1import{r as s,V as D,j as e,m as h,v as k,t as U,b as Y,u as G,a1 as M}from"./index-Bf5Dl9ga.js";import{a as z}from"./SurfaceShell-Bz5CucKi.js";import{S as B}from"./SelectSheet-nAy_KTFF.js";import{i as H}from"./useConnectionStatus-COdaw8uL.js";import{C as V}from"./circle-check-Drs-U1w9.js";import{C as q}from"./chevron-down-nakivCEz.js";import{S as J}from"./send-BsIorSAe.js";import{U as K}from"./user-DApmB3zf.js";/* empty css */const N=[{value:"mother",label:"Mother"},{value:"father",label:"Father"},{value:"guardian",label:"Guardian"},{value:"other",label:"Other"}],Q="I'd love for you to join my T90 Performance Team. I think it will help us understand each other better and help you support me throughout my athletic journey.",X="I'd like to invite you to join my T90 Performance Team. Your insights will help personalize my mental training and improve the way we communicate throughout the season.";function Z({role:a,athleteName:i=void 0,onBack:l}){var j;const[r,m]=s.useState(""),[n,p]=s.useState(""),[u,C]=s.useState(""),[x,I]=s.useState(a==="parent"?Q:X),[b,f]=s.useState(!1),[P,T]=s.useState(!1),[A,y]=s.useState(!1),{toast:g}=D(),o=a==="parent",E=o?"Invite Your Parent":"Invite Your Coach",L=o?"Your parent isn't joining to monitor you. They're joining to understand how to support your growth.":"Your coach already develops your game. Now help them understand how you learn, compete, communicate, and perform under pressure.",R=o?["Your Athlete Profile","Parent Insights","Communication Tips","Growth Updates","Personalized AI Parent Coaching"]:["Athlete Development Dashboard","Communication Insights","Leadership Tendencies","Growth Trends","Reflection Highlights","T90 Coach Assistant"],w=o?"Relationship":"Organization",_=o?"Select relationship":"Team or organization name",W=o?"Invite Parent":"Invite Coach",F=async()=>{var t,v;if(!r.trim()||!u.trim()){g({title:"Missing info",description:"Please enter a name and email.",variant:"destructive"});return}f(!0);try{await Y.functions.invoke("manageInvitation",{action:"send",recipient_type:a,recipient_name:r.trim(),recipient_email:u.trim(),relationship_detail:n,personal_message:x,active_role:"athlete"}),H(),T(!0)}catch(c){const O=((v=(t=c==null?void 0:c.response)==null?void 0:t.data)==null?void 0:v.error)||(c==null?void 0:c.message)||"Something went wrong. Please try again.";g({title:"Invitation failed",description:O,variant:"destructive"})}finally{f(!1)}};return P?e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.35},className:"rounded-[20px] p-7 border border-white/[0.06] t90-metal-card text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/15 border border-primary/30 flex items-center justify-center mx-auto mb-4",children:e.jsx(V,{className:"w-7 h-7 text-primary",strokeWidth:2})}),e.jsx("h3",{className:"text-[18px] font-heading font-bold text-white uppercase mb-2",children:"Invitation Sent"}),e.jsxs("p",{className:"text-[14px] font-body font-light text-white/55 leading-[1.6] mb-6",children:[r.trim()," will receive an email inviting them to join your T90 Performance Team. We'll let you know
1when they accept."]}),e.jsx("button",{onClick:l,className:"inline-flex items-center gap-2 text-[13px] font-heading font-bold text-white uppercase tracking-wide rounded-full px-6 py-2.5 bg-primary border border-primary/40 hover:bg-primary/90 transition-colors",children:"Done"})]}):e.jsxs(h.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3},children:[e.jsxs("button",{onClick:l,className:"inline-flex items-center gap-1.5 text-[13px] font-body font-medium text-white/50 hover:text-white/80 transition-colors mb-4",children:[e.jsx(k,{className:"w-4 h-4",strokeWidth:2}),"Back"]}),e.jsxs("div",{className:"rounded-[20px] p-6 border border-white/[0.06] t90-metal-card",children:[e.jsx("h2",{className:"text-[22px] font-heading font-bold text-white uppercase leading-tight mb-2",children:E}),e.jsx("p",{className:"text-[14px] font-body font-light text-white/55 leading-[1.6] mb-5",children:L}),e.jsxs("div",{className:"rounded-xl bg-white/[0.03] border border-white/[0.05] p-4 mb-6",children:[e.jsx("p",{className:"text-[11px] font-heading font-bold text-primary uppercase tracking-[0.12em] mb-2.5",children:"When they join, they'll unlock:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.map(t=>e.jsx("span",{className:"text-[11px] font-body font-medium text-white/60 bg-white/[0.05] rounded-full px-2.5 py-1",children:t},t))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{label:o?"Parent Name":"Coach Name",children:e.jsx("input",{type:"text",value:r,onChange:t=>m(t.target.value),placeholder:o?"Parent's name":"Coach's name",className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-[15px] font-body text-white placeholder:text-white/25 focus:outline-none focus:border-primary/40 transition-colors"})}),o?e.jsxs(d,{label:w,children:[e.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center justify-between bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-[15px] font-body text-white focus:outline-none focus:border-primary/40 transition-colors",children:[e.jsx("span",{className:n?"text-white":"text-white/25",children:((j=N.find(t=>t.value===n))==null?void 0:j.label)||"Select relationship"}),e.jsx(q,{className:"w-4 h-4 text-white/40",strokeWidth:2.5})]}),e.jsx(B,{open:A,onOpenChange:y,value:n,options:N,onSelect:p,title:"Relationship",placeholder:"Select relationship"})]}):e.jsx(d,{label:w,children:e.jsx("input",{type:"text",value:n,onChange:t=>p(t.target.value),placeholder:_,className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-[15px] font-body text-white placeholder:text-white/25 focus:outline-none focus:border-primary/40 transition-colors"})}),e.jsx(d,{label:"Email Address",children:e.jsx("input",{type:"email",value:u,onChange:t=>C(t.target.value),placeholder:"[email protected]",className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-[15px] font-body text-white placeholder:text-white/25 focus:outline-none focus:border-primary/40 transition-colors"})}),e.jsx(d,{label:"Optional Message",children:e.jsx("textarea",{value:x,onChange:t=>I(t.target.value),rows:4,className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-[14px] font-body text-white placeholder:text-white/25 focus:outline-none focus:border-primary/40 transition-colors resize-none"})})]}),e.jsx("button",{onClick:F,disabled:b||!r.trim()||!u.trim(),className:"w-full mt-6 inline-flex items-center justify-center gap-2 text-[14px] font-heading font-bold text-white uppercase tracking-wide rounded-full py-3.5 bg-primary t90-cta-glow transition-transform active:scale-[0.98] disabled:opacity-40 disabled:cursor-not-allowed",children:b?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-4 h-4 animate-spin",strokeWidth:2.5}),"Sendingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"w-4 h-4",strokeWidth:2.2}),W]})})]})]})}function d({label:a,children:i}){return e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] font-heading font-bold text-white/50 uppercase tracking-[0.12em] mb-1.5",children:a}),i]})}function ce(){const a=G(),[i,l]=s.useState(null);s.useEffect(()=>{const n=new URLSearchParams(window.location.search).get("role");(n==="parent"||n==="coach")&&l(n)},[]);const r=()=>{l(null),a("/identity",{replace:!0})};return e.jsx(z,{family:"identity",bare:!0,children:e.jsx("div",{className:"px-5 pt-2",children:i?e.jsx(Z,{role:i,onBack:r}):e.jsx($,{onSelect:l,onBack:()=>a("/identity")})})})}function $({onSelect:a,onBack:i}){return e.jsxs(h.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.3},children:[e.jsxs("button",{onClick:i,className:"inline-flex items-center gap-1.5 text-[13px] font-body font-medium text-white/50 hover:text-white/80 transition-colors mb-5",children:[e.jsx(k,{className:"w-4 h-4",strokeWidth:2}),"Back to Identity"]}),e.jsxs(h.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.05,duration:.35},className:"text-center mb-7",children:[e.jsx("h1",{className:"text-[26px] font-heading font-bold text-white uppercase leading-tight",children:"Build Your Performance Team"}),e.jsx("p",{className:"text-[15px] font-body font-light text-white/55 leading-[1.6] mt-2 max-w-sm mx-auto",children:"The best athletes don't train alone. Invite the people who help you become your best."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(S,{role:"parent",icon:M,title:"Parent / Guardian",description:"Help your parent better understand how to support you during practices, games, wins, setbacks, and pressure.",buttonLabel:"Invite Parent",onSelect:a,delay:.1}),e.jsx(S,{role:"coach",icon:K,title:"Coach",description:"Help your coach understand how you compete, learn, communicate, and respond under pressure.",buttonLabel:"Invite Coach",onSelect:a,delay:.16})]})]})}function S({role:a,icon:i,title:l,description:r,buttonLabel:m,onSelect:n,delay:p}){return e.jsx(h.button,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:p,duration:.35},onClick:()=>n(a),className:"w-full text-left rounded-[20px] p-6 border border-white/[0.06] t90-metal-card hover:border-primary/30 transition-all active:scale-[0.98] group",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/12 border border-primary/20 flex items-center justify-center flex-shrink-0 group-hover:bg-primary/20 transition-colors",children:e.jsx(i,{className:"w-5 h-5 text-primary",strokeWidth:2.2})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-[18px] font-heading font-bold text-white uppercase leading-tight",children:l}),e.jsx("p",{className:"text-[13px] font-body font-light text-white/50 leading-[1.6] mt-1.5",children:r}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 mt-4 text-[12px] font-heading font-bold text-primary uppercase tracking-wide",children:[m,e.jsx("span",{className:"transition-transform group-hover:translate-x-0.5",children:"â"})]})]})]})})}export{ce 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.