@epic-web/workshop-app 5.8.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/build/client/assets/{_-Dn1a0zwA.js → _-BbjJ9R-5.js} +2 -2
  2. package/build/client/assets/{_-Dn1a0zwA.js.map → _-BbjJ9R-5.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber-BVCFK83o.js → _exerciseNumber-BdRxxVY9.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber-BVCFK83o.js.map → _exerciseNumber-BdRxxVY9.js.map} +1 -1
  5. package/build/client/assets/{_exerciseNumber_._stepNumber-CAxJdIJe.js → _exerciseNumber_._stepNumber-CZKDy98j.js} +2 -2
  6. package/build/client/assets/{_exerciseNumber_._stepNumber-CAxJdIJe.js.map → _exerciseNumber_._stepNumber-CZKDy98j.js.map} +1 -1
  7. package/build/client/assets/{_exerciseNumber_.finished-DYebDhaK.js → _exerciseNumber_.finished-zD7Rb_Qp.js} +2 -2
  8. package/build/client/assets/{_exerciseNumber_.finished-DYebDhaK.js.map → _exerciseNumber_.finished-zD7Rb_Qp.js.map} +1 -1
  9. package/build/client/assets/{_layout-cu1Of_4G.js → _layout-BN0qitsj.js} +2 -2
  10. package/build/client/assets/{_layout-cu1Of_4G.js.map → _layout-BN0qitsj.js.map} +1 -1
  11. package/build/client/assets/{_layout-CyDc9BN3.js → _layout-DMejPY7I.js} +3 -3
  12. package/build/client/assets/_layout-DMejPY7I.js.map +1 -0
  13. package/build/client/assets/{accordion-e-d1HozW.js → accordion-BL_cX9y6.js} +2 -2
  14. package/build/client/assets/{accordion-e-d1HozW.js.map → accordion-BL_cX9y6.js.map} +1 -1
  15. package/build/client/assets/{account-HU5gUm5Q.js → account-C4MWGVQU.js} +2 -2
  16. package/build/client/assets/{account-HU5gUm5Q.js.map → account-C4MWGVQU.js.map} +1 -1
  17. package/build/client/assets/app-srTG3_Hm.js +2 -0
  18. package/build/client/assets/{app-CWEUg7hY.js.map → app-srTG3_Hm.js.map} +1 -1
  19. package/build/client/assets/{button-Hft_V1bH.js → button-DhtjxLl5.js} +2 -2
  20. package/build/client/assets/{button-Hft_V1bH.js.map → button-DhtjxLl5.js.map} +1 -1
  21. package/build/client/assets/{diff-B_FrL8Cl.js → diff-CMHaCmku.js} +2 -2
  22. package/build/client/assets/{diff-B_FrL8Cl.js.map → diff-CMHaCmku.js.map} +1 -1
  23. package/build/client/assets/diff-CcVqQ39D.js +2 -0
  24. package/build/client/assets/{diff-DmVm_N6W.js.map → diff-CcVqQ39D.js.map} +1 -1
  25. package/build/client/assets/{discord-C0ZkL9cR.js → discord-DsGCI_e6.js} +2 -2
  26. package/build/client/assets/{discord-C0ZkL9cR.js.map → discord-DsGCI_e6.js.map} +1 -1
  27. package/build/client/assets/discord-tUa_uzeh.js +2 -0
  28. package/build/client/assets/discord-tUa_uzeh.js.map +1 -0
  29. package/build/client/assets/{epic-video-75U1kyqf.js → epic-video-DbfbYOk7.js} +3 -3
  30. package/build/client/assets/{epic-video-75U1kyqf.js.map → epic-video-DbfbYOk7.js.map} +1 -1
  31. package/build/client/assets/{error-boundary-IvG0vuiP.js → error-boundary-DBVB3BBH.js} +2 -2
  32. package/build/client/assets/{error-boundary-IvG0vuiP.js.map → error-boundary-DBVB3BBH.js.map} +1 -1
  33. package/build/client/assets/{finished-DDnBGcs8.js → finished-EOAd0vS7.js} +2 -2
  34. package/build/client/assets/{finished-DDnBGcs8.js.map → finished-EOAd0vS7.js.map} +1 -1
  35. package/build/client/assets/{icons-BtWYk6Ws.svg → icons-BM6r7NHK.svg} +9 -0
  36. package/build/client/assets/{index-BzN2y10J.js → index-BH_SsYHe.js} +2 -2
  37. package/build/client/assets/{index-BzN2y10J.js.map → index-BH_SsYHe.js.map} +1 -1
  38. package/build/client/assets/{index-9OWT3nC-.js → index-Ba7zHVvt.js} +2 -2
  39. package/build/client/assets/{index-9OWT3nC-.js.map → index-Ba7zHVvt.js.map} +1 -1
  40. package/build/client/assets/index-BoOt6peO.js +2 -0
  41. package/build/client/assets/index-BoOt6peO.js.map +1 -0
  42. package/build/client/assets/{index-CQEwwWTS.js → index-Bqxmi8_-.js} +2 -2
  43. package/build/client/assets/{index-CQEwwWTS.js.map → index-Bqxmi8_-.js.map} +1 -1
  44. package/build/client/assets/{index-c1IJ5ZX5.js → index-CWadM2q_.js} +2 -2
  45. package/build/client/assets/{index-c1IJ5ZX5.js.map → index-CWadM2q_.js.map} +1 -1
  46. package/build/client/assets/{index-t6AA12_S.js → index-D7-ne3iG.js} +2 -2
  47. package/build/client/assets/{index-t6AA12_S.js.map → index-D7-ne3iG.js.map} +1 -1
  48. package/build/client/assets/{loading-DsHhjqzj.js → loading-ZSC9wgHC.js} +2 -2
  49. package/build/client/assets/{loading-DsHhjqzj.js.map → loading-ZSC9wgHC.js.map} +1 -1
  50. package/build/client/assets/{login-DJlKIofe.js → login-CJfcLXAB.js} +2 -2
  51. package/build/client/assets/{login-DJlKIofe.js.map → login-CJfcLXAB.js.map} +1 -1
  52. package/build/client/assets/{manifest-3da21166.js → manifest-710bbc0c.js} +1 -1
  53. package/build/client/assets/{mdx-CsRMuEw9.js → mdx-Nz3dsEsr.js} +2 -2
  54. package/build/client/assets/{mdx-CsRMuEw9.js.map → mdx-Nz3dsEsr.js.map} +1 -1
  55. package/build/client/assets/{misc-DoGPlBur.js → misc-D9k1wGip.js} +2 -2
  56. package/build/client/assets/{misc-DoGPlBur.js.map → misc-D9k1wGip.js.map} +1 -1
  57. package/build/client/assets/{nav-chevrons-CxWSSbTo.js → nav-chevrons-CM-frhig.js} +2 -2
  58. package/build/client/assets/{nav-chevrons-CxWSSbTo.js.map → nav-chevrons-CM-frhig.js.map} +1 -1
  59. package/build/client/assets/{onboarding-DssP5iXB.js → onboarding-DhIDoTnn.js} +2 -2
  60. package/build/client/assets/{onboarding-DssP5iXB.js.map → onboarding-DhIDoTnn.js.map} +1 -1
  61. package/build/client/assets/online-CN5sXlwN.js +2 -0
  62. package/build/client/assets/online-CN5sXlwN.js.map +1 -0
  63. package/build/client/assets/{preferences-BIt5-Lgy.js → preferences-DhTuJwew.js} +2 -2
  64. package/build/client/assets/{preferences-BIt5-Lgy.js.map → preferences-DhTuJwew.js.map} +1 -1
  65. package/build/client/assets/{presence-BsqTpSt4.js → presence-DcXyg7el.js} +2 -2
  66. package/build/client/assets/{presence-BsqTpSt4.js.map → presence-DcXyg7el.js.map} +1 -1
  67. package/build/client/assets/{preview-CZwnFQrx.js → preview-BhbdVgz0.js} +2 -2
  68. package/build/client/assets/{preview-CZwnFQrx.js.map → preview-BhbdVgz0.js.map} +1 -1
  69. package/build/client/assets/{product-CVL4Z9c0.js → product-DD8nUALO.js} +2 -2
  70. package/build/client/assets/{product-CVL4Z9c0.js.map → product-DD8nUALO.js.map} +1 -1
  71. package/build/client/assets/{progress-Dj5cyA_v.js → progress-CpALgZbi.js} +2 -2
  72. package/build/client/assets/{progress-Dj5cyA_v.js.map → progress-CpALgZbi.js.map} +1 -1
  73. package/build/client/assets/{progress-bar-Dln7epYZ.js → progress-bar-IswLOt8e.js} +2 -2
  74. package/build/client/assets/{progress-bar-Dln7epYZ.js.map → progress-bar-IswLOt8e.js.map} +1 -1
  75. package/build/client/assets/{revalidation-ws-Bes2l3ma.js → revalidation-ws-BIizeOeQ.js} +2 -2
  76. package/build/client/assets/{revalidation-ws-Bes2l3ma.js.map → revalidation-ws-BIizeOeQ.js.map} +1 -1
  77. package/build/client/assets/{root-Bb8fIt2z.js → root-B3Ez4TJh.js} +2 -2
  78. package/build/client/assets/{root-Bb8fIt2z.js.map → root-B3Ez4TJh.js.map} +1 -1
  79. package/build/client/assets/{set-playground-DOFTHWzE.js → set-playground-BoPKA2de.js} +2 -2
  80. package/build/client/assets/{set-playground-DOFTHWzE.js.map → set-playground-BoPKA2de.js.map} +1 -1
  81. package/build/client/assets/test-B1MpH-AU.js +2 -0
  82. package/build/client/assets/{test-BwM0E8Mk.js.map → test-B1MpH-AU.js.map} +1 -1
  83. package/build/client/assets/{tests-CDgBzBBo.js → tests-oMtvdjmo.js} +2 -2
  84. package/build/client/assets/{tests-CDgBzBBo.js.map → tests-oMtvdjmo.js.map} +1 -1
  85. package/build/client/assets/{tooltip-DT9kZxPw.js → tooltip-CzrLrLJU.js} +2 -2
  86. package/build/client/assets/{tooltip-DT9kZxPw.js.map → tooltip-CzrLrLJU.js.map} +1 -1
  87. package/build/server/index.js +25 -9
  88. package/build/server/index.js.map +1 -1
  89. package/package.json +3 -3
  90. package/build/client/assets/_layout-CyDc9BN3.js.map +0 -1
  91. package/build/client/assets/app-CWEUg7hY.js +0 -2
  92. package/build/client/assets/diff-DmVm_N6W.js +0 -2
  93. package/build/client/assets/discord-D6ZwxiZG.js +0 -2
  94. package/build/client/assets/discord-D6ZwxiZG.js.map +0 -1
  95. package/build/client/assets/index-DJhl_Q5J.js +0 -2
  96. package/build/client/assets/index-DJhl_Q5J.js.map +0 -1
  97. package/build/client/assets/online-D33oijLr.js +0 -2
  98. package/build/client/assets/online-D33oijLr.js.map +0 -1
  99. package/build/client/assets/test-BwM0E8Mk.js +0 -2
@@ -1,2 +1,2 @@
1
- import{j as e,u as a}from"./index-CGzylDPY.js";import{G as s}from"./error-boundary-IvG0vuiP.js";import{I as o}from"./misc-DoGPlBur.js";import{L as n}from"./components-DrvY4pal.js";function m(){return e.jsx(t,{})}function t(){const r=a();return e.jsx(s,{statusHandlers:{404:()=>e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{children:"We can't find this page:"}),e.jsx("pre",{className:"whitespace-pre-wrap break-all text-body-lg",children:r.pathname})]}),e.jsx(n,{to:"/",className:"text-body-md underline",children:e.jsx(o,{name:"ArrowLeft",children:"Back to home"})})]})}})}export{t as ErrorBoundary,m as default};
2
- //# sourceMappingURL=_-Dn1a0zwA.js.map
1
+ import{j as e,u as a}from"./index-CGzylDPY.js";import{G as s}from"./error-boundary-DBVB3BBH.js";import{I as o}from"./misc-D9k1wGip.js";import{L as n}from"./components-DrvY4pal.js";function m(){return e.jsx(t,{})}function t(){const r=a();return e.jsx(s,{statusHandlers:{404:()=>e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{children:"We can't find this page:"}),e.jsx("pre",{className:"whitespace-pre-wrap break-all text-body-lg",children:r.pathname})]}),e.jsx(n,{to:"/",className:"text-body-md underline",children:e.jsx(o,{name:"ArrowLeft",children:"Back to home"})})]})}})}export{t as ErrorBoundary,m as default};
2
+ //# sourceMappingURL=_-BbjJ9R-5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_-Dn1a0zwA.js","sources":["../../../app/routes/$.tsx"],"sourcesContent":["// This is called a \"splat route\" and as it's in the root `/app/routes/`\n// directory, it's a catchall. If no other routes match, this one will and we\n// can know that the user is hitting a URL that doesn't exist. By throwing a\n// 404 from the loader, we can force the error boundary to render which will\n// ensure the user gets the right status code and we can display a nicer error\n// message for them than the Remix and/or browser default.\n\nimport { type LoaderFunctionArgs } from '@remix-run/node'\nimport { Link, useLocation } from '@remix-run/react'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { Icon } from '#app/components/icons.tsx'\n\nexport async function loader({ params }: LoaderFunctionArgs) {\n\tconst splat = params['*']\n\tconst segments = splat?.split('/') ?? []\n\tif (segments.length > 0 && !isNaN(Number(segments[0]))) {\n\t\tconst newPath = `/exercise/${splat}`\n\t\treturn new Response(null, {\n\t\t\tstatus: 302,\n\t\t\theaders: {\n\t\t\t\tLocation: newPath,\n\t\t\t},\n\t\t})\n\t}\n\n\tthrow new Response('Not found', { status: 404 })\n}\n\nexport default function NotFound() {\n\t// due to the loader, this component will never be rendered, but we'll return\n\t// the error boundary just in case.\n\treturn <ErrorBoundary />\n}\n\nexport function ErrorBoundary() {\n\tconst location = useLocation()\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tstatusHandlers={{\n\t\t\t\t404: () => (\n\t\t\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t\t\t\t<h1>We can't find this page:</h1>\n\t\t\t\t\t\t\t<pre className=\"whitespace-pre-wrap break-all text-body-lg\">\n\t\t\t\t\t\t\t\t{location.pathname}\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Link to=\"/\" className=\"text-body-md underline\">\n\t\t\t\t\t\t\t<Icon name=\"ArrowLeft\">Back to home</Icon>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</div>\n\t\t\t\t),\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["NotFound","ErrorBoundary","location","useLocation","jsx","GeneralErrorBoundary","statusHandlers","jsxs","className","children","pathname","Link","to","Icon","name"],"mappings":"oLA4BA,SAAwBA,GAAW,CAGlC,aAAQC,EAAc,CAAA,CAAA,CACvB,CAEO,SAASA,GAAgB,CAC/B,MAAMC,EAAWC,IAEhB,OAAAC,EAAAA,IAACC,EAAA,CACAC,eAAgB,CACf,IAAK,IACHC,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAACF,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAAAL,EAAA,IAAC,MAAGK,SAAwB,0BAAA,CAAA,EAC3BL,EAAA,IAAA,MAAA,CAAII,UAAU,6CACbC,WAASC,QACX,CAAA,CAAA,CACD,CAAA,EACAN,EAAA,IAACO,EAAK,CAAAC,GAAG,IAAIJ,UAAU,yBACtBC,SAAAL,EAAA,IAACS,EAAK,CAAAC,KAAK,YAAYL,SAAA,eAAY,CACpC,CAAA,CAAA,EACD,CAEF,CAAA,CACD,CAEF"}
1
+ {"version":3,"file":"_-BbjJ9R-5.js","sources":["../../../app/routes/$.tsx"],"sourcesContent":["// This is called a \"splat route\" and as it's in the root `/app/routes/`\n// directory, it's a catchall. If no other routes match, this one will and we\n// can know that the user is hitting a URL that doesn't exist. By throwing a\n// 404 from the loader, we can force the error boundary to render which will\n// ensure the user gets the right status code and we can display a nicer error\n// message for them than the Remix and/or browser default.\n\nimport { type LoaderFunctionArgs } from '@remix-run/node'\nimport { Link, useLocation } from '@remix-run/react'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { Icon } from '#app/components/icons.tsx'\n\nexport async function loader({ params }: LoaderFunctionArgs) {\n\tconst splat = params['*']\n\tconst segments = splat?.split('/') ?? []\n\tif (segments.length > 0 && !isNaN(Number(segments[0]))) {\n\t\tconst newPath = `/exercise/${splat}`\n\t\treturn new Response(null, {\n\t\t\tstatus: 302,\n\t\t\theaders: {\n\t\t\t\tLocation: newPath,\n\t\t\t},\n\t\t})\n\t}\n\n\tthrow new Response('Not found', { status: 404 })\n}\n\nexport default function NotFound() {\n\t// due to the loader, this component will never be rendered, but we'll return\n\t// the error boundary just in case.\n\treturn <ErrorBoundary />\n}\n\nexport function ErrorBoundary() {\n\tconst location = useLocation()\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tstatusHandlers={{\n\t\t\t\t404: () => (\n\t\t\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t\t\t\t<h1>We can't find this page:</h1>\n\t\t\t\t\t\t\t<pre className=\"whitespace-pre-wrap break-all text-body-lg\">\n\t\t\t\t\t\t\t\t{location.pathname}\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Link to=\"/\" className=\"text-body-md underline\">\n\t\t\t\t\t\t\t<Icon name=\"ArrowLeft\">Back to home</Icon>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</div>\n\t\t\t\t),\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["NotFound","ErrorBoundary","location","useLocation","jsx","GeneralErrorBoundary","statusHandlers","jsxs","className","children","pathname","Link","to","Icon","name"],"mappings":"oLA4BA,SAAwBA,GAAW,CAGlC,aAAQC,EAAc,CAAA,CAAA,CACvB,CAEO,SAASA,GAAgB,CAC/B,MAAMC,EAAWC,IAEhB,OAAAC,EAAAA,IAACC,EAAA,CACAC,eAAgB,CACf,IAAK,IACHC,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAACF,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAAAL,EAAA,IAAC,MAAGK,SAAwB,0BAAA,CAAA,EAC3BL,EAAA,IAAA,MAAA,CAAII,UAAU,6CACbC,WAASC,QACX,CAAA,CAAA,CACD,CAAA,EACAN,EAAA,IAACO,EAAK,CAAAC,GAAG,IAAIJ,UAAU,yBACtBC,SAAAL,EAAA,IAACS,EAAK,CAAAC,KAAK,YAAYL,SAAA,eAAY,CACpC,CAAA,CAAA,EACD,CAEF,CAAA,CACD,CAEF"}
@@ -1,2 +1,2 @@
1
- import{j as r,a as l,i as c}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as m}from"./epic-video-75U1kyqf.js";import{u as d}from"./revalidation-ws-Bes2l3ma.js";import{M as x,E as p}from"./mdx-CsRMuEw9.js";import{P as u}from"./progress-Dj5cyA_v.js";import{g as f}from"./misc-DoGPlBur.js";import{g as h}from"./seo-pBpFCWsy.js";import{u as b,L as j}from"./components-DrvY4pal.js";import"./index-9OWT3nC-.js";import"./tooltip-DT9kZxPw.js";import"./pe-DXT2FOp1.js";import"./online-D33oijLr.js";import"./loading-DsHhjqzj.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-Dln7epYZ.js";const B=({data:e,matches:o})=>{var i;const t=e==null?void 0:e.exercise.exerciseNumber.toString().padStart(2,"0"),s=(i=o.find(n=>n.id==="root"))==null?void 0:i.data;return!e||!s?[{title:"🦉 | Error"}]:h({title:`📝 | ${t}. ${e.exercise.title} | ${s==null?void 0:s.workshopTitle}`,description:`Introduction for ${t}. ${e.exercise.title}`,ogTitle:e.exercise.title,ogDescription:`Introduction for exercise ${Number(t)}`,instructor:s.instructor,requestInfo:s.requestInfo})},g={h1:()=>null};function D(){var t;const e=b();d({watchPaths:[e.exerciseReadme.file]});const o=String(((t=e.firstStep)==null?void 0:t.stepNumber)??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(m,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(x,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(a,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{}),r.jsx(p,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(j,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"flex h-full items-center justify-center bg-foreground px-7 text-background",children:"Start Learning"})]})]})}function F(){const e=l();return typeof document<"u"&&console.error(e),c(e)?e.status===404?r.jsx("p",{children:"Sorry, we couldn't find that step."}):r.jsxs("p",{children:[e.status," ",e.data]}):r.jsx("p",{children:f(e)})}export{F as ErrorBoundary,D as default,B as meta};
2
- //# sourceMappingURL=_exerciseNumber-BVCFK83o.js.map
1
+ import{j as r,a as l,i as c}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as m}from"./epic-video-DbfbYOk7.js";import{u as d}from"./revalidation-ws-BIizeOeQ.js";import{M as x,E as p}from"./mdx-Nz3dsEsr.js";import{P as u}from"./progress-CpALgZbi.js";import{g as f}from"./misc-D9k1wGip.js";import{g as h}from"./seo-pBpFCWsy.js";import{u as b,L as j}from"./components-DrvY4pal.js";import"./index-Ba7zHVvt.js";import"./tooltip-CzrLrLJU.js";import"./pe-DXT2FOp1.js";import"./online-CN5sXlwN.js";import"./loading-ZSC9wgHC.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-IswLOt8e.js";const B=({data:e,matches:o})=>{var i;const t=e==null?void 0:e.exercise.exerciseNumber.toString().padStart(2,"0"),s=(i=o.find(n=>n.id==="root"))==null?void 0:i.data;return!e||!s?[{title:"🦉 | Error"}]:h({title:`📝 | ${t}. ${e.exercise.title} | ${s==null?void 0:s.workshopTitle}`,description:`Introduction for ${t}. ${e.exercise.title}`,ogTitle:e.exercise.title,ogDescription:`Introduction for exercise ${Number(t)}`,instructor:s.instructor,requestInfo:s.requestInfo})},g={h1:()=>null};function D(){var t;const e=b();d({watchPaths:[e.exerciseReadme.file]});const o=String(((t=e.firstStep)==null?void 0:t.stepNumber)??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(m,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(x,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(a,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{}),r.jsx(p,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(j,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"flex h-full items-center justify-center bg-foreground px-7 text-background",children:"Start Learning"})]})]})}function F(){const e=l();return typeof document<"u"&&console.error(e),c(e)?e.status===404?r.jsx("p",{children:"Sorry, we couldn't find that step."}):r.jsxs("p",{children:[e.status," ",e.data]}):r.jsx("p",{children:f(e)})}export{F as ErrorBoundary,D as default,B as meta};
2
+ //# sourceMappingURL=_exerciseNumber-BdRxxVY9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber-BVCFK83o.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tworkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tisRouteErrorResponse,\n\tuseLoaderData,\n\tuseRouteError,\n} from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${data.exercise.title}`,\n\t\togTitle: data.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tworkshopRoot,\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center bg-foreground px-7 text-background\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseNumberRoute","useLoaderData","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","getErrorMessage"],"mappings":"woBAqCO,MAAMA,EAAiEA,CAAC,CAC9EC,KAAAA,EACAC,QAAAA,CACD,IAAM,OACC,MAAAC,EAASF,GAAAA,YAAAA,EAAMG,SAASC,eAAeC,WAAWC,SAAS,EAAG,KAE9DC,GAAWN,EAAAA,EAAQO,KAAMC,GAAMA,EAAEC,KAAO,MAAM,IAAnCT,YAAAA,EAAsCD,KACnD,MAAA,CAACA,GAAQ,CAACO,EAAiB,CAAC,CAAEI,MAAO,YAAa,CAAC,EAEhDC,EAAe,CACrBD,MAAO,QAAQT,CAAM,KAAKF,EAAKG,SAASQ,KAAK,MAAMJ,GAAAA,YAAAA,EAAUM,aAAa,GAC1EC,YAAa,oBAAoBZ,CAAM,KAAKF,EAAKG,SAASQ,KAAK,GAC/DI,QAASf,EAAKG,SAASQ,MACvBK,cAAe,6BAA6BC,OAAOf,CAAM,CAAC,GAC1DgB,WAAYX,EAASW,WACrBC,YAAaZ,EAASY,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvC,SAAwBC,GAAsB,OAC7C,MAAMtB,EAAOuB,IACKC,EAAA,CACjBC,WAAY,CAACzB,EAAK0B,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,SAAO7B,EAAAA,EAAK8B,YAAL9B,YAAAA,EAAgB+B,aAAc,IAAI,EAAEzB,SAClE,EACA,GACD,EAEC,OAAA0B,EAAAA,KAAC,OAAK,CAAAC,UAAU,4FACfC,SAAA,CAAAF,EAAA,KAAC,UAAA,CACAtB,GAAIV,EAAKmC,UAETF,UAAU,8JAEVC,SAAA,CAACE,EAAA,IAAA,MAAA,CACAF,eAAC,KAAG,CAAAD,UAAU,4DACZC,SAAAlC,EAAKG,SAASQ,MAChB,CACD,CAAA,EACCyB,EAAA,IAAA,MAAA,CACCF,SAAAlC,EAAKG,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBvC,EAAKuC,sBAE5BL,SAAAE,EAAA,IAAC,MAAI,CAAAH,UAAU,sCACdC,SAAAE,EAAA,IAACI,EAAA,CACAC,KAAMzC,EAAKG,SAASkC,iBACpBK,WAAYtB,EACb,EACD,CACD,CAAA,EAEA,wBAEF,CAAA,CAAA,CAAA,EAvBKpB,EAAKmC,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAI5C,EAAKmC,SAAS,EAAA,EAC3B,UAAUnC,EAAKmC,SAAS,EAC9B,EACAC,EAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBJ,EAAKI,eACrB6B,UAAU,oBAAA,CACX,EACAD,EAAA,KAAC,MAAI,CAAAC,UAAU,8DACdC,SAAA,CAAAE,EAAAA,IAAC,MAAI,CAAA,CAAA,EACLA,EAAA,IAACW,EAAA,CACApB,KAAM3B,EAAK0B,eAAeC,KAC1BqB,aAAchD,EAAK0B,eAAesB,YAAA,CACnC,EACAZ,EAAA,IAACa,EAAA,CACAC,GAAI,GAAGtB,CAAe,IAAI5B,EAAKmD,SAAS,GACxCC,SAAS,SACTnB,UAAU,6EACVC,SAAA,gBAAA,CAED,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CAEF,CAEO,SAASmB,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBvB,EAAA,IAAC,IAAE,CAAAF,SAAA,oCAAA,CAAkC,EAErCF,EAAA,KAAC,IACC,CAAAE,SAAA,CAAMoB,EAAAK,OAAO,IAAEL,EAAMtD,IAAA,CAAA,CACvB,EAGDoC,EAAA,IAAC,IAAG,CAAAF,SAAA0B,EAAgBN,CAAK,CAAE,CAAA,CAE7B"}
1
+ {"version":3,"file":"_exerciseNumber-BdRxxVY9.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tworkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tisRouteErrorResponse,\n\tuseLoaderData,\n\tuseRouteError,\n} from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${data.exercise.title}`,\n\t\togTitle: data.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tworkshopRoot,\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center bg-foreground px-7 text-background\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseNumberRoute","useLoaderData","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","getErrorMessage"],"mappings":"woBAqCO,MAAMA,EAAiEA,CAAC,CAC9EC,KAAAA,EACAC,QAAAA,CACD,IAAM,OACC,MAAAC,EAASF,GAAAA,YAAAA,EAAMG,SAASC,eAAeC,WAAWC,SAAS,EAAG,KAE9DC,GAAWN,EAAAA,EAAQO,KAAMC,GAAMA,EAAEC,KAAO,MAAM,IAAnCT,YAAAA,EAAsCD,KACnD,MAAA,CAACA,GAAQ,CAACO,EAAiB,CAAC,CAAEI,MAAO,YAAa,CAAC,EAEhDC,EAAe,CACrBD,MAAO,QAAQT,CAAM,KAAKF,EAAKG,SAASQ,KAAK,MAAMJ,GAAAA,YAAAA,EAAUM,aAAa,GAC1EC,YAAa,oBAAoBZ,CAAM,KAAKF,EAAKG,SAASQ,KAAK,GAC/DI,QAASf,EAAKG,SAASQ,MACvBK,cAAe,6BAA6BC,OAAOf,CAAM,CAAC,GAC1DgB,WAAYX,EAASW,WACrBC,YAAaZ,EAASY,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvC,SAAwBC,GAAsB,OAC7C,MAAMtB,EAAOuB,IACKC,EAAA,CACjBC,WAAY,CAACzB,EAAK0B,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,SAAO7B,EAAAA,EAAK8B,YAAL9B,YAAAA,EAAgB+B,aAAc,IAAI,EAAEzB,SAClE,EACA,GACD,EAEC,OAAA0B,EAAAA,KAAC,OAAK,CAAAC,UAAU,4FACfC,SAAA,CAAAF,EAAA,KAAC,UAAA,CACAtB,GAAIV,EAAKmC,UAETF,UAAU,8JAEVC,SAAA,CAACE,EAAA,IAAA,MAAA,CACAF,eAAC,KAAG,CAAAD,UAAU,4DACZC,SAAAlC,EAAKG,SAASQ,MAChB,CACD,CAAA,EACCyB,EAAA,IAAA,MAAA,CACCF,SAAAlC,EAAKG,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBvC,EAAKuC,sBAE5BL,SAAAE,EAAA,IAAC,MAAI,CAAAH,UAAU,sCACdC,SAAAE,EAAA,IAACI,EAAA,CACAC,KAAMzC,EAAKG,SAASkC,iBACpBK,WAAYtB,EACb,EACD,CACD,CAAA,EAEA,wBAEF,CAAA,CAAA,CAAA,EAvBKpB,EAAKmC,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAI5C,EAAKmC,SAAS,EAAA,EAC3B,UAAUnC,EAAKmC,SAAS,EAC9B,EACAC,EAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBJ,EAAKI,eACrB6B,UAAU,oBAAA,CACX,EACAD,EAAA,KAAC,MAAI,CAAAC,UAAU,8DACdC,SAAA,CAAAE,EAAAA,IAAC,MAAI,CAAA,CAAA,EACLA,EAAA,IAACW,EAAA,CACApB,KAAM3B,EAAK0B,eAAeC,KAC1BqB,aAAchD,EAAK0B,eAAesB,YAAA,CACnC,EACAZ,EAAA,IAACa,EAAA,CACAC,GAAI,GAAGtB,CAAe,IAAI5B,EAAKmD,SAAS,GACxCC,SAAS,SACTnB,UAAU,6EACVC,SAAA,gBAAA,CAED,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CAEF,CAEO,SAASmB,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBvB,EAAA,IAAC,IAAE,CAAAF,SAAA,oCAAA,CAAkC,EAErCF,EAAA,KAAC,IACC,CAAAE,SAAA,CAAMoB,EAAAK,OAAO,IAAEL,EAAMtD,IAAA,CAAA,CACvB,EAGDoC,EAAA,IAAC,IAAG,CAAAF,SAAA0B,EAAgBN,CAAK,CAAE,CAAA,CAE7B"}
@@ -1,2 +1,2 @@
1
- import{j as t,O as e,a as o,i as s}from"./index-CGzylDPY.js";import{g as n}from"./misc-DoGPlBur.js";import"./components-DrvY4pal.js";function p(){return t.jsx(e,{})}function d(){const r=o();return typeof document<"u"&&console.error(r),s(r)?r.status===404?t.jsx("p",{children:"Sorry, we couldn't find that step."}):t.jsxs("p",{children:[r.status," ",r.data]}):t.jsx("p",{children:n(r)})}export{d as ErrorBoundary,p as default};
2
- //# sourceMappingURL=_exerciseNumber_._stepNumber-CAxJdIJe.js.map
1
+ import{j as t,O as e,a as o,i as s}from"./index-CGzylDPY.js";import{g as n}from"./misc-D9k1wGip.js";import"./components-DrvY4pal.js";function p(){return t.jsx(e,{})}function d(){const r=o();return typeof document<"u"&&console.error(r),s(r)?r.status===404?t.jsx("p",{children:"Sorry, we couldn't find that step."}):t.jsxs("p",{children:[r.status," ",r.data]}):t.jsx("p",{children:n(r)})}export{d as ErrorBoundary,p as default};
2
+ //# sourceMappingURL=_exerciseNumber_._stepNumber-CZKDy98j.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_._stepNumber-CAxJdIJe.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.tsx"],"sourcesContent":["import { invariantResponse } from '@epic-web/invariant'\nimport { getExercises } from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercises = await getExercises({ request, timings })\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst result = data(\n\t\t{\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseTitle: exercise.title,\n\t\t\ttitle: workshopTitle,\n\t\t\texercises: exercises.map((e) => ({\n\t\t\t\texerciseNumber: e.exerciseNumber,\n\t\t\t\ttitle: e.title,\n\t\t\t})),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n\treturn result\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function StepRoute() {\n\treturn <Outlet />\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["StepRoute","Outlet","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","jsx","children","jsxs","data","getErrorMessage"],"mappings":"qIAuDA,SAAwBA,GAAY,CACnC,aAAQC,EAAO,CAAA,CAAA,CAChB,CAEO,SAASC,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBC,EAAA,IAAC,IAAE,CAAAC,SAAA,oCAAA,CAAkC,EAErCC,EAAA,KAAC,IACC,CAAAD,SAAA,CAAMP,EAAAK,OAAO,IAAEL,EAAMS,IAAA,CAAA,CACvB,EAGDH,EAAA,IAAC,IAAG,CAAAC,SAAAG,EAAgBV,CAAK,CAAE,CAAA,CAE7B"}
1
+ {"version":3,"file":"_exerciseNumber_._stepNumber-CZKDy98j.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.tsx"],"sourcesContent":["import { invariantResponse } from '@epic-web/invariant'\nimport { getExercises } from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercises = await getExercises({ request, timings })\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst result = data(\n\t\t{\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseTitle: exercise.title,\n\t\t\ttitle: workshopTitle,\n\t\t\texercises: exercises.map((e) => ({\n\t\t\t\texerciseNumber: e.exerciseNumber,\n\t\t\t\ttitle: e.title,\n\t\t\t})),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n\treturn result\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function StepRoute() {\n\treturn <Outlet />\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["StepRoute","Outlet","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","jsx","children","jsxs","data","getErrorMessage"],"mappings":"qIAuDA,SAAwBA,GAAY,CACnC,aAAQC,EAAO,CAAA,CAAA,CAChB,CAEO,SAASC,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBC,EAAA,IAAC,IAAE,CAAAC,SAAA,oCAAA,CAAkC,EAErCC,EAAA,KAAC,IACC,CAAAD,SAAA,CAAMP,EAAAK,OAAO,IAAEL,EAAMS,IAAA,CAAA,CACvB,EAGDH,EAAA,IAAC,IAAG,CAAAC,SAAAG,EAAgBV,CAAK,CAAE,CAAA,CAE7B"}
@@ -1,2 +1,2 @@
1
- import{j as e,r as n}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as c}from"./epic-video-75U1kyqf.js";import{I as m,a as d}from"./misc-DoGPlBur.js";import{L as x}from"./loading-DsHhjqzj.js";import{N as f}from"./nav-chevrons-CxWSSbTo.js";import{u as p}from"./revalidation-ws-Bes2l3ma.js";import{M as u,E as h}from"./mdx-CsRMuEw9.js";import{P as j}from"./progress-Dj5cyA_v.js";import{u as b}from"./online-D33oijLr.js";import{g}from"./seo-pBpFCWsy.js";import{u as v,L as N}from"./components-DrvY4pal.js";import"./index-9OWT3nC-.js";import"./tooltip-DT9kZxPw.js";import"./pe-DXT2FOp1.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-Dln7epYZ.js";const U=({data:s,matches:i})=>{var o;const t=s==null?void 0:s.exercise.exerciseNumber.toString().padStart(2,"0"),r=(o=i.find(l=>l.id==="root"))==null?void 0:o.data;return!s||!r?[{title:"🦉 | Error"}]:g({title:`🦉 | ${t}. ${s.exercise.title} | ${r==null?void 0:r.workshopTitle}`,description:`Elaboration for ${t}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(t)}`,instructor:r.instructor,requestInfo:r.requestInfo})},E={h1:()=>null};function G(){const s=v(),i=s.exercise.exerciseNumber.toString().padStart(2,"0");return p({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:e.jsxs("main",{className:"flex 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 pl-10 pr-5 text-sm font-medium leading-tight",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(N,{to:`/${i}`,className:"hover:underline",children:`${i}. ${s.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-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",id:s.articleId,children:s.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:s.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(u,{code:s.exercise.finishedCode,components:E})})}):"No finished instructions yet..."}),e.jsx(a,{elementQuery:`#${s.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:s.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",{}),e.jsx(h,{file:s.exerciseFinished.file,relativePath:s.exerciseFinished.relativePath}),e.jsx(f,{prev:s.prevStepLink,next:s.nextStepLink})]})]}),e.jsx(w,{exerciseFormEmbedUrl:s.exerciseFormEmbedUrl,exerciseTitle:s.exercise.title})]})})}function w({exerciseFormEmbedUrl:s,exerciseTitle:i}){const[t,r]=n.useState(!1);return b()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0",children:[t?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{children:e.jsxs("span",{children:["Loading ",i," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>r(!0),onError:()=>r(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",t?"opacity-100":"opacity-0")})]}):e.jsx("div",{className:"relative flex-shrink-0",children:e.jsx("div",{className:"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center text-body-md",children:e.jsx(m,{name:"Error",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${i} feedback form`})," when offline"]})})})})}export{G as default,U as meta};
2
- //# sourceMappingURL=_exerciseNumber_.finished-DYebDhaK.js.map
1
+ import{j as e,r as n}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as c}from"./epic-video-DbfbYOk7.js";import{I as m,a as d}from"./misc-D9k1wGip.js";import{L as x}from"./loading-ZSC9wgHC.js";import{N as f}from"./nav-chevrons-CM-frhig.js";import{u as p}from"./revalidation-ws-BIizeOeQ.js";import{M as u,E as h}from"./mdx-Nz3dsEsr.js";import{P as j}from"./progress-CpALgZbi.js";import{u as b}from"./online-CN5sXlwN.js";import{g}from"./seo-pBpFCWsy.js";import{u as N,L as v}from"./components-DrvY4pal.js";import"./index-Ba7zHVvt.js";import"./tooltip-CzrLrLJU.js";import"./pe-DXT2FOp1.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-IswLOt8e.js";const U=({data:s,matches:i})=>{var o;const t=s==null?void 0:s.exercise.exerciseNumber.toString().padStart(2,"0"),r=(o=i.find(l=>l.id==="root"))==null?void 0:o.data;return!s||!r?[{title:"🦉 | Error"}]:g({title:`🦉 | ${t}. ${s.exercise.title} | ${r==null?void 0:r.workshopTitle}`,description:`Elaboration for ${t}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(t)}`,instructor:r.instructor,requestInfo:r.requestInfo})},E={h1:()=>null};function W(){const s=N(),i=s.exercise.exerciseNumber.toString().padStart(2,"0");return p({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:e.jsxs("main",{className:"flex 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 pl-10 pr-5 text-sm font-medium leading-tight",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(v,{to:`/${i}`,className:"hover:underline",children:`${i}. ${s.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-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",id:s.articleId,children:s.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:s.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(u,{code:s.exercise.finishedCode,components:E})})}):"No finished instructions yet..."}),e.jsx(a,{elementQuery:`#${s.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:s.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",{}),e.jsx(h,{file:s.exerciseFinished.file,relativePath:s.exerciseFinished.relativePath}),e.jsx(f,{prev:s.prevStepLink,next:s.nextStepLink})]})]}),e.jsx(w,{exerciseFormEmbedUrl:s.exerciseFormEmbedUrl,exerciseTitle:s.exercise.title})]})})}function w({exerciseFormEmbedUrl:s,exerciseTitle:i}){const[t,r]=n.useState(!1);return b()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0",children:[t?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{children:e.jsxs("span",{children:["Loading ",i," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>r(!0),onError:()=>r(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",t?"opacity-100":"opacity-0")})]}):e.jsx("div",{className:"relative flex-shrink-0",children:e.jsx("div",{className:"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center text-body-md",children:e.jsx(m,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${i} feedback form`})," when offline"]})})})})}export{W as default,U as meta};
2
+ //# sourceMappingURL=_exerciseNumber_.finished-zD7Rb_Qp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_.finished-DYebDhaK.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tworkshopRoot,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport { Link, useLoaderData } from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${data.exercise.title}`,\n\t\togTitle: `Finished: ${data.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tworkshopRoot,\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full flex-grow flex-col\">\n\t\t\t<main className=\"flex 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\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative flex-shrink-0\">\n\t\t\t\t<div className=\"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center text-body-md\">\n\t\t\t\t\t<Icon name=\"Error\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseFinished","useLoaderData","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","Icon","name","size","href"],"mappings":"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"}
1
+ {"version":3,"file":"_exerciseNumber_.finished-zD7Rb_Qp.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tworkshopRoot,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport { Link, useLoaderData } from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${data.exercise.title}`,\n\t\togTitle: `Finished: ${data.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tworkshopRoot,\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full flex-grow flex-col\">\n\t\t\t<main className=\"flex 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\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative flex-shrink-0\">\n\t\t\t\t<div className=\"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center text-body-md\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseFinished","useLoaderData","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","Icon","name","size","href"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{r as p,j as r,O as Q}from"./index-CGzylDPY.js";import{E as Z}from"./index-egcHQOpF.js";import{G as J}from"./error-boundary-IvG0vuiP.js";import{N as X}from"./nav-chevrons-CxWSSbTo.js";import{u as ee}from"./revalidation-ws-Bes2l3ma.js";import{M as re,L as b,E as te}from"./mdx-CsRMuEw9.js";import{P as oe}from"./progress-Dj5cyA_v.js";import{S as D}from"./set-playground-DOFTHWzE.js";import{g as ne}from"./seo-pBpFCWsy.js";import{b as se,a as A,I as C,i as ie}from"./misc-DoGPlBur.js";import{E as ae}from"./epic-video-75U1kyqf.js";import{S,d as le,j as k,A as _,h as I,P as L,f as j,g as F,k as ce,D as pe,C as ue,l as de,u as fe,R as me,e as xe}from"./tooltip-DT9kZxPw.js";import{a as he}from"./index-9OWT3nC-.js";import{u as P,L as v,e as ve,A as ge}from"./components-DrvY4pal.js";import{h as Pe,R as je,u as Ne,F as be,P as Ce}from"./index-c1IJ5ZX5.js";import"./progress-bar-Dln7epYZ.js";import"./pe-DXT2FOp1.js";import"./index-t6AA12_S.js";import"./online-D33oijLr.js";import"./loading-DsHhjqzj.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";const $=p.createContext(null);function Se(){const e=p.useContext($);if(!e)throw new Error("useStepContext must be used within a StepContext.Provider");return e}function Ee({children:e,inBrowserBrowserRef:o}){return r.jsx($.Provider,{value:{inBrowserBrowserRef:o},children:e})}const we={DiffLink:E,PrevDiffLink:Re,NextDiffLink:Oe,InlineFile:Ae,LinkToApp:ke};function ye({inBrowserBrowserRef:e}){const o=P();return o.exerciseStepApp.instructionsCode?r.jsx(Ee,{inBrowserBrowserRef:e,children:r.jsx(ae,{epicVideoInfosPromise:o.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(re,{code:o.exerciseStepApp.instructionsCode,components:we})})})}):null}function T(e,o,t){const n=new URLSearchParams(e);return t===null?n.delete(o):n.set(o,t),n}function Oe({app:e=0,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function Re({app:e=-1,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function E({app1:e=0,app2:o=1,children:t,fullPage:n=!1,to:i}){const s=P();if(!i&&!e&&!o)return r.jsx("callout-danger",{className:"notification",children:r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"})});function a(d){var f;if(typeof d=="number"){const m=s.exerciseIndex+d;return(f=s.allApps[m])==null?void 0:f.name}if(!d)return null;for(const{name:m,stepName:x}of s.allApps)if(d===m||d===x)return m;return null}if(i){const d=new URLSearchParams(i);e=d.get("app1"),o=d.get("app2")}const l=a(e),c=a(o);if(!l||!c)return r.jsxs("callout-danger",{className:"notification",children:[r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"}),!l&&r.jsxs("div",{children:['app1: "',e,'" is not a valid app name']}),!c&&r.jsxs("div",{children:['app2: "',o,'" is not a valid app name']})]});i||(i=`app1=${l}&app2=${c}`);const u=n?`/diff?${i}`:`?${decodeURIComponent(T(new URLSearchParams,"preview",`diff&${i}`).toString())}`;return t||(t=r.jsxs("span",{children:["Go to Diff ",n?"":"Preview"," from: ",r.jsx("code",{children:l})," to:"," ",r.jsx("code",{children:c})]})),r.jsx(v,{to:u,children:t})}function Ae({file:e,type:o="playground",children:t=r.jsx("code",{children:e}),...n}){const i=P(),s=i[o]||i[i.type],a=r.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[t," ",r.jsx("svg",{height:24,width:24,children:r.jsx("use",{href:`${ie}#Keyboard`})})]});return ENV.EPICSHOP_DEPLOYED&&s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):o==="playground"?r.jsx(S,{content:"You must 'Set to Playground' before opening a file",children:r.jsx("div",{className:"inline-block grow cursor-not-allowed",children:a})}):r.jsx(r.Fragment,{children:"children"})}function De(e){return e==="problem"?"problem":e==="solution"?"solution":"playground"}function ke({to:e,children:o=r.jsx("code",{children:e.toString()}),...t}){var m;const[n]=ve(),i=`?${T(n,"pathname",e.toString()).toString()}`,s=P(),a=De(n.get("preview")),l=he(),c=s[a],u=(c==null?void 0:c.dev.type)==="script"?se({domain:l.domain,port:c.dev.portNumber}):((m=s.playground)==null?void 0:m.dev.type)==="browser"?s.playground.dev.pathname:null,{inBrowserBrowserRef:d}=Se(),f=u?u.slice(0,-1)+e.toString():null;return r.jsxs("div",{className:"inline-flex items-center justify-between gap-1",children:[r.jsx(v,{to:i,...t,className:A(t.className,{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":void 0,onClick:x=>{var O,R;ENV.EPICSHOP_DEPLOYED&&x.preventDefault(),(O=t.onClick)==null||O.call(t,x),(R=d.current)==null||R.handleExtrnalNavigation(e.toString())},children:o}),f?r.jsx(S,{content:"Open in new tab",children:r.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:A("flex aspect-square items-center justify-center",{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":"Open in new tab",onClick:x=>{ENV.EPICSHOP_DEPLOYED&&x.preventDefault()},children:r.jsx(C,{name:"ExternalLink"})})}):null]})}var w="Popover",[M,xr]=le(w,[k]),N=k(),[_e,h]=M(w),H=e=>{const{__scopePopover:o,children:t,open:n,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,l=N(o),c=p.useRef(null),[u,d]=p.useState(!1),[f=!1,m]=fe({prop:n,defaultProp:i,onChange:s});return r.jsx(me,{...l,children:r.jsx(_e,{scope:o,contentId:xe(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:p.useCallback(()=>m(x=>!x),[m]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:t})})};H.displayName=w;var U="PopoverAnchor",Ie=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(U,t),s=N(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=i;return p.useEffect(()=>(a(),()=>l()),[a,l]),r.jsx(_,{...s,...n,ref:o})});Ie.displayName=U;var V="PopoverTrigger",Y=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(V,t),s=N(t),a=I(o,i.triggerRef),l=r.jsx(L.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":W(i.open),...n,ref:a,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:r.jsx(_,{asChild:!0,...s,children:l})});Y.displayName=V;var y="PopoverPortal",[Le,Fe]=M(y,{forceMount:void 0}),B=e=>{const{__scopePopover:o,forceMount:t,children:n,container:i}=e,s=h(y,o);return r.jsx(Le,{scope:o,forceMount:t,children:r.jsx(F,{present:t||s.open,children:r.jsx(Ce,{asChild:!0,container:i,children:n})})})};B.displayName=y;var g="PopoverContent",G=p.forwardRef((e,o)=>{const t=Fe(g,e.__scopePopover),{forceMount:n=t.forceMount,...i}=e,s=h(g,e.__scopePopover);return r.jsx(F,{present:n||s.open,children:s.modal?r.jsx($e,{...i,ref:o}):r.jsx(Te,{...i,ref:o})})});G.displayName=g;var $e=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(null),i=I(o,n),s=p.useRef(!1);return p.useEffect(()=>{const a=n.current;if(a)return Pe(a)},[]),r.jsx(je,{as:ce,allowPinchZoom:!0,children:r.jsx(q,{...e,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Te=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(!1),i=p.useRef(!1);return r.jsx(q,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=t.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),q=p.forwardRef((e,o)=>{const{__scopePopover:t,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,m=h(g,t),x=N(t);return Ne(),r.jsx(be,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:r.jsx(pe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:r.jsx(ue,{"data-state":W(m.open),role:"dialog",id:m.contentId,...x,...f,ref:o,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),K="PopoverClose",Me=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(K,t);return r.jsx(L.button,{type:"button",...n,ref:o,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Me.displayName=K;var He="PopoverArrow",Ue=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=N(t);return r.jsx(de,{...i,...n,ref:o})});Ue.displayName=He;function W(e){return e?"open":"closed"}var Ve=H,Ye=Y,Be=B,Ge=G;function qe({diffFilesPromise:e}){var l,c;const o=P(),[t,n]=p.useState(!1),i=p.useRef(null);function s(){n(!1)}const a=(l=o.playground)==null?void 0:l.appName;return r.jsx(r.Fragment,{children:r.jsxs(Ve,{open:t,onOpenChange:n,children:[r.jsx(Ye,{asChild:!0,children:r.jsxs("button",{className:"flex h-full items-center gap-1 border-r px-6 py-3 font-mono text-sm uppercase","aria-label":"Relevant Files",children:[r.jsx(C,{name:"Files"}),"Files"]})}),r.jsx(Be,{children:r.jsx(Ge,{ref:i,className:"slideRightContent lg:slideUpContent invert-theme z-10 select-none rounded bg-background px-9 py-8 text-foreground",align:"start",sideOffset:5,children:r.jsxs("div",{className:"launch-editor-wrapper",children:[r.jsx("strong",{className:"inline-block px-2 pb-4 font-semibold uppercase",children:"Relevant Files"}),o.problem&&((c=o.playground)==null?void 0:c.appName)!==o.problem.name?r.jsx("div",{className:"mb-2 rounded p-1 font-mono font-medium",children:r.jsx(D,{appName:o.problem.name})}):null,r.jsx("div",{id:"files",children:r.jsx(p.Suspense,{fallback:r.jsx(S,{content:"Loading diff",children:r.jsx("div",{className:"flex justify-center",children:r.jsx(C,{name:"Refresh",className:"h-8 w-8 animate-spin"})})}),children:r.jsx(ge,{resolve:e,errorElement:r.jsx("div",{className:"text-foreground-destructive",children:"Something went wrong."}),children:u=>{if(!u)return r.jsx("p",{className:"text-foreground-destructive",children:"Unable to determine diff"});if(typeof u=="string")return r.jsx("p",{className:"text-foreground-destructive",children:u});if(!u.length)return r.jsx("p",{children:"No files changed"});const d=a||ENV.EPICSHOP_GITHUB_ROOT?{}:{title:"You must 'Set to Playground' before opening a file",className:"not-allowed"};return r.jsxs("ul",{...d,children:[u.length>1&&!ENV.EPICSHOP_DEPLOYED?r.jsx("div",{className:"mb-2 border-b border-b-gray-50 border-opacity-50 pb-2 font-sans",children:r.jsx(b,{appFile:u.map(f=>`${f.path},${f.line},1`),appName:"playground",onUpdate:s,children:r.jsx("p",{children:"Open All Files"})})}):null,u.map(f=>{var m;return r.jsx("li",{"data-state":f.status,children:r.jsx(b,{appFile:`${f.path},${f.line},1`,appName:ENV.EPICSHOP_DEPLOYED?((m=o.problem)==null?void 0:m.name)??"playground":"playground",onUpdate:s,children:r.jsx("code",{children:f.path})})},f.path)})]})}})})})]})})})]})})}function z(e,o){var a;const t=(e==null?void 0:e.exerciseStepApp.exerciseNumber.toString().padStart(2,"0"))??"00",n=(e==null?void 0:e.exerciseStepApp.stepNumber.toString().padStart(2,"0"))??"00",i={problem:"💪",solution:"🏁"}[(e==null?void 0:e.type)??"problem"],s=((a=e==null?void 0:e[e.type])==null?void 0:a.title)??"N/A";return{emoji:i,stepNumber:n,title:s,exerciseNumber:t,exerciseTitle:(e==null?void 0:e.exerciseTitle)??"Unknown exercise",workshopTitle:o,type:(e==null?void 0:e.type)??"problem"}}const hr=({data:e,matches:o,params:t})=>{var u;const n=(u=o.find(d=>d.id==="root"))==null?void 0:u.data;if(!e||!n)return[{title:"🦉 | Error"}];const{emoji:i,stepNumber:s,title:a,exerciseNumber:l,exerciseTitle:c}=z(e);return ne({title:`${i} | ${s}. ${a} | ${l}. ${c} | ${n.workshopTitle}`,description:`${t.type} step for exercise ${l}. ${c}`,ogTitle:a,ogDescription:`${c} step ${Number(s)} ${t.type}`,instructor:n.instructor,requestInfo:n.requestInfo})};function vr(){var n;const e=P(),o=p.useRef(null),t=z(e);return ee({watchPaths:[`${e.exerciseStepApp.relativePath}/README.mdx`]}),r.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:r.jsxs("main",{className:"flex 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:[r.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[r.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight",children:r.jsxs("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:[r.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[r.jsxs(v,{to:`/${t.exerciseNumber}`,className:"hover:underline",children:[t.exerciseNumber,". ",t.exerciseTitle]}),"/",r.jsxs(v,{to:".",className:"hover:underline",children:[t.stepNumber,". ",t.title," (",t.emoji," ",t.type,")"]})]}),e.problem&&((n=e.playground)==null?void 0:n.appName)!==e.problem.name?r.jsx("div",{className:"hidden md:block",children:r.jsx(D,{appName:e.problem.name})}):null]})}),r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",children:[e.exerciseStepApp.instructionsCode?r.jsx(ye,{inBrowserBrowserRef:o}):r.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:r.jsx("p",{children:"No instructions yet..."})}),r.jsxs("div",{className:"mt-auto flex justify-between",children:[e.prevStepLink?r.jsx(v,{to:e.prevStepLink.to,"aria-label":"Previous Step",prefetch:"intent",children:"← Previous"}):r.jsx("span",{}),e.nextStepLink?r.jsx(v,{to:e.nextStepLink.to,"aria-label":"Next Step",prefetch:"intent",children:"Next →"}):r.jsx("span",{})]})]},e.articleId),r.jsx(Z,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),e.type==="solution"?r.jsx(oe,{type:"step",exerciseNumber:e.exerciseStepApp.exerciseNumber,stepNumber:e.exerciseStepApp.stepNumber,className:"h-14 border-t px-6"}):null,r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{children:r.jsx("div",{className:"h-full",children:r.jsx(qe,{diffFilesPromise:e.diffFiles})})}),r.jsx(te,{appName:e.exerciseStepApp.name,relativePath:e.exerciseStepApp.relativePath}),r.jsx(X,{prev:e.prevStepLink?{to:e.prevStepLink.to,"aria-label":"Previous Step"}:null,next:e.nextStepLink?{to:e.nextStepLink.to,"aria-label":"Next Step"}:null})]})]}),r.jsx(Q,{})]})})}function gr(){return r.jsx(J,{statusHandlers:{404:()=>r.jsx("p",{children:"Sorry, we couldn't find an app here."})}})}export{gr as ErrorBoundary,vr as default,hr as meta};
2
- //# sourceMappingURL=_layout-cu1Of_4G.js.map
1
+ import{r as p,j as r,O as Q}from"./index-CGzylDPY.js";import{E as Z}from"./index-egcHQOpF.js";import{G as J}from"./error-boundary-DBVB3BBH.js";import{N as X}from"./nav-chevrons-CM-frhig.js";import{u as ee}from"./revalidation-ws-BIizeOeQ.js";import{M as re,L as b,E as te}from"./mdx-Nz3dsEsr.js";import{P as oe}from"./progress-CpALgZbi.js";import{S as D}from"./set-playground-BoPKA2de.js";import{g as ne}from"./seo-pBpFCWsy.js";import{b as se,a as A,I as C,i as ie}from"./misc-D9k1wGip.js";import{E as ae}from"./epic-video-DbfbYOk7.js";import{S,d as le,j as k,A as _,h as I,P as L,f as j,g as F,k as ce,D as pe,C as ue,l as de,u as fe,R as me,e as xe}from"./tooltip-CzrLrLJU.js";import{a as he}from"./index-Ba7zHVvt.js";import{u as P,L as v,e as ve,A as ge}from"./components-DrvY4pal.js";import{h as Pe,R as je,u as Ne,F as be,P as Ce}from"./index-CWadM2q_.js";import"./progress-bar-IswLOt8e.js";import"./pe-DXT2FOp1.js";import"./index-D7-ne3iG.js";import"./online-CN5sXlwN.js";import"./loading-ZSC9wgHC.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";const $=p.createContext(null);function Se(){const e=p.useContext($);if(!e)throw new Error("useStepContext must be used within a StepContext.Provider");return e}function Ee({children:e,inBrowserBrowserRef:o}){return r.jsx($.Provider,{value:{inBrowserBrowserRef:o},children:e})}const we={DiffLink:E,PrevDiffLink:Re,NextDiffLink:Oe,InlineFile:Ae,LinkToApp:ke};function ye({inBrowserBrowserRef:e}){const o=P();return o.exerciseStepApp.instructionsCode?r.jsx(Ee,{inBrowserBrowserRef:e,children:r.jsx(ae,{epicVideoInfosPromise:o.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(re,{code:o.exerciseStepApp.instructionsCode,components:we})})})}):null}function T(e,o,t){const n=new URLSearchParams(e);return t===null?n.delete(o):n.set(o,t),n}function Oe({app:e=0,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function Re({app:e=-1,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function E({app1:e=0,app2:o=1,children:t,fullPage:n=!1,to:i}){const s=P();if(!i&&!e&&!o)return r.jsx("callout-danger",{className:"notification",children:r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"})});function a(d){var f;if(typeof d=="number"){const m=s.exerciseIndex+d;return(f=s.allApps[m])==null?void 0:f.name}if(!d)return null;for(const{name:m,stepName:x}of s.allApps)if(d===m||d===x)return m;return null}if(i){const d=new URLSearchParams(i);e=d.get("app1"),o=d.get("app2")}const l=a(e),c=a(o);if(!l||!c)return r.jsxs("callout-danger",{className:"notification",children:[r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"}),!l&&r.jsxs("div",{children:['app1: "',e,'" is not a valid app name']}),!c&&r.jsxs("div",{children:['app2: "',o,'" is not a valid app name']})]});i||(i=`app1=${l}&app2=${c}`);const u=n?`/diff?${i}`:`?${decodeURIComponent(T(new URLSearchParams,"preview",`diff&${i}`).toString())}`;return t||(t=r.jsxs("span",{children:["Go to Diff ",n?"":"Preview"," from: ",r.jsx("code",{children:l})," to:"," ",r.jsx("code",{children:c})]})),r.jsx(v,{to:u,children:t})}function Ae({file:e,type:o="playground",children:t=r.jsx("code",{children:e}),...n}){const i=P(),s=i[o]||i[i.type],a=r.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[t," ",r.jsx("svg",{height:24,width:24,children:r.jsx("use",{href:`${ie}#Keyboard`})})]});return ENV.EPICSHOP_DEPLOYED&&s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):o==="playground"?r.jsx(S,{content:"You must 'Set to Playground' before opening a file",children:r.jsx("div",{className:"inline-block grow cursor-not-allowed",children:a})}):r.jsx(r.Fragment,{children:"children"})}function De(e){return e==="problem"?"problem":e==="solution"?"solution":"playground"}function ke({to:e,children:o=r.jsx("code",{children:e.toString()}),...t}){var m;const[n]=ve(),i=`?${T(n,"pathname",e.toString()).toString()}`,s=P(),a=De(n.get("preview")),l=he(),c=s[a],u=(c==null?void 0:c.dev.type)==="script"?se({domain:l.domain,port:c.dev.portNumber}):((m=s.playground)==null?void 0:m.dev.type)==="browser"?s.playground.dev.pathname:null,{inBrowserBrowserRef:d}=Se(),f=u?u.slice(0,-1)+e.toString():null;return r.jsxs("div",{className:"inline-flex items-center justify-between gap-1",children:[r.jsx(v,{to:i,...t,className:A(t.className,{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":void 0,onClick:x=>{var O,R;ENV.EPICSHOP_DEPLOYED&&x.preventDefault(),(O=t.onClick)==null||O.call(t,x),(R=d.current)==null||R.handleExtrnalNavigation(e.toString())},children:o}),f?r.jsx(S,{content:"Open in new tab",children:r.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:A("flex aspect-square items-center justify-center",{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":"Open in new tab",onClick:x=>{ENV.EPICSHOP_DEPLOYED&&x.preventDefault()},children:r.jsx(C,{name:"ExternalLink"})})}):null]})}var w="Popover",[M,xr]=le(w,[k]),N=k(),[_e,h]=M(w),H=e=>{const{__scopePopover:o,children:t,open:n,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,l=N(o),c=p.useRef(null),[u,d]=p.useState(!1),[f=!1,m]=fe({prop:n,defaultProp:i,onChange:s});return r.jsx(me,{...l,children:r.jsx(_e,{scope:o,contentId:xe(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:p.useCallback(()=>m(x=>!x),[m]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:t})})};H.displayName=w;var U="PopoverAnchor",Ie=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(U,t),s=N(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=i;return p.useEffect(()=>(a(),()=>l()),[a,l]),r.jsx(_,{...s,...n,ref:o})});Ie.displayName=U;var V="PopoverTrigger",Y=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(V,t),s=N(t),a=I(o,i.triggerRef),l=r.jsx(L.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":W(i.open),...n,ref:a,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:r.jsx(_,{asChild:!0,...s,children:l})});Y.displayName=V;var y="PopoverPortal",[Le,Fe]=M(y,{forceMount:void 0}),B=e=>{const{__scopePopover:o,forceMount:t,children:n,container:i}=e,s=h(y,o);return r.jsx(Le,{scope:o,forceMount:t,children:r.jsx(F,{present:t||s.open,children:r.jsx(Ce,{asChild:!0,container:i,children:n})})})};B.displayName=y;var g="PopoverContent",G=p.forwardRef((e,o)=>{const t=Fe(g,e.__scopePopover),{forceMount:n=t.forceMount,...i}=e,s=h(g,e.__scopePopover);return r.jsx(F,{present:n||s.open,children:s.modal?r.jsx($e,{...i,ref:o}):r.jsx(Te,{...i,ref:o})})});G.displayName=g;var $e=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(null),i=I(o,n),s=p.useRef(!1);return p.useEffect(()=>{const a=n.current;if(a)return Pe(a)},[]),r.jsx(je,{as:ce,allowPinchZoom:!0,children:r.jsx(q,{...e,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Te=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(!1),i=p.useRef(!1);return r.jsx(q,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=t.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),q=p.forwardRef((e,o)=>{const{__scopePopover:t,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,m=h(g,t),x=N(t);return Ne(),r.jsx(be,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:r.jsx(pe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:r.jsx(ue,{"data-state":W(m.open),role:"dialog",id:m.contentId,...x,...f,ref:o,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),K="PopoverClose",Me=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(K,t);return r.jsx(L.button,{type:"button",...n,ref:o,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Me.displayName=K;var He="PopoverArrow",Ue=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=N(t);return r.jsx(de,{...i,...n,ref:o})});Ue.displayName=He;function W(e){return e?"open":"closed"}var Ve=H,Ye=Y,Be=B,Ge=G;function qe({diffFilesPromise:e}){var l,c;const o=P(),[t,n]=p.useState(!1),i=p.useRef(null);function s(){n(!1)}const a=(l=o.playground)==null?void 0:l.appName;return r.jsx(r.Fragment,{children:r.jsxs(Ve,{open:t,onOpenChange:n,children:[r.jsx(Ye,{asChild:!0,children:r.jsxs("button",{className:"flex h-full items-center gap-1 border-r px-6 py-3 font-mono text-sm uppercase","aria-label":"Relevant Files",children:[r.jsx(C,{name:"Files"}),"Files"]})}),r.jsx(Be,{children:r.jsx(Ge,{ref:i,className:"slideRightContent lg:slideUpContent invert-theme z-10 select-none rounded bg-background px-9 py-8 text-foreground",align:"start",sideOffset:5,children:r.jsxs("div",{className:"launch-editor-wrapper",children:[r.jsx("strong",{className:"inline-block px-2 pb-4 font-semibold uppercase",children:"Relevant Files"}),o.problem&&((c=o.playground)==null?void 0:c.appName)!==o.problem.name?r.jsx("div",{className:"mb-2 rounded p-1 font-mono font-medium",children:r.jsx(D,{appName:o.problem.name})}):null,r.jsx("div",{id:"files",children:r.jsx(p.Suspense,{fallback:r.jsx(S,{content:"Loading diff",children:r.jsx("div",{className:"flex justify-center",children:r.jsx(C,{name:"Refresh",className:"h-8 w-8 animate-spin"})})}),children:r.jsx(ge,{resolve:e,errorElement:r.jsx("div",{className:"text-foreground-destructive",children:"Something went wrong."}),children:u=>{if(!u)return r.jsx("p",{className:"text-foreground-destructive",children:"Unable to determine diff"});if(typeof u=="string")return r.jsx("p",{className:"text-foreground-destructive",children:u});if(!u.length)return r.jsx("p",{children:"No files changed"});const d=a||ENV.EPICSHOP_GITHUB_ROOT?{}:{title:"You must 'Set to Playground' before opening a file",className:"not-allowed"};return r.jsxs("ul",{...d,children:[u.length>1&&!ENV.EPICSHOP_DEPLOYED?r.jsx("div",{className:"mb-2 border-b border-b-gray-50 border-opacity-50 pb-2 font-sans",children:r.jsx(b,{appFile:u.map(f=>`${f.path},${f.line},1`),appName:"playground",onUpdate:s,children:r.jsx("p",{children:"Open All Files"})})}):null,u.map(f=>{var m;return r.jsx("li",{"data-state":f.status,children:r.jsx(b,{appFile:`${f.path},${f.line},1`,appName:ENV.EPICSHOP_DEPLOYED?((m=o.problem)==null?void 0:m.name)??"playground":"playground",onUpdate:s,children:r.jsx("code",{children:f.path})})},f.path)})]})}})})})]})})})]})})}function z(e,o){var a;const t=(e==null?void 0:e.exerciseStepApp.exerciseNumber.toString().padStart(2,"0"))??"00",n=(e==null?void 0:e.exerciseStepApp.stepNumber.toString().padStart(2,"0"))??"00",i={problem:"💪",solution:"🏁"}[(e==null?void 0:e.type)??"problem"],s=((a=e==null?void 0:e[e.type])==null?void 0:a.title)??"N/A";return{emoji:i,stepNumber:n,title:s,exerciseNumber:t,exerciseTitle:(e==null?void 0:e.exerciseTitle)??"Unknown exercise",workshopTitle:o,type:(e==null?void 0:e.type)??"problem"}}const hr=({data:e,matches:o,params:t})=>{var u;const n=(u=o.find(d=>d.id==="root"))==null?void 0:u.data;if(!e||!n)return[{title:"🦉 | Error"}];const{emoji:i,stepNumber:s,title:a,exerciseNumber:l,exerciseTitle:c}=z(e);return ne({title:`${i} | ${s}. ${a} | ${l}. ${c} | ${n.workshopTitle}`,description:`${t.type} step for exercise ${l}. ${c}`,ogTitle:a,ogDescription:`${c} step ${Number(s)} ${t.type}`,instructor:n.instructor,requestInfo:n.requestInfo})};function vr(){var n;const e=P(),o=p.useRef(null),t=z(e);return ee({watchPaths:[`${e.exerciseStepApp.relativePath}/README.mdx`]}),r.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:r.jsxs("main",{className:"flex 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:[r.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[r.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight",children:r.jsxs("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:[r.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[r.jsxs(v,{to:`/${t.exerciseNumber}`,className:"hover:underline",children:[t.exerciseNumber,". ",t.exerciseTitle]}),"/",r.jsxs(v,{to:".",className:"hover:underline",children:[t.stepNumber,". ",t.title," (",t.emoji," ",t.type,")"]})]}),e.problem&&((n=e.playground)==null?void 0:n.appName)!==e.problem.name?r.jsx("div",{className:"hidden md:block",children:r.jsx(D,{appName:e.problem.name})}):null]})}),r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",children:[e.exerciseStepApp.instructionsCode?r.jsx(ye,{inBrowserBrowserRef:o}):r.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:r.jsx("p",{children:"No instructions yet..."})}),r.jsxs("div",{className:"mt-auto flex justify-between",children:[e.prevStepLink?r.jsx(v,{to:e.prevStepLink.to,"aria-label":"Previous Step",prefetch:"intent",children:"← Previous"}):r.jsx("span",{}),e.nextStepLink?r.jsx(v,{to:e.nextStepLink.to,"aria-label":"Next Step",prefetch:"intent",children:"Next →"}):r.jsx("span",{})]})]},e.articleId),r.jsx(Z,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),e.type==="solution"?r.jsx(oe,{type:"step",exerciseNumber:e.exerciseStepApp.exerciseNumber,stepNumber:e.exerciseStepApp.stepNumber,className:"h-14 border-t px-6"}):null,r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{children:r.jsx("div",{className:"h-full",children:r.jsx(qe,{diffFilesPromise:e.diffFiles})})}),r.jsx(te,{appName:e.exerciseStepApp.name,relativePath:e.exerciseStepApp.relativePath}),r.jsx(X,{prev:e.prevStepLink?{to:e.prevStepLink.to,"aria-label":"Previous Step"}:null,next:e.nextStepLink?{to:e.nextStepLink.to,"aria-label":"Next Step"}:null})]})]}),r.jsx(Q,{})]})})}function gr(){return r.jsx(J,{statusHandlers:{404:()=>r.jsx("p",{children:"Sorry, we couldn't find an app here."})}})}export{gr as ErrorBoundary,vr as default,hr as meta};
2
+ //# sourceMappingURL=_layout-BN0qitsj.js.map