PageSourceSearch

https://startuplive.ngo/assets/SpeakerEventDashboard-Bv5ingLa.js

js startuplive.ngo collected 2026-10-09 18:12:06 UTC 24,244 bytes, 2 lines download raw bytes

1import{d as K,r as p,s as d,t as f,j as e,B as Q,C as te,e as se,u as re,k as ae}from"./index-EuY_-FAY.js";import{D as ie}from"./DashboardLayout-Gw2TxiBJ.js";import{C as F,c as $,a as Y,b as H}from"./card-CIFW0qNz.js";import{B as U}from"./badge-BiGl0epm.js";import{B as E}from"./button-DwzNqib_.js";import{T as ne}from"./textarea-D6vuaKhs.js";import{P as W}from"./presentation-1PlbYjJw.js";import{C as oe,P as le}from"./plus-DP6EyEDe.js";import{C as J}from"./calendar-TeXraZ6Q.js";import{C as me}from"./clock-C9pzXbgT.js";import{M as ce}from"./map-pin-CiJS0zpt.js";import{L as X}from"./loader-circle-Caxve_ph.js";import{U as de}from"./ChatSystem-4zb8rVWu.js";import{F as G}from"./layout-dashboard-a4gKtYLw.js";import{a as pe,S as xe,M as he}from"./MediaGalleryContent-XJA4H3_o.js";import{D as ue}from"./download-Gq_d9FhN.js";import{T as fe}from"./command-CJk2AU3Y.js";import{f as ee}from"./format-BJatCrh1.js";import{M as ge}from"./message-square-CX4ymtRO.js";import{N as je}from"./NetworkingContent-Bb1EhX8P.js";import{S as Ne}from"./StartupsContent-C87fSNlC.js";import{R as ve}from"./ReviewsContent-BqM04mPl.js";import"./list-checks-XjZkVVNc.js";import"./user-DuBvhp_O.js";import"./circle-user-C6EVL7I0.js";import"./search-BN9ssjqw.js";import"./users-B7Eh8ycR.js";import"./target-Cm-J7PgS.js";import"./award-CK-g5_KF.js";import"./shield-nL0KFzur.js";import"./index-wQwPqDfP.js";import"./index-BMKRCHpo.js";import"./index-BJKYc_OV.js";import"./index-DKmrCAge.js";import"./chevron-down-D0i5abe3.js";import"./chevron-right-R-JJXQF-.js";import"./settings-DbY5cOJ-.js";import"./user-plus-tyTYVH-R.js";import"./rocket-D93ZlqmD.js";import"./users-round-B278ejjI.js";import"./star-DLxjevVK.js";import"./clipboard-list-DnNVBJ_L.js";import"./handshake-ChAu9QXI.js";import"./eye-DWMmm-eV.js";import"./DashboardHeader-qK3Qmy-e.js";import"./avatar-DmtcMqZM.js";import"./index-BccXDNaF.js";import"./index-BSIHs9Yh.js";import"./index-C40cg7B2.js";import"./index-BONWbLIr.js";import"./index-BXTDk0Ug.js";import"./check-BFBMQrmy.js";import"./building-2-AqdBhrS9.js";import"./arrow-left-lIwOt_N5.js";import"./menu-QX_7UXmx.js";import"./Footer-DLYBYlrH.js";import"./input-CwLsOgdz.js";import"./NotificationCenter-DHgRHZeL.js";import"./index-BdQq_4o_.js";import"./FeedbackButton-84GpwsHz.js";import"./dialog-BshpMbXa.js";import"./index-Byc0C5HR.js";import"./label-DHjRMKAW.js";import"./tabs-BkjaH3fl.js";import"./send-CxotHqOi.js";import"./cityCoordinates-BF9Pw5Lr.js";import"./index-CCnnvLwg.js";import"./switch-C1fACMOm.js";import"./index-90AI2Mcq.js";import"./mail-BVVKtkzs.js";import"./select-Zkugu-mn.js";import"./chevron-up-BGLh5JIr.js";import"./popover-C1CUfueU.js";import"./calendar-D4NNVj7-.js";import"./subDays-1Gd6-EPS.js";import"./isSameDay-D8qkwPfC.js";import"./chevron-left-nZrh3bY0.js";import"./checkbox-D-yVHPM-.js";import"./tooltip-DhO4SW4a.js";import"./index-DwFUDgNw.js";import"./chevrons-up-down-CWJDjV6L.js";import"./index-h3IyJjLp.js";import"./index-Cb8UU1H3.js";import"./parseISO-DmI85Ds7.js";import"./eachDayOfInterval-C6Nk_oxa.js";import"./differenceInMilliseconds-ycH2onZd.js";import"./square-pen-DgtJmqsG.js";import"./mic-B2yxq-CM.js";import"./sparkles-CDimFECD.js";import"./timezones-CsxV_3Uh.js";import"./globe-DmqLM4zl.js";import"./list-DRGo6gHo.js";import"./useInfiniteScroll-CcPzzG0i.js";import"./circle-check-DZuRMJvy.js";import"./image-rU_ppTuS.js";import"./play-BEepO1Dv.js";import"./eye-off-Cp1ZERv1.js";import"./ellipsis-vertical-eBvHTnN9.js";import"./separator-CP7aABc2.js";import"./linkedin-CHWP1gWB.js";import"./twitter-7bv0L9_e.js";import"./StartupContactModal-C5e0adbk.js";import"./index-DXqQCM1T.js";import"./table-B7IdTOLn.js";import"./sticky-note-DtyHP69G.js";import"./bookmark-DYmGZhVj.js";import"./hash-DFi8_KFc.js";import"./trending-up-DfxLE4nH.js";const we=({eventId:x,eventTitle:g})=>{const{user:a}=K(),[o,v]=p.useState([]),[A,l]=p.useState(!0),[C,j]=p.useState(null),[w,h]=p.useState(""),[y,S]=p.useState(!1),[b,R]=p.useState(null);p.useEffect(()=>{a&&x&&r()},[a,x]);const r=async()=>{try{l(!0);const{data:t,error:s}=await d.from("event_schedules").select("*").eq("event_id",x).eq("speaker_id",a==null?void 0:a.id).in("session_type",["presentation","workshop"]).order("start_time",{ascending:!0});if(s)console.error("Error fetching presentations:",s),f.error({title:"Error",description:"Failed to load your presentations"});else{const n=await Promise.all((t||[]).map(async i=>{const{data:m}=await d.from("speaker_presentation_notes").select("id, notes").eq("schedule_id",i.id).eq("speaker_id",a==null?void 0:a.id).maybeSingle();let u=[];
1if(m){const{data:z}=await d.from("speaker_presentation_files").select("id, file_name, file_path, file_size").eq("notes_id",m.id);u=z||[]}return{...i,notes:(m==null?void 0:m.notes)||void 0,notesId:(m==null?void 0:m.id)||void 0,files:u}}));v(n)}}catch(t){console.error("Error:",t),f.error({title:"Error",description:"An unexpected error occurred"})}finally{l(!1)}},D=t=>{switch(t){case"presentation":return"bg-blue-100 text-blue-800 border-blue-200";case"workshop":return"bg-green-100 text-green-800 border-green-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},B=t=>ee(new Date(t),"EEEE, MMMM d, yyyy"),I=t=>ee(new Date(t),"HH:mm"),P=t=>new Date(t)>new Date,q=t=>{const s=new Date(t.start_time),n=new Date(t.end_time),i=u=>u.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z";return["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//StartupLive//Event Calendar//EN","BEGIN:VEVENT",`UID:${t.id}@startuplive.org`,`DTSTART:${i(s)}`,`DTEND:${i(n)}`,`SUMMARY:${t.title}`,`DESCRIPTION:${t.description||"Speaker session for "+g}`,`LOCATION:${t.location||"Event venue"}`,"STATUS:CONFIRMED","BEGIN:VALARM","TRIGGER:-PT15M","ACTION:DISPLAY","DESCRIPTION:Reminder: Presentation starts in 15 minutes","END:VALARM","END:VEVENT","END:VCALENDAR"].join(`\r
2`)},O=t=>{try{const s=q(t),n=new Blob([s],{type:"text/calendar;charset=utf-8"}),i=document.createElement("a");i.href=window.URL.createObjectURL(n),i.download=`${t.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.ics`,document.body.appendChild(i),i.click(),document.body.removeChild(i),f.success({title:"Calendar Event Created",description:`Added "${t.title}" to your calendar`})}catch(s){console.error("Error creating calendar event:",s),f.error({title:"Error",description:"Failed to create calendar event"})}},M=t=>{j(t),h("")},V=t=>{j(t.id),h(t.notes||"")},c=()=>{j(null),h("")},k=async t=>{if(a){S(!0);try{if(t.notesId){const{error:s}=await d.from("speaker_presentation_notes").update({notes:w,updated_at:new Date().toISOString()}).eq("id",t.notesId);if(s)throw s}else{const{error:s}=await d.from("speaker_presentation_notes").insert({schedule_id:t.id,speaker_id:a.id,notes:w});if(s)throw s}f.success({title:"Notes saved"}),j(null),h(""),r()}catch(s){console.error("Error saving note:",s),f.error({title:"Error",description:"Failed to save notes"})}finally{S(!1)}}},T=async(t,s)=>{if(!(!a||s.length===0)){R(t.id);try{let n=t.notesId;if(!n){const{data:i,error:m}=await d.from("speaker_presentation_notes").insert({schedule_id:t.id,speaker_id:a.id,notes:""}).select("id").single();if(m)throw m;n=i.id}for(const i of Array.from(s)){const m=i.name.split(".").pop(),u=`${a.id}/${t.id}/${Date.now()}.${m}`,{error:z}=await d.storage.from("speaker-files").upload(u,i);if(z)throw z;const{error:Z}=await d.from("speaker_presentation_files").insert({notes_id:n,file_name:i.name,file_path:u,file_size:i.size,file_type:i.type});if(Z)throw Z}f.success({title:"Files uploaded"}),r()}catch(n){console.error("Error uploading files:",n),f.error({title:"Error",description:"Failed to upload files"})}finally{R(null)}}},_=async(t,s)=>{try{await d.storage.from("speaker-files").remove([s]);const{error:n}=await d.from("speaker_presentation_files").delete().eq("id",t);if(n)throw n;f.success({title:"File deleted"}),r()}catch(n){console.error("Error deleting file:",n),f.error({title:"Error",description:"Failed to delete file"})}},N=async(t,s)=>{try{const{data:n,error:i}=await d.storage.from("speaker-files").download(t);if(i)throw i;const m=URL.createObjectURL(n),u=document.createElement("a");u.href=m,u.download=s,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(m)}catch(n){console.error("Error downloading file:",n),f.error({title:"Error",description:"Failed to download file"})}},L=t=>t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:"";return A?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(Q,{size:32})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg p-4 sm:p-6",children:e.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-3 mb-2 sm:mb-4",children:[e.jsx(W,{className:"w-6 h-6 sm:w-8 sm:h-8 text-blue-600 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-lg sm:text-2xl font-bold text-gray-900",children:"My Presentations"}),e.jsxs("p",{className:"text-xs sm:text-sm text-gray-600 truncate",children:["Presentations & workshops for ",g]})]})]})}),o.length===0?e.jsx(F,{children:e.jsxs($,{className:"flex flex-col items-center justify-center py-8 sm:py-12 px-4",children:[e.jsx(oe,{className:"w-10 h-10 sm:w-12 sm:h-12 text-muted-foreground mb-3 sm:mb-4"}),e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 mb-2 text-center",children:"No Presentations Assigned"}),e.jsx("p",{className:"text-xs sm:text-sm text-gray-600 text-center max-w-md",children:"You don't have any presentations or workshops assigned for this event yet. Contact the event organizers if you expect to be scheduled as a speaker."})]})}):e.jsx("div",{className:"space-y-4",children:o.map(t=>e.jsxs(F,{className:`transition-all hover:shadow-md ${P(t.start_time)?"border-l-4 border-l-blue-500 bg-gradient-to-r from-blue-50/30 to-transparent":"opacity-75"}`,children:[e.jsx(Y,{className:"p-3 sm:p-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs(H,{
2className:"flex flex-wrap items-center gap-2 text-sm sm:text-base",children:[e.jsx("span",{className:"break-words",children:t.title}),P(t.start_time)&&e.jsx(U,{variant:"secondary",className:"bg-green-100 text-green-800 text-xs",children:"Upcoming"})]}),t.description&&e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1 sm:mt-2 line-clamp-2 sm:line-clamp-none",children:t.description})]}),e.jsx(U,{variant:"outline",className:`${D(t.session_type)} text-xs shrink-0`,children:t.session_type})]})}),e.jsxs($,{className:"p-3 sm:p-6 pt-0 sm:pt-0",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm text-gray-600",children:[e.jsx(J,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 shrink-0"}),e.jsx("span",{className:"truncate",children:B(t.start_time)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm text-gray-600",children:[e.jsx(me,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 shrink-0"}),e.jsxs("span",{children:[I(t.start_time)," - ",I(t.end_time)]})]}),t.location&&e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm text-gray-600",children:[e.jsx(ce,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t.location})]})]}),e.jsx("div",{className:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t border-gray-200",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[!t.notes&&C!==t.id&&e.jsxs(E,{size:"sm",onClick:()=>M(t.id),className:"text-xs sm:text-sm h-8 sm:h-9 px-2 sm:px-3",children:[e.jsx(le,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Prepare"})," Notes"]}),P(t.start_time)&&e.jsxs(E,{size:"sm",variant:"outline",onClick:()=>O(t),className:"text-xs sm:text-sm h-8 sm:h-9 px-2 sm:px-3",children:[e.jsx(J,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Add to"})," Calendar"]}),e.jsxs("label",{className:"cursor-pointer",children:[e.jsx(E,{size:"sm",variant:"outline",disabled:b===t.id,asChild:!0,className:"text-xs sm:text-sm h-8 sm:h-9 px-2 sm:px-3",children:e.jsxs("span",{children:[b===t.id?e.jsx(X,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2 animate-spin"}):e.jsx(de,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Upload"})," Files"]})}),e.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:s=>s.target.files&&T(t,s.target.files),disabled:b===t.id})]})]})}),C===t.id?e.jsxs("div",{className:"mt-3 sm:mt-4 space-y-2 sm:space-y-3",children:[e.jsx(ne,{value:w,onChange:s=>h(s.target.value),placeholder:"Add your preparation notes here...",rows:3,className:"w-full text-sm"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(E,{size:"sm",onClick:()=>k(t),disabled:y,className:"text-xs sm:text-sm h-8 sm:h-9",children:[y&&e.jsx(X,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 mr-1 sm:mr-2 animate-spin"}),"Save"]}),e.jsx(E,{size:"sm",variant:"outline",onClick:c,disabled:y,className:"text-xs sm:text-sm h-8 sm:h-9",children:"Cancel"})]})]}):t.notes?e.jsx("div",{className:"mt-3 sm:mt-4 p-3 sm:p-4 bg-muted/50 rounded-lg cursor-pointer hover:bg-muted transition-colors",onClick:()=>V(t),children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(G,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground mb-1",children:"Notes (tap to edit)"}),e.jsx("p",{className:"text-xs sm:text-sm whitespace-pre-wrap break-words",children:t.notes})]})]})}):null,t.files&&t.files.length>0&&e.jsxs("div",{className:"mt-3 sm:mt-4 space-y-2",children:[e.jsxs("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground flex items-center gap-1.5 sm:gap-2",children:[e.jsx(pe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}),"Uploaded Files"]}),e.jsx("div",{className:"space-y-1.5 sm:space-y-2",children:t.files.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted/30 rounded-lg gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 min-w-0 flex-1",children:[e.jsx(G,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-xs sm:text-sm truncate",children:s.file_name}),s.file_size&&e.jsxs("span",{className:"text-xs text-muted-foreground shrink-0 hidden sm:inline",children:["(",L(s.file_size),")"]})]}),e.jsxs("div",{className:"flex items-center shrink-0",children:[e.jsx(E,{size:"sm",variant:"ghost",onClick:()=>N(s.file_path,s.file_name),className:"h-7 w-7 sm:h-8 sm:w-8 p-0",children:e.jsx(ue,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})}),e.jsx(E,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive h-7 w-7 sm:h-8 sm:w-8 p-0",onClick:()=>_(s.id,s.file_path),children:e.jsx(fe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]},s.id))})]})]})]},t.id))}),e.jsxs(F,{className:"bg-blue-50 border-blue-200",children:[e.jsx(Y,{className:"p-3 sm:p-6 pb-2 sm:pb-3",children:e.jsxs(H,{
2className:"flex items-center gap-2 text-blue-800 text-sm sm:text-base",children:[e.jsx(G,{className:"w-4 h-4 sm:w-5 sm:h-5"}),"Speaker Tips"]})}),e.jsx($,{className:"text-blue-700 p-3 sm:p-6 pt-0 sm:pt-0",children:e.jsxs("ul",{className:"space-y-1.5 sm:space-y-2 text-xs sm:text-sm",children:[e.jsx("li",{children:"• Arrive at least 15 min before your slot"}),e.jsx("li",{children:"• Test your materials and tech setup in advance"}),e.jsx("li",{children:"• Prepare for Q&A sessions"}),e.jsx("li",{children:"• Contact organizers for special equipment needs"}),e.jsx("li",{children:"• Bring backup copies of your presentation"})]})})]})]})},ye=({eventId:x,eventTitle:g})=>{const{user:a}=K(),[o,v]=p.useState([]),[A,l]=p.useState(!0);p.useEffect(()=>{a&&x&&C()},[a,x]);const C=async()=>{try{l(!0);const{data:r,error:D}=await d.from("event_schedules").select("*").eq("event_id",x).eq("speaker_id",a==null?void 0:a.id).in("session_type",["presentation","workshop"]).order("start_time",{ascending:!0});D?console.error("Error fetching presentations:",D):v(r||[])}catch(r){console.error("Error fetching speaker data:",r)}finally{l(!1)}},j=r=>new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),w=r=>new Date(r).toLocaleDateString([],{weekday:"long",month:"short",day:"numeric"}),h=r=>new Date(r)>new Date,y=r=>{switch(r){case"presentation":return"bg-blue-100 text-blue-800";case"workshop":return"bg-green-100 text-green-800";case"keynote":return"bg-purple-100 text-purple-800";case"panel":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}};if(A)return e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(Q,{size:32})});const S=o.filter(r=>h(r.start_time)),b=o.length,R=o.filter(r=>!h(r.start_time)).length;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-r from-pink-50 to-purple-50 rounded-lg p-6",children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[e.jsx(ge,{className:"w-8 h-8 text-pink-600"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Speaker Dashboard"}),e.jsx("p",{className:"text-gray-600",children:"Share your expertise with the startup community"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6",children:[e.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-sm",children:[e.jsx("div",{className:"text-2xl font-bold text-pink-600",children:b}),e.jsx("div",{className:"text-sm text-gray-600",children:"Speaking Sessions"})]}),e.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-sm",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:S.length}),e.jsx("div",{className:"text-sm text-gray-600",children:"Upcoming Sessions"})]}),e.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-sm",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:R}),e.jsx("div",{className:"text-sm text-gray-600",children:"Completed Sessions"})]})]})]}),e.jsxs(F,{children:[e.jsx(Y,{children:e.jsxs(H,{className:"flex items-center gap-2",children:[e.jsx(W,{className:"w-5 h-5 text-primary"}),"My Presentations"]})}),e.jsx($,{children:e.jsx("div",{className:"space-y-4",children:o.length===0?e.jsx("p",{className:"text-gray-500 text-center py-4",children:"No presentations scheduled yet."}):o.map(r=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[h(r.start_time)?e.jsx(W,{className:"w-5 h-5 text-blue-600"}):e.jsx(te,{className:"w-5 h-5 text-green-600"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:r.title}),e.jsxs("div",{className:"text-sm text-gray-600",children:[w(r.start_time)," • ",j(r.start_time)," - ",j(r.end_time)," • ",r.location]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(U,{className:y(r.session_type),children:r.session_type}),h(r.start_time)&&e.jsx(U,{variant:"outline",className:"text-orange-600 border-orange-200 text-xs",children:"Upcoming"})]})]},r.id))})})]})]})};function bs(){const{eventSlug:x}=se(),g=re(),a=ae(),{user:o}=K(),[v,A]=p.useState(null),[l,C]=p.useState(null),[j,w]=p.useState(!0),[h,y]=p.useState([]),S=a.pathname.includes("/presentation"),b=a.pathname.includes("/speakers"),R=a.pathname.includes("/networking"),r=a.pathname.includes("/schedule"),D=a.pathname.includes("/startups"),B=a.pathname.includes("/reviews"),I=a.pathname.endsWith("/media");p.useEffect(()=>{o&&x&&P()},[o,x]);const P=async()=>{try{w(!0);const{data:c,error:k}=await d.from("events").select("*");if(k){console.error("Error fetching events:",k),g("/dashboard");return}const T=n=>n.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50),_=c==null?void 0:c.find(n=>T(n.title)===x);if(!_){console.error("Event not found for slug:",x),g("/dashboard");return}C(_);const{data:N,error:L}=await d.from("user_roles").select("event_id, role, status").eq("user_id",o==null?void 0:o.id).eq("event_id",_.id);if(L)console.error("Error fetching user roles:",L);else if(y(N||[]),!(N==null?void 0:N.some(i=>i.role==="speaker"&&i.event_id===_.id))){g("/dashboard");return}const{data:t,error:s}=await d.from("profiles").select("*").eq("user_id",o==null?void 0:o.id).single();if(s)console.error("Error fetching profile:",s);else{const n={id:(o==null?void 0:o.id)||"",name:t.name||(o==null?void 0:o.name)||"",email:t.email||(o==null?void 0:o.email)||"",avatar:t.avatar_url,roles:(N==null?void 0:N.map(i=>({visitor:"visitor",attendee:"attendant",mentor:"mentor",startup:"startup_foun
2der",corporate:"corporate",investor:"investor",speaker:"speaker",program_manager:"program_manager",location:"location",jury_member:"jury_member"})[i.role]||i.role))||["speaker"],primaryRole:"speaker",currentEventId:_.id};A(n)}}catch(c){console.error("Error in fetchEventAndUserData:",c),g("/dashboard")}finally{w(!1)}},q=()=>{const c=h.find(k=>k.role==="speaker");return(c==null?void 0:c.status)||"pending"},O=c=>c==="pending"?e.jsx("div",{className:"max-w-4xl mx-auto p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Application Under Review"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Your speaker application is currently being reviewed by the event organizers. You'll receive an email notification once a decision has been made."}),e.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:e.jsx("p",{className:"text-yellow-800 font-medium",children:"Status: Pending Review"})})]})}):c==="rejected"?e.jsx("div",{className:"max-w-4xl mx-auto p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Application Not Accepted"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Unfortunately, your speaker application was not accepted for this event. Thank you for your interest, and we encourage you to apply for future events."}),e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:e.jsx("p",{className:"text-red-800 font-medium",children:"Status: Not Accepted"})})]})}):null;if(j)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx(Q,{size:64})});if(!v||!l)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Access Denied"}),e.jsx("p",{className:"text-gray-600",children:"You don't have access to this speaker dashboard or the event doesn't exist."})]})});const M=q(),V=()=>S?e.jsx(we,{eventId:l.id,eventTitle:l.title}):b?e.jsx("div",{className:"max-w-4xl mx-auto p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Speaker Resources"}),e.jsx("p",{className:"text-gray-600",children:"Speaker resources and materials will be available here."})]})}):M!=="accepted"?O(M):R?e.jsx(je,{eventId:l.id,title:"Event Networking",description:"Connect with other speakers, mentors, and participants"}):r?e.jsx(xe,{eventId:l.id,eventStartDate:l.start_date,eventEndDate:l.end_date,canEdit:!1,eventTimezone:l.timezone}):D?e.jsx(Ne,{eventId:l.id}):B?e.jsx(ve,{eventId:l.id,eventTitle:l.title}):I?e.jsx(he,{}):e.jsx(ye,{eventId:l.id,eventTitle:l.title});return e.jsx(ie,{user:v,currentEvent:l,userEventRoles:h,currentRole:a.pathname.includes("/speaker")?"speaker":v.primaryRole==="admin"?"program_manager":v.primaryRole,onRoleChange:c=>{const T={speaker:"speaker",mentor:"mentor",startup:"startups",startup_foun
2der:"startups",investor:"investor",corporate:"corporate",program_manager:"manager",jury_member:"jury",attendee:"attendant",visitor:"visitor",location:"location"}[c];T&&g(`/dashboard/${x}/${T}/`)},children:V()})}export{bs 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.