1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"17b19cc648ed40d106d5e65feb37d1a95987c23f"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4aadc8d8-66b8-4462-9428-641bad937200",e._sentryDebugIdIdentifier="sentry-dbid-4aadc8d8-66b8-4462-9428-641bad937200")}catch(a){}}();import{a as e,j as t}from"./react-core-Cq8slIZc.js";import{h as a,ag as n,af as i,ah as s,aB as r,L as l,aS as o,A as d,bb as c,bc as u,aF as m}from"./vendor-CzlNkN5i.js";import{S as p}from"./SidebarNavigationLayout-CNQvQrfA.js";import{S as h}from"./BaseService-CSKFPB7k.js";import{s as x,aw as b,ax as g}from"./index-DaYamA8v.js";import{u as f}from"./hooks-KEN8rdpf.js";import{v as k}from"./ChromeOutletContext-Vk8gySZC.js";import{u as v}from"./useAuthOptimized-l7UR0IYA.js";import{F as y,L as j,f as N,a as w,b as _,c as S,d as C,e as P,g as T}from"./labOrderCopy-C2z4AyAo.js";import"./navigationConfig-BPQQ581u.js";import"./store-avBA4NEr.js";import"./supabase-B56CYXAC.js";import"./index-Z1Yk02tE.js";import"./client-D4BhIO5F.js";import"./BiomarkerConfigService-voK7_tdv.js";import"./authStoreWrapper-B7Uv2CWO.js";import"./index-BpetFTHu.js";import"./RouterDispatcher-Ce3uHi_p.js";import"./zod-BWXzifLT.js";import"./useMember-Cvrl0xJ4.js";import"./BugReportService-CxR6BR2t.js";const I={availability:["labs","sandbox","availability"],quote:(e,t)=>["labs","sandbox","quote",...e,t],orders:["labs","sandbox","orders"]};function _temp$5(){return x.labs().getSandboxAvailability()}function _temp4$2(e){return!!e.state.data?.orders.some(_temp3$2)&&5e3}function _temp3$2(e){return"stripe_test"===e.paymentMode&&"pending_synthetic_payment"===e.status}function _temp2$3(){return x.labs().getSandboxOrders()}function _temp5$2(e){return x.labs().startStripeTestCheckout(e)}function _temp6$2(e){const{quoteId:t,idempotencyKey:a}=e;return x.labs().createSandboxOrder(t,a)}function _temp7$1(e){return x.labs().simulateSandboxPayment(e)}const formatFixture=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e/100),A={pending_synthetic_payment:"Waiting for test payment",paid_queued:"Test payment recorded",claimed:"Test order claimed",prepared:"Test order prepared",blocked:"Test order blocked",submit_started:"Test fulfillment started",needs_reconciliation:"Test order needs review",provider_confirmed:"Test outcome recorded",reconciled:"Test order reconciled"};function OrderStatus(e){const n=a.c(27),{order:i,stripeTestAvailable:s,onSimulate:r,onStripeCheckout:l,busy:o}=e,d=("unselected"===i.paymentMode||"stripe_test"===i.paymentMode)&&s,c="synthetic"===i.paymentMode||"unselected"===i.paymentMode&&!s;let u,m;n[0]!==i.orderId?(u=i.orderId.slice(0,8),n[0]=i.orderId,n[1]=u):u=n[1],n[2]!==u?(m=t.jsxs("p",{className:"font-semibold",children:["Test order ",u]}),n[2]=u,n[3]=m):m=n[3];const p="pending_synthetic_payment"===i.status&&"stripe_test"===i.paymentMode?"Waiting for Stripe TEST confirmation":A[i.status];let h,x,b,g,f;return n[4]!==p?(h=t.jsxs("p",{className:"mt-1",children:["Status: ",p]}),n[4]=p,n[5]=h):h=n[5],n[6]!==i.nextStep?(x=t.jsx("p",{className:"mt-1 text-[var(--kin-ink-2)]",children:i.nextStep}),n[6]=i.nextStep,n[7]=x):x=n[7],n[8]!==o||n[9]!==c||n[10]!==r||n[11]!==i.orderId||n[12]!==i.status?(b="pending_synthetic_payment"===i.status&&c&&t.jsx("button",{type:"button",onClick:()=>r(i.orderId),disabled:o,className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] disabled:opacity-60",children:o?"Recording test paymentâ¦":"Simulate test payment"}),n[8]=o,n[9]=c,n[10]=r,n[11]=i.orderId,n[12]=i.status,n[13]=b):b=n[13],n[14]!==o||n[15]!==d||n[16]!==l||n[17]!==i.orderId||n[18]!==i.paymentMode||n[19]!==i.status?(g="pending_synthetic_payment"===i.status&&d&&t.jsx("button",{type:"button",onClick:()=>l(i.orderId),disabled:o,className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] disabled:opacity-60",children:o?"Opening Stripe TEST checkoutâ¦":"stripe_test"===i.paymentMode?"Resume Stripe TEST checkout":"Open Stripe TEST checkout"}),n[14]=o,n[15]=d,n[16]=l,n[17]=i.orderId,n[18]=i.paymentMode,n[19]=i.status,n[20]=g):g=n[20],n[21]!==m||n[22]!==h||n[23]!==x||n[24]!==b||n[25]!==g?(f=t.jsxs("li",{className:"rounded-xl border border-[var(--kin-line)] p-4 text-[14px] text-[var(--kin-ink)]",children:[m,h,x,b,g]}),n[21]=m,n[22]=h,n[23]=x,n[24]=b,n[25]=g,n[26]=f):f=n[26],f}function SandboxOrderJourney({categoryIds:r,lab:l,canQuote:o}){const d=function(e){const t=a.c(2);let i;return t[0]!==e?(i={queryKey:I.availability,queryFn:_temp$5,enabled:e,retry:!1,staleTime:6e4},t[0]=e,t[1]=i):i=t[1],n(i)}(!0),c=!0===d.data?.available&&"synthetic"===d.data.mode,u=function(e,t,i){const s=a.c(10);let r,l;s[0]!==e||s[1]!==t?(r=I.quote(e,t),s[0]=e,s[1]=t,s[2]=r):r=s[2],s[3]!==e||s[4]!==t?(l=()=>x.labs().getSandboxQuote(e,t),s[3]=e,s[4]=t,s[5]=l):l=s[5];const o=i&&e.length>0&&null!==t;let d;return s[6]!==r||s[7]!==l||s[8]!==o?(d={queryKey:r,queryFn:l,enabled:o,retry:!1,staleTime:0}
1,s[6]=r,s[7]=l,s[8]=o,s[9]=d):d=s[9],n(d)}(r,l,c&&o),m=function(e){const t=a.c(2);let i;return t[0]!==e?(i={queryKey:I.orders,queryFn:_temp2$3,enabled:e,retry:!1,refetchInterval:_temp4$2},t[0]=e,t[1]=i):i=t[1],n(i)}(c),p=function(){const e=a.c(2),t=i();let n;return e[0]!==t?(n={mutationFn:_temp6$2,onSuccess:()=>t.invalidateQueries({queryKey:I.orders})},e[0]=t,e[1]=n):n=e[1],s(n)}(),b=function(){const e=a.c(2),t=i();let n;return e[0]!==t?(n={mutationFn:_temp7$1,onSuccess:()=>t.invalidateQueries({queryKey:I.orders})},e[0]=t,e[1]=n):n=e[1],s(n)}(),g=function(){const e=a.c(2),t=i();let n;return e[0]!==t?(n={mutationFn:_temp5$2,onSuccess:()=>t.invalidateQueries({queryKey:I.orders})},e[0]=t,e[1]=n):n=e[1],s(n)}(),[f,k]=e.useState(null),[v,y]=e.useState(null),[j,N]=e.useState(!1),w=e.useRef(null),_=e.useRef(!1),S=e.useRef(!1),C=e.useRef(!1),P=`${r.join(",")}:${l??""}`;if(e.useEffect(()=>{k(null),w.current=null},[P]),!c)return null;const T=u.data&&function(e,t,a){return"synthetic"===e.mode&&e.quoteId.length>0&&"sandbox-v1"===e.quoteVersion&&e.lab===a&&[...e.categoryIds].sort().join(",")===[...t].sort().join(",")&&Number.isFinite(Date.parse(e.expiresAt))&&!1===e.checkoutAvailable&&"USD"===e.currency&&Array.isArray(e.lines)&&2===e.lines.length&&e.lines.some(e=>"tests"===e.code)&&e.lines.some(e=>"draw"===e.code)&&e.lines.every(e=>Number.isSafeInteger(e.amountCents)&&e.amountCents>=0)&&Number.isSafeInteger(e.totalCents)&&e.lines.reduce((e,t)=>e+t.amountCents,0)===e.totalCents}(u.data,r,l)?u.data:null,A=!!T&&Date.parse(T.expiresAt)<=Date.now(),E=m.data?.orders??[],L=f&&!E.some(e=>e.orderId===f.orderId)?[f,...E]:E.map(e=>e.orderId===f?.orderId&&"paid_queued"===f.status&&"pending_synthetic_payment"===e.status?f:e);return t.jsxs("section",{"aria-labelledby":"sandbox-heading",className:"rounded-2xl border-2 border-[var(--kin-flame-d)] bg-[var(--kin-paper)] p-5 sm:p-7",children:[t.jsx("span",{className:"kin-eye !text-[12px]",children:"Staging sandbox"}),t.jsx("h2",{id:"sandbox-heading",className:"kin-display mt-2 text-[24px] text-[var(--kin-ink)]",children:"Try the test order flow"}),t.jsx("p",{className:"mt-2 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"This is a synthetic demonstration. Fixture amounts are illustrative and are not member prices. No charge or lab request will occur."}),o&&l&&r.length>0&&t.jsxs("div",{className:"mt-5 rounded-xl border border-[var(--kin-line)] p-4",children:[t.jsx("h3",{className:"font-semibold text-[16px] text-[var(--kin-ink)]",children:"Test-only itemized quote"}),u.isPending&&t.jsx("p",{role:"status",className:"mt-2 text-[14px]",children:"Preparing test quoteâ¦"}),u.isError&&t.jsx("p",{role:"alert",className:"mt-2 text-[14px]",children:"The test quote could not be prepared. Choose another lab or try again."}),u.data&&!T&&t.jsx("p",{role:"alert",className:"mt-2 text-[14px]",children:"The test quote is unavailable. Please try again later."}),T&&t.jsxs(t.Fragment,{children:[t.jsxs("dl",{className:"mt-3 space-y-2 text-[14px]",children:[T.lines.map(e=>t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("dt",{children:e.label}),t.jsx("dd",{children:formatFixture(e.amountCents)})]},e.code)),t.jsxs("div",{className:"flex justify-between gap-4 border-t border-[var(--kin-line)] pt-2 font-semibold",children:[t.jsx("dt",{children:"Illustrative test total"}),t.jsx("dd",{children:formatFixture(T.totalCents)})]})]}),t.jsx("p",{className:"mt-3 text-[13px] text-[var(--kin-ink-2)]",children:"The final member price is still being verified. This quote cannot be paid."}),A?t.jsx("p",{role:"status",className:"mt-3 text-[14px]",children:"This test quote expired. Refresh it before saving an order."}):t.jsx("button",{type:"button",onClick:()=>{(async()=>{if(T&&!A&&!_.current&&!p.isPending){_.current=!0,w.current?.quoteId!==T.quoteId&&(w.current={quoteId:T.quoteId,idempotencyKey:crypto.randomUUID()});try{const e=await p.mutateAsync(w.current);k(e.order)}catch{await m.refetch()}finally{_.current=!1}}})()},disabled:p.isPending||f?.quoteId===T.quoteId,className:"kin-btn kin-btn--ghost mt-4 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] disabled:opacity-60",children:p.isPending?"Saving test orderâ¦":f?.quoteId===T.quoteId?"Test order saved":"Save test order"}),A&&t.jsx("button",{type:"button",onClick:()=>{u.refetch()},className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:"Refresh test quote"}),p.isError&&t.jsx("p",{role:"alert",className:"mt-3 text-[14px]",children:p.error instanceof h&&"LABS_QUOTE_STALE"===p.error.code?"This test quote expired or changed. Refresh it before saving an order.":"The test order could not be confirmed. Check your test order history before retrying."}),p.isError&&p.error instanceof h&&"LABS_QUOTE_STALE"===p.error.code&&t.jsx("button",{type:"button",onClick:()=>{u.refetch()},className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:"Refresh test quote"})]})]}),t.jsxs("div",{className:"mt-6",children:[t.jsx("h3",{className:"font-semibold text-[16px] text-[var(--kin-ink)]",children:"Your test order history"}),m.isPending&&t.jsx("p",{role:"status",className:"mt-2 text-[14px]",children:"Loading test ordersâ¦"}),m.isError&&t.jsx("p",{role:"alert",className:"mt-2 text-[14px]",children:"Test order history is unavailable. Try refreshing it."}),m.isSuccess&&0===L.length&&t.jsx("p",{className:"mt-2 text-[14px] text-[var(--kin-ink-2)]",children:"No test orders saved yet."}),L.length>0&&t.jsx("ul",{className:"mt-3 space-y-3","aria-live":"polite",children:L.map(e=>t.jsx(OrderStatus,{order:e,stripeTestAvailable:!0===d.data?.stripeTestAvailable,onSimulate:e=>{(async e=>
1{if(!S.current&&!b.isPending){S.current=!0,y(e);try{const t=await b.mutateAsync(e);k(t.order)}catch{await m.refetch()}finally{S.current=!1,y(null)}}})(e)},onStripeCheckout:e=>{(async e=>{if(!C.current&&!g.isPending){C.current=!0,y(e),N(!1);try{const t=await g.mutateAsync(e),a=new URL(t.checkoutUrl);if("https:"!==a.protocol||"checkout.stripe.com"!==a.hostname)throw new Error("Invalid Stripe TEST checkout destination");window.location.assign(a.href)}catch{N(!0),await m.refetch()}finally{C.current=!1,y(null)}}})(e)},busy:v===e.orderId||b.isPending||g.isPending},e.orderId))}),b.isError&&t.jsx("p",{role:"alert",className:"mt-3 text-[14px]",children:"The test payment status could not be confirmed. Refresh history before trying again. No real charge occurred."}),j&&t.jsx("p",{role:"alert",className:"mt-3 text-[14px]",children:"Stripe TEST checkout could not be opened. Refresh test order history to see its current status. No live charge occurred."}),t.jsx("button",{type:"button",onClick:()=>{m.refetch()},className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:"Refresh test order history"})]})]})}function download(e,t,a){const n=URL.createObjectURL(new Blob([t],{type:a})),i=document.createElement("a");i.href=n,i.download=e,i.click(),URL.revokeObjectURL(n)}function availabilityLabel(e){return"exact_assay_hold"===e?"Exact test not yet verified":"specialist_review"===e?"Specialist review required":"Review availability"}function LabGuidance(e){const n=a.c(3),{intent:i}=e,{user:s}=f(),r=s?.id??"anonymous";let l;return n[0]!==i||n[1]!==r?(l=t.jsx(LabGuidanceForm,{intent:i},r),n[0]=i,n[1]=r,n[2]=l):l=n[2],l}function LabGuidanceForm(i){const s=a.c(146),{intent:r}=i,l=function(){const e=a.c(11),{user:t}=v(),i=k(t?.id);let s,r;e[0]!==i.data?(s=["labs","guidance",i.data],r=()=>x.labGuidance().load(i.data),e[0]=i.data,e[1]=s,e[2]=r):(s=e[1],r=e[2]);const l=Boolean(t?.id&&i.data);let o;e[3]!==s||e[4]!==r||e[5]!==l?(o={queryKey:s,queryFn:r,enabled:l,staleTime:6e4,retry:!1},e[3]=s,e[4]=r,e[5]=l,e[6]=o):o=e[6];const d=n(o),c=i.isError||d.isError,u=!i.isError&&(i.isPending||d.isPending);let m;return e[7]!==d||e[8]!==c||e[9]!==u?(m={...d,isError:c,isPending:u},e[7]=d,e[8]=c,e[9]=u,e[10]=m):m=e[10],m}(),[o,d]=e.useState(!1),[c,u]=e.useState("unsure"),[m,p]=e.useState("other"),[h,g]=e.useState("other"),[f,y]=e.useState(""),[j,N]=e.useState(""),[w,_]=e.useState("");let S;s[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],s[0]=S):S=s[0];const[C,P]=e.useState(S);let T;s[1]===Symbol.for("react.memo_cache_sentinel")?(T=[],s[1]=T):T=s[1];const[I,A]=e.useState(T),[E,L]=e.useState(!1),[$,O]=e.useState(!1),[q,R]=e.useState(!1);let D;s[2]!==l.data?.supplements||s[3]!==C?(D=C.length?C:l.data?.supplements??[],s[2]=l.data?.supplements,s[3]=C,s[4]=D):D=s[4];const F=D;let G;s[5]!==l.data?.results||s[6]!==I?(G=I.length?I:l.data?.results??[],s[5]=l.data?.results,s[6]=I,s[7]=G):G=s[7];const M=G,U=r??"baseline";let B;s[8]!==f||s[9]!==h||s[10]!==j||s[11]!==w||s[12]!==m||s[13]!==c||s[14]!==E||s[15]!==M||s[16]!==F||s[17]!==U||s[18]!==o?(B=b({intent:U,goal:c,focus:m,useConfirmedRecords:o,results:M,supplements:F,noSupplementsConfirmed:E,changeDate:f,changeType:h,clinicianDate:j,clinicianTests:w}),s[8]=f,s[9]=h,s[10]=j,s[11]=w,s[12]=m,s[13]=c,s[14]=E,s[15]=M,s[16]=F,s[17]=U,s[18]=o,s[19]=B):B=s[19];const W=B;let K;s[20]!==l.data?.results||s[21]!==I?(K=()=>I.length?I:l.data?.results??[],s[20]=l.data?.results,s[21]=I,s[22]=K):K=s[22];const V=K;let H;s[23]!==l.data?.supplements||s[24]!==C?(H=()=>C.length?C:l.data?.supplements??[],s[23]=l.data?.supplements,s[24]=C,s[25]=H):H=s[25];const Y=H;let Q;s[26]!==V?(Q=(e,t,a)=>A(V().map((n,i)=>i===e?{...n,[t]:["value","labLow","labHigh"].includes(t)&&""!==a?Number(a):"string"==typeof a?a||void 0:a}:n)),s[26]=V,s[27]=Q):Q=s[27];const z=Q;let J;s[28]!==V?(J=(e,t)=>A(V().map((a,n)=>n===e?{...a,confirmed:t}:a)),s[28]=V,s[29]=J):J=s[29];const X=J;let Z;s[30]!==Y?(Z=(e,t,a)=>P(Y().map((n,i)=>i===e?{...n,[t]:a}:n)),s[30]=Y,s[31]=Z):Z=s[31];const ee=Z;let te;s[32]!==W.cards||s[33]!==W.slots||s[34]!==E||s[35]!==F?(te=()=>download("phoenix-lab-discussion-list.txt",["Phoenix lab discussion list",...W.cards.map(_temp$4),"Blueprint slot status and report provenance",...W.slots.map(_temp2$2),"Supplement intake",...E?["No supplements confirmed."]:F.length?F.map(_temp3$1):["No supplement intake confirmed."]].join("\n\n"),"text/plain"),s[32]=W.cards,s[33]=W.slots,s[34]=E,s[35]=F,s[36]=te):te=s[36];const ae=te;let ne;s[37]!==j?(ne=()=>{if(!j)return;const e=j.replace(/-/g,"");download("phoenix-lab-review-reminder.ics",`BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Phoenix//Lab Guidance//EN\r\nBEGIN:VEVENT\r\nUID:phoenix-lab-${e}@thephoenix.community\r\nDTSTAMP:${(new Date).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}\r\nDTSTART;VALUE=DATE:${e}\r\nSUMMARY:Phoenix review reminder\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n`,"text/calendar")},s[37]=j,s[38]=ne):ne=s[38];const ie=ne;let se,re,le,oe,de,ce,ue,me,pe,he,xe,be,ge,fe,ke,ve,ye,je,Ne,we,_e,Se,Ce,Pe,Te,Ie,Ae,Ee,Le,$e,Oe,qe,Re,De,Fe,Ge,Me,Ue,Be,We,Ke,Ve,He,Ye,Qe,ze,Je,Xe,Ze,et,tt,at,nt,it,st;s[39]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("span",{className:"kin-eye !text-[12px]",children:"Your lab guidance"}),re=t.jsx("h2",{id:"guidance-heading",className:"kin-display mt-2 text-[24px] text-[var(--kin-ink)]",children:"Choose tests that answer your question"}),le=t.jsx("p",{className:"mt-2 text-[14px] text-[var(--kin-ink-2)]",children:"Suggestions help you prepare a clinician conversation. A Phoenix target and a clinical range can serve different purposes."}),s[39]=se,s[40]=re,s[41]=le):(se=s[39],re=s[40],le=s[41]),s[42]!==l.isPending?(
1oe=l.isPending&&t.jsx("p",{role:"status",children:"Loading records you can choose to confirmâ¦"}),s[42]=l.isPending,s[43]=oe):oe=s[43],s[44]!==l.isError?(de=l.isError&&t.jsx("p",{role:"alert",children:"Your records are unavailable. General Blueprint guidance remains available; no result has been used."}),s[44]=l.isError,s[45]=de):de=s[45],s[46]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("legend",{className:"font-semibold",children:"What would you like to understand?"}),s[46]=ce):ce=s[46],s[47]===Symbol.for("react.memo_cache_sentinel")?(ue=e=>u(e.target.value),s[47]=ue):ue=s[47],s[48]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("option",{value:"unsure",children:"Iâm not sure"}),pe=t.jsx("option",{value:"previous_result",children:"A previous result"}),he=t.jsx("option",{value:"treatment_change",children:"A treatment or lifestyle change"}),xe=t.jsx("option",{value:"phoenix_target",children:"A Phoenix target"}),be=t.jsx("option",{value:"clinician_plan",children:"My clinicianâs monitoring plan"}),s[48]=me,s[49]=pe,s[50]=he,s[51]=xe,s[52]=be):(me=s[48],pe=s[49],he=s[50],xe=s[51],be=s[52]),s[53]!==c?(ge=t.jsxs("select",{"aria-label":"Goal",value:c,onChange:ue,className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3",children:[me,pe,he,xe,be]}),s[53]=c,s[54]=ge):ge=s[54],s[55]===Symbol.for("react.memo_cache_sentinel")?(fe=e=>p(e.target.value),s[55]=fe):fe=s[55],s[56]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx("option",{value:"other",children:"Choose a focus"}),ve=t.jsx("option",{value:"lipids",children:"Heart and lipids"}),ye=t.jsx("option",{value:"glucose",children:"Glucose and metabolism"}),je=t.jsx("option",{value:"b12",children:"B12"}),Ne=t.jsx("option",{value:"iron",children:"Iron"}),we=t.jsx("option",{value:"vitamin_d_omega",children:"Vitamin D and omega-3"}),_e=t.jsx("option",{value:"thyroid",children:"Thyroid"}),Se=t.jsx("option",{value:"inflammation",children:"Inflammation"}),Ce=t.jsx("option",{value:"selected_nutrients",children:"Selected nutrients"}),Pe=t.jsx("option",{value:"brain",children:"Specialist brain biomarkers"}),s[56]=ke,s[57]=ve,s[58]=ye,s[59]=je,s[60]=Ne,s[61]=we,s[62]=_e,s[63]=Se,s[64]=Ce,s[65]=Pe):(ke=s[56],ve=s[57],ye=s[58],je=s[59],Ne=s[60],we=s[61],_e=s[62],Se=s[63],Ce=s[64],Pe=s[65]),s[66]!==m?(Te=t.jsxs("select",{"aria-label":"Follow-up focus",value:m,onChange:fe,className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3",children:[ke,ve,ye,je,Ne,we,_e,Se,Ce,Pe]}),s[66]=m,s[67]=Te):Te=s[67],s[68]!==ge||s[69]!==Te?(Ie=t.jsxs("fieldset",{className:"mt-5",children:[ce,t.jsxs("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:[ge,Te]})]}),s[68]=ge,s[69]=Te,s[70]=Ie):Ie=s[70],s[71]===Symbol.for("react.memo_cache_sentinel")?(Ae=e=>d(e.target.checked),s[71]=Ae):Ae=s[71],s[72]!==o?(Ee=t.jsxs("label",{className:"mt-4 flex min-h-[48px] items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:o,onChange:Ae})," ","Use only the results and supplements I confirm below"]}),s[72]=o,s[73]=Ee):Ee=s[73],s[74]===Symbol.for("react.memo_cache_sentinel")?(Le=e=>O(e.currentTarget.open),$e=t.jsx("summary",{children:"Review, correct, or add results"}),s[74]=Le,s[75]=$e):(Le=s[74],$e=s[75]),s[76]!==X||s[77]!==z||s[78]!==$||s[79]!==M?(Oe=$&&M.map((e,a)=>t.jsxs("fieldset",{className:"mt-3 grid gap-2 border p-2 sm:grid-cols-2",children:[t.jsx("input",{"aria-label":`Result ${a+1} marker`,value:e.marker,onChange:e=>z(a,"marker",e.target.value),placeholder:"Marker",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} value`,value:e.value,onChange:e=>z(a,"value",e.target.value),placeholder:"Value",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} unit`,value:e.unit??"",onChange:e=>z(a,"unit",e.target.value),placeholder:"Unit",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} date`,type:"date",value:e.date??"",onChange:e=>z(a,"date",e.target.value),className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} draw reference`,value:e.sourceId??"",onChange:e=>z(a,"sourceId",e.target.value),placeholder:"Draw reference",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} specimen`,value:e.specimen??"",onChange:e=>z(a,"specimen",e.target.value),placeholder:"Specimen",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} assay`,value:e.assay??"",onChange:e=>z(a,"assay",e.target.value),placeholder:"Assay",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} lab low`,value:e.labLow??"",onChange:e=>z(a,"labLow",e.target.value),placeholder:"Lab low",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Result ${a+1} lab high`,value:e.labHigh??"",onChange:e=>z(a,"labHigh",e.target.value),placeholder:"Lab high",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsxs("label",{className:"flex min-h-[48px] items-center gap-2",children:[t.jsx("input",{"aria-label":`Result ${a+1} fasting`,type:"checkbox",checked:!0===e.fasting,onChange:e=>z(a,"fasting",e.target.checked)})," ","Fasting result"]}),t.jsxs("label",{className:"flex min-h-[48px] items-center gap-2",children:[t.jsx("input",{"aria-label":`Confirm result ${a+1}`,type:"checkbox",checked:!0===e.confirmed,onChange:e=>X(a,e.target.checked)})," ",e.confirmed?"Confirmed result":"Confirm this result"]})]},a)),s[76]=X,s[77]=z,s[78]=$,s[79]=M,s[80]=Oe):Oe=s[80],s[81]!==V?(qe=t.jsx("button",{type:"button",onClick:()=>A([...V(),{marker:"",value:""}]),className:"kin-btn kin-btn--ghost mt-2 min-h-[48px]",children:"Add a result"}),s[81]=V,s[82]=qe):qe=s[82],s[83]!==Oe||s[84]!==qe?(Re=t.jsxs("details",{className:"mt-3",onToggle:Le,children:[$e,Oe,qe]}),s[83]=Oe,s[84]=qe,s[85]=Re):Re=s[85],s[86]===Symbol.for("react.memo_cache_sentinel")?(De=e=>R(e.currentTarget.open),Fe=t.jsx("summary",{children:"Review, correct, or add supplements"}
1),s[86]=De,s[87]=Fe):(De=s[86],Fe=s[87]),s[88]!==ee||s[89]!==F||s[90]!==q?(Ge=q&&F.map((e,a)=>t.jsxs("fieldset",{className:"mt-3 grid gap-2 border p-2 sm:grid-cols-2",children:[t.jsx("input",{"aria-label":`Supplement ${a+1} name`,value:e.name,onChange:e=>ee(a,"name",e.target.value),placeholder:"Ingredient/product",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Supplement ${a+1} dose`,value:e.dose??"",onChange:e=>ee(a,"dose",e.target.value),placeholder:"Dose and unit",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Supplement ${a+1} frequency`,value:e.frequency??"",onChange:e=>ee(a,"frequency",e.target.value),placeholder:"Frequency",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Supplement ${a+1} route`,value:e.route??"",onChange:e=>ee(a,"route",e.target.value),placeholder:"Route",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsx("input",{"aria-label":`Supplement ${a+1} start date`,type:"date",value:e.startDate??"",onChange:e=>ee(a,"startDate",e.target.value),className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"}),t.jsxs("label",{className:"flex min-h-[48px] items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:e.confirmed,onChange:e=>ee(a,"confirmed",e.target.checked)})," ",e.confirmed?"Confirmed":"Confirm this supplement"]})]},a)),s[88]=ee,s[89]=F,s[90]=q,s[91]=Ge):Ge=s[91],s[92]!==Y?(Me=t.jsx("button",{type:"button",onClick:()=>P([...Y(),{name:"",confirmed:!1}]),className:"kin-btn kin-btn--ghost mt-2 min-h-[48px]",children:"Add a supplement"}),s[92]=Y,s[93]=Me):Me=s[93],s[94]===Symbol.for("react.memo_cache_sentinel")?(Ue=e=>L(e.target.checked),s[94]=Ue):Ue=s[94],s[95]!==E?(Be=t.jsxs("label",{className:"ml-3 inline-flex min-h-[48px] items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:E,onChange:Ue})," ","I confirm no supplements"]}),s[95]=E,s[96]=Be):Be=s[96],s[97]!==Ge||s[98]!==Me||s[99]!==Be?(We=t.jsxs("details",{className:"mt-3",onToggle:De,children:[Fe,Ge,Me,Be]}),s[97]=Ge,s[98]=Me,s[99]=Be,s[100]=We):We=s[100],s[101]!==f||s[102]!==h||s[103]!==c?(Ke="treatment_change"===c&&t.jsxs("label",{className:"mt-4 block",children:["What changed, and when?",t.jsxs("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:[t.jsxs("select",{"aria-label":"Change type",value:h,onChange:e=>g(e.target.value),className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3",children:[t.jsx("option",{value:"lipid_medication",children:"Lipid medication"}),t.jsx("option",{value:"oral_iron",children:"Oral iron"}),t.jsx("option",{value:"lifestyle",children:"Lifestyle"}),t.jsx("option",{value:"other",children:"Other"})]}),t.jsx("input",{"aria-label":"Change date",type:"date",value:f,onChange:e=>y(e.target.value),className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3"})]})]}),s[101]=f,s[102]=h,s[103]=c,s[104]=Ke):Ke=s[104],s[105]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("legend",{children:"Clinician-requested test or review date (optional)"}),s[105]=Ve):Ve=s[105],s[106]===Symbol.for("react.memo_cache_sentinel")?(He=e=>_(e.target.value),s[106]=He):He=s[106],s[107]!==w?(Ye=t.jsx("input",{"aria-label":"Clinician requested test",type:"text",value:w,onChange:He,placeholder:"e.g. CBC",className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3 mt-2"}),s[107]=w,s[108]=Ye):Ye=s[108],s[109]===Symbol.for("react.memo_cache_sentinel")?(Qe=e=>N(e.target.value),s[109]=Qe):Qe=s[109],s[110]!==j?(ze=t.jsx("input",{"aria-label":"Clinician review date",type:"date",value:j,onChange:Qe,className:"min-h-[48px] w-full rounded-lg border border-[var(--kin-ink-3)] px-3 mt-2"}),s[110]=j,s[111]=ze):ze=s[111],s[112]!==Ye||s[113]!==ze?(Je=t.jsxs("fieldset",{className:"mt-4",children:[Ve,Ye,ze]}),s[112]=Ye,s[113]=ze,s[114]=Je):Je=s[114],s[115]!==W.cards?(Xe=W.cards.map(_temp4$1),s[115]=W.cards,s[116]=Xe):Xe=s[116],s[117]!==Xe?(Ze=t.jsx("div",{className:"mt-5 space-y-3",children:Xe}),s[117]=Xe,s[118]=Ze):Ze=s[118],s[119]===Symbol.for("react.memo_cache_sentinel")?(et=t.jsx("summary",{children:"All 38 Blueprint markers"}),s[119]=et):et=s[119],s[120]!==W.slots?(tt=W.slots.map(_temp5$1),s[120]=W.slots,s[121]=tt):tt=s[121],s[122]!==tt?(at=t.jsxs("details",{className:"mt-5",children:[et,t.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:tt})]}),s[122]=tt,s[123]=at):at=s[123],s[124]!==ae?(nt=t.jsx("button",{type:"button",onClick:ae,className:"kin-btn kin-btn--ghost min-h-[48px]",children:"Download discussion list"}),s[124]=ae,s[125]=nt):nt=s[125],s[126]===Symbol.for("react.memo_cache_sentinel")?(it=t.jsx("button",{type:"button",onClick:_temp6$1,className:"kin-btn kin-btn--ghost min-h-[48px]",children:"Print discussion list"}),s[126]=it):it=s[126],s[127]!==nt?(st=t.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[nt,it]}),s[127]=nt,s[128]=st):st=s[128];const rt=!j;let lt,ot,dt;return s[129]!==ie||s[130]!==rt?(lt=t.jsx("button",{type:"button",disabled:rt,onClick:ie,className:"kin-btn kin-btn--ghost mt-3 min-h-[48px] disabled:opacity-50",children:"Download calendar reminder (.ics)"}),s[129]=ie,s[130]=rt,s[131]=lt):lt=s[131],s[132]===Symbol.for("react.memo_cache_sentinel")?(ot=t.jsx("p",{className:"mt-2 text-[13px]",children:"Optional generic-title calendar file only. Phoenix does not schedule or email a reminder automatically."}),s[132]=ot):ot=s[132],s[133]!==oe||s[134]!==de||s[135]!==Ie||s[136]!==Ee||s[137]!==Re||s[138]!==We||s[139]!==Ke||s[140]!==Je||s[141]!==Ze||s[142]!==at||s[143]!==st||s[144]!==lt?(dt=t.jsxs("section",{"aria-labelledby":"guidance-heading",className:"rounded-2xl border border-[var(--kin-hair)] bg-[var(--kin-bg)] p-5 sm:p-7",children:[se,re,le,oe,de,Ie,Ee,Re,We,Ke,Je,Ze,at,st,lt,ot]}),s[133]=oe,s[134]=de,s[135]=Ie,s[136]=Ee,s[137]=Re,s[138]=We,s[139]=Ke,s[140]=Je,s[141]=Ze,s[142]=at,s[143]=st,s[144]=lt,s[145]=dt):dt=s[145],dt}function _temp6$1(){return window.print()}function _temp5$1(e){return t.jsxs("article",{children:[t.jsx("strong",{children:e.label})," ·"," ","held"===e.state?"Exact test unavailable":e.state.replace("_"," "),t.jsx("p",{children:e.reason}),t.jsx("p",{children:availabilityLabel(e.availability)}),e.result&&t.jsxs("p",{children:[e.result.value," ",e.result.unit," · ",e.result.date," · draw ",e.result.sourceId??"unknown"," · lab range"," ",e.result.labLow??"unknown","â",e.result.labHigh??"unknown"," ·"," ",e.result.specimen??"specimen unknown"," ·"," ",e.result.assay??"assay unknown"]}),e.resolvedHistory&&t.jsx("p",{children:"Older flag resolved by a newer comparable result."})]},e.id)}function _temp4$1(e){return t.jsxs("article",{className:"rounded-lg border border-[var(--kin-hair)] p-4",children:[t.jsx("strong",{children:e.title}),t.jsx("p",{children:e.body}),e.timing&&t.jsx("p",{children:e.timing}),t.jsx("a",{href:e.evidence.href,target:"_blank",rel:"noreferrer",className:"underline",children:e.evidence.label}),t.jsxs("p",{className:"mt-2",children:[t.jsx("strong",{children:"Next step:"})," ",e.nextStep]})]},e.title)}function _temp3$1(e){return`${e.name}: ${e.dose??"dose unknown"}; ${e.frequency??"frequency unknown"}; ${e.route??"route unknown"}; ${e.startDate??"start date unknown"}; ${e.confirmed?"confirmed":"unconfirmed"}`}function _temp2$2(e){return`${e.label}: ${e.state}; ${availabilityLabel(e.availability)}${e.result?`; ${e.result.value} ${e.result.unit??"unit unknown"}; report ${e.result.sourceId??"source unknown"}; ${e.result.date??"date unknown"}; range ${e.result.labLow??"unknown"}â${e.result.labHigh??"unknown"}; ${e.result.specimen??"specimen unknown"}; ${e.result.assay??"assay unknown"}`:""}`}function _temp$4(e){return`${e.title}\n${e.body}\nEvidence: ${e.evidence.label} (${e.evidence.href})${e.timing?`\nTiming: ${e.timing}`:""}\nNext step: ${e.nextStep}`}const E={orders:["labs","orders"]};function _temp$3(){return x.labs().getLabOrders()}function _temp2$1(e){return x.labs().createLabOrder(e)}const L=[{code:"AL",name:"Alabama"},{code:"AK",name:"Alaska"},{code:"AZ",name:"Arizona"},{code:"AR",name:"Arkansas"},{code:"CA",name:"California"},{code:"CO",name:"Colorado"},{code:"CT",name:"Connecticut"},{code:"DE",name:"Delaware"},{code:"DC",name:"District of Columbia"},{code:"FL",name:"Florida"},{code:"GA",name:"Georgia"},{code:"HI",name:"Hawaii"},{code:"ID",name:"Idaho"},{code:"IL",name:"Illinois"},{code:"IN",name:"Indiana"},{code:"IA",name:"Iowa"},{code:"KS",name:"Kansas"},{code:"KY",name:"Kentucky"},{code:"LA",name:"Louisiana"},{code:"ME",name:"Maine"},{code:"MD",name:"Maryland"},{code:"MA",name:"Massachusetts"},{code:"MI",name:"Michigan"},{code:"MN",name:"Minnesota"},{code:"MS",name:"Mississippi"},{code:"MO",name:"Missouri"},{code:"MT",name:"Montana"},{code:"NE",name:"Nebraska"},{code:"NV",name:"Nevada"},{code:"NH",name:"New Hampshire"},{code:"NJ",name:"New Jersey"},{code:"NM",name:"New Mexico"},{code:"NY",name:"New York"},{code:"NC",name:"North Carolina"},{code:"ND",name:"North Dakota"},{code:"OH",name:"Ohio"},{code:"OK",name:"Oklahoma"},{code:"OR",name:"Oregon"},{code:"PA",name:"Pennsylvania"},{code:"RI",name:"Rhode Island"},{code:"SC",name:"South Carolina"},{code:"SD",name:"South Dakota"},{code:"TN",name:"Tennessee"},{code:"TX",name:"Texas"},{code:"UT",name:"Utah"},{code:"VT",name:"Vermont"},{code:"VA",name:"Virginia"},{code:"WA",name:"Washington"},{code:"WV",name:"West Virginia"},{code:"WI",name:"Wisconsin"},{code:"WY",name:"Wyoming"}],$="OUTSIDE_US",O={price_unavailable:"Doesnât offer every test in your selection",state_restricted:"Not available for your state",outside_us:"US only"};
1function newRequestKey(){return crypto.randomUUID()}function LabOrderPanel({categoryIds:n,markerIds:l,breakdown:o,breakdownPending:d,breakdownError:c,stateCode:u,onStateChange:m,selectedLab:p,onSelectLab:x,onPricesChanged:b,redirect:g=e=>window.location.assign(e)}){const f=function(){const e=a.c(2),t=i();let n;return e[0]!==t?(n={mutationFn:_temp2$1,onSettled:()=>t.invalidateQueries({queryKey:E.orders})},e[0]=t,e[1]=n):n=e[1],s(n)}(),[k,v]=e.useState(null),C=e.useRef(newRequestKey()),P=`${n.join(",")}|${p??""}|${u}`;e.useEffect(()=>{C.current=newRequestKey(),v(null)},[P]);const T=u===$,I=""!==u&&!T,A=o?.options??[],q=A.find(e=>e.lab===p&&e.available)??null,R=A.find(e=>e.available)??null,D=l.some(e=>y.includes(e)),F=I&&null!==q&&null!==q.totalCents&&!f.isPending;return t.jsxs("div",{className:"mt-6 space-y-5 border-t border-[var(--kin-line)] pt-5",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"lab-order-state",className:"block font-semibold text-[15px] text-[var(--kin-ink)]",children:"Your state"}),t.jsxs("p",{id:"lab-order-state-help",className:"mt-1 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:["Lab rules depend on where you live. ",j]}),t.jsxs("select",{id:"lab-order-state","aria-describedby":"lab-order-state-help",required:!0,value:u,onChange:e=>m(e.target.value),className:"mt-2 min-h-[48px] w-full max-w-sm rounded-lg border border-[var(--kin-ink-3)] bg-[var(--kin-bg)] px-3 text-[15px] text-[var(--kin-ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:[t.jsx("option",{value:"",children:"Choose your state"}),L.map(e=>t.jsx("option",{value:e.code,children:e.name},e.code)),t.jsx("option",{value:$,children:"I live outside the US"})]}),T&&t.jsx("p",{role:"status",className:"mt-2 text-[14px] leading-relaxed text-[var(--kin-ink)]",children:"Lab orders are available in the US only for now. We are working hard to expand to Canada, the UK and Australia."})]}),t.jsxs("fieldset",{children:[t.jsx("legend",{className:"font-semibold text-[15px] text-[var(--kin-ink)]",children:"Choose your lab"}),t.jsxs("div",{"aria-live":"polite",children:[d&&t.jsx("p",{role:"status",className:"mt-2 text-[14px] text-[var(--kin-ink-2)]",children:"Getting prices at each labâ¦"}),c&&t.jsx("p",{role:"alert",className:"mt-2 text-[14px] text-[var(--kin-ink-2)]",children:"Prices are unavailable right now. Please try again."}),!d&&o&&!R&&!T&&t.jsxs("p",{role:"status",className:"mt-2 text-[14px] text-[var(--kin-ink-2)]",children:["No lab can do this whole selection",I?" for your state":"",". Remove an extra or choose another panel."]})]}),t.jsx("div",{className:"mt-3 grid gap-3",children:A.map(e=>{const a=e.available&&e.lab===R?.lab,n=e.lab===q?.lab;return t.jsxs("label",{className:`flex min-h-[56px] items-center gap-3 rounded-xl border px-4 py-3 text-[15px] ${e.available?"cursor-pointer text-[var(--kin-ink)]":"cursor-not-allowed text-[var(--kin-ink-2)] opacity-80"} ${n?"border-2 border-[var(--kin-flame-d)]":"border-[var(--kin-line)]"} focus-within:ring-2 focus-within:ring-[var(--kin-flame-d)]`,children:[t.jsx("input",{type:"radio",name:"lab-choice",value:e.lab,checked:n,disabled:!e.available,onChange:()=>x(e.lab),className:"h-5 w-5 shrink-0 accent-[var(--kin-flame-d)]"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block font-semibold",children:e.labName}),a&&t.jsx("span",{className:"kin-mono block text-[12px] font-bold uppercase tracking-[0.1em] text-[var(--kin-flame-d)]",children:"Suggested for your selection"}),!e.available&&e.unavailableReason&&t.jsx("span",{className:"block text-[13px]",children:O[e.unavailableReason]})]}),null!==e.totalCents&&t.jsx("span",{className:"shrink-0 font-semibold tabular-nums",children:N(e.totalCents)})]},e.lab)})})]}),q&&null!==q.drawFeeCents&&null!==q.totalCents&&t.jsxs("section",{"aria-labelledby":"price-breakdown-heading",className:"rounded-xl border border-[var(--kin-line)] bg-[var(--kin-paper)] p-4",children:[t.jsxs("h3",{id:"price-breakdown-heading",className:"font-semibold text-[16px] text-[var(--kin-ink)]",children:["Your price at ",q.labName]}),t.jsxs("dl",{className:"mt-3 space-y-2 text-[15px] text-[var(--kin-ink)]",children:[q.items.map(e=>t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("dt",{className:"min-w-0",children:[e.name,"extra"===e.kind?" (extra)":""]}),t.jsx("dd",{className:"shrink-0 tabular-nums",children:N(e.cents)})]},e.id)),t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("dt",{children:[q.labName," draw fee"]}),t.jsx("dd",{className:"shrink-0 tabular-nums",children:N(q.drawFeeCents)})]}),t.jsxs("div",{className:"flex items-start justify-between gap-4 border-t border-[var(--kin-line)] pt-2 font-semibold",children:[t.jsx("dt",{children:"Total"}),t.jsx("dd",{className:"shrink-0 tabular-nums",children:N(q.totalCents)})]})]}),t.jsxs("p",{className:"mt-3 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:["After you order, you book your blood draw at a ",q.labName," patient service center."," ",t.jsxs("a",{href:w[q.lab],target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-h-[44px] items-center gap-1 font-semibold text-[var(--kin-flame-d)] underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:["Find a ",q.labName," location ",t.jsx(r,{className:"h-4 w-4","aria-hidden":"true"}),t.jsx("span",{className:"sr-only",children:"(opens in a new tab)"})]})]}),D&&t.jsx("p",{className:"mt-2 text-[14px] font-semibold leading-relaxed text-[var(--kin-ink)]",children:_})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[14px] leading-relaxed text-[var(--kin-ink)]",children:S}),t.jsx("button",{type:"button",onClick:()=>{q&&null!==q.totalCents&&I&&(v(null),f.mutate({categoryIds:n,lab:q.lab,state:u,expectedTotalCents:q.totalCents,idempotencyKey:C.current},{onSuccess:e=>{e.checkoutUrl?g(e.checkoutUrl):v("This order is already paid. See your orders below.")},onError:e=>
1{e instanceof h&&"LABS_QUOTE_STALE"===e.code&&(b(),C.current=newRequestKey()),v(e instanceof h?e.message:"The payment could not start. No charge was made.")}}))},disabled:!F,className:"kin-btn kin-btn--flame mt-3 min-h-[48px] w-full sm:w-auto focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",children:f.isPending?"Opening secure paymentâ¦":null!=q?.totalCents?`Pay ${N(q.totalCents)}`:"Pay"}),!I&&!T&&t.jsx("p",{className:"mt-2 text-[13px] text-[var(--kin-ink-2)]",children:"Choose your state to continue."}),k&&t.jsx("p",{role:"alert",className:"mt-2 text-[14px] text-[var(--kin-red)]",children:k})]})]})}const q=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"});function orderTitle(e){return e.items.map(e=>e.name).join(" + ")}function LabOrderHistory(e){const n=a.c(5),{orders:i}=e;if(0===i.length)return null;let s,r,l;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("h2",{id:"lab-orders-heading",className:"kin-display text-[24px] text-[var(--kin-ink)]",children:"Your lab orders"}),n[0]=s):s=n[0],n[1]!==i?(r=i.map(_temp$2),n[1]=i,n[2]=r):r=n[2],n[3]!==r?(l=t.jsxs("section",{"aria-labelledby":"lab-orders-heading",children:[s,t.jsx("ul",{className:"mt-4 grid gap-3",children:r})]}),n[3]=r,n[4]=l):l=n[4],l}function _temp$2(e){const a=C[e.status];return t.jsxs("li",{className:"kin-card kin-card--hairline rounded-xl p-4 text-[15px] text-[var(--kin-ink)]",children:[t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[t.jsx("p",{className:"min-w-0 font-semibold",children:orderTitle(e)}),t.jsx("p",{className:"shrink-0 tabular-nums",children:N(e.totalCents)})]}),t.jsxs("p",{className:"mt-1 text-[14px] text-[var(--kin-ink-2)]",children:[e.labName," · ",q.format(new Date(e.createdAt))]}),t.jsxs("p",{className:"mt-2",children:[t.jsx("span",{className:"font-semibold",children:a.label}),a.detail&&t.jsxs("span",{className:"text-[var(--kin-ink-2)]",children:[" â ",a.detail]})]}),"completed"===e.status&&t.jsx(l,{to:"/app/bloodwork",className:"mt-2 inline-flex min-h-[44px] items-center font-semibold text-[var(--kin-flame-d)] underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:"Upload your results"})]},e.orderId)}function EmberLabUpgradeCard(){const e=a.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("section",{"aria-labelledby":"labs-ember-upgrade-heading",className:"kin-card kin-card--hairline rounded-2xl border-2 border-[var(--kin-flame-d)] p-5 sm:p-7",children:[t.jsx("h2",{id:"labs-ember-upgrade-heading",className:"kin-display text-[24px] leading-tight text-[var(--kin-ink)]",children:P.title}),t.jsx("p",{className:"mt-2 max-w-2xl text-[15px] leading-relaxed text-[var(--kin-ink-2)]",children:P.body}),t.jsx(l,{to:"/app/upgrade",className:"kin-btn kin-btn--flame mt-4 inline-flex min-h-[48px] items-center justify-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2",children:P.button}),t.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-[var(--kin-ink-2)]",children:P.note})]}),e[0]=n):n=e[0],n}const R={catalog:["labs","catalog"],preview:(e,t,a)=>["labs","preview",...e,t,a??"any-state"]};function _temp$1(){return x.labs().getCatalog()}const D={quest:"Quest Diagnostics",labcorp:"Labcorp",bioreference:"BioReference"},F=["quest","labcorp","bioreference"],G=["paid","ordered","completed"],M=[{id:"guide-first-7-days",kind:"guide",status:"live",title:"The APOE4 Carrier's First 7 Days",description:"A calm, science-backed 7-day plan for the week after you find out: your genotype, the 5 systems it touches, a baseline lab plan, and a 90-day starting point.",route:"/guides/first-7-days",entryPoint:"guide-first7days",pdfPath:"/guides/apoe4-first-7-days.pdf"},{id:"guide-essential-guide",kind:"guide",status:"live",title:"The Essential Guide to Thriving with APOE4",description:"The mechanism, then the no-regret interventions across nutrition, exercise, sleep, stress, supplements and toxins.",route:"/guides/essential-guide",entryPoint:"guide-essential",pdfPath:"/guides/essential-guide-thriving-with-apoe4.pdf"},{id:"guide-blood-work-blueprint",kind:"guide",status:"live",title:"The APOE4 Blood Work Blueprint",description:"Evidence-based biomarker targets across 6 systems, a traffic-light scoring system, and a checklist for your doctor.",route:"/guides/blood-work-blueprint",entryPoint:"guide-blueprint",pdfPath:"/guides/apoe4
1-blood-work-blueprint.pdf"},{id:"guide-lipid-playbook",kind:"guide",status:"live",title:"The APOE4 Lipid Playbook",description:"Why ApoB beats LDL, how the 90 / 70 / 60 cardiovascular risk tiers work, and the statin-vs-ezetimibe-vs-PCSK9 decision in plain English.",route:"/guides/lipid-playbook",entryPoint:"guide-lipids",pdfPath:"/guides/apoe4-lipid-playbook.pdf"},{id:"guide-womens-guide",kind:"guide",status:"live",title:"The APOE4 Woman's Guide",description:"Estrogen and the brain, the HRT timing window, transdermal vs oral, and the honest state of the APOE4 + HRT evidence.",route:"/guides/womens-guide",entryPoint:"guide-women",pdfPath:"/guides/apoe4-womans-guide.pdf"},{id:"guide-genetic-testing-family",kind:"guide",status:"live",title:"APOE4 Genetic Testing & Family Guide",description:"What one vs two copies means, 23andMe vs WGS vs clinical testing, GINA and insurance, and the family conversation.",route:"/guides/genetic-testing-family",entryPoint:"guide-genetics",pdfPath:"/guides/apoe4-genetic-testing-family.pdf"},{id:"guide-genetic-counselor-brief",kind:"guide",status:"live",title:"The APOE4 Brief for Genetic Counselors",description:"A peer-level clinical reference: lifetime-risk by genotype, REVEAL disclosure-safety, GINA, and cascade testing.",route:"/guides/genetic-counselor-brief",entryPoint:"guide-counselor",pdfPath:"/guides/apoe4-genetic-counselor-brief.pdf"},{id:"guide-sleep-protocol",kind:"guide",status:"live",title:"The APOE4 Sleep & Glymphatic Protocol",description:"The study that found better sleep blunted the APOE4 allele's effect on Alzheimer's risk, the brain's nightly wash cycle, and what the evidence does not support.",route:"/guides/sleep-protocol",entryPoint:"guide-sleep",pdfPath:"/guides/apoe4-sleep-protocol.pdf"},{id:"guide-clinician-brief",kind:"guide",status:"live",title:"The Clinician's APOE4 Brief",description:"For GPs, internists, neurologists, cardiologists, and gynaecologists: what to say in three minutes, what to measure, and the 2024 Lancet reframe.",route:"/guides/clinician-brief",entryPoint:"guide-clinician",pdfPath:"/guides/apoe4-clinician-brief.pdf"},{id:"guide-doctor-conversation-kit",kind:"guide",status:"live",title:"The Doctor Conversation Kit",description:"The six asks, the exact words, what not to request, and the GINA insurance trap, with a tear-out one-page brief for your doctor.",route:"/guides/doctor-conversation-kit",entryPoint:"guide-doctor",pdfPath:"/guides/apoe4-doctor-conversation-kit.pdf"},{id:"guide-supplement-guide",kind:"guide",status:"live",title:"The APOE4 Supplement Guide",description:"Every supplement needs a reason: omega-3, creatine, fiber and nutrient gaps, with research limits, product-quality checks and questions for your clinician.",route:"/guides/supplement-guide",entryPoint:"guide-supplements",pdfPath:"/guides/apoe4-supplement-guide.pdf"},{id:"guide-diet-playbook",kind:"guide",status:"live",title:"The APOE4 Diet Playbook",description:"What to actually eat: Mediterranean vs. keto, red meat and dairy in context, the fiber lever that moves your ApoB, and a 90-day plate-building plan.",route:"/guides/diet-playbook",entryPoint:"guide-diet",pdfPath:"/guides/apoe4-diet-playbook.pdf"},{id:"guide-metabolic-guide",kind:"guide",status:"live",title:"The APOE4 Metabolic Guide",description:"Glucose, insulin, fasting, and GLP-1s: the brain-glucose gradient, whether a CGM is worth wearing, and the honest state of the GLP-1 and SGLT2 evidence.",route:"/guides/metabolic-guide",entryPoint:"guide-metabolic",pdfPath:"/guides/apoe4-metabolic-guide.pdf"},{id:"guide-emerging-therapies",kind:"guide",status:"live",title:"The APOE4 Emerging Therapies Watchlist",description:"Anti-amyloid drugs, ARIA risk by genotype, gene therapy, and the rest of the pipeline, explained in plain English with the honest limits.",route:"/guides/emerging-therapies",entryPoint:"guide-therapies",pdfPath:"/guides/apoe4-emerging-therapies.pdf"},{id:"guide-brain-biomarkers",kind:"guide",status:"live",title:"The APOE4 Brain Biomarker Guide",description:"pTau-217, NfL, and GFAP: what a blood test can and cannot tell you, and a script for the conversation with your doctor.",route:"/guides/brain-biomarkers",entryPoint:"guide-biomarkers",pdfPath:"/guides/apoe4
1-brain-biomarkers.pdf"},{id:"guide-exercise-protocol",kind:"guide",status:"live",title:"The APOE4 Exercise Protocol",description:"Zone 2, HIIT read honestly, resistance training, and how muscle talks to your brain, built around the genotype question.",route:"/guides/exercise-protocol",entryPoint:"guide-exercise",pdfPath:"/guides/apoe4-exercise-protocol.pdf"},{id:"guide-inflammation-gut-stress",kind:"guide",status:"live",title:"The APOE4 Inflammation, Gut & Stress Guide",description:"Why APOE4 runs a hotter immune system, the gut-brain axis, cortisol and your hippocampus, and what to test and target.",route:"/guides/inflammation-gut-stress",entryPoint:"guide-inflammation",pdfPath:"/guides/apoe4-inflammation-gut-stress.pdf"},{id:"guide-optimizer-stack",kind:"guide",status:"live",title:"The APOE4 Optimizer's Stack",description:"For carriers past the basics: the core lab panel, what a CGM actually proves, sleep stages and HRV decoded, and how to run your own N-of-1 experiment.",route:"/guides/optimizer-stack",entryPoint:"guide-optimizer",pdfPath:"/guides/apoe4-optimizer-stack.pdf"},{id:"guide-caregiver-90-day-plan",kind:"guide",status:"live",title:"The Caregiver's 90-Day Plan",description:"For the first three months after a parent or spouse is diagnosed: home safety, the medical team, the papers that cannot wait, and protecting your own brain too.",route:"/guides/caregiver-90-day-plan",entryPoint:"guide-caregiver90",pdfPath:"/guides/apoe4-caregiver-90-day-plan.pdf"},{id:"guide-thermal-device-therapy",kind:"guide",status:"live",title:"The APOE4 Thermal & Device Therapy Guide",description:"Sauna, cold exposure, and red light are not equally proven: the evidence tier for each, the exact sauna dose, and the safety rules.",route:"/guides/thermal-device-therapy",entryPoint:"guide-thermal",pdfPath:"/guides/apoe4-thermal-device-therapy.pdf"}].find(e=>"guide-blood-work-blueprint"===e.id),U={lipids_7:"Cholesterol, ApoB, Lp(a) and LDL particle markers together.",glucose_metabolic_5:"Fasting glucose and insulin alongside longer-term blood sugar markers.",inflammation_4:"The four inflammation markers in one panel.",b_vitamins_5:"B vitamins, homocysteine and methylmalonic acid together.",thyroid_4:"Thyroid hormones and thyroid peroxidase antibodies.",iron_5:"Iron stores and transport alongside blood hemoglobin.",vitamin_d_1:"Your total 25-hydroxyvitamin D.",ptau217_1:"One blood marker. Results typically take 5â7 days."},B={ptau217_1:g};function readCheckoutReturn(){if("undefined"==typeof window)return{orderId:null,outcome:null};const e=new URLSearchParams(window.location.search),t=e.get("checkout");return{orderId:e.get("order"),outcome:"success"===t||"cancelled"===t?t:null}}function CategoryCard(e){const n=a.c(37),{category:i,selected:s,onSelect:r}=e,l="held"===i.availability,o="plan"===i.group,c=o?i.description??"A Phoenix plan.":U[i.id]??"The markers covered by this focused panel.",p=l?void 0:B[i.id];let h,x,b;n[0]!==i.title?(h=t.jsx("span",{className:"kin-display text-[20px] leading-tight text-[var(--kin-ink)]",children:i.title}),n[0]=i.title,n[1]=h):h=n[1],n[2]!==l||n[3]!==s?(x=l?t.jsx(u,{className:"h-5 w-5 shrink-0 text-[var(--kin-ink-2)]","aria-hidden":"true"}):s?t.jsx(m,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)]","aria-hidden":"true"}):t.jsx(d,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)]","aria-hidden":"true"}),n[2]=l,n[3]=s,n[4]=x):x=n[4],n[5]!==h||n[6]!==x?(b=t.jsxs("span",{className:"flex items-start justify-between gap-3",children:[h,x]}),n[5]=h,n[6]=x,n[7]=b):b=n[7];const g=l?i.holdReason||"Weâre still confirming some of the tests in this panel.":c;let f,k,v;n[8]!==g?(f=t.jsx("span",{className:"mt-2 block text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:g}),n[8]=g,n[9]=f):f=n[9],n[10]!==p?(k=p&&t.jsx("span",{className:"mt-2 block text-[14px] leading-relaxed text-[var(--kin-ink)]",children:p}),n[10]=p,n[11]=k):k=n[11],n[12]!==i.markerIds||n[13]!==i.supportedLabs||n[14]!==l||n[15]!==o?(v=!l&&t.jsxs("span",{className:"mt-3 block text-[13px] leading-relaxed text-[var(--kin-ink-2)]",children:[o?"Phoenix plan":"Focused panel"," · ",i.markerIds.length," marker",1===i.markerIds.length?"":"s"," · available at ",i.supportedLabs.length," ",1===i.supportedLabs.length?"lab":"labs"]}),n[12]=i.markerIds,n[13]=i.supportedLabs,n[14]=l,n[15]=o,n[16]=v):v=n[16];
1const y=l?"Not available yet":s?"Selected":o?"Choose this plan":"Choose this panel";let j,N;n[17]!==y?(j=t.jsx("span",{className:"kin-mono mt-4 block text-[12px] uppercase tracking-[0.12em] font-bold text-[var(--kin-flame-d)]",children:y}),n[17]=y,n[18]=j):j=n[18],n[19]!==b||n[20]!==f||n[21]!==k||n[22]!==v||n[23]!==j?(N=t.jsxs(t.Fragment,{children:[b,f,k,v,j]}),n[19]=b,n[20]=f,n[21]=k,n[22]=v,n[23]=j,n[24]=N):N=n[24];const w=N,_="kin-card kin-card--hairline block w-full min-h-[118px] rounded-xl p-5 text-left "+(s?"border-2 border-[var(--kin-flame-d)]":"");if(l){const e=`${_} opacity-80`,a=`${i.title}, not available yet`;let s;return n[25]!==w||n[26]!==e||n[27]!==a?(s=t.jsx("div",{className:e,"aria-label":a,children:w}),n[25]=w,n[26]=e,n[27]=a,n[28]=s):s=n[28],s}const S=`${_} hover:border-[var(--kin-flame-d)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2`;let C,P;return n[29]!==i||n[30]!==r?(C=()=>r(i),n[29]=i,n[30]=r,n[31]=C):C=n[31],n[32]!==w||n[33]!==s||n[34]!==S||n[35]!==C?(P=t.jsx("button",{type:"button",className:S,"aria-pressed":s,onClick:C,children:w}),n[32]=w,n[33]=s,n[34]=S,n[35]=C,n[36]=P):P=n[36],P}function CombinationCard(e){const n=a.c(22),{combination:i,selected:s,onSelect:r}=e,l="kin-card kin-card--hairline block w-full min-h-[118px] rounded-xl p-5 text-left hover:border-[var(--kin-flame-d)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2 "+(s?"border-2 border-[var(--kin-flame-d)]":"");let o,c,u,p;n[0]!==i||n[1]!==r?(o=()=>r(i),n[0]=i,n[1]=r,n[2]=o):o=n[2],n[3]!==i.title?(c=t.jsx("span",{className:"kin-display text-[20px] leading-tight text-[var(--kin-ink)]",children:i.title}),n[3]=i.title,n[4]=c):c=n[4],n[5]!==s?(u=s?t.jsx(m,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)]","aria-hidden":"true"}):t.jsx(d,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)]","aria-hidden":"true"}),n[5]=s,n[6]=u):u=n[6],n[7]!==c||n[8]!==u?(p=t.jsxs("span",{className:"flex items-start justify-between gap-3",children:[c,u]}),n[7]=c,n[8]=u,n[9]=p):p=n[9];const h=1===i.supportedLabs.length?"lab":"labs";let x;n[10]!==i.supportedLabs.length||n[11]!==h?(x=t.jsxs("span",{className:"mt-2 block text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:["Two panels in one order · available at ",i.supportedLabs.length," ",h]}),n[10]=i.supportedLabs.length,n[11]=h,n[12]=x):x=n[12];const b=s?"Selected":"Choose both together";let g,f;return n[13]!==b?(g=t.jsx("span",{className:"kin-mono mt-4 block text-[12px] uppercase tracking-[0.12em] font-bold text-[var(--kin-flame-d)]",children:b}),n[13]=b,n[14]=g):g=n[14],n[15]!==s||n[16]!==l||n[17]!==o||n[18]!==p||n[19]!==x||n[20]!==g?(f=t.jsxs("button",{type:"button",className:l,"aria-pressed":s,onClick:o,children:[p,x,g]}),n[15]=s,n[16]=l,n[17]=o,n[18]=p,n[19]=x,n[20]=g,n[21]=f):f=n[21],f}function AddOnOption(e){const n=a.c(40),{addOn:i,baseLabs:s,checked:r,onToggle:l}=e;let o,d,c,u,m,p,h,x,b,g,f;if(n[0]!==i||n[1]!==s||n[2]!==r||n[3]!==l){let e;n[12]!==i.supportedLabs?(e=e=>!i.supportedLabs.includes(e),n[12]=i.supportedLabs,n[13]=e):e=n[13];const a=s.filter(e),b=`addon-${i.id}-description`;let g,f;h="flex min-h-[48px] cursor-pointer items-start gap-3 rounded-lg border px-4 py-3 text-[14px] text-[var(--kin-ink)] focus-within:ring-2 focus-within:ring-[var(--kin-flame-d)] "+(r?"border-2 border-[var(--kin-flame-d)]":"border-[var(--kin-line)]"),n[14]!==i||n[15]!==l?(g=()=>l(i),n[14]=i,n[15]=l,n[16]=g):g=n[16],n[17]!==r||n[18]!==b||n[19]!==g?(x=t.jsx("input",{type:"checkbox",checked:r,onChange:g,"aria-describedby":b,className:"mt-0.5 h-5 w-5 shrink-0 accent-[var(--kin-flame-d)]"}),n[17]=r,n[18]=b,n[19]=g,n[20]=x):x=n[20],n[21]!==i.title?(p=t.jsx("span",{className:"block font-semibold text-[15px]",children:i.title}),n[21]=i.title,n[22]=p):p=n[22],o=b,d="mt-1 block leading-relaxed text-[var(--kin-ink-2)]",c=i.description,n[23]!==i.markers?(f=i.markers.map(_temp).join(" · "),n[23]=i.markers,n[24]=f):f=n[24],n[25]!==f?(u=t.jsx("span",{className:"mt-1 block",children:f}),n[25]=f,n[26]=u):u=n[26],m=a.length>0&&t.jsxs("span",{className:"mt-1 block",children:["Not offered at ",a.map(_temp2).join(" or ")]}),n[0]=i,n[1]=s,n[2]=r,n[3]=l,n[4]=o,n[5]=d,n[6]=c,n[7]=u,n[8]=m,n[9]=p,n[10]=h,n[11]=x}
1else o=n[4],d=n[5],c=n[6],u=n[7],m=n[8],p=n[9],h=n[10],x=n[11];return n[27]!==o||n[28]!==d||n[29]!==c||n[30]!==u||n[31]!==m?(b=t.jsxs("span",{id:o,className:d,children:[c,u,m]}),n[27]=o,n[28]=d,n[29]=c,n[30]=u,n[31]=m,n[32]=b):b=n[32],n[33]!==p||n[34]!==b?(g=t.jsxs("span",{children:[p,b]}),n[33]=p,n[34]=b,n[35]=g):g=n[35],n[36]!==g||n[37]!==h||n[38]!==x?(f=t.jsxs("label",{className:h,children:[x,g]}),n[36]=g,n[37]=h,n[38]=x,n[39]=f):f=n[39],f}function _temp2(e){return D[e]}function _temp(e){return e.label}function LabsPage(){const i=a.c(53),{member:s}=f(),r=null!=s&&!0!==s.app_access_enabled,l=function(){const e=a.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:R.catalog,queryFn:_temp$1,staleTime:3e5},e[0]=t):t=e[0],n(t)}(),[c]=e.useState(readCheckoutReturn),u="success"===c.outcome?c.orderId:null;let m;i[0]!==u?(m={awaitingOrderId:u},i[0]=u,i[1]=m):m=i[1];const b=function(e){const t=a.c(4);let i;t[0]!==e?(i=void 0===e?{}:e,t[0]=e,t[1]=i):i=t[1];const s=i;let r;return t[2]!==s?(r={queryKey:E.orders,queryFn:_temp$3,staleTime:3e4,retry:!1,refetchInterval:e=>{const t=s.awaitingOrderId;if(!t||e.state.dataUpdateCount>40)return!1;const a=e.state.data?.find(e=>e.orderId===t);return(!a||"pending_payment"===a.status)&&3e3}},t[2]=s,t[3]=r):r=t[3],n(r)}(m),[g,k]=e.useState(null),[v,y]=e.useState(null),[N,w]=e.useState(null);let _;i[2]===Symbol.for("react.memo_cache_sentinel")?(_=[],i[2]=_):_=i[2];const[S,C]=e.useState(_),[P,I]=e.useState(null),[A,L]=e.useState(""),O=l.data?.categories??[];let q;i[3]!==l.data?.supportedCombinations?(q=l.data?.supportedCombinations??[],i[3]=l.data?.supportedCombinations,i[4]=q):q=i[4];const D=q,G=l.data?.addOns??[],U=O.filter(_temp3),W=U.filter(_temp4),K=U.filter(_temp5),V=O.filter(_temp6);let H;i[5]!==v?(H=e=>e.id===v,i[5]=v,i[6]=H):H=i[6];const Y=U.find(H);let Q;if(i[7]!==N||i[8]!==D){let e;i[10]!==N?(e=e=>e.id===N,i[10]=N,i[11]=e):e=i[11],Q=D.find(e),i[7]=N,i[8]=D,i[9]=Q}else Q=i[9];const z=Q,J=z??Y,X=z?.id??Y?.id,Z=Y&&!z?B[Y.id]:void 0,ee=Y&&!z?G.filter(e=>!e.markerIds.every(e=>Y.markerIds.includes(e))&&e.supportedLabs.some(e=>Y.supportedLabs.includes(e))):[];let te;i[12]!==S?(te=e=>S.includes(e.id),i[12]=S,i[13]=te):te=i[13];const ae=ee.filter(te).map(_temp7),ne=z?.categoryIds??(Y?[Y.id,...ae]:[]),ie=function(e,t,i){const s=a.c(12);let r,l;s[0]!==e||s[1]!==t||s[2]!==i?(r=R.preview(e,"recommended",i),s[0]=e,s[1]=t,s[2]=i,s[3]=r):r=s[3],s[4]!==e||s[5]!==t||s[6]!==i?(l=()=>x.labs().previewQuote(e,void 0,i),s[4]=e,s[5]=t,s[6]=i,s[7]=l):l=s[7];const o=e.length>0;let d;return s[8]!==r||s[9]!==l||s[10]!==o?(d={queryKey:r,queryFn:l,enabled:o,retry:!1},s[8]=r,s[9]=l,s[10]=o,s[11]=d):d=s[11],n(d)}(ne,null,A&&A!==$?A:A===$?"XX":void 0),se=ie.data?.breakdown;let re;if(i[14]!==se?.options||i[15]!==se?.recommendedLab||i[16]!==P){const e=se?.options.filter(_temp8).map(_temp9)??[];re=P&&e.includes(P)?P:se?.recommendedLab??null,i[14]=se?.options,i[15]=se?.recommendedLab,i[16]=P,i[17]=re}else re=i[17];const le=re,oe=l.error instanceof h&&"LABS_ACCESS_DENIED"===l.error.code,de=e.useRef(null);let ce;e.useEffect(()=>{X&&de.current?.focus()},[X]),i[18]===Symbol.for("react.memo_cache_sentinel")?(ce=e=>{y(e.id),w(null),C([]),I(null)},i[18]=ce):ce=i[18];const ue=ce;let me;i[19]===Symbol.for("react.memo_cache_sentinel")?(me=e=>{C(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),I(null)},i[19]=me):me=i[19];const pe=me;let he;i[20]===Symbol.for("react.memo_cache_sentinel")?(he=e=>{w(e.id),y(null),C([]),I(null)},i[20]=he):he=i[20];const xe=he;let be;i[21]!==b.data?(be=b.data??[],i[21]=b.data,i[22]=be):be=i[22];const ge=be;let fe;if(i[23]!==c.orderId||i[24]!==ge){let e;i[26]!==c.orderId?(e=e=>e.orderId===c.orderId,i[26]=c.orderId,i[27]=e):e=i[27],fe=ge.find(e),i[23]=c.orderId,i[24]=ge,i[25]=fe}else fe=i[25];const ke=fe;let ve;i[28]!==r||i[29]!==ge?(ve=r&&ge.some(_temp0),i[28]=r,i[29]=ge,i[30]=ve):ve=i[30];const ye=ve,je=p;let Ne,we,_e,Se,Ce;i[31]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsxs("div",{className:"rounded-2xl border border-[var(--kin-line)] bg-[var(--kin-paper)] p-5 sm:p-7",children:[t.jsx("span",{className:"kin-eye !text-[12px]",children:"A Phoenix member benefit"}),t.jsx("h2",{className:"kin-display mt-2 text-[26px] leading-tight text-[var(--kin-ink)] sm:text-[32px]",children:"Order your blood tests."}),t.jsx("p",{className:"mt-3 max-w-2xl text-[15px] leading-relaxed text-[var(--kin-ink-2)]",children:T}),t.jsx("p",{className:"mt-2 max-w-2xl text-[15px] leading-relaxed text-[var(--kin-ink-2)]",children:j})]}),i[31]=Ne):Ne=i[31],i[32]!==c.outcome||i[33]!==ke?(we="success"===c.outcome&&t.jsx("div",{role:"status",className:"rounded-xl border border-[var(--kin-line)] bg-[var(--kin-bg)] p-4 text-[15px] text-[var(--kin-ink)]",children:ke&&"pending_payment"!==ke.status?"Payment received. Weâll email you when your order is placed.":"Thank y
1ou. Weâre confirming your payment; this takes a few seconds."}),i[32]=c.outcome,i[33]=ke,i[34]=we):we=i[34],i[35]!==c.outcome?(_e="cancelled"===c.outcome&&t.jsx("div",{role:"status",className:"rounded-xl border border-[var(--kin-line)] bg-[var(--kin-bg)] p-4 text-[15px] text-[var(--kin-ink)]",children:"Payment cancelled. Nothing was charged."}),i[35]=c.outcome,i[36]=_e):_e=i[36],i[37]!==l.isPending?(Se=l.isPending&&t.jsx("p",{role:"status",className:"text-[15px] text-[var(--kin-ink-2)]",children:"Loading lab panelsâ¦"}),i[37]=l.isPending,i[38]=Se):Se=i[38],i[39]!==oe||i[40]!==l?(Ce=l.isError&&t.jsxs("div",{role:"alert",className:"kin-card kin-card--hairline p-6",children:[t.jsx("h2",{className:"kin-display text-[22px] text-[var(--kin-ink)]",children:oe?"Membership required":"Panels are unavailable right now"}),t.jsx("p",{className:"mt-2 text-[15px] text-[var(--kin-ink-2)]",children:oe?"Lab orders require an active Phoenix membership.":"Please try again. No order or payment has been started."}),!oe&&t.jsx("button",{type:"button",onClick:()=>{l.refetch()},className:"kin-btn kin-btn--ghost mt-4 min-h-[48px] focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:"Try again"})]}),i[39]=oe,i[40]=l,i[41]=Ce):Ce=i[41];const Pe=l.isSuccess&&t.jsxs(t.Fragment,{children:[W.length>0&&t.jsxs("section",{"aria-labelledby":"plans-heading",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h2",{id:"plans-heading",className:"kin-display text-[24px] text-[var(--kin-ink)]",children:"Phoenix plans"}),t.jsx("p",{className:"mt-1 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"Choose one plan. You can add extras to the same order: one lab, one blood draw."})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:W.map(e=>t.jsx(CategoryCard,{category:e,selected:e.id===Y?.id,onSelect:ue},e.id))})]}),t.jsxs("details",{className:"group rounded-2xl border border-[var(--kin-line)] bg-[var(--kin-paper)] p-5 sm:p-7",children:[t.jsxs("summary",{className:"flex min-h-[48px] cursor-pointer items-center justify-between gap-3 font-semibold text-[17px] text-[var(--kin-ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2",children:[t.jsx("span",{children:"Not sure? Get guidance"}),t.jsx(o,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)] group-open:rotate-180","aria-hidden":"true"})]}),t.jsxs("div",{className:"mt-4 space-y-6",children:[t.jsxs("section",{"aria-labelledby":"intent-heading",children:[t.jsx("h2",{id:"intent-heading",className:"kin-display text-[22px] text-[var(--kin-ink)]",children:"Where would you like to start?"}),t.jsx("p",{className:"mt-1 mb-4 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"Choose the reason youâre looking at bloodwork. You can change paths at any time."}),t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsxs("button",{type:"button","aria-pressed":"baseline"===g,onClick:()=>k("baseline"),className:"kin-card kin-card--hairline min-h-[112px] rounded-xl p-5 text-left hover:border-[var(--kin-flame-d)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2 "+("baseline"===g?"border-2 border-[var(--kin-flame-d)]":""),children:[t.jsx("span",{className:"kin-display block text-[21px] text-[var(--kin-ink)]",children:"Establish a baseline"}),t.jsx("span",{className:"mt-2 block text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"A Phoenix plan brings several parts of your bloodwork into one starting picture."})]}),t.jsxs("button",{type:"button","aria-pressed":"follow_up"===g,onClick:()=>k("follow_up"),className:"kin-card kin-card--hairline min-h-[112px] rounded-xl p-5 text-left hover:border-[var(--kin-flame-d)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2 "+("follow_up"===g?"border-2 border-[var(--kin-flame-d)]":""),children:[t.jsx("span",{className:"kin-display block text-[21px] text-[var(--kin-ink)]",children:"Follow up on a change"}),t.jsx("span",{className:"mt-2 block text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"A focused panel for markers youâre tracking with your clinician."})]})]}),g&&t.jsx("p",{className:"mt-4 max-w-3xl text-[15px] leading-relaxed text-[var(--kin-ink-2)]",children:"baseline"===g?"Start with a Phoenix plan above. Baseline covers the core markers; Foundation adds Lp(a), thyroid, inflammation and more.":"Choose a focused panel below covering the markers you agreed to review. Which tests to repeat, and when, depend on your situation."}),M&&t.jsxs("a",{href:M.pdfPath,target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-flex min-h-[48px] items-center gap-2 font-semibold text-[14px] text-[var(--kin-flame-d)] underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2",children:["Open the Blood Work Blueprint (PDF) ",t.jsx(d,{className:"h-4 w-4","aria-hidden":"true"})]})]}),t.jsx(LabGuidance,{intent:g})]})]}
1),t.jsxs("section",{"aria-labelledby":"category-heading",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h2",{id:"category-heading",className:"kin-display text-[24px] text-[var(--kin-ink)]",children:"Focused panels"}),t.jsx("p",{className:"mt-1 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"Choose one panel, or one of the pairs below."})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:K.map(e=>t.jsx(CategoryCard,{category:e,selected:e.id===Y?.id,onSelect:ue},e.id))})]}),D.length>0&&t.jsxs("section",{"aria-labelledby":"combinations-heading",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h2",{id:"combinations-heading",className:"kin-display text-[24px] text-[var(--kin-ink)]",children:"Two panels together"}),t.jsx("p",{className:"mt-1 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"These pairs come in one order with one blood draw. Other combinations are not available yet."})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:D.map(e=>t.jsx(CombinationCard,{combination:e,selected:e.id===z?.id,onSelect:xe},e.id))})]}),J&&t.jsxs("section",{ref:de,tabIndex:-1,"aria-labelledby":"review-heading",className:"kin-card kin-card--hairline rounded-2xl p-5 sm:p-7 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)]",children:[t.jsx("span",{className:"kin-eye !text-[12px]",children:"Your order"}),t.jsx("h2",{id:"review-heading",className:"kin-display mt-2 text-[24px] text-[var(--kin-ink)]",children:J.title}),Z&&t.jsx("p",{className:"mt-2 max-w-3xl text-[15px] leading-relaxed text-[var(--kin-ink-2)]",children:Z}),ee.length>0&&t.jsxs("fieldset",{className:"mt-5",children:[t.jsx("legend",{className:"font-semibold text-[15px] text-[var(--kin-ink)]",children:"Add extras"}),t.jsx("p",{className:"mt-1 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"Extras are added to the same order: one lab, one blood draw."}),t.jsx("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:ee.map(e=>t.jsx(AddOnOption,{addOn:e,baseLabs:Y?.supportedLabs??F,checked:ae.includes(e.id),onToggle:pe},e.id))})]}),ie.data&&ie.data.markers.length>0&&t.jsxs("details",{className:"group mt-5",children:[t.jsxs("summary",{className:"flex min-h-[48px] cursor-pointer items-center justify-between gap-3 font-semibold text-[16px] text-[var(--kin-ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--kin-flame-d)] focus-visible:ring-offset-2",children:[t.jsxs("span",{children:["See all ",ie.data.markers.length," marker",1===ie.data.markers.length?"":"s"," in this order"]}),t.jsx(o,{className:"h-5 w-5 shrink-0 text-[var(--kin-flame-d)] group-open:rotate-180","aria-hidden":"true"})]}),t.jsx("p",{className:"mt-1 text-[13px] text-[var(--kin-ink-2)]",children:"Some numbers are calculated from other results, so they do not need a separate test."}),t.jsx("ul",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:ie.data.markers.map(_temp1)})]}),t.jsx(LabOrderPanel,{categoryIds:ne,markerIds:ie.data?.markerIds??[],breakdown:se,breakdownPending:ie.isPending,breakdownError:ie.isError,stateCode:A,onStateChange:e=>{L(e),I(null)},selectedLab:le,onSelectLab:I,onPricesChanged:()=>{ie.refetch()}})]}),b.isSuccess&&t.jsx(LabOrderHistory,{orders:ge}),b.isSuccess&&ye&&t.jsx(EmberLabUpgradeCard,{}),t.jsx(SandboxOrderJourney,{categoryIds:ne,lab:le,canQuote:null!==le&&!ie.isError&&!ie.isPending&&ne.length<=2}),V.length>0&&t.jsxs("section",{"aria-labelledby":"held-heading",children:[t.jsx("h2",{id:"held-heading",className:"kin-display text-[24px] text-[var(--kin-ink)]",children:"Coming later"}),t.jsx("p",{className:"mt-1 mb-4 text-[14px] leading-relaxed text-[var(--kin-ink-2)]",children:"These panels need a few more tests confirmed before they can be offered."}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:V.map(e=>t.jsx(CategoryCard,{category:e,selected:!1,onSelect:ue},e.id))})]})]});let Te,Ie,Ae;return i[42]===Symbol.for("react.memo_cache_sentinel")?(Te=t.jsx("p",{className:"text-[13px] leading-relaxed text-[var(--kin-ink-2)]",children:"Core members can upload blood-test results for analysis and tracking."}),i[42]=Te):Te=i[42],i[43]!==Ne||i[44]!==we||i[45]!==_e||i[46]!==Se||i[47]!==Ce||i[48]!==Pe?(Ie=t.jsxs("div",{className:"mx-auto max-w-5xl space-y-9 pb-12",children:[Ne,we,_e,Se,Ce,Pe,Te]}),i[43]=Ne,i[44]=we,i[45]=_e,i[46]=Se,i[47]=Ce,i[48]=Pe,i[49]=Ie):Ie=i[49],i[50]!==je||i[51]!==Ie?(Ae=t.jsx(je,{title:"Lab tests",subtitle:"Order blood tests at the lab's price",children:Ie}),i[50]=je,i[51]=Ie,i[52]=Ae):Ae=i[52],Ae}function _temp1(e){return t.jsxs("li",{className:"flex items-start gap-2 text-[14px] text-[var(--kin-ink)]",children:[t.jsx(c,{className:"mt-0.5 h-4 w-4 shrink-0 text-[var(--kin-flame-d)]","aria-hidden":"true"}),e.label,e.calculated?" (calculated)":""]},e.id)}function _temp0(e){return G.includes(e.status)}function _temp9(e){return e.lab}function _temp8(e){return e.available}function _temp7(e){return e.id}function _temp6(e){return"held"===e.availability}function _temp5(e){return"plan"!==e.group}function _temp4(e){return"plan"===e.group}function _temp3(e){return"review_only"===e.availability}export{LabsPage};
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.