"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[2060,7932],{37932:function(e,t,a){a.d(t,{n:function(){return $e}});var o=a(73884),i=a.n(o),n=a(51387),l=a(6596),r=a(39530),s=a(73827),c=a(42060),d=a(14677),p=a(99312),u=a(20486),h=a(6806),g=a(11851),b=a(35291),m=a(36257),y=a(91266),f=a(35616),v=a.n(f),x=a(27516);const w=({className:e,color:t})=>i().createElement("svg",{width:"14",height:"20",viewBox:"0 0 14 20",className:e},i().createElement("path",{d:"M7 0C3.134 0 0 3.134 0 7C0 10.966 4.404 16.82 6.226 19.071C6.626 19.565 7.374 19.565 7.774 19.071C9.596 16.82 14 10.966 14 7C14 3.134 10.866 0 7 0ZM7 9.5C5.619 9.5 4.5 8.381 4.5 7C4.5 5.619 5.619 4.5 7 4.5C8.381 4.5 9.5 5.619 9.5 7C9.5 8.381 8.381 9.5 7 9.5Z",fill:t||"currentColor"})),S=g.A.li` display: flex; align-items: center; gap: 12px; padding: 8px 16px; > :first-child { flex: 1; } > :nth-child(2) { flex: 6; } & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${b.w.colors.neutral100}; } `,C="url(\"data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.9803 0.990669C16.7205 0.99841 16.4739 1.10699 16.2928 1.2934L5.99984 11.5864L2.70687 8.2934C2.61473 8.19743 2.50436 8.12081 2.38223 8.06802C2.2601 8.01524 2.12867 7.98735 1.99563 7.986C1.86259 7.98464 1.73061 8.00985 1.60743 8.06014C1.48426 8.11043 1.37235 8.18479 1.27827 8.27887C1.1842 8.37295 1.10983 8.48485 1.05954 8.60803C1.00926 8.73121 0.98405 8.86318 0.985403 8.99622C0.986757 9.12926 1.01464 9.26069 1.06743 9.38282C1.12021 9.50495 1.19684 9.61532 1.29281 9.70747L5.29281 13.7075C5.48035 13.8949 5.73467 14.0002 5.99984 14.0002C6.26501 14.0002 6.51933 13.8949 6.70687 13.7075L17.7069 2.70747C17.8514 2.567 17.9501 2.38616 17.99 2.18864C18.03 1.99112 18.0093 1.78614 17.9308 1.60055C17.8523 1.41497 17.7195 1.25744 17.5499 1.14861C17.3803 1.03978 17.1817 0.984729 16.9803 0.990669Z' fill='%232685F1'/%3E%3C/svg%3E%0A\")",k=(g.A.div` display: flex; position: absolute; top: 48px; min-width: 100%; box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); border-radius: ${b.w.borderRadius}; background-color: white; z-index: 30; ${m.M.tdDown} { position: relative; top: 0; box-shadow: initial; } `,g.A.ul` width: 100%; max-height: 600px; overflow-y: auto; `,(0,g.A)(w)` width: 12px; height: 18px; `,g.A.li` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; ${({isSelected:e})=>e&&`\n &::after {\n content: ${C};\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${b.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${b.w.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; } `,(0,g.A)((({count:e,className:t})=>i().createElement(i().Fragment,null,[...Array(e)].map(((e,a)=>i().createElement(S,{className:t,key:a},i().createElement(y.A,{count:1,height:32}),i().createElement(y.A,{count:1,height:24})))))))` &:first-child { padding-top: 18px; } `,(e,t,a)=>v()(e,Object.assign(Object.assign({},t),{domain:x.y[a||"en-PH"]})));var E=a(17989),O=a(72809),j=a(38221),L=a.n(j),$=a(66189),I=a(40503),T=a(26662),P=a(15096),M=a(85509);const D="api/lists/cities?keyword={keyword}&country_id={countryId}&site={domain}&_nopaging={noPaging}&client={client}",F="api/v2/search/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}&specialty_id={specialty_id}&client_slug={client_slug}&msd={msd}&skip_booking={skipBooking}",N="api/geobyip?site={domain}&latitude={lat}&longitude={lng}&_nopaging={noPaging}&client={client}",R="api/v2/specialties/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}&msd={msd}",A="api/search/keywords?site={domain}&sort_by={sort_by}&sort_order={sort_order}&type={searchType}",K=g.A.div``,B=g.A.div` background-color: ${b.w.colors.neutral50}; padding-bottom: 1px; ${m.M.mbDown} { padding: 0 16px 10px; } `,z=(0,g.A)(I.C)` padding: 0 16px; ${m.M.mbDown} { padding: 0; } `,_=g.A.div` padding: 24px 56px; border-radius: 16px; background-color: ${b.w.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); ${m.M.mbDown} { padding: 16px 16px; border-radius: 0px 0px 12px 12px; } .flex-search-input { flex-direction: row; ${m.M.mbDown} { flex-direction: column; } } `,q={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},V={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:[]};var W;function G(e){const{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function H(e,t){var a,o;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case W.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case W.ClickOutsideInputLocation:return"location"!==e.focused?e:G(Object.assign(Object.assign({},e),{focused:"none"}));case W.ClickOutsideInputSpecialty:return"specialty"!==e.focused?e:G(Object.assign(Object.assign({},e),{focused:"none"}));case W.ClickOutsideInputSearch:return"search"!==e.focused?e:Object.assign(Object.assign({},e),{focused:"none"});case W.ClickOutsideInputSearchSpecialty:return"search"!==e.focusedSpecialty?e:Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case W.FocusInputLocation:{const t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===$.a&&(t.searchLocationKeywords=""),t}case W.FocusInputSpecialty:{const t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(o=e.selectedLocation)||void 0===o?void 0:o.id)===$.a&&(t.searchLocationKeywords=""),t}case W.FocusInputSearch:const i=Object.assign(Object.assign({},e),{focused:"search"});return e.isMobile?G(i):i;case W.FocusInputSearchSpecialty:return Object.assign(Object.assign({},e),{focusedSpecialty:"search"});case W.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case W.ChangeInputSearch:{const a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>q[e.locale]})}case W.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case W.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case W.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case W.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case W.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload});case W.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case W.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case W.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case W.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case W.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case W.FetchSearchResultsComplete:return Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});case W.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload;const{default:o}=t.payload;a=a.filter((e=>e.id!==o.id)),o&&a.unshift(o),e.initialSelectedCity&&!a.find((t=>t.id===e.initialSelectedCity.id))&&a.unshift(e.initialSelectedCity);const i=Object.assign(Object.assign({},e),{defaultCity:o,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(i.selectedLocation=o,i.searchLocationKeywords=o.name),i}case W.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case W.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case W.DisplayInitialSearchResults:return Object.assign(Object.assign({},e),{searchResults:e.initialSearchResults,isLoadingSearchResults:!1});case W.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case W.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case W.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case W.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case W.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case W.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case W.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case W.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case W.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}!function(e){e.NavigateTo="navigate to url",e.ClickOutsideInputLocation="click outside input location",e.ClickOutsideInputSearch="click outside input search",e.ClickOutsideInputSearchSpecialty="click outside input search specialty",e.ClickOutsideInputSpecialty="click outside input specialty",e.SelectCurrentLocation="select current location",e.FocusInputLocation="focus input location",e.FocusInputSearch="focus input search",e.FocusInputSearchSpecialty="focus input search specialty",e.ChangeInputLocation="change input location",e.ChangeInputSearch="change input search",e.ClearInputLocation="clear input location",e.ClearInputSearch="clear input search",e.SelectLocation="select location",e.SelectSpecialty="select specialty",e.FetchCitiesStart="fetch cities start",e.FetchCitiesFinish="fetch cities finish",e.FetchSearchResultsStart="fetch search results start",e.FetchSearchResultsComplete="fetch search results complete",e.FetchSearchResultsFinish="fetch search results finish",e.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",e.FetchCitiesByKeywordComplete="fetch cities by keyword finish",e.DisplayInitialCities="display initial cities",e.DisplayInitialSearchResults="display initial search results",e.UpdateInitialSearchResults="update initial search results",e.GrantGeoLocationPermission="grant geolocation permission",e.DenyGeoLocationPermission="deny geolocation permission",e.OpenMobileModal="open mobile modal",e.CloseMobileModal="close mobile modal",e.UpdateInitialSearchValue="update initial search value",e.SelectSearchResult="select search result",e.SetInputSearchPlaceholder="set input search placeholder",e.FocusInputSpecialty="focus input specialty",e.FetchAllSpecialties="fetch all specialty",e.FetchPopularKeys="fetch popular key by type"}(W||(W={}));const U=g.A.div` flex: 1; position: relative; ${m.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,Q=g.A.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${b.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${m.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,Y=g.A.div``,Z=g.A.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${b.w.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${b.w.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `,J=g.A.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,X=g.A.div` display: flex; gap: 12px; align-items: center; cursor: pointer; &:hover { background-color: ${b.w.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 ${b.w.colors.neutral100}; .title { color: ${b.w.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${b.w.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; } } `;g.A.div` padding: 0 16px 16px; .search-detail-btn { color: ${b.w.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;const ee=({state:e,type:t,results:a,location:l,isLoading:r,typeInformation:s,clientSlug:c="",dispatch:d})=>{const{locale:p,t:u}=(0,O.u)(),{selectedLocation:h}=e,g=(0,o.useMemo)((()=>s[t].slug),[s,t]);return i().createElement(Y,null,i().createElement(Z,null,i().createElement("div",{className:"title"},u("booking.searchResult.description",{search_type:s[t].name,search_location:l})),a.length>0&&i().createElement("div",{className:"btn-see-all",onClick:()=>{let a=`/${h.slug}/${g}`;const o=$.M[p][c];o&&(a+=`/${o}`),("doctor"===t||"hospital"===t)&&e.selectedSpecialty.id>0&&(a+=`?specialtyId=${e.selectedSpecialty.id}`),a&&d({type:W.NavigateTo,payload:a})}},u("home.seeAll"))),i().createElement(J,null,r&&Array(3).fill(void 0).map(((e,a)=>i().createElement(X,{key:t+"loading"+a,className:2===a?"last-item":""},i().createElement("div",{className:"image-item"},i().createElement(n.E,{height:48,circle:!0,mb:"xl",animate:!0})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},i().createElement(n.E,{height:8,mt:10,radius:"xl",animate:!0})),i().createElement("div",{className:"description"},i().createElement("div",{className:"sub-description"},i().createElement(n.E,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!r&&a&&a.length>0&&i().createElement(i().Fragment,null,a.map(((e,o)=>{var n,l;const r=a.length>4&&3===o||a.length<=4&&o===a.length-1;let c="";return"hospital"===t&&(c=(null===e||void 0===e?void 0:e.address)||""),"doctor"===t&&(c=(null===(n=null===e||void 0===e?void 0:e.specialties)||void 0===n?void 0:n.join(", "))||""),"service"===t&&(c=(null===(l=null===e||void 0===e?void 0:e.hospital_branch)||void 0===l?void 0:l.name)||""),o>=4?i().createElement(i().Fragment,null):i().createElement(X,{key:e.id,className:r?"last-item":"",onClick:()=>(e=>{let a="";switch(t){case"service":a=`/${h.slug}/${g}/${e.slug}`;break;case"doctor":case"hospital":a=`/${g}/${e.slug}-${e.id}`}a&&d({type:W.NavigateTo,payload:a})})(e)},i().createElement("div",{className:"image-item"},i().createElement("img",{src:e.logo||e.avatar,alt:e.name})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},e.name),i().createElement("div",{className:"description"},s[t].icon,i().createElement("div",{className:"sub-description"},c))))}))),!r&&0===(null===a||void 0===a?void 0:a.length)&&i().createElement(P.T,{size:"sm",color:b.w.colors.gray400},u("booking.searchBar.noResults"))))},te=g.A.div` position: relative; ${m.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,ae=g.A.div` position: absolute; top: calc(100% + 2px); width: calc(100% + 100px); border-radius: 4px; background: ${b.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; max-height: 300px; overflow: auto; ${m.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,oe=g.A.li` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; .image-item { display: flex; align-items: center; width: 40px; height: 40px; img { width: 100%; object-fit: cover; } svg { width: 40px; } } ${({isSelected:e})=>e&&`\n &::after {\n content: ${C};\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${b.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${b.w.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; } `,ie=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),ne=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),le=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),re=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},i().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"})),se=({state:e,isMobile:t,debouncedFetchSearchResults:a,selectedLocation:n,onSpecialtyClick:r,dispatch:s})=>{var c;const{t:d,locale:p}=(0,O.u)(),u=(0,o.useRef)(null),h=(0,o.useMemo)((()=>$.L[p]),[p]),g=(0,o.useMemo)((()=>({wrapper:{"&:after":{content:'""',width:"1px",height:"20px",backgroundColor:"#E4E8EC",position:"absolute",right:0,top:"13px"}},input:{border:t?"border: 1px solid #d9d9d9":"none",height:t?"40px":"46px !important",paddingRight:"30px","&:focus":{boxShadow:t?"box-shadow: 0px 0px 0px 2px #91caff":"none"}},rightSection:{width:"30px",svg:{fontSize:"20px"}}})),[t]),b=(0,o.useCallback)((function(e){console.log(e)}),[a,s]);return(0,E.a)(u,(()=>{s({type:W.ClickOutsideInputSpecialty})})),i().createElement(te,{ref:u},i().createElement(l.p.Wrapper,null,i().createElement(l.p,{size:t?"md":"lg",placeholder:d("booking.searchPopup.specialties"),value:(null===(c=null===e||void 0===e?void 0:e.selectedSpecialty)||void 0===c?void 0:c.name)||"",rightSection:i().createElement(M.C,null),styles:g,onFocus:()=>s({type:W.FocusInputSpecialty}),onChange:e=>{b(e.target.value)}})),"specialty"===e.focused&&i().createElement(ae,null,i().createElement(oe,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{r&&r({name:d("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:h.SPECIALTIES})}},i().createElement("div",{className:"image-item"},i().createElement(re,null)),i().createElement(P.T,{size:"md"},d("booking.searchBar.allSpecialties"))),e.allSpecialties.map((e=>i().createElement(oe,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),r&&r(Object.assign(Object.assign({},e),{total_doctor:0}))},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null===n||void 0===n?void 0:n.id)===e.id},i().createElement("div",{className:"image-item"},i().createElement("img",{src:e.thumbnail,alt:e.name})),i().createElement(P.T,{size:"md"},e.name))))))},ce=({state:e,type:t,isMobile:a,isLoading:n,initalSearchValue:r,typeInformation:s,debouncedFetchSearchResults:c,trackingAttributes:d,hideSpecialtySelection:p=!1,clientSlug:u="",focusSearchInput:h,onSearch:g,onEnterSearch:b,dispatch:m})=>{var y;const{t:f}=(0,O.u)(),v=(0,o.useRef)(null),x=(0,o.useMemo)((()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{}),[d]),w=(0,o.useMemo)((()=>"doctor"===t?f("booking.searchBar.placeholder.doctor"):"service"===t?f("booking.searchBar.placeholder.service"):"hospital"===t?f("booking.searchBar.placeholder.hospital"):"specialty"===t?f("booking.searchBar.placeholder.specialty"):""),[t]),S=(0,o.useMemo)((()=>({root:{flex:1,"&.hide-specialty-selection":{".mantine-Input-rightSection":{display:"none"},input:{paddingLeft:"48px"},".mantine-Input-icon":{left:"0"}}}})),[]),C=(0,o.useMemo)((()=>({icon:{left:"165px"},input:{color:"#262626",'&[data-with-icon="true"]':{paddingLeft:"205px",paddingRight:"16px"}},rightSection:{left:0,width:"165px",padding:"1px"}})),[]),k=(0,o.useMemo)((()=>({input:{color:"#262626"}})),[]);(0,E.a)(v,(()=>{m({type:W.ClickOutsideInputSearch})}));const j=(0,o.useCallback)((function(a){m({type:W.ChangeInputSearch,payload:a}),"function"!==typeof g&&(a.trim().length>q[e.locale]||r||0===a.trim().length?c(a.trim(),e,t,u):(c.cancel(),m({type:W.DisplayInitialSearchResults})))}),[m,e,t]),L=(0,o.useCallback)((function(e){m({type:W.SelectSpecialty,payload:e}),h()}),[m]),$=(0,o.useCallback)((e=>{13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),b&&b())}),[b]);return i().createElement(U,{ref:v},"specialty"===t?i().createElement(l.p.Wrapper,{styles:S},i().createElement(l.p,{icon:i().createElement(T.A,null),size:a?"md":"lg",placeholder:w,styles:k,value:e.searchKeywords,onFocus:()=>m({type:W.FocusInputSearchSpecialty}),onChange:e=>{j(e.target.value)},onKeyDown:$})):i().createElement(i().Fragment,null,"service"===t?i().createElement(l.p.Wrapper,{styles:S},i().createElement(l.p,{icon:i().createElement(T.A,null),size:a?"md":"lg",name:"search-results",placeholder:w,onFocus:()=>m({type:W.FocusInputSearch}),value:e.searchKeywords,onChange:e=>{j(e.target.value)},onKeyDown:$})):i().createElement(i().Fragment,null,a&&!p?i().createElement(i().Fragment,null,i().createElement(se,{state:e,isMobile:a,dispatch:m,debouncedFetchSearchResults:c,onSpecialtyClick:L}),i().createElement(l.p.Wrapper,{styles:S},i().createElement(l.p,{icon:i().createElement(T.A,null),size:"md",placeholder:w,value:e.searchKeywords,name:"search-results",onFocus:()=>m({type:W.FocusInputSearch}),onChange:e=>{j(e.target.value)},onKeyDown:$}))):i().createElement(l.p.Wrapper,{styles:S,className:p?"hide-specialty-selection":""},i().createElement(l.p,Object.assign({icon:i().createElement(T.A,null),size:"lg",placeholder:w,styles:C,name:"search-results",autoComplete:"off",value:e.searchKeywords,onChange:e=>{j(e.target.value)},onFocus:()=>m({type:W.FocusInputSearch}),onKeyDown:$},x,{rightSection:p?i().createElement(i().Fragment,null):i().createElement(se,{state:e,isMobile:a,dispatch:m,debouncedFetchSearchResults:c,onSpecialtyClick:L})})))),"search"===e.focused&&i().createElement(Q,null,i().createElement(ee,{type:t,state:e,results:(null===(y=e.searchResults)||void 0===y?void 0:y[t])||[],location:e.selectedLocation.name,dispatch:m,isLoading:n,typeInformation:s,clientSlug:u}))))},de=g.A.div` position: relative; ${m.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,pe=g.A.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${b.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${m.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,ue=g.A.div` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; ${({isSelected:e})=>e&&`\n &::after {\n content: ${C};\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${b.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${b.w.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; } `,he=(0,g.A)(w)` width: 12px; height: 18px; flex: 0 0 12px; `,ge=({state:e,isMobile:t,debouncedFetchCitiesByKeyword:a,selectedLocation:n,trackingAttributes:s,onLocationClick:c,dispatch:d})=>{const{t:p,locale:u}=(0,O.u)(),h=(0,o.useRef)(null),g=(0,o.useMemo)((()=>s?{"data-event-category":s.dataEventCategory,"data-event-action":s.dataEventAction,"data-event-label":s.dataEventLabel}:{}),[s]),m=(0,o.useCallback)((function(t){d({type:W.ChangeInputLocation,payload:t}),t.trim().length>q[e.locale]?a(t.trim()):(a.cancel(),d({type:W.DisplayInitialCities}))}),[a,d]);return(0,E.a)(h,(()=>{d({type:W.ClickOutsideInputLocation})})),i().createElement(de,{ref:h},i().createElement(l.p.Wrapper,null,i().createElement(l.p,Object.assign({size:t?"md":"lg",placeholder:"Search location",value:e.searchLocationKeywords,onFocus:()=>d({type:W.FocusInputLocation}),onChange:e=>{m(e.target.value)}},g))),"location"===e.focused&&i().createElement(pe,null,i().createElement(r.F,{scrollbarSize:6,styles:{viewport:{maxHeight:400}}},i().createElement(ue,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;c&&c({name:p("booking.searchBar.allLocations"),id:$.I,slug:null===(e=$.L[u])||void 0===e?void 0:e.ALL})}},i().createElement(he,{color:b.w.colors.neutral400}),i().createElement(P.T,{size:"md"},p("booking.searchBar.allLocations"))),e.cities.map((e=>i().createElement(ue,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),c&&c(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null===n||void 0===n?void 0:n.id)===e.id},i().createElement(he,{color:b.w.colors.neutral400}),i().createElement(P.T,{size:"md"},e.name)))))))},be=g.A.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${m.M.mbDown} { margin-top: 12px; } `,me=g.A.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${b.w.colors.neutral100}; background: ${b.w.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${b.w.colors.blue50}; } ${m.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${m.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: ${b.w.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${b.w.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,ye=(0,g.A)(s.c)` margin: 24px 0 !important; `,fe=g.A.div` display: flex; justify-content: center; margin-top: 24px; .show-more { border-radius: 4px; border: 1px solid ${b.w.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${b.w.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${m.M.mbDown} { width: 100%; text-align: center; } } `,ve=({state:e,isMobile:t,specialties:a,isLoading:l,dispatch:r})=>{const{t:s,locale:c}=(0,O.u)(),{selectedLocation:d}=e,p=(0,o.useMemo)((()=>$.L[c]),[c]),u=(0,o.useMemo)((()=>a.length>=9||e.searchKeywords.trim().length<=q[e.locale]),[e.searchKeywords,a]);return i().createElement(i().Fragment,null,!t&&i().createElement(ye,{color:"#E4E8EC"}),i().createElement(be,null,a.length>0&&!l&&i().createElement(i().Fragment,null,a.map(((e,t)=>t>=9?i().createElement(i().Fragment,null):i().createElement(me,{key:e.id,onClick:()=>(e=>{let t="";e===$.S?(t=`/${d.slug}/${p.HOSPITAL}/${$.C.GSK}/`,r({type:W.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${p.DOCTOR}/${e}`,r({type:W.NavigateTo,payload:t})})(e.slug)},i().createElement("div",{className:"image-item"},i().createElement("img",{src:e.thumbnail,alt:e.name})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},e.name)))))),0===a.length&&!l&&i().createElement(P.T,{size:"sm",color:b.w.colors.gray400},s("booking.searchBar.noResults")),l&&Array(6).fill(void 0).map(((e,t)=>i().createElement(me,{key:"loading"+t},i().createElement("div",{className:"image-item"},i().createElement(n.E,{height:40,animate:!0})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},i().createElement(n.E,{height:20,radius:"sm",animate:!0}))))))),u&&i().createElement(fe,null,i().createElement("div",{className:"show-more",onClick:()=>{const e=`/${p.SPECIALTIES}`;r({type:W.NavigateTo,payload:e})}},s("home.seeAll"))))},xe=g.A.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,we=g.A.div` color: ${b.w.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${b.w.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${b.w.colors.white}; margin-bottom: 5px; border-color: ${b.w.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${b.w.colors.blue50}; background: ${b.w.colors.blue50}; color: ${b.w.colors.blue600}; &:hover { border-color: ${b.w.colors.blue50}; background: ${b.w.colors.blue50}; color: ${b.w.colors.blue600}; } } &:hover { border-color: ${b.w.colors.neutral100}; background: #f7f9fc; } `,Se=g.A.div` color: ${b.w.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${b.w.colors.white}; border-radius: 32px; border: 1px solid ${b.w.colors.white}; margin-bottom: 5px; margin-right: 7px; `,Ce=({state:e,type:t,typeInformation:a,dispatch:n})=>{const{t:l}=(0,O.u)(),{selectedLocation:r}=e,s=(0,o.useMemo)((()=>a[t].slug),[a,t]);return i().createElement(xe,null,i().createElement(Se,null,l("booking.searchBar.popularKey")),e.popularKeys.map((e=>i().createElement(we,{key:e.id,onClick:()=>{var t;(t=e).url&&(window.location.href=t.url)}},e.keyword))),i().createElement(we,{className:"view-all",onClick:()=>{const e=`/${r.slug}/${s}`;e&&n({type:W.NavigateTo,payload:e})}},l("booking.searchBar.viewAll")))},ke=g.A.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${b.w.colors.neutral100}; `,Ee=(0,g.A)(I.C)` padding: 0 16px; `,Oe=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:n,setCurrentTab:l})=>{const{t:r}=(0,O.u)(),s=(0,o.useMemo)((()=>({root:{overflowY:n?"hidden":"initial",overflowX:n?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:n?"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:n?"14px":"16px",fontWeight:600,lineHeight:n?"22px":"24px"}})),[n]),d=(0,o.useMemo)((()=>[{value:"hospital",label:r("booking.searchPopup.hospitals")},{value:"doctor",label:r("booking.searchPopup.doctors")},{value:"service",label:r("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:r("booking.searchPopup.specialties")}]]),[a]),p=(0,o.useMemo)((()=>d.filter((e=>!t.includes(e.value)))||[]),[t,d]);return i().createElement(ke,{className:"booking-search-tab"},i().createElement(Ee,null,i().createElement(c.t,{value:e,onTabChange:e=>{l(e)},styles:s},i().createElement(c.t.List,null,p.map((e=>i().createElement(c.t.Tab,{value:e.value,key:e.value},e.label)))))))};var je;!function(e){e.doctor="doctor",e.service="hospital_service",e.hospital="hospital_branch"}(je||(je={}));const Le=e=>e.filter((e=>"string"===typeof e?"cacar-api"!==e:232!==(null===e||void 0===e?void 0:e.id)));const $e=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:n,initialSelectedCity:l,initialSearchValue:r="",initTypeSearch:s="hospital",initSpecialty:c,careFrontDomain:g="/care",isDebug:b=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:y,autoCompleteDisabled:f=!1,inputSearchPlaceholder:v="",hideTabBookingSearch:x=[],hideSpecialtySelection:w=!1,hideSpecialtyTab:S=!1,hidePopularSearchKeys:C=!1,clientSlug:j="",routerPush:I,onGeoLocationPermissionChange:T,onChangeLocation:P})=>{const{locale:M,t:G}=(0,O.u)(),U=(0,o.useRef)(null),Q=(0,o.useRef)(null),[Y,Z]=(0,o.useState)(s),{geoLocationPermission:J,geoLocationCoordinates:X}=function(){const[e,t]=(0,o.useState)((()=>{if("undefined"===typeof window)return"unset";if((0,h.Ri)(u.U))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[a,i]=(0,o.useState)((()=>{if("undefined"===typeof window)return null;const e=(0,h.Ri)(u.U);if(e)try{return JSON.parse(e)}catch(t){console.log(t)}return null})),n=(0,o.useCallback)((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const a={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};(0,h.TV)(u.U,JSON.stringify(a),{minutes:15}),i(a),t("granted")}),(()=>{(0,h.Yj)(u.U),t("denied")}))}),[]);return(0,o.useMemo)((()=>({geoLocationPermission:e,geoLocationCoordinates:a,requestGeoLocation:n})),[e,a])}(),[ee,te]=(0,o.useReducer)(H,V,(t=>Object.assign(Object.assign({},t),{isDebug:b,isMobile:e,geoLocationPermission:a||J||"unset",geoLocationCoordinates:n||X||null,searchKeywords:r,initialSelectedCity:l||null,selectedLocation:l||t.selectedLocation||null,searchLocationKeywords:(null===l||void 0===l?void 0:l.name)||t.searchLocationKeywords,autoCompleteDisabled:f,inputSearchPlaceholder:v,locale:M}))),{navigateTo:ae,focusedSpecialty:oe,searchKeywords:se,geoLocationPermission:de,selectedLocation:pe,selectedSpecialty:ue,initialSelectedCity:he,searchResults:be,isLoadingSearchResults:me}=ee,{fetchCitiesByLocation:ye,fetchCitiesByKeyword:fe,fetchSearchResults:xe,fetchAllSpecialties:we,fetchPopularKeys:Se}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:i=""}){const n=(0,o.useCallback)((function(o,i={}){const n=`${t}${o}`;return e({type:W.FetchCitiesStart}),fetch(k(n,i,a),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null===e||void 0===e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:W.FetchCitiesFinish})))}),[a]);return{fetchCitiesByLocation:(0,o.useCallback)((function({coordinates:t}){let o={};const l={};t&&(o={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(l.noPaging=1);const r=[n(N,Object.assign(Object.assign(Object.assign({},o),l),{client:$.C.MSD===i?"":i}))];return"zh-TW"===a?r.push(n(D,{noPaging:1,client:$.C.MSD===i?"":i})):r.push(n(D)),Promise.all(r).then((([t,a])=>{const o=Object.assign({},t);if(a){const e=o.cities.map((e=>e.id));o.cities=o.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:W.FetchCitiesByGeoIpComplete,payload:o})})).catch((e=>console.error("error loading cities by location",e)))}),[a,t,e]),fetchCitiesByKeyword:(0,o.useCallback)((function(t){return n(D,{keyword:t,client:i}).then((t=>{e({type:W.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[a,t,e]),fetchSearchResults:(0,o.useCallback)((function(o,n,l,r,s){const c="specialty"===l?`${t}${R}`:`${t}${F}`;e({type:W.FetchSearchResultsStart});const{selectedLocation:d,geoLocationCoordinates:p,selectedSpecialty:u}=n;let h="";if(!d)return void e({type:W.FetchSearchResultsFinish});h=d.id===$.I?"":d.id;const g=(null===p||void 0===p?void 0:p.lat)||"",b=(null===p||void 0===p?void 0:p.lng)||"",m=(null===u||void 0===u?void 0:u.id)>0?null===u||void 0===u?void 0:u.id:"",y=o.trim().length>q[a]?o.trim():"";return fetch(k(c,Object.assign({domain:t,searchType:l||"global",keyword:y,city:h===$.a?"":h,lat:g,lng:b,specialty_id:m,client_slug:$.C.MSD===r?"":r,msd:$.C.MSD===i?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?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:Le((null===e||void 0===e?void 0:e.specialties)||[])}))):t.searches),"specialty"===l&&(a=Le(y?(null===t||void 0===t?void 0:t.specialties)||[]:(null===t||void 0===t?void 0:t.default)||[])),e({type:W.FetchSearchResultsComplete,payload:{key:l,searches:a||[]}}),s&&e({type:W.UpdateInitialSearchResults,payload:{key:l,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:c,error:e})})).finally((()=>e({type:W.FetchSearchResultsFinish})))}),[a,t,e]),fetchAllSpecialties:(0,o.useCallback)((function(){const o=`${t}${R}`;return fetch(k(o,{domain:t,searchType:"",msd:$.C.MSD===i?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?void 0:e._data:Promise.reject(e))).then((t=>{e({type:W.FetchAllSpecialties,payload:Le(t.specialties||[])})})).catch((e=>{console.log("error loading search results",{url:o,error:e})}))}),[a,t,e]),fetchPopularKeys:(0,o.useCallback)((function(o){const i=`${t}${A}`;return fetch(k(i,{domain:t,searchType:je[o],sort_by:"display_order",sort_order:"asc"},a)).then((e=>e.json())).then((e=>1===e._status&&e._data?null===e||void 0===e?void 0:e._data:Promise.reject(e))).then((t=>{e({type:W.FetchPopularKeys,payload:t.popular_searches||[]})})).catch((e=>{console.log("error loading search results",{url:i,error:e})}))}),[a,t,e])}}({dispatch:te,locale:M,careApiDomain:t,client:j}),ke=(0,o.useMemo)((()=>$.L[M]),[M]),Ee=(0,o.useMemo)((()=>Object.assign({doctor:{name:G("booking.searchPopup.doctors"),icon:i().createElement(ie,null),slug:ke.DOCTOR},service:{name:G("booking.searchPopup.services"),icon:i().createElement(ne,null),slug:ke.SERVICE},hospital:{name:G("booking.searchPopup.hospitals"),icon:i().createElement(le,null),slug:ke.HOSPITAL}},!S&&{specialty:{name:G("booking.searchPopup.specialties"),icon:i().createElement(re,null),slug:ke.SPECIALTIES}})),[Y]),$e=(0,o.useMemo)((()=>L()(fe,400)),[fe]),Ie=(0,o.useMemo)((()=>L()(xe,400)),[xe]),Te=(0,o.useCallback)((function(e){te({type:W.SelectLocation,payload:e}),Pe(),P&&P(e)}),[G,te]);function Pe(){var e;U.current&&(null===(e=U.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Me(){let e="";const{slug:t}=Ee[Y];let a="";const o=$.M[M][j];("doctor"===Y||"hospital"===Y)&&ee.selectedSpecialty.id>0&&(a=`&specialtyId=${ee.selectedSpecialty.id}`),e="specialty"===Y?`/${t}`:`/${pe.slug}/${t}`,o&&(e+=`/${o}`),e+=`?q=${se}${a}`,e&&te({type:W.NavigateTo,payload:e})}return(0,E.a)(Q,(()=>{te({type:W.ClickOutsideInputSearchSpecialty})})),(0,o.useEffect)((()=>{var t;"denied"===de||he||te({type:W.SelectLocation,payload:{name:G("booking.searchBar.allLocations"),id:$.I,slug:null===(t=$.L[M])||void 0===t?void 0:t.ALL}}),T&&T(de,ee.geoLocationCoordinates),e&&"granted"===de&&pe&&te({type:W.FocusInputSearch}),ye({coordinates:ee.geoLocationCoordinates})}),[de]),(0,o.useEffect)((()=>{const e=c||{name:G("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ke.SPECIALTIES};ee.selectedSpecialty||te({type:W.SelectSpecialty,payload:e})}),[c,ee.selectedSpecialty]),(0,o.useEffect)((()=>{we()}),[]),(0,o.useEffect)((()=>{Se(Y)}),[Y]),(0,o.useEffect)((()=>{ae&&(I?I(ae):window.location.href=`${g}${ae}`)}),[ae]),(0,o.useEffect)((()=>{xe(ee.searchKeywords,ee,Y,j,!0)}),[pe,ue,Y]),i().createElement(K,{ref:U},i().createElement(Oe,{currentTab:Y,setCurrentTab:Z,isMobile:e,hideTabBookingSearch:x,hideSpecialtyTab:S}),i().createElement(B,{className:"booking-search-container"},i().createElement(z,null,i().createElement(_,{className:"booking-search-content"},i().createElement("div",{ref:Q},i().createElement(d.s,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==Y&&i().createElement(ge,{state:ee,isMobile:e,dispatch:te,debouncedFetchCitiesByKeyword:$e,selectedLocation:pe,onLocationClick:Te,trackingAttributes:y}),i().createElement(ce,{type:Y,isMobile:e,state:ee,dispatch:te,debouncedFetchSearchResults:Ie,initalSearchValue:r,focusSearchInput:Pe,onEnterSearch:Me,typeInformation:Ee,trackingAttributes:m,isLoading:me,hideSpecialtySelection:w||S,clientSlug:j}),i().createElement(p.$,{size:e?"md":"lg",color:"#2D87F3",fullWidth:e,variant:"filled",onClick:Me,styles:{root:{height:e?"40px":"48px"}}},G("booking.searchBar.searchButton"))),!C&&"specialty"!==Y&&ee.popularKeys.length>0&&i().createElement(Ce,{type:Y,state:ee,typeInformation:Ee,dispatch:te}),"specialty"===Y&&"search"===oe&&i().createElement(ve,{state:ee,isMobile:e,dispatch:te,specialties:(null===be||void 0===be?void 0:be.specialty)||[],isLoading:me}))))))}},26662:function(e,t,a){var o=a(73884),i=a.n(o),n=a(41303),l=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{var{size:t,color:a=n.fT}=e,o=l(e,["size","color"]);const r=(0,n.D5)(t);return i().createElement("svg",Object.assign({width:r,height:r,viewBox:"0 0 24 24",fill:"none"},o),i().createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.972 10.873a6.901 6.901 0 1 1 13.803 0 6.901 6.901 0 0 1-13.803 0M10.873 2a8.873 8.873 0 1 0 5.539 15.806l3.905 3.906a.986.986 0 0 0 1.394-1.395l-3.905-3.905A8.873 8.873 0 0 0 10.873 2",fill:a}))}},42060:function(e,t,a){a.d(t,{t:function(){return ke}});var o=a(73884),i=a.n(o),n=a(86566),l=a(85618);const r="Tabs component was not found in the tree",s="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",[c,d]=(0,l.F)(r);var p=a(48085),u=a(50736),h=a(36950),g=Object.defineProperty,b=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,f=(e,t,a)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,v=(e,t)=>{for(var a in t||(t={}))m.call(t,a)&&f(e,a,t[a]);if(b)for(var a of b(t))y.call(t,a)&&f(e,a,t[a]);return e};function x({orientation:e,inverted:t,placement:a},o,i){const n="vertical"===e;return"default"===i?{[n?"left"===a?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${(0,p.D)(2)} solid ${"dark"===o.colorScheme?o.colors.dark[4]:o.colors.gray[3]}`}:"outline"===i?{[n?"left"===a?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${(0,p.D)(1)} solid ${"dark"===o.colorScheme?o.colors.dark[4]:o.colors.gray[3]}`}:"pills"===i?{gap:`calc(${o.spacing.sm} / 2)`}:{}}var w=(0,u.r)(((e,t,{variant:a})=>{const o="vertical"===t.orientation;return{tabsList:v({display:"flex",flexWrap:"wrap",flexDirection:o?"column":"row",justifyContent:h.H[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},x(t,e,a))}})),S=a(36814),C=Object.defineProperty,k=Object.defineProperties,E=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,$=(e,t,a)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const I={grow:!1,position:"left"},T=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsList",I,e),{children:o,className:l,grow:r,position:s}=a,c=((e,t)=>{var a={};for(var o in e)j.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&O)for(var o of O(e))t.indexOf(o)<0&&L.call(e,o)&&(a[o]=e[o]);return a})(a,["children","className","grow","position"]),{orientation:p,variant:u,color:h,radius:g,inverted:b,placement:m,classNames:y,styles:f,unstyled:v}=d(),{classes:x,cx:C}=w({orientation:p,grow:r,color:h,position:s,radius:g,inverted:b,placement:m},{name:"Tabs",unstyled:v,classNames:y,styles:f,variant:u});return i().createElement(S.a,(T=((e,t)=>{for(var a in t||(t={}))j.call(t,a)&&$(e,a,t[a]);if(O)for(var a of O(t))L.call(t,a)&&$(e,a,t[a]);return e})({},c),P={className:C(x.tabsList,l),ref:t,role:"tablist","aria-orientation":p},k(T,E(P))),o);var T,P}));T.displayName="@mantine/core/TabsList";var P=a(55470),M=(0,u.r)(((e,{orientation:t})=>({panel:{flex:"vertical"===t?1:void 0}}))),D=Object.defineProperty,F=Object.defineProperties,N=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,B=(e,t,a)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const z={},_=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsPanel",z,e),{value:l,children:r,sx:s,className:c}=a,p=((e,t)=>{var a={};for(var o in e)A.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&R)for(var o of R(e))t.indexOf(o)<0&&K.call(e,o)&&(a[o]=e[o]);return a})(a,["value","children","sx","className"]),u=d(),{classes:h,cx:g}=M({orientation:u.orientation,color:u.color,radius:u.radius,inverted:u.inverted,placement:u.placement},{name:"Tabs",unstyled:u.unstyled,classNames:u.classNames,styles:u.styles,variant:u.variant}),b=u.getPanelId(l),m=u.value===l,y=u.keepMounted||m?r:null;return(0,o.useEffect)((()=>(u.setMountedPanelIds((e=>[...e,b])),u.setMountedPanelIds((e=>e.filter((e=>e!==b)))))),[b]),i().createElement(S.a,(f=((e,t)=>{for(var a in t||(t={}))A.call(t,a)&&B(e,a,t[a]);if(R)for(var a of R(t))K.call(t,a)&&B(e,a,t[a]);return e})({},p),v={ref:t,sx:[{display:m?void 0:"none"},...(0,P.n)(s)],className:g(h.panel,c),role:"tabpanel",id:b,"aria-labelledby":u.getTabId(l)},F(f,N(v))),y);var f,v}));_.displayName="@mantine/core/TabsPanel";var q=a(54363),V=Object.defineProperty,W=Object.defineProperties,G=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,Y=(e,t,a)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Z=(e,t)=>{for(var a in t||(t={}))U.call(t,a)&&Y(e,a,t[a]);if(H)for(var a of H(t))Q.call(t,a)&&Y(e,a,t[a]);return e},J=(e,t)=>W(e,G(t));function X(e,{orientation:t,color:a,radius:o,inverted:i,placement:n},l){const r="vertical"===t,s=e.fn.variant({color:a,variant:"filled"}),c=(0,p.D)(e.fn.radius(o)),d="vertical"===t?"left"===n?`${c} 0 0 ${c}`:` 0 ${c} ${c} 0`:i?`0 0 ${c} ${c}`:`${c} ${c} 0 0`;return"default"===l?J(Z({[r?"left"===n?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:`${(0,p.D)(2)} solid transparent`,[r?"left"===n?"marginRight":"marginLeft":i?"marginTop":"marginBottom"]:(0,p.D)(-2),borderRadius:d},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":Z({borderColor:s.background,color:"dark"===e.colorScheme?e.white:e.black},e.fn.hover({borderColor:s.background}))}):"outline"===l?{borderRadius:d,border:`${(0,p.D)(1)} solid transparent`,[r?"left"===n?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.white,position:"absolute",bottom:r?0:i?"unset":(0,p.D)(-1),top:r?0:i?(0,p.D)(-1):"unset",[r?"width":"height"]:(0,p.D)(1),right:r?"left"===n?(0,p.D)(-1):"unset":0,left:r?"left"===n?"unset":(0,p.D)(-1):0}}}:"pills"===l?J(Z({borderRadius:e.fn.radius(o)},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Z({backgroundColor:s.background,color:e.white},e.fn.hover({backgroundColor:s.background}))}):{}}var ee=(0,u.r)(((e,t,{variant:a})=>({tabLabel:{},tab:Z({position:"relative",padding:`${e.spacing.xs} ${e.spacing.md}`,paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:"horizontal"===t.orientation?"center":void 0,lineHeight:1,"&:disabled":Z({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},X(e,t,a)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:(0,p.D)(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:(0,p.D)(7)}}}))),te=a(42990),ae=Object.defineProperty,oe=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,se=(e,t,a)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const ce={},de=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsTab",ce,e),{value:o,children:l,onKeyDown:r,onClick:s,className:c,icon:p,rightSection:u,color:h}=a,g=((e,t)=>{var a={};for(var o in e)le.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&ne)for(var o of ne(e))t.indexOf(o)<0&&re.call(e,o)&&(a[o]=e[o]);return a})(a,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),b=d(),m=!!p,y=!!u,{theme:f,classes:v,cx:x}=ee({withIcon:m||y&&!l,withRightSection:y||m&&!l,orientation:b.orientation,color:h||b.color,radius:b.radius,inverted:b.inverted,placement:b.placement},{name:"Tabs",unstyled:b.unstyled,classNames:b.classNames,styles:b.styles,variant:b.variant}),w=o===b.value,S=b.getPanelId(o),C=b.mountedPanelIds.includes(o)?S:void 0;return i().createElement(te.N,(k=((e,t)=>{for(var a in t||(t={}))le.call(t,a)&&se(e,a,t[a]);if(ne)for(var a of ne(t))re.call(t,a)&&se(e,a,t[a]);return e})({},g),E={unstyled:b.unstyled,className:x(v.tab,c),"data-active":w||void 0,ref:t,type:"button",role:"tab",id:b.getTabId(o),"aria-selected":w,tabIndex:w||null===b.value?0:-1,"aria-controls":C,onClick:e=>{b.onTabChange(b.allowTabDeactivation&&o===b.value?null:o),null==s||s(e)},onKeyDown:(0,q.Y)({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,dir:f.dir,orientation:b.orientation,onKeyDown:r})},oe(k,ie(E))),p&&i().createElement("span",{className:v.tabIcon},p),l&&i().createElement("span",{className:v.tabLabel},l),u&&i().createElement("span",{className:v.tabRightSection},u));var k,E}));de.displayName="@mantine/core/Tab";var pe=a(25850),ue=a(27878),he=a(19203);function ge({defaultValue:e,value:t,onTabChange:a,orientation:n,children:l,loop:r,id:d,activateTabWithKeyboard:p,allowTabDeactivation:u,variant:h,color:g,radius:b,inverted:m,placement:y,keepMounted:f=!0,classNames:v,styles:x,unstyled:w}){const S=(0,ue.B)(d),[C,k]=(0,o.useState)([]),[E,O]=(0,he.Z)({value:t,defaultValue:e,finalValue:null,onChange:a});return i().createElement(c,{value:{placement:y,value:E,orientation:n,id:S,loop:r,activateTabWithKeyboard:p,getTabId:(0,pe.r)(`${S}-tab`,s),getPanelId:(0,pe.r)(`${S}-panel`,s),onTabChange:O,setMountedPanelIds:k,mountedPanelIds:C,allowTabDeactivation:u,variant:h,color:g,radius:b,inverted:m,keepMounted:f,classNames:v,styles:x,unstyled:w}},l)}ge.displayName="@mantine/core/TabsProvider";var be=(0,u.r)(((e,{orientation:t,placement:a})=>({root:{display:"vertical"===t?"flex":void 0,flexDirection:"right"===a?"row-reverse":"row"}}))),me=Object.defineProperty,ye=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Se=(e,t,a)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const Ce={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},ke=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("Tabs",Ce,e),{defaultValue:o,value:l,orientation:r,loop:s,activateTabWithKeyboard:c,allowTabDeactivation:d,children:p,id:u,onTabChange:h,variant:g,color:b,className:m,unstyled:y,classNames:f,styles:v,radius:x,inverted:w,keepMounted:C,placement:k}=a,E=((e,t)=>{var a={};for(var o in e)xe.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&ve)for(var o of ve(e))t.indexOf(o)<0&&we.call(e,o)&&(a[o]=e[o]);return a})(a,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:O,cx:j}=be({orientation:r,color:b,radius:x,inverted:w,placement:k},{unstyled:y,name:"Tabs",classNames:f,styles:v,variant:g});return i().createElement(ge,{activateTabWithKeyboard:c,defaultValue:o,orientation:r,onTabChange:h,value:l,id:u,loop:s,allowTabDeactivation:d,color:b,variant:g,radius:x,inverted:w,keepMounted:C,placement:k,classNames:f,styles:v,unstyled:y},i().createElement(S.a,(L=((e,t)=>{for(var a in t||(t={}))xe.call(t,a)&&Se(e,a,t[a]);if(ve)for(var a of ve(t))we.call(t,a)&&Se(e,a,t[a]);return e})({},E),$={className:j(O.root,m),id:u,ref:t},ye(L,fe($))),p));var L,$}));ke.List=T,ke.Tab=de,ke.Panel=_,ke.displayName="@mantine/core/Tabs"}}]);