PageSourceSearch

https://www.glowdiet.com/_next/static/chunks/pages/glp1/intake-6e7674933ac2abd1.js

js glowdiet.com collected 2026-10-09 16:55:33 UTC 48,374 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7943],{4992:(e,i,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/glp1/intake",function(){return n(5340)}])},5340:(e,i,n)=>{"use strict";n.r(i),n.d(i,{default:()=>Y});var t=n(4848),o=n(4853),r=n(6540),l=n(6715),d=n(3540),a=n(1557),s=n(1930),c=n(9590),p=n(7488);let u=["tirzepatide","semaglutide"],h=["odt","injectable"],m=["BM3","BM1","BM0"],g=["personal","questions","bodyPhoto","preparingRecommendation","recommendation","medicationDrug","medicationForm","medicationDose","shipping","photo","address","review"],_=["medicationDrug","medicationForm","medicationDose","shipping","questions","review"],v={personal:"About you",questions:"Health",bodyPhoto:"Photo",preparingRecommendation:"Recommendation",recommendation:"Recommendation",medicationDrug:"Medication",medicationForm:"Format",medicationDose:"Dose",shipping:"Shipping",photo:"Identity",address:"Address",review:"Review",notEligible:"Eligibility"},x=[["AL","Alabama"],["AK","Alaska"],["AZ","Arizona"],["AR","Arkansas"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DE","Delaware"],["FL","Florida"],["GA","Georgia"],["HI","Hawaii"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["IA","Iowa"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["ME","Maine"],["MD","Maryland"],["MA","Massachusetts"],["MI","Michigan"],["MN","Minnesota"],["MS","Mississippi"],["MO","Missouri"],["MT","Montana"],["NE","Nebraska"],["NV","Nevada"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NY","New York"],["NC","North Carolina"],["ND","North Dakota"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VT","Vermont"],["VA","Virginia"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"]],f={firstName:"",lastName:"",email:"",dob:"",gender:""},b={address_1:"",address_2:"",city:"",region:"",postalcode:"",country:"US"},w=new Set(["consultation_pending","prescribed","shipped","delivered","denied","logistics_issue"]),y={funnelVersion:2,currentStep:"personal",flow:"new",answers:{},currentQuestionIdx:0,updatedAt:new Date().toISOString()},j=e=>{var i;return(null===(i=e.code)||void 0===i?void 0:i.trim().toLowerCase())==="full_body_photo"},I=d.Ay.div.withConfig({componentId:"sc-5786a707-0"})(["display:flex;justify-content:space-between;gap:16px;margin-bottom:10px;color:",";font-size:12px;font-weight:650;"],p.w.colors.gray[500]),k=d.Ay.label.withConfig({componentId:"sc-5786a707-1"})(["display:flex;align-items:flex-start;gap:12px;margin-top:24px;padding:16px;border:1px solid ",";border-radius:14px;color:",";font-size:14px;line-height:1.5;cursor:pointer;input{width:18px;height:18px;margin-top:2px;accent-color:",";}"],p.w.colors.gray[200],p.w.colors.gray[700],p.w.colors.primary[500]),C=d.Ay.div.withConfig({componentId:"sc-5786a707-2"})(["margin-top:24px;padding-top:22px;border-top:1px solid ",";h3{margin:0 0 10px;font-size:15px;}p{margin:4px 0;color:",";font-size:14px;line-height:1.5;}"],p.w.colors.gray[200],p.w.colors.gray[600]),S=d.Ay.div.withConfig({componentId:"sc-5786a707-3"})(["margin-top:24px;padding:22px;border:1.5px solid ",";border-radius:20px;background:",";h3{margin:0;font-size:22px;}p{margin:7px 0 0;color:",";font-size:14px;line-height:1.5;}"],p.w.colors.primary[300],p.w.colors.primary[100],p.w.colors.gray[600]),M=d.Ay.strong.withConfig({componentId:"sc-5786a707-4"})(["display:block;margin-top:18px;font-size:20px;"]),N=d.Ay.label.withConfig({componentId:"sc-5786a707-5"})(["display:grid;grid-template-columns:22px 1fr auto;gap:13px;align-items:start;margin-top:24px;padding:18px;border:1.5px solid ",";border-radius:18px;background:",";cursor:pointer;input{width:19px;height:19px;margin-top:2px;accent-color:",";}strong,span{display:block;}span{margin-top:5px;color:",";font-size:13px;line-height:1.45;}"],p.w.colors.green[300],p.w.colors.green[100],p.w.colors.green[800],p.w.colors.gray[600]),D=d.Ay.div.withConfig({componentId:"sc-5786a707-6"})(["margin-top:24px;padding:28px 20px;border:1.5px dashed ",";border-radius:18px;background:",";text-align:center;"],p.w.colors.primary[300],p.w.colors.primary[100]),A=d.Ay.div.withConfig({componentId:"sc-5786a707-7"})(["display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px;"]),q=d.Ay.label.withConfig({componentId:"sc-5786a707-8"})(["display:inline-flex;min-height:48px;align-items:center;justify-content:center;padding:12px 14px;border:1px solid ",";border-radius:999px;background:",";color:",";font-size:14px;font-weight:600;cursor:pointer;input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;}"],p.w.colors.gray[200],p.w.colors.white,p.w.colors.primary[700]),P=d.Ay.img.withConfig({componentId:"sc-5786a707-9"})(["display:block;width:100%;max-height:320px;margin-top:18px;border-radius:16px;object-fit:contain;background:",";"],p.w.colors.gray[100]),R=d.Ay.div.withConfig({componentId:"sc-5786a707-10"})(["display:flex;align-items:center;justify-content:space-between;gap:16px;button{border:0;background:transparent;color:",";font:inherit;font-size:13px;font-weight:600;cursor:pointer;}"],p.w.colors.primary[600]),B=d.Ay.div.withConfig({componentId:"sc-5786a707-11"})(["display:grid;place-items:center;min-height:420px;color:",";font-size:15px;"],p.w.colors.gray[600]);function U(e){let i=(e||"").toLowerCase().trim();return["multiple_choice","multi_choice","multi_select","multi","checkbox","checkboxes"].includes(i)?"multiple":["free_text","text","textarea","long_text","short_text","string"].includes(i)?"text":["numeric","number","integer","decimal"].includes(i)?"number":["date","datepicker"].includes(i)?"date":["file_upload","file","image","image_upload","photo"].includes(i)?"file":"radio"}function $(e){let i=(e.label||"").trim().toLowerCase();return e.is_exclusive||"none"===i||"none of the above"===i||i.startsWith("none of the")}function E(e){var i,n;if(e.code)return e.code.toUpperCase();let t=Number(null!==(n=null!==(i=e.cadence_months)&&void 0!==i?i:e.interval_count)&&void 0!==n?n:-1);return 0===t?"BM0":1===t?"BM1":3===t?"BM3":""}function T(e){let i=/^(\d{2})\/(\d{2})\/(\d{4})$/.exec(e);if(!i)return!1;let n=new Date(Number(i[3]),Number(i[1])-1,Number(i[2])),t=Math.floor((Date.now()-n.getTime())/315576e5);return t>=18&&t<=100}function K(e,i){if(e)return Number(((12*e+(i||0))*2.54).toFixed(1))}function F(e,i){var n;let t={...e};if(null===(n=t.medication)||void 0===n?void 0:n.doseId){let e=i.medications_flat.find(e=>{var i,n;return e.lockebio_medication_dose_id===(null===(i=t.medication)||void 0===i?void 0:i.doseId)||e.pricing_id===(null===(n=t.medication)||void 0===n?void 0:n.pricingId)});(null==e?void 0:e.lockebio_medication_dose_id)?t.medication={drug:e.drug,form:e.format,pricingId:e.pricing_id,doseId:e.lockebio_medication_dose_id,productName:e.product_name,dosage:e.dosage,price1moCents:e.price_1mo_cents,price3moCents:e.price_3mo_cents}:t={...t,medication:void 0,shipping:void 0,currentStep:"medicationDrug"}}if(t.shipping){let e=i.billing_models.find(e=>{var i,n;return e.billing_model_id===(null===(i=t.shipping)||void 0===i?void 0:i.billingModelId)||!!(null===(n=t.shipping)||void 0===n?void 0:n.billingModelCode)&&E(e)===t.shipping.billingModelCode});e?t.shipping={billingModelId:e.billing_model_id,billingModelCode:E(e),billingModelName:e.name}:t={...t,shipping:void 0,currentStep:"shipping"}}return t}function O(){var e,i,n,o,d,p,O,Y,L,G,Q,z,W,J,H,Z,V,X,ee,ei,en,et,eo,er,el,ed;let ea=(0,l.useRouter)(),[es,ec]=(0,r.useState)(y),[ep,eu]=(0,r.useState)(null),[eh,em]=(0,r.useState)(null),[eg,e_]=(0,r.useState)(!1),[ev,ex]=(0,r.useState)(!1),[ef,eb]=(0,r.useState)(!0),[ew,ey]=(0,r.useState)(!1),[ej,eI]=(0,r.useState)(""),[ek,eC]=(0,r.useState)(null),[eS,eM]=(0,r.useState)(""),[eN,eD]=(0,r.useState)({}),[eA,eq]=(0,r.useState)(""),eP=(0,r.useRef)(!1),eR=(0,r.useMemo)(()=>
1s.Yk.getSession(),[]),eB="renewal"===ea.query.flow?"renewal":"new",eU=(0,r.useMemo)(()=>((null==ep?void 0:ep.questions)||[]).slice().sort((e,i)=>{var n,t;return(null!==(n=e.order_number)&&void 0!==n?n:0)-(null!==(t=i.order_number)&&void 0!==t?t:0)}),[ep]),e$=(0,r.useMemo)(()=>eU.filter(e=>!j(e)),[eU]),eE=(0,r.useMemo)(()=>eU.filter(j),[eU]),eT="bodyPhoto"===es.currentStep?eE:"renewal"===es.flow?eU:e$,eK=eT[es.currentQuestionIdx],eF=(0,r.useMemo)(()=>{let e="renewal"===es.flow?_:g;return eg&&"new"===es.flow?e.filter(e=>"personal"!==e):e},[es.flow,eg]),eO=Math.max(0,eF.indexOf(es.currentStep)),eY=Math.max(0,("renewal"===es.flow?eU:e$).length-1),eL="new"===es.flow?Math.max(0,eE.length-1):0,eG=eF.indexOf("questions"),eQ=eF.indexOf("bodyPhoto"),ez="questions"===es.currentStep?eG+es.currentQuestionIdx+1:"bodyPhoto"===es.currentStep?eQ+eY+es.currentQuestionIdx+1:eQ>=0&&eO>eQ?eO+eY+eL+1:eO>eG?eO+eY+1:eO+1,eW=eF.length+eY+eL,eJ=ez/Math.max(1,eW)*100,eH=(0,r.useMemo)(()=>ep&&"new"===es.flow?function(e){let i=u.flatMap(e=>h.map(i=>({drug:e,form:i}))).map(i=>{let{drug:n,form:t}=i;return e.medications_flat.filter(e=>e.drug===n&&e.format===t&&!!e.lockebio_medication_dose_id).slice().sort((e,i)=>e.display_order-i.display_order)[0]}).find(Boolean);if(!(null==i?void 0:i.lockebio_medication_dose_id))return{status:"no_recommendation"};let n=m.map(n=>{if("BM3"===n&&!i.price_3mo_cents)return null;let t=e.billing_models.find(e=>(function(e){var i,n,t;let o=null===(i=e.code)||void 0===i?void 0:i.toUpperCase();if("BM0"===o||"BM1"===o||"BM3"===o)return o;let r=Number(null!==(t=null!==(n=e.cadence_months)&&void 0!==n?n:e.interval_count)&&void 0!==t?t:-1);return 0===r?"BM0":1===r?"BM1":3===r?"BM3":null})(e)===n);return t?{model:t,code:n}:null}).find(Boolean);if(!n)return{status:"no_recommendation"};let t="BM3"===n.code?i.price_3mo_cents:i.price_1mo_cents;if(!t||i.price_1mo_cents<=0)return{status:"no_recommendation"};let o="BM3"===n.code?Math.round(t/3):t,r="BM3"===n.code?Math.max(0,3*i.price_1mo_cents-t):0;return{status:"ready",option:{medication:{drug:i.drug,form:i.format,pricingId:i.pricing_id,doseId:i.lockebio_medication_dose_id,productName:i.product_name,dosage:i.dosage,price1moCents:i.price_1mo_cents,price3moCents:i.price_3mo_cents},shipping:{billingModelId:n.model.billing_model_id,billingModelCode:n.code,billingModelName:n.model.name},recommendationKey:[i.drug,i.format,i.pricing_id,n.code].join(":"),amountDueCents:t,monthlyEquivalentCents:o,savingsVsMonthlyCents:r}}}(ep):null,[ep,es.flow]),eZ=(0,r.useCallback)(e=>{ec(i=>{let n={...e(i),updatedAt:new Date().toISOString()};return s.Yk.setDraft(n),n})},[]);if((0,r.useEffect)(()=>{if(!ea.isReady)return;if(!eR){ea.replace("/glp1/start");return}let e=!1;return(async()=>{try{var i,n,t,o,r,l,d,a,p,u,h,m;let[g,_,v,x]=await Promise.all([s.ng.getConfig(eR.token,eB),s.ng.getCurrentUser(eR.token),s.ng.getStatus(eR.token),s.ng.getCoachingOffer(eR.token).catch(()=>null)]);if(e)return;if("new"===eB&&w.has(v.overallStatus)){(0,c.I)("web_glp1_existing_patient_handoff",{status:v.overallStatus}),await ea.replace("/glp1/app");return}let b=_.locke_bio_user_info,j=_.app_onboarding_data,I=!!_.onboarding_complete;if("new"===eB&&"registered"===v.overallStatus&&(null==b?void 0:b.intake_submitted_at)){let e=await s.ng.reconcileCheckout(eR.token);if(e.completed){(0,c.I)("web_glp1_existing_patient_handoff",{status:e.overall_status}),await ea.replace("/glp1/app");return}let i=await s.ng.createCheckoutSession(eR.token);s.Yk.setPendingCheckout({url:i.url,expiresAt:i.expires_at,createdAt:new Date().toISOString()}),(0,c.I)("web_glp1_checkout_resumed",{is_resume:!0}),await ea.replace("/glp1/payment-pending");return}let k=s.Yk.getDraft(),C=(null==k?void 0:k.flow)===eB&&2===k.funnelVersion?k:null,S={...y,...C||{},flow:eB,currentStep:(null==C?void 0:C.currentStep)||("renewal"===eB?"medicationDrug":"personal"),journeyInstanceId:(null==C?void 0:C.journeyInstanceId)||crypto.randomUUID(),usesExistingAppProfile:I},M=!!(null==b?void 0:b.user_id);if("renewal"===eB&&!M)throw Error("A previous GLP-1 intake is required before a refill.");if(M&&"new"===eB&&"personal"===S.currentStep&&(S.currentStep="questions"),b)(i=S).personal||(i.personal={firstName:b.first_name||"",lastName:b.last_name||"",email:b.email||"",dob:b.dob||"",gender:b.gender||"",ethnicity:b.ethnicity,heightCm:b.height_cm,weightKg:b.weight_kg}),b.address&&((n=S).address||(n.address=b.address)),b.photo_id_uploaded&&(S.photoIdUploaded=!0);else if(I){let e=(null==j?void 0:j.sex)==="male"?"Male":(null==j?void 0:j.sex)==="female"?"Female":"Not_known";S.personal={...S.personal||f,firstName:(null===(t=S.personal)||void 0===t?void 0:t.firstName)||_.name||(null==j?void 0:j.firstName)||"",lastName:(null===(o=S.personal)||void 0===o?void 0:o.lastName)||_.last_name||(null==j?void 0:j.lastName)||"",email:(null===(r=S.personal)||void 0===r?void 0:r.email)||_.email||"",dob:(null===(l=S.personal)||void 0===l?void 0:l.dob)||"",gender:(null===(d=S.personal)||void 0===d?void 0:d.gender)||e,ethnicity:null===(a=S.personal)||void 0===a?void 0:a.ethnicity,heightCm:(null===(p=S.personal)||void 0===p?void 0:p.heightCm)||(null==j?void 0:null===(u=j.height)||void 0===u?void 0:u.value),weightKg:(null===(h=S.personal)||void 0===h?void 0:h.weightKg)||(null==j?void 0:null===(m=j.weight)||void 0===m?void 0:m.value)},"body"===S.personalSubStep&&(S.personalSubStep="name_gender")}let N=JSON.stringify({medication:S.medication,shipping:S.shipping});if(S=F(S,g),N!==JSON.stringify({medication:S.medication,shipping:S.shipping})&&(0,c.I)("web_glp1_selection_repaired",{result:S.medication?"repaired":"reset"}),"questions"===S.currentStep&&!S.intakeId){let e=await s.ng.ensureIntake(eR.token,eB);S.intakeId=e.intake_id}e_(M),ex(I),eu(g),em(x),ec(S),s.Yk.setDraft(S),(0,c.I)(C?"web_glp1_intake_resumed":"web_glp1_intake_started",{is_resume:!!C,flow:eB})}catch(e){eI(e instanceof Error?e.message:"We could not load the intake.")}finally{e||eb(!1)}})(),()=>{e=!0}},[eB,ea,eR]),(0,r.useEffect)(()=>
1{if("preparingRecommendation"!==es.currentStep)return;let e=window.setTimeout(()=>{eZ(e=>({...e,currentStep:"recommendation"}))},1e3);return()=>window.clearTimeout(e)},[es.currentStep,eZ]),(0,r.useEffect)(()=>{ef||(0,c.I)("web_glp1_step_viewed",{step:es.currentStep,step_index:ez,flow:es.flow,...("questions"===es.currentStep||"bodyPhoto"===es.currentStep)&&{question_index:es.currentQuestionIdx,question_count:eT.length}})},[es.currentQuestionIdx,es.currentStep,es.flow,ef,ez,eT.length]),(0,r.useEffect)(()=>{ef||"personal"!==es.currentStep||(0,c.I)("web_glp1_personal_step_viewed",{personal_step:es.personalSubStep||"name_gender"})},[es.currentStep,es.personalSubStep,ef]),(0,r.useEffect)(()=>{ef||"review"!==es.currentStep||eP.current||null==eh||!eh.eligible||eh.already_subscribed||null===eh.price_cents||(eP.current=!0,(0,c.I)("web_glp1_coaching_offer_viewed",{flow:es.flow,subscription_plan:eh.plan_type}))},[eh,es.currentStep,es.flow,ef]),!eR||ef)return(0,t.jsx)(B,{children:"Preparing your secure intake…"});let eV=e=>{eI(""),eZ(i=>({...i,currentStep:e}))},eX=()=>{let e=eF.indexOf(es.currentStep),i=eF[e+1];i&&((0,c.I)("web_glp1_step_completed",{step:es.currentStep,step_index:ez}),eV(i))},e0=()=>{if((0,c.I)("web_glp1_back_clicked",{step:es.currentStep}),"recommendation"===es.currentStep){eV("bodyPhoto");return}if("photo"===es.currentStep&&"guided"===es.selectionPath){eV("recommendation");return}let e=eF.indexOf(es.currentStep),i=eF[e-1];i&&eV(i)},e1=async(e,i)=>{ey(!0),eI("");try{await e()}catch(e){eI(e instanceof Error?e.message:"We could not complete that request."),(0,c.I)("web_glp1_intake_failed",{error_type:i})}finally{ey(!1)}},e3=async()=>{var e,i;if(!es.personal||(e=es.personal,i=!ev,!(e.firstName.trim()&&e.lastName.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.email)&&T(e.dob))||!e.gender||!e.ethnicity||i&&(!e.heightCm||!(e.heightCm>=100)||!(e.heightCm<=250)||!e.weightKg||!(e.weightKg>=30)||!(e.weightKg<=350)))){eI("Complete every field. Date of birth must be MM/DD/YYYY and age 18+."),(0,c.I)("web_glp1_validation_failed",{step:"personal"});return}await e1(async()=>{await s.ng.createPatient(eR.token,es.personal),(0,c.I)("web_glp1_patient_profile_ready",{result:eg?"reused":"created"}),e_(!0);let e=await s.ng.ensureIntake(eR.token,es.flow);eZ(i=>({...i,intakeId:e.intake_id,currentQuestionIdx:0,currentStep:"questions"}))},"create_patient")},e2=async()=>{await e1(async()=>{let e=await s.ng.ensureIntake(eR.token,es.flow);eZ(i=>({...i,intakeId:e.intake_id,currentQuestionIdx:0,currentStep:"questions"}))},"ensure_intake")},e5=async()=>{var e;if(!es.address||!((e=es.address).address_1.trim()&&e.city.trim()&&e.region&&/^\d{5}(-\d{4})?$/.test(e.postalcode))){eI("Enter a complete US shipping address."),(0,c.I)("web_glp1_validation_failed",{step:"address"});return}await e1(async()=>{await s.ng.saveAddress(eR.token,es.address),eX()},"save_address")},e7=async()=>{if(es.photoIdUploaded){eX();return}if(!ek){eI("Choose a clear photo of your government-issued ID.");return}if(!ek.type.startsWith("image/")||ek.size>0xa00000){eI("Upload a JPG or PNG image smaller than 10 MB.");return}await e1(async()=>{await s.ng.uploadPhotoId(eR.token,ek),eZ(e=>({...e,photoIdUploaded:!0})),(0,c.I)("web_glp1_photo_uploaded",{step:"photo"}),eX()},"upload_id")},e6=e=>{var i;let n=(null===(i=e.target.files)||void 0===i?void 0:i[0])||null;if(e.target.value="",n){if(!n.type.startsWith("image/")||n.size>0xa00000){eI("Upload a JPG, PNG, or HEIC image smaller than 10 MB.");return}eS&&URL.revokeObjectURL(eS),eC(n),eM(URL.createObjectURL(n)),eI(""),(0,c.I)("web_glp1_photo_selected",{step:"photo"})}},e8=async()=>{var e,i;if(!(null===(e=es.medication)||void 0===e?void 0:e.doseId)||!(null===(i=es.shipping)||void 0===i?void 0:i.billingModelId)){eI("Choose a medication dose and shipping plan.");return}if(!es.consentAgreed){eI("Confirm that the information is accurate before continuing.");return}await e1(async()=>{var e,i,n,t;let o=await s.ng.getConfig(eR.token,es.flow);eu(o);let r=F(es,o);if(!(null===(e=r.medication)||void 0===e?void 0:e.doseId))throw eZ(e=>({...e,medication:void 0,shipping:void 0,currentStep:"medicationDrug"})),Error("That treatment option is no longer available. Choose a current option to continue.");if(!(null===(i=r.shipping)||void 0===i?void 0:i.billingModelId))throw eZ(e=>({...e,shipping:void 0,currentStep:"shipping"})),Error("That shipping plan changed. Choose a current plan to continue.");if(eZ(()=>r),(0,c.I)("web_glp1_price_revalidated",{result:r.medication.doseId===(null===(n=es.medication)||void 0===n?void 0:n.doseId)&&r.shipping.billingModelId===(null===(t=es.shipping)||void 0===t?void 0:t.billingModelId)?"current":"repaired",billing_code:r.shipping.billingModelCode}),await s.ng.submitIntake(eR.token,{medication_dose_id:r.medication.doseId,billing_model_id:r.shipping.billingModelId,billing_model_code:r.shipping.billingModelCode,answers:Object.values(es.answers).map(e=>({question_id:e.questionId,options:e.options,answer:e.answer,additional_answer:e.additionalAnswer,file:e.filePath})),flow:es.flow}),(0,c.I)("web_glp1_intake_submitted",{medication_drug:r.medication.drug,medication_form:r.medication.form,billing_code:r.shipping.billingModelCode}),es.includeGlowCoaching&&(null==eh?void 0:eh.eligible)&&!eh.already_subscribed){(0,c.I)("web_glp1_coaching_checkout_started",{subscription_plan:eh.plan_type});let e=await s.ng.createCoachingCheckout(eR.token);if(!e.already_subscribed&&e.checkoutUrl){window.location.assign(e.checkoutUrl);return}}let l=await s.ng.createCheckoutSession(eR.token,{medication_dose_id:r.medication.doseId,billing_model_id:r.shipping.billingModelId});(0,c.I)("web_glp1_checkout_created"),s.Yk.setPendingCheckout({url:l.url,createdAt:new Date().toISOString()}),(0,c.I)("web_glp1_checkout_ready"),await ea.push("/glp1/payment-pending")},"checkout")},e4=function(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Continue";return(0,t.jsxs)(t.Fragment,{children:[ej&&(0,t.jsx)(a.$T,{$error:!0,children:ej}),(0,t.jsxs)(a.En,{children:[(eF.indexOf(es.currentStep)>0||"recommendation"===es.currentStep)&&(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:e0,disabled:ew,children:"Back"}),(0,t.jsx)(a.$n,{type:"button",onClick:e,disabled:i||ew,children:ew?"Please wait…":n})]})]})},e9=(null==ep?void 0:ep.medications_flat)||[],ie=Array.from(new Set(e9.map(e=>e.drug))),ii=Array.from(new Set(e9.filter(e=>{var i;return e.drug===(null===(i=es.medication)||void 0===i?void 0:i.drug)}).map(e=>e.format))),it=e9.filter(e=>{var i,n;return e.drug===(null===(i=es.medication)||void 0===i?void 0:i.drug)&&e.format===(null===(n=es.medication)||void 0===n?void 0:n.form)&&e.lockebio_medication_dose_id}).sort((e,i)=>
1e.display_order-i.display_order),io=e9.find(e=>{var i;return e.lockebio_medication_dose_id===(null===(i=es.medication)||void 0===i?void 0:i.doseId)}),ir=null==ep?void 0:ep.billing_models.find(e=>{var i;return e.billing_model_id===(null===(i=es.shipping)||void 0===i?void 0:i.billingModelId)}),il=ir&&"BM3"===E(ir)&&(null==io?void 0:io.price_3mo_cents)?"".concat((0,a.UK)(io.price_3mo_cents)," / 3 mo"):(null==io?void 0:io.price_1mo_cents)?"".concat((0,a.UK)(io.price_1mo_cents),"/mo"):"Price unavailable",id=eU.map(e=>{let i=es.answers[e.question_id],n=[...(e.options||[]).filter(e=>{var n;return null==i?void 0:null===(n=i.options)||void 0===n?void 0:n.includes(e.option_id)}).map(e=>(0,a.QZ)(e.label)),null==i?void 0:i.answer,null==i?void 0:i.additionalAnswer,(null==i?void 0:i.filePath)?"Photo uploaded":void 0].filter(Boolean).join(" \xb7 ");return{id:e.question_id,label:(0,a.QZ)(e.title)||"Health question",value:n||"No answer"}}),ia=e=>{(0,c.I)("web_glp1_option_selected",{step:"medicationDrug",medication_drug:e}),eZ(i=>({...i,medication:{drug:e,form:"injectable",pricingId:"",doseId:"",productName:"",dosage:"",price1moCents:0,price3moCents:null}}))},is=e=>{(0,c.I)("web_glp1_option_selected",{step:"medicationForm",medication_form:e}),eZ(i=>({...i,medication:i.medication?{...i.medication,form:e,pricingId:"",doseId:""}:void 0}))},ic=e=>{e.lockebio_medication_dose_id&&(eZ(i=>({...i,medication:{drug:e.drug,form:e.format,pricingId:e.pricing_id,doseId:e.lockebio_medication_dose_id,productName:e.product_name,dosage:e.dosage,price1moCents:e.price_1mo_cents,price3moCents:e.price_3mo_cents}})),(0,c.I)("web_glp1_price_viewed",{medication_drug:e.drug,medication_form:e.format}),(0,c.I)("web_glp1_option_selected",{step:"medicationDose",medication_drug:e.drug,medication_form:e.format}))},ip=es.personalSubStep||"name_gender",iu=es.personal||f,ih=ev?["name_gender","dob","contact","ethnicity"]:["name_gender","body","dob","contact","ethnicity"],im="name_gender"===ip?!!iu.firstName.trim()&&!!iu.lastName.trim()&&!!iu.gender:"body"===ip?!!iu.heightCm&&iu.heightCm>=100&&iu.heightCm<=250&&!!iu.weightKg&&iu.weightKg>=30&&iu.weightKg<=350:"dob"===ip?T(iu.dob):"contact"===ip?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(iu.email):!!iu.ethnicity,ig=async()=>{if(eI(""),!im){eI("Complete this step before continuing."),(0,c.I)("web_glp1_validation_failed",{step:"personal"});return}(0,c.I)("web_glp1_personal_step_completed",{personal_step:ip});let e=ih.indexOf(ip),i=ih[e+1];if(i){eZ(e=>({...e,personalSubStep:i}));return}await e3()};return(0,t.jsxs)(a.Zp,{children:["notEligible"!==es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I,{children:[(0,t.jsx)("span",{children:v[es.currentStep]}),(0,t.jsxs)("span",{children:[ez," of ",eW]})]}),(0,t.jsx)(a.XL,{children:(0,t.jsx)(a.Z1,{$value:eJ})})]}),"personal"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.JR,{children:["name_gender"===ip&&"Tell us about yourself.","body"===ip&&"Your current measurements.","dob"===ip&&"What is your date of birth?","contact"===ip&&"Where can we reach you?","ethnicity"===ip&&"Which best describes your ethnicity?"]}),(0,t.jsx)(a.nB,{children:"name_gender"===ip?ev?"We found your Glow account. Confirm the legal name used for clinical care.":"Use your legal name so the clinician can verify your identity.":"body"===ip?"Height and current weight help the clinician assess eligibility.":"This information is used for identity and clinical review."}),(0,t.jsxs)(a.vY,{children:["name_gender"===ip&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.D0,{children:["First name",(0,t.jsx)(a.pd,{autoComplete:"given-name",value:iu.firstName,onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,firstName:e.target.value}}))})]}),(0,t.jsxs)(a.D0,{children:["Last name",(0,t.jsx)(a.pd,{autoComplete:"family-name",value:iu.lastName,onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,lastName:e.target.value}}))})]}),!ev&&(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Sex assigned at birth",(0,t.jsxs)(a.l6,{value:iu.gender,onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,gender:e.target.value}})),children:[(0,t.jsx)("option",{value:"",children:"Select"}),(0,t.jsx)("option",{value:"Female",children:"Female"}),(0,t.jsx)("option",{value:"Male",children:"Male"})]})]})})]}),"body"===ip&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.D0,{children:["Height (feet)",(0,t.jsx)(a.pd,{type:"number",inputMode:"numeric",min:3,max:8,value:iu.heightFeet||"",onChange:e=>{let i=Number(e.target.value)||void 0;eZ(e=>{let n=e.personal||f;return{...e,personal:{...n,heightFeet:i,heightCm:K(i,n.heightInches)}}})}})]}),(0,t.jsxs)(a.D0,{children:["Height (inches)",(0,t.jsx)(a.pd,{type:"number",inputMode:"numeric",min:0,max:11,value:null!==(el=iu.heightInches)&&void 0!==el?el:"",onChange:e=>{let i=""===e.target.value?void 0:Number(e.target.value);eZ(e=>{let n=e.personal||f;return{...e,personal:{...n,heightInches:i,heightCm:K(n.heightFeet,i)}}})}})]}),(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Current weight (lb)",(0,t.jsx)(a.pd,{type:"number",inputMode:"decimal",min:66,max:770,value:iu.weightLbs||"",onChange:e=>{let i=Number(e.target.value)||void 0;eZ(e=>({...e,personal:{...e.personal||f,weightLbs:i,weightKg:i?Number((.45359237*i).toFixed(1)):void 0}}))}})]})})]}),"dob"===ip&&(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Date of birth",(0,t.jsx)(a.pd,{inputMode:"numeric",placeholder:"MM/DD/YYYY",maxLength:10,value:iu.dob,onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,dob:e.target.value.replace(/[^\d/]/g,"").slice(0,10)}}))})]})}),"contact"===ip&&(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Email",(0,t.jsx)(a.pd,{type:"email",autoComplete:"email",value:iu.email,onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,email:e.target.value.trim().toLowerCase()}}))})]})}),"ethnicity"===ip&&(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Ethnicity",(0,t.jsxs)(a.l6,{value:iu.ethnicity||"",onChange:e=>eZ(i=>({...i,personal:{...i.personal||f,ethnicity:e.target.value}})),children:[(0,t.jsx)("option",{value:"",children:"Select"}),(0,t.jsx)("option",{value:"asian",children:"Asian"}),(0,t.jsx)("option",{value:"black_or_african",children:"Black or African"}),(0,t.jsx)("option",{value:"hispanic_or_latino",children:"Hispanic or Latino"}),(0,t.jsx)("option",{value:"white",children:"White"}),(0,t.jsx)("option",{value:"other",children:"Other"}),(0,t.jsx)("option",{value:"prefer_not_to_say",children:"Prefer not to say"})]})]})})]}),ej&&(0,t.jsx)(a.$T,{$error:!0,children:ej}),(0,t.jsxs)(a.En,{children:["name_gender"!==ip&&(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:()=>{(0,c.I)("web_glp1_back_clicked",{step:"personal",personal_step:ip});let e=ih.indexOf(ip),i=ih[e-1];i&&eZ(e=>({...e,personalSubStep:i}))},children:"Back"}),(0,t.jsx)(a.$n,{type:"button",disabled:!im||ew,onClick:()=>void ig(),children:ew?"Please wait…":"ethnicity"===ip?"Continue":"Next"})]})]}),"preparingRecommendation"===es.currentStep&&(0,t.jsx)(B,{children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(a.JR,{children:"Preparing your starting option…"}),(0,t.jsx)(a.nB,{children:"Reviewing your profile, preferences, and health answers."})]})}),"recommendation"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:(null===(e=es.personal)||void 0===e?void 0:e.firstName)?"".concat(es.personal.firstName,", here’s what Glow re
1commends."):"Here’s what Glow recommends."}),(0,t.jsx)(a.nB,{children:"This is a commercial starting option, not a prescription. A licensed clinician makes every treatment decision."}),(null==eH?void 0:eH.status)==="ready"?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S,{children:[(0,t.jsx)("h3",{children:eH.option.medication.productName}),(0,t.jsx)("p",{children:eH.option.medication.dosage}),(0,t.jsx)("p",{children:eH.option.shipping.billingModelName||"Recommended shipping plan"}),(0,t.jsx)(M,{children:(0,a.UK)(eH.option.amountDueCents)}),(0,t.jsxs)("p",{children:["About"," ",(0,a.UK)(eH.option.monthlyEquivalentCents),"/month",eH.option.savingsVsMonthlyCents>0?" \xb7 Save ".concat((0,a.UK)(eH.option.savingsVsMonthlyCents)," over 3 months"):""]})]}),ej&&(0,t.jsx)(a.$T,{$error:!0,children:ej}),(0,t.jsxs)(a.En,{children:[(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:e0,children:"Back"}),(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:()=>{(0,c.I)("web_glp1_recommendation_compared",{action:"choose_own"}),eZ(e=>({...e,selectionPath:"compare",acceptedRecommendationKey:void 0,currentStep:"medicationDrug"}))},children:"Choose my own option"}),(0,t.jsx)(a.$n,{type:"button",onClick:()=>{let e=eH.option;(0,c.I)("web_glp1_recommendation_accepted",{medication_drug:e.medication.drug,medication_form:e.medication.form}),eZ(i=>({...i,medication:e.medication,shipping:e.shipping,selectionPath:"guided",acceptedRecommendationKey:e.recommendationKey,currentStep:"photo"}))},children:"Continue application"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.$T,{children:"Glow could not load a complete starting option without guessing. You can still compare every available option."}),e4(()=>{(0,c.I)("web_glp1_recommendation_compared",{action:"fallback"}),eZ(e=>({...e,selectionPath:"compare",currentStep:"medicationDrug"}))},!1,"Compare available options")]})]}),"medicationDrug"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Which medication are you interested in?"}),(0,t.jsx)(a.nB,{children:"The clinician will make the final treatment decision based on your intake."}),(0,t.jsx)(a.yZ,{children:ie.map(e=>{var i,n;return(0,t.jsxs)(a.GR,{type:"button",$selected:(null===(i=es.medication)||void 0===i?void 0:i.drug)===e,onClick:()=>ia(e),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.KY,{children:"tirzepatide"===e?"Tirzepatide":"Semaglutide"}),(0,t.jsx)(a.z8,{children:"Available options and current pricing appear in the next steps."})]}),(0,t.jsx)("span",{children:(null===(n=es.medication)||void 0===n?void 0:n.drug)===e?"✓":""})]},e)})}),e4(eX,!(null===(i=es.medication)||void 0===i?void 0:i.drug))]}),"medicationForm"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Choose your preferred format."}),(0,t.jsx)(a.nB,{children:"Availability comes directly from the current treatment catalog."}),(0,t.jsx)(a.yZ,{children:ii.map(e=>{var i,n;return(0,t.jsxs)(a.GR,{type:"button",$selected:(null===(i=es.medication)||void 0===i?void 0:i.form)===e,onClick:()=>is(e),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.KY,{children:"injectable"===e?"Injection":"Oral dissolving tablet"}),(0,t.jsx)(a.z8,{children:"injectable"===e?"A once-weekly injection, when prescribed.":"A dissolving oral format, when prescribed."})]}),(0,t.jsx)("span",{children:(null===(n=es.medication)||void 0===n?void 0:n.form)===e?"✓":""})]},e)})}),e4(eX,!(null===(n=es.medication)||void 0===n?void 0:n.form))]}),"medicationDose"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Review the current options."}),(0,t.jsx)(a.nB,{children:"Prices shown here are loaded from the care system. The clinician may recommend a different dose or determine treatment is not appropriate."}),(0,t.jsx)(a.yZ,{children:it.map(e=>{var i;return(0,t.jsxs)(a.GR,{type:"button",$selected:(null===(i=es.medication)||void 0===i?void 0:i.pricingId)===e.pricing_id,onClick:()=>ic(e),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.KY,{children:e.product_name}),(0,t.jsxs)(a.z8,{children:[e.dosage,e.display_description?" \xb7 ".concat(e.display_description):""]})]}),(0,t.jsxs)(a.gm,{children:[(0,a.UK)(e.price_1mo_cents),"/mo"]})]},e.pricing_id)})}),0===it.length&&(0,t.jsx)(a.$T,{$error:!0,children:"No purchasable dose is configured for this option. Go back and choose another format."}),e4(eX,!(null===(o=es.medication)||void 0===o?void 0:o.doseId))]}),"shipping"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"How often should your medication ship?"}
1),(0,t.jsx)(a.nB,{children:"You will confirm the final total in secure hosted checkout."}),(0,t.jsx)(a.yZ,{children:((null==ep?void 0:ep.billing_models)||[]).slice().sort((e,i)=>{var n,t;return Number(null!==(n=e.cadence_months)&&void 0!==n?n:99)-Number(null!==(t=i.cadence_months)&&void 0!==t?t:99)}).map(e=>{var i,n,o;let[r,l]=function(e){let i=E(e);return"BM0"===i?["One-time shipping","One shipment, no subscription."]:"BM1"===i?["Monthly subscription","Billed monthly. Cancel anytime."]:"BM3"===i?["3-month subscription","Billed every 3 months."]:[e.name||"Shipping plan","Review the billing details at checkout."]}(e),d=E(e),s="BM3"===d&&(null===(i=es.medication)||void 0===i?void 0:i.price3moCents)?"".concat((0,a.UK)(es.medication.price3moCents)," / 3 mo"):(null===(n=es.medication)||void 0===n?void 0:n.price1moCents)?"BM1"===d?"".concat((0,a.UK)(es.medication.price1moCents),"/mo"):(0,a.UK)(es.medication.price1moCents):"";return(0,t.jsxs)(a.GR,{type:"button",$selected:(null===(o=es.shipping)||void 0===o?void 0:o.billingModelId)===e.billing_model_id,onClick:()=>{(0,c.I)("web_glp1_option_selected",{step:"shipping",billing_code:d}),eZ(i=>({...i,shipping:{billingModelId:e.billing_model_id,billingModelCode:d,billingModelName:e.name}}))},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.KY,{children:r}),(0,t.jsx)(a.z8,{children:l})]}),(0,t.jsx)(a.gm,{children:s})]},e.billing_model_id)})}),e4("renewal"===es.flow?e2:eX,!(null===(d=es.shipping)||void 0===d?void 0:d.billingModelId))]}),("questions"===es.currentStep||"bodyPhoto"===es.currentStep)&&eK&&(0,t.jsxs)(t.Fragment,{children:[(e=>{let i=U(e.input_type),n=es.answers[e.question_id],o=i=>eZ(n=>({...n,answers:{...n.answers,[e.question_id]:{...n.answers[e.question_id],...i,questionId:e.question_id}}})),r=t=>{let r=(null==n?void 0:n.options)||[];"multiple"===i?o({options:r.includes(t.option_id)?r.filter(e=>e!==t.option_id):$(t)?[t.option_id]:[...r.filter(i=>{var n;let t=null===(n=e.options)||void 0===n?void 0:n.find(e=>e.option_id===i);return!t||!$(t)}),t.option_id]}):o({options:[t.option_id],...t.has_additional?{}:{additionalAnswer:void 0}})},l=async i=>{var n;let t=null===(n=i.target.files)||void 0===n?void 0:n[0];if(i.target.value="",t){if(!t.type.startsWith("image/")||t.size>0xf00000){eI("Upload a JPG or PNG image smaller than 15 MB.");return}eD(i=>({...i,[e.question_id]:URL.createObjectURL(t)})),(0,c.I)("web_glp1_photo_selected",{step:es.currentStep,question_index:es.currentQuestionIdx}),eq(e.question_id),eI("");try{let i=await s.ng.uploadIntakeFile(eR.token,e.question_id,t,es.flow);o({filePath:i.path}),(0,c.I)("web_glp1_photo_uploaded",{step:es.currentStep,question_index:es.currentQuestionIdx})}catch(e){eI(e instanceof Error?e.message:"The image could not be uploaded.")}finally{eq("")}}},d=(e.options||[]).filter(e=>{var i;return null==n?void 0:null===(i=n.options)||void 0===i?void 0:i.includes(e.option_id)}).some(e=>e.has_additional);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:(0,a.QZ)(e.title)||"Health question"}),e.description&&(0,t.jsx)(a.nB,{children:(0,a.QZ)(e.description)}),e.help_text&&(0,t.jsx)(a.nB,{children:(0,a.QZ)(e.help_text)}),("radio"===i||"multiple"===i)&&(0,t.jsx)(a.yZ,{children:(e.options||[]).slice().sort((e,i)=>{var n,t;return(null!==(n=e.order_number)&&void 0!==n?n:0)-(null!==(t=i.order_number)&&void 0!==t?t:0)}).map(e=>{var i,o;return(0,t.jsxs)(a.GR,{type:"button",$selected:null==n?void 0:null===(i=n.options)||void 0===i?void 0:i.includes(e.option_id),onClick:()=>r(e),children:[(0,t.jsx)(a.KY,{children:(0,a.QZ)(e.label)||"Option"}),(0,t.jsx)("span",{"aria-hidden":!0,children:(null==n?void 0:null===(o=n.options)||void 0===o?void 0:o.includes(e.option_id))?"✓":""})]},e.option_id)})}),["text","number","date"].includes(i)&&(0,t.jsxs)(a.D0,{style:{marginTop:24},children:["Your answer","text"===i?(0,t.jsx)(a.fs,{value:(null==n?void 0:n.answer)||"",onChange:e=>o({answer:e.target.value})}):(0,t.jsx)(a.pd,{type:"number"===i?"number":"text",inputMode:"number"===i?"decimal":"text",placeholder:"date"===i?"MM/DD/YYYY":void 0,value:(null==n?void 0:n.answer)||"",onChange:e=>o({answer:e.target.value})})]}),"file"===i&&(0,t.jsxs)(D,{children:[(0,t.jsx)("strong",{children:eA===e.question_id?"Uploading image…":(null==n?void 0:n.filePath)?"Image uploaded ✓":"Take or choose a clear image"}),eN[e.question_id]&&(0,t.jsx)(P,{src:eN[e.question_id],alt:"Selected upload preview"}),(0,t.jsxs)(A,{children:[(0,t.jsxs)(q,{children:["Take photo",(0,t.jsx)("input",{type:"file",accept:"image/*",capture:"environment",disabled:eA===e.question_id,onChange:l})]}),(0,t.jsxs)(q,{children:["Choose photo",(0,t.jsx)("input",{type:"file",accept:"image/jpeg,image/png,image/heic",disabled:eA===e.question_id,onChange:l})]}),(null==n?void 0:n.filePath)&&(0,t.jsx)(q,{as:"button",type:"button",onClick:()=>{o({filePath:void 0}),eD(i=>{let n={...i};return delete n[e.question_id],n}),(0,c.I)("web_glp1_photo_removed",{step:es.currentStep,question_index:es.currentQuestionIdx})},children:"Remove and retake"})]})]}),d&&(0,t.jsxs)(a.D0,{style:{marginTop:20},children:["Please provide details",(0,t.jsx)(a.fs,{value:(null==n?void 0:n.additionalAnswer)||"",onChange:e=>o({additionalAnswer:e.target.value})})]})]})})(eK),ej&&(0,t.jsx)(a.$T,{$error:!0,children:ej}),(0,t.jsxs)(a.En,{children:[(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:()=>{0===es.currentQuestionIdx?e0():((0,c.I)("web_glp1_back_clicked",{step:es.currentStep,question_index:es.currentQuestionIdx}),eZ(e=>({...e,currentQuestionIdx:Math.max(0,e.currentQuestionIdx-1)})))},children:"Back"}),(0,t.jsx)(a.$n,{type:"button",disabled:!function(e,i){var n,t,o,r;let l=U(e.input_type);if(e.is_required){if("radio"===l||"multiple"===l){if(!(null==i?void 0:null===(t=i.options)||void 0===t?void 0:t.length)&&!(null==i?void 0:null===(o=i.answer)||void 0===o?void 0:o.trim()))return!1}else if("file"===l){if(!(null==i?void 0:i.filePath))return!1}else if(!(null==i?void 0:null===(n=i.answer)||void 0===n?void 0:n.trim()))return!1}return!(e.options||[]).filter(e=>{var n;return null==i?void 0:null===(n=i.options)||void 0===n?void 0:n.includes(e.option_id)}).some(e=>e.has_additional)||!!(null==i?void 0:null===(r=i.additionalAnswer)||void 0===r?void 0:r.trim())}(eK,es.answers[eK.question_id]),onClick:()=>{(0,c.I)("web_glp1_question_completed",{step:es.currentStep,question_index:es.currentQuestionIdx,question_count:eT.length});let e=es.answers[eK.question_id];if((eK.options||[]).filter(i=>{var n;return null==e?void 0:null===(n=e.options)||void 0===n?void 0:n.includes(i.option_id)}).some(e=>e.is_stop_intake)){let e=(eK.title||"").toLowerCase();eZ(i=>({...i,disqualifiedReason:e.includes("mississippi")||e.includes("louisiana")?"state":"medical",currentStep:"notEligible"})),(0,c.I)("web_glp1_intake_disqualified",{error_type:"eligibility"});return}es.currentQuestionIdx>=eT.length-1?"questions"===es.currentStep&&"new"===es.flow?eZ(e=>({...e,currentStep:eE.length>0?"bodyPhoto":"preparingRecommendation",currentQuestionIdx:0})):"bodyPhoto"===es.currentStep?eZ(e=>({...e,currentStep:"preparingRecommendation",currentQuestionIdx:0})):eX():eZ(e=>({...e,currentQuestionIdx:e.currentQuestionIdx+1}))},children:"Continue"})]})]}),("questions"===es.currentStep||"bodyPhoto"===es.currentStep)&&!eK&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"No questionnaire is available."}),(0,t.jsx)(a.$T,{$error:!0,children:"The clinical questionnaire is not configured. Please try again later."}),e4(()=>window.location.reload(),!1,"Retry")]}),"address"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Where should treatment ship?"}),(0,t.jsx)(a.nB,{children:"Enter the residential address that should appear on your order."}),(0,t.jsxs)(a.vY,{children:[(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Street address",(0,t.jsx)(a.pd,{autoComplete:"address-line1",value:(null===(p=es.address)||void 0===p?void 0:p.address_1)||"",onChange:e=>eZ(i=>({...i,address:{...i.address||b,address_1:e.target.value}}))})]})}),(0,t.jsx)(a.cL,{children:(0,t.jsxs)(a.D0,{children:["Apartment, suite, etc. (optional)",(0,t.jsx)(a.pd,{autoComplete:"address-line2",value:(null===(O=es.address)||void 0===O?void 0:O.address_2)||"",onChange:e=>eZ(i=>({...i,address:{...i.address||b,address_2:e.target.value}}))})]})}),(0,t.jsxs)(a.D0,{children:["City",(0,t.jsx)(a.pd,{autoComplete:"address-level2",value:(null===(Y=es.address)||void 0===Y?void 0:Y.city)||"",onChange:e=>eZ(i=>({...i,address:{...i.address||b,city:e.target.value}}))})]}),(0,t.jsxs)(a.D0,{children:["State",(0,t.jsxs)(a.l6,{autoComplete:"address-level1",value:(null===(L=es.address)||void 0===L?void 0:L.region)||"",onChange:e=>eZ(i=>({...i,address:{...i.address||b,region:e.target.value}})),children:[(0,t.jsx)("option",{value:"",children:"Select state"}),x.map(e=>{let[i,n]=e;return(0,t.jsx)("option",{value:i,children:n},i)})]})]}
1),(0,t.jsxs)(a.D0,{children:["ZIP code",(0,t.jsx)(a.pd,{inputMode:"numeric",autoComplete:"postal-code",maxLength:10,value:(null===(G=es.address)||void 0===G?void 0:G.postalcode)||"",onChange:e=>eZ(i=>({...i,address:{...i.address||b,postalcode:e.target.value.replace(/[^\d-]/g,"").slice(0,10)}}))})]})]}),e4(e5)]}),"photo"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Upload a photo of your ID."}),(0,t.jsx)(a.nB,{children:"A driver's license, passport, or state-issued ID is required for clinician review and identity verification."}),(0,t.jsxs)(D,{children:[(0,t.jsx)("strong",{children:es.photoIdUploaded?"Photo ID on file ✓":ek?"".concat(ek.name," selected"):"Take or choose a clear photo of your ID"}),eS&&(0,t.jsx)(P,{src:eS,alt:"Selected ID preview"}),!es.photoIdUploaded&&(0,t.jsxs)(A,{children:[(0,t.jsxs)(q,{children:["Take photo",(0,t.jsx)("input",{type:"file",accept:"image/*",capture:"environment",onChange:e6})]}),(0,t.jsxs)(q,{children:["Choose photo",(0,t.jsx)("input",{type:"file",accept:"image/jpeg,image/png,image/heic",onChange:e6})]}),ek&&(0,t.jsx)(q,{as:"button",type:"button",onClick:()=>{eS&&URL.revokeObjectURL(eS),eC(null),eM(""),(0,c.I)("web_glp1_photo_removed",{step:"photo"})},children:"Remove and retake"})]})]}),(0,t.jsx)(a.nB,{children:"Your ID is sent directly to the clinical care system and is not included in product analytics."}),e4(e7,!es.photoIdUploaded&&!ek)]}),"review"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Review and continue to checkout."}),(0,t.jsx)(a.nB,{children:"Your intake goes to a licensed clinician. Checkout pays for the selected plan, but medication is prescribed only when clinically appropriate."}),(0,t.jsxs)(C,{children:[(0,t.jsxs)(R,{children:[(0,t.jsx)("h3",{children:"Treatment path"}),(0,t.jsx)("button",{type:"button",onClick:()=>eV("medicationDrug"),children:"Edit"})]}),(0,t.jsx)("p",{children:null===(Q=es.medication)||void 0===Q?void 0:Q.productName}),(0,t.jsx)("p",{children:null===(z=es.medication)||void 0===z?void 0:z.dosage}),(0,t.jsx)("p",{children:null===(W=es.shipping)||void 0===W?void 0:W.billingModelName}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:il})," \xb7 verified from the current catalog"]})]}),(0,t.jsxs)(C,{children:[(0,t.jsxs)(R,{children:[(0,t.jsx)("h3",{children:"Patient information"}),!eg&&(0,t.jsx)("button",{type:"button",onClick:()=>eV("personal"),children:"Edit"})]}),(0,t.jsxs)("p",{children:[null===(J=es.personal)||void 0===J?void 0:J.firstName," ",null===(H=es.personal)||void 0===H?void 0:H.lastName]}),(0,t.jsx)("p",{children:null===(Z=es.personal)||void 0===Z?void 0:Z.email}),(0,t.jsxs)("p",{children:["Date of birth: ",null===(V=es.personal)||void 0===V?void 0:V.dob]}),(0,t.jsxs)("p",{children:["Sex assigned at birth: ",(null===(X=es.personal)||void 0===X?void 0:X.gender)||"Not provided"]}),(0,t.jsxs)("p",{children:["Height: ",function(e){if(!(null==e?void 0:e.heightCm))return"Not provided";let i=Math.round(e.heightCm/2.54);return"".concat(Math.floor(i/12)," ft ").concat(i%12," in")}(es.personal)," \xb7 Current weight:"," ",(null==(ed=es.personal)?void 0:ed.weightKg)?"".concat(Math.round(ed.weightKg/.45359237)," lb"):"Not provided"]}),(0,t.jsxs)("p",{children:["Ethnicity: ",(null===(ee=es.personal)||void 0===ee?void 0:ee.ethnicity)||"Not provided"]})]}),(0,t.jsxs)(C,{children:[(0,t.jsxs)(R,{children:[(0,t.jsx)("h3",{children:"Health questionnaire"}),(0,t.jsx)("button",{type:"button",onClick:()=>{eZ(e=>({...e,currentStep:"questions",currentQuestionIdx:0}))},children:"Review"})]}),id.map(e=>(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)("p",{children:(0,t.jsx)("strong",{children:e.label})}),(0,t.jsx)("p",{children:e.value})]},e.id))]}),(0,t.jsxs)(C,{children:[(0,t.jsxs)(R,{children:[(0,t.jsx)("h3",{children:"Identity verification"}),(0,t.jsx)("button",{type:"button",onClick:()=>eV("photo"),children:"Edit"})]}),(0,t.jsx)("p",{children:es.photoIdUploaded?"Government-issued photo ID uploaded ✓":"Photo ID is still required"})]}),"new"===es.flow&&(0,t.jsxs)(C,{children:[(0,t.jsxs)(R,{children:[(0,t.jsx)("h3",{children:"Shipping"}),(0,t.jsx)("button",{type:"button",onClick:()=>eV("address"),children:"Edit"})]}),(0,t.jsx)("p",{children:null===(ei=es.address)||void 0===ei?void 0:ei.address_1}),(null===(en=es.address)||void 0===en?void 0:en.address_2)&&(0,t.jsx)("p",{children:es.address.address_2}),(0,t.jsxs)("p",{children:[null===(et=es.address)||void 0===et?void 0:et.city,", ",null===(eo=es.address)||void 0===eo?void 0:eo.region," ",null===(er=es.address)||void 0===er?void 0:er.postalcode]})]}),(null==eh?void 0:eh.already_subscribed)&&(0,t.jsx)(a.$T,{children:"Glow co
1aching is already active on this account. It will not be charged again."}),(null==eh?void 0:eh.eligible)&&null!==eh.price_cents&&(0,t.jsxs)(N,{children:[(0,t.jsx)("input",{type:"checkbox",checked:!!es.includeGlowCoaching,onChange:e=>{let i=e.target.checked;eZ(e=>({...e,includeGlowCoaching:i})),(0,c.I)("web_glp1_coaching_offer_selected",{selected:i,subscription_plan:eh.plan_type})}}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Add Glow coaching"}),(0,t.jsx)("span",{children:"Daily AI coaching, meal and workout plans, progress tracking, and ongoing support alongside treatment."})]}),(0,t.jsxs)("strong",{children:[(0,a.UK)(eh.price_cents),"/","month"===eh.interval?"mo":eh.interval]})]}),(0,t.jsxs)(k,{children:[(0,t.jsx)("input",{type:"checkbox",checked:!!es.consentAgreed,onChange:e=>eZ(i=>({...i,consentAgreed:e.target.checked}))}),(0,t.jsx)("span",{children:"I confirm that my information is accurate and consent to clinician review of my intake."})]}),e4(e8,!es.consentAgreed||!es.photoIdUploaded||!io||!ir,"Prepare secure checkout")]}),"notEligible"===es.currentStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JR,{children:"Online treatment may not be appropriate right now."}),(0,t.jsx)(a.nB,{children:"Based on one of your responses, we cannot continue with this online intake. This is not a diagnosis. Please speak with a medical professional about the care that is right for you."}),(0,t.jsx)(a.$T,{children:"If you believe you selected an answer by mistake, you can go back and review it."}),(0,t.jsxs)(a.En,{children:[(0,t.jsx)(a.$n,{type:"button",$secondary:!0,onClick:()=>eZ(e=>({...e,currentStep:"questions",disqualifiedReason:void 0})),children:"Review answer"}),(0,t.jsx)(a.$n,{type:"button",onClick:()=>void ea.push("/glp1"),children:"Return to GLP-1 overview"})]})]})]})}function Y(){return(0,t.jsxs)(a.YW,{children:[(0,t.jsx)(o.bV,{title:"GLP-1 Medical Intake | Glow",description:"Complete your secure GLP-1 medical intake.",noindex:!0}),(0,t.jsx)(a.Gk,{}),(0,t.jsx)(a.$f,{children:(0,t.jsx)(O,{})})]})}}},e=>{var i=i=>e(e.s=i);e.O(0,[1106,1112,636,6593,8792],()=>i(4992)),_N_E=e.O()}]);

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