1import{r as d,b as E,u as H,g as P,j as e,C as N,y as I,H as D,z as k,a as S,B as c,d as F,F as A,A as C,L as G,s as W}from"./index-DO0ZNUzu.js";import{R as Q,a as z}from"./radio-group-CNYLzVCg.js";import{P as R}from"./progress-JqVFM1gN.js";import{A as M}from"./arrow-right-CUzZpWVI.js";import"./circle-DEg_pb6A.js";const r=[{id:"mistake-reaction",section:"Self-Talk & Affirmations",question:"When you make a mistake, what's your first reaction?",options:[{value:"a",label:"I'm so dumb, I always mess up.",score:0},{value:"b",label:"Ugh, I could've done better.",score:1},{value:"c",label:"It's okay, I'll learn from this.",score:2},{value:"d",label:"Mistakes are part of growth â I still love myself.",score:3}]},{id:"positive-self-talk",section:"Self-Talk & Affirmations",question:"How often do you say something positive to yourself out loud?",options:[{value:"never",label:"Never",score:0},{value:"once-in-while",label:"Once in a while",score:1},{value:"few-times-week",label:"A few times a week",score:2},{value:"every-day",label:"Every day",score:3}]},{id:"boundaries-response",section:"Boundaries & Self-Care",question:"When someone asks you to do something you don't want to do, how do you respond?",options:[{value:"a",label:"I say yes, even if I don't want to.",score:0},{value:"b",label:"I hesitate, but usually say yes.",score:1},{value:"c",label:"I sometimes say no, depending on the situation.",score:2},{value:"d",label:"I confidently say no when I need to.",score:3}]},{id:"self-care-frequency",section:"Boundaries & Self-Care",question:"How often do you make time for activities that recharge you (rest, nails, a walk, journaling, coffee, etc.)?",options:[{value:"rarely",label:"Rarely",score:0},{value:"once-week",label:"Once a week",score:1},{value:"few-times-week",label:"A few times a week",score:2},{value:"daily",label:"Daily",score:3}]},{id:"mirror-feeling",section:"Body & Self-Image",question:"When you look in the mirror, how do you usually feel?",options:[{value:"a",label:"Critical and unhappy",score:0},{value:"b",label:"Neutral, I don't think much",score:1},{value:"c",label:"Appreciative of some features",score:2},{value:"d",label:"Loving and accepting of myself as I am",score:3}]},{id:"compliment-response",section:"Body & Self-Image",question:"If a friend complimented you today, would you:",options:[{value:"a",label:`Dismiss it ("No, I don't look good")`,score:0},{value:"b",label:'Downplay it ("Thanks, butâ¦")',score:1},{value:"c",label:"Accept it politely",score:2},{value:"d",label:`Smile and say, "Thank you, I know I'm amazing"`,score:3}]},{id:"handle-challenges",section:"Inner Confidence",question:"On a scale of 1â5, how much do you believe in your ability to handle challenges? (1 = I doubt myself often, 5 = I fully trust myself)",options:[{value:"1",label:"1 - I doubt myself often",score:0},{value:"2",label:"2 - I sometimes doubt myself",score:1},{value:"3",label:"3 - I'm moderately confident",score:2},{value:"4",label:"4 - I'm quite confident",score:3},{value:"5",label:"5 - I fully trust myself",score:4}]},{id:"goal-mindset",section:"Inner Confidence",question:"Imagine you set a big goal. What's your mindset?",options:[{value:"a",label:"I probably won't reach it.",score:0},{value:"b",label:"I'll try, but I don't expect much.",score:1},{value:"c",label:"It'll be hard, but I believe I can get close.",score:2},{value:"d",label:"I can absolutely reach it with effort.",score:3}]},{id:"uplifting-people",section:"Relationships with Self & Others",question:"Do you surround yourself with people who uplift and respect you?",options:[{value:"rarely",label:"Rarely",score:0},{value:"sometimes",label:"Sometimes",score:1},{value:"often",label:"Often",score:2},{value:"always",label:"Always",score:3}]},{id:"self-forgiveness",section:"Relationships with Self & Others",question:"How often do you forgive yourself for past mistakes?",options:[{value:"never",label:"Never",score:0},{value:"occasionally",label:"Occasionally",score:1},{value:"often",label:"Often",score:2},{value:"almost-always",label:"Almost always",score:3}]}],X=()=>{const[t,m]=d.useState(0),[u,h]=d.useState({}),[Y,v]=d.useState(!1),[y,b]=d.useState(!1),x=E(),{user:p}=H(),{toast:g}=P(),q=(s,a)=>{h(l=>({...l,[s]:a}))},T=async()=>{t<r.length-1?m(s=>s+1):(await B(),v(!0))},B=async()=>
1{if(p)try{b(!0);const s=w(),a=j(s),n=s/31*100,{error:i}=await W.from("assessment_results").insert({user_id:p.id,assessment_type:"self_love",total_score:s,percentage_score:n,result_title:a.title,result_message:a.message,answers:u});if(i)throw i;g({title:"Assessment Saved",description:"Your assessment results have been saved to your profile."})}catch(s){console.error("Error saving assessment results:",s),g({title:"Save Failed",description:"Failed to save your assessment results. Please try again.",variant:"destructive"})}finally{b(!1)}},O=()=>{t>0&&m(s=>s-1)},w=()=>{let s=0;return Object.entries(u).forEach(([a,l])=>{const n=r.find(f=>f.id===a),i=n==null?void 0:n.options.find(f=>f.value===l);i&&(s+=i.score)}),s},j=s=>{const l=s/31*100;return l>=85?{title:"Self-Love Goddess! ðâ¨",message:"You are absolutely radiant in your self-love journey! You demonstrate incredible self-compassion, strong boundaries, and beautiful confidence. You're an inspiration to others and truly understand your worth. Keep shining, queen!",color:"text-pink-600"}:l>=70?{title:"Blooming Beautifully ðºð",message:"You have a wonderful foundation of self-love! You're practicing many healthy habits and showing yourself compassion. There are still some beautiful areas to explore and grow in. You're on such a loving path!",color:"text-purple-600"}:l>=50?{title:"Growing Your Garden ð±ð",message:"You're planting seeds of self-love and they're starting to bloom! There are areas where you can be even kinder to yourself. This journey is about progress, not perfection. You deserve all the love you're learning to give yourself.",color:"text-green-600"}:{title:"Your Beautiful Beginning ð¸ð¦",message:"You're taking the most courageous step - choosing to love yourself more. Every queen starts somewhere, and you're exactly where you need to be. This journey will transform how you see yourself. You are so worthy of love, especially your own.",color:"text-blue-600"}},_=(t+1)/r.length*100,o=r[t],L=u[o==null?void 0:o.id];if(Y){const s=w(),a=j(s);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("div",{className:"container mx-auto px-4 py-8",children:e.jsxs(N,{className:"max-w-2xl mx-auto",children:[e.jsxs(I,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(D,{className:"h-12 w-12 text-primary"})}),e.jsx(k,{className:"text-2xl md:text-3xl",children:"Your Self-Love Assessment Results"})]}),e.jsxs(S,{className:"space-y-6 text-center",children:[e.jsxs("div",{className:"bg-gradient-card rounded-lg p-6 border",children:[e.jsx("h3",{className:`text-xl font-semibold mb-3 ${a.color}`,children:a.title}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:a.message})]}),e.jsxs("div",{className:"bg-muted rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Your Score"}),e.jsxs("p",{className:"text-2xl font-bold",children:[s," out of 31"]}),e.jsx(R,{value:s/31*100,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(c,{onClick:()=>x("/dashboard"),variant:"wellness",size:"lg",className:"w-full",children:[e.jsx(F,{className:"h-5 w-5 mr-2"}),"Continue Your Wellness Journey"]}),e.jsx(c,{onClick:()=>{m(0),h({}),v(!1)},variant:"outline",className:"w-full",children:"Retake Assessment"})]})]})]})}),e.jsx(A,{})]})}return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs(c,{variant:"ghost",onClick:()=>x("/dashboard"),className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Back to Dashboard"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Question ",t+1," of ",r.length]})]}),e.jsx("div",{className:"mb-8",children:e.jsx(R,{value:_,className:"h-2"})}),e.jsxs(N,{className:"max-w-2xl mx-auto",children:[e.jsxs(I,{children:[e.jsx("div",{className:"text-sm text-primary font-medium mb-2 text-center",children:o.section}),e.jsx(k,{className:"text-xl md:text-2xl text-center",children:o.question})]}),e.jsxs(S,{className:"space-y-6",children:[e.jsx(Q,{value:u[o.id]||"",onValueChange:s=>q(o.id,s),className:"space-y-3",children:o.options.map(s=>e.jsxs("div",{className:"flex items-start space-x-3 p-3 rounded-lg border hover:bg-accent/50 transition-colors cursor-pointer",children:[e.jsx(z,{value:s.value,id:s.value,className:"mt-1"}),e.jsx(G,{htmlFor:s.value,className:"cursor-pointer flex-1 leading-relaxed",children:s.label})]},s.value))}),e.jsxs("div",{className:"flex justify-between pt-6",children:[e.jsxs(c,{variant:"outline",onClick:O,disabled:t===0,className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Previous"]}),e.jsxs(c,{onClick:T,disabled:!L||y,className:"flex items-center gap-2",variant:"wellness",children:[y?"Saving...":t===r.length-1?"See Results":"Next",e.jsx(M,{className:"h-4 w-4"})]})]})]})]})]}),e.jsx(A,{})]})};export{X as default};
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.