"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9557],{FMVR:function(e,t,o){o.d(t,{D:function(){return DrawerBottom}});var n=o("6eqW"),i=o("q1tI"),r=o("iuhU"),a=o("h8tX"),l=o("p5f+"),s=o("rSBk"),c=o("rBCA"),d=o("iBNF"),u=o("Jbia");(0,c.Z)(l.D)` /* max-height: 100vh; max-height: 100dvh; */ background-color: white; &[data-vaul-drawer-direction='bottom'] { top: initial !important; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; } .drawer__handle { width: 44px; height: 3px; background-color: ${d.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;let p=(0,c.Z)(s.dy.Content)` position: fixed; z-index: ${u.Z-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &[data-is-linear='true'] { background: linear-gradient(180deg, #c3e3ff 1.86%, #fff 20%) !important; } &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { top: initial; border-top-left-radius: 16px; border-top-right-radius: 16px; /* padding-bottom: 16px; */ } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,g=(0,c.Z)(s.dy.Overlay)` position: fixed; inset: 0; z-index: ${u.Z-9e6}; width: 100%; max-height: 100%; background-color: rgb(0, 0, 0, 0.4); `,m=(0,c.Z)(s.dy.Handle)` &[data-vaul-handle] { width: 44px; height: 3px; background-color: ${d.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;function DrawerBottom(e){var{children:t,onClose:o,isOpen:c,onOpenChange:d,isMobile:u,classNames:h,isLinear:f,overlayClassName:b,contentClassName:v,handlerClassName:y,drawerOverlayProps:E}=e,S=(0,n._)(e,["children","onClose","isOpen","onOpenChange","isMobile","classNames","isLinear","overlayClassName","contentClassName","handlerClassName","drawerOverlayProps"]);let{isDragging:_,handleDragStart:w,handleDragEnd:O}=(0,l.u)(),{onDrag:x,onRelease:P}=S,k=(0,n._)(S,["onDrag","onRelease"]);return u?i.createElement(s.dy.Root,Object.assign({},k,{open:c,onOpenChange:d,onClose:o,onDrag:(e,t)=>{w(),null==x||x(e,t)},onRelease:(e,t)=>{O(),null==P||P(e,t)}}),i.createElement(s.dy.Portal,null,i.createElement(g,Object.assign({className:(0,r.default)(b,"drawer__overlay")},E)),i.createElement(p,{isDragging:_,className:(0,r.default)(v,"drawer__content"),"data-is-linear":f},i.createElement(s.dy.Title,{style:{display:"none"}}),i.createElement(m,{className:(0,r.default)(y,"drawer__handle")}),t))):i.createElement(a.u,Object.assign({withCloseButton:!0,centered:!0,zIndex:500,size:"auto",classNames:h,radius:"lg"},S,{onClose:o,opened:c,styles:{root:{maxHeight:"400px"},body:{background:f?"linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 20%)":void 0}}}),t)}},FeZt:function(e,t,o){o.d(t,{B:function(){return g},F:function(){return h},G:function(){return m},S:function(){return d},a:function(){return fetchSSOV2ApiJson},c:function(){return checkUserExist},f:function(){return fetchSSOV2Api},g:function(){return getUserInfo},h:function(){return handleAuthSuccess},l:function(){return u},r:function(){return resetPassword},u:function(){return updateUserInfo},w:function(){return p}});var n=o("6eqW"),i=o("GOBr"),r=o("XKpd"),a=o("Jbia"),l=o("27Mu"),s=o("PmKk"),c=o("xrdX");let d={LOGIN_BY_SOCIAL:"member/social-login",EMAIL:{REGISTER_BY_SEND_OTP:"login/login-with-email",LOGIN_BY_PASSWORD:"member/login",VERIFY_BY_OTP:"login/email-verify-code",SEND_OTP:"login/email-resend-otp-code"},PHONE:{REGISTER_BY_SEND_OTP:"login/login-with-sms",SEND_OTP:"login/sms/sent-otp",VERIFY_BY_OTP:"login/phone-verify-code",LOGIN_BY_PASSWORD:"member/login-by-phone",UPDATE_PHONE_SEND_OTP:"login/sms-social/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/phone-verify-code"},WHATSAPP:{LOGIN_OTP_WHATSAPP:"login/login-otp-whatsapp",REGISTER_BY_SEND_OTP:"login/login-with-whatsapp",SEND_OTP:"login/whatsapp/sent-otp",UPDATE_PHONE_SEND_OTP:"login/sms-social/whatsapp/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/whatsapp-verify-code",VERIFY_BY_OTP:"login/whatsapp-verify-code"},ZALO:{REGISTER_BY_SEND_OTP:"login/login-with-zalo",SEND_OTP:"login/zalo/sent-otp",VERIFY_BY_OTP:"login/zalo-verify-code",UPDATE_PHONE_SEND_OTP:"login/sms-social/zalo/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/zalo-verify-code"},RESET_PASSWORD:"login/reset-password",CHECK_USER_EXIST:"member/check-user-exist",UPDATE_USER_INFO:"login/update-first-info",SETUP_USER_INFO:"login/setup-first-info",ECOM_CARE:{SEND_OTP:"login/ecom-care/send-email-otp-code",VERIFY_OTP:"login/ecom-care/email-verify-code",RESEND_OTP:"login/ecom-care/resend-email-otp-code"}},u="vi-VN",p={[s.L.Vietnam]:"1",[s.L.Indonesia]:"2",[s.L.Malaysia]:"3"}[u];a.L[u].PHONE;let getSSOV2ApiUrl=e=>(0,r.n)(`${(0,r.a)(u)}/api/v2/${e}`),getSSOApiUrl=e=>(0,r.n)(`${(0,r.a)(u)}/api/${e}`),g="hhg_user_token",fetchSSOV2Api=(e,t={},o)=>(0,n.a)(void 0,void 0,void 0,function*(){var n;let i;let r=o?"":null===(n=document.cookie.split("; ").find(e=>e.startsWith(g)))||void 0===n?void 0:n.split("=")[1];try{t.body instanceof FormData&&(t.body.append("ga_client_id",(0,l.ej)("_ga")||""),t.body.append("referrer",window.location.href)),i=yield fetch(getSSOV2ApiUrl(e),r?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${r}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==i?void 0:i.json()}),fetchSSOV2ApiJson=(e,t,o)=>(0,n.a)(void 0,void 0,void 0,function*(){var n;let i;let r=o?"":null===(n=document.cookie.split("; ").find(e=>e.startsWith(g)))||void 0===n?void 0:n.split("=")[1];try{i=yield fetch(getSSOV2ApiUrl(e),{method:"POST",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},r?{Authorization:`Bearer ${r}`}:{}),body:JSON.stringify(t)})}catch(e){return console.error(e),null}return null==i?void 0:i.json()}),fetchSSOApi=(e,t={},o)=>(0,n.a)(void 0,void 0,void 0,function*(){var n;let i;let r=o?"":null===(n=document.cookie.split("; ").find(e=>e.startsWith(g)))||void 0===n?void 0:n.split("=")[1];try{i=yield fetch(getSSOApiUrl(e),r?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${r}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==i?void 0:i.json()}),resetPassword=(e,t)=>(0,n.a)(void 0,void 0,void 0,function*(){let o=new FormData;return o.append("password",e),o.append("confirm-password",t),fetchSSOV2Api(d.RESET_PASSWORD,{method:"POST",body:o})}),checkUserExist=({email:e,phone:t})=>(0,n.a)(void 0,void 0,void 0,function*(){let o=new FormData;return e?o.append("email",e):o.append("phone_number",t),fetchSSOV2Api(d.CHECK_USER_EXIST,{method:"POST",body:o})}),updateUserInfo=e=>(0,n.a)(void 0,void 0,void 0,function*(){let t=new FormData;return Object.keys(e).forEach(o=>{let n=e[o];null!=n&&("string"!=typeof n||n.trim())&&t.append(o,e[o])}),fetchSSOV2Api(d.SETUP_USER_INFO,{method:"POST",body:t})}),m=i.y?"289442006438-040a42cbidr6v5d178f3iqi9q95821r3.apps.googleusercontent.com":"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",h="2759888574045636",getUserInfo=()=>(0,n.a)(void 0,void 0,void 0,function*(){return fetchSSOApi("user/profile",{method:"POST"})}),handleAuthSuccess=e=>{(null==e?void 0:e.token)&&(0,l.d8)(g,e.token,{domain:"localhost"===window.location.hostname?"localhost":`.${c.v[u]}`,expires:new Date(1e3*e.expire_in).toUTCString()}),(null==e?void 0:e.refresh_token)&&(0,l.d8)(a.k,e.refresh_token,{domain:"localhost"===window.location.hostname?"localhost":`.${c.v[u]}`})}},Huya:function(e,t,o){o.d(t,{B:function(){return BlueWhiteLogin},N:function(){return NavigationProfileButton},U:function(){return UserPlain},a:function(){return O},b:function(){return NavigationProvider},u:function(){return useCSSFocusPopupHelper}});var n=o("6eqW"),i=o("q1tI"),r=o("nmRb"),a=o("Ner0"),l=o("TH2c"),s=o("p3w3"),c=o("ZQ3V"),d=o("ZKGu"),u=o("i2MM"),p=o("iBNF"),g=o("rBCA"),m=o("K2Xj"),h=o("gEnE"),f=o("xXM3"),b=o.n(f),v=o("Jbia"),y=o("4fTT"),E=o("XKpd"),S=o("xrdX"),_=o("QHxc"),w=o("hPj0");let BlueWhiteLogin=e=>i.createElement("svg",Object.assign({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i.createElement("rect",{y:"0.5",width:"31",height:"31",rx:"15.5",fill:"white"}),i.createElement("path",{d:"M15.4999 14.3797C16.9062 14.3797 18.0462 13.2397 18.0462 11.8334C18.0462 10.4271 16.9062 9.28711 15.4999 9.28711C14.0936 9.28711 12.9536 10.4271 12.9536 11.8334C12.9536 13.2397 14.0936 14.3797 15.4999 14.3797Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M19.9092 22.0335C20.7055 21.7825 21.124 20.9029 20.786 20.1399C19.8879 18.1112 17.861 16.6946 15.4999 16.6946C13.1388 16.6946 11.112 18.1112 10.2138 20.1399C9.87585 20.9038 10.2944 21.7825 11.0907 22.0335C12.2249 22.3909 13.7258 22.7131 15.4999 22.7131C17.274 22.7131 18.7749 22.3909 19.9092 22.0335Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),UserPlain=e=>i.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i.createElement("path",{d:"M9.99991 8.3797C11.4062 8.3797 12.5462 7.23969 12.5462 5.83341C12.5462 4.42712 11.4062 3.28711 9.99991 3.28711C8.59363 3.28711 7.45361 4.42712 7.45361 5.83341C7.45361 7.23969 8.59363 8.3797 9.99991 8.3797Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M14.4092 16.0335C15.2055 15.7825 15.624 14.9029 15.286 14.1399C14.3879 12.1112 12.361 10.6946 9.99992 10.6946C7.63881 10.6946 5.61196 12.1112 4.71381 14.1399C4.37585 14.9038 4.79436 15.7825 5.59066 16.0335C6.72492 16.3909 8.22584 16.7131 9.99992 16.7131C11.774 16.7131 13.2749 16.3909 14.4092 16.0335Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),useNavConfig=({locale:e,projectType:t,siteType:o,enableBookingBtn:n})=>{let r=(0,i.useMemo)(()=>{let i="discover"===t||"together"===t||"marryBaby"===t||"profile"===t&&"marryBaby"===o,r="marryBaby"!==o&&"marryBaby"!==t&&v.C.includes(e),a=n&&"marryBaby"!==t&&"discover"===t&&"marryBaby"!==o&&v.d.includes(e),l="marryBaby"===t||v.c.includes(e),s="marryBaby"!==o&&v.E.includes(e),c="marryBaby"!==o&&v.E.includes(e),d=v.V.includes(e),u=v.H.includes(e),p=v.e.includes(e),g=(0,E.g)(e,"marryBaby"===o),m=g;"undefined"!=typeof window&&(m.includes("//id.")&&(m=m.replace("id.","")),m.includes("//staging-id.")&&(m=m.replace("staging-id.","discover.")));let h=(0,E.a)(e,"marryBaby"===o),f={HOME_PAGE_URL:m,CARE_URL_FE:`${m}/care`,TOGETHER_URL_FE:`${m}/community`,VIDEO_URL_FE:`${m}/videos`,SSO_URL:h,TOGETHER_API:(0,E.b)(),DISCOVER_API:(0,E.c)(e)};return{enableSearchBar:i,enableNavCare:r,enableNavCareBooking:a,enableNavTogether:l,enableNavEcom:s,enableProfileEcom:c,enableNavVideo:d,enableProfileMyHealth:!0,enableNavDiscover:!0,enableNavHealthTools:!0,enableProfileMySaved:!0,statics:f,enableNavClinityDownload:u,enableNavCartCare:p}},[]);return r},O=i.createContext({}),NavigationProvider=e=>{var{children:t}=e,o=(0,n._)(e,["children"]);let[r,a]=i.useState(()=>o.currentUrl||`https://${"marryBaby"===o.siteType?y.d[o.locale||"en-PH"]:S.v[o.locale||"en-PH"]}${"together"===o.projectType?"/community":"ecom"===o.projectType?"/ecom":"care"===o.projectType?"/care":""}/`);(0,i.useEffect)(()=>{let update=()=>{a(window.location.href)};return window.addEventListener("popstate",update),update(),()=>{window.removeEventListener("popstate",update)}},[]);let l=useNavConfig({locale:o.locale,projectType:o.projectType,siteType:o.siteType,enableBookingBtn:o.enableBookingBtn});return i.createElement(O.Provider,{value:Object.assign(Object.assign({},o),{customClasses:o.customClasses||{},configs:Object.assign(Object.assign({},l),o.configs),currentUrl:o.currentUrl||r})},t)},useCSSFocusPopupHelper=e=>{let{allowBgScroll:t}=e||{},o=(0,i.useRef)();return{containerRef:o,onContainerFocus:()=>{t||(document.documentElement.style.overflow="hidden")},onContainerBlur:()=>{t||(document.documentElement.style.overflow="")},onButtonMouseDown:e=>{o.current&&(document.activeElement===o.current||o.current.contains(document.activeElement))&&(o.current.blur(),document.activeElement.blur(),e.preventDefault())},onClose:()=>{o.current&&(document.activeElement===o.current||o.current.contains(document.activeElement))&&(o.current.blur(),document.activeElement.blur())}}},x=(0,h.Z)(g.Z.div` position: absolute; right: 0; transition: all 0.5s ease-in-out; overflow-y: auto; &[data-open='true'] { z-index: 200; top: 120%; opacity: 1; visibility: visible; } &[data-open='false'] { display: none; } .popup-content { z-index: 111; height: 100%; border: 1px solid #0000001a; border-radius: 16px; border-top-left-radius: 0; border-top-right-radius: 0; } /* min-height: 415px; */ ${m.M.mbUp} { width: 320px; } ${m.M.mbDown} { position: fixed; left: 0; width: 100%; padding-bottom: 70px; } `,"hhgcomp-navprofilebutton-popup"),P=(0,h.Z)(g.Z.div` position: fixed; z-index: 150; top: var(--header-bottom, 56px); left: 0; width: 100%; height: 100%; align-items: center; ${m.M.mbUp} { background-color: transparent; &[data-type='welcome'] { background: rgba(38, 38, 38, 0.3); } &[data-type='due-date'] { background: rgba(38, 38, 38, 0.3); } } ${m.M.mbDown} { background: rgba(38, 38, 38, 0.3); } &[data-type='welcome'] { top: 0; } &[data-open='false'] { display: none; } `,"hhgcomp-navprofilebutton-popupwrapper"),k=g.Z.div` width: 36px; height: 36px; cursor: pointer; img { border-radius: 50%; } .avatar { width: 36px; height: 36px; object-fit: cover; } .avatar-default { display: flex; align-items: center; justify-content: center; background-color: ${p.r.colors.secondaryBase}; border-radius: 50%; color: white; font-size: 20px; font-weight: bold; } `,C=g.Z.div` display: inline-flex; position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; cursor: pointer; .user-close-icon { display: none; } &:focus-within { .user-close-icon { display: block; } .user-avatar { display: none; } ${x.classSelector} { z-index: 200; top: 120%; opacity: 1; visibility: visible; display: initial; ${m.M.mbDown} { top: 100%; } } ${P.classSelector} { display: initial; } } `,T=g.Z.a` display: inline-flex; .login-btn[data-color='tertiary'][data-size='md'] { padding-left: 12px; padding-right: 12px; } .mobile-only { ${m.M.mbUp} { display: none; } } .login-btn { display: none; ${m.M.mbUp} { display: block; border: 1px solid ${p.r.colors.neutral100}; } } &[data-win-cash-back-theme='true'] { .login-btn { ${m.M.mbUp} { color: ${p.r.colors.white}; } } } `,ProfilePopup=({isOpen:e,userInfo:t,closePopup:o,siteType:n="helloSites",dispatchLogout:r})=>{let{customClasses:a={},configs:{enableProfileFindMyBooking:l}}=(0,i.useContext)(O);return i.createElement(x,{className:a.profilePopup,"data-open":e},i.createElement("div",{className:b()("popup-content",a.profilePopupContent)},i.createElement(_.l,{siteType:n,onLogout:()=>{r&&(r(),o())},userInfo:t,configs:{enableProfileFindMyBooking:l}})))},NavigationProfileButton=({userInfo:e,siteType:t,onLoginClick:o,currentUrl:g,isMinifyLogin:m,onLogout:h,style:f,isLoading:b,isMobile:v,className:y})=>{let{isWinCashBackTheme:E}=(0,i.useContext)(O),{t:S}=(0,d.u)(),[_,x]=(0,i.useState)(!1),P=(null==e?void 0:e.name)||(null==e?void 0:e.username),{containerRef:B,onContainerFocus:N,onContainerBlur:A,onButtonMouseDown:D,onClose:R}=useCSSFocusPopupHelper(),U=(0,i.useMemo)(()=>v&&"helloSites"===t,[v]);return b?U?i.createElement(a.S,null):i.createElement(s.B,{size:"sm",color:"transparent",loading:!0}):(null==e?void 0:e.id)?i.createElement(i.Fragment,null,i.createElement(C,{ref:B,style:f,tabIndex:0,onBlur:A,onFocus:()=>{var e;N();let t=null===(e=B.current)||void 0===e?void 0:e.querySelector("#navigation-v2 .hhgcomp-navprofilebutton-popup");if(t){let e=t.getBoundingClientRect(),o=e.top,n=`calc(100vh - ${o}px)`;t.setAttribute("style",`max-height: ${n};`)}},className:y},i.createElement("div",{onMouseDown:D},i.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"user-close-icon"},i.createElement("path",{d:"M18 6L6 18M18 18L6 6",stroke:"#3E3F58",strokeWidth:"1.3",strokeLinecap:"round"})),i.createElement(l.A,{size:32,className:"user-avatar",src:null==e?void 0:e.avatar,color:"marryBaby"===t?p.r.mbColors.pink:p.r.colors.secondaryBase,placeholderText:P&&P.length?P[0].toUpperCase():"A"})),i.createElement(ProfilePopup,{dispatchLogout:()=>{R(),x(!0)},isOpen:!1,closePopup:R,siteType:t,userInfo:e})),i.createElement(w.F,{openLogoutPopup:_,onCloseHandler:()=>{document.body.classList.toggle("noscroll",!1),x(!1)},siteType:t,onLogoutHandler:()=>(0,n.a)(void 0,void 0,void 0,function*(){x(!1),document.body.classList.toggle("noscroll",!1),yield h()})})):i.createElement(T,{style:Object.assign({textDecoration:"none"},f),"data-event-category":"Sign Up","data-event-action":"Button Click","data-event-label":g,"data-win-cash-back-theme":E,"data-site-type":t,onClick:o},m?i.createElement(k,null,i.createElement("img",{src:u.C.getAssetPath("lock.png"),className:"avatar",loading:"lazy",alt:"avatar"})):i.createElement(i.Fragment,null,"helloSites"===t&&(U?E?i.createElement(BlueWhiteLogin,{className:"mobile-only",style:{cursor:"pointer",width:32,height:32,flexShrink:0}}):i.createElement("img",{className:"mobile-only",src:u.C.getAssetPath("login.svg"),style:{cursor:"pointer",height:24,width:24}}):i.createElement(s.B,{className:"mobile-only",size:"sm",leftIcon:i.createElement(r.Z,{color:"currentColor",isSolid:!0,size:22}),sx:{paddingLeft:"8px",paddingRight:"12px"},styles:{leftIcon:{marginRight:4}}},S("navigation.loginJoin"))),"marryBaby"===t&&i.createElement("div",{className:"mobile-only",style:{paddingLeft:16}},i.createElement(c.T,{size:"p3",color:p.r.mbColors.pink},S("navigation.loginJoin"))),"marryBaby"===t?i.createElement(s.B,{className:"login-btn",size:"md",leftIcon:i.createElement(r.Z,{color:"currentColor",isSolid:!0,size:22})},S("navigation.loginJoin")):i.createElement(s.B,{className:"login-btn",size:"md",leftIcon:E?i.createElement(UserPlain,{style:{flexShrink:0,width:20,height:20}}):i.createElement(r.Z,{color:"#595959",isSolid:!0,size:22}),variant:"ghost",color:"#262626",sx:{fontWeight:500,fontSize:14,lineHeight:22}},S("navigation.loginJoin"))))}}}]);