@epic-web/workshop-app 6.72.0 → 6.72.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.
- package/build/client/assets/{_-dWSrc4Ox.js → _-C4AWl_1u.js} +2 -2
- package/build/client/assets/{_-dWSrc4Ox.js.map → _-C4AWl_1u.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber-FdJ9Amz3.js → _exerciseNumber-DUwXPNgl.js} +2 -2
- package/build/client/assets/{_exerciseNumber-FdJ9Amz3.js.map → _exerciseNumber-DUwXPNgl.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_._stepNumber.index-WLW-sVZ0.js → _exerciseNumber_._stepNumber.index-BPqMtmN8.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber.index-WLW-sVZ0.js.map → _exerciseNumber_._stepNumber.index-BPqMtmN8.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_.finished-Z7QZ9wk-.js → _exerciseNumber_.finished-C4sVkuEq.js} +2 -2
- package/build/client/assets/{_exerciseNumber_.finished-Z7QZ9wk-.js.map → _exerciseNumber_.finished-C4sVkuEq.js.map} +1 -1
- package/build/client/assets/{_extra-UkIdJCI9.js → _extra-DkiDFYVP.js} +2 -2
- package/build/client/assets/{_extra-UkIdJCI9.js.map → _extra-DkiDFYVP.js.map} +1 -1
- package/build/client/assets/{_layout-CjWZzKD8.js → _layout-C9vSX5Ti.js} +2 -2
- package/build/client/assets/{_layout-CjWZzKD8.js.map → _layout-C9vSX5Ti.js.map} +1 -1
- package/build/client/assets/{_layout-DQM0capK.js → _layout-DDTXkx2z.js} +2 -2
- package/build/client/assets/{_layout-DQM0capK.js.map → _layout-DDTXkx2z.js.map} +1 -1
- package/build/client/assets/{entry.client-DSlySyW6.js → entry.client-DdbTov6T.js} +3 -3
- package/build/client/assets/{entry.client-DSlySyW6.js.map → entry.client-DdbTov6T.js.map} +1 -1
- package/build/client/assets/{error-boundary-DVp6wKiz.js → error-boundary-DxHqAEHX.js} +3 -3
- package/build/client/assets/{error-boundary-DVp6wKiz.js.map → error-boundary-DxHqAEHX.js.map} +1 -1
- package/build/client/assets/{finished-PFz2gTpr.js → finished-BW_4ow3n.js} +2 -2
- package/build/client/assets/{finished-PFz2gTpr.js.map → finished-BW_4ow3n.js.map} +1 -1
- package/build/client/assets/{index-DkDXAMak.js → index-BgExztV_.js} +2 -2
- package/build/client/assets/{index-DkDXAMak.js.map → index-BgExztV_.js.map} +1 -1
- package/build/client/assets/{index-DuFMeXSm.js → index-DroM8fzS.js} +2 -2
- package/build/client/assets/{index-DuFMeXSm.js.map → index-DroM8fzS.js.map} +1 -1
- package/build/client/assets/{index-CATk0s1i.js → index-IgBUhsxX.js} +2 -2
- package/build/client/assets/{index-CATk0s1i.js.map → index-IgBUhsxX.js.map} +1 -1
- package/build/client/assets/{index-DfT8l3cx.js → index-PKjGT1Rp.js} +2 -2
- package/build/client/assets/{index-DfT8l3cx.js.map → index-PKjGT1Rp.js.map} +1 -1
- package/build/client/assets/index.client-CsIUPfXc.js +500 -0
- package/build/client/assets/index.client-CsIUPfXc.js.map +1 -0
- package/build/client/assets/{manifest-6451f320.js → manifest-9e0c0428.js} +1 -1
- package/build/client/assets/progress-BcA4i0iU.js +2 -0
- package/build/client/assets/progress-BcA4i0iU.js.map +1 -0
- package/build/client/assets/{root-CB01jtcy.js → root-CKcj2hDc.js} +3 -3
- package/build/client/assets/{root-CB01jtcy.js.map → root-CKcj2hDc.js.map} +1 -1
- package/build/server/index.js +16 -2
- package/build/server/index.js.map +1 -1
- package/package.json +9 -9
- package/build/client/assets/index.client-B5fbXzJV.js +0 -500
- package/build/client/assets/index.client-B5fbXzJV.js.map +0 -1
- package/build/client/assets/progress-ILaVQtOO.js +0 -2
- package/build/client/assets/progress-ILaVQtOO.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{w as $e,b as oe,O as Be,L as i,i as xe,u as pe,p as v}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{c as h,I as g,a as x,n as H,o as I}from"./misc-W4055b-0.js";import{r as C}from"./index-CqIc3cxq.js";import{a as ze}from"./pe-CIZUOJMr.js";import{u as le,O as K}from"./onboarding-indicator-B-XR90_G.js";import{L as M}from"./product-CvyMpYD_.js";import{u as Re}from"./revalidation-ws-BJWJviUX.js";import{S as Y}from"./status-indicator-C6DiLYL5.js";import{D as Ve,f as Ue,a as Fe,b as We,d as Ye}from"./dialog-CzO65Z5w.js";import{R as qe,T as Qe,P as Ke,C as Oe}from"./index-CmflCPTU.js";import{S as E,m as Je,T as ee,j as te,k as se}from"./tooltip-Tlsyx2YO.js";import{c as G,b as Ge}from"./user-BsPobzjB.js";import{u as ge}from"./workshop-config-Zfc8zU0x.js";import{u as je}from"./online-DiNLkgTC.js";import{u as ie,g as be,p as Xe}from"./presence-VCvV2mg7.js";import{b as ve,a as we}from"./root-loader-BOzEMapJ.js";import{b as Ze,s as Ne,c as Me,d as et,e as ye,f as ke,m as f,u as tt,g as st}from"./progress-ILaVQtOO.js";import{T as O}from"./index-CdzVFL-Z.js";import"./schemas-Uj5SZtvt.js";import"./index-ynYvVAOK.js";import"./index-vDCSPjrM.js";import"./coerce-CkHW0SMv.js";function nt(t){t.values.forEach(n=>n.stop())}function re(t,n){[...n].reverse().forEach(o=>{const r=t.getVariant(o);r&&Ne(t,r),t.variantChildren&&t.variantChildren.forEach(l=>{re(l,n)})})}function rt(t,n){if(Array.isArray(n))return re(t,n);if(typeof n=="string")return re(t,[n]);Ne(t,n)}function at(){const t=new Set,n={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,o){const r=[];return t.forEach(l=>{r.push(Ze(l,s,{transitionOverride:o}))}),Promise.all(r)},set(s){return t.forEach(o=>{rt(o,s)})},stop(){t.forEach(s=>{nt(s)})},mount(){return()=>{n.stop()}}};return n}function ae(){const t=Me(at);return et(t.mount,[]),t}function ot(t,n){function s(){return window.matchMedia(t).matches}function o(r){const l=window.matchMedia(t);return l.addEventListener("change",r),()=>{l.removeEventListener("change",r)}}return function(){return C.useSyncExternalStore(o,s,()=>n)}}function Ee({...t}){return e.jsx(qe,{...t})}function J({...t}){return e.jsx(Qe,{...t})}function Ce({className:t,align:n="center",sideOffset:s=4,...o}){return e.jsx(Ke,{children:e.jsx(Oe,{align:n,sideOffset:s,className:h("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-2 shadow-md outline-none",t),...o})})}const fe=["opacity-70","opacity-80","opacity-90","opacity-100"],he=["shadow-[0_0_2px_0_rgba(0,0,0,0.3)]","shadow-[0_0_4px_0_rgba(0,0,0,0.3)]","shadow-[0_0_7px_0_rgba(0,0,0,0.3)]","shadow-[0_0_10px_0_rgba(0,0,0,0.3)]"];function me(t){const n=Math.round(t*fe.length-1),s=Math.round(t*he.length-1);return h("shadow-highlight hover:opacity-100 focus:opacity-100",fe[n]??"opacity-60",he[s]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function Pe({isMenuOpened:t}){const n=G(),{users:s}=ie(),{product:{displayNameShort:o}}=ge(),r=t?17:0,l=s.length-r,m=l>(t?1:0);if(!s.length)return null;const d=t&&s.length===1?e.jsx(i,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:h("h-8 w-8 rounded-full border object-cover",me(1)),src:"/img/tiffany.png"})}):null,p=`${l}${t?" more ":" "}${o} Dev${l===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(Je,{children:[(m?s.slice(0,r):s).map(({user:u,score:D})=>{const P=me(D),w=it(u),A=u.imageUrlSmall||u.avatarUrl,S=u.hasAccess,_=w.some(k=>k.origin?.includes("localhost")),T=ct(w),j=lt(u.loggedInProductHosts);if(u.optOut)return e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsx("div",{className:"relative","aria-label":"Anonymous user (opted out)",children:e.jsx("div",{className:h("bg-muted flex h-8 w-8 items-center justify-center rounded-full border opacity-50"),children:e.jsx(g,{name:"User"})})})}),e.jsx(se,{children:e.jsx("span",{className:"flex flex-col items-center justify-center gap-1",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,"Anonymous (opted out of sharing)"]})})})]},u.id);let L;return S?L=_?"working":"referencing":L=_?"previewing":"reviewing",e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsxs("div",{className:"relative","aria-label":u.name||`${o} Dev`,children:[A?e.jsx("img",{alt:u.name||o,className:h("h-8 w-8 rounded-full border object-cover",P),src:A}):e.jsx("div",{className:h("flex h-8 w-8 items-center justify-center rounded-full border",P),children:e.jsx(g,{name:"User"})}),T?e.jsx("span",{className:"absolute -top-1 -left-1 text-xs leading-none","aria-label":"Workshop products",children:T}):null]})}),e.jsx(se,{children:e.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,u.name||`${o} Dev`,w.length>0?` is ${L} ${D===1&&n?.id!==u.id?"with you":""} on`:null]}),w.map((k,V)=>{const b=dt(k);return b?e.jsxs("span",{className:h("flex flex-col items-center",w.length>1?"border-border mt-1 border-t pt-1 first:mt-0 first:border-t-0 first:pt-0":""),children:[b.line1?e.jsxs("span",{children:[be(k.productHost)," ",b.line1]}):null,b.line2?e.jsx("span",{className:"text-muted-foreground text-xs",children:b.line2}):null]},`${k.workshopTitle}-${V}`):null})]})})]},u.id)}),d,m?e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsx("div",{"aria-label":p,className:h("bg-accent text-accent-foreground flex items-center justify-center rounded-full border text-xs",t?"h-8 w-8":"h-6 w-6"),children:e.jsx("span",{className:h("pointer-events-none truncate text-center",t?"w-8":"w-6"),children:t?`+${l}`:l})})}),e.jsx(se,{children:p})]}):null]})})}function lt(t){return!t||t.length===0?null:t.map(n=>Xe[n]).filter(Boolean).join(" ")}function it(t){return t.locations&&t.locations.length>0?t.locations.filter(Boolean):t.location?[t.location]:[]}function ct(t){const n=new Set;for(const s of t)s.productHost&&n.add(s.productHost);return n.size===0?null:Array.from(n).map(s=>be(s)).filter(Boolean).join("")}function Se(t){return t.some(n=>{const s=n.relativePath.split(/[\\/]/)[0];return s==="extra"||s==="example"||s==="examples"})}const Le=ot("(min-width: 640px)",!0),zt=$e(function(){const n=oe(),s=G(),o=Le(),r=ze(),[l,m]=C.useState(n.isMenuOpened);Re({watchPaths:["./exercises/README.mdx","./extra","./example","./examples"]});function d(p){m(p),document.cookie=`es_menu_open=${p.toString()}; path=/; SameSite=Lax;`}return e.jsxs("div",{className:"flex flex-col",children:[s?null:e.jsx(ut,{}),r&&o?null:e.jsx(ht,{isMenuOpened:l,onMenuOpenChange:d}),e.jsxs("div",{className:h("flex grow flex-col sm:flex-row",{"h-[calc(100vh-128px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!s,"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":s,"h-[unset]":!o&&l}),children:[o?e.jsx(mt,{isMenuOpened:l,onMenuOpenChange:d}):null,e.jsx("div",{className:h("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",l?"hidden md:block":""),children:e.jsx(Be,{})})]})]})});function dt(t){if(!t)return null;const{exercise:n}=t,s=[n?[n.exerciseNumber,n.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,n?.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:s}}function ut(){const t=Le(),{product:{host:n,displayName:s}}=ge(),o=Ge(),[r,l]=le("login-button"),m=e.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:["This is the deployed version. ",e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):o?e.jsxs("div",{children:[e.jsx(i,{to:"/login",className:"underline",children:"Login"})," ","or"," ",e.jsx("a",{href:`https://${n}/login`,className:"underline",children:"join for free"})," ","for the full experience."]}):null});return e.jsx("div",{className:"from-highlight to-info text-info-foreground z-10 flex h-16 items-center justify-between border-b bg-linear-to-tr pl-4",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden flex-1 flex-wrap items-center gap-4 sm:flex",children:[e.jsx(M,{size:"lg",style:"monochrome"}),e.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[e.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",target:"_blank",children:s})," ","Workshop app!"]}),m]})]}),o?null:e.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsxs("span",{className:"drop-shadow-sm",children:["Join ",s]}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),r?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4 sm:hidden",children:[e.jsx("a",{href:`https://${n}`,children:e.jsx(M,{size:"lg",style:"monochrome"})}),e.jsxs(Ve,{children:[e.jsx(Ue,{children:e.jsx(g,{name:"Question",size:"lg",className:"animate-pulse"})}),e.jsxs(Fe,{children:[e.jsxs(We,{children:[e.jsx(M,{size:"lg",style:"monochrome"}),e.jsx("span",{className:"text-lg font-semibold",children:s})]}),e.jsxs(Ye,{children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",children:s})," ","Workshop app!"]}),m]})]})]}),o?null:e.jsxs("div",{className:"flex h-full items-center",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsx("span",{className:"drop-shadow-sm",children:"Join"}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),r?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]})})}const ce={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Ie({exerciseNumber:t,children:n}){const s=tt(t);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:n})})}function z({children:t,...n}){const s=st(n);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:t})})}function De({children:t}){return e.jsx(f.li,{variants:ce,className:"py-[6px] first:pt-3 last:pb-3",children:e.jsx("span",{className:"inline-block pl-2",children:t})})}const ft='relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]';function R(t,n){return x(ft,n,{"bg-foreground text-background":t})}function ht({isMenuOpened:t,onMenuOpenChange:n}){const s=oe(),o=ve(),r=G(),l=ye(),m=ke(),d=xe(),p=pe(),u=je(),{users:D}=ie(),[P,w]=le("account-link"),A=Se(o),S=s.extras.find(c=>c.name===s.playground.appName),_=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!S&&!_,j={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},k=we().session.theme??"system",V={light:"Light",dark:"Dark",system:"System"}[k],[b,U]=C.useState(!1),q=!!s.sidecarStatus;return C.useEffect(()=>{q||U(!1)},[q]),e.jsx("nav",{className:"flex w-full border-b sm:hidden",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:h("flex items-center",{"flex-col":t,"h-14":!t}),children:[e.jsx(He,{title:s.workshopTitle,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{className:"scrollbar-thin scrollbar-thumb-scrollbar flex w-full grow flex-col justify-between overflow-x-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"Home"})}),s.exercises.map(({exerciseNumber:c,title:F,steps:$})=>{const W=Number(d.exerciseNumber)===c,a=!W&&s.playground.exerciseNumber===c;return e.jsxs(Ie,{exerciseNumber:c,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(c),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":W}),children:F}),a?e.jsx(i,{to:I(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),W?e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(z,{type:"instructions",exerciseNumber:c,children:e.jsx(i,{to:H(c),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},c),$.filter(Boolean).map(({stepNumber:N,title:X,problem:B,solution:Q})=>e.jsx(z,{type:"step",stepNumber:N,exerciseNumber:c,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:I(c,N),prefetch:"intent",className:"leading-tight font-semibold",children:[N.toString().padStart(2,"0"),"."," ",X]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[B&&e.jsxs(v,{to:I(c,N,"problem"),prefetch:"intent",className:({isActive:y})=>R(y),children:["Problem",B.name===s.playground.appName?" 🛝":""]}),Q&&e.jsxs(v,{to:I(c,N,"solution"),prefetch:"intent",className:({isActive:y})=>R(y),children:["Solution",Q.name===s.playground.appName?" 🛝":""]})]})]})},N)),e.jsx(z,{type:"finished",exerciseNumber:c,children:e.jsx(v,{to:H(c,"finished"),prefetch:"intent",className:({isActive:N})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":N}),children:"📝 Elaboration"})})]}):null]},c)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"📚 Extras"}),T&&S?e.jsx(i,{to:`/extra/${S.dirName}`,prefetch:"intent",children:"🛝"}):null]}),_&&s.extras.length?e.jsx(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(c=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${c.dirName}`,prefetch:"intent",className:({isActive:F})=>R(F,"leading-tight font-semibold"),children:[c.title,c.name===s.playground.appName?" 🛝":""]})},c.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:c})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':c}),children:"📝 Workshop Feedback"})})]}),e.jsx("div",{className:"grow"}),u?null:e.jsx(E,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex h-14 animate-pulse items-center justify-start p-4",t?"w-full border-t":"border-l"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?"You are offline":null})})}),e.jsx("div",{className:h("flex items-center justify-start p-4",t&&D.length>4?"min-h-14":"h-14",t?"w-full border-t":"border-l"),children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:r?e.jsx(E,{content:t?null:"Your account",children:e.jsxs(i,{className:h("relative flex h-14 shrink-0 items-center justify-start space-x-3 px-4 py-4 text-center no-underline hover:underline",{"border-l":!t,"w-full border-t":t}),to:"/account",onClick:w,children:[r.imageUrlSmall?e.jsx("img",{alt:r.name??r.email,src:r.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),P?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&l?e.jsx(E,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&m?e.jsx(E,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:h("flex h-14 items-center justify-center gap-2 self-start p-4 sm:mb-4",{"w-full border-t":t,"w-14 border-l":!t}),children:t?e.jsxs(e.Fragment,{children:[e.jsx(O,{}),e.jsx(_e,{status:s.sidecarStatus})]}):q?e.jsxs(Ee,{open:b,onOpenChange:U,children:[s.sidecarStatus?.hasFailure?e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:b?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:"failed"})})}):e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:b?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:V,disableTooltip:b}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(Y,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]}):e.jsx(O,{})})]})})})}const ne=400;function _e({status:t}){return t?e.jsx(E,{content:t.hasFailure?`${t.failureCount} sidecar${t.failureCount===1?"":"s"} failed`:"All sidecars running",children:e.jsx(i,{to:"/admin",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:t.hasFailure?"failed":"running"})})}):null}function mt({isMenuOpened:t,onMenuOpenChange:n}){const s=oe(),o=ve(),r=G(),l=ye(),m=ke(),d=xe(),p=pe(),u=je(),{users:D}=ie(),[P,w]=le("account-link"),A=Se(o),S=s.extras.find(a=>a.name===s.playground.appName),_=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!S&&!_,j=s.exercises.find(a=>a.exerciseNumber===Number(d.exerciseNumber)),L=d.type==="solution"?j?.solutions.find(a=>a.stepNumber===Number(d.stepNumber)):d.type==="problem"?j?.problems.find(a=>a.stepNumber===Number(d.stepNumber)):null,k=ae(),V={close:{width:56},open:{width:ne}},b={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},U=C.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]),c=we().session.theme??"system",F={light:"Light",dark:"Dark",system:"System"}[c],[$,W]=C.useState(!1);return e.jsx("nav",{className:"hidden border-r sm:flex",children:e.jsx(f.div,{initial:t?"open":"close",variants:V,animate:k,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(He,{title:s.workshopTitle,menuControls:k,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{style:{width:ne},className:"scrollbar-thin scrollbar-thumb-scrollbar flex grow flex-col justify-between overflow-y-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:a})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":a}),children:"Home"})}),s.exercises.map(({exerciseNumber:a,title:N,steps:X})=>{const B=Number(d.exerciseNumber)===a,Q=!B&&s.playground.exerciseNumber===a;return e.jsxs(Ie,{exerciseNumber:a,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(a),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":B}),children:N}),Q?e.jsx(i,{to:I(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),B?e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(z,{type:"instructions",exerciseNumber:a,children:e.jsx(i,{to:H(a),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},a),X.filter(Boolean).map(({stepNumber:y,title:Te,problem:de,solution:ue})=>e.jsx(z,{type:"step",stepNumber:y,exerciseNumber:a,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:I(a,y),prefetch:"intent",className:"leading-tight font-semibold",children:[y.toString().padStart(2,"0"),"."," ",Te]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[de&&e.jsxs(v,{to:I(a,y,"problem"),prefetch:"intent",className:({isActive:Z})=>R(Z),children:["Problem",de.name===s.playground.appName?" 🛝":""]}),ue&&e.jsxs(v,{to:I(a,y,"solution"),prefetch:"intent",className:({isActive:Z})=>R(Z),children:["Solution",ue.name===s.playground.appName?" 🛝":""]})]})]})},y)),e.jsx(z,{type:"finished",exerciseNumber:a,children:e.jsx(v,{to:H(a,"finished"),prefetch:"intent",className:({isActive:y})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":y}),children:"📝 Elaboration"})})]}):null]},a)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:a})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":a}),children:"📚 Extras"}),T&&S?e.jsx(i,{to:`/extra/${S.dirName}`,prefetch:"intent",children:"🛝"}):null]}),_&&s.extras.length?e.jsx(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(a=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${a.dirName}`,prefetch:"intent",className:({isActive:N})=>R(N,"leading-tight font-semibold"),children:[a.title,a.name===s.playground.appName?" 🛝":""]})},a.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:a})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':a}),children:"📝 Workshop Feedback"})})]}),!t&&e.jsx("div",{className:"flex grow flex-col justify-center",children:e.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm leading-none font-medium uppercase",children:[j?.title?e.jsx(i,{to:H(Number(d.exerciseNumber)),children:j.title}):null,j?.title&&L?.title?" — ":null,L?.title?e.jsx(i,{to:I(Number(d.exerciseNumber),L.stepNumber),children:L.title}):null]})}),u?null:e.jsx(E,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex w-full animate-pulse items-center border-t p-4",t?"justify-start":"justify-center"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?e.jsx("span",{className:"whitespace-nowrap",children:"You are offline"}):null})})}),e.jsx("div",{className:h("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&D.length>4?"h-28":"h-14"),style:t?{width:ne}:{},children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:r?e.jsx(E,{content:t?null:"Your account",children:e.jsxs(i,{className:"relative flex h-14 w-full shrink-0 items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",onClick:w,children:[r.imageUrlSmall?e.jsx("img",{alt:r.name??r.email,src:r.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),P?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&l?e.jsx(E,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&m?e.jsx(E,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:"mb-4 w-full self-start border-t pt-[15px] pl-3",children:t?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{}),e.jsx(E,{content:"Keyboard shortcuts (press ?)",children:e.jsx("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,className:"text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring flex h-8 w-8 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:ring-offset-2",children:e.jsx(g,{name:"Question",size:"md"})})}),e.jsx(_e,{status:s.sidecarStatus})]}):e.jsxs(Ee,{open:$,onOpenChange:W,children:[s.sidecarStatus?.hasFailure?e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:$?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:"failed"})})}):e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:$?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:F,disableTooltip:$}),e.jsxs("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(g,{name:"Question",size:"md"})}),e.jsx("span",{className:"flex-1 text-left",children:"Keyboard shortcuts"})]}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(Y,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}function Ae({themeLabel:t,disableTooltip:n}){const s=C.useRef(null),o=r=>{const l=s.current?.querySelector("form");if(!l)return;const m=l.querySelector('button[type="submit"]');m?.contains(r.target)||m?.click()};return e.jsxs("div",{ref:s,onClick:o,className:"hover:bg-muted flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(O,{disableTooltip:n})}),e.jsxs("span",{className:"flex-1 text-left",children:[t," theme"]})]})}function He({title:t,isMenuOpened:n,setMenuOpened:s,menuControls:o}){const r=C.useRef(n),l=C.useRef(null),m={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},d={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},p=ae(),u=ae();async function D(){o?.start(n?"close":"open"),s(!n),n?(p.start(m.closed),await u.start(d.moving),u.start(d.closed)):(await u.start(d.moving),p.start(m.open),u.start(d.open))}return C.useEffect(()=>{if(!n)return;function P(w){if(w.key!=="Escape"||w.defaultPrevented)return;!!document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||l.current?.click()}return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[n]),e.jsxs("div",{className:h("relative inline-flex h-14 shrink-0 items-center justify-between overflow-hidden border-r sm:w-full sm:border-r-0 sm:border-b",{"w-full":n}),children:[e.jsx("button",{ref:l,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:D,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(f.path,{...m[r.current?"open":"closed"],animate:p,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(f.path,{...d[r.current?"open":"closed"],animate:u,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),n&&e.jsx(f.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 font-mono text-sm whitespace-nowrap uppercase",children:e.jsx(i,{to:"/",children:t})})]})}export{zt as default};
|
|
2
|
-
//# sourceMappingURL=_layout-
|
|
1
|
+
import{w as $e,b as oe,O as Be,L as i,i as xe,u as pe,p as v}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{c as h,I as g,a as x,n as H,o as I}from"./misc-W4055b-0.js";import{r as C}from"./index-CqIc3cxq.js";import{a as ze}from"./pe-CIZUOJMr.js";import{u as le,O as K}from"./onboarding-indicator-B-XR90_G.js";import{L as M}from"./product-CvyMpYD_.js";import{u as Re}from"./revalidation-ws-BJWJviUX.js";import{S as Y}from"./status-indicator-C6DiLYL5.js";import{D as Ve,f as Ue,a as Fe,b as We,d as Ye}from"./dialog-CzO65Z5w.js";import{R as qe,T as Qe,P as Ke,C as Oe}from"./index-CmflCPTU.js";import{S as E,m as Je,T as ee,j as te,k as se}from"./tooltip-Tlsyx2YO.js";import{c as G,b as Ge}from"./user-BsPobzjB.js";import{u as ge}from"./workshop-config-Zfc8zU0x.js";import{u as je}from"./online-DiNLkgTC.js";import{u as ie,g as be,p as Xe}from"./presence-VCvV2mg7.js";import{b as ve,a as we}from"./root-loader-BOzEMapJ.js";import{b as Ze,s as Ne,c as Me,d as et,e as ye,f as ke,m as f,u as tt,g as st}from"./progress-BcA4i0iU.js";import{T as O}from"./index-CdzVFL-Z.js";import"./schemas-Uj5SZtvt.js";import"./index-ynYvVAOK.js";import"./index-vDCSPjrM.js";import"./coerce-CkHW0SMv.js";function nt(t){t.values.forEach(n=>n.stop())}function re(t,n){[...n].reverse().forEach(o=>{const r=t.getVariant(o);r&&Ne(t,r),t.variantChildren&&t.variantChildren.forEach(l=>{re(l,n)})})}function rt(t,n){if(Array.isArray(n))return re(t,n);if(typeof n=="string")return re(t,[n]);Ne(t,n)}function at(){const t=new Set,n={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,o){const r=[];return t.forEach(l=>{r.push(Ze(l,s,{transitionOverride:o}))}),Promise.all(r)},set(s){return t.forEach(o=>{rt(o,s)})},stop(){t.forEach(s=>{nt(s)})},mount(){return()=>{n.stop()}}};return n}function ae(){const t=Me(at);return et(t.mount,[]),t}function ot(t,n){function s(){return window.matchMedia(t).matches}function o(r){const l=window.matchMedia(t);return l.addEventListener("change",r),()=>{l.removeEventListener("change",r)}}return function(){return C.useSyncExternalStore(o,s,()=>n)}}function Ee({...t}){return e.jsx(qe,{...t})}function J({...t}){return e.jsx(Qe,{...t})}function Ce({className:t,align:n="center",sideOffset:s=4,...o}){return e.jsx(Ke,{children:e.jsx(Oe,{align:n,sideOffset:s,className:h("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-2 shadow-md outline-none",t),...o})})}const fe=["opacity-70","opacity-80","opacity-90","opacity-100"],he=["shadow-[0_0_2px_0_rgba(0,0,0,0.3)]","shadow-[0_0_4px_0_rgba(0,0,0,0.3)]","shadow-[0_0_7px_0_rgba(0,0,0,0.3)]","shadow-[0_0_10px_0_rgba(0,0,0,0.3)]"];function me(t){const n=Math.round(t*fe.length-1),s=Math.round(t*he.length-1);return h("shadow-highlight hover:opacity-100 focus:opacity-100",fe[n]??"opacity-60",he[s]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function Pe({isMenuOpened:t}){const n=G(),{users:s}=ie(),{product:{displayNameShort:o}}=ge(),r=t?17:0,l=s.length-r,m=l>(t?1:0);if(!s.length)return null;const d=t&&s.length===1?e.jsx(i,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:h("h-8 w-8 rounded-full border object-cover",me(1)),src:"/img/tiffany.png"})}):null,p=`${l}${t?" more ":" "}${o} Dev${l===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(Je,{children:[(m?s.slice(0,r):s).map(({user:u,score:D})=>{const P=me(D),w=it(u),A=u.imageUrlSmall||u.avatarUrl,S=u.hasAccess,_=w.some(k=>k.origin?.includes("localhost")),T=ct(w),j=lt(u.loggedInProductHosts);if(u.optOut)return e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsx("div",{className:"relative","aria-label":"Anonymous user (opted out)",children:e.jsx("div",{className:h("bg-muted flex h-8 w-8 items-center justify-center rounded-full border opacity-50"),children:e.jsx(g,{name:"User"})})})}),e.jsx(se,{children:e.jsx("span",{className:"flex flex-col items-center justify-center gap-1",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,"Anonymous (opted out of sharing)"]})})})]},u.id);let L;return S?L=_?"working":"referencing":L=_?"previewing":"reviewing",e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsxs("div",{className:"relative","aria-label":u.name||`${o} Dev`,children:[A?e.jsx("img",{alt:u.name||o,className:h("h-8 w-8 rounded-full border object-cover",P),src:A}):e.jsx("div",{className:h("flex h-8 w-8 items-center justify-center rounded-full border",P),children:e.jsx(g,{name:"User"})}),T?e.jsx("span",{className:"absolute -top-1 -left-1 text-xs leading-none","aria-label":"Workshop products",children:T}):null]})}),e.jsx(se,{children:e.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,u.name||`${o} Dev`,w.length>0?` is ${L} ${D===1&&n?.id!==u.id?"with you":""} on`:null]}),w.map((k,V)=>{const b=dt(k);return b?e.jsxs("span",{className:h("flex flex-col items-center",w.length>1?"border-border mt-1 border-t pt-1 first:mt-0 first:border-t-0 first:pt-0":""),children:[b.line1?e.jsxs("span",{children:[be(k.productHost)," ",b.line1]}):null,b.line2?e.jsx("span",{className:"text-muted-foreground text-xs",children:b.line2}):null]},`${k.workshopTitle}-${V}`):null})]})})]},u.id)}),d,m?e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,tabIndex:0,children:e.jsx("div",{"aria-label":p,className:h("bg-accent text-accent-foreground flex items-center justify-center rounded-full border text-xs",t?"h-8 w-8":"h-6 w-6"),children:e.jsx("span",{className:h("pointer-events-none truncate text-center",t?"w-8":"w-6"),children:t?`+${l}`:l})})}),e.jsx(se,{children:p})]}):null]})})}function lt(t){return!t||t.length===0?null:t.map(n=>Xe[n]).filter(Boolean).join(" ")}function it(t){return t.locations&&t.locations.length>0?t.locations.filter(Boolean):t.location?[t.location]:[]}function ct(t){const n=new Set;for(const s of t)s.productHost&&n.add(s.productHost);return n.size===0?null:Array.from(n).map(s=>be(s)).filter(Boolean).join("")}function Se(t){return t.some(n=>{const s=n.relativePath.split(/[\\/]/)[0];return s==="extra"||s==="example"||s==="examples"})}const Le=ot("(min-width: 640px)",!0),zt=$e(function(){const n=oe(),s=G(),o=Le(),r=ze(),[l,m]=C.useState(n.isMenuOpened);Re({watchPaths:["./exercises/README.mdx","./extra","./example","./examples"]});function d(p){m(p),document.cookie=`es_menu_open=${p.toString()}; path=/; SameSite=Lax;`}return e.jsxs("div",{className:"flex flex-col",children:[s?null:e.jsx(ut,{}),r&&o?null:e.jsx(ht,{isMenuOpened:l,onMenuOpenChange:d}),e.jsxs("div",{className:h("flex grow flex-col sm:flex-row",{"h-[calc(100vh-128px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!s,"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":s,"h-[unset]":!o&&l}),children:[o?e.jsx(mt,{isMenuOpened:l,onMenuOpenChange:d}):null,e.jsx("div",{className:h("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",l?"hidden md:block":""),children:e.jsx(Be,{})})]})]})});function dt(t){if(!t)return null;const{exercise:n}=t,s=[n?[n.exerciseNumber,n.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,n?.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:s}}function ut(){const t=Le(),{product:{host:n,displayName:s}}=ge(),o=Ge(),[r,l]=le("login-button"),m=e.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:["This is the deployed version. ",e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):o?e.jsxs("div",{children:[e.jsx(i,{to:"/login",className:"underline",children:"Login"})," ","or"," ",e.jsx("a",{href:`https://${n}/login`,className:"underline",children:"join for free"})," ","for the full experience."]}):null});return e.jsx("div",{className:"from-highlight to-info text-info-foreground z-10 flex h-16 items-center justify-between border-b bg-linear-to-tr pl-4",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden flex-1 flex-wrap items-center gap-4 sm:flex",children:[e.jsx(M,{size:"lg",style:"monochrome"}),e.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[e.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",target:"_blank",children:s})," ","Workshop app!"]}),m]})]}),o?null:e.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsxs("span",{className:"drop-shadow-sm",children:["Join ",s]}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),r?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4 sm:hidden",children:[e.jsx("a",{href:`https://${n}`,children:e.jsx(M,{size:"lg",style:"monochrome"})}),e.jsxs(Ve,{children:[e.jsx(Ue,{children:e.jsx(g,{name:"Question",size:"lg",className:"animate-pulse"})}),e.jsxs(Fe,{children:[e.jsxs(We,{children:[e.jsx(M,{size:"lg",style:"monochrome"}),e.jsx("span",{className:"text-lg font-semibold",children:s})]}),e.jsxs(Ye,{children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",children:s})," ","Workshop app!"]}),m]})]})]}),o?null:e.jsxs("div",{className:"flex h-full items-center",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsx("span",{className:"drop-shadow-sm",children:"Join"}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),r?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]})})}const ce={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Ie({exerciseNumber:t,children:n}){const s=tt(t);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:n})})}function z({children:t,...n}){const s=st(n);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:t})})}function De({children:t}){return e.jsx(f.li,{variants:ce,className:"py-[6px] first:pt-3 last:pb-3",children:e.jsx("span",{className:"inline-block pl-2",children:t})})}const ft='relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]';function R(t,n){return x(ft,n,{"bg-foreground text-background":t})}function ht({isMenuOpened:t,onMenuOpenChange:n}){const s=oe(),o=ve(),r=G(),l=ye(),m=ke(),d=xe(),p=pe(),u=je(),{users:D}=ie(),[P,w]=le("account-link"),A=Se(o),S=s.extras.find(c=>c.name===s.playground.appName),_=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!S&&!_,j={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},k=we().session.theme??"system",V={light:"Light",dark:"Dark",system:"System"}[k],[b,U]=C.useState(!1),q=!!s.sidecarStatus;return C.useEffect(()=>{q||U(!1)},[q]),e.jsx("nav",{className:"flex w-full border-b sm:hidden",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:h("flex items-center",{"flex-col":t,"h-14":!t}),children:[e.jsx(He,{title:s.workshopTitle,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{className:"scrollbar-thin scrollbar-thumb-scrollbar flex w-full grow flex-col justify-between overflow-x-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"Home"})}),s.exercises.map(({exerciseNumber:c,title:F,steps:$})=>{const W=Number(d.exerciseNumber)===c,a=!W&&s.playground.exerciseNumber===c;return e.jsxs(Ie,{exerciseNumber:c,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(c),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":W}),children:F}),a?e.jsx(i,{to:I(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),W?e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(z,{type:"instructions",exerciseNumber:c,children:e.jsx(i,{to:H(c),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},c),$.filter(Boolean).map(({stepNumber:N,title:X,problem:B,solution:Q})=>e.jsx(z,{type:"step",stepNumber:N,exerciseNumber:c,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:I(c,N),prefetch:"intent",className:"leading-tight font-semibold",children:[N.toString().padStart(2,"0"),"."," ",X]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[B&&e.jsxs(v,{to:I(c,N,"problem"),prefetch:"intent",className:({isActive:y})=>R(y),children:["Problem",B.name===s.playground.appName?" 🛝":""]}),Q&&e.jsxs(v,{to:I(c,N,"solution"),prefetch:"intent",className:({isActive:y})=>R(y),children:["Solution",Q.name===s.playground.appName?" 🛝":""]})]})]})},N)),e.jsx(z,{type:"finished",exerciseNumber:c,children:e.jsx(v,{to:H(c,"finished"),prefetch:"intent",className:({isActive:N})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":N}),children:"📝 Elaboration"})})]}):null]},c)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"📚 Extras"}),T&&S?e.jsx(i,{to:`/extra/${S.dirName}`,prefetch:"intent",children:"🛝"}):null]}),_&&s.extras.length?e.jsx(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(c=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${c.dirName}`,prefetch:"intent",className:({isActive:F})=>R(F,"leading-tight font-semibold"),children:[c.title,c.name===s.playground.appName?" 🛝":""]})},c.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:c})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':c}),children:"📝 Workshop Feedback"})})]}),e.jsx("div",{className:"grow"}),u?null:e.jsx(E,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex h-14 animate-pulse items-center justify-start p-4",t?"w-full border-t":"border-l"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?"You are offline":null})})}),e.jsx("div",{className:h("flex items-center justify-start p-4",t&&D.length>4?"min-h-14":"h-14",t?"w-full border-t":"border-l"),children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:r?e.jsx(E,{content:t?null:"Your account",children:e.jsxs(i,{className:h("relative flex h-14 shrink-0 items-center justify-start space-x-3 px-4 py-4 text-center no-underline hover:underline",{"border-l":!t,"w-full border-t":t}),to:"/account",onClick:w,children:[r.imageUrlSmall?e.jsx("img",{alt:r.name??r.email,src:r.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),P?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&l?e.jsx(E,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&m?e.jsx(E,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:h("flex h-14 items-center justify-center gap-2 self-start p-4 sm:mb-4",{"w-full border-t":t,"w-14 border-l":!t}),children:t?e.jsxs(e.Fragment,{children:[e.jsx(O,{}),e.jsx(_e,{status:s.sidecarStatus})]}):q?e.jsxs(Ee,{open:b,onOpenChange:U,children:[s.sidecarStatus?.hasFailure?e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:b?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:"failed"})})}):e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:b?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:V,disableTooltip:b}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(Y,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]}):e.jsx(O,{})})]})})})}const ne=400;function _e({status:t}){return t?e.jsx(E,{content:t.hasFailure?`${t.failureCount} sidecar${t.failureCount===1?"":"s"} failed`:"All sidecars running",children:e.jsx(i,{to:"/admin",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:t.hasFailure?"failed":"running"})})}):null}function mt({isMenuOpened:t,onMenuOpenChange:n}){const s=oe(),o=ve(),r=G(),l=ye(),m=ke(),d=xe(),p=pe(),u=je(),{users:D}=ie(),[P,w]=le("account-link"),A=Se(o),S=s.extras.find(a=>a.name===s.playground.appName),_=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!S&&!_,j=s.exercises.find(a=>a.exerciseNumber===Number(d.exerciseNumber)),L=d.type==="solution"?j?.solutions.find(a=>a.stepNumber===Number(d.stepNumber)):d.type==="problem"?j?.problems.find(a=>a.stepNumber===Number(d.stepNumber)):null,k=ae(),V={close:{width:56},open:{width:ne}},b={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},U=C.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]),c=we().session.theme??"system",F={light:"Light",dark:"Dark",system:"System"}[c],[$,W]=C.useState(!1);return e.jsx("nav",{className:"hidden border-r sm:flex",children:e.jsx(f.div,{initial:t?"open":"close",variants:V,animate:k,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(He,{title:s.workshopTitle,menuControls:k,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{style:{width:ne},className:"scrollbar-thin scrollbar-thumb-scrollbar flex grow flex-col justify-between overflow-y-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:a})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":a}),children:"Home"})}),s.exercises.map(({exerciseNumber:a,title:N,steps:X})=>{const B=Number(d.exerciseNumber)===a,Q=!B&&s.playground.exerciseNumber===a;return e.jsxs(Ie,{exerciseNumber:a,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(a),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":B}),children:N}),Q?e.jsx(i,{to:I(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),B?e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(z,{type:"instructions",exerciseNumber:a,children:e.jsx(i,{to:H(a),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},a),X.filter(Boolean).map(({stepNumber:y,title:Te,problem:de,solution:ue})=>e.jsx(z,{type:"step",stepNumber:y,exerciseNumber:a,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:I(a,y),prefetch:"intent",className:"leading-tight font-semibold",children:[y.toString().padStart(2,"0"),"."," ",Te]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[de&&e.jsxs(v,{to:I(a,y,"problem"),prefetch:"intent",className:({isActive:Z})=>R(Z),children:["Problem",de.name===s.playground.appName?" 🛝":""]}),ue&&e.jsxs(v,{to:I(a,y,"solution"),prefetch:"intent",className:({isActive:Z})=>R(Z),children:["Solution",ue.name===s.playground.appName?" 🛝":""]})]})]})},y)),e.jsx(z,{type:"finished",exerciseNumber:a,children:e.jsx(v,{to:H(a,"finished"),prefetch:"intent",className:({isActive:y})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":y}),children:"📝 Elaboration"})})]}):null]},a)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:a})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":a}),children:"📚 Extras"}),T&&S?e.jsx(i,{to:`/extra/${S.dirName}`,prefetch:"intent",children:"🛝"}):null]}),_&&s.extras.length?e.jsx(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(a=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${a.dirName}`,prefetch:"intent",className:({isActive:N})=>R(N,"leading-tight font-semibold"),children:[a.title,a.name===s.playground.appName?" 🛝":""]})},a.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:a})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':a}),children:"📝 Workshop Feedback"})})]}),!t&&e.jsx("div",{className:"flex grow flex-col justify-center",children:e.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm leading-none font-medium uppercase",children:[j?.title?e.jsx(i,{to:H(Number(d.exerciseNumber)),children:j.title}):null,j?.title&&L?.title?" — ":null,L?.title?e.jsx(i,{to:I(Number(d.exerciseNumber),L.stepNumber),children:L.title}):null]})}),u?null:e.jsx(E,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex w-full animate-pulse items-center border-t p-4",t?"justify-start":"justify-center"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?e.jsx("span",{className:"whitespace-nowrap",children:"You are offline"}):null})})}),e.jsx("div",{className:h("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&D.length>4?"h-28":"h-14"),style:t?{width:ne}:{},children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:r?e.jsx(E,{content:t?null:"Your account",children:e.jsxs(i,{className:"relative flex h-14 w-full shrink-0 items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",onClick:w,children:[r.imageUrlSmall?e.jsx("img",{alt:r.name??r.email,src:r.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),P?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&l?e.jsx(E,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:r&&m?e.jsx(E,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:"mb-4 w-full self-start border-t pt-[15px] pl-3",children:t?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{}),e.jsx(E,{content:"Keyboard shortcuts (press ?)",children:e.jsx("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,className:"text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring flex h-8 w-8 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:ring-offset-2",children:e.jsx(g,{name:"Question",size:"md"})})}),e.jsx(_e,{status:s.sidecarStatus})]}):e.jsxs(Ee,{open:$,onOpenChange:W,children:[s.sidecarStatus?.hasFailure?e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:$?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(Y,{status:"failed"})})}):e.jsx(J,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:$?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:F,disableTooltip:$}),e.jsxs("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(g,{name:"Question",size:"md"})}),e.jsx("span",{className:"flex-1 text-left",children:"Keyboard shortcuts"})]}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(Y,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}function Ae({themeLabel:t,disableTooltip:n}){const s=C.useRef(null),o=r=>{const l=s.current?.querySelector("form");if(!l)return;const m=l.querySelector('button[type="submit"]');m?.contains(r.target)||m?.click()};return e.jsxs("div",{ref:s,onClick:o,className:"hover:bg-muted flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(O,{disableTooltip:n})}),e.jsxs("span",{className:"flex-1 text-left",children:[t," theme"]})]})}function He({title:t,isMenuOpened:n,setMenuOpened:s,menuControls:o}){const r=C.useRef(n),l=C.useRef(null),m={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},d={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},p=ae(),u=ae();async function D(){o?.start(n?"close":"open"),s(!n),n?(p.start(m.closed),await u.start(d.moving),u.start(d.closed)):(await u.start(d.moving),p.start(m.open),u.start(d.open))}return C.useEffect(()=>{if(!n)return;function P(w){if(w.key!=="Escape"||w.defaultPrevented)return;!!document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||l.current?.click()}return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[n]),e.jsxs("div",{className:h("relative inline-flex h-14 shrink-0 items-center justify-between overflow-hidden border-r sm:w-full sm:border-r-0 sm:border-b",{"w-full":n}),children:[e.jsx("button",{ref:l,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:D,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(f.path,{...m[r.current?"open":"closed"],animate:p,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(f.path,{...d[r.current?"open":"closed"],animate:u,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),n&&e.jsx(f.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 font-mono text-sm whitespace-nowrap uppercase",children:e.jsx(i,{to:"/",children:t})})]})}export{zt as default};
|
|
2
|
+
//# sourceMappingURL=_layout-C9vSX5Ti.js.map
|