"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2681],{79512:function(e,t,r){r.d(t,{O:function(){return l},W:function(){return d}});var a=r(35944);r(67294);var n=r(43967),i=r(48189),o=r(76318);let s=r(87379).ZP.div.withConfig({componentId:"sc-ee959cfc-0"})([""]),l=e=>{let{customDataProps:t,wrapperProps:r,pages:o=[],...l}=e,c=d(o);return(0,a.tZ)(i.xu,{...r,children:(0,a.tZ)(s,{...t,children:(0,a.tZ)(n.B,{...l,pages:c})})})},d=e=>{let t=(0,o.U)();return e.map(e=>({dataEventCategory:"Ecommerce",dataEventAction:"Breadcrumb Click",dataEventLabel:t,...e}))}},75713:function(e,t,r){r.d(t,{o:function(){return l}});var a=r(35944);r(67294);var n=r(11163),i=r(3527),o=r(58370),s=r(9268);let l=e=>{let{children:t,pageTitle:r,SEOData:l,customHead:d}=e,{locale:c="vi-VN"}=(0,n.useRouter)(),{isDesktop:u}=o.v3.useDevice(),p=(0,i.x)();return(0,a.tZ)(s._,{locale:c,showStickyBottomMenu:!1,headerProps:{topBarProps:{backProps:{visible:!0,onClick:p},titleProps:{visible:!0,content:r},cartProps:{visible:!0},searchProps:{visible:!0},rightKebabProps:{visible:!0},hasBorder:!0},showSearchBar:u},SEOData:l,customHead:d,children:t})}},804:function(e,t,r){r.d(t,{ql:function(){return c},o2:function(){return i.o},_2:function(){return a._},Xg:function(){return n.X},oc:function(){return u}});var a=r(9268),n=r(10877),i=r(75713),o=r(35944);r(67294);var s=r(11163),l=r(3527),d=r(58370);let c=e=>{let{children:t,pageTitle:r,SEOData:n,customHead:i}=e,{locale:c="vi-VN"}=(0,s.useRouter)(),{isDesktop:u}=d.v3.useDevice(),p=(0,l.x)();return(0,o.tZ)(a._,{locale:c,showStickyBottomMenu:!1,headerProps:{topBarProps:{backProps:{visible:!0,onClick:p},titleProps:{visible:!0,content:r},cartProps:{visible:!0},searchProps:{visible:!0},rightKebabProps:{visible:!0},hasBorder:!0},showSearchBar:u},SEOData:n,customHead:i,children:t})},u=e=>{let{children:t,pageTitle:r,SEOData:n,customHead:i,onBack:l}=e,{locale:c="vi-VN"}=(0,s.useRouter)(),{isDesktop:u}=d.v3.useDevice();return(0,o.tZ)(a._,{locale:c,headerProps:{topBarProps:{backProps:{visible:!0,onClick:l},titleProps:{visible:!0,content:r},cartProps:{visible:!1},searchProps:{visible:!1},rightKebabProps:{visible:!0},hasBorder:!0},showSearchBar:u},SEOData:n,customHead:i,showStickyBottomMenu:!0,bottomBarProps:{defaultMenuItemType:"profile"},children:t})}},10877:function(e,t,r){r.d(t,{X:function(){return l}});var a=r(35944);r(67294);var n=r(11163),i=r(48189),o=r(58370),s=r(9268);let l=e=>{let{children:t,pageTitle:r,SEOData:l,customHead:d,bottomMenuDefault:c}=e,{locale:u="vi-VN"}=(0,n.useRouter)(),{isMobile:p}=o.v3.useDevice();return(0,a.tZ)(s._,{locale:u,showStickyBottomMenu:!0,headerProps:{logoComponent:p&&r?(0,a.tZ)(i.X6,{tag:"h5",as:"h1",weight:"bold",wordWrap:"none",children:r}):void 0},bottomBarProps:{defaultMenuItemType:c},SEOData:l,customHead:d,children:t})}},3527:function(e,t,r){r.d(t,{x:function(){return o}});var a=r(67294),n=r(11163),i=r(58370);let o=()=>{let e=(0,n.useRouter)(),{back:t}=e,r=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{let e=()=>{r.current=!0};return window.addEventListener("beforeunload",e),()=>{r.current=!0,window.removeEventListener("beforeunload",e)}},[]),(0,a.useEffect)(()=>{r.current=!0,setTimeout(()=>{r.current=!1},700)},[e.asPath]),()=>{t(),setTimeout(()=>{r.current||e.push(i.zM.getNewRelativeURL("","shop").toString())},500)}}},52681:function(e,t,r){r.r(t),r.d(t,{__N_SSP:function(){return M},default:function(){return S}});var a=r(35944),n=r(30118),i=r(67294),o=r(48189),s=r(79512),l=r(85934),d=r(58370),c=r(330),u=r(90531),p=r(41664),g=r.n(p),h=r(87379);let m=h.ZP.div.withConfig({componentId:"sc-95159f06-0"})(["background:",";padding-bottom:40px;","{padding-bottom:24px;gap:12px;}","{padding-top:24px;}"],e=>{let{theme:t}=e;return t.colors.neutral50},u.M.tdOnly,u.M.tdDown),v=h.ZP.div.withConfig({componentId:"sc-95159f06-1"})(["display:grid;grid-gap:24px 16px;grid-template-columns:repeat(6,1fr);","{grid-template-columns:repeat(5,1fr);grid-gap:12px 8px;}","{grid-gap:12px 8px;grid-template-columns:repeat(3,1fr);padding-top:0;}"],u.M.tdOnly,u.M.mbDown),b=h.ZP.div.withConfig({componentId:"sc-95159f06-2"})(["background-color:",";border-radius:4px;padding:16px;width:100%;max-height:120px;height:120px;position:relative;.brand-img{width:100%;height:100%;object-fit:contain;}","{padding:8px;max-height:72px;};"],e=>e.theme.colors.white,u.M.mbDown),f=(0,h.ZP)(g()).withConfig({componentId:"sc-95159f06-3"})(["display:flex;align-items:center;flex:1;flex-direction:column;"]),P=e=>{let{customDataProps:t,brandList:r,pagination:n}=e,u=d.D1.useTranslation(),{query:p,replace:g,pathname:h}=d.zM.useRouter(),{isMobile:P,isDesktop:B}=d.v3.useDevice(),[w,x]=(0,i.useState)(!1),[M,S]=(0,i.useState)(r),[E,D]=(0,i.useState)(n||{}),Z=[{label:u({id:"breadcrumb.home",defaultMessage:"Trang chủ"}),value:d.zM.getNewRelativeURL("","shop").toString()},{label:u({id:"breadcrumb.brands",defaultMessage:"Brands"}),value:d.zM.getLocalisedUrl("","BRAND").toString()}],N=(0,i.useRef)(!0);return(0,i.useEffect)(()=>{N.current&&r.length?N.current=!1:(N.current=!1,(async()=>{x(!0);let e=Number(p.page)||1,t=await l.Ut.getBrands({params:{page:e,perPage:500}});if(null==t?void 0:t.data){var r,a,n,i;(null===(r=t.data.brands)||void 0===r?void 0:r.length)||1===e?(S((null===(n=t.data)||void 0===n?void 0:null===(a=n.brands)||void 0===a?void 0:a.map(d.lZ.formatBrand).filter(c.$K))||[]),D(d.lZ.formatPagination(null===(i=t.data)||void 0===i?void 0:i.pagination)||{current:Number(p.page)||1})):g({pathname:h,query:{...p,page:1}})}x(!1)})())},[p.page]),(0,a.BX)(m,{"data-loading":w,...t,children:[(0,a.tZ)("div",{className:"page-breadcrumbs-wrapper",children:(0,a.tZ)(o.EW,{isDesktopPadding:!0,children:(0,a.tZ)(s.O,{pages:Z,size:"md"})})}),(0,a.BX)(o.EW,{isDesktopPadding:!0,children:[B&&(0,a.tZ)(o.X6,{tag:"h5",as:"h1",wrapperProps:{style:{textTransform:"uppercase",marginTop:16}},children:u({id:"breadcrumb.brands",defaultMessage:"Brands"})}),(0,a.BX)(v,{"data-loading":w,children:[M.map(e=>(0,a.BX)(f,{href:d.zM.getLocalisedUrl(e.slug,"BRAND").toString(),"data-event-category":"Ecommerce","data-event-action":"Brand Click","data-event-label":d.zM.getLocalisedUrl(e.slug,"BRAND").toString(),children:[(0,a.tZ)(b,{children:(0,a.tZ)(o.E9,{className:"brand-img",src:e.image||e.pmcImage,alt:e.name})}),(0,a.tZ)(o.xv,{size:"p3",as:"h3",customDataProps:{style:{marginTop:P?8:12}},children:e.name})]},e.id)),w&&(0,a.tZ)(o.zx,{className:"category-product-loading",size:"lg",isLoading:!0,color:"ghost"})]})]})]})};var B=r(804),w=r(76902),x=r(90143),M=!0,S=e=>{var t,r,i,o;let{navigation:s,brandList:l,defaultProductsListingPagination:c,canonicalUrl:u}=e,p=x.z.useLocale(),{asPath:g,query:h}=x.z.useRouter(),m=Number(h.page)||1,v=d.D1.useTranslation();return(0,a.tZ)(B.o2,{navigation:s,pageTitle:v({id:"breadcrumb.brands",defaultMessage:"Brands"}),SEOData:{canonicalUrl:u+(m>1?"?page=".concat(m):""),SEOTitle:"".concat(v({id:"brand.seo.title",defaultMessage:"Xem Tất cả {number} Thương hiệu c\xf3 sẵn để mua - Cửa h\xe0ng {site}"},{number:null==c?void 0:c.totalItems,site:(null===(t=w.CX[p])||void 0===t?void 0:t.SITE_NAME_FORMATTED)||""})).concat(m>=2?" - ".concat(v({id:"brand.seo.pagesSuffix",defaultMessage:"Trang {current} tr\xean tổng số {last} trang"},{current:m.toString(),last:(null==c?void 0:c.last)||1})):""),SEODescription:v({id:"brand.seo.description",defaultMessage:"Chọn c\xe1c thương hiệu c\xf3 sẵn từ {site} - Thanh to\xe1n khi nhận h\xe0ng, Miễn ph\xed vận chuyển & Đảm bảo gi\xe1 tốt nhất!"},{site:(null===(r=w.CX[p])||void 0===r?void 0:r.SITE_NAME_FORMATTED)||""}),schemaData:(null===(o=w.X1[p])||void 0===o?void 0:null===(i=o.BRAND)||void 0===i?void 0:i.call(o,g,(null==c?void 0:c.totalItems)||0,(null==l?void 0:l.map(e=>({"@type":"Brand",name:e.name,url:x.z.getLocalisedUrl(e.slug,"BRAND").toString(),image:e.image||e.pmcImage||""})))||[]))||""},children:(0,a.tZ)(n.Z,{children:(0,a.tZ)(P,{brandList:l||[],pagination:c})})})}}}]);