import{w as n,L as l}from"./chunk-JZWAC4HX-0uKZ9a0b.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-BStOTXfq.js";import{r as m}from"./index-Bi6L2ga8.js";import{E as a}from"./epic-video-CBD2QuF7.js";import{I as x,c as d}from"./misc-w_rthUBN.js";import{L as f}from"./loading-DI7gaEz8.js";import{N as p}from"./nav-chevrons-BpUTiCfb.js";import{R as h}from"./retrieval-practice-I8WO2_2I.js";import{u}from"./revalidation-ws-Bfvn_PkK.js";import{E as b}from"./launch-editor-CPRN8qq5.js";import{P as j}from"./progress-C06Xc75T.js";import{u as g}from"./index-BCfhIjlz.js";import{M as N}from"./mdx-C-RSHS6z.js";import{u as v}from"./online-CIe0rJXF.js";import{g as w}from"./root-loader-DlSJfUY6.js";import{g as E}from"./seo-t5J-DRxw.js";import"./use-event-source-lSuOQRXY.js";import"./index-E_6kulJP.js";import"./index-B2VNpNxJ.js";import"./schemas-siASSt6b.js";import"./tooltip-DXU4r0k_.js";import"./format-CZ5n8p10.js";import"./user-DVcB6tJK.js";import"./workshop-config-BDoPVTl_.js";import"./progress-bar-DTHojpoN.js";import"./pe-tear8uic.js";import"./preload-helper-BXl3LOEh.js";const re=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=w(r);return!s||!o?[{title:"🦉 | Error"}]:E({title:`🦉 | ${i}. ${s.exercise.title} | ${o?.workshopTitle}`,description:`Elaboration for ${i}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(i)}`,instructor:o.instructor,requestInfo:o.requestInfo})},y={h1:()=>null},se=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return u({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{className:"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(l,{to:`/${i}`,className:"hover:underline",children:`${i}. ${r.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsxs("article",{className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",id:r.articleId,children:[r.exercise.finishedCode?e.jsx(a,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(N,{code:r.exercise.finishedCode,components:y})})}):"No finished instructions yet...",e.jsx(h,{exerciseNumber:r.exercise.exerciseNumber})]}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:r.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{}),e.jsx(b,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx($,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function $({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=g(),[o,t]=m.useState(!1);return v()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:shrink-0",children:[o?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(f,{children:e.jsxs("span",{children:["Loading ",r," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>t(!0),onError:()=>t(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",o?"opacity-100":"opacity-0"),style:{colorScheme:i}})]}):e.jsx("div",{className:"relative shrink-0",children:e.jsx("div",{className:"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${r} feedback form`})," when offline"]})})})})}export{se as default,re as meta};
//# sourceMappingURL=_exerciseNumber_.finished-aQf3Q2Fi.js.map
