1import{h as s}from"./momenttz-2e60a0d5.js";import{n as d,ah as m,m as a,ai as g,e as l,aj as f,f as _}from"./index-affce793.js";import"./vue-036c6a95.js";import"./misc-091d00d4.js";import"./aws-b1e32208.js";const v={data:()=>({loading:!1,error:!1}),mounted(){this.checkToken()},computed:{publicPatientDetails(){return this.$store.state.patient.patient},maintenanceMode(){return!!this.$store.state.settings.maintenanceMessage}},methods:{openPatientPortal(){this.publicPatientDetails?this.$router.push("/patientPortal/account"):this.$router.push("/patientPortal/login")},async checkToken(){this.loading=!0;const r=window.location.search,i=new URLSearchParams(r).get("token"),{tenant:p}=await m();if(p==="ROTH"){a("public_patient_access_token"),a("public_patient_expires_at"),this.$router.push("/patientPortal/login");return}i?g({token:i}).then(t=>{if(t.patient){a("public_patient_access_token"),a("public_patient_expires_at"),l("public_patient_access_token",t.accessToken);const u=s(t.expires).unix();if(l("public_patient_expires_at",u),this.$store.commit("patient/setPatient",t.patient),t.patient.regionId&&(this.$store.commit("setSelectedRegion",{region:t.patient.region,regionId:t.patient.regionId}),window.localStorage.setItem("mdfitRegion",t.patient.regionId)),t.appointmentType&&t.visitType&&this.$store.commit("survey/setCodes",{activity:t.appointmentType,visit:t.visitType}),t.path){if(t.path.startsWith("/reservation")){console.log("getting booking info"),f(t.bookingId).then(n=>{n.status==="pending"?_(t.providerId).then(o=>{this.$store.commit("patient/setRescheduleAppt",t.rescheduleAppointment),this.$store.commit("setAppointment",{provider:o,appointment:{time:s(t.bookingTime).format("h:mm A"),date:s(t.bookingTime).format("LL"),bookingId:t.bookingId,status:n.status,expires:t.expires,locationId:t.location.locationId,appointmentReason:t.rescheduleAppointment.appointmentReason,activityCode:t.rescheduleAppointment.appointmentType,visitCode:t.rescheduleAppointment.visitType}}),this.$router.push(`/reservation/${t.bookingId}`)}):this.$router.push("/patientPortal/account")});return}this.$router.push(t.path);const c=t.path.split("?").pop();if(c){const n=new URLSearchParams(c);if(!Number.isNaN(+n.get("regionId"))){const o=this.$store.state.settings.regions.find(h=>h.regionId===+n.get("regionId"));o&&this.$store.commit("setSelectedRegion",o)}}}else this.$router.push("/patientPortal/account")}else this.loading=!1,this.error=!0}).catch(t=>{console.log(t),this.loading=!1,this.error=!0}):(this.loading=!1,this.error=!0)}}};var k=function(){var e=this,i=e._self._c;return i("v-container",{attrs:{fluid:"","fill-height":""}},[i("v-layout",{attrs:{"align-center":"","justify-center":""}},[e.loading?i("div",[i("v-progress-circular",{staticStyle:{margin:"auto",padding:"20px"},attrs:{color:"primary",indeterminate:""}})],1):e._e(),e.error?i("div",[i("div",{staticClass:"font-weight-thin text-h4"},[e._v(" Sorry, the link has expired. Please sign in. ")]),e.maintenanceMode?e._e():i("v-btn",{staticClass:"ml-2 black--text",attrs:{color:"secondary",disabled:e.maintenanceMode},on:{click:function(p){return e.openPatientPortal()}}},[e._v(" My Account ")])],1):e._e()])],1)},y=[],b=d(v,k,y,!1,null,null,null,null);const R=b.exports;export{R 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.