1let colorData;async function onLoadGetColorFinderData(){var e=$("#color-finder-listing").attr("data-attr-respath"),t=$("#color-finder-listing").attr("data-attr-selectedfamily");e&&$.ajax({url:e+".shade.json",method:"GET",data:{selectedShadeFamily:t},success:function(e){if(e.success){var t=e.shade;t.forEach(function(e,t){var a=Object.keys(revised_cc_listing.allShadeCategory),o=e.shadeFamily;-1===a.indexOf(o)?(revised_cc_listing.allShadeCategory[o]=[],revised_cc_listing.allShadeCategory[o].push(e)):revised_cc_listing.allShadeCategory[o].push(e)}),revised_cc_listing.allShadeCategory.all=[],revised_cc_listing.allShadeCategory.all=t,onCfLoadApplyFilter()}}})}function colorFinderShadeFamilyToggle(e){if(e){$(".colorFinderComponent").empty(),colorData=revised_cc_listing.allShadeCategory,colorData=colorData[e];for(var t=colorData,a=0;a<colorData.length/75;a++){$(".colorFinderComponent").append("<div class='color-grid-container-"+a+"' </div>");for(var o=0;o<(t.length>75?75:t.length);o++)$(".color-grid-container-"+a).append("<div data-attr-shadecode="+t[o].entityCode+" data-attr-shadename="+t[o].entityName+"data-attr-shaderedirect="+t[o].pageUrl+" class='color-swatch color-swatch-flat' style='background-color:"+t[o].shadeHexCode+"'></div>");t=t.length>75?t.slice(75):t}}$(".colorFinderComponent > div").on("mouseenter",function(){$(this).addClass("active"),zoomColors()}),$(".colorFinderComponent > div").on("mouseleave",function(){$(this).removeClass("active")})}function onCfLoadApplyFilter(){if(Object.keys(revised_cc_listing.filtersFromUrl).length>0&&revised_cc_listing.filtersFromUrl.hasOwnProperty("Shade")){var e=revised_cc_listing.filtersFromUrl.Shade;"object"==typeof e&&(e=e[0]),$(".colour-family-tab-cf").removeClass("active"),$("li .colourCodeWrap span[data-attr-family='"+e.toLowerCase()+"']").parents(".colour-family-tab-cf").addClass("active"),revised_cc_listing.activeShadeTab=e.toLowerCase(),colorFinderShadeFamilyToggle(e.toLowerCase())}}function zoomColors(){$(".active .color-swatch").click(function(){$(".color-swatch__content")&&$(".color-swatch__content").remove(),$(".color-swatch-selected").removeClass("color-swatch-selected").addClass("color-swatch-flat"),$(this).addClass("color-swatch-selected");let e=$(this).attr("data-attr-shadecode"),t=$(this).attr("data-attr-shadename");$(this).append('<div class="color-swatch__content"><p class="color-swatch__content__number">'+e+'<span class="close-icon-swatch">x</span></p><p class="color-swatch__content__name text-capitalize">'+t+"</p></div>")})}$(document).ready(function(){$("#color-finder-listing").length>0&&(revised_cc_listing.allFeatures.fetchUrlForActiveFilter(),onLoadGetColorFinderData(),$(".colorFinderComponent > div").on("mouseenter",function(){$(this).addClass("active"),zoomColors()}),$(".colorFinderComponent > div").on("mouseleave",function(){$(this).removeClass("active")}),$(".activeColorFamily").parent().parent().parent().addClass("active"),$(".activeColorFamily").siblings().addClass("deactiveColorFamily")),$(".js-colourCatalouge-colorFilter--list .colourCatalouge-colorFilter--list--items .colourName").on("click",function(){if(!$(this).find(".colourCodeWrap span").eq(0).hasClass("activeColorFamily")){$(".colour-family-tab-cf .colourCodeWrap span").removeClass("activeColorFamily").removeClass("deactiveColorFamily"),$(this).parents(".colour-family-tab-cf").find(".colourCodeWrap span").eq(0).addClass("activeColorFamily"),$(".colour-family-tab-cf").removeClass("active").not($(this).parents(".colour-family-tab-cf").addClass("active"));let e=$(this).parents(".colour-family-tab-cf").find(".colourCodeWrap span").eq(0).attr("data-attr-family");revised_cc_listing.activeShadeTab=e.toLowerCase(),e&&(colorFinderShadeFamilyToggle(e.toLowerCase()),revised_cc_listing.allFeatures.uniqueURL())}}),document.getElementsByClassName("colorFinderComponent").length>0&&($(".ccforms").addClass("d-none d-lg-block"),$(".colorcatalogueform").addClass("d-block"))}),$(".js-colorfinder-form").click(function(){let e=$("#globalFormPopUp");modalHandler.showModal(e);let t=$(".color-swatch.color-swatch-selected").css("background-color");$(".modal__variant-colorCatalogueFormPopup .modal-header").css({"background-color":t})}),$(window).scroll(function(){$(window).scrollTop()+$(window).height()>$(document).height()-15?$(".colorFinderForm").css("bottom","100px"):$(".colorFinderForm").css("bottom","0px")}),$(document).on("click",".iconsWithText__wrap.visible-mobile.minimalistic-footer",function(){$(".colorFinderForm").toggleClass("color-finder-stickyform")}),$(document).on("click",".color-swatch-flat",function(e){if($(".color-swatch-selected").length>0){const e=document.querySelector(".color-swatch-selected");e.addEventListener("click",t=>{if(t.target==t.currentTarget){const t=e.getAttribute("data-attr-shaderedirect");window.open(t,"_blank")}})}else void 0}),$(document).on("click",".close-icon-swatch",function(){$(".color-swatch-selected").empty(),$(".color-swatch.color-swatch-flat").removeClass("color-swatch-selected")});let swatchOrderLink=$(".quickview-common-wrap").attr("data-swatch-orderlink"),swatchOrderLinkText=$(".quickview-common-wrap").attr("data-swatch-orderlinktext"),swatchJumpLink=$(".quickview-common-wrap").attr("data-swatch-jumplink"),swatchJumpLinkText=$(".quickview-common-wrap").attr("data-swatch-jumplinktext"),ccLeadFormId=$("#getToForm").attr("cc-form-id");const colorOfTheYear=$(".colorOfTheYear-js"),freePaintConsultationComp=$(".freePaintConsultation-js");let popupCtaPlaystorePathMobile=$(".colour-app-link").attr("data-attr-ccpopupctaplaystorepathmobile"),popupCtaAndriodAppPathMobile=$(".colour-app-link").attr("data-attr-ccpopupctaandriodapppathmobile"),popupCtaAppstorePathMobile=$(".colour-app-link").attr("data-attr-ccpopupctaappstorepathmobile"),popupCtaIosAppPathMobile=$(".colour-app-link").attr("data-attr-ccpopupctaiosapppathmobile"),selectedFamily=$("#cc-listing").attr("data-attr-selectedfamily"),shadeMapperCheckbox=$("#cc-listing").attr("data-attr-shadeMapper"),colourFinderBannerPosition=$("#colorCatalogueListForm-apRvm").attr("data-colourFinderBannerPosition"),languageCode=document.getElementById("GlobalPath").value;languageCode=languageCode.includes("/ap/eg/en/home")?"ab":"en",null!=colourFinderBannerPosition&&""!=colourFinderBannerPosition||(colourFinderBannerPosition=0),colourFinderBannerPosition>0&&(colourFinderBannerPosition-=1);let colourFinderBannerURL=$("#colorCatalogueListForm-apRvm").attr("data-colorfinder-url");null!=colourFinderBannerURL&&""!=colourFinderBannerURL||(colourFinderBannerURL="");
1let colourFinderBannerText=$("#colorCatalogueListForm-apRvm").attr("data-colorfinder-text");null!=colourFinderBannerText&&""!=colourFinderBannerText||(colourFinderBannerText="");let colourFinderTarget=$("#colorCatalogueListForm-apRvm").attr("data-colorfinder-target");function colorFamilySelector(){$(".js-colorfamilySelector").each(function(){1===$(this).find(".colourCodeWrap span").length?$(this).addClass("singleColour"):$(this).addClass("doubleColour")}),$(".js-colourCatalouge-colorFilter--list .colourCatalouge-colorFilter--list--items .colourName").on("click",function(){if(!$(this).find(".colourCodeWrap span").eq(0).hasClass("activeColorFamily")){$(".js-colorfamilySelector .colourCodeWrap span").removeClass("activeColorFamily").removeClass("deactiveColorFamily"),$(this).parents(".js-colorfamilySelector").find(".colourCodeWrap span").eq(0).addClass("activeColorFamily"),$(".js-colorfamilySelector").removeClass("active").not($(this).parents(".js-colorfamilySelector").addClass("active"));let e=$(this).parents(".js-colorfamilySelector").find(".colourCodeWrap span").eq(0).attr("data-attr-family");revised_cc_listing.activeShadeTab=e.toLowerCase(),revised_cc_listing.appliedFilters={},revised_cc_listing.allFeatures.shadeFamilyToggle(e.toLowerCase()),revised_cc_listing.allFeatures.uniqueURL(),swatchClick()}})}function pdQuickView(e){var t=e.parent();$($(".quickview-common-wrap")).insertAfter(t),$(".quickview-common-wrap").show("slow"),$(".PD-quickview-wrap").css("display","flex");$(".quickview-btns-flex .linkBtn");var a=$(".colorwrap > div"),o=$(".preview-section--img-carousel > div");$(".color-title > h3").text(e.find(".cc-swatch--desc--colorName").text()),$(".color-title > p").text("COLOUR CODE -"+e.find(".cc-swatch--desc--skucode").text()),$(".quickview-btns-flex .linkBtn > a, .quickview-btns-flex .whiteBtn > a").attr("href",e.data("pageurl")),$(".linkBtn-mweb").attr("href",e.data("pageurl"));var i=$(".preview-section--img-carousel > div").map(function(){return $(this).data("positionnumber")});function l(e){a.removeClass("selectedGrow"),a.children("div").removeClass("selectedItem"),e.addClass("selectedGrow"),e.children("div").addClass("selectedItem"),$(".color-title > h3").text(e.data("colorname")),$(".color-title > p").text("COLOUR CODE -"+e.data("colorcode")),$(".quickview-btns-flex .linkBtn > a, .quickview-btns-flex .whiteBtn > a").attr("href",e.data("url"));let t=e.data("colorcode")+"";$(".topfiftycolors").length||recently_viewed_shades.updateRecentViewedShades(t)}a.click(function(){current_shade=$(this),l(current_shade);for(var e=$(this).attr("data-positionnumber"),t=0;t<=i.length;t++)$(o[t]).removeClass("active"),e==i[t]&&$(o[t]).addClass("active")}),$(".preview-section--img-carousel .caretUpIcon").click(function(){var e=Number($(this).siblings(".active").attr("data-positionnumber"));e<i.length-1?e+=1:e=0;for(var t=0;t<i.length;t++){if($(o[t]).removeClass("active"),i[t]==e)$(o[t]).addClass("active"),l($(a[t]))}}),$(".preview-section .close-btn").click(function(){closePDQuickview(),$("html, body").css("overflow","visible")})}function closePDQuickview(){$(".quickview-common-wrap").hide(),$(".PD-quickview-wrap")&&($(".PD-quickview-wrap").hide(),$(".PD-quickview-wrap").removeClass("show-extended-color")),$(".colorwrap > div, .preview-section--img-carousel > div")&&$(".colorwrap > div, .preview-section--img-carousel > div").remove()}
1function renderSwatches(e,t,a=null,o){var i=$(".color-swatch-row").length,l=0,r=0;$(".color-swatch-row-index-"+i+" li").length>=4&&i++;for(var c=0==i?0:i-1;c<=Math.ceil(t/4)&&!(r>=e.length);c++){$(".color-swatch-row-index-"+c).length?(l=$(".color-swatch-row-index-"+c+" li").length)>=4&&(l=0,++c,$("#colorCatalogueListForm-apRvm").append("<li><ul class='color-swatch-row color-swatch-row-index-"+c+"' ></ul></li>")):(l=0,$("#colorCatalogueListForm-apRvm").append("<li><ul class='color-swatch-row color-swatch-row-index-"+c+"' ></ul></li>"));for(var s=l;s<(e.length>4?1==c&&null!==a?3:4:e.length)&&!(r>=e.length);s++){var n=e[r++],d="<li class='cc-swatch-list js-colorCatRevampCardList loadmoreItem' data-cftype="+revised_cc_listing.cfType+" data-pageurl="+n.pageUrl+" data-pagenumber="+n.pageNumber+"> <div class='cc-swatch'> <span data-attr-sku="+n.entityCode+" data-attr-action='like' data-attr-type='shades' class='spriteIcon-Aprevamp favouriteIcon color-catalogue-revamp-list--wishList' onclick='event.stopPropagation(); wishListPage.wishlistAction(event, true)'></span> <div class='cc-swatch--colorcode' style='background-color: "+n.shadeHexCode+"'></div> <div class='cc-swatch--desc'> <p title="+n.entityName+" class='cc-swatch--desc--colorName text-capitalize'>"+n.entityName+" <span class='spriteIcon-Firstfold rightArrow'></span> </p> <p class='cc-swatch--desc--skucode'>"+n.entityCode+"</p> </div> </div></li>";if($(".color-swatch-row-index-"+c).append(d),o)if(1==c&&2==s){let e=$(".color-swatch-row-index-"+c+" > li");$(a).insertAfter($(e[s]))}else 2==c&&$(colorOfTheYear).insertAfter($(".color-swatch-row-index-"+c))}}if(null!=colourFinderBannerPosition&&null==$(".cc-shadelists").attr("data-hideshowccoform")){$("#bannerTemplate a").append($("#colorCatalogueListForm-apRvm a.colour-finder-barWrap")),$($("#colorCatalogueListForm-apRvm")).find("a.colour-finder-barWrap").remove();let e=$($("#colorCatalogueListForm-apRvm > li ul")[colourFinderBannerPosition]),t="<a href='"+colourFinderBannerURL+"' target='"+colourFinderTarget+"'class='colour-finder-barWrap color-finder-js mb-4'aria-label='"+colourFinderBannerText+"'><p>"+colourFinderBannerText+"</p><span class='spriteIcon-Firstfold rightArrow cc-rightArrow-icon float-right'></span>";e.parent().append(t)}}function ccFilterAccordion(){$(document).on("click",".js-left-swatch-filter--Accordion .filter-accordion-title",function(){$(this).hasClass("active-filter")?($(this).removeClass("active-filter"),$(this).next(".filter-accordion-options").slideUp(500)):($(this).addClass("active-filter"),$(this).next(".filter-accordion-options").slideDown(500))})}function toggleFilterOption(){$(".js-optionSelection-box").on("click",function(){$(this).toggleClass("activeOption")})}function mobileCCFilter(){$(".js-left-swatch-filter--head").on("click",function(){$(this).next(".js-left-swatch-filter--Accordion").addClass("mobile-Filter-active"),$(".filter-accordion-title").each(function(e,t){$(t).hasClass("active-filter")||($(t).addClass("active-filter"),$(".filter-accordion-options").slideDown(500))})})}function clearallFilters(){$(".js-clearcta").on("click",function(){$(".customCheckBox-checked").parent().each(function(){onFilterApplyRemove($(this))}),$(".js-optionSelection-box").removeClass("activeOption"),$(".js-left-swatch-filter--Accordion").removeClass("mobile-Filter-active"),$(".filter-accordion-title").removeClass("active-filter"),$(".filter-accordion-options").slideUp(500)})}function applyCCFilter(){$(".js-applycta").on("click",function(){$(".js-left-swatch-filter--Accordion").removeClass("mobile-Filter-active"),$(".filter-accordion-title").removeClass("active-filter"),$(".filter-accordion-options").slideUp(500)})}null!=colourFinderTarget&&""!=colourFinderTarget||(colourFinderTarget="_self"),$(".quickview-cta > span").on("click",function(){$(this).toggleClass("caretDownIcon caretUpIcon"),$(".PD-quickview-wrap").toggleClass("show-extended-color"),$(".colour-preview").css("background-color",$(".selectedGrow").css("background-color"))});var revised_cc_listing={allShadeCategory:{},allFeatures:{}
1,activeShadeTab:"all",visibleSwatchIndex:parseInt($(".js-shadeRevamp-colorLoadMoreBtn").attr("data-loadmore-on-pageload"))||0,loadMoreOnPageLoad:parseInt($(".js-shadeRevamp-colorLoadMoreBtn").attr("data-loadmore-on-pageload"))||0,loadMore:parseInt($(".js-shadeRevamp-colorLoadMoreBtn").attr("data-loadmore-on-click"))||0,eachFamilyFilters:{},appliedFilters:{},filteredSwatch:[],filtersFromUrl:{},colorFinderPageUrl:$("#colorCatalogueListForm-apRvm").attr("data-colorfinder-url"),colorFinderText:$("#colorCatalogueListForm-apRvm").attr("data-colorfinder-text"),selectedFamily:$("#cc-listing").attr("data-attr-selectedfamily"),cfType:"Shade",shadeMapperCheckbox:$("#cc-listing").attr("data-attr-shadeMapper"),allFeatures:{ajaxOnLoad:function(){var e=$("#cc-listing").attr("data-attr-respath");e&&$.ajax({url:e+".shade.json",method:"GET",data:{selectedShadeFamily:selectedFamily,language:languageCode,shadeMapper:shadeMapperCheckbox},success:function(e){if(e.success){var t=e.shade;t.forEach(function(e,t){var a=Object.keys(revised_cc_listing.allShadeCategory),o=e.shadeFamily;-1===a.indexOf(o)?(revised_cc_listing.allShadeCategory[o]=[],revised_cc_listing.allShadeCategory[o].push(e)):revised_cc_listing.allShadeCategory[o].push(e)}),revised_cc_listing.allShadeCategory.all=[],revised_cc_listing.allShadeCategory.all=t,Object.keys(revised_cc_listing.allShadeCategory).forEach(function(e,t){var a=revised_cc_listing.allShadeCategory[e];revised_cc_listing.eachFamilyFilters.hasOwnProperty(a)||(revised_cc_listing.eachFamilyFilters[e]={},revised_cc_listing.allShadeCategory[e].forEach(function(t,a){var o=t.filterTitle;Object.keys(o).forEach(function(t,a){revised_cc_listing.eachFamilyFilters[e].hasOwnProperty(t)?o[t].forEach(function(a,o){if(revised_cc_listing.eachFamilyFilters[e][t].hasOwnProperty(a)){var i=revised_cc_listing.eachFamilyFilters[e][t][a];i++,revised_cc_listing.eachFamilyFilters[e][t][a]=i}else revised_cc_listing.eachFamilyFilters[e][t][a]=1}):(revised_cc_listing.eachFamilyFilters[e][t]=[],o[t].forEach(function(a,o){revised_cc_listing.eachFamilyFilters[e][t][a]=1}))})})),revised_cc_listing.eachFamilyFilters[e]=sortObjectByKeys(revised_cc_listing.eachFamilyFilters[e]),Object.keys(revised_cc_listing.eachFamilyFilters[e]).forEach(function(t,a){Object.keys(revised_cc_listing.eachFamilyFilters[e][t]).length>=1&&(revised_cc_listing.eachFamilyFilters[e][t]=sortObjectByKeys(revised_cc_listing.eachFamilyFilters[e][t]))});var o=$("#cc-listing").attr("data-attr-filterorder"),i=$("#cc-listing").attr("data-attr-subfilterorder"),l=[];o&&(l=o.split(","));var r=[];i&&(r=i.split(","));for(var c={},s=0;s<l.length;s++)revised_cc_listing.eachFamilyFilters[e].hasOwnProperty(l[s])&&(c[l[s]]=revised_cc_listing.eachFamilyFilters[e][l[s]]);Object.keys(c).forEach(function(e,t){if(c.hasOwnProperty(e)){for(var a=c[e],o={},i=0;i<r.length;i++)a.hasOwnProperty(r[i])&&(o[r[i]]=a[r[i]]);for(var l=Object.keys(c[e]),s=0;s<l.length;s++)o.hasOwnProperty(l[s])||(o[l[s]]=c[e][l[s]]);c[e]=o}}),revised_cc_listing.eachFamilyFilters[e]=c}),revised_cc_listing.allFeatures.onLoadApplyFilter()}},error:function(e){}})},shadeFamilyToggle:function(e){if(closePDQuickview(),$(".js-shadeRevamp-colorLoadMoreBtn").show(),revised_cc_listing.allShadeCategory.hasOwnProperty(e)){$(".js-colorCatRevampCardList").remove();var t=revised_cc_listing.loadMoreOnPageLoad;revised_cc_listing.allShadeCategory[e].length<t&&(t=revised_cc_listing.allShadeCategory[e].length,$(".js-shadeRevamp-colorLoadMoreBtn").hide());let a=freePaintConsultationComp;$(".color-swatch-row").remove(),renderSwatches(revised_cc_listing.allShadeCategory[e].slice(0,t),t,a,!0),toggleFilterOption(),FilterscrollToShade()}revised_cc_listing.eachFamilyFilters.hasOwnProperty(e)&&(Object.keys(revised_cc_listing.eachFamilyFilters[e]).forEach(function(t,a){if(Object.keys(revised_cc_listing.eachFamilyFilters[e][t]).length>=1){var o="<p class='shade-revamp-filter--filterLabel-js filter-accordion-title active-filter'>"+t.toUpperCase()+" <span class='js-accordion-icon spriteIcon-Firstfold caretDownIcon'></span></p><ul class='filter-accordion-options shade-revamp-FilterListArea-js'>";
1Object.keys(revised_cc_listing.eachFamilyFilters[e][t]).forEach(function(a,i){o=o+"<li class='shade-revamp-filter--filterArea-js' data-attr-filtername='"+a+"' data-attr-parentfilter='"+t+"' onclick='onFilterApplyRemove(this);'> <span class='optionSelection-box js-optionSelection-box'></span> "+a+" ("+revised_cc_listing.eachFamilyFilters[e][t][a]+")</li>"}),o+="</ul>",$(".shade-revamp-filter--List-js").append(o)}}),FilterscrollToShade()),revised_cc_listing.filteredSwatch=[]},showFilteredSwatch:function(e){colorOfTheYear.hide(),closePDQuickview(),revised_cc_listing.filteredSwatch.length>revised_cc_listing.visibleSwatchIndex?$(".js-shadeRevamp-colorLoadMoreBtn").show():$(".js-shadeRevamp-colorLoadMoreBtn").hide();$(".freePaintConsultation-js");if($(".color-swatch-row").remove(),revised_cc_listing.allShadeCategory.hasOwnProperty(e)){$(".js-colorCatRevampCardList").remove();var t=revised_cc_listing.loadMoreOnPageLoad;revised_cc_listing.filteredSwatch.length<t&&(t=revised_cc_listing.filteredSwatch.length,$(".js-shadeRevamp-colorLoadMoreBtn").hide()),renderSwatches(revised_cc_listing.filteredSwatch.slice(0,t),t,null,!1)}},shadeFamilyLoadMore:function(e,t,a){if(revised_cc_listing.allShadeCategory.hasOwnProperty(e)){var o=a;revised_cc_listing.allShadeCategory[e].length<=o&&(o=revised_cc_listing.allShadeCategory[e].length,$(".js-shadeRevamp-colorLoadMoreBtn").hide()),renderSwatches(revised_cc_listing.allShadeCategory[e].slice(t,a),o,null,!1)}},filterDataLoadMore:function(e,t){var a=t;revised_cc_listing.filteredSwatch.length<=a&&(a=revised_cc_listing.filteredSwatch.length,$(".js-shadeRevamp-colorLoadMoreBtn").hide()),renderSwatches(revised_cc_listing.filteredSwatch.slice(e,t),a,null,!1)},uniqueURL:function(){var e=revised_cc_listing.appliedFilters;ccAnalytics.trackFilterBtn(e);var t={};revised_cc_listing.activeShadeTab.toLowerCase()!=="all".toLowerCase()&&(t.Shade=[],t.Shade.push(revised_cc_listing.activeShadeTab.toLowerCase()));var a={...t,...e},o=Object.keys(a),i="";if(o.forEach(function(e,t){var l=a[e];l.forEach(function(t,a){0===a&&(i=i+e+":"),i+=t,a!==l.length-1&&(i+=",")}),t!==o.length-1&&(i+="&")}),""!==i){window.location.href.includes("?f")&&(i="?f="+encodeURIComponent(i),window.history.replaceState({},"",i))}else i=window.location.href.split("?")[0],window.history.replaceState({},"",i)},fetchUrlForActiveFilter:function(){let e={},t=decodeURIComponent(window.location.href);-1!=t.indexOf("?")&&(-1!=t.indexOf("?f=")?t=t.substr(t.indexOf("?f=")+3,t.length):-1!=t.indexOf("&f=")&&(t=t.substr(t.indexOf("&f=")+3,t.length)),t=t.split("&"),$.each(t,function(t,a){let o=a.split(":");2==o.length&&(e[o[0]]=unescape(o[1]).split(","))})),revised_cc_listing.filtersFromUrl=e},onLoadApplyFilter:function(){var e={},t=Object.keys(revised_cc_listing.filtersFromUrl);if(t.length>0){if(revised_cc_listing.filtersFromUrl.hasOwnProperty("Shade")){var a=revised_cc_listing.filtersFromUrl.Shade;"object"==typeof a&&(a=a[0]),$(".js-colorfamilySelector").removeClass("active"),$("li .colourCodeWrap span[data-attr-family='"+a.toLowerCase()+"']").parents(".js-colorfamilySelector").addClass("active"),revised_cc_listing.activeShadeTab=a.toLowerCase(),revised_cc_listing.allFeatures.shadeFamilyToggle(a.toLowerCase()),revised_cc_listing.activeShadeTab.toLowerCase()==="all".toLowerCase()&&a.toLowerCase()==="all".toLowerCase()||(e.Shade=[],e.Shade.push(a))}for(var o=0;o<t.length;o++){let e=t[o];if("Shade"!==e)for(var i=revised_cc_listing.filtersFromUrl[e],l=0,r=0;r<i.length;r++){let t=i[r];setTimeout(clickOnFilters(t),l),l+=100,revised_cc_listing.appliedFilters.hasOwnProperty(e)?-1!==$.inArray(t,revised_cc_listing.appliedFilters[e])&&revised_cc_listing.appliedFilters[e].push(t):(revised_cc_listing.appliedFilters[e]=[],revised_cc_listing.appliedFilters[e].push(t))}}}var c=revised_cc_listing.appliedFilters,s={...e,...c},n=Object.keys(s),d="";if(n.forEach(function(e,t){var a=s[e];a.forEach(function(t,o){0===o&&(d=d+e+":"),d+=t,o!==a.length-1&&(d+=",")}),t!==n.length-1&&(d+="&")}),""!==d){window.location.href.includes("?f")&&(d="?f="+encodeURIComponent(d),window.history.replaceState({},"",d))}else d=window.location.href.split("?")[0]}}};function clickOnFilters(e){$("li[data-attr-filtername='"+e+"']").trigger("click")}function toggleMobileFilterCatalogue(e){window.innerWidth<1e3&&(e?($(".js-filterMainArea").show(),$("html").addClass("disable-overflow")):($(".js-filterMainArea").hide(),$("html").removeClass("disable-overflow")))}function onFilterApplyRemove(e){u=(u=$(e).attr("data-attr-filtername")).toLowerCase();var t=$(e).attr("data-attr-parentfilter");t=t.toLowerCase(),revised_cc_listing.filteredSwatch=[];var a=!1;$(e).find("span:first").hasClass("selected")?($(e).find("span:first").removeClass("customCheckBox-checked activeOption").removeClass("selected").addClass("customCheckBox-unchecked"),a=!1):($(e).find("span:first").removeClass("customCheckBox-unchecked").addClass("customCheckBox-checked activeOption").addClass("selected"),a=!0),a?(colorOfTheYear.hide(),revised_cc_listing.a
1ppliedFilters.hasOwnProperty(t)?-1==$.inArray(u,revised_cc_listing.appliedFilters[t])&&revised_cc_listing.appliedFilters[t].push(u):(revised_cc_listing.appliedFilters[t]=[],revised_cc_listing.appliedFilters[t].push(u))):(colorOfTheYear.css("display","flex"),revised_cc_listing.appliedFilters[t].forEach(function(e,a){e&&e.toLowerCase()===u&&(revised_cc_listing.appliedFilters[t].splice(a,1),0===revised_cc_listing.appliedFilters[t].length&&delete revised_cc_listing.appliedFilters[t])}));for(var o=Object.keys(revised_cc_listing.appliedFilters),i=revised_cc_listing.allShadeCategory[revised_cc_listing.activeShadeTab.toLowerCase()],l=0;l<i.length;l++){for(var r=!1,c=i[l].filterTitle,s=0;s<o.length;s++)if(r=!1,c.hasOwnProperty(o[s]))for(var n=revised_cc_listing.appliedFilters[o[s]],d=0;d<n.length;d++)if(r=!1,-1!==$.inArray(n[d],c[o[s]])){r=!0;break}r&&revised_cc_listing.filteredSwatch.push(i[l])}0!==revised_cc_listing.filteredSwatch.length?revised_cc_listing.allFeatures.showFilteredSwatch(revised_cc_listing.activeShadeTab.toLowerCase()):(revised_cc_listing.allFeatures.shadeFamilyToggle(revised_cc_listing.activeShadeTab.toLowerCase()),revised_cc_listing.allFeatures.uniqueURL());var p=[];revised_cc_listing.filteredSwatch.forEach(function(e,t){Object.keys(e.filterTitle).forEach(function(t,a){e.filterTitle[t].forEach(function(e,t){-1===$.inArray(e,p)&&p.push(e)})})});for(var h=$(".shade-revamp-filter--filterArea-js"),v=0;v<h.length;v++){var u;u=(u=$(h[v]).attr("data-attr-filtername")).toLowerCase(),p.length>0&&-1===$.inArray(u,p)?h[v].classList.add("disabledElement"):h[v].classList.remove("disabledElement")}revised_cc_listing.allFeatures.uniqueURL(),swatchClick()}function clearAllForColourListing(){revised_cc_listing.filteredSwatch=[],revised_cc_listing.allFeatures.shadeFamilyToggle(revised_cc_listing.activeShadeTab.toLowerCase()),revised_cc_listing.allFeatures.uniqueURL()}function sortObjectByKeys(e){return Object.keys(e).sort().reduce((t,a)=>(t[a]=e[a],t),{})}function listStaticCompo(){let e=window.innerWidth>=1e3?20:15;$(".js-colorCatRevampCardList a").parent()&&$(".js-colorCatRevampCardList a").parent().length>e?$(".js-colorCatRevampCardList a").parent().eq(e).after($(".js-colorCatRevampStaticComp-apRvm")):$(".js-colorCatRevampCardList a").parent().length>9&&window.innerWidth<1e3?$("js-colorCatRevampCardList a").parent().after($(".js-colorCatRevampStaticComp-apRvm")):$(".js-colorCatRevampCardList a").parent().eq($(".js-colorCatRevampCardList a").parent().length-1).after($(".js-colorCatRevampStaticComp-apRvm"))}function listingColorCatalogueForm(){if(window.innerWidth>=1e3)$("#colorCatalogueListForm-apRvm").before($(".colorCatalogueListForm-apRvm li")),$(".js-colorCatalogueList .js-colorCatRevampCardList a").parent().length<=9?($(".js-colorCatalogueList .js-colorCatRevampCardList a").parent().eq(0).after($("#colorCatalogueListForm-apRvm")),$(".js-colorCatalogueList .js-colorCatRevampCardList a").parent().each((e,t)=>{e+1<=9&&$("#colorCatalogueListForm-apRvm .colorCatalogueListForm-apRvm").append($(t))})):($(".js-colorCatalogueList .js-colorCatRevampCardList a").parent().eq(4).after($("#colorCatalogueListForm-apRvm")),$(".js-colorCatalogueList .js-colorCatRevampCardList a").parent().each((e,t)=>{e+1>5&&e+1<=14&&$("#colorCatalogueListForm-apRvm .colorCatalogueListForm-apRvm").append($(t))}));else{let e=24;$(".js-colorCatRevampCardList a").parent()&&$(".js-colorCatRevampCardList a").parent().length>=e?$(".js-colorCatRevampCardList a").parent().eq(e).after($("#colorCatalogueListForm-apRvm")):$(".js-colorCatRevampCardList a").parent().eq($(".js-colorCatRevampCardList a").parent().length-1).after($("#colorCatalogueListForm-apRvm"))}setTimeout(function(){listStaticCompo()},1e3)}ccFilterAccordion(),toggleFilterOption(),mobileCCFilter(),clearallFilters(),applyCCFilter(),colorFamilySelector(),$(window).scroll(sticky_relocate),sticky_relocate(),$(window).on("load",function(){$(".selected-color-tab-label-mweb").removeClass("d-none"),$(".selected-color-tab-label-desktop").removeClass("d-none"),getSelectedColorTabLabelInMWeb(),swatchClick()}),getAPMobileApp=function(){let e=navigator.userAgent||navigator.vendor||window.opera;/android/i.test(e)&&triggerAndriodAppOpenMobile(),/iPad|iPhone|iPod/.test(e)&&triggerIosAppOpenMobile()};let triggerAndriodAppOpenMobile=function(){popupCtaAndriodAppPathMobile?window.location.replace(popupCtaAndriodAppPathMobile):setTimeout(window.location.replace(popupCtaPlaystorePathMobile),250)},triggerIosAppOpenMobile=function(){popupCtaIosAppPathMobile?window.location.replace(popupCtaIosAppPathMobile):setTimeout(window.location.replace(popupCtaAppstorePathMobile),250)};function getSelectedColorTabLabelInMWeb(){let e=$(".active .colourName").text();$(".selected-color-tab-label-mweb").text(e),$(".selected-color-tab-label-desktop").text(e)}function swatchClick(){$(".js-scroll-to-form").click(function(){scrollToForm()}),$(".js-colorCatRevampCardList.loadmoreItem").click(function(){let e=$(this).find(".cc-swatch--desc--skucode").text().trim();recently_viewed_shades.updateRecentViewedShades(e)}),$(".js-colorCatRevampCardList").click(function(){$(window).width()<768&&($("html, body").css("overflow","hidden"),$("div.headerUnification_sticky").length>0?$(".preview-section .favouriteIcon, .preview-section .close-btn").css({top:"15p
1x"}):$(".preview-section .favouriteIcon, .preview-section .close-btn").css({top:"110px"})),$(".cc-swatch--colorcode").removeClass("active");var e=$(this);e.find(".cc-swatch--colorcode").addClass("active"),closePDQuickview();let t=$(this).attr("data-pagenumber"),a=$(this).find(".cc-swatch--desc--skucode").text();$.ajax({type:"GET",url:"/apcolourcatalogue/shadelistingpalette.json",data:{cfType:revised_cc_listing.cfType,pageNumber:t,language:languageCode},success:function(t){if(t&&t.success){$(".colorwrap").empty(),$(".js-icon-append").empty();let e=t.shadepalette;for(var o in $(".PD-quickview-wrap").css("display","flex"),e){let t=e[o].entityCode,s=a==t?"selectedGrow":"",n=a==t?"selectedItem":"",d=a==t?"active":"";var i="<div tabindex='0' data-positionnumber="+o+" data-colorname='"+e[o].entityName+"' data-colorcode="+e[o].entityCode+" data-url="+e[o].pageUrl+" class='focus-visible-auto-imp "+s+"' style='background-color:"+e[o].shadeHexCode+"'><div class='"+n+"'></div></div>";$(".colorwrap").append(i);var l=" <p>"+e[o].entityDescription+"</p>";$(".color-body").html(l);var r="<div id='img"+o+"' class='"+d+"' data-positionnumber="+o+"><picture><source media='(max-width:575px)' srcset="+e[o].naturalMobileRoomShots+" class='listingImg' /><img src="+e[o].naturalDesktopRoomShots+" /><span data-attr-sku="+e[o].entityCode+" data-attr-action='like' data-attr-type='shades' class='spriteIcon-Aprevamp favouriteIcon color-catalogue-revamp-list--wishList' onclick='event.stopPropagation(); wishListPage.wishlistAction(event, true)'></span>";$(".js-icon-append").append(r);var c="<span data-attr-sku="+e[o].entityCode+" data-attr-action='like' data-attr-type='shades' class='spriteIcon-Aprevamp favouriteIcon color-catalogue-revamp-list--wishList' onclick='event.stopPropagation(); wishListPage.wishlistAction(event, true)'></span>";$(".colour-preview").append(c)}wcagForShades()}$(".js-icon-append").append("<div class='close-btn'><span class='spriteIcon-Firstfold closeIcon'></span></div><span tabindex='0' class='spriteIcon-Firstfold caretUpIcon focus-visible-auto-imp'></span>"),pdQuickView(e),$("#js-shade-palette-append").get(0).scrollIntoView({block:"center",behavior:"smooth"})},error:function(e){}})})}function sticky_relocate(){if($("#sticky-anchor-for-small-card").length>0){$(window).scrollTop()>$("#sticky-anchor-for-small-card").offset().top+100?$("#sticky-small-card").addClass("stick"):$("#sticky-small-card").removeClass("stick")}}function getColorFinderPage(e){var t=revised_cc_listing.activeShadeTab,a=encodeURIComponent(t.toLowerCase()),o=$(e).attr("data-attr-colorfinderurl")+"?f=Shade:"+encodeURIComponent(a);$(e).attr("href",o)}function scrollToForm(){let e=$("div[id='"+ccLeadFormId+"']");$("html,body").animate({scrollTop:e.offset().top-100},"slow")}function FilterscrollToShade(){$(".js-optionSelection-box").on("click",function(){$(".selected-color-tab-label-desktop").get(0).scrollIntoView({block:"center",behavior:"smooth"})})}function clickOnChildOnFocus(e,t){$(e).keypress(function(e){if(13==e.keyCode){let e=$(this).find(t)[0];e&&e.click()}})}function clickOnSelfOnFocus(e){$(e).keypress(function(e){13==e.keyCode&&$(this).click()})}function wcagForShades(){setTimeout(function(){$("#colorCatalogueListForm-apRvm .PD-quickview-wrap .shadePallateWrapCT .colorwrap > div, .preview-section .preview-section--img-carousel .caretUpIcon").on("keydown",function(e){("click"===e.type||"keydown"===e.type&&"Enter"===e.key)&&$(this).click()})})}function mobileColorFinderBar(){if($(window).width()<=991){let e=$("#colorCatalogueListForm-apRvm").find(".colour-finder-barWrap");$(".colorfinder-mob-block").length>0?e.css("display","none"):e.css("display","block")}}$(document).ready(function(){$("#cc-listing").length>0&&(revised_cc_listing.allFeatures.ajaxOnLoad(),$(".js-shadeRevamp-colorLoadMoreBtn").on("click",function(){var e=$
1(".js-colorCatRevampCardList").length;revised_cc_listing.visibleSwatchIndex=e+revised_cc_listing.loadMore,revised_cc_listing.filteredSwatch.length>0?revised_cc_listing.allFeatures.filterDataLoadMore(e,revised_cc_listing.visibleSwatchIndex):revised_cc_listing.allFeatures.shadeFamilyLoadMore(revised_cc_listing.activeShadeTab.toLowerCase(),e,revised_cc_listing.visibleSwatchIndex),swatchClick(),null!=wishListPage&&wishListPage.wishlistState()}),getSelectedColorTabLabelInMWeb(),revised_cc_listing.allFeatures.fetchUrlForActiveFilter()),$(".colourCodeWrap").each(function(){1==$(this).find("span").length&&$(this).find("span").addClass("single-shade")}),$(".single-shade").css({transition:"none",flex:"0 0 100%"}),$(".activeColorFamily").parent().parent().parent().addClass("active"),$(".activeColorFamily").siblings().addClass("deactiveColorFamily"),FilterscrollToShade(),$(".js-colorfamilySelector .redirectShadePage").on("click",function(e){e.preventDefault();let t=$(this).parent().attr("data-attr-family"),a=$(this).parent().css("background-color");ccAnalytics.trackColourTabClick(t,a),window.location.href=$(this).attr("href")})}),swatchClick(),$(".js-scroll-to-top-of-page").click(function(){window.scroll({top:0,left:0,behavior:"smooth"})}),$(".js-scroll-to-form").click(function(){scrollToForm()}),$(".js-scroll-shade-pallete-mweb").click(function(){$("html, body").css("overflow","visible")}),$(".js-form-modal-open").click(function(){let e=$("#globalFormPopUp");modalHandler.showModal(e);let t=$(".PD-quickview-wrap .selectedGrow").css("background-color");$(".modal__variant-colorCatalogueFormPopup .modal-header").css({"background-color":t})}),$(document).on("click",".quickview-cta",function(){$(".quickview-common-wrap").toggleClass("show-extended-color-toggle");let e=navigator.userAgent||navigator.vendor||window.opera;/android/i.test(e)&&$(".colour-preview").css("height","calc(100vh - 30vh)"),/iPad|iPhone|iPod/.test(e)&&$(".colour-preview").css("height","calc(100vh - 38vh)")}),$(document).on("click",".js-colorfamilySelector",function(){colorOfTheYear.show()}),$(".apcolourshadelistingpage .cmp-image__link").click(function(){if(null!=_satellite){let e=$(".apcolourshadelistingpage .cmp-image__link").attr("href");_satellite.track("cta_link_text",{cta_:"Explore Colors",param1:e})}}),clickOnChildOnFocus(".colourCatalouge-colorFilter--list--items",".colourName"),clickOnSelfOnFocus(".shade-revamp-filter--filterLabel-js"),clickOnSelfOnFocus(".shade-revamp-filter--filterArea-js"),clickOnSelfOnFocus(".ctaText"),clickOnSelfOnFocus("#sticky-small-card .js-scroll-to-top-of-page"),clickOnSelfOnFocus(".cc-swatch-list"),$(document).ready(function(){if($(".shadeListing-wrap, .shadeListing-swatch-wrap").length>0){let t=$("#colorCatalogueListForm-apRvm ul.color-swatch-row > li"),a=$("#js-shade-palette-append"),o=a.find(".preview-section .close-btn");function e(){t.attr("tabindex","0")}t.attr("tabindex","0"),t.on("click",function(){let i=$(this);t.attr("tabindex","-1");let l=a.find(".color-title .ctaText, .preview-section .quickview-cta .ctaComp .ctaText, .preview-section .close-btn, .preview-section .active picture .favouriteIcon");l.attr("tabindex","0"),a.find(".preview-section .active picture .favouriteIcon").addClass("focus-visible-auto-imp"),l.on("keydown",function(a){if("Tab"===a.key&&!a.shiftKey){let o=l.last();if($(this).is(o)){a.preventDefault();let o=i.next("li").length?i.next("li"):t.first();e(),o.focus()}}("click"===a.type||"keydown"===a.type&&"Enter"===a.key)&&(o.click(),e())})}),o.click(function(){e()})}mobileColorFinderBar()});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.