"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7082],{FaaI:function(e,t,n){n.d(t,{h:function(){return useCity}});var l=n("q1tI"),a=n("09QT"),i=n("oQBk"),o=n("Tk9B");let useCity=function(e,t,n,r){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",[s,d]=(0,l.useState)(!1),[u,h]=(0,l.useState)([]),g=(0,l.useRef)([]),[p,f]=(0,l.useState)(!0),m=(0,l.useCallback)(()=>{h(g.current)},[]);return(0,l.useEffect)(()=>{e&&(async()=>{try{d(!0);let e=await (0,a.d)(i.y.CARE.GET_CARE_GEOBYIP,void 0,"care");if(null==e?void 0:e._data){let{default:n={},cities:l}=e._data;h(l||[]),g.current=l;let a=r?l.find(e=>e.id===r):n;null==t||t("selected_city",{...a,value:a.id,label:a.name})}}catch(e){}finally{d(!1)}})()},[e,r]),(0,l.useEffect)(()=>{c&&""!==c&&c.length>=3?(async()=>{try{d(!0);let e=await (0,a.d)(i.y.CARE.GET_CARE_CITY_LIST,{params:{keyword:c}},"care");if(null==e?void 0:e._data){let{cities:t}=e._data;h(t||[])}}catch(e){}finally{d(!1)}})():h(g.current)},[c]),(0,l.useEffect)(()=>{e&&(async()=>{d(!0);try{if((null==n?void 0:n.value)===0){let n={latitude:"",longitude:""};try{var e,l;let t=await (0,o.k)();n={latitude:(null===(e=t.location)||void 0===e?void 0:e.latitude)||"",longitude:(null===(l=t.location)||void 0===l?void 0:l.longitude)||""},f(!0)}catch(e){f(!1)}let r=await (0,a.d)(i.y.CARE.GET_CARE_GEOBYIP,{params:n},"care");if(null==r?void 0:r._data){let{default:e={}}=r._data;null==t||t("selected_city",{...e,value:e.id,label:e.name})}}}catch(e){}finally{d(!1)}})()},[null==n?void 0:n.value]),{loading:s,permission:p,setCityLoading:d,cityList:u,onFocus:m}}},a7TI:function(e,t,n){n.r(t),n.d(t,{DefaultPagination:function(){return es},default:function(){return clinicLocator}});var l=n("BGKE"),a=n("q1tI"),i=n("rBCA"),o=n("9uQI"),r=n("G7ij"),c=n("rrs9"),s=n("oTwY"),d=n("kd6S"),u=n("Eso5"),h=n("SPK5"),g=n("mYVa"),p=n("FQtM"),f=n("gxre"),m=n("XRSF"),v=n("gHhT"),b=n("sEfC"),w=n.n(b),x=n("dDsW"),C=n("gHFm"),y=n("rz9S"),k=n("3d+w"),T=n("raAP"),S=n("hXNO"),L=n("P5LW"),Z=n("rIrU"),B=n("mwIZ"),E=n.n(B),I=n("09QT"),N=n("/tR3"),_=n("oQBk"),R=n("rEaw");let M={streetViewControl:!1,fullscreenControl:!1,mapTypeControl:!1,styles:[{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"poi.medical",elementType:"labels.icon",stylers:[{visibility:"on"}]}]},A={[R.MV.Vietnam]:{lat:10.762622,lng:106.660172},[R.MV.Indonesia]:{lat:-6.208763,lng:106.845599},[R.MV.Malaysia]:{lat:3.139003,lng:101.686855},[R.MV.Thailand]:{lat:13.756331,lng:100.501765},[R.MV.Cambodia]:{lat:11.544873,lng:104.892167},[R.MV.Taiwan]:{lat:25.032969,lng:121.565418},[R.MV.Myanmar]:{lat:19.763306,lng:96.07851},[R.MV.PhilippinesEnglish]:{lat:14.599512,lng:120.98422},[R.MV.India]:{lat:28.613939,lng:77.209021}};var z=n("GcSG"),D=n("94Cm");let P=(0,a.forwardRef)((e,t)=>{let{options:n=M,zoom:i=13,onLoad:o,center:r,onCenterChanged:c,markerItems:s,markerItemProps:{onClick:d}={},children:u}=e,[h,g]=(0,a.useState)(),p=(0,a.useCallback)(e=>{g(e),null==o||o(e)},[o]);return(0,a.useImperativeHandle)(t,()=>h,[h]),(0,l.tZ)(z.LoadScript,{googleMapsApiKey:D.JO,children:(0,l.BX)(z.GoogleMap,{id:"clinicLocator--map",zoom:i,options:n,onLoad:p,onCenterChanged:c,mapContainerClassName:"g-map",center:r,children:[null==s?void 0:s.map(e=>(0,l.tZ)(z.Marker,{position:{lat:Number(e.latitude),lng:Number(e.longitude)},onClick:()=>null==d?void 0:d(e)},e.id)),u]})})});var X=n("iBNF"),F=n("UpS/"),V=n("gXGR"),W=n("o5qa"),G=n("vaps"),U=n("iuhU"),O=n("eZo4"),j=n("DzJC"),H=n.n(j),K=n("pK+c"),Y=n("jpeG"),q=n("YL+3");let ClinicLocatorSidebarLocation=e=>{var t;let{data:n=[],defaultValue:a="",onChange:i,...o}=e,{formatMessage:r}=(0,x.Z)();return n&&(null==n?void 0:n.length)?(0,l.tZ)(q.A,{...o,value:a,data:[{label:r({id:"clinicLocator.filterAll"}),value:"",type:null==n?void 0:null===(t=n[0])||void 0===t?void 0:t.type},...n],onSelectItem:e=>i(e)}):null};var Q=n("UbCi"),J=n("VZtU"),$=n("OAL+");let ee=(0,a.createContext)({});var et=(0,n("/npG").k)(function(e){let{useMobileLayout:t,backgroundColor:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{resultItem:{padding:(0,g.h)(12),display:"flex",flexDirection:"column",gap:4,...!t&&{[e.fn.largerThan("sm")]:{gap:8,padding:(0,g.h)(16)}}},wrapper:{flexDirection:"column-reverse",height:"80vh",...!t&&{[e.fn.largerThan("md")]:{height:"min(800px,70vh)",flexDirection:"row"}}},content:{height:"100%",position:"relative",...!t&&{[e.fn.largerThan("md")]:{flex:1,minWidth:0,position:"static"}}},searchBarMobile:{},sidebar:{width:"100%",backgroundColor:e.colors.neutral50,...!t&&{[e.fn.largerThan("md")]:{width:(0,g.h)(456),overflow:"auto",position:"relative","&:after":{content:'""',height:30,position:"absolute",left:0,right:0,bottom:0,backgroundImage:"linear-gradient(0deg, #FAFAFA 0%, rgba(250, 250, 250, 0) 100%)"}},[e.fn.largerThan(1500)]:{width:"max(".concat((0,g.h)(456),",25%)")}}},sidebarExtend:{order:3,paddingTop:(0,g.h)(8),paddingInline:(0,g.h)(16),paddingBottom:(0,g.h)(12),...!t&&{[e.fn.largerThan("md")]:{order:1,paddingInline:(0,g.h)(24),paddingTop:(0,g.h)(40),paddingBottom:0}}},sidebarSticky:{order:1,zIndex:1,paddingInline:(0,g.h)(16),paddingBlock:(0,g.h)(8),...!t&&{[e.fn.largerThan("md")]:{order:2,paddingTop:(0,g.h)(16),paddingInline:(0,g.h)(24),paddingBottom:(0,g.h)(12),width:"calc(100% - 6px)"}}},sidebarSearch:{[e.fn.smallerThan("sm")]:{marginBottom:10},...!t&&{[e.fn.largerThan("lg")]:{paddingBottom:(0,g.h)(16)}}},countTitle:{gap:(0,g.h)(8),alignItems:"center",...!t&&{[e.fn.largerThan("md")]:{flex:1,minWidth:0}},".mantine-Select-item":{whiteSpace:"nowrap",fontSize:(0,g.h)(14),padding:"10px 16px"}},searchBtn:{...!t&&{[e.fn.largerThan("lg")]:{paddingTop:(0,g.h)(12)}}},sidebarList:{maxWidth:"100%",order:2,display:"flex",gap:(0,g.h)(8),flexDirection:"row",overflow:"auto",paddingInline:(0,g.h)(16),[e.fn.smallerThan("md")]:{paddingBottom:16},...!t&&{[e.fn.largerThan("md")]:{order:3,gap:0,flexDirection:"column",overflow:"hidden",paddingInline:0},[e.fn.largerThan("lg")]:{flex:1,minHeight:0}}},controlBtns:{transform:"translate(0, -50%)",backgroundColor:"#fff",borderRadius:(0,g.h)(4),".zoomBtn":{border:"none",borderRadius:(0,g.h)(4),borderTop:"1px solid ".concat(e.colors.gray100),borderInline:"1px solid ".concat(e.colors.gray100),"+ .zoomBtn":{borderRadius:0},"&:first-child":{borderRadius:"".concat((0,g.h)(4)," ").concat((0,g.h)(4)," 0 0")},"&:last-child":{borderRadius:"0 0 ".concat((0,g.h)(4)," ").concat((0,g.h)(4)),borderBottom:"1px solid ".concat(e.colors.gray100)},".zoomIcon":{width:"70%",height:"70%"},...!t&&{[e.fn.largerThan("sm")]:{width:(0,g.h)(46),height:(0,g.h)(46)}}}},contentWrapper:{position:"relative",maxHeight:"100%",display:"flex",overflow:"auto",flex:1,background:"white",transition:"all .3s ease",[e.fn.smallerThan("sm")]:{padding:"0 16px 16px",gap:(0,g.h)(12)},...!t&&{[e.fn.largerThan("sm")]:{flexDirection:"column",'&[data-opened="false"]':{transform:"translate(-50%, 0)",opacity:0}}}},searchItem:{width:"100%",background:"white",'&[data-selected="true"]':{background:e.colors.blue[0]},[e.fn.smallerThan("sm")]:{border:"1px solid ".concat(e.colors.neutral[1]),borderRadius:(0,g.h)(6)},...!t&&{[e.fn.largerThan("sm")]:{borderBottom:"1px solid ".concat(e.colors.neutral[1])}}},filterSelectRoot:{width:"120px"},filterSelectItem:{fontSize:"14px",padding:"8px 10px"},filterSelectInput:{height:"auto !important",border:0,paddingLeft:0,paddingRight:(0,g.h)(22),":focus":{outline:0,boxShadow:"none"},[e.fn.smallerThan("sm")]:{textAlign:"right"}},filterSelectRightSection:{pointerEvents:"none",width:(0,g.h)(20)},filterSelectDropdown:{...!t&&{[e.fn.largerThan("sm")]:{transform:"translate(-10px, 0)"}}},foundListRoot:{display:"flex",flexDirection:"column",transition:"all .3s ease",...!t&&{[e.fn.largerThan("sm")]:{position:"absolute",zIndex:2,top:(0,g.h)(29),left:(0,g.h)(10),maxHeight:"calc(100% - 53px)",width:(0,g.h)(312),alignItems:"flex-start",'&[data-open="false"]':{pointerEvents:"none"}}},[e.fn.smallerThan("sm")]:{border:"none",transition:"all .3s ease",background:"white"}},foundListWrapper:{padding:"".concat((0,g.h)(8)," ").concat((0,g.h)(16)),[e.fn.smallerThan("sm")]:{'&[data-open="false"]':{borderBottom:"1px solid ".concat(e.colors.neutral[1])}},...!t&&{[e.fn.largerThan("sm")]:{padding:"".concat((0,g.h)(8)," ").concat((0,g.h)(12)),background:"white",borderBottom:"1px solid ".concat(e.colors.neutral[1]),pointerEvents:"initial",width:"100%",'&[data-open="false"]':{width:"auto"}}}},foundListInner:{[e.fn.smallerThan("sm")]:{justifyContent:"space-between"},...!t&&{[e.fn.largerThan("sm")]:{justifyContent:"space-between",'&[data-open="false"]':{justifyContent:"flex-start"}}}},arrowBtn:{cursor:"pointer",...!t&&{[e.fn.largerThan("sm")]:{marginTop:"3px"}}},titleComp:{flex:1,color:e.colors.gray800,fontSize:(0,g.h)(24),fontWeight:700,lineHeight:(0,g.h)(32),letterSpacing:(0,g.h)(-.8),textAlign:"center",paddingTop:(0,g.h)(48),paddingBottom:(0,g.h)(16),...!t&&{[e.fn.largerThan(1112)]:{textAlign:"left",fontSize:(0,g.h)(22),letterSpacing:(0,g.h)(-.6),paddingTop:0,paddingBottom:0}}},viewExpertBtn:{height:"auto",paddingBlock:0,paddingLeft:0,paddingRight:0,marginLeft:"auto",borderRadius:(0,g.h)(8),color:e.colors.primary600,backgroundColor:"transparent !important",".mantine-Button-leftIcon":{marginRight:(0,g.h)(12)},...!t&&{[e.fn.largerThan("md")]:{height:(0,g.h)(48),paddingBlock:(0,g.h)(12),paddingLeft:(0,g.h)(12),paddingRight:(0,g.h)(16),color:"white",backgroundColor:"".concat(n||e.colors.primary600," !important"),"&:hover":{backgroundColor:"".concat(n||e.colors.primary500," !important")}}}}}});let en=(0,a.forwardRef)(function(e,t){let{id:n,name:i,address:o,...r}=e,{isMobile:s}=(0,a.useContext)(ee),{classes:d}=et({useMobileLayout:s});return(0,l.BX)(u.x,{className:d.resultItem,ref:t,...r,children:[(0,l.tZ)(c.T,{size:"s3",weight:"semiBold",children:i}),(0,l.tZ)(c.T,{size:"p4",sx:{display:"-webkit-box","-webkit-line-clamp":"3","-webkit-box-orient":"vertical",overflow:"hidden"},children:o})]},n)}),el=(0,a.forwardRef)((e,t)=>{let{searchData:n,loading:a,placeholder:i,onClickLeftIcon:r,value:s,icon:d=(0,l.tZ)(J.Z,{color:X.r.colors.gray300,onClick:r}),hideSearchDropdown:u,...p}=e,{formatMessage:f}=(0,x.Z)(),m=f({id:"clinicLocator.inputPlaceholder",defaultMessage:"Search by hospital name"}),v=(0,l.BX)($.K,{align:"center",sx:{position:"relative",padding:(0,g.h)(40),width:"100%"},children:[(0,l.tZ)(O.f,{visible:null===n||!!a,sx:()=>({borderRadius:(0,g.h)(20),border:0})}),(0,l.BX)($.K,{align:"center",sx:{opacity:Number(!(null===n||a))},children:[(0,l.tZ)(h.k,{align:"center",justify:"center",sx:{background:"white",borderRadius:"50%",width:(0,g.h)(120),height:(0,g.h)(120),img:{width:(0,g.h)(80)}},children:(0,l.tZ)("img",{src:Q.C.getAssetPath("hospital.png"),alt:"Not found",loading:"lazy"})}),(0,l.tZ)(c.T,{size:"p4",children:f({id:"clinicLocator.notFound",defaultMessage:"No result found. Try another keyword!"})})]})]});return(0,l.tZ)(o.S,{ref:t,size:"lg",clearable:!0,keepSearch:!0,searchable:!0,withinPortal:!0,limit:20,icon:d,data:n||[],inputMode:"text",value:s||"",placeholder:i||m,filter:()=>!0,itemComponent:en,rightSection:null,dropdownPosition:"bottom",dropdownComponent:e=>{let{children:t}=e;return(0,l.BX)(G.x,{scrollbarSize:8,className:"w-full",children:[t,(0,l.tZ)(O.f,{visible:!!a,sx:()=>({borderRadius:(0,g.h)(20),border:0})})]})},nothingFound:v,styles:e=>{let t={border:0,padding:0,borderRadius:(0,g.h)(20)};return(u||!s)&&(t.display="none"),{input:{borderRadius:(0,g.h)(8),borderColor:e.colors.gray200,fontSize:(0,g.h)(16),lineHeight:1.5,"&:not(.mantine-Textarea-input)":{[e.fn.smallerThan("sm")]:{height:40,fontSize:(0,g.h)(14)}},"&[data-with-icon]":{paddingLeft:(0,g.h)(48)},"&[disabled]":{opacity:1}},dropdown:t,item:{borderRadius:0,borderTop:"1px solid ".concat(e.colors.neutral100),"&:first-of-type":{borderTop:0}}}},...p})}),ea=(0,a.forwardRef)((e,t)=>{let{color:n,loadingAt:i,extendComponent:o,clinics:s,clinicSelected:d,onSelectClinic:p,pagination:f=es,searchData:m=[],searchValue:v,onChangeSearch:b,onSubmitSearch:C,onItemSubmitSearch:y,filter:k=[],onFilter:T,onLoadMore:S,searchRef:Z,hideSearchDropdown:B}=e,{isMobile:E}=(0,a.useContext)(ee),{classes:I}=et({useMobileLayout:E}),{locale:N}=(0,L.h)(),{formatMessage:_}=(0,x.Z)(),R=(0,a.useRef)(null),M=(0,a.useRef)(null),A=(0,a.useRef)(null),[z,D]=(0,a.useState)(v||""),[P,j]=(0,a.useState)(!0);(0,a.useImperativeHandle)(t,()=>({scrollTop:()=>{E?A.current&&A.current.scrollTo({left:0,behavior:"smooth"}):M.current&&M.current.scrollTo({top:0,behavior:"smooth"})}}));let q=(0,a.useRef)(S),Q=(0,a.useRef)(f),J=(0,a.useRef)(i);(0,a.useEffect)(()=>{q.current=S,Q.current=f,J.current=i},[S,f,i]);let $=(0,a.useCallback)(H()(()=>{let e=Q.current,t="string"==typeof J.current;if(e.current{let e=R.current,t=M.current;if(!e)return;let n=new IntersectionObserver(e=>{e[0].isIntersecting&&$()},{root:t,threshold:.1,rootMargin:"0px 0px 400px 0px"});return n.observe(e),()=>{n.disconnect(),$.cancel()}},[$,E,null==s?void 0:s.length]);let{title:en}=(0,a.useMemo)(()=>({title:_({id:"clinicLocator.foundClinics",defaultMessage:"{count} Clinics"},{count:null==f?void 0:f.total_items.toLocaleString(N)})}),[null==f?void 0:f.total_items,N,_]),ea=(0,a.useMemo)(()=>(null==f?void 0:f.current)<(null==f?void 0:f.last),[null==f?void 0:f.current,null==f?void 0:f.last]),ei=E?h.k:G.x,eo=E?{direction:"column"}:{viewportRef:M,styles:{root:{height:"100%"},thumb:{zIndex:2}},scrollbarSize:6},er=E?G.x:h.k,ec=E?{viewportRef:A,scrollbarSize:6,w:"100%",styles:e=>({root:{[e.fn.smallerThan("sm")]:{paddingLeft:0,paddingRight:0}},viewport:{[e.fn.smallerThan("sm")]:{paddingLeft:16,paddingRight:16}}})}:{},ed=E?h.k:u.x,eu=E?{gap:8}:{},eh=(0,a.useMemo)(()=>w()(e=>null==b?void 0:b(e),500),[b]);(0,a.useEffect)(()=>()=>eh.cancel(),[eh]);let eg=(0,a.useCallback)(e=>{e.includes("-----")||(D(e),eh(e))},[eh]),ep=(0,a.useCallback)(e=>{"Enter"===e.key&&(null==C||C(e.target.value))},[C]),ef=(0,a.useCallback)(e=>{let{value:t,label:n,...l}=e;null==y||y(l)},[y]);return(0,a.useEffect)(()=>{D(v||"")},[v]),(0,l.BX)(ei,{className:"ClinicLocatorSidebar--wrapper",...eo,children:[o&&(0,l.tZ)(h.k,{align:"stretch",gap:(0,g.h)(16),className:I.sidebarExtend,children:o}),(0,l.BX)(u.x,{pos:"sticky",top:0,left:0,bg:X.r.colors.neutral50,sx:{zIndex:10},className:(0,U.default)("ClinicLocatorSidebar--sticky relative",{"pt-4":!E},I.sidebarSticky),children:[(0,l.tZ)(h.k,{gap:(0,g.h)(8),align:"center",children:(0,l.tZ)(r.B,{onClick:()=>j(!P),leftIcon:P?(0,l.tZ)(K.ok,{className:"text-[24px] text-gray800"}):(0,l.tZ)(Y.Z,{className:"text-[24px] text-gray800"}),className:(0,U.default)("ml-auto !absolute top-[52px] right-[12px] !bg-[transparent] ",{"!block":E,"!hidden":!E})})}),(0,l.tZ)(el,{ref:Z,searchData:Array.isArray(m)?m.map(e=>({...e,value:"-----".concat(e.id),label:e.name})):null,loading:"search-bar"===i,value:z,onChange:eg,onItemSubmit:ef,onKeyUp:ep,className:I.sidebarSearch,hideSearchDropdown:B}),(0,l.BX)(h.k,{gap:(0,g.h)(8),align:"center",className:I.searchBtn,children:[(0,l.tZ)(W.Z,{size:24,color:n||X.r.colors.primary600}),(0,l.BX)(h.k,{className:I.countTitle,align:"center",gap:16,children:[(0,l.tZ)(c.T,{size:"s3",sx:{flex:1},children:en}),(0,l.tZ)(ClinicLocatorSidebarLocation,{data:k,onChange:T})]})]})]}),(0,l.BX)(er,{...ec,className:(0,U.default)("clinicLocatorSidebar--body",{"!hidden":E&&!P},I.sidebarList),children:[(0,l.tZ)(O.f,{visible:"sidebar"===i,sx:{borderRadius:(0,g.h)(20)}}),(0,l.BX)(ed,{...eu,children:[null==s?void 0:s.map((e,t)=>(0,l.BX)(h.k,{gap:(0,g.h)(16),sx:{cursor:"pointer"},className:(0,U.default)("clinicLocatorSidebar--item relative",{"min-w-[280px]":E,"p-3":E,"px-6 py-3":!E,"border-b border-solid border-gray100":!E,"bg-[transparent]":(null==d?void 0:d.id)===e.id&&!E,"bg-blue50":(null==d?void 0:d.id)===e.id,...E&&{"bg-white":(null==d?void 0:d.id)!==e.id}}),onClick:()=>null==p?void 0:p(e),children:[(0,l.tZ)("div",{className:(0,U.default)("absolute bg-primary600",{"left-0 bottom-0 w-full h-[2px]":E,"top-0 left-0 w-[2px] h-full":!E,"opacity-100":(null==d?void 0:d.id)===e.id,"opacity-0":(null==d?void 0:d.id)!==e.id})}),!E&&(0,l.tZ)(u.x,{className:"w-8 h-8",children:(0,l.tZ)(F.I,{width:"100%",height:"100%",src:e.logo,alt:e.name,className:"object-contain"})}),(0,l.tZ)(u.x,{sx:{flex:1,minWidth:0},children:(0,l.BX)(c.T,{lineClamp:E?3:void 0,children:[(0,l.tZ)(c.T,{size:"s3",weight:"semiBold",children:e.name}),(0,l.tZ)(c.T,{size:"p4",lineClamp:E?void 0:3,children:e.address})]})})]},"".concat(e.id,"-").concat(t))),ea&&(0,l.BX)(u.x,{py:20,sx:{textAlign:"center"},children:[(0,l.tZ)("div",{ref:R,style:{height:1}}),(0,l.tZ)(V.L,{className:"whitespace-nowrap"})]})]})]})]})});ea.displayName="ClinicLocatorSidebar";var ei=n("L6+J"),eo=n("xrdX"),er=n("8vDj"),ec=n("CJtR");function SelectedClinicMarker(e){var t,n;let{selectedClinic:i,hideBooking:o}=e,{formatMessage:r}=(0,x.Z)(),s=(0,er.rZ)(),{dataEventCategory:d}=(0,a.useContext)(ee),[p,f]=(0,a.useState)(),{locale:m}=(0,L.h)(),v=ei.C.includes(m)?(0,ec.D4)({id:i.id,name:i.name,locale:m,slug:i.slug}):null,b=i.totalAvailableDoctors&&i.totalAvailableServices?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:v}:i.totalAvailableDoctors?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:"".concat(v,"?tab=").concat(null===(t=Z.a8[m])||void 0===t?void 0:t.DOCTOR)}:i.totalAvailableServices?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:"".concat(v,"?tab=").concat(null===(n=Z.a8[m])||void 0===n?void 0:n.SERVICE)}:{label:r({id:"articlePage.careEmbedding.viewDetail"}),url:v};return(0,l.BX)(l.HY,{children:[(0,l.tZ)("style",{children:"\n .gm-style img {\n max-height: none !important;\n max-width: 100%;\n object-fit: contain;\n }\n\n .gm-style-iw-c {\n padding: 12px; \n border-radius: 16px; \n box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04), \n 0px 0px 2px 0px rgba(0, 0, 0, 0.06), \n 0px 4px 8px 0px rgba(0, 0, 0, 0.04);\n }\n\n .gm-style-iw > button {\n right: 0 !important;\n top: 0 !important;\n }\n\n .gm-style-iw-chr {\n position: absolute;\n right: 0;\n }\n "}),(0,l.tZ)(z.Marker,{position:{lat:Number(i.latitude),lng:Number(i.longitude)},onLoad:f}),p&&(0,l.tZ)(z.InfoWindow,{anchor:p,options:{minWidth:320,maxWidth:320},children:(0,l.BX)($.K,{spacing:(0,g.h)(4),sx:{paddingTop:10},children:[i.logo?(0,l.tZ)("div",{children:(0,l.tZ)("img",{loading:"lazy",src:i.logo,alt:i.name,width:"auto",height:48})}):null,(0,l.BX)($.K,{spacing:(0,g.h)(4),children:[(0,l.tZ)(c.T,{size:"s4",weight:"semiBold",children:i.name}),(0,l.tZ)(c.T,{size:"n1",children:i.address}),!o&&(i.totalAvailableDoctors||i.totalAvailableServices)?(0,l.BX)(c.T,{size:"n1",children:[r({id:"clinicLocator.infoWindow.availableForBooking",defaultMessage:"Available for booking"}),": ",(0,l.BX)(u.x,{component:"span",sx:e=>({span:{display:"inline-block"},"span + span":{position:"relative",marginLeft:(0,g.h)(5),paddingLeft:(0,g.h)(5),"&:before":{content:'""',width:(0,g.h)(2),height:(0,g.h)(2),borderRadius:"50%",background:e.colors.gray[6],position:"absolute",left:"0",top:"50%"}}}),children:[i.totalAvailableDoctors>0&&(0,l.tZ)("span",{children:i.totalAvailableDoctors?r({id:"clinicLocator.infoWindow.availableDoctors"}):""}),i.totalAvailableServices>0&&(0,l.tZ)("span",{children:(0,l.tZ)("span",{children:i.totalAvailableServices?r({id:"clinicLocator.infoWindow.availableServices"}):""})})]})]}):null,(!o&&b.url||i.websiteUrl)&&(0,l.BX)(h.k,{align:"center",gap:16,sx:{"a:focus-visible":{outline:"none"}},children:[!o&&b.url&&(0,l.tZ)(u.x,{component:"a",href:b.url,target:"_blank",className:"pointer-event-child-none","data-event-category":d,"data-event-action":"Book Doctor via Clinic Click","data-event-label":"https://".concat(eo.v[m]).concat(b.url),children:(0,l.tZ)(c.T,{size:"n1",sx:{color:s.colors.blue[8],textDecoration:"underline",textUnderlineOffset:(0,g.h)(4)},children:b.label})}),i.websiteUrl&&(0,l.tZ)(u.x,{component:"a",href:i.websiteUrl,target:"_blank",className:"pointer-event-child-none","data-event-category":d,"data-event-action":"Clinic Directory - Go to Hospital Page","data-event-label":i.websiteUrl,children:(0,l.tZ)(c.T,{size:"n1",sx:{color:s.colors.blue[8],textDecoration:"underline",textUnderlineOffset:(0,g.h)(4)},children:r({id:"clinicLocator.infoWindow.websiteUrl",defaultMessage:"Go to hospital page"})})})]})]})]})},i.id)]})}let es={current:1,first:1,last:1,next:1,prev:1,total_items:0,items_per_page:20};var clinicLocator=e=>{var t,n;let{title:i,specialties:v=[],specialties_hashtag:b,defaultColor:Z,hideBooking:B,onGetBrowserLoc:R,infoPath:M,useMobileLayout:z,dataEventCategory:D="Service Connection",...X}=e,{formatMessage:F}=(0,x.Z)(),{classes:V}=et({useMobileLayout:z}),{locale:W}=(0,L.h)(),G=(0,S.d)(!0),U=(0,T.U)(),O=(0,a.useRef)(null),j=(0,a.useRef)(null),H=(0,a.useRef)(null),K=(0,a.useRef)(null),Y=function(e){let{specialties:t}=e,n={type:"hospital",allowSearchInDistrict:1,showDistricts:1};return t.length&&(n.specialtyIds=t.join(",")),n}({specialties:v}),[q,Q]=(0,a.useState)(Y),[J,$]=(0,a.useState)(),[en,el]=(0,a.useState)(null),[ei,eo]=(0,a.useState)([]),[er,ec]=(0,a.useState)(!1),[eu,eh]=(0,a.useState)(!1),[eg,ep]=(0,a.useState)(!1),[ef,em]=(0,a.useState)(!1),{fetchClinics:ev}=function(e){let{infoPath:t}=e,[n,l]=(0,a.useState)(!1),i=(0,a.useCallback)(async e=>{let{signal:n,...a}=e;l(!0);try{let e=await (0,I.d)(_.y.CARE.GET_SEARCH_CARE,{params:a,signal:n},"careV2"),{_data:l}=e||{};if(!l)throw Error(JSON.stringify(e));let{searches:i}=l||{};return{data:{...l,searches:i.map(e=>{let n={...e};return t&&(n.name=E()(e,t,e.name)),(0,N.ZL)(n)})},errors:[]}}catch(e){if("AbortError"===e.name||"canceled"===e.message)return{data:null,errors:[],isCanceled:!0};return{data:null,errors:[e]}}finally{l(!1)}},[t]);return(0,a.useMemo)(()=>({loading:n,setLoading:l,fetchClinics:i}),[n,l,i])}({infoPath:M}),eb=(0,a.useRef)(null),appendClinics=e=>{eo(t=>{let n=[...t,...e],l=n.reduce((e,t)=>(e[t.id]=t,e),{});return Object.values(l)})},[ew,ex]=(0,a.useState)(null),[eC,ey]=(0,a.useState)(null),[ek,eT]=(0,a.useState)(),[eS,eL]=(0,a.useState)(""),eZ=A[W],{title:eB,viewExpertsBtn:eE}=(0,a.useMemo)(()=>({title:i||F({id:"section.clinicLocator.title",defaultMessage:"Explore the best Clinics for yourself"}),viewExpertsBtn:F({id:"section.clinicLocator.viewExpertsBtn",defaultMessage:"View Experts"})}),[F,i]),eI=(0,a.useMemo)(()=>(0,l.tZ)(TitleComp,{title:eB}),[eB]),eN=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(0==e.length)return!1;if(O.current){let t=new window.google.maps.LatLngBounds;if(null==e||e.forEach(e=>{t.extend(new window.google.maps.LatLng(e.latitude,e.longitude))}),t.getNorthEast().equals(t.getSouthWest())){let e=new google.maps.LatLng(t.getNorthEast().lat()+.005,t.getNorthEast().lng()+.005),n=new google.maps.LatLng(t.getNorthEast().lat()-.005,t.getNorthEast().lng()-.005);t.extend(e),t.extend(n)}O.current.fitBounds(t)}},[]);function formatFilterData(e){let{cities:t=[],districts:n=[]}=e,l=n.length?n.map(e=>({label:e.name,value:e.id,type:"district"})):t.length?t.map(e=>({label:e.name,value:e.id,type:"city"})):[];return l}let handleReset=async()=>{Q(Y),e_(Y,"sidebar",e=>{var t;let{clinics:n,pagination:l,cities:a,districts:i}=e;ey({initialClinics:n,initialPagination:l,filter:formatFilterData({cities:a,districts:i})}),eo(n||[]),el(null),eL(""),null===(t=K.current)||void 0===t||t.scrollTop()})},handleFetch=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l={...Y,...e&&{latitude:e.lat,longitude:e.lng,...t&&{distance:5}}};Q(l),eL(""),e_(l,"sidebar",e=>{let{clinics:t,pagination:l,cities:a,districts:i}=e;ey({initialClinics:t,initialPagination:l,filter:formatFilterData({cities:a,districts:i})}),eo(t||[]),n&&setTimeout(()=>{em(n)},1e3)})},handleLoadMore=async()=>{let e={...q,page:Number(null==eC?void 0:eC.initialPagination.current)+1};Q(e),e_(e,"load-more",e=>{let{clinics:t,pagination:n,cities:l,districts:a}=e;ey(e=>({initialClinics:[...(null==e?void 0:e.initialClinics)||[],...t],initialPagination:n,filter:function(e){if(!e||!e.length)return[];let t=new Map,n=[];return e.forEach(e=>t.set(e.value,e)),t.forEach(e=>{n.push(e)}),n}(((null==eC?void 0:eC.filter)||[]).concat(formatFilterData({cities:l,districts:a})))})),appendClinics(t),eo(t||[])})},handleFilter=async e=>{let t=null==e?void 0:e.type,n=null==e?void 0:e.value,l={...q,page:1,..."district"===t?{districtId:n}:"city"===t?{cityId:n}:{}};n||(delete l.cityId,delete l.districtId,delete l.distance),Q(l);try{e_(l,"sidebar",e=>{var t;let{clinics:n,pagination:l,cities:a,districts:i}=e;ey({initialClinics:n,initialPagination:l,filter:formatFilterData({cities:a,districts:i})}),appendClinics(n),eo(n||[]),null===(t=K.current)||void 0===t||t.scrollTop()})}catch(e){console.error(e)}},e_=(0,a.useCallback)(w()(async(e,t,n)=>{eb.current&&eb.current.abort();let l=new AbortController;eb.current=l;try{$(t);let a=await ev({...e,signal:l.signal});if((null==a?void 0:a.isCanceled)||l.signal.aborted)return;let{data:i}=a;if(!i)return;let{searches:o,districts:r,cities:c,pagination:s}=i;n&&n({clinics:o,pagination:s||es,districts:r,cities:c})}catch(e){"AbortError"!==e.name&&console.error("Search Error:",e)}finally{l.signal.aborted||$(void 0)}},500),[null==eC?void 0:eC.filter]);(0,a.useEffect)(()=>()=>{e_.cancel()},[e_]);let handleSearch=async e=>{if(!e){e_.cancel(),handleReset();return}let t={...q,keyword:e,page:1};e_(t,"search-bar",e=>{let{clinics:t,pagination:n,cities:l,districts:a}=e;el({initialClinics:t,initialPagination:n,filter:formatFilterData({cities:l,districts:a})})})},trackSearchResults=(e,t)=>{var n,l;null===(n=(l=window).gtag)||void 0===n||n.call(l,"event","view_search_results",{event_category:D,event_action:"Clinic Directory",event_label:U,search_term:e,search_result_shown:((null==t?void 0:t.length)>0).toString()})},handleSubmitSearchValue=async e=>{var t,n;let l={...Y,keyword:e,page:1};Q(l),ec(!0),eL(e),null==j||null===(t=j.current)||void 0===t||t.blur();let a=(null==en?void 0:en.initialClinics)||[];if("search-bar"!==J&&a.length>0){ey({initialClinics:a,initialPagination:(null==en?void 0:en.initialPagination)||es,filter:(null==en?void 0:en.filter)||[]}),eo(a),el(null),trackSearchResults(e,a),null===(n=K.current)||void 0===n||n.scrollTop();return}e_(l,"sidebar",t=>{var n;let{clinics:l,pagination:a,cities:i,districts:o}=t;ey({initialClinics:l,initialPagination:a||es,filter:formatFilterData({cities:i,districts:o})}),eo(l),el(null),trackSearchResults(e,l),null===(n=K.current)||void 0===n||n.scrollTop()})},handleMarkerClick=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(ex(e),t&&eL(""),ec(!0),O.current){let t=new window.google.maps.LatLngBounds;if(t.extend(new window.google.maps.LatLng(e.latitude,e.longitude)),t.getNorthEast().equals(t.getSouthWest())){let e=new google.maps.LatLng(t.getNorthEast().lat()+.01,t.getNorthEast().lng()+.01),n=new google.maps.LatLng(t.getNorthEast().lat()-.01,t.getNorthEast().lng()-.01);t.extend(e),t.extend(n)}O.current.fitBounds(t)}if(!eC){eo([e]);let{data:t}=await ev({type:"hospital",latitude:e.latitude,longitude:e.longitude,distance:5,perPage:50,showDistricts:0}),{searches:n}=t;appendClinics(n)}},getCurrentLocation=()=>{if(!ef){if(!navigator.geolocation)return console.log("Geolocation is not supported by this browser."),null;eh(!0),navigator.geolocation.getCurrentPosition(e=>{eh(!1),handleFetch({lat:e.coords.latitude.toFixed(8),lng:e.coords.longitude.toFixed(8)},!0,!0),eT({lat:e.coords.latitude,lng:e.coords.longitude}),null==R||R({lat:e.coords.latitude,lng:e.coords.longitude})},e=>(console.log("Error getting user location",e),eh(!1),1===e.code&&ep(!0),null))}},eR=(0,a.useCallback)(e=>()=>{var t,n;let l=(null===(t=O.current)||void 0===t?void 0:t.getZoom())||15;null===(n=O.current)||void 0===n||n.setZoom(l+e)},[null===(t=O.current)||void 0===t?void 0:t.getZoom,null===(n=O.current)||void 0===n?void 0:n.setZoom]);(0,a.useEffect)(()=>{O.current&&eC&&(((null==eC?void 0:eC.initialClinics)||[]).length>0?eN(eC.initialClinics):ek&&O.current.setCenter(ek))},[eC]),(0,a.useEffect)(()=>{if(O.current&&ek){let e=new window.google.maps.LatLngBounds;if(e.extend(new window.google.maps.LatLng(ek.lat,ek.lng)),e.getNorthEast().equals(e.getSouthWest())){let t=new google.maps.LatLng(e.getNorthEast().lat()+.01,e.getNorthEast().lng()+.01),n=new google.maps.LatLng(e.getNorthEast().lat()-.01,e.getNorthEast().lng()-.01);e.extend(t),e.extend(n)}O.current.fitBounds(e)}},[ek]),(0,a.useEffect)(()=>{if(eg){let e=setTimeout(()=>{ep(!1)},3e3);return()=>clearTimeout(e)}},[eg]);let eM=G||z;return(0,l.tZ)(ee.Provider,{value:{isMobile:eM,dataEventCategory:D},children:(0,l.BX)(ed,{ref:H,...X,children:[eM&&(0,l.tZ)(C.W,{className:"map-hhg-container",children:eI}),(0,l.tZ)(u.x,{sx:{position:"relative",backgroundColor:"#fff"},children:(0,l.BX)(h.k,{className:V.wrapper,pos:"relative",children:[(0,l.tZ)(h.k,{id:"clinicLocator--sidebar",direction:"column",mah:"100%",className:V.sidebar,children:(0,l.tZ)(ea,{ref:K,color:Z,loadingAt:J,extendComponent:!eM&&(0,l.BX)(l.HY,{children:[eI,(0,l.tZ)(ButtonComp,{buttonText:eE,backgroundColor:Z,specialties_hashtag:b,currentUrl:U})]}),clinics:null==eC?void 0:eC.initialClinics,pagination:null==eC?void 0:eC.initialPagination,clinicSelected:ew,onSelectClinic:e=>{var t,n;handleMarkerClick(e,!1),null===(t=(n=window).gtag)||void 0===t||t.call(n,"event","interaction_click",{event_category:D,event_action:"Clinic Directory Click",event_label:U,hospital_id:e.id,click_location:"list"}),setTimeout(()=>{var e;null===(e=document.getElementById("clinicLocator--content"))||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},100)},hideSearchDropdown:er,searchValue:eS,searchData:(null==en?void 0:en.initialClinics)||null,onChangeSearch:e=>{ec(!1),handleSearch(e)},onItemSubmitSearch:e=>{var t,n,l,a,i;let o={...q};delete o.keyword,eL(""),Q(o),appendClinics([e]),handleMarkerClick(e),null===(t=j.current)||void 0===t||t.blur(),null===(n=(l=window).gtag)||void 0===n||n.call(l,"event","view_search_results",{event_category:D,event_action:"Clinic Directory",event_label:U,search_term:eS,search_result_shown:(((null==en?void 0:en.initialClinics)||[]).length>0).toString()}),null===(a=(i=window).gtag)||void 0===a||a.call(i,"event","interaction_click",{event_category:D,event_action:"Clinic Directory Click",event_label:U,hospital_id:e.id,click_location:"search box"}),setTimeout(()=>{var e;null===(e=document.getElementById("clinicLocator--content"))||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},100)},onSubmitSearch:handleSubmitSearchValue,onLoadMore:handleLoadMore,filter:null==eC?void 0:eC.filter,onFilter:handleFilter,searchRef:j,queryParams:q})}),(0,l.BX)(u.x,{id:"clinicLocator--content",className:V.content,children:[(0,l.tZ)(P,{ref:O,onLoad:e=>{var t,n;let l=null===(t=e.getCenter())||void 0===t?void 0:t.lat(),a=null===(n=e.getCenter())||void 0===n?void 0:n.lng();if(l&&a){let e=(null==eZ?void 0:eZ.lat)===l&&(null==eZ?void 0:eZ.lng)===a,t={lat:l,lng:a};eT(t),handleFetch(t,!e)}},zoom:13,center:ek||eZ,onCenterChanged:()=>em(!1),markerItems:ei,markerItemProps:{onClick(e){var t,n;handleMarkerClick(e),null===(t=(n=window).gtag)||void 0===t||t.call(n,"event","interaction_click",{event_category:D,event_action:"Clinic Directory Click",event_label:U,hospital_id:e.id,click_location:"map"})}},options:{cameraControl:!1,rotateControl:!1,streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1},children:ew&&(0,l.tZ)(SelectedClinicMarker,{selectedClinic:ew,hideBooking:B})}),(0,l.BX)(h.k,{direction:"column",gap:0,pos:"absolute",top:"50%",right:(0,g.h)(16),className:V.controlBtns,children:[(0,l.tZ)(p.u,{label:F({id:"clinicLocator.zoomOutToViewMore"}),position:"left",withArrow:!0,children:(0,l.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:()=>{eN(ei)},children:(0,l.tZ)(k.Z,{className:"zoomIcon"})})}),(0,l.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:eR(1),children:(0,l.tZ)(s.Z,{className:"zoomIcon"})}),(0,l.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:eR(-1),children:(0,l.tZ)(d.Z,{className:"zoomIcon"})})]}),(0,l.tZ)(h.k,{pos:"absolute",left:"50%",sx:e=>({zIndex:0,transform:"translate(-50%, 0)",[e.fn.smallerThan("sm")]:{top:16},[e.fn.largerThan("sm")]:{bottom:16}}),children:(0,l.BX)(o.o,{position:"top",withArrow:!0,arrowPosition:"center",shadow:"md",opened:eg,onChange:ep,positionDependencies:["isMobile"],children:[(0,l.tZ)(o.o.Target,{children:(0,l.tZ)(r.B,{className:"pointer-event-child-none",styles:e=>({root:{...Z&&{background:"".concat(Z,"!important"),"&:hover":{background:"".concat(e.fn.darken(Z,.05))}},"&[data-loading]":{"&:before":{background:"transparent"}}},leftIcon:{display:"none"}}),onClick:()=>getCurrentLocation(),loading:eu,rightIcon:eu?(0,l.tZ)(m.a,{color:"#fff",size:"xs"}):(0,l.tZ)(y.Z,{color:"#fff",size:18}),"data-event-category":D,"data-event-action":"Find The Nearest Clinic","data-event-label":U,children:F({id:"clinicLocator.findNearClinic",defaultMessage:"Find your nearest Clinic"})})}),(0,l.tZ)(o.o.Dropdown,{style:{pointerEvents:"none"},children:(0,l.tZ)(c.T,{size:"xs",children:F({id:"clinicLocator.plsAllowAccess",defaultMessage:"Please allow location access"})})})]})})]})]})})]})})};let TitleComp=e=>{let{title:t}=e,{isMobile:n}=(0,a.useContext)(ee),{classes:i,cx:o}=et({useMobileLayout:n});return(0,l.tZ)(c.T,{as:"h2",miw:0,fs:(0,g.h)(22),className:o("map-header",i.titleComp),children:t})},ButtonComp=e=>{let{buttonText:t,backgroundColor:n,specialties_hashtag:i,currentUrl:o}=e,{isMobile:c,dataEventCategory:s}=(0,a.useContext)(ee),{classes:d}=et({backgroundColor:n,useMobileLayout:c}),u=(0,a.useMemo)(()=>{if(!i)return null;let e=document.getElementById("#".concat(i.replace(/\#/g,"")));if(!e)return null;let n={"data-event-category":s,"data-event-action":"CLick - View experts","data-event-label":"".concat(o).concat(i?"".concat(i):"")};return(0,l.tZ)(r.B,{...n,className:d.viewExpertBtn,size:"lg",variant:"primary",onClick:()=>{e.scrollIntoView({behavior:"smooth",inline:"center",block:"center"})},leftIcon:(0,l.tZ)(v.E,{w:(0,g.h)(24),h:(0,g.h)(24),src:"".concat(Z.uQ,"/clinic.svg"),alt:t}),children:t})},[i,t]);return u},ed=(0,i.Z)("div",{target:"e2j4txt0"})("display:flex;flex-direction:column;.g-map{width:100%;height:100%;}")},"7a+s":function(e,t,n){n.d(t,{S:function(){return ClinicLocatorEmbedCard}});var l=n("BGKE"),a=n("rrs9"),i=n("8vDj"),o=n("OAL+"),r=n("Vvt1"),c=n.n(r);let s=c()(()=>Promise.all([n.e(1255),n.e(4846),n.e(2233),n.e(1058),n.e(3295),n.e(1538),n.e(7152),n.e(5684),n.e(2574),n.e(9057),n.e(9884),n.e(7644),n.e(6962),n.e(8767),n.e(6638),n.e(7741),n.e(3434),n.e(2433),n.e(5385),n.e(3564),n.e(7082),n.e(3158),n.e(5641),n.e(7454),n.e(7004),n.e(4758),n.e(6219),n.e(17),n.e(8990),n.e(4067),n.e(9487),n.e(9083),n.e(1520),n.e(270),n.e(7596),n.e(8217),n.e(7543),n.e(2835),n.e(2507),n.e(6885),n.e(7859),n.e(690),n.e(2730),n.e(6287),n.e(7682),n.e(1551),n.e(4870),n.e(9922),n.e(3133),n.e(612),n.e(2002),n.e(1880),n.e(7471),n.e(7165),n.e(5451),n.e(8612),n.e(2819),n.e(7695)]).then(n.bind(n,"a7TI")).then(e=>e.default),{loadableGenerated:{webpack:()=>["a7TI"]},ssr:!1}),ClinicLocatorEmbedCard=e=>{let{title:t,description:n,specialties:r,color:c,dataEventCategory:d}=e,u=(0,i.rZ)();return(0,l.BX)(o.K,{spacing:16,sx:e=>({".map-hhg-container":{display:"none"},[e.fn.largerThan("sm")]:{"#clinicLocator--content":{height:400}}}),children:[(t||n)&&(0,l.BX)(o.K,{spacing:8,children:[t&&(0,l.tZ)(a.T,{size:"h3",variant:"primary",children:t}),n&&(0,l.tZ)(a.T,{size:"p1",children:n})]}),(0,l.tZ)(s,{useMobileLayout:!0,className:"locator-map",specialties:r,defaultColor:c||u.fn.primaryColor(),dataEventCategory:d})]})}}}]);