import{j as e,r as a}from"./index-Cdyla_OY.js";import{E as n}from"./index-mgtoNNih.js";import{E as c}from"./epic-video-CjEf3QZf.js";import{L as d}from"./loading-B4dBNbEu.js";import{N as x}from"./nav-chevrons-VObezJH8.js";import{M as m,E as p}from"./mdx-DgrgY_jR.js";import{P as f}from"./progress-D9hbe2EE.js";import{c as h}from"./misc-DYOOS15_.js";import{u,L as j}from"./components-B-E6uop2.js";import"./index-DQyeCf3G.js";import"./index-B8k-Gd1G.js";import"./tooltip-OJ1rlWP2.js";import"./client-hints-BdCVz-7u.js";import"./clsx-B-dksMZM.js";import"./progress-bar-SDQV9Bld.js";const M=({data:r,matches:s})=>{var o;if(!r)return[{title:"🦉 | Error"}];const t=r.exercise.exerciseNumber.toString().padStart(2,"0"),i=(o=s.find(l=>l.id==="root"))==null?void 0:o.data;return[{title:`🦉 | ${t}. ${r.exercise.title} | ${i==null?void 0:i.workshopTitle}`}]},b={h1:()=>null};function R(){const r=u(),s=r.exercise.exerciseNumber.toString().padStart(2,"0");return e.jsx("div",{className:"flex flex-grow flex-col",children:e.jsxs("main",{className:"grid h-full flex-grow grid-cols-1 grid-rows-2 lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative col-span-1 row-span-1 flex h-full flex-col lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium uppercase leading-none",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(j,{to:`/${s}`,className:"hover:underline",children:`${s}. ${r.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsx("article",{className:"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-10 pt-8 scrollbar-thin scrollbar-thumb-scrollbar",id:r.articleId,children:r.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(m,{code:r.exercise.finishedCode,components:b})})}):"No finished instructions yet..."}),e.jsx(n,{elementQuery:`#${r.articleId}`}),e.jsx(f,{type:"finished",exerciseNumber:r.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[e.jsx("div",{}),r.exerciseFinished?e.jsx(p,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}):null,e.jsx(x,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx(g,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})}function g({exerciseFormEmbedUrl:r,exerciseTitle:s}){const[t,i]=a.useState(!1);return e.jsxs("div",{className:"relative flex-shrink-0",children:[t?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(d,{children:e.jsxs("span",{children:["Loading ",s," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>i(!0),title:"Elaboration",src:r,className:h("absolute inset-0 flex h-full w-full transition-opacity duration-300",t?"opacity-100":"opacity-0")})]})}export{R as default,M as meta};
//# sourceMappingURL=_exerciseNumber_.finished-C6dO6YJ4.js.map
