1/*! For license information please see 9478.5c228b0a.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9478],{7819(e,s,t){t.d(s,{A:()=>l});const l=(0,t(7784).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9478(e,s,t){t.r(s),t.d(s,{MyCourseworkPage:()=>w,default:()=>b});var l=t(5043),a=t(5685),r=t(9970),c=t(4980),i=t(1140),n=t(3390),o=t(8729),d=t(7819),m=t(2024),x=t(2626),h=t(8326),u=t(764),f=t(4965),j=t(9797),p=t(797),N=t(579);const g=e=>{if(!e)return null;if(/^[a-zA-Z0-9_-]+$/.test(e)&&e.length>20)return e;const s=[/\/folders\/([a-zA-Z0-9_-]+)/,/id=([a-zA-Z0-9_-]+)/,/\/d\/([a-zA-Z0-9_-]+)/,/^([a-zA-Z0-9_-]{25,})/];for(const t of s){const s=e.match(t);if(s)return s[1]}return e},v=e=>{if(!e)return null;const s=g(e);return"https://drive.google.com/embeddedfolderview?id=".concat(s,"#list")},w=()=>{var e;(0,a.Zp)();const{user:s}=(0,o.As)(),[t,w]=(0,l.useState)([]),[b,y]=(0,l.useState)({}),[A,k]=(0,l.useState)({}),[_,C]=(0,l.useState)(!0),[D,Z]=(0,l.useState)(null);(0,l.useEffect)(()=>{(async()=>{try{C(!0);const e=await c.yl.getMyEnrollments(),s=e.data.filter(e=>e.personal_drive_folder);w(e.data),1===s.length&&Z(s[0]);const t=await c.BP.getAll(),l=await c.d1.getAll(),a={};t.data.forEach(e=>{a[e.course_id]=e}),y(a);const r={};l.data.forEach(e=>{r[e.cohort_id]=e}),k(r)}catch(e){console.error("Failed to fetch data:",e)}finally{C(!1)}})()},[]);const E=t.filter(e=>e.personal_drive_folder);return _?(0,N.jsx)(r.NI,{children:(0,N.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,N.jsx)(m.A,{className:"w-8 h-8 animate-spin text-[#41EAD4]"})})}):(0,N.jsx)(r.NI,{children:(0,N.jsxs)("div",{className:"space-y-6",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("h1",{className:"text-2xl font-bold text-slate-800",children:"My Coursework"}),(0,N.jsx)("p",{className:"text-slate-500",children:"Upload and manage your assignment submissions"})]}),0===E.length?(0,N.jsx)(i.Zp,{children:(0,N.jsxs)(i.Wu,{className:"flex flex-col items-center justify-center py-16",children:[(0,N.jsx)(f.A,{className:"w-16 h-16 text-slate-300 mb-4"}),(0,N.jsx)("h3",{className:"text-lg font-medium text-slate-700 mb-2",children:"No Coursew
2ork Folder Assigned"}),(0,N.jsx)("p",{className:"text-slate-500 text-center max-w-md",children:"Your instructor hasn't set up a personal coursework folder yet. Please contact your course administrator."})]})}):(0,N.jsxs)("div",{className:"grid lg:grid-cols-4 gap-6",children:[(0,N.jsxs)("div",{className:"lg:col-span-1 space-y-3",children:[(0,N.jsx)("h2",{className:"text-sm font-semibold text-slate-600 uppercase tracking-wider mb-4",children:"Your Courses"}),E.map(e=>{const s=b[e.course_id],t=A[e.cohort_id],l=(null===D||void 0===D?void 0:D.enrollment_id)===e.enrollment_id;return(0,N.jsx)(i.Zp,{className:"cursor-pointer transition-all ".concat(l?"border-[#41EAD4] bg-[#41EAD4]/5 shadow-md":"border-slate-200 hover:border-slate-300 hover:shadow-sm"),onClick:()=>Z(e),children:(0,N.jsx)(i.Wu,{className:"p-4",children:(0,N.jsxs)("div",{className:"flex items-start gap-3",children:[(0,N.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center ".concat(l?"bg-[#41EAD4]":"bg-slate-100"),children:(0,N.jsx)(j.A,{className:"w-5 h-5 ".concat(l?"text-[#0D1B2A]":"text-slate-500")})}),(0,N.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,N.jsx)("h3",{className:"font-medium truncate ".concat(l?"text-[#0D1B2A]":"text-slate-700"),children:(null===s||void 0===s?void 0:s.title)||"Course"}),(0,N.jsx)("p",{className:"text-xs text-slate-500 truncate",children:(null===t||void 0===t?void 0:t.name)||"Cohort"})]}),l&&(0,N.jsx)(h.A,{className:"w-5 h-5 text-[#41EAD4] flex-shrink-0"})]})})},e.enrollment_id)})]}),(0,N.jsxs)("div",{className:"lg:col-span-3",children:[D?(0,N.jsxs)(i.Zp,{className:"overflow-hidden",children:[(0,N.jsx)(i.aR,{className:"bg-gradient-to-r from-[#0D1B2A] to-[#1B3A4B] text-white",children:(0,N.jsxs)("div",{className:"flex items-center justify-between",children:[(0,N.jsxs)("div",{className:"flex items-center gap-3",children:[(0,N.jsx)("div",{className:"p-2 bg-white/10 rounded-lg",children:(0,N.jsx)(p.A,{className:"w-5 h-5"})}),(0,N.jsxs)("div",{children:[(0,N.jsx)(i.ZB,{className:"text-white",children:(null===(e=b[D.course_id])||void 0===e?void 0:e.title)||"Coursew
2ork"}),(0,N.jsx)(i.BT,{className:"text-slate-300",children:"Upload your assignments and coursework here"})]})]}),(0,N.jsxs)(n.$,{variant:"secondary",size:"sm",onClick:()=>window.open((e=>{if(!e)return null;const s=g(e);return"https://drive.google.com/drive/folders/".concat(s)})(D.personal_drive_folder),"_blank"),className:"gap-2",children:[(0,N.jsx)(u.A,{className:"w-4 h-4"}),"Open in Drive"]})]})}),(0,N.jsx)(i.Wu,{className:"p-0",children:(0,N.jsxs)("div",{className:"relative bg-slate-50",children:[(0,N.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-50 z-0",children:(0,N.jsxs)("div",{className:"text-center",children:[(0,N.jsx)(m.A,{className:"w-8 h-8 animate-spin text-[#41EAD4] mx-auto mb-2"}),(0,N.jsx)("p",{className:"text-sm text-slate-500",children:"Loading your folder..."})]})}),(0,N.jsx)("iframe",{src:v(D.personal_drive_folder),title:"My Coursework Folder",className:"w-full h-[550px] border-0 relative z-10",style:{minHeight:"550px"},sandbox:"allow-same-origin allow-scripts allow-popups allow-forms"})]})})]}):(0,N.jsx)(i.Zp,{children:(0,N.jsxs)(i.Wu,{className:"flex flex-col items-center justify-center py-16",children:[(0,N.jsx)(x.A,{className:"w-12 h-12 text-slate-300 mb-4"}),(0,N.jsx)("h3",{className:"text-lg font-medium text-slate-700 mb-2",children:"Select a Course"}),(0,N.jsx)("p",{className:"text-slate-500 text-center",children:"Choose a course from the left to view your coursework folder"})]})}),D&&(0,N.jsx)(i.Zp,{className:"mt-4 bg-amber-50 border-amber-100",children:(0,N.jsx)(i.Wu,{className:"py-4",children:(0,N.jsxs)("div",{className:"flex items-start gap-3",children:[(0,N.jsx)("div",{className:"p-2 bg-amber-100 rounded-lg",children:(0,N.jsx)(d.A,{className:"w-4 h-4 text-amber-600"})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("p",{className:"text-sm font-medium text-amber-800",children:"How to Upload"}),(0,N.jsxs)("p",{className:"text-sm text-amber-700 mt-1",children:["To upload files, click ",(0,N.jsx)("strong",{children:'"Open in Drive"'}),' button above. In Google Drive, right-click and select "File upload" or drag and drop your files. Your instructor will be able to see all uploaded files.']})]})]})})})]})]})]})})},b=w}}]); 3//# sourceMappingURL=9478.5c228b0a.chunk.js.map
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.