"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[206],{533:(e,t,a)=>{a.d(t,{f:()=>l,n:()=>s});var i=a(37876),r=a(37477),n=a(40917),o=a(80072);a(14232);let s=new Map([[o.C.PreEligibility,{label:"Age & BMI",icon:r.IconScaleOutline}],[o.C.ContactDetails,{label:"Personal Details",icon:r.IconId}],[o.C.InsuranceDetails,{label:"Insurance Info",icon:r.IconClipboardPlus}]]),l=e=>{var t;let{currentStep:a,steps:r=s}=e,o=null==(t=r.get(a))?void 0:t.label,l=Array.from(r.values());return(0,i.jsx)(n.s,{currentStep:o,steps:l})}},17206:(e,t,a)=>{a.d(t,{D:()=>R});var i=a(37876),r=a(37477),n=a(16741),o=a(34305),s=a(1144),l=a(66885),c=a(62227),d=a(14232),u=a(46884),m=a(76803),g=a(53100),p=a(92261),h=a(96079),b=a(32246),C=a(53310),x=a(47811),f=a(56931),D=a(74161),y=a(45383),I=a(20058),v=a(92749);let E=e=>(0,i.jsx)(r.Flex,{direction:"column",gap:"spacer-2",alignItems:"center",cursor:"pointer",role:"group",tabIndex:0,outline:"none",as:"button",onKeyDown:t=>{"Enter"===t.key&&e.onClick()},...e});E.Image=e=>(0,i.jsx)(r.Image,{flex:1,objectFit:"contain",...e}),E.Description=e=>(0,i.jsx)(r.Text,{variant:"text-body-floating-label-regular",color:"text-secondary",textAlign:"center",...e}),E.Title=e=>(0,i.jsx)(r.Text,{color:"text-secondary",variant:"text-body-meta-medium",transition:"color 100ms linear",_groupHover:{color:"text-link-primary-hover"},_groupActive:{color:"text-link-primary-pressed"},_groupFocusVisible:{color:"text-link-primary-default"},...e}),E.Frame=e=>(0,i.jsx)(r.Flex,{px:"spacer-3",pb:"spacer-5",borderRadius:"radii-1",borderWidth:"1px",borderStyle:"solid",borderColor:"ui-element-outline-active",transition:"background-color 100ms linear, border-color 100ms linear",_groupFocusVisible:{outlineWidth:"3px",outlineStyle:"solid",outlineColor:"primary-focus"},_groupHover:{borderColor:"primary-hover",backgroundColor:"background-action-hover"},_groupActive:{borderColor:"primary-pressed",backgroundColor:"background-action-pressed"},direction:"column",alignItems:"center",minHeight:"160px",width:"100%",...e});let S=e=>{let{onSelectWorkflow:t}=e,{track:a}=(0,D.useAnalytics)(),s=e=>()=>(a("".concat(e,"_selected"),{partner:e}),t(e)),l=Object.entries(v.s);return(0,i.jsxs)(y.s,{direction:"column",gap:"spacer-9",children:[(0,i.jsx)(r.Flex,{direction:"column",gap:"spacer-2",children:(0,i.jsxs)(r.Text,{variant:"text-header-XL",color:"text-secondary-negative",children:["Welcome!"," ",(0,i.jsxs)(r.Text,{as:"span",variant:"text-header-XL",color:"text-primary",children:["To get started, please select your benefit program."," "]})]})}),(0,i.jsxs)(r.Flex,{direction:"column",gap:{base:"spacer-9"},children:[(0,i.jsx)(r.Flex,{direction:"column",gap:"spacer-4",flex:1}),(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-4",pb:{base:"spacer-9",md:"spacer-6"},flex:1,children:[(0,i.jsx)(r.Flex,{direction:{base:"column",md:"row"},gap:{base:"spacer-6",md:"spacer-3"},justifyContent:{md:"space-between"},alignItems:{md:"end"},children:(0,i.jsxs)(r.Flex,{gap:"spacer-3",alignItems:"center",flex:1,children:[(0,i.jsx)(r.IconArrowRight,{color:"primary-default",size:"l"}),(0,i.jsx)(r.Text,{variant:"text-body-large-medium",color:"text-primary",children:"Available Programs:"})]})}),(0,i.jsxs)(r.Grid,{spacingX:"spacer-4",spacingY:{base:"spacer-4",lg:"spacer-6"},columns:{base:2,md:3,lg:4,xxl:5},children:[l.map(e=>{let[t,{asset:a,description:r,name:n}]=e;return(0,i.jsxs)(E,{onClick:s(t),children:[(0,i.jsxs)(E.Frame,{children:[(0,i.jsx)(E.Image,{...a}),(0,i.jsx)(E.Description,{children:r})]}),(0,i.jsx)(E.Title,{children:n})]},t)}),(0,i.jsxs)(E,{"aria-label":"Provider Referral",onClick:s(o.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(E.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(E.Image,{src:n.k[o.fz.KaiserPermanente],width:"123px",height:"40px",alt:"Kaiser Permanente Logo"})}),(0,i.jsx)(E.Title,{children:"Provider Referral"})]}),(0,i.jsxs)(E,{onClick:s(o.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(E.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(E.Image,{src:n.k[o.fz.Sone],width:"123px",height:"40px",alt:"Sone Logo"})}),(0,i.jsx)(E.Title,{children:"Provider Referral"})]})]})]})]}),(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-1",children:[(0,i.jsx)(r.Text,{color:"text-secondary",variant:"text-body-bold",children:"Need some help?"}),(0,i.jsxs)(r.Text,{color:"text-secondary",variant:"text-body-regular",children:["Please call"," ",(0,i.jsx)(I.C,{})," ","to speak with a Care Coordinator."]})]})]})};var w=a(33841),L=a(65159);let P={WorkflowSelector:"workflowSelector",...w.fz},A=(0,L.mj)({types:{},guards:{isCareCompassSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.CareCompass},isAetnaSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.Aetna},isRiverspringSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.RiverSpringLiving},isPequotSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.PequotHealthCare},isPyleSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.PyleFamilyInsurance},isMDSaveSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.MDSave},isChristianaCareSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.ChristianaCare},is1199SEIUSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz["1199SEIU"]}}}).createMachine({id:"workflowManagerMachine",initial:P.WorkflowSelector,states:{[P.WorkflowSelector]:{id:P.WorkflowSelector,on:{SUBMIT:[{guard:"isCareCompassSelected",target:P.CareCompass},{guard:"isAetnaSelected",target:P.Aetna},{guard:"isRiverspringSelected",target:P.RiverSpringLiving},{guard:"isPequotSelected",target:P.PequotHealthCare},{guard:"isPyleSelected",target:P.PyleFamilyInsurance},{guard:"isMDSaveSelected",target:P.MDSave},{guard:"isChristianaCareSelected",target:P.ChristianaCare},{guard:"is1199SEIUSelected",target:P["1199SEIU"]},{target:P.Flyte}]}},[P.PequotHealthCare]:{},[P.RiverSpringLiving]:{},[P.CareCompass]:{},[P.Aetna]:{},[P.Flyte]:{},[P.PyleFamilyInsurance]:{},[P.MDSave]:{},[P.ChristianaCare]:{},[P["1199SEIU"]]:{}}}),R=e=>{let{render:t}=e,[a,D]=(0,c.zl)(A),y=(0,d.useMemo)(()=>(0,l.r)(a.value),[a.value]),I=(0,d.useCallback)(e=>{D({type:"SUBMIT",data:{workflow:e}})},[D]);return(0,d.useCallback)(()=>{switch(y){case P.WorkflowSelector:return t({header:(0,i.jsx)(n.E,{partner:o.fz.Flyte}),body:(0,i.jsx)(S,{onSelectWorkflow:I}),currentWorkFlowStep:y});case P.Aetna:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.aetna,children:(0,i.jsx)(u.j,{render:t})});case P.CareCompass:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.careCompass,children:(0,i.jsx)(m.Z,{render:t})});case P.RiverSpringLiving:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.riverspring,children:(0,i.jsx)(x.D,{render:t})});case P.PequotHealthCare:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.pequot,children:(0,i.jsx)(b.K,{render:t})});case P.PyleFamilyInsurance:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.pyle,children:(0,i.jsx)(C.A,{render:t})});case P.MDSave:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(h.Y,{render:t})});case P.ChristianaCare:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(g.z,{render:t})});case P["1199SEIU"]:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(f.A,{render:t})});case P.Flyte:default:return(0,i.jsx)(p.q,{render:t})}},[y])()}},32246:(e,t,a)=>{a.d(t,{K:()=>eu});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(47320),E=a(93511),S=a(34305),w=a(80072),L=a(66885),P=a(3712),A=a(62227),R=a(14232),T=a(11969),M=a(10758),U=a(85007),j=a(20411),k=a(31346),B=a(38360),F=a(39648),O=a(77944),N=a(47353),_=a(83928),V=a(33841),H=a(13751),X=a(92323),z=a(86687),W=a(89225),q=a(97793),Y=a(53795),K=a(38088),G=a(65159),Q=a(39777),J=a(45352),$=a(63826),Z=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.CheckEligibility="checkEligibility",e.CheckBenefits="checkBenefits",e}(Z||{});let ee={...q.f,...Z},et=W.Ek[V.fz.PequotHealthCare],ea={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},eligibilityCheckMatchType:void 0,bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},ei={...H.AU,...H.gQ,...H.pE,...H.UH,...H.yF,...H.n6,...H.uN,...H.yS,...H.RW,...H.i_,...(0,H.rS)(ea).reset},er=(0,G.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return Y.J0.pequotHealthCare({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!_.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&[V.wY.EXPIRED,V.wY.INSURANCE_MATCH,V.wY.PERSON_MATCH,V.wY.NOT_FOUND].includes(t)},isApplicationDetected:z.L,isAthenaRecordCreated:X.z},actions:ei}).createMachine({context:()=>ea,id:"pequotMachine",initial:ee.PreEligibility,states:{[ee.PreEligibility]:{id:ee.PreEligibility,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(ee.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(ee.EligibilityUnmet)}]}}},[ee.ContactDetails]:{id:ee.ContactDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:"#".concat(ee.InsuranceDetails),actions:"updateFormData"}}}}},[ee.InsuranceDetails]:{id:ee.InsuranceDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{BACK:{target:"#".concat(ee.ContactDetails)},SUBMIT:{target:"#".concat(ee.InsuranceDetailsReview),actions:"updateFormData"}}}}},[ee.InsuranceDetailsReview]:{id:ee.InsuranceDetailsReview,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:ee.Submitting}}},[ee.Submitting]:{id:ee.Submitting,initial:ee.CheckEligibility,states:{[ee.CheckEligibility]:{id:ee.CheckEligibility,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,insurance:W.w[V.fz.PequotHealthCare],benefitProgram:W.Nl[V.fz.PequotHealthCare]};return await (0,F.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,J.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:"#".concat(ee.CheckBenefits)}],onError:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}},[ee.CheckBenefits]:{id:ee.CheckBenefits,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:W.dT[V.lk["Pequot HealthCare"]]};return await (0,j.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,J.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(ee.DetermineContactOrLead)}],onError:"#".concat(ee.DetermineContactOrLead)}},[ee.DetermineContactOrLead]:{id:ee.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:ee.CreateLead},{target:ee.CreateContact}]},[ee.CreateContact]:{id:ee.CreateContact,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:V.h9.Evolve,company:et,insurance:W.Ft[V.fz.PequotHealthCare],evolveOrganization:V.PM["Pequot Tribal Family Health Plan"],accountId:W.f3[V.fz.PequotHealthCare]};return await (0,B.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(ee.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}]}},[ee.CreateLead]:{id:ee.CreateLead,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:V.h9.Evolve,company:et,insurance:W.Ft[V.fz.PequotHealthCare],evolveOrganization:V.PM["Pequot Tribal Family Health Plan"],leadStatus:(e=>{switch(e){case $.w.PERSON_MATCH:case $.w.INSURANCE_MATCH:case $.w.EXPIRED:case $.w.NOT_FOUND:return S.XN.EligibleWaiting;case $.w.FULL_MATCH:case $.w.ELIGIBLE_MATCH:default:return}})(t.eligibilityCheckMatchType),automateEvolveEnrollment:(e=>e===$.w.FULL_MATCH||e===$.w.ELIGIBLE_MATCH)(t.eligibilityCheckMatchType)};return await (0,N.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(ee.ApplicationReview)},{target:"#".concat(ee.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}]}}}},[ee.Error]:{id:"".concat(ee.InsuranceDetailsReview,".").concat(ee.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:ee.Submitting}}}}},[ee.EmailVerification]:{id:ee.EmailVerification,initial:ee.Idle,states:{[ee.Idle]:{id:"".concat(ee.EmailVerification,".").concat(ee.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle,reenter:!0},UPDATE_EMAIL:{target:ee.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,M.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,J.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,U.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.OnboardingChecklist),onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle},UPDATE_EMAIL:{target:ee.UpdateEmail}}},[ee.UpdateEmail]:{initial:ee.Idle,states:{[ee.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,Q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,B.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},UPDATE_EMAIL:{target:ee.Idle}}}}}}},[ee.ReviewConsents]:{id:ee.ReviewConsents,initial:ee.FetchConsents,states:{[ee.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}},[ee.FetchConsents]:{invoke:{src:(0,Q.Sx)(async()=>await (0,k.i)()),onDone:{actions:"assignConsents",target:ee.Idle},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,K.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:V.PM["Pequot Tribal Family Health Plan"],consents:t.consentsData.userConsentStatus,programName:r};return await (0,O.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ee.UpdateContact}],onError:"#".concat(ee.OnboardingUserError)}},[ee.UpdateContact]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,B.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(ee.CreatePassword)},{target:"#".concat(ee.OnboardingUserError)}],onError:"#".concat(ee.OnboardingUserError)}},[ee.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}}}},[ee.CreatePassword]:{id:ee.CreatePassword,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:ee.Submitting}}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,T.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.RequestLabs),onError:{target:ee.Error,actions:"assignError"}}},[ee.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:ee.Submitting}}}}},[ee.RequestLabs]:{id:ee.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(ee.SubmitLabs),LAB_REQUESTED:{target:"#".concat(ee.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.SubmitLabs]:{id:ee.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(ee.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(ee.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.OnboardingChecklist]:{id:ee.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(ee.ReviewConsents)}}},[ee.AppDownload]:{id:ee.AppDownload},[ee.ApplicationReview]:{id:ee.ApplicationReview},[ee.OnboardingUserError]:{id:ee.OnboardingUserError},[ee.ApplicationComplete]:{id:ee.ApplicationComplete},[ee.ApplicationDetected]:{id:ee.ApplicationDetected},[ee.EligibilityUnmet]:{id:ee.EligibilityUnmet,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,company:et,leadStatus:V.XN.Ineligible,ineligibilityReason:V.hT.BMI,insurance:W.Ft[V.fz.PequotHealthCare],automateEvolveEnrollment:!1};return await (0,N.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:ee.Success,onError:ee.Error}},[ee.Success]:{},[ee.Error]:{on:{SUBMIT:{actions:"updateFormData",target:ee.Submitting}}}}}},on:{RESET:{target:"#".concat(ee.PreEligibility),actions:"reset"}}});var en=a(69443);let eo={[w.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your Pequot HealthCare benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[w.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[w.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself. Next, we'll ask about your Pequot Healthcare membership. Be sure to have your insurance card handy."})]})},[w.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"What's your Pequot HealthCare membership number?"})]})},[w.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[w.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[w.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[w.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[w.C.EmailVerification]:en.M[w.C.EmailVerification],[w.C.OnboardingChecklist]:en.M[w.C.OnboardingChecklist],[w.C.CreatePassword]:en.M[w.C.CreatePassword],[w.C.AppDownload]:en.M[w.C.AppDownload],[w.C.ReviewConsents]:en.M[w.C.ReviewConsents]};var es=a(82393);let el=[S.UX.BenefitsWebsite,S.UX.ProviderReferral,S.UX.WordOfMouth,S.UX.Other],ec={[w.C.ContactDetails]:{state:{options:es.rI},howDidYouFindUs:{options:el}},[w.C.InsuranceDetails]:{insuranceMemberID:{}},[w.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},ed=S.fz.PequotHealthCare,eu=e=>{let{render:t}=e,[a,T]=(0,A.zl)(er);(0,v.F)((0,P.K)(ed));let M=(0,R.useMemo)(()=>(0,L.r)(a.value),[a.value]);(0,E.t)(M,ed);let U=(0,R.useCallback)(e=>{T({type:"SUBMIT",data:e})},[T]),j=(0,R.useCallback)(()=>{T({type:"BACK"})},[T]),k=(0,R.useCallback)(()=>{var e,t;switch(M){case ee.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:eo[w.C.PreEligibility]},onSubmit:U});case ee.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eo[w.C.ContactDetails],fields:ec[w.C.ContactDetails]},onSubmit:U,defaultValues:a.context.formData});case ee.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:eo[w.C.EligibilityUnmet]},onSubmit:U,loading:a.matches({[ee.EligibilityUnmet]:ee.Submitting}),isEmailSent:a.matches({[ee.EligibilityUnmet]:ee.Success}),hasError:a.matches({[ee.EligibilityUnmet]:ee.Error})});case ee.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:eo[w.C.InsuranceDetails],fields:ec[w.C.InsuranceDetails]},onSubmit:U,onBack:j});case ee.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:eo[w.C.InsuranceDetailsReview],fields:ec[w.C.InsuranceDetailsReview]},onSubmit:U,loading:a.matches({[ee.InsuranceDetailsReview]:ee.Submitting}),hasError:a.matches({[ee.InsuranceDetailsReview]:ee.Error}),defaultValues:a.context.formData});case ee.ApplicationComplete:return(0,i.jsx)(o.Q,{...eo[w.C.ApplicationComplete],email:a.context.formData.email});case ee.ApplicationReview:return(0,i.jsx)(l.l,{...eo[w.C.ApplicationReview]});case ee.ApplicationDetected:return(0,i.jsx)(s.r,{...eo[w.C.ApplicationDetected],email:a.context.formData.email});case ee.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:eo[w.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[ee.EmailVerification]:ee.Error}),loading:a.matches({[ee.EmailVerification]:ee.Submitting}),isUpdateEmailLoading:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Idle}}),hasUpdateEmailError:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Error}}),onSubmit:U,onResendCode:e=>T({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>T({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ee.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:eo[w.C.OnboardingChecklist]},onSubmit:U});case ee.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:eo[w.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[ee.ReviewConsents]:ee.Error}),loading:a.matches({[ee.ReviewConsents]:ee.FetchConsents})||a.matches({[ee.ReviewConsents]:ee.Submitting})||a.matches({[ee.ReviewConsents]:ee.UpdateContact}),onSubmit:U});case ee.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eo[w.C.CreatePassword]},loading:a.matches({[ee.CreatePassword]:ee.Submitting}),error:a.context.error,onSubmit:U});case ee.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?eo[w.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?eo[w.C.AppDownload].titleLabSubmitted:eo[w.C.AppDownload].titleLabRequested,checklist:eo[w.C.AppDownload].checklist});case ee.OnboardingUserError:return(0,i.jsx)(x.C,{});case ee.RequestLabs:return(0,i.jsx)(D.I,{organizationName:"Pequot Tribal Family Health Plan",patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>T({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>T({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case ee.SubmitLabs:return(0,i.jsx)(I.x,{onGoBackToRequestLabs:()=>T({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>T({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>T({type:"LAB_SUBMITTED"}),patientId:null==(t=a.context.flyteUserData)?void 0:t.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[M,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:S.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:ed})]}),(0,i.jsx)(d.nV,{currentStep:M})]}),body:k(),currentWorkFlowStep:M})}},46884:(e,t,a)=>{a.d(t,{j:()=>eu});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(533),u=a(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(47320),E=a(93511),S=a(34305),w=a(80072),L=a(66885),P=a(3712),A=a(62227),R=a(14232),T=a(11969),M=a(10758),U=a(85007),j=a(20411),k=a(31346),B=a(38360),F=a(39648),O=a(77944),N=a(47353),_=a(83928),V=a(33841),H=a(13751),X=a(92323),z=a(86687),W=a(89225),q=a(97793),Y=a(53795),K=a(38088),G=a(65159),Q=a(39777),J=a(45352),$=a(63826),Z=function(e){return e.CheckEligibility="checkEligibility",e.CreateLead="createLead",e.CreateContact="createContact",e.CheckBenefits="checkBenefits",e.DetermineContactOrLead="determineContactOrLead",e.UpdateEmail="updateEmail",e.FetchConsents="fetchConsents",e.UpdateContact="updateContact",e}(Z||{});let ee={...q.f,...Z},et=W.Ek[V.fz.Aetna],ea={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},eligibilityCheckMatchType:void 0,bmi:void 0,benefitsCheck:void 0,otpData:void 0,contactData:{},consentsData:{items:[],userConsentStatus:[]},passwordData:{password:"",confirmPassword:""},flyteUserData:void 0,error:void 0,labs:void 0},ei={...H.AU,...H.gQ,...H.pE,...H.UH,...H.yF,...H.n6,...H.uN,...H.yS,...H.RW,...H.i_,...(0,H.rS)(ea).reset},er=(0,G.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return Y.J0.aetna({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!_.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&[V.wY.EXPIRED,V.wY.INSURANCE_MATCH,V.wY.PERSON_MATCH,V.wY.NOT_FOUND].includes(t)},isApplicationDetected:z.L,isAthenaRecordCreated:X.z},actions:ei}).createMachine({context:()=>ea,id:"aetnaMachine",initial:ee.PreEligibility,states:{[ee.PreEligibility]:{id:ee.PreEligibility,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(ee.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(ee.EligibilityUnmet)}]}}},[ee.ContactDetails]:{id:ee.ContactDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:"#".concat(ee.InsuranceDetails),actions:"updateFormData"}}}}},[ee.InsuranceDetails]:{id:ee.InsuranceDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{BACK:{target:"#".concat(ee.ContactDetails)},SUBMIT:{target:"#".concat(ee.InsuranceDetailsReview),actions:"updateFormData"}}}}},[ee.InsuranceDetailsReview]:{id:ee.InsuranceDetailsReview,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:ee.Submitting}}},[ee.Submitting]:{type:"parallel",states:{[ee.CheckEligibility]:{id:ee.CheckEligibility,initial:ee.Idle,states:{[ee.Idle]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,insurance:W.w[V.fz.Aetna],benefitProgram:W.Nl[V.fz.Aetna]};return await (0,F.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,J.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:ee.Success},onError:ee.Success}},[ee.Success]:{type:"final"}}},[ee.CheckBenefits]:{id:ee.CheckBenefits,initial:ee.Idle,states:{[ee.Idle]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:W.dT[V.lk["Aetna Medicare"]]};return await (0,j.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,J.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:ee.Success},onError:{target:ee.Success}}},[ee.Success]:{type:"final"}}}},onDone:{target:"#".concat(ee.DetermineContactOrLead)}},[ee.DetermineContactOrLead]:{id:ee.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:ee.CreateLead},{target:ee.CreateContact}]},[ee.CreateLead]:{id:ee.CreateLead,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:V.h9.Evolve,company:et,insurance:W.Ft[V.fz.Aetna],evolveOrganization:V.PM["State of Connecticut Retirees"],leadStatus:(e=>{switch(e){case $.w.PERSON_MATCH:case $.w.INSURANCE_MATCH:case $.w.EXPIRED:case $.w.NOT_FOUND:return S.XN.EligibleWaiting;case $.w.FULL_MATCH:case $.w.ELIGIBLE_MATCH:default:return}})(t.eligibilityCheckMatchType),automateEvolveEnrollment:(e=>e===$.w.FULL_MATCH||e===$.w.ELIGIBLE_MATCH)(t.eligibilityCheckMatchType)};return await (0,N.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}]}},[ee.CreateContact]:{id:ee.CreateContact,invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:V.h9.Evolve,company:et,insurance:W.Ft[V.fz.Aetna],evolveOrganization:V.PM["State of Connecticut Retirees"],accountId:W.f3[V.fz.Aetna]};return await (0,B.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(ee.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.Error)}]}},[ee.Error]:{id:ee.Error,on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:ee.Submitting}}}}},[ee.EmailVerification]:{id:ee.EmailVerification,initial:ee.Idle,states:{[ee.Idle]:{id:"".concat(ee.EmailVerification,".").concat(ee.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle,reenter:!0},UPDATE_EMAIL:{target:ee.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,M.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,J.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,U.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.OnboardingChecklist),onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle},UPDATE_EMAIL:{target:ee.UpdateEmail}}},[ee.UpdateEmail]:{initial:ee.Idle,states:{[ee.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,Q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,B.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},UPDATE_EMAIL:{target:ee.Idle}}}}}}},[ee.OnboardingChecklist]:{id:ee.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(ee.ReviewConsents)}}},[ee.ReviewConsents]:{id:ee.ReviewConsents,initial:ee.FetchConsents,states:{[ee.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}},[ee.FetchConsents]:{invoke:{src:(0,Q.Sx)(async()=>await (0,k.i)()),onDone:{actions:"assignConsents",target:ee.Idle},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,K.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:V.PM["State of Connecticut Retirees"],consents:t.consentsData.userConsentStatus,programName:r};return await (0,O.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ee.UpdateContact}],onError:"#".concat(ee.OnboardingUserError)}},[ee.UpdateContact]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,B.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(ee.CreatePassword)},{target:"#".concat(ee.OnboardingUserError)}],onError:"#".concat(ee.OnboardingUserError)}},[ee.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}}}},[ee.CreatePassword]:{id:ee.CreatePassword,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:ee.Submitting}}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,T.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.RequestLabs),onError:{target:ee.Error,actions:"assignError"}}},[ee.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:ee.Submitting}}}}},[ee.RequestLabs]:{id:ee.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(ee.SubmitLabs),LAB_REQUESTED:{target:"#".concat(ee.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.SubmitLabs]:{id:ee.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(ee.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(ee.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.OnboardingUserError]:{id:ee.OnboardingUserError},[ee.ApplicationReview]:{id:ee.ApplicationReview},[ee.AppDownload]:{id:ee.AppDownload},[ee.ApplicationComplete]:{id:ee.ApplicationComplete},[ee.ApplicationDetected]:{id:ee.ApplicationDetected},[ee.EligibilityUnmet]:{id:ee.EligibilityUnmet,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{invoke:{src:(0,Q.Sx)(async e=>{let{input:t}=e,a={...t,company:et,leadStatus:V.XN.Ineligible,insurance:W.Ft[V.fz.Aetna],ineligibilityReason:V.hT.BMI,automateEvolveEnrollment:!1};return await (0,N.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:ee.Success,onError:ee.Error}},[ee.Success]:{},[ee.Error]:{on:{SUBMIT:{target:ee.Submitting}}}}}},on:{RESET:{target:"#".concat(ee.PreEligibility),actions:"reset"}}});var en=a(69443);let eo={[w.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the Flyte program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the Flyte program through your Aetna Medicare Advantage benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. Flyte providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the Flyte program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[w.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The Flyte program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[w.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your health plan, tell us about yourself. Next, we'll ask about your Aetna membership. Be sure to have your insurance card handy."})]})},[w.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"What's your Aetna membership number?"})]})},[w.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[w.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[w.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[w.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[w.C.EmailVerification]:en.M[w.C.EmailVerification],[w.C.OnboardingChecklist]:en.M[w.C.OnboardingChecklist],[w.C.CreatePassword]:en.M[w.C.CreatePassword],[w.C.AppDownload]:en.M[w.C.AppDownload],[w.C.ReviewConsents]:en.M[w.C.ReviewConsents]};var es=a(82393);let el=[S.UX.BenefitsWebsite,S.UX.ProviderReferral,S.UX.WordOfMouth,S.UX.Other],ec={[w.C.ContactDetails]:{state:{options:es.rI},howDidYouFindUs:{options:el}},[w.C.InsuranceDetails]:{insuranceMemberID:{tooltip:(0,i.jsxs)(r.Box,{children:[(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-light",children:"Where to find my Membership ID Number:"}),(0,i.jsx)(r.Image,{width:"100%",height:"auto",src:"/static/assets/programs/aetna/aetna-insurance-card.png",alt:"Member ID guidance"})]})}},[w.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},ed=S.fz.Aetna,eu=e=>{let{render:t}=e,[a,T]=(0,A.zl)(er);(0,v.F)((0,P.K)(ed));let M=(0,R.useMemo)(()=>(0,L.r)(a.value),[a.value]);(0,E.t)(M,ed);let U=(0,R.useCallback)(e=>{T({type:"SUBMIT",data:e})},[T]),j=(0,R.useCallback)(()=>{T({type:"BACK"})},[T]),k=(0,R.useCallback)(()=>{var e,t;switch(M){case ee.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:eo[w.C.PreEligibility]},onSubmit:U});case ee.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eo[w.C.ContactDetails],fields:ec[w.C.ContactDetails]},onSubmit:U,defaultValues:a.context.formData});case ee.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:eo[w.C.EligibilityUnmet]},onSubmit:U,loading:a.matches({[ee.EligibilityUnmet]:ee.Submitting}),isEmailSent:a.matches({[ee.EligibilityUnmet]:ee.Success}),hasError:a.matches({[ee.EligibilityUnmet]:ee.Error})});case ee.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:eo[w.C.InsuranceDetails],fields:ec[w.C.InsuranceDetails]},onSubmit:U,onBack:j});case ee.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:eo[w.C.InsuranceDetailsReview],fields:ec[w.C.InsuranceDetailsReview]},onSubmit:U,loading:a.matches({[ee.InsuranceDetailsReview]:ee.Submitting})||a.matches({[ee.InsuranceDetailsReview]:ee.DetermineContactOrLead})||a.matches({[ee.InsuranceDetailsReview]:ee.CreateLead})||a.matches({[ee.InsuranceDetailsReview]:ee.CreateContact}),hasError:a.matches({[ee.InsuranceDetailsReview]:ee.Error}),defaultValues:a.context.formData});case ee.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:eo[w.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[ee.EmailVerification]:ee.Error}),loading:a.matches({[ee.EmailVerification]:ee.Submitting}),isUpdateEmailLoading:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Idle}}),hasUpdateEmailError:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Error}}),onSubmit:U,onResendCode:e=>T({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>T({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ee.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:eo[w.C.OnboardingChecklist]},onSubmit:U});case ee.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:eo[w.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[ee.ReviewConsents]:ee.Error}),loading:a.matches({[ee.ReviewConsents]:ee.FetchConsents})||a.matches({[ee.ReviewConsents]:ee.Submitting})||a.matches({[ee.ReviewConsents]:ee.UpdateContact}),onSubmit:U});case ee.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eo[w.C.CreatePassword]},loading:a.matches({[ee.CreatePassword]:ee.Submitting}),error:a.context.error,onSubmit:U});case ee.ApplicationComplete:return(0,i.jsx)(o.Q,{...eo[w.C.ApplicationComplete],email:a.context.formData.email});case ee.ApplicationDetected:return(0,i.jsx)(s.r,{...eo[w.C.ApplicationDetected],email:a.context.formData.email});case ee.ApplicationReview:return(0,i.jsx)(l.l,{...eo[w.C.ApplicationReview]});case ee.AppDownload:{let e=eo[w.C.AppDownload].BrickAndMortarLabSkipped.image;return(0,i.jsx)(n.a,{title:(()=>{let{labs:e}=a.context;switch(!0){case"SUBMIT_LATER"===e:return eo[w.C.AppDownload].titleLabSkipped;case"LABS_UPLOADED"===e:return eo[w.C.AppDownload].titleLabSubmitted;default:return eo[w.C.AppDownload].titleLabRequested}})(),image:e,checklist:eo[w.C.AppDownload].checklist})}case ee.OnboardingUserError:return(0,i.jsx)(x.C,{});case ee.RequestLabs:return(0,i.jsx)(D.I,{organizationName:"State of Connecticut Retirees",patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>T({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>T({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case ee.SubmitLabs:return(0,i.jsx)(I.x,{onGoBackToRequestLabs:()=>T({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>T({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>T({type:"LAB_SUBMITTED"}),patientId:null==(t=a.context.flyteUserData)?void 0:t.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[M,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:S.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:ed})]}),(0,i.jsx)(d.f,{currentStep:M})]}),body:k(),currentWorkFlowStep:M})}},47811:(e,t,a)=>{a.d(t,{D:()=>ey});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(18681),m=a(39946),g=a(53154),p=a(42037),h=a(70587),b=a(11427),C=a(86535),x=a(27297),f=a(43483),D=a(81488),y=a(47320),I=a(93511),v=a(34305),E=a(80072),S=a(61415),w=a(66885),L=a(3712),P=a(62227),A=a(14232),R=a(82393),T=a(45383),M=a(76692),U=a(19847),j=a(88992);let k="participantDepartmentorOrg",B=["Hebrew Home at Riverdale","RiverSpring Services Corp","RiverSpring Licensed Home Care Services Agency","RiverSpring Health Plans (ElderServe Health, Inc.)"],F=()=>{let{register:e,watch:t}=(0,j.xW)();return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-2",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:k,children:"Participating organization"}),(0,i.jsx)(r.Select,{"data-test":k,id:k,size:"l",variant:"flushed",placeholder:"Select organization",...e(k,{required:!0}),value:t(k),children:B.map(e=>(0,i.jsx)("option",{value:e,children:e},e))})]})};var O=a(58892);let N="evolveProgram";var _=function(e){return e.Guided="Guided",e.SelfGuided="Self-Guided",e}({});let V=()=>{let{register:e}=(0,j.xW)();return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-4",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",children:"Program selection"}),(0,i.jsxs)(r.RadioGroup,{display:"flex",gap:"spacer-3",name:N,flexDirection:{base:"column",md:"row"},"data-test":N,children:[(0,i.jsx)(O.e,{value:"Guided",size:"m",name:N,...e(N,{required:!0}),children:"Physician-guided"}),(0,i.jsx)(O.e,{value:"Self-Guided",size:"m",...e(N),name:N,children:"Self-guided"})]})]})},H=e=>{let{configuration:t,loading:a=!1,onSubmit:n,onBack:o}=e,{contentResources:s,fields:l}=t,c=(0,j.mN)({mode:"onBlur",defaultValues:{insuranceMemberID:"",insurance:void 0,evolveProgram:void 0}}),d=(0,U.a)(),u=()=>(0,i.jsxs)(r.Flex,{gap:{base:"spacer-8",md:"spacer-16"},alignItems:"center",flex:{base:1,lg:"unset"},children:[(0,i.jsx)(r.Button,{size:{base:"m",lg:"l"},isLoading:a,variant:"link","aria-label":"Back",leadingIcon:(0,i.jsx)(r.IconArrowLeft,{}),onClick:o,children:"Back"}),(0,i.jsx)(r.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!c.formState.isValid,flex:1,isLoading:a,trailingIcon:(0,i.jsx)(r.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"})]});return(0,i.jsx)(j.Op,{...c,children:(0,i.jsxs)(T.X,{as:"form",onSubmit:c.handleSubmit(n),noValidate:!0,children:[(0,i.jsx)(T.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(T.X.Form,{children:[(null==l?void 0:l.evolveProgram)&&(0,i.jsx)(V,{}),(0,i.jsx)(F,{}),(null==l?void 0:l.insurance)&&(0,i.jsx)(M._8,{isDisabled:a,isRequired:!0,...null==l?void 0:l.insurance}),(0,i.jsx)(M.kV,{isDisabled:a,isRequired:!0,pb:{base:"spacer-24",lg:0},...null==l?void 0:l.insuranceMemberID}),d?(0,i.jsx)(R.cI,{children:u()}):u()]})]})})};var X=a(11969),z=a(10758),W=a(85007),q=a(20411),Y=a(31346),K=a(38360),G=a(77944),Q=a(47353),J=a(83928),$=a(33841),Z=a(13751),ee=a(92323),et=a(86687),ea=a(89225),ei=a(97793),er=a(38088),en=a(65159),eo=a(45352),es=a(39777);let el={Guided:v.PM["RiverSpring Living - Guided"],"Self-Guided":v.PM["RiverSpring Living - Self Guided"]},ec=(e,t,a)=>{if(a===v.PM["RiverSpring Living - Self Guided"])return!0;switch(e){case v.lk["1199SEIU"]:return!0;case v.lk.Aetna:return[v.yj["New York"],v.yj["New Jersey"],v.yj.Connecticut].includes(t);default:return!1}};var ed=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e}(ed||{});let eu={...ei.f,...ed},em=ea.Ek[$.fz.RiverSpringLiving],eg={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",participantDepartmentorOrg:"",evolveProgram:void 0,comorbidities:[],diabetes:"",bariatricSurgery:""},evolveOrganization:void 0,bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},ep={...Z.AU,...Z.gQ,...Z.pE,...Z.UH,...Z.yF,...Z.n6,...Z.uN,...Z.yS,...Z.RW,...Z.i_,...(0,Z.rS)(eg)},eh=(0,en.mj)({types:{},guards:{isApplicationReviewRequired:e=>{let{context:{formData:t,evolveOrganization:a}}=e;return!J.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!ec(t.insurance,t.state,a)},isApplicationDetected:et.L,isAthenaRecordCreated:ee.z},actions:{...ep,assignEvolveOrganization:(0,eo.a)({evolveOrganization:e=>{let{context:t}=e;return el[t.formData.evolveProgram||_.SelfGuided]}})}}).createMachine({context:()=>eg,id:"riverspringMachine",initial:eu.PreEligibility,states:{[eu.PreEligibility]:{id:eu.PreEligibility,initial:eu.Idle,states:{[eu.Idle]:{on:{SUBMIT:{target:eu.Submitting,actions:"updateFormData"}}},[eu.Submitting]:{entry:["assignBMI"],always:"#".concat(eu.ContactDetails)}}},[eu.ContactDetails]:{id:eu.ContactDetails,initial:eu.Idle,states:{[eu.Idle]:{on:{SUBMIT:{target:"#".concat(eu.InsuranceDetails),actions:"updateFormData"}}}}},[eu.InsuranceDetails]:{id:eu.InsuranceDetails,initial:eu.Idle,states:{[eu.Idle]:{on:{BACK:{target:"#".concat(eu.ContactDetails)},SUBMIT:{target:"#".concat(eu.InsuranceDetailsReview),actions:["updateFormData","assignEvolveOrganization"]}}}}},[eu.InsuranceDetailsReview]:{id:eu.InsuranceDetailsReview,initial:eu.Idle,states:{[eu.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:eu.Submitting}}},[eu.Submitting]:{initial:eu.CheckBenefits,states:{[eu.CheckBenefits]:{id:eu.CheckBenefits,invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:ea.dT[t.insurance]};return await (0,q.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,eo.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(eu.DetermineContactOrLead)}],onError:"#".concat(eu.DetermineContactOrLead)}},[eu.DetermineContactOrLead]:{id:eu.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:eu.CreateLead},{target:eu.CreateContact}]},[eu.CreateLead]:{id:eu.CreateLead,invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={...t.formData,evolveOrganization:t.evolveOrganization,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:em,leadStatus:((e,t,a)=>{if(!ec(e,t,a))return v.XN.EligibleWaiting})(t.formData.insurance,t.formData.state,t.evolveOrganization),automateEvolveEnrollment:ec(t.formData.insurance,t.formData.state,t.evolveOrganization),evolveProgram:t.formData.evolveProgram||_.SelfGuided};return await (0,Q.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(eu.ApplicationReview)},{target:"#".concat(eu.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(eu.ApplicationDetected)},{target:"#".concat(eu.InsuranceDetailsReview,".").concat(eu.Error)}]}},[eu.CreateContact]:{id:eu.CreateContact,invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={...t.formData,evolveOrganization:t.evolveOrganization,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:em,accountId:ea.f3[$.fz.RiverSpringLiving],evolveProgram:t.formData.evolveProgram||_.SelfGuided,eligibilityVerifiedBy:$.h9.Pverify};return await (0,K.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(eu.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(eu.ApplicationDetected)},{target:"#".concat(eu.InsuranceDetailsReview,".").concat(eu.Error)}]}}}},[eu.Error]:{id:"".concat(eu.InsuranceDetailsReview,".").concat(eu.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:eu.Submitting}}}}},[eu.EmailVerification]:{id:eu.EmailVerification,initial:eu.Idle,states:{[eu.Idle]:{id:"".concat(eu.EmailVerification,".").concat(eu.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:eu.Submitting},RESEND_EMAIL_VERIFICATION:{target:eu.Idle,reenter:!0},UPDATE_EMAIL:{target:eu.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,es.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,z.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,eo.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:eu.Error}},[eu.Submitting]:{invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,W.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eu.OnboardingChecklist),onError:eu.Error}},[eu.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:eu.Submitting},RESEND_EMAIL_VERIFICATION:{target:eu.Idle},UPDATE_EMAIL:{target:eu.UpdateEmail}}},[eu.UpdateEmail]:{initial:eu.Idle,states:{[eu.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,es.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,K.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(eu.EmailVerification,".").concat(eu.Idle)},onError:eu.Error}},[eu.Error]:{on:{SUBMIT:{target:"#".concat(eu.EmailVerification,".").concat(eu.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(eu.EmailVerification,".").concat(eu.Idle)},UPDATE_EMAIL:{target:eu.Idle}}}}}}},[eu.ReviewConsents]:{id:eu.ReviewConsents,initial:eu.FetchConsents,states:{[eu.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eu.Submitting}}},[eu.FetchConsents]:{invoke:{src:(0,es.Sx)(async()=>await (0,Y.i)()),onDone:{actions:"assignConsents",target:eu.Idle},onError:eu.Error}},[eu.Submitting]:{invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,er.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:t.evolveOrganization,consents:t.consentsData.userConsentStatus,programName:r};return await (0,G.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:eu.UpdateContact}],onError:"#".concat(eu.OnboardingUserError)}},[eu.UpdateContact]:{invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,K.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(eu.CreatePassword)},{target:"#".concat(eu.OnboardingUserError)}],onError:"#".concat(eu.OnboardingUserError)}},[eu.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eu.Submitting}}}}},[eu.CreatePassword]:{id:eu.CreatePassword,initial:eu.Idle,states:{[eu.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:eu.Submitting}}},[eu.Submitting]:{invoke:{src:(0,es.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,X.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eu.RequestLabs),onError:{target:eu.Error,actions:"assignError"}}},[eu.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:eu.Submitting}}}}},[eu.RequestLabs]:{id:eu.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(eu.SubmitLabs),LAB_REQUESTED:{target:"#".concat(eu.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(eu.AppDownload)}}},[eu.SubmitLabs]:{id:eu.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(eu.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(eu.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(eu.AppDownload)}}},[eu.OnboardingChecklist]:{id:eu.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(eu.ReviewConsents)}}},[eu.AppDownload]:{id:eu.AppDownload},[eu.ApplicationReview]:{id:eu.ApplicationReview},[eu.OnboardingUserError]:{id:eu.OnboardingUserError},[eu.ApplicationComplete]:{id:eu.ApplicationComplete},[eu.ApplicationDetected]:{id:eu.ApplicationDetected}},on:{RESET:{target:"#".concat(eu.PreEligibility),actions:"reset"}}});var eb=a(69443);let eC={[E.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["All employees are eligible to access the"," ",(0,i.jsx)("b",{children:"Self-Guided"})," ","program through the RiverSpring Living benefits.",(0,i.jsx)("br",{}),"To be eligible for the"," ",(0,i.jsx)("b",{children:"Physician-Guided"})," ","program, you must meet specific age and Body Mass Index (BMI)* requirements."]})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[E.C.ContactDetails]:(e,t)=>({title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(r.TextPairing.Label,{color:"text-primary",children:[(0,i.jsxs)(r.Text,{display:{base:"inline",lg:"block"},as:"label",variant:"text-header-2XL",color:"text-secondary-negative",children:["Congratulations!"," "]}),"You're eligible for the"," ",S.J.riverSpringLiving({bmi:e,comorbidity:t})?"Physician":"Self","-Guided FlyteHealth program"]}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, please tell us a bit more about yourself."})]})}),[E.C.InsuranceDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(r.TextPairing.Label,{color:"text-secondary-negative",children:["Almost done:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Select your program and let us know if you have health insurance"})]}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["Before selecting your program, review summaries below."," ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"Physician-Guided:"})," ","Access to the entire FlyteHealth care team and our patient app.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"Self-Guided:"})," ","Access to the FlyteHealth patient app only."]})]})},[E.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[E.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsxs)(r.Text,{color:"text-secondary",mt:"spacer-8",variant:"text-body-meta-regular",children:["Please note that for Physician-Guided users, clinical encounters and prescription costs are covered by RiverSpring Living insurance (either Aetna or 1199SEIU), and out-of-pocket costs will vary based on your plan coverage, deductibles, co-pays, and limits. For more information, please contact the RiverSpring Living Benefits Department or your insurance company.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"If you don't have RiverSpring Living insurance, FlyteHealth also accepts a number of other plans. Please check with a FlyteHealth Patient Coordinator about whether your insurance is accepted.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"For Self-Guided users, there is no cost for RiverSpring Living employees."]})},[E.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]}),note:(0,i.jsxs)(r.Text,{color:"text-secondary",variant:"text-body-meta-regular",children:["Please note that for Guided users, clinical encounters and prescription costs are covered by RiverSpring Living insurance (either Aetna or 1199SEIU), and out-of-pocket costs will vary based on your plan coverage, deductibles, co-pays, and limits. For more information, please contact the RiverSpring Living Benefits Department or your insurance company."," ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"If you don't have RiverSpring Living insurance, FlyteHealth also accepts a number of other plans. Please check with a FlyteHealth Patient Coordinator about whether your insurance is accepted."]})},[E.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[E.C.EmailVerification]:eb.M[E.C.EmailVerification],[E.C.OnboardingChecklist]:eb.M[E.C.OnboardingChecklist],[E.C.CreatePassword]:eb.M[E.C.CreatePassword],[E.C.AppDownload]:eb.M[E.C.AppDownload],[E.C.ReviewConsents]:eb.M[E.C.ReviewConsents]},ex=[v.UX.BenefitsWebsite,v.UX.CoworkerReferral,v.UX.OnsiteMonitor,v.UX.Poster,v.UX.ProviderReferral,v.UX.WordOfMouth,v.UX.Other],ef={[E.C.ContactDetails]:{state:{options:R.rI},howDidYouFindUs:{options:ex}},[E.C.InsuranceDetails]:e=>({insurance:{insuranceCarriers:[v.lk.Aetna,v.lk["1199SEIU"]]},insuranceMemberID:{},evolveProgram:e?{}:void 0}),[E.C.InsuranceDetailsReview]:{insurance:{insuranceCarriers:[v.lk.Aetna,v.lk["1199SEIU"]]}}},eD=v.fz.RiverSpringLiving,ey=e=>{let{render:t}=e,[a,R]=(0,P.zl)(eh);(0,y.F)((0,L.K)(eD));let T=(0,A.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,I.t)(T,eD);let M=(0,A.useCallback)(e=>{R({type:"SUBMIT",data:e})},[R]),U=(0,A.useCallback)(()=>{R({type:"BACK"})},[R]),j=(0,A.useCallback)(()=>{var e,t;switch(T){case eu.PreEligibility:return(0,i.jsx)(C.P,{configuration:{contentResources:eC[E.C.PreEligibility]},onSubmit:M});case eu.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eC[E.C.ContactDetails](a.context.bmi,a.context.formData.comorbidity),fields:ef[E.C.ContactDetails]},onSubmit:M,defaultValues:a.context.formData});case eu.InsuranceDetails:return(0,i.jsx)(H,{configuration:{contentResources:eC[E.C.InsuranceDetails],fields:ef[E.C.InsuranceDetails](S.J.riverSpringLiving({bmi:a.context.bmi}))},onSubmit:M,onBack:U});case eu.InsuranceDetailsReview:return(0,i.jsx)(p.h,{configuration:{contentResources:eC[E.C.InsuranceDetailsReview],fields:ef[E.C.InsuranceDetailsReview]},onSubmit:M,loading:a.matches({[eu.InsuranceDetailsReview]:eu.Submitting}),hasError:a.matches({[eu.InsuranceDetailsReview]:eu.Error}),defaultValues:a.context.formData});case eu.ApplicationComplete:return(0,i.jsx)(o.Q,{...eC[E.C.ApplicationComplete],email:a.context.formData.email});case eu.ApplicationReview:return(0,i.jsx)(l.l,{...eC[E.C.ApplicationReview]});case eu.ApplicationDetected:return(0,i.jsx)(s.r,{...eC[E.C.ApplicationDetected],email:a.context.formData.email});case eu.EmailVerification:return(0,i.jsx)(g.e,{configuration:{contentResources:{title:eC[E.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[eu.EmailVerification]:eu.Error}),loading:a.matches({[eu.EmailVerification]:eu.Submitting}),isUpdateEmailLoading:a.matches({[eu.EmailVerification]:{[eu.UpdateEmail]:eu.Idle}}),hasUpdateEmailError:a.matches({[eu.EmailVerification]:{[eu.UpdateEmail]:eu.Error}}),onSubmit:M,onResendCode:e=>R({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>R({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case eu.OnboardingChecklist:return(0,i.jsx)(h.E,{showLabs:!0,configuration:{contentResources:eC[E.C.OnboardingChecklist]},onSubmit:M});case eu.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:eC[E.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[eu.ReviewConsents]:eu.Error}),loading:a.matches({[eu.ReviewConsents]:eu.FetchConsents})||a.matches({[eu.ReviewConsents]:eu.Submitting})||a.matches({[eu.ReviewConsents]:eu.UpdateContact}),onSubmit:M});case eu.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eC[E.C.CreatePassword]},loading:a.matches({[eu.CreatePassword]:eu.Submitting}),error:a.context.error,onSubmit:M});case eu.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?eC[E.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?eC[E.C.AppDownload].titleLabSubmitted:eC[E.C.AppDownload].titleLabRequested,checklist:eC[E.C.AppDownload].checklist});case eu.OnboardingUserError:return(0,i.jsx)(b.C,{});case eu.RequestLabs:return(0,i.jsx)(x.I,{organizationName:a.context.evolveOrganization,patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>R({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>R({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case eu.SubmitLabs:return(0,i.jsx)(D.x,{onGoBackToRequestLabs:()=>R({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>R({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>R({type:"LAB_SUBMITTED"}),patientId:null==(t=a.context.flyteUserData)?void 0:t.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[T,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:v.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:eD})]}),(0,i.jsx)(d.nV,{currentStep:T})]}),body:j(),currentWorkFlowStep:T})}},53100:(e,t,a)=>{a.d(t,{z:()=>em});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(47320),E=a(93511),S=a(34305),w=a(80072),L=a(66885),P=a(3712),A=a(62227),R=a(14232),T=a(11969),M=a(10758),U=a(85007),j=a(20411),k=a(31346),B=a(38360),F=a(77944),O=a(47353),N=a(83928),_=a(33841),V=a(13751),H=a(92323),X=a(86687),z=a(89225),W=a(97793),q=a(53795),Y=a(38088),K=a(65159),G=a(39777),Q=a(45352);let J=e=>{let{groupNumber:t,status:a}=e;return["10556700","10556701","10556702","10556703","10556704","10556705","10556706","10556707","10556708","10556709","10556710","10556711","10556712","10556713","10556714","10556715","10556716","10556717","10556718","10556719","10556720","10556721","10556722","10556723","10556724","10556725","10556726","10556727","10556728"].includes(t)&&"Active"===a},$=e=>e===S.yj.Maryland?z.Ft["ChristianaCare - MD"]:(S.yj.Delaware,z.Ft["ChristianaCare - DE"]);var Z=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineBenefitsOrLead="determineBenefitsOrLead",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e}(Z||{});let ee={...W.f,...Z},et=z.Ek[_.fz.ChristianaCare],ea={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},ei={...V.AU,...V.gQ,...V.pE,...V.UH,...V.yF,...V.n6,...V.uN,...V.yS,...V.RW,...V.i_,...(0,V.rS)(ea)},er=(0,K.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return q.J0.christianaCare({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{var t,a;let{context:{benefitsCheck:i,formData:r}}=e;return!N.A.shouldBypassIsApplicationReviewRequired({email:r.email})&&!J({groupNumber:null==i||null==(t=i.coverage)?void 0:t.groupNumber,status:null==i||null==(a=i.coverage)?void 0:a.status})},isApplicationDetected:X.L,isAthenaRecordCreated:H.z},actions:ei}).createMachine({context:()=>ea,id:"christianaCareMachine",initial:ee.PreEligibility,states:{[ee.PreEligibility]:{id:ee.PreEligibility,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(ee.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(ee.EligibilityUnmet)}]}}},[ee.ContactDetails]:{id:ee.ContactDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:"#".concat(ee.InsuranceDetails),actions:"updateFormData"}}}}},[ee.InsuranceDetails]:{id:ee.InsuranceDetails,initial:ee.Idle,states:{[ee.Idle]:{on:{BACK:{target:"#".concat(ee.ContactDetails)},SUBMIT:{target:"#".concat(ee.InsuranceDetailsReview),actions:"updateFormData"}}}}},[ee.InsuranceDetailsReview]:{id:ee.InsuranceDetailsReview,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:ee.Submitting}}},[ee.Submitting]:{id:ee.Submitting,initial:ee.CheckBenefits,states:{[ee.CheckBenefits]:{id:ee.CheckBenefits,invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:z.dT[_.lk.Highmark]};return await (0,j.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,Q.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(ee.DetermineContactOrLead)}],onError:"#".concat(ee.DetermineContactOrLead)}},[ee.DetermineContactOrLead]:{id:ee.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:ee.CreateLead},{target:ee.CreateContact}]},[ee.CreateContact]:{id:ee.CreateContact,invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:et,insurance:$(t.formData.state),evolveOrganization:_.PM["ChristianaCare - Caregivers"],accountId:z.f3[_.fz.ChristianaCare],eligibilityVerifiedBy:_.h9.Pverify};return await (0,B.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(ee.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}]}},[ee.CreateLead]:{id:ee.CreateLead,invoke:{src:(0,G.Sx)(async e=>{var t,a,i,r,n,o,s,l,c,d,u,m;let{input:g}=e,p={...g.formData,...g.formData.insuranceMemberID&&{employmentVerificationCode:g.formData.insuranceMemberID},...g.benefitsCheck&&{benefitsCheck:g.benefitsCheck},...J({groupNumber:null==(a=g.benefitsCheck)||null==(t=a.coverage)?void 0:t.groupNumber,status:null==(r=g.benefitsCheck)||null==(i=r.coverage)?void 0:i.status})&&{eligibilityVerifiedBy:_.h9.Pverify},insurance:$(g.formData.state),evolveOrganization:_.PM["ChristianaCare - Caregivers"],company:et,leadStatus:(e=>{let{groupNumber:t,status:a}=e;if(!J({groupNumber:t,status:a}))return S.XN.EligibleWaiting})({groupNumber:null==(o=g.benefitsCheck)||null==(n=o.coverage)?void 0:n.groupNumber,status:null==(l=g.benefitsCheck)||null==(s=l.coverage)?void 0:s.status}),automateEvolveEnrollment:J({groupNumber:null==(d=g.benefitsCheck)||null==(c=d.coverage)?void 0:c.groupNumber,status:null==(m=g.benefitsCheck)||null==(u=m.coverage)?void 0:u.status})};return await (0,O.t)(p)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(ee.ApplicationReview)},{target:"#".concat(ee.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(ee.ApplicationDetected)},{target:"#".concat(ee.InsuranceDetailsReview,".").concat(ee.Error)}]}}}},[ee.Error]:{id:"".concat(ee.InsuranceDetailsReview,".").concat(ee.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:ee.Submitting}}}}},[ee.EmailVerification]:{id:ee.EmailVerification,initial:ee.Idle,states:{[ee.Idle]:{id:"".concat(ee.EmailVerification,".").concat(ee.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle,reenter:!0},UPDATE_EMAIL:{target:ee.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,G.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,M.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,Q.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,U.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.OnboardingChecklist),onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:ee.Submitting},RESEND_EMAIL_VERIFICATION:{target:ee.Idle},UPDATE_EMAIL:{target:ee.UpdateEmail}}},[ee.UpdateEmail]:{initial:ee.Idle,states:{[ee.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,G.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,B.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},onError:ee.Error}},[ee.Error]:{on:{SUBMIT:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(ee.EmailVerification,".").concat(ee.Idle)},UPDATE_EMAIL:{target:ee.Idle}}}}}}},[ee.ReviewConsents]:{id:ee.ReviewConsents,initial:ee.FetchConsents,states:{[ee.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}},[ee.FetchConsents]:{invoke:{src:(0,G.Sx)(async()=>await (0,k.i)()),onDone:{actions:"assignConsents",target:ee.Idle},onError:ee.Error}},[ee.Submitting]:{invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,Y.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:_.PM["ChristianaCare - Caregivers"],consents:t.consentsData.userConsentStatus,programName:r};return await (0,F.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ee.UpdateContact}],onError:"#".concat(ee.OnboardingUserError)}},[ee.UpdateContact]:{invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,B.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(ee.CreatePassword)},{target:"#".concat(ee.OnboardingUserError)}],onError:"#".concat(ee.OnboardingUserError)}},[ee.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ee.Submitting}}}}},[ee.CreatePassword]:{id:ee.CreatePassword,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:ee.Submitting}}},[ee.Submitting]:{invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,T.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ee.RequestLabs),onError:{target:ee.Error,actions:"assignError"}}},[ee.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:ee.Submitting}}}}},[ee.OnboardingChecklist]:{id:ee.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(ee.ReviewConsents)}}},[ee.RequestLabs]:{id:ee.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(ee.SubmitLabs),LAB_REQUESTED:{target:"#".concat(ee.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.SubmitLabs]:{id:ee.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(ee.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(ee.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ee.AppDownload)}}},[ee.AppDownload]:{id:ee.AppDownload},[ee.ApplicationReview]:{id:ee.ApplicationReview},[ee.OnboardingUserError]:{id:ee.OnboardingUserError},[ee.ApplicationComplete]:{id:ee.ApplicationComplete},[ee.ApplicationDetected]:{id:ee.ApplicationDetected},[ee.EligibilityUnmet]:{id:ee.EligibilityUnmet,initial:ee.Idle,states:{[ee.Idle]:{on:{SUBMIT:{target:ee.Submitting,actions:"updateFormData"}}},[ee.Submitting]:{invoke:{src:(0,G.Sx)(async e=>{let{input:t}=e,a={...t,company:et,leadStatus:_.XN.Ineligible,ineligibilityReason:_.hT.BMI,automateEvolveEnrollment:!1,insurance:"CCHS DE"};return await (0,O.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:ee.Success,onError:ee.Error}},[ee.Success]:{},[ee.Error]:{on:{SUBMIT:{actions:"updateFormData",target:ee.Submitting}}}}}},on:{RESET:{target:"#".concat(ee.PreEligibility),actions:"reset"}}});var en=a(69443);let eo={[w.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through ChristianaCare, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[w.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[w.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["To help match your information with the ChristianaCare Caregivers with Highmark insurance plan, tell us about yourself.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Next, we'll ask about your Highmark membership. Be sure to have your insurance card handy."]})]})},[w.C.InsuranceDetails]:{title:(0,i.jsx)(r.TextPairing,{variant:"textpairing-header-2XL",children:(0,i.jsxs)(r.TextPairing.Label,{color:"text-primary",children:[(0,i.jsxs)(r.Text,{display:{base:"inline",lg:"block"},as:"label",variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," "]}),"What's your Highmark membership number?"]})})},[w.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[w.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[w.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[w.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[w.C.EmailVerification]:en.M[w.C.EmailVerification],[w.C.OnboardingChecklist]:en.M[w.C.OnboardingChecklist],[w.C.CreatePassword]:en.M[w.C.CreatePassword],[w.C.AppDownload]:en.M[w.C.AppDownload],[w.C.ReviewConsents]:en.M[w.C.ReviewConsents]};var es=a(82393);let el=[S.UX.BenefitsWebsite,S.UX.CoworkerReferral,S.UX.PrescriptionDenial,S.UX.ProviderReferral,S.UX.WordOfMouth,S.UX.Other],ec={maxLength:15,minLength:15,registerOptions:{minLength:{value:15,message:"Enter the 15-character member ID number."},maxLength:{value:15,message:"Enter the 15-character member ID number."},pattern:{value:/^(C9I|C9O)/i,message:"Member ID must begin with C9i or C9o."}},label:"Highmark Membership ID Number",placeholder:"C9XXXXXXXXXXXXX"},ed={[w.C.ContactDetails]:{state:{options:es.rI},howDidYouFindUs:{options:el}},[w.C.InsuranceDetails]:{insuranceMemberID:{...ec,description:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Enter the 15-digit Member ID as displayed on your Highmark Membership ID Card."}),tooltip:(0,i.jsxs)(r.Box,{children:[(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-light",children:"Where to find my Membership ID Number:"}),(0,i.jsx)(r.Image,{width:"100%",height:"auto",src:"/static/assets/programs/christiana-care/christiana-care-insurance-card.png",alt:"Member ID guidance"})]})}},[w.C.InsuranceDetailsReview]:{insuranceMemberID:ec}},eu=S.fz.ChristianaCare,em=e=>{let{render:t}=e,[a,T]=(0,A.zl)(er);(0,v.F)((0,P.K)(eu));let M=(0,R.useMemo)(()=>(0,L.r)(a.value),[a.value]);(0,E.t)(M,eu);let U=(0,R.useCallback)(e=>{T({type:"SUBMIT",data:e})},[T]),j=(0,R.useCallback)(()=>{T({type:"BACK"})},[T]),k=(0,R.useCallback)(()=>{switch(M){case ee.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:eo[w.C.PreEligibility]},onSubmit:U});case ee.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eo[w.C.ContactDetails],fields:ed[w.C.ContactDetails]},onSubmit:U,defaultValues:a.context.formData});case ee.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:eo[w.C.EligibilityUnmet]},onSubmit:U,loading:a.matches({[ee.EligibilityUnmet]:ee.Submitting}),isEmailSent:a.matches({[ee.EligibilityUnmet]:ee.Success}),hasError:a.matches({[ee.EligibilityUnmet]:ee.Error})});case ee.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:eo[w.C.InsuranceDetails],fields:ed[w.C.InsuranceDetails]},onSubmit:U,onBack:j});case ee.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:eo[w.C.InsuranceDetailsReview],fields:ed[w.C.InsuranceDetailsReview]},onSubmit:U,loading:a.matches({[ee.InsuranceDetailsReview]:ee.Submitting}),hasError:a.matches({[ee.InsuranceDetailsReview]:ee.Error}),defaultValues:a.context.formData});case ee.ApplicationComplete:return(0,i.jsx)(o.Q,{...eo[w.C.ApplicationComplete],email:a.context.formData.email});case ee.ApplicationDetected:return(0,i.jsx)(s.r,{...eo[w.C.ApplicationDetected],email:a.context.formData.email});case ee.ApplicationReview:return(0,i.jsx)(l.l,{...eo[w.C.ApplicationReview]});case ee.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:eo[w.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[ee.EmailVerification]:ee.Error}),loading:a.matches({[ee.EmailVerification]:ee.Submitting}),isUpdateEmailLoading:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Idle}}),hasUpdateEmailError:a.matches({[ee.EmailVerification]:{[ee.UpdateEmail]:ee.Error}}),onSubmit:U,onResendCode:e=>T({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>T({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ee.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:eo[w.C.OnboardingChecklist]},onSubmit:U});case ee.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:eo[w.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[ee.ReviewConsents]:ee.Error}),loading:a.matches({[ee.ReviewConsents]:ee.FetchConsents})||a.matches({[ee.ReviewConsents]:ee.Submitting})||a.matches({[ee.ReviewConsents]:ee.UpdateContact}),onSubmit:U});case ee.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eo[w.C.CreatePassword]},loading:a.matches({[ee.CreatePassword]:ee.Submitting}),error:a.context.error,onSubmit:U});case ee.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?eo[w.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?eo[w.C.AppDownload].titleLabSubmitted:eo[w.C.AppDownload].titleLabRequested,checklist:eo[w.C.AppDownload].checklist,image:(0,i.jsx)(r.Image,{m:"auto",mt:8,maxWidth:"300px",src:"/static/assets/app-download.png",alt:"app-download"})});case ee.OnboardingUserError:return(0,i.jsx)(x.C,{});case ee.RequestLabs:var e;return(0,i.jsx)(D.I,{organizationName:"ChristianaCare - Caregivers",patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>T({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>T({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case ee.SubmitLabs:return(0,i.jsx)(I.x,{onGoBackToRequestLabs:()=>T({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>T({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>T({type:"LAB_SUBMITTED"}),patientId:a.context.flyteUserData.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[M,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:S.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:eu})]}),(0,i.jsx)(d.nV,{currentStep:M})]}),body:k(),currentWorkFlowStep:M})}},53310:(e,t,a)=>{a.d(t,{A:()=>V});var i=a(37876),r=a(37477),n=a(48934),o=a(14901),s=a(16741),l=a(533),c=a(18681),d=a(63583),u=a(86535),m=a(47320),g=a(93511),p=a(34305),h=a(80072),b=a(97793),C=a(66885),x=a(3712),f=a(62227),D=a(14232),y=a(47353),I=a(33841),v=a(86687),E=a(89225),S=a(53795),w=a(65159),L=a(45352),P=a(39777),A=function(e){return e.CreateLead="createLead",e}(A||{});let R={...b.f,...A},T=E.Ek[I.fz.PyleFamilyInsurance],M={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0},U=(0,w.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t}}=e;return S.J0.pyleFamilyInsurance({bmi:t})},isApplicationDetected:v.L},actions:{updateFormData:(0,L.a)({formData:e=>{let{context:t,event:a}=e;return{...t.formData,...a.data}}}),assignBMI:(0,L.a)({bmi:e=>{let{context:t}=e,{heightInFoot:a,heightInInch:i,highestWeightInPounds:r}=t.formData;return(0,S.Hv)({heightFeet:(0,S.sC)(a),heightInches:(0,S.sC)(i),weightPounds:(0,S.sC)(r)})}}),reset:(0,L.a)({...M})}}).createMachine({context:()=>M,id:"pyleMachine",initial:R.PreEligibility,states:{[R.PreEligibility]:{id:R.PreEligibility,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{target:R.Submitting,actions:"updateFormData"}}},[R.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(R.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(R.EligibilityUnmet)}]}}},[R.ContactDetails]:{id:R.ContactDetails,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:R.Submitting}}},[R.Submitting]:{id:R.Submitting,initial:R.CreateLead,states:{[R.CreateLead]:{id:R.CreateLead,invoke:{src:(0,P.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:T,evolveOrganization:I.PM["A Duie Pyle"],leadStatus:I.XN.EligibleWaiting,insurance:E.Ft[I.fz.PyleFamilyInsurance],automateEvolveEnrollment:!1};return await (0,y.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(R.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(R.ApplicationDetected)},{target:"#".concat(R.Error)}]}}}},[R.Error]:{id:R.Error,on:{SUBMIT:{actions:"updateFormData",target:R.Submitting}}}}},[R.ApplicationReview]:{id:R.ApplicationReview},[R.ApplicationDetected]:{id:R.ApplicationDetected},[R.EligibilityUnmet]:{id:R.EligibilityUnmet,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{target:R.Submitting,actions:"updateFormData"}}},[R.Submitting]:{invoke:{src:(0,P.Sx)(async e=>{let{input:t}=e,a={...t,company:T,leadStatus:I.XN.Ineligible,ineligibilityReason:I.hT.BMI,automateEvolveEnrollment:!1,insurance:E.Ft[I.fz.PyleFamilyInsurance]};return await (0,y.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:R.Success,onError:R.Error}},[R.Success]:{},[R.Error]:{on:{SUBMIT:{target:R.Submitting}}}}}},on:{RESET:{target:"#".concat(R.PreEligibility),actions:"reset"}}});var j=a(69443);let k={[h.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your A-Duie Pyle benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[h.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[h.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself."})]})},[h.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]}),note:(0,i.jsx)(r.Text,{variant:"text-body-large-regular",color:"text-secondary",children:"There is a one-time $235 FlyteHealth program fee for eligible employees collected during scheduling. A portion of this fee ($150) will be reimbursed by A-Duie Pyle upon confirmation of eligibility and program start. Please contact Pyle HR for instructions on how to obtain this reimbursement."})},[h.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[h.C.OnboardingChecklist]:j.M[h.C.OnboardingChecklist],[h.C.CreatePassword]:j.M[h.C.CreatePassword],[h.C.AppDownload]:j.M[h.C.AppDownload],[h.C.ReviewConsents]:j.M[h.C.ReviewConsents]};var B=a(82393);let F=[p.UX.BenefitsWebsite,p.UX.CoworkerReferral,p.UX.ProviderReferral,p.UX.WordOfMouth,p.UX.Other],O={[h.C.ContactDetails]:{state:{options:B.rI},howDidYouFindUs:{options:F}}},N=new Map([[h.C.PreEligibility,l.n.get(h.C.PreEligibility)],[h.C.ContactDetails,l.n.get(h.C.ContactDetails)]]),_=p.fz.PyleFamilyInsurance,V=e=>{let{render:t}=e,[a,y]=(0,f.zl)(U);(0,m.F)((0,x.K)(_));let I=(0,D.useMemo)(()=>(0,C.r)(a.value),[a.value]);(0,g.t)(I,_);let v=(0,D.useCallback)(e=>{y({type:"SUBMIT",data:e})},[y]),E=(0,D.useCallback)(()=>{switch(I){case b.f.PreEligibility:return(0,i.jsx)(u.P,{configuration:{contentResources:k[h.C.PreEligibility]},onSubmit:v});case b.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:k[h.C.ContactDetails],fields:O[h.C.ContactDetails]},loading:a.matches({[b.f.ContactDetails]:b.f.Submitting}),onSubmit:v,defaultValues:a.context.formData});case b.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:k[h.C.EligibilityUnmet]},onSubmit:v,loading:a.matches({[b.f.EligibilityUnmet]:b.f.Submitting}),isEmailSent:a.matches({[b.f.EligibilityUnmet]:b.f.Success}),hasError:a.matches({[b.f.EligibilityUnmet]:b.f.Error})});case b.f.ApplicationReview:return(0,i.jsx)(o.l,{...k[h.C.ApplicationReview]});case b.f.ApplicationDetected:return(0,i.jsx)(n.r,{...k[h.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[I,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(s.E,{partner:p.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(s.E,{partner:_})]}),(0,i.jsx)(l.f,{currentStep:I,steps:N})]}),body:E(),currentWorkFlowStep:I})}},56931:(e,t,a)=>{a.d(t,{A:()=>ex});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(533),u=a(18681),m=a(39946),g=a(63583),p=a(53154),h=a(42037),b=a(70587),C=a(11427),x=a(86535),f=a(43483),D=a(47320),y=a(93511),I=a(34305),v=a(80072),E=a(66885),S=a(3712),w=a(62227),L=a(14232);Object.values(I.lk).filter(e=>e!==I.lk.SelfPay);var P=a(82393),A=a(45383),R=a(19847),T=a(88992),M=a(76692),U=a(43400),j=a(82492);let k="insuranceMemberID",B=(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Your Unique ID is your ten-digit Benefit Funds’ Member ID Number. For Eligible dependents, use the guidance below:"}),F=e=>{let{label:t="1199SEIU Unique ID",placeholder:a="Unique ID Number",description:n=B,tooltip:o,type:s,maxLength:l,minLength:c,maskOptions:d,inputMode:u,registerOptions:m,isDisabled:g=!1,isRequired:p=!0,...h}=e,{setValue:b,register:C,formState:{errors:x}}=(0,T.xW)(),f=(0,j.Q)(k,x,["minLength","maxLength","pattern"]);return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-2",...h,children:[(0,i.jsxs)(r.Box,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-2",alignItems:"center",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:k,children:t}),o&&(0,i.jsx)(r.Tooltip,{label:o,placement:"auto-end",children:(0,i.jsx)(r.Flex,{children:(0,i.jsx)(r.IconInfoCircle,{size:"m",color:"text-link-primary-default"})})})]}),n]}),(0,i.jsx)(U.I,{"data-test":k,id:k,isInvalid:f,isDisabled:g,placeholder:a,type:s,inputMode:u,maxLength:l,minLength:c,maskOptions:d,onInput:e=>{let t=e.currentTarget.value,a=!c||c&&t.length>=c;b(k,t,{shouldValidate:a})},...C(k,{required:p,...m})}),(0,i.jsxs)(r.Text,{variant:"text-body-regular",fontSize:12,color:"text-secondary",children:[(0,i.jsx)("b",{children:"- For Spouse:"})," ","member’s ID number + first nine characters of spouse’s first name + S."," ",(0,i.jsx)("br",{}),"Example: 1234567890JohnathonS",(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"- For Child (18 or older)"}),": member’s ID number + first nine characters of dependent’s first name + D. Example: 1234567890MariaD"]}),f&&(0,i.jsx)(P.gO,{errors:x,name:k})]})},O=e=>{let{configuration:t,loading:a=!1,onSubmit:n,onBack:o}=e,{contentResources:s,fields:l}=t,c=(0,T.mN)({mode:"onBlur"}),d=(0,R.a)(),u=c.watch(M.uQ)===I.RS.SelfPay,m=c.watch(M.ag)===I.lk.Other;(0,L.useEffect)(()=>{u&&(c.resetField(M.ag),c.resetField(M.JB))},[u,c]),(0,L.useEffect)(()=>{c.resetField(M.E6)},[c.watch(M.ag),c]);let g=()=>(0,i.jsxs)(r.Flex,{gap:{base:"spacer-8",md:"spacer-16"},alignItems:"center",flex:{base:1,lg:"unset"},children:[(0,i.jsx)(r.Button,{size:{base:"m",lg:"l"},isLoading:a,variant:"link","aria-label":"Back",leadingIcon:(0,i.jsx)(r.IconArrowLeft,{}),onClick:o,children:"Back"}),(0,i.jsx)(r.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!c.formState.isValid,flex:1,isLoading:a,trailingIcon:(0,i.jsx)(r.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"})]});return(0,i.jsx)(T.Op,{...c,children:(0,i.jsxs)(A.X,{as:"form",onSubmit:c.handleSubmit(n),noValidate:!0,children:[(0,i.jsx)(A.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(A.X.Form,{children:[(null==l?void 0:l.insuranceCoverage)&&(0,i.jsx)(M.Xq,{isDisabled:a}),(null==l?void 0:l.insurance)&&(0,i.jsx)(M._8,{isDisabled:a||u,isRequired:!u,...null==l?void 0:l.insurance},u.toString()),m&&(0,i.jsx)(M.jP,{isDisabled:a,...null==l?void 0:l.insuranceOther}),(0,i.jsx)(F,{isDisabled:a||u,isRequired:!u,pb:{base:"spacer-24",lg:0},...null==l?void 0:l.insuranceMemberID}),d?(0,i.jsx)(P.cI,{children:g()}):g()]})]})})};var N=a(11969),_=a(10758),V=a(85007),H=a(31346),X=a(38360),z=a(39648),W=a(77944),q=a(47353),Y=a(83928),K=a(33841),G=a(13751),Q=a(92323),J=a(86687),$=a(89225),Z=a(97793),ee=a(53795),et=a(38088),ea=a(65159),ei=a(39777),er=a(45352),en=a(63826);let eo=e=>e===en.w.FULL_MATCH||e===en.w.ELIGIBLE_MATCH||e===en.w.PERSON_MATCH;var es=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.CheckEligibility="checkEligibility",e}(es||{});let el={...Z.f,...es},ec=$.Ek[K.fz["1199SEIU"]],ed={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",ssn:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",termsAgreement:!1,howDidYouFindUS:"",diabetes:"",bariatricSurgery:"",comorbidities:[""]},eligibilityCheckMatchType:void 0,matchingRecord:void 0,bmi:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0},eu={...G.AU,...G.gQ,...G.pE,...G.UH,...G.yF,...G.n6,...G.uN,...G.yS,...G.RW,...(0,G.rS)(ed).reset},em=(0,ea.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return ee.J0["1199SEIU"]({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!Y.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&!eo(t)},isApplicationDetected:J.L,isAthenaRecordCreated:Q.z},actions:eu}).createMachine({context:()=>ed,id:"SEIUMachine",initial:el.PreEligibility,states:{[el.PreEligibility]:{id:el.PreEligibility,initial:el.Idle,states:{[el.Idle]:{on:{SUBMIT:{target:el.Submitting,actions:"updateFormData"}}},[el.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(el.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(el.EligibilityUnmet)}]}}},[el.ContactDetails]:{id:el.ContactDetails,initial:el.Idle,states:{[el.Idle]:{on:{SUBMIT:{target:"#".concat(el.InsuranceDetails),actions:"updateFormData"}}}}},[el.InsuranceDetails]:{id:el.InsuranceDetails,initial:el.Idle,states:{[el.Idle]:{on:{BACK:{target:"#".concat(el.ContactDetails)},SUBMIT:{target:"#".concat(el.InsuranceDetailsReview),actions:"updateFormData"}}}}},[el.InsuranceDetailsReview]:{id:el.InsuranceDetailsReview,initial:el.Idle,states:{[el.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:el.Submitting}}},[el.Submitting]:{id:el.Submitting,initial:el.CheckEligibility,states:{[el.CheckEligibility]:{id:el.CheckEligibility,invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a={...t,insurance:$.w[K.fz["1199SEIU"]],benefitProgram:$.Nl[K.fz["1199SEIU"]]};return await (0,z.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,er.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType},matchingRecord:e=>{let{event:t}=e;return t.output.data.matchingRecord}}),target:"#".concat(el.DetermineContactOrLead)}],onError:"#".concat(el.InsuranceDetailsReview,".").concat(el.Error)}},[el.DetermineContactOrLead]:{id:el.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:el.CreateLead},{target:el.CreateContact}]},[el.CreateContact]:{id:el.CreateContact,invoke:{src:(0,ei.Sx)(async e=>{var t;let{input:a}=e,i=null==(t=a.matchingRecord)?void 0:t.accountName,r={...a.formData,employmentVerificationCode:a.formData.insuranceMemberID,eligibilityVerifiedBy:K.h9.Evolve,insuranceMemberID:a.formData.insuranceMemberID,company:ec,insurance:$.Ft[K.fz["1199SEIU"]],evolveOrganization:K.PM["1199SEIU"],accountId:$.f3[K.fz["1199SEIU"]],...i&&{participantDepartmentorOrg:i}};return await (0,X.vY)(r)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(el.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(el.ApplicationDetected)},{target:"#".concat(el.InsuranceDetailsReview,".").concat(el.Error)}]}},[el.CreateLead]:{id:el.CreateLead,invoke:{src:(0,ei.Sx)(async e=>{var t;let{input:a}=e,i=null==(t=a.matchingRecord)?void 0:t.accountName,r={...a.formData,employmentVerificationCode:a.formData.insuranceMemberID,insuranceMemberID:a.formData.insuranceMemberID,company:ec,insurance:$.Ft[K.fz["1199SEIU"]],evolveOrganization:K.PM["1199SEIU"],leadStatus:(e=>{switch(e){case en.w.INSURANCE_MATCH:case en.w.EXPIRED:case en.w.NOT_FOUND:return I.XN.EligibleWaiting;case en.w.PERSON_MATCH:case en.w.FULL_MATCH:case en.w.ELIGIBLE_MATCH:default:return}})(a.eligibilityCheckMatchType),automateEvolveEnrollment:eo(a.eligibilityCheckMatchType),...i&&{participantDepartmentorOrg:i}};return await (0,q.t)(r)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(el.ApplicationReview)},{target:"#".concat(el.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(el.ApplicationDetected)},{target:"#".concat(el.InsuranceDetailsReview,".").concat(el.Error)}]}}}},[el.Error]:{id:"".concat(el.InsuranceDetailsReview,".").concat(el.Error),on:{SUBMIT:{actions:"updateFormData",target:el.Submitting}}}}},[el.EmailVerification]:{id:el.EmailVerification,initial:el.Idle,states:{[el.Idle]:{id:"".concat(el.EmailVerification,".").concat(el.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:el.Submitting},RESEND_EMAIL_VERIFICATION:{target:el.Idle,reenter:!0},UPDATE_EMAIL:{target:el.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,ei.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,_.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,er.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:el.Error}},[el.Submitting]:{invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,V.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(el.OnboardingChecklist),onError:el.Error}},[el.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:el.Submitting},RESEND_EMAIL_VERIFICATION:{target:el.Idle},UPDATE_EMAIL:{target:el.UpdateEmail}}},[el.UpdateEmail]:{initial:el.Idle,states:{[el.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,ei.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,X.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(el.EmailVerification,".").concat(el.Idle)},onError:el.Error}},[el.Error]:{on:{SUBMIT:{target:"#".concat(el.EmailVerification,".").concat(el.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(el.EmailVerification,".").concat(el.Idle)},UPDATE_EMAIL:{target:el.Idle}}}}}}},[el.ReviewConsents]:{id:el.ReviewConsents,initial:el.FetchConsents,states:{[el.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:el.Submitting}}},[el.FetchConsents]:{invoke:{src:(0,ei.Sx)(async()=>await (0,H.i)()),onDone:{actions:"assignConsents",target:el.Idle},onError:el.Error}},[el.Submitting]:{invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,et.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:K.PM["1199SEIU"],consents:t.consentsData.userConsentStatus,programName:r};return await (0,W.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:el.UpdateContact}],onError:"#".concat(el.OnboardingUserError)}},[el.UpdateContact]:{invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,X.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(el.CreatePassword)},{target:"#".concat(el.OnboardingUserError)}],onError:"#".concat(el.OnboardingUserError)}},[el.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:el.Submitting}}}}},[el.CreatePassword]:{id:el.CreatePassword,initial:el.Idle,states:{[el.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:el.Submitting}}},[el.Submitting]:{invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,N.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(el.AppDownload),onError:{target:el.Error,actions:"assignError"}}},[el.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:el.Submitting}}}}},[el.OnboardingChecklist]:{id:el.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(el.ReviewConsents)}}},[el.AppDownload]:{id:el.AppDownload},[el.ApplicationReview]:{id:el.ApplicationReview},[el.OnboardingUserError]:{id:el.OnboardingUserError},[el.ApplicationComplete]:{id:el.ApplicationComplete},[el.ApplicationDetected]:{id:el.ApplicationDetected},[el.EligibilityUnmet]:{id:el.EligibilityUnmet,initial:el.Idle,states:{[el.Idle]:{on:{SUBMIT:{target:el.Submitting,actions:"updateFormData"}}},[el.Submitting]:{invoke:{src:(0,ei.Sx)(async e=>{let{input:t}=e,a={...t,company:ec,leadStatus:K.XN.Ineligible,ineligibilityReason:K.hT.BMI,automateEvolveEnrollment:!1};return await (0,q.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:el.Success,onError:el.Error}},[el.Success]:{},[el.Error]:{on:{SUBMIT:{target:el.Submitting}}}}}},on:{RESET:{target:"#".concat(el.PreEligibility),actions:"reset"}}});var eg=a(69443);let ep={[v.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through the 1199SEIU Benefit Funds, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[v.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[v.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Next, tell us about yourself"}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["To help match your information with the 1199SEIU Health Benefits Plan, we need to verify a few personal details.",(0,i.jsx)("br",{})," ",(0,i.jsx)("br",{}),"Be sure to have your member ID card handy for the next step."]})]})},[v.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Do you have health insurance?"})]})},[v.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[v.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[v.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[v.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[v.C.EmailVerification]:eg.M[v.C.EmailVerification],[v.C.OnboardingChecklist]:eg.M[v.C.OnboardingChecklist],[v.C.CreatePassword]:eg.M[v.C.CreatePassword],[v.C.AppDownload]:eg.M[v.C.AppDownload],[v.C.ReviewConsents]:eg.M[v.C.ReviewConsents]},eh=[I.UX.BenefitsWebsite,I.UX.CoworkerReferral,I.UX.PrescriptionDenial,I.UX.ProviderReferral,I.UX.WordOfMouth,I.UX.Other],eb={[v.C.ContactDetails]:{state:{options:P.rI},howDidYouFindUs:{options:eh}},[v.C.InsuranceDetails]:{insuranceMemberID:{}},[v.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},eC=I.fz["1199SEIU"],ex=e=>{let{render:t}=e,[a,P]=(0,w.zl)(em);(0,D.F)((0,S.K)(eC));let A=(0,L.useMemo)(()=>(0,E.r)(a.value),[a.value]);(0,y.t)(A);let R=(0,L.useCallback)(e=>{P({type:"SUBMIT",data:e})},[P]),T=(0,L.useCallback)(()=>{P({type:"BACK"})},[P]),M=(0,L.useCallback)(()=>{switch(A){case el.PreEligibility:return(0,i.jsx)(x.P,{configuration:{contentResources:ep[v.C.PreEligibility]},onSubmit:R});case el.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:ep[v.C.ContactDetails],fields:eb[v.C.ContactDetails]},onSubmit:R,defaultValues:a.context.formData});case el.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:ep[v.C.EligibilityUnmet]},onSubmit:R,loading:a.matches({[el.EligibilityUnmet]:el.Submitting}),isEmailSent:a.matches({[el.EligibilityUnmet]:el.Success}),hasError:a.matches({[el.EligibilityUnmet]:el.Error})});case el.InsuranceDetails:return(0,i.jsx)(O,{configuration:{contentResources:ep[v.C.InsuranceDetails],fields:eb[v.C.InsuranceDetails]},onSubmit:R,onBack:T});case el.InsuranceDetailsReview:return(0,i.jsx)(h.h,{configuration:{contentResources:ep[v.C.InsuranceDetailsReview],fields:eb[v.C.InsuranceDetailsReview]},onSubmit:R,loading:a.matches({[el.InsuranceDetailsReview]:el.Submitting}),hasError:a.matches({[el.InsuranceDetailsReview]:el.Error}),defaultValues:a.context.formData});case el.ApplicationComplete:return(0,i.jsx)(o.Q,{...ep[v.C.ApplicationComplete],email:a.context.formData.email});case el.ApplicationDetected:return(0,i.jsx)(s.r,{...ep[v.C.ApplicationDetected],email:a.context.formData.email});case el.ApplicationReview:return(0,i.jsx)(l.l,{...ep[v.C.ApplicationReview]});case el.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:ep[v.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[el.EmailVerification]:el.Error}),loading:a.matches({[el.EmailVerification]:el.Submitting}),isUpdateEmailLoading:a.matches({[el.EmailVerification]:{[el.UpdateEmail]:el.Idle}}),hasUpdateEmailError:a.matches({[el.EmailVerification]:{[el.UpdateEmail]:el.Error}}),onSubmit:R,onResendCode:e=>P({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>P({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case el.OnboardingChecklist:return(0,i.jsx)(b.E,{configuration:{contentResources:ep[v.C.OnboardingChecklist]},onSubmit:R});case el.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:ep[v.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[el.ReviewConsents]:el.Error}),loading:a.matches({[el.ReviewConsents]:el.FetchConsents})||a.matches({[el.ReviewConsents]:el.Submitting})||a.matches({[el.ReviewConsents]:el.UpdateContact}),onSubmit:R});case el.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:ep[v.C.CreatePassword]},loading:a.matches({[el.CreatePassword]:el.Submitting}),error:a.context.error,onSubmit:R});case el.AppDownload:return(0,i.jsx)(n.a,{title:ep[v.C.AppDownload].title,checklist:ep[v.C.AppDownload].checklist});case el.OnboardingUserError:return(0,i.jsx)(C.C,{});default:return null}},[A,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:I.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:I.fz["1199SEIU"]})]}),(0,i.jsx)(d.f,{currentStep:A})]}),body:M(),currentWorkFlowStep:A})}},77944:(e,t,a)=>{a.d(t,{Y:()=>i.Y});var i=a(87665)},92261:(e,t,a)=>{a.d(t,{q:()=>eA});var i=a(37876),r=a(59004),n=a(91366),o=a(48934),s=a(14901),l=a(16741),c=a(533),d=a(39946),u=a(63583),m=a(53154),g=a(30435),p=a(42037),h=a(70587),b=a(11427),C=a(86535),x=a(43483),f=a(47320),D=a(93511),y=a(34305),I=a(80072),v=a(66885),E=a(3712),S=a(62227),w=a(14232),L=a(37477),P=a(82393),A=a(45383),R=a(84441),T=a(15986),M=a(48496),U=a(19847),j=a(88992),k=function(e){return e.NotReferred="Not referred",e.AccessHealthcare="Access Healthcare, PC",e.AnandKanjolia="Anand Kanjolia, MD, LLC",e.AnneMarieVilla="Anne Marie Villa, MD, PC",e.ArthurSkalski="Arthur H Skalski, MD Internal Medicine FACSG LLC",e.AvantaClinic="Avanta Clinic, LLC",e.ComprehensiveMedicalGroup="Comprehensive Medical Group, LLC",e.ConnecticutValleyPediatricCenter="Connecticut Valley Pediatric Center, Inc",e.DushyantParikh="Dushyant Parikh, MD",e.EastGranbyFamilyPractice="East Granby Family Practice, LLC",e.EileenComia="Eileen C Comia, MD, LLC",e.EllenMarmer="Ellen L Marmer, MD",e.FeelWellHealthCenter="Feel Well Health Center of Southington, PC dba Confidia Health Institute",e.HRobertSilverstein="H Robert Silverstein MD, FACC, PC",e.IvelisseViruet="Ivelisse Viruet, MD Internal Medicine, LLC",e.JamesHainesAndWilliamBelcastro="James Haines, MD & William Belcastro, MD",e.JudithMascolo="Judith M Mascolo, MD, LLC",e.JulieSacharko="Julie Sacharko, APRN LLC",e.KaiserPermanente="Kaiser Permanente",e.MahmoodYekta="Mahmood Yekta, MD, PC dba Shafa Medical Clinic",e.MeadowsHealthCenter="Meadows Health Center, PC",e.MobileCarePartners="Mobile Care Partners of Connecticut, PLLC",e.MouliAssociates="Mouli Associates LLC",e.OksanaKloyzner="Oksana Kloyzner, MD, LLC",e.OliverDiaz="Oliver B Diaz, MD",e.PeiSun="Pei Sun MD, LLC",e.PersonalPrimaryCare="Personal Primary Care and Weight Management LLC",e.PreferredHealthcareAssociates="Preferred Healthcare Associates, Inc",e.PrimaryPhysicalMedicine="Primary Physical Medicine, LLC",e.QuinonesMedicalGroup="Quinones Medical Group, LLC",e.RamirezMedicalPractice="Ramirez Medical Practice, PLLC",e.ReviveCenterForHealth="REVIVE Center for Health & Wellness, PLLC",e.RobertCarlson="Robert D Carlson, MD, LLC",e.RockyHillMedicalCenter="Rocky Hill Medical Center, LLC",e.RoyKellerman="Roy A Kellerman, MD, LLC",e.SoNEHealthMedicalGroup="SoNE Health Medical Group, PLLC",e.SuffieldMedicalAssociates="Suffield Medical Associates",e.WarrenPediatrics="Warren Pediatrics, LLC",e.WinstedInternalMedicine="Winsted Internal Medicine Associates",e.YounusMasih="Younus Masih, MD",e.Other="Other",e}({});let B="referralProgram",F=Object.values(k),O=e=>{let{options:t=F,isRequired:a,isDisabled:r,defaultSelectedItem:n,placeholder:o}=e,{watch:s,control:l}=(0,j.xW)(),[c,d]=(0,w.useState)(""),u=c?t.filter(e=>e.toLowerCase().includes(c.toLowerCase())):t;return(0,i.jsxs)(L.Flex,{direction:"column",gap:"spacer-2",children:[(0,i.jsxs)(L.Box,{children:[(0,i.jsx)(L.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:B,children:"Were you referred to FlyteHealth?"}),(0,i.jsx)(L.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"If yes, select the healthcare organization, clinic, or provider."})]}),(0,i.jsx)(j.xI,{control:l,name:B,rules:{required:a},render:e=>{let{field:{onChange:t,onBlur:a}}=e;return(0,i.jsxs)(L.Autocomplete,{id:"".concat(B,"-autocomplete"),items:u,onInputValueChange:e=>{let{inputValue:a}=e;d(a||""),a||t(a)},onSelectedItemChange:e=>{let{selectedItem:a}=e;return t(a)},initialSelectedItem:n,selectedItem:s(B)||"",children:[(0,i.jsx)(L.Autocomplete.Input,{"data-test":B,id:B,size:"l",placeholder:o,clearButtonMode:r?"never":"has-value",leadingIcon:(0,i.jsx)(L.IconSearch,{}),variant:"flushed",isDisabled:r,onBlur:a}),(0,i.jsx)(L.Autocomplete.List,{"data-test":"".concat(B,"List"),zIndex:2,renderItem:e=>(0,i.jsx)(L.Text,{variant:"text-body-regular",children:e}),overflowY:"auto",maxHeight:"13.5rem"})]})}})]})},N=[y.yj.California,y.yj.Connecticut,y.yj.Massachusetts,y.yj["New York"],y.yj["Rhode Island"],y.yj["New Hampshire"],y.yj.Vermont],_=[y.yj.California,y.yj.Colorado,y.yj.Oregon,y.yj.Georgia,y.yj.Hawaii,y.yj.Maryland,y.yj.Virginia,y.yj.Washington,y.yj["Washington D.C."]],V=e=>{let{configuration:t,loading:a=!1,onSubmit:r,defaultValues:n}=e,{contentResources:o,fields:s}=t,l=(0,j.mN)({mode:"onBlur",defaultValues:n,shouldUnregister:!1}),c=(0,w.useRef)(null==n?void 0:n.state),d=(0,w.useRef)(null==n?void 0:n.referralProgram),{watch:u}=l,m=(0,U.a)(),g=u(M.b),p=u(B),h=g&&(N.includes(g)||_.includes(g)),b=!g||a||!h,C=g&&!h?"There are no organizations or clinics in your state":"Select referral location",x=!!p,f=!g||a||h&&!x,D=h&&!x,y="Not referred"===p||""===p?s.howDidYouFindUs.options.notReferrerOptions:s.howDidYouFindUs.options.referrerOptions;(0,w.useEffect)(()=>{p!==d.current&&(l.resetField(T.l,{defaultValue:""}),d.current=p)},[p,l]),(0,w.useEffect)(()=>{g!==c.current&&(l.resetField(B,{defaultValue:""}),l.resetField(T.l,{defaultValue:""}),c.current=g)},[g,l]);let I=()=>(0,i.jsx)(L.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!l.formState.isValid,width:"100%",isLoading:a,trailingIcon:(0,i.jsx)(L.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"});return(0,i.jsx)(j.Op,{...l,children:(0,i.jsxs)(A.X,{as:"form",onSubmit:l.handleSubmit(r),noValidate:!0,children:[(0,i.jsx)(A.X.Side,{gap:0,flex:{base:"none",lg:1},children:o.title}),(0,i.jsxs)(A.X.Form,{children:[(0,i.jsx)(P.d5,{isDisabled:a}),(0,i.jsx)(P.LP,{inputProps:{isDisabled:a}}),(0,i.jsxs)(L.Flex,{direction:{base:"column",lg:"row"},gap:"spacer-9",children:[(0,i.jsx)(R.PV,{isDisabled:a,flex:1}),(null==s?void 0:s.state)&&(0,i.jsx)(M.X,{isDisabled:a,flex:1,options:s.state.options})]}),(0,i.jsx)(O,{isDisabled:b,isRequired:D,placeholder:C,options:_.includes(g)?[k.KaiserPermanente]:Object.values(k).filter(e=>e!==k.KaiserPermanente&&e!==k.Other&&e!==k.NotReferred)}),(0,i.jsx)(T.h,{isDisabled:f,options:y}),(0,i.jsx)(R.Ci,{isDisabled:a,pb:{base:"spacer-24",lg:0}}),m?(0,i.jsx)(P.cI,{children:I()}):I()]})]})})};var H=a(11969),X=a(10758),z=a(85007),W=a(20411),q=a(31346),Y=a(38360),K=a(77944),G=a(12342);let Q=async e=>{let t=(e=>{let t={bariatricSurgery:2200,diabetes:2199,comorbidities:2201};return{answers:{[t.bariatricSurgery]:{order:1,answer:e.bariatricSurgery},[t.diabetes]:{order:2,answer:e.diabetes},[t.comorbidities]:{order:3,answer:e.comorbidities}},status:"completed",percentage:100,patientId:e.patientId,slug:"screener-questionnaire"}})(e);return await G.A.post("/api/hra-questionnaire",t)};var J=a(47353),$=a(83928),Z=a(33841),ee=a(13751),et=a(92323),ea=a(86687),ei=a(89225),er=a(97793),en=a(53795),eo=a(38088),es=a(65159),el=a(39777),ec=a(45352),ed=a(99221);let eu=e=>e===k.KaiserPermanente?y.PM["Kaiser Permanente"]:y.PM["SoNE Health"],em=(e,t)=>{if(e===k.KaiserPermanente)return t},eg=(e,t)=>{switch(e){case y.lk["1199SEIU"]:return!0;case y.lk.Aetna:case y.lk.Cigna:return[y.yj["New York"],y.yj["New Jersey"],y.yj.Connecticut].includes(t);case y.lk.BCBS:case y.lk.United:return t===y.yj["New York"];case y.lk.BCBSPPO:case y.lk.Other:case y.lk["Kaiser Colorado"]:case y.lk["Kaiser Georgia"]:case y.lk["Kaiser Hawaii"]:case y.lk["Kaiser MidAtlantic"]:case y.lk["Kaiser Northern California"]:case y.lk["Kaiser Northwest"]:case y.lk["Kaiser Southern California"]:case y.lk["Kaiser Washington"]:case y.lk["Kaiser Washington Options"]:default:return!1}},ep=e=>{let{bmi:t,comorbidity:a,insurance:i,insuranceCoverage:r,state:n}=e;return(!(t>=27)||!(t<=30)||a!==ed.Y9.Yes)&&r!==y.RS.SelfPay&&eg(i,n)},eh=e=>{let{insurance:t,insuranceCoverage:a}=e;return a===y.RS.SelfPay?y.lk.SelfPay:t};var eb=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineBenefitsOrLead="determineBenefitsOrLead",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.SubmitHRA="submitHRA",e}(eb||{});let eC={...er.f,...eb},ex=ei.Ek[Z.fz.Flyte],ef={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insuranceOther:void 0,insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",referralProgram:void 0,comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0},eD={...ee.AU,...ee.gQ,...ee.pE,...ee.UH,...ee.yF,...ee.n6,...ee.uN,...ee.yS,...ee.RW,...(0,ee.rS)(ef)},ey=(0,es.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return en.J0.flyte({bmi:a,comorbidity:t.comorbidity})},isApplicationReviewRequired:e=>{let{context:{formData:t,bmi:a}}=e;return!$.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!ep({bmi:a,comorbidity:t.comorbidity,insuranceCoverage:t.insuranceCoverage,insurance:t.insurance,state:t.state})},isApplicationDetected:ea.L,isInsurerSelected:e=>{let{context:{formData:t}}=e;return!!t.insurance&&t.insurance!==Z.lk.Other},isAthenaRecordCreated:et.z},actions:eD}).createMachine({context:()=>ef,id:"flyteMachine",initial:eC.PreEligibility,states:{[eC.PreEligibility]:{id:eC.PreEligibility,initial:eC.Idle,states:{[eC.Idle]:{on:{SUBMIT:{target:eC.Submitting,actions:"updateFormData"}}},[eC.Submitting]:{entry:"assignBMI",always:[{guard:"isPreEligibilityMet",target:"#".concat(eC.ContactDetails)},{target:"#".concat(eC.EligibilityUnmet)}]}}},[eC.ContactDetails]:{id:eC.ContactDetails,initial:eC.Idle,states:{[eC.Idle]:{on:{SUBMIT:{target:"#".concat(eC.InsuranceDetails),actions:"updateFormData"}}}}},[eC.InsuranceDetails]:{id:eC.InsuranceDetails,initial:eC.Idle,states:{[eC.Idle]:{on:{BACK:{target:"#".concat(eC.ContactDetails)},SUBMIT:{target:"#".concat(eC.InsuranceDetailsReview),actions:"updateFormData"}}}}},[eC.InsuranceDetailsReview]:{id:eC.InsuranceDetailsReview,initial:eC.Idle,states:{[eC.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:eC.Submitting}}},[eC.Submitting]:{initial:eC.DetermineBenefitsOrLead,states:{[eC.DetermineBenefitsOrLead]:{id:eC.DetermineBenefitsOrLead,always:[{guard:"isInsurerSelected",target:eC.CheckBenefits},{target:eC.CreateLead}]},[eC.CheckBenefits]:{id:eC.CheckBenefits,invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:ei.dT[t.insurance]};return await (0,W.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,ec.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:eC.DetermineContactOrLead},onError:eC.DetermineContactOrLead}},[eC.DetermineContactOrLead]:{id:eC.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:eC.CreateLead},{target:eC.CreateContact}]},[eC.CreateContact]:{id:eC.CreateContact,invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:ex,insurance:eh({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:eu(t.formData.referralProgram),participantDepartmentorOrg:em(t.formData.referralProgram,t.formData.insurance),accountId:ei.f3[Z.fz.Flyte]};return await (0,Y.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(eC.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(eC.ApplicationDetected)},{target:"#".concat(eC.InsuranceDetailsReview,".").concat(eC.Error)}]}},[eC.CreateLead]:{id:eC.CreateLead,invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:ex,insurance:eh({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:eu(t.formData.referralProgram),ineligibilityReason:(e=>{let{insuranceCoverage:t,insurance:a,state:i}=e;return t===y.RS.SelfPay?y.hT.CashPay:eg(a,i)?void 0:y.hT.Insurance})({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),leadStatus:(e=>{let{bmi:t,comorbidity:a,insuranceCoverage:i,insurance:r,state:n}=e;if(!ep({bmi:t,comorbidity:a,insurance:r,insuranceCoverage:i,state:n}))return y.XN.EligibleWaiting})({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),automateEvolveEnrollment:ep({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),participantDepartmentorOrg:em(t.formData.referralProgram,t.formData.insurance)};return await (0,J.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(eC.ApplicationReview)},{target:"#".concat(eC.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(eC.ApplicationDetected)},{target:"#".concat(eC.InsuranceDetailsReview,".").concat(eC.Error)}]}}}},[eC.Error]:{id:"".concat(eC.InsuranceDetailsReview,".").concat(eC.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:eC.Submitting}}}}},[eC.EmailVerification]:{id:eC.EmailVerification,initial:eC.Idle,states:{[eC.Idle]:{id:"".concat(eC.EmailVerification,".").concat(eC.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:eC.Submitting},RESEND_EMAIL_VERIFICATION:{target:eC.Idle,reenter:!0},UPDATE_EMAIL:{target:eC.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,el.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,X.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,ec.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:eC.Error}},[eC.Submitting]:{invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,z.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eC.OnboardingChecklist),onError:eC.Error}},[eC.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:eC.Submitting},RESEND_EMAIL_VERIFICATION:{target:eC.Idle},UPDATE_EMAIL:{target:eC.UpdateEmail}}},[eC.UpdateEmail]:{initial:eC.Idle,states:{[eC.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,el.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,Y.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(eC.EmailVerification,".").concat(eC.Idle)},onError:eC.Error}},[eC.Error]:{on:{SUBMIT:{target:"#".concat(eC.EmailVerification,".").concat(eC.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(eC.EmailVerification,".").concat(eC.Idle)},UPDATE_EMAIL:{target:eC.Idle}}}}}}},[eC.ReviewConsents]:{id:eC.ReviewConsents,initial:eC.FetchConsents,states:{[eC.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eC.Submitting}}},[eC.FetchConsents]:{invoke:{src:(0,el.Sx)(async()=>await (0,q.i)()),onDone:{actions:"assignConsents",target:eC.Idle},onError:eC.Error}},[eC.Submitting]:{invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,eo.C)(a,i),n={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:Z.PM.Flyte,consents:t.consentsData.userConsentStatus,programName:r};return await (0,K.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:eC.SubmitHRA}],onError:"#".concat(eC.OnboardingUserError)}},[eC.SubmitHRA]:{id:eC.SubmitHRA,invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={bariatricSurgery:t.formData.bariatricSurgery,diabetes:t.formData.diabetes,comorbidities:t.formData.comorbidities,patientId:t.flyteUserData.patientId};return await Q(a)}),input:e=>{let{context:t}=e;return t},onDone:{target:eC.UpdateContact},onError:{target:eC.UpdateContact}}},[eC.UpdateContact]:{invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,Y.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(eC.CreatePassword)},{target:"#".concat(eC.OnboardingUserError)}],onError:"#".concat(eC.OnboardingUserError)}},[eC.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eC.Submitting}}}}},[eC.CreatePassword]:{id:eC.CreatePassword,initial:eC.Idle,states:{[eC.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:eC.Submitting}}},[eC.Submitting]:{invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,H.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eC.AppDownload),onError:{target:eC.Error,actions:"assignError"}}},[eC.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:eC.Submitting}}}}},[eC.OnboardingChecklist]:{id:eC.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(eC.ReviewConsents)}}},[eC.AppDownload]:{id:eC.AppDownload},[eC.ApplicationReview]:{id:eC.ApplicationReview},[eC.OnboardingUserError]:{id:eC.OnboardingUserError},[eC.ApplicationComplete]:{id:eC.ApplicationComplete},[eC.ApplicationDetected]:{id:eC.ApplicationDetected},[eC.EligibilityUnmet]:{id:eC.EligibilityUnmet,initial:eC.Idle,states:{[eC.Idle]:{on:{SUBMIT:{target:eC.Submitting,actions:"updateFormData"}}},[eC.Submitting]:{invoke:{src:(0,el.Sx)(async e=>{let{input:t}=e,a={...t,company:ei.Ek[Z.fz.Flyte],leadStatus:Z.XN.Ineligible,ineligibilityReason:Z.hT.BMI,automateEvolveEnrollment:!1};return await (0,J.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:eC.Success,onError:eC.Error}},[eC.Success]:{},[eC.Error]:{on:{SUBMIT:{target:eC.Submitting}}}}}},on:{RESET:{target:"#".concat(eC.PreEligibility),actions:"reset"}}});var eI=a(69443);let ev={[I.C.PreEligibility]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(L.TextPairing.Label,{color:"text-secondary-negative",children:["We're so glad you're here!"," ",(0,i.jsx)(L.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Let's make sure you're eligible for FlyteHealth."})]}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"You must meet specific age and Body Mass Index (BMI) requirements* to be eligible for the FlyteHealth program."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(L.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[I.C.EligibilityUnmet]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(L.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"FlyteHealth requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+"})]})},[I.C.ContactDetails]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(L.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"Tell us a little more about yourself."})]})},[I.C.InsuranceDetails]:{title:(0,i.jsxs)(L.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(L.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Do you have health insurance?"})]})},[I.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(L.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[I.C.ApplicationComplete]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(L.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(L.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[I.C.ApplicationReview]:{title:(0,i.jsxs)(L.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(L.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(L.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[I.C.ApplicationDetected]:{title:(0,i.jsx)(L.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(L.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[I.C.EmailVerification]:eI.M[I.C.EmailVerification],[I.C.OnboardingChecklist]:eI.M[I.C.OnboardingChecklist],[I.C.CreatePassword]:eI.M[I.C.CreatePassword],[I.C.AppDownload]:eI.M[I.C.AppDownload],[I.C.ReviewConsents]:eI.M[I.C.ReviewConsents]},eE=[y.lk["1199SEIU"],y.lk.Aetna,y.lk.BCBS,y.lk.BCBSPPO,y.lk.Cigna,y.lk["Kaiser Colorado"],y.lk["Kaiser Georgia"],y.lk["Kaiser Hawaii"],y.lk["Kaiser MidAtlantic"],y.lk["Kaiser Northern California"],y.lk["Kaiser Northwest"],y.lk["Kaiser Southern California"],y.lk["Kaiser Washington"],y.lk["Kaiser Washington Options"],y.lk.United,y.lk.Other],eS=[y.UX.Brochure,y.UX.Email,y.UX.Mailer,y.UX.OnsiteMonitor,y.UX.Poster,y.UX.ProviderReferral,y.UX.Other],ew=[y.UX.Brochure,y.UX.CoworkerReferral,y.UX.Email,y.UX.GoogleAd,y.UX.Poster,y.UX.PrintAd,y.UX.ProviderReferral,y.UX.SocialMedia,y.UX.TradeShow,y.UX.TVAd,y.UX.WebSearch,y.UX.WordOfMouth,y.UX.Other],eL={[I.C.ContactDetails]:{state:{options:P.rI},howDidYouFindUs:{options:{referrerOptions:eS,notReferrerOptions:ew}}},[I.C.InsuranceDetails]:{insuranceCoverage:{},insurance:{label:"Insurance Company",insuranceCarriers:eE},insuranceOther:{description:(0,i.jsx)(L.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Enter the name of your insurance company"})},insuranceMemberID:{}},[I.C.InsuranceDetailsReview]:{insurance:{label:"Insurance Company",insuranceCarriers:eE}}},eP=y.fz.Flyte,eA=e=>{let{render:t}=e,[a,y]=(0,S.zl)(ey);(0,f.F)((0,E.K)(eP));let L=(0,w.useMemo)(()=>(0,v.r)(a.value),[a.value]);(0,D.t)(L,eP);let P=(0,w.useCallback)(e=>{y({type:"SUBMIT",data:e})},[y]),A=(0,w.useCallback)(()=>{y({type:"BACK"})},[y]),R=(0,w.useCallback)(()=>{switch(L){case eC.PreEligibility:return(0,i.jsx)(C.P,{configuration:{contentResources:ev[I.C.PreEligibility]},onSubmit:P});case eC.ContactDetails:return(0,i.jsx)(V,{configuration:{contentResources:ev[I.C.ContactDetails],fields:eL[I.C.ContactDetails]},onSubmit:P,defaultValues:a.context.formData});case eC.EligibilityUnmet:return(0,i.jsx)(u.B,{configuration:{contentResources:ev[I.C.EligibilityUnmet]},onSubmit:P,loading:a.matches({[eC.EligibilityUnmet]:eC.Submitting}),isEmailSent:a.matches({[eC.EligibilityUnmet]:eC.Success}),hasError:a.matches({[eC.EligibilityUnmet]:eC.Error})});case eC.InsuranceDetails:return(0,i.jsx)(g.d,{configuration:{contentResources:ev[I.C.InsuranceDetails],fields:eL[I.C.InsuranceDetails]},onSubmit:P,onBack:A});case eC.InsuranceDetailsReview:return(0,i.jsx)(p.h,{configuration:{contentResources:ev[I.C.InsuranceDetailsReview],fields:eL[I.C.InsuranceDetailsReview]},onSubmit:P,loading:a.matches({[eC.InsuranceDetailsReview]:eC.Submitting}),hasError:a.matches({[eC.InsuranceDetailsReview]:eC.Error}),defaultValues:a.context.formData});case eC.ApplicationComplete:return(0,i.jsx)(n.Q,{...ev[I.C.ApplicationComplete],email:a.context.formData.email});case eC.ApplicationReview:return(0,i.jsx)(s.l,{...ev[I.C.ApplicationReview]});case eC.ApplicationDetected:return(0,i.jsx)(o.r,{...ev[I.C.ApplicationDetected],email:a.context.formData.email});case eC.EmailVerification:return(0,i.jsx)(m.e,{configuration:{contentResources:{title:ev[I.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[eC.EmailVerification]:eC.Error}),loading:a.matches({[eC.EmailVerification]:eC.Submitting}),isUpdateEmailLoading:a.matches({[eC.EmailVerification]:{[eC.UpdateEmail]:eC.Idle}}),hasUpdateEmailError:a.matches({[eC.EmailVerification]:{[eC.UpdateEmail]:eC.Error}}),onSubmit:P,onResendCode:e=>y({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>y({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case eC.OnboardingChecklist:return(0,i.jsx)(h.E,{configuration:{contentResources:ev[I.C.OnboardingChecklist]},onSubmit:P});case eC.ReviewConsents:return(0,i.jsx)(x.U,{configuration:{contentResources:ev[I.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[eC.ReviewConsents]:eC.Error}),loading:a.matches({[eC.ReviewConsents]:eC.FetchConsents})||a.matches({[eC.ReviewConsents]:eC.Submitting})||a.matches({[eC.ReviewConsents]:eC.UpdateContact})||a.matches({[eC.ReviewConsents]:eC.SubmitHRA}),onSubmit:P});case eC.CreatePassword:return(0,i.jsx)(d.i,{configuration:{contentResources:ev[I.C.CreatePassword]},loading:a.matches({[eC.CreatePassword]:eC.Submitting}),error:a.context.error,onSubmit:P});case eC.AppDownload:return(0,i.jsx)(r.a,{title:ev[I.C.AppDownload].title,checklist:ev[I.C.AppDownload].checklist});case eC.OnboardingUserError:return(0,i.jsx)(b.C,{});default:return null}},[L,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.E,{partner:eP}),(0,i.jsx)(c.f,{currentStep:L})]}),body:R(),currentWorkFlowStep:L})}},92749:(e,t,a)=>{a.d(t,{s:()=>n});var i=a(16741),r=a(34305);let n={[r.fz.CareCompass]:{asset:{src:i.k[r.fz.CareCompass],width:"64px",height:"64px",alt:"Care Compass Logo"},name:"Care Compass",description:"State of Connecticut Health Plan Members"},[r.fz.Aetna]:{asset:{src:i.k[r.fz.Aetna],width:"141px",height:"32px",alt:"Aetna Logo"},name:"State of Connecticut: Aetna",description:"Aetna MA for State of Connecticut Retirees"},[r.fz.PequotHealthCare]:{asset:{src:i.k[r.fz.PequotHealthCare],width:"103px",height:"40px",alt:"Pequot Health Care Logo"},name:"Mashantucket Pequot Tribal Nation",description:"Pequot Healthy Weight Program"},[r.fz.RiverSpringLiving]:{asset:{src:i.k[r.fz.RiverSpringLiving],width:"158px",height:"24px",alt:"RiverSpring Living Logo"},name:"RiverSpring Living Employee Program",description:"Employees at The Hebrew Home at Riverdale by RiverSpring Living"},[r.fz.PyleFamilyInsurance]:{asset:{src:i.k[r.fz.PyleFamilyInsurance],width:"157px",height:"48px",alt:"Pyle Family Insurance Logo"},name:"A. Duie Pyle",description:"Pyle Weight Management Program for Employees"},[r.fz.MDSave]:{asset:{src:i.k[r.fz.MDSave],width:"56px",height:"56px",alt:"MDsave Logo"},name:"MDsave",description:"Patients in partnership with MDsave"},[r.fz["1199SEIU"]]:{asset:{src:i.k[r.fz["1199SEIU"]],width:"211px",height:"122px",alt:"1199SEIU Logo"},name:"1199SEIU",description:"1199SEIU"}}},96079:(e,t,a)=>{a.d(t,{Y:()=>V});var i=a(37876),r=a(37477),n=a(48934),o=a(14901),s=a(16741),l=a(533),c=a(18681),d=a(63583),u=a(86535),m=a(47320),g=a(93511),p=a(34305),h=a(80072),b=a(97793),C=a(66885),x=a(3712),f=a(62227),D=a(14232),y=a(47353),I=a(33841),v=a(86687),E=a(89225),S=a(53795),w=a(65159),L=a(45352),P=a(39777),A=function(e){return e.CreateLead="createLead",e}(A||{});let R={...b.f,...A},T=E.Ek[I.fz.MDSave],M={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0},U=(0,w.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t,formData:a}}=e;return S.J0.mdSave({bmi:t,comorbidity:a.comorbidity})},isApplicationDetected:v.L},actions:{updateFormData:(0,L.a)({formData:e=>{let{context:t,event:a}=e;return{...t.formData,...a.data}}}),assignBMI:(0,L.a)({bmi:e=>{let{context:t}=e,{heightInFoot:a,heightInInch:i,highestWeightInPounds:r}=t.formData;return(0,S.Hv)({heightFeet:(0,S.sC)(a),heightInches:(0,S.sC)(i),weightPounds:(0,S.sC)(r)})}}),reset:(0,L.a)({...M})}}).createMachine({context:()=>M,id:"mdSaveMachine",initial:R.PreEligibility,states:{[R.PreEligibility]:{id:R.PreEligibility,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{target:R.Submitting,actions:"updateFormData"}}},[R.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(R.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(R.EligibilityUnmet)}]}}},[R.ContactDetails]:{id:R.ContactDetails,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:R.Submitting}}},[R.Submitting]:{id:R.Submitting,initial:R.CreateLead,states:{[R.CreateLead]:{id:R.CreateLead,invoke:{src:(0,P.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:T,evolveOrganization:I.PM.MDsave,leadStatus:I.XN.EligibleWaiting,automateEvolveEnrollment:!1};return await (0,y.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(R.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(R.ApplicationDetected)},{target:"#".concat(R.Error)}]}}}},[R.Error]:{id:R.Error,on:{SUBMIT:{actions:"updateFormData",target:R.Submitting}}}}},[R.ApplicationReview]:{id:R.ApplicationReview},[R.ApplicationDetected]:{id:R.ApplicationDetected},[R.EligibilityUnmet]:{id:R.EligibilityUnmet,initial:R.Idle,states:{[R.Idle]:{on:{SUBMIT:{target:R.Submitting,actions:"updateFormData"}}},[R.Submitting]:{invoke:{src:(0,P.Sx)(async e=>{let{input:t}=e,a={...t,company:T,leadStatus:I.XN.Ineligible,ineligibilityReason:I.hT.BMI,automateEvolveEnrollment:!1};return await (0,y.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:R.Success,onError:R.Error}},[R.Success]:{},[R.Error]:{on:{SUBMIT:{target:R.Submitting}}}}}},on:{RESET:{target:"#".concat(R.PreEligibility),actions:"reset"}}});var j=a(69443);let k={[h.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your MDsave benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[h.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[h.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself."})]})},[h.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[h.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[h.C.OnboardingChecklist]:j.M[h.C.OnboardingChecklist],[h.C.CreatePassword]:j.M[h.C.CreatePassword],[h.C.AppDownload]:j.M[h.C.AppDownload],[h.C.ReviewConsents]:j.M[h.C.ReviewConsents]};var B=a(82393);let F=[p.UX.WordOfMouth,p.UX.Other],O={[h.C.ContactDetails]:{state:{options:B.rI},howDidYouFindUs:{options:F}}},N=new Map([[h.C.PreEligibility,l.n.get(h.C.PreEligibility)],[h.C.ContactDetails,l.n.get(h.C.ContactDetails)]]),_=p.fz.MDSave,V=e=>{let{render:t}=e,[a,y]=(0,f.zl)(U);(0,m.F)((0,x.K)(_));let I=(0,D.useMemo)(()=>(0,C.r)(a.value),[a.value]);(0,g.t)(I,_);let v=(0,D.useCallback)(e=>{y({type:"SUBMIT",data:e})},[y]),E=(0,D.useCallback)(()=>{switch(I){case b.f.PreEligibility:return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Alert,{variant:"subtle",status:"warning",borderRadius:"none",justifyContent:"center",children:[(0,i.jsx)(r.Alert.Icon,{}),(0,i.jsxs)(r.Alert.Title,{children:["To continue, you must first purchase the MDsave FlyteHealth bundle. To purchase, click"," ",(0,i.jsx)(r.Link,{isExternal:!0,href:"https://www.mdsave.com/p/flyte-weight-loss-and-nutritional-counseling",fontWeight:"bold",children:"here"}),"."]})]}),(0,i.jsx)(u.P,{configuration:{contentResources:k[h.C.PreEligibility]},onSubmit:v})]});case b.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:k[h.C.ContactDetails],fields:O[h.C.ContactDetails]},loading:a.matches({[b.f.ContactDetails]:b.f.Submitting}),onSubmit:v,defaultValues:a.context.formData});case b.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:k[h.C.EligibilityUnmet]},onSubmit:v,loading:a.matches({[b.f.EligibilityUnmet]:b.f.Submitting}),isEmailSent:a.matches({[b.f.EligibilityUnmet]:b.f.Success}),hasError:a.matches({[b.f.EligibilityUnmet]:b.f.Error})});case b.f.ApplicationReview:return(0,i.jsx)(o.l,{...k[h.C.ApplicationReview]});case b.f.ApplicationDetected:return(0,i.jsx)(n.r,{...k[h.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[I,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(s.E,{partner:p.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(s.E,{partner:_})]}),(0,i.jsx)(l.f,{currentStep:I,steps:N})]}),body:E(),currentWorkFlowStep:I})}}}]);