(function(w){var u=window.AmazonUIPageJS||window.P,B=u._namespace||u.attributeErrors,e=B?B("DetailPageDesktopTwisterAssets",""):u;e.guardFatal?e.guardFatal(w)(e,window):e.execute(function(){w(e,window)})})(function(w,u,B){w.when("A","new-desktop-twister-view","desktop-twister-widgets-factory","desktop-twister-slot-manager","desktop-twister-dynamic-style","desktop-twister-utils","desktop-twister-dropdown","desktop-twister-logger","twister-js-init-dpx-data","twister-plus-desktop-twister-mark-render").register("desktop-twister-view-initialiser",
function(e,m,t,p,d,r,q,y,z){var x=z?z.inlineTwisterData||{}:{};x.inlineTwisterEnabled&&(y=new y,new m(z,t.Row,q,p,d,r,y),!x.shouldDelayRegistrationWithTwisterCore&&e.trigger("desktop-twister-view-initialized"))});"use strict";w.when("A","desktop-twister-constants","3p-promise").register("new-desktop-twister-view",function(e,m,t){var p=e.$;return function(d,r,q,y,z,x,I){function w(){"function"===typeof u.markFeatureInteractive&&u.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"twister-plus-new-desktopTwister"}]})}
function n(){if(!A)return 0===d.unselectedDimCount;var a=c();return!!A.util.getAsinFromSelectionInfo(a)}function b(a,c,b,g,f,k,h,n,l,e,d){return{text:a,image:c||"",name:b,id:e+"_"+b,selected:g,slotHtm:f,showSlot:k,isVisible:h,unavailable:n,defaultSlotUnavailable:L,asin:l,pageUrl:d}}function a(a,c){var b=M.unselectedDimensionPrompt||"",g=d&&d.variationDisplayLabels?d.variationDisplayLabels[a]:"",f=d&&d.variationValues?d.variationValues[a][c]:"";return{dimKey:a,titleSelectorPrefix:"inline-twister-dim-title-",
titleValueSelector:"inline-twister-dim-title-value",mainText:g,subText:-1!==c?f:b.replace("###dimension",g||"")}}function c(){if(!A){var a=[];e.each(h.dimList,function(c){a.push({dimKey:c,val:d.selectedVariationValues?d.selectedVariationValues[c]:-1})});return a}return A.state()}function f(){return e.map(h.dimList,function(a,c){if(!h.isSingletonMap[a]&&!h.rows[a].dimType)return new t(function(b){l(h.rows[a],a,c);b()})})}function l(a,c,g){var f=h.inlineTwisterData.slotsEnabledDimensions,k=!!((h.dimList.length===
f.length?f[g]:f[0])&&n(c));g=d.variationValues[c];var l=a.getInitialVisibleSwatchList(),v=[];e.each(g,function(a,g){a=b(a,N[c+"::"+g],g,h.initSelectionState[c].val===g,l[g]?l[g].slotHtm:"",k,l[g]&&l[g].isVisible,l[g]&&l[g].unavailable,B,c,G[c]?G[c][a]:null);v.push(a)});h.swatches[c]=v}function g(){e.each(h.rows,function(a){h.isSingletonMap[a.dimKey]||a.dimType||(a.createDisplaySwatches(),h.textSwatchMap[a.dimKey]&&a.toggleSwatch.alignTextSwatches())})}function k(){function g(a,c,g){var f,k,l,n=a.expanderContent.find(".inline-twister-swatch:not(.aok-hidden):not(.swatch-prototype)"),
v=d.variationValues[c]||[],K=h.inlineTwisterData.inlineVariationsSize,q=-1,D=[],m=null;-1===K&&(q=parseInt(a.expanderContent.attr("data-swatchCountPerRow"))||n.length);e.each(n,function(n,h){var e=parseInt(n.getAttribute("data-idxInToggleSwatchList")),d="true"===n.getAttribute("data-initiallySelected"),C="true"===n.getAttribute("data-initiallyUnavailable");f=n.getAttribute("data-asin");k=e;l=v[e]||"";e=N[c+"::"+k];var F=l;d=b(F,e,k,d,"",g,!0,C,f,c,G[c]?G[c][F]:null);a.toggleSwatch&&(C=a.toggleSwatch.createSwatch(d,
n),d.isVisible=C.isVisible);D.push(d);-1!==K&&-1===q&&(n=n.getBoundingClientRect().top,null===m?m=n:n!==m&&(q=h))});h.inlineVariationsSize[c]=n.length;a.toggleSwatch&&a.toggleSwatch.setNumberOfSwatchesPerRow(q);return D}function f(a,c){var g=!(!a||!n(c)),b=h.rows[c].getInitialVisibleSwatchList();g&&e.each(b,function(g){if(!g.unavailable){var b=h.slotManager.get(g.asin,c,h.noOfLoadingIndicator,F,g.isImageSwatch);g.updateSlotNode({showSlot:a,slotHtm:b},c)}})}function k(a,g,b){return{divMetadata:{dimIndex:h.dimIndexMap[a],
dimValueIndex:g},eventType:b,subType:m.DP_STATE_VIEW_SUBTYPE,dimensionsMap:h.dimensionsMap,currDimCombId:x.getCurrDimCombId(c(),m.CHAR_UNDERSCORE)}}var l=c(),D=0,z={},y=h.inlineTwisterData.slotsEnabledDimensions;p.each(l,function(a,c){z[c.dimKey]=c;h.dimIndexMap[c.dimKey]=a;h.dimensionsMap[a]=c.dimKey});h.initSelectionState=z;p.each(h.dimList,function(g,b){var k=z[b].val;g=C(b);k=a(b,k);var n=-1!==O.indexOf(b),l={handleDimensionExpansion:function(a,g,k){b=a.dimKey;if(k){a=B;k={};J[b]?(k=v(h.swatches[b],
g,b,c(),!n),h.indexTranslationMap[b]=k,a={swatches:h.swatches[b]}):(f(g,b),J[b]=!0);var l=h.rows[b];l.setState(a,k,E,null,!1);H(g,l,b);h.logger.logDimensionExpanded(b)}else h.logger.logDimensionCollapsed(b)}};h.textSwatchMap[b]=g;g={showSlot:!1,dimKey:b,inlineTwisterData:h.inlineTwisterData};d.variationValues[b].length>d.inlineTwisterData.numberOfSwatchPerDimension?(g={dimName:b,currDimCombId:x.getCurrDimCombId(c(),m.CHAR_UNDERSCORE)},g=new q(d,g)):g=new r("inline-twister-row-",k,g,l,h.logger);h.rows[b]=
g;D+=1});0===h.inlineTwisterData.numberOfDimensionsExpanded&&(w(),P=!0);D=0;p.each(h.dimList,function(a,b){function f(a){if(a){var c=parseInt(a[m.STRING_DIM_VALUE_INDEX],10);E=b=a[m.STRING_DIM_KEY];a={dimKey:b,val:c};u.newTwisterInteractionStartTime=new Date;h.twister.metaData(k(b,c,m.viewEvents.CLICK));h.twister.dimensionChanged(a);h.logger.logDimensionValueClick()}}var l=h.textSwatchMap[b],e=[];a=h.dimList.length===y.length?y[D]:y[0];var v=-1!==O.indexOf(b),q=h.rows[b];h.showSlotMap[b]=a;var C=
-1!==d.singletonDimensionKeys.indexOf(b);h.isSingletonMap[b]=C;D+=1;!C&&q&&(C=!(!a||!n(b)),l={name:b,swatches:e,isTextSwatch:l,onChange:function(a,c,g){if(c){var f=parseInt(c.buttonName,10);b=c.buttonGroupName;a[f]&&a[f].selected&&h.logger.logSelectedSwatchClick();E=b;a={dimKey:b,val:f};u.newTwisterInteractionStartTime=new Date;h.twister.metaData(k(b,f,m.viewEvents.CLICK));h.twister.dimensionChanged(a);h.logger.logDimensionValueClick();g&&h.logger.logDimValueClickAfterAutoUpdate()}},onHover:function(a,
b){var g=b.data;b=b.type;var f=[];if(g){if(b===m.viewEvents.MOUSE_ENTER){var l=parseInt(g.name,10);f.push({dimKey:a,val:l})}else f=c();A&&(h.twister.metaData(k(a,l,b)),h.twister.dimensionPeek(f));E=a}},totalSwatchCount:(d.variationValues[b]||[]).length,preserveNaturalSwatchOrder:v},e={handleWindowResize:function(a){A&&H(h.showSlotMap[a],h.rows[a],a)}},q.dimType&&"dropdown"===q.dimType?q.initialize({onDropdownChange:f}):(q.initializeComponents(l,a,e),e=g(q,b,C),h.swatches[b]=e))});P||w()}function C(a){var c=
!0;(h.inlineTwisterData.disableImageSwatch===B?0:h.inlineTwisterData.disableImageSwatch)||(c=!h.inlineTwisterData.imageDimensionKeysMap[a]);return c}function v(a,c,b,g,f,k){var l=!(!c||!n(b));c=A.util.getDimAvailability(b,g);var d={},v=0,q=-1;p.each(g,function(a,c){c.dimKey===b&&(q=c.val)});-1!==q&&(f&&(d[q]=v),v++);e.each(c.available,function(c){a[c.index]=a[c.index]||{};var g=a[c.index];g.unavailable=!1;var n=g.isVisible,e=""!==g.image;g.slotHtm=l&&n?h.slotManager.get(c.asin,b,h.noOfLoadingIndicator,
F,e,k):g.slotHtm||"";f&&q!==c.index&&(d[c.index]=v);g.showSlot=l;g.selected||v++});e.each(c.unavailable,function(c){a[c.index]=a[c.index]||{};var g=a[c.index];g.unavailable=!0;f&&(g.isVisible=v<h.inlineVariationsSize[b]);g.slotHtm=l?L:"";f&&(d[c.index]=v);g.showSlot=l;v++});J[b]=!0;return d}function H(a,c,b){a&&(h.slotManager.resetMinSlotHeight(b),a=c.toggleSwatch.getSlotNodes(),D(a,b),h.slotManager.updateSlotHeight(b))}function D(a,c){h.slotManager.resetSlotHeight(c);e.each(a,function(a,b){e.each(a,
function(a){h.slotManager.setState(a,c,b)})})}function F(a){H(!0,h.rows[a],a)}var h=this,A=B;this.data=d;this.noOfLoadingIndicator=1;this.dimList=d.reorderedDimensionListKeys||[];this.dimensionsMap=[];this.logger=I;this.inlineTwisterData=d?d.inlineTwisterData||{}:{};this.swatches={};var M=this.inlineTwisterData&&this.inlineTwisterData.stringTranslationMap?this.inlineTwisterData.stringTranslationMap:{},L='\x3cspan class\x3d"a-size-small default-slot-unavailable"\x3e'+(M.defaultSlotUnavailableString||
"")+"\x3c/span\x3e",N=d.imageHashMap||{},G=d.dimensionPageLoadUrls||{};this.rows={};this.isSingletonMap={};this.indexTranslationMap={};this.textSwatchMap={};var E;this.initSelectionState={};this.inlineVariationsSize={};this.dimIndexMap={};this.showSlotMap={};var O=h.inlineTwisterData.dimsWithSwatchReorderingDisabled||[],J={},P=!1;(function(){var a=h.logger.createFunctionTimerInstance("desktopTwisterInitTime");a.start();k();a.stop()})();e.on("register-desktop-twister-with-twisterCore",function(b,k){A=
b;h.logger.registerTwisterCore(A);b=c();var l=h.inlineTwisterData.slotsEnabledDimensions,n={};p.each(b,function(a,c){n[c.dimKey]=c});A.slotsDimSum.addDefaultQueryParameter("showFancyPrice",h.inlineTwisterData.showFancyPrice);A.slotsDimSum.addDefaultQueryParameter("twisterFlavor",m.DESKTOP_TWISTER_FLAVOR);h.slotManager=new y(A,z,h.logger,h.inlineTwisterData);var q=0;e.each(h.rows,function(c){function b(b){var l={};var n=b.selected().selectionInfo();p.each(n,function(a,c){l[c.dimKey]=c});var d=l[g].val;
b=h.swatches[g];b[d]=b[d]||{};b[f]=b[f]||{};b[f].selected=!1;b[d].selected=!0;f=d;v(b,k,g,n,!1,k);n=a(g,d);d={swatches:b};var q=e.filter(b,function(a){return a.isVisible});b.length===q.length&&(h.inlineVariationsSize[g]=b.length);c.setState(d,{},E,n,!1);H(k,c,g);e.each(h.rows,function(a){h.isSingletonMap[a.dimKey]||a.dimType||(a.toggleSwatch.repopulateDisplaySwatches(),h.textSwatchMap[a.dimKey]&&a.toggleSwatch.alignTextSwatches())})}if(!h.isSingletonMap[c.dimKey]){c.dimType||c.postInitialize();var g=
c.dimKey,f=n[g].val;C(g);var k=h.dimList.length===l.length?l[q]:l[0];h.twister=A.registerActive({viewAttribution:"DetailPage",viewName:"DesktopTwisterRowView_"+g},c.dimType&&"dropdown"===c.dimType?{updateView:function(a,b){var g={};g={};var f={};"VARIATION_CHANGE"===a&&(g=b.selected(),g=x.getDimensionValuesData(g.selInfo,d),f=x.constructEventInfo(d,A,m.viewEvents.CLICK,b,g),e.delay(function(){c.updateView(f)}))}}:{updateView:function(f,k){var l={};"VARIATION_CHANGE"===f?e.delay(function(){b(k)}):
"VARIATION_PEEK"===f&&(f=k.peek().selectionInfo(),p.each(f,function(a,c){l[c.dimKey]=c}),f=l[g].val,f=a(g,f),E===g&&c.title.setState(f))}})}q++});t.all(f()).then(function(){g()});e.trigger("desktop-twister-twisterCore-initialized",h);k.then(function(){e.each(h.rows,function(a){a.activatePageRefresh()})})})}});"use strict";w.when("A").register("desktop-twister-constants",function(e){return{AJAX_CALL_TIMEOUT:2E4,DIMENSION_VALUE:"DimensionValue###",DISPLAY_VALUE:"DisplayValue###",SWATCH_DATA:"SwatchData###",
DESKTOP_TWISTER_FLAVOR:"twisterPlusDesktopConfigurator",MAX_DIMENSION_FLAVOUR_CAP:3,POPOVER_DELAY:500,MAX_INLINE_ROWS:7,SIDE_SHEET_ANIMATION_SPEED:300,SIDE_SHEET_PADDING:32,TEXT_SWATCH_MARGIN_RIGHT:6,CONFIGURED_SLOTS:["price","ms3","twisterPrimeWardrobe","twisterAvailability","deliveryPromise"],DP_STATE_VIEW_SUBTYPE:"DETAILPAGE_STATE_VIEW_METADATA",CHAR_UNDERSCORE:"_",CHAR_ASTERISK:"*",ID_SELECTOR:"#",INDEX_FOR_SELECT_OPTION:"-1",DEFAULT_SCROLLER_WIDTH:20,BORDER_WIDTH:2,TEXT_ALIGNMENT_LIMIT:400,DEFAULT_TEXT_SWATCH_SPACING:16,
DEFAULT_IMAGE_SWATCH_SPACING:8,REDUCED_IMAGE_SWATCH_SPACING:4,TWISTER_DIMENSION_VIEW_DROPDOWN:"dropdown",NATIVE_DROPDOWN_DIV_PREFIX:"#native_",DROPDOWN_DIV_NAME:"dropdown_selected_",STRING_EVENT_TYPE:"eventType",STRING_EVENT_DATA:"eventData",STRING_DIMENSION_SELECTION_DATA:"dimensionSelectionData",STRING_DIM_NAME:"dimName",STRING_DIM_ORDER:"dimOrder",STRING_DIM_INDEX:"dimIndex",STRING_DIM_KEY:"dimKey",STRING_DIM_VALUE_INDEX:"dimValueIndex",STRING_UNAVAILABLE_POPOVER_STRING_VALUE:"unavailablePopOverStringValue",
STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE:"currentlyUnavailablePopOverStringValue",CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED:"isCurrentlyUnavailableWeblabEnabled",EVENT_TYPE_DROPDOWN_CHANGE:"dropdownChange",AUI_DROPDOWN_EVENT_PREFIX:"a:dropdown:selected:",STRING_IS_SELECTED:"isSelected",STRING_IS_REQUIRED:"isRequired",STRING_STYLE:"style",CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION:"dropdownSelect",STRING_CSS_CLASS:"css_class",STRING_NATIVE_CSS_CLASS:"native_css_class",STRING_HTML_CONTENT:"html_content",
CLASS_FOR_DROPDOWN_UNAVAILABLE:"dropdownUnavailable",CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE:"dropdownCurrentlyUnavailable",STYLE_CLASS_TYPE_FOR_SELECTED:"selected",STYLE_CLASS_TYPE_FOR_UNAVAILABLE:"unavailable",STYLE_CLASS_TYPE_FOR_AVAILABLE:"available",STYLE_CLASS_TYPE_FOR_INVALID:"invalid",STRING_DISPLAY_CONFIG_STYLES_DATA:"displayConfigStylesData",TWISTER_CURRENT_ASIN:"currentAsin",INIT_DATA_DELETED_LANDING_ASIN_INFO:"deletedLandingAsinInfo",STRING_DIM_COMB_ID:"dimCombID",STRING_EVENT_DIV_METADATA:"divMetaData",
STRING_EVENT_DIM_INFO:"eventDimInfo",viewEvents:{MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CLICK:"click",DROPDOWN_CHANGE:"dropdownChange",TWISTER_REFRESH:"twisterRefresh"},sideSheetSelectors:{EXPANDER_CONTENT_PREFIX:"#inline-twister-expander-content-",SEC_VIEW_DIMENSION_VALUE_LIST:" #tp-inline-twister-dim-values-container",DIMENSION_VALUES_LIST:" .dimension-values-list",DIMENSION_VALUES_LIST_ODD_CHILD:" .dimension-values-list \x3e :nth-child(odd)",DIMENSION_VALUES_LIST_EVEN_CHILD:" .dimension-values-list \x3e :nth-child(even)",
LIST_ITEM_CIRCULAR_IMAGE:".dimension-value-list-item-circular-image",CIRCULAR_IMAGE_SWATCH_BUTTON:".circle-image-swatch-button",LIST_ITEM_SQUARE_IMAGE:".dimension-value-list-item-square-image",SQUARE_IMAGE_SWATCH_BUTTON:".image-swatch-button",TEXT_LIST_ITEM:".swatch-list-item-text",TEXT_SWATCH_BUTTON:".text-swatch-button",TEXT_SWATCH_BUTTON_WITH_SLOTS:".text-swatch-button-with-slots",IMAGE_SELECTOR:".swatch-image",SEC_VIEW_TOGGLE_BUTTON_PREFIX:"sec_",DELAY:200},widgetSelectors:{EXPANDER_CONTENT_PREFIX:"#inline-twister-expander-content-",
EXPANDER_HEADER_PREFIX:"#inline-twister-expander-header-",DIMENSION_EXPANDER_ICON_PREFIX:"#dimension-expander-icon-",DIMENSION_EXPANDER_ICON_WRAPPER:".dimension-expander-icon-wrapper",EXPANDED_DIMENSION_TEXT_PREFIX:"#inline-twister-expanded-dimension-text-",COLLAPSED_DIMENSION_TEXT_PREFIX:"#inline-twister-collapsed-dimension-text-",AUTO_NOTIFICATION_EXPANDED:"#inline-twister-auto-notification-expanded",AUTO_NOTIFICATION_COLLAPSED:"#inline-twister-auto-notification-collapsed",IMAGE_THUMBNAIL:".dimension-collapsed-image-thumbnail",
SWATCH_NODE_SELECTOR:".inline-twister-swatch",SLOT_NODE_SELECTOR:".dimension-slot-info",TOGGLE_BUTTON_SELECTOR:".a-button-toggle",IMAGE_SELECTOR:".swatch-image",DIMENSION_VALUES_LIST:".dimension-values-list",IMAGE_SWATCH_HORIZONTAL:".image-swatch-button-with-slots-horizontal",IMAGE_SWATCH_VERTICAL:".image-swatch-button-with-slots",IMAGE_SWATCH_WITH_NO_SLOT:".image-swatch-button",IMAGE_SWATCH_FALLBACK:".image-swatch-button-fallback"},classes:{A_COLOR_ATTAINABLE:"a-color-attainable",AOK_HIDDEN:"aok-hidden",
DIMENSION_EXPANDER_CONTENT_EXPAND:"dimension-expander-content-expand",ROTATE:"rotate",A_BUTTON_UNAVAILABLE:"a-button-unavailable",A_BUTTON_SELECTED:"a-button-selected",A_BUTTON_FOCUS:"a-button-focus",ROW_IDENTIFIER_PREFIX:"desktop-twister-dim-row-"},cssConstants:{BG_COLOR:"background-color",GREEN_BG_COLOR:"#D9EED9",WHITE_BG_COLOR:"white"},loggingConstants:{ATTRIBUTION:"TwisterPlusNewDesktopTwister",ERROR:"ERROR"}}});"use strict";w.when("A").register("desktop-twister-logger",function(e){function m(){if(!(this instanceof
m))return new m;d||(d=this);return d}function t(d){if("undefined"!==typeof u.csa){var e=u.csa("Events",{producerId:"dp-rpcx"}),q=r.count(d)||0;e("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:d,valueToLog:q},{ent:"all"})}}var p=e.$,d,r=u.ue;m.prototype={registerTwisterCore:function(d){this.twisterCore=d},logCSMDataOnLanding:function(){var d=0,e=0,m=0,x=this.twisterCore.util,w=x.tvm.dimensionInfo,u=this.twisterCore.state().length,n=Object.keys(x.tvm.dimCombinations).length;p.each(w,function(b,
a){b=a.dimKey;x.isRequiredDim(b)&&m++;x.isSingletonDim(b)?e++:d++});r&&r.count&&(r.count("dpMobileTwisterDropdownPresent",d),t("dpMobileTwisterDropdownPresent"),r.count("dpMbileTwisterSingletonDim",e),t("dpMbileTwisterSingletonDim"),r.count("dpMobileTwisterRequiredDim",m),t("dpMobileTwisterRequiredDim"),r.count("dpMobileTwisterDimSize",u),t("dpMobileTwisterDimSize"),r.count("dpMobileTwisterFamilySize",n),t("dpMobileTwisterFamilySize"),r.count("twisterPlus.inlineTwisterGV",1),t("twisterPlus.inlineTwisterGV"))},
logCSMTagsOnLanding:function(d){function q(a,c,b){var g=[];if(c===b)g.push(""),a=a[c],e.$.isArray(a)?e.each(a,function(a,c){g.push(a)}):g.push(a);else{var f=Math.floor((c+b)/2);c=q.call(this,a,c,f);var k=q.call(this,a,f+1,b);e.each(c,function(a,c){e.each(k,function(c,b){g.push(""===a?c:""===c?a:a+":"+c)})})}return g}function m(a){a&&p.push(a)}var r=this,p=[],t=!0,n=!0,b=[0,3,8,25,50,100,1E3,5E3],a=Object.keys(this.twisterCore.util.tvm.dimCombinations).length;if(d.dimensionList){var c="variation_dimension:"+
d.dimensionList.length;e.each(d.dimensionList,function(a,c){r.addCSMTag(a)})}for(var f=1;f<b.length;f++)if(a<=b[f]){var l="family_size_bucket:"+b[f-1]+"-"+b[f];break}else f===b.length-1&&(l="family_size_bucket:gt"+b[f]);d.dimensionInfo&&e.each(d.dimensionInfo,function(a,c){a.isSingleton||(t=!1)});b=t?"SingletonFamily":"DesktopTwister";d.initDimCombination&&e.each(d.initDimCombination,function(a,c){-1===a.val&&(n=!1)});m(c);m(l);m(b);n&&m("defaultSelection");d=q.call(this,p,0,p.length-1);(function(a){var c=
this;e.each(a,function(a,b){a&&c.addCSMTag(a)})}).call(this,d)},createFunctionTimerInstance:function(d){var e=this;return{eventType:d,start:function(){this.startTime=Date.now()},stop:function(){this.startTime&&e.logCounter(this.eventType,Date.now()-this.startTime)}}},addCSMTag:function(d){u.ue&&u.ue.tag&&u.ue.tag(d)},logCounter:function(d,e){r&&r.count&&(e===B?r.count(d,(r.count(d)||0)+1):r.count(d,e),t(d))},logBottomSheetPageUpdate:function(d){this.logCounter("twisterPlus.inlineTwisterPageUpdate")},
logSelectedSwatchClick:function(){this.logCounter("twisterPlus.inlineTwister.selectedSwatchClick")},logDimensionValueClick:function(){this.logCounter("dpmobiletwisterclickOndimval")},logDimensionCollapsed:function(d){this.logCounter("twisterPlus.inlineTwister.dimCollapse."+d)},logDimensionExpanded:function(d){this.logCounter("twisterPlus.inlineTwister.dimExpand."+d)},logDimExpansionAfterAutoUpdate:function(){this.logCounter("twisterPlus.inlineTwister.dimExpansionAfterAutoUpdate")},logDimValueClickAfterAutoUpdate:function(){this.logCounter("twisterPlus.inlineTwister.dimValueClickAfterAutoUpdate")},
logAvailabilitySlotRender:function(){this.logCounter("twisterPlus.inlineTwister.availabilitySlotRender")},logPPUSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.ppuSlotRender")},logPrimeSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.primeSlotRender")},logPriceSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.priceSlotRender")},logDeliverySlotRender:function(){this.logCounter("twisterPlus.inlineTwister.deliverySlotRender")},logReviewsSlotRender:function(){this.logCounter("twisterPlus.inlineTwister.reviewsSlotRender")}};
return m});"use strict";w.when("A").register("desktop-twister-dynamic-style",function(e){function m(d,e){this.name=d;this.styleNode;this.rules=e||[];this.pendingRefresh}var t=e.$,p={};m.prototype={refresh:function(){var d=t("\x3cdiv /\x3e",{html:"\x26shy;\x3cstyle\x3e"+this.rules.join(" ")+"\x3c/style\x3e"});this.styleNode?(this.styleNode.replaceWith(d),delete this.styleNode,this.styleNode=d):(this.styleNode=d,this.styleNode.appendTo("body"))}};return{addCSSRules:function(d,e){p[d]?p[d].rules=e||
[]:p[d]=new m(d,e);p[d].refresh()}}});"use strict";w.when("A","desktop-twister-constants","desktop-twister-register").register("desktop-twister-slot-manager",function(e,m,t){function p(d,b,a,c){this.twisterCore=d;this.batch={};this.currentBatch;this.maxSlotHeight={};this.minSlotHeight={};this.evenSlotHeight={};this.dynamicStyle=b;this.slotIdentifierMap={};this.logger=a;this.auiPriceSize=c&&c.auiPriceSize?c.auiPriceSize:"m";this.currentlyUnavailableMessage=c&&c.stringTranslationMap?c.stringTranslationMap.currentlyUnavailableMessage:
"";this.desktopTwisterSlots=c&&c.desktopTwisterSlots?c.desktopTwisterSlots:[]}function d(d,b,a,c){b=this.batch;var f=this;b[d]=b[d]||[];b[d].push(a);clearTimeout(this.currentBatch);this.currentBatch=setTimeout(function(){var a=e.map(f.batch,function(a,c){return c});f.twisterCore.slotsDimSum.get(a,function(a){var b=f.batch[a.ASIN];b&&(w.each(b,function(c,b){b(a)}),delete f.batch[a.ASIN]);x(f.batch)&&(b=Object.keys(f.maxSlotHeight),e.each(b,function(a){c(a)}))})},0)}function r(d,b,a,c){a[b]=a[b]||{};
a[b].uniqueCount=a[b].uniqueCount||0;var f="inline-twister-dimsum-loading-"+b+"-"+a[b].uniqueCount;a[b].uniqueCount+=1;return{loadingHtm:'\x3cdiv class\x3d"'+f+(d?c?" loading-indicator-1":" loading-indicator-2":"")+'"\x3e\x3cdiv\x3e\x3c/div\x3e\x3c/div\x3e',promise:function(a){var c=w("."+f+":not(.loading-indicator-in-popover)").parent();c.length&&c.html(a)}}}function q(d){return d.replace(/\n/g,"").replace(/[\t ]+</g,"\x3c").replace(/>[\t ]+</g,"\x3e\x3c").replace(/>[\t ]+$/g,"\x3e")}function y(d,
b){return q(u.default.call(this,d.content.twisterSlotDiv,b))}function z(d,b){if(!d||0===d.length)return b;if(0<d.find(".loading-indicator-1").length)return d[0].scrollHeight;if(0===d.find(".defaultSlotUnavailable").length)return b;d=d[0].scrollHeight;b<d&&(b=d);return b}function x(d){for(var b in d)if(d.hasOwnProperty(b))return!1;return!0}var w=e.$,u={default:function(d,b){d=w("\x3cdiv\x3e"+d+"\x3c/div\x3e");var a=d.find(".price_slot_ppu"),c=d.find("#ms3slot"),f=d.find("#twisterAvailability"),l=d.find("#deliveryPromisePrefix"),
g=d.find(".variationReviewsSection"),k=this.desktopTwisterSlots,e=d.find(".twister_swatch_price"),n=d.find(".apex_on_twister_price");0<f.length&&(0===e.length&&0===n.length?(f.parent().find(".a-size-medium").removeClass("a-size-medium").addClass("a-size-small"),f.parent().find(".a-size-mini").removeClass("a-size-mini").addClass("a-size-small"),f.parent().find(".a-size-large").removeClass("a-size-large").addClass("a-size-small")):-1===k.indexOf("twisterAvailability")&&f.parent().addClass("aok-hidden"),
b&&this.logger.logAvailabilitySlotRender());0<e.length?(-1===k.indexOf("apexPrice")&&e.addClass("aok-hidden"),e.addClass("inline-twister-swatch-price"),f=d.find(".a-price"),0<f.length?f[0].dataset&&(f[0].dataset.aSize=this.auiPriceSize):(e.find(".a-size-small").removeClass("a-size-small").addClass("a-size-base").addClass("a-color-base"),e.find(".a-size-mini").removeClass("a-size-mini").addClass("a-size-base").addClass("a-color-base"),e.find(".a-size-large").removeClass("a-size-large").addClass("a-size-base").addClass("a-color-base")),
f="a-size-small",e.find(".olpWrapper").removeClass("a-size-mini a-size-micro a-size-medium a-size-large a-size-base a-color-base").addClass(f),a.length&&(f="twister-plus-inline-twister-ppu a-size-micro",a.removeClass("a-size-mini a-size-small a-size-medium a-size-large a-size-base a-color-base").addClass(f),b&&this.logger.logPPUSlotRender()),b&&this.logger.logPriceSlotRender()):(e=d.find("#sndbox-mobile-twister-price"),0<e.length&&b&&this.logger.logPriceSlotRender());c.length&&(c.find(".a-icon-mini").removeClass("a-icon-mini").addClass("a-icon-small"),
-1===k.indexOf("ms3")&&c.addClass("aok-hidden"),b&&this.logger.logPrimeSlotRender());0<l.length&&(l.removeClass("a-size-small a-color-secondary").addClass("a-color-base"),-1===k.indexOf("deliveryPromise")&&l.parent().addClass("aok-hidden"),l.find("br").remove(),a=l.find("b"),0===a.length&&(a=l.find("span")),a.length&&(c=" "+q(a.text()),a.addClass("aok-hidden"),l.append('\x3cspan style\x3d"font-weight: bold;"\x3e'+c+"\x3c/span\x3e")),b&&this.logger.logDeliverySlotRender());0<g.length&&(g.removeClass("a-spacing-micro a-spacing-top-micro").addClass("a-spacing-none a-spacing-top-none"),
-1===k.indexOf("variationReviews")&&g.addClass("aok-hidden"),b&&this.logger.logReviewsSlotRender());t.executeModifiers(d);return d.html()}};p.prototype={get:function(e,b,a,c,f){var l=this,g=this.twisterCore.slotsDimSum.get([e]);if(g[e])return y.call(l,g[e].Value,!1);var k=r(a,b,l.slotIdentifierMap,f);d.call(this,e,b,function(a){k.promise(y.call(l,a.Value,!0))},c);return k.loadingHtm},setState:function(d,b,a){this.minSlotHeight[b]||(this.minSlotHeight[b]=[]);this.maxSlotHeight[b]||(this.maxSlotHeight[b]=
[]);this.evenSlotHeight[b]||(this.evenSlotHeight[b]=0);this.minSlotHeight[b][a]=this.minSlotHeight[b][a]||0;this.minSlotHeight[b][a]=z(d,this.minSlotHeight[b][a]);this.maxSlotHeight[b][a]=this.maxSlotHeight[b][a]||0;var c=this.maxSlotHeight[b];var f=this.maxSlotHeight[b][a];!d||0===d.length||0<d.find(".loading-indicator-1").length||(d=d[0].scrollHeight,f<d&&(f=d));c[a]=f;this.maxSlotHeight[b][a]=this.maxSlotHeight[b][a]>this.minSlotHeight[b][a]?this.maxSlotHeight[b][a]:this.minSlotHeight[b][a];this.evenSlotHeight[b]=
this.maxSlotHeight[b][a]>this.evenSlotHeight[b]?this.maxSlotHeight[b][a]:this.evenSlotHeight[b]},updateSlotHeight:function(d){var b=[],a=this.evenSlotHeight[d],c;e.each(this.maxSlotHeight[d],function(f,l){b.push("#inline-twister-expander-content-"+d+" .desktop-twister-dim-row-"+l+" .dimension-slot-info {height: "+a+"px;}");c="twister-plus-desktop-twister-slot-height-"});this.dynamicStyle.addCSSRules(c+d,b)},resetMinSlotHeight:function(d){this.minSlotHeight[d]||(this.minSlotHeight[d]=[]);this.minSlotHeight[d]=
e.map(this.minSlotHeight[d],function(){return 0})},resetSlotHeight:function(d){this.maxSlotHeight[d]=[];this.minSlotHeight[d]=[];this.evenSlotHeight[d]=0;this.dynamicStyle.addCSSRules("twister-plus-desktop-twister-slot-height-"+d,[])}};return p});"use strict";w.when("A").register("desktop-twister-register",function(){var e=[];return{registerModifier:function(m){e.push(m)},executeModifiers:function(m){e.forEach(function(e){e.modify&&"function"===typeof e.modify&&e.modify(m)})}}});"use strict";w.when("A",
"desktop-twister-constants").register("desktop-twister-utils",function(e,m){function t(d,e){for(var q=[],p=0;p<d.length;p++){var r=d[p].val;-1===r&&(r=m.CHAR_ASTERISK);q.push(String(r))}return e?q.join(e):q}function p(d,e){var q={},p=B;if(e){var r=e[m.TWISTER_CURRENT_ASIN],t=e[m.INIT_DATA_DELETED_LANDING_ASIN_INFO];t&&r===t.asin&&(p=t.dimValues)}for(r=0;r<e.dimensions.length;r++)t=e.variationValues[d[r].dimKey][d[r].val],!t&&p&&p[r]&&(t=p[r]),q[r]=t;return q}return{getCurrDimCombId:t,constructEventInfo:function(d,
e,q,w,u,x){var r=e.state(),y={},n={},b=[],a=e.tvm.dimensionList,c=e.tvm.dimensionDisplayText;if("undefined"!==typeof c&&"undefined"!==typeof a)for(var f in a){var l=a[f];b[f]=c[l]}d={dimensionDisplayMap:b,dimensionsMap:d.dimensions,dimensionValuesData:u?u:p(r,d)};y[m.STRING_DIM_COMB_ID]=t(q===m.viewEvents.MOUSE_ENTER&&x?x:r,m.CHAR_UNDERSCORE);y[m.STRING_EVENT_TYPE]=q;n[m.STRING_EVENT_DIV_METADATA]=w;n[m.STRING_EVENT_DIM_INFO]=d;q=m.STRING_DIMENSION_SELECTION_DATA;w=e.util.dimensionMetaData;x=[];for(d=
0;d<e.tvm.dimensionList.length;d++)u={},a=b=0,-1!==r[d].val&&(a=1),w[r[d].dimKey].isRequired&&(b=1),u[m.STRING_IS_REQUIRED]=b,u[m.STRING_IS_SELECTED]=a,x[d]=u;n[q]=x;y[m.STRING_EVENT_DATA]=n;return y},getDimensionValuesData:p}});"use strict";w.when("A","desktop-twister-constants").register("desktop-twister-widgets-factory",function(e,m){var t=e.$,p=m.widgetSelectors,d=m.classes,r=m.cssConstants,q=m.loggingConstants;m=function(){function d(b,a,c){c=c&&0<c.length?c:b.find(".a-button");a?(c.addClass("text-swatch-button-with-slots").removeClass("text-swatch-button"),
b.find("hr").show(),b.find("hr").removeClass("aok-hidden"),b.find(p.SLOT_NODE_SELECTOR).show(),b.find(p.SLOT_NODE_SELECTOR).removeClass("aok-hidden")):(c.removeClass("text-swatch-button-with-slots").addClass("text-swatch-button"),b.find("hr").hide(),b.find("hr").addClass("aok-hidden"),b.find(p.SLOT_NODE_SELECTOR).hide(),b.find(p.SLOT_NODE_SELECTOR).addClass("aok-hidden"))}return{alignTextSwatches:function(b,a){var c=0,d;e.each(b,function(b){if(b.domNode&&(b.isVisible||a)){b.domNode.attr("data-idxInToggleSwatchList");
d=b.domNode;b=d.find(".swatch-title-text-display");b.length&&b[0].style.removeProperty("height");var g=b?b.height():0;c<g&&(c=g);b.length&&(g=parseInt(b.css("line-height")),b.height()<=g&&b.addClass("swatch-title-text-single-line"))}});e.each(b,function(b){b.domNode&&(b.isVisible||a)&&(b.domNode.attr("data-idxInToggleSwatchList"),d=b.domNode,d.find(".swatch-title-text-display").height(c))})},createSwatch:function(b,a,c,f,e,g){var k=!a.unavailable,l=a.isVisible,v=a.selected,m=a.showSlot,n=a.slotHtm;
c="#"+c;if(e.length)return e=e.clone(),e.removeClass("swatch-prototype"),e.attr("data-idxInToggleSwatchList",f),f=e.find(c).attr("id",a.id),e.find(c+"-announce").attr("id",a.id+"-announce"),e.find("input").attr({name:a.name,"aria-labelledby":a.id+"-announce"}),e.find("text"===b?".swatch-title-text-display":"square_image"===b?".swatch-title-text":".swatch-text").text(a.text),k||f.addClass("a-button-unavailable"),v&&f.addClass("a-button-selected"),"text"!==b&&(v=e.find(".swatch-image"),v.addClass("inline-twister-manual-load"),
v.attr({"data-a-image-source":a.image||"",id:"inline-twister-image-"+a.name,alt:a.text})),v=e.find(".dimension-slot-info"),v.length&&(v.attr("id","dimension-slot-info-"+a.name),m?k?0<n.length&&v.html(n):v.html(a.defaultSlotUnavailable):e.find("text"===b?".slots-padding":".dimension-slot-info").addClass("aok-hidden"),"text"===b&&d(e,m,f)),g.append(e),l||e.addClass("aok-hidden"),e},updateSlotSectionInTextSwatch:d,updateSlotSectionInImageSwatch:function(b,a){var c=b.find(p.IMAGE_SWATCH_HORIZONTAL);0===
c.length&&(c=b.find(p.IMAGE_SWATCH_VERTICAL),0===c.length&&(c=b.find(p.IMAGE_SWATCH_WITH_NO_SLOT)));b=b.find(p.IMAGE_SWATCH_FALLBACK);a?(b.addClass("aok-hidden"),c.removeClass("aok-hidden")):(c.addClass("aok-hidden"),b.removeClass("aok-hidden"))}}}();var y=function(m){function b(a,c,b,d,g,e,n){this.id=a.id;this.unavailable=!!a.unavailable;this.selected=!!a.selected;this.showSlot=a.showSlot;this.slotHtm=a.slotHtm;this.isImageSwatch=!c;this.asin=a.asin;this.pageUrl=a.pageUrl;var f=c?"text":a.isCirclularImageSwatch?
"circular_image":"square_image";this.domNode=n?t(n):m.createSwatch(f,a,b,d,g,e);this.isVisible=a.isVisible;this.popoverImage=a.popoverImage;this.isSlotVisible=!0;this.slotNodeIdentifier=c?".slots-padding":".dimension-slot-info";this.title=a.text;this.name=a.name;this.subscribeToHoverEvent(b)}b.prototype={setState:function(a,c,b){this.selected=!!a.selected;this.updateAvailablity(a);this.updateSlotNode(a);this.updateVisibility(a);this.updateSwatchIndexInDomNode(b);return this},getSlotNode:function(){this.slotNode||
(this.slotNode=this.domNode.find(p.SLOT_NODE_SELECTOR));return this.slotNode},updateSlotNode:function(a){this.slotNode||(this.slotNode=this.domNode.find(p.SLOT_NODE_SELECTOR));this.showSlot!==a.showSlot&&((this.showSlot=a.showSlot)?this.domNode.find(this.slotNodeIdentifier).removeClass("aok-hidden"):this.domNode.find(this.slotNodeIdentifier).addClass("aok-hidden"),this.isImageSwatch?m.updateSlotSectionInImageSwatch(this.domNode,this.showSlot):m.updateSlotSectionInTextSwatch(this.domNode,this.showSlot));
this.slotHtm!==a.slotHtm&&(this.slotNode.html(a.slotHtm),this.slotHtm=a.slotHtm)},updateAvailablity:function(a){this.toggleButton||(this.toggleButton=this.domNode.find(p.TOGGLE_BUTTON_SELECTOR));(this.unavailable=a.unavailable)?this.toggleButton.addClass(d.A_BUTTON_UNAVAILABLE):this.toggleButton.removeClass(d.A_BUTTON_UNAVAILABLE)},updateSelection:function(){this.toggleButton||(this.toggleButton=this.domNode.find(p.TOGGLE_BUTTON_SELECTOR));this.selected?(this.toggleButton.addClass(d.A_BUTTON_SELECTED),
this.toggleButton.removeClass(d.A_BUTTON_UNAVAILABLE)):(this.toggleButton.removeClass(d.A_BUTTON_SELECTED),this.toggleButton.removeClass(d.A_BUTTON_FOCUS))},updateVisibility:function(a){a.isVisible?this.domNode.removeClass(d.AOK_HIDDEN):this.domNode.addClass(d.AOK_HIDDEN);this.isVisible=a.isVisible},subscribeToHoverEvent:function(a){a="desktop-twister-swatch-hover:"+a;try{e.declarative.remove(this.domNode,a),e.declarative.create(this.domNode,a,{})}catch(c){w.log("Hover event subscribe failed with error: "+
this.name,q.ERROR,q.ATTRIBUTION)}},updateSwatchIndexInDomNode:function(a){this.domNode&&this.domNode.attr("data-idxInToggleSwatchList",a)},getTopPosition:function(){var a=this.domNode.position();return this.topPosition=a?a.top:0}};return b}(m),z=function(m,b){function a(a,b,d,g){var c=this;this.isTextSwatch=a.isTextSwatch;this.name=a.name;this.domNode=t(p.EXPANDER_CONTENT_PREFIX+a.name);this.title=g;this.selectedSwatch=null;this.swatches={};this.orderedSwatchList=[];this.initialVisibleSwatchList=
{};this.swatchIdxOrder=[];this.isPageRefreshActive=!1;this.totalSwatchCount=a.totalSwatchCount||0;this.onChange=a.onChange;this.hoverHandler=a.onHover;this.isUserInteracting=!1;this.autoNotificationCallback=b.autoNotificationCallback;this.rowContainer=d;this.swatchListContainer=this.domNode.find(p.DIMENSION_VALUES_LIST);this.markAutoUpdated=!1;this.windowResizeCallback=b.windowResizeCallback;this.preserveNaturalSwatchOrder=a.preserveNaturalSwatchOrder;this.displaySwatches=[];this.numberOfSwatchesPerRow=
0;this.swatchPrototypeNode=t("#"+a.name).closest(p.SWATCH_NODE_SELECTOR);this.swatchPrototypeNodeParent=this.swatchPrototypeNode.parent();e.on("a:button-group:"+this.name+":toggle",function(a){var b=parseInt(a.selectedButton.buttonName,10),d=c.swatches[b];d?c.isPageRefreshActive?(c.isUserInteracting=!0,b=d.unavailable,d.updateSelection(),c.autoNotificationCallback&&c.autoNotificationCallback(b,!0),c.onChange&&c.onChange(c.swatches,a.selectedButton,c.markAutoUpdated),c.setAutoUpdated(!1)):d.pageUrl&&
(u.location.href=d.pageUrl):(a="Selected swatch not found on toggle button click. Value clicked: "+b+" ; Swatch length: "+Object.keys(c.swatches).length,w.log(a,q.ERROR,q.ATTRIBUTION))});this.registerHoverDeclarative("desktop-twister-swatch-hover:"+a.name);if(this.isTextSwatch)e.on("resize",function(){0<c.displaySwatches.length&&(c.repopulateDisplaySwatches(),c.alignTextSwatches(),"function"===typeof c.windowResizeCallback&&c.windowResizeCallback(c.name))})}a.prototype={setState:function(a,d,l){var c=
this,f,m=[],v=[],n=[];e.objectIsEmpty(d)||(e.each(d,function(d,f){if(!c.swatches[f]&&a.swatches[f].isVisible){var e=new b(a.swatches[f],c.isTextSwatch,c.name,f,c.swatchPrototypeNode,c.swatchPrototypeNodeParent);e.subscribeToHoverEvent(c.name);c.swatches[f]=e;!c.isTextSwatch&&c.swatches[f]&&c.swatches[f].domNode&&n.push(c.swatches[f].domNode.find(".inline-twister-manual-load")[0])}v[d]=f}),this.swatchIdxOrder=v,l||(this.resetToggleSwatchContainer(),this.displaySwatches=[]),e.each(this.swatchIdxOrder,
function(a,b){if(a=c.swatches[a])a&&c.swatchListContainer.append(a.domNode),a&&a.subscribeToHoverEvent(c.name),c.addToDisplaySwatches(a,c.displaySwatches)}));e.each(a.swatches,function(a,d){c.swatches[d]?(f=a.selected?c.swatches[d]:f,c.swatches[d].selected=!!a.selected,m.push({index:d,data:a})):(a.isVisible&&(c.swatches[d]=new b(a,c.isTextSwatch,c.name,d,c.swatchPrototypeNode,c.swatchPrototypeNodeParent),c.swatches[d].subscribeToHoverEvent(c.name),c.addToDisplaySwatches(c.swatches[d],c.displaySwatches),
!c.isTextSwatch&&c.swatches[d]&&c.swatches[d].domNode&&n.push(c.swatches[d].domNode.find(".inline-twister-manual-load")[0])),a.selected&&(f=c.swatches[d]))});this.selectedSwatch&&this.selectedSwatch.updateSelection();f&&f.updateSelection();e.each(m,function(a,b){c.swatches[a.index].setState(a.data,c.name,a.index)});this.isTextSwatch&&(e.objectIsEmpty(d)||this.alignTextSwatches());c.selectedSwatch&&f&&c.selectedSwatch!==f&&!c.isUserInteracting&&c.autoNotificationCallback(!0);c.selectedSwatch=f;c.isUserInteracting=
!1;n.length&&e.loadImageManually(n);return this},getSlotNodes:function(){return e.map(this.displaySwatches,function(a){return e.map(a,function(a){return a.getSlotNode()})})},alignTextSwatches:function(a){e.each(this.displaySwatches,function(c){m.alignTextSwatches(c,a)})},resetToggleSwatchContainer:function(){var a=t(this.domNode.find(".a-button-list").children()[0]);this.swatchListContainer.html("");this.swatchListContainer.append(a)},setAutoUpdated:function(a){this.markAutoUpdated=a},getInitialVisibleSwatchList:function(){return this.initialVisibleSwatchList},
getNumberOfSwatchesPerRow:function(){return this.numberOfSwatchesPerRow},setNumberOfSwatchesPerRow:function(a){a&&(this.numberOfSwatchesPerRow=a)},createSwatch:function(a,d){d=new b(a,this.isTextSwatch,this.name,a.name,this.swatchPrototypeNode,this.swatchPrototypeNodeParent,d);this.swatches[a.name]=d;this.initialVisibleSwatchList[a.name]=d;this.selectedSwatch=a.selected?d:this.selectedSwatch;this.orderedSwatchList.push(d);return d},registerHoverDeclarative:function(a){var c=this;e.declarative(a,"mouseenter mouseleave",
function(a){var b=a.$currentTarget[0].getAttribute("data-idxInToggleSwatchList");b=c.getSwatch(b);a.data={slotNode:a.$currentTarget.find(b.slotNodeIdentifier),showImageInPopOver:b.isImageSwatch&&!!b.popoverImage,unavailable:b.unavailable,showSlot:b.showSlot,selected:b.selected,title:b.title,name:b.name,id:b.id,image:b.popoverImage};c.hoverHandler(c.name,a)})},activatePageRefresh:function(){this.isPageRefreshActive=!0;this.domNode.find(".page-load-link").remove()},getSwatch:function(a){return this.swatches[a]?
this.swatches[a]:{}},addToDisplaySwatches:function(a,b){var c=a.domNode[0].getBoundingClientRect();if(0===b.length)b.push([a]);else{var e=b[b.length-1],f=e[0].domNode[0].getBoundingClientRect();c.top===f.top?e.push(a):b.push([a])}this.removeSwatchRowIdentifier(a);c=d.ROW_IDENTIFIER_PREFIX;a.domNode&&a.domNode.addClass(c+(b.length-1).toString())},repopulateDisplaySwatches:function(){if(0!==this.displaySwatches.length){var a=[],b=0,l,g=this;e.each(this.displaySwatches,function(c,f){e.each(c,function(c,
e){0===a.length?a.push([c]):0===b?(l=a[0][a[0].length-1],c.getTopPosition()!==l.getTopPosition()?(b=a[0].length,g.numberOfSwatchesPerRow=b,g.addToDisplaySwatches(c,a)):(a[0].push(c),g.removeSwatchRowIdentifier(c),c.domNode&&c.domNode.addClass(d.ROW_IDENTIFIER_PREFIX+(0).toString()))):g.addToDisplaySwatches(c,a)})});0===b&&(this.numberOfSwatchesPerRow=b=a[0].length);this.displaySwatches=a}},removeSwatchRowIdentifier:function(a){a.domNode&&a.domNode.removeClass(function(a,b){return(b.match(/(^|\s)desktop-twister-dim-row-\S+/g)||
[]).join(" ")})},createDisplaySwatches:function(){var a=this;e.each(this.orderedSwatchList,function(b){a.addToDisplaySwatches(b,a.displaySwatches)})},removeMisplacedSwatch:function(){var a=this.displaySwatches[this.displaySwatches.length-1],b=a[a.length-1],d=b.name;b.domNode&&b.domNode.remove();delete this.swatches[d];this.selectedSwatch&&this.selectedSwatch.name===d&&(this.selectedSwatch=null);1<a.length?a.pop():this.displaySwatches.pop()}};return a}(m,y),x=function(d){function b(a){this.mainText=
a.mainText;this.subText=a.subText;this.dimKey=a.dimKey;this.titleSelectorPrefix=a.titleSelectorPrefix;this.titleValueSelector=a.titleValueSelector;this.domNode=t("#"+this.titleSelectorPrefix+this.dimKey)}b.prototype={refresh:function(){this.domNode.find("."+this.titleValueSelector).text(this.subText);this.domNode.removeClass("twister-plus-inline-twister-dim-required twister-plus-inline-twister-dim-required-delay")},setState:function(a){return e.equals(a,t.extend({},this))?this:(t.extend(this,a),this.refresh())},
getData:function(){return{mainText:this.mainText,subText:this.subText}}};return b}(m),I=function(m,b,a){function c(a,c,g,k,m){function f(){n=n||l.domNode.find(".dimension-heading");n.css(r.BG_COLOR,r.GREEN_BG_COLOR);e.delay(function(){e.animate(n,{"background-color":r.WHITE_BG_COLOR},200)},1E3)}var l=this;this.stringTranslationMap=g.inlineTwisterData?g.inlineTwisterData.stringTranslationMap:{};this.title=c?new b(c):null;this.dimKey=g.dimKey;this.domNode=t("#"+a+this.dimKey);this.showSlot=g.showSlot;
this.logger=m;this.expanderContent=l.domNode.find(p.EXPANDER_CONTENT_PREFIX+this.dimKey);this.rowCallbacks=k;this.autoNotificationExpanded=l.domNode.find(p.AUTO_NOTIFICATION_EXPANDED);this.autoNotificationExpandedText=l.autoNotificationExpanded.text();var n;this.autoNotificationCallback=function(a,b){var c=l.autoNotificationExpandedText;a?l.isExpanded&&b?(l.autoNotificationExpanded.find("."+d.A_COLOR_ATTAINABLE).html(c),l.autoNotificationExpanded.removeClass(d.AOK_HIDDEN)):(f(),l.setAutoUpdated(!0)):
l.hideAutoNotification()}}c.prototype={setState:function(a,b,c,d,e){a&&this.toggleSwatch&&this.toggleSwatch.setState(a,b,e);d&&this.title&&this.title.setState(d)},getInitialVisibleSwatchList:function(){return this.toggleSwatch?this.toggleSwatch.getInitialVisibleSwatchList():{}},activatePageRefresh:function(){this.toggleSwatch&&this.toggleSwatch.activatePageRefresh()},setAutoUpdated:function(a){this.markAutoUpdated=a;this.toggleSwatch&&this.toggleSwatch.setAutoUpdated(a)},hideAutoNotification:function(){this.autoNotificationExpanded.addClass(d.AOK_HIDDEN)},
createDisplaySwatches:function(){this.toggleSwatch&&this.toggleSwatch.createDisplaySwatches()},initializeComponents:function(b,c,d){if(!this.toggleSwatch&&b){var f=this.title.getData();this.toggleSwatch=new a(b,{windowResizeCallback:d.handleWindowResize,autoNotificationCallback:this.autoNotificationCallback},this.domNode,f.mainText)}this.isTextSwatch=b?b.isTextSwatch:!0;this.rowCallbacks=e.extend(this.rowCallbacks,d);this.totalSwatchCount=b?b.totalSwatchCount:0;this.showSlot=c},postInitialize:function(){this.isTwisterCoreInitialized=
!0;this.rowCallbacks.handleDimensionExpansion({dimKey:this.dimKey},this.showSlot,!0)}};return c}(m,x,z),Q=function(){w.when("A","a-dropdown","desktop-twister-constants").register("desktop-twister-dropdown",function(d,b,a){w.when("a-dropdown-handlers").execute("mark-dropdown-interactive-time",function(){"function"===typeof u.markFeatureInteractive&&u.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"dropdown"}]})});return function(c,e){function f(){var b=a.DROPDOWN_DIV_NAME+k.dimKey;
var c=function(b){var c={};c[a.STRING_DIM_KEY]=k.dimKey;b=b?b.value:B;c[a.STRING_DIM_VALUE_INDEX]=b?parseInt(b.split(",")[0]):B;k.dropdownChange(c)};w.when("A").execute(function(d){d.on(a.AUI_DROPDOWN_EVENT_PREFIX+b,c)})}function g(a,b){var c;d.each(a,function(a,d){a===b&&(c=d)});return c}var k=this,m=d.$;k.dimType=a.TWISTER_DIMENSION_VIEW_DROPDOWN;k.AuiDropdownHandle=b;k.dimKey;k.dimStyleData;k.dimMap;k.dimNameDisplayString;k.dimValuesDisplayData;k.dropdownChange;k.unavailableString;k.currentlyUnavailableString;
k.domNode;k.dimType=a.TWISTER_DIMENSION_VIEW_DROPDOWN;k.optionsUpdatedOnLanding=!1;k.initialize=function(b){k.dimKey=e[a.STRING_DIM_NAME];k.dimMap=c.dimensions;k.dimNameDisplayString=c.variationDisplayLabels[k.dimKey];k.dimValuesDisplayData=c.variationValues[k.dimKey];k.dropdownChange=b.onDropdownChange;k.displayConfigStylesData=c[a.STRING_DISPLAY_CONFIG_STYLES_DATA];k.unavailableString=c[a.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];k.currentlyUnavailableString=c[a.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE];
f()};k.activatePageRefresh=function(){this.isPageRefreshActive=!0;if("undefined"!==typeof TwisterNonJs)for(var a=u.TwisterNonJs.handleDropDown.length,b=0;b<a;b++)u.TwisterNonJs.handleDropDown[b]=function(){}};k.updateView=function(b){switch(b[a.STRING_EVENT_TYPE]){case a.viewEvents.DROPDOWN_CHANGE:case a.viewEvents.CLICK:case a.viewEvents.TWISTER_REFRESH:var d=a.ID_SELECTOR+k.dimKey+a.CHAR_UNDERSCORE+a.INDEX_FOR_SELECT_OPTION;var f=a.NATIVE_DROPDOWN_DIV_PREFIX+a.DROPDOWN_DIV_NAME+k.dimKey,l=m(f).val().split(",")[0],
h=b[a.STRING_EVENT_TYPE];var n=b.eventData.dimensionSelectionData;b=b&&b.dimCombID?b.dimCombID:e.currDimCombId;var p=g(k.dimMap,k.dimKey);var q=k.dimValuesDisplayData.length;var r=k.displayConfigStylesData,t=b.split("_");b=[];for(var w=t.slice(0),u,v,x=0;x<q;x++){v={};if(t[p]===x.toString())u=a.STYLE_CLASS_TYPE_FOR_SELECTED;else{w[p]=x;u=w.join("_");var y=!0;c.dimensionToAsinMap[u]||(y=!1);u=(u=y)?a.STYLE_CLASS_TYPE_FOR_AVAILABLE:a.STYLE_CLASS_TYPE_FOR_INVALID}u=r.dropdown[u];v.style=u;b[x]=v}n&&
0===n[p][a.STRING_IS_SELECTED]&&l!==a.INDEX_FOR_SELECT_OPTION&&"undefined"!==typeof k.AuiDropdownHandle&&k.AuiDropdownHandle.getSelect(f).val("-1");h!==a.viewEvents.CLICK&&h!==a.viewEvents.DROPDOWN_CHANGE||0!==n[p][a.STRING_IS_REQUIRED]||1!==n[p][a.STRING_IS_SELECTED]||m(d).remove();l=0;for(h=b.length;l<h;l++)if(n=b[l],d=a.NATIVE_DROPDOWN_DIV_PREFIX+k.dimKey+a.CHAR_UNDERSCORE+l,p=n[a.STRING_STYLE],n=m(d).get(0).className,p===a.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&(q=m(d).attr("value"),m(f).val()!==
q&&k.AuiDropdownHandle.getSelect(f).val(q)),n!==p||n===a.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION)try{q={};n!==p&&(q[a.STRING_CSS_CLASS]=p,q[a.STRING_NATIVE_CSS_CLASS]=p);var z=q;0!==Object.keys(z).length&&k.AuiDropdownHandle.updateOption(d,z)}catch(R){}}}}})}();return{Swatch:y,ToggleSwatch:z,Title:x,Row:I,utils:m,Dropdown:Q}})});
/* ******** */
(function(m){var n=window.AmazonUIPageJS||window.P,p=n._namespace||n.attributeErrors,g=p?p("TwisterCoreAsset",""):n;g.guardFatal?g.guardFatal(m)(g,window):g.execute(function(){m(g,window)})})(function(m,n,p){m.when("twister-variation-matrix","twister-dim-util","twister-state-machine","twister-metadata","twister-view-controller","twister-dispatcher","twister-actions","twister-slots-dimsum","twister-dimsum").register("TwisterCore",function(g,l,f,e,a,b,c,d,k){function h(c,h){this.tvm=new g(c);this.util=
new l(this.tvm);this.tsm=new f(this.tvm,this.util,c.initDimCombination);this.dimSum=new k(c.config.ajaxTimeout,c.config.ajaxUrlParams,c.config.deviceType,h);this.slotsDimSum=new d(c.config.ajaxTimeout,c.config.ajaxUrlParams,c.config.deviceType);var q=this;b.registerStore("twister-state-machine",function(b,c){q.tsm.accept(b,c).THEN(function(c){a.publishView(b,c)}).ELSE()});var u=new e;b.registerStore("twister-metadata",function(b,c){u.process(b,c,function(c){a.publishView(b,c)})})}function q(a,d){var k=
a.viewAttribution+"_"+a.viewName+"_"+d;return function(a){try{var h=c.create(d,a);b.dispatch(d,h)}catch(e){n.ueLogError&&n.ueLogError(e,{logLevel:"ERROR",attribution:"Twister_view_"+k,message:"This error is caused by the Twister view - "+k+" while updating the TwisterCore"})}}}h.prototype={registerActive:function(b,c){a.register(b.viewAttribution+"_"+b.viewName,!0,c.updateView);return{dimensionChanged:q(b,"VARIATION_CHANGE"),dimensionPeek:q(b,"VARIATION_PEEK"),metaData:q(b,"METADATA")}},registerPassive:function(b,
c){a.register(b.viewAttribution+"_"+b.viewName,!1,c.updateView);return{metaData:q(b,"METADATA")}},state:function(){return this.tsm.currentState().selected().selectionInfo()}};return h});"use strict";m.when("A").register("twister-actions",function(g){var l=g.$,f={VARIATION_CHANGE:function(e){return e=l.isArray(e)?e:[e]},VARIATION_PEEK:function(e){return e},VARIATION_SEQUENCE_ALTER:function(){},INIT_SEQUENCE_ALTER_DATA:function(e){return e},METADATA:function(e){return e}};return{create:function(e,a){return f[e]?
f[e](a):!1}}});"use strict";m.when("A","publisherSubscriber").register("twister-dispatcher",function(g,l){function f(){f=1;return this}var e=g.$,a=new l,f=0,b=[];return{registerStore:function(b,d){a.register(b,d);return this},deregisterStore:function(b){a.deRegister(b);return this},dispatch:function(c,d){f?b.push(arguments):a.publish(c,d);return this},hold:f,release:function(){e.each(b,function(b,d){a.publish.apply(a,d)});f=0;return this}}});"use strict";m.when("A","publisherSubscriber").register("twister-view-controller",
function(g,l){function f(){e?a.push(arguments):(e=1,b.publish.apply(b,arguments),c.publish.apply(c,arguments),e=0,a.length&&f.apply(this,a.shift()));return this}var e=0,a=[],b=new l,c=new l;return{register:function(a,k,h){k?b.register(a,h):c.register(a,h);return this},deRegister:function(a,k){k?b.deRegister(a):c.deRegister(a);return this},publishView:f}});"use strict";m.when("A").register("twister-dimsel-api",function(g){function l(e){var a=this;this.dimSelectionMap={};this.selInfo=e;f.each(e,function(b,
c){a.dimSelectionMap[c.dimKey]=c.val})}var f=g.$;l.prototype={matches:function(e){e=e.selectionInfo();for(var a=0;a<e.length;a++){var b=e[a].dimKey;if(!(b in this.dimSelectionMap)||this.dimSelectionMap[b]!==e[a].val)return!1}return!0},selectionInfo:function(){return g.copy(this.selInfo)}};return l});"use strict";m.when("A","twister-dimsel-api").register("twister-dim-util",function(g,l){function f(a){this.tvm=a;this.dimensionMetaData={};var b=[];a=a.dimensionInfo;for(var c=0;c<a.length;c++){b.push(a[c].dimKey);
var d={};d.isRequired=a[c].isRequired;d.isSingleton=a[c].isSingleton;d.dimOrder=c;d.size=a[c].size;this.dimensionMetaData[a[c].dimKey]=d}}var e=g.$;f.prototype={createSelectionInfo:function(a){return new l(a)},extendSelectionInfo:function(a,b,c){var d=c||0===c,k={},h=[];e.each(b.selectionInfo(),function(b,a){k[a.dimKey]=a.val});e.each(a.selectionInfo(),function(b,a){b=a.dimKey;a=d?c:a.val;b in k&&(a=k[b]);h.push({dimKey:b,val:a})});return new l(h)},createNextDimSelection:function(a,b){var c=[],d=
b.selectionInfo(),k=this;e.each(a.split(":"),function(b,a){var e=d[b].dimKey;a=parseInt(a,10);k.dimensionMetaData[e].isRequired&&a!==d[b].val&&(a=-1);c.push({dimKey:e,val:a})});return new l(c)},getDimScore:function(a,b){var c=0,d=a.split(":"),k=this;e.each(b.selectionInfo(),function(b,a){var e=a.dimKey;a=a.val;var f=parseInt(d[b],10);b=d.length-b;a===f?(c+=200*b,k.dimensionMetaData[e].isRequired&&(c+=2E4)):c+=100-Math.round(Math.abs(a-f)/k.dimensionMetaData[e].size*100)});return c},isSingletonDim:function(a){return this.dimensionMetaData[a]?
this.dimensionMetaData[a].isSingleton:!1},isRequiredDim:function(a){return this.dimensionMetaData[a]?this.dimensionMetaData[a].isRequired:!1},getDimensionInfo:function(){return this.tvm.dimensionInfo},getDimAvailability:function(a,b){b=b.selectionInfo?b:this.createSelectionInfo(b);var c=[],d=[],k=this.tvm.dimensionList,h=this.tvm.dimtoValueMap[a],f=this.createSelectionInfo([{dimKey:a,val:-1}]);b=this.tvm.fetch(this.extendSelectionInfo(b,f).selectionInfo());var g={},l=this;e.each(b,function(b,c){g[c.split(":")[k.indexOf(a)]]=
l.tvm.dimCombinations[c]});e.each(h,function(b,a){b in g?c.push({index:b,asin:g[b],label:a}):d.push({index:b,label:a})});return{available:c,unavailable:d}},getUnselectedDims:function(a){var b={};e.each(a,function(a,c){b[c.dimKey]=c.val});a=[];var c=this.tvm.dimensionList,d;for(d in c)if(c.hasOwnProperty(d)){var k=c[d];if(b[k]===p||-1===b[k])this.isSingletonDim(k)?b[k]=0:a.push(k)}return a},showDimSum:function(a,b){b=this.getUnselectedDims(b);return!b||0===b.length||1===b.length&&b[0]===a?1:0},isFullySelected:function(a){var b=
!0;"string"===typeof a&&(a=this.getSelectionInfoFromDimComb(a));a=a.selectionInfo?a.selectionInfo():a;if(a.length!=this.tvm.dimensionList.length)return!1;e.each(a,function(a,d){-1===d.val&&(b=!1)});return b},createDimensionSelectionMap:function(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];b[d.dimKey]=d.val}return b},getSelectedDimKeys:function(a){var b=this.tvm.dimensionList,c=[],d;for(d in b)if(b.hasOwnProperty(d)){var e=a[b[d]];"undefined"===typeof e||-1==e?c.push("*"):c.push(e)}return c},
getValidDimCombination:function(a,b){var c,d=this,k=0,h=0;a=this.tvm.fetch(a);e.each(a,function(a,e){h=d.getDimScore(e,b);h>k&&(c=a,k=h)});return a[c]},getAsinFromSelectionInfo:function(a,b){var c;"undefined"==typeof b||b?a=this.createDimensionSelectionMap(a):(c=g.copy(a),a=this.getValidDimCombination(c,this.createSelectionInfo(a)),"undefined"!=typeof a&&e.each(a.split(":"),function(b,a){a=parseInt(a,10);c[b].val=a}),a=this.createDimensionSelectionMap(c));a=this.getSelectedDimKeys(a).join(":");return this.tvm.dimCombinations[a]},
getSelectionInfoFromSelectedVariationValuesMap:function(a){var b=[],c;for(c in this.tvm.dimensionList){var d={},e=this.tvm.dimensionList[c];d.dimKey=e;d.val=a[e];b.push(d)}return b},getSelectionInfoFromDimComb:function(a){var b=[];a=a.split("_");for(var c in this.tvm.dimensionList){var d={},e=a[c];d.dimKey=this.tvm.dimensionList[c];d.val="X"===e||"*"===e?-1:parseInt(e,10);b.push(d)}return b},getDimensionDisplayText:function(a){return this.tvm.dimensionDisplayText[a]},getDimensionValueFromIndex:function(a,
b){return(this.tvm.dimtoValueMap[a]||[])[b]},getSelectionInfoFromDimIndexAndValue:function(a,b){var c=[],d={};d.dimKey=this.tvm.dimensionList[a];d.val="X"===b||"*"===b?-1:parseInt(b,10);c.push(d);return c},predictNextState:function(a,b){var c=this.extendSelectionInfo(a,b);if(function(b){var a;e.each(b.selectionInfo(),function(b,c){a=-1===c.val});return a}(b)||this.tvm.exists(c.selectionInfo()))return c;a=this.extendSelectionInfo(a,b,-1);a=this.tvm.fetch(a.selectionInfo());for(var d=b=0,k,h=0;h<a.length;h++)d=
this.getDimScore(a[h],c),d>b&&(k=h,b=d);k=a[k];return"undefined"!=typeof k?this.createNextDimSelection(k,c):c},getAsinToCorrespondingDimensionIndexMap:function(a){var b={};e.each(this.tvm.dimCombinations,function(c,d){b[d]=parseInt(c.split(":")[a-1])});return b}};return f});"use strict";m.when("A","twister-core-store-utils","dp-sort-filter-api").register("variations-reorder",function(g,l,f){return function(e){function a(b){return"undefined"!==typeof b&&"undefined"!==typeof g?(k=g.alterSequence(b),
!0):!1}function b(b){if("undefined"!==typeof b&&"undefined"!==typeof b.alterData){var a=e.getDefaultAsinList();d=b.slotRowNumber?b.slotRowNumber:p;h=e.getAsinToCorrespondingDimensionIndexMap(d);g=new c.SortFilterMain(b.alterData,a,h);return!0}return!1}var c=this,d,k=[],h={};this.StoreUtils=l;this.SortFilterMain=f;var g;this.accept=function(c,d){switch(c){case "VARIATIONS_REORDER":c=this.StoreUtils.branch(a(d),this.getReorderedAsinsList);break;case "UPDATE_VARIATIONS_REORDER_DATA":c=this.StoreUtils.branch(b(d));
break;default:c=this.StoreUtils.branch(!1)}return c};this.getReorderedAsinsList=function(){return k}}});"use strict";m.when("A","url-builder").register("twister-dimsum",function(g,l){function f(a,b,c,d){this.cache;d&&(this.cache=new d);this.ajaxTimeout=a;this.batchLimit=10;this.ajaxUrlParams=b;this.ajaxUrl="/gp/product/ajax?asinList\x3d###asinString###\x26vs\x3d1\x26experienceId\x3dtwisterDimensionSlotsSecondaryView\x26asin\x3d###asin###"+(b||"");this.ajaxUrl=c?this.ajaxUrl+("\x26deviceType\x3d"+
c):this.ajaxUrl+("\x26deviceType\x3d"+(g.capabilities.isAmazonApp?"mobileApp":"mobile"));(a=g.state("pwState"))&&a.isTryState&&(this.ajaxUrl=l.addUrlParams(this.ajaxUrl,{isTryState:"true"}))}var e=g.$;f.prototype={get:function(a,b,c){function d(b){var a=b-this.batchLimit;0<a&&d.call(this,a);if(b=l.slice(0>a?0:a,b).join(","))a=new URLSearchParams(this.ajaxUrlParams),a=a.get("parentAsin")?a.get("parentAsin"):null,b=this.ajaxUrl.replace("###asinString###",b).replace("###asin###",a),g.ajax(b,{chunk:k,
timeout:this.ajaxTimeout})}function k(a){if(a)for(var d in a){if(a.hasOwnProperty(d)){var e=a[d];if(e&&e.asin){if(f){var k=h(e.asin,c);f.put(k,e)}b&&b(e)}}}else m.log("Twister slots returning empty response for secondary view.","FATAL")}function h(b,a){var c=b;g.objectIsEmpty(a)||(c={asin:b},e.extend(!0,c,a));return c}var f=this.cache,l=[],n={};e.each(a,function(a,d){a=h(d,c);f&&f.get(a)?b?b(f.get(a)):n[d]=f.get(a):l.push(d)});if(!b)return n;d.call(this,l.length)}};return f});"use strict";m.when("A").register("twister-slots-dimsum",
function(g){function l(a,c,d){this.cache=e;this.ajaxTimeout=a;this.batchLimit=8;this.ajaxUrlParams=c;this.ajaxUrl="/gp/product/ajax?isDimensionSlotsAjax\x3d1\x26asinList\x3d###asinString###\x26vs\x3d1\x26experienceId\x3dtwisterDimensionSlotsDefault\x26asin\x3d###asin###\x26quantity\x3d###quantity###"+(c||"");d&&(this.ajaxUrl+="\x26deviceType\x3d"+d);this.defaultQuerryParamsObj={};this.defaultAddedQueryParamString=""}var f=g.$,e={},a={};l.prototype={get:function(b,c){function d(a){a=new URLSearchParams(a);
return a.get("landingAsin")?a.get("landingAsin"):null}function e(){var a=new URLSearchParams(n.location.search),a=parseInt(a.get(v.WEBSITE_URL_QUANTITY_PARAM_KEY));return isNaN(a)||1>a||a>v.MAX_SUPPORTED_ASIN_QTY?1:a}function h(a){var b=a-this.batchLimit,c="",f=[];0<b&&h.call(this,b);f=t.slice(0>b?0:b,a);f=f.map(function(a){return encodeURIComponent(a)});if(c=f.join(","))a=d(this.ajaxUrlParams),b=e(),c=this.ajaxUrl.replace("###asinString###",c),c=1!==b?c.replace("###quantity###",b):c.replace("\x26quantity\x3d###quantity###",
""),c=a?c.replace("###asin###",a):c.replace("###asin###",f[0]),c+="\x26"+this.defaultAddedQueryParamString,g.ajax(c,{chunk:w.bind(this),timeout:this.ajaxTimeout,cache:!0,error:l.apply(null,f)})}function l(){var b=arguments;return function(){g.each(b,function(b){delete a[b]})}}function w(b){if(b&&b.ASIN){var d=b.ASIN;r[d]=b;for(c&&c(b);a[d]&&a[d].length;)a[d].pop()(b);delete a[d]}else m.log("Twister slots returning empty response.","FATAL","undefined"!=typeof this.defaultQuerryParamsObj?this.defaultQuerryParamsObj.twisterFlavor:
p)}var r=this.cache,t=[],u={},v={WEBSITE_URL_QUANTITY_PARAM_KEY:"qty",MAX_SUPPORTED_ASIN_QTY:999};f.each(b,function(b,d){r[d]?c?c(r[d]):u[d]=r[d]:a[d]&&c?a[d].push(c):c&&(t.push(d),a[d]=[])});if(!c)return u;t.length&&h.call(this,t.length)},addDefaultQueryParameter:function(a,c){var d=!1;c!==p&&(this.defaultQuerryParamsObj[a]=c,this.defaultAddedQueryParamString=f.param(this.defaultQuerryParamsObj),d=!0);return d},getBatchSize:function(){return 8}};return l});"use strict";m.register("twister-metadata",
function(){function g(){this.config={}}g.prototype={process:function(g,f,e){"METADATA"===g&&e(f)}};return g});"use strict";m.when("A").register("publisherSubscriber",function(g){function l(){this.Subscribers=[];this.Names=[]}var f=g.$;l.prototype={register:function(e,a){if(-1<g.indexOfArray(this.Names,e))return!1;this.Names.push(e);this.Subscribers.push({name:e,handler:a})},deRegister:function(e){var a=g.indexOfArray(this.Names,e),b=this,c=function(a,c){if(a.name===e)return b.Subscribers.splice(c,
1),!0};return-1<a?(this.Names.splice(a,1),[].some?this.Subscribers.some(c):f.each(this.Subscribers,function(a,b){c(b,a)}),!0):!1},publish:function(){var e=arguments;f.each(this.Subscribers,function(a,b){setTimeout(function(){b.handler.apply(null,e)},0)})}};return l});"use strict";m.when("jQuery").register("twister-state-machine",function(g){return function(g,f,e){function a(a,b){this.selected=function(){return a};this.peek=function(){return b}}function b(a,b){return{THEN:function(c){a&&c&&c(b());
return this},ELSE:function(c){a||c&&c(b());return this}}}var c,d;this.accept=function(e,h){switch(e){case "VARIATION_PEEK":var g=f.createSelectionInfo(h);e=c();e.peek().matches(g)?h=!1:(-1===h.val?h=new a(c.selected(),c.selected()):(h=f.predictNextState(e.peek(),g),h=new a(e.selected(),h)),d=h,h=!0);h=b(h,this.currentState);break;case "VARIATION_CHANGE":e=c();h=f.createSelectionInfo(h);g=f.getDimensionInfo();e.selected().matches(h)?h=!1:(h=h.selectionInfo().length!==g.length?f.predictNextState(e.selected(),
h):h,d=new a(h,h),h=!0);h=b(h,this.currentState);break;default:h=b(!1)}return h};c=this.currentState=function(){return d};d=new a(f.createSelectionInfo(e),f.createSelectionInfo(e))}});"use strict";m.register("twister-core-store-utils",function(g){return{branch:function(g,f){return{THEN:function(e){if(g&&e){var a=f?f():g;e(a)}return this},ELSE:function(e){if(!g&&e){var a=f?f():g;e(a)}return this}}}}});"use strict";m.when("A").register("twister-variation-matrix",function(g){function l(b){b=g.copy(b);
var c=this;this.dimCombinations=b.dimCombinations;this.validCombinatonString=" "+g.keys(b.dimCombinations).join("  ")+" ";this.dimensionInfo=b.dimensionInfo;this.dimensionList=b.dimensionList;this.dimensionDisplayText=b.dimensionDisplayText;this.config=b.config;this.dimInfoMap={};a.each(this.dimensionInfo,function(a,b){var e=b.dimKey,f={};f.size=b.size;f.dimOrder=a;c.dimInfoMap[e]=f});this.dimtoValueMap=b.dimtoValueMap}function f(b){b=a.map(b,function(a){a=a.val;return-1===a?"\\d+":""+a}).join(":");
return new RegExp("\\s"+b+"\\s","gm")}function e(b){return a.map(b,function(a){return""+a.val}).join(":")}var a=g.$;l.prototype={fetch:function(b){b=f(b);b=this.validCombinatonString.match(b)||[];return b=a.map(b,function(b){return a.trim(b)})},exists:function(a){return e(a)in this.dimCombinations}};return l});"use strict";m.when("A","jQuery").register("url-builder",function(g,l){function f(a,c){var d;if(a&&c&&"object"==typeof c){d=a;var e="?";g.each(c,function(a,b){a=c[b];d+=e+b+"\x3d"+a;e="\x26"})}return d}
function e(a){var c;a&&(c=a.split("?")[0]);return c}function a(a){var c={};a&&(a=a.split("?"),1<a.length&&(a=a[1].split("\x26"),g.each(a,function(a,b){a=a.split("\x3d");c[a[0]]=a[1]})));return c}return{addUrlParams:function(b,c){var d=b;b&&c&&"object"==typeof c&&(d=e(b),b=a(b),b=l.extend(b,c),d=f(d,b));return d},removeUrlParams:function(b,c){var d=b;if(b&&c&&"object"==typeof c){var d=e(b),k=a(b);g.each(c,function(a,b){delete k[a]});d=f(d,k)}return d}}})});
/* ******** */
(function(m){var w=window.AmazonUIPageJS||window.P,q=w._namespace||w.attributeErrors,e=q?q("DetailPageTwisterViewAsset",""):w;e.guardFatal?e.guardFatal(m)(e,window):e.execute(function(){m(e,window)})})(function(m,w,q){m.when("A","dp-refresh-handler","view-util","twister-string-constants","dp-interactive-page-refresh-handler","twister-dimension-subview-promise-handler","page-refresh-custom-params-handler").register("page-refresh-view",function(e,L,t,g,v,r,B){function x(r,d,x){function C(c){return{chunk:function(b){var c=
b.ASIN,h=b.Value;b=b.FeatureName;if(!k.hiddenFeatures[b]){var a=b,f,y;try{a&&h&&h.content&&(y=h.content[a],"undefined"!==typeof y&&(f=u("#"+a),f.html(y).removeClass("js-feature-refresh-overlay").css({opacity:""})))}catch(d){a=a||"NoFeatureName",z.logFatal(d,{message:"Error in feature"+a})}k.twisterRefreshHandler.stampFeature(a,c);"twister-slot-price_feature_div"==b&&(h=h?h.content:null,y=u(".swatchSelect .twisterSwatchPrice").html(),f=u(".swatchSelect .price_slot_ppu").html(),y&&h&&h.priceToSet&&
(y=e.trim(y),h.priceToSet!==y&&(u(".swatchSelect .twisterSwatchPrice").html(h.priceToSet),D("twisterUpdatePriceMismatch"))),f&&h&&h.hasPricePerUnit&&h.pricePerUnitDisplay&&(f=e.trim(f),h.pricePerUnitDisplay!==f&&(u(".swatchSelect .price_slot_ppu").html(h.pricePerUnitDisplay),D("twisterUpdatePricePerUnitMismatch"))));"desktop_configurator_price_mismatch_div"==b&&e.trigger("DesktopConfiguratorPriceMismatchDataUpdated",c)}},success:function(b,c,h){H.stop();D("twisterUpdateSuccess");v.updateRenderTime()},
error:function(b,c,h){Twister.$("#variations-overlay").hide();D("twisterUpdateFailure");z.logFatal("Error occurred for twister refresh call in desktop");Twister.showErrorMessageOnFailure&&(alert(Twister.errorMessageOnFailure),location.reload())},abort:function(b){z.logFatal("Twister refresh Ajax aborted for desktop call"+b)},timeout:4E4}}function A(c,b,n,h,a){var f=[];"parent"===c?(b=F(b,h,"parent",a),f.parent=b,b=F(n,h,"partial",a),f.partial=b):(b=F(n,h,c,a),f[c]=b);return f}function l(c,b,n,h,a){for(var f in c)if(c.hasOwnProperty(f)){if("full"===
f){var d=n.dimensionType,l=k.twisterUtil.getDimensionInfo().length,C=n.dimensionDisplayType,p=n.newAsin,g=a&&(e.state("dp-twister-csm")||{}).updateCSMPageTypeId;k.twisterRefreshHandler.startMeasurement(p,d,l,C,g?p:q,g?["is-twister","parentAsin-"+G]:q)}d=c[f].twisterRefreshParams;l=c[f].notifyClientParams;if(a){H.start();var t=!1;k.twisterRefreshHandler.doPageRefresh(null,d,b,h,function(a){a&&!a.isNewRequest&&(I(f),t=!0)},function(){!t&&I(f)})}O(l.asin,l.id,f,a)}}function I(c){u(k.config[c].affectedFeatures).addClass("js-feature-refresh-overlay").css({opacity:.5})}
function p(){u.each(d.contextMetaData,function(c,b){var n={};b=b.elementList||[];var h=b.length,a=[];n.click={};n.mouseOver={};for(var f=0;f<h;f++){var d=u("#"+(b[f].divToUpdate||b[f].dtu));a.push("#"+(b[f].divToUpdate||b[f].dtu));if(d.length&&(b[f].customClientFunction||b[f].ccf)){if(b[f].updateOnHover||b[f].uoh)n.mouseOver[b[f].divToUpdate||b[f].dtu]=d.attr("customfunctionname");n.click[b[f].divToUpdate||b[f].dtu]=d.attr("customfunctionname")}}k.config[c].affectedFeatures=a.join(",");k.config[c].clientFeatures=
n})}function O(c,b,n,h){var a="",a=h?g.EVENT_TYPE_CLICK:g.EVENT_TYPE_MOUSEOVER;u.each(k.config[n].clientFeatures[a],function(a,h){try{var n=function(){k.twisterRefreshHandler.stampImageLoad(c)};(function(){var a={};a.P=m;(function(){eval("var P \x3d this.P;");eval("0, "+h)(b,DetailPage.StateController,n)}).call(a)})()}catch(d){z.logFatal("Client feature - "+a+", threw and exception :- "+d)}})}function F(c,b,n,h){if(/(?=.{0,512}$)^([A-Z]{2})_([A-Za-z]+)_([0-9]+)#([A-Za-z0-9\-\_\#\:\|]*$)/g.test(c)){var a=
!0,f=encodeURIComponent(c);c=G}var d={},l={};d.asinList=c;a&&(d.customizationToken=f);d.id="parent"===n?c:"partial"===h?b:c;d.mType=n;d=P(n,d);n=!1;(h=e.state("pwState"))&&(n=h.isTryState);n&&(d.isTryState=n);Q(d,B.getCustomPageRefreshParams(c)||{});d=k.twisterRefreshHandler.createCustomParamsMap({},d);l.asin=c;l.id=b;return{twisterRefreshParams:d,notifyClientParams:l}}function Q(c,b){e.each(b,function(b,d){c[d]=b})}function P(c,b){u.each(d.contextMetaData[c].mTypeSpecificURLParams,function(c,d){b[c]=
d});return b}function R(c){c=k.twisterUtil.getSelectionInfoFromSelectedVariationValuesMap(c.selected_variation_values);k.twisterUtil.isFullySelected(c)?k.currentPageSelectionState="full":k.currentPageSelectionState="partial"}function S(c){var b={};b.config=c.measurement;b.dimensionDisplayType=c.dimensionsDisplayType;b.storeID=c.storeID;b.productGroupID=c.productGroupID;return b}function T(c){c=c.immutableURLPrefix;var b=null;c&&-1!=c.indexOf("?")&&(c=c.split("?")[1],0<c.length&&(b={},c=c.split("\x26"),
e.each(c,function(c){c=c.split("\x3d");b[c[0]]=c[1]})),b.isFlushing=2,b.dpEnvironment=Twister.dpEnvironment);return b}function J(c,b){var d;"partial"===c&&"partial"===b&&(d="partial");"partial"===c&&"full"===b&&(d="full");"full"===c&&"partial"===b&&(d="parent");"full"===c&&"full"===b&&(d="full");return d}var k=this,G=d.parent_asin,E=w.ue,K="",z=new x("dpTwisterPageRefreshView"),H=z.createFunctionTimer(z.eventTypes.TWISTER_GREY_OVERLAY_TIME_DESKTOP);this.twisterUtil=r.util;this.twisterFeatureName=
"Twister";this.currentPageSelectionState;this.twisterRefreshHandler;this.config={partial:{},full:{},parent:{},master:{}};this.hiddenFeatures={intermediateEOS:1,EOS:1};k.viewUtil=new t(r);k.subType;var D=function(c){E&&E.count&&E.count(c,(E.count(c)||0)+1)};(function(){R(d);p();var c={featureName:k.twisterFeatureName},b=S(d);k.twisterRefreshHandler=new L(c,null,b);c=T(d.twisterUpdateURLInfo);k.twisterRefreshHandler.addParams(c);B.initialize();r.registerPassive({viewAttribution:"DetailPage",viewName:"WebTwisterRefreshView"},
{updateView:function(c,b){var a={};if(c!==g.METADATA){var a={},f;f=q;if(b)switch(c){case g.VARIATION_CHANGE:f=b.selected().selInfo;break;case g.VARIATION_PEEK:f=b.peek().selInfo}a.selectionInfo=f;a.dimensionCombination=k.viewUtil.getCurrDimCombId(a.selectionInfo,"_","X");f=k.twisterUtil.isFullySelected(a.dimensionCombination);a.childAsin=k.twisterUtil.getAsinFromSelectionInfo(a.selectionInfo,f);a.newPageSelectionState=f?"full":"partial";a.mTypeForRefresh=J(k.currentPageSelectionState,a.newPageSelectionState);
a.newAsin="parent"===a.mTypeForRefresh?G:a.childAsin;a.doNotAbort="parent"===a.mTypeForRefresh?!0:!1;a.twisterCallListParams=A(a.mTypeForRefresh,a.newAsin,a.childAsin,a.dimensionCombination,a.newPageSelectionState);a.optionsForTwisterRefresh=C(b);a.pageRefreshMeasure={newAsin:a.newAsin,dimensionType:K,dimensionDisplayType:d.dimensionsDisplayType}}switch(c){case g.VARIATION_CHANGE:k.subType!==g.PRODUCTIZED_VIEW_SUBTYPE&&(l(a.twisterCallListParams,a.optionsForTwisterRefresh,a.pageRefreshMeasure,a.doNotAbort,
!0),k.currentPageSelectionState=a.newPageSelectionState,k.subType=q);break;case g.METADATA:switch(b.subType){case g.DP_STATE_VIEW_SUBTYPE:K=b.divMetadata.dimDisplayType;break;case g.PRODUCTIZED_VIEW_SUBTYPE:k.subType=b.subType,a.dimensionCombination=b.newDimCombID,a.childAsin=b.childAsin,a.newAsin=b.newAsin,a.newPageSelectionState=k.twisterUtil.isFullySelected(a.dimensionCombination)?"full":"partial",a.mTypeForRefresh=J(k.currentPageSelectionState,a.newPageSelectionState),a.doNotAbort="parent"===
a.mTypeForRefresh?!0:!1,a.twisterCallListParams=A(a.mTypeForRefresh,a.newAsin,a.childAsin,a.dimensionCombination,a.newPageSelectionState),a.optionsForTwisterRefresh=C(b),a.pageRefreshMeasure={newAsin:a.newAsin,dimensionType:b.divMetaData?b.divMetaData.dimDisplayType:q,dimensionDisplayType:d.dimensionsDisplayType},l(a.twisterCallListParams,a.optionsForTwisterRefresh,a.pageRefreshMeasure,a.doNotAbort,!0),k.currentPageSelectionState=a.newPageSelectionState}}}})})()}var u=e.$;r.registerDimensionSubView("page-refresh-view",
x);return x});m.when("A").register("twister-common-constants",function(e){return{FAMILY_SIZE_BUCKET_LIMITS:[0,3,8,25,50,100,1E3,5E3],DEFAULT_SELECTION_TAG:"defaultSelection",BottomSheet:{TRIGGERING_CRITERION_BOTTOMSHEET_OPEN:"onBottomsheetOpen",BOTTOM_SHEET_SELECTOR:"#twister_bottom_sheet",OVERFLOW_THRESHOLD:8,BOTTOM_SHEET_INIT_TIME:"dpBottomSheetInitTime",PREFETCH_AJAX_CALLS_COMPLETED_EVENT:"prefetchAjaxCallsCompleted"},SortingFiltering:{PRICE_SORT_TOGGLE_SWITCH_CLICK_ON_METRIC:"DPBottomSheetSortingToggleSwitchClickOn",
PRICE_SORT_TOGGLE_SWITCH_CLICK_OFF_METRIC:"DPBottomSheetSortingToggleSwitchClickOff",PRICE_SORT_TOGGLE_SWITCH_ENABLED_STATUS_METRIC:"DPBottomSheetPriceSortingToggleSwitchEnabledStatus",PRIME_FILTER_TOGGLE_SWITCH_CLICK_ON_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchClickOn",PRIME_FILTER_TOGGLE_SWITCH_CLICK_OFF_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchClickOff",PRIME_FILTER_TOGGLE_SWITCH_ENABLED_STATUS_METRIC:"DPBottomSheetPrimeFilteringToggleSwitchEnabledStatus",SORTING_TYPE_PRICE:"price",
SORTING_TYPE_UNSORTED:"unsorted",PREFETCH_AJAX_CALLS_COMPLETED_EVENT:"prefetchAjaxCallsCompleted",TOGGLE_SWITCH_STATE_OFF:"off",TOGGLE_SWITCH_STATE_ON:"on",PRICE_SORTING_ENABLED_PARAMETER:"priceSortingEnabled",PRICE_SORTING_PRIORITY_NAME_PARAMETER:"priceSortingPriorityName",ALTER_TYPE_NAME_PRICE:"price",ALTER_TYPE_NAME_PRIME:"prime",ALTER_SUB_TYPE_ENABLE:"enable",ALTER_SUB_TYPE_DISABLE:"disable",ALTER_TYPE_SORT:"sort",ALTER_TYPE_FILTER:"filter",PRICE_SORT_TOGGLE_SWITCH_SELECTOR:".priceSortToggleSwitch",
PRIME_FILTER_TOGGLE_SWITCH_SELECTOR:".primeFilterToggleSwitch",EXPERIMENT_PRICE_SORTING:"priceSorting",EXPERIMENT_PRIME_FILTERING:"primeFiltering",ATTRIBUTE_PRICE_SORTING_PRIORITY:"priorityName",ATTRIBUTE_SORT_BY_PRICE_STRING:"sortByPriceString",ATTRIBUTE_SORTED_BY_PRICE_STRING:"sortedByPriceString",ATTRIBUTE_TOOL_NAME:"toolName",TOOL_TYPE_TOGGLE_SWITCH:"toggleSwitch"}}});m.when("A").register("page-refresh-custom-params-handler",function(e){var m={};return{initialize:function(){e.on("updateCustomPageRefreshParams",
function(e,g,v){e&&g&&null!==v&&v!==q&&(m[e]||(m[e]={}),m[e][g]=v)})},getCustomPageRefreshParams:function(e){return m[e]||{}}}});"use strict";m.when("A","a-sheet","jQuery","ready").execute(function(e,m,t){e.on("a:sheet:afterShow:bottom_sheet_mediaMatrix",function(){var e=t("#mediaMatrix_bottomSheet_view_div").find("#format-picker-scroller"),m=e.find("#selected-format"),r=m.offset().left,q=Math.abs(m.width()),m=Math.max(document.documentElement.clientWidth,w.innerWidth||0),q=m-q,x=e.scrollLeft();(r>
q||0>=r)&&e.scrollLeft(x+r-m/3)})});m.when("A","view-util","twister-string-constants").register("hover-refresh-view",function(e,w,t){var g=e.$;return function(v,r,B){function x(){e.each(r.contextMetaData,function(e,m){var l={};e=e.elementList||[];var g=e.length;l.mouseOver=[];for(var p=0;p<g;p++)(e[p].customClientFunction||e[p].ccf)&&(e[p].updateOnHover||e[p].uoh)&&l.mouseOver.push(e[p].divToUpdate||e[p].dtu);d.clientFeatures[m]=l})}function u(q,A){e.each(d.clientFeatures[A][t.EVENT_TYPE_MOUSEOVER],
function(d){try{var e=g("#"+d),p;e.length&&(p=e.attr("customfunctionname"),function(){var d={};d.P=m;(function(){eval("var P \x3d this.P;");eval("0, "+p)(q,DetailPage.StateController)}).call(d)}())}catch(A){N.logFatal("Client feature - "+feature+", threw and exception :- "+A)}})}function M(e){e=d.twisterUtil.getSelectionInfoFromSelectedVariationValuesMap(e.selected_variation_values);d.twisterUtil.isFullySelected(e)?d.currentPageSelectionState="full":d.currentPageSelectionState="partial"}var d=this,
N=new B("dpTwisterHoverRefreshView");this.twisterUtil=v.util;this.twisterFeatureName="TwisterHover";this.currentPageSelectionState;this.clientFeatures={partial:{},full:{},parent:{},master:{}};d.viewUtil=new w(v);d.subType=q;(function(){function m(e){e=d.viewUtil.getCurrDimCombId(e,"_","X");var l=d.twisterUtil.isFullySelected(e)?"full":"partial",g,p=d.currentPageSelectionState;"partial"===p&&"partial"===l&&(g="partial");"partial"===p&&"full"===l&&(g="full");"full"===p&&"partial"===l&&(g="parent");
"full"===p&&"full"===l&&(g="full");l=[g];"parent"===g&&(l=["parent","partial"]);return{clientFeatureToRefresh:l,dimensionCombination:e}}M(r);x();v.registerPassive({viewAttribution:"DetailPageTwister",viewName:"WebTwisterHoverRefreshView"},{updateView:function(g,l){switch(g){case t.VARIATION_PEEK:var r={};g=l.peek().selInfo;r=m(g);e.each(r.clientFeatureToRefresh,function(d){u(r.dimensionCombination,d)});case t.VARIATION_CHANGE:d.subType!==t.PRODUCTIZED_VIEW_SUBTYPE&&(g=l.selected().selInfo,l=d.viewUtil.getCurrDimCombId(g,
"_","X"),d.currentPageSelectionState=d.twisterUtil.isFullySelected(l)?"full":"partial",d.subType=q);break;case t.METADATA:switch(l.subType){case t.PRODUCTIZED_VIEW_SUBTYPE:d.subType=l.subType,d.currentPageSelectionState=d.twisterUtil.isFullySelected(l.newDimCombID)?"full":"partial"}}}})})()}})});
/* ******** */
(function(x){var w=window.AmazonUIPageJS||window.P,y=w._namespace||w.attributeErrors,u=y?y("DetailPageTwisterAssets",""):w;u.guardFatal?u.guardFatal(x)(u,window):u.execute(function(){x(u,window)})})(function(x,w,y){x.when("A","jQuery","dp-js-logger","dp-ajax-prefetch-metrics").register("dp-ajax-prefetch",function(u,e,a,b){function q(a,t,d,c,g,p){this.scope=a;this.uniqueId=t;this.url=d;this.options=c;this.context=g;this.status=0;this.selected=!1;this.error=this.successData=this.xhr=this._status=y;
this.chunks=[];this.doNotAbort=p||!1;this.prefetchMetrics=b.getInstance(this.scope)}var n=new a("dpAjaxPrefetch");q.prototype._callback=function(a,t,d,c,b){"function"===typeof a&&a.call(self,t,d,c,b)};q.prototype._canAbort=function(){return!this.doNotAbort&&1===this.status};q.prototype._isAborted=function(){return 3===this.status};q.prototype._getUniqueId=function(){return this.uniqueId};q.prototype._abort=function(){if(1===this.status)try{this.ajaxRequestRefence.abort(),this.status=3}catch(a){n.logFatal(a,
{message:" Could not abort ajax request."})}};q.prototype._flushChunkData=function(){var a=this;a.chunks.length&&e.map(a.chunks,function(b){a._callback(a.options.chunk,b,a.context)})};q.prototype._request=function(){var a=this;a.ajaxRequestRefence=u.get(a.url,{params:a.options.params,success:function(b,d,c){a.status=4;a.successData=b;a._status=d;a.xhr=c;a.selected&&a._callback(a.options.success,b,d,c,a.context)},error:function(b,d,c){a.status=2;a.xhr=b;a._status=d;a.error=c;a.selected&&a._callback(a.options.error,
b,d,c,a.context)},abort:function(b){a.status=3;a.xhr=b;a.selected&&a._callback(a.options.abort,b,a.context)},chunk:function(b){b&&(a.chunks.push(b),a.selected&&a._callback(a.options.chunk,b,a.context))},timeout:a.options.timeout||4E4})};q.prototype.prefetchContent=function(){this.prefetchMetrics.predicted(this.uniqueId);0===this.status&&(this.status=1,this._request())};q.prototype.getContent=function(a){a&&this.prefetchMetrics.selected(this.uniqueId);q._abortPrefetchesExcept(this);this.selected=!0;
0===this.status?(this.status=1,this._request()):1===this.status?this._flushChunkData():4===this.status&&(this._flushChunkData(),this._callback(this.options.success,this.successData,this._status,this.xhr,this.context),u.trigger("a:pageUpdate"))};q._objects={};q._abortPrefetchesExcept=function(a){e.each(q._objects[a.scope],function(b,d){d._canAbort()&&b!==a._getUniqueId()&&d._abort()})};q.getInstance=function(a,b,d,c,g,p){if(!a||!b||!d||"object"!==typeof c)throw"Incorrect parameter passed.";q._objects[a]=
q._objects[a]||{};var C=q._objects[a][b];C&&C._isAborted()&&(delete q._objects[a][b],C=y);C||(q._objects[a][b]=new q(a,b,d,c,g,p,this));return q._objects[a][b]};return q});x.when("A","jQuery","dp-ajax-prefetch","twister-utils","dp-js-logger").register("dimensional-summary-module",function(u,e,a,b,q){var n=new q("dpDimensionalSummary");return function(a){function t(a){f.initData.fnToDetermineSelectedVariations?"function"===typeof f.initData.fnToDetermineSelectedVariations&&(f.currentDimCombOnGlance=
f.initData.fnToDetermineSelectedVariations.call(f)):(f.glanceViewSelectedDims=p.StateController.getState().selected_variations,f.currentDimCombOnGlance=p.StateController.getState().currentDimCombID);return a?f.currentDimCombOnGlance.split("_"):f.currentDimCombOnGlance}function d(a,c){for(var h="",l,v,r=0,d=a.length;r<d;r++)h=h+(0<r?",":"")+a[r];var k=E.extend(k,b.getQueryParams({psc:1})),k=E.extend(k,{parentAsin:p.StateController.getState().parent_asin,productGroupId:p.StateController.getState().productGroupID});
f.initData.globalAjaxParameters&&(k=E.extend(k,f.initData.globalAjaxParameters));C.isPWBadgeEnabled&&(k.isPWBadgeEnabled=1);k&&(v=E.param(k));h&&(a=!C.multiDimensionWeblabEnabled||"dropdown"!==c.dimType.toLowerCase()&&"swatch"!==c.dimType.toLowerCase()?c.dimType:"Dropdown",l="/gp/twister/dimension?asinList\x3d"+h+"\x26isDimensionSlotsAjax\x3d1\x26dimSubType\x3d"+c.dimSubType+"\x26dimType\x3d"+a+(v?"\x26"+v:""));return l}function c(a){for(var c,h=0,l=a.length;h<l;h++)c=c+(0<h?",":"")+a[h];return c}
function g(a,l,h){C.isPWBadgeEnabled&&w.ue&&w.ue.count&&w.ue.count("Twister:DimensionSlotsAjax",(w.ue.count("Twister:DimensionSlotsAjax")||0)+1);c(a);a=d(a,h);var g={};h.params&&(g.params=h.params);g.chunk=function(a,c){var l;(l=(l=(l=(l=a&&"JSON"===a.Type)&&typeof("undefined"!==a.Value))&&typeof("undefined"!==a.Value.content))&&typeof("undefined"!==a.Value.content.twisterSlotDiv))?(h.executeChunk===y?h.chunk(a,c):h.executeChunk()&&h.chunk(a,c),f.asinDimSumCache[a.ASIN]=a):n.logFatal("The received data does not contain required properties.",
{message:"[Twister]Invalid data received."})};g.success=function(a,c,l,k){h.success&&b.typeChecker.isFunction(h.success)&&h.success(a,c,l,k)};g.error=function(a,c,l){h.error&&b.typeChecker.isFunction(h.error)&&h.error(a,c,l)};g.abort=function(a){h.abort&&b.typeChecker.isFunction(h.abort)&&h.abort(a)};g.timeout=6E4;u.get(a,{success:function(a,h,c){g.success(a,h,c,l)},chunk:function(a){g.chunk(a,l)},error:function(a,h,c){g.error(a,h,c)},abort:function(a){g.abort(a)}})}var p=w.DetailPage,C=w.Twister,
f=this,E=u.$;f.initData=a;f.scopePrefix="dpDimSum";f.symbolForTriggeringDim="*";f.uniqueID="";f.urlPrefix="";f.asinDataCache={};f.glanceViewSelectedDims="";f.currentDimCombOnGlance="";f.mapOfDimToAsinMaps={};f.mapOfAsinToDimMaps={};f.asinDimSumCache={};f.scope=f.scopePrefix+"_"+f.initData.scopeSuffix;f.dimensionsList=f.initData.dimensionsList;f.dimensionValuesList=f.initData.dimensionValuesList;f.dimensionCombinationToASINMap=f.initData.dimensionCombinationToASINMap;t();f.fetchDimSumData=function(a){if(a.dimTriggeringDimSum&&
b.typeChecker.isString(a.dimTriggeringDimSum))var c=a.dimTriggeringDimSum;else throw"Wrong parameter passes to DimSumModule "+f.scope;var h=u.indexOfArray(f.dimensionsList,c);if(a){if(!a.asinList||!b.typeChecker.isArray(a.asinList))throw"Wrong parameter passed to DimSumModule "+f.scope;if(!a.chunk||!b.typeChecker.isFunction(a.chunk))throw"Wrong parameter passed to DimSumModule "+f.scope;}else throw"Error : No options for dimSum";c={dimIndexTriggeringDimSum:h};c.dimCombOnPage=t();var l=t(!0).slice(0);
l[h]=f.symbolForTriggeringDim;h=l.join("_");c.hashKey=h;for(var v=a.asinList,h=[],l=[],d=0,p=v.length;d<p;d++){var k=v[d];k&&(f.asinDimSumCache&&f.asinDimSumCache[k]?l.push(k):h.push(k))}v=[];v.asinListForServer=h;v.asinListForCache=l;0<v.asinListForServer.length&&g(v.asinListForServer,c,a);if(0<v.asinListForCache.length){h=v.asinListForCache;v=0;for(d=h.length;v<d;v++)l=h[v],a.chunk(f.asinDimSumCache[l],c);h.length===a.asinList.length&&a.success(y,y,y,c)}}}});x.when("A","twister-string-constants").register("twister-modal-resize-helper",
function(u,e){return function(){function a(a,b){a.each(function(a,g){a=l(g);-1===g.className.indexOf(b)&&(a.outerWidth()>e.width&&(e.width=a.outerWidth()),a.outerHeight()>e.height&&(e.height=a.outerHeight()))});return e}var b=w.Twister,e={width:0,height:0},n=this,l=u.$;n.getGlanceSwatchesInRow=function(a,b){b&&b.fixModalSwatchesForThinWidths();a=l("#twister_feature_div "+a);var c=0,g=0;0<a.length&&(g=a.get(0).getBoundingClientRect().top,c++);for(var p=1,e=a.length;p<e;p++){var f=a.get(p).getBoundingClientRect();
if(5<Math.abs(g-f.top))break;else c++}b&&b.resizeSwatchesForThinWidths();return c};n.fixSize=function(t,d,c,g,p){t.removeClass("twisterSwatchWrapper");var e=a(t,g),f=w.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(p!==y){var E=p.twisterModalDiv.outerWidth(),q=n.getGlanceSwatchesInRow(d,p),m=t.first().width(),m=q*(e.width-m);0<m&&0<q&&p.setModalWidth(E+m)}t.addClass("twisterSwatchWrapper");b.isIE8()?(t.each(function(a,c){l(c).css({"min-height":e.height+"px","min-width":e.width+
"px"})}),1100<f&&l("."+g).css({height:e.height+"px"})):l("#"+c).html(d+" { min-height:"+e.height+"px; min-width:"+e.width+"px; } ."+g+" { height: "+e.height+"px;}");n.resetBestSize()};n.resetBestSize=function(){e={width:0,height:0}}}});x.when("A").register("evdd-utils",function(u){return function(){this.PopulateEVDD=function(e,a,b,q){var n={},l,t;for(l in e)if(t=b[l],"undefined"!=typeof t){var d=t[1];q===t[0]&&(n[d]=e[l])}"function"===typeof a.dimensionViewHandlersMap[1].updateViewWithPriceInfo&&
a.dimensionViewHandlersMap[1].updateViewWithPriceInfo(n)}}});x.when("A").register("scroll-event-handler",function(u){return function(e,a,b){if(a){var q=u.$,n,l=(new Date).getTime();q(a).bind("scroll",function(a){var d=Date.now();n&&d-l<e&&clearTimeout(n);l=d;n=setTimeout(function(){b(a)},e)})}}});x.when("A").register("twister-data-translator",function(u){function e(b){var e=[],n=b.selected_variation_values;a.each(b.dimensions,function(a,b){n.hasOwnProperty(b)&&e.push({dimKey:b,val:n[b]})});return e}
var a=u.$;return{getTranslatedData:function(a){var q={},n={},l=a.deviceType,t=a.ajaxTimeout;n.ajaxUrlParams=a.ajaxUrlParams;n.deviceType=l;n.ajaxTimeout=t;q.config=n;var n={},l=a.dimToAsinMapData,d;for(d in l)if(l.hasOwnProperty(d)){var t=l[d],c=d.split("_").join(":");n[c]=t}q.dimCombinations=n;q.dimensionDisplayText=a.variationDisplayLabels;d=[];n=a.dimensions;l=a.dimensionSelectionData;t=a.variation_values;for(c=0;c<n.length;c++){var g={},p=n[c];g.dimKey=p;g.isRequired=l[c].isRequired?!0:!1;g.size=
t[p].length;d.push(g)}q.dimensionInfo=d;q.dimensionList=a.dimensions;q.dimtoValueMap=a.variation_values;q.initDimCombination=e(a);return q}}});x.when("A").register("twister-availabilty-cache",function(u){return function(e,a){function b(a,t){var d=a+":"+t,c=a.split("_"),g=c.length,p=-1,e;if(null!==n.asinToRenderCache[d]&&n.asinToRenderCache[d]!==y)return n.asinToRenderCache[d];n.intermediateAsinToRenderCache[d]=!0;for(d=0;d<g;d++)if("X"===c[d]){p=d;break}if(-1===p)return e=null,null!=n.twisterVariationsData.dimToAsinMapData[a]&&
(e=n.twisterVariationsData.dimToAsinMapData[a]),e;a=n.twisterVariationsData.dimensionValuesData[p].length;for(var f=0;f<a&&(c[p]=f,g=c.join("_"),d=g+":"+t,n.intermediateAsinToRenderCache.hasOwnProperty(d)||(e=b(g,t),null===e||e===y));f++);return e}function q(a){for(var b in n.intermediateAsinToRenderCache)n.asinToRenderCache[b]=a,delete n.intermediateAsinToRenderCache[b];n.intermediateAsinToRenderCache={}}var n=this;n.twisterVariationsData=e;n.dimensionHierarchyData=a.dimensionHierarchyData;n.isHierarchicalPivoting=
a.hierarchicalPivoting;n.dimAvailabilityCache={};n.dimCurrentAvailabilityCache={};n.asinToRenderCache={};n.intermediateAsinToRenderCache={};n.isUpdateCacheReq=!1;n.isDimCombinationCurrentlyAvailable=function(a){if(n.dimCurrentAvailabilityCache[a])return n.dimCurrentAvailabilityCache[a];var b=!0;n.twisterVariationsData.currentlyUnavailableDimensions.includes(a)&&(b=!1);return n.dimCurrentAvailabilityCache[a]=b};n.resetAvailabilityCache=function(){n.dimAvailabilityCache={}};n.isDimCombinationAvailable=
function(a){var b=a.split("_"),d,c=-1,g,p;d=b.length;if(null!==n.dimAvailabilityCache[a]&&n.dimAvailabilityCache[a]!==y)return n.dimAvailabilityCache[a];for(p=0;p<d;p++)if("X"===b[p]){c=p;break}if(-1===c)return g=!1,null!==n.twisterVariationsData.dimToAsinMapData[a]&&n.twisterVariationsData.dimToAsinMapData[a]!==y&&(g=!0),n.dimAvailabilityCache[a]=g;d=n.twisterVariationsData.dimensionValuesData[c].length;for(var e=0;e<d&&(b[c]=e,p=b.join("_"),null!==n.dimAvailabilityCache[p]&&n.dimAvailabilityCache[p]!==
y?g=n.dimAvailabilityCache[p]:(g=n.isDimCombinationAvailable(p),n.dimAvailabilityCache[p]=g),!g);e++);return n.dimAvailabilityCache[a]=g};n.gAsinToRender=function(a,t){var d=null,c,g,p=a.split("_"),e=p.length;c=a+":"+t;if(null!==n.asinToRenderCache[c]&&n.asinToRenderCache[c]!==y)return n.isUpdateCacheReq&&(q(n.asinToRenderCache[c]),n.isUpdateCacheReq=!1),n.asinToRenderCache[c];n.isUpdateCacheReq||(n.isUpdateCacheReq=!0);n.intermediateAsinToRenderCache.hasOwnProperty(c)||(d=b(a,t));if(null!==d&&d!==
y)return n.isUpdateCacheReq&&("X"===p[t]?(n.asinToRenderCache[c]=d,n.intermediateAsinToRenderCache={}):q(d),n.isUpdateCacheReq=!1),d;for(a=0;a<e;a++)if(c=n.isHierarchicalPivoting&&n.dimensionHierarchyData&&n.dimensionHierarchyData[a]<n.dimensionHierarchyData[t],a!==t&&"X"!==p[a]&&!c&&(d=p[a],p[a]="X",c=p.join("_"),g=c+":"+t,p[a]=d,!n.intermediateAsinToRenderCache.hasOwnProperty(g)&&(d=b(c,t),null!==d&&d!==y)))return n.isUpdateCacheReq&&(q(d),n.isUpdateCacheReq=!1),d;d=-1;for(a=0;a<e;a++)if(c=n.isHierarchicalPivoting&&
n.dimensionHierarchyData&&n.dimensionHierarchyData[a]<n.dimensionHierarchyData[t],"X"!==p[a]&&a!==t&&!c){d=a;break}if(-1===d)return"";p[d]="X";c=p.join("_");return n.gAsinToRender(c,t)}}});x.when("A","twister-string-constants").register("twister-utils",function(u,e){var a=w.DetailPage,b=u.$,q=this,n={};q.windowWidth=w.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;q.immersiveTwisterOverlay=b("#"+e.TWISTER_FEATURE_DIV_ID+" #"+e.IMMERSIVE_TWISTER_OVERLAY);q.twisterFeatureDiv=
b("#"+e.TWISTER_FEATURE_DIV_ID);(function(){for(var a="Array Object String Date RegExp Function Boolean Number Null Undefined".split(" "),b=0,d=a.length;b<d;b++)n["is"+a[b]]=function(a){return function(b){return Object.prototype.toString.call(b).slice(8,-1)===a}}(a[b])})();return{enableTwisterDiv:function(){q.immersiveTwisterOverlay.css({opacity:"0",position:"absolute",width:"0px",height:"0px"})},disableTwisterDiv:function(){var a=q.twisterFeatureDiv.get(0).clientWidth,b=q.twisterFeatureDiv.get(0).clientHeight;
q.immersiveTwisterOverlay.css({opacity:"0.8",position:"absolute",width:a,height:b,"background-color":"white","z-index":10})},isSwatchSelected:function(a,b){var d=w.Twister.isImmersiveExperience?"."+e.TWISTER_SWATCH_CLASS_PREFIX+b.dimensionsMap[a[e.STRING_DIM_INDEX]]+"_"+a[e.STRING_DIM_VALUE_INDEX]:"#"+b.dimensionsMap[a[e.STRING_DIM_INDEX]]+"_"+a[e.STRING_DIM_VALUE_INDEX],c;if(u.$(d).is("li")){d=u.$(d);!w.Twister.isImmersiveExperience||0<d.length||(d=u.$("."+e.TWISTER_SWATCH_CLASS_PREFIX+b.dimensionsMap[a[e.STRING_DIM_INDEX]]+
"_"+a[e.STRING_DIM_VALUE_INDEX]));a=d.get(0).className.split(" ");b=0;for(d=a.length;b<d;b++){var g=a[b];if(0===g.indexOf("swatch")){c=g;break}}c!==e.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER&&c!==e.CLASS_FOR_SWATCH_UNAVAILABLE||u.$("#twisterPopover.twisterPopoverSkin").hide();return c===e.CLASS_FOR_SWATCH_SELECT}return!1},isPartialState:function(b){for(var t=a.StateController.getState().currentDimCombID.split("_"),d=!1,c=0;c<b;c++)if("X"===t[c]){d=!0;break}return d},getProductizedTwisterSelectionFromDivMetaData:function(a,
b){var d=[],c=a.dimIndex,g=a.dimValueIndex;for(a=0;a<b.length;a++)if(c===parseInt(a,10)){c={};c.dimKey=b[a];c.val=parseInt(g,10);d.push(c);break}return d},getProductizedTwisterSelectionFromDimComb:function(a,b){var d=[];a=a.replace(/X/g,"-1").split("_");for(var c=0;c<b.length;c++){var g={},p=a[c];g.dimKey=b[c];g.val=parseInt(p,10);d.push(g)}return d},getImmersivePartialStateBannerContent:function(a,b){var d="",c=w.Twister.immersivePartialStateMessage,g=a.dimensionSelectionData;a=a.dimensionsDisplay;
for(var p=0;p<g.length;p++)p!==b&&0===g[p][e.STRING_IS_SELECTED]&&(d=d?d+", "+a[p]:a[p]);w.Twister.isPWBadgeEnabled&&(d=d.toLowerCase());return c.replace("dimName",d)},getImmersiveFullStateBannerContent:function(b,t){var d="",c=w.Twister.immersiveFullySelectedStateMessage,g=b.dimensionSelectionData,p=b.dimensions;b=b.dimensionsDisplay;for(var n=a.StateController.getState().selected_variations,f=0;f<g.length;f++)f!==t&&1===g[f][e.STRING_IS_SELECTED]&&(d=d?d+", "+b[f]+" "+n[p[f]]:b[f]+" "+n[p[f]]);
return c.replace("dimName",d)},isSmallerWidthScreen:function(){return 1100>q.windowWidth?1:0},getAttachedClass:function(a,t){a=a[e.STRING_DIM_VALUE_INDEX];var d="#"+t+"_"+a;if(u.$(d).is("li")){var c,d=u.$(d);!w.Twister.isImmersiveExperience||0<d.length||(d=b("."+e.TWISTER_SWATCH_CLASS_PREFIX+t+"_"+a));t=d.get(0).className.split(" ");a=0;for(d=t.length;a<d;a++){var g=t[a];if(0===g.indexOf("swatch")){c=g;break}}return c}d=w.Twister.isImmersiveExperience?e.IMMERSIVE_DROPDOWN_ROW_PREFIX+t+"_"+a:e.NATIVE_DROPDOWN_DIV_PREFIX+
t+"_"+a;return u.$(d).attr("class")},htmlUnescape:function(a){return String(a).replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e").replace(/&amp;/g,"\x26")},getDimStyleData:function(a,b,d,c,g){a=a.split("_");for(var p=[],n=a.slice(0),f,E,q,m=!1,h=0;h<b;h++)q={},a[d]===h.toString()?f=e.STYLE_CLASS_TYPE_FOR_SELECTED:(n[d]=h,f=n.join("_"),(E=c.isDimCombinationAvailable(f))&&(m=c.isDimCombinationCurrentlyAvailable(f)),f=E?m?e.STYLE_CLASS_TYPE_FOR_AVAILABLE:e.STYLE_CLASS_TYPE_FOR_UNAVAILABLE:
e.STYLE_CLASS_TYPE_FOR_INAVLID),f=g[f],q.style=f,p[h]=q;return p},getVisibleTableRows:function(a,t){var d=[],c=a.getBoundingClientRect();t||(t=b(a).find("tr"));if(t.length)for(a=0;a<t.length;a++){var g=t.get(a),p=g.getBoundingClientRect(),e=(p.bottom-p.top)/2,f=c.bottom+e;c.top-e<p.top&&f>p.bottom&&d.push(g);if(c.bottom<p.top)break}return d},reconstructCombinationWithDimValue:function(a,b,d){if(!a)return a;var c=a.split(e.CHAR_UNDERSCORE);if(b>=c.length)return a;c[b]=d;return c.join(e.CHAR_UNDERSCORE)},
isTouchDevice:function(){return u.capabilities.touch},isTouchOnlyDevice:function(){return"undefined"!==typeof w.touchDeviceDetected&&w.touchDeviceDetected},typeChecker:n,getQueryParams:function(a){a=a===y?{}:a;var t={},d=decodeURIComponent(w.location.href).match(/^.*?\?(.*?)(#.*)?$/);if(null===d||2>d.length||d[1]===y)return{};d=d[1].split("\x26");b.each(d,function(b,d){b=d.split("\x3d");2>b.length||a.hasOwnProperty(b[0])||(t[b[0]]=b[1])});return t},stringTrim:function(a){var b=/^\s+/,d=/\s+$/;return String.prototype.trim?
String.prototype.trim.call(a):a.replace(b,"").replace(d,"")},checkPWBadge:function(a,t){if(!t||a!==y){var d=!1,c=u.state("pwState");c&&(d=c.isTryState);var g,p,e,f;t?(e=a.find(".pwTryBadge"),f=a.find(".pwBuyBadge"),c=a.find(".pwPrice")):(e=b(".pwTryBadge"),f=b(".pwBuyBadge"),c=b(".pwPrice"));d&&e.length?(g=e,p=f,c.length&&c.removeClass("aok-hidden"),a=e.parent(),c=a.find(".pwPrimeBadge"),c.length&&c.addClass("aok-hidden"),t=a.find(".buyBoxPrice"),a=a.find(".deal-price"),t.length&&t.addClass("aok-hidden"),
a.length&&a.addClass("aok-hidden")):e.length&&(p=e,g=f,t?(d=a.find(".pwPrimeBadge"),t=a.find(".buyBoxPrice"),a=a.find(".deal-price")):(d=b(".pwPrimeBadge"),t=b(".buyBoxPrice"),a=b(".deal-price")),d.length&&d.removeClass("aok-hidden"),t.length&&t.removeClass("aok-hidden"),a.length&&a.removeClass("aok-hidden"),c.length&&c.addClass("aok-hidden"));g&&g.length&&g.removeClass("aok-hidden");p&&p.length&&p.addClass("aok-hidden")}}}});x.when("A","twister-string-constants").register("aui-style-override",function(u,
e){return{doOverride:function(a,b){"a-button-group"===b.parent("ul").data("action")&&(b=b.find(".a-button.a-button-toggle"),b.length&&(a===e.CLASS_FOR_SWATCH_UNAVAILABLE?b.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT).addClass(e.AUI_CLASS_FOR_SWATCH_UNAVAILABLE):b.removeClass(e.AUI_CLASS_FOR_SWATCH_UNAVAILABLE),a===e.CLASS_FOR_SWATCH_SELECT?b.addClass(e.AUI_CLASS_FOR_SWATCH_SELECT):b.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT)))},ingressOverride:function(a){"a-button-group"===a.parent("ul").data("action")&&
(a=a.find(".a-button.a-button-toggle"),a.length&&a.removeClass(e.AUI_CLASS_FOR_SWATCH_SELECT))}}});x.when("A").register("twister-thumbnailModule",function(u){var e=u.$;return{attach:function(a){var b=e("#dropdown_selected_thumbnail_"+a);a=e("#dropdown_selected_"+a+" .a-button-inner");0<b.length&&0<a.length&&(b.detach(),a.append(b),"#"!==b.attr("src")&&b.show())},update:function(a){var b=encodeURIComponent(e("#native_dropdown_selected_"+a).val().split(",")[0]);"undefined"!==typeof b&&"-1"!==b&&(b=
e("#native_"+a+"_"+b),b=0<b.length?b.attr("data-a-image-source"):"",a=e("#dropdown_selected_thumbnail_"+a),0<a.length&&""!==b?(a.attr("src",b),a.show()):a.hide())},preloadAllThumbnails:function(a){if(a){var b=e("#native_dropdown_selected_"+a+" option");a=e("#dropdown_selected_"+a).attr("data-a-class");b&&a&&-1!==a.indexOf("twister-image-dropdown")&&e.each(b,function(a,b){if(a=b.getAttribute("data-a-image-source"))(new Image).src=a})}}}});x.when("A","twister-string-constants","scroll-event-handler").execute(function(u,
e,a){(function(b){function e(a){function d(g,f){g=b(f).get(0).getBoundingClientRect();f=a.$window.get(0).getBoundingClientRect();var p=f.right-f.left,h=f.bottom-f.top;return f.top<g.top&&g.top<f.top+h&&f.left<g.left&&g.left<f.left+p}t=!1;for(var p=0,n=a.selector.length;p<n;p++){var f=[];a.blockIsAppear!==y&&a.blockIsAppear()||(f=b(a.selector[p]).filter(function(){return b(this).is(d)}).not(l));0<f.length&&(u.trigger(a.eventToBeTriggered,[f.clone()]),l=l.add(f))}}var n=[],l=b(),t=!1,d={interval:250,
force_process:!1};b.fn.extend({appearedInTwisterImmersiveView:function(c){var g=b.extend({},d,c||{}),p=this.selector||this;g.selector=[];g.selector[0]=p;var l=function(){t||(t=!0,setTimeout(function(){e(g)},g.interval))};new a(200,c.$scrollHandlerDiv,l);c.$window.resize(l);g.force_process&&setTimeout(function(){e(g)},g.interval);n.push(p);return b(p)},forceAppear:function(a){var g=b.extend({},d,a||{});a=this.selector||this;g.selector=[];g.selector[0]=a;setTimeout(function(){e(g)},g.interval)},invalidateAppearedAlreadyCache:function(a){l=
l.not(this.selector)}})})(u.$)});x.when("A").register("accessibility-helper",function(u){return{announceText:function(){}}});x.when("A").register("twister-expander",function(u){return function(e){function a(){"function"===typeof m.synchronousPreCollapseCallback&&m.synchronousPreCollapseCallback();m.logger.logImpression(m.logger.eventTypes.COLLAPSE_BUTTON_CLICK,A);m.expanderSection.height();m.expanderSection.animate({height:m.minHeightForExpandedSection},{duration:m.scrollAnimationDuration,queue:!1,
complete:function(){m.expanderSection.css("overflow-y","hidden");m.expanderSection.css("overflow","hidden");m.expanderHidesVariation&&!m.expanderButtonPostCollapse||m.expanderButton.removeClass("aok-hidden");"function"===typeof m.synchronousPostCollapseCallback&&m.synchronousPostCollapseCallback()}});m.expanderSection.animate({scrollTop:0},{duration:m.scrollAnimationDuration,queue:!1});t.isCollapsed=!0;m.expanderHidesVariation?q():m.collapseButton.addClass("aok-hidden");t.handleVariationSwap()}function b(){f.hasClass("aok-hidden")&&
(f.removeClass("aok-hidden"),m.expanderButton.prev().insertAfter(g))}function q(){t.isCollapsed?(m.collapseButton.addClass("aok-hidden"),m.expanderHidesVariation&&C.addClass("aok-hidden"),m.expanderButtonPostCollapse||m.expanderButton.removeClass("aok-hidden")):(m.expanderButton.addClass("aok-hidden"),C.removeClass("aok-hidden"),m.collapseButton.removeClass("aok-hidden"))}function n(){E.bind("click",function(h){m.expanderButton[0].id===h.currentTarget.id||t.isCollapsed||a()})}var l=u.$,t=this,d,c,
g,p,C,f,E=l(".expanderButton"),A,m={minHeightForExpandedSection:50,maxHeightForExpandedSection:100,maxHeightForExpandedSectionInView:null,scrollAnimationDuration:500,expanderSection:null,useExpanderScrollView:!0,minAsinsForExpandedView:null,expanderButtonReplacementIndex:null,dimValuePrefix:null,initSelectedID:null,swatchImageSize:null,swatchImageMargin:null,expanderButton:null,collapseButton:null,expanderHidesVariation:!0,expanderButtonPostCollapse:!1,synchronousPreExpanderCallback:null,synchronousPostExpanderCallback:null,
synchronousPreCollapseCallback:null,synchronousPostCollapseCallback:null,dimDisplayType:null,logger:null,dimOrder:null};t.handleExpand=function(){"function"===typeof m.synchronousPreExpanderCallback&&m.synchronousPreExpanderCallback();m.logger.logImpression(m.logger.eventTypes.EXPAND_BUTTON_CLICK,A);var a=m.expanderSection.height();t.isCollapsed=!1;t.handleVariationSwap();m.expanderHidesVariation?q():m.expanderButton.addClass("aok-hidden");if(m.useExpanderScrollView)m.expanderSection.height(a).animate({height:m.maxHeightForExpandedSection},
{duration:m.scrollAnimationDuration,queue:!1,complete:function(){m.expanderSection.css("overflow-y","auto");t.scrollVariationIntoView();m.expanderHidesVariation||m.collapseButton.removeClass("aok-hidden");"function"===typeof m.synchronousPostExpanderCallback&&m.synchronousPostExpanderCallback()}});else{var b=m.expanderSection.css("height","auto").height();m.expanderSection.height(a).animate({height:b},{duration:m.scrollAnimationDuration,queue:!1,complete:function(){m.expanderHidesVariation||m.collapseButton.removeClass("aok-hidden");
"function"===typeof m.synchronousPostExpanderCallback&&m.synchronousPostExpanderCallback()}})}};t.handleVariationSwap=function(a){t.isCollapsed&&(d>=p||m.expanderHidesVariation&&f.hasClass("aok-hidden")&&c.is(f))?(a&&b(),a=f,d===p&&m.expanderHidesVariation?(C.removeClass("aok-hidden"),g=f):d===p+1&&m.expanderHidesVariation?(C.addClass("aok-hidden"),g=m.expanderButton):d===p-1&&m.expanderHidesVariation?(f.removeClass("aok-hidden"),a=C,g=l(m.dimValuePrefix+(d-1))):m.expanderHidesVariation?(C.addClass("aok-hidden"),
g=l(m.dimValuePrefix+(d-1))):g=d===p?m.expanderButton:l(m.dimValuePrefix+(d-1)),c.insertBefore(m.expanderButton),a.addClass("aok-hidden")):t.isCollapsed||b()};t.scrollVariationIntoView=function(){var a=c.offset().top,b=m.expanderSection.offset().top,v=m.expanderSection.scrollTop(),a=a-b,v=v+a;0>a?m.expanderSection.animate({scrollTop:v},{duration:m.scrollAnimationDuration,queue:!1}):a>m.maxHeightForExpandedSectionInView&&(v-=m.swatchImageSize+m.swatchImageMargin,m.expanderSection.animate({scrollTop:v},
{duration:m.scrollAnimationDuration,queue:!1}))};t.updateSelectedVariation=function(a,b){null!=b&&(c=b);null!=a&&(d=a.split("_")[m.dimOrder])};(function(){e&&l.extend(m,e);if(!m.collapseButton)throw"Expander collapseButton should not be null";if(!m.expanderButton)throw"Expander expanderButton should not be null";if(!m.expanderSection)throw"Expander expanderSection should not be null";if(!m.initSelectedID)throw"Expander initSelectedID should not be null";if(!m.minAsinsForExpandedView)throw"Expander minAsinsForExpandedView should not be null";
if(!m.dimValuePrefix)throw"Expander dimValuePrefix should not be null";if(!m.swatchImageSize)throw"Expander swatchImageSize should not be null";if(!m.swatchImageMargin)throw"Expander swatchImageMargin should not be null";if(!m.expanderButtonReplacementIndex)throw"Expander expanderButtonReplacementIndex should not be null";if(!m.dimDisplayType)throw"Expander dimDisplayType should not be null";if(!m.logger)throw"Expander Logger should not be null";m.dimOrder||(m.dimOrder=0);A={dimDisplayType:m.dimDisplayType};
m.logger.logImpression(m.logger.eventTypes.EXPANDER,A);p=m.expanderButtonReplacementIndex;C=l(m.dimValuePrefix+p);f=l(m.dimValuePrefix+(p-1));d=m.initSelectedID.split("_")[m.dimOrder];c=l(m.dimValuePrefix+m.initSelectedID.split("_")[m.dimOrder]);t.isCollapsed=!0;m.expanderButton.click(function(){t.handleExpand()});m.collapseButton.click(function(){a()});n();t.handleVariationSwap()})()}});x.when("A","twister-string-constants","migrated-views").register("view-util",function(u,e,a){function b(a){n.tvm=
a.tvm;n.util=a.util}var q=u.$,n=this;b.isViewsEligibleForMigration=function(b){for(var t=!0,d=a.getMigratedViews(),c=0,g=b[e.INIT_DATA_DIMENSIONS_MAP].length;c<g;c++){var p="undefined"!==typeof b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]?b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][c]:y;if(!0===t&&p!==y)t=-1!==u.indexOfArray(d,p);else{t=!1;break}}return t};b.prototype={variationData:{getAsinToDimIndexMapData:function(){var a={},b=n.tvm.dimCombinations,d,c,g;for(d in b)b.hasOwnProperty(d)&&(g=d.split(e.CHAR_COLON),
c=b[d],g=q.map(g,function(a){return parseInt(a)}),a[c]=g);return a},getDimToAsinMapData:function(){var a={},b=n.tvm.dimCombinations,d,c,g;for(d in b)b.hasOwnProperty(d)&&(g=d.split(e.CHAR_COLON).join(e.CHAR_UNDERSCORE),c=b[d],a[g]=c);return a},getDimensionValuesData:function(){var a=[],b=n.tvm.dimtoValueMap;q.each(n.tvm.dimensionList,function(d,c){a.push(b[c])});return a},getDimensionValuesDisplay:function(){var a=this,b={},d=this.getAsinToDimIndexMapData();q.each(d,function(c,d){var p=[];q.each(d,
function(b,c){b=a.getDimValueByDimIndex(b,c);p.push(b)});b[c]=p});return b},getDimValueByDimIndex:function(a,b){var d=y,c=n.tvm.dimInfoMap,g=n.tvm.dimtoValueMap;q.each(c,function(p,e){c.hasOwnProperty(p)&&e.dimOrder===a&&g[p]!==y&&(d=g[p][b])});return d}},getTwisterState:function(a){for(var b=[],d={dimKey:y,val:y},c=0;c<n.tvm.dimensionList.length;c++)if(a&&(d.dimKey=n.tvm.dimensionList[c],parseInt(a.dimIndex,10)===c)){d.val=a.dimValueIndex;b.push(d);break}return b},getCurrDimCombId:function(a,b,d){for(var c=
[],g=0;g<n.tvm.dimensionList.length;g++){var p=a[g].val;-1===p&&(p=d?d:e.CHAR_ASTERISK);c.push(String(p))}return b?c.join(b):c},getDimensionSelectionData:function(a,b){for(var d=[],c=0;c<n.tvm.dimensionList.length;c++){var g={},p=0,q=0;-1!==b[c].val&&(q=1);a[b[c].dimKey].isRequired&&(p=1);g[e.STRING_IS_REQUIRED]=p;g[e.STRING_IS_SELECTED]=q;d[c]=g}return d},getDimDisplayMap:function(){var a=[],b=n.tvm.dimensionList,d=n.tvm.dimensionDisplayText,c;if("undefined"!==typeof d&&"undefined"!==typeof b)for(var g in b)c=
b[g],a[g]=d[c];return a},getDimensionValuesData:function(a,b){var d={},c=y;if(b){var g=b[e.TWISTER_CURRENT_ASIN];(b=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO])&&g===b.asin&&(c=b.dimValues)}for(g=0;g<n.tvm.dimensionList.length;g++)b=n.tvm.dimtoValueMap[a[g].dimKey][a[g].val],!b&&c&&c[g]&&(b=c[g]),d[g]=b;return d},getDimNameByOrder:function(a){a=Number(a);var b=y;q.each(n.tvm.dimInfoMap,function(d,c){if(c.dimOrder===a)return b=d,!1});return b},isAlreadySelected:function(a,b){var d=!1,c=parseInt(b.dimValueIndex,
10),g=this.getDimNameByOrder(parseInt(b.dimIndex,10));if(g)q.each(a,function(a,b){b.dimKey===g&&(d=b.val===c?!0:!1)});else return!1;return d},initializeTwisterInteractionStartTime:function(){w.newTwisterInteractionStartTime=new Date},isDimensionSelected:function(a,b){return(a=n.tvm.dimensionList[a])&&(b=n.util.getUnselectedDims(b))&&0<b.length?-1===q.inArray(a,b):!1},createAccessibilityText:function(a,b){var d=b[e.STRING_ACCESSIBILITY_CURRENT_SELECTION],c=this.getDimensionValuesData(a,b);a=n.tvm.dimensionList;
var g=this.getDimDisplayMap(n.tvm),p=[];q.each(a,function(a,b){p.push(g[a]+" \x3d "+c[a])});return d+p.join(" , ")},getDimensionValuesDisplayData:function(a,b){var d;if(b){var c=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO];(d=b[e.INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA][a])||a!==c.asin||(d=c.dimValues)}return d||[]}};return b});x.when("A").register("dp-js-logger-service",function(u){return function(e,a,b,q){function n(a,b,c){b=b||{};"string"===typeof a&&(b.message+=a,a=y);b.logLevel=c;w.ueLogError&&w.ueLogError(a,
b)}function l(){var b=a.getDataToUploadOnUnload();t.logCounters(b);return null}var t=this,d=w.Twister,c=b!==y&&null!==b?b:"";q=q||!1;this.logFatal=function(a,b){n(a,b,"FATAL")};this.logError=function(a,b){n(a,b,"ERROR")};this.logCounter=function(a,b){a=""===c?a:c+":"+a;w.ue&&w.ue.count&&ue.count(a,b)};this.logCounters=function(a){e.each(a,function(a,b){a=c+":"+b.name;"undefined"!==typeof d&&d.printConsoleLogs&&x.log("Logging metric: "+a+" -\x3e "+b.value,"WARN","DPJSLogger");w.ue&&w.ue.count&&ue.count(a,
b.value)})};this.consoleLog=function(a){w.console&&"undefined"!==typeof d&&d.printConsoleLogs&&x.log(a,"WARN","DPJSLogger")};this.init=function(){if(q)if("undefined"!==typeof w.ue.onunload)w.ue.onunload(l);else e(w).bind("beforeunload",l)}}});x.when("A","dp-js-logger-service","twister-string-constants").register("dp-js-logger",function(u,e,a){var b=w.Twister;return function(q,n,l){function t(b){if(!b)return null;var c=n?n.jsInteractionEnabledTime:Date.now();return(b[a.TWISTER_EVENT_DATA_TIME]||Date.now())-
c}function d(a){if(a.hasOwnProperty("getMetricData"))return a.getMetricData();var b=a.stringVal;a=a.hasOwnProperty("getUploadValue")?a.getUploadValue():a.hasOwnProperty("currentValue")?a.currentValue:a.initValue;return isNaN(a)?null:{value:a,name:b}}var c=this,g=u.$,p;this.createFunctionTimer=function(a){return{eventType:a,start:function(){this.startTime=Date.now()},stop:function(){c.logImpression(this.eventType,{duration:Date.now()-this.startTime})}}};this.eventTypes={CLICK:{metricList:["M_CLICK_COUNT",
"M_FIRST_CLICK","M_VARIANTS_CLICKED"]},UNAVAILABLE_SWATCH_HOVER:{metricList:["UNAVAILABLE_SWATCH_HOVER_COUNT"]},CURRENTLY_UNAVAILABLE_SWATCH_HOVER:{metricList:["CURRENTLY_UNAVAILABLE_SWATCH_HOVER_COUNT"]},UNAVAILABLE_SWATCH_TABLET_CLICK:{metricList:["UNAVAILABLE_SWATCH_TABLET_CLICK_COUNT"]},UNAVAILABLE_SWATCH_PC_CLICK:{metricList:["UNAVAILABLE_SWATCH_PC_CLICK_COUNT"]},TWISTER_UNAVAILABILITY_NOTIFIER:{metricList:["UNAVAILABILE_VARIATIONS_COUNT","IS_UNAVAILABLITY_PRESENT"]},HOVER:{metricList:["M_HOVER_COUNT",
"M_FIRST_HOVER"]},HOVER_OUT:[],CACHE_HIT:{metricList:["M_CACHE_HIT","M_CACHE_USED"]},CACHE_MISS:{metricList:["M_CACHE_MISS","M_CACHE_USED"]},PAGE_UNLOAD:{metricList:["M_CACHE_UNUSED","M_CACHE_HIT_RATIO","M_CACHE_USED_RATIO"]},REQ_DIM_CHANGED:{metricList:["M_OTHER_REQ_DIM_SELECTED_COUNT","M_REQ_DIM_CHANGE_COUNT"]},DIM_SUM_LOAD:{metricList:["M_DIM_SUM_LOAD"]},CLICK_NA:{metricList:["M_NA_CLICK_COUNT"]},DIM_INIT:{metricList:["M_DIM_PAGENATION_COUNT"]},SCROLL:{metricList:["M_VIEWED_DIM_COUNT"]},CLICK_VARIATION:{metricList:["M_DIM_CLICK_VIEWED_DIM_COUNT"]},
EXPAND_BUTTON_CLICK:{metricList:["EXPAND_BUTTON_CLICK_COUNT"]},COLLAPSE_BUTTON_CLICK:{metricList:["COLLAPSE_BUTTON_CLICK_COUNT"]},EXPANDER:{metricList:["EXPANDER_COUNT"]},HISTORY_API_SUPPORTED:{metricList:["M_HISTORY_API_SUPPORTED"]},HISTORY_API_NOT_SUPPORTED:{metricList:["M_HISTORY_API_NOT_SUPPORTED"]},TWISTER_GREY_OVERLAY_TIME_DESKTOP:{metricList:["M_TWISTER_GREY_OVERLAY_TIME_DESKTOP"]}};var C=function(c,d){this.stringVal=d;this.initValue=NaN;this.deferLogging=!0;this.pagenationCountName=c;this.updateFunction=
function(c){var h;h=25*Math.ceil(c[a.TWISTER_EVENT_DATA_PERCENTAGE]/25);var d=c[a.TWISTER_EVENT_DATA_DIV_METADATA][a.STRING_DIM_INDEX];this.metrics||(this.metrics={});this.metrics[d]||(this.metrics[d]={});(this.metrics[d].percentage||0)<h&&(this.metrics[d].percentage=h);this.metrics[d].pageCount=c[a.TWISTER_EVENT_DATA_COUNT];this.metrics[d].dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];"undefined"!==typeof b&&b.printConsoleLogs&&x.log(this.stringVal+": index - "+d+" page - "+this.metrics[d].pageCount+
" percentage - "+this.metrics[d].percentage,"WARN","DPJSLogger")};this.getMetricData=function(){if(this.metrics){var a=[],b=this;g.each(this.metrics,function(c,v){c=b.pagenationCountName+v.pageCount;v.dimDisplayType&&(c=v.dimDisplayType+":"+c);a.push({name:c+"_"+(b.stringVal+v.percentage),value:1})});return a}}},f={M_CACHE_HIT:{stringVal:"CacheHit",initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue=0<this.currentValue?this.currentValue+1:1;"undefined"!==typeof b&&b.printConsoleLogs&&
x.log("incrementing cacheHit count to "+this.currentValue,"WARN","DPJSLogger")}},M_CACHE_MISS:{stringVal:"CacheMiss",initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue=0<this.currentValue?this.currentValue+1:1}},M_CACHE_HIT_RATIO:{stringVal:"CacheHitRatio",initValue:NaN,deferLogging:!0,updateFunction:function(a){a=c.getMetricCurrentValue("M_CACHE_HIT");var b=c.getMetricCurrentValue("M_CACHE_MISS");if(a||b)this.currentValue=Math.round(a/(a+b)*100)}},M_CACHE_USED:{stringVal:"CacheUsed",
initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue||(this.currentValue=this.initValue,this.usedIdCache={});a=a.id;this.usedIdCache.hasOwnProperty(a)||(this.currentValue++,this.usedIdCache[a]=!0)}},M_CACHE_UNUSED:{stringVal:"CacheUnused",initValue:0,deferLogging:!0,updateFunction:function(a){if(n)a=n.twisterModel.pageRefresh.getModelCacheSize("full")-c.getMetricCurrentValue("M_CACHE_USED"),this.currentValue=0>a?0:a;else throw"EventController undefined";}},M_CACHE_USED_RATIO:{stringVal:"CacheUsedRatio",
initValue:NaN,deferLogging:!0,updateFunction:function(a){a=c.getMetricCurrentValue("M_CACHE_USED");var b=c.getMetricCurrentValue("M_CACHE_UNUSED");if(a||b)this.currentValue=Math.round(a/(a+b)*100)}},M_FIRST_CLICK:{stringVal:"FirstClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.firstClickLogged||(this.currentValue=t(a),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("first click \x3d "+this.currentValue,"WARN","DPJSLogger"),this.firstClickLogged=!0)}},M_CLICK_COUNT:{stringVal:"ClickCount",
initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("incrementing click count to "+this.currentValue,"WARN","DPJSLogger")}},M_VARIANTS_CLICKED:{stringVal:"VariantsClicked",initValue:0,deferLogging:!0,updateFunction:function(a){a=a.divMetaData;this.lastClickedDivMetaData&&a&&this.lastClickedDivMetaData.dimIndex===a.dimIndex&&this.lastClickedDivMetaData.dimValueIndex===a.dimValueIndex||(this.lastClickedDivMetaData=a,this.currentValue=
0<this.currentValue?this.currentValue+1:1,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("incrementing variants click count to "+this.currentValue,"WARN","DPJSLogger"))}},M_HOVER_COUNT:{stringVal:"HoverCount",initValue:0,deferLogging:!0,updateFunction:function(a){a=a.divMetaData;this.lastHoveredDivMetaData&&a&&this.lastHoveredDivMetaData.dimIndex===a.dimIndex&&this.lastHoveredDivMetaData.dimValueIndex===a.dimValueIndex||(this.lastHoveredDivMetaData=a,this.currentValue=0<this.currentValue?this.currentValue+
1:1,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("incrementing hover count to "+this.currentValue,"WARN","DPJSLogger"))}},M_FIRST_HOVER:{stringVal:"FirstHover",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.firstHoverLogged||(this.currentValue=t(a),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("first hover \x3d "+this.currentValue,"WARN","DPJSLogger"),this.firstHoverLogged=!0)}},M_OTHER_REQ_DIM_SELECTED_COUNT:{stringVal:"OtherReqDimSelectedCount",initValue:NaN,deferLogging:!0,
updateFunction:function(a){var c=a.newReqDimValueIndex;a=a.oldReqDimValueIndex;"X"===c?this.currentValue||(this.lastReqDimValueIndex=a,this.currentValue=0):this.lastReqDimValueIndex!==c&&(this.lastReqDimValueIndex=c,this.currentValue||0===this.currentValue?this.currentValue++:"X"===a?this.currentValue=0:this.currentValue=1,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("OtherReqDimSelectedCount incremented to : "+this.currentValue,"WARN","DPJSLogger"))}},M_REQ_DIM_CHANGE_COUNT:{stringVal:"ReqDimChangeCount",
initValue:0,deferLogging:!0,updateFunction:function(a){this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("ReqDimChangeCount incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=1}},M_DIM_SUM_LOAD:{stringVal:"DimSumLoadingDuration",initValue:NaN,deferLogging:!1,updateFunction:function(c){this.currentValue=c[a.TWISTER_EVENT_DATA_DURATION];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DimSumLoadingDuration: "+this.currentValue,"WARN",
"DPJSLogger")}},M_TWISTER_GREY_OVERLAY_TIME_DESKTOP:{stringVal:"DPTwisterGreyOverlayDesktopDuration",initValue:NaN,deferLogging:!1,updateFunction:function(c){this.currentValue=c[a.TWISTER_EVENT_DATA_DURATION];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DPTwisterGreyOverlayDesktopDuration: "+this.currentValue,"WARN","DPJSLogger")}},M_NA_CLICK_COUNT:{stringVal:"NAClickCount",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&
b.printConsoleLogs&&x.log("NAClick incremented to: "+this.currentValue,"WARN","DPJSLogger")}},M_DIM_PAGENATION_COUNT:{stringVal:"DimPageCount",initValue:1,deferLogging:!1,updateFunction:function(c){this.pageCount=c[a.TWISTER_EVENT_DATA_COUNT]||1;this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];"undefined"!==typeof b&&b.printConsoleLogs&&x.log("DimPageCount: "+this.pageCount,"WARN","DPJSLogger")},getMetricData:function(){var a=this.stringVal+(this.pageCount||1);this.dimDisplayType&&(a=this.dimDisplayType+
":"+a);return{name:a,value:1}}},M_VIEWED_DIM_COUNT:new C("DimPageCount","ViewedVariationCount"),M_DIM_CLICK_VIEWED_DIM_COUNT:new C("DimPageCount","ViewedVariationCountBeforeClick"),EXPAND_BUTTON_CLICK_COUNT:{stringVal:"ExpandButtonClickCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Expand Button Click Count incremented to : "+this.currentValue,
"WARN","DPJSLogger")):this.currentValue=1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+":"+a);return{name:a,value:this.currentValue}}},COLLAPSE_BUTTON_CLICK_COUNT:{stringVal:"CollapseButtonClickCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Collapse Button Click Count incremented to : "+this.currentValue,
"WARN","DPJSLogger")):this.currentValue=1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+":"+a);return{name:a,value:this.currentValue}}},EXPANDER_COUNT:{stringVal:"ExpanderCount",initValue:0,deferLogging:!0,updateFunction:function(c){this.dimDisplayType=c[a.TWISTER_EVENT_DATA_DISPLAY_TYPE];this.currentValue?(this.currentValue++,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Expander Count incremented to : "+this.currentValue,"WARN","DPJSLogger")):this.currentValue=
1},getMetricData:function(){var a=this.stringVal;this.dimDisplayType&&(a=this.dimDisplayType+":"+a);return{name:a,value:this.currentValue}}},IS_UNAVAILABLITY_PRESENT:{stringVal:"UnavailabilityPresent",initValue:NaN,deferLogging:!0,updateFunction:function(a){"undefined"===typeof this.currentValue&&(this.currentValue=0,0<a.noOfUnavailableVariations&&(this.currentValue=1),"undefined"!==typeof b&&b.printConsoleLogs&&x.log("IsUnavailabilityPresent : "+this.currentValue,"WARN","DPJSLogger"))}},UNAVAILABILE_VARIATIONS_COUNT:{stringVal:"UnavailableVariations",
initValue:NaN,deferLogging:!0,updateFunction:function(a){"undefined"==typeof this.currentValue&&(this.currentValue=a.noOfUnavailableVariations,"undefined"!==typeof b&&b.printConsoleLogs&&x.log("Possible unavailable variations present are : "+this.currentValue,"WARN","DPJSLogger"))}},UNAVAILABLE_SWATCH_HOVER_COUNT:{stringVal:"UnavailableSwatchHover",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchHoverCount is incremented to : "+
this.currentValue,"WARN","DPJSLogger")}},CURRENTLY_UNAVAILABLE_SWATCH_HOVER_COUNT:{stringVal:"CurrentlyUnavailableSwatchHover",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("CurrentlyUnavailableSwatchHoverCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},UNAVAILABLE_SWATCH_PC_CLICK_COUNT:{stringVal:"UnavailableSwatchPCClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=
(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchPCClickCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},UNAVAILABLE_SWATCH_TABLET_CLICK_COUNT:{stringVal:"UnavailableSwatchTabletClick",initValue:NaN,deferLogging:!0,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("UnavailableSwatchTabletClickCount is incremented to : "+this.currentValue,"WARN","DPJSLogger")}},M_HISTORY_API_SUPPORTED:{stringVal:"HistoryAPISupported",
initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("History API is supported in the browser : "+this.currentValue,"WARN","DPJSLogger")}},M_HISTORY_API_NOT_SUPPORTED:{stringVal:"HistoryAPINotSupported",initValue:0,deferLogging:!1,updateFunction:function(a){this.currentValue=(this.currentValue||0)+1;"undefined"!==typeof b&&b.printConsoleLogs&&x.log("History API is not supported in the browser : "+this.currentValue,
"WARN","DPJSLogger")}}};this.logImpression=function(a,c){try{g.each(a.metricList,function(a,h){try{var g=f[h];g.updateFunction(c);f[h].deferLogging||p.logCounters(Array(d(g)))}catch(v){"undefined"!==typeof b&&b.printConsoleLogs&&x.log("metricUpdate failing for metric \x3d "+h,"WARN","DPJSLogger")}})}catch(m){"undefined"!==typeof b&&b.printConsoleLogs&&x.log("logImpression failed","ERROR","DPJSLogger")}};this.logFatal=function(a,b){p&&p.logFatal(a,b)};this.logError=function(a,b){p&&p.logFatal(a,b)};
this.logCounter=function(a,b){p.logCounter(a,b)};this.addCSMTag=function(a){w.ue&&w.ue.tag&&w.ue.tag(a)};this.consoleLog=function(a){p&&p.logFatal(a)};this.logPresenceOfUnavailability=function(a,b){a=a.num_total_variations;b=b.dimensionValuesData;for(var c=1,h=b.length,d=0;d<h;d++)c*=b[d].length;this.logImpression(this.eventTypes.TWISTER_UNAVAILABILITY_NOTIFIER,{noOfUnavailableVariations:c-a})};this.logUnavailableSwatchClick=function(){this.logImpression(this.eventTypes.CLICK_NA,null);var a=this.eventTypes.UNAVAILABLE_SWATCH_PC_CLICK;
"undefined"!==typeof b&&b.isTabletWeb&&(a=this.eventTypes.UNAVAILABLE_SWATCH_TABLET_CLICK);this.logImpression(a,null)};this.getDataToUploadOnUnload=function(a){this.logImpression(this.eventTypes.PAGE_UNLOAD);var b=[];g.each(f,function(a,c){try{if(c.deferLogging){var f=d(c);f&&(g.isArray(f)?b=g.merge(f,b):b.push(f))}}catch(v){}});return b};this.getMetricCurrentValue=function(a){try{return f[a].hasOwnProperty("currentValue")?f[a].currentValue:f[a].initValue}catch(b){return f[a].initValue}};p=new e(g,
c,q,l);p.init()}});x.when("A","jQuery").register("detail-page-state-controller",function(){return function(){this.state={};this.getState=function(){return this.state};this.setState=function(u,e){u&&e&&(this.state[u]=e)}}});x.when("A","jQuery").register("detail-page-framework",function(){return{callbacks:{},registerCallback:function(u,e,a){"after_redraw"!==u&&"asin_select"!==u||"sims-widget"!==e&&"session-similarities"!==e&&"purchase-similarities"!==e&&"buyxgety"!==e||(this.callbacks[e+"_feature_div"]=
a)},registerFeature:function(){},registerFeatureConfig:function(){}}});x.when("A","jQuery","dp-js-logger").register("dp-ajax-prefetch-metrics",function(u,e,a){function b(a){this.scope="dpPre"+a;this.data={}}new a("PrefetchMetrics");b.prototype._count=function(a,b){a=this.scope+a;var e;w.ue&&w.ue.count&&(e="undefined"!==typeof b?(e=ue.count(a,b))||b:(e=ue.count(a))||0);return e};b.prototype._incrementCounter=function(a){this._count(a,(this._count(a)||0)+1)};b.prototype._record=function(a,b,e){this.data[b]=
this.data[b]||{};this.data[b][a]||(this.data[b][a]=e||(new Date).getTime(),"predicted"===a?this._incrementCounter("Predicted"):"selected"===a&&this.data[b].predicted?(a=this.data[b].selected-this.data[b].predicted,this.data[b].lookahead=a,this._incrementCounter("PredictedSelect"),this._count("LookAhead"+this._count("PredictedSelect"),a),this._count("LookAhead",a)):"selected"!==a||this.data[b].predicted||this._incrementCounter("UnpredictedSelect"))};b.prototype.setCounter=function(a,b){this._count(a,
b)};b.prototype.predicted=function(a,b){this._record("predicted",a,b)};b.prototype.selected=function(a,b){this._record("selected",a,b)};b._allInstances={};b.getInstance=function(a){if(!a)throw"Undefind scope. scope is a required parameter";b._allInstances[a]||(b._allInstances[a]=new b(a));return b._allInstances[a]};return b});x.when("A","twister-string-constants","twister-variations-data","parent-view","twister-view","twister-model","twister-model-new","twister-state","twister-availabilty-cache",
"twister-utils","evdd-utils","dp-js-logger","TwisterCore","twister-data-translator","twister-productization-view","view-util","detail-page-state-controller-view","hover-refresh-view","twister-dimension-subview-promise-handler").register("twister-controller",function(u,e,a,b,q,n,l,t,d,c,g,p,C,f,E,A,m,h,F){return function(v){var r=this;r.logger=new p(null,this);var D=f.getTranslatedData(v),k=v.inlineTwisterData&&v.inlineTwisterData.inlineTwisterEnabled,n=!(!v.inlineTwisterData||!v.inlineTwisterData.shouldDelayRegistrationWithTwisterCore);
r.twisterCore=function(a){var b=y;if(k||a!==y)b=new C(a);return b}(D);(function(){r.twisterCore!==y&&(r.productizationView=new E(r.twisterCore),r.hoverRefreshView=new h(r.twisterCore,v,p),F.getDimensionSubViewPromise("page-refresh-view").then(function(a){r.pageRefreshView=new a(r.twisterCore,v,p)}))})();v[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]=k||A.isViewsEligibleForMigration(v);r.twisterJSInitData=v;r.twisterVariationsData=new a(v,r.twisterCore);r.twisterAvailabilityCache=new d(r.twisterVariationsData,
v);r.initTwisterState=new t(v,r.twisterVariationsData,r.twisterAvailabilityCache);k?(r.pageRefreshViewPromise=F.getDimensionSubViewPromise("page-refresh-view"),r.detailPageStateControllerView=new m(v,r.twisterCore),D=void 0):r.twisterCore!==y&&v[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]?(r.detailPageStateControllerView=new m(v,r.twisterCore),D=new b(r,v,r.twisterVariationsData,r.twisterAvailabilityCache,r.twisterCore)):D=new q(r,r.initTwisterState,v,r.twisterVariationsData,r.twisterAvailabilityCache);
r.twisterView=D;u.on("desktop-twister-view-initialized",function(){u.trigger("register-desktop-twister-with-twisterCore",r.twisterCore,r.pageRefreshViewPromise)});u.on("desktop-twister-twisterCore-initialized",function(a){r.twisterView=a;r.twisterModel=new l(r,v,r.twisterVariationsData,r.productizationView);x.register("desktop-twister-model")});n?x.when("ImageBlockController","desktop-twister-view-initialiser").execute("register-desktop-twister-with-twisterCore",function(){u.trigger("register-desktop-twister-with-twisterCore",
r.twisterCore,r.pageRefreshViewPromise)}):u.trigger("register-desktop-twister-with-twisterCore",r.twisterCore,r.pageRefreshViewPromise);x.register("desktop-twister",function(){return r.twisterCore});k||(r.twisterModel=new l(r,v,r.twisterVariationsData,r.productizationView),x.register("desktop-twister-model"));r.jsInteractionEnabledTime=Date.now();r.logger.logPresenceOfUnavailability(v,r.twisterVariationsData);r.onInitializeTwister=function(){!k&&r.twisterView.onInitializeTwister()};r.populateEVDD=
function(a){var b=r.twisterView,c=r.twisterVariationsData.asinToDimIndexMapData,h=r.twisterModel.twisterState.getMaster();a&&b.isAllViewsInitialized().then(function(){(new g).PopulateEVDD(a,b,c,h)})};r.handleClick=function(a){r.divMetaData=a;r.logger.logImpression(r.logger.eventTypes.CLICK,{divMetaData:a});var b=r.initTwisterState.getCurrentDimCombID(),h=c.reconstructCombinationWithDimValue(b,a.dimIndex,a.dimValueIndex);w.newTwisterInteractionStartTime=new Date;c.isSwatchSelected(a,r.twisterVariationsData)||
b===h||(r.enableMouseOut=0,r.twisterModel.handleClick(a),r.twisterAvailabilityCache.isDimCombinationAvailable(h)||r.logger.logUnavailableSwatchClick())};r.handleExternalViewClick=function(a,b){try{r.handleClick(a)}catch(c){(new p(b,this)).logFatal(c,{message:"[Failed to hand over click event of external view]"})}};r.handleMouseOver=function(a){if("undefined"!==typeof w.touchDeviceDetected&&w.touchDeviceDetected)return r.handleClick(a),!0;r.logger.logImpression(r.logger.eventTypes.HOVER,{divMetaData:a});
r.enableMouseOut=1;r.twisterModel.handleMouseOver(a);return!0};r.handleExternalViewMouseOver=function(a,b){try{r.handleMouseOver(a)}catch(c){(new p(b,this)).logFatal(c,{message:"[Failed to hand over mouse over event of external view]"})}};r.handleMouseOut=function(a,b,c){1===r.enableMouseOut&&r.twisterModel.handleMouseOut(a,b,c)};r.handleExternalViewMouseOut=function(a,b,c,h){try{r.handleMouseOut(a,b,c)}catch(v){(new p(h,this)).logFatal(v,{message:"[Failed to hand over mouse out event of external view]"})}};
r.handleDropdownOnChange=function(a,b){w.newTwisterInteractionStartTime=new Date;r.logger.logImpression(r.logger.eventTypes.CLICK,{divMetaData:b});r.twisterModel.twisterState.setPreHoverData(b);r.twisterModel.handleDropdownChange(b)};r.registerExternalView=function(a,b){r.twisterModel.registerExternalView(a,b)}}});x.when("3p-promise").register("twister-dimension-subview-promise-handler",function(u){var e={};return{getDimensionSubViewPromise:function(a){if(e[a])return e[a].viewConstructor;e[a]={viewConstructor:null};
var b=new u(function(b,n){e[a].resolve=b});return e[a].viewConstructor=b},registerDimensionSubView:function(a,b){e[a]?e[a].resolve(b):e[a]={viewConstructor:u.resolve(b)}}}});x.when("twister-dimension-subview-promise-handler","twister-string-constants").register("twister-dimension-view-promise-factory",function(u,e){function a(a,q,n){this.dimCount=n;this.dimensionDisplayType=a[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][n];this.dimensionDisplaySubType=a[e.INIT_DATA_DIMENSIONS_DISPLAY_SUB_TYPE_MAP][n];
this.dimName=a[e.INIT_DATA_DIMENSIONS_MAP][n];this.dimensionsMap=a[e.INIT_DATA_DIMENSIONS_MAP];this.dimensionDisplayString=a[e.INIT_DATA_DIMENSIONS_DISPLAY][n];this.dimensionValuesData=q.dimensionValuesData[n];this.displayConfigStylesData=q.displayConfigStylesData[this.dimensionDisplayType];this.twisterVariationsData=q;this.isIconPresentForDimensionValue=function(){var l=[];if("undefined"!==typeof a[e.DIMENSION_VALUE_HAS_ICON])l=a[e.DIMENSION_VALUE_HAS_ICON][n];else for(var t=0;t<q.dimensionValuesData[n].length;t++)l.push(0);
return l}}return{registerDimensionSubView:function(a,e){u.registerDimensionSubView(a,e)},getDimensionSubViewPromise:function(b,q,n,l,t,d){return u.getDimensionSubViewPromise(b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][n]).then(function(c){var g=new a(b,q,n),p={};p[e.STRING_DIM_ORDER]=g.dimCount;p[e.STRING_DIM_NAME]=g.dimName;p[e.STRING_DIMENSIONS_MAP]=g.dimensionsMap;p[e.STRING_DIMENSION_DISPLAY_STRING]=g.dimensionDisplayString;p[e.STRING_DIMENSION_VALUES_DATA]=g.dimensionValuesData;p[e.STRING_DISPLAY_CONFIG_STYLES_DATA]=
g.displayConfigStylesData;p[e.STRING_TWISTER_CONTROLLER_HANDLE]=l;p[e.STRING_TWISTER_INITIAL_STATE_KEY]=t;p[e.STRING_TWISTER_AVAILABILITY_CACHE]=t!==y?t.twisterAvailabilityCache:d!==y?d.twisterAvailabilityCache:y;p[e.STRING_TWISTER_VARIATION_DATA]=g.twisterVariationsData;p[e.STRING_IS_SLOTS_ENABLED]=w.Twister[e.STRING_IS_SLOTS_ENABLED]&&w.Twister[e.STRING_IS_SLOTS_ENABLED][g.dimCount];p[e.DIMENSION_VALUE_HAS_ICON]=g.isIconPresentForDimensionValue();p[e.DIMENSION_SUB_TYPE]=g.dimensionDisplaySubType;
p[e.PRODUCTIZED_PARENT_VIEW]=d;p[e.PRODUCTIZED_VIEW_UTIL]=d?d.viewUtil:y;return new c(b,p)})}}});x.when("A","twister-shelf","twister-counter","twister-vodd","twister-beaconized-evdd","twister-native-evdd","twister-dimension-views-swatch","twister-dimension-views-dropdown","twister-dimension-views-singleton","twister-string-constants","view-util").register("twister-dimension-view-factory",function(u,e,a,b,q,n,l,t,d,c,g){function p(a,b,c){this.dimCount=c;this.dimensionDisplayType=a.dimensionsDisplayType[c];
this.dimensionDisplaySubType=a.dimensionsDisplaySubType[c];this.dimName=a.dimensions[c];this.dimensionsMap=a.dimensions;this.dimensionDisplayString=a.dimensionsDisplay[c];this.dimensionValuesData=b.dimensionValuesData[c];this.displayConfigStylesData=b.displayConfigStylesData[this.dimensionDisplayType];this.twisterVariationsData=b;this.isIconPresentForDimensionValue=function(){var h=[];if("undefined"!==typeof a.isIconPresentForDimensionValue)h=a.isIconPresentForDimensionValue[c];else for(var d=0;d<
b.dimensionValuesData[c].length;d++)h.push(0);return h}}var C=w.Twister,f=u.$;return{getDimensionSubViewObject:function(g,u,m,h,F,v){m=new p(g,u,m);u={};u[c.STRING_DIM_ORDER]=m.dimCount;u[c.STRING_DIM_NAME]=m.dimName;u[c.STRING_DIMENSIONS_MAP]=m.dimensionsMap;u[c.STRING_DIMENSION_DISPLAY_STRING]=m.dimensionDisplayString;u[c.STRING_DIMENSION_VALUES_DATA]=m.dimensionValuesData;u[c.STRING_DISPLAY_CONFIG_STYLES_DATA]=m.displayConfigStylesData;u[c.STRING_TWISTER_CONTROLLER_HANDLE]=h;u[c.STRING_TWISTER_INITIAL_STATE_KEY]=
F;u[c.STRING_TWISTER_AVAILABILITY_CACHE]=F!==y?F.twisterAvailabilityCache:v!==y?v.twisterAvailabilityCache:y;u[c.STRING_TWISTER_VARIATION_DATA]=m.twisterVariationsData;u.isSlotsEnabled=f.isArray(C.isSlotsEnabled)?C.isSlotsEnabled[m.dimCount]:y;u.isIconPresentForDimensionValue=m.isIconPresentForDimensionValue();u.dimensionDisplaySubType=m.dimensionDisplaySubType;u[c.PRODUCTIZED_PARENT_VIEW]=v;u[c.PRODUCTIZED_VIEW_UTIL]=v?v.viewUtil:y;a:switch(m.dimensionDisplayType){case c.TWISTER_DIMENSION_VIEW_SWATCH:h=
l;break;case c.TWISTER_DIMENSION_VIEW_DROPDOWN:h=t;break;case c.TWISTER_DIMENSION_VIEW_SINGLETON:h=d;break;case c.TWISTER_DIMENSION_VIEW_EVDD:h=f("html").hasClass("a-lt-ie8")?n:q;break;case c.TWISTER_DIMENSION_VIEW_VODD:h=b;break;case c.TWISTER_DIMENSION_VIEW_COUNTER:h=a;break;case c.TWISTER_DIMENSION_VIEW_SHELF:h=e;break;default:h=y;break a}return new h(g,u)}}});x.when("A").execute(function(){"function"===typeof uet&&uet("bb","clickToTwister",{wb:1})});x.when("twisterModule").execute(function(u){"function"===
typeof uex&&"function"===typeof uet&&(uet("be","clickToTwister",{wb:1}),uet("be","TwisterAUIWait",{wb:1}),uex("ld","clickToTwister",{wb:1}),uex("ld","TwisterAUIWait",{wb:1}))});x.when("A","twister-string-constants","twister-js-init-dpx-data","twister-controller","page-refresh-manager","dimensional-summary-module","dp-js-logger","twister-common-constants").register("twister-init",function(u,e,a,b,q,n,l,t){w.DetailPage={};var d={};w.Twister={};var c=w.Twister,g=w.DetailPage;c.$=u.$;c.DimensionViews=
{};var p=new l("dpTwister");c.isIEBrowser=function(a){return a.browser.msie||!!navigator.userAgent.match(/Trident/)};c.isIE8=function(){var a=c.A.$;return a("html").hasClass("a-lt-ie9")};c.A=u;(function(){if(!u.$.isEmptyObject(a)){var b=a.updateDivLists;c.dpEnvironment=a.dpEnvironment;c.isInstaTwisterEnabled=!0;d.productTypeName=a.ajaxUrlParams.match("productTypeDefinition\x3d[A-Za-z_]+")?a.ajaxUrlParams.match("productTypeDefinition\x3d[A-Za-z_]+")[0].split("\x3d")[1]:null;c.productTypeName=d.productTypeName;
d.storeID=a.ajaxUrlParams.match("storeId\x3d[A-Za-z1-9_]+")?a.ajaxUrlParams.match("storeId\x3d[A-Za-z1-9_]+")[0].split("\x3d")[1]:null;d.productGroupID=a.ajaxUrlParams.match("productGroupId\x3d[A-Za-z_]+")?a.ajaxUrlParams.match("productGroupId\x3d[A-Za-z_]+")[0].split("\x3d")[1]:null;a.ajaxUrlParams.match("productTypeDefinition")&&!d.productTypeName&&p.logCounter("productTypeNameNullInJsInit",1);a.ajaxUrlParams.match("storeId")&&!d.storeID&&p.logCounter("storeIDNullInJsInit",1);a.ajaxUrlParams.match("productGroupId")&&
!d.productGroupID&&p.logCounter("productGroupIDNullInJsInit",1);c.isImmersiveViewEnabled=a.isImmersiveViewEnabledOnDim?a.isImmersiveViewEnabledOnDim:a.isImmersiveViewEnabled;c.isSlotsEnabled=a.isSlotsEnabled;c.isPWBadgeEnabled=a.isPWBadgeEnabled?a.isPWBadgeEnabled:!1;c.isImmersiveViewEnabledOnPage=a.isImmersiveViewEnabled;c.isImmersiveExperience=a.isImmersiveExperience?a.isImmersiveExperience:a.isImmersiveViewEnabled;c.multiDimensionWeblabEnabled=a.multiDimensionWeblabEnabled?a.multiDimensionWeblabEnabled:
!1;c.immersivePartialStateMessage=a.immersivePartialStateMessage?a.immersivePartialStateMessage:"";c.immersiveFullySelectedStateMessage=a.immersiveFullySelectedStateMessage?a.immersiveFullySelectedStateMessage:"";c.immersiveBannersPresent=a.immersiveBannersPresent?a.immersiveBannersPresent:!1;c.globalAjaxParameters={};c.isTabletWeb=a.isTabletWeb;c.isAssemblyVariationsEnabled=a.isAssemblyVariationsEnabled?a.isAssemblyVariationsEnabled:!1;var f=a.contextMetaData;d.contextMetaData=a.contextMetaData;
var g=f.full,t=f.master,m=f.parent,f=f.partial;d.inlineTwisterData=a.inlineTwisterData||{};var h=d.inlineTwisterData.inlineTwisterEnabled,l=d.inlineTwisterData.inlineTwisterEnabled;(d.dimensionsDisplayType=a.dimensionsDisplayType)||p.logCounter("dpxDisplayTypePropertyUndefined",1);d[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]=a[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]?a[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]:"";d[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]=a[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]?
a[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]:"";d.currentlyUnavailableAsins=a.currentlyUnavailableAsins?a.currentlyUnavailableAsins:[];d.dimensionSelectionData=a.dimensionSelectionData;d.dimensionsDisplaySubType=a.dimensionsDisplaySubType?a.dimensionsDisplaySubType:[];d.ajaxUrlParams=a.ajaxUrlParams;d.displayTypeProperties=a.displayTypeProperties?a.displayTypeProperties:[];d.maxSwatchesForImmersiveView=a.maxSwatchesForImmersiveView?a.maxSwatchesForImmersiveView:[];d[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]=
a[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]?a[e.INIT_DATA_PW_ENABLED_DIMENSION_MAP]:[];l||h||!d.dimensionsDisplayType||"counter"!==d.dimensionsDisplayType[0]||"undefined"!==typeof a.displayTypeProperties[0].expandedViewEnabled||(d.useCounterConfig=!0,d.expandedViewEnabled=a.expandedViewEnabled?a.expandedViewEnabled:[],d.minAsinForExpandedView=a.minAsinForExpandedView?a.minAsinForExpandedView:[],d.minAsinForExpandedScroll=a.minAsinForExpandedScroll?a.minAsinForExpandedScroll:[]);if("undefined"!==typeof a.twisterUpdateURLInfo){var h=
a.twisterUpdateURLInfo,l=h.immutableURLPrefix,v=h.immutableParams,r=a.twisterUpdateURLInfo.immutableParams,D;for(D in r)if("function"!==typeof r.hasOwnProperty||r.hasOwnProperty(D))l+=(-1===l.indexOf("?")?"?":"\x26")+D+"\x3d"+r[D],v[D]=r[D];h.immutableURLPrefix=l;c.globalAjaxParameters=r;d.twisterUpdateURLInfo=a.twisterUpdateURLInfo}d.dimToAsinMapData=a.dimensionToAsinMap;d.asinToDimIndexMapData=a.asinToDimensionIndexMap;d.dimensionValuesData=a.dimensionValuesData;d.variation_values=a.variationValues;
d.asin_variation_values=a.asinVariationValues;d.reactId=a.reactId;d.currentDimCombID=a.currentDimensionCombinationId;d.selected_variation_values=a.selectedVariationValues;d.dimensionHierarchyData=a.dimensionHierarchyData;d.topHierarchicalDimensionIndex=a.topHierarchicalDimensionIndex;d.hierarchicalPivoting=a.hierarchicalPivoting;d.isIconPresentForDimensionValue=a.isIconPresentForDimensionValue;d.singletonDimensionKeys=a.singletonDimensionKeys;d.current_asin=a.currentAsin;d.landingAsin=a.landingAsin;
d.parent_asin=a.parentAsin;d.deletedLandingAsinInfo=a.deletedLandingAsinInfo;d.num_total_variations=a.num_total_variations;d.dimensions=a.dimensions;d.unselectedDimCount=a.unselectedDimCount;d.selected_variations=a.selected_variations||{};d.dimensionValuesDisplayData=a.dimensionValuesDisplayData;d.prirotizeReqPrefetch=a.prioritizeReqPrefetch;d.num_variation_dimensions=a.num_variation_dimensions;d.num_total_variations=a.num_total_variations;d.dimensionsDisplay=a.dimensionsDisplay||{};d.variationDisplayLabels=
a.variationDisplayLabels;null!=b.full&&(g.elementList=null!=g.elementList?b.full.concat(g.elementList):b.full);null!=b.master&&(t.elementList=null!=t.elementList?b.master.concat(t.elementList):b.master);null!=b.parent&&(m.elementList=null!=m.elementList?b.parent.concat(m.elementList):b.parent);null!=b.partial&&(f.elementList=null!=f.elementList?b.partial.concat(f.elementList):b.partial)}})();d.ajaxTimeout=a.ajaxTimeout;d.displayConfigStylesData=a.displayConfigStylesData;d.keysToPopulateDetailPageStateController=
a.keysToPopulateDetailPageStateController;d.twisterAccessibilityCurrentSelection=a.twisterAccessibilityCurrentSelection;c.remainingAjaxCalls=0;c.errorMessageOnFailure="We are sorry.  Amazon has encountered an error.  Please try again.";d.deviceType=a.deviceType;c.deviceType=d.deviceType;c.useAui=1;c.useAuiAjax=1;d.measurement=a.measurement;c.atfMarkerCount=d.measurement.atf.count;c.cfMarkerCount=d.measurement.cf.count;c.cfImageLongPollTag=d.measurement.cf.longPollImageTag;c.cfHtmlLongPollTag=d.measurement.cf.longPollHtmlTag;
u.state("URL-Refresh-State",{landingAsin:d.landingAsin,isUrlRefreshEnable:"web"===d.deviceType?1:0});w.twisterController=new b(d);(function(){var a={};a.dimensionsList=d.dimensions;a.dimensionValuesList=d.dimensionValuesData;a.dimensionCombinationToASINMap=d.dimToAsinMapData;a.scopeSuffix="twister";a.globalAjaxParameters=c.globalAjaxParameters;c.dimensionalSummaryModule=new n(a)})();(function(a){function b(a,c,h){var v=[];if(c===h)v.push(""),a=a[c],u.$.isArray(a)?u.each(a,function(a,b){v.push(a)}):
v.push(a);else{var k=Math.floor((c+h)/2);c=b(a,c,k);var d=b(a,k+1,h);u.each(c,function(a,b){u.each(d,function(b,c){v.push(""===a?b:""===b?a:a+":"+b)})})}return v}var c=[],d=t.FAMILY_SIZE_BUCKET_LIMITS,g=t.DEFAULT_SELECTION_TAG,h=[],l=!0,v,r;a.dimensions&&(v="variation_dimension:"+a.dimensions.length,u.each(a.dimensions,function(a,b){p.addCSMTag(a)}));if(a.dimToAsinMapData){var D=0,k;for(k in a.dimToAsinMapData)a.dimToAsinMapData.hasOwnProperty(k)&&D++;p.logCounter("numberOfChildAsins",D);for(k=1;k<
d.length;k++)if(D<=d[k]){r="family_size_bucket:"+d[k-1]+"-"+d[k];break}else k===d.length-1&&(r="family_size_bucket:gt"+d[k])}a.dimensionsDisplayType&&u.each(a.dimensionsDisplayType,function(b,c){-1===h.indexOf(b)&&h.push(b);b===e.TWISTER_DIMENSION_VIEW_SWATCH&&a.dimensionsDisplaySubType&&(b="s"+a.dimensionsDisplaySubType[c],-1===h.indexOf(b)&&h.push(b))});a.dimensionSelectionData&&u.each(a.dimensionSelectionData,function(a,b){a.isSelected||(l=!1)});v&&c.push(v);r&&c.push(r);h&&c.push(h);l&&g&&c.push(g);
(function(a){u.each(a,function(a,b){a&&p.addCSMTag(a)})})(b(c,0,c.length-1))})(d);(function(a){var b={};a.extend(b,{ajaxReadyState:{NONE:-1,UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},ajaxHandlerCode:{OK:0,IGNORE:1,RETRY:2,RELOAD:3,TIMEOUT:4,ABORT:5,FATAL:6,INVALID_RESP:7,INCOMPLETE_RESP:8,PAGELET_FATAL:9,DEBUG_NOAJAX:10},serverCode:{ERROR:-1,OK:200,TIMEOUT:408},shouldReload:function(a){return!1}});w.AJAXFlushUtils=b})(u.$);(function(){"undefined"!=typeof amznJQ?amznJQ.declareAvailable("newTwister"):
x.register("newTwister",function(){return w.newTwister});x.register("twisterModule",function(){return{getState:function(){return g.StateController.getState()}}});"undefined"!=typeof amznJQ?(amznJQ.declareAvailable("pageRefreshJS"),amznJQ.declareAvailable("dpf")):(x.register("pageRefreshJS",function(){return w.pageRefreshJS}),x.register("dpf",function(){return w.pageRefreshJS}))})();if("function"===typeof w.twisterController.onInitializeTwister)w.twisterController.onInitializeTwister();return c});
x.when("A","twister-state","twister-utils","detail-page-framework","twister-string-constants","dp-js-logger").register("twister-model",function(u,e,a,b,q,n){return function(e,t,d,c,g){function p(a,b,c){b=0;try{for(;b<h.externalViews.length;)h.externalViews[b].updateView(a,h.twisterState,c),b++}catch(d){(new n(h.externalViewNames[b])).logFatal(d,{message:"[Failed to update external view from TwisterModel]"})}}function q(a){var b,c,d,k,g,e=h.twisterState.parentASIN,p;a?(b=h.twisterState.reactId,c=h.twisterState.hoveredReactId,
d=h.twisterState.unselectedDimCount,k=0<=h.twisterState.hoveredDimCombID.search(/X/)?1:0,g=h.twisterState.hoveredAsin):(b=h.twisterState.previousReactId,c=h.twisterState.reactId,d=h.twisterState.previousPartialState,k=h.twisterState.partialState,g=h.twisterState.getCurrentASIN());p=h.twisterVariationsData.asinToDimIndexMapData[g];h.twisterVariationsData.useMS&&p&&g&&f(h.fetchMasterIDList,"m"+p[0],g,0,a);0===k?(f(h.fetchFullIDList,g,g,0,a),h.prioritizeReqPrefetch=0):0===d?(f(h.fetchPartialIDList,c,
g,0,a),f(h.fetchParentIDList,e,e,0,a),h.prioritizeReqPrefetch=1):b!==c&&f(h.fetchPartialIDList,c,g,0,a)}function f(a,b,c,d,k){k||(k=0);1!==h.idsList[b]&&b&&c&&(!h.prefetchFixWeblab||c!==h.twisterState.parentASIN||"full"!==a.type)&&a&&(h.idsList[b]=1,a.data.push({id:b,asin:c,isPrefetch:d,isHover:k}))}function u(a){a||(a=0);var b=[];0<h.fetchParentIDList.data.length&&b.push({type:"parent",idList:h.fetchParentIDList.data});0<h.fetchPartialIDList.data.length&&b.push({type:"partial",idList:h.fetchPartialIDList.data});
0<h.fetchFullIDList.data.length&&b.push({type:"full",idList:h.fetchFullIDList.data});0<h.fetchMasterIDList.data.length&&b.push({type:"master",idList:h.fetchMasterIDList.data});0<b.length&&(a||h.pageRefresh.measurement.stampCustomMetrics("ns",h.twisterState.currentASIN),h.pageRefresh.react(b,a));h.fetchParentIDList.data=[];h.fetchPartialIDList.data=[];h.fetchFullIDList.data=[];h.fetchMasterIDList.data=[];h.idsList={};h.prefetchCount=0}function A(b,c){for(var d={},g,k=0;k<c.length;k++)g=null,h.twisterState.isDimSelected(k)&&
(g=c[k],"(Please Select)"===g&&(g=null)),null!==g&&(g=a.htmlUnescape(g)),d[h.viewHandle.dimensionsMap[k]]=g;m.StateController.setState(b+"_variations",d)}var m=w.DetailPage,h=this;h.twisterControllerHandle=e;h.pageRefresh=t;h.twisterJSInitData=d;h.twisterVariationsData=c;h.twisterAvailabilityCache=g;h.twisterState;h.prefetchCount=0;h.preHoverClass="";h.fetchParentIDList={type:"parent",data:[]};h.fetchPartialIDList={type:"partial",data:[]};h.fetchFullIDList={type:"full",data:[]};h.fetchMasterIDList=
{type:"master",data:[]};h.idsList={};h.prefetchFixWeblab=0;h.prioritizeReqPrefetch=0;h.externalViews=[];h.externalViewNames=[];h.registerExternalView=function(a,b){try{h.externalViews.push(a),h.externalViewNames.push(b)}catch(c){(new n(b)).logFatal(c,{message:"[Failed to register external view with TwisterModel]"})}};h.handleMouseOver=function(b){var c;null!==b&&(h.twisterState.updateStateOnMouseOver(b),!a.isSwatchSelected(b,h.twisterVariationsData)||h.twisterVariationsData.useMS)&&(c=h.twisterVariationsData.getDimensionValuesDisplayData(h.twisterState.hoveredAsin),
h.twisterVariationsData.useMS||A("hovered",c),this.viewHandle.updateView(b,h.twisterState,"mouseOver"),p(b,h.twisterState,"mouseOver"),q(1),u(1))};h.handleDropdownChange=function(a){h.handleClick(a)};h.handleClick=function(c,d,g){var f=g?"mouseOut":"click",k,e,l=0;k=d;e=h.twisterState.getCurrentASIN();h.twisterVariationsData.useMS&&c&&a.isSwatchSelected(c,h.twisterVariationsData)&&(l=1);g||(g=0);if(null!==k||null!==c)if(k=h.twisterState.updateStateOnClick(c,d,f)){k=h.twisterState.getCurrentASIN();
if(!g&&e!==k&&!h.twisterState.partialState&&b.callbacks["sims-widget_feature_div"])b.callbacks["sims-widget_feature_div"](m.StateController.getState());h.twisterState.partialState||g||h.pageRefresh.measurement.start(k);e=h.twisterVariationsData.getDimensionValuesDisplayData(k);A("selected",e);A("hovered",e);h.twisterState.partialState||g||h.pageRefresh.measurement.stampCustomMetrics("bb",k);h.viewHandle.updateView({},h.twisterState,f);p(c,h.twisterState,f);h.twisterState.partialState||g||h.pageRefresh.measurement.stampCustomMetrics("be",
k);1!==l&&(q(g),u(g))}};h.handleMouseOut=function(b,c,d){c=h.twisterState.getCurrentASIN();!h.twisterVariationsData.useMS&&a.isSwatchSelected(b,h.twisterVariationsData)||h.handleClick(null,c,1)};(function(){var a;h.twisterJSInitData&&(h.twisterState=h.twisterControllerHandle.initTwisterState,h.MAX_PREFETCH_COUNT=h.twisterJSInitData.prefetchCount,h.prioritizeReqPrefetch=h.twisterJSInitData.prioritizeReqPrefetch,h.prefetchFixWeblab=h.twisterJSInitData.prefetchFixWeblab,a=h.twisterState.getCurrentASIN(),
a=h.twisterVariationsData.getDimensionValuesDisplayData(a),h.viewHandle||(h.viewHandle=h.twisterControllerHandle.twisterView),A("selected",a),A("hovered",a));h.pageRefresh.init(h.twisterJSInitData.storeID,h.twisterJSInitData.productGroupID)})()}});x.when("A","jQuery","twister-state","twister-utils","twister-string-constants","page-refresh:controller","dp-js-logger").register("twister-model-new",function(u,e,a,b,q,n,l){return function(a,d,c,g){function e(a,b,c){b=0;try{for(;b<m.externalViews.length;)m.externalViews[b].updateView(a,
m.twisterState,c),b++}catch(d){(new l(m.externalViewNames[b])).logFatal(d,{message:"[Failed to update external view from TwisterModel]"})}}function C(a,c,d,f){if(c&&b.isSwatchSelected(c,m.twisterVariationsData))return!1;if(m.twisterState.updateStateOnClick(c,d,f,a)){d=m.twisterVariationsData.getDimensionValuesDisplayData(d);if(f===q.EVENT_TYPE_CLICK||f===q.EVENT_TYPE_DROPDOWN_CHANGE){for(var l=m.twisterState.getCurrentDimCombID().split("_"),k={},t=0,u=m.twisterState.dimensionSelectionData.length;t<
u;t++)k[m.twisterState.twisterJSInitData.dimensions[t]]="1"===m.twisterState.dimensionSelectionData[t].isRequired&&"0"===m.twisterState.dimensionSelectionData[t].isSelected&&"X"===l[t]?"-1":l[t];A.StateController.setState("selected_variation_values",k)}E("selected",d);E("hovered",d);m.viewHandle.updateView(c,m.twisterState,f);e(c,m.twisterState,f);f===q.EVENT_TYPE_CLICK||f===q.EVENT_TYPE_DROPDOWN_CHANGE?(c=m.twisterState.getProductizedTwisterSelection(a.newDimCombID),g.handleClick(c,a)):n.updatePage(a,
f);return!0}}function f(a,b,c,d,g){if(a&&1<m.twisterVariationsData.dimensionsMap.length){m.viewHandle.updateViewAfterTwisterUpdate(c,m.twisterState,g);a=0;try{for(;a<m.externalViews.length;)m.externalViews[a].updateViewAfterTwisterUpdate(c,m.twisterState,g),a++}catch(k){(new l(m.externalViewNames[a])).logFatal(k,{message:"[Failed to update external view after twister update from TwisterModel]"})}}}function E(a,b){for(var c={},d,g=0;g<b.length;g++)d=null,m.twisterState.isDimSelected(g)&&(d=b[g],"(Please Select)"===
d&&(d=null)),c[m.viewHandle.dimensionsMap[g]]=d;A.StateController.setState(a+"_variations",c)}var A=w.DetailPage,m=this;m.twisterControllerHandle=a;m.twisterJSInitData=d;m.twisterVariationsData=c;m.pageRefresh=n.page;m.twisterState;m.externalViews=[];m.externalViewNames=[];m.registerExternalView=function(a,b){try{m.externalViews.push(a),m.externalViewNames.push(b)}catch(c){(new l(b)).logFatal(c,{message:"[Failed to register external view with TwisterModel]"})}};m.prefetch=function(a,b){a=m.twisterState.getRequestContext(a,
!0);n.prefetchPage(a,b)};m.handleMouseOver=function(a){if(!a||!b.isSwatchSelected(a,m.twisterVariationsData)){var c=m.twisterState.getHoverContext(a);m.twisterState.updateStateOnMouseOver(a,c);var d=m.twisterVariationsData.getDimensionValuesDisplayData(c.newAsin);E("hovered",d);A.StateController.setState("hovered_asin",c.newAsin);this.viewHandle.updateView(a,m.twisterState,q.EVENT_TYPE_MOUSEOVER);e(a,m.twisterState,q.EVENT_TYPE_MOUSEOVER);n.updatePage(c,q.EVENT_TYPE_MOUSEOVER)}};m.handleClick=function(a){var b=
m.twisterState.getRequestContext(a),c=C(b,a,b.childAsin,q.EVENT_TYPE_CLICK);f(c,b,a,b.childAsin,q.EVENT_TYPE_CLICK)};m.handleMouseOut=function(a){a=m.twisterState.getCurrentContext(a);C(a,null,a.currentAsin,q.EVENT_TYPE_MOUSEOUT)};m.handleDropdownChange=function(a){var b=m.twisterState.getRequestContext(a);C(b,a,b.childAsin,q.EVENT_TYPE_DROPDOWN_CHANGE);f(b,a,b.childAsin,q.EVENT_TYPE_DROPDOWN_CHANGE)};(function(){if(m.twisterJSInitData){m.viewHandle||(m.viewHandle=m.twisterControllerHandle.twisterView);
m.twisterState=m.twisterControllerHandle.initTwisterState;var a=m.twisterState.getCurrentASIN(),a=m.twisterVariationsData.getDimensionValuesDisplayData(a);E("selected",a);E("hovered",a);n.init(d);u.on("dp:twister:prefetch",function(a,b){m.prefetch(a,b)})}})()}});x.when("A","twister-utils","detail-page-state-controller","twister-string-constants").register("twister-state",function(u,e,a,b){return function(q,n,l){function t(a){a.mType===b.MTYPE_PARENT&&a.relatedContext&&(a=a.relatedContext);return a}
function d(a,d,h){var k=F.extend(!0,{},a);k.mType=b.MTYPE_MASTER;k.id="m"+h[0];k.relatedContext=a;k.doNotAbort=!0;k.url=c(k,d,[]);k.uniqueID=p(k,[]);return k}function c(a,b,c){var d=h.twisterJSInitData.twisterUpdateURLInfo,f=d.immutableURLPrefix,e=d.immutableParams,d=d.mutableParams,p;p=F.extend(!0,{},d,h.twisterJSInitData.contextMetaData[a.mType].mTypeSpecificURLParams);if(null!=c)for(var l=0,t=c.length;l<t;l++){var n=c[l];if(!e.hasOwnProperty(n.key)){var q=n.key,u=n.value;p[q]=u;n.isPersistent&&
(d[q]=u)}}for(var C in p)null!=p[C]&&(f+="\x26"+C+"\x3d"+p[C]);f+="\x26asinList\x3d"+a.newAsin+"\x26isFlushing\x3d2\x26dpEnvironment\x3d"+m.dpEnvironment+"\x26id\x3d"+a.id+"\x26mType\x3d"+a.mType;b&&(f+="\x26prefetchRequest\x3d1");g()&&(f+="\x26isTryState\x3dtrue");return f}function g(){var a=!1,b=u.state("pwState");b&&(a=b.isTryState);return a}function p(a,b){var c="",d=a.mType,f=[],e=F.extend(!0,{},h.twisterJSInitData.twisterUpdateURLInfo.mutableParams);if(null!=b)for(var p=0,m=b.length;p<m;p++){var l=
b[p];e[l.key]=l.value}for(var t in e)e.hasOwnProperty(t)&&f.push(t);f.sort();p=0;for(b=f.length;p<b;p++)m=f[p],null!=m&&null!=e&&(c+=m+"\x3d"+e[m]+"\x26");c+="mType\x3d"+d+"\x26id\x3d"+a.id;g()&&(c+="\x26isTryState\x3dtrue");return c}function C(a){var c=a[b.STRING_DIM_INDEX],d=a[b.STRING_DIM_VALUE_INDEX];a=h.getCurrentDimCombID().split("_");a[c]=-1===d?"X":d;a=a.join("_");return h.twisterAvailabilityCache.gAsinToRender(a,c)}function f(a,c){var d=h.getCurrentDimCombID().split("_"),k=d.length,g=h.twisterVariationsData.asinToDimIndexMapData[a];
a=-1;var f;if(g)g=g.slice(0);else for(g=[],f=0;f<k;f++)g[f]="X";null!==c&&c!==y&&(a=c[b.STRING_DIM_INDEX]);for(var e=0;e<k;e++)(f=h.dimensionSelectionData[e][b.STRING_IS_REQUIRED])&&e!==parseInt(a)&&parseInt(g[e])!==parseInt(d[e])&&(g[e]="X",h.sizeSwatch&&0!==h.partialState&&(h.dimensionSelectionData[e][b.STRING_IS_SELECTED]=0)),-1!==parseInt(a)&&-1===parseInt(c[b.STRING_DIM_VALUE_INDEX])&&(g[a]="X");return g.join("_")}function E(a,c){a=a.split("_");for(var d=0;d<h.dimensionSelectionData.length;d++)1===
h.dimensionSelectionData[d][b.STRING_IS_REQUIRED]&&0!==c&&(a[d]="X");return a.join("_")}var A=w.DetailPage,m=w.Twister,h=this,F=u.$;h.twisterJSInitData=q;h.twisterVariationsData=n;h.twisterAvailabilityCache=l;h.parentASIN="";h.currentASIN="";h.dimensionSelectionData={};h.unselectedDimCount=-1;h.master="";h.currentDimCombID="";h.preHoverClass="";h.hoveredReactId="";h.hoveredAsin="";h.hoveredDimCombID="";h.partialState="";h.previousPartialState="";h.previousReactId="";h.previousAsin="";h.sizeSwatch=
!1;h.setMaster=function(a){h.master=a};h.getMaster=function(){return h.master};h.getCurrentASIN=function(){return h.currentASIN};h.setCurrentASIN=function(a){a&&(h.currentASIN=a)};h.getCurrentDimCombID=function(){return h.currentDimCombID};h.setCurrentDimCombID=function(a){a&&(h.currentDimCombID=a)};h.isDimSelected=function(a){return 1===h.dimensionSelectionData[a][b.STRING_IS_SELECTED]};h.setPreHoverData=function(a){h.useMS||(h.preHoverClass=e.getAttachedClass(a,h.twisterVariationsData.dimensionsMap[a[b.STRING_DIM_INDEX]]))};
h.updateStateOnMouseOver=function(a,c){var d,k;a&&"0"===a[b.STRING_DIM_INDEX]&&h.setMaster(a[b.STRING_DIM_VALUE_INDEX]);d=c&&c.childAsin||C(a);k=h.unselectedDimCount;if(""===d){if(0>=k)return;d=h.getCurrentASIN()}h.hoveredAsin=d;d=c&&c.newDimCombID||f(h.hoveredAsin,a);h.hoveredDimCombID=d;k=0<=d.search(/X/)?1:0;c=c&&c.reactID||E(d,k);h.hoveredReactId=c;h.setPreHoverData(a)};h.updateStateOnClick=function(a,c,d,k){var g;h.previousAsin=h.getCurrentASIN();c=c||k&&k.childAsin||C(a);a&&a[b.STRING_DIM_INDEX]&&
"0"===a[b.STRING_DIM_INDEX]&&h.setMaster(a[b.STRING_DIM_VALUE_INDEX]);g=h.unselectedDimCount;h.previousPartialState=g;if(""===c){if(0>=g)return!1;c=h.getCurrentASIN()}g=k&&k.newDimCombID||f(c,a);if(b.EVENT_TYPE_CLICK===d||b.EVENT_TYPE_DROPDOWN_CHANGE===d){var e=a[b.STRING_DIM_INDEX];d="undefined"!==typeof h.preHoverClass&&(-1!==h.preHoverClass.indexOf(b.CLASS_FOR_SWATCH_UNAVAILABLE)||-1!==h.preHoverClass.indexOf(b.CLASS_FOR_DROPDOWN_UNAVAILABLE));var p=g.split("_"),m=h.currentDimCombID.split("_");
p[e]="*";m[e]="*";e=p.join("_");m=m.join("_");e!==m&&(d=!0);if(d||-1===a[b.STRING_DIM_VALUE_INDEX])for(var m=g.split("_"),p=0,l=h.dimensionSelectionData.length;p<l;p++)e=h.dimensionSelectionData[p],"X"===m[p]&&1===e[b.STRING_IS_SELECTED]&&(e[b.STRING_IS_SELECTED]=0,h.unselectedDimCount++);A.StateController.setState("isUnavailableInOldDimCombId",d?"true":"false");d=a[b.STRING_DIM_INDEX];null!==a&&a!==y&&(d=h.dimensionSelectionData[d],0===d[b.STRING_IS_SELECTED]&&-1!==parseInt(a[b.STRING_DIM_VALUE_INDEX])&&
(d[b.STRING_IS_SELECTED]=1,h.unselectedDimCount--,0>h.unselectedDimCount&&(h.unselectedDimCount=0)));a=h.unselectedDimCount;h.previousReactId=h.reactId}else a=0<=g.search(/X/)?1:0,h.previousReactId=h.hoveredReactId;k=k&&k.reactID||E(g,a);h.partialState=a;h.setCurrentASIN(c);h.setCurrentDimCombID(g);h.reactId=k;A.StateController.setState("current_asin",h.getCurrentASIN());A.StateController.setState("currentDimCombID",h.getCurrentDimCombID());A.StateController.setState("reactId",h.reactId);A.StateController.setState("dimensionSelectionData",
h.dimensionSelectionData);return!0};h.getCurrentContext=function(){var a=h.getRequestContext();return t(a)};h.getHoverContext=function(a){a=h.getRequestContext(a);return t(a)};h.getProductizedTwisterSelection=function(a){return"string"===typeof a?e.getProductizedTwisterSelectionFromDimComb(a,h.twisterJSInitData.dimensions):e.getProductizedTwisterSelectionFromDivMetaData(a,h.twisterJSInitData.dimensions)};h.getRequestContext=function(a,g){var e=h.getCurrentASIN(),k=h.parentASIN,m;m=a&&C(a)||e;var l=
h.getCurrentDimCombID(),t=f(m,a),n=0<=l.search(/X/)?1:0,q=0<=t.search(/X/)?b.MTYPE_PARTIAL:b.MTYPE_FULL;n||q!==b.MTYPE_PARTIAL||(q=b.MTYPE_PARENT);var n=q!==b.MTYPE_FULL?1:0,u=E(t,n);a={divMetaData:a,currentAsin:e,newAsin:m,childAsin:m,currentDimCombID:l,newDimCombID:t,reactID:u,partialState:n,mType:q,id:0<=u.search(/X/)?u:m};if(h.useMS&&m){if(k=h.twisterVariationsData.asinToDimIndexMapData[m])a.relatedContext=d(a,g,k),a.doNotAbort=!0}else q===b.MTYPE_PARENT&&(m=F.extend(!0,{},a),m.mType=b.MTYPE_PARTIAL,
m.relatedContext=a,m.url=c(m,g,[]),m.doNotAbort=!0,m.uniqueID=p(m,[]),a.relatedContext=m,a.id=k,a.newAsin=k,a.doNotAbort=!0);a.url=c(a,g,[]);a.uniqueID=p(a,[]);return a};h.getRequestContextForExternalTwisterUpdates=function(a){var g=h.getCurrentASIN(),f=h.getCurrentDimCombID();f.search(/X/);var k=0<=f.search(/X/)?b.MTYPE_PARTIAL:b.MTYPE_FULL,e=k!==b.MTYPE_FULL?1:0,m=E(f,e),f={divMetaData:{},currentAsin:g,newAsin:g,childAsin:g,currentDimCombID:f,newDimCombID:f,reactID:m,partialState:e,mType:k,id:0<=
m.search(/X/)?m:g};h.useMS&&g&&(g=h.twisterVariationsData.asinToDimIndexMapData[g])&&(f.relatedContext=d(f,0,g),f.doNotAbort=!0);f.url=c(f,0,a);f.uniqueID=p(f,a);return f};(function(){var c=h.twisterJSInitData,d=c.keysToPopulateDetailPageStateController,g;if(c){A.StateController=new a;for(var k=0,f=d.length;k<f;k++)g=d[k],A.StateController.setState(g,c[g]);A.StateController.setState("variation_display_labels",c[b.INIT_DATA_VARIATIONS_DISPLAY_LABELS]);A.StateController.setState("variation_label_order",
c[b.INIT_DATA_DIMENSIONS_MAP]);h.currentASIN=c.current_asin;h.parentASIN=c.parent_asin;h.dimensionSelectionData=c.dimensionSelectionData;h.unselectedDimCount=c.unselectedDimCount;h.currentDimCombID=c.currentDimCombID;h.reactId=c.reactId;h.storeID=c.storeId;h.productGroupID=c.productGroupId;h.useMS=c[b.STRING_USE_MS];h.useMS&&h.currentASIN&&h.twisterVariationsData.asinToDimIndexMapData[h.currentASIN]&&h.setMaster(h.twisterVariationsData.asinToDimIndexMapData[h.currentASIN][0]);F("#sizeSwatch").length&&
(h.sizeSwatch=!0)}})()}});x.when("A","twister-string-constants","view-util").register("twister-variations-data",function(u,e,a){return function(b,q){function n(a,b){var c=[];u.each(b,function(b){null!==a[b]&&a[b]!==y?c.push(a[b].join("_")):x.log("Currently unavailable ASIN "+b+" not found in dimension combination","ERROR","TwisterCurrentlyUnavailableExperiment")});return c}var l=this;l.dimensionValuesDisplay={};l.deletedLandingAsinInfo;l.dimToAsinMapData;l.dimensionValuesData;l.asinToDimIndexMapData;
l.dimensionsDisplayType;l.displayConfigStylesData;l.dimensionsMap;l.twisterCore=q;l.currentlyUnavailableAsins;l.currentlyUnavailableDimensions;l.getDimensionValuesDisplayData=function(a){var b=l.dimensionValuesDisplay[a];b||a!==l.deletedLandingAsinInfo.asin||(b=l.deletedLandingAsinInfo.dimValues);return b};(function(){if(l.twisterCore!==y&&b[e.IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION]){var t=(new a(l.twisterCore)).variationData;l.asinToDimIndexMapData=t.getAsinToDimIndexMapData();l.dimToAsinMapData=t.getDimToAsinMapData();
l.dimensionsMap=l.twisterCore.tvm.dimensionList;l.dimensionValuesData=t.getDimensionValuesData();l.dimensionValuesDisplay=t.getDimensionValuesDisplay()}else l.dimToAsinMapData=b[e.INIT_DATA_DIM_TO_ASIN_MAP],l.dimensionsMap=b[e.INIT_DATA_DIMENSIONS_MAP],l.dimensionValuesData=b[e.STRING_DIMENSION_VALUES_DATA],l.asinToDimIndexMapData=b[e.INIT_DATA_ASIN_TO_DIM_INDEX_MAP],l.dimensionValuesDisplay=b[e.INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA];l.dimensionsDisplayType=b[e.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP];
l.deletedLandingAsinInfo=b[e.INIT_DATA_DELETED_LANDING_ASIN_INFO];l.displayConfigStylesData=b[e.STRING_DISPLAY_CONFIG_STYLES_DATA];l.currentlyUnavailableAsins=b[e.CURRENTLY_UNAVAILABLE_ASINS];l.currentlyUnavailableDimensions=b[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED]?n(b[e.INIT_DATA_ASIN_TO_DIM_INDEX_MAP],b[e.CURRENTLY_UNAVAILABLE_ASINS]):[]})()}});x.when("A").register("twister-string-constants",function(u){return{YES:"YES",NO:"NO",MTYPE_PARENT:"parent",MTYPE_PARTIAL:"partial",MTYPE_FULL:"full",
MTYPE_MASTER:"master",AUI_DROPDOWN_EVENT_PREFIX:"a:dropdown:selected:",AUI_EVENT_FOR_SWATCHTHUMB:"swatchthumb-action",CHAR_COLON:":",CHAR_SEMICOLON:";",CHAR_UNDERSCORE:"_",CHAR_ASTERISK:"*",CHAR_CROSS:"X",CLASS_FOR_DROPDOWN_UNAVAILABLE:"dropdownUnavailable",CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE:"dropdownCurrentlyUnavailable",CLASS_FOR_NEW_TWISTER_EVDD:"#newTwisterEVDD",CLASS_FOR_NON_JS_EVDD:"#nonJSEVDD",CLASS_FOR_SWATCH_AVAILABLE:"swatchAvailable",CLASS_FOR_SWATCH_HOVER:"swatchHover",CLASS_FOR_SWATCH_SELECT:"swatchSelect",
CLASS_FOR_SWATCH_SELECT_CURRENTLY_UNAVAILABLE:"swatchSelectCurrentlyUnavailable",CLASS_FOR_SWATCH_UNAVAILABLE:"swatchUnavailable",CLASS_FOR_SWATCH_UNAVAILABLE_HOVER:"swatchUnavailableHover",CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE:"swatchCurrentlyUnavailable",CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE_HOVER:"swatchCurrentlyUnavailableHover",AUI_CLASS_FOR_SWATCH_UNAVAILABLE:"a-button-unavailable",AUI_CLASS_FOR_SWATCH_SELECT:"a-button-selected",CLASS_FOR_VODD_AVAILABLE:"voddAvailable",CLASS_FOR_VODD_HOVER:"voddHover",
CLASS_FOR_VODD_SELECT:"voddSelect",CLASS_FOR_VODD_UNAVAILABLE:"voddUnavailable",CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION:"dropdownSelect",DROPDOWN_DIV_NAME:"dropdown_selected_",EVENT_TYPE_SHOWPOPOVER:"showPopover",EVENT_TYPE_HIDEPOPOVER:"hidePopover",EVENT_TYPE_UPDATEPOPOVERPOSITION:"updatePopoverPosition",EVENT_TYPE_DROPDOWN_CHANGE:"dropdownChange",EVENT_TYPE_CLICK:"click",EVENT_TYPE_TWISTER_REFRESH:"twisterRefresh",EVENT_TYPE_MOUSEENTER:"mouseenter",EVENT_TYPE_MOUSELEAVE:"mouseleave",EVENT_TYPE_MOUSEDOWN:"mousedown",
EVENT_TYPE_MOUSEOUT:"mouseOut",EVENT_TYPE_MOUSEOVER:"mouseOver",EVENT_TYPE_TOUCHSTART:"touchstart",EVENT_TYPE_TOUCHEND:"touchend",EVENT_TYPE_TOUCHMOVE:"touchmove",EVENT_TYPE_KEYPRESS:"keypress",ID_SELECTOR:"#",CLASS_SELECTOR:".",TWISTER_POPOVER:"twisterPopover",INDEX_FOR_SELECT_OPTION:"-1",INIT_DATA_ASIN_TO_DIM_INDEX_MAP:"asinToDimIndexMapData",INIT_DATA_DELETED_LANDING_ASIN_INFO:"deletedLandingAsinInfo",INIT_DATA_PW_ENABLED_DIMENSION_MAP:"pwEnabledDimensionMap",INIT_DATA_DIM_TO_ASIN_MAP:"dimToAsinMapData",
INIT_DATA_DIMENSION_VALUES_DISPLAY_DATA:"dimensionValuesDisplayData",INIT_DATA_DIMENSIONS_DISPLAY:"dimensionsDisplay",INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP:"dimensionsDisplayType",INIT_DATA_DIMENSIONS_DISPLAY_SUB_TYPE_MAP:"dimensionsDisplaySubType",INIT_DATA_DIMENSIONS_MAP:"dimensions",INIT_DATA_VARIATIONS_DISPLAY_LABELS:"variationDisplayLabels",INIT_DATA_MAX_POPOVER_HEIGHT:"maxPopoverHeight",INIT_DATA_VISIBLE_ROW_COUNT:"visibleRowCount",INIT_DATA_POPOVER_POSITION:"popoverPosition",INIT_DATA_ANIMATE_BUTTON_CONTENT:"animateButtonContent",
INIT_DATA_DISPLAY_TYPE_PROPERTIES:"displayTypeProperties",NATIVE_DROPDOWN_DIV_PREFIX:"#native_",STRING_CSS_CLASS:"css_class",STRING_DIM_COMB_ID:"dimCombID",CURR_DIM_COMB_ID:"currentDimCombID",CURRENTLY_UNAVAILABLE_ASINS:"currentlyUnavailableAsins",STRING_DIM_DATA:"dimData",STRING_DIM_INDEX:"dimIndex",STRING_DIM_NAME:"dimName",STRING_DIM_ORDER:"dimOrder",STRING_DIM_VALUE_INDEX:"dimValueIndex",STRING_DIMENSION_DISPLAY_MAP:"dimensionDisplayMap",STRING_DIMENSION_DISPLAY_STRING:"dimensionDisplayString",
STRING_DIMENSION_SELECTION_DATA:"dimensionSelectionData",STRING_DIMENSION_VALUES_DATA:"dimensionValuesData",STRING_DIMENSION_VALUES_DATA_GLOBAL:"dimensionValuesDataGlobal",STRING_DIMENSIONS_MAP:"dimensionsMap",STRING_DISPLAY_CONFIG_STYLES_DATA:"displayConfigStylesData",STRING_PRIME_WARDROBE_ASINS:"pwASINs",STRING_EVENT_DATA:"eventData",STRING_EVENT_DIM_DATA:"dimData",STRING_EVENT_DIM_INFO:"eventDimInfo",STRING_EVENT_DIV_METADATA:"divMetaData",STRING_EVENT_POPOVER_DATA:"popoverData",STRING_EVENT_TYPE:"eventType",
STRING_HIDE_POPOVER:"hidePopover",STRING_HOVER_MS:"hoverMS",STRING_HTML_CONTENT:"html_content",STRING_IS_REQUIRED:"isRequired",STRING_IS_SELECTED:"isSelected",STRING_IS_SLOTS_ENABLED:"isSlotsEnabled",STRING_NATIVE_CSS_CLASS:"native_css_class",STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER:"showDimSecondUnavailablePopover",STRING_STYLE:"style",STRING_TWISTER_CONTROLLER_HANDLE:"twisterControllerHandle",STRING_TWISTER_AVAILABILITY_CACHE:"twisterAvailabilityCache",STRING_TWISTER_VARIATION_DATA:"twisterVariationData",
STRING_TWISTER_INITIAL_STATE_KEY:"twisterInitialState",STRING_UNAVAILABLE_POPOVER_STRING_VALUE:"unavailablePopOverStringValue",STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE:"currentlyUnavailablePopOverStringValue",STRING_PW_UNAVAILABLE_POPOVER_STRING_VALUE:"pwUnavailableMessage",STRING_ACCESSIBILITY_CURRENT_SELECTION:"twisterAccessibilityCurrentSelection",STRING_USE_MS:"useMS",STRING_CLASS_NAME:"className",STYLE_CLASS_TYPE_FOR_AVAILABLE:"available",STYLE_CLASS_TYPE_FOR_INAVLID:"invalid",STYLE_CLASS_TYPE_FOR_SELECTED:"selected",
STYLE_CLASS_TYPE_FOR_UNAVAILABLE:"unavailable",TWISTER_DIMENSION_VIEW_DROPDOWN:"dropdown",TWISTER_DIMENSION_VIEW_EVDD:"etdd",TWISTER_DIMENSION_VIEW_SINGLETON:"singleton",TWISTER_DIMENSION_VIEW_SWATCH:"swatch",TWISTER_DIMENSION_VIEW_VODD:"vodd",TWISTER_DIMENSION_VIEW_COUNTER:"counter",TWISTER_DIMENSION_VIEW_SHELF:"shelf",TWISTER_EVENT_DATA_DIV_METADATA:"divMetaData",TWISTER_EVENT_DATA_DISPLAY_TYPE:"dimDisplayType",TWISTER_EVENT_DATA_TIME:"time",TWISTER_EVENT_DATA_DURATION:"duration",TWISTER_EVENT_DATA_COUNT:"count",
TWISTER_EVENT_DATA_PERCENTAGE:"percentage",TWISTER_EVENT_DATA_DIM_INDEX:"dimIndex",TWISTER_DIMENSION_VIEW_SWATCH_VARIATION:"variation",MODAL_SWATCH_PREFIX:"modal_",STRING_MAX_SWATCHES_IMMERSIVE_VIEW:"maxSwatchesForImmersiveView",TWISTER_SWATCH_CLASS_PREFIX:"twister_",PRICE_SLOT_CLASS_NAME:"twister_swatch_price",CLASS_FOR_PRICE_BASE:"a-color-base",CLASS_FOR_PRICE_SECONDARY:"a-color-secondary",CLASS_FOR_PRICE_SELECTED:"a-color-price",TWISTER_MODAL_ID_PREFIX:"twister_modal_",TWISTER_INGRESS_ID_PREFIX:"twister_ingress_",
AUI_EVENT_FOR_INGRESS_PREFIX:"twister-ingress-click-",TWISTER_FEATURE_DIV_ID:"twister_feature_div",IMMERSIVE_TWISTER_OVERLAY:"immersiveTwisterOverlay",CENTER_COL_DIV_ID:"centerCol",MODAL_CONTENTDIV_PREFIX:"twister_modal_innerDiv_",MODAL_HEADER_PREFIX:"twister_modal_header_",IMMERSIVE_DROPDOWN_ROW_PREFIX:"twister_idd_",DYNAMIC_STYLE_RULES_ID:"twisterSwatchWrapperDynaStyle",CLASSNAME_FOR_STYLERBOTTOM:"twisterModal_stylerBottom",CLASSNAME_FOR_STYLERTOP:"twisterModal_stylerTop",CLASSNAME_FOR_SWATCH:"twisterSwatchWrapper",
CLASSNAME_FOR_INGRESS:"twisterIngressWrapper",AUI_EVENT_CLOSE_MODAL_PREFIX:"close-twisterModal-",AUI_EVENT_VISIBILITY_PREFIX:"twister-appear-",CLASSNAME_FOR_THIN_WIDTH_OVERRIDE:"thinWidthOverride",DIMENSION_SUB_TYPE:"dimensionDisplaySubType",AUI_EVENT_FOR_COUNTER:"twister_counter-action",EXPANDED_VIEW_ENABLED:"expandedViewEnabled",MIN_HEIGHT_EXPANDED_SECTION:"minHeightForExpandedSection",MAX_HEIGHT_EXPANDED_SECTION:"maxHeightForExpandedSection",MIN_ASINS_FOR_EXPANDED_VIEW:"minAsinForExpandedView",
MIN_ASINS_FOR_EXPANDED_VIEW_TEXT:"minAsinForExpandedViewText",MIN_ASINS_FOR_EXPANDED_VIEW_IMAGE:"minAsinForExpandedViewImage",MIN_ASINS_FOR_EXPANDED_SCROLL:"minAsinForExpandedScroll",MIN_ASINS_FOR_EXPANDED_SCROLL_TEXT:"minAsinForExpandedScrollText",MIN_ASINS_FOR_EXPANDED_SCROLL_IMAGE:"minAsinForExpandedScrollImage",SUFFIX_FOR_DROPDOWN_PANEL_PLACEHOLDER:"_placeHolderDivForDD",DIMENSION_VALUE_HAS_ICON:"isIconPresentForDimensionValue",HIDDEN_DIMENSION_DISPLAY_TYPE:"hidden",PRODUCTIZATION_ENABLED:"isProductizationEnabled",
PRODUCTIZATION_VIEW_ENABLED:"isViewProductizationEnabled",PRODUCTIZED_PARENT_VIEW:"parentView",PRODUCTIZED_VIEW_UTIL:"viewUtil",VARIATION_CHANGE:"VARIATION_CHANGE",VARIATION_PEEK:"VARIATION_PEEK",METADATA:"METADATA",PRODUCTIZED_VIEW_SUBTYPE:"PRODUCTIZED_VIEW_METADATA",DP_STATE_VIEW_SUBTYPE:"DETAILPAGE_STATE_VIEW_METADATA",IS_PAGE_ELIGIBLE_FOR_PRODUCTIZATION:"isPageEligibleForProductizationMigration",TWISTER_CURRENT_ASIN:"current_asin",CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED:"isCurrentlyUnavailableWeblabEnabled"}});
x.when("A","twisterModule","dp-js-logger").register("twister-view-registry",function(u,e,a){var b=this;b.logger=new a("DpTwisterViewRegistry");var q=u.createClass({init:function(a,b){this.twisterControllerHandle=a;this.externalViewName=b;this.dimensions=a.twisterJSInitData.dimensions;this.dimensionToAsinMap=a.twisterJSInitData.dimToAsinMapData;this.dimensionValues=a.twisterJSInitData.dimensionValuesData;this.dimensionAsinToValuesMap=a.twisterJSInitData.dimensionValuesDisplayData;this.variationValues=
a.twisterJSInitData.variation_values;this.asinVariationValues=a.twisterJSInitData.asin_variation_values;this.parentAsin=a.twisterJSInitData.parent_asin;this.currentDimCombID=a.twisterJSInitData.currentDimCombID;this.currentAsin=a.twisterJSInitData.current_asin;this.isConsolesOrAccessories=a.twisterJSInitData.isConsolesOrAccessories;this.ajaxUrlParams=a.twisterJSInitData.ajaxUrlParams;this.getControllerInterface=function(){function b(a,d,e){return{dimIndex:a,dimValueIndex:d,dimDisplayType:e}}return{handleClick:function(c,
g,e){c=b(c,g,e);a.handleExternalViewClick(c,this.externalViewName)},handleMouseOver:function(c,g,e){c=b(c,g,e);a.handleExternalViewMouseOver(c,this.externalViewName)},handleMouseOut:function(c,g,e){c=b(g);a.handleExternalViewMouseOut(c,c.dimIndex,c.dimValueIndex,this.externalViewName)}}}},updateView:function(a,b,d){},updateViewAfterTwisterUpdate:function(a,b,d){}}),n=w.twisterController;this.createAndRegisterExternalView=function(a){var e=new q(n,a);n.registerExternalView(e,a);b.logger.logCounter("TwisterExternalView_"+
a,1);return e};return this});x.when("A","jQuery","twisterModule","dp-js-logger","page-refresh:controller","twister-controller","twister-state","twister-string-constants","desktop-twister-model").register("detailPage:RefreshHandler",function(u,e,a,b,q,n,l,t){var d=w.twisterController.twisterModel.twisterState,c=new b("dpPageRegreshHandler"),g={},p=function(a){var b=this;b.clientId=a;b.doPageRefresh=function(g){if(!Array.isArray(g))throw"Incorrect parameters passed to doPageRefresh for clientId "+b.clientId;
g=d.getRequestContextForExternalTwisterUpdates(g);try{q.updatePage(g,t.EVENT_TYPE_CLICK)}catch(e){c.logFatal(e,{message:" Error doing page-refresh for clientId "+a})}};b.getURLParamObject=function(a,c,d){if(!a||null==d)throw"Incorrect parameters passed to getURLParams for clientId "+b.clientId;return{key:encodeURIComponent(a),value:encodeURIComponent(c),isPersistent:d}}};return{getHandlerInstance:function(a){if(null===a||""===a)throw"Incorrect clientID passed to getHandlerInstance of dpRefreshHandler";
g[a]||(g[a]=new p(a));return g[a]}}});x.when("A","jQuery","detailPage:RefreshHandler","twister-string-constants").register("your-module-name",function(u,e,a,b){w.handleClickForMyButton=function(){for(var b=[],e="",l=0,t=arguments.length;l<t;l++){var d=arguments[l];0===l?(e=d,e=a.getHandlerInstance(e)):(d=e.getURLParamObject(d[0],d[1],d[2]),b.push(d))}e.doPageRefresh(b)}});x.when("A","jQuery","dp-ajax-prefetch","detail-page-framework","dp-js-logger","twister-string-constants","page-refresh:meta-cache",
"page-refresh:page").register("page-refresh:controller",function(u,e,a,b,q,n,l,t){var d=w.DetailPage,c=w.Twister,g={intermediateEOS:1,EOS:1},p=new q("dpTwister");return new function(){function q(a,b){if(!(1<b.recordImpressionPending)){var c=b.impressionCallbackData&&b.impressionCallbackData.relatedRequestID,d="/gp/twister/impression.html/?relatedRequestID\x3d"+c;c?u.delay(function(){u.get(d,{success:function(a){p.logCounter("dpTwisterImpression",1)},timeout:4E4,error:function(a,b,c){p.logCounter("dpTwisterImpressionFailed",
1)}})},1500):p.logFatal("prefetchRequestId does not exists. twister prefetch ajax requests are not returning the metadata.");b.recordImpressionPending++;l.set(a,b)}}function f(a,b,c){"undefined"===typeof b.forceFullPrefetch&&(b.forceFullPrefetch=c||n.NO,l.set(a,b));return b.forceFullPrefetch===n.NO&&h.metadata[a.mType]&&!h.metadata[a.mType].fullyPrefetchable}function E(a,b){A(a,function(a){t.executeClientFeatures(a,b)})}function A(a,b){var c=[a];a.relatedContext&&c.push(a.relatedContext);e.each(c,
function(a,c){b.apply(h,[c])})}function m(b,c){A(b,function(b){t.fadeInFeatures(b);var d=b.uniqueID,g=b.url,e=l.get(b);h.newPrefetchWeblab&&e.prefetchSent&&f(b,e)&&(d+="_prefetch_1",g+="\x26prefetchParam\x3d1",e.hotFeaturesPending=!0);e.requestSent=!0;l.set(b,e);e=h.newPrefetchWeblab&&c===n.EVENT_TYPE_CLICK;a.getInstance("dpTwister",d,g,F,b,b.doNotAbort).getContent(e)})}var h=this;h.metadata={};h.newPrefetchWeblab=!1;h.page=t;h.twisterPSCParam="psc";var F={chunk:function(a,b){var c=a.ASIN,d=a.Value;
a=a.FeatureName;if(!g[a]){var h=l.get(b);"twister-request-metadata"===a?(h.impressionCallbackData=u.parseJSON(d.content[a]),l.set(b,h)):t.refreshFeature(c,a,d)}},success:function(b,c,d,g){b=l.get(g);b.hotFeaturesPending&&(b.hotFeaturesPending=!1,l.set(g,b),a.getInstance("dpTwister",g.uniqueID+"_prefetch_2",g.url+"\x26prefetchParam\x3d2",F,g,g.doNotAbort).getContent());b.recordImpressionPending&&q(g,b)},error:function(a,b,d){c.$("#variations-overlay").hide();c.showErrorMessageOnFailure&&(x.log(c.errorMessageOnFailure,
"ERROR","PageRefreshController"),location.reload());p.logFatal(b+" "+d)},abort:function(a){p.logFatal(" Ajax aborted: "+a)},timeout:4E4};h.prefetchPage=function(b,c){A(b,function(b){var d=b.uniqueID,g=b.url,h=l.get(b);h.requestSent||(f(b,h,c)&&(d+="_prefetch_1",g+="\x26prefetchParam\x3d1"),h.prefetchSent=!0,h.recordImpressionPending=h.recordImpressionPending||1,h.requestSent=!0,l.set(b,h),a.getInstance("dpTwister",d,g,F,b,b.doNotAbort).prefetchContent())})};h.updatePage=function(a,c){if(c===n.EVENT_TYPE_CLICK||
c===n.EVENT_TYPE_DROPDOWN_CHANGE){if(!a.partialState){if(b.callbacks["sims-widget_feature_div"])b.callbacks["sims-widget_feature_div"](d.StateController.getState());t.startMeasurement(a)}m(a,c)}E(a,c)};h.reloadPage=function(a){var b;if(w.location.search){b=w.location.search;var c={};b=b.substring(b.indexOf("?")+1).split("\x26");for(var d=0;d<b.length;d++){var g=b[d].split("\x3d");g[0]&&0<=g[0].length&&(c[decodeURIComponent(g[0])]=decodeURIComponent(g[1]))}b=c}var f,c="/dp/"+a.childAsin;a.partialState?
b[h.twisterPSCParam]&&delete b[h.twisterPSCParam]:b[h.twisterPSCParam]=1;(a="?"+e.param(b))&&c&&(f=c+a);w.location.href=f};h.init=function(a){e.each(a.contextMetaData,function(a,b){if(b.elementList){for(var c=b.elementList.length,d=!0,g=0;g<c;g++)if(!b.elementList[g].isPrefetchable&&!b.elementList[g].isp){d=!1;break}h.metadata[a]||(h.metadata[a]={});h.metadata[a].fullyPrefetchable=d}});t.init(a)}}});x.when("A","jQuery","page-refresh-measurement","twister-string-constants","dp-js-logger").register("page-refresh:page",
function(u,e,a,b,q){var n=new q("dpTwister");return new function(){var l=this;l.measurement=y;l.config={partial:{},full:{},parent:{},master:{}};l.dimensionsDisplayType=y;l.initializeMeasurement=function(b){var d=b.measurement;l.dimensionsDisplayType=b.dimensionsDisplayType;l.measurement=new a(e,d.atf.marker,d.cf.marker);l.measurement.init(b.storeID,b.productGroupID)};l.init=function(a){l.initializeMeasurement(a);e.each(a.contextMetaData,function(a,c){var g=[],p={};c=c.elementList||[];var t=c.length;
p[b.EVENT_TYPE_MOUSEOVER]={};p[b.EVENT_TYPE_CLICK]={};for(var f=0;f<t;f++){var n=e("#"+(c[f].divToUpdate||c[f].dtu));g.push("#"+(c[f].divToUpdate||c[f].dtu));if(n.length&&(c[f].customClientFunction||c[f].ccf)){if(c[f].updateOnHover||c[f].uoh)p[b.EVENT_TYPE_MOUSEOVER][c[f].divToUpdate||c[f].dtu]=n.attr("customfunctionname");p[b.EVENT_TYPE_CLICK][c[f].divToUpdate||c[f].dtu]=n.attr("customfunctionname")}}l.config[a].affectedFeatures=g.join(",");l.config[a].clientFeatures=p})};l.startMeasurement=function(a){var d,
c,g=l.dimensionsDisplayType;null!=a.divMetaData&&(d=a.divMetaData.dimDisplayType);"undefined"!==typeof a.currentDimCombID&&(c=a.currentDimCombID.split(b.CHAR_UNDERSCORE).length);this.measurement.start(a.newAsin,d,c,g)};l.fadeInFeatures=function(a){e(this.config[a.mType].affectedFeatures).css({opacity:.5})};l.executeClientFeatures=function(a,d){e.each(l.config[a.mType].clientFeatures[d===b.EVENT_TYPE_CLICK||d===b.EVENT_TYPE_DROPDOWN_CHANGE?b.EVENT_TYPE_CLICK:b.EVENT_TYPE_MOUSEOVER],function(b,d){try{b=
y,b=eval("0, "+d),b(a.reactID,w.DetailPage.StateController,function(){l.measurement.stampImageLoad(a.newAsin)})}catch(e){n.logFatal(e)}})};l.refreshFeature=function(a,b,c){var g,p;try{b&&c&&c.content&&(p=c.content[b],"undefined"!==typeof p&&(g=e("#"+b),g.html(p),g.css({opacity:""})))}catch(l){b=b||"NoFeatureName",n.logFatal(l,{message:" Error in feature "+b})}this.measurement.stampFeature(b,a)}}});x.when("twister-string-constants").register("page-refresh:meta-cache",function(u){return{data:{},set:function(e,
a){return(e=this.getKey(e))?this.data[e]=a:y},get:function(e){e=this.getKey(e);return this.data[e]||{}},getKey:function(e){var a;e&&e.newAsin&&(a=e.mType===u.MTYPE_PARENT?e.mType+e.newAsin:e.mType===u.MTYPE_MASTER?e.mType+e.id:e.mType+e.newAsin+e.reactID);if(!a)throw"Twister PageRefresh::MetaCache:getKey incorrect context passed.";return a}}});x.when("A","jQuery").register("page-refresh-ajax-scope",function(u,e){return function(a,b,e){var n=w.Twister;this.scopeName=b;this.url=e;ues("t0",b,w.newTwisterInteractionStartTime);
ues("ctb",b,"1");this.signalMarker=function(a){!this.markers[a]||0>=this.markers[a].conditions||0===--this.markers[a].conditions&&"function"===typeof this.markers[a].handler&&this.markers[a].handler()};this.addlongPoleTag=function(a,b){a=a.toLowerCase();this.markers[a]&&0===this.markers[a].conditions&&0===this.markers[a].conditions&&w.ue&&"function"===typeof ue.tag&&ue.tag(b)};this.postData=function(){var b=this.scopeName;a.ajax({url:this.url,dataType:"text",timeout:4E4,error:function(){},success:function(a,
c,g){ues("id",b,a);uex("ld",b)}})};var l=this;this.markers={image:{conditions:1,handler:function(){uet("ne",b);l.signalMarker("af")}},af:{conditions:n.atfMarkerCount?n.atfMarkerCount:2,handler:function(){uet("af",b);uet("cf",b);l.signalMarker("cf")}},cf:{conditions:n.cfMarkerCount?n.cfMarkerCount:2,handler:function(){uet("cf",b);l.postData()}}}}});x.when("A","jQuery").register("page-refresh-cache",function(u,e){return function(){this.data={};this.getValue=function(a,b){return null==this.data[a]?null:
b?this.data[a][b]:this.data[a]};this.setValue=function(a,b,e){if(null==this.data[a]||this.data[a].pending)this.data[a]={};this.data[a][b]=e};this.clear=function(a){this.data[a]=null}}});x.when("A","jQuery","page-refresh-refresh","page-refresh-measurement","page-refresh-model","detail-page-framework").register("page-refresh-manager",function(u,e,a,b,q,n){return function(e,t,d,c,g){var p=w.Twister;this.$=e;this.model={};this.refresh=new a(e,c,g);this.contextMetaData=t;this.measurement=new b(e,d.atfMarker,
d.cfMarker);this.init=function(a,b){for(var c in this.contextMetaData)this.model[c]=new q(e,this.contextMetaData[c].AJAXUrl,this.contextMetaData[c].elementList,c.toString());this.measurement.init(a,b)};this.getModelCacheSize=function(a){var b=0;this.model.hasOwnProperty(a)&&e.each(this.model[a].cache.data,function(a,c){c.hasOwnProperty("cacheStatus")&&("preFetched"!==c.cacheStatus&&"completeFetched"!==c.cacheStatus||b++)});return b};this.react=function(a,b){for(var c in this.model)b||this.model[c].finishAjaxCall(this.model[c].currentRequestId,
1);c=0;for(var d=a.length;c<d;c++){var g=a[c];b||this.model[g.type].finishAjaxCall(this.model[g.type].currentRequestId,2);var h=this.model[g.type].getUpdateData(this,g);this.refresh.startRefresh(h);this.model[g.type].makePendingCallBacks()}};this.pageRefreshHandler=function(a,b,c,d){if(!d.noRefresh)for(var g in d.content)try{this.refresh.doRefresh(g,d.content[g]);if(c.isFinishRefreshReq)if(this.refresh.finishRefresh(g),"session-similarities_feature_div"===g||"purchase-similarities_feature_div"===
g||"buyxgety_feature_div"===g){if(n.callbacks[g])n.callbacks[g]()}else"zeroes-buy-box_feature_div"===g&&p.isIEBrowser(e)&&e("#"+g).css({opacity:"",zoom:1});this.measurement.stampFeature(b,a)}catch(h){}}}});x.when("A","jQuery","page-refresh-ajax-scope").register("page-refresh-measurement",function(u,e,a){return function(b,e,n){var l=w.Twister;this.atfMarker=e;this.cfMarker=n;this.scopeCount={};this.ajaxScopes={};this.url="";this.init=function(a,b){this.url="/gp/twister/dynamic-update/ajax-measurement.html/?s\x3d"+
a+"\x26pgid\x3d"+b+"\x26deviceType\x3d"+l.deviceType;l.isInstaTwisterEnabled&&(this.url+="\x26ptd\x3d"+l.productTypeName)};this.start=function(e,d,c,g){if(w.ue){this.scopeCount[e]||(this.scopeCount[e]=0);var p=e+(this.scopeCount[e]+1);this.scopeCount[e]++;var l=this.url;d&&(l+="\x26dimensionType\x3d"+d);"undefined"!==typeof c&&(l+="\x26dimensionCount\x3d"+c);"undefined"!==typeof g&&(l+="\x26dimensionsDisplayType\x3d"+g);this.ajaxScopes[e]=new a(b,p,l)}};this.stampImageLoad=function(a){this.ajaxScopes[a]&&
(this.ajaxScopes[a].signalMarker("image"),l.cfImageLongPollTag&&this.ajaxScopes[a].addlongPoleTag("cf",l.cfImageLongPollTag))};this.stampFeature=function(a,b){this.ajaxScopes[b]&&(a===this.atfMarker&&this.ajaxScopes[b].signalMarker("af"),a===this.cfMarker&&(this.ajaxScopes[b].signalMarker("cf"),l.cfHtmlLongPollTag&&this.ajaxScopes[b].addlongPoleTag("cf",l.cfHtmlLongPollTag)))};this.stampCustomMetrics=function(a,b){this.ajaxScopes[b]&&uet(a,this.ajaxScopes[b].scopeName)}}});x.when("A","jQuery","page-refresh-cache").register("page-refresh-model",
function(u,e,a){return function(b,e,n,l){var t=w.Twister,d=w.DetailPage;this.$=b;this.pendingCallBacks={};this.pendingCallBacksASIN="";this.cache=new a;this.AJAXUrl=e;this.AJAXRequests={};this.requestIdHash={};this.elementList=n;this.currentRequestId=null;this.pendingCallbacksList={};this.immediateCallbacksList=[];this.elementsToRefresh=[];this.modelType=l;this.getNewRequestId=function(){for(var a=0;100>a;a++){var b=a.toString();if(!this.requestIdHash.hasOwnProperty(b))return this.requestIdHash[b]=
!0,b}};this.removeRequestId=function(a){"string"!=typeof a&&(a=a.toString());this.requestIdHash.hasOwnProperty(a)&&delete this.requestIdHash[a]};this.executeActionItems=function(a,b,d,e,f){d=d.divToUpdate||d.dtu;for(var l=0,n=a.length;l<n;l++){var m=a[l];if("addToImmediate"===m)m={},m.id=b,m.key=d,this.immediateCallbacksList.push(m);else if("addToElementsRefresh"===m||"addToElementsRefreshWithLoading"===m)f.push(d+("addToElementsRefreshWithLoading"===m?",loadingBar":""));else if("updateCache"===m)m=
{handler:this,callbackType:"updateCache"},this.addToPendingCallbacksList(b,d,m);else if("customClientFunction"===m){var m={handler:this,callbackType:"customClientFunction"},h={};h.refreshHandler=e;m.callbackParams=h;this.addToPendingCallbacksList(b,d,m)}else if("doRefreshAndFinish"===m||"doRefresh"===m)m={},m.handler=e,m.callbackType="doRefresh",h={isFinishRefreshReq:1},m.callbackParams=h,this.addToPendingCallbacksList(b,d,m)}};this.getAjaxCallContext=function(a,b,d,e,f,l){b=[];var n=f=0,m="notFetched";
this.cache.getValue(a,"cacheStatus")&&(m=this.cache.getValue(a,"cacheStatus"));for(var h=0,t=this.elementList.length;h<t;h++){var v=this.elementList[h],r=v.divToUpdate||v.dtu,q=[],k=1,u=0,w=0,x=0;if("0"===v.isPrefetchable||"0"===v.isp)k=0,n=1;if("1"===v.customClientFunction||"1"===v.ccf)u=1,k=0;if("1"===v.updateOnHover||"1"===v.uoh)w=1;if("1"===v.loadingBar||"1"===v.lb)x=1;if(!l||w){if(d)if(u||!k||this.cache.getValue(a,r))continue;else q.push("updateCache"),f||(f=1);else u?(q.push("customClientFunction"),
q.push("addToImmediate")):this.cache.getValue(a,r)?(q.push("doRefresh"),q.push("addToImmediate")):(q.push("updateCache"),q.push("doRefreshAndFinish"),x?q.push("addToElementsRefreshWithLoading"):q.push("addToElementsRefresh"),f||(f=1));(1===d&&"preFetched"===m||0===d&&"completeFetched"===m||1===d&&"completeFetched"===m)&&1===f&&(f=0);this.executeActionItems(q,a,v,e,b)}}(1===d&&"preFetched"===m||0===d&&"completeFetched"===m||1===d&&"completeFetched"===m)&&1===f&&(f=0);l&&f&&(f=0);f&&this.cache.setValue(a,
"cacheStatus",d?n?"preFetching":"completeFetching":"preFetched"===m?"hotFeaturesFetching":"completeFetching");a={};a.isAjaxCallReq=f;a.elementsToRefresh=b;return a};this.getUpdateData=function(a,b){var d=b.idList;b=[];for(var e=[],f=[],l=[],n=0,m,h,t,v,r,q=1,k=0,u=d.length;k<u;k++){h=d[k].id;t=d[k].asin;v=d[k].isPrefetch;m=d[k].requiredDivs;m=this.getAjaxCallContext(h,t,v,a,m,d[k].isHover);r=m.elementsToRefresh;for(var w=0,x=r.length;w<x;w++)l.push(r[w]);if(m.isAjaxCallReq){n=1;v=v?1:"hotFeaturesFetching"===
this.cache.getValue(h,"cacheStatus")?2:0;if(0===v||2===v)q=0;e.push(h);f.push(t);b.push(v)}}if(n){d={};d.asinList=f.join(",");d.id=e.join(",");d.prefetchParam=b.join(",");d.managerHandler=a;d.modelType=this.modelType;d.containsOnlyPrefetches=q;try{this.doAjaxCall(d)}catch(P){}}this.elementsToRefresh=l.slice();return l};this.makeCallback=function(a,b,d,e){var f=d.handler,l=d.callbackType;d=d.callbackParams;null==e&&(e=this.cache.getValue(a,b));if("function"==typeof f)f(a,b,d,e);else if("doRefresh"===
l)f.pageRefreshHandler(a,b,d,e);else if("customClientFunction"===l)try{f.callCustomClientFunction(a,b,d,e)}catch(n){}else"updateCache"===l&&f.updateCache(a,b,d,e)};this.makePendingCallBacks=function(a,b,d){var e;if(a){if("object"===typeof this.pendingCallbacksList[a])if(b){e=this.pendingCallbacksList[a][b];if(!e){e=[];var f={handler:this,callbackType:"updateCache"};e.push(f)}for(var l=0,n=e.length;l<n;l++){f=e[l];try{this.makeCallback(a,b,f,d)}catch(h){}}this.pendingCallbacksList[a][b]&&delete this.pendingCallbacksList[a][b]}else{for(var m in this.pendingCallbacksList[a])for(e=
this.pendingCallbacksList[a][m],l=0,n=e.length;l<n;l++)f=e[l],this.makeCallback(a,b,f,d);delete this.pendingCallbacksList[a]}}else{a=0;for(n=this.immediateCallbacksList.length;a<n;a++)b=this.immediateCallbacksList[a],this.makePendingCallBacks(b.id,b.key,null);this.immediateCallbacksList=[]}};this.addToPendingCallbacksList=function(a,b,d){this.pendingCallbacksList.hasOwnProperty(a)||(this.pendingCallbacksList[a]={});this.pendingCallbacksList[a].hasOwnProperty(b)||(this.pendingCallbacksList[a][b]=[]);
this.pendingCallbacksList[a][b].push(d)};this.doAjaxCall=function(a){t.remainingAjaxCalls+=1;var b=this.getNewRequestId();this.currentRequestId=b;var d=a.managerHandler,e=this.AJAXUrl+a.asinList+"\x26isFlushing\x3d2\x26id\x3d"+a.id+"\x26prefetchParam\x3d"+a.prefetchParam+"\x26mType\x3d"+a.modelType;t.isInstaTwisterEnabled&&(e+="\x26dpEnvironment\x3d"+t.dpEnvironment);var f={};if(t.useAuiAjax){var l=this,e=t.A.ajax(e,{method:"get",chunk:function(a){l.AJAXHandler(null,a,w.AJAXFlushUtils.ajaxReadyState.LOADING)},
success:function(){l.AJAXHandler(null,null,w.AJAXFlushUtils.ajaxReadyState.DONE);--t.remainingAjaxCalls;0===t.remainingAjaxCalls&&t.$("#variations-overlay").hide()},error:function(){t.$("#variations-overlay").hide();--t.remainingAjaxCalls;t.printConsoleLogs&&x.log("ajax call failed","ERROR","AjaxErrorHandler")},timeout:4E4});f.streamingXhrRef=e}f.ajaxParams=a;f.managerHandler=d;this.AJAXRequests[b]=f};this.abortAllAjaxCalls=function(){for(var a in this.requestIdHash)this.finishAjaxCall(a,!0)};this.finishAjaxCall=
function(a,b){if(a){var d=this.AJAXRequests[a],e=d.streamingXhrRef,f=d.ajaxParams,d=f.id.split(","),f=f.containsOnlyPrefetches;if(1!==b||!f){this.pendingCallbacksList={};this.immediateCallbacksList=[];if(b)for(e&&"function"===typeof e.abort&&e.abort(w.AJAXFlushUtils.ajaxHandlerCode.ABORT),e=0,f=d.length;e<f;e++)if(this.cache.getValue(d[e])){var l=this.cache.getValue(d[e],"cacheStatus");"preFetching"===l||"completeFetching"===l?b?this.cache.clear(d[e]):this.cache.setValue(d[e],"cacheStatus","preFetching"===
l?"preFetched":"completeFetched"):"hotFeaturesFetching"===l&&this.cache.setValue(d[e],"cacheStatus",b?"preFetched":"completeFetched")}this.elementsToRefresh=[];this.removeRequestId(a);delete this.AJAXRequests[a];this.currentRequestId=null}}};this.updateCache=function(a,b,d,e){"intermediateEOS"===b||"EOS"===b?(b=this.cache.getValue(a,"cacheStatus"),"preFetching"===b?this.cache.setValue(a,"cacheStatus","preFetched"):"completeFetching"!==b&&"hotFeaturesFetching"!==b||this.cache.setValue(a,"cacheStatus",
"completeFetched")):this.cache.setValue(a,b,e)};this.callCustomClientFunction=function(a,e,l,n){var f=b("#"+e).attr("customFunctionName");if(f){var q=l.refreshHandler,u=d.StateController.getState().current_asin;n=function(){q.measurement.stampImageLoad(u)};l=t.useAui?n:null;if(f=t.useAui?eval("var customFunction \x3d "+f+"; customFunction")(a,d.StateController,l):eval(f)(a,d.StateController,l)){l={isFinishRefreshReq:0};if(!t.useAui){var m;if("twister-main-image"===e&&u){m=document.getElementById("main-image");
if(!m){var h=document.getElementById("main_image_0");h&&(m=(m=h.getElementsByTagName("img"))?m[0]:null)}m&&(m.onload=n)}}q.pageRefreshHandler(a,e,l,f);t.useAui||-1<navigator.userAgent.toLowerCase().indexOf("chrome")&&m&&m.complete&&n()}}};this.AJAXHandler=function(a,b,d){if(d===w.AJAXFlushUtils.ajaxReadyState.DONE)return this.finishAjaxCall(this.currentRequestId,0),w.AJAXFlushUtils.ajaxHandlerCode.OK;for(a=0;1>a;a++){var e=b;d=e.ASIN;b=e.Value;e=e.FeatureName;"intermediateEOS"===e||"EOS"===e?this.updateCache(d,
e,null,b):this.makePendingCallBacks(d,e,b)}return w.AJAXFlushUtils.ajaxHandlerCode.OK};this.AJAXErrorHandler=function(a,b,d){(a=a.xhrStatus)||(a=d);return a}}});x.when("A","jQuery").register("page-refresh-refresh",function(u,e){return function(a,b,e){this.$=a;this.loadingBarHtml=b;this.loadingBarHtml2=e;this.doRefresh=function(b,e){a("#"+b).html(e)};this.startRefresh=function(b){if(b)for(var e=0,t=b.length;e<t;e++){var d=b[e].split(","),c=d[0],g=!0,p=!1;if("buy-box_feature_div"===c||"more-buying-choices_feature_div"===
c||"session-similarities_feature_div"===c&&a.browser.msie)g=!1;1<d.length&&("loadingBar"===d[1]||"lb"===d[1])&&(p=!0);g&&a("#"+c).css("opacity","0.5");p&&this.appendLoadingBar(c)}};this.appendLoadingBar=function(b){var e=a("#"+b);"moreBuyingChoices_feature_div"===b||e.attr("loadingBarSet")||(e.attr("loadingBarSet","1"),"more-buying-choices_feature_div"===b?(e=a("#more-buying-choice-content-div"),e.html(this.loadingBarHtml2)):(b=e.find("h2, h1, b"),0<b.length&&(b=a(b[0]),b.css({display:"inline",padding:"0px"}),
b.after(a(this.loadingBarHtml)))))};this.finishRefresh=function(b){var e=!0,t=!0;"buy-box_feature_div"===b&&(t=e=!1);if("session-similarities_feature_div"===b&&a.browser.msie||"more-buying-choices_feature_div"===b)e=!1;var d="0";"more-buying-choices_feature_div"===b&&(d="1");e&&a("#"+b).css({opacity:"",zoom:d});t&&a("#"+b).removeAttr("loadingBarSet")}}});x.when("A","twisterModule","dp-js-logger").execute(function(u,e,a){var b=w.DetailPage,q=w.Twister,n=u.$;e=new a(null,this,!0);var l=y;w.history&&
w.history.replaceState?(e.logImpression(e.eventTypes.HISTORY_API_SUPPORTED,null),u.on("a:pageUpdate",function(){l||(l=u.state("URL-Refresh-State"));if(l&&l.isUrlRefreshEnable&&b&&b.StateController&&"function"===typeof b.StateController.getState){var a=b.StateController.getState()||{},d=q&&q.isAssemblyVariationsEnabled,c=a.current_asin;if(c){for(var e=w.location.search,p={},e=e.substring(e.indexOf("?")+1).split("\x26"),x=0;x<e.length;x++){var f=e[x].split("\x3d");f[0]&&0<=f[0].length&&(p[decodeURIComponent(f[0])]=
decodeURIComponent(f[1]))}d&&(e=c.lastIndexOf("#"),p.customId=-1!==e?c.slice(e+1):c,/(?=.{0,512}$)^([A-Z]{2})_([A-Za-z]+)_([0-9]+)#([A-Za-z0-9\-\_\#\:\|]*$)/g.test(c)?p.customizationToken=c:"customizationToken"in p&&p.customizationToken.startsWith("MC_Custom_1#")?(e=p.customizationToken,x=e.lastIndexOf("#"),f=c.substring(x+1),0>x||(p.customizationToken=e.substring(0,x+1)+f)):p.customizationToken="MC_Assembly_1#"+c);"th"in p||(p.th=1);"psc"in p&&delete p.psc;x=e=!1;for(f=0;f<a.dimensionSelectionData.length;f++){var E=
a.dimensionSelectionData[f];if(1===parseInt(E.isRequired,10)&&(x=!0,0===parseInt(E.isSelected,10))){e=!0;break}}!e&&x&&(p.psc=1);l.landingAsin!==c&&("m"in p?delete p.m:"me"in p?delete p.me:"smid"in p&&delete p.smid);a=(a=n.param(p))&&0<a.length?"?"+a:a;d=d?w.location.pathname:w.location.pathname.replace(new RegExp(l.landingAsin,"i"),c);w.history.replaceState({},document.title,d+a);l.landingAsin=c}}})):e.logImpression(e.eventTypes.HISTORY_API_NOT_SUPPORTED,null)});x.when("A","twister-string-constants").register("twister-productization-view",
function(u,e){return function(a){var b=this;b.twister=y;b.twisterUtil=a.util;b.handleClick=function(a,b){b.subType=e.PRODUCTIZED_VIEW_SUBTYPE;this.twister.metaData(b);this.twister.dimensionChanged(a)};(function(){b.twister=a.registerActive({viewAttribution:"DetailPage",viewName:"TwisterDesktopProductizationView"},{updateView:function(a,b){}})})()}});x.when("A","a-dropdown","twister-thumbnailModule","twister-utils","twister-string-constants","dp-js-logger","twister-dimension-view-promise-factory").register("twister-dimension-views-dropdown",
function(u,e,a,b,q,n,l){function t(d,c){function g(){var a=q.DROPDOWN_DIV_NAME+f.dimName,b;b=function(a){var b={};b[q.STRING_DIM_INDEX]=f.dimOrder;var c=a?a.value:y;b[q.STRING_DIM_VALUE_INDEX]=c?parseInt(c.split(",")[0]):y;f.logger.logImpression(f.logger.eventTypes.CLICK,{divMetaData:b});var c=m?m.handleDropdownChange:y,d=f.twisterControllerHandle.handleDropdownOnChange;c!==y?(f.logger.logCounter("Twister.dropdown.productized.event",1),c.call(m,b,a,q.EVENT_TYPE_DROPDOWN_CHANGE)):(f.logger.logCounter("Twister.dropdown.event",
1),d.call(f.twisterControllerHandle,a,b))};x.when("A").execute(function(c){c.on(q.AUI_DROPDOWN_EVENT_PREFIX+a,b)})}function l(){for(var a,b=0,c=f.dimensionsMap.length;b<c;b++)a=f.dimensionsMap[b],f.thumbnailHandle.attach(a),f.thumbnailHandle.preloadAllThumbnails(a)}function t(a){var c,d,e,g;e=q.ID_SELECTOR+f.dimName+q.CHAR_UNDERSCORE+q.INDEX_FOR_SELECT_OPTION;var k=q.NATIVE_DROPDOWN_DIV_PREFIX+q.DROPDOWN_DIV_NAME+f.dimName,m=E(k).val().split(",")[0],l=a[q.STRING_EVENT_TYPE],p=a[q.STRING_EVENT_DATA],
n=p?p[q.STRING_DIMENSION_SELECTION_DATA]:y;d=a.dimCombID;var u;a=a.optionsUpdatedOnLanding!==y?a.optionsUpdatedOnLanding:!0;p=b.getDimStyleData(d,f.dimValuesDisplayData.length,f.dimOrder,f.twisterAvailabilityCache,f.displayConfigStylesData);f.isCurrentlyUnavailableWeblabEnabled&&(u=f.twisterAvailabilityCache.isDimCombinationCurrentlyAvailable(d));n&&0===n[f.dimOrder][q.STRING_IS_SELECTED]&&m!==q.INDEX_FOR_SELECT_OPTION&&"undefined"!==typeof f.AuiDropdownHandle&&f.AuiDropdownHandle.getSelect(k).val("-1");
l!==q.EVENT_TYPE_CLICK&&l!==q.EVENT_TYPE_DROPDOWN_CHANGE||0!==n[f.dimOrder][q.STRING_IS_REQUIRED]||1!==n[f.dimOrder][q.STRING_IS_SELECTED]||E(e).remove();m=0;for(n=p.length;m<n;m++)if(d=p[m],e=q.NATIVE_DROPDOWN_DIV_PREFIX+f.dimName+q.CHAR_UNDERSCORE+m,c=d[q.STRING_STYLE],d=E(e).get(0).className,c===q.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&(g=E(e).attr("value"),E(k).val()!==g&&f.AuiDropdownHandle.getSelect(k).val(g)),d!==c||d===q.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION||!a)try{var w;g=m;var x=u,C=
{};d!==c&&(C[q.STRING_CSS_CLASS]=c,C[q.STRING_NATIVE_CSS_CLASS]=c);if(f.isCurrentlyUnavailableWeblabEnabled){var A=f.dimValuesDisplayData[g];if(c===q.CLASS_FOR_DROPDOWN_UNAVAILABLE)E("#popover-unavailable-string-text")[0].innerText=f.unavailableString,A+=E("#popover-unavailable-string-text")[0].outerHTML;else if(c===q.CLASS_FOR_DROPDOWN_CURRENTLY_UNAVAILABLE||c===q.CLASS_NAME_FOR_SELCTED_DROPDOWN_OPTION&&!x)E("#popover-currently-unavailable-string-text")[0].innerText=f.currentlyUnavailableString,
A+=E("#popover-currently-unavailable-string-text")[0].outerHTML;C[q.STRING_HTML_CONTENT]=A}w=C;0!==Object.keys(w).length&&f.AuiDropdownHandle.updateOption(e,w)}catch(U){}f.isTablet&&(l===q.EVENT_TYPE_CLICK||l===q.EVENT_TYPE_DROPDOWN_CHANGE)&&f.thumbnailHandle&&f.thumbnailHandle.update(f.dimName)}var f=this,E=u.$,A=c[q.STRING_TWISTER_VARIATION_DATA],m=c[q.PRODUCTIZED_PARENT_VIEW];f.dimType=q.TWISTER_DIMENSION_VIEW_DROPDOWN;f.AuiDropdownHandle=e;f.thumbnailHandle=a;f.dimName;f.dimOrder;f.dimStyleData;
f.dimensionsMap;f.dimNameDisplayString;f.dimValuesDisplayData;f.twisterControllerHandle;f.isTablet;f.unavailableString;f.currentlyUnavailableString;f.isCurrentlyUnavailableWeblabEnabled;f.logger=new n("TwisterDimensionViewsDropdown",this,!0);f.dimType=q.TWISTER_DIMENSION_VIEW_DROPDOWN;f.optionsUpdatedOnLanding=!1;f.initialize=function(){f.twisterAvailabilityCache=c[q.STRING_TWISTER_AVAILABILITY_CACHE];f.dimOrder=c[q.STRING_DIM_ORDER];f.dimName=c[q.STRING_DIM_NAME];f.dimensionsMap=A.dimensionsMap;
f.dimNameDisplayString=c[q.STRING_DIMENSION_DISPLAY_STRING];f.dimValuesDisplayData=A.dimensionValuesData[f.dimOrder];f.twisterControllerHandle=c[q.STRING_TWISTER_CONTROLLER_HANDLE];f.displayConfigStylesData=c[q.STRING_DISPLAY_CONFIG_STYLES_DATA];f.initialTwisterState=c[q.STRING_TWISTER_INITIAL_STATE_KEY];f.isTablet=d.isTablet;f.unavailableString=d[q.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];f.currentlyUnavailableString=d[q.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE];f.isCurrentlyUnavailableWeblabEnabled=
d[q.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];var a=m?m.getCurrDimCombId():f.initialTwisterState.getCurrentDimCombID();f.dimStyleData=b.getDimStyleData(a,f.dimValuesDisplayData.length,f.dimOrder,f.twisterAvailabilityCache,f.displayConfigStylesData);g();f.isTablet&&l();if(f.isCurrentlyUnavailableWeblabEnabled)u.on("a:popover:beforeShow:dropdown_selected_"+f.dimName,function(a){f.optionsUpdatedOnLanding||(a={},a.optionsUpdatedOnLanding=f.optionsUpdatedOnLanding,a.dimCombID=m?m.getCurrDimCombId():
f.initialTwisterState.getCurrentDimCombID(),t(a),f.optionsUpdatedOnLanding=!0)})};f.removePageLayoutUrls=function(){if("undefined"!==typeof TwisterNonJs)for(var a=w.TwisterNonJs.handleDropDown.length,b=0;b<a;b++)w.TwisterNonJs.handleDropDown[b]=function(){}};f.updateView=function(a){switch(a[q.STRING_EVENT_TYPE]){case q.EVENT_TYPE_MOUSELEAVE:case q.EVENT_TYPE_DROPDOWN_CHANGE:case q.EVENT_TYPE_CLICK:t(a);break;case q.EVENT_TYPE_TWISTER_REFRESH:t(a)}}}x.when("a-dropdown-handlers").execute("mark-dropdown-interactive-time",
function(){"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"dropdown"}]})});l.registerDimensionSubView(q.TWISTER_DIMENSION_VIEW_DROPDOWN,t);return t});x.when("A","twister-string-constants","twister-dimension-view-promise-factory").register("twister-dimension-views-singleton",function(u,e,a){function b(a,b){this.dimType=e.TWISTER_DIMENSION_VIEW_SINGLETON;this.initialize=function(){};this.updateView=function(a){}}a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_SINGLETON,
b);return b});x.when("A","twister-dimension-views-unavailablePopover","twister-utils","twister-string-constants","aui-style-override","dp-js-logger","twister-dimension-view-promise-factory","a-truncate").register("twister-dimension-views-swatch",function(u,e,a,b,q,n,l,t){function d(c,d){function l(a,b,c,d){c!==y?(k.logger.logCounter("Twister.swatch.productized.event",1),c.call(G,a,b)):(k.logger.logCounter("Twister.swatch.event",1),d.call(k.twisterControllerHandle,a,a.dimIndex,a.dimValueIndex))}function C(){var a=
b.AUI_EVENT_FOR_SWATCHTHUMB;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"swatch",events:["hover"]}]});u.declarative(a,[b.EVENT_TYPE_CLICK,b.EVENT_TYPE_MOUSEENTER,b.EVENT_TYPE_MOUSELEAVE,b.EVENT_TYPE_MOUSEDOWN,b.EVENT_TYPE_TOUCHSTART],function(a){if(a.type===b.EVENT_TYPE_CLICK){var c=a.data;a=a.type;k.logger.logImpression(k.logger.eventTypes.CLICK,{divMetaData:c});l(c,a,G?G.handleClick:y,k.twisterControllerHandle.handleClick)}else a.type===
b.EVENT_TYPE_MOUSEENTER?(c=a.data,a=a.type,k.logger.logImpression(k.logger.eventTypes.HOVER,{divMetaData:c}),l(c,a,G?G.handleMouseOver:y,k.twisterControllerHandle.handleMouseOver)):a.type===b.EVENT_TYPE_MOUSELEAVE?l(a.data,a.type,G?G.handleMouseOut:y,k.twisterControllerHandle.handleMouseOut):!k.newPrefetchWeblab||a.type!==b.EVENT_TYPE_MOUSEDOWN&&a.type!==b.EVENT_TYPE_TOUCHSTART||k.twisterControllerHandle&&k.twisterControllerHandle.handleClickPrediction(a.data,"T1"===k.newPrefetchWeblab?b.YES:b.NO)})}
function f(){for(var a,c,d=0,e=k.dimData.length;d<e;d++)if(a=k.dimData[d],c=h(d))a=a[b.STRING_STYLE],F(d,c,a),v(d,a)}function E(a,c){var d=r.StateController.getState().selected_variations,e=r.StateController.getState()[b.STRING_DIMENSION_SELECTION_DATA],h=B("#variation_"+k.dimName+" .selection"),f=B("#variation_"+k.dimName).find(".a-truncate");c?(h.addClass("hover"),0<f.length?(h.text(a),a=k.AUITruncate.get(f),a.getIfTextFits()||a.update()):h.html(a)):(c=B("#variation_"+k.dimName+" .selection"),B("#"+
b.TWISTER_MODAL_ID_PREFIX+k.dimName+" .selection"),k.sizeSwatch?(h="",m(e,k.dimOrder)&&""===a||(null==d[k.dimName]?A(e,k.dimOrder)&&(h=a):h=d[k.dimName]),c.html(h).removeClass("hover")):(h.removeClass("hover"),0<f.length?(h.text(a),a=k.AUITruncate.get(f),a.getIfTextFits()||a.update()):h.html(a)))}function A(a,c){var d=!1;1===a[c][b.STRING_IS_SELECTED]&&(d=!0);return d}function m(a,c){var d=!1;1===a[c][b.STRING_IS_REQUIRED]&&(d=!0);return d}function h(a){a=B(b.ID_SELECTOR+k.dimName+b.CHAR_UNDERSCORE+
a);var c;if(0<a.length){a=a.get(0).className.split(" ");for(var d=0,e=a.length;d<e;d++){var h=a[d];if(0===h.indexOf("swatch")){c=h;break}}}return c}function F(a,c,d){a=B(b.ID_SELECTOR+k.dimName+b.CHAR_UNDERSCORE+a);c!==d&&B(a).removeClass(c).addClass(d);q.doOverride(d,a)}function v(a,c){a=B(b.ID_SELECTOR+k.dimName+b.CHAR_UNDERSCORE+a+"_price");var d=b.CLASS_FOR_PRICE_SECONDARY;if(c===b.CLASS_FOR_SWATCH_SELECT||c===b.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER||c===b.CLASS_FOR_SWATCH_HOVER)d=b.CLASS_FOR_PRICE_SELECTED;
a.length&&a.removeClass(b.CLASS_FOR_PRICE_SECONDARY+" "+b.CLASS_FOR_PRICE_SELECTED).addClass(d)}var r=w.DetailPage,D=w.Twister,k=this,B=u.$,N=d[b.STRING_TWISTER_VARIATION_DATA],G=d[b.PRODUCTIZED_PARENT_VIEW];k.dimSubType="";k.dimName;k.dimOrder;k.dimData;k.dimensionsMap;k.dimNameDisplayString;k.dimValuesDisplayData;k.twisterControllerHandle;k.finalLimitForSwatches;k.isCurrentlyUnavailableWeblabEnabled;k.twisterJSInitData=c;k.newPrefetchWeblab=!1;k.landingDimCombId;k.logger=new n("TwisterDimensionViewsSwatch",
this,!0);k.sizeSwatch=!1;k.dimType=b.TWISTER_DIMENSION_VIEW_SWATCH;k.AUITruncate=t;k.initialize=function(){k.twisterAvailabilityCache=d[b.STRING_TWISTER_AVAILABILITY_CACHE];k.isSlotsEnabled=d.isSlotsEnabled;k.newPrefetchWeblab=k.twisterJSInitData.newPrefetchWeblab;k.dimOrder=d[b.STRING_DIM_ORDER];k.dimName=d[b.STRING_DIM_NAME];k.dimensionsMap=N.dimensionsMap;k.dimNameDisplayString=d[b.STRING_DIMENSION_DISPLAY_STRING];k.dimValuesDisplayData=N.dimensionValuesData[k.dimOrder];k.displayConfigStylesData=
d[b.STRING_DISPLAY_CONFIG_STYLES_DATA];k.twisterControllerHandle=d[b.STRING_TWISTER_CONTROLLER_HANDLE];k.initialTwisterState=d[b.STRING_TWISTER_INITIAL_STATE_KEY];k.isCurrentlyUnavailableWeblabEnabled=c[b.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];var e=G?G.getCurrDimCombId():k.initialTwisterState.getCurrentDimCombID();k.displayConfigStylesData;k.dimData=a.getDimStyleData(e,k.dimValuesDisplayData.length,k.dimOrder,k.twisterAvailabilityCache,k.displayConfigStylesData);k.dimSubType=d.dimensionDisplaySubType;
C();f();k.swatchWrapper=".twisterSwatchWrapper_"+k.dimOrder;k.swatchDynaWrapper="twisterSwatchWrapperDynaStyle_"+k.dimOrder;k.$swatches=B(k.swatchWrapper);k.twisterDimmedOpacity=.2;B("#sizeSwatch").length&&(k.sizeSwatch=!0);k.landingDimCombId=r.StateController.getState().currentDimCombID;B(".variations .swatchOuter a").each(function(){var a=u.$(k).contents();B(k).replaceWith(a)})};k.removePageLayoutUrls=function(){B("#twister .swatches a").remove()};k.updateView=function(c){if(c[b.STRING_EVENT_TYPE]===
b.EVENT_TYPE_MOUSEOVER||c[b.STRING_EVENT_TYPE]===b.EVENT_TYPE_MOUSEENTER){var d,f,g,l,p=c[b.STRING_EVENT_DATA],n=p[b.STRING_EVENT_DIM_INFO],r=n[b.STRING_DIMENSION_VALUES_DATA]!==y?n[b.STRING_DIMENSION_VALUES_DATA][k.dimOrder]:"";d=p[b.STRING_EVENT_DIV_METADATA];var q=c.dimCombID,p=d[b.STRING_DIM_INDEX],n=q.split(b.CHAR_UNDERSCORE)[p];if(parseInt(k.dimOrder)===parseInt(p)){var t=h(n),q=a.getDimStyleData(q,k.dimValuesDisplayData.length,k.dimOrder,k.twisterAvailabilityCache,k.displayConfigStylesData);
f=k.dimName+"_"+d.dimValueIndex;g=k.twisterJSInitData;l={};l[b.STRING_HIDE_POPOVER]=g[b.STRING_HIDE_POPOVER];l[b.STRING_UNAVAILABLE_POPOVER_STRING_VALUE]=g[b.STRING_UNAVAILABLE_POPOVER_STRING_VALUE];l[b.STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER]=g[b.STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER];l[b.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE]=g[b.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE];l[b.STRING_CLASS_NAME]=t;l[b.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED]=k.isCurrentlyUnavailableWeblabEnabled;
parseInt(d[b.STRING_DIM_INDEX])===parseInt(k.dimOrder)&&(t===b.CLASS_FOR_SWATCH_UNAVAILABLE&&!k.twisterJSInitData[b.STRING_HIDE_POPOVER]||k.isCurrentlyUnavailableWeblabEnabled&&t===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE)&&e.triggerPopover(c,l,f);B(b.ID_SELECTOR+b.TWISTER_POPOVER).css("z-index","2000");E(r,!0);t===b.CLASS_FOR_SWATCH_UNAVAILABLE&&k.logger.logImpression(k.logger.eventTypes.UNAVAILABLE_SWATCH_HOVER,null);t===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE&&k.logger.logImpression(k.logger.eventTypes.CURRENTLY_UNAVAILABLE_SWATCH_HOVER,
null);c=0;for(r=q.length;c<r;c++)d=q[c],d=d[b.STRING_STYLE],f=h(c),g=f===b.CLASS_FOR_SWATCH_SELECT?!0:!1,l=parseInt(p===parseInt(k.dimOrder)&&parseInt(n)===parseInt(c))?!0:!1,g||t===b.CLASS_FOR_SWATCH_UNAVAILABLE&&!l||(d===b.CLASS_FOR_SWATCH_SELECT&&(d=f===b.CLASS_FOR_SWATCH_UNAVAILABLE?b.CLASS_FOR_SWATCH_UNAVAILABLE_HOVER:k.isCurrentlyUnavailableWeblabEnabled&&f===b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE?b.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE_HOVER:b.CLASS_FOR_SWATCH_HOVER,v(c,d)),F(c,f,d))}}else for(p=
c[b.STRING_EVENT_DATA],n=p[b.STRING_EVENT_DIM_INFO],q=n[b.STRING_DIMENSION_VALUES_DATA]!==y?n[b.STRING_DIMENSION_VALUES_DATA][k.dimOrder]:"",p=p[b.STRING_DIMENSION_SELECTION_DATA],t=c.dimCombID,n=a.getDimStyleData(t,k.dimValuesDisplayData.length,k.dimOrder,k.twisterAvailabilityCache,k.displayConfigStylesData),k.sizeSwatch?(c=t.split("_")[0],t=m(p,k.dimOrder),r=A(p,k.dimOrder),"X"===c&&t&&r||E(q,!1)):E(q,!1),d=0,f=n.length;d<f;d++)c=n[d],q=c[b.STRING_STYLE],0===p[k.dimOrder][b.STRING_IS_SELECTED]&&
q===b.CLASS_FOR_SWATCH_SELECT&&(q=b.CLASS_FOR_SWATCH_AVAILABLE),r=h(d),k.sizeSwatch&&(t=m(p,k.dimOrder),g=!A(p,k.dimOrder),r===b.CLASS_FOR_SWATCH_SELECT&&c[b.STRING_STYLE]===b.CLASS_FOR_SWATCH_SELECT&&t&&g&&(q=c[b.STRING_STYLE])),r&&(k.sizeSwatch&&(t=m(p,k.dimOrder),r!==b.CLASS_FOR_SWATCH_SELECT&&r!==b.CLASS_FOR_SWATCH_HOVER||!t||q!==b.CLASS_FOR_SWATCH_UNAVAILABLE||E("",!1)),r=h(d),F(d,r,q),v(d,q))};x.when("twister-lazy-load-data").execute(function(c){if(c.context.dimKey===k.dimName){var d=r.StateController.getState().currentDimCombID,
e=k.landingDimCombId.split("_"),d=d.split("_");e[k.dimOrder]="*";d[k.dimOrder]="*";d=d.join("_");e=e.join("_");if(d===e){var h=c.context;c=c.responseData.split("\x26\x26\x26");B("#"+b.TWISTER_FEATURE_DIV_ID).css("opacity",.2);B.each(c,function(b,c){var d;if(""!==a.stringTrim(c))try{d=B.parseJSON(c)}catch(e){}else d=c;b=d;c=B(document.querySelectorAll('[data-defaultAsin\x3d"'+b.ASIN+'"]'));d=c.find(" .twisterSlotDiv");if(0<d.length){d.css("display","");if(D.multiDimensionWeblabEnabled){for(var f="",
g=0;b.Value.content.twisterSlotDiv[g];)"IMAGE"===h.dimSubType&&(f+="\x3cdiv\x3e"),f+=b.Value.content.twisterSlotDiv[g],"IMAGE"===h.dimSubType&&(f+="\x3c/div\x3e"),g++;d.html(f)}else d.html(b.Value.content.twisterSlotDiv);c.removeAttr("data-defaultAsin")}});B("#"+b.TWISTER_FEATURE_DIV_ID).css("opacity",1)}}})}l.registerDimensionSubView(b.TWISTER_DIMENSION_VIEW_SWATCH,d);return d});x.when("A","twister-string-constants","dp-js-logger").register("twister-vodd-override-behavior",function(u,e,a){this.VoddOverride=
u.createClass({test:!1,shouldGetNextAvailableAsin:function(a,e){return!1},getSupplementString:function(a,e,n,l){return""}});this.voddOverrideBehavior=new this.VoddOverride;this.externalFeatureName="";this.setExternalOverrideBehavior=function(b,e){try{this.voddOverrideBehavior=b,this.externalFeatureName=e}catch(n){(new a(e)).logFatal(n,{message:"[Override behavior for VODD failed]"})}};this.getVoddOverrideBehavior=function(){return this.voddOverrideBehavior};return this});x.when("A","twister-string-constants").register("twister-dimension-views-unavailablePopover",
function(u,e){function a(a,b,c,g,l,n){if(n)return g;n="";for(var f=0;f<b.length;f++)f!==a&&1===b[f][e.STRING_IS_SELECTED]&&(n=n?n+", "+c[f]:c[f]);n="\x3cstrong\x3e"+n+"\x3c/strong\x3e";return l?g+"\x26nbsp;"+n:n+"\x26nbsp;"+g}function b(a){("Escape"===a.key||27===a.keyCode)&&n&&q()}function q(){n&&(n.close(),l(document).unbind("keydown",b),n=null)}var n=null,l=u.$;return{triggerPopover:function(q,d,c){var g=q[e.STRING_EVENT_DATA];q=g[e.STRING_EVENT_DIM_INFO][e.STRING_DIMENSION_DISPLAY_MAP];var p=
g[e.STRING_DIMENSION_SELECTION_DATA],g=g[e.STRING_EVENT_DIV_METADATA][e.STRING_DIM_INDEX],u=d[e.STRING_CLASS_NAME],f=d[e.STRING_CURRENTLY_UNAVAILABLE_POPOVER_STRING_VALUE],x=d[e.STRING_UNAVAILABLE_POPOVER_STRING_VALUE],A=d[e.CURRENTLY_UNAVAILABLE_CX_CHANGE_WEBLAB_ENABLED];d=d[e.STRING_SHOW_DIM_SECOND_UNAVAILABLE_POPOVER];if("undefined"===typeof w.touchDeviceDetected||!w.touchDeviceDetected){d=a(g,p,q,A&&u===e.CLASS_FOR_SWATCH_CURRENTLY_UNAVAILABLE?f:x,d,A);q="ap_body";p=[2,22];if(l.browser.msie||
navigator.userAgent.match(/Trident/))q+=" styleIE";g=l("#"+c);n=l.AmazonPopover.displayPopover({modal:!1,showOnHover:!0,draggable:!1,showCloseButton:!1,hoverShowDelay:50,hoverHideDelay:0,width:null,closeEventInclude:"CLICK_TRIGGER",literalContent:d,skin:"\x3cdiv id\x3d'twisterPopover' class\x3d'ap_popover twisterPopoverSkin a-text-color-white'\x3e\x3cdiv class\x3d'ap_header'\x3e\x3c/div\x3e\x3cdiv class\x3d'"+q+"'\x3e\x3cdiv class\x3d'ap_content'\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'ap_footer'\x3e\x3cdiv class\x3d'ap_middle'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e",
location:"top",locationElement:w.Twister.$("#"+c),align:"center",attached:!1,group:"TwisterPopover",locationOffset:p,paddingLeft:5,paddingRight:5,paddingBottom:5,onShow:function(){var a=l("#twisterPopover").width();l.browser.msie?l("#twisterPopover").find(".ap_footer").find(".ap_middle").addClass("twisterPopoverArrow").css({top:"16px",width:a-68+"px"}):l("#twisterPopover").find(".ap_footer").find(".ap_middle").addClass("twisterPopoverArrow").css({width:a-68+"px"});l(document).bind("keydown",b)}},
g);l("#"+c).trigger("mouseover.amzPopover")}},closePopover:q}});x.when("A","twister-utils","twister-string-constants","twister-expander","dp-js-logger","twister-dimension-view-promise-factory","legacy-popover").register("twister-counter",function(u,e,a,b,q,n){function l(l,d){function c(){J=new b({minHeightForExpandedSection:55,maxHeightForExpandedSection:155,maxHeightForExpandedSectionInView:101,scrollAnimationDuration:500,expanderSection:P,useExpanderScrollView:K>=r.minAsinsForExpandedScroll-1,minAsinsForExpandedView:r.minAsinsForExpandedView,
expanderButtonReplacementIndex:r.minAsinsForExpandedView-2,dimValuePrefix:G,initSelectedID:r.currDimCombID,swatchImageSize:54,swatchImageMargin:10,expanderButton:k,collapseButton:B,dimDisplayType:"counter",logger:S,dimOrder:r.dimOrder,synchronousPostExpanderCallback:function(){u.trigger("TwisterCounterExpanded")},synchronousPostCollapseCallback:function(){u.trigger("TwisterCounterCollapsed")}})}function g(){var b=a.AUI_EVENT_FOR_COUNTER;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",
{hasComponents:!0,components:[{name:"counter",events:["hover"]}]});if(e.isTouchDevice()){var c=!1,d="";u.declarative(b,[a.EVENT_TYPE_CLICK,a.EVENT_TYPE_TOUCHSTART,a.EVENT_TYPE_TOUCHEND,a.EVENT_TYPE_TOUCHMOVE],function(b){b.data&&(b.data.dimDisplayType=a.TWISTER_DIMENSION_VIEW_COUNTER);b.type===a.EVENT_TYPE_CLICK?n(b):b.type===a.EVENT_TYPE_TOUCHSTART?(d=b.data.dimValueSelectedID,c=!1):b.type===a.EVENT_TYPE_TOUCHMOVE?c=!0:b.type!==a.EVENT_TYPE_TOUCHEND||c||d!==b.data.dimValueSelectedID||(d="",c=!1,
b.type=a.EVENT_TYPE_CLICK,n(b));I=!1})}else u.declarative(b,[a.EVENT_TYPE_CLICK,a.EVENT_TYPE_MOUSEENTER,a.EVENT_TYPE_MOUSELEAVE],function(b){b.data&&(b.data.dimDisplayType=a.TWISTER_DIMENSION_VIEW_COUNTER);if(b.type===a.EVENT_TYPE_CLICK)n(b);else if(b.type===a.EVENT_TYPE_MOUSEENTER){var c=p(b.data);F(c,b.type,r.parentView?r.parentView.handleMouseOver:y,r.twisterControllerHandle.handleMouseOver,null);b=b.data[a.STRING_DIM_VALUE_INDEX];D(G+b).css("cursor","pointer");b!==r.currDimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]&&
(D(G+b).css("z-index",1),x(!0,b),N.html(r.dimValuesDisplayData[b]))}else b.type===a.EVENT_TYPE_MOUSELEAVE&&(c=p(b.data),F(c,b.type,r.parentView?r.parentView.handleMouseOut:y,r.twisterControllerHandle.handleMouseOut,c[a.STRING_DIM_VALUE_INDEX]),b=b.data[a.STRING_DIM_VALUE_INDEX],b!==r.currDimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]&&(D(G+b).css("z-index",0),x(!1,b),N.html(r.dimValuesDisplayData[r.currDimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]])));I=!1})}function p(b){return{dimIndex:r.dimOrder,
dimValueIndex:b?m(b.dimValueSelectedID):null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_COUNTER,dimValueSelectedID:b.dimValueSelectedID}}function n(b){L=D(a.ID_SELECTOR+b.data.dimValueSelectedID);var c=e.reconstructCombinationWithDimValue(r.currDimCombID,b.data[a.TWISTER_EVENT_DATA_DIM_INDEX],b.data[a.STRING_DIM_VALUE_INDEX]),d=p(b.data);r.currDimCombID!==c&&F(d,b.type,r.parentView?r.parentView.handleClick:y,r.twisterControllerHandle.handleClick,d[a.STRING_DIM_VALUE_INDEX])}function f(b){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA][a.TWISTER_EVENT_DATA_DISPLAY_TYPE];
R=D(G+b.dimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]);(U=D(".vodd-dim-wrapper").length)&&R.hasClass("counter_unavailable")&&c===a.TWISTER_DIMENSION_VIEW_COUNTER&&u.animate(D(".vodd-dim-wrapper"),{scale:1.1},150,"ease-in",function(){u.animate(D(".vodd-dim-wrapper"),{scale:1},100,"ease-out",function(){})})}function x(a,b){b=D(G+b);a?b.addClass("hoverSwatch"):b.removeClass("hoverSwatch")}function A(){"undefined"===typeof r.$variationList&&(r.$variationList=D("#"+a.TWISTER_DIMENSION_VIEW_COUNTER+"-"+
r.dimName+" .counterSwatch"));for(var b=r.$variationList,c=r.parentView?r.parentView.getCurrDimCombId():r.initialTwisterState.getCurrentDimCombID(),d=parseInt(r.dimOrder),f=[],g=0;g<b.length;g++){5===f.length&&(h(f),f=[]);var k=m(b[g].id),k=e.reconstructCombinationWithDimValue(c,d,k);(k=r.dimensionToAsinMap[k])?f.push(k):D(b[g]).addClass("counter_unavailable")}0<f.length&&h(f)}function m(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function h(a){var b=S.createFunctionTimer(S.eventTypes.DIM_SUM_LOAD);
b.start();var c=function(){b.stop()};0<a.length&&v.dimensionalSummaryModule.fetchDimSumData({indices:y,asinList:a,dimTriggeringDimSum:r.dimName,dimSubType:r.dimSubType,dimType:r.dimType,chunk:function(a){var b=parseInt(z[a.ASIN][parseInt(r.dimOrder)]),b=D(G+b);0<a.Value.content.twisterSlotDiv.length&&b.removeClass("counter_unavailable")},success:function(a,b,d,e){c()},error:c,abort:c})}function F(a,b,c,d,e){c!==y&&"function"===typeof c?c.call(r.parentView,a,b):"function"===typeof d&&d.call(r.twisterControllerHandle,
a,r.dimOrder,e)}var v=w.Twister,r=this,D=u.$,k=D(a.ID_SELECTOR+"expanderButton"),B=D(a.ID_SELECTOR+"collapseButton"),N,G,P,K,I,L,M,R,U,J,S,z,H=d[a.STRING_TWISTER_VARIATION_DATA];r.dimType=a.TWISTER_DIMENSION_VIEW_COUNTER;r.initialize=function(){r.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];r.parentView=d[a.PRODUCTIZED_PARENT_VIEW];r.twisterJSInitData=l;r.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];r.dimensionToAsinMap=H.dimToAsinMapData;r.dimOrder=d[a.STRING_DIM_ORDER];r.dimName=d[a.STRING_DIM_NAME];
r.dimensionsMap=d[a.STRING_DIMENSIONS_MAP];r.dimNameDisplayString=d[a.STRING_DIMENSION_DISPLAY_STRING];r.dimValuesDisplayData=d[a.STRING_DIMENSION_VALUES_DATA];r.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];r.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];l.useCounterConfig?(r.expandedViewEnabled=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][r.dimOrder][a.EXPANDED_VIEW_ENABLED],r.minAsinsForExpandedView=l[a.MIN_ASINS_FOR_EXPANDED_VIEW],r.minAsinsForExpandedScroll=l[a.MIN_ASINS_FOR_EXPANDED_SCROLL]):
(r.displayTypeProperties=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][r.dimOrder],r.expandedViewEnabled=r.displayTypeProperties[a.EXPANDED_VIEW_ENABLED],r.minAsinsForExpandedView=r.displayTypeProperties[a.MIN_ASINS_FOR_EXPANDED_VIEW],r.minAsinsForExpandedScroll=r.displayTypeProperties[a.MIN_ASINS_FOR_EXPANDED_SCROLL]);r.dimSubType=d.dimensionDisplaySubType;r.currDimCombID=r.parentView?r.parentView.getCurrDimCombId():r.initialTwisterState.getCurrentDimCombID();S=new q("DPTwisterCounterView");z=H.asinToDimIndexMapData;
N=D(a.ID_SELECTOR+"counter-label-"+r.dimName+" .selection");G=a.ID_SELECTOR+r.dimName+a.CHAR_UNDERSCORE;P=D(a.ID_SELECTOR+"counterSwatchSection-"+r.dimName);K=r.dimValuesDisplayData.length;M=D(G+r.currDimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]);L=D(G+r.currDimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]);I=!1;g();r.expandedViewEnabled&&K>=r.minAsinsForExpandedView&&c();w.CounterScenesController&&w.CounterScenesController.registerCounter(r)};r.removePageLayoutUrls=function(){D(".counterSwatch").each(function(a){a=
D(this);a.parent().is("a")&&a.unwrap()})};r.updateView=function(b){if(b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&r.currDimCombID!==b[a.STRING_DIM_COMB_ID]){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIM_INFO][a.STRING_DIMENSION_VALUES_DATA][r.dimOrder];M.css("z-index",0);L.css("z-index",1);N.html(c);L=D(G+b.dimCombID.split(a.CHAR_UNDERSCORE)[r.dimOrder]);L.removeClass("hoverSwatch");M.removeClass("selectedSwatch");L.addClass("selectedSwatch");f(b);A();r.currDimCombID=b[a.STRING_DIM_COMB_ID];u.trigger("counter:select",
r.currDimCombID);null!=J&&(J.updateSelectedVariation(r.currDimCombID,L),J.isCollapsed&&I&&J.handleVariationSwap(I),J.isCollapsed?J.handleVariationSwap(!0):J.scrollVariationIntoView());M=L}};r.selectCounterVariationAtIndex=function(a){I=!0;D(G+a).children().click()};r.getCurrentSelectedIndex=function(){return parseInt(r.currDimCombID,10)};r.expandCounter=function(){null!=J&&J.isCollapsed&&J.handleExpand()};r.onInitializeTwister=function(){A()}}n.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_COUNTER,
l);return l});x.when("A","twister-utils","twister-string-constants","twister-expander","dp-js-logger","twister-dimension-view-promise-factory").register("twister-shelf",function(u,e,a,b,q,n){function l(l,d){function c(a){"undefined"!==a&&w.ue&&w.ue.tag&&w.ue.tag(a)}function g(a){var b=w.ue;if(b){var c=b.count(a)||0;b.count(a,c+1)}}function p(){return k.parentView?k.parentView.getCurrDimCombId():k.initialTwisterState.getCurrentDimCombID()}function n(){T=new b({minHeightForExpandedSection:k.minHeightForExpandedSection,
maxHeightForExpandedSection:k.maxHeightForExpandedSection,maxHeightForExpandedSectionInView:k.maxHeightForExpandedSection-74,scrollAnimationDuration:500,expanderSection:I,useExpanderScrollView:L>=k.minAsinsForExpandedScroll-1,minAsinsForExpandedView:k.minAsinsForExpandedView,expanderButtonReplacementIndex:k.expanderButtonReplacementIndex,dimValuePrefix:K,initSelectedID:k.currDimCombID,swatchImageSize:74,swatchImageMargin:17,expanderButton:N,collapseButton:G,expanderHidesVariation:k.expanderHidesVariation,
dimDisplayType:"shelf",logger:J,dimOrder:k.dimOrder,expanderButtonPostCollapse:k.expanderButtonPostCollapse,synchronousPreExpanderCallback:function(){I.removeClass("twisterShelf_isCollapsed");I.removeClass("twisterShelf_isCollapsedAnimated");I.addClass("twisterShelf_isExpanded");I.addClass("twisterShelf_isExpandedAnimated");m()},synchronousPostExpanderCallback:function(){A();I.removeClass("twisterShelf_isExpandedAnimated");u.trigger("TwisterShelfExpanded");k.dualDimension&&g("dualDimshelfExpanded")},
synchronousPreCollapseCallback:function(){I.removeClass("twisterShelf_isExpanded");I.removeClass("twisterShelf_isExpandedAnimated");I.addClass("twisterShelf_isCollapsed");I.addClass("twisterShelf_isCollapsedAnimated");m()},synchronousPostCollapseCallback:function(){A();I.removeClass("twisterShelf_isCollapsedAnimated");u.trigger("TwisterShelfCollapsed")}})}function f(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function x(b){return{dimIndex:k.dimOrder,dimValueIndex:b?f(b.id):
null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_SHELF,dimValueSelectedID:b.id}}function A(){m();"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"shelf",events:["hover"]}]});M.bind(a.EVENT_TYPE_CLICK,function(b){var c=x(b.currentTarget);b=b.type;H=B(a.ID_SELECTOR+c.dimValueSelectedID);var d=e.reconstructCombinationWithDimValue(k.currDimCombID,c.dimIndex,c.dimValueIndex);k.currDimCombID!==d&&r(c,b,k.parentView?k.parentView.handleClick:
y,k.twisterControllerHandle.handleClick,null)});e.isTouchDevice()||(M.bind(a.EVENT_TYPE_MOUSEENTER,function(b){var c=x(b.currentTarget);r(c,b.type,k.parentView?k.parentView.handleMouseOver:y,k.twisterControllerHandle.handleMouseOver,null);b=c[a.STRING_DIM_VALUE_INDEX];c=B(K+b);c.css("cursor","pointer");b!==k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]&&(c.addClass("hoverSwatch"),P.html(k.dimValuesDisplayData[b]))}),M.bind(a.EVENT_TYPE_MOUSELEAVE,function(b){var c=x(b.currentTarget);r(c,b.type,
k.parentView?k.parentView.handleMouseOut:y,k.twisterControllerHandle.handleMouseOut,c[a.STRING_DIM_VALUE_INDEX]);b=c[a.STRING_DIM_VALUE_INDEX];c=B(K+b);b!==k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]&&(c.removeClass("hoverSwatch"),P.html(k.dimValuesDisplayData[k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]]))}))}function m(){M.unbind(a.EVENT_TYPE_CLICK);e.isTouchDevice()||(M.unbind(a.EVENT_TYPE_MOUSEENTER),M.unbind(a.EVENT_TYPE_MOUSELEAVE))}function h(b){var c=b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA][a.TWISTER_EVENT_DATA_DISPLAY_TYPE];
S=B(K+b.dimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);(z=B(".vodd-dim-wrapper").length)&&S.hasClass("shelf_unavailable")&&c===a.TWISTER_DIMENSION_VIEW_SHELF&&u.animate(B(".vodd-dim-wrapper"),{scale:1.1},150,"ease-in",function(){u.animate(B(".vodd-dim-wrapper"),{scale:1},100,"ease-out",function(){})})}function F(b){"undefined"===typeof k.$variationList&&(k.$variationList=B("#"+a.TWISTER_DIMENSION_VIEW_SHELF+"-"+k.dimName+" .twisterShelf_swatch"));for(var c=k.$variationList,d=p(),h=parseInt(k.dimOrder),
g=[],m=0;m<c.length;m++){5===g.length&&(v(g),g=[]);var l=f(c[m].id),l=e.reconstructCombinationWithDimValue(d,h,l);if(l=k.dimensionToAsinMap[l])b?B(".twisterShelf_container #"+k.dimName+"_"+R[l]+" .twisterShelf_infoSection_slots").length||(g.push(l),W+=1):(g.push(l),W+=1);else{var l=B(c[m]),n,r=c[m];n=p().split(a.CHAR_UNDERSCORE);var q=[],t=parseInt(k.dimOrder),r=parseInt(f(r.id));n[t]=r;if(k.parentView)var u=String(n[t]),w=k.parentView.twisterCore,r=k.parentView.twisterCore.util,u=w.util.predictNextState(w.util.createSelectionInfo(w.state()),
w.util.createSelectionInfo(w.util.getSelectionInfoFromDimIndexAndValue(t,u))),r=r.getAsinFromSelectionInfo(u.selectionInfo());else r=k.twisterControllerHandle.twisterAvailabilityCache.gAsinToRender(n.join(a.CHAR_UNDERSCORE),t);if(r=R[r])for(u=0;u<n.length;u++)t!==u&&U[u]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&q.push(k.dimensionValuesList[u][r[u]]);n=q.join(", ");l.addClass("shelf_unavailable");"undefined"!==typeof n?(q=l.find(".unavailableV2"),q.find(".variation-combination-text").html(n),l.find(".unavailable-text").removeClass("aok-hidden"),
l.find(".shelf_loading_placeholder").hide(),q.removeClass("aok-hidden"),l.find(".twisterShelf_infoSection").empty().addClass("aok-hidden")):(l.find(".shelf_loading_placeholder").hide(),l.find(".outofstock-text").removeClass("aok-hidden"),l.find(".shelf-outofstock").removeClass("aok-hidden"))}}0<g.length&&v(g)}function v(b){var d=J.createFunctionTimer(J.eventTypes.DIM_SUM_LOAD);d.start();var e=function(){d.stop();fa+=b.length;fa===W&&k.dualDimension&&c("twisterDualDimPlaceholderRemove")};0<b.length&&
D.dimensionalSummaryModule.fetchDimSumData({indices:y,asinList:b,dimTriggeringDimSum:k.dimName,dimSubType:k.dimSubType,dimType:k.dimType,chunk:function(b){if(b&&"object"===typeof b){var c=parseInt(R[b.ASIN][parseInt(k.dimOrder)]),c=B(K+c);if(b.Value&&b.Value.content&&b.Value.content.twisterSlotDiv){var d=B.trim(b.Value.content.twisterSlotDiv);if(0<d.length){c.removeClass("shelf_unavailable");c.find(".unavailableV2").addClass("aok-hidden");c.find(".outofstock-text").addClass("aok-hidden");c.find(".shelf-outofstock").addClass("aok-hidden");
c.find(".unavailable-text").addClass("aok-hidden");b=c.find(".twisterShelf_infoSection");b.empty();b.addClass("aok-hidden");b.append(d);var d=c.find(".twisterShelf_infoSection .price_slot_ppu, .twisterShelf_infoSection .deal_slot_ppu"),e=c.find(".twisterShelf_infoSection .sampling_twister_message"),h=c.find(".twisterShelf_infoSection .sampling_twister_price"),f=c.find(".twisterShelf_infoSection .twister_swatch_price");if(d.length||e.length){var g=B("\x3cp\x3e\x3c/p\x3e");e.length&&h.length?(f.length&&
h.empty(),d.empty(),g.append(e)):g.append(d);b.append(g);d=c.find(".twisterShelf_infoSection i");c=c.find(".twisterShelf_infoSection .olpWrapper");e=B(".twisterShelf_swatchSection.twisterShelf_isCollapsed");d.length&&c.length&&e.length&&b.addClass("hasAllItems")}b.removeClass("aok-hidden");d=I.find(".twisterShelf_swatch.selectedSwatch .twisterShelf_infoSection");d.length&&(c=d.find("[id*\x3d_price]"),d=d.find(".a-size-mini.[class*\x3d_slot_ppu]"),c.length&&c.hasClass(a.CLASS_FOR_PRICE_SECONDARY)&&
c.removeClass(a.CLASS_FOR_PRICE_SECONDARY).addClass(a.CLASS_FOR_PRICE_SELECTED),d.length&&d.addClass(a.CLASS_FOR_PRICE_SELECTED));k.dualDimensionShelf&&(c=b.find(".twister_swatch_price").find(".a-size-mini"),d=c.text().replace(/\s+/g,"").length,b.find("i").length&&7<d&&c.addClass("twisterShelf_dual_dim_price_long"))}}}},success:function(a,b,c,d){e()},error:e,abort:e})}function r(a,b,c,d,e){c!==y&&"function"===typeof c?c.call(k.parentView,a,b):"function"===typeof d&&d.call(k.twisterControllerHandle,
a,k.dimOrder,e)}var D=w.Twister,k=this,B=u.$,N,G,P,K,I,L,M,R,U,J,S,z,H,O,T,W=0,fa=0,X=d[a.STRING_TWISTER_VARIATION_DATA];k.dimType=a.TWISTER_DIMENSION_VIEW_SHELF;k.initialize=function(){k.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];k.dimOrder=d[a.STRING_DIM_ORDER];k.parentView=d[a.PRODUCTIZED_PARENT_VIEW];k.twisterJSInitData=l;k.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];k.expandedViewEnabled=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.EXPANDED_VIEW_ENABLED];k.dimensionToAsinMap=
X.dimToAsinMapData;k.dimName=d[a.STRING_DIM_NAME];k.dimensionsMap=d[a.STRING_DIMENSIONS_MAP];k.dimNameDisplayString=d[a.STRING_DIMENSION_DISPLAY_STRING];k.dimValuesDisplayData=d[a.STRING_DIMENSION_VALUES_DATA];k.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];k.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];"IMAGE"===d[a.DIMENSION_SUB_TYPE]?(k.minAsinsForExpandedView=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MIN_ASINS_FOR_EXPANDED_VIEW_IMAGE],k.minAsinsForExpandedScroll=
l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MIN_ASINS_FOR_EXPANDED_SCROLL_IMAGE]):(k.minAsinsForExpandedView=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MIN_ASINS_FOR_EXPANDED_VIEW_TEXT],k.minAsinsForExpandedScroll=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MIN_ASINS_FOR_EXPANDED_SCROLL_TEXT]);k.dualDimension=B(".dualDim-Swatch").length;k.dualDimension?(k.expanderButtonReplacementIndex=k.minAsinsForExpandedView-2,k.expanderHidesVariation=!0,k.expanderButtonPostCollapse=
!0,k.dualDimensionShelf=!0,k.minHeightForExpandedSection=89,k.maxHeightForExpandedSection=209,c("twisterDualDimPlaceholderShow2")):(k.expanderButtonReplacementIndex=k.minAsinsForExpandedView-1,k.expanderHidesVariation=!1,k.expanderButtonPostCollapse=!1,k.dualDimensionShelf=!1,k.minHeightForExpandedSection=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MIN_HEIGHT_EXPANDED_SECTION],k.maxHeightForExpandedSection=l[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES][k.dimOrder][a.MAX_HEIGHT_EXPANDED_SECTION]);
k.dimSubType=d[a.DIMENSION_SUB_TYPE];k.currDimCombID=p();J=new q("DPTwisterShelfView");U=X.dimensionsDisplayType;R=X.asinToDimIndexMapData;k.dimensionValuesList=X.dimensionValuesData;M=B(a.ID_SELECTOR+"shelfSwatchSection-"+k.dimName+" .twisterShelf_swatch");P=B(a.ID_SELECTOR+"shelf-label-"+k.dimName+" .twisterShelf_dimension_label span");K=a.ID_SELECTOR+k.dimName+a.CHAR_UNDERSCORE;I=B(a.ID_SELECTOR+"shelfSwatchSection-"+k.dimName);L=k.dimValuesDisplayData.length;O=B(K+k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);
H=B(K+k.currDimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);N=B(a.ID_SELECTOR+"shelfSwatchSection-"+k.dimName+" .expanderButton");G=B(a.ID_SELECTOR+"shelfSwatchSection-"+k.dimName+" .collapseButton");A();k.expandedViewEnabled&&L>=k.minAsinsForExpandedView&&n()};k.removePageLayoutUrls=function(){B(".twisterShelf_swatch").each(function(a){a=B(this);a.parent().is("a")&&a.unwrap()})};k.updateView=function(b){if(b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&k.currDimCombID!==b[a.STRING_DIM_COMB_ID]){for(var c=
b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIM_INFO][a.STRING_DIMENSION_VALUES_DATA][k.dimOrder],d=0;d<k.$variationList.length;d++){var e=B(k.$variationList[d]);e.find("twisterShelf_infoSection").addClass("shelf_loading_placeholder");e.find("twisterShelf_infoSection").removeClass("aok-hidden");e.find("twisterShelf_infoSection").addClass("twisterShelf_placeholder_price");e.find("twisterShelf_infoSection").addClass("twisterShelf_placeholder_badge");e.find("unavailableV2").addClass("aok-hidden");e.find("twister_swatch_price").addClass("aok-hidden")}P.html(c);
H=B(K+b.dimCombID.split(a.CHAR_UNDERSCORE)[k.dimOrder]);H.removeClass("hoverSwatch");O.removeClass("selectedSwatch");H.addClass("selectedSwatch");h(b);F(!1);k.dualDimension&&g("dualDimShelfVariationDoubleClick");k.currDimCombID=b[a.STRING_DIM_COMB_ID];null!=T&&(T.updateSelectedVariation(k.currDimCombID,H),T.isCollapsed?T.handleVariationSwap(!0):T.scrollVariationIntoView());O=H}};k.onInitializeTwister=function(){u.loadDescendantImagesManually(I);F(!1)}}n.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_SHELF,
l);return l});x.when("A","a-popover","twister-string-constants","twister-utils").register("twister-vodd-popover",function(u,e,a,b){return function(q){function n(a,b){f.eventListener&&f.eventListener.handlePopoverEvent&&f.eventListener.handlePopoverEvent(a,b)}function l(b){n(a.EVENT_TYPE_SHOWPOPOVER,b);var d="bottom"===f.displayPosition?"vodd-modified-popover":"vodd-modified-top-popover";b.popover.$container.hasClass(d)||b.popover.$container.addClass(d);c(b.popover.$container)}function t(b){n(a.EVENT_TYPE_HIDEPOPOVER,
b);b.popover.$trigger.blur()}function d(b){c(b.popover.$container);n(a.EVENT_TYPE_UPDATEPOPOVERPOSITION,b)}function c(a){var b=x.get(0).getBoundingClientRect(),c,d;w.pageYOffset?(c=w.pageYOffset,d=w.pageXOffset):"CSS1Compat"===(document.compatMode||"")?(c=document.documentElement.scrollTop,d=document.documentElement.scrollLeft):(c=document.body.scrollTop,d=document.body.scrollLeft);c="bottom"===f.displayPosition?b.bottom+c:b.top+c-a.height();var e=b.right-b.left,b=b.left+d;a&&a.css({top:c+"px",left:b+
"px",width:e+"px"})}var g,p=u.$,x,f={name:null,trigger:null,eventListener:null,displayPosition:"bottom",positionOnTwisterContainer:!0};this.getHandle=function(){return g};q&&p.extend(f,q);if(!f.name)throw"Popover name should not be null";if(!f.trigger)throw"Popover trigger should not be null";(function(){var a="triggerBottom";"top"===f.displayPosition&&(a="triggerTop");a={closeButton:!1,closeButtonLabel:"close",position:a,name:f.name,popoverLabel:f.name,padding:"none",activate:b.isTouchDevice()?"onmouseover":
"onclick"};f.height&&p.extend(a,{height:f.height});g=e.create(f.trigger,a)})();(function(){"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"vodd"}]});u.on("a:popover:afterShow:"+f.name,l);u.on("a:popover:afterHide:"+f.name,t);u.on("a:popover:afterUpdatePosition:"+f.name,d);var a=function(){g&&g.isActive()&&c(g.$container)};u.on("a:pageUpdate",a);p(w).resize(a)})();x=f.positionOnTwisterContainer?p("#twister"):f.trigger}});x.when("A",
"twister-utils","twister-string-constants","scroll-event-handler","twister-vodd-popover","twister-vodd-override-behavior","dp-js-logger","twister-dimension-view-promise-factory").register("twister-vodd",function(u,e,a,b,q,n,l,t){function d(c,d){function p(){return z.parentView?z.parentView.getCurrDimCombId():z.initialTwisterState.getCurrentDimCombID()}function t(){var a=100*parseInt(z.dimensionOrder),b=a,c=function(a,b,c){a.addClass("animation-start");setTimeout(function(){a.animate({top:c||"0px"},
{duration:300,complete:function(){H(this).removeClass("animation-start")}})},b)};ba.length&&ba.parent("td").is(":visible")&&(c(ba.parent("td"),a,"5px"),b=a+50);c(ia.parent("td"),b,"5px")}function f(){ja=a.ID_SELECTOR+"vodd-button-"+z.dimensionName;na=a.ID_SELECTOR+"vodd-singleton-"+z.dimensionName;ra=a.CLASS_SELECTOR+"vodd-button-label-"+z.dimensionName;sa=a.CLASS_SELECTOR+"vodd-button-icon-"+z.dimensionName;ua=a.ID_SELECTOR+"vodd-table-"+z.dimensionName;ta=a.ID_SELECTOR+"dimension-button-img-"+z.dimensionName;
oa=a.ID_SELECTOR+z.dimensionName+a.CHAR_UNDERSCORE;va="vodd-popover-"+z.dimensionName;var b=parseInt(z.dimensionOrder),d=c[a.INIT_DATA_DISPLAY_TYPE_PROPERTIES];d&&H.isArray(d)&&d.length>b&&(b=d[b],b[a.INIT_DATA_VISIBLE_ROW_COUNT]&&(ca=b[a.INIT_DATA_VISIBLE_ROW_COUNT]),b[a.INIT_DATA_MAX_POPOVER_HEIGHT]&&(ka=b[a.INIT_DATA_MAX_POPOVER_HEIGHT]),b[a.INIT_DATA_ANIMATE_BUTTON_CONTENT]&&(wa=b[a.INIT_DATA_ANIMATE_BUTTON_CONTENT]),b[a.INIT_DATA_POPOVER_POSITION]&&(xa=b[a.INIT_DATA_POPOVER_POSITION]))}function E(b){if(V){var c=
V.length/z.dimensionsMap.length*100,c={divMetaData:D(null),count:Math.ceil(z.dimensionsMap.length/ca),percentage:Math.floor(c),dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD};da.logImpression(b,c)}}function A(){2===fa&&1===X&&(qa=!1);var b={trigger:z.dimensionButton,name:va,eventListener:z,displayPosition:xa,positionOnTwisterContainer:qa},c=Q.find("tr").not(".aok-hidden");c.length&&c.length>ca&&ka&&"undefined"!==typeof ka&&H.extend(b,{height:ka});O=new q(b);z.dimensionButton.bind(e.isTouchDevice()?
a.EVENT_TYPE_TOUCHEND:a.EVENT_TYPE_CLICK,function(a){if(O&&O.getHandle()&&O.getHandle().isActive())return O.getHandle().hide(),!1;da.logImpression(Z.CLICK,{time:Date.now()});e.isTouchDevice()&&z.dimensionButton.trigger("mouseenter")})}function m(a,b){var c=da.createFunctionTimer(Z.DIM_SUM_LOAD);c.start();S.dimensionalSummaryModule&&S.dimensionalSummaryModule.fetchDimSumData({indices:b,asinList:a,dimTriggeringDimSum:z.dimensionName,dimSubType:z.dimSubType,dimType:z.dimType,chunk:function(a){if(a&&
"object"===typeof a){var b=ea[a.ASIN][parseInt(z.dimensionOrder)],b=Q.find(oa+b);if(a.Value&&a.Value.content&&a.Value.content.twisterSlotDiv){var c=H.trim(a.Value.content.twisterSlotDiv);0<c.length&&(b.find(".vodd-loading-placeholder").hide(),P(b),a=b.find(".dimension-details"),a.append(c),b=a.find(".twister_swatch_price").parent(),b.is("div")&&!b.attr("class")&&(b=F(b),b.find(".a-size-mini").addClass("a-size-small").removeClass("a-size-mini"),b.addClass("a-color-price")),a=a.find(".sns-data-slot").parent(),
a.is("div")&&!a.attr("class")&&F(a))}}},success:function(a,b,d,e){c.stop()},error:function(){c.stop()},abort:function(){c.stop()}})}function h(b){var c=p(),d=parseInt(z.dimensionOrder),h=[],f=[];V||(V=[]);var g=n.getVoddOverrideBehavior();z.voddOverrideEnabled=!0;try{z.shouldFetchNextAvailableAsin=g.shouldGetNextAvailableAsin(z.dimensionOrder,z.dimensionsMap)}catch(k){var q=new l(g.externalFeatureName),v={message:"[shouldFetchNextAvailableAsin failed for VODD Twister Override]"};q.logFatal(k,v)}for(var t=
0;t<b.length;t++){7===h.length&&(m(h,f),h=[],f=[]);var w=r(b[t].id),q=e.reconstructCombinationWithDimValue(c,d,w),x=pa[q];0>u.indexOfArray(V,w)&&V.push(w);null==x&&z.shouldFetchNextAvailableAsin&&(q=p().split(a.CHAR_UNDERSCORE),d=parseInt(z.dimensionOrder),q[d]=w,x=L(q,d));if(x){if(z.voddOverrideEnabled){var D="";try{D=g.getSupplementString(x,pa,ea,W)}catch(k){q=new l(g.externalFeatureName),v={message:"[getSupplementString failed for VODD Twister Override]"},q.logFatal(k,v)}H(b[t]).find(".supplementString").remove();
H(b[t]).find(".dimension-display-text").append('\x3cspan class\x3d"supplementString a-size-mini"\x3e'+D+"\x3c/span\x3e")}f.push(w);h.push(x)}}0<h.length&&m(h,f)}function F(a){var b=a.prev(),c=a.children();a.remove();b.after(c);return c}function v(a){a=e.getVisibleTableRows(a.currentTarget,Q.find("tr"));h(a)}function r(b){if(!b)return-1;b=b.split(a.CHAR_UNDERSCORE);return b[b.length-1]}function D(b){return{dimIndex:z.dimensionOrder,dimValueIndex:b?r(b.id):null,dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD}}
function k(a){E(Z.CLICK_VARIATION);ha||E(Z.SCROLL);ha=!0;V=null;var b=D(a.currentTarget),c=p(),d=e.reconstructCombinationWithDimValue(c,b.dimIndex,b.dimValueIndex);d!==c&&(R(),G(b,a.type,z.parentView?z.parentView.handleClick:y,z.twisterControllerHandle.handleClick,null));O&&O.getHandle()&&O.getHandle().hide();b={dimensionOrder:z.dimensionOrder,dimensionValueIndex:b.dimValueIndex,isSelectedDimValueAvailable:aa.dimToAsinMapData[d]?!0:!1};H(a.currentTarget).trigger("TwisterVODD.dimensionRowClick",b)}
function B(a){H(a.currentTarget).addClass("vodd-row-hovered");var b=D(a.currentTarget);G(b,a.type,z.parentView?z.parentView.handleMouseOver:y,z.twisterControllerHandle.handleMouseOver,null)}function N(a){H(a.currentTarget).removeClass("vodd-row-hovered");var b=D(a.currentTarget);G(b,a.type,z.parentView?z.parentView.handleMouseOut:y,z.twisterControllerHandle.handleMouseOut,r(a.currentTarget.id))}function G(a,b,c,d,e){c!==y?c.call(z.parentView,a,b):d.call(z.twisterControllerHandle,a,z.dimensionOrder,
e)}function P(a){a.find(".dimension-slots .availability-message").nextAll().remove()}function K(b,c){if(c)b.find(".unavailable-text").hide(),b.find(".vodd-loading-placeholder").show();else{b.find(".vodd-loading-placeholder").hide();b.find(".unavailableV2").removeClass("aok-hidden");c=p().split(a.CHAR_UNDERSCORE);var d=[],e=parseInt(z.dimensionOrder),h=r(b[0].id);c[e]=h;h=L(c,e);if(h=ea[h])for(var f=0;f<c.length;f++)e!==f&&ya[f]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&d.push(W[f][h[f]]);if(c=d.join(", "))b.find(".unavailable-text").show(),
b.find(".variation-combination-text").text(c);var g;a:{c=0;d=parseInt(z.dimensionOrder);e=parseInt(r(b[0].id));for(g in ea)if(parseInt(ea[g][d])===e&&1<++c){g=!0;break a}g=!1}g||b.find(".variation-more-text").hide()}P(b)}function I(b){Y.sort(function(c,d){c=r(c.id);d=r(d.id);if(b[c][a.STRING_STYLE]!==b[d][a.STRING_STYLE]){if(b[c][a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE)return 1;if(b[d][a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE)return-1}return c-d});Y.detach().appendTo(Q)}function L(b,
c){if(z.parentView){var d=String(b[c]),e=z.parentView.twisterCore;b=z.parentView.twisterCore.util;c=e.util.predictNextState(e.util.createSelectionInfo(e.state()),e.util.createSelectionInfo(e.util.getSelectionInfoFromDimIndexAndValue(c,d)));c=b.getAsinFromSelectionInfo(c.selectionInfo())}else c=z.twisterControllerHandle.twisterAvailabilityCache.gAsinToRender(b.join(a.CHAR_UNDERSCORE),c);return c}function M(a){var b=Q.find("tr").not(".aok-hidden");a=b.index(a);var c=b.length-ca;a>c?(a=c,0>a&&(a=0)):
a=0===a?a:a-1;b=b.slice(a,a+ca);h(b)}function R(){Y.unbind(a.EVENT_TYPE_CLICK,k);e.isTouchDevice()||Y.unbind(a.EVENT_TYPE_MOUSEENTER,B).unbind(a.EVENT_TYPE_MOUSELEAVE,N)}function U(b,c,d){var h=b;if(J()){var f=b.split(a.CHAR_UNDERSCORE);b=z.dimensionOrder;for(var f=f.slice(0),g=0;g<la.length;g++)b!==g&&la[b]<la[g]&&(f[g]="X",h=f.join("_"))}b=h;h=e.getDimStyleData(h,z.dimValuesDisplayData.length,z.dimensionOrder,z.twisterAvailabilityCache,z.displayConfigStylesData);I(h);var k=null;b=h.length;for(f=
0;f<h.length;f++){var g=h[f],l=Q.find(oa+f);if(g[a.STRING_STYLE]===a.CLASS_FOR_VODD_SELECT){if(k=l,l.addClass("vodd-row-selected"),z.dimensionValueHasIcon[f]?(ia.text(""),ma.attr("class","background-sprite "+z.dimValuesDisplayData[f].replace(/\s/g,""))):(ma.attr("class",""),ia.text(z.dimValuesDisplayData[f])),ba.length){var m=l.find("img.vodd-dimension-img");(m=0<m.length?m.attr("src"):null)&&ba.attr("src",m).show()}}else l.removeClass("vodd-row-selected");l.removeClass("vodd-row-hovered");1<z.dimensionsMap.length&&
K(l,g[a.STRING_STYLE]!==a.CLASS_FOR_VODD_UNAVAILABLE);J(d)&&(g[a.STRING_STYLE]===a.CLASS_FOR_VODD_UNAVAILABLE?(l.addClass("aok-hidden"),--b):l.removeClass("aok-hidden"))}J(d)&&(1>=b?(H(ja).addClass("aok-hidden"),H(na).removeClass("aok-hidden")):(H(na).addClass("aok-hidden"),H(ja).removeClass("aok-hidden")));c?u.on.load(function(){M(k)}):M(k)}function J(){var a=!1;za&&Aa!==parseInt(z.dimensionOrder)&&(a=!0);return a}var S=w.Twister,z=this,H=u.$,O,T,W,fa,X,qa=!0,ga,Y,Q,ba,ia,ma,ra,sa,ta,ja,na,ua,oa,
va,ca=0,xa="bottom",wa=!1,ka,ha=!1,V,pa,ya,ea,da,Z,aa=d[a.STRING_TWISTER_VARIATION_DATA],la,za,Aa;z.dimType=a.TWISTER_DIMENSION_VIEW_VODD;z.initialize=function(){z.twisterAvailabilityCache=d[a.STRING_TWISTER_AVAILABILITY_CACHE];z.dimensionOrder=d[a.STRING_DIM_ORDER];z.parentView=d[a.PRODUCTIZED_PARENT_VIEW];z.twisterJSInitData=c;z.viewUtil=d[a.PRODUCTIZED_VIEW_UTIL];z.displayConfigStylesData=d[a.STRING_DISPLAY_CONFIG_STYLES_DATA];z.dimSubType=d[a.DIMENSION_SUB_TYPE];z.dimensionValueHasIcon=d[a.DIMENSION_VALUE_HAS_ICON];
z.initialTwisterState=d[a.STRING_TWISTER_INITIAL_STATE_KEY];z.twisterControllerHandle=d[a.STRING_TWISTER_CONTROLLER_HANDLE];z.dimensionsMap=aa.dimensionsMap;z.dimensionName=z.dimensionsMap[z.dimensionOrder];z.dimValuesDisplayData=aa.dimensionValuesData[z.dimensionOrder];fa=z.dimensionsMap.length;W=aa.dimensionValuesData;pa=aa.dimToAsinMapData;da=new l("DPTwisterVODDView");Z=da.eventTypes;ya=aa.dimensionsDisplayType;ea=aa.asinToDimIndexMapData;X=H(".vodd-dim-wrapper").size();la=c.dimensionHierarchyData;
za=c.hierarchicalPivoting;Aa=c.topHierarchicalDimensionIndex;f();z.dimensionButton=H(ja);Q=H(ua);Y=Q.find("tr");ba=H(ta);ia=H(ra);ma=H(sa);da.logImpression(Z.DIM_INIT,{count:Math.ceil(z.dimensionsMap.length/ca),dimDisplayType:a.TWISTER_DIMENSION_VIEW_VODD});wa&&x.when("A","ready").execute(function(a){w.setTimeout(function(){t()},1E3)})};z.onInitializeTwister=function(){U(p(),!0,null);u.loadDescendantImagesManually(Q);A()};z.handlePopoverEvent=function(c,d){c===a.EVENT_TYPE_SHOWPOPOVER?(R(),Y.bind(a.EVENT_TYPE_CLICK,
k),e.isTouchDevice()||Y.bind(a.EVENT_TYPE_MOUSEENTER,B).bind(a.EVENT_TYPE_MOUSELEAVE,N),ha=!1,c=d.popover.$trigger,d={popover:d},c.addClass("highlighted"),c.trigger("TwisterVODD.showPopup",d),T||(ga=Q.closest(".a-popover-inner"),T=new b(200,ga,v)),d=Q.find("tr.vodd-row-selected"),ga&&ga.length&&d.length&&ga.scrollTop(d.get(0).offsetTop-33)):c===a.EVENT_TYPE_HIDEPOPOVER?(c=d.popover.$trigger,d={popover:d},ha||(E(Z.SCROLL),V=null),ha=!0,H(c).removeClass("highlighted"),c.trigger("TwisterVODD.hidePopup",
d)):c===a.EVENT_TYPE_UPDATEPOPOVERPOSITION&&d.popover.$trigger.trigger("TwisterVODD.updatePopupPosition",{popover:d})};z.updateView=function(b){b[a.STRING_EVENT_TYPE]===a.EVENT_TYPE_CLICK&&U(b[a.STRING_DIM_COMB_ID],!1,b[a.STRING_EVENT_DATA][a.STRING_EVENT_DIV_METADATA])};z.showVariationSelection=function(){e.isTouchDevice()||z.dimensionButton.trigger("click")}}t.registerDimensionSubView(a.TWISTER_DIMENSION_VIEW_VODD,d);return d});x.when("A","twister-utils","twister-string-constants").register("twister-beaconized-evdd",
function(u,e,a){return function(b,q){function n(){var a=p(x).height(),a={localContent:f,location:"bottom",showOnHover:!1,showCloseButton:!1,skin:null,clone:!1,controlCallbacks:!0,locationOffset:[-2,-(8+a)],closeEventInclude:"CLICK_OUTSIDE",forceAlignment:!0,group:"DonsBoxDropDowns",width:null};"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"evdd"}]});m=p(x).amazonPopoverTrigger(a);p(document).bind("touchend click",function(){F=
!1;m.amznPopoverHide()})}function l(a){F=!0;a=a.currentTarget.id.split("_");g.twisterControllerHandle.handleClick({dimIndex:g.dimOrder,dimValueIndex:a[a.length-1]});F&&(m.amznPopoverHide(),F=!1);return!1}function t(a){p(a.currentTarget).addClass("evdd-row-hovered")}function d(a){p(a.currentTarget).removeClass("evdd-row-hovered");return!1}function c(a){p(a.currentTarget).removeClass("evdd-row-hovered");l(a);return!1}var g=this,p=u.$,x,f,y,A,m,h={},F=!1;g.dimType="etdd";g.dimNameDisplayString;g.dimData;
g.dimensionsMap;g.dimNameDisplayString;g.dimValuesDisplayData;g.dimName;g.dimOrder;g.isMasterDim=!1;g.initialize=function(){var b;g.dimOrder=q[a.STRING_DIM_ORDER];g.dimName=q[a.STRING_DIM_NAME];g.dimensionsMap=q[a.STRING_DIMENSIONS_MAP];g.dimNameDisplayString=q[a.STRING_DIMENSION_DISPLAY_STRING];g.dimValuesDisplayData=q[a.STRING_DIMENSION_VALUES_DATA];g.displayConfigStylesData=q[a.STRING_DISPLAY_CONFIG_STYLES_DATA];g.twisterControllerHandle=q[a.STRING_TWISTER_CONTROLLER_HANDLE];g.initialTwisterState=
q[a.STRING_TWISTER_INITIAL_STATE_KEY];b=g.initialTwisterState.getCurrentDimCombID();g.dimData=e.getDimStyleData(b,g.dimValuesDisplayData.length,g.dimOrder,g.twisterControllerHandle.twisterAvailabilityCache,g.displayConfigStylesData);g.isMasterDim=!1;"0"===g.dimOrder&&(g.isMasterDim=!0);g.dimNameDisplayString=q[a.STRING_DIMENSION_DISPLAY_STRING];x="#evdd-button-"+g.dimName;f="#evdd-table-wrapper-"+g.dimName;y="#evdd-singleton-"+g.dimName;h.invalid=g.isMasterDim?"evdd-row-default":"evdd-row-hidden";
h.available="evdd-row-default";h.selected="evdd-row-selected";A="evdd-hidden evdd-row-hovered evdd-row-hidden evdd-row-default evdd-row-selected";n();for(var m=0,u=g.dimData.length;m<u;m++)b="#"+g.dimName+"_"+m,p(b).bind("click",l).bind("touchend",c).bind("touchstart",t).bind("mouseenter",t).bind("mouseleave",d)};g.updateView=function(a){var b=e.getDimStyleData(a.dimCombID,g.dimValuesDisplayData.length,g.dimOrder,g.twisterControllerHandle.twisterAvailabilityCache,g.displayConfigStylesData),c,d,f,
l;a=0;l="";m.amznPopoverHide();F=!1;for(var n=0,q=b.length;n<q;n++)c=b[n],d=h[c.style],f="#"+g.dimName+"_"+n,"evdd-row-selected"===d&&(l=n,l=g.dimValuesDisplayData[l]),"available"!==c.style&&"selected"!==c.style||a++,c=p(f),c.removeClass(A).addClass(d),c.find(".evdd-row-snake-wrapper").show(),c.find(".evdd-row-price-info-wrapper").html(""),c.find(".evdd-row-prime-badge-wrapper").html("");b=!1;g.isMasterDim||1!==a||(b=!0);a=b;p(x).find("button").text(l);p(y).text(l);a?(p(x).addClass("evdd-hidden"),
p(y).removeClass("evdd-hidden")):(p(y).addClass("evdd-hidden"),p(x).removeClass("evdd-hidden"))};g.updateViewWithPriceInfo=function(a){var b,c,d;for(b in a)c=a[b],d="#"+g.dimName+"_"+b,d=p(d),d.find(".evdd-row-snake-wrapper").hide(),d.find(".evdd-row-price-info-wrapper").html(c[2]),d.find(".evdd-row-prime-badge-wrapper").html(c[3])}}});x.when("A","twister-utils","twister-string-constants").register("twister-native-evdd",function(u,e,a){return function(b,q){function n(){var a=t(d).val(),a=parseInt(a.split(",")[0]);
l.twisterControllerHandle.handleClick({dimIndex:l.dimOrder,dimValueIndex:a})}var l=this,t=u.$,d;l.dimType="etdd";l.dimNameDisplayString;l.dimName;l.dimOrder;l.isMasterDim=!1;l.initialize=function(){l.dimOrder=q[a.STRING_DIM_ORDER];l.dimName=q[a.STRING_DIM_NAME];l.dimValuesDisplayData=q[a.STRING_DIMENSION_VALUES_DATA];l.isMasterDim=!1;"0"===l.dimOrder&&(l.isMasterDim=!0);l.dimNameDisplayString=q[a.STRING_DIMENSION_DISPLAY_STRING];l.displayConfigStylesData=q[a.STRING_DISPLAY_CONFIG_STYLES_DATA];l.twisterControllerHandle=
q[a.STRING_TWISTER_CONTROLLER_HANDLE];d="#evdd-select-"+l.dimName;"function"===typeof w.markFeatureInteractive&&w.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"etdd"}]});t(d).change(n)};l.updateView=function(a){a=e.getDimStyleData(a.dimCombID,l.dimValuesDisplayData.length,l.dimOrder,l.twisterControllerHandle.twisterAvailabilityCache,l.displayConfigStylesData);var b,n="",q;t(d).empty();for(var f=0,u=a.length;f<u;f++)if(b=a[f],b=b.style,"invalid"!==b||l.isMasterDim)b="selected"===
b?"selected":"",q="#native-"+l.dimName+"_"+f,b='\x3coption id\x3d"'+q+'" value\x3d"'+f+'," '+b+"\x3e"+l.dimValuesDisplayData[f]+"\x3c/option\x3e",n+=b;t(d).html(n)}}});x.when("A","twister-dimension-view-promise-factory","twister-string-constants","3p-promise","twister-dimension-subview-promise-handler").register("twister-view",function(u,e,a,b,q){return function(n,l,t,d,c){function g(a){for(var b,c=[],d=0,g=f.dimensionsMap.length;d<g;d++)b=e.getDimensionSubViewPromise(f.twisterJSInitData,f.twisterVariationsData,
d.toString(10),f.twisterControllerHandle,a),c.push(b);return c}function p(b){var c=q.getDimensionSubViewPromise("page-refresh-view");u.each(b,function(a,b){a.initialize();f.dimensionViewHandlersMap[b]=a});c.then(function(a){u.each(b,function(a,b){a.removePageLayoutUrls!==y&&a.removePageLayoutUrls()});x("#twisterNonJsData").html("")});x(a.CLASS_FOR_NON_JS_EVDD).hide();x(a.CLASS_FOR_NEW_TWISTER_EVDD).show();f.updateView({},f.twisterControllerHandle.initTwisterState,a.EVENT_TYPE_CLICK);f.onInitializeTwister()}
function w(b,c,d,e,f){var g={},l={};g[a.STRING_EVENT_TYPE]=b;g[a.STRING_DIM_COMB_ID]=c;l[a.STRING_EVENT_DIV_METADATA]=d;l[a.STRING_EVENT_DIM_INFO]=e;l[a.STRING_DIMENSION_SELECTION_DATA]=f;g[a.STRING_EVENT_DATA]=l;return g}var f=this,x=u.$;f.twisterControllerHandle=n;f.twisterJSInitData=t;f.twisterVariationsData=d;f.twisterAvailabilityCache=c;f.dimensionsMap={};f.dimensionDisplayMap={};f.dimensionDisplayTypeMap={};f.dimensionViewHandlersMap={};f.isAllViewsInitializedPromise=null;f.updateView=function(b,
c,d){var e={},g,l=c.dimensionSelectionData;d===a.EVENT_TYPE_MOUSEOVER?(g=c.hoveredAsin,c=c.hoveredDimCombID):(g=c.getCurrentASIN(),c=c.getCurrentDimCombID());e[a.STRING_DIMENSION_VALUES_DATA]=f.twisterVariationsData.getDimensionValuesDisplayData(g);e[a.STRING_DIMENSION_DISPLAY_MAP]=f.dimensionDisplayMap;e[a.STRING_DIMENSIONS_MAP]=f.dimensionsMap;b=w(d,c,b,e,l);d=0;for(e=f.dimensionsMap.length;d<e;d++)f.dimensionViewHandlersMap[d].updateView(b)};f.updateViewAfterTwisterUpdate=function(b,c,d){var e=
{},g=c.dimensionSelectionData;c.getCurrentASIN();c=c.getCurrentDimCombID();e[a.STRING_DIMENSION_DISPLAY_MAP]=f.dimensionDisplayMap;e[a.STRING_DIMENSIONS_MAP]=f.dimensionsMap;b=w(d,c,b,e,g);if(d===a.EVENT_TYPE_DROPDOWN_CHANGE||d===a.EVENT_TYPE_CLICK)for(d=0,e=f.dimensionsMap.length;d<e;d++)f.dimensionViewHandlersMap[d].updateViewAfterTwisterUpdate&&f.dimensionViewHandlersMap[d].updateViewAfterTwisterUpdate(b)};f.onInitializeTwister=function(){"undefined"!==typeof f.dimensionViewHandlersMap&&f.dimensionViewHandlersMap&&
x.each(f.dimensionViewHandlersMap,function(a,b){if("function"===typeof b.onInitializeTwister)b.onInitializeTwister()})};f.isAllViewsInitialized=function(){return f.isAllViewsInitializedPromise};f.isAllViewsInitializedPromise=function(c){for(var d=f.twisterJSInitData,e=d[a.INIT_DATA_DIMENSIONS_MAP].length,l=[],n=[],q=[],t=0,k=0;k<e;k++)d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]&&d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][k]!==a.HIDDEN_DIMENSION_DISPLAY_TYPE&&(l[t]=d[a.INIT_DATA_DIMENSIONS_MAP][k],
n[t]=d[a.INIT_DATA_DIMENSIONS_DISPLAY][k],q[t]=d[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][k],t++);f.dimensionsMap=l;f.dimensionDisplayMap=n;f.dimensionDisplayTypeMap=q;var u=g(c);return new b(function(a){b.all(u).then(function(b){p(b);a()})})}(l)}});x.when("A","twister-string-constants").register("migrated-views",function(u,e){var a=[e.TWISTER_DIMENSION_VIEW_VODD,e.TWISTER_DIMENSION_VIEW_SWATCH,e.TWISTER_DIMENSION_VIEW_DROPDOWN,e.TWISTER_DIMENSION_VIEW_SHELF,e.TWISTER_DIMENSION_VIEW_COUNTER];u.$(".luxury-subnav, [class^\x3d'_luxury-subnav-desktop']").length&&
a.push(e.TWISTER_DIMENSION_VIEW_SINGLETON);return{getMigratedViews:function(){return a}}});x.when("A","twister-dimension-view-promise-factory","twister-string-constants","view-util","twister-utils","dp-js-logger","3p-promise","twister-dimension-subview-promise-handler").register("parent-view",function(u,e,a,b,q,n,l,t){return function(d,c,g,p,w){function f(){for(var b,c=0,d=[],f=0,g=w.tvm.dimensionList.length;f<g;f++)v.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP]&&v.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][f]!==
a.HIDDEN_DIMENSION_DISPLAY_TYPE&&(v.dimensionDisplayTypeMap[f]=v.twisterJSInitData[a.INIT_DATA_DIMENSIONS_DISPLAY_TYPE_MAP][f],v.dimensionsMap[f]=v.twisterJSInitData[a.INIT_DATA_DIMENSIONS_MAP][f],b=e.getDimensionSubViewPromise(v.twisterJSInitData,v.twisterVariationsData,f.toString(10),v.twisterControllerHandle,y,v),d.push(b),v.dimensionSubViewIndexMap[c++]=f);return d}function x(b){var c=t.getDimensionSubViewPromise("page-refresh-view");u.each(b,function(a,b){a.initialize();v.dimensionViewHandlersMap[v.dimensionSubViewIndexMap[b]]=
a});c.then(function(a){u.each(b,function(a,b){a.removePageLayoutUrls!==y&&a.removePageLayoutUrls()});r("#twisterNonJsData").html("")});r(a.CLASS_FOR_NON_JS_EVDD).hide();r(a.CLASS_FOR_NEW_TWISTER_EVDD).show();A();v.updateView(a.EVENT_TYPE_CLICK);v.onInitializeTwister()}function A(){var a=m();v.twister=w.registerActive({viewAttribution:"DetailPage",viewName:"TwisterDesktopView"},a)}function m(){return{updateView:function(b,c){switch(b){case a.VARIATION_CHANGE:b=c.selected();c=v.viewUtil.getDimensionValuesData(b.selInfo,
v.twisterJSInitData);v.updateView(v.eventType,v.divMetaData,c);v.eventType!==a.EVENT_TYPE_DROPDOWN_CHANGE&&v.eventType!==a.EVENT_TYPE_CLICK||v.updateViewAfterTwisterUpdate(v.divMetaData,v.eventType,c);break;case a.VARIATION_PEEK:b=c.peek(),c=v.viewUtil.getDimensionValuesData(b.selInfo,v.twisterJSInitData),v.updateView(v.eventType,v.divMetaData,c,b.selInfo)}}}}function h(){return{divMetadata:v.divMetaData,eventType:v.eventType,subType:a.DP_STATE_VIEW_SUBTYPE,dimensionsMap:v.dimensionsMap,currDimCombId:v.viewUtil.getCurrDimCombId(w.state(),
a.CHAR_UNDERSCORE)}}function F(b,c,d,e){var f=w.state(),g={},h={};d={dimensionDisplayMap:v.viewUtil.getDimDisplayMap(),dimensionsMap:v.dimensionsMap,dimensionValuesData:d?d:v.viewUtil.getDimensionValuesData(f,v.twisterJSInitData)};g[a.STRING_DIM_COMB_ID]=v.viewUtil.getCurrDimCombId(b===a.EVENT_TYPE_MOUSEENTER&&e?e:f,a.CHAR_UNDERSCORE,a.CHAR_CROSS);g[a.STRING_EVENT_TYPE]=b;h[a.STRING_EVENT_DIV_METADATA]=c;h[a.STRING_EVENT_DIM_INFO]=d;h[a.STRING_DIMENSION_SELECTION_DATA]=v.viewUtil.getDimensionSelectionData(w.util.dimensionMetaData,
f);g[a.STRING_EVENT_DATA]=h;return g}var v=this,r=u.$;v.twisterControllerHandle=d;v.twisterJSInitData=c;v.twisterVariationsData=g;v.twisterAvailabilityCache=p;v.viewUtil=new b(w);v.deletedLandingAsinInfo=c[a.INIT_DATA_DELETED_LANDING_ASIN_INFO];v.dimensionsMap=[];v.dimensionDisplayTypeMap={};v.dimensionViewHandlersMap={};v.dimensionSubViewIndexMap={};v.divMetaData={};v.eventType="";v.twisterCore=w;v.enableMouseOut;v.isAllViewsInitializedPromise=null;v.logger=new n("dpTwister",this,!0);v.handleClick=
function(a,b){v.viewUtil.initializeTwisterInteractionStartTime();var c=w.state();v.divMetaData=a;v.eventType=b;if(v.viewUtil.isAlreadySelected(c,a))return!1;b=v.viewUtil.getTwisterState(a);v.twister.metaData(h());v.twister.dimensionChanged(b);v.logger.logImpression(v.logger.eventTypes.CLICK,{divMetaData:a});return b};v.getCurrDimCombId=function(){return v.viewUtil.getCurrDimCombId(w.state(),a.CHAR_UNDERSCORE)};v.handleDropdownChange=function(a,b,c){v.handleClick(a,c)};v.handleMouseOver=function(b,
c){if(q.isTouchOnlyDevice())return v.handleClick(b,a.EVENT_TYPE_CLICK),!0;v.divMetaData=b;v.eventType=c;c=w.state();v.enableMouseOut=1;if(v.viewUtil.isAlreadySelected(c,b))return!1;c=v.viewUtil.getTwisterState(b);v.twister.metaData(h());v.twister.dimensionPeek(c);v.logger.logImpression(v.logger.eventTypes.HOVER,{divMetaData:b});return c};v.handleMouseOut=function(a,b){v.divMetaData=a;v.eventType=b;a=v.viewUtil.getTwisterState(a);return 1===v.enableMouseOut?(v.enableMouseOut=0,v.twister.metaData(h()),
v.twister.dimensionPeek(w.state()),a):!1};v.updateView=function(a,b,c,d){a=F(a,b,c,d);b=0;for(c=v.dimensionsMap.length;b<c;b++)v.dimensionViewHandlersMap[b].updateView(a);return a};v.updateViewAfterTwisterUpdate=function(b,c,d){b=F(c,b,d);if(c===a.EVENT_TYPE_DROPDOWN_CHANGE||c===a.EVENT_TYPE_CLICK)for(c=0,d=v.dimensionsMap.length;c<d;c++)"function"===typeof v.dimensionViewHandlersMap[c].updateViewAfterTwisterUpdate&&v.dimensionViewHandlersMap[c].updateViewAfterTwisterUpdate(b);return b};v.onInitializeTwister=
function(){"undefined"!==typeof v.dimensionViewHandlersMap&&v.dimensionViewHandlersMap&&r.each(v.dimensionViewHandlersMap,function(a,b){if("function"===typeof b.onInitializeTwister)b.onInitializeTwister()})};v.isAllViewsInitialized=function(){return v.isAllViewsInitializedPromise};v.isAllViewsInitializedPromise=function(){var a=f();return new l(function(b){l.all(a).then(function(a){x(a);b()})})}()}});x.when("A","twister-string-constants","detail-page-state-controller","view-util","twister-utils",
"dp-js-logger").register("detail-page-state-controller-view",function(u,e,a,b,q,n){return function(a,n){function d(){return{updateView:function(b,d){var u=n.util,r;switch(b){case e.METADATA:d.subType===e.DP_STATE_VIEW_SUBTYPE&&(f=d.divMetadata,y=d.dimensionsMap,A=d.currDimCombId);break;case e.VARIATION_CHANGE:d=d.selected();b=u.isFullySelected(d);u=u.getAsinFromSelectionInfo(d.selInfo,b);r=m.getDimensionValuesDisplayData(u,a);b=m.getCurrDimCombId(d.selInfo,e.CHAR_UNDERSCORE,e.CHAR_CROSS);var x=n.util;
if(p.eventType===e.EVENT_TYPE_CLICK||p.eventType===e.EVENT_TYPE_DROPDOWN_CHANGE){for(var k=m.getCurrDimCombId(d.selInfo),B={},C=0,G=y.length;C<G;C++)"1"===x.isRequiredDim(y[C])&&f.dimIndex===C&&"*"===k[C]?B[y[C]]="-1":B[y[C]]=k[C];g.StateController.setState("selected_variation_values",B)}c("selected",r,d.selInfo);c("hovered",r,d.selInfo);g.StateController.setState("current_asin",u);g.StateController.setState("currentDimCombID",b);g.StateController.setState("reactId",b);g.StateController.setState("dimensionSelectionData",
m.getDimensionSelectionData(n.util.dimensionMetaData,d.selInfo));r=f[e.STRING_DIM_INDEX];d=q.getAttachedClass(f,m.getDimNameByOrder(r));d="undefined"!==typeof d&&(-1!==d.indexOf(e.CLASS_FOR_SWATCH_UNAVAILABLE)||-1!==d.indexOf(e.CLASS_FOR_DROPDOWN_UNAVAILABLE));k=b.split(e.CHAR_UNDERSCORE);x=A.split(e.CHAR_UNDERSCORE);k[r]=e.CHAR_ASTERISK;x[r]=e.CHAR_ASTERISK;r=k.join(e.CHAR_UNDERSCORE);x=x.join(e.CHAR_UNDERSCORE);r!==x&&(d=!0);g.StateController.setState("isUnavailableInOldDimCombId",d?"true":"false");
w.twisterController&&w.twisterController.twisterModel&&w.twisterController.twisterModel.twisterState&&(d=w.twisterController.twisterModel.twisterState,d.currentDimCombID=b,d.currentASIN=u);break;case e.VARIATION_PEEK:d=d.peek(),b=u.isFullySelected(d),u=u.getAsinFromSelectionInfo(d.selInfo,b),r=m.getDimensionValuesDisplayData(u,a),a.useMS&&(!f||f.dimDisplayType!==e.TWISTER_DIMENSION_VIEW_VODD&&f.dimDisplayType!==e.TWISTER_DIMENSION_VIEW_SHELF&&f.dimDisplayType!==e.TWISTER_DIMENSION_VIEW_COUNTER)||
c("hovered",r,d.selInfo),g.StateController.setState("hovered_asin",u)}}}}function c(b,c,d){var f={};x.each(c,function(b,c){m.isDimensionSelected(b,d)&&"(Please Select)"===c&&(c=null);f[a[e.INIT_DATA_DIMENSIONS_MAP][b]]=c});g.StateController.setState(b+"_variations",f)}var g=w.DetailPage,p=this,x=u.$,f={},y={},A="",m=new b(n);(function(){var a=d();p.twister=n.registerActive({viewAttribution:"DetailPage",viewName:"DPStateControllerView"},a)})()}});x.when("A","twister-string-constants","twister-dimension-view-promise-factory",
"twister-native-evdd","twister-beaconized-evdd").register("twister-evdd",function(u,e,a,b,q){u=u.$;if(u("html").hasClass("a-lt-ie8"))return a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_EVDD,b),b;a.registerDimensionSubView(e.TWISTER_DIMENSION_VIEW_EVDD,q);return q})});
/* ******** */
(function(l){var c=window.AmazonUIPageJS||window.P,m=c._namespace||c.attributeErrors,e=m?m("PageRefreshAsset",""):c;e.guardFatal?e.guardFatal(l)(e,window):e.execute(function(){l(e,window)})})(function(l,c,m){l.when("A","page-refresh-state","web-ajax-utility","alt-page-refresh-measurement","dp-interactive-page-refresh-handler","dp-click-to-ci-utils").register("page-refresh-handler",function(e,f,h,b,d,a){var g={},k=e.$,p=m,n="",r=function(b,g){var c=this;c.clientId=b;c.persistentParams={};c.pageRefreshUrlParams=
"";c.deviceType="";c.doPageRefresh=function(g,c,k,f,l,m){g=r(g,c);d.createInteractivityObjectForTwisterUpdate();var q;q=h.getInstance(b,g,{success:function(){var b=arguments[arguments.length-1];b&&!b.isResponseFromCache?p&&n&&(b=q.xhr.http.getResponseHeader("x-amz-rid"),p.setRequestId(n,b),n=""):a.logCounter("CachedTwisterMetric-Desktop");k.success.apply(null,arguments);e.trigger("PageRefresh:Success")},chunk:k.chunk,failure:k.failure,error:k.error,abort:k.abort},f);"function"===typeof l&&l.call(null,
{isNewRequest:0===q.status});q.getContent();"function"===typeof m&&m.call(null)};c.addParams=function(a){c.persistentParams=k.extend(!0,c.persistentParams,a);return!0};c.removeParams=function(a){e.each(a,function(a,b){delete c.persistentParams[a]});return!0};c.createCustomParamsMap=function(a,b){var g={Persistent:{},"Non-Persistent":{}};k.each(a,function(a,b){g.Persistent[a]=b});k.each(b,function(a,b){g["Non-Persistent"][a]=b});return g};c.startMeasurement=function(a,b,g,c,k,d){n=a;p&&p.start(a,b,
g,c,k,d)};c.stampImageLoad=function(a){p&&p.stampImageLoad(a)};c.stampFeature=function(a,b){p&&p.stampFeature(a,b)};var r=function(a,b){c.persistentParams=k.extend(!0,c.persistentParams,b.Persistent);var n={};k.extend(!0,n,c.persistentParams,b["Non-Persistent"]);b=g;var d=e.contains(b,"?");b=b+(d?"\x26":"?")+((a?"asin\x3d"+a:"")+(c.pageRefreshUrlParams?c.pageRefreshUrlParams:""));for(var f in n)null!=n[f]&&(a=n[f],d=b.slice(-1),b+="?"===d||"\x26"===d?"":"\x26",b+=f+"\x3d"+a);return b};(function(){var a=
f.pageRefreshData;c.pageRefreshUrlParams=a.pageRefreshUrlParams;c.deviceType=a.deviceType})()};return{getHandlerInstance:function(a,d,e){(null==a||""===a)&&c.ueLogError&&c.ueLogError({message:"Invalid ClientId"},{logLevel:"FATAL",attribution:"PageRefreshAPI",message:"Invalid ClientId passed to getHandlerInstance of dpRefreshHandler"});g[a]||(g[a]=new r(a,d));!p&&e&&(d=e.config,p=new b(k,d.atf.marker,d.cf.marker),p.setStoreId(n,e.storeID));return g[a]}}});"use strict";l.when("A","page-refresh-handler").register("dp-refresh-handler",
function(e,f){function h(b,c,a){this.featureTriggeringRefresh=b.featureName;this.deviceType=(this.deviceTypeStateData=e.state("detail-page-device-type"))&&this.deviceTypeStateData.deviceType?this.deviceTypeStateData.deviceType:"web";this.pageRefreshUrl=c&&c.pageRefreshUrl?c.pageRefreshUrl:"/gp/twister/ajaxv2";this.clientId="PageRefresh_"+this.deviceType+"_Client";this.DPRefreshHandler=f.getHandlerInstance(this.clientId,this.pageRefreshUrl,a)}h.prototype={doPageRefresh:function(b,d,a,g,k,e){try{this.DPRefreshHandler.doPageRefresh(b,
d,a,g,k,e)}catch(n){c.ueLogError&&c.ueLogError(n,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the doPageRefresh method triggered by - "+this.featureTriggeringRefresh})}},createCustomParamsMap:function(b,d){var a={};try{a=this.DPRefreshHandler.createCustomParamsMap(b,d)}catch(g){c.ueLogError&&c.ueLogError(g,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the createCustompParamsMap method triggered by - "+this.featureTriggeringRefresh})}return a},
addParams:function(b){return b&&"object"==typeof b?this.DPRefreshHandler.addParams(b):!1},removeParams:function(b){return b&&"object"==typeof b?this.DPRefreshHandler.removeParams(b):!1},startMeasurement:function(b,d,a,g,k,e){try{this.DPRefreshHandler.startMeasurement(b,d,a,g,k,e)}catch(n){c.ueLogError&&c.ueLogError(n,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}},stampImageLoad:function(b){try{this.DPRefreshHandler.stampImageLoad(b)}catch(d){c.ueLogError&&
c.ueLogError(d,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}},stampFeature:function(b,d){try{this.DPRefreshHandler.stampFeature(b,d)}catch(a){c.ueLogError&&c.ueLogError(a,{logLevel:"ERROR",attribution:this.featureTriggeringRefresh,message:"This error is caused by the startMeasurement method triggered by - "+this.featureTriggeringRefresh})}}};return h});l.when("A","jQuery","dp-interactive-page-refresh-handler",
"dp-click-to-ci-utils").register("alt-page-refresh-ajax-scope",function(e,f,h,b){return function(d,a,g,k){this.scopeName=a;this.customPageTypeId=g;this.customTags=k;this.storeId="";this.CFmarked=this.requestIdAvailable=!1;ues("t0",a,c.newTwisterInteractionStartTime);ues("ctb",a,"1");this.signalMarker=function(a){!this.markers[a]||0>=this.markers[a].conditions||0===--this.markers[a].conditions&&"function"==typeof this.markers[a].handler&&this.markers[a].handler()};this.addlongPoleTag=function(a,b){a=
a.toLowerCase();this.markers[a]&&0==this.markers[a].conditions&&0==this.markers[a].conditions&&c.ue&&"function"===typeof ue.tag&&ue.tag(b)};this.markClickToCI=function(){var a=this,g=h.getClickToCIMetric();g&&g.then(function(g){uet("fn",a.scopeName,m,g.interactiveTime);a.requestIdAvailable&&uex("ld",lScopeName);b.logCounter("TTISuccessCountForTwisterUpdate")}).catch(function(a){b.logCounter("TTIFailureCountForTwisterUpdate")})};this.setStoreId=function(a){a&&(this.storeId=a)};this.setRequestId=function(a){a&&
(this.CFmarked=this.requestIdAvailable=!0,this.postData(a))};this.postData=function(a){var b=this.scopeName,g=this.customPageTypeId,k=this.customTags;c.ue&&ue.tag&&(c.ue_pty&&ue.tag(c.ue_pty),c.ue_spty&&ue.tag(c.ue_spty),ue.tag(c.ue_spty),ue.tag("main"),ue.tag(this.storeID),ue.tag("clientOnly"));if(this.requestIdAvailable&&this.CFmarked){ues("id",b,a);var d;g!==m&&(d=c.ue_pti,c.ue_pti=g);if(k!==m)for(a=0;a<k.length;a++)ue.tag(k[a]);uex("ld",b);g!==m&&(c.ue_pti=d)}};var f=this;this.markers={image:{conditions:1,
handler:function(){uet("ne",a);f.signalMarker("af")}},af:{conditions:Twister.atfMarkerCount?Twister.atfMarkerCount:2,handler:function(){e.trigger("PageRefresh:ATF");uet("af",a);uet("cf",a);f.signalMarker("cf");h.updateCriticalFeatures();f.markClickToCI()}},cf:{conditions:Twister.cfMarkerCount?Twister.cfMarkerCount:2,handler:function(){e.trigger("PageRefresh:CF");uet("cf",a);this.CFmarked=!0;f.postData()}}}}});l.when("A","jQuery","alt-page-refresh-ajax-scope").register("alt-page-refresh-measurement",
function(e,f,h){return function(b,d,a){this.atfMarker=d;this.cfMarker=a;this.scopeCount={};this.ajaxScopes={};this.start=function(a,k,d,e,f,l){c.ue&&(this.scopeCount[a]||(this.scopeCount[a]=0),k=a+(this.scopeCount[a]+1),this.scopeCount[a]++,this.ajaxScopes[a]=new h(b,k,f,l))};this.setRequestId=function(a,b){this.ajaxScopes[a]&&this.ajaxScopes[a].setRequestId(b)};this.setStoreId=function(a,b){this.ajaxScopes[a]&&this.ajaxScopes[a].setStoreId(requestId)};this.stampImageLoad=function(a){this.ajaxScopes[a]&&
(this.ajaxScopes[a].signalMarker("image"),Twister.cfImageLongPollTag&&this.ajaxScopes[a].addlongPoleTag("cf",Twister.cfImageLongPollTag))};this.stampFeature=function(a,b){this.ajaxScopes[b]?(a===this.atfMarker&&this.ajaxScopes[b].signalMarker("af"),a===this.cfMarker&&(this.ajaxScopes[b].signalMarker("cf"),Twister.cfHtmlLongPollTag&&this.ajaxScopes[b].addlongPoleTag("cf",Twister.cfHtmlLongPollTag))):a===this.cfMarker&&e.trigger("PageRefresh:AjaxCallCompletedButCFMarkingNotDone")};this.stampCustomMetrics=
function(a,b){this.ajaxScopes[b]&&uet(a,this.ajaxScopes[b].scopeName)}}});l.when("A","ready").register("page-refresh-state",function(c){var f=c.state("page-refresh-data");c=c.state("detail-page-device-type");var h={};"undefined"!==typeof f&&(h.pageRefreshUrlParams=f.pageRefreshUrlParams);"undefined"!==typeof c&&(h.deviceType=c.deviceType);return{pageRefreshData:h}});l.when("A","jQuery","dp-js-logger").register("web-ajax-utility",function(e,f,h){function b(a,b,c,d){this.scope=a;this.url=b;this.options=
c;this.status=0;this.selected=!1;this.error=this.successData=this.xhr=this._status=m;this.chunks=[];this.doNotAbort=d||!1}var d=new h("WebAjaxUtility");b._objects={};b.prototype._callback=function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);"function"===typeof a&&a.apply(self,b)};b.prototype._canAbort=function(){return!this.doNotAbort&&1===this.status};b.prototype._isAborted=function(){return 3===this.status};b.prototype._getUrl=function(){return this.url};b.prototype._abort=function(){if(1===
this.status)try{this.ajaxRequestRefence.abort(),this.status=3}catch(a){d.logFatal(a,{message:" Could not abort ajax request."})}};b.prototype._flushChunkData=function(){var a=this;a.chunks.length&&f.map(a.chunks,function(b){a._callback(a.options.chunk,b)})};b.prototype._request=function(){var a=this,b=c.performance&&performance.now,d=m,f=m;b&&(d=performance.now());a.ajaxRequestRefence=e.get(a.url,{params:a.options.params,success:function(h,l,m){a.status=4;b&&(f=performance.now());a.successData=h;
a._status=l;a.xhr=m;a.selected&&a._callback(a.options.success,h,l,m,{isResponseFromCache:!1});e.trigger("TwisterRefresh:Success");c.ue&&ue.count&&d&&f&&ue.count("TwisterApiCall",f-d)},error:function(b,c,d){a.status=2;a.xhr=b;a._status=c;a.error=d;a.selected&&a._callback(a.options.error,b,c,d)},abort:function(b){a.status=3;a.xhr=b;a.selected&&a._callback(a.options.abort,b)},chunk:function(b){b&&(a.chunks.push(b),a.selected&&a._callback(a.options.chunk,b))},timeout:a.options.timeout||4E4})};b.prototype.getContent=
function(){b._abortRequestsExcept(this);this.selected=!0;0===this.status?(this.status=1,this._request()):1===this.status?this._flushChunkData():4===this.status&&(this._flushChunkData(),this._callback(this.options.success,this.successData,this._status,this.xhr,{isResponseFromCache:!0}),e.trigger("a:pageUpdate"),e.trigger("TwisterRefresh:Success"))};b._abortRequestsExcept=function(a){f.each(b._objects[a.scope],function(b,c){c._canAbort()&&b!==a._getUrl()&&c._abort()})};b.getInstance=function(a,c,d,
f){if(!a||!c||"object"!==typeof d)throw"Incorrect parameter passed.";b._objects[a]=b._objects[a]||{};var e=b._objects[a][c];e&&e._isAborted()&&(delete b._objects[a][c],e=m);e||(b._objects[a][c]=new b(a,c,d,f,this));return b._objects[a][c]};return b});l.when("A").register("state-aware-critical-features",function(c){return function(){var c=[];this.add=function(e,b){for(var d=e.featureName,a=!1,g=0;g<c.length;g++)if(c[g].featureName===d){a=!0;break}if(a)throw"Critical Feature "+e.featureName+" already registered for State Aware Messaging!";
e={};e.featureName=d;e.callback=b;c.push(e)};this.getAllCriticalFeatures=function(){return c}}});l.when("A","state-aware-parameter-handler").register("state-aware-feature-consolidator",function(c,f){return{getStateAwareParameters:function(){return f.getStateAwareParameters()}}});l.when("A","state-aware-critical-features","state-aware-parameters").register("state-aware-parameter-handler",function(e,f,h){return new function(){var b=new f,d=new h;this.registerCriticalFeature=function(a,d){try{if("function"===
typeof d)b.add(a,d);else throw"callback needs to be a function!";}catch(e){c.ueLogError&&c.ueLogError(e,{logLevel:"ERROR",attribution:a.featureName,message:"StateAwareExceptionMessaging:- This error is caused by the feature "+a.featureName+" while registering itself as a critical feature for State Aware Messaging. "+e})}};this.getStateAwareParameters=function(){for(var a=b.getAllCriticalFeatures(),e=0;e<a.length;e++){var f=a[e],h=f.featureName,f=f.callback.apply();try{d.putParameters(h,f)}catch(l){c.ueLogError&&
c.ueLogError(l,{logLevel:"ERROR",attribution:h,message:"StateAwareMessaging:- This error is caused by the feature "+h+" while injecting state aware parameters. "+l})}}return d.getAllStateAwareParameters()}}});l.when("A").register("state-aware-parameters",function(){return function(){var c={};this.putParameters=function(f,h){var b=!0;for(feature in c)if(c.hasOwnProperty(feature)&&f!==feature){var d=this.getParameters(feature);if(b){var b=h,a=!1;for(paramKey in b)if(b.hasOwnProperty(paramKey)&&d.hasOwnProperty(paramKey)){a=
!0;break}b=!a}}if(b)for(paramKey in h)h.hasOwnProperty(paramKey)&&(d=h[paramKey],c[f]||(c[f]={}),c[f][paramKey]=d);else throw"Duplicate Parameters found for other Critical Feature!";};this.getParameters=function(f){return c[f]};this.getAllStateAwareParameters=function(){var f={},h;for(h in c)if(c.hasOwnProperty(h)){var b=this.getParameters(h),d;for(d in b)b.hasOwnProperty(d)&&(f[d]=b[d])}return f}}});l.when("A").register("page-refresh-utils",function(e){var f=e.$,h={intermediateEOS:1,EOS:1};return{fadeInFeatures:function(b){f.each(b,
function(a,c){"#"!==c[0]&&(b[a]="#"+c)});var c=b.join(",");f(c).addClass("js-feature-refresh-overlay").css("opacity",.5)},refreshFeature:function(b){var d=b.Value;b=b.FeatureName;if(!h[b]){var a,e;try{b&&d&&d.content&&(e=d.content[b],"undefined"!==typeof e&&(a=f("#"+b),a.html(e),a.removeClass("js-feature-refresh-overlay"),a.css("opacity","")))}catch(k){d={message:"Error in feature"+(b||"NoFeatureName"),logLevel:"FATAL"},c.ueLogError&&c.ueLogError(k,d)}}},removeOverlayForAllFeatures:function(b){b=
f("body").find(".js-feature-refresh-overlay");for(var c=0;c<b.length;c++)f(b[c]).removeClass("js-feature-refresh-overlay").css("opacity","")}}})});
/* ******** */
