PageSourceSearch

https://aicureacademy.com/assets/InstructorDashboard-4CyMGlB1.js

js aicureacademy.com collected 2026-09-29 10:55:04 UTC 105,453 bytes, 1 lines download raw bytes

1import{a as j,n as x,d as h,_ as xa}from"./index-CJ3hxe8K.js";import{r as i,O as ua,B as ga,y as e}from"./vendor-CAn19U_C.js";import{h as R,f as Xt,o as pa,d as k,u as C,n as qt,E as ha,F as ma,H as ba,q as F,w as _,k as Q,l as ot,j as fa,D as es,e as Ne,s as ya}from"./vendor-firebase-CMgAD1F0.js";import{M as ja}from"./MessagesTab-CRzWmsKc.js";import{I as wa}from"./InstructorLayout-Cc2SIgrq.js";import{a6 as ct,e as se,k as ts,w as ss,a3 as ke,y as G,az as Se,b5 as va,z as Ce,j as ze,b as ae,aA as Oe,D as Na,aH as as,x as re,a8 as A,b6 as ka,ac as rs,am as Sa,an as Ca,aC as dt,aD as _e,J as ls,l as ns,O as za,aL as is,b7 as os,s as Aa,c as xt,S as cs,at as Pa,aM as Ae,au as ut,av as gt,aa as pt,a as B,a9 as Ra,b8 as La}from"./vendor-lucide-B99EgzbQ.js";import"./logo-D8gOup9f.js";const ds=()=>{const w="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";return Array.from({length:6},()=>w[Math.floor(Math.random()*w.length)]).join("")};function Ua(){var Ht,Kt;const[w,ht]=i.useState(null),[xs,us]=i.useState(!0),[Ge,mt]=i.useState([]),[gs,Be]=i.useState(!1),[Ve,ps]=i.useState(""),[bt,hs]=i.useState(0),[T,V]=i.useState(1),[W]=i.useState(8),[We,ms]=i.useState("all"),[le,bs]=i.useState("all"),[g,Pe]=i.useState([]),[ne,Y]=i.useState([]),[fs,ys]=i.useState([]),[js,Ye]=i.useState([]),[ws,ft]=i.useState(!1),[yt]=ua(),[p,H]=i.useState("Overview");i.useEffect(()=>{const t=yt.get("tab");H(t||"Overview")},[yt]);const[ie,vs]=i.useState("all"),[Re,Ns]=i.useState(""),[oe,ks]=i.useState("all"),[ce,de]=i.useState(1),[Le,Ss]=i.useState(""),[He,Cs]=i.useState("all"),[xe,ue]=i.useState(1),[Ke,zs]=i.useState(""),[ge,pe]=i.useState(1),K=5,Je=6,D=ga(),[As,he]=i.useState(!1),[S,Ps]=i.useState(null),[U,Ee]=i.useState(""),[jt,wt]=i.useState(!1),[L,Ze]=i.useState(null),[vt,Rs]=i.useState(new Set),[Ls,me]=i.useState(!1),[J,Es]=i.useState(null),[be,Nt]=i.useState(""),[fe,kt]=i.useState(""),[St,Ct]=i.useState(!1),[Fs,Z]=i.useState(!1),[Ds,X]=i.useState(!1),[I,Xe]=i.useState(null),[zt,Fe]=i.useState(""),[qe,At]=i.useState(!1),[et,Pt]=i.useState(!1),[Rt,Is]=i.useState({}),[Ms,Qs]=i.useState({}),[Ts,De]=i.useState(!1),[Ie,Us]=i.useState([]),[Lt,Et]=i.useState(!1),[ye,$s]=i.useState(null),[v,$]=i.useState({courseId:"",title:"",date:"",time:"",duration:60,meetingLink:""}),[Me,Os]=i.useState(""),[Qe,_s]=i.useState("all"),[tt,Gs]=i.useState("all"),[Ft,Dt]=i.useState([]),[Bs,It]=i.useState(!1),[d,st]=i.useState(null),[Te,Vs]=i.useState("all"),[je,q]=i.useState(1),[Ws,we]=i.useState(!1),[ee,Ys]=i.useState(null),[Ue,Mt]=i.useState(""),[at,Qt]=i.useState(""),[rt,Tt]=i.useState("pending"),[Ut,$t]=i.useState(!1),[Ot,_t]=i.useState(!1),[Gt,Bt]=i.useState(!1),[N,$e]=i.useState({current:"",new:"",confirm:""}),[E,lt]=i.useState(!1),[P,ve]=i.useState({fullName:"",bio:"",expertise:"",collegeName:""});i.useEffect(()=>{if(!g.length)return;const t=R(h,"attendance_records"),a=Xt(t,s=>{const l={};s.docs.forEach(n=>{const o=n.data();o.sessionId&&(l[o.sessionId]=(l[o.sessionId]||0)+1)}),Is(l)});return(async()=>{const s={};for(const l of g){const n=R(h,"users"),o=F(n,_("enrolledCourses","array-contains",l.id)),c=await Q(o);s[l.id]=c.size}Qs(s)})(),()=>a()},[g]),i.useEffect(()=>{w&&ve({fullName:w.fullName||"",bio:w.bio||"",expertise:w.expertise||"",collegeName:w.collegeName||""})},[w]);const[Vt,Hs]=i.useState({totalStudents:0,activeCourses:0,avgRating:0,monthlyGrowth:"0%"}),Ks=async(t,a,r)=>{Et(!0),$s({id:a,title:r});try{const s=R(h,"users"),l=F(s,_("enrolledCourses","array-contains",t)),o=(await Q(l)).docs.map(m=>({id:m.id,name:m.data().fullName,email:m.data().email,role:m.data().role})),c=R(h,"attendance_records"),u=F(c,_("sessionId","==",a)),b=await Q(u),f=new Set(b.docs.map(m=>m.data().userId)),y=o.map(m=>({...m,status:f.has(m.id)?"present":"absent"}));y.sort((m,z)=>m.status===z.status?m.name.localeCompare(z.name):m.status==="present"?-1:1),Us(y),De(!0)}catch(s){console.error("Error fetching attendance report:",s),x.error("Error","Could not load attendance details")}finally{Et(!1)}};i.useEffect(()=>{const t=pa(j,async a=>{var r;if(a)try{const s=k(h,"users",a.uid),l=await Ne(s);if(l.exists()&&((r=l.data().role)==null?void 0:r.trim())==="instructor"){const n=k(h,"trainers",a.uid),o=await Ne(n),c=o.exists()?o.data():{},u=l.data();ht({...u,...c,fullName:u.fullName,email:u.email,role:"instructor",bio:u.bio||c.bio||"",expertise:u.expertise||c.expertise||"",collegeName:u.collegeName||c.collegeName||""});const b=F(R(h,"courses"),_("instructorId","==",a.uid));Xt(b,f=>{const y=f.docs.map(M=>({id:M.id,...M.data()})).sort((M,da)=>{var Jt,Zt;return(((Jt=da.updatedAt)==null?void 0:Jt.seconds)||0)-(((Zt=M.updatedAt)==null?void 0:Zt.seconds)||0)});Pe(y);let m=0,z=0,te=0;
1y.forEach(M=>{m+=M.enrolledCount||0,M.rating&&(z+=Number(M.rating),te++)});const ca=te>0?(z/te).toFixed(1):0;Hs({totalStudents:m,activeCourses:y.length,avgRating:Number(ca),monthlyGrowth:"+0%"})})}else await ya(j),D("/login")}catch(s){console.error("Error fetching dashboard data:",s),x.error("Error","Failed to fetch your dashboard data")}else D("/login");us(!1)});return()=>t()},[D]),i.useEffect(()=>{(p==="Overview"||p==="QA management")&&g.length>0&&(async()=>{try{const a=[],r=g.slice(0,10).map(async n=>(await Q(F(R(h,"courses",n.id,"questions"),ot(20)))).docs.map(c=>({id:c.id,courseId:n.id,courseTitle:n.title,...c.data()})));(await Promise.all(r)).forEach(n=>a.push(...n));const l=a.sort((n,o)=>{var b,f;const c=(b=n.createdAt)!=null&&b.seconds?n.createdAt.seconds*1e3:new Date(n.createdAt).getTime();return(((f=o.createdAt)!=null&&f.seconds?o.createdAt.seconds*1e3:new Date(o.createdAt).getTime())||0)-(c||0)});Y(l)}catch{}})()},[p,g.length]),i.useEffect(()=>{p==="Reviews"&&g.length>0&&(async()=>{try{const a=[],r=g.slice(0,10).map(async n=>(await Q(F(R(h,"courses",n.id,"reviews"),ot(20)))).docs.map(c=>({id:c.id,courseId:n.id,courseTitle:n.title,...c.data()})));(await Promise.all(r)).forEach(n=>a.push(...n));const l=a.sort((n,o)=>{var b,f;const c=(b=n.createdAt)!=null&&b.seconds?n.createdAt.seconds*1e3:new Date(n.createdAt).getTime();return(((f=o.createdAt)!=null&&f.seconds?o.createdAt.seconds*1e3:new Date(o.createdAt).getTime())||0)-(c||0)});ys(l)}catch{}})()},[p,g.length]),i.useEffect(()=>{(p==="Student analytics"||p==="Overview")&&g.length>0&&(async()=>{Be(!0);try{const a=g.map(c=>c.id).filter(c=>c);if(a.length===0){mt([]),Be(!1);return}const r=F(R(h,"users"),_("role","==","student"),_("enrolledCourses","array-contains-any",a.slice(0,10))),l=(await Q(r)).docs.map(c=>{const u=c.data(),b=u.courseProgress||{};let f=0,y=0;a.forEach(z=>{b[z]!==void 0&&(f+=Number(b[z]),y++)});const m=y>0?Math.round(f/y):0;return{id:c.id,...u,calculatedProgress:m}}),n=l.reduce((c,u)=>c+u.calculatedProgress,0),o=l.length>0?Math.round(n/l.length):0;mt(l),hs(o)}catch{x.error("Analytics Loading Failed","Could not synchronize student metrics.")}finally{Be(!1)}})()},[p,g]),i.useEffect(()=>{p==="Assignment manager"&&g.length>0&&(async()=>{var a;ft(!0);try{if(g.map(o=>o.id).length===0){Ye([]);return}const s=F(R(h,"assignmentSubmissions"),_("instructorId","==",(a=j.currentUser)==null?void 0:a.uid)),n=(await Q(s)).docs.map(o=>({id:o.id,...o.data()})).sort((o,c)=>new Date(c.submittedAt).getTime()-new Date(o.submittedAt).getTime());Ye(n)}catch(r){console.error("Error fetching submissions:",r),x.error("Error","Failed to fetch assignment submissions")}finally{ft(!1)}})()},[p,g]),i.useEffect(()=>{p==="Support portal"&&(async()=>{It(!0);try{const a=F(R(h,"support_tickets"),fa("createdAt","desc"),ot(100)),s=(await Q(a)).docs.map(l=>{var o;const n=l.data();return{id:l.id,...n,createdAt:(o=n.createdAt)!=null&&o.toDate?n.createdAt.toDate():new Date}});Dt(s)}catch(a){console.error("Support Tickets Error:",a),x.error("Error","Failed to load support tickets")}finally{It(!1)}})()},[p,g]);const Js=t=>{Ys(t),Mt(t.instructorFeedback||""),Qt(t.score||""),Tt(t.status==="cleared"||t.status==="not_cleared"?t.status:"pending"),we(!0)},Zs=async()=>{if(!(!ee||!j.currentUser)){$t(!0);try{const t=k(h,"assignmentSubmissions",ee.id),a=rt==="pending"?"graded":rt;await C(t,{instructorFeedback:Ue,score:at,status:a,gradedAt:new Date().toISOString(),isResubmission:!1}),Ye(r=>r.map(s=>s.id===ee.id?{...s,instructorFeedback:Ue,score:at,status:a,isResubmission:!1}:s)),x.success("Success","Feedback saved successfully"),we(!1)}catch{x.error("Error","Failed to save feedback")}finally{$t(!1)}}},nt=(t,a,r)=>{Ps(t),a?(Ee(a.content),Ze(r!==void 0?r:null)):(Ee(""),Ze(null)),he(!0)},Xs=async()=>{var t;if(!(!U.trim()||!S||!j.currentUser)){if(L===null&&(((t=S.replies)==null?void 0:t.length)||0)>=5){x.error("Limit Reached","Maximum 5 replies allowed per question");return}wt(!0);try{const a=k(h,"courses",S.courseId,"questions",S.id);if(L!==null){const s=[...S.replies];s[L]={...s[L],content:U,updatedAt:new Date().toISOString()},await C(a,{replies:s}),x.success("Success","Reply updated successfully")}else{const s={userId:j.currentUser.uid,userName:(w==null?void 0:w.fullName)||"Instructor",content:U,createdAt:new Date().toISOString()};await C(a,{replies:es(s),status:"answered"}),x.success("Success","Reply posted successfully")}const r=ne.map(s=>{var l;if(s.id===S.id){const n=L!==null?[...s.replies]:[...s.replies||[],{userId:(l=j.currentUser)==null?void 0:l.uid,userName:(w==null?void 0:w.fullName)||"Instructor",content:U,createdAt:new Date().toISOString()}];return L!==null&&(n[L].content=U),{...s,replies:n,status:"answered"}}return s});Y(r),he(!1),Ee(""),Ze(null)}catch{x.error("Error","Failed to post reply")}finally{wt(!1)}}},qs=async(t,a)=>{if(window.confirm("Are you sure you want to delete this reply?"))try{const r=k(h,"courses",t.courseId,"questions",t.id),s=t.replies.filter((n,o)=>o!==a);await C(r,{replies:s,status:s.length===0?"pending":"answered"});const l=ne.map(n=>n.id===t.id?{...n,replies:s,status:s.length===0?"pending":"answered"}:n);Y(l),x.success("Success","Reply deleted")}catch{x.error("Error","Failed to delete reply")}},ea=t=>{Es(t),Nt(t.title||""),kt(t.content||""),me(!0)},ta=async()=>
1{if(!(!J||!be.trim()||!fe.trim())){Ct(!0);try{const t=k(h,"courses",J.courseId,"questions",J.id);await C(t,{title:be,content:fe,updatedAt:qt()}),Y(a=>a.map(r=>r.id===J.id?{...r,title:be,content:fe}:r)),x.success("Success","Question updated successfully"),me(!1)}catch{x.error("Error","Failed to update question")}finally{Ct(!1)}}},sa=async t=>{if(window.confirm("Are you sure you want to delete this question? This action cannot be undone."))try{const{deleteDoc:a}=await xa(async()=>{const{deleteDoc:s}=await import("./vendor-firebase-CMgAD1F0.js").then(l=>l.N);return{deleteDoc:s}},[]),r=k(h,"courses",t.courseId,"questions",t.id);await a(r),Y(s=>s.filter(l=>l.id!==t.id)),x.success("Success","Question deleted successfully")}catch{x.error("Error","Failed to delete question")}},aa=async t=>{try{const a=k(h,"courses",t.courseId,"questions",t.id),r=!t.isFeatured;await C(a,{isFeatured:r}),Y(s=>s.map(l=>l.id===t.id?{...l,isFeatured:r}:l)),x.success("Success",r?"Question marked as featured":"Question removed from featured")}catch{x.error("Error","Failed to update featured status")}},ra=async()=>{if(!(!I||!j.currentUser)){At(!0);try{const t=k(h,"courses",I.courseId),a=await Ne(t);if(a.exists()){const s=(a.data().liveClasses||[]).map(l=>l.id===I.id?{...l,status:"completed",recordingLink:zt,endedAt:new Date().toISOString()}:l);await C(t,{liveClasses:s}),Pe(l=>l.map(n=>n.id===I.courseId?{...n,liveClasses:s}:n)),x.success("Session Ended","Recording link has been saved successfully."),Z(!1),Xe(null),Fe("")}}catch{x.error("Error","Failed to end session")}finally{At(!1)}}},la=async t=>{if(t.preventDefault(),!(!v.courseId||!v.title||!v.date||!j.currentUser)){Pt(!0);try{const a=k(h,"courses",v.courseId),r={id:Math.random().toString(36).substr(2,9),title:v.title,date:v.date,time:v.time,duration:v.duration,meetingLink:v.meetingLink,status:"scheduled",attendanceCode:ds(),attendees:[],createdAt:new Date().toISOString()};await C(a,{liveClasses:es(r)}),x.success("Session Scheduled","Your new live session has been added successfully."),X(!1),$({courseId:"",title:"",date:"",time:"",duration:60,meetingLink:""})}catch{x.error("Error","Failed to schedule session")}finally{Pt(!1)}}},Wt=async(t,a)=>{if(window.confirm("Are you sure you want to delete this session? This action cannot be undone."))try{const r=k(h,"courses",t),s=await Ne(r);if(s.exists()){const n=(s.data().liveClasses||[]).filter(o=>o.id!==a);await C(r,{liveClasses:n}),Pe(o=>o.map(c=>c.id===t?{...c,liveClasses:n}:c)),x.success("Session Deleted","The live session has been removed.")}}catch{x.error("Error","Failed to delete session")}},na=async(t,a)=>{try{const r=k(h,"courses",t),s=await Ne(r);if(s.exists()){const l=s.data().liveClasses||[],n=ds(),o=l.map(c=>c.id===a?{...c,attendanceCode:n,attendees:c.attendees||[]}:c);await C(r,{liveClasses:o}),Pe(c=>c.map(u=>u.id===t?{...u,liveClasses:o}:u)),x.success("Code Generated","Attendance code is ready to use")}}catch(r){console.error("Code generation error:",r),x.error("Error","Failed to generate attendance code")}},ia=t=>{Rs(a=>{const r=new Set(a);return r.has(t)?r.delete(t):r.add(t),r})},it=Math.ceil(g.filter(t=>{var s;const a=ie==="all"||t.status===ie,r=(((s=t.title)==null?void 0:s.toLowerCase())||"").includes(Ke.toLowerCase());return a&&r}).length/Je),Yt=g.filter(t=>{var s;const a=ie==="all"||t.status===ie,r=(((s=t.title)==null?void 0:s.toLowerCase())||"").includes(Ke.toLowerCase());return a&&r}).slice((ge-1)*Je,ge*Je),O=Ge.filter(t=>{var l,n,o;const a=(((l=t.fullName)==null?void 0:l.toLowerCase())||"").includes(Ve.toLowerCase())||(((n=t.email)==null?void 0:n.toLowerCase())||"").includes(Ve.toLowerCase()),r=We==="all"||((o=t.enrolledCourses)==null?void 0:o.includes(We)),s=le==="all"||(le==="struggling"?t.calculatedProgress<30:le==="in-progress"?t.calculatedProgress>=30&&t.calculatedProgress<=90:le==="completed"?t.calculatedProgress>90:!0);return a&&r&&s}),oa=O.slice((T-1)*W,T*W);return xs?e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 border-4 border-blue-600/20 border-t-blue-600 rounded-full animate-spin"})}):e.jsxs(wa,{activePage:p,children:[p!=="Message inbox"&&p!=="Support portal"&&e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-12",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("span",{className:"px-3 py-1 bg-blue-100 text-blue-600 rounded-lg text-[10px] font-black uppercase tracking-widest",children:"Mentor Dashboard"}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-600 animate-pulse"}),e.jsx("span",{className:"text-gray-400 text-xs font-bold uppercase tracking-widest",children:"Live Platform Session"})]}),e.jsx("h1",{className:"text-2xl sm:text-4xl font-black text-gray-900 tracking-tight",children:p})]}),p==="Course management"&&e.jsxs("button",{onClick:()=>
1D("/instructor/courses/new"),className:"bg-blue-600 hover:bg-blue-700 text-white px-6 sm:px-8 py-3 sm:py-4 rounded-xl sm:rounded-[22px] font-black uppercase tracking-widest text-[10px] sm:text-[11px] shadow-2xl shadow-blue-200 transition-all hover:-translate-y-1 flex items-center justify-center gap-3",children:[e.jsx(ct,{size:18})," Create New Course"]}),p==="Overview"&&e.jsxs("button",{onClick:()=>D("/instructor/courses/new"),className:"bg-blue-600 hover:bg-blue-700 text-white px-6 sm:px-8 py-3 sm:py-4 rounded-xl sm:rounded-[22px] font-black uppercase tracking-widest text-[10px] sm:text-[11px] shadow-2xl shadow-blue-200 transition-all hover:-translate-y-1 flex items-center justify-center gap-3",children:[e.jsx(ct,{size:18})," Create New Course"]})]}),p==="Overview"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[{label:"Total Students",value:Ge.length,icon:se,color:"text-blue-600",bg:"bg-blue-50"},{label:"Active Courses",value:g.length,icon:ts,color:"text-indigo-600",bg:"bg-indigo-50"},{label:"Growth Rating",value:Vt.avgRating,icon:ss,color:"text-amber-600",bg:"bg-amber-50"},{label:"Student Progress",value:`${bt}%`,icon:ke,color:"text-emerald-600",bg:"bg-emerald-50"}].map((t,a)=>e.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[30px] sm:rounded-[40px] border border-gray-100 shadow-sm hover:shadow-xl transition-all group",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4 sm:mb-6",children:[e.jsx("div",{className:`p-3 sm:p-4 rounded-2xl sm:rounded-3xl ${t.bg} ${t.color} transition-transform group-hover:scale-110 duration-500`,children:e.jsx(t.icon,{size:20,className:"sm:w-6 sm:h-6"})}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-black text-emerald-500 uppercase tracking-widest bg-emerald-50 px-2 sm:px-3 py-1 rounded-lg",children:Vt.monthlyGrowth})]}),e.jsx("h3",{className:"text-gray-400 text-[10px] sm:text-[11px] font-black uppercase tracking-[0.2em] mb-1",children:t.label}),e.jsx("p",{className:"text-2xl sm:text-3xl font-black text-gray-900 tracking-tight",children:t.value})]},a))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-2xl font-black text-gray-900 flex items-center gap-3",children:["Active Courses ",e.jsxs("span",{className:"text-sm font-black text-blue-600 bg-blue-50 px-3 py-1 rounded-lg",children:[g.length," Total"]})]}),e.jsxs("button",{onClick:()=>H("Course management"),className:"text-blue-600 font-black text-[10px] uppercase tracking-widest hover:gap-2 transition-all flex items-center gap-1",children:["Manage All ",e.jsx(G,{size:14})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-6",children:g.length>0?g.slice(0,3).map((t,a)=>e.jsxs("div",{className:"bg-white p-4 sm:p-6 rounded-[24px] sm:rounded-[32px] border border-gray-100 shadow-sm hover:shadow-lg transition-all flex flex-col sm:flex-row items-start sm:items-center gap-4 sm:gap-6 group cursor-pointer",onClick:()=>D(`/instructor/courses/edit/${t.id}`),children:[e.jsx("div",{className:"w-full sm:w-16 h-32 sm:h-16 rounded-2xl bg-gray-50 flex items-center justify-center text-gray-400 group-hover:bg-blue-50 group-hover:text-blue-600 transition-all shrink-0 overflow-hidden",children:t.thumbnailUrl?e.jsx("img",{src:t.thumbnailUrl,alt:"",className:`w-full h-full transition-all duration-300 ${t.thumbnailFit==="contain"?"object-contain p-2":"object-cover"}`}):e.jsx(Se,{size:32})}
1),e.jsxs("div",{className:"flex-1 min-w-0 w-full",children:[e.jsx("h4",{className:"font-black text-gray-900 truncate mb-1 text-sm sm:text-base",children:t.title}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-gray-400",children:[e.jsx(se,{size:14})," ",t.studentsCount||0," Students"]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-emerald-500",children:[e.jsx(ss,{size:14})," ",t.rating||"New"," Rating"]})]})]}),e.jsxs("div",{className:"flex flex-row sm:flex-col items-center sm:items-end justify-between sm:justify-center w-full sm:w-auto gap-2 border-t sm:border-t-0 border-gray-50 pt-3 sm:pt-0 mt-2 sm:mt-0",children:[e.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest ${t.status==="published"?"bg-emerald-50 text-emerald-600":"bg-amber-50 text-amber-600"}`,children:t.status}),e.jsx("button",{className:"p-2 hover:bg-gray-50 rounded-xl transition-colors",children:e.jsx(va,{size:18,className:"text-gray-400"})})]})]},a)):e.jsxs("div",{className:"bg-white p-12 rounded-[32px] border border-dashed border-gray-100 flex flex-col items-center text-center",children:[e.jsx("div",{className:"p-4 bg-gray-50 rounded-full text-gray-300 mb-4",children:e.jsx(ts,{size:32})}),e.jsx("h4",{className:"font-black text-gray-900 mb-2",children:"No courses created yet"}),e.jsx("p",{className:"text-gray-400 text-sm max-w-xs mb-6 font-medium",children:"Start sharing your medical knowledge by creating your first specialized AI module."}),e.jsx("button",{onClick:()=>D("/instructor/courses/new"),className:"bg-blue-600 text-white px-8 py-3 rounded-xl font-black uppercase tracking-widest text-[10px] shadow-xl shadow-blue-100",children:"Get Started"})]})})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx("h3",{className:"text-2xl font-black text-gray-900",children:"Recent Q&A"}),e.jsxs("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"p-8 space-y-6",children:ne.length>0?ne.map(t=>{var a,r;return e.jsxs("div",{onClick:()=>nt(t),className:"flex gap-4 group cursor-pointer border-b border-gray-50 pb-6 last:border-0 last:pb-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gray-50 shrink-0 flex items-center justify-center font-black text-gray-400 group-hover:bg-blue-50 group-hover:text-blue-600 transition-all",children:((a=t.userName)==null?void 0:a.charAt(0))||"S"}),e.jsxs("div",{children:[e.jsx("h5",{className:"text-[13px] font-black text-gray-900 mb-1 group-hover:text-blue-600 transition-colors line-clamp-2",children:t.title||t.content}),e.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-2",children:[t.courseTitle||"Course Question"," • ",(r=t.createdAt)!=null&&r.seconds?new Date(t.createdAt.seconds*1e3).toLocaleDateString():"Just now"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-md text-[8px] font-black uppercase tracking-widest ${t.status==="answered"?"bg-emerald-50 text-emerald-600":"bg-amber-50 text-amber-600"}`,children:t.status||"Pending"}),t.isFeatured&&e.jsxs("span",{className:"flex items-center gap-1 bg-blue-50 text-blue-600 px-2 py-0.5 rounded-md text-[8px] font-black uppercase tracking-widest",children:[e.jsx(Ce,{size:10,fill:"currentColor"})," Featured"]})]})]})]},t.id)}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-50 rounded-2xl flex items-center justify-center mx-auto mb-3 text-gray-300",children:e.jsx(ze,{size:20})}),e.jsx("p",{className:"text-gray-400 text-xs font-bold",children:"No recent questions"})]})}),e.jsx("div",{className:"p-6 bg-gray-50/50 border-t border-gray-100",children:e.jsx("button",{onClick:()=>H("QA management"),className:"w-full bg-white border border-gray-100 py-4 rounded-2xl text-[10px] font-black uppercase tracking-widest text-gray-500 hover:text-blue-600 transition-all",children:"View All Questions"})})]})]})]})]}),p==="Course management"&&e.jsxs("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-8 border-b border-gray-100 flex flex-col xl:flex-row xl:items-center justify-between bg-gray-50/30 gap-6",children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:"All Modules"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-4",children:[e.jsxs("div",{className:"relative w-full md:w-64",children:[e.jsx("input",{type:"text",placeholder:"Search modules...",value:Ke,onChange:t=>{zs(t.target.value),pe(1)},className:"w-full pl-10 pr-4 py-2.5 bg-white border border-gray-100 rounded-xl text-xs font-bold focus:outline-none focus:ring-2 focus:ring-blue-500/10 focus:border-blue-500 transition-all"}),e.jsx(ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:[{id:"all",label:"All"},{id:"published",label:"Published"},{id:"pending",label:"Pending Approval"},{id:"draft",label:"Drafts"}].map(t=>e.jsx("button",{onClick:()=>{vs(t.id),pe(1)},className:`px-4 py-2 rounded-xl text-xs font-black uppercase tracking-widest transition-all ${ie===t.id?"bg-blue-600 text-white shadow-lg shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-600"}`,children:t.label},t.id))})]})]}),e.jsx("div",{className:"p-8",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:Yt.length===0?e.jsxs("div",{className:"col-span-full py-12 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-50 text-gray-300 rounded-3xl flex items-center justify-center mx-auto mb-6",children:e.jsx(ae,{size:32})}),e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-2",children:"No Modules Found"}),e.jsx("p",{className:"text-gray-400 font-medium max-w-md mx-auto",children:"Try adjusting your search or filter to find what you're looking for."})]}):e.jsxs(e.Fragment,{children:[Yt.map((t,a)=>e.jsxs("div",{className:"group bg-white rounded-[32px] border border-gray-100 p-6 hover:shadow-xl hover:border-blue-100 transition-all duration-300",children:[e.jsxs("div",{className:"aspect-video bg-gray-100 rounded-2xl mb-6 relative overflow-hidden",children:[t.thumbnailUrl?e.jsx("img",{src:t.thumbnailUrl,alt:"",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-300",children:e.jsx(Se,{size:48})}),e.jsx("div",{className:"absolute top-4 left-4 flex flex-col gap-2",children:t.isLiveClass&&e.jsxs("span",{className:"px-3 py-1 bg-red-600 text-white text-[9px] font-black rounded-lg uppercase tracking-wider flex items-center gap-1 shadow-lg animate-pulse",children:[e.jsx(Oe,{size:10}),"Live"]})}),e.jsx("div",{className:"absolute top-4 right-4 group-hover:opacity-0 transition-opacity",children:e.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest backdrop-blur-md shadow-lg ${t.status==="published"?"bg-emerald-500 text-white":t.status==="pending"?"bg-blue-500 text-white":"bg-amber-500 text-white"}`,children:t.status==="pending"?"Reviewing":t.status})})]}),e.jsx("h3",{className:"font-black text-gray-900 text-lg mb-2 group-hover:text-blue-600 transition-colors line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 font-bold mb-6",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(se,{size:14})," ",t.studentsCount||0," Students"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Na,{size:14})," $",t.price||"0"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>D(`/instructor/courses/edit/${t.id}`),className:"flex-1 py-3 bg-gray-50 text-gray-900 rounded-xl font-bold text-xs hover:bg-blue-600 hover:text-white transition-all",children:"Edit Content"}),t.isLiveClass&&e.jsxs("button",{onClick:()=>H("Live Sessions"),className:"flex-1 py-3 bg-rose-50 text-rose-600 rounded-xl font-bold text-xs hover:bg-rose-600 hover:text-white transition-all flex items-center justify-center gap-2 border border-rose-100",children:[e.jsx(Oe,{size:14})," Sessions"]}),e.jsx("button",{className:"p-3 bg-gray-50 text-gray-400 rounded-xl hover:bg-red-50 hover:text-red-500 transition-all",children:e.jsx(as,{size:18})})]})]},a)),it>1&&e.jsxs("div",{className:"col-span-full flex items-center justify-center gap-4 pt-8",children:[e.jsx("button",{disabled:ge===1,onClick:()=>pe(t=>t-1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(re,{size:20})}),e.jsx("div",{className:"flex items-center gap-2",children:[...Array(it)].map((t,a)=>e.jsx("button",{onClick:()=>pe(a+1),className:`w-12 h-12 rounded-2xl text-xs font-black transition-all ${ge===a+1?"bg-blue-600 text-white shadow-xl shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-900"}`,children:a+1},a))}),e.jsx("button",{disabled:ge===it,onClick:()=>pe(t=>t+1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(G,{size:20})})]})]})})})]}),p==="Student analytics"&&e.jsxs("div",{className:"space-y-12 animate-enter",children:[e.jsxs("div",{className:"flex flex-col xl:flex-row xl:items-end justify-between gap-8 pb-8 border-b border-gray-100",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 w-full xl:w-2/3",children:[{label:"Managed Students",value:Ge.length,icon:se,color:"text-blue-600",bg:"bg-blue-50"},{label:"Avg. Completion",value:`${bt}%`,icon:ke,color:"text-indigo-600",bg:"bg-indigo-50"},{label:"Active Cohorts",value:g.length,icon:Ce,color:"text-emerald-600",bg:"bg-emerald-50"}
1].map((t,a)=>e.jsxs("div",{className:"bg-white p-6 rounded-[32px] border border-gray-100 shadow-sm flex items-center justify-between group hover:shadow-xl hover:shadow-blue-900/5 transition-all",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-gray-400 text-[10px] font-black uppercase tracking-widest mb-1",children:t.label}),e.jsx("p",{className:"text-3xl font-black text-gray-900 tracking-tight",children:t.value})]}),e.jsx("div",{className:`w-12 h-12 rounded-2xl ${t.bg} ${t.color} flex items-center justify-center transition-transform group-hover:scale-110`,children:e.jsx(t.icon,{size:20})})]},a))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"relative group/search",children:[e.jsx(ae,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within/search:text-blue-600 transition-colors",size:16}),e.jsx("input",{type:"text",placeholder:"Search students...",className:"pl-12 pr-6 h-14 bg-white border border-gray-100 rounded-2xl text-[11px] font-black uppercase tracking-widest focus:border-blue-500/50 outline-none transition-all w-64 shadow-sm",value:Ve,onChange:t=>{ps(t.target.value),V(1)}})]}),e.jsx("button",{className:"h-14 px-8 bg-gray-900 text-white rounded-2xl text-[10px] font-black uppercase tracking-[0.2em] hover:bg-black transition-all shadow-xl shadow-gray-200",children:"Export Data"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 bg-white border border-gray-100 rounded-2xl shadow-sm",children:[e.jsx("span",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest shrink-0",children:"By Module:"}),e.jsxs("select",{value:We,onChange:t=>{ms(t.target.value),V(1)},className:"bg-transparent border-none outline-none text-[11px] font-black uppercase tracking-widest text-blue-600 cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Modules"}),g.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})]}),e.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 bg-white border border-gray-100 rounded-2xl shadow-sm",children:[e.jsx("span",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest shrink-0",children:"By Progress:"}),e.jsxs("select",{value:le,onChange:t=>{bs(t.target.value),V(1)},className:"bg-transparent border-none outline-none text-[11px] font-black uppercase tracking-widest text-indigo-600 cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Levels"}),e.jsx("option",{value:"struggling",children:"Struggling (<30%)"}),e.jsx("option",{value:"in-progress",children:"In Progress (30-90%)"}),e.jsx("option",{value:"completed",children:"Completed (>90%)"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden min-h-[500px] flex flex-col",children:[e.jsx("div",{className:"p-8 border-b border-gray-100 flex items-center justify-between bg-gray-50/20",children:e.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Learning Cohort Registry"})}),e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50/50",children:[e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Student Information"}),e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Enrolled Cohorts"}),e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Completion Progress"}),e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Login Frequency"}),e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Last Activity"}),e.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:gs?e.jsx("tr",{children:e.jsxs("td",{colSpan:6,className:"px-8 py-20 text-center",children:[e.jsx(A,{className:"animate-spin mx-auto text-blue-600 mb-4",size:32}),e.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Synchronizing learning metrics..."})]})}):O.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-8 py-20 text-center",children:e.jsx("p",{className:"text-gray-400 font-medium",children:"No learning candidates match these refined criteria."})})}):oa.map(t=>{var a,r,s,l;return e.jsxs("tr",{className:"hover:bg-gray-50/30 transition-colors group border-b border-gray-50 last:border-0",children:[e.jsx("td",{className:"px-8 py-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-tr from-blue-600 to-indigo-600 flex items-center justify-center text-white font-black text-sm shadow-lg shadow-blue-500/10",children:(a=t.fullName)==null?void 0:a.charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-black text-gray-900 text-sm",children:t.fullName}),e.jsx("p",{className:"text-[10px] font-bold text-gray-400 tracking-tight",children:t.email})]})]})}),e.jsx("td",{className:"px-8 py-6",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(r=t.enrolledCourses)==null?void 0:r.slice(0,2).map(n=>{var o,c;return e.jsxs("span",{className:"px-2.5 py-1 bg-gray-50 text-gray-500 rounded-lg text-[9px] font-black uppercase tracking-widest",children:[((c=(o=g.find(u=>u.id===n))==null?void 0:o.title)==null?void 0:c.slice(0,15))||"Module","..."]}
1,n)}),((s=t.enrolledCourses)==null?void 0:s.length)>2&&e.jsxs("span",{className:"px-2.5 py-1 bg-blue-50 text-blue-600 rounded-lg text-[9px] font-black uppercase tracking-widest",children:["+",t.enrolledCourses.length-2]})]})}),e.jsx("td",{className:"px-8 py-6",children:e.jsxs("div",{className:"w-40",children:[e.jsxs("div",{className:"flex justify-between text-[10px] font-black text-gray-400 mb-2 uppercase tracking-widest",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{className:"text-blue-600",children:[t.calculatedProgress,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full bg-gray-100 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-blue-600 rounded-full",style:{width:`${t.calculatedProgress}%`}})})]})}),e.jsx("td",{className:"px-8 py-6",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(ke,{size:12,className:"text-blue-500"}),e.jsxs("span",{className:"text-[11px] font-black text-gray-900",children:[t.totalLogins||0," Logins"]})]}),e.jsx("p",{className:"text-[9px] font-black text-gray-400 uppercase tracking-widest leading-none",children:(()=>{const n=t.createdAt?new Date(t.createdAt):new Date,o=Math.max(1,Math.floor((new Date().getTime()-n.getTime())/(1e3*3600*24)));return`${Math.round((t.totalLogins||0)/(o/30))} Mean / Month`})()})]})}),e.jsx("td",{className:"px-8 py-6 text-[11px] font-bold text-gray-400",children:(l=t.lastLogin)!=null&&l.toDate?t.lastLogin.toDate().toLocaleDateString():"Active Recently"}),e.jsx("td",{className:"px-8 py-6 text-right",children:e.jsx("button",{onClick:()=>{H("Message inbox")},className:"p-2.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-xl transition-all",children:e.jsx(ze,{size:18})})})]},t.id)})})]})}),O.length>0&&e.jsxs("div",{className:"p-8 bg-gray-50/30 border-t border-gray-100 flex flex-col sm:flex-row items-center justify-between gap-6 mt-auto",children:[e.jsxs("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest italic",children:["Showing ",e.jsxs("span",{className:"text-blue-600",children:[(T-1)*W+1,"-",Math.min(T*W,O.length)]})," of ",e.jsx("span",{className:"text-gray-900",children:O.length})," candidates"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{disabled:T===1,onClick:()=>V(t=>t-1),className:"w-12 h-12 flex items-center justify-center bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all shadow-sm",children:e.jsx(re,{size:20})}),e.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.ceil(O.length/W)}).map((t,a)=>e.jsx("button",{onClick:()=>V(a+1),className:`w-12 h-12 rounded-2xl text-[11px] font-black transition-all ${T===a+1?"bg-blue-600 text-white shadow-xl shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-blue-600"}`,children:a+1},a))}),e.jsx("button",{disabled:T>=Math.ceil(O.length/W),onClick:()=>V(t=>t+1),className:"w-12 h-12 flex items-center justify-center bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all shadow-sm",children:e.jsx(G,{size:20})})]})]})]})]}),p==="Assignment manager"&&(()=>{const a=js.filter(l=>{var u,b,f;const n=(((u=l.userName)==null?void 0:u.toLowerCase())||"").includes(Me.toLowerCase())||(((b=l.lessonTitle)==null?void 0:b.toLowerCase())||"").includes(Me.toLowerCase())||(((f=l.courseTitle)==null?void 0:f.toLowerCase())||"").includes(Me.toLowerCase()),o=Qe==="all"||Qe==="pending"&&(l.status==="pending"||l.status==="re-uploaded")||l.status===Qe,c=tt==="all"||l.courseId===tt;return n&&o&&c}),r=Math.ceil(a.length/10),s=a.slice((je-1)*10,je*10);return e.jsxs("div",{className:"space-y-12 animate-enter",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-8 pb-8 border-b border-gray-100",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-3xl font-black text-gray-900 tracking-tight",children:"Assignment Manager"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Review student solutions and provide qualitative feedback"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"relative group/search",children:[e.jsx(ae,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within/search:text-blue-600 transition-colors",size:16}),e.jsx("input",{type:"text",placeholder:"Search student or lesson...",className:"pl-12 pr-6 h-14 bg-white border border-gray-100 rounded-2xl text-[11px] font-black uppercase tracking-widest focus:border-blue-500/50 outline-none transition-all w-64 shadow-sm",value:Me,onChange:l=>{Os(l.target.value),q(1)}})]}
1),e.jsxs("select",{value:tt,onChange:l=>{Gs(l.target.value),q(1)},className:"h-14 px-6 bg-white border border-gray-100 rounded-2xl text-[11px] font-black uppercase tracking-widest focus:border-blue-500/50 outline-none transition-all shadow-sm cursor-pointer min-w-[200px]",children:[e.jsx("option",{value:"all",children:"All Courses"}),g.map(l=>e.jsx("option",{value:l.id,children:l.title},l.id))]}),e.jsxs("select",{value:Qe,onChange:l=>{_s(l.target.value),q(1)},className:"h-14 px-6 bg-white border border-gray-100 rounded-2xl text-[11px] font-black uppercase tracking-widest focus:border-blue-500/50 outline-none transition-all shadow-sm cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"pending",children:"Pending Review"}),e.jsx("option",{value:"re-uploaded",children:"Re-uploaded"}),e.jsx("option",{value:"graded",children:"Graded"}),e.jsx("option",{value:"cleared",children:"Cleared"}),e.jsx("option",{value:"not_cleared",children:"Not Cleared"})]})]})]}),e.jsx("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50/50",children:[e.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Student & Lesson"}),e.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Course Module"}),e.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Score"}),e.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Status"}),e.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-gray-400 uppercase tracking-widest text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:ws?e.jsx("tr",{children:e.jsxs("td",{colSpan:5,className:"px-8 py-20 text-center",children:[e.jsx(A,{className:"animate-spin mx-auto text-blue-600 mb-4",size:32}),e.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest",children:"Fetching student submissions..."})]})}):s.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:5,className:"px-8 py-20 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-50 text-gray-300 rounded-3xl flex items-center justify-center mx-auto mb-4",children:e.jsx(ka,{size:32})}),e.jsx("h4",{className:"font-black text-gray-900 mb-2",children:"No Submissions Found"}),e.jsx("p",{className:"text-gray-400 font-medium",children:"When students upload assignment solutions, they will appear here."})]})}):s.map(l=>{var n;return e.jsxs("tr",{className:"group hover:bg-gray-50/30 transition-colors",children:[e.jsx("td",{className:"px-8 py-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-indigo-500 to-purple-500 flex items-center justify-center text-white font-black text-sm",children:(n=l.userName)==null?void 0:n.charAt(0)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-black text-gray-900 text-sm",children:l.userName}),l.isResubmission&&e.jsx("span",{className:"bg-blue-100 text-blue-600 px-2 py-0.5 rounded-lg text-[8px] font-black uppercase tracking-tighter",children:"Updated"})]}),e.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:l.lessonTitle})]})]})}),e.jsx("td",{className:"px-8 py-6",children:e.jsx("span",{className:"text-xs font-black text-blue-600 bg-blue-50 px-3 py-1.5 rounded-lg line-clamp-1 max-w-[200px]",children:l.courseTitle})}),e.jsx("td",{className:"px-8 py-6",children:e.jsx("p",{className:"text-sm font-black text-gray-900",children:l.score||"N/A"})}),e.jsx("td",{className:"px-8 py-6",children:e.jsx("span",{className:`px-4 py-1.5 rounded-xl text-[10px] font-black uppercase tracking-widest ${l.status==="cleared"?"bg-emerald-50 text-emerald-600":l.status==="not_cleared"?"bg-red-50 text-red-600":l.status==="re-uploaded"||l.status==="graded"?"bg-blue-50 text-blue-600":"bg-amber-50 text-amber-600"}`,children:l.status==="cleared"?"Cleared":l.status==="not_cleared"?"Not Cleared":l.status==="re-uploaded"?"Re-uploaded":l.status==="graded"?"Graded":"Pending"})}),e.jsxs("td",{className:"px-8 py-6 text-right space-x-2",children:[e.jsx("a",{href:l.fileUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex p-3 bg-gray-50 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-xl transition-all",title:"View Link",children:e.jsx(rs,{size:18})}),e.jsx("button",{onClick:()=>Js(l),className:`p-3 rounded-xl transition-all ${l.status!=="pending"?"bg-emerald-50 text-emerald-600":"bg-indigo-50 text-indigo-600 hover:bg-indigo-600 hover:text-white"}`,title:"Provide Feedback & Grade",children:e.jsx(ze,{size:18})})]})]},l.id)})})]})})}),r>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 pt-8",children:[e.jsx("button",{onClick:()=>q(l=>Math.max(1,l-1)),disabled:je===1,className:"p-3 rounded-xl bg-white border border-gray-100 text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(re,{size:20})}),[...Array(r)].map((l,n)=>e.jsx("button",{onClick:()=>q(n+1),className:`w-12 h-12 rounded-xl text-xs font-black transition-all ${je===n+1?"bg-blue-600 text-white shadow-lg shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-600"}`,children:n+1},n)),e.jsx("button",{onClick:()=>q(l=>Math.min(r,l+1)),disabled:je===r,className:"p-3 rounded-xl bg-white border border-gray-100 text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(G,{size:20})})]})]})})(),p==="QA management"&&(()=>
1{const t=ne.filter(s=>{var o,c,u,b,f;const l=(((o=s.title)==null?void 0:o.toLowerCase())||"").includes(Re.toLowerCase())||(((c=s.content)==null?void 0:c.toLowerCase())||"").includes(Re.toLowerCase())||(((u=s.userName)==null?void 0:u.toLowerCase())||"").includes(Re.toLowerCase()),n=oe==="all"||(oe==="answered"?((b=s.replies)==null?void 0:b.length)>0:oe==="unanswered"?((f=s.replies)==null?void 0:f.length)===0||!s.replies:oe==="featured"?s.isFeatured:!0);return l&&n}),a=Math.ceil(t.length/K),r=t.slice((ce-1)*K,ce*K);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[e.jsx("h3",{className:"text-2xl font-black text-gray-900",children:"Student Q&A"}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("input",{type:"text",placeholder:"Search questions...",value:Re,onChange:s=>{Ns(s.target.value),de(1)},className:"w-full pl-10 pr-4 py-2.5 bg-white border border-gray-100 rounded-xl text-xs font-bold focus:outline-none focus:ring-2 focus:ring-blue-500/10 focus:border-blue-500 transition-all"}),e.jsx(ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]}),e.jsx("div",{className:"flex gap-2",children:["all","answered","unanswered","featured"].map(s=>e.jsx("button",{onClick:l=>{l.stopPropagation(),ks(s),de(1)},className:`px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${oe===s?"bg-blue-600 text-white shadow-lg shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-600"}`,children:s},s))})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-6",children:r.length>0?r.map(s=>{var l,n,o,c,u,b,f;return e.jsxs("div",{className:"bg-white p-8 rounded-[40px] border border-gray-100 shadow-sm hover:shadow-xl transition-all",children:[e.jsxs("div",{className:"flex items-start justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-blue-50 flex items-center justify-center font-black text-blue-600 text-lg",children:((l=s.userName)==null?void 0:l.charAt(0))||"S"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-black text-gray-900 text-lg",children:s.title||"Course Question"}),e.jsxs("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:["By ",s.userName||"Student"," • ",s.courseTitle," • ",(n=s.createdAt)!=null&&n.seconds?new Date(s.createdAt.seconds*1e3).toLocaleString():"Recently"]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[s.isFeatured&&e.jsxs("span",{className:"flex items-center gap-1.5 bg-blue-50 text-blue-600 px-4 py-1.5 rounded-xl text-[10px] font-black uppercase tracking-widest border border-blue-100/50",children:[e.jsx(Ce,{size:14,fill:"currentColor"})," Featured"]}),e.jsx("span",{className:`px-4 py-1.5 rounded-xl text-[10px] font-black uppercase tracking-widest ${((o=s.replies)==null?void 0:o.length)>0?"bg-emerald-50 text-emerald-600":"bg-amber-50 text-amber-600"}`,children:((c=s.replies)==null?void 0:c.length)>0?"Answered":"Unanswered"})]})]}),e.jsxs("p",{className:"text-gray-600 font-medium leading-relaxed mb-8 bg-gray-50/50 p-6 rounded-3xl border border-gray-50 italic",children:['"',s.content,'"']}),s.replies&&s.replies.length>0&&e.jsxs("div",{className:"pt-6 border-t border-gray-50",children:[e.jsxs("button",{onClick:()=>ia(s.id),className:"w-full flex items-center justify-between group/expand mb-4 py-2",children:[e.jsxs("h5",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1 flex items-center gap-2 group-hover/expand:text-blue-600 transition-colors",children:[e.jsx(ze,{size:14})," ",s.replies.length," Replies"]}),e.jsx("div",{className:"text-gray-400 group-hover/expand:text-blue-600 transition-all",children:vt.has(s.id)?e.jsx(Sa,{size:14}):e.jsx(Ca,{size:14})})]}),vt.has(s.id)&&e.jsx("div",{className:"space-y-4 animate-fade-in",children:s.replies.map((y,m)=>{var z,te;return e.jsxs("div",{className:"flex gap-4 pl-4 border-l-2 border-blue-100",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-gray-50 shrink-0 flex items-center justify-center font-black text-gray-400 text-xs",children:((z=y.userName)==null?void 0:z.charAt(0))||"U"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between group/reply mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-black text-gray-900",children:y.userName}),e.jsxs("span",{className:"text-[9px] font-bold text-gray-400",children:["• ",new Date(y.createdAt).toLocaleDateString()]})]}),y.userId===((te=j.currentUser)==null?void 0:te.uid)&&e.jsxs("div",{className:"flex items-center gap-2 opacity-0 group-hover/reply:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:()=>nt(s,y,m),className:"p-1 hover:text-blue-600 transition-colors",children:e.jsx(dt,{size:12})}),e.jsx("button",{onClick:()=>qs(s,m),className:"p-1 hover:text-red-500 transition-colors",children:e.jsx(_e,{size:12})})]})]}),e.jsx("p",{className:"text-sm text-gray-600 font-medium",children:y.content})]})]},m)})})]}),e.jsxs("div",{className:"mt-8 flex gap-3",children:[e.jsx("button",{onClick:()=>{var y;return(((y=s.replies)==null?void 0:y.length)||0)<5?nt(s):x.error("Limit Reached","Maximum 5 replies allowed")},disabled:(((u=s.replies)==null?void 0:u.length)||0)>=5,className:`flex-1 rounded-2xl py-4 font-black uppercase text-[11px] tracking-widest transition-all ${(((b=s.replies)==null?void 0:b.length)||0)>=5?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-blue-600 text-white shadow-lg shadow-blue-100 hover:-translate-y-1"}`,children:(((f=s.replies)==null?void 0:f.length)||0)>=5?"Max Replies Reached":"Post an Answer"}),e.jsx("button",{onClick:()=>ea(s),className:"px-6 bg-gray-50 text-gray-400 rounded-2xl hover:text-blue-600 hover:bg-blue-50 transition-all border border-transparent hover:border-blue-100",title:"Edit Question",children:e.jsx(dt,{size:20})}),e.jsx("button",{onClick:()=>aa(s),className:`px-6 rounded-2xl transition-all border ${s.isFeatured?"bg-blue-600 text-white border-blue-600 shadow-lg shadow-blue-100":"bg-gray-50 text-gray-400 border-transparent hover:bg-blue-50 hover:text-blue-600 hover:border-blue-100"}`,title:s.isFeatured?"Unfeature Question":"Feature Question",children:e.jsx(Ce,{size:20,fill:s.isFeatured?"currentColor":"none"})}),e.jsx("button",{onClick:()=>sa(s),className:"px-6 bg-gray-50 text-gray-400 rounded-2xl hover:text-red-500 hover:bg-red-50 transition-all border border-transparent hover:border-red-100",title:"Delete Question",children:e.jsx(_e,{size:20})})]})]},s.id)}):e.jsxs("div",{className:"bg-white p-12 rounded-[40px] border border-dashed border-gray-100 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mx-auto mb-6",children:e.jsx(ze,{size:32})}),e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-2",children:"No Questions Yet"}),e.jsx("p",{className:"text-gray-400 font-medium max-w-md mx-auto",children:"Try adjusting your search or filters to find what you're looking for."})]})}),a>1&&e.jsxs("div",{className:"flex items-center justify-center gap-4 pt-8",children:[e.jsx("button",{disabled:ce===1,onClick:()=>de(s=>s-1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(re,{size:20})}),e.jsx("div",{className:"flex items-center gap-2",children:[...Array(a)].map((s,l)=>e.jsx("button",{onClick:()=>de(l+1),className:`w-12 h-12 rounded-2xl text-xs font-black transition-all ${ce===l+1?"bg-blue-600 text-white shadow-xl shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-900"}`,children:l+1},l))}),e.jsx("button",{disabled:ce===a,onClick:()=>de(s=>s+1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(G,{size:20})})]})]})})(),p==="Reviews"&&(()=>{const t=fs.filter(s=>{var o,c,u;const l=(((o=s.comment)==null?void 0:o.toLowerCase())||"").includes(Le.toLowerCase())||(((c=s.userName)==null?void 0:c.toLowerCase())||"").includes(Le.toLowerCase())||(((u=s.courseTitle)==null?void 0:u.toLowerCase())||"").includes(Le.toLowerCase()),n=He==="all"||s.rating===He;return l&&n}),a=Math.ceil(t.length/K),r=t.slice((xe-1)*K,xe*K);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[e.jsx("h3",{className:"text-2xl font-black text-gray-900",children:"Student Reviews"}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("input",{type:"text",placeholder:"Search reviews...",value:Le,onChange:s=>{Ss(s.target.value),ue(1)},className:"w-full pl-10 pr-4 py-2.5 bg-white border border-gray-100 rounded-xl text-xs font-bold focus:outline-none focus:ring-2 focus:ring-blue-500/10 focus:border-blue-500 transition-all"}),e.jsx(ae,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]}
1),e.jsxs("select",{value:He,onChange:s=>{Cs(s.target.value==="all"?"all":Number(s.target.value)),ue(1)},className:"px-4 py-2.5 bg-white border border-gray-100 rounded-xl text-[10px] font-black uppercase tracking-widest focus:outline-none focus:ring-2 focus:ring-blue-500/10 transition-all cursor-pointer",children:[e.jsx("option",{value:"all",children:"All Ratings"}),[5,4,3,2,1].map(s=>e.jsxs("option",{value:s,children:[s," Stars"]},s))]})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:r.length>0?r.map(s=>{var l,n;return e.jsxs("div",{className:"bg-white p-8 rounded-[40px] border border-gray-100 shadow-sm hover:shadow-xl transition-all flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-indigo-50 flex items-center justify-center font-black text-indigo-600 text-lg",children:((l=s.userName)==null?void 0:l.charAt(0))||"U"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-black text-gray-900 leading-none mb-1",children:s.userName||"Student"}),e.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:s.courseTitle})]})]}),e.jsx("div",{className:"flex items-center gap-0.5 text-amber-400",children:[...Array(5)].map((o,c)=>e.jsx(ls,{size:14,fill:c<s.rating?"currentColor":"none",className:c<s.rating?"text-amber-400":"text-gray-200"},c))})]}),e.jsxs("p",{className:"text-gray-600 font-medium leading-relaxed mb-6 flex-1 italic overflow-hidden line-clamp-4",children:['"',s.comment,'"']}),e.jsxs("div",{className:"pt-6 border-t border-gray-50 flex items-center justify-between text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:[e.jsx("span",{children:(n=s.createdAt)!=null&&n.seconds?new Date(s.createdAt.seconds*1e3).toLocaleDateString():"Recently"}),e.jsx("button",{className:"text-blue-600 hover:text-blue-700 transition-colors",children:"See Source Module"})]})]},s.id)}):e.jsxs("div",{className:"col-span-full bg-white p-12 rounded-[40px] border border-dashed border-gray-100 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-50 text-amber-600 rounded-3xl flex items-center justify-center mx-auto mb-6",children:e.jsx(ls,{size:32})}),e.jsx("h2",{className:"text-xl font-black text-gray-900 mb-2",children:"No Reviews Found"}),e.jsx("p",{className:"text-gray-400 font-medium max-w-md mx-auto",children:"Try adjusting your search or filters to find what you're looking for."})]})}),a>1&&e.jsxs("div",{className:"flex items-center justify-center gap-4 pt-8",children:[e.jsx("button",{disabled:xe===1,onClick:()=>ue(s=>s-1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(re,{size:20})}),e.jsx("div",{className:"flex items-center gap-2",children:[...Array(a)].map((s,l)=>e.jsx("button",{onClick:()=>ue(l+1),className:`w-12 h-12 rounded-2xl text-xs font-black transition-all ${xe===l+1?"bg-blue-600 text-white shadow-xl shadow-blue-100":"bg-white border border-gray-100 text-gray-400 hover:text-gray-900"}`,children:l+1},l))}),e.jsx("button",{disabled:xe===a,onClick:()=>ue(s=>s+1),className:"p-4 bg-white border border-gray-100 rounded-2xl text-gray-400 hover:text-blue-600 disabled:opacity-50 transition-all",children:e.jsx(G,{size:20})})]})]})})(),p==="Live Sessions"&&(()=>{const t=[];g.forEach(r=>{r.liveClasses&&r.liveClasses.forEach(s=>{t.push({...s,courseId:r.id,courseTitle:r.title})})});const a=t.sort((r,s)=>new Date(r.date).getTime()-new Date(s.date).getTime());return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-6",children:[e.jsx("h3",{className:"text-2xl font-black text-gray-900",children:"Live Session Management"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-[10px] font-black text-blue-600 bg-blue-50 px-3 py-1 rounded-full uppercase tracking-widest hidden sm:inline-block",children:[t.length," Total Sessions"]}),e.jsxs("button",{onClick:()=>X(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-xl font-black uppercase text-[10px] tracking-widest shadow-xl shadow-blue-100 transition-all hover:-translate-y-1 flex items-center justify-center gap-2",children:[e.jsx(ct,{size:16})," Schedule New Session"]})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.length>0?a.map((r,s)=>{var l;return e.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[32px] border border-gray-100 shadow-sm hover:shadow-xl transition-all flex flex-col lg:flex-row lg:items-center justify-between gap-6 group",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:`w-16 h-16 rounded-2xl flex items-center justify-center shrink-0 transition-all group-hover:scale-110 duration-500 ${r.status==="completed"?"bg-emerald-50 text-emerald-600":"bg-blue-50 text-blue-600"}`,children:e.jsx(Oe,{size:28})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("h4",{className:"font-black text-gray-900 text-lg",children:r.title}),e.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest ${r.status==="completed"?"bg-emerald-100 text-emerald-700":"bg-amber-100 text-amber-700"}`,children:r.status||"scheduled"})]}),e.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mb-3",children:r.courseTitle}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs font-bold text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ns,{size:14,className:"text-gray-300"})," ",r.date]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(za,{size:14,className:"text-gray-300"})," ",r.time," (",r.duration,"m)"]}),r.recordingLink&&e.jsxs("a",{href:r.recordingLink,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-blue-600 hover:text-blue-700",children:[e.jsx(Se,{size:14})," View Recording"]})]}),r.attendanceCode&&r.status!=="completed"&&e.jsxs("div",{className:"mt-3 flex items-center gap-3 px-4 py-2.5 bg-violet-50 rounded-xl border border-violet-100 w-fit",children:[e.jsx(is,{size:14,className:"text-violet-600 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[8px] font-black text-violet-500 uppercase tracking-widest leading-none mb-0.5",children:"Attendance Code"}),e.jsx("p",{className:"text-base font-black text-violet-700 tracking-[0.3em] leading-none",children:r.attendanceCode})]}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(r.attendanceCode),x.success("Copied!","Code copied to clipboard")}
1,className:"ml-1 p-1.5 bg-violet-100 hover:bg-violet-200 rounded-lg transition-all",title:"Copy code",children:e.jsx(os,{size:12,className:"text-violet-600"})})]}),!r.attendanceCode&&r.status!=="completed"&&e.jsxs("button",{onClick:()=>na(r.courseId,r.id),className:"mt-3 flex items-center gap-2 px-4 py-2 bg-gray-50 hover:bg-gray-100 text-gray-400 rounded-xl border border-gray-100 w-fit text-[10px] font-black uppercase tracking-widest transition-all",children:[e.jsx(is,{size:12})," Generate Code"]}),e.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-emerald-50 text-emerald-600 rounded-lg border border-emerald-100 uppercase tracking-widest leading-none text-[10px] font-black",children:["Present: ",Rt[r.id]||0]}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-rose-50 text-rose-600 rounded-lg border border-rose-100 uppercase tracking-widest leading-none text-[10px] font-black",children:["Absent: ",Math.max(0,(Ms[r.courseId]||0)-(Rt[r.id]||0))]}),e.jsxs("button",{onClick:()=>Ks(r.courseId,r.id,r.title),disabled:Lt,className:"flex items-center gap-2 px-4 py-1.5 bg-gray-900 hover:bg-blue-600 text-white rounded-lg text-[9px] font-black uppercase tracking-widest transition-all shadow-md active:translate-y-0.5 disabled:opacity-50",children:[Lt&&(ye==null?void 0:ye.id)===r.id?e.jsx(A,{size:10,className:"animate-spin"}):e.jsx(ke,{size:10}),"Detailed Analytics"]})]})]})]}),e.jsx("div",{className:"flex items-center gap-3",children:r.status!=="completed"?e.jsxs(e.Fragment,{children:[e.jsxs("a",{href:(l=r.meetingLink)!=null&&l.startsWith("http")?r.meetingLink:`https://${r.meetingLink}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 lg:flex-none px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-black uppercase text-[10px] tracking-widest shadow-lg shadow-blue-100 transition-all flex items-center justify-center gap-2",children:["Join Session ",e.jsx(G,{size:14})]}),e.jsx("button",{onClick:()=>{Xe(r),Fe(r.recordingLink||""),Z(!0)},className:"flex-1 lg:flex-none px-6 py-3 bg-gray-900 hover:bg-black text-white rounded-xl font-black uppercase text-[10px] tracking-widest shadow-lg shadow-gray-100 transition-all",children:"End Session"}),e.jsx("button",{onClick:()=>Wt(r.courseId,r.id),className:"p-3 bg-red-50 text-red-500 hover:bg-red-500 hover:text-white rounded-xl transition-all shadow-sm",title:"Delete Session",children:e.jsx(_e,{size:18})})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>{Xe(r),Fe(r.recordingLink||""),Z(!0)},className:"px-6 py-3 bg-gray-50 hover:bg-gray-100 text-gray-600 rounded-xl font-black uppercase text-[10px] tracking-widest transition-all border border-gray-100 flex items-center gap-2",children:["Edit Recording ",e.jsx(dt,{size:14})]}),e.jsx("button",{onClick:()=>Wt(r.courseId,r.id),className:"p-3 bg-red-50 text-red-500 hover:bg-red-500 hover:text-white rounded-xl transition-all shadow-sm",title:"Delete Session",children:e.jsx(_e,{size:18})})]})})]},s)}):e.jsxs("div",{className:"bg-white p-16 rounded-[40px] border border-dashed border-gray-100 text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-gray-50 text-gray-300 rounded-3xl flex items-center justify-center mx-auto mb-6",children:e.jsx(Oe,{size:40})}),e.jsx("h4",{className:"text-xl font-black text-gray-900 mb-2",children:"No Live Sessions Found"}),e.jsx("p",{className:"text-gray-400 font-medium max-w-sm mx-auto mb-8",children:"You haven't scheduled any live sessions for your courses yet."}),e.jsx("button",{onClick:()=>X(!0),className:"bg-blue-600 text-white px-8 py-4 rounded-2xl font-black uppercase tracking-widest text-[11px] shadow-xl shadow-blue-100 transition-all hover:-translate-y-1",children:"Schedule Your First Session"})]})})]})})(),p==="Message inbox"&&e.jsx("div",{className:"bg-white rounded-[40px] shadow-2xl shadow-blue-900/5 overflow-hidden h-[calc(100vh-12rem)] border border-gray-100",children:e.jsx(ja,{currentUserRole:"instructor",filterType:"direct",containerHeight:"h-full"})}),p==="Support portal"&&e.jsx("div",{className:"lg:h-[calc(100vh-12rem)] flex flex-col animate-enter",children:e.jsxs("div",{className:"flex-1 bg-white rounded-[40px] border border-gray-100 shadow-2xl shadow-blue-900/5 flex flex-col lg:flex-row overflow-hidden",children:[e.jsxs("div",{className:`w-full lg:w-[400px] border-r border-gray-50 flex flex-col overflow-hidden ${d?"hidden lg:flex":"flex"} h-full`,children:[e.jsxs("div",{className:"p-8 border-b border-gray-50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-2xl font-black text-gray-900 tracking-tight",children:"Support Queue"}),e.jsx("div",{className:"bg-blue-50 text-blue-600 px-3 py-1 rounded-full text-[10px] font-black tracking-widest uppercase",children:Ft.length})]}),e.jsx("div",{className:"flex bg-gray-50 p-1.5 rounded-[20px] gap-1",children:["All","Open","In Progress","Resolved"].map(t=>e.jsx("button",{onClick:()=>Vs(t.toLowerCase()),className:`flex-1 py-2 rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all ${Te===t.toLowerCase()?"bg-white text-blue-600 shadow-sm":"text-gray-400 hover:text-gray-600"}`,children:t},t))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar space-y-3",children:Bs?e.jsx("div",{className:"py-20 text-center",children:e.jsx(A,{className:"animate-spin mx-auto text-blue-600 mb-4",size:32})}):(()=>{const t=Ft.filter(a=>Te==="all"||a.status.toLowerCase()===Te);return t.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsxs("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest",children:["No ",Te," tickets found"]}
1)}):t.map(a=>{var r,s;return e.jsxs("div",{onClick:()=>st(a),className:`p-6 rounded-[32px] cursor-pointer transition-all duration-500 border relative overflow-hidden group/ticket ${(d==null?void 0:d.id)===a.id?"bg-gradient-to-br from-blue-600 to-indigo-700 border-transparent shadow-[0_20px_40px_rgba(37,99,235,0.25)] text-white scale-[1.02]":"bg-white border-transparent hover:border-blue-100 hover:shadow-xl hover:shadow-blue-500/5 text-gray-900"}`,children:[(d==null?void 0:d.id)===a.id&&e.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-white/10 blur-3xl -mr-16 -mt-16 rounded-full"}),e.jsxs("div",{className:"flex justify-between items-start mb-4 relative z-10",children:[e.jsxs("span",{className:`px-2.5 py-1 rounded-lg text-[8px] font-black uppercase tracking-widest flex items-center gap-1.5 ${(d==null?void 0:d.id)===a.id?"bg-white/20 text-white":a.priority==="High"?"bg-red-50 text-red-600 border border-red-100":"bg-blue-50 text-blue-600 border border-blue-100"}`,children:[e.jsx("div",{className:`w-1 h-1 rounded-full ${(d==null?void 0:d.id)===a.id?"bg-white":a.priority==="High"?"bg-red-600":"bg-blue-600"}`}),a.priority," Priority"]}),e.jsx("span",{className:`text-[9px] font-bold tracking-tighter ${(d==null?void 0:d.id)===a.id?"text-white/60":"text-gray-400"}`,children:(r=a.createdAt)!=null&&r.toLocaleDateString?a.createdAt.toLocaleDateString("en-GB",{day:"2-digit",month:"short"}):"Today"})]}),e.jsx("h4",{className:"font-black text-[15px] mb-2 line-clamp-1 tracking-tight relative z-10",children:a.subject}),e.jsxs("div",{className:"flex items-center justify-between relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${a.status==="Open"?"bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.5)]":a.status==="In Progress"?"bg-amber-400":"bg-blue-400"}`}),e.jsx("p",{className:`text-[10px] font-black uppercase tracking-[0.1em] ${(d==null?void 0:d.id)===a.id?"text-white/80":"text-gray-500"}`,children:a.status})]}),e.jsxs("p",{className:`text-[9px] font-bold italic truncate ml-4 ${(d==null?void 0:d.id)===a.id?"text-white/40":"text-gray-300"}`,children:["by ",(s=a.studentName)==null?void 0:s.split(" ")[0]]})]})]},a.id)})})()})]}),e.jsx("div",{className:`flex-1 p-6 lg:p-12 flex flex-col overflow-hidden ${d?"flex":"hidden lg:flex"} h-full bg-slate-50/30`,children:d?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between mb-8 pb-8 border-b border-gray-100 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("button",{onClick:()=>st(null),className:"lg:hidden p-3 bg-white rounded-2xl text-gray-400 hover:text-blue-600 transition-all border border-gray-100 shadow-sm",children:e.jsx(re,{size:20,strokeWidth:3})}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"w-16 h-16 lg:w-24 lg:h-24 rounded-[28px] lg:rounded-[40px] bg-gradient-to-tr from-blue-600 to-indigo-600 flex items-center justify-center text-white font-black text-2xl lg:text-4xl shadow-2xl relative z-10",children:((Ht=d.studentName)==null?void 0:Ht.charAt(0))||"S"}),e.jsx("div",{className:"absolute -inset-2 bg-blue-500/20 blur-2xl rounded-full opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.2em]",children:d.category||"General Support"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-gray-300"}),e.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.1em]",children:d.id.slice(-8).toUpperCase()})]}),e.jsx("h2",{className:"text-2xl lg:text-4xl font-black text-gray-900 tracking-tight leading-none mb-3 truncate",children:d.subject}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-500 text-[11px] font-bold",children:[e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 bg-white rounded-lg border border-gray-100 shadow-sm",children:[e.jsx(se,{size:14,className:"text-blue-600"})," ",d.studentName]}),e.jsxs("span",{className:"flex items-center gap-2 px-3 py-1.5 bg-white rounded-lg border border-gray-100 shadow-sm",children:[e.jsx(Aa,{size:14,className:"text-blue-600"})," ",d.studentEmail]})]})]})]}),e.jsxs("div",{className:`hidden sm:flex items-center gap-3 px-6 py-4 rounded-[24px] border shadow-lg transition-all ${d.status==="Open"?"bg-emerald-500 text-white border-emerald-400 shadow-emerald-500/20":"bg-white text-gray-900 border-gray-100 shadow-gray-200/50"}`,children:[e.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${d.status==="Open"?"bg-white shadow-[0_0_12px_rgba(255,255,255,0.8)]":"bg-
1amber-500"}`}),e.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest",children:d.status})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-2 lg:px-4 custom-scrollbar",children:e.jsxs("div",{className:"group/msg p-8 lg:p-12 mt-4 lg:mt-6 bg-white rounded-[40px] border border-gray-100 relative transition-all hover:shadow-2xl hover:shadow-slate-200/50",children:[e.jsx("div",{className:"absolute -top-3 left-8 lg:left-12 px-6 py-1.5 bg-gray-900 border border-gray-900 rounded-full text-[10px] font-black uppercase tracking-[0.2em] text-white shadow-lg",children:"Issue Description"}),e.jsx("div",{className:"relative",children:e.jsx("p",{className:"text-gray-700 font-bold leading-relaxed whitespace-pre-wrap text-base lg:text-lg",children:d.message})})]})}),e.jsx("div",{className:"pt-8 lg:pt-10",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-6 bg-white p-6 rounded-[32px] border border-gray-100 shadow-sm",children:[e.jsx("div",{className:"flex flex-wrap justify-center gap-2 lg:gap-3",children:["Open","In Progress","Resolved","Closed"].map(t=>e.jsx("button",{onClick:async()=>{try{const a=k(h,"support_tickets",d.id);await C(a,{status:t,updatedAt:qt()}),st({...d,status:t}),Dt(r=>r.map(s=>s.id===d.id?{...s,status:t}:s)),x.success("Status Updated",`Ticket marked as ${t}`)}catch{x.error("Error","Failed to update ticket status")}},className:`px-6 py-4 rounded-2xl font-black uppercase text-[10px] tracking-widest transition-all duration-300 scale-95 hover:scale-100 ${d.status===t?"bg-blue-600 text-white shadow-[0_10px_20px_rgba(37,99,235,0.2)]":"bg-gray-50 border border-transparent text-gray-400 hover:text-gray-600 hover:bg-gray-100"}`,children:t},t))}),e.jsxs("div",{className:"text-right hidden md:block",children:[e.jsx("p",{className:"text-[10px] font-black text-gray-300 uppercase tracking-[0.3em] mb-1",children:"REFERENCE ID"}),e.jsxs("p",{className:"text-[11px] font-bold text-gray-900 font-mono tracking-tighter",children:["SDK-",d.id.slice(0,8).toUpperCase()]})]})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-20 text-center animate-fade-in",children:[e.jsxs("div",{className:"w-32 h-32 bg-white rounded-[40px] shadow-2xl flex items-center justify-center mb-8 relative group",children:[e.jsx("div",{className:"absolute inset-0 bg-blue-600 rounded-[40px] opacity-0 group-hover:opacity-5 transition-opacity"}),e.jsx("div",{className:"relative p-6 bg-blue-50 rounded-2xl text-blue-600 animate-bounce-slow",children:e.jsx(os,{size:48,strokeWidth:1.5})})]}),e.jsx("h3",{className:"text-3xl font-black text-gray-900 tracking-tight mb-3",children:"Select a Ticket"}),e.jsx("p",{className:"text-gray-400 font-bold max-w-sm mx-auto leading-relaxed",children:"Choose a student inquiry from the queue to start assisting them."})]})})]})}),p==="Teacher settings"&&e.jsxs("div",{className:"max-w-4xl mx-auto space-y-12 pb-20 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-3xl font-black text-gray-900 tracking-tight",children:"Teacher Settings"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Manage your professional profile and security settings"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-12",children:[e.jsxs("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-8 sm:p-12 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-blue-200",children:e.jsx(xt,{size:28})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xl font-black text-gray-900",children:"Profile Information"}),e.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1",children:"This information will be visible to your students"})]})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(cs,{size:40,className:"text-blue-100"})})]}),e.jsxs("div",{className:"p-8 sm:p-12 space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Full Name"}),e.jsxs("div",{className:"relative group",children:[e.jsx(xt,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:"text",value:P.fullName,onChange:t=>ve({...P,fullName:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"Dr. Rajesh Kumar"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Academic / Corporate Expertise"}),e.jsxs("div",{className:"relative group",children:[e.jsx(Ce,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:"text",value:P.expertise,onChange:t=>ve({...P,expertise:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"AI Researcher in Oncology"})]})]}),e.jsxs("div",{className:"space-y-2 col-span-full",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Professional Bio"}),e.jsx("textarea",{rows:4,value:P.bio,onChange:t=>ve({...P,bio:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-[32px] p-6 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all resize-none placeholder:text-gray-300",placeholder:"Tell your students about your journey and what they can expect from your modules..."})]}),e.jsxs("div",{className:"space-y-2 col-span-full",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Organization / College Name"}),e.jsxs("div",{className:"relative group",children:[e.jsx(Pa,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:"text",value:P.collegeName,onChange:t=>ve({...P,collegeName:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"AIIMS, Delhi / Google DeepMind"})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsxs("button",{onClick:async()=>
1{if(j.currentUser){_t(!0);try{const t=k(h,"users",j.currentUser.uid);await C(t,P),x.success("Success","Profile updated successfully"),ht(a=>a?{...a,...P}:null)}catch(t){x.error("Update Failed",t.message)}finally{_t(!1)}}},disabled:Ot,className:"px-10 py-4 bg-gray-900 hover:bg-black text-white rounded-2xl font-black uppercase text-[11px] tracking-widest shadow-xl shadow-gray-200 transition-all flex items-center gap-3 disabled:opacity-50",children:[Ot?e.jsx(A,{size:16,className:"animate-spin"}):e.jsx(Ae,{size:16}),"Update Profile"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[40px] border border-gray-100 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-8 sm:p-12 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx("div",{className:"w-14 h-14 bg-amber-500 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-amber-200",children:e.jsx(ut,{size:28})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xl font-black text-gray-900",children:"Security & Password"}),e.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mt-1",children:"Keep your account secure with a strong password"})]})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(as,{size:40,className:"text-amber-100"})})]}),e.jsxs("div",{className:"p-8 sm:p-12 space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-2 col-span-full",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Current Password"}),e.jsxs("div",{className:"relative group",children:[e.jsx(ut,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:E?"text":"password",value:N.current,onChange:t=>$e({...N,current:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-14 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"••••••••••••"}),e.jsx("button",{type:"button",onClick:()=>lt(!E),className:"absolute right-5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:E?e.jsx(gt,{size:18}):e.jsx(pt,{size:18})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"New Password"}),e.jsxs("div",{className:"relative group",children:[e.jsx(cs,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:E?"text":"password",value:N.new,onChange:t=>$e({...N,new:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-14 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"At least 8 chars"}),e.jsx("button",{type:"button",onClick:()=>lt(!E),className:"absolute right-5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:E?e.jsx(gt,{size:18}):e.jsx(pt,{size:18})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Confirm New Password"}),e.jsxs("div",{className:"relative group",children:[e.jsx(Ae,{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-300 group-focus-within:text-blue-600 transition-colors",size:18}),e.jsx("input",{type:E?"text":"password",value:N.confirm,onChange:t=>$e({...N,confirm:t.target.value}),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-14 pr-14 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all placeholder:text-gray-300",placeholder:"Confirm new password"}),e.jsx("button",{type:"button",onClick:()=>lt(!E),className:"absolute right-5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",children:E?e.
1jsx(gt,{size:18}):e.jsx(pt,{size:18})})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4",children:e.jsxs("button",{onClick:async()=>{if(j.currentUser){if(!N.current||!N.new||!N.confirm){x.error("Required","Please fill in all password fields");return}if(N.new!==N.confirm){x.error("Mismatch","New passwords do not match");return}if(N.new.length<6){x.error("Weak Password","Password should be at least 6 characters");return}Bt(!0);try{const t=ha.credential(j.currentUser.email,N.current);await ma(j.currentUser,t),await ba(j.currentUser,N.new),x.success("Security Updated","Password has been changed successfully"),$e({current:"",new:"",confirm:""})}catch(t){t.code==="auth/wrong-password"?x.error("Error","Current password you entered is incorrect"):x.error("Security Update Failed",t.message)}finally{Bt(!1)}}},disabled:Gt,className:"px-10 py-4 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black uppercase text-[11px] tracking-widest shadow-xl shadow-blue-100 transition-all flex items-center gap-3 disabled:opacity-50",children:[Gt?e.jsx(A,{size:16,className:"animate-spin"}):e.jsx(ut,{size:16}),"Save New Password"]})})]})]})]})]}),As&&S&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm animate-fade-in",onClick:()=>he(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[40px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100",children:[e.jsxs("div",{className:"p-8 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:L!==null?"Edit Your Answer":"Post an Answer"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:S.courseTitle})]}),e.jsx("button",{onClick:()=>he(!1),className:"p-2 hover:bg-white rounded-xl text-gray-400 hover:text-gray-900 transition-all border border-transparent hover:border-gray-100",children:e.jsx(B,{size:20})})]}),e.jsxs("div",{className:"p-8 space-y-6 max-h-[70vh] overflow-y-auto no-scrollbar",children:[e.jsxs("div",{className:"bg-blue-50/50 p-6 rounded-3xl border border-blue-100/50",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-600 text-white flex items-center justify-center font-black text-xs",children:((Kt=S.userName)==null?void 0:Kt.charAt(0))||"S"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-black text-gray-900",children:S.title||"Question"}),e.jsxs("p",{className:"text-[10px] font-bold text-blue-600 uppercase tracking-widest",children:["Asked by ",S.userName]})]})]}),e.jsxs("p",{className:"text-sm text-gray-600 font-medium italic leading-relaxed",children:['"',S.content,'"']})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Your response"}),e.jsx("textarea",{value:U,onChange:t=>Ee(t.target.value),placeholder:"Write your professional answer here...",className:"w-full h-48 px-6 py-4 bg-gray-50 border border-gray-100 rounded-3xl focus:border-blue-600 focus:ring-4 focus:ring-blue-100 outline-none transition-all font-medium text-sm text-gray-700 resize-none"})]})]}),e.jsxs("div",{className:"p-8 bg-gray-50/30 border-t border-gray-50 flex gap-4",children:[e.jsx("button",{onClick:()=>he(!1),className:"flex-1 py-4 bg-white border border-gray-200 text-gray-500 rounded-2xl font-black text-[11px] uppercase tracking-widest hover:bg-gray-50 transition-all",children:"Cancel"}),e.jsxs("button",{onClick:Xs,disabled:jt||!U.trim(),className:"flex-[2] bg-blue-600 text-white rounded-2xl py-4 font-black uppercase text-[11px] tracking-widest shadow-lg shadow-blue-100 hover:-translate-y-1 transition-all disabled:opacity-50 disabled:translate-y-0 flex items-center justify-center gap-3",children:[jt?e.jsx(A,{size:16,className:"animate-spin"}):e.jsx(Ra,{size:16}),L!==null?"Update Answer":"Send Answer"]})]})]})]}),Ws&&ee&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm animate-fade-in",onClick:()=>we(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-xl rounded-[40px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100",children:[e.jsxs("div",{className:"p-8 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Grade Assignment"}),e.jsxs("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:["Reviewing: ",ee.userName]})]}),e.jsx("button",{onClick:()=>we(!1),className:"p-3 hover:bg-white rounded-2xl transition-all text-gray-400 hover:text-gray-900",children:e.jsx(B,{size:20})})]}),e.jsxs("div",{className:"p-8 space-y-6 max-h-[70vh] overflow-y-auto no-scrollbar",children:[e.jsxs("div",{className:"bg-indigo-50/50 p-6 rounded-3xl border border-indigo-100/50 text-center",children:[e.jsx("p",{className:"text-[10px] font-black text-indigo-600 uppercase tracking-widest mb-1",children:"Student Submission"}),e.jsxs("a",{href:ee.fileUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-3 px-6 py-3 bg-white border border-indigo-100 rounded-2xl text-indigo-600 font-black text-xs uppercase tracking-widest hover:shadow-lg transition-all",children:[e.jsx(rs,{size:16})," Open Solution Link"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Score / Points"}),e.jsx("input",{type:"text",value:at,onChange:t=>Qt(t.target.value),placeholder:"e.g. 95/100",className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-indigo-500/50 transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Clearance Status"}),e.jsxs("select",{value:rt,onChange:t=>Tt(t.target.value),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-indigo-500/50 transition-all cursor-pointer",children:[e.jsx("option",{value:"pending",children:"Keep Pending"}),e.jsx("option",{value:"cleared",children:"Cleared ✅"}),e.jsx("option",{value:"not_cleared",children:"Not Cleared ❌"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Qualitative Feedback"}),e.jsx("textarea",{value:Ue,onChange:t=>Mt(t.target.value),placeholder:"Provide detailed feedback to help the student improve...",className:"w-full h-32 bg-gray-50 border border-gray-100 rounded-3xl p-6 text-sm font-medium outline-none focus:bg-white focus:border-indigo-500/50 transition-all resize-none"})]}),e.jsxs("div",{className:"flex gap-4 pt-2",children:[e.jsx("button",{onClick:()=>we(!1),className:"flex-1 h-14 bg-gray-50 hover:bg-gray-100 text-gray-500 font-black uppercase text-xs tracking-widest rounded-2xl transition-all",children:"Later"}),e.jsxs("button",{onClick:Zs,disabled:Ut||!Ue.trim(),className:"flex-[2] h-14 bg-indigo-600 hover:bg-indigo-700 text-white font-black uppercase text-xs tracking-widest rounded-2xl transition-all shadow-xl shadow-indigo-100 flex items-center justify-center gap-3 disabled:opacity-50",children:[Ut?e.jsx(A,{size:18,className:"animate-spin"}):e.jsx(La,{size:18}),"Submit Grade"]})]})]})]})]}),Fs&&I&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm animate-fade-in",onClick:()=>Z(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-lg rounded-[40px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100",children:[e.jsxs("div",{className:"p-8 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:I.status==="completed"?"Edit Recording":"End Live Session"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:I.title})]}),e.jsx("button",{onClick:()=>Z(!1),className:"p-3 hover:bg-white rounded-2xl transition-all text-gray-400 hover:text-gray-900 shadow-sm",children:e.jsx(B,{size:20})})]}),e.jsxs("div",{className:"p-8 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Recording URL (Optional)"}),e.jsxs("div",{className:"relative group/input",children:[e.jsx("div",{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within/input:text-blue-600 transition-colors",children:e.jsx(Se,{size:20})}
1),e.jsx("input",{type:"url",value:zt,onChange:t=>Fe(t.target.value),placeholder:"Paste Cloud Recording URL (Zoom, Google Drive, etc.)",className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold placeholder:text-gray-400 outline-none focus:bg-white focus:border-blue-500/50 focus:ring-4 focus:ring-blue-500/10 transition-all"})]}),e.jsx("p",{className:"text-[10px] font-bold text-gray-400 italic ml-1",children:"* Students will be able to watch the recording from their session calendar."})]}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsx("button",{onClick:()=>Z(!1),className:"flex-1 h-14 bg-gray-50 hover:bg-gray-100 text-gray-500 font-black uppercase text-xs tracking-[0.2em] rounded-2xl transition-all",children:"Cancel"}),e.jsxs("button",{onClick:ra,disabled:qe,className:"flex-[2] h-14 bg-blue-600 hover:bg-blue-700 text-white font-black uppercase text-xs tracking-[0.2em] rounded-2xl transition-all shadow-xl shadow-blue-500/20 flex items-center justify-center gap-3 disabled:opacity-50",children:[qe?e.jsx(A,{size:18,className:"animate-spin"}):e.jsx(Ae,{size:18}),qe?"Processing...":I.status==="completed"?"Update Recording":"Mark as Completed"]})]})]})]})]}),Ds&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm animate-fade-in",onClick:()=>X(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[40px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100",children:[e.jsxs("div",{className:"p-8 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Schedule Live Session"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:"Setup Your Global Classroom"})]}),e.jsx("button",{onClick:()=>X(!1),className:"p-3 hover:bg-white rounded-2xl transition-all text-gray-400 hover:text-gray-900 shadow-sm",children:e.jsx(B,{size:20})})]}),e.jsxs("form",{onSubmit:la,className:"p-8 space-y-6 max-h-[75vh] overflow-y-auto no-scrollbar",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Select Course"}),e.jsxs("select",{required:!0,value:v.courseId,onChange:t=>$(a=>({...a,courseId:t.target.value})),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all appearance-none cursor-pointer",children:[e.jsx("option",{value:"",children:"Choose a module..."}),g.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Session Title"}),e.jsx("input",{required:!0,type:"text",value:v.title,onChange:t=>$(a=>({...a,title:t.target.value})),placeholder:"e.g. Q&A on Module 3",className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Date"}),e.jsx("input",{required:!0,type:"date",value:v.date,onChange:t=>$(a=>({...a,date:t.target.value})),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Start Time"}),e.jsx("input",{required:!0,type:"time",value:v.time,onChange:t=>$(a=>({...a,time:t.target.value})),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Duration (min)"}),e.jsx("input",{required:!0,type:"number",value:v.duration,onChange:t=>$(a=>({...a,duration:parseInt(t.target.value)})),className:"w-full bg-gray-50 border border-gray-100 rounded-2xl px-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] ml-1",children:"Meeting Link"}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute left-5 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within:text-blue-600 transition-colors",children:e.jsx(Se,{size:18})}),e.jsx("input",{required:!0,type:"url",value:v.meetingLink,onChange:t=>$(a=>({...a,meetingLink:t.target.value})),placeholder:"Zoom / GMeet URL",className:"w-full bg-gray-50 border border-gray-100 rounded-2xl pl-12 pr-6 h-14 text-sm font-bold outline-none focus:bg-white focus:border-blue-500/50 transition-all"})]})]})]}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsx("button",{type:"button",onClick:()=>X(!1),className:"flex-1 h-14 bg-gray-50 hover:bg-gray-100 text-gray-500 font-black uppercase text-xs tracking-[0.2em] rounded-2xl transition-all",children:"Discard"}),e.jsxs("button",{type:"submit",disabled:et,className:"flex-[2] h-14 bg-blue-600 hover:bg-blue-700 text-white font-black uppercase text-xs tracking-[0.2em] rounded-2xl transition-all shadow-xl shadow-blue-500/20 flex items-center justify-center gap-3 disabled:opacity-50",children:[et?e.jsx(A,{size:18,className:"animate-spin"}):e.jsx(ns,{size:18}),et?"Scheduling...":"Publish Session"]})]})]})]})]}),Ls&&J&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm animate-fade-in",onClick:()=>me(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[40px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100",children:[e.jsxs("div",{className:"p-8 border-b border-gray-50 flex items-center justify-between bg-gray-50/30",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Edit Question"}),e.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest mt-1",children:J.courseTitle})]}),e.jsx("button",{onClick:()=>me(!1),className:"p-2 hover:bg-white rounded-xl text-gray-400 hover:text-gray-900 transition-all border border-transparent hover:border-gray-100",children:e.jsx(B,{size:20})})]}),e.jsxs("div",{className:"p-8 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Question Title"}),e.jsx("input",{type:"text",value:be,onChange:t=>Nt(t.target.value),placeholder:"Question Title",className:"w-full px-6 py-4 bg-gray-50 border border-gray-100 rounded-3xl focus:border-blue-600 focus:ring-4 focus:ring-blue-100 outline-none transition-all font-bold text-gray-900"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1",children:"Question Content"}),e.jsx("textarea",{value:fe,onChange:t=>kt(t.target.value),placeholder:"Question Content",className:"w-full h-48 px-6 py-4 bg-gray-50 border border-gray-100 rounded-3xl focus:border-blue-600 focus:ring-4 focus:ring-blue-100 outline-none transition-all font-medium text-sm text-gray-700 resize-none"})]})]}),e.jsxs("div",{className:"p-8 bg-gray-50/30 border-t border-gray-50 flex gap-4",children:[e.jsx("button",{onClick:()=>me(!1),className:"flex-1 py-4 bg-white border border-gray-200 text-gray-500 rounded-2xl font-black text-[11px] uppercase tracking-widest hover:bg-gray-50 transition-all",children:"Cancel"}),e.jsxs("button",{onClick:ta,disabled:St||!be.trim()||!fe.trim(),className:"flex-[2] bg-blue-600 text-white rounded-2xl py-4 font-black uppercase text-[11px] tracking-widest shadow-lg shadow-blue-100 hover:-translate-y-1 transition-all disabled:opacity-50 disabled:translate-y-0 flex items-center justify-center gap-3",children:[St?e.jsx(A,{size:16,className:"animate-spin"}):e.jsx(Ae,{size:16}),"Save Changes"]})]})]})]}),Ts&&ye&&e.jsxs("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-900/60 backdrop-blur-md animate-fade-in",onClick:()=>De(!1)}),e.jsxs("div",{className:"bg-white w-full max-w-4xl rounded-[48px] shadow-2xl relative z-10 overflow-hidden animate-scale-up border border-gray-100 max-h-[85vh] flex flex-col",children:[e.jsxs("div",{className:"p-8 sm:p-12 border-b border-gray-50 flex items-center justify-between bg-white relative",children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-blue-50/50 rounded-full blur-3xl -mr-32 -mt-32 op
1acity-50"}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center shadow-inner",children:e.jsx(ke,{size:24})}),e.jsx("h3",{className:"text-3xl font-black text-gray-900 tracking-tight leading-none uppercase",children:"Attendance Analytics"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("span",{className:"px-4 py-1.5 bg-gray-100 text-gray-500 rounded-xl text-[10px] font-black uppercase tracking-widest border border-gray-200/50",children:["Session: ",ye.title]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 bg-emerald-50 text-emerald-600 rounded-xl text-[10px] font-black",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shadow-sm shadow-emerald-200"}),Ie.filter(t=>t.status==="present").length," Present"]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 bg-rose-50 text-rose-600 rounded-xl text-[10px] font-black",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-rose-500 shadow-sm shadow-rose-200"}),Ie.filter(t=>t.status==="absent").length," Absent"]})]})]}),e.jsx("button",{onClick:()=>De(!1),className:"relative z-10 p-3 bg-gray-50 hover:bg-rose-50 text-gray-400 hover:text-rose-500 rounded-[20px] transition-all border border-transparent hover:border-rose-100 group shadow-sm active:scale-95",children:e.jsx(B,{size:24,className:"group-hover:rotate-90 transition-transform duration-300"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-8 sm:p-12 space-y-6 custom-scrollbar bg-gray-50/20",children:Ie.length===0?e.jsxs("div",{className:"py-20 text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-gray-50 rounded-[30px] flex items-center justify-center mx-auto mb-6 text-gray-200 border border-gray-100 border-dashed",children:e.jsx(se,{size:32})}),e.jsx("p",{className:"font-black text-gray-400 uppercase tracking-widest",children:"No students found enrolled in this course"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Ie.map(t=>{var a;return e.jsxs("div",{className:`group p-5 rounded-[28px] border transition-all flex items-center justify-between ${t.status==="present"?"bg-white border-emerald-100/50 hover:border-emerald-200 hover:shadow-xl hover:shadow-emerald-900/5":"bg-white border-gray-200/50 hover:border-rose-100 hover:bg-rose-50/10"}`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-[18px] flex items-center justify-center font-black text-xs shrink-0 border-2 ${t.status==="present"?"bg-emerald-50 text-emerald-600 border-white":"bg-gray-50 text-gray-400 border-white"}`,children:((a=t.name)==null?void 0:a.charAt(0))||e.jsx(xt,{size:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:`text-sm font-black truncate leading-tight mb-0.5 ${t.status==="present"?"text-gray-900":"text-gray-500"}`,children:t.name}),e.jsx("p",{className:"text-[10px] font-bold text-gray-400 truncate tracking-tight",children:t.email})]})]}),e.jsx("div",{className:"flex flex-col items-end gap-1.5",children:e.jsxs("span",{className:`px-3 py-1 rounded-full text-[8px] font-black uppercase tracking-widest flex items-center gap-1.5 border ${t.status==="present"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-rose-50 text-rose-500 border-rose-100"}`,children:[t.status==="present"?e.jsx(Ae,{size:10}):e.jsx(B,{size:10}),t.status]})})]},t.id)})})}),e.jsxs("div",{className:"p-8 bg-gray-50/50 border-t border-gray-50 flex items-center justify-between",children:[e.jsxs("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest",children:["Report generated at ",new Date().toLocaleTimeString()]}),e.jsx("button",{onClick:()=>De(!1),className:"px-10 py-4 bg-gray-900 hover:bg-blue-600 text-white rounded-2xl font-black uppercase text-[11px] tracking-widest shadow-lg shadow-gray-200 transition-all hover:-translate-y-1 active:translate-y-0",children:"Done"})]})]})]})]})}export{Ua 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.