"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4447],{"jH+L":function(e,t,a){a.d(t,{T:function(){return ThrForm}});var n=a("6eqW"),l=a("q1tI"),i=a("cChf"),o=a("ZFu2"),r=a("ySrh"),s=a("ZKGu"),c=a("i2MM"),d=a("5+xW"),p=a("Mzyo"),u=a("TH2c"),m=a("7mOA"),h=a("ZQ3V"),g=a("yjyv"),v=a("Xlwb"),b=a("xrdX");let E=(0,l.createContext)({}),DefaultForm=e=>{var t,a=(0,n._)(e,[]);let{t:i,locale:o}=(0,s.u)(),{isAdult:r,activeValueNote:c,linkTool:d,form:f,submitProps:w}=(0,l.useContext)(E),{classes:y={}}=(0,l.useContext)(g.C);return l.createElement(v.H,Object.assign({formLayout:"default"},a),l.createElement(v.H.FormRow,null,l.createElement(p.G,Object.assign({},f.getInputProps("gender")))),l.createElement(v.H.FormRow,null,l.createElement(m.D,Object.assign({},f.getInputProps("age"),{placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},label:l.createElement(h.T,{size:"p2",weight:"semiBold"},i("targetHeartRate.ageInput")),maxDate:new Date}))),l.createElement(v.H.FormRow,null,l.createElement(u.I.Number,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},i("targetHeartRate.heartRateInput")),placeholder:i("tools.inputPlaceholder",{content:"60"})},f.getInputProps("heartRate"),{min:40,max:200,styles:()=>({rightSection:{width:"auto"}})}))),r&&l.createElement(v.H.FormRow,null,l.createElement(u.S,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},i("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(v.H.FormRow,{className:y.submitWrapper},l.createElement(v.H.Submit,Object.assign({className:y.submitBtn,type:"submit",dataEventCategory:"Health Tool",dataEventAction:"THR",dataEventLabel:`https://${b.v[o]}/${d}`},w),i("bmi.submit"))))},InlineForm=e=>{var t,a=(0,n._)(e,[]);let{t:i,locale:o}=(0,s.u)(),{isAdult:r,activeValueNote:c,linkTool:d,form:h,submitProps:f}=(0,l.useContext)(E),{classes:w={}}=(0,l.useContext)(g.C);return l.createElement(v.H,Object.assign({formLayout:"inline"},a),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:i("tools.selectGender"),width:"none"},l.createElement(p.G,Object.assign({type:"radio",hideLabel:!0,error:null},h.getInputProps("gender")))),h.errors.gender&&l.createElement(v.H.Error,null,h.errors.gender)),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:i("targetHeartRate.ageInput")},l.createElement(m.D,Object.assign({},h.getInputProps("age"),{placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},error:null,maxDate:new Date}))),h.errors.age&&l.createElement(v.H.Error,null,h.errors.age)),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:i("targetHeartRate.heartRateInput")},l.createElement(u.I.Number,Object.assign({placeholder:i("tools.inputPlaceholder",{content:"60"})},h.getInputProps("heartRate"),{error:null,min:40,max:200,rightSection:l.createElement(v.H.Unit,null,"bmp"),styles:()=>({rightSection:{width:"auto"}})}))),h.errors.heartRate&&l.createElement(v.H.Error,null,h.errors.heartRate)),r&&l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:i("targetHeartRate.selectActive")},l.createElement(u.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(v.H.FormRow,{className:w.submitWrapper},l.createElement(v.H.Submit,Object.assign({className:w.submitBtn,type:"submit",dataEventCategory:"Health Tool",dataEventAction:"THR",dataEventLabel:`https://${b.v[o]}/${d}`},f),i("bmi.submit"))))},ThrForm=e=>{var{formLayout:t,onSubmit:a,onError:p,submitProps:u}=e,m=(0,n._)(e,["formLayout","onSubmit","onError","submitProps"]);let{t:h,locale:g}=(0,s.u)(),v=(0,l.useRef)(40),{getHealthToolLink:b}=(0,r.u)(g),f=(0,i.c)({initialValues:{heartRate:60,activeValue:"low_intensity"},validate:{gender:(0,o.U)(h("validation.error.requiredField")),age:(0,o.U)(h("validation.error.requiredField")),heartRate:e=>Number(e)>=v.current&&200>=Number(e)?null:h("tools.heartRateRangeErr",{min:v.current,max:200})}}),w=(0,l.useMemo)(()=>b(d.H.THR),[b]),[y,x]=(0,l.useState)(!1),C=[{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 a=(new Date().getTime()-e.getTime())/1e3;a>=567648e3?x(!0):x(!1);let n=C.find(e=>a>=31536e3*e.minAge&&a<31536e3*e.maxAge)||C[0];v.current="male"===t?n.rangeMale:n.rangeFemale}},[f]);let S=Object.assign(Object.assign({},m),{onSubmit:f.onSubmit(a,p)});return l.createElement(E.Provider,{value:{isAdult:y,activeValueNote:k,linkTool:w,form:f,submitProps:u}},"inline"===t?l.createElement(InlineForm,Object.assign({},S)):l.createElement(DefaultForm,Object.assign({},S)))}},"x/Jy":function(e,t,a){a.d(t,{M:function(){return el},S:function(){return SurveyOrPremiumBanner},a:function(){return ei},b:function(){return SideBannerModal}});var n,l,i,o,r,s,c,d=a("q1tI"),p=a("mYVa"),u=a("7Ci/"),m=a("/npG"),h=a("Eso5"),g=a("OAL+"),v=a("SPK5"),b=a("RZSM"),E=a("vaps"),f=a("9n+W"),w=a("DA0W"),y=a("RGvF"),x=a("JZkZ"),C=a("MkcP"),k=a("i2MM"),S=a("4fTT"),P=a("Jbia"),T=a("QyuW"),I=a("UIg8"),B=a("6eqW"),M=a("T4hN"),O=a("EDn0"),A=a("XKpd"),R=a("ZKGu"),L=a("cChf"),N=a("ZFu2"),j=a("TH2c"),_=a("Yoob"),H=a("ZQ3V"),D=a("p3w3"),z=a("jD9D"),F=a("IQVP"),$=a("OGdO"),V=a("ySrh"),W=a("V2lD"),Z=a("xrdX"),G=a("GOBr"),U=a("OWiL"),q=a("vWP/"),Y=a("02Su"),K=a("gOIo"),Q=a("JIJ2"),X=a("TYy9"),J=a.n(X),ee=a("qPyV"),et=a.n(ee),ea=a("PmKk");let en=[{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}];(n=o||(o={})).Pregnant="pregnant",n.Parenting="parenting",(r||(r={})).Option="option",(l=s||(s={})).Button="button",l.Checkbox="checkbox",(i=c||(c={})).ShowTool="showTool",i.ShowPremiumModal="showPremiumModal",i.ShowOptionBanner="showOptionBanner",i.Hide="hide";let el={pregnancy:o.Pregnant,parenting:o.Parenting},ei={[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:T.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: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:I.t.HPV,props:{value:I.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},[I.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:I.t.HPV,hideDescOnMobile:!0,dataEventAction:"Keep safe from HPV virus Click"}}),eo=(0,d.createContext)({}),PnBannerEle=e=>{var t=(0,B._)(e,[]);let{locale:a}=(0,R.u)(),{type:n,isMobile:l,currentUrl:i,isMarketing:o,isLoggedIn:r,setShouldAcquisitionModalOpen:s}=(0,d.useContext)(eo),{triggerLogin:c}=(0,M.u)();return d.createElement(u.W,Object.assign({mih:{base:144,md:160},fluid:!0,p:0,sx:{borderRadius:4,cursor:"pointer"},onClick:()=>(0,B.a)(void 0,void 0,void 0,function*(){let e=o?(0,A.g)(a)+"/dang-ky-nhan-tin/":`${window.location.href}?source=acquisition`;r?null==s||s():(0,M.I)(a)?c({returnUrl:o?e:void 0,source:o?void 0:"acquisition"}):window.location.href=`${(0,A.a)(a)}/?returnUrl=${encodeURIComponent(e)}`}),"data-event-category":"Newsletter","data-event-action":"Banner Click","data-event-label":i,className:"pointer-event-child-none"},t),d.createElement(O.I,{src:o?k.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_Marketing.png`):k.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_${n}.png`),style:{maxWidth:"100%"},alt:"newsletter banner"}))},er={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,m.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:a={desktop:"",mobile:""},hideDescOnMobile:n,children:l})=>{let{isMobile:i,minHeight:o}=(0,d.useContext)(eo);return d.createElement(h.x,{sx:()=>({borderRadius:(0,p.h)(8),background:"linear-gradient(180deg, #FAFDFF 0%, #E3F2FF 100%)"})},d.createElement(h.x,{sx:e=>({minHeight:(0,p.h)(o),borderRadius:"inherit",background:`url(${i?a.mobile:a.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,{tag:"h4"},e),!(n&&i)&&t&&d.createElement(H.T,{size:"p4"},t)),d.createElement(h.x,null,l))))},BannerWithOptions=e=>{let{styleType:t=s.Button,items:a=[],buttonProps:n,styles:l,submitBtnTracking:i}=e,{classes:o}=es(void 0,{name:"PremiumBannerWithOptions",styles:l}),{t:r,locale:c}=(0,R.u)(),{surveyType:u,articleId:m,handleClickOption:g,hasPremiumBanner:b,source:E,isMobile:f,setShowPNModal:w}=(0,d.useContext)(eo),y=(0,d.useMemo)(()=>b?a:a.filter(e=>!e.isPNBtn).filter(Boolean),[a]),{getHealthToolLink:x}=(0,V.u)(c),C=(0,L.c)({initialValues:{bannerOptions:[]}}),saveStep=e=>(0,B.a)(void 0,void 0,void 0,function*(){return yield(0,S.e)((0,S.f)(F.yy.HEALTH_TOOL.CREATE,{_locale:c,type:ei[u]}),"POST",{headers:{"Content-Type":"application/json"},data:{value:e,article:m,source:E}})}),k=(0,d.useCallback)(()=>d.createElement(v.k,{gap:(0,p.h)(8),className:o.wrapper},y.map((e,t)=>d.createElement(h.x,{key:String(t),component:e.isLink?"a":"div",href:e.isRiskScreener?`https://${Z.v[c]}/bot/${I.n[c][e.activeTool]}/`:e.isLink?x(e.activeTool):void 0},d.createElement(D.B,Object.assign({className:o.button,classNames:{label:o.buttonLabel},size:"sm"},e.tracking,n,{onClick:()=>{e.isLink||(e.isPNBtn&&w(!0),saveStep(e.value),g(e.value))}}),e.label)))),[y,C]),P=(0,d.useCallback)(()=>d.createElement(v.k,null,d.createElement(v.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(j.d.Group,Object.assign({},C.getInputProps("bannerOptions",{type:"checkbox"})),d.createElement(v.k,{gap:(0,p.h)(16)},y.map((e,t)=>d.createElement(j.d,{key:String(t),value:e.value,label:e.label,styles:{label:{cursor:"pointer"}}})))),d.createElement(D.B,Object.assign({size:"sm"},i,n,{disabled:0===C.getInputProps("bannerOptions").value.length,leftIcon:f?d.createElement(W.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}}})}),!f&&r("pnBanner.submit")))),[y,C]);return d.createElement(BannerLayout,Object.assign({},e),t===s.Button?k():t===s.Checkbox?P():null)},ToolBanner=e=>{var t,a;let{t:n}=(0,R.u)(),{heading:l,description:i,thumbnail:o,btnLabel:r,value:s,isRiskScreener:c,hideDescOnMobile:u,dataEventAction:m}=e,{locale:h}=(0,R.u)(),{isMobile:b}=(0,d.useContext)(eo),{getHealthToolLink:E,allTools:f}=(0,V.u)(h),w=(0,d.useMemo)(()=>{let e=c?`https://${G.y?"":"discover."}${Z.v[h]}/bot/${I.n[h][s]}`:E(s);return d.createElement("a",{href:e},d.createElement(D.B,{size:"sm","data-event-category":"Focused Audience","data-event-action":m,"data-event-label":e},r||n("pnBanner.caclNow")))},[f]);return"mainBanner"==(c?"mainBanner":"toolBanner")?d.createElement(BannerLayout,Object.assign({},Object.assign(Object.assign({},e),{thumbnail:e.thumbnail})),w):d.createElement(v.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)},l&&d.createElement($.H,{tag:"h4"},l),!(b&&u)&&i&&d.createElement(H.T,{size:"p4"},i)),d.createElement(v.k,{gap:(0,p.h)(8),sx:{button:{minWidth:(0,p.h)(120)}}},w)),d.createElement(v.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===(a=null===(t=f.filter(e=>e.template===s))||void 0===t?void 0:t[0])||void 0===a?void 0:a.icon)||T.a[s]||"",loading:"lazy"})))},HandlerBanner=()=>{var e,t,a;let{t:n}=(0,R.u)(),{state:l,Outside:i}=(0,d.useContext)(eo);return(null==l?void 0:l.action)===c.ShowTool?d.createElement(i,null,TOOL_BANNERS_PROPS(n)[null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.value]?d.createElement(ToolBanner,Object.assign({},TOOL_BANNERS_PROPS(n)[null===(t=null==l?void 0:l.props)||void 0===t?void 0:t.value],{value:null===(a=null==l?void 0:l.props)||void 0===a?void 0:a.value})):null):(null==l?void 0:l.action)===c.ShowOptionBanner?d.createElement(i,null,d.createElement(BannerWithOptions,Object.assign({},null==l?void 0:l.props))):null},SideBannerModal=e=>{var{isMobile:t,children:a,desktopBanner:n=k.C.getAssetPath("friso/onboarding-banner.jpg"),mobileBanner:l=k.C.getAssetPath("friso/onboarding-banner-mobile.jpg"),modalRatio:i={width:937,height:536},mobileBannerRatio:o={width:750,height:480},desktopBannerRatio:r={width:420,height:536},closeProps:s}=e,c=(0,B._)(e,["isMobile","children","desktopBanner","mobileBanner","modalRatio","mobileBannerRatio","desktopBannerRatio","closeProps"]);let{width:u,height:m}=(0,z.n)(),g=u*o.height/o.width,[v,E]=(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)(i.width),width:"100%",height:"100%",maxHeight:(0,p.h)(i.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:`${(v?1:((m<=667?190:265)+g+74)/m)*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:v?0:(0,p.h)(12),borderTopRightRadius:v?0:(0,p.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(D.B,Object.assign({variant:"white",leftIcon:d.createElement(U.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(b.o,{ratio:(null==o?void 0:o.width)/(null==o?void 0:o.height),w:"100%"}),d.createElement(h.x,{className:"inner",sx:{padding:`${(0,p.h)(28)} ${(0,p.h)(16)} ${(0,p.h)(16)}`,background:"white",position:"relative"}},a))))):d.createElement(b.o,{className:"desktop-template",ratio:i.width/i.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,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)(n)?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:n})):d.createElement("img",{alt:"",src:n,loading:"lazy",style:{borderTopLeftRadius:(0,p.h)(8),borderBottomLeftRadius:(0,p.h)(8),height:"100%",display:"block"}}),d.createElement(h.x,{sx:{position:"relative",height:"100%",width:`${(i.width-r.width)/i.width*100}%`}},d.createElement(D.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,p.h)(40)} ${(0,p.h)(24)} 0`}},a)))))},ec={UPDATE_SUBSCRIPTION:"user/subscription"},ed=(0,d.createContext)({}),_NormalTopic=e=>{var{value:t,name:a}=e,n=(0,B._)(e,["value","name"]);return d.createElement(j.g,Object.assign({value:t,withIcon:!0},n,{buttonProps:{styles:()=>({leftIcon:{marginRight:(0,p.h)(6)},root:{paddingLeft:(0,p.h)(10),paddingRight:(0,p.h)(10)}})}}),a)},TopicSection=({topicsGroup:e,onTopicChange:t,isBlock:a=!1,selectedTopics:n=[],inputProps:l,labelProps:i,maxSelect:o=5,hasScroll:r,readonly:s})=>{let{action:{pushNotifications:c}}=(0,d.useContext)(S.T),p=J()(e.map(e=>e.topics||[])),{t:u}=(0,R.u)(),[m,b]=(0,d.useState)([]);(0,d.useEffect)(()=>{b(n)},[n.length]),(0,d.useEffect)(()=>{null==t||t(m)},[m]);let onValueChange=e=>{if(e.length>5){c({type:"danger",title:u("pnTopicSection.maxSelectError.title",{maxSelect:o}),message:u("pnTopicSection.maxSelectError.desc")});return}s||b(()=>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(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},i),e.label),r?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:m.map(e=>e.catId),multiple:!0},l,{onChange:onValueChange}),d.createElement(v.k,{gap:8,wrap:"wrap"},e.topics.map(t=>d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:a},e.tracking))))))):d.createElement(f.A.Group,Object.assign({value:m.map(e=>e.catId),multiple:!0},l,{onChange:onValueChange}),d.createElement(v.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:a},e.tracking)):d.isValidElement(t.component)?t.component:null))))))},Layout=e=>{var{heading:t,children:a,stickyActions:n}=e,l=(0,B._)(e,["heading","children","stickyActions"]);let{isMobile:i}=(0,d.useContext)(ed),o=d.createElement(g.K,{spacing:(0,p.h)(24),sx:{height:"100%"}},d.createElement($.H,{tag:"h4",style:{textAlign:"center"}},t),d.createElement(h.x,null,a));return d.createElement(h.x,{sx:e=>({[e.fn.largerThan("sm")]:{position:"relative",height:"100%"}})},i?o:d.createElement(E.x,Object.assign({className:"layout-body",h:n?"calc(100% - 90px)":"100%"},l),o),n&&d.createElement(v.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`}})},n))},MainForm=()=>{let{t:e,locale:t}=(0,R.u)(),{data:{userInfo:a},action:{pushNotifications:n}}=(0,d.useContext)(S.T),l=null==a?void 0:a.id,{currentUrl:i,isMobile:o,pnSuggestCategory:r=[],nextStep:s,formValues:c,setFormValues:u,onSubmit:m,submitLoading:h,selectCategory:v,setCategoryLibs:b,setSelectCategory:E,maxSelectCategory:f}=(0,d.useContext)(ed),w=r.map(e=>e.catId),y=(0,L.c)({validate:{name:(0,N.U)(e("healthToolPNModal.mainForm.requireName"))},initialValues:Object.assign(Object.assign({},c),{fitnessTopics:w})}),[x,C]=(0,d.useState)([]),[k,P]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,B.a)(void 0,void 0,void 0,function*(){var e;try{let a=yield(0,S.e)((0,S.h)(er.GET_SUBSCRIPTION_CATEGORIES,{_locale:t}),"get"),n=((null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.subscription)||[]).filter(e=>!w.includes(e.catId));C(r),P(n),b([...r,...n])}catch(e){console.log(e)}})},[]),(0,d.useEffect)(()=>{l&&y.setFieldValue("name",(null==a?void 0:a.name)||"")},[l]);let onMore=()=>{""!==y.getInputProps("name").value?(u(y.getTransformedValues()),s()):y.validateField("name")},T=(0,d.useMemo)(()=>d.createElement(D.B,{variant:"tertiary",dataEventCategory:"Newsletter",dataEventAction:"More Category Click",dataEventLabel:i,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(H.T,{size:o?"p3":"p4"},e("home.seeMore"))),[y]);return(0,d.useEffect)(()=>{y.setFieldValue("fitnessTopics",v.map(e=>e.catId))},[v]),d.createElement("form",{style:{height:"100%"},onSubmit:y.onSubmit(t=>{if(0===v.length)return n({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;u(t),null==m||m(t.name)})},d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(d.Fragment,null,d.createElement(D.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Register Click",dataEventLabel:i,loading:h,sx:{maxWidth:(0,p.h)(240)}},e("healthToolPNModal.register")))},d.createElement(g.K,{spacing:(0,p.h)(16)},d.createElement(j.I,Object.assign({label:e("newsletter.welcome.description")},y.getInputProps("name"))),d.createElement(TopicSection,{topicsGroup:[...0===r.length&&0===k.length?[{topics:[{component:T}]}]:[],...r.length>0?[{label:e("healthToolPNModal.mainForm.tailorTopicsHeading"),topics:[...r,...0===k.length?[{component:T}]:[]]}]:[],...k.length>0?[{label:e("healthToolPNModal.findMore.chooseFav"),topics:[...k,...k.length>0?[{component:T}]:[]]}]:[]],selectedTopics:[...x],labelProps:{size:o?"p3":"p4",color:"gray.6"},onTopicChange:E,maxSelect:f}))))},ep=(0,d.forwardRef)(function(e,t){var{label:a}=e,n=(0,B._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},n),d.createElement(w.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(H.T,{size:"p3"},a)))}),eu=(0,d.forwardRef)(function(e,t){var{label:a}=e,n=(0,B._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},n),d.createElement(H.T,{size:"p3"},a))}),HistorySection=({history:e,onDelete:t})=>d.createElement(v.k,{wrap:"wrap",gap:8},et()(e,"catId").map(e=>d.createElement(y.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 ${_.t.neutral[4]}`,borderRadius:32,textTransform:"unset"},rightSection:{height:18,cursor:"pointer"}}},d.createElement(H.T,{size:"p4"},e.localName)))),RecentlyViewedSection=({topics:e,onTopicChange:t,isBlock:a=!1,selectedTopics:n,labelProps:l,maxSelect:i=5})=>{let{action:{pushNotifications:o}}=(0,d.useContext)(S.T),[r,s]=(0,d.useState)([]),{t:c}=(0,R.u)();return((0,d.useEffect)(()=>{s(n)},[n.length]),(0,d.useEffect)(()=>{t(r)},[r]),e&&0!==e.length)?d.createElement(g.K,{spacing:12,px:16,mx:-16},d.createElement(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},l),c("pnTopicSection.recentView")),d.createElement(f.A.Group,{value:r.map(e=>e.catId),onChange:t=>{if(a&&r.lengthe.filter(e=>t.some(t=>e.catId===t)))},multiple:!0},d.createElement(v.k,{gap:8,wrap:"wrap"},e.map((e,t)=>d.createElement(_NormalTopic,{key:t,value:e.catId,name:e.localName,isBlock:a}))))):null},_TopicSlide=e=>{var{topic:t,active:a,onClick:n}=e,l=(0,B._)(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,p.h)(130),[e.fn.largerThan("sm")]:{minHeight:(0,p.h)(138)}}),onClick:()=>n(t,a)},l),a&&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(j.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(H.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:a,isBlock:n=!1,labelProps:l,pushNotifications:i,maxSelect:o=5})=>{let{t:r}=(0,R.u)(),[s,c]=(0,d.useState)([]),onSelect=(e,t)=>{if(t)c(t=>t.filter(t=>t.catId!==e.catId));else{if(n){i({type:"danger",title:r("pnTopicSection.maxSelectError.title",{maxSelect:o}),message:r("pnTopicSection.maxSelectError.desc")});return}c(t=>[...t,e])}};(0,d.useEffect)(()=>{c(t)},[t.length]),(0,d.useEffect)(()=>{a(s)},[s]);let[p,u]=(0,d.useState)(!1),[m,b]=(0,d.useState)(0),[f,w]=(0,d.useState)(0),y=(0,d.useRef)(null),handleMouseUp=()=>{u(!1)};return d.createElement(g.K,{spacing:10},d.createElement(v.k,{justify:"space-between",align:"center",w:"100%"},d.createElement(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold",span:!0},l),r("pnTopicSection.trending"))),d.createElement(h.x,null,d.createElement(E.x,{type:"always",w:"100%",offsetScrollbars:!0,scrollbarSize:4,px:4,viewportRef:y,viewportProps:{onMouseDown:e=>{e.preventDefault(),y.current&&(u(!0),b(e.pageX-y.current.offsetLeft),w(y.current.scrollLeft))},onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onMouseMove:e=>{if(e.preventDefault(),!p||!y.current)return;let t=e.pageX-y.current.offsetLeft;y.current.scrollLeft=f-(t-m)*2}},styles:{viewport:{paddingBottom:16}}},d.createElement(h.x,{w:{base:112*e.length+8*(e.length-1)+10}},d.createElement(v.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:a=5,values:n=[],labelProps:l,onChange:i}=e,o=(0,B._)(e,["isLoggedIn","maxSelect","values","labelProps","onChange"]);let{action:{pushNotifications:r}}=(0,d.useContext)(S.T),[s,c]=(0,d.useState)(""),{t:u,locale:m}=(0,R.u)(),v=(0,d.useRef)(null),[b,E]=(0,d.useState)([]),[f,w]=(0,d.useState)([]),[y,C]=(0,d.useState)([]),[k,P]=(0,d.useState)([]),[T,I]=(0,d.useState)(null),[M,O]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,B.a)(void 0,void 0,void 0,function*(){var e,t;let a=yield(0,S.e)((0,S.h)(er.GET_NEWSLETTER_CATEGORIES,{_locale:m}),"get"),l=(null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.interested)||[],i=(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.trending)||[],o=et()([...l,...i],"catId"),r=o.map(e=>Object.assign(Object.assign({},e),{value:e.catId||"",label:e.localName||""}));if(O(r||[]),I((null==a?void 0:a.data)||null),n.length>0){let e=l.filter(e=>n.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"interested"})),t=i.filter(e=>n.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"trending"}));P(e),w(t)}})},[t]);let A=(0,d.useMemo)(()=>et()([...b,...f,...k,...y],"catId"),[b,f,k,y]),[L,N]=(0,d.useState)(!1);(0,d.useEffect)(()=>{A.length>=a?N(!0):N(!1),null==i||i(A)},[A]);let onValueChange=e=>(0,B.a)(void 0,void 0,void 0,function*(){var t;let n="default";if(L)r({type:"danger",title:u("pnTopicSection.maxSelectError.title",{maxSelect:a}),message:u("pnTopicSection.maxSelectError.desc")});else{let a=[{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=a.find(t=>{var a;return null===(a=t.array)||void 0===a?void 0:a.some(t=>t.catId===e[0])});({trending:w,recently:C,interested:P,default:E})[n=(null==l?void 0:l.key)||"default"](t=>[...t,...M.filter(t=>e.some(e=>t.catId===e))].map(e=>Object.assign(Object.assign({},e),{template:n}))),null===(t=v.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(H.T,{size:"p3"},u("pnTopicSection.maxSelectError.detail",{max:a,maxTopic:A.length})),d.createElement(x.NU,{ref:v,maxSelectedValues:3,styles:{wrapper:{overflow:"initial !important"},separator:{padding:16},separatorLabel:{fontWeight:600,fontSize:12,lineHeight:"18px",textTransform:"uppercase",color:_.t.gray[4],"&::after":{display:"none"}},searchInput:{fontSize:"inherit"},input:{paddingRight:16}},nothingFound:d.createElement(H.T,{size:"s4",color:"gray.6"},u("pnTopicSection.notFound")),itemComponent:""===s?ep:eu,size:"lg",placeholder:u("pnTopicSection.plsEnterFavTopics"),data:M,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:[]}),A&&A.length>0&&d.createElement(HistorySection,{history:A,onDelete:e=>{let t={trending:w,recently:C,interested:P,default:E},a=t[e.template]||t.default;a(t=>{let a=[...t],n=a.findIndex(t=>t.catId===e.catId);return a.splice(n,1),a})}})),d.createElement(h.x,{sx:e=>({position:"relative",height:(0,p.h)(175),[e.fn.largerThan("sm")]:{height:(0,p.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:w,isBlock:L,labelProps:l}))),d.createElement(RecentlyViewedSection,{topics:((null==T?void 0:T.recently)||[]).map(e=>Object.assign(Object.assign({},e),{template:"recently"})),selectedTopics:y,onTopicChange:C,isBlock:L,labelProps:l}),d.createElement(TopicSection,{labelProps:l,topicsGroup:[{label:u("pnTopicSection.ppAlsoInterested"),topics:((null==T?void 0:T.interested)||[]).map(e=>Object.assign(Object.assign({},e),{template:"interested"}))}],selectedTopics:k,onTopicChange:P,isBlock:L}))},MoreTopics=()=>{let{t:e}=(0,R.u)(),{action:{pushNotifications:t}}=(0,d.useContext)(S.T),{prevStep:a,formValues:n,submitLoading:l,onSubmit:i,selectCategory:o,maxSelectCategory:r,setSelectCategory:s,currentUrl:c,isLoggedIn:u}=(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(D.B,{fullWidth:!0,variant:"secondary",dataEventCategory:"Newsletter",dataEventAction:"Back Click",dataEventLabel:c,onClick:a},e("healthToolPNModal.back")),d.createElement(D.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==i||i(n.name)},loading:l},e("healthToolPNModal.next")))},d.createElement(PremiumTopicSelect,{isLoggedIn:u,maxSelect:r,values:n.fitnessTopics,onChange:s,labelProps:{size:"s5",sx:{textTransform:"uppercase"}}}))},Result=()=>{let{t:e}=(0,R.u)(),{close:t,selectCategory:a,onRegisterSuccess:n,currentUrl:l,finishLabelOnResult:i,disclaimerText:o}=(0,d.useContext)(ed);return(0,d.useEffect)(()=>()=>{setTimeout(()=>{null==n||n()},400)},[]),d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(D.B,{fullWidth:!0,sx:{maxWidth:(0,p.h)(300)},dataEventCategory:"Newsletter",dataEventAction:"Continue Reading Click",dataEventLabel:l,onClick:()=>{t()}},i||e("healthToolPNModal.finish"))},d.createElement(g.K,null,d.createElement(v.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(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(H.T,{size:"p3"},o||e("pnModal.disclaimer"))),d.createElement($.H,{tag:"h5"},e("healthToolPNModal.yourPre")),a.length>0&&d.createElement(TopicSection,{topicsGroup:[{label:"",topics:a}],selectedTopics:a,readonly:!0})))},PremiumNewsletterModal=({isMobile:e,isLoggedIn:t,pnSuggestCategory:a=[],acquisitionInfo:n,currentUrl:l,opened:i,close:o,finishLabelOnResult:r,onRegisterSuccess:s,disclaimerText:c})=>{let{t:p,locale:u}=(0,R.u)(),{action:{pushNotifications:m}}=(0,d.useContext)(S.T),h=k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),g=k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),[v,b]=(0,d.useState)([]),[E,f]=(0,d.useState)([]),[w,y]=(0,d.useState)(0),[x,T]=(0,d.useState)({name:"",fitnessTopics:[]}),[I,M]=(0,d.useState)(!1),lastStep=()=>y(2),O=(0,d.useCallback)(e=>(0,B.a)(void 0,void 0,void 0,function*(){try{M(!0),yield(0,S.e)((0,S.h)(er.POST_SUBSCRIPTION,{website_url:(0,S.i)(u)}),"post",{headers:{"Content-Type":"application/json"},method:"POST",data:{ga_client_id:Q.Z.get(P.G),client_ip:window.clientIP||"",user_info:Object.assign(Object.assign({},n.userInfo),{name:e||x.name,type_subscription:1}),domain:Z.v[u||ea.L.Vietnam],category:E,perferred:n.preferredTopics.map(({id:e})=>({id:e}))}}),M(!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}),M(!1),m({title:p("notification.comment.somethingWrong"),message:"",type:"danger"})}}),[x,E]);return(0,d.useEffect)(()=>{[h,g].forEach(e=>{let t=new Image;t.src=e})},[]),d.createElement(ed.Provider,{value:{currentUrl:l,isMobile:e,isLoggedIn:t,opened:i,close:o,pnSuggestCategory:a,nextStep:()=>y(e=>e<3?e+1:e),prevStep:()=>y(e=>e>0?e-1:e),lastStep,categoryLibs:v,setCategoryLibs:b,selectCategory:E,setSelectCategory:f,formValues:x,setFormValues:T,maxSelectCategory:5,submitLoading:I,onSubmit:O,onRegisterSuccess:s,finishLabelOnResult:r,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:i,onClose:o,zIndex:305,closeProps:{dataEventCategory:"Newsletter",dataEventAction:"Close Click",dataEventLabel:l}},d.createElement(C.v,{active:w,onStepClick:y,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,R.u)(),{isMobile:t,isLoggedIn:a,currentUrl:n,acquisitionInfo:l,categoryIds:i,state:o,setState:r,settings:s,submitHandler:p,subcribeHealthStatus:u,showPNModal:m,setShowPNModal:h,setIsBack:g}=(0,d.useContext)(eo),[v,b]=(0,d.useState)([]),[E,f]=(0,d.useState)(m);(0,d.useEffect)(()=>{(0,B.a)(void 0,void 0,void 0,function*(){var t,a;let n=yield(0,S.e)((0,S.h)(er.GET_NEWSLETTER_CATEGORIES,{_locale:e}),"get"),l=(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.interested)||[],o=(null===(a=null==n?void 0:n.data)||void 0===a?void 0:a.trending)||[],r=[...l,...o];b(r.filter(e=>i.includes(Number(e.catId))))})},[]);let w=(0,d.useRef)([]);return(0,d.useEffect)(()=>{let e=(null==u?void 0:u.value)||"",t=e.split("|").filter(Boolean),a=e;w.current.push(u),t.length>1&&(null!==w.current[0]&&g(!0),Object.keys(p).map(e=>{let n=e.split("|");if(t.length===n.length){let l=0;t.map(e=>{n.includes(String(e))&&(l+=1)}),l===t.length&&(a=e)}}));let n=t.length>0?p[a]:s;r(n)},[u]),(0,d.useEffect)(()=>{f(m)},[m]),(null==o?void 0:o.action)!==c.Hide?d.createElement(d.Fragment,null,d.createElement(HandlerBanner,Object.assign({},s.props)),d.createElement(PremiumNewsletterModal,{acquisitionInfo:l,isMobile:t,isLoggedIn:a,currentUrl:n,pnSuggestCategory:v,opened:E,close:()=>{var e;f(!1),h(!1),setTimeout(()=>{var e;(null===(e=o.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&r({action:c.Hide})},400),(null===(e=o.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&r({action:c.Hide})},onRegisterSuccess:()=>f(!1)})):null},SurveyOrPremiumBanner=({type:e,articleId:t=0,categoryIds:a=[],isMarketing:n,isSurveyType:l,hasPremiumBanner:i,currentUrl:o,isMobile:r,subcribeHealthStatus:s,setShouldAcquisitionModalOpen:p,onValueChange:u,source:m="discover",Wrapper:g})=>{let{t:v}=(0,R.u)(),{data:{userInfo:b}}=(0,d.useContext)(S.T),E=!!(null==b?void 0:b.id),[f,w]=(0,d.useState)(null),[y,x]=(0,d.useState)(),[C,k]=(0,d.useState)(""),[P,T]=(0,d.useState)(!1),[I,B]=(0,d.useState)(!1),M=(0,d.useMemo)(()=>el[e],[]),O=FLOW(v,o)[M],A=null==O?void 0:O.submitHandler,getMappingMultiValue=e=>{let t="",a=e.split("|");return 1===a.length?e:(Object.keys(A).map(e=>{let n=e.split("|");if(a.length===n.length){let l=0;a.map(e=>{n.includes(String(e))&&(l+=1)}),l===a.length&&(t=e)}}),t)},L=g||h.x,handleShowPNBannerFlowWhenLogin=()=>i&&(null==b?void 0:b.subscription)!==1?d.createElement(PnBannerEle,null):null;return(0,d.useEffect)(()=>{E&&w({userInfo:b,preferredTopics:en,healthTopics:[]})},[E]),d.createElement(eo.Provider,{value:{settings:O,submitHandler:A,type:e,surveyType:M,value:C,setValue:k,isMobile:r,isLoggedIn:E,isMarketing:n,hasPremiumBanner:i,currentUrl:o,acquisitionInfo:f,categoryIds:a,subcribeHealthStatus:s,articleId:t,onValueChange:u,state:y,setState:x,handleClickOption:e=>{let t=getMappingMultiValue(e);if(t){let a=A[t];a.action===c.ShowPremiumModal?i?(T(!0),x(Object.assign(Object.assign({},y),{actionParams:{hideBannerWhenClose:a.action===c.ShowPremiumModal}}))):(x({action:c.Hide}),null==u||u(e)):(x(a),null==u||u(e))}},showPNModal:P,setShowPNModal:T,source:m,Outside:L,isBack:I,setIsBack:B,minHeight:180,setShouldAcquisitionModalOpen:p}},void 0!==s?E?l&&O?(()=>{let e=A[(null==s?void 0:s.value)||""];return(null==e?void 0:e.action)===c.ShowPremiumModal?handleShowPNBannerFlowWhenLogin():d.createElement(SurveyBanner,null)})():handleShowPNBannerFlowWhenLogin():i?d.createElement(PnBannerEle,null):null:null)}},JfIY:function(e,t,a){a.d(t,{C:function(){return Checkbox},I:function(){return ImageWrapV2},P:function(){return Pagination},S:function(){return x},a:function(){return E},b:function(){return SearchInput},c:function(){return Search2}});var n=a("q1tI"),l=a("rBCA"),i=a("K2Xj"),o=a("iBNF"),r=a("6eqW"),s=a("4JTe"),c=a("xrdX"),d=a("ZKGu"),p=a("TH2c"),u=a("p5f+");let Search2=e=>n.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none"},e),n.createElement("path",{d:"M11 18.957C14.866 18.957 18 15.823 18 11.957C18 8.09104 14.866 4.95703 11 4.95703C7.13401 4.95703 4 8.09104 4 11.957C4 15.823 7.13401 18.957 11 18.957Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),n.createElement("path",{d:"M20 20.957L16 16.957",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),m=l.Z.div` display: flex; cursor: pointer; &[data-theme='marryBaby'] { input { width: 20px; height: 20px; border: 1.3px solid ${o.r.mbColors.midGray}; border-radius: 9px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${o.r.mbColors.cobalt}; box-shadow: 0 0 2px 2px ${o.r.mbColors.cobalt}; } &:focus-visible { border: 2px solid ${o.r.mbColors.cobalt}; } &:checked { border: 0; background: ${o.r.mbColors.cobalt} url("data:image/svg+xml,%3Csvg width='9' height='7' viewBox='0 0 9 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 4L3.45455 6L8 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat center center; } } label { max-width: 15rem; margin-left: 8px; width: calc(100% - 24px); cursor: inherit; font-weight: 600; font-size: 12px; line-height: 20px; letter-spacing: -0.2px; color: ${o.r.mbColors.gray}; } } input { width: 20px; height: 20px; border: solid 1px ${o.r.colors.gray500}; border-radius: 2px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${o.r.colors.primaryBase}; box-shadow: 0 0 2px 2px ${o.r.colors.primary200}; } &:focus-visible { border: 2px solid ${o.r.colors.primaryActive}; } &:checked { border: 0; background: ${o.r.colors.primaryBase} url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1L4.125 8L1 4.81819' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat center center; } } label { max-width: 15rem; margin-left: 8px; font-weight: ${o.r.sizes.fwRegular}; width: calc(100% - 24px); cursor: inherit; ${i.M.mbDown} { font-size: 14px; line-height: 24px; } ${i.M.mbUp} { font-size: 16px; line-height: 22px; } } &[data-is-rectangle] > input { position: relative; width: unset; height: unset; padding: 5px 12px; border: 1px solid ${o.r.colors.neutral100}; border-radius: 32px; &::after { color: ${o.r.colors.gray800}; content: attr(data-label-text); font-size: 13px; } &:checked { border-color: ${o.r.colors.primary50}; &::after { color: ${o.r.colors.primaryBase}; } } &:checked { background: ${o.r.colors.primary50}; } } &[data-disabled] { color: ${o.r.colors.gray300}; cursor: not-allowed; input { border-color: ${o.r.colors.gray300}; &:hover { border-color: ${o.r.colors.gray300}; box-shadow: none; } } } `,Checkbox=({label:e,name:t,checked:a,className:l,isDisabled:i,onChange:o,value:r,isRectangle:s,inputDataTestId:c,siteType:d})=>n.createElement(m,{className:l,"data-disabled":i||void 0,"data-is-rectangle":s||void 0,"data-label-text":e,"data-theme":d},n.createElement("input",{type:"checkbox",checked:a,name:t,onChange:()=>o(r,!a),disabled:i,value:r,id:`${t}-${r}`,"data-label-text":e,"data-testid":c}),!s&&n.createElement("label",{htmlFor:`${t}-${r}`},e)),h=l.Z.div` display: flex; align-items: center; justify-content: space-between; user-select: none; li { transition: all 0.3s ease; } [data-page-active] { background: ${o.r.colors.primaryBase}; color: ${o.r.colors.white}; > a { color: ${o.r.colors.white}; } } `,g=l.Z.div` display: flex; width: 32px; height: 32px; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid ${o.r.colors.gray200}; margin: 0 2px; border-radius: 4px; color: ${o.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${o.r.sizes.fwBold}; &[data-last-page] { border: none; background-color: ${o.r.colors.gray100}; cursor: not-allowed; pointer-events: none; svg { path { stroke: ${o.r.colors.gray300}; } } } `,v=l.Z.li` display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; margin: 0 2px; border-radius: 4px; color: ${o.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${o.r.sizes.fwBold}; > a { color: ${o.r.colors.gray800}; text-decoration: unset; display: block; width: 100%; height: 100%; line-height: 32px; text-align: center; } `,RenderPagiWithDots=({pagesAmount:e,activePage:t,handlePageChange:a,handleClick:l,href:o,queryPageName:r="page"})=>{let s=[...Array(e)].map((e,t)=>t+1),[c,d]=(0,n.useState)(t<=4?s.slice(0,5):t>=s.length-3?s.slice(s.length-5,s.length):s.slice(t-2,t+1));return(0,n.useEffect)(()=>{t<=4?d(s.slice(0,5)):t>=s.length-3?d(s.slice(s.length-5,s.length)):d(s.slice(t-2,t+1))},[t]),n.createElement(n.Fragment,null,t>4&&n.createElement(n.Fragment,null,n.createElement(v,{onClick:()=>a(1)},o?n.createElement("a",{href:o,onClick:l},1):1),n.createElement(v,null,"...")),c.map(e=>n.createElement(v,{key:`pagination+${e}`,"data-page-active":e===t||void 0,onClick:()=>a(e)},o?n.createElement("a",{href:(0,i.f)(o,e,r),onClick:l},e):e)),ta(s.length)},o?n.createElement("a",{href:(0,i.f)(o,s.length,r),onClick:l},s.length):s.length)))},Pagination=({className:e,pagesAmount:t,currentPage:a,onChange:l,onClick:o,style:r,href:s,queryPageName:c="page"})=>{let d=[...Array(t)].map((e,t)=>t+1),[p,u]=(0,n.useState)(a),m=(0,n.useMemo)(()=>s&&s.endsWith("&page=")?s.replace("&page=",""):s,[s]),b=t-1,handlePageChange=e=>{e<=t&&e>0&&(u(e),l(e))},handleClick=e=>{o&&o(e)};return(0,n.useEffect)(()=>{u(a)},[a]),n.createElement(h,{className:e,style:r},n.createElement(g,{className:"prev-page",onClick:()=>handlePageChange(p-1),"data-last-page":1===p||void 0},m?n.createElement("a",{href:(0,i.f)(m,p,c),onClick:handleClick},n.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},n.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):n.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},n.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),d.length>8?n.createElement(RenderPagiWithDots,{pagesAmount:t,activePage:p,handlePageChange:handlePageChange,handleClick:handleClick,href:m,queryPageName:c}):d.map(e=>n.createElement(v,{key:`pagination+${e}`,"data-page-active":e===p||void 0,onClick:()=>handlePageChange(e)},m?n.createElement("a",{href:(0,i.f)(m,e,c),onClick:handleClick},e):e)),n.createElement(g,{className:"next-page",onClick:()=>handlePageChange(p+1),"data-last-page":p===b+1||void 0},m?n.createElement("a",{href:(0,i.f)(m,p,c),onClick:handleClick},n.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},n.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):n.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},n.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))},b=l.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: ${o.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${o.r.colors.primary200}; } &: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}; ${i.M.mbDown} { font-size: 22px; line-height: 1.2; } ${i.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { input { font-weight: ${o.r.sizes.fwRegular}; ${i.M.mbDown} { font-size: 14px; line-height: 1.2; } ${i.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { input { font-weight: ${o.r.sizes.fwRegular}; ${i.M.mbDown} { font-size: 13px; line-height: 1.5; } ${i.M.mbUp} { font-size: 13px; line-height: 1.5; } } } `,E=n.forwardRef((e,t)=>{var{name:a,errorMessage:l,autoComplete:i="off",defaultValue:o,actionIcon:c,displayIcon:d,isDeleteAction:p,onActionClick:u,label:m,placeholder:h,className:g,onChange:v,onKeyPress:E,isDisabled:f,CustomInput:w,size:y,style:x,autoFocus:C,type:k="text",isNumerousKeyboard:S=!1,onFocus:P,enterKeyHint:T,nativeOnChange:I}=e,B=(0,r._)(e,["name","errorMessage","autoComplete","defaultValue","actionIcon","displayIcon","isDeleteAction","onActionClick","label","placeholder","className","onChange","onKeyPress","isDisabled","CustomInput","size","style","autoFocus","type","isNumerousKeyboard","onFocus","enterKeyHint","nativeOnChange"]);let[M,O]=(0,n.useState)(o),handleOnChange=e=>{O(e),v(e)};return n.createElement(b,{"data-size":y,className:g,"data-has-action-icon":!!c||void 0,"data-has-display-icon":!!d||void 0,"data-has-error":l&&l.length>0||void 0,style:x},m&&n.createElement(s.L,{size:"label2",htmlFor:a,className:"inputLabel"},m),n.createElement("div",{style:{position:"relative"}},w||n.createElement("input",Object.assign({id:a,name:a,placeholder:h,onChange:null!=I?I:e=>handleOnChange(e.target.value),onKeyPress:E,type:k,"aria-label":k,disabled:f,value:M,autoComplete:i,ref:t,autoFocus:C,inputMode:S||"number"===k?"numeric":k,pattern:S?"[0-9]*":".*",onFocus:P,enterKeyHint:T},B)),d&&n.createElement(s.S,{className:"displayIcon"},d),c&&n.createElement(s.a,{className:"actionIcon",onClick:()=>{var e;p&&(O(""),null===(e=t.current)||void 0===e||e.focus()),u&&u()}},c)),l&&l.length>0&&n.createElement(s.b,{className:"errorLabel"},l))});E.displayName="PureInput";let f=[320,420,640,750,828,1080,1200,1440,1920,2048],defaultLoader=({src:e,width:t,quality:a,locale:n})=>{try{let l="undefined"!=typeof window?window.location.origin:c.v[n]?`https://${c.v[n]}`:"";if(!l)return e;let i=new URL(e,l);return i.searchParams.set("w",String(t)),i.searchParams.set("q",String(null!=a?a:75)),i.toString()}catch(t){return e}},ImageWrapV2=e=>{var{alt:t,backupSrc:a,src:l,placeholderSrc:i,style:o,ref:s,unoptimized:c=!1,quality:p,sizes:u,width:m}=e,h=(0,r._)(e,["alt","backupSrc","src","placeholderSrc","style","ref","unoptimized","quality","sizes","width"]);let[g,v]=(0,n.useState)(!1),{locale:b="vi-VN"}=(0,d.u)(),E=(0,n.useMemo)(()=>c?[]:function(e){if(e.sizes)return f;if(e.width){let t=Math.max(1,Math.round(e.width));return Array.from(new Set([t,Math.min(2*t,2048)])).sort((e,t)=>e-t)}return f}({sizes:u,width:m}),[u,m,c]),y=(0,n.useMemo)(()=>{if(!c)return E.map(e=>`${defaultLoader({src:l,width:e,quality:p,locale:b})} ${e}w`).join(", ")},[c,E,l,p]),x=(0,n.useMemo)(()=>{if(c)return l;let e=E.length?E[E.length-1]:null!=m?m:1920;return defaultLoader({src:l,width:e,quality:p,locale:b})},[c,E,l,p,m]);return n.createElement(w,Object.assign({loading:"lazy",alt:t,srcSet:y,onError:()=>!g&&v(!0),src:g?a||x:x||a,style:Object.assign(Object.assign({},i?{backgroundImage:`url(${i})`}:{}),o),"data-has-placeholder":!!i,sizes:u,ref:s},h))},w=l.Z.img` &[data-has-placeholder='true'] { background-position: center; background-repeat: no-repeat; background-size: cover; } `,y=(0,l.Z)(p.I)` box-shadow: 0px 0px 1px 0px #0000000a, 0px 2px 8px 0px #0000000a, 0px 10px 16px 0px #0000000a; border-radius: 0.75rem; overflow: hidden; input.mantine-Input-input { border: none; font-size: 0.8125rem; line-height: 1.25rem; } .close-icon-wrapper { display: none; background-color: ${o.r.colors.gray400}; border-radius: 100%; cursor: pointer; width: 20px; height: 20px; padding: 2px; svg { pointer-events: none; } &[data-is-disabled='true'] { opacity: 0.2; cursor: not-allowed; pointer-events: none; } } input.mantine-Input-input:focus ~ .mantine-Input-rightSection .close-icon-wrapper, input.mantine-Input-input:not(:placeholder-shown) ~ .mantine-Input-rightSection .close-icon-wrapper { display: flex; } `,x=(0,l.Z)(Search2)` color: ${o.r.colors.primaryBase}; width: 20px; height: 20px; `,SearchInput=e=>{let{loading:t,disabled:a,placeholder:l,value:i,onChange:o,icon:s=n.createElement(x,null),className:c,style:d,enableClear:p}=e,m=(0,r._)(e,["loading","disabled","placeholder","value","onChange","icon","className","style","enableClear"]);return n.createElement(y,Object.assign({disabled:t||a,size:"lg",value:i,onChangeRaw:e=>{o(e.currentTarget.value)},type:"text",placeholder:l,className:c,icon:s,style:d,rightSection:p?n.createElement("div",{className:"close-icon-wrapper",onClick:()=>{o("")},"data-is-disabled":!i},n.createElement(u.C,{fill:"white",width:"100%",height:"100%"})):void 0},m,{"data-event-label":i}))}},Oakx:function(e,t,a){a.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var n=a("6eqW"),l=a("q1tI"),i=a("Jn/A"),o=a("OGdO"),r=a("ZKGu"),s=a("ns0B"),c=a.n(s),d=a("VYyz"),p=a("i2MM"),u=a("5+xW"),m=a("aZjv"),h=a("4fTT"),g=a("vJ0r"),v=a("rBCA"),b=a("K2Xj"),E=a("iBNF"),f=a("OQNV"),w=a("IQVP"),y=a("RDA3"),x=a("cphq"),C=a("sx9v"),k=a("8Jy2"),S=a("KyIs"),P=a("NvkK"),T=a("vWP/"),I=a("VLUI"),B=a("h84G"),M=a("MZpI"),O=a("QaGV"),A=a("bpvy"),R=a("4JTe"),L=a("ZQ3V"),N=a("WpsW"),j=a("XKpd"),_=a("xrdX"),H="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",D="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",z="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.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:a,post:i,className:o="",popoverClassName:s="",onEditPost:c})=>{let{data:{locale:v,userInfo:b,env:{isMarryBaby:E}}}=(0,l.useContext)(h.T),{t:f}=(0,r.u)(),[w,y]=(0,l.useState)(!1),[x,C]=(0,l.useState)(!1),[k,S]=(0,l.useState)(!1),{authActionWrapper:P}=(0,m.iV)(),T=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return l.createElement("div",{className:o,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&l.createElement(d.S,{url:a,text:null==i?void 0:i.title,onClose:()=>S(!1)}),x&&l.createElement(d.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:f("popup.deletePost.title"),description:f("popup.deletePost.description"),acceptText:f("popup.deletePost.accept"),cancelText:f("popup.deletePost.cancel"),onAccept:()=>(0,n.a)(void 0,void 0,void 0,function*(){if((null==i?void 0:i.id)&&!w){y(!0);try{let e=yield(0,d.h)({id:i.id,locale:v});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}y(!1)}}),onClose:()=>C(!1)}),l.createElement(g.b,{className:s,toggleButtonContent:l.createElement("img",{src:E?H:D,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:w},data:T?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:f("actionPopover.edit"),onClick:c},{icon:z,label:f("actionPopover.delete"),onClick:()=>{P(()=>C(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:d.i,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(u.R).map(e=>({label:u.R[e].label,reason:u.R[e].reportReasonText,reasonValue:e})).map(e=>({label:f(e.label),subTree:{title:f("morePopover.reportSubmit.title"),description:f("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>l.createElement(d.b,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==i?void 0:i.id,onClose:()=>t&&t(!1)})}}))}}]}}))},F=v.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${E.r.borderRadius}; a { text-decoration: none; } ${b.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${E.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${b.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${b.M.mbDown} { margin-bottom: 12px; } } `;var $="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:a="",popoverClassName:i=""})=>{let{data:{env:{isMarryBaby:o},locale:s},action:{pushNotifications:c}}=(0,l.useContext)(h.T),{t:p}=(0,r.u)(),[u,v]=(0,l.useState)(!1),{authActionWrapper:b}=(0,m.iV)();return l.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},u&&l.createElement(d.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,n.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let n=yield(0,d.j)({id:t,locale:s});(null==n?void 0:n.status)===1?(e&&e(),c({title:"",message:p("notification.success"),type:"success"})):c({title:"",message:(null===(a=null==n?void 0:n.messages)||void 0===a?void 0:a[0])||p("notification.failure"),type:"danger"})}),onClose:()=>v(!1)}),l.createElement(g.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:z,label:p("actionPopover.delete"),onClick:()=>{b(()=>{v(!0)})}}]},className:i,toggleButtonContent:l.createElement("img",{src:o?H:D,loading:"lazy"}),buttonProps:{}}))},V=v.Z.div` .add-link { color: ${E.r.colors.primaryBase}; } `,W=v.Z.div` margin: 16px 0; background: ${E.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,Z=v.Z.div` display: flex; align-items: center; gap: 8px; `,G=v.Z.div` padding: 8px 16px; `,U=v.Z.div` margin-bottom: 12px; width: 100%; `,q=v.Z.div``,Y=v.Z.div` margin-bottom: 16px; `,K=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,Q=v.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=v.Z.div` display: flex; align-items: center; gap: 16px; `,J=v.Z.div` border-radius: ${E.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,r.u)(),{data:{locale:a,env:{isMarryBaby:n}}}=(0,l.useContext)(h.T),i=(0,j.g)(a,n);return l.createElement(q,null,l.createElement(Y,null,l.createElement(o.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),l.createElement(K,null,e.map(e=>l.createElement(Q,{href:i+e.permalink,key:String(e.termId),target:"_blank"},l.createElement(X,null,l.createElement(J,null,l.createElement("img",{src:e.featureImage||p.C.getAssetPath(n?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),l.createElement(L.T,{size:"s3",weight:"bold"},e.displayName)),l.createElement(I.Z,{size:20,color:E.r.colors.gray400})))))},ee=v.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${E.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:n})=>{let{t:i}=(0,r.u)(),o=(()=>{let{expert:e,editor:a,is_author:n}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return n?Object.assign({title:i("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:i("articleAuthor.title.expert")},t):Object.assign({title:i("articleAuthor.title.medical")},t)}if(a)return{title:i("articleAuthor.title.fact-check"),name:a.display_name,avatar:a.avatar}})();return l.createElement(ee,{href:n,title:e,target:"_blank"},l.createElement(L.T,{size:"s3",as:"h5",weight:"bold"},e),l.createElement("div",null,l.createElement(x.C,{avatar:null==o?void 0:o.avatar,avatarProps:{size:32},name:null==o?void 0:o.name,role:null==o?void 0:o.role,hideBackground:!0},l.createElement(x.C.SubTextRow,null,l.createElement(x.C.SubText,null,null==o?void 0:o.title," ",l.createElement("span",{style:{color:E.r.colors.gray800}},null==o?void 0:o.name)),l.createElement(x.C.SubDivider,null),l.createElement(x.C.SubText,null,a)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:a,categorySlug:s,editMode:c,collapseSource:d,onListChange:u,isMarryBaby:m}=e,g=(0,n._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:v}=(0,r.u)(),[b,y]=(0,l.useState)(t||[]),[x,C]=(0,l.useState)([]),[k,S]=(0,l.useState)([]),[P,I]=(0,l.useState)(!1);(0,l.useEffect)(()=>{a||(0,n.a)(void 0,void 0,void 0,function*(){I(!0);let e=b.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),n=t.origin,l=-1!==n.search("marrybaby.vn");return{isMarrySite:l,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,h.c)(e.isMarrySite?(0,h.s)(w.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,h.g)(w.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);C(a.map((t,a)=>{var n,l;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)&&Object.assign(Object.assign({},(0,f.b)(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.post)),{href:e[a].href})}).filter(Boolean)),I(!1)})},[]),(0,l.useEffect)(()=>{!a&&(null==x?void 0:x.length)===0&&s&&(0,n.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,h.c)(m?(0,h.s)(w.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,h.g)(w.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,f.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[x]);let handleRemoveItem=e=>{y(t=>{let a=[...t];return a.splice(e,1),a}),C(t=>{let a=[...t];return a.splice(e,1),a})};return(0,l.useEffect)(()=>{null==u||u(b)},[b]),l.createElement("div",Object.assign({},g),!c&&l.createElement(W,null,l.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),l.createElement(L.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:v("cardReply.disclaimer")}})),a?null:P?l.createElement(N.L,null):x.length>0||c?l.createElement(V,null,l.createElement(A.U,{defaultValue:!d&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${E.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${E.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:l.createElement("div",{className:et.chevron},l.createElement(B.Z,{color:E.r.colors.gray600,size:20}))},l.createElement(A.U.Item,{value:"accordion"},l.createElement(A.U.Control,null,l.createElement("div",{className:et.header},l.createElement(o.H,{as:"h4",tag:"h6"},v("cardReply.source")))),l.createElement(A.U.Panel,null,l.createElement(G,null,(x||[]).map((e,t)=>l.createElement(Z,{key:String(t)},"object"==typeof e?l.createElement(SourceItem,Object.assign({},e)):l.createElement(U,null,l.createElement(R.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{y(a=>{let n=[...a];return n[t]=e,n}),C(a=>{let n=[...a];return n[t]=e,n})}})),c&&l.createElement(i.B,{size:"md",color:"transparent",icon:l.createElement(M.Z,null),onClick:()=>handleRemoveItem(t)}))),c&&l.createElement(i.B,{className:"add-link",color:"transparent",size:"md",icon:l.createElement(T.Z,{color:E.r.colors.primaryBase,size:18}),onClick:()=>{y(e=>[...e,""]),C(e=>[...e,""])}},"Add source")))))):l.createElement(RecommentCategories,{categories:k}))},ea=v.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${E.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${E.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,en=(0,v.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:n,title:o,className:s})=>{let{t:c}=(0,r.u)(),[d,p]=(0,l.useState)(!1);return l.createElement(l.Fragment,null,l.createElement(i.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},l.createElement("span",{className:"text"},l.createElement(O.Z,{isSolid:!0,size:18,color:E.r.colors.green800,className:"icon"}),c("cardReply.verifyBy",{name:`${a||""}`}))),l.createElement(x.c,{open:d,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},l.createElement(C.a,{authorProps:{userId:e,avatar:t,name:a,role:n,title:o},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:o="comment",level:s=0,replyingId:c,onPostCommentSuccess:p,post:u,onDeleteComment:v,refetchComment:b,hasQuickBookingEnable:E,handleMakeAppointment:f,cardAuthorProps:S,maxChars:T=600,disableShortenContent:I})=>{var B,M,O,A,R,L,N,j,H,D,z,F,$;let{data:{locale:V,userInfo:W,env:{isMarryBaby:Z}}}=(0,l.useContext)(h.T),{t:G}=(0,r.u)(),[U,q]=(0,l.useState)(a||null),{id:Y,countLikes:K,content:Q,replies:X=[],images:J=[],author:ee,liked:et,link:el,mentionedUser:ei,mentions:eo}=U,{text:er,replyingTo:es}=(0,d.k)(Q),{authActionWrapper:ec}=(0,m.iV)({_joinCommunityIds:[null===(B=null==u?void 0:u.community)||void 0===B?void 0:B.id],_joinTopicIds:null===(M=null==u?void 0:u.topics)||void 0===M?void 0:M.map(e=>e.id)}),[ed,ep]=(0,l.useState)(4),eu=null!=W&&!!W.id&&(null==X?void 0:X.some(e=>e.author.id===W.id)),addNewReply=e=>{q(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(a),a}return t})},[em,eh]=(0,l.useState)(!1),eg=(0,l.useMemo)(()=>"comment"===o&&X&&0!=X.length?X.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),n=new Date(t.createdAt).getTime();return a>n?-1:a{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,n.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,h.c)((0,h.b)(w.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:_.v[V]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ek(null==a?void 0:a._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,n.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,h.c)((0,h.b)(w.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:_.v[V]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eP(null==a?void 0:a._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eT=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),eI=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0,eB=E&&(eT||eI),eM=(null===(A=null==U?void 0:U.author)||void 0===A?void 0:A.type)==="chatbot";return l.createElement(m.I_,{defaultParams:{_joinCommunityIds:[null===(R=null==u?void 0:u.community)||void 0===R?void 0:R.id],_joinTopicIds:null===(L=null==u?void 0:u.topics)||void 0===L?void 0:L.map(e=>e.id)}},l.createElement(ea,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":Z,"data-has-booking":eB},"reply"===o&&l.createElement(P.D,{className:"top-divider",type:"solid"}),l.createElement("div",{style:{padding:"16px 16px 0"}},l.createElement(x.C,Object.assign({avatar:ew,name:eE,username:ef,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:`post-author ${eb?"with-popover":""}`,type:o,userId:null==ee?void 0:ee.id,role:ey,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eB,handleMakeAppointment:f,isAnonymous:(null==U?void 0:U.isAnonymous)||!!(null==u?void 0:u.isAnonymous)&&(null===(N=null==u?void 0:u.author)||void 0===N?void 0:N.username)===(null==ee?void 0:ee.username),hideBackground:eM,userType:null==ee?void 0:ee.type},S)),!!(null==U?void 0:U.isVerify)&&!(null==U?void 0:U.isOppose)&&l.createElement(VerifiedTag,{title:null===(j=null==U?void 0:U.userVerify)||void 0===j?void 0:j.title,name:null===(H=null==U?void 0:U.userVerify)||void 0===H?void 0:H.name,userId:null===(D=null==U?void 0:U.userVerify)||void 0===D?void 0:D.id,role:null===(z=null==U?void 0:U.userVerify)||void 0===z?void 0:z.role,avatar:null===(F=null==U?void 0:U.userVerify)||void 0===F?void 0:F.avatar,className:"verify-tag"})),l.createElement(C.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:ei,description:er,mentions:ex,maxChars:T,disableShortenContent:I}),l.createElement("span",null),l.createElement("span",null),J&&J.length>0?l.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},l.createElement(k.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&el?l.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},l.createElement(y.C,{url:el})):null,"most-engaging"!==o?l.createElement(l.Fragment,null,eM&&l.createElement(en,{listUrl:null==U?void 0:U.source,categorySlug:null==U?void 0:U.categorySlug}),l.createElement(g.C,{type:g.c.reply,loveCount:K,replyCount:ev,className:"post-reaction",liked:et,isReplied:eu,hideCommentIcon:"reply"===o||eM,hasShare:!1,onCommentClick:()=>ec(()=>eh(e=>!e)),onCommentCountClick:()=>ec(()=>{eh(!0)}),onLikeClick:()=>ec(()=>(0,n.a)(void 0,void 0,void 0,function*(){if(Y){let e=yield(0,d.l)({commentId:Y,setLike:!et,locale:V});1===e.status&&q(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),em&&l.createElement(d.I,{replyingId:c||U.id,replyToName:eE,isReply:!0,onClose:()=>eh(!1),onPostSuccess:e=>{"reply"===o?p&&p(e):addNewReply(e)},post:u,replyingUser:ee}),"comment"===o&&X&&X.length>0?l.createElement("div",{className:"comment-reply-wrapper"},null===($=null==eg?void 0:eg.slice(0,ed))||void 0===$?void 0:$.map(e=>l.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:Y,onPostCommentSuccess:addNewReply,post:u,onDeleteComment:()=>{q(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:f,hasQuickBookingEnable:E})),ev>ed&&l.createElement(l.Fragment,null,l.createElement(P.D,{className:"top-divider",type:"solid"}),l.createElement(i.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},G("comment.seeMoreReplies",{count:ev-ed}),l.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eb&&l.createElement(CardReplyPopover,{onDeleteComment:v,className:"popover",commentId:U.id})))},getMostEngagingComment=(e,t)=>(0,n.a)(void 0,void 0,void 0,function*(){var a,n,l;let i=yield(0,h.t)((0,h.f)(w.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(l=null===(n=null===(a=null==i?void 0:i.data)||void 0===a?void 0:a.comments)||void 0===n?void 0:n.map(f.g))||void 0===l?void 0:l[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:s,onCommentClick:p,onCommentCountClick:v,onMostEngagingCommentClick:b,onPostCommentSuccess:E,disableCardLink:f,disableShortenContent:P,onDeletePost:T,onEditPost:I,post:B,mostEngagingComment:M,onDeleteComment:O,showInputComment:A,InlineCommentsComponent:R,hasQuickBookingEnable:L,handleMakeAppointment:N,onSaveUnsaveSuccess:j,cardAuthorProps:_,verticalReactions:H=!1})=>{let[D,z]=(0,l.useState)(B),[V,W]=(0,l.useState)(!1),[Z,G]=(0,l.useState)(M),{community:U,topics:q,author:Y,slug:K,isPin:Q,liked:X,photos:J,mentions:ee,title:et,description:ea,previewUrl:en,likesCount:el,commentsCount:ei,id:eo,commented:er}=D,{data:{locale:es,togetherUserId:ec,userInfo:ed,env:{isMarryBaby:ep,togetherBasePath:eu}},action:{pushNotifications:em}}=(0,l.useContext)(h.T),eh=!!(null==ed?void 0:ed.id),{t:eg}=(0,r.u)(),[ev,eb]=(0,l.useState)(A),eE=`${eu}/${(null==U?void 0:U.slug)||"_"}/${K||""}`,ef=`${(0,h.l)(es)}${eE}`,{authActionWrapper:ew}=(0,m.iV)((null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0),[ey,ex]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eb(A)},[A]);let eC=(null==Y?void 0:Y.name)||(null==Y?void 0:Y.username)||"",ek=(null==Y?void 0:Y.username)||(null==Y?void 0:Y.name)||"",eS=null==Y?void 0:Y.avatar,eP=(null==D?void 0:D.isAnonymous)?void 0:null==Y?void 0:Y.role,[eT,eI]=(0,l.useState)(null),[eB,eM]=(0,l.useState)(null);(0,l.useEffect)(()=>{var e,t;(null==Y?void 0:Y.hospitalId)&&(e=Y.hospitalId,(0,n.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,h.c)((0,h.b)(w.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:h.m[es]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&eI(null==a?void 0:a._data.branch)})),(null==Y?void 0:Y.doctorId)&&(t=Y.doctorId,(0,n.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,h.c)((0,h.b)(w.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:h.m[es]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eM(null==a?void 0:a._data.doctor)}))},[Y.hospitalId,Y.doctorId]);let eO=(null==eB?void 0:eB.valid_outpatient)||(null==eB?void 0:eB.valid_telemedicine),eA=((null==eT?void 0:eT.total_available_service)||(null==eT?void 0:eT.total_available_doctor))>0;(0,l.useEffect)(()=>{(0,n.a)(void 0,void 0,void 0,function*(){if(eo&&ei&&s&&!(null==M?void 0:M.id)){let e=yield getMostEngagingComment(eo,es);G(e)}})},[eo,es,ei,s,null==M?void 0:M.id]),(0,l.useEffect)(()=>{G(M)},[null==M?void 0:M.id]);let onDeleteComment=e=>(0,n.a)(void 0,void 0,void 0,function*(){if(ei>1&&(null==Z?void 0:Z.id)&&(null==Z?void 0:Z.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(eo,es);G(e)}z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),O&&O(e)});return l.createElement(m.I_,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0},V&&l.createElement(d.S,{url:ef,avatar:u.a,text:et,onClose:()=>W(!1)}),l.createElement(F,{className:e,style:t,"data-is-marrybaby":ep},Q?l.createElement(g.a,{className:"post-pin"}):null,l.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},l.createElement(x.C,Object.assign({avatar:eS,name:eC,username:ek,url:f?void 0:eE,community:U,timeText:null==D?void 0:D.createdTime,className:"post-author",role:eP,userId:null==Y?void 0:Y.id,expertId:null==Y?void 0:Y.partnerId,doctorId:null==Y?void 0:Y.doctorId,hospitalId:null==Y?void 0:Y.hospitalId,title:null==Y?void 0:Y.title,hasQuickBooking:L&&(eO||eA),handleMakeAppointment:N,"data-testid":"name",isAnonymous:!!(null==D?void 0:D.isAnonymous),extendEle:l.createElement(CardPostPopoverMore,{authorEmail:String(null==Y?void 0:Y.email),onDeletePost:T,shareUrl:ef,post:D,className:"popover",onEditPost:I})},_))),l.createElement("a",{href:f?void 0:eE,className:"post-content-link-wrapper"},et&&l.createElement(o.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},c()(et)),l.createElement(C.P,{className:"post-content-wrapper",description:ea,disableShortenContent:P,mentions:ee,"data-testid":"Content of the Post"})),l.createElement("span",null),l.createElement("span",null),l.createElement("div",{key:"tag-topic"},q&&q.length>0?l.createElement(g.T,{topics:q,className:"post-topics"}):null),l.createElement("div",{key:"social-preview"},(null==D?void 0:D.introUrl)?l.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},l.createElement(S.S,{url:D.introUrl,image:D.bannerImage})):null),l.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?l.createElement("div",{className:"image-preview-wrapper"},l.createElement(k.a,{images:J,authorName:null==Y?void 0:Y.name,isSensitive:!!(null==D?void 0:D.isSensitive)})):null),l.createElement("div",{key:"link-preview"},(null==D?void 0:D.introUrl)||(null==J?void 0:J.length)||null==en||!en.url?null:l.createElement("div",{className:"link-preview-wrapper"},l.createElement(y.C,{title:en.title,url:en.url,image:en.image}))),l.createElement(g.C,{isMarryBaby:ep,type:g.c.post,loveCount:el,replyCount:ei,className:`post-reaction ${(null==J?void 0:J.length)||(null==en?void 0:en.url)?"hide-top-border":""}`,liked:ey?!X:X,isReplied:er,isSaved:(null==D?void 0:D.bookmarked)||!1,onCommentClick:()=>ew(()=>{p?p():eb(e=>!e)}),onCommentCountClick:()=>{ew(()=>{ep?eb(!0):v?v():f||(window.location.href=eE)})},onShareClick:()=>{W(!0)},onLikeClick:()=>(0,n.a)(void 0,void 0,void 0,function*(){ew(()=>(0,n.a)(void 0,void 0,void 0,function*(){if(eo&&!ey){ex(!0);try{let e=yield(0,d.m)({id:eo,locale:es});(null==e?void 0:e.status)!==1?em((0,d.g)(eg)):z(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){em((0,d.g)(eg))}ex(!1)}}))}),onSaveClick:()=>{ew(()=>(0,n.a)(void 0,void 0,void 0,function*(){if((null==ed?void 0:ed.id)&&(null==D?void 0:D.id)){if(null==D?void 0:D.bookmarked){let e=yield(0,h.e)((0,h.f)(w.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(D.id)}});(null==e?void 0:e.status)===1?(em({title:"",message:eg("post.remove.success"),type:"success",displayIcon:$}),null==j||j()):em({title:"",message:eg("post.remove.failed"),type:"danger",displayIcon:$})}else{let e=yield(0,h.e)((0,h.f)(w.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ec||ed.id,post_id:D.id}});(null==e?void 0:e.status)===1?(em({title:"",message:eg("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==j||j()):em({title:"",message:eg("post.save.failed"),type:"danger",displayIcon:$})}}}))},onGoToUrl:e=>{let t=e?`${ef}${e}`:ef;eh?window.location.href=t:ew(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==Z?void 0:Z.id)),isVertical:H}),ev&&l.createElement(d.I,{isMainCmt:!A,onClose:()=>eb(!1),onPostSuccess:e=>{0!==ei||(null==Z?void 0:Z.id)||G(e),z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),E&&E(e)},post:D}),s&&(null==Z?void 0:Z.id)?l.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=eE}},l.createElement(CardReply,{hasQuickBookingEnable:L,handleMakeAppointment:N,comment:Z,post:D,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(Z)},className:"most-engaging-comment",type:"most-engaging",key:Z.id,cardAuthorProps:_}),ei>1&&!a&&l.createElement(i.B,{className:"see-more-comments",color:"ghost",size:"md"},eg("comment.seeMoreComments",{count:ei-1}))):null,R))}},LeBD:function(e,t,a){a.d(t,{C:function(){return i},F:function(){return o},G:function(){return GlobalTextStyleNew},T:function(){return TemplateProvider},a:function(){return c},u:function(){return useTemplateVariant}});var n,l,i,o,r=a("mYVa"),s=a("q1tI");(n=i||(i={})).LEADGEN="leadgen",n.NONE="none",(l=o||(o={}))[l.regular=400]="regular",l[l.halfBold=500]="halfBold",l[l.semiBold=600]="semiBold",l[l.bold=700]="bold";let c={[i.NONE]:{fontSize:{base:[(0,r.h)(16),(0,r.h)(16)],lg:[(0,r.h)(18),(0,r.h)(16)],md:[(0,r.h)(18),(0,r.h)(16)],sm:[(0,r.h)(16),(0,r.h)(14)],xs:[(0,r.h)(14),(0,r.h)(12)],s1:[(0,r.h)(22),(0,r.h)(18)],s2:[(0,r.h)(18),(0,r.h)(16)],s3:[(0,r.h)(16),(0,r.h)(14)],s4:[(0,r.h)(14),(0,r.h)(12)],s5:[(0,r.h)(12),(0,r.h)(12)],p1:[(0,r.h)(18),(0,r.h)(16)],p2:[(0,r.h)(16),(0,r.h)(16)],p3:[(0,r.h)(16),(0,r.h)(14)],p4:[(0,r.h)(14),(0,r.h)(12)],p5:[(0,r.h)(12),(0,r.h)(12)],c1:[(0,r.h)(16),(0,r.h)(14)],c2:[(0,r.h)(14),(0,r.h)(12)],n1:[(0,r.h)(12),(0,r.h)(12)],label1:[(0,r.h)(14),(0,r.h)(14)],label2:[(0,r.h)(12),(0,r.h)(12)],h1:[(0,r.h)(40),(0,r.h)(26)],h2:[(0,r.h)(32),(0,r.h)(24)],h3:[(0,r.h)(26),(0,r.h)(20)],h4:[(0,r.h)(22),(0,r.h)(18)],h5:[(0,r.h)(18),(0,r.h)(16)],h5New:[(0,r.h)(20),(0,r.h)(18)],h6:[(0,r.h)(16),(0,r.h)(14)],title1:[(0,r.h)(17),(0,r.h)(17)],title2:[(0,r.h)(15),(0,r.h)(15)],body2:[(0,r.h)(15),(0,r.h)(15)]},lineHeight:{base:[(0,r.h)(24),(0,r.h)(24)],lg:[(0,r.h)(32),(0,r.h)(28)],md:[(0,r.h)(32),(0,r.h)(28)],sm:[(0,r.h)(24),(0,r.h)(22)],xs:[(0,r.h)(24),(0,r.h)(18)],s1:[(0,r.h)(32),(0,r.h)(26)],s2:[(0,r.h)(28),(0,r.h)(24)],s3:[(0,r.h)(24),(0,r.h)(24)],s4:[(0,r.h)(22),(0,r.h)(18)],s5:[(0,r.h)(18),(0,r.h)(18)],p1:[(0,r.h)(28),(0,r.h)(28)],p2:[(0,r.h)(24),(0,r.h)(24)],p3:[(0,r.h)(24),(0,r.h)(22)],p4:[(0,r.h)(22),(0,r.h)(18)],c1:[(0,r.h)(24),(0,r.h)(22)],c2:[(0,r.h)(22),(0,r.h)(18)],n1:[(0,r.h)(18),(0,r.h)(18)],label1:[(0,r.h)(22),(0,r.h)(22)],label2:[(0,r.h)(18),(0,r.h)(18)],h1:[(0,r.h)(52),(0,r.h)(34)],h2:[(0,r.h)(42),(0,r.h)(32)],h3:[(0,r.h)(36),(0,r.h)(26)],h4:[(0,r.h)(32),(0,r.h)(26)],h5:[(0,r.h)(28),(0,r.h)(24)],h5New:[(0,r.h)(28),(0,r.h)(24)],h6:[(0,r.h)(24),(0,r.h)(22)],title1:[(0,r.h)(24),(0,r.h)(24)],title2:[(0,r.h)(24),(0,r.h)(24)],body2:[(0,r.h)(24),(0,r.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],h5New:[-.4,-.4],h6:[0,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.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,h5New:o.semiBold,h6:o.bold},fontWeight:o},[i.LEADGEN]:{fontSize:{base:[(0,r.h)(16),(0,r.h)(16)],lg:[(0,r.h)(18),(0,r.h)(16)],md:[(0,r.h)(18),(0,r.h)(16)],sm:[(0,r.h)(16),(0,r.h)(14)],xs:[(0,r.h)(14),(0,r.h)(12)],s1:[(0,r.h)(22),(0,r.h)(18)],s2:[(0,r.h)(18),(0,r.h)(16)],s3:[(0,r.h)(16),(0,r.h)(14)],s4:[(0,r.h)(14),(0,r.h)(12)],s5:[(0,r.h)(12),(0,r.h)(12)],p1:[(0,r.h)(17),(0,r.h)(17)],p2:[(0,r.h)(15),(0,r.h)(15)],p3:[(0,r.h)(13),(0,r.h)(13)],p4:[(0,r.h)(14),(0,r.h)(12)],p5:[(0,r.h)(12),(0,r.h)(12)],c1:[(0,r.h)(12),(0,r.h)(12)],c2:[(0,r.h)(11),(0,r.h)(11)],n1:[(0,r.h)(12),(0,r.h)(12)],label1:[(0,r.h)(14),(0,r.h)(14)],label2:[(0,r.h)(12),(0,r.h)(12)],h1:[(0,r.h)(40),(0,r.h)(26)],h2:[(0,r.h)(32),(0,r.h)(24)],h3:[(0,r.h)(26),(0,r.h)(22)],h4:[(0,r.h)(22),(0,r.h)(20)],h5:[(0,r.h)(18),(0,r.h)(16)],h5New:[(0,r.h)(20),(0,r.h)(18)],h6:[(0,r.h)(16),(0,r.h)(14)],title1:[(0,r.h)(17),(0,r.h)(17)],title2:[(0,r.h)(15),(0,r.h)(15)],body2:[(0,r.h)(15),(0,r.h)(15)],overline:[(0,r.h)(11),(0,r.h)(11)],subText:[(0,r.h)(10),(0,r.h)(10)]},lineHeight:{base:[(0,r.h)(24),(0,r.h)(24)],lg:[(0,r.h)(32),(0,r.h)(28)],md:[(0,r.h)(32),(0,r.h)(28)],sm:[(0,r.h)(24),(0,r.h)(22)],xs:[(0,r.h)(24),(0,r.h)(18)],s1:[(0,r.h)(32),(0,r.h)(26)],s2:[(0,r.h)(28),(0,r.h)(24)],s3:[(0,r.h)(24),(0,r.h)(24)],s4:[(0,r.h)(22),(0,r.h)(18)],s5:[(0,r.h)(18),(0,r.h)(18)],p1:[(0,r.h)(28),(0,r.h)(28)],p2:[(0,r.h)(24),(0,r.h)(24)],p3:[(0,r.h)(20),(0,r.h)(20)],p4:[(0,r.h)(22),(0,r.h)(18)],c1:[(0,r.h)(16),(0,r.h)(16)],c2:[(0,r.h)(22),(0,r.h)(18)],n1:[(0,r.h)(18),(0,r.h)(18)],label1:[(0,r.h)(22),(0,r.h)(22)],label2:[(0,r.h)(18),(0,r.h)(18)],h1:[(0,r.h)(48),(0,r.h)(34)],h2:[(0,r.h)(40),(0,r.h)(32)],h3:[(0,r.h)(32),(0,r.h)(32)],h4:[(0,r.h)(32),(0,r.h)(28)],h5:[(0,r.h)(28),(0,r.h)(24)],h5New:[(0,r.h)(28),(0,r.h)(24)],h6:[(0,r.h)(24),(0,r.h)(22)],title1:[(0,r.h)(24),(0,r.h)(24)],title2:[(0,r.h)(24),(0,r.h)(24)],body2:[(0,r.h)(24),(0,r.h)(24)],overline:[(0,r.h)(12),(0,r.h)(12)],subText:[(0,r.h)(12),(0,r.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],h5New:[-.4,-.4],h6:[0,-.2],n1:[-.2,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.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,h5New:o.semiBold,h6:o.bold},fontWeight:o}},GlobalTextStyleNew=e=>({[i.LEADGEN]:{h1:{fontSize:(0,r.h)(40),lineHeight:(0,r.h)(48),letterSpacing:"-1.2px",[e.fn.smallerThan("sm")]:{fontSize:(0,r.h)(26),lineHeight:(0,r.h)(32),letterSpacing:"-0.6px"}},h2:{fontSize:(0,r.h)(32),lineHeight:(0,r.h)(40),letterSpacing:"-1px",[e.fn.smallerThan("sm")]:{fontSize:(0,r.h)(20),lineHeight:(0,r.h)(28),letterSpacing:"-0.4px"}},h3:{fontSize:(0,r.h)(26),lineHeight:(0,r.h)(32),letterSpacing:"-0.6px",[e.fn.smallerThan("sm")]:{fontSize:(0,r.h)(20),lineHeight:(0,r.h)(28),letterSpacing:"-0.4px"}},p1:{fontSize:(0,r.h)(17),lineHeight:(0,r.h)(28),letterSpacing:"-0.4px"},p2:{fontSize:(0,r.h)(15),lineHeight:(0,r.h)(24),letterSpacing:"-0.3px"}}}),d=(0,s.createContext)(i.NONE),TemplateProvider=({variant:e=i.NONE,children:t})=>s.createElement(d.Provider,{value:e},t),useTemplateVariant=()=>(0,s.useContext)(d)},"02Su":function(e,t,a){a.d(t,{i:function(){return isVideo}});let isVideo=e=>e.endsWith(".mp4")},yveB:function(e,t,a){a.d(t,{O:function(){return OvulationForm}});var n,l,i=a("6eqW"),o=a("q1tI"),r=a("/npG"),s=a("mYVa"),c=a("iuhU"),d=a("8vDj"),p=a("cChf"),u=a("ZFu2"),m=a("mhs0"),h=a("TH2c"),g=a("7mOA"),v=a("ZQ3V"),b=a("ZKGu"),E=a("yjyv"),f=a("Xlwb"),w=a("fkrl");let AvoidPregnancy=e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return t?o.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),o.createElement("path",{d:"M16.5 27.133c1.298 0 2.596-.149 3.868-.447a9.15 9.15 0 0 0 6.818-6.818 16.94 16.94 0 0 0 0-7.736 9.15 9.15 0 0 0-6.818-6.818 16.94 16.94 0 0 0-7.736 0 9.15 9.15 0 0 0-6.818 6.818A17 17 0 0 0 5.367 16a.867.867 0 0 1-1.734 0c0-1.43.165-2.862.494-4.264a10.88 10.88 0 0 1 8.109-8.11 18.7 18.7 0 0 1 8.528 0 10.88 10.88 0 0 1 8.11 8.11 18.7 18.7 0 0 1 0 8.528 10.88 10.88 0 0 1-8.11 8.11 18.7 18.7 0 0 1-4.264.493.867.867 0 0 1 0-1.734",fill:"#3E3F58"}),o.createElement("path",{d:"M12.5 16a4 4 0 1 1 8 0 4 4 0 0 1-8 0",fill:"#fff"}),o.createElement("path",{d:"M11.633 16a4.867 4.867 0 1 1 9.734 0 4.867 4.867 0 0 1-9.734 0m4.867-3.133a3.133 3.133 0 1 0 0 6.266 3.133 3.133 0 0 0 0-6.266m-4 9.8a2.667 2.667 0 1 1-5.333 0 2.667 2.667 0 0 1 5.333 0",fill:"#3E3F58"}),o.createElement("path",{d:"M10.305 22.195c.26.26.26.683 0 .943l-1.91 1.91c-.36.36-.562.847-.562 1.355a3.25 3.25 0 0 1-1.796 2.907l-1.239.62a.667.667 0 1 1-.596-1.193l1.238-.62a1.92 1.92 0 0 0 1.06-1.714c0-.862.342-1.688.952-2.298l1.91-1.91c.26-.26.682-.26.943 0",fill:"#3E3F58"}),o.createElement("path",{d:"M3.874 4.788a1 1 0 0 1 1.414-1.414l23.099 23.098a1 1 0 1 1-1.415 1.415z",fill:"#E85388"})):o.createElement("svg",Object.assign({viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),o.createElement("g",{clipPath:"url(#clip0_1530_7251)"},o.createElement("path",{d:"M8.983 10.87a.23.23 0 0 1 .049-.16c.08-.114.156-.229.207-.36.1-.166.168-.348.233-.528.246-.668.397-1.36.508-2.062.036-.235.076-.471.09-.71.065-.511.101-1.024.095-1.541.004-.015.011-.03.011-.044a13 13 0 0 0-.089-1.62c-.023-.196-.093-.335-.298-.406-.293-.1-.48-.316-.568-.615a2.7 2.7 0 0 0-.217-.566c-.123-.222-.29-.391-.54-.47-.057-.018-.088-.016-.106.052q-.045.165-.073.336c-.005.044 0 .058.048.058q.122.005.244.017c.127.009.21.09.202.196-.011.111-.108.179-.239.166-.065-.007-.133-.009-.198-.016-.058-.008-.077.016-.067.072q.027.165.052.332c.006.043.031.053.07.053.078 0 .147-.03.218-.057.104-.042.2-.004.242.093.04.09.004.187-.093.235-.13.063-.27.113-.411.085a.23.23 0 0 0-.235.077c-.04-.084-.106-.146-.167-.211-.46-.475-.55-1.194-.235-1.82.18-.359.45-.627.828-.776A.4.4 0 0 0 8.69.595c.33-.317.734-.477 1.172-.55.641-.11 1.25-.024 1.819.3.41.233.728.566.942.983.131.253.188.535.246.814.16.762.233 1.538.293 2.313q.108 1.411.213 2.826c.055.712.13 1.422.24 2.128.066.428.175.846.26 1.27.097.479.039.941-.24 1.358a1.2 1.2 0 0 1-.517.428c-.163.05-.327.105-.491.155-.178.052-.302-.059-.268-.239a4.6 4.6 0 0 0 .077-.72 13.6 13.6 0 0 0-.133-2.225c-.03-.196-.055-.395-.087-.591-.07-.43-.151-.857-.257-1.28l-.015-.07a16 16 0 0 0-.282-1.03c-.012-.039-.025-.079-.076-.075-.038.003-.053.034-.058.07l-.146 1.105c-.05.219-.094.437-.158.652a5.5 5.5 0 0 1-.806 1.654l-.091.113c-.308.382-.654.719-1.094.95-.122.06-.177.048-.252-.063",fill:"#1B3250"}),o.createElement("path",{d:"M12.304 9.435c.1.737.154 1.477.133 2.224a4.6 4.6 0 0 1-.077.72c-.034.182.09.293.268.239q.246-.075.491-.155c.053.226.126.448.17.675q.09.452.129.912c.025.302.043.603.032.905q-.015.483-.065.964a14 14 0 0 1-.299 1.707c-.02.086-.045.17-.065.255-.02.09-.068.12-.16.12L8.789 18H7.781c-.111 0-.117-.011-.13-.124a3 3 0 0 0-.361-1.121c-.132-.235-.297-.448-.415-.692a3.14 3.14 0 0 1-.324-1.521c.233.07.418.001.571-.184q.236-.281.477-.559c.07-.08.136-.164.244-.193.315-.087.631-.166.94-.262.665-.207 1.324-.43 1.917-.804.251-.159.475-.344.595-.63.237-.564.415-1.147.592-1.733.085-.28.184-.55.417-.742",fill:"#2D87F3"}),o.createElement("path",{d:"M12.304 9.435c-.233.194-.33.462-.413.74-.177.585-.355 1.169-.592 1.733-.12.286-.344.471-.595.63-.593.375-1.254.597-1.916.804-.312.097-.628.177-.941.262-.11.031-.177.113-.244.193q-.24.277-.477.559c-.153.184-.34.253-.571.184a.87.87 0 0 1-.44-.54.64.64 0 0 1 .045-.503 1 1 0 0 0 .094-.31.47.47 0 0 1 .392-.405c.132-.03.269-.039.404-.053a.4.4 0 0 0 .114-.024c.115-.009.21-.069.31-.12.322-.167.646-.328.966-.497q.586-.308 1.192-.571a.78.78 0 0 0 .473-.524q.09-.305.177-.608c.047-.171.113-.337.14-.514a5.5 5.5 0 0 0 .806-1.654c.064-.215.108-.433.159-.652a.63.63 0 0 1 .342-.054c.08.013.156.036.237.054.105.423.187.85.256 1.28q.039.292.082.59m-4.19-5.947a.23.23 0 0 1 .235-.076c.142.025.282-.022.411-.086.097-.047.133-.143.093-.234-.042-.095-.138-.133-.242-.093-.071.027-.14.056-.218.056-.039 0-.062-.009-.07-.053q-.024-.165-.052-.33-.017-.082.067-.074c.066.008.133.01.198.017.131.013.228-.053.239-.166.01-.105-.073-.187-.202-.196-.082-.006-.162-.015-.244-.017-.046 0-.053-.014-.047-.058.016-.115.043-.224.072-.337.017-.067.05-.069.106-.05.25.078.417.247.54.469.1.178.16.371.217.566.087.298.273.515.568.615.206.07.275.21.298.406.066.539.091 1.08.09 1.62 0 .014-.008.029-.011.043-.272-.016-.525.075-.783.133a1.4 1.4 0 0 1-.513.031.5.5 0 0 1-.433-.36 2.3 2.3 0 0 1-.091-.46c.154-.024.309-.048.451-.124.1-.055.135-.148.09-.242a.18.18 0 0 0-.24-.084 1 1 0 0 1-.376.087 1.3 1.3 0 0 0-.326-.482c-.096-.093-.096-.215-.013-.319.06-.07.126-.134.186-.202",fill:"#FCCAAF"}),o.createElement("path",{d:"M10.069 7.052c-.013.239-.053.473-.09.71-.11.7-.261 1.394-.507 2.062-.066.18-.135.362-.233.528a.46.46 0 0 0-.235-.4c-.328-.21-.544-.508-.599-.898a.86.86 0 0 1 .242-.742c.237-.244.504-.459.761-.683.188-.162.37-.327.555-.493.033-.031.064-.064.106-.084m.349 2.818c-.025.176-.093.341-.14.513-.057.204-.119.404-.177.608a.78.78 0 0 1-.473.524q-.607.261-1.192.571c-.32.17-.646.33-.966.497-.099.051-.195.111-.31.12.066-.15.177-.266.277-.387.273-.334.615-.596.932-.881q.306-.28.611-.565c.077.11.13.124.251.06.439-.229.787-.567 1.094-.95z",fill:"#2D87F3"}),o.createElement("path",{d:"M8.271 4.49a1 1 0 0 0 .377-.088.183.183 0 0 1 .239.084c.047.095.01.187-.09.242-.14.076-.296.1-.45.124z",fill:"#FF6F4D"}),o.createElement("path",{d:"M11.96 7.563c-.079-.018-.157-.041-.237-.054a.65.65 0 0 0-.342.054l.146-1.104c.005-.037.02-.068.058-.071.05-.006.063.034.076.074q.159.511.282 1.03.01.036.017.071",fill:"#2D87F3"}),o.createElement("path",{d:"M9.834 1.004a7.996 7.996 0 1 0 0 15.992 7.996 7.996 0 0 0 0-15.992M9.465 2.26c1.606-.09 3.191.4 4.467 1.378a.282.282 0 0 1 .03.424l-9.066 9.066a.283.283 0 0 1-.424-.03A6.749 6.749 0 0 1 9.465 2.26m.369 13.49a6.72 6.72 0 0 1-4.016-1.325.284.284 0 0 1-.032-.426l9.046-9.047a.283.283 0 0 1 .427.032A6.75 6.75 0 0 1 9.834 15.75",fill:"#F44D2C"}),o.createElement("path",{d:"M10.159 5.509c.005.517 2.997-1.054 2.997-1.054s-.133-1.55-.293-2.313c-.058-.279-.114-.56-.245-.814a2.35 2.35 0 0 0-.943-.983c-.568-.324-1.178-.41-1.818-.3-.44.073-.843.233-1.173.55a.4.4 0 0 1-.147.085c-.379.15-.648.417-.828.776-.315.626-.224 1.345.235 1.82.062.065.127.127.167.21a.23.23 0 0 1 .235-.076c.142.028.282-.022.411-.085.097-.048.133-.144.093-.235-.042-.097-.138-.135-.242-.093-.071.027-.14.057-.218.057-.039 0-.064-.01-.07-.053q-.024-.165-.052-.332c-.01-.056.009-.08.067-.072.066.007.133.009.198.016.131.013.228-.055.239-.166.009-.105-.075-.187-.202-.196h-.007q-.118-.013-.237-.017c-.047 0-.053-.014-.047-.058.016-.114.043-.225.072-.336.019-.068.05-.07.106-.051.25.078.417.247.54.47.099.178.16.37.217.565.087.299.275.515.568.615.206.071.275.21.298.406.066.539.091 1.078.09 1.62z",fill:"#1B3250"}),o.createElement("path",{d:"M8.107 3.488a.23.23 0 0 1 .235-.076c.142.025.282-.022.411-.086.097-.047.133-.143.093-.234-.042-.095-.138-.133-.242-.093-.07.027-.14.056-.218.056-.038 0-.062-.009-.07-.053q-.024-.165-.052-.33-.017-.082.067-.074c.066.008.133.01.199.017.13.013.227-.053.238-.166.01-.105-.073-.187-.202-.196-.082-.006-.162-.015-.244-.017-.045 0-.053-.014-.047-.058.016-.115.043-.224.073-.337.016-.067.049-.069.105-.05.25.078.417.247.54.469.1.178.16.371.217.566.088.298.273.515.568.615.206.07.275.21.298.406.066.539.091 1.08.09 1.62 0 .014-.008.029-.011.043-.271-.016-.524.075-.783.133a1.4 1.4 0 0 1-.513.031.5.5 0 0 1-.433-.36 2.3 2.3 0 0 1-.091-.46c.154-.024.31-.048.451-.124.1-.055.135-.148.09-.242a.18.18 0 0 0-.24-.084 1 1 0 0 1-.376.087 1.3 1.3 0 0 0-.326-.482c-.096-.093-.096-.215-.012-.319.06-.07.125-.134.185-.202",fill:"#FCCAAF"}),o.createElement("path",{d:"M8.265 4.49a1 1 0 0 0 .376-.088.183.183 0 0 1 .239.084c.047.095.01.187-.09.242-.14.076-.296.1-.45.124z",fill:"#FF6F4D"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_1530_7251"},o.createElement("path",{fill:"#fff",d:"M.834 0h18v18h-18z"}))))},TryConceive=e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,i._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return t?o.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),o.createElement("path",{d:"M14.018 9.155c-1.422 1.066-1.777 1.777-1.067 2.843.57.853 2.133 2.488 3.2 3.554-.712 2.133-6.753 1.422-6.753 1.422l-.711 1.421-1.067 3.199c-1.066 0-3.198.142-3.198.71 0 .712 2.843 2.844 3.554 2.844.569 0 1.658-2.132 2.132-3.199 1.54 1.777 5.474 4.905 8.885 3.199 4.265-2.132 6.398-5.331 5.687-7.819-.274-.959-.284-1.495-.132-1.813a4.62 4.62 0 0 0 3.438-2.3c.715-1.108.78-2.417.397-3.652-.41-1.663-1.15-2.955-2.637-3.252-3.423-.685-6.397 1.016-6.397 4.62a4.6 4.6 0 0 0 .971 2.834c-1.184.316-2.414-.236-6.302-4.611",fill:"#fff"}),o.createElement("path",{d:"M29.3 10.825A5.235 5.235 0 0 0 24.077 5.6c-2.876 0-5.245 2.348-5.245 5.224 0 .36.275.634.634.634.36 0 .635-.275.635-.634 0-2.179 1.776-3.955 3.976-3.955s3.954 1.776 3.954 3.955a3.947 3.947 0 0 1-3.531 3.933.8.8 0 0 0-.381-.021c-.042.021-.085.021-.106.042a.64.64 0 0 0-.57.635c0 .254.147.465.359.57.105.487.148.995.148 1.502a7.175 7.175 0 0 1-7.17 7.17 7.22 7.22 0 0 1-5.773-2.898l-.02-.021c.507-.317 1.902-.17 2.41-.106a.637.637 0 0 0 .698-.57.637.637 0 0 0-.571-.699c-1.184-.148-3.384-.38-3.891 1.164-.064.19-.127.401-.19.592-.318.994-.74 2.347-1.27 2.58-.634.063-2.918-1.587-3.172-2.284.212-.275 1.248-.444 2.623 0 .169.063.36.042.507-.064s.275-.232.296-.423c.571-2.707.74-3.278.74-3.299v-.021c.212-.888.867-.973 2.538-.93 1.523.042 3.384.084 4.674-1.46a7.8 7.8 0 0 0 3.235.994h.043a.643.643 0 0 0 .634-.592c.021-.36-.232-.655-.57-.677-4.4-.36-6.028-4.652-6.091-4.842 0 0 0-.022-.022-.022-.274-.634-.063-1.036.19-1.163.17-.105.445-.105.614.17 1.248 2.008 2.432 3.32 3.574 4.018.021 0 .042.02.042.02.677.34 2.052.762 3.596-.295.296-.19.359-.592.169-.889-.19-.296-.592-.36-.889-.169-.951.635-1.776.487-2.305.233-.93-.571-1.988-1.777-3.108-3.574-.508-.783-1.48-1.036-2.284-.613-.762.401-1.312 1.438-.762 2.77.085.254.93 2.368 2.898 3.934a2.7 2.7 0 0 1-.614.486c-.02 0-.02 0-.042-.021-8.205-2.517-8.86-8.586-8.924-9.77a.61.61 0 0 0-.656-.614.63.63 0 0 0-.592.656c.042 1.226.655 7.084 7.74 10.172h-.508c-1.48-.042-3.34-.085-3.806 1.882-.021.106-.17.677-.613 2.707-1.587-.36-3.194-.127-3.574 1.036-.19.55.126 1.206.972 2.01.571.549 2.263 1.902 3.447 1.902.149 0 .297-.02.423-.063.952-.36 1.438-1.544 1.861-2.813a8.48 8.48 0 0 0 6.324 2.855c4.652 0 8.438-3.785 8.438-8.438 0-.507-.043-1.015-.148-1.522a5.264 5.264 0 0 0 4.23-5.16",fill:"#3E3F58"}),o.createElement("rect",{x:"23.005",y:"8.444",width:"1.942",height:"1.422",rx:".711",transform:"rotate(34.869 23.005 8.444)",fill:"#FB8C00"})):o.createElement("svg",Object.assign({viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),o.createElement("path",{d:"M13.996 8.62v3.221c1.054.035 1.682-.705 1.845-1.467.209-.977-.444-2.041-1.845-1.754",fill:"#FEAA96"}),o.createElement("path",{d:"M14.055 10.67a.21.21 0 0 1-.2-.277c.166-.508.594-.69.92-.644a.21.21 0 1 1-.059.418c-.163-.023-.37.079-.461.358a.21.21 0 0 1-.2.145",fill:"#FF886C"}),o.createElement("path",{d:"M2.16 10.374c.162.762.79 1.502 1.844 1.467V8.62c-1.4-.287-2.054.777-1.845 1.754",fill:"#FEAA96"}),o.createElement("path",{d:"M3.98 10.67a.21.21 0 0 1-.2-.145c-.093-.28-.299-.381-.462-.358a.21.21 0 0 1-.21-.102.21.21 0 0 1 .152-.316c.326-.046.753.136.92.644a.21.21 0 0 1-.2.277",fill:"#FF886C"}),o.createElement("path",{d:"M9 15.831c1.325 0 3.365-.561 4.534-2.292 1.057-1.563.436-4.144.462-5.169.053-2.079-1.447-4.78-4.996-4.78s-5.05 2.7-4.996 4.78c.026 1.025-.595 3.606.461 5.169 1.17 1.73 3.21 2.292 4.535 2.292",fill:"#FECCBF"}),o.createElement("path",{d:"M6.881 10.535a.56.56 0 1 0 0-1.121.56.56 0 0 0 0 1.121",fill:"#A35961"}),o.createElement("path",{d:"M7.114 9.777a.21.21 0 0 1-.188-.116c-.049-.097-.205-.122-.27-.129-.225-.022-.44.056-.477.104a.211.211 0 1 1-.347-.241c.149-.215.53-.306.831-.285.306.021.533.15.64.362a.21.21 0 0 1-.189.305",fill:"#8C2F39"}),o.createElement("path",{d:"M11.119 10.535a.56.56 0 1 0 0-1.121.56.56 0 0 0 0 1.121",fill:"#A35961"}),o.createElement("path",{d:"M9 13.329c.777 0 .994-.61 1.046-.92.031-.185-.132-.35-.34-.35H8.293c-.208 0-.371.165-.34.35.052.31.27.92 1.047.92",fill:"#D84023"}),o.createElement("path",{d:"M10.763 7.94a.2.2 0 0 1-.107-.03.33.33 0 0 0-.18-.029.21.21 0 1 1-.07-.416.74.74 0 0 1 .464.081.211.211 0 0 1-.107.393m-3.526 0a.21.21 0 0 1-.107-.393.74.74 0 0 1 .463-.08.211.211 0 1 1-.07.415.3.3 0 0 0-.18.029.2.2 0 0 1-.106.029",fill:"#FEAA96"}),o.createElement("path",{d:"M10.887 9.777a.21.21 0 0 1-.189-.305c.107-.212.334-.34.64-.362.3-.021.682.07.83.285a.211.211 0 0 1-.346.24c-.038-.048-.252-.125-.477-.103-.065.007-.221.032-.27.129a.21.21 0 0 1-.188.116",fill:"#8C2F39"}),o.createElement("path",{d:"M9.284 11.02a.21.21 0 0 1-.22-.15.07.07 0 0 0-.063-.05H9a.07.07 0 0 0-.064.05.21.21 0 0 1-.22.15.22.22 0 0 1-.192-.244c.018-.221.213-.379.476-.379.264 0 .458.158.476.38a.22.22 0 0 1-.192.244",fill:"#FEAA96"}),o.createElement("path",{d:"M9.55 12.06h-1.1l-.003.054a.552.552 0 1 0 1.102-.055m2.041-.774-.29.53a.1.1 0 0 1-.041.04l-.53.29a.1.1 0 0 0-.053.09.1.1 0 0 0 .053.09l.53.29q.026.015.04.04l.29.53a.103.103 0 0 0 .18 0l.29-.53a.1.1 0 0 1 .041-.04l.53-.29a.103.103 0 0 0 0-.18l-.53-.29a.1.1 0 0 1-.04-.04l-.29-.53a.1.1 0 0 0-.143-.039.1.1 0 0 0-.038.04",fill:"#fff"}),o.createElement("path",{d:"M11.055 2.193c-.147-.422-.524-.698-1.01-.738a.9.9 0 0 0-.535.154c-.206.155-.37.358-.478.592a.036.036 0 0 1-.066 0 1.55 1.55 0 0 0-.475-.592.9.9 0 0 0-.537-.154c-.485.04-.862.316-1.008.739a1.03 1.03 0 0 0 .259 1.09c.479.447 1.156.518 1.543.518h.502c.387 0 1.066-.07 1.545-.517a1.03 1.03 0 0 0 .26-1.092M8.79 3.243a.13.13 0 0 1-.134.135c-.316-.012-.821-.084-1.163-.402a.61.61 0 0 1-.148-.644.66.66 0 0 1 .438-.417c.242-.078.404-.006.456.033.446.33.539.932.551 1.295m1.718-.267c-.342.319-.847.39-1.163.402a.13.13 0 0 1-.135-.135c.013-.362.105-.964.551-1.295a.47.47 0 0 1 .25-.073c.318.027.554.193.645.457a.61.61 0 0 1-.149.644",fill:"#2D87F3"}),o.createElement("path",{d:"M8.998 3.338a.21.21 0 0 1 .122.383l-.04.028c-.16.118-.957.76-.991 1.758-.027.78.403 1.132.814 1.202.367.062.831-.096.985-.59a.415.415 0 0 0-.211-.52c-.136-.069-.32-.076-.425.064a.211.211 0 0 1-.337-.253c.215-.287.607-.363.954-.186a.836.836 0 0 1 .422 1.02 1.28 1.28 0 0 1-1.458.88c-.56-.095-1.202-.58-1.166-1.631.046-1.334 1.17-2.093 1.222-2.125a.2.2 0 0 1 .109-.03",fill:"#BA8288"}))},y=(0,o.createContext)({});var x=(0,r.k)(e=>({inputRightSection:{fontSize:(0,s.h)(13),lineHeight:(0,s.h)(24),color:e.colors.gray[4],justifyContent:"flex-end",paddingRight:8}}));let DefaultLayout=e=>{var t=(0,i._)(e,[]);let{t:a}=(0,b.u)(),{currentUrl:n,submitProps:l,form:r,calculatingMethods:s,isMobile:d}=(0,o.useContext)(y),{classes:p={}}=(0,o.useContext)(E.C),{classes:u}=x(void 0,{name:"OvulationTool__DefaultLayout"});return o.createElement(f.H,Object.assign({formLayout:"default"},t),o.createElement(f.H.FormRow,null,o.createElement(f.H.Control,null,o.createElement(f.H.ChipGroup,Object.assign({data:s,label:a("dueDatePage.calculationMethod"),isMobile:d},r.getInputProps("calculatorType"))))),o.createElement(f.H.FormRow,null,o.createElement(g.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},label:o.createElement(v.T,{size:"p2",weight:"semiBold"},` (${a("dueDatePage.lastPeriod.lastPeriodLabel")})`),maxDate:new Date},r.getInputProps("lastPeriodDate")))),o.createElement(f.H.FormRow,null,o.createElement(h.I.Number,Object.assign({label:o.createElement(v.T,{size:"p2",weight:"semiBold"},a("ovulationPage.cycleLength")),rightSection:a("ovulationPage.dayUnit"),min:21,max:45,defaultValue:1},r.getInputProps("cycleLength"),{classNames:{rightSection:u.inputRightSection}}))),o.createElement(f.H.FormRow,null,o.createElement(h.I.Number,Object.assign({label:o.createElement(v.T,{size:"p2",weight:"semiBold"},a("ovulationPage.periodDuration")),rightSection:a("ovulationPage.dayUnit"),min:1,max:15,defaultValue:1},r.getInputProps("periodLength"),{classNames:{rightSection:u.inputRightSection}}))),o.createElement(f.H.FormRow,{className:p.submitWrapper},o.createElement(f.H.Submit,Object.assign({type:"submit",className:(0,c.default)("due-date-calculate-button",p.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Ovulation",dataEventLabel:n},l),a("dueDatePage.lastPeriod.calculate"))))},InlineLayout=e=>{var t=(0,i._)(e,[]);let{t:a}=(0,b.u)(),{currentUrl:n,submitProps:l,form:r,calculatingMethods:s}=(0,o.useContext)(y),{classes:d={}}=(0,o.useContext)(E.C);return o.createElement(f.H,Object.assign({formLayout:"inline"},t),o.createElement(f.H.FormRow,null,o.createElement(f.H.BorderInlineControl,{label:a("dueDatePage.calculationMethod"),direction:"column",width:"100%"},o.createElement(f.H.ChipGroup,Object.assign({data:s},r.getInputProps("calculatorType"))))),o.createElement(f.H.FormRow,null,o.createElement(f.H.BorderInlineControl,{label:a("dueDatePage.lastPeriod.lastPeriodLabel")},o.createElement(g.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},r.getInputProps("lastPeriodDate"))))),o.createElement(f.H.FormRow,null,o.createElement(f.H.BorderInlineControl,{label:a("ovulationPage.cycleLength")+" "+a("ovulationPage.dayUnit")},o.createElement(h.I.Number,Object.assign({min:21,max:45,defaultValue:1},r.getInputProps("cycleLength"),{error:null}))),r.errors.cycleLength&&o.createElement(f.H.Error,null,r.errors.cycleLength)),o.createElement(f.H.FormRow,null,o.createElement(f.H.BorderInlineControl,{label:a("ovulationPage.periodDuration")+" "+a("ovulationPage.dayUnit")},o.createElement(h.I.Number,Object.assign({min:1,max:15,defaultValue:1},r.getInputProps("periodLength"),{error:null}))),r.errors.periodLength&&o.createElement(f.H.Error,null,r.errors.periodLength)),o.createElement(f.H.FormRow,{className:d.submitWrapper},o.createElement(f.H.Submit,Object.assign({type:"submit",className:(0,c.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Ovulation",dataEventLabel:n},l),a("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,i._)(e,[]);let{t:a}=(0,b.u)(),{currentUrl:n,submitProps:l,form:r,calculatingMethods:s}=(0,o.useContext)(y);return o.createElement(f.H,Object.assign({formLayout:"inline"},t),o.createElement(f.H.Control,null,o.createElement(h.I.Wrapper,{label:o.createElement(v.T,{size:"p4",sx:{fontWeight:"normal"}},a("dueDatePage.calculationMethod"))},o.createElement(f.H.ChipGroup,Object.assign({data:s},r.getInputProps("calculatorType"))))),o.createElement(f.H.BorderBoxControl,{label:a("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:o.createElement(w.Z,null)},o.createElement(g.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null},r.getInputProps("lastPeriodDate")))),o.createElement(f.H.BorderBoxControl,{label:a("ovulationPage.cycleLength"),rightSection:a("ovulationPage.dayUnit")},o.createElement(h.I.Number,Object.assign({min:21,max:45,defaultValue:1},r.getInputProps("cycleLength")))),r.errors.cycleLength&&o.createElement(f.H.Error,null,r.errors.cycleLength),o.createElement(f.H.BorderBoxControl,{label:a("ovulationPage.periodDuration"),rightSection:a("ovulationPage.dayUnit")},o.createElement(h.I.Number,Object.assign({min:1,max:15,defaultValue:1},r.getInputProps("periodLength")))),r.errors.periodLength&&o.createElement(f.H.Error,null,r.errors.periodLength),o.createElement(f.H.Submit,Object.assign({type:"submit",className:"due-date-calculate-button",dataEventCategory:"Health Tool",dataEventAction:"Ovulation",dataEventLabel:n},l),a("dueDatePage.lastPeriod.calculate")))};(n=l||(l={}))[n.trackPeriod=0]="trackPeriod",n[n.conceive=1]="conceive",n[n.avoidPregnancy=2]="avoidPregnancy";let OvulationForm=e=>{var{formLayout:t="default",submitProps:a,currentUrl:n,isMobile:r,onSubmit:s}=e,c=(0,i._)(e,["formLayout","submitProps","currentUrl","isMobile","onSubmit"]);let h=(0,d.rZ)(),{t:g}=(0,b.u)(),v="mb"===h.other.template,E=(0,p.c)({initialValues:{calculatorType:String(l.trackPeriod),periodLength:7,cycleLength:28,lastPeriodDate:new Date},validate:{periodLength:(0,u.U)(g("validation.error.requiredField")),cycleLength:(0,u.U)(g("validation.error.requiredField"))}}),f=Object.assign({onSubmit:E.onSubmit(s)},c),w=[{label:g("ovulationPage.trackPeriod"),value:l.trackPeriod,icon:o.createElement(m.L,null)},{label:g("ovulationPage.conceive"),value:l.conceive,icon:o.createElement(TryConceive,null)},{label:g("ovulationPage.avoidPregnancy"),value:l.avoidPregnancy,icon:o.createElement(AvoidPregnancy,null)}];return o.createElement(y.Provider,{value:{submitProps:a,currentUrl:n,form:E,isMobile:r,calculatingMethods:w}},"inline"===t?o.createElement(InlineLayout,Object.assign({},f)):v?o.createElement(MbLayout,Object.assign({formLayout:t},f)):o.createElement(DefaultLayout,Object.assign({},f)))}}}]);