(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{99272:function(e,t,s){Promise.resolve().then(s.bind(s,64404)),Promise.resolve().then(s.bind(s,27640)),Promise.resolve().then(s.bind(s,90239)),Promise.resolve().then(s.t.bind(s,231,23)),Promise.resolve().then(s.t.bind(s,84080,23)),Promise.resolve().then(s.bind(s,78040)),Promise.resolve().then(s.t.bind(s,15204,23))},78040:function(e,t,s){"use strict";s.d(t,{default:function(){return en}});var n=s(57437),r=s(56800),l=s.n(r);function i(e){let{children:t}=e;return(0,n.jsx)("div",{className:"p-3 lg:p-6",children:t})}var a=s(78963),c=s(64818),o=s(5618),d=s(79370),u=s(29039),x=s(70673),h=s(94526),m=s(2265),g=s(87138),f=s(66648),j=s(94143);function b(e){let{visible:t,onCancel:s}=e,{user:r,setUserAddress:l}=(0,a.b)(),{data:i,isLoading:b}=(0,u.ZP)(["address",r],r?d.Kz:null,{revalidateOnFocus:!1}),v=(0,m.useCallback)(e=>{var t,n,r,i,a,c;let o={zipCode:null!==(t=e.zipcode)&&void 0!==t?t:e.zipCode,address:null!==(n=e.address)&&void 0!==n?n:"",addressNumber:e.addressNumber,neighborhood:null!==(r=e.neighborhood)&&void 0!==r?r:"",city:null!==(i=e.city)&&void 0!==i?i:"",state:null!==(a=e.state)&&void 0!==a?a:"",country:null!==(c=e.country)&&void 0!==c?c:"",latitude:e.coordinate.latitude,longitude:e.coordinate.longitude,coordinate:{latitude:e.coordinate.latitude,longitude:e.coordinate.longitude},current:!1};l(o),(0,j.D)("browserAddress").set(o),s()},[s,l]);return(0,n.jsxs)(c.Z,{hideCloseButton:!0,title:"",visible:t,onCancel:s,cancelOnOutsideClick:!1,className:"modal-address",children:[(0,n.jsxs)("div",{className:"modal-address-header",children:[(0,n.jsxs)("div",{className:"modal-address-icons",children:[(0,n.jsx)(f.default,{src:"/search/search_consult.png",alt:"consult",width:50,height:50,className:"filter to-green-800"}),(0,n.jsx)(f.default,{src:"/search/search_exam.png",alt:"exam",width:50,height:50}),(0,n.jsx)(f.default,{src:"/search/search_drugstore.png",alt:"drugstore",width:50,height:50})]}),(0,n.jsxs)("h1",{className:"text-lg font-semibold text-gray-600",children:["Precisamos da sua localiza\xe7\xe3o para voc\xea marcar"," ",(0,n.jsx)("span",{className:"green",children:"consultas"}),","," ",(0,n.jsx)("span",{className:"yellow",children:"exames"})," e comprar em"," ",(0,n.jsx)("span",{className:"blue",children:"farm\xe1cias"})," pr\xf3ximas de voc\xea."]})]}),(0,n.jsx)(o.Z,{onGetFullAddress:v}),b?"Obtendo dados...":i?(0,n.jsx)(x.Z,{children:i.map(e=>(0,n.jsx)(h.Z,{onClick:()=>v(e),address:e,className:"cursor-pointer"},e.id))}):"",!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("h1",{className:"text-lg font-semibold text-black",children:"J\xe1 tem um endere\xe7o salvo?"}),(0,n.jsx)("p",{children:"Entre na sua conta e selecione um dos seus endere\xe7os."})]}),(0,n.jsxs)("div",{className:"w-full flex justify-center items-center",children:[(0,n.jsx)(g.default,{onClick:s,href:"/create-account",className:"text-green-500 text-lg mr-3 hover:text-green-400 no-link",children:"Crie sua conta"}),(0,n.jsx)(g.default,{href:"/profile",onClick:s,children:(0,n.jsx)("button",{className:"bg-green-500 h-12 rounded-lg text-white px-3 removeInputCoutour",children:"Entrar"})})]})]})]})}var v=s(1261),p=s(10792);function N(){let[e,t]=(0,m.useState)(!1),{userAddress:s,compassAddress:r,setOpenAddress:l}=(0,a.b)();(0,m.useEffect)(()=>{l(()=>t(!0))},[l]);let i=(0,m.useMemo)(()=>{let e=null!=s?s:r;return e?(0,v.Hx)([null==e?void 0:e.address,null==e?void 0:e.addressNumber,null==e?void 0:e.neighborhood,null==e?void 0:e.city]):"Selecione o endere\xe7o"},[s,r]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"egide-address no-link",onClick:()=>t(!0),children:[(0,n.jsx)("span",{children:i})," ",(0,n.jsx)(p.I,{icon:"chevron-down",className:"text-green-600 ml-1"})]}),(0,n.jsx)(b,{visible:e,onCancel:()=>t(!1)})]})}var y=s(2289),C=s(63872),k=s(70254),w=s(7732),_=s(80734),P=s(43172);function E(){let{onAskExit:e}=(0,a.b)();return(0,n.jsxs)(w.v,{children:[(0,n.jsx)(g.default,{href:"/profile",className:"no-link",children:(0,n.jsx)(_.s,{text:"Perfil",icon:"person"})}),(0,n.jsx)(P.R,{}),(0,n.jsx)(_.s,{text:"Sair",icon:"log-out",onClick:e})]})}var S=s(62156);function Z(){let{user:e}=(0,a.b)(),[t,s]=(0,m.useState)(!1),[r,l]=(0,m.useState)("login"),i=(0,m.useCallback)(e=>{l(e),s(!0)},[]);return e?(0,n.jsx)("div",{className:"egide-nav-user flex flex-1 justify-end items-center",children:(0,n.jsx)(k.J,{content:(0,n.jsx)(E,{}),position:"bottom",children:(0,n.jsxs)("div",{className:"flex justify-end items-center cursor-pointer",children:[(0,n.jsxs)("div",{className:"text-right mr-4",children:[(0,n.jsx)("div",{className:"font-semibold",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-gray-400",children:e.email})]}),(0,n.jsx)(y.Z,{size:48,imageUrl:e.profile_image_url,name:e.name}),(0,n.jsx)(C.Blh,{className:"ml-2 text-gray-500"})]})})}):(0,n.jsxs)("div",{className:"egide-nav-login flex flex-1 justify-end items-center",children:[(0,n.jsx)("span",{onClick:()=>i("register"),className:"text-green-500 text-lg mr-3 hover:text-green-400 no-link cursor-pointer",children:"Crie sua conta"}),(0,n.jsx)("button",{className:"bg-green-500 h-12 rounded-lg text-white px-3 removeInputCoutour",onClick:()=>i("login"),children:"Entrar"}),(0,n.jsx)(S.Z,{visible:t,onCancel:()=>s(!1),typeFormView:r})]})}var F=s(3941),z=s(22170),I=s.n(z),O=s(49363),A=e=>{let{children:t,placeholder:s="Procurar...",compareKey:r="id",keyLabel:l="name",onPick:i,onQueryChange:a,renderRequesting:c,renderItem:o,noResults:d=(0,n.jsx)(_.s,{text:"N\xe3o h\xe1 resultados"}),...x}=e,[h,g]=(0,m.useState)(""),[f,j]=(0,m.useState)(!1),{data:b=[],isValidating:v}=(0,u.ZP)((null==h?void 0:h.trim())&&f&&a?["search",h.trim()]:null,()=>a(h.trim()),{revalidateOnFocus:!1}),p=(0,m.useMemo)(()=>a?{onQueryChange:I()(g,400)}:{},[a]),N=(0,m.useMemo)(()=>v?["requesting"]:b,[b,v]);(0,m.useEffect)(()=>{f||g("")},[f]);let y=(0,m.useCallback)(e=>{i(e),j(!1)},[i]);return(0,n.jsxs)(n.Fragment,{children:[t(()=>j(!0)),(0,n.jsx)(F.T,{resetOnSelect:!0,isOpen:f,initialContent:null,itemsEqual:(e,t)=>e[r]===t[r],inputProps:{placeholder:s},activeItem:null,onClose:()=>j(!1),onItemSelect:e=>{j(!1),y(e)},itemRenderer:(e,t)=>{let{handleClick:s}=t;return"requesting"===e?c?c():(0,n.jsxs)("div",{className:"text-slate-500 px-3 py-1 flex justify-between items-center",children:[(0,n.jsx)("span",{children:"Obtendo informa\xe7\xf5es..."}),(0,n.jsx)(O.Z,{})]}):o?o(e,()=>j(!1),s):(0,n.jsx)(_.s,{text:e[l],onClick:s},e.id)},items:N,noResults:d,className:"egide-omnisearch",...p,...x})]})};function R(){var e;let{searchParams:t}=(0,a.b)();return(0,n.jsx)(A,{keyLabel:"name",noResults:null==t?void 0:t.noResults,onQueryChange:null==t?void 0:t.onQuery,placeholder:null==t?void 0:t.placeholder,renderItem:(null==t?void 0:t.renderItem)?t.renderItem:void 0,onPick:null!==(e=null==t?void 0:t.onPick)&&void 0!==e?e:()=>{},children:e=>{var s;return(0,n.jsx)("div",{className:"egide-search",children:(0,n.jsxs)("button",{type:"button",onClick:e,className:"flex bg-gray-50 pl-3 items-center rounded-lg no-link w-full lg:w-auto",children:[(0,n.jsx)(p.I,{icon:"search",size:18,className:"text-[#bbbbbb]"}),(0,n.jsx)("div",{className:"ml-3 mr-6 flex-1 bg-gray-50 text-lg text-[#bbbbbb]",children:null!==(s=null==t?void 0:t.placeholder)&&void 0!==s?s:"O que voc\xea procura?"}),(0,n.jsx)("div",{className:"bkgPrimary w-12 h-12 rounded-lg flex items-center justify-center",children:(0,n.jsx)(p.I,{icon:"search",className:"text-white"})})]})})}})}function T(){return(0,n.jsxs)("div",{className:"egide-flex-lg-sidebar gap-2 justify-between items-center py-3",children:[(0,n.jsx)(R,{}),(0,n.jsx)(N,{}),(0,n.jsx)(Z,{})]})}function L(){return(0,n.jsxs)("div",{className:"egide-flex-sm flex-col",children:[(0,n.jsx)(N,{}),(0,n.jsx)(R,{})]})}var D=s(2337);function W(e){var t;let{hasAbout:s,...r}=e,{subdomain:l}=(0,D.p)();return(0,n.jsx)("div",{...r,children:(0,n.jsxs)("div",{className:"flex flex-col w-full gap-6",children:[(0,n.jsxs)("div",{className:"flex w-full items-center gap-4",children:[(0,n.jsx)(f.default,{src:null!==(t=null==l?void 0:l.imageUrl)&&void 0!==t?t:"",height:60,width:60,alt:"Logo",className:"rounded-full"}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("h1",{className:"font-semibold text-gray-700 text-lg",children:null==l?void 0:l.name}),(0,n.jsxs)("p",{className:"text-gray-400",children:[null==l?void 0:l.clinicIds.length," unidade",l.clinicIds.length>1?"s":""]})]})]}),s&&(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("h1",{className:"font-semibold text-gray-500 text-base",children:"Sobre N\xf3s"}),(0,n.jsx)("p",{className:"text-gray-700",children:null==l?void 0:l.description})]})]})})}function B(){let e,t;let{subdomain:s}=(0,D.p)();if(s)return s.height>=s.width&&(e=50,t=s.height/s.width*e),s.height<s.width&&(t=50,e=s.width/s.height*t),(0,n.jsxs)("div",{className:"egide-white-label",children:[(0,n.jsx)(W,{className:"logo-whitelabel-mobile"}),(0,n.jsx)(R,{}),(0,n.jsx)(Z,{})]})}function M(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(T,{}),(0,n.jsx)(L,{}),(0,n.jsx)(B,{})]})}function U(e){let{visible:t,onDismiss:s}=e,{logout:r}=(0,a.b)(),l=(0,m.useCallback)(async()=>{r()},[r]);return(0,n.jsx)(c.Z,{cancelOnOutsideClick:!1,intent:"danger",visible:t,onCancel:s,onConfirm:l,title:"Exit?",confirmTitle:"Yes, exit",cancelTitle:"Cancel",children:(0,n.jsx)("p",{children:"Are you sure?"})})}function q(e){let{href:t,asButton:s=!1,minimal:r=!1,full:i=!1,large:a=!1,intent:c="primary",children:o,className:d="",...u}=e,x=r||!s,h=l()({"p-3 rounded-lg gap-2":!0,"font-bold":s,"w-full":i,"text-lg":a,"text-white":"none"!==c&&!x,"bg-gray-600 text-black":"none"===c&&!x,"bg-blue-600":"primary"===c&&!x,"bg-red-600":"danger"===c&&!x,"bg-green-600":"success"===c&&!x,"bg-orange-600":"warning"===c&&!x,"hover:text-gray-700":"none"===c&&!x,"hover:text-white":"primary"===c&&!x,"hover:text-red-700":"danger"===c&&!x,"hover:text-green-700":"success"===c&&!x,"hover:text-orange-700":"warning"===c&&!x,"text-gray-600":"none"===c&&x,"text-blue-600":"primary"===c&&x,"text-red-600":"danger"===c&&x,"text-green-600":"success"===c&&x,"text-orange-400":"warning"===c&&x,[d]:d});return(0,n.jsx)("div",{children:(0,n.jsx)(g.default,{...u,href:t,className:h,children:o})})}var V=s(16463),J=s(94669);function Q(e){let{label:t,href:s,as:r,src:i,score:a}=e,c=(0,V.usePathname)(),o=(0,m.useMemo)(()=>c===s||c.startsWith(s)&&"/"!==s||r&&c.startsWith(r),[c,s,r]),d=l()({"flex justify-between items-center text-gray-500 py-3 gap-2 pl-4 pr-2 rounded-lg focus:outline-none hover:no-underline":!0,"bg-[#ebfaef] text-[#45cc46] hover:text-[#45cc46] font-semibold":o,"hover:bg-gray-50 hover:text-gray-500 hover:font-semibold text-gray-300":!o}),u=l()({"filter grayscale ":!o});return(0,n.jsx)("li",{className:"mb-1 group",children:(0,n.jsxs)(q,{href:s,className:d,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(f.default,{src:i,height:26,width:26,alt:"Icon",className:u}),(0,n.jsx)("span",{className:"text-lg ml-2",children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[!!a&&(0,n.jsx)(J.V,{intent:"success",className:"egide-tag",children:a}),!o&&(0,n.jsx)(p.I,{icon:"chevron-right",size:24,className:"ml-auto"})]})]})})}var H=s(81466),K=s(25205);function $(){let{activeOrders:e}=(0,H.i)(),[t,s]=(0,m.useState)(!1),{hasSubdomain:r,mode:l}=(0,D.p)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(U,{visible:t,onDismiss:()=>s(!1)}),(0,n.jsxs)("div",{className:"egide-menu egide-flex-lg flex-col justify-center w-[344px] bg-white min-h-screen p-4 sidebar-menu transition-transform",children:[(0,n.jsx)(q,{href:"/",className:"flex items-center justify-center pb-4 no-link",children:r?(0,n.jsx)(W,{hasAbout:!0,className:"w-full"}):(0,n.jsx)(f.default,{src:"/logo.png",height:100,width:280,alt:"Logo"})}),(0,n.jsxs)("ul",{className:"mt-4",children:[(0,n.jsx)(Q,{label:"In\xedcio",src:"/tabbar/ic_home.png",href:"/"}),r&&("both"===l||"consult"===l)&&(0,n.jsx)(Q,{label:"Consultas",src:"/tabbar/ic_appointment.png",href:"/consult"}),r&&("both"===l||"exam"===l)&&(0,n.jsx)(Q,{label:"Exames",src:"/tabbar/ic_exam.png",href:"/exam"}),!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{label:"Consultas",src:"/tabbar/ic_appointment.png",href:"/consult"}),(0,n.jsx)(Q,{label:"Exames",src:"/tabbar/ic_exam.png",href:"/exam"}),(0,n.jsx)(Q,{label:"Farm\xe1cias",src:"/tabbar/ic_drugstore.png",href:"/drugstore",as:"/order",score:e.length})]}),(0,n.jsx)(Q,{label:"Perfil",src:"/tabbar/ic_profile.png",href:"/profile"})]}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsx)("ul",{className:"flex flex-col",children:(0,n.jsx)(K.Z,{className:"text-lg py-2 px-4 rounded-md focus:outline-none hover:no-underline hover:bg-gray-50 hover:text-gray-500 hover:font-semibold text-gray-400"})}),(0,n.jsx)("div",{className:"flex-1"})]})]})}let G=(0,m.createContext)({}),Y=e=>{let{children:t}=e,s=(0,m.useRef)(),r=(0,m.useRef)();return(0,n.jsx)(G.Provider,{value:{openSearch:()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.call(s)},openAddresses:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.call(r)},defineMethod:(0,m.useCallback)((e,t)=>{switch(e){case"search":s.current=t;break;case"address":r.current=t}},[])},children:t})};function X(e){let{selected:t=!1,src:s,title:r,href:i,size:a=20,score:c}=e,o=l()({"text-xs":!0,"text-green-400":t});return(0,n.jsxs)(g.default,{href:i,className:"flex flex-1 flex-col gap-2 items-center justify-center no-link relative",children:[!!c&&(0,n.jsx)(J.V,{intent:"success",className:"egide-tag absolute top-0 right-3",children:c}),(0,n.jsx)(f.default,{src:s,height:a,width:a,alt:r,className:t?"":"grayscale"}),(0,n.jsx)("div",{className:o,children:r})]})}function ee(){let e=(0,V.usePathname)(),{activeOrders:t}=(0,H.i)(),{hasSubdomain:s,mode:r}=(0,D.p)(),l=(0,m.useCallback)((t,s)=>({href:t,selected:e===t||e.startsWith(t)&&"/"!==t||void 0!==s&&e.startsWith(s)}),[e]);return(0,n.jsxs)("div",{className:"egide-menu egide-bottombar",children:[(0,n.jsx)(X,{title:"In\xedcio",src:"/tabbar/ic_home.png",...l("/")}),(!s||"both"===r)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{title:"Consulta",src:"/tabbar/ic_appointment.png",...l("/consult")}),(0,n.jsx)(X,{title:"Exame",src:"/tabbar/ic_exam.png",...l("/exam")})]}),!s&&(0,n.jsx)(X,{title:"Farm\xe1cia",src:"/tabbar/ic_drugstore.png",...l("/drugstore","/order"),score:t.length}),(0,n.jsx)(X,{title:"Perfil",src:"/tabbar/ic_profile.png",size:16,...l("/profile")})]})}function et(e){let{children:t}=e,{hasSubdomain:s}=(0,D.p)(),r=l()({"min-h-screen main bg-white pb-16 lg:pb-0 w-full":!0,"lg:w-[calc(100%-344px)]":!0}),a=(0,m.useMemo)(()=>s?"robson-theme":"",[s]);return(0,n.jsx)(Y,{children:(0,n.jsxs)("div",{className:"flex ".concat(a),children:[(0,n.jsx)($,{}),(0,n.jsxs)("div",{className:r,children:[(0,n.jsx)(M,{}),(0,n.jsx)(i,{children:t}),(0,n.jsx)(ee,{})]})]})})}var es=s(79071);function en(e){let{children:t,whitelabel:s}=e;return(0,n.jsx)(D.s,{whitelabel:s,children:(0,n.jsx)(a.k,{hasSubdomain:s.hasSubdomain,children:(0,n.jsx)(H.A,{children:(0,n.jsx)(es.t,{children:(0,n.jsx)(et,{children:t})})})})})}},25205:function(e,t,s){"use strict";s.d(t,{Z:function(){return i}});var n=s(57437),r=s(2337),l=s(87138);function i(e){let{...t}=e,{hasSubdomain:s}=(0,r.p)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.default,{target:"_blank",href:"https://institucional.egidesaude.com.br/sobre-o-egide/",...t,children:"Sobre o \xc9gide"}),!s&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.default,{target:"_blank",href:"https://institucional.egidesaude.com.br/parceiro/",...t,children:"Credencie sua Farm\xe1cia"}),(0,n.jsx)(l.default,{target:"_blank",href:"https://institucional.egidesaude.com.br/clinicas-medicos/",...t,children:"Credencie seu Consult\xf3rio"})]}),(0,n.jsx)(l.default,{target:"_blank",href:"https://institucional.egidesaude.com.br/faq/",...t,children:"Ajuda"}),!s&&(0,n.jsx)(l.default,{target:"_blank",href:"https://institucional.egidesaude.com.br/contato/",...t,children:"Contato"})]})}},94526:function(e,t,s){"use strict";s.d(t,{Z:function(){return u}});var n=s(57437),r=s(63872),l=s(70254),i=s(7732),a=s(80734),c=s(43172),o=s(56800),d=s.n(o);function u(e){let{address:t,setAddressToEdit:s,setModalAddressOpened:o,onClickAddressToDefault:u,onClickAddressToDelete:x,className:h,...m}=e,g={"flex items-center gap-4 border rounded-md py-2 px-4":!0,[String(h)]:!!h},f=d()(g);return(0,n.jsxs)("div",{...m,className:f,children:[(0,n.jsx)(r.m6B,{size:20}),(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsxs)("p",{children:[t.address,", ",t.addressNumber]}),(0,n.jsxs)("p",{children:[t.neighborhood," - ",t.city," - ",t.state]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[t.current&&(0,n.jsx)(r.ETl,{className:"text-green-600"}),x&&(0,n.jsx)(l.J,{content:(0,n.jsxs)(i.v,{children:[(0,n.jsx)(a.s,{text:"Editar",icon:"edit",onClick:()=>{s&&o&&(s(t),o(!0))}}),(0,n.jsx)(c.R,{}),(0,n.jsx)(a.s,{text:"Definir como principal",icon:"add-location",intent:"success",onClick:()=>{var e;return u&&u(null!==(e=t.id)&&void 0!==e?e:0)}}),(0,n.jsx)(c.R,{}),(0,n.jsx)(a.s,{text:"Excluir",icon:"trash",intent:"danger",onClick:()=>{var e;return x(null!==(e=t.id)&&void 0!==e?e:0)}})]}),position:"bottom",className:"p-4 cursor-pointer",children:(0,n.jsx)(r.Blh,{})})]})]})}},70673:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});var n=s(57437);function r(e){let{children:t}=e;return(0,n.jsx)("div",{className:"flex flex-col gap-4",children:t})}},79071:function(e,t,s){"use strict";s.d(t,{t:function(){return d},D:function(){return u}});var n=s(57437),r=s(2265);let l={mode:"newAppointment",installments:1},i=(e,t)=>{var s,n;switch(t.type){case"UPDATE":return{...e,...null!==(s=t.payload)&&void 0!==s?s:{}};case"CLEAR":return{...l,...null!==(n=t.payload)&&void 0!==n?n:{}};default:return e}};var a=s(16463),c=s(1261);let o=(0,r.createContext)({}),d=e=>{let{children:t}=e,{push:s}=(0,a.useRouter)(),d=(0,a.usePathname)(),[u,x]=(0,r.useReducer)(i,l),h=d.startsWith("/exam"),m=d.startsWith("/exam")||d.startsWith("/consult"),g=(0,r.useCallback)(e=>{let t="/".concat(h?"exam":"consult");return e?"".concat(t).concat(e.startsWith("/")?"":"/").concat(e):t},[h]),f=(0,r.useMemo)(()=>(0,c.Ti)(u,[h?"specialty":"exam"]),[u,h]);return(0,n.jsx)(o.Provider,{value:{...f,schedule:f,push:s,path:h?"/exam":"/consult",isExamScreen:h,getAppointmentPath:g,gotoPath:(0,r.useCallback)(e=>s(g(e)),[g,s]),updateSchedule:(0,r.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x({type:t?"CLEAR":"UPDATE",payload:e})},[]),clearSchedule:(0,r.useCallback)(()=>x({type:"CLEAR"}),[])},children:m?(0,n.jsx)("div",{className:h?"appointment-exam":"appointment-consult",children:t}):t})},u=()=>(0,r.useContext)(o)},2337:function(e,t,s){"use strict";s.d(t,{p:function(){return a},s:function(){return i}});var n=s(57437),r=s(2265);let l=(0,r.createContext)({}),i=e=>{let{children:t,whitelabel:s}=e;return(0,n.jsx)(l.Provider,{value:null!=s?s:{hasSubdomain:!1,mode:"none"},children:t})},a=()=>(0,r.useContext)(l)},9723:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});var n=s(2265);function r(e){let{value:t,delay:s,callback:r}=e;(0,n.useEffect)(()=>{if(!s||!t){r&&r(t);return}let e=setTimeout(()=>{r&&r(t)},s);return()=>{e&&clearTimeout(e)}},[t,s,r])}},5618:function(e,t,s){"use strict";s.d(t,{Z:function(){return k}});var n=s(57437),r=s(2265),l=s(1951),i=s(29039),a=s(1261),c=s(24630);function o(e){let{address:t,onUserAddress:s}=e;return(null==t?void 0:t.address)?(0,n.jsxs)("button",{onClick:()=>s&&s(t),className:"address-item address-item-compass no-link text-left mt-4",children:[(0,n.jsx)(c.j33,{size:30,className:"text-green-700"}),(0,n.jsxs)("div",{className:"address-container",children:[(0,n.jsx)("div",{className:"text-xs text-gray-500",children:"Sua localiza\xe7\xe3o"}),(0,n.jsx)("div",{className:"font-semibold ",children:(0,a.Hx)([t.address,t.addressNumber,t.neighborhood])})]}),(0,n.jsx)("div",{className:"text-xs text-green-700",children:"(utilizar)"})]}):null}var d=s(81461),u=s(10792),x=s(91136),h=s(18993),m=s(9723),g=s(38472),f=s(31138);g.Z.create({baseURL:"https://maps.googleapis.com/maps/api"});let j=async(e,t)=>f.B.post("/api/google/prediction",{address:e,...t}),b=async e=>f.B.get("/api/google/details",{params:{place_id:e.place_id}});var v=s(56800),p=s.n(v);function N(e){let{loading:t,showTopDivisor:s=!0,prediction:r,onClick:l}=e,i=p()({"address-item address-item-search no-link":!0,"address-divisor":s});return(0,n.jsxs)("button",{type:"button",className:i,onClick:l,children:[t?(0,n.jsx)(h.$,{size:16}):(0,n.jsx)(u.I,{icon:"map-marker"}),r.description]},r.place_id)}var y=s(99839),C=s(6742);function k(e){let{onGetFullAddress:t}=e,[s,a]=(0,r.useState)(""),[c,g]=(0,r.useState)(""),[f]=(0,r.useState)(),{toast:v}=(0,y.p)(),{data:p}=(0,i.ZP)("coordinateAddressList",C.O,{revalidateOnFocus:!1}),{data:k}=(0,i.ZP)(p?["current-address",p]:null,()=>(0,l.f)(p),{revalidateOnFocus:!1}),{data:w=[],isValidating:_}=(0,i.ZP)(c.length?["search-address",c]:null,()=>j(c,p),{revalidateOnFocus:!1}),P=(0,r.useCallback)(async e=>{try{let s=await b(e);t(s)}catch(e){v(e.message||e.error||e,"danger")}},[t,v]);return(0,m.Z)({value:s,delay:500,callback:e=>g(e.trim())}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.B,{value:s,placeholder:"Digite seu endere\xe7o",className:"input-address",leftElement:(0,n.jsx)(u.I,{icon:"map-marker",size:18,color:"#999"}),rightElement:s.trim()?(0,n.jsx)(x.z,{minimal:!0,icon:"cross",style:{marginTop:8},onClick:()=>{a("")}}):(0,n.jsx)(n.Fragment,{}),onChange:e=>a(e.target.value)}),_&&!w.length&&(0,n.jsx)(h.$,{size:18}),!_&&!w.length&&p&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o,{onUserAddress:()=>{var e,s;return t({address:null==k?void 0:k.address,addressNumber:null==k?void 0:k.addressNumber,neighborhood:(null==k?void 0:k.neighborhood)&&"string"==typeof k.neighborhood?k.neighborhood:"",neighborhoodCity:"".concat((null==k?void 0:k.neighborhood)&&"string"==typeof k.neighborhood&&(null==k?void 0:k.city)?"".concat(k.neighborhood," - ").concat(k.city):""),zipcode:null==k?void 0:k.zipcode,city:null==k?void 0:k.city,state:null==k?void 0:k.state,country:null==k?void 0:k.country,coordinate:{latitude:null!==(e=null==k?void 0:k.latitude)&&void 0!==e?e:0,longitude:null!==(s=null==k?void 0:k.longitude)&&void 0!==s?s:0}})},address:{...k,neighborhood:(null==k?void 0:k.neighborhood)&&"string"==typeof k.neighborhood?k.neighborhood:""}})}),(0,n.jsx)("div",{className:"address-container",children:w.map((e,t)=>(0,n.jsx)(N,{showTopDivisor:!!t,loading:f===e.place_id,prediction:e,onClick:()=>P(e)},e.place_id))})]})}},79370:function(e,t,s){"use strict";s.d(t,{Kz:function(){return l},Vx:function(){return a},ZL:function(){return c},h:function(){return i},ob:function(){return o}});var n=s(54438);let r="address",l=()=>n.h.get(r),i=e=>n.h.post(r,e),a=(e,t)=>n.h.put("".concat(r,"/").concat(e),t),c=e=>n.h.put("".concat(r,"/").concat(e,"/default")),o=e=>n.h.delete("".concat(r,"/").concat(e))},15204:function(){}},function(e){e.O(0,[4579,3458,5706,7240,5452,4358,8691,2376,5719,6648,4011,5522,9039,8472,2929,8573,7380,4245,6575,8348,995,1466,2156,2971,7023,1744],function(){return e(e.s=99272)}),_N_E=e.O()}]);