PageSourceSearch

https://md.getheally.com/f/patient_admin/assets/index-C3kb8JZS.js

js getheally.com collected 2026-10-03 20:28:57 UTC 9,398 bytes, 1 lines download raw bytes

1import{r as f,j as p}from"./vendor-mui-dzClTZha.js";import{m as M}from"./vendor-moment-Crddo2RD.js";import{h as le,A as ce,e as ue,aC as L,b as ee,u as _e,l as me,m as he,s as te,i as se,aY as fe,aZ as ye,a_ as ge,R as ve}from"./index-oWmLXTUp.js";import{i as De}from"./isAsyncVisitType-DWFrj6FI.js";import{u as Te,F as Se,M as Ae,H as xe,S as be,W as Pe,V as je,D as ie,L as ke,A as Ee,P as ne}from"./styles-oski3rpz.js";import"./Select-DOTjTRWY.js";import"./index-CBfjFgo6.js";import"./array-BlcVibqV.js";import"./index-Dozf_Y2e.js";import"./styles-BWUkM3nO.js";import"./vendor-sentry-CQ7mWrpb.js";import"./index.esm-B6HvUY4S.js";import"./IconMD-C-K4Nl_P.js";import"./InputMU-BOdE86xN.js";import"./index-MQAdPw9U.js";import"./warning-C20GYw-A.js";import"./PreloaderMD-Ctoh95Ti.js";import"./RingLoader-BYN2PxRR.js";const Ve=({doctor:t,partnerCustomErrorMessages:y,visitTypeIdFromQueryString:o,handleSelectVisitType:r})=>{const{fetchVisitTypes:_,fetchVisitType:i,visitTypes:x}=ye();f.useEffect(()=>{o?D(o):n()},[]);const v=()=>{const d=t?{doctor_user_id:t==null?void 0:t.id}:{};return{include:["locations","categories"],only_available:!0,...d}},n=()=>{const d=v();_(d)},D=d=>{const m=v();i(d,m)};return p.jsx(p.Fragment,{children:p.jsx(je,{...x,partnerCustomErrorMessages:y,handleSelectVisitType:r})})},Fe=({handleSelectDoctor:t})=>{const{fetchDoctors:y,doctors:o}=ge();f.useEffect(()=>{r()},[]);const r=()=>{y({only_available:!0})};return p.jsx(p.Fragment,{children:p.jsx(ie,{...o,handleSelectDoctor:t})})},Ce=({data:t,handleSelectLocation:y,manualPatientAddressQuestion:o})=>{var _;
1const r=(t==null?void 0:t.length)===1&&((_=t[0])==null?void 0:_.appointment_type)!=="mobile";return f.useEffect(()=>{r&&y(t[0],!0)},[]),p.jsx(p.Fragment,{children:r?null:p.jsx(ke,{data:t,handleSelectLocation:y,manualPatientAddressQuestion:o})})},we=({scheduleVisitIdFromQueryParam:t,scheduleVisitTypeId:y,location:o,doctor:r,timezone:_,currentSlot:i,isResetAvailableDoctors:x=!0,handleSelectSlot:v})=>{const{setDefaultFreeDaysState:n,setDefaultAvailableDoctors:D,fetchFreeDays:d,freeDays:m}=L();f.useEffect(()=>{const h=i!=null&&i.time?M.tz(i==null?void 0:i.time,_):null,T=h?h.startOf("month").utc().format():null,A=h?h.endOf("month").utc().format():null;return E(T,A,i==null?void 0:i.time),x&&D(),()=>n()},[]);const P=()=>{var l;const h=ne.includes((l=o==null?void 0:o.appointment_type)==null?void 0:l.toLowerCase())?{partner_address_id:o==null?void 0:o.id}:{},T=t?{schedule_visit_id:t}:{},A=r?{doctor_user_id:r==null?void 0:r.id}:{};return{schedule_visit_type_id:y,appointment_type:o==null?void 0:o.appointment_type,...T,...A,...h}},E=(h,T,A)=>{const l=h?{start_date:h}:{},V=T?{end_date:T}:{},b={...P(),...l,...V};d(b,A,_)},F=h=>{const T=M.tz(h,"MM-DD-YYYY",_).startOf("day").utc().format(),A=M.tz(h,"MM-DD-YYYY",_).endOf("month").utc().format();E(T,A)};return p.jsx(p.Fragment,{children:p.jsx(Ee,{isLoading:m.status==="running",data:m.groupedByDays,initialDate:m.preSelectDate,timezone:_,currentSlot:i,handleMonthChange:F,handleSelectSlot:v})})},Ie=({slot:t,scheduleVisitTypeId:y,location:o,scheduleVisitIdFromQueryParam:r,handleSelectDoctor:_})=>{var n;const{doctors:i,fetchAvailableDoctors:x}=L();f.useEffect(()=>{v()},[]),f.useEffect(()=>{var D;((D=i.data)==null?void 0:D.length)===1&&_(i.data[0],!0)},[i.data]);const v=()=>{var P;const D=ne.includes((P=o==null?void 0:o.appointment_type)==null?void 0:P.toLowerCase())?{partner_address_id:o==null?void 0:o.id}:{},d=r?{schedule_visit_id:r}:{},m={schedule_visit_type_id:y,appointment_type:o==null?void 0:o.appointment_type,start_date:t==null?void 0:t.time,doctor_user_ids:t==null?void 0:t.doctor_user_ids,...d,...D};x(m)};return(i==null?void 0:i.status)==="idle"||(i==null?void 0:i.status)==="running"?p.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(ve,{color:"var(--primaryColor)"})}):p.jsx(p.Fragment,{children:((n=i==null?void 0:i.data)==null?void 0:n.length)>1?p.jsx(ie,{data:i==null?void 0:i.data,handleSelectDoctor:_}):null})},qe=()=>{var H,$,Q,Z,J,K,X,U,q;const{profile:t,updateProfile:y}=le(),o=["in_office","mobile"],r=t.data.partner_user,_=t.data.patient_personal,i=((H=r==null?void 0:r.partner_branding)==null?void 0:H.basic_subdomain)||(($=r==null?void 0:r.partner_branding)==null?void 0:$.subdomain),x=f.useRef([]),v=f.useRef({}),[n,D]=f.useState({doctor:null,visitType:null,location:null,slot:null}),[d,m]=f.useState({warning:null,status:"idle",data:null}),[P,E]=f.useState({}),{createScheduleVisit:F,updateScheduleVisit:h}=ce(),{fetchFormsVisitTypes:T}=ue(),{doctors:A}=L(),{flow:l,setFlow:V,handleClickBack:Y,handleSetData:b}=Te({state:n,setState:D,doctors:A}),C=ee(),{query:c,push:O}=_e(),{gtagData:j,sendToGTM:B}=me(),{redditPixel:R,connectImagePixel:ae}=he();f.useEffect(()=>{const e=c!=null&&c.by_provider?Se:Ae,s={patient_id:t.data.id,patient_uuid:t.data.uuid};V(u=>({...u,steps:e,step:e[0]})),oe(),j!=null&&j.isEnabledTracking&&B("schedule_viewed",s),te(i,s,"scheduledViewed")},[]),f.useEffect(()=>{l.step===void 0&&w()},[l]),f.useEffect(()=>{d.status==="ready"&&l.step!=="summary"&&N(d==null?void 0:d.data)},[d]);const oe=async()=>x.current=await T(),W=e=>{var a;const{status:s,response:u}=e,g=s===449?{warning:(a=u==null?void 0:u.errors)==null?void 0:a[0],status:"warning",data:null}:{warning:null,status:"error",data:null};m(g),s===422&&(C("So sorry, looks like that appointment time is already taken, please choose a different time"),V(S=>({...S,step:"availabilitySlots"}))),s>=500&&C("Something went wront. Please use the chat in bottom left.")},N=e=>{var a,S,k;const s=`/f/patient_admin/schedule/payment?visit_type=${e==null?void 0:e.sc
1hedule_visit_type_id}&appt_type=${e==null?void 0:e.appointment_type}`,u=(a=x.current)==null?void 0:a.find(I=>(I==null?void 0:I.id)===(e==null?void 0:e.schedule_visit_type_id)),g={patient_id:t.data.id,patient_uuid:t.data.uuid,visit_type_id:(S=t.data.patient_personal)==null?void 0:S.default_visit_type_id};j!=null&&j.isEnabledTracking&&B("book_appointment",g),te(i,g,"bookedAppt"),ae((k=t.data.partner_user)==null?void 0:k.id,"book_appointment",g),R&&R.rdt("track","Custom",{customEventName:"scheduling",currency:"USD",itemCount:"1",transactionId:t.data.id}),y({patient_personal:{..._,default_visit_type:u,default_visit_type_id:e==null?void 0:e.schedule_visit_type_id}}),O(s)},de=()=>{var k;const{visitType:e,location:s,slot:u,doctor:g}=n,a=o.includes((k=s==null?void 0:s.appointment_type)==null?void 0:k.toLowerCase())?{partner_address_id:s==null?void 0:s.id}:{},S=s!=null&&s.patient_address?{patient_address:s==null?void 0:s.patient_address}:{};return{start_date:u==null?void 0:u.time,schedule_visit_type_id:e==null?void 0:e.id,doctor_user_id:g==null?void 0:g.id,appointment_type:De(e)?"async":s==null?void 0:s.appointment_type,...a,...S}},G=e=>e==null?void 0:e.forEach(s=>C(s==null?void 0:s.message,1e4));function w(e=!1,s={}){const u=de();v.current=e?{[e]:!0,...v.current}:{};const g={...u,...v.current,...s};m(a=>({...a,status:"running"})),c!=null&&c.apptID?h(c==null?void 0:c.apptID,g).then(a=>{se(a==null?void 0:a.warnings)||G(a==null?void 0:a.warnings),m(S=>({...S,status:"ready",data:a}))}).catch(a=>W(a)):F(g).then(a=>{se(a==null?void 0:a.warnings)||G(a==null?void 0:a.warnings),m(S=>({...S,status:"ready",data:a}))}).catch(a=>W(a))}const z=ee(),{fetchConfirmationMessage:pe}=fe(),re=(e,s)=>{e==="getConfirmationMessage"&&pe(s).then(u=>{z(u==null?void 0:u.confirmation_message),O("/f/patient_admin/home")}).catch(()=>z("Unexpected error"))};return p.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[p.jsx(xe,{onClickBack:()=>Y(),mounted:((Q=l.steps)==null?void 0:Q.indexOf(l.step))>0,wide:l.step==="visitTypes"||l.step==="availabilitySlots"}),l.step==="doctors"?p.jsx(Fe,{handleSelectDoctor:e=>b({doctor:e},l.step)}):null,l.step==="visitTypes"?p.jsx(Ve,{doctor:n.doctor,visitTypeIdFromQueryString:c==null?void 0:c.visit_type_id,partnerCustomErrorMessages:(Z=r==null?void 0:r.partner_config)==null?void 0:Z.error_messages,handleSelectVisitType:e=>b({visitType:e},l.step)}):null,l.step==="locations"?p.jsx(Ce,{data:(J=n.visitType)==null?void 0:J.locations,handleSelectLocation:(e,s)=>b({location:e},l.step,s),manualPatientAddressQuestion:(X=(K=t.data.partner_user)==null?void 0:K.partner_config)==null?void 0:X.patient_address_question}):null,l.step==="availabilitySlots"?p.jsx(we,{scheduleVisitIdFromQueryParam:c==null?void 0:c.apptID,scheduleVisitTypeId:(U=n==null?void 0:n.visitType)==null?void 0:U.id,location:n==null?void 0:n.location,doctor:n==null?void 0:n.doctor,timezone:t.data.timezone,currentSlot:n.slot,handleSelectSlot:e=>b({slot:e},l.step)}):null,l.step==="doctorsForAppt"?p.jsx(Ie,{slot:n.slot,location:n==null?void 0:n.location,scheduleVisitTypeId:(q=n==null?void 0:n.visitType)==null?void 0:q.id,scheduleVisitIdFromQueryParam:c==null?void 0:c.apptID,handleSelectDoctor:(e,s)=>b({doctor:e},l.step,s)}):null,l.step==="summary"?p.jsx(be,{status:d.status,data:n,timezone:t.data.timezone,handleContinue:w,handleCloseSummary:()=>N(d==null?void 0:d.data)}):null,(d==null?void 0:d.status)==="warning"?p.jsx(Pe,{data:d==null?void 0:d.warning,handleAdditionalAction:re,handlePositiveAction:w,handleNegativeAction:()=>m({warning:null,status:"idle"}),onClose:()=>m({warning:null,status:"idle"}),forceActions:P,setForceActions:E}):null]})};export{qe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.