PageSourceSearch

https://www.asianpaints.com/etc.clientlibs/apcolourcatalogue/compo…/recentlyViewedShades/clientlibs.min.js

js asianpaints.com collected 2026-09-25 09:20:55 UTC 4,823 bytes, 1 lines download raw bytes

1let cookieName="recentShades",loadMoreIndex=0,checkLanguage=document.getElementById("GlobalPath").value;checkLanguage=checkLanguage.includes("/ap/eg/en/home")?"ab":"en";let recently_viewed_shades={checkForRecentlyViewedShadesCookie:function(e){let t=getCookieValues(cookieName);if(null!=t&&null!=t&&""!=t){let a=JSON.parse(t);recently_viewed_shades.paintRecentShadesViewed(a,e,!1),$(".desktop-cookies .recentlyViewedShades").removeClass("d-none")}},printLoadMoreShades:function(e,t,a,c){let o=getCookieValues(cookieName);if(null!=o&&null!=o&&""!=o){let c=JSON.parse(o),s=c.slice(t,a),i=a>=c.length;recently_viewed_shades.paintRecentShadesViewed(s,e,i),$(".desktop-cookies .recentlyViewedShades").removeClass("d-none")}},paintRecentShadesViewed:function(e,t,a){let c=e,o="";if(c.length>t){let e=c.length-t;c.splice(t,e)}$.ajax({type:"GET",url:"/apcolourcatalogue/personalization/previousShades.json",data:{previousShadeSKUs:JSON.stringify(c),swatchesOnLoad:t,language:checkLanguage},success:function(e){if(e&&e.success){$("#recently-viewed-shades").removeClass("d-none");let c=e.previousShades;for(var t in $(".PD-quickview-wrap").css("display","flex"),c)o+=`<li class="cc-swatch-list previousViewedShadesCards product-view" data-cftype="${c[t].cfType}"\n                            onclick="event.stopPropagation(); recently_viewed_shades.executePrevShadeClick($(this))"\n                            data-pageurl="${c[t].pageUrl}"\n                            data-attr-colourTemperature="${c[t].colourTemperature}"\n                            data-attr-colourTonality="${c[t].colourTonality}"\n                            data-attr-shadeFamily="${c[t].shadeFamily}">\n                            <div class="cc-swatch">\n                                <span data-attr-sku="${c[t].entityCode}" data-attr-action="like" data-attr-type="shades"\n                                    class="spriteIcon-Aprevamp favouriteIcon color-catalogue-revamp-list--wishList"\n                                    onclick="event.stopPropagation(); wishListPage.wishlistAction(event, true)">\n                                </span>\n                                <div class="cc-swatch--colorcode" style="background-color: ${c[t].shadeHexCode}"></div>\n                                <div class="cc-swatch--desc">\n                                    <p title="${c[t].entityName}" class="cc-swatch--desc--colorName text-capitalize">\n                                        ${c[t].entityName}\n                                        <span class="spriteIcon-Firstfold rightArrow"></span>\n                                    </p>\n                                    <p class="cc-swatch--desc--skucode">${c[t].entityCode}</p>\n                                </div>\n                            </div>\n                        </li>`;$(".mweb-cookies #recent-shade-list").append(o),$(".desktop-cookies #recent-shade-list").append(o),(JSON.parse(getCookieValues(cookieName)).length<=5||a)&&$(".cookie-loadMoreBtn").addClass("d-none"),null!=wishListPage&&wishListPage.wishlistState()}},error:function(e){}})},updateRecentViewedShades:function(e){let t=new Date;t.setTime(t.getTime()+31536e6);let a=[],c=getCookieValues(cookieName);if(null!=c&&null!=c&&""!=c&&(a=JSON.parse(c)),e=(e=e.replaceAll("undefined ","")).replaceAll("Colour Code:",""),null!=a&&a.length>0){for(let t=0;t<a.length;t++)if(a[t]==e.trim()){a.splice(t,1);break}a.unshift(e.trim())}else a.push(e.trim());if(a.length>50){let e=a.length-50;a.splice(50,e)}document.cookie=cookieName+"="+JSON.stringify(a)+";path=/;expires="+t.toGMTString()},executePrevShadeClick:function(e){let t=$(e).data("pageurl"),a=$(e).find(".cc-swatch--colorcode").attr("style")?$(e).find(".cc-swatch--colorcode").attr("style").replace("background-color:","").trim():"",c=$(e).find(".color-catalogue-revamp-list--wishList").attr("data-attr-sku"),o=$(e).find(".cc-swatch--desc--colorName").text()?$(e).find(".cc-swatch--desc--colorName").text().trim():"";"undefined"!=typeof smartech&&smartech("dispatch","Product View",{Product_Name:o,Price:0,Category:"Colour Catalogue",SKU_Code:c,Event_Source:"AP Shop",Product_Image:a}),window.location.href=t}};$(document).ready(function(){if($("#recently-viewed-shades").length>0){let e=0;e+=$("#recent-shade-list").attr("data-attr-swatchOnLoad"),recently_viewed_shades.checkForRecentlyViewedShadesCookie(e)}$(".cc-swatch-list.js-colorCatRevampCardList").click(function(){let e=$(this).find(".cc-swatch--desc--skucode").text().trim();recently_viewed_shades.updateRecentViewedShades(e)}),$(".js-loadmore-cookie").click(function(){let e=parseInt($(".js-loadmore-cookie").attr("data-loadmore-on-pageload")),t=parseInt($("#recent-shade-list").attr("data-attr-swatchOnLoad"))+loadMoreIndex,a=t+e;
1recently_viewed_shades.printLoadMoreShades(e,t,a),loadMoreIndex+=e})});

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.