1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2683],{3836:(e,l,s)=>{s.d(l,{Py:()=>x,W_:()=>g,Yu:()=>u,z1:()=>h});var n=s(28888),i=s(37876),t=s(14232),a=s(65212),r=s(31368),d=s(71632),c=s(10272),o=s(60760);function m(){let e=(0,n._)(["common.recommendation.title"]);return m=function(){return e},e}var x=function(e){return e.LEFT="left",e.CENTER="center",e}({}),g=function(e){return e.CART="cart",e.PDP="PDP",e.CONFIRM="thank-you",e.WISHLIST="wishlist",e}({});let u="dynamic-yields";function h(e){let{page:l}=e,{user:s}=(0,d.As)(),{t:n,i18n:x}=(0,a.Bd)(),[g,h]=t.useState([]),p=t.useMemo(()=>{let e=r.LE.Other;switch(l){case"cart":e=r.LE.Cart;break;case"PDP":e=r.LE.Product}return e},[l]);return(t.useEffect(()=>{async function e(){let e=await (0,o.eT)();(null==e?void 0:e[l])&&(0,o.$B)({language:x.language,pageType:p}).then(e=>{var l;if((null==e||null==(l=e.docs)?void 0:l.length)>0){let l=[];null==e||e.docs.forEach(e=>{l=[...l,...e.variations.map(l=>{if(null==l?void 0:l.slotId)return{...e,variations:[l],slotId:l.slotId,isRecommendation:!0}})]}),h([{itemCollection:l=l.filter(e=>!!e),name:n(m()),_id:"dynamic-yields",slug:u}])}}).catch(e=>{console.log(e)})}s.accessToken&&e().catch(e=>{console.log(e)})},[n,s.accessToken,x.language,l]),(null==s?void 0:s.accessToken)&&0!==g.length)?"cart"===l?(0,i.jsx)("div",{className:"relative flex w-full justify-center bg-white lg:px-3",children:(0,i.jsx)("div",{className:"w-full max-w-screen-wide lg:px-3 lg:pb-18",children:(0,i.jsx)("div",{"data-testid":"recommendation-item",children:(0,i.jsx)(c.CatalogueList,{catalogues:g,isRecommendation:!0,positionTitle:"left"})})})}):"thank-you"===l?(0,i.jsx)("div",{className:"mx-auto bg-white lg:px-0",children:(0,i.jsx)("div",{className:"flex h-full justify-center pb-3 pt-5 lg:bg-opacity-50 lg:pb-8 lg:pt-3",children:(0,i.jsx)("div",{className:"relative w-full lg:max-w-screen-wide",children:(0,i.jsx)("div",{"data-testid":"recommendation-item",className:"border-t border-gray-900 pt-10",children:(0,i.jsx)(c.CatalogueList,{catalogues:g,isRecommendation:!0,positionTitle:"center"})})})})}):"PDP"===l?(0,i.jsx)("div",{className:"relative flex w-full justify-center bg-white lg:px-3",children:(0,i.jsx)("div",{className:"w-full max-w-screen-wide lg:my-5 lg:px-3",children:(0,i.jsx)("div",{"data-testid":"recommendation-item",className:"pt-5 lg:border-t lg:border-gray-900 lg:pt-10",children:(0,i.jsx)(c.CatalogueList,{catalogues:g,isRecommendation:!0,positionTitle:"left"})})})}):"wishlist"===l?(0,i.jsx)("div",{className:"relative flex w-full justify-center bg-white lg:px-3",children:(0,i.jsx)("div",{className:"w-full max-w-screen-wide lg:mb-5",children:(0,i.jsx)("div",{"data-testid":"recommendation-item",className:"pt-5 lg:border-t lg:border-gray-900",children:(0,i.jsx)(c.CatalogueList,{catalogues:g,isRecommendation:!0,positionTitle:"left",numberPerView:4})})})}):null:null}},10272:(e,l,s)=>{s.r(l),s.d(l,{CatalogueHighlightsBanner:()=>V,CatalogueList:()=>O,CatalogueShopByBrand:()=>D});var n=s(28888),i=s(37876),t=s(15039),a=s.n(t),r=s(54587),d=s.n(r),c=s(48230),o=s.n(c),m=s(89099),x=s(14232),g=s(65212),u=s(50634),h=s(77185),p=s(19193),b=s(66196),f=s(39534),j=s(5651),w=s(1243),v=s(3836),N=s(52529),y=s(87928),k=s(15411);function C(e){let{title:l,mobileImage:s,desktopImage:n,linkTo:t}=e.item,r=y.Y.get()===k.Qe.MINIAPP,{t:d}=(0,g.Bd)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"relative mb-3 bg-white cursor-pointer lg:w-full sm:ml-0",children:(null==t?void 0:t.value)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{target:r?"":"_blank",href:t.value,className:a()("rounded-lg min-w-[280px] block sm:hidden",e.isSingleItem?"min-h-[215px]":"min-h-[180px]"),children:(0,i.jsx)(h.p$y,{alt:l,src:s,className:"rounded-lg",layout:"fill",sizes:"280px"})}),(0,i.jsx)(o(),{target:r?"":"_blank",href:t.value,className:"hidden sm:block rounded-lg min-h-[180px] min-w-[280px] lg:min-w-[380px] lg:min-h-[246px]",children:(0,i.jsx)(h.p$y,{layout:"fill",src:n,alt:l,className:"rounded-lg",sizes:"380px"})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"rounded-lg min-w-[280px] min-h-[180px] sm:hidden",children:(0,i.jsx)(h.p$y,{layout:"fill",src:s,alt:l,className:"rounded-lg",sizes:"280px"})}),(0,i.jsx)("div",{className:"hidden sm:block rounded-lg min-w-[280px] min-h-[180px] lg:min-w-[380px] lg:min-h-[246px]",children:(0,i.jsx)(h.p$y,{layout:"fill",src:n,alt:l,className:"rounded-lg",sizes:"380px"})})]})}),(0,i.jsxs)("div",{className:"font-medium text-[18px] leading-[27px] sm:ml-0",children:[(0,i.jsx)("h4",{className:"mb-2 line-clamp-3",children:l}),(null==t?void 0:t.value)&&(0,i.jsx)(o(),{target:r?"":"_blank",href:t.value,className:"cursor-pointer text-primary",children:d("common.read-more")})]})]})}function B(e){let{items:l}=e,s=(0,x.useMemo)(()=>({drag:(null==l?void 0:l.length)>1,mode:"snap",rtl:!1,slides:{perView:"auto",spacing:20},loop:!1,breakpoints:{[N.W1]:{slides:{perView:N.lG,spacing:20},drag:!1}}}),[null==l?void 0:l.length]);return(0,i.jsx)("div",{className:"lg:ml-0",children:(0,i.jsx)(h.RCg,{options:s,className:"pt-5 pl-5 sm:px-0",children:Array.isArray(l)&&1===l.length?(0,i.jsx)(N.qr,{className:"w-full pr-5 lg:pr-0 overflow-visible min-h-[280px]",children:(0,i.jsx)(C,{item:l[0],isSingleItem:!0})}):null==l?void 0:l.map((e,s)=>0===s?(0,i.jsx)(N.qr,{className:"w-full overflow-visible min-w-[280px] max-w-[280px] min-h-[280px]",children:(0,i.jsx)(C,{item:e})},e._id):s===l.length-1?(0,i.jsx)(N.qr,{className:"w-full overflow-visible min-w-[320px] max-w-[320px] min-h-[280px] pr-10 md:pr-0",children:(0,i.jsx)(C,{item:e})},e._id):(0,i.jsx)(N.qr,{className:"w-full overflow-visible min-w-[280px] max-w-[280px] min-h-[280px] last:mr-5",children:(0,i.jsx)(C,{item:e})},e._id))})})}var P=s(6481);function R(e){let{itemsShopByBrand:l=[],isAutoPlay:s=!1}=e,n=(0,x.useMemo)(()=>({...N.NB,loop:!0,drag:(null==l?void 0:l.length)>1,slides:{perView:1.81862,spacing:20},breakpoints:{[N.W1]:{drag:(null==l?void 0:l.length)>2,loop:!0,slides:{perView:"auto",spacing:20}},[N.CG]:{drag:(null==l?void 0:l.length)>4,loop:!0,slides:{perView:"auto",spacing:20}}}}),[null==l?void 0:l.length]);return(0,i.jsx)("div",{children:(0,i.jsx)(h.RCg,{showNavigation:!0,options:n,isAutoPlay:s,className:"pt-5 pl-5 lg:pl-0",children:Array.isArray(l)&&l.slice(0,6).map(e=>{var l;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(N.qr,{className:"overflow-visible min-w-[188px] min-h-[188px] lg:min-w-[246px] lg:max-w-[246px] lg:min-h-[246px] lg:max-h-[246px] lg:pl-0",children:(0,i.jsx)("div",{className:"rounded-lg bg-grey-200 min-h-[188px] min-w-[188px]",children:(0,i.jsxs)(o(),{href:null!=(l=e.brandUrl)?l:"#",children:[(0,i.jsxs)("div",{className:"p-2 rounded-lg bg-grey-200",children:[e.brandBackgroun
1d?(0,i.jsx)("img",{className:"h-[107px] w-full lg:w-[230px] lg:h-[140px] rounded mb-2 object-cover",src:e.brandBackground,alt:"brandBackground"}):(0,i.jsx)("img",{className:"min-w-[172px] h-[107px] sm:w-full lg:w-[230px] lg:h-[140px] rounded-lg mb-2 object-cover",src:P.$,alt:"brandBackground"}),(0,i.jsx)("div",{className:"flex items-center justify-center min-w-[172px] min-h-[52px] max-h-[52px] lg:min-h-[76px] lg:min-w-[230px]",children:e.brandLogo?(0,i.jsx)("img",{className:"object-contain min-w-[172px] min-h-[52px] max-h-[52px] lg:min-h-[76px] lg:min-w-[230px]",src:e.brandLogo,alt:"brandLogo"}):(0,i.jsx)("div",{className:"object-contain"})})]}),(0,i.jsx)("div",{className:a()("h-[5px] lg:h-[6px] rounded-bl-lg rounded-br-lg",!e.brandColor&&"bg-petronas-500"),style:e.brandColor?{backgroundColor:e.brandColor}:{}})]})})},e._id)})})})})}var _=s(31996);function A(){let e=(0,n._)(["common.view-more"]);return A=function(){return e},e}function L(){let e=(0,n._)(["common.view-more"]);return L=function(){return e},e}function T(){let e=(0,n._)(["common.view-more"]);return T=function(){return e},e}function I(){let e=(0,n._)(["shop-by-brand.title"]);return I=function(){return e},e}function E(){let e=(0,n._)(["shop-by-brand.view-all"]);return E=function(){return e},e}function O(e){let{catalogues:l,isRecommendation:s,positionTitle:n,numberPerView:t,centerNavOnImage:a}=e;return(0,i.jsx)("div",{className:"w-full",children:Array.isArray(l)&&l.map((e,l)=>e.type===w.gl.BRAND_HIGHLIGHT?(0,i.jsx)(H,{catalogue:e,isRecommendation:s,positionTitle:n,numberPerView:t,centerNavOnImage:a,index:l},e._id):(0,i.jsx)(W,{catalogue:e,index:l,isRecommendation:s,positionTitle:n,numberPerView:t,centerNavOnImage:a},e._id))})}function W(e){let{catalogue:l,isRecommendation:s,positionTitle:n,numberPerView:t,centerNavOnImage:r,index:d}=e,{isOpenModalItemAdded:c,dismissModalItemAdded:h}=(0,x.useContext)(f.XZ),w=(0,m.useRouter)(),{t:N}=(0,g.Bd)(),{ref:y}=(0,u.Wx)({threshold:.1,triggerOnce:!0}),k=(0,x.useMemo)(()=>l.slug===v.Yu?(0,b.f0Z)(w):(0,b.dJ2)(w,l.slug),[w,l.slug]);return(0,i.jsxs)("section",{className:"mb-8 w-full last:mb-18 lg:mb-[30px]",ref:y,children:[(0,i.jsxs)("div",{className:a()("flex w-full items-center justify-between px-5 lg:px-0",n===v.Py.CENTER&&"lg:justify-center"),children:[d<1?(0,i.jsx)("h1",{className:"max-w-[90%] overflow-hidden text-xl font-semibold text-black lg:max-w-[85%] lg:text-2xl lg:leading-[34px]",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},"data-testid":"catalogue-name",children:(0,i.jsx)(o(),{passHref:!0,href:k,children:l.name})}):(0,i.jsx)("h2",{className:"max-w-[90%] overflow-hidden text-xl font-semibold text-black lg:max-w-[85%] lg:text-2xl lg:leading-[34px]",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},"data-testid":"catalogue-name",children:(0,i.jsx)(o(),{passHref:!0,href:k,children:l.name})}),!s&&(0,i.jsxs)(o(),{passHref:!0,href:k,className:"flex items-center text-black",children:[(0,i.jsx)("span",{className:"hidden h-7 text-2sm font-medium lg:flex lg:items-center",children:N(A())}),(0,i.jsx)(p.U5,{className:"lg:hidden"})]})]}),Array.isArray(l.itemCollection)&&(0,i.jsx)(_.K,{items:l.itemCollection,isRecommendation:s,numberPerView:t,catalogue:l,centerNavOnImage:r}),c&&(0,i.jsx)(j.C,{isOpen:c,onDismiss:h,overlayClassName:"bg-modal-item-added",isProductItemCard:!0})]})}function H(e){let{catalogue:l,isRecommendation:s,positionTitle:n,numberPerView:t,centerNavOnImage:r}=e,{t:c}=(0,g.Bd)(),p=(0,m.useRouter)(),{ref:f}=(0,u.Wx)({threshold:.1,triggerOnce:!0}),j=(0,x.useMemo)(()=>l.slug===v.Yu?(0,b.f0Z)(p):l.type===w.gl.BRAND?(0,b.$yi)(p,l.slug):(0,b.dJ2)(p,l.slug),[l.slug,l.type,p]);return(0,i.jsxs)("section",{className:a()("mb-8 w-full bg-cover pb-6 last:pb-0 md:rounded-lg lg:mb-16 lg:pb-10",l.type===w.gl.BRAND?"lg:pt-[9px]":"",l.brandBackground?"":"bg-default-background-brand-catalogue lg:bg-default-background-brand-catalogue-lg"),ref:f,style:l.brandBackground?{backgroundImage:"url('".concat(l.brandBackground,"')")}:{},children:[(0,i.jsx)("div",{className:a()("flex items-center justify-between px-5 lg:px-0",n===v.Py.CENTER&&"lg:justify-center"),children:(0,i.jsxs)("div",{className:"w-full lg:hidden",children:[(0,i.jsxs)("div",{className:"mt-8 flex items-center justify-between lg:justify-center",children:[l.brandLogo?(0,i.jsx)(d(),{src:l.brandLogo,width:161,height:48,className:"object-cover",alt:l.name}):(0,i.jsx)("div",{className:"h-[38px] w-[186px] bg-default-brand-logo-mobile bg-left bg-no-repeat"}),(0,i.jsx)(o(),{passHref:!0,href:j,className:"flex items-center text-black lg:hidden",children:(0,i.jsx)(h.$nd,{className:"h-[34px] w-[128px] border border-white bg-opacity-0 text-xs font-bold uppercase leading-[18px] tracking-[0.13em] !text-white",children:c(L())})})]}),(0,i.jsx)("p",{className:"mt-5 text-center text-2sm font-medium text-white",children:l.brandDescription})]})}),(0,i.jsx)("div",{className:"lg:flex-1",children:Array.isArray(l.itemCollection)&&(0,i.jsx)(_.K,{routeGetProductListCatalogue:j,isBrandCatalogue:!0,catalogue:l,items:l.itemCollection,isRecommendation:s,numberPerView:t,centerNavOnImage:r,isAutoPlay:!0})})]})}function V(e){let{positionTitle:l,cataloguesHighlightsBanner:s}=e,{ref:n}=(0,u.Wx)({threshold:.1,triggerOnce:!0}),{t}=(0,g.Bd)();return(0,m.useRouter)(),(0,i.jsxs)("section",{className:"mb-[52px] w-full sm:px-5 lg:px-0",ref:n,children:[(0,i.jsxs)("div",{className:a()("mb-1 flex w-full items-center justify-between px-5 sm:px-0",l===v.Py.CENTER&&"lg:justify-center"),children:[(0,i.jsx)("h2",{className:"max-w-[90%] overflow-hidden text-xl font-semibold text-black lg:max-w-[85%] lg:text-2xl lg:leading-[34px]",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:null==s?void 0:s.name}),(null==s?void 0:s.bannerCollection.length)>3&&(0,i.jsxs)(o(),{passHref:!0,href:b.j_L,className:"flex items-center text-black",children:[(0,i.jsx)("span",{className:"hidden h-7 text-2sm font-medium lg:flex lg:items-center",children:t(T())}),(0,i.jsx)(p.U5,{className:"lg:hidden"})]})]}),Array.isArray(null==s?void 0:s.bannerCollection)&&(0,i.jsx)(B,{items:null==s?void 0:s.bannerCollection.slice(0,3)})]})}function D(e){let{cataloguesShopByBrand:l=[]}=e,{t:s}=(0,g.Bd)(),{ref:n}=(0,u.Wx)({threshold:.1,triggerOnce:!0}),t=(0,m.useRouter)();return(0,i.jsxs)("section",{className:"mb-[52px] w-full",ref:n,children:[(0,i.jsxs)("div",{className:a()("flex w-full items-center justify-between"),children:[(0,i.jsx)("h2",{className:"hidden px-5 text-xl font-semibold text-black lg:block lg:px-0 lg:text-2xl lg:leading-[34px]",children:s("shop-by-brand.title")}),(0,i.jsx)(o(),{href:(0,b.jJu)(t),className:"px-5 text-xl font-semibold text-black lg:hidden",children:s(I())}),(null==l?void 0:l.length)>=6&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{className:"hidden text-2sm font-normal text-black lg:block",href:(0,b.jJu)(t),children:s(E())}),(0,i.jsx)(o(),{className:"mr-5 lg:hidden",href:(0,b.jJu)(t),children:(0,i.jsx)(p.U5,{})})]})]}),(0,i.jsx)(R,{itemsShopByBrand:l,isAutoPlay:(null==l?void 0:l.length)>=6})]})}}}]);
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.