/* global React */ const { useState, useEffect, useRef } = React; // ============================================================================ // STEP 9 — Consents (the legal weight of the moment) // ============================================================================ window.SU.Step9Consents = function Step9Consents({ data, set, isMinor }) { const consents = data.consents || {}; function toggle(id) { set({ consents: { ...consents, [id]: !consents[id] } }); } const CONSENTS = []; const visible = CONSENTS.filter(c => !c.onlyMinor || isMinor); const required = visible.filter(c => c.tag.startsWith("Required") || c.tag === "All members" || c.id === "minor"); const allRequiredOK = required.every(c => consents[c.id]); return ( <>
Step 9 of 12 · Consents & agreements

The fine print, made plain.

Read the summary, expand the full document if you want every word. Tap to consent. Required items are marked. You can revoke any consent at any time from your Guardian Orb settings — though some revocations will pause the connected service.

{visible.map(c => { const isReq = c.tag.startsWith("Required") || c.tag === "All members" || c.id === "minor"; return (

{c.title}

{c.tag}
{c.summary}
📜 {c.doc} · e.preventDefault()} style={{ color: "var(--accent-clinical)", textDecoration: "underline" }}>read full text
); })} Counter-signed by us. When you tap "Continue," our compliance team's signing key counter-signs your consent record on the Conceptual Chain. You'll receive a permanent receipt — block height, hash, and a PDF copy by email — within 60 seconds. {!allRequiredOK && Some required consents are still unchecked.} ); }; // ============================================================================ // STEP 10 — Verification (email + SMS code + passkey + insurance card scan) // ============================================================================ window.SU.Step10Verify = function Step10Verify({ data, set }) { const [emailCode, setEmailCode] = useState(data.emailCodeInput || ""); const [smsCode, setSmsCode] = useState(data.smsCodeInput || ""); const [emailSent, setEmailSent] = useState(false); const [smsSent, setSmsSent] = useState(false); useEffect(() => { const t1 = setTimeout(() => setEmailSent(true), 600); const t2 = setTimeout(() => setSmsSent(true), 1200); return () => { clearTimeout(t1); clearTimeout(t2); }; }, []); function checkEmail(v) { setEmailCode(v); set({ emailCodeInput: v }); if (v === "739218" || v.length === 6) set({ emailVerified: true }); } function checkSms(v) { setSmsCode(v); set({ smsCodeInput: v }); if (v === "402851" || v.length === 6) set({ smsVerified: true }); } return ( <>
Step 10 of 12 · Final verification

Three quick checks.

Confirming your contact channels and locking in a passkey. From this point forward, your account is sealed — every change requires multi-factor approval.

1 · Email verification

{emailSent ? <>We sent a 6-digit code to {data.email || "your email"}. Demo code: 739218 : "Sending code…"}
checkEmail(e.target.value)} placeholder="• • • • • •" maxLength={6} style={{ maxWidth: 220, fontFamily: "var(--font-mono)", fontSize: 22, letterSpacing: "0.4em", textAlign: "center" }} /> {data.emailVerified && ( Verified )}

2 · SMS verification

{smsSent ? <>Code sent to {data.phone || "your phone"}. Demo code: 402851 : "Sending code…"}
checkSms(e.target.value)} placeholder="• • • • • •" maxLength={6} style={{ maxWidth: 220, fontFamily: "var(--font-mono)", fontSize: 22, letterSpacing: "0.4em", textAlign: "center" }} /> {data.smsVerified && ( Verified )}

3 · Add a passkey · strongly recommended

A passkey replaces your password with biometric or device-bound auth. Phishing-resistant, FIDO2 compliant. Stored on your device — we never see it.
Recovery. If you ever lose access, our 4-of-7 social recovery scheme can restore your account. You'll set up recovery contacts in Guardian Orb after onboarding — it takes about 90 seconds. ); }; // ============================================================================ // STEP 11 — Wallet mint + vault seal (the moment of ceremony) // ============================================================================ window.SU.Step11Mint = function Step11Mint({ data, set }) { const [phase, setPhase] = useState(0); // 0: idle, 1: minting, 2: sealing, 3: complete useEffect(() => { if (phase === 0) return; const dur = phase === 1 ? 1800 : phase === 2 ? 1600 : 0; if (phase < 3) { const t = setTimeout(() => setPhase(phase + 1), dur); return () => clearTimeout(t); } if (phase === 3) set({ minted: true }); }, [phase]); function start() { setPhase(1); } const blockHeight = 18472311 + (data.minted ? 1 : 0); const txHash = "0x" + (data.firstName || "user").toLowerCase().slice(0, 4).padEnd(4, "x") + "9c4a2f87b1e30d6c5d8a472e8f1c93a0b"; const memberId = "CH-" + (data.lastName || "MBR").toUpperCase().slice(0, 3).padEnd(3, "X") + "-" + Math.floor(100000 + Math.random() * 900000); return ( <>
Step 11 of 12 · Mint & seal

Your ledger entry.

Two things happen now, atomically. (1) Your HEALTHCOIN™ wallet is minted on the Conceptual Chain. (2) Your medical vault is sealed — encrypted with a key only your authenticated devices can derive. Both events share a single block. From here, your record is yours, forever.

= 1 ? " active" : "")}>
= 1 ? " spinning" : "")}>
= 2 ? " spinning" : "")}>
= 3 ? " sealed" : "")}> {phase < 3 ? ( {phase === 0 ? "Awaiting" : phase === 1 ? "Minting" : "Sealing"} ) : ( )}
{phase === 0 ? ( ) : (
= 1 ? " on" : "")}> block.proposed #{blockHeight}
= 1 ? " on" : "")}> wallet.minted {txHash.slice(0, 22)}…
= 2 ? " on" : "")}> vault.sealed AES-256-GCM · 4096-bit RSA wrap
= 2 ? " on" : "")}> consents.countersigned 7 / 7 · CHC compliance key
= 3 ? " on" : "")}> block.committed {phase >= 3 ? "✓ finalized" : "pending"}
= 3 ? " on" : "")}> member.id {phase >= 3 ? memberId : "—"}
)}
Your medical vault key is split: half on your device, half escrowed under our compliance HSM. Neither half alone can decrypt anything. Combined under your authenticated session, they unlock your record. We can't read your data; you can't lose it. ); }; // ============================================================================ // STEP 12 — Welcome / eligibility recap // ============================================================================ window.SU.Step12Welcome = function Step12Welcome({ data }) { const services = data.services || {}; const ch = (() => { let v = 50; const ME = []; const s = data.meScores || {}; ME.forEach(a => { const r = s[a.id]; if (r === undefined) return; const n = (r - 3) / 2; const adj = a.inv ? -n : n; v += adj * a.w * 50; }); return Math.max(0, Math.min(100, Math.round(v))); })(); const who = data.preferredName || data.firstName || "there"; return ( <>
Welcome, member

You're in,
{who}.

Your account is live. Your CH0 is anchored. Your vault is sealed. Everything that happens next — every visit, every prescription, every lab, every wearable beat — flows into one place.

Member ID
CH-{(data.lastName || "MBR").toUpperCase().slice(0, 3).padEnd(3, "X")}-{data.minted ? "739241" : "------"}
Starting CH
{ch} / 100
Wallet
0 HCR
KYC tier
Tier 2 ✓

What's active for you

You can change any of these from Guardian Orb → Settings → Services.
{[ { id: "telehealth", label: "Conceptual Telehealth · same-day video, all 50 states" }, { id: "pharmacy", label: "Conceptual Pharmacy · mail-order, free 90-day supply" }, { id: "labs", label: "Conceptual Labs · at-home phlebotomy + Quest/Labcorp routing" }, { id: "wearable", label: "Wearable + EHR sync · Apple, Fitbit, Oura, Epic, Cerner" }, { id: "exchange", label: "hc.exchange · health-outcome contracts (Tier 3 required)" } ].map(s => (
{services[s.id] ? ( ) : ( )} {s.label}
))}

What happens next

  1. We're faxing a records-release to {data.pcpName || "your PCP"} right now. Expect their last 24 months of records in Guardian Orb within 7 business days.
  2. Your insurance is being verified asynchronously — eligibility, copays, and prior-auth requirements will appear in your timeline by morning.
  3. If you opted into Conceptual Pharmacy, you'll receive a welcome packet with two free generic refills.
  4. {data.consents?.exchange ? <>Your hc.exchange paper-trading sandbox is live. To unlock real trading, complete KYC Tier 3 from your account settings. : <>You can opt into hc.exchange anytime from your account settings.}
Open Guardian Orb
); };