PageSourceSearch

https://freshket.co/_next/static/chunks/5597-98cfc6cf9d7d81f4.js

js freshket.co collected 2026-09-24 18:35:02 UTC 82,193 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5597],{16760:function(e,i,o){var n=o(14924),t=o(85893),l=o(41120),a=o(35117),r=o(14310),d=o(22318),s=o(58365),u=o(86010),c=(o(67294),(0,l.Z)((function(e){return(0,a.Z)({root:{border:"1px solid ".concat(e.palette.divider),borderRadius:e.shape.borderRadius,display:"flex",flexDirection:"column",justifyContent:"space-evenly",height:"100%",padding:e.spacing(1),width:"100%"},skeleton:{borderRadius:e.shape.borderRadius},skeletonButton:{backgroundColor:e.palette.primary.main,height:e.spacing(5)}})})));i.Z=function(e){var i,o=e.className,l=c();return(0,t.jsxs)("div",{className:(0,u.Z)(l.root,o),"data-testid":"product-vertical-card-skeleton-root",children:[(0,t.jsx)(r.Z,{mt:1,children:(0,t.jsx)(s.Z,{className:l.skeleton,height:148,variant:"rect"})}),(0,t.jsx)(r.Z,{mt:3,children:(0,t.jsx)(d.Z,{component:"div",children:(0,t.jsx)(s.Z,{className:l.skeleton})})}),(0,t.jsx)(d.Z,{component:"div",children:(0,t.jsx)(s.Z,{className:l.skeleton,width:"50%"})}),(0,t.jsx)(r.Z,{children:(0,t.jsx)(d.Z,{component:"div",variant:"h3",children:(0,t.jsx)(s.Z,{className:l.skeleton,width:"25%"})})}),(0,t.jsx)(r.Z,{mt:7,children:(0,t.jsx)(s.Z,{className:(0,u.Z)((i={},(0,n.Z)(i,l.skeleton,!0),(0,n.Z)(i,l.skeletonButton,!0),i)),height:54,variant:"rect"})})]})}},78788:function(e,i,o){o.d(i,{L:function(){return r}});var n=o(47568),t=o(26042),l=o(97582),a=o(12757),r=function(){var e=(0,n.Z)((function(e,i){return(0,l.__generator)(this,(function(o){switch(o.label){case 0:return[4,a.E0.get(e.path,{params:{language:e.language},headers:(0,t.Z)({},(0,a.Ek)(i))})];case 1:return[2,o.sent().data]}}))}));return function(i,o){return e.apply(this,arguments)}}()},50092:function(e,i,o){o.d(i,{t:function(){return c}});var n=o(47568),t=o(97582),l=o(33299),a=o(31814),r=o(88767),d=o(41609),s=o.n(d),u=o(78788),c=function(e){var i=e.path,o=void 0===i?"":i,d=(0,l.useSession)().data,c=(0,a.$G)().i18n;return(0,r.useQuery)({queryFn:(0,n.Z)((function(){return(0,t.__generator)(this,(function(e){return[2,(0,u.L)({path:o,language:c.language},null===d||void 0===d?void 0:d.accessToken)]}))})),queryKey:["content-skus",o],enabled:!s()(o)})}},75347:function(e,i,o){var n=o(14924),t=o(85893),l=o(11719),a=o(10150),r=o(41609),d=o.n(r),s=o(67294),u=o(53264),c=o(711),p=o(45939),v=o(45568),m=o(70331),g=o(87515),h=(0,l.Z)((function(e){return(0,a.Z)({root:{position:"relative"},wrapper:(0,n.Z)({position:"fixed",right:0,zIndex:999,bottom:72},e.breakpoints.up("md"),{bottom:16})})}));i.Z=function(){var e,i,o=h(),n=(0,v.iQ)(),l=n.data,a=n.isLoading,r=(0,c.Sj)().data,f=!d()(null===l||void 0===l||null===(e=l.tax_info)||void 0===e?void 0:e.etax_emails)&&!d()(null===l||void 0===l||null===(i=l.tax_info)||void 0===i?void 0:i.accounting_phone),x=(0,m.m)(),y=(0,p.k)().isActive,b=!d()(l)&&!!(null===r||void 0===r?void 0:r.is_active)&&y&&!(x||f||a),Z=(0,g.F$)((function(e){return e.setVisible}));return(0,s.useEffect)((function(){return Z(b),function(){return Z(!1)}}),[b,Z]),b?(0,t.jsx)("div",{className:o.root,children:(0,t.jsx)("div",{className:o.wrapper,children:(0,t.jsx)(u.Z,{isShowButton:!0})})}):null}},49577:function(e,i,o){o.d(i,{V:function(){return v}});var n=o(85893),t=(o(67294),o(41120)),l=o(35117),a=o(14310),r=o(22318),d=o(8380),s=o(66492),u=o(31814),c=o(86010),p=(0,t.Z)((function(e){return(0,l.Z)({root:{},description:{fontSize:"13px",lineHeight:"20px",fontWeight:300,color:"#6C757D"},highlightText:{marginLeft:e.spacing(.5)}})})),v=function(e){var i=e.className,o=p(),t=(0,u.$G)().t;return(0,n.jsxs)(a.Z,{className:(0,c.Z)(o.root,i),children:[(0,n.jsxs)(r.Z,{className:o.description,children:[t("common:consent.marketing_consent.description"),(0,n.jsx)(d.Z,{to:"/marketing-consent",children:t("common:consent.marketing_consent.readmore")})]}),(0,n.jsxs)(a.Z,{mt:2,display:"flex",alignItems:"start",children:[(0,n.jsx)(s.Z,{width:24,height:24,src:"/images/icons/orange.svg"}),(0,n.jsx)(r.Z,{className:o.highlightText,color:"primary",variant:"body2",children:t("common:consent.marketing_consent.highlights.received_promotion")})]}),(0,n.jsxs)(a.Z,{my:2,display:"flex",alignItems:"start",children:[(0,n.jsx)(s.Z,{width:24,height:24,src:"/images/icons/avocado.svg"}),(0,n.jsx)(r.Z,{className:o.highlightText,color:"primary",variant:"body2",children:t("common:consent.marketing_consent.highlights.news_update")})]}),(0,n.jsxs)(a.Z,{display:"flex",alignItems:"start",children:[(0,n.jsx)(s.Z,{width:24,height:24,src:"/images/icons/peach.svg"}),(0,n.jsx)(r.Z,{className:o.highlightText,color:"primary",variant:"body2",children:t("common:consent.marketing_consent.highlights.promotion_for_you")})]})]})}},14269:function(e,i,o){o.d(i,{u:function(){return P}});var n=o(14924),t=o(85893),l=o(67294),a=o(86010),r=o(31814),d=o(41609),s=o.n(d),u=o(41120),c=o(35117),p=o(8920),v=o(63457),m=o(14310),g=o(20170),h=o(17812),f=o(282),x=o(22318),y=o(95477),b=o(32692),Z=o(79138),_=o(66492),j=(0,u.Z)((function(){return(0,c.Z)({titleText:{fontSize:"24px",marginRight:"10px"}})})),w=function(){var e=j(),i=(0,r.$G)().t;return(0,t.jsxs)(m.Z,{display:"flex",my:1,children:[(0,t.jsx)(x.Z,{variant:"h3",className:e.titleText,children:i("common:consent.marketing_consent.title")}
1),(0,t.jsx)(_.Z,{width:65,height:62,src:"/images/request-marketing-consent.svg"})]})},N=o(49577),k=o(51093),C=o(45568),S=o(41074),T=o(20215),I=o(73400),E=o(49688),D=o(92672),R=(0,u.Z)((function(e){return(0,c.Z)({root:(0,n.Z)({position:"fixed",left:e.spacing(2),top:"50%",transform:"translateY(-50%)",zIndex:e.zIndex.snackbar},e.breakpoints.down("sm"),{left:"50%",transform:"translate(-50%, -50%)"}),dialog:{width:"330px",padding:e.spacing(2),backgroundColor:"#F8F9FA",borderRadius:"12px",boxShadow:e.shadows[1]},closeButton:{position:"absolute",top:0,right:0,transform:"translate(75%, -75%)",color:"#343A40",backgroundColor:e.palette.background.default,"&:hover":{backgroundColor:e.palette.background.default}},content:{marginBottom:e.spacing(4)},marginRight:{marginRight:e.spacing(2)},backdrop:{zIndex:e.zIndex.modal}})}));var P=function(e){var i=e.className,o=R(),n=(0,p.Z)(),d=(0,r.$G)().t,u=(0,T.Z)().setAlert,c=(0,v.Z)(n.breakpoints.down("sm")),_=(0,C.Yy)().data,j=(0,E.B)(),P=j.mutateAsync,q=j.isLoading,A=(0,I.Ds)().enqueueSnackbar,L=(0,k.q)(),F=L.isOpen,W=L.open,B=L.close;(0,l.useEffect)((function(){var e=!s()((0,S.Qz)());(function(e,i){return!("NO-POLICY"!==e&&"OPT-OUT"!==e&&"PENDING"!==e||i)})(_,e)&&W()}),[_]);var O=function(){(0,S.l)("answered",28),B()};return F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Z,{className:(0,a.Z)(o.root,i),"data-testid":"request-consent-dialog-root",children:(0,t.jsx)(g.Z,{in:F,children:(0,t.jsx)(m.Z,{className:o.dialog,children:(0,t.jsxs)(m.Z,{position:"relative",children:[(0,t.jsx)(h.Z,{onClick:O,disableRipple:!0,disableFocusRipple:!0,className:o.closeButton,children:(0,t.jsx)(Z.Z,{fontSize:"small",color:"inherit"})}),(0,t.jsx)(w,{}),(0,t.jsx)(N.V,{className:o.content}),(0,t.jsxs)(m.Z,{display:"flex",children:[(0,t.jsx)(f.Z,{className:o.marginRight,disableElevation:!0,fullWidth:!0,color:"default",variant:"contained",onClick:O,children:(0,t.jsx)(x.Z,{variant:"inherit",color:"primary",children:d("common:button.later")})}),(0,t.jsx)(f.Z,{disableElevation:!0,fullWidth:!0,color:"primary",variant:"contained",onClick:function(){B(),u({dialogType:"OPT_IN_CONSENT",open:!0}),P(void 0,{onError:function(e){A("Update consent error: ".concat((0,D.e)(e)),{variant:"error"})}})},children:q?(0,t.jsx)(y.Z,{size:24}):d("common:button.accept")})]})]})})})}),(0,t.jsx)(b.Z,{className:o.backdrop,open:c,onClick:O})]}):null}},49688:function(e,i,o){o.d(i,{B:function(){return c}});var n=o(47568),t=o(26042),l=o(97582),a=o(96517),r=o(49431),d=o(33299),s=o(88767),u=function(){var e=(0,n.Z)((function(e){return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return[4,r.default.post("/oms/pdpa/consent/opt-in",void 0,{headers:(0,t.Z)({},(0,a.E)(e))})];case 1:return[2,i.sent().data]}}))}));return function(i){return e.apply(this,arguments)}}(),c=function(){var e=(0,d.useSession)().data;return(0,s.useMutation)({mutationFn:function(){return u(null===e||void 0===e?void 0:e.accessToken)}})}},72120:function(e,i,o){var n=o(85893),t=o(11163),l=o(73400),a=o(67294),r=o(42297),d=o(90698),s=o(72912);i.Z=function(){var e=(0,l.Ds)(),i=e.enqueueSnackbar,o=e.closeSnackbar,u=(0,t.useRouter)(),c=(0,s.Z)().clearState,p=(0,a.useCallback)((function(e){e&&i((0,n.jsx)(r.z,{promotion:e,isTriggerView:!0}),{anchorOrigin:{horizontal:"center",vertical:"bottom"},disableWindowBlurListener:!0,autoHideDuration:8e3,content:d.E,key:"promotion-trigger-snackbar",onClose:function(e,i){"clickaway"===i&&o()}})}),[i,o]);return(0,a.useEffect)((function(){var e=function(){c()};return u.events.on("routeChangeStart",e),function(){u.events.off("routeChangeStart",e)}}),[u,c]),{showPromotionTrigger:p}}},70323:function(e,i,o){o.d(i,{u:function(){return p}});var n=o(47568),t=o(26042),l=o(97582),a=o(11163),r=o(33299),d=o(31814),s=o(88767),u=o(12757),c=function(){var e=(0,n.Z)((function(e){return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,u.E0.get("api/order/order-user-verification",{headers:(0,t.Z)({},(0,u.Ek)(e))})];case 1:return[2,i.sent()];case 2:throw i.sent();case 3:return[2]}}
1))}));return function(i){return e.apply(this,arguments)}}(),p=function(){var e=(0,r.useSession)().data,i=(0,a.useRouter)(),o="th"===(0,d.$G)().i18n.language?"/admin/logout":"/en/admin/logout";return(0,s.useQuery)({queryFn:function(){return c(null===e||void 0===e?void 0:e.accessToken)},queryKey:["forced-logout"],enabled:!!(null===e||void 0===e?void 0:e.accessToken),onError:function(e){var n;401===(null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status)&&i.push(o)}})}},88042:function(e,i,o){o.d(i,{D:function(){return n}});var n=function(e){return{promotion_sequence:Number(null===e||void 0===e?void 0:e.sequence),creative_name:null===e||void 0===e?void 0:e.modelName,promotion_id:null===e||void 0===e?void 0:e.guid,promotion_name:null===e||void 0===e?void 0:e.name,promotion_type:null===e||void 0===e?void 0:e.type}}},57163:function(e,i,o){o.d(i,{D:function(){return h}});var n=o(14924),t=o(85893),l=o(41120),a=o(35117),r=o(14310),d=o(86010),s=o(31814),u=(o(67294),o(96505)),c=o(8380),p=o(42660),v=o(11379),m=o(22176),g=(0,l.Z)((function(e){return(0,a.Z)({image:{borderRadius:"16px"},full:{filter:"grayscale(100%)"},badge:{fontSize:"22px",fontWeight:700,color:"#FFF",backgroundColor:"#DD1E1B",borderRadius:"6px",padding:e.spacing(2,3),position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:2},root:{position:"relative"}})})),h=function(e){var i,o=g(),l=(0,s.$G)().t,a=e.className,h=e.promotion,f="FULL"===(null===h||void 0===h?void 0:h.promotion.status),x=null===(i=null===h||void 0===h?void 0:h.sizes.find((function(e){return"DESKTOP"
1===e.name})))||void 0===i?void 0:i.url;return(0,t.jsx)("div",{className:(0,d.Z)(o.root,a),"data-testid":"promotion-card-root",onClick:function(){v.v7({post_guid:null===h||void 0===h?void 0:h.guid,post_name:null===h||void 0===h?void 0:h.name,post_type:p.JH.POST_PROMOTIONS})},children:(0,t.jsxs)(c.Z,{to:(0,m.S)(null===h||void 0===h?void 0:h.action),children:[(0,t.jsx)(u.Z,{priority:!0,alt:(null===h||void 0===h?void 0:h.alt)||"promotion",className:(0,d.Z)(o.image,(0,n.Z)({},o.full,f)),cloudinaryTransform:{width:690,height:900,type:"fill"},height:450,width:345,preload:"none",src:x||""}),f&&(0,t.jsx)(r.Z,{"data-testid":"full-badge",className:o.badge,children:l("common:promotion.full_badge")})]})})}},11984:function(e,i,o){var n=o(85893),t=o(67294),l=o(86010),a=o(41120),r=o(35117),d=o(14310),s=o(16760),u=(0,a.Z)((function(e){return(0,r.Z)({content:{display:"flex",overflow:"hidden",width:"100%"},root:{color:"inherit",width:"100%",padding:e.spacing(2,1)},vertical:{"&:last-child":{marginRight:e.spacing(0)},marginRight:e.spacing(2),minWidth:200}})}));i.Z=function(e){var i=e.className,o=e.amount,a=void 0===o?6:o,r=u();return(0,n.jsx)("div",{className:(0,l.Z)(r.root,i),"data-testid":"normal-skeleton-root",children:(0,n.jsx)(d.Z,{className:r.content,children:t.Children.toArray(Array(a).fill("").map((function(e,i){return(0,n.jsx)(s.Z,{className:r.vertical},"skeleton-".concat(e+i))})))})})}},86789:function(e,i,o){o.d(i,{Z:function(){return Vi}});var n,t=o(85893),l=o(8920),a=o(63457),r=o(43832),d=o(67294),s=o(14924),u=o(41120),c=o(35117),p=o(41749),v=o(86010),m=o(26042),g=o(69396),h=o(99534),f=o(29815),x=o(18357),y=o(22318),b=o(282),Z=o(41664),_=o.n(Z),j=o(66492),w=o(8380),N=(0,u.Z)((function(e){return(0,c.Z)({ctaButton:{backdropFilter:"blur(2px)",background:"#FF6600",bottom:e.spacing(3),color:e.palette.common.white,left:e.spacing(3),position:"absolute",height:44},image:{borderRadius:e.spacing(1)},mainImageTitle:{color:e.palette.common.white,padding:e.spacing(4,2),position:"absolute"},root:{}})})),k=function(e){var i=e.className,o=e.onClick,n=e.imageSrc,l=e.title,a=e.buttonName,r=e.href,d=void 0===r?"#":r,s=N();return(0,t.jsx)("div",{className:(0,v.Z)(s.root,i),"data-testid":"cover-image-card-root",onClick:o,children:(0,t.jsx)(_(),{passHref:!0,href:d,prefetch:!1,children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{className:s.image,layout:"fill",objectFit:"cover",alt:l,src:n||""},l+"-cover-image"),(0,t.jsx)(w.Z,{"aria-label":l,overlay:!0,to:d,children:(0,t.jsx)(y.Z,{className:s.mainImageTitle,variant:"h4",children:l})}),(null===a||void 0===a?void 0:a.length)&&(0,t.jsx)(b.Z,{className:s.ctaButton,variant:"contained",children:(0,t.jsx)(y.Z,{variant:"body2",children:a})})]})})})},C=o(57756),S=o(76509),T=o(14156),I=o(30719),E=o(11984),D=o(14310),R=o(28659),P=o(41609),q=o.n(P),A=o(31814),L=o(64117),F=o(11379),W=o(88042),B=(0,u.Z)((function(e){return(0,c.Z)({root:(0,s.Z)({alignItems:"center"},e.breakpoints.down("xs"),{padding:e.spacing(0,1.5,0,0)})})})),O=function(e){var i,o,n=e.className,l=e.post,a=e.sequence,r=B(),d=(0,m.Z)({},null===l||void 0===l||null===(i=l.action)||void 0===i||null===(o=i.target)||void 0===o?void 0:o.data),s=d.name,u=d.id,c=(0,m.Z)({},l),p=c.slug,g=c.type,h=c.guid,f=c.name,x=c.modelName,b=p?"/".concat(p):"",Z="/posts".concat(b,"/").concat(u),_=(0,A.$G)().t;return(0,t.jsxs)(D.Z,{className:(0,v.Z)(r.root,n),display:"flex",justifyContent:"space-between",children:[(null===l||void 0===l?void 0:l.name)&&(0,t.jsx)(D.Z,{minWidth:0,children:(0,t.jsx)(y.Z,{noWrap:!0,variant:"h5",children:null===l||void 0===l?void 0:l.name})}),(null===l||void 0===l?void 0:l.action)&&(0,t.jsx)(D.Z,{bgcolor:"#F8F9FA",borderRadius:8,display:"flex",p:.5,pl:1.5,children:(0,t.jsx)(w.Z,{noWrap:!0,color:"primary",to:Z,onClick:function(){L.G5({custom_dimensions:{post_guid:h,post_link:Z,post_model:x,post_name:f,post_position:a,post_type:g},ecommerce:(0,W.D)({sequence:a,modelName:x,guid:h,name:f,type:g})}),F.F8({post_guid:h,post_name:f,post_type:g,index:a})},children:(0,t.jsxs)(y.Z,{variant:"body2",noWrap:!0,style:{display:"flex"},children:[q()(s)?_("button.see_more"):s,(0,t.jsx)(R.Z,{})]})})})]})},H=o(50092),G=o(45568),z=(0,u.Z)((function(e){return(0,c.Z)({arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},imageSwiper:(0,s.Z)({height:"auto",minHeight:350,width:300},e.breakpoints.up("sm"),{width:400}),root:{},swiper:{padding:e.spacing(2,0,4,0)},verticalCard:{textAlign:"left",width:196}})})),M=function(e){var i,o,n,l,a,r,s,u,c,p,y,b,Z,_,j=e.className,w=e.post,N=e.onEmptyData,D=e.sequence,R=e.page,P=z
1(),q=null===w||void 0===w||null===(i=w.items)||void 0===i?void 0:i.find((function(e){return"COVER_IMAGE"===e.type})),A=null===w||void 0===w||null===(o=w.items)||void 0===o?void 0:o.find((function(e){return"SKU"===e.type})),B=(0,G.iQ)().data,M=(0,H.t)({path:null===q||void 0===q||null===(n=q.dataEndpoint)||void 0===n?void 0:n.path}),K=M.data,Y=M.isLoading,J=(0,H.t)({path:null===A||void 0===A||null===(l=A.dataEndpoint)||void 0===l?void 0:l.path}),$=J.data,V=J.isLoading,Q="/posts/".concat(null===K||void 0===K||null===(a=K.action)||void 0===a||null===(r=a.target)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.id),U=(null===w||void 0===w?void 0:w.guid)?{promotion_id:null===w||void 0===w?void 0:w.guid,post_guid:null===w||void 0===w?void 0:w.guid}:{},X=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&L.hW({custom_dimensions:{post_guid:null===w||void 0===w?void 0:w.guid,post_model:null===$||void 0===$?void 0:$.modelName,post_type:null===w||void 0===w?void 0:w.type,post_name:null===w||void 0===w?void 0:w.name,post_position:D},ecommerce:{promotion_id:null===w||void 0===w?void 0:w.guid,promotion_name:null===w||void 0===w?void 0:w.name,items:L.bN(null===$||void 0===$?void 0:$.skus,U)}})}}).ref;return(0,d.useEffect)((function(){var e;0===(null===$||void 0===$||null===(e=$.skus)||void 0===e?void 0:e.length)&&(null===N||void 0===N||N())}),[null===$||void 0===$||null===(u=$.skus)||void 0===u?void 0:u.length]),(0,t.jsxs)("div",{className:(0,v.Z)(P.root,j),"data-testid":"post-special-root",children:[(0,t.jsx)(O,{post:(0,g.Z)((0,m.Z)({},w),{modelName:null===$||void 0===$?void 0:$.modelName}),sequence:D}),Y||V||0===(null===$||void 0===$||null===(c=$.skus)||void 0===c?void 0:c.length)?(0,t.jsx)(E.Z,{}):(0,t.jsx)("div",{ref:X,children:(0,t.jsx)(S.Z,{arrowNext:P.arrowNext,arrowPrev:P.arrowPrev,swiper:{className:P.swiper},onClickToSwipe:function(){return L.pA({ecommerce:(0,W.D)({sequence:Number(D),modelName:null===w||void 0===w?void 0:w.modelName,guid:null===w||void 0===w?void 0:w.guid,name:null===w||void 0===w?void 0:w.name,type:null===w||void 0===w?void 0:w.type})})},onRealIndexChange:function(e){var i=e.realIndex,o=e.previousIndex;e.isEnd?F.rL({action:"right",scroll_depth:"100%",post_guid:null===w||void 0===w?void 0:w.guid,post_name:null===w||void 0===w?void 0:w.name,post_type:null===w||void 0===w?void 0:w.type}):function(e,i){var o,n,t=null!==(n=null===$||void 0===$||null===(o=$.skus)||void 0===o?void 0:o.length)&&void 0!==n?n:1,l=Math.floor(e/t*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(l),"%"),post_guid:null===w||void 0===w?void 0:w.guid,post_name:null===w||void 0===w?void 0:w.name,post_type:null===w||void 0===w?void 0:w.type}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(l),"%"),post_guid:null===w||void 0===w?void 0:w.guid,post_name:null===w||void 0===w?void 0:w.name,post_type:null===w||void 0===w?void 0:w.type})}(i,o)},children:(0,f.Z)(d.Children.toArray((0,t.jsx)(I.o5,{className:P.imageSwiper,children:(0,t.jsx)(k,{onClick:function(){L.G5({custom_dimensions:{post_guid:null===w||void 0===w?void 0:w.guid,post_link:Q,post_model:null===K||void 0===K?void 0:K.modelName,post_name:null===w||void 0===w?void 0:w.name,post_position:D,post_type:null===w||void 0===w?void 0:w.type,post_subtype:"THUMBNAIL"},ecommerce:(0,W.D)({sequence:D,modelName:null===w||void 0===w?void 0:w.modelName,guid:null===w||void 0===w?void 0:w.guid,name:null===w||void 0===w?void 0:w.name,type:null===w||void 0===w?void 0:w.type})}),F.F8({post_guid:null===w||void 0===w?void 0:w.guid,post_name:null===w||void 0===w?void 0:w.name,post_type:null===w||void 0===w?void 0:w.type,index:D})},buttonName:null===K||void 0===K||null===(p=K.action)||void 0===p?void 0:p.name,href:Q,imageSrc:null===K||void 0===K||null===(y=K.banner)||void 0===y||null===(b=y.sizes)||void 0===b||null===(Z=b[0])||void 0===Z?void 0:Z.url,title:null===K||void 0===K?void 0:K.name})},"sequence-".concat(D,"-cover-image")))).concat((0,f.Z)(d.Children.toArray(null===$||void 0===$||null===(_=$.skus)||void 0===_?void 0:_.map((function(e,i){var o,n=e.guid,l=e.images,a=e.name,r=e.sellingSize,d=e.sellingPrice,s=e.sellerSkuID,u=e.specialMessages,c=e.labels,p=e.conversionUnit,v=e.conversionVolume,g=e.slug,f=(0,h.Z)(e,["guid","images","name","sellingSize","sellingPrice","sellerSkuID","specialMessages","labels","conversionUnit","conversionVolume","slug"]);return(0,t.jsx)(I.o5,{style:{height:"auto",width:"auto"},children:(0,t.jsx)(C.Z,(0,m.Z)({disableGost:!0,cardId:s,className:P.verticalCard,conversion:{conversionUnit:p,conversionVolume:v},href:(0,T.j)({cardId:n,slug:g}),labels:c,mediaSrc:null===l||void 0===l||null===(o=l[0])||void 0===o?void 0:o.src,priceLabelProps:{originalPrice
1:null===d||void 0===d?void 0:d.originalPrice,sellingPrice:null===d||void 0===d?void 0:d.price,status:null===d||void 0===d?void 0:d.type},sku:e,specialMessages:u,subheader:r,title:a,userInfo:B,tracking:{page:R,postID:null===w||void 0===w?void 0:w.guid,postModel:null===$||void 0===$?void 0:$.modelName,postName:null===w||void 0===w?void 0:w.name,postPosition:D,postType:null===w||void 0===w?void 0:w.type}},f))},"item_sequence-".concat(i,"-").concat(n))})))))})})]})},K=o(33299),Y=o(58365),J=function(e){var i=e.amount,o=void 0===i?10:i;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(D.Z,{display:"flex",flexWrap:"nowrap",m:1.5,overflow:"hidden",pb:1,children:d.Children.toArray(Array(o).fill("").map((function(e,i){return(0,t.jsxs)(D.Z,{alignItems:"flex-start",border:1,borderRadius:8,color:"divider",display:"flex",flexDirection:"column",height:212,justifyContent:"space-between",mr:1,p:1,children:[(0,t.jsx)(Y.Z,{height:100,style:{borderRadius:"8px"},variant:"rect",width:100},"skeleton-".concat(e+i)),(0,t.jsxs)(D.Z,{display:"flex",flexDirection:"column",height:"50%",justifyContent:"space-evenly",width:"100%",children:[(0,t.jsx)(Y.Z,{component:"div",height:12,style:{borderRadius:"8px"},variant:"rect",width:"60%"}),(0,t.jsx)(Y.Z,{component:"div",height:12,style:{borderRadius:"8px"},variant:"rect",width:"60%"}),(0,t.jsx)(Y.Z,{component:"div",height:12,style:{borderRadius:"8px"},variant:"rect",width:"30%"})]})]},i)})))})})},$=o(8701),V=o(35419),Q=o(96505),U=o(74342),X=o(58584),ee=o(43795),ie=o(1773),oe=(0,u.Z)((function(e){return(0,c.Z)({root:{},customPrice:{paddingTop:e.spacing(.15),marginBottom:0},title:{fontSize:"10px",color:"#6C757D",padding:e.spacing(0,2),"-webkit-box-orient":"vertical","-webkit-line-clamp":1,overflow:"hidden",textOverflow:"ellipsis"},description:(0,g.Z)((0,m.Z)({},ee.c.caption2),{width:"100%",color:"#6C757D"}),price:{display:"flex",alignItems:"center"},badge:{padding:e.spacing(1)},publicPrice:{alignItems:"flex-end"}})})),ne=function(e){var i,o,n=e.sku,l=e.className,a=e.onClickCard,r=oe(),d=(0,m.Z)({},n),u=d.slug,c=d.guid,p=d.name,g=d.sellingSize,h=d.sellingPrice,f=d.images,x=d.labels,b=void 0===x?[]:x,Z=d.remainingAmount,_=d.isDiscontinued,j=!(0,ie.R)(Z);return(0,t.jsx)(D.Z,{bgcolor:"#FFF",flexDirection:"column",justifyContent:"space-between",position:"relative",p:.5,className:(0,v.Z)(r.root,l),children:(0,t.jsxs)(w.Z,{overlay:!0,to:"/product/detail/".concat(u,"/").concat(c),onClick:function(){null===a||void 0===a||a(n)},children:[(0,t.jsxs)(D.Z,{width:"100%",height:136,position:"relative",children:[(0,t.jsx)(X.o,{labels:b}),(j||_)&&(0,t.jsx)(V.P,{isDiscontinued:_}),(0,t.jsx)(Q.Z,{alt:null===f||void 0===f||null===(i=f[0])||void 0===i?void 0:i.alt,cloudinaryTransform:{height:292,width:292,type:"fit"},objectFit:"contain",layout:"fill",src:null===f||void 0===f||null===(o=f[0])||void 0===o?void 0:o.src})]}),(0,t.jsxs)(D.Z,{pt:.5,width:"100%",className:"line-clamp-1",minHeight:90,children:[(0,t.jsx)(y.Z,{noWrap:!0,align:"center",className:r.title,color:"textPrimary",component:"h3",variant:"caption",children:p}),(0,t.jsxs)(D.Z,{alignItems:"center",display:"flex",flexDirection:"column",minHeight:0,minWidth:0,children:[(0,t.jsx)(y.Z,{align:"center",noWrap:!0,className:r.description,component:"p",children:g}),(0,t.jsx)(D.Z,{height:"50px",display:"flex",className:(0,v.Z)((0,s.Z)({},r.publicPrice,"PUBLIC"===(null===h||void 0===h?void 0:h.type))),children:(0,t.jsx)(U.Z,{originalPrice:null===h||void 0===h?void 0:h.originalPrice,priceClassName:r.customPrice,className:r.price,sellingPrice:null===h||void 0===h?void 0:h.price,status:null===h||void 0===h?void 0:h.type,discount:null===h||void 0===h?void 0:h.discount,productCardType:"MINI",isSellByWeight:null===n||void 0===n?void 0:n.isSellByWeight,sku:n})})]})]})]})})},te=(0,u.Z)((function(e){var i;return(0,c.Z)({root:{paddingBottom:e.spacing(1)},miniCard:(i={cursor:"pointer",width:"188px"},(0,s.Z)(i,e.breakpoints.down("md"),{width:"140px"}),(0,s.Z)(i,"minHeight","190px"),i),arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},swiper:{padding:e.spacing(0,2),"& .swiper-horizontal":{paddingBottom:"8px"},"& .swiper-scrollbar":{width:"80px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#F8F9FA"},"& .swiper-scrollbar-drag":{width:"80px",backgroundColor:"".concat(e.palette.primary.main," !important")}}})})),le=function(e){var i=e.className,o=e.skus,n=e.onClickCard,l=e.onClickToSwipe,a=e.onScrollbarDragEnd,r=e.onRealIndexChange,d=te();return(0,t.jsx)("div",{className:(0,v.Z)(d.root,i),children:(0,t.jsx)(S.Z,{spaceBetween:8,arrowNext:d.arrowNext,arrowPrev:d.arrowPrev,scrollbar:{draggable:!0,dragSize:32},modules:[$.LW],className:d.swiper,onScrollbarDragEnd:a,onClickToSwipe:l,onRealIndexChange:function(e){var i=e.realIndex,o=e.previousIndex,n=e.isEnd;return null===r||void 0===r?void 0:r(i,o,n)},children:null===o||void 0===o?void 0:o.map((function(e){return(0,t.jsx)(I.o5,{className:d.miniCard,
1children:(0,t.jsx)(ne,{sku:e,onClickCard:n})},"mini-card-".concat(e.guid))}))})})},ae=o(30079),re=o(52130),de=(0,u.Z)((function(e){return(0,c.Z)({arrow:{color:e.palette.primary.main,position:"absolute",right:e.spacing(4),top:e.spacing(2)},header:{padding:e.spacing(2)},miniCard:{cursor:"pointer",paddingBottom:e.spacing(2)},root:{background:e.palette.background.paper,borderRadius:e.shape.borderRadius,boxShadow:e.shadows[1],position:"relative"},title:{marginBottom:e.spacing(1)}})})),se=function(e){var i,o,n,l,a=e.className,r=e.post,s=e.onEmptyData,u=e.sequence,c=e.page,p=de(),h=(0,K.useSession)().data,f=(0,H.t)({path:null===r||void 0===r||null===(i=r.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),y=f.data,b=f.isLoading,Z=(null===r||void 0===r?void 0:r.guid)?{promotion_id:null===r||void 0===r?void 0:r.guid,post_guid:null===r||void 0===r?void 0:r.guid}:{},_=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&L.hW({custom_dimensions:{post_guid:null===r||void 0===r?void 0:r.guid,post_model:null===y||void 0===y?void 0:y.modelName,post_type:null===r||void 0===r?void 0:r.type,post_name:null===r||void 0===r?void 0:r.name,post_position:u},ecommerce:{promotion_id:null===r||void 0===r?void 0:r.guid,promotion_name:null===r||void 0===r?void 0:r.name,items:L.bN(null===y||void 0===y?void 0:y.skus,Z)}})}}).ref,j=(0,d.useCallback)((function(e){e&&(F.Gh({items:(0,re.O)([e],{item_list_name:null===r||void 0===r?void 0:r.name,item_list_id:null===r||void 0===r?void 0:r.guid})}),(0,ae.uH)({eventName:c?"select_item_".concat(c.toLowerCase()):"select_item",objectID:e.guid,userId:null===h||void 0===h?void 0:h.userId,timestamp:Date.now(),metadata:{userType:(null===h||void 0===h?void 0:h.isEnduser)?"B2C":"B2B"}}))}),[null===r||void 0===r?void 0:r.name,null===r||void 0===r?void 0:r.guid,c,null===h||void 0===h?void 0:h.userId]);return(0,d.useEffect)((function(){var e;0===(null===y||void 0===y||null===(e=y.skus)||void 0===e?void 0:e.length)&&(null===s||void 0===s||s())}),[null===y||void 0===y||null===(l=y.skus)||void 0===l?void 0:l.length]),(0,t.jsxs)("div",{className:(0,v.Z)(p.root,a),children:[(0,t.jsx)(O,{className:p.header,post:(0,g.Z)((0,m.Z)({},r),{modelName:null===y||void 0===y?void 0:y.modelName}),sequence:u}),b||q()(null===y||void 0===y?void 0:y.skus)?(0,t.jsx)(J,{}):(0,t.jsx)("div",{ref:_,children:(0,t.jsx)(le,{skus:null===y||void 0===y?void 0:y.skus,onClickCard:j,onRealIndexChange:function(e,i,o){if(o)F.rL({action:"right",scroll_depth:"100%",post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type});else{var n,t,l=null!==(t=null===y||void 0===y||null===(n=y.skus)||void 0===n?void 0:n.length)&&void 0!==t?t:1,a=Math.floor(e/l*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(a),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(a),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type})}},onClickToSwipe:function(){L.pA({ecommerce:(0,W.D)({sequence:Number(u),modelName:null===r||void 0===r?void 0:r.modelName,guid:null===r||void 0===r?void 0:r.guid,name:null===r||void 0===r?void 0:r.name,type:null===r||void 0===r?void 0:r.type})})},onScrollbarDragEnd:function(){L.bg({ecommerce:(0,W.D)({sequence:Number(u),modelName:null===r||void 0===r?void 0:r.modelName,guid:null===r||void 0===r?void 0:r.guid,name:null===r||void 0===r?void 0:r.name,type:null===r||void 0===r?void 0:r.type})})}})})]})},ue=o(66986),ce=o(84823),pe=o(42660),ve=o(47568),me=o(97582),ge=o(88767),he=o(12757),fe="/api/product/resources/categories",xe="seqNo:asc",ye=(function(){var e=(0,ve.Z)((function(e,i){var o,t,l,a,r,d,s,u,c;return(0,me.__generator)(this,(function(p){switch(p.label){case 0:return o=e.options,t=e.language,l=o.page,a=o.limit,r=o.guid,d=o.name,s=o.maxChildrenLevel,u=o.sort,[4,he.E0.get(fe,{params:{guid:r,language:t,limit:a||100,maxChildrenLevel:s||1,name:d,page:l,sort:u||xe},headers:(0,m.Z)({},(0,he.Ek)(i))})];case 1:return c=p.sent(),v=c.data,[2,(0,g.Z)((0,m.Z)({},v),{records:null===v||void 0===v?void 0:v.records.map((function(e){var i;return(0,g.Z)((0,m.Z)({},e),{children:null!==(n=null===e||void 0===e||null===(i=e.children)||void 0===i?void 0:i.filter((function(e){return!1!==(null===e||void 0===e?void 0:e.isFilterEnabled)})))&&void 0!==n?n:[]})})).filter((function(e){return!1!==(null===e||void 0===e?void 0:e.isFilterEnabled)}))})]}var v}))}))}(),(0,u.Z)((function(e){return(0,c.Z)({root:{}})}))),be=function(e){var i,o,n,l=e.className,a=e.post,r=e.sequence,s=e.onEmptyData,u=ye(),c=function(e){var i=e.path,o=void 0===i?fe:i,n=(0,K.useSession)().data,t=(0,A.$G)().i18n,l=e.page,a=e.limit,r=e.guid,d=e.name,s=e.maxChildrenLevel,u=e.sort;return(0,ge.useQuery)({queryFn:(0,ve.Z)((function(){return(0,me.__generator)(this,(function(e){switch(e.label){case 0:return[4,he.E0.get(o,{params:{guid:r,language:t.language,limit:a||100,maxChildrenLevel:s||1,name:d,page:l,sort:u||xe},headers:(0,m.Z)({},(0,he.Ek)(null===n||void 0===n?void 0:n.accessToken))})];case 1:return[2,e.sent().data]}}))})),queryKey:["content-categories",o],enabled:!q()(o)})}({maxChildrenLevel:1,page:1,path:null===a||void 0===a||null===(i=a.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),p=c.data,g=c.isLoading,h=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&(L.hW({custom_dimensions:{post_guid:null===a||void 0===a?void 0:a.guid,post_model:null===a||void 0===a?void 0:a.modelName,post_type:null===a||void 0===a?void 0:a.type,post_name:null===a||void 0===a?void 0:a.name,post_position:r},ecommerce:{promotion_id:null===a||void 0===a?void 0:a.guid,promotion_name:null===a||void 0===a?void 0:a.name}}),F.S4({post_guid:null===a||void 0===a?void 0:a.guid,post_name:null===a||void 0===a?void 0:a.name,post_type:pe.JH.POST_CATEGORY}))}}).ref;return(0,d.useEffect)((function(){0===(null===p||void 0===p?void 0:p.records.length)&&(null===s||void 0===s||s())}),[null===p||void 0===p?void 0:p.records.length]),(0,t.jsxs)("div",{className:(0,v.Z)(u.root,l),children:[(0,t.jsx)(O,{post:a,sequence:r}),g?(0,t.jsx)(ce.Z,{amount:10}):(0,t.jsx)("div",{ref:h,children:(0,t.jsx)(ue.Z,{categories:null===p||void 0===p?void 0:p.records,handleItem
1Click:function(e){L.G5({custom_dimensions:{post_guid:null===e||void 0===e?void 0:e.guid,post_type:null===a||void 0===a?void 0:a.type,post_name:null===e||void 0===e?void 0:e.name,post_position:r},ecommerce:(0,W.D)({sequence:r,guid:null===e||void 0===e?void 0:e.guid,name:null===e||void 0===e?void 0:e.name,type:null===a||void 0===a?void 0:a.type})}),L.au({ecommerce:{content_id:null===e||void 0===e?void 0:e.guid,content_name:null===e||void 0===e?void 0:e.name,content_type:"category"}}),F.uY({ecommerce:{post_guid:null===e||void 0===e?void 0:e.guid,post_name:null===e||void 0===e?void 0:e.name,post_type:pe.JH.POST_CATEGORY}})},handleOnScrollClick:function(e,i){var o,n=null!==(o=null===p||void 0===p?void 0:p.totalRecord)&&void 0!==o?o:1,t=Math.floor(e/n*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(t),"%"),post_guid:null===a||void 0===a?void 0:a.guid,post_name:null===a||void 0===a?void 0:a.name,post_type:pe.JH.POST_CATEGORY}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(t),"%"),post_guid:null===a||void 0===a?void 0:a.guid,post_name:null===a||void 0===a?void 0:a.name,post_type:pe.JH.POST_CATEGORY})},imageUrlKey:"imageSquareSrc",primaryTextKey:"name",valueKey:"slug"})})]})},Ze=o(61128),_e=o(2408),je=o(828),we=o(23907),Ne=(0,je.Z)((0,we.kr)(),2),ke=Ne[0],Ce=Ne[1],Se=[0,1,2],Te=function(e){var i=e.children,o=e.sectionData,n=(0,d.useState)(!1),l=n[0],a=n[1],r=(0,d.useCallback)((function(){a(!0)}),[]),s=(0,d.useMemo)((function(){return{sectionHidden:l,section:null===o||void 0===o?void 0:o.section,sequence:null===o||void 0===o?void 0:o.sequence,isFirstBanner:null===o||void 0===o?void 0:o.isFirstBanner,hideSelfSection:r}}),[l,o]),u=(0,d.useCallback)((function(){return l?null:Se.includes(o.sequence)?i:(0,t.jsx)(x.df,{rootMargin:"500px 0px",triggerOnce:!0,children:function(e){var o=e.ref,n=e.inView;return(0,t.jsx)("div",{ref:o,style:(0,m.Z)({},!n&&{minHeight:"400px"}),children:n&&i})}})}),[o,l]);return(0,t.jsx)(ke,{value:s,children:u()})},Ie=o(78788),Ee=o(25675),De=o.n(Ee),Re=o(11163),Pe=o(5434),qe=o(91517),Ae=(0,u.Z)((function(e){var i,o;return(0,c.Z)({root:(i={position:"relative",display:"grid",gridTemplateColumns:"repeat(2, 1fr)",width:"100%"},(0,s.Z)(i,e.breakpoints.only("sm"),{display:"flex"}),(0,s.Z)(i,"alignItems","center"),(0,s.Z)(i,"gap",e.spacing(1)),i),wrapper:{position:"relative",display:"flex",justifyContent:"space-between",flexDirection:"column"},secondTitle:{display:"inline-flex",alignItems:"baseline",gap:e.spacing(.5)},couponImage:(0,s.Z)({position:"relative"},e.breakpoints.up("sm"),{width:"100%",height:"auto"}),discountText:(0,s.Z)({position:"absolute",zIndex:2,bottom:10,left:18,maxWidth:60,lineHeight:"16px"},e.breakpoints.only("sm"),{left:20}),rewardText:(0,s.Z)({position:"absolute",zIndex:2,bottom:0,left:85,lineHeight:"16px",display:"inline-flex"},e.breakpoints.only("sm"),{left:115}),button:(o={color:"white",backgroundColor:"#00B46C",borderBottom:"4px solid #004637",padding:e.spacing(1),maxWidth:130},(0,s.Z)(o,e.breakpoints.up("md"),{padding:e.spacing(1,2.75)}),(0,s.Z)(o,"&:hover",{backgroundColor:"#009157"}),o),symbolText:{marginTop:"6px"}})})),Le=function(e){var i,o=e.onClick,n=e.acceptRebateDetail,r=Ae(),d=(0,l.Z)(),s=(0,A.$G)("rebateProgram").t,u=(0,a.Z)(d.breakpoints.only("sm"));return(0,t.jsxs)("div",{className:r.root,children:[(0,t.jsx)(y.Z,{variant:"h6",className:r.discountText,children:s("unaccepted.badge_title")}),(0,t.jsxs)("span",{className:r.rewardText,children:[(0,t.jsx)(y.Z,{variant:"subtitle2",className:r.symbolText,children:"\u0e3f"}),(0,t.jsx)(y.Z,{variant:"h3",children:(null===n||void 0===n||null===(i=n.rebateAmount)||void 0===i?void 0:i.toLocaleString())||0})]}),(0,t.jsx)(De(),{src:"/images/coupon-background.png",alt:"coupon-background",layout:"fixed",objectFit:"fill",width:u?250:190,height:50,quality:100,className:r.couponImage}),(0,t.jsx)(b.Z,{className:r.button,variant:"contained",onClick:o,children:(0,t.jsx)(y.Z,{variant:"subtitle1",children:s("button.accept")})})]})},Fe=(0,u.Z)((function(){return(0,c.Z)({wrapper:{position:"absolute",display:"flex",justifyContent:"space-between",flexDirection:"column",zIndex:1,top:20},whiteText:{color:"white"},boldText:{fontWeight:700},mediumText:{fontWeight:400}})})),We=function(){var e=Fe(),i=(0,A.$G)("rebateProgram").t;return(0,t.jsxs)("div",{className:e.wrapper,children:[(0,t.jsx)(y.Z,{variant:"subtitle1",className:(0,v.Z)(e.boldText,e.whiteText),children:i("unaccepted.title.part1")}),(0,t.jsx)(y.Z,{variant:"h3",className:e.whiteText,children:i("unaccepted.title.part2")}),(0,t.jsx)(y.Z,{variant:"h4",className:(0,v.Z)(e.mediumText,e.whiteText),children:i("unaccepted.title.part3")})]})},Be=(0,u.Z)((function(e){var i,o;return(0,c.Z)({root:{position:"relative",width:"100%",borderRadius:e.spacing(1.25),boxShadow:e.shadows[1],minWidth:350,cursor:"pointer"},wrapper:{padding:e.spacing(2,2,0,2)},info:(i={position:"absolute",top:e.spacing(1),right:e.spacing(1)},(0,s.Z)(i,e.breakpoints.only("sm"),{right:15}),(0,s.Z)(i,"display","inline-flex"),(0,s.Z)(i,"color","white"),(0,s.Z)(i,"alignItems","center"),i),coverImage:{minHeight:215},imageContent:{width:"100%",height:"100%",borderRadius:12},footerWrapper:(o={position:"absolute",bottom:25},(0,s.Z)(o,e.breakpoints.up("sm"),{bottom:30}),(0,s.Z)(o,e.breakpoints.up("md"),{bottom:30,left:10}),o)})})),Oe="https://res.cloudinary.com/freshketimage001/image/upload/v1758786521/oms/shared/rebate-program/acceptance/rebate_cover_desktop.jpg",He="https://res.cloudinary.com/freshketimage001/image/upload/v1758786521/oms/shared/rebate-program/acceptance/rebate_cover_mobile.jpg",Ge=function(){var e,i,o,n,l=Be(),r=(0,Re.useRouter)(),d=(0,A.$G)("rebateProgram").t,s=(0,qe.K4)().mutateAsync,u=(0,a.Z)((function(e){return e.breakpoints.up("md")})),c=(0,a.Z)((function(e){return e.breakpoints.only("sm")}))&&!u,p=(0,a.Z)((function(e){return e.breakpoints.down("sm")})),v=(0,qe.ER)().data,m=(0,ge.useQueryClient)(),g=null===v||void 0===v||null===(e=v[0])||void 0===e||null===(i=e.programs)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.programDetails)||void 0===n?void 0:n[0],h=function(){var e=(0,ve.Z)((function(e){var i,o;return(0,me.__generator)(this,(function(n){switch(n.label){case 0:return e.stopPropagation(),(null===v||void 0===v||null===(i=v[0])||void 0===i?void 0:i.groupId)?[4,s({groupIds:[null===v||void 0===v||null===(o=v[0])||void 0===o?void 0:o.groupId]})]:[3,2];
1case 1:n.sent(),null===m||void 0===m||m.invalidateQueries("rebate-program-v2"),r.push("/rebate-program-details"),n.label=2;case 2:return[2]}}))}));return function(i){return e.apply(this,arguments)}}();return(0,t.jsxs)("div",{className:l.root,onClick:function(){r.push("/rebate-program-details")},children:[(0,t.jsx)("div",{className:l.coverImage,children:c||p?(0,t.jsx)(De(),{src:u||c?Oe:He,width:100,height:c?45:70,layout:"responsive",objectFit:"cover",quality:100,alt:"rebate program cover",className:l.imageContent,priority:!0}):(0,t.jsx)(De(),{src:u||c?Oe:He,width:u?350:358,height:u?218:250,layout:"fixed",objectFit:"cover",quality:100,alt:"rebate program cover",className:l.imageContent,priority:!0})}),(0,t.jsxs)("div",{className:l.wrapper,children:[(0,t.jsxs)("div",{className:l.info,children:[(0,t.jsx)(y.Z,{variant:"caption",style:{color:"white"},children:d("button.see_detail")}),(0,t.jsx)(Pe.FNi,{})]}),(0,t.jsx)(We,{}),(0,t.jsx)("div",{className:l.footerWrapper,children:(0,t.jsx)(Le,{onClick:function(e){return h(e)},acceptRebateDetail:g})})]})]})},ze=o(81850),Me=(0,je.Z)((0,we.kr)(),2),Ke=Me[0],Ye=Me[1],Je=function(e){var i,o,n=e.children,l=(0,qe.cb)(),a=l.data,r=l.isLoading,d=l.isError,s=(0,qe.ER)(),u=s.data,c=s.isLoading,p=s.isError,v=null===u||void 0===u?void 0:u.length,m=null===a||void 0===a?void 0:a.find((function(e){return e.isActive})),g=null===(i=null===a||void 0===a?void 0:a.filter((function(e){return!e.isActive})))||void 0===i?void 0:i[0],h=Boolean(v&&(null===u||void 0===u||null===(o=u[0])||void 0===o?void 0:o.isAccepted)||(null===m||void 0===m?void 0:m.isActive)),f=Boolean(!m&&g);return r||c||d||p?null:(0,t.jsx)(Ke,{value:{rebateProgramData:a,rebateAcceptedData:u,currentActiveRebate:m,latestHistoryRebate:g,isAcceptedRebate:h,isRebateEndedWithAccepted:f},children:n})},$e=Ye,Ve=(0,u.Z)((function(e){var i,o;return(0,c.Z)({root:(0,s.Z)({},e.breakpoints.down("xs"),{padding:0}),bannerContainer:{display:"flex",width:"100%",flexDirection:"column",overflow:"hidden",gap:e.spacing(1)},bannerDesktopContainer:{display:"flex",flexDirection:"row-reverse",width:"100%",borderRadius:e.spacing(1.5)},bannerImage:(i={width:"100%",minHeight:100,minWidth:100,order:1},(0,s.Z)(i,e.breakpoints.up("sm"),{maxWidth:"1500px"}),(0,s.Z)(i,e.breakpoints.up("md"),{order:2}),i),missionWrapper:(0,s.Z)({order:2,marginBottom:e.spacing(2)},e.breakpoints.up("md"),{order:1,marginBottom:0}),customMissionWrapper:(0,s.Z)({order:1},e.breakpoints.up("md"),{minHeight:220}),campaignSkeleton:(o={borderRadius:e.spacing(2)},(0,s.Z)(o,e.breakpoints.down("lg"),{height:250,minWidth:825}),(0,s.Z)(o,e.breakpoints.down("sm"),{height:180,minWidth:600}),(0,s.Z)(o,e.breakpoints.down("xs"),{height:150,minWidth:500}),(0,s.Z)(o,"height",220),(0,s.Z)(o,"margin",e.spacing(3,0)),o),rebateEndWrapper:(0,s.Z)({},e.breakpoints.up("md"),{minHeight:0})})})),Qe=function(e){var i,o,n,r,u,c,p=e.className,m=e.post,g=e.sequence,h=e.onEmptyData,f=e.page,y=Ve(),b=(0,l.Z)(),Z=(0,a.Z)(b.breakpoints.up("md")),_=Ce().isFirstBanner,j=function(e){var i=e.path,o=void 0===i?"":i,n=(0,K.useSession)().data,t=(0,A.$G)().i18n;return(0,ge.useQuery)({queryFn:(0,ve.Z)((function(){return(0,me.__generator)(this,(function(e){return[2,(0,Ie.L)({path:o,language:t.language},null===n||void 0===n?void 0:n.accessToken)]}))})),queryKey:["content-banners",o],enabled:!q()(o)})}({path:null===m||void 0===m||null===(i=m.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),w=j.data,N=j.isLoading,k=j.error,C=(0,Ze.useFlags)(["new_rebate_program"]),S=$e(),T=S.rebateProgramData,I=S.rebateAcceptedData,E=S.isAcceptedRebate,R=S.isRebateEndedWithAccepted,P=["Business","Home","Household"].includes(null!==f&&void 0!==f?f:"")&&_,W=(null===C||void 0===C||null===(r=C.new_rebate_program)||void 0===r?void 0:r.enabled)&&P&&(Array.isArray(I)&&I.length>0||Array.isArray(T)&&T.length>0),B=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&(L.hW({custom_dimensions:{post_guid:null===m||void 0===m?void 0:m.guid,post_model:null===m||void 0===m?void 0:m.modelName,post_type:null===m||void 0===m?void 0:m.type,post_name:null===m||void 0===m?void 0:m.name,post_position:g}
1,ecommerce:{promotion_id:null===m||void 0===m?void 0:m.guid,promotion_name:null===m||void 0===m?void 0:m.name}}),F.F({banner_guid:null===m||void 0===m?void 0:m.guid,banner_name:null===m||void 0===m?void 0:m.name}))}}).ref,H=(0,d.useMemo)((function(){return R?null:E?(0,t.jsx)(ze.Z,{isShowCover:!0}):(0,t.jsx)(Ge,{})}),[I,T,E,R]);return(0,d.useEffect)((function(){var e;(!N&&k||0===(null===w||void 0===w||null===(e=w.records)||void 0===e?void 0:e.length))&&(null===h||void 0===h||h())}),[k,N,null===w||void 0===w||null===(u=w.records)||void 0===u?void 0:u.length]),N?(0,t.jsx)(Y.Z,{className:(0,v.Z)(y.campaignSkeleton),variant:"rect"}):(0,t.jsxs)("div",{className:(0,v.Z)(y.root,p),children:[(0,t.jsx)(O,{post:m,sequence:g}),(0,t.jsxs)("div",{className:(0,v.Z)(y.bannerContainer,(0,s.Z)({},y.bannerDesktopContainer,Z&&W)),children:[W?(0,t.jsx)(D.Z,{className:(0,v.Z)(y.missionWrapper,(c={},(0,s.Z)(c,y.customMissionWrapper,!R),(0,s.Z)(c,y.rebateEndWrapper,R),c)),children:H}):null,(0,t.jsx)("div",{ref:B,className:(0,v.Z)(y.bannerImage),children:(0,t.jsx)(_e.Z,{banners:null===w||void 0===w?void 0:w.records,isLoading:N,isMissionBanner:W})})]})]})},Ue=o(2021),Xe=o(22176),ei=(0,u.Z)((function(e){return(0,c.Z)({root:{display:"flex",overflow:"hidden",paddingTop:e.spacing(1)},skeleton:{borderRadius:e.spacing(2),marginRight:e.spacing(1),minHeight:146,minWidth:168}})})),ii=function(e){var i=e.className,o=e.amount,n=void 0===o?8:o,l=ei();return(0,t.jsx)("div",{className:(0,v.Z)(l.root,i),"data-testid":"brands-skeleton-root",children:d.Children.toArray(Array(n).fill("").map((function(e,i){return(0,t.jsx)(Y.Z,{className:l.skeleton,variant:"rect"},"skeleton-".concat(e+i))})))})},oi=(0,u.Z)((function(e){return(0,c.Z)({action:{padding:e.spacing(1,0),width:"100%"},arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},button:{backgroundColor:"rgba(25, 30, 40, 0.04)",display:"flex",justifyContent:"space-between",width:"100%"},buttonArrow:{color:"#CED4DA"},card:{WebkitTapHighlightColor:"transparent",alignItems:"center",borderRadius:e.shape.borderRadius,boxShadow:e.shadows[1],color:"inherit",display:"flex",flexDirection:"column",height:"100%",minWidth:130,padding:e.spacing(1),width:"fit-content"},media:{height:100,width:100},root:{},swiper:{padding:e.spacing(2,0,4,1)}})})),ni=function(e){var i,o,n,l,a=e.className,r=e.post,s=e.sequence,u=e.onEmptyData,c=oi(),p=function(e){var i=e.path,o=void 0===i?"":i,n=(0,K.useSession)().data,t=(0,A.$G)().i18n;return(0,ge.useQuery)({queryFn:(0,ve.Z)((function(){return(0,me.__generator)(this,(function(e){return[2,(0,Ie.L)({path:o,language:t.language},null===n||void 0===n?void 0:n.accessToken)]}))})),queryKey:["content-brands",o],enabled:!q()(o)})}({path:null===r||void 0===r||null===(i=r.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),g=p.data,h=p.isLoading,f=function(e){var i=e.guid,o=e.title;L.G5({custom_dimensions:{post_guid:i,post_name:o,post_position:s,post_type:null===r||void 0===r?void 0:r.type},ecommerce:(0,W.D)({sequence:s,guid:i,name:o,type:null===r||void 0===r?void 0:r.type})}),F.RR({post_guid:i,post_name:o,post_type:null===r||void 0===r?void 0:r.type})},y=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&(L.hW({custom_dimensions:{post_guid:null===r||void 0===r?void 0:r.guid,post_model:null===r||void 0===r?void 0:r.modelName,post_type:null===r||void 0===r?void 0:r.type,post_name:null===r||void 0===r?void 0:r.name,post_position:s},ecommerce:{promotion_id:null===r||void 0===r?void 0:r.guid,promotion_name:null===r||void 0===r?void 0:r.name}}),F.M_({post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}))}}).ref;return(0,d.useEffect)((function(){0===(null===g||void 0===g?void 0:g.records.length)&&(null===u||void 0===u||u())}),[null===g||void 0===g?void 0:g.records.length]),(0,t.jsxs)("div",{className:(0,v.Z)(c.root,a),"data-testid":"post-premium-brand-root",children:[(0,t.jsx)(O,{post:r,sequence:s}),h?(0,t.jsx)(ii,{amount:7}):(0,t.jsx)("div",{ref:y,children:(0,t.jsx)(S.Z,{arrowNext:c.arrowNext,arrowPrev:c.arrowPrev,swiper:{className:c.swiper},onClickToSwipe:function(){return L.pA({ecommerce:(0,W.D)({sequence:Number(s),modelName:null===r||void 0===r?void 0:r.modelName,guid:null===r||void 0===r?void 0:r.guid,name:null===r||void 0===r?void 0:r.name,type:null===r||void 0===r?void 0:r.type})})},onRealIndexChange:function(e){!function(e,i,o){var n,t=null!==(n=null===g||void 0===g?void 0:g.records.length)&&void 0!==n?n:1,l=Math.floor(i/t*100);e?F.rL({action:"right",scroll_depth:"100%",post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}):i>o?F.rL({action:"right",scroll_depth:"".concat(String(l),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}):i<o&&F.rL({action:"left",scroll_depth:"".concat(String(l),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type})}(e.isEnd,e.realIndex,e.previousIndex)},children:d.Children.toArray(null===g||void 0===g||null===(l=g.records)||void 0===l?void 0:l.map((function(e){var i,o=(0,m.Z)({},e),n=o.sizes,l=o.guid,a=o.action,r=o.name;return(0,t.jsx)(I.o5,{style:{width:"auto"},children:(0,t.jsx)(Ue.Z,{onClick:f,guid:l,alt:r,href:(0,Xe.S)(a),imageSrc:(null===(i=null===n||void 0===n?void 0:n.find((function(e){return"DESKTOP"
1===(null===e||void 0===e?void 0:e.name)})))||void 0===i?void 0:i.url)||"",title:r})},l)})))})})]})},ti=(0,u.Z)((function(e){return(0,c.Z)({arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},root:{},swiper:{padding:e.spacing(2,0,4,1)},title:{marginBottom:e.spacing(1)},verticalCard:{textAlign:"left",width:196}})})),li=function(e){var i,o,n,l,a=e.className,r=e.post,s=e.onEmptyData,u=e.sequence,c=e.page,p=ti(),f=(0,G.iQ)().data,y=(0,H.t)({path:null===r||void 0===r||null===(i=r.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),b=y.data,Z=y.isLoading,_=(null===r||void 0===r?void 0:r.guid)?{promotion_id:null===r||void 0===r?void 0:r.guid,post_guid:null===r||void 0===r?void 0:r.guid}:{},j=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&L.hW({custom_dimensions:{post_guid:null===r||void 0===r?void 0:r.guid,post_model:null===b||void 0===b?void 0:b.modelName,post_type:null===r||void 0===r?void 0:r.type,post_name:null===r||void 0===r?void 0:r.name,post_position:u},ecommerce:{promotion_id:null===r||void 0===r?void 0:r.guid,promotion_name:null===r||void 0===r?void 0:r.name,items:L.bN(null===b||void 0===b?void 0:b.skus,_)}})}}).ref;return(0,d.useEffect)((function(){var e;0===(null===b||void 0===b||null===(e=b.skus)||void 0===e?void 0:e.length)&&(null===s||void 0===s||s())}),[null===b||void 0===b||null===(l=b.skus)||void 0===l?void 0:l.length]),(0,t.jsxs)("div",{className:(0,v.Z)(p.root,a),"data-testid":"post-normal-root",children:[(0,t.jsx)(O,{post:(0,g.Z)((0,m.Z)({},r),{modelName:null===b||void 0===b?void 0:b.modelName}),sequence:u}),Z?(0,t.jsx)(E.Z,{}):(0,t.jsx)("div",{ref:j,children:(0,t.jsx)(S.Z,{arrowNext:p.arrowNext,arrowPrev:p.arrowPrev,swiper:{className:p.swiper},onClickToSwipe:function(){return L.pA({ecommerce:(0,W.D)({sequence:Number(u),modelName:null===r||void 0===r?void 0:r.modelName,guid:null===r||void 0===r?void 0:r.guid,name:null===r||void 0===r?void 0:r.name,type:null===r||void 0===r?void 0:r.type})})},onRealIndexChange:function(e){var i=e.realIndex,o=e.previousIndex;e.isEnd?F.rL({action:"right",scroll_depth:"100%",post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}):function(e,i){var o,n,t=null!==(n=null===b||void 0===b||null===(o=b.skus)||void 0===o?void 0:o.length)&&void 0!==n?n:1,l=Math.floor(e/t*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(l),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(l),"%"),post_guid:null===r||void 0===r?void 0:r.guid,post_name:null===r||void 0===r?void 0:r.name,post_type:null===r||void 0===r?void 0:r.type})}(i,o)},children:null===b||void 0===b?void 0:b.skus.map((function(e,i){var o,n=e.guid,l=e.images,a=e.name,d=e.sellingSize,s=e.sellingPrice,v=e.sellerSkuID,g=e.specialMessages,x=e.labels,y=e.conversionUnit,Z=e.conversionVolume,_=e.slug,j=(0,h.Z)(e,["guid","images","name","sellingSize","sellingPrice","sellerSkuID","specialMessages","labels","conversionUnit","conversionVolume","slug"]);return(0,t.jsx)(I.o5,{style:{height:"auto",width:"auto"},children:(0,t.jsx)(C.Z,(0,m.Z)({disableGost:!0,cardId:v,className:p.verticalCard,conversion:{conversionUnit:y,conversionVolume:Z},href:(0,T.j)({cardId:n,slug:_}),labels:x,mediaSrc:null===l||void 0===l||null===(o=l[0])||void 0===o?void 0:o.src,priceLabelProps:{originalPrice:null===s||void 0===s?void 0:s.originalPrice,sellingPrice:null===s||void 0===s?void 0:s.price,status:null===s||void 0===s?void 0:s.type},sku:e,specialMessages:g,subheader:d,title:a,userInfo:f,tracking:{page:c,postID:null===r||void 0===r?void 0:r.guid,postModel:null===b||void 0===b?void 0:b.modelName,postName:null===r||void 0===r?void 0:r.name,postPosition:u,postType:null===r||void 0===r?void 0:r.type}},j))},"item_sequence-".concat(i,"-").concat(n))}))})})]})},ai=(0,u.Z)((function(e){return(0,c.Z)({root:{},container:{background:"linear-gradient(83.5deg, #0F3D31 0%, #4A7D71 99.21%)",borderTopLeftRadius:e.spacing(2),borderTopRightRadius:e.spacing(2)},mainTopic:{fontSize:24,marginLeft:e.spacing(1),color:"#e3d2ad"},action:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.spacing(.75),padding:e.spacing(.75,1,.75,1.5),color:"#e3d2ad"},actionLabel:(0,g.Z)((0,m.Z)({},e.typography.body1),{fontWeight:600})})})),ri=function(e){var i=e.post,o=e.sequence,n=e.className,l=ai(),a=(0,m.Z)({},i),r=a.type,d=a.guid,s=a.name,u=a.modelName,c=a.action,p=(0,Xe.S)(c),g=(0,A.$G)().t;return(0,t.jsx)("div",{className:(0,v.Z)(l.root,n),children:(0,t.jsxs)(D.Z,{display:"flex",alignItems:"center",p:2,className:l.container,children:[(0,t.jsx)(D.Z,{flex:1,display:"flex",alignItems:"center",children:(0,t.jsx)(y.Z,{color:"primary",variant:"h5",className:l.mainTopic,children:s})}),(null===i||void 0===i?void 0:i.action)&&(0,t.jsx)(w.Z,{noWrap:!0,color:"inherit",to:p,"aria-labelledby":(null===c||void 0===c?void 0:c.name)||"see all",onClick:function(){L.G5({custom_dimensions:{post_guid:d,post_link:p,post_model:u,post_name:s,post_position:o,post_type:r},ecommerce:(0,W.D)({sequence:o,modelName:u,guid:d,name:s,type:r})}),F.F8({post_guid:d,post_name:s,post_type:r,index:o})},children:(0,t.jsxs)(D.Z,{className:l.action,children:[(0,t.jsx)(y.Z,{noWrap:!0,variant:"body2",children:q()(null===c||void 0===c?void 0:c.name)?g("common:button.see_more"):null===c||void 0===c?void 0:c.name}),(0,t.jsx)(R.Z,{})]})})]})})},di=o(21994),si=o(67265),ui=o(17812),ci=o(95111),pi=(0,u.Z)((function(e){return(0,c.Z)({root:{},title:(0,m.Z)({fontWeight:"bold","-webkit-box-orient":"vertical","-webkit-line-clamp":1,display:"-webkit-box",overflow:"hidden"},e.typography.subtitle3),description:{fontSize:"14px","-webkit-box-orient":"vertical","-webkit-line-clamp":1,display:"-webkit-box",overflow:"hidden",color:e.palette.grey[500]},highlightBrand:{width:48,height:48,border:"1px solid ".concat(e.palette.grey[200])}})})),vi=function(e){var i=e.className,o=e.title,n=void 0===o?"title":
1o,l=e.description,a=void 0===l?"description":l,r=e.action,d=e.image,s=void 0===d?"":d,u=e.guid,c=e.modelName,p=e.sequence,m=e.type,g=pi();return(0,t.jsx)("div",{"data-testid":"brand-highlight-root",className:(0,v.Z)(g.root,i),children:(0,t.jsxs)(D.Z,{position:"relative",display:"flex",onClick:function(){L.G5({custom_dimensions:{post_guid:u,post_model:c,post_name:n,post_position:p,post_type:m},ecommerce:{promotion_id:u,promotion_name:n,creative_name:m}}),F.F8({post_guid:u,post_name:n,post_type:m,index:p})},children:[(0,t.jsxs)(D.Z,{display:"flex",flex:1,alignItems:"start",flexDirection:"center",children:[(0,t.jsx)(si.Z,{alt:n,className:g.highlightBrand,src:s}),(0,t.jsxs)(D.Z,{style:{overflow:"hidden"},ml:2,children:[(0,t.jsx)(y.Z,{display:"inline",className:g.title,children:n}),(0,t.jsx)(y.Z,{display:"inline",variant:"caption",className:g.description,children:a})]})]}),r&&(0,t.jsx)(w.Z,{overlay:!0,to:(0,Xe.S)(r),children:(0,t.jsx)(ui.Z,{size:"small",children:(0,t.jsx)(ci.Z,{fontSize:"medium"})})})]})})},mi=o(16558),gi=(0,u.Z)((function(e){return(0,c.Z)({arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},root:{},swiper:{padding:e.spacing(2)},title:{marginBottom:e.spacing(1)},verticalCard:{textAlign:"left",width:196},backArrow:{background:e.palette.common.white,borderRadius:"0 50% 50% 0 ",boxShadow:"0px 2px 6px rgba(110, 116, 128, 0.24)",left:0,position:"absolute",top:"50%",transform:"translate(0%, -50%)",zIndex:10,"&:hover":{color:e.palette.primary.light}},nextArrow:{background:e.palette.common.white,borderRadius:"50% 0  0 50%",boxShadow:"0px 2px 6px rgba(110, 116, 128, 0.24)",position:"absolute",right:0,top:"50%",transform:"translate(0%, -50%)",zIndex:10,"&:hover":{color:e.palette.primary.light}},brandContainer:{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})})),hi=function(e){var i,o,n,a,r,u,c=e.className,p=e.post,m=e.onEmptyData,g=e.sequence,h=e.page,f=gi(),y=(0,l.Z)(),b=(0,d.useState)(null),Z=b[0],_=b[1],j=(0,d.useState)(null),w=j[0],N=j[1],k=(0,H.t)({path:null===p||void 0===p||null===(i=p.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),C=k.data,S=k.isLoading,D=(null===p||void 0===p?void 0:p.guid)?{promotion_id:null===p||void 0===p?void 0:p.guid,post_guid:null===p||void 0===p?void 0:p.guid}:{},R=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){if(e){var i=null===C||void 0===C?void 0:C.records.map((function(e){return e.highlightSku}));L.hW({custom_dimensions:{post_guid:null===p||void 0===p?void 0:p.guid,post_model:null===p||void 0===p?void 0:p.modelName,post_name:null===p||void 0===p?void 0:p.name,post_type:null===p||void 0===p?void 0:p.type,post_position:g},ecommerce:{promotion_id:null===p||void 0===p?void 0:p.guid,promotion_name:null===p||void 0===p?void 0:p.name,items:L.bN(i,D)}})}}}).ref;return(0,d.useEffect)((function(){var e;0===(null===C||void 0===C||null===(e=C.skus)||void 0===e?void 0:e.length)&&(null===m||void 0===m||m())}),[null===C||void 0===C||null===(a=C.skus)||void 0===a?void 0:a.length]),(0,t.jsxs)("div",{className:(0,v.Z)(f.root,c),"data-testid":"post-highlight-root",children:[(0,t.jsx)(ri,{post:p,sequence:g}),S?(0,t.jsx)(E.Z,{}):(0,t.jsxs)("div",{style:{position:"relative",padding:16,boxShadow:y.shadows[1]},ref:R,children:[(0,t.jsx)(di.$,{ref:function(e){_(e)},onClick:function(){L.av()},className:(0,v.Z)(f.backArrow)}),(0,t.jsx)(di.g,{ref:function(e){N(e)},onClick:function(){L.QL()},className:(0,v.Z)(f.nextArrow)}),(0,t.jsx)(I.tq,{slidesPerView:1.5,spaceBetween:8,breakpoints:(u={},(0,s.Z)(u,y.breakpoints.values.xs,{slidesPerView:1.5,spaceBetween:8}),(0,s.Z)(u,y.breakpoints.values.sm,{slidesPerView:2.2,spaceBetween:16}),(0,s.Z)(u,y.breakpoints.values.md,{slidesPerView:3,spaceBetween:24}),(0,s.Z)(u,y.breakpoints.values.lg,{slidesPerView:4,spaceBetween:24}),u),navigation:{nextEl:w,prevEl:Z},onRealIndexChange:function(e){var i=e.realIndex,o=e.previousIndex;e.isEnd?F.rL({action:"right",scroll_depth:"100%",post_guid:null===p||void 0===p?void 0:p.guid,post_name:null===p||void 0===p?void 0:p.name,post_type:null===p||void 0===p?void 0:p.type}):function(e,i){var o,n,t=null!==(n=null===C||void 0===C||null===(o=C.records)||void 0===o?void 0:o.length)&&void 0!==n?n:1,l=Math.floor(e/t*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(l),"%"),post_guid:null===p||void 0===p?void 0:p.guid,post_name:null===p||void 0===p?void 0:p.name,post_type:null===p||void 0===p?void 0:p.type}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(l),"%"),post_guid:null===p||void 0===p?void 0:p.guid,post_name:null===p||void 0===p?void 0:p.name,post_type:null===p||void 0===p?void 0:p.type})}(i,o)},children:null===C||void 0===C||null===(r=C.records)||void 0===r?void 0:r.map((function(e,i){var o=e.highlightSku,n=e.title,l=e.description,a=e.action,r=e.thumbnail,d=e.guid;return(0,t.jsxs)(I.o5,{children:[(0,t.jsx)(vi,{guid:d,sequence:g,className:f.brandContainer,image:r,title:n,description:l,action:a,type:null===p||void 0===p?void 0:p.type,modelName:null===p||void 0===p?void 0:p.modelName}
1),(0,t.jsx)(mi.Z,{href:(0,T.j)({cardId:o.guid,slug:o.slug}),sku:o,tracking:{page:h,postID:null===p||void 0===p?void 0:p.guid,postModel:null===p||void 0===p?void 0:p.modelName,postName:null===p||void 0===p?void 0:p.name,postType:null===p||void 0===p?void 0:p.type,postPosition:g}})]},"item_sequence-".concat(i,"-").concat(d))}))})]})]})},fi=o(57163),xi=(0,u.Z)((function(e){return(0,c.Z)({arrowNext:{transform:"translate(0, -75%)"},arrowPrev:{transform:"translate(0, -75%)"},root:{},swiper:{padding:e.spacing(2,0,4,1)}})})),yi=function(e){var i,o,n=e.className,l=e.post,a=e.sequence,r=e.onEmptyData,s=null===l||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((function(e){return"PROMOTION"===e.type})),u=function(e){var i=e.path,o=void 0===i?"":i,n=(0,K.useSession)().data,t=(0,A.$G)().i18n;return(0,ge.useQuery)({queryFn:(0,ve.Z)((function(){return(0,me.__generator)(this,(function(e){return[2,(0,Ie.L)({path:o,language:t.language},null===n||void 0===n?void 0:n.accessToken)]}))})),queryKey:["content-banners",o],enabled:!q()(o)})}({path:null===s||void 0===s||null===(o=s.dataEndpoint)||void 0===o?void 0:o.path}),c=u.data,p=u.isLoading,m=xi(),g=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&(L.hW({custom_dimensions:{post_guid:null===l||void 0===l?void 0:l.guid,post_type:null===l||void 0===l?void 0:l.type,post_name:null===l||void 0===l?void 0:l.name,post_position:a},ecommerce:{promotion_id:null===l||void 0===l?void 0:l.guid,promotion_name:null===l||void 0===l?void 0:l.name,items:[]}}),F.ZZ({post_guid:null===l||void 0===l?void 0:l.guid,post_name:null===l||void 0===l?void 0:l.name,post_type:null===l||void 0===l?void 0:l.type}))}}).ref;return(0,d.useEffect)((function(){0===(null===c||void 0===c?void 0:c.records.length)&&(null===r||void 0===r||r())}),[null===c||void 0===c?void 0:c.records.length]),(0,t.jsxs)("div",{className:(0,v.Z)(m.root,n),children:[(0,t.jsx)(O,{post:l,sequence:a}),p?(0,t.jsx)(E.Z,{}):(0,t.jsx)("div",{ref:g,children:(0,t.jsx)(S.Z,{arrowNext:m.arrowNext,arrowPrev:m.arrowPrev,swiper:{className:m.swiper},onClickToSwipe:function(){L.pA({ecommerce:(0,W.D)({sequence:Number(a),modelName:null===l||void 0===l?void 0:l.modelName,guid:null===l||void 0===l?void 0:l.guid,name:null===l||void 0===l?void 0:l.name,type:null===l||void 0===l?void 0:l.type})})},slidesPerGroup:2,onRealIndexChange:function(e){!function(e,i,o){var n,t=null!==(n=null===c||void 0===c?void 0:c.records.length)&&void 0!==n?n:1,a=Math.floor(i/t*100);e?F.rL({action:"right",scroll_depth:"100%",post_guid:null===l||void 0===l?void 0:l.guid,post_name:null===l||void 0===l?void 0:l.name,post_type:null===l||void 0===l?void 0:l.type}):i>o?F.rL({action:"right",scroll_depth:"".concat(String(a),"%"),post_guid:null===l||void 0===l?void 0:l.guid,post_name:null===l||void 0===l?void 0:l.name,post_type:null===l||void 0===l?void 0:l.type}):i<o&&F.rL({action:"left",scroll_depth:"".concat(String(a),"%"),post_guid:null===l||void 0===l?void 0:l.guid,post_name:null===l||void 0===l?void 0:l.name,post_type:null===l||void 0===l?void 0:l.type})}(e.isEnd,e.realIndex,e.previousIndex)},children:null===c||void 0===c?void 0:c.records.map((function(e){return(0,t.jsx)(I.o5,{style:{height:"auto",width:"auto"},children:(0,t.jsx)(fi.D,{promotion:e})},e.guid)}))})})]})},bi=(0,u.Z)((function(e){return(0,c.Z)({root:{display:"flex",justifyContent:"space-between",paddingBottom:e.spacing(2)},title:{gap:e.spacing(1),display:"flex",alignItems:"center"},action:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#DE1B1B",borderRadius:e.spacing(.75),padding:e.spacing(.75,1,.75,1.5),color:e.palette.common.white}})})),Zi=function(e){var i,o,n=e.className,l=e.post,a=e.sequence,r=bi(),d=(0,A.$G)().t,s=(0,m.Z)({},null===l||void 0===l||null===(i=l.action)||void 0===i||null===(o=i.target)||void 0===o?void 0:o.data),u=s.name,c=s.id,p=(0,m.Z)({},l),g=p.slug,h=p.type,f=p.guid,x=p.name,b=p.modelName,Z=g?"/".concat(g):"",_="/posts".concat(Z,"/").concat(c);return(0,t.jsxs)(D.Z,{className:(0,v.Z)(r.root,n),children:[(null===l||void 0===l?void 0:l.name)&&(0,t.jsxs)(D.Z,{className:r.title,"aria-labelledby":(null===l||void 0===l?void 0:l.name)||"hot deal",children:[(0,t.jsx)(j.Z,{src:"/images/icons/fire.svg",width:32,height:32}),(0,t.jsx)(y.Z,{display:"inline",variant:"h4",children:null===l||void 0===l?void 0:l.name})]}),(null===l||void 0===l?void 0:l.action)&&(0,t.jsx)(w.Z,{noWrap:!0,color:"inherit",to:_,"aria-labelledby":u||"see all",onClick:function(){L.G5({custom_dimensions:{post_guid:f,post_link:_,post_model:b,post_name:x,post_position:a,post_type:h},ecommerce:(0,W.D)({sequence:a,modelName:b,guid:f,name:x,type:h})})},children:(0,t.jsxs)(D.Z,{className:r.action,children:[(0,t.jsx)(y.Z,{variant:"body2",noWrap:!0,children:q()(u)?d("common:button.see_more"):u}),(0,t.jsx)(R.Z,{})]})})]})},_i=o(8400),ji=o.n(_i),wi=(0,u.Z)((function(e){var i;return(0,c.Z)({root:{padding:e.spacing(2),background:"linear-gradient(120.1deg, #FFDEC6 0%, #F78F54 99.09%)",boxShadow:"0px 0px 24px rgba(122, 172, 193, 0.16)",borderRadius:"8px"},swiper:{width:"100%",height:"100%",marginLeft:"auto",marginRight:"auto","& .swiper-horizontal":{paddingBottom:"25px"},"& .swiper-scrollbar":{width:"80px",left:"50%",transform:"translateX(-50%)",backgroundColor:e.palette.common.white},"& .swiper-scrollbar-drag":{width:"80px",backgroundColor:"".concat(e.palette.primary.main," !important")},"& .swiper-slide":{marginTop:"8px"}},arrowNext:{transform:"translate(0, -75%)",right:e.spacing(-2)},arrowPrev:{transform:"translate(0, -75%)",left:e.spacing(-2)},card:(i={},(0,s.Z)(i,e.breakpoints.down("sm"),{width:"140px"}),(0,s.Z)(i,"borderRadius",8),i)})})),Ni=function(e){var i,o,n,r,s=e.className,u=e.post,c=e.sequence,p=e.onEmptyData,m=wi(),g=(0,l.Z)(),h=(0,a.Z)(g.breakpoints.down("sm"),{noSsr:!0}),y=(0,H.t)({path:null===u||void 0===u||null===(i=u.items)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.dataEndpoint)||void 0===n?void 0:n.path}),b=y.data,Z=y.isLoading,_=(0,d.useMemo)((function(){var e,i=null!==(e=null===b||void 0===b?void 0:b.skus)&&void 0!==e?e:[];return(0,f.Z)(i.filter((function(e){return(0,ie.R)(e.remainingAmou
1nt)}))).concat((0,f.Z)(i.filter((function(e){return!(0,ie.R)(e.remainingAmount)}))))}),[null===b||void 0===b?void 0:b.skus]),j=(0,d.useMemo)((function(){return(e=_).length<11?e:ji()(e,12).flatMap((function(e){var i=e.filter((function(e,i){return i%2===0})),o=e.filter((function(e,i){return i%2===1}));return(0,f.Z)(i).concat((0,f.Z)(o))}));var e}),[_]),w=(0,d.useMemo)((function(){return{post_guid:null===u||void 0===u?void 0:u.guid,post_model:null===u||void 0===u?void 0:u.modelName,post_name:null===u||void 0===u?void 0:u.name,post_type:null===u||void 0===u?void 0:u.type,post_position:c}}),[]),N=(null===u||void 0===u?void 0:u.guid)?{promotion_id:null===u||void 0===u?void 0:u.guid,post_guid:null===u||void 0===u?void 0:u.guid}:{},k=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&L.hW({custom_dimensions:w,ecommerce:{promotion_id:null===u||void 0===u?void 0:u.guid,promotion_name:null===u||void 0===u?void 0:u.name,items:L.bN(_,N)}})}}).ref,C=(0,d.useCallback)((function(e){F.Gh({items:(0,re.t)([e],{item_list_id:null===u||void 0===u?void 0:u.guid,item_list_name:null===u||void 0===u?void 0:u.name})})}),[w]);return(0,d.useEffect)((function(){var e;0===(null===b||void 0===b||null===(e=b.skus)||void 0===e?void 0:e.length)&&(null===p||void 0===p||p())}),[null===b||void 0===b||null===(r=b.skus)||void 0===r?void 0:r.length]),(0,t.jsxs)("div",{className:(0,v.Z)(m.root,s),"data-testid":"post-hot-deal-root",children:[(0,t.jsx)(Zi,{post:u,sequence:c}),Z?(0,t.jsx)(J,{}):(0,t.jsx)("div",{ref:k,children:(0,t.jsx)(S.Z,{slidesPerView:h?"auto":6,slidesPerGroup:6,grid:{rows:2,fill:"row"},spaceBetween:8,scrollbar:{draggable:!0,dragSize:32},onScrollbarDragEnd:function(){L.bg({ecommerce:(0,W.D)({sequence:Number(c),modelName:null===u||void 0===u?void 0:u.modelName,guid:null===u||void 0===u?void 0:u.guid,name:null===u||void 0===u?void 0:u.name,type:null===u||void 0===u?void 0:u.type})})},modules:[$.rj,$.LW],className:m.swiper,arrowNext:m.arrowNext,arrowPrev:m.arrowPrev,onClickToSwipe:function(){return L.pA({ecommerce:(0,W.D)({sequence:Number(c),modelName:null===u||void 0===u?void 0:u.modelName,guid:null===u||void 0===u?void 0:u.guid,name:null===u||void 0===u?void 0:u.name,type:null===u||void 0===u?void 0:u.type})})},onRealIndexChange:function(e){var i=e.realIndex,o=e.previousIndex;e.isEnd?F.rL({action:"right",scroll_depth:"100%",post_guid:null===u||void 0===u?void 0:u.guid,post_name:null===u||void 0===u?void 0:u.name,post_type:null===u||void 0===u?void 0:u.type}):function(e,i){var o,n,t=null!==(n=null===b||void 0===b||null===(o=b.skus)||void 0===o?void 0:o.length)&&void 0!==n?n:1,l=Math.floor(e/t*100);e>i?F.rL({action:"right",scroll_depth:"".concat(String(l),"%"),post_guid:null===u||void 0===u?void 0:u.guid,post_name:null===u||void 0===u?void 0:u.name,post_type:null===u||void 0===u?void 0:u.type}):e<i&&F.rL({action:"left",scroll_depth:"".concat(String(l),"%"),post_guid:null===u||void 0===u?void 0:u.guid,post_name:null===u||void 0===u?void 0:u.name,post_type:null===u||void 0===u?void 0:u.type})}(i,o)},children:j.map((function(e,i){return(0,t.jsx)(I.o5,{style:{height:"auto",width:"auto"},children:(0,t.jsx)(ne,{sku:e,className:m.card,onClickCard:C})},"item_sequence-".concat(i,"-").concat(e.guid))}))})})]})},ki=o(18716),Ci=function(e){var i=e.items,o=e.isXsScreen,n=e.classes,l=e.onClickItem;return(0,t.jsx)(p.Z,{container:!0,spacing:4,children:(0,t.jsx)(p.Z,{item:!0,xs:12,children:(0,t.jsx)(S.Z,{slidesPerGroup:o?i.length:4,grid:{rows:o&&i.length>8?2:1,fill:"row"},spaceBetween:8,scrollbar:{draggable:!0,dragSize:32},modules:[$.rj,$.LW],className:(0,v.Z)(n.swiper,{notXsScreen:!o}),arrowNext:n.arrowNext,arrowPrev:n.arrowPrev,children:i.map((function(e,i){return(0,t.jsx)(I.o5,{className:n.swiperSlide,children:(0,t.jsxs)(ki.E.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.2,delay:.025*i,ease:"easeOut"},className:n.card,onClick:function(){return l(e,i)},style:q()(null===e||void 0===e?void 0:e.colorCode)?void 0:{backgroundColor:null===e||void 0===e?void 0:e.colorCode},children:[(0,t.jsx)("div",{className:n.itemImage,children:(0,t.jsx)(Q.Z,{alt:e.name,cloudinaryTransform:{height:200,width:200,type:"fit"},height:"60px",src:e.image,width:"60px"})}),(0,t.jsx)(D.Z,{className:n.tag,children:e.badgeLabel}),(0,t.jsx)(w.Z,{as:e.link,to:e.link,passHref:!0,overlay:!0,children:(0,t.jsx)("div",{className:n.itemName,children:e.name})})]})},e.name)}))},"swiper-".concat(o))})})},Si=function(e){var i=e.amount,o=void 0===i?10:i,n=e.isXsScreen;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Z,{display:"flex",flexWrap:"nowrap",justifyContent:n?"flex-start":"center",gridGap:4,overflow:"hidden",pb:1,children:d.Children.toArray(Array(o).fill("").map((function(e,i){return(0,t.jsx)(D.Z,{display:"flex",flexWrap:"nowrap",gridGap:4,pb:1,children:(0,t.jsx)(Y.Z,{height:20,style:{borderRadius:"8px"},variant:"rect",width:50},"skeleton-badge-".concat(i))},i)})))}),(0,t.jsx)(D.Z,{display:"flex",flexWrap:"nowrap",justifyContent:n?"flex-start":"center",overflow:"hidden",pb:1,children:d.Children.toArray(Array(o).fill("").map((function(e,i){return(0,t.jsx)(D.Z,{alignItems:"flex-start",border:1,borderRadius:8,color:"divider",display:"flex",flexDirection:"column",height:80,width:80,justifyContent:"space-between",mr:1,p:1,children:(0,t.jsx)(Y.Z,{height:60,style:{borderRadius:"8px"},variant:"rect",width:60},"skeleton-".concat(e+i))},i)})))}),n&&(0,t.jsx)(D.Z,{display:"flex",flexWrap:"nowrap",overflow:"hidden",children:d.Children.toArray(Array(o).fill("").map((function(e,i){return(0,t.jsx)(D.Z,{alignItems:"flex-start",border:1,borderRadius:8,color:"divider",display:"flex",flexDirection:"column",height:80,width:80,justifyContent:"space-between",mr:1,p:1,children:(0,t.jsx)(Y.Z,{height:60,style:{borderRadius:"8px"},variant:"rect",width:60},"skeleton-".concat(e+i))},i)})))})]})},Ti=(0,u.Z)((function(e){var i;return(0,c.Z)({active:{color:"".concat(e.palette.primary.dark," !important"),background:"#C8F3E2 !important",border:"1px solid #50DDA5 !important"},linkBadge:{border:"1px solid #E6E9EB",borderRadius:"100px",cursor:"pointer",transition:"border-color 0.2s, box-shadow 0.2s",backgroundColor:e.palette.common.white,padding:"2px 10px"},root:{padding:e.spacing(1),borderRadius:"8px"},swiper:{width:"100%",marginLeft:"auto",marginRight:"auto","& .swiper-horizontal":{paddingTop:"8px",paddingBottom:"20px"},"& .swiper-scrollbar":{width:"80px",left:"50%",transform:"translateX(-50%)",backgroundColor:e.palette.grey[100]},"& .swiper-scrollbar-drag":{width:"80px",backgroundColor:"".concat(e.palette.primary.main," !important")},"& .swiper-slide":{marginTop:"8px"},"&.notXsScreen":{display:"flex",flexWrap:"wrap",justifyContent:"center"}},arrowNext:{transform:"translate(0, -75%)",right:e.spacing(-2)},arrowPrev:{transform:"translate(0, -75%)",left:e.spacing(-2)},card:(i={backgroundColor:"#F0FAF8",position:"relative",aspectRatio:"76 / 84",borderRadius:8},(0,s.Z)(i,e.breakpoints.down("xs"),{minWidth:76,minHeight:84}),(0,s.Z)(i,"cursor","pointer"),i),tag:{fontSize:"10px",position:"absolute",padding:"0px 4px",borderRadius:"6px",transform:"translate(-50%, -50%)",top:"0%",left:"50%",color:e.palette.common.white,backgroundColor:"#DB2C2C",boxShadow:"0 1px 4px 0 rgba(255, 0, 0, 0.24)",whiteSpace:"nowrap"},categoryTabs:{display:"flex",justifyContent:"center",overflowX:"auto",whiteSpace:"nowrap",marginBottom:e.spacing(2),gap:8,"&.xsScreen":{justifyContent:"flex-start",marginBottom:12}},title:{fontWeight:700,fontSize:18,lineHeight:"24px",marginBottom:16,textAlign:"center","&.xsScreen":{marginBottom:12,textAlign:"left"}},swiperSlide:{height:"100px",width:"84px"},itemImage:{position:"absolute",top:"40%",left:"50%",width:"60px",height:"60px",transform:"translate(-50%, -50%)"},itemName:{position:"absolute",bottom:"0%",fontSize:"12px",left:"50%",transform:"translate(-50%, -25%)",whiteSpace:"nowrap",maxWidth:60,overflow:"hidden",textOverflow:"ellipsis",textAlign:"center",color:e.palette.common.black}})})),Ii=function(e){var i=e.className,o=e.post,n=e.sequence,r=e.onEmptyData,s=Ti(),u=(0,d.useState)([])[0],c=(0,l.Z)(),p=(0,a.Z)(c.breakpoints.down("xs"),{noSsr:!0}),m=function(e){var i=e.path,o=void 0===i?"":i,n=(0,K.useSession)().data,t=(0,A.$G)().i18n;return(0,ge.useQuery)({queryFn:(0,ve.Z)((function(){return(0,me.__generator)(this,(function(e){return[2,(0,Ie.L)({path:o,language:t.language},null===n||void 0===n?void 0:n.accessToken)]}))})),queryKey:["content-skus",o],enabled:!q()(o)})}({path:"/api/content/posts/".concat(null===o||void 0===o?void 0:o.guid,"/category-link")}),g=m.data,h=m.isLoading;(0,d.useEffect)((function(){0===(null===g||void 0===g?void 0:g.length)&&(null===r||void 0===r||r())}),[null===g||void 0===g?void 0:g.length,r]);var f=(0,x.YD)({triggerOnce:!0,threshold:1,onChange:function(e){e&&(L.hW({custom_dimensions:{post_guid:null===o||void 0===o?void 0:o.guid,post_model:null===o||void 0===o?void 0:o.type,post_type:null===o||void 0===o?void 0:o.type,post_name:null===o||void 0===o?void 0:o.name,post_position:n},ecommerce:{promotion_id:null===o||void 0===o?void 0:o.guid,promotion_name:null===o||void 0===o?void 0:o.name}}),F.S4({post_guid:null===o||void 0===o?void 0:o.guid,post_name:null===o||void 0===o?void 0:o.name,post_type:pe.JH.POST_LINK_CATEGORY}))}}).ref,b=d.useCallback((function(e,i){var t="[".concat(i,"]-").concat(null===e||void 0===e?void 0:e.link);L.G5({custom_dimensions:{post_guid:t,post_type:null===o||void 0===o?void 0:o.type,post_name:e.name,post_position:n},ecommerce:(0,W.D)({sequence:n,guid:t,name:e.name,type:null===o||void 0===o?void 0:o.type})}),L.au({ecommerce:{content_id:t,content_name:null===e||void 0===e?void 0:e.name,content_type:"category"}}),F.uY({ecommerce:{post_guid:t,post_name:null===e||void 0===e?void 0:e.name,post_type:pe.JH.POST_LINK_CATEGORY}})}),[null===o||void 0===o?void 0:o.type,n]),Z=d.useMemo((function(){return g&&null!==(o=(0===u.length?g:g.filter((function(e){return u.includes(e.name)}))).flatMap((function(e){return e.items})).sort((function(o,n){return(null!==(e=o.sequence)&&void 0!==e?e:0)-(null!==(i=n.sequence)&&void 0!==i?i:0)})))&&void 0!==o?o:[];var e,i,o}),[g,u]);return(0,t.jsx)("div",{className:(0,v.Z)(s.root,i),children:h?(0,t.jsx)(Si,{isXsScreen:p}):(0,t.jsxs)("div",{ref:f,children:[(0,t.jsx)(y.Z,{variant:"h6",className:(0,v.Z)(s.title,{xsScreen:p}),children:!q()(null===o||void 0===o?void 0:o.name)&&(null===o||void 0===o?void 0:o.name)}),(0,t.jsx)(Ci,{items:Z,isXsScreen:p,classes:s,onClickItem:b})]})})},Ei=o(33588),Di=function(e){var i;return"KKC"===(null===e||void 0===e||null===(i=e.info)||void 0===i?void 0:i.region)},Ri=function(e,i){return"loading"===e||"authenticated"===e&&void 0===i},Pi=function(){var e=(0,K.useSession)().status,i=(0,Ei.iQ)().data;return{isKKC:Di(i),isRegionPending:Ri(e,i)}},qi=function(e){var i,o=e.column,n=e.columnSequence,l=e.page,a=Ce(),r=a.hideSelfSection,s=a.sequence,u=null===o||void 0===o?void 0:o.post,c=(null===o||void 0===o||null===(i=o.post)||void 0===i?void 0:i.type)||pe.JH.POST_NORMAL,p=Pi(),v=p.isKKC,m=p.isRegionPending,g=c===pe.JH.POST_MINI||c===pe.JH.POST_BRAND_HIGHLIGHT,h=v&&g;return(0,d.useEffect)((function(){h&&r()}),[h,r]),h||m&&g?null:c===pe.JH.POST_NORMAL?(0,t.jsx)(li,{post:u,sequence:s,onEmptyData:r,page:l}):c===pe.JH.POST_SPECIAL?(0,t.jsx)(M,{post:u,sequence:s,onEmptyData:r,page:l}
1):c===pe.JH.POST_MINI?(0,t.jsx)(se,{columnSequence:n,post:u,sequence:s,onEmptyData:r,page:l}):c===pe.JH.POST_CATEGORY?(0,t.jsx)(be,{post:u,sequence:s,onEmptyData:r}):c===pe.JH.POST_BANNER?(0,t.jsx)(Qe,{post:u,sequence:s,onEmptyData:r,page:l}):c===pe.JH.POST_PREMIUM_BRAND?(0,t.jsx)(ni,{post:u,sequence:s,onEmptyData:r}):c===pe.JH.POST_PROMOTIONS?(0,t.jsx)(yi,{post:u,sequence:s,onEmptyData:r}):c===pe.JH.POST_BRAND_HIGHLIGHT?(0,t.jsx)(hi,{post:u,sequence:s,onEmptyData:r,page:l}):c===pe.JH.POST_HOT_DEAL?(0,t.jsx)(Ni,{post:u,sequence:s,onEmptyData:r}):c===pe.JH.POST_LINK_CATEGORY?(0,t.jsx)(Ii,{post:u,sequence:s,onEmptyData:r}):null},Ai=o(29973),Li=(0,u.Z)((function(e){return(0,c.Z)({root:(0,s.Z)({},e.breakpoints.down("xs"),{padding:e.spacing(0,1.5,0,0)})})})),Fi=function(e){var i,o,n,l=e.className,a=e.section,r=Li();return(0,t.jsx)("div",{className:(0,v.Z)(r.root,l),children:(0,t.jsxs)(D.Z,{display:"flex",justifyContent:"space-between",mb:1,children:[(0,t.jsx)(D.Z,{children:(0,t.jsx)(y.Z,{noWrap:!0,variant:"h3",children:"".concat(null===a||void 0===a?void 0:a.name)})}),(null===a||void 0===a?void 0:a.action)&&(0,t.jsx)(D.Z,{display:"flex",children:(0,t.jsx)(w.Z,{noWrap:!0,color:"primary",to:"/posts",variant:"body1",children:(0,t.jsxs)(y.Z,{noWrap:!0,style:{display:"flex"},children:[null===a||void 0===a||null===(i=a.action)||void 0===i||null===(o=i.target)||void 0===o||null===(n=o.data)||void 0===n?void 0:n.name,(0,t.jsx)(Ai.Z,{})]})})})]})})},Wi=(0,u.Z)((function(e){return(0,c.Z)({root:{},sectionSpacing:(0,s.Z)({margin:e.spacing(0,1,3,1)},e.breakpoints.up("lg"),{margin:e.spacing(0,0,3,0)})})})),Bi=function(e){var i,o,n,l=e.className,a=e.page,r=Wi(),d=Ce(),s=d.section,u=d.sequence,c=Number((12/(null!==(n=null===s||void 0===s||null===(i=s.columns)||void 0===i?void 0:i.length)&&void 0!==n?n:1)).toFixed());return(0,t.jsxs)("div",{className:(0,v.Z)(r.root,r.sectionSpacing,l),children:[(0,t.jsx)(Fi,{section:s}),(0,t.jsx)(p.Z,{container:!0,spacing:2,children:null===s||void 0===s||null===(o=s.columns)||void 0===o?void 0:o.map((function(e,i){var o,n,l,r;return(0,t.jsx)(p.Z,{item:!0,"data-testid":"".concat(null===e||void 0===e||null===(o=e.post)||void 0===o||null===(n=o.type)||void 0===n?void 0:n.toLowerCase(),"-").concat(null===(l=e.post)||void 0===l?void 0:l.guid),sm:c,xs:12,children:(0,t.jsx)(qi,{column:e,columnSequence:i,page:a})},"column_sequence-".concat(i,"-sequence-").concat(u,"-").concat(null===(r=e.post)||void 0===r?void 0:r.name))}))})]})},Oi=o(485),Hi=o(11719),Gi=o(10150),zi=(0,Hi.Z)((function(e){return(0,Gi.Z)({root:{backgroundColor:"#FFF9F5",border:"2px solid #FFC8A3",padding:e.spacing(1,1.5),borderRadius:e.spacing(1.5),display:"inline-flex",width:"100%",justifyContent:"space-between",alignItems:"center"},orangeText:{color:"#FF4100"},greenText:{color:"#008065"},icon:{fontSize:"1rem"},buttonWrapper:{color:"#008065",display:"inline-flex",justifyContent:"space-between",cursor:"pointer"},title:(0,s.Z)({userSelect:"none",fontSize:12},e.breakpoints.up("sm"),{fontSize:14}),flexBox:{display:"inline-flex",alignItems:"center"}})})),Mi=function(){var e=zi(),i=(0,A.$G)("common").t,o=(0,Re.useRouter)();return(0,t.jsxs)("div",{className:e.root,children:[(0,t.jsx)(y.Z,{variant:"subtitle2",className:e.title,children:(0,t.jsx)(A.cC,{i18nKey:"rebate.final.title",ns:"common",components:{b:(0,t.jsx)("b",{className:e.orangeText})}})}),(0,t.jsx)("div",{className:e.buttonWrapper,onClick:function(){return o.push("/rebate-program-details")},children:(0,t.jsxs)(y.Z,{variant:"caption",className:(0,v.Z)(e.greenText,e.title,e.flexBox),children:[i("rebate.final.see_detail"),(0,t.jsx)(Pe.FNi,{className:(0,v.Z)(e.icon,e.greenText)})]})})]})},Ki=(0,u.Z)((function(e){return(0,c.Z)({firstSection:(0,s.Z)({marginTop:45},e.breakpoints.up("md"),{marginTop:25}),rebateFinalContainer:{padding:e.spacing(1),width:"100%",marginTop:e.spacing(2)},rebateFinalWithAlert:{marginTop:e.spacing(8)}})})),Yi=function(e){var i,o,n=e.pageLayout,l=e.page,a=Ki(),r=(0,G.iQ)().data,u=(null===r||void 0===r?void 0:r.is_suspend)||!1,c=$e().isRebateEndedWithAccepted,m=(0,d.useMemo)((function(){var e,i;return null===n||void 0===n||null===(e=n.layout)||void 0===e||null===(i=e.sections)||void 0===i?void 0:i.findIndex((function(e){var i,o,n;return(null===e||void 0===e||null===(i=e.columns)||void 0===i||null===(o=i[0])||void 0===o||null===(n=o.post)||void 0===n?void 0:n.type)===pe.JH.POST_BANNER}))}),[n]);return(0,t.jsxs)(p.Z,{container:!0,children:[(0,t.jsx)(p.Z,{item:!0,"data-testid":"alert-out-of-area",xs:12,children:(0,t.jsx)(Oi.Z,{})}),c&&(0,t.jsx)("div",{className:(0,v.Z)(a.rebateFinalContainer,(0,s.Z)({},a.rebateFinalWithAlert,u)),children:(0,t.jsx)(Mi,{})}),null===n||void 0===n||null===(i=n.layout)||void 0===i||null===(o=i.sections)||void 0===o?void 0:o.map((function(e,i){var o,n,r,d;if(0===(null===(o=e.columns)||void 0===o?void 0:o.length))return null;var c=!1;(null===e||void 0===e||null===(n=e.columns)||void 0===n||null===(r=n[0])||void 0===r||null===(d=r.post)||void 0===d?void 0:d.type)===pe.JH.POST_BANNER&&(c=i===m);var g={section:e,sequence:i,isFirstBanner:c};return(0,t.jsx)(p.Z,{item:!0,"data-testid":"section-".concat(i),xs:12,className:(0,v.Z)((0,s.Z)({},a.firstSection,0===i&&u)),children:(0,t.jsx)(Te,{sectionData:g,children:(0,t.jsx)(Bi,{page:l})})},"section_sequence-".concat(i))}))]})},Ji=(0,u.Z)((function(e){return(0,c.Z)({root:(0,s.Z)({padding:e.spacing(1,0,3,0)},e.breakpoints.up("md"),{padding:e.spacing(2,0,3,0)})})})),$i=function(e){var i=e.className,o=e.children,n=Ji();return(0,t.jsx)("div",{className:(0,v.Z)(n.root,i),"data-testid":"page-content-root",children:o})},Vi=function(e){var i=e.pageLayout,o=e.page,n=(0,l.Z)(),d=(0,a.Z)(n.breakpoints.down("xs"));return(0,t.jsx)(r.Z,{disableGutters:d,children:(0,t.jsx)(Je,{children:(0,t.jsx)($i,{children:(0,t.jsx)(Yi,{pageLayout:i,page:o})})})})}}}]);

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.