"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{mVZD:function(e,t,a){a.d(t,{B:function(){return BabyPoopForm}});var r=a("T/vS"),o=a("q1tI"),i=a("/npG"),n=a("mYVa"),l=a("Eso5"),s=a("iuhU"),c=a("dDw1"),d=a("RlpF"),p=a("Z+18"),u=a("cHPQ"),g=a("w8P6"),h=(0,i.k)((e,{hasOnClickFn:t})=>({root:{position:"relative",display:"flex",flexDirection:"column",gap:(0,n.h)(16)},sponsorBox:{display:"flex",gap:(0,n.h)(12),alignItems:"center",backgroundColor:e.colors.neutral[0],border:`1px solid ${e.colors.neutral[1]}`,borderRadius:(0,n.h)(4),padding:"4px 12px",alignSelf:"flex-start"},sponsorLogo:{maxHeight:(0,n.h)(32)},btn:{minWidth:(0,n.h)(180),[e.fn.largerThan("sm")]:{alignSelf:"flex-end"},visibility:t?"visible":"hidden"}}));let BabyPoopForm=e=>{var{babyPoopPage:t,onClickFindOut:a,currentUrl:i,sponsorLogo:n,btnProps:m,styles:b,classNames:v}=e,f=(0,r.a)(e,["babyPoopPage","onClickFindOut","currentUrl","sponsorLogo","btnProps","styles","classNames"]);let{t:x}=(0,p.u)(),{classes:y}=h({hasOnClickFn:!!a},{name:"BabyPoopForm",styles:b,classNames:v}),{classes:w={}}=(0,o.useContext)(u.C);return o.createElement(g.H.FormRow,null,o.createElement(l.x,Object.assign({className:y.root},f),n&&o.createElement(l.x,{className:y.sponsorBox},o.createElement(c.T,{size:"p4"},x("common.sponsoredBy")),o.createElement("img",{loading:"lazy",src:n,alt:"sponsor",className:y.sponsorLogo})),o.createElement(c.T,{size:"p3",as:"div",className:"description",dangerouslySetInnerHTML:{__html:t.description}}),o.createElement(d.B,Object.assign({className:(0,s.default)(y.btn,w.submitBtn),onClick:a,dataEventCategory:"Health Tool",dataEventAction:"Baby Stool Inquiry",dataEventLabel:i},m),x("babyPoop.findOut"))))}},spOg:function(e,t,a){a.d(t,{A:function(){return AddressInput}});var r=a("T/vS"),o=a("q1tI"),i=a("OAL+"),n=a("aDCK"),l=a("SMDy"),s=a("qFhO"),c=a("Z+18"),d=a("wxjh"),p=a("375z"),u=a("yNk5");let generateGetAddressDetail=e=>`${s.g}/cities-data-${d.M[e]}.json`,g={provinceByName:{},provinces:[],districts:[],wards:[],selectedProvince:"",selectedDistrict:"",selectedWard:""},reducer=(e,t)=>{switch(t.type){case"SET_DATA":return Object.assign(Object.assign({},e),t.payload);case"SET_DISTRICTS":return Object.assign(Object.assign({},e),{districts:t.payload});case"SET_WARDS":return Object.assign(Object.assign({},e),{wards:t.payload});case"SELECT_PROVINCE":return Object.assign(Object.assign({},e),{selectedProvince:t.payload,selectedDistrict:"",selectedWard:""});case"SELECT_DISTRICT":return Object.assign(Object.assign({},e),{selectedDistrict:t.payload,selectedWard:""});case"SELECT_WARD":return Object.assign(Object.assign({},e),{selectedWard:t.payload});default:return e}},mappingProvinceId=(e,t)=>{let a={};for(let[,e]of Object.entries(t)){let{id:t}=e;t&&(a[t]=e)}let r={};return e.map(e=>{r[e.name]=a[e.id]}),r},useAddress=({provinces:e})=>{let[t,a]=(0,o.useReducer)(reducer,g),{provinceByName:i,provinces:n,districts:l,wards:s,selectedProvince:c,selectedDistrict:d,selectedWard:h}=t,[m,b]=(0,o.useState)();return(0,o.useEffect)(()=>{(0,r._)(void 0,void 0,void 0,function*(){var t,r,o;try{let i=yield fetch(generateGetAddressDetail(u.env.UNIFY_LOCALE||p.L.Vietnam)).then(e=>e.json());b(i);let{list:n}=i,l=e?mappingProvinceId(e,n):n,s=Object.keys(l),c=Object.keys((null===(t=n[s[0]])||void 0===t?void 0:t.list)||{}),d=Object.keys((null===(o=null===(r=n[s[0]])||void 0===r?void 0:r[c[0]])||void 0===o?void 0:o.list)||{});a({type:"SET_DATA",payload:{provinceByName:l,provinces:s,districts:c,wards:d}})}catch(e){console.error("Error fetching address data:",e)}})},[u.env.UNIFY_LOCALE]),{provinces:n,districts:l,wards:s,selectedProvince:c,selectedDistrict:d,selectedWard:h,handleProvinceChange:e=>{var t;let r=Object.keys((null===(t=i[e])||void 0===t?void 0:t.list)||{});a({type:"SET_DISTRICTS",payload:r}),a({type:"SET_WARDS",payload:[]}),a({type:"SELECT_PROVINCE",payload:e})},handleDistrictChange:e=>{var t,r;let o=Object.keys((null===(r=null===(t=i[c])||void 0===t?void 0:t.list[e])||void 0===r?void 0:r.list)||{});a({type:"SET_WARDS",payload:o}),a({type:"SELECT_DISTRICT",payload:e})},handleWardChange:e=>{a({type:"SELECT_WARD",payload:e})}}},AddressInput=e=>{var{error:t,provinces:a,placeholder:s}=e,d=(0,r.a)(e,["error","provinces","placeholder"]);let{t:p}=(0,c.u)(),{provinces:u,districts:g,wards:h,selectedProvince:m,selectedDistrict:b,selectedWard:v,handleProvinceChange:f,handleDistrictChange:x,handleWardChange:y}=useAddress({provinces:a}),[w,E]=(0,o.useState)("");return(0,o.useEffect)(()=>{m&&b&&v&&w?d.onChange({selectedProvince:m,selectedDistrict:b,selectedWard:v,extraInfo:w}):d.onChange(null)},[m,b,v,w]),o.createElement(l.I.Wrapper,Object.assign({withAsterisk:!0},d),o.createElement(i.K,null,o.createElement(l.S,{placeholder:(null==s?void 0:s.province)||p("onboarding.similac.input.city"),data:a?u:u.sort(),searchable:!0,onChange:f,value:m}),o.createElement(l.S,{placeholder:(null==s?void 0:s.district)||p("onboarding.similac.input.district"),data:g.sort(),searchable:!0,onChange:x,value:b,disabled:!m}),o.createElement(l.S,{placeholder:(null==s?void 0:s.ward)||p("onboarding.similac.input.ward"),searchable:!0,data:h.sort(),value:v,onChange:y,disabled:!m||!b}),o.createElement(l.I,{placeholder:(null==s?void 0:s.address)||p("onboarding.similac.input.no"),disabled:!m||!b||!v,value:w,onChange:E,style:{marginBottom:0}})),o.createElement(n.I.Error,{size:"md"},t))}},"6+FN":function(e,t,a){a.d(t,{S:function(){return SocialLinkPreview}});var r=a("T/vS"),o=a("q1tI"),i=a("Eso5"),n=a("8vDj"),l=a("FfBq"),s=a("YRXs"),c=a("GAI/"),d=a("rBCA"),p=a("IQVP"),u=a("OzIV"),g=a("did1"),h=a("iLR0");let m=d.Z.div`
.link-info-container {
padding: 0.5rem 1rem;
background: ${e=>e.color||"#f4faff"};
}
.link-image-wrapper {
position: relative;
overflow: hidden;
width: 100%;
background-color: #000;
padding-top: ${e=>{var t;return null!==(t=e.aspectPaddingTop)&&void 0!==t?t:e.isShort?"179.58%":"56.25%"}};
&.fetching {
background: lightgray;
}
.loading-spinner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.link-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: ${e=>{var t;return null!==(t=e.posterFit)&&void 0!==t?t:"cover"}};
object-position: center;
}
}
a {
text-decoration: none;
}
&[data-is-marrybaby='true'] {
overflow: hidden;
border-radius: 1rem;
}
`,useExternalScript=({url:e,onLoad:t,onError:a})=>{let[r,i]=(0,o.useState)(e?"loading":"idle");return(0,o.useEffect)(()=>{if(!e){i("idle");return}let r=document.querySelector(`script[src="${e}"]`),handleLoadScript=()=>{i("ready"),null==t||t()},handleErrorScript=()=>{i("error"),null==a||a()};return r||((r=document.createElement("script")).type="application/javascript",r.src=e,r.async=!0,document.body.appendChild(r),r.addEventListener("load",handleLoadScript),r.addEventListener("error",handleErrorScript)),r.addEventListener("load",handleLoadScript),r.addEventListener("error",handleErrorScript),()=>{r.removeEventListener("load",handleLoadScript),r.removeEventListener("error",handleErrorScript)}},[e]),r},YoutubePlyr=({id:e,autoplay:t,posterFit:a="cover"})=>{let r=(0,o.useRef)(null),n=useExternalScript({url:"https://cdn.plyr.io/3.7.8/plyr.js"});return(0,o.useEffect)(()=>{var e;if(!document.getElementById("hhg-plyr-player")){let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href="https://cdn.plyr.io/3.7.8/plyr.css",e.id="hhg-plyr-player",document.head.appendChild(e)}let a="ready"===n||"undefined"!=typeof Plyr;if(!a)return;let o=null===(e=r.current)||void 0===e?void 0:e.querySelector('[data-id="player"]');if(!o)return;let i=new Plyr(o,{autoplay:t,muted:!0});return()=>{i.destroy()}},[n,t,e]),o.createElement(i.x,{ref:r,sx:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#000","&, & > div":{width:"100%",height:"100%"},"& .plyr":{width:"100%",height:"100%",maxWidth:"none"},"& .plyr__video-wrapper":{height:"100%",width:"100%"},"& .plyr__video-embed":{paddingBottom:"0 !important",height:"100% !important",position:"relative"},"& .plyr__video-embed iframe":{position:"absolute",top:0,left:0,width:"100%",height:"100%"},"& .plyr__poster":{backgroundSize:"cover"===a?"cover !important":"contain !important",backgroundPosition:"center !important",backgroundRepeat:"no-repeat",width:"100% !important",height:"100% !important",top:0,left:0}}},o.createElement("div",{key:e,"data-id":"player",className:"plyr__video-embed"},o.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${e}?mute=1&enablejsapi=1&rel=0`,allow:"autoplay; fullscreen",allowFullScreen:!0,title:"YouTube preview",frameBorder:"0"})))},SocialLinkPreview=({url:e,image:t,className:a,style:i,baseUrl:d="",autoPlay:b=!0,forceType:v,ratio:f,posterFit:x="cover",onPushStatus:y})=>{let{data:{locale:w}}=(0,o.useContext)(c.T),[E,C]=(0,o.useState)(null);(0,o.useEffect)(()=>{(0,r._)(void 0,void 0,void 0,function*(){if(!t){if(!e)return C(null);C(e=>Object.assign(Object.assign({},e),{isFetching:!0})),(0,c.c)((0,c.f)(p.yy.FETCH_PREVIEW,{_locale:w},void 0,d),"POST",{data:{link:e},headers:{"Content-Type":"application/json"}},!!d).then(t=>{var a,r;C({url:e,image:(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.image)||(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.logo)})}).catch(()=>{C(null)})}})},[e,t]);let k=t||(null==E?void 0:E.image),S=(null==E?void 0:E.url)||e,I=(0,o.useMemo)(()=>(0,g.y)(S),[S]),j=(0,o.useMemo)(()=>S.includes("facebook.com")||S.includes("fb.watch"),[S]),O=(0,o.useMemo)(()=>(0,g.i)(S),[S]),$=(0,o.useMemo)(()=>!!(I||j),[j,I]),L=(0,o.useMemo)(()=>v===s.V.SHORTS||v!==s.V.VIDEO&&O,[v,O]),P=(0,o.useMemo)(()=>f?function(e){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)$/);if(!t)return;let a=Number(t[1]),r=Number(t[2]);if(Number.isFinite(a)&&Number.isFinite(r)&&!(a<=0)&&!(r<=0))return`${r/a*100}%`}(f):void 0,[f]),T=(0,o.useRef)(null),N=(0,o.useRef)(0),M=(0,o.useRef)(0),[F,R]=(0,o.useState)(!1),z=(0,o.useCallback)(e=>{var t;let a=null===(t=T.current)||void 0===t?void 0:t.getBoundingClientRect();if(!(null==a?void 0:a.width))return;let r=Math.floor(a.width),o=Math.floor(a.height),i=!1;e?((!N.current||Math.abs((N.current-r)/a.width)>.2)&&(N.current=r,i=!0),(!M.current||Math.abs((M.current-o)/(a.height||1))>.2)&&(M.current=o,i=!0)):(r!==N.current||o!==M.current)&&(N.current=r,M.current=o,i=!0),i&&R(e=>!e)},[]);(0,o.useLayoutEffect)(()=>{z(!1)},[P,f,L,S,z]),(0,o.useEffect)(()=>{let handleResize=()=>z(!0);return handleResize(),window.addEventListener("resize",handleResize,{passive:!0}),()=>{window.removeEventListener("resize",handleResize)}},[z]),(0,o.useEffect)(()=>{(null==E?void 0:E.image)&&(null==E?void 0:E.url)&&(null==y||y(!0))},[E]);let B=(0,n.rZ)();return o.createElement(m,{className:`${a} no-replace-click`,style:i,color:B.colors[B.primaryColor][0],isShort:L,aspectPaddingTop:P,posterFit:x},$&&(!t||O)?o.createElement("div",{ref:T,className:"link-image-wrapper"},I?o.createElement(YoutubePlyr,{key:`${I}-${null!=f?f:"auto"}`,id:I,autoplay:b,isShort:L,ratio:f,posterFit:x}):j?o.createElement("iframe",{key:String(F),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(S)}&autoplay=${b?1:0}&show_text=false&t=0&width=${N.current}&height=${M.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:M.current,width:N.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null):o.createElement("a",{href:S,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:`link-image-wrapper ${(null==E?void 0:E.isFetching)?"fetching":""}`},(null==E?void 0:E.isFetching)?o.createElement(h.L,{className:"loading-spinner"}):o.createElement(l.I,{className:"link-image",src:k||u.a,backupSrc:u.a,alt:S}))))}},WTZ1:function(e,t,a){a.d(t,{B:function(){return Button}});var r=a("T/vS"),o=a("q1tI"),i=a("RlpF");let Button=e=>{var{size:t,color:a="primary",isDisabled:n,isBlock:l,title:s,onClick:c,icon:d,iconPosition:p="left",children:u,isLoading:g=!1,loadingText:h,dataEventCategory:m,dataEventAction:b,dataEventLabel:v,dataProductChannel:f,dataProductSku:x,dataProductBrand:y,dataProductName:w,dataProductPrice:E,dataProductCategory:C,dataProductPosition:k,type:S}=e,I=(0,r.a)(e,["size","color","isDisabled","isBlock","title","onClick","icon","iconPosition","children","isLoading","loadingText","dataEventCategory","dataEventAction","dataEventLabel","dataProductChannel","dataProductSku","dataProductBrand","dataProductName","dataProductPrice","dataProductCategory","dataProductPosition","type"]);return o.createElement(i.B,Object.assign({},{"data-event-category":m,"data-event-action":b,"data-event-label":v,"data-product-channel":f,"data-product-sku":x,"data-product-brand":y,"data-product-name":w,"data-product-price":E,"data-product-category":C,"data-product-position":k},{size:t,variant:"transparent"===a?"white":"danger"===a?"error":a,disabled:n,onClick:e=>{g||n||!c||c(e)},title:s,loading:g,type:S||"submit",leftIcon:"left"===p?d:void 0,rightIcon:"right"===p?d:void 0,w:l?"100%":void 0,p:l?"12px auto":void 0,"data-color":a,"data-size":t,"data-block":l,"data-has-icon":!!d||void 0,"data-theme":I.theme,"data-is-loading":g},I),g&&h||u)}},L3Nj:function(e,t,a){a.d(t,{M:function(){return index_ce29e1ac_Modal}});var r=a("T/vS"),o=a("q1tI"),i=a("h8tX"),n=(0,a("/npG").k)(e=>({root:{},inner:{},content:{borderRadius:16},header:{borderBottom:`1px solid ${e.colors.neutral[1]}`,marginRight:0,marginBottom:0,padding:"12px"},overlay:{},title:{fontSize:16,fontWeight:700,lineHeight:1.5},body:{},close:{cursor:"pointer",width:"unset",height:"unset",svg:{width:"24px !important",height:"24px !important"}}}));let index_ce29e1ac_Modal=e=>{var{styles:t,classNames:a,transitionProps:l}=e,s=(0,r.a)(e,["styles","classNames","transitionProps"]);let{classes:c}=n(void 0,{name:"Modal",styles:t,classNames:a});return o.createElement(i.u,Object.assign({centered:!0,classNames:c,transitionProps:Object.assign({transition:"fade"},l),trapFocus:!1},s))}},zzXX:function(e,t,a){a.d(t,{D:function(){return Divider}});var r=a("q1tI"),o=a("rBCA"),i=a("iBNF");let n=o.Z.hr`
border-width: 1px;
border-color: ${i.r.colors.neutral200};
border-style: ${e=>e.dividerType};
`,Divider=({type:e="solid",className:t,style:a})=>r.createElement(n,{style:a,className:t,"data-diver-type":e,dividerType:e})},TUdM:function(e,t,a){a.d(t,{C:function(){return CardLink}});var r=a("T/vS"),o=a("q1tI"),i=a("8vDj"),n=a("Mjd7"),l=a("dDw1"),s=a("GAI/"),c=a("rBCA"),d=a("IQVP"),p=a("OzIV");let u=c.Z.div`
.link-info-container {
padding: 0.5rem 1rem;
background: ${e=>e.color||"#f4faff"};
}
.link-image-wrapper {
position: relative;
overflow: hidden;
width: 100%;
padding-top: min(280px, 56.25%);
.link-image-blur {
position: absolute;
top: 50%;
left: 50%;
width: 110%;
height: 110%;
/* Add the blur effect */
-webkit-filter: blur(8px);
filter: blur(8px);
object-fit: cover;
object-position: center;
opacity: 0.8;
transform: translate(-50%, -50%);
}
.link-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
}
}
a {
text-decoration: none;
}
&[data-is-marrybaby='true'] {
overflow: hidden;
border-radius: 1rem;
.link-info-container {
padding-bottom: 1rem;
p {
color: #2661ad;
}
.link-logo {
max-width: 2rem;
height: 13px;
margin-right: 4px;
object-fit: contain;
vertical-align: middle;
}
}
.link-image-wrapper {
padding-top: min(360px, 56.25%);
.link-image {
object-fit: cover;
}
}
}
`,CardLink=({title:e,url:t,image:a,logo:c,className:g,style:h,noRefetch:m})=>{let{data:{locale:b,env:{isMarryBaby:v}}}=(0,o.useContext)(s.T),[f,x]=(0,o.useState)(!1),y=(0,i.rZ)(),w=(0,o.useRef)(m);w.current=m;let[E,C]=(0,o.useState)(null);(0,o.useEffect)(()=>{(0,r._)(void 0,void 0,void 0,function*(){if(!w.current){if(!t)return C(null);C(e=>Object.assign(Object.assign({},e),{isFetching:!0})),(0,s.c)((0,s.f)(d.yy.FETCH_PREVIEW,{_locale:b}),"POST",{data:{link:t},headers:{"Content-Type":"application/json"}}).then(e=>{var a,r,o;x(!1),C({title:null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.title,url:t,image:(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.image)||(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.logo)})}).catch(()=>{C(null)})}})},[t]);let k=(null==E?void 0:E.image)||a,S=(null==E?void 0:E.title)||e,I=(null==E?void 0:E.logo)||c,j=(null==E?void 0:E.url)||t,O=j.replace("http://","").replace("https://","").split(/[/?#]/),$=O[0],L=(0,o.useRef)(!1);return o.createElement(u,{"data-is-marrybaby":v,className:`${g} no-replace-click`,style:h,color:y.colors[y.primaryColor][0]},o.createElement("a",{href:j,target:"_blank",rel:"noreferrer"},k&&o.createElement("div",{className:"link-image-wrapper"},!v&&o.createElement("img",{className:"link-image-blur",src:k,onError:e=>{L.current||(L.current=!0,e.currentTarget.src=p.a)},loading:"lazy"}),o.createElement("img",{className:"link-image",src:k,onError:e=>{L.current||(L.current=!0,e.currentTarget.src=p.a)},loading:"lazy"})),o.createElement("div",{className:"link-info-container"},o.createElement(l.T,{size:"n1"},v&&I&&!f&&o.createElement("img",{className:"link-logo",src:I,onError:()=>x(!0),loading:"lazy"}),$),o.createElement(n.H,{tag:"h6"},S))))}},TXyQ:function(e,t,a){a.d(t,{B:function(){return BookingSearchBarV3},T:function(){return TextDivider}});var r,o,i,n,l=a("q1tI"),s=a("6mQP"),c=a("0D4Z"),d=a("iuhU"),p=a("Eso5"),u=a("aDCK"),g=a("mYVa"),h=a("vaps"),m=a("8vDj"),b=a("OAL+"),v=a("SPK5"),f=a("TIp3"),x=a("CmzK"),y=a("NEaA"),w=a("rlLN"),E=a("Iblh"),C=a("ULDv"),k=a("lUSm"),S=a("Z+18"),I=a("sEfC"),j=a.n(I),O=a("kEvS"),$=a("rBCA"),L=a("iBNF"),P=a("un+D"),T=a("mpds"),N=a("dDw1"),M=a("VAe8"),F=a("T/vS"),R=a("A24R"),z=a("L3Nj"),B=a("Qccx"),D=a("RlpF");let A=$.Z.div``,_=$.Z.div`
background-color: ${L.r.colors.neutral50};
padding-bottom: 1px;
${P.M.mbDown} {
padding: 0;
}
`,Z=(0,$.Z)(T.C)`
padding: 0 16px;
${P.M.mbDown} {
padding: 0;
}
`,H=$.Z.div`
padding: 24px 56px;
border-radius: 16px;
background-color: ${L.r.colors.white};
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
${P.M.mbDown} {
padding: 16px;
border-radius: 0;
}
.flex-search-input {
flex-direction: row;
${P.M.mbDown} {
flex-direction: column;
}
}
`,W={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},q={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",focusedSpecialty:"none",searchLocationKeywords:"",searchSpecialtyKeywords:"",searchKeywords:"",selectedLocation:null,selectedSpecialty:null,defaultCity:null,initialCities:[],cities:[],searchResults:{},initialSearchResults:{},isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN",allSpecialties:[],popularKeys:[]};function resetSearchLocationKeywords(e){let{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function reducer(e,t){var a,r;switch(e.isDebug&&console.log("bookingSearchBarV3",{action:t,state:e}),t.type){case i.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case i.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case i.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case i.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case i.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case i.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===O.a&&(t.searchLocationKeywords=""),t}case i.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(r=e.selectedLocation)||void 0===r?void 0:r.id)===O.a&&(t.searchLocationKeywords=""),t}case i.FocusInputSearch:let o=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(o);return o;case i.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case i.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case i.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>W[e.locale]})}case i.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case i.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case i.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case i.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case i.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case i.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case i.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case i.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case i.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case i.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case i.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case i.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:r}=t.payload;a=a.filter(e=>e.id!==r.id),r&&a.unshift(r),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let o=Object.assign(Object.assign({},e),{defaultCity:r,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(o.selectedLocation=r,o.searchLocationKeywords=r.name),o}case i.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case i.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case i.DisplayInitialSearchResults:{let t=e.searchKeywords.trim(),a=W[e.locale],r=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:r?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case i.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case i.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case i.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case i.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case i.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case i.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case i.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case i.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case i.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(r=i||(i={})).NavigateTo="navigate to url",r.ClickOutsideInputLocation="click outside input location",r.ClickOutsideInputSearch="click outside input search",r.ClickOutsideInputSearchSpecialty="click outside input search specialty",r.ClickOutsideInputSpecialty="click outside input specialty",r.SelectCurrentLocation="select current location",r.FocusInputLocation="focus input location",r.FocusInputSearch="focus input search",r.FocusInputSearchSpecialty="focus input search specialty",r.ChangeInputLocation="change input location",r.ChangeInputSearch="change input search",r.ClearInputLocation="clear input location",r.ClearInputSearch="clear input search",r.SelectLocation="select location",r.SelectSpecialty="select specialty",r.FetchCitiesStart="fetch cities start",r.FetchCitiesFinish="fetch cities finish",r.FetchSearchResultsStart="fetch search results start",r.FetchSearchResultsComplete="fetch search results complete",r.FetchSearchResultsFinish="fetch search results finish",r.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",r.FetchCitiesByKeywordComplete="fetch cities by keyword finish",r.DisplayInitialCities="display initial cities",r.DisplayInitialSearchResults="display initial search results",r.UpdateInitialSearchResults="update initial search results",r.GrantGeoLocationPermission="grant geolocation permission",r.DenyGeoLocationPermission="deny geolocation permission",r.OpenMobileModal="open mobile modal",r.CloseMobileModal="close mobile modal",r.UpdateInitialSearchValue="update initial search value",r.SelectSearchResult="select search result",r.SetInputSearchPlaceholder="set input search placeholder",r.FocusInputSpecialty="focus input specialty",r.FetchAllSpecialties="fetch all specialty",r.FetchPopularKeys="fetch popular key by type";let G=$.Z.div`
flex: 1;
position: relative;
${P.M.mbDown} {
width: 100%;
}
`,V=$.Z.div`
background: #f7f9fc;
border-radius: 12px;
height: 48px;
display: flex;
align-items: center;
padding: 4px 12px 4px 4px;
gap: 16px;
${P.M.mbDown} {
height: 48px;
width: 100%;
}
`,K=$.Z.div`
display: flex;
align-items: center;
flex-shrink: 0;
color: #8c8c8c;
svg {
width: 18px;
height: 18px;
}
`,U=$.Z.div`
position: absolute;
top: calc(100% + 2px);
width: 100%;
border-radius: 4px;
background: ${L.r.colors.white};
box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
z-index: 10;
${P.M.mbDown} {
width: calc(100% + 64px);
left: -32px;
}
`,Q=$.Z.div``;$.Z.div`
display: flex;
justify-content: space-between;
align-item: center;
padding: 9px 14px 9px 22px;
background: #f7f9fc;
.title {
color: ${L.r.colors.gray800};
font-size: 14px;
font-weight: 600;
line-height: 22px;
}
.btn-see-all {
color: ${L.r.colors.blue600};
font-size: 14px;
line-height: 22px;
cursor: pointer;
}
`;let Y=$.Z.div`
padding: 10px 16px;
max-height: 400px;
overflow: auto;
`,J=$.Z.div`
display: flex;
gap: 12px;
align-items: center;
cursor: pointer;
${P.M.mbUp} {
&:hover {
background-color: ${L.r.colors.blue50};
}
}
.image-item {
flex: 0 0 48px;
width: 48px;
height: 48px;
border-radius: 50%;
img {
object-fit: contain;
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.infor {
overflow: hidden;
padding: 12px 0;
flex: 1;
border-bottom: 1px solid ${L.r.colors.neutral100};
.title {
color: ${L.r.colors.gray800};
font-size: 16px;
font-weight: 600;
line-height: 24px;
}
.description {
overflow: hidden;
color: ${L.r.colors.gray600};
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
line-height: 18px;
display: flex;
gap: 8px;
align-items: center;
margin-top: 5px;
svg {
flex: 0 0 16px;
}
.sub-description {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
}
}
}
&.last-item {
.infor {
border-bottom: none;
}
}
`;$.Z.div`
padding: 0 16px 16px;
.search-detail-btn {
color: ${L.r.colors.blue600};
font-size: 14px;
line-height: 22px;
cursor: pointer;
}
`;let SearchResult=({state:e,type:t,results:a,isLoading:r,typeInformation:o,dispatch:n})=>{let{t:s}=(0,S.u)(),{selectedLocation:p}=e,u=(0,l.useMemo)(()=>o[t].slug,[o,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${p.slug}/${u}/${e.slug}`;break;case"doctor":case"hospital":a=`/${u}/${e.slug}-${e.id}`}a&&n({type:i.NavigateTo,payload:a})};return null===a?null:l.createElement(Q,null,l.createElement(Y,{className:"search-results__body"},r&&l.createElement("div",{className:"skeleton-result"},[,,,].fill(void 0).map((e,a)=>l.createElement(J,{key:t+"loading"+a,className:2===a?"last-item":""},l.createElement("div",{className:"image-item"},l.createElement(c.O,{height:48,circle:!0,mb:"xl",animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(c.O,{height:8,mt:10,radius:"xl",animate:!0})),l.createElement("div",{className:"description"},l.createElement("div",{className:"sub-description"},l.createElement(c.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!r&&a&&a.length>0&&l.createElement(l.Fragment,null,a.map((e,r)=>{var i,n;let s=a.length>4&&3===r||a.length<=4&&r===a.length-1,c="";return("hospital"===t&&(c=(null==e?void 0:e.address)||""),"doctor"===t&&(c=(null===(i=null==e?void 0:e.specialties)||void 0===i?void 0:i.join(", "))||""),"service"===t&&(c=(null===(n=null==e?void 0:e.hospital_branch)||void 0===n?void 0:n.name)||""),r>=4)?l.createElement(l.Fragment,null):l.createElement(J,{key:e.id,className:(0,d.default)(s?"last-item":"","result-item"),onClick:()=>handleOnClick(e)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.logo||e.avatar,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name),l.createElement("div",{className:"description"},o[t].icon,l.createElement("div",{className:"sub-description"},c))))})),!r&&(null==a?void 0:a.length)===0&&l.createElement(N.T,{size:"sm",color:L.r.colors.gray400,className:"noresult-block"},s("booking.searchBar.noResults"))))},SearchResultContent=({state:e,type:t,isLoading:a,clientSlug:r,typeInformation:o,dispatch:i})=>{var n;return"search"!==e.focused?null:l.createElement(SearchResult,{type:t,state:e,results:(null===(n=e.searchResults)||void 0===n?void 0:n[t])||null,location:e.selectedLocation.name,dispatch:i,isLoading:a,typeInformation:o,clientSlug:r})},X=$.Z.div`
position: relative;
flex-shrink: 0;
${P.M.mbDown} {
width: 100%;
display: flex;
flex-direction: column;
gap: 12px;
}
&.compact {
${P.M.mbDown} {
width: auto;
display: block;
}
}
`,ee=$.Z.div`
position: absolute;
top: calc(100% + 4px);
left: 0;
min-width: 264px;
background: white;
border-radius: 12px;
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04);
z-index: 10;
overflow: hidden;
&.mobile {
min-width: 280px;
}
`,et=$.Z.div`
cursor: pointer;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 12px;
outline: none;
.image-item {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
flex-shrink: 0;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
svg {
width: 24px;
height: 24px;
}
}
.item-label {
font-size: 15px;
font-weight: 400;
line-height: 24px;
letter-spacing: -0.3px;
color: ${L.r.colors.gray800};
}
&:hover {
background-color: ${L.r.colors.neutral50};
}
&.selected {
background-color: ${L.r.colors.neutral50};
}
&:last-child {
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
}
`,DoctorIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208",fill:"#595959"})),ServiceIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068",fill:"#595959"})),HospitalIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184",fill:"#8C8C8C"})),SpecialtyIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("path",{d:"M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667",fill:"#9AA2AC"})),SearchSpecialty=({state:e,isMobile:t,onSpecialtyClick:a,dispatch:r,isCompact:o=!1})=>{let{t:n,locale:c}=(0,S.u)(),d=(0,l.useRef)(null),m=(0,l.useRef)(null),b=(0,l.useMemo)(()=>O.L[c],[c]),[v,f]=(0,l.useState)(""),[x,{close:y,toggle:w}]=(0,E.q)(!1);(0,k.a)(d,()=>{y(),f(""),r({type:i.ClickOutsideInputSpecialty})});let C=(0,l.useMemo)(()=>[{name:n("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:b.SPECIALTIES},...e.allSpecialties],[e.allSpecialties,n,b.SPECIALTIES]),I=(0,l.useMemo)(()=>v.trim()?C.filter(e=>e.name.toLowerCase().includes(v.toLowerCase().trim())):C,[C,v]),j=(0,l.useMemo)(()=>e.selectedSpecialty?e.selectedSpecialty.name:"",[e.selectedSpecialty]),$=(0,l.useCallback)(e=>{a({id:e.id,name:e.name,slug:e.slug,thumbnail:e.thumbnail||"",total_doctor:0}),y(),f("")},[a,y]),P=(0,l.useCallback)(()=>{w(),x&&f("")},[w,x]);return l.createElement(X,{ref:d,className:o?"compact":""},l.createElement(p.x,{onClick:P,className:x?"dropdown-trigger-open":"",sx:{cursor:"pointer",position:"relative",width:o?t?96:160:"100%",flexShrink:0}},l.createElement(u.I,{readOnly:!0,value:j,placeholder:n("booking.searchPopup.specialties"),rightSection:l.createElement(M.C,{style:{width:20,height:20}}),styles:Object.assign({input:{cursor:"pointer",outline:"none","&:focus":{outline:"none"},"&:not(.mantine-Textarea-input)":{height:o?40:t?40:46,fontSize:o?(0,g.h)(14):t?(0,g.h)(14):(0,g.h)(16),paddingLeft:o?12:16,paddingRight:30,background:o?"white":"transparent",border:o?`1px solid ${L.r.colors.gray200}`:"none",borderRadius:8,letterSpacing:"-0.2px",color:L.r.colors.gray800,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},rightSection:{width:30,pointerEvents:"none"}},!o&&{wrapper:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:L.r.colors.neutral100,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"}}})})),x&&l.createElement(ee,{className:t?"mobile":""},l.createElement(p.x,{sx:{padding:"12px 12px 8px"}},l.createElement(u.I,{ref:m,icon:l.createElement(s.Z,{size:18,color:L.r.colors.gray300}),placeholder:n("booking.searchBar.placeholder.specialty"),value:v,onChange:e=>f(e.target.value),size:"md",styles:{input:{height:40,fontSize:(0,g.h)(15),paddingLeft:36,"&::placeholder":{color:L.r.colors.gray400}},icon:{width:36}}})),l.createElement(h.x.Autosize,{mah:300},0===I.length?l.createElement(p.x,{sx:{padding:"12px 16px",color:L.r.colors.gray400,fontSize:14}},n("common.noResult")):I.map(t=>{var a,r;return l.createElement(et,{key:t.id,tabIndex:0,role:"option","aria-selected":(null===(a=e.selectedSpecialty)||void 0===a?void 0:a.id)===t.id,className:(null===(r=e.selectedSpecialty)||void 0===r?void 0:r.id)===t.id?"selected":"",onClick:()=>$(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),$(t))}},l.createElement("div",{className:"image-item"},t.thumbnail?l.createElement("img",{src:t.thumbnail,alt:t.name}):l.createElement(SpecialtyIcon,null)),l.createElement("span",{className:"item-label"},t.name))}))))},ea=(0,l.forwardRef)(({state:e,type:t,isMobile:a,isLoading:r,initalSearchValue:o,typeInformation:n,debouncedFetchSearchResults:c,trackingAttributes:d,hideSpecialtySelection:p=!1,clientSlug:h="",onSearch:m,onFocusInput:b,onEnterSearch:v,dispatch:f,onlyShowSearchBox:x,onChangeSpecialty:y},w)=>{let{t:E}=(0,S.u)(),C=(0,l.useRef)(null),I=(0,l.useRef)(null);(0,l.useImperativeHandle)(w,()=>({focus:()=>{var e;null===(e=I.current)||void 0===e||e.focus()}}));let j=(0,l.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),O=(0,l.useMemo)(()=>"doctor"===t?E("booking.searchBar.placeholder.doctor"):"service"===t?E("booking.searchBar.placeholder.service"):"hospital"===t?E("booking.searchBar.placeholder.hospital"):"specialty"===t?E("booking.searchBar.placeholder.specialty"):"",[t,E]),$="specialty"!==t&&"service"!==t&&!p&&!x,P=(0,l.useMemo)(()=>({input:{border:"none",background:"transparent",height:"100%",fontSize:(0,g.h)(16),color:L.r.colors.gray800,padding:"0","&::placeholder":{color:L.r.colors.gray400},"&:focus":{outline:"none",boxShadow:"none"},[a?"@media (max-width: 767px)":""]:a?{fontSize:(0,g.h)(16)}:{}},wrapper:{flex:1}}),[a]);(0,k.a)(C,()=>{a||f({type:i.ClickOutsideInputSearch})});let T=(0,l.useCallback)(function(a){f({type:i.ChangeInputSearch,payload:a}),"function"!=typeof m&&(a.trim().length>W[e.locale]||o||0===a.trim().length)&&c(a.trim(),e,t,h)},[f,e,t,o,c,h,m]),N=(0,l.useCallback)(function(e){var t;f({type:i.SelectSpecialty,payload:e}),null==y||y(e),a||null===(t=I.current)||void 0===t||t.focus()},[f,y]),M=(0,l.useCallback)(e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),v&&v())},[v]);return l.createElement(G,{ref:C},l.createElement(V,null,$&&l.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:f,debouncedFetchSearchResults:c,onSpecialtyClick:N,isCompact:!0}),l.createElement(K,null,l.createElement(s.Z,null)),l.createElement(u.I,Object.assign({ref:I,variant:"unstyled",size:a?"md":"lg",placeholder:O,styles:P,value:e.searchKeywords,name:"search-results",autoComplete:"off",onFocus:()=>{f({type:i.FocusInputSearch}),null==b||b()},onChange:e=>{T(e.target.value)},onKeyDown:M},j))),!a&&"specialty"!==t&&l.createElement(U,null,l.createElement(SearchResultContent,{type:t,state:e,dispatch:f,isLoading:r,typeInformation:n,clientSlug:h})))});ea.displayName="SearchInputs";let ModalSearchResult=e=>{var{searchInputEle:t,closeModal:a,children:r}=e,o=(0,F.a)(e,["searchInputEle","closeModal","children"]);let i=(0,m.rZ)();return l.createElement(z.M,Object.assign({},o,{zIndex:310,fullScreen:!0,styles:{content:{borderRadius:0,height:"100%",".search-results__body":{padding:0},".result-item":{paddingLeft:16,paddingRight:16},".noresult-block":{padding:16},".skeleton-result":{padding:16}},header:{display:"none"}}}),l.createElement(b.K,{spacing:16,sx:{paddingTop:16}},l.createElement(v.k,{align:"center",gap:12},l.createElement(R.Z,{size:28,onClick:a,color:i.fn.primaryColor()}),l.createElement(p.x,{sx:{width:"100%"}},t)),r))},er=$.Z.div`
position: relative;
width: 240px;
flex-shrink: 0;
${P.M.mbDown} {
width: 100%;
}
`;$.Z.div`
position: absolute;
top: calc(100% + 2px);
width: 100%;
border-radius: 4px;
background: ${L.r.colors.white};
box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
z-index: 10;
${P.M.mbDown} {
width: calc(100% + 64px);
left: -32px;
}
`;let eo=$.Z.div`
position: relative;
cursor: pointer;
padding: 12px 18px;
display: flex;
align-items: center;
gap: 14px;
overflow: hidden;
& + li::before {
content: '';
position: absolute;
left: 18px;
right: 18px;
top: 0;
height: 1px;
background-color: ${L.r.colors.neutral100};
}
&:not([data-is-denied='true']):hover {
background-color: ${L.r.colors.neutral50};
}
&:last-child:hover {
border-bottom-right-radius: 6px;
border-bottom-left-radius: 6px;
}
&:first-child:hover {
border-top-right-radius: 6px;
border-top-left-radius: 6px;
}
&[data-is-denied='true'] {
cursor: not-allowed;
}
`,ei=(0,$.Z)(C.P)`
width: 12px;
height: 18px;
flex: 0 0 12px;
`,en=(0,l.forwardRef)((e,t)=>{var{label:a,value:r}=e,o=(0,F.a)(e,["label","value"]);return l.createElement("div",Object.assign({ref:t},o),l.createElement(eo,{key:r,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},l.createElement(ei,{color:L.r.colors.neutral400}),l.createElement(f.x,{size:"md"},a)))}),SearchLocation=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:r,onLocationClick:o,dispatch:n})=>{var s;let{t:c,locale:d}=(0,S.u)(),p=(0,l.useRef)(null),u=(0,l.useMemo)(()=>{var t;return[{name:c("booking.searchBar.allLocations"),id:O.I,slug:null===(t=O.L[d])||void 0===t?void 0:t.ALL},...e.cities]},[e.cities,c,d]),h=(0,l.useMemo)(()=>r?{"data-event-category":r.dataEventCategory,"data-event-action":r.dataEventAction,"data-event-label":r.dataEventLabel}:{},[r]),m=(0,l.useCallback)(function(a){n({type:i.ChangeInputLocation,payload:a}),a.trim().length>W[e.locale]?t(a.trim()):(t.cancel(),n({type:i.DisplayInitialCities}))},[t,n,e.locale]);(0,k.a)(p,()=>{n({type:i.ClickOutsideInputLocation})});let b=null!==(s=null==a?void 0:a.id)&&void 0!==s?s:null,v=null===b?void 0:String(b);return l.createElement(er,{ref:p},l.createElement(x.Ph,Object.assign({key:null!=v?v:"no-selected-location",defaultValue:v,placeholder:c("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{m(e)},onFocus:()=>{n({type:i.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),n({type:i.DisplayInitialCities})},nothingFound:c("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",icon:l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),rightSection:l.createElement(M.C,{style:{width:20,height:20}})},h,{styles:()=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"#F7F9FC",color:"inherit"},".location-item":{"&::after":{content:C.i,top:"50%",right:19,position:"absolute",transform:"translateY(-50%)"}}},"&[data-hovered]":{backgroundColor:"transparent"}},root:{width:"100%"},wrapper:{width:"100%"},input:{"&:not(.mantine-Textarea-input)":{height:48,fontSize:(0,g.h)(15),fontWeight:400,letterSpacing:"-0.3px",color:L.r.colors.gray1000,paddingLeft:44,paddingRight:40,background:"white",border:`1px solid ${L.r.colors.gray200}`,borderRadius:12}},icon:{width:44,paddingLeft:12},rightSection:{width:40,paddingRight:12},itemsWrapper:{padding:0},dropdown:{left:"0 !important",border:0,marginTop:4,borderRadius:12,overflow:"hidden",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)","& ::-webkit-scrollbar":{width:"6px",height:"6px"}}}),itemComponent:en,filter:()=>!0,onChange:e=>{if(null==e)return;let a=u.find(t=>String(t.id)===e);a&&(o(a),t.cancel(),n({type:i.DisplayInitialCities}),setTimeout(()=>{var e,t;null===(t=null===(e=p.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()},0))},data:u.map(e=>({value:String(e.id),label:e.name,city:e}))})))},el=$.Z.div`
display: flex;
flex-wrap: wrap;
row-gap: 8px;
column-gap: 20px;
${P.M.mbDown} {
margin-top: 12px;
}
`,es=$.Z.div`
display: flex;
align-items: center;
border-radius: 8px;
border: 1px solid ${L.r.colors.neutral100};
background: ${L.r.colors.white};
padding: 8px 12px 8px 8px;
flex: 0 0 calc(33.3% - 13px);
gap: 12px;
cursor: pointer;
&:hover {
background: ${L.r.colors.blue50};
}
${P.M.tdDown} {
flex: 0 0 calc(50% - 10px);
}
${P.M.mbDown} {
flex: 0 0 100%;
border: none;
}
.image-item {
display: flex;
align-items: center;
width: 40px;
height: 40px;
img {
width: 100%;
object-fit: cover;
}
}
.infor {
flex: 1;
.title {
color: ${L.r.colors.gray800};
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
}
.description {
color: ${L.r.colors.gray600};
font-size: 12px;
font-weight: 400;
line-height: 18px;
}
}
`,ec=(0,$.Z)(y.i)`
margin: 24px 0 !important;
`,ed=$.Z.div`
display: flex;
justify-content: center;
margin-top: 24px;
.show-more {
border-radius: 4px;
border: 1px solid ${L.r.colors.neutral200};
padding: 12px 16px;
cursor: pointer;
display: inline-block;
color: ${L.r.colors.gray800};
font-size: 16px;
font-weight: 600;
line-height: 24px;
${P.M.mbDown} {
width: 100%;
text-align: center;
}
}
`,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:r,dispatch:o})=>{let{t:n,locale:s}=(0,S.u)(),{selectedLocation:d}=e,p=(0,l.useMemo)(()=>O.L[s],[s]),handleOnClick=e=>{let t="";e===O.S?(t=`/${d.slug}/${p.HOSPITAL}/${O.C.GSK}/`,o({type:i.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${p.DOCTOR}/${e}`,o({type:i.NavigateTo,payload:t})},u=(0,l.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=W[e.locale],[e.searchKeywords,a]);return l.createElement(l.Fragment,null,!t&&l.createElement(ec,{color:"#E4E8EC"}),l.createElement(el,null,a.length>0&&!r&&l.createElement(l.Fragment,null,a.map((e,t)=>t>=9?l.createElement(l.Fragment,null):l.createElement(es,{key:e.id,onClick:()=>handleOnClick(e.slug)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.thumbnail,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name))))),0===a.length&&!r&&l.createElement(N.T,{size:"sm",color:L.r.colors.gray400},n("booking.searchBar.noResults")),r&&Array(6).fill(void 0).map((e,t)=>l.createElement(es,{key:"loading"+t},l.createElement("div",{className:"image-item"},l.createElement(c.O,{height:40,animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(c.O,{height:20,radius:"sm",animate:!0})))))),u&&l.createElement(ed,null,l.createElement("div",{className:"show-more",onClick:()=>{let e=`/${p.SPECIALTIES}`;o({type:i.NavigateTo,payload:e})}},n("home.seeAll"))))},ep=$.Z.div`
display: flex;
gap: 5px;
margin-top: 16px;
flex-wrap: wrap;
`,eu=$.Z.div`
color: ${L.r.colors.gray600};
font-size: 14px;
font-weight: 600;
line-height: 22px;
padding: 4px 12px;
background: ${L.r.colors.white};
border-radius: 32px;
cursor: pointer;
border: 1px solid ${L.r.colors.white};
margin-bottom: 5px;
border-color: ${L.r.colors.neutral100};
background: #f7f9fc;
&.view-all {
border-radius: 32px;
border-color: ${L.r.colors.blue50};
background: ${L.r.colors.blue50};
color: ${L.r.colors.blue600};
&:hover {
border-color: ${L.r.colors.blue50};
background: ${L.r.colors.blue50};
color: ${L.r.colors.blue600};
}
}
&:hover {
border-color: ${L.r.colors.neutral100};
background: #f7f9fc;
}
`,eg=$.Z.div`
color: ${L.r.colors.gray600};
font-size: 14px;
font-weight: 600;
line-height: 22px;
padding: 4px 0;
background: ${L.r.colors.white};
border-radius: 32px;
border: 1px solid ${L.r.colors.white};
margin-bottom: 5px;
margin-right: 7px;
`,SearchTag=({state:e,type:t,typeInformation:a,dispatch:r})=>{let{t:o}=(0,S.u)(),{selectedLocation:n}=e,s=(0,l.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return l.createElement(ep,null,l.createElement(eg,null,o("booking.searchBar.popularKey")),e.popularKeys.map(e=>l.createElement(eu,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),l.createElement(eu,{className:"view-all",onClick:()=>{let e=`/${n.slug}/${s}`;e&&r({type:i.NavigateTo,payload:e})}},o("booking.searchBar.viewAll")))},eh=$.Z.div`
background: rgba(255, 255, 255, 0.64);
backdrop-filter: blur(12px);
border-bottom: 1px solid ${L.r.colors.neutral100};
`,em=(0,$.Z)(T.C)`
padding: 0 16px;
`,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:r,setCurrentTab:o})=>{let{t:i}=(0,S.u)(),n=(0,l.useMemo)(()=>({root:{overflowY:r?"hidden":"initial",overflowX:r?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:r?"12px 16px 12px 16px":"15px 40px 15px 40px",borderTop:"2px solid transparent",borderBottom:"none",margin:0,borderRadius:0,position:"relative",width:"auto",'&[data-active="true"]':{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:after":{display:"none"},"&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:hover":{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:after":{content:'""',width:"1px",height:"24px",backgroundColor:"#E4E8EC",position:"absolute",right:"-1px"}},tabLabel:{color:"#595959",fontSize:r?"14px":"16px",fontWeight:600,lineHeight:r?"22px":"24px"}}),[r]),s=(0,l.useMemo)(()=>[{value:"hospital",label:i("booking.searchPopup.hospitals")},{value:"doctor",label:i("booking.searchPopup.doctors")},{value:"service",label:i("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:i("booking.searchPopup.specialties")}]],[a]),c=(0,l.useMemo)(()=>s.filter(e=>!t.includes(e.value))||[],[t,s]);return l.createElement(eh,{className:"booking-search-tab"},l.createElement(em,null,l.createElement(w.m,{value:e,onTabChange:e=>{o(e)},styles:n},l.createElement(w.m.List,null,c.map(e=>l.createElement(w.m.Tab,{value:e.value,key:e.value},e.label))))))};(o=n||(n={})).doctor="doctor",o.service="hospital_service",o.hospital="hospital_branch";let ignoreCacarSpecialty=e=>e.filter(e=>"string"==typeof e?"cacar-api"!==e:(null==e?void 0:e.id)!==232),BookingSearchBarV3=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:r,initialSelectedCity:o,initialSearchValue:c="",initTypeSearch:d="hospital",initSpecialty:u,careFrontDomain:g="/care",isDebug:h=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:b,autoCompleteDisabled:f=!1,inputSearchPlaceholder:x="",hideTabBookingSearch:y=[],hideSpecialtySelection:w=!1,hideSpecialtyTab:I=!1,hidePopularSearchKeys:$=!1,clientSlug:L="",triggerSearchWhenChangeFilter:P,routerPush:T,onGeoLocationPermissionChange:N,onChangeLocation:M})=>{var F;let{locale:R,t:z}=(0,S.u)(),G=(0,l.useRef)(null),V=(0,l.useRef)(null),K=(0,l.useRef)(null),U=(0,l.useRef)(null),[Q,Y]=(0,l.useState)(d),{geoLocationPermission:J,geoLocationCoordinates:X}=(0,C.u)(),[ee,et]=(0,l.useReducer)(reducer,q,t=>Object.assign(Object.assign({},t),{isDebug:h,isMobile:e,geoLocationPermission:a||J||"unset",geoLocationCoordinates:r||X||null,searchKeywords:c,initialSelectedCity:o||null,selectedLocation:o||t.selectedLocation||null,searchLocationKeywords:(null==o?void 0:o.name)||t.searchLocationKeywords,autoCompleteDisabled:f,inputSearchPlaceholder:x,locale:R})),{navigateTo:er,focusedSpecialty:eo,searchKeywords:ei,geoLocationPermission:en,selectedLocation:el,initialSelectedCity:es,searchResults:ec,isLoadingSearchResults:ed}=ee,{fetchCitiesByLocation:ep,fetchCitiesByKeyword:eu,fetchSearchResults:eg,fetchAllSpecialties:eh,fetchPopularKeys:em}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:r=""}){let o=(0,l.useCallback)(function(r,o={}){let n=`${t}${r}`;return e({type:i.FetchCitiesStart}),fetch((0,C.h)(n,o,a),{method:"GET"}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))).finally(()=>e({type:i.FetchCitiesFinish}))},[a]),s=(0,l.useCallback)(function({coordinates:t}){let n={},l={};t&&(n={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(l.noPaging=1);let s=[o(B.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},n),l),{hospitalActive:1,client:O.C.MSD===r?"":r}))];return"zh-TW"===a?s.push(o(B.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1,client:O.C.MSD===r?"":r})):s.push(o(B.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1})),Promise.all(s).then(([t,a])=>{let r=Object.assign({},t);if(a){let e=r.cities.map(e=>e.id);r.cities=r.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:i.FetchCitiesByGeoIpComplete,payload:r})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),c=(0,l.useCallback)(function(t){return o(B.P.GET_CITIES_LIST,{keyword:t,client:r}).then(t=>{e({type:i.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,l.useCallback)(function(o,n,l,s,c){let d="specialty"===l?`${t}${B.P.GET_SEARCH_SPECIALTY}`:`${t}${B.P.GET_SEARCH_V2}`;e({type:i.FetchSearchResultsStart});let{selectedLocation:p,geoLocationCoordinates:u,selectedSpecialty:g}=n,h="";if(!p){e({type:i.FetchSearchResultsFinish});return}h=p.id===O.I?"":p.id;let m=(null==u?void 0:u.lat)||"",b=(null==u?void 0:u.lng)||"",v=(null==g?void 0:g.id)>0?null==g?void 0:g.id:"",f=o.trim().length>W[a]?o.trim():"";return fetch((0,C.h)(d,Object.assign({domain:t,searchType:l||"global",keyword:f,city:h===O.a?"":h,lat:m,lng:b,specialty_id:v,client_slug:O.C.MSD===s?"":s,msd:O.C.MSD===r?1:""},"doctor"===l&&{skipBooking:1}),a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{let a=[];"specialty"!==l&&(a="doctor"===l?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===l&&(a=f?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:i.FetchSearchResultsComplete,payload:{key:l,searches:a||[]}}),c&&e({type:i.UpdateInitialSearchResults,payload:{key:l,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:i.FetchSearchResultsFinish}))},[a,t,e]),p=(0,l.useCallback)(function(){let o=`${t}${B.P.GET_SEARCH_SPECIALTY}`;return fetch((0,C.h)(o,{domain:t,searchType:"",msd:O.C.MSD===r?1:""},a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:i.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]),u=(0,l.useCallback)(function(r){let o=`${t}${B.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,C.h)(o,{domain:t,searchType:n[r],sort_by:"display_order",sort_order:"asc"},a)).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:i.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]);return{fetchCitiesByLocation:s,fetchCitiesByKeyword:c,fetchSearchResults:d,fetchAllSpecialties:p,fetchPopularKeys:u}}({dispatch:et,locale:R,careApiDomain:t,client:L}),eb=(0,l.useMemo)(()=>O.L[R],[R]),[ev,{close:ef,open:ex}]=(0,E.q)(!1),ey=(0,l.useMemo)(()=>Object.assign({doctor:{name:z("booking.searchPopup.doctors"),icon:l.createElement(DoctorIcon,null),slug:eb.DOCTOR},service:{name:z("booking.searchPopup.services"),icon:l.createElement(ServiceIcon,null),slug:eb.SERVICE},hospital:{name:z("booking.searchPopup.hospitals"),icon:l.createElement(HospitalIcon,null),slug:eb.HOSPITAL}},!I&&{specialty:{name:z("booking.searchPopup.specialties"),icon:l.createElement(SpecialtyIcon,null),slug:eb.SPECIALTIES}}),[Q]),ew=(0,l.useMemo)(()=>j()(eu,400),[eu]),eE=(0,l.useMemo)(()=>j()(eg,400),[eg]),eC=(0,l.useCallback)(function({locationSlug:e,specialtyId:t}={}){var a;ef();let r="",{slug:o}=ey[Q],n="",l=O.M[R][L],s=t||(null===(a=ee.selectedSpecialty)||void 0===a?void 0:a.id)||-1,c=e||(null==el?void 0:el.slug)||"";("doctor"===Q||"hospital"===Q)&&s>0&&(n=`&specialtyId=${s}`),r="specialty"===Q?`/${o}`:`/${c}/${o}`,l&&(r+=`/${l}`),(r+=`?q=${ei}${n}`)&&et({type:i.NavigateTo,payload:r})},[L,ef,Q,et,R,ei,null==el?void 0:el.slug,null===(F=ee.selectedSpecialty)||void 0===F?void 0:F.id,ey]),ek=(0,l.useCallback)(function(e){P&&eC({locationSlug:e.slug}),et({type:i.SelectLocation,payload:e}),M&&M(e)},[et,e,M,eC,P]);(0,k.a)(U,()=>{e||et({type:i.ClickOutsideInputSearchSpecialty})}),(0,l.useEffect)(()=>{var t;"denied"===en||es||et({type:i.SelectLocation,payload:{name:z("booking.searchBar.allLocations"),id:O.I,slug:null===(t=O.L[R])||void 0===t?void 0:t.ALL}}),N&&N(en,ee.geoLocationCoordinates),e&&"granted"===en&&el&&et({type:i.FocusInputSearch}),ep({coordinates:ee.geoLocationCoordinates})},[en]),(0,l.useEffect)(()=>{var e;let t=u||{name:z("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:eb.SPECIALTIES};if(u){(null===(e=ee.selectedSpecialty)||void 0===e?void 0:e.id)!==u.id&&et({type:i.SelectSpecialty,payload:u});return}ee.selectedSpecialty&&ee.selectedSpecialty.id===t.id||et({type:i.SelectSpecialty,payload:t})},[u,eb.SPECIALTIES,z]),(0,l.useEffect)(()=>{eh()},[]),(0,l.useEffect)(()=>{em(Q)},[Q]),(0,l.useEffect)(()=>{er&&(T?T(er):window.location.href=`${g}${er}`)},[er]),(0,l.useEffect)(()=>{eg(ee.searchKeywords,ee,Q,L,!0)},[Q]),(0,l.useEffect)(()=>{if(ev&&e){let e=setTimeout(()=>{var e;null===(e=K.current)||void 0===e||e.focus()},150);return()=>clearTimeout(e)}},[ev,e]);let eS={type:Q,isMobile:e,state:ee,dispatch:et,debouncedFetchSearchResults:eE,initalSearchValue:c,onEnterSearch:eC,typeInformation:ey,trackingAttributes:m,isLoading:ed,hideSpecialtySelection:w||I,clientSlug:L,triggerSearchWhenChangeFilter:P,onChangeSpecialty:e=>P&&eC({specialtyId:e.id})};return l.createElement(l.Fragment,null,l.createElement(A,{ref:G},l.createElement(TabSearch,{currentTab:Q,setCurrentTab:Y,isMobile:e,hideTabBookingSearch:y,hideSpecialtyTab:I}),l.createElement(_,{className:"booking-search-container"},l.createElement(Z,null,l.createElement(H,{className:"booking-search-content"},l.createElement("div",{ref:U},l.createElement(v.k,{gap:"12px",align:"center",className:"flex-search-input"},l.createElement(ea,Object.assign({},eS,{ref:V,onFocusInput:()=>e&&ex()})),"specialty"!==Q&&l.createElement(SearchLocation,{state:ee,isMobile:e,dispatch:et,debouncedFetchCitiesByKeyword:ew,selectedLocation:el,onLocationClick:ek,trackingAttributes:b}),!e&&l.createElement(D.B,{size:"lg",variant:"primary",onClick:()=>eC(),styles:{root:{height:"48px",minWidth:"120px",borderRadius:"12px"}}},z("booking.searchBar.searchButton"))),!$&&"specialty"!==Q&&ee.popularKeys.length>0&&l.createElement(SearchTag,{type:Q,state:ee,typeInformation:ey,dispatch:et}),"specialty"===Q&&"search"===eo&&l.createElement(SearchResultSpecialties,{state:ee,isMobile:e,dispatch:et,specialties:(null==ec?void 0:ec.specialty)||[],isLoading:ed})))))),e&&l.createElement(ModalSearchResult,{keepMounted:!0,opened:ev,onClose:ef,closeModal:ef,searchInputEle:l.createElement(v.k,{align:"center",gap:8},l.createElement(ea,Object.assign({},eS,{onlyShowSearchBox:!0,ref:K})),l.createElement(D.B,{variant:"primary",leftIcon:l.createElement(s.Z,{size:20,color:"#fff"}),onClick:()=>eC(),styles:{root:{borderRadius:"12px"}}}))},l.createElement(p.x,{sx:{marginLeft:-16,marginRight:-16}},l.createElement(SearchResultContent,{type:Q,state:ee,dispatch:et,isLoading:ed,typeInformation:ey,clientSlug:L}))))},eb=$.Z.div`
background-color: var(--neutral50);
padding: 12px 0;
box-shadow: inset 0px 1px 0px #e4e8ec;
> * {
display: grid;
grid-template-columns: 32px 1fr;
align-content: center;
p {
font-weight: 600;
}
}
.icon-wrapper {
display: flex;
align-items: center;
}
`,TextDivider=({children:e,icon:t,className:a,style:r})=>l.createElement(eb,{style:r,className:a},l.createElement(T.C,null,l.createElement("div",{className:"icon-wrapper"},t),l.createElement(N.T,{size:"c1",color:"var(--neutral800)"},e)))},mpds:function(e,t,a){a.d(t,{C:function(){return Container}});var r=a("q1tI");let Container=({children:e,className:t,style:a,type:o})=>r.createElement("div",{className:`d76E4SH ${t||""}`,style:a,"data-type":o},e)},DSvu:function(e,t,a){a.d(t,{i:function(){return isVideo}});let isVideo=e=>e.endsWith(".mp4")},RlpF:function(e,t,a){a.d(t,{B:function(){return g}});var r=a("T/vS"),o=a("q1tI"),i=a("/npG"),n=a("HC7W"),l=a("8vDj"),s=a("mAfZ"),c=a("K9Tt"),d=a("HC5J"),p=(0,i.k)((e,t)=>{var a,r,o,i,l,s;let{other:p}=e,{template:u}=p,{size:g,variant:h,skipHover:m,withColorHover:b,isError:v,isSuccess:f,color:x,gradient:y,children:w,theme:E,customStylesType:C}=t,k="mb"===u||"marryBaby"===E,S=x||(E&&k?"mb":e.primaryColor),I=S.startsWith("#"),j=I?e.fn.lighten(x,.9):(null===(r=null===(a=e.colors)||void 0===a?void 0:a[S])||void 0===r?void 0:r[0])||"",O=I?S:null===(i=null===(o=e.colors)||void 0===o?void 0:o[S])||void 0===i?void 0:i[e.fn.primaryShade()],$=I?e.fn.darken(x,.05):null===(s=null===(l=e.colors)||void 0===l?void 0:l[S])||void 0===s?void 0:s[e.fn.primaryShade()+1],L=C===d.C.LEADGEN;return{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({transition:`all ${c.A} ease-in-out`},y&&Object.assign({border:0,position:"relative"},"secondary"===h&&{"&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#fff",borderRadius:"inherit"}})),{"&:focus":{outline:"none"}}),L&&{borderRadius:12}),!w&&{paddingLeft:"10px",paddingRight:"10px",".mantine-Button-icon":{margin:0}}),(()=>{switch(g){case"xl":return Object.assign({height:56,fontWeight:L?d.F.halfBold:d.F.semiBold,fontSize:L?"15px":k?"14px":"16px",lineHeight:"24px"},L&&{letterSpacing:"-0.3px"});case"lg":return Object.assign({height:48,fontWeight:L?d.F.halfBold:d.F.semiBold,fontSize:L?"15px":k?"14px":"16px",lineHeight:"24px"},L&&{letterSpacing:"-0.3px"});case"md":return Object.assign({height:40,fontWeight:L?d.F.halfBold:d.F.semiBold,fontSize:L?"13px":"14px",lineHeight:L?"20px":"22px"},L&&{letterSpacing:"-0.3px"});case"sm":return Object.assign(Object.assign({height:32,fontWeight:L?d.F.halfBold:d.F.semiBold,fontSize:L?"11px":k?"12px":"14px",lineHeight:L?"16px":"22px"},L&&{letterSpacing:"-0.2px"}),{paddingLeft:"16px",paddingRight:"16px"});case"xs":return Object.assign({height:24,fontWeight:L?d.F.halfBold:d.F.semiBold,fontSize:L?"11px":"12px",lineHeight:L?"16px":"18px",paddingLeft:"8px",paddingRight:"8px"},L&&{letterSpacing:"-0.2px"})}})()),(()=>{switch(h){case"primary":return Object.assign(Object.assign({color:e.white},y?{backgroundImage:y,backgroundColor:"initial"}:{backgroundColor:O}),!m&&{"&:hover":{backgroundColor:y?"initial":$}});case"secondary":return Object.assign(Object.assign(Object.assign({color:O,backgroundColor:"transparent",border:`1px solid ${O}`},y&&{backgroundImage:y,borderColor:"transparent"}),!m&&!y&&{"&:hover":{backgroundColor:j,border:`1px solid ${O}`}}),b&&!y&&{"&:hover":{backgroundColor:O,border:`1px solid ${O}`,color:"#fff"}});case"white":return{color:O,backgroundColor:"transparent",border:"1px solid transparent","&:hover":{backgroundColor:"transparent",borderColor:"transparent"}};case"tertiary":return{color:e.colors.gray[8],backgroundColor:e.white,border:`1px solid ${e.colors.neutral[2]}`,"&:hover":Object.assign({},m?{backgroundColor:e.white,border:`1px solid ${e.colors.neutral[2]}`}:{backgroundColor:e.colors.neutral[0],border:`1px solid ${e.colors.neutral[0]}`})};case"light":return{color:O,backgroundColor:j,border:"1px solid transparent","&:hover":Object.assign({},m?{backgroundColor:j,border:"1px solid transparent"}:{backgroundColor:e.white,border:`1px solid ${j}`})};case"ghost":return Object.assign({color:O,backgroundColor:"transparent",border:"1px solid transparent"},!m&&{"&:hover":{backgroundColor:j,border:"1px solid transparent"}})}})()),{"&[data-disabled]":{backgroundColor:e.colors.gray[1],color:e.colors.gray[4]}}),v?Object.assign({color:e.colors.red[6],backgroundColor:e.white,border:`1px solid ${e.colors.red[6]}`},!m&&{"&:hover":{backgroundColor:e.colors.red[0],border:`1px solid ${e.colors.red[6]}`}}):{}),f?Object.assign({color:e.colors.green[8],backgroundColor:e.colors.green[0]},!m&&{"&:hover":{backgroundColor:e.colors.green[0]}}):{}),inner:Object.assign({ref:(0,n.A)("inner")},y&&{position:"relative"}),leftIcon:{marginRight:8},rightIcon:{},label:Object.assign({},y&&"secondary"===h&&{background:y,"-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"})}});let u={primary:"filled",secondary:"outline",tertiary:"default",light:"light",ghost:"subtle",error:"outline",white:"white",success:"subtle"},g=(0,o.forwardRef)((e,t)=>{var a,i;let n=(0,l.rZ)(),c=Object.assign(Object.assign({},null===(i=null===(a=n.components)||void 0===a?void 0:a.Button)||void 0===i?void 0:i.defaultProps),function(e){let t={};return Object.keys(e).filter(t=>void 0!==e[t]).forEach(a=>t[a]=e[a]),t}(e)),{variant:g,size:h,color:m,gradient:b,skipHover:v,withColorHover:f,className:x,dataEventCategory:y,dataEventAction:w,dataEventLabel:E,children:C,theme:k,component:S,styles:I,classNames:j}=c,O=(0,r.a)(c,["variant","size","color","gradient","skipHover","withColorHover","className","dataEventCategory","dataEventAction","dataEventLabel","children","theme","component","styles","classNames"]),$="error"===g,L=(0,d.u)(),{classes:P,cx:T}=p({variant:g,size:h,color:m,gradient:b,skipHover:v,withColorHover:f,isError:$,isSuccess:"success"===g,children:C,theme:k,customStylesType:L},{name:"ButtonMantine",styles:I,classNames:j});return o.createElement(s.z,Object.assign({component:S,className:T(x,g),classNames:{root:P.root,inner:P.inner,leftIcon:P.leftIcon,rightIcon:P.rightIcon,label:P.label},variant:u[g],"data-variant":g,"data-event-category":y,"data-event-action":w,"data-event-label":E,ref:t,loaderProps:O.disabled?{color:"currentColor"}:void 0},O),C)})},"3rb+":function(e,t,a){a.d(t,{C:function(){return Close},D:function(){return DrawerComponent},u:function(){return useDrawerDrag}});var r=a("q1tI"),o=a("T/vS"),i=a("iuhU"),n=a("rSBk"),l=a("rBCA"),s=a("qFhO");let Close=e=>r.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},e),r.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),c=300,useDrawerDrag=(e=c)=>{let[t,a]=(0,r.useState)(!1),o=(0,r.useCallback)(()=>{a(!0)},[]),i=(0,r.useCallback)(()=>{setTimeout(()=>{a(!1)},e)},[e]);return{isDragging:t,handleDragStart:o,handleDragEnd:i}},d=(0,l.Z)(n.dy.Content)`
position: fixed;
z-index: ${s.c-9e6+1};
inset: 0;
background-color: #fff;
outline: none !important;
&::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.4);
border-radius: 6px;
}
&[data-vaul-drawer-direction='bottom'] {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
&[data-vaul-drawer-direction='top'] {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
&[data-vaul-drawer-direction='left'] {
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
}
&[data-vaul-drawer-direction='right'] {
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
${e=>e.isDragging&&`
input {
caret-color: transparent;
}
`}
`,p=(0,l.Z)(n.dy.Overlay)`
position: fixed;
inset: 0;
z-index: ${s.c-9e6};
width: 100%;
max-height: 100%;
&[data-state='open'] {
opacity: 0.6 !important;
}
`,DrawerComponent=e=>{let{open:t,onOpenChange:a,snapPoints:l,activeSnapPoint:c,setActiveSnapPoint:u,children:g,overlayClassName:h,className:m,fadeFromIndex:b=s.c-9e6,onClose:v}=e,f=(0,o.a)(e,["open","onOpenChange","snapPoints","activeSnapPoint","setActiveSnapPoint","children","overlayClassName","className","fadeFromIndex","onClose"]),[x,y]=(0,r.useState)(t),[w,E]=(0,r.useState)(l?null==l?void 0:l[0]:null),{isDragging:C,handleDragStart:k,handleDragEnd:S}=useDrawerDrag(),I=(0,r.useCallback)(e=>{y(e),null==a||a(e)},[a]),j=(0,r.useMemo)(()=>l&&l.length?w===l[l.length-1]:x,[w,l]),O=(0,r.useMemo)(()=>{let e={open:x,onOpenChange:I,fadeFromIndex:b};return l&&(null==l?void 0:l.length)&&(e.snapPoints=l,e.activeSnapPoint=w,e.setActiveSnapPoint=e=>{E(e),null==u||u(e)}),e},[x,I,w,E,u,l,b]);return(0,r.useEffect)(()=>{y(t)},[t]),(0,r.useEffect)(()=>{E(c)},[c]),r.createElement(n.dy.Root,Object.assign({onDrag:k,onRelease:S,onClose:v},f,O),r.createElement(n.dy.Portal,null,r.createElement(p,{className:(0,i.default)(h,"drawer__overlay",{drawer__overlay_full:j})}),r.createElement(d,{isDragging:C,className:(0,i.default)(m,"drawer__content",{drawer__content_full:j})},r.createElement(n.dy.Handle,{className:"drawer__handle"}),r.createElement(n.dy.Title,{style:{display:"none"}}),g)))}},pEwG:function(e,t,a){a.d(t,{A:function(){return Alert},B:function(){return Badge},C:function(){return CardCollapse},D:function(){return DragFreeCarousel},F:function(){return FileDropdown},G:function(){return Grid},H:function(){return HtmlContent},I:function(){return IconHeading},R:function(){return Radio},S:function(){return StepRenderer},T:function(){return Tag},U:function(){return Upload},a:function(){return BorderHeading},b:function(){return RateStars},c:function(){return Toggle},d:function(){return Z},e:function(){return Q},f:function(){return i},g:function(){return n}});var r,o,i,n,l=a("q1tI"),s=a("dDw1"),c=a("rBCA"),d=a("iBNF"),p=a("un+D"),u=a("4JiQ"),g=a("mYVa"),h=a("iuhU"),m=a("Iblh"),b=a("07+u"),v=a("SMDy"),f=a("T/vS"),x=a("cFN4"),y=a("gEnE"),w=a("yVya"),E=a("Mjd7"),C=a("3rb+"),k=a("Z+18"),S=a("Zdfy");let Upload=e=>l.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"none"},e),l.createElement("path",{d:"M9.82324 8.7033L10.8228 9.70287C10.9267 9.80662 11.056 9.8573 11.2107 9.85493C11.3655 9.85255 11.4948 9.79943 11.5987 9.69555C11.7026 9.59168 11.7545 9.46074 11.7545 9.30274C11.7545 9.14474 11.7026 9.01462 11.5987 8.91237L9.7353 7.04899C9.59968 6.91337 9.44149 6.84555 9.26074 6.84555C9.07999 6.84555 8.9218 6.91337 8.78618 7.04899L6.91549 8.91968C6.81174 9.02355 6.75987 9.15287 6.75987 9.30762C6.75987 9.46237 6.81174 9.59168 6.91549 9.69555C7.01937 9.79943 7.1503 9.85137 7.3083 9.85137C7.4663 9.85137 7.59643 9.79943 7.69868 9.69555L8.69824 8.7033L8.69824 11.5576C8.69824 11.717 8.75218 11.8506 8.86005 11.9583C8.96793 12.0662 9.10156 12.1201 9.26093 12.1201C9.42043 12.1201 9.55399 12.0662 9.66162 11.9583C9.76937 11.8506 9.82324 11.717 9.82324 11.5576L9.82324 8.7033ZM16.3857 9.3063C16.3857 10.2918 16.1987 11.2181 15.8247 12.0852C15.4507 12.9524 14.9432 13.7066 14.3021 14.348C13.6609 14.9894 12.907 15.4972 12.0402 15.8714C11.1735 16.2456 10.2474 16.4326 9.26205 16.4326C8.27655 16.4326 7.35024 16.2456 6.48312 15.8716C5.61599 15.4976 4.86174 14.9901 4.22037 14.3489C3.57899 13.7078 3.07118 12.9539 2.69693 12.0871C2.3228 11.2204 2.13574 10.2943 2.13574 9.30893C2.13574 8.32343 2.32274 7.39712 2.69674 6.52999C3.07074 5.66287 3.5783 4.90862 4.21943 4.26724C4.86055 3.62587 5.61449 3.11805 6.48124 2.7438C7.34799 2.36968 8.27405 2.18262 9.25943 2.18262C10.2449 2.18262 11.1712 2.36962 12.0384 2.74362C12.9055 3.11762 13.6597 3.62518 14.3011 4.2663C14.9425 4.90743 15.4503 5.66137 15.8246 6.52812C16.1987 7.39487 16.3857 8.32093 16.3857 9.3063ZM15.2607 9.30762C15.2607 7.63262 14.6795 6.21387 13.517 5.05137C12.3545 3.88887 10.9357 3.30762 9.26074 3.30762C7.58574 3.30762 6.16699 3.88887 5.00449 5.05137C3.84199 6.21387 3.26074 7.63262 3.26074 9.30762C3.26074 10.9826 3.84199 12.4014 5.00449 13.5639C6.16699 14.7264 7.58574 15.3076 9.26074 15.3076C10.9357 15.3076 12.3545 14.7264 13.517 13.5639C14.6795 12.4014 15.2607 10.9826 15.2607 9.30762Z",fill:"#595959"})),Alert=({style:e,onClose:t,text:a,type:r,contentIcon:o,closeIcon:i,className:n,description:c})=>l.createElement("div",{className:`CHw-fZZ ${n||""}`,style:e,"data-alert-type":r},l.createElement("div",{className:"_03U6VRS"},l.createElement("div",{className:"icon-title"},o,l.createElement(s.T,{weight:"bold",size:"label1"},a)),l.createElement(s.T,{weight:"regular",size:"p3"},c)),l.createElement("div",{className:"EO828Vv",onClick:t},i)),renderNotificationStyles=(e,t,a,r)=>{let o,i="";if("numeric"===e)switch(t){case"medium":i=`
height: 16px;
font-size: 11px;
padding: 1px 6px;
`;case"large":i=`
height: 24px;
font-size: 13px;
padding: 1px 10px;
`}let n="";a&&(n=`
position: absolute;
top: 0;
left: 75%;
`),a&&(o=`
left: 70%;
${"large"===t?`
top: -7px;
`:"medium"===t?`
top: -2px;
width: 16px;
height: 16px;
`:""}
`);let l="";switch(r){case"primary":l=`
background: ${d.r.colors.primary50};
color: ${d.r.colors.primary600};
`;break;case"error":l=`
background: ${d.r.colors.error};
color: white;
`}switch(e){case"dot":return`
${n}
width: 8px;
height: 8px;
font-size: 0px;
border-radius: 50%;
${l}
`;case"numeric":return`
${n}
width: max-content;
border-radius: 32px;
${i}
${o}
${l}
`}},I=c.Z.div`
position: relative;
> div {
width: max-content;
position: relative;
}
span {
font-weight: ${d.r.sizes.fwBold};
display: flex;
justify-content: center;
align-items: center;
${e=>renderNotificationStyles(e.notificationType,e.notificationSize,e.hasIcon,e.notificationColor)}
}
${e=>e.hasIcon&&`
svg {
width: 40px;
height: 40px;
}
`}
`,Badge=({amount:e,type:t,size:a="medium",color:r="primary",icon:o,className:i})=>l.createElement(I,{"data-notification-type":t,"data-notification-size":a,"data-notification-color":r,"data-has-icon":!!o||void 0,notificationType:t,notificationSize:a,notificationColor:r,hasIcon:!!o,className:i},l.createElement("div",null,e&&l.createElement("span",null,e)," ",o&&l.createElement("div",null,o))),j=c.Z.h4`
position: relative;
line-height: 18px;
&:after {
position: absolute;
top: 1px;
left: 0;
width: 4px;
height: 18px;
background-color: ${d.r.colors.primaryBase};
content: '';
}
&[data-size='lg'] {
font-size: 18px;
padding-left: 12px;
}
&[data-size='sm'] {
font-size: 14px;
padding-left: 8px;
&::after {
width: 2px;
height: 15px;
}
}
&[data-type='bold'] {
font-weight: ${d.r.sizes.fwBold};
}
&[data-type='semiBold'] {
font-weight: ${d.r.sizes.fwSemiBold};
}
&[data-uppercase] {
text-transform: uppercase;
}
${p.M.mbDown} {
&[data-size='lg'] {
font-size: 16px;
}
}
`,BorderHeading=({style:e,children:t,className:a,size:r="lg",type:o="bold",upperCase:i,as:n="h4",color:s})=>l.createElement(j,{style:Object.assign({color:s},e),className:a,"data-size":r,"data-type":o,"data-uppercase":i,as:n},t),O=(0,c.Z)(b.S)`
flex-shrink: 0;
color: ${d.r.colors.neutral800};
width: 16px;
height: 16px;
transition: transform 0.2s ease-in-out;
transform: rotate(-180deg);
&[data-is-collapsed='true'] {
transform: rotate(0deg);
}
`,$=c.Z.div`
background-color: white;
.icon {
width: 20px;
height: 20px;
flex-shrink: 0;
color: ${d.r.colors.neutral800};
}
.title-collapse {
color: #111111;
font-weight: var(--fwSemiBold);
font-size: 1.0625rem;
line-height: 1.5rem;
flex-grow: 1;
}
.box-collapse {
display: flex;
padding: 1.5rem 1rem 1rem 1rem;
gap: 0.75rem;
align-items: center;
}
`;function CardCollapse({children:e,title:t,icon:a,defaultOpened:r=!0,haveCollapse:o=!0,id:i,className:n,as:c="h2"}){let[d,{toggle:p}]=(0,m.q)(r);return l.createElement($,{id:i,className:n},l.createElement("div",{className:"box-collapse",onClick:()=>{o&&p()}},o&&a,l.createElement(s.T,{as:c,className:"title-collapse"},t),o&&l.createElement(O,{"data-is-collapsed":d})),l.createElement(u.U,{in:!o||d,transitionDuration:200,transitionTimingFunction:"ease"},e))}let L=c.Z.div`
position: relative;
box-sizing: border-box;
border: 1px solid ${d.r.colors.gray200};
background: url('../../../public/bgSvg/arrow-down.svg') no-repeat;
background-position: right 16px center;
border-radius: ${d.r.borderRadius};
&[data-has-icons='true'] {
border: none;
background: ${d.r.colors.gray100};
img,
svg {
display: inline-block;
max-width: 16px;
margin-right: 6px;
}
span {
vertical-align: middle;
display: inline-block;
}
&:hover {
box-shadow: none;
}
> div {
position: relative;
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
}
> div::after {
content: '';
right: 12px;
top: 50%;
background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
width: 10px;
height: 8px;
position: absolute;
background-repeat: no-repeat;
transform: translateY(-50%);
}
}
&:hover {
box-shadow: 0 0 2px 2px ${d.r.colors.primary200};
}
`,P=c.Z.div`
padding: 12px 18px 12px 16px;
cursor: pointer;
&[data-dropdown-open] {
padding: 11px 15px 11px 15px;
border: 1px solid ${d.r.colors.primaryBase};
border-radius: ${d.r.borderRadius};
box-shadow: 0 0 2px 2px ${d.r.colors.primary200};
}
& > svg {
height: 16px;
width: 16px;
}
`,T=c.Z.ul`
position: absolute;
top: 100%;
right: 0;
left: 0;
display: block;
margin-top: 4px;
background: ${d.r.colors.white};
border-radius: ${d.r.borderRadius};
box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001),
-2px 2px 5px rgba(67, 86, 100, 0.123689);
cursor: pointer;
&[data-has-icons='true'] {
background: white;
box-shadow: none;
border: 1px solid ${d.r.colors.gray200};
filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04));
}
`,N=c.Z.li`
margin: 8px;
padding: 12px 18px 12px 16px;
border-radius: ${d.r.borderRadius};
display: flex;
&:hover,
:active {
background: ${d.r.colors.gray100};
}
`,M=c.Z.div`
display: flex;
align-items: center;
margin-right: 8px;
& > svg {
height: 16px;
width: 16px;
}
`,ShareIconPathStyle=()=>l.createElement("style",null,".file-dropdown-path{fill:none;stroke:#595959;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}"),DefaultFileIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 12.17 14.83"},l.createElement("defs",null,l.createElement("clipPath",{id:"prefix__clip-path",transform:"translate(-1.92 -1.54)"},l.createElement("path",{fill:"none",d:"M0 .96h16v16H0z"}))),l.createElement("title",null,"File"),l.createElement("g",{clipPath:"url(#prefix__clip-path)"},l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29H4a1.33 1.33 0 00-1.33 1.33v10.67A1.33 1.33 0 004 15.62h8a1.33 1.33 0 001.33-1.33V7z",transform:"translate(-1.92 -1.54)"}),l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29V7h4.66",transform:"translate(-1.92 -1.54)"}))),DownloadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"download"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M4.67 7.62L8 11l3.33-3.34M8 11V3",transform:"translate(-1.25 -2.21)"})),UploadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"upload"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M11.33 6.29L8 3 4.67 6.29M8 3v8",transform:"translate(-1.25 -2.21)"})),FileDropdown=({className:e,value:t,options:a,onUploadSelected:r,id:o,placeholderIcon:i,placeholder:n,style:s})=>{let[c,d]=(0,l.useState)(!1),showDropdown=()=>d(!c),p=(0,l.useRef)(a.map(e=>"upload"===e.type&&l.createElement("input",{id:"uploader-dropdown-input-"+o+"-"+e.value,key:"uploader-dropdown-input-"+o+"-"+e.value,accept:e.fileAcceptedType,multiple:e.multiple,type:"file",style:{display:"none"},onChange:e=>{console.log("change"),r(e.target.files)}}))),onUpload=e=>{var t;null===(t=document.querySelector(e))||void 0===t||t.click()},onDownload=e=>{e&&window.open(e,"_blank")};return l.createElement(L,{className:e,"data-dropdown-open":!!c,id:o,"data-has-icons":!0,style:s,onBlur:()=>d(!1),tabIndex:0},l.createElement(ShareIconPathStyle,null),l.createElement(P,{onClick:showDropdown},i||l.createElement(DefaultFileIcon,null)," ",l.createElement("span",null,t&&t.value?t.label:n)),c&&l.createElement(T,{onClick:showDropdown,"data-has-icons":!0},a.map(e=>l.createElement(N,{key:`${o}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>"upload"===e.type?onUpload("#uploader-dropdown-input-"+o+"-"+e.value):onDownload(e.url)},l.createElement(M,null,e.icon||"download"===e.type?l.createElement(DownloadIcon,null):l.createElement(UploadIcon,null)),e.label))),l.createElement(l.Fragment,null,p.current))},F=c.Z.div`
--columns: var(--grid-template-columns, repeat(var(--columns-count), 1fr));
--columns-desktop: var(
--grid-template-columns-desktop,
repeat(var(--columns-count-desktop), 1fr)
);
display: grid;
grid-template-columns: var(--columns);
grid-gap: var(--grid-gap);
align-items: var(--align-items);
${p.M.tdUp} {
grid-template-columns: var(--columns-desktop);
}
> * {
justify-self: var(--justify-children);
}
`,Grid=({className:e,columns:t,columnsDesktop:a,gridTemplateColumns:r,gridTemplateColumnsDesktop:o,gap:i,children:n,justifyChildren:s,style:c,alignItems:d})=>l.createElement(F,{className:e,style:Object.assign({"--columns-count":t,"--columns-count-desktop":a,"--grid-template-columns":r,"--grid-template-columns-desktop":o,"--justify-children":s,"--grid-gap":i,"--align-items":d},c)},n),Radio=({size:e="small",label:t,name:a,checked:r,value:o,className:i,isDisabled:n=!1,onChange:s,dataEventCategory:c,dataEventAction:d,dataEventLabel:p})=>{let u=!!d&&!!c&&!!p,g=u?{"data-event-category":c,"data-event-action":d,"data-event-label":p}:{};return l.createElement(v.R,Object.assign({size:"small"===e?"md":"lg",label:t,name:a,checked:r,value:o,className:i,disabled:n,onChange:e=>null==s?void 0:s(e.target.value)},g))},R=c.Z.div`
display: inline-flex;
gap: calc(var(--gap) * 1px);
> svg {
width: calc(var(--star-size) * 1px);
height: calc(var(--star-size) * 1px);
}
&[data-selectable='true'] {
> svg {
cursor: pointer;
}
}
`,StarHalfIcon=e=>l.createElement("svg",Object.assign({},e,{viewBox:"0 0 24 24",fill:"none"}),l.createElement("path",{d:"m139.287 144.772 5.17 3.12c.38.23.85-.11.75-.54l-1.37-5.88 4.56-3.95c.33-.29.16-.84-.29-.88l-6.01-.51-2.35-5.54a.498.498 0 0 0-.92 0l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#E4E8EC"}),l.createElement("path",{d:"M139.289 144.771s.013-14.488 0-14.488a.49.49 0 0 0-.46.308l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#FFC326"})),StarIcon=e=>{var{isFull:t}=e,a=(0,f.a)(e,["isFull"]);return l.createElement("svg",Object.assign({},a,{viewBox:"0 0 32 32",fill:"none"}),l.createElement("path",{d:"m16 23.027 6.893 4.16c.507.306 1.134-.147 1-.72l-1.826-7.84 6.08-5.267a.67.67 0 0 0-.387-1.173l-8.013-.68-3.134-7.387a.664.664 0 0 0-1.226 0l-3.133 7.387-8.014.68a.668.668 0 0 0-.373 1.173l6.08 5.267-1.827 7.84c-.133.573.493 1.026 1 .72z",fill:t?"#FFC326":"#D2D6DC"}))},RateStars=({gap:e=2,size:t=24,star:a,totalStars:r=5,onSelect:o,hideEmptyStars:i,style:n,className:s})=>{let c=Math.floor(a),d=a-c>=.5?1:0,[p,u]=(0,l.useState)(null),g=p||c,h=p?0:d;return l.createElement(R,{"data-selectable":!!o,style:Object.assign({"--gap":e,"--star-size":t},n),className:s},Array.from({length:i?c+d:r}).map((e,t)=>{let onMouseOver=()=>!!o&&u(t+1),onMouseLeave=()=>!!o&&u(null);return t+1<=g?l.createElement(StarIcon,{key:t,onClick:()=>null==o?void 0:o(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,isFull:!0}):t+1===g+h?l.createElement(StarHalfIcon,{key:t,onClick:()=>null==o?void 0:o(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave}):l.createElement(StarIcon,{key:t,onClick:()=>null==o?void 0:o(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave})}))},getTag=(e,t)=>{switch(e){case"yellow":{let e=t?d.r.colors.yellow50:d.r.colors.yellow600;return`
background: ${e};
p {
color: var(
--text-props-color,
${d.r.colors.gray800}
);
}
`}case"standard":return`
background: ${d.r.colors.white};
border: 1px solid ${d.r.colors.gray200};
p {
color: var(
--text-props-color,
${d.r.colors.gray800}
);
}
&:hover {
background: ${d.r.colors.gray100};
}
`;case"red":{let e=t?d.r.colors.red50:d.r.colors.red500;return`
background: ${e};
`}case"green":{let e=t?d.r.colors.green50:d.r.colors.green500;return`
background: ${e};
`}case"blue":{let e=t?d.r.colors.primary50:d.r.colors.primaryBase;return`
background: ${e};
`}case"teal":{let e=t?d.r.colors.teal100:d.r.colors.teal600;return`
background: ${e};
`}case"pink":{let e=t?d.r.colors.pink200:d.r.colors.pink800;return`
background: ${e};
`}case"violet":{let e=t?d.r.colors.violet100:d.r.colors.violet500;return`
background: ${e};
`}case"grey":{let e=t?d.r.colors.gray100:d.r.colors.gray600;return`
background: ${e};
`}}},z=c.Z.div`
--padding-horizontal: 8px;
--pading-vertical: 2px;
display: flex;
align-items: center;
justify-content: center;
padding: var(--pading-vertical) var(--padding-horizontal);
border-radius: 24px;
${e=>"sponsored"===e.tagType&&`
--offset-size: 4px;
display: flex;
align-items: center;
justify-content: center;
box-sizing: content-box;
position: relative;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.08);
border-radius: 0 4px 18px 0;
height: 24px;
width: 90px;
border-left: var(--offset-size) solid ${d.r.colors.accentLight};
padding: 0;
margin-left: calc(var(--offset-size) * -1);
p {
font-weight: ${d.r.sizes.fwBold};
color: var(
--text-props-color,
${d.r.colors.secondaryDark}
);
font-size: 11px;
margin-left: calc(var(--offset-size) * -1);
}
&::after {
width: calc(var(--offset-size) * 2);
height: var(--offset-size);
background: ${d.r.colors.accentMain};
position: absolute;
left: calc(var(--offset-size) * -1);
bottom: calc(var(--offset-size) * -1);
clip-path: polygon(0 1%, 100% 0%, 100% 100%);
content: '';
}
`}
${e=>e.isInline&&`
display: inline-block;
`}
${e=>e.tagHasMorePadding&&`
&[data-has-more-padding] {
padding: calc(var(--pading-vertical) + 5px) var(--padding-horizontal);
}
`}
p {
${e=>e.tagIsLight?`
color: var(--text-props-color, #000);
`:`
color: var(--text-props-color, ${d.r.colors.white});
`}
}
${e=>getTag(e.tagType,e.tagIsLight)}
${e=>e.tagIsSquared&&"sponsored"!==e.tagType&&`
border-radius: 4px;
`}
${e=>e.tagIsALink&&`
cursor: pointer;
`}
&[data-is-selected],
&:active {
background: ${d.r.colors.primary50};
}
`,Tag=({type:e,children:t,style:a,isInline:r,isSquared:o=!1,className:i,isLight:n,hasMorePadding:s,isLink:c,isSelected:d,textProps:p={size:"sm"}})=>{let u=p.color?{"--text-props-color":p.color}:{};return l.createElement(z,{"data-is-squared":o||void 0,"data-tag-type":e,"data-is-light":n||void 0,"data-has-more-padding":s||void 0,"data-is-inline":r||void 0,style:Object.assign(Object.assign({},a),u),className:i,"data-is-selected":d||void 0,"data-is-link":c||void 0,tagType:e,isInline:r,tagHasMorePadding:s,tagIsLight:n,tagIsSquared:o,tagIsALink:c},l.createElement(x.T,Object.assign({},p),t))},B="24px",D=(0,y.Z)(c.Z.span`
position: relative;
display: block;
width: 40px;
height: ${B};
background: #c3cbd4;
border-radius: 100px;
cursor: pointer;
&:after {
position: absolute;
top: 2px;
left: 2px;
width: 20px;
height: 20px;
background: #fff;
border-radius: 90px;
content: '';
transition: 0.3s;
}
`,"hhgcomp-toggle-icon"),A=c.Z.span`
padding-left: 15px;
`,_=c.Z.div`
height: ${B};
input[type='checkbox'] {
width: 0;
height: 0;
visibility: hidden;
}
label {
cursor: pointer;
display: inline-flex;
color: ${d.r.colors.gray600};
}
input:checked + label ${D.classSelector} {
background: ${d.r.colors.primaryBase};
&:after {
left: calc(100% - 2px);
transform: translateX(-100%);
}
}
`,Toggle=({className:e,id:t,onChange:a,checked:r,style:o,label:i})=>l.createElement(_,{className:e,style:o},l.createElement("input",{type:"checkbox",id:t,onChange:a,checked:r}),l.createElement("label",{htmlFor:t},l.createElement(D,null),i&&l.createElement(A,null,i))),Z=(0,l.createContext)({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1}),StepRenderer=({children:e,onStepChange:t})=>{let[a,r]=(0,l.useState)(0),[o,i]=(0,l.useState)(0),n=l.Children.count(e);return(0,l.useEffect)(()=>{i(n-1)},[n]),(0,l.useEffect)(()=>{null==t||t(a)},[a]),l.createElement(Z.Provider,{value:{currentStep:a,setCurrentStep:r,setMaxStep:i,nextStep:()=>a+1<=o&&r(a+1),prevStep:()=>a-1>=0&&r(a-1)}},(0,w.Z)(e).map((e,t)=>{let r=t===a;return l.createElement(l.Fragment,{key:t},l.isValidElement(e)?e.props.alwaysRender||r?l.cloneElement(e,{isActive:t===a,stepIndex:t}):null:r?e:null)}))},H=c.Z.div`
display: flex;
align-items: center;
gap: 8px;
`,W=(0,c.Z)(E.H)`
font-weight: var(--fwBold);
`,IconHeading=({icon:e,title:t,className:a,style:r})=>l.createElement(H,{className:a,style:r},e,l.createElement(W,{tag:"h6",color:"var(--secondaryDark)"},t)),sanitizeHtml=e=>{if(!e)return"";let t=e.replace(/\n$/,"").replace(/\n/g,"
");return t},HtmlContent=({htmlContent:e,className:t})=>{let a=sanitizeHtml(e);return l.createElement("div",{className:t,dangerouslySetInnerHTML:{__html:a}})};(r=i||(i={})).ONE_TO_ONE="1:1",r.THREE_TO_ONE="3:1",(o=n||(n={})).PNG=".png",o.JPG=".jpg",o.JPEG=".jpeg";let getBase64=e=>new Promise((t,a)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=a,r.readAsDataURL(e)}),handleMultipleImageFiles=e=>(0,f._)(void 0,void 0,void 0,function*(){if(0===e.length)return[];let t=yield Promise.all(e.map(e=>getBase64(e)));return t}),q=c.Z.div`
display: flex;
flex-direction: column;
.image-upload-input-error {
margin-top: ${(0,g.h)(12)};
display: flex;
flex-direction: column;
gap: ${(0,g.h)(4)};
}
`,G=c.Z.div`
display: flex;
flex-direction: column;
gap: ${(0,g.h)(4)};
margin-top: ${(0,g.h)(4)};
span {
color: ${d.r.colors.neutral500};
}
`,V=c.Z.div`
position: relative;
width: fit-content;
padding: ${(0,g.h)(8)} ${(0,g.h)(12)};
border-radius: ${(0,g.h)(12)};
border: ${(0,g.h)(1)} solid ${d.r.colors.neutral200};
cursor: pointer;
display: flex;
align-items: center;
gap: ${(0,g.h)(8)};
margin-top: ${(0,g.h)(18)};
&.image-upload-dragover {
border-color: ${d.r.colors.primaryBase};
}
&.image-upload-error {
border-color: ${d.r.colors.error};
}
&.image-upload-disabled {
cursor: not-allowed;
background-color: ${d.r.colors.gray100};
color: ${d.r.colors.gray400};
border-color: ${d.r.colors.gray200};
}
svg {
width: ${(0,g.h)(18)};
height: ${(0,g.h)(18)};
}
input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
z-index: -1;
}
`,K=c.Z.div`
position: relative;
width: ${(0,g.h)(90)};
height: ${(0,g.h)(90)};
border-radius: ${(0,g.h)(12)};
overflow: hidden;
background-color: ${d.r.colors.gray100};
display: flex;
align-items: center;
justify-content: center;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
svg {
width: ${(0,g.h)(14)};
height: ${(0,g.h)(14)};
color: ${d.r.colors.white};
}
.image-upload-remove-button {
cursor: pointer;
position: absolute;
top: ${(0,g.h)(6)};
right: ${(0,g.h)(6)};
background: ${d.r.colors.black};
border-radius: ${(0,g.h)(12)};
padding: ${(0,g.h)(2)};
display: flex;
&:hover {
opacity: 0.8;
}
}
`,U=c.Z.div`
display: flex;
gap: ${(0,g.h)(8)};
margin-top: ${(0,g.h)(18)};
`,Q=(0,l.forwardRef)(({label:e,name:t,error:a,acceptedTypes:r=[n.PNG,n.JPG,n.JPEG],maxSize:o=1,acceptedRatios:i,multiple:c=!1,disabled:p=!1,id:u,className:m,onChange:b,value:v,showValidationRules:x=!1,description:y,useBase64:w=!1,placeholder:E},S)=>{let{t:I}=(0,k.u)(),[j,O]=(0,l.useState)(!1),[$,L]=(0,l.useState)([]),P=(0,l.useRef)(null),T=!!a||$.length>0,N=(0,l.useMemo)(()=>v?Array.isArray(v)?v:[v]:[],[v]),M=(0,l.useCallback)(e=>{var t;let a=[],i="."+(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase());r.includes(i)||a.push(`Unsupported file format. Please upload a ${r.join(", ")} file.`);let n=e.size/1048576;return n>o&&a.push(`File too large. Please upload an image smaller than ${o}MB.`),{file:e,isValid:0===a.length,errors:a}},[r,o]),F=(0,l.useCallback)(e=>new Promise(t=>{if(!i||!i.length||!e.type.startsWith("image/")){t([]);return}let a=new Image;a.onload=()=>{let e=a.width/a.height,r=`${e.toFixed(1)}:1`,o=i.some(t=>{let[a,r]=t.split(":"),o=parseInt(a)/parseInt(r);return .1>Math.abs(e-o)});t(o?[]:[`Image ratio ${r} is not accepted.`])},a.onerror=()=>t(["Invalid image file"]),a.src=URL.createObjectURL(e)}),[i]),R=(0,l.useMemo)(()=>N.map(e=>"string"==typeof e?e:e instanceof File?URL.createObjectURL(e):"").filter(Boolean),[N]),z=(0,l.useCallback)(e=>(0,f._)(void 0,void 0,void 0,function*(){let a=Array.from(e),r=[],o=[];for(let e of a){let t=M(e),a=yield F(e),i=[...t.errors,...a];0===i.length?o.push(e):r.push(...i)}if(L(r),0===o.length)return;let i=w?yield handleMultipleImageFiles(o):o;b({target:{name:t,value:c?[...N,...i]:i.slice(0,1)}})}),[M,F,c,b,t,N]),removeFile=e=>{let a=N.filter((t,a)=>a!==e);L([]),b({target:{name:t,value:c?a:""}})},B=(0,l.useCallback)(e=>{P.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),D=(0,l.useCallback)(()=>{!p&&P.current&&P.current.click()},[p]),A=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O(!0)},[]),_=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O(!1)},[]),Z=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),H=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),O(!1);let t=e.dataTransfer.files;t.length>0&&z(t)},[z]);return l.createElement(q,{className:m},l.createElement("label",{htmlFor:u||t},"string"==typeof e?l.createElement(s.T,{size:"title2"},e):e,y&&l.createElement(s.T,{size:"p3",mt:(0,g.h)(4),color:d.r.colors.gray700},y)),x&&l.createElement(G,null,l.createElement(s.T,{size:"p3"},"Formats: ",r.join("/")),i&&l.createElement(s.T,{size:"p3"},"Max size: ",o,"MB - Accepted ratios:"," ",i.join("/"))),(c||0===N.length)&&l.createElement(V,{className:(0,h.default)(j&&"image-upload-dragover",T&&"image-upload-error",p&&"image-upload-disabled"),onDragEnter:A,onDragLeave:_,onDragOver:Z,onDrop:H,onClick:D},l.createElement("input",{ref:B,type:"file",id:u||t,name:t,accept:r.join(","),multiple:c,onChange:e=>{let t=e.target.files;t&&t.length>0&&z(t)},disabled:p}),l.createElement(Upload,null),l.createElement(s.T,{size:"p3",fw:500},E||I("common.btn.uploadPhoto"))),N.length>0&&l.createElement(U,null,R.map((e,t)=>l.createElement(K,{key:t},l.createElement("img",{src:e,alt:`Uploaded file ${t+1}`,className:"image-upload-preview-image"}),l.createElement("button",{onClick:e=>{e.stopPropagation(),removeFile(t)},className:"image-upload-remove-button"},l.createElement(C.C,null))))),T&&l.createElement("div",{className:"image-upload-input-error"},[...$,a].map(e=>l.createElement(s.T,{key:e,className:"error-text",size:"c1",color:d.r.colors.red600},e))))}),Y=(0,c.Z)(S.l)`
& .mantine-Carousel-control {
width: auto;
}
`,DragFreeCarousel=e=>{var{children:t,gapItem:a=8,slideSize:r="auto",withControls:o=!1,withIndicators:i=!1,dragFree:n=!0,align:s="start"}=e,c=(0,f.a)(e,["children","gapItem","slideSize","withControls","withIndicators","dragFree","align"]);return l.createElement(Y,Object.assign({slideSize:r,slideGap:a,withControls:o,withIndicators:i,dragFree:n,align:s,containScroll:"trimSnaps"},c),l.Children.map(t,(e,t)=>l.createElement(S.l.Slide,{key:t},e)))}},mtKD:function(e,t,a){a.d(t,{B:function(){return BtnChoice}});var r=a("q1tI"),o=a("RlpF"),i=a("rBCA");let n=i.Z.div`
display: flex;
align-items: center;
gap: 8px;
button[data-color='tertiary'] {
background: white;
}
`,BtnChoice=({value:e,choices:t,className:a,onChange:i})=>{let[l,s]=(0,r.useState)(e);return(0,r.useEffect)(()=>{s(e)},[e]),r.createElement(n,{className:a},t.map((e,t)=>r.createElement(o.B,{dataEventCategory:e.dataEventCategory,dataEventAction:e.dataEventAction,dataEventLabel:e.dataEventLabel,size:"sm",variant:e.value===l?"primary":"tertiary",className:e.value===l?"btn-choice-selected":"",key:t,onClick:()=>{s(e.value),null==i||i(e.value)}},e.label||"")))}},Zq07:function(e,t,a){a.d(t,{L:function(){return Loading}});var r=a("q1tI"),o=a("flyO"),i=a("Z+18");let Loading=({className:e,theme:t,hideText:a})=>{let{t:n}=(0,i.u)();return r.createElement("div",{className:`tliWyii ${e}`},r.createElement(o.I.Spinner,{isMarryBaby:"marryBaby"===t}),!a&&n("loading"))}},"2KWK":function(e,t,a){a.d(t,{D:function(){return Dropdown}});var r=a("q1tI"),o=a("8vDj"),i=a("rBCA"),n=a("iBNF");let l=i.Z.div`
--dropdown-padding: 12px 18px 12px 16px;
position: relative;
box-sizing: border-box;
border: 1px solid ${n.r.colors.gray200};
background: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A")
no-repeat;
background-position: right 16px center;
border-radius: ${n.r.borderRadius};
&[data-disabled='true'],
:disabled {
background-color: #f2f2f2;
cursor: not-allowed;
}
&[data-size='sm'] {
font-size: 13px;
line-height: 20px;
}
&[data-size='md'] {
font-size: 14px;
line-height: 21px;
}
&[data-size='lg'] {
font-size: 16px;
line-height: 24px;
}
&[data-has-icons='true'] {
border: none;
background: ${n.r.colors.gray100};
img,
svg {
display: inline-block;
max-width: 16px;
margin-right: 6px;
}
span {
display: inline-block;
vertical-align: middle;
}
&:hover {
box-shadow: none;
}
> div {
position: relative;
display: flex;
width: 100%;
box-sizing: border-box;
align-items: center;
}
> div::after {
position: absolute;
top: 50%;
right: 12px;
width: 10px;
height: 8px;
background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
content: '';
transform: translateY(-50%);
}
}
&:hover {
box-shadow: 0 0 2px 2px ${e=>e.shadowColor};
}
&[data-is-native='true'] {
padding: var(--dropdown-padding);
line-height: 24px;
&:focus {
box-shadow: 0px 0px 2px 2px ${e=>e.shadowColor};
}
}
`,s=i.Z.div`
padding: var(--dropdown-padding);
cursor: pointer;
&.with-label {
padding-top: 34px;
padding-bottom: 12px;
}
&[data-dropdown-open] {
padding: 11px 15px 11px 15px;
border: 1px solid ${e=>e.color};
border-radius: ${n.r.borderRadius};
box-shadow: 0 0 2px 2px ${e=>e.shadowColor};
}
`,c=i.Z.ul`
position: absolute;
top: 100%;
/* right: 0; */
min-width: 100%;
left: 0;
display: block;
margin-top: 4px;
background: ${n.r.colors.white};
border-radius: ${n.r.borderRadius};
box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001),
-2px 2px 5px rgba(67, 86, 100, 0.123689);
cursor: pointer;
&[data-has-icons='true'] {
border: 1px solid ${n.r.colors.gray200};
background: white;
box-shadow: none;
filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04));
}
`,d=i.Z.li`
display: flex;
padding: 12px 18px 12px 16px;
&[data-disabled='true'] {
cursor: not-allowed;
color: #bfbfbf;
& > * {
pointer-events: none;
}
}
&:hover,
:active {
background: ${n.r.colors.gray100};
}
`,p=i.Z.div`
max-width: 16px;
margin-right: 8px;
`,u=i.Z.div`
position: absolute;
top: 12px;
left: 16px;
pointer-events: none;
`,Dropdown=({className:e,value:t,options:a,onChange:i=()=>void 0,id:n,placeholderIcon:g,placeholder:h,style:m,size:b="lg",groupedWithLabel:v,disabled:f,dropdownLabelTrackingAttributes:x={},isNativeSelect:y=!1})=>{let w=(0,o.rZ)(),[E,C]=r.useState(!1),showDropdown=()=>!f&&C(!E);if(y){let e="object"==typeof(null==t?void 0:t.value)&&t.value instanceof Date?t.value.toString():null==t?void 0:t.value;return r.createElement(l,{color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],as:"select","data-is-native":"true",value:e||void 0,disabled:f,onChange:e=>{if("string"==typeof e.target.value){let t=a.find(t=>t.value===e.target.value);t&&i(t)}}},h&&r.createElement("option",{value:h,disabled:!0,selected:!0},h),a.map(e=>r.createElement("option",{key:`${n}-${e.value}`,value:e.value,disabled:!!e.disabled&&e.disabled},e.label)))}return r.createElement(l,{color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],className:e,"data-dropdown-open":E||void 0,"data-size":b,id:n,"data-has-icons":!!g,style:m,onBlur:()=>C(!1),tabIndex:0,"data-disabled":f},!!v&&r.createElement(u,null,v),r.createElement(s,Object.assign({color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],onClick:showDropdown,className:v&&"with-label"},x),g," ",r.createElement("span",null,t&&t.value?t.label:h)),E&&r.createElement(c,{onClick:showDropdown,"data-has-icons":!!g},a.map(e=>r.createElement(d,{key:`${n}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>!e.disabled&&!f&&(null==i?void 0:i(e)),"data-disabled":!!e.disabled&&e.disabled},e.icon&&r.createElement(p,null,e.icon),e.label))))}},"8PRT":function(e,t,a){a.d(t,{P:function(){return PWGForm}});var r=a("T/vS"),o=a("q1tI"),i=a("8vDj"),n=a("iuhU"),l=a("cChf"),s=a("ZFu2"),c=a("iAc4"),d=a("Z+18"),p=a("OzIV"),u=a("SMDy"),g=a("dDw1"),h=a("cHPQ"),m=a("w8P6"),b=a("Cafw"),v=a("xrdX");let f=(0,o.createContext)({}),DefaultForm=e=>{var t=(0,r.a)(e,[]);let{t:a,locale:l}=(0,d.u)(),{linkTool:s,form:c,submitProps:p}=(0,o.useContext)(f),{classes:x={}}=(0,o.useContext)(h.C),y=(0,i.rZ)(),w="mb"===y.other.template;return o.createElement(m.H,Object.assign({formLayout:"default"},t),o.createElement(m.H.FormRow,null,o.createElement(u.I.Number,Object.assign({label:o.createElement(g.T,{size:"p2",weight:"semiBold"},a("pregnancyWeightGain.weekInput")),min:b.I.pregnantWeek.min,max:b.I.pregnantWeek.max,placeholder:`${b.I.pregnantWeek.min} - ${b.I.pregnantWeek.max}`},c.getInputProps("pregnantWeek")))),o.createElement(m.H.FormRow,null,o.createElement(u.I.Number,Object.assign({label:o.createElement(g.T,{size:"p2",weight:"semiBold"},a("pregnancyWeightGain.weightBeforeInput")),min:b.I.weight.min,max:b.I.weight.max,placeholder:a("tools.inputPlaceholder",{content:"50"})},c.getInputProps("lastWeight")))),o.createElement(m.H.FormRow,null,o.createElement(u.I.Number,Object.assign({label:o.createElement(g.T,{size:"p2",weight:"semiBold"},a("pregnancyWeightGain.heightInput")),min:b.I.height.min,max:b.I.height.max,placeholder:a("tools.inputPlaceholder",{content:"160"})},c.getInputProps("height")))),o.createElement(m.H.FormRow,null,o.createElement(u.I.Number,Object.assign({label:o.createElement(g.T,{size:"p2",weight:"semiBold"},a("pregnancyWeightGain.weightInput")),min:b.I.weight.min,max:b.I.weight.max,placeholder:a("tools.inputPlaceholder",{content:"50"})},c.getInputProps("weight")))),o.createElement(m.H.FormRow,null,o.createElement(m.H.Switching,Object.assign({label:o.createElement(g.T,{size:"p2",weight:"semiBold"},a("pregnancyWeightGain.havingTwins"))},c.getInputProps("hasTwin")))),o.createElement(m.H.FormRow,{className:x.submitWrapper},o.createElement(m.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${v.v[w?"vi-VN_MB":l]}/${s}`,className:(0,n.default)("due-date-calculate-button",x.submitBtn)},p),a("dueDatePage.lastPeriod.calculate"))))},InlineForm=e=>{var t=(0,r.a)(e,[]);let{t:a,locale:l}=(0,d.u)(),{classes:s={}}=(0,o.useContext)(h.C),{linkTool:c,form:p,submitProps:g}=(0,o.useContext)(f),x=(0,i.rZ)(),y="mb"===x.other.template;return o.createElement(m.H,Object.assign({formLayout:"inline"},t),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderInlineControl,{label:a("pregnancyWeightGain.weekInput")},o.createElement(u.I.Number,Object.assign({min:b.I.pregnantWeek.min,max:b.I.pregnantWeek.max,placeholder:`${b.I.pregnantWeek.min} - ${b.I.pregnantWeek.max}`,rightSection:o.createElement(m.H.Unit,null,a("pwgForm.week"))},p.getInputProps("pregnantWeek"))))),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderInlineControl,{label:a("pregnancyWeightGain.weightBeforeInput")},o.createElement(u.I.Number,Object.assign({},p.getInputProps("lastWeight"),{min:b.I.weight.min,max:b.I.weight.max,placeholder:a("tools.inputPlaceholder",{content:"50"}),rightSection:o.createElement(m.H.Unit,null,a("babyGrowth.kg"))})))),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderInlineControl,{label:a("pregnancyWeightGain.heightInput")},o.createElement(u.I.Number,Object.assign({},p.getInputProps("height"),{min:b.I.height.min,max:b.I.height.max,placeholder:a("tools.inputPlaceholder",{content:"160"}),rightSection:o.createElement(m.H.Unit,null,a("babyGrowth.cm"))})))),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderInlineControl,{label:a("pregnancyWeightGain.weightInput")},o.createElement(u.I.Number,Object.assign({},p.getInputProps("weight"),{min:b.I.weight.min,max:b.I.weight.max,placeholder:a("tools.inputPlaceholder",{content:"50"}),rightSection:o.createElement(m.H.Unit,null,a("babyGrowth.kg"))})))),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderInlineControl,{label:a("pregnancyWeightGain.havingTwins"),width:"none"},o.createElement(m.H.Switching,Object.assign({},p.getInputProps("hasTwin"))))),o.createElement(m.H.FormRow,{className:s.submitWrapper},o.createElement(m.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${v.v[y?"vi-VN_MB":l]}/${c}`,className:(0,n.default)("due-date-calculate-button",s.submitBtn)},g),a("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,r.a)(e,[]);let{t:a,locale:n}=(0,d.u)(),{linkTool:l,form:s,submitProps:c}=(0,o.useContext)(f),p=(0,i.rZ)(),g="mb"===p.other.template;return o.createElement(m.H,Object.assign({formLayout:"inline"},t),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderBoxControl,{label:a("pregnancyWeightGain.weekInput"),rightSection:a("pregnancy.week")},o.createElement(u.I.Number,Object.assign({min:b.I.pregnantWeek.min,max:b.I.pregnantWeek.max,placeholder:`${b.I.pregnantWeek.min} - ${b.I.pregnantWeek.max}`},s.getInputProps("pregnantWeek")))),s.errors.pregnantWeek&&o.createElement(m.H.Error,null,s.errors.pregnantWeek)),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderBoxControl,{label:a("pregnancyWeightGain.weightBeforeInput"),rightSection:"kg"},o.createElement(u.I.Number,Object.assign({min:b.I.weight.min,max:b.I.weight.max},s.getInputProps("lastWeight"),{placeholder:a("tools.inputPlaceholder",{content:"50"})}))),s.errors.lastWeight&&o.createElement(m.H.Error,null,s.errors.lastWeight)),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderBoxControl,{label:a("pregnancyWeightGain.heightInput"),rightSection:"cm"},o.createElement(u.I.Number,Object.assign({min:b.I.height.min,max:b.I.height.max},s.getInputProps("height"),{placeholder:a("tools.inputPlaceholder",{content:"160"})}))),s.errors.height&&o.createElement(m.H.Error,null,s.errors.height)),o.createElement(m.H.FormRow,null,o.createElement(m.H.BorderBoxControl,{label:a("pregnancyWeightGain.weightInput"),rightSection:"kg"},o.createElement(u.I.Number,Object.assign({min:b.I.weight.min,max:b.I.weight.max},s.getInputProps("weight"),{placeholder:a("tools.inputPlaceholder",{content:"50"})}))),s.errors.weight&&o.createElement(m.H.Error,null,s.errors.weight)),o.createElement(m.H.Switching,Object.assign({label:a("pregnancyWeightGain.havingTwins")},s.getInputProps("hasTwin"))),o.createElement(m.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${v.v[g?"vi-VN_MB":n]}/${l}`,className:"due-date-calculate-button"},c),a("dueDatePage.lastPeriod.calculate")))},PWGForm=e=>{var{formLayout:t="default",submitProps:a,onSubmit:n}=e,u=(0,r.a)(e,["formLayout","submitProps","onSubmit"]);let{t:g,locale:h}=(0,d.u)(),m=(0,i.rZ)(),b="mb"===m.other.template,v=(0,l.c)({validate:{pregnantWeek:(0,s.U)(g("validation.error.requiredField")),height:(0,s.U)(g("validation.error.requiredField")),weight:(e,t)=>e?Number(e)>=Number(t.lastWeight)?null:g("pregnancyWeightGain.weightInput.error"):g("validation.error.requiredField"),lastWeight:(e,t)=>e?Number(e)x(p.H.PWG),[x]),w=Object.assign({onSubmit:v.onSubmit(n)},u);return o.createElement(f.Provider,{value:{linkTool:y,form:v,submitProps:a}},"inline"===t?o.createElement(InlineForm,Object.assign({},w)):b?o.createElement(MbLayout,Object.assign({formLayout:t},w)):o.createElement(DefaultForm,Object.assign({},w)))}},"/eVK":function(e,t,a){a.d(t,{C:function(){return h},I:function(){return ImagePreviewPopup},P:function(){return PostSingleImageViewPopup},a:function(){return PostImagePreview},b:function(){return m}});var r=a("q1tI"),o=a("Mjd7"),i=a("un+D"),n=a("Z+18"),l=a("GAI/"),s=a("t/pd"),c=a("dDw1"),d=a("rBCA"),p=a("T/vS"),u=a("iBNF"),g=a("gEnE"),h="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e",m="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.05 18.06 4 12.038l6.05-6.025M4.002 12.035h15'/%3e%3c/svg%3e";let b=d.Z.div`
padding: 14px 16px 14px 17px;
background: ${e=>e.bgColor};
border-left: 3px solid ${e=>e.highlight};
${i.M.mbUp} {
padding: 12px 12px 12px 17px;
}
`,v=d.Z.div`
display: flex;
`,f=d.Z.div`
font-size: 12px;
line-height: 18px;
&[data-has-icon='true'] {
margin-left: 10px;
}
`,x=d.Z.div`
flex-shrink: 0;
`,y=d.Z.div`
display: grid;
grid-gap: 3px;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;
.img-wrapper {
position: relative;
overflow: hidden;
width: 100%;
padding-top: 56.25%;
grid-column: auto;
& > img {
cursor: zoom-in;
}
.img-preview-blur {
position: absolute;
top: 50%;
left: 50%;
width: 110%;
height: 110%;
/* Add the blur effect */
-webkit-filter: blur(8px);
filter: blur(8px);
object-fit: cover;
object-position: center;
opacity: 0.8;
transform: translate(-50%, -50%);
}
.img-preview {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
}
.img-more-overlay {
position: absolute;
top: 0;
left: 0;
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5);
z-index: 4;
}
}
&[data-image-count='1'] {
.img-wrapper {
/* padding-top: 100%; */
grid-column: 1/3;
}
}
&[data-image-count='2'] {
.img-wrapper {
/* padding-top: 100%; */
}
}
&[data-image-count='3'] {
.img-wrapper {
&:first-child {
grid-column: 1/3;
}
}
}
&[data-image-count='4'] {
.img-wrapper {
/* padding-top: 100%; */
}
}
&[data-image-count='5'] {
grid-template-columns: repeat(6, 1fr);
.img-wrapper {
/* padding-top: 100%; */
grid-column: auto/ span 2;
&:first-child {
padding-top: 56.25%;
grid-column: 1/4;
}
&:nth-child(2) {
padding-top: 56.25%;
grid-column: 4/7;
}
}
}
&[data-is-marrybaby='true'] {
grid-gap: 8px;
.img-wrapper {
padding-top: 66.66%;
border-radius: 1rem;
.img-preview {
object-fit: cover;
}
}
&[data-image-count='3'] {
grid-template-columns: 1fr 1fr 1fr;
.img-wrapper {
&:first-child {
padding-top: 100%;
grid-column: 1/3;
grid-row: 1/3;
}
}
}
}
`,w=d.Z.div`
position: fixed;
z-index: 999;
top: 0;
left: 0;
display: flex;
overflow: hidden;
width: 100vw;
height: 100vh;
flex-direction: column;
background: white;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s linear;
&[data-open='true'] {
opacity: 1;
pointer-events: auto;
}
.top-bar {
position: relative;
padding: 20px 40px;
.icon-arrow-left {
position: absolute;
top: 50%;
left: 20px;
height: 24px;
width: 24px;
cursor: pointer;
transform: translateY(-50%);
}
}
.container {
flex: 1;
overflow-y: auto;
.img-preview {
width: 100%;
min-width: 100%;
margin-bottom: 0.5rem;
cursor: pointer;
max-height: 100%;
object-fit: cover;
}
}
`,E=(0,d.Z)(e=>{var{icon:t,bgColor:a=u.r.colors.yellow50,highlightColor:o=u.r.colors.yellow800,message:i}=e,n=(0,p.a)(e,["icon","bgColor","highlightColor","message"]);return r.createElement(b,Object.assign({bgColor:a,highlight:o},n),r.createElement(v,null,t&&r.createElement(x,null,t),r.createElement(f,{"data-has-icon":!!t},i)))})`
margin-bottom: 16px;
&.noti-bottom {
border-left: none;
margin-top: 4px;
padding: 4px 8px;
margin-left: 16px;
margin-right: 16px;
border-radius: 4px;
}
`,ImagePreviewPopup=({className:e,style:t,authorName:a,images:o,onClose:i,onOpenSingleView:l,alt:d})=>{let{t:p}=(0,n.u)(),[u,g]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{setTimeout(()=>{g(!0)},0)},[]),r.createElement(s.h,null,r.createElement(w,{className:e,style:t,"data-open":u},r.createElement("div",{className:"top-bar"},r.createElement("img",{className:"icon-arrow-left",src:m,onClick:i,alt:"go back",loading:"lazy"}),r.createElement(c.T,{size:"p2",weight:"bold",style:{textAlign:"center"}},p("previewPhotos.title",{name:a}))),r.createElement("div",{className:"container"},o.map((e,t)=>r.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==l?void 0:l(t),alt:d,loading:"lazy"})))),",")},C=d.Z.div`
position: fixed;
z-index: 999;
top: 0;
left: 0;
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
background: black;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s linear;
&[data-open='true'] {
opacity: 1;
pointer-events: auto;
}
`,k=d.Z.div`
padding: 1rem;
background: white;
.icon-close {
width: 26px;
height: 26px;
cursor: pointer;
}
`,S=d.Z.div`
position: relative;
flex: 1;
overflow: hidden;
> img {
height: 100%;
width: 100%;
object-fit: contain;
object-position: center;
}
`,I=d.Z.div`
--inner-padding: max(16px, 20%);
height: 100%;
position: absolute;
left: 0;
padding: 8px;
padding-right: var(--inner-padding);
display: flex;
align-items: center;
top: 0;
cursor: pointer;
&[data-right] {
padding-right: 8px;
padding-left: var(--inner-padding);
left: unset;
right: 0;
}
&[data-disabled='true'] {
cursor: not-allowed;
}
`,j=d.Z.div`
border-radius: 50%;
background: rgba(0, 0, 0, 0.3);
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
> img {
width: 16px;
height: 16px;
&[data-disabled='true'] {
opacity: 0.5;
}
}
${i.M.tdUp} {
padding: 8px;
> img {
width: 30px;
height: 30px;
}
}
`;var O="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 12.813 4-4-4-4'/%3e%3c/svg%3e";let PostSingleImageViewPopup=({initialViewIndex:e,images:t,onClose:a,alt:o})=>{let[i,n]=(0,r.useState)(e),[l,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>{setTimeout(()=>{c(!0)},0)},[]);let d=null==t?void 0:t[i],p=0===i,u=!(null==t?void 0:t.length)||i===(null==t?void 0:t.length)-1;return r.createElement(s.h,null,r.createElement(C,{"data-open":l&&!!d},r.createElement(k,null,r.createElement("img",{src:h,className:"icon-close",onClick:a,alt:"close",loading:"lazy"})),d&&i>=0&&r.createElement(r.Fragment,null,r.createElement(S,null,r.createElement("img",{className:"img-preview",src:d,alt:o,loading:"lazy"}),r.createElement(I,{"data-disabled":p,onClick:()=>!p&&n(i-1)},r.createElement(j,null,r.createElement("img",{src:O,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":p,loading:"lazy"}))),r.createElement(I,{"data-right":!0,"data-disabled":u,onClick:()=>!u&&n(i+1)},r.createElement(j,null,r.createElement("img",{src:O,alt:"right arrow","data-disabled":u,loading:"lazy"})))))))},$=(0,g.Z)(d.Z.div`
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
color: white;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
`,"hhgcomp-sensitivemask-inner"),L=d.Z.div``,P=d.Z.div`
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 3;
background: white;
cursor: pointer;
&,
* {
// transition: all 300ms;
transform-origin: bottom left;
}
img {
transition: none;
}
.img-preview {
width: 100%;
}
&[data-is-blurred='true'] {
.img-preview {
/* Add the blur effect */
-webkit-filter: blur(24px);
filter: blur(24px);
}
}
&[data-is-blurred='false'] {
background: transparent;
cursor: zoom-in;
${$.classSelector} {
top: auto;
right: auto;
left: 8px;
bottom: 8px;
background: rgba(0, 0, 0, 0);
align-items: flex-end;
justify-content: flex-start;
}
}
`,SensitiveMask=({image:e,showIcon:t=!0})=>{let[a,o]=(0,r.useState)(!0);return r.createElement(P,{"data-is-blurred":a,onClick:e=>a&&e.stopPropagation()},r.createElement("img",{loading:"lazy",className:"img-preview",src:e}),r.createElement($,{onClick:e=>{e.stopPropagation(),o(!a)}},t&&r.createElement(L,null,a?r.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},r.createElement("path",{d:"M1.71 2.54a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0l16.31 16.33a.996.996 0 1 1-1.41 1.41l-2.72-2.72c-1.34.52-2.79.82-4.31.82-5 0-9.27-3.11-11-7.5C.77 7.5 2.06 5.8 3.68 4.51zM16 9.47c0-2.76-2.24-5-5-5-.51 0-1 .1-1.47.24L7.36 2.54c1.15-.37 2.37-.57 3.64-.57 5 0 9.27 3.11 11 7.49-.69 1.76-1.79 3.3-3.18 4.53l-3.06-3.06c.14-.46.24-.95.24-1.46m-5 5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14L8.06 8.9c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07l1.57 1.57c-.65.32-1.37.5-2.14.5m2.97-5.33a2.97 2.97 0 0 0-2.64-2.64z",fill:"#fff"})):r.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},r.createElement("path",{d:"M12 0C5.142 0 1.886 5.879 1.096 7.557c-.132.28-.132.604 0 .884C1.886 10.121 5.142 16 12 16c6.834 0 10.092-5.837 10.896-7.54a1.08 1.08 0 0 0 0-.92C22.092 5.836 18.834 0 12 0m0 3a5 5 0 1 1-.001 10.001 5 5 0 0 1 0-10.001m0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6",fill:"#2D87F3"})))))},PostImagePreview=({className:e,images:t=[],style:a,authorName:s,isSensitive:c=!1,alt:d,positionAlert:p="top"})=>{let{data:{env:{isMarryBaby:u}}}=(0,r.useContext)(l.T),{t:g}=(0,n.u)(),h=`+ ${(t.length||0)-4}`,[m,b]=(0,r.useState)(!1),[v,f]=(0,r.useState)(-1),x=t.length>5,w=(0,r.useRef)(!1);return(0,r.useEffect)(()=>()=>{w.current&&(0,i.t)(!1)},[]),(0,r.useEffect)(()=>{m||v>=0?((0,i.t)(!0),w.current=!0):((0,i.t)(!1),w.current=!1)},[m,v]),r.createElement(r.Fragment,null,c&&"top"===p&&r.createElement(E,{message:g("sensitiveMask.contentWarningDescription"),icon:r.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},r.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}),r.createElement(y,{className:e,style:a,"data-image-count":x?5:t.length||0,"data-is-marrybaby":u,"data-cursor-pointer":!c},null==t?void 0:t.slice(0,5).map((e,t)=>{let a=4===t&&x;return r.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&x?b(!0):f(t)}},c&&r.createElement(SensitiveMask,{image:e,showIcon:!a}),!u&&r.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),r.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&r.createElement("div",{className:"img-more-overlay"},r.createElement(o.H,{tag:"h1",as:"h2",color:"white"},h)))})),m&&r.createElement(ImagePreviewPopup,{authorName:s||"",images:t,onClose:()=>b(!1),onOpenSingleView:f,alt:d}),v>=0&&r.createElement(PostSingleImageViewPopup,{images:t,initialViewIndex:v,onClose:()=>f(-1),alt:d}),c&&"bottom"===p&&r.createElement(E,{message:g("sensitiveMask.contentWarningDescription.community"),className:"noti-bottom",icon:r.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},r.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}))}},m3fh:function(e,t,a){a.r(t),a.d(t,{ProfileChatbot:function(){return ProfileChatbot},TabDataInit:function(){return w},TabName:function(){return i},UserType:function(){return n}});var r,o,i,n,l=a("T/vS"),s=a("q1tI"),c=a("Py5H"),d=a("H/q8"),p=a("eKPt"),u=a("IQVP"),g=a("GAI/"),h=a("WedE"),m=a("vWP/"),b=a("4JiQ"),v=a("OZ05"),f=a("375z");a("JIJ2"),a("NmYn"),a("gY0P"),a("Wgwc"),a("QgiU"),a("rBCA");let x=(0,s.createContext)({}),Faqs=({faqs:e})=>{let[t,a]=(0,s.useState)([]),handleClick=e=>{if(t.includes(e)){let r=t.filter(t=>t!==e);a(r)}else a(t=>[...t,e])};return s.createElement("div",{className:"_0NhMo6T"},e.map((e,a)=>{let r=t.includes(a);return s.createElement("div",{className:"nrZtZ-u",key:a},s.createElement("div",{className:"faq-item",onClick:()=>handleClick(a)},s.createElement("div",{className:"faq-question",dangerouslySetInnerHTML:{__html:e.question||""}}),r?s.createElement(h.Z,null):s.createElement(m.Z,null)),s.createElement(b.U,{in:r,className:"faq-answer"},s.createElement("div",{dangerouslySetInnerHTML:{__html:e.answer||""}})))}))};var y={container:"_2ugC2Ll",body:"CCwRHCd",description:"RF63WXG",cardAuthorWrapper:"PIaeC0v"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(r=i||(i={}))[r.About=0]="About",r[r.Care=1]="Care",r[r.Answer=2]="Answer",r[r.Posts=3]="Posts",(o=n||(n={}))[o.Expert=0]="Expert",o[o.User=1]="User";let w={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileChatbot=e=>{var{authorProps:t,authActionWrapper:a,onSkipQuestion:r,onCloseFromPost:o,onChatWithBot:i,showSkipQuestionTag:n,currentPageUrl:h}=e,m=(0,l.a)(e,["authorProps","authActionWrapper","onSkipQuestion","onCloseFromPost","onChatWithBot","showSkipQuestionTag","currentPageUrl"]);let{data:{locale:b,userInfo:w,env:{isMarryBaby:E}}}=(0,s.useContext)(g.T),C=String(null==t?void 0:t.userId),[k,S]=(0,s.useState)(),[I,j]=(0,s.useState)(!1),[O,$]=(0,s.useState)(),[L,P]=(0,s.useState)([]),[T,N]=(0,s.useState)(""),M=(null==w?void 0:w._togetherUserId)===(null==t?void 0:t.userId),[F,R]=(0,s.useState)(1),z={value:String(F),dataList:[{value:"1",text:"FAQs",content:s.createElement(Faqs,{faqs:L})}],onTabChange:e=>R(Number(e))};return(0,s.useEffect)(()=>{(0,l._)(void 0,void 0,void 0,function*(){var e,t,a,r,o,i,n,l,s,c,d;j(!0);let h=yield Promise.all([(0,g.c)((0,g.f)(u.yy.USER.DETAIL,{_locale:b,id:C}),"GET"),(0,g.c)((0,g.f)(u.yy.CHATBOT.PROFILE,{_locale:b}),"GET"),(0,g.c)((0,g.f)(u.yy.CHATBOT.FAQS_LIST,{_locale:b}),"GET")]),[m,v,f]=h,x={data:null==m?void 0:m.data,experiences:((null===(t=null===(e=null==m?void 0:m.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==m?void 0:m.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,p.f)(e.post)),educations:((null===(o=null===(r=null==m?void 0:m.data)||void 0===r?void 0:r.fields)||void 0===o?void 0:o.educations)||[]).map(formatEducation),awards:(null===(n=null===(i=null==m?void 0:m.data)||void 0===i?void 0:i.fields)||void 0===n?void 0:n.awards_accreditations)||[],contact:(null===(s=null===(l=null==m?void 0:m.data)||void 0===l?void 0:l.fields)||void 0===s?void 0:s.contact)||{}};(null==m?void 0:m.status)===1&&$(x),P((null===(c=null==f?void 0:f.data)||void 0===c?void 0:c.faqs)||[]),N((null===(d=null==v?void 0:v.data)||void 0===d?void 0:d.description)||""),j(!1)})},[]),s.createElement(x.Provider,{value:{isMarryBaby:E,siteType:E?"marryBaby":"helloSites",authorId:String((null==t?void 0:t.userId)||""),authActionWrapper:a,onSkipQuestion:r,info:O,authorProps:t,onCloseFromPost:o,countValues:k,setCountValues:S,isAuthorLogin:M,showSkipQuestionTag:n,currentPageUrl:h}},s.createElement("div",Object.assign({},m,{className:`${y.container} ${(null==m?void 0:m.className)||""}`,"data-is-marrybaby":E}),I?s.createElement(d.L,null):s.createElement(s.Fragment,null,s.createElement("div",{className:y.cardAuthorWrapper},s.createElement(v.C,Object.assign({},t,{className:"card-author",showDetailPopup:!1,showChatbotButton:b===f.L.Vietnam,onChatWithBot:i}))),s.createElement("div",{className:y.description,dangerouslySetInnerHTML:{__html:T}}),L.length>0&&s.createElement("div",{className:y.body},s.createElement(c.T,Object.assign({},z))))))}},QAwL:function(e,t,a){a.d(t,{L:function(){return LabelSorting}});var r,o,i=a("q1tI"),n=a("dDw1"),l=a("GAI/"),s=a("8yea");(r=o||(o={})).latest="latest",r.oldest="oldest",r.popular="popular";let LabelSorting=({onChange:e,className:t,style:a,leftLabel:r,rightLabel:o,color:c,value:d,choices:p})=>{let{data:{env:{isMarryBaby:u}}}=(0,i.useContext)(l.T);return i.createElement(s.L,{label:r,rightLabel:i.createElement(s.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:p.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===d,className:"bold-item"}))},toggleButtonContent:i.createElement("div",{style:{display:"flex"}},i.createElement(n.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},o),i.createElement("img",{src:u?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%233E3F58' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m8 14 4 4 4-4M16 10l-4-4-4 4'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%238C8C8C' d='M4.5 7h7a.46.46 0 0 0 .351-.165.56.56 0 0 0 .149-.39q0-.226-.149-.391l-3.5-3.89a.458.458 0 0 0-.703 0l-3.5 3.89a.56.56 0 0 0-.148.39q0 .226.148.391Q4.298 7 4.5 7M11.5 9h-7a.46.46 0 0 0-.352.165.56.56 0 0 0-.148.39q0 .226.148.391l3.5 3.889a.46.46 0 0 0 .703 0l3.5-3.889a.56.56 0 0 0 .149-.39q0-.226-.149-.391A.46.46 0 0 0 11.5 9'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"},loading:"lazy"}))}),color:"gray",className:t,style:a})}},"z+87":function(e,t,a){a.d(t,{c:function(){return convertLocalizedStringToNumber},f:function(){return formatPhoneNumber},l:function(){return localizeNumberFormat}});var r=a("A9bs");let localizeNumberFormat=(e,t,a=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:a}).format(e),convertLocalizedStringToNumber=e=>Number(e.replace(/,/gi,".")),formatPhoneNumber=e=>{try{let t=(0,r.parsePhoneNumber)(e,"VN");if(!(null==t?void 0:t.number))throw Error("Invalid number");return(0,r.formatPhoneNumber)(t.number)}catch(t){return console.log("\uD83D\uDE80 ~ formatPhoneNumber ~ error:",t),e}}},TsRu:function(e,t,a){a.d(t,{L:function(){return n}});var r=a("q1tI"),o=a("0dn/"),i=a("FfBq");let n=(0,r.memo)(({type:e,width:t,height:a,isLight:n})=>{let l=(0,r.useMemo)(()=>{switch(e){case"hellobacsi":return{width:t||"107px",height:a||"24px",src:o.C.getAssetPath("logo/hellobacsi.png"),srcLight:o.C.getAssetPath("logo/hellobacsi-light.png")};case"hellodoktor":return{width:t||"127px",height:a||"24px",src:o.C.getAssetPath("logo/hellodoktor.png")};case"hellosehat":return{width:t||"121px",height:a||"27px",src:o.C.getAssetPath("logo/hellosehat.png")};case"hellojiankang":return{width:t||"87px",height:a||"24px",src:o.C.getAssetPath("logo/hellojiankang.png")};case"hellohealth":return{width:t||"123px",height:a||"24px",src:o.C.getAssetPath("logo/hellohealth.png")};case"hellotogether":return{width:t||"150px",height:a||"24px",src:o.C.getAssetPath("logo/hellotogether.png")};case"hellocare":return{width:t||"99px",height:a||"24px",src:o.C.getAssetPath("logo/hellocare.png")};case"hellodoctor":return{width:t||"127px",height:a||"24px",src:o.C.getAssetPath("logo/hellodoctor.png")};case"hellokrupet":return{width:t||"101px",height:a||"24px",src:o.C.getAssetPath("logo/hellokrupet.png")};case"hellosayarwon":return{width:t||"111px",height:a||"24px",src:o.C.getAssetPath("logo/hellosayarwon.png")};case"helloyishi":return{width:t||"89px",height:a||"24px",src:o.C.getAssetPath("logo/helloyishi.png")};case"hellokhunmor":return{width:t||"123px",height:a||"24px",src:o.C.getAssetPath("logo/hellokhunmor.png")};case"helloswasthya":return{width:t||"105px",height:a||"24px",src:o.C.getAssetPath("logo/helloswasthya.png")};case"logomark":return{width:t||"60px",height:a||"57px",src:o.C.getAssetPath("logo/logomark.png")};case"marryBaby":return{width:t||"145px",height:a||"28px",src:o.C.getAssetPath("logo/marrybaby.png")};default:return null}},[e,t,a]),{src:s,width:c,height:d,srcLight:p}=l||{};return r.createElement(i.I,{alt:`${e} logo`,className:"main-logo-icon",src:n&&p||s,style:{width:c,height:d}})})}}]);