PageSourceSearch

https://recoverytrauma.lovable.app/assets/personalise-Cjg0b6BY.js

js recoverytrauma.lovable.app collected 2026-10-03 03:44:49 UTC 7,692 bytes, 2 lines download raw bytes

1import{j as e,aR as E,m as j,d as o,S as P,aj as F,k as w,p as B,aY as N}from"./index-70yz1Rcc.js";import{u as T}from"./use-require-sign-in-Dso4d6Uc.js";import{saveIntake as G,advanceOnboarding as L}from"./onboarding.functions-B8Dgz2sd.js";import{A as $}from"./arrow-left-D1Uc4TKp.js";const H=[{value:"overwhelmed",label:"Overwhelmed",hint:"A lot is piling up right now."},{value:"anxious",label:"Anxious",hint:"My body feels alert or on edge."},{value:"numb",label:"Numb / flat",hint:"I feel disconnected or foggy."},{value:"stuck",label:"Stuck",hint:"I keep circling the same place."},{value:"grieving",label:"Grieving",hint:"I'm sitting with a loss."},{value:"hopeful",label:"Hopeful, curious",hint:"I'm ready to explore gently."}],O=[{value:"safety",label:"Feel safer in my body",hint:"Grounding, breathing, calm."},{value:"regulate",label:"Regulate strong emotions",hint:"Ride the wave without drowning."},{value:"process",label:"Process past experiences",hint:"Slowly, at my pace."},{value:"routine",label:"Build a gentle daily rhythm",hint:"Small habits that hold me."},{value:"relationships",label:"Feel steadier in relationships",hint:"Boundaries and connection."},{value:"sleep",label:"Sleep and rest better",hint:"Wind down a wired system."}],Y=["Anxiety","CPTSD","Childhood Trauma","Flashbacks","Emotional Regulation","Grounding","Breathing","Somatic Healing","Sleep","Dissociation","Panic","Boundaries","Self-Esteem","Relationships","Inner Child","Grief","Attachment","Burnout"];function J(){return T()?e.jsx(q,{}):e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center px-6 text-sm text-muted-foreground",role:"status",children:"Checking you're signed in…"})}function q(){const i=E(),g=j(G),h=j(L),[s,d]=o.useState(0),[r,c]=o.useState(""),[p,k]=o.useState(""),[u,I]=o.useState(new Set),[l,x]=o.useState(!1),[f,m]=o.useState(null);function C(t){I(a=>{const n=new Set(a);return n.has(t)?n.delete(t):n.add(t),n})}async function R(){m(null),x(!0);try{await g({data:{feeling:r||"unspecified",priority:p||"unspecified",interests:Array.from(u)}}),i({to:"/dashboard",replace:!0})}catch(t){m(N(t))}finally{x(!1)}}async function A(){m(null),x(!0);try{await h({data:{step:"done"}}),i({to:"/dashboard",replace:!0})}catch(t){m(N(t))}finally{x(!1)}}const b=s===0&&!!r||s===1&&!!p||s===2,y=["How you feel","Your priority","Areas of focus"];return e.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-10 sm:py-14",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-[var(--gradient-gold)] shadow-[var(--shadow-gold)]",children:e.jsx(P,{className:"h-6 w-6 text-foreground","aria-hidden":"true"})}),e.jsx("h1",{className:"mt-5 font-display text-2xl text-foreground sm:text-3xl",children:"Let's tailor your first steps"}),e.jsx("p",{className:"mx-auto mt-3 max-w-md text-sm leading-relaxed text-foreground/75",children:"Three short questions — about 60 seconds. Your answers stay private and shape the resources we surface first. You can change them any time in your profile."})]}),e.jsx("ol",{className:"mt-8 flex items-center justify-center gap-2","aria-label":"Onboarding progress",children:y.map((t,a)=>{const n=a===s,v=a<s;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex h-7 w-7 items-center justify-center rounded-full border text-xs font-semibold ${v?"border-gold bg-[var(--gradient-gold)] text-foreground":n?"border-gold bg-cream text-foreground":"border-border bg-background text-foreground/40"}`,"aria-current":n?"step":void 0,children:v?e.jsx(F,{className:"h-3.5 w-3.5","aria-hidden":"true"}):a+1}),e.jsx("span",{className:`hidden text-xs sm:inline ${n?"text-foreground":"text-foreground/50"}`,children:t}),a<y.length-1&&e.jsx("span",{className:"mx-1 h-px w-6 bg-border sm:w-10","aria-hidden":"true"})]},t)})}),e.jsxs("div",{className:"mt-8",children:[s===0&&e.jsx(S,{legend:"How are you feeling right now?",name:"feeling",options:H,value:r,onChange:c}),s===1&&e.jsx(S,{legend:"Right now, your biggest priority is…",name:"priority",options:O,value:p,onChange:k}),s===2&&e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-4 text-center font-display text-lg text-foreground",children:"Which areas would you like guidance on?"}),e.jsx("p",{className:"mb-4 text-center text-xs text-foreground
1/60",children:"Pick as many as feel right — optional."}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:Y.map(t=>{const a=u.has(t);return e.jsxs("label",{className:`flex min-h-[52px] cursor-pointer items-center gap-2 rounded-xl border px-3 py-2 text-sm transition ${a?"border-gold bg-cream/70 text-foreground shadow-[var(--shadow-gold)]":"border-border bg-card text-foreground/80 hover:border-gold/50"}`,children:[e.jsx("input",{type:"checkbox",checked:a,onChange:()=>C(t),className:"h-4 w-4 accent-[var(--gold-deep)]"}),e.jsx("span",{children:t})]},t)})}),e.jsx("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:u.size===0?"No selections yet":`${u.size} selected`})]})]}),f&&e.jsx("p",{className:"mt-4 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:f}),e.jsxs("div",{className:"mt-8 flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"flex gap-3",children:s>0?e.jsxs("button",{type:"button",onClick:()=>d(t=>t-1),disabled:l,className:"inline-flex min-h-[48px] items-center gap-2 rounded-full border border-border bg-background px-5 py-3 text-sm font-medium text-foreground/80 disabled:opacity-60",children:[e.jsx($,{className:"h-4 w-4","aria-hidden":"true"})," Back"]}):e.jsx("button",{type:"button",onClick:A,disabled:l,className:"inline-flex min-h-[48px] items-center justify-center rounded-full border border-border bg-background px-5 py-3 text-sm font-medium text-foreground/70 disabled:opacity-60",children:"Skip for now"})}),s<2?e.jsxs("button",{type:"button",onClick:()=>b&&d(t=>t+1),disabled:!b||l,className:"inline-flex min-h-[48px] items-center justify-center gap-2 rounded-full bg-[var(--gradient-gold)] px-6 py-3 text-sm font-semibold text-foreground shadow-[var(--shadow-gold)] disabled:opacity-60",children:["Continue ",e.jsx(w,{className:"h-4 w-4","aria-hidden":"true"})]}):e.jsx("button",{type:"button",onClick:R,disabled:l,className:"inline-flex min-h-[48px] items-center justify-center gap-2 rounded-full bg-[var(--gradient-gold)] px-6 py-3 text-sm font-semibold text-foreground shadow-[var(--shadow-gold)] disabled:opacity-60",children:l?e.jsx(B,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:["Show my tailored dashboard ",e.jsx(w,{className:"h-4 w-4","aria-hidden":"true"})]})})]})]})}function S({legend:i,name:g,options:h,value:s,onChange:d}){return e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-4 text-center font-display text-lg text-foreground",children:i}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:h.map(r=>{const c=s===r.value;return e.jsxs("label",{className:`flex cursor-pointer items-start gap-3 rounded-xl border px-4 py-3 text-start transition ${c?"border-gold bg-cream/70 text-foreground shadow-[var(--shadow-gold)]":"border-border bg-card text-foreground/80 hover:border-gold/50"}`,children:[e.jsx("input",{type:"radio",name:g,checked:c,onChange:()=>d(r.value),className:"mt-1 h-4 w-4 accent-[var(--gold-deep)]"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium",children:r.label}),e.jsx("span",{className:"mt-0.5 block text-xs text-foreground/60",children:r.hint})]})]},r.value)})})]})}export{J as component};
2//# sourceMappingURL=personalise-Cjg0b6BY.js.map

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.