(function(h){var l=window.AmazonUIPageJS||window.P,q=l._namespace||l.attributeErrors,f=q?q("AmazonDevicesDetailPageUtilityAssets",""):l;f.guardFatal?f.guardFatal(h)(f,window):f.execute(function(){h(f,window)})})(function(h,l,q){h.when("A").execute(function(f){f.declarative("popup-window","click",function(d){var b=d.data.windowName||"popupWindow",a=d.data.windowOptions||"width\x3d600,height\x3d400,scrollbars\x3dyes";d.$event.preventDefault();l.open(d.$target.prop("href"),b,a)})});"use strict";h.when("A").register("ods-element-factory", function(f){var d=f.$;return{getHiddenInput:function(b,a){return d("\x3cinput\x3e").prop("name",b).prop("type","hidden").prop("value",a)}}});"use strict";h.register("ods-url-utils",function(){return{getUrlParam:function(f){for(var d=null,b=l.location.search.substr(1).split("\x26"),a=0;a<b.length;a++){var c=b[a].split("\x3d");c[0]===f&&(d=c[1])}return d}}});"use strict";h.when("A").register("csmCounter",function(f){var d=f.$;return{register:function(b,a,c){b&&a&&c&&d(b).bind(a,d.proxy(this.increment, this,c))},increment:function(b){b&&l.ue.count(b,(l.ue.count(b)||0)+1)},update:function(b,a){b&&"number"===typeof a&&l.ue.count(b,a)}}});"use strict";h.register("function-utils",function(){return{throttle:function(f,d,b){var a,c,e,k=null,g=0;b||(b={});var m=function(){g=!1===b.leading?0:(new Date).getTime();k=null;e=f.apply(a,c);k||(a=c=null)};return function(){var t=(new Date).getTime();g||!1!==b.leading||(g=t);var h=d-(t-g);a=this;c=arguments;0>=h||h>d?(k&&(clearTimeout(k),k=null),g=t,e=f.apply(a, c),k||(a=c=null)):k||!1===b.trailing||(k=setTimeout(m,h));return e}},debounce:function(f,d,b){var a;return function(){var c=this,e=arguments;clearTimeout(a);a=setTimeout(function(){a=null;b||f.apply(c,e)},d);b&&!a&&f.apply(c,e)}},memoize:function(f,d){var b={};return function(){for(var a=0<arguments.length?"":"%NO_ARGUMENTS%",c=0;c<arguments.length;c++)a&&(a+="-"),a+="object"===typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c];b.hasOwnProperty(a)||(b[a]=d.apply(f,arguments));return b[a]}}}}); "use strict";h.when("A","csmCounter").register("odsRefTagUtils",function(f,d){var b=f.$;return{send:function(a,c){if(!a)throw d.increment("odsRefTagUtils_reftag_undefined"),Error("refTag is not defined");b.get((c||"/hctp/log/refMarker")+"?ref_\x3d"+a);d.increment("odsRefTagUtils_csm_counter")}}});"use strict";h.when("A").register("ods-image-utilities",function(f){function d(a,c){var e=new Image;e.onload=function(){c.resolve(a)};e.onerror=function(){c.reject(a)};e.src=a}var b=f.$;return{preloadImage:function(a, c){var e=b.Deferred();d(a,e);if(c&&f.capabilities.hires){var k=b.Deferred();d(c,k)}return{image:e.promise(),hiResImage:k?k.promise():q}},preloadImages:function(a){for(var c=[],e=0;e<a.length;e++){var k=b.Deferred();d(a[e],k);c.push(k.promise())}return c}}});"use strict";h.when("A").register("ODSEventDispatcher",function(f){return f.createClass({init:function(){this._callbacks={}},registerCallback:function(d,b){var a=this._callbacks[d]||[];-1===a.indexOf(b)&&a.push(b);this._callbacks[d]=a},unregisterCallback:function(d, b){if(d=this._callbacks[d])b=d.indexOf(b),-1<b&&d.splice(b,1)},dispatch:function(d){var b=this._callbacks[d];if(b)for(var a=0;a<b.length;a++)b[a].apply(this,Array.prototype.slice.call(arguments,1))}})});"use strict";h.when("A","jQuery").register("BuyboxManagerFactory",function(f,d){function b(c,a,b,g){var e=f.copy(b);d.each(e,function(e){-1===["initialize","reset"].indexOf(e)&&(c[e]=g?d.proxy(a,null,e):d.proxy(b,e))})}function a(c,a,k,g){var e=function(m){if(!h&&(g?(g.initialize(),b(f,e,g,!1)):p= new k,h=new a(p),d.each(c,function(a,c){f[c]=d.proxy(h,c)}),"string"===typeof m))return f[m].apply(h,Array.prototype.slice.call(arguments,1))},f={reset:function(){h?(g&&g.reset(),p&&p.reset(),h.reset()):e()},initialize:e},h,p;g&&b(f,e,g,!0);d.each(c,function(c,a){f[a]=d.proxy(e,null,a)});return f}return{create:function(c,e,b){return a(c,e,b)},extend:function(c,e,b){return a(c,e,null,b)}}});"use strict";h.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerFormHelper",function(f,d){function b(a, c){return'\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+c+'" /\x3e'}function a(a){return 0<=a.attr("id").search("buyNow")}function c(a){return 0<=a.attr("id").search("addToCart")||0<=a.attr("id").search("mobile-installments")}function e(a,c){return f.map(a,function(a){return f(a).attr(c)})}'input[name\x3d"%NAME%"]'.replace("%NAME%","verificationSessionID");var k='input[name\x3d"%NAME%"]'.replace("%NAME%","a"),g='input[name\x3d"%NAME%"]'.replace("%NAME%","oid"),m='input[name\x3d"%NAME%"]'.replace("%NAME%", "quantity"),h='input[name\x3d"%NAME%"]'.replace("%NAME%","asin"),r='input[name\x3d"%NAME%"]'.replace("%NAME%","offeringID"),p='input[name\x3d"%NAME%"]'.replace("%NAME%","quantity"),l=[k,g,m].concat([h,r,p]).join(", ");return{removeAllFormFields:function(a){a.find(l).remove()},getHiddenInputHTML:b,isFormBuyNow:a,isFormAddToCart:c,createMobileAppFormInputs:function(a){var c=a[0];if(c){var e=c.asin;var k=c.offerId;var g=c.quantity}for(c=1;c<a.length;c++)e+="|"+a[c].asin,k+="|"+a[c].offerId,g+="|"+a[c].quantity; return""+(b("asin",e)+b("offeringID",k)+b("quantity",g))},getViewData:function(b){if(a(b)){var f=e(b.find(h),"value")[0].split("|"),n=e(b.find(r),"value")[0].split("|");b=e(b.find(p),"value")[0].split("|");return d.buildRawData(f,n,b)}if(c(b))return f=e(b.find(k),"value"),n=e(b.find(g),"value"),b=e(b.find(m),"value"),d.buildRawData(f,n,b);throw Error("Add to order button not handled in buyBoxManagerFormHelper");},updateMobileAppFormInputsWithSubscriptionData:function(a,c,e){if(!f.isEmptyObject(a._digitalSubscriptionAsinMap)){var k= [],g=a._digitalSubscriptionAsinMap,d;for(d in g)if(g.hasOwnProperty(d)){var n=g[d],m=n.name;n=n.value;k.push('input[name\x3d"%NAME%"]'.replace("%NAME%",m));k.push('input[name\x3d"%NAME%"]'.replace("%NAME%",n));delete g[d]}m=k.join(",");e.find(m).remove();a._digitalSubscriptionAsinMap=g}e="";for(g=1;g<c.length;g++)c[g].customAttribute&&(m="custom-name.%INDEX.1".replace("%INDEX",g),n="custom-value.%INDEX.1".replace("%INDEX",g),k=c[g],e+=b(m,k.customAttribute.name)+b(n,k.customAttribute.value),a._digitalSubscriptionAsinMap|| (a._digitalSubscriptionAsinMap={}),a._digitalSubscriptionAsinMap[k.asin]={index:g,name:m,value:n});return e}}});"use strict";h.when("A","jQuery","BuyboxManagerViewBase").register("BuyboxManagerView",function(f,d,b){return b.extend({init:function(){this._super()},moveFieldsToContainer:function(a,c){for(var e=1,b=[],g;g===q||0<g.length;)g=a.find(this.getHiddenSelector("ASIN."+e)),0<g.length&&b.push(g.get(0),a.find(this.getHiddenSelector("offerListingID."+e)).get(0),a.find(this.getHiddenSelector("quantity."+ e)).get(0)),e++;c.append(b)},render:function(a){this._super(a);var c=this;this.$forms.each(function(e){var b=d(this),g=b.find('input[type\x3d"hidden"][name^\x3d"ASIN."]'),f=d.isArray(a)?a.length:0,h=c.$fieldsContainers.get(e);g.each(function(){var a=d(this);if(!a.parent().is(h)){var e=c._getAsinIndex(a);f++;a.prop("name","ASIN."+f);b.find('input[type\x3d"hidden"][name\x3d"offerListingID.'+e+'"]').prop("name","offerListingID."+f);b.find('input[type\x3d"hidden"][name\x3d"quantity.'+e+'"]').prop("name", "quantity."+f)}})})},buildHTML:function(a,c){return this.getHiddenInputHTML("ASIN."+c,a.asin)+this.getHiddenInputHTML("offerListingID."+c,a.offerId)+this.getHiddenInputHTML("quantity."+c,a.quantity)},getDataFromDOM:function(){var a=[],c=this.$fieldsContainers.first(),e=this;c.find('input[type\x3d"hidden"][name^\x3d"ASIN."]').each(function(){var b=d(this),g=e._getAsinIndex(b);a.push({asin:b.val(),offerId:c.find(e.getHiddenSelector("offerListingID."+g)).val(),quantity:parseInt(c.find(e.getHiddenSelector("quantity."+ g)).val(),10)})});return a},_getAsinIndex:function(a){return parseInt(a.prop("name").substring(5),10)}})});"use strict";h.when("A","BuyboxNatcMobileweb","jQuery").register("BuyboxManagerViewBase",function(f,d,b){return f.createClass({init:function(){this.reset()},registerAtcBtn:function(a){this.$atcBtns=this.$atcBtns.add(a)},registerForm:function(a){a="string"===typeof a?b(a):a;if(a instanceof b&&0<a.length&&0===this.$forms.has(a).length){this.$forms=this.$forms.add(a);var c=this.createFieldsContainer(a); this.moveFieldsToContainer(a,c)}},createFieldsContainer:function(a){var c=a.find(".buyboxManagerHiddenFieldsContainer");0===c.length&&(c=b('\x3cdiv class\x3d"buyboxManagerHiddenFieldsContainer"\x3e'),a.append(c));0===this.$fieldsContainers.has(c).length&&(this.$fieldsContainers=this.$fieldsContainers.add(c));return c.first()},moveFieldsToContainer:function(a,c){throw Error("The view must override the moveFieldsToContainer function");},getHiddenSelector:function(a,c){var e='input[type\x3d"hidden"]'; "string"===typeof a&&(e+='[name\x3d"'+a+'"]');"string"===typeof c&&(e+='[value\x3d"'+c+'"]');return e},getHiddenInputHTML:function(a,c){return'\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+c+'" /\x3e'},render:function(a){this.appendFormData(a)},appendFormData:function(a,c){c=c||1;var e="";if(b.isArray(a))for(var k=0;k<a.length;k++)e+=this.buildHTML(a[k],c+k);this.$fieldsContainers.html(e)},appendFormDataNatc:function(a,c){var e="";c.find('input[type\x3d"hidden"].ATCFormUpsellAsinData').remove(); if(b.isArray(a))for(var k=1;k<a.length;k++)e+=d.buildNatcHTML(a[k],k);c.append(e)},reset:function(){this.$forms=b();this.$fieldsContainers=b();this.registerForm(b("#addToCart"));b("#mobile-installments")&&this.registerForm(b("#mobile-installments"));this.$atcBtns=b();this.registerAtcBtn(b("#add-to-cart-button"));this.registerAtcBtn(b("#bb_to_cfg_button"));this.registerAtcBtn(b("#buy-now-button"));b("#installments-button").length&&this.registerAtcBtn(b("#installments-button"))}})});"use strict";h.when("jQuery").register("BuyboxManagerViewHelper", function(f){var d={FORM:"form",AW_MASH:"aw_mash",SHOW_HCTP_ATTACH:"show-hctp-attach",UNKNOWN:q};return{ViewType:d,getAtcBtnViewType:function(b){var a=d.UNKNOWN;b instanceof f||(b=f(b));var c=b.closest('.a-declarative[data-action\x3d"aw-mash"]'),e=b.closest('.a-declarative[data-action\x3d"show-hctp-attach"]');return 0<c.length?d.AW_MASH:0<b.closest("form").length?d.FORM:0<e.length?d.SHOW_HCTP_ATTACH:a},buildRawData:function(b,a,c){var e={},k=[];f.each(b,function(b,d){var g=a.length>b?a[b]:"";b=c.length> b?parseInt(c[b],10):1;var f=d+":"+g;e.hasOwnProperty(f)?k[e[f]].quantity+=b:e[f]=k.push({asin:d,offerId:g,quantity:b})-1});return k}}});"use strict";h.when("A","jQuery","ODSEventDispatcher","ods-url-utils","BuyboxManagerViewBase").register("BuyboxManagerController",function(f,d,b,a,c){return f.createClass({init:function(a){if(!(a instanceof c))throw new TypeError("The view must inherits from BuyboxManagerViewBase");this._view=a;this._eventDispatcher=new b;this._enableEvents(!0);this.reset();var e= this;f.on("a:dropdown:mobileQuantityDropDown:select",function(a){e.setPageAsinQuantity(parseInt(a.value,10))});this._isFreeFormQuantityPickerPresent()&&this._makeAwareOfFreeFormQuantity()},_enableEvents:function(a){d.each("UpsellAsinAdded UpsellAsinRemoved UpsellAsinChanged PageAsinAdded PageAsinReplaced PageAsinChanged".split(" "),d.proxy(function(c,e){a?(this["register"+e]=d.proxy(this._eventDispatcher,"registerCallback",e),this["unregister"+e]=d.proxy(this._eventDispatcher,"unregisterCallback", e)):(delete this["register"+e],delete this["unregister"+e])},this))},_parseInitialAsins:function(){var a=this._view.getDataFromDOM();if(a)for(var c=0;c<a.length;c++)this[0===c?"setPageAsin":"setUpsellAsin"](a[c].asin,a[c].offerId,a[c].quantity)},_dispatchSetUpsellAsinEvents:function(a,c,b,d){d!==b&&(0===d&&0<b?this._eventDispatcher.dispatch("UpsellAsinAdded",a,c,b,d):0===b&&0<d&&this._eventDispatcher.dispatch("UpsellAsinRemoved",a,c,b,d),this._eventDispatcher.dispatch("UpsellAsinChanged",a,c,b,d))}, _indexOfAsin:function(a,c){c=c||"";for(var b=0;b<this._asinsData.length;b++)if(this._asinsData[b].asin===a&&this._asinsData[b].offerId===c)return b;return-1},_isFreeFormQuantityPickerPresent:function(){return 0<d('select[id$\x3d"-predefinedQuantitiesDropdown"]').length},_makeAwareOfFreeFormQuantity:function(){var c=this;f.on("buyBoxQuantityChanged",function(a,b){c.setPageAsinQuantity(b)});var b=parseInt(a.getUrlParam("qty"),10);b&&c.setPageAsinQuantity(b)},setUpsellAsin:function(a,c,b,d){if("string"!== typeof a||0>=a.length)throw new TypeError("The asin argument is required");var e=this._indexOfAsin(a,c),k=0;c=c||"";b="number"===typeof b?Math.max(0,b):1;if(0===e)throw Error("To modify the pageAsin, use setPageAsin() instead.");if(0<e)d=this._asinsData[e],k=d.quantity,0>=b?this._asinsData.splice(e,1):d.quantity=b;else if(0<b)this._asinsData.push({asin:a,offerId:c,quantity:b,customAttribute:d});else return!1;this.render();this._dispatchSetUpsellAsinEvents(a,c,b,k,e);return!0},updateSelectedAsinsQuantity:function(a){if(1> a)throw Error("New quantity for upsell asins must be greater than 0.");for(var c=1;c<this._asinsData.length;c++)this._asinsData[c].quantity=a;this.render()},registerForm:function(a){this._view.registerForm(a);this.render()},registerAtcBtn:function(a){this._view.registerAtcBtn(a);this.render()},setPageAsin:function(a,c,b){if("string"!==typeof a||0>=a.length)throw new TypeError("The asin argument is required");var e=this._indexOfAsin(a,c),d=0<this._asinsData.length?this._asinsData[0].quantity:0;c=c|| "";if(0>=b)throw new TypeError("The quantity of the page asin must be \x3e 0.");b="number"===typeof b?Math.max(1,b):1;if(0===e&&b===d)return!1;0<e&&this.setUpsellAsin(a,c,0);this._asinsData[0]={asin:a,offerId:c,quantity:b};this.render();-1<e?this._eventDispatcher.dispatch("PageAsinReplaced",a,c,b,d):this._eventDispatcher.dispatch("PageAsinAdded",a,c,b);this._eventDispatcher.dispatch("PageAsinChanged",a,c,b);return!0},setPageAsinQuantity:function(a){var c=this._asinsData&&this._asinsData.length&&this._asinsData[0]; c&&this.setPageAsin(c.asin,c.offerId,a)},addUpsellAsin:function(a,c,b){b=b||1;for(var e=0;e<this._asinsData.length;e++){var d=this._asinsData[e];if(d.asin===a){this.setUpsellAsin(a,c,d.quantity+b);return}}this.setUpsellAsin(a,c,b)},render:function(){this._view.render(this._asinsData)},getAsins:function(){return f.copy(this._asinsData)},getUpsellAsins:function(){var a=this.getAsins();a.splice(0,1);return a},resetUpsellAsins:function(){this._asinsData=[this._asinsData[0]];return f.copy(this._asinsData)}, getPageAsin:function(){return f.copy(this._asinsData[0])},getPageQuantityDropdown:function(){return d("#buybox").find('select[name\x3d"quantity"]')},reset:function(){this._asinsData=[];this._parseInitialAsins()}})});"use strict";h.when("BuyboxManagerController","BuyboxManagerView","BuyboxManagerFactory","jQuery").register("BuyboxManager",function(f,d,b,a){return b.create("getAsins getUpsellAsins setUpsellAsin resetUpsellAsins getPageAsin setPageAsin registerUpsellAsinChanged registerUpsellAsinAdded registerUpsellAsinRemoved registerPageAsinChanged registerPageAsinAdded registerPageAsinReplaced unregisterUpsellAsinChanged unregisterUpsellAsinRemoved unregisterUpsellAsinAdded unregisterPageAsinChanged unregisterPageAsinAdded unregisterPageAsinReplaced addUpsellAsin registerForm registerAtcBtn updateSelectedAsinsQuantity getPageQuantityDropdown".split(" "), f,d)});"use strict";h.when("A").register("BuyboxNatcMobileweb",function(f){return{buildNatcHTML:function(d,b){return""+(this.getHiddenInputHTMLNatc("items["+b+".upsell][asin]",d.asin)+this.getHiddenInputHTMLNatc("items["+b+".upsell][offerListingId]",d.offerId)+this.getHiddenInputHTMLNatc("items["+b+".upsell][quantity]",d.quantity))},getHiddenInputHTMLNatc:function(d,b){return'\x3cinput type\x3d"hidden" name\x3d"'+d+'" value\x3d"'+b+'" class\x3d"ATCFormUpsellAsinData" /\x3e'}}});"use strict";h.when("jQuery").register("BuyboxNatcMobileapp", function(f){return{createInputs:function(d){var b={};f.each(d,function(a,c){0!==a&&(b["items["+a+".upsell][asin]"]=c.asin,b["items["+a+".upsell][offerListingId]"]=c.offerId,b["items["+a+".upsell][quantity]"]=c.quantity)});return b}}});"use strict";h.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerMashHelper",function(f,d){return{createInputs:function(b){var a={a:[],oid:[],quantity:[]};f.each(b,function(c,b){a.a.push(b.asin);a.oid.push(b.offerId);a.quantity.push(b.quantity)});a.a=a.a.join("|"); a.oid=a.oid.join("|");a.quantity=a.quantity.join("|");return a},getViewData:function(b){var a=b.inputs.a.split("|"),c=b.inputs.oid.split("|");b=b.inputs.quantity.split("|");return d.buildRawData(a,c,b)},setDeclarativeMultiple:function(b){b.buttonID="add-multiple-to-cart"},getDeclarativeDataFromBtn:function(b){return b.closest('.a-declarative[data-action\x3d"aw-mash"]').data("awMash")},isAddToCart:function(b){return"add-to-cart"===b.buttonID},updateInputWithSubscriptionData:function(b,a,c){if(!f.isEmptyObject(b._digitalSubscriptionAsinMap)){var e= b._digitalSubscriptionAsinMap,d;for(d in e)if(e.hasOwnProperty(d)){var g=e[d],h=g.index;if(c.length<=h||c[h].asin!==d)a[g.name]&&delete a[g.name],a[g.value]&&delete a[g.value],delete e[d]}b._digitalSubscriptionAsinMap=e}f.each(c,function(c,e){if(e.customAttribute){var d="custom-name."+(c+1)+".1",f="custom-value."+(c+1)+".1";a[d]=e.customAttribute.name;a[f]=e.customAttribute.value;b._digitalSubscriptionAsinMap||(b._digitalSubscriptionAsinMap={});b._digitalSubscriptionAsinMap[e.asin]={index:c,name:d, value:f}}})}}});"use strict";h.when("ODSBuyboxManagerController","BuyboxManager","BuyboxManagerFactory","A","jQuery").register("ODSBuyboxManager",function(f,d,b,a,c){return b.extend(["addMetadata","getMetadata","getAsins","getPageAsin","getUpsellAsins"],f,d)});"use strict";h.when("BuyboxManager","ODSBuyboxAsinMetadata","A","jQuery").register("ODSBuyboxManagerController",function(f,d,b,a){return b.createClass({init:function(){this.reset()},addMetadata:function(a){if(!(a instanceof d))throw Error("The argument metadata must be an instance of ODSBuyboxAsinMetadata"); if(!a.isValid())throw Error("The metadata is NOT valid");this._metadatas[a.asin+":"+a.offerId]=a.clone()},getMetadata:function(a,b){return this._metadatas[a+":"+b]},getMetadatas:function(){return b.copy(this._metadatas)},enhanceAsinsData:function(c){if("undefined"!==typeof c&&null!==c&&0!==c.length){var b=this;a.isArray(c)?c=a.map(c,function(c){return a.extend({},c,{metadata:b.getMetadata(c.asin,c.offerId)})}):c.metadata=b.getMetadata(c.asin,c.offerId)}return c},getPageAsin:function(){return this.enhanceAsinsData(f.getPageAsin())}, getUpsellAsins:function(){return this.enhanceAsinsData(f.getUpsellAsins())},getAsins:function(){return this.enhanceAsinsData(f.getAsins())},reset:function(){this._metadatas={}}})});"use strict";h.when("A","jQuery").register("ODSBuyboxAsinMetadata",function(f,d){var b=f.createClass({init:function(a,c,b,d,f,h,l){this.asin=a;this.offerId=c;this.buyingPrice=b;this.listingPrice=d;this.title=f;this.imageUrl=h;this.availabilityMessage=l},isValid:function(){var a="string"===typeof this.asin&&0<this.asin.length; return"number"===typeof this.buyingPrice&&a},clone:function(){return new b(this.asin,this.offerId,this.buyingPrice,this.listingPrice,this.title)}});return b});"use strict";h.when("A","jQuery","a-modal").register("singleton-popup-modal",function(f,d,b){function a(a){null===g?(k=e.appendTo(d("body")),g=b.create(k,a)):g.update(a);g.show()}function c(){g&&g.hide()}var e=d('\x3cdiv style\x3d"display:none"\x3e'),k=null,g=null;f.declarative("cfg-singleton-modal-close","click",c);f.declarative("cfg-singleton-modal-open", "click",function(c){a({inlineContent:c.data.inlineContent,header:c.data.header,width:c.data.width||"502",position:"triggerRight"},!0)});return{show:a,hide:c,destroy:function(){g&&(b.remove(g),g=null)}}});"use strict";h.when("A").register("MakoCommonCartHelper",function(f){var d=f.$,b=f.createClass({init:function(a,c,b,d){this.sessionId=a||"";this.clientName=c||"";this.asinsData=b||[];this.additionalData=d||{};this.reftag;this.hasBeenPosted=!1},setSessionId:function(a){this.sessionId=a;return this}, setClientName:function(a){this.clientName=a;return this},setAsinsData:function(a){if(Array.isArray(a))return this.asinsData=a,this},addAsinData:function(a,c,b){this.asinsData.push({asin:a,offerId:c,quantity:b});return this},setAdditionalData:function(a){this.additionalData=a;return this},setReftag:function(a){this.reftag=a;return this},sendRequest:function(){if(this.hasBeenPosted)h.log("Request has already been sent.","WARN");else if(this._verifyRequest()){var a=this._buildRequestData();this.hasBeenPosted= !0;a=d.ajax({url:"/gp/add-to-cart/json/"+(this.reftag?"ref\x3d"+this.reftag:""),type:"POST",data:a});a.done(function(a){f.trigger("mako:common-cart-request:complete",a)});return a}},_verifyRequest:function(){var a=!0;this.sessionId&&""!==this.sessionId||(a=!1,h.log("SessionId is undefined or blank","WARN"));this.asinsData&&this.asinsData.length||(a=!1,h.log("No asins data exist for cart handler request","WARN"));return a},_buildRequestData:function(){var a={};a.verificationSessionID=this.sessionId; a.clientName=this.clientName;for(var c=0;c<this.asinsData.length;c++){var b=this.asinsData[c];a["asin."+c]=b.asin;a["offeringID."+c]=b.offerId||b.offerListingID;a["quantity."+c]=b.quantity}if(this.additionalData)for(var d in this.additionalData)this.additionalData.hasOwnProperty(d)&&(a[d]=this.additionalData[d]);return a}});return{createRequest:function(a,c){a||h.log("Cannot find session-id and attempting to add to cart without session-id","FATAL");return new b(a,c)}}});"use strict";h.when("A").register("MakoAmazonApiAddToCartHelper", function(f){var d=f.$,b=["true","false"],a=f.createClass({init:function(a,b,d){this.csrfToken=a||"";this.marketplace=b||"";this.ajaxEndpoint=d||"";this.asinDataList=[];this.refTag=""},setAsinDataList:function(a){if(Array.isArray(a))return this.asinDataList=a,this},addSingleAsinData:function(a){if(a.asin&&a.offerId&&a.quantity)return this.asinDataList.push(a),this;h.log("asin, offerListingId or quantity of single asinData is empty","FATAL")},setRefTag:function(a){this.refTag=a;return this},sendRequest:function(a, b){var c=this;this.asinDataList.length?d.ajax({url:this.constructAjaxUrl(),type:"POST",data:this.constructAddToCartRequest(this.asinDataList),xhrFields:{withCredentials:!0},headers:{"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":this.csrfToken,"x-amzn-encrypted-slate-token":d('meta[name\x3d"encrypted-slate-token"]').prop("content")},success:function(d){c.verifyCartApiResponse(d)? a(d):b()},error:b}):(h.log("Invalid request with an empty asin list to CartAPI","FATAL"),b())},verifyCartApiResponse:function(a){return"cart.add-items/v1"===a.type&&"items"in a.entity&&0<a.entity.items.length&&"id"in a.entity.items[0]&&this.isCartCountResponseValid(a.entity.count)},isCartCountResponseValid:function(a){return a&&"cart.count/v1"===a.type&&"items"in a.entity},constructAjaxUrl:function(){var a="https://"+this.ajaxEndpoint+"/api/marketplaces/"+this.marketplace+"/cart/carts/retail/items"; this.refTag&&(a+="?ref_\x3d"+this.refTag);return a},constructAddToCartRequest:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],f={asin:d.asin,offerListingId:d.offerId,quantity:d.quantity};d=this.formatBooleanParams(d);d=this.constructAdditionalParameters(d);if(d.hasOwnProperty("giftOptions")||d.hasOwnProperty("devicePreregistration")||d.hasOwnProperty("installments")||d.hasOwnProperty("incentivizedCart")||d.hasOwnProperty("paymentOfferInfo"))f.additionalParameters=d;b.push(f)}return JSON.stringify({items:b})}, constructAdditionalParameters:function(a){var b={};a.hasOwnProperty("isToBeGiftWrapped")&&"boolean"===typeof a.isToBeGiftWrapped&&(b.giftOptions={includeGiftReceipt:a.isToBeGiftWrapped});a.hasOwnProperty("isDevicePreRegistered")&&"boolean"===typeof a.isDevicePreRegistered&&(b.devicePreregistration={selected:a.isDevicePreRegistered});a.hasOwnProperty("programId")&&a.programId.length&&(b.installments={programId:a.programId});a.hasOwnProperty("incentivizedCart")&&a.incentivizedCart.length&&(b.incentivizedCart= a.incentivizedCart);a.hasOwnProperty("paymentOfferInfo")&&a.paymentOfferInfo.length&&(b.paymentOfferInfo=a.paymentOfferInfo);return b},formatBooleanParams:function(a){for(var c in a)if(a.hasOwnProperty(c)&&"string"===typeof a[c]){var d=a[c].toLowerCase();-1!==b.indexOf(d)&&(a[c]="true"===d)}return a}});return{createRequest:function(b,d,f){return new a(b,d,f)}}});"use strict";h.when().register("ExtraDataHelper",function(){function f(a,b){return a&&a.name&&0===a.name.indexOf(b)}function d(a,b){var c= Array.prototype.slice.call(a.elements);a=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&f(a,["custom-name",b,""].join("."))});c=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&f(a,["custom-value",b,""].join("."))});return{names:a,values:c}}function b(a,b){return a!==q&&null!==a?a:b}function a(a,c,d){c=b(c,"([0-9]+)");d=b(d,"([0-9]+)");return new RegExp([a,c,d].join("."))}function c(a,b){var c=document.createElement("input");c.type="hidden"; c.name=a;c.value=b;return c}function e(b,c,d,e){var f=a("custom-name",b);return c.reduce(function(a,c){var g=f.exec(c);if(g){g=g[1];var n=["custom-value",b,g].join(".");a[g]={name:d(c),value:e(n)}}return a},{})}function h(a,b,c,d){Object.keys(b).forEach(function(e){var f=b[e],g=["custom-name",a,e].join(".");e=["custom-value",a,e].join(".");"object"===typeof f&&(c(g,f.name),d(e,f.value))})}function g(a,b){var c=Object.keys(a),d=function(b){return a[b]};return e(b,c,d,d)}function m(a,b,c){var d=function(b, c){a[b]=c};h(c,b,d,d)}function l(a,b){a=d(a,b);var c=a.names.map(function(a){return a.name}),f=function(a){return function(b){var c=a.filter(function(a){return a.name===b});return c.length?c[0].value:q}};return e(b,c,f(a.names),f(a.values))}function r(a,b,e){var f=d(a,e),g=function(b){return function(d,e){var f=b.filter(function(a){return a.name===d});f.length?f.forEach(function(a){a.value=e}):a.appendChild(c(d,e))}};h(e,b,g(f.names),g(f.values))}function p(a){return Object.keys(a).reduce(function(b, c){c=a[c];b[c.name]=c.value;return b},{})}function u(a,b){var c=Object.keys(a).reduce(function(b,c){c=a[c];b[c.name]=c;return b},{});Object.keys(b).forEach(function(d){if(c[d])c[d].value=b[d];else{var e=w(a),f={name:d,value:b[d]};a[e]=f;c[d]=f}});return a}function v(a,b){return a-b}function w(a){a=Object.keys(a).map(function(a){return parseInt(a)}).sort(v);if(a.length){if(1!==a[0])return 1;for(var b=1;b<a.length;b++)if(1!==a[b]-a[b-1])return a[b-1]+1;return a.length+1}return 1}return{getObjectExtraData:function(a, c){c=b(c,1);return p(g(a,c))},setObjectExtraData:function(a,c,d){d=b(d,1);c=u(g(a,d),c);m(a,c,d)},getFormExtraData:function(a,c){if(!a)return{};c=b(c,1);return p(l(a,c))},setFormExtraData:function(a,c,d){a&&(d=b(d,1),c=u(l(a,d),c),r(a,c,d))}}})}); /* ******** */ (function(l){var r=window.AmazonUIPageJS||window.P,x=r._namespace||r.attributeErrors,f=x?x("DetailPageAccessoryUpsellAssets",""):r;f.guardFatal?f.guardFatal(l)(f,window):f.execute(function(){l(f,window)})})(function(l,r,x){l.when("desktop-accessory-upsell-model","desktop-accessory-upsell-view","desktop-accessory-upsell-controller").register("desktop-accessory-upsell-factory",function(f,d,a){return{get:function(e,g){var v=new d(e);g=new f(g);return new a(e,v,g)}}});"use strict";l.when("A").register("desktop-accessory-upsell-model", function(f){var d=f.$;return f.createClass({init:function(a){this._accessoryCampaignData=a.accessoriesCampaignSource;this._asinsData=a.asinsData;this._primaryAsin=a.primaryAsin;this._buildScheduledAsinCache(this._asinsData)},getAsinsData:function(){return this._asinsData},getAccessoryCampaignData:function(){return this._accessoryCampaignData},getPrimaryAsin:function(){return this._primaryAsin},getInterstitialAsinsData:function(){var a=d.extend({},this._asinsData);Object.keys(a).forEach(function(e){a[e][e]&& (a[e][e].isInterstitial=!0)});return a},getScheduledAsinFromVariationAsin:function(a){return this._scheduledAsins[a]},getVariationAsinsFromScheduledAsin:function(a){return this._scheduledVariationsAsins[a]},_buildScheduledAsinCache:function(a){this._scheduledAsins={};this._scheduledVariationsAsins={};this._interstitialAsinsData={};for(var e in a)if(a.hasOwnProperty(e)){this._scheduledVariationsAsins[e]=[];for(var g in a[e])a[e].hasOwnProperty(g)&&(this._scheduledVariationsAsins[e].push(g),this._scheduledAsins[g]= e,a[e][g].isInterstitial&&(this._interstitialAsinsData[e]=a[e]))}}})});"use strict";l.when("a-modal","A").register("desktop-accessory-upsell-view",function(f,d){return d.createClass({init:function(a){this.$el=a},_getOptionElement:function(a){return this.$el.find("#abb-option-"+a)},_updateOptionRow:function(a){var e=this._getOptionElement(a.optionAsin);e.find(".abb-selected-variation").html(a.variationText);e.find(".abb-option-list-price").html(a.listPriceString);e.find(".abb-option-list-price-label").html(a.listPriceLabel); e.find(".abb-option-buying-price").html(a.buyingPriceString)},_toggleProduct:function(a){var e=this._getOptionElement(a.optionAsin).find(".abb-option-checkbox input[type\x3d'checkbox']");a.isProductSelected?e.attr("checked",!0):e.removeAttr("checked");this.$el.trigger("change")},_hidePopover:function(a){a=this.$el.find("#abb-popover-trigger-"+a.optionAsin);(a=f.get(a))&&a.hide()},render:function(a){this._toggleProduct(a);a.isProductSelected&&(this._updateOptionRow(a),this._hidePopover(a))},deselectAllProducts:function(){this.$el.find(".abb-option-checkbox input[type\x3d'checkbox']").removeProp("checked")}})}); "use strict";l.when("desktop-accessory-upsell-product-factory","desktop-accessory-upsell-interstitial-factory","desktop-accessory-upsell-ref-helper","accessory-upsell-dom-helper","accessory-upsell-buybox-helper","A").register("desktop-accessory-upsell-controller",function(f,d,a,e,g,v){var k=v.$;return v.createClass({init:function(m,c,b){this.$el=m;this._view=c;this._model=b;this._subControllers={};this._interstitialController;g.reset();e.processMarkupForDabb();g.parsePageAsin();m=0;c=this._model.getAsinsData(); g.registerAccessoryUpsellData(c);for(var h in c)c.hasOwnProperty(h)&&(c[h]&&c[h][h]?a.sendAsinScheduled(m,h,c[h][h].isAutomated):a.sendAsinScheduled(m,h,!1),b=f.get(h,c[h],m),b.setOnOrderUpdate(k.proxy(this._handleOrderUpdate,this)),this._subControllers[h]=b,m++);a.addCountMetric("DesktopMarsABBCount");h=this._model.getInterstitialAsinsData();this._interstitialController=d.get(h);this._bindEvents();this._updateDefaultCheckedAccessories()},_bindEvents:function(){var a=this;l.when("ready").execute("accessory-upsell-controller-bindEvents", function(){a._loadSubControllerInitialImages.apply(a);a._interstitialController&&a._interstitialController.loadInitialImages();e.getPageQuantityDropdown().change(function(){var c=a._parseQuantity(k(this).val());g.updateSelectedAsinsQuantity(c)})});this._bindedFn={handleCheckboxChange:k.proxy(this._handleCheckboxChange,this),onBuyboxUpsellAsinsChanged:k.proxy(this._onBuyboxUpsellAsinsChanged,this)};this._enableEvents(!0);e.getGiftWrapUpdate().change(function(){g.updateGiftCheck()})},_enableEvents:function(a){a= a?"":"un";g[a+"registerUpsellAsinRemoved"](this._bindedFn.onBuyboxUpsellAsinsChanged);g[a+"registerUpsellAsinAdded"](this._bindedFn.onBuyboxUpsellAsinsChanged);this.$el[a+"delegate"](".abb-option-checkbox input[type\x3d'checkbox']","change",this._bindedFn.handleCheckboxChange)},_addAsin:function(a,c,b){var h=this._model.getScheduledAsinFromVariationAsin(a);this._model.getVariationAsinsFromScheduledAsin(h);g.addUpsellAsin(a,c,b)},_onBuyboxUpsellAsinsChanged:function(a,c,b){c=this._model.getScheduledAsinFromVariationAsin(a); var h=this._subControllers[c];b=0<b;h&&(h.setAddedToOrderState(b),b&&h.selectAsin(a),this._internalRender(c,h.getCurrentProduct(),b))},_handleCheckboxChange:function(d,c,b){c=c||k(d.currentTarget);d=c.parents(".abb-option").data("asin");var h=c.is(":checked");c=this._subControllers[d];var y=c.getIndex(),p=c.getCurrentProduct();c.setAddedToOrderState(h);h?(h=this._parseQuantity(e.getPageQuantityDropdown().val()),this._addAsin(p.asin,p.offerListingID,h),a.sendCheckboxSelected(y,p.asin,p.isAutomated)): (g.removeUpsellAsin(p.asin,p.offerListingID),a.sendCheckboxDeselected(y,p.asin,p.isAutomated));b||!p.checkForInteraction||p.hasBeenInteractedWith||c.setHasBeenInteractedWith(d)},_handleOrderUpdate:function(a,c){a=this._parseQuantity(k('#addToCart select[name\x3d"quantity"]').val());this._addAsin(c.asin,c.offerListingID,a)},_internalRender:function(a,c,b){a=this._generateOptionViewModel(a,c,b);this._view.render(a)},_generateOptionViewModel:function(a,c,b){var h=!1,g="",e="",d="",f="";c&&(g=(h=c.showPriceStrikethrough)? c.listPrice:"",c.showPriceStrikethrough&&c.listingPriceLabel&&(e=c.listingPriceLabel),d=c.buyingPrice,f=c.swatchValue);return{optionAsin:a,isProductSelected:b,isOnSale:h,listPriceString:g,listPriceLabel:e,buyingPriceString:d,variationText:f}},_loadSubControllerInitialImages:function(){for(var a in this._subControllers)this._subControllers.hasOwnProperty(a)&&this._subControllers[a].loadInitialImages()},_updateDefaultCheckedAccessories:function(){var a=this;a.$el.find(".abb-option-checkbox input[type\x3d'checkbox']:checked").each(function(){a._handleCheckboxChange(null, k(this),!0)})},_parseQuantity:function(a){a=parseInt(a,10);return isNaN(a)?1:a}})});"use strict";l.when("desktop-accessory-upsell-product-model","desktop-accessory-upsell-product-controller","desktop-accessory-upsell-product-view","A").register("desktop-accessory-upsell-product-factory",function(f,d,a,e){return{get:function(g,v,k){var m=e.$("#abb-product-view-"+g),c=new a(m);v=new f(v,g,k);return new d(m,g,c,v)}}});"use strict";l.when("A").register("desktop-accessory-upsell-product-model",function(f){return f.createClass({init:function(d, a,e){this._products=d;this._index=e;this._isViewClosedByOrderUpdate=this._isAddedToOrder=this._preloadingComplete=!1;this._cachedAsin=null;this._isVisual=this._calculateIsVisual(a);this.setSelectedProduct(a)},_calculateIsVisual:function(d){return(d=this._products[d])?d.visualDimension:!1},cacheSelectedProduct:function(){var d=this.getSelectedProduct();"undefined"!==typeof d&&(this._cachedAsin=d.asin)},setSelectedProductFromCache:function(){this.setSelectedProduct(this._cachedAsin)},clearSelectedProductCache:function(){this._cachedAsin= null},setSelectedProduct:function(d){if(d)for(var a in this._products)this._products.hasOwnProperty(a)&&(this._products[a].isSelected=a===d)},getSelectedProduct:function(){for(var d in this._products)if(this._products.hasOwnProperty(d)){var a=this._products[d];if(a.isSelected)return f.copy(a)}},getProduct:function(d){var a=null,e;for(e in this._products)if(this._products.hasOwnProperty(e)&&e===d){a=this._products[e];break}return a},isSelectedProduct:function(d){return(d=this._products[d])&&d.isSelected}, isVisual:function(){return this._isVisual},setAddedToOrderState:function(d){this._isAddedToOrder=d},isAddedToOrderState:function(){return this._isAddedToOrder},getAllLowResImages:function(){var d=[],a;for(a in this._products)this._products.hasOwnProperty(a)&&d.push(this._products[a].lowResImage.URL_);return d},isPreloadingComplete:function(){return this._preloadingComplete},completePreloading:function(){this._preloadingComplete=!0},getIndex:function(){return this._index},isViewClosedByOrderUpdate:function(){return this._isViewClosedByOrderUpdate}, setViewClosedByOrderUpdate:function(d){this._isViewClosedByOrderUpdate=d},setHasBeenInteractedWith:function(d){this._products.hasOwnProperty(d)&&(this._products[d].hasBeenInteractedWith=!0)}})});"use strict";l.when("A").register("desktop-accessory-upsell-product-view",function(f){var d=f.$;return f.createClass({init:function(a){this.$baseElement=a;this.$variations=this.$baseElement.find(".abb-variation")},updateTargetElement:function(a,e){this.$el=a;this.$el.find(".abb-product-view").toggleClass("abb-product-is-selected", e)},_updateSelectedVariation:function(a){this.$variations.removeClass("a-button-selected");this.$variations.filter(".abb-variation-"+a).addClass("a-button-selected")},render:function(a){var e=this._buildFeatureBullets(a.featureBullets);this._updateElements(this.$el,a,e.clone());this._updateSelectedVariation(a.asin)},updateBase:function(a){var e=this._buildFeatureBullets(a.featureBullets);this._updateElements(this.$baseElement,a,e.clone());this.$baseElement.find(".abb-variation-"+a.asin).trigger("click")}, _updateElements:function(a,e,g){e.isDigitalSubscription||(a.find(".abb-product-title").html(e.title),a.find(".abb-product-buying-price").html(e.buyingPriceString),a.find(".abb-product-list-price").html(e.isOnSale?e.listPriceString:""),a.find(".abb-product-list-price-label").html(e.isOnSale?e.listingPriceLabel:""),a.find(".abb-product-merchant").text(e.merchant),a.find(".abb-variation-selected-dimension").text(e.swatchValue),a.find(".abb-product-feature-bullets").html(g),a.find(".abb-product-title").attr("href", e.productURL))},_buildFeatureBullets:function(a){for(var e=d("\x3cul\x3e"),g=0;g<a.length;g++)d("\x3cli\x3e").html(a[g]).appendTo(e);return e},updateProductImage:function(a){setTimeout(function(){this.$el.find(".abb-product-image").attr("src",a);this.$baseElement.find(".abb-product-image").attr("src",a)}.bind(this),100)}})});"use strict";l.when("desktop-accessory-upsell-ref-helper","ods-image-utilities","A").register("desktop-accessory-upsell-product-controller",function(f,d,a){var e=a.$;return a.createClass({init:function(g, d,f,m){this.$baseElement=g;this._scheduledAsin=d;this._view=f;this._model=m;this.$el;this.popoverInstance;a.on("a:button-group:abb-product-variations-"+this._scheduledAsin+":toggle",e.proxy(this._handleVariationSelection,this));a.on("a:popover:beforeShow:abb-product-view-"+this._scheduledAsin,e.proxy(this._preparePopover,this));a.on("a:popover:show:abb-product-view-"+this._scheduledAsin,e.proxy(this._bindEvents,this));a.on("a:popover:afterHide:abb-product-view-"+this._scheduledAsin,e.proxy(this._detachPopover, this))},_preparePopover:function(a){this.$el=a.popover.$popover;this.popoverInstance=a.popover;this._model.cacheSelectedProduct();this._model.setViewClosedByOrderUpdate(!1);this._model.setHasBeenInteractedWith(this._scheduledAsin);this._view.updateTargetElement(this.$el,this._model.isAddedToOrderState());if(!this._model.isPreloadingComplete()){var v=this;a=d.preloadImages(this._model.getAllLowResImages());e.when.apply(e,a).done(function(){v._model.completePreloading()})}this.renderView();f.sendPopoverDisplayed(this._model.getIndex(), this._model.getSelectedProduct().asin);f.addCountMetric("DesktopMarsABBProductViewCount")},_bindEvents:function(){this.$el.delegate(".abb-product-ato","click",e.proxy(this._handleAddToOrderClick,this))},_detachPopover:function(){this.$el&&this.$el.undelegate(".abb-product-ato","click",e.proxy(this._handleAddToOrderClick,this));this.popoverInstance=this.$el=x;this._model.isViewClosedByOrderUpdate()||(this._model.setSelectedProductFromCache(),f.sendPopoverCancelled(this._model.getIndex(),this._model.getSelectedProduct().asin)); this._model.clearSelectedProductCache()},_handleVariationSelection:function(a){var e;a.selectedButton&&(e=a.selectedButton.buttonName);e&&(this.selectAsin(e),this.renderView(),f.sendPopoverTwisted(this._model.getIndex(),e))},_handleAddToOrderClick:function(){var a=this._model.getSelectedProduct(),e=this._model.isAddedToOrderState();this._orderUpdateCallback&&this._orderUpdateCallback(this._scheduledAsin,a);this._model.setAddedToOrderState(!0);this._model.setViewClosedByOrderUpdate(!0);this._view.updateBase(this._generateViewModel(a)); e?f.sendUpdateClicked(this._model.getIndex(),a.asin):f.sendAddToOrderClicked(this._model.getIndex(),a.asin);this.$el.addClass("abb-product-is-selected");this.popoverInstance.hide()},_handleLowResImageLoaded:function(a,e){var d=this._model.getSelectedProduct();a&&a.isResolved()||d.lowResImage.URL_!==e||this._view.updateProductImage(e)},_handleHiResImageLoaded:function(a){this._model.getSelectedProduct().hiResImage.URL_===a&&this._view.updateProductImage(a)},_handleImageLoadFailure:function(a){throw Error("The image "+ a+" failed to load for accessory ASIN "+this._scheduledAsin);},_generateViewModel:function(a){return{asin:a.asin,title:a.title,merchant:a.merchantName,swatchValue:a.swatchValue,featureBullets:a.featureBullets,listPriceString:a.listPrice,listingPriceLabel:a.listingPriceLabel,buyingPriceString:a.buyingPrice,isOnSale:a.showPriceStrikethrough,isDigitalSubscription:a.isDigitalSubscription,productURL:"/dp/{0}/ref\x3dods_dabb_{0}_productInfo".replace("{0}",a.asin).replace("{0}",a.asin)}},_loadProductImage:function(a){a= d.preloadImage(a.lowResImage.URL_,a.hiResImage.URL_);a.image.done(e.proxy(this._handleLowResImageLoaded,this,a.hiResImage)).fail(e.proxy(this._handleImageLoadFailure,this,a.hiResImage));a.hiResImage&&a.hiResImage.done(e.proxy(this._handleHiResImageLoaded,this)).fail(e.proxy(this._handleImageLoadFailure,this))},loadInitialImages:function(){a.loadDescendantImagesManually(this.$baseElement)},setOnOrderUpdate:function(a){this._orderUpdateCallback=a},getCurrentProduct:function(){return this._model.getSelectedProduct()}, setAddedToOrderState:function(a){this._model.setAddedToOrderState(a)},selectAsin:function(a){var e=this._model.getSelectedProduct();e&&e.asin!==a&&this._model.setSelectedProduct(a)},renderView:function(){var a=this._model.getSelectedProduct();this._model.isVisual()&&this._loadProductImage(a);this._view.render(this._generateViewModel(a))},getIndex:function(){return this._model.getIndex()},setHasBeenInteractedWith:function(a){this._model.setHasBeenInteractedWith(a)}})});"use strict";l.when("desktop-accessory-upsell-interstitial-model", "desktop-accessory-upsell-interstitial-view","desktop-accessory-upsell-interstitial-controller","A").register("desktop-accessory-upsell-interstitial-factory",function(f,d,a,e){return{get:function(g){var l=e.$("#abb-interstitial"),k=new d(l);g=new f(g);return new a(l,k,g)}}});"use strict";l.when("A").register("desktop-accessory-upsell-interstitial-model",function(f){return f.createClass({init:function(d){this._interstitialAsinsData=d;this._scheduledAsins={};this._scheduledVariationsAsins={};this._interstitialProducts= {};this._buildScheduledAsinCache(d)},getInterstitialAsinsData:function(){return this._interstitialAsinsData},getInterstitialProducts:function(){return this._interstitialProducts},getScheduledAsinFromVariationAsin:function(d){return this._scheduledAsins[d]},getVariationAsinsFromScheduledAsin:function(d){return this._scheduledVariationsAsins[d]},_buildScheduledAsinCache:function(d){this._scheduledAsins={};this._scheduledVariationsAsins={};this._interstitialProducts={};for(var a in d)if(d.hasOwnProperty(a)){this._scheduledVariationsAsins[a]= [];this._interstitialProducts[a]=d[a][a];for(var e in d[a])d[a].hasOwnProperty(e)&&(this._scheduledVariationsAsins[a].push(e),this._scheduledAsins[e]=a)}}})});"use strict";l.when("a-modal","A").register("desktop-accessory-upsell-interstitial-view",function(f,d){return d.createClass({init:function(a){this.$baseElement=a;this.$productSections=this.$baseElement.find(".abb-intl-product-view,.abb-intl-product-terms")},render:function(a){this.$productSections.hide();a=a.asinsToShow;for(var e=0;e<a.length;e++)this._getProductSection(a[e]).show()}, getCheckedProductCheckboxes:function(){return this.$baseElement.find(".abb-intl-product-ato input[type\x3d'checkbox']:checked")},getAllVisibleProductCheckboxes:function(){return this.$baseElement.find(".abb-intl-product-ato input[type\x3d'checkbox']:visible")},getAllVisibleSelectedMessage:function(){return this.$baseElement.find(".abb-intl-product-selected-successful-message:visible")},getAllVisibleSelectButtons:function(){return this.$baseElement.find(".abb-intl-product-select-button:visible")}, getAllVisibleAddToCartButtons:function(){return this.$baseElement.find(".abb-intl-product-atc input[type\x3d'submit']:visible")},_getProductSection:function(a){return this.$baseElement.find("#abb-intl-product-view-"+a+","+("#abb-intl-product-terms-"+a))}})});"use strict";l.when("desktop-accessory-upsell-ref-helper","ods-image-utilities","accessory-upsell-dom-helper","accessory-upsell-buybox-helper","MakoAmazonApiAddToCartHelper","a-modal","A").register("desktop-accessory-upsell-interstitial-controller", function(f,d,a,e,g,v,k){function m(a){a||(a=function(){});if(b&&e.getPageAsin()&&e.getPageAsin().asin){var c=e.getPageAsin().asin;b._handleLDAtcSubmit(a,c)}}var c=k.$,b=null;return k.createClass({init:function(a,c,e){this.$baseElement=a;this._view=c;this._model=e;b=this;this.popoverInstance=v.get("abb-interstitial");this.$el;this.$clickedSubmitButton;var d=this.wasInterstitialOfferAccepted=!1;this.asinsToShow=k.map(this._model.getInterstitialProducts(),function(a,h){a.checkForInteraction&&(d=!0); return h});this.hasCheckForInteractionAsin=d;this._bindEvents()},_bindEvents:function(){var h=this;l.when("ready").execute("accessory-upsell-interstitial-controller-bindEvents",function(){a.getSubmitButtons().forEach(function(a){0<=a.selector.indexOf("input#add-to-cart-button")||0<=a.selector.indexOf("input#one-click-button")&&h.hasCheckForInteractionAsin||0<=a.selector.indexOf("input#buy-now-button")&&h.hasCheckForInteractionAsin?a.bind("click",c.proxy(h._handleAtcSubmit,h)):0<=a.selector.indexOf("#LDBuybox *[id^\x3dgb_atc_]")&& (k.off("deals_claimDealSuccess",m),k.on("deals_claimDealSuccess",m))})})},_handleAtcSubmit:function(a){if(c("#abb-interstitial").length){this.$clickedSubmitButton=c(a.target);var b=this._getInterstitialAsinsToShow();if(0<b.length){a.preventDefault();this.$clickedSubmitButton.unbind("click",c.proxy(this._handleAtcSubmit,this));for(var d=0;d<b.length;d++)f.sendInterstitialDisplayed(-1,b[d]),0===c("#abb-product-better-together-message-"+b[d]).length&&b[d]!==e.getPageAsin().asin&&f.sendInterstitialBetterTogetherMessageNotAvailable(-1, b[d]);c("#abb-intl-product-select-button").length?this._displaySelectButtonOrATCButton(a,!1):this._displayCheckBoxOrATCButtons(a,!1);this._showIntlPopover.apply(this)}}else l.log("Interstitial popover PreloadContent is not found in regular buybox","FATAL")},_handleLDAtcSubmit:function(h,b){if(b!==a.parsePageAsinData().asin)l.log("ASIN added to cart and Page ASIN are different.","WARN");else if(c("#abb-interstitial").length){b=this._getInterstitialAsinsToShow();if(0<b.length){for(var d=0;d<b.length;d++)f.sendInterstitialDisplayed(-1, b[d]);c("#abb-intl-product-select-button").length?this._displaySelectButtonOrATCButton(h,!0):this._displayCheckBoxOrATCButtons(h,!0);this._showIntlPopover.apply(this)}var q=e.getUpsellAsins();if(q.length){try{var n=k.state("abbCartAPIParametersMap"),m=g.createRequest(n.csrfToken,n.marketplaceId,n.aapiAjaxEndpoint);m.setAsinDataList(q);m.setRefTag("mars_ajax_dabb_atc");m.sendRequest(function(h){for(var c=0;c<q.length;c++){var b=e.getProductData(q[c].asin);f.sendLightningDealsABBAddToCartSuccessful(-1, b.asin,b.isAutomated)}a.updateCartQuantity(h.entity.count.entity.items);f.sendCartAPIRequestSuccessful(-1,"");h=a.getLightningDealElements();a.getDomElements().abbContainer.find(".abb-option-checkbox input").prop("checked",!1);h.successMessageCount.text(q.length);1<q.length?h.successMessageMultiple.removeClass("aok-hidden"):h.successMessageSingle.removeClass("aok-hidden");h.successMessageContainer.removeClass("aok-hidden")},function(){l.log("An error has occurred with Cart API","FATAL");f.sendCartAPIRequestFailure(-1, "")})}catch(u){l.log("Adding accessories to cart failed from ABB on Deals ASIN","FATAL")}e.resetUpsellData()}}else l.log("Interstitial popover PreloadContent is not found in LD buybox","FATAL")},_getInterstitialAsinsToShow:function(){for(var a=[],c=e.getUpsellAsins(),c=this.getParentAsins(c),b=0;b<this.asinsToShow.length;b++){var d=this.asinsToShow[b],g=this._model.getScheduledAsinFromVariationAsin(d),f=this._model.getInterstitialAsinsData()[g][d];f.checkForInteraction?f.hasBeenInteractedWith||(a.push(d), this.autoCheckInterstitial=!0):-1===c.indexOf(g)&&a.push(d)}return this.asinsToShow=a},_showIntlPopover:function(){k.off("a:popover:beforeShow:abb-interstitial");k.off("a:popover:show:abb-interstitial");k.off("a:popover:hide:abb-interstitial");k.on("a:popover:beforeShow:abb-interstitial",c.proxy(this._popoverBeforeShow,this));k.on("a:popover:show:abb-interstitial",c.proxy(this._popoverOnShow,this));k.on("a:popover:hide:abb-interstitial",c.proxy(this._popoverOnHide,this));this.popoverInstance.show(); f.addCountMetric("DesktopMarsABBInterstitialCount")},_popoverBeforeShow:function(a){this._lazyLoadImages();this._resetInterstitalInteractedElements();this.renderView()},_popoverOnShow:function(a){this.$el=a.popover.$popover;c("#abb-intl-product-select-button").length?this.$el.delegate(".abb-intl-ato","click",c.proxy(this._handleIntlSelectCXAddToOrderClick,this)):this.$el.delegate(".abb-intl-ato","click",c.proxy(this._handleIntlAddToOrderClick,this));this.$el.delegate(".abb-intl-decline","click",c.proxy(this._handleIntlDeclineClick, this));this.$el.delegate(".abb-intl-continue","click",c.proxy(this._handleIntlDeclineClick,this));this.$el.delegate(".a-button-close","click",c.proxy(this._handleIntCloseButtonClick,this));this.$el.delegate(".abb-intl-product-ato input[type\x3d'checkbox']","change",c.proxy(this._handleSelectedItemsChange,this));this.$el.delegate(".abb-intl-product-atc","click",c.proxy(this._handleAccessoryAddToCartClick,this));this.$el.delegate(".abb-intl-product-atc-try-again","click",c.proxy(this._handleAccessoryAddToCartClick, this));this.$el.delegate(".abb-product-subscription-see-more-link","click",c.proxy(this._onSeeMoreClick,this));this.$el.delegate(".abb-product-subscription-see-less-link","click",c.proxy(this._onSeeLessClick,this));this.$el.delegate("#abb-intl-product-select-button","click",c.proxy(this._onSelectClick,this));this.$el.delegate(".abb-intl-product-delete","click",c.proxy(this._onDeleteClick,this));1==this._getInterstitialAsinsToShow().length&&this.autoCheckInterstitial&&this.$el.find(".abb-intl-product-ato input[type\x3d'checkbox']").prop("checked", !0);this._updateItemCounters();c(".abb-intl-product-view:visible").length||l.log("Will show an empty popover Interstitial","FATAL")},_popoverOnHide:function(a){this._view.getAllVisibleAddToCartButtons().each(function(){var a=c(this).data("asin");f.sendInterstitialItemUnchecked(-1,a)});this.wasInterstitialOfferAccepted||f.sendInterstitialOfferDeclined(-1,"");this.$clickedSubmitButton&&this.$clickedSubmitButton.click()},_lazyLoadImages:function(){c(".abb-sources").length&&(c(".abb-product-view-image-container").each(function(){var a= c(this).find(".abb-product-image"),b=c(this).find(".abb-sources"),e=c(b).attr("data-normalres")||c(b).attr("data-normalRes"),b=c(b).attr("data-highres")||c(b).attr("data-highRes");a.attr("src",e);a.attr("data-a-hires",b)}),k.loadHiResImage(c(".abb-product-image")))},_resetInterstitalInteractedElements:function(){c(".abb-intl-atc-spinner").hide();c(".abb-intl-atc-successfully").hide();c(".abb-intl-product-inCart-message").hide();c(".abb-intl-atc-successfully-icon").hide();c(".abb-intl-atc-error").hide(); c(".abb-intl-product-atc-try-again").hide();c(".abb-intl-atc-successfully-quantity").remove();var h=a.getInterstitialCTAButtons();h.continueButton.hide();h.addSelectedButton.hide();h.declineButton.show()},_handleIntCloseButtonClick:function(a){f.sendInterstitialCloseButtonClicked(-1,"")},_handleSelectedItemsChange:function(c){this.wasInterstitialOfferAccepted=0<this._view.getCheckedProductCheckboxes().length;c=a.getInterstitialCTAButtons();this.wasInterstitialOfferAccepted?(c.addSelectedButton.css("display", "inline-block"),c.declineButton.hide()):(c.addSelectedButton.hide(),c.declineButton.css("display","inline-block"))},_handleIntlAddToOrderClick:function(b){b=this._view.getAllVisibleProductCheckboxes();var d=parseInt(a.getPageQuantityDropdown().val()||1,10);b.each(function(a,b){a=c(this).closest(".abb-intl-product-ato").data("asin");b=e.getProductData(a);if(!b)return!0;c(this).is(":checked")?(e.addUpsellAsin(a,b.offerListingID,d),f.sendInterstitialItemAdded(-1,a,b.isAutomated)):(e.removeUpsellAsin(a, b.offerListingID),f.sendInterstitialItemUnchecked(-1,a,b.isAutomated))});this.popoverInstance.hide()},_handleIntlSelectCXAddToOrderClick:function(b){b=this._view.getAllVisibleSelectedMessage();var d=this._view.getAllVisibleSelectButtons(),g=parseInt(a.getPageQuantityDropdown().val()||1,10);b.each(function(a,b){a=c(this).closest(".abb-intl-product-selected-successful-message").data("asin");b=e.getProductData(a);if(!b)return!0;e.addUpsellAsin(a,b.offerListingID,g);f.sendInterstitialItemAdded(-1,a,b.isAutomated)}); d.each(function(a,b){a=c(this).closest("#abb-intl-product-select-button").data("asin");b=e.getProductData(a);if(!b)return!0;e.removeUpsellAsin(a,b.offerListingID);f.sendInterstitialItemUnchecked(-1,a,b.isAutomated)});this.popoverInstance.hide()},_showContinue:function(b){b=a.getInterstitialCTAButtons();b.continueButton.css("display","inline-block");b.declineButton.hide()},_handleAccessoryAddToCartClick:function(a){var b=this,d=c("input[name\x3d'gift-wrap']").is(":checked");c(a.currentTarget).hide(); c(a.target).closest(".a-section").find(".abb-intl-atc-error").hide();c(a.target).closest(".a-section").find(".abb-intl-product-atc-try-again").hide();c(a.target).closest(".a-section").find(".abb-intl-atc-successfully-icon").hide();c(a.target).closest(".a-section").find(".abb-intl-product-inCart-message").hide();c(a.target).closest(".a-section").find(".abb-intl-product-atc").hide();c(a.target).closest(".a-section").find(".abb-intl-atc-successfully-quantity").hide();c(a.target).closest(".a-section").find(".abb-intl-atc-successfully-quantity").remove(); c(a.target).closest(".a-row").find(".abb-intl-atc-spinner").css("display","inline-block");var f=a.currentTarget.firstChild.firstChild.dataset.asin,n=e.getProductData(f),d={asin:f,offerId:n.offerListingID,quantity:1,isToBeGiftWrapped:d.toString()};try{var m=k.state("abbCartAPIParametersMap"),u=g.createRequest(m.csrfToken,m.marketplaceId,m.aapiAjaxEndpoint);u.addSingleAsinData(d);u.setRefTag("mars_ajax_intl_atc");r.setTimeout(function(){b._onSendingCartRequest(a,u,n,f)},2E3)}catch(w){l.log("An exception occurred when fetching parameters for cart API"+ w,"ERROR"),b._onAccessoryAddFailure(a,f)}},_onSendingCartRequest:function(a,b,c,d){var e=this;b.sendRequest(function(b){f.sendCartAPIRequestSuccessful(-1,"");e._onAccessoryAddSuccess(a,b,c);e._showContinue(a)},function(){f.sendCartAPIRequestFailure(-1,"");e._onAccessoryAddFailure(a,d)})},_onSeeMoreClick:function(a){c(a.target).closest(".a-section").find("#abb-product-terms-conditions-short-terms-conditions").hide();c(a.target).closest(".a-section").find("#abb-product-terms-conditions-long-terms-conditions").css("display", "inline-block")},_onSeeLessClick:function(a){c(a.target).closest(".a-section").find("#abb-product-terms-conditions-long-terms-conditions").hide();c(a.target).closest(".a-section").find("#abb-product-terms-conditions-short-terms-conditions").css("display","inline-block")},_onSelectClick:function(a){c(a.target).closest(".a-section").find("#abb-intl-product-select-button").hide();c(a.target).closest(".a-section").find(".abb-intl-product-select-button-clicked").css("display","inline-block");this._handleSelectDeleteChange()}, _onDeleteClick:function(a){c(a.target).closest(".a-section").find(".abb-intl-product-select-button-clicked").hide();c(a.target).closest(".a-section").find("#abb-intl-product-select-button").css("display","inline-block");this._handleSelectDeleteChange()},_handleSelectDeleteChange:function(b){this.wasInterstitialOfferAccepted=0<this._view.getAllVisibleSelectedMessage().length;b=a.getInterstitialCTAButtons();this.wasInterstitialOfferAccepted?(b.addSelectedButton.css("display","inline-block"),b.declineButton.hide()): (b.addSelectedButton.hide(),b.declineButton.css("display","inline-block"))},_onAccessoryAddSuccess:function(b,d,e){this.wasInterstitialOfferAccepted=!0;var g=d.entity.items[0].quantity,k=e.maxOrderQuantity;c(b.target).closest(".a-row").find(".abb-intl-atc-spinner").hide();c(b.target).closest(".a-row").find(".abb-intl-atc-successfully-icon").css("display","inline-block");c(b.target).closest(".a-section").find(".abb-intl-atc-successfully-quantity").remove();if(k){if(0!=k){var m='\x3cdiv class \x3d "abb-intl-atc-successfully-quantity "\x3e'+ g+"\x3c/div\x3e";c(b.target).closest(".a-row").find(".abb-intl-product-inCart-message").before(m)}c(b.target).closest(".a-row").find(".abb-intl-product-inCart-message").css("display","inline-block");g<k&&c(b.target).closest(".a-row").find(".abb-intl-product-atc").css("display","inline-block")}else c(b.target).closest(".a-row").find(".abb-intl-product-inCart-message").before('\x3cdiv class \x3d "abb-intl-atc-successfully-quantity "\x3e1\x3c/div\x3e'),c(b.target).closest(".a-row").find(".abb-intl-product-inCart-message").css("display", "inline-block");f.sendInterstitialAddToCartSuccessful(-1,e.asin,e.isAutomated);a.updateCartQuantity(d.entity.count.entity.items)},_onAccessoryAddFailure:function(a,b){c(a.target).closest(".a-row").find(".abb-intl-atc-spinner").hide();c(a.target).closest(".a-section").find(".abb-intl-atc-error").css("display","inline-block");c(a.target).closest(".a-section").find(".abb-intl-product-atc-try-again").css("display","inline-block");f.sendInterstitialAddToCartFailure(-1,b);l.log("Accessory add to cart failed in Interstitial", "FATAL")},_displayCheckBoxOrATCButtons:function(b,c){b=a.getProductButtonsAndCheckboxes();c?(b.addToCart.css("display","inline-block"),b.checkbox.hide()):(b.checkbox.css("display","inline-block"),b.addToCart.hide())},_displaySelectButtonOrATCButton:function(b,c){b=a.getSelectAndATCButtons();c?(b.addToCart.css("display","inline-block"),b.selectButton.hide()):(b.selectButton.css("display","inline-block"),b.addToCart.hide())},_handleIntlDeclineClick:function(a){this.wasInterstitialOfferAccepted=!1;this.popoverInstance.hide()}, _generateViewModel:function(){return{asinsToShow:this.asinsToShow}},_updateItemCounters:function(){var a=c(".abb-intl-product-view:visible").length,b=c(".abb-interstitial").closest(".a-popover-wrapper").find(".a-popover-header-content").last();b.text(b.text().replace("$totalItems",a));c(".abb-product-total").text(a);c(".abb-intl-product-view:visible .abb-product-index").each(function(a){c(this).text(a+1)});c(".abb-intl-product-view:visible").eq(0).addClass("abb-intl-first-accessory")},loadInitialImages:function(){k.loadDescendantImagesManually(this.$baseElement)}, renderView:function(){this._view.render(this._generateViewModel())},getParentAsins:function(a){for(var b=[],c=0;c<a.length;c++){var d=this._model.getScheduledAsinFromVariationAsin(a[c].asin);b.push(d)}return b},_csmRegisterWeblab:function(a,b){var c=r.ue;c&&c.trigger(a,b)}})});"use strict";l.when("odsRefTagUtils","accessory-upsell-buybox-helper","csmCounter","A").register("desktop-accessory-upsell-ref-helper",function(f,d,a,e){function g(a,b,e,g){var p=d.getPageAsin().asin;p&&p.length&&(a=("ods_dabb_"+ p+"_slot{{index}}_{{asin}}_{{action}}"+(g?"_automated":"")).replace(l,a).replace(k,b).replace(m,e),f.send(a))}var l=/{{\s?index\s?}}/ig,k=/{{\s?asin\s?}}/ig,m=/{{\s?action\s?}}/ig;return{sendAsinScheduled:function(a,b,d){g(a,b,"asinScheduled",d)},sendCheckboxSelected:function(a,b,d){g(a,b,"checkoxSelected",d)},sendCheckboxDeselected:function(a,b,d){g(a,b,"checkoxDeselected",d)},sendSecondaryViewDisplayed:function(a,b){g(a,b,"secondaryViewDisplayed")},sendSecondaryViewTwisted:function(a,b){g(a,b,"secondaryViewTwisted")}, sendSecondaryViewCancelled:function(a,b){g(a,b,"secondaryViewCancelled")},sendPopoverDisplayed:function(a,b){g(a,b,"popoverDisplayed")},sendPopoverTwisted:function(a,b){g(a,b,"popoverTwisted")},sendPopoverCancelled:function(a,b){g(a,b,"popoverCancelled")},sendAddToOrderClicked:function(a,b){g(a,b,"addToOrderClicked")},sendInterstitialDisplayed:function(a,b){g(a,b,"interstitialDisplayed")},sendInterstitialItemAdded:function(a,b,d){g(a,b,"interstitialItemAdded",d)},sendInterstitialItemUnchecked:function(a, b,d){g(a,b,"interstitialItemUnselected",d)},sendInterstitialOfferDeclined:function(a,b){g(a,b,"interstitialOfferDeclined")},sendInterstitialCloseButtonClicked:function(a,b){g(a,b,"interstitialCloseButtonClicked")},sendUpdateClicked:function(a,b){g(a,b,"updateClicked")},sendInterstitialAddToCartSuccessful:function(a,b,d){g(a,b,"intATC",d)},sendLightningDealsABBAddToCartSuccessful:function(a,b,d){g(a,b,"intLdATC",d)},sendInterstitialAddToCartFailure:function(a,b){g(a,b,"intATCFail")},sendInterstitialBetterTogetherMessageNotAvailable:function(a, b){g(a,b,"interstitialBetterTogetherNotAvailable")},sendCartAPIRequestSuccessful:function(a,b){g(a,b,"cartApiAddItemsRequestSuccess")},sendCartAPIRequestFailure:function(a,b){g(a,b,"cartApiAddItemsRequestFailure")},addCountMetric:function(a){r.ue&&r.ue.count&&r.ue.count(a,1)}}});"use strict";l.when("A").register("accessory-upsell-dom-helper",function(f){var d=f.$;return new function(){function a(a){a.each(function(){var a=d(this);a.find(".buyboxHelperHiddenFieldsContainer").length||a.append(d("\x3cdiv\x3e").addClass("buyboxHelperHiddenFieldsContainer"))}); return a.find(".buyboxHelperHiddenFieldsContainer")}function e(a,b){return d("\x3cinput\x3e").attr({type:"hidden",name:a,value:b})}function g(a,b){return d("\x3cinput\x3e").attr({type:"hidden",name:a,value:b,"class":"ATCFormUpsellAsinData"})}function f(a){a.each(function(){var a=d(this),c=a.parent("form").find('input[name\x3d"itemCount"]');b.itemCount.length&&!c.length&&a.append(b.itemCount.clone())});return a}function k(a){for(var b=document.getElementById("giftCheckBoxInput"),c=0;c<a.length;c++)d("form#addToCart").find('input[name\x3d"items['+ c+'.upsell][additionalParameters][giftOptions][includeGiftReceipt]"]').remove();if(b&&b.value)for(c=0;c<a.length;c++){var e="items["+c+".upsell][additionalParameters][giftOptions][includeGiftReceipt]";d("form#addToCart").append(g(e,b.value)[0])}}function m(a,b,c){if(b){var d=1,g;for(g in b)a.appendChild(e("custom-name."+c+"."+d,g)[0]),a.appendChild(e("custom-value."+c+"."+d,b[g])[0]),d+=1}}function c(){b.hiddenFieldsContainers.empty()}var b={};return{processMarkupForDabb:function(){var a=d("#accessory-upsell"); a.find(".abb-option-checkbox input[type\x3d'checkbox']").removeAttr("name").removeAttr("value");a.find('input[name^\x3d"asin."]').remove();a.find('input[name^\x3d"offeringID."]').remove();a.find('input[name^\x3d"quantity."]').remove()},parsePageAsinData:function(){b.abbContainer=d("#accessory-upsell");b.itemCount=b.abbContainer.find('input[name\x3d"itemCount"]');b.buyboxForm=d("form#addToCart");b.atcForms=d('#buybox form:has(input[name\x3d"ASIN"])');b.formSessionIdInput=b.buyboxForm.find("input#session-id"); b.formSessionIdInput.length||(b.formSessionIdInput=d("#verificationSessionID"));b.submitButton=b.buyboxForm.find('input#add-to-cart-button[name\x3d"submit.add-to-cart"]');b.installmentsSubmitButton=b.buyboxForm.find('input#installments-button[name\x3d"submit.installments"]');b.oneClickSubmitButton=b.buyboxForm.find('input#one-click-button[name\x3d"submit.one-click-order.x"]');b.buyNowSubmitButton=b.buyboxForm.find('input#buy-now-button[name\x3d"submit.buy-now"]');b.lightningDealSubmitButton=b.buyboxForm.find("#LDBuybox *[id^\x3dgb_atc_]"); b.pageAsinInput=b.buyboxForm.find('input[type\x3d"hidden"][name\x3d"ASIN"]');b.pageOfferIdInput=b.buyboxForm.find('input[type\x3d"hidden"][name\x3d"offerListingID"]');b.pageQuantityDropdown=b.buyboxForm.find('select[name\x3d"quantity"]');b.giftCheck=b.buyboxForm.find('input[name\x3d"gift-wrap"]');b.ldAddSuccessMessageContainer=b.buyboxForm.find("#abb-add-success-message");b.ldAddSuccessCount=b.buyboxForm.find("#abb-add-success-message-count");b.ldAddSuccessSingleMessage=b.buyboxForm.find("#abb-add-single-message"); b.ldAddSuccessMultipleMessage=b.buyboxForm.find("#abb-add-multiple-message");b.ldWaitlistMessage=b.buyboxForm.find("#abb-waitlist-message");b.hiddenFieldsContainers=a(b.atcForms);b.intlAtoSubmitButon=d(".abb-intl-ato");b.intlDeclineButton=d(".abb-intl-decline");b.productCheckbox=d(".abb-intl-product-ato");b.addSelectedButton=d(".abb-intl-add-selected");b.productSelectButton=d(".abb-intl-product-select-button");b.productAddToCart=d(".abb-intl-product-atc");b.continueButton=d(".abb-intl-continue"); b.cartQuantity=d(".nav-cart-count");var c=b.pageAsinInput.val(),e=b.pageOfferIdInput.val(),g=b.pageQuantityDropdown.val()&&b.pageQuantityDropdown.val().trim()?parseInt(b.pageQuantityDropdown.val().trim(),10):1;return{asin:c,offerId:e,quantity:g}},getSubmitButtons:function(){return[b.submitButton,b.oneClickSubmitButton,b.buyNowSubmitButton,b.lightningDealSubmitButton]},getPageQuantityDropdown:function(){return b.pageQuantityDropdown},renderUpsellAsinsHiddenInputs:function(a){if(b.hiddenFieldsContainers.length){c(); var g=d('input#add-to-cart-button[name\x3d"submit.add-to-cart"]').closest("form"),k=g.find('input[type\x3d"hidden"][name^\x3d"offeringID"]').length,l=new Set;0<k&&g.find('input[type\x3d"hidden"][name^\x3d"offeringID"]').each(function(){var a=d(this).attr("name");a&&(a=a.slice(11),l.add(parseInt(a)))});for(var n=document.createDocumentFragment(),g=!1,t=0;t<a.length;t++){var u=a[t],w=t+1;if(l.has(w)||g)w=k+t+1,g=!0,t===a.length-1&&(w=k+t+2);n.appendChild(e("asin."+w,u.asin)[0]);n.appendChild(e("offeringID."+ w,u.offerId)[0]);n.appendChild(e("quantity."+w,u.quantity)[0]);if(u.isDigitalSubscription){var z=u.fixedCustomCartAttribute?w:w+1;n.appendChild(e("custom-name."+z+".1",u.customAttributeName)[0]);n.appendChild(e("custom-value."+z+".1",u.customAttributeValue)[0])}m(n,u.productLineItemCustomKeyValuePair,"1");m(n,u.upsellLineItemCustomKeyValuePair,w+1)}b.hiddenFieldsContainers.each(function(){d(this).append(n.cloneNode(!0))});f(b.hiddenFieldsContainers)}},removeUpsellAsinsHiddenInputs:c,updateUpsellAsinsQuantityInputs:function(a){b.hiddenFieldsContainers.find('input[type\x3d"hidden"][name^\x3d"quantity."]').each(function(b, c){d(c).val(a)})},getDomElements:function(){return b},getHiddenFieldsContainer:function(){return b.hiddenFieldsContainers},getBuyboxFormSessionID:function(){return b.formSessionIdInput},getLightningDealElements:function(){return{waitlistMessage:b.ldWaitlistMessage,successMessageContainer:b.ldAddSuccessMessageContainer,successMessageContainerSelector:"#abb-add-success-message",successMessageSingle:b.ldAddSuccessSingleMessage,successMessageMultiple:b.ldAddSuccessMultipleMessage,successMessageCount:b.ldAddSuccessCount}}, reset:function(){b={}},getInterstitialCTAButtons:function(){return{atoButton:b.intlAtoSubmitButon,declineButton:b.intlDeclineButton,continueButton:b.continueButton,addSelectedButton:b.addSelectedButton}},getProductButtonsAndCheckboxes:function(){return{checkbox:b.productCheckbox,addToCart:b.productAddToCart}},getSelectAndATCButtons:function(){return{selectButton:b.productSelectButton,addToCart:b.productAddToCart}},updateCartQuantity:function(a){b.cartQuantity.text(a)},renderNatcUpsellAsinHiddenInputs:function(a){d(".ATCFormUpsellAsinData").remove(); for(var c=document.createDocumentFragment(),e=0;e<a.length;e++){var f=a[e];c.appendChild(g("items["+e+".upsell][asin]",f.asin)[0]);c.appendChild(g("items["+e+".upsell][offerListingId]",f.offerId)[0]);c.appendChild(g("items["+e+".upsell][quantity]",f.quantity)[0])}b.buyboxForm.append(c);k(a)},updateSelectedAsinsGiftCheck:k,getGiftWrapUpdate:function(){return b.giftCheck}}}});"use strict";l.when("A","ODSEventDispatcher","accessory-upsell-dom-helper").register("accessory-upsell-buybox-helper",function(f, d,a){var e=f.$;return new function(){function g(a){return r[p[a]]}function l(a){var b=p[a];return b?h[b][a]:x}function k(a,b,c){if("string"!==typeof a||0===a.length)throw new TypeError('The "asin" argument must be defined.');c="number"===typeof c?Math.max(1,c):1;var d=!q||f.objectIsEmpty(q);q={asin:a,offerId:b,quantity:c||1};t.dispatch(d?"PageAsinAdded":"PageAsinChanged",a,b,c)}function m(a,b,c){var d;a:{if(!q||q.asin!==a)for(d=0;d<n.length;d++)if(n[d].asin===a&&(!b||n[d].offerId===b))break a;d=-1}if(0<= d){var e=n[d],g=e.quantity;if(g===c)return!1;0===c?(n.splice(d,1),t.dispatch("UpsellAsinRemoved",a,b,c,g)):(e.quantity=c,t.dispatch("UpsellAsinChanged",a,b,c,g))}else-1===d&&0<c&&(d=l(a),n.push({asin:a,offerId:b,quantity:c,fixedCustomCartAttribute:d.isDigitalSubscription?d.fixedCustomCartAttribute:null,customAttributeValue:d.isDigitalSubscription?d.customAttributeValue:null,customAttributeName:d.isDigitalSubscription?d.customAttributeName:null,isDigitalSubscription:d.isDigitalSubscription,productLineItemCustomKeyValuePair:d.productLineItemCustomKeyValuePair, upsellLineItemCustomKeyValuePair:d.upsellLineItemCustomKeyValuePair}),t.dispatch("UpsellAsinAdded",a,b,c))}function c(){return f.copy(q)}function b(){return f.copy(n)}var h,r={},p={},q={},n=[],t=new d;(function(){e.each(["PageAsinAdded","PageAsinChanged","UpsellAsinAdded","UpsellAsinChanged","UpsellAsinRemoved"],e.proxy(function(a,b){this["register"+b]=e.proxy(t,"registerCallback",b);this["unregister"+b]=e.proxy(t,"unregisterCallback",b)},this))}).apply(this);this.registerAccessoryUpsellData=function(a){h= a;for(var b in h)if(h.hasOwnProperty(b)){a=h[b];r[b]=[];for(var c in a)a.hasOwnProperty(c)&&(r[b].push(c),p[c]=b)}};this.getParentAsin=function(a){return p[a]};this.getChildAsins=g;this.getProductData=l;this.parsePageAsin=function(){var b=a.parsePageAsinData();k(b.asin,b.offerId,b.quantity)};this.setPageAsin=k;this.addUpsellAsin=function(b,c,d){if("string"!==typeof b||0===b.length)throw new TypeError('The "asin" argument must be defined.');if(q&&q.asin===b)throw Error("Can not modify page asin."); d="number"===typeof d?Math.max(1,d):1;for(var e=g(b),f=0;f<e.length;f++){var h=e[f];h!==b&&m(h,"",0)}m(b,c||"",d);a.renderUpsellAsinsHiddenInputs(n);a.renderNatcUpsellAsinHiddenInputs(n)};this.removeUpsellAsin=function(b,c){m(b,c||"",0);a.renderUpsellAsinsHiddenInputs(n);a.renderNatcUpsellAsinHiddenInputs(n)};this.getPageAsin=c;this.getUpsellAsins=b;this.getAsins=function(){var a=c(),d=b();return[a].concat(d)};this.updateSelectedAsinsQuantity=function(b){if(isNaN(b)||1>b)throw Error("New quantity for upsell asins must be greater than 0."); q.quantity=b;for(var c=0;c<n.length;c++)n[c].quantity=b;a.updateUpsellAsinsQuantityInputs(b);a.renderNatcUpsellAsinHiddenInputs(n)};this.reset=function(){r={};p={};q={};n=[];a.reset()};this.resetUpsellData=function(){n=[]};this.updateGiftCheck=function(){a.updateSelectedAsinsGiftCheck(n)}}});"use strict";l.when("A","odsRefTagUtils").register("upsell-ref",function(f,d){var a=f.$;return f.createClass({init:function(e){e.delegate("input[type\x3dcheckbox]","change",function(){var e=a(this),f=e.is(":checked")? "checkboxSelected":"checkboxDeselected",e=e.parents(".a-checkbox").data("ref");d.send(e+"_"+f)})}})});"use strict";l.when("A").register("ld-upsell",function(f){var d=f.$;return f.createClass({init:function(a){a.find("input[type\x3dcheckbox]").is(":checked")&&this.addToCart(a)},addToCart:function(a){var e={clientName:"AmazonDevices",verificationSessionID:d("#session-id").val()},g=0;a.find("input[type\x3dcheckbox]:checked").each(function(a){var f=d(this).closest(".abbListItem");if(f){var c=f.find('input[name^\x3d"asin."]').val(), b=f.find('input[name^\x3d"offeringID."]').val(),f=f.find('input[name^\x3d"quantity."]').val();e["ASIN."+a]=c;e["offerListingID."+a]=b;e["quantity."+a]=f;g+=1;d("#selected-itemCount").val(g)}});var f=d.ajax({url:"/gp/add-to-cart/json/ref\x3dldabb",type:"POST",data:e});f.done(function(e){e=d("#ld-success-msg");e.find("#ld-count").html(g);1<g?e.find("#ld-accessories").removeClass("aok-hidden"):e.find("#ld-accessory").removeClass("aok-hidden");e.removeClass("aok-hidden");d(a).find("fieldset").hide()}); f.fail(function(a,e){d("#ld-error-msg").show()})}})})}); /* ******** */ (function(b){var d=window.AmazonUIPageJS||window.P,e=d._namespace||d.attributeErrors,a=e?e("DetailPageJumpLinksAssets",""):d;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,d,e){b.when("A","ready").execute("jump-links",function(a){var f=a.$,b=!1;f("#jump-links a").each(function(){if(!f(this.hash).length)return b=!0,!1});if(!b){f("body").addClass("jump-links-targets-exist");var e=d.ue;a.declarative("jump-links-click","click",function(c){var a=c.$target[0].hash, b=f(a).offset().top;c="jump-links-count_"+c.$target[0].id;var g=e.count(c)||0;e.count(c,g+1);d.history.pushState?d.history.pushState(null,null,a):(c=f(a),g=c.attr("id"),c.removeAttr("id"),d.location.hash=a,c.attr("id",g));f("html, body").stop().animate({scrollTop:b},500)})}})}); /* ******** */ (function(c){var d=window.AmazonUIPageJS||window.P,e=d._namespace||d.attributeErrors,a=e?e("DetailPageGiftingOptionAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,e){c.when("csmCounter","A").execute(function(a,b){function c(){var b=d("#gift-wrap");b.length&&(b=b.is(":checked"),a.update("dpGiftingSelected",b?1:0))}var d=b.$;d("#add-to-cart-button, #buy-now-button, #one-click-button").each(function(b,a){d(a).bind("click.makoGiftingMetrics",c)})}); "use strict";c.when("A").execute(function(a){a.declarative("gifting-popup-window","click",function(b){var a=b.data.windowName||"popupWindow",c=b.data.windowOptions||"width\x3d600,height\x3d400,scrollbars\x3dyes";b.$event.preventDefault();d.open(b.$target.prop("href"),a,c)})})}); /* ******** */ (function(c){var a=window.AmazonUIPageJS||window.P,e=a._namespace||a.attributeErrors,d=e?e("MakoCommonMetricAssets",""):a;d.guardFatal?d.guardFatal(c)(d,window):d.execute(function(){c(d,window)})})(function(c,a,e){c.now("mako-metric-logger").execute("MakoMetricLoggerEmpty",function(a){a||c.when("A").register("mako-metric-logger",function(a){function b(){}return{increment:b,update:b,counter:b,timer:b,suffixed:b}})});"use strict";c.now("mako-reftag-logger").execute("ReftagLoggerExecute",function(a){a|| c.when("A").register("mako-reftag-logger",function(a){function b(){}function c(a){if(!a)throw Error("refTag is not defined");d.post("/gp/digital/fiona/ajax/log.html/ref\x3d"+a)}var d=a.$;return{increment:c,update:b,counter:function(a){return function(){c(a)}},timer:b,suffixed:function(a,b){return function(c){return a(b+":"+c)}}}})});"use strict";c.now("mako-csm-logger").execute("MakoCsmLoggerExecute",function(d){d||c.when("A").register("mako-csm-logger",function(c){function b(){}function d(){return a.ue&& "function"===typeof a.ue.count?a.ue.count:b}function e(a){if(a){var b=d();b(a,(b(a)||0)+1)}}function g(a,b){a&&"number"===typeof b&&d()(a,b)}function h(a){var b=d();return function(c){b(a,c)}}function k(b){var c=function(){return{stop:function(){}}};if(a.performance&&"function"===typeof a.performance.now){var l=d();c=function(){var c=a.performance.now();return{stop:function(){var d=a.performance.now()-c;l(b,d)}}}}return{start:c}}function f(a,b){return function(c){return a(b+":"+c)}}return a.ue&&"function"=== typeof a.ue.count?{increment:e,update:g,counter:h,timer:k,suffixed:f}:{increment:b,update:b,counter:b,timer:b,suffixed:b}})});"use strict";c.now("mako-csa-logger").execute("MakoCsaLoggerExecute",function(d){d||c.when("A").register("mako-csa-logger",function(c){function b(){}function d(a,b){f("recordMetric",a,b)}function e(a){f("recordMetric",a,1)}function g(a){return function(b){d(a,b)}}function h(a,b){return function(c){return a(b+":"+c)}}function k(b){var c=function(){return{stop:function(){}}}; a.performance&&"function"===typeof a.performance.now&&(c=function(){var c=a.performance.now();return{stop:function(){var e=a.performance.now()-c;d(b,e)}}});return{start:c}}if(a.csa&&"function"===typeof a.csa){var f=a.csa("Metrics",{producerId:"mako-ml"});if("function"===typeof a.csa)return{increment:e,update:d,counter:g,timer:k,suffixed:h}}f=b;return{increment:b,update:b,counter:b,timer:b,suffixed:b}})})}); /* ******** */ (function(l){var m=window.AmazonUIPageJS||window.P,n=m._namespace||m.attributeErrors,g=n?n("DetailPagePreRegistrationAssets",""):m;g.guardFatal?g.guardFatal(l)(g,window):g.execute(function(){l(g,window)})})(function(l,m,n){l.when("A","a-checkbox","a-dropdown","ExtraDataHelper").register("PreRegistration.View",function(g,f,d,a){var e=g.$,k={},h=g.createClass({init:function(c,b){this.selectors={};this._setupSelectors(c,b);this.reset()},reset:function(){this._giftingCheckbox=f(this.selectors.GIFTING_CHECKBOX_SELECTOR); this._giftingCheckboxElement=e(this.selectors.GIFTING_CHECKBOX_SELECTOR);this._accountLinkingCheckbox=f(this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._accountLinkingCheckboxes=f(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._desktopQuantityDropdown=d.getSelect(this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR);this._mobileQuantityDropdown=d.getSelect(this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR);this._quantityAlert=e(this.selectors.QUANTITY_ALERT_SELECTOR);this._giftingAlert= e(this.selectors.GIFTING_ALERT_SELECTOR);this._mainGiftingAlert=e(this.selectors.MAIN_GIFTING_ALERT_SELECTOR);this._declaratives=e(this.selectors.DECLARATIVES_SELECTOR);this._forms=e(this.selectors.FORMS_SELECTOR);this._atcforms=e(this.selectors.ATC_FORM_SELECTOR);this._quantityAlert.length&&(this._quantityAlertFormatString=this._quantityAlert.html())},_setupSelectors:function(c,b){this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME="isDevicePreRegistered";this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER= "$PREREG_MAX_QUANTITY";this.selectors.AUI_HIDDEN_CLASS="aok-hidden";this.selectors.AUI_COLOR_TERTIARY="a-color-tertiary";this.selectors.GIFTING_CHECKBOX_SELECTOR="#gift-wrap"+c;this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR="#account-linking"+c;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR=".pre-reg-checkbox-option";this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR=b[c].desktopQuantityDropdown;this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR=b[c].mobileQuantityDropdown;this.selectors.QUANTITY_ALERT_SELECTOR= "#preregistrationQuantityAlert"+c;this.selectors.GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert"+c;this.selectors.MAIN_GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert";this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR="#preRegCheckboxText"+c;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR=".mako-pre-reg-checkbox-text";this.selectors.DECLARATIVES_SELECTOR="#atc-declarative, #buyNow .a-declarative";this.selectors.FORMS_SELECTOR="form#addToCart, form#mobile-installments, form#buyNow, form#buyNowCheckout, form#oneClickBuy, form#buyNowOneClickCheckout"; this.selectors.ATC_FORM_SELECTOR="#addToCart"},updateQuantityLimit:function(c){this._quantityAlert.length&&this._quantityAlertFormatString&&(c=this._quantityAlertFormatString.replace(this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER,c),this._quantityAlert.html(c))},_setDeclarativeExtraData:function(c){this._declaratives.each(function(){var b=e(this),f=b.data("action");f&&(b=b.data(f))&&b.inputs&&a.setObjectExtraData(b.inputs,c)})},_setFormHiddenInput:function(c){for(var b=document.querySelectorAll(this.selectors.ATC_FORM_SELECTOR), a=0;a<b.length;a++){var f=b[a],g="accountLinking"+a,d=e("[id\x3d"+g+"]");d&&d.length&&d.remove();d=document.createElement("input");d.type="hidden";d.name="items[0.base][additionalParameters][devicePreregistration][selected]";d.value=c;d.id=g;f.appendChild(d)}},_setFormExtraData:function(c){this._forms.each(function(){a.setFormExtraData(this,c)})},setAccountLinkingAttributeValue:function(c){var b={};b[this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME]=c;this._setDeclarativeExtraData(b);this._setFormExtraData(b); this._setFormHiddenInput(c)},_isCheckboxPresent:function(c){return!c.isEmpty()},_isCheckboxChecked:function(c){return!c.isEmpty()&&c.isChecked()},isGiftingChecked:function(){return this._isCheckboxChecked(this._giftingCheckbox)},isGiftingPresent:function(){return this._isCheckboxPresent(this._giftingCheckbox)},uncheckGiftingbox:function(){f(this.selectors.GIFTING_CHECKBOX_SELECTOR).uncheck();this._hide(this._mainGiftingAlert)},isAccountLinkingChecked:function(){return this._isCheckboxChecked(this._accountLinkingCheckbox)}, isAccountLinkingPresent:function(){return this._isCheckboxPresent(this._accountLinkingCheckbox)},getQuantity:function(){return this._desktopQuantityDropdown?this._desktopQuantityDropdown.val():this._mobileQuantityDropdown?this._mobileQuantityDropdown.val():1},scrollGiftingIntoView:function(){this._giftingCheckboxElement.length&&!g.onScreen(this._giftingCheckboxElement,5)&&this._giftingCheckboxElement[0].scrollIntoView()},_hide:function(c){c.addClass(this.selectors.AUI_HIDDEN_CLASS)},_show:function(c){c.removeClass(this.selectors.AUI_HIDDEN_CLASS)}, _isHidden:function(c){return c.hasClass(this.selectors.AUI_HIDDEN_CLASS)},showGiftingAlert:function(){this._show(this._giftingAlert)},hideGiftingAlert:function(){this._hide(this._giftingAlert)},showQuantityAlert:function(){this._show(this._quantityAlert)},hideQuantityAlert:function(){this._hide(this._quantityAlert)},isGiftingAlertHidden:function(){return this._isHidden(this._giftingAlert)},enableAccountLinkingCheckboxes:function(c){this._accountLinkingCheckboxes.enable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY); e(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);c?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},enableInstanceAccountLinkingCheckbox:function(c){this._accountLinkingCheckbox.enable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);e(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);c?this._accountLinkingCheckbox.check(): this._accountLinkingCheckbox.uncheck()},disableAccountLinkingCheckbox:function(){this._accountLinkingCheckboxes.uncheck();this._accountLinkingCheckbox.disable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},disableAccountLinkingCheckboxForQuantityCheck:function(){this._accountLinkingCheckbox.uncheck();this._accountLinkingCheckbox.disable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},isAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckbox.isEnabled()}, allAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckboxes.isEnabled()},updateAccountLinkingCheckboxes:function(c){c?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},openPopup:function(c){m.open(c,"popupWindow","width\x3d600,height\x3d400,scrollbars\x3dyes")}});return{getInstance:function(c,b){var a=""==c?"default":c;k[a]||(k[a]=new h(c,b));return k[a]}}});l.when("A","PreRegistration.View","PreRegistration.Metrics").register("PreRegistration.Controller", function(g,f,d){var a=g.$,e={},k={"":{quantityChangeEvent:"a:dropdown:selected:quantity",mobileQuantityDropdown:"#quantity",desktopQuantityDropdown:"#mobileQuantityDropDown"},"-installment":{quantityChangeEvent:"a:dropdown:selected:installmentsQuantityDropdown",mobileQuantityDropdown:"#installmentsQuantityDropdown",desktopQuantityDropdown:"#installmentsQuantityDropdown"},"-deals":{quantityChangeEvent:"a:dropdown:dealOrderQuantityDropdown:select",mobileQuantityDropdown:"#dealOrderQuantityDropdown", desktopQuantityDropdown:"#dealOrderQuantityDropdown"}},h,c=g.createClass({init:function(b,a){this.selectors={};this._data=b;this._view=f.getInstance(a,k);this._metrics=new d;this._suffix=a;this.reset(b);this._bindEventsOnce()},reset:function(b){this._setupSelectors(this._suffix);this._view.reset();this._view.uncheckGiftingbox();this._bindEventsDOM();"object"===typeof b?(this._showStatus=b.showStatus,this._maxQuantityLimit=b.maxQuantity,this._defaultValue=b.defaultValue,this._status=b.status,this._asin= b.asin,h=h===n?this._defaultValue:h,this._view.updateQuantityLimit(this._maxQuantityLimit),this._view.setAccountLinkingAttributeValue(this._defaultValue),this._reenableALC(),this._showStatus?this._metrics.emitGiftingAndAccountLinkingLoadedMetric(this._asin):this._metrics.emitGiftingLoadedMetric(this._asin)):this._view.setAccountLinkingAttributeValue("false")},_setupSelectors:function(b){this.selectors.QUANTITY_CHANGE_EVENT=k[b].quantityChangeEvent;this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME= "detail-page-gifting-declarative"+b;this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME="mako-gifting-declarative"+b;this.selectors.MOBILE_POPOVER_TRIGGER_EVENT="a:popover:beforeSlide:preRegistration-secview"+b;this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME="mako-gifting-declarative-mobile";this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME="mako-preReg-declarative"+b;this.selectors.POPUP_DECLARATIVE_NAME="preReg-popup-window"+b;this.selectors.INSTALLMENT_ATC_SELECTOR="#installments-button";this.selectors.ADD_TO_CART_SELECTOR= "#add-to-cart-button";this.selectors.BUY_NOW_BUTTON_SELECTOR="#buy-now-button";this.selectors.BUY_NOW_CLICK_EVENT="click.makoPreRegistration";this.selectors.ONE_CLICK_BUTTON_SELECTOR="#one-click-button";this.selectors.TWISTER_PLUS_AFTER_BUYBOX_UPDATE_EVENT="twisterPlus:selection:afterBuyBox:update"},_reenableALC:function(){this._view.isGiftingChecked()||(this._enableAccountLinkingCheckbox(h),this._view.hideGiftingAlert())},_giftingCheckboxChecked:function(){this._view.hideQuantityAlert();this._view.showGiftingAlert(); this._view.isAccountLinkingChecked()&&this._metrics.emitALForceUncheckedGiftingSelected(this._asin);this._disableAccountLinkingCheckbox()},_giftingCheckboxUnchecked:function(){this._view.hideGiftingAlert();this._enableAccountLinkingCheckbox()},_enableAccountLinkingCheckbox:function(){this._view.enableInstanceAccountLinkingCheckbox(h);this._view.setAccountLinkingAttributeValue(h?"true":"false")},_disableAccountLinkingCheckbox:function(){this._view.disableAccountLinkingCheckbox();h=this._view.isAccountLinkingChecked(); this._view.setAccountLinkingAttributeValue("false")},_bindEventsOnce:function(){g.on(this.selectors.MOBILE_POPOVER_TRIGGER_EVENT,this._handlePopupClickMobile.bind(this));g.declarative(this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME, "click",this._handleAccountLinkingClick.bind(this));g.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"click",this._handlePopupClick.bind(this));g.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"mouseenter",this._handlePopupHover.bind(this));g.on(this.selectors.TWISTER_PLUS_AFTER_BUYBOX_UPDATE_EVENT,this._handleTwisterPlusUpdate.bind(this))},_bindEventsDOM:function(){a(this.selectors.INSTALLMENT_ATC_SELECTOR).click(this._handleATC.bind(this,"ATC"));a(this.selectors.ADD_TO_CART_SELECTOR).click(this._handleATC.bind(this, "ATC"));a(this.selectors.BUY_NOW_BUTTON_SELECTOR).bind(this.selectors.BUY_NOW_CLICK_EVENT,this._handleATC.bind(this,"BUYNOW"));a(this.selectors.ONE_CLICK_BUTTON_SELECTOR).click(this._handleATC.bind(this,"ONECLICK"))},_handleGiftingClick:function(b){(this._isInputEvent(b)||this._isDefaultInstance())&&this._view.isGiftingPresent()&&(this._view.isGiftingChecked()?(this._giftingCheckboxChecked(),this._metrics.emitGiftingCheckedMetric(this._asin)):(this._giftingCheckboxUnchecked(),this._metrics.emitGiftingUncheckedMetric(this._asin)))}, _handleAccountLinkingClick:function(b){if(this._isInputEvent(b)&&this._view.isAccountLinkingPresent()){var a=this._view.isAccountLinkingChecked();a?(this._view.uncheckGiftingbox(),this._handleGiftingClick(b),this._metrics.emitALCheckedMetric(this._asin)):this._metrics.emitALUncheckedMetric(this._asin);h=a;this._view.updateAccountLinkingCheckboxes(a);this._view.setAccountLinkingAttributeValue(a?"true":"false")}},_handleTwisterPlusUpdate:function(){if(this._view.isAccountLinkingPresent()){var b=this._view.isAccountLinkingChecked(); this._view.setAccountLinkingAttributeValue(b?"true":"false")}},_handlePopupClick:function(b){b.$event.preventDefault();b=b.$target.prop("href");this._view.openPopup(b);this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},_handlePopupClickMobile:function(b){this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},_handlePopupHover:function(b){this._metrics.emitPopupHoverMetric(this._asin)},_handleATC:function(b){this._metrics.emitATCGiftingALSelectionMetric(this._asin,b,this._view.isGiftingChecked(), this._view.isAccountLinkingChecked())},_isInputEvent:function(b){return"input"===b.targetTag.toLowerCase()},_isStatusAllowedConditional:function(){return"ALLOWED_CONDITIONAL"===this._status},_isDefaultInstance:function(){return""===this._suffix},getInstanceData:function(){return this._data},emitInitializationMetrics:function(b){this._metrics.emitALCheckboxBuyboxInitializedMetric(this._data.asin,b);this._metrics.emitALCheckboxInitializedMetric(this._data.asin)}});return{getInstance:function(b,a){a= "undefined"===typeof a?"":a;var d=""===a?"default":a;e[d]?b&&e[d].reset(b):e[d]=new c(b,a);e[d].emitInitializationMetrics(d);return e[d]},reset:function(){Object.keys(e).forEach(function(a){var c=e[a].getInstanceData();e[a].reset(c)})}}});l.when("A","odsRefTagUtils","mako-csm-logger").register("PreRegistration.Metrics",function(g,f,d){return g.createClass({emitGiftingAndAccountLinkingLoadedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_AL_LOADED");f.send("PREREGISTRATION_"+a+"_GIFTING_AL_LOADED")}, emitALCheckboxInitializedMetric:function(a){d.increment("PREREGISTRATION_AL_ASSETS_INITIALIZED");f.send("PREREGISTRATION_"+a+"_AL_ASSETS_INITIALIZED")},emitALCheckboxBuyboxInitializedMetric:function(a,e){e&&0<e.length&&(e=e.replace("-","").toUpperCase(),d.increment("PREREGISTRATION_"+e+"_AL_ASSETS_INITIALIZED"),f.send("PREREGISTRATION_"+a+"_"+e+"_AL_ASSETS_INITIALIZED"))},emitGiftingLoadedMetric:function(a){d.increment("PREREGISTRATION_ONLY_GIFTING_LOADED");f.send("PREREGISTRATION_"+a+"_ONLY_GIFTING_LOADED")}, emitALForceUncheckedQuantityHigh:function(a){d.increment("PREREGISTRATION_AL_FORCE_UNCHECKED_QUANTITYHIGH");f.send("PREREGISTRATION_"+a+"_AL_FORCE_UNCHECKED_QUANTITYHIGH")},emitALForceUncheckedGiftingSelected:function(a){d.increment("PREREGISTRATION_AL_FORCE_UNCHECKED_GIFTINGSELECTED");f.send("PREREGISTRATION_"+a+"_AL_FORCE_UNCHECKED_GIFTINGSELECTED")},emitGiftingCheckedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_CHECKED");f.send("PREREGISTRATION_"+a+"_GIFTING_CHECKED")},emitGiftingUncheckedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_UNCHECKED"); f.send("PREREGISTRATION_"+a+"_GIFTING_UNCHECKED")},emitALCheckedMetric:function(a){d.increment("PREREGISTRATION_AL_CHECKED");f.send("PREREGISTRATION_"+a+"_AL_CHECKED")},emitALUncheckedMetric:function(a){d.increment("PREREGISTRATION_AL_UNCHECKED");f.send("PREREGISTRATION_"+a+"_AL_UNCHECKED")},emitWhyIsThisImportantClickedMetric:function(a){d.increment("PREREGISTRATION_WHY_IS_THIS_IMPORTANT_CLICKED");f.send("PREREGISTRATION_"+a+"_WHY_IS_THIS_IMPORTANT_CLICKED")},emitPopupHoverMetric:function(a){d.increment("PREREGISTRATION_WHY_IS_THIS_IMPORTANT_HOVER"); f.send("PREREGISTRATION_"+a+"_WHY_IS_THIS_IMPORTANT_HOVER")},emitATCGiftingALSelectionMetric:function(a,e,g,h){g?(d.increment("PREREGISTRATION_"+e+"_GIFTING_CHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_GIFTING_CHECKED")):(d.increment("PREREGISTRATION_"+e+"_GIFTING_UNCHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_GIFTING_UNCHECKED"));h?(d.increment("PREREGISTRATION_"+e+"_AL_CHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_AL_CHECKED")):(d.increment("PREREGISTRATION_"+e+"_AL_UNCHECKED"),f.send("PREREGISTRATION_"+ a+"_"+e+"_AL_UNCHECKED"))}})});l.when("A","PreRegistration.Controller").execute(function(g,f){g.on("a:accordion:buybox_accordion:select",function(d){f.reset()});g.on("a:accordion:buybox-accordion:select",function(d){f.reset()})});"use strict";l.when("a-checkbox","add-to-cart-parameter-name","add-to-cart-constants").register("mobile-app-account-linking",function(g,f,d){return{updateData:function(a){var e=f.constructParameterName(d.ITEM_TYPES.BASE,0,d.PARAMETER_PATHS.DEVICEPREREGISTRATION),k=g("#account-linking"); 0<k.size()&&k.isChecked()?a.inputs[e]="true":a.inputs[e]="false";return a}}})}); /* ******** */ (function(c){var d=window.AmazonUIPageJS||window.P,h=d._namespace||d.attributeErrors,a=h?h("DetailPageQRMAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,h){c.when("singletonPopupModal","a-dropdown","jQuery","csm-counter").register("quantity-restriction-messaging",function(a,d,k,l){return{quantityModal:function(e){var c=k("#quantity"),g=k("#cspQuantity"),f=function(){var b={};return"lastQuantityOption"===c.find("option:selected").attr("data-a-id")? (b.id=c,b.dropdown="quantity",b.popoverTitle=e.popoverTitle,b.message=e.message,b.plusOne=e.moq,b):"lastQuantityOption"===g.find("option:selected").attr("data-a-id")?(b.id=g,b.dropdown="cspQuantity",b.popoverTitle=e.popoverTitle,b.message=e.cspMessage,b.plusOne=e.cspMOQ,b):null},m=function(){var b=f();null!==b&&b.message&&(a.show({width:502,position:"triggerRight",header:b.popoverTitle,inlineContent:b.message.replace(/MAX_QUANTITY_PLUS_ONE/g,b.plusOne)},!0),b.id.selectedIndex=0,(b=d.getSelect(b.dropdown))&& b.getOption(0).update({selected:!0}),l.increment("last-quantity-option-click-count"))};c.change(m);g.change(m);m()}}});"use strict";c.when("A").register("csm-counter",function(a){var c=a.$;return{register:function(k,a,e){k&&a&&e&&c(k).bind(a,c.proxy(this.increment,this,e))},increment:function(a){a&&d.ue.count(a,(d.ue.count(a)||0)+1)},update:function(a,c){a&&"number"===typeof c&&d.ue.count(a,c)}}});"use strict";c.when("A","jQuery","a-modal").register("singletonPopupModal",function(a,c,d){function l(a){null=== f?(g=h.appendTo(c("body")),f=d.create(g,a)):f.update(a);f.show()}function e(){f&&f.hide()}var h=c('\x3cdiv style\x3d"display:none"\x3e'),g=null,f=null;a.declarative("cfg-singleton-modal-close","click",e);a.declarative("cfg-singleton-modal-open","click",function(a){l({inlineContent:a.data.inlineContent,header:a.data.header,width:a.data.width||"502",position:"triggerRight"},!0)});return{show:l,hide:e,destroy:function(){f&&(d.remove(f),f=null)}}})}); /* ******** */ (function(c){var l=window.AmazonUIPageJS||window.P,p=l._namespace||l.attributeErrors,d=p?p("MakoShadowCartAssets",""):l;d.guardFatal?d.guardFatal(c)(d,window):d.execute(function(){c(d,window)})})(function(c,l,p){c.declare("Mako.ShadowCart.Experiments",{EventCycleOrderEnforcement:!0});c.when("A").register("Mako.ShadowCart.Helpers",function(d){function e(b){return[].slice.call(b)}function h(b,d){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector); return b.matches(d)}return{arrayFrom:e,elementMatches:h,keysAsEnum:function(){function b(a,b){a[b]=b;return a}for(var g=e(arguments),a=0,f={};a<g.length;a++)f=d.reduce(Object.keys(g[a]),b,f);return f},selectorMapReducer:function(b,d){return function(a,f){b.hasOwnProperty(f)&&h(d,b[f])&&(a=f);return a}}}});c.declare("Mako.ShadowCart.Selectors",{AddToCartButton:"#add-to-cart-button",BuyBox:"#buybox",BuyNowButton:"#buy-now-button",DesktopRightColumn:"#rightCol",DesktopBuybox:"#desktop_buybox",InstallmentButton:"#installments-button", LightningDealButton:"#goldboxBuyBox button",MobileAppBuybox:"#mobileapp_buybox_feature_div",MobileWebBuybox:"#mobile_buybox_feature_div",PreOwnedCrossSellButton:"span#preOwnedCrossSellCertRefurb-addToCart input",UsedDesktopButton:"#add-to-cart-button-ubb",UsedMobileButton:"#add-to-cart-button-ubb-mobile"});c.declare("Mako.ShadowCart.EventNames",{AtcIntention:"shadowcart:atc:intention",AtcSubmitted:"shadowcart:atc:submitted",AuiMashAtc:"dpx:add-to-cart:success",MakoCommonCartRequestComplete:"mako:common-cart-request:complete"}); c.when("A","Mako.ShadowCart.Selectors","Mako.ShadowCart.Helpers").register("Mako.ShadowCart.Checkout",function(d,e,h){var b={BuyNow:e.BuyNowButton,AddToCart:e.AddToCartButton,Installment:e.InstallmentButton,UsedDesktop:e.UsedDesktopButton,UsedMobile:e.UsedMobileButton,PreOwnedCrossSell:e.PreOwnedCrossSellButton,LightningDeal:e.LightningDealButton};return{Types:h.keysAsEnum(b,{Unknown:"Unknown"}),getTypeByClickTarget:function(e){return e?d.reduce(Object.keys(b),h.selectorMapReducer(b,e),"Unknown"): "Unknown"}}});c.when("A","Mako.ShadowCart.Selectors","Mako.ShadowCart.Helpers").register("Mako.ShadowCart.Cbb",function(d,e,h){var b,g={MobileWebBuybox:e.MobileWebBuybox,MobileAppBuybox:e.MobileAppBuybox,DesktopBuybox:e.DesktopBuybox};return{Types:h.keysAsEnum(g,{Unknown:"Unknown"}),getType:function(){var a;(a=b)||(a=(a=document.querySelector(e.BuyBox))&&a.parentElement?d.reduce(Object.keys(g),h.selectorMapReducer(g,a.parentElement),"Unknown"):"Unknown");return b=a}}});c.register("Mako.ShadowCart.MetricsVars", function(){return{UeCountIncrement:1,Suffixes:{ForBeginKey:":bb",ForEndKey:":be",ForPerformanceMeasureKey:":performance"},Keys:{AtcIntention:"shadowcart:atc-intention",AtcSubmitted:"shadowcart:atc-submitted",PreAtcEventQueue:"shadowcart:pre-atc-events",PostAtcEventQueue:"shadowcart:post-atc-events",IntentionToSubmission:"shadowcart:atc-intention-submitted"}}});c.when("Mako.ShadowCart.MetricsVars").register("Mako.ShadowCart.Metrics",function(d){function e(a,b){return"string"===typeof a?a.replace(b, "")+b:null}function h(a,b){b=b||d.UeCountIncrement;l.ue&&l.ue.count&&l.ue.count(a,b)}var b=l.performance,g=!!(b&&b.mark&&b.measure&&b.getEntriesByName);return{markCount:h,markPerformanceBegin:function(a){(a=e(a,d.Suffixes.ForBeginKey))&&g&&b.mark(a)},markPerformanceEnd:function(a){var f=e(a,d.Suffixes.ForEndKey);if(f&&g){b.mark(f);var c=e(a,d.Suffixes.ForBeginKey);a=e(a,d.Suffixes.ForPerformanceMeasureKey);c&&f&&a&&(b.measure(a,c,f),f=b.getEntriesByName(a),0<f.length&&(f=f.pop())&&h(a,f.duration))}}}}); c.when("A","Mako.ShadowCart.Cbb","Mako.ShadowCart.Checkout","Mako.ShadowCart.EventNames","Mako.ShadowCart.Experiments","Mako.ShadowCart.Metrics","Mako.ShadowCart.MetricsVars").register("Mako.ShadowCart.CaptureAtcIntention",function(d,e,h,b,g,a,f){function c(r){return function(c){if(g.EventCycleOrderEnforcement){r.stopListening();var n=c.target,k=c.currentTarget}else n=c.target||null,k=c.currentTarget||null;if(n&&k){var q=h.getTypeByClickTarget(n);if(q!==h.Types.Unknown){a.markPerformanceBegin(f.Keys.IntentionToSubmission); a.markCount(f.Keys.AtcIntention);a.markCount(f.Keys.AtcIntention+":"+q.toLowerCase());if(g.EventCycleOrderEnforcement)k=d.$(n).closest("form"),k=k.length?k[0]:null;else a:{for(var m=n.parentElement;m&&m!==k;m=m.parentElement)if("form"===m.nodeName.toLowerCase()){k=m;break a}k=null}m=e.getType();c={captureInstance:r,cbbType:m,checkoutButton:n,checkoutType:q,event:c,form:k};l(c,k,[b.AuiMashAtc,b.MakoCommonCartRequestComplete]);d.trigger(b.AtcIntention,c)}}}}function l(c,e,h){var k=function(){a.markPerformanceEnd(f.Keys.IntentionToSubmission); a.markCount(f.Keys.AtcSubmitted);a.markCount(f.Keys.AtcSubmitted+":"+c.checkoutType.toLowerCase());d.trigger(b.AtcSubmitted,c);e&&e.removeEventListener("submit",k);d.each(h,function(a){d.off(a,k)});g.EventCycleOrderEnforcement&&c.captureInstance.startListening()};e&&e.addEventListener("submit",k);d.each(h,function(a){d.on(a,k)})}return function(a){var b=c(this);this.startListening=function(){a&&a.addEventListener("click",b,!0)};this.stopListening=function(){a&&b&&a.removeEventListener("click",b,!0)}}}); c.when("A","Mako.ShadowCart.CaptureAtcIntention","Mako.ShadowCart.EventNames","Mako.ShadowCart.Metrics","Mako.ShadowCart.MetricsVars","Mako.ShadowCart.Selectors").register("Mako.ShadowCart",function(d,e,c,b,g,a){function f(a){b.markPerformanceBegin(g.Keys.PreAtcEventQueue);b.markPerformanceEnd(g.Keys.PreAtcEventQueue)}function l(){b.markPerformanceBegin(g.Keys.PostAtcEventQueue);b.markPerformanceEnd(g.Keys.PostAtcEventQueue)}if(a=document.querySelector(a.DesktopRightColumn)||document.querySelector(a.BuyBox)|| null)d.on(c.AtcIntention,f),d.on(c.AtcSubmitted,l),(new e(a)).startListening()})}); /* ******** */ (function(e){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,a=g?g("AmazonDevicesDetailPageAssets",""):f;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,f,g){e.when("A").register("installments-checkbox-module",function(a){var c=a.$,e,d,b;return a.createClass({init:function(a){a.undelegate("#installments-payment-checkbox","change",c.proxy(this._handleChange,this));a.delegate("#installments-payment-checkbox","change",c.proxy(this._handleChange, this));e=c("#addToCart");d=c("\x3cinput\x3e").attr({type:"hidden",name:"installments-check",id:"installments-check"});b=c("#OneClickBox");c("#installments-payment-checkbox").removeAttr("disabled");c("#installments-payment-checkbox").prop("checked")&&this._checkedHandler()},_handleChange:function(a){c("#installments-payment-checkbox").prop("checked")?this._checkedHandler():this._uncheckedHandler()},_checkedHandler:function(){e.prepend(d);b&&(b.find(".a-button-stack").addClass("aok-hidden"),b.find("#installmentsQuantity").removeClass("aok-hidden"), b.find("#diodeQuantityDropdown").addClass("aok-hidden"))},_uncheckedHandler:function(){d.remove();b&&(b.find(".a-button-stack").removeClass("aok-hidden"),b.find("#installmentsQuantity").addClass("aok-hidden"),b.find("#diodeQuantityDropdown").removeClass("aok-hidden"))}})});"use strict";e.when("A","a-carousel-framework","ready").register("family-stripe",function(a,c){function e(a,c){g.each(function(){this.id!==a+"_carousel"&&d(this).toggleClass("invisible-family-stripe",c)})}var d=a.$,b=d("#dpx-subnav_div"), f=d("#familyStripe_feature_div"),g=f.find(".family");f.insertAfter(b);(function(){d("#mako-subnav-helper .fs-content-links").each(function(){var a=this.id;d("#"+a+"_carousel").length&&d("#"+a+"_caret_wrapper").addClass("active")})})();a.declarative("family-stripe-hover","mouseenter mouseleave",function(a){var b=a.data.code;a="mouseenter"===a.type;var g=d("#"+b+"_carousel"),h=d("#"+b+" span");h.toggleClass("a-color-state",a);h.toggleClass("a-color-base",!a);g.length&&(f.toggleClass("active-family-stripe", a),d("#"+b).toggleClass("active-family-stripe",a),g.toggleClass("active-family-stripe",a),e(b,a));c.createAll();c.initializeAll()})});"use strict";e.when("A","odsRefTagUtils","ready").execute(function(a,c){a=a.$;0<a("[name\x3d'submit.bundlebuilder']").length&&(a="mako_bb_button_is_present_"+a("#ASIN")[0].value,c.send(a,""))})}); /* ******** */ (function(k){var g=window.AmazonUIPageJS||window.P,p=g._namespace||g.attributeErrors,d=p?p("TradeInInstantSavingsAssets@launcher","TradeInInstantSavingsAssets"):g;d.guardFatal?d.guardFatal(k)(d,window):d.execute(function(){k(d,window)})})(function(k,g,p){k.when("A").register("trade-in-constants",function(d){return{unauthorizedCode:401,maxTradeInItemQuantityStatusCode:204,autoCompleteUrl:"https://completion.amazon.com/api/2017/suggestions?",autoCompleteUrlSuffix:"/api/2017/suggestions?",tradeInRouteBase:"/tradein/hzw/", appraisalInputName:"appraisal",customerIpPreferenceInputName:"instantPaymentPreference",appraisalReturn:"RETURN_WORSE",appraisalAccept:"ACCEPT_WORSE",itemSelectEligibleContext:"eligible",itemSelectSearchContext:"search",maximumTradeInItemsCount:5,tradeInSearchAlias:"ereaders",tradeInSearchPageSize:20,tanookiV2DesktopRowSize:3,tanookiV2MobileRowSize:2,tanookiV2DesktopSearchPageSize:15,tanookiV2MobileSearchPageSize:10,tradeInSearchResultsLoadContext:"onLoad",tradeInSearchResultsScrollContext:"onScroll", sessionStorageAccessErrorMsg:"Session storage access blocked",AUTH_PORTAL_ASSOC_HANDLE:{com:"amzn_tradein_horizonte_us",uk:"amzn_tradein_horizonte_uk",de:"amzn_tradein_horizonte_de"},tradeInSecondaryViewName:"tradeInSecondaryView",tradeInModalName:"tradeInModal",tradeInSideSheetName:"tradeInSideSheet",csrfKeyMap:"csrfKeyMap",csrfQueryParam:"requestToken",csrfSearchRequestKey:"searchRequestKey",csrfReviewRequestKey:"reviewRequestKey",csrfRemoveRequestKey:"removeItemRequestKey",csrfSubmitRequestKey:"submitRequestKey", csrfSaveGradedItemKey:"saveGradedItemRequestKey",csrfSearchAsinCategoryItemKey:"searchAsinCategoryRequestKey",validConditions:"N/A;Neutral;New;LikeNew;VeryGood;Good;Working;Acceptable;Damaged;NonFunctional;Unacceptable;Ruined;Wrong Item".split(";"),resetAllElementsEvent:"resetAllElementsEvent",priceBlockSessionStorageKey:"launchTradeInPriceBlock",tanookiSessionStorageKey:"launchTradeIn",tanookiV2SessionStorageKey:"launchAsinCategoryTradeIn",priceBlockTanookiV2SessionStorageKey:"launchAsinCategoryTradeInPriceBlock", priceBlockIngressType:"tradein-price-block",recycleAndSaveIngressType:"tradein-recycle-save",tanookiBuyboxMetric:"tanooki_launch_buy_box",tanookiBuyboxMobileMetric:"tanooki_launch_buy_box_mobile",tanookiPriceblockMetric:"tanooki_launch_price_block",tanookiPriceblockMobileMetric:"tannoki_launch_price_block_mobile",tanookiV2PastPurchaseSelectedMetric:"tv2_past_purchase_item_selected",refTagPrefix:"dp_trdv2_is_",refTagPrefixMobile:"dp_trdv2_is_m_",refTagPriceBlockPrefix:"dp_price_block_",refTagPriceBlockPrefixMobile:"dp_price_block_m_", refTagRecycleAndSaveTanookiPrefix:"dp_recycle_save_tanooki_ingress_",refTagRecycleAndSaveTanookiPrefixMobile:"dp_recycle_save_tanooki_ingress_m",refTagListItemsView:"list_items_view",refTagSearchItemsView:"search_items_view",refTagConditionView:"condition_view",refTagConfirmationView:"confirmation_view",refTagSuccessfulView:"success_view",refTagSearchTermRequest:"search_term_request_",refTagSearchItemRemoveClick:"search_remove_click",refTagBackClick:"back_click",refTagListItemsContinueClick:"list_items_continue_click", refTagGradedConditionClick:"graded_condition_",refTagAppraisalAccept:"appraisal_accept",refTagAppraisalReturn:"appraisal_return",refTagConditionContinueClick:"condition_continue_click",refTagReviewInstantPaymentView:"review_ip_view",refTagReviewNonInstantPaymentView:"review_nip_view",refTagReviewMixedBagPaymentView:"review_mb_view",refTagChangeConditionClick:"change_condition_click",refTagDeleteClick:"delete_click",refTagReturnAddressUpdateRequest:"return_address_update_request",refTagReturnAddressUpdateView:"return_address_update_view", refTagTradeInMoreItems:"trade_more_items",refTagReturnToShopping:"return_to_shopping_click",refTagLogInPrompt:"log_in_prompt",refTagWeWantYouToKnow:"we_want_you_to_know_expanded",refTagPromotionInformationPopoverView:"promotion_information_panel_view",refTagAppraisalLearnMorePopoverView:"appraisal_learn_more_panel_view",refTagRegisteredDevicesLearnMorePopoverView:"registered_devices_learn_more_panel_view",refTagViewDropOffLocations:"view_drop_off_locations",refTagViewUBIFLocations:"view_ubif_locations", refTagButtonExperimentPreFix:"tanooki_",refTagTanookiLaunchedWithBlue:"lwbl",refTagTanookiLaunchedWithBorder:"lwbo",refTagTermsAndConditions:"select_terms_and_conditions",refTagHowToLink:"select_how_to_link",refTagPrintShippingLabel:"tv2_print_shipping_label",refTagNearbyProcessorsMobile:"nearby_processors_m",refTagNearbyProcessorsDesktop:"nearby_processors",refTagStorefront:"sf",refTagDetailPage:"detail_page",refTagTv2:"tv2_",refTagPriceBlockIngress:"pb_",refTagAuthRequired:"AuthReq",refTagAuthCompleted:"AuthComp", refTagBackButton:"Back_",refTagExit:"Exit_",refTagEnd:"End",refTagChangeCondition:"ChgCond",refTagRemoveCartItem:"RmvItm",refTagHazmatError:"HazmatError",refTagIPDowngrade:"IPDowngrade",refTagIPUpgrade:"IPUpgrade",refTagMFAFailure:"_mfaFailure",refTagMFASuccess:"_mfaSuccess",BIFURCATION_REF_TAG:["tradein-manufacturer","tradein-vg-type"],VIEW_REF_TAG:{manufacturer:"Man",model:"Mod","model-family":"ModFam","storage-size":"Stor","product-category":"product_category",carrier:"Carr","Console-Generation":"ConGen", "Console-generation":"ConGen",Games:"Games",Accessories:"Access",platform:"Plat","trade-in-item-type":"IT",".refinement-search-view":"Search","#conditionViewTemplate":"Cond",".submit-trade-in-content":"Review",".tradein-cart-view":"Cart","#tradeinReviewYourOrderNextStepTemplate":"NxtStp"},PRODUCT_GROUP_REF_TAG:{gl_wireless:"Wir",gl_electronics:"Elec",gl_video_games:"VG",gl_digital_video_games:"VG",gl_digital_products_3:"AUCC"},PRODUCT_GROUP_SHORT_REF_TAG:{gl_wireless:"WL",gl_electronics:"WL",gl_video_games:"VG", gl_digital_video_games:"VG",gl_digital_text:"eink",gl_digital_text_2:"tablet",gl_digital_products_3:"efd",gl_digital_devices_4:"smp",gl_digital_products_9_accessory:"vicc_rg",gl_vdo_devices:"vicc_bl",gl_digital_products_22_accessory:"eero",gl_digital_products_18_accessory:"health"},APPRAISAL_REF_TAG:{ACCEPT_WORSE:"Accpt",RETURN_WORSE:"Dcln"},eligibleListViewClass:".tradein-eligible-list-view",searchResultsListViewClass:".tradein-search-results-list-view",selectedItemConditionViewClass:".tradein-selected-item-condition-view", selectedItemsConfirmationViewClass:".tradein-selected-items-confirmation-view",successfulViewClass:".tradein-successful-view",tradeInWrapperClass:".tradein-wrapper",checkboxItemThumbTemplateId:"#checkboxItemThumbTemplate",eligibleItemTemplateId:"#eligibleItemTemplate",questionRadioButtonTemplateId:"#questionRadioButtonTemplate",questionRadioTemplateId:"#questionRadioTemplate",radioButtonTemplateId:"#radioButtonTemplate",itemConfirmationTemplateId:"#itemConfirmationTemplate",asinDetailsViewTemplateId:"#asinDetailsViewTemplate", eligibleListViewTemplateId:"#eligibleListViewTemplate",pastPurchasedListViewTemplateId:"#pastPurchasedListViewTemplate",searchResultsListViewTemplateId:"#searchResultsListViewTemplate",searchResultItemTemplateId:"#searchResultItemTemplate",selectedItemConditionViewTemplateId:"#selectedItemConditionViewTemplate",selectedItemsConfirmationViewTemplateId:"#selectedItemsConfirmationViewTemplate",successfulTradeInViewTemplateId:"#successfulTradeInViewTemplate",radioButtonRestrictionSelectionTemplateId:"#radioButtonRefinementSelectorViewTemplate", cardItemRestrictionSelectionViewTemplateId:"#searchRestrictionCardItemSelectionTemplate",conditionViewTemplateId:"#conditionViewTemplate",tradeinHeaderViewTemplateId:"#tradeinHeaderViewTemplate",tradeinCartHeaderTemplateId:"#tradeInCartHeaderTemplate",tradeinCartSubmitViewHeaderTemplateId:"#tradeInCartHeaderTemplateSubmitView",tradeInCartPromosTemplateId:"#tradeInCartPromosTemplate",tradeInPromoPreviewViewTemplate:"#tradeInPromoPreviewViewTemplate",verticalComplexCardViewTemplateId:"#verticalComplexCardViewTemplate", appraisalSelectionComponentViewId:"#appraisalSelectionComponentView",promotionInformationComponentId:"#promotionInformationComponent",appraisalWrapperClass:".appraisal-wrapper",conditionAppraisalMaxTivClass:".appraisal-max-tiv",appraisalTivHeaderClass:".appraisal-tiv-header",appraisalTivPriceClass:".appraisal-tiv",termsAndAgreementViewTemplateId:"#termsAndAgreementViewTemplate",multiItemTermsAndAgreementViewTemplateId:"#additionalItemTermsAndAgreementViewTemplate",multiItemTermsAndAgreementViewTemplateDevicesId:"#additionalItemTermsAndAgreementViewTemplateDevices", tradeinReviewYourOrderNextStepTemplateId:"#tradeinReviewYourOrderNextStepTemplate",mixedOfferNextStepsTemplateId:"#mixedOfferNextStepsTemplate",multiItemConfirmationOrderDetailsViewComponentClass:".multiItemConfirmationOrderDetailsViewComponent",wirelessHowToViewTemplateId:"#wirelessHowToViewTemplate",howToLinkHelperTitleId:"#categoryHelperTitle",tradeinFooterComponentId:"#tradeinFooterComponent",successfulTradeInBannerComponentViewId:"#successfulTradeInBannerComponentView",restrictionSelectionViewTemplateId:"#restrictionSelectionViewTemplate", tradeInSubmitConditionButtonTemplateId:"#tradeInSubmitConditionButtonTemplate",conditionQuestionnaireListClass:".questionnaires-list",conditionQuestionContainerClass:".condition-question-container",conditionQuestionButtonSelectorClass:".question-selector-button",conditionPageEstimatedTivComponentsSelector:"#tradeinEstimateOfferComponent .estimate-component",conditionPageFinalTivComponentsSelector:"#tradeinEstimateOfferComponent .final-component",conditionPageHeaderTivSelector:"#tradeinEstimateOfferComponent #tradeInValue", binaryQuestionnaireListViewTemplateId:"#binaryQuestionnaireListViewTemplate",searchRefinementItemSelectionTemplateId:"#searchRefinementItemSelectionTemplate",refinementSearchViewTemplateId:"#refinementSearchViewTemplate",refinementSearchInputSelector:".refinement-search-input",refinementSearchInputMobileSelector:".refinement-search-input input",refinementSearchAllOffersCountId:"#searchAllOffersCount",refinementSearchOnlyOffersCountId:"#searchOnlyOffersCount",refinementSearchResultSelector:".refinement-selection-content .refinement-column", shipmentDetailViewComponentId:"#shipmentDetailViewComponent",dropOffBannerNoLinkComponentId:"#dropOffBannerNoLinkComponent",dropOffBannerNoLinkTemplateId:"#dropOffBannerNoLinkTemplate",dropOffLocationExpanderId:"#dropOffLocationExpander",dropOffLocationsTemplateId:"#dropOffLocationsTemplate",dropOffLocationListTemplateId:"#dropOffLocationListTemplate",offlineMessageSectionClass:".offline-message-section",tradeInOfferOverviewTemplateId:"#tradeInOfferOverviewTemplate",categoryRefinementSelectionItemComponentId:"#categoryRefinementSelectionItemComponent", tradeinCartItemComponentId:"#tradeInCartItemComponent",shipmentDetailsHeaderComponentClass:".shipment-details-header-component",tradeinSubmitButtonComponentClass:".tradein-submit-button-container",tradeinSubmitWrapperComponentId:"#tradeinSubmitWrapper",refinementSelectionViewWrapperClass:".refinement-selection-view",refinementContentWrapperClass:".refinement-content-wrapper",refinementSearchViewClass:".refinement-search-view",submitTradeInWrapperClass:".submit-trade-in-content",searchRestrictionWrapperClass:".search-restriction-wrapper", searchLoadMoreResultsWrapperClass:".load-more-results-wrapper",cardItemRestrictionSelectionViewClass:".restriction-selection-view",wirelessTradeInReviewYourOrderViewClass:".wireless-tradein-review-your-order-view",tradeInCartViewClass:".tradein-cart-view",tradeInCartTemplateId:"#tradeInCartViewTemplate",tradeinCartTotalTivElement:".cart-total-tiv",tradeinCartGCValueIpElement:"#gcValueIp",tradeinCartGCValueNonIpElement:"#gcValueNonIp",tradeinCartIpItemsSection:".tradein-cart-view-ip-items",tradeinCartNonIpItemsSection:".tradein-cart-view-nip-items", tradeinCartIpItemsList:".tradein-cart-item-list-ip",tradeinCartNonIpItemsList:".tradein-cart-item-list-nip",continueConditionButtonViewClass:".continue-trigger",submitButtonViewClass:".handle-submit-your-tradein",reviewButtonViewClass:".handle-review-your-tradein",tradeInMoreItemsButtonViewClass:".handle-trade-in-more-items",agreementCheckboxTarget:".agreement-checkbox-target",tradeInMoreItemsButtonContainerClass:".tradein-more-items-button-container",searchInputClass:".search-input",searchInputClassMobile:".search-input input", searchFormClass:".search-form",searchSuggestionsClass:".tradein-autocomplete-dropdown-menu",eligibleItemsCountId:"#eligibleItemsCount",dateRegisteredClass:".registered-date",eligibleItemListClass:".tradein-eligible-item-list",eligibleItemListWrapper:".tradein-eligible-item-list-wrapper",searchResultListClass:".tradein-search-result-list",reviewTradeInItemsSubmitId:"#reviewTradeInItemsSubmit",customerPastDevicesPurchasesCarouselContainerId:"#customerPastDevicesPurchasesCarouselContainer",currentSelectedItemIndexId:"#currentSelectedItemIndex", selectedItemTotalCountId:"#selectedItemTotalCount",backButtonClass:".back-button",continueButtonClass:".continue-button",alertMaxItemQuantityClass:".tradein-error-quantity-limit",alertMaxItemsWarningClass:".tradein-warning-max-items",alertMaxItemsWarningClassMobile:".tradein-mobile-warning-max-items",alertMaxGCValueWarningClass:".tradein-warning-max-gc-value",alertMaxGCValueWarningClassMobile:".tradein-mobile-warning-max-gc-value",alertPromptLoginClass:".tradein-prompt-log-in",alertItemAcceptableClass:".tradein-info-unacceptable-error", alertItemAcceptableClassMobile:".tradein-mobile-info-unacceptable-error",alertMaxItemQuantityBannerClass:".tradein-max-quantity-error",loadingSpinnerClass:".tradein-loading-spinner",loadingSideSheetSpinnerClass:".asin-selection-tradein-loading-spinner",searchLoadingSpinnerClass:".tradein-search-loading-spinner",tradeinCartHeaderItemsSingularClass:".tradein-cart-header-items-singular",tradeinCartHeaderItemsPluralClass:".tradein-cart-header-items-plural",tradeInQuantityExceededErrorSelector:".tradein-templates .tradein-info-quantity-exceeded-error", tradeInAmountExceededErrorSelector:".tradein-templates .tradein-info-amount-exceeded-error",tradeInErrorExitButtonSelector:".tradein-templates .tradein-error-exit-button",tradeInMixHazmatErrorSelector:".tradein-templates .tradein-info-mix-hazmat-error",tradeInMixHazmatCartItemErrorSelector:".tradein-templates .tradein-info-mix-hazmat-error-cart-item",tradeInHazmatItemList:".hazmat-item-list",tradeInHazmatListItemTemplate:".hazmat-asin-list-item-template",tradeInNonTradeableErrorSelector:".tradein-templates .tradein-info-non-tradeable-error", complexCardRefinementSelectionViewType:"COMPLEX_CARD_VIEW",simpleCardRefinementSelectionViewType:"SIMPLE_CARD_VIEW",containedButtonRefinementSelectionViewType:"CONTAINED_BUTTON_VIEW",searchRefinementViewType:"SEARCH_CARD_VIEW",tradeInItemTypeEcho:"US_Echo",tradeInEchoGl:"gl_digital_products_3",tradeInWirelessGl:"gl_wireless",tradeInVGGl:"gl_video_games",tradeInDigitalVGGL:"gl_digital_video_games",tradeInElectronicsGL:"gl_electronics",tradeInVGProductGroups:["gl_video_games","gl_digital_video_games"], wirelessVgProductGroups:["gl_wireless","gl_video_games","gl_digital_video_games","gl_electronics"],tradeInCCCardEligibleGls:["gl_wireless"],tradeInLaunchButtonDeclarativeActionSelector:"#tradeInLaunchAction",instantPaymentPreferenceInputName:"instantPaymentPreference",instantPaymentNow:"PAID_NOW",instantPaymentLater:"PAID_LATER"}});"use strict";k.when("A","trade-in-constants","tanooki-ingress-button-treatment").register("trade-in-common-utils",function(d,e,b){var c=d.$,f={locale:null,currencyCode:null, productGroup:null,deviceType:null,asin:null,selectedAsin:null,modalTitle:null,isStorefront:!1,refTagPrefix:null,refTagPrefixMobile:null,priceBlockEnabled:null,buyingPriceUpgradeAsin:null,promoDiscount:null,autoSearchTerm:"",captureTradeInContext:function(){var a=c("#tanookiWidgetState").data("tanookiWidgetState");a?(a.hasOwnProperty("productGroup")?this.productGroup=a.productGroup:this.recordMetric("productGroupMissing"),a.hasOwnProperty("deviceType")?this.deviceType=a.deviceType:this.recordMetric("deviceTypeMissing"), a.hasOwnProperty("recycleAndSaveTitle")?this.modalTitle=a.recycleAndSaveTitle:a.hasOwnProperty("tanookiTitle")?this.modalTitle=a.tanookiTitle:this.recordMetric("deviceModalHeaderMissing"),a.hasOwnProperty("asin")&&(this.asin=a.asin),a.hasOwnProperty("buyingPrice")&&(this.buyingPriceUpgradeAsin=a.buyingPrice),a.hasOwnProperty("selectedAsin")&&(this.selectedAsin=a.selectedAsin),a.hasOwnProperty("autoSearchTerm")&&(this.autoSearchTerm=a.autoSearchTerm)):this.recordMetric("widgetContextMissing")},updateTradeInContext:function(a){var b= c("#tanookiWidgetState").data("tanookiWidgetState");b.hasOwnProperty("productGroup")&&a.hasOwnProperty("productGroup")&&(b.productGroup=a.productGroup);b.hasOwnProperty("deviceType")&&a.hasOwnProperty("deviceType")&&(b.deviceType=a.deviceType);b.hasOwnProperty("tanookiTitle")&&a.hasOwnProperty("tanookiTitle")&&(b.tanookiTitle=a.tanookiTitle);b.hasOwnProperty("asin")&&a.hasOwnProperty("asin")&&(b.asin=a.asin);b.hasOwnProperty("buyingPrice")&&a.hasOwnProperty("buyingPrice")&&(b.buyingPrice=a.buyingPrice); a.hasOwnProperty("selectedAsin")&&(b.selectedAsin=a.selectedAsin);a.hasOwnProperty("autoSearchTerm")&&(b.autoSearchTerm=a.autoSearchTerm);document.getElementById("tanookiWidgetState").dataset.tanookiWidgetState=JSON.stringify(b);this.captureTradeInContext()},setProductGroup:function(a){this.productGroup=a},getProductGroup:function(){return this.productGroup},setRefTagPrefix:function(a){this.refTagPrefix=a},getRefTagPrefix:function(){return this.refTagPrefix?this.refTagPrefix:e.refTagPrefix},getUpgradeAsinBuyingPrice:function(){return this.buyingPriceUpgradeAsin}, setRefTagPrefixMobile:function(a){this.refTagPrefixMobile=a},getRefTagPrefixMobile:function(){return this.refTagPrefixMobile?this.refTagPrefixMobile:e.refTagPrefixMobile},getCurrentAsin:function(){return this.asin},getSelectedAsin:function(){return this.selectedAsin},getDeviceType:function(){return this.deviceType},getModalTitle:function(){return this.modalTitle||""},getIsStoreFront:function(){return this.isStorefront},setIsStoreFront:function(a){this.isStorefront=a},setLocale:function(a){this.locale= a},setPriceBlockEnabled:function(a){this.priceBlockEnabled=a},isPriceBlockEnabled:function(){return this.priceBlockEnabled},setPromoDiscount:function(a){this.promoDiscount=a},getPromoDiscount:function(){return this.promoDiscount},setCurrencyCode:function(a){this.currencyCode=a},formatCurrency:function(a,b){this.currencyCode||this.recordError("Missing currency code","trade-in-common-utils");var e={style:"currency",currency:this.currencyCode};b&&c.extend(e,b);a=parseFloat(a);return a.toLocaleString(this.locale.replace("_", "-"),e)},formatDate:function(a){if(!a)return"";a=a.split(" ");return a[0]+" "+a[1]+" "+a[2]},getRedirectAuthUrl:function(a){var b=g.location,c="https://"+b.host,b=b.pathname+b.search+b.hash,e=c;-1<c.indexOf("aka.corp.amazon.com")&&(e="https://development.amazon.com");return e+"/ap/signin?_encoding\x3dUTF8\x26openid.assoc_handle\x3d"+a+"\x26openid.claimed_id\x3dhttp://specs.openid.net/auth/2.0/identifier_select\x26openid.identity\x3dhttp://specs.openid.net/auth/2.0/identifier_select\x26openid.mode\x3dcheckid_setup\x26openid.ns\x3dhttp://specs.openid.net/auth/2.0\x26openid.return_to\x3d"+ encodeURIComponent(c+b)},redirectToAuth:function(a,b){a=this.getRedirectAuthUrl(a);try{g.sessionStorage&&!this.hasStorefrontAutoLaunchParams()&&sessionStorage.setItem(b,!0)}catch(c){this.recordSessionStorageBlockedError(c)}g.location.href=a},redirectToMFA:function(a){var b="https://"+g.location.host;-1<b.indexOf("aka.corp.amazon.com")&&(b="https://development.amazon.com");g.location.href=encodeURI(b+a)},getAuthPortalHandleFromHostname:function(){var a=g.location.hostname.match(/^(?:(?:(?:(\w\w)-)?pre-prod)|(?:(?:(\w\w)-)?development)|(?:.+))\.amazon.(?:(\w\w)|(com)|(?:co\.(?:(\w\w))))?$/); if(a)for(var b=1;b<a.length;b++)if(a[b])return e.AUTH_PORTAL_ASSOC_HANDLE[a[b]];return e.AUTH_PORTAL_ASSOC_HANDLE.com},recordError:function(a,b){g.ueLogError&&g.ueLogError({message:a,logLevel:"ERROR",attribution:"tradein: "+b})},recordSessionStorageBlockedError:function(a){g.ueLogError&&g.ueLogError({message:a,logLevel:"WARN",attribution:"tradein: "+e.sessionStorageAccessErrorMsg})},recordMetric:function(a){g.ue&&g.ue.count&&(a="tradeIn_"+a,g.ue.count(a,(g.ue.count(a)||0)+1))},findMinMaxTivInContainer:function(a){var b, c;Object.keys(a).forEach(function(e,d){e=a[e];0===d?c=b=e.tiv:(d=e.tiv,b=d<b?d:b,c=d>c?d:c)});return[b,c]},getMashModalUrl:function(a){var b="https://"+g.location.host,c="\x26cb\x3d"+Math.round((new Date).getTime()/1E3);return b+a+c},getCsrfTokenByKey:function(a,b){return b.hasOwnProperty(e.csrfKeyMap)&&b[e.csrfKeyMap][a]?b[e.csrfKeyMap][a]:""},updateCsrfTokenByKey:function(a,b,c){b.hasOwnProperty(a)&&c.hasOwnProperty(e.csrfKeyMap)&&(c[e.csrfKeyMap][a]=b[a])},recordRefTag:function(a,b,c,e){a=b+c+ this.getIngressPageRefTag()+"_"+a;e=a+"_"+this.deviceType+"_"+this.getProductGroupShortReftag(e);this.doRecordRefTag(a);this.doRecordRefTag(e)},recordTv2RefTag:function(a,b,c){var e="";Array.isArray(c)&&0<c.length&&(e=c.join("_")+"_");a=b+this.getTv2RefTagPrefix()+"_"+e+a+"_"+this.getTv2RefTagPostfix();this.doRecordRefTag(a)},doRecordRefTag:function(a){d.get(a,{error:c.proxy(function(a,b,c){this.recordError(b+"::"+c,"Error encountered during refTag record request")},this)})},getIngressButtonRefTag:function(){return c(".tradein-price-block.blue").length? e.refTagTanookiLaunchedWithBlue:e.refTagTanookiLaunchedWithBorder},getIngressPageRefTag:function(){return this.isStorefront?e.refTagStorefront:e.refTagDetailPage},getIngressTypeRefTag:function(){return this.isPriceBlockEnabled()?e.refTagPriceBlockIngress:""},getDRAMIngressRefTag:function(){var a=this.getRefTagPrefix(),b=c('input[name\x3d"tanookiPainterRefTag"]'),e=c('input[name\x3d"tanookiPainterSlotId"]');return a=b.length&&""!==b.val()?a+(b.val()+"_tile_launch"):e.length&&""!==e.val()?a+(e.val()+ "_tile_launch"):a+"tile_launch"},isMobileVariant:function(a){return 0<=["mobile","mobileApp","mobileWeb"].indexOf(a)},getTanookiV2RowSize:function(a){return this.isMobileVariant(a)?e.tanookiV2MobileRowSize:e.tanookiV2DesktopRowSize},getTanookiV2SearchPageSize:function(a){return this.isMobileVariant(a)?e.tanookiV2MobileSearchPageSize:e.tanookiV2DesktopSearchPageSize},isWirelessVgProductGroup:function(a){return-1!==e.wirelessVgProductGroups.indexOf(a)},isVGProductGroup:function(a){return-1!==e.tradeInVGProductGroups.indexOf(a)}, shouldLaunchTanookiOnPageLoad:function(a){try{if(g.sessionStorage){var b=sessionStorage.getItem(a);this.updateWidgetStateFromSessionStorage();return b?(sessionStorage.removeItem(a),this.resetSessionStorage(),!0):!1}}catch(c){return this.recordSessionStorageBlockedError(c),!1}},resetSessionStorage:function(){try{g.sessionStorage&&(sessionStorage.removeItem("storefront-product-group"),sessionStorage.removeItem("storefront-device-type"),sessionStorage.removeItem("storefront-modal-title"),sessionStorage.removeItem("is-storefront"))}catch(a){this.recordSessionStorageBlockedError(a)}}, updateWidgetStateFromSessionStorage:function(){try{if(g.sessionStorage){var a={productGroup:sessionStorage.getItem("storefront-product-group"),deviceType:sessionStorage.getItem("storefront-device-type"),tanookiTitle:sessionStorage.getItem("storefront-modal-title")};a.productGroup&&this.updateTradeInContext(a)}}catch(b){this.recordSessionStorageBlockedError(b)}},hasStorefrontAutoLaunchParams:function(){var a=g.location.href;return-1!==a.indexOf("tipg\x3d")||-1!==a.indexOf("selectedAsin\x3d")?!0:!1}, getStorefrontSessionStorage:function(){try{g.sessionStorage&&sessionStorage.getItem("is-storefront")&&(this.isStorefront=!0)}catch(a){this.recordSessionStorageBlockedError(a)}return this.getIsStoreFront()},setStorefrontSessionStorage:function(a){try{g.sessionStorage&&(a&&sessionStorage.setItem("is-storefront",!0),sessionStorage.setItem("storefront-product-group",f.getProductGroup()),sessionStorage.setItem("storefront-device-type",f.getDeviceType()),sessionStorage.setItem("storefront-modal-title", f.getModalTitle()))}catch(b){this.recordSessionStorageBlockedError(b)}},getSortedConditionTradeInValues:function(a){var b=[],d=a.conditionOfferMap,f=e.validConditions,h;for(h in d)if(d.hasOwnProperty(h))if(-1===c.inArray(h,f))this.recordError("Invalid condition",h+" was not found in validConditions array for type: "+a.tradeInItemType);else{var g=d[h];g.hasOwnProperty("tiv")&&b.push(g.tiv)}b.sort(function(a,b){return a-b});return b},getProductGroupShortReftag:function(a){return e.PRODUCT_GROUP_SHORT_REF_TAG[a]}, getTv2RefTagPrefix:function(){return e.refTagTv2+this.getIngressPageRefTag()+"_"+this.getIngressTypeRefTag()+this.getProductGroupShortReftag(this.productGroup)},getTv2RefTagPostfix:function(){return("web"===this.deviceType?"D_":"M_")+e.PRODUCT_GROUP_REF_TAG[this.productGroup]},generatePrettyTitle:function(a){return a.split("(Trade")[0]},getIngressTypeFromActionParams:function(a){return a&&a.hasOwnProperty("data")&&a.data.hasOwnProperty("ingressType")?a.data.ingressType:null},isGlEligibleForPastPurchases:function(a){return a=== e.tradeInEchoGl},isGlEligibleForPromotions:function(a){return a===e.tradeInEchoGl},isCETechGl:function(a){return a===e.tradeInWirelessGl||a===e.tradeInDigitalVGGL||a===e.tradeInVGGl||a===e.tradeInElectronicsGL},isTradeInLaunchedFromWisper:function(a){return["launch-tanooki-wireless","redirect-to-login-wireless"].includes(a)},isGlEligibleForCCCard:function(a){return e.tradeInCCCardEligibleGls.includes(a)},createNearbyProcessorsList:function(a,b,e){b.empty();c.each(a,c.proxy(function(a,d){a=c("\x3cdiv/\x3e"); var f=c("\x3cdiv/\x3e"),r=c("\x3cdiv/\x3e"),g=c("\x3cdiv/\x3e"),n=d.processorAddress.line1+" "+d.processorAddress.line2,k=d.processorAddress.city+" "+d.processorAddress.state+" "+d.processorAddress.postalCode+" "+d.processorAddress.countryCode;a.html(d.processorAddress.fullName).addClass("a-text-bold a-spacing-top-medium");f.html(n);r.html(k);b.append(a).append(f).append(r).append(g);e.append(b)},this))},renderPriceBlockRecommendationMessages:function(a,b,c){var e=f.getUpgradeAsinBuyingPrice(),e= parseFloat(e);a.find("#selectedItemTotalCount").html(b);b=f.getPromoDiscount()?f.getPromoDiscount():0;c=e-(e*b+c);0<=c?(a.find("#finalPriceLowTiv").html(f.formatCurrency(c)),a.find("#buyingPrice").html(f.formatCurrency(e)).wrap("\x3cs\x3e"),a.find(".low-tiv").show(),a.find(".high-tiv").hide()):(a.find("#finalPriceHighTiv").html(f.formatCurrency(0)),a.find("#buyingPrice").html(f.formatCurrency(e)).wrap("\x3cs\x3e"),a.find("#gcAmount").html(f.formatCurrency(-1*c)),a.find(".low-tiv").hide(),a.find(".high-tiv").show()); a.show()}};d.on("a:tradein:record:reftag",function(a){f.doRecordRefTag(e.tradeInRouteBase+"recordRefTag?ref_\x3d"+a.refTag)});d.on("a:pageUpdate",function(){d.state.parse();f.captureTradeInContext()});return f});"use strict";k.when("A","a-modal","trade-in-constants","trade-in-common-utils","tradein-desktop-side-sheet","tanooki-rebates-cx-launcher","recycle-and-save-helper","ready").execute(function(d,e,b,c,f,a,k){function m(a){-1<a.indexOf(b.refTagPriceBlockPrefix)&&c.setRefTagPrefix(b.refTagPriceBlockPrefix); if(!c.getIsStoreFront()){var d=b.tradeInRouteBase+"recordRefTag?deviceType\x3d"+c.getDeviceType()+"\x26ref_\x3d",f=c.getIngressButtonRefTag();c.recordRefTag(f,d,b.refTagButtonExperimentPreFix,c.getProductGroup())}(d=c.getProductGroup())?(a=a+"_"+d,a={deviceType:c.getDeviceType(),currentAsin:c.getCurrentAsin(),buyingPrice:c.getUpgradeAsinBuyingPrice(),selectedAsin:c.getSelectedAsin(),productGroup:d,ref_:a},""!==c.autoSearchTerm&&(a.autoSearchTerm=c.autoSearchTerm,f=l("#tanookiWidgetState").data("tanookiWidgetState"), f.autoSearchTerm="",c.updateTradeInContext(f)),a=b.tradeInRouteBase+"getCustomerItems?"+l.param(a)):a=b.tradeInRouteBase+"generalerror?ref_\x3d"+(a+"_pg_missing");(d=e.get(b.tradeInModalName+"_"+d))||(d=e.create(l("\x3cdiv /\x3e"),{url:a,name:b.tradeInModalName,header:c.getModalTitle(),width:700,cache:!1,padding:"none",timeout:3E4}));d.show()}function q(){t||c.recordTv2RefTag(b.refTagAuthRequired,n);var a=c.getAuthPortalHandleFromHostname();c.isPriceBlockEnabled()?c.redirectToAuth(a,b.priceBlockTanookiV2SessionStorageKey): c.redirectToAuth(a,b.tanookiV2SessionStorageKey);c.setStorefrontSessionStorage(v)}function h(a){var e=c.getIngressButtonRefTag();c.recordTv2RefTag(e,n);a=b.refTagTv2+a;var d=c.getProductGroup(),h=c.getCurrentAsin();d?(e=a+"_"+d,e={deviceType:c.getDeviceType(),productGroup:d,ref_:e,currentAsin:h,buyingPrice:c.getUpgradeAsinBuyingPrice()},e=l.param(e),e=b.tradeInRouteBase+"wirelessTradeInSearchRefinements?"+e):e=b.tradeInRouteBase+"generalerror?ref_\x3d"+(a+"_pg_missing");r=l.get(e);f.initialize(); l("body").addClass("scroll-disabled");f.show(r,function(){t=!0;0<l("#tradein-desktop-side-sheet").find(".tradein-logged-out-view").length?c.recordTv2RefTag(b.refTagAuthRequired,n):0<=a.indexOf("auth_launch")&&c.recordTv2RefTag(b.refTagAuthCompleted,n)})}var l=d.$,r,v=c.getIsStoreFront(),n=b.tradeInRouteBase+"recordRefTag?deviceType\x3d"+c.getDeviceType()+"\x26ref_\x3d",t=!1,u=null;c.captureTradeInContext();v=c.getStorefrontSessionStorage();c.shouldLaunchTanookiOnPageLoad(b.tanookiV2SessionStorageKey)? h(b.refTagPrefix+"auth_launch"):c.shouldLaunchTanookiOnPageLoad(b.priceBlockTanookiV2SessionStorageKey)&&(c.setPriceBlockEnabled(!0),h(b.refTagPrefix+"auth_launch"));d.on("a:popover:afterHide:tradeInModal",function(){u&&u.focus()});d.on("a:tradein:tanooki:launch",function(a){c.setIsStoreFront(!0);c.updateTradeInContext(a.widgetState);d.trigger("a:tradein:productgroup:update");var b=a.refTag?a.refTag:c.getDRAMIngressRefTag();c.isWirelessVgProductGroup(a.widgetState.productGroup)?h(b):m(b)});d.declarative("launch-tanooki-wireless", "click",function(){h("launch")});d.declarative("launch-tanooki-v2","click",function(a){c.getIngressTypeFromActionParams(a)===b.priceBlockIngressType&&c.setPriceBlockEnabled(!0);h("launch")});d.declarative("launch-tanooki-v2-storefront","click",function(a){c.setIsStoreFront(!0);c.updateTradeInContext(a.data);h("launch")});d.declarative("redirect-to-login-wireless","click",function(){q()});d.declarative("redirect-to-login-v2","click",function(a){c.getIngressTypeFromActionParams(a)===b.priceBlockIngressType&& c.setPriceBlockEnabled(!0);q()});d.declarative("launch-tanooki","click",function(a){var e=c.getIngressTypeFromActionParams(a),d=b.refTagPrefix,f=b.tanookiBuyboxMetric;u=a.$target;e===b.priceBlockIngressType?(d=b.refTagPriceBlockPrefix,f=b.tanookiPriceblockMetric):e===b.recycleAndSaveIngressType&&(d=b.refTagRecycleAndSaveTanookiPrefix);c.setRefTagPrefix(d);m(d+"launch");c.recordMetric(f)});d.declarative("redirect-to-login","click",function(a){a=c.getIngressTypeFromActionParams(a);var e=c.getAuthPortalHandleFromHostname(); c.getIsStoreFront()&&c.setStorefrontSessionStorage(!0);var d=b.tanookiSessionStorageKey;a===b.priceBlockIngressType&&(d=b.priceBlockSessionStorageKey);c.redirectToAuth(e,d)});try{g.sessionStorage&&(c.shouldLaunchTanookiOnPageLoad(b.tanookiSessionStorageKey)&&m(b.refTagPrefix+"auth_launch"),sessionStorage.getItem(b.priceBlockSessionStorageKey)&&("launch-recycle-and-save"===l(b.tradeInLaunchButtonDeclarativeActionSelector).data("action")?k.launchRecycleAndSaveWeb(e,"_auth_launch"):m(b.refTagPriceBlockPrefix+ "auth_launch"),sessionStorage.removeItem(b.priceBlockSessionStorageKey)))}catch(w){c.recordSessionStorageBlockedError(w)}d.trigger("a:tradein:tanooki:launcher:loaded")});"use strict";k.when("A","ready").register("tradein-desktop-side-sheet",function(d){var e,b=d.$,c,f,a;return{initialize:function(){c=b("\x3cdiv id\x3d'a-popover-lgtbox' class\x3d'a-declarative attach-popover tradein-lgtbox' data-action\x3d'a-popover-floating-close'\x3e\x3c/div\x3e");c.hide();c.appendTo(document.body);c.click(this.close); a=b('\x3cdiv id\x3d"tradein-desktop-side-sheet" class\x3d"a-section"\x3e\x3c/div\x3e');a.addClass("aok-hidden");b('\x3cdiv class\x3d"a-spinner-wrapper sidesheet-spinner"\x3e\x3cspan class\x3d"a-spinner a-spinner-medium"\x3e\x3c/span\x3e\x3c/div\x3e').appendTo(a);a.appendTo(document.body);b(document).unbind("keydown",this.onKeyDown);b(document).keydown(this.onKeyDown);e=this.close},onKeyDown:function(a){27===a.which&&e()},close:function(){d.trigger("tanooki-trade-in-desktop-side-sheet-close");c.hide(); b(a).animate({right:f},{duration:500,complete:function(){b(a).remove();b(c).remove();b("body").removeClass("scroll-disabled")}})},show:function(e,d){b(a).removeClass("aok-hidden");b(a).animate({right:"0"},500,"linear");b(a).find(".sidesheet-spinner").addClass("active");c.show();b.when(e).done(function(c){b(a).find(".sidesheet-spinner").remove("active");b("#tradein-desktop-side-sheet").html(c);d&&"function"===typeof d&&d()});f=b(a).css("right")}}});"use strict";k.when("trade-in-cc-device").register("trade-in-cc-constants", function(d){return{featureName:"tradeInInstantSavingsCC",featureAttribution:"Website/CETech/WirelessPlans",actions:{expand:"trade-in-cc-card:expanded",collapse:"trade-in-cc-card:collapse",atfRefresh:"PageRefresh:ATF",ingress:"trade-in-button:ingress",postTradeInExp:"trade-in-cc:postTradeInExp",postTradeInMultiCardExp:"trade-in-cc:postTradeInMultiCardExp"},selectors:{expanderIcon:".trade-in-cc-header-icon",expanderContentWrapper:".trade-in-cc-expander-content-wrapper",expanderContent:".trade-in-cc-expander-content", expanderContentPre:".trade-in-cc-expander-content-pre",expandInitiallyInput:".trade-in-cc-expand-initially-input",tradeInCCCardTemplate:".trade-in-cc-card-template",successMessage:".trade-in-cc-card-template .trade-in-cc-success-message",tivMessage:".trade-in-cc-tiv-message",promoMessage:".trade-in-cc-promo-message",subtitleWrapper:".trade-in-cc-subtitle-wrapper",subtitle:".trade-in-cc-subtitle",submittedMessage:".trade-in-cc-submitted-message",ccCardTotalTiv:".cc-card-total-tiv",ccCardIpTiv:".cc-card-ip-tiv", promoTitle:".trade-in-cc-promo-title",promoSubtitle:".trade-in-cc-promo-subtitle",ipPromoSubtitle:".trade-in-cc-ip-promo-subtitle",nipPromoSubtitle:".trade-in-cc-non-ip-promo-subtitle",promoTitleSingle:".trade-in-cc-promo-title-single",singlePromoTitle:".single-promo-title",promoTitleMultiple:".trade-in-cc-promo-title-multiple",lastPromoTitle:".last-promo-title",remainingPromoAmount:".remaining-promo-amount",ccPostTradeInMessageTemplate:".cc-post-trade-in-message-template",ccTiMessageContent:".cc-post-trade-in-message-content", ccIpTiMessage:".trade-in-cc-ip-ti-message",ccNipTiMessage:".trade-in-cc-non-ip-ti-message",ccMixedTiMessage:".trade-in-cc-mix-ti-message",ccPromoMessageContent:".trade-in-cc-promo-message-content",multiCardExperimentData:"wireless-multi-card",multiCardExperimentElement:"[data-wireless-multi-card]",activeTPlusCards:"#twister-plus-active-cards",defaultOptionSwatch:".tradein-twister-box-group-default-option",expandContentSuccessMessage:".trade-in-cc-expander-content .trade-in-cc-success-message"},classes:{hidden:"aok-hidden", rotate:"rotate",tradeInCCExpanded:"trade-in-cc-expander-content-wrapper-expanded",contentHidden:"content-hidden",selectedSwatch:"tradein-options-selected-box-group"}}});"use strict";k.when("A","trade-in-cc-constants").register("trade-in-cc-expander",function(d,e){var b=d.$,c=e.selectors,f=e.classes;return{toggleCard:function(a){b(c.expanderIcon).toggleClass(f.rotate,a);b(c.subtitleWrapper).toggleClass(f.hidden,a);b(c.expanderContent).toggleClass(f.contentHidden,!a);return b(c.expanderContentWrapper).toggleClass(f.tradeInCCExpanded, a).hasClass(f.tradeInCCExpanded)}}});"use strict";k.when("A","cc-manager","trade-in-cc-constants").register("trade-in-cc-registration",function(d,e,b){var c={featureName:b.featureName,featureAttribution:b.featureAttribution};d.on(b.actions.expand,function(){e.cardExpanded(b.featureName)});e.registerFeature(c,{init:function(){},validateInputParams:function(){return!0},cardCollapse:function(){d.trigger(b.actions.collapse)}})});"use strict";k.when("A","trade-in-cc-constants","trade-in-cc-expander","trade-in-cc-registration").execute(function(d, e,b){function c(){"true"===f(g.expandInitiallyInput).val()&&b.toggleCard(!0)}var f=d.$,a=e.actions,g=e.selectors,k=e.classes;d.declarative("toggle-trade-in-cc-card","click",function(){var c=!f(g.expanderContentWrapper).hasClass(k.tradeInCCExpanded);b.toggleCard(c);c&&d.trigger(a.expand)});d.on(a.collapse,function(){b.toggleCard(!1)});d.on(a.atfRefresh,function(){c()});c()});"use strict";k.when("A","trade-in-cc-constants","trade-in-cc-registration").execute("trade-in-cc-metrics",function(d,e){var b= e.actions,c=function(){var b=g.ue;return{incrementCount:function(a){b&&b.count&&a&&(a="twisterPlus_tradeIn_"+a+"."+e.featureName,b.count(a,(b.count(a)||0)+1))}}}();d.declarative("launch-tanooki-v2",function(){d.trigger(b.ingress)});d.on(b.expand,function(){c.incrementCount("ccExpanded")});d.on(b.ingress,function(){c.incrementCount("ccIngress")})});"use strict";k.register("trade-in-cc-device",function(){return{isMobile:!1}});"use strict";k.register("tanooki-ingress-button-treatment",function(){return{isEnabled:!1}}); "use strict";k.register("tanooki-rebates-cx-launcher",function(){return{isEnabled:!1}});"use strict";k.when("A","a-modal","trade-in-common-utils","recycle-and-save-constants","recycle-and-save-helper","ready").execute(function(d,e,b,c,f){var a=null;d.declarative("launch-recycle-and-save-banyan","click",function(c){a=c.$target;f.setIsPageRenderTargetSPP(!0);b.setProductGroup("gl_digital_products_3");b.deviceType="web";f.launchRecycleAndSaveWeb(e)});d.declarative("launch-recycle-and-save","click",function(b){a= b.$target;f.launchRecycleAndSaveWeb(e)});d.declarative("recycle-and-save-claim-promo","click",function(a){var b=e.get(c.recycleAndSaveModalName);f.claimRecycleAndSavePromo(a.data.csrfKey,b,!1)});d.on("a:popover:afterHide:recycleAndSaveModal",function(){a&&a.focus()})});k.when("recycle-and-save-helper","ready").execute(function(d){d.triggerRecycleAndSaveWeblab()});"use strict";k.when("A").register("recycle-and-save-constants",function(d){return{recycleAndSaveModalName:"recycleAndSaveModal",recycleAndSaveSecondaryViewName:"recycleAndSaveSecondaryView", recycleAndSaveRouteBase:"/tradein/hzw/",recycleAndSavePrefix:"recycleAndSave/",recycleAndSaveViewUrl:"getView?",recycleAndSaveClaimPromoUrl:"claimPromo?",recycleAndSavePriceblockMetric:"recycle_and_save_launch_price_block",recycleAndSavePriceblockMobileMetric:"recycle_and_save_launch_price_block_mobile",recycleAndSavePromoAccessErrorMetric:"recycle_and_save_promo_access_error",refTagRecycleAndSavePrefix:"dp_recycle_save_price_block_",refTagRecycleAndSaveMobilePrefix:"dp_recycle_save_price_block_m_", refTagRecycleAndSaveReftagLaunch:"dp_recycle_save_price_block_launch",refTagRecycleAndSaveReftagMobileLaunch:"dp_recycle_save_price_block_launch_m",refTagRecycleAndSaveOnSPPLaunch:"spp_recycle_save_upgrader_launch",refTagRecycleAndSaveOnSPPMobileLaunch:"spp_recycle_save_upgrader_launch_m",refTagRecycleAndSaveClaimPromo:"dp_recycle_save_price_claim_promo_",refTagRecycleAndSaveSPPClaimPromo:"spp_recycle_save_price_claim_promo_",refTagMobile:"m_",promoAccessAvailable:"available",promoAccessClaimed:"claimed", promoAlreadyClaimed:"ALREADY_CLAIMED"}});"use strict";k.when("A","trade-in-common-utils","recycle-and-save-constants","ready").register("recycle-and-save-helper",function(d,e,b){function c(a,c){var d=e.getProductGroup(),f=q();return d?(a={deviceType:c?"mobile":e.getDeviceType(),productGroup:d,ref_:a,pageRenderTarget:l.getIsPageRenderTargetSPP()?"spp":"dp",currentAsin:f},b.recycleAndSaveRouteBase+b.recycleAndSavePrefix+b.recycleAndSaveViewUrl+h.param(a)):b.recycleAndSaveRouteBase+"generalerror?ref_\x3d"+ (a+"_pg_missing")}function f(){h("#recycleSaveErrorAlert").removeClass("aok-hidden")}function a(){h("#recycleSaveClaimPromoDeclarAct").removeClass("a-declarative");h("#recycleSaveClaimPromoButton").removeClass("a-button-normal").addClass("a-button-disabled")}function k(a){d.declarative.remove(h("#launch-recycle-and-save"),"launchRecycleAndSave");var b=h(".tradein-instant-savings-launch-button"),c=h(a?".recycle-and-save-wrapper-mobile":".recycle-and-save-wrapper").find("#successfulRecycleAndSaveButtonText"); h.each(b,function(){h(this).replaceWith(c.clone())});h(".tradein-price-block").each(function(){h(this).html(c.clone())});a=h(".tradein-price-block.blue");a.length&&a.removeClass("blue").addClass("green")}function m(){var a=h(".ucw-cards-upgrader-btn-text"),b=h("#ucw-upgrader-offer-claimed-text");0<a.length?a.each(function(){var a=b.clone().removeClass("aok-hidden").addClass("recycle-and-save-spp-ingress-success");h(this).replaceWith(a)}):h(".ucw-cards-upgrader-button").each(function(){var a=b.clone().removeClass("aok-hidden").addClass("recycle-and-save-spp-ingress-success"); h(this).find("#ucw-cards-upgrader-btn-text").replaceWith(a)})}function q(){var a=h("#ingressAsin");if(a&&a.length)return a.data("ingressAsin")}var h=d.$,l={isPageRenderTargetSPP:!1,setIsPageRenderTargetSPP:function(a){this.isPageRenderTargetSPP=a},getIsPageRenderTargetSPP:function(){return this.isPageRenderTargetSPP},launchRecycleAndSaveWeb:function(a,d){d=d||"";e.setRefTagPrefix(b.refTagRecycleAndSavePrefix);d=(this.getIsPageRenderTargetSPP()?b.refTagRecycleAndSaveOnSPPLaunch:b.refTagRecycleAndSaveReftagLaunch)+ "_"+e.getProductGroup()+d;d=c(d,!1);var f=a.get(b.recycleAndSaveModalName);f||(f=a.create(h("\x3cdiv /\x3e"),{url:d,name:b.recycleAndSaveModalName,header:e.getModalTitle(),width:929,cache:!1,padding:"none",timeout:3E4}));f.show();e.recordMetric(b.recycleAndSavePriceblockMetric)},launchRecycleAndSaveMobile:function(a,d){d=d||"";e.setRefTagPrefix(b.refTagRecycleAndSaveMobilePrefix);d=(this.getIsPageRenderTargetSPP()?b.refTagRecycleAndSaveOnSPPMobileLaunch:b.refTagRecycleAndSaveReftagMobileLaunch)+"_"+ e.getProductGroup()+d;d=c(d,!0);var f=a.get(b.recycleAndSaveSecondaryViewName);f||(f=a.create(h("\x3cdiv /\x3e"),{url:d,name:b.recycleAndSaveSecondaryViewName,cache:!1,backButtonText:"Close",padding:"none",timeout:3E4}));f.show();e.recordMetric(b.recycleAndSavePriceblockMobileMetric)},triggerRecycleAndSaveWeblab:function(){var a=h("#recycleAndSaveWeblabToTrigger");if(a&&a.length){var b=a.data("weblabname"),a=a.data("weblabtreatment");b&&b.length&&a&&a.length&&g.ue&&g.ue.trigger&&g.ue.trigger(b,a)}}, claimRecycleAndSavePromo:function(c,g,l){var t=e.getProductGroup(),u=l?b.refTagMobile:"",p=q(),x=this.getIsPageRenderTargetSPP()?b.refTagRecycleAndSaveSPPClaimPromo:b.refTagRecycleAndSaveClaimPromo;c=b.recycleAndSaveRouteBase+b.recycleAndSavePrefix+b.recycleAndSaveClaimPromoUrl+h.param({productGroup:t,requestToken:c,ref_:x+u+t,currentAsin:p});d.post(c,{success:h.proxy(function(c){c.claimPromoSuccess?(g.hide(),this.getIsPageRenderTargetSPP()?m():k(l)):(c.claimPromoFailureReason&&c.claimPromoFailureReason=== b.promoAlreadyClaimed?h("#recycleSaveClaimAlert").removeClass("aok-hidden"):f(),a())},this),error:h.proxy(function(){e.recordMetric(b.recycleAndSavePromoAccessErrorMetric);f();a()},this),async:!1})}};return l})}); /* ******** */ (function(d){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,a=k?k("ListsCommonUtilityAssets",""):f;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,f,k){d.when("A").register("al-ajax-response-state-parser",function(a){var b=a.$;return{getState:function(c){c=b(c).filter("#listsAjaxResponseStateSection");var e=b("#listsAjaxResponseStateSection");e&&0<=e.length&&e.remove();b(c).appendTo("body");a.state.parse();c=a.state("listsAjaxResponseState")|| {};return{hasError:c.hasError,authRequired:c.authRequired,authUrl:c.authUrl,error:c.error}}}});"use strict";d.when("A","al-bottomsheet-with-fallback","iphone-x-detector").register("bottom-sheet-utils",function(a,b,c){var e=a.$;a.declarative("al-sheet-with-fallback","click",function(e){e.$event.preventDefault();var a=e.data;e=b.create(b.buildComponentParams(a.componentName,a.showCloseButton,c.getAdjustedHeightPx(a.bottomsheetHeight),a.popoverHeight,a.popoverWidth,a.headerForPopover,a.viewLabel,a.viewDescription? a.viewDescription:a.viewLabel,a.paddingForPopover,a.closeMessage),e.$target);b.show(e)});return{raiseBottomsheet:function(b){b=e(b).parents(".a-sheet-web-container");b.css("z-index",1E4);b.siblings(".a-sheet-lightbox").css("z-index",8E3)}}});"use strict";d.when("A").register("al-bottomsheet-with-fallback",function(a){function b(b){f.ueLogError&&f.ueLogError({logLevel:"ERROR",message:b})}var c,e;d.when("a-sheet").execute(function(b){c=b});d.when("a-modal").execute(function(b){e=b});var g=function(a){if(a)return c? c.get(a.name):e.get(a.name);b("No ComponentParams specified. Please generate componentParams using .create(component)")},n={IS_POPOVER_LABEL:"IS_POPOVER",IS_BOTTOMSHEET_LABEL:"IS_BOTTOMSHEET"};return{create:function(a,p){if(a)return c?c.create(a):e.create(p,a),a;b("No ComponentParams specified. Please generate componentParams using .create(component)")},show:function(a){(a=g(a))?a.show():b("No View Created. Please create a view first by calling .create(component)")},hide:function(a){(a=g(a))?a.hide(): b("No View Created. Please create a view first by calling .create(component)")},changeHeight:function(a,e,d){var l=g(a);l?c?(l.changeHeight({height:e,duration:d}),a.bottomsheetHeight=e):(l.update({height:e}),a.popoverHeight=e):b("No View Found. Please create a view first by calling .create(component)")},remove:function(a){(a=g(a))?a.$container.remove():b("No View Created. Please create a view first by calling .create(component)")},exists:function(a){return g(a)?!0:!1},onCloseExecute:function(e,d, g){if("function"!==typeof d)b("Expected onCloseFunction to be of type function");else if(e)a.on((c?"a:sheet":"a:popover")+":"+(g?"beforeHide":"afterHide")+":"+e.name,d);else b("No ComponentParams specified. Please generate componentParams using .create(component)")},onOpenExecute:function(e,d,g){if("function"!==typeof d)b("Expected onOpenFunction to be of type function");else if(e)a.on((c?"a:sheet":"a:popover")+":"+(g?"beforeShow":"afterShow")+":"+e.name,d);else b("No ComponentParams specified. Please generate componentParams using .create(component)")}, buildComponentParams:function(a,b,e,d,g,f,u,v,w,x){var l=c!==k,h={viewTypeLabel:l?n.IS_BOTTOMSHEET_LABEL:n.IS_POPOVER_LABEL,name:a};l?(h.closeType=x?"message":b?"icon":k,h.closeMessage=x,h.height=e,h.sheetLabel=u,h.sheetDescription=v,h.preloadDomId=a):(h.closeButton=b,h.height=d,h.width=g,h.dataStrategy="preload",h.header=f,h.hideHeader=f===k,h.padding=w!==k?w:"none",h.popoverLabel=u);return h},VIEW_TYPE_LABELS:n}});"use strict";d.when("A").register("lists-dpx-common-utils",function(a){return{urlParamValue:function(a){for(var b= f.location.search.substring(1).split("\x26"),e=0;e<b.length;e++){var d=b[e].split("\x3d");if(d[0]===a)return d[1]}}}});"use strict";d.when("A").register("iphone-x-detector",function(){function a(){try{var a=b();c.forEach(function(b){if(-1<a.indexOf(b))return!0})}catch(g){}return!1}function b(){try{a:{for(var a=document.cookie.split(";"),b=0;b<a.length;b++){for(var c=a[b];" "===c.charAt(0);)c=c.substring(1,c.length);if(0===c.indexOf("amzn-app-ctxt\x3d")){var d=c.substring(14,c.length);break a}}d=null}if(d){var f= d.match(/"v":.*%2C*/);if(f)return f.toString().toLowerCase()}}catch(m){}return""}var c=["iphone10","iphone11"];return{isIphoneX:a,getDeviceType:b,getAdjustedHeightPx:function(b){try{if(b=parseInt(b,10),a())return b+40}catch(g){}return b}}});"use strict";d.when("A","lists-metric-logger").register("amazon-lists-csrf-utils",function(a,b){var c=a.$;return{addCsrfToken:function(a){0!==c('meta[id\x3d"lists-sp-csrf-meta-token"]').length?a["anti-csrftoken-a2z"]=c('meta[id\x3d"lists-sp-csrf-meta-token"]').attr("content"): 0!==c('input[id\x3d"lists-sp-csrf-form-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"lists-sp-csrf-form-token"]').attr("value"):0!==c('input[id\x3d"lists-sp-csrf-input-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"lists-sp-csrf-input-token"]').attr("value"):b.incrementMetricCountByOne("Lists:CSRF:UnableToRetrieveToken")},hasCsrfToken:function(a){a=a["anti-csrftoken-a2z"];return""!==a&&a!==k}}});"use strict";d.when("A","lists-metric-logger").register("idea-list-csrf-utils",function(a, b){var c=a.$;return{addIdeaListCsrfToken:function(a){0!==c('input[id\x3d"creator-sp-csrf-form-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"creator-sp-csrf-form-token"]').attr("value"):b.incrementMetricCountByOne("Lists:CSRF:UnableToRetrieveToken")}}});"use strict";d.when("A","amazon-lists-csrf-utils").register("lists-ajax-handler",function(a,b){function c(a){b.hasCsrfToken(a)||b.addCsrfToken(a)}function d(a,b){"function"===typeof a?a(b):r("callableFunction passed in is not callable: "+ a)}function g(a,b,c){m(a);c&&m(p(a,c));b&&m(p(a,b));b&&c&&m(p(a,b,c))}function n(a){m("lists_ajax_before_send");a&&m(p("lists_ajax_before_send",a))}function l(a){try{return a.replaceAll("/","_")}catch(v){r("Replace all failed for URL: "+a)}}function p(a,b,c){return[a,b,c].filter(function(a){return""!==a&&a!==k}).join(":")}function m(a){q&&q.count(a,(q.count(a)||0)+1)}function r(a){f.ueLogError(k,{logLevel:"ERROR",attribution:"ListsCommonUtilityAssets::ListsAjaxHandler",message:a})}var t=a.$,q=f.ue; return{post:function(a){var b=a.headers||[];c(b);var e=l(a.url);n(e);return t.ajax({type:"POST",url:a.url,cache:a.isCached,headers:b,data:a.params,timeout:a.timeout,success:function(b,c){g("lists_ajax_success",e,c);d(a.successCallback,b)},error:function(b,c){g("lists_ajax_error",e,c);d(a.errorCallback)}})},get:function(a){var b=l(a.url);n(b);return t.ajax({type:"GET",url:a.url,headers:a.headers,cache:a.isCached,data:a.params,timeout:a.timeout,success:function(c,e){g("lists_ajax_success",b,e);d(a.successCallback, c)},error:function(c,e){g("lists_ajax_error",b,e);d(a.errorCallback)}})}}});"use strict";d.when("A").register("lists-mash-overlay-helper",function(){function a(a){return b&&b.dispatchEvent&&"function"===typeof b.dispatchEvent?(b.dispatchEvent({type:a}),!0):!1}var b;d.when("mash").execute("amazon-lists-mash-api-registration",function(a){b=a});return{hideGLOWOverlay:function(){return a("appOverlays.Hide")},showGLOWOverlay:function(){return a("appOverlays.Show")}}});"use strict";d.when("A").register("al-client-side-widget-latency-helper", function(){var a={wb:1};return{emitFeatureBegin:function(b){b&&"function"==typeof f.uet&&f.uet("bb",b,a)},emitFeatureLoaded:function(b){b&&"function"==typeof f.uet&&f.uet("cf",b,a);b&&"function"==typeof f.uex&&f.uex("ld",b,a)}}});"use strict";d.when("A").register("lists-update-cart-count",function(a){return{updateCartCount:function(a){d.when("mash").execute(function(b){b.cart.didUpdate({newCartQuantity:a,successCallback:function(){f.amazon.cordova.notification.vibrate(50)},failCallback:null})});d.when("nav.setCartCount").execute(function(b){b(a)})}}}); "use strict";d.register("lists-metric-logger",function(){return{incrementMetricCountByOne:function(a){var b=f.ue;b&&b.count(a,(b.count(a)||0)+1)}}})}); /* ******** */ (function(h){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,d=l?l("ListsCreateAssets",""):g;d.guardFatal?d.guardFatal(h)(d,window):d.execute(function(){h(d,window)})})(function(h,g,l){h.when("A","al-bottomsheet-with-fallback","al-ajax-response-state-parser","create-new-list-hz","bottom-sheet-utils","lists-dpx-common-utils","lists-mash-overlay-helper").execute(function(d,a,k,u,A,z,t){function e(b){var c=b.data||{};"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===p()&&v&&f&&a.remove(f); f=a.create(a.buildComponentParams(c.componentName,!0,w,430,400,l,c.viewName,c.viewDescription,l,l),b.$target);t.hideGLOWOverlay();a.show(f);"DETAIL_PAGE"===p()&&x&&(a.onOpenExecute(f,C),a.onCloseExecute(f,function(){t.showGLOWOverlay()},!1))}function C(){A.raiseBottomsheet("#create-list-form-wrapper");a.changeHeight(f,w,0)}function D(b){var c=g.ue?g.ue.rid:l;b={createIngressName:b.ingressName,isHearts:!1,sourceVendorId:b.sourceVendorId};c&&(b.relatedRequestID=c);"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"=== p()&&v&&(b.isHearts=!0);q.ajax({type:"GET",url:"/hz/wishlist/create",data:b,success:F,error:function(b,c,a){B("Failed to fetch CreateList-Form. Status: "+c+"; Error: "+a)},timeout:2E4})}function F(b){var c=q(b).filter("#createlist-form-container");b=k.getState(b);b.authRequired&&b.authUrl?g.location.href=b.authUrl:b.hasError?B("CreateList form has error \x3d "+b.error):(c.find("#bottomSheetSize").length&&(w=c.find("#bottomSheetSize").val(),a.changeHeight(f,w,0)),q("#create-list-form-wrapper").html(c), r("#create-list-form-spinner"),y("#create-list-form-wrapper"))}function r(b){q(b).addClass("aok-hidden")}function y(b){q(b).removeClass("aok-hidden")}function B(b){a.changeHeight(f,110);r("#create-list-form-spinner");r("#create-list-form-wrapper");y("#createlist-form-loading-error-section");g.ueLogError&&g.ueLogError({logLevel:"FATAL",message:b});if("DETAIL_PAGE"!==p()||!x)a.onCloseExecute(f,G,!1)}function G(){r("#createlist-form-loading-error-section");r("#create-list-form-wrapper");y("#create-list-form-spinner"); g.location.reload()}function n(b,c,a){B("List creation failed. Status: "+c+"; Error: "+a)}function m(b){b.hasError?B("List creation failed with Error: "+b.error):"YOUR_STUFF_LISTS_CAROUSEL"===p()&&E?(a.onCloseExecute(f,function(){E.bufferReloadOnBackNavigation();g.location="/hz/wishlist/ls/"+b.listExternalId},!1),a.hide(f)):(a.hide(f),g.location="/hz/wishlist/ls/"+b.listExternalId)}function p(){return(d.state("createListIngressState")||{}).ingressName}var q=d.$,w=325,x,v,E,f;d.declarative("awl-create-list-bottomsheet", "click",function(b){var c=b.data||{};d.state("createListIngressState",{ingressName:c.ingressName});var a=c.componentName;a&&"function"==typeof uet&&uet("bb",a,{wb:1});e(b);D(c);(b=c.componentName)&&"function"==typeof uet&&uet("cf",b,{wb:1});b&&"function"==typeof uex&&uex("ld",b,{wb:1})});d.declarative("list-name-toggle","click",function(b){if("input"===b.targetTag){var c=q("span[data-action\x3dcreate-list-bottomsheet-submit]")[0],a=JSON.parse(c.getAttribute("data-create-list-bottomsheet-submit")), d=document.getElementById("createlist-list-name-textinput");a.persistence=b.data.persistence;c.setAttribute("data-create-list-bottomsheet-submit",JSON.stringify(a));d.value=b.data.name}});d.declarative("create-list-bottomsheet-submit","click",function(b){b=b.data||{};var c=g.ue?g.ue.rid:l;c&&(b.relatedRequestID=c);c=q("#createlist-list-name-textinput").val();c===l||0===c.length?q("#createlist-list-name-textinput").parent("div").addClass("a-form-error"):(r("#createlist-form-loading-error-section"), r("#create-list-form-wrapper"),y("#create-list-form-spinner"),b.listName=c,(c=z.urlParamValue("createAndAddAsin"))&&0<c.length&&(b.asin=c),"DETAIL_PAGE"===p()&&x?((c=x.getAsin())&&0<c.length&&(b.asin=c),u(b,x.handleSuccess,x.handleError)):"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===p()&&v?((c=v.getAsin())&&0<c.length&&(b.asin=c),a.hide(f),u(b,v.onCreateSuccess,v.onCreateError)):(c=d.state("atwl"),c!==l&&c.asin!==l&&0<c.asin.length&&(b.asin=q.trim(c.asin)),u(b,m,n)))});h.when("dp-create-list-handler").execute(function(b){x= b});h.when("hearts-v2-create-list-handler").execute(function(b){v=b});h.when("lists-your-saves-refresh-utils").execute(function(b){E=b});d.on("a:expander:create-list-learn-more-popover:toggle:expand",function(){f.viewTypeLabel===a.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?a.changeHeight(f,w+165):a.changeHeight(f,580)});d.on("a:expander:create-list-learn-more-popover:toggle:collapse",function(){a.changeHeight(f,w);f.viewTypeLabel===a.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?a.changeHeight(f,w):a.changeHeight(f, 430)});d.declarative("createlist-list-name-validation",["keyup"],function(b){0!==b.$target.context.value.length&&q("#createlist-list-name-textinput").parent("div").hasClass("a-form-error")&&q("#createlist-list-name-textinput").parent("div").removeClass("a-form-error")})});"use strict";h.when("A","create-new-list-hz","a-modal","lists-dpx-common-utils","create-list-state-util","lists-metric-logger").register("create-utils",function(d,a,k,h,A,z){function u(a){a&&"function"==typeof uet&&uet("cf",a,{wb:1}); a&&"function"==typeof uex&&uex("ld",a,{wb:1})}var e=d.$,C=function(a){a="#"+(a.formId||"addToCart");0===e(a).length&&(a="#atwl-form");return a};d.declarative("show-create-list",["click touchstart"],function(a){a.$event.preventDefault();var e=a.data;if(e.url||e.name)"function"==typeof uet&&uet("bb","create-list-dp-widget",{wb:1}),k.create(a.$target,e).show({padding:"none"}),u("create-list-dp-widget");d.on("a:popover:afterHide:create-list",function(){k.remove("create-list")});d.on("a:popover:show:create-list", function(a){D(a.popover.$popover)});e.createAndAddAsin&&A.saveCreateAndAddAsin(e.createAndAddAsin)});d.declarative("list-name-validation",["keyup"],function(a){0!==a.$target.context.value.length&&e("#alert-list-name").is(":visible")&&(e("#alert-list-name").addClass("aok-hidden"),e("#alert-list-name").parent("div").find("input").each(function(){e(this).removeClass("a-form-error")}))});var D=function(a){a.delegate("input:text","keypress",function(a){13===a.which&&a.preventDefault()})};return{submitCreate:function(k, u,y){k.$event.preventDefault();var r=e("#create-list-form").closest(".a-popover"),t=e("#list-name").val();if(""===t)e("#alert-list-name").removeClass("aok-hidden"),e("#alert-list-name").parent("div").find("input").each(function(){e(this).addClass("a-form-error")});else{var n={},m=d.state("popoverState")||{};m=C(m);var p=h.urlParamValue("createAndAddAsin");p&&1<p.length&&(n.asin=p);"1"===e("#is-create-and-add").val()&&(m=e(m).find("#ASIN, [name^\x3d'ASIN'], [name\x3d'a'], [name\x3d'asin']").val(), ""===m&&(m=d.state("atwl").asin,z.incrementMetricCountByOne("Lists:CreateListAndAddItem:FallbackToGiftingModuleASIN")),"undefined"!==m&&(n.asin=e.trim(m)));(m=A.getCreateAndAddAsin())&&"undefined"!==m&&(n.asin=m);e("#create-list-loading").removeClass("aok-hidden");r.find("#popover-spinner .a-popover-loading").show();e("#create-list-form").addClass("aok-hidden");n.listName=t;n.sid=k.data.sessionId;n.vendorId=k.data.sourceVendorId;n.privacyStatus=k.data.privacyStatus;n.listType=k.data.listType;if(k= g.ue?g.ue.rid:l)n.relatedRequestID=k;a(n,u,y)}}}});"use strict";h.when("A","amazon-lists-csrf-utils").register("create-new-list-hz",function(d,a){var k=d.$;return function(d,h,z){var t=[];a.addCsrfToken(t);var e=g.ue?g.ue.rid:l;e&&(d.relatedRequestID=e);d.isJson=!0;return k.ajax("/hz/wishlist/create/newlist",{type:"POST",headers:t,data:d,success:h,error:z,timeout:1E4})}});"use strict";h.when("A").register("create-list-state-util",function(d){var a=d.$;(function(){var d=a('\x3cinput type\x3d"hidden"\x3e'); d.attr("id","lists-createlist-createAndAddAsin");d.appendTo("body")})();return{getCreateAndAddAsin:function(){return a("#lists-createlist-createAndAddAsin").val()},saveCreateAndAddAsin:function(d){a("#lists-createlist-createAndAddAsin").val(d)}}})}); /* ******** */ (function(f){var n=window.AmazonUIPageJS||window.P,p=n._namespace||n.attributeErrors,d=p?p("ListsDPXCommonAssets",""):n;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,n,p){f.when("A","a-dropdown","a-modal","legacy-create-utils").execute(function(d,u,b,h){var m=d.$;d.declarative("reg-create-change-privacy",["click"],function(b){h.changePrivacySetting(b)});d.declarative("list-privacy-toggle",["click"],function(b){h.togglePrivacy(b)});d.declarative("list-name-toggle", ["click"],function(b){h.toggleListName(b)});d.declarative("idea-list-toggle",["click"],function(b){h.toggleIdeaList(b)});d.on("a:popover:beforeShow:reg-create",function(b){m("#createCal").append(m("#popCal"))});d.on("a:popover:show:reg-create",function(b){h.onShow(b)});d.on("a:popover:ajaxContentLoaded:reg-create",function(b){b=b.popover.$popover;m("#createCal").append(m("#popCal"));b.hasClass("pop-create")||b.addClass("pop-create")});d.on("a:popover:beforeHide:reg-create",function(b){m("#createCalHolder").append(m("#popCal"))}); d.on("a:popover:hide:reg-create",function(b){h.onClose(b)});d.on("a:dropdown:select",function(b){h.onDropdownSelect(b)})});"use strict";f.when("A","create-new-list-hz").register("legacy-create-utils",function(d,u){var b=d.$;d.state.parse();d.state("pageInfo");d.state("createInfo");var h=d.state("popoverState")||{},m=0,f=function(a){a="#"+(a.formId||"addToCart");0===b(a).length&&(a="#atwl-form");return a},r=f(h),v=function(a){var c={};b.each(a.serializeArray(),function(a,b){b.name.match(/create-|next-/)&& (c[b.name]=b.value)});return c},z=function(a){var c={},q={};c["create-sourceVendorId"]=a["create-sourceVendorId"];"undefined"!==typeof w("vendorId")&&(c["create-sourceVendorId"]=w("vendorId"));var k="wishlist";if(a["create-for"]){var e=a["create-for"];"friend"===e?k="giftlist":"child"===e&&(k="giftlist",c["create-isKidList_Registry"]=1)}h=d.state("popoverState")||{};r=f(h);"1"===b("#create-isCreateAndAdd").val()&&(c.isCreateAndAdd=!0,e=b(r).find("#ASIN, [name^\x3d'ASIN'], [name\x3d'a'], [name\x3d'asin']").val(), c.asin=b.trim(e),e=d.state("wishlistDPState")||{},e.customizationToken&&(c.customizationToken=e.customizationToken));if("giftlist"!==k&&"1"===b("#create-isIdeaList").val())return e=b.trim(a["create-name-il"]),""!==e?c.name=e:q.list_name_il="empty",c.isIdeaList=!0,c.description=b.trim(a["create-description-il"]),{errors:q,userCreateArgs:c};c["create-registryType"]=k;if("wishlist"===k)e=b.trim(a["create-name"]),""!==e?c["create-name"]=e:q.list_name="empty";else{var g=b.trim(a["create-first-name"]), l=b.trim(a["create-last-name"]),e=b.trim(a["create-participant_relationship"]);""!==g||""!==l?(c["create-participant2-givenName"]=g,c["create-participant2-surName"]=l,g=g+" "+l,c["create-participant2-name"]=g,c["create-name"]=g,c["create-participant2-relationship_Participant"]=e):q.recipient_name="empty"}e="N";g="wishlist"===k?"Y":"N";if(l=a["create-privacy"])"public"===l?("undefined"!==typeof a["create-recipient-name"]&&(c["create-recipient-name"]=b.trim(a["create-recipient-name"])),g="Y"):("hidden"!== l&&(e="Y"),g="N");c["create-isPrivate"]=e;c["create-isSearchable"]=g;"wishlist"===k&&(c["create-persistence"]=b.trim(a["create-persistence"]));e=a["create-month"];g=a["create-day"];0<b("#popCal").length&&((l=b('[data-action\x3d"a-cal-input"]').val())?(e=l.split("/")[0],g=l.split("/")[1]):e=l="-1");e&&g&&("-1"!==e||"-1"!==g)&&(e=parseInt(e,10),g=parseInt(g,10),(l=new Date(1904,e-1,g),l.getMonth()+1===e)&&l.getDate()===g?(c["create-occasion1-fromDate_Month"]=e,c["create-occasion1-fromDate_Day"]=g,c["create-occasion1-fromDate_Year"]= 1904,"giftlist"===k&&(c["create-isKidList_Registry"]&&a["create-age"]&&"-1"!==a["create-age"]&&(c["create-occasion1-firstYear_Occasion"]=(new Date).getFullYear()-a["create-age"]),a["create-reminder"]&&(c["create-occasion1-reminderOffset_Occasion"]=a["create-reminder"]))):1<m||(q.occasion_date="invalid"));a["create-next"]&&(k=a["create-next"],c["next-action"]=k,"add"===k&&d.each(["asin","purchasedQty","requestedQty","purchaseDate","redirect"],function(b,e){b="next-"+b;a[b]&&(c[b]=a[b])}));return{errors:q, userCreateArgs:c}},A=function(a){a.find("#WLNEW_error").addClass("a-hidden");a.find(".a-alert-inline").addClass("a-hidden");a.find(".a-form-error").removeClass("a-form-error");a.find(".reg-create-form").removeClass("a-hidden")},t=function(a){var b=a.find('select[name\x3d"create-month"]').val(),d=a.find('select[name\x3d"create-day"]').val();b&&"-1"!==b&&d&&"-1"!==d?a.find("#WLNEW_section_occAge").removeClass("a-hidden"):a.find("#WLNEW_section_occAge").addClass("a-hidden")},x=function(a,c){c.find("#WLNEW_input_privacy").val(a); var d="";b("#a-popover-reg-create-privacy").find(".a-list-link li a").each(function(){b(this).removeClass("a-active");var c=b(this).data("reg-create-change-privacy");c&&c.type===a&&(d=c.triggerText,b(this).addClass("a-active"))});c.find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(d)},y=function(a){"private"===a?(b(".reg-create-form").find("#private_blurb").removeClass("a-hidden"),b(".reg-create-form").find("#public_blurb").addClass("a-hidden"),b(".reg-create-form").find("#public_recipient").addClass("a-hidden")): (b(".reg-create-form").find("#private_blurb").addClass("a-hidden"),b(".reg-create-form").find("#public_blurb").removeClass("a-hidden"),b(".reg-create-form").find("#public_recipient").removeClass("a-hidden"))},w=function(a){for(var b=n.location.search.substring(1).split("\x26"),d=0;d<b.length;d++){var k=b[d].split("\x3d");if(k[0]===a)return k[1]}},B=function(a){a.each(function(){b.data(this,"default",this.value)}).focus(function(){this.select();this.onmouseup=function(){this.onmouseup=null;return!1}}).keyup(function(){b.data(this, "edited",""!==b.trim(this.value))}).change(function(){b.data(this,"edited",""!==b.trim(this.value))}).blur(function(){b.data(this,"edited")||(this.value=b.data(this,"default"))})},C=function(a){a.delegate("input:text","keypress",function(a){13===a.which&&a.preventDefault()})};return{changePrivacySetting:function(a){a.$event.preventDefault();var c=a.$target.closest(".a-popover");a=a.data;var d=a.type;c.hide();b("#a-popover-reg-create-privacy").find(".a-active").removeClass("a-active");b("#a-popover-reg-create-privacy").find("#WLNEW_link_"+ d).addClass("a-active");b(".reg-create-form").find("#WLNEW_input_privacy").val(d);b(".reg-create-form").find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(a.triggerText);y(a.privacy)},togglePrivacy:function(a){a.$event.preventDefault();a=a.data;var c=a.privacy;b(".reg-create-form").find("#WLNEW_input_privacy").val(c);b(".reg-create-form").find('a[id^\x3d"WLNEW_privacy_"]').find("span").html(a.triggerText);y(c)},toggleListName:function(a){var c=a.data;a=c.name;var d=c.privacy,k=c.persistence,e=c.isReorderList=== p?!1:c.isReorderList,c=c.isReorderListView===p?!1:c.isReorderListView;b(".reg-create-form").find("#WLNEW_section_wlName").show();b(".reg-create-form").find("#create-isIdeaList").val("0");b(".reg-create-form").find("#WLNEW_section_ideaList").hide();b(".reg-create-form").find("#WLNEW_list_name").val(a);b(".reg-create-form").find("#WLNEW_privacy_"+d).click();b(".reg-create-form").find("#WLNEW_input_privacy").val(d);b(".pop-create").find("#WLNEW_list_persistence").prop("checked",c?e:"persistent"===k); c&&b(".reg-create-form").find("#WLNEW_list_persistence").val(e?"persistent":"non-persistent")},toggleIdeaList:function(a){b(".reg-create-form").find("#WLNEW_section_wlName").hide();b(".reg-create-form").find("#create-isIdeaList").val("1");b(".reg-create-form").find("#WLNEW_section_ideaList").removeClass("a-hidden").show()},onShow:function(a){var c=a.popover;a=a.popover.$popover;c.data.first&&a.find("#WLNEW_section_wlFor").addClass("a-hidden");c.data.forFriend&&(a.find("#WLNEW_section_wlName, #WLNEW_section_occAge, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_wlFor, #WLNEW_listtype_listname_divider, #WLNEW_section_ideaList").addClass("a-hidden"), a.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occReminder, #WLNEW_privacy_gl").removeClass("a-hidden"),"child"===c.data.value&&t(a),b(".reg-create-form").find("#WLNEW_privacy_private").click(),b(".reg-create-form").find("#WLNEW_input_privacy").val("private"),a.find('select[name\x3d"create-for"]').val("friend"));c.data.sourceVendorId&&a.find('input[name\x3d"create-sourceVendorId"]').val(c.data.sourceVendorId);if(c.data.next){var h=c.data.next,k=a.find(".reg-create-form");k.find('input[name\x3d"create-next"]').val(h); d.each(c.data,function(a,c){c.match(/^next-/)&&(a=b("\x3cinput/\x3e",{type:"hidden",name:c,value:a}),k.prepend(a))})}B(a.find("#WLNEW_list_name"));C(a)},onDropdownSelect:function(a){var c=b(a.selectNode).closest(".a-popover");if("create-for"===a.name){var d="public";if("self"===a.value)c.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occAge, #WLNEW_section_occReminder, #WLNEW_privacy_gl").addClass("a-hidden"),c.find("#WLNEW_section_wlName, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_ideaList").removeClass("a-hidden"), "1"===b("#create-isIdeaList").val()?c.find("#WLNEW_section_wlName").hide():c.find("#WLNEW_section_ideaList").hide();else if("friend"===a.value||"child"===a.value)c.find("#WLNEW_section_wlName, #WLNEW_section_occAge, #WLNEW_listfor_listtype_divider, #WLNEW_section_wlType, #WLNEW_section_ideaList").addClass("a-hidden"),c.find("#WLNEW_section_glName, #WLNEW_section_occDate, #WLNEW_section_occReminder, #WLNEW_privacy_gl").removeClass("a-hidden"),0===b("#popCal").length&&c.find("#WLNEW_occ_date").removeClass("a-hidden"), "child"===a.value&&t(c),d="hidden",b(".reg-create-form").find("#WLNEW_privacy_private").click(),b(".reg-create-form").find("#WLNEW_input_privacy").val("private");x(d,c)}else"create-month"===a.name||"create-day"===a.name?(a=c.find('select[name\x3d"create-for"]').val())&&"child"===a&&t(c):"choose-relationship"===a.name&&(a=a.value,c.find("#create-participant_relationship").val(a))},onClose:function(a){x("public",a.popover.$popover);m=0},submitCreate:function(a,c,h,k,e){a.$event.preventDefault();var g= a.$target.closest(".reg-create-form"),l=g.closest(".a-popover");A(g);m++;var f=v(g),f=z(f),p=!1;d.each(f.errors,function(a,c){a=l.find("#WLNEW_alert_"+c);a.removeClass("a-hidden");a.parent("div").find("input").each(function(){b(this).addClass("a-form-error")});p=!0});p||(a={sid:a.data.sid,createListToken:a.data.createListToken},b.extend(a,f.userCreateArgs),l.find("#WLNEW_loading").removeClass("a-hidden"),l.find("#popover-spinner .a-popover-loading").show(),g.addClass("a-hidden"),f.userCreateArgs.isIdeaList? (c="/hz/wishlist/ajax/createlist?ref\x3ddl_create_list_lv",f.userCreateArgs.isCreateAndAdd&&(c="/hz/wishlist/ajax/createlistandadditem?ref\x3ddl_create_list_dp"),b.ajax(c,{type:"POST",data:a,success:k,error:e})):(k="Y"===a["create-isPrivate"]?"private":"public",e={},e.sid=a.sid,"undefined"!==typeof a.createListToken&&(e.createListToken=a.createListToken),e.listType=a["create-registryType"],e.privacyStatus=k,"undefined"!==typeof a["create-name"]&&(e.listName=a["create-name"]),"undefined"!==typeof a["create-persistence"]&& (e.persistence=a["create-persistence"]),"undefined"!==typeof a["create-sourceVendorId"]&&(e.vendorId=a["create-sourceVendorId"]),"undefined"!==typeof a["create-participant2-name"]&&(e.participantName=a["create-participant2-name"]),"undefined"!==typeof a["create-participant2-surName"]&&(e.participantGivenName=a["create-participant2-surName"]),"undefined"!==typeof a["create-participant2-givenName"]&&(e.participantSurName=a["create-participant2-givenName"]),"undefined"!==typeof a["create-participant2-relationship_Participant"]&& (e.relationship=a["create-participant2-relationship_Participant"]),"undefined"!==typeof a["create-occasion1-fromDate_Day"]&&(e.occasionFromDate=a["create-occasion1-fromDate_Day"]),"undefined"!==typeof a["create-occasion1-fromDate_Month"]&&(e.occasionFromMonth=a["create-occasion1-fromDate_Month"]),"undefined"!==typeof a["create-occasion1-fromDate_Year"]&&(e.occasionFromYear=a["create-occasion1-fromDate_Year"]),"undefined"!==typeof a["create-occasion1-reminderOffset_Occasion"]&&(e.occasionReminderOffset= a["create-occasion1-reminderOffset_Occasion"]),"undefined"!==typeof a.asin&&(e.asin=a.asin),"undefined"!==typeof a.customizationToken&&(e.customizationToken=a.customizationToken),"undefined"!==typeof a["create-recipient-name"]&&(e.recipientName=a["create-recipient-name"]),u(e,c,h)))}}});"use strict";f.register("mash-capabilities",function(){var d;return{isDispatchEventAvailable:function(){if(d!==p)return d;var f;a:{f=document.cookie.split(";");for(var b=0;b<f.length;b++){for(var h=f[b];" "===h.charAt(0);)h= h.substring(1,h.length);if(0===h.indexOf("amzn-app-ctxt\x3d")){f=h.substring(14,h.length);break a}}f=null}b=0;if(null!==f)try{var m=f.match(/"cp":[0-9]*/);null===m&&(m=decodeURIComponent(f).match(/"cp":[0-9]*/));if(null!==m&&0<m.length){var n=m[0].split(/:/);if(null!==n&&2===n.length){var r=parseInt(n[1],10);b="number"===typeof r?r&2048:0}}}catch(v){}return d=0!==b}}});"use strict";f.when("A").register("weblab-trigger",function(d){var f=d.$;return function(b){f.ajax({url:"/hz/wishlist/triggerweblab?name\x3d"+ b,success:function(d){d||n.ueLogError(p,{logLevel:"FATAL",attribution:"ListsDPXCommonAssets::"+b,message:"failed To trigger weblab "+b})},timeout:2E4})}})}); /* ******** */ (function(k){var h=window.AmazonUIPageJS||window.P,u=h._namespace||h.attributeErrors,a=u?u("RegistryDPAssets",""):h;a.guardFatal?a.guardFatal(k)(a,window):a.execute(function(){k(a,window)})})(function(k,h,u){k.when("A","b2b-lists-detail").execute(function(a,c){function e(){var b=a.$("#free-form-quantity-dropdown"),d=a.$("#quantity-update-text"),e=a.$("#quantity"),c=1;0<b.length&&b.is(":visible")?(c=b.val(),0===c.length&&(c=d.val())):0<d.length&&d.is(":visible")?c=d.val():0<e.length&&e.is(":visible")&& (c=e.val());return c}c.isEnabled()&&(a.on("a:dropdown:selected:quantity",function(b){c.updateQuantity(b.value)}),a.on("a:dropdown:selected:free-form-quantity-dropdown",function(b){0<b.value.length?c.updateQuantity(b.value):c.updateQuantity(a.$("#quantity-update-text").val())}),a.$(document).delegate("#quantity-update-text","change",function(b){c.updateQuantity(b.target.value)}),a.on("a:pageUpdate",function(){var b=a.$("#ASIN").val();c.updateQuantityAndAsin(e(),b)}))});k.when("A","a-modal").register("b2b-lists-detail", function(a,c){function e(){return c.get(a.$("#business-list-modal"))}function b(b,a,e){var c=new RegExp("([?\x26])"+a+"\x3d.*?(\x26|$)","i"),f=b;b.match(c)&&(f=b.replace(c,"$1"+a+"\x3d"+e+"$2"));return f}return{updateQuantityAndAsin:function(d,c){var l=(a.state("businessListPageState")||{}).businessListUrl;l&&(l=b(l,"quantity",d),d=l=b(l,"asin",c),e().update({url:d}))},updateQuantity:function(c){var n=(a.state("businessListPageState")||{}).businessListUrl;n&&(c=n=b(n,"quantity",c),e().update({url:c}))}, isEnabled:function(){return 0<a.$("#add-business-list-button").length}}});"use strict";k.when("A","a-popover","atwl-common-util","atwl-dropdown-util","atwl-util","atwl-inline-util","add-to-wish-list:plugin-registry","lists-ajax-handler","atwl-ready").register("add-to-wish-list",function(a,c,e,b,d,n,l,p){"undefined"!==typeof a.state.parse&&a.state.parse();var f=a.$;e.getState("atwl");var g=e.getState("popoverState");e.atwlFormSelector();var v=h.currentType;h.setRegistryId=e.setRegistryId;var m=[], k=function(b){"undefined"!==typeof b&&b.preventDefault();q();var c=function(){var c=e.getState("wishlistDPState").isFirstCreate?"create":"add";"add"===c&&f("html").hasClass("a-lt-ie9")?(h.atwlLoaded=!1,atwlEarlyClick(b)):(v="wishlist",h.currentType=v,a.state("wishlistDPState",{action:c,type:v}),f("#add-wishlist-declarative").trigger("click"))},d=l.getPlugin();d&&d.addToList?d.addToList(c):c()};a.on("addFormSubmit",k);var q=function(){var b=e.getState("wishlistDPState");delete b.customizationToken; delete b.customizedPrice;a.state.replace("wishlistDPState",b)};c=function(){(g.showWishListDropDown||g.showBabyRegDropdown||g.isAddToWishListDropDownAuiEnabled||g.showPopover)&&g.showPopover&&(f("#add-to-wishlist-button-submit").unbind("click").bind("click",k),a.declarative("add-wishlist-declarative",["click"],function(b){b=e.getState("wishlistDPState");d.parsePostData(b.action,b.type);(b=h.ue)&&b.count("lists:dp:addtolist:click",(b.count("lists:dp:addtolist:click")||0)+1)}))};c();a.on("atwl-trigger-onload-bindings", c);return{setPostAddSuccess:function(b){m.push(b)}}});"use strict";k.when("A","a-popover","atwl-common-util").register("atwl-dropdown-util",function(a,c,e){var b=a.$;e.getState("popoverState");var d=0,n,l=e.CONST,p=e.ie8NoScroll,f=e.setAtwlState,g=function(){b("#wishListDropDown").removeClass("a-button-selected");b("#wishListMainButton").removeClass("a-button-selected")},v=function(){var b=e.getState("atwl"),a=b.activePopoverButtonId;return"undefined"!==a&&"add-to-baby-button-group"===a?b.babyDropDownHtml: b.dropDownHtml},m=function(b){var a=e.getState("atwl").activePopoverButtonId;"undefined"!==a&&"add-to-baby-button-group"===a?f({babyDropDownHtml:b}):f({dropDownHtml:b})},k=function(){var a=b("#atwl-dd-ul").parent();if(a&&a.get(0)){var c=a.get(0).scrollHeight,e=a.height(),a=2*parseInt(a.css("padding-top"),10);return c>e+a}return!1},q=function(c){c.find(".a-button-close").hide();c.find(".a-popover-content").css({"margin-right":"0px"});c.css({padding:"0"});c.find(".a-popover-inner").css({padding:"0"}); setTimeout(function(){c.find(".a-arrow-border").addClass("aok-hidden");b("#atwl-rich-content").css({"margin-bottom":"0px",width:"auto"});var d=e.getState("atwl");if(d.hzPopover){var f=document.getElementById(d.activePopoverButtonId);if(null!==f&&"undefined"!==typeof f){var g=f.getBoundingClientRect().left;a.capabilities.rtl&&(g=b(h).width()-f.getBoundingClientRect().right);c.css({left:g+"px"})}}b.browser.msie&&(g=b("#"+d.wishlistButtonSubmitId),d=g.offset(),f=g.height(),g=d.left,d=d.top+f,p()&&(g+= document.body.parentElement.scrollLeft,d+=document.body.parentElement.scrollTop),k()&&(g-=17),c.css({left:g+"px",top:d+"px"}))},50)},x=function(a){var c;c=p()?50:0;setTimeout(function(){var c=b("#atwl-popover-inner"),d=c.width(),f=e.getState("atwl"),g=document.getElementById(f.activePopoverButtonId);f.hzPopover&&null!==g&&"undefined"!==typeof g?d=g.getBoundingClientRect().width:k()?d+=l.overflowWidth:b(".atwl-dd-list-name").each(function(a){a=b(this);a.width(a.width()+l.noOverflowWidth)});f=a.find("ul li a.a-active").first(); f.css("margin-left","1px");f.parent().focus();c.width(d)},c)},t=function(){if(n){var b=c.get(n);b&&b.hide()}},w=function(a){var d=l.widthStaticPopovers;try{d=document.getElementById("add-to-wishlist-button-group").clientWidth}catch(f){}b("#"+a).children().first().width(d);t();if(c){var g=c.get(n),r=e.getState("atwl"),g=g?c.get(n):c.create(b("#"+r.activePopoverButtonId),{content:b("#"+a).html(),name:"atwl",skin:function(b){return b},activate:"onmouseclick",width:d,position:r.dropDownPosition||"triggerBottom"}); g.update({width:d,content:b("#"+a).html()});n=g.id;g.show().updatePosition();q(g.$popover)}},r=function(){g();d++;t();w("atwl-dd-error-holder")},A=function(){var a=e.getState("atwl");return c.create(b("#"+a.activePopoverButtonId),{content:v(),name:"atwl",skin:function(b){return b},activate:"onmouseclick",position:a.dropDownPosition||"triggerBottom"})},C=function(b){b.update({content:v(),width:"auto"});b.show();q(b.$popover);x(b.$popover)},u=function(){var d=c.get("atwl");d&&d.isActive()?d.hide(): (d=A(),c.remove(d),d=A(),C(d),a.capabilities.touch&&setTimeout(function(){var a=b("#wishlistButtonStack"),c=a.clone(),d=a.parent();a.remove();d.append(c)},300),"function"===typeof h.uet&&h.uet("cf","addToListDropdown",{wb:1}),"function"===typeof h.uex&&h.uex("ld","addToListDropdown",{wb:1}))},B=function(){var b=c.get("atwl");b&&b.isActive()&&b.hide()},y=function(b,a,c){b.append('\x3cinput type\x3d"hidden" id\x3d"'+a+'" name\x3d"'+a+'" value\x3d"'+c+'"\x3e')};return{makeDropDownArrowInactive:g,getDropDownHtml:v, setDropDownHtml:m,resetDropDownHtml:function(){m("")},resetAjaxFailCount:function(){this.ajaxFailCount=0},hideDropdown:B,hideError:function(){t();var b=e.getState("atwl");return d>=b.maxAjaxFailureCount},showUnavail:function(){t();t();w("atwl-dd-unavail-holder")},showSpinner:function(){w("atwl-dd-spinner-holder")},parseAjaxResponse:function(c){g();t();var d;if("object"===typeof c)d=c;else try{d=a.parseJSON(c)}catch(f){r();return}"undefined"!==typeof d.html&&"undefined"!==d.css?(m(d.html),c=d.css, b("body").append(c),u()):r()},showError:r,showDropDown:u,setInputRegistryId:function(c,d){"undefined"===typeof d&&(d="wishlist");var g="pop_"+c+"_"+d,r=b(e.atwlFormSelector()),q=r.find(e.popCommandSelector);q.length?q.attr("value",g):y(r,"sourceCustomerOrgListID",g);g=r.find("[name\x3d'registryID']");g.length?g.attr("value",c):y(r,"registryID",c);c=r.find("[name\x3d'registryType']");c.length?c.attr("value",d):y(r,"registryType",d);f({inSubmit:!0});d=r.find("[name\x3d'submit.add-to-registry.wishlist'],[name\x3d'submit.add-to-wishlist']").eq(0); d.length?d.click():a.trigger("addFormSubmit");B();return!1}}});"use strict";k.when("A","a-popover","atwl-dropdown-util","atwl-common-util","atwl-inline-util","kbp","idea-list-csrf-utils","add-to-list-modal-util","lists-ajax-handler","atwl-ready").execute("atwl-dropdown",function(a,c,e,b,d,n,l,p,f){var g=a.$,v=b.getState("popoverState"),m=b.getState("atwl"),k=m.wireDeclaratives,q=function(){var b=g("#"+m.wishlistButtonId),d=g("#"+m.wishlistButtonSubmitId);a.on("wl-drop-down",function(b){t(b)});d.addClass("a-declarative"); d.attr("data-action","atwl-splitbutton-main");g("#wishListMainButton").addClass("a-declarative").attr("data-action","add-wishlist-declarative");h.atwlEc&&setTimeout(function(){b.click();g("#atwl-dd-spinner-holder").addClass("a-hidden");h.atwlEc=!1},1);h.atwlLoaded=!0};a.on("a:pageUpdate",function(){g("#wishListMainButton").hasClass("a-declarative")||(q(),a.trigger("atwl-trigger-onload-bindings"))});var x=function(){var b;b=h.atwlEc?"lists:dp:ech:early":"lists:dp:ech:late";var a=h.ue;a&&a.count(b, (a.count(b)||0)+1)},t=function(a){a.$event&&a.$event.originalEvent&&a.$event.originalEvent.acknowledge&&a.$event.originalEvent.acknowledge(a.$currentTarget.get(0));"function"===typeof h.uet&&h.uet("bb","addToListDropdown",{wb:1});x();b.setAtwlState({activePopoverButtonId:"add-to-wishlist-button-group"});a.$event?a.$event.preventDefault():a.preventDefault();setTimeout(function(){e.makeDropDownArrowInactive()},0);if("not-allowed"===(a.$target?a.$target:g(a.target)).css("cursor"))return!1;if(e.hideError())return e.showUnavail(), !1;if((a=e.getDropDownHtml())&&a.length)e.showDropDown();else{e.showSpinner();a=b.getState("wishlistDPState");var d="website.wishlist.detail.add";"undefined"!==typeof a.vendorId&&(d=a.vendorId);a="/hz/wishlist/addtolist?"+g.param({sortMethod:m.sortMethod||0,type:"wishlist",useAll:m.showAllTypes||0,sourceVendorId:d});g.ajax({url:a,cache:!1,success:e.parseAjaxResponse,error:e.showError})}return!1};if(v.showWishListDropDown||v.isAddToWishListDropDownAuiEnabled||v.showPopover)q(),b.setAtwlState({resetDropDownHtml:e.resetDropDownHtml}), k||(a.declarative("atwl-splitbutton-arrow","click",t),a.declarative("atwl-dd","click",function(d){d.$event.preventDefault();w();e.hideDropdown();var c=d.data;p.show(d.$target,{height:c.height,width:c.width,name:c.name,header:c.header,padding:c.padding});d={asin:b.getAsin(),vendorId:"website.wishlist.detail.add",listExternalId:c.listExternalId,listType:c.listType,isAjax:"1"};a.state.replace("atwl-huc-recommendation-state",{listId:d.listExternalId,listType:d.listType});f.post({url:"/hz/wishlist/additemtolist", params:d,successCallback:function(a){p.updateHtmlContent(a)},errorCallback:function(a){}})}),a.declarative("atwl-dd-dl","click",function(c){c.$event.preventDefault();e.hideDropdown();d.showSpinner();var f=b.getAsin(),q=b.getSid(),f=g.extend({},{asin:f,sid:q},c.data),q=[];l.addIdeaListCsrfToken(q);a.post("/create/api/addToList?ref\x3didea_dp_ai",{params:f,headers:q,success:function(a){a.registryName=c.data.listName;d.addItemResponseHandler(a)},error:d.showError,abort:d.showError});return!1}),a.declarative("atwl-kbp-landing", "click",function(a){a=a.data;var d=b.getAsin();h.open(a.url+("\x26asin\x3d"+d));return!1})),m&&"kbp"===m.sortMethod&&(a.state("atwl",{kbpPromo:{mouseOver:!1,countDown:!1}}),a.ajax("/gp/toys/birthday/atwl-dpx.html",{method:"get",cache:!1,params:{isAUI:1},success:n.showKbpPromoPopover,error:function(){}}),k||(a.declarative("atwl-kbp-promo-mouseover","mouseleave",function(){var d=b.getState("atwl").kbpPromo;d.mouseOver=!1;if(d.countDown){var f=c.get("kbpPromoPopover");f&&(f.unlock().hide(),c.remove(f))}a.state("atwl", {kbpPromo:d})}),a.declarative("atwl-kbp-promo-mouseover","mouseenter",function(){var d=b.getState("atwl").kbpPromo;d.mouseOver=!0;a.state("atwl",{kbpPromo:d})}),a.on("a:popover:hide:kbpPromoPopover",function(){var a=c.get("kbpPromoPopover");a.unlock().hide();c.remove(a)}))),b.setAtwlState({wireDeclaratives:!0});var w=function(){var a=h.ue;a&&a.count("lists:dp:addtolist:dropdownentry:click",(a.count("lists:dp:addtolist:dropdownentry:click")||0)+1)}});"use strict";(function(){var a=!1;k.when("cf").execute(function(){a|| (a=!0,c())});k.when("atwl-cf").execute(function(){a||(a=!0,c())});var c=function(){k.now("cf-or-atwl-cf").execute(function(a){"undefined"===typeof a&&h.P.register("cf-or-atwl-cf")})}})();k.when("A","cf-or-atwl-cf").register("atwl-common-util",function(a){var c=a.$,e=function(){return"#"+(b("popoverState").formId||"addToCart")+",#addToWL"},b=function(b){a.state.parse();return 0===c('script[data-a-state\x3d"{"key":"'+b+'"}"]').length?{}:a.state(b)||JSON.parse(c('script[data-a-state\x3d"{"key":"'+b+ '"}"]').text())||{}};return{CONST:{widthStaticPopovers:230,overflowWidth:10,noOverflowWidth:10,scrollbarWidth:17},getAsin:function(){var a=c(e()).find("#ASIN").val();return"undefined"===typeof a?c(e()).find("[name^\x3d'ASIN'],[name^\x3d'ASIN.0']").val():""===a?b("atwl").asin:a},getSid:function(){var a=c(e()).find("#session-id").val();"undefined"===typeof a&&(a=c(e()).find("[name\x3d'session-id']").val());return a},ie8NoScroll:function(){return 9>parseInt(c.browser.version,10)&&document.body&&document.body.parentElement? !(!document.body.parentElement.scrollLeft&&!document.body.parentElement.scrollTop):!1},setRegistryID:function(a){var b=c(e());b.find("[name\x3d'sourceCustomerOrgListID'],[name\x3d'colid'],[name\x3d'wlPopCommand']").attr("value",a);b.find("[name\x3d'submit.add-to-registry.wishlist'],[name\x3d'submit.add-to-wishlist']").eq(0).click();return!1},setAtwlState:function(b){a.state("atwl",c.extend(a.state("atwl")||{},b))},getState:b,clearText:function(a){a.value===a.defaultValue&&(a.value="")},forceFormSubmit:function(a){var b= a.attr("name");a=a.parents("form");b=c('\x3cinput type\x3d"hidden" /\x3e').attr("name",b).val("1");a.append(c(b));a.submit()},clearPopCommandFields:function(){for(var a=["wlPopCommand","sourceCustomerOrgListID"],b=0;b<a.length;b++){var e=c('[name^\x3d"'+a[b]+'"]');e&&e.length&&e.val("")}},atwlFormSelector:e,popCommandSelector:"[name\x3d'sourceCustomerOrgListID'],[name\x3d'colid'],[name\x3d'wlPopCommand']"}});"use strict";k.when("A","a-popover","atwl-common-util").register("kbp",function(a,c,e){var b= a.$,d=e.getState("atwl"),n=b("#"+d.wishlistButtonSubmitId);return{showKbpPromoPopover:function(b){if(b&&b.promoEnabled){var d=b.html;if(d){var f=c.create(n.parent(),{name:"kbpPromoPopover",content:d,position:"triggerBottom",width:b.width});f.show().lock();a.delay(function(){var b=e.getState("atwl").kbpPromo||{};b.mouseOver?b.countDown=!0:(f.unlock().hide(),c.remove(f));a.state("atwl",{kbpPromo:b})},1E4)}}}}});"use strict";k.when("A","atwl-util","atwl-dropdown-util","atwl-common-util","lists-ajax-handler", "atwl-ready").execute("atwl-huc",function(a,c,e,b,d){var n=a.$;e=b.getState("popoverState");var l=b.getState("createInfo")||{},p="addCreateToWishlist";l.isHorizonte&&(p="reg-create");if(e.showWishListDropDown||e.showBabyRegDropdown||e.isAddToWishListDropDownAuiEnabled||e.showPopover)a.on("a:popover:show:"+p,function(f){var e=f.popover,n=e.$popover;f=b.getState("wishlistDPState");var m=f.action;n.addClass("pop-huc-"+m);var p=e.$trigger.closest(".a-button").find("input"),n=f.type;p.closest(".a-button-selected").removeClass("a-button-selected"); n=c.parsePostData(m,n);f.customizationToken&&(n.customizationToken=f.customizationToken);f=n.url;var q=n.streaming,k="ajax_"+q,t=new Date;h.ue&&h.uet("tc",k);var w=function(){e.hide();b.forceFormSubmit(p)},r=function(){e.$popover.find("#popover-spinner").addClass("a-hidden");b.clearPopCommandFields()};"create"!==m&&q?(f=c.buildAddItemToDefaultListParams(n),a.state.replace("atwl-huc-recommendation-state",{listId:"",listType:f.listType}),d.post({url:"/hz/wishlist/additemtolist",params:f,successCallback:function(a){r(); e.$popover.find("#WLHUC_result").html(a).removeClass("a-hidden");e.updatePosition()},errorCallback:w})):l.isHorizonte?a.ajax(f,{method:"get",success:function(a){e.$popover.find("#popover-spinner").addClass("a-hidden");e.$popover.find("#WLHUC_result").html(a).removeClass("a-hidden");e.updatePosition()},error:w}):a.ajax(f,{method:"post",params:n,success:function(a){a&&a.html?(h.ue&&(h.ues("id",k,a.requestId),h.ues("t0",k,t),h.ues("ctb",k,"1")),a.status&&"no-asins"===a.status?w():(r(),"add"===m?e.$popover.find("#WLHUC_result").html(a.html).removeClass("a-hidden"): (e.$popover.find("#WLNEW_main").html(a.html).removeClass("a-hidden"),(a=b.getState("atwl"))&&a.resetDropDownHtml&&a.resetDropDownHtml()),e.updatePosition()),h.ue&&(h.uet("be",k),h.uex("ld",k))):("create"===m&&b.forceFormSubmit(p),e.hide())},error:w})}),a.on("a:popover:beforeShow:"+p,function(a){a=a.popover;var c=b.getState("wishlistDPState");a.$popover.find("#popover-spinner").css({margin:"10% 40%"});a.$popover.find("#popover-spinner").removeClass("a-hidden");a.$popover.find(".wlAddCreatePop").html("").addClass("a-hidden"); var d=c.action,e=d+"Header";"create"===d&&c.isFirstCreate&&(e="first"+e);a.update({width:c[d+"Width"],header:c[e],height:c[d+"Height"]});a.updatePosition()}),a.on("a:popover:hide:"+p,function(a){n(".a-modal-scroller").css({visibility:"hidden"});b.clearPopCommandFields()})});"use strict";k.when("A","atwl-common-util","add-to-wish-list:plugin-registry").register("atwl-util",function(a,c,e){var b=a.$;return{parsePostData:function(a,b){var l=c.getState("popoverState"),l=document.getElementById(l.formId|| "addToCart");if("undefined"===typeof l||null===l)l=document.getElementById("addToWL");var k=[];if("undefined"!==typeof l&&null!==l){var f=[],k=!1,g=l.elements;g||(g=l.querySelectorAll("input"),k=!0);for(var h=0;h<g.length;h++){var m;if(!(m=k)){m=g[h];var u=/^(?:checkbox|radio)$/i,q=/^(?:submit|button|image|reset|file)$/i,x=/^(?:input|select|textarea|keygen)/i;if(m){var t=m.type;m=m.name&&!m.disabled&&x.test(m.nodeName)&&!q.test(t)&&(m.checked||!u.test(t))}else m=!1}m&&f.push(g[h])}k=f}f={};g=c.getState("wishlistDPState"); for(h=0;h<k.length;h++)"submit"!==k[h].type&&(f[k[h].name]=k[h].value);f.requestedQty=f.quantity=null!==l&&"undefined"!==typeof l.quantity?l.quantity.value:1;f.sid="undefined"!==typeof f["session-id"]?f["session-id"]:g.sid;f.cache=!1;f.url=g[a+"Url"];f.action=a;f.type=f.registryType||"wishlist";"add"===a?(f.type=f.registryType||b,f.caller="aui",f.streaming=g.streaming,f.sourceVendorId="undefined"!==typeof g.vendorId?g.vendorId:"website.wishlist.detail.add"):"create"===a&&(f.create_sid=f.sid,f.create_type= f.registryType||b,f.create_nextAction="add",f.create_includeEmptyList=1,f.create_isFirst=g.isFirstCreate?1:0,f.caller="aui",f.create_sourceVendorId="undefined"!==typeof g.vendorId?g.vendorId:"website.wishlist.detail.add");(a=e.getPlugin())&&a.filterFormData&&a.filterFormData(f);return f},hideAddToListButtonStack:function(){b("#add-to-wishlist-button-group").hasClass("a-hidden")||b("#add-to-wishlist-button-group").addClass("a-hidden")},showAddToListButtonStack:function(){b("#add-to-wishlist-button-group").hasClass("a-hidden")&& b("#add-to-wishlist-button-group").removeClass("a-hidden")},buildAddItemToDefaultListParams:function(a){return{asin:c.getAsin(),vendorId:"website.wishlist.detail.add",listType:a.type,isAjax:"1"}}}});"use strict";k.when("A","atwl-util","atwl-dropdown-util","cf").register("atwl-inline-util",function(a,c,e){var b=a.$,d=function(){b("#atwl-inline-spinner").addClass("a-hidden")},n=function(){c.hideAddToListButtonStack();b("#atwl-inline-spinner").removeClass("a-hidden")},l=function(){d();b("#atwl-inline").addClass("a-hidden"); c.showAddToListButtonStack();e.makeDropDownArrowInactive();b("#atwl-inline-error").removeClass("a-hidden")},k=function(a){b("#atwl-inline-error-msg").empty();b("#atwl-inline-error-msg").html(a)},f=function(a,c){a=c&&"giftlist"===c?"/gp/registry/giftlist/"+a+"/ref\x3dwl_inline_title":c&&"discoverlist"===c?"/create/collection?id\x3damzn1.ideas."+a+"\x26ref_\x3didea_dp_inline":"/gp/registry/wishlist/"+a+"/ref\x3dwl_inline_title";b("#atwl-inline-link").attr("href",a)},g=function(a){b("#atwl-inline-link-text").empty(); b("#atwl-inline-link-text").text(a)},h=function(){d();b("#atwl-inline-error").addClass("a-hidden");b("#atwl-inline").removeClass("a-hidden")},m=function(a){a&&a.message&&k(a.message);l();b(".reg-create-form").closest(".a-popover").find(".a-button-close").click()},z=function(a){n();b(".reg-create-form").closest(".a-popover").find(".a-button-close").click();g(a.listName)};return{showSpinner:n,showError:l,showErrorClosePopover:m,parseParams:function(a,b){a=c.parsePostData(a,b);b=a.ASIN||a["ASIN.0"]; var d=a["session-id"],e=a.sourceVendorId,f=a.type||"wishlist",g;g="create"===a.action?"newsl":a.wlPopCommand?a.wlPopCommand.split("_")[1]:a.sourceCustomerOrgListID?a.sourceCustomerOrgListID.split("_")[1]:"default";return{asin:b,sid:d,sourceVendorId:e,type:f,registryID:g,pcomp:0,action:a.action}},addItemResponseHandler:function(a){try{typeof a!==u?1===a.isValid||!0===a.updateSuccessful?(f(a.registryID,a.registryType),g(a.registryName),h()):typeof a.message!==u&&(k(a.message),l()):l()}catch(b){l()}}, addItemResponseHandlerHZ:function(a){try{typeof a!==u&&!1===a.hasError?(z(a),f(a.listExternalId,a.listType),h()):l()}catch(b){l()}},addItemResponseHandlerHZIdeaList:function(a){try{typeof a!==u&&a.updateSuccessful?(z(a),f(a.listId,"discoverlist"),h()):m(a)}catch(b){m(a)}}}});"use strict";k.register("add-to-wish-list:plugin-registry",function(){var a=null;return{registerPlugin:function(c){if(null!==a)throw Error("Only a single plugin can be registered.");a=c},getPlugin:function(){return a}}});"use strict"; k.when("A","a-modal").register("add-to-list-modal-util",function(a,c){a.declarative("continue-shopping-submit","click",function(a){e("reg-create","hide");e("add-item-to-list-modal","remove")});var e=function(a,d){var e=c.get(a);e&&("hide"==d?e.hide():c.remove(a))};return{show:function(a,d){e("add-item-to-list-modal","remove");c.create(a,d).show()},updateHtmlContent:function(a){c.get("add-item-to-list-modal").update({content:a})}}});"use strict";k.when("A","atwl-common-util","amazon-lists-csrf-utils").register("add-to-list-from-huc-recs", function(a,c,e){var b=a.$,d=function(a){var b=h.ue;b&&b.count(a,(b.count(a)||0)+1)};a.on("lists:widget:add_card_item_to_list_requested",function(h,k){var p=a.state("atwl-huc-recommendation-state");k={listId:p.listId,listType:p.listType,asin:h,sid:c.getSid(),tags:JSON.stringify(k)};var f=function(){d("lists:dp:card:addtolist:failed");a.trigger("lists:widget:add_card_item_to_list_failed",h)},p=[];e.addCsrfToken(p);b.ajax({type:"POST",url:"/hz/wishlist/addasin",data:k,headers:p,success:function(b){b&& !1===b.hasError?(d("lists:dp:card:addtolist:succeeded"),a.trigger("lists:widget:add_card_item_to_list_succeeded",h)):f()},error:f})})});"use strict";k.when("A","legacy-create-utils","atwl-inline-util").execute(function(a,c,e){var b=a.$;a.state.parse();if((a.state("createInfo")||{}).isHorizonte){var d=function(){b("#WLNEW_error").removeClass("a-hidden")},h=function(a){try{if(typeof a!==u&&!1===a.hasError){b("#WLNEW_loading").addClass("a-hidden");var c=b(".reg-create-form");c.addClass("a-hidden");a.htmlMessage? c.parent().append(a.htmlMessage):d()}else d()}catch(e){d()}};a.declarative("reg-create-submit",["click"],function(a){c.submitCreate(a,h,d,e.addItemResponseHandlerHZIdeaList,e.showErrorClosePopover)})}});"use strict";k.when("A","jQuery").execute(function(a,c){a.declarative("remaining-customizations-action","click",function(a){var b=a.$currentTarget.parent().find(".remaining_customization_info");b.show();b.removeClass("aok-hidden");a.$currentTarget.hide();a.$event.preventDefault()})});"use strict"; k.when("A","create-utils").execute(function(a,c){var e=a.$,b=function(a){e("#create-list-loading").addClass("aok-hidden");e("#create-list-error").removeClass("aok-hidden");a.message?e("#create-list-error").html(a.message):h.ueLogError&&h.ueLogError({message:"Redesigned Create List failed.",logLevel:"FATAL"})},d=function(a){a&&!a.hasError?a.htmlMessage?(e("#create-list-loading").addClass("aok-hidden"),e("#create-list-form").parent().append(a.htmlMessage)):b():b()};a.declarative("create-list-submit", ["click"],function(a){c.submitCreate(a,d,b)})})}); /* ******** */ (function(n){var g=window.AmazonUIPageJS||window.P,t=g._namespace||g.attributeErrors,B=t?t("GenericRegistryDPXAssets",""):g;B.guardFatal?B.guardFatal(n)(B,window):B.execute(function(){n(B,window)})})(function(n,g,t){"use strict";n.when("A","a-modal","a-popover","a-checkbox","a-dropdown","a-splitdropdown","ready").register("add-to-br-util",function(c,G,p,f,e){function r(){return encodeURIComponent(b("#ASIN").val())}function H(a){var q=c.state("atbrState"),E=q.hasBabyReg||!1,k="true"===b("#is-fully-selected-baby-reg").val()|| !1,f=r();f!==t&&k&&(k=encodeURIComponent(q.sessionId),E?d(q,"C",a):g.location.href="/baby-reg/signup/ref\x3ddp_create_br_desktop?asin\x3d"+f+"\x26sessionId\x3d"+k)}function d(a,q,d){var k=r();a=encodeURIComponent(a.sessionId);var e={};e.asin=k;e.sid=a;e.vendorId=d||"website.dpx.atbr";c.post("/baby-reg/button-action/atbr-dpx/ref\x3ddpx_atbr_dsk",{params:e,timeout:5E3,success:function(a){a!==t&&"failure"!==a.result?("duplicate"===a.result?(b("#br-dp-post-atbr-status-add-to-registry-success").addClass("a-hidden"), b("#br-dp-post-atbr-status-add-to-registry-dup").removeClass("a-hidden")):(b("#br-dp-post-atbr-status-add-to-registry-dup").addClass("a-hidden"),b("#br-dp-post-atbr-status-add-to-registry-success").removeClass("a-hidden")),f("#br_dp_post_atbr_manage_must_have_item").hide(),f("#br_dp_post_atbr_manage_group_gifting_item").hide(),f("#br_dp_post_atbr_manage_private_item").hide(),document.getElementById("dp-br-post-atbr-header-checklist-text-circle").style.paddingLeft=460-b("#dp-br-post-atbr-header-text").width()+ "px",b("#br-dp-post-atbr-light-box").removeClass("a-hidden"),b("#br-dp-post-atbr-container").removeClass("a-hidden"),b("body").addClass("br-dp-post-atbr-no-scroll"),b("#br-dp-post-atbr-container").removeClass("br-dp-post-atbr-container-hide"),b("#br-dp-post-atbr-container").addClass("br-dp-post-atbr-container-show"),K(),v(q)):g.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_hp?asin\x3d"+k},error:function(){g.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_er?asin\x3d"+k}})}function v(a){b("#br-dp-post-atbr-recommadation").html("\x3cspan\x3e\x3c/span\x3e"); b("#br-dp-post-atbr-spinner").removeClass("a-hidden");a={asin:r(),treatment:a};c.get("/baby-reg/dp-post-atbr-recommendation",{params:a,success:function(a){b("#br-dp-post-atbr-spinner").addClass("a-hidden");b("#br-dp-post-atbr-recommadation").html(a)},failure:function(){}})}function K(){var a={asin:r()};c.get("/baby-reg/dp-post-atbr-status",{params:a,success:function(a){b("#br-dp-post-atbr-status-add-to-registry-item-img").attr("src",a.result.newAddedItemImgUrl);null!=a.result.checklistPercent&&(b("#dp-br-post-atbr-header-checklist-percent").html(a.result.checklistPercent+ '\x3cspan class\x3d"smaller"\x3e%\x3c/span\x3e'),b("#dp-br-post-atbr-header-checklist-pie").addClass("progress-"+a.result.checklistPercent),b("#dp-br-post-atbr-header-checklist-pie").removeClass("progress-0"),b("#dp-br-post-atbr-header-checklist-text-circle").removeClass("a-hidden"));b("#dp-br-post-atbr-header-checklist-link").attr("href",a.result.checklistLink);b("#dp-br-post-atbr-header-registry-link").attr("href",a.result.registryLink);if(a.result.hasMustHave){x=!0;var c=f("#br_dp_post_atbr_manage_must_have_item"); c.show();a.result.isMustHaveItem&&c.check()}a.result.hasGroupGifting&&(z=!0,c=f("#br_dp_post_atbr_manage_group_gifting_item"),c.show(),w=a.result.helpInfoLinkGroupGifting,a.result.isGroupGiftingItem&&c.check());a.result.hasPrivate&&(y=!0,c=f("#br_dp_post_atbr_manage_private_item"),c.show(),a.result.isPrivateItem&&c.check());a=a.result.itemRequestedCount;!Number.isInteger(a)||0>=a||(10<a?(a=e.getSelect("br-dp-post-atbr-header-registry-request").getOption("br-dp-post-atbr-dropdown-tenPlusOpt"),a.info()[0]=== t?e.getSelect("br-dp-post-atbr-header-registry-request").appendOption({text:"10+",value:"10+Opt",native_id:"br-dp-post-atbr-dropdown-tenPlusOpt",selected:"true",css_class:"br-dp-post-atbr-dropdown-option-disabled",native_css_class:"br-dp-post-atbr-dropdown-option-disabled"}):a.update({selected:"true",text:"10+"})):(e.getSelect("br-dp-post-atbr-header-registry-request").getOption(a-1).update({selected:"true",text:a}),A()))},error:function(){}})}function A(){e.getSelect("br-dp-post-atbr-header-registry-request").removeOption("br-dp-post-atbr-dropdown-tenPlusOpt")} var b=c.$,z=!1,x=!1,y=!1,w="",m=(c.state("atbrState")||{}).token;c.declarative("dpx-add-to-baby-registry-action",["click"],function(a){H()});c.declarative("br_dp_post_atbr_close",["click"],function(a){document.getElementById("br-dp-post-atbr-container").classList.remove("br-dp-post-atbr-container-show");document.getElementById("br-dp-post-atbr-container").classList.add("br-dp-post-atbr-container-hide");document.getElementById("br-dp-post-atbr-light-box").classList.add("a-hidden");document.body.classList.remove("br-dp-post-atbr-no-scroll"); c.get("/baby-reg/dp-post-atbr-close/ref\x3dbr_dsk_dpx_patr_hdr_close",{})});c.declarative("br-dp-post-atbr-status-manage-info-popover",["click"],function(a){p.create(a.$target,{inlineContent:a.data.popoverContent,position:"triggerBottom",activate:"onclick"}).show();!1===x&&(b("#br-manage-popover-content-section-title-must-have").addClass("a-hidden"),b("#br-manage-popover-content-section-content-must-have").addClass("a-hidden"));!1===z?(b("#br-manage-popover-content-section-title-group").addClass("a-hidden"), b("#br-manage-popover-content-section-content-group").addClass("a-hidden")):b("#br-manage-popover-content-section-content-group-link").attr("href",w);!1===y&&(b("#br-manage-popover-content-section-title-private").addClass("a-hidden"),b("#br-manage-popover-content-section-content-private").addClass("a-hidden"));c.get("/baby-reg/dp-post-atbr-manage-help-info/ref\x3dbr_dsk_dpx_patr_mgmt_info",{})});c.declarative("post-atbr-item-atbr-button-action",["click"],function(a){var d=a.data.reftag,g=a.data.asin; a=a.data.sid;var k={};k.asin=g;k.sid=a;k.vendorId="website.dpx.post-atbr";c.post("/baby-reg/button-action/atbr-dpx/ref\x3d"+d,{params:k,timeout:5E3,success:function(a){a!==t&&"failure"!==a.result?(b("#post-atbr-item-atbr-success-"+g).removeClass("a-hidden"),b("#post-atbr-item-button-"+g).addClass("a-hidden"),b("#post-atbr-item-atbr-failure-"+g).addClass("a-hidden")):b("#post-atbr-item-atbr-failure-"+g).removeClass("a-hidden")},error:function(){b("#post-atbr-item-atbr-failure-"+g).removeClass("a-hidden")}})}); c.declarative("post-atbr-item-see-all-button-action",["click"],function(a){g.location.href=a.data.link});c.declarative("br_dp_post_atbr_manage_must_have_item_action","change",function(a){a.$event.preventDefault();a={isMustHaveItem:b("#br_dp_post_atbr_manage_must_have_item").is(":checked"),asin:r(),token:m};c.post("/baby-reg/dp-post-atbr-status-manage-must-have/ref\x3dbr_dsk_dpx_patr_mgmt_mh",{params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_group_gifting_item_action", "change",function(a){a.$event.preventDefault();a={isGroupGiftingItem:b("#br_dp_post_atbr_manage_group_gifting_item").is(":checked"),asin:r(),token:m};c.post("/baby-reg/dp-post-atbr-status-manage-group-gifting/ref\x3dbr_dsk_dpx_patr_mgmt_gg",{params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_private_item_action","change",function(a){a={isPrivateItem:b("#br_dp_post_atbr_manage_private_item").is(":checked"),asin:r(),token:m};c.post("/baby-reg/dp-post-atbr-status-manage-private/ref\x3dbr_dsk_dpx_patr_mgmt_pvt", {params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_request_quantity_item_action","change",function(a){a={requestQuantity:b("#br-dp-post-atbr-header-registry-request").val(),asin:r(),token:m};c.post("/baby-reg/dp-post-atbr-status-manage-request-quantity/ref\x3dbr_dsk_dpx_patr_mgmt_qty",{params:a,success:function(a){A()},error:function(a){}})});return{addToBabyRegistryFromDPX:H}});"use strict";n.when("A","a-button","a-modal","ready").register("dpx-modal-add-to-wr-declarative-actions", function(c,G,p){var f=c.$,e=c.state("modal-add-to-wedding-registry-status");if(e&&e.weddingButtonId&&f("#"+e.weddingButtonId).length){var r={name:"wr-modal-add-to-reg-wedding-registry",header:e.modalHeader,url:""};f(document).delegate("#"+e.weddingButtonId,"click",function(c){c.preventDefault();if(e.userSignedIn){var d=f("#quantity").val();d||(d=1);c=p.create(f("#"+e.weddingButtonId),r);var v=encodeURIComponent(f("#ASIN").val()),d=encodeURIComponent(d),G=e.token?"\x26token\x3d"+encodeURIComponent(e.token): "";e.hasWeddingRegistry?(c.update({cache:!1,url:"/wedding/modal/external-add-to-registry?asin\x3d"+v+"\x26quantity\x3d"+d+G+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop"}).show(),"undefined"!==typeof g.ue&&g.ue.count("wrAddToRegModalPopup",(g.ue.count("wrAddToRegModalPopup")||0)+1)):g.location.href="/wedding/new-registry?asin."+v+"\x3d"+d+"\x26vendorId\x3dgr-dpx-new-reg\x26associateId\x3d\x26associateSubId\x3d"}else g.location.href="/wedding/nosignin"});c.declarative("wr-modal-add-to-reg-rec-add-to-registry-action", "click",function(e){var d=e.data;e=f("#wr-modal-add-to-reg-wrapper").data("token");var p=G("#wr-modal-add-to-reg-add-to-wr-"+d.recItemAsin);p.isEnabled()&&(p.disable(),!0===f("#wr-modal-add-to-reg-rec-product-card-"+d.recItemAsin).data("exist-in-registry")?(p.hide(),f("#wr-modal-add-to-reg-item-exist-message-"+d.recItemAsin).removeClass("aok-hidden")):(e={items:JSON.stringify([{asin:d.recItemAsin,requestedQuantity:1}]),token:e},c.post("/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa", {params:e,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(c){p.hide();c.success?f("#wr-modal-add-to-reg-item-added-message-"+d.recItemAsin).removeClass("aok-hidden"):"ITEM_ALREADY_EXIST"===c.errorCode?f("#wr-modal-add-to-reg-item-exist-message-"+d.recItemAsin).removeClass("aok-hidden"):f("#wr-modal-add-to-reg-item-added-error-"+d.recItemAsin).removeClass("aok-hidden")},error:function(){f("#wr-modal-add-to-reg-item-added-error-"+d.recItemAsin).removeClass("aok-hidden"); "undefined"!==typeof g.ue&&g.ue.count("wrAddToRegModalAddFromSimilaritiesError",(g.ue.count("wrAddToRegModalAddFromSimilaritiesError")||0)+1)}})),"undefined"!==typeof g.ue&&g.ue.count("wrAddToRegModalAddFromSimilarities",(g.ue.count("wrAddToRegModalAddFromSimilarities")||0)+1))});c.on("a:popover:beforeHide:wr-modal-add-to-reg-wedding-registry",function(){"undefined"!==typeof g.ue&&g.ue.count("wrAddToRegModalDismissed",(g.ue.count("wrAddToRegModalDismissed")||0)+1)});c.declarative("wr-modal-add-to-reg-view-registry-action", "click",function(c){"undefined"!==typeof g.ue&&g.ue.count("wrAddToRegModalViewRegistry",(g.ue.count("wrAddToRegModalViewRegistry")||0)+1);g.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";var B="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};n.when("A","a-button","a-modal","a-dropdown","a-splitdropdown", "dpx-gift-tag-modal","add-to-br-util","ready").register("ggr-add-to-registry-desktop-util",function(c,G,p,f,e,r,H){function d(){l.ajax({dataType:"json",url:"/registries/dpx/desktop/list-registry?"+l.param({asin:encodeURIComponent(l("#ASIN").val())}),cache:!1}).done(function(a){b(a)}).fail(y)}function v(){null==n?l.ajax({dataType:"json",url:"/registries/dpx/desktop/list-registry?"+l.param({asin:encodeURIComponent(l("#ASIN").val())}),cache:!1}).done(function(a){n=a;b(a)}).fail(y):b(n)}function K(){var a= f.getSelect(h.registryDropdownId).getOptions().options.elements;l.each(a,function(a,b){f.getSelect(h.registryDropdownId).removeOption(b)})}function A(){var a=e.getSelect(u.oneClickSplitDropdown),b=a.getOptions().options.elements;l.each(b,function(b,c){a.removeOption(c)})}function b(a){a=z(a);if(null===a)y();else{if(h.showOneClickSplitDropdown)return A(),L({html_content:document.getElementById(h.registryDropdownCreateRegistryTemplateId).innerHTML,css_class:t.registryDropdownItemWrapper,native_id:C.newRegistryType, value:JSON.stringify({regType:C.newRegistryType})}),L({html_content:x(a[0]),text:q(a[0].name),value:JSON.stringify({regType:a[0].type,regName:a[0].name,regId:a[0].id}),css_class:t.registryDropdownItemWrapper}),e.getSelect(u.oneClickSplitDropdown).getOption("defaultSpinner").remove(),null!=document.getElementById(D.splitDropdownAnnounce)&&"true"===document.getElementById(D.splitDropdownAnnounce).getAttribute(C.ariaPressedProperty)&&document.getElementById(D.splitDropdownAnnounce).click(),e.getSelect(u.oneClickSplitDropdown).setValue(""), !1;K();k({html_content:document.getElementById(h.registryDropdownCreateRegistryTemplateId).innerHTML,css_class:t.registryDropdownItemWrapper,native_id:C.newRegistryType,value:JSON.stringify({regType:C.newRegistryType})});var b=[];h.babyEnabled||b.push(F.BABY);h.weddingEnabled||b.push(F.WEDDING);h.ggrEnabled||b.push(F.BIRTHDAY,F.CUSTOM,F.HOLIDAY,F.PET,F.GRADUATION,F.HOUSE_WARMING);l.each(a,function(a,c){b.includes((c.type||"").toLowerCase())||k({html_content:x(c),text:q(c.name),value:JSON.stringify({regType:c.type, regName:c.name,regId:c.id}),css_class:t.registryDropdownItemWrapper})});l(l(u.registryDropdownSpinnerId)).addClass("aok-hidden");f.getSelect(u.registryDropdownId).getOption("defaultSpinner").remove();l(u.registryDropdownId)[0].click()}}function z(a){var b=void 0;if("object"===("undefined"===typeof a?"undefined":B(a)))b=a.result;else try{b=c.parseJSON(a)}catch(d){b=null}return l.isArray(b)?b:null}function x(a){var b=document.getElementById(h.registryDropdownItemTemplateId).innerHTML,b=b.replace("{imgTag}", C.imgTag),c={registryType:a.typeText,registryName:a.name,imgUrl:a.imageUrl};return b.replace(/\{([\w]*)\}/g,function(b,d){b=c[d];if("undefined"!==typeof b&&null!==b)a=b;else return"";return a})}function y(){l(u.registryDropdownSpinnerId).addClass("aok-hidden");w(u.registryDropdownErrorBoxId)}function w(a){l(a).removeClass("aok-hidden")}function m(b){var c=l("#quantity").val()||1,d=JSON.parse(b.value);if(d.regId||d.regType){b=d.regType;var k=d.regId,e=d.regName,d=encodeURIComponent(l("#ASIN").val()), c=encodeURIComponent(c),f=encodeURIComponent(h.sessionId);E(J.dropdownItemClicked+":"+b.toLowerCase());b===C.newRegistryType?g.location.href="/registries?ref\x3ddpx_create_registry_desktop\x26sessionId\x3d"+f:"Wedding"===b?(e={name:D.popoverModalName,header:!0===u.internationalGiftTaggingEnabled?C.addToRegistryModalHeaderText:h.weddingModalHeader,url:""},(f=p.get(e.name))||(f=p.create(l("#GR-DROPDOWN-MODAL-TRIGGER"),e)),f.update(a(b,e.header,k,d,c,h.token)).show()):"Baby"===b?H.addToBabyRegistryFromDPX(C.addToBabyRegistryVendorId): (f={name:D.popoverModalName,header:{Birthday:h.birthdayModalHeader,Custom:h.customModalHeader,Holiday:h.holidayModalHeader,Pet:h.petModalHeader}[b],url:""},!0===u.internationalGiftTaggingEnabled?r.renderDPXGiftTagModal(b,k,e,d,c,h.token,u.internationalGiftTaggingEnabled):(g.ue&&ue.trigger("HIT_GGR_PETS_DPX_GIFT_TAGS_636549",u.cglBglPetsGiftTagEnabled?"T1":"C"),"Custom"!==b&&"Birthday"!==b&&"Pet"!==b||u.cglBglPetsGiftTagEnabled?r.renderDPXGiftTagModal(b,k,e,d,c,h.token,u.internationalGiftTaggingEnabled): ((e=p.get(f.name))||(e=p.create(l("#GR-DROPDOWN-MODAL-TRIGGER"),f)),e.update(a(b,f.header,k,d,c,h.token)).show())))}}function a(a,b,c,d,e,k){var f="Wedding"===a?a:"GGR";a={Wedding:"/wedding/modal/external-add-to-registry",GGR:"/registries/dpx-add-to-registry/"+a.toLowerCase()+"/"+c};k=k?"\x26token\x3d"+encodeURIComponent(k):"";d=a[f]+"?asin\x3d"+d+"\x26quantity\x3d"+e+k+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop";"Wedding"===f?d+="\x26sourceVendorId\x3damazon.wedding_registry.add.dpx.desktop":"GGR"===f&&(d+= "\x26sourceid\x3damazon.ggr.add.dpx.desktop");return{header:b,cache:!1,url:d}}function q(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value}function E(a){a=J.deviceType+":"+a;g.ue&&g.ue.count(a,(g.ue.count(a)||0)+1)}function k(a){f.getSelect(h.registryDropdownId).addOption(a)}function L(a){e.getSelect(h.oneClickDropdownSubmitId).addOption(a)}function I(){h.showOneClickSplitDropdown?c.delay(v,0):c.delay(d,0);E(J.dropdownClicked);return!1}function M(){h.showOneClickSplitDropdown? (null!=document.getElementById(D.splitDropdownAnnounce)&&"true"===document.getElementById(D.splitDropdownAnnounce).getAttribute(C.ariaPressedProperty)&&I(),I()):(null!=document.getElementById(h.registryDropdownId)&&"true"===document.getElementById(h.registryDropdownId).getAttribute(C.ariaPressedProperty)&&I(),l(u.registryDropdownId).unbind("click").one("click",function(){I()}))}var l=c.$,h=c.state("modal-add-to-registry-dropdown-state"),n=null;if(h){var J={deviceType:"desktop",dropdownClicked:"dpx-ggr-dropdown-clicked", dropdownItemClicked:"dpx-ggr-dropdown-item-clicked",similarityClicked:"dpx-ggr-dropdown-similarity-clicked"},t={registryDropdownItemWrapper:"agr-add-to-registry-dropdown-item-wrapper"},u={registryDropdownId:"#"+h.registryDropdownId,registryDropdownErrorBoxId:"#"+h.registryDropdownErrorBoxId,registryDropdownSpinnerId:"#"+h.registryDropdownSpinnerId,oneClickSplitDropdownAnnounce:"#add-to-registry-one-click-dropdown-announce",oneClickSplitDropdown:"#"+h.oneClickDropdownSubmitId,internationalGiftTaggingEnabled:h.internationalGiftTaggingEnabled, cglBglPetsGiftTagEnabled:h.cglBglPetsGiftTagEnabled},D={addToRegistrySuccessClass:".gr-add-success-message",addToRegistryErrorClass:".gr-add-error-message",addToRegistryDuplicateClass:".gr-already-exist-message",popoverModalName:"wr-modal-add-to-reg-wedding-registry",splitDropdownAnnounce:"add-to-registry-one-click-dropdown-announce"},C={newRegistryType:"new",imgTag:'\x3cimg src\x3d"{imgUrl}" alt\x3d"{registryName}" class\x3d"agr-add-to-registry-dropdown-registry-icon" /\x3e',ariaPressedProperty:"aria-pressed", addToBabyRegistryVendorId:"amazon.ggr.baby.add.dpx.desktop",addToRegistryModalHeaderText:h.addToRegistryModalHeaderText},F={BABY:"baby",WEDDING:"wedding",BIRTHDAY:"birthday",CUSTOM:"custom",HOLIDAY:"holiday",GRADUATION:"graduation",PET:"pet",HOUSE_WARMING:"house_warming"};c.on("a:dropdown:"+h.registryDropdownId+":select",function(a){m(a);f.getSelect(h.registryDropdownId).setValue("")});c.on("a:splitdropdown:"+h.oneClickDropdownSubmitId+":select",function(a){m(a)});l(document).delegate(".gr-modal-add-to-reg-rec-add-to-registry-action", "click",function(a){var b=l(a.currentTarget);a=b.attr("data-asin");var d=G("#gr-modal-add-to-reg-add-to-wr-"+a);if(d.isEnabled()){d.disable();if(!0===b.data("exist"))d.hide(),w(b.find(D.addToRegistryDuplicateClass));else{var e=void 0,k=void 0,e=b.data("type"),k=l("#gr-modal-add-to-reg-wrapper").data("token");e&&"Wedding"!==e?(e={asin:a,desiredQuantity:1,registryId:b.data("id"),registryType:b.data("type"),itemType:"AMAZON_ITEM",vendorId:"amazon.ggr.add.dpx.desktop",token:k},k="/registries/registry-products/addProduct"): (e={token:k,items:JSON.stringify([{asin:a,requestedQuantity:1}])},k="/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa");c.post(k,{params:e,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(a){d.hide();a.success?w(b.find(D.addToRegistrySuccessClass)):"ITEM_ALREADY_EXIST"===a.errorCode&&w(b.find(D.addToRegistryDuplicateClass))},error:function(){d.hide();w(b.find(D.addToRegistryErrorClass))}})}E(J.similarityClicked)}});M();c.on("a:pageUpdate",function(){M()}); c.declarative("gr-modal-add-to-reg-view-registry-action","click",function(a){g.location.href=a.data&&a.data.type&&a.data.id?"/registries/"+a.data.type.toLowerCase()+"/owner-view?registryId\x3d"+a.data.id+"\x26ref_\x3dhit_gr_from_dpx":"/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"});c.declarative("wr-modal-add-to-reg-view-registry-action","click",function(a){g.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";n.when("A","a-modal","a-button","a-alert", "message-render","create-gift-tag-modal","ready").register("dpx-gift-tag-modal",function(c,g,p,f,e,r){var n,d,v,t,A,b;function z(){m(q.giftTagErrorBoxId).removeClass("aok-hidden")}function x(b){m(a.tagListWrapper).html("");m(a.tagListWrapper).html(b)}function y(a,b,c,d,e,g,f,q){a="/registries/dpx-add-to-registry/"+a.toLowerCase()+"/"+c;q=q?"\x26token\x3d"+encodeURIComponent(q):"";d=a+"?asin\x3d"+g+"\x26quantity\x3d"+f+"\x26tagId\x3d"+d+"\x26tagName\x3d"+encodeURIComponent(e)+q+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop"; return{header:b,cache:!1,url:d+"\x26sourceid\x3damazon.ggr.add.dpx.desktop"}}function w(c,f,q,p,l,h,r){n=c;d=f;v=p;t=l;A=h;b=r;f=!0===b?E.addToGiftListModalHeaderText:E.hglGiftTagHeader+" "+q;c=g.get("dpxTagModal");c||(c=a.tagModalTrigger,f={name:"dpxTagModal",width:800,cache:!1,header:f,inlineContent:m(a.tagModalContent)},c=g.create(c,f));f=n;q=d;f&&q?m.ajax({url:"/registries/"+f+"/"+q+"/dpx-get-registry-tags",timeout:5E3}).done(x).fail(z):e.showChangeOver(a.tagModalChangeover,void 0);c.show()}var m= c.$;if(c=c.state("modal-view-gift-tags-state")){b=A=t=v=d=n="";var a={tagModalTrigger:".gr-dpx-tag-modal-trigger",tagModalContent:".gr-dpx-tag-modal",tagTextContent:"#gr-tag-modal-name-input",tagListContainer:".gr-dpx-tag-modal-your-tags-container",tooManyTagsAlert:"#gr-tag-modal-too-many-tags-alert",invalidInputAlert:"#gr-tag-modal-invalid-input-alert",hiddenClass:"aok-hidden",tagListWrapper:".gr-dpx-tag-modal-taglist-wrapper",tagModalChangeover:"#tagModalChangeover",tagHeading:".gr-tag-modal-your-tags-header", closeButton:".gr-tag-modal-back-button",saveButton:".gr-dpx-tag-modal-save-wrapper"},q={registryTitleComponent:".gr-dpx-tag-modal-header-main",giftTagErrorBoxId:"#"+c.giftTagErrorBoxId,popoverModalName:"wr-modal-add-to-reg-wedding-registry"},E={hglGiftTagHeader:c.giftTagModalHeaderText,holidayModalHeader:c.addToHGLModalHeaderText,addToGiftListModalHeaderText:c.addToGiftListModalHeaderText};m(document).delegate(".gr-dpx-add-new-tag","click",function(a){r.renderCreateTagModal(n,d)});m(document).delegate(".gr-tag-modal-back-button", "click",function(a){(a=g.get("dpxTagModal"))&&a.show()});m(document).delegate(".gr-dpx-tag-modal-your-tags-wrapper","click",function(a){a=m(this).attr("tagid");var c=m(this).text(),e={name:q.popoverModalName,header:!0===b?E.addToGiftListModalHeaderText:E.holidayModalHeader,url:""},f=g.get(e.name);f||(f=g.create(m("#GR-DROPDOWN-MODAL-TRIGGER"),e));f.update(y(n,e.header,d,a,c,v,t,A)).show()});return{renderDPXGiftTagModal:w}}});"use strict";n.when("A","a-modal","a-button","a-alert","message-render", "ready").register("create-gift-tag-modal",function(c,g,p,f,e){function r(a,e){c.get("/registries/"+a+"/"+e+"/dpx-get-registry-tags",{cache:!1,success:function(a){d(b.renderModalTagListWrapper).html("");d(b.renderModalTagListWrapper).html(a)},error:function(){y(z.ADD_TAG_FAILURE)}})}function n(a,c){B=a;v=c;var e=g.get("tagModal");if(!e)var e=b.tagModalTrigger,f={name:"tagModal",width:800,cache:!1,hideHeader:!0,inlineContent:d(b.tagModalContent)},e=g.create(e,f);w({updateType:x.render,token:A},a,c); m();e.show()}var d=c.$,v="",B="",A=c.state("modal-add-to-registry-dropdown-state")?c.state("modal-add-to-registry-dropdown-state").token:t,b={tagModalTrigger:".gr-tag-modal-trigger",tagModalContent:".gr-tag-modal-container",tagModalMainContent:".gr-tag-modal",tagModalDeleteContent:".gr-tag-modal-delete-flow",tagTextContent:"#gr-tag-modal-name-input",tagListContainer:".gr-tag-modal-your-tags-container",tooManyTagsAlert:"#gr-tag-modal-too-many-tags-alert",invalidInputAlert:"#gr-tag-modal-invalid-input-alert", hiddenClass:"aok-hidden",tagListWrapper:".gr-tag-modal-taglist-wrapper",tagModalChangeover:"#tagModalChangeover",deleteFlowReplacementSelector:".gr-tag-modal-delete-this-tag",deleteFlowButtonReplacementSelector:".gr-tag-modal-delete-this-button",deleteFlowDeleteButton:".gr-tag-modal-delete-confirm",onOwnerViewSelector:".gr-tag-summary-container-owner",productListExpander:".gr-product-list-expander",productListExpanderSection:"gr-product-list-expander-section",tagSectionTemplate:"#gr-product-list-section-template", tagIdFinderSelector:".gr-tag-modal-your-tags-tag",renderModalTagListWrapper:".gr-dpx-tag-modal-taglist-wrapper"},z={ADD_TAG_SUCCESS:"ADD_TAG_SUCCESS",REMOVE_TAG_SUCCESS:"REMOVE_TAG_SUCCESS",ADD_TAG_FAILURE:"ADD_TAG_FAILURE",REMOVE_TAG_FAILURE:"REMOVE_TAG_FAILURE"},x={add:"add",remove:"remove",render:"render"},y=function(a){var d="";"ADD_TAG_SUCCESS"===a?d=c.state("tagModalChangeoverStrings").addSuccess:"REMOVE_TAG_SUCCESS"===a?d=c.state("tagModalChangeoverStrings").removeSuccess:"ADD_TAG_FAILURE"=== a?d=c.state("tagModalChangeoverStrings").addFailure:"REMOVE_TAG_FAILURE"===a&&(d=c.state("tagModalChangeoverStrings").removeFailure);e.showChangeOver(b.tagModalChangeover,d)},w=function(a,e,f,g,p){e&&f?(a.ref_="gr-dpx-modal",c.post("/registries/"+e+"/"+f+"/update-tag",{params:a,timeout:5E3,cache:!1,success:function(c){g&&y(g);if(a.updateType===x.remove)r(e,f),n(e,f);else if(d(b.tagListWrapper).html(c),a.updateType===x.add){r(e,f);var p=a.tagName,l=d(d(b.tagSectionTemplate).html()).clone();c=d(c).find(b.tagIdFinderSelector).last().attr("id"); l.attr("data-section-id",c);l.find(".gr-product-list-expander-section-name").text(p);d(b.productListExpander).append(l)}},error:function(){y(p)}})):y(p)},m=function(){d(b.tooManyTagsAlert).hasClass(b.hiddenClass)||d(b.tooManyTagsAlert).addClass(b.hiddenClass);d(b.invalidInputAlert).hasClass(b.hiddenClass)||d(b.invalidInputAlert).addClass(b.hiddenClass);d(b.tagModalMainContent).hasClass(b.hiddenClass)&&d(b.tagModalMainContent).removeClass(b.hiddenClass);d(b.tagModalDeleteContent).hasClass(b.hiddenClass)|| d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagTextContent).val()&&d(b.tagTextContent).val("");e.closeChangeOver(b.tagModalChangeover)};d(document).delegate(".gr-tag-modal-create-button","click",function(a){a.preventDefault();a=d(b.tagTextContent).val();m();15<=d(b.tagListContainer).children().length?d(b.tooManyTagsAlert).removeClass(b.hiddenClass):a?w({updateType:x.add,tagName:a,token:A},B,v,z.ADD_TAG_SUCCESS,z.ADD_TAG_FAILURE):d(b.invalidInputAlert).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-your-tags-tag", "click",function(a){a.preventDefault();a=d(this).attr("id");var c=d(this).text();d(b.deleteFlowDeleteButton).attr("id",a);d(b.deleteFlowReplacementSelector).text(c);d(b.deleteFlowButtonReplacementSelector).text(c);d(b.tagModalMainContent).addClass(b.hiddenClass);d(b.tagModalDeleteContent).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-delete-go-back","click",function(a){a.preventDefault();d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagModalMainContent).removeClass(b.hiddenClass)}); d(document).delegate(".gr-tag-modal-delete-confirm","click",function(a){a.preventDefault();a=d(this).attr("id");w({updateType:x.remove,tagId:a,token:A},B,v,z.REMOVE_TAG_SUCCESS,z.REMOVE_TAG_FAILURE);d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagModalMainContent).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-back-button","click",function(a){a.preventDefault();if(a=g.get("tagModal"))m(),a.hide()});return{renderCreateTagModal:n}});"use strict";n.when("A","ready").register("message-render", function(c){var g=c.$;return{showChangeOver:function(c,f,e){c=g(c);c.stop(!0,!0);c.find("strong").text(f);c.is(":visible")||c.fadeIn(400);c.delay(2E3).fadeOut(800,function(){e&&e()})},closeChangeOver:function(c){g(c).hide()}}})}); /* ******** */ (function(f){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,b=n?n("GoldboxUDPAssets",""):h;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,h,n){f.when("A").execute("dealsx-constants",function(b){h.DealsX||(h.DealsX={});DealsX.constants={AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR:"deal.claim.quantity-restriction-violation.error/v1",AAPI_V1_ERROR_TYPE:"error/v1"};DealsX.CustomerStates={NONE:"NONE",IN_CART:"IN_CART",PENDING_ADD_TO_CART:"PENDING_ADD_TO_CART", CLAIMED:"CLAIMED",EXPIRED:"EXPIRED",UNKNOWN:"UNKNOWN"};DealsX.DealStates={AVAILABLE:"AVAILABLE",UPCOMING:"UPCOMING",WAITLISTFULL:"WAITLISTFULL",UNKNOWN:"UNKNOWN"};DealsX.Events={DEAL_TIMER_EXPIRED:"dealsx:gsod:buybox:deal-timer-expired"};DealsX.ApiNames={CLAIM_AND_ADD_TO_CART:"ClaimAndAddToCart",CART_COUNT:"CartCount",CART_ADD_ITEMS:"CartAddToCart"};DealsX.RenderingPlatform={MOBILE_WEB:"MOBILE_WEB",SHOPPING_APP:"SHOPPING_APP",DESKTOP:"DESKTOP"};DealsX.AppAccessRenderingComponent={APP_DOWNLOAD_BUTTON:"APP_DOWNLOAD_BUTTON", LEARN_MORE_MESSAGE:"LEARN_MORE_MESSAGE",NOTHING:"NOTHING"};DealsX.DeviceAttributes={SHOPPING_APP:"APP,APP_MASH",MOBILE_WEB:"MOBILE",DESKTOP:"DESKTOP"}});f.when("A").execute("dealsx-timer-ticker",function(b){b.interval(function(){b.trigger("dealsx-timer-tick")},1E3)});f.when("A").register("dealsx-productv2-service",function(b){return b.createClass({endpointUrl:null,offerListingID:null,headers:null,_request:null,setup:function(b){this.abortRequest();this.endpointUrl=b.aapiEndpoint;this.offerListingId= b.offerListingId;this.headers=this.getHeaders(b)},callProductV2:function(c,a,d){var e=this;e._request=b.$.ajax({url:this.endpointUrl+"?buyingOptionTypes\x3dLIGHTNING_DEAL\x26offerListingId\x3d"+this.offerListingId,type:"GET",headers:this.headers,xhrFields:{withCredentials:!0},success:c,error:a,complete:function(){e._request=null;d&&d()}})},abortRequest:function(){this._request&&this._request.abort()},getDeviceAttributes:function(b){return b.app?DealsX.DeviceAttributes.SHOPPING_APP:b.mobile?DealsX.DeviceAttributes.MOBILE_WEB: DealsX.DeviceAttributes.DESKTOP},getHeaders:function(b){var a={"Accept-Language":b.languageOfPreference,Accept:'application/vnd.com.amazon.api+json; type\x3d"product/v2"; expand\x3d"buyingOptions[].dealDetails(product.deal-details/v1),buyingOptions[].callToAction(product.call-to-action/v1),buyingOptions[].dealCustomerStatus(product.deal-customer-status/v1)"',"x-api-csrf-token":b.aapiCsrfToken,"x-amzn-device-attributes":this.getDeviceAttributes(b)};b.slateToken&&(a["x-amzn-encrypted-slate-token"]= b.slateToken);return a}})});f.when("A","dealsx-productv2-service").register("dealsx-poller-service",function(b,c){return b.createClass({statusCallbackHandler:null,productV2Service:null,pollingIntervalMs:null,continuePolling:!0,init:function(){this.productV2Service=new c},setup:function(a){this.productV2Service.setup(a);this.pollingIntervalMs=a.pollingIntervalMs;this.continuePolling=!0},callProductV2:function(a,b){var d=this;d.productV2Service.callProductV2(function(b){d.provideBuyingOptionToSuccessCallback(b, a)},b)},connect:function(a,d,e){var g=this,c=function(){g.productV2Service.callProductV2(function(b){g.provideBuyingOptionToSuccessCallback(b,a)},function(a){d&&d(a)},function(){e&&e();g.continuePolling&&(g.statusCallbackHandler=b.delay(c,g.pollingIntervalMs))})};c()},disconnect:function(){this.continuePolling=!1;null!==this.statusCallbackHandler&&(clearTimeout(this.statusCallbackHandler),this.statusCallbackHandler=null)},provideBuyingOptionToSuccessCallback:function(a,b){a=this.extractLightningDealBuyingOption(a); b&&b(a)},extractLightningDealBuyingOption:function(a){if(a&&a.entity&&a.entity.buyingOptions)for(var b=0;b<a.entity.buyingOptions.length;b++){var e=a.entity.buyingOptions[b];if("LIGHTNING_DEAL"===e.type)return e}return null}})});f.when("A","dealsx-model","dealsx-deal-redemption-service","dealsx-redemption-view","dealsx-quantity-view","dealsx-progress-view","dealsx-timer-view","dealsx-header-view","dealsx-prime-access-view","dealsx-app-access-view","dealsx-cart-aapi-service","dealsx-warranty-view").register("dealsx-deal-controller", function(b,c,a,d,e,g,m,k,l,h,p,q){return b.createClass({dealPollerController:null,dealRedemptionService:null,views:[],headerView:null,redemptionView:null,quantityView:null,timerView:null,primeAccessView:null,appAccessView:null,warrantyView:null,dealModel:null,buying:!1,cartAAPIService:null,init:function(a){},getSlateToken:function(){var a=b.$('meta[name\x3d"encrypted-slate-token"]');if(a.length&&a.attr("content"))return a.attr("content");DealsX.recordAPIMetrics({apiName:"getSlateToken",isSuccess:!1})}, setup:function(b){if(b){b.slateToken=this.getSlateToken();var d=b.systemTime?Date.now()-b.systemTime:0;this.dealModel=new c({setupData:b,clockOffset:d});this.setupDealPollerController(b);this.dealRedemptionService=new a(b);this.cartAAPIService=new p(b);this.setupBuyboxViews(b);this.onModelUpdate(this.dealModel);this.subscribeToAccordionEvents()}else f.log("No setupData passed for setup method of deal controller","ERROR","DealController")},setupDealPollerController:function(a){var d=this;f.when("dealsx-poller-service").execute(function(e){d.dealPollerController? d.dealPollerController.disconnect():d.dealPollerController=new e;d.dealPollerController.setup(a);d.dealPollerController.connect(function(a){a?(d.dealModel.updateDealModelContent(a),d.onModelUpdate(d.dealModel)):d.headerView&&(d.dealPollerController.disconnect(),d.headerView.showDealUnavailableView())});b.off(DealsX.Events.DEAL_TIMER_EXPIRED);b.on(DealsX.Events.DEAL_TIMER_EXPIRED,function(){d.dealPollerController.callProductV2(function(a){a?(d.redemptionView.hideProcessingView(),d.dealModel.updateDealModelContent(a), d.onModelUpdate(d.dealModel)):d.headerView&&(d.dealPollerController.disconnect(),d.headerView.showDealUnavailableView())})})})},setupBuyboxViews:function(a){var c=this,f=b.$("#dealsAccordionRow");f=0<f.length?f:b.$("#dealsx-single-offer-display-box");c.primeAccessView=l.getView({rootContainer:f,dealModel:c.dealModel});c.redemptionView=d.getView({rootContainer:f,setupData:a});c.appAccessView=h.getView({rootContainer:f,dealModel:c.dealModel,setupData:a});c.timerView=m.getView({rootContainer:f,clockOffset:c.dealModel.clockOffset, startTime:c.dealModel.dealDetails.startTime,endTime:c.dealModel.dealDetails.endTime});c.redemptionView.initializeButtons(function(a){if(a){var d=c.quantityView.getQuantity();c.buying=!0;c.dealRedemptionService.claimDeal(a.dealId,a.itemId,a.purchaseReferenceTag,d,function(a,d){a&&(a&&a.dealAsinState&&a.customerState&&(c.dealModel.translateClaimDealResponse({customerState:a.customerState,itemState:a.dealAsinState,msToCustomerStateExpiry:a.msUntilExpiration}),c.buying=!1),c.redemptionView.hideProcessingView(), c.updateNavigationCartQuantity(),c.onModelUpdate(c.dealModel),b.trigger("deals_claimDealSuccess"))},function(a,d){c.redemptionView.hideProcessingView();d===DealsX.constants.AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR?(c.dealModel.canCustomerClaimPrimeOnlyDOTD=!1,c.redemptionView.showPodotdQuantityLimitExceeded()):c.redemptionView.showRedemptionFailed();b.trigger("deals_claimDealError")})}});c.quantityView=e.getView({rootContainer:f,setupData:a});c.headerView=k.getView({rootContainer:f});c.progressView= g.getView({rootContainer:f});c.warrantyView=q.getView({rootContainer:f});c.addView(c.headerView);c.addView(c.progressView);c.addView(c.primeAccessView);c.addView(c.quantityView);c.addView(c.timerView);c.addView(c.redemptionView);c.addView(c.appAccessView);c.addView(c.warrantyView)},onModelUpdate:function(a){this.buying||this.views.forEach(function(b){return b.onModelUpdate(a)})},updateNavigationCartQuantity:function(){var a=this;a.cartAAPIService.getCount(function(b,d){(b=a.retrieveQuantity(b))&& a.displayQuantity(b)},function(a){})},retrieveQuantity:function(a){return a&&a.entity?a.entity.items:null},displayQuantity:function(a){f.when("nav.setCartCount").execute(function(b){b(a)});f.when("mash").execute(function(b){b.cart.didUpdate({newCartQuantity:parseInt(a,10)})})},addView:function(a){null!==a&&this.views.push(a)},subscribeToAccordionEvents:function(){b.on("a:accordion:buybox-accordion:select",function(a){a&&a.selectedRow&&("dealsAccordionRow"===a.selectedRow.rowName?b.trigger("deals_onSelectLDBuybox"): b.trigger("deals_onSelectRegularBuybox"))})},addItemsToCart:function(a,b){var d=this;d.cartAAPIService.addItems(a,b,function(a,b){a&&"cart.add-items/v1"===a.type&&(a=a.entity.count.entity.items)&&d.displayQuantity(a)},function(a){})}})});f.when("A").register("dealsx-model",function(b){var c=b.$;return b.createClass({callToAction:null,dealDetails:null,dealCustomerStatus:null,deviceType:null,canCustomerClaimPrimeOnlyDOTD:!0,hasPrimeSavingsBenefit:!1,clockOffset:0,init:function(a){if(a&&a.setupData){var b= a.setupData.itemCustomerState;b&&(b.dealDetails&&(this.dealDetails=JSON.parse(b.dealDetails)),b.dealCustomerStatus&&(this.dealCustomerStatus=JSON.parse(b.dealCustomerStatus)),b.callToAction&&(this.callToAction=JSON.parse(b.callToAction)));this.hasPrimeSavingsBenefit=a.setupData.hasPrimeSavingsBenefit||!1;this.clockOffset=a.clockOffset;this.deviceType={isMobile:a.setupData.mobile,isApp:a.setupData.app}}},updateDealModelContent:function(a){this.callToAction=a.callToAction?a.callToAction.entity:null; this.dealDetails=a.dealDetails?a.dealDetails.entity:null;this.dealCustomerStatus=a.dealCustomerStatus?a.dealCustomerStatus.entity:null},translateClaimDealResponse:function(a){a&&(c.extend(this.dealDetails,this.buildDealState(a)),c.extend(this.dealCustomerStatus,this.buildDealCustomerState(a)),this.isCustomerStateIsEqualTo("IN_CART")&&(this.callToAction={}))},buildDealCustomerState:function(a){if(!a.customerState)return{};var b=new Date((new Date).getTime()+parseInt(a.msToCustomerStateExpiry));return{state:this.convertClaimDealCustomerStateToProductV2CompatibleCustomerState(a.customerState), expiryTime:b.toISOString()}},buildDealState:function(a){return{state:this.convertClaimDealDealStateToProductV2CompatibleDealState(a)}},isCustomerStateInCart:function(){return this.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)},isCustomerStatePendingATC:function(){return this.isCustomerStateIsEqualTo(DealsX.CustomerStates.PENDING_ADD_TO_CART)},isDealStateIsEqualTo:function(a){return this.dealDetails?this.dealDetails.state===a:!1},isCustomerStateIsEqualTo:function(a){return this.dealCustomerStatus? this.dealCustomerStatus.state===a:!1},getCurrentServerTime:function(){return new Date(Date.now()-this.clockOffset)},isDealInPrimeEarlyAccessWindowForPrimeCustomer:function(){if(!this.dealDetails||!this.dealDetails.startTime||null===this.dealDetails.earlyAccessDurationInMilliseconds)return!1;var a=this.getCurrentServerTime(),b=Date.parse(this.dealDetails.startTime),c=b+this.dealDetails.earlyAccessDurationInMilliseconds;a=b<=a&&a<c;return this.isDealPrimeEarlyAccess()&&a},isDealInPrimeEarlyAccessWindowForNonPrimeCustomer:function(){if(!this.dealDetails|| !this.dealDetails.startTime||null===this.dealDetails.earlyAccessDurationInMilliseconds)return!1;var a=this.getCurrentServerTime(),b=Date.parse(this.dealDetails.startTime);a=b-this.dealDetails.earlyAccessDurationInMilliseconds<=a&&a<b;return this.isDealPrimeEarlyAccess()&&a},isDealInPrimeEarlyAccessWindow:function(){return this.hasPrimeSavingsBenefit?this.isDealInPrimeEarlyAccessWindowForPrimeCustomer():this.isDealInPrimeEarlyAccessWindowForNonPrimeCustomer()},isDealPrimeEarlyAccess:function(){return this.dealDetails&& "PRIME_EARLY_ACCESS"===this.dealDetails.accessBehavior},isDealAppOnly:function(){return this.dealDetails&&"APP_ONLY_LD"===this.dealDetails.accessBehavior},isDealPrimeOnly:function(){return this.dealDetails&&"PRIME_ONLY"===this.dealDetails.accessBehavior},isDealPrimeOnlyDotd:function(){return this.isDealPrimeOnly()&&"DEAL_OF_THE_DAY"===this.dealDetails.type},isDealAccessibleToCustomer:function(){return this.hasPrimeSavingsBenefit||!this.isDealInPrimeEarlyAccessWindowForNonPrimeCustomer()&&!this.isDealPrimeOnly()}, getCustomerStateExpiryTime:function(){return this.dealCustomerStatus?this.dealCustomerStatus.expiryTime:null},convertClaimDealCustomerStateToProductV2CompatibleCustomerState:function(a){switch(a){case "NONE":return DealsX.CustomerStates.NONE;case "INCART":return DealsX.CustomerStates.IN_CART;case "PENDINGATC":return DealsX.CustomerStates.PENDING_ADD_TO_CART;case "CLAIMED":return DealsX.CustomerStates.CLAIMED;case "EXPIRED":return DealsX.CustomerStates.EXPIRED;default:return DealsX.CustomerStates.UNKNOWN}}, convertClaimDealDealStateToProductV2CompatibleDealState:function(a){switch(a){case "AVAILABLE":return DealsX.DealStates.AVAILABLE;case "UPCOMING":return DealsX.DealStates.UPCOMING;case "WAITLISTFULL":return DealsX.DealStates.WAITLISTFULL;default:return DealsX.DealStates.UNKNOWN}},getRenderingPlatform:function(){return this.deviceType.isApp?DealsX.RenderingPlatform.SHOPPING_APP:this.deviceType.isMobile?DealsX.RenderingPlatform.MOBILE_WEB:DealsX.RenderingPlatform.DESKTOP}})});f.when("A").register("dealsx-prime-access-view", function(b){var c=b.createClass({primeAccessMessageView:null,init:function(a){this.primeAccessMessageView=a.rootContainer.find("#dealsx_prime_access_view")},onModelUpdate:function(a){a.isDealInPrimeEarlyAccessWindow()?b.show(this.primeAccessMessageView):b.hide(this.primeAccessMessageView)}});return{getView:function(a){return a.dealModel.isDealPrimeEarlyAccess()?new c(a):null}}});f.when("A").register("dealsx-app-access-view",function(b){var c=b.createClass({learnMoreMessage:null,appDownloadButton:null, addToCartButton:null,renderingPlatform:null,init:function(a){this.appDownloadButton=a.rootContainer.find("#app-download-button");this.learnMoreMessage=a.rootContainer.find("#app-only-deal-learn-more-message");this.addToCartButton=a.rootContainer.find("#dealsx_atc_btn");this.renderingPlatform=a.dealModel.getRenderingPlatform()},onModelUpdate:function(a){a=this.getRenderingComponent()[this.renderingPlatform](a);this.renderComponent(a)},renderComponent:function(a){switch(a){case DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON:b.show(this.appDownloadButton); b.hide(this.learnMoreMessage);b.hide(this.addToCartButton);break;case DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE:b.show(this.learnMoreMessage);b.hide(this.appDownloadButton);break;default:b.hide(this.appDownloadButton),b.hide(this.learnMoreMessage)}},getRenderingComponent:function(){return{SHOPPING_APP:function(){return DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE},MOBILE_WEB:function(a){return a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE: DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON},DESKTOP:function(a){return a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?DealsX.AppAccessRenderingComponent.NOTHING:DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON}}}});return{getView:function(a){return a.setupData.showAppOnlyDealCx?new c(a):null}}});f.when("A","dealsx-processing-view","dealsx-redemption-countdown-timer","a-button").register("dealsx-redemption-view",function(b,c,a,d){var e=b.createClass({addToCartButton:null, processingView:null,inCartView:null,inCartTimer:null,pendingAddToCartView:null,pendingAddToCartTimer:null,waitlistFullMessageView:null,itemQuantityView:null,podotdQuantityLimitMessageView:null,redemptionFailedMessageView:null,pushNotificationInfo:null,init:function(d){var e=d.rootContainer,g=this;g.processingView=c.getView(d);g.inCartView=e.find("#dealsx_incart");g.pendingAddToCartView=e.find("#dealsx_pending_atc");g.waitlistFullMessageView=e.find("#dealsx_waitlist_full_message");g.itemQuantityView= e.find("#dealsx_quantity_view");g.redemptionFailedMessageView=e.find("#dealsx_redemption_failed");g.podotdQuantityLimitMessageView=e.find("#dealsx_podotd_quantitylimit_message");g.inCartTimer=a.getView({timerView:e.find("#dealsx_checkout_timer"),onTimeoutCallback:function(){g.processingView.showClaimingProgress();b.hide(g.inCartView);b.delay(function(){b.trigger(DealsX.Events.DEAL_TIMER_EXPIRED)},1E3)}});this.pendingAddToCartTimer=a.getView({timerView:e.find("#dealsx_pending_atc_timer"),onTimeoutCallback:function(){b.hide(g.pendingAddToCartView)}})}, initializeButtons:function(a){var c=this;c.addToCartButton=d("#dealsx_atc_btn");c.addToCartButton.enable();b.declarative("dealsx-addtocart-button-action","click",function(b){b.data&&b.data.actionEnabled&&(delete b.data.actionEnabled,c.addToCartButton.hide(),c.processingView.showClaimingProgress(),a(b.data))})},onModelUpdate:function(a){var c=!0;a.dealCustomerStatus&&"IN_CART"===a.dealCustomerStatus.state?(this.inCartTimer.targetDate||(c=new Date(Date.parse(a.dealCustomerStatus.expiryTime)),this.inCartTimer.setTargetDate(c)), b.show(this.inCartView),c=!1):(this.inCartTimer.stop(),b.hide(this.inCartView));a.dealCustomerStatus&&"PENDING_ADD_TO_CART"===a.dealCustomerStatus.state?(b.show(this.pendingAddToCartView),this.pendingAddToCartTimer.targetDate||(c=new Date(Date.parse(a.dealCustomerStatus.expiryTime)),this.pendingAddToCartTimer.setTargetDate(c)),c=!0):(this.pendingAddToCartTimer.stop(),b.hide(this.pendingAddToCartView));a.dealDetails&&"WAITLISTFULL"===a.dealDetails.state&&a.isDealAccessibleToCustomer()?(b.show(this.waitlistFullMessageView), c=!1):b.hide(this.waitlistFullMessageView);a.callToAction&&a.callToAction.addToCart?this.addToCartButton.show():this.addToCartButton.hide();c?b.show(this.itemQuantityView):b.hide(this.itemQuantityView)},showRedemptionFailed:function(){b.show(this.redemptionFailedMessageView)},showPodotdQuantityLimitExceeded:function(){b.show(this.podotdQuantityLimitMessageView)},hideProcessingView:function(){this.processingView.hide()}});return{getView:function(a){return new e(a)}}});f.when("A").register("dealsx-redemption-countdown-timer", function(b){var c=b.createClass({targetDate:null,timerView:null,onTimeoutCallback:null,init:function(a){var c=this;c.timerView=a.timerView;c.targetDate=a.targetDate;c.onTimeoutCallback=a.onTimeoutCallback;b.on("dealsx-timer-tick",function(){c.render()})},setTargetDate:function(a){this.targetDate=a;this.render()},stop:function(){this.targetDate=null},render:function(){if(this.targetDate){var a=this.targetDate.getTime()-(new Date).getTime(),b=Math.floor(a/6E4%60);a=Math.floor(a/1E3%60);var c=b+":"+ ("0"+a).slice(-2);this.timerView&&this.timerView.html(c);if(0===b&&0==a){if(this.onTimeoutCallback)this.onTimeoutCallback();this.stop()}}}});return{getView:function(a){return new c(a)}}});f.when("A").register("dealsx-quantity-view",function(b){var c=b.createClass({quantity:1,init:function(a){this.subscribeToQuantityChangeEvents()},getQuantity:function(){return this.quantity},onModelUpdate:function(a){},subscribeToQuantityChangeEvents:function(){var a=this;b.on("a:dropdown:selected:dealx_quantity_dropdown", function(b){a.quantity=b.value})}});return{getView:function(a){return new c(a)}}});f.when("A").register("dealsx-processing-view",function(b){var c=b.createClass({processingView:null,processingMessage:null,init:function(a){this.processingView=a.rootContainer.find("#dealsx_processing_view");this.processingMessage=this.processingView.find("#dealsx_processing_msg")},hide:function(){b.hide(this.processingView);b.hide(this.processingMessage)},showClaimingProgress:function(){b.show(this.processingMessage); b.show(this.processingView)}});return{getView:function(a){return new c(a)}}});f.when("A","dealsx-timer-countdown").register("dealsx-timer-view",function(b,c){var a=b.$,d=b.createClass({startTimerView:null,endTimerView:null,clockOffset:0,startTime:null,endTime:null,init:function(a){this.clockOffset=a.clockOffset;this.startTime=Date.parse(a.startTime);this.endTime=Date.parse(a.endTime);var d=b.$(a.rootContainer);this.isDealStarted()||(this.startTimerView=c.getView({timerView:d.find("#dealsx-start-timer"), targetTime:Date.parse(a.startTime),clockOffset:a.clockOffset,onTimerExpired:this.onTimerExpired}));this.endTimerView=c.getView({timerView:d.find("#dealsx-end-timer"),targetTime:Date.parse(a.endTime),clockOffset:a.clockOffset,onTimerExpired:this.onTimerExpired})},onTimerExpired:function(){b.delay(function(){b.trigger(DealsX.Events.DEAL_TIMER_EXPIRED)},1E3)},onModelUpdate:function(b){b.dealDetails&&(b.isCustomerStateInCart()||b.isCustomerStatePendingATC()?this.endTimerView.hide():this.startTimerView? (a("#dealsx-start-timer").addClass("a-color-success"),this.isDealStarted()&&(this.startTimerView.hide(),this.endTimerView.show())):(this.endTimerView.show(),this.isDealEnding()&&a("#dealsx-end-timer").addClass("a-color-success")))},isDealStarted:function(){return Date.now()-this.clockOffset>this.startTime},isDealEnding:function(){var a=Date.now()-this.clockOffset;return 18E5>this.endTime-a}});return{getView:function(a){return new d(a)}}});f.when("A","dealsx-polyfills").register("dealsx-timer-countdown", function(b,c){c.padStart();var a=b.createClass({init:function(a){this.timerView=a.timerView;this.targetTime=a.targetTime;this.clockOffset=a.clockOffset;this.onTimerExpired=a.onTimerExpired;var c=this;b.on("dealsx-timer-tick",b.$.proxy(function(){c.countdown()},this))},countdown:function(){var a=Date.now()-this.clockOffset;a=(this.targetTime-a)/1E3|0;if(!(0>a))if(0===a)this.onTimerExpired();else{var b=Math.floor(a/86400),c=Math.floor(a/3600),f=Math.floor(a/60%60),k=Math.floor(a%60);a=this.timerView.find(".timer-days"); var l=this.timerView.find(".timer-precise");if(0<b)c=a.find(".singular"),f=a.find(".plural"),k=f.find(".value"),a.show(),l.hide(),1===b?(c.show(),f.hide()):(c.hide(),f.show(),k.text(b));else{b=l.find(".timer-hours \x3e .value");var h=l.find(".timer-minutes \x3e .value"),p=l.find(".timer-seconds \x3e .value");a.hide();l.show();b.text(c.toString().padStart(2,"0"));h.text(f.toString().padStart(2,"0"));p.text(k.toString().padStart(2,"0"))}}},hide:function(){b.hide(this.timerView)},show:function(){b.show(this.timerView)}}); return{getView:function(b){return new a(b)}}});f.when("A").register("dealsx-progress-view",function(b){var c=b.createClass({progressView:null,progressBarBase:null,progressBarTick:null,claimedMessage:null,init:function(a){a=a.rootContainer;this.progressView=a.find("#dealsx_progress_view");this.progressBarBase=a.find("#dealsx_progress_bar \x3e .progbar");this.progressBarTick=a.find("#dealsx_progress_bar \x3e .progbartick");this.claimedMessage=a.find("#dealsx_percent_message")},onModelUpdate:function(a){if(a.dealDetails&& null!=a.dealDetails.percentClaimed&&a.dealDetails.percentClaimedMessage){!a.dealCustomerStatus||"IN_CART"!==a.dealCustomerStatus.state&&"PENDING_ADD_TO_CART"!==a.dealCustomerStatus.state?b.show(this.progressView):b.hide(this.progressView);var c=a.dealDetails.percentClaimed;this.progressBarBase.css("width",c+"%");this.progressBarTick.css("width",c+"%");this.claimedMessage.text(a.dealDetails.percentClaimedMessage);89>=c?this.claimedMessage.removeClass("a-color-error").removeClass("a-color-success").addClass("a-color-base"): 99>=c?this.claimedMessage.removeClass("a-color-base").removeClass("a-color-error").addClass("a-color-success"):this.claimedMessage.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-error")}}});return{getView:function(a){var b=a.rootContainer;return b.find("#dealsx_progress_view").length&&b.find("#dealsx_progress_bar \x3e .progbar").length&&b.find("#dealsx_progress_bar \x3e .progbartick").length&&b.find("#dealsx_percent_message").length?new c(a):null}}});f.when("A").register("dealsx-header-view", function(b){var c=b.createClass({dealUnavailableView:null,claimedMessageView:null,headerStateView:null,init:function(a){a=a.rootContainer;this.headerStateView=a.find("#dealsx_header_message");this.claimedMessageView=a.find("#dealsx-claimed-message");this.dealUnavailableView=a.find("#dealsx-unavailable-message")},onModelUpdate:function(a){a.isCustomerStateIsEqualTo(DealsX.CustomerStates.CLAIMED)&&this.claimedMessageView&&(b.show(this.claimedMessageView),b.hide(this.claimedMessageView.siblings())); this.updateHeaderStateMessage(a)},showDealUnavailableView:function(){this.dealUnavailableView&&(b.show(this.dealUnavailableView),b.hide(this.dealUnavailableView.siblings()))},updateHeaderStateMessage:function(a){a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_incart")):a.isCustomerStateIsEqualTo(DealsX.CustomerStates.PENDING_ADD_TO_CART)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_pendingatc")): a.isCustomerStateIsEqualTo(DealsX.CustomerStates.CLAIMED)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_claimed")):a.isDealStateIsEqualTo(DealsX.DealStates.WAITLISTFULL)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_waitlistfull")):this.hideHeaderStateViewChildrenExceptProvidedView(null)},hideHeaderStateViewChildrenExceptProvidedView:function(a){a?(b.show(a),b.hide(a.siblings())):b.hide(this.headerStateView.children())}}); return{getView:function(a){return a.rootContainer.find("#dealsx_header_message").length?new c(a):null}}});f.when("A").register("dealsx-warranty-view",function(b){var c=b.createClass({warrantyViewSelector:null,init:function(a){a=a.rootContainer;this.isMobile()?this.warrantyViewSelector=a.find("#warrantyCheckBoxLD"):this.warrantyViewSelector=a.find("#abbWrapper")},onModelUpdate:function(a){null!==this.warrantyViewSelector&&(a.dealCustomerStatus&&a.dealCustomerStatus.state===DealsX.CustomerStates.IN_CART? b.hide(this.warrantyViewSelector):this.warrantyViewSelector.removeClass("a-hidden"))},isMobile:function(){var a=b.$;return 0<a("#warrantyCheckBoxLD_feature_div").find('input[name\x3d"mbba-ld"][type\x3d"checkbox"]').length}});return{getView:function(a){return new c(a)}}});f.when("A").execute("dealsx-metrics-utilities",function(b){DealsX.incrementCounter=function(b){b&&h.ue&&"function"===typeof h.ue.count&&ue.count(b,(ue.count(b)||0)+1)};DealsX.setCounter=function(b,a){b&&h.ue&&"function"===typeof h.ue.count&& ue.count(b,a)};DealsX.generateAPIMetricName=function(b){if(!b)return null;var a="dealsx";b.apiName&&(a+=":"+b.apiName,b.apiVersion&&(a+=":"+b.apiVersion));a+=":"+(b.isSuccess?"success":"error");b.clientId&&(a+=":"+b.clientId);b.errorCode&&(a+=":"+b.errorCode);b.isRobot&&(a+=":robot");return a.toLowerCase()};DealsX.recordAPIMetrics=function(b){if(b){var a=DealsX.generateAPIMetricName(b);DealsX.incrementCounter(a);b.latency&&DealsX.setCounter(a+":time",b.latency)}};DealsX.callIfFunctionWithMetrics= function(){if(!(2>arguments.length)){var b=[];Array.prototype.push.apply(b,arguments);var a=b.shift(),d=b.shift();"function"==typeof d?(DealsX.recordAPIMetrics(a),d.apply(null,b)):(a.isRobot=!0,DealsX.recordAPIMetrics(a))}}});f.when("A").register("dealsx-polyfills",function(){return{padStart:function(b){!b&&String.prototype.padStart||Object.defineProperty(String.prototype,"padStart",{configurable:!0,writable:!0,value:function(b,a){a=a||" ";if(this.length>=b)return String(this);b-=this.length;for(var c= "",e=0;e<b;e+=a.length)c+=a;return c.slice(0,b)+String(this)}})}}});f.when("A").register("deals-custom-integration-base",function(b){return b.createClass({isActive:!1,init:function(){this.isIntegrationActive()},isIntegrationActive:function(){throw Error("isIntegrationActive called from base");},appendArgumentsToEndpoint:function(){throw Error("appendArgumentsToEndpoint called from base");},handleClaimDealSuccess:function(){throw Error("handleClaimDealSuccess called from base");},handleClaimDealError:function(){throw Error("handleClaimDealError called from base"); },handleClaimDealRetry:function(){throw Error("handleClaimDealRetry called from base");},handleLDBuyBoxSelected:function(){throw Error("handleLDBuyBoxSelected called from base");},handleRegularBuyBoxSelected:function(){throw Error("handleRegularBuyBoxSelected called from base");}})});f.when("A","deals-custom-integration-base").register("deals-custom-integration-installments",function(b,c){var a=b.$;return c.extend({init:function(){this._super()},isIntegrationActive:function(){var b=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'), c=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');this.isActive=b.length&&c.length},appendArgumentsToEndpoint:function(){var b="",c=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),g=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');g.length&&c.length&&c.is(":checked")&&(b="\x26installmentsProgramId\x3d"+g.val());return b},getRequestDataParameter:function(){var b={},c=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'), g=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');g.length&&c.length&&c.is(":checked")&&(b={installmentsProgramId:g.val()});return b},handleClaimDealSuccess:function(){a(".installments-checkbox-wrapper").hide()},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){var b=a(".installments-deal-breakdown");b.length&&b.addClass("aok-hidden");b=a(".price-installment-payment");b.length&&b.removeClass("aok-hidden")},handleRegularBuyBoxSelected:function(){var b= a(".installments-deal-breakdown");b.length&&b.removeClass("aok-hidden");b=a(".price-installment-payment");b.length&&b.addClass("aok-hidden")}})});f.when("A","deals-custom-integration-base").register("dealsx-deal-custom-integration-preRegistration",function(b,c){function a(){var a=d('#preRegistration-container-deals input[name\x3d"account-linking-deals"]'),b=d('#preRegistration-container-mobile-deals input[name\x3d"account-linking-deals"]');return 0<a.length?a:0<b.length?b:null}var d=b.$;return c.extend({init:function(){this._super()}, isIntegrationActive:function(){this.isActive=null!==a()},appendArgumentsToEndpoint:function(){var b="",c=a();null!==c&&(b=c.is(":checked")&&!c.prop("disabled")?"\x26isDevicePreRegistered\x3dtrue":"\x26isDevicePreRegistered\x3dfalse");return b},getRequestDataParameter:function(){var b={},c=a();0<c.length&&(b={devicePreRegistered:c.is(":checked")&&!c.prop("disabled")});return b},handleClaimDealSuccess:function(){h.dealController&&h.dealController.dealModel&&!h.dealController.dealModel.isDealPrimeOnlyDotd()&& (d("#preRegistration-container-deals").hide(),d("#preRegistration-container-mobile-deals").hide())},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){},handleRegularBuyBoxSelected:function(){}})});f.when("A","deals-custom-integration-base","ready").register("dealsx-deal-custom-integration-warranty",function(b,c){function a(){var a=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"][type\x3d"checkbox"]'),b=document.querySelectorAll('div[id\x3d"mbbLD_feature_div"] [id^\x3d"mbb-offeringID-3"]'); return 0<a.length?a:b}function d(){return 0<e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"][type\x3d"checkbox"]').length}var e=b.$;return c.extend({init:function(){this._super()},isIntegrationActive:function(){this.isActive=0<a().length},appendArgumentsToEndpoint:function(){},getRequestDataParameter:function(){},handleClaimDealSuccess:function(){var c=a();if(0<c.length){if(d()){if(c.prop("checked")){var f=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"]').val(); var k=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbboid-ld"]').val()}}else for(var l=0;l<c.length;l++)if(c[l].checked){f=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"asin.3'+l+'"]').val();k=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"offeringID.3'+l+'"]').val();break}f!==n&&k!==n&&(c=k,k=d()?b.state("hlcx-mbb-state").baseAsin:e('#ASIN,input[name\x3d"items[0.base][asin]"]').val(),c={asin:f,offerListingId:c,quantity:Number(e("#dealx_quantity_dropdown").val())||1,additionalParameters:{itemAssociation:{associatedItemId:k, renderType:"renderAll",programType:"AmazonProtect",deleteConstraint:{mutuallyInclusive:!1}}}},k=(d()?"wty_ld_m_mbb":"wty_ld_d_mbb")+"_"+k+"_"+f,h.dealController.addItemsToCart([c],k))}},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){var a=e(".a-section.mbb__tld");a.length&&a.removeClass("a-hidden")},handleRegularBuyBoxSelected:function(){var a=e(".a-section.mbb__tld");a.length&&a.addClass("a-hidden")}})});f.when("A").register("dealsx-cart-aapi-service", function(b){return b.createClass({countEndpointUrl:null,addItemsEndpointUrl:null,headers:null,init:function(b){this.countEndpointUrl=b.cartCountAapiEndpoint;this.addItemsEndpointUrl=b.cartAddItemsAapiEndpoint;this.headers={"Accept-Language":b.languageOfPreference,"x-api-csrf-token":b.aapiCsrfToken};b.slateToken&&(this.headers["x-amzn-encrypted-slate-token"]=b.slateToken)},getCount:function(c,a){var d=this,e={apiName:DealsX.ApiNames.CART_COUNT};d._request=b.$.ajax({url:this.countEndpointUrl,type:"GET", dataType:"json",headers:b.$.extend({},d.headers,{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.count/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.count.request/v1"'}),xhrFields:{withCredentials:!0},success:function(a){e.isSuccess=!0;DealsX.recordAPIMetrics(e);c(a,d._request)},error:function(b){e.isSuccess=!1;DealsX.recordAPIMetrics(e);e.errorCode=JSON.parse(b.responseText).entity.status;DealsX.recordAPIMetrics(e);a(b)},complete:function(){d._request=null}})}, addItems:function(c,a,d,e){var f=this,m={apiName:DealsX.ApiNames.CART_ADD_ITEMS};f._request=b.$.ajax({url:this.addItemsEndpointUrl+"?ref\x3d"+a,type:"POST",dataType:"json",headers:b.$.extend({},f.headers,{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"'}),data:JSON.stringify({items:c}),xhrFields:{withCredentials:!0},success:function(a){m.isSuccess=!0;DealsX.callIfFunctionWithMetrics(m, d,a,f._request)},error:function(a){m.isSuccess=!1;DealsX.recordAPIMetrics(m);if(a.hasOwnProperty("responseText")){var b=JSON.parse(a.responseText);b.hasOwnProperty("type")&&b.type===DealsX.constants.AAPI_V1_ERROR_TYPE&&(m.errorCode=b.entity.status)}m.errorCode||(m.errorCode=a.status);DealsX.callIfFunctionWithMetrics(m,e,a)},complete:function(){f._request=null}})}})});f.when("A","dealsx-deal-custom-integration-service").register("dealsx-deal-redemption-service",function(b,c){return b.createClass({endPoint:null, dealCustomIntegrationService:null,init:function(a){this.dealCustomIntegrationService=new c;this.endPoint=a.claimDealAapiEndpoint;this.headers={"Accept-Language":a.languageOfPreference,Accept:'application/vnd.com.amazon.api+json; type\x3d"deals.claim.response/v1"',"x-api-csrf-token":a.aapiCsrfToken};a.slateToken&&(this.headers["x-amzn-encrypted-slate-token"]=a.slateToken)},claimDeal:function(a,c,f,g,m,k){var d=this,e={apiName:DealsX.ApiNames.CLAIM_AND_ADD_TO_CART,isRetry:!1};d._request=b.$.ajax({url:d.endPoint+ a+"/claim-and-add-to-cart",type:"POST",dataType:"json",data:d.generateRequestData(c,g),contentType:'application/vnd.com.amazon.api+json; type\x3d"deals.claim.request/v1"',headers:d.headers,xhrFields:{withCredentials:!0},success:function(a){e.isSuccess=!0;DealsX.callIfFunctionWithMetrics(e,m,a.entity,d._request)},error:function(a){e.isSuccess=!1;DealsX.recordAPIMetrics(e);var b=null;if(a.hasOwnProperty("responseText")&&""!==a.responseText){var c=JSON.parse(a.responseText);c.hasOwnProperty("type")&& (b=c.type,b===DealsX.constants.AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR||b===DealsX.constants.AAPI_V1_ERROR_TYPE)&&(e.errorCode=c.entity.status)}e.errorCode||(e.errorCode=a.status);DealsX.callIfFunctionWithMetrics(e,k,a,b)},complete:function(){d._request=null}})},generateRequestData:function(a,b){var c=this.dealCustomIntegrationService.getRequestDataParameters();c.asin=a;c.quantity=parseInt(b);return JSON.stringify(c)}})});f.when("A","deals-custom-integration-installments","dealsx-deal-custom-integration-preRegistration", "dealsx-deal-custom-integration-warranty").register("dealsx-deal-custom-integration-service",function(b,c,a,d){var e=b.$;return b.createClass({requiredFunctions:"isIntegrationActive appendArgumentsToEndpoint handleClaimDealSuccess handleClaimDealError handleClaimDealRetry handleLDBuyBoxSelected handleRegularBuyBoxSelected".split(" "),registeredIntegrations:[new c,new a,new d],init:function(){this.bindEvents()},bindEvents:function(){b.on("deals_claimDealSuccess",e.proxy(function(){this.executeEventHandler("handleClaimDealSuccess")}, this));b.on("deals_claimDealError",e.proxy(function(){this.executeEventHandler("handleClaimDealError")},this));b.on("deals_claimDealRetry",e.proxy(function(){this.executeEventHandler("handleClaimDealRetry")},this));b.on("deals_onSelectLDBuybox",e.proxy(function(){this.executeEventHandler("handleLDBuyBoxSelected")},this));b.on("deals_onSelectRegularBuybox",e.proxy(function(){this.executeEventHandler("handleRegularBuyBoxSelected")},this))},appendCustomArgumentsToEndpoint:function(a){var b=a;e.each(this.registeredIntegrations, function(a,c){c.isIntegrationActive();c.isActive&&(b+=c.appendArgumentsToEndpoint())});return b},getRequestDataParameters:function(){var a={};e.each(this.registeredIntegrations,function(b,c){c.isIntegrationActive();if(c.isActive){b=c.getRequestDataParameter();for(var d in b)a[d]=b[d]}});return a},executeEventHandler:function(a){e.each(this.registeredIntegrations,function(b,c){c.isIntegrationActive();if(c.isActive)c[a]()})}})})}); /* ******** */ (function(e){var g=window.AmazonUIPageJS||window.P,q=g._namespace||g.attributeErrors,a=q?q("DetailPageCommonScripts",""):g;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,g,q){e.when("A","jQuery").register("jumpLink",function(a,b){return{bind:function(a,f,d,u){try{f=f||1E3,d=d||0,b("body").delegate(a,"click",function(c){try{var e=b(a);if(e.get(0)){var h=e.attr("href");h&&"#"===h.charAt(0)&&(h=u&&0===b(h).length?"[name\x3d'"+h.substring(1)+"']":h,0!==b(h).length&& (c.preventDefault(),b("html, body").animate({scrollTop:b(h).offset().top-d},f)))}}catch(m){g.ueLogError&&g.ueLogError(m,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in executing click handler]"})}})}catch(k){g.ueLogError&&g.ueLogError(k,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in binding click handler]"})}}}});"use strict";e.when("A").execute(function(a){a.declarative("mySummaryExpander_1","click",function(a){if(a=document.getElementById("summaryText"))a.style.display= "block"===a.style.display?"none":"block"})});"use strict";e.when("A").register("dp-log-utils",function(a){a.on("dpLogFatalsEvent",function(a,c,f){g.ueLogError&&g.ueLogError({message:a},{logLevel:c,attribution:f})})});"use strict";e.register("dp-client-counter",function(){var a=function(){};g.ue&&g.ue.count&&"function"===typeof g.ue.count&&(a=g.ue.count);return{set:function(b,c){"undefined"!==typeof c&&a(b,c)},get:function(b){return a(b)},inc:function(b){a(b,(a(b)||0)+1)}}});"use strict";e.when("dp-client-counter").register("dp-click-counter", function(a){return{record:function(b,c){b&&b.addEventListener("click",function(){a.inc(c+"-clicked")})}}});"use strict";e.when("A").register("cache",function(a){function b(){this.data={}}function c(b){var f=b;if("object"===typeof b){var c="";f="";a.each(b,function(a,b){f+=c+b+"\x3d"+a;c="\x26"})}return f}b.prototype={put:function(a,b){a=c(a);this.data[a]=b},get:function(a){a=c(a);return this.data[a]},exists:function(a){return c(a)in this.data}};return b});"use strict";e.register("dp-util-cookie", function(){return function(a){a+="\x3d";for(var b=decodeURIComponent(document.cookie).split(";"),c=0;c<b.length;c++){var f=b[c];f=f.replace(/^\s+/,"");if(0===f.indexOf(a))return f.substring(a.length,f.length)}return""}});e.when("jQuery").register("quanityChangePriceUpdate",function(a){return{ajaxCall:function(a){}}});"use strict";e.when("A","jQuery","a-popover","a-dropdown","ready").register("moq-core",function(a,b,c,f){function d(a){return 0<a.length&&0<a.find("div[data-name\x3d'quantity.improvedMOQ']").length} function e(){return b(n.join(", "))}function k(a){return"locked"===a.find("div[data-name\x3d'quantity.improvedMOQ']").attr("moq-lock")}function g(){return(b(h.join(", ")).length?h:b(m.join(", ")).length?m:b(t.join(", ")).length?t:["#buybox"]).map(function(a){return b(a)}).filter(d)}var h=["div[id^\x3dnewAccordionRow]","#snsAccordionRowMiddle","#snsAccordionRowMobileMiddle","#snsAccordionRowMobileAppMiddle"],m=["#oneTimeBuyBox","#snsBuyBox"],t=["#toggleBuyBox \x3e #sns","#toggleBuyBox \x3e #onetime"], n=["#snsBuyBox","#toggleBuyBox \x3e #sns","#snsAccordionRowMiddle","#snsAccordionRowMobileMiddle","#snsAccordionRowMobileAppMiddle"],p="#add-to-cart-button;#mobb\\.addToCart;#buy-now-button;#one-click-button;#oneClickBuyButton;#prime-toggle-main;#rcx-subscribe-submit-button input;#rcx-subscribe-submit-button button".split(";");return{isSnsLocked:function(){var a=e();return k(a)},isLocked:k,getSnsSubscriptionContainer:e,offerContainerHasMoq:d,findMoqOfferContainers:g,findMoqOfferContainerWithDomElement:function(a){var b= g().filter(function(b){return b[0].contains(a)});return 0===b.length?null:b[0]},tweakDisplayTextForMoqQuantityDropdown:function(a){var b=f.getSelect(a).getOptions(0),c=b.info()[0];c.selected?b.update({text:c.value}):b.update({text:a.children("option[data-displayText]").attr("data-displayText")})},lockSubmission:function(a,c,f){var d=a.find(p.join(", ")),e=a.find("div[data-name\x3d'quantity.improvedMOQ']");d.each(function(){"hidden"!==b(this).prop("type")&&(this.hasAttribute("moq-original-button-type")|| b(this).attr("moq-original-button-type",b(this).prop("type")),e.attr("moq-lock","locked"),b(this).prop("type","button"),b(this).bind("click.moq",c),"function"===typeof f&&f(b(this)))})},unlockSubmission:function(a,c){var f=a.find(p.join(", ")),d=a.find("div[data-name\x3d'quantity.improvedMOQ']");f.each(function(){"button"===b(this).prop("type")&&(d.attr("moq-lock","unlocked"),b(this).prop("type",b(this).attr("moq-original-button-type")),b(this).unbind("click.moq"),"function"===typeof c&&c(b(this)))})}}}); "use strict";e.when("A","dp-pre-atc-monitor").execute("dp-pre-atc-execution",function(a,b){a.declarative("dp-pre-atc-declarative","click",function(c){var f=b.getInstance();a.$.isEmptyObject(f.preAddToCartHeroFunctionRegister.heroFunctionMap)||a.$.isEmptyObject(f.getHeroName())||f.triggerHeroFunction(c)})});"use strict";e.when("A","ready").register("dp-pre-atc-hero-candidates",function(a){var b=a.state("dp-pre-atc-hero")===q?"":a.state("dp-pre-atc-hero").heroName;return{getHeroName:function(){return b}, setHeroName:function(a){a&&(b=a)},hasHeroName:function(){return!a.$.isEmptyObject(b)},getHeroCandidates:a.state("dp-pre-atc-hero-candidates")===q?[]:a.state("dp-pre-atc-hero-candidates")}});"use strict";e.when("A").register("dp-pre-atc-hero-function-register",function(a){function b(){this.heroFunctionMap={};this.registerHero=function(a,b){if(a&&"function"===typeof b)this.heroFunctionMap[a]=b;else throw Error("PRE-ATC-ERROR-REGISTER-1 Failed to register as your Hero name might be invalid or triggerFunction is not function type."); }}var c;return{getInstance:function(){c||(c=new b);return c}}});"use strict";e.when("A","dp-pre-atc-hero-candidates","dp-pre-atc-hero-function-register").register("dp-pre-atc-monitor",function(a,b,c){function f(a,b){this.preAddToCartHeroCandidates=a;this.preAddToCartHeroFunctionRegister=b;this.logAttribution="dp_pre_atc_monitor"}f.prototype={getHeroName:function(){return this.preAddToCartHeroCandidates.getHeroName()},updateHero:function(b){b?-1<this.preAddToCartHeroCandidates.getHeroCandidates.indexOf(b)? (this.preAddToCartHeroCandidates.setHeroName(b),a.state.replace("dp-pre-atc-hero",null),b=g.ue,"undefined"!==typeof b&&"undefined"!==typeof b.count&&b.count("dpOffers:preatc:updateHero",(b.count("dpOffers:preatc:updateHero")||0)+1)):a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-1 Failed to update Hero to "+b+" as it is not registered on DPX side.","ERROR",this.logAttribution):a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-2 Empty Hero name, Hero has been deleted.","WARN",this.logAttribution)}, triggerHeroFunction:function(b){if(!a.$.isEmptyObject(this.preAddToCartHeroFunctionRegister.heroFunctionMap)&&this.preAddToCartHeroCandidates.hasHeroName()){var c=this.getHeroName();try{this.preAddToCartHeroFunctionRegister.heroFunctionMap[c](b)}catch(v){a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-3 PreAddToCartMonitor could not find Hero's function.","ERROR",this.logAttribution)}}else a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-4 PreAddToCartMonitor tried to trigger Hero function when Hero does not exist.", "ERROR",this.logAttribution)}};f.prototype.constructor=f;var d;return{getInstance:function(){d||(d=new f(b,c.getInstance()));return d}}});"use strict";e.when("dp-accordion-click-counter").execute("gsbb-accordion-click-counter-desktop",function(a){a.recordAccordionClick("gsbb","desktop")});"use strict";e.when("dp-button-click-counter").execute("gsbb-button-click-counter-desktop",function(a){a.recordButtonClick("desktop_buybox","gsbb","desktop")});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids", "ready").register("dp-accordion-click-counter",function(a,b,c){return{recordAccordionClick:function(c,d){var f=c+":"+d+":";a.on("a:accordion:buybox-accordion:select",function(a){b.inc(f+a.selectedRow.rowName+":click")})}}});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids","ready").register("dp-button-click-counter",function(a,b,c){var f=a.$;return{recordButtonClick:function(a,e,g){(a=c.getAccordionRowIds(a))&&a.length&&a.forEach(function(a){var d=c.getButtonIds(a);d&&d.length&& d.forEach(function(c){var d=e+":"+g+":"+a+":"+c+":click";f("#"+c).click(function(){b.inc(d)})})})},recordSingleOfferButtonClick:function(a,e,g){if(a){var d=c.getButtonIds(a);d&&d.length&&d.forEach(function(c){var d=e+":"+g+":"+a+":"+c+":click";f("#"+c).click(function(){b.inc(d)})})}}}});"use strict";e.when("A","ready").register("dp-get-buybox-element-ids",function(a){function b(a){return c(a).length?c(a).map(function(){return this.id}).get():[]}var c=a.$;return{getAccordionRowIds:function(a){return b("#"+ a+" [data-a-accordion-row-name]")},getButtonIds:function(a){return b("#"+a+" .a-button-input")}}});"use strict";e.when("A","ready").register("dp-get-offerDisplay-container",function(a){var b=a.$;return{getOfferDisplayContainerByElement:function(a){var c=["#buyBoxAccordion [data-a-accordion-row-name]","[id^\x3dgsod_singleOfferDisplay]","[id^\x3dtab_][id*\x3d_buybox_group_]","#buybox"],d=b("body");a&&a.closest&&(d=a.closest(c.join(",")));return d.length?d:b("body")}}});"use strict";e.register("dp-csm-metrics", function(){return{updateCount:function(a){var b=g.ue;b&&b.count&&"string"===typeof a&&b.count(a,(b.count(a)||0)+1)},startLatencyTime:function(a){"function"===typeof uet&&"string"===typeof a&&uet("bb",a,{wb:1})},recordLatencyTime:function(a){"function"===typeof uex&&"string"===typeof a&&uex("ld",a,{wb:1})}}});"use strict";e.register("add-to-cart-constants",function(){return{PREFIX:"items",ITEM_TYPES:{BASE:"base"},PARAMETER_PATHS:{ASIN:["asin"],OFFER_LISTING_ID:["offerListingId"],QUANTITY:["quantity"], GIFTOPTIONS:["additionalParameters","giftOptions","includeGiftReceipt"],DEVICEPREREGISTRATION:["additionalParameters","devicePreregistration","selected"]},CLIENT_NAME:"clientName",CSRF_TOKEN:"anti-csrftoken-a2z"}});"use strict";e.when("A","add-to-cart-constants").register("add-to-cart-parameter-name",function(a,b){return{constructParameterName:function(c,f,d){if("string"===typeof c&&"number"===typeof f&&0<=f&&Array.isArray(d)){var e=b.PREFIX;e+="["+(f+"."+c)+"]";d.forEach(function(a){e+="["+a+"]"}); return e}a.trigger("dpLogFatalsEvent","[Invalid parameters used to construct add to cart parameter]","WARN","addtocart_construct_parameter_error")}}});"use strict";e.when("add-to-cart-constants").register("offersx-csrf-utils",function(a){function b(b){var c="input[name\x3d'"+a.CSRF_TOKEN+"']";return(c=b?c+"[id\x3d'"+b+"']":c)?(b=document.querySelector(c))?b.value:"":""}function c(b,c){c instanceof Object||(c={});b&&""!==b&&(c[a.CSRF_TOKEN]=b);return c}return{getCSRFToken:b,setCSRFHeader:c,setCSRFHeaderFromId:function(a, d){a=b(a);return c(a,d)}}});"use strict";e.when("A","hdp-invite-button-ajax-handler","atf").execute("hdp-invite-button-action-handler",function(a,b){a.declarative("invite-button","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data,a.action)});a.declarative("request-invite","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data,a.action)});a.declarative("notify-details","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data, a.action)})});"use strict";e.when("A","dp-client-counter","hdp-ajax-success-dialog-handler","a-button","atf").register("hdp-invite-button-ajax-handler",function(a,b,c,e){var d=a.$,f,k,q;c.initialize();return{hdpInviteButtonAjaxHandle:function(c,m){c=d("#hdp-ib-ajax-endpoint");var h=d("#hdp-ib-csrf-token"),n=d("#hdp-ib-signedIn"),p=d("#hdp-sign-in-url"),r=d("#hdp-language"),l=d("#hdp-ib-post-click-display-string");p=p?p.val():"/gp/sign-in.html";n=n?"true"===n.val():!1;r=r?r.val():"en_US";"notify-details"=== m?(f="iod:prime:signup:details:click",k="notify-program-details"):(f="hdp:request:invitation:click",k="request-invite");q=l?l.val():"Details emailed";if(n&&c&&h){c.val()&&(l=c.val().split("/"))&&4<l.length&&b.inc(f+":"+l[l.length-1]);b.inc(f);h={"Accept-Language":r,Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.highdemandproductcontracts.'+k+'/v1"',"x-api-csrf-token":h.val()};if(l=document.querySelector('meta[name\x3d"encrypted-slate-token"]'))h["x-amzn-encrypted-slate-token"]=l.content; d.ajax({url:"https://"+c.val(),type:"POST",contentType:'application/vnd.com.amazon.api+json; type\x3d"aapi.highdemandproductcontracts.'+k+'.request/v1"',headers:h,data:JSON.stringify({}),xhrFields:{withCredentials:!0},timeout:1E4,success:function(b){if("request-invite"===m||"invite-button"===m){b=d("#shippingMessageInsideBuyBox_feature_div");var c=d("#availabilityInsideBuyBox_feature_div"),f=d("#tabular_feature_div"),g=d("#hdp-detail-no-requested-id"),h=d("#hdp-invite-button"),k=d("#hdp-detail-expired-id"), l=d("#hdp-detail-requested-id"),n=d("#iod-request-invite-success-message-trigger"),p=d("#hdpInviteButton_feature_div").attr("data-csa-c-asin");"invite-button"===m&&f&&f.hide();b&&b.hide();c&&c.hide();g&&g.hide();h&&h.hide();k&&k.hide();l&&l.removeClass("aok-hidden");n.length&&n.click();a.trigger("updateCustomPageRefreshParams",p,"hdpCustomerAction","requestInvite")}else"notify-details"===m&&(b=d("#hdpInviteButton_feature_div").attr("data-csa-c-asin"),c=e("#hdp-invite-button"),c.isEmpty()||(c.disable().text(q), a.trigger("updateCustomPageRefreshParams",b,"hdpCustomerAction","notifyDetails")))},error:function(){a.trigger("dpLogFatalsEvent","HDP Invite Button Ajax call failed","ERROR","HDPAjaxFailure");var b=d("#hdp-ajax-failure-modal");b&&b.click()}})}else n?a.trigger("dpLogFatalsEvent","HDP Invite Button Ajax data is missing","ERROR","HDPAjaxFailure"):g.location.href=p}}});"use strict";e.when("dp-button-click-counter").execute("hdp-button-click-counter-desktop",function(a){a.recordSingleOfferButtonClick("hdp_buybox_desktop", "hdp","desktop")});e.when("A","a-modal").register("hdp-ajax-success-dialog-handler",function(a,b){return{initialize:function(){var b=this;a.declarative("close-iod-request-invite-success-dialog","click",function(){b.hide()})},hide:function(){var a=b.get("iodRequestInviteSuccessMessageModal");a&&a.hide()}}})}); /* ******** */ (function(h){var g=window.AmazonUIPageJS||window.P,p=g._namespace||g.attributeErrors,e=p?p("DetailPageLatencyAssets",""):g;e.guardFatal?e.guardFatal(h)(e,window):e.execute(function(){h(e,window)})})(function(h,g,p){h.when("dp-interactive-feature-component-base","dp-click-to-ci-utils","A").register("dp-interactive-feature",function(e,d,a){function b(a,f){this.name=a;this._baseComponents={};this.getComponent("default",f)}function c(a){return n.isPlainObject(a)&&a.hasComponents&&n.isArray(a.components)} var n=a.$;b.prototype={getTimeToInteractivity:function(b,f){b=b||{};var k,l,e=0,g=!1,h=[];c(b)?(a.each(b.components,function(a){n.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(k=this.getComponent(a.name,f),(l=k.getTimeToInteractivity(f,a.events))&&l.interactive?l.interactiveTime>e&&(e=l.interactiveTime):h.push(a.name))},this),h.length||(g=!0)):(l=this.getComponent("default",f).getTimeToInteractivity(f,b.events),g=l.interactive,e=l.interactiveTime);return{interactive:g,interactiveTime:g?e:0}}, getComponent:function(a,f){a=a.toLowerCase();this._baseComponents[a]||(this._baseComponents[a]=new e(a,f));return this._baseComponents[a]},updateFeatureInformation:function(b,f){var k={timestamp:b.timestamp,type:b.type,options:{}},l=!1;c(b.options)?a.each(b.options.components,function(a){n.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(k.options=a,a=this.getComponent(a.name,f).updateComponentInformation(k,f),l=l||a)},this):(k.options=b.options||{},l=this.getComponent("default",f).updateComponentInformation(k, f));return l},updateRenderTime:function(b,f,k){b=b||{};var l;c(b)?a.each(b.components,function(a){n.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(l=this.getComponent(a.name))&&k&&l.updateRenderTime(k,f)},this):this.getComponent("default",k).updateRenderTime(k,f)},resetFeatureInfo:function(b,f){b=b||{};var k;c(b)?a.each(b.components,function(a){n.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(k=this.getComponent(a.name))&&f&&k.resetComponentInfo(f)},this):this.getComponent("default",f).resetComponentInfo(f)}}; return b});h.when("A","dp-interactive-feature","dp-click-to-ci","dp-critical-features","3p-promise","dp-click-to-ci-utils").register("dp-time-to-interactive",function(e,d,a,b,c,n){var m=e.$;return{_features:{},criticalFeatures:{},_clickToCI:{},pageType:"glance",getTimeToInteractivity:function(a,b){a=a||{};var l={features:a,longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1,nonInteractiveFeatures:[]},c=[];m.isPlainObject(a)&&!m.isEmptyObject(a)&&(e.each(a,function(a,f){f=f.toLowerCase(); var b=this._features[f];b?(b=b.getTimeToInteractivity(a,this.pageType),b.interactive?(a.interactiveTime=b.interactiveTime,b.interactiveTime>l.interactiveTime&&(l.interactiveTime=b.interactiveTime,l.longPoleFeatureName=f)):c.push(f)):c.push(f)},this),c.length||(l.allFeaturesInteractive=!0),l.nonInteractiveFeatures=c);return l},updateFeatures:function(a){a=a||[];var b=!1;m.isArray(a)&&(e.each(a,function(a){var f=!1;m.isPlainObject(a)&&n.isValidNonEmptyString(a.name)&&a.timestamp&&(f=this.getFeatureObject(a.name).updateFeatureInformation(a, this.pageType));b=b||f},this),this._getClickToCIObj(this.pageType).getMetricInfo().allFeaturesInteractive||this.updateMetricInfo());return b},getFeatureObject:function(a){a=a.toLowerCase();this._features[a]||(this._features[a]=new d(a,this.pageType));return this._features[a]},updateRenderTime:function(a){if(a&&"twisterupdate"===this.pageType){var b=this.getCriticalFeatureObj().getCriticalFeaturesPromise(),l=this._getClickToCIObj(this.pageType).getMetricInfo(),c=this;b&&b.then(function(b){m.isPlainObject(b)&& !m.isEmptyObject(b)&&e.each(b,function(b,k){k=k.toLowerCase();(k=c._features[k])&&k.updateRenderTime(b,a,c.pageType)},this);l.allFeaturesInteractive||c.updateMetricInfo(!0)})}},updatePage:function(f){if(f){var k=this.pageType;this.pageType=f.toLowerCase();var l=this.getCriticalFeatureObj().getCriticalFeatures();n.logCounter("ClickToCITwisterUpdateTotalCount");l&&this._clickToCI[k]&&!this._clickToCI[k].isResolved()&&this._clickToCI[k].reject(Error("ClicktoCI not available "));this._resetFeatureInfo(l, f);this._clickToCI[this.pageType]=new a;this.criticalFeatures=new b;"twisterupdate"===this.pageType&&this.criticalFeatures.setIgnoreCriticalFeatures("twister")}},_resetFeatureInfo:function(a,b){b=b.toLowerCase();a=a||{};m.isPlainObject(a)&&!m.isEmptyObject(a)&&e.each(a,function(a,f){f=f.toLowerCase();(f=this._features[f])&&f.resetFeatureInfo(a,b)},this)},_getClickToCIObj:function(b){b=b.toLowerCase();this._clickToCI[b]||(this._clickToCI[b]=new a);return this._clickToCI[b]},getCriticalFeatureObj:function(){m.isEmptyObject(this.criticalFeatures)&& (this.criticalFeatures=new b);return this.criticalFeatures},updateMetricInfo:function(a){var b=this._getClickToCIObj(this.pageType),c=this,e=this.getCriticalFeatureObj();e.getCriticalFeaturesPromise().then(function(d){e.isCriticalFeaturesKnown&&!b.getMetricInfo().allFeaturesInteractive&&b.setMetricInfo(c.getTimeToInteractivity(d,c.pageType));b.getMetricInfo().allFeaturesInteractive&&c._clickToCI[c.pageType]&&!c._clickToCI[c.pageType].isResolved()?(c._clickToCI[c.pageType].resolve(b.getMetricInfo()), c._clickToCI[c.pageType].setResolved(!0),a&&n.logCounter("ClickToCITwisterUpdateSuccessCount"),h.now("dp-critical-features-interactive-marker").execute(function(a){a||h.register("dp-critical-features-interactive-marker",function(){return b.getMetricInfo().allFeaturesInteractive})})):a&&!b.getMetricInfo().allFeaturesInteractive&&n.logCounter("ClickToCITwisterUpdateFailureCount")})},getClickToCIPromise:function(a){if(a){if(a=a.toLowerCase(),this._clickToCI[a])return this._clickToCI[a].getPromiseObject()}else if(this._clickToCI[this.pageType])return this._clickToCI[this.pageType].getPromiseObject()}, updateCriticalFeatures:function(){this.getCriticalFeatureObj().updateCriticalInteractiveFeatures();this.updateMetricInfo()}}});h.when("A").register("dp-interactive-feature-component",function(e){function d(a){if(a instanceof d){var c={};this._renderTime=0;this._isInteractive=a._isInteractive;e.each(a._events,function(a){a.alwaysInteractive&&(c[a.name]={name:a.name,interactiveTime:a.interactiveTime,alwaysInteractive:!0})},this);this._events=c}else this._renderTime=0,this._isInteractive=!0,this._events= {}}var a=e.$;d.prototype={updateComponentInformation:function(b){var c=!1;if(a.isPlainObject(b))switch(b.type){case "render":c=this._updateRenderInformation(b);break;case "interactive":c=this._updateInteractiveInformation(b)}return c},_updateRenderInformation:function(a){var c=!1,e=a.options||{};this._renderTime||(this._renderTime=a.timestamp,this._isInteractive=e.isInteractive===p?!0:e.isInteractive,c=!0);return c},_updateInteractiveInformation:function(a){var c;c=a.options||{};var d=c.alwaysInteractive|| !1,m=!1;this._isInteractive&&(c=c.events||["click"],e.each(c,function(c){this._events[c]||(this._events[c]={name:c,interactiveTime:a.timestamp,alwaysInteractive:d},m=!0)},this));return m},getTimeToInteractivity:function(b){var c=0,d=!1,m=[];this.isRendered()&&(this._isInteractive?(a.isArray(b)||(b=["click"]),e.each(b,function(a){var b=this._events[a];b?b.interactiveTime>c&&(c=b.interactiveTime):m.push(a)},this),m.length||(d=!0,this._renderTime>c&&(c=this._renderTime))):(d=!0,c=this._renderTime)); return{interactive:d,interactiveTime:d?c:0}},isRendered:function(){return!!this._renderTime},updateRenderTime:function(a){a&&!this.isRendered()&&(this._renderTime=a);return this._renderTime}};return d});h.when("dp-time-to-interactive").register("dp-interactive-page-refresh-handler",function(e){return{twisterStartTime:null,createInteractivityObjectForTwisterUpdate:function(){this.twisterStartTime=g.parseInt((new Date).getTime());e.updatePage("twisterUpdate")},updateCriticalFeatures:function(){e.updateCriticalFeatures()}, updateRenderTime:function(){e.updateRenderTime(this.twisterStartTime)},getClickToCIMetric:function(){return e.getClickToCIPromise("twisterUpdate")}}});h.when("dp-interactive-feature-component").register("dp-interactive-feature-component-base",function(e){function d(a,b){this.compName=a;this._pageType={};this.getComponentByPageType(b)}d.prototype={getComponentByPageType:function(a){if(a)return this._pageType[a]||(this._pageType[a]=this.getComponent(a)),this._pageType[a]},updateComponentInformation:function(a, b){return this.getComponentByPageType(b).updateComponentInformation(a)},getTimeToInteractivity:function(a,b){return a?this.getComponentByPageType(a).getTimeToInteractivity(b):{interactive:!1,interactiveTime:0}},resetComponentInfo:function(a){a&&this._pageType[a]&&(this._pageType[a]=this.getComponent(a))},updateRenderTime:function(a,b){return this.getComponentByPageType(a).updateRenderTime(b)},getComponent:function(a){return this._pageType[a]?new e(this._pageType[a]):this._pageType.glance?new e(this._pageType.glance): new e}};return d});h.when("3p-promise").register("dp-click-to-ci",function(e){function d(){this.reject=this.resolve=null;this.resolved=!1;var a=this;this.promiseObject=new e(function(b,c){a.resolve=b;a.reject=c});this.metricInfo={features:{},longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1}}d.prototype={getMetricInfo:function(){return this.metricInfo},setMetricInfo:function(a){this.metricInfo=a},getPromiseObject:function(){return this.promiseObject},isResolved:function(){return this.resolved}, setResolved:function(a){this.resolved=a}};return d});h.when("A","dp-time-to-interactive","dp-click-to-ci-utils").register("dp-clicktoci-metric-for-glanceview",function(e,d,a){function b(){var b=d.getClickToCIPromise("GLANCE");b&&b.then(function(a){n(a.features);m(a.features);c(a)}).catch(function(b){a.logCounter("ClickToCIFailureCount")})}function c(b){a.addTag("DPCIFLongPole"+b.longPoleFeatureName);a.widgetTime("cf","clickToCI",{wb:1},b.interactiveTime);a.widgetTime("fn",p,p,b.interactiveTime);a.postCSMMetrics("ld", "clickToCI",{wb:1});g.ue&&ue.isl&&a.postCSMMetrics("at")}function n(b){f.isPlainObject(b.atc)?(b=b.atc,a.addTag("DPCIFBuyable"),a.widgetTime("cf","dpATCTTI",{wb:1},b.interactiveTime),a.postCSMMetrics("ld","dpATCTTI",{wb:1}),b.hasComponents&&f.isArray(b.components)&&(b=b.components[0],f.isPlainObject(b)&&a.isValidNonEmptyString(b.name)&&a.addTag("DPCIFBuyable-"+b.name))):a.addTag("DPCIFNonBuyable")}function m(b){if(f.isPlainObject(b)){var c=g.performance;"object"===typeof c&&"object"===typeof c.timing&& e.each(b,function(b,f){var d="DP"+f+"TTI";a.logCounter("DPCF"+f+"TTI",b.interactiveTime-c.timing.navigationStart);a.widgetTime("cf",d,{wb:1},b.interactiveTime);a.postCSMMetrics("ld",d,{wb:1})})}}var f=e.$;a.widgetTime("bb","dpATCTTI",{wb:1});b();h.when("atf").execute("dp-get-critical-interactive-features",function(){d.updateCriticalFeatures()});return{markClickToCI:b,publishTTIOfCriticalFeatures:m,tagBuyablibity:n,publishTimeToInteractive:c}});h.when("A").register("dp-click-to-ci-utils",function(e){return{widgetTime:function(d, a,b,c){"function"===typeof uet&&uet(d,a,b,c)},addTag:function(d){g.ue&&g.ue.tag&&g.ue.tag(d)},logCounter:function(d,a){g.ue&&e.$.isFunction(g.ue.count)&&(a=a||(g.ue.count(d)||0)+1,g.ue.count(d,a))},isValidNonEmptyString:function(d){return"string"===typeof d&&0<d.length},postCSMMetrics:function(d,a,b){"function"===typeof uex&&uex(d,a,b)}}});h.when("A","3p-promise","dp-click-to-ci-utils").register("dp-critical-features",function(e,d,a){function b(){this._resolve;this._reject=null;var a=this;this._promiseObj= new d(function(b,c){a._resolve=b;a._reject=c});this._features=null;this.isCriticalFeaturesKnown=!1}var c=e.$,g=[];b.prototype={getCriticalFeatures:function(){return this._features},getCriticalFeaturesPromise:function(){return this._promiseObj},setCriticalFeatures:function(a){c.isPlainObject(a)&&!c.isEmptyObject(a)&&(this._features=a,this._resolve(a),this.isCriticalFeaturesKnown=!0)},setIgnoreCriticalFeatures:function(a){g.push(a)},updateCriticalInteractiveFeatures:function(){var b={},f=c(".dp-cif"); f.length?(f.each(function(){var f=(c(this).data()||{}).featureDetails;if(c.isPlainObject(f)&&a.isValidNonEmptyString(f.name)){var d;d=g.length&&g.includes(f.name)?!1:!0;d&&(b[f.name]=f)}else a.logCounter("DPCIFInvalidData")}),this._parseCriticalFeatures(b)):a.addTag("DPCIFNoData")},_parseCriticalFeatures:function(b){var f={};c.isPlainObject(b)?(e.each(b,function(a,b){f[b]={};c.isPlainObject(a)&&(f[b]=a)}),c.isEmptyObject(f)?a.addTag("DPCIFNoData"):this.setCriticalFeatures(f)):a.addTag("DPCIFNoData")}, resetIgnoreCriticalFeatures:function(){g=[]}};return b});h.when("dp-critical-features-interactive-marker").register("dp-latency-marker",function(e){});"use strict";h.when("A","load").execute("logDpAssetInjectionMetric",function(e){var d=e.state("dp_injected_meta_assets");if("undefined"!=typeof performance&&"undefined"!=typeof performance.getEntries){for(var a=0,b=0,c=0,h=0,m=performance.getEntries(),f=0;f<m.length;f++){var k=m[f],l=k.initiatorType;k.name.match(/\.css\?AUIClients\/AmazonUI/g)&&l&& "link"===l&&k.duration+k.startTime>a+b&&(a=k.duration,b=k.startTime);if("undefined"!=typeof d&&"undefined"!=typeof d.assetNames&&0<d.assetNames.length)for(var p=0;p<d.assetNames.length;p++)if(k.name.match(new RegExp("\\.css\\?AUIClients/"+d.assetNames[p]))&&l&&"link"===l){if(0===c||c>k.startTime)c=k.startTime;h<k.startTime&&(h=k.startTime);break}}g.ue&&e.$.isFunction(g.ue.count)&&(g.ue.count("aui.auiDuration",a),g.ue.count("aui.auiStartTime",b),0!==c&&0!==h&&(g.ue.count("dpcss.dpStartTimeMin",c), g.ue.count("dpcss.dpStartTimeMax",h),g.ue.count("dpcss.auiDiffMin",c-b),g.ue.count("dpcss.auiDiffMax",h-b)))}});h.when("A","load").execute("dp-asset-connection-metric-logging",function(e){function d(a){g.ue&&ue.tag&&ue.tag(a)}(function(){if(g.navigator&&g.navigator.connection){var a=1024*g.navigator.connection.downlink,b=g.navigator.connection.rtt,c=g.navigator.connection.effectiveType;b&&(g.ue&&ue.count&&ue.count("rtt",b),0<=b&&100>b?d("rtt:0_100"):100<=b&&200>=b&&d("rtt:100_200"));a&&(g.ue&&ue.count&& ue.count("downlink",a),0<=a&&5120>a?d("downlink:0_5"):5120<=a&&10240>=a&&d("downlink:5_10"));d("EffectiveConnectionType:"+c)}})()});h.when("A").register("get-resource-time",function(e){return{getResourceTimeByName:function(d,a){var b=[];g.performance&&performance.getEntries&&d&&e.$.isArray(a)&&0<a.length&&(b=performance.getEntries(),b=e.filter(b,function(b){return b&&b.initiatorType===d?-1<e.indexOfArray(a,b.name):!1}));return b}}});h.when("A","dp-interactivity-metric-utils").execute("dp-non-critical-tti", function(e,d){var a=e.$;(function(){a(".a-container").click(function(a){d.calculateInteractivity(a)})})()});h.when("A").register("dp-log-critical-asset-source-details",function(e){function d(a){g.ue&&ue.tag&&ue.tag(a)}function a(a){return a&&0<a.encodedBodySize}function b(b,c,d,g){var h=[];e.each(c,function(c){var k=new RegExp("\\."+d+"\\?AUIClients/"+c+"([^a-zA-Z]|$)");c=e.filter(b,function(b){return b&&b.initiatorType===g&&b.name&&b.name.match(k)&&a(b)?!0:!1});h=h.concat(c)});return h}function c(a){for(var b in a){var c= a[b];if(c&&0!==c.transferSize)return!1}return!0}var h=["DPMobileAppCriticalFeatureMetaAsset","DetailPageMobileWebCriticalFeatureAsset","DetailPageDesktopImageBlockMetaAsset"],m=["AmazonUI"];return{logAssetCacheSourceDetails:function(a){var e=b(a,h,"js","script"),e=e.concat(b(a,h,"js","link"));a=b(a,m,"css","link");var g="";0<e.length&&0<a.length&&(g+="dpcriticaljs_",g=c(e)?g+"cached":g+"not_cached",g+=":auicss_",g=c(a)?g+"cached":g+"not_cached",d(g));return g},checkEncodedBodySize:a,getFilteredResources:b, isResourceCached:c,logTag:d}});h.when("dp-log-critical-asset-source-details","ready").execute("dp-log-critical-asset-source-details_execute",function(e){if(g.performance&&performance.getEntries){var d=performance.getEntries();e.logAssetCacheSourceDetails(d)}});h.when("A","dp-click-to-ci-utils").register("dp-interactivity-metric-utils",function(e,d){var a=e.$;return{calculateInteractivity:function(b){var c=b.type,e=a(b.target),g=e.closest("div[id$\x3d'_feature_div']");d.logCounter("Total-"+c);g&&((g= a(g).data("feature-name"))?d.logCounter(g+"-"+c):d.logCounter(b.target.id+"-"+c));(b=e.closest(".a-declarative"))&&(b=a(b).data("action"))&&d.logCounter(b+"-"+c+"-dec-action")}}})}); /* ******** */ (function(g){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,d=h?h("DetailPageFeaturesAssets",""):e;d.guardFatal?d.guardFatal(g)(d,window):d.execute(function(){g(d,window)})})(function(g,e,h){e.P&&(g.when("A","jQuery","atf").execute(function(d,b){e.registeredDPApplicablePromotionListComponent||g.register("DPApplicablePromotionListComponent",function(){return{recordImpressions:function(){},adjustPromotionMessageWidth:function(){var a=b(".apl_popover_hover").width()+b(".apl_label").width()+ 10;if(a){var c=b(".apl_popover_hover").parent().parent().width();if(c&&!(c<=a)){var d=b(".apl_popover_hover .apl_message").width();d&&(a=c-a+d,c=parseInt(b(".apl_popover_hover .apl_message").css("max-width"),10),!isNaN(c)&&c!==a&&60<=a&&b(".apl_popover_hover .apl_message").css("max-width",a+"px"))}}}}});e.registeredDPApplicablePromotionListComponent=!0}),g.when("A","ready").execute(function(d){var b=d.$("#applicable_promotion_list_sec"),a=d.$("#mediaTabsGroup #mediaAccordion");a&&a.length&&b&&b.length&& ((a=d.$("#mediaTabsGroup #newOfferAccordionRow"))&&a.length||b.addClass("a-hidden"),d.on("a:accordion:media-accordion:select",function(a){"media-newOffer-accordion"===a.selectedRow.rowName?b.removeClass("a-hidden"):b.addClass("a-hidden")}))}));"use strict";e.P&&g.when("A","ready").execute(function(d){var b=d.$;e.registeredDPApplicablePromotionListClaimCodeButtonComponent||g.register("registeredDPApplicablePromotionListClaimCodeButtonComponent",function(){return{init:function(){e.registeredDPApplicablePromotionListClaimCodeButtonPageStates|| (d.state("aplDetailPageRedemption",{redeemedCoupons:[]}),d.state("aplDetailpageStateData",{visitedAsins:[]}),e.registeredDPApplicablePromotionListClaimCodeButtonPageStates=!0)},isAplVisitedAsins:function(a){var c=d.state("aplDetailpageStateData"),f=c?c.visitedAsins:null;if(f)if(-1<b.inArray(a,f)){if(a=(a=d.state("aplDetailPageRedemption"))?a.redeemedCoupons:null)for(c=0;c<a.length;c++)f=a[c],b("#RedeemB_"+f).addClass("a-hidden"),b("#RedeemM_"+f).removeClass("a-hidden"),0!==b("#hvaCoupon .apl_badgeHvaCoupon").length&& b("#hvaCoupon .apl_badgeHvaCoupon").addClass("apl_badgeHvaCoupon_redeemed")}else f.push(a),c.visitedAsins=f,d.state("aplDetailpageStateData",c)},bindClaimPromoEvent:function(){b(".apl_redeem").click(function(){var a=d.$(this).attr("id");b("#RedeemB_"+a).addClass("a-button-disabled");b.ajax({url:"/gp/collect-coupon/handler/redeem-coupon-detailpage.html?ref_\x3dapl_redeem_coupon",type:"POST",data:{encryptedPromotionId:a},dataType:"json",success:function(c){if(1==c.status){b("#RedeemB_"+a).addClass("a-hidden"); b("#RedeemM_"+a).removeClass("a-hidden");g.when("PromotionUpellComponent").execute(function(b){b.showRedeemedNote(a)});var f=(c=d.state("aplDetailPageRedemption"))?c.redeemedCoupons:null;if(f){for(var k=!1,l=f.length;l--;)if(f[l]===a){k=!0;break}k||(f.push(a),c.redeemedCoupons=f,d.state("aplDetailPageRedemption",c))}}else e.location.reload()},error:function(){e.location.reload()}})});b(".apl_login").click(function(){var a=b(this).attr("id"),c=encodeURIComponent(e.location.pathname);e.location.href= "/gp/collect-coupon/handler/redeem_coupon_after_login.html?path\x3d"+c+"\x26encryptedPromotionId\x3d"+a})},showRedeemedNote:function(a){if(b("#RedeemB_"+a).length){b("#RedeemB_"+a).addClass("a-hidden");b("#RedeemM_"+a).removeClass("a-hidden");var c=d.state("aplDetailPageRedemption"),f=c?c.redeemedCoupons:null;if(f){for(var e=!1,g=f.length;g--;)if(f[g]===a){e=!0;break}e||(f.push(a),c.redeemedCoupons=f,d.state("aplDetailPageRedemption",c))}}}}});e.registeredDPApplicablePromotionListClaimCodeButtonComponent= !0})}); /* ******** */ (function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DeliveryStaticPackard",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","GLUXWidget").execute(function(a,b){a.on("packard:glow:destinationChangeAll",function(){c.location.reload()})});b.when("A","GlowTriggerMetrics","a-modal").register("dpContextualIngressPtTrigger",function(a,c,f){function b(d){c.logGLOWTriggerCountFromIngress(c.getEvents().cip.desktop); var e=f.get(a.$("#nav-global-location-slot"));e&&(d.$event.preventDefault(),e.show())}a.declarative("dpContextualIngressPt","click",function(a){b(a)});return{showGlowModal:b}});b.when("A").register("GlowTriggerMetrics",function(a){var b={cip:{desktop:"cip.desktop",mobileWeb:"cip.mobileWeb",tabletApp:"cip.tabletApp",mobileApp:"cip.mobileApp",micron:"cip.micron"},glowTop:{tabletApp:"glow-top.tabletApp",mobileApp:"glow-top.mobileApp",micron:"glow-top.micron"},gpsOnLoad:{nativeApp:"gpsOnLoad.nativeApp"}, unknown:{nativeApp:"unknown.nativeApp"}};return{getEvents:function(){return b},logGLOWTriggerCountFromIngress:function(a){a="GLOWTrigger."+a;c.ue?c.ue.count(a,1):(a="Failed to increment metrics counter: "+a+" because window.ue is not present.",c.ueLogError&&a&&c.ueLogError({message:a},{logLevel:"ERROR",attribution:"GLOWTrigger"}))}}});b.when("BottomSheetPlugin").register("GlowOpener",function(a){return{openGlow:function(b){a.ShowBottomSheet(b)}}})}); /* ******** */ (function(l){var n=window.AmazonUIPageJS||window.P,q=n._namespace||n.attributeErrors,a=q?q("DeliveryStatic",""):n;a.guardFatal?a.guardFatal(l)(a,window):a.execute(function(){l(a,window)})})(function(l,n,q){l.when("A","jQuery","ready").register("DeliveryCountdownComponent",function(a,b){function h(a,b,f,c,d){this.strings=a;this.asin=b;this.deliveryMessageSectionId=f;this.countdownElementId=c;this.secondsLeft=d;this.intervalHandle=null}n.DeliveryCountdownHandler=function(a){var b=a.strings,f=a.asin, c=a.deliveryMessageSectionId,d=a.fastCountdownElementId,m=a.cheapCountdownElementId;this.cheapCountdownTimer=this.fastCountdownTimer=null;this.start=function(a,k){0<a&&(this.fastCountdownTimer=new h(b,f,c,d,a),this.fastCountdownTimer.start());0<k&&(this.cheapCountdownTimer=new h(b,f,c,m,k),this.cheapCountdownTimer.start())};this.stop=function(){this.fastCountdownTimer&&(this.fastCountdownTimer.stop(),this.fastCountdownTimer=null);this.cheapCountdownTimer&&(this.cheapCountdownTimer.stop(),this.cheapCountdownTimer= null)}};h.prototype.start=function(){var b=this;this.intervalHandle=a.interval(function(){b&&b.updateCountdownText()},1E3)};h.prototype.stop=function(){this.intervalHandle&&n.clearInterval(this.intervalHandle)};h.prototype.updateCountdownText=function(){this.secondsLeft--;if(0<this.secondsLeft){var a=Math.floor(this.secondsLeft/60),g=a%60,a=Math.floor(a/60),f=this.secondsLeft%60,c=this.strings.inNext,d=1<a?this.strings.hours:this.strings.hour,m=1<g?this.strings.minutes:this.strings.minute,p=1<f?this.strings.seconds: this.strings.second,h=this.strings.timeSeperator,g=0<a&&0<g?a+h+d+h+g+h+m+h+c:0<a&&0===g?a+h+d+c:0===a&&0<g?g+h+m+c:f+h+p+c;b(this.countdownElementId).html(g)}else this.stop(),g="\x3ca href\x3d'javacript:window.location.reload();'\x3e"+this.strings.refreshTimeout+"\x3c/a\x3e",b(this.deliveryMessageSectionId).html(g)}});l.when("A","jQuery","LUXContext").register("LUXController",function(a,b,h){function k(){return{addressLabel:m,addressId:p,obfuscatedId:r,countryCode:e,zipCode:w,state:u,city:v,district:t, locationType:q}}function g(a){m=a.addressLabel;p=a.addressId;r=a.obfuscatedId;e=a.countryCode;w=a.zipCode;u=a.state;v=a.city;t=a.district;q=a.locationType}function f(e,c,b){e=a.copy(e);e.deviceType=h.deviceType;e.pageType=d;e.actionSource="locux";a.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:e,success:function(e){if(e.sembuUpdated){e.address&&g(e.address);var d=k();h.fullPageRefresh?(l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}), n.location.reload()):(a.trigger("DeliveryAddressDropdown_OnSembuUpdateSuccess",d),a.trigger("DeliveryAddressDropdown_OnAddressChange",d),c&&c(),l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}))}else b&&b()},error:function(){a.trigger("DeliveryAddressDropdown_OnSembuUpdateFail",k());b&&b()}})}var c=!1,d=null,m,p,r,e,w,u,v,t,q;return{locationChangeEventName:"DeliveryAddressDropdown_OnAddressChange",locationTypes:{defaultAddress:"DEFAULT_ADDRESS",accountAddress:"ACCOUNT_ADDRESS", lockerAddress:"LOCKER_ADDRESS",locationInput:"LOCATION_INPUT",realmDefault:"REALM_DEFAULT",region:"REGION",country:"COUNTRY",ip2location:"IP2LOCATION"},init:function(e){l.when("LUXResponder").execute(function(d){c?a.equals(e,k())||(g(e),d.refresh()):(g(e),d.activate(),c=!0)});l.when("LUXCustom").execute(function(a){a.activate()});l.when("LUXMetrics").execute(function(a){d=a.getPageType()})},getLocationData:function(){return k()},changeLocation:function(a,e,c){f(a,e,c)}}});l.when("A","LUXDPOnly").register("LUXDPRefreshController", function(a){function b(a){d=a;h({addressId:d.addressId,zipCode:d.zipCode,city:d.city,state:d.state,district:d.district,countryCode:d.countryCode,relatedRequestId:d.relatedRequestId});var b={asin:d.asin,merchantId:d.merchantId,deviceType:d.deviceType,smid:d.smid,wdg:d.wdg,exMerchId:d.exMerchId,oneClick:d.oneClick};l.when("UnifiedLocationUpdateHandler").execute(function(a){a.init(b);c=a});k(d.obfuscatedId);g(d.obfuscatedId)}function h(c){var d=f('#buybox select[name\x3d"quantity"]').val()||1;a.state("unifiedLocation", {addressId:c.addressId,zipCode:c.zipCode,city:c.city,state:c.state,district:c.district,countryCode:c.countryCode,quantity:d,relatedRequestId:c.relatedRequestId})}function k(c){if(d&&d.oneClick){var b="unifiedLocation1ClickAddress";d.deviceType&&"mobileApp"===d.deviceType&&(b="addressID");c||(c=f("#"+b).data("addnewaddress"))||(c="new");b='[id\x3d"'+b+'"]';0<f(b).length&&f(b).val(c);if(d.deviceType&&d.deviceType in m&&(b=a.state("buyNowInfo"))){var e=b.urlParams,e=0<e.indexOf("addressID\x3d")?e.replace(/(addressID=)[^&]*/, "$1"+c):e+"\x26addressID\x3d"+c;b.urlParams=e;a.state("buyNowInfo",b)}}}function g(a){d&&!d.oneClick&&"T1"===d.updateAddressForNon1Click&&(a||(a=f("#unifiedLocationAddress").data("addnewaddress")),1===f("#unifiedLocationAddress").length&&f("#unifiedLocationAddress").val(a))}var f=a.$,c=null,d=null,m={tabletApp:1,tabletLargeApp:1,iPad:1};a.on("DeliveryAddressDropdown_OnAddressChange",function(b){var d=a.state("unifiedLocation")?a.state("unifiedLocation").relatedRequestId:q;b.relatedRequestId=d;h(b); k(b.obfuscatedId);g(b.obfuscatedId);null!==c&&(c.refresh(),a.trigger("LocationUX_OnAddressChange",b))});a.on("UnifiedLocationPostRefresh",function(){a.trigger("diodeAjaxRefreshed")});return{init:function(a){b(a)},updateFeaturesForNewQuantitySelection:function(b){h(b);null!==c&&(c.refresh(),a.trigger("LocationUX_OnAddressChange",b))}}});l.when("A","LUXController","LUXDPRefreshController","LUXDPOnly").register("LUXDPQuantityRefresh",function(a,b,h){a.declarative("quantity-dropdown","change",function(a){a= b.getLocationData();h.updateFeaturesForNewQuantitySelection(a)})});l.when("A","detailPage:RefreshHandler","LUXDPOnly","a-state").execute(function(a,b){l.register("TwisterUpdateHandler",function(){return{init:function(b){a.state("unifiedLocation",b)},refresh:function(){var h=b.getHandlerInstance("LocationUX"),k=[],g="addressId zipCode city state district countryCode relatedRequestId".split(" ");if(h){var f=a.state("unifiedLocation"),c;for(c in f)if(f.hasOwnProperty(c)&&-1<a.$.inArray(c,g)){var d=typeof f[c]; ("number"===d||"boolean"===d||"string"===d||f[c]instanceof String)&&k.push(h.getURLParamObject(c,null===f[c]?"":f[c],1))}}0<k.length&&h.doPageRefresh(k)}}})});l.when("A","LUXDPOnly","a-state").execute(function(a){l.register("UnifiedLocationUpdateHandler",function(){return{init:function(c){a.state("unifiedLocation",c)},refresh:function(){b=2;h()}}});var b=0,h=function(){var c=a.state("unifiedLocation");c.urlParams=JSON.stringify(c.urlParams);for(var b in c)if(c.hasOwnProperty(b)){var m=typeof c[b]; "number"===m||"boolean"===m||"string"===m||c[b]instanceof String||(null===c[b]?c[b]="":delete c[b])}c&&c.asin&&c.merchantId&&(a.trigger("UnifiedLocationPreRefresh"),a.ajax("/gp/product/features/unified-location/udp/refresh-features.html?_encoding\x3dUTF-8",{params:c,method:"POST",success:k,error:g,abort:f}))},k=function(){a.trigger("UnifiedLocationPostRefresh",!0)},g=function(){a.trigger("UnifiedLocationPostRefresh",!1);0<--b&&h()},f=function(c){a.trigger("UnifiedLocationPostRefresh",!1)}});l.when("A", "jQuery","LUXContext","LUXWidgetConfig","LUXUtils","LUXController","LUXMetrics","ready").register("LUXResponder",function(a,b,h,k,g,f,c){function d(a){b("#unifiedLocationAddrInput").trigger("updateAlerts",[a]);1===a?(b("#unifiedLocationAddrInput").addClass("a-form-error"),b("#LUXInvalidZipCodeAlert").width(b("#LUXInvalidZipCodeAlert").parent().width()).removeClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden")):2===a?(b("#unifiedLocationAddrInput").removeClass("a-form-error"), b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").width(b("#LUXMilitaryZipCodeAlert").parent().width()).removeClass("aok-hidden")):3===a&&(b("#unifiedLocationAddrInput").removeClass("a-form-error"),b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden"))}function m(a){b(".lux-location-label").html(g.generateLocationLabel(a))}function p(c){b("#LUXAddressSelections input[type\x3dradio]:checked").attr("checked",!1);var e= b("#LUXAddressSelections .a-declarative").has(".a-radio input[type\x3dradio]");c=c.addressId;for(var d=e.length-1;0<=d;d--)if(a.parseJSON(e[d].getAttribute("data-lux-address-selection")).addressId===c){b(".a-radio input[type\x3dradio]",e[d]).attr("checked",!0);break}}function r(a){a=a.locationType===f.locationTypes.locationInput&&a.zipCode?a.zipCode:"";b("#unifiedLocationAddrInput").trigger("updateZipCodeField",a);b("#unifiedLocationAddrInput").val(a);d(3)}function e(c){l.when("a-dropdown").execute(function(e){e= e.getSelect(k.countrySelectorComponentName);a.objectIsEmpty(e)||(c.locationType===f.locationTypes.country||c.locationType===f.locationTypes.region||c.locationType===f.locationTypes.ip2location&&!c.state?e.setValue(g.mapLocationDataToCode(c)):e.setValue(""))})}function q(){a.post("/gp/delivery/ajax/get-country-selections.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:g.prepareCountrySelectionGeneratorInput(),success:function(a){b("#unifiedLocationCountrySelectionDiv").html(a); e(f.getLocationData())}})}function u(a){f.changeLocation(a.data,null,function(){p(f.getLocationData())})}function v(a){f.changeLocation(g.mapCodeToLocationData(a.value),null,function(){e(f.getLocationData())})}function t(){var a=b("#unifiedLocationAddrInput").val();g.validateZipCode(a)?f.changeLocation({zipCode:g.preprocessZipCode(a),locationType:f.locationTypes.locationInput},function(){d(3)},function(){d(1)}):g.isMilitaryZipCode(a)?d(2):d(1)}function z(){l.when(k.addressSelectorComponentType).execute(function(a){a.get(k.addressSelectorComponentName)&& a.get(k.addressSelectorComponentName).hide()})}function x(){var a=b("#LUXAddressSelections .a-radio"),e=b("#LUXAddressSelections .a-radio.aok-hidden"),a=a.length===e.length;e.slice(0,a?k.initialAddressLoadCount:k.addressReloadCount).removeClass("aok-hidden");0===b("#LUXAddressSelections .a-radio.aok-hidden").length&&(b("#LUXSeeMoreAddressLink").addClass("aok-hidden"),b("#LUXAddressActionSeparator").addClass("aok-hidden"));a||c.logEvent(c.getEvents().click.seeMore)}function y(a){m(a);p(a);r(a);g.shouldPopulateCountrySelector()&& e(a);z()}function A(){var e=f.getLocationData();r(e);h.isRecognizedCustomer&&0===b("#LUXAddressSelections .a-radio").length&&0===b("#LUXNoAddressNote").length&&a.get("/gp/delivery/ajax/get-address-selections.html",{params:{currentAddressId:e.addressId,deviceType:h.deviceType,isOneClickFromContext:h.isOneClick,clientPage:h.clientPage},success:function(a){a&&(b("#unifiedLocationTitleNoAddress").remove(),b("#unifiedLocationAccountAddrList").remove(),b("#unifiedLocationSeeMoreDiv").remove(),b("#unifiedLocationTitleSelectAddress").remove(), b(".lux-address-selector-divider").before(a),x())}});!b.trim(b("#unifiedLocationCountrySelectionDiv").html()).length&&g.shouldPopulateCountrySelector()&&q(e);c.logWidgetView(c.getEvents().view.addressSelector)}return{activate:function(){var e=f.getLocationData();c.logPageView(e.locationType);e.locationType===f.locationTypes.region&&m(e);a.on("a:popover:beforeShow:"+k.addressSelectorComponentName,A);r(e);a.on(f.locationChangeEventName,y);a.declarative("lux-address-selection",["change"],u);b(document).delegate("#unifiedLocationAddrInput", "keypress",function(a){13===a.which&&t()});b(document).delegate("#unifiedLocationAddrInput","focus",function(){d(3)});b(document).delegate("#unifiedLocationAddrUpdate","click",t);b(document).delegate("#unifiedLocationSignIn","click",function(){c.logEvent(c.getEvents().click.signIn);var a=k.signInURL+n.location.pathname;"Search"===c.getPageType()&&(a+=n.location.search);n.location.href=a});b(document).delegate("#LUXSeeMoreAddressLink","click",x);b(document).delegate(".lux-manage-address-link","click", function(a){c.logEvent(c.getEvents().click.manageAddressBook);return!0});a.on("a:dropdown:"+k.countrySelectorComponentName+":select",v)},refresh:function(a){y(f.getLocationData())}}});l.declare("LUXWidgetConfig",{addressSelectorComponentName:"LUXAddressSelector",addressSelectorComponentType:"a-popover",countrySelectorComponentName:"LUXCountrySelector",countrySelectorComponentType:"a-dropdown",initialAddressLoadCount:5,addressReloadCount:5,signInURL:"/gp/sign-in.html?ie\x3dUTF8\x26useRedirectOnSuccess\x3d1\x26path\x3d"}); l.when("A","jQuery","LUXController","RegionNames","ready").register("LUXRegionData",function(a,b,h,k){function g(c){if(a.objectIsEmpty(c)||!c.countryCode||!c.zipCode)return null;for(var b in f)if(f.hasOwnProperty(b)&&a.reduce(f[b],function(m,h,g){return m&&!a.objectIsEmpty(c[g])&&a.equals(c[g],f[b][g])},!0))return b;return null}var f={"GB-ML":{countryCode:"GB",zipCode:"KA10 6EB"},"GB-NI":{countryCode:"GB",zipCode:"BT1 3ES"},"GB-JE":{countryCode:"GB",zipCode:"JE2 4QA"},"GB-IS":{countryCode:"GB",zipCode:"ZE1 0BX"}, "GB-BF":{countryCode:"GB",zipCode:"BFPO 204"},"GB-HI":{countryCode:"GB",zipCode:"PH41 4PU"},"DE-ML":{countryCode:"DE",zipCode:"60313"},"DE-GI":{countryCode:"DE",zipCode:"27498"},"FR-ML":{countryCode:"FR",zipCode:"75001"},"FR-CH":{countryCode:"FR",zipCode:"20000"},"FR-GP":{countryCode:"FR",zipCode:"97100"},"FR-GY":{countryCode:"FR",zipCode:"97300"},"FR-MC":{countryCode:"FR",zipCode:"98000"},"FR-MQ":{countryCode:"FR",zipCode:"97200"},"FR-NC":{countryCode:"FR",zipCode:"98800"},"FR-PF":{countryCode:"FR", zipCode:"98700"},"FR-RE":{countryCode:"FR",zipCode:"97400"},"FR-SB":{countryCode:"FR",zipCode:"97133"},"FR-SM":{countryCode:"FR",zipCode:"97150"},"FR-SP":{countryCode:"FR",zipCode:"97500"},"FR-WF":{countryCode:"FR",zipCode:"98611"},"FR-YT":{countryCode:"FR",zipCode:"97600"},"IT-ML":{countryCode:"IT",zipCode:"20125"},"IT-II":{countryCode:"IT",zipCode:"09121"},"ES-ML":{countryCode:"ES",zipCode:"28004"},"ES-BI":{countryCode:"ES",zipCode:"07003"},"ES-CI":{countryCode:"ES",zipCode:"35005"},"BR-SP":{countryCode:"BR", zipCode:"01319900"}};return{getRegions:function(){return f},mapLocationDataToRegionCode:function(a){return g(a)},mapRegionCodeToLocationData:function(a){a=f.hasOwnProperty(a)?b.extend({},{addressLabel:k[a],countryCode:f[a].countryCode,zipCode:f[a].zipCode,state:f[a].state,city:f[a].city,locationType:h.locationTypes.region}):null;return a}}});l.when("A","jQuery","ready").register("LUXRegionConfig",function(a,b){var h=[],k="AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW".split(" "), g=/^.+$/,f=/^[ \t]*([AFD](\.?)([ \t]?)P(\.?)([ \t]?)O(\.?)[ \t]*[A-Z]{2}[ \t]*[0-9]{5}([ \-][0-9]{4})?)[ \t]*$/;return{getPrimarySelections:function(){return h},getSecondarySelections:function(){return k},getZipCodePattern:function(){return g},getMilitaryZipCodePattern:function(){return f},preprocessZipCode:function(a){return a.toUpperCase().trim()}}});l.declare("RegionNames",{"GB-ML":"UK - Mainland","GB-BF":"UK - BFPO","GB-JE":"UK - Channel Islands","GB-IS":"UK - Islands","GB-NI":"UK - Northern Ireland", "GB-HI":"UK - Scottish Highlands","DE-ML":"Germany - Mainland","DE-GI":"German Islands","FR-ML":"France - Mainland","FR-CH":"Corsica","FR-GP":"Guadeloupe","FR-GY":"Guyane","FR-MC":"Monaco","FR-MQ":"Martinique","FR-NC":"New Caledonia","FR-PF":"French Polynesia","FR-RE":"Reunion","FR-SB":"Saint Barthélemy","FR-SM":"Saint Martin","FR-SP":"Saint Pierre and Miquelon","FR-WF":"Wallis and Futuna Islands","FR-YT":"Mayotte","IT-ML":"Italy - Mainland","IT-II":"Italian Islands","ES-ML":"Spain - Mainland","ES-BI":"Spain - Balearic Islands", "ES-CI":"Spain - Canary Islands, Ceuta and Melilla","BR-SP":"Brazil"});l.declare("CountryNames",{AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AN:"Netherlands Antilles",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Aland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi", BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Saint Eustatius and Saba",BR:"Brazil",BS:"Bahamas, The",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, The Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote D'ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CS:"Serbia and Montenegro",CU:"Cuba", CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States of",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar", GL:"Greenland",GM:"Gambia, The",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and the McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic of",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica", JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"Korea, Democratic People's Republic of",KR:"Korea, Republic of",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao People's Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova, Republic of",ME:"Montenegro",MF:"Saint Martin", MG:"Madagascar",MH:"Marshall Islands",MK:"Macedonia, The Former Yugoslav Republic of",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru", PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestinian Territories",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia", SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic of",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands", US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",YU:"Yugoslavia",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"});l.when("A","jQuery","LUXController","LUXRegionData","LUXRegionConfig","LUXContext","CountryNames","RegionNames").register("LUXUtils",function(a,b,h,k,g,f,c,d){function m(e){return!a.objectIsEmpty(e)&& e.countryCode&&c.hasOwnProperty(e.countryCode)?a.equals(e.locationType,h.locationTypes.country)?e.countryCode:a.equals(e.locationType,h.locationTypes.region)?k.mapLocationDataToRegionCode(e):k.mapLocationDataToRegionCode(e)||e.countryCode:null}function p(a){return c.hasOwnProperty(a)?c[a]:d.hasOwnProperty(a)?d[a]:null}function l(e){var b={};if(!a.objectIsEmpty(e))for(var c=e.length,d=0;d<c;d++)b[p(e[d])]=e[d];return b}return{getNameForCode:function(a){return p(a)},mapCodeToLocationData:function(a){a= a?c.hasOwnProperty(a)?{countryCode:a,locationType:h.locationTypes.country,district:a}:k.mapRegionCodeToLocationData(a):null;return a},mapLocationDataToCode:function(a){return m(a)},generateLocationLabel:function(a){a.addressLabel?a=a.addressLabel:a.locationType!==h.locationTypes.region&&a.locationType!==h.locationTypes.country&&a.zipCode?(g.formatZipCodeForAddressLabel&&(a.zipCode=g.formatZipCodeForAddressLabel(a.zipCode)),a=a.city||a.state?g.generateDiffLocationLabelForZip?g.generateDiffLocationLabelForZip(a): (a.city?a.city+", ":"")+(a.state?a.state+" ":"")+a.zipCode:g.formatZipCodeForAddressLabel?a.zipCode:p(m(a))):a=p(m(a));return a},prepareCountrySelectionGeneratorInput:function(){return{deviceType:f.deviceType,primarySelections:JSON.stringify(l(g.getPrimarySelections())),primarySelectionsOrder:JSON.stringify(g.getPrimarySelections()),secondarySelections:JSON.stringify(l(g.getSecondarySelections()))}},validateZipCode:function(b){return!a.objectIsEmpty(b)&&g.getZipCodePattern().test(b.toUpperCase())}, preprocessZipCode:function(a){return g.preprocessZipCode(a)},isMilitaryZipCode:function(b){return!a.objectIsEmpty(b)&&g.getMilitaryZipCodePattern().test(b.toUpperCase())},shouldPopulateCountrySelector:function(){var a=!0;"undefined"!==typeof f.shouldPopulateCountrySelector&&(a=f.shouldPopulateCountrySelector);return a}}});l.when("A","jQuery","LUXContext","ready").register("LUXMetrics",function(a,b,h){function k(a,b){n.ueLogError&&a&&n.ueLogError({message:a},{logLevel:b||"ERROR",attribution:"LocationUX"})} function g(a){n.ue?n.ue.count(a,(n.ue.count(a)||0)+1):k("Failed to increment metrics counter: "+a+" because window.ue is not present.","ERROR")}function f(){var b;if(b=n.ue_pty)a:{b=n.ue_pty;for(var d in c)if(c.hasOwnProperty(d)&&-1!==a.indexOfArray(c[d],b)){b=!0;break a}b=!1}return b?n.ue_pty:"unrecognizedPage"}var c={detail:["Detail","DetailAW","DetailWebView","TabletUDP"],search:["Search","SearchAW"],offerListing:["OfferListing","OfferListingAW","OfferListingMobileAppAW"]},d={click:{signIn:"click.signIn", seeMore:"click.seeMore",manageAddressBook:"click.manageAddressBook"},view:{page:"view.page",addressSelector:"view.addressSelector",countrySelector:"view.countrySelector"},selection:"selection",override:"override"};return{getPageType:function(){return f()},getEvents:function(){return d},logLocationChange:function(b){l.when("LUXController").execute(function(k){var l=f(),e="LocationUX."+l,e=a.equals(b,k.locationTypes.locationInput)||a.equals(b,k.locationTypes.realmDefault)||a.equals(b,k.locationTypes.ip2location)? e+("."+d.override+"."+b):e+("."+d.selection+"."+b);a.equals(b,k.locationTypes.defaultAddress)||a.equals(b,k.locationTypes.accountAddress)||a.equals(b,k.locationTypes.lockerAddress)||(e+="."+(h.isRecognizedCustomer?"recognized":"unrecognized"));-1!==a.indexOfArray(c.detail,l)&&h.isRecognizedCustomer&&(e+="."+(h.isOneClick?"1Click":"Non1Click"));g(e)})},logPageView:function(b){l.when("LUXController").execute(function(k){var l=f(),e="LocationUX."+l+"."+d.view.page+"."+b;a.equals(b,k.locationTypes.defaultAddress)|| a.equals(b,k.locationTypes.accountAddress)||a.equals(b,k.locationTypes.lockerAddress)||(e+="."+(h.isRecognizedCustomer?"recognized":"unrecognized"));-1!==a.indexOfArray(c.detail,l)&&h.isRecognizedCustomer&&(e+="."+(h.isOneClick?"1Click":"Non1Click"));g(e)})},logWidgetView:function(b){var d=f();b="LocationUX."+d+"."+b+"."+(h.isRecognizedCustomer?"recognized":"unrecognized");-1!==a.indexOfArray(c.detail,d)&&h.isRecognizedCustomer&&(b+="."+(h.isOneClick?"1Click":"Non1Click"));g(b)},logEvent:function(a){a= "LocationUX."+f()+"."+a;g(a)},logError:function(a,b){k(a,b)}}})}); /* ******** */ (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(f){var n=window.AmazonUIPageJS||window.P,p=n._namespace||n.attributeErrors,a=p?p("DetailPageDesktopOffersAssets",""):n;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,n,p){f.when("A").register("add-to-form",function(a){return{addInputToForm:function(a,b,l,c){var g=document.createElement("input");g.id=a;g.type="hidden";g.name=l;g.value=c;b.appendChild(g)}}});"use strict";f.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form","afterLoad").execute("giftOptions-autoUpdate", function(a,e,b,l){var c=a.$;c("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){if(c(this).is(":checked")){var a=e.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.GIFTOPTIONS),h=c(this).get(0).form;h&&l.addInputToForm("giftCheckBoxInput",h,a,"true")}})});"use strict";f.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form").execute("giftOptions-update",function(a,e,b,l){function c(){g("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){g(this).change(function(){if(g(this).is(":checked")){var a= e.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.GIFTOPTIONS),c=g(this).get(0).form;c&&l.addInputToForm("giftCheckBoxInput",c,a,"true")}else(a=g('[id\x3d"giftCheckBoxInput"]'))&&a.remove()})})}var g=a.$;c();a.on("a:pageUpdate",function(){c()})});"use strict";f.when("A","add-to-cart-parameter-name","add-to-cart-constants","dp-get-offerDisplay-container").execute("quantity-update",function(a,e,b,l){function c(d){if(d&&d.value!==p&&d.nativeItemNode&&d.nativeItemNode.form!==p){var a=h(d.nativeItemNode.form); a&&(a=a.find(k))&&a.val(d.value);a=l.getOfferDisplayContainerByElement(h(d.nativeItemNode));g(a,"form#addToCart",q,d.value);g(a,"form#buyNow","quantity",d.value)}}function g(a,b,c,e){0<a.length&&b&&(a=a.find(b+" input[name\x3d'"+c+"']"),0<a.length&&a.val(e))}var h=a.$,q=e.constructParameterName(b.ITEM_TYPES.BASE,0,b.PARAMETER_PATHS.QUANTITY),k='input[name\x3d"'+q+'"]';a.on("addToCartQuantityChange",c);a.on("a:dropdown:quantity:select",c)});"use strict";f.when("jQuery","a-popover","A","a-dropdown", "moq-core","ready").register("moq",function(a,e,b,l,c){function g(m,d){0===l.getSelect(d).val().length?c.lockSubmission(m,a.noop,u):c.unlockSubmission(m,f)}function h(m){m=c.findMoqOfferContainerWithDomElement(m.nativeItemNode);if(null!==m){var a=m.find("#quantity, #rcxsubsQuan");g(m,a);c.tweakDisplayTextForMoqQuantityDropdown(a)}}function q(a){return c.findMoqOfferContainerWithDomElement(a.popover.$trigger[0]).find("#quantity, #rcxsubsQuan")}function k(){t||(b.on("a:popover:beforeShow:moqAtcPopover", function(a){var m=q(a);0!==m.length&&(p(m),setTimeout(function(){m.addClass("highlightQuantityDropdownBorder")},20))}),b.on("a:popover:afterHide:moqAtcPopover",function(a){a=q(a);0!==a.length&&(a.removeClass("highlightQuantityDropdownBorder"),n(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&&n(a)}),b.on("a:dropdown:rcxsubsQuan:select",h),b.on("a:dropdown:quantity:select",h),t= !0)}function d(a){var d=a.parent().parent("div").innerWidth()-a.prev("label").outerWidth()-5;100<d&&a.width(d)}function u(a){if(null===e.get(a)){var d=c.findMoqOfferContainerWithDomElement(a[0]).find("script#moqPopoverContent");0!==d.length&&(d=d.html(),a.addClass("cursorDisabled"),e.create(a,{name:"moqAtcPopover",position:"triggerLeft",closeButton:"false",inlineContent:d}))}}function f(a){null!==e.get(a)&&(a.removeClass("cursorDisabled"),e.remove(a))}function n(a){setTimeout(function(){r--;0<r|| (a.prop("disabled",!1),a.removeClass("quantityBarGrayOut"))},370)}function p(a){r++;0===l.getSelect(a).val().length&&(a.prop("disabled",!0),a.addClass("quantityBarGrayOut"))}function v(a){var b=a.find("#quantity, #rcxsubsQuan");if(0!==b.length&&!b.hasClass("aok-hidden")){var c=l.getSelect(b);c.setValue("");null===c.val()&&c.setValue(c.options.$select[0].options[0].value);d(b);w(a);g(a,b)}}function w(a){if(0!==a.length){var b=a.find("#quantity, #rcxsubsQuan");a.click(function(){setTimeout(function(){d(b)}, 20)})}}var t=!1,r=0;return{initializeQuantitySelect:function(){var a=c.findMoqOfferContainers();0!==a.length&&(a.forEach(v),k())}}});"use strict";f.when("dp-click-counter").execute("dp-desktop-atc-click-counter",function(a){var e=document.getElementById("add-to-cart-button");e&&a.record(e,"dp-desktop-atc")});"use strict";f.when("A","ready").execute(function(a){function e(){for(var d=a.$(".offersConsistencyEnabled"),b=[],c=0;c<d.length;c++)"undefined"!=typeof d[c]&&null!=d[c]&&b.push(d[c].children); return b}function b(d){d.length&&(g=a.$("#buybox .a-accordion-active"),g.length&&(h=g.index()));h=l(h)}function l(d){var b=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");b.length&&0===b.index()&&(d+=1);return d}function c(){var b=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");b.length&&k.length&&(b=b.index(),k[0].length&&(0===b?f=0:f=k[0].length-1))}var g,h=0,f=0,k=e();b(k);c();a.on("a:pageUpdate",function(){k=e();b(k);c()});a.on("a:accordion:buybox-accordion:select", function(b){b=a.$(b.selectedRow.$row).index();b=l(b);for(var c=0;c<k.length;c++)k[c][h].style.display="none",k[c][b].style.display="block";h=b});a.on("a:tabs:offerDisplayGroup_tabs:select",function(b){b=a.$(b.selectedTab.$tab).index();for(var c=0;c<k.length;c++)k[c][0===f?f:h].style.display=0===b?"block":"none",k[c][0===f?h:f].style.display=0===b?"none":"block"})});"use strict";f.when("A","ready").execute("dp-atc-switch-endpoint",function(a){function e(){b(".natc-enabled").each(function(){b("#usedOnlyBuybox").get(0)&& b.contains(b("#usedOnlyBuybox").get(0),b(this).get(0))&&(f="dp_start-ubbf_1_glance");b(this).find("input").attr("formaction","/cart/add-to-cart/ref\x3d"+f);b(this).parents("form:first").find("input[name\x3d'smokeTestEnabled']").val("false")})}var b=a.$,f="dp_start-bbf_1_glance";e();a.on("a:pageUpdate",function(){e()})});f.when("A","ready").execute("quantity-selector-metrics",function(a){function e(a){n.ue&&n.ue.count(a,(ue.count(a)||0)+1)}a.on("a:dropdown:select",function(a){try{var b=a.name,c=a.value; if("quantity"===b||"rcxsubsQuan"===b)e("desktop:quantitySelected_"+c),1<c&&e("desktop:quantitySelected:moreThanOne")}catch(g){e("desktop:quantitySelected:error")}})})}); /* ******** */ (function(m){var p=window.AmazonUIPageJS||window.P,x=p._namespace||p.attributeErrors,r=x?x("VasUpsellWidgetAsset",""):p;r.guardFatal?r.guardFatal(m)(r,window):r.execute(function(){m(r,window)})})(function(m,p,x){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(d,b){var a=function(a,b,c){p.ueLogError&&p.ueLogError(a,{message:c,logLevel:"WARN",attribution:b})},f=function(a,c){a&&0<a.length?(c?(a=(new b.DetailPageInstrumentationBuilder(a)).setProductAsin(c.productAsin).setSelectedUpsellAsin(c.upsellAsin).setPageType(c.pageType).setSubPageType(c.subPageType).setMerchantId(c.merchantId).setSelectedUpsellPrice(c.upsellAsinPrice).setProductPrice(c.productAsinPrice).setHitType(c.hitType|| "popUp"),"undefined"!==typeof c.additionalRequestData&&(a=a.setPostalCode(c.additionalRequestData.zip).setPromo(c.additionalRequestData.promo).setIsCritical(c.additionalRequestData.crtcl).setDeviceType(c.additionalRequestData.dt).setIsBuyBoxAvailable(c.additionalRequestData.ibba).setIsMbcClick(c.additionalRequestData.mbc).setUpsellAsins(c.additionalRequestData.services).setProductAsin(c.productAsin||c.additionalRequestData.asin)),a=a.build()):a=(new b.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"})},e=function(a,b,c){var e="";a&&b&&c&&(e=a+"_"+b+"_"+c);return e},h=function(a,b,c,e){var d="";a&&b&&c&&e&&(d=a+"_"+b+"_"+c+"_"+e);return d},c=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,c,e){a({message:b},c,e)},log:function(a){p.ueLogError&&p.ueLogError(a,{logLevel:"ERROR",attribution:"ppd-bundles"})},logFatal:function(a,b,c){p.ueLogError&&p.ueLogError({message:a},{message:c,logLevel:"FATAL",attribution:b})},logException:function(a,b,c){p.ueLogError&&p.ueLogError(a, {message:c,logLevel:"ERROR",attribution:b})},logRefTag:function(a,c,e,d,f,h,w,t,H){a?(c=(new b.DetailPageInstrumentationBuilder(a)).setProductAsin(w).setSelectedUpsellAsin(d).setPageType(c).setSubPageType(e).setMerchantId(h).setSelectedUpsellPrice(t).setProductPrice(H).setHitType(f||"popUp"),c=c.build(),c.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:c,getCSMName:e,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,c){a=this.getCSMName(a,b,c);this.logCSMCounter(a);return a},logHit:f,createRefMarkerAndLog:function(a,b,c,e,d){a=this.getRefMarker(a,b,c,e);this.logHit(a, d);return a},logReftagAndCSMMetricForWidgetAction:function(a,b,d,q,n){var u=e(q,b,a);c(u);a=h(q,d,b,a);f(a,n)},hitParameterKeys:{upsellAsin:"upsellAsin",productAsin:"productAsin",pageType:"pageType",subPageType:"subPageType",upsellAsinPrice:"upsellAsinPrice",productAsinPrice:"productAsinPrice",hitType:"hitType",additionalRequestData:"additionalRequestData",merchantId:"merchantId",zipCode:"zip"},CSMActionTypes:{glanceView:"gv",addToCart:"att",buyBack:"bbk",buyNow:"bnw",serviceIncluded:"incl",serviceNotIncluded:"cncl", expandBulletPoints:"expbp",collapseBulletPoints:"colbp",redirect:"redir",skip:"skip",escape:"escape"},RefmarkerActionTypes:{glanceView:"gv",glanceViewDisabled:"gvDis",addToCart:"att",buyBack:"bbk",buyNow:"bnw",serviceIncluded:"incl",serviceNotIncluded:"cncl",expandBulletPoints:"expbp",collapseBulletPoints:"colbp",redirect:"redir",hyperLinkClick:"click",popoverShow:"popshow"}}});"use strict";m.when("A","vas-widget-const","vas-value-prop-logger","vas-value-prop-constants","ready").register("vas-value-prop-controller", function(d,b,a,f){var e=d.$,h=b.COMMON.DOM.VALUE_PROP_BUY_BOX_SLOT,c=f.VALUE_PROP_T1_WIDGET_NAME,g=function(){var b,g;d.each(e("#"+h).find("[data-a-state]"),function(f,h){g=d.parseJSON(e(f).attr("data-a-state")).key;"vas-value-prop-widget-vm"===g&&(b=d.parseJSON(e(f).html()),a.logGlanceViewRefTagAndCSM(b,c))})};b=function(){g();d.off(f.POPOVER_SHOW_EVENT);d.on(f.POPOVER_SHOW_EVENT,function(b){a.logPopoverShowRefTagAndCSM(c)});e(document.body).undelegate(f.HYPERLINK_TEXT_ID,f.CLICK_EVENT);e(document.body).delegate(f.HYPERLINK_TEXT_ID, f.CLICK_EVENT,function(){a.logHyperLinkClickRefTagAndCSM(c)})};b();return{initialize:b}});"use strict";m.when("A","vas-metrics-publisher").register("vas-value-prop-logger",function(d,b){var a=function(a){return{pageAsin:a.productAsin,services:f(a),zip:a.zipCode,additionalRequestData:{zip:a.zipCode,services:f(a)}}},f=function(a){var b=[];d.each(a.serviceOptions,function(a){b.push(a.serviceAsin)});return b},e=function(a,b){return["vas",b,a].join("_")};return{logHyperLinkClickRefTagAndCSM:function(a){b.logHit(e(b.RefmarkerActionTypes.hyperLinkClick, a));b.logCSMCounter(e(b.RefmarkerActionTypes.hyperLinkClick,a))},logPopoverShowRefTagAndCSM:function(a){b.logHit(e(b.RefmarkerActionTypes.popoverShow,a));b.logCSMCounter(e(b.RefmarkerActionTypes.popoverShow,a))},logGlanceViewRefTagAndCSM:function(d,c){b.logHit(e(b.RefmarkerActionTypes.glanceView,c),a(d));b.logCSMCounter(e(b.RefmarkerActionTypes.glanceView,c))}}});"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(d){return typeof d}:function(d){return d&&"function"===typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};m.register("vas-utilities",function(d){return{generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var a=16*Math.random()| 0;return("x"===b?a:a&3|8).toString(16)})},getPriceValue:function(b){var a=/[+-]?\d+(\.\d+)?/g;if(null!==b.match(a))return b.match(a).map(function(a){return parseFloat(a)})[0]},validateZipCode:function(b,a){return(new RegExp(a.val())).test(b)?!0:!1},flattenObject:function a(d){var e={};if(null==d)return e;Object.keys(d).forEach(function(h){var c=d[h];if("object"===("undefined"===typeof c?"undefined":r(c))){var g="["+h+"]",k=a(c);Object.keys(k).forEach(function(a){e[g+a]=k[a]})}else e["["+h+"]"]=d[h]}); return e}}});"use strict";"use strict";m.when("A","vas-common-settings","vas-metrics-publisher","vas-mobile-config").register("vas-metric-utils",function(d,b,a,f){var e=f.mobileMetricConstants;return{createHitParameters:function(e){var c=b.getSetting("widgetCommonVM"),d=b.getSetting("winningWidgetVM"),f={},l={},d=d.baseAsinOfferData===x?d:d.baseAsinOfferData;l[e.additionalRequestDataKeys.zipCode]=c.zipCode;f[a.hitParameterKeys.productAsin]=c.productAsin;f[a.hitParameterKeys.upsellAsin]=d.upsellAsin; f[a.hitParameterKeys.merchantId]=c.merchantId;f[a.hitParameterKeys.productAsinPrice]=c.buyboxPrice;f[a.hitParameterKeys.pageType]=e.hitRecordConstants.pageType;f[a.hitParameterKeys.upsellAsinPrice]=d.winningServiceMinPrice;f[a.hitParameterKeys.subPageType]=e.hitRecordConstants.subPageType;f[a.hitParameterKeys.additionalRequestData]=l;return f},createHitParametersForVSX:function(b,c){var e={},f={},l=d.state("vas-base-vm");"undefined"!==typeof l&&"undefined"!==typeof b&&(f[c.additionalRequestDataKeys.zipCode]= l.zipCode,f[c.additionalRequestDataKeys.deviceType]="mobile",e[a.hitParameterKeys.productAsin]=l.productAsin,e[a.hitParameterKeys.upsellAsin]=b.asin,e[a.hitParameterKeys.additionalRequestData]=f);return e},createGlobalHitParameters:function(e){var c={},d=b.getSetting("widgetCommonVM");if(d){if(null===e||e===x)e={};e[a.hitParameterKeys.zipCode]=d.zipCode;c[a.hitParameterKeys.additionalRequestData]=e;c[a.hitParameterKeys.productAsin]=d.productAsin;c[a.hitParameterKeys.merchantId]=d.merchantId;if(e= b.getSetting("winningWidgetVM"))c[a.hitParameterKeys.upsellAsin]=(e.baseAsinOfferData===x?e:e.baseAsinOfferData).upsellAsin}return c},getMobileMetricConstants:function(){b.getSetting("widgetCommonVM").isApp?(e.metricPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl",e.refmarkerPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"aft":"aftxl"):(e.metricPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName? "mft":"mftxl",e.refmarkerPrefixes.widget="mobiletwister"===b.getSetting("winningWidgetVM").winningWidgetName?"mft":"mftxl");return e}}});"use strict";"use strict";m.when("A","ready").register("vas-url-util",function(d){function b(a){return l.Q_STRING_REGEX.test(a)}function a(a){a=l.VAS_REGEX.exec(a);return null===a||3>=a.length?"":a[2]}function f(a,b){return a.replace(l.VAS_REGEX,"$1vas\x3d"+encodeURIComponent(b))}function e(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,c){delete b[c];b=k(b);return f(a,b)}function c(a,b){return 0!==Object.keys(a).length&&b in a?!0:!1}function g(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:b,doesVasQueryParamExist:function(a){return l.VAS_REGEX.test(a)}, getVasQueryParamValue:a,addOrUpdateKeyInVasQryParam:function(b,c,e){b=a(b);b=g(b);b[c]=e;return k(b)},replaceExistingVasParam:f,appendVasQueryParam:function(a,c){var e;e=b(a)?"\x26":"?";return a+e+"vas\x3d"+encodeURIComponent(c)},removeOrUpdateVasQryParamWithMarker:function(a,b,d){if(!c(b,d))throw Error("vas: specified key "+d+" does not exist");return 1===Object.keys(b).length?e(a):h(a,b,d)},removeVasQueryParam:e,removeMarkerFromVasQueryParam:h,doesKeyExist:c,parseSingleQuotedStringAsJson:g,stringifyJsonWithSingleQuotes:k}}); "use strict";m.when("A","vas-common-settings","ready").register("vas-detailpage-util",function(d,b){return{isMobbPresent:function(){var a=b.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-item-association-v2","vas_manage_forms","buyback-item-association").register("vas-core-buybox",function(d,b,a,f,e,h,c,g){function k(){var b=f.getSetting("widgetCommonVM"),c={};c.itemAssocId=a.generateUUID();c.addItemAssociation=b.isShipToStore||b.shouldAddItemAssociation||b.showUnifiedGuruExperience;return c}function l(a){try{"undefined"!==typeof a.offerlistingId&&H()&&t("add",a.offerlistingId),b.increaseMetricBy("mbcFormAppend_fail",0),b.metric("mbcFormAppend_success")}catch(c){b.increaseMetricBy("mbcFormAppend_success", 0),b.metric("mbcFormAppend_fail"),b.log(c)}}function q(){try{H()&&t("remove"),b.increaseMetricBy("mbcFormRemove_fail",0),b.metric("mbcFormRemove_success")}catch(a){b.increaseMetricBy("mbcFormRemove_success",0),b.metric("mbcFormRemove_fail"),b.log(a)}}function n(a){var b=u(w.BUY_BACK_FORM_ID),c=u(w.ADD_TO_CART_FORM_ID),c=Math.max(c.find("input[name^\x3d'asin']").length+1,b.find("input[name^\x3d'asin']").length+1);if(b.length){var d=e.getServiceQuantity(f.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled); b.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+c+'" name\x3d"quantity.'+c+'" value\x3d"'+d+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+c+'" name\x3d"asin.'+c+'" value\x3d"'+a.upsellAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+c+'" name\x3d"offeringID.'+c+'" value\x3d"'+a.offerlistingId+'" /\x3e')}}var u=d.$,w={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"},t=function(a,b){u("#mbc .a-button").each(function(){var c=u(this);c.text();var c=c.find("a")[0],e,d,f;if(c&&c.href){var g=c.href;(f=g.match(/itemCount=([0-9]+)/i))&&f[1]&&((d=parseInt(f[1],10))&&"add"===a?e=d+1:d&&"remove"===a&&(e=d-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."+ d+"\x3d[^\x26]*"),"")),c.href=g)}})},H=function(){var a=f.getSetting("widgetCommonVM");return(a.populateMBCATC||a.showFakeTwisterBundles||a.showEnhancedUpsellBundle)&&!a.showUnifiedGuruExperience},B=function(a){c.removeFieldsFromBuyBoxForm("addToCart");q();c.addFieldsInBuyBoxForm("addToCart",a.data.asinOfferData,k(),!1);l(a.data.asinOfferData);n(a.data.asinOfferData)},m={addServiceAsinBuybox:function(a){c.addFieldsInBuyBoxForm("addToCart",a,k(),!1);l(a);if(h.isEnabled)c.addFieldsInBuyBoxForm(w.MOBB_FORM_NAME, a,k(),!1);else{var b=u(w.MOBB_FORM_ID),d=b.find("input[name^\x3d'offeringID']").length+1,g=b.find('input[name\x3d"itemCount"]');if(b.length){var t=e.getServiceQuantity(f.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled),t='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+d+'" name\x3d"quantity.'+d+'" value\x3d"'+t+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+d+'" name\x3d"asin.'+d+'" value\x3d"'+a.upsellAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+ d+'" name\x3d"offeringID.'+d+'" value\x3d"'+a.offerlistingId+'" /\x3e';0===g.length?b.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+d+'"\x3e'):g[0].value=d;b.append(t)}}f.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled&&(u(document.body).undelegate(w.PRODUCT_QUANTITY_ID,"change",B),u(document.body).delegate(w.PRODUCT_QUANTITY_ID,"change",{asinOfferData:a},B))},removeServiceAsinBuybox:function(){c.removeFieldsFromBuyBoxForm("addToCart");h.isEnabled&&c.removeFieldsFromBuyBoxForm(w.MOBB_FORM_NAME); q();u(document.body).undelegate(w.PRODUCT_QUANTITY_ID,"change",B)},addServiceAsinToBuyBack:function(a){n(a)}};return{registerBuyboxEventHandlers:function(){d.off("vas:add-service-asin-buybox-event");d.on("vas:add-service-asin-buybox-event",function(a){m.addServiceAsinBuybox(a)});d.off("vas:remove-service-asin-buybox-event");d.on("vas:remove-service-asin-buybox-event",function(){m.removeServiceAsinBuybox()});d.off("vas:add-service-asin-buyback-form-event");d.on("vas:add-service-asin-buyback-form-event", function(a){g.isEnabled?c.addFieldsInBuyBoxForm("buyBackBuyNow",a,k(),!1):m.addServiceAsinToBuyBack(a)})}}});"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-association-v2","ready").register("vas_manage_forms",function(d,b,a,f,e,h,c,g){function k(a,b){var c=n("*[id\x3d"+a+"]");if("retailheavybulky"===b.mappingSet||"heavybulky"===b.mappingSet)c=c.not("#usedAccordionRow *[id\x3d"+a+"]"); return c}function l(a,b,c){var d=document.createElement("input");d.type="hidden";d.id=a;d.name=a;d.value=b;d.className=c;return d}function q(a,b){var c=h.getNatcParameters(b);Object.keys(c).forEach(function(b){a.append(l(b,c[b],"atcFormServiceAsinData"))});b.additionalParameters!==x&&b.additionalParameters.itemAssociation!==x&&"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 n=d.$,u={retailheavybulky:"RetailHeavyBulky",heavybulky:"HeavyBulky"},w="vdo_devices_display_on_website premium_ce_brands_display_on_website amazon_ereaders_display_on_website amazon_home_display_on_website amazon_shm_display_on_website amazon_smp_display_on_website amazon_tablets_display_on_website digital_devices_7_display_on_website digital_products_3_display_on_website fsn_devices_display_on_website sud_devices_display_on_website digital_accessories_3_display_on_website digital_accessories_4_display_on_website digital_accessories_5_display_on_website digital_device_acc_display_on_website".split(" "); return{addFieldsInBuyBoxForm:function(d,h,B,m){try{var p=a.getSetting("widgetCommonVM");k(d,p).each(function(){var b=n(this),d;d=m?b.find("input[name^\x3d'offeringID']").length:b.find("input[name^\x3d'offeringID']").length+1;var k=B.itemAssocId,t=d+1,z=B.addItemAssociation,v=f.getServiceQuantity(p.multiQuantityPurchaseEnabled),r=b.find('input[name\x3d"itemCount"]');0<w.indexOf(p.productWDG)&&(d=0===r.length?1:r[0].value);if("undefined"!==typeof h.offerlistingId){b.append('\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+ d+'" name\x3d"quantity.'+d+'" value\x3d"'+v+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+d+'" name\x3d"asin.'+d+'" value\x3d"'+h.serviceAsin+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+d+'" name\x3d"offeringID.'+d+'" value\x3d"'+h.offerlistingId+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"merchantID.'+d+'" name\x3d"merchantID.'+d+'" value\x3d"'+h.merchantId+'" /\x3e');if("retailheavybulky"!== p.mappingSet&&"heavybulky"!==p.mappingSet&&g.isEnabled){if(z=c.getItemAssociationData(h.upsellAsin))z=c.getIAGroupData(z),b.append(l("custom-name."+t+".1","itemAssociationGroup","atcFormServiceAsinData")),b.append(l("custom-value."+t+".1",JSON.stringify(z),"atcFormServiceAsinData"))}else if(z){var z=b.find("input[name^\x3d'custom-name."+t+"']").length+1,y=b.find("input[name^\x3d'custom-name.1']").length+1,k='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+t+"."+z+ '" name\x3d"custom-name.'+t+"."+z+'" value\x3d"itemAssoc" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+t+"."+z+'" name\x3d"custom-value.'+t+"."+z+'" 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',A;a:{A=h.asin;var D=a.getSetting("winningWidgetVM");if(D&&D.vasTwisterOptions&&D.vasTwisterOptions[A]&&(A=D.vasTwisterOptions[A].mappingSet)&&u.hasOwnProperty(A)){A=u[A];break a}A=void 0}A&&(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"'+A+'" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+t+"."+(z+1)+'" name\x3d"custom-name.'+t+"."+(z+1)+'" value\x3d"itemAssocType" /\x3e\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+t+"."+(z+1)+'" name\x3d"custom-value.'+ t+"."+(z+1)+'" value\x3d"'+A+'" /\x3e');b.append(k)}0===r.length?b.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+d+'"\x3e'):r[0].value=Math.max(d,r[0].value);m||(t=h.offerlistingId,d=h.upsellAsin,d===x&&(d=h.asin),v=(new e.AddItemData).construct(d,t,v),d=c.getItemAssociationData(d),d!==x&&(v=v.setItemAssociation(d)),q(b,v))}});b.increaseMetricBy("vas_"+d+"_FormAppend_fail",0);b.metric("vas_"+d+"_FormAppend_success")}catch(U){b.increaseMetricBy("vas_"+d+"_FormAppend_success",0), b.metric("vas_"+d+"_FormAppend_fail"),b.log(U)}},removeFieldsFromBuyBoxForm:function(c){try{n(".atcFormServiceAsinData").remove();var d=n("#"+c).find('input[name\x3d"itemCount"]');-1===w.indexOf(a.getSetting("widgetCommonVM").productWDG)&&0!==d.length&&1<=d[0].value&&--d[0].value;b.increaseMetricBy("vas_"+c+"FormRemove_fail",0);b.metric("vas_"+c+"FormRemove_success")}catch(e){b.increaseMetricBy("vas_"+c+"FormRemove_success",0),b.metric("vas_"+c+"FormRemove_fail"),b.log(e)}},addItemDataInForm:q}}); "use strict";m.when("A","vas-metrics-publisher","vas-url-util","ready").register("vas-persist-widget",function(d,b,a){return{initialize:function(){p.history&&p.history.replaceState?(d.on("vas:add-widget-state-url",function(d){try{var e;var h=a.getDecodedQueryParamString(),c=d.preSelectedWidgetValue;if(a.doesVasQueryParamExist(h)){var g=a.addOrUpdateKeyInVasQryParam(h,"vw",c);e=a.replaceExistingVasParam(h,g)}else{d={};d.vw=c;var k=a.stringifyJsonWithSingleQuotes(d);e=a.appendVasQueryParam(h,k)}var l= a.getPathName()+e;p.history.replaceState({},document.title,l)}catch(q){b.metric("addWidgetStateInUrl_fail"),b.log(q)}}),d.on("vas:remove-widget-state-url",function(){var d=a.getDecodedQueryParamString();if(a.doesVasQueryParamExist(d))try{var e=a.getVasQueryParamValue(d),h=a.parseSingleQuotedStringAsJson(e);if(a.doesKeyExist(h,"vw")){var c=a.removeOrUpdateVasQryParamWithMarker(d,h,"vw"),g=a.getPathName()+c;p.history.replaceState({},document.title,g)}}catch(k){b.metric("removeWidgetStateFromUrl_fail"), b.log(k)}})):b.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(d,b,a,f,e,h){var c=d.$,g,k,l=!1,q,n,u=function(){var a=c("#ppdb-add-service-checkbox");if(!l){f.setHijacked();c(document.body).undelegate("#mbc .a-button","click.lsatc");f.logMetric("vas_si_atcClick");l=!0;g.isMBCClick=!1;g.atcButton=c(this);var k=g.atcButton.attr("id");if(k&& "add-to-cart-button"!==k)if("mobb.addToCart"!==k){if(g.isMBCClick=!0,(k=g.atcButton.text())&&!k.match(/cart/i))return document.body.style.cursor="default",e.safeATCClick(),!1}else g.isMOBBlick=!0;if(0<a.length&&a.is(":checked"))return a=!0===g.isUpsellCritical?"1":"0",k="vas_bdlppd_",g.isMBCClick&&(k+="mbc_"),g.isMOBBClick&&(k+="mobb_"),b.logRefTag(k+"checked_atc_"+a+"_"+g.productAsin+"_"+g.serviceAsin),f.logMetric("vas_bdlppd_atc_click"),document.body.style.cursor="default",e.safeATCClick(),l?!0: !1;c(document.body).undelegate("#add-to-cart-button","click.lsatc");c(document.body).undelegate("#mobb\\.addToCart","click.lsatc");if(g.productAsin&&g.serviceAsin&&1===g.atcButton.length&&1===q.length){g.atcButton.bind("click.lsatc",e.lsATCHandlerSuppressATC);if(a=c.parseJSON(c("#valueAddsInterstitial").attr("data-a-modal"))){if(a={name:a.name,header:a.header},c("#valueAddsInterstitial").attr("data-a-modal",JSON.stringify(a)).click(),d.$(".a-popover-inner").addClass("pdp-service-modal-instance"), g.showSTSServiceInterstitial&&(a=g.selectedOfferFulfillmentType,(k=c("#"+(g.showSTSServiceInterstitial?"sts-":"")+"pdp-service-siatc-modal-content"))&&k.length)){var h=k.find("."+a);h.length&&(k.find("."+g.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),h.removeClass("vas-hidecomponent"),g.selectedOfferFulfillmentType=a)}}else e.safeATCClick();return!1}document.body.style.cursor="default";e.safeATCClick();return!1}},w=function(){q=c("#addToCart");q.submit(function(){f.unsetHijacked(); return!0});n=c("#second_new_accordion_form");n.submit(function(){f.unsetHijacked();return!0});g.hijackMBCATC&&(c(document).undelegate("#mbc .a-button","click.lsatc"),c(document.body).delegate("#mbc .a-button","click.lsatc",u),b.logRefTag("vas_mbc_ld_"+g.productAsin+"_"+g.serviceAsin));c(document).undelegate("#add-to-cart-button","click.lsatc");c(document.body).delegate("#add-to-cart-button","click.lsatc",u);c(document).undelegate("#mobb\\.addToCart","click.lsatc");c(document.body).delegate("#mobb\\.addToCart", "click.lsatc",u)};return{registerSIEventHandlers:function(){c(document.body).undelegate("#add-to-cart-button","click.lsatc");var d=0!==c("#abb-interstitial").length;d&&b.metric("devicesInterstitialPresentCount");if(d=!d)d="undefined"!==typeof a.getSetting("winningWidgetVM")?a.getSetting("widgetCommonVM").hijackATC:!1;d&&(g=a.getSetting("widgetCommonVM"),g.isShipToStoreAsinSelected="in_store"===g.selectedOfferFulfillmentType,g.atcEventInProgress=!1,g.isMBCClick=!1,g.isMOBBClick=!1,k=g.isWarrantyPresent, e.setWidgetMetaData(g),f.setWidgetMetaData(g),h.setWidgetMetaData(g),g.doRedirect&&null===document.getElementById("servicesInterstitial")&&null===document.getElementById("attach-warranty-pane")&&!k&&(w(),h.registerSIEventHandlers()))}}});"use strict";m.when("vas-common-settings").register("vas-item-association",function(d){return{getIAGroupData:function(b){return{type:b.programType,renderType:b.renderType,parentAsin:b.associatedItemId,constraintList:[{type:"DELETE",mutuallyInclusive:b.deleteConstraint.mutuallyInclusive}]}}, getItemAssociationData:function(b){var a=d.getSetting("winningWidgetVM"),f=a.itemAssociationV2;f===x&&a.vasTwisterOptions&&a.vasTwisterOptions[b]&&(f=a.vasTwisterOptions[b].itemAssociationV2);return f}}});"use strict";m.when("vas-utilities").register("vas-natc",function(d){return{getNatcParameters:function(b){var a={asin:b.asin,offerListingId:b.offerListingId,quantity:b.quantity};b.additionalParameters!==x&&(a.additionalParameters=b.additionalParameters);var f={},e=d.flattenObject(a);Object.keys(e).forEach(function(a){f["items[0.vasItem]"+ a]=e[a]});return f}}});"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(d,b,a,f,e,h){function c(){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":q.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 g(c,d,e){c=(new b.AddItemData).construct(c,d,e).setItemAssociation(a.getItemAssociationData(c));return JSON.stringify({items:[c]})}function k(){f.logUeMetricIncreaseCount(h.METRICS.SUCCESS,1);d.trigger(h.SUCCESS_EVENT)}function l(a){422===a.status?f.logUeMetricIncreaseCount(h.METRICS.INCOMPLETE_ADD,1):(f.logUeMetricIncreaseCount(h.METRICS.ERROR,1),f.logFatal(a.responseText,h.FATAL_ATTRIBUTION,"[context:: productAsin\x3d"+n.productAsin+ ", zip\x3d"+n.zipCode+"] "))}var q,n;return{addUpsell:function(a,b,f){q=e.getSetting("addItemsAjaxCallVM");n=e.getSetting("widgetBaseVM");d.$.ajax({url:q.ajaxEndpoint+h.API_PATH+"?ref\x3d"+h.REFTAG,type:h.AJAX_METHOD,headers:c(),xhrFields:{withCredentials:!0},data:g(a,b,f),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(d){var b={};return{getSetting:function(a){return a?b[a]:b},setSetting:function(a,d,e){a&&e?b[a][e]=d:a&&(b[a]=d)},clearSettings:function(){b={}}}});"use strict";m.when("A","vas-metrics-publisher","vas-common-settings","vas-widget-const","ready").register("vas-common-metrics",function(d,b,a,f){d.off(f.COMMON.EVENT_NAME.NO_BUYBOX);d.on(f.COMMON.EVENT_NAME.NO_BUYBOX,function(){var d=f.COMMON.REFTAG_PREFIX.NO_BUYBOX, h=a.getSetting("widgetCommonVM").productAsin,c=a.getSetting("widgetCommonVM").zipCode;b.logRefTag(d+h+"_"+c,"LocalServicesWidget")});d.off(f.COMMON.EVENT_NAME.NO_PRODUCT);d.on(f.COMMON.EVENT_NAME.NO_PRODUCT,function(){var d=a.getSetting("widgetCommonVM").shouldSuppressWidget,h=a.getSetting("widgetCommonVM").isProductAvailable,c;d?c=f.COMMON.REFTAG_PREFIX.WIDGET_SUPRESSED:h||(c=f.COMMON.REFTAG_PREFIX.WIDGET_NO_PRODUCT);b.logRefTag(c,"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(d,b,a,f,e,h,c,g){var k=d.$,l=function(){b.clearSettings();var a,c,f=!1;d.each(k("#"+e.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(e,h){c=d.parseJSON(k(e).attr("data-a-state")).key;"vas-common-vm"===c?(a=d.parseJSON(k(e).html()),b.setSetting("widgetCommonVM",a)):"vas-winning-widget-vm"===c?(a=d.parseJSON(k(e).html()),b.setSetting("winningWidgetVM", a),f=!0,g.logCSMCounter("vas_winningWidgetVM_"+a.winningWidgetName)):"vas-prepurchase-widget-vm"===c?(a=d.parseJSON(k(e).html()),b.setSetting("prepurchaseWidgetVM",a),f=!0):"vas-base-vm"===c&&(a=d.parseJSON(k(e).html()),b.setSetting("widgetBaseVM",a))});b.setSetting("addItemsAjaxCallVM",d.state("vas-aapi-ajax-call-data-vm"));return f},q=function(){if(l()){a.registerBuyboxEventHandlers();f.registerSIEventHandlers();if("undefined"!==typeof b.getSetting("winningWidgetVM")){var k=b.getSetting("winningWidgetVM").winningWidgetName; d.trigger("vas:widgetname:"+k)}else d.trigger(e.COMMON.EVENT_NAME.NO_BUYBOX);d.trigger(e.COMMON.EVENT_NAME.NO_PRODUCT);"undefined"!==typeof b.getSetting("prepurchaseWidgetVM")&&(k=b.getSetting("prepurchaseWidgetVM").prepurchaseWidgetName,d.trigger("vas:widgetname:"+k));h.attachToLdbb();c.initialize();g.logCSMCounter("vas_widget_initialized")}};d.on("a:pageUpdate",function(){q()});return{initialize:q}});"use strict";"use strict";m.when("A","vas-metrics-publisher","vas-widget-const","atf","ready").register("vas-base-data-publisher", function(d,b,a,f){var e=d.$;f=function(){var f,c;d.each(e("#"+a.COMMON.DOM.VALUE_ADDS_SLOT).find("[data-a-state]"),function(a,b){c=d.parseJSON(e(a).attr("data-a-state")).key;"vas-base-vm"===c&&(f=d.parseJSON(e(a).html()))});if(f){var g=!1,k={};if(0<e("#add-to-cart-button").length||0<e("#mbc .a-button").length)g=!0;k[b.hitParameterKeys.productAsin]=f.productAsin;k[b.hitParameterKeys.additionalRequestData]={asin:f.productAsin,dt:"d",zip:f.zipCode,ibba:g};b.logHit("hbs_product_data",k)}};f();return{publish:f}}); "use strict";m.when("A","vas-common-settings","vas-service-quantity-helper","vas-ldbb-constants").register("attach-to-ldbb",function(d,b,a,f){var e=d.$,h=function(){e(document.body).undelegate(f.ATC_BUTTON,f.EVENT_TYPE);var c=a.getServiceQuantity(b.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled,"ldbb");d.on(f.SUCCESS_EVENT,function(){d.trigger(f.VAS_DEALS_A2C_EVENT,c)})};return{attachToLdbb:function(){b.getSetting("widgetCommonVM").attachToLdbb&&(e(document.body).undelegate(f.ATC_BUTTON, f.EVENT_TYPE),e(document.body).delegate(f.ATC_BUTTON,f.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";"use strict";"use strict";"use strict";"use strict";m.when("A","vas-metrics-publisher","ready").register("vas-atc-tracker",function(d,b){d=d.$;var a=!1,f=null,e=null,h=0,c=null,g=null,k=!1,l, q=function(){return 0===h?!1:!0},n=function(a,c){"undefined"!==typeof c?b.logUeMetricIncreaseCount(a+(l.showSTSServiceInterstitial||l.isParentServiceAsin?"_sts":""),c):b.logUeMetricIncreaseCount(a+(l.showSTSServiceInterstitial||l.isParentServiceAsin?"_sts":""))},u=function(){if(a){var c=f;null!==c&&(c=((new Date).getTime()-c)/1E3,n("vas_si_hijack_interval_time",c),300<c&&(b.logRefTag("vas_si_hijack_interval_time_5M_"+l.productAsin+"_"+l.serviceAsin),b.logFatal("Customer spending more than 5 min on SI widget", "vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")))}},w=function(){if(q()){var a=e;null!==a&&(a=((new Date).getTime()-a)/1E3,n("vas_si_dismissal_interval_time",a),30<a&&(b.logRefTag("vas_si_hijack_dismissal_time_30S_"+l.productAsin+"_"+l.serviceAsin),b.logFatal("Customer spending more than 30 sec on page after trying to dismiss SI widget","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+ "] ")))}},t=function(){if(!k&&(k=!0,a)){n("vas_si_hijack_unload");b.logRefTag("vas_si_hijack_unload"+l.productAsin+"_"+l.serviceAsin);var c=f;if(null!==c){var d=(new Date).getTime();n("vas_si_hijack_unload_total_time",d-c);b.logFatal("Customer may be stuck on SI widget","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")}}return!0};d(p).unbind("beforeunload");d(p).bind("beforeunload",t);d(p).unbind("unload");d(p).bind("unload",t);return{isHijacked:function(){return a}, setHijacked:function(){a||(a=!0,n("vas_si_atcHijack"),b.logRefTag("vas_si_atcHijack"),f=(new Date).getTime(),c=p.setInterval(u,6E4),g=p.setInterval(w,2E4))},unsetHijacked:function(){if(a){if(null!==f){var d=((new Date).getTime()-f)/1E3;n("vas_si_hijack_total_time",d)}a=!1;n("vas_si_atcUnHijack");b.logRefTag("vas_si_atcUnHijack");f=null;h=0;e=null;null!==c&&(p.clearInterval(c),c=null);null!==g&&(p.clearInterval(g),g=null)}},getHijackTime:function(){return f},logHijackMetricOnPageUnload:t,setHijackDismissalAttempt:function(){0=== h&&(e=(new Date).getTime());h++;1<h?n("vas_si_dismissal_count",1):n("vas_si_dismissal_count",0);2===h&&b.logFatal("SI widget is dismissed mulitple times","vas-si","[context::productAsin\x3d"+l.productAsin+",serviceAsin\x3d"+l.serviceAsin+",zip\x3d"+l.zipCode+"] ")},getDismissalTime:function(){return e},isDismissalAttempted:q,setWidgetMetaData:function(a){l=a},logMetric:n}});"use strict";m.when("A","vas-metrics-publisher","vas-atc-tracker","ready").register("vas-atc-helper",function(d,b,a){var f=d.$, e,h=function(){a.logMetric("vas_si_atcClick_returnFalse");e&&(b.logFatal("Add to cart is clicked multiple times with vas SI","vas-si","[context::productAsin\x3d"+e.productAsin+",serviceAsin\x3d"+e.serviceAsin+",zip\x3d"+e.zipCode+"] "),b.logHit("vas_si_atcClick_returnFalse",{upsellAsin:e.serviceAsin,productAsin:e.productAsin,additionalRequestData:e.zipCode}));return!1},c=function(){a.logMetric("vas_si_forceSafeATC_click");e.isMBCClick&&e.atcButton.bind("click",function(){var a=f(this).find("a")[0]; a&&a.href&&(p.location.href=a.href)});if(e.atcButton)e.atcButton.unbind("click.lsatc").click().bind("click.lsatc",h);else{var b=f("#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()}},g=function(){a.logMetric("vas_si_safeATC_click");e.atcEventInProgress||c()},k=function(){var a,b,c,d;e.isMBCClick&&"undefined"!==typeof e.offerListingID&&(c=e.atcButton.find("a")[0])&&c.href&&(a=c.href,e.showSIATC&&(b=2, (d=a.match(/itemCount=([0-9]+)/i))&&d[1]&&(d=parseInt(d[1],10))&&(b=d+1),a=a.replace(/itemCount=([0-9]+)/i,"itemCount\x3d"+b)+"\x26offeringID."+b+"\x3d"+e.offerListingID,c.href=a));return a},l=function(){var a={};a.upsellAsin=e.serviceAsin;a.offerlistingId=e.offerListingID;a.merchantId=e.merchantId;d.trigger("vas:add-service-asin-buybox-event",a)};return{addServiceToCart:function(b){var d=k();if(e.showSIATC)l(),a.logMetric("vas_siatc_service_added"),g();else{if(e.atcEventInProgress)return!1;e.atcEventInProgress= !0;a.logMetric("vas_si_addProduct");var h=function(c){document.body.style.cursor="default";a.logMetric("vas_siatc_sdp_redirect_ajaxFail",0);if(e.productAsin&&e.serviceAsin){var d={dsc:1,productASIN:e.productAsin},g=e.zipCode;c=f(c);if(c=(c=(c=(c=(c=f(".giftableItem, .nonGiftableItem",c))&&c[0])&&c.outerHTML)&&f(c))&&c.attr("itemid"))d.itemID=c,d.newItems=c+",1",d.isHUC="true";g&&(d.area=g);d=JSON.stringify(d).replace(/"/g,"'");d="?vas\x3d"+encodeURIComponent(d)+"\x26psc\x3d1";a.unsetHijacked();p.location.href= "/gp/product/"+e.serviceAsin+"/ref\x3d"+b+d;a.logMetric("vas_siatc_sdp_redirect")}else a.logMetric("vas_siatc_huc_redirect"),a.unsetHijacked(),p.location.href="/gp/cart/view.html"},w=function(b){a.logMetric("vas_siatc_sdp_redirect_ajaxFail");document.body.style.cursor="default";c()};e.isMBCClick?f.get(d).done(h).fail(w):(d={"session-id":f("#session-id").attr("value"),ASIN:e.productAsin,offerListingID:f("#offerListingID").attr("value"),isMerchantExclusive:f("#isMerchantExclusive").attr("value"),merchantID:f("#merchantID").attr("value"), isAddon:f("#isAddon").attr("value"),nodeID:f("#nodeID").attr("value"),sellingCustomerID:f("#sellingCustomerID").attr("value"),qid:f("#qid").attr("value"),sr:f("#sr").attr("value"),storeID:f("#storeID").attr("value"),tagActionCode:f("#tagActionCode").attr("value"),viewID:f("#viewID").attr("value"),rsid:f("#rsid").attr("value"),sourceCustomerOrgListID:f("#sourceCustomerOrgListID").attr("value"),sourceCustomerOrgListItemID:f("#sourceCustomerOrgListItemID").attr("value"),wlPopCommand:"",quantity:f("#quantity").attr("value"), "submit.add-to-cart":"Submit+Query"},f.post("/gp/product/handle-buy-box/ref\x3dvas_dphbb_"+e.productAsin+"_"+e.serviceAsin,d).done(h).fail(w));document.body.style.cursor="progress"}return!1},lsATCHandlerSuppressATC:h,safeATCClick:g,forceSafeATCClick:c,setWidgetMetaData:function(a){e=a}}});"use strict";m.when("A","ready").register("vas-service-quantity-helper",function(d){return{getServiceQuantity:function(b,a){return 1}}});"use strict";"use strict";"use strict";"use strict";"use strict";"use strict"; "use strict";"use strict";"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(d,b,a){var f=d.$,e,h,c,g,k,l,q,n,u,w,t,m,B,p,r,x,I,Q,L,z,v,G,y,A,D=function(a,c){"undefined"!==typeof c?b.logUeMetricIncreaseCount(a+(v.showSTSServiceInterstitial||v.isParentServiceAsin?"_sts":""),c):b.logUeMetricIncreaseCount(a+(v.showSTSServiceInterstitial||v.isParentServiceAsin?"_sts":""))},M=function(){k.hide();I.hide();x.hide();m.addClass("a-button-disabled").prop("disabled",!0)},R=function(){M();n.hide();l.hide();u.show()};d.on("a:popover:show:VAS-SI-Zip-Update", function(a){A=a.popover});return{vasSIZipCodeUpdate:function(C,J){var K=C.bsi_prefixes.refmarkerPrefixes,S=C.additionalRequestDataKeys,F=C.bsi_prefixes.metricPrefixes;b.createCSMNameAndLog(F.tenant,F.widget,"updateZip");C=r.val();if(a.validateZipCode(C,Q)){y=r.val();var N=v.zipCode,T="vas_sx_zc_"+N+"_"+y,O="undefined"!==typeof v.childServiceAsins?v.childServiceAsins:[v.serviceAsin];b.logRefTag(T);if(y===G)return!1;d.ajax("/gp/ls/vas-ajax-handlers/vas-zipcode-refresh.html",{method:"get",params:{asinlist:O.join(","), vasZipcode:y,clientName:"vasBuyableSiZipRefresh",includeMerchantAddress:v.showSTSServiceInterstitial},success:function(a){var r,E,C=!(f.isEmptyObject(a)||"1"===a.hasError);if(C)for(var P=0;P<O.length;P++)if(E=O[P],a[E]&&!r||!r.merchantId||v.showSTSServiceInterstitial&&"in_store"===a[E].fulfillmentType)r=a[E],v.serviceAsin=E;E=f(".vas-siatc-zip");E.length&&E.text(y);if(!C||d.objectIsEmpty(a)||1===a.hasError||d.objectIsEmpty(a[v.serviceAsin])||1===a[v.serviceAsin].hasError)return R(),b.logRefTag("vas_sx_zaf_"+ N+"_"+y),D("vas-si-atc-zip-ajaxFail"),b.createCSMNameAndLog(F.tenant,F.widget,"updateZipFail"),!1;d.objectIsEmpty(r.offerListingId)?(J.additionalRequestData[S.zipCode]=y,b.createRefMarkerAndLog(K.tenant,v.mappingSet,K.widget,"zprfrsh0",J),M(),l.hide(),u.hide(),q.length&&q.text(y),n.show(),v.showSTSServiceInterstitial&&L.hide(),b.logRefTag("vas_sx_zfl_"+N+"_"+y),D("vas-si-atc-zipchange-nooffer")):(J.additionalRequestData[S.zipCode]=y,b.createRefMarkerAndLog(K.tenant,v.mappingSet,K.widget,"zprfrsh1", J),A&&A.hide(),a=r,v.offerListingID=a.offerListingId,v.isCBM=a.isCBM,v.merchantId=a.merchantId,v.isShipToStoreAsinSelected="in_store"===a.fulfillmentType,v.shouldAddItemAssociation=v.isShipToStoreAsinSelected,a=r.isCBM,g.html(r.positiveRatingHtml),w.text(r.merchantName).prop("href",r.sellerReviewLink),e.html(r.price).className+="a-color-price",c.html(r.price).className+="a-color-price",a?(I.hide(),x.show(),B.hide(),p.show()):(x.hide(),I.show(),p.hide(),B.show()),d.objectIsEmpty(r.nextOfferPrice)|| a?k.hide():(t.html(r.nextOfferPrice).className+="a-color-price",k.show()),n.hide(),l.hide(),m.removeClass("a-button-disabled").prop("disabled",!1),b.logRefTag(T),D("vas-si-atc-zipchange-offeravailable"),r.fulfillmentType&&(a=r.fulfillmentType,h&&h.length&&(C=h.find("."+a),C.length&&(h.find("."+v.selectedOfferFulfillmentType).addClass("vas-hidecomponent"),C.removeClass("vas-hidecomponent"),v.selectedOfferFulfillmentType=a))),v.showSTSServiceInterstitial&&(L.show(),d.objectIsEmpty(r.merchantAddress)? z.hide():(z.text(r.merchantAddress.AddressLine1+", "+r.merchantAddress.City+", "+r.merchantAddress.StateOrRegion+" "+r.merchantAddress.PostalCode),z.show())));G=y},error:function(){G=y;R();b.createCSMNameAndLog(F.tenant,F.widget,"updateZipFail");D("vas-si-atc-zip-ajaxFail");A&&A.hide()}})}else G=C,M(),u.hide(),n.hide(),l.show();return!1},setZipCodeValuesFromDOM:function(){e=f("#vas-siatc-bestoffer-obm");c=f("#vas-siatc-bestoffer-cbm");g=f("#vas-siatc-ratingandreview");k=f("#vas-si-atc-remainingoffers"); l=f("#vas-siatc-invalidzip-message");q=f("#vas-siatc-nooffer-zip");n=f("#vas-siatc-offerunavailable-message");u=f("#vas-siatc-zip-ajaxfail-message");w=f("#vas-siatc-merchantname");t=f("#vas-si-atc-remainingoffer-price");m=f("#btnVasModalContinue");B=f("#vas-siatc-howitworks-obm");p=f("#vas-siatc-howitworks-cbm");x=f("#vas-siatc-cbm-gridrow");I=f("#vas-siatc-obm-gridrow");r=f("#vas-siatc-zip-input");Q=f("#vas-zipCodeValidationRegexString");v.showSTSServiceInterstitial&&(h=f("#sts-pdp-service-siatc-modal-content"), f("#vas-sts-zip-update-modal"),h&&h.length&&(L=h.find(".vas-si-merchant"),z=h.find(".vas-si-merchant-address")))},setWidgetMetaData:function(a){v=a;G=v.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(d,b,a,f,e,h,c){var g=d.$,k,l,q=c.siMetricConstants.hitRecordConstants,n,u,w=c.siMetricConstants.additionalRequestDataKeys,t={addProductAndOpenSDPInNewTab:function(b, c){h.createRefMarkerAndLog(n.tenant,k.mappingSet,n.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(u.tenant,u.widget,h.CSMActionTypes.redirect);e.setHijackDismissalAttempt();e.logMetric(b);p.open("/dp/"+k.serviceAsin+"/ref\x3d"+c,"_blank");a.safeATCClick();return!1},triggerMetricsForPopoverShow:function(){e.logMetric("vas_si_show");var a=l+"show_"+k.serviceAsin;k.showSIATC?(e.logMetric("vas_buyable_si_show"),a=l+k.zipCode+"_"+k.merchantId):e.logMetric("vas_normal_si_show"); h.createCSMNameAndLog(u.tenant,u.widget,h.CSMActionTypes.glanceView);h.createRefMarkerAndLog(n.tenant,k.mappingSet,n.widget,h.RefmarkerActionTypes.glanceView,k.hitParameters);h.logRefTag(a);p.ue&&ue.trigger&&b.getSetting("widgetCommonVM").siRatingWeblabTreatment&&ue.trigger("DP_VAS_SI_RATING_235428",b.getSetting("widgetCommonVM").siRatingWeblabTreatment)},triggerMetricsForPopoverhide:function(){e.setHijackDismissalAttempt();e.logMetric("vas_si_hide_click");h.createCSMNameAndLog(u.tenant,u.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(n.tenant,k.mappingSet,n.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 b=g("#vas-siatc-zip-input");f.setZipCodeValuesFromDOM();b.keyup(function(a){13===a.keyCode&& g("#vas-siatc-zip-update").click()});g(document).undelegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh");g(document).delegate("#vas-siatc-zip-update","click.vas-siatc-zip-refresh",function(a){f.vasSIZipCodeUpdate(c.siMetricConstants,k.hitParameters)});g(document).undelegate("#vas-si-moredetails","click.sdpredir");g(document).delegate("#vas-si-moredetails","click.sdpredir",function(a){t.addProductAndOpenSDPInNewTab("vas_siatc_see_more_details",l+"sm_"+k.productAsin+"_"+k.serviceAsin)})}g(document).undelegate("#btnVasModalSkip", "click");g(document).delegate("#btnVasModalSkip","click",function(b){e.setHijackDismissalAttempt();e.logMetric("vas_si_skip_click");h.createCSMNameAndLog(u.tenant,u.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(n.tenant,k.mappingSet,n.widget,h.RefmarkerActionTypes.serviceNotIncluded,k.hitParameters);a.safeATCClick();return!1});g(document).undelegate("#btnVasModalContinue","click.pdpVasNext"); g(document).delegate("#btnVasModalContinue","click.pdpVasNext",function(b){e.setHijackDismissalAttempt();e.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(n.tenant,k.mappingSet,n.widget,d,k.hitParameters);h.createCSMNameAndLog(u.tenant,u.widget,c);a.addServiceToCart(b); return!1});d.off("a:popover:hide:vasServiceInterstitial");d.on("a:popover:hide:vasServiceInterstitial",function(a){t.triggerMetricsForPopoverhide()});d.off("a:popover:afterShow:vasServiceInterstitial");d.on("a:popover:afterShow:vasServiceInterstitial",function(a){t.triggerMetricsForPopoverShow()});d.off("a:popover:hide:valueAddsInterstitial");d.on("a:popover:hide:valueAddsInterstitial",function(a){t.triggerMetricsForPopoverhide()});d.off("a:popover:afterShow:valueAddsInterstitial");d.on("a:popover:afterShow:valueAddsInterstitial", function(a){t.triggerMetricsForPopoverShow()});g("#buyableSIAsinRatingLink").unbind("click");g("#buyableSIAsinRatingLink").bind("click",function(){e.logMetric("vas_sx_sdp_rating_redirect");h.createRefMarkerAndLog(n.tenant,k.mappingSet,n.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(u.tenant,u.widget,h.CSMActionTypes.redirect)});g("#siAsinRatingLink").unbind("click");g("#siAsinRatingLink").bind("click",function(){e.logMetric("vas_si_sdp_rating_redirect");h.createRefMarkerAndLog(n.tenant, k.mappingSet,n.widget,h.RefmarkerActionTypes.redirect,k.hitParameters);h.createCSMNameAndLog(u.tenant,u.widget,h.CSMActionTypes.redirect)})},setWidgetMetaData:function(a){k=a;f.setWidgetMetaData(a);k.showSIATC?(n=c.siMetricConstants.bsi_prefixes.refmarkerPrefixes,u=c.siMetricConstants.bsi_prefixes.metricPrefixes):(n=c.siMetricConstants.rsi_prefixes.refmarkerPrefixes,u=c.siMetricConstants.rsi_prefixes.metricPrefixes);n.tenant=k.showSTSServiceInterstitial||k.isParentServiceAsin?"sts":"vas";u.tenant= k.showSTSServiceInterstitial||k.isParentServiceAsin?"sts":"vas";a=k;var b={},d={};d[w.zipCode]=k.zipCode;d[w.isMBC]=k.isMBCClick?1:0;b[h.hitParameterKeys.upsellAsin]=k.serviceAsin;b[h.hitParameterKeys.productAsin]=k.productAsin;b[h.hitParameterKeys.merchantId]=k.merchantId;b[h.hitParameterKeys.pageType]=q.pageType;b[h.hitParameterKeys.subPageType]=q.subPageType;b[h.hitParameterKeys.additionalRequestData]=d;a.hitParameters=b}}});"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(d,b,a,f,e){var h=d.$,c={baseAsinMetaData:{},isUpsellCritical:"",hasPrecheckEnabled:""},g=f.vasTwisterMetricConstants.refmarkerPrefixes, k=f.vasTwisterMetricConstants.additionalRequestDataKeys,l=f.vasTwisterMetricConstants.metricPrefixes;return{getSettings:function(a){return"undefined"!==typeof a?c[a]:c},fetchTwisterSetting:function(){var q=h("#ppdb-add-service-checkbox");q.is(":checked")&&q.prop("checked",!1);var q=b.getSetting("winningWidgetVM"),n=q.winningServicePriceWithPromotionApplied;c.baseAsinMetaData.upsellAsin=q.upsellAsin;c.upsellAsin=q.serviceAsinToOffer;c.baseAsinMetaData.offerlistingId=q.offerListingID;c.baseAsinMetaData.merchantId= q.merchantId;c.baseAsinMetaData.price=q.winningServiceMinPrice;c.isUpsellCritical=q.isUpsellCritical;c.hasPrecheckEnabled=q.hasPrecheckEnabled;c.dynamicStringChangeOnTwisterSelection=q.dynamicStringChangeOnTwisterSelection;c.promotionMessagingWeblab="undefined"!==typeof q.promotionMessagingWeblab?q.promotionMessagingWeblab:!1;c.isPromoPriceDisplayed=!d.objectIsEmpty(h.trim(n));c.productAsin=b.getSetting("widgetCommonVM").productAsin;c.zipCode=b.getSetting("widgetCommonVM").zipCode;c.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice; c.mappingSet=b.getSetting("widgetCommonVM").mappingSet;c.sessionId=b.getSetting("widgetCommonVM").sessionId;c.vasTwisterMetricConstants=f.vasTwisterMetricConstants;c.hitParameters=e.createHitParameters(c.vasTwisterMetricConstants);q=c.hitParameters[a.hitParameterKeys.additionalRequestData];q[k.isPromo]=c.isPromoPriceDisplayed;q[k.isCritical]=c.isUpsellCritical;c.hitParameters[a.hitParameterKeys.additionalRequestData]=q;var q=c.upsellAsin,n=c.productAsin,u=c.baseAsinMetaData.price,w=c.baseAsinMetaData.merchantId, t="vas_bdlppd_fake_twister_"+(!0===c.isUpsellCritical?"1":"0")+"_a_"+c.zipCode;a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.glanceView,c.hitParameters);a.metric("vas_bdlppd_fake_twister_");a.logRefTag(t,"LocalServicesWidget","Impression",q,"popUp",w,n,u,c.buyboxPrice)},logTwisterInteractionReftag:function(b){var d=c.isUpsellCritical,e=c.upsellAsin,f=c.productAsin,k=c.baseAsinMetaData.price,h=c.baseAsinMetaData.merchantId, m="vas_bdlppd_fake_twister_";c.isPromoPriceDisplayed&&(m="vas_bdplppd_fake_twister_promo_");a.logRefTag(m+(b?"y":"n")+"_"+(!0===d?"1":"0")+"_a","LocalServicesWidget","AddServiceCheck",e,"popUp",h,f,k);a.createCSMNameAndLog(l.tenant,l.widget,b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,c.hitParameters)},logTwisterATCReftag:function(){var b= !0===c.isUpsellCritical?"1":"0",d="vas_bdlppd_fake_twister_atc_"+b,e=c.upsellAsin,f=c.productAsin,k=c.baseAsinMetaData.price,h=c.baseAsinMetaData.merchantId;c.isPromoPriceDisplayed&&(d="vas_bdlppd_fake_twister_atc_promo_"+b);a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.addToCart);a.logRefTag(d,"LocalServicesWidget","CartAdd",e,"popUp",h,f,k,c.buyboxPrice);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.addToCart,c.hitParameters);return!0},logTwisterExpanderReftagAndMetric:function(b){var d= c.upsellAsin,e=c.productAsin,f=c.baseAsinMetaData.merchantId,k=b?"vas_bdlppd_fake_twister_sm_click":"vas_bdlppd_fake_twister_sl_click";a.createCSMNameAndLog(l.tenant,l.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,c.hitParameters);a.increaseMetricBy(k,1);a.logRefTag(k,"LocalServicesWidget","SeeMoreClick",d,"popUp",f,e)}, logTwisterSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.redirect,c.hitParameters)}}});"use strict";m.when("A","vas-twister-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-twister-controller",function(d,b,a,f){var e=d.$,h=e("body"),c=!1,g=function(){b.logTwisterATCReftag()},k=function(){e("#ppdb-add-service-checkbox").prop("checked", !0);var c=b.getSettings("baseAsinMetaData");try{d.trigger("vas:add-service-asin-buybox-event",c),e("#addToCart").unbind("submit.ppdBundles"),e("#addToCart").bind("submit.ppdBundles",g),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(f){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(f)}e("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")||e("#vas-fake-twister-include-section").click(); b.getSettings("isPromoPriceDisplayed")&&b.getSettings("promotionMessagingWeblab")&&(e("#vasTwisterSelectedPromotionMessage").removeClass("aok-hidden"),e("#vasTwisterNotSelectedPromotionMessage").addClass("aok-hidden"));d.trigger("vas:add-widget-state-url",{preSelectedWidgetValue:b.getSettings("baseAsinMetaData").upsellAsin})},l=function(a){b.getSettings("dynamicStringChangeOnTwisterSelection")&&e("#vas-service-title-text").html(a.attr("data-title"))},q={vasTwisterTrigger:function(c){e(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select"); c.addClass("vas-ppd-swatch-select");l(c);if("removeOffer"===c.attr("data-twister-action")){e("#ppdb-add-service-checkbox").prop("checked",!1);try{d.trigger("vas:remove-service-asin-buybox-event"),e("#addToCart").unbind("submit.ppdBundles"),a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success"),d.trigger("vas:remove-widget-state-url")}catch(f){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(f)}b.getSettings("isPromoPriceDisplayed")&& b.getSettings("promotionMessagingWeblab")&&(e("#vasTwisterSelectedPromotionMessage").addClass("aok-hidden"),e("#vasTwisterNotSelectedPromotionMessage").removeClass("aok-hidden"));b.logTwisterInteractionReftag(!1)}else k(),b.logTwisterInteractionReftag(!0)},vasTwisterExpander:function(){e("#vas-fake-twister-include-section").find("i").hasClass("a-icon-extender-collapse")?b.logTwisterExpanderReftagAndMetric(!1):b.logTwisterExpanderReftagAndMetric(!0)}},n=function(){e("#vas-fake-twister-include-section").unbind("click"); e("#vas-fake-twister-include-section").bind("click",function(a){q.vasTwisterExpander()});e("#vas-fake-twiseter-detailLink").unbind("click");e("#vas-fake-twiseter-detailLink").bind("click",function(a){b.logTwisterSDPRedirectReftagAndMetric()})},u=function(){c||(h.undelegate(".vas-ppd-swatch-item","click"),h.delegate(".vas-ppd-swatch-item","click",function(a){a=e(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||q.vasTwisterTrigger(a)}),c=!0)},w=function(){d.off("vas:ldbb-a2c-event:desktop");d.on("vas:ldbb-a2c-event:desktop", function(a){if(e("#ppdb-add-service-checkbox").is(":checked")){var c=b.getSettings("baseAsinMetaData");f.addUpsell(c.upsellAsin,c.offerlistingId,a)}});d.off("vas:ldbb-upsell-added:desktop");d.on("vas:ldbb-upsell-added:desktop",function(){b.logTwisterATCReftag()})};d.off("vas:widgetname:twister");d.on("vas:widgetname:twister",function(){e("#vas-service-title-text");u();b.fetchTwisterSetting();b.getSettings("hasPrecheckEnabled")&&(k(),l(e(".vas-ppd-swatch-select")));n();w();e("#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(d,b){function a(a){a=document.getElementById(a);var b=[];if(null===a||a===x)return b;a=a.getElementsByTagName("SCRIPT"); d.each(a,function(a){b.push(a.innerHTML)});return b}function f(a,b){d.each(b,function(b){var c=document.createElement("script");c.type="text/javascript";c.text=b;b=document.getElementById(a);null!==b&&b!==x&&b.appendChild(c)})}var e=d.$,h=null,c=function(c){try{var g=c.pageRefreshData,h=[];d.each(c.featuresWithScriptTags,function(b){h.push(a(b))});c.featuresToRefresh.forEach(function(a){e(a).replaceWith(e(g).find(a).prop("outerHTML"))});d.each(c.featuresWithScriptTags,function(a,b){f(a,h[b])});d.trigger("vas:vas-twister-page-refresh-complete", c);b.increaseMetricBy("vasTwisterUpdateFeatures_success",1);b.increaseMetricBy("vasTwisterUpdateFeatures_fail",0);d.loadImageManually(d.$(".icon-box"))}catch(n){d.trigger("vas:vas-twister-update-features-failed",c),b.increaseMetricBy("vasTwisterUpdateFeatures_success",0),b.increaseMetricBy("vasTwisterUpdateFeatures_fail",1),b.log(n)}},g=function(a){d.trigger("vas:vas-twister-page-refresh-start",a);null!==h&&h.abort();h=d.ajax(a.ajaxUrl,{method:"POST",timeout:"90000",params:{isVariationalParent:a.isVariationalParent}, success:function(d){a.pageRefreshData=d;c(a);b.increaseMetricBy("vasTwisterPageRefresh_success",1);b.increaseMetricBy("vasTwisterPageRefresh_fail",0)},error:function(){d.trigger("vas:vas-twister-page-refresh-failed",a);b.increaseMetricBy("vasTwisterPageRefresh_success",0);b.increaseMetricBy("vasTwisterPageRefresh_fail",1)}})};return{performPageRefresh:function(a){"undefined"===typeof a.pageRefreshData?g(a):c(a)},abortPageRefreshRequests:function(){null!==h&&h.abort()},restoreInitialData:function(a){try{var c= a.pageRefreshData;d.each(a.featuresToRefresh,function(a){"undefined"!==typeof c[a]&&e(a).replaceWith(c[a])});b.increaseMetricBy("vasTwisterRestoreInitialData_success",1);b.increaseMetricBy("vasTwisterRestoreInitialData_fail",0);d.trigger("vas:vas-twister-initialdata-restore-complete")}catch(f){b.increaseMetricBy("vasTwisterRestoreInitialData_success",0),b.increaseMetricBy("vasTwisterRestoreInitialData_fail",1),b.log(f)}}}});"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(d,b,a,f,e,h){var c=d.$,g={vasTwisterOptions:{},baseAsinMetaData:{},productAsinAndOfferData:{},productPriceInTwisterVariation:{}},k=f.vasTwisterXLMetricConstants.refmarkerPrefixes,l=f.vasTwisterXLMetricConstants.metricPrefixes,q=function(){var b=g.productAsinAndOfferData.asin,c=g.productAsinAndOfferData.merchantId,e="vas_bdlppd_fake_twister_a_"+g.productAsinAndOfferData.zipCode;a.metric("vas_bdlppd_vas_twister_"); a.logRefTag(e,"LocalServicesWidget","Impression","","popUp",c,b,"","");a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);d.each(g.vasTwisterOptions,function(b,c){var d=a.RefmarkerActionTypes.glanceView;b.isOfferAvailable||(d=a.RefmarkerActionTypes.glanceViewDisabled);g.hitParameters[a.hitParameterKeys.upsellAsin]=c;a.createRefMarkerAndLog(k.tenant,g.mappingSet,k.widget,d,g.hitParameters)})},n=function(){try{var b=g.productAsinAndOfferData.asin,d=c("li[data-defaultasin\x3d"+b+"] .a-size-mini"); d.length&&g.productPriceInTwisterVariation[b]===x&&(g.productPriceInTwisterVariation[b]=d.text());a.increaseMetricBy("saveInitialProductPriceContent_fail",0);a.metric("saveInitialProductPriceContent_success",1)}catch(e){a.createCSMNameAndLog(l.tenant,l.widget,"saveInitialProductError"),a.increaseMetricBy("saveInitialProductPriceContent_success",0),a.metric("saveInitialProductPriceContent_fail",1),a.log(e)}};return{getProductAsinAndOfferData:function(a){return"undefined"!==typeof a?g.productAsinAndOfferData[a]: g.productAsinAndOfferData},getSettings:function(a){if("undefined"!==typeof a){a=g.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 g.hasPrecheckEnabled},getVasTwisterOption:function(a){if("undefined"!==typeof a)return g.vasTwisterOptions[a]},getInitialProductPriceContent:function(){return g.productPriceInTwisterVariation},setInitialWidgetSettings:function(){c("#ppdb-add-service-checkbox").is(":checked")&& c("#ppdb-add-service-checkbox").prop("checked",!1);var a=b.getSetting("winningWidgetVM"),k=a.vasTwisterOptions;g.productAsinAndOfferData=a.vasUpsellProductAsinAndOfferData;g.mappingSet=b.getSetting("widgetCommonVM").mappingSet;g.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;d.each(k,function(a,b){g.vasTwisterOptions[b]=a});g.vasTwisterXLMetricConstants=f.vasTwisterXLMetricConstants;g.hitParameters=e.createHitParameters(g.vasTwisterXLMetricConstants);g.hasPrecheckEnabled=!0===h.isDisabled? !1:a.hasPrecheckEnabled;n();q()},logVasTwisterInteractionReftag:function(b,c){b&&(b=g.vasTwisterOptions[c].offerData.price,a.logRefTag("vas_bdlppd_vas_twister_a","LocalServicesWidget","AddServiceCheck",c,"popUp",g.vasTwisterOptions[c].offerData.merchantId,g.productAsinAndOfferData.asin,b),g.hitParameters[a.hitParameterKeys.upsellAsin]=c,g.hitParameters[a.hitParameterKeys.upsellAsinPrice]=b);c=a.CSMActionTypes.serviceIncluded;a.createRefMarkerAndLog(k.tenant,g.mappingSet,k.widget,a.RefmarkerActionTypes.serviceIncluded, g.hitParameters);a.createCSMNameAndLog(l.tenant,l.widget,c)},logVasTwistetATCReftag:function(c){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.addToCart);var d=g.productAsinAndOfferData.asin,e=g.vasTwisterOptions[c].offerData.price,f=g.vasTwisterOptions[c].offerData.merchantId,h="";b.getSetting("widgetCommonVM")&&(h=b.getSetting("widgetCommonVM").buyboxPrice||"");g.hitParameters[a.hitParameterKeys.upsellAsin]=c;g.hitParameters[a.hitParameterKeys.upsellAsinPrice]=e;a.createRefMarkerAndLog(k.tenant, g.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,g.hitParameters);a.logRefTag("vas_bdlppd_vas_twister_atc_","LocalServicesWidget","CartAdd",c,"popUp",f,d,e,h);return!0},logTwisterExpanderReftagAndMetric:function(b,c){var d=g.vasTwisterOptions[c].offerData.price;a.createCSMNameAndLog(l.tenant,l.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints);g.hitParameters[a.hitParameterKeys.upsellAsin]=c;g.hitParameters[a.hitParameterKeys.upsellAsinPrice]=d;a.createRefMarkerAndLog(k.tenant, g.mappingSet,k.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints,g.hitParameters)},getVasTwisterXLMetricConstants:function(){return g.vasTwisterXLMetricConstants},getHitParameters:function(){return g.hitParameters},isMultiQuantityPurchaseEnabled:function(){return b.getSetting("widgetCommonVM").multiQuantityPurchaseEnabled},isBusinessCustomer:function(){return b.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(d,b,a,f,e){var h=d.$,c={},g={},k=function(a){a.pageRefreshData=c;b.restoreInitialData(a);q("1.0",a.featuresToRefresh)},l=function(){var a=f.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(""))},q=function(a,b){d.each(b,function(b,c){h(b).css("opacity",a)})},n=function(){try{var b=f.getInitialProductPriceContent();d.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(c){a.increaseMetricBy("restoreInitialPriceInProductTwister_success",0),a.metric("restoreInitialPriceInProductTwister_fail", 1),a.log(c)}};d.off("vas:vas-twister-page-refresh-start");d.on("vas:vas-twister-page-refresh-start",function(a){q("0.5",a.featuresToRefresh);h("#vasTwisterRow").addClass("vas-twister-disabled")});d.off("vas:vas-twister-page-refresh-complete");d.on("vas:vas-twister-page-refresh-complete",function(a){g[a.baseOfferMerchantId+a.asin]=a.pageRefreshData;l();q("1.0",a.featuresToRefresh);h("#vasTwisterRow").removeClass("vas-twister-disabled");d.trigger("vas:twister-update-widgets","hide");d.trigger("vas:add-asin-offer-data-to-cart", a.svcAsin)});d.off("vas:vas-twister-page-refresh-failed");d.on("vas:vas-twister-page-refresh-failed",function(a){q("1.0",a.featuresToRefresh);h("#vasTwisterRow").removeClass("vas-twister-disabled")});d.off("vas:vas-twister-update-features-failed");d.on("vas:vas-twister-update-features-failed",function(a){k(a.featuresToRefresh);q("1.0",a.featuresToRefresh)});d.off("vas:vas-twister-initialdata-restore-complete");d.on("vas:vas-twister-initialdata-restore-complete",function(){n();d.trigger("vas:remove-asin-offer-data-to-cart"); d.trigger("vas:twister-update-widgets","show")});d.off("vas:twister-update-widgets");d.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){d.each(a,function(a,b){c[a]=h(a).prop("outerHTML")});d.trigger("vas:twister-update-widgets","show")},performPageRefresh:function(a){a.ajaxUrl=e.getAjaxUrl(a.asin,a.baseOfferMerchantId); a.pageRefreshData=g[a.baseOfferMerchantId+a.asin];a.featuresWithScriptTags=e.getFeaturesWithScriptTags();b.performPageRefresh(a)},abortPageRefreshRequests:function(){b.abortPageRefreshRequests()},restoreInitialPriceInProductTwister:n,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(d,b,a){function f(){return b.isBusinessCustomer()&&b.isMultiQuantityPurchaseEnabled()}function e(){return"{%27disableFreeFormQtyPicker%27:true}"}return{isRefreshRequired:function(d,c){return b.isBusinessCustomer()?d!==c||b.isMultiQuantityPurchaseEnabled()&&!b.hasPrecheckEnabled():a.isMobbPresent()||d!==c},getAjaxUrl:function(a,b){a="/gp/product/"+a+"?m\x3d"+b;return f()?a+"\x26vas\x3d"+e():a},getFeaturesWithScriptTags:function(){return b.isMultiQuantityPurchaseEnabled()&& !b.isBusinessCustomer()?["soldByThirdParty_feature_div","quantityLayoutHigh_feature_div"]:[]},disableQuantityRefresh:f,getQueryParamValueToDisableQuantityRefresh:e}});"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(d,b,a,f,e,h){var c=d.$,g="#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="",q="",n=function(){b.logVasTwistetATCReftag(q)},m=function(){try{d.trigger("vas:remove-service-asin-buybox-event"),c("#addToCart").unbind("submit.ppdBundles"),f.increaseMetricBy("a2cFormRemoveEventSend_fail",0),f.metric("a2cFormRemoveEventSend_success")}catch(a){f.increaseMetricBy("a2cFormRemoveEventSend_success",0),f.metric("a2cFormRemoveEventSend_fail"),f.log(a)}},p=function(a){try{d.trigger("vas:add-service-asin-buybox-event",a),c("#addToCart").bind("submit.ppdBundles",n),f.increaseMetricBy("a2cFormAddEventSend_success", 1),f.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(b){f.increaseMetricBy("a2cFormAddEventSend_success",0),f.increaseMetricBy("a2cFormAddEventSend_fail",1),f.log(b)}},t={vasTwisterExpander:function(a,d){c("#vas-fake-twister-includesection-"+a.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")?b.logTwisterExpanderReftagAndMetric(!1,d):b.logTwisterExpanderReftagAndMetric(!0,d)},ppdFakeTwisterTrigger:function(f){var h=f.attr("data-twister-svcAsin"),n={};if("undefined"=== typeof h||b.getVasTwisterOption(h).isOfferAvailable)if(c(".vas-ppd-swatch-item").removeClass("vas-ppd-swatch-select"),f.addClass("vas-ppd-swatch-select"),c(".vas-twister-whatsincluded").hide(),c("#vas-twister-title").html(f.attr("data-twister-callToAction")),"removeOffer"===f.attr("data-twister-action"))a.abortPageRefreshRequests(),c("#ppdb-add-service-checkbox").prop("checked",!1),q="undefined",e.isRefreshRequired(l,b.getProductAsinAndOfferData("merchantId"))?(n.featuresToRefresh=g,a.restoreInitialData(n), l=b.getProductAsinAndOfferData("merchantId"),a.showOfferUpdateWidget()):a.hideOfferUpdateWidget(),m(),b.logVasTwisterInteractionReftag(!1,"ItemOnly"),d.trigger("vas:twister-update-widgets","show");else{!1===k&&(a.setInitialFeaturesData(g),k=!0);c("#ppdb-add-service-checkbox").prop("checked",!0);m();c("#vas-fake-twister-whatsincluded-"+f.attr("data-twister-svcAsin")).show();c("#vas-fake-twister-includesection-"+f.attr("data-twister-svcAsin")).find("i").hasClass("a-icon-extender-collapse")||(c("#vas-fake-twister-includesection-"+ f.attr("data-twister-svcAsin")).unbind("click"),c("#vas-fake-twister-includesection-"+f.attr("data-twister-svcAsin")).bind("click",function(a){t.vasTwisterExpander(f,h)}),c("#vas-fake-twister-includesection-"+f.attr("data-twister-svcAsin")).click());q=h;var r=b.getVasTwisterOption(h).baseOfferMerchantId;e.isRefreshRequired(l,r)?(n.asin=b.getProductAsinAndOfferData("asin"),n.svcAsin=h,n.merchantId=b.getVasTwisterOption(h).offerData.merchantId,n.isVariationalParent=!1,n.featuresToRefresh=g,n.baseOfferMerchantId= r,a.performPageRefresh(n),l=r,a.showOfferUpdateWidget()):(d.trigger("vas:twister-update-widgets","hide"),p(b.getSettings(f.attr("data-twister-svcAsin"))),a.hideOfferUpdateWidget());b.logVasTwisterInteractionReftag(!0,h)}}};d.off("vas:add-asin-offer-data-to-cart");d.on("vas:add-asin-offer-data-to-cart",function(a){p(b.getSettings(a))});d.off("vas:remove-asin-offer-data-to-cart");d.on("vas:remove-asin-offer-data-to-cart",function(){m()});var r=function(){c(".vas-ppd-swatch-item").unbind("click");c(".vas-ppd-swatch-item").bind("click", function(a){a=c(a.currentTarget);a.hasClass("vas-ppd-swatch-select")||t.ppdFakeTwisterTrigger(a)})};d.off("vas:widgetname:twister_xl");d.on("vas:widgetname:twister_xl",function(){b.setInitialWidgetSettings();r();l=b.getProductAsinAndOfferData("merchantId");a.restoreInitialPriceInProductTwister();if(b.hasPrecheckEnabled()&&!h.isMobbPresent()){a.hideOfferUpdateWidget();var d=c(".vas-ppd-swatch-select");t.ppdFakeTwisterTrigger(d)}c("#vasTwisterRow").removeClass("vas-twister-disabled")})});"use strict"; m.register("vas-enhanceppd-config",function(){return{enhancedPPDMetricConstants:{refmarkerPrefixes:{tenant:"vas",widget:"eppdb"},hitRecordConstants:{pageType:"DetailPage",subPageType:"AddServices"},additionalRequestDataKeys:{zipCode:"zip",isCritical:"crtcl"},metricPrefixes:{tenant:"vas",widget:"eppdb"}}}});"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(d,b,a,f,e,h){var c= {enhancePpdViewModel:{}},g=e.enhancedPPDMetricConstants.refmarkerPrefixes,k=e.enhancedPPDMetricConstants.metricPrefixes;return{getSettings:function(a){return c.hasOwnProperty(a)?c[a]:c},setSettings:function(a,b,d){a&&d?c[a][d]=b:a&&(c[a]=b)},fetchEnhancePpdSetting:function(){c.enhancePpdViewModel=b.getSetting("winningWidgetVM");c.productAsin=b.getSetting("widgetCommonVM").productAsin;c.zipCode=b.getSetting("widgetCommonVM").zipCode;c.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;c.isEnhanceUpsellPresence= "undefined"===typeof c.enhancePpdViewModel.upsellAsinOfferData?!1:!0;c.sessionId=b.getSetting("widgetCommonVM").sessionId;c.mappingSet=b.getSetting("widgetCommonVM").mappingSet;c.enhancedPPDMetricConstants=e.enhancedPPDMetricConstants;c.hitParameters=h.createHitParameters(e.enhancedPPDMetricConstants);var d,q=!0===c.enhancePpdViewModel.isUpsellCritical?"1":"0",n=c.enhancePpdViewModel.baseAsinOfferData.upsellAsin,m=c.enhancePpdViewModel.productAsin,p=f.getPriceValue(c.enhancePpdViewModel.winningServiceMinPrice), t=c.enhancePpdViewModel.baseAsinOfferData.merchantId,r=f.getPriceValue(c.buyboxPrice),x=c.zipCode;d=(!1===c.isEnhanceUpsellPresence?"vas_bdlppd_enh_":"vas_bdlppd_enh_upsell_")+q+"_a_"+x;a.logRefTag("vas_bdlppd_ld_"+q+"_a_"+x,"LocalServicesWidget","Impression",n,"popUp",t,m,p,r);a.logRefTag(d,"LocalServicesWidget","Impression",n,"popUp",t,m,p,r);d=c.isEnhanceUpsellPresence?"uppdb":k.widget;a.createCSMNameAndLog(k.tenant,d,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(g.tenant,c.mappingSet,d, a.RefmarkerActionTypes.glanceView,c.hitParameters)},logPPDBundlesExpander:function(b){a.increaseMetricBy(!1===c.isEnhanceUpsellPresence?"vas_ppd_bdl_sm_clicks":"vas_ppd_bdl_sm_upg_clicks",1);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,b?a.CSMActionTypes.expandBulletPoints:a.CSMActionTypes.collapseBulletPoints,c.hitParameters);a.createCSMNameAndLog(k.tenant,k.widget,b?a.RefmarkerActionTypes.expandBulletPoints:a.RefmarkerActionTypes.collapseBulletPoints)},logPPDBundlesATCReftag:function(){a.createCSMNameAndLog(k.tenant, k.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.addToCart,c.hitParameters)},logCheckboxInteractionReftag:function(b){var d=!0===c.enhancePpdViewModel.isUpsellCritical?"1":"0",e=c.enhancePpdViewModel.baseAsinOfferData.upsellAsin,h=c.enhancePpdViewModel.productAsin,m=f.getPriceValue(c.enhancePpdViewModel.winningServiceMinPrice);a.logRefTag("vas_bdlppd_"+b+"_"+c.ppdBundlesInteractionSlice+"_"+d+"_a","LocalServicesWidget","AddServiceCheck", e,"popUp",c.enhancePpdViewModel.baseAsinOfferData.merchantId,h,m);a.createCSMNameAndLog(k.tenant,k.widget,"y"===b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,"y"===b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,c.hitParameters)},logBuyBackReftagHandler:function(){var b=c.enhancePpdViewModel.baseAsinOfferData.upsellAsin,d=c.enhancePpdViewModel.productAsin,e="vas_bbk_"+d+"_"+b,h=f.getPriceValue(c.enhancePpdViewModel.winningServiceMinPrice); a.logRefTag(e,"LocalServicesWidget","CartAdd",b,"popUp",c.enhancePpdViewModel.baseAsinOfferData.merchantId,d,h);a.createCSMNameAndLog(k.tenant,k.widget,a.CSMActionTypes.buyBack);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.buyBack,c.hitParameters);return!0},logPPDBundlesBuyNowReftag:function(){a.createCSMNameAndLog(k.tenant,k.widget,a.CSMActionTypes.buyNow);a.createRefMarkerAndLog(g.tenant,c.mappingSet,g.widget,a.RefmarkerActionTypes.buyNow,c.hitParameters)}}});"use strict"; m.when("A","vas-enhanceppd-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-enhanceppd-controller",function(d,b,a,f){var e=d.$,h=function(){b.logPPDBundlesATCReftag()},c=function(){b.logPPDBundlesBuyNowReftag()},g=function(){b.logBuyBackReftagHandler()},k=function(){try{d.trigger("vas:remove-service-asin-buybox-event"),e("#add-to-cart-button").unbind("click.ppdBundles"),e("#buy-now-button").unbind("click.ppdBundles"),e("#buyBackBuyNow").length&&e(document.body).undelegate("#buyBackBuyNow", "submit.vasBuyBackReftag"),a.increaseMetricBy("a2cFormRemoveEventSend_fail",0),a.metric("a2cFormRemoveEventSend_success")}catch(b){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(b)}},l=function(b){try{d.trigger("vas:add-service-asin-buybox-event",b),e("#add-to-cart-button").bind("click.ppdBundles",h),e("#buy-now-button").bind("click.ppdBundles",c),d.trigger("vas:add-service-asin-buyback-form-event",b),e(document.body).delegate("#buyBackBuyNow", "submit.vasBuyBackReftag",g),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(f){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(f)}},q={ppdBundlesCheckBoxHandler:function(){var a,c=e("#ppdBundlesEnhancedWrapper"),d=e("#ppdBundlesEnhancedBox");e("#ppdb-add-service-checkbox").is(":checked")?(a="y",k(),b.getSettings("isEnhanceUpsellPresence")&&e("#ppdb-upsell-service-checkbox").is(":checked")? l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData):l(b.getSettings("enhancePpdViewModel").baseAsinOfferData),c.addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),d.addClass("ppdBundlesOrangeBox"),null===b.getSettings("ppdBundlesInteractionSlice")&&b.setSettings("ppdBundlesInteractionSlice",1),e("#ppdBundlesExpanderContent").is(":visible")||e("#ppdBundlesExpanderHeadingLink").click()):(a="n",c.addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),d.removeClass("ppdBundlesOrangeBox"), b.getSettings("isEnhanceUpsellPresence")&&e("#ppdb-upsell-service-checkbox").is(":checked")&&e("#ppdb-upsell-service-checkbox").click(),k());b.logCheckboxInteractionReftag(a);b.setSettings("ppdBundlesInteractionSlice",1)},ppdBundlesUpsellCheckBoxHandler:function(){var a;e("#ppdb-upsell-service-checkbox").is(":checked")?(e("#ppdb-add-service-checkbox").is(":checked")?(k(),l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData)):e("#ppdb-add-service-checkbox").click(),a="y"):(k(),l(b.getSettings("enhancePpdViewModel").baseAsinOfferData), a="n");b.logCheckboxInteractionReftag(a)}},n=function(){d.off("a:expander:ppdBundlesExpander:toggle:expand");d.on("a:expander:ppdBundlesExpander:toggle:expand",function(a){b.logPPDBundlesExpander(!0)});d.off("a:expander:ppdBundlesExpander:toggle:collapse");d.on("a:expander:ppdBundlesExpander:toggle:collapse",function(a){b.logPPDBundlesExpander(!1)});e("#ppdb-add-service-checkbox").unbind("change");e("#ppdb-add-service-checkbox").bind("change",function(){q.ppdBundlesCheckBoxHandler()});b.getSettings("isEnhanceUpsellPresence")&& (e("#ppdb-upsell-service-checkbox").unbind("change"),e("#ppdb-upsell-service-checkbox").bind("change",function(){q.ppdBundlesUpsellCheckBoxHandler()}))},m=function(){d.off("vas:ldbb-a2c-event:desktop");d.on("vas:ldbb-a2c-event:desktop",function(a){if(e("#ppdb-add-service-checkbox").is(":checked")){var c;c=b.getSettings("isEnhanceUpsellPresence")&&e("#ppdb-upsell-service-checkbox").is(":checked")?b.getSettings("enhancePpdViewModel").upsellAsinOfferData:b.getSettings("enhancePpdViewModel").baseAsinOfferData; f.addUpsell(c.upsellAsin,c.offerlistingId,a)}});d.off("vas:ldbb-upsell-added:desktop");d.on("vas:ldbb-upsell-added:desktop",function(){h()})};d.off("vas:widgetname:enhancedPPD");d.on("vas:widgetname:enhancedPPD",function(){b.fetchEnhancePpdSetting();n();m();e("#ppdb-add-service-checkbox").is(":checked")?(k(),e("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesOrangeBorder").removeClass("ppdBundlesGrayBorder"),e("#ppdBundlesEnhancedBox").addClass("ppdBundlesOrangeBox"),b.getSettings("isEnhanceUpsellPresence")&& e("#ppdb-upsell-service-checkbox").is(":checked")?l(b.getSettings("enhancePpdViewModel").upsellAsinOfferData):l(b.getSettings("enhancePpdViewModel").baseAsinOfferData)):(e("#ppdBundlesEnhancedWrapper").addClass("ppdBundlesGrayBorder").removeClass("ppdBundlesOrangeBorder"),e("#ppdBundlesEnhancedBox").removeClass("ppdBundlesOrangeBox"));e("#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(d,b,a,f){var e=d.$,h=f.COMMON.DOM.SERVICE_CAPABILITIES_SLOT,c=b.SERVICE_CAPABILITIES_WIDGET_NAME,g=function(){var b;d.each(e("#"+h).find("[data-a-state]"),function(f,g){b=d.parseJSON(e(f).attr("data-a-state")).key;"vas-service-capabilities-model"=== b&&a.logCSMCounter(["vas",c,a.RefmarkerActionTypes.glanceView].join("_"))})};f=function(){g();e("#"+b.SERVICE_CAPABILITIES_IMAGE_ID).unbind(b.CLICK_EVENT);e("#"+b.SERVICE_CAPABILITIES_IMAGE_ID).bind(b.CLICK_EVENT,function(){a.logCSMCounter(["vas",c,b.CLICK_EVENT].join("_"))})};f();return{initialize:f}});"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(d,b,a,f,e,h){var c=d.$,g={ppdBundleViewModel:{}},k=e.ppdBundlesMetricConstants.refmarkerPrefixes,l=e.ppdBundlesMetricConstants.metricPrefixes;return{getSettings:function(a){return g.hasOwnProperty(a)?g[a]:g},setSettings:function(a, b,c){a&&c?g[a][c]=b:a&&(g[a]=b)},fetchPpdBundleSetting:function(){g.ppdBundleViewModel=b.getSetting("winningWidgetVM");g.productAsin=b.getSetting("widgetCommonVM").productAsin;g.zipCode=b.getSetting("widgetCommonVM").zipCode;g.buyboxPrice=b.getSetting("widgetCommonVM").buyboxPrice;g.sessionId=b.getSetting("widgetCommonVM").sessionId;g.mappingSet=b.getSetting("widgetCommonVM").mappingSet;g.ppdBundlesMetricConstants=e.ppdBundlesMetricConstants;g.hitParameters=h.createHitParameters(g.ppdBundlesMetricConstants); var d=c("#ppdb-add-service-checkbox");d.is(":checked")&&d.prop("checked",!1);var d=!0===g.ppdBundleViewModel.isUpsellCritical?"1":"0",m=g.zipCode,p=g.productAsin,r=f.getPriceValue(g.ppdBundleViewModel.baseAsinOfferData.price),t=f.getPriceValue(g.buyboxPrice),x=g.ppdBundleViewModel.baseAsinOfferData.upsellAsin,B=g.ppdBundleViewModel.baseAsinOfferData.merchantId,V="vas_bdlppd_old_"+d+"_a_"+m;a.logRefTag("vas_bdlppd_ld_"+d+"_a_"+m,"LocalServicesWidget","Impression",x,"popUp",B,p,r,t);a.logRefTag(V,"LocalServicesWidget", "Impression",x,"popUp",B,p,r,t);a.metric("bdl_old_gv");a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.glanceView);a.createRefMarkerAndLog(k.tenant,g.mappingSet,k.widget,a.RefmarkerActionTypes.glanceView,g.hitParameters)},logCheckboxInteractionReftag:function(b){var c=!0===g.ppdBundleViewModel.isUpsellCritical?"1":"0",d=g.ppdBundleViewModel.baseAsinOfferData.upsellAsin,e=g.productAsin,h=f.getPriceValue(g.ppdBundleViewModel.baseAsinOfferData.price);f.getPriceValue(g.buyboxPrice);a.logRefTag("vas_bdlppd_"+ b+"_1_"+c+"_a","LocalServicesWidget","AddServiceCheck",d,"popUp",g.ppdBundleViewModel.baseAsinOfferData.merchantId,e,h);a.createCSMNameAndLog(l.tenant,l.widget,"y"===b?a.CSMActionTypes.serviceIncluded:a.CSMActionTypes.serviceNotIncluded);a.createRefMarkerAndLog(k.tenant,g.mappingSet,k.widget,"y"===b?a.RefmarkerActionTypes.serviceIncluded:a.RefmarkerActionTypes.serviceNotIncluded,g.hitParameters)},logATCInteraction:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.addToCart);a.createRefMarkerAndLog(k.tenant, g.mappingSet,k.widget,a.RefmarkerActionTypes.addToCart,g.hitParameters)},logSDPRedirectReftagAndMetric:function(){a.createCSMNameAndLog(l.tenant,l.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(k.tenant,g.mappingSet,k.widget,a.RefmarkerActionTypes.redirect,g.hitParameters);return!0}}});"use strict";m.when("A","vas-ppdbundle-setting","vas-metrics-publisher","vas-addUpsell-to-cart","ready").execute("vas-ppdbundle-controller",function(d,b,a,f){var e=d.$,h={ppdBundlesCheckBoxHandler:function(){var c; if(e("#ppdb-add-service-checkbox").is(":checked")){c=b.getSettings("ppdBundleViewModel").baseAsinOfferData;b.logATCInteraction();try{d.trigger("vas:add-service-asin-buybox-event",c),a.increaseMetricBy("a2cFormAddEventSend_success",1),a.increaseMetricBy("a2cFormAddEventSend_fail",0)}catch(f){a.increaseMetricBy("a2cFormAddEventSend_success",0),a.increaseMetricBy("a2cFormAddEventSend_fail",1),a.log(f)}c="y"}else{try{d.trigger("vas:remove-service-asin-buybox-event"),a.increaseMetricBy("a2cFormRemoveEventSend_fail", 0),a.metric("a2cFormRemoveEventSend_success")}catch(f){a.increaseMetricBy("a2cFormRemoveEventSend_success",0),a.metric("a2cFormRemoveEventSend_fail"),a.log(f)}c="n"}b.logCheckboxInteractionReftag(c)}},c=function(){e("#ppdb-add-service-checkbox").unbind("change");e("#ppdb-add-service-checkbox").bind("change",function(){h.ppdBundlesCheckBoxHandler()});e("#ppdBundles-estimate-SDP").unbind("click");e("#ppdBundles-estimate-SDP").bind("click",function(){b.logSDPRedirectReftagAndMetric()})},g=function(){d.off("vas:ldbb-a2c-event:desktop"); d.on("vas:ldbb-a2c-event:desktop",function(a){if(e("#ppdb-add-service-checkbox").is(":checked")){var c=b.getSettings("ppdBundleViewModel").baseAsinOfferData;f.addUpsell(c.upsellAsin,c.offerlistingId,a)}})};d.off("vas:widgetname:ppdBundle");d.on("vas:widgetname:ppdBundle",function(){b.fetchPpdBundleSetting();c();g()})});"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(d,b,a,f,e){var h,c,g,k,l=f.regularPPDMetricConstants.refmarkerPrefixes,m=f.regularPPDMetricConstants.metricPrefixes;return{fetchRegularPpdSetting:function(){h=b.getSetting("widgetCommonVM").productAsin;c=b.getSetting("winningWidgetVM").upsellAsin; g=b.getSetting("widgetCommonVM").mappingSet;b.getSetting("widgetCommonVM");b.getSetting("widgetCommonVM");k=e.createHitParameters(f.regularPPDMetricConstants);a.createRefMarkerAndLog(l.tenant,g,l.widget,a.RefmarkerActionTypes.glanceView,k);a.createCSMNameAndLog(m.tenant,m.widget,a.CSMActionTypes.glanceView);a.logRefTag("vas_ppd_cs_"+h+"_"+c);a.logUeMetricIncreaseCount("vas_standard_pdp_show")},logRedirectMetrics:function(){a.createCSMNameAndLog(m.tenant,m.widget,a.CSMActionTypes.redirect);a.createRefMarkerAndLog(l.tenant, g,l.widget,a.RefmarkerActionTypes.redirect,k)}}});"use strict";m.when("A","vas-regularppd-setting","vas-metrics-publisher","ready").execute("vas-regularppd-controller",function(d,b,a){var f=d.$,e=function(){f(".sdpRedirect").unbind("click");f(".sdpRedirect").bind("click",function(){b.logRedirectMetrics();a.logUeMetricIncreaseCount("vas_pdp_sdp_redirect");b.logRedirectMetrics()})};d.off("vas:widgetname:regularPPD");d.on("vas:widgetname:regularPPD",function(){e();b.fetchRegularPpdSetting()})});"use strict"; m.when("A","vas-common-settings","vas-metrics-publisher","ready").register("vas-brandmessaging-setting",function(d,b,a){var f,e,h;return{fetchBrandMessagingSettings:function(){f=b.getSetting("widgetCommonVM").productAsin;e=b.getSetting("winningWidgetVM").upsellAsin;h=b.getSetting("winningWidgetVM").impressionReftag;a.logRefTag(h,"LocalServicesWidget","Impression",e,null,null,f,null,null);a.logUeMetricIncreaseCount("vas_brand_gv")}}});"use strict";m.when("A","vas-brandmessaging-setting","vas-metrics-publisher", "ready").execute("vas-brandmessaging-controller",function(d,b,a){var f=d.$,e=function(){f("#vas-brand-messaging-details-redirect").unbind("click");f("#vas-brand-messaging-details-redirect").bind("click",function(){a.logUeMetricIncreaseCount("vas_brand_details_redir")})};d.off("vas:widgetname:brandMessagingDesktop");d.on("vas:widgetname:brandMessagingDesktop",function(){e();b.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(d,b,a){var f=d.$,e=function(){f("#"+a.SERVICE_BANNER_IMAGE_DIV_ID).unbind(a.CLICK_EVENT);f("#"+a.SERVICE_BANNER_IMAGE_DIV_ID).bind(a.CLICK_EVENT,function(){b.logCSMCounter(["vas",a.SERVICE_BANNER_WIDGET_NAME,a.CLICK_EVENT].join("_"))})};d.off("vas:widgetname:serviceBanner"); d.on("vas:widgetname:serviceBanner",function(){e();b.logCSMCounter(["vas",a.SERVICE_BANNER_WIDGET_NAME,b.RefmarkerActionTypes.glanceView].join("_"))})});"use strict";"use strict";"use strict";"use strict";"use strict";m.when("A").register("vsx-services-constants",function(d){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(d){return typeof d}:function(d){return d&&"function"===typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};m.when("A", "cc-manager","vsx-services-constants").register("vsx-services-twister-registration",function(d,b,a){var f=d.$,e={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,d){f(b).removeClass(a.AUI_CARD_EXPANDED).attr(a.DATA_EXPANDED_STATE, a.DATA_EXPANDED_STATE_VALUE_FALSE).attr(a.STYLE,a.CARD_HIDDEN_STYLE);f(d).removeClass(a.COLLAPSE_HEADING_ICON).addClass(a.EXPAND_HEADING_ICON)};return{selectionUpdate:function(a,d){return b.ccSelectionUpdate(a,d)},registerFeature:function(){b.registerFeature({featureName:a.FEATURE_NAME,featureAttribution:a.FEATURE_ATTRIBUTION},e)},cardExpanderListener:function(){b.cardExpanded(a.FEATURE_NAME)},ccSelectionsClear:function(){b.ccSelectionsClear(a.FEATURE_NAME)}}});"use strict";m.when("A","vas-metrics-publisher", "vas-prepurchase-setting").execute("vas-prepurchase-controller",function(d,b,a){var f=d.$,e=function(){f("#vas-prepurchase-details-redirect").undelegate("click");f("#vas-prepurchase").delegate("#vas-prepurchase-details-redirect","click",function(){b.logUeMetricIncreaseCount("vas_prepurchase_details_redirect")})};d.off("vas:widgetname:prePurchase");d.on("vas:widgetname:prePurchase",function(){e();a.fetchPrepurchaseSettings()})});"use strict";m.when("A","vas-common-settings","vas-metrics-publisher", "ready").register("vas-prepurchase-setting",function(d,b,a){var f={};return{fetchPrepurchaseSettings:function(){"undefined"!==typeof b.getSetting("widgetBaseVM")&&(f.productAsin=b.getSetting("widgetBaseVM").productAsin);f.impressionReftag=b.getSetting("prepurchaseWidgetVM").impressionReftag;a.logRefTag(f.impressionReftag,"LocalServicesWidget","Impression",f.serviceAsin,null,null,f.productAsin,null,null);a.logUeMetricIncreaseCount("vas_prepurchase_gv")}}});"use strict";m.register("vas-item-association-v2", function(){return{isEnabled:!1}});"use strict";m.register("pre-check-disabled",function(){return{isDisabled:!0}});"use strict";m.register("buyback-item-association",function(){return{isEnabled:!1}});"use strict";m.register("vas-add-item-data",function(){return{AddItemData:function(){return{construct:function(d,b,a){this.asin=d;this.offerListingId=b;this.quantity=a;return this},setItemAssociation:function(d){this.additionalParameters===x&&(this.additionalParameters={});this.additionalParameters.itemAssociation= d;return this}}}}})}); /* ******** */ (function(f){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,e=h?h("VasDPInstrumentationMetrics",""):g;e.guardFatal?e.guardFatal(f)(e,window):e.execute(function(){f(e,window)})})(function(f,g,h){f.register("vas-dp-instrumentation-config",function(){return{SCHEMA_ID:"vas.instrumentation.metrics.VasInstrumentationMetrics.5",PRODUCER_ID:"vas-discovery"}});f.register("vas-dp-postal-code-format-config",function(){return{BRITISH_FORMAT:["gb","ca"]}});f.register("vas-dp-instrumentation-get-marketplace", function(){return{marketplace:"ww"}});f.register("vas-dp-instrumentation-exception-logger",function(){return{logDataTypeException:function(e,b){b={message:"Incorrect data type for param: "+b};"undefined"!==typeof g.ueLogError&&ueLogError(b,{logLevel:"WARN",attribution:"Vas dp instrumentation metricId: "+e})}}});f.when("A","vas-dp-instrumentation-get-marketplace","vas-dp-postal-code-format-config").register("vas-dp-instrumentation-postal-code-formatter",function(e,b,d){return{format:function(c){var a= c;-1!==e.indexOfArray(d.BRITISH_FORMAT,b.marketplace)&&(c=c.split(" "),a="",1<c.length&&2<=c[0].length&&4>=c[0].length&&(a=c[0]+" "+c[1][0]));return a}}});f.register("vas-dp-instrumentation-time-formatter",function(){var e=function(b){return(10>b?"0":"")+b};return{formatTime:function(b){return b.getFullYear()+"-"+e(b.getMonth()+1)+"-"+e(b.getDate())+" "+e(b.getHours())+":"+e(b.getMinutes())+":"+e(b.getSeconds())}}});f.when("vas-dp-instrumentation-config","vas-dp-instrumentation-time-formatter").register("vas-dp-instrumentation", function(e,b){return{DetailPageInstrumentation:function(d){this.pagePath=location.href;this.customerLocalTime=b.formatTime(new Date);this.metricId=d.metricId;this.obfuscatedCustomerId=d.obfuscatedCustomerId||"";this.widgetName=d.widgetName||"";this.productAsin=d.productAsin;this.productPrice=d.productPrice;this.selectedUpsellAsin=d.selectedUpsellAsin;this.selectedUpsellPrice=d.selectedUpsellPrice;this.upsellAsins=d.upsellAsins;this.postalCode=d.postalCode;this.merchantId=d.merchantId;this.pageType= d.pageType||"LocalServicesWidget";this.subPageType=d.subPageType||"Impression";this.hitType=d.hitType||"popUp";this.isCritical=d.isCritical;this.deviceType=d.deviceType;this.promo=d.promo;this.isMbcClick=d.isMbcClick;this.isBuyBoxAvailable=d.isBuyBoxAvailable;this.deviceType=d.deviceType;this.postPurchaseUID=d.postPurchaseUID;this.experimentalData=d.experimentalData;this.payload=function(){var b={},a;for(a in this)"function"!==typeof this[a]&&(b[a]=this[a]);return b};this.publishMetrics=function(){g.ue&& ue.event&&"undefined"!==typeof this.metricId&&ue.event(this.payload(),e.PRODUCER_ID,e.SCHEMA_ID)}}}});f.when("vas-dp-instrumentation","vas-dp-instrumentation-exception-logger","vas-dp-instrumentation-postal-code-formatter").register("vas-dp-instrumentation-builder",function(e,b,d){return{DetailPageInstrumentationBuilder:function(c){return{metricId:c,obfuscatedCustomerId:"",setWidgetName:function(a){"string"===typeof a?this.widgetName=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"widgetName"); return this},setProductAsin:function(a){"string"===typeof a?this.productAsin=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"productAsin");return this},setProductPrice:function(a){"string"===typeof a?this.productPrice=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"productPrice");return this},setSelectedUpsellAsin:function(a){"string"===typeof a?this.selectedUpsellAsin=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"selectedUpsellAsin");return this},setSelectedUpsellPrice:function(a){"string"=== typeof a?this.selectedUpsellPrice=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"selectedUpsellPrice");return this},setUpsellAsins:function(a){if("object"===typeof a)this.upsellAsins=a;else if("string"===typeof a)try{this.upsellAsins=JSON.parse(a)}catch(k){g.ueLogError&&g.ueLogError(k,{logLevel:"ERROR",attribution:"error in parsing upsellAsin"})}else"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"upsellAsins");return this},setPostalCode:function(a){"string"===typeof a?this.postalCode= d.format(a):"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"postalCode");return this},setMerchantId:function(a){"string"===typeof a?this.merchantId=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"merchantId");return this},setPageType:function(a){"string"===typeof a?this.pageType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"pageType");return this},setSubPageType:function(a){"string"===typeof a?this.subPageType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c, "subPageType");return this},setHitType:function(a){"string"===typeof a?this.hitType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"hitType");return this},setIsCritical:function(a){"boolean"===typeof a?this.isCritical=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isCritical");return this},setPromo:function(a){"boolean"===typeof a?this.promo=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"promo");return this},setIsBuyBoxAvailable:function(a){"boolean"=== typeof a?this.isBuyBoxAvailable=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isBuyBoxAvailable");return this},setIsMbcClick:function(a){"boolean"===typeof a?this.isMbcClick=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isMbcClick");return this},setDeviceType:function(a){"string"===typeof a?this.deviceType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"deviceType");return this},setPostPurchaseUID:function(a){"string"===typeof a?this.postPurchaseUID=a: "undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"postPurchaseUID");return this},addExperimentalData:function(a,b){"undefined"===typeof this.experimentalData&&(this.experimentalData={});"string"===typeof b&&(this.experimentalData[a]=b);return this},build:function(){return new e.DetailPageInstrumentation(this)}}}}})}); /* ******** */ (function(a){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,b=d?d("DetailPagePromotionalBundleAssets",""):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,d){a.when("A","ready").execute("kbpMobileExpander",function(b){var a=b.$;a(".pb-bundle-section-expander").click(function(b){a(".pb-bundle-mobile-box").removeClass("aok-hidden");a(".pb-bundle-expander-box").addClass("aok-hidden")})})}); /* ******** */ (function(b){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,a=e?e("DigitalDashDetailPageAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,e){b.register("DigitalDashUtils",function(){return{redirect:function(a){if(!a)throw"Must pass a target URL.";c.location.href=a}}});"use strict";b.when("A","DigitalDashCreateForm").register("DigitalDashAddListeners",function(a,b){a.declarative("digital-dash-create","click",function(a){a.$event.preventDefault(); if(a.$target.data("DigitalDashCreateForm"))var d=a.$target.data("DigitalDashCreateForm");else d=new b({el:a.data.el,href:a.data.href}),a.$target.data("DigitalDashCreateForm",d);d.submit(a.data.data);return!1});a.on("digital-dash:auto-create",function(a){(new b({el:a.el,href:a.href})).submit(a.data)})});"use strict";b.when("A","DigitalDashUtils","a-alert").register("DigitalDashCreateForm",function(a,g,c){function d(a){f.extend(this,h,a);if(!this.el)throw"Must specify an el";if(!this.href)throw"Must specify an href to post to"; this.$el=f(this.el);this.$el.find(this.errorAlertSelector).removeClass("aok-hidden").end();this.$errorAlert=c(this.$el.find(this.errorAlertSelector));this.baseErrorText=this.$errorAlert.text();this.$changeover=this.$el.find(this.changeoverSelector);this.$updatingEls=Array.prototype.slice.call(document.querySelectorAll(this.buttonSuccessClass))}var f=a.$,h={errorAlertSelector:"#digital-dash-create-error-message",ajaxFieldName:"isAjax",changeoverSelector:"#digital-dash-create-success-changeover",buttonSuccessClass:".digital-dash-create-button-success-display"}; d.prototype.submit=function(b){this.$updatingEls.forEach(function(a){a.classList.remove("success");a.classList.remove("error")});b[this.ajaxFieldName]=!0;a.ajax(this.href,{method:"POST",params:b,success:f.proxy(this.handleAjaxSuccess,this),error:f.proxy(this.handleAjaxError,this)})};d.prototype.handleAjaxSuccess=function(a){a.success||510===a.error.errorCode?(this.$changeover.show(),this.$updatingEls.forEach(function(a){a.classList.add("success")})):(a.error.errorTitle&&this.$errorAlert.heading(a.error.errorTitle), a.error.errorMessage?this.$errorAlert.text(a.error.errorMessage):this.$errorAlert.text(this.baseErrorText),this.$updatingEls.forEach(function(a){a.classList.add("error")}))};d.prototype.handleAjaxError=function(a){if(401===a.http.status)try{return g.redirect(a.http.responseText)}catch(k){b.log("Error parsing unauth response: "+k,"ERROR","DigitalDashCreateForm")}else b.log("Create dash button call failed, could not recognize response from server.","FATAL","DigitalDashCreateForm");this.$updatingEls.forEach(function(a){a.classList.add("error")})}; return d});"use strict";b.when("A","DigitalDashAddListeners","load").execute("DigitalDashAutoAction",function(a){var b=a.state("digital-dash-auto-action");if(b)a.trigger(b.actionName,b.data);else a.on("a:state:update:digital-dash-auto-action",function(c){a.trigger(b.actionName,a.state("digital-dash-auto-action").data)})});"use strict";b.when("A","a-popover").execute("DigitalDashPopoverManager",function(a,c){var e=a.$,d=a.throttle(function(a){a.updatePosition()},500,{trailing:!1});a.on("a:popover:ajaxContentLoaded:dd-create-learn-more", function(a){var c=a.popover;a=e(c.getContent());a.html()?a.find("img").each(function(){e(this).bind("load",function(){d(c)})}):b.log("dd-create-learn-more lazyPositionPopover popover content not ready","WARN","DigitalDashPopoverManager")})})}); /* ******** */ (function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("AmazonsChoiceAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","a-popover","ready").execute(function(a,b){var g=a.$;g(document).delegate("#why-we-love-this-product-link","click mouseenter",function(a){b.get(g("#ac-badge-popover-declarative")).show();a.preventDefault()})});"use strict";b.when("A","atf","dp-refresh-handler","twisterModule","ac-state-utils").execute(function(a, b,g,c,d){d.addACStateParamsToPageRefreshAjaxUrl()});"use strict";b.when("A","atf","dp-refresh-handler","ready").register("ac-state-utils",function(a,b,c){return{addACStateParamsToPageRefreshAjaxUrl:function(){var b={featureName:"acBadge"},d=a.$,e=a.state("acState");if(e){var f={};e.acAsin&&(f.acAsin=e.acAsin);e.modalityMetadata&&(f.ac_md=e.modalityMetadata);d.isEmptyObject(f)||(new c(b)).addParams(f)}}}})}); /* ******** */ (function(n){var A=window.AmazonUIPageJS||window.P,C=A._namespace||A.attributeErrors,b=C?C("ProductBundleUIAssets",""):A;b.guardFatal?b.guardFatal(n)(b,window):b.execute(function(){n(b,window)})})(function(n,A,C){n.when("A","bundle-constants","bundle-logger","a-carousel-framework","a-carousel-constants","p-detect").register("bundles-card",function(b,c,e,d,a,m){function w(a){var g=a.getAttr(t.ATTR_MAX_HEIGHT);g&&b.isFiniteNumber(g)||(g=1);var l=g;a.dom.$carousel.children("li").not("."+t.EMPTY_CARD_CLASS).each(function(a, f){a=r(f).outerHeight();l=Math.max(a,l)});l>g&&(a.setAttr(t.ATTR_MAX_HEIGHT,l),m.capabilities.transition?1===g?a.dom.$viewport.height(l):b.animate(a.dom.$viewport,{height:l},a.getAttr(t.ATTR_HEIGHT_ANIMATION_SPEED),"linear"):a.dom.$viewport.height(l),a.updateDimensionsCache({viewport:{height:l,outerHeight:l}}))}function q(f){var r=f.getAttr(a.PAGE_NUMBER),l=f.getAttr(a.TOTAL_PAGES),g=f.dom.$container.find(t.prevButton);f=f.dom.$container.find(t.nextButton);g.css("visibility",1===r?"hidden":"visible"); f.css("visibility",r>=l?"hidden":"visible")}function u(){d.onInit("bundle-drawer-carousel",function(a){w(a);q(a);b.on(t.pageChangeEvent,function(a){y||(y=!0,e.logCount(h.SCROLL,1),g.isDevices&&e.logRefTag(k.INGRESS_SCROLLED+g.landingAsin));q(a.carousel)});b.on(t.repaintEvent,function(a){q(a.carousel)})})}function n(){var a=r(v.bundlesCardBundles),g=0,l=0,x=0;b.each(a,function(a,f){a=r(a);f=a.find(v.bundleTitle);f.height()>g&&(g=f.height());f=a.find(v.bundleImage);f.height()>l&&(l=f.height());a=a.find(v.bundleSavings); a.height()>x&&(x=a.height())});b.each(a,function(a,f){r(a).find(v.bundleTitle).height(g);r(a).find(v.bundleImage).height(l);r(a).find(v.bundleSavings).height(x)})}var r=b.$,g={},y=!1,t={pageChangeEvent:"a:carousel:bundle-drawer-carousel:change:pageNumber",repaintEvent:"a:carousel:bundle-drawer-carousel:repaint",prevButton:".a-carousel-goto-prevpage",nextButton:".a-carousel-goto-nextpage",ATTR_MAX_HEIGHT:"maxHeight",ATTR_HEIGHT_ANIMATION_SPEED:"height_animation_speed",EMPTY_CARD_CLASS:"a-carousel-card-empty"}, v={alexaBadgeContainer:".amazon-certified-badge-container",bundlesBottomDivider:".bundles-bottom-divider",bundlesCardCarousel:"#bundles-card .a-carousel-viewport",bundlesCardBundles:".bundles-carousel .bundle",bundlesCardState:"#bundles-card-state",bundlesFeature:"#bundles-feature",bundleSavings:".bundle-savings-line",bundleImage:".bundle-image",bundleTitle:".bundle-title",inlineTwister:"#twister-plus-mobile-inline-twister-container",vas:"#vas-ppd-fake-twister-mobile",kso:"#special-offers-information", devices_mc6:"#atfCenter10_feature_div"},h={SCROLL:"bundlesCard.desktop.ingress.scroll",WIDGET_SHOWN:"bundlesCard.desktop.ingress.shown"},k={INGRESS_SHOWN:"amzdv_tplus_dp_dsk_imp_",INGRESS_SCROLLED:"amzdv_tplus_dp_dsk_scroll_"};b.on(c.BUNDLES_CARD_READY,function(){y=!1;var a=r(v.bundlesCardState);g.currency=a.data("currencysymbol");g.aapiEndpoint=a.data("aapiendpoint");g.language=a.data("language");g.csrfToken=a.data("csrftoken");g.marketplaceId=a.data("marketplaceid");g.sessionId=a.data("sessionid"); g.landingAsin=a.data("landingasin");g.isDevices=a.data("isdevices");g.currencyOfPreference=a.data("currencyofpreference");g.isUnifiedCxView=a.data("isunifiedcxview");n();u();e.logCount(h.WIDGET_SHOWN,1);g.isDevices&&e.logRefTag(k.INGRESS_SHOWN+g.landingAsin);r(v.alexaBadgeContainer).length&&r(v.bundlesBottomDivider).addClass("aok-hidden")});return g});"use strict";n.when("A").register("aapi-add-to-cart-helper",function(b){var c=b.$,e=["true","false"],d=b.createClass({init:function(a,b,d){this.csrfToken= a||"";this.marketplace=b||"";this.ajaxEndpoint=d||"";this.asinDataList=[];this.refTag=""},setAsinDataList:function(a){if(Array.isArray(a))return this.asinDataList=a,this},addSingleAsinData:function(a){if(a.asin&&a.offerId&&a.quantity)return this.asinDataList.push(a),this;n.log("asin, offerListingId or quantity of single asinData is empty","WARN")},setRefTag:function(a){this.refTag=a;return this},sendRequest:function(a,b){var d=this;this.asinDataList.length?c.ajax({url:this.constructAjaxUrl(),type:"POST", data:this.constructAddToCartRequest(this.asinDataList),xhrFields:{withCredentials:!0},headers:{"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":this.csrfToken,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},success:function(c){d.verifyCartApiResponse(c)?a(c):b()},error:b}):(n.log("Invalid request with an empty asin list to CartAPI", "WARN"),b())},verifyCartApiResponse:function(a){return"cart.add-items/v1"===a.type&&"items"in a.entity&&0<a.entity.items.length&&"id"in a.entity.items[0]&&this.isCartCountResponseValid(a.entity.count)},isCartCountResponseValid:function(a){return a&&"cart.count/v1"===a.type&&"items"in a.entity},constructAjaxUrl:function(){var a="https://"+this.ajaxEndpoint+"/api/marketplaces/"+this.marketplace+"/cart/carts/retail/items";this.refTag&&(a+="?ref_\x3d"+this.refTag);return a},constructAddToCartRequest:function(a){for(var b= [],d=0;d<a.length;d++){var c=a[d],e={asin:c.asin,offerListingId:c.offerId,quantity:c.quantity},c=this.formatBooleanParams(c);e.additionalParameters=this.constructAdditionalParameters(c);b.push(e)}return JSON.stringify({items:b})},constructAdditionalParameters:function(a){var b={};a.hasOwnProperty("isToBeGiftWrapped")&&"boolean"===typeof a.isToBeGiftWrapped&&(b.giftOptions={includeGiftReceipt:a.isToBeGiftWrapped});a.hasOwnProperty("isDevicePreRegistered")&&"boolean"===typeof a.isDevicePreRegistered&& (b.devicePreregistration={selected:a.isDevicePreRegistered});a.hasOwnProperty("programId")&&a.programId.length&&(b.installments={programId:a.programId});a.hasOwnProperty("incentivizedCart")&&a.incentivizedCart.length&&(b.incentivizedCart=a.incentivizedCart);a.hasOwnProperty("paymentOfferInfo")&&a.paymentOfferInfo.length&&(b.paymentOfferInfo=a.paymentOfferInfo);return b},formatBooleanParams:function(a){for(var b in a)if(a.hasOwnProperty(b)&&"string"===typeof a[b]){var d=a[b].toLowerCase();-1!==e.indexOf(d)&& (a[b]="true"===d)}return a}});return{createRequest:function(a,b,c){return new d(a,b,c)}}});"use strict";n.when("A","bundles-card").register("bundles-secondary-view-item-models",function(b,c){function e(a){try{var b=w.grep(a.entity.images,function(a){return"MAIN"===a.variant});b&&b.length||(b=a.entity.images);return"https://m.media-amazon.com/images/I/"+b[0].lowRes.physicalId+"."+b[0].lowRes.extension}catch(d){n.log("Unable to fetch main image for asin","ERROR")}}function d(a){try{return a.entity.displayString}catch(b){n.log("Unable to fetch title for asin", "ERROR")}}function a(a,b){try{if(a[0].price&&a[0].price.entity[""+b]){var d=a[0].price.entity[""+b];if(d)return d.moneyValueOrRange.value.amount}}catch(c){n.log("Unable to fetch "+JSON.stringify(b)+" price for asin","ERROR")}}function m(a,b){q||(q=new Intl.NumberFormat(a,{style:"currency",currency:b}));return q}var w=b.$,q,u=function(a,b){try{return"stars"===b?a.rating.hasHalfStar?a.rating.fullStarCount+.5:a.rating.fullStarCount:a.count.displayString}catch(d){n.log("Unable to fetch star rating/review count for asin", "ERROR")}},z=function(a,b,d){a=a.parameters;if(a.length)for(var c=0;c<a.length;c++)if(a[c].name===b)return a[c].value;return d};return{validateProductV2Entity:function(a){return a.asin&&a.productImages.entity.images.length&&a.title.entity.displayString&&a.buyingOptions.length?!0:!1},componentData:function(b,g){this.detailPageUrl="/dp/"+b.asin;this.imageUrl=e(b.productImages);this.itemTitle=d(b.title);if(g=a(b.buyingOptions,"basisPrice"))this.basisPrice=m(c.language,c.currencyOfPreference).format(g); b.customerReviewsSummary&&(this.starRating=u(b.customerReviewsSummary.entity,"stars"),this.ratingCount=u(b.customerReviewsSummary.entity,"count"))},recommendationItemData:function(b,g){this.asin=b.asin;this.detailPageUrl="/dp/"+b.asin;this.imageUrl=e(b.productImages);this.itemTitle=d(b.title);b.customerReviewsSummary&&(this.starRating=u(b.customerReviewsSummary.entity,"stars"),this.ratingCount=u(b.customerReviewsSummary.entity,"count"));g=a(b.buyingOptions,"basisPrice");var q=m(c.language,c.currencyOfPreference); g&&(this.basisPrice=q.format(g));this.buyingPrice=q.format(a(b.buyingOptions,"priceToPay"));b.featureBullets&&(this.featureBullets=b.featureBullets.entity.featureBullets);b.buyingOptions[0].callToAction&&b.buyingOptions[0].callToAction.entity&&b.buyingOptions[0].callToAction.entity.addToCart&&b.buyingOptions[0].callToAction.entity.addToCart.data&&(g=b.buyingOptions[0].callToAction.entity.addToCart.data,this.canAddToCart=z(g,"canAddToCart",!1),this.offerListingId=z(g,"offerListingId",""));b.buyingOptions[0].quantity&& b.buyingOptions[0].quantity.entity&&(this.quantityLimit=b.buyingOptions[0].quantity.entity.maxOrderQuantity)}}});"use strict";n.when("A","ready").register("bundle-state",function(b){var c=b.$,e={bundleState:"#bundle-state"};return{elements:e,getBundleASIN:function(){var b=c(e.bundleState);if(b.length)return b.data("asin")}}});"use strict";n.when("A").register("bundles-aapi-util",function(b){var c=b.$;return{getAAPIProductData:function(b,d,a,m,w,q,n){return c.ajax({url:"https://"+b+"/api/marketplaces/"+ q+"/products/"+m,type:"GET",headers:{Accept:w,"x-api-csrf-token":a,"Accept-Language":d,"x-cc-currency-of-preference":n,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getProductV2ResourceInclusions:function(b){return'application/vnd.com.amazon.api+json; type\x3d"collection(product/v2)/v1"; expand\x3d"'+b.join(",")+'"'},getCartData:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/items", type:"GET",data:{filter:"RETAIL"},headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.items.request/v1"',"x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getFullCartCount:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/count",type:"GET",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.count/v1"', "Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.count.request/v1"',"x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getCartSummary:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/summary",type:"GET",data:{cartTypes:"RETAIL"},headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.summary/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.summary.request/v1"', "x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})}}});"use strict";n.when("A").register("bundle-logger",function(b){var c=b.$;b=A.ue||!1;var e=b.count||!1,d=b.log||!1,a=A.ueLogError||!1,m=function(b,c,m,e){"INFO"!==c&&a?(null!==e&&"object"===typeof e?e.message="["+b+"] "+e.message:e={message:"["+b+"]"},a(e,{logLevel:c,attribution:m,message:b})):"INFO"===c&&d&&d(b,m)};return{logCount:function(a,b){if(e)return e(a, b),e(a)},logInfo:function(a,b){m(a,"INFO",b,null)},logWarning:function(a,b,c){m(a,"WARN",b,c)},logError:function(a,b,c){m(a,"ERROR",b,c)},logFatal:function(a,b,c){m(a,"FATAL",b,c)},logRefTag:function(a,b){c.get((b||"/hctp/log/refMarker")+"?ref_\x3d"+a)}}});"use strict";n.when("A").register("bundle-constants",function(){return{BUNDLE_LISTING_V2_READY_EVENT:"bundle-listing-V2:widget:ready",BUNDLE_LISTING_BOTTOM_SHEET_READY_EVENT:"bundle-listing:sheet:ready",BUNDLES_CARD_READY:"bundles-card-ready",BUNDLES_CARD_SECONDARY_VIEW_READY:"bundles-card-secondary-view-ready", BUNDLES_DRAWER_SIDE_SHEET_READY:"bundles-drawer-side-sheet-ready",BUNDLES_CARD_SECONDARY_VIEW_ATC_READY:"bundles-card-secondary-view-atc-ready",BUNDLES_CARD_RENDER_SECONDARY_VIEW:"bundles-card-render-secondary-view",BUNDLES_COMPONENTS_EXPANDER_READY:"a:expander:bundle-components-expander",BUNDLES_POPOVER_BEFORE_SHOW:"a:popover:beforeShow:bundles_secondary_view",BUNDLES_POPOVER_AFTER_HIDE:"a:popover:afterHide:bundles_secondary_view",BUNDLES_TOGGLE_EXPANDER:"toggle-bundle-cards-expander",AJAX_URL:"/gp/product/ajax/bundlesAjaxExperience?asin\x3d"}}); "use strict";n.when("A","bundles-card","bundle-constants","bundles-secondary-view-item-models","bundles-aapi-util","bundles-side-sheet-cart-data","a-truncate","bundles-drawer-side-sheet","bundle-logger","ready").register("bundles-desktop-secondary-view",function(b,c,e,d,a,m,w,q,u){function z(a){q.reset();h.post(e.AJAX_URL+a).done(function(a){a=h(E.ajaxDataWrapper).html(a);q.initialize(a)}).done(function(){b.trigger(e.BUNDLES_CARD_SECONDARY_VIEW_ATC_READY);b.trigger(e.BUNDLES_DRAWER_SIDE_SHEET_READY); h(p.bundleTitle).live("click",function(){if(c.isDevices){var a=h(this).closest(p.bundleExpander).find(p.bundleAsin).val();u.logRefTag(B.BUNDLE_TITLE_CLICKED_DESKTOP+c.landingAsin+x.UNDERSCORE+a)}});h(p.bundleGetDealButton).live("click",function(){if(c.isDevices){var a=h(this).closest(p.bundleExpander).find(p.bundleAsin).val();u.logRefTag(B.GET_DEAL_BUNDLE_CLICKED_DESKTOP+c.landingAsin+x.UNDERSCORE+a)}})}).fail(function(){n.log("Fail to render secondary view for "+a,"ERROR")})}function r(b,l,e){var m= h(p.bundleComponentsExpander+b),t=!1;m.length&&a.getAAPIProductData(c.aapiEndpoint,c.language,c.csrfToken,l,k,c.marketplaceId,c.currencyOfPreference).done(function(a){a=a.entities;for(var b=0;b<a.length;b++){var l=a[b].entity;if(d.validateProductV2Entity(l)){var e=l.asin,l=new d.componentData(l,c.currency),e=m.find(p.bundleComponentCard+e);g(e,l);y(e,l);e.find(f.productBuyingPriceBase).text()&&l.basisPrice&&e.find(f.productFullPrice).text(l.basisPrice)}else{t=!0;break}}m.toggleClass(x.AUI_HIDDEN_CLASS, t);q.updateContent(h(p.bundlesSecondaryViewSideSheet).html())})}function g(a,b){a.find(f.productImageUrl).attr("src",b.imageUrl);a=a.find(f.productTitle);a.attr("href",b.detailPageUrl);a.find(f.productTitleText).append(b.itemTitle);w.get(a.find(f.productTitleTruncate)).update()}function y(a,b){if(b.starRating&&b.ratingCount){var l=b.starRating.toString().replace(".","-");a.find(f.productRatingStars).removeClass("a-star-0").addClass("a-star-"+l);a.find(f.productRatingCount).text(b.ratingCount)}}function t(a, b){var l=h(p.bundlesSecondaryView+" .primary-bundles").children("div");l.length&&(l=l.eq(0).offset().top,b=b.offset().top,a.animate({scrollTop:b-l},2E3))}function v(b,e){var t=h(p.bundlesSecondaryView).find(l.upsellRecommendation+b),B=0;a.getAAPIProductData(c.aapiEndpoint,c.language,c.csrfToken,e,k,c.marketplaceId,c.currencyOfPreference).done(function(a){a=a.entities;for(var b=0;b<a.length;b++){var e=a[b].entity;if(d.validateProductV2Entity(e)){var k=new d.recommendationItemData(e,c.currency),e=t.find(l.accessoryAtcCard+ e.asin);g(e,k);y(e,k);k.buyingPrice&&e.find(f.productBuyingPriceBase).text(k.buyingPrice);k.fullPrice&&e.find(f.productFullPrice).text(k.fullPrice);if(k.featureBullets)for(var n=0;n<k.featureBullets.length;n++)e.find(f.featureBullet).append("\x3cli\x3e"+k.featureBullets[n]+"\x3c/li\x3e");k.quantityLimit&&m.setItemQuantityLimit(k.asin,k.quantityLimit);k.offerListingId&&k.canAddToCart&&(e.find(l.individualRecommendationAtc).find(l.accessoryOfferListingId).val(k.offerListingId),e.toggleClass(x.AUI_HIDDEN_CLASS), B++)}}0<B&&(a=t.find(l.accessoryAtcHeader),a.text(a.text().replace(x.ITEM_COUNT_PLACEHOLDER,B)),a.toggleClass(x.AUI_HIDDEN_CLASS));q.updateContent(h(p.bundlesSecondaryViewSideSheet).html())}).fail(function(){t.toggleClass(x.AUI_HIDDEN_CLASS,!0);n.log("An error has occurred while getting accessory recommendations sub total","WARN")})}var h=b.$,k=a.getProductV2ResourceInclusions("productImages(product.product-images/v2) title(product.offer.title/v1) buyingOptions[].price(product.price/v1) customerReviewsSummary(product.customer-reviews-summary/v1) featureBullets(product.offer.feature-bullets/v1) buyingOptions[].quantity(product.quantity/v2) buyingOptions[].callToAction(product.call-to-action/v1)".split(" ")), f={productImageUrl:".item-image",productTitle:".item-title",productTitleText:".a-truncate-full",productTitleTruncate:".a-truncate",productRatingStars:".a-star-0",productRatingCount:".component-rating-count",productBuyingPriceBase:".buying-item-price-base",productFullPrice:".full-item-price",featureBullet:".feature-bullet"},p={bundlesSecondaryView:"#bundles-secondary-view",bundleAsin:"[name\x3d'bundle-asin']",bundleExpanders:"#bundle-expander-content-",bundleExpander:".secondary-bundle-container", bundleExpanderContent:".bundle-expander-content",bundleExpanderHeader:".bundle-expander-header",bundleComponentsExpander:".bundle-components-expander-",bundleComponentsExpanderHeader:".bundle-components-expander-header",bundleComponentsExpanderContent:".bundle-components-expander-content",bundleComponentCard:".bundle-component-card-",componentAsins:"[name\x3d'component-asins']",expanderAsins:".bundles-secondary-expander-asins",expanderComponentAsins:".bundles-secondary-expander-component-asins",bundlesSecondaryViewSideSheet:"#bundles-desktop-side-sheet", bundleCardAsin:"input[name\x3d'bundle-card-asin']",bundleTitle:".bundle-details-title",bundleGetDealButton:".bundle-get-deal-button",relatedBundlesDivider:".related-bundles-divider"},l={individualRecommendationAtc:".bundles-drawer-individual-recommendation-add-to-cart",accessoryAtcHeader:".bundles-drawer-accessory-atc-header",accessoryOfferListingId:'[name\x3d"accessory-offer-listing-id"]',upsellRecommendation:"#bundle-upsell-recommendations-",accessoryAtcCard:"#bundle-upsell-accessory-atc-card-", bundleAsin:".bundles-sideSheet-accessory-atc-asins",bundleAccessoryAsins:".bundles-sideSheet-accessory-atc-recommendation-asins"},x={AUI_HIDDEN_CLASS:"aok-hidden",SIDE_SHEET:"side-sheet",BUNDLES_CARD_SELECTOR:"div[id^\x3d'bundle-card']",ITEM_COUNT_PLACEHOLDER:"{NUM_OF_ITEMS}",BUNDLE_EXPANDER_HEADING_HIGHLIGHTED_CLASS:"bundle-expander-header-highlighted",BUNDLE_EXPANDER_HEADING_CLASS:"bundle-expander-header",BUNDLE_CARD_CLICKED_REFTAG:"amzdv_tplus_dp_dsk_card_clicked_",UNDERSCORE:"_",INGRESS_CARD_REFTAG:"amzdv_tplus_dp_dsk_expl_simlr_bdl_"}, E={ajaxDataWrapper:'\x3cdiv id\x3d"bundles-desktop-side-sheet-wrapper"\x3e\x3c/div\x3e'},B={BUNDLE_TITLE_CLICKED_DESKTOP:"amzdv_tplus_dp_dsk_bdp_",GET_DEAL_BUNDLE_CLICKED_DESKTOP:"amzdv_tplus_dp_dsk_bgd_"};b.on(e.BUNDLES_CARD_RENDER_SECONDARY_VIEW,function(){z(c.landingAsin)});b.on(e.BUNDLES_DRAWER_SIDE_SHEET_READY,function(){var a=h(p.bundlesSecondaryView),b=a.find(p.expanderComponentAsins),d=a.find(p.expanderAsins);b.length&&b.each(function(l){r(d[l].textContent.trim(),b[l].textContent.trim(),a)}); var e=a.find(l.bundleAsin),f=a.find(l.bundleAccessoryAsins);f.length&&f.each(function(a){v(e[a].textContent.trim(),f[a].textContent.trim())});a=h(p.bundlesSecondaryViewSideSheet);h(".ingress-card").unbind("click").click(function(b){b.preventDefault();c.isDevices&&u.logRefTag(x.INGRESS_CARD_REFTAG+c.landingAsin);q.show(function(){var b=h(p.relatedBundlesDivider);t(a,b)},!0)});c.isUnifiedCxView||h(".bundle-box-link").unbind("click").click(function(b){b.preventDefault();var l=h(this).siblings(p.bundleCardAsin).val(); c.isDevices&&(b=h(".bundle-box-link").index(b.target),u.logRefTag(x.BUNDLE_CARD_CLICKED_REFTAG+b+x.UNDERSCORE+c.landingAsin));q.show(function(b){var l=h(p.bundlesSecondaryView).find(".secondary-bundle-container input[value\x3d'"+b+"']").closest(p.bundleExpander);"false"===l.find(p.bundleExpanderContent).attr("aria-expanded")&&l.find(p.bundleExpanderHeader).click();"false"===l.find(p.bundleComponentsExpanderContent).attr("aria-expanded")&&l.find(p.bundleComponentsExpanderHeader).click();l.find(p.bundleExpanderHeader).removeClass(x.BUNDLE_EXPANDER_HEADING_CLASS).addClass(x.BUNDLE_EXPANDER_HEADING_HIGHLIGHTED_CLASS); b=a.find(".secondary-bundle-container input[value\x3d'"+b+"']").closest(p.bundleExpander);t(a,b)},!1,l)})})});"use strict";n.when("A","MakoAmazonApiAddToCartHelper","bundle-constants","bundles-aapi-util","bundles-card","bundles-side-sheet-cart-data","bundle-logger","a-checkbox").execute("register-bundles-add-to-cart-declarative-actions",function(b,c,e,d,a,m,w,q){function u(a){a&&a.items&&a.items.forEach(function(a){m.setCartItemQuantity(a.asin,a.quantity)})}function z(a){m.setCartTotalCount(a);n.when("nav.setCartCount").execute(function(b){b(a)})} function r(a){h(k.postAddToCartContent).find(p.subTotalContainer).toggleClass(f.AUI_HIDDEN_CLASS,!a)}function g(){d.getCartSummary(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){r(!0);a.entity&&a.entity.summary&&0<a.entity.summary.length&&h(k.postAddToCartContent).find(p.subTotalPrice).text(a.entity.summary[0].subtotal.displayString)}).fail(function(){r(!1);n.log("An error has occurred while getting cart sub total","WARN")})}function y(a){var b=a.asin;if(h(k.atcButton+b).length){var c= q(k.accountLinkingCheckbox+b);c&&(a.isDevicePreRegistered=c.isChecked())}h(k.installmentsCheckbox+b).length&&(c=q(k.installmentsCheckbox+b))&&c.isChecked()&&(a.programId=h(k.installmentsCheckbox+b).val());return a}function t(a){var b=h(k.postAddToCartContent).find(p.proceedToCheckoutText);b.text().includes(f.ITEM_COUNT_PLACEHOLDER)?b.text(b.text().replace(f.ITEM_COUNT_PLACEHOLDER,a)):b.text(b.text().replace(/\d+/,a))}function v(a,b,c,d){b.text(c);a.toggleClass(f.AUI_HIDDEN_CLASS,!0);d.toggleClass(f.AUI_HIDDEN_CLASS, !1)}var h=b.$,k={reachCartLimitMessage:"#bundle-reach-cart-limit-message-",atcButton:"#bundle-ajax-atc-button-",atcErrorBlock:"#bundle-ajax-atc-error-block-",bundlesDrawerSideSheet:"#bundles-desktop-side-sheet",natcForm:"#bundles-drawer-natc-form-",accountLinkingCheckbox:"#bundles-desktop-side-sheet #bundle-account-linking-",accountLinkingHiddenInput:"#bundles-drawer-natc-accountLinking-",installmentsCheckbox:"#bundles-desktop-side-sheet #bundle-account-installments-",installmentsHiddenInput:"#bundles-drawer-natc-installments-", installmentsMessage:"#bundles-desktop-side-sheet #bundles-drawer-installments-message",installmentsMessageText:"#bundles-desktop-side-sheet #bundles-drawer-installments-message-text",bundleExpanders:"#bundle-expander-content-",bundleImage:".bundle-image",bundleContent:"#bundles-desktop-side-sheet .bundle-content",postAddToCartContent:"#bundles-desktop-side-sheet .post-add-to-cart"},f={AUI_HIDDEN_CLASS:"aok-hidden",UNDERSCORE:"_",HIDDEN_TYPE:"hidden",BUNDLE_AJAX_ATC_DECLARATIVE_ACTION:"bundles-ajax-add-to-cart", BUNDLE_NATC_ACCOUNT_LINKING_DECLARATIVE_ACTION:"bundles-account-linking-checkbox",ACCOUNT_LINKING_INPUT_NAME_NATC:"items[0.base][additionalParameters][devicePreregistration][selected]",BUNDLE_NATC_INSTALLMENTS_DECLARATIVE_ACTION:"bundles-installments-checkbox",INSTALLMENTS_INPUT_NAME_NATC:"items[0.base][additionalParameters][installments][programId]",ACCOUNT_LINKING_INPUT_ID_PREFIX:"bundles-drawer-natc-accountLinking-",INSTALLMENTS_INPUT_ID_PREFIX:"bundles-drawer-natc-installments-",ACCESSORY_ATC_DECLARATIVE_ACTION:"bundles-ajax-accessory-atc", ITEM_COUNT_PLACEHOLDER:"{NUM_OF_ITEMS}"},p={accessoryAtcButton:".bundles-drawer-ajax-accessory-atc-button",accessoryAtcCard:".bundles-drawer-accessory-atc-card",accessoryAtcErrorContent:".bundles-drawer-accessory-atc-error-content",accessoryAtcSpinner:".bundles-drawer-accessory-atc-spinner",accessoryAtcSuccessContainer:".bundles-drawer-accessory-atc-success-container",accessoryAtcSuccessContent:".bundles-drawer-accessory-atc-success-content",accessoryOfferListingId:'[name\x3d"accessory-offer-listing-id"]', upsellRecommendationSection:"#bundle-upsell-recommendations-",successCount:".bundles-drawer-success-count",proceedToCheckoutText:".bundles-drawer-proceed-to-checkout-text",addedItemImage:".bundles-drawer-added-item-image",subTotalPrice:".bundles-drawer-accessory-sub-total-price",subTotalContainer:".bundles-drawer-accessory-sub-total-container"};b.on(e.BUNDLES_CARD_SECONDARY_VIEW_ATC_READY,function(){m.resetData();d.getCartData(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){u(a.entity)}); d.getFullCartCount(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){a.entity&&m.setCartTotalCount(a.entity.items)})});b.declarative(f.BUNDLE_AJAX_ATC_DECLARATIVE_ACTION,"click",function(b){b=b.data;var d=b.asin,e=h(k.bundlesDrawerSideSheet),B=e.find(k.atcButton+d),v=e.find(k.reachCartLimitMessage+d),r=e.find(k.atcErrorBlock+d);m.cartContainsItem(d)?(B.addClass(f.AUI_HIDDEN_CLASS),v.removeClass(f.AUI_HIDDEN_CLASS)):(e=c.createRequest(b.csrfToken,b.marketplaceId,b.aapiEndpoint),b={asin:d, offerId:b.offerListingId,quantity:1},b=y(b),e.addSingleAsinData(b),e.setRefTag("bundles_dsk_sec_view_bundle_atc"),w.logCount("bundlesDrawerBundleCartApiSent",1),e.sendRequest(function(b){m.setCartItemQuantity(d,1);var c=m.getCartTotalCount();z(b.entity.count.entity.items);a.isDevices&&w.logRefTag("amzdv_tplus_dp_dsk_atc_"+a.landingAsin+f.UNDERSCORE+d);g();t(m.getCartTotalCount());b=h(k.bundlesDrawerSideSheet).find(k.bundleExpanders+d).find(k.bundleImage).attr("src");var e=0;h(k.installmentsCheckbox+ d).length&&q(k.installmentsCheckbox+d).isChecked()&&(e=m.getCartTotalCount()-c);c=h(k.installmentsMessageText).text();0<e?(h(k.installmentsMessageText).text(c.replace(f.ITEM_COUNT_PLACEHOLDER,e)),h(k.installmentsMessage).toggleClass(f.AUI_HIDDEN_CLASS,!1)):h(k.installmentsMessage).toggleClass(f.AUI_HIDDEN_CLASS,!0);h(p.addedItemImage).attr("src",b);h(k.bundlesDrawerSideSheet).scrollTop(0);h(k.bundleContent).toggleClass(f.AUI_HIDDEN_CLASS,!0);h(k.postAddToCartContent).find(p.upsellRecommendationSection+ d).toggleClass(f.AUI_HIDDEN_CLASS);h(k.postAddToCartContent).toggleClass(f.AUI_HIDDEN_CLASS)},function(){w.logCount("bundlesDrawerBundleCartApiFailed",1);n.log("An error has occurred with Cart API addItems request when add "+d+" from Secondary View.","WARN");a.isDevices&&w.logRefTag("amzdv_tplus_dp_dsk_failed_atc_"+a.landingAsin+f.UNDERSCORE+d);B.addClass(f.AUI_HIDDEN_CLASS);r.removeClass(f.AUI_HIDDEN_CLASS)}))});b.declarative(f.ACCESSORY_ATC_DECLARATIVE_ACTION,"click",function(d){var e=d.data;w.logCount("bundlesDrawerSideSheetAccessoryAtcClicked", 1);var k=e.bundleAsin,h=e.asin,q=d.$target.closest(p.accessoryAtcButton);q.toggleClass(f.AUI_HIDDEN_CLASS,!0);var r=q.closest(p.accessoryAtcCard),u=r.find(p.accessoryAtcSpinner);u.toggleClass(f.AUI_HIDDEN_CLASS);var y=r.find(p.accessoryAtcSuccessContent).find(p.accessoryAtcButton),A=r.find(p.accessoryAtcErrorContent);d=r.find(p.accessoryOfferListingId).val();var C=r.find(p.accessoryAtcSuccessContainer),D=C.find(p.successCount),e=c.createRequest(e.csrfToken,e.marketplaceId,e.aapiEndpoint);e.addSingleAsinData({asin:h, offerId:d,quantity:1});e.setRefTag("bundles_dsk_sec_view_acc_atc");e.sendRequest(function(d){z(d.entity.count.entity.items);A.toggleClass(f.AUI_HIDDEN_CLASS,!0);m.cartContainsItem(h)?m.setCartItemQuantity(h,m.getCartItemQuantity(h)+1):m.setCartItemQuantity(h,1);!m.getItemQuantityLimit(h)||m.getCartItemQuantity(h)<m.getItemQuantityLimit(h)?b.delay(function(){g();t(m.getCartTotalCount());v(u,D,m.getCartItemQuantity(h),C);q.toggleClass(f.AUI_HIDDEN_CLASS,!1);y.toggleClass(f.AUI_HIDDEN_CLASS,!1)},3E3): (g(),t(m.getCartTotalCount()),v(u,D,m.getCartItemQuantity(h),C));a.isDevices&&w.logRefTag("amzdv_tplus_dp_dsk_patc_"+a.landingAsin+f.UNDERSCORE+k+f.UNDERSCORE+h)},function(){w.logCount("bundlesDrawerSideSheetAccessoryAtcFailed",1);u.toggleClass(f.AUI_HIDDEN_CLASS,!0);q.toggleClass(f.AUI_HIDDEN_CLASS,!1);y.toggleClass(f.AUI_HIDDEN_CLASS,!0);A.toggleClass(f.AUI_HIDDEN_CLASS,!1);n.log("An error has occurred with desktop post atc screen add to cart request handler for "+h,"WARN");a.isDevices&&w.logRefTag("amzdv_tplus_dp_dsk_failed_patc_"+ a.landingAsin+f.UNDERSCORE+k+f.UNDERSCORE+h)})});b.declarative(f.BUNDLE_NATC_ACCOUNT_LINKING_DECLARATIVE_ACTION,"change",function(a){var b=a.data.asin,d=q(k.accountLinkingCheckbox+b).isChecked();a=h(k.bundlesDrawerSideSheet).find(k.natcForm+b);var c=a.find(k.accountLinkingHiddenInput+b);c&&c.length&&c.remove();b=h("\x3cinput\x3e",{type:f.HIDDEN_TYPE,name:f.ACCOUNT_LINKING_INPUT_NAME_NATC,value:d,id:f.ACCOUNT_LINKING_INPUT_ID_PREFIX+b});a.append(b)});b.declarative(f.BUNDLE_NATC_INSTALLMENTS_DECLARATIVE_ACTION, "change",function(a){a=a.data.asin;var b=q(k.installmentsCheckbox+a),d=h(k.installmentsCheckbox+a).val(),c=b.isChecked(),b=h(k.bundlesDrawerSideSheet).find(k.natcForm+a),e=b.find(k.installmentsHiddenInput+a);e&&e.length&&e.remove();c&&(a=h("\x3cinput\x3e",{type:f.HIDDEN_TYPE,name:f.INSTALLMENTS_INPUT_NAME_NATC,value:d,id:f.INSTALLMENTS_INPUT_ID_PREFIX+a}),b.append(a))})});"use strict";n.when("A","bundles-focus-management","ready").register("bundles-drawer-side-sheet",function(b,c){function e(a,b){u= document.activeElement;if(a)d("#bundle-expander-header-"+a).focus();else{if(b&&(a=d(g.SIDE_SHEET_CONTAINER).find(g.RELATED_BUNDLES),a.length))return a.find('[id^\x3d"bundle-expander-header-"]:first').focus(),y;d(g.SIDE_SHEET_CONTAINER).find('[id^\x3d"bundle-expander-header-"]:first').focus()}}var d=b.$,a,m,n,q=!1,u,z,r,g={SIDE_SHEET_MODAL_LAYER:"#bundles-desktop-side-sheet-modal-wrapper",SIDE_SHEET_CONTAINER:"#bundles-desktop-side-sheet",SIDE_SHEET_DARK_BACKGROUND:"#bundles-side-sheet-bg",PAGE_BODY:"body", RELATED_BUNDLES:".related-bundles"},y={initialize:function(b){n=b;d(g.SIDE_SHEET_CONTAINER).html(n);a=this.close},onKeyDown:function(b){27===b.which&&a()},close:function(){b.delay(function(){b.hide(g.SIDE_SHEET_DARK_BACKGROUND)},400);d(g.SIDE_SHEET_CONTAINER).animate({right:m},{duration:500,complete:function(){d(g.SIDE_SHEET_CONTAINER).addClass("aok-hidden");d(g.SIDE_SHEET_MODAL_LAYER).addClass("aok-hidden");d(document).unbind("keydown",this.onKeyDown);d(g.PAGE_BODY).removeClass("bundles-scroll-disabled"); q=!1;u.focus()}})},show:function(a,c,h){d(g.SIDE_SHEET_CONTAINER).html(n);d(g.SIDE_SHEET_CONTAINER).scrollTop(0);d(g.SIDE_SHEET_MODAL_LAYER).removeClass("aok-hidden");d(g.SIDE_SHEET_CONTAINER).removeClass("aok-hidden");d(g.SIDE_SHEET_CONTAINER).animate({right:"0"},500,"linear");b.delay(function(){b.show(g.SIDE_SHEET_DARK_BACKGROUND)},400);d(g.PAGE_BODY).addClass("bundles-scroll-disabled");d(document).unbind("keydown",this.onKeyDown);d(document).keydown(this.onKeyDown);a&&"function"===typeof a&&a(h); m=d(g.SIDE_SHEET_CONTAINER).css("right");q=!0;e(h,c)},reset:function(){n=null;q=!1;u=null;z=!1;r=null},isReadyToShow:function(){return null!==n},updateContent:function(a){n=a}};document.addEventListener("focus",function(a){if(q&&!z){var b=d(g.SIDE_SHEET_MODAL_LAYER).get(0);b.contains(a.target)?r=a.target:(z=!0,c.focusDescendant(b,"first"),r===document.activeElement&&c.focusDescendant(b,"last"),z=!1,r=document.activeElement)}},!0);return y});"use strict";n.register("bundles-side-sheet-cart-data",function(){var b= {},c={},e;return{resetData:function(){b={};c={}},setCartItemQuantity:function(d,a){b[d]=a},getCartItemQuantity:function(d){return b[d]},cartContainsItem:function(d){return d in b},setCartTotalCount:function(b){e=b},getCartTotalCount:function(){return e},getItemQuantityLimit:function(b){return c[b]},setItemQuantityLimit:function(b,a){c[b]=a}}});"use strict";n.when("A","bundles-drawer-side-sheet","bundles-card","bundle-logger").execute("register-bundles-side-sheet-declarative-actions",function(b,c, e,d){var a=b.$;b.declarative("open-bundles-drawer-side-sheet","click",function(a){c.isReadyToShow()&&(e.isDevices&&d.logRefTag("amzdv_tplus_dp_dsk_shown_all_"+e.landingAsin),c.show())});b.declarative("close-bundles-side-sheet","click",function(a){c.close()});b.on("a:expander:bundle-components-expander:toggle:expand",function(b){a("#bundles-secondary-view .bundle-expander-header-highlighted").removeClass("bundle-expander-header-highlighted").addClass("bundle-expander-header");e.isDevices&&(b=b.expander.$expander.closest(".secondary-bundle-container").find("[name\x3d'bundle-asin']").val(), d.logRefTag("amzdv_tplus_dp_dsk_witb_"+e.landingAsin+"_"+b))})});"use strict";n.register("bundles-focus-management",function(){return{attemptFocus:function(b){try{b.focus()}catch(c){}return b===document.activeElement},focusDescendant:function(b,c){if(b&&b.children)for(var e=0;e<b.children.length;e++){var d=b.children.item("last"===c?b.children.length-e-1:e);if(this.attemptFocus(d)||this.focusDescendant(d,c))return!0}return!1}}})}); /* ******** */ (function(f){var g=window.AmazonUIPageJS||window.P,v=g._namespace||g.attributeErrors,e=v?v("SmartHomeDPAssets",""):g;e.guardFatal?e.guardFatal(f)(e,window):e.execute(function(){f(e,window)})})(function(f,g,v){f.when("A","a-button","a-checkbox","sh-badge-utils","ready").execute(function(e,y,n,x){function m(c){var e=w[c],a=y(d.selectors.shAtcBtn);0<c?(a.enable(),q(d.selectors.shTotalPriceContainer).css("visibility","visible")):(a.disable(),q(d.selectors.shTotalPriceContainer).css("visibility","hidden")); a.text(e)}function k(){var c=0,e=0,a=[];q(d.selectors.shCheckbox).each(function(){var b=q(this);b.find("input").prop("checked")&&(e++,b=b.data(),a.push({asin:b[d.dataProperties.checkboxAsin],offerListingId:b[d.dataProperties.checkboxOfferListingId]}),c+=b[d.dataProperties.checkboxPrice])});x.injectUniversalAddToCartParams(a,d.selectors.shAtcFormFields);x.updatePrice(d.selectors.shAtcTotalPriceText,p,c,f,r);m(e)}var d={selectors:{shAtcBtn:"#sh-badge-v2-atc-btn",shCheckbox:".sh-badge-v2-chkBox",shAtcTotalPriceText:"#sh-badge-v2-simple-total-price", shAtcFormFields:".sh-badge-v2-atc-form-fields",shTotalPriceContainer:"#sh-badge-v2-atc-total-price-container"},pageStateModels:{shAtcBtnMsg:"sh-badge-v2-atc-btn-messages",shBadgeV2WidgetData:"sh-badge-v2-data"},pageStateModelKeys:{currencyDecimalSeparator:"currencyDecimalSeparator",currencyCode:"currencyCode",priceFormat:"priceFormat"},declarativeActions:{shCheckBoxEventHandler:"sh-badge-v2-chkBox-action"},dataProperties:{checkboxPrice:"price",checkboxAsin:"asin",checkboxOfferListingId:"offerlistingid"}, events:{expanderCollapse:"a:expander:sh-badge-v2-rq-device-expander:toggle:collapse"}},c=e.state(d.pageStateModels.shBadgeV2WidgetData);if("object"!==typeof c)return!1;var f=c[d.pageStateModelKeys.currencyCode],p=c[d.pageStateModelKeys.priceFormat],r=c[d.pageStateModelKeys.currencyDecimalSeparator],w=e.state(d.pageStateModels.shAtcBtnMsg);r||(r="");if(!r&&"JPY"!==f||!f||!p||"object"!==typeof w)return!1;var q=e.$;e.declarative(d.declarativeActions.shCheckBoxEventHandler,"change",function(){k()});e.on(d.events.expanderCollapse, function(){n(d.selectors.shCheckbox).check()});n(d.selectors.shCheckbox).enable();e.on("a:pageUpdate",function(){n(d.selectors.shCheckbox).enable()})});"use strict";f.when("A","sh-accounting","ready").register("sh-badge-utils",function(e,f){var n=e.$;return{injectUniversalAddToCartParams:function(e,m){var k=n(m);k.empty();e.forEach(function(d,c){n("\x3cinput\x3e").attr({type:"hidden",name:"ASIN."+c,value:d.asin}).appendTo(k);n("\x3cinput\x3e").attr({type:"hidden",name:"offerListingID."+c,value:d.offerListingId}).appendTo(k)})}, updatePrice:function(e,m,k,d,c){k=f.formatNumber(k,"JPY"===d?"0":"2",","===c?".":",",c);m=m.replace(/([0.,]*[0][0.,]*)/,k);n(e).html(m)}}});f.register("sh-accounting",function(){function e(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function f(a){return p?p(a):"[object Array]"===r.call(a)}function n(a){return a&&"[object Object]"===r.call(a)}function x(a,b){var c;a=a||{};b=b||{};for(c in b)b.hasOwnProperty(c)&&null==a[c]&&(a[c]=b[c]);return a}function m(a,b,c){var e=[],d,f;if(!a)return e;if(g&& a.map===g)return a.map(b,c);d=0;for(f=a.length;d<f;d++)e[d]=b.call(c,a[d],d,a);return e}function k(a,b){a=Math.round(Math.abs(a));return isNaN(a)?b:a}function d(a){var b=c.settings.currency.format;"function"===typeof a&&(a=a());return e(a)&&a.match("%v")?{pos:a,neg:a.replace("-","").replace("%v","-%v"),zero:a}:a&&a.pos&&a.pos.match("%v")?a:e(b)?c.settings.currency.format={pos:b,neg:b.replace("%v","-%v"),zero:b}:b}var c={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",", precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},g=Array.prototype.map,p=Array.isArray,r=Object.prototype.toString,w=c.unformat=c.parse=function(a,b){if(f(a))return m(a,function(a){return w(a,b)});a=a||0;if("number"===typeof a)return a;b=b||c.settings.number.decimal;var d=new RegExp("[^0-9-"+b+"]",["g"]);a=parseFloat((""+a).replace(/\((.*)\)/,"-$1").replace(d,"").replace(b,"."));return isNaN(a)?0:a},q=c.toFixed=function(a,b){b=k(b,c.settings.number.precision);var d= Math.pow(10,b);return(Math.round(c.unformat(a)*d)/d).toFixed(b)},v=c.formatNumber=c.format=function(a,b,d,e){if(f(a))return m(a,function(a){return v(a,b,d,e)});a=w(a);var t=x(n(b)?b:{precision:b,thousand:d,decimal:e},c.settings.number),u=k(t.precision),h=0>a?"-":"",l=parseInt(q(Math.abs(a||0),u),10)+"",g=3<l.length?l.length%3:0;return h+(g?l.substr(0,g)+t.thousand:"")+l.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+t.thousand)+(u?t.decimal+q(Math.abs(a),u).split(".")[1]:"")},z=c.formatMoney=function(a, b,e,g,t,u){if(f(a))return m(a,function(a){return z(a,b,e,g,t,u)});a=w(a);var h=x(n(b)?b:{symbol:b,precision:e,thousand:g,decimal:t,format:u},c.settings.currency),l=d(h.format);return(0<a?l.pos:0>a?l.neg:l.zero).replace("%s",h.symbol).replace("%v",v(Math.abs(a),k(h.precision),h.thousand,h.decimal))};c.formatColumn=function(a,b,g,q,t,u){if(!a)return[];var h=x(n(b)?b:{symbol:b,precision:g,thousand:q,decimal:t,format:u},c.settings.currency),l=d(h.format),r=l.pos.indexOf("%s")<l.pos.indexOf("%v")?!0:!1, p=0;a=m(a,function(a,b){if(f(a))return c.formatColumn(a,h);a=w(a);a=(0<a?l.pos:0>a?l.neg:l.zero).replace("%s",h.symbol).replace("%v",v(Math.abs(a),k(h.precision),h.thousand,h.decimal));a.length>p&&(p=a.length);return a});return m(a,function(a,b){return e(a)&&a.length<p?r?a.replace(h.symbol,h.symbol+Array(p-a.length+1).join(" ")):Array(p-a.length+1).join(" ")+a:a})};return c})}); /* ******** */ (function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageVoltageComplianceAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){}); /* ******** */ (function(g){var n=window.AmazonUIPageJS||window.P,v=n._namespace||n.attributeErrors,b=v?v("ProductAdsDetailPageAssets",""):n;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,n,v){g.when("A","a-carousel-framework","a-carousel-ajax-standard").register("AmazonClicks",function(b,n,t){function q(c,a,k,f){var l=c.getAttr("pageNumber"),w;w=c.getAttr("initialSeenAsins");for(var r=c.getAttr("fetchedItems").slice(w.length),p=0;p<r.length;p++)r[p]&&r[p].oid&&w.push(r[p].oid); r=c.getAttr("filteredItems");for(p=0;p<r.length;p++)r[p]&&w.push(r[p]);w=w.join("");k.pg=l;k.tot=c.getAttr("set_size");k.start=k.offset;k.num=k.count;k.cc=1===l?0:k.offset;k.oData=w;l=c.getAttr("ajax");c.setAttr("requestTimer",b.delay(d,l.fetch_delay,c,a,k,f))}function d(c,a,k,f){c.triggerEvent("beforeAjax",{url:a,params:k});b.get(a,{cache:!1,success:function(l){l=C(l,a);if(null===l)g.error("Invalid JSON returned to carousel from "+a+" - see http://tiny/c1mr5h0u for details.","a-carousel-ajax-standard", "sendRequest");else{k.needSetSize&&(l&&l.length||g.error("Carousel requires a set_size and none was returned by the fallback AJAX request at: "+a,"a-carousel-ajax-standard","sendRequest"),c.setAttr("set_size",l[0].setSize?l[0].setSize:l.length));for(var f=c.getAttr("fetchedItems"),r=c.getAttr("filteredItems"),p=c.getAttr("ajax"),d=[],e,h=l.length,m=0;h--;)e=l[h],null===e&&d.push(h),e&&e.isFilteredItem&&"true"===e.isFilteredItem?(r.push(e.oid),m++):(e&&(e.content||""===e.content?e.content=b.trim(e.content): e=b.trim(e)),f[k.offset+h]=e);z=1*m/l.length;p.remove_nulls&&p.id_list&&d.length&&(b.each(d,function(c){p.id_list.splice(k.offset+c,1)}),c.setAttr("ajax",p));k.needSetSize&&c.init();c.setAttr("fetchedItems",f);c.setAttr("filteredItems",r);c.setAttr("ajaxLock",!1);c.getAttr("pageSize")*c.getAttr("pageNumber")>=f.length&&c.strategies.ajax.wantCurrentPage(c);c.triggerEvent("ajaxSuccess",{url:a,params:k})}},error:function(){b.delay(function(){var a=b.$("#"+c.dom.$container[0].id+" li.a-carousel-card-empty"); 0<a.length&&(c.setAttr("set_size",a[0].getAttribute("aria-posinset")-1),a.removeClass("a-carousel-card-empty"))},200)},params:k,headers:f})}function C(c,a){return b.isArray(c)?c:c!==v&&null!==c&&!b.objectIsEmpty(c)&&c.hasOwnProperty("data")&&b.isArray(c.data)?c.data:null}function e(c,B){Array.isArray(c)&&b.each(c,function(c){a[c]=B})}function h(c){b.each(a,function(b,k){b===c&&delete a[k]})}var A={},a={},m={},u={},y=[],z=0,x=b.extend([],t),D=function(c,b,a){return function(){c.apply(b,a)}};x.init= function(c){var a=c.getAttr("ajax");if(a&&a.params){var k=a.params;if((a=c.getAttr("fetchedItems"))&&a.length!==k.start){var f=0;a.forEach(function(c){c&&f++});var l=[];c.dom.$carousel.children("li").each(function(c,a){if(c>=k.start)return!1;l.push(b.trim(a.innerHTML))});f!==l.length&&(k.offset=l.length,c.setAttr("fetchedItems",l))}}t.init(c)};x.getItems=function(c,a,k,f){var l=!1,e=c.getAttr("name");b.each(u,function(c,a){a!==e&&(l=l||c)});c=D(q,this,[c,a,k,f]);(a=m[e]!==v)&&l?y.push(c):(a&&(u[e]= !0),c())};x.want=function(c,a,b){var f=Math.ceil(10*z);b=Math.max(b,c.getAttr("pageSize")*f);b=Math.min(b,30);if(!c.getAttr("ajaxLock")){if(f=c.getAttr("requestTimer"))clearTimeout(f),c.setAttr("requestTimer",null);var f=c.getAttr("ajax"),e=c.getAttr("set_size");if(f.url){var d=c.getAttr("fetchedItems"),h=f.id_list;h||(h=[]);var p=-1<a?a:0;a=a+b-1;var m=f.params||{},g=f.headers||{},u=[],q=[];0===e&&(h.length&&(e=h),m.needSetSize="true",c.setAttr("ajaxLock",!0));for(-1===b&&e&&(a=e);p<=a;)d[p]||((b= h[p])&&u.push(b),q.push(p)),p++;c.setAttr("fetchedItems",d,{silent:!0});m.count=q.length;m.offset=q[0]||0;0<u.length&&(m[f.id_param_name]=u.join(","));(0<q.length||m.needSetSize)&&this.getItems(c,f.url,m,g)}}};n.registerStrategy("ajax","clicksCustomAjax",x);return{registerFeedbackEvents:function(c,a,e,f,l){var d=!0,h=function(){b.$("#"+a).text(f);d=!1;b.$("."+l).each(function(){b.$(this).show()})},m=function(){b.$("#"+a).text(e);d=!0;b.$("."+l).each(function(){b.$(this).hide()})};b.$("#"+a).click(function(){d? h():m()});b.on("a:carousel:"+c+":change:pageNumber",m);m()},registerFeedbackEventsWithSponsoredLabel:function(a,e,k,f){var d=!0,h=function(){b.$("#"+k).show();d=!1;b.$("."+f).each(function(){b.$(this).show()})},m=function(){b.$("#"+k).hide();d=!0;b.$("."+f).each(function(){b.$(this).hide()})};b.$("#"+e).click(function(){d?h():m()});b.on("a:carousel:"+a+":change:pageNumber",m);m()},truncateTitles:function(a){b.$("."+a).each(function(){var e=b.$(this);if("hidden"===e.css("overflow")){var d=e.html(), f=b.$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(e.width()).height("auto");e.after(f);for(f.html(d);0<d.length&&f.height()>e.height();)d=d.substr(0,d.length-1),f.html(d+"\x26#133;");e.html(f.html()).height("auto").removeClass(a);f.remove()}})},preventSpinners:function(a,e){A[a]===v&&(b.on("a:carousel:"+a+":ajaxSuccess",function(a){b.delay(function(){var c=b.$("#"+e+" li.a-carousel-card-empty");0<c.length&&(a.carousel.setAttr("set_size",c[0].getAttribute("aria-posinset")- 1),c.removeClass("a-carousel-card-empty"))},200)}),A[a]="defined")},registerCarouselToSaveAsins:function(a,d,k){h(a);e(k,a);u[a]=!1;m[a]===v&&(b.on("a:carousel:"+a+":ajaxSuccess",function(d){var h=d.carousel.getAttr("fetchedItems").slice(-1*d.params.count),m=[];b.each(h,function(a){m.push(a.oid)});e(m,a);u[d.carousel.getAttr("name")]=!1;0<y.length&&y.shift()()}),m[a]=d)}}});(function(b,n,t){function q(){return b.P&&b.P.AUI_BUILD_DATE}q()?(g.when("jQuery").register("sponsored-products-truncator-jQuery", function(b){return b}),g.when("ready").register("sponsored-products-truncator-ready",function(){})):b.amznJQ&&(b.amznJQ.available("jQuery",function(){g.register("sponsored-products-truncator-jQuery",function(){return b.amznJQ.jQuery})}),b.amznJQ.onReady("jQuery",function(){g.register("sponsored-products-truncator-ready",function(){})}),b.amznJQ.available("amazonShoveler",function(){g.register("sponsored-products-truncator-amznJQ-shoveler",function(){})}));g.register("sponsored-products-truncator-util", function(){function d(b,d){g({logLevel:b,attribution:"ProductAdsDetailPageAssets",message:"[sponsored-products-truncator] "+d})}var g=b.ueLogError;"function"!==typeof g&&(g=function(b,d){if(d&&d.message)throw Error(d.message);if(b&&b.message)throw Error(b.message);});return{constants:{FEATURE_NAME:"SponsoredProductsTitleTruncation"},count:b.ue&&b.ue.count||function(){},isAUI:q,log:{warn:function(b){d("WARN",b)},error:function(b){d("ERROR",b)}}}})})(n,document);(function(b,n,t){g.when("A","sponsored-products-truncator-jQuery", "sponsored-products-truncator-util").register("sponsored-products-truncator-line-truncator",function(b,d,g){function e(a){this.$element=a;this.$experimentElement=d("\x3cdiv\x3e").addClass("sponsored-products-truncator-offscreen-truncate");this.maxRows=a.attr("data-rows");this.text=a.attr("data-fulltext")?a.attr("data-fulltext"):this.$element.html();this.lineHeight=this.getLineHeight();this.maxRows||g.log.error("Truncation element missing necessary line number data")}var h,n;h=/(?=[ \-\/])|(?=[\u3105-\u312F])|(?=[\u31A0-\u31BA])|(?=[\u4E00-\u9FD5])|(?=[\u3400-\u4DB5])|(?=[\uF900-\uFAFF])|(?=[\u3040-\u309F])|(?=[\u30A0-\u30FF])|(?=[\u3190-\u319F])/; n=/[^\/\-\[\]():\s]/;e.prototype.truncate=function(){var a=this.text,b,a=d.trim(a);this.$element.append(this.$experimentElement);this.checkLineFit(a)?this.text!==this.$element.html()&&this.$element.html(a):(b=this.truncateByToken(a))?(this.$element.html(b),this.$element.attr({title:a})):g.log.error("Unable to successfully truncate line "+a);this.$experimentElement.remove()};e.prototype.getLineHeight=function(){var a=this.$element.html(),b;this.$element.html("\x26hellip;");b=this.$element.innerHeight(); this.$element.html(a);return b};e.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return Math.round(a)<=this.maxRows};e.prototype.truncateByToken=function(a){a=a.split(this.getTokenSeparatorRegex());var b=a.length,d=0,e,h,g;for(g=1;g!==b;)if(e=Math.floor((b+g)/2),h=a.slice(0,e).join("")+"\x26hellip;",this.checkLineFit(h)){if(1>=b-e){for(d=e;0<d&&!n.test(a[d-1]);)d--;break}g=e}else b=e;if(0!==d)return a.slice(0,d).join("")+ "\x26hellip;"};e.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":h};return{truncateLines:function(a){a.find(".sponsored-products-truncator-truncate:visible, .sponsored-products-truncator-truncate-medium:visible").each(function(){(new e(d(this))).truncate();d(this).addClass("sponsored-products-truncator-truncated").removeClass("sponsored-products-truncator-truncate sponsored-products-truncator-truncate-medium");d(this).removeClass(function(a,b){return(b.match(/sponsored-products-truncator-line-clamp-\d/g)|| []).join(" ")})});b.trigger("sponsored-products-truncator:linestruncated")}}});g.when("jQuery","A","sponsored-products-truncator-line-truncator","a-carousel-framework").register("sp-dp-carousel-truncation",function(b,d,g,e){function h(a){"string"===typeof a?(g.truncateLines(d.$("#"+a)),e.getCarouselByName(a+"_carousel")&&d.trigger("spTruncationComplete",e.getCarouselByName(a+"_carousel"))):(g.truncateLines(a.carousel.dom.$container),d.trigger("spTruncationComplete",a.carousel))}var n="sp_detail sp_detail2 sp_detail_thematic sp_phone_detail sp_phone_detail2 sp_phoneapp_detail sp_phoneapp_detail2 sp_phone_detail_thematic sp_phoneapp_detail_thematic".split(" "); d.on("spCarouselNoTruncationRegistration",function(){var a=d.state("spTruncatorStatus");if(!a||!a.truncationInitialized){for(a=n.length-1;0<=a;a--)h(n[a]),d.on("a:carousel:"+n[a]+"_carousel:change:animating",h),d.on("a:carousel:"+n[a]+"_carousel:change:loading",h),d.on("a:carousel:"+n[a]+"_carousel:change:pageSize",h);d.state("spTruncatorStatus",{truncationInitialized:!0})}});d.on("spMobileCarouselAjaxComplete",h);return{setUpTruncation:function(a){h(a);d.on("a:carousel:"+a+"_carousel:change:animating", h);d.on("a:carousel:"+a+"_carousel:change:loading",h);d.on("a:carousel:"+a+"_carousel:change:pageSize",h)}}})})(n,document);g.execute("ClickLoggingUrlParamRemover",function(){if(history&&history.replaceState){var b=n.location.href,b=b.split("?");if(2<=b.length){for(var g=encodeURIComponent("spc")+"\x3d",t=b[1].split(/[&;]/g),q=t.length;0<q--;)-1!==t[q].lastIndexOf(g,0)&&t.splice(q,1);b=b[0]+(0<t.length?"?"+t.join("\x26"):"");n.history.replaceState({},document.title,b)}}})}); /* ******** */ (function(d){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,b=r?r("SponsoredProductsViewabilityAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,r){d.when("A","SponsoredProductsEventBatcher","SPHAT").register("SponsoredProductsViewability",function(b,l,h){function k(c,a){c="SPView-"+a+"-"+c;f.ue&&f.ue.count(c,(f.ue.count(c)||0)+1)}function n(c){return{qualifier:a("qualifier",c),id:a("id",c),widgetName:a("widgetName",c), adId:a("adId",c),adIndex:a("adIndex",c),eventType:a("eventType",c)}}function a(c,a){return(c=(new RegExp("[?\x26]"+c+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(a))&&c[2]?decodeURIComponent(c[2].replace(/\+/g," ")):""}function e(c){g[c.selector].viewHandler=b.delay(function(){if(c){var a=c.data("viewpixelurl");a&&-1===d.indexOf(a)&&(l.sendRequest(n(a+"\x26eventType\x3d1")),d.push(a),g[c.selector]&&(g[c.selector].viewState="VIEWED",k("viewUrlSuccess",g[c.selector].placementId)),p())}},500)}function p(){for(var c in g)if("VIEWED"=== g[c].viewState)delete g[c];else{var a=b.$(c),m=g[a.selector].viewState;"VIEWED"!==m&&(b.onScreen(a,-.15*a.height())?"OFF"===m&&(g[a.selector].viewState="ON",e(a)):"ON"===m&&(g[a.selector].viewState="OFF",clearTimeout(g[a.selector].viewHandler)))}}var g={},d=[],q=[],m=[];b.on("spViewTrackingElementLoaded",p);return{registerViewTrackingElement:function(a,e){-1===d.indexOf(a.data("viewpixelurl"))&&(k("totalAds",e),g[a.selector]={viewState:"OFF",viewHandler:null,placementId:e},b.trigger("spViewTrackingElementLoaded"))}, registerAuiEvents:function(a){Array.isArray(a)&&a.forEach(function(a){if(-1===m.indexOf(a))b.on(a,p)})},loadImagePixel:function(a,b,e,m){!h.checkForHiddenElementsWithTargetList(b,e,m)&&Array.isArray(q)&&-1===q.indexOf(a)&&(q.push(a),l.sendRequest(n(a)))}}});d.when("A","SponsoredProductsViewabilityConfig").register("SponsoredProductsEventBatcher",function(b,l){function h(a,c){a||(q+=1,g+=c);p+=c;t+=1;k("avgRequestFailurePerPage",q/t);k("avgEventFailurePerPage",g/p)}function k(a,c){f.ue&&f.ue.count("SPBatch-"+ a,c)}function n(a){var c=[];b.each(a,function(a){c.push({data:a})});return{events:c}}function a(){if(0<e.length){var a=e.length,c=n(e);e=[];var g=/unagi-\w\w.amazon.com\/1\/events\/com.amazon.eel.SponsoredProductsEventTracking.(prod|gamma)/;l.eelEndpoint!==r&&g.test(l.eelEndpoint)?b.ajax(l.eelEndpoint,{method:"post",params:c,paramsFormat:"json",contentType:"application/json",accepts:"application/json",success:function(c,b,e){h(!0,a);k("batchSuccess",a)},error:function(c,b,e){d.log("Warning -- sushi response: "+ e+" | StatusText: "+b+" | xhrStatusCode: "+(c.http?c.http.status:"could not get xhr status code. ")+" | url: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets");h(!1,a);k("batchError",a)}}):(h(!1,a),k("batchError",a),d.log("Warning -- sushi endpoint incorrectly configured with: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets"))}}var e=[],p=0,g=0,t=0,q=0;b.interval(function(){a()},250);f.addEventListener("beforeunload",function(){a()});return{sendRequest:function(b){e.push(b);15< e.length&&a()},_batchRequest:function(){a()}}});d.when("A","SponsoredProductsEventBatcher").register("SPHAT",function(b,d){function h(a,b){a&&f.ue&&f.ue.count&&f.ue.count(a,(f.ue.count(a)||0)+b?1:0)}function k(a,e){return a&&e?0<b.$(a).find(e.join(",")).filter(function(){return"hidden"===b.$(this).css("visibility")||"0"===b.$(this).css("opacity")||b.$(this).is(":hidden")}).length:!1}function n(a,e){var d=":hidden";b.$.each(e,function(a,b){d+=":not("+b+")"});return 0<b.$(a).children(d).length}return{checkForHiddenElementsWithTargetList:function(a, b,d){a=k(a,b);h(d,a);return a},checkForHiddenElements:function(a,b,d){a=n(a,b);h(d,a);return a}}});d.when("A","ready").register("SponsoredProductsViewabilityConfigInitializer",function(b){function f(b){d.register("SponsoredProductsViewabilityConfig",function(){return{eelEndpoint:b,updateEelEndpoint:function(a){this.eelEndpoint=a}}})}var h=b.state("SpViewabilityConfigState"),k=!1;"undefined"!==typeof h&&null!==h&&"undefined"!==typeof h.eelEndpoint&&null!==h.eelEndpoint&&(k=!0,f(h.eelEndpoint));b.state.bind("SpViewabilityConfigState", function(b,a){a.eelEndpoint&&"undefined"!==typeof b.eelEndpoint&&null!==b.eelEndpoint&&(k?d.when("SponsoredProductsViewabilityConfig").execute(function(a){a.updateEelEndpoint(b.eelEndpoint)}):(k=!0,f(b.eelEndpoint)))})})}); /* ******** */ (function(b){var e=window.AmazonUIPageJS||window.P,g=e._namespace||e.attributeErrors,d=g?g("SponsoredProductsAddToCartAssets",""):e;d.guardFatal?d.guardFatal(b)(d,window):d.execute(function(){b(d,window)})})(function(b,e,g){b.when("A").register("sp-atc-config",function(){return{getClientID:function(){return"sspa-dp-desktop"}}});"use strict";b.when("sp-atc-config","fresh-add-to-cart","A").execute(function(d,b,k){var h={},f=function(a,c){var b=k.capabilities.mobile?"mobile":"desktop";a="spF3Atc."+b+ "."+a+"."+c;e.ue&&e.ue.count(a,(ue.count(a)||0)+1)},l=function(a){var c=a&&a.additionalParams?a.additionalParams.loggingUrl:g;c&&!h[c]?k.post(c,{success:function(a){h[c]=!0;f("logClick","success")},error:function(a,c,b){f("logClick","failure")}}):h[c]?f("logClick","duplicate"):c||f("logClick","missingData")};b.addToFreshCart({clientID:d.getClientID(),success:function(a,c){l(a.data);f("addToCart","success")},error:function(a,c,b,d){f("addToCart","failure")}})})}); /* ******** */ (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,p,m,n,b,t,r,g){var q;f.when("EWC").execute(function(b){q= 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 k(b,a,l,h){w(b);m.error(b,a,l,h)}function w(h,c){c=c||{};var g=h.data.sessionID;c.title=D(h.data.title);c.asin=h.data.asin;c.offerListingID=h.data.offerListingID;c.sessionID=g;switch(c.reasonCode?c.reasonCode:F){case y.itemNotAvailable:b.increment(l.freshUATCItemNotAvailableErrorCountMetric); break;case y.itemPartiallyAvailable:b.increment(l.freshUATCItemPartiallyAvailableErrorCountMetric);break;case y.itemPartiallyAvailableForReservation:b.increment(l.freshUATCItemPartiallyAvailableForReservationErrorCountMetric);break;case y.itemNotAvailableForReservation:b.increment(l.freshUATCItemNotAvailableForReservationErrorCountMetric);break;case y.itemPriceUnavailable:b.increment(l.freshUATCItemPriceUnavailableErrorCountMetric);break;case y.itemCountOverflow:b.increment(l.freshUATCItemCountOverflowErrorCountMetric); break;default:b.increment(l.freshUATCEmptyItemStatusCodeErrorCountMetric),f.log("fresh-atc-handler: No error status code.","ERROR")}c=e.param(c);d.create(h.$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){u(g);d.remove(b.popover)})}function D(b){var a={"\x26amp;":"\x26"},h;for(h in a)a.hasOwnProperty(h)&&(b=b.replace(h,a[h]));return b}function B(b){return b.filter(function(b){return b.statusKey in A})}function h(b,a,h){h+=" returned by UATC is not an array";f.log(h,"Error",a);k(b,"","",h)}function x(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 t=e.data.sessionID;if(t){var n=r.val();n||(f.log('fresh-atc-handler: "quantity" action parameter is missing.',"ERROR"),n=1);b.setWidgetClickTimestamp(l.freshUATCTCallScope);c({asin:m,offerListingID:z,sessionID:t,quantity:n,reftag:"afx-dp-addtocart",success:function(c){try{b.sendWidgetMetrics(l.freshUATCTCallScope); var m;if(c&&c.isOK){var z=c.extraErrorInfos;if(z&&z.constructor===Array&&0<z.length)m=!0;else{var r=c.statusList,C;if(r&&r.constructor===Array&&0<r.length){var y=B(r);C=y&&0<y.length}else C=!1;m=C?!0:!1}}else m=!0;if(m)if(b.increment(l.freshUATCInvalidErrorResponseCountMetric),c)if(c.isOK){var p=c.extraErrorInfos,u=c.statusList;if(p&&p.constructor!==Array)h(e,p,"extraErrorInfos");else if(0<p.length){if(p&&!(0>=p.length)){var x=p[0];"ADDRESS_NOT_SELECTED"===x.statusCode?(b.increment(l.freshUATCAddressNotSelectedErrorCountMetric), f.log("fresh-atc-handler: Address is not selected.","INFO")):w(e,{reasonCode:x.itemStatusCode,quantityAdded:x.availableQuantity,quantityRequested:x.requestedQuantity})}}else if(u&&u.constructor!==Array)h(e,u,"statusList");else if(0<u.length&&u&&!(0>=u.length)){var q=B(u);q&&0<q.length&&w(e,{reasonCode:A[q[0].statusKey]})}}else b.increment(l.freshUATCFailureCountMetric),k(e,"","","isOK returned by UATC is false");else b.increment(l.freshUATCFailureCountMetric),k(e,"","","No response from UATC");else b.increment(l.freshUATCSuccessCountMetric), g(c,t,n)}catch(v){b.increment(l.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+v,"ERROR")}finally{a.delay(d,E.reEnableDelay)}},error:function(h,c,g){try{b.sendWidgetMetrics(l.freshUATCTCallScope),b.increment(l.freshUATCFailureCountMetric),k(e,h,c,g)}catch(m){b.increment(l.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(l.freshAddToCartMissingParameterCountMetric),k(e)}else f.log('fresh-atc-handler: Required "offerListingID" action parameter is missing.',"ERROR"),b.increment(l.freshAddToCartMissingParameterCountMetric),k(e)}else f.log('fresh-atc-handler: Required "title" action parameter is missing.',"ERROR"),b.increment(l.freshAddToCartMissingParameterCountMetric),k(e);else f.log('fresh-atc-handler: Required "asin" action parameter is missing.',"ERROR"),b.increment(l.freshAddToCartMissingParameterCountMetric), k(e)}catch(C){b.increment(l.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+C,"ERROR"),a.delay(d,E.reEnableDelay)}}function u(b){q&&"function"===typeof q.refresh?q.refresh():p(b)}var E={reEnableDelay:1E3},l={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,h,a){t(a);u(h);m.success(b)};a.declarative("fresh-atc-handler","click",n(function(h,a){r.valid()?(g.vibrate(),b.increment(l.freshAddToCartClickCountMetric),x(h,C,a)):a()}))}}});"use strict";f.when("A","jQuery","a-button","fresh-show-atl-changeover","ready").register("FreshAddToShoppingList",function(a,e,d,c){function p(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"),p(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,p){d.addToFreshCart({success:function(a,c){p(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,t,r,g,q,A,v,k,w,D,B,h,x=function(){if(!n){b=e(c.addToCartButtonSelector);g=d.getSelect(c.dropdownID);if(t=!!g){r=e(c.dropdownDivSelector);var a=g.getOptions().size(); a&&(A=a-1)}v=e(c.freeTextDivSelector);if(q=0!==v.length)k=e(c.freeTextInputSelector),w=e(c.freeTextErrorDivsSelector),D=e(c.freeTextErrorMsgMin),B=e(c.freeTextErrorMsgMax)}},u=function(){a.on(c.dropdownSelectedID,function(a){e(a.nativeItemNode).index()===A?(k.attr("validValue",h),k.val(h),v.show(),w.hide(),r.hide(),k.focus().select(),g.val("1")):h=g.val()});var l=function(){var a=k.attr("validValue");a&&(g.val(a),g.val()===a?(h=a,r.show(),v.hide()):(f.updateQuantity("freshAddToCartButton",a),b.focus()))}, d=function(){var a=E(k.val());k.attr("validValue",a?a:"")};k.change(d);k.keyup(d);k.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&&(l(),b.click());return!1});k.blur(l)},E=function(){var a;a:{a=k.val();if(c.rxNumbersOnly.test(a)&&(a=parseInt(a,10),!isNaN(a)))break a;a=!1}w.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;x();n=!0;if(q){v.hide().removeClass(c.auiHiddenClass);w.hide().removeClass(c.auiHiddenClass);var a=g.getOption(A),b=a.info()[0].text;a.update({value:"0",text:e.trim(b)+"+"});h=g.val();u()}},valid:function(){x();return q&&v.is(":visible")?!1!==E():!0},val:function(){x();return q&&v.is(":visible")?k.attr("validValue"):t?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?t.disable():t.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),t=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){t.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 p(a){c.increment(g.countAddToAlexaList);a.data.isAlmInStoreMode&&c.increment(g.countISMAddToAlexaList);c.setWidgetClickTimestamp(g.addToAlexaListCallTime);t(a);var b=Date.now(),k=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(k)},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);r(a)},error:function(b,e,k){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");r(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:q+v,eventType:k,eventVersion:1,pageName:k+w+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:q+A,eventType:k,eventVersion:1,pageName:k+w+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 t(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 r(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){r(a);p(a)});var g={countAddToAlexaList:"countAddToAlexaList",addToAlexaListCallTime:"addToAlexaListCallTime",addToAlexaListCallSuccess:"addToAlexaListCallSuccess",addToAlexaListCallFail:"addToAlexaListCallFail",countISMAddToAlexaList:"countISMAddToAlexaList"}, q="ADD_ITEM_",A="SUCCESS",v="FAILURE",k="F3_Detail_Page",w="_",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")})});"use strict";f.when("A","afx-dp-csm-metrics-utils","dpContextualIngressPtTrigger","ready").execute(function(a,d,f){a.declarative("alm-change-to-fulfillment-type-button","click",function(a){if(a.data!==F){var p=a.data;d.increment("almChangeTo_"+p.fulfillmentType+ "_"+p.almBrandId);f.showGlowModal(a)}})})}); /* ******** */ (function(q){var x=window.AmazonUIPageJS||window.P,F=x._namespace||x.attributeErrors,A=F?F("QuantitySelectorAssets",""):x;A.guardFatal?A.guardFatal(q)(A,window):A.execute(function(){q(A,window)})})(function(q,x,F){function A(n){var f=!1;q.now(n).execute("qsAssetDuplicationGuard",function(a){f=!!a});return f}function L(n,f){if(!A(n))try{q.register(n,f)}catch(a){if(!a.message.includes("reregistered by QuantitySelectorAssets"))throw a;}}function Da(){var n=arguments;return{register:function(f,a){if(!A(f))try{q.when.apply(q, n).register(f,a)}catch(c){if(!c.message.includes("reregistered by QuantitySelectorAssets"))throw c;}},execute:function(f,a){q.when.apply(q,n).execute(f,a)}}}L("QSAssetDuplicationGuard",function(){return{register:L,when:Da}});"use strict";q.when("QSAssetDuplicationGuard").execute("qsAUIDeps-main-duplication-guard",function(n){n.when("A","QuantitySelectorConstants","a-util").execute("qsAUIDeps-main",function(f,a,c){function h(){w&&w.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"),r=JSON.parse(l).key;if(r&&r.substring(0,k.length)==k){var t=c.state(r);if(!t||!t.id){var g=JSON.parse(d[e].innerHTML);c.state(r,g)}}}catch(N){var w=a.getQsWidgetConfigurationJsonString(),G=a.getQsWidgetStateAttributeJsonString(); if(l.includes(G)||d[e].innerHTML.includes(w))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 w;q.when("QuantitySelectorAUIDeps_AState","QuantitySelectorAUIDeps_AButton").execute("qsAUIDeps-register",function(a,d){n.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){w=JSON.parse(c[k].innerHTML);break}}catch(t){var l=a.getQsWidgetConfigurationJsonString(),r=a.getQsWidgetStateAttributeJsonString();if(g.includes(r)||c[k].innerHTML.includes(l))throw t;}})();(function(){w&&w.enableCheckoutCompatibility?(q.when("a-state").execute("qsAUIDeps-checkout-compat-a-state-register",function(a){n.register("QuantitySelectorAUIDeps_AState",function(){return{object:G(a)}})}), q.when("a-buttons").execute("qsAUIDeps-checkout-compat-a-button-register",function(a){n.register("QuantitySelectorAUIDeps_AButton",function(){return{object:k(a)}})}),f.on("checkout:afterReload",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})):(q.when("a-state").execute("qsAUIDeps-a-state-register",function(a){n.register("QuantitySelectorAUIDeps_AState",function(){return{object:a}})}),q.when("a-button").execute("qsAUIDeps-a-button-register",function(a){n.register("QuantitySelectorAUIDeps_AButton", function(){return{object:a}})}));f.on("a:pageUpdate ready",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})})();h()})});"use strict";q.when("QSAssetDuplicationGuard").execute("qsConstants-duplication-guard",function(n){n.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"}}})});"use strict";q.when("QSAssetDuplicationGuard").execute("qsMetadata-duplication-guard",function(n){n.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";q.when("A","QSAssetDuplicationGuard").execute("qsMetrics-duplication-guard", function(n,f){f.when("A","QuantitySelectorAUIDeps","QuantitySelectorConstants").register("QuantitySelectorMetrics",function(a,c,f){function g(a){x.ue&&x.ue.count&&a&&ue.count(a,(ue.count(a)||0)+1)}q.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;x.ue&&x.ue.count&&a&&"undefined"!== typeof x.ue_t0&&(c-=x.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 m="s";switch(k){case "count":m+="u";break;case "weight":m+="w";break; default:k=void 0;break a}m+="p";switch(d){case "count":m+="u";break;case "weight":m+="w";break;default:k=void 0;break a}k=m}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},x.ue&&x.ue.event&&ue.event(g,"quantityselector_attr","quantityselector.QuantityselectorMetrics.2"))}}}})}); "use strict";q.when("QSAssetDuplicationGuard").execute("qsState-duplication-guard",function(n){n.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(), r=JSON.parse(l.html());h.aState.state(d,r);if(r&&r.staticData){var m=JSON.parse(r.staticData).asin;v(m,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 w(a){var c=g(a),e=c.selectedId;c=c.selectedQuantity;0==c||c?d(a,c):e&&p(a,e)}function p(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 m(){for(var c=[],d=f.$(a.getQsWidgetGenericStateSelectorQuery()),e=a.getQsWidgetConfigurationId(""),l=0;l<d.length;l++)try{var m=d[l].getAttribute("data-a-state"),g=JSON.parse(m).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(m.includes(k))throw D;}return c}function v(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(m())});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;v(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||w(c),d={selectedId:d,selectedQuantity:null},h.aState.state(a.getQsWidgetConfigurationId(c),d))},setSelectedQuantity:function(c,d,e){e||w(c);d={selectedId:null,selectedQuantity:d};h.aState.state(a.getQsWidgetConfigurationId(c),d)},setPreviousSelectedId:p,setPreviousSelectedQuantity:d,setData:function(c,d){h.aState.state(a.getQsWidgetConfigurationId(c),d)},getQsUIDs:m,getQsWidgetMapSet:function(a){return l[a]},isStepper:e}})});"use strict";q.when("QSAssetDuplicationGuard").execute("qsTemplates-duplication-guard", function(n){n.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 w=g.getQsWidgetBottomSheetTemplateElement().clone(!0);w.appendTo(g.getQsWidgetContainer(h));w.attr("id",c.getQsWidgetBottomSheetContainerId(h)); var p=a.getQsWidgetConfiguration(h);w.attr("cel_widget_id","qs-widget-metric-"+p.qsMetricID+"-bottomsheet");w.addClass(p.cssClass);k(c.getQsWidgetBottomSheetContainerId(h),h);g.getQsWidgetBottomSheetSelectQuantityTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetSelectQuantityText));g.getQsWidgetBottomSheetUnitTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetSelectQuantityUnitText));g.getQsWidgetBottomSheetUnitTextElement(h).attr("aria-label",p.bottomSheetSelectQuantityUnitAriaLabelText); g.getQsWidgetBottomSheetPpuTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetPricePerUnitText));g.getQsWidgetBottomSheetPriceTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.estTotalPriceText));g.getQsWidgetBottomSheetImageElement(h).attr("src",p.bottomSheetImageUrl);p.summaryDisclaimerText?g.getQsWidgetSummaryDisclaimerElement(h).text(g.replaceNbspWithPlainTextNbsp(p.summaryDisclaimerText)):(g.getQsWidgetBottomSheetTableElement(h).attr("style","border-bottom: 0px solid !important;"), g.getQsWidgetSummaryDisclaimerContainerElement(h).remove());"right"===p.currencySymbolPosition&&g.getQsWidgetSummaryPriceSymbolElement(h).insertAfter(g.getQsWidgetSummaryPriceFractionElement(h));w=g.getQsWidgetSummaryAtcButtonAsComponent(h);a.isStepper(h)?w.text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetUpdateCartText)):w.text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetAddToCartText));f.declarative.create(g.getQsWidgetSummaryAtcButton(h),c.getQsWidgetSummaryAtcDecl(),{qsUID:h})}}})});"use strict"; q.when("QSAssetDuplicationGuard").execute("qsUtils-duplication-guard",function(n){n.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 n(b){b=a.getQsWidgetConfiguration(b);return b.clientId?b.clientId:"unrec-client"}function w(b){return"mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase()?!0:!1}function p(b){return a.getQsWidgetConfiguration(b).shapeType=== c.getQsWidgetSimplifiedStepperShapeType()}function d(b){var c=a.getQsWidgetConfiguration(b);return p(b)||"undefined"!=typeof c.showATCButtonWhenZeroQuantity&&c.showATCButtonWhenZeroQuantity?!0:!1}function m(b){b=a.getQsWidgetConfiguration(b);return k(b.showConfirmationView)?!0:!1}function v(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 r(b){if(b)try{var c=a.getQsWidgetConfiguration(b);return JSON.parse(c.staticData).storeId}catch(P){}}function t(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 q(b,c){var u=a.getQsWidgetConfiguration(b).variationSelectorListsMap;if(null==u)return null;null==c&&(c=t(b));return null==c?null:u[c]}function y(b,a){b=q(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 u=a.getQsWidgetConfiguration(b),d=u.qsItems.length;u=u.allowZeroQuantity;if(D(b)){if(1==c||u&&2==c)return!0}else if(c==d||c==d-1&&u)return!0;return!1}function F(b,c){var u=a.getQsWidgetConfiguration(b).qsItems;if(D(b)){if(c==u.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);S(b);f.trigger(c.getQsWidgetEventInitialized(),b)}function T(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 U(b){return f.$("#"+c.getQsWidgetStepperId(b))}function V(b){return h.aButton("#"+c.getQsWidgetAtcButtonId(b))}function W(b){return h.aButton("#"+c.getQsWidgetPlusButtonId(b))}function X(b){return f.$("#"+c.getQsWidgetButtonId(b)+"-announce")}function ja(b){return f.$("#"+c.getQsWidgetDropdownContainerId(b))}function ka(b){return f.$("#"+c.getQsWidgetDropdownViewId(b))} function R(b){return f.$("#"+c.getQsWidgetVariationDropdownViewId(b))}function Y(b){return f.$("#"+c.getQsWidgetDropdownUnorderedListId(b))}function la(b){return f.$("#"+c.getQsWidgetTextInputContainerId(b))}function K(b){return f.$("#"+c.getQsWidgetTextInputId(b))}function ma(b){return f.$("#"+c.getQsWidgetTextInputUpdateButtonContainerId(b))}function na(b){return f.$("#"+c.getQsWidgetSummaryAtcId(b))}function oa(b){return h.aButton("#"+c.getQsWidgetSummaryAtcId(b))}function pa(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 u=d.qsItems[parseInt(c)-1];return u.id===c?u:qa(b,c)}}catch(C){return qa(b,c)}}function qa(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 ra(b,a){var d=q(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];if(null==d)return sa(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 sa(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:ta(b)}function ta(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 ua(b,a){var d=q(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];return null!=d?d:va(b,a)}function va(b,a){b=sa(b);return null==b?null:b.id}function Q(b){return a.getQsWidgetConfiguration(b).selectedQuantity}function wa(b,a){return 0>a?b[0].id:a>=b.length?b[b.length-1].id:b[a].id}function xa(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+". Click to change quantity"}function da(b,a){return(v(b)?/^(([0-9]\d{0,2}))$/:/^(([1-9]\d{0,2})|(0[1-9]\d?)|(00[1-9]))$/).test(a)}function ya(b,a){var c=la(b),d=ma(b);ia(b).addClass("aok-hidden");T(c);var e=K(b);a&&e.val(a);a=e.val();da(b,a)&&Q(b)!==a?T(d):d.addClass("aok-hidden");w(b)?e.focus():setTimeout(function(){e.focus()},200)}function S(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 za(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 Aa(b,a){null==a&&(a=t(b));if(null==a)return{};var d=ra(b,a);if(null==d)return{};var e=w(b)?d.displayTextForMobile: d.dissplayTextForDesktop;b=za(b,d);var u={};u[a]=JSON.parse(d.data);u[a][c.getQsWidgetVariationSelectorDisplayTextKey()]=e;u[a][c.getQsWidgetVariationSelectorDisplayTextWithQuantityKey()]=b;return u}function Ba(b,a){b=q(b,a);return null==b||null==b.actionTriggerId||""==b.actionTriggerId?null:b.actionTriggerId}function ea(b,d,e,h,m){m=a.getQsWidgetConfiguration(b);var u=m.selectedId,P=m.selectedQuantity,g=a.isStepper(b);h=g&&h!=c.getQsWidgetStepperAddToCartReftag();var E=a.getQsWidgetConfiguration(b); var r=E.previousSelectedQuantity;E=E.previousSelectedId;r=r?r:E?z(B(b,E)):null;E=JSON.parse(m.staticData);var k=m.sellingUnit,v=m.sellingDimension;if(u)for(var t=0;t<m.qsItems.length;t++)if(m.qsItems[t].id==u){var C=JSON.parse(m.qsItems[t].data);C=f.$.extend({qsUID:b,prevSelectedQty:r,isStepperFlag:g,setQuantityFlag:h,tunneledData:d,quantityData:C,sellingUnit:k,sellingDimension:v},E,C);l(b)&&(C=f.$.extend(C,Aa(b,e)))}if(P||0==P)C=f.$.extend({qsUID:b,prevSelectedQty:r,isStepperFlag:g,setQuantityFlag:h, tunneledData:d,sellingUnit:k,sellingDimension:v},E,{quantity:P}),l(b)&&(C=f.$.extend(C,Aa(b,e)));return C}function Ca(b){var c=a.getQsWidgetConfiguration(b);if(p(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(/ /g," ")}var H=[];f.on(c.getQsWidgetEventTriggerAction(),function(b,d,e,l,m){var u=a.getQsWidgetConfiguration(b);d||(d=u.actionId); u="mobile"==u.viewType.toLowerCase();var h=!1;(b=ea(b,e,null,l,m))&&b.ref&&null!=l&&(b.reftag=b.ref+l);b&&(f.trigger(c.getQsWidgetEventAction(d),b),g.incrementTriggerActionCount(d,!0,u),h=!0);h||g.incrementTriggerActionCount(d,!1,u)});f.on(c.getQsWidgetVariationEventTriggerAction(),function(b,d,e,l){var u="mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase();e=ea(b,e);null==d&&(d=Ba(b,l));null!=d&&(f.trigger(c.getQsWidgetEventAction(d),e),g.incrementTriggerActionCount(d,!1,u))});return{isInitialized:function(b){return(b= a.getQsWidgetConfiguration(b))?b.initialized:!1},isMobile:w,isSimplifiedStepper:p,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:m,isAllowZeroQuantityEnabled:v,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:q,getQsWidgetBottomSheetConfig:function(b){var d=a.getQsWidgetConfiguration(b),e=c.getQsWidgetBottomSheetHeightConfig(d.enabledBottomSheetWith2DSupport),f=0;d.summaryDisclaimerText||(f=m(b)?e.disclaimerTextAdjustmentWithAtc:e.disclaimerTextAdjustment); return m(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(p(b))L(b);else{var d=ba(b),e=Q(b),m=a.getQsWidgetConfiguration(b);if(m.qsItems)for(var h=0;h<m.qsItems.length;h++)parseFloat(e)===z(m.qsItems[h])&&(d=m.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=ua(b),null!=d&&f.trigger(c.getQsWidgetVariationEventSelectId(),b,d,!1,function(){}));S(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:T,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=oa(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(!p()){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(!p()){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,m=d.top,h="unset",g=f.$(x).height(),r=a.getQsWidgetConfiguration(b).dropdownAnchorId;b=r.startsWith("qs-widget-container")?c:f.$("#"+r);if(r&&b.length){for(r=b;!r.is(document)&&"static"===r.css("position");)r=r.parent();m-=null===r.offset()?0:r.offset().top;l-=null===r.offset()?0:r.offset().left;e.appendTo(b); r.is(document)||(g=r.height())}else e.appendTo(document.body);l+e.width()>x.scrollX+f.$(x).width()&&(l=l+c.width()-e.width());d.top-x.scrollY+e.height()>f.$(x).height()&&(h=g-m-c.height(),m="unset");e.css({left:l,top:m,bottom:h})},getQsWidgetContainer:I,getQsWidgetButtonContainer:ia,getQsWidgetButtonAsComponent:J,getQsWidgetStepperElement:U,getQsWidgetAtcButtonAsComponent:V,getQsWidgetButton:X,getQsWidgetDropdownContainer:ja,getQsWidgetDropdownElement:function(b){return f.$("#"+c.getQsWidgetDropdownId(b))}, getQsWidgetDropdownViewSelector:ka,getQsWidgetVariationDropdownViewSelector:R,getQsWidgetDropdownUnorderedListElement:Y,getQsWidgetDropdownVariationUnorderedListElement:function(b){return f.$("#"+c.getQsWidgetDropdownVariationUnorderedListId(b))},getQsWidgetDropdownItemElement:function(b,a){return f.$("#"+c.getQsWidgetDropdownItemAriaId(b,a))},getQsWidgetPlusButtonAsComponent:W,getQsWidgetTextInputContainer:la,getQsWidgetTextInputElement:K,getQsWidgetTextInputUpdateButtonContainer:ma,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:na,getQsWidgetSummaryAtcButtonAsComponent:oa,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:pa,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:n,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:ra,getSelectedQsItemId:ba,getInitialSelectedQsItemId:ta,getSelectedQuantity:Q,getInitialSelectedVariationSelectorItemId:va,getSelectedVariationSelectorItemIdData:function(b,a,d){null==d&&(d=t(b));if(null==d)return null; b={};b[c.getQsWidgetVariationSelectorSelectedIdKey()]=a;a={};a[c.getQsWidgetVariationSelectorListMapKey()]={};a[c.getQsWidgetVariationSelectorListMapKey()][d]=b;return a},getSelectedVariationSelectorItemId:ua,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 wa(b,d)},getFocusedVariationSelectorItemIdInBottomSheet:function(a,d){var b=R(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 wa(a,b)},getIndexFromIdInBottomSheet:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;return xa(b,c)},getAriaLabelTextForSelectOption:ca,getVariationSelectorIndexFromIdInBottomSheet:function(a,c,d){a=y(a,d);return xa(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 m=w(b);if(!f)return g.incrementQsWidgetFailToRender(),"";for(var h=0;h<f.length;h++){var r=f[h].id,k=f[h].quantityText,v=f[h].quantityTextAbbreviatedSuffix; if(m){var t=b;var n=v,p=B(t,r);v=k;if(n){var q=n.indexOf("\x3c");if(-1!=q){var y=n.indexOf("\x3c",q+1);if(n=n.substring(q,y))n=n.split("\x3e")[1],v+=". ",q=n,n=a.getQsWidgetConfiguration(t).estText,v+=n?n+" "+q:"Total est. "+q}else v=v+"."+n}p=p.price;n=pa(t).html();v=v+". "+n+" "+(p.currencySymbol+p.wholeValue+p.decimalSeparator+p.fractionValue);p=l(t)?c.getQsWidget2DBottomSheetQuantitySelectorCssClass():c.getQsWidget1DBottomSheetSelectorCssClass();n=c.getQsWidgetDropdownItemId(t,r);q=c.getQsWidgetDropdownItemDecl(); t='\x3cspan class\x3d"a-declarative" data-action\x3d"'+q+'" data-'+q+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+t+"\x26quot;,\x26quot;id\x26quot;:"+r+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+n+'" aria-label\x3d"'+v+'" class\x3d"'+p+'"\x3e'+k+"\x3c/li\x3e\x3c/span\x3e"}else{t=b;var x=v;v=f[h].id==e;p=c.getQsWidgetDropdownItemId(t,r);n=c.getQsWidgetDropdownItemAriaId(t,r);var M=c.getQsWidgetDropdownItemQuantitySuffixId(t,r);q=c.getQsWidgetDropdownDecl(t);y="";x&&(y='\x3cspan id\x3d"'+ M+'" class\x3d"a-size-mini a-color-tertiary"\x3e'+x+"\x3c/span\x3e");x="false";M="qs-widget-dropdown-link";v&&(x="true",M+=" qs-widget-dropdown-link-active aok-block aok-nowrap");t='\x3cspan class\x3d"a-declarative" data-action\x3d"'+q+'" data-'+q+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+t+"\x26quot;,\x26quot;id\x26quot;:"+r+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+p+'" aria-labelledby\x3d"'+n+'" aria-checked\x3d"'+x+'" class\x3d"qs-widget-dropdown-item"\x3e\x3ca tabindex\x3d"0" href\x3d"javascript:void(0)" draggable\x3d"false" id\x3d"'+ n+'" class\x3d"'+M+'"\x3e'+k+"\x26nbsp;\x26nbsp;"+y+"\x3c/a\x3e\x3c/li\x3e\x3c/span\x3e"}d+=t}return d},generateVariationSelectorDOM:function(a,d){if(!w(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,m=d[e].ariaLabelText,g=c.getQsWidget2DBottomSheetVariationSelectorCssClass(),r=c.getQsWidgetDropdownItemId(f,l);c.getQsWidgetDropdownItemAriaId(f,l);var u=c.getQsWidgetVariationDropdownItemDecl();b+='\x3cspan class\x3d"a-declarative" data-action\x3d"'+ u+'" data-'+u+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+f+"\x26quot;,\x26quot;id\x26quot;:\x26quot;"+l+'\x26quot;}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+r+'" aria-label\x3d"'+m+'" 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);X(b).attr("aria-label",ca(b,f));var l=Z(b),h=aa(b),m=W(b);f=U(b);var g=V(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?ya(b,c.initialQuantityText):"icdp"==n(b)?m.hide():m.disable()):"icdp"==n(b)?m.show():m.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(p(b)){var d=a.getQsWidgetConfiguration(b);J(b).text(c);X(b).attr("aria-label", ca(b,c));var e=Z(b),f=aa(b),l=W(b),m=U(b);b=V(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?(m.addClass("aok-hidden"),b.show()):(b.hide(),m.removeClass("aok-hidden"))}},showTextInput:ya,hideSpinner:S,EnableVariationSelector:function(a){a&&R(a).removeClass("qs-widget-disable")},DisableVariationSelector:function(a){a&&R(a).addClass("qs-widget-disable")},getVariationSelectorDisplayTextWithQuantity:za, getVariationSelectorActionTriggerId:Ba,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 na(a).is(":visible")},isBottomSheetExist:function(a){return h.aSheet.get(c.getQsWidgetBottomSheetId(a))?!0:!1},getStoreId:r,syncStepperQuantities:function(b,d,e,l,m,h,g){(b=a.getQsWidgetMapSet(b))&&(d|| 0==d)&&b.forEach(function(b){var v=r(b),k=n(b).includes("fresh-dp"),t=a.isStepper(b)&&(g||l!=b),p;if(!(p=k||!l))a:{if(l&&b){p=Ca(l);var q=Ca(b);if("bcPrice"==p||"bcPrice"==q){p=!0;break a}if(p&&q){p=p===q;break a}}p=!1}t&&p&&(e&&v&&!k?e==v&&f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),b,d,m,h):f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),b,d,m,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}}})});"use strict";q.when("QSAssetDuplicationGuard").execute("qsWidget-duplication-guard",function(n){n.when("A","QuantitySelectorUtils","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorMetrics").register("QuantitySelectorWidget",function(f,a,c,h,g){function k(c){a.deactivateWidget(c);var d=a.getQsWidgetButtonContainer(c),g=a.getQsWidgetDropdownContainer(c),e=a.getQsWidgetDropdownElement(c), l=a.getQsWidgetQuantityContainer(c),r=a.getQsWidgetSummaryAtcButton(c),k=a.getQsWidgetFooterPriceContainer(c),n=a.getQsWidgetFooterQuantitySuffixContainer(c);a.setElementVisibility(k,!0);a.setElementVisibility(n,!0);k=a.getQsWidgetTextInputContainer(c);a.isComponentVisible(k)||a.showComponent(d);a.hideComponent(g);a.hideComponent(e);a.hideComponent(l);a.hideComponent(r);a.resetQsWidgetContainerMinWidthAndHeight(c);f.trigger(h.getQsWidgetEventHideDropdown(),c)}function n(d,m,g){var e=a.getQsItem(d, m),l=e.quantityText,r=e.quantityTextAbbreviatedSuffix,k=e.quantityTextFullSuffix,v=e.selectedText;e=e.price;var n=a.getQsWidgetSummaryPriceSymbolElement(d),p=a.getQsWidgetSummaryPriceWholeElement(d),q=a.getQsWidgetSummaryPriceFractionElement(d),w=a.getQsWidgetSummaryPriceDecimalElement(d);a.setHtml(n,e.currencySymbol);a.setHtml(p,e.wholeValue);a.setHtml(q,e.fractionValue);a.setHtml(w,e.decimalSeparator);n=a.getQsWidgetQuantityElement(d);a.setHtml(n,l);l=a.getQsWidgetQuantitySuffixElement(d);r&&k? (a.setHtml(l,r),r=a.getQsWidgetInitialViewSuffixElement(d),a.setHtml(r,k)):a.setHtml(l,"");r=a.getQsWidgetFooterPriceSymbolElement(d);l=a.getQsWidgetFooterPriceWholeElement(d);n=a.getQsWidgetFooterPriceFractionElement(d);p=a.getQsWidgetFooterPriceDecimalElement(d);a.setHtml(r,e.currencySymbol);a.setHtml(l,e.wholeValue);a.setHtml(n,e.fractionValue);a.setHtml(p,e.decimalSeparator);k&&(e=a.getQsWidgetFooterQuantitySuffixElement(d),a.setHtml(e,k));k="Current quantity "+v+". Click to change quantity"; a.isInitialViewDropdown(d)?(a.getQsWidgetButtonAsComponent(d).text(v),a.getQsWidgetButton(d).attr("aria-label",k)):a.isInitialViewTextLink(d)&&(e=a.getQsWidgetInitialViewTextLinkElement(d),e.text(v),e.attr("aria-label",k));a.setAtcButtonStepperText(d);c.setPreviousSelectedId(d,c.getQsWidgetConfiguration(d).selectedId);c.setSelectedId(d,m);c.isStepper(d)&&a.updateQsWidgetStepper(d,m);g&&f.trigger(h.getQsWidgetEventTriggerAction(),d)}function q(d,m){if(!a.isSimplifiedStepper(d)){var g=a.getQsWidgetTextInputElement(d), e=g.val(),l=a.getQsWidgetButtonContainer(d),r=a.getQsWidgetTextInputContainer(d),k=a.getQsWidgetTextInputUpdateButtonContainer(d),p=a.getQsItemFromQuantityTextOrQuantity(d,e),q=c.isStepper(d);a.hideComponent(k);q&&a.getQsWidgetButtonAsComponent(d).text(e);p?(a.hideComponent(r),a.showComponent(l),n(d,p.id,m)):(a.hideComponent(l),a.showComponent(r),g.blur(),c.setSelectedQuantity(d,e),g=c.getQsWidgetConfiguration(d),q&&a.isInitialViewChooseQuantity(d)&&0==g.selectedQuantity&&(g=a.getQsWidgetStepperElement(d), k=a.getQsWidgetAtcButtonAsComponent(d),a.hideComponent(r),a.showComponent(l),a.hideComponent(g),k.show()),m&&f.trigger(h.getQsWidgetEventTriggerAction(),d));q&&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 p=null;f.on(h.getQsWidgetEventSelectId(),function(c,f,h,e){n(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),q(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,m,k,e){var l=a.getQsItemFromQuantityTextOrQuantity(d,m);l?f.trigger(h.getQsWidgetEventSelectId(),d,l.id,k,e):a.isSimplifiedStepper(d)?(m=m.toString(),c.setSelectedQuantity(d,m),a.updateSimplifiedQsWidgetStepper(d,m)):(g.incrementQsItemNotFound(!0,a.getClientId(d)),a.getQsWidgetTextInputElement(d).val(m),q(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);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 n=a.getQsWidgetFooterQuantitySuffixContainer(d);a.setElementVisibility(f,!1);a.setElementVisibility(n,!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)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);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:n,validateAndSelectQuantity:q,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)}a.showATCButtonWhenZeroQuantity(d)&&k?c.isStepper(d)?f.trigger(h.getQsWidgetEventTriggerAction(),d,null,null,h.getQsWidgetStepperAddToCartReftag()):f.trigger(h.getQsWidgetEventTriggerAction(),d):(null!=p&&clearTimeout(p),p=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!=p&&clearTimeout(p);p=setTimeout(function(){f.trigger(h.getQsWidgetEventTriggerAction(),d)},g.stepperDebounceTime)}}})});"use strict";q.when("QSAssetDuplicationGuard").execute("QuantitySelector-duplication-guard",function(n){n.when("A","QuantitySelectorWidget","QuantitySelectorUtils","QuantitySelectorState", "QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps","QuantitySelectorMetadata","QuantitySelectorTemplates").register("QuantitySelector",function(f,a,c,h,g,k,n,w,p){function d(a,d){try{var e=c.isMobile(d)}catch(t){t instanceof TypeError&&k.incrementInvalidIdCount();return}try{if(!c.isInitialized(d)||a)eval(w.getMetaConfiguration(d,"script")),h.setInitialized(d),c.initializeWidget(d),c.isQsWidgetEnabled(d)?c.enableQsWidget(d):c.disableQsWidget(d),k.incrementInitializeCount(!0, e)}catch(t){k.incrementInitializeCount(!1,e)}}function m(a){h.loadQsWidgetStateConfiguration(a);d(!0,a)}function v(){for(var a=h.getQsUIDs(),d=0;d<a.length;d++){var f=a[d];c.isInitialized(f)||m(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.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.$(x).resize(function(){a.hideAllPopover()});f.on(g.getQsWidgetEventInitialize(),function(a,c){n.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{v()}catch(e){if(e instanceof SyntaxError)f.delay(function(){try{v()}catch(l){q.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();p=f.now();k.logLatencyMetric("JSReady",p);return{loadStateAndInitializeWidget:m}})})}); /* ******** */ (function(c){var v=window.AmazonUIPageJS||window.P,w=v._namespace||v.attributeErrors,p=w?w("QuantitySliderAssets",""):v;p.guardFatal?p.guardFatal(c)(p,window):p.execute(function(){c(p,window)})})(function(c,v,w){function p(t,l){try{c.register(t,l)}catch(g){if(-1===g.message.indexOf("reregistered by QuantitySliderAssets"))throw g;}}function y(){var t=arguments;return{register:function(l,g){try{c.when.apply(c,t).register(l,g)}catch(f){if(-1===f.message.indexOf("reregistered by QuantitySliderAssets"))throw f; }}}}c.when("QuantitySliderAssetDuplicationGuard").execute(function(t){t.when("A").register("qs-cart-count-handler",function(l){var g=l.$,f={DEFAULT:function(d,f,k,a,b){l.post("/gp/api/cart/1.0/get-cart-count.json",{timeout:5E3,params:{sessionID:d,clientName:f},success:function(b){b&&b.isOK&&b.total?g.isFunction(a)&&a(b.total.numActiveItem):c.log("Malformed get-cart-count response for sessionId\x3d"+d,"ERROR",k)},error:function(){c.log("Failed to retrieve get-cart-count response for sessionId\x3d"+ d,"ERROR",k);g.isFunction(b)&&b()}})},UFG:function(g,f,k,a,b){}};return{getTotalCartCount:function(d,l){return(g.isFunction(f[l])?f[l]:f.DEFAULT)(d.request.sessionId,d.clientName,d.attribution,d.onSuccess,d.onError)}}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(t){t.when("A","quantity-slider-utils","qs-cart-update-utils").register("qs-cart-update-handler",function(l,g,f){function d(a){r||(r="quantity-slider-widget-"+a);return r}function x(a,b){if(!b.atcFormSubmitDisabled){if((a= a.$target&&a.$target.closest(".qs-atc-form"))&&0!==a.length)return a;c.log("Missing $form object","ERROR",d(b.clientName))}}function k(b,m,d){l.trigger(g.ACTIONS.ADD_TO_CART_SUBMIT_START,{asin:b,cartType:m.cartType,clientName:m.clientName,isQSAction:d,request:m});a(b,m,!0,d)}function a(a,m,n,k){var u=m.cartType,e=JSON.stringify(k?f.getQSRequestObject(m,n,u):f.getATCRequestObject(m,u)),h=f.getAjaxUrl(m,n,u);h&&b.ajax({url:h,type:f.getHttpMethodType(n,u),data:e,headers:f.getHeadersForRequest(m,n,u), xhrFields:{withCredentials:!0},success:function(h,e,b){h.jqXHR=b;delete q[a];(h=f.adaptResponseObject(h,m,n,m.cartType))?(g.setUpdatedQSParamsForAsinOffer(a,m.additionalParams&&m.additionalParams.storeId,{quantityInCart:h.quantity,cartItemId:h.itemId}),l.trigger(n?g.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS:g.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS,{asin:a,cartType:m.cartType,request:m,response:h,clientName:m.clientName,attribution:d(m.clientName),isQSAction:k,isDecreaseQuantityAction:!n}),g.logUrl(m.loggingUrl)): c.log("Invalid Response from the server","ERROR",d(m.clientName))},error:function(h){delete q[a];h=h||{};c.log("Ajax request failed with type: "+(n?"addItems":"modifyItems")+", status code: "+h.status+", error: "+h.responseText,"ERROR",d(m.clientName));l.trigger(g.ACTIONS.QS_CART_SUBMIT_ERROR,{asin:a,cartType:u,clientName:m.clientName,isQSAction:k,isDecreaseQuantityAction:!n,isMaxOrderQuantityReached:m.quantityInCart>=m.maxOrderQuantity,response:h,request:m});n&&m.$form&&m.$form.submit()}})}var b= l.$,r="",q={};l.declarative("qs-add-to-cart-trigger","click",function(a){var b=a.data&&a.data.asin,d=g.getQsParamsFromTargetAsinOffer(a,b);a.$event&&a.$event.preventDefault();q[b]||(q[b]=!0,d.isMultipleAsinsSubmitting=1<Object.keys(q).length,d.$form=x(a,d),d.triggeringEvent=a,k(b,d,!1))});l.declarative("qs-slider-widget-trigger","click",function(b){var d=b.data&&b.data.asin,f=g.getQsParamsFromTargetAsinOffer(b,d),r=b.$target[0]&&b.$target[0].className||"",c=l.contains(r,"qs-increase-quantity")||l.contains(r, "qs-decrease-quantity");r=l.contains(r,"qs-decrease-quantity");b.$event&&b.$event.preventDefault();c&&!q[d]&&(q[d]=!0,f.isMultipleAsinsSubmitting=1<Object.keys(q).length,f.triggeringEvent=b,r?(l.trigger(g.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,{asin:d,cartType:f.cartType,clientName:f.clientName,isQSAction:!0,isDecreaseQuantityAction:!0,request:f}),a(d,f,!1,!0)):(f.$form=x(b,f),k(d,f,!0)))});return{setAttribution:function(a){r=a}}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(c){c.when("A", "qs-fresh-cart-update-utils").register("qs-cart-update-utils",function(l,g){function f(h){var a=h.quantityInCart||0;return{items:[{asin:h.asinId,offerListingId:h.offerListingId,quantity:a<h.minOrderQuantity?h.minOrderQuantity-a:1}]}}function d(h,a,e){return(c.isFunction(a[e])?a[e]:a.DEFAULT)(h)}var c=l.$,k={DEFAULT:f,UFG:g.getUfgCartRequestObject},a={DEFAULT:f,UFG:g.getUfgCartRequestObject},b={DEFAULT:function(a){var h=a.quantityInCart||0;var e=a.cartItemId;e=!e||"C"!==e[0]&&"S"!==e[0]?e:e.substring(1); return{items:[{id:e,quantity:h<=a.minOrderQuantity?0:h-1}]}},UFG:g.getUfgCartRequestObject},r={DEFAULT:function(a){return a.ajaxCartUrl},UFG:function(a){return a.addToCartUrl}},q={DEFAULT:function(a){return a.ajaxCartUrl}},u={DEFAULT:function(a){return(a=a.entity&&a.entity.items&&a.entity.items[0])?{itemId:a.id,quantity:a.quantity,isTotal:!0}:null},UFG:g.ufgCartResponseAdapter},m={DEFAULT:function(a,e){a=(e.quantityInCart||0)-1;return 0>a?null:{itemId:a?e.cartItemId:"",quantity:a,isTotal:!0}},UFG:g.ufgCartResponseAdapter}, n={DEFAULT:"POST",UFG:"POST"},t={DEFAULT:"PUT",UFG:"POST"},p={DEFAULT:function(a){return{"x-api-csrf-token":a.csrfToken,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content"),Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"'}},UFG:function(a){return{"Content-Type":"application/json","x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")}}}, e={DEFAULT:function(a){return{"x-api-csrf-token":a.csrfToken,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content"),Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.modify-items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.modify-items.request/v1"'}},UFG:function(a){return{"Content-Type":"application/json","x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")}}};return{getATCRequestObject:function(a, e){return d(a,k,e)},getQSRequestObject:function(e,g,f){return d(e,g?a:b,f)},adaptResponseObject:function(a,e,b,d){b=b?u:m;return(c.isFunction(b[d])?b[d]:b.DEFAULT)(a,e)},getHttpMethodType:function(a,e){a=a?n:t;return a[e]?a[e]:a.DEFAULT},getHeadersForRequest:function(a,b,d){b=b?p:e;return(c.isFunction(b[d])?b[d]:b.DEFAULT)(a)},getAjaxUrl:function(a,e,b){return d(a,e?r:q,b)}}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(c){c.when("A").register("qs-fresh-cart-update-utils", function(l){function g(g,d){return d&&d.items?d.items.find(function(d){return d.ASIN===g}):null}return{getUfgCartRequestObject:function(g){return g.additionalInput},ufgCartResponseAdapter:function(f,d){return(d=g(d.asinId,f.clientResponseModel))?{itemId:d.itemId,quantity:d.quantity,isTotal:!0,rawResponse:f}:{itemId:"invalidItemId",quantity:0,isTotal:!0,rawResponse:f}}}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(c){c.when("A","quantity-slider-utils").register("quantity-slider-metrics-handler", function(l,g){function f(a,b){return"QuantitySliderWidget::"+a+"::"+(b?b+"::":"")}function d(a){var b=v.ue;"undefined"!==typeof b&&b.count(a,1)}function c(a,b){g.assert(a&&b.clientName,"Missing required properties while logging metrics");if(b.isQSAction)if(b.isDecreaseQuantityAction){var c=k.QS_DECREASE;a=f(b.clientName,b.cartType)+a+"::"+c;d(a)}else c=k.QS_INCREASE,a=f(b.clientName,b.cartType)+a+"::"+c,d(a);else c=k.ATC,a=f(b.clientName,b.cartType)+a+"::"+c,d(a)}var k={ATC:"ATC",QS_INCREASE:"QSIncrease", QS_DECREASE:"QSDecrease"};return{logRequestStartMetrics:function(a){c("CountStart",a)},logRequestSuccessMetrics:function(a){c("CountSuccess",a)},logRequestErrorMetrics:function(a){c("CountError",a)},logMaxQuantityReachedMetric:function(a){a=f(a.clientName,a.cartType)+"MaxQuantityReached";d(a)},logMultipleAsinsSubmittingMetric:function(a){a=f(a.clientName,a.cartType)+"MultipleAsinsSubmitting";d(a)}}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(c){c.when("A","quantity-slider-utils", "qs-cart-update-handler","quantity-slider-metrics-handler").register("quantity-slider-widget",function(c,g,f,d){function l(a,b,d,c){a=n(a,b,c);d?g.disableButton(a):g.enableButton(a)}function k(a,b,d){l("."+a+"-qs-slider-button .qs-decrease-quantity",a,b,d)}function a(a,b,d){l("."+a+"-qs-slider-button .qs-increase-quantity",a,b,d)}function b(a,b,d){l("."+a+"-qs-add-to-cart-button .qs-slider-atc-button",a,b,d)}function r(a){if(a.isQSAction){var e=a.asin,b=q(a);a.isDecreaseQuantityAction?g.deselectButton(n("."+ e+"-qs-slider-button .qs-decrease-quantity",e,b)):g.deselectButton(n("."+e+"-qs-slider-button .qs-increase-quantity",e,b))}}function q(a){return(a=(a=a.request)&&a.additionalInput)&&a.storeId}function u(e){var h=e.asin,c=q(e),f=n("."+h+"-qs-slider-spinner",h,c);g.toggleDomNodeVisibility(f,!1);e.isQSAction?(k(h,!1,c),a(h,!1,c)):b(h,!1,c);r(e);h=e.asin;g.assert(h&&e.request&&e.response&&e.response.quantity!==w,"Required properties missing in payload object for UpdateQSWidget");c=q(e);t(h,e.response.quantity, e.request.maxOrderQuantity,c);e.request.enableQuantityLimitMessage&&(h=n("."+h+"-qs-quantity-limit-message",h,c),g.toggleDomNodeVisibility(h,e.response.quantity>=e.request.maxOrderQuantity));g.updateTotalCartCountOnUI(e,e.cartType);d.logRequestSuccessMetrics(e)}function m(e){var c=e.asin,f=q(e),l=n("."+c+"-qs-slider-spinner",c,f);g.toggleDomNodeVisibility(l,!0);e.isQSAction?(k(c,!0,f),a(c,!0,f)):b(c,!0,f);d.logRequestStartMetrics(e);e.request&&e.request.isMultipleAsinsSubmitting&&d.logMultipleAsinsSubmittingMetric(e)} function n(a,b,d){if(!d)return p(a);b="."+b+"-qs-slider-data";a=document.querySelectorAll(a);for(var e=[],c=0;c<a.length;c++){var g=a[c],f=g&&p(g).closest(".qs-widget-container");(f=(f=f&&p(f).children(b))&&p(f).data("qs-model"))&&f.additionalInput&&f.additionalInput.storeId===d&&e.push(g)}return p(e)}function t(b,d,c,f){var e=n("."+b+"-qs-add-to-cart-button",b,f),h=n("."+b+"-qs-slider-button",b,f);0<d?(g.changeATCtoQS(e,h),e=Math.min(d,c),h=n("."+b+"-qs-qty-present-in-cart",b,f),Number.isInteger(e)&& h.html(e),a(b,d>=c,f)):(g.changeQStoATC(e,h),a(b,!1,f))}var p=c.$;Number.isInteger||(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&-9007199254740992<a&&9007199254740992>a&&Math.floor(a)===a});c.on(g.ACTIONS.ADD_TO_CART_SUBMIT_START,function(a){m(a)});c.on(g.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS,function(a){u(a);a.response.quantity===a.request.maxOrderQuantity&&d.logMaxQuantityReachedMetric(a)});c.on(g.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,function(a){m(a)});c.on(g.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS, function(a){u(a)});c.on(g.ACTIONS.QS_CART_SUBMIT_ERROR,function(c){var e=c.asin,f=q(c),l=n("."+e+"-qs-slider-spinner",e,f);g.toggleDomNodeVisibility(l,!1);c.isQSAction&&c.isMaxOrderQuantityReached?k(e,!1,f):c.isQSAction?(k(e,!1,f),a(e,!1,f)):b(e,!1,f);r(c);d.logRequestErrorMetrics(c)});return{ACTIONS:g.ACTIONS,setAttribution:f.setAttribution,updateQuantitySliderWidget:t}})});"use strict";c.when("QuantitySliderAssetDuplicationGuard").execute(function(p){p.when("A","qs-cart-count-handler","a-button").register("quantity-slider-utils", function(l,g,f){function d(a){return k("."+a+"-qs-slider-data").first().data("qs-model")}function p(a,b){var c=d(a);k("."+a+"-qs-slider-data").data(l.extend(c,b))}var k=l.$;return{ACTIONS:{ADD_TO_CART_SUBMIT_START:"quantity-slider:add-to-cart-start",ADD_TO_CART_SUBMIT_SUCCESS:"quantity-slider:add-to-cart-success",REMOVE_FROM_CART_SUBMIT_START:"quantity-slider:remove-from-cart-start",REMOVE_FROM_CART_SUBMIT_SUCCESS:"quantity-slider:remove-from-cart-success",QS_CART_SUBMIT_ERROR:"quantity-slider:cart-submit-error"}, assert:function(a,b){if(!a)throw Error(b);},changeATCtoQS:function(a,b){k(a).hasClass("aok-hidden")||(k(a).addClass("aok-hidden"),k(b).removeClass("aok-hidden"))},changeQStoATC:function(a,b){k(b).hasClass("aok-hidden")||(k(b).addClass("aok-hidden"),k(a).removeClass("aok-hidden"))},disableButton:function(a){f(k(a)).disable()},deselectButton:function(a){a=f(k(a));a.isEnabled()&&a.setStatus("normal")},enableButton:function(a){f(k(a)).enable()},getQSParamsForAsin:d,getQsParamsFromTargetAsinOffer:function(a, b){var c="."+b+"-qs-slider-data";return(c=(a=a.$event&&k(a.$event.target).closest(".qs-widget-container"))&&a.children(c).data("qs-model"))?c:d(b)},setUpdatedQSParamsForAsin:p,setUpdatedQSParamsForAsinOffer:function(a,b,c){b?k("."+a+"-qs-slider-data").map(function(a,d){a=k(d);(d=a.data("qs-model"))&&d.storeId===b&&a.data(l.extend(d,c))}):p(a,c)},toggleDomNodeVisibility:function(a,b){b?k(a).removeClass("aok-hidden"):k(a).addClass("aok-hidden")},updateTotalCartCountOnUI:function(a,b){a=l.extend({}, a);a.onSuccess=function(a){v.$Nav&&v.$Nav.when("api.setCartCount").run(function(b){b(a)});c.when("mash").execute("quantity-slider-mash-update",function(b){b.cart&&k.isFunction(b.cart.didUpdate)&&b.cart.didUpdate({newCartQuantity:a})})};g.getTotalCartCount(a,b)},logUrl:function(a){a&&l.post(a)}}})});"use strict";p("QuantitySliderAssetDuplicationGuard",function(){return{register:p,when:y}})}); /* ******** */ (function(e){var g=window.AmazonUIPageJS||window.P,n=g._namespace||g.attributeErrors,t=n?n("ALMCartActionAssets",""):g;t.guardFatal?t.guardFatal(e)(t,window):t.execute(function(){e(t,window)})})(function(e,g,n){function t(c,b){try{e.register(c,b)}catch(d){if(!d.message.includes("reregistered by ALMCartActionAssets"))throw d;}}function E(){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=h(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 h(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(h,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(g.location.search)).get("almBrandId");l&&(c.almBrandId=l)}catch(v){d.increment("ATFC_INVALID_URL_ALMBRANDID")}try{var r=(new URLSearchParams(g.location.search)).get("gsc"); r&&(c.gsc=r)}catch(v){d.increment("ATFC_INVALID_URL_GSC")}(f=b.$.param(c))&&"string"===typeof f&&""!==f&&(h+="?"+f);return h}}})});"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 h(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=h(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");a=h(a.data);a=d("#"+a);b&&b.length&&a&&a.length&&(f=!1,b.each(function(){d(this).parent().hasClass("atfc-spinner")&&d(this).unwrap()}),b.css("visibility","visible"))},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,h){b=a.getMetricsForDevice(d.getDevice());h.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 h=d.addQueryStringParamsToUrl("/alm/addtofreshcart",a.data);b.$.ajax(h,{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 h=d(a.data);b.post("/afx/cartconflicts/getconflictsummary",{timeout:5E3,success:a.success,error:a.error,params:h})},resolve:function(a){var h=d(a.data);b.post("/afx/cartconflicts/resolve",{timeout:5E3,success:a.success,error:a.error,params:h})},substitute:function(a){a=d(a.data);a.sourceUrl=g.location.pathname+g.location.search;a=b.$.param(a);g.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 h=d.addQueryStringParamsToUrl("/alm/addtocart/multiple",a.data);b.$.ajax(h,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)}}})});"use strict";t("ALMCartActionAssetDuplicationGuard",function(){return{register:t,when:E}});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-callbacks-helper",function(b){function d(b){var h=b in a;!h&&e.log("Unable to retrieve callback for "+ b,"Error");return h}var a={};return{addCallbacks:function(b){a[b.clientID||"default"]=b},success:function(b,f,c){b=b in a?b:"default";d(b)&&a[b].success&&a[b].success(f,c)},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 h=b.clientId in a?b.clientId:"default"; d(b.clientId)&&a[h].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){g.ue&&g.ue.count&&a&&b&&g.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){g.ue&&g.uet&&a&&g.uet("tc",a,{wb:1})}, setWidgetTimestamp:function(a,b){g.ue&&g.uet&&a&&b&&g.uet(a,b,{wb:1})},increment:function(a){g.ue&&g.ue.count&&a&&g.ue.count(a,(g.ue.count(a)||0)+1)},setCount:d,sendWidgetMetrics:function(a){g.ue&&g.uex&&a&&g.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 g.amazon&&g.amazon.cordova&&g.amazon.cordova.notification&&g.amazon.cordova.notification.vibrate&&g.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,f){c&&(c={name:"fresh-add-to-cart-modal",header:c.header,inlineContent:c.body,footer:c.footer},"desktop"===f&&(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,g){function h(a,d,c,f){e.when("a-modal").execute("showModal",function(w){d||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:d.header,inlineContent:d.errorMessage,footer:d.footer,data:{event:a,response:f}};"desktop"===c&&(e.width=325);w.create(a.$currentTarget,e).show();b.on("a:popover:afterHide:".concat("fresh-add-to-cart-error-modal"),function(b){l.refreshCart(a.data.sessionID);w.remove(b.popover)})})}function m(c,w){a.showGenericErrorModal({success:function(a,b, f){a&&(a=d.parseJSON(f.http.response),r(c,a,w))},error:function(){e.log("Failed to get the generic error modal","Error");var a=g.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));h(c,a,w)}})} function u(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 r(a,d,e){var w=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=u(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)));h(a,w,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:h,showGenericErrorModal:m,parseResponseAndShowErrorModal:r,getItemInCartQuantityFromResponse:u}})});"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,h){function d(a){h({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,h,l){h.storeIntroductionSheetHtml&&h.storeIntroductionSheetHtml.content||d.additionalParams&&d.additionalParams.shouldRenderSIS?c.render(d,h,l):h.renderUFGCartProgressIndicator?a.render(d):b.trigger("fresh-atfc:success", "false",{almBrandId:d.brandId});e.handleAddToCart(h,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,h){function d(a){e.when("a-sheet").execute(function(b){b.create({inlineContent:a,closeType:"icon",height:190}).show();g("mobile",!1)})}function k(a,c,d){var f=a.additionalParams; if(a.asin&&a.brandId&&a.offerListingDiscriminator&&a.storeId){var h={almBrandId:a.brandId,almStoreId:a.storeId,asin:a.asin,isDelivery:c.delivery,offerListingDiscriminator:a.offerListingDiscriminator,isAlmDetailPageBopis:c.almDetailPageBopis};c.newGlowAddressId&&(h.newGlowAddressId=c.newGlowAddressId);a.clientID&&(h.clientId=a.clientID);f&&f.sisDeliveryMessage&&(h.deliveryMessage="DELIVERY_MESSAGE_PLACEHOLDER");b.get("/mulon/alm-sis",{params:h,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);g(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 g(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(h.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?r():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 r(){var a=b.$("#store-introduction-sheet-side-sheet-container").width()+30;v({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 v(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=h(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=g.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 h(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,k){!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(k,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,h,f,k,g,u,y,m,p,r,v,w,t,F,A){return{updateQuantity:g.updateQuantity,attachPrehooks:u.addPrehooks,attachCallbacks:y.addCallbacks, updateAddAllQuantityForAsin:v.updateQuantityForAsin,initialize:function(d){function l(a){return a.isItemSoldByCount?!JSON.parse(a.isItemSoldByCount):a.pickingStrategy?"bulk"===a.pickingStrategy||"catch"===a.pickingStrategy:!1}function v(a,b,c,e){t.vibrate();a.data.amountInUom===n&&l(a.data)&&(a.data.amountInUom=a.data.quantity,a.data.quantity=1);var q={clientId:a.data.clientID,triggerEvent:a,scope:b,success:c,failure:e,device:d},f=C(a,b,e);u&&u.prehooksWeblabEnabled&&u.validatePrehook(q.clientId)? u.invoke(q,{success:D,error:function(a,b,c){f(a,b,c)}}):D(a,b,c,e)}function C(a,b,c){return function(q,e,g){var k=x.ATFC_CTCF,m=q.responseText;p.removeModal();if(m){var l=JSON.parse(m);k=x.ATFC_CTCF+":lineItemBucket:"+B(l.clientResponseModel)}400===q.status&&l?(f.increment(x.ATFC_ERROR_MODAL_COUNT),p.parseResponseAndShowErrorModal(a,l,d)):403===q.status?location.reload():(f.increment(x.ATFC_UNEXPECTED_ERROR_COUNT),p.showGenericErrorModal(a,d),y.error(a.data.clientID,a,q,e,g),A.error());f.endWidgetTimer(b, k);a.data.setQuantityFlag||h.showButtonAndRemoveSpinner(a);c&&c()}}function D(a,e,g,k){var q=C(a,e,k);A.start();c.addToFreshCart({data:a.data,success:function(c,q,k){if(200===k.status)if(f.increment(x.ATFC_SUCCESSFUL_ADD_COUNT),q=x.ATFC_CTCF+":lineItemBucket:"+B(c),f.endWidgetTimer(e,q),q=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,q,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,q,a.data.storeId,a.data.qsUID):b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,q,a.data.storeId),r.refreshCart(a.data.sessionID),y.success(a.data.clientID,a,c.clientResponseModel),A.success(a,c.clientResponseModel),c.refreshGlowLabel){if(F.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():w.handleAddToCart(a.data,c,d);p.removeModal();a.data.setQuantityFlag||h.showButtonAndRemoveSpinner(a);g&&g()},error:function(a,b,c){q(a,b,c)}})}function G(a,c){f.startWidgetTimer(c);b.post("/afx/slotselection/cancel",{timeout:5E3,params:{token:a.data.additionalParams.csrfToken},success:function(){a.data.quantity= g.getQuantity(a.$target);v(a,c,function(){location.reload()})},error:function(){e.log("Failed to clear reservation");p.showGenericErrorModal(a,d)}})}function B(a){return a.items&&Math.ceil(a.items.length/5)}var x=k.getMetricsForDevice(d),z=x.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||h.hideButtonAndRenderSpinner(c);v(c,z)});b.declarative("fresh-clear-slot","click",function(a){a.$currentTarget.context.disabled=!0;G(a,z)});b.declarative("fresh-add-to-cart","click",function(a){f.startWidgetTimer(z); f.increment(x.ATFC_COUNT);h.shouldDisableButtonClicks()||a.$currentTarget.find("input").is(":disabled")||(a.data.setQuantityFlag||h.hideButtonAndRenderSpinner(a),a.data.qsUID?b.trigger("quantity-selector-widget:triggerAction",a.data.qsUID,"AddToCartAction",{$target:a.$currentTarget}):(a.data.quantity=g.getQuantity(a.$target),v(a,z)))});b.declarative("fresh-add-to-cart-alcohol","click",function(a){a.$currentTarget.context.disabled=!0;f.startWidgetTimer(z);a.data.quantity=g.getQuantity(a.$target);b.trigger("quantity-selector-widget:sync-stepper-quantity", a.data.asin,a.data.quantity);v(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){h.shouldDisableButtonClicks()||(h.hideButtonAndRenderSpinner(b),t.vibrate(),a.addToFreshOrder({data:b.data,success:function(a,c,d){200===d.http.status&&y.success(b.data.clientID, b,a.clientResponseModel);h.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 g=a.getFallbackErrorModalHtml();p.showModal(b,g,d);y.error(b.data.clientID,b,c,e,f)}h.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,g,l,u,t,m,p){return{attachCallbacks:g.addCallbacks,attachPreHandler:l.addPreHandler,initialize:function(d){function h(f,h,l,r){p.vibrate();c.multiAddToCart({data:f.data,success:function(c,h,p){200===p.status&&(e.increment(k.ALM_MULTI_ATC_COUNT_SUCCESS), t.refreshCart(f.data.sessionID),b.trigger("multipleAddToCart:success",f.data),g.success(f.data.clientId,f,c),m.handleAddToCart(f.data,c,d));u.removeModal();a.showButtonAndRemoveSpinner(f);l&&l()},error:function(b,c,h){a.showButtonAndRemoveSpinner(f);u.removeModal();if(b.responseText)try{var m=JSON.parse(b.responseText)}catch(B){m=n}400===b.status&&m?(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_MODAL),u.parseResponseAndShowErrorModal(f,m,d)):403===b.status?location.reload():(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED), u.showGenericErrorModal(f,d));g.error(f.data.clientId,f,b,c,h);r&&r()}})}var k=f.getMetricsForDevice(d),r=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),h(b,r))})}}})});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,g){return{initialize:function(d){function h(a){return"UFG"==a.cartType&&a.response&&a.request&&a.request.additionalInput?!0:!1}function k(b){if(h(b)&&b.response.rawResponse){var g=b.response.rawResponse,k=g.jqXHR,m=b.request,l=m.triggeringEvent;l.data=m.additionalInput;l.data&&(l.data.isDecreaseQuantityAction= b.isDecreaseQuantityAction);200===k.status&&(a.refreshCart(m.sessionId),e.success(b.clientName,l,g.clientResponseModel),c.handleAddToCart(l.data,g,d));f.removeModal()}}b.on("quantity-slider:add-to-cart-start",function(a){g.vibrate()});b.on("quantity-slider:remove-from-cart-start",function(a){g.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(h(a)){var b= a.request.triggeringEvent,c=a.response,g=c.responseText,k;f.removeModal();g&&(k=JSON.parse(g));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(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(p){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,d=r?r("ABPricingFreeFormQuantityPickerAssets",""):f;d.guardFatal?d.guardFatal(p)(d,window):d.execute(function(){p(d,window)})})(function(p,f,r){p.when("jQuery","A","abPricingFfqp_constants","abPricingFfqp_metrics","abPricingFfqp_amazonAPIPriceFormatter").register("abPricingFfqp_amazonAPIClient",function(d,f,g,a,c){return f.createClass({inclusions:function(){return{priceV1:"buyingOptions[].price(product.price/v1)", quantityPricingTableV1:"buyingOptions[].quantityPricingTable(product.quantity-pricing-table/v1)",availabilityV2:"buyingOptions[].availability(product.availability/v2)"}},init:function(a){this._baseEndpoint="https://"+a.endpoint;this._baseUrl=this._baseEndpoint+"/api/marketplaces/"+a.marketplaceId+"/";this._defaultHeaders={"Accept-Language":a.language,"x-api-csrf-token":a.csrfToken,"x-cc-currency-of-preference":a.currencyOfPreference,"x-amzn-encrypted-slate-token":this._getSlateToken()};"object"=== typeof a.priceFormatConfig&&(this._aapiPriceFormatter=new c(a.priceFormatConfig));a=this._getValidatedClientId(a.clientId);this._metricScopeName=g.METRIC_SCOPE_NAME.AAPI_CLIENT.replace(g.AAPI_CLIENT_ID_PLACEHOLDER,a);this._statusMetricNameTpl=g.COUNTER_METRIC.AAPI_REQUEST_STATUS.replace(g.AAPI_CLIENT_ID_PLACEHOLDER,a)},_constructHeader:function(a,c){return"application/vnd.com.amazon.api+json; "+(""===a?"":'type\x3d"'+a+'"; ')+(""===c?"":'expand\x3d"'+c+'"; ')+'experiments\x3d"enableQuantityPricingTablePaginationField_dn2f4w34"'}, productV2:function(a){var c=["products",a.asin],g={Accept:this._constructHeader("product/v2",a.subresources.join(","))},c=this._constructUrl(c,a.parameters);this._get(a.success,a.error,c,g)},productQPT:function(a){var c={Accept:this._constructHeader("product.quantity-pricing-table/v1","")};this._get(a.success,a.error,this._baseEndpoint+a.url,c)},_getValidatedClientId:function(a){return"string"===typeof a&&0<a.length?a:g.UNSPECIFIED_CLIENT_ID},_get:function(c,m,f,k){var q=this;a.registerWidgetBodyBegin(this._metricScopeName); k=d.extend(this._defaultHeaders,k);d.ajax({url:f,type:"GET",headers:k,xhrFields:{withCredentials:!0},timeout:g.AAPI_CLIENT_TIMEOUT}).done(function(b,e){q._handleAjaxSuccess(b,e,c)}).fail(function(b,e,a){q._handleAjaxError(e,a,m,b.status)}).always(function(b,e){q._handleAjaxComplete(e)})},_constructUrl:function(a,c){c=c||{};c=d.map(c,function(a,c){return c.toString()+"\x3d"+a.toString()}).join("\x26");return this._baseUrl+a.join("/")+(0<c.length?"?"+c:"")},_getSlateToken:function(){var a=document.querySelector('meta[name\x3d"encrypted-slate-token"]'); if(a)return a.content},_handleAjaxSuccess:function(c,g,d){this._aapiPriceFormatter&&this._aapiPriceFormatter.formatPrices(c);a.registerWidgetCriticalFeature(this._metricScopeName);a.registerWidgetLoaded(this._metricScopeName);d&&d(c,g)},_handleAjaxError:function(c,g,d,f){a.registerWidgetLoaded(this._metricScopeName);d&&d(c,g,f)},_handleAjaxComplete:function(c){"string"!==typeof c&&(c=g.UNSPECIFIED_REQUEST_STATUS);c=this._statusMetricNameTpl.replace(g.AAPI_REQUEST_STATUS_PLACEHOLDER,c);a.registerCounter(c)}})}); "use strict";p.when("A","abPricingFfqp_constants","abPricingFfqp_metrics","abPricingFfqp_priceFormatter").register("abPricingFfqp_amazonAPIPriceFormatter",function(d,f,g,a){return d.createClass({init:function(c){this._priceFormatter=new a(c)},formatPrices:function(a){g.registerWidgetBodyBegin(f.METRIC_SCOPE_NAME.AAPI_PRICE_FORMATTER);try{this._formatPricesRec(a),g.registerWidgetCriticalFeature(f.METRIC_SCOPE_NAME.AAPI_PRICE_FORMATTER)}catch(d){throw d;}finally{g.registerWidgetLoaded(f.METRIC_SCOPE_NAME.AAPI_PRICE_FORMATTER)}}, _formatPricesRec:function(a){if(this._isPriceObject(a))a.displayString=this._formatPrice(a.amount,a.currencyCode,a.displayString);else if("object"===typeof a)for(var g in a)a.hasOwnProperty(g)&&this._formatPricesRec(a[g])},_isPriceObject:function(a){return"object"===typeof a&&this._priceFormatter.isValidPrice(a.amount,a.currencyCode)},_formatPrice:function(a,g,d){return"string"===typeof d&&0<d.length?d:this._priceFormatter.format(a,g)}})});"use strict";p.when("A","abPricingFfqp_constants","abPricingFfqp_metrics").register("abPricingFfqp_priceFormatter", function(d,f,g){return d.createClass({init:function(a){a=a||{};this._priceFormat=a.priceFormat;this._decimalSeparator=a.decimalSeparator;this._fractionDigits=parseInt(a.fractionDigits);this._groupingSeparator=a.groupingSeparator;this._groupingDigits=parseInt(a.groupingDigits);this._secondaryGroupingDigits=parseInt(a.secondaryGroupingDigits);this._minGroupingDigits=parseInt(a.minGroupingDigits);this._currencyCode=a.currencyOfPreference;this._validateInput();0===this._secondaryGroupingDigits&&(this._secondaryGroupingDigits= this._groupingDigits)},format:function(a,c){a=parseFloat(a);isNaN(a)&&this._throwValidationError("amount");if(0>a)return"-"+this.format(-a,c);a=this._formatAmount(a);return this._currencyFormat(c).replace("{}",a)},isValidPrice:function(a,c){a=parseFloat(a);return!isNaN(a)&&0<=a&&this._isValidCurrencyCode(c)},_validateInput:function(){this._validatePriceFormat();this._validateSeparator("decimalSeparator",this._decimalSeparator);this._validateSeparator("groupingSeparator",this._groupingSeparator);this._validateDigitsCount("fractionDigits", this._fractionDigits,0);this._validateDigitsCount("groupingDigits",this._groupingDigits,0);this._validateDigitsCount("secondaryGroupingDigits",this._secondaryGroupingDigits,0);this._validateDigitsCount("minGroupingDigits",this._minGroupingDigits,1);this._validateCurrencyCode()},_validatePriceFormat:function(){"string"===typeof this._priceFormat&&-1!==this._priceFormat.indexOf("{}")||this._throwValidationError("priceFormat")},_validateSeparator:function(a,c){"string"===typeof c&&0!=c.length||this._throwValidationError(a)}, _validateDigitsCount:function(a,c,g){("number"!==typeof c||isNaN(c)||c<g)&&this._throwValidationError(a)},_validateCurrencyCode:function(){this._isValidCurrencyCode(this._currencyCode)||this._throwValidationError("currencyOfPreference")},_isValidCurrencyCode:function(a){return"string"===typeof a&&/^[A-Z]{3}$/.test(a)},_throwValidationError:function(a){throw Error("[abPricingFfqp_priceFormatter] Invalid value for "+a);},_formatAmount:function(a){var c=this._halfEvenRound(a,this._fractionDigits).toString().split("."); a=this._formatIntegerPart(c[0]);if(0==this._fractionDigits)return a;c=this._formatDecimalPart(2==c.length?c[1]:"");return[a,c].join(this._decimalSeparator)},_halfEvenRound:function(a,c){a*=Math.pow(10,c);var g=a%1;a=.500001<=g||1E-6>Math.abs(g-.5)&&1==Math.floor(a)%2?Math.ceil(a):Math.floor(a);return a/Math.pow(10,c)},_formatIntegerPart:function(a){if(0===this._groupingDigits||a.length<this._groupingDigits+this._minGroupingDigits)return a;for(var c=a.length,g=!0,d=[];0<c;){var f=this._secondaryGroupingDigits; g&&(g=!1,f=this._groupingDigits);c<f?d.push(a.substr(0,c)):d.push(a.substr(c-f,f));c-=f}return d.reverse().join(this._groupingSeparator)},_formatDecimalPart:function(a){for(;a.length<this._fractionDigits;)a+="0";return a.substr(0,this._fractionDigits)},_currencyFormat:function(a){if(a===this._currencyCode)return this._priceFormat;this._isValidCurrencyCode(a)||this._throwValidationError("currencyCode");g.registerCounter(f.COUNTER_METRIC.FALLBACK_PRICE_FORMAT_USED);return a+" {}"}})});"use strict"; p.register("abPricingFfqp_constants",function(){return{METRIC_SCOPE_NAME:{AAPI_PRICE_FORMATTER:"b2b-ffqp-aapi-price-formatter",AAPI_CLIENT:"b2b-ffqp-aapi-client-{clientId}",AAPI_QPT:"b2b-ffqp-aapi-qpt",AAPI_PACK_ASIN:"b2b-ffqp-aapi-pack-asin",AAPI_SINGLE_QUANTITY:"b2b-ffqp-aapi-single-quantity",AUI_STATE_PARSING:"b2b-ffqp-aui-state-parsing",GET_QPT_REQUEST:"b2b-ffqp-get-qpt-request"},COUNTER_METRIC:{FALLBACK_PRICE_FORMAT_USED:"ABPricingFreeFormQuantityPicker.FallbackPriceFormatUsed",AAPI_REQUEST_STATUS:"ABPricingFreeFormQuantityPicker.AAPIClient.{clientId}.status.{status}", AAPI_SINGLE_QUANTITY_BO_NOT_FOUND:"ABPricingFreeFormQuantityPicker.AAPISingleQuantityBONotFound",AAPI_SINGLE_QUANTITY_EXTRACTION_FAILED:"ABPricingFreeFormQuantityPicker.AAPISingleQuantityBONotFoundExtractionFailed",AAPI_PACK_ASIN_EXTRACTION_FAILED:"ABPricingFreeFormQuantityPicker.AAPIPackAsinExtractionFailed",AAPI_PACK_ASIN_BO_NOT_FOUND:"ABPricingFreeFormQuantityPicker.AAPIPackAsinBONotFound",AAPI_PACK_ASIN_MISSING:"ABPricingFreeFormQuantityPicker.AAPIPackAsinMissing",AAPI_PACK_ASIN_MISSING_BO:"ABPricingFreeFormQuantityPicker.AAPIPackAsinMissing.{bo}", AAPI_PACK_ASIN_ERROR:"ABPricingFreeFormQuantityPicker.AAPIPackAsinError",AAPI_PACK_ASIN_ERROR_CODE:"ABPricingFreeFormQuantityPicker.AAPIPackAsinError.{code}",AAPI_PACK_ASIN_PRESENT:"ABPricingFreeFormQuantityPicker.AAPIPackAsinPresent",AAPI_QPT_BO_NOT_FOUND:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableBONotFound",AAPI_QPT_MISSING:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableMissing",AAPI_QPT_MISSING_BO:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableMissing.{bo}",AAPI_QPT_ERROR:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableError", AAPI_QPT_ERROR_CODE:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableError.{code}",AAPI_QPT_PRESENT:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePresent",AAPI_QPT_PAGINATES:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginates",AAPI_QPT_FETCH_PAGE:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableFetchPage",AAPI_QPT_PAGE_FETCHED:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePageFetched",AAPI_QPT_PAGINATION_COMPLETE:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginationComplete", AAPI_QPT_NEXT_PAGE_ONLY:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableNextPageOnly",AAPI_QPT_PAGE_MISSING:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginationPageMissing",AAPI_QPT_EXTRACTION_FAILED:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableExtractionFailed",AAPI_QPT_CONVERSION_ERROR:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTableConversionFailed",AAPI_QPT_PAGINATION_PAGE_ERROR:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginationPageError", AAPI_QPT_PAGINATION_ERROR:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginationError",AAPI_QPT_PAGINATION_404_ERROR:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePagination404Error",AAPI_QPT_PAGINATION_404_EXCEPTION:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePagination404Exception",AAPI_QPT_MAX_PAGINATION_DEPTH_REACHED:"ABPricingFreeFormQuantityPicker.AAPIQuantityPricingTablePaginationDepthReached",AAPI_QPT_WEBLABS_TRIGGERING_EXCEPTION:"ABPricingFreeFormQuantityPicker.WeblabTriggeringException", AAPI_SUBRESOURCE_WEBLABS_TRIGGERING_EXCEPTION:"ABPricingFreeFormQuantityPicker.SubresourceWeblabTriggeringException",AAPI_DATA_MGR_INIT_FAILED:"ABPricingFreeFormQuantityPicker.AAPIDataManagerInitializationFailed",PACK_ASIN_RECOMMENDATION_ERROR:"ABPricingFreeFormQuantityPicker.PackAsinRecommendationError",QUANTITY_REFRESH_CHECK_ERROR:"ABPricingFreeFormQuantityPicker.QuantityRefreshCheckError",PAGE_WILL_REFRESH:"ABPricingFreeFormQuantityPicker.PageWillRefresh",NO_PAGE_REFRESH_QTY_AVAILABLE:"ABPricingFreeFormQuantityPicker.NoPageRefreshQtyAvailable", NO_PAGE_REFRESH_QTY_NOT_AVAILABLE:"ABPricingFreeFormQuantityPicker.NoPageRefreshQtyNotAvailable",AVAILABILITY_CHECK_QTY_AVAILABLE_SHOULD_REFRESH:"ABPricingFreeFormQuantityPicker.AvailabilityCheckQtyAvailableShouldRefresh",AVAILABILITY_CHECK_PAGE_WILL_REFRESH:"ABPricingFreeFormQuantityPicker.AvailabilityCheckPageWillRefresh",AVAILABILITY_CHECK_QTY_AVAILABLE_NO_REFRESH:"ABPricingFreeFormQuantityPicker.AvailabilityCheckQtyAvailableNoRefresh",AVAILABILITY_CHECK_QTY_AVAILABLE:"ABPricingFreeFormQuantityPicker.AvailabilityCheckQtyAvailable", AVAILABILITY_CHECK_QTY_NOT_AVAILABLE:"ABPricingFreeFormQuantityPicker.AvailabilityCheckQtyNotAvailable",AVAILABILITY_CHECK_ERROR:"ABPricingFreeFormQuantityPicker.AvailabilityCheckError",MISSING_AJAX_PARAMS:"ABPricingFreeFormQuantityPicker.MissingAjaxParams",SPLIT_OFFER_LINK_DISPLAYED:"SplitOfferLinkDisplayed"},ERROR:{AAPI_DATA_MGR_INIT_FAILED:"AAPIDataManager initialization failed",MISSING_AJAX_PARAMS:"AAPIDataManager could not find the AJAX parameters"},AAPI_CLIENT_ID_PLACEHOLDER:"{clientId}",AAPI_METADATA_EXPERIMENTS:"x-api-exp-data", AAPI_REQUEST_STATUS_PLACEHOLDER:"{status}",AAPI_ERROR_CODE_PLACEHOLDER:"{code}",AAPI_BO_PLACEHOLDER:"{bo}",UNSPECIFIED_CLIENT_ID:"unspecified",UNSPECIFIED_REQUEST_STATUS:"unspecified",AAPI_CLIENT_TIMEOUT:6E3,AJAX_PARAMS_STATE_KEY:"quantityPickerAjaxParams",MAX_SUPPORTED_QTY:999,MAX_PAGINATION_DEPTH:10,ADD_TO_CART_QUANTITY_CHANGE_EVENT:"addToCartQuantityChange",URL_PARAM_ID__BUYING_IN_BULK_QUANTITY:"quantity",URL_PARAM_ID__BUYING_IN_BULK_REFTAG:"ref_",URL_PARAM_ID__BUYING_IN_BULK_ASIN:"asin",URL_PARAM_VALUE__LIMITED_AVAILABILITY_REFTAG:"bbt_limit_order", WEBLAB_AUTOTRIGGER_ALLOWLIST:["AB_SAVINGS_STANDARDIZATION_EXPERIMENT_868536","B2BHAWKS_QPT_PAGE_LIMIT_DATAPATH_1033347","AB_DPX_OPTIMIZER_EXPERIMENT_1056062"]}});"use strict";p.when("jQuery","abPricingFfqp_constants","ready").register("abPricingFfqp_metrics",function(d,k){function g(a,g){f.ue&&f.ue.trigger&&f.ue.trigger(a,g)}var a=!0;return{logError:function(a,g,d){f.ueLogError&&f.ueLogError(d,{logLevel:a,attribution:"ABPricingFreeFormQuantityPicker",message:g})},updateCounterTriggering:function(c){a= c},register:function(a){a.counter&&this.registerCounter(a.counter)},registerCounter:function(c){a&&f.ue&&f.ue.count&&f.ue.count(c,(f.ue.count(c)||0)+1)},registerWidgetBodyBegin:function(c){a&&f.uet&&f.uet("bb",c,{wb:1})},registerWidgetCriticalFeature:function(c){a&&f.uet&&f.uet("cf",c,{wb:1})},registerWidgetLoaded:function(c){a&&f.uex&&f.uex("ld",c,{wb:1})},triggerWeblab:g,triggerWeblabIfAllowlisted:function(a,d){k.WEBLAB_AUTOTRIGGER_ALLOWLIST.includes(a)&&g(a,d)}}});"use strict";p.when("jQuery", "A","abPricingFfqp_utils","abPricingFfqp_constants","abPricingFfqp_metrics","abPricingFfqp_quantityPickerDataManager").register("abPricingFfqp_quantityManager",function(d,k,g,a,c,h){function m(e,a){return(e=(new RegExp("(?:^|\\?|\x26)"+a+"\x3d(?:([^\x26#]*)|\x26|#|$)")).exec(e))?e[1]?decodeURIComponent(e[1].replace(/\+/g," ")):"":r}function l(e,a,b){var c=e.split("#");e=c[0];e="?"===e[0]?e.substr(1):e;c=c[1];"undefined"!==typeof b&&null!==b?(b=a+"\x3d"+b,a=new RegExp("(^|\x26)("+a+"\x3d[^\x26]*)"), e=a.test(e)?e.replace(a,"$1"+b):e+((0!==e.length?"\x26":"")+b)):(a=new RegExp("(^|\x26)("+a+"\x3d[^\x26]*)"),a.test(e)&&(e=e.replace(a,""),"\x26"===e[0]&&(e=e.substr(1))));return"?"+e+("undefined"!==typeof c?"#"+c:"")}function n(e,a){for(var b in a)a.hasOwnProperty(b)&&(e=l(e,encodeURIComponent(b),encodeURIComponent(a[b])));return e}function q(e){return f.location.protocol+"//"+f.location.host+f.location.pathname+n(f.location.search,e)}function b(){var e;e=parseInt(m(f.location.search,"qty"));e=isNaN(e)|| 1>e||e>a.MAX_SUPPORTED_QTY?1:e;this._initialQuantity=this.currentQuantity=e;this.wireUpSelectorBasedEvents()}k.on("ready",function(){f.location.search.includes("\x26bmsmSlotRedirect\x3d1")&&document.getElementById("qtyUpdatedTooltip").click()});b.prototype.getCurrentQuantity=function(){return this.currentQuantity};b.prototype.wireUpSelectorBasedEvents=function(){var e=this;p.when("A","jQuery","quanityChangePriceUpdate").execute(function(a,b,c){e.quantityChangePriceUpdater=c;a.on("a:pageUpdate",function(){e.handleTwisterPageRefresh()})})}; b.prototype.update3PPriceBlock=function(){if(!(this.leastMinimumOrderQuantity===r||1>=this.leastMinimumOrderQuantity)){var e=d(".price3P");e.hasClass("updatedPrice3P")||(e.addClass("updatedPrice3P"),this.quantityChangePriceUpdater.ajaxCall({qt:this.leastMinimumOrderQuantity,quantityPriceField:"quantity_price"}))}};b.prototype.handleTwisterPageRefresh=function(){this.update3PPriceBlock()};b.prototype.reloadPageForQuantity=function(e,a){var b={},c="";b.qty=e;b.psc=1;e="";"undefined"!==typeof a&&("undefined"!== typeof a.refTag&&(b.ref_=a.refTag),"string"===typeof a.selectedBuyingOption&&0<a.selectedBuyingOption.length&&(b.sbo=a.selectedBuyingOption),"undefined"!==typeof a.merchantId&&(b.smid=a.merchantId),"undefined"!==typeof a.anchorToDiv&&(e=a.anchorToDiv),"undefined"!==typeof a.asinDetailPageUrl&&(c=f.location.protocol+"//"+f.location.host+a.asinDetailPageUrl+n("",b)+"\x26bmsmSlotRedirect\x3d1"+e));0==c.length&&(c=q(b)+e);f.location.href=c};b.prototype.notifyQuantityTyped=function(e,b){this.quantityRefreshCheck({newQuantity:e, currentBuyBoxId:b.currentBuyBoxId,qdsForLockedMerchantEnabled:b.qdsForLockedMerchantEnabled,success:function(e,g){c.registerCounter(e?a.COUNTER_METRIC.AVAILABILITY_CHECK_QTY_AVAILABLE:a.COUNTER_METRIC.AVAILABILITY_CHECK_QTY_NOT_AVAILABLE);b.callback({hasAvailability:e})},error:function(){c.registerCounter(a.COUNTER_METRIC.AVAILABILITY_CHECK_ERROR);b.callback({hasAvailability:!0})}})};b.prototype.buyboxRefreshCheck=function(e){var b=this;this.quantityRefreshCheck({newQuantity:e.newQuantity,currentBuyBoxId:e.currentBuyBoxId, qdsForLockedMerchantEnabled:e.qdsForLockedMerchantEnabled,startEvent:"quantityRefreshCheckStarted",success:function(g,q){e.newQuantity===b.currentQuantity&&(g&&q?(c.registerCounter(a.COUNTER_METRIC.PAGE_WILL_REFRESH),b.reloadPageForQuantity(e.newQuantity,{activeBuyBoxId:e.activeBuyBoxId,selectedBuyingOption:e.selectedBuyingOption})):(c.registerCounter(g?a.COUNTER_METRIC.NO_PAGE_REFRESH_QTY_AVAILABLE:a.COUNTER_METRIC.NO_PAGE_REFRESH_QTY_NOT_AVAILABLE),e.callback({hasAvailability:g})),k.trigger("quantityRefreshCheckFinished"))}, error:function(){c.registerCounter(a.COUNTER_METRIC.QUANTITY_REFRESH_CHECK_ERROR);e.newQuantity===b.currentQuantity&&b.reloadPageForQuantity(e.newQuantity,{activeBuyBoxId:e.activeBuyBoxId,selectedBuyingOption:e.selectedBuyingOption})}})};b.prototype.notifyQuantityChanged=function(e,a){e=parseInt(e);if(this.currentQuantity!==e){this.currentQuantity=e;if(f.history!==r&&f.history.pushState!==r){var b={};b.qty=e;f.history.pushState({},"",q(b))}k.trigger("buyBoxQuantityChanged",a.senderId,e,{newQuantity:e, activeBuyBoxId:a.activeBuyBoxId,selectedBuyingOption:a.selectedBuyingOption});k.trigger("notifyBuyingInBulkOptionClicked",e)}};b.prototype.quantityRefreshCheck=function(e){if(!0!==e.preventRefreshCheck){var a={asin:g.getPageState().asin,initialQuantity:this._initialQuantity,quantity:e.newQuantity,currentBuyBoxId:e.currentBuyBoxId,success:e.success,error:e.error};if(e.qdsForLockedMerchantEnabled){var b=m(f.location.search,"smid");"undefined"!==typeof b&&(a.merchantId=b)}"string"===typeof e.startEvent&& k.trigger(e.startEvent);h.getInstance().refreshCheck(a)}};b.prototype.fetchAllTiersForQuantityDiscountTable=function(e){var a=this.isQPTBuyBoxAwareEnabled(e),b={asin:g.getPageState().asin,enableQPTPagination:"true"};a&&(b.currentBuyBoxId=e.activeBuyBoxId);if(e.qdsForLockedMerchantEnabled){var c=m(f.location.search,"smid");"undefined"!==typeof c&&(b.merchantId=c)}c=e.enableQuantityPricingTablePagination;"undefined"!==c&&(b.enableQPTPagination=0==c?"false":"true");var q=this;this.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableStarted", e);b.success=function(b){a?k.trigger("fetchQuantityDiscountTableCompleted",b,e.senderId):k.trigger("fetchQuantityDiscountTableCompleted",b)};b.error=function(){q.triggerBuyBoxAwareEvent("fetchQuantityDiscountTableError",e)};h.getInstance().getQuantityPricingTable(b)};b.prototype.isQPTBuyBoxAwareEnabled=function(e){return e&&e.senderId&&e.activeBuyBoxId};b.prototype.triggerBuyBoxAwareEvent=function(e,a){this.isQPTBuyBoxAwareEnabled(a)?k.trigger(e,a.senderId):k.trigger(e)};b.prototype.notifyBuyingInBulkOptionClicked= function(e){k.trigger("notifyBuyingInBulkOptionClicked",e)};b.prototype.getLimitedAvailabilityUrl=function(e){var b={};b[a.URL_PARAM_ID__BUYING_IN_BULK_QUANTITY]=e;b[a.URL_PARAM_ID__BUYING_IN_BULK_ASIN]=g.getPageState().asin;b[a.URL_PARAM_ID__BUYING_IN_BULK_REFTAG]=a.URL_PARAM_VALUE__LIMITED_AVAILABILITY_REFTAG;return"/ab/bulk-order/bebx/api/v2/fastForwardBasket"+n("?",b)};b.prototype.notifyQuantityUnavailableOptionClicked=function(e){e=f.location.protocol+"//"+f.location.host+this.getLimitedAvailabilityUrl(e); f.location.href=e};return{EVENT__BUY_BOX_QUANTITY_CHANGED:"buyBoxQuantityChanged",EVENT__QUANTITY_REFRESH_CHECK_STARTED:"quantityRefreshCheckStarted",EVENT__QUANTITY_REFRESH_CHECK_FINISHED:"quantityRefreshCheckFinished",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED:"fetchQuantityDiscountTableStarted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED:"fetchQuantityDiscountTableCompleted",EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR:"fetchQuantityDiscountTableError",EVENT__NOTIFY_BUYING_IN_BULK_OPTION_CLICKED:"notifyBuyingInBulkOptionClicked", getUrlParameter:m,replaceUrlParameter:l,replaceUrlQueryParameters:function(e,a){var b="?";e=e.split(b);2===e.length&&(b+=e[1]);a=n(b,a);"?"!==a&&(e[0]+=a);return e[0]},singleton:new b}});"use strict";p.when("A","jQuery","abPricingFfqp_constants","abPricingFfqp_metrics","abPricingFfqp_amazonAPIClient","abPricingFfqp_helpers","ready").register("abPricingFfqp_quantityPickerDataManager",function(d,f,g,a,c,h){var m=d.createClass({_buyboxIdToBOTypes:{customOffer:["CUSTOM_OFFER"],b2bRd:["B2B_RD"],default:["NEW", "B2B_NEW"]},_buyboxIdToFallbackBOTypes:{customOffer:["NEW","B2B_NEW"]},init:function(a){this._aapiClient=new c(a);this._qptCache=this._getQPTCacheInstance();this._quantityDataCache=this._getQuantityDataCacheInstance()},getQuantityPricingTable:function(c){a.registerWidgetBodyBegin(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST);var b=this;this._qptCache.get(c,function(e){try{var t,d=b._extractQPT(e,c),f=b._extractPricingTiers(d);if(b._hasNextPage(d)){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATES);a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_FETCH_PAGE); var h=b._extractNextPage(d);b._aapiQPTRequest(c.asin,h,[f],c.success,c.error)}else t=b._convertToLegacyFormat(f),c.success(t)}catch(k){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_EXTRACTION_FAILED),c.error(k)}},c.error)},refreshCheck:function(a){function b(e){g||(g=!0,a.error(e))}var e=this,c={},g=!1;f.each([a.quantity,a.initialQuantity],function(g,d){e._getSingleQuantityData({asin:a.asin,merchantId:a.merchantId,quantity:d,currentBuyBoxId:a.currentBuyBoxId,success:function(e){c[d]=e;if(c[a.initialQuantity]&& c[a.quantity]){e=c[a.initialQuantity];var b=c[a.quantity];a.success(b.isAvailable,e.price!==b.price||e.buyingOptionId!==b.buyingOptionId)}},error:b})})},_aapiRequest:function(c,b,e,g,d,f){a.registerWidgetBodyBegin(f);this._aapiClient.productV2({asin:c,subresources:b,parameters:e,success:function(e){a.registerWidgetCriticalFeature(f);a.registerWidgetLoaded(f);g(e)},error:function(e,b){a.registerWidgetLoaded(f);d(e,b)}})},_triggerQPTWeblabsIfAllowlisted:function(c){if(c.metadata&&c.metadata[g.AAPI_METADATA_EXPERIMENTS])try{c.metadata[g.AAPI_METADATA_EXPERIMENTS].split(",").forEach(function(b){b= b.split(":",2);a.triggerWeblabIfAllowlisted(b[0],b[1])})}catch(b){a.logError("ERROR","Could not trigger weblabs",b),a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_WEBLABS_TRIGGERING_EXCEPTION)}},_aapiQPTRequest:function(c,b,e,d,f){var h=this;this._aapiClient.productQPT({asin:c,url:b,success:function(b){try{var k=h._processQPTPage(b);e.push(h._extractPricingTiers(k));a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGE_FETCHED);h._maxPaginationDepthGuardrail(e.length);if(h._hasNextPage(k)){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_FETCH_PAGE); var m=h._extractNextPage(k);h._aapiQPTRequest(c,m,e,d,f)}else{var l=h._constructTiers(e),n=h._convertToLegacyFormat(l);a.registerWidgetCriticalFeature(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST);a.registerWidgetLoaded(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST);a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATION_COMPLETE);d(n)}}catch(p){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATION_PAGE_ERROR),a.logError("ERROR","Exception when processing next page",p),f(p)}},error:function(b,c,q){if(404===q){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATION_404_ERROR); try{var k=h._constructTiers(e),m=h._convertToLegacyFormat(k);a.registerWidgetCriticalFeature(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST);a.registerWidgetLoaded(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST);d(m)}catch(l){a.registerWidgetLoaded(g.METRIC_SCOPE_NAME.GET_QPT_REQUEST),a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATION_404_EXCEPTION),a.logError("ERROR","Exception when processing empty page",l),f(l)}}else a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGINATION_ERROR),f(b,c)}})},_maxPaginationDepthGuardrail:function(c){if(c>= this.getMaxPaginationDepth())throw a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_MAX_PAGINATION_DEPTH_REACHED),Error("Max pagination depth reached");},getMaxPaginationDepth:function(){return g.MAX_PAGINATION_DEPTH},_getQPTCacheInstance:function(){var a=this,b=[a._aapiClient.inclusions().quantityPricingTableV1];return new h.AsyncCache({loader:function(e,c,d){var f={};"string"===typeof e.merchantId&&(f.merchantId=e.merchantId);f.enableQuantityPricingTablePagination=e.enableQPTPagination;a._aapiRequest(e.asin, b,f,c,d,g.METRIC_SCOPE_NAME.AAPI_QPT)},keyGenerator:function(e){var a=e.asin;"string"===typeof e.merchantId&&(a+=e.merchantId);return a}})},_getQuantityDataCacheInstance:function(){var a=this,b=[a._aapiClient.inclusions().priceV1,a._aapiClient.inclusions().availabilityV2];return new h.AsyncCache({loader:function(e,c,d){var f={itemQuantity:e.quantity};"string"===typeof e.merchantId&&(f.merchantId=e.merchantId);a._aapiRequest(e.asin,b,f,c,d,g.METRIC_SCOPE_NAME.AAPI_SINGLE_QUANTITY)},keyGenerator:function(a){var b= a.asin+a.quantity.toString();"string"===typeof a.merchantId&&(b+=a.merchantId);return b}})},_firstBuyingOption:function(a){return a.entity.buyingOptions[0]},_firstBuyingOptionByType:function(a,b){a=a.entity.buyingOptions;for(var e=0;e<a.length;e++){var c=a[e];if(-1!==b.indexOf(c.type))return c}},_firstBuyingOptionByBuyboxId:function(a,b){a=this._firstBuyingOptionByType(a,this._buyboxIdToBOTypes[b]||this._buyboxIdToBOTypes.default);if("undefined"===typeof a)throw Error("Could not find an eligible buying option"); return a},_firstBuyingOptionByBuyboxIdWithFallback:function(a,b){var e=this._buyboxIdToFallbackBOTypes[b];b=this._firstBuyingOptionByType(a,this._buyboxIdToBOTypes[b]||this._buyboxIdToBOTypes.default);"undefined"===typeof b&&"undefined"!==typeof e&&(b=this._firstBuyingOptionByType(a,e));if("undefined"===typeof b)throw Error("Could not find an eligible or fallback buying option");return b},_extractQPT:function(c,b){var e;try{e=this._firstBuyingOptionByBuyboxId(c,b.currentBuyBoxId)}catch(d){a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_BO_NOT_FOUND); a.logError("ERROR","Exception when getting first BO",d);return}c=e.quantityPricingTable;if("undefined"===typeof c||"undefined"===typeof c.entity)a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_MISSING),"string"===typeof e.type&&a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_MISSING_BO.replace(g.AAPI_BO_PLACEHOLDER,e.type));else return this._triggerQPTWeblabsIfAllowlisted(c),c},_processQPTPage:function(c){if("undefined"===c.entity)a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PAGE_MISSING);else return c},_extractPricingTiers:function(c){if("undefined"=== typeof c)return[];var b=c.entity.pricingTiers;if("undefined"===typeof b&&this._hasNextPage(c))return a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_NEXT_PAGE_ONLY),[];if("undefined"===typeof b)throw a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_ERROR),c=c.entity.code,"string"===typeof c&&a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_ERROR_CODE.replace(g.AAPI_ERROR_CODE_PLACEHOLDER,c)),Error("Error in the QPT sub-resource");a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_PRESENT);return b},_hasNextPage:function(a){return"undefined"!== typeof a&&"undefined"!==typeof a.entity.nextPage},_extractNextPage:function(a){return a.entity.nextPage.resource.url},_constructTiers:function(a){for(var b=0,e=[],c=0;c<a.length;c++)for(var g=0;g<a[c].length;g++){var d=a[c][g],f=d.minimumQuantity;f!=b&&(b=f,e.push(d))}return e},_convertToLegacyFormat:function(c){var b=[];try{for(var e=0;e<c.length;e++){var d=c[e],f={quantity:d.minimumQuantity,quantityPickerPriceText:h.richContentHelper.toText(d.priceMessage),isUncompetitive:d.hidden,isLowestAvailablePrice:d.lowestAvailablePrice}; d.savingsMessage&&(f.savingsMessage=h.richContentHelper.toText(d.savingsMessage));d.availabilityMessage&&(f.availabilityMessage=h.richContentHelper.toText(d.availabilityMessage));d.program&&(f.program=d.program);d.buyingInBulk&&"undefined"!==typeof d.buyingInBulk.fragments&&1<=d.buyingInBulk.fragments.length&&(f.buyingInBulkLink=h.richContentHelper.toText(d.buyingInBulk.fragments[0]),f.buyingInBulkMessage=h.richContentHelper.toText({fragments:d.buyingInBulk.fragments.slice(1)}));b.push(f)}}catch(k){throw a.registerCounter(g.COUNTER_METRIC.AAPI_QPT_CONVERSION_ERROR), k;}return b},_extractSingleQuantityData:function(c,b){var e={isAvailable:!1,buyingOptionId:"",price:""},d;try{d=this._firstBuyingOptionByBuyboxIdWithFallback(c,b)}catch(f){return a.registerCounter(g.COUNTER_METRIC.AAPI_SINGLE_QUANTITY_BO_NOT_FOUND),e}try{return{isAvailable:"OUT_OF_STOCK"!==d.availability.entity.type,buyingOptionId:d.availability.resource.url,price:d.price.entity.priceToPay.moneyValueOrRange.value.displayString}}catch(f){return a.registerCounter(g.COUNTER_METRIC.AAPI_SINGLE_QUANTITY_EXTRACTION_FAILED), e}},_getSingleQuantityData:function(a){var b=this;b._quantityDataCache.get({asin:a.asin,merchantId:a.merchantId,quantity:a.quantity},function(e){a.success(b._extractSingleQuantityData(e,a.currentBuyBoxId))},a.error)}}),l=d.createClass({init:function(a){this._errorMessage=a},getQuantityPricingTable:function(a){a.error&&a.error(this._errorMessage)},refreshCheck:function(a){a.error&&a.error(this._errorMessage)}}),n;return{getInstance:function(){if("undefined"!==typeof n)return n;var c=d.state(g.AJAX_PARAMS_STATE_KEY); "undefined"===typeof c&&(a.registerWidgetBodyBegin(g.METRIC_SCOPE_NAME.AUI_STATE_PARSING),d.state.parse(),a.registerWidgetLoaded(g.METRIC_SCOPE_NAME.AUI_STATE_PARSING),c=d.state(g.AJAX_PARAMS_STATE_KEY));if("undefined"!==typeof c){c.priceFormatConfig=c;c.clientId="dpx";try{n=new m(c)}catch(b){a.registerCounter(g.COUNTER_METRIC.AAPI_DATA_MGR_INIT_FAILED),n=new l(g.ERROR.AAPI_DATA_MGR_INIT_FAILED)}}else return a.registerCounter(g.COUNTER_METRIC.MISSING_AJAX_PARAMS),new l(g.ERROR.MISSING_AJAX_PARAMS); return n}}});"use strict";p.when("A").register("abPricingFfqp_helpers",function(d){var f=d.createClass({_listeners:{},addListeners:function(d,a,c){this._listeners.hasOwnProperty(d)||(this._listeners[d]=[]);this._listeners[d].push({success:a,error:c})},triggerSuccess:function(d,a){this._triggerListeners(d,"success",a)},triggerError:function(d,a){this._triggerListeners(d,"error",a)},_triggerListeners:function(d,a,c){if(this._listeners.hasOwnProperty(d))for(d=this._listeners[d];0<d.length;){var f=d.pop(); if(f[a])f[a](c)}}});return{AsyncCache:d.createClass({_requestStatus:{IN_PROGRESS:1,READY:2,ERROR:3},_status:{},_cache:{},init:function(d){this._eventHandler=new f;this._loader=d.loader;this._keyGenerator=d.keyGenerator},_getKey:function(d){return this._keyGenerator?this._keyGenerator(d):d},get:function(d,a,c){var f=this._getKey(d);this._status[f]===this._requestStatus.READY?a(this._cache[f]):(this._eventHandler.addListeners(f,a,c),this._load(d,f))},_load:function(d,a){var c=this;c._status[a]!==c._requestStatus.IN_PROGRESS&& (c._status[a]=c._requestStatus.IN_PROGRESS,c._loader(d,function(d){c._cache[a]=d;c._status[a]=c._requestStatus.READY;c._eventHandler.triggerSuccess(a,d)},function(d){c._status[a]=c._requestStatus.ERROR;c._eventHandler.triggerError(a,d)}))}}),richContentHelper:{toText:function a(c){if(c.money)return c.money.displayString;if(c.text)return c.text;if(c.link)return a(c.link.content);if(c.fragments){for(var d=[],f=0;f<c.fragments.length;f++)d.push(a(c.fragments[f]));return d.join("")}return c.semanticContent? a(c.semanticContent.content):""}}}});"use strict";p.when("jQuery","A","a-dropdown","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager","abPricingFfqp_metrics","abPricingFfqp_constants").register("abPricingFfqp_quantityPickerLogic",function(d,f,g,a,c,h,m,l){function n(a){return a.prop("selectedIndex")+1===a.prop("length")}function q(a,b){if(!c.dropdownContainsQuantity(a,b)){var d=document.createElement("option");d.value=b;d.text=b.toString();a.append(d)}}function b(a){this.id=a.id;this.buyBoxId= a.buyBoxId;this.buyingOptionStereotype=a.buyingOptionStereotype?a.buyingOptionStereotype:"";this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;this.predefinedQuantitiesDropdownSelector=a.predefinedQuantitiesDropdownSelector;this.predefinedQuantitiesDropdownContainerSelector=a.predefinedQuantitiesDropdownContainerSelector;this.freeQuantityTextInputSelector=a.freeQuantityTextInputSelector;this.freeQuantityTextInputOuterSelector= a.freeQuantityTextInputOuterSelector;this.updateButtonSelector=a.updateButtonSelector;this.addToCartButtonSelector=a.addToCartButtonSelector;this.buyingOptionPosition=a.buyingOptionPosition;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector;this.splitOfferLinkSelector=a.splitOfferLinkSelector;this.splitOfferSectionSelector=a.splitOfferSectionSelector;this.amazonDevicesLinkEnabled=a.amazonDevicesLinkEnabled;this.buyingInBulkBaseUrl=a.buyingInBulkBaseUrl;this.initializeQuantityHiddenField(); this.wireUpSelectorBasedEvents()}b.prototype.wireUpSelectorBasedEvents=function(){var a=this,b=d(this.predefinedQuantitiesDropdownSelector);f.on("a:dropdown:"+b[0].id+":select",function(b){a.handleDropdownOptionClicked(b.value)});f.on(h.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,c,d){a.handleQuantityChangedOnOtherBuyBox(b,c,d)});f.on(h.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});f.on(h.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()})}; b.prototype.wireUpReferenceBasedEvents=function(){var a=this,b=d(this.freeQuantityTextInputSelector),c=d(this.updateButtonSelector);b.keydown(function(b){a.handleTextInputKeyDown(b)});b.keyup(function(b){a.handleTextInputKeyUp(b)});b.focus(function(){a.handleTextInputFocused()});c.click(function(){a.handleButtonClick()})};b.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();n(d(this.predefinedQuantitiesDropdownSelector))?this.switchToFreeQuantityUI():this.switchToPredefinedQuantitiesUI(); this.enableUI();this.lastSelectedQuantity=this.getCurrentQuantity();h.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};b.prototype.getCurrentQuantity=function(){if(this.isTextInputVisible()){var a=d(this.freeQuantityTextInputSelector);return parseInt(a.val())}return this.isDropdownVisible()?(a=d(this.predefinedQuantitiesDropdownSelector),parseInt(a.find(":selected").val())):r};b.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&&this.disableUI()};b.prototype.handleQuantityRefreshCheckFinished= function(){this.doesDOMExist()&&this.enableUI()};b.prototype.handleDropdownOptionClicked=function(a){var b=d(this.predefinedQuantitiesDropdownSelector);n(b)?(a=d(this.freeQuantityTextInputSelector),a.val(this.lastSelectedQuantity.toString()),this.switchToFreeQuantityUI(),a.focus(),c.incrementMetricByOne("freeFormQtyPickerMaxQtySelected")):(this.lastSelectedQuantity=a=parseInt(a),this.updateQuantityHiddenField(a),h.singleton.notifyQuantityChanged(a,{senderId:this.id,activeBuyBoxId:this.buyBoxId,selectedBuyingOption:this.buyingOptionStereotype}))}; b.prototype.handleTextInputFocused=function(){d(this.freeQuantityTextInputSelector).select()};b.prototype.handleTextInputKeyUp=function(b){13!==b.keyCode&&a(this.updateButtonSelector).show()};b.prototype.handleTextInputKeyDown=function(a){13===a.keyCode&&(a.preventDefault(),d(this.updateButtonSelector).click(),this._findWithinPickerAccordionRow(this.addToCartButtonSelector).focus())};b.prototype.clampQuantity=function(a){999<a&&(a=999);this.leastMinimumOrderQuantity!==r&&a<this.leastMinimumOrderQuantity&& (a=this.leastMinimumOrderQuantity);return a};b.prototype.handleButtonClick=function(){var b=d(this.predefinedQuantitiesDropdownSelector),f=g.getSelect(b[0]),k=d(this.freeQuantityTextInputSelector),m=k.val(),l=parseInt,n=m.match(/[1-9][0-9]*/),l=l(null===n?"1":n[0]),l=this.clampQuantity(l);c.dropdownContainsQuantity(b,l)?(this.switchToPredefinedQuantitiesUI(),f.setValue(l.toString()),this.handleDropdownOptionClicked(l)):(b=l.toString(),b!==m&&k.val(b),a(this.updateButtonSelector).hide(),this.updateQuantityHiddenField(l), h.singleton.notifyQuantityChanged(l,{senderId:this.id,activeBuyBoxId:this.buyBoxId,selectedBuyingOption:this.buyingOptionStereotype}))};b.prototype.doesDOMExist=function(){return 0<d(this.predefinedQuantitiesDropdownSelector).length&&0<d(this.freeQuantityTextInputSelector).length&&0<d(this.updateButtonSelector).length};b.prototype.handleQuantityChangedOnOtherBuyBox=function(a,b,c){if(this.doesDOMExist()){a!==this.id&&this.getCurrentQuantity()!==b&&this._updateSelectedQuantity(b);var d=this;h.singleton.buyboxRefreshCheck({newQuantity:b, activeBuyBoxId:c.activeBuyBoxId,selectedBuyingOption:c.selectedBuyingOption,currentBuyBoxId:this.buyBoxId,callback:function(a){d.updateLimitedAvailabilityMessageVisibility(a.hasAvailability)}})}};b.prototype._updateSelectedQuantity=function(a){var b=d(this.predefinedQuantitiesDropdownSelector),f=g.getSelect(b[0]);c.dropdownContainsQuantity(b,a)?(f.setValue(a.toString()),this.lastSelectedQuantity=a,this.switchToPredefinedQuantitiesUI()):(d(this.freeQuantityTextInputSelector).val(a.toString()),this.switchToFreeQuantityUI()); this.updateQuantityHiddenField(a)};b.prototype.showDropdown=function(){d(this.predefinedQuantitiesDropdownContainerSelector).removeClass("aok-hidden")};b.prototype.hideDropdown=function(){d(this.predefinedQuantitiesDropdownContainerSelector).addClass("aok-hidden")};b.prototype.isDropdownVisible=function(){return!d(this.predefinedQuantitiesDropdownContainerSelector).hasClass("aok-hidden")};b.prototype.showTextInput=function(){"mobile"===c.getPageState().platform?d(this.freeQuantityTextInputOuterSelector).removeClass("aok-hidden"): d(this.freeQuantityTextInputSelector).removeClass("aok-hidden")};b.prototype.hideTextInput=function(){"mobile"===c.getPageState().platform?d(this.freeQuantityTextInputOuterSelector).addClass("aok-hidden"):d(this.freeQuantityTextInputSelector).addClass("aok-hidden")};b.prototype.isTextInputVisible=function(){return"mobile"===c.getPageState().platform?!d(this.freeQuantityTextInputOuterSelector).hasClass("aok-hidden"):!d(this.freeQuantityTextInputSelector).hasClass("aok-hidden")};b.prototype.disableTextInput= function(){if("mobile"===c.getPageState().platform){var a=d(this.freeQuantityTextInputSelector),b=d(this.freeQuantityTextInputOuterSelector);a.prop("disabled","disabled");b.addClass("a-form-disabled")}else a=d(this.freeQuantityTextInputSelector),a.prop("disabled","disabled"),a.addClass("a-form-disabled")};b.prototype.enableTextInput=function(){if("mobile"===c.getPageState().platform){var a=d(this.freeQuantityTextInputSelector),b=d(this.freeQuantityTextInputOuterSelector);a.removeProp("disabled"); b.removeClass("a-form-disabled")}else a=d(this.freeQuantityTextInputSelector),a.removeProp("disabled"),a.removeClass("a-form-disabled")};b.prototype.switchToFreeQuantityUI=function(){this.hideDropdown();this.showTextInput();a(this.updateButtonSelector).hide()};b.prototype.switchToPredefinedQuantitiesUI=function(){this.showDropdown();this.hideTextInput();a(this.updateButtonSelector).hide()};b.prototype.disableUI=function(){var b=g.getSelect(this.predefinedQuantitiesDropdownSelector),c=a(this.updateButtonSelector); b.update({status:"disabled"});this.disableTextInput();c.disable()};b.prototype.enableUI=function(){var b=g.getSelect(this.predefinedQuantitiesDropdownSelector),c=a(this.updateButtonSelector);b.update({status:"normal"});this.enableTextInput();c.enable()};b.prototype._isMobileQuantityHiddenFieldSelector=function(){return"string"===typeof this.quantityHiddenFieldSelector&&-1<this.quantityHiddenFieldSelector.indexOf("select#mobileQuantityDropDown")};b.prototype._mobileQuantityHiddenFieldSelector=function(){return this.quantityHiddenFieldSelector.replace("input#quantity", "select#mobileQuantityDropDown")};b.prototype.updateQuantityHiddenField=function(a){var b=this._findWithinPickerAccordionRow(this.quantityHiddenFieldSelector).first();b.is("select")?(q(b,a),g.getSelect(b).val(a)):b.val(a.toString());f.trigger(l.ADD_TO_CART_QUANTITY_CHANGE_EVENT,{nativeItemNode:b[0],value:a.toString()});"mobile"!==c.getPageState().platform||this._isMobileQuantityHiddenFieldSelector()||(b=this._findWithinPickerAccordionRow(this._mobileQuantityHiddenFieldSelector()))&&b.is("select")&& (q(b,a),g.getSelect(b).val(a),b.val(a.toString()))};b.prototype.updateLimitedAvailabilityMessageVisibility=function(b){var c=this._findWithinPickerAccordionRow(this.addToCartButtonSelector).closest(".a-button"),f=a(c),c=this._findWithinPickerAccordionRow(this.splitOfferSectionSelector);b?(d(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),f.enable(),c.addClass("aok-hidden")):(d(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden"),f.disable(),b=this.getCurrentQuantity(), f=this.amazonDevicesLinkEnabled?this.buyingInBulkBaseUrl:h.singleton.getLimitedAvailabilityUrl(b),this._findWithinPickerAccordionRow(this.splitOfferLinkSelector).attr("href",f),1<b?(m.registerCounter(l.COUNTER_METRIC.SPLIT_OFFER_LINK_DISPLAYED),c.removeClass("aok-hidden")):c.addClass("aok-hidden"))};b.prototype._findWithinPickerAccordionRow=function(a){return c.findWithinPickerAccordionRow(this.id,a)};b.prototype.initializeQuantityHiddenField=function(){var a=h.singleton.currentQuantity,b=parseInt(this.leastMinimumOrderQuantity); b&&b>a&&(a=b);this.updateQuantityHiddenField(a)};return{QuantityPickerLogic:b}});"use strict";p.when("jQuery","A","a-dropdown","a-modal","a-button","abPricingFfqp_utils","abPricingFfqp_quantityManager","abPricingFfqp_metrics","abPricingFfqp_constants").register("abPricingFfqpV2_quantityPickerLogic",function(d,k,g,a,c,h,m,l,n){function q(a,b){if(!h.dropdownContainsQuantity(a,b)){var c=document.createElement("option");c.value=b;c.text=b.toString();a.append(c)}}function b(a){this.id=a.id;this.buyBoxId= a.buyBoxId;this.buyingOptionStereotype=a.buyingOptionStereotype?a.buyingOptionStereotype:"";this.quantityHiddenFieldSelector=a.quantityHiddenFieldSelector;this.leastMinimumOrderQuantity=a.leastMinimumOrderQuantity;this.quantityPickerSelector=a.quantityPickerSelector;this.quantityDiscountTableSelector=this.quantityPickerSelector+" .quantity-discount-table";this.quantityTextInputLabelSelector=this.quantityPickerSelector+" .quantity-text-input-label";this.buyboxAccordionContainerSelector=a.buyboxAccordionContainerSelector; this.loadMoreMessage=a.loadMoreMessage;this.fetchTheBestPricesMessage=a.fetchTheBestPricesMessage;this.qdtErrorMessage=a.qdtErrorMessage;this.includeRfqdLinkInNewPicker=a.includeRfqdLinkInNewPicker;this.requestForQuantityDiscountModalSelector=a.requestForQuantityDiscountModalSelector;this.requestForQuantityDiscountMessage=a.requestForQuantityDiscountMessage;this.bbtLinkSelector=a.bbtLinkSelector;this.addToCartButtonSelector=a.addToCartButtonSelector;this.limitedAvailabilityMessageSelector=a.limitedAvailabilityMessageSelector; this.fetchQuantityDiscountTableCompleted=this.fetchQuantityDiscountTableStarted=this.isLoadMoreButtonClicked=!1;this.quantityTextInputSelector=this.quantityPickerSelector;this.quantityTextInputSelector+=" .quantity-text-input-with-label";this.loadMoreButtonForUncompetitiveTiersPresence=this.hasError=!1;this.quantityPricingTableSummaryEnabled=a.quantityPricingTableSummaryEnabled;this.qdsForLockedMerchantEnabled=a.qdsForLockedMerchantEnabled;this.isAODLinkEnabled=!0===a.isAODLinkEnabled;this.quantityPickerUnavailabilityMessage= a.quantityPickerUnavailabilityMessage;this.quantityPickerUnavailabilityLink=a.quantityPickerUnavailabilityLink;this.splitOfferLinkSelector=a.splitOfferLinkSelector;this.splitOfferSectionSelector=a.splitOfferSectionSelector;this.amazonDevicesLinkEnabled=a.amazonDevicesLinkEnabled;this.buyingInBulkBaseUrl=a.buyingInBulkBaseUrl;this.initializeQuantityAvailabilityVariables();this.wireUpSelectorBasedEvents();this.initializeQuantityHiddenField()}var e=h.PACKAGE_PREFIX+".PriceTableLoadError",p=h.PACKAGE_PREFIX+ ".QuantityPriceTableRender",u=h.PACKAGE_PREFIX+".QuantityPriceTableView",v=h.PACKAGE_PREFIX+".QuantityPriceTableRenderWithLockedMerchant",w=h.PACKAGE_PREFIX+".QuantityPriceTableViewWithLockedMerchant",x=h.PACKAGE_PREFIX+".QuantityPriceTableRenderWithUncompetitiveTiers",y=h.PACKAGE_PREFIX+".QuantityPriceTableViewWithUncompetitiveTiers",z=h.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClicked",A=h.PACKAGE_PREFIX+".QuantityPriceTableLoadMoreButtonClickedWithUncompetitiveTiers",B=h.PACKAGE_PREFIX+ ".QuantityPriceTableBBTLinkRender",C=h.PACKAGE_PREFIX+".QuantityPriceTableBBTLinkClick",D=h.PACKAGE_PREFIX+".QuantityPriceTableQuantityUnavailableLinkRender",E=h.PACKAGE_PREFIX+".QuantityPriceTableQuantityUnavailableLinkClick",F=h.PACKAGE_PREFIX+".QuantityPriceTableRFQDBBTLinkClick",G=h.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageRender",H=h.PACKAGE_PREFIX+".QuantityPriceTableAvailabilityMessageView";b.prototype.initializeQuantityAvailabilityVariables=function(){this.hasAvailability=!0}; b.prototype.wireUpSelectorBasedEvents=function(){var a=this;k.on(m.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_STARTED,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableStarted()});k.on(m.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_COMPLETED,function(b,c){c&&c!==a.id||a.handleFetchQuantityDiscountTableCompleted(b)});k.on(m.EVENT__FETCH_QUANTITY_DISCOUNT_TABLE_ERROR,function(b){b&&b!==a.id||a.handleFetchQuantityDiscountTableError()});k.on(m.EVENT__BUY_BOX_QUANTITY_CHANGED,function(b,c,d){a.handleQuantityChangedOnOtherBuyBox(b, c,d)});k.on(m.EVENT__QUANTITY_REFRESH_CHECK_STARTED,function(){a.handleQuantityRefreshCheckStarted()});k.on(m.EVENT__QUANTITY_REFRESH_CHECK_FINISHED,function(){a.handleQuantityRefreshCheckFinished()})};b.prototype.initializeQuantityHiddenField=function(){var a=m.singleton.currentQuantity,b=parseInt(this.leastMinimumOrderQuantity);b&&b>a&&(a=b);this.updateQuantityHiddenField(a)};b.prototype.handleFetchQuantityDiscountTableCompleted=function(a){this.wireUpQuantityDiscountTableData(a);this.generateQuantityDiscountTable(); this.fetchQuantityDiscountTableCompleted=!0};b.prototype.handleFetchQuantityDiscountTableStarted=function(){this.fetchQuantityDiscountTableStarted=!0};b.prototype.wireUpQuantityDiscountTableData=function(a){this.priceTiers=a;this.buildQptRenderMetrics();this.buildQptForLockedMerchantMetrics(v);this.buildQptUncompetitiveTiersMetrics(x);this.buildAvailabilityMessageMetrics(G)};b.prototype.handleFetchQuantityDiscountTableError=function(){h.incrementMetricByOne(e);this.fetchQuantityDiscountTableStarted= !1;this.hasError=!0;this.generateQuantityDiscountTable()};b.prototype.wireUpReferenceBasedEvents=function(){var a=this,b=d(this.quantityTextInputSelector),c=d(this.quantityTextInputLabelSelector);c.click(function(){b.focus();b.click()});b.focus(function(){c.hide();"1"===this.value&&(this.value="");a.showQuantityDiscountTable()});b.blur(function(){""===this.value&&(this.value=m.singleton.currentQuantity);a.updateQuantityAndHideQuantityDiscountTable();c.show()});b.live("keypress input",function(b){a.isValidQuantityTextInputKeyCode(b); this.value=this.value.replace(/[^0-9]/g,"")});b.live("input",k.throttle(function(b){a.quantityAvailabilityCheckStart()},500));b.live("keydown",function(b){a.isValidQuantityTextPressKeyCode(b)});b.live("click change paste keyup",function(){a.clampQuantity(b.val());a.generateQuantityDiscountTable()})};b.prototype.quantityAvailabilityCheckStart=function(){this.initializeQuantityAvailabilityVariables();var a=this.getCurrentQuantity(),b=this;m.singleton.notifyQuantityTyped(a,{currentBuyBoxId:this.buyBoxId, activeBuyBoxId:this.buyBoxId,selectedBuyingOption:this.buyingOptionStereotype,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled,callback:function(c){a===b.getCurrentQuantity()&&b.updateLimitedAvailabilityMessageVisibility(c.hasAvailability)}})};b.prototype.attachToDOM=function(){this.wireUpReferenceBasedEvents();this.enableUI();m.singleton.leastMinimumOrderQuantity=this.leastMinimumOrderQuantity};b.prototype.isValidQuantityTextPressKeyCode=function(a){var b={left:37,up:38,right:39,down:40}, c=f.event?a.keyCode:a.which,d;for(d in b)b[d]===c&&a.preventDefault()};b.prototype.isValidQuantityTextInputKeyCode=function(a){var b=f.event?a.keyCode:a.which;8!==b&&46!==b&&(13===b?(this.updateQuantityAndHideQuantityDiscountTable(),a.preventDefault()):(b=String.fromCharCode(b),/\d/.test(b)||a.preventDefault()))};b.prototype.getCurrentQuantity=function(){var a=d(this.quantityTextInputSelector);return this.clampQuantity(a.val())};b.prototype.handleQuantityRefreshCheckStarted=function(){this.doesDOMExist()&& this.disableUI()};b.prototype.handleQuantityRefreshCheckFinished=function(){this.doesDOMExist()&&this.enableUI()};b.prototype.clampQuantity=function(a){var b=a;999<a&&(b=999);this.leastMinimumOrderQuantity!==r&&a<this.leastMinimumOrderQuantity&&(b=this.leastMinimumOrderQuantity);return b};b.prototype.doesDOMExist=function(){return 0<d(this.quantityTextInputSelector).length};b.prototype.handleQuantityChangedOnOtherBuyBox=function(a,b,c){if(this.doesDOMExist()){a!==this.id&&parseInt(this.getCurrentQuantity())!== b&&(d(this.quantityTextInputSelector).val(b),this.updateQuantityHiddenField(b));var e=this;m.singleton.buyboxRefreshCheck({newQuantity:b,activeBuyBoxId:c.activeBuyBoxId,selectedBuyingOption:c.selectedBuyingOption,currentBuyBoxId:this.buyBoxId,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled,callback:function(a){e.updateLimitedAvailabilityMessageVisibility(a.hasAvailability)}})}};b.prototype.showQuantityDiscountTable=function(){this.buildQptViewMetrics();this.fetchQuantityDiscountTableCompleted&& (this.buildQptForLockedMerchantMetrics(w),this.buildQptUncompetitiveTiersMetrics(y,this.getStartIndexOfQuantityDiscountTierTable(),3),this.buildAvailabilityMessageMetrics(H));var a=h.findAccordionRow(this.id);0<a.length&&(a.get(0).setAttribute("style","overflow:visible"),a=a.find(".a-accordion-inner.accordion-row-content"),0<a.length&&a.get(0).setAttribute("style","overflow:visible"));a=d(this.buyboxAccordionContainerSelector);0<a.length&&(a.get(0).setAttribute("style","overflow:visible"),a=a.find(".a-accordion-inner"), 0<a.length&&a.get(0).setAttribute("style","overflow:visible"));d(this.quantityPickerSelector).addClass("open")};b.prototype.hideQuantityDiscountTable=function(){d(this.quantityPickerSelector).removeClass("open")};b.prototype.updateQuantityAndHideQuantityDiscountTable=function(){var a=d(this.quantityDiscountTableSelector),b=d(this.quantityTextInputSelector),c=this.clampQuantity(b.val());b.val(c);this.updateQuantityHiddenField(c);m.singleton.notifyQuantityChanged(c,{senderId:this.id,activeBuyBoxId:this.buyBoxId, selectedBuyingOption:this.buyingOptionStereotype,qdsForLockedMerchantEnabled:this.qdsForLockedMerchantEnabled});this.isLoadMoreButtonClicked=!1;this.hideQuantityDiscountTable();a.empty()};b.prototype.disableUI=function(){var a=d(this.quantityTextInputSelector),b=d(this.quantityDiscountTableSelector);a.attr("disabled",!0);a.addClass("quantity-text-input-disabled");b.attr("disabled",!0)};b.prototype.enableUI=function(){var a=d(this.quantityTextInputSelector),b=d(this.quantityDiscountTableSelector); a.attr("disabled",!1);a.removeClass("quantity-text-input-disabled");b.attr("disabled",!1);this.hideQuantityDiscountTable()};b.prototype._isMobileQuantityHiddenFieldSelector=function(){return"string"===typeof this.quantityHiddenFieldSelector&&-1<this.quantityHiddenFieldSelector.indexOf("select#mobileQuantityDropDown")};b.prototype._mobileQuantityHiddenFieldSelector=function(){return this.quantityHiddenFieldSelector.replace("input#quantity","select#mobileQuantityDropDown")};b.prototype.updateQuantityHiddenField= function(a){var b=this._findWithinPickerAccordionRow(this.quantityHiddenFieldSelector).first();b.is("select")&&(q(b,a),g.getSelect(b).val(a));b.val(a.toString());k.trigger(n.ADD_TO_CART_QUANTITY_CHANGE_EVENT,{nativeItemNode:b[0],value:a.toString()});"mobile"!==h.getPageState().platform||this._isMobileQuantityHiddenFieldSelector()||(b=this._findWithinPickerAccordionRow(this._mobileQuantityHiddenFieldSelector()))&&b.is("select")&&(q(b,a),g.getSelect(b).val(a),b.val(a.toString()))};b.prototype.generateVisibleTiersList= function(a,b){for(var c=[],d=0,e=!1;b<this.priceTiers.length&&(this.isLoadMoreButtonClicked||3>d);){var f=this.priceTiers[b],g=!this.shouldHideFirstTier()&&0===d,h=f.isLowestAvailablePrice||e||2!=d;if(this.isLoadMoreButtonClicked||g||!f.isUncompetitive&&h)c.push({quantity:Math.max(a,f.quantity),savingsMessage:f.savingsMessage,availabilityMessage:f.availabilityMessage,quantityPickerPriceText:f.quantityPickerPriceText,isDiscountUnlocked:0===d?0===b&&"BUSINESS_VOLUME_AWARE_PRICING"===f.program:!1,isFirstTier:g}), e=e||f.isLowestAvailablePrice,d++;b++}return c};b.prototype.findStartIndexOfQuantityDiscountTierTable=function(a){for(var b=0,c=this.priceTiers.length-1;b<=c;){var d=parseInt((b+c)/2),e;e=this.priceTiers[d].quantity;e=0===e.length?0:parseInt(e);if(e===a)return d;e>a?c=d-1:b=d+1}return Math.max(0,c)};b.prototype.getStartIndexOfQuantityDiscountTierTable=function(){var a=this.getCurrentQuantity(),a=this.findStartIndexOfQuantityDiscountTierTable(a);return this.shouldHideFirstTier()&&1<this.priceTiers.length? a+1:a};b.prototype.shouldHideFirstTier=function(){var a=m.singleton.currentQuantity,b=d(this.quantityTextInputSelector);return!this.isAvailabilityMessagePresent()&&1===a&&""===b.val()};b.prototype.generateQuantityDiscountTable=function(){this.cleanOutQuantityDiscountTable();var a=d(this.quantityDiscountTableSelector);this.hasError?a.append(this.generateSingleTierDiscountTableUnorderedList(this.generateQdtErrorMessage())):this.hasAvailability?this.priceTiers===r?a.append(this.generateFetchInProcessTableUnorderedList()): 0===this.priceTiers.length?a.append(this.generateSingleTierDiscountTableUnorderedList()):a.append(this.generateQuantityDiscountTableUnorderedList()):a.append(this.generateQuantityUnavailableTableUnorderedList())};b.prototype.cleanOutQuantityDiscountTable=function(){d(this.quantityDiscountTableSelector).empty()};b.prototype.areUncompetitiveTiersPresent=function(a,b){var c=!1;if("undefined"!==typeof this.priceTiers)for("undefined"===typeof a&&(a=0),b="undefined"===typeof b?this.priceTiers.length:Math.min(a+ b,this.priceTiers.length),a+=1;a<b;a++)if(this.priceTiers[a].isUncompetitive){c=!0;break}return c};b.prototype.isAvailabilityMessagePresent=function(){return"undefined"!==typeof this.priceTiers&&0<this.priceTiers.length&&"undefined"!==typeof this.priceTiers[0].availabilityMessage};b.prototype.showLoadMoreButton=function(a){this.loadMoreButtonForUncompetitiveTiersPresence=this.areUncompetitiveTiersPresent(a);return!this.isLoadMoreButtonClicked&&(3<this.priceTiers.length-a||this.loadMoreButtonForUncompetitiveTiersPresence)}; b.prototype.showBuyingInBulkLink=function(a){return"undefined"!==typeof this.priceTiers[a].buyingInBulkLink};b.prototype.generateQuantityDiscountTableUnorderedList=function(){var a=this.getCurrentQuantity(),b=this.getStartIndexOfQuantityDiscountTierTable(),a=this.generateVisibleTiersList(a,b),c=document.createElement("ul");c.setAttribute("class","qdt-ul");for(var e=d(c),f=0;f<a.length;f++)e.append(this.generateQuantityDiscountTierOption(a[f]));this.showLoadMoreButton(b)?e.append(this.generateLoadMoreOption()): !this.showBuyingInBulkLink(b)||!0!==this.includeRfqdLinkInNewPicker&&"true"!==this.includeRfqdLinkInNewPicker?!0!==this.includeRfqdLinkInNewPicker&&"true"!==this.includeRfqdLinkInNewPicker||e.append(this.generateRequestForQuantityDiscountOption()):e.append(this.generateBuyingInBulkOption(b));return c};b.prototype.generateSingleTierDiscountTableUnorderedList=function(a){var b=this.getCurrentQuantity(),b=this.generateSingleTierQuantityList(b),c=document.createElement("ul");c.setAttribute("class","qdt-ul"); for(var e=d(c),f=0;f<b.length;f++)e.append(this.generateQuantityDiscountTierOption(b[f]));a&&e.append(a);return c};b.prototype.generateQuantityUnavailableTableUnorderedList=function(){var a=document.createElement("ul");a.setAttribute("class","qdt-ul");d(a).append(this.generateQuantityUnavailableOption());return a};b.prototype.generateSingleTierQuantityList=function(a){var b=[];b.push({quantity:Math.max(a,1),savingsMessage:null,availabilityMessage:null,quantityPickerPriceText:"",isDiscountUnlocked:!1, isFirstTier:!0});return b};b.prototype.generateFetchInProcessTableUnorderedList=function(){var a=document.createElement("ul");a.setAttribute("class","qdt-ul");d(a).append(this.generateFetchInProcessOption());return a};b.prototype._removeINRSymbol=function(a){a=a.split("\x3e");return a[a.length-1]};b.prototype._populateOptionPriceContent=function(a,b){if("string"===typeof a.quantityPickerPriceText&&-1!==a.quantityPickerPriceText.search("currencyINR")){var c=document.createElement("span");c.setAttribute("class", "currencyINR");c.textContent=" ";b.appendChild(c);a=this._removeINRSymbol(a.quantityPickerPriceText);b.appendChild(document.createTextNode(a))}else b.textContent=a.quantityPickerPriceText};b.prototype.generateQuantityDiscountTierOption=function(a){var b=this,c=document.createElement("li"),e=document.createElement("div"),d=document.createElement("div"),f=document.createElement("div");a.isFirstTier?(d.textContent=a.quantity,c.setAttribute("class","qdt-dropdown-item qdt-active")):(d.textContent=a.quantity+ "+",c.setAttribute("class","qdt-dropdown-item"));b._populateOptionPriceContent(a,f);d.setAttribute("class","option-tier");f.setAttribute("class","option-price");a.availabilityMessage!=r?this.generateTierWithAvailabilityMessageContent(e,d,f,a.availabilityMessage):a.savingsMessage!=r?this.generateTierWithSavingsMessageContent(e,d,f,a):(e.setAttribute("class","qdt-dropdown-option-no-saving-message"),e.appendChild(d),e.appendChild(f));c.appendChild(e);c.addEventListener("mousedown",function(){b.handleQuantityDiscountTableOptionClicked(a.quantity)}); return c};b.prototype.generateTierWithAvailabilityMessageContent=function(a,b,c,e){var d=document.createElement("div");d.textContent=e;d.setAttribute("class","option-availability-message");this.generateTierWithMessageContent(a,b,c,d)};b.prototype.generateTierWithSavingsMessageContent=function(a,b,c,e){var f=document.createElement("div");f.textContent=e.savingsMessage;e.isDiscountUnlocked?(e=document.createElement("div"),e.setAttribute("class","option-unlocked-saving-message-icon"),d(f).prepend(e), f.setAttribute("class","option-unlocked-saving-message")):f.setAttribute("class","a-color-tertiary option-saving-message");this.generateTierWithMessageContent(a,b,c,f)};b.prototype.generateTierWithMessageContent=function(a,b,c,e){var d=document.createElement("div");a.setAttribute("class","qdt-dropdown-option-regular");d.setAttribute("class","option-price-and-message");d.appendChild(c);d.appendChild(e);a.appendChild(b);a.appendChild(d)};b.prototype.generateLoadMoreOption=function(){var a=this,b=document.createElement("li"), c=document.createElement("div");c.textContent=this.loadMoreMessage;b.setAttribute("class","qdt-dropdown-item");c.setAttribute("class","qdt-dropdown-option-load-more");b.setAttribute("id","qdt-dropdown-load-more");b.appendChild(c);b.addEventListener("mousedown",function(b){a.handleLoadMoreOptionClicked(b)});return b};b.prototype.generateRequestForQuantityDiscountOption=function(){var a=this,b=document.createElement("a");b.textContent=this.requestForQuantityDiscountMessage;b.setAttribute("class","a-link-normal qdt-dropdown-request-for-quantity-discount"); b.addEventListener("mousedown",function(b){a.handleRequestForQuantityDiscountOptionClicked(b)});return this.generateLinkOption(b)};b.prototype.generateBuyingInBulkOption=function(a){var b=this;a={container:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk"},link:{element:document.createElement("a"),class:"a-link-normal qdt-dropdown-buying-in-bulk-link",text:b.priceTiers[a].buyingInBulkLink},message:{element:document.createElement("div"),class:"qdt-dropdown-buying-in-bulk-message", text:b.priceTiers[a].buyingInBulkMessage}};for(var c in a)a[c].element.setAttribute("class",a[c].class),"undefined"!==typeof a[c].text&&(a[c].element.textContent=a[c].text);a.container.element.appendChild(a.link.element);a.container.element.appendChild(a.message.element);a.link.element.addEventListener("mousedown",function(a){b.handleBuyingInBulkOptionClicked(b.bbtLinkSelector,C,a)});l.registerCounter(B);return this.generateLinkOption(a.container.element)};b.prototype.generateQuantityUnavailableOption= function(){var a=this,b=document.createElement("div"),c=document.createElement("div");c.innerHTML=this.quantityPickerUnavailabilityMessage;b.setAttribute("class","a-link-normal qdt-dropdown-quantity-unavailable");c.setAttribute("class","qdt-dropdown-quantity-unavailable-message");b.appendChild(c);0<this._findWithinPickerAccordionRow(this.splitOfferSectionSelector).length&&(c=document.createElement("a"),c.textContent=this.quantityPickerUnavailabilityLink,c.setAttribute("class","a-link-normal qdt-dropdown-quantity-unavailable-link"), b.appendChild(c),c.addEventListener("mousedown",function(b){a.handleQuantityUnavailableOptionClicked(b)}));l.registerCounter(D);return this.generateLinkOption(b)};b.prototype.generateLinkOption=function(a){var b=document.createElement("li"),c=document.createElement("div");b.setAttribute("class","qdt-dropdown-item qdt-inactive");c.setAttribute("class","qdt-dropdown-option-link");c.appendChild(a);b.appendChild(c);return b};b.prototype.generateFetchInProcessOption=function(){var a=document.createElement("li"), b=document.createElement("div"),c=document.createElement("div"),e=document.createElement("div"),d=document.createElement("img");d.src="https://m.media-amazon.com/images/G/01/AmazonBusiness/vapLoading3._CB1556651073_.gif";c.textContent=this.fetchTheBestPricesMessage;d.setAttribute("class","fetching-in-progress-img");a.setAttribute("class","qdt-dropdown-item qdt-inactive");b.setAttribute("class","qdt-dropdown-option-fetch-in-progress");e.appendChild(d);b.appendChild(e);b.appendChild(c);a.setAttribute("id", "qdt-dropdown-fetch-in-progress");a.appendChild(b);return a};b.prototype.generateQdtErrorMessage=function(){var a=document.createElement("li"),b=document.createElement("div");if(this.isAODLinkEnabled){var c=document.createElement("span");c.setAttribute("class","a-declarative");c.setAttribute("data-action","show-all-offers-display");c.setAttribute("data-show-all-offers-display","{}");c.innerHTML=this.qdtErrorMessage;b.appendChild(c)}else b.innerHTML=this.qdtErrorMessage;a.setAttribute("class","qdt-dropdown-item qdt-inactive"); b.setAttribute("class","qdt-dropdown-option-request-for-olp");a.setAttribute("id","qdt-dropdown-error-message");a.appendChild(b);var e=b.getElementsByTagName("a")[0];e.addEventListener("mousedown",function(a){e.click()});return a};b.prototype.handleLoadMoreOptionClicked=function(a){this.isLoadMoreButtonClicked=!0;this.buildLoadMoreButtonMetrics();this.generateQuantityDiscountTable();a.preventDefault()};b.prototype.handleQuantityDiscountTableOptionClicked=function(a){d(this.quantityTextInputSelector).val(a); this.updateQuantityAndHideQuantityDiscountTable();d(this.quantityTextInputLabelSelector).show()};b.prototype.handleRequestForQuantityDiscountOptionClicked=function(b){var c=d(this.requestForQuantityDiscountModalSelector).find(".a-declarative");(c=a.get(c))&&c.show();this.handleBuyingInBulkOptionClicked(this.requestForQuantityDiscountModalSelector,F,b)};b.prototype.handleBuyingInBulkOptionClicked=function(a,b,c){var e=this.getCurrentQuantity();if(this.amazonDevicesLinkEnabled)l.registerCounter(b), m.singleton.notifyBuyingInBulkOptionClicked(e),f.location.href=this.buyingInBulkBaseUrl;else if(a=document.querySelector(a+" .a-link-normal"))l.registerCounter(b),m.singleton.notifyBuyingInBulkOptionClicked(e),a.click();c.preventDefault()};b.prototype.handleQuantityUnavailableOptionClicked=function(a){l.registerCounter(E);var b=this.getCurrentQuantity();this.quantityUnavailableOptionClicked(b);a.preventDefault()};b.prototype.quantityUnavailableOptionClicked=function(a){a=this.amazonDevicesLinkEnabled? this.buyingInBulkBaseUrl:f.location.protocol+"//"+f.location.host+m.singleton.getLimitedAvailabilityUrl(a);f.location.href=a};b.prototype.updateLimitedAvailabilityMessageVisibility=function(a){this.hasAvailability=a;this.generateQuantityDiscountTable();this.updateBuyboxLimitedAvailabilityMessageVisibility()};b.prototype.updateBuyboxLimitedAvailabilityMessageVisibility=function(){var a=this._findWithinPickerAccordionRow(this.addToCartButtonSelector).closest(".a-button"),b=c(a),a=this._findWithinPickerAccordionRow(this.splitOfferSectionSelector); if(this.hasAvailability)d(this.limitedAvailabilityMessageSelector).addClass("aok-hidden"),b.enable(),a.addClass("aok-hidden");else{d(this.limitedAvailabilityMessageSelector).removeClass("aok-hidden");b.disable();var b=this.getCurrentQuantity(),e;e=this.amazonDevicesLinkEnabled?this.buyingInBulkBaseUrl:m.singleton.getLimitedAvailabilityUrl(b);this._findWithinPickerAccordionRow(this.splitOfferLinkSelector).attr("href",e);1<b?(l.registerCounter(n.COUNTER_METRIC.SPLIT_OFFER_LINK_DISPLAYED),a.removeClass("aok-hidden")): a.addClass("aok-hidden")}};b.prototype.buildQptRenderMetrics=function(){var a={};a.counter=p+(this.quantityPricingTableSummaryEnabled?".QPTS":"");l.register(a)};b.prototype.buildQptViewMetrics=function(){var a={};a.counter=u+(this.quantityPricingTableSummaryEnabled?".QPTS":"");l.register(a)};b.prototype.buildQptForLockedMerchantMetrics=function(a){this.qdsForLockedMerchantEnabled&&l.registerCounter(a)};b.prototype.buildQptUncompetitiveTiersMetrics=function(a,b,c){this.areUncompetitiveTiersPresent(b, c)&&l.registerCounter(a)};b.prototype.buildLoadMoreButtonMetrics=function(){this.loadMoreButtonForUncompetitiveTiersPresence?l.registerCounter(A):l.registerCounter(z)};b.prototype.buildAvailabilityMessageMetrics=function(a){this.isAvailabilityMessagePresent()&&l.registerCounter(a)};b.prototype._findWithinPickerAccordionRow=function(a){return h.findWithinPickerAccordionRow(this.id,a)};return{QuantityPickerLogicV2:b}});"use strict";p.when("jQuery","A","ready").execute(function(d,k){function g(a){f.ue!== r&&f.ue.count!==r&&f.ue.count(a,(f.ue.count(a)||0)+1)}function a(a,c,d){null===d&&(d="");var f=new RegExp("\\b("+c+"\x3d).*?(\x26|#|$)");if(0<=a.search(f))return a.replace(f,"$1"+d+"$2");a=a.replace(/[?#]$/,"");return a+(0<a.indexOf("?")?"\x26":"?")+c+"\x3d"+d}function c(){return k.state("ABPricingFreeFormQuantityPicker")}function h(a,c){return 0!==a.find('option[value\x3d"'+c.toString()+'"]').length}function m(a){return d("[id^\x3d"+a+"]").closest("[data-a-accordion-row-name]")}function l(a,c){a= m(a);return 0<a.length?a.find(c):d(c)}function n(){q||c()===r||(q=!0,p.register("abPricingFfqp_utils",function(){return{PACKAGE_PREFIX:"ABPricingFreeFormQuantityPicker",getPageState:c,incrementMetricByOne:g,replaceUrlParam:a,dropdownContainsQuantity:h,findAccordionRow:m,findWithinPickerAccordionRow:l}}))}var q=!1;n();p.register("abPricingFfqp_lazyInitializer",function(){return{tryInitialize:n}})})}); /* ******** */ (function(c){var d=window.AmazonUIPageJS||window.P,f=d._namespace||d.attributeErrors,a=f?f("ABPricingQuantityPricingTableSummaryAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,f){c.when("A","jQuery","abPricingFfqp_utils","abPricingFfqp_quantityManager","abPricingFfqp_metrics").execute(function(a,c,d,f,g){a.declarative("b2bhawks-quantity-pricing-table-summary-click","click",function(b){var a=b.data.selectedQuantity,e="",c=b.data.deviceType,d=b.data.bestTier, k=b.data.recommendedTier,h=b.data.asinDetailPageUrl;if(!b.data.tierSelected){d&&k?g.registerCounter("AB_QR_QPTS_RECOMMENDED_AND_BEST_TIER"):k?g.registerCounter("AB_QR_QPTS_RECOMMENDED_TIER"):d?g.registerCounter("AB_QR_QPTS_BEST_TIER"):g.registerCounter("AB_QR_QPTS_DEFAULT_TIER");if("mobile"===c||"mobileApp"===c)e+="#b2bhawks-quantity-pricing-table-summary";e={anchorToDiv:e};e.selectedBuyingOption="undefined"!==typeof b.data.selectedBuyingOption&&0<b.data.selectedBuyingOption.length?b.data.selectedBuyingOption: "RZvfv//HxDF+O5021pAnSA\x3d\x3d";h&&0!=h.length&&(e.asinDetailPageUrl=h,e.refTag="bmsm_slot_redirect");f.singleton.reloadPageForQuantity(a,e)}})})}); /* ******** */ (function(c){var e=window.AmazonUIPageJS||window.P,f=e._namespace||e.attributeErrors,a=f?f("DetailPageDeepCheckPromiseAssets",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,f){c.when("A","deep-check-promise-container","deep-check-promise-loader").register("deep-check-promise",function(a,k,d){return{asyncRequestDeepCheckPromise:function(b){var a=e.ue,c=e.uet,f=e.uex,l=b.url,g={},h=k.getDcpContainer(b);h.length?(h.hide(),g.params={asin:b.asin,buyingOptionIndex:b.buyingOptionIndex, customerId:b.customerId,device:b.device,marketplaceId:b.marketplaceId,merchantId:b.merchantId,requestId:b.requestId,sessionId:b.sessionId,slateToken:b.slateToken},g.headers={"Accept-Language":b.language,"csrf-token":b.csrfToken},g.success=function(b){h.html(b.content);h.show();a&&a.count&&a.count("dcp_ajax_success",1);"function"===typeof c&&c("cf","DeepCheckPromise",{wb:1});"function"===typeof f&&f("ld","DeepCheckPromise",{wb:1})},g.error=function(b){h.hide();a&&a.count&&a.count("dcp_ajax_error", 1)},"function"===typeof c&&c("bb","DeepCheckPromise",{wb:1}),d.load(l,g)):a&&a.count&&a.count("dcp_container_not_found",1)}}});"use strict";c.when("A").register("deep-check-promise-container",function(a){return{getDcpContainer:function(c){var d=a.$;c=c.buyingOptionIndex;var b=d("[id\x3ddelivery-block-ags-dcp-container_"+c+"]");return b.length?b:d("[id\x3dags-dcp-container_"+c+"]")}}});"use strict";c.when("A").register("deep-check-promise-loader",function(a){return{load:function(c,d){d=d||{};d.method= "post";d.contentType="application/json";d.paramsFormat="json";d.withCredentials=!0;a.ajax(c,d)}}})}); /* ******** */ (function(f){var h=window.AmazonUIPageJS||window.P,l=h._namespace||h.attributeErrors,m=l?l("AllOffersDisplayIngressAssets",""):h;m.guardFatal?m.guardFatal(f)(m,window):m.execute(function(){f(m,window)})})(function(f,h,l){f.execute("all-offers-display-ingress-init",function(){var m=h.uet,n=h.uex;"function"===typeof m&&m("bb","aod-ingress-assets-load-time",{wb:1});f.when("A","jQuery","all_offers_display_ingress_utils","all-offers-display-register-state","all_offers_display_ingress_csm_counters").execute("all_offers_display_ingress_load_AOD_assets", function(a,d,c,g,e){function k(b){f.now().execute(function(c){c!==l||g.isMarkerOverrideRegistered()||("function"===typeof q&&q("bb","aod-main-assets-injection",{wb:1}),f.register("aodIngressClick"),f.register("aodDeclarativeEvent",function(){return b}),g.setMarkerOverrideTriggered())})}var q=h.uet;a.state("aod:assetsLoaded",{isAodAssetsLoaded:!0});e.triggerUnitCounter("aodIngressAssetsLoadCtr");a.declarative("show-all-offers-display","click",function(b){b.$event.preventDefault();b.$event.stopPropagation(); b&&b.data&&b.data.ingressName&&e.incrementAndTriggerCounter(b.data.ingressName+"LoadAod");b&&b.data&&b.data.daodiDesktopExp2Treatment&&e.incrementAndTriggerCounter("daodiDesktopExp2MetricTreatment"+b.data.daodiDesktopExp2Treatment);!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("aod-load-event-handler","aodDeclarativeEvent").execute(function(c,b){b&&b.data&&(b.data.pc="dp");c.renderAodAction(b)}))});a.declarative("s-show-all-offers-display","click",function(b){b.$event.preventDefault(); b.$event.stopPropagation();!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("search-all-offers-display-util","aodDeclarativeEvent").execute(function(b,c){b.searchOnClickHandler(c)}))});a.declarative("all-offers-display-show-from-morpheus","click",function(b){b.$event.preventDefault();b.$event.stopPropagation();!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("all-offers-display-morpheus-util","aodDeclarativeEvent").execute(function(b,c){b.openAODFromMorpheus(c)}))})}); f.when("A","jQuery","all-offers-display-register-state","all_offers_display_ingress_csm_counters").execute("all-offers-display-enable-compare",function(a,d,c,g){var e=h.uet;a.state("aod:assets2Loaded")||(a=h.location.href.split("?"),1<a.length&&(a=a[1].toLowerCase().split(/[&,#]/))&&-1!==a.indexOf("aod\x3d1")&&f.now().execute(function(d){d===l&&(c.isMarkerOverrideRegistered()?g.incrementAndTriggerCounter("aodAutoLoadMarkerOverrideSetCtr"):(g.triggerUnitCounter("aodAutoLoadAssetsRequestedCtr"),"function"=== typeof e&&e("bb","aod-main-assets-injection-auto-load",{wb:1}),f.register("aodIngressClick"),c.setMarkerOverrideTriggered()))}))});f.when("A","jQuery","all_offers_display_ingress_olp_hyperlink").register("all_offers_display_ingress_utils",function(a,d,c){return{isClickOnAODIngressSupported:function(d){return c.getOlpHyperlink(d)?!0:!1}}});f.register("all_offers_display_ingress_csm_counters",function(){var a=h.ue;return{incrementAndTriggerCounter:function(d){a&&a.count&&a.count(d,(a.count(d)||0)+1)}, triggerUnitCounter:function(d){a&&a.count&&a.count(d,1)}}});f.when("all_offers_display_ingress_csm_counters").register("all_offers_display_ingress_aod_supported",function(a){return{isPropertySupported:function(d,c,g){var e=typeof d[c]===g;if(!e){var k={};d.tagName&&(k.tagName=d.tagName);d.getAttribute&&"function"===typeof d.getAttribute&&(d.getAttribute("id")&&(k.id=d.getAttribute("id")),d.getAttribute("class")&&(k.class=d.getAttribute("class")),d.getAttribute("href")&&(k.href=d.getAttribute("href"))); d="aodPropertyUnsupportedMessage, element: "+JSON.stringify(k);f.log(d+(", propertyName: "+c+", propertyType: "+g),"WARN","aodPropertyUnsupportedMessage");a.triggerUnitCounter("aodPropertyUnsupportedMessage")}return e}}});f.when("A","jQuery","all_offers_display_ingress_aod_supported").register("all_offers_display_ingress_olp_hyperlink",function(a,d,c){return{getOlpHyperlink:function(a){if(a&&a.$event&&a.$event.target){var e=a.$event.target;if("A"===e.nodeName&&e.href)return e.href;if(c.isPropertySupported(a.$event.target, "closest","function"))return(a=e.closest("a"))?a.href:null;if(a=d(e).closest("a"))return a.attr("href")}return null}}});f.when().register("all-offers-display-register-state",function(){var a=!1;return{isMarkerOverrideRegistered:function(){return a},setMarkerOverrideTriggered:function(){a=!0}}});"use strict";f.when("A","mbc_constants","all_offers_display_ingress_csm_counters").register("mbc_atc_cart_api_ajax_controller",function(a,d,c){var g=l,e;return{mbcAtcAjaxCall:function(e){g?c.incrementAndTriggerCounter(d.MBC_ATC_CLICK_CANCELLED_CSM_METRIC): g=a.$.ajax({url:e.url,type:e.type,data:e.data,cache:!1,headers:e.headers,xhrFields:e.xhrFields,success:e.successHandler,error:e.errorHandler,timeout:e.timeout||1E4})},updateCartCount:function(a){f.when("EWC").execute(function(c){e=c});e!==l&&"function"===typeof e.refresh?(e.refresh(),c.triggerUnitCounter(d.MBC_EWC_REFRESH_API_CSM_METRIC_SCOPE_NAME)):(f.when("nav.setCartCount").execute(function(c){c(a)}),c.triggerUnitCounter(d.MBC_NAV_API_CSM_METRIC_SCOPE_NAME))},resetAjaxHandler:function(){g=l}}}); "use strict";f.when("A","mbc_constants","mbc_cart_api_handler").execute("mbc_atc_action_handler",function(a,d,c){a.declarative("mbc-atc-action",d.MBC_WIDGET_TRIGGER_EVENTS,function(a){c.addToCart(a.data,!0)})});"use strict";f.when("A","jQuery","mbc_constants","all_offers_display_ingress_csm_counters","mbc_atc_cart_api_ajax_controller").register("mbc_cart_api_handler",function(a,d,c,f,e){function g(b){f.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_FAILURE_METRIC_SCOPE_NAME);var a=b.offerIndex;d(c.MBC_OFFER_ADDED_TO_CART+ a).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME);d(c.MBC_OFFER_NOT_ADDED_TO_CART+a).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);h(b.offerIndex)}function h(a){d(c.MBC_OFFER_VIEW_CART_BUTTON+a).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);d(c.MBC_OFFER_ATC_BUTTON_ID+a).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME)}return{addToCart:function(a,k){var b=d(c.MBC_ATC_AJAX_ENDPOINT).val(),l=d(c.MBC_ATC_CSRF_TOKEN).val(),m=d(c.MBC_LANGUAGE_HEADER).val(),n={items:[{asin:a.asin,offerListingId:a.oid,quantity:a.minQty}]},p=document.querySelector('meta[name\x3d"encrypted-slate-token"]'); b={url:"https://"+b+"?ref\x3d"+a.refTag+"\x26sr\x3d"+a.sr+"\x26qid\x3d"+a.qid,type:"POST",data:JSON.stringify(n),headers:{"Accept-Language":m,Accept:c.MBC_ATC_CART_API_HEADER_ACCEPT,"x-api-csrf-token":l,"Content-Type":c.MBC_ATC_CART_API_HEADER_CONTENT_TYPE,"x-amzn-encrypted-slate-token":p&&p.content?p.content:""},xhrFields:{withCredentials:!0},timeout:1E4,successHandler:function(b){b&&b.entity&&b.entity.items&&b.entity.items[0]&&0<b.entity.items[0].quantity?(b.entity.count&&b.entity.count.entity&& b.entity.count.entity.items?e.updateCartCount(b.entity.count.entity.items):(f.triggerUnitCounter(c.MBC_CART_API_SUCCESS_COUNT_FAILURE_CSM_METRIC),e.updateCartCount(b.entity.items[0].quantity)),f.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_SUCCESS_METRIC_SCOPE_NAME),k&&d(c.MBC_OFFER_ADDED_TO_CART+a.offerIndex).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME),h(a.offerIndex)):g(a);e.resetAjaxHandler()},errorHandler:function(b){422===b.status&&(b=JSON.parse(b.responseText))&&b.entity&&b.entity.items&&b.entity.items[0]&& (b.entity.count&&b.entity.count.entity&&b.entity.count.entity.items?e.updateCartCount(b.entity.count.entity.items):(f.triggerUnitCounter(c.MBC_CART_API_ERROR_COUNT_FAILURE_CSM_METRIC),e.updateCartCount(b.entity.items[0].quantity)));g(a);e.resetAjaxHandler()}};e.mbcAtcAjaxCall(b)}}});f.register("mbc_constants",function(){return{MBC_ATC_AJAX_ENDPOINT:"#mbc-atc-ajax-endpoint",MBC_ATC_CSRF_TOKEN:"#mbc-atc-csrf-token",MBC_LANGUAGE_HEADER:"#mbc-language",MBC_OFFER_ADDED_TO_CART:"#mbc-offer-added-to-cart-", MBC_OFFER_NOT_ADDED_TO_CART:"#mbc-offer-not-added-to-cart-",MBC_OFFER_VIEW_CART_BUTTON:"#mbc-offer-view-cart-",MBC_OFFER_ATC_BUTTON_ID:"#mbc-buybutton-addtocart-",MBC_ATC_CLICK_CANCELLED_CSM_METRIC:"mbc-atc-click-cancelled",MBC_ATC_CART_API_HEADER_ACCEPT:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',MBC_ATC_CART_API_HEADER_CONTENT_TYPE:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"',MBC_NAV_API_CSM_METRIC_SCOPE_NAME:"mbc-nav-api-called",MBC_EWC_REFRESH_API_CSM_METRIC_SCOPE_NAME:"mbc-ewc-refresh-api-called", MBC_CART_API_SUCCESS_COUNT_FAILURE_CSM_METRIC:"mbc-cart-api-success-response-count-failure",MBC_CART_API_ERROR_COUNT_FAILURE_CSM_METRIC:"mbc-cart-api-error-response-count-failure",MBC_CART_API_ATC_CSM_SUCCESS_METRIC_SCOPE_NAME:"mbc-cart-api-atc-success",MBC_CART_API_ATC_CSM_FAILURE_METRIC_SCOPE_NAME:"mbc-cart-api-atc-failure",MBC_WIDGET_TRIGGER_EVENTS:"click",AUI_HIDE_ELEMENT_CSS_NAME:"aok-hidden"}});"function"===typeof n&&n("ld","aod-ingress-assets-load-time",{wb:1})})}); /* ******** */ (function(m){var n=window.AmazonUIPageJS||window.P,q=n._namespace||n.attributeErrors,a=q?q("DetailPageOfferDisplayFeatureCommonAssets",""):n;a.guardFatal?a.guardFatal(m)(a,window):a.execute(function(){m(a,window)})})(function(m,n,q){m.when("A","odf-metric-utils").register("progressive-display-utils",function(a,d){function f(b,e){h(".offer-display-features-expander").each(function(c,a){c=h(a);a=c.find(".a-expander-header.odf-expander-heading");if(a.is(":visible")){var g=c.attr("data-a-expander-collapsed-height"); if("undefined"===typeof g||!1===g||!0===e){var f=c.find(".offer-display-features-container").attr("displayable-row-count"),r=a.height()+4+6;c.find(".offer-display-feature-label").each(function(b,c){if(b>=parseInt(f))return!1;r+=h(c).outerHeight(!0)});c.attr("data-a-expander-collapsed-height",r);0<c.find('div[data-expanded\x3d"false"]').length&&(c.height(r),c.find(".a-expander-content-fade").remove());d.publishCountMetrics(b+"ProgressiveDisplayHeightSet")}d.publishCountMetrics(b+"ProgressiveDisplayAvailable")}else d.publishCountMetrics(b+ "ProgressiveDisplayNotAvailable")})}function l(b){h(".offer-display-features-expander").each(function(e,c){e=h(c);c=e.find(".offer-display-features-container").attr("displayable-row-count");var a=e.find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").length;"undefined"!==typeof c&&a<=c?(c=e.find(".offer-display-features-show-more"),c.length&&c[0].classList.remove("a-spacing-small"),c=e.find(".a-expander-header.odf-expander-heading"),c.length&&c[0].classList.add("aok-hidden"), e=e.find(".show-more"),0<e.length&&e.find(".offer-display-feature-label")[0].classList.add("aok-hidden"),d.publishCountMetrics(b+"ProgressiveDisplayHidden")):"undefined"!==typeof c&&g(e)})}function k(b){var e=0;h(".offer-display-dynamic-features").each(function(b,a){a.classList.remove("aok-hidden");e+=1});d.publishCountMetrics(b+"UnHidingDynamicFeatures",e)}function p(b){h(".collapsed-offer-display-features").each(function(e,c){e=h(c);var a=e.find(".offer-display-features-container").attr("displayable-row-count"); c=e.find(".offer-display-feature-label").length;"undefined"!==typeof a&&c>a&&(e.find(".offer-display-feature-label").each(function(b,c){b>=a&&h(c).parent()[0].classList.add("aok-hidden")}),d.publishCountMetrics(b+"FeaturesHiddenInCollapsedAccordion",c-a))})}function g(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,e){b>=a&&h(e).parent()[0].classList.add("aok-hidden")})}function t(b,a){b= d.buildMetricPrefix(b,a);k(b);l(b);f(b,!1);p(b)}var h=a.$;return{initializeAndSetEventListeners:function(b){t(b,"pageLoad");a.on("a:pageUpdate",function(){t(b,"pageUpdate")});a.on("a:accordion:buybox-accordion:select",function(){f(d.buildMetricPrefix(b,"accordionSelect"),!1)});a.on("a:tabs:offerDisplayGroup_tabs:select",function(){f(d.buildMetricPrefix(b,"tabSelect"),!1)});a.on("a:odf:resetHeightForProgressiveFaceOut",function(){f(d.buildMetricPrefix(b,"resetHeightForProgressiveFaceOut"),!0)})},alignOverlappingElements:function(b, a){var c=b.find(".a-expander-header.odf-expander-heading a")[0].getBoundingClientRect(),e=b.find(".offer-display-features-show-more a")[0].getBoundingClientRect();c=c.right-e.left;-10<=c&&(b.find(".offer-display-features-show-more a").css("paddingLeft",c+10),b=d.buildMetricPrefix(a),d.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, e){b>=a&&h(e).parent()[0].classList.remove("aok-hidden")})},hideFeaturesUnderProgressiveDisplay:g}});"use strict";m.when("A","odf-metric-utils").register("truncation-utils",function(a,d){function f(f,p){l(".offer-display-features").each(function(g,k){g=l(k);var h=!1;g.find(".offer-display-feature-text-message").each(function(b,a){b=l(a);if(b.css("line-clamp")!==(3).toString()&&b.css("-webkit-line-clamp")!==(3).toString()){b=l(a);var c=b.text();b.text("...");var e=a.offsetHeight;b.text(c);for(c=!1;a.offsetHeight> 3*e;)c=!0,b.text(b.text().replace(/\W*\s(\S)*$/,"..."));c&&(h=!0)}else if(h=a.scrollHeight>a.clientHeight)return!1});g=g.find(".offer-display-features-show-more");k=d.buildMetricPrefix(f,p);h?(a.show(g),d.publishCountMetrics(k+"ContentTruncated")):(a.hide(g),d.publishCountMetrics(k+"ContentNotTruncated"))})}var l=a.$;return{setEventsToUpdateTextAndDetailsLinkVisibility:function(d){f(d,"pageLoad");if("Mobile"===d)a.on(a.constants.BROWSER_EVENTS.RESIZE,function(){f("pageResize")});a.on("a:accordion:buybox-accordion:select", function(){f(d,"accordionSelect")});a.on("a:tabs:offerDisplayGroup_tabs:select",function(){f(d,"tabSelect")});a.on("a:pageUpdate",function(){f(d,"pageUpdate")})}}});"use strict";m.when("A").register("copy-odf-content-utils",function(a){var d=a.$;return{copyOfferDisplayFeatureContent:function(a,l){a.siblings("#offer-display-features").find(d(l)).each(function(f,p){a.append(d(p).children())})}}});"use strict";m.when("A").register("odf-metric-utils",function(a){function d(a,d){a="ODF."+a+".";d&&(a+= d+".");return a}function f(a,d){k&&k.count&&k.count(a,d?d:1)}var l=a.$,k=n.ue;return{buildMetricPrefix:d,publishCountMetrics:f,publishFeatureLevelMetrics:function(a){l(".offer-display-features").find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").each(function(g,k){g=l(k).attr("offer-display-feature-name");g=d(a)+g+".Display";f(g)})}}})}); /* ******** */ (function(e){var k=window.AmazonUIPageJS||window.P,l=k._namespace||k.attributeErrors,c=l?l("DetailPageOfferDisplayFeatureDesktopAssets",""):k;c.guardFatal?c.guardFatal(e)(c,window):c.execute(function(){e(c,window)})})(function(e,k,l){e.when("A","truncation-utils","copy-odf-content-utils","odf-metric-utils").execute("show-offer-display-features-side-sheet",function(c,b,d,a){var f=c.$;f("#offer-display-features-side-sheet-content a").attr("target","_blank");f("#offer-display-features #sellerProfileTriggerId").click(function(){a.publishCountMetrics(a.buildMetricPrefix("Desktop")+ "SellerProfileTriggerIdClicked")});c.declarative("close-offer-display-features-side-sheet","click",function(h){function b(a){a.siblings("#offer-display-features-side-sheet-content").show(function(){f(this).removeClass("offer-display-features-side-sheet-content-display")})}(function(a){b(a);c.hide(a.find("#offer-display-features-background"))})(f(h&&h.$currentTarget&&h.$currentTarget[0]));a.publishCountMetrics(a.buildMetricPrefix("Desktop")+"SideSheetClosed")});c.declarative("show-offer-display-features-side-sheet", "click",function(b){function h(a){a.siblings("#offer-display-features-side-sheet-content").show(function(){f(this).addClass("offer-display-features-side-sheet-content-display")})}b=f(b&&b.$currentTarget&&b.$currentTarget[0]).closest("#offer-display-features");(function(a){a=a.siblings("#offer-display-features-side-sheet-content");0===a[0].children.length&&d.copyOfferDisplayFeatureContent(a,".offer-display-feature-side-sheet")})(b);(function(a){var b=a.siblings('[data-action\x3d"close-offer-display-features-side-sheet"]').find("#offer-display-features-background"); c.show(b);h(a)})(b);a.publishCountMetrics(a.buildMetricPrefix("Desktop")+"SideSheetOpened")});b.setEventsToUpdateTextAndDetailsLinkVisibility("Desktop")});"use strict";e.when("A","progressive-display-utils","odf-metric-utils").execute("offer-display-features-expander",function(c,b,d){b.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.find(".offer-display-features-show-more").is(":visible")? a.children(".a-row").css("paddingTop",c):a.children(".a-row").css("paddingTop",c+4);b.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);b.hideFeaturesUnderProgressiveDisplay(a);d.publishCountMetrics(d.buildMetricPrefix("Desktop")+ "ProgressiveDisplayCollapse")})});"use strict";e.when("A","odf-metric-utils").execute("publish-feature-metrics",function(c,b){b.publishFeatureLevelMetrics("Desktop")});"use strict";e.when("A","jQuery","odf-metric-utils").execute("giftingInfo",function(c,b,d){function a(){var a=b(".odf-gift-wrap input[type\x3d'checkbox']");1<a.length&&d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingMultipleBOWithCheckbox");a.each(function(){b(this).change(function(){if(0<b(this).closest("div.odf-gift-wrap").length){var a= b(this).closest("div.odf-gift-wrap").attr("data-bo-index"),g=b('.offer-display-feature-text-message.gift-wrap-message[data-bo-index\x3d"'+a+'"]'),e=b('.gift-wrap-unchecked-message[data-bo-index\x3d"'+a+'"]'),f=b('.gift-wrap-checked-message[data-bo-index\x3d"'+a+'"]');a=b('div[data-bo-index\x3d"'+a+'"] input[type\x3d"checkbox"][id\x3d"gift-wrap"]');0<g.length&&b(this).is(":checked")?(0<f.length&&(g.text(f.text()),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingCheckedTextUpdate")),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+ "GiftingCheckboxChecked")):(0<e.length&&(g.text(e.text()),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingUncheckedTextUpdate")),d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"GiftingCheckboxUnchecked"));if(g=0<a.length)g=b(this),g=g.is(":checked")&&!a.is(":checked")||!g.is(":checked")&&a.is(":checked");g&&a.click();c.trigger("a:odf:resetHeightForProgressiveFaceOut")}})})}a();c.on("a:pageUpdate",function(){a()})})}); /* ******** */