"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7730],{ywlr:function(e,t,n){n.d(t,{P:function(){return PopoverMenu},S:function(){return c}});var a=n("q1tI"),i=n("LgdP"),r=n("VhOp"),o=n("rBCA"),l=n("iBNF");let s=o.Z.div` position: relative; display: content; .popover-menu__btn { /* position: relative; */ > span { width: 100%; height: 100%; > img { width: 100%; height: 100%; } } } .popover-menu__content { position: absolute; z-index: 10; width: 320px; padding: 8px; border: none; background: #fff; border-radius: 8px; box-shadow: 3px 3px 20px rgba(0, 0, 0, 0.1); &::before { position: absolute; width: 16px; height: 8px; background: #fff; content: ''; } &.--position { &-top { bottom: calc(100% + 8px); &.--align { &-start { left: 0; &::before { top: 100%; left: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { top: 100%; right: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } } } &-right { left: calc(100% + 8px); &.--align { &-start { top: 0; &::before { top: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } &-end { top: 100%; transform: translateX(calc(-100% + 1rem)); &::before { bottom: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } } } &-bottom { top: calc(100% + 8px); &.--align { &-start { left: 0; &::before { bottom: 100%; left: 16px; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { right: 16px; bottom: 100%; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } } } &-left { left: -8px; transform: translateX(-100%); &.--align { &-start { top: 0; &::before { top: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } &-end { bottom: 0; &::before { bottom: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } } } } } &[data-is-marrybaby='true'] { .popover-menu__content { padding: 0; border-radius: 12px; /* &::before { display: none; } */ } } `,c=o.Z.div` display: flex; /* max-height: 300px; */ flex-direction: column; cursor: default; .__header { position: relative; display: flex; align-items: center; justify-content: center; padding: 1rem 0; margin-bottom: 8px; .__back-btn { position: absolute; top: 50%; left: 8px; width: 16px; height: 16px; cursor: pointer; transform: translateY(-50%); } } .tree-text-description { padding-right: 8px; padding-left: 8px; margin-top: -8px; margin-bottom: 8px; font-size: 14px; font-weight: 400; line-height: 22px; text-align: left; } .__content { overflow: auto; flex: 1; } .__list { .__item { position: relative; &.bold-item { font-weight: 700; } &:last-child { .__btn { margin-bottom: 0; } } .__btn { position: relative; display: flex; width: 100%; height: 40px; align-items: center; padding: 0 1rem; border: none; margin-bottom: 8px; color: ${l.r.colors.gray800}; cursor: pointer; text-align: left; transition: background 0.3s; /* for better gtm tracking result */ * { pointer-events: none; } &.--checked { color: ${l.r.colors.gray500}; pointer-events: none; } &:hover { background: ${l.r.colors.gray100}; } .__icon { width: 16px; height: 16px; margin-right: 0.4rem; } & > span { position: relative; & > img { width: 16px; height: 16px; margin-right: 0.4rem; } } } .__toggle { position: absolute; top: 50%; right: 16px; width: 16px; height: 16px; pointer-events: none; transform: translateY(-50%); } } } &[data-is-marrybaby='true'] { .__header { padding: 1rem; } .tree-text-description { padding: 0 1rem; } .__list { .__item { &:first-child { .__btn { border-top-left-radius: 12px; border-top-right-radius: 12px; } } &:last-child { .__btn { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } } .__btn { height: unset; padding: 1rem; margin-bottom: 0; &:hover { background: ${l.r.mbColors.lightPink}; } } } } } `,PopoverMenu=({className:e,style:t,toggleButtonContent:n,position:o="bottom",align:l="end",children:c,buttonProps:d})=>{let{data:{env:{isMarryBaby:p}}}=(0,a.useContext)(r.T),[h,u]=(0,a.useState)(!1),m=(0,a.useRef)(null),g=(0,a.useRef)(h);return(0,a.useEffect)(()=>{var e;g.current=h,h&&(null===(e=m.current)||void 0===e||e.focus())},[h]),(0,a.useEffect)(()=>{let clickHandler=e=>{var t;(null===(t=m.current)||void 0===t?void 0:t.contains(e.target))||!g.current||u(!1)};return window.addEventListener("click",clickHandler,{passive:!0}),()=>{window.removeEventListener("click",clickHandler)}},[]),a.createElement(s,{"data-is-marrybaby":p,className:e,style:t},a.createElement(i.B,Object.assign({theme:p?"marryBaby":"helloSites",className:"popover-menu__btn",size:"md",color:"transparent",onClick:()=>u(e=>!e)},d),n),h?a.createElement("div",{ref:m,className:`popover-menu__content --position-${o} --align-${l}`,tabIndex:0,onClick:e=>e.stopPropagation()},"function"==typeof c?c({setShow:u}):c):null)}},ao4L:function(e,t,n){n.d(t,{M:function(){return ei},S:function(){return SurveyOrPremiumBanner},a:function(){return er},b:function(){return SideBannerModal}});var a,i,r,o,l,s,c,d=n("q1tI"),p=n("mYVa"),h=n("7Ci/"),u=n("/npG"),m=n("Eso5"),g=n("OAL+"),b=n("SPK5"),v=n("RZSM"),f=n("vaps"),x=n("9n+W"),E=n("DA0W"),w=n("RGvF"),y=n("JZkZ"),C=n("MkcP"),k=n("nGnw"),S=n("VhOp"),T=n("LL/B"),P=n("vjmd"),B=n("UIg8"),N=n("FRPj"),_=n("bVHi"),O=n("R7WV"),L=n("n/N3"),j=n("Gx+P"),R=n("cChf"),M=n("ZFu2"),I=n("fdQd"),z=n("XFb3"),A=n("wp0n"),$=n("8wjV"),F=n("jD9D"),D=n("IQVP"),H=n("DEkF"),W=n("1HUI"),V=n("ft6n"),Z=n("xrdX"),U=n("GOBr"),G=n("q9DY"),q=n("oTwY"),Y=n("6AS9"),K=n("fNFL"),X=n("JIJ2"),Q=n("TYy9"),J=n.n(Q),ee=n("qPyV"),et=n.n(ee),en=n("eosF");let ea=[{title:"Health News & Current Affairs",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-health.svg"),checked:!1,id:1},{title:"Educational Medical Hello Bacsi Content",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-education.svg"),checked:!1,id:2},{title:"Hello Health Community Feed",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-community.svg"),checked:!1,id:3}];(a=o||(o={})).Pregnant="pregnant",a.Parenting="parenting",(l||(l={})).Option="option",(i=s||(s={})).Button="button",i.Checkbox="checkbox",(r=c||(c={})).ShowTool="showTool",r.ShowPremiumModal="showPremiumModal",r.ShowOptionBanner="showOptionBanner",r.Hide="hide";let ei={pregnancy:o.Pregnant,parenting:o.Parenting},er={[o.Pregnant]:"pregnant",[o.Parenting]:"parent"},FLOW=(e,t)=>({[o.Pregnant]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.pregnancy.heading"),description:e("pnBanner.pregnancy.desc"),styleType:s.Button,thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-pregnancy-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-pregnancy-mobile.png")},buttonProps:{variant:"white",styles:e=>({minWidth:(0,p.h)(80),[e.fn.largerThan("sm")]:{minWidth:(0,p.h)(120)}})},items:[{label:e("switchBtn.yes"),value:"yes",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - Yes Click",dataEventLabel:t}},{label:e("switchBtn.no"),value:"no",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - No Click",dataEventLabel:t}}]},submitHandler:{yes:{action:c.ShowTool,props:{value:P.H.DUE_DATE}},no:{action:c.ShowPremiumModal}}},[o.Parenting]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.parenting.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,styleType:s.Checkbox,items:[{label:e("pnBanner.toddlers"),value:"todders"},{label:e("pnBanner.teenager"),value:"teenager"}],submitBtnTracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the age range of your kids Click",dataEventLabel:t}},submitHandler:{todders:{action:c.ShowTool,props:{value:P.H.BABY_VACCINE}},teenager:{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.teenager.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},buttonProps:{variant:"white"},items:[{label:e("childCard.boy"),value:"teenager.boy",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Boy Click",dataEventLabel:t}},{label:e("childCard.girl"),value:"teenager.girl",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Girl Click",dataEventLabel:t}}]}},"teenager.boy":{action:c.ShowPremiumModal},"teenager.girl":{action:c.ShowTool,activeTool:B.t.HPV,props:{value:B.t.HPV}},"todders|teenager":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:P.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}},{label:e("pnBanner.pn.btnLabel"),value:"todders|teenager.showPN",isPNBtn:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Premium Newsletter Click",dataEventLabel:t}}]}},"todders|teenager.showPN":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:P.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}}]}}}}}),TOOL_BANNERS_PROPS=e=>({[P.H.DUE_DATE]:{heading:e("pnBanner.dueDateTool.heading"),description:e("pnBanner.dueDateTool.desc"),btnLabel:e("pnBanner.caclNow"),value:P.H.DUE_DATE,dataEventAction:"Try our Due Date Calculator Click"},[P.H.BABY_VACCINE]:{heading:e("pnBanner.vaccination.heading"),description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:P.H.BABY_VACCINE,dataEventAction:"Try our Baby Vaccine Scheduler Click"},[P.H.BABY_GROWTH]:{heading:"Baby Growth",description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:P.H.BABY_GROWTH},[B.t.HPV]:{heading:e("pnBanner.hpv.heading"),description:e("pnBanner.hpv.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-hpv-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-hpv-mobile.png")},isRiskScreener:!0,btnLabel:e("pnBanner.checkNow"),value:B.t.HPV,hideDescOnMobile:!0,dataEventAction:"Keep safe from HPV virus Click"}}),eo=(0,d.createContext)({}),PnBannerEle=e=>{var t=(0,N._)(e,[]);let{locale:n}=(0,j.u)(),{type:a,isMobile:i,currentUrl:r,isMarketing:o,isLoggedIn:l,setShouldAcquisitionModalOpen:s}=(0,d.useContext)(eo),{triggerLogin:c}=(0,_.u)();return d.createElement(h.W,Object.assign({mih:{base:144,md:160},fluid:!0,p:0,sx:{borderRadius:4,cursor:"pointer"},onClick:()=>(0,N.a)(void 0,void 0,void 0,function*(){let e=o?(0,L.g)(n)+"/dang-ky-nhan-tin/":`${window.location.href}?source=acquisition`;l?null==s||s():(0,_.I)(n)?c({returnUrl:o?e:void 0,source:o?void 0:"acquisition"}):window.location.href=`${(0,L.a)(n)}/?returnUrl=${encodeURIComponent(e)}`}),"data-event-category":"Newsletter","data-event-action":"Banner Click","data-event-label":r,className:"pointer-event-child-none"},t),d.createElement(O.I,{src:o?k.C.getAssetPath(`newsletter/${i?"Mobile":"Desktop"}_Marketing.png`):k.C.getAssetPath(`newsletter/${i?"Mobile":"Desktop"}_${a}.png`),style:{maxWidth:"100%"},alt:"newsletter banner"}))},el={GET_NEWSLETTER_CATEGORIES:"api/v1/categories?site={website_url}",POST_SUBSCRIPTION:"api/v1/subscription?site={website_url}",GET_SUBSCRIPTION_CATEGORIES:"api/v1/categories?site={website_url}"};var es=(0,u.k)(e=>({root:{},wrapper:{[e.fn.smallerThan("sm")]:{width:"70%"}},button:{[e.fn.smallerThan("sm")]:{height:"auto",minHeight:(0,p.h)(32),padding:`${(0,p.h)(6)} ${(0,p.h)(16)}`,textAlign:"center",width:"100%"}},buttonLabel:{whiteSpace:"normal"}}));let BannerLayout=({heading:e,description:t,thumbnail:n={desktop:"",mobile:""},hideDescOnMobile:a,children:i})=>{let{isMobile:r,minHeight:o}=(0,d.useContext)(eo);return d.createElement(m.x,{sx:()=>({borderRadius:(0,p.h)(8),background:"linear-gradient(180deg, #FAFDFF 0%, #E3F2FF 100%)"})},d.createElement(m.x,{sx:e=>({minHeight:(0,p.h)(o),borderRadius:"inherit",background:`url(${r?n.mobile:n.desktop})`,backgroundPosition:"center right",backgroundRepeat:"no-repeat",backgroundSize:"contain",padding:`${(0,p.h)(24)} ${(0,p.h)(16)}`,display:"flex",flexDirection:"column",justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(22)} ${(0,p.h)(32)}`}})},d.createElement(g.K,{spacing:(0,p.h)(16)},d.createElement(g.K,{spacing:(0,p.h)(4),sx:e=>({maxWidth:"60%",[e.fn.largerThan("sm")]:{maxWidth:"70%"}})},e&&d.createElement(H.H,{tag:"h4"},e),!(a&&r)&&t&&d.createElement(A.T,{size:"p4"},t)),d.createElement(m.x,null,i))))},BannerWithOptions=e=>{let{styleType:t=s.Button,items:n=[],buttonProps:a,styles:i,submitBtnTracking:r}=e,{classes:o}=es(void 0,{name:"PremiumBannerWithOptions",styles:i}),{t:l,locale:c}=(0,j.u)(),{surveyType:h,articleId:u,handleClickOption:g,hasPremiumBanner:v,source:f,isMobile:x,setShowPNModal:E}=(0,d.useContext)(eo),w=(0,d.useMemo)(()=>v?n:n.filter(e=>!e.isPNBtn).filter(Boolean),[n]),{getHealthToolLink:y}=(0,W.u)(c),C=(0,R.c)({initialValues:{bannerOptions:[]}}),saveStep=e=>(0,N.a)(void 0,void 0,void 0,function*(){return yield(0,S.b)((0,S.e)(D.yy.HEALTH_TOOL.CREATE,{_locale:c,type:er[h]}),"POST",{headers:{"Content-Type":"application/json"},data:{value:e,article:u,source:f}})}),k=(0,d.useCallback)(()=>d.createElement(b.k,{gap:(0,p.h)(8),className:o.wrapper},w.map((e,t)=>d.createElement(m.x,{key:String(t),component:e.isLink?"a":"div",href:e.isRiskScreener?`https://${Z.v[c]}/bot/${B.n[c][e.activeTool]}/`:e.isLink?y(e.activeTool):void 0},d.createElement($.B,Object.assign({className:o.button,classNames:{label:o.buttonLabel},size:"sm"},e.tracking,a,{onClick:()=>{e.isLink||(e.isPNBtn&&E(!0),saveStep(e.value),g(e.value))}}),e.label)))),[w,C]),T=(0,d.useCallback)(()=>d.createElement(b.k,null,d.createElement(b.k,{align:"center",gap:(0,p.h)(24),sx:e=>({background:"white",borderRadius:(0,p.h)(8),padding:(0,p.h)(4),[e.fn.largerThan("sm")]:{paddingLeft:(0,p.h)(16)}})},d.createElement(I.d.Group,Object.assign({},C.getInputProps("bannerOptions",{type:"checkbox"})),d.createElement(b.k,{gap:(0,p.h)(16)},w.map((e,t)=>d.createElement(I.d,{key:String(t),value:e.value,label:e.label,styles:{label:{cursor:"pointer"}}})))),d.createElement($.B,Object.assign({size:"sm"},r,a,{disabled:0===C.getInputProps("bannerOptions").value.length,leftIcon:x?d.createElement(V.I.ArrowRightTail,{size:18,useCurrentColor:!0}):void 0,onClick:()=>{let e=C.getInputProps("bannerOptions").value;saveStep(e.join("|")),g(e.join("|"))},styles:e=>({root:{[e.fn.smallerThan("sm")]:{width:(0,p.h)(38),minWidth:"auto",padding:0}}})}),!x&&l("pnBanner.submit")))),[w,C]);return d.createElement(BannerLayout,Object.assign({},e),t===s.Button?k():t===s.Checkbox?T():null)},ToolBanner=e=>{var t,n;let{t:a}=(0,j.u)(),{heading:i,description:r,thumbnail:o,btnLabel:l,value:s,isRiskScreener:c,hideDescOnMobile:h,dataEventAction:u}=e,{locale:m}=(0,j.u)(),{isMobile:v}=(0,d.useContext)(eo),{getHealthToolLink:f,allTools:x}=(0,W.u)(m),E=(0,d.useMemo)(()=>{let e=c?`https://${U.y?"":"discover."}${Z.v[m]}/bot/${B.n[m][s]}`:f(s);return d.createElement("a",{href:e},d.createElement($.B,{size:"sm","data-event-category":"Focused Audience","data-event-action":u,"data-event-label":e},l||a("pnBanner.caclNow")))},[x]);return"mainBanner"==(c?"mainBanner":"toolBanner")?d.createElement(BannerLayout,Object.assign({},Object.assign(Object.assign({},e),{thumbnail:e.thumbnail})),E):d.createElement(b.k,{gap:(0,p.h)(7),align:"center",justify:"space-between",sx:e=>({borderRadius:(0,p.h)(8),background:e.colors.blue[0],minHeight:(0,p.h)(180),padding:`${(0,p.h)(24)} ${(0,p.h)(16)}`,[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(34)} ${(0,p.h)(32)}`}})},d.createElement(g.K,{spacing:(0,p.h)(12)},d.createElement(g.K,{spacing:(0,p.h)(4)},i&&d.createElement(H.H,{tag:"h4"},i),!(v&&h)&&r&&d.createElement(A.T,{size:"p4"},r)),d.createElement(b.k,{gap:(0,p.h)(8),sx:{button:{minWidth:(0,p.h)(120)}}},E)),d.createElement(b.k,{align:"center",justify:"center",sx:e=>({width:(0,p.h)(96),height:(0,p.h)(96),borderRadius:"50%",background:"white",flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,p.h)(112),height:(0,p.h)(112)},img:{maxWidth:(0,p.h)(64),[e.fn.largerThan("sm")]:{maxWidth:(0,p.h)(73)}}})},d.createElement("img",{alt:"health-tool-icon",src:o||(null===(n=null===(t=x.filter(e=>e.template===s))||void 0===t?void 0:t[0])||void 0===n?void 0:n.icon)||P.a[s]||"",loading:"lazy"})))},HandlerBanner=()=>{var e,t,n;let{t:a}=(0,j.u)(),{state:i,Outside:r}=(0,d.useContext)(eo);return(null==i?void 0:i.action)===c.ShowTool?d.createElement(r,null,TOOL_BANNERS_PROPS(a)[null===(e=null==i?void 0:i.props)||void 0===e?void 0:e.value]?d.createElement(ToolBanner,Object.assign({},TOOL_BANNERS_PROPS(a)[null===(t=null==i?void 0:i.props)||void 0===t?void 0:t.value],{value:null===(n=null==i?void 0:i.props)||void 0===n?void 0:n.value})):null):(null==i?void 0:i.action)===c.ShowOptionBanner?d.createElement(r,null,d.createElement(BannerWithOptions,Object.assign({},null==i?void 0:i.props))):null},SideBannerModal=e=>{var{isMobile:t,children:n,desktopBanner:a=k.C.getAssetPath("friso/onboarding-banner.jpg"),mobileBanner:i=k.C.getAssetPath("friso/onboarding-banner-mobile.jpg"),modalRatio:r={width:937,height:536},mobileBannerRatio:o={width:750,height:480},desktopBannerRatio:l={width:420,height:536},closeProps:s}=e,c=(0,N._)(e,["isMobile","children","desktopBanner","mobileBanner","modalRatio","mobileBannerRatio","desktopBannerRatio","closeProps"]);let{width:h,height:u}=(0,F.n)(),g=h*o.height/o.width,[b,f]=(0,d.useState)(!1);return d.createElement(K.M,Object.assign({styles:e=>({header:{display:"none"},content:{flex:"auto",background:"transparent",[e.fn.smallerThan("sm")]:{maxHeight:"100%",height:"100%",position:"relative",borderRadius:0},[e.fn.largerThan("sm")]:{maxWidth:(0,p.h)(r.width),width:"100%",height:"100%",maxHeight:(0,p.h)(r.height),boxShadow:"none"}},body:{padding:0,width:"100%",height:"100%",[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},inner:{padding:0,[e.fn.smallerThan("sm")]:{display:"flex",alignItems:"flex-end"}}})},c),t?d.createElement(m.x,{sx:{position:"relative",width:"100%",height:"100%"},onTouchStart:()=>f(!0)},d.createElement(m.x,{className:"mobile-template",sx:{position:"absolute",height:`${(b?1:((u<=667?190:265)+g+74)/u)*100}%`,left:0,bottom:0,right:0,transition:"height 0.4s ease"}},d.createElement(m.x,{className:"mobile-template-wrapper",sx:{height:"100%",backgroundColor:"white",borderTopLeftRadius:b?0:(0,p.h)(12),borderTopRightRadius:b?0:(0,p.h)(12)}},d.createElement(m.x,{sx:{height:"100%",background:`url(${i})`,backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"top center",overflowY:"auto",borderRadius:"inherit"}},(0,Y.i)(i)&&d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{width:"100%",position:"absolute",top:0,left:0}},d.createElement("source",{src:i})),d.createElement($.B,Object.assign({variant:"white",leftIcon:d.createElement(G.Z,null),sx:{position:"absolute",right:0,top:0,zIndex:1,padding:(0,p.h)(10)}},s,{onClick:()=>null==c?void 0:c.onClose()})),d.createElement(v.o,{ratio:(null==o?void 0:o.width)/(null==o?void 0:o.height),w:"100%"}),d.createElement(m.x,{className:"inner",sx:{padding:`${(0,p.h)(28)} ${(0,p.h)(16)} ${(0,p.h)(16)}`,background:"white",position:"relative"}},n))))):d.createElement(v.o,{className:"desktop-template",ratio:r.width/r.height,w:"100%",sx:{position:"relative","& > div":{justifyContent:"flex-end"}}},d.createElement(m.x,{sx:{width:"100%",height:"100%",justifyContent:"flex-end",alignItems:"stretch",borderRadius:(0,p.h)(8),background:"white",boxShadow:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"}},(0,Y.i)(a)?d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{borderTopLeftRadius:(0,p.h)(8),borderBottomLeftRadius:(0,p.h)(8),height:"100%",display:"block"}},d.createElement("source",{src:a})):d.createElement("img",{alt:"",src:a,loading:"lazy",style:{borderTopLeftRadius:(0,p.h)(8),borderBottomLeftRadius:(0,p.h)(8),height:"100%",display:"block"}}),d.createElement(m.x,{sx:{position:"relative",height:"100%",width:`${(r.width-l.width)/r.width*100}%`}},d.createElement($.B,Object.assign({variant:"white",leftIcon:d.createElement(G.Z,null)},s,{onClick:()=>null==c?void 0:c.onClose(),sx:{position:"absolute",right:0,top:0,backgroundColor:"transparent"}})),d.createElement(m.x,{className:"side-banner-modal-container",sx:{height:"100%",padding:`${(0,p.h)(40)} ${(0,p.h)(24)} 0`}},n)))))},ec={UPDATE_SUBSCRIPTION:"user/subscription"},ed=(0,d.createContext)({}),_NormalTopic=e=>{var{value:t,name:n}=e,a=(0,N._)(e,["value","name"]);return d.createElement(I.g,Object.assign({value:t,withIcon:!0},a,{buttonProps:{styles:()=>({leftIcon:{marginRight:(0,p.h)(6)},root:{paddingLeft:(0,p.h)(10),paddingRight:(0,p.h)(10)}})}}),n)},TopicSection=({topicsGroup:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a=[],inputProps:i,labelProps:r,maxSelect:o=5,hasScroll:l,readonly:s})=>{let{action:{pushNotifications:c}}=(0,d.useContext)(S.T),p=J()(e.map(e=>e.topics||[])),{t:h}=(0,j.u)(),[u,v]=(0,d.useState)([]);(0,d.useEffect)(()=>{v(a)},[a.length]),(0,d.useEffect)(()=>{null==t||t(u)},[u]);let onValueChange=e=>{if(e.length>5){c({type:"danger",title:h("pnTopicSection.maxSelectError.title",{maxSelect:o}),message:h("pnTopicSection.maxSelectError.desc")});return}s||v(()=>p.filter(t=>e.some(e=>t.catId===e)))};return d.createElement(g.K,{spacing:12},e.map((e,t)=>d.createElement(g.K,{key:String(t),spacing:12},e.label&&d.createElement(A.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},r),e.label),l?d.createElement(f.x,{w:"100%",offsetScrollbars:!0,scrollbarSize:4,p:16,m:-16,styles:{viewport:{margin:-16,padding:16}}},d.createElement(m.x,{w:800},d.createElement(x.A.Group,Object.assign({value:u.map(e=>e.catId),multiple:!0},i,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:n},e.tracking))))))):d.createElement(x.A.Group,Object.assign({value:u.map(e=>e.catId),multiple:!0},i,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>t.catId?d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:n},e.tracking)):d.isValidElement(t.component)?t.component:null))))))},Layout=e=>{var{heading:t,children:n,stickyActions:a}=e,i=(0,N._)(e,["heading","children","stickyActions"]);let{isMobile:r}=(0,d.useContext)(ed),o=d.createElement(g.K,{spacing:(0,p.h)(24),sx:{height:"100%"}},d.createElement(H.H,{tag:"h4",style:{textAlign:"center"}},t),d.createElement(m.x,null,n));return d.createElement(m.x,{sx:e=>({[e.fn.largerThan("sm")]:{position:"relative",height:"100%"}})},r?o:d.createElement(f.x,Object.assign({className:"layout-body",h:a?"calc(100% - 90px)":"100%"},i),o),a&&d.createElement(b.k,{gap:(0,p.h)(8),sx:e=>({position:"absolute",left:0,right:0,bottom:0,padding:(0,p.h)(16),button:{flexGrow:1},justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(24)} 0`}})},a))},MainForm=()=>{let{t:e,locale:t}=(0,j.u)(),{data:{userInfo:n},action:{pushNotifications:a}}=(0,d.useContext)(S.T),i=null==n?void 0:n.id,{currentUrl:r,isMobile:o,pnSuggestCategory:l=[],nextStep:s,formValues:c,setFormValues:h,onSubmit:u,submitLoading:m,selectCategory:b,setCategoryLibs:v,setSelectCategory:f,maxSelectCategory:x}=(0,d.useContext)(ed),E=l.map(e=>e.catId),w=(0,R.c)({validate:{name:(0,M.U)(e("healthToolPNModal.mainForm.requireName"))},initialValues:Object.assign(Object.assign({},c),{fitnessTopics:E})}),[y,C]=(0,d.useState)([]),[k,T]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,N.a)(void 0,void 0,void 0,function*(){var e;try{let n=yield(0,S.b)((0,S.f)(el.GET_SUBSCRIPTION_CATEGORIES,{_locale:t}),"get"),a=((null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.subscription)||[]).filter(e=>!E.includes(e.catId));C(l),T(a),v([...l,...a])}catch(e){console.log(e)}})},[]),(0,d.useEffect)(()=>{i&&w.setFieldValue("name",(null==n?void 0:n.name)||"")},[i]);let onMore=()=>{""!==w.getInputProps("name").value?(h(w.getTransformedValues()),s()):w.validateField("name")},P=(0,d.useMemo)(()=>d.createElement($.B,{variant:"tertiary",dataEventCategory:"Newsletter",dataEventAction:"More Category Click",dataEventLabel:r,leftIcon:d.createElement(q.Z,{size:16,color:"currentColor"}),onClick:onMore,styles:e=>({root:{borderRadius:(0,p.h)(6),padding:"2px 15px",height:(0,p.h)(40)},label:{fontSize:(0,p.h)(14),fontWeight:400,[e.fn.smallerThan("sm")]:{fontSize:(0,p.h)(12),lineHeight:(0,p.h)(16),height:(0,p.h)(40)}},leftIcon:{marginRight:"5px"}})},d.createElement(A.T,{size:o?"p3":"p4"},e("home.seeMore"))),[w]);return(0,d.useEffect)(()=>{w.setFieldValue("fitnessTopics",b.map(e=>e.catId))},[b]),d.createElement("form",{style:{height:"100%"},onSubmit:w.onSubmit(t=>{if(0===b.length)return a({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;h(t),null==u||u(t.name)})},d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(d.Fragment,null,d.createElement($.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Register Click",dataEventLabel:r,loading:m,sx:{maxWidth:(0,p.h)(240)}},e("healthToolPNModal.register")))},d.createElement(g.K,{spacing:(0,p.h)(16)},d.createElement(I.I,Object.assign({label:e("newsletter.welcome.description")},w.getInputProps("name"))),d.createElement(TopicSection,{topicsGroup:[...0===l.length&&0===k.length?[{topics:[{component:P}]}]:[],...l.length>0?[{label:e("healthToolPNModal.mainForm.tailorTopicsHeading"),topics:[...l,...0===k.length?[{component:P}]:[]]}]:[],...k.length>0?[{label:e("healthToolPNModal.findMore.chooseFav"),topics:[...k,...k.length>0?[{component:P}]:[]]}]:[]],selectedTopics:[...y],labelProps:{size:o?"p3":"p4",color:"gray.6"},onTopicChange:f,maxSelect:x}))))},ep=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,N._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(E.Z,{noWrap:!0},d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.97887 8.15493C2.97887 5.29627 5.29627 2.97887 8.15493 2.97887C11.0136 2.97887 13.331 5.29627 13.331 8.15493C13.331 11.0136 11.0136 13.331 8.15493 13.331C5.29627 13.331 2.97887 11.0136 2.97887 8.15493ZM8.15493 1.5C4.47951 1.5 1.5 4.47951 1.5 8.15493C1.5 11.8303 4.47951 14.8099 8.15493 14.8099C9.72615 14.8099 11.1702 14.2653 12.3086 13.3547L15.2376 16.2837C15.5264 16.5725 15.9946 16.5725 16.2833 16.2837C16.5721 15.9949 16.5721 15.5267 16.2833 15.238L13.3544 12.3091C14.2652 11.1705 14.8099 9.72634 14.8099 8.15493C14.8099 4.47951 11.8303 1.5 8.15493 1.5Z",fill:"#8C8C8C"})),d.createElement(A.T,{size:"p3"},n)))}),eh=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,N._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(A.T,{size:"p3"},n))}),HistorySection=({history:e,onDelete:t})=>d.createElement(b.k,{wrap:"wrap",gap:8},et()(e,"catId").map(e=>d.createElement(w.C,{key:e.catId,rightSection:d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",onClick:()=>null==t?void 0:t(e)},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 9C1.5 4.8525 4.8525 1.5 9 1.5C13.1475 1.5 16.5 4.8525 16.5 9C16.5 13.1475 13.1475 16.5 9 16.5C4.8525 16.5 1.5 13.1475 1.5 9ZM11.1677 12.2248C11.4602 12.5173 11.9327 12.5173 12.2252 12.2248C12.5101 11.9323 12.5101 11.4523 12.2252 11.1673L10.0577 8.99979L12.2252 6.83229C12.5177 6.53979 12.5177 6.0673 12.2252 5.7748C11.9327 5.4823 11.4602 5.4823 11.1677 5.7748L9.00015 7.9423L6.83265 5.7748C6.54015 5.4823 6.06765 5.4823 5.77515 5.7748C5.63471 5.91492 5.55579 6.10516 5.55579 6.30354C5.55579 6.50193 5.63471 6.69217 5.77515 6.83229L7.94265 8.99979L5.77515 11.1673C5.63471 11.3074 5.55579 11.4977 5.55579 11.696C5.55579 11.8944 5.63471 12.0847 5.77515 12.2248C6.06765 12.5173 6.54015 12.5173 6.83265 12.2248L9.00015 10.0573L11.1677 12.2248Z",fill:"#8C8C8C"})),styles:{root:{height:32,background:"#ffffff",padding:"5px 12px",border:`1px solid ${z.t.neutral[4]}`,borderRadius:32,textTransform:"unset"},rightSection:{height:18,cursor:"pointer"}}},d.createElement(A.T,{size:"p4"},e.localName)))),RecentlyViewedSection=({topics:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a,labelProps:i,maxSelect:r=5})=>{let{action:{pushNotifications:o}}=(0,d.useContext)(S.T),[l,s]=(0,d.useState)([]),{t:c}=(0,j.u)();return((0,d.useEffect)(()=>{s(a)},[a.length]),(0,d.useEffect)(()=>{t(l)},[l]),e&&0!==e.length)?d.createElement(g.K,{spacing:12,px:16,mx:-16},d.createElement(A.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},i),c("pnTopicSection.recentView")),d.createElement(x.A.Group,{value:l.map(e=>e.catId),onChange:t=>{if(n&&l.lengthe.filter(e=>t.some(t=>e.catId===t)))},multiple:!0},d.createElement(b.k,{gap:8,wrap:"wrap"},e.map((e,t)=>d.createElement(_NormalTopic,{key:t,value:e.catId,name:e.localName,isBlock:n}))))):null},_TopicSlide=e=>{var{topic:t,active:n,onClick:a}=e,i=(0,N._)(e,["topic","active","onClick"]);return d.createElement(m.x,Object.assign({sx:e=>({position:"relative",cursor:"pointer",padding:2,borderRadius:8,boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06), 0px 0px 1px rgba(0, 0, 0, 0.04)",minHeight:(0,p.h)(130),[e.fn.largerThan("sm")]:{minHeight:(0,p.h)(138)}}),onClick:()=>a(t,n)},i),n&&d.createElement(m.x,{id:"test",sx:{position:"absolute",top:2,right:2,width:20,height:20,zIndex:1}},d.createElement("svg",{id:"test",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.66699 9.99984C1.66699 5.39984 5.40033 1.6665 10.0003 1.6665C14.6003 1.6665 18.3337 5.39984 18.3337 9.99984C18.3337 14.5998 14.6003 18.3332 10.0003 18.3332C5.40033 18.3332 1.66699 14.5998 1.66699 9.99984ZM4.75066 10.5827L7.74232 13.5744C8.06732 13.8994 8.60066 13.8994 8.91732 13.5744L15.2423 7.2494C15.5673 6.9244 15.5673 6.3994 15.2423 6.0744C14.9173 5.7494 14.3923 5.7494 14.0673 6.0744L8.33399 11.8077L5.92566 9.40773C5.60066 9.08273 5.07566 9.08273 4.75066 9.40773C4.59461 9.56342 4.50692 9.7748 4.50692 9.99523C4.50692 10.2157 4.59461 10.427 4.75066 10.5827Z",fill:"#2D87F3"}),d.createElement("path",{d:"M7.74224 13.5772L4.75057 10.5856C4.59453 10.4299 4.50684 10.2185 4.50684 9.99808C4.50684 9.77765 4.59453 9.56627 4.75057 9.41058C5.07557 9.08558 5.60057 9.08558 5.92557 9.41058L8.33391 11.8106L14.0672 6.07725C14.3922 5.75225 14.9172 5.75225 15.2422 6.07725C15.5672 6.40225 15.5672 6.92725 15.2422 7.25225L8.91724 13.5772C8.60057 13.9022 8.06724 13.9022 7.74224 13.5772Z",fill:"white"}))),d.createElement(m.x,{sx:{borderRadius:"8px"}},d.createElement(I.c,{ratio:1.5,mb:10,sx:e=>({background:e.colors.neutral[0]})},d.createElement(m.x,null,d.createElement("img",{src:t.guid||"",alt:"cat",loading:"lazy",style:{maxHeight:"63px"}})))),d.createElement(A.T,{size:"p4",ta:"center",px:6,sx:{display:"-webkit-box","-webkit-line-clamp":"2","-webkit-box-orient":"vertical",overflow:"hidden"}},t.localName||""))},TrendingCarousel=({topics:e,selectedTopics:t=[],onTopicChange:n,isBlock:a=!1,labelProps:i,pushNotifications:r,maxSelect:o=5})=>{let{t:l}=(0,j.u)(),[s,c]=(0,d.useState)([]),onSelect=(e,t)=>{if(t)c(t=>t.filter(t=>t.catId!==e.catId));else{if(a){r({type:"danger",title:l("pnTopicSection.maxSelectError.title",{maxSelect:o}),message:l("pnTopicSection.maxSelectError.desc")});return}c(t=>[...t,e])}};(0,d.useEffect)(()=>{c(t)},[t.length]),(0,d.useEffect)(()=>{n(s)},[s]);let[p,h]=(0,d.useState)(!1),[u,v]=(0,d.useState)(0),[x,E]=(0,d.useState)(0),w=(0,d.useRef)(null),handleMouseUp=()=>{h(!1)};return d.createElement(g.K,{spacing:10},d.createElement(b.k,{justify:"space-between",align:"center",w:"100%"},d.createElement(A.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold",span:!0},i),l("pnTopicSection.trending"))),d.createElement(m.x,null,d.createElement(f.x,{type:"always",w:"100%",offsetScrollbars:!0,scrollbarSize:4,px:4,viewportRef:w,viewportProps:{onMouseDown:e=>{e.preventDefault(),w.current&&(h(!0),v(e.pageX-w.current.offsetLeft),E(w.current.scrollLeft))},onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onMouseMove:e=>{if(e.preventDefault(),!p||!w.current)return;let t=e.pageX-w.current.offsetLeft;w.current.scrollLeft=x-(t-u)*2}},styles:{viewport:{paddingBottom:16}}},d.createElement(m.x,{w:{base:112*e.length+8*(e.length-1)+10}},d.createElement(b.k,{gap:8},e.map((e,t)=>d.createElement(_TopicSlide,{key:t,topic:e,onClick:onSelect,active:s.some(t=>t.catId===e.catId),w:{base:112}})))))))},PremiumTopicSelect=e=>{var{isLoggedIn:t,maxSelect:n=5,values:a=[],labelProps:i,onChange:r}=e,o=(0,N._)(e,["isLoggedIn","maxSelect","values","labelProps","onChange"]);let{action:{pushNotifications:l}}=(0,d.useContext)(S.T),[s,c]=(0,d.useState)(""),{t:h,locale:u}=(0,j.u)(),b=(0,d.useRef)(null),[v,f]=(0,d.useState)([]),[x,E]=(0,d.useState)([]),[w,C]=(0,d.useState)([]),[k,T]=(0,d.useState)([]),[P,B]=(0,d.useState)(null),[_,O]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,N.a)(void 0,void 0,void 0,function*(){var e,t;let n=yield(0,S.b)((0,S.f)(el.GET_NEWSLETTER_CATEGORIES,{_locale:u}),"get"),i=(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.interested)||[],r=(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.trending)||[],o=et()([...i,...r],"catId"),l=o.map(e=>Object.assign(Object.assign({},e),{value:e.catId||"",label:e.localName||""}));if(O(l||[]),B((null==n?void 0:n.data)||null),a.length>0){let e=i.filter(e=>a.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"interested"})),t=r.filter(e=>a.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"trending"}));T(e),E(t)}})},[t]);let L=(0,d.useMemo)(()=>et()([...v,...x,...k,...w],"catId"),[v,x,k,w]),[R,M]=(0,d.useState)(!1);(0,d.useEffect)(()=>{L.length>=n?M(!0):M(!1),null==r||r(L)},[L]);let onValueChange=e=>(0,N.a)(void 0,void 0,void 0,function*(){var t;let a="default";if(R)l({type:"danger",title:h("pnTopicSection.maxSelectError.title",{maxSelect:n}),message:h("pnTopicSection.maxSelectError.desc")});else{let n=[{key:"trending",array:null==P?void 0:P.trending},{key:"recently",array:null==P?void 0:P.recently},{key:"interested",array:null==P?void 0:P.interested}],i=n.find(t=>{var n;return null===(n=t.array)||void 0===n?void 0:n.some(t=>t.catId===e[0])});({trending:E,recently:C,interested:T,default:f})[a=(null==i?void 0:i.key)||"default"](t=>[...t,..._.filter(t=>e.some(e=>t.catId===e))].map(e=>Object.assign(Object.assign({},e),{template:a}))),null===(t=b.current)||void 0===t||t.blur()}return null});return d.createElement(g.K,Object.assign({spacing:(0,p.h)(16)},o),d.createElement(g.K,{spacing:(0,p.h)(8)},d.createElement(A.T,{size:"p3"},h("pnTopicSection.maxSelectError.detail",{max:n,maxTopic:L.length})),d.createElement(y.NU,{ref:b,maxSelectedValues:3,styles:{wrapper:{overflow:"initial !important"},separator:{padding:16},separatorLabel:{fontWeight:600,fontSize:12,lineHeight:"18px",textTransform:"uppercase",color:z.t.gray[4],"&::after":{display:"none"}},searchInput:{fontSize:"inherit"},input:{paddingRight:16}},nothingFound:d.createElement(A.T,{size:"s4",color:"gray.6"},h("pnTopicSection.notFound")),itemComponent:""===s?ep:eh,size:"lg",placeholder:h("pnTopicSection.plsEnterFavTopics"),data:_,onSearchChange:c,searchValue:s,icon:d.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97183 10.8732C3.97183 7.0617 7.0617 3.97183 10.8732 3.97183C14.6848 3.97183 17.7746 7.0617 17.7746 10.8732C17.7746 14.6848 14.6848 17.7746 10.8732 17.7746C7.0617 17.7746 3.97183 14.6848 3.97183 10.8732ZM10.8732 2C5.97268 2 2 5.97268 2 10.8732C2 15.7738 5.97268 19.7465 10.8732 19.7465C12.9682 19.7465 14.8936 19.0205 16.4115 17.8063L20.3168 21.7116C20.7018 22.0966 21.3261 22.0966 21.7111 21.7116C22.0961 21.3266 22.0961 20.7023 21.7111 20.3173L17.8059 16.4121C19.0203 14.894 19.7465 12.9684 19.7465 10.8732C19.7465 5.97268 15.7738 2 10.8732 2Z",fill:"#595959"})),rightSection:d.createElement(d.Fragment,null),zIndex:500,searchable:!0,withinPortal:!0,onChange:e=>onValueChange(e),value:[]}),L&&L.length>0&&d.createElement(HistorySection,{history:L,onDelete:e=>{let t={trending:E,recently:C,interested:T,default:f},n=t[e.template]||t.default;n(t=>{let n=[...t],a=n.findIndex(t=>t.catId===e.catId);return n.splice(a,1),n})}})),d.createElement(m.x,{sx:e=>({position:"relative",height:(0,p.h)(175),[e.fn.largerThan("sm")]:{height:(0,p.h)(190)}})},d.createElement(m.x,{sx:{position:"absolute",top:0,right:0,left:0}},d.createElement(TrendingCarousel,{topics:((null==P?void 0:P.trending)||[]).map(e=>Object.assign(Object.assign({},e),{template:"trending"})),selectedTopics:x,onTopicChange:E,isBlock:R,labelProps:i}))),d.createElement(RecentlyViewedSection,{topics:((null==P?void 0:P.recently)||[]).map(e=>Object.assign(Object.assign({},e),{template:"recently"})),selectedTopics:w,onTopicChange:C,isBlock:R,labelProps:i}),d.createElement(TopicSection,{labelProps:i,topicsGroup:[{label:h("pnTopicSection.ppAlsoInterested"),topics:((null==P?void 0:P.interested)||[]).map(e=>Object.assign(Object.assign({},e),{template:"interested"}))}],selectedTopics:k,onTopicChange:T,isBlock:R}))},MoreTopics=()=>{let{t:e}=(0,j.u)(),{action:{pushNotifications:t}}=(0,d.useContext)(S.T),{prevStep:n,formValues:a,submitLoading:i,onSubmit:r,selectCategory:o,maxSelectCategory:l,setSelectCategory:s,currentUrl:c,isLoggedIn:h}=(0,d.useContext)(ed);return d.createElement(Layout,{heading:e("newsletter.topic.title"),type:"always",styles:{root:{paddingRight:(0,p.h)(25)}},stickyActions:d.createElement(d.Fragment,null,d.createElement($.B,{fullWidth:!0,variant:"secondary",dataEventCategory:"Newsletter",dataEventAction:"Back Click",dataEventLabel:c,onClick:n},e("healthToolPNModal.back")),d.createElement($.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Next Click",dataEventLabel:c,onClick:()=>{if(0===o.length)return t({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;null==r||r(a.name)},loading:i},e("healthToolPNModal.next")))},d.createElement(PremiumTopicSelect,{isLoggedIn:h,maxSelect:l,values:a.fitnessTopics,onChange:s,labelProps:{size:"s5",sx:{textTransform:"uppercase"}}}))},Result=()=>{let{t:e}=(0,j.u)(),{close:t,selectCategory:n,onRegisterSuccess:a,currentUrl:i,finishLabelOnResult:r,disclaimerText:o}=(0,d.useContext)(ed);return(0,d.useEffect)(()=>()=>{setTimeout(()=>{null==a||a()},400)},[]),d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement($.B,{fullWidth:!0,sx:{maxWidth:(0,p.h)(300)},dataEventCategory:"Newsletter",dataEventAction:"Continue Reading Click",dataEventLabel:i,onClick:()=>{t()}},r||e("healthToolPNModal.finish"))},d.createElement(g.K,null,d.createElement(b.k,{gap:(0,p.h)(8),sx:e=>({background:e.colors.green[0],border:`1px solid ${e.colors.green[1]}`,borderRadius:(0,p.h)(8),padding:(0,p.h)(8)})},d.createElement(m.x,null,d.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{d:"M9.99984 18.3334C14.6022 18.3334 18.3332 14.6025 18.3332 10.0001C18.3332 5.39771 14.6022 1.66675 9.99984 1.66675C5.39746 1.66675 1.6665 5.39771 1.6665 10.0001C1.6665 14.6025 5.39746 18.3334 9.99984 18.3334Z",fill:"#00B16A"}),d.createElement("path",{d:"M9.58558 12.6674C9.22944 12.668 8.87668 12.5983 8.54752 12.4623C8.21835 12.3264 7.91925 12.1268 7.66732 11.8751L6.68587 10.8931C6.55607 10.7587 6.48424 10.5787 6.48587 10.3919C6.48749 10.2051 6.56243 10.0263 6.69455 9.89422C6.82667 9.7621 7.00539 9.68716 7.19222 9.68554C7.37906 9.68391 7.55906 9.75574 7.69345 9.88554L8.67491 10.8675C8.79344 10.986 8.93415 11.08 9.08902 11.1442C9.24389 11.2083 9.40987 11.2413 9.5775 11.2413C9.74513 11.2413 9.91111 11.2083 10.066 11.1442C10.2208 11.08 10.3616 10.986 10.4801 10.8675L16.7033 5.24335C16.8443 5.12184 17.0272 5.06032 17.213 5.07195C17.3987 5.08358 17.5726 5.16744 17.6973 5.30558C17.8221 5.44373 17.8878 5.6252 17.8805 5.81118C17.8731 5.99717 17.7933 6.17291 17.6581 6.30081L11.4592 11.8998C11.2128 12.1448 10.9205 12.3387 10.5989 12.4705C10.2774 12.6022 9.93304 12.6692 9.58558 12.6674Z",fill:"white"}))),d.createElement(A.T,{size:"p3"},o||e("pnModal.disclaimer"))),d.createElement(H.H,{tag:"h5"},e("healthToolPNModal.yourPre")),n.length>0&&d.createElement(TopicSection,{topicsGroup:[{label:"",topics:n}],selectedTopics:n,readonly:!0})))},PremiumNewsletterModal=({isMobile:e,isLoggedIn:t,pnSuggestCategory:n=[],acquisitionInfo:a,currentUrl:i,opened:r,close:o,finishLabelOnResult:l,onRegisterSuccess:s,disclaimerText:c})=>{let{t:p,locale:h}=(0,j.u)(),{action:{pushNotifications:u}}=(0,d.useContext)(S.T),m=k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),g=k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),[b,v]=(0,d.useState)([]),[f,x]=(0,d.useState)([]),[E,w]=(0,d.useState)(0),[y,P]=(0,d.useState)({name:"",fitnessTopics:[]}),[B,_]=(0,d.useState)(!1),lastStep=()=>w(2),O=(0,d.useCallback)(e=>(0,N.a)(void 0,void 0,void 0,function*(){try{_(!0),yield(0,S.b)((0,S.f)(el.POST_SUBSCRIPTION,{website_url:(0,S.h)(h)}),"post",{headers:{"Content-Type":"application/json"},method:"POST",data:{ga_client_id:X.Z.get(T.G),client_ip:window.clientIP||"",user_info:Object.assign(Object.assign({},a.userInfo),{name:e||y.name,type_subscription:1}),domain:Z.v[h||en.L.Vietnam],category:f,perferred:a.preferredTopics.map(({id:e})=>({id:e}))}}),_(!1),yield(0,S.b)((0,S.i)(ec.UPDATE_SUBSCRIPTION),"post",{headers:{"Content-Type":"application/json"},method:"PUT",data:{subscription:1}}),lastStep()}catch(e){console.log({err:e}),_(!1),u({title:p("notification.comment.somethingWrong"),message:"",type:"danger"})}}),[y,f]);return(0,d.useEffect)(()=>{[m,g].forEach(e=>{let t=new Image;t.src=e})},[]),d.createElement(ed.Provider,{value:{currentUrl:i,isMobile:e,isLoggedIn:t,opened:r,close:o,pnSuggestCategory:n,nextStep:()=>w(e=>e<3?e+1:e),prevStep:()=>w(e=>e>0?e-1:e),lastStep,categoryLibs:b,setCategoryLibs:v,selectCategory:f,setSelectCategory:x,formValues:y,setFormValues:P,maxSelectCategory:5,submitLoading:B,onSubmit:O,onRegisterSuccess:s,finishLabelOnResult:l,disclaimerText:c}},d.createElement(SideBannerModal,{isMobile:e,desktopBanner:k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),mobileBanner:k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),modalRatio:{width:960,height:588},desktopBannerRatio:{width:384,height:588},opened:r,onClose:o,zIndex:305,closeProps:{dataEventCategory:"Newsletter",dataEventAction:"Close Click",dataEventLabel:i}},d.createElement(C.v,{active:E,onStepClick:w,styles:{root:{height:"100%"},content:{padding:0,height:"100%",width:"100%"},steps:{display:"none"}}},d.createElement(C.v.Step,null,d.createElement(MainForm,null)),d.createElement(C.v.Step,null,d.createElement(MoreTopics,null)),d.createElement(C.v.Step,null,d.createElement(Result,null)))))},SurveyBanner=()=>{let{locale:e}=(0,j.u)(),{isMobile:t,isLoggedIn:n,currentUrl:a,acquisitionInfo:i,categoryIds:r,state:o,setState:l,settings:s,submitHandler:p,subcribeHealthStatus:h,showPNModal:u,setShowPNModal:m,setIsBack:g}=(0,d.useContext)(eo),[b,v]=(0,d.useState)([]),[f,x]=(0,d.useState)(u);(0,d.useEffect)(()=>{(0,N.a)(void 0,void 0,void 0,function*(){var t,n;let a=yield(0,S.b)((0,S.f)(el.GET_NEWSLETTER_CATEGORIES,{_locale:e}),"get"),i=(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.interested)||[],o=(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.trending)||[],l=[...i,...o];v(l.filter(e=>r.includes(Number(e.catId))))})},[]);let E=(0,d.useRef)([]);return(0,d.useEffect)(()=>{let e=(null==h?void 0:h.value)||"",t=e.split("|").filter(Boolean),n=e;E.current.push(h),t.length>1&&(null!==E.current[0]&&g(!0),Object.keys(p).map(e=>{let a=e.split("|");if(t.length===a.length){let i=0;t.map(e=>{a.includes(String(e))&&(i+=1)}),i===t.length&&(n=e)}}));let a=t.length>0?p[n]:s;l(a)},[h]),(0,d.useEffect)(()=>{x(u)},[u]),(null==o?void 0:o.action)!==c.Hide?d.createElement(d.Fragment,null,d.createElement(HandlerBanner,Object.assign({},s.props)),d.createElement(PremiumNewsletterModal,{acquisitionInfo:i,isMobile:t,isLoggedIn:n,currentUrl:a,pnSuggestCategory:b,opened:f,close:()=>{var e;x(!1),m(!1),setTimeout(()=>{var e;(null===(e=o.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&l({action:c.Hide})},400),(null===(e=o.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&l({action:c.Hide})},onRegisterSuccess:()=>x(!1)})):null},SurveyOrPremiumBanner=({type:e,articleId:t=0,categoryIds:n=[],isMarketing:a,isSurveyType:i,hasPremiumBanner:r,currentUrl:o,isMobile:l,subcribeHealthStatus:s,setShouldAcquisitionModalOpen:p,onValueChange:h,source:u="discover",Wrapper:g})=>{let{t:b}=(0,j.u)(),{data:{userInfo:v}}=(0,d.useContext)(S.T),f=!!(null==v?void 0:v.id),[x,E]=(0,d.useState)(null),[w,y]=(0,d.useState)(),[C,k]=(0,d.useState)(""),[T,P]=(0,d.useState)(!1),[B,N]=(0,d.useState)(!1),_=(0,d.useMemo)(()=>ei[e],[]),O=FLOW(b,o)[_],L=null==O?void 0:O.submitHandler,getMappingMultiValue=e=>{let t="",n=e.split("|");return 1===n.length?e:(Object.keys(L).map(e=>{let a=e.split("|");if(n.length===a.length){let i=0;n.map(e=>{a.includes(String(e))&&(i+=1)}),i===n.length&&(t=e)}}),t)},R=g||m.x,handleShowPNBannerFlowWhenLogin=()=>r&&(null==v?void 0:v.subscription)!==1?d.createElement(PnBannerEle,null):null;return(0,d.useEffect)(()=>{f&&E({userInfo:v,preferredTopics:ea,healthTopics:[]})},[f]),d.createElement(eo.Provider,{value:{settings:O,submitHandler:L,type:e,surveyType:_,value:C,setValue:k,isMobile:l,isLoggedIn:f,isMarketing:a,hasPremiumBanner:r,currentUrl:o,acquisitionInfo:x,categoryIds:n,subcribeHealthStatus:s,articleId:t,onValueChange:h,state:w,setState:y,handleClickOption:e=>{let t=getMappingMultiValue(e);if(t){let n=L[t];n.action===c.ShowPremiumModal?r?(P(!0),y(Object.assign(Object.assign({},w),{actionParams:{hideBannerWhenClose:n.action===c.ShowPremiumModal}}))):(y({action:c.Hide}),null==h||h(e)):(y(n),null==h||h(e))}},showPNModal:T,setShowPNModal:P,source:u,Outside:R,isBack:B,setIsBack:N,minHeight:180,setShouldAcquisitionModalOpen:p}},void 0!==s?f?i&&O?(()=>{let e=L[(null==s?void 0:s.value)||""];return(null==e?void 0:e.action)===c.ShowPremiumModal?handleShowPNBannerFlowWhenLogin():d.createElement(SurveyBanner,null)})():handleShowPNBannerFlowWhenLogin():r?d.createElement(PnBannerEle,null):null:null)}},kueh:function(e,t,n){n.d(t,{D:function(){return DrawerComponent},u:function(){return useDrawerDrag}});var a=n("FRPj"),i=n("q1tI"),r=n("iuhU"),o=n("rSBk"),l=n("rBCA"),s=n("LL/B");let c=300,useDrawerDrag=(e=c)=>{let[t,n]=(0,i.useState)(!1),a=(0,i.useCallback)(()=>{n(!0)},[]),r=(0,i.useCallback)(()=>{setTimeout(()=>{n(!1)},e)},[e]);return{isDragging:t,handleDragStart:a,handleDragEnd:r}},d=(0,l.Z)(o.dy.Content)` position: fixed; z-index: ${s.Z-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { border-top-left-radius: 8px; border-top-right-radius: 8px; } &[data-vaul-drawer-direction='top'] { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } &[data-vaul-drawer-direction='left'] { border-top-right-radius: 8px; border-bottom-right-radius: 8px; } &[data-vaul-drawer-direction='right'] { border-top-left-radius: 8px; border-bottom-left-radius: 8px; } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,p=(0,l.Z)(o.dy.Overlay)` position: fixed; inset: 0; z-index: ${s.Z-9e6}; width: 100%; max-height: 100%; &[data-state='open'] { opacity: 0.6 !important; } `,DrawerComponent=e=>{let{open:t,onOpenChange:n,snapPoints:l,activeSnapPoint:c,setActiveSnapPoint:h,children:u,overlayClassName:m,className:g,fadeFromIndex:b=s.Z-9e6,onClose:v}=e,f=(0,a._)(e,["open","onOpenChange","snapPoints","activeSnapPoint","setActiveSnapPoint","children","overlayClassName","className","fadeFromIndex","onClose"]),[x,E]=(0,i.useState)(t),[w,y]=(0,i.useState)(l?null==l?void 0:l[0]:null),{isDragging:C,handleDragStart:k,handleDragEnd:S}=useDrawerDrag(),T=(0,i.useCallback)(e=>{E(e),null==n||n(e)},[n]),P=(0,i.useMemo)(()=>l&&l.length?w===l[l.length-1]:x,[w,l]),B=(0,i.useMemo)(()=>{let e={open:x,onOpenChange:T,fadeFromIndex:b};return l&&(null==l?void 0:l.length)&&(e.snapPoints=l,e.activeSnapPoint=w,e.setActiveSnapPoint=e=>{y(e),null==h||h(e)}),e},[x,T,w,y,h,l,b]);return(0,i.useEffect)(()=>{E(t)},[t]),(0,i.useEffect)(()=>{y(c)},[c]),i.createElement(o.dy.Root,Object.assign({onDrag:k,onRelease:S,onClose:v},f,B),i.createElement(o.dy.Portal,null,i.createElement(p,{className:(0,r.default)(m,"drawer__overlay",{drawer__overlay_full:P})}),i.createElement(d,{isDragging:C,className:(0,r.default)(g,"drawer__content",{drawer__content_full:P})},i.createElement(o.dy.Handle,{className:"drawer__handle"}),i.createElement(o.dy.Title,{style:{display:"none"}}),u)))}},mihF:function(e,t,n){n.d(t,{I:function(){return InputCommentBar},P:function(){return PopupDanger},S:function(){return SharePopup},a:function(){return PopupFrame},b:function(){return SubmitReportForm},c:function(){return _},d:function(){return getPostFormData},e:function(){return editPost},f:function(){return createPost},g:function(){return getDefaultFailNoti},h:function(){return deletePost},i:function(){return I},j:function(){return deleteComment},k:function(){return decodeCommentBody},l:function(){return likeUnlikeComment},m:function(){return likeUnlikePost},u:function(){return useImagePicker}});var a=n("q1tI"),i=n("LgdP"),r=n("DEkF"),o=n("wp0n"),l=n("uuQu"),s=n("i8i4"),c=n("VhOp"),d=n("rBCA"),p=n("iBNF"),h=n("FRPj"),u=n("l9Yf"),m=n("Gx+P"),g=n("Fo2T"),b=n("Aqof"),v=n("IQVP"),f=n("0CvA"),x=n("wbWA"),E=n("xA8p"),w=n("dxY4"),y=n("pq7p"),C=n("t/pd"),k=n("D0vz"),S=n("J8qH"),T=n("voTM"),P=n("/pFO");let useImagePicker=(e,t)=>{let[n,i]=(0,a.useState)(e||[]),r=(0,a.useMemo)(()=>(e||n).map(e=>"string"==typeof e?e:URL.createObjectURL(e)),[e,n]);return{onSelectImages:a=>{let r=a.target.files;if(r){if(t&&e){let a=e||n;t(a.concat(Array.from(r)))}else i(n=>{let a=e||n;return t&&t(a.concat(Array.from(r))),a.concat(Array.from(r))})}},onRemoveImage:n=>{t&&e?(e.splice(n,1),t(e.slice())):i(a=>{let i=e||a;return i.splice(n,1),t&&t(i.slice()),i.slice()})},onRemoveAllImages:()=>{t?t([]):i([])},imageSrcs:r,imageFiles:e||n}},getDefaultFailNoti=e=>({message:e("notification.failure"),type:"danger"}),likeUnlikePost=({id:e,locale:t})=>(0,h.a)(void 0,void 0,void 0,function*(){if(!e)return;let n=yield(0,c.b)((0,c.e)(v.yy.POST.LIKE,{id:e,_locale:t}),"GET");return n}),deletePost=({id:e,locale:t})=>(0,h.a)(void 0,void 0,void 0,function*(){if(!e)return;let n=yield(0,c.b)((0,c.e)(v.yy.POST.DELETE,{id:e,_locale:t}),"DELETE");return n}),getPostFormData=({title:e,description:t,communityId:n,imageFiles:a,previewUrl:i,topicIds:r,locale:o,sanitizeFunction:s,categoryCommunityId:c,categoryTopicIds:d,introUrl:p,bannerUrl:u,scheduleTime:m,isAnonymous:g,isAskDoctor:v})=>(0,h.a)(void 0,void 0,void 0,function*(){let h=new FormData,x=(0,f.j)(t),E=(0,f.j)(e),w=(0,f.i)(x);if(h.append("title",E),h.append("description",(0,f.k)(x,s)),c?h.append("category_community",String(c)):n&&h.append("community_id",String(n)),h.append("is_anonymous",g?"1":"0"),h.append("is_question",v?"1":"0"),(null==i?void 0:i.title)&&h.append("preview_title",i.title),(null==i?void 0:i.description)&&h.append("preview_description",i.description),(null==i?void 0:i.url)&&h.append("preview_link",(0,l.c)(i.url)),(null==i?void 0:i.image)&&h.append("preview_image",(0,l.c)(i.image)),null==r||r.forEach(e=>{h.append("topics[]",String(e||""))}),null==d||d.forEach(e=>{h.append("category_topics[]",String(e||""))}),null==a?void 0:a.length){let e=yield Promise.all(a.map((e,t)=>new Promise(n=>{setTimeout(()=>{n((0,f.u)(e,o))},2e3*t)})));null==e||e.filter(Boolean).slice(0,b.M).forEach((e,t)=>{h.append(`images[${t}]`,e)})}else h.append("images","");return null==w||w.forEach(e=>{h.append("mention_ids[]",e)}),h.append("intro_url",p||""),h.append("banner",u||""),m&&(h.append("post_type","scheduled"),h.append("schedule_datetime",m)),h}),createPost=({locale:e,formData:t,isArticleComment:n})=>(0,h.a)(void 0,void 0,void 0,function*(){let a=yield(0,c.b)((0,c.e)(n?v.yy.POST.CREATE_ARTICLE_COMMENT:v.yy.POST.CREATE,{_locale:e}),"POST",{data:t});return a}),editPost=({id:e,locale:t,formData:n})=>(0,h.a)(void 0,void 0,void 0,function*(){let a=yield(0,c.b)((0,c.e)(v.yy.POST.UPDATE,{id:e,_locale:t}),"POST",{data:n});return a}),reportPost=({id:e,reason:t,locale:n})=>{let a=new FormData;return a.append("reason",t),(0,c.b)((0,c.e)(v.yy.POST.REPORT,{_locale:n,id:e}),"POST",{data:a})},B=d.Z.div` [data-type='confirm'] { max-width: 468px; /* height: 486px; */ padding: 0; .popup-content { display: flex; flex-direction: column; padding: 0; .close-button { top: 16px; right: 16px; width: 24px; height: 24px; z-index: 5; } .header { display: flex; height: 56px; align-items: center; padding: 16px 56px 16px 32px; border-bottom: 1px solid ${p.r.colors.neutral100}; font-weight: 900; width: 100%; justify-content: space-between; } .content { overflow: auto; flex: 1; .topic-list-wrapper { padding: 1rem; } } } } > div&[data-open='true'] { z-index: 250; &:last-child { z-index: 200; } } ${e=>e.isExpand&&` & > div[data-open] { width: 100%; height: 100%; max-width: none; max-height: none; } `} ${e=>e.hasFullscreen&&` & > div[data-open] { transition: all 0.5s ease-in-out, width 0s, height 0s; } `} `,N=d.Z.div` cursor: pointer; display: flex; align-items: center; `,PopupFrame=({className:e,style:t,closeIcon:n,heading:i="",children:o,isOpen:l=!1,hasFullscreen:s=!1,disableClickOutside:c=!1,initExpand:d=!1,onExpandChange:p,onClose:h=()=>null})=>{let[u,m]=(0,a.useState)(d);return a.createElement(B,{className:e,style:t,isExpand:u,hasFullscreen:s},a.createElement(S.P,{type:"confirm",onClose:h,isOpen:l,closeIcon:n||a.createElement("img",{src:T.C,loading:"lazy"}),enableAnimation:!s,disableClickOutside:c},a.createElement("div",{className:"header"},a.createElement(r.H,{tag:"h5"},i),s&&a.createElement(N,{onClick:()=>{null==p||p(),m(!u)}},a.createElement(k.Z,{size:14,isExpand:u}))),a.createElement("div",{className:"content"},"function"==typeof o?o(u):o)))};var _="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath fill='%23262626' d='M12 22.984c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.478-10 10 4.477 10 10 10'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.828 10.156-5.657 5.657M9.172 10.156l5.657 5.657'/%3e%3c/svg%3e";let O=d.Z.div` [data-type='confirm'] { width: min(360px, 100%); height: auto; &[data-open='false'] { top: calc(-100% - 500px); } } z-index: 600; .header { display: none !important; } .confirm-dialog { position: relative; overflow: auto; width: 100%; padding-top: 44px; background: #fff; border-radius: ${p.r.borderRadius}; .confirm-content { display: flex; flex-direction: column; align-items: center; padding: 0 16px 16px; text-align: center; .title { margin-bottom: 8px; font-size: 24px; line-height: 32px; word-break: break-word; overflow-wrap: break-word; } .desc { margin-bottom: 24px; color: ${p.r.colors.gray500}; font-size: 18px; line-height: 24px; text-align: center; word-break: break-word; overflow-wrap: break-word; } .btn-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; button { margin: 0 4px 0.5rem; } } } } .thumbnail-container { width: 80px; height: 80px; margin-bottom: 32px; .thumbnail { width: 100%; height: 100%; } &.is-icon { display: flex; align-items: center; justify-content: center; background: #e0e9fc; border-radius: 1rem; .thumbnail { width: 40px; height: 40px; } } } &[data-is-marrybaby='true'] { .popup-frame { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { top: 100%; transform: translate(-50%, -100%); max-width: unset; width: 100%; background: unset; overflow: unset; } } } .popup-content { .close-button { ${l.M.mbDown} { display: none; } } .confirm-dialog { ${l.M.mbDown} { background: unset; position: relative; overflow-x: hidden; &::before { content: ''; width: 200%; background: #fff; position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: -1; height: 100%; border-top-left-radius: 100%; border-top-right-radius: 100%; } } .confirm-content { padding: 0 40px 40px; ${l.M.mbDown} { padding-left: 1.5rem; padding-right: 1.5rem; } .btn-group { width: 100%; justify-content: space-between; button { flex: 1; margin: 0; &:first-child { margin-right: 0.5rem; } } } } } } .thumbnail-container { ${l.M.mbDown} { display: none; } &.is-icon { background: #ffeaf1; border-radius: 24px; } &.is-mobile { position: absolute; top: 0; left: 50%; display: none; width: 48px; height: 48px; transform: translate(-50%, -50%); &.is-icon { border-radius: 1rem; .thumbnail { width: 24px; height: 24px; } } ${l.M.mbDown} { display: flex; } } } } } `,PopupDanger=({className:e,isMarryBaby:t,style:n,title:d,description:p,acceptText:h,cancelText:u,onAccept:m,onCancel:g,thumbnail:b,isThumbnailIcon:v,onClose:f,acceptBtnTracking:x,acceptBtnProps:E,cancelBtnProps:w})=>{let{data:{env:{isMarryBaby:y}}}=(0,a.useContext)(c.T),C="boolean"==typeof t?t:y,[k,S]=(0,a.useState)(!1);return((0,a.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>S(!0),0),()=>(0,l.t)(!1)),[]),"undefined"==typeof window)?null:s.createPortal(a.createElement(O,{"data-is-marrybaby":C,className:e,style:n,"data-open":k},a.createElement(PopupFrame,{className:"popup-frame",isOpen:k,onClose:f},a.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"confirm-content"},b&&a.createElement("div",{className:`thumbnail-container ${v?"is-icon":""}`},a.createElement("img",{className:"thumbnail",src:b,loading:"lazy"})),a.createElement(r.H,{className:"title",tag:"h2"},d),a.createElement(o.T,{className:"desc",size:"lg"},p),a.createElement("div",{className:"btn-group"},a.createElement(i.B,Object.assign({theme:C?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==m||m(),null==f||f()}},E,x),h),a.createElement(i.B,Object.assign({theme:C?"marryBaby":"helloSites",size:"md",onClick:()=>{null==g||g(),null==f||f()}},w),u)))),C&&b&&a.createElement("div",{className:`thumbnail-container is-mobile ${v?"is-icon":""}`},a.createElement("img",{className:"thumbnail",src:b,loading:"lazy"})))),(0,l.a)())},L=d.Z.div` padding: 1rem; border-top: 1px solid #f2f2f2; &[data-is-reply='true'] { padding-right: 0; padding-left: 0; border-top: 1px solid #e4e8ec; margin-right: 1rem; margin-left: 1rem; } .error-text { padding: 1rem; color: ${p.r.colors.red700}; } .reply-to-container { display: flex; justify-content: space-between; padding-bottom: 0.75rem; margin-top: -0.25rem; .icon-close-comment { width: 16px; height: 16px; cursor: pointer; } a { text-decoration: none; } } .input-container { display: flex; align-items: center; .avatar-wrapper { display: flex; flex-shrink: 0; align-items: center; margin-right: 0.5rem; &.avatar-wrapper-reply { width: 32px; height: 32px; .avatar { width: 32px; height: 32px; } } } .input-wrapper { margin-right: 0.5rem; &[data-has-error] { .as-input { border-color: ${p.r.colors.red700}; } } .as-input { .textarea { width: 100%; max-height: 225px; min-height: 75px; .ql-toolbar { padding: 0; } .ql-editor { padding-left: 0; padding-right: 0; } .quill { height: 0; } } width: 100%; padding: 12px 16px; border: solid 1px ${p.r.colors.gray200}; border-radius: ${p.r.borderRadius}; &:active, &:focus { border-color: ${p.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${p.r.colors.primary200}; } &:disabled { background-color: ${p.r.colors.gray100}; cursor: not-allowed; } span { &[data-error='true'] { color: red; text-decoration: underline; } } } &[data-has-action-icon] { .as-input { padding: 12px 48px 12px 16px; } } &[data-has-display-icon] { .as-input { padding: 12px 16px 12px 48px; } } &[data-has-action-icon][data-has-display-icon] { .as-input { padding: 12px 48px; } } &[data-size='lg'] { .as-input { font-size: 16px; font-weight: ${p.r.sizes.fwRegular}; ${l.M.mbDown} { font-size: 22px; line-height: 1.2; } ${l.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { .as-input { font-weight: ${p.r.sizes.fwRegular}; line-height: 22px; ${l.M.mbDown} { font-size: 14px; line-height: 1.2; } ${l.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { .as-input { font-weight: ${p.r.sizes.fwRegular}; line-height: 20px; ${l.M.mbDown} { font-size: 13px; line-height: 1.5; } ${l.M.mbUp} { font-size: 13px; line-height: 1.5; } } } } .images-input-label { height: 100%; cursor: pointer; .icon-images-input { width: 24px; height: 24px; vertical-align: middle; } } .send-button { display: flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0; border: none; &.send-button-post { background: ${p.r.colors.neutral100}; border-radius: 50%; } .icon-enter { width: 20px; height: 20px; vertical-align: middle; } &[data-is-loading='true'] { > div { display: flex; align-items: center; justify-content: center; } } } } .preview-images-container { margin-top: 1rem; .image-src-wrapper { position: relative; width: 100%; padding-top: 66.67%; &:not(:last-child) { margin-bottom: 1rem; } .preview-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .icon-close-circle { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; cursor: pointer; } } } `,j=(0,a.createContext)({}),getCommentFormBody=({postId:e,message:t,photos:n,link:a,locale:i,sanitizeFunction:r,replyingUserId:o,replyingUserName:l,replyingId:s})=>(0,h.a)(void 0,void 0,void 0,function*(){let c=new FormData,d=(0,f.k)(t.replace(/(\ )+/g," "),r),p=(0,f.i)(d);if(n&&n.length>0){let e=yield Promise.all(null==n?void 0:n.map(e=>(0,f.u)(e,i)));e.filter(Boolean).slice(0,b.M).forEach(e=>{c.append("images[]",e)})}return a&&c.append("link",a),null==p||p.forEach(e=>{c.append("mention_ids[]",e)}),c.append("post_id",e),s&&c.append("parent_id",s),o&&(p.unshift(o),d=`[mention+id="${o}"+name="${(l||"").replace('"',"'")}"]${d}`,c.append("parent_user_id",String(o))),c.append("content",d),c.append("content",d),c}),submitComment=(e,t)=>(0,h.a)(void 0,void 0,void 0,function*(){return(0,c.b)((0,c.e)(v.yy.COMMENT.CREATE,{_locale:t}),"POST",{data:e})}),decodeCommentBody=e=>{try{let t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"",a=e.replace(/\[@([^\]]+)\]/,"");return{text:a.trim(),replyingTo:n}}catch(e){}return{text:""}},submitReply=(e,t)=>(0,h.a)(void 0,void 0,void 0,function*(){return(0,c.b)((0,c.e)(v.yy.COMMENT.REPLY,{_locale:t}),"POST",{data:e})}),likeUnlikeComment=({commentId:e,setLike:t=!1,locale:n})=>(0,h.a)(void 0,void 0,void 0,function*(){return(0,c.b)((0,c.e)(t?v.yy.COMMENT.LIKE:v.yy.COMMENT.UNLIKE,{_locale:n,id:e}),"GET")}),deleteComment=({id:e,locale:t})=>(0,c.b)((0,c.e)(v.yy.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"),InputCommentBar=({isReply:e,className:t,onClose:n,replyToName:r,style:l,replyingId:s,replyingUser:d,onPostSuccess:p,post:v,isMarryBaby:f})=>{let{action:{pushNotifications:C,sanitizeFunction:k},data:{userInfo:S,locale:T,env:{isMarryBaby:P}}}=(0,a.useContext)(c.T),{t:B}=(0,m.u)(),{onSelectImages:N,onRemoveImage:O,imageSrcs:R,onRemoveAllImages:M,imageFiles:I}=useImagePicker(),[z,A]=(0,a.useState)(""),{trigger:$}=(0,a.useContext)(j),[F,D]=(0,a.useState)(!1),H=(0,a.useRef)(null),W=(0,a.useRef)(null),V=(0,a.useRef)(null),[Z,U]=(0,a.useState)([]),[G,q]=(0,a.useState)([]),[Y,K]=(0,a.useState)(null);return(0,a.useEffect)(()=>{var e;null===(e=V.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{var e;null===(e=W.current)||void 0===e||e.focus()},400)},[$]),a.createElement(L,{"data-is-reply":e,className:t,style:l},e&&a.createElement("div",{className:"reply-to-container"},a.createElement(o.T,{size:"p4"},a.createElement("span",{dangerouslySetInnerHTML:{__html:B("inputComment.replyTo",{name:`@${r||""}`})}})),a.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3ccircle cx='8' cy='8.5' r='6.667' fill='white' stroke='%23404040'/%3e%3cpath stroke='%23404040' stroke-linecap='round' stroke-linejoin='round' d='m10 6.5-4 4M6 6.5l4 4'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>n&&n(),loading:"lazy"})),a.createElement("div",{className:"input-container",ref:V},a.createElement(w.U,{className:`avatar-wrapper ${e?"avatar-wrapper-reply":""}`,avatar:(null==S?void 0:S.id)?S.avatar:b.a,username:(null==S?void 0:S.name)||(null==S?void 0:S.username)}),a.createElement("input",{ref:H,onChange:N,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),a.createElement(u.I,{value:z,name:"input",size:"md",className:"input-wrapper",displayIcon:a.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.754 4.854H4.492a1.79 1.79 0 0 0-1.789 1.789v12.524a1.79 1.79 0 0 0 1.79 1.789h12.523a1.79 1.79 0 0 0 1.79-1.79v-6.261'/%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M17.463 3.512a1.898 1.898 0 0 1 2.684 2.684l-8.498 8.498-3.579.895.895-3.579z'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:a.createElement("div",{className:"as-input"},a.createElement(y.R,{className:"textarea",html:z,onChange:A,onImagePickerClick:()=>{var e;return null===(e=H.current)||void 0===e?void 0:e.click()},bannedWords:G,onPreviewUrlChange:K,onInvalidUrlsChange:U,setEditorRef:e=>W.current=e,isReplying:e}))}),a.createElement(i.B,{theme:("boolean"==typeof f?f:P)?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>(0,h.a)(void 0,void 0,void 0,function*(){var t,a,i,r,o,l,c,h,u;if((null==v?void 0:v.id)&&!F){D(!0);try{let m=yield getCommentFormBody(Object.assign({message:z,photos:I,postId:String(v.id),link:null==Y?void 0:Y.url,sanitizeFunction:k,locale:T},e&&s?{replyingUserId:String((null==d?void 0:d.id)||(null===(t=null==v?void 0:v.author)||void 0===t?void 0:t.id)||""),replyingId:s,replyingUserName:(null==d?void 0:d.name)||(null==d?void 0:d.username)||""}:{})),b=yield e&&s?submitReply(m,T):submitComment(m,T),f=null==b?void 0:b.data;(null==f?void 0:f.id)&&!(null===(i=null===(a=null==b?void 0:b.messages)||void 0===a?void 0:a.moderation)||void 0===i?void 0:i.type)?(e=>{A(""),M(),n&&n();let t=(0,g.e)(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),p&&p(t)})(b):(null===(o=null===(r=null==b?void 0:b.messages)||void 0===r?void 0:r.moderation)||void 0===o?void 0:o.type)==="banned"?(C({title:B("notification.comment.blocked.title"),message:B("notification.comment.blocked.message"),type:"danger"}),b.messages.moderation.words&&q(b.messages.moderation.words)):(null===(c=null===(l=null==b?void 0:b.messages)||void 0===l?void 0:l.moderation)||void 0===c?void 0:c.type)==="suspect"?(C({title:B("notification.comment.suspect.title"),message:B("notification.comment.suspect.message"),type:"warning"}),A(""),M(),n&&n()):(null===(h=null==b?void 0:b.messages)||void 0===h?void 0:h.find(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(C({message:B("notification.suspend.message"),type:"warning"}),A(""),M(),n&&n()):C({title:"",message:(null===(u=null==b?void 0:b.messages)||void 0===u?void 0:u[0])||B("notification.comment.somethingWrong"),type:"danger"})}catch(e){C({title:"",message:B("notification.comment.somethingWrong"),type:"danger"})}D(!1)}}),isLoading:F,isDisabled:!!(null==Z?void 0:Z.length)||F||!z||(null==z?void 0:z.length)<2||!z.trim()},a.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m7.5 9.734-3.75 3.75 3.75 3.75'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.25 4.734v5.569c0 .843-.33 1.653-.915 2.25a3.1 3.1 0 0 1-2.21.931H3.75'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==Z?void 0:Z.length)?a.createElement("div",{className:"error-text"},B("notification.limitUrlDomain")):null,(!R||0===R.length)&&Y&&a.createElement("div",{className:"link-preview-wrapper"},Y.isFetching?a.createElement(E.L,null):a.createElement(a.Fragment,null,a.createElement(x.C,{title:Y.title,url:Y.url||"#",image:Y.image,noRefetch:!0}),a.createElement("img",{src:_,className:"icon-close",onClick:()=>K(null),loading:"lazy"}))),R&&R.length>0&&a.createElement("div",{className:"preview-images-container"},R.map((e,t)=>a.createElement("div",{key:t,className:"image-src-wrapper"},a.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),a.createElement("img",{src:_,className:"icon-close-circle",onClick:()=>O(t),loading:"lazy"})))))},SharePopup=({trackingCategory:e,className:t,style:n,url:i,text:r,onClose:o})=>{let{data:{env:{isMarryBaby:s}}}=(0,a.useContext)(c.T),{t:d}=(0,m.u)(),[p,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>h(!0),0),()=>(0,l.t)(!1)),[]),a.createElement(C.h,null,a.createElement(R,{"data-is-marrybaby":s,className:t,style:n},a.createElement(PopupFrame,{className:"share-popup",isOpen:p,onClose:o,heading:d("bottomBar.share")},p&&a.createElement(P.r,{trackingCategory:e,shareUrl:i||("undefined"!=typeof window?window.location.href:""),title:r}))))},R=d.Z.div` .share-popup { > div:first-child { height: unset; } } .custom-share__header { display: flex; flex-wrap: no-wrap; align-items: center; padding: 1rem; border-bottom: 1px solid ${p.r.colors.neutral100}; margin-bottom: 16px; .custom-share__header-image { width: 38px; height: 38px; flex-shrink: 0; & > img { width: 100%; height: 100%; object-fit: cover; object-position: center; } } .custom-share__header-info { flex: 1; padding: 0 8px; word-break: break-word; [data-tag='h4'] { margin-bottom: 8px; font-size: 14px; font-weight: bold; line-height: 14px; } [data-size='md'] { color: #a5a5a5; font-size: 14px; line-height: 14px; } } } &[data-is-marrybaby='true'] { .share-popup { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { max-width: unset; width: 100%; top: 100%; transform: translate(-50%, -100%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; } } } .close-button { display: block; } .popup-content { .header { display: block; padding: 1rem; background-color: rgb(243, 243, 243); } .content { padding-bottom: 1rem; } } .share-mb-text { margin: 1rem 1rem 0.5rem; } } } `,M=d.Z.div` padding: 0 8px; margin-top: 18px; .report-list { margin-bottom: 18px; .report-item { display: flex; align-items: center; margin-bottom: 10px; font-weight: 600; & > img { width: 12px; height: 12px; margin-right: 8px; } .__label { font-size: 14px; } } } .report-submit { width: 100%; } &[data-is-marrybaby='true'] { padding: 0 1rem 1rem; } `;var I="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12M8 5v3M8 11h.007'/%3e%3c/svg%3e";let SubmitReportForm=({className:e,style:t,reason:n,reasonText:r,onClose:l,postId:s})=>{let{data:{locale:d,env:{isMarryBaby:u}},action:{pushNotifications:g}}=(0,a.useContext)(c.T),{t:b}=(0,m.u)(),[v,f]=(0,a.useState)(!1);return a.createElement(M,{"data-is-marrybaby":u,className:e,style:t},a.createElement("ul",{className:"report-list"},a.createElement("li",{className:"report-item"},a.createElement("img",{src:I,loading:"lazy"}),a.createElement(o.T,{className:"__label",color:p.r.colors.gray800,size:"p4"},r))),a.createElement(i.B,{theme:u?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:v,onClick:()=>(0,h.a)(void 0,void 0,void 0,function*(){if(s&&!v){f(!0);try{let e=yield reportPost({id:s,reason:n,locale:d});(null==e?void 0:e.status)===1&&(g({message:"Post reported",type:"success"}),l&&l())}catch(e){}f(!1)}})},b("submit")))}},VwLB:function(e,t,n){n.d(t,{A:function(){return Avatar},D:function(){return DistanceTag},I:function(){return IconWrapper},S:function(){return ShapedArrowDown},a:function(){return DrawerBottom}});var a=n("q1tI"),i=n("rBCA"),r=n("iBNF"),o=n("R7WV"),l=n("wp0n"),s=n("FRPj"),c=n("iuhU"),d=n("h8tX"),p=n("kueh"),h=n("rSBk"),u=n("LL/B");let ShapedArrowDown=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none"},e),a.createElement("path",{d:"M13.5554 9.33398L7.99989 5.55621L2.44434 9.33398",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),m=i.Z.div` background-color: var(--background-color, transparent); color: white; cursor: pointer; img { --width: var(--width-prop, 40px); --height: var(--height-prop, 40px); width: var(--width); height: var(--height); } &[data-has-max='true'] { img { max-width: var(--width); max-height: var(--height); } } &[data-avatar-type='square'] { img { --width: var(--width-prop, 72px); --height: var(--height-prop, 72px); border-radius: ${r.r.borderRadius}; } } &[data-avatar-type='rounded'] { img { border-radius: 50%; } } &[data-custom-size='true'] { display: flex; overflow: hidden; overflow: hidden; width: var(--size); height: var(--size); align-items: center; justify-content: center; background-size: cover; font-size: calc(var(--size) / 2); font-weight: bold; &[data-avatar-type='square'] { border-radius: ${r.r.borderRadius}; } &[data-avatar-type='rounded'] { border-radius: 50%; img { --width: 100%; --height: 100%; } } img { object-fit: cover; } } `,g={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},Avatar=({type:e="square",size:t,avatarImg:n,avatarUrl:i,firstLetter:r,backgroundColor:l,onClick:s,style:c,className:d,width:p,height:h,alt:u})=>{let b=t?g[t]:void 0,[v,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(i){let e=document.createElement("img");e.setAttribute("src",i),e.addEventListener("error",()=>{f(!0)})}},[i,f]);let x=(!i&&!n||v)&&r;return a.createElement(m,{style:Object.assign(Object.assign({},c),{"--size":b?b+"px":void 0,"--width-prop":p?p+"px":void 0,"--height-prop":h?h+"px":void 0,"--background-color":l}),"data-has-max":!!(p&&h),"data-avatar-type":e,onClick:s,className:d,avatarUrl:i,"data-custom-size":!!t},n,i&&!v&&a.createElement(o.I,{src:i,alt:u||"avatar"}),x&&r)},b=i.Z.div` display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: ${r.r.colors.red700}; border-radius: 8px; border: 1px solid ${r.r.colors.neutral100}; font-size: 0.6875rem; line-height: 1rem; border-radius: 0.5rem; `,v=(0,i.Z)(e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none"},e),a.createElement("g",{clipPath:"url(#clip0_5371_10640)"},a.createElement("path",{d:"M6.6665 4.3335L8.1665 5.8335L6.6665 7.3335",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M8.16667 5.8335H5.83333C5.09667 5.8335 4.5 6.43016 4.5 7.16683V7.50016",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M6.94331 10.3902L10.3907 6.94281C10.9114 6.42211 10.9114 5.57789 10.3907 5.05719L6.94331 1.60981C6.42261 1.08911 5.57839 1.08911 5.05769 1.60981L1.61031 5.05719C1.08961 5.57789 1.08961 6.42211 1.61031 6.94281L5.05769 10.3902C5.57839 10.9109 6.42261 10.9109 6.94331 10.3902Z",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"})),a.createElement("defs",null,a.createElement("clipPath",{id:"clip0_5371_10640"},a.createElement("rect",{width:12,height:12,fill:"white"})))))` width: 0.75rem; height: 0.75rem; color: ${r.r.colors.gray400}; `;function DistanceTag({value:e,className:t}){return a.createElement(b,{className:t},a.createElement(v,null),a.createElement(l.T,{size:"p3",weight:"regular",color:r.r.colors.gray400},e))}let f=i.Z.div` display: inline-flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; width: calc(var(--wrapper-size, var(--icon-size)) * 1px); height: calc(var(--wrapper-size, var(--icon-size)) * 1px); &[data-clickable='true'] { cursor: pointer; } > * { width: calc(var(--icon-size) * 1px); height: calc(var(--icon-size) * 1px); } &[data-svg-custom-stroke='true'] > svg * { stroke: var(--icon-stroke-color); } &[data-svg-custom-fill='true'] > svg * { fill: var(--icon-fill-color); } `,IconWrapper=({children:e,className:t,onClick:n,wrapperSize:i,iconSize:r=24,wrapperStyle:o,iconStyle:l,svgIcon:s,wrapperProps:c})=>a.createElement(f,Object.assign({className:t,onClick:n,style:Object.assign(Object.assign(Object.assign(Object.assign({},i&&{"--wrapper-size":i}),r&&{"--icon-size":r}),s&&Object.assign(Object.assign({},s.fill&&{"--icon-fill-color":s.fill}),s.stroke&&{"--icon-stroke-color":s.stroke})),o),"data-clickable":!!n,"data-svg-custom-stroke":!!(null==s?void 0:s.stroke),"data-svg-custom-fill":!!(null==s?void 0:s.fill)},c),a.cloneElement(e,{style:l}));(0,i.Z)(p.D)` /* max-height: 100vh; max-height: 100dvh; */ background-color: white; &[data-vaul-drawer-direction='bottom'] { top: initial !important; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; } .drawer__handle { width: 44px; height: 3px; background-color: ${r.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;let x=(0,i.Z)(h.dy.Content)` position: fixed; z-index: ${u.Z-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &[data-is-linear='true'] { background: linear-gradient(180deg, #c3e3ff 1.86%, #fff 20%) !important; } &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { top: initial; border-top-left-radius: 16px; border-top-right-radius: 16px; /* padding-bottom: 16px; */ } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,E=(0,i.Z)(h.dy.Overlay)` position: fixed; inset: 0; z-index: ${u.Z-9e6}; width: 100%; max-height: 100%; background-color: rgb(0, 0, 0, 0.4); `,w=(0,i.Z)(h.dy.Handle)` &[data-vaul-handle] { width: 44px; height: 3px; background-color: ${r.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;function DrawerBottom(e){var{children:t,onClose:n,isOpen:i,onOpenChange:r,isMobile:o,classNames:l,isLinear:u,overlayClassName:m,contentClassName:g,handlerClassName:b}=e,v=(0,s._)(e,["children","onClose","isOpen","onOpenChange","isMobile","classNames","isLinear","overlayClassName","contentClassName","handlerClassName"]);let{isDragging:f,handleDragStart:y,handleDragEnd:C}=(0,p.u)();return o?a.createElement(h.dy.Root,Object.assign({onDrag:y,onRelease:C,open:i,onOpenChange:r,onClose:n},v),a.createElement(h.dy.Portal,null,a.createElement(E,{className:(0,c.default)(m,"drawer__overlay")}),a.createElement(x,{isDragging:f,className:(0,c.default)(g,"drawer__content"),"data-is-linear":u},a.createElement(h.dy.Title,{style:{display:"none"}}),a.createElement(w,{className:(0,c.default)(b,"drawer__handle")}),t))):a.createElement(d.u,Object.assign({withCloseButton:!0,centered:!0,zIndex:500,size:"auto",classNames:l,radius:"lg"},v,{onClose:n,opened:i,styles:{root:{maxHeight:"400px"}}}),t)}},ZLal:function(e,t,n){n.d(t,{C:function(){return r},F:function(){return o},G:function(){return GlobalTextStyleNew},T:function(){return TemplateProvider},a:function(){return c},u:function(){return useTemplateVariant}});var a,i,r,o,l=n("mYVa"),s=n("q1tI");(a=r||(r={})).LEADGEN="leadgen",a.NONE="none",(i=o||(o={}))[i.regular=400]="regular",i[i.halfBold=500]="halfBold",i[i.semiBold=600]="semiBold",i[i.bold=700]="bold";let c={[r.NONE]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(18),(0,l.h)(16)],p2:[(0,l.h)(16),(0,l.h)(16)],p3:[(0,l.h)(16),(0,l.h)(14)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(16),(0,l.h)(14)],c2:[(0,l.h)(14),(0,l.h)(12)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(20)],h4:[(0,l.h)(22),(0,l.h)(18)],h5:[(0,l.h)(18),(0,l.h)(16)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(24),(0,l.h)(22)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(24),(0,l.h)(22)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(52),(0,l.h)(34)],h2:[(0,l.h)(42),(0,l.h)(32)],h3:[(0,l.h)(36),(0,l.h)(26)],h4:[(0,l.h)(32),(0,l.h)(26)],h5:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.2,-.2],p2:[0,-.2],p3:[0,-.2],p4:[-.2,0],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.8,-.7],h4:[-.6,-.6],h5:[-.2,-.2],h6:[0,-.2],title1:[-.4,-.4],title2:[-.3,-.3]},fontWeightBySize:{s1:o.semiBold,s2:o.semiBold,s3:o.semiBold,s4:o.semiBold,h1:o.bold,h2:o.bold,h3:o.bold,h4:o.bold,h5:o.bold,h6:o.bold},fontWeight:o},[r.LEADGEN]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(17),(0,l.h)(17)],p2:[(0,l.h)(15),(0,l.h)(15)],p3:[(0,l.h)(13),(0,l.h)(13)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(12),(0,l.h)(12)],c2:[(0,l.h)(11),(0,l.h)(11)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(22)],h4:[(0,l.h)(22),(0,l.h)(20)],h5:[(0,l.h)(18),(0,l.h)(16)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)],overline:[(0,l.h)(11),(0,l.h)(11)],subText:[(0,l.h)(10),(0,l.h)(10)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(20),(0,l.h)(20)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(16),(0,l.h)(16)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(48),(0,l.h)(34)],h2:[(0,l.h)(40),(0,l.h)(32)],h3:[(0,l.h)(32),(0,l.h)(32)],h4:[(0,l.h)(32),(0,l.h)(28)],h5:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)],overline:[(0,l.h)(12),(0,l.h)(12)],subText:[(0,l.h)(12),(0,l.h)(12)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.4,-.4],p2:[-.3,-.3],p3:[-.3,-.3],p4:[-.2,0],c1:[-.2,-.2],c2:[-.2,-.2],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.6,-.6],h4:[-.6,-.4],h5:[-.2,-.2],h6:[0,-.2],n1:[-.2,-.2],title1:[-.4,-.4],title2:[-.3,-.3],overline:[-.2,-.2],subText:[-.2,-.2]},fontWeightBySize:{s1:o.semiBold,s2:o.semiBold,s3:o.semiBold,s4:o.semiBold,h1:o.bold,h2:o.bold,h3:o.bold,h4:o.bold,h5:o.bold,h6:o.bold},fontWeight:o}},GlobalTextStyleNew=e=>({[r.LEADGEN]:{h1:{fontSize:(0,l.h)(40),lineHeight:(0,l.h)(48),letterSpacing:"-1.2px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px"}},h2:{fontSize:(0,l.h)(32),lineHeight:(0,l.h)(40),letterSpacing:"-1px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},h3:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},p1:{fontSize:(0,l.h)(17),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"},p2:{fontSize:(0,l.h)(15),lineHeight:(0,l.h)(24),letterSpacing:"-0.3px"}}}),d=(0,s.createContext)(r.NONE),TemplateProvider=({variant:e=r.NONE,children:t})=>s.createElement(d.Provider,{value:e},t),useTemplateVariant=()=>(0,s.useContext)(d)},"5wro":function(e,t,n){n.d(t,{S:function(){return Spoiler}});var a=n("FRPj"),i=n("q1tI"),r=n("uCoU"),o=n("wp0n"),l=n("Gx+P"),s=n("iBNF");let Spoiler=e=>{var{children:t,line:n,lineHeight:c,trackingAttributes:d,maxHeight:p,customExpandFn:h}=e,u=(0,a._)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:m}=(0,l.u)(),g=(0,i.useMemo)(()=>p||(n&&c?n*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0)),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");let b=(0,i.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]);return i.createElement(r.o,Object.assign({showLabel:i.createElement(o.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b,{onClick:h}),m("articlePage.readMore")),hideLabel:i.createElement(o.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b),m("articlePage.showLess"))},u,{maxHeight:g}),t)}},"2rpi":function(e,t,n){n.d(t,{S:function(){return SocialLinkPreview}});var a=n("FRPj"),i=n("q1tI"),r=n("Eso5"),o=n("8vDj"),l=n("R7WV"),s=n("VhOp"),c=n("rBCA"),d=n("IQVP"),p=n("Aqof"),h=n("0CvA"),u=n("xA8p");let m=c.Z.div` .link-info-container { padding: 0.5rem 1rem; background: ${e=>e.color||"#f4faff"}; } .link-image-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; &.fetching { background: lightgray; } .loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .link-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; } } a { text-decoration: none; } &[data-is-marrybaby='true'] { overflow: hidden; border-radius: 1rem; } `,useExternalScript=({url:e,onLoad:t,onError:n})=>{let[a,r]=(0,i.useState)(e?"loading":"idle");return(0,i.useEffect)(()=>{if(!e){r("idle");return}let a=document.querySelector(`script[src="${e}"]`),handleLoadScript=()=>{r("ready"),null==t||t()},handleErrorScript=()=>{r("error"),null==n||n()};return a||((a=document.createElement("script")).type="application/javascript",a.src=e,a.async=!0,document.body.appendChild(a),a.addEventListener("load",handleLoadScript),a.addEventListener("error",handleErrorScript)),a.addEventListener("load",handleLoadScript),a.addEventListener("error",handleErrorScript),()=>{a.removeEventListener("load",handleLoadScript),a.removeEventListener("error",handleErrorScript)}},[e]),a},YoutubePlyr=({id:e,autoplay:t})=>{let n=(0,i.useRef)(null),a=useExternalScript({url:"https://cdn.plyr.io/3.7.8/plyr.js"});return(0,i.useEffect)(()=>{if(!document.getElementById("hhg-plyr-player")){let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href="https://cdn.plyr.io/3.7.8/plyr.css",e.id="hhg-plyr-player",document.head.appendChild(e)}("ready"===a||"undefined"!=typeof Plyr)&&new Plyr(n.current.querySelector('[data-id="player"]'),{autoplay:t,muted:!0})},[a]),i.createElement(i.Fragment,null,i.createElement(r.x,{ref:n,sx:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#000","&, > div":{width:"100%",height:"100%"}}},i.createElement("div",{"data-id":"player"},i.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${e}?&mute=1&enablejsapi=1&rel=0`,allowFullScreen:!0,frameBorder:"0"}))))},SocialLinkPreview=({url:e,image:t,className:n,style:r,baseUrl:c="",autoPlay:g=!0,onPushStatus:b})=>{let{data:{locale:v}}=(0,i.useContext)(s.T),[f,x]=(0,i.useState)(null);(0,i.useEffect)(()=>{(0,a.a)(void 0,void 0,void 0,function*(){if(!t){if(!e)return x(null);x(e=>Object.assign(Object.assign({},e),{isFetching:!0})),(0,s.c)((0,s.e)(d.yy.FETCH_PREVIEW,{_locale:v},void 0,c),"POST",{data:{link:e},headers:{"Content-Type":"application/json"}},!!c).then(t=>{var n,a;x({url:e,image:(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.image)||(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.logo)})}).catch(()=>{x(null)})}})},[e,t]);let E=t||(null==f?void 0:f.image),w=(null==f?void 0:f.url)||e,y=(0,i.useMemo)(()=>(0,h.y)(w),[w]),C=(0,i.useMemo)(()=>w.includes("facebook.com")||w.includes("fb.watch"),[w]),k=(0,i.useRef)(0),S=(0,i.useRef)(0),[T,P]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let handleResize=()=>{var e;let t=null===(e=B.current)||void 0===e?void 0:e.getBoundingClientRect(),n=!1;t&&(!k.current||Math.abs((k.current-t.width)/(null==t?void 0:t.width))>.2)&&(k.current=Math.floor(t.width),n=!0),t&&(!S.current||Math.abs((S.current-t.height)/(null==t?void 0:t.height))>.2)&&(S.current=Math.floor(t.height),n=!0),n&&P(e=>!e)};return handleResize(),window.addEventListener("resize",handleResize,{passive:!0}),()=>{window.removeEventListener("resize",handleResize)}},[]),(0,i.useEffect)(()=>{(null==f?void 0:f.image)&&(null==f?void 0:f.url)&&(null==b||b(!0))},[f]);let B=(0,i.useRef)(null),N=(0,o.rZ)();return i.createElement(m,{className:`${n} no-replace-click`,style:r,ref:B,color:N.colors[N.primaryColor][0]},!t&&(y||C)?i.createElement("div",{className:"link-image-wrapper"},y?i.createElement(YoutubePlyr,{id:y,autoplay:g}):C?i.createElement("iframe",{key:String(T),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(w)}&autoplay=${g?1:0}&show_text=false&t=0&width=${k.current}&height=${S.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:S.current,width:k.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null):i.createElement("a",{href:w,target:"_blank",rel:"noreferrer"},i.createElement("div",{className:`link-image-wrapper ${(null==f?void 0:f.isFetching)?"fetching":""}`},(null==f?void 0:f.isFetching)?i.createElement(u.L,{className:"loading-spinner"}):i.createElement(l.I,{className:"link-image",src:E||p.D,backupSrc:p.D,alt:w}))))}},OUhn:function(e,t,n){n.d(t,{M:function(){return MantineProvider}});var a=n("FRPj"),i=n("q1tI"),r=n("8vDj"),o=n("XFb3"),l=n("ZLal");let MantineProvider=e=>{var{children:t,locale:n,template:s="hb",isNotifications:c=!0,customStyleType:d=l.C.NONE}=e,p=(0,a._)(e,["children","locale","template","isNotifications","customStyleType"]);return(0,o.u)(n),i.createElement(r.Me,Object.assign({theme:(0,o.g)(n,s,d)},p),i.createElement(l.T,{variant:d},t,c&&i.createElement(o.N,null)))}},tpb0:function(e,t,n){n.d(t,{P:function(){return PillCarousel}});var a=n("FRPj"),i=n("q1tI"),r=n("rBCA"),o=n("nGnw"),l=n("iBNF"),s=n("R7WV"),c=n("MmHG"),d=n("eosF"),p=n("fdQd");let h=r.Z.div` display: inline-flex; overflow: hidden; width: ${e=>e.size}px; height: ${e=>e.size}px; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid #e4e8ec; background-color: ${e=>e.backgroundColor||l.r.colors.white}; border-radius: ${e=>e.borderRadius||"50%"}; & > * { width: ${e=>e.iconSize}px; height: ${e=>e.iconSize}px; } `,u=r.Z.div` display: inline-block; height: 108px; background-color: ${l.r.colors.white}; border-radius: 60px; cursor: pointer; &.selected-week-pill { background-color: ${l.r.colors.pink100}; } & > div:first-child { margin: 4px 4px 0; } & > p { margin-top: 8px; text-align: center; } & > * { pointer-events: none; } `,m=[d.L.Myanmar,d.L.Taiwan],g=(0,r.Z)(e=>{var{icon:t,name:n,className:r,locale:d="en-PH",dataEventCategory:p,dataEventAction:g,dataEventLabel:b,onSelect:v}=e,f=(0,a._)(e,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);let x=(0,i.useMemo)(()=>null==r?void 0:r.includes("selected-week-pill"),[r]);return i.createElement(u,Object.assign({onClick:v,className:r?"week-pill".concat(" non-pointer-event-child ",r):"week-pill non-pointer-event-child","data-event-category":p,"data-event-action":g,"data-event-label":b},f),i.createElement(h,{size:64,iconSize:40,backgroundColor:l.r.colors.white},i.createElement(s.I,{src:t||o.C.getAssetPath("week_default.png"),alt:`week ${n}`})),x?i.createElement(c.T,Object.assign({type:"semiBold",size:"n1",color:l.r.colors.gray800},m.includes(d)&&{style:{fontSize:"10px"}}),n):i.createElement(c.T,Object.assign({size:"n1",color:l.r.colors.gray600},m.includes(d)&&{style:{fontSize:"10px"}}),n))})` box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08); `,b=(0,r.Z)(p.f.Slide)` cursor: pointer; > div * { pointer-events: none; } `,v=(0,r.Z)(p.f)` .centerred-pill-wrapper { padding: 16px 0; } `,PillCarousel=e=>{var{data:t,isMobile:n,onSlideChange:r,pillProps:o,locale:l=d.L.Vietnam,blurFromIndex:s,blurLength:c}=e,p=(0,a._)(e,["data","isMobile","onSlideChange","pillProps","locale","blurFromIndex","blurLength"]);let[h,u]=(0,i.useState)("");return(0,i.useEffect)(()=>{u(window.location.href)},[]),i.createElement(v,Object.assign({},{withControls:!n,slideGap:16,blurFromCenter:!0,blurFromIndex:s||(n?2:4),blurLength:c||(n?1:3),onSlideChange:r},p,{selectSlideWhenClick:!0,previousControlIcon:i.createElement(Arrow,{currentUrl:h}),nextControlIcon:i.createElement(Arrow,{currentUrl:h,isRight:!0})}),e=>t.map((t,n)=>i.createElement(b,Object.assign({key:n,onClick:r,"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":h,innerSlideProps:{"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":h}},o),i.createElement("div",{className:"centerred-pill-wrapper"},i.createElement(g,{"data-event-category":"Health Tool","data-event-action":"Fetal Week Click","data-event-label":h,locale:l,name:t.name,icon:t.icon,className:n===e?"selected-week-pill pointer-event-child-none":"pointer-event-child-none"})))))},Arrow=({isRight:e,currentUrl:t})=>i.createElement("svg",{viewBox:"0 0 15 15",fill:"none",width:"16",height:"16",style:e?{transform:"rotate(-90deg)"}:{transform:"rotate(90deg)"},"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Arrow Click","data-event-label":t,className:"pointer-event-child-none"},i.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))},SVFg:function(e,t,n){n.d(t,{L:function(){return Loading}});var a=n("q1tI"),i=n("Gx+P"),r=n("LgdP");let Loading=({className:e,size:t="md"})=>{let{t:n}=(0,i.u)();return a.createElement("div",{className:`PD6nRZX ${e}`},a.createElement(r.B,{size:t,color:"transparent",isLoading:!0},n("loading")))}}}]);