1import{j as e}from"./vendor-ui-Cmvb7Owm.js";import{s as u,u as S,bu as v,v as c,w as d,x as m,y as p,B as o,Q as f,aS as y,H as I,aU as M,bZ as U}from"./index-5g62s0Db.js";import{r as x}from"./vendor-react-DT3EBgZv.js";import{c as P}from"./vendor-data-EeBZkdt7.js";import{b as z}from"./exhibitorCompletionUtils-BlZyQxmu.js";import"./vendor-charts-Ly3mFSe7.js";import"./vendor-editor-D2klMk7-.js";import"./vendor-dnd-B5czVS4k.js";function L(){const[s,C]=x.useState(null),[E,N]=x.useState(u),[a,_]=x.useState([]),{data:h}=S();x.useEffect(()=>{(async()=>{const n=sessionStorage.getItem("impersonation_token"),i=sessionStorage.getItem("impersonation_refresh");let t=u;n&&i&&(t=P("https://bncyctvyvwicqlcdzgtj.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJuY3ljdHZ5dndpY3FsY2R6Z3RqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjgyMjEzNTcsImV4cCI6MjA4Mzc5NzM1N30.cXVY34NkgLPa6kfDx0iLeRW1aSXc0P70k7bPcv-Kh-U",{auth:{storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}},persistSession:!1,autoRefreshToken:!0}}),await t.auth.setSession({access_token:n,refresh_token:i}),N(t));const{data:{session:l}}=await t.auth.getSession();if(l){const{data:g,error:b}=await t.from("speakers").select("*, speaker_submissions(*)").eq("user_id",l.user.id).maybeSingle();if(b){console.error("Error fetching speaker data:",b);return}g&&C(g)}})(),w()},[]);const w=async()=>{try{const{data:r,error:n}=await u.from("user_roles").select("user_id").eq("role","project_manager");if(n||!r||r.length===0)return;const{data:i,error:t}=await u.from("user_profiles").select("display_name, meeting_url, email").in("user_id",r.map(l=>l.user_id));if(t){console.error("Error loading project manager profiles:",t);return}i&&i.length>0&&_(i.map(l=>({name:l.display_name||"Project Manager",email:l.email||"",meetingUrl:l.meeting_url||""})))}catch(r){console.error("Unexpected error loading project managers:",r)}},k=[{label:"Photo",completed:!!(s!=null&&s.photo_url)},{label:"Bio (>50 chars)",completed:!!(s!=null&&s.bio&&s.bio.length>50)},{label:"Title",completed:!!(s!=null&&s.title)},{label:"Company",completed:!!(s!=null&&s.company)},{label:"Company Logo",completed:!!(s!=null&&s.company_logo_url)},{label:"LinkedIn",completed:!!(s!=null&&s.linkedin_url)},{label:"Seminar Title",completed:!!(s!=null&&s.seminar_title)},{label:"Seminar Description",completed:!!(s!=null&&s.seminar_description)},{label:"Speaker Form Uploaded & Approved",completed:!!(s!=null&&s.speaker_submissions&&s.speaker_submissions.some(r=>r.approval_status==="approved"))}],{percentage:j,completedCount:F,totalCount:H}=z(s);return e.jsxs(e.Fragment,{children:[e.jsxs(v,{children:[e.jsx("title",{children:"Speaker Portal - Home"}),e.jsx("meta",{name:"description",content:"Welcome to your speaker portal"})]}),e.jsxs("section",{className:"mb-8",children:[e.jsxs("h1",{className:"text-4xl font-bold text-foreground mt-5 mb-2",children:["Welcome, ",(s==null?void 0:s.name)||"Speaker"]}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your speaker profile and session information"})]}),!(s!=null&&s.photo_url)&&e.jsxs(c,{className:"mb-8 border-yellow-200 bg-yellow-50 dark:border-yellow-800 dark:bg-yellow-950",children:[e.jsx(d,{children:e.jsx(m,{className:"text-yellow-800 dark:text-yellow-200",children:"Headshot Required"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 mb-4",children:"Only profiles with a headshot are displayed on the website. Upload your headshot now to be featured on the speakers page."}),e.jsx(o,{asChild:!0,children:e.jsx("a",{href:"/speaker-portal/profile",children:"Upload Headshot"})})]})]}),e.jsxs("section",{className:"flex gap-4 mb-8 flex-col xl:flex-row",children:[e.jsxs(c,{className:"flex-[0.7]",children:[e.jsxs(d,{children:[e.jsx(m,{children:"Manage Your Speaker Account"}),e.jsx(f,{children:"This platform has been designed to help you manage your speaking session and profile information. Keep your profile up to date and submit your speaker form when ready."})]}),e.jsx(p,{children:a&&a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("h3",{className:"font-semibold mb-3",children:["Your Project Manager",a.length>
11?"s":""," ",a.length===1?`is ${a[0].name}`:"are:"]}),a.length===1?e.jsxs("div",{className:"flex gap-2",children:[a[0].meetingUrl&&e.jsx(o,{asChild:!0,children:e.jsx("a",{href:a[0].meetingUrl,target:"_blank",rel:"noopener noreferrer",children:"Book a Meeting"})}),a[0].email&&e.jsx(o,{variant:"outline",asChild:!0,children:e.jsx("a",{href:`mailto:${a[0].email}`,children:"Contact"})})]}):e.jsx("div",{className:"space-y-4",children:a.map((r,n)=>e.jsxs("div",{className:"flex items-start justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:r.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.email})]}),e.jsxs("div",{className:"flex gap-2",children:[r.meetingUrl&&e.jsx(o,{size:"sm",asChild:!0,children:e.jsx("a",{href:r.meetingUrl,target:"_blank",rel:"noopener noreferrer",children:"Book Meeting"})}),r.email&&e.jsx(o,{size:"sm",variant:"outline",asChild:!0,children:e.jsx("a",{href:`mailto:${r.email}`,children:"Contact"})})]})]},n))})]})})]}),e.jsxs(c,{className:"flex-[0.3]",variant:"black",children:[e.jsx(d,{children:e.jsx(m,{variant:"black",children:"Important Notice"})}),e.jsxs(p,{className:"text-sm space-y-3",children:[e.jsx("p",{children:"Please keep your profile information up to date."}),e.jsx("p",{children:"Submit your speaker form as soon as possible to ensure your session can be scheduled."}),e.jsx("p",{children:"If you have any questions, please contact your project manager or client relations manager."})]})]})]}),e.jsx("section",{className:"mb-8",children:e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(m,{children:"Upload Your Speaker Form"}),(s==null?void 0:s.speaker_submissions)&&s.speaker_submissions.length>0&&e.jsx(y,{variant:"secondary",children:"Pending"})]}),e.jsx(f,{children:"Submit your completed speaker form to finalize your session details"}),(h==null?void 0:h.speaker_form_deadline)&&e.jsxs("p",{className:"text-red-600 font-semibold mt-2",children:["Speaker Form + Headshot Submission Deadline: ",I(new Date(h.speaker_form_deadline),"d MMMM yyyy")]})]}),e.jsx(p,{children:e.jsx(o,{asChild:!0,children:e.jsx("a",{href:"/speaker-portal/upload",children:"Upload Form"})})})]})}),e.jsx("section",{className:"mb-8",children:e.jsxs(c,{children:[e.jsxs(d,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(m,{children:"Profile Completion"}),e.jsxs(y,{variant:j===100?"default":"secondary",children:[j,"%"]})]}),e.jsx(f,{children:"Complete your profile to appear on the website"})]}),e.jsxs(p,{children:[e.jsx("div",{className:"space-y-3",children:k.map(r=>e.jsxs("div",{className:"flex items-center gap-3",children:[r.completed?e.jsx(M,{className:"h-5 w-5 text-green-600"}):e.jsx(U,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:r.completed?"text-foreground":"text-muted-foreground",children:r.label})]},r.label))}),j<100&&e.jsx(o,{className:"mt-6 w-full",asChild:!0,children:e.jsx("a",{href:"/speaker-portal/profile",children:"Complete Profile"})})]})]})})]})}export{L 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.