exports.id=96415,exports.ids=[96415],exports.modules={32316:(a,b,c)=>{Promise.resolve().then(c.bind(c,87388))},42044:(a,b,c)=>{Promise.resolve().then(c.bind(c,44686))},44686:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>p});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(89531),j=c(38999);c(91115);var k=c(99355),l=c(65710),m=c(10693);function n(){return(0,d.jsxs)("div",{className:"h-screen flex flex-col bg-gray-50",children:[(0,d.jsxs)("div",{className:"h-14 flex-shrink-0 bg-gray-900 flex items-center gap-3 px-4 lg:px-6",children:[(0,d.jsx)("div",{className:"h-9 w-9 rounded-md bg-white/10 animate-pulse"}),(0,d.jsx)("div",{className:"h-6 w-px bg-white/20 hidden sm:block"}),(0,d.jsx)("div",{className:"h-5 w-48 bg-white/10 rounded animate-pulse"}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:"h-8 w-24 bg-white/10 rounded animate-pulse hidden sm:block"})]}),(0,d.jsxs)("div",{className:"flex-1 flex min-h-0",children:[(0,d.jsx)("main",{className:"flex-1 min-w-0 p-4 lg:p-6",children:(0,d.jsxs)("div",{className:"max-w-4xl mx-auto space-y-4",children:[(0,d.jsx)("div",{className:"aspect-video w-full max-w-3xl mx-auto bg-gray-200 rounded-lg animate-pulse"}),(0,d.jsx)("div",{className:"h-6 w-2/3 bg-gray-200 rounded animate-pulse"}),(0,d.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded animate-pulse"}),(0,d.jsx)("div",{className:"h-4 w-5/6 bg-gray-200 rounded animate-pulse"})]})}),(0,d.jsx)("aside",{className:"hidden lg:flex w-96 flex-shrink-0 border-l border-gray-200 bg-white p-4 flex-col gap-4",children:[1,2,3,4,5].map(a=>(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("div",{className:"h-4 w-3/4 bg-gray-200 rounded animate-pulse"}),(0,d.jsx)("div",{className:"space-y-1 pl-2",children:[1,2,3].map(a=>(0,d.jsx)("div",{className:"h-3 w-full bg-gray-100 rounded animate-pulse"},a))})]},a))})]})]})}function o({children:a,params:b}){let{course:c,chapters:f,lessons:g,completedLessonIds:m,progressPercent:n}=(0,k.w)(),{sidebarOpen:o,toggleSidebar:p,closeSidebar:q,closeSidebarIfMobile:r}=(0,l.m)(),s=b.lessonId,t=(0,e.useMemo)(()=>{let a=g.filter(a=>a&&"string"==typeof a.title&&a.title.trim().length>0);if(!f.length||!a.length)return a.slice().sort((a,b)=>a.order-b.order);let b=[];for(let c of f){let d=a.filter(a=>a.chapterId===c.id).sort((a,b)=>a.order-b.order);b.push(...d)}return[...b,...a.filter(a=>!f.some(b=>b.id===a.chapterId)).sort((a,b)=>a.order-b.order)]},[f,g]);return c?(0,d.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-gray-50",children:[(0,d.jsxs)("header",{className:"h-14 flex-shrink-0 bg-gray-900 text-white flex items-center justify-between px-4 lg:px-6 z-30 shadow-lg",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,d.jsx)(h(),{href:`/courses/${c.id}`,className:"p-2 hover:bg-white/10 rounded transition-colors flex-shrink-0",children:(0,d.jsx)(i.UZh,{className:"w-5 h-5"})}),(0,d.jsx)("div",{className:"h-6 w-px bg-white/20 hidden sm:block"}),(0,d.jsx)("h1",{className:"text-base font-bold truncate max-w-[180px] sm:max-w-sm",children:c.title})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsxs)("div",{className:"hidden sm:flex flex-col items-end",children:[(0,d.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-gray-400",children:"Progress"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"w-24 h-1.5 bg-white/20 rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-emerald-400 transition-all duration-300",style:{width:`${n}%`}})}),(0,d.jsxs)("span",{className:"text-xs font-bold",children:[n,"%"]})]})]}),(0,d.jsx)("button",{type:"button",onClick:p,className:"p-2 hover:bg-white/10 rounded transition-colors lg:hidden","aria-label":o?"Close playlist":"Open playlist",children:o?(0,d.jsx)(i.U_s,{className:"w-5 h-5"}):(0,d.jsx)(i.TF4,{className:"w-5 h-5"})})]})]}),(0,d.jsxs)("div",{className:"flex-1 flex min-h-0 relative",children:[(0,d.jsx)("main",{className:"flex-1 min-w-0 overflow-y-auto bg-gray-50 p-4 lg:p-6",children:(0,d.jsx)("div",{className:"max-w-4xl mx-auto",children:a})}),o&&(0,d.jsx)("button",{type:"button",className:"fixed inset-0 top-14 z-30 bg-black/40 lg:hidden","aria-label":"Close playlist",onClick:q}),(0,d.jsxs)("aside",{className:`
            flex flex-col bg-white border-l border-gray-200 shadow-xl
            fixed top-14 bottom-0 right-0 z-40 w-full max-w-sm
            transition-transform duration-200 ease-out
            ${o?"translate-x-0":"translate-x-full"}
            lg:relative lg:top-auto lg:bottom-auto lg:right-auto lg:z-20 lg:w-96 lg:max-w-none lg:flex-shrink-0 lg:translate-x-0 lg:shadow-none
          `,children:[(0,d.jsxs)("div",{className:"p-4 border-b border-gray-100 flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider lg:hidden truncate",children:c.title}),(0,d.jsx)("h2",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider hidden lg:block",children:"Course content"}),(0,d.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[t.length," lessons \xb7"," ",t.filter(a=>m.has(a.id)).length," completed",(0,d.jsxs)("span",{className:"lg:hidden",children:[" \xb7 ",n,"%"]})]})]}),(0,d.jsx)("button",{type:"button",onClick:q,className:"p-2 hover:bg-gray-100 rounded transition-colors lg:hidden shrink-0","aria-label":"Close playlist",children:(0,d.jsx)(i.U_s,{className:"w-5 h-5 text-gray-700"})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsx)("ul",{className:"divide-y divide-gray-100 pb-24",children:t.map((a,b)=>{let e=s===a.id,f=m.has(a.id);return(0,d.jsx)("li",{children:(0,d.jsxs)(h(),{href:`/courses/${c.id}/learn/${a.id}`,onClick:r,className:`
                        flex items-center gap-3 px-4 py-3 text-left transition-colors
                        ${e?"bg-[var(--primary-50)] text-[var(--primary-700)]":"hover:bg-gray-50 text-gray-700"}
                      `,children:[(0,d.jsx)("span",{className:"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold bg-gray-200 text-gray-600",children:b+1}),(0,d.jsx)("span",{className:"flex-shrink-0 text-gray-400",children:(0,d.jsx)(j.U,{lesson:a,variant:"marketing",size:"sm"})}),(0,d.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:a.title}),null!=a.videoDuration&&a.videoDuration>0&&(0,d.jsxs)("span",{className:"flex-shrink-0 text-xs text-gray-400",children:[Math.floor(a.videoDuration/60),"m"]}),f&&(0,d.jsx)(i.OLr,{className:"flex-shrink-0 w-5 h-5 text-emerald-500"})]})},a.id)})})})]})]})]}):null}function p({children:a,params:b}){let c=(0,e.use)(b),g=(0,f.useRouter)(),h=(0,f.usePathname)(),i=c.id,j=c.lessonId,l=(0,e.useCallback)(()=>{g.push(`/login?redirect=${encodeURIComponent(h||"")}`)},[h,g]),{authLoading:p,loading:q,loadError:r,course:s,contextValue:t,setRetryCount:u}=(0,m.K)({courseId:i,lessonId:j,learnBasePath:`/courses/${i}/learn`,onUnauthenticated:l});return p||q?(0,d.jsx)(n,{}):r&&!s?(0,d.jsx)("div",{className:"h-screen flex items-center justify-center bg-gray-50 px-4",children:(0,d.jsxs)("div",{className:"w-full max-w-lg rounded-xl border border-gray-200 bg-white p-6 text-center shadow-sm",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Unable to open this course"}),(0,d.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:r}),(0,d.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-3",children:[(0,d.jsx)("button",{type:"button",onClick:()=>u(a=>a+1),className:"inline-flex items-center rounded-md bg-[var(--primary-700)] px-4 py-2 text-sm font-medium text-white hover:bg-[var(--primary-800)] transition-colors",children:"Retry"}),(0,d.jsx)("button",{type:"button",onClick:()=>g.push(`/courses/${i}`),className:"inline-flex items-center rounded-md border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",children:"Back to course"})]})]})}):s?(0,d.jsx)(k.A,{value:t,children:(0,d.jsx)(o,{params:c,children:a})}):null}},87388:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/reeyabasnet/dplms/launchPadLms-frontend/app/courses/[id]/learn/layout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/reeyabasnet/dplms/launchPadLms-frontend/app/courses/[id]/learn/layout.tsx","default")}};