(function(A){var C=window.AmazonUIPageJS||window.P,F=C._namespace||C.attributeErrors,c=F?F("DPTwisterPlusDesktopConfiguratorAssets",""):C;c.guardFatal?c.guardFatal(A)(c,window):c.execute(function(){A(c,window)})})(function(A,C,F){A.when("A","desktop-configurator-view","desktop-configurator-widgets-factory","desktop-configurator-slot-manager","twister-dynamic-style","desktop-configurator-logger","desktop-configurator-dimension-handler","desktop-configurator-side-sheet-view","desktop-configurator-popover-factory",
"twister-js-init-dpx-data","twister-plus-desktop-configurator-mark-render").register("desktop-configurator-view-initialiser",function(c,g,l,n,f,q,v,x,y,p){var t=p?p.inlineTwisterData||{}:{};t.inlineTwisterEnabled&&(q=new q,new g(p,l.Row,n,f,q,v,x,y),!t.shouldDelayRegistrationWithTwisterCore&&c.trigger("desktop-configurator-view-initialized"))});"use strict";A.when("A").register("desktop-configurator-dimension-handler",function(c){function g(c){this.numberOfDimensionsExpandedOnLanding=c.numberOfDimensionsExpanded||
0;this.expandAllDimensions=-1===this.numberOfDimensionsExpandedOnLanding;this.dimensionKeyRowMap={};this.expandedDimensionList=[];this.maxNumberOfDimensionsExpanded=c.maxNumberOfDimensionsExpanded||1}g.prototype={registerDimension:function(c,g){this.dimensionKeyRowMap[c]=g;(this.expandAllDimensions||this.expandedDimensionList.length<this.numberOfDimensionsExpandedOnLanding)&&this.expandedDimensionList.push(c)},init:function(){-1===this.maxNumberOfDimensionsExpanded&&(this.maxNumberOfDimensionsExpanded=
Object.keys(this.dimensionKeyRowMap).length)},expandDimension:function(c){-1===this.expandedDimensionList.indexOf(c)&&this.expandedDimensionList.push(c);if(this.maxNumberOfDimensionsExpanded<this.expandedDimensionList.length)for(var g=0;g<this.expandedDimensionList.length&&(this.expandedDimensionList[g]!==c&&this.dimensionKeyRowMap[this.expandedDimensionList[g]].collapse(),this.maxNumberOfDimensionsExpanded!==this.expandedDimensionList.length);g++);},collapseDimension:function(c){c=this.expandedDimensionList.indexOf(c);
-1!==c&&this.expandedDimensionList.splice(c,1)}};return g});"use strict";A.when("A","desktop-configurator-constants","3p-promise").register("desktop-configurator-view",function(c,g,l){var n=c.$;return function(f,q,v,x,y,p,t,B){function u(){"function"===typeof C.markFeatureInteractive&&C.markFeatureInteractive("twister",{hasComponents:!0,components:[{name:"twister-desktopConfigurator"}]})}function a(){if(!D)return 0===f.unselectedDimCount;var b=r();return!!D.util.getAsinFromSelectionInfo(b)}function d(b,
a,d,e,k,c,m,u,r,f,w,z){return{text:b,image:a||"",popoverImage:d||"",name:e,id:w+"_"+e,selected:k,slotHtm:c,showSlot:m,isVisible:u,unavailable:r,defaultSlotUnavailable:V,isCirclularImageSwatch:h.inlineTwisterData&&"CIRCLE"===h.inlineTwisterData.swatchShape,asin:f,pageUrl:z}}function e(b){W[b]||null===H[b]||(b=h.rows[b],b.toggleSwatch&&b.toggleSwatch.removeMisplacedSwatch())}function m(b,a){var d=N.unselectedDimensionPrompt||"",e=f&&f.variationDisplayLabels?f.variationDisplayLabels[b]:"",h=f&&f.variationValues?
f.variationValues[b][a]:"";return{dimKey:b,titleSelectorPrefix:"inline-twister-dim-title-",titleValueSelector:"inline-twister-dim-title-value",mainText:e,subText:-1!==a?h:d.replace("###dimension",e||"")}}function r(){if(!D){var b=[];c.each(h.dimList,function(a){b.push({dimKey:a,val:f.selectedVariationValues?f.selectedVariationValues[a]:-1})});return b}return D.state()}function b(){return c.map(h.dimList,function(b,a){if(!h.isSingletonMap[b])return new l(function(d){k(h.rows[b],b,a);d()})})}function k(b,
e,k){var m=h.inlineTwisterData.slotsEnabledDimensions,u=!!((h.dimList.length===m.length?m[k]:m[0])&&a(e));k=f.variationValues[e];var r=b.getInitialVisibleSwatchList(),w=[];c.each(k,function(b,a){b=d(b,X[e+"::"+a],Y[e+"::"+a],a,h.initSelectionState[e].val===a,r[a]?r[a].slotHtm:"",u,r[a]&&r[a].isVisible,r[a]&&r[a].unavailable,F,e,L[e]?L[e][b]:null);w.push(b)});h.swatches[e]=w}function w(){c.each(h.rows,function(b){h.isSingletonMap[b.dimKey]||(b.createDisplaySwatches(),h.textSwatchMap[b.dimKey]&&b.toggleSwatch.alignTextSwatches())})}
function z(){function b(a,e,k){var m,r,u,w=a.expanderContent.find(".inline-twister-swatch:not(.aok-hidden):not(.swatch-prototype)"),p=f.variationValues[e]||[],z=h.inlineTwisterData.inlineVariationsSize,v=-1,g=z,q=[],l=null;-1===z&&(v=parseInt(a.expanderContent.attr("data-swatchCountPerRow"))||w.length,g=v*O[e]);c.each(w,function(b,h){var c=parseInt(b.getAttribute("data-idxInToggleSwatchList")),w="true"===b.getAttribute("data-initiallySelected"),f="true"===b.getAttribute("data-initiallyUnavailable");
m=b.getAttribute("data-asin");r=c;u=p[c]||"";var n,t,G;n=X[e+"::"+r];t=Y[e+"::"+r];G=u;f=d(G,n,t,r,w,"",k,!0,f,m,e,L[e]?L[e][G]:null);a.toggleSwatch&&(n=a.toggleSwatch.createSwatch(f,b),f.isVisible=n.isVisible);q.push(f);w&&h>=g&&(H[e]=c);-1!==z&&-1===v&&(b=b.getBoundingClientRect().top,null===l?l=b:b!==l&&(v=h))});-1!==z&&(-1===v&&(v=w.length),O[e]=Math.ceil(w.length/v));h.inlineVariationsSize[e]=w.length;a.toggleSwatch&&a.toggleSwatch.setNumberOfSwatchesPerRow(v);return q}function k(b,d,e){var m=
!(!b||!a(d)),r=h.rows[d].getInitialVisibleSwatchList();m&&c.each(r,function(a){if(!a.unavailable){var k=B.updateIfCurrentlyActive.bind(B,a.id),k=h.slotManager.get(a.asin,d,h.noOfLoadingIndicator,!1,Z,k,e);a.updateSlotNode({showSlot:b,slotHtm:k},!1,d)}})}function w(b,a,d){b={dimIndex:h.dimIndexMap[b],dimValueIndex:a};a=g.DP_STATE_VIEW_SUBTYPE;var e=h.dimensionsMap,k;k=r();for(var c=g.CHAR_UNDERSCORE,m=[],u=0;u<h.dimensionsMap.length;u++){var f=k[u].val;-1===f&&(f=g.CHAR_ASTERISK);m.push(String(f))}k=
c?m.join(c):m;return{divMetadata:b,eventType:d,subType:a,dimensionsMap:e,currDimCombId:k}}var z=r(),p=0,v={},l=h.inlineTwisterData.slotsEnabledDimensions,t=h.inlineTwisterData.popoverSlotsEnabledDimensions;n.each(z,function(b,a){v[a.dimKey]=a;h.dimIndexMap[a.dimKey]=b;h.dimensionsMap[b]=a.dimKey});h.initSelectionState=v;n.each(h.dimList,function(b,a){var d=v[a].val;b=G(a);var d=m(a,d),e=!(!P&&(h.dimList.length===l.length?l[p]:l[0])),c=-1!==Q.indexOf(a);h.textSwatchMap[a]=b;b=new q("inline-twister-row-",
d,{showSlot:!1,dimKey:a,inlineTwisterData:h.inlineTwisterData},{handleDimensionExpansion:function(b,d,m){a=b.dimKey;if(m){h.dimensionHandler.expandDimension(a);b=F;m={};R[a]?(m=S(h.swatches[a],d,a,r(),!1,!c,e),h.indexTranslationMap[a]=m,b={swatches:h.swatches[a]}):(k(d,a,e),R[a]=!0);var u=h.rows[a];u.setState(b,m,I,null,!1);J(d,u,a);h.logger.logDimensionExpanded(a);c||(H[a]=null)}else h.dimensionHandler.collapseDimension(a),h.logger.logDimensionCollapsed(a)}},h.logger);h.rows[a]=b;p+=1});0===h.inlineTwisterData.numberOfDimensionsExpanded&&
(u(),aa=!0);p=0;n.each(h.dimList,function(d,k){function m(b,a,d){if(a){var e=parseInt(a.buttonName,10),c=b[e]&&b[e].id?b[e].id:"";k=a.buttonGroupName;b[e]&&b[e].selected&&h.logger.logSelectedSwatchClick();c&&B.exists(c)&&B.hide(c);I=k;b={dimKey:k,val:e};C.newTwisterInteractionStartTime=new Date;h.twister.metaData(w(k,e,g.viewEvents.CLICK));h.twister.dimensionChanged(b);h.logger.logDimensionValueClick();d&&h.logger.logDimValueClickAfterAutoUpdate()}}function u(b,d){var e=d.data,k=d.type;d=d.$currentTarget;
var c=e.id,m=!!a(b),m=K&&m&&y,m=e.showImageInPopOver||m,f=!y,z=[];if(e){if(k===g.viewEvents.MOUSE_ENTER){var v=parseInt(e.name,10);z.push({dimKey:b,val:v});m&&B.show(c,d,e,f)}else m&&B.hide(c),z=r();D&&(h.twister.metaData(w(b,v,k)),h.twister.dimensionPeek(z));I=b}}function z(b,a){var d=parseInt(b.buttonName,10),e=h.swatches[a];(e?e[d]:F)?(E.setUserInteracting(!0),c.delay(function(){m(e,b)},350),h.logger.logSecViewSwatchClick()):A.log("Selected swatch not found on side sheet toggle button click. Value clicked: "+
d+" ; Swatch length: "+h.swatches[a].length,ba.ERROR,ba.ATTRIBUTION)}function v(b,a){h.isSideSheetOpen=a;h.isWindowResizedAfterSideSheetOpen&&!a&&n.each(h.dimList,function(b,a){h.textSwatchMap[a]&&(G(a),(b=h.rows[a])&&b.toggleSwatch&&(b.toggleSwatch.alignTextSwatches(),b.toggleSwatch.alignTextSwatchNodesInLastRow()))});h.isWindowResizedAfterSideSheetOpen=!1}function q(b,a,d){var k=N.desktopConfiguratorAllOptionsString||"",m=h.swatches[b].length,u={dimensionDisplayText:d.mainText,displayValueText:d.subText,
dimKey:b,getSwatchInfo:E.getSwatch.bind(E),destroyPopover:B.destroy,optionsText:k,totalValueCount:m,isTextSwatch:M};h.sideSheet.open(u);var w={swatches:h.swatches[b]};c.delay(function(){var d=S(h.swatches[b],a,b,r(),!0,!1,T);U&&e(b);E.setState(w,d,I,null,!0,!0);h.sideSheet.update(u);W[b]=!0;c.delay(function(){M&&J(a,E,b,!0);M&&E.toggleSwatch&&m<g.TEXT_ALIGNMENT_LIMIT&&E.toggleSwatch.alignTextSwatches(!1,!0)})},1E3);h.isSideSheetOpen=!0;h.isWindowResizedAfterSideSheetOpen=!1;h.logger.logSeeAllLinkClick("Dimension"+
(h.dimIndexMap[b]+1))}function G(b){D&&(h.isWindowResizedAfterSideSheetOpen=!0,h.isSideSheetOpen||J(h.showSlotMap[b],h.rows[b],b,!1))}var M=h.textSwatchMap[k];d=[];var x=!P&&(h.dimList.length===l.length?l[p]:l[0]),y=h.dimList.length===t.length?t[p]:t[0],T=!x,K=x||y,U=-1!==Q.indexOf(k),E=h.rows[k];h.showSlotMap[k]=K;O[k]=h.inlineTwisterData.numOfRowsPerDimension;x=-1!==f.singletonDimensionKeys.indexOf(k);h.isSingletonMap[k]=x;p+=1;!x&&E&&(x=!(!K||!a(k)),H[k]=null,d={name:k,swatches:d,isTextSwatch:M,
onChange:m,onHover:u,hideSlotsFromMainView:T,totalSwatchCount:(f.variationValues[k]||[]).length,preserveNaturalSwatchOrder:U},h.sideSheet.registerToggleButtonGroup(k,z,v),E.initializeComponents(d,K,{showSideSheet:q,handleWindowResize:G}),h.dimensionHandler.registerDimension(k,E),d=b(E,k,x),h.swatches[k]=d)});aa||u()}function G(b){var a=!0;(h.inlineTwisterData.disableImageSwatch===F?0:h.inlineTwisterData.disableImageSwatch)||(a=!h.inlineTwisterData.imageDimensionKeysMap[b]);return a}function S(b,d,
k,m,u,r,w,f){var z=!(!d||!a(k));d=D.util.getDimAvailability(k,m);var v=-1!==Q.indexOf(k),p={},g=0,q=B.updateIfCurrentlyActive,l=-1;n.each(m,function(b,a){a.dimKey===k&&(l=a.val)});-1!==l&&(r&&(p[l]=g),g++);var t=h.rows[k];c.each(d.available,function(a){b[a.index]=b[a.index]||{};var d=b[a.index];d.unavailable=!1;d.selected&&(l=a.index,d.isVisible||(null!==H[k]&&b[H[k]]&&(b[H[k]].isVisible=!1,v&&e(k)),H[k]=a.index),d.isVisible=!0);r&&(d.isVisible=g<h.inlineVariationsSize[k]||d.selected);var m=d.isVisible||
u,n=u?d.id+"_sec":d.id;z&&m?d.slotHtm=h.slotManager.get(a.asin,k,h.noOfLoadingIndicator,u,Z,q.bind(B,n),w,f):(d.slotHtm=d.slotHtm||"",q(n,d.slotHtm));u&&t&&t.toggleSwatch&&(m=t.toggleSwatch.getSwatch(a.index),c.objectIsEmpty(m)&&(p[a.index]=g));r&&l!==a.index&&(p[a.index]=g);d.showSlot=z;d.selected||g++});c.each(d.unavailable,function(a){b[a.index]=b[a.index]||{};var d=b[a.index];d.unavailable=!0;r&&(d.isVisible=g<h.inlineVariationsSize[k]);d.slotHtm=z?V:"";r&&(p[a.index]=g);d.showSlot=z;g++});R[k]=
!0;v&&(p={});return p}function J(b,a,d,e){var k=h.textSwatchMap[d];b&&k&&(!e||h.isSideSheetOpen)&&(h.slotManager.resetMinSlotHeight(d),b=a.toggleSwatch.getSlotNodes(e),ca(b,d,e),h.slotManager.updateSlotHeight(d,e))}function ca(b,a,d){h.slotManager.resetSlotHeight(a,d);c.each(b,function(b,d){c.each(b,function(b){h.slotManager.setState(b,a,d)})})}function Z(b,a){a&&!h.isSideSheetOpen||J(!0,h.rows[b],b,a)}var h=this,D=F;this.isWindowResizedAfterSideSheetOpen=!1;this.data=f;this.noOfLoadingIndicator=
1;this.dimList=f.reorderedDimensionListKeys||[];this.dimensionsMap=[];this.logger=y;this.inlineTwisterData=f?f.inlineTwisterData||{}:{};this.swatches={};this.sideSheet=new t;var H={},N=this.inlineTwisterData&&this.inlineTwisterData.stringTranslationMap?this.inlineTwisterData.stringTranslationMap:{},V='\x3cspan class\x3d"a-size-small default-slot-unavailable"\x3e'+(N.defaultSlotUnavailableString||"")+"\x3c/span\x3e",X=f.imageHashMap||{},Y=f.desktopConfiguratorPopoverImageMap||{},L=f.dimensionPageLoadUrls||
{},O={},P=!!f.isAssemblyVariationsEnabled;this.rows={};this.dimensionHandler=new p(h.inlineTwisterData);this.isSingletonMap={};this.indexTranslationMap={};this.textSwatchMap={};var I,ba=g.loggingConstants;this.initSelectionState={};B.setVisibleSlotConfig(this.inlineTwisterData&&this.inlineTwisterData.desktopConfiguratorSlotsInPopover?this.inlineTwisterData.desktopConfiguratorSlotsInPopover:[]);this.inlineVariationsSize={};this.dimIndexMap={};this.isSideSheetOpen=!1;this.showSlotMap={};var Q=h.inlineTwisterData.dimsWithSwatchReorderingDisabled||
[],W={},R={},aa=!1;(function(){var b=h.logger.createFunctionTimerInstance("desktopConfiguratorInitTime");b.start();z();b.stop()})();c.on("register-desktop-configurator-with-twisterCore",function(a,d){D=a;h.logger.registerTwisterCore(D);h.sideSheet.init(h.logger);a=r();var e=h.inlineTwisterData.slotsEnabledDimensions,k=h.inlineTwisterData.popoverSlotsEnabledDimensions,u={};n.each(a,function(b,a){u[a.dimKey]=a});D.slotsDimSum.addDefaultQueryParameter("showFancyPrice",h.inlineTwisterData.showFancyPrice);
D.slotsDimSum.addDefaultQueryParameter("twisterFlavor",g.DESKTOP_CONFIGURATOR_FLAVOR);h.slotManager=new v(D,x,h.logger,h.inlineTwisterData);h.dimensionHandler.init();var f=0;c.each(h.rows,function(b){function a(e){var k,u={},f;k=e.selected().selectionInfo();n.each(k,function(b,a){u[a.dimKey]=a});f=u[d].val;e=h.swatches[d];e[f]=e[f]||{};e[r]=e[r]||{};e[r].selected=!1;e[f].selected=!0;var z=m(d,r);r===f||w||b.setThumbnailImage(e[f].image);r=f;S(e,g,d,k,!1,!1,p,g);k=m(d,f);f={swatches:e};var v=c.filter(e,
function(b){return b.isVisible});e.length===v.length&&(b.hideSideSheetLink(),h.inlineVariationsSize[d]=e.length);b.setExpanderHeaderAriaLabel(z,k);b.setState(f,{},I,k,!1);J(g,b,d)}if(!h.isSingletonMap[b.dimKey]){b.postInitialize();var d=b.dimKey,r=u[d].val,w=G(d),z=h.dimList.length===k.length?k[f]:k[0],v=!P&&(h.dimList.length===e.length?e[f]:e[0]),p=!v,g=v||z;h.twister=D.registerActive({viewAttribution:"DetailPage",viewName:"DesktopConfiguratorRowView_"+d},{updateView:function(e,k){var u={};"VARIATION_CHANGE"===
e?c.delay(function(){a(k)}):"VARIATION_PEEK"===e&&(e=k.peek().selectionInfo(),n.each(e,function(b,a){u[a.dimKey]=a}),e=u[d].val,e=m(d,e),I===d&&b.title.setState(e),h.sideSheet.activeDimKey===d&&h.sideSheet.updateDimVal(e))}})}f++});l.all(b()).then(function(){w()});c.trigger("desktop-configurator-twisterCore-initialized",h);d.then(function(){c.each(h.rows,function(b){b.activatePageRefresh()})})})}});"use strict";A.when("A").register("desktop-configurator-constants",function(c){return{AJAX_CALL_TIMEOUT:2E4,
DIMENSION_VALUE:"DimensionValue###",DISPLAY_VALUE:"DisplayValue###",SWATCH_DATA:"SwatchData###",DESKTOP_CONFIGURATOR_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:"*",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,viewEvents:{MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CLICK:"click"},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"},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-configurator-dim-row-"},
cssConstants:{BG_COLOR:"background-color",GREEN_BG_COLOR:"#D9EED9",WHITE_BG_COLOR:"white"},loggingConstants:{ATTRIBUTION:"TwisterPlusDesktopConfigurator",ERROR:"ERROR"}}});"use strict";A.when("A").register("desktop-configurator-logger",function(c){function g(){if(!(this instanceof g))return new g;f||(f=this);return f}function l(c){if("undefined"!==typeof C.csa){var f=C.csa("Events",{producerId:"dp-rpcx"}),g=q.count(c)||0;f("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:c,valueToLog:g},{ent:"all"})}}
var n=c.$,f,q=C.ue;g.prototype={registerTwisterCore:function(c){this.twisterCore=c},logCSMDataOnLanding:function(){var c=0,f=0,g=0,p=this.twisterCore.util,t=p.tvm.dimensionInfo,B=this.twisterCore.state().length,u=Object.keys(p.tvm.dimCombinations).length;n.each(t,function(a,d){a=d.dimKey;p.isRequiredDim(a)&&g++;p.isSingletonDim(a)?f++:c++});q&&q.count&&(q.count("dpMobileTwisterDropdownPresent",c),l("dpMobileTwisterDropdownPresent"),q.count("dpMbileTwisterSingletonDim",f),l("dpMbileTwisterSingletonDim"),
q.count("dpMobileTwisterRequiredDim",g),l("dpMobileTwisterRequiredDim"),q.count("dpMobileTwisterDimSize",B),l("dpMobileTwisterDimSize"),q.count("dpMobileTwisterFamilySize",u),l("dpMobileTwisterFamilySize"),q.count("twisterPlus.inlineTwisterGV",1),l("twisterPlus.inlineTwisterGV"))},logCSMTagsOnLanding:function(f){function g(b,a,d){var e=[];if(a===d)e.push(""),b=b[a],c.$.isArray(b)?c.each(b,function(b,a){e.push(b)}):e.push(b);else{var m=Math.floor((a+d)/2);a=g.call(this,b,a,m);var f=g.call(this,b,m+
1,d);c.each(a,function(b,a){c.each(f,function(a,d){e.push(""===b?a:""===a?b:b+":"+a)})})}return e}function q(b){b&&l.push(b)}var p=this,l=[],n=!0,u=!0,a=[0,3,8,25,50,100,1E3,5E3],d=Object.keys(this.twisterCore.util.tvm.dimCombinations).length,e,m;f.dimensionList&&(e="variation_dimension:"+f.dimensionList.length,c.each(f.dimensionList,function(b,a){p.addCSMTag(b)}));for(var r=1;r<a.length;r++)if(d<=a[r]){m="family_size_bucket:"+a[r-1]+"-"+a[r];break}else r===a.length-1&&(m="family_size_bucket:gt"+
a[r]);f.dimensionInfo&&c.each(f.dimensionInfo,function(b,a){b.isSingleton||(n=!1)});a=n?"SingletonFamily":"DesktopConfigurator";f.initDimCombination&&c.each(f.initDimCombination,function(b,a){-1===b.val&&(u=!1)});q(e);q(m);q(a);u&&q("defaultSelection");f=g.call(this,l,0,l.length-1);(function(b){var a=this;c.each(b,function(b,d){b&&a.addCSMTag(b)})}).call(this,f)},createFunctionTimerInstance:function(c){var f=this;return{eventType:c,start:function(){this.startTime=Date.now()},stop:function(){this.startTime&&
f.logCounter(this.eventType,Date.now()-this.startTime)}}},addCSMTag:function(c){C.ue&&C.ue.tag&&C.ue.tag(c)},logCounter:function(c,f){q&&q.count&&(f===F?q.count(c,(q.count(c)||0)+1):q.count(c,f),l(c))},logBottomSheetPageUpdate:function(c){this.logCounter("twisterPlus.inlineTwisterPageUpdate")},logSelectedSwatchClick:function(){this.logCounter("twisterPlus.inlineTwister.selectedSwatchClick")},logDimensionValueClick:function(){this.logCounter("dpmobiletwisterclickOndimval")},logSecViewTotalCount:function(c){this.logCounter("twisterPlus.inlineTwister.secondaryViewCount."+
c)},logSecViewGV:function(c){this.logCounter("twisterPlus.inlineTwister.secondaryViewGV."+c)},logSecViewClosed:function(c){this.logCounter("twisterPlus.inlineTwister.secondaryViewClosed."+c)},logDimensionCollapsed:function(c){this.logCounter("twisterPlus.inlineTwister.dimCollapse."+c)},logDimensionExpanded:function(c){this.logCounter("twisterPlus.inlineTwister.dimExpand."+c)},logSecViewSwatchClick:function(){this.logCounter("twisterPlus.inlineTwister.secViewSwatchClick")},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")},logSeeAllLinkClick:function(c){this.logCounter("twisterPlus.inlineTwister.seeAllLinkClick."+c)}};return g});"use strict";A.when("A").register("twister-dynamic-style",function(c){function g(c,g){this.name=c;this.styleNode;this.rules=g||[];this.pendingRefresh}var l=c.$,n={};g.prototype={refresh:function(){var c=l("\x3cdiv /\x3e",{html:"\x26shy;\x3cstyle\x3e"+this.rules.join(" ")+"\x3c/style\x3e"});this.styleNode?
(this.styleNode.replaceWith(c),delete this.styleNode,this.styleNode=c):(this.styleNode=c,this.styleNode.appendTo("body"))}};return{addCSSRules:function(c,l){n[c]?n[c].rules=l||[]:n[c]=new g(c,l);n[c].refresh()}}});"use strict";A.when("A","desktop-configurator-constants","desktop-configurator-twister-register").register("desktop-configurator-slot-manager",function(c,g,l){function n(c,a,d,e){this.twisterCore=c;this.batch={};this.currentBatch;this.maxSlotHeight={};this.minSlotHeight={};this.dynamicStyle=
a;this.slotIdentifierMap={};this.logger=d;this.auiPriceSize=e&&e.auiPriceSize?e.auiPriceSize:"m";this.currentlyUnavailableMessage=e&&e.stringTranslationMap?e.stringTranslationMap.currentlyUnavailableMessage:"";this.desktopConfiguratorSlotsInMainView=e&&e.desktopConfiguratorSlotsInMainView?e.desktopConfiguratorSlotsInMainView:[]}function f(u,a,d,e,m){var f=this.batch,b=this;f[u]=f[u]||[];f[u].push(d);clearTimeout(this.currentBatch);this.currentBatch=setTimeout(function(){var d=c.map(b.batch,function(b,
a){return a});b.twisterCore.slotsDimSum.get(d,function(d){var k=b.batch[d.ASIN];k&&(t.each(k,function(b,a){a(d)}),delete b.batch[d.ASIN]);p(b.batch)&&(k=Object.keys(b.maxSlotHeight),c.each(k,function(b){e(b,m&&b===a)}))})},0)}function q(c,a,d,e){d[a]=d[a]||{};d[a].uniqueCount=d[a].uniqueCount||0;var m="inline-twister-dimsum-loading-"+a+"-"+d[a].uniqueCount;d[a].uniqueCount+=1;return{loadingHtm:'\x3cdiv class\x3d"'+m+(c?" loading-indicator-1":"")+(e?" aok-hidden":"")+'"\x3e\x3cdiv\x3e\x3c/div\x3e\x3c/div\x3e',
promise:function(a,b){var d=t("."+m+":not(.loading-indicator-in-popover)").parent();d.length&&(d.html(a),b(d))}}}function v(c){return c.replace(/\n/g,"").replace(/[\t ]+\</g,"\x3c").replace(/\>[\t ]+\</g,"\x3e\x3c").replace(/\>[\t ]+$/g,"\x3e")}function x(c,a,d){return v(B.default.call(this,c.content.twisterSlotDiv,a,d))}function y(c,a){if(!c||0===c.length)return a;if(0<c.find(".loading-indicator-1").length)return c[0].scrollHeight;if(0===c.find(".defaultSlotUnavailable").length)return a;c=c[0].scrollHeight;
a<c&&(a=c);return a}function p(c){for(var a in c)if(c.hasOwnProperty(a))return!1;return!0}var t=c.$,B={default:function(c,a,d){c=t("\x3cdiv\x3e"+c+"\x3c/div\x3e");var e=c.find(".price_slot_ppu"),m=c.find("#ms3slot"),f=c.find("#twisterAvailability"),b=c.find("#deliveryPromisePrefix"),k=c.find(".variationReviewsSection"),w=d?[]:this.desktopConfiguratorSlotsInMainView,g=c.find(".twister_swatch_price");f.length&&((g.length||d)&&-1===w.indexOf("twisterAvailability")&&f.parent().addClass("aok-hidden"),
f.parent().append("\x3cdiv class\x3d'js-dummy-twister-availability'\x3e\x3c/div\x3e"),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"),a&&this.logger.logAvailabilitySlotRender());0<g.length?(-1===w.indexOf("price")&&g.addClass("aok-hidden"),g.addClass("inline-twister-swatch-price"),d=c.find(".a-price"),
0<d.length?d[0].dataset&&(d[0].dataset.aSize=this.auiPriceSize):(g.find(".a-size-small").removeClass("a-size-small").addClass("a-size-base").addClass("a-color-base"),g.find(".a-size-mini").removeClass("a-size-mini").addClass("a-size-base").addClass("a-color-base"),g.find(".a-size-large").removeClass("a-size-large").addClass("a-size-base").addClass("a-color-base")),d="a-size-small",g.find(".olpWrapper").removeClass("a-size-mini a-size-micro a-size-medium a-size-large a-size-base a-color-base").addClass(d),
e.length&&(d="twister-plus-inline-twister-ppu a-size-micro",e.removeClass("a-size-mini a-size-small a-size-medium a-size-large a-size-base a-color-base").addClass(d),a&&this.logger.logPPUSlotRender()),a&&this.logger.logPriceSlotRender()):(g=c.find("#sndbox-mobile-twister-price"),0<g.length&&a&&this.logger.logPriceSlotRender());m.length&&(m.find(".a-icon-mini").removeClass("a-icon-mini").addClass("a-icon-small"),-1===w.indexOf("ms3")&&m.addClass("aok-hidden"),a&&this.logger.logPrimeSlotRender());0<
b.length&&(b.removeClass("a-size-small a-color-secondary").addClass("a-color-base"),-1===w.indexOf("deliveryPromise")&&b.parent().addClass("aok-hidden"),b.find("br").remove(),e=b.find("b"),0===e.length&&(e=b.find("span")),e.length&&(m=" "+v(e.text()),e.addClass("aok-hidden"),b.append('\x3cspan style\x3d"font-weight: bold;"\x3e'+m+"\x3c/span\x3e")),a&&this.logger.logDeliverySlotRender());0<k.length&&(k.removeClass("a-spacing-micro a-spacing-top-micro").addClass("a-spacing-none a-spacing-top-none"),
-1===w.indexOf("variationReviews")&&k.addClass("aok-hidden"),a&&this.logger.logReviewsSlotRender());l.executeModifiers(c);return c.html()}};n.prototype={get:function(c,a,d,e,m,r,b){var k=this,g=this.twisterCore.slotsDimSum.get([c]);if(g[c])return x.call(k,g[c].Value,!1,b);var p=q(d,a,k.slotIdentifierMap,b);f.call(this,c,a,function(a){p.promise(x.call(k,a.Value,!0,b),r)},m,e);return p.loadingHtm},setState:function(c,a,d){this.minSlotHeight[a]||(this.minSlotHeight[a]=[]);this.maxSlotHeight[a]||(this.maxSlotHeight[a]=
[]);this.minSlotHeight[a][d]=this.minSlotHeight[a][d]||0;this.minSlotHeight[a][d]=y(c,this.minSlotHeight[a][d]);this.maxSlotHeight[a][d]=this.maxSlotHeight[a][d]||0;var e=this.maxSlotHeight[a];var m=this.maxSlotHeight[a][d];!c||0===c.length||0<c.find(".loading-indicator-1").length||(c=c[0].scrollHeight,m<c&&(m=c));e[d]=m;this.maxSlotHeight[a][d]=this.maxSlotHeight[a][d]>this.minSlotHeight[a][d]?this.maxSlotHeight[a][d]:this.minSlotHeight[a][d]},updateSlotHeight:function(f,a){var d=[],e;c.each(this.maxSlotHeight[f],
function(c,r){a?(d.push("#desktop-configurator-side-sheet #"+f+"dim_list .desktop-configurator-dim-row-"+r+" .dimension-slot-info {height: "+c+"px;}"),e="twister-plus-desktop-configurator-side-sheet-slot-height-"):(d.push("#inline-twister-expander-content-"+f+" .desktop-configurator-dim-row-"+r+" .dimension-slot-info {height: "+c+"px;}"),e="twister-plus-desktop-configurator-slot-height-")});this.dynamicStyle.addCSSRules(e+f,d)},resetMinSlotHeight:function(f){this.minSlotHeight[f]||(this.minSlotHeight[f]=
[]);this.minSlotHeight[f]=c.map(this.minSlotHeight[f],function(){return 0})},resetSlotHeight:function(f,a){this.maxSlotHeight[f]||(this.maxSlotHeight[f]=[]);this.dynamicStyle.addCSSRules((a?"twister-plus-desktop-configurator-side-sheet-slot-height-":"twister-plus-desktop-configurator-slot-height-")+f,[]);this.maxSlotHeight[f]=c.map(this.maxSlotHeight[f],function(){return 0})}};return n});"use strict";A.when("A","desktop-configurator-constants","detail-page-side-sheet").register("desktop-configurator-side-sheet-view",
function(c,g,l){function n(){this.sideSheetData=this.activeDimKey=null;this.swatchList=[];this.mainViewDimContainer=this.keyDownEventHandler=this.dimValContainer=null;this.updateSideSheetStatus={}}function f(){this.sideSheetData=this.activeDimKey=null;this.swatchList=[];this.mainViewDimContainer=this.keyDownEventHandler=this.dimValContainer=null}function q(a,d){c.each(a,function(a){var m="desktop-configurator-swatch-hover:"+d+"_sec";try{c.declarative.remove(a,m),c.declarative.create(a,m,{})}catch(f){A.log("Hover event subscribe failed with error: "+
this.name,u.ERROR,u.ATTRIBUTION)}})}function v(a){a=Array.prototype.slice.call(a);var d=t(a[0]).find("input");a=t(a[a.length-1]).find("input");this.keyDownEventHandler=y.bind(this,d,a);document&&document.addEventListener("keydown",this.keyDownEventHandler);c.delay(function(){d&&d.focus()})}function x(){if(this.mainViewDimContainer){var a=this.mainViewDimContainer.parent().find(".tp-side-sheet-link-container a")[0];document&&document.removeEventListener("keydown",this.keyDownEventHandler);a&&a.focus()}}
function y(a,d,e){e.code&&"tab"===e.code.toLowerCase()&&(e.shiftKey?document&&document.activeElement===a[0]&&(e.preventDefault(),d.focus()):document&&document.activeElement===d[0]&&(e.preventDefault(),a.focus()))}function p(a){var d=t("#desktop-configurator-side-sheet-content-header").clone();d.removeClass("aok-hidden");d.find(".dim-name").text(a.dimensionDisplayText+":");d.find(".dim-value").text(a.displayValueText);var e=a.optionsText;e&&d.find(".dim-options").text(e.replace("###options",a.totalValueCount));
return d}var t=c.$,B=g.sideSheetSelectors,u=g.loggingConstants;n.prototype={init:function(a){var d=this,e=t("#twister-plus-inline-twister-container");0!==e.length&&(e=e[0].getBoundingClientRect().width,this.scrollbarWidth=this.getScrollbarWidth(),this.sideSheet=new l({id:"desktop-configurator-side-sheet",shouldRenderHTMLString:!0,animationDuration:g.SIDE_SHEET_ANIMATION_SPEED,width:e+g.SIDE_SHEET_PADDING+d.scrollbarWidth,onAfterHide:function(){a.logSecViewClosed(d.activeDimKey);c.each(d.swatchList,
function(a){var e=parseInt(a.getAttribute("data-idxInToggleSwatchList"),10),e=d.sideSheetData.getSwatchInfo(e);c.declarative.remove(a,"desktop-configurator-swatch-hover:"+d.activeDimKey+"_sec");d.sideSheetData.destroyPopover(e.id+"_sec")});x.call(d);d.updateSideSheetStatus[d.activeDimKey]&&d.updateSideSheetStatus[d.activeDimKey](d.activeDimKey,!1);f.call(d)}}))},open:function(a){this.activeDimKey=a.dimKey;this.sideSheetData=a;var d=t("#inline-twister-row-"+a.dimKey+" #tp-inline-twister-dim-values-container").find(".desktop-configurator-dim-row-0"),
e=t("#side-sheet-loader-container").clone().removeClass("aok-hidden"),f=e.find(".loader-container"),r=e.find("#side-sheet-loader").clone().removeClass("aok-hidden"),b,k,w=g.DEFAULT_TEXT_SWATCH_SPACING;a.isTextSwatch?(b=d.width()-g.BORDER_WIDTH,k=d.height()-g.BORDER_WIDTH):(k=d.find(".swatch-image-container"),w=0<k.closest(".reduced-image-swatch-margin").length,b=k.outerWidth(),k=k.outerHeight(),w=w?g.REDUCED_IMAGE_SWATCH_SPACING:g.DEFAULT_IMAGE_SWATCH_SPACING,r.css({marginLeft:w/2+"px",marginRight:w/
2+"px"}));r.width(b);r.height(k);c.each(d,function(){f.append(r.clone().addClass("side-sheet-loader-1"))});b=f.clone();b.find(".side-sheet-loader-1").removeClass("side-sheet-loader-1").addClass("side-sheet-loader-2");e.append(b);a=p(a);e.prepend(a);e=e[0].outerHTML;this.sideSheet.updateWidth(this.getWidth(d,w));this.sideSheet.open(e)},update:function(a){this.mainViewDimContainer=t("#inline-twister-row-"+a.dimKey+" #tp-inline-twister-dim-values-container");var d=this.mainViewDimContainer.clone(),e=
d.find(B.DIMENSION_VALUES_LIST);e.attr("id",a.dimKey+"dim_list");var c=p(a);d.prepend(c);e.children().slice(1).removeClass("aok-hidden");e.attr("data-a-button-group",'{"name":"sec_'+a.dimKey+'"}');this.sideSheet.updateContent(d[0].outerHTML);a=this.sideSheet.container;this.swatchList=a.find(B.DIMENSION_VALUES_LIST).children().slice(1);q(this.swatchList,this.activeDimKey);this.dimValContainer=a.find(".desktop-configurator-side-sheet-content-header .dim-value");v.call(this,this.swatchList)},close:function(){this.sideSheet.close()},
registerToggleButtonGroup:function(a,d,e){var f=B.SEC_VIEW_TOGGLE_BUTTON_PREFIX+a,g=this;this.updateSideSheetStatus[a]=e;c.on("a:button-group:"+f+":toggle",function(b){g.sideSheet.close();b.selectedButton.buttonGroupName=a;d(b.selectedButton,a)})},updateDimVal:function(a){this.dimValContainer&&this.dimValContainer.length&&this.dimValContainer.text(a.subText)},getScrollbarWidth:function(){if(this.scrollbarWidth)return this.scrollbarWidth;var a=document.body?C.innerWidth-document.body.clientWidth:-1;
0>a&&(a=g.DEFAULT_SCROLLER_WIDTH);return a},getWidth:function(a,d){var e=0;c.each(a,function(a){e+=a.getBoundingClientRect().width+d});return e+g.SIDE_SHEET_PADDING+this.scrollbarWidth}};return n});"use strict";A.when("A","a-popover","desktop-configurator-constants").register("desktop-configurator-popover-factory",function(c,g,l){function n(b){var a=y("\x3cdiv /\x3e"),d=y("\x3cspan /\x3e"),e=b.title,c=b.showImageInPopOver,m=!b.hideSlots;a.addClass("desktop-configurator-popover-content");d.addClass("desktop-configurator-title-block a-size-base a-color-base a-text-bold");
d.text(e);a.append(d);c&&(d=y("\x3cdiv /\x3e"),c=y("\x3cimg /\x3e"),c.attr("src",b.image),c.attr("data-a-image-source",b.image),c.attr("alt",e),d.append(c),a.addClass("visual-dimension"),d.addClass("desktop-configurator-image-block"),a.prepend(d));m&&f(a,b.slotNode);return a}function f(b,a){a="string"===typeof a?a:a.clone();var d=y("\x3cdiv /\x3e");b.find(".desktop-configurator-slot-block").remove();d.addClass("desktop-configurator-slot-block");d.html(a);q(d);b.append(d)}function q(b){var a=b.find(".price_slot_ppu"),
d=b.find("#ms3slot"),f=b.find(".twister_swatch_price"),g=b.find("#twisterAvailability"),p=b.find("#deliveryPromisePrefix"),l=b.find(".variationReviewsSection"),u=b.find(".default-slot-unavailable"),q=b.find(".loading-indicator-1");b=b.find(".twisterPrimeWardrobe");var h={variationReviews:l,price:f,ms3:d,twisterAvailability:g.parent(),deliveryPromise:p.parent(),ppu:a,twisterPrimeWardrobe:b};q.length&&(q.addClass("loading-indicator-in-popover"),0===e.length?q.addClass("aok-hidden"):q.removeClass("aok-hidden"));
c.each(m,function(a){h[a]&&(-1===e.indexOf(a)?h[a].addClass("aok-hidden"):(h[a].removeClass("aok-hidden"),a=r[a+"_styleSlot"],"function"===typeof a&&a.call(this,h)))});u.length&&u.removeClass("a-size-small").addClass("a-size-base")}function v(a,d,e,f){e=n({slotNode:e.slotNode,title:e.title,showImageInPopOver:e.showImageInPopOver,image:e.image,hideSlots:f});d=g.create(d,{name:a,inlineContent:e,closeButton:!1,padding:"none",activate:"none",restoreFocusOnHide:!1});p[a]=d;t[a]||(c.on("a:popover:afterShow:"+
a,function(a){c.delay(function(){y(u.DIMENSION_VALUES_LIST).removeClass("stop-scrolling-dc")})}),t[a]=!0);return d}function x(a,d,e){if(a=p[a])d=n({slotNode:d.slotNode,title:d.title,showImageInPopOver:d.showImageInPopOver,image:d.image,hideSlots:e}),a.update({content:d});return a}var y=c.$,p={},t={},B=l.POPOVER_DELAY,u=l.sideSheetSelectors,a=null,d=null,e=[],m=l.CONFIGURED_SLOTS,r={price_styleSlot:function(a){var d=a.ppu;a=a.price;a.length&&(a.find(".a-size-base").removeClass("a-size-base").addClass("a-size-large"),
d.length&&d.removeClass("a-size-micro").addClass("a-size-small"))},ms3_styleSlot:function(a){a=a.ms3;a.length&&a.find(".a-icon-mini").removeClass("a-icon-mini").addClass("a-icon-small")},twisterAvailability_styleSlot:function(a){var d=a.twisterAvailability;d.length&&(a=a.ms3,d.find(".a-size-small").removeClass("a-size-small").addClass("a-size-base"),a.length&&a.after(d))},deliveryPromise_styleSlot:function(a){a=a.deliveryPromise;a.length&&a.addClass("a-size-base")}};return{show:function(b,e,f,m){a=
this.exists(b)?x.call(this,b,f,m):v.call(this,b,e,f,m);clearTimeout(d);var g=this;d=c.delay(function(){y(u.DIMENSION_VALUES_LIST).addClass("stop-scrolling-dc");a&&a.show();g.updateIfCurrentlyActive(b,f.slotNode)},B)},exists:function(a){return!!p[a]},hide:function(b){(b=p[b])&&b.hide();a=null;clearTimeout(d)},updateIfCurrentlyActive:function(b,d){a&&a.$container&&a.attributes.name===b&&(b=a.$container.find(".desktop-configurator-popover-content"),f(b,d))},destroy:function(a){p[a]&&g.remove(a);delete p[a];
clearTimeout(d)},setVisibleSlotConfig:function(a){e=a}}});"use strict";A.when("A").register("desktop-configurator-twister-register",function(){var c=[];return{registerModifier:function(g){c.push(g)},executeModifiers:function(g){c.forEach(function(c){c.modify&&"function"===typeof c.modify&&c.modify(g)})}}});"use strict";A.when("A","desktop-configurator-constants").register("desktop-configurator-widgets-factory",function(c,g){var l=c.$,n=g.widgetSelectors,f=g.classes,q=g.cssConstants,v=g.loggingConstants;
g=function(){function f(){var a=l(n.IMAGE_THUMBNAIL).attr("src");return a&&a.length&&(a=a.split("."),2<a.length)?a[a.length-2]:!1}function g(a,d,e,c){c=c&&0<c.length?c:a.find(".a-button");d&&!e?(c.addClass("text-swatch-button-with-slots").removeClass("text-swatch-button"),a.find("hr").show(),a.find("hr").removeClass("aok-hidden")):(c.removeClass("text-swatch-button-with-slots").addClass("text-swatch-button"),a.find("hr").hide(),a.find("hr").addClass("aok-hidden"))}return{alignTextSwatches:function(a,
d,e){var f=0,g,b;c.each(a,function(a){a.domNode&&(a.isVisible||d||e)&&(g=a.domNode.attr("data-idxInToggleSwatchList"),b=e?l("#desktop-configurator-side-sheet").find("[data-idxInToggleSwatchList\x3d"+g+"]"):a.domNode,a=b.find(".swatch-title-text-display"),a.length&&a[0].style.removeProperty("height"),a=a?a.height():0,f<a&&(f=a))});c.each(a,function(a){a.domNode&&(a.isVisible||d||e)&&(g=a.domNode.attr("data-idxInToggleSwatchList"),b=e?l("#desktop-configurator-side-sheet").find("[data-idxInToggleSwatchList\x3d"+
g+"]"):a.domNode,b.find(".swatch-title-text-display").height(f))})},createSwatch:function(a,d,e,c,f,b,k){var p=!d.unavailable,q=d.isVisible,l=d.selected,n=d.showSlot,v=d.slotHtm;e="#"+e;if(b.length)return b=b.clone(),b.removeClass("swatch-prototype"),f&&b.addClass("slots-hidden"),b.attr("data-idxInToggleSwatchList",c),c=b.find(e).attr("id",d.id),b.find(e+"-announce").attr("id",d.id+"-announce"),b.find("input").attr({name:d.name,"aria-labelledby":d.id+"-announce"}),b.find("text"===a?".swatch-title-text-display":
"square_image"===a?".swatch-title-text":".swatch-text").text(d.text),p||c.addClass("a-button-unavailable"),l&&c.addClass("a-button-selected"),"text"!==a&&(l=b.find(".swatch-image"),l.addClass("inline-twister-manual-load"),l.attr({"data-a-image-source":d.image||"",id:"inline-twister-image-"+d.name,alt:d.text})),l=b.find(".dimension-slot-info"),l.length&&(l.attr("id","dimension-slot-info-"+d.name),n?p?0<v.length&&l.html(v):l.html(d.defaultSlotUnavailable):b.find("text"===a?".slots-padding":".dimension-slot-info").addClass("aok-hidden"),
"text"===a&&g(b,n,f,c)),k.append(b),q||b.addClass("aok-hidden"),b},getThumbnailImageUrlForPhysicalId:function(a){return a&&a.length&&(a=a.split("."),2<a.length)?(a.splice(-2,1,f()),a.join(".")):!1},updateSlotSectionInTextSwatch:g}}();var x=function(g){function p(a,d,e,c,f,b,k,q){this.id=a.id;this.unavailable=!!a.unavailable;this.selected=!!a.selected;this.showSlot=a.showSlot;this.slotHtm=a.slotHtm;this.isImageSwatch=!d;this.asin=a.asin;this.pageUrl=a.pageUrl;this.hideSlotsFromMainView=f;var n=d?"text":
a.isCirclularImageSwatch?"circular_image":"square_image";this.domNode=q?l(q):g.createSwatch(n,a,e,c,f,b,k);this.isVisible=a.isVisible;this.imageUrl=a.image;this.popoverImage=a.popoverImage;this.isSlotVisible=!0;this.slotNodeIdentifier=d?".slots-padding":".dimension-slot-info";this.title=a.text;this.name=a.name;this.subscribeToHoverEvent(e)}p.prototype={setState:function(a,d,e,c){this.selected=!!a.selected;this.updateAvailablity(a);this.updateSlotNode(a,d,e);this.updateVisibility(a);this.updateSwatchIndexInDomNode(c);
return this},getSlotNode:function(a){this.slotNode||(this.slotNode=this.domNode.find(n.SLOT_NODE_SELECTOR));if(!a)return this.slotNode;a=this.slotNode?this.slotNode.attr("id"):"";return l("#desktop-configurator-side-sheet").find("#"+a)},updateSlotNode:function(a,d,e){this.slotNode||(this.slotNode=this.domNode.find(n.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||g.updateSlotSectionInTextSwatch(this.domNode,this.showSlot,this.hideSlotsFromMainView));this.slotHtm!==a.slotHtm&&(d&&l("#tp-inline-twister-sec-view-"+e+" #"+this.slotNode.attr("id")).html(a.slotHtm),this.slotNode.html(a.slotHtm),this.slotHtm=a.slotHtm)},updateAvailablity:function(a){this.toggleButton||(this.toggleButton=this.domNode.find(n.TOGGLE_BUTTON_SELECTOR));(this.unavailable=a.unavailable)?this.toggleButton.addClass(f.A_BUTTON_UNAVAILABLE):this.toggleButton.removeClass(f.A_BUTTON_UNAVAILABLE)},
updateSelection:function(){this.toggleButton||(this.toggleButton=this.domNode.find(n.TOGGLE_BUTTON_SELECTOR));this.selected?(this.toggleButton.addClass(f.A_BUTTON_SELECTED),this.toggleButton.removeClass(f.A_BUTTON_UNAVAILABLE)):(this.toggleButton.removeClass(f.A_BUTTON_SELECTED),this.toggleButton.removeClass(f.A_BUTTON_FOCUS))},updateVisibility:function(a){a.isVisible?this.domNode.removeClass(f.AOK_HIDDEN):this.domNode.addClass(f.AOK_HIDDEN);this.isVisible=a.isVisible},subscribeToHoverEvent:function(a){a=
"desktop-configurator-swatch-hover:"+a;try{c.declarative.remove(this.domNode,a),c.declarative.create(this.domNode,a,{})}catch(d){A.log("Hover event subscribe failed with error: "+this.name,v.ERROR,v.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 p}(g),y=function(g,p){function a(a,e,f,g){var b=this;this.isTextSwatch=a.isTextSwatch;
this.name=a.name;this.domNode=l(n.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=e.autoNotificationCallback;this.rowContainer=f;this.swatchListContainer=this.domNode.find(n.DIMENSION_VALUES_LIST);this.markAutoUpdated=
!1;this.hideSlotsFromMainView=a.hideSlotsFromMainView;this.windowResizeCallback=e.windowResizeCallback;this.preserveNaturalSwatchOrder=a.preserveNaturalSwatchOrder;this.displaySwatches=[];this.numberOfSwatchesPerRow=0;this.swatchPrototypeNode=l("#"+a.name).closest(n.SWATCH_NODE_SELECTOR);this.swatchPrototypeNodeParent=this.swatchPrototypeNode.parent();c.on("a:button-group:"+this.name+":toggle",function(a){var d=parseInt(a.selectedButton.buttonName,10),e=b.swatches[d];e?b.isPageRefreshActive?(b.isUserInteracting=
!0,d=e.unavailable,e.updateSelection(),b.autoNotificationCallback&&b.autoNotificationCallback(d,!0),b.onChange&&b.onChange(b.swatches,a.selectedButton,b.markAutoUpdated),b.setAutoUpdated(!1)):e.pageUrl&&(C.location.href=e.pageUrl):(a="Selected swatch not found on toggle button click. Value clicked: "+d+" ; Swatch length: "+Object.keys(b.swatches).length,A.log(a,v.ERROR,v.ATTRIBUTION))});this.registerHoverDeclarative("desktop-configurator-swatch-hover:"+a.name);this.registerHoverDeclarative("desktop-configurator-swatch-hover:"+
a.name+"_sec",!0);if(this.isTextSwatch)c.on("resize",function(){0<b.displaySwatches.length&&(b.repopulateDisplaySwatches(),b.alignTextSwatches(),b.alignTextSwatchNodesInLastRow(),"function"===typeof b.windowResizeCallback&&b.windowResizeCallback(b.name))})}a.prototype={setState:function(a,e,f,g){var b=this,k,l=[],q=[],n=[];c.objectIsEmpty(e)||(c.each(e,function(e,c){if(!b.swatches[c]&&(a.swatches[c].isVisible||f)){var g=new p(a.swatches[c],b.isTextSwatch,b.name,c,b.hideSlotsFromMainView,b.swatchPrototypeNode,
b.swatchPrototypeNodeParent);g.subscribeToHoverEvent(b.name);b.swatches[c]=g;!b.isTextSwatch&&b.swatches[c]&&b.swatches[c].domNode&&n.push(b.swatches[c].domNode.find(".inline-twister-manual-load")[0])}q[e]=c}),this.swatchIdxOrder=q,g||(this.resetToggleSwatchContainer(),this.displaySwatches=[]),c.each(this.swatchIdxOrder,function(a,d){if(a=b.swatches[a])a&&b.swatchListContainer.append(a.domNode),a&&a.subscribeToHoverEvent(b.name),b.addToDisplaySwatches(a,b.displaySwatches)}));c.each(a.swatches,function(a,
d){if(b.swatches[d])k=a.selected?b.swatches[d]:k,b.swatches[d].selected=!!a.selected,l.push({index:d,data:a});else{if(a.isVisible||f)b.swatches[d]=new p(a,b.isTextSwatch,b.name,d,b.hideSlotsFromMainView,b.swatchPrototypeNode,b.swatchPrototypeNodeParent),b.swatches[d].subscribeToHoverEvent(b.name),b.addToDisplaySwatches(b.swatches[d],b.displaySwatches),!b.isTextSwatch&&b.swatches[d]&&b.swatches[d].domNode&&n.push(b.swatches[d].domNode.find(".inline-twister-manual-load")[0]);a.selected&&(k=b.swatches[d])}});
this.selectedSwatch&&this.selectedSwatch.updateSelection();k&&k.updateSelection();c.each(l,function(a,d){b.swatches[a.index].setState(a.data,f,b.name,a.index)});this.isTextSwatch&&(c.objectIsEmpty(e)?this.alignTextSwatchNodesInLastRow():this.alignTextSwatches());b.selectedSwatch&&k&&b.selectedSwatch!==k&&!b.isUserInteracting&&b.autoNotificationCallback(!0);b.selectedSwatch=k;b.isUserInteracting=!1;n.length&&c.loadImageManually(n);return this},getSlotNodes:function(a){return c.map(this.displaySwatches,
function(e){return c.map(e,function(e){return e.getSlotNode(a)})})},setUserInteracting:function(a){this.isUserInteracting=a},alignTextSwatches:function(a,e){c.each(this.displaySwatches,function(c){g.alignTextSwatches(c,a,e)})},alignTextSwatchNodesInLastRow:function(){var a=this.domNode.find(".inline-twister-swatch:not(.aok-hidden):not(.swatch-prototype)");if(1<a.length){var e=a[a.length-1],f=a[a.length-2];e&&f&&e.getBoundingClientRect().top===f.getBoundingClientRect().top&&(a=c.map(a.slice(a.length-
(a.length%this.numberOfSwatchesPerRow||this.numberOfSwatchesPerRow),a.length),function(a){return this.swatches[a.getAttribute("data-idxInToggleSwatchList")]},this),g.alignTextSwatches(a))}},resetToggleSwatchContainer:function(){var a=l(this.domNode.find(".a-button-list").children()[0]);this.swatchListContainer.html("");this.swatchListContainer.append(a)},getVisibleSwatchesSize:function(){var a=0;c.each(this.swatches,function(e,c){e.isVisible&&(a+=1)});return 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,e){e=new p(a,this.isTextSwatch,this.name,a.name,this.hideSlotsFromMainView,this.swatchPrototypeNode,this.swatchPrototypeNodeParent,e);this.swatches[a.name]=e;this.initialVisibleSwatchList[a.name]=e;this.selectedSwatch=a.selected?e:this.selectedSwatch;
this.orderedSwatchList.push(e);return e},activatePageRefresh:function(){this.isPageRefreshActive=!0;this.domNode.find(".page-load-link").remove()},getSwatch:function(a){return this.swatches[a]?this.swatches[a]:{}},registerHoverDeclarative:function(a,e){var f=this;c.declarative(a,"mouseenter mouseleave",function(a){var b=a.$currentTarget[0].getAttribute("data-idxInToggleSwatchList"),b=f.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:e?b.id+"_sec":b.id,image:b.popoverImage};f.hoverHandler(f.name,a)})},addToDisplaySwatches:function(a,e){var c=f.ROW_IDENTIFIER_PREFIX;if(0===e.length)e.push([a]);else{var g=e[e.length-1];g&&g.length===this.numberOfSwatchesPerRow?e.push([a]):g.push(a)}this.removeSwatchRowIdentifier(a);a.domNode&&a.domNode.addClass(c+(e.length-1).toString())},repopulateDisplaySwatches:function(){if(0!==this.displaySwatches.length){var a=
[],e=0,g,p=this;c.each(this.displaySwatches,function(b,k){c.each(b,function(b,c){0===a.length?a.push([b]):0===e?(g=a[0][a[0].length-1],b.getTopPosition()!==g.getTopPosition()?(e=a[0].length,p.numberOfSwatchesPerRow=e,p.addToDisplaySwatches(b,a)):(a[0].push(b),p.removeSwatchRowIdentifier(b),b.domNode&&b.domNode.addClass(f.ROW_IDENTIFIER_PREFIX+(0).toString()))):p.addToDisplaySwatches(b,a)})});0===e&&(this.numberOfSwatchesPerRow=e=a[0].length);this.displaySwatches=a}},removeSwatchRowIdentifier:function(a){a.domNode&&
a.domNode.removeClass(function(a,d){return(d.match(/(^|\s)desktop-configurator-dim-row-\S+/g)||[]).join(" ")})},createDisplaySwatches:function(){var a=this;c.each(this.orderedSwatchList,function(e){a.addToDisplaySwatches(e,a.displaySwatches)})},removeMisplacedSwatch:function(){var a=this.displaySwatches[this.displaySwatches.length-1],e=a[a.length-1],c=e.name;e.domNode&&e.domNode.remove();delete this.swatches[c];this.selectedSwatch&&this.selectedSwatch.name===c&&(this.selectedSwatch=null);1<a.length?
a.pop():this.displaySwatches.pop()},removeInitiallyHiddenSwatches:function(){for(var a=this.domNode.find(".inline-twister-swatch.aok-hidden:not(.swatch-prototype)"),e=a.length-1;0<=e;e--){var c=a[e];c.parentNode.removeChild(c)}}};return a}(g,x),p=function(f){function g(a){this.mainText=a.mainText;this.subText=a.subText;this.dimKey=a.dimKey;this.titleSelectorPrefix=a.titleSelectorPrefix;this.titleValueSelector=a.titleValueSelector;this.domNode=l("#"+this.titleSelectorPrefix+this.dimKey)}g.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 c.equals(a,l.extend({},this))?this:(l.extend(this,a),this.refresh())},getData:function(){return{mainText:this.mainText,subText:this.subText}}};return g}(g),t=function(g,p,a){function d(a,d,g,b,k){function v(){x=x||t.domNode.find(".dimension-heading");x.css(q.BG_COLOR,q.GREEN_BG_COLOR);
c.delay(function(){c.animate(x,{"background-color":q.WHITE_BG_COLOR},200)},1E3)}var t=this;this.disableCollapseFunctionality=g.inlineTwisterData?g.inlineTwisterData.disableCollapseFunctionality:!1;this.stringTranslationMap=g.inlineTwisterData?g.inlineTwisterData.stringTranslationMap:{};this.title=d?new p(d):null;this.dimKey=g.dimKey;this.domNode=l("#"+a+this.dimKey);this.showSlot=g.showSlot;this.logger=k;this.isTwisterCoreInitialized=this.markAutoUpdated=!1;this.expanderContent=t.domNode.find(n.EXPANDER_CONTENT_PREFIX+
this.dimKey);this.expanderHeader=t.domNode.find(n.EXPANDER_HEADER_PREFIX+this.dimKey);this.icon=t.domNode.find(n.DIMENSION_EXPANDER_ICON_PREFIX+this.dimKey);this.expandedText=t.domNode.find(n.EXPANDED_DIMENSION_TEXT_PREFIX+this.dimKey);this.collapsedText=t.domNode.find(n.COLLAPSED_DIMENSION_TEXT_PREFIX+this.dimKey);this.rowCallbacks=b;this.autoNotificationExpanded=t.domNode.find(n.AUTO_NOTIFICATION_EXPANDED);this.autoNotificationExpandedText=t.autoNotificationExpanded.text();this.imageThumbnail=t.domNode.find(n.IMAGE_THUMBNAIL);
this.sideSheetLink=this.domNode.find(".tp-side-sheet-link-container");this.isExpanded=this.expanderContent.hasClass("dimension-expander-content-expand");var x;this.autoNotificationCallback=function(a,b){var e=t.autoNotificationExpandedText;a?t.isExpanded&&b?(t.autoNotificationExpanded.find("."+f.A_COLOR_ATTAINABLE).html(e),t.autoNotificationExpanded.removeClass(f.AOK_HIDDEN)):(v(),t.setAutoUpdated(!0)):t.hideAutoNotification()};this.disableCollapseFunctionality||c.declarative("toggle-dimension-expander-"+
this.dimKey,"click",function(a){t.isExpanded?t.collapse():t.expand();t.hideAutoNotification()})}d.prototype={setState:function(a,d,c,b,g,p){this.toggleSwatch&&c!==this.dimKey&&this.autoNotificationExpanded.addClass(f.AOK_HIDDEN);a&&this.toggleSwatch&&this.toggleSwatch.setState(a,d,g,p);g||b&&this.title&&this.title.setState(b)},expand:function(){this.expanderContent&&this.expanderContent.css("visibility","");this.expanderContent&&this.expanderContent.addClass(f.DIMENSION_EXPANDER_CONTENT_EXPAND);this.icon&&
this.icon.addClass(f.ROTATE);this.expandedText&&this.expandedText.removeClass(f.AOK_HIDDEN);this.collapsedText&&this.collapsedText.addClass(f.AOK_HIDDEN);this.imageThumbnail.addClass(f.AOK_HIDDEN);this.isExpanded=!0;var a={dimKey:this.dimKey};"function"===typeof this.rowCallbacks.handleDimensionExpansion&&this.isTwisterCoreInitialized&&this.rowCallbacks.handleDimensionExpansion(a,this.showSlot,!0);if(this.expanderHeader){var a=this.stringTranslationMap?this.stringTranslationMap.expanderHeaderAriaLabel:
"",d=this.title.getData(),a=a.replace("###dimension",d.mainText).replace("###value",d.subText),a=a+" "+(this.stringTranslationMap?this.stringTranslationMap.tapToCollapse:"");this.expanderHeader.attr("aria-label",a);this.expanderHeader.find(n.DIMENSION_EXPANDER_ICON_WRAPPER).attr("aria-label",a)}this.markAutoUpdated&&(this.logger.logDimExpansionAfterAutoUpdate(),this.markAutoUpdated=!1)},collapse:function(){this.expanderContent&&this.expanderContent.removeClass(f.DIMENSION_EXPANDER_CONTENT_EXPAND);
this.expanderContent&&this.expanderContent.css("visibility","hidden");this.icon&&this.icon.removeClass(f.ROTATE);this.expandedText&&this.expandedText.addClass(f.AOK_HIDDEN);this.collapsedText&&this.collapsedText.removeClass(f.AOK_HIDDEN);this.imageThumbnail.removeClass(f.AOK_HIDDEN);this.isExpanded=!1;var a={dimKey:this.dimKey};"function"===typeof this.rowCallbacks.handleDimensionExpansion&&this.isTwisterCoreInitialized&&this.rowCallbacks.handleDimensionExpansion(a,this.showSlot,!1);this.autoNotificationExpanded.addClass(f.AOK_HIDDEN);
if(this.expanderHeader){var a=this.stringTranslationMap?this.stringTranslationMap.expanderHeaderAriaLabel:"",d=this.title.getData(),a=a.replace("###dimension",d.mainText).replace("###value",d.subText),a=a+" "+(this.stringTranslationMap?this.stringTranslationMap.tapToExpand:"");this.expanderHeader.attr("aria-label",a);this.expanderHeader.find(n.DIMENSION_EXPANDER_ICON_WRAPPER).attr("aria-label",a)}},setUserInteracting:function(a){this.toggleSwatch&&this.toggleSwatch.setUserInteracting(a)},setExpanderHeaderAriaLabel:function(a,
d){a=this.expanderHeader.attr("aria-label").replace(a.subText,d.subText);this.expanderHeader.attr("aria-label",a);this.expanderHeader.find(n.DIMENSION_EXPANDER_ICON_WRAPPER).attr("aria-label",a)},setThumbnailImage:function(a){(a=g.getThumbnailImageUrlForPhysicalId(a))&&this.imageThumbnail.attr("src",a)},setAutoUpdated:function(a){this.markAutoUpdated=a;this.toggleSwatch&&this.toggleSwatch.setAutoUpdated(a)},getInitialVisibleSwatchList:function(){return this.toggleSwatch?this.toggleSwatch.getInitialVisibleSwatchList():
{}},getSwatch:function(a){return this.toggleSwatch?this.toggleSwatch.getSwatch(a):{}},activatePageRefresh:function(){this.toggleSwatch&&this.toggleSwatch.activatePageRefresh()},showSideSheetLink:function(){this.sideSheetLink.removeClass("aok-hidden")},hideSideSheetLink:function(){this.sideSheetLink.addClass("aok-hidden")},setMaxHeight:function(a){this.expanderContent.css("max-height",a)},triggerExpandOrCollapseAnimation:function(a,d,c){var b=this;this.expanderContent.animate({"max-height":a+"px"},
d,function(){b.setMaxHeight("");c&&c()})},getDisplaySwatches:function(){return this.toggleSwatch?this.toggleSwatch.displaySwatches:[]},createDisplaySwatches:function(){this.toggleSwatch&&this.toggleSwatch.createDisplaySwatches()},hideAutoNotification:function(){this.autoNotificationExpanded.addClass(f.AOK_HIDDEN)},initializeComponents:function(d,f,g){if(!this.toggleSwatch&&d){var b=this.title.getData();this.toggleSwatch=new a(d,{windowResizeCallback:g.handleWindowResize,autoNotificationCallback:this.autoNotificationCallback},
this.domNode,b.mainText)}this.isTextSwatch=d?d.isTextSwatch:!0;this.rowCallbacks=c.extend(this.rowCallbacks,g);this.totalSwatchCount=d?d.totalSwatchCount:0;this.showSlot=f;var k=this;c.declarative("open-desktop-configurator-side-sheet:"+this.dimKey,"click",function(){"function"===typeof k.rowCallbacks.showSideSheet&&k.isTwisterCoreInitialized&&(k.rowCallbacks.showSideSheet(k.dimKey,k.showSlot,k.title.getData()),k.hideAutoNotification())})},postInitialize:function(){this.isTwisterCoreInitialized=!0;
var a={dimKey:this.dimKey};this.toggleSwatch&&this.toggleSwatch.removeInitiallyHiddenSwatches();this.isExpanded&&this.rowCallbacks.handleDimensionExpansion(a,this.showSlot,!0)}};return d}(g,p,y);return{Swatch:x,ToggleSwatch:y,Title:p,Row:t,utils:g}});"use strict";A.when("A","detail-page-side-sheet-handlers").register("detail-page-side-sheet",function(c,g){function l(c){var l=c.id&&"string"===typeof c.id,q=1===x("#"+c.id).length;if(l&&q)this.id=c.id,this.shouldRenderHTMLString=!!c.shouldRenderHTMLString,
this.animationDuration=c.animationDuration||300,this.container=g.getContainer(c.id),this.onBeforeShow=c.onBeforeShow,this.onAfterHide=c.onAfterHide,l=c.width||580,(q=this.container)&&q.width(l),v(c.id,l),f.call(this);else throw c="Side sheet initialisation failed: "+(l?"Side sheet not present in DOM, or multiple instances of side sheet ID "+c.id+" exist":"Invalid Side sheet ID"),A.log(c,"ERROR","DetailPageSideSheet"),c;}function n(c){var f=this.container;c=this.shouldRenderHTMLString?x(c):x(c).clone();
f.html(c);c.css("display","block");f.removeClass("aok-hidden")}function f(){var f=this;c.declarative("close-detail-page-side-sheet:"+this.id,"click",function(){f.close()});c.declarative("open-detail-page-side-sheet:"+this.id,"click",function(c){f.open(c&&c.data?c.data.content:null)})}function q(c){c.code&&"escape"===c.code.toLowerCase()&&(this.close(),document&&document.removeEventListener("keydown",y))}function v(c,f){c=x("#"+c+"-background .close-button");c.length&&(c[0].style.marginRight=f+10+
"px")}var x=c.$,y=null;l.prototype={open:function(c){if(c&&"string"===typeof c){n.call(this,c);if(this.onBeforeShow)this.onBeforeShow();g.showSideSheet(this.id,this.animationDuration);y=q.bind(this);document&&document.addEventListener("keydown",y)}else A.log("Invalid side sheet content. Side sheet ID: "+this.id,"ERROR","DetailPageSideSheet")},close:function(){g.closeSideSheet(this.id,this.animationDuration);g.resetSideSheetContainer(this.container);if(this.onAfterHide)this.onAfterHide()},updateWidth:function(c){var f=
this.container;f&&f.width(c);v(this.id,c)},updateContent:function(c){c&&"string"===typeof c?n.call(this,c):A.log("Invalid side sheet content. Side sheet ID: "+this.id,"ERROR","DetailPageSideSheet")}};return l});"use strict";A.when("A").register("detail-page-side-sheet-handlers",function(c){function g(c,g){f("#"+c+" .detail-page-side-sheet-content").show(function(){n({right:"0px"},c,g)})}function l(c,g){f("#"+c+" .detail-page-side-sheet-content").show(function(){n({right:"-600px"},c,g)})}function n(g,
l,n){c.animate(f("#"+l+" .detail-page-side-sheet-content"),g,n)}var f=c.$;return{showSideSheet:function(c,l){f("body").css("overflow","hidden");f(".detail-page-side-sheet-darken-bg").removeClass("aok-hidden");f("#"+c).removeClass("aok-hidden");g(c,l)},closeSideSheet:function(c,g){l(c,g);f(".detail-page-side-sheet-darken-bg").addClass("aok-hidden");f("#"+c).addClass("aok-hidden");f("body").css("overflow","scroll")},getContainer:function(c){return f("#"+c).find(".detail-page-side-sheet-content")},resetSideSheetContainer:function(c){c.html("")}}})});