1import{z as O,r as x,j as e,bm as _,m as p}from"./index-u0HMC9Vb.js";const h=[{id:"q1",section:"A",text:"When encountering something new, what draws you in first?",options:[{label:"The feeling it gives",value:"A"},{label:"How it is structured",value:"B"},{label:"The idea behind it",value:"C"},{label:"The contrast or tension within it",value:"D"}]},{id:"q2",section:"A",text:"What do you instinctively respond to most?",options:[{label:"Atmosphere",value:"A"},{label:"Order",value:"B"},{label:"Possibility",value:"C"},{label:"Intensity",value:"D"}]},{id:"q3",section:"A",text:"When gathering inspiration, you are usually:",options:[{label:"Following a mood or feeling",value:"A"},{label:"Looking for systems or patterns",value:"B"},{label:"Exploring multiple directions",value:"C"},{label:"Searching for something striking",value:"D"}]},{id:"q4",section:"A",text:"When creating something, your starting point is usually:",options:[{label:"A feeling",value:"A"},{label:"A structure",value:"B"},{label:"A concept",value:"C"},{label:"A strong visual or idea",value:"D"}]},{id:"q5",section:"A",text:"When something feels off, you:",options:[{label:"Adjust the tone",value:"A"},{label:"Reorganise the structure",value:"B"},{label:"Rethink the direction",value:"C"},{label:"Intensify or simplify it",value:"D"}]},{id:"q6",section:"A",text:"Which approach feels closest to you?",options:[{label:"Subtle and layered",value:"A"},{label:"Clear and structured",value:"B"},{label:"Experimental and open",value:"C"},{label:"Defined and intentional",value:"D"}]},{id:"q7",section:"A",text:"When something feels incomplete, you are more likely to:",options:[{label:"Deepen the atmosphere",value:"A"},{label:"Refine the structure",value:"B"},{label:"Expand the idea",value:"C"},{label:"Sharpen the expression",value:"D"}]},{id:"q8",section:"A",text:"Which process feels more natural to you?",options:[{label:"Layering and adjusting over time",value:"A"},{label:"Organising and refining step by step",value:"B"},{label:"Exploring before deciding",value:"C"},{label:"Defining a strong direction early",value:"D"}]},{id:"q9",section:"B",text:"When working on something, what feels most natural?",options:[{label:"Starting from something personal",value:"A"},{label:"Understanding who it's for first",value:"B"},{label:"Bringing both together",value:"C"}]},{id:"q10",section:"B",text:"When receiving a brief, you:",options:[{label:"Filter it through your own perspective",value:"A"},{label:"Try to understand it as accurately as possible",value:"B"},{label:"Interpret and reshape it",value:"C"}]},{id:"q11",section:"B",text:"When reviewing your work, you ask:",options:[{label:"Does this feel like me?",value:"A"},{label:"Does this work for them?",value:"B"},{label:"Does this balance both?",value:"C"}]},{id:"q12",section:"B",text:"You feel most challenged when:",options:[{label:"You can't express your own voice",value:"A"},{label:"You don't understand the user",value:"B"},{label:"You can't reconcile both",value:"C"}]},{id:"q13",section:"B",text:"If your instinct conflicts with a requirement, you:",options:[{label:"Prioritise your instinct",value:"A"},{label:"Adjust to the requirement",value:"B"},{label:"Integrate both",value:"C"}]},{id:"q14",section:"B",text:"When collaborating with someone, you tend to:",options:[{label:"Bring your perspective strongly",value:"A"},{label:"Listen and adapt carefully",value:"B"},{label:"Balance both perspectives",value:"C"}]},{id:"q15",section:"C",text:"When developing an idea, you tend to:",options:[{label:"Let it evolve from a feeling",value:"A"},{label:"Build it through structure",value:"B"},{label:"Explore multiple possibilities",value:"C"},{label:"Refine a strong direction",value:"D"}]},{id:"q16",section:"C",text:"When something works well, it is because:",options:[{label:"It feels right",value:"A"},{label:"It makes sense",value:"B"},{label:"It opens possibilities",value:"C"},{label:"It communicates clearly",value:"D"}]},{id:"q17",section:"C",text:"When making final decisions, you prioritise:",options:[{label:"Emotional coherence",value:"A"},{label:"Logical clarity",value:"B"},{label:"Conceptual strength",value:"C"},{label:"Expressive impact",value:"D"}]},{id:"q18",section:"C",text:"When interpreting someone else's idea, you:",options:[{label:"Reframe it through your own lens",value:"A"},{label:"Preserve it accurately",value:"B"},{label:"Translate it into something new",value:"C"}]},{id:"q19",section:"C",text:"When you feel confident in your work, it's because:",options:[{label:"It feels aligned internally",value:"A"},{label:"It holds together logically",value:"B"},{label:"It expands possibilities",value:"C"},{label:"It communicates strongly",value:"D"}]},{id:"q20",section:"C",text:"When refining something, you prioritise:",options:[{label:"Emotional depth",value:"A"},{label:"Structural clarity",value:"B"},{label:"Conceptual expansion",value:"C"},{label:"Visual precision",value:"D"}]}],P=new Set(["q1","q2","q3","q4","q5","q6","q7","q8"]),W=new Set(["q9","q10","q11","q12","q13","q14"]),w=new Set(["q15","q16","q17","q18","q19","q20"]);function L(c){const t={SORA:0,AERO:0,NOVA:0,ONYX:0},l={A:"SORA",B:"AERO",C:"NOVA",D:"ONYX"};
1[...P,...w].forEach(n=>{const s=c[n];l[s]&&t[l[s]]++});const i=Object.entries(t).sort((n,s)=>s[1]-n[1]);return{primary:i[0][0],secondary:i[1][0]}}function M(c){const t={self:0,other:0,synthesis:0};[...W].forEach(n=>{const s=c[n];s==="A"?t.self++:s==="B"?t.other++:s==="C"&&t.synthesis++}),[...w].forEach(n=>{const s=c[n];s==="A"||s==="D"?t.self++:(s==="B"||s==="C")&&t.synthesis++});const i=30/(t.self+t.other+t.synthesis||1);return{self:Math.round(t.self*i),other:Math.round(t.other*i),synthesis:Math.round(t.synthesis*i)}}const Y={A:"PERCEPTION + DECISION",B:"ORIENTATION",C:"SYNTHESIS"};function G(){var v;const c=O(),[t,l]=x.useState(0),[i,n]=x.useState({}),[s,N]=x.useState(null),[S,f]=x.useState(!1),d=h[t-1],C=t===0?0:Math.round(t/h.length*100),k=a=>{const r={...i,[d.id]:a};n(r),t<h.length?l(o=>o+1):q(r)},q=async a=>{var A;f(!0),l(21),await new Promise(j=>setTimeout(j,1500));const{primary:r,secondary:o}=L(a),u=M(a),m=await p.auth.me(),D=String(Math.floor(Math.random()*1e4)).padStart(4,"0"),I=Array.from({length:2},()=>String.fromCharCode(65+Math.floor(Math.random()*26))).join(""),y=`TR-${D}-${I}`,g=await p.entities.TRESDAProfile.filter({user_id:m.id});if(g.length>0&&(await p.entities.TRESDAProfile.update(g[0].id,{student_id:y,primary_tra:r,secondary_tra:o,sos_baseline_self:u.self,sos_baseline_other:u.other,sos_baseline_synthesis:u.synthesis}),(await p.entities.PublicProfile.filter({user_id:m.id})).length===0)){const E=`${((A=m.full_name)==null?void 0:A.toLowerCase().replace(/\s+/g,"-"))||"user"}`,R=m.id.slice(-6),T=`${E}-${R}`;await p.entities.PublicProfile.create({user_id:m.id,slug:T,is_public:!0,avatar_url:g[0].avatar_url})}N({primary:r,secondary:o,sos:u,studentId:y}),f(!1),l(22)};if(t===0)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-md w-full",children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-[0.35em] text-muted-foreground mb-8",children:"TRESDA â Identity Assessment"}),e.jsxs("h1",{className:"text-2xl font-display uppercase tracking-tight text-foreground mb-4 leading-tight",children:["Generate your",e.jsx("br",{}),"TRESDA ID"]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed mb-2",children:"This assessment identifies your perceptual patterns and creative orientation."}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed mb-10",children:"It takes approximately 5 minutes. The system will recognise your patterns â not judge them."}),e.jsxs("div",{className:"space-y-2 text-[9px] font-meta uppercase tracking-widest text-muted-foreground/60 mb-10",children:[e.jsx("p",{children:"· 20 questions · ~5 minutes"}),e.jsx("p",{children:"· Primary + Secondary TRA assigned"}),e.jsx("p",{children:"· SOS baseline generated"}),e.jsx("p",{children:"· TRESDA ID issued immediately"})]}),e.jsx("button",{onClick:()=>l(1),className:"text-[10px] font-meta uppercase tracking-[0.25em] px-8 py-3 bg-foreground text-background hover:opacity-80 transition-opacity",children:"Begin"})]})});if(t===21||S)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-[0.35em] text-muted-foreground",children:"Processing your responsesâ¦"})});if(t===22&&s){const a=_(s.primary,s.secondary),r=((v=a==null?void 0:a.identitySummary)==null?void 0:v.simple)||null;return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-6 py-12",children:e.jsxs("div",{className:"max-w-sm w-full",children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-[0.35em] text-muted-foreground mb-12",children:"TRESDA ID Generated"}),e.jsxs("div",{className:"mb-10",children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/50 mb-2",children:"TRESDA ID"}),e.jsx("p",{className:"text-xl font-mono tracking-wider text-foreground",children:s.studentId})]}),e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground
1/50 mb-1",children:"Primary TRA"}),e.jsx("p",{className:"text-sm font-meta uppercase tracking-widest text-foreground",children:s.primary})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/50 mb-1",children:"Secondary TRA"}),e.jsx("p",{className:"text-sm font-meta uppercase tracking-widest text-muted-foreground",children:s.secondary})]})]}),r&&e.jsxs("div",{className:"border-l border-border pl-4 mb-8",children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/40 mb-1.5",children:"In simple terms"}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r})]}),e.jsxs("div",{className:"mb-12 border-t border-border pt-6 space-y-3",children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/40 mb-4",children:"SOS"}),[{label:"Self",value:s.sos.self},{label:"Other",value:s.sos.other},{label:"Synthesis",value:s.sos.synthesis}].map(({label:o,value:u})=>e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-[10px] font-meta uppercase tracking-widest text-muted-foreground",children:o}),e.jsx("span",{className:"text-[10px] font-meta text-foreground tabular-nums",children:u})]},o))]}),e.jsx("button",{onClick:()=>c("/campus"),className:"text-[10px] font-meta uppercase tracking-[0.25em] px-8 py-3 bg-foreground text-background hover:opacity-80 transition-opacity",children:"â Continue"})]})})}const b=h[t-2],B=t===1||d.section!==(b==null?void 0:b.section);return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-md w-full",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-12",children:[e.jsx("div",{className:"flex-1 h-px bg-border relative",children:e.jsx("div",{className:"absolute top-0 left-0 h-px bg-foreground transition-all duration-500",style:{width:`${C}%`}})}),e.jsxs("span",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/50 flex-shrink-0",children:[t," / ",h.length]})]}),B&&e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-[0.35em] text-muted-foreground/40 mb-5",children:Y[d.section]}),e.jsx("h2",{className:"text-base font-display uppercase tracking-tight text-foreground mb-10 leading-snug",children:d.text}),e.jsx("div",{className:"space-y-3",children:d.options.map(a=>e.jsx("button",{onClick:()=>k(a.value),className:"w-full text-left border border-border px-5 py-4 text-xs text-foreground hover:border-foreground
1/60 hover:bg-muted/30 transition-all",children:a.label},a.value))})]})})}export{G 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.