"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{Du1b:function(e,t,n){n.d(t,{P:function(){return PillCarousel}});var a=n("Kz+G"),l=n("q1tI"),r=n("rBCA"),i=n("kSP5"),o=n("iBNF"),s=n("kuQP"),c=n("vsdc"),d=n("NbaP"),u=n("H1c6");let g=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||o.r.colors.white}; border-radius: ${e=>e.borderRadius||"50%"}; & > * { width: ${e=>e.iconSize}px; height: ${e=>e.iconSize}px; } `,p=r.Z.div` display: inline-block; height: 108px; background-color: ${o.r.colors.white}; border-radius: 60px; cursor: pointer; &.selected-week-pill { background-color: ${o.r.colors.pink100}; } & > div:first-child { margin: 4px 4px 0; } & > p { margin-top: 8px; text-align: center; } & > * { pointer-events: none; } `,h=[d.L.Myanmar,d.L.Taiwan],m=(0,r.Z)(e=>{var{icon:t,name:n,className:r,locale:d="en-PH",dataEventCategory:u,dataEventAction:m,dataEventLabel:b,onSelect:v}=e,E=(0,a._)(e,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);let f=(0,l.useMemo)(()=>null==r?void 0:r.includes("selected-week-pill"),[r]);return l.createElement(p,Object.assign({onClick:v,className:r?"week-pill".concat(" non-pointer-event-child ",r):"week-pill non-pointer-event-child","data-event-category":u,"data-event-action":m,"data-event-label":b},E),l.createElement(g,{size:64,iconSize:40,backgroundColor:o.r.colors.white},l.createElement(s.I,{src:t||i.C.getAssetPath("week_default.png"),alt:`week ${n}`})),f?l.createElement(c.T,Object.assign({type:"semiBold",size:"n1",color:o.r.colors.gray800},h.includes(d)&&{style:{fontSize:"10px"}}),n):l.createElement(c.T,Object.assign({size:"n1",color:o.r.colors.gray600},h.includes(d)&&{style:{fontSize:"10px"}}),n))})` box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08); `,b=(0,r.Z)(u.f.Slide)` cursor: pointer; > div * { pointer-events: none; } `,v=(0,r.Z)(u.f)` .centerred-pill-wrapper { padding: 16px 0; } `,PillCarousel=e=>{var{data:t,isMobile:n,onSlideChange:r,pillProps:i,locale:o=d.L.Vietnam,blurFromIndex:s,blurLength:c}=e,u=(0,a._)(e,["data","isMobile","onSlideChange","pillProps","locale","blurFromIndex","blurLength"]);let[g,p]=(0,l.useState)("");return(0,l.useEffect)(()=>{p(window.location.href)},[]),l.createElement(v,Object.assign({},{withControls:!n,slideGap:16,blurFromCenter:!0,blurFromIndex:s||(n?2:4),blurLength:c||(n?1:3),onSlideChange:r},u,{selectSlideWhenClick:!0,previousControlIcon:l.createElement(Arrow,{currentUrl:g}),nextControlIcon:l.createElement(Arrow,{currentUrl:g,isRight:!0})}),e=>t.map((t,n)=>l.createElement(b,Object.assign({key:n,onClick:r,"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":g,innerSlideProps:{"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":g}},i),l.createElement("div",{className:"centerred-pill-wrapper"},l.createElement(m,{"data-event-category":"Health Tool","data-event-action":"Fetal Week Click","data-event-label":g,locale:o,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})=>l.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"},l.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"}))},UKgX:function(e,t,n){n.d(t,{T:function(){return ThrForm}});var a=n("Kz+G"),l=n("q1tI"),r=n("cChf"),i=n("ZFu2"),o=n("hR5a"),s=n("FUIV"),c=n("kSP5"),d=n("xPje"),u=n("sO5b"),g=n("H1c6"),p=n("3tAZ"),h=n("pMur"),m=n("w8hz"),b=n("+aod"),v=n("xrdX");let E=(0,l.createContext)({}),DefaultForm=e=>{var t,n=(0,a._)(e,[]);let{t:r,locale:i}=(0,s.u)(),{isAdult:o,activeValueNote:c,linkTool:d,form:f,submitProps:C}=(0,l.useContext)(E),{classes:x={}}=(0,l.useContext)(m.C);return l.createElement(b.H,Object.assign({formLayout:"default"},n),l.createElement(b.H.FormRow,null,l.createElement(u.G,Object.assign({},f.getInputProps("gender")))),l.createElement(b.H.FormRow,null,l.createElement(p.D,Object.assign({},f.getInputProps("age"),{placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},label:l.createElement(h.T,{size:"p2",weight:"semiBold"},r("targetHeartRate.ageInput")),maxDate:new Date}))),l.createElement(b.H.FormRow,null,l.createElement(g.I.Number,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},r("targetHeartRate.heartRateInput")),placeholder:r("tools.inputPlaceholder",{content:"60"})},f.getInputProps("heartRate"),{min:40,max:200,styles:()=>({rightSection:{width:"auto"}})}))),o&&l.createElement(b.H.FormRow,null,l.createElement(g.S,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},r("targetHeartRate.selectActive")),defaultValue:null===(t=null==c?void 0:c[0])||void 0===t?void 0:t.value,data:c.map(e=>({value:e.value,label:e.label})),styles:{item:{whiteSpace:"nowrap",padding:"10px 12px",fontSize:"14px"}},withinPortal:!0},f.getInputProps("activeValue")))),l.createElement(b.H.FormRow,{className:x.submitWrapper},l.createElement(b.H.Submit,Object.assign({className:x.submitBtn,type:"submit",dataEventCategory:"Health Tool",dataEventAction:"THR",dataEventLabel:`https://${v.v[i]}/${d}`},C),r("bmi.submit"))))},InlineForm=e=>{var t,n=(0,a._)(e,[]);let{t:r,locale:i}=(0,s.u)(),{isAdult:o,activeValueNote:c,linkTool:d,form:h,submitProps:f}=(0,l.useContext)(E),{classes:C={}}=(0,l.useContext)(m.C);return l.createElement(b.H,Object.assign({formLayout:"inline"},n),l.createElement(b.H.FormRow,null,l.createElement(b.H.BorderInlineControl,{label:r("tools.selectGender"),width:"none"},l.createElement(u.G,Object.assign({type:"radio",hideLabel:!0,error:null},h.getInputProps("gender")))),h.errors.gender&&l.createElement(b.H.Error,null,h.errors.gender)),l.createElement(b.H.FormRow,null,l.createElement(b.H.BorderInlineControl,{label:r("targetHeartRate.ageInput")},l.createElement(p.D,Object.assign({},h.getInputProps("age"),{placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},error:null,maxDate:new Date}))),h.errors.age&&l.createElement(b.H.Error,null,h.errors.age)),l.createElement(b.H.FormRow,null,l.createElement(b.H.BorderInlineControl,{label:r("targetHeartRate.heartRateInput")},l.createElement(g.I.Number,Object.assign({placeholder:r("tools.inputPlaceholder",{content:"60"})},h.getInputProps("heartRate"),{error:null,min:40,max:200,rightSection:l.createElement(b.H.Unit,null,"bmp"),styles:()=>({rightSection:{width:"auto"}})}))),h.errors.heartRate&&l.createElement(b.H.Error,null,h.errors.heartRate)),o&&l.createElement(b.H.FormRow,null,l.createElement(b.H.BorderInlineControl,{label:r("targetHeartRate.selectActive")},l.createElement(g.S,Object.assign({defaultValue:null===(t=null==c?void 0:c[0])||void 0===t?void 0:t.value,data:c.map(e=>({value:e.value,label:e.label})),styles:{item:{whiteSpace:"nowrap",padding:"10px 12px",fontSize:"14px"}},withinPortal:!0},h.getInputProps("activeValue"))))),l.createElement(b.H.FormRow,{className:C.submitWrapper},l.createElement(b.H.Submit,Object.assign({className:C.submitBtn,type:"submit",dataEventCategory:"Health Tool",dataEventAction:"THR",dataEventLabel:`https://${v.v[i]}/${d}`},f),r("bmi.submit"))))},ThrForm=e=>{var{formLayout:t,onSubmit:n,onError:u,submitProps:g}=e,p=(0,a._)(e,["formLayout","onSubmit","onError","submitProps"]);let{t:h,locale:m}=(0,s.u)(),b=(0,l.useRef)(40),{getHealthToolLink:v}=(0,o.u)(m),f=(0,r.c)({initialValues:{heartRate:60,activeValue:"low_intensity"},validate:{gender:(0,i.U)(h("validation.error.requiredField")),age:(0,i.U)(h("validation.error.requiredField")),heartRate:e=>Number(e)>=b.current&&200>=Number(e)?null:h("tools.heartRateRangeErr",{min:b.current,max:200})}}),C=(0,l.useMemo)(()=>v(d.H.THR),[v]),[x,w]=(0,l.useState)(!1),y=[{idAge:0,minAge:0,maxAge:18,rangeMale:40,rangeFemale:40},{idAge:1,minAge:18,maxAge:25,rangeMale:49,rangeFemale:54},{idAge:2,minAge:25,maxAge:35,rangeMale:49,rangeFemale:54},{idAge:3,minAge:35,maxAge:45,rangeMale:50,rangeFemale:54},{idAge:4,minAge:45,maxAge:55,rangeMale:50,rangeFemale:54},{idAge:5,minAge:55,maxAge:65,rangeMale:51,rangeFemale:54},{idAge:6,minAge:65,maxAge:120,rangeMale:50,rangeFemale:54}],k=[{value:"low_intensity",label:h("targetHeartRate.lowIntensity.title"),image:c.C.getAssetPath("/low.svg"),imageActive:c.C.getAssetPath("/low-active.svg"),content:h("targetHeartRate.lowIntensity.note")},{value:"moderate_intensity",label:h("targetHeartRate.moderateIntensity.title"),image:c.C.getAssetPath("/moderate.svg"),imageActive:c.C.getAssetPath("/moderate-active.svg"),content:h("targetHeartRate.moderateIntensity.note")},{value:"aerobic_zone",label:h("targetHeartRate.aerobicZone.title"),image:c.C.getAssetPath("/aerobic.svg"),imageActive:c.C.getAssetPath("/aerobic-active.svg"),content:h("targetHeartRate.aerobicZone.note")},{value:"vigorous_intensity",label:h("targetHeartRate.vigorousIntensity.title"),image:c.C.getAssetPath("/vigorous.svg"),imageActive:c.C.getAssetPath("/vigorous-active.svg"),content:h("targetHeartRate.vigorousIntensity.note")},{value:"maximum_intensity",label:h("targetHeartRate.maximumIntensity.title"),image:c.C.getAssetPath("/maximum.svg"),imageActive:c.C.getAssetPath("/maximum-active.svg"),content:h("targetHeartRate.maximumIntensity.note")}];(0,l.useEffect)(()=>{let e=f.getInputProps("age").value,t=f.getInputProps("gender").value;if(e instanceof Date){let n=(new Date().getTime()-e.getTime())/1e3;n>=567648e3?w(!0):w(!1);let a=y.find(e=>n>=31536e3*e.minAge&&n<31536e3*e.maxAge)||y[0];b.current="male"===t?a.rangeMale:a.rangeFemale}},[f]);let S=Object.assign(Object.assign({},p),{onSubmit:f.onSubmit(n,u)});return l.createElement(E.Provider,{value:{isAdult:x,activeValueNote:k,linkTool:C,form:f,submitProps:g}},"inline"===t?l.createElement(InlineForm,Object.assign({},S)):l.createElement(DefaultForm,Object.assign({},S)))}},"s/gR":function(e,t,n){n.d(t,{I:function(){return Input},L:function(){return Label},S:function(){return g},a:function(){return u},b:function(){return d}});var a=n("Kz+G"),l=n("q1tI"),r=n("8vDj"),i=n("rBCA"),o=n("iBNF"),s=n("JIuZ");let c=i.Z.div` position: relative; width: 100%; &[data-has-error] { input { border-color: ${o.r.colors.red700}; } } input { width: 100%; padding: 12px 16px; border: solid 1px ${o.r.colors.gray200}; border-radius: ${o.r.borderRadius}; &:active, &:focus, &.focused { border-color: ${e=>e.color}; box-shadow: 0px 0px 2px 2px ${e=>e.shadowColor}; } &:disabled { background-color: ${o.r.colors.gray100}; cursor: not-allowed; } } &[data-has-action-icon] { input { padding: 12px 48px 12px 16px; } } &[data-has-display-icon] { input { padding: 12px 16px 12px 48px; } } &[data-has-action-icon][data-has-display-icon] { input { padding: 12px 48px; } } &[data-size='lg'] { input { font-size: 16px; font-weight: ${o.r.sizes.fwRegular}; ${s.M.mbDown} { font-size: 22px; line-height: 1.2; } ${s.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { input { font-weight: ${o.r.sizes.fwRegular}; line-height: 22px; ${s.M.mbDown} { font-size: 14px; line-height: 1.2; } ${s.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { input { font-weight: ${o.r.sizes.fwRegular}; line-height: 20px; ${s.M.mbDown} { font-size: 13px; line-height: 1.5; } ${s.M.mbUp} { font-size: 13px; line-height: 1.5; } } } `,d=i.Z.label` color: ${o.r.colors.red700}; font-weight: ${o.r.sizes.fwRegular}; `,u=i.Z.div` position: absolute; top: 50%; right: 16px; cursor: pointer; transform: translateY(-50%); `,g=i.Z.div` position: absolute; top: 50%; left: 16px; display: inline-flex; cursor: default; transform: translateY(-50%); `,Label=({children:e,className:t,style:n,htmlFor:a,size:r})=>l.createElement("label",{"data-size":r,className:`DjBFAbd ${t||""}`,style:n,htmlFor:a},e),Input=e=>{var{name:t,value:n,errorMessage:i,isNumerousKeyboard:o=!1,showErrorMessage:s=!0,actionIcon:p,displayIcon:h,onActionClick:m,label:b,className:v,onChange:E,isDisabled:f,CustomInput:C,size:x,style:w,autoComplete:y="off",type:k="text",inputClassName:S,trackingAttributes:P,enterKeyHint:T}=e,B=(0,a._)(e,["name","value","errorMessage","isNumerousKeyboard","showErrorMessage","actionIcon","displayIcon","onActionClick","label","className","onChange","isDisabled","CustomInput","size","style","autoComplete","type","inputClassName","trackingAttributes","enterKeyHint"]);let A=(0,r.rZ)(),I=(0,l.useMemo)(()=>P?{"data-event-category":P.dataEventCategory,"data-event-action":P.dataEventAction,"data-event-label":P.dataEventLabel}:{},[P]);return l.createElement(c,{"data-size":x,className:v,"data-has-action-icon":!!p||void 0,"data-has-display-icon":!!h||void 0,"data-has-error":i&&i.length>0||void 0,color:A.fn.primaryColor(),shadowColor:A.colors[A.primaryColor][0],style:w},b&&l.createElement(Label,{size:"label2",htmlFor:t,className:"inputLabel"},b),l.createElement("div",{style:{position:"relative"}},C||l.createElement("input",Object.assign({id:t,name:t,onChange:e=>E&&E(e.target.value),type:k,"aria-label":k,value:n,disabled:f,autoComplete:y,inputMode:o||"number"===k?"numeric":k,pattern:o?"[0-9]*":".*",className:S,enterKeyHint:T},I,B)),h&&l.createElement(g,{className:"displayIcon"},h),p&&l.createElement(u,{className:"actionIcon",onClick:m},p)),i&&i.length>0&&s&&l.createElement(d,{className:"errorLabel"},i))}},"3tAZ":function(e,t,n){n.d(t,{D:function(){return DatePicker}});var a=n("Kz+G"),l=n("q1tI"),r=n("8vDj"),i=n("gHhT"),o=n("catb"),s=n("+7X0"),c=n("kSP5"),d=n("mD/4"),u=n("NbaP"),g=n("yNk5");let DatePicker=e=>{var t,{value:n,fullWidth:p=!0}=e,h=(0,a._)(e,["value","fullWidth"]);let m=(0,r.rZ)(),b="mb"===m.other.template,v=null===(t=s.I[g.env.UNIFY_LOCALE||u.L.Vietnam])||void 0===t?void 0:t.dateFormat;return l.createElement(o.a,Object.assign({locale:d.M[g.env.UNIFY_LOCALE||u.L.Vietnam],valueFormat:v,size:"md",clearable:!1,popoverProps:p?{styles:{dropdown:{minWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}}:{},styles:{root:{position:"relative"},rightSection:{pointerEvents:"none",cursor:"default"}},rightSection:l.createElement(i.E,{src:c.C.getAssetPath(b?"MB-calendar.svg":"OutlineCalendar.svg"),width:18,height:18}),value:n,placeholder:v},h,{className:`input-control ${(null==h?void 0:h.className)||""}`}))}},mArf:function(e,t,n){n.d(t,{T:function(){return s}});var a=n("q1tI"),l=n("rBCA"),r=n("s/gR"),i=n("iBNF");let o=l.Z.div` textarea { width: 100%; height: var(--textarea-height, 116px); padding: 1rem; border: 1px solid ${i.r.colors.gray200}; border-radius: 6px; color: ${i.r.colors.gray800}; font-size: 14px; resize: none; &:focus { box-shadow: 0px 0px 2px 2px #91caff; } &::placeholder { color: ${i.r.colors.gray500}; } &:disabled { background-color: ${i.r.colors.neutral50}; cursor: not-allowed; } } `,s=a.forwardRef(({height:e,placeholder:t,labelText:n,labelColor:l,id:i,name:s,onChange:c,value:d,className:u,onKeyPress:g,disabled:p=!1},h)=>a.createElement(o,{className:u,style:{"--textarea-height":e||"116px"}},n&&a.createElement(r.L,{size:"label2",style:{color:l||"#595959"},htmlFor:i},n),a.createElement("textarea",{name:s,ref:h,placeholder:t,id:i,onChange:e=>c&&c(e.target.value),onKeyPress:e=>g&&g(e),value:d,disabled:p})))},kFaE:function(e,t,n){n.d(t,{M:function(){return el},S:function(){return SurveyOrPremiumBanner},a:function(){return er},b:function(){return SideBannerModal}});var a,l,r,i,o,s,c,d=n("q1tI"),u=n("mYVa"),g=n("7Ci/"),p=n("/npG"),h=n("Eso5"),m=n("OAL+"),b=n("SPK5"),v=n("RZSM"),E=n("vaps"),f=n("9n+W"),C=n("DA0W"),x=n("RGvF"),w=n("JZkZ"),y=n("MkcP"),k=n("kSP5"),S=n("7m0Y"),P=n("+7X0"),T=n("FHZx"),B=n("UIg8"),A=n("Kz+G"),I=n("CBD8"),R=n("kuQP"),L=n("bxxm"),O=n("FUIV"),N=n("cChf"),H=n("ZFu2"),M=n("H1c6"),j=n("mD/4"),F=n("pMur"),z=n("VLju"),_=n("jD9D"),$=n("IQVP"),D=n("sfOR"),W=n("hR5a"),V=n("LL6q"),Z=n("xrdX"),G=n("GOBr"),U=n("OWiL"),K=n("vWP/"),Y=n("zsF2"),q=n("CFP3"),X=n("JIJ2"),J=n("TYy9"),Q=n.n(J),ee=n("qPyV"),et=n.n(ee),en=n("NbaP");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=i||(i={})).Pregnant="pregnant",a.Parenting="parenting",(o||(o={})).Option="option",(l=s||(s={})).Button="button",l.Checkbox="checkbox",(r=c||(c={})).ShowTool="showTool",r.ShowPremiumModal="showPremiumModal",r.ShowOptionBanner="showOptionBanner",r.Hide="hide";let el={pregnancy:i.Pregnant,parenting:i.Parenting},er={[i.Pregnant]:"pregnant",[i.Parenting]:"parent"},FLOW=(e,t)=>({[i.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,u.h)(80),[e.fn.largerThan("sm")]:{minWidth:(0,u.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:T.H.DUE_DATE}},no:{action:c.ShowPremiumModal}}},[i.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:T.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:T.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:T.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}}]}}}}}),TOOL_BANNERS_PROPS=e=>({[T.H.DUE_DATE]:{heading:e("pnBanner.dueDateTool.heading"),description:e("pnBanner.dueDateTool.desc"),btnLabel:e("pnBanner.caclNow"),value:T.H.DUE_DATE,dataEventAction:"Try our Due Date Calculator Click"},[T.H.BABY_VACCINE]:{heading:e("pnBanner.vaccination.heading"),description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:T.H.BABY_VACCINE,dataEventAction:"Try our Baby Vaccine Scheduler Click"},[T.H.BABY_GROWTH]:{heading:"Baby Growth",description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:T.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"}}),ei=(0,d.createContext)({}),PnBannerEle=e=>{var t=(0,A._)(e,[]);let{locale:n}=(0,O.u)(),{type:a,isMobile:l,currentUrl:r,isMarketing:i,isLoggedIn:o,setShouldAcquisitionModalOpen:s}=(0,d.useContext)(ei),{triggerLogin:c}=(0,I.u)();return d.createElement(g.W,Object.assign({mih:{base:144,md:160},fluid:!0,p:0,sx:{borderRadius:4,cursor:"pointer"},onClick:()=>(0,A.a)(void 0,void 0,void 0,function*(){let e=i?(0,L.g)(n)+"/dang-ky-nhan-tin/":`${window.location.href}?source=acquisition`;o?null==s||s():(0,I.I)(n)?c({returnUrl:i?e:void 0,source:i?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(R.I,{src:i?k.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_Marketing.png`):k.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_${a}.png`),style:{maxWidth:"100%"},alt:"newsletter banner"}))},eo={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,p.k)(e=>({root:{},wrapper:{[e.fn.smallerThan("sm")]:{width:"70%"}},button:{[e.fn.smallerThan("sm")]:{height:"auto",minHeight:(0,u.h)(32),padding:`${(0,u.h)(6)} ${(0,u.h)(16)}`,textAlign:"center",width:"100%"}},buttonLabel:{whiteSpace:"normal"}}));let BannerLayout=({heading:e,description:t,thumbnail:n={desktop:"",mobile:""},hideDescOnMobile:a,children:l})=>{let{isMobile:r,minHeight:i}=(0,d.useContext)(ei);return d.createElement(h.x,{sx:()=>({borderRadius:(0,u.h)(8),background:"linear-gradient(180deg, #FAFDFF 0%, #E3F2FF 100%)"})},d.createElement(h.x,{sx:e=>({minHeight:(0,u.h)(i),borderRadius:"inherit",background:`url(${r?n.mobile:n.desktop})`,backgroundPosition:"center right",backgroundRepeat:"no-repeat",backgroundSize:"contain",padding:`${(0,u.h)(24)} ${(0,u.h)(16)}`,display:"flex",flexDirection:"column",justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(22)} ${(0,u.h)(32)}`}})},d.createElement(m.K,{spacing:(0,u.h)(16)},d.createElement(m.K,{spacing:(0,u.h)(4),sx:e=>({maxWidth:"60%",[e.fn.largerThan("sm")]:{maxWidth:"70%"}})},e&&d.createElement(D.H,{tag:"h4"},e),!(a&&r)&&t&&d.createElement(F.T,{size:"p4"},t)),d.createElement(h.x,null,l))))},BannerWithOptions=e=>{let{styleType:t=s.Button,items:n=[],buttonProps:a,styles:l,submitBtnTracking:r}=e,{classes:i}=es(void 0,{name:"PremiumBannerWithOptions",styles:l}),{t:o,locale:c}=(0,O.u)(),{surveyType:g,articleId:p,handleClickOption:m,hasPremiumBanner:v,source:E,isMobile:f,setShowPNModal:C}=(0,d.useContext)(ei),x=(0,d.useMemo)(()=>v?n:n.filter(e=>!e.isPNBtn).filter(Boolean),[n]),{getHealthToolLink:w}=(0,W.u)(c),y=(0,N.c)({initialValues:{bannerOptions:[]}}),saveStep=e=>(0,A.a)(void 0,void 0,void 0,function*(){return yield(0,S.e)((0,S.f)($.yy.HEALTH_TOOL.CREATE,{_locale:c,type:er[g]}),"POST",{headers:{"Content-Type":"application/json"},data:{value:e,article:p,source:E}})}),k=(0,d.useCallback)(()=>d.createElement(b.k,{gap:(0,u.h)(8),className:i.wrapper},x.map((e,t)=>d.createElement(h.x,{key:String(t),component:e.isLink?"a":"div",href:e.isRiskScreener?`https://${Z.v[c]}/bot/${B.n[c][e.activeTool]}/`:e.isLink?w(e.activeTool):void 0},d.createElement(z.B,Object.assign({className:i.button,classNames:{label:i.buttonLabel},size:"sm"},e.tracking,a,{onClick:()=>{e.isLink||(e.isPNBtn&&C(!0),saveStep(e.value),m(e.value))}}),e.label)))),[x,y]),P=(0,d.useCallback)(()=>d.createElement(b.k,null,d.createElement(b.k,{align:"center",gap:(0,u.h)(24),sx:e=>({background:"white",borderRadius:(0,u.h)(8),padding:(0,u.h)(4),[e.fn.largerThan("sm")]:{paddingLeft:(0,u.h)(16)}})},d.createElement(M.d.Group,Object.assign({},y.getInputProps("bannerOptions",{type:"checkbox"})),d.createElement(b.k,{gap:(0,u.h)(16)},x.map((e,t)=>d.createElement(M.d,{key:String(t),value:e.value,label:e.label,styles:{label:{cursor:"pointer"}}})))),d.createElement(z.B,Object.assign({size:"sm"},r,a,{disabled:0===y.getInputProps("bannerOptions").value.length,leftIcon:f?d.createElement(V.I.ArrowRightTail,{size:18,useCurrentColor:!0}):void 0,onClick:()=>{let e=y.getInputProps("bannerOptions").value;saveStep(e.join("|")),m(e.join("|"))},styles:e=>({root:{[e.fn.smallerThan("sm")]:{width:(0,u.h)(38),minWidth:"auto",padding:0}}})}),!f&&o("pnBanner.submit")))),[x,y]);return d.createElement(BannerLayout,Object.assign({},e),t===s.Button?k():t===s.Checkbox?P():null)},ToolBanner=e=>{var t,n;let{t:a}=(0,O.u)(),{heading:l,description:r,thumbnail:i,btnLabel:o,value:s,isRiskScreener:c,hideDescOnMobile:g,dataEventAction:p}=e,{locale:h}=(0,O.u)(),{isMobile:v}=(0,d.useContext)(ei),{getHealthToolLink:E,allTools:f}=(0,W.u)(h),C=(0,d.useMemo)(()=>{let e=c?`https://${G.y?"":"discover."}${Z.v[h]}/bot/${B.n[h][s]}`:E(s);return d.createElement("a",{href:e},d.createElement(z.B,{size:"sm","data-event-category":"Focused Audience","data-event-action":p,"data-event-label":e},o||a("pnBanner.caclNow")))},[f]);return"mainBanner"==(c?"mainBanner":"toolBanner")?d.createElement(BannerLayout,Object.assign({},Object.assign(Object.assign({},e),{thumbnail:e.thumbnail})),C):d.createElement(b.k,{gap:(0,u.h)(7),align:"center",justify:"space-between",sx:e=>({borderRadius:(0,u.h)(8),background:e.colors.blue[0],minHeight:(0,u.h)(180),padding:`${(0,u.h)(24)} ${(0,u.h)(16)}`,[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(34)} ${(0,u.h)(32)}`}})},d.createElement(m.K,{spacing:(0,u.h)(12)},d.createElement(m.K,{spacing:(0,u.h)(4)},l&&d.createElement(D.H,{tag:"h4"},l),!(v&&g)&&r&&d.createElement(F.T,{size:"p4"},r)),d.createElement(b.k,{gap:(0,u.h)(8),sx:{button:{minWidth:(0,u.h)(120)}}},C)),d.createElement(b.k,{align:"center",justify:"center",sx:e=>({width:(0,u.h)(96),height:(0,u.h)(96),borderRadius:"50%",background:"white",flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,u.h)(112),height:(0,u.h)(112)},img:{maxWidth:(0,u.h)(64),[e.fn.largerThan("sm")]:{maxWidth:(0,u.h)(73)}}})},d.createElement("img",{alt:"health-tool-icon",src:i||(null===(n=null===(t=f.filter(e=>e.template===s))||void 0===t?void 0:t[0])||void 0===n?void 0:n.icon)||T.a[s]||"",loading:"lazy"})))},HandlerBanner=()=>{var e,t,n;let{t:a}=(0,O.u)(),{state:l,Outside:r}=(0,d.useContext)(ei);return(null==l?void 0:l.action)===c.ShowTool?d.createElement(r,null,TOOL_BANNERS_PROPS(a)[null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.value]?d.createElement(ToolBanner,Object.assign({},TOOL_BANNERS_PROPS(a)[null===(t=null==l?void 0:l.props)||void 0===t?void 0:t.value],{value:null===(n=null==l?void 0:l.props)||void 0===n?void 0:n.value})):null):(null==l?void 0:l.action)===c.ShowOptionBanner?d.createElement(r,null,d.createElement(BannerWithOptions,Object.assign({},null==l?void 0:l.props))):null},SideBannerModal=e=>{var{isMobile:t,children:n,desktopBanner:a=k.C.getAssetPath("friso/onboarding-banner.jpg"),mobileBanner:l=k.C.getAssetPath("friso/onboarding-banner-mobile.jpg"),modalRatio:r={width:937,height:536},mobileBannerRatio:i={width:750,height:480},desktopBannerRatio:o={width:420,height:536},closeProps:s}=e,c=(0,A._)(e,["isMobile","children","desktopBanner","mobileBanner","modalRatio","mobileBannerRatio","desktopBannerRatio","closeProps"]);let{width:g,height:p}=(0,_.n)(),m=g*i.height/i.width,[b,E]=(0,d.useState)(!1);return d.createElement(q.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,u.h)(r.width),width:"100%",height:"100%",maxHeight:(0,u.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(h.x,{sx:{position:"relative",width:"100%",height:"100%"},onTouchStart:()=>E(!0)},d.createElement(h.x,{className:"mobile-template",sx:{position:"absolute",height:`${(b?1:((p<=667?190:265)+m+74)/p)*100}%`,left:0,bottom:0,right:0,transition:"height 0.4s ease"}},d.createElement(h.x,{className:"mobile-template-wrapper",sx:{height:"100%",backgroundColor:"white",borderTopLeftRadius:b?0:(0,u.h)(12),borderTopRightRadius:b?0:(0,u.h)(12)}},d.createElement(h.x,{sx:{height:"100%",background:`url(${l})`,backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"top center",overflowY:"auto",borderRadius:"inherit"}},(0,Y.i)(l)&&d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{width:"100%",position:"absolute",top:0,left:0}},d.createElement("source",{src:l})),d.createElement(z.B,Object.assign({variant:"white",leftIcon:d.createElement(U.Z,null),sx:{position:"absolute",right:0,top:0,zIndex:1,padding:(0,u.h)(10)}},s,{onClick:()=>null==c?void 0:c.onClose()})),d.createElement(v.o,{ratio:(null==i?void 0:i.width)/(null==i?void 0:i.height),w:"100%"}),d.createElement(h.x,{className:"inner",sx:{padding:`${(0,u.h)(28)} ${(0,u.h)(16)} ${(0,u.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(h.x,{sx:{width:"100%",height:"100%",justifyContent:"flex-end",alignItems:"stretch",borderRadius:(0,u.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,u.h)(8),borderBottomLeftRadius:(0,u.h)(8),height:"100%",display:"block"}},d.createElement("source",{src:a})):d.createElement("img",{alt:"",src:a,loading:"lazy",style:{borderTopLeftRadius:(0,u.h)(8),borderBottomLeftRadius:(0,u.h)(8),height:"100%",display:"block"}}),d.createElement(h.x,{sx:{position:"relative",height:"100%",width:`${(r.width-o.width)/r.width*100}%`}},d.createElement(z.B,Object.assign({variant:"white",leftIcon:d.createElement(U.Z,null)},s,{onClick:()=>null==c?void 0:c.onClose(),sx:{position:"absolute",right:0,top:0,backgroundColor:"transparent"}})),d.createElement(h.x,{className:"side-banner-modal-container",sx:{height:"100%",padding:`${(0,u.h)(40)} ${(0,u.h)(24)} 0`}},n)))))},ec={UPDATE_SUBSCRIPTION:"user/subscription"},ed=(0,d.createContext)({}),_NormalTopic=e=>{var{value:t,name:n}=e,a=(0,A._)(e,["value","name"]);return d.createElement(M.g,Object.assign({value:t,withIcon:!0},a,{buttonProps:{styles:()=>({leftIcon:{marginRight:(0,u.h)(6)},root:{paddingLeft:(0,u.h)(10),paddingRight:(0,u.h)(10)}})}}),n)},TopicSection=({topicsGroup:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a=[],inputProps:l,labelProps:r,maxSelect:i=5,hasScroll:o,readonly:s})=>{let{action:{pushNotifications:c}}=(0,d.useContext)(S.T),u=Q()(e.map(e=>e.topics||[])),{t:g}=(0,O.u)(),[p,v]=(0,d.useState)([]);(0,d.useEffect)(()=>{v(a)},[a.length]),(0,d.useEffect)(()=>{null==t||t(p)},[p]);let onValueChange=e=>{if(e.length>5){c({type:"danger",title:g("pnTopicSection.maxSelectError.title",{maxSelect:i}),message:g("pnTopicSection.maxSelectError.desc")});return}s||v(()=>u.filter(t=>e.some(e=>t.catId===e)))};return d.createElement(m.K,{spacing:12},e.map((e,t)=>d.createElement(m.K,{key:String(t),spacing:12},e.label&&d.createElement(F.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},r),e.label),o?d.createElement(E.x,{w:"100%",offsetScrollbars:!0,scrollbarSize:4,p:16,m:-16,styles:{viewport:{margin:-16,padding:16}}},d.createElement(h.x,{w:800},d.createElement(f.A.Group,Object.assign({value:p.map(e=>e.catId),multiple:!0},l,{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(f.A.Group,Object.assign({value:p.map(e=>e.catId),multiple:!0},l,{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,l=(0,A._)(e,["heading","children","stickyActions"]);let{isMobile:r}=(0,d.useContext)(ed),i=d.createElement(m.K,{spacing:(0,u.h)(24),sx:{height:"100%"}},d.createElement(D.H,{tag:"h4",style:{textAlign:"center"}},t),d.createElement(h.x,null,n));return d.createElement(h.x,{sx:e=>({[e.fn.largerThan("sm")]:{position:"relative",height:"100%"}})},r?i:d.createElement(E.x,Object.assign({className:"layout-body",h:a?"calc(100% - 90px)":"100%"},l),i),a&&d.createElement(b.k,{gap:(0,u.h)(8),sx:e=>({position:"absolute",left:0,right:0,bottom:0,padding:(0,u.h)(16),button:{flexGrow:1},justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(24)} 0`}})},a))},MainForm=()=>{let{t:e,locale:t}=(0,O.u)(),{data:{userInfo:n},action:{pushNotifications:a}}=(0,d.useContext)(S.T),l=null==n?void 0:n.id,{currentUrl:r,isMobile:i,pnSuggestCategory:o=[],nextStep:s,formValues:c,setFormValues:g,onSubmit:p,submitLoading:h,selectCategory:b,setCategoryLibs:v,setSelectCategory:E,maxSelectCategory:f}=(0,d.useContext)(ed),C=o.map(e=>e.catId),x=(0,N.c)({validate:{name:(0,H.U)(e("healthToolPNModal.mainForm.requireName"))},initialValues:Object.assign(Object.assign({},c),{fitnessTopics:C})}),[w,y]=(0,d.useState)([]),[k,P]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,A.a)(void 0,void 0,void 0,function*(){var e;try{let n=yield(0,S.e)((0,S.h)(eo.GET_SUBSCRIPTION_CATEGORIES,{_locale:t}),"get"),a=((null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.subscription)||[]).filter(e=>!C.includes(e.catId));y(o),P(a),v([...o,...a])}catch(e){console.log(e)}})},[]),(0,d.useEffect)(()=>{l&&x.setFieldValue("name",(null==n?void 0:n.name)||"")},[l]);let onMore=()=>{""!==x.getInputProps("name").value?(g(x.getTransformedValues()),s()):x.validateField("name")},T=(0,d.useMemo)(()=>d.createElement(z.B,{variant:"tertiary",dataEventCategory:"Newsletter",dataEventAction:"More Category Click",dataEventLabel:r,leftIcon:d.createElement(K.Z,{size:16,color:"currentColor"}),onClick:onMore,styles:e=>({root:{borderRadius:(0,u.h)(6),padding:"2px 15px",height:(0,u.h)(40)},label:{fontSize:(0,u.h)(14),fontWeight:400,[e.fn.smallerThan("sm")]:{fontSize:(0,u.h)(12),lineHeight:(0,u.h)(16),height:(0,u.h)(40)}},leftIcon:{marginRight:"5px"}})},d.createElement(F.T,{size:i?"p3":"p4"},e("home.seeMore"))),[x]);return(0,d.useEffect)(()=>{x.setFieldValue("fitnessTopics",b.map(e=>e.catId))},[b]),d.createElement("form",{style:{height:"100%"},onSubmit:x.onSubmit(t=>{if(0===b.length)return a({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;g(t),null==p||p(t.name)})},d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(d.Fragment,null,d.createElement(z.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Register Click",dataEventLabel:r,loading:h,sx:{maxWidth:(0,u.h)(240)}},e("healthToolPNModal.register")))},d.createElement(m.K,{spacing:(0,u.h)(16)},d.createElement(M.I,Object.assign({label:e("newsletter.welcome.description")},x.getInputProps("name"))),d.createElement(TopicSection,{topicsGroup:[...0===o.length&&0===k.length?[{topics:[{component:T}]}]:[],...o.length>0?[{label:e("healthToolPNModal.mainForm.tailorTopicsHeading"),topics:[...o,...0===k.length?[{component:T}]:[]]}]:[],...k.length>0?[{label:e("healthToolPNModal.findMore.chooseFav"),topics:[...k,...k.length>0?[{component:T}]:[]]}]:[]],selectedTopics:[...w],labelProps:{size:i?"p3":"p4",color:"gray.6"},onTopicChange:E,maxSelect:f}))))},eu=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,A._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(C.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(F.T,{size:"p3"},n)))}),eg=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,A._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(F.T,{size:"p3"},n))}),HistorySection=({history:e,onDelete:t})=>d.createElement(b.k,{wrap:"wrap",gap:8},et()(e,"catId").map(e=>d.createElement(x.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 ${j.t.neutral[4]}`,borderRadius:32,textTransform:"unset"},rightSection:{height:18,cursor:"pointer"}}},d.createElement(F.T,{size:"p4"},e.localName)))),RecentlyViewedSection=({topics:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a,labelProps:l,maxSelect:r=5})=>{let{action:{pushNotifications:i}}=(0,d.useContext)(S.T),[o,s]=(0,d.useState)([]),{t:c}=(0,O.u)();return((0,d.useEffect)(()=>{s(a)},[a.length]),(0,d.useEffect)(()=>{t(o)},[o]),e&&0!==e.length)?d.createElement(m.K,{spacing:12,px:16,mx:-16},d.createElement(F.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},l),c("pnTopicSection.recentView")),d.createElement(f.A.Group,{value:o.map(e=>e.catId),onChange:t=>{if(n&&o.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,l=(0,A._)(e,["topic","active","onClick"]);return d.createElement(h.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,u.h)(130),[e.fn.largerThan("sm")]:{minHeight:(0,u.h)(138)}}),onClick:()=>a(t,n)},l),n&&d.createElement(h.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(h.x,{sx:{borderRadius:"8px"}},d.createElement(M.c,{ratio:1.5,mb:10,sx:e=>({background:e.colors.neutral[0]})},d.createElement(h.x,null,d.createElement("img",{src:t.guid||"",alt:"cat",loading:"lazy",style:{maxHeight:"63px"}})))),d.createElement(F.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:l,pushNotifications:r,maxSelect:i=5})=>{let{t:o}=(0,O.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:o("pnTopicSection.maxSelectError.title",{maxSelect:i}),message:o("pnTopicSection.maxSelectError.desc")});return}c(t=>[...t,e])}};(0,d.useEffect)(()=>{c(t)},[t.length]),(0,d.useEffect)(()=>{n(s)},[s]);let[u,g]=(0,d.useState)(!1),[p,v]=(0,d.useState)(0),[f,C]=(0,d.useState)(0),x=(0,d.useRef)(null),handleMouseUp=()=>{g(!1)};return d.createElement(m.K,{spacing:10},d.createElement(b.k,{justify:"space-between",align:"center",w:"100%"},d.createElement(F.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold",span:!0},l),o("pnTopicSection.trending"))),d.createElement(h.x,null,d.createElement(E.x,{type:"always",w:"100%",offsetScrollbars:!0,scrollbarSize:4,px:4,viewportRef:x,viewportProps:{onMouseDown:e=>{e.preventDefault(),x.current&&(g(!0),v(e.pageX-x.current.offsetLeft),C(x.current.scrollLeft))},onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onMouseMove:e=>{if(e.preventDefault(),!u||!x.current)return;let t=e.pageX-x.current.offsetLeft;x.current.scrollLeft=f-(t-p)*2}},styles:{viewport:{paddingBottom:16}}},d.createElement(h.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:l,onChange:r}=e,i=(0,A._)(e,["isLoggedIn","maxSelect","values","labelProps","onChange"]);let{action:{pushNotifications:o}}=(0,d.useContext)(S.T),[s,c]=(0,d.useState)(""),{t:g,locale:p}=(0,O.u)(),b=(0,d.useRef)(null),[v,E]=(0,d.useState)([]),[f,C]=(0,d.useState)([]),[x,y]=(0,d.useState)([]),[k,P]=(0,d.useState)([]),[T,B]=(0,d.useState)(null),[I,R]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,A.a)(void 0,void 0,void 0,function*(){var e,t;let n=yield(0,S.e)((0,S.h)(eo.GET_NEWSLETTER_CATEGORIES,{_locale:p}),"get"),l=(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)||[],i=et()([...l,...r],"catId"),o=i.map(e=>Object.assign(Object.assign({},e),{value:e.catId||"",label:e.localName||""}));if(R(o||[]),B((null==n?void 0:n.data)||null),a.length>0){let e=l.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"}));P(e),C(t)}})},[t]);let L=(0,d.useMemo)(()=>et()([...v,...f,...k,...x],"catId"),[v,f,k,x]),[N,H]=(0,d.useState)(!1);(0,d.useEffect)(()=>{L.length>=n?H(!0):H(!1),null==r||r(L)},[L]);let onValueChange=e=>(0,A.a)(void 0,void 0,void 0,function*(){var t;let a="default";if(N)o({type:"danger",title:g("pnTopicSection.maxSelectError.title",{maxSelect:n}),message:g("pnTopicSection.maxSelectError.desc")});else{let n=[{key:"trending",array:null==T?void 0:T.trending},{key:"recently",array:null==T?void 0:T.recently},{key:"interested",array:null==T?void 0:T.interested}],l=n.find(t=>{var n;return null===(n=t.array)||void 0===n?void 0:n.some(t=>t.catId===e[0])});({trending:C,recently:y,interested:P,default:E})[a=(null==l?void 0:l.key)||"default"](t=>[...t,...I.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(m.K,Object.assign({spacing:(0,u.h)(16)},i),d.createElement(m.K,{spacing:(0,u.h)(8)},d.createElement(F.T,{size:"p3"},g("pnTopicSection.maxSelectError.detail",{max:n,maxTopic:L.length})),d.createElement(w.NU,{ref:b,maxSelectedValues:3,styles:{wrapper:{overflow:"initial !important"},separator:{padding:16},separatorLabel:{fontWeight:600,fontSize:12,lineHeight:"18px",textTransform:"uppercase",color:j.t.gray[4],"&::after":{display:"none"}},searchInput:{fontSize:"inherit"},input:{paddingRight:16}},nothingFound:d.createElement(F.T,{size:"s4",color:"gray.6"},g("pnTopicSection.notFound")),itemComponent:""===s?eu:eg,size:"lg",placeholder:g("pnTopicSection.plsEnterFavTopics"),data:I,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:C,recently:y,interested:P,default:E},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(h.x,{sx:e=>({position:"relative",height:(0,u.h)(175),[e.fn.largerThan("sm")]:{height:(0,u.h)(190)}})},d.createElement(h.x,{sx:{position:"absolute",top:0,right:0,left:0}},d.createElement(TrendingCarousel,{topics:((null==T?void 0:T.trending)||[]).map(e=>Object.assign(Object.assign({},e),{template:"trending"})),selectedTopics:f,onTopicChange:C,isBlock:N,labelProps:l}))),d.createElement(RecentlyViewedSection,{topics:((null==T?void 0:T.recently)||[]).map(e=>Object.assign(Object.assign({},e),{template:"recently"})),selectedTopics:x,onTopicChange:y,isBlock:N,labelProps:l}),d.createElement(TopicSection,{labelProps:l,topicsGroup:[{label:g("pnTopicSection.ppAlsoInterested"),topics:((null==T?void 0:T.interested)||[]).map(e=>Object.assign(Object.assign({},e),{template:"interested"}))}],selectedTopics:k,onTopicChange:P,isBlock:N}))},MoreTopics=()=>{let{t:e}=(0,O.u)(),{action:{pushNotifications:t}}=(0,d.useContext)(S.T),{prevStep:n,formValues:a,submitLoading:l,onSubmit:r,selectCategory:i,maxSelectCategory:o,setSelectCategory:s,currentUrl:c,isLoggedIn:g}=(0,d.useContext)(ed);return d.createElement(Layout,{heading:e("newsletter.topic.title"),type:"always",styles:{root:{paddingRight:(0,u.h)(25)}},stickyActions:d.createElement(d.Fragment,null,d.createElement(z.B,{fullWidth:!0,variant:"secondary",dataEventCategory:"Newsletter",dataEventAction:"Back Click",dataEventLabel:c,onClick:n},e("healthToolPNModal.back")),d.createElement(z.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Next Click",dataEventLabel:c,onClick:()=>{if(0===i.length)return t({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;null==r||r(a.name)},loading:l},e("healthToolPNModal.next")))},d.createElement(PremiumTopicSelect,{isLoggedIn:g,maxSelect:o,values:a.fitnessTopics,onChange:s,labelProps:{size:"s5",sx:{textTransform:"uppercase"}}}))},Result=()=>{let{t:e}=(0,O.u)(),{close:t,selectCategory:n,onRegisterSuccess:a,currentUrl:l,finishLabelOnResult:r,disclaimerText:i}=(0,d.useContext)(ed);return(0,d.useEffect)(()=>()=>{setTimeout(()=>{null==a||a()},400)},[]),d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(z.B,{fullWidth:!0,sx:{maxWidth:(0,u.h)(300)},dataEventCategory:"Newsletter",dataEventAction:"Continue Reading Click",dataEventLabel:l,onClick:()=>{t()}},r||e("healthToolPNModal.finish"))},d.createElement(m.K,null,d.createElement(b.k,{gap:(0,u.h)(8),sx:e=>({background:e.colors.green[0],border:`1px solid ${e.colors.green[1]}`,borderRadius:(0,u.h)(8),padding:(0,u.h)(8)})},d.createElement(h.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(F.T,{size:"p3"},i||e("pnModal.disclaimer"))),d.createElement(D.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:l,opened:r,close:i,finishLabelOnResult:o,onRegisterSuccess:s,disclaimerText:c})=>{let{t:u,locale:g}=(0,O.u)(),{action:{pushNotifications:p}}=(0,d.useContext)(S.T),h=k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),m=k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),[b,v]=(0,d.useState)([]),[E,f]=(0,d.useState)([]),[C,x]=(0,d.useState)(0),[w,T]=(0,d.useState)({name:"",fitnessTopics:[]}),[B,I]=(0,d.useState)(!1),lastStep=()=>x(2),R=(0,d.useCallback)(e=>(0,A.a)(void 0,void 0,void 0,function*(){try{I(!0),yield(0,S.e)((0,S.h)(eo.POST_SUBSCRIPTION,{website_url:(0,S.i)(g)}),"post",{headers:{"Content-Type":"application/json"},method:"POST",data:{ga_client_id:X.Z.get(P.G),client_ip:window.clientIP||"",user_info:Object.assign(Object.assign({},a.userInfo),{name:e||w.name,type_subscription:1}),domain:Z.v[g||en.L.Vietnam],category:E,perferred:a.preferredTopics.map(({id:e})=>({id:e}))}}),I(!1),yield(0,S.e)((0,S.j)(ec.UPDATE_SUBSCRIPTION),"post",{headers:{"Content-Type":"application/json"},method:"PUT",data:{subscription:1}}),lastStep()}catch(e){console.log({err:e}),I(!1),p({title:u("notification.comment.somethingWrong"),message:"",type:"danger"})}}),[w,E]);return(0,d.useEffect)(()=>{[h,m].forEach(e=>{let t=new Image;t.src=e})},[]),d.createElement(ed.Provider,{value:{currentUrl:l,isMobile:e,isLoggedIn:t,opened:r,close:i,pnSuggestCategory:n,nextStep:()=>x(e=>e<3?e+1:e),prevStep:()=>x(e=>e>0?e-1:e),lastStep,categoryLibs:b,setCategoryLibs:v,selectCategory:E,setSelectCategory:f,formValues:w,setFormValues:T,maxSelectCategory:5,submitLoading:B,onSubmit:R,onRegisterSuccess:s,finishLabelOnResult:o,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:i,zIndex:305,closeProps:{dataEventCategory:"Newsletter",dataEventAction:"Close Click",dataEventLabel:l}},d.createElement(y.v,{active:C,onStepClick:x,styles:{root:{height:"100%"},content:{padding:0,height:"100%",width:"100%"},steps:{display:"none"}}},d.createElement(y.v.Step,null,d.createElement(MainForm,null)),d.createElement(y.v.Step,null,d.createElement(MoreTopics,null)),d.createElement(y.v.Step,null,d.createElement(Result,null)))))},SurveyBanner=()=>{let{locale:e}=(0,O.u)(),{isMobile:t,isLoggedIn:n,currentUrl:a,acquisitionInfo:l,categoryIds:r,state:i,setState:o,settings:s,submitHandler:u,subcribeHealthStatus:g,showPNModal:p,setShowPNModal:h,setIsBack:m}=(0,d.useContext)(ei),[b,v]=(0,d.useState)([]),[E,f]=(0,d.useState)(p);(0,d.useEffect)(()=>{(0,A.a)(void 0,void 0,void 0,function*(){var t,n;let a=yield(0,S.e)((0,S.h)(eo.GET_NEWSLETTER_CATEGORIES,{_locale:e}),"get"),l=(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.interested)||[],i=(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.trending)||[],o=[...l,...i];v(o.filter(e=>r.includes(Number(e.catId))))})},[]);let C=(0,d.useRef)([]);return(0,d.useEffect)(()=>{let e=(null==g?void 0:g.value)||"",t=e.split("|").filter(Boolean),n=e;C.current.push(g),t.length>1&&(null!==C.current[0]&&m(!0),Object.keys(u).map(e=>{let a=e.split("|");if(t.length===a.length){let l=0;t.map(e=>{a.includes(String(e))&&(l+=1)}),l===t.length&&(n=e)}}));let a=t.length>0?u[n]:s;o(a)},[g]),(0,d.useEffect)(()=>{f(p)},[p]),(null==i?void 0:i.action)!==c.Hide?d.createElement(d.Fragment,null,d.createElement(HandlerBanner,Object.assign({},s.props)),d.createElement(PremiumNewsletterModal,{acquisitionInfo:l,isMobile:t,isLoggedIn:n,currentUrl:a,pnSuggestCategory:b,opened:E,close:()=>{var e;f(!1),h(!1),setTimeout(()=>{var e;(null===(e=i.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&o({action:c.Hide})},400),(null===(e=i.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&o({action:c.Hide})},onRegisterSuccess:()=>f(!1)})):null},SurveyOrPremiumBanner=({type:e,articleId:t=0,categoryIds:n=[],isMarketing:a,isSurveyType:l,hasPremiumBanner:r,currentUrl:i,isMobile:o,subcribeHealthStatus:s,setShouldAcquisitionModalOpen:u,onValueChange:g,source:p="discover",Wrapper:m})=>{let{t:b}=(0,O.u)(),{data:{userInfo:v}}=(0,d.useContext)(S.T),E=!!(null==v?void 0:v.id),[f,C]=(0,d.useState)(null),[x,w]=(0,d.useState)(),[y,k]=(0,d.useState)(""),[P,T]=(0,d.useState)(!1),[B,A]=(0,d.useState)(!1),I=(0,d.useMemo)(()=>el[e],[]),R=FLOW(b,i)[I],L=null==R?void 0:R.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 l=0;n.map(e=>{a.includes(String(e))&&(l+=1)}),l===n.length&&(t=e)}}),t)},N=m||h.x,handleShowPNBannerFlowWhenLogin=()=>r&&(null==v?void 0:v.subscription)!==1?d.createElement(PnBannerEle,null):null;return(0,d.useEffect)(()=>{E&&C({userInfo:v,preferredTopics:ea,healthTopics:[]})},[E]),d.createElement(ei.Provider,{value:{settings:R,submitHandler:L,type:e,surveyType:I,value:y,setValue:k,isMobile:o,isLoggedIn:E,isMarketing:a,hasPremiumBanner:r,currentUrl:i,acquisitionInfo:f,categoryIds:n,subcribeHealthStatus:s,articleId:t,onValueChange:g,state:x,setState:w,handleClickOption:e=>{let t=getMappingMultiValue(e);if(t){let n=L[t];n.action===c.ShowPremiumModal?r?(T(!0),w(Object.assign(Object.assign({},x),{actionParams:{hideBannerWhenClose:n.action===c.ShowPremiumModal}}))):(w({action:c.Hide}),null==g||g(e)):(w(n),null==g||g(e))}},showPNModal:P,setShowPNModal:T,source:p,Outside:N,isBack:B,setIsBack:A,minHeight:180,setShouldAcquisitionModalOpen:u}},void 0!==s?E?l&&R?(()=>{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)}},FUIV:function(e,t,n){n.d(t,{f:function(){return format},u:function(){return useTranslations}});var a=n("q1tI"),l=n("+Miz");function format(e,t){let n=[e];return(Object.keys(t).forEach(e=>{n=function(e,t,n){let l=[];return e.forEach(e=>{if("string"==typeof e){let r=RegExp(`\\{${n}\\}`,"gi");if("string"==typeof t||"number"==typeof t)l.push(e.replace(r,`${t}`));else{let n=e.split(r);n.forEach((e,r)=>{e&&(function(e){let t=[],n=!1,l=!1;return e.match(/^\s+/gi)&&(e=e.replace(/^\s+/gi,""),n=!0),e.match(/\s+$/gi)&&(e=e.replace(/\s+$/gi,""),l=!0),n&&t.push(a.createElement(a.Fragment,null,"\xa0")),t.push(e),l&&t.push(a.createElement(a.Fragment,null,"\xa0")),t})(e).forEach(e=>l.push(e)),r+1"string"==typeof e)?n.join(""):a.createElement(a.Fragment,null,n.map((e,t)=>a.createElement(a.Fragment,{key:t},e)))}function useTranslations(){let{values:e,locale:t}=(0,a.useContext)(l.T)||{locale:"en-PH"};return(0,a.useMemo)(()=>({t:(t,n)=>e?e[t]?n?format(e[t]||t,n):e[t]||t:n?format(t,n):t:t,locale:t}),[e,t])}},hJjf:function(e,t,n){n.d(t,{L:function(){return Loading}});var a=n("q1tI"),l=n("LB4I"),r=n("FUIV"),i=n("AeFk"),o=n("rBCA"),s=n("iBNF");let c=o.Z.div` display: flex; align-items: center; justify-content: center; padding: 1em; button { position: relative; } `,d=i.F4` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `;o.Z.div` display: flex; width: fit-content; width: -moz-fit-content; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 2rem; background: white; border-radius: ${s.r.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); .loading-spinner { width: 24px; height: 24px; margin-bottom: 0.5rem; animation: ${d} 1.2s linear infinite; } &[data-is-marrybaby='true'] { box-shadow: none; } `;let Loading=({className:e,size:t="md"})=>{let{t:n}=(0,r.u)();return a.createElement(c,{className:e},a.createElement(l.B,{size:t,color:"transparent",isLoading:!0},n("loading")))}},POO0:function(e,t,n){n.d(t,{S:function(){return Spoiler}});var a=n("Kz+G"),l=n("q1tI"),r=n("uCoU"),i=n("pMur"),o=n("FUIV"),s=n("iBNF");let Spoiler=e=>{var{children:t,line:n,lineHeight:c,trackingAttributes:d,maxHeight:u,customExpandFn:g}=e,p=(0,a._)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:h}=(0,o.u)(),m=(0,l.useMemo)(()=>u||(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,l.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]);return l.createElement(r.o,Object.assign({showLabel:l.createElement(i.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b,{onClick:g}),h("articlePage.readMore")),hideLabel:l.createElement(i.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b),h("articlePage.showLess"))},p,{maxHeight:m}),t)}},Vyfo:function(e,t,n){n.d(t,{u:function(){return a}});var a=(0,n("/npG").k)(e=>({root:{},inner:{},content:{borderRadius:16},header:{borderBottom:`1px solid ${e.colors.neutral[1]}`,marginRight:0,marginBottom:0,padding:"12px"},overlay:{},title:{fontSize:16,fontWeight:700,lineHeight:1.5},body:{},close:{cursor:"pointer",width:"unset",height:"unset",svg:{width:"24px !important",height:"24px !important"}}}))},MJLR:function(e,t,n){n.d(t,{L:function(){return LabelSorting}});var a,l,r=n("q1tI"),i=n("pMur"),o=n("7m0Y"),s=n("xp5F");(a=l||(l={})).latest="latest",a.oldest="oldest",a.popular="popular";let LabelSorting=({onChange:e,className:t,style:n,leftLabel:a,rightLabel:l,color:c,value:d,choices:u})=>{let{data:{env:{isMarryBaby:g}}}=(0,r.useContext)(o.T);return r.createElement(s.L,{label:a,rightLabel:r.createElement(s.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:u.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===d,className:"bold-item"}))},toggleButtonContent:r.createElement("div",{style:{display:"flex"}},r.createElement(i.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},l),r.createElement("img",{src:g?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%233E3F58' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m8 14 4 4 4-4M16 10l-4-4-4 4'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%238C8C8C' d='M4.5 7h7a.46.46 0 0 0 .351-.165.56.56 0 0 0 .149-.39q0-.226-.149-.391l-3.5-3.89a.458.458 0 0 0-.703 0l-3.5 3.89a.56.56 0 0 0-.148.39q0 .226.148.391Q4.298 7 4.5 7M11.5 9h-7a.46.46 0 0 0-.352.165.56.56 0 0 0-.148.39q0 .226.148.391l3.5 3.889a.46.46 0 0 0 .703 0l3.5-3.889a.56.56 0 0 0 .149-.39q0-.226-.149-.391A.46.46 0 0 0 11.5 9'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"},loading:"lazy"}))}),color:"gray",className:t,style:n})}},"o7I/":function(e,t,n){n.d(t,{c:function(){return convertLocalizedStringToNumber},f:function(){return formatPhoneNumber},l:function(){return localizeNumberFormat}});var a=n("A9bs");let localizeNumberFormat=(e,t,n=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(e),convertLocalizedStringToNumber=e=>Number(e.replace(/,/gi,".")),formatPhoneNumber=e=>{try{let t=(0,a.parsePhoneNumber)(e,"VN");if(!(null==t?void 0:t.number))throw Error("Invalid number");return(0,a.formatPhoneNumber)(t.number)}catch(t){return console.log("\uD83D\uDE80 ~ formatPhoneNumber ~ error:",t),e}}},pGve:function(e,t,n){n.d(t,{L:function(){return i}});var a=n("q1tI"),l=n("kSP5"),r=n("kuQP");let i=(0,a.memo)(({type:e,width:t,height:n,isLight:i})=>{let o=(0,a.useMemo)(()=>{switch(e){case"hellobacsi":return{width:t||"107px",height:n||"24px",src:l.C.getAssetPath("logo/hellobacsi.png"),srcLight:l.C.getAssetPath("logo/hellobacsi-light.png")};case"hellodoktor":return{width:t||"127px",height:n||"24px",src:l.C.getAssetPath("logo/hellodoktor.png")};case"hellosehat":return{width:t||"121px",height:n||"27px",src:l.C.getAssetPath("logo/hellosehat.png")};case"hellojiankang":return{width:t||"87px",height:n||"24px",src:l.C.getAssetPath("logo/hellojiankang.png")};case"hellohealth":return{width:t||"123px",height:n||"24px",src:l.C.getAssetPath("logo/hellohealth.png")};case"hellotogether":return{width:t||"150px",height:n||"24px",src:l.C.getAssetPath("logo/hellotogether.png")};case"hellocare":return{width:t||"99px",height:n||"24px",src:l.C.getAssetPath("logo/hellocare.png")};case"hellodoctor":return{width:t||"127px",height:n||"24px",src:l.C.getAssetPath("logo/hellodoctor.png")};case"hellokrupet":return{width:t||"101px",height:n||"24px",src:l.C.getAssetPath("logo/hellokrupet.png")};case"hellosayarwon":return{width:t||"111px",height:n||"24px",src:l.C.getAssetPath("logo/hellosayarwon.png")};case"helloyishi":return{width:t||"89px",height:n||"24px",src:l.C.getAssetPath("logo/helloyishi.png")};case"hellokhunmor":return{width:t||"123px",height:n||"24px",src:l.C.getAssetPath("logo/hellokhunmor.png")};case"helloswasthya":return{width:t||"105px",height:n||"24px",src:l.C.getAssetPath("logo/helloswasthya.png")};case"logomark":return{width:t||"60px",height:n||"57px",src:l.C.getAssetPath("logo/logomark.png")};case"marryBaby":return{width:t||"145px",height:n||"28px",src:l.C.getAssetPath("logo/marrybaby.png")};default:return null}},[e,t,n]),{src:s,width:c,height:d,srcLight:u}=o||{};return a.createElement(r.I,{alt:`${e} logo`,className:"main-logo-icon",src:i&&u||s,style:{width:c,height:d}})})}}]);