@epic-web/workshop-app 4.2.1 → 4.2.3

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 (41) hide show
  1. package/build/client/assets/{_exerciseNumber-B_VU-pG1.js → _exerciseNumber-s_qbmGEJ.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-B_VU-pG1.js.map → _exerciseNumber-s_qbmGEJ.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-DldgXnJy.js → _exerciseNumber_.finished-DJgT9oaU.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-DldgXnJy.js.map → _exerciseNumber_.finished-DJgT9oaU.js.map} +1 -1
  5. package/build/client/assets/{_layout-CGXamJB4.js → _layout-49l6Rvwp.js} +2 -2
  6. package/build/client/assets/_layout-49l6Rvwp.js.map +1 -0
  7. package/build/client/assets/{_layout-CPxDcKGb.js → _layout-D7Qo_r0X.js} +2 -2
  8. package/build/client/assets/{_layout-CPxDcKGb.js.map → _layout-D7Qo_r0X.js.map} +1 -1
  9. package/build/client/assets/client-hints-KnbHFIgn.js +36 -0
  10. package/build/client/assets/client-hints-KnbHFIgn.js.map +1 -0
  11. package/build/client/assets/{diff-Blb5EPiO.js → diff-CLRdJhCn.js} +2 -2
  12. package/build/client/assets/{diff-Blb5EPiO.js.map → diff-CLRdJhCn.js.map} +1 -1
  13. package/build/client/assets/{diff-MSYB00VZ.js → diff-CT3-9rtW.js} +2 -2
  14. package/build/client/assets/{diff-MSYB00VZ.js.map → diff-CT3-9rtW.js.map} +1 -1
  15. package/build/client/assets/{epic-video-BwJwnV_j.js → epic-video-Df7qGSN7.js} +2 -2
  16. package/build/client/assets/{epic-video-BwJwnV_j.js.map → epic-video-Df7qGSN7.js.map} +1 -1
  17. package/build/client/assets/{finished-CGll5TOI.js → finished-Dw3SJA8A.js} +2 -2
  18. package/build/client/assets/{finished-CGll5TOI.js.map → finished-Dw3SJA8A.js.map} +1 -1
  19. package/build/client/assets/{index-zG3_j9lj.js → index-CLnz0tXz.js} +2 -2
  20. package/build/client/assets/{index-zG3_j9lj.js.map → index-CLnz0tXz.js.map} +1 -1
  21. package/build/client/assets/{index-DqBktlAI.js → index-YgRENgjt.js} +2 -2
  22. package/build/client/assets/{index-DqBktlAI.js.map → index-YgRENgjt.js.map} +1 -1
  23. package/build/client/assets/{loading-CaagEELb.js → loading-D-DClzm1.js} +2 -2
  24. package/build/client/assets/{loading-CaagEELb.js.map → loading-D-DClzm1.js.map} +1 -1
  25. package/build/client/assets/{login-2BiFV7_R.js → login-CjvZj820.js} +2 -2
  26. package/build/client/assets/{login-2BiFV7_R.js.map → login-CjvZj820.js.map} +1 -1
  27. package/build/client/assets/{manifest-5e8d103b.js → manifest-50f87ab0.js} +1 -1
  28. package/build/client/assets/{mdx-DdywIxB6.js → mdx-ytg-y2nh.js} +2 -2
  29. package/build/client/assets/{mdx-DdywIxB6.js.map → mdx-ytg-y2nh.js.map} +1 -1
  30. package/build/client/assets/{onboarding-eFvyCmxD.js → onboarding-BxcIdiGj.js} +2 -2
  31. package/build/client/assets/{onboarding-eFvyCmxD.js.map → onboarding-BxcIdiGj.js.map} +1 -1
  32. package/build/client/assets/{root-D_snSGY7.js → root-B02acrJe.js} +2 -2
  33. package/build/client/assets/{root-D_snSGY7.js.map → root-B02acrJe.js.map} +1 -1
  34. package/build/server/index.js +2 -2
  35. package/build/server/index.js.map +1 -1
  36. package/node_modules/@epic-web/client-hints/dist/index.js +32 -20
  37. package/node_modules/@epic-web/client-hints/package.json +1 -1
  38. package/package.json +4 -4
  39. package/build/client/assets/_layout-CGXamJB4.js.map +0 -1
  40. package/build/client/assets/client-hints-BHTHvBjk.js +0 -24
  41. package/build/client/assets/client-hints-BHTHvBjk.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as j,j as e,O as K,b as Q}from"./index-D1WEsmVZ.js";import{c as x}from"./clsx-B-dksMZM.js";import{b as q,s as Y,c as X,d as Z,e as M,m as h,u as ee,f as te}from"./progress-CBZt2pmu.js";import{T as se}from"./index-zG3_j9lj.js";import{c as f,I as b}from"./misc-CXGQ7VS9.js";import{S as I,T as ne,a as D,b as $,c as V}from"./tooltip-CVFWPOu0.js";import{b as S}from"./user-DiGtbaa7.js";import{a as O}from"./presence-u-05JV3Z.js";import{L as u,u as ae,N as W}from"./components-Dj3sm47B.js";import"./index-B8k-Gd1G.js";import"./client-hints-BHTHvBjk.js";function re(t){t.values.forEach(s=>s.stop())}function P(t,s){[...s].reverse().forEach(o=>{const l=t.getVariant(o);l&&Y(t,l),t.variantChildren&&t.variantChildren.forEach(r=>{P(r,s)})})}function oe(t,s){if(Array.isArray(s))return P(t,s);if(typeof s=="string")return P(t,[s]);Y(t,s)}function le(){const t=new Set,s={subscribe(n){return t.add(n),()=>void t.delete(n)},start(n,o){const l=[];return t.forEach(r=>{l.push(q(r,n,{transitionOverride:o}))}),Promise.all(l)},set(n){return t.forEach(o=>{oe(o,n)})},stop(){t.forEach(n=>{re(n)})},mount(){return()=>{s.stop()}}};return s}function _(){const t=X(le);return Z(t.mount,[]),t}const H=["opacity-70","opacity-80","opacity-90","opacity-100"],U=["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 A(t){const s=Math.round(t*H.length-1),n=Math.round(t*U.length-1);return f("shadow-purple-700 hover:opacity-100 focus:opacity-100 dark:shadow-purple-200",H[s]??"opacity-60",U[n]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function ie({isMenuOpened:t}){const s=S(),{users:n}=O(),o=t?17:0,l=n.length-o;if(!n.length)return null;const r=t&&n.length===1?e.jsx(u,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:f("h-8 w-8 rounded-full border object-cover",A(1)),src:"https://github-production-user-asset-6210df.s3.amazonaws.com/1500684/277090714-b26e5961-4ee5-4c20-abdb-b04c1c480f2b.png"})}):null,m=`${l}${t?" more ":" "}Epic Web Dev${l===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(ne,{children:[n.slice(0,o).map(({user:a,score:c})=>{const p=A(c),d=ce(a.location);return e.jsxs(D,{children:[e.jsx($,{asChild:!0,children:a.avatarUrl?e.jsx("img",{tabIndex:0,alt:a.name||"Epic Web Dev",className:f("h-8 w-8 rounded-full border object-cover",p),src:a.avatarUrl}):e.jsx("div",{tabIndex:0,"aria-label":a.name||"Epic Web Dev",className:f("flex h-8 w-8 items-center justify-center rounded-full border",p),children:e.jsx(b,{name:"User"})})}),e.jsx(V,{children:e.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[e.jsxs("span",{children:[a.name||"An EPIC Web Dev"," ",d?` is working ${c===1&&(s==null?void 0:s.id)!==a.id?"with you":""} on`:null]}),d!=null&&d.line1?e.jsx("span",{children:d.line1}):null,d!=null&&d.line2?e.jsx("span",{children:d.line2}):null]})})]},a.id)}),r,l>0?e.jsxs(D,{children:[e.jsx($,{asChild:!0,children:e.jsx("div",{tabIndex:0,"aria-label":m,className:f("flex items-center justify-center rounded-full border bg-accent text-xs text-accent-foreground",t?"h-8 w-8":"h-6 w-6"),children:e.jsx("span",{className:f("pointer-events-none overflow-hidden text-ellipsis whitespace-nowrap text-center",t?"w-8":"w-6"),children:t?`+${l}`:l})})}),e.jsx(V,{children:m})]}):null]})})}function Ce(){const t=S(),[s,n]=j.useState(!1);return e.jsxs("div",{className:"flex flex-col",children:[t?null:e.jsx(de,{}),e.jsxs("div",{className:f("flex flex-grow",{"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!t,"h-[calc(100vh-112px-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))]":ENV.EPICSHOP_DEPLOYED,"h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":t}),children:[e.jsx(fe,{isMenuOpened:s,onMenuOpenChange:n}),e.jsx("div",{className:f("h-full w-full max-w-[calc(100%-56px)]",s?"hidden md:block":""),children:e.jsx(K,{})})]})]})}function ce(t){if(!t)return null;const{exercise:s}=t,n=[s?[s.exerciseNumber,s.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,s==null?void 0:s.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:n}}function de(){return e.jsxs("div",{className:f("z-10 flex items-center justify-between border-b bg-gradient-to-tr from-blue-500 to-indigo-500 pl-4 text-white",ENV.EPICSHOP_DEPLOYED?"h-[112px] md:h-[64px]":"h-16"),children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[e.jsx(b,{name:"EpicWeb",size:"lg"}),e.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[e.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",e.jsx(u,{to:"https://www.epicweb.dev",className:"underline",target:"_blank",children:"EpicWeb.dev"})," ","Workshop app!"]}),ENV.EPICSHOP_DEPLOYED?e.jsxs("small",{className:"text-sm",children:["This is the deployed version."," ",ENV.EPICSHOP_GITHUB_ROOT?e.jsx(u,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_ROOT,children:"Run locally"}):null," ","for full experience."]}):null]})]}),e.jsxs("div",{className:"flex h-full flex-col items-center md:flex-row",children:[e.jsxs(u,{to:"https://www.epicweb.dev",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 Epic Web"}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(u,{to:ENV.EPICSHOP_DEPLOYED?"https://www.epicweb.dev/login":"/login",className:"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30",children:[e.jsx(b,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"})]})]})]})}const z={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function ue({exerciseNumber:t,children:s}){const n=ee(t);return e.jsx(h.li,{variants:z,className:f("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:e.jsx("span",{className:"ml-2",children:s})})}function C({children:t,...s}){const n=te(s);return e.jsx(h.li,{variants:z,className:f("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:e.jsx("span",{className:"ml-2",children:t})})}const k=400;function fe({isMenuOpened:t,onMenuOpenChange:s}){const n=ae(),o=S(),l=M(),r=Q(),{users:m}=O(),a=n.exercises.find(i=>i.exerciseNumber===Number(r.exerciseNumber)),c=r.type==="solution"?a==null?void 0:a.solutions.find(i=>i.stepNumber===Number(r.stepNumber)):r.type==="problem"?a==null?void 0:a.problems.find(i=>i.stepNumber===Number(r.stepNumber)):null,p=_(),d={close:{width:56},open:{width:k}},g={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},L=Number(r.exerciseNumber).toString().padStart(2,"0");return e.jsx("nav",{className:"flex border-r",children:e.jsx(h.div,{initial:t?"open":"close",variants:d,animate:p,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(he,{title:n.workshopTitle,menuControls:p,isMenuOpened:t,setMenuOpened:s}),t&&e.jsxs(h.div,{style:{width:k},className:"flex flex-grow flex-col justify-between overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar",initial:{opacity:0},animate:{opacity:1},children:[e.jsx(h.ul,{variants:g,initial:"hidden",animate:"visible",className:"flex flex-col",children:n.exercises.map(({exerciseNumber:i,title:B,steps:R})=>{const N=Number(r.exerciseNumber)===i,F=!N&&n.playground.exerciseNumber===i,v=i.toString().padStart(2,"0");return e.jsxs(ue,{exerciseNumber:i,children:[e.jsxs(u,{prefetch:"intent",to:`/${v}`,className:x("relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":N}),children:[B,F?" 🛝":null]}),N?e.jsxs(h.ul,{variants:g,initial:"hidden",animate:"visible",className:"ml-4 mt-4 flex flex-col",children:[e.jsx(C,{type:"instructions",exerciseNumber:i,children:e.jsx(u,{to:`/${v}`,prefetch:"intent",className:x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!r.stepNumber}),children:"Intro"})},i),R.filter(Boolean).map(({name:y,stepNumber:w,title:T})=>{const G=Number(r.stepNumber)===w,E=w.toString().padStart(2,"0"),J=y===n.playground.appName;return e.jsx(C,{type:"step",stepNumber:w,exerciseNumber:i,children:e.jsx(u,{to:`/${v}/${E}`,prefetch:"intent",className:x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":G}),children:J?`${E}. ${T} 🛝`:`${E}. ${T}`})},w)}),e.jsx(C,{type:"finished",exerciseNumber:i,children:e.jsx(W,{to:`/${v}/finished`,prefetch:"intent",className:({isActive:y})=>x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":y}),children:"📝 Elaboration"})})]}):null]},i)})}),e.jsx("div",{className:"mt-6",children:e.jsx(W,{to:"/finished",className:({isActive:i})=>x("relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline",{'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""]':i}),children:"📝 Workshop Feedback"})})]}),!t&&e.jsx("div",{className:"flex flex-grow flex-col justify-center",children:e.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm font-medium uppercase leading-none",children:[a!=null&&a.title?e.jsx(u,{to:`/${L}`,children:a.title}):null,a!=null&&a.title&&(c!=null&&c.title)?" — ":null,c!=null&&c.title?e.jsx(u,{to:`/${L}/${c.stepNumber.toString().padStart(2,"0")}`,children:c.title}):null]})}),e.jsx("div",{className:f("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&m.length>4?"h-28":"h-14"),style:t?{width:k}:{},children:e.jsx(ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:o?e.jsx(I,{content:t?null:"Your account",children:e.jsxs(u,{className:"flex h-14 w-full items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",children:[o.avatarUrl?e.jsx("img",{alt:o.name??o.email,src:o.avatarUrl,className:"h-full rounded-full"}):e.jsx(b,{name:"User",className:"flex-shrink-0",size:"lg"}),t?e.jsx(h.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"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:o&&l?e.jsx(I,{content:t?null:"Continue to next lesson",children:e.jsxs(u,{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(b,{name:"FastForward",className:"flex-shrink-0",size:"md"}),t?e.jsx(h.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,e.jsx("div",{className:"mb-4 w-full self-start border-t pl-3 pt-[15px]",children:e.jsx(se,{})})]})})})}function he({title:t,isMenuOpened:s,setMenuOpened:n,menuControls:o}){const l={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},r={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},m=_(),a=_();async function c(){o.start(s?"close":"open"),n(!s),s?(m.start(l.closed),await a.start(r.moving),a.start(r.closed)):(await a.start(r.moving),m.start(l.open),a.start(r.open))}const p=j.useRef(c);return j.useEffect(()=>{p.current=c}),j.useEffect(()=>{if(!s)return;function d(g){g.key==="Escape"&&p.current()}return document.addEventListener("keyup",d),()=>document.removeEventListener("keyup",d)},[s]),e.jsxs("div",{className:"relative inline-flex h-14 w-full items-center justify-between overflow-hidden border-b",children:[e.jsx("button",{className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:c,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(h.path,{...l.closed,animate:m,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(h.path,{...r.closed,animate:a,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),s&&e.jsx(h.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 whitespace-nowrap font-mono text-sm uppercase",children:e.jsx(u,{to:"/",children:t})})]})}export{Ce as default};
2
- //# sourceMappingURL=_layout-CPxDcKGb.js.map
1
+ import{r as j,j as e,O as K,b as Q}from"./index-D1WEsmVZ.js";import{c as x}from"./clsx-B-dksMZM.js";import{b as q,s as Y,c as X,d as Z,e as M,m as h,u as ee,f as te}from"./progress-CBZt2pmu.js";import{T as se}from"./index-CLnz0tXz.js";import{c as f,I as b}from"./misc-CXGQ7VS9.js";import{S as I,T as ne,a as D,b as $,c as V}from"./tooltip-CVFWPOu0.js";import{b as S}from"./user-DiGtbaa7.js";import{a as O}from"./presence-u-05JV3Z.js";import{L as u,u as ae,N as W}from"./components-Dj3sm47B.js";import"./index-B8k-Gd1G.js";import"./client-hints-KnbHFIgn.js";function re(t){t.values.forEach(s=>s.stop())}function P(t,s){[...s].reverse().forEach(o=>{const l=t.getVariant(o);l&&Y(t,l),t.variantChildren&&t.variantChildren.forEach(r=>{P(r,s)})})}function oe(t,s){if(Array.isArray(s))return P(t,s);if(typeof s=="string")return P(t,[s]);Y(t,s)}function le(){const t=new Set,s={subscribe(n){return t.add(n),()=>void t.delete(n)},start(n,o){const l=[];return t.forEach(r=>{l.push(q(r,n,{transitionOverride:o}))}),Promise.all(l)},set(n){return t.forEach(o=>{oe(o,n)})},stop(){t.forEach(n=>{re(n)})},mount(){return()=>{s.stop()}}};return s}function _(){const t=X(le);return Z(t.mount,[]),t}const H=["opacity-70","opacity-80","opacity-90","opacity-100"],U=["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 A(t){const s=Math.round(t*H.length-1),n=Math.round(t*U.length-1);return f("shadow-purple-700 hover:opacity-100 focus:opacity-100 dark:shadow-purple-200",H[s]??"opacity-60",U[n]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function ie({isMenuOpened:t}){const s=S(),{users:n}=O(),o=t?17:0,l=n.length-o;if(!n.length)return null;const r=t&&n.length===1?e.jsx(u,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:f("h-8 w-8 rounded-full border object-cover",A(1)),src:"https://github-production-user-asset-6210df.s3.amazonaws.com/1500684/277090714-b26e5961-4ee5-4c20-abdb-b04c1c480f2b.png"})}):null,m=`${l}${t?" more ":" "}Epic Web Dev${l===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(ne,{children:[n.slice(0,o).map(({user:a,score:c})=>{const p=A(c),d=ce(a.location);return e.jsxs(D,{children:[e.jsx($,{asChild:!0,children:a.avatarUrl?e.jsx("img",{tabIndex:0,alt:a.name||"Epic Web Dev",className:f("h-8 w-8 rounded-full border object-cover",p),src:a.avatarUrl}):e.jsx("div",{tabIndex:0,"aria-label":a.name||"Epic Web Dev",className:f("flex h-8 w-8 items-center justify-center rounded-full border",p),children:e.jsx(b,{name:"User"})})}),e.jsx(V,{children:e.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[e.jsxs("span",{children:[a.name||"An EPIC Web Dev"," ",d?` is working ${c===1&&(s==null?void 0:s.id)!==a.id?"with you":""} on`:null]}),d!=null&&d.line1?e.jsx("span",{children:d.line1}):null,d!=null&&d.line2?e.jsx("span",{children:d.line2}):null]})})]},a.id)}),r,l>0?e.jsxs(D,{children:[e.jsx($,{asChild:!0,children:e.jsx("div",{tabIndex:0,"aria-label":m,className:f("flex items-center justify-center rounded-full border bg-accent text-xs text-accent-foreground",t?"h-8 w-8":"h-6 w-6"),children:e.jsx("span",{className:f("pointer-events-none overflow-hidden text-ellipsis whitespace-nowrap text-center",t?"w-8":"w-6"),children:t?`+${l}`:l})})}),e.jsx(V,{children:m})]}):null]})})}function Ce(){const t=S(),[s,n]=j.useState(!1);return e.jsxs("div",{className:"flex flex-col",children:[t?null:e.jsx(de,{}),e.jsxs("div",{className:f("flex flex-grow",{"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!t,"h-[calc(100vh-112px-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))]":ENV.EPICSHOP_DEPLOYED,"h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":t}),children:[e.jsx(fe,{isMenuOpened:s,onMenuOpenChange:n}),e.jsx("div",{className:f("h-full w-full max-w-[calc(100%-56px)]",s?"hidden md:block":""),children:e.jsx(K,{})})]})]})}function ce(t){if(!t)return null;const{exercise:s}=t,n=[s?[s.exerciseNumber,s.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,s==null?void 0:s.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:n}}function de(){return e.jsxs("div",{className:f("z-10 flex items-center justify-between border-b bg-gradient-to-tr from-blue-500 to-indigo-500 pl-4 text-white",ENV.EPICSHOP_DEPLOYED?"h-[112px] md:h-[64px]":"h-16"),children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[e.jsx(b,{name:"EpicWeb",size:"lg"}),e.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[e.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",e.jsx(u,{to:"https://www.epicweb.dev",className:"underline",target:"_blank",children:"EpicWeb.dev"})," ","Workshop app!"]}),ENV.EPICSHOP_DEPLOYED?e.jsxs("small",{className:"text-sm",children:["This is the deployed version."," ",ENV.EPICSHOP_GITHUB_ROOT?e.jsx(u,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_ROOT,children:"Run locally"}):null," ","for full experience."]}):null]})]}),e.jsxs("div",{className:"flex h-full flex-col items-center md:flex-row",children:[e.jsxs(u,{to:"https://www.epicweb.dev",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 Epic Web"}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(u,{to:ENV.EPICSHOP_DEPLOYED?"https://www.epicweb.dev/login":"/login",className:"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30",children:[e.jsx(b,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"})]})]})]})}const z={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function ue({exerciseNumber:t,children:s}){const n=ee(t);return e.jsx(h.li,{variants:z,className:f("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:e.jsx("span",{className:"ml-2",children:s})})}function C({children:t,...s}){const n=te(s);return e.jsx(h.li,{variants:z,className:f("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:e.jsx("span",{className:"ml-2",children:t})})}const k=400;function fe({isMenuOpened:t,onMenuOpenChange:s}){const n=ae(),o=S(),l=M(),r=Q(),{users:m}=O(),a=n.exercises.find(i=>i.exerciseNumber===Number(r.exerciseNumber)),c=r.type==="solution"?a==null?void 0:a.solutions.find(i=>i.stepNumber===Number(r.stepNumber)):r.type==="problem"?a==null?void 0:a.problems.find(i=>i.stepNumber===Number(r.stepNumber)):null,p=_(),d={close:{width:56},open:{width:k}},g={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},L=Number(r.exerciseNumber).toString().padStart(2,"0");return e.jsx("nav",{className:"flex border-r",children:e.jsx(h.div,{initial:t?"open":"close",variants:d,animate:p,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(he,{title:n.workshopTitle,menuControls:p,isMenuOpened:t,setMenuOpened:s}),t&&e.jsxs(h.div,{style:{width:k},className:"flex flex-grow flex-col justify-between overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar",initial:{opacity:0},animate:{opacity:1},children:[e.jsx(h.ul,{variants:g,initial:"hidden",animate:"visible",className:"flex flex-col",children:n.exercises.map(({exerciseNumber:i,title:B,steps:R})=>{const N=Number(r.exerciseNumber)===i,F=!N&&n.playground.exerciseNumber===i,v=i.toString().padStart(2,"0");return e.jsxs(ue,{exerciseNumber:i,children:[e.jsxs(u,{prefetch:"intent",to:`/${v}`,className:x("relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":N}),children:[B,F?" 🛝":null]}),N?e.jsxs(h.ul,{variants:g,initial:"hidden",animate:"visible",className:"ml-4 mt-4 flex flex-col",children:[e.jsx(C,{type:"instructions",exerciseNumber:i,children:e.jsx(u,{to:`/${v}`,prefetch:"intent",className:x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!r.stepNumber}),children:"Intro"})},i),R.filter(Boolean).map(({name:y,stepNumber:w,title:T})=>{const G=Number(r.stepNumber)===w,E=w.toString().padStart(2,"0"),J=y===n.playground.appName;return e.jsx(C,{type:"step",stepNumber:w,exerciseNumber:i,children:e.jsx(u,{to:`/${v}/${E}`,prefetch:"intent",className:x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":G}),children:J?`${E}. ${T} 🛝`:`${E}. ${T}`})},w)}),e.jsx(C,{type:"finished",exerciseNumber:i,children:e.jsx(W,{to:`/${v}/finished`,prefetch:"intent",className:({isActive:y})=>x('relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":y}),children:"📝 Elaboration"})})]}):null]},i)})}),e.jsx("div",{className:"mt-6",children:e.jsx(W,{to:"/finished",className:({isActive:i})=>x("relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline",{'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""]':i}),children:"📝 Workshop Feedback"})})]}),!t&&e.jsx("div",{className:"flex flex-grow flex-col justify-center",children:e.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm font-medium uppercase leading-none",children:[a!=null&&a.title?e.jsx(u,{to:`/${L}`,children:a.title}):null,a!=null&&a.title&&(c!=null&&c.title)?" — ":null,c!=null&&c.title?e.jsx(u,{to:`/${L}/${c.stepNumber.toString().padStart(2,"0")}`,children:c.title}):null]})}),e.jsx("div",{className:f("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&m.length>4?"h-28":"h-14"),style:t?{width:k}:{},children:e.jsx(ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:o?e.jsx(I,{content:t?null:"Your account",children:e.jsxs(u,{className:"flex h-14 w-full items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",children:[o.avatarUrl?e.jsx("img",{alt:o.name??o.email,src:o.avatarUrl,className:"h-full rounded-full"}):e.jsx(b,{name:"User",className:"flex-shrink-0",size:"lg"}),t?e.jsx(h.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"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:o&&l?e.jsx(I,{content:t?null:"Continue to next lesson",children:e.jsxs(u,{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(b,{name:"FastForward",className:"flex-shrink-0",size:"md"}),t?e.jsx(h.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,e.jsx("div",{className:"mb-4 w-full self-start border-t pl-3 pt-[15px]",children:e.jsx(se,{})})]})})})}function he({title:t,isMenuOpened:s,setMenuOpened:n,menuControls:o}){const l={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},r={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},m=_(),a=_();async function c(){o.start(s?"close":"open"),n(!s),s?(m.start(l.closed),await a.start(r.moving),a.start(r.closed)):(await a.start(r.moving),m.start(l.open),a.start(r.open))}const p=j.useRef(c);return j.useEffect(()=>{p.current=c}),j.useEffect(()=>{if(!s)return;function d(g){g.key==="Escape"&&p.current()}return document.addEventListener("keyup",d),()=>document.removeEventListener("keyup",d)},[s]),e.jsxs("div",{className:"relative inline-flex h-14 w-full items-center justify-between overflow-hidden border-b",children:[e.jsx("button",{className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:c,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(h.path,{...l.closed,animate:m,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(h.path,{...r.closed,animate:a,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),s&&e.jsx(h.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 whitespace-nowrap font-mono text-sm uppercase",children:e.jsx(u,{to:"/",children:t})})]})}export{Ce as default};
2
+ //# sourceMappingURL=_layout-D7Qo_r0X.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_layout-CPxDcKGb.js","sources":["../../../../../node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs","../../../../../node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs","../../../app/routes/_app+/_layout.tsx"],"sourcesContent":["import { invariant } from '../../utils/errors.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\n\nfunction stopAnimation(visualElement) {\n visualElement.values.forEach((value) => value.stop());\n}\nfunction setVariants(visualElement, variantLabels) {\n const reversedLabels = [...variantLabels].reverse();\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key);\n variant && setTarget(visualElement, variant);\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels);\n });\n }\n });\n}\nfunction setValues(visualElement, definition) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition);\n }\n else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition]);\n }\n else {\n setTarget(visualElement, definition);\n }\n}\n/**\n * @public\n */\nfunction animationControls() {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false;\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set();\n const controls = {\n subscribe(visualElement) {\n subscribers.add(visualElement);\n return () => void subscribers.delete(visualElement);\n },\n start(definition, transitionOverride) {\n invariant(hasMounted, \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\n const animations = [];\n subscribers.forEach((visualElement) => {\n animations.push(animateVisualElement(visualElement, definition, {\n transitionOverride,\n }));\n });\n return Promise.all(animations);\n },\n set(definition) {\n invariant(hasMounted, \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition);\n });\n },\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement);\n });\n },\n mount() {\n hasMounted = true;\n return () => {\n hasMounted = false;\n controls.stop();\n };\n },\n };\n return controls;\n}\n\nexport { animationControls, setValues };\n","import { animationControls } from './animation-controls.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * Creates `AnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `AnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return <motion.div animate={controls} />\n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nfunction useAnimationControls() {\n const controls = useConstant(animationControls);\n useIsomorphicLayoutEffect(controls.mount, []);\n return controls;\n}\nconst useAnimation = useAnimationControls;\n\nexport { useAnimation, useAnimationControls };\n","import {\n\textractNumbersAndTypeFromAppNameOrPath,\n\tgetExercises,\n\tgetPlaygroundAppName,\n\tgetWorkshopTitle,\n} from '@epic-web/workshop-utils/apps.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\ttype LoaderFunctionArgs,\n\ttype HeadersFunction,\n\tjson,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tNavLink,\n\tOutlet,\n\tuseLoaderData,\n\tuseParams,\n} from '@remix-run/react'\nimport { clsx } from 'clsx'\nimport {\n\ttype AnimationControls,\n\tmotion,\n\tuseAnimationControls,\n} from 'framer-motion'\nimport * as React from 'react'\nimport {\n\tuseNextExerciseRoute,\n\tuseExerciseProgressClassName,\n\ttype ProgressItemSearch,\n\tuseProgressItemClassName,\n} from '../progress.tsx'\nimport { ThemeSwitch } from '../theme/index.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport {\n\tSimpleTooltip,\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from '#app/components/ui/tooltip.tsx'\nimport { useOptionalUser } from '#app/components/user.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { type User, usePresence } from '#app/utils/presence.tsx'\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tconst [exercises, workshopTitle, playgroundAppName] = await Promise.all([\n\t\tgetExercises({ request, timings }),\n\t\tgetWorkshopTitle(),\n\t\tgetPlaygroundAppName(),\n\t])\n\n\tconst playground = {\n\t\tappName: playgroundAppName,\n\t\texerciseNumber: Number(\n\t\t\textractNumbersAndTypeFromAppNameOrPath(playgroundAppName ?? '')\n\t\t\t\t?.exerciseNumber,\n\t\t),\n\t}\n\n\tconst result = json(\n\t\t{\n\t\t\tworkshopTitle,\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\tsolutions: e.solutions.map(({ stepNumber, title, name }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle,\n\t\t\t\t\tname,\n\t\t\t\t})),\n\t\t\t\tproblems: e.problems.map(({ stepNumber, title, name }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle,\n\t\t\t\t\tname,\n\t\t\t\t})),\n\t\t\t\tsteps: e.steps.map(({ stepNumber, problem, solution }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle: problem?.title ?? solution?.title ?? 'Unknown',\n\t\t\t\t\tname: problem?.name ?? solution?.name ?? 'Unknown',\n\t\t\t\t})),\n\t\t\t})),\n\t\t\tplayground,\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\tVary: 'Cookie',\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\tVary: 'Cookie',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst opacities = ['opacity-70', 'opacity-80', 'opacity-90', 'opacity-100']\nconst shadows = [\n\t'shadow-[0_0_2px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_4px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_7px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_10px_0_rgba(0,0,0,0.3)]',\n]\nfunction getScoreClassNames(score: number) {\n\tconst opacityNumber = Math.round(score * opacities.length - 1)\n\tconst shadowNumber = Math.round(score * shadows.length - 1)\n\treturn cn(\n\t\t'shadow-purple-700 hover:opacity-100 focus:opacity-100 dark:shadow-purple-200',\n\t\topacities[opacityNumber] ?? 'opacity-60',\n\t\tshadows[shadowNumber] ?? 'shadow-none',\n\t\tscore === 1 ? 'animate-pulse hover:animate-none focus:animate-none' : null,\n\t)\n}\n\nfunction FacePile({ isMenuOpened }: { isMenuOpened: boolean }) {\n\tconst loggedInUser = useOptionalUser()\n\tconst { users } = usePresence()\n\tconst limit = isMenuOpened ? 17 : 0\n\tconst numberOverLimit = users.length - limit\n\tif (!users.length) return null\n\tconst tiffany =\n\t\tisMenuOpened && users.length === 1 ? (\n\t\t\t<Link\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\tto=\"https://www.youtube.com/watch?v=w6Q3mHyzn78\"\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\talt=\"Tiffany Tunes\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'h-8 w-8 rounded-full border object-cover',\n\t\t\t\t\t\tgetScoreClassNames(1),\n\t\t\t\t\t)}\n\t\t\t\t\tsrc=\"https://github-production-user-asset-6210df.s3.amazonaws.com/1500684/277090714-b26e5961-4ee5-4c20-abdb-b04c1c480f2b.png\"\n\t\t\t\t/>\n\t\t\t</Link>\n\t\t) : null\n\tconst overLimitLabel = `${numberOverLimit}${\n\t\tisMenuOpened ? ' more ' : ' '\n\t}Epic Web Dev${numberOverLimit === 1 ? '' : 's'} working now`\n\treturn (\n\t\t<div className=\"flex flex-wrap items-center gap-2\">\n\t\t\t<TooltipProvider>\n\t\t\t\t{users.slice(0, limit).map(({ user, score }) => {\n\t\t\t\t\tconst scoreClassNames = getScoreClassNames(score)\n\t\t\t\t\tconst locationLabel = getLocationLabel(user.location)\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Tooltip key={user.id}>\n\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t{user.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\t\talt={user.name || 'Epic Web Dev'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-8 w-8 rounded-full border object-cover',\n\t\t\t\t\t\t\t\t\t\t\tscoreClassNames,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\tsrc={user.avatarUrl}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\t\taria-label={user.name || 'Epic Web Dev'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex h-8 w-8 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tscoreClassNames,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Icon name=\"User\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t<span className=\"flex flex-col items-center justify-center gap-1\">\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t{user.name || 'An EPIC Web Dev'}{' '}\n\t\t\t\t\t\t\t\t\t\t{locationLabel\n\t\t\t\t\t\t\t\t\t\t\t? ` is working ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tscore === 1 && loggedInUser?.id !== user.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'with you'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t} on`\n\t\t\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{locationLabel?.line1 ? (\n\t\t\t\t\t\t\t\t\t\t<span>{locationLabel.line1}</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{locationLabel?.line2 ? (\n\t\t\t\t\t\t\t\t\t\t<span>{locationLabel.line2}</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t\t{tiffany}\n\t\t\t\t{numberOverLimit > 0 ? (\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\taria-label={overLimitLabel}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'flex items-center justify-center rounded-full border bg-accent text-xs text-accent-foreground',\n\t\t\t\t\t\t\t\t\tisMenuOpened ? 'h-8 w-8' : 'h-6 w-6',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'pointer-events-none overflow-hidden text-ellipsis whitespace-nowrap text-center',\n\t\t\t\t\t\t\t\t\t\tisMenuOpened ? 'w-8' : 'w-6',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{isMenuOpened ? `+${numberOverLimit}` : numberOverLimit}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>{overLimitLabel}</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : null}\n\t\t\t</TooltipProvider>\n\t\t</div>\n\t)\n}\n\nexport default function App() {\n\tconst user = useOptionalUser()\n\n\tconst [isMenuOpened, setMenuOpened] = React.useState(false)\n\n\treturn (\n\t\t<div className=\"flex flex-col\">\n\t\t\t{user ? null : <EpicWebBanner />}\n\t\t\t<div\n\t\t\t\tclassName={cn('flex flex-grow', {\n\t\t\t\t\t'h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]':\n\t\t\t\t\t\t!user,\n\t\t\t\t\t'h-[calc(100vh-112px-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))]':\n\t\t\t\t\t\tENV.EPICSHOP_DEPLOYED,\n\t\t\t\t\t'h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]':\n\t\t\t\t\t\tuser,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Navigation\n\t\t\t\t\tisMenuOpened={isMenuOpened}\n\t\t\t\t\tonMenuOpenChange={setMenuOpened}\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'h-full w-full max-w-[calc(100%-56px)]',\n\t\t\t\t\t\tisMenuOpened ? 'hidden md:block' : '',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<Outlet />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction getLocationLabel(location: User['location']) {\n\tif (!location) return null\n\n\tconst { exercise } = location\n\n\tconst exercisePortion = [\n\t\texercise\n\t\t\t? [exercise.exerciseNumber, exercise.stepNumber]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.map(s => s.toString().padStart(2, '0'))\n\t\t\t\t\t.join('/')\n\t\t\t: null,\n\t\texercise?.type,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' - ')\n\treturn { line1: location.workshopTitle, line2: exercisePortion }\n}\n\nfunction EpicWebBanner() {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'z-10 flex items-center justify-between border-b bg-gradient-to-tr from-blue-500 to-indigo-500 pl-4 text-white',\n\t\t\t\tENV.EPICSHOP_DEPLOYED ? 'h-[112px] md:h-[64px]' : 'h-16',\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"flex flex-1 flex-wrap items-center gap-4\">\n\t\t\t\t<Icon name=\"EpicWeb\" size=\"lg\" />\n\t\t\t\t<div className=\"flex flex-1 flex-wrap items-center\">\n\t\t\t\t\t<p className=\"mr-2\">\n\t\t\t\t\t\tWelcome to the{' '}\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"https://www.epicweb.dev\"\n\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tEpicWeb.dev\n\t\t\t\t\t\t</Link>{' '}\n\t\t\t\t\t\tWorkshop app!\n\t\t\t\t\t</p>\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? (\n\t\t\t\t\t\t<small className=\"text-sm\">\n\t\t\t\t\t\t\tThis is the deployed version.{' '}\n\t\t\t\t\t\t\t{ENV.EPICSHOP_GITHUB_ROOT ? (\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\tto={ENV.EPICSHOP_GITHUB_ROOT}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tRun locally\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\tfor full experience.\n\t\t\t\t\t\t</small>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-col items-center md:flex-row\">\n\t\t\t\t<Link\n\t\t\t\t\tto=\"https://www.epicweb.dev\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"drop-shadow-sm\">Join Epic Web</span>\n\t\t\t\t\t<span>↗︎</span>\n\t\t\t\t</Link>\n\t\t\t\t<Link\n\t\t\t\t\tto={\n\t\t\t\t\t\tENV.EPICSHOP_DEPLOYED ? 'https://www.epicweb.dev/login' : '/login'\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30\"\n\t\t\t\t>\n\t\t\t\t\t<Icon name=\"User\" size=\"lg\" />\n\t\t\t\t\t<span className=\"drop-shadow-sm\">Login</span>\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nconst itemVariants = {\n\thidden: { opacity: 0, x: -20 },\n\tvisible: { opacity: 1, x: 0 },\n}\nfunction NavigationExerciseListItem({\n\texerciseNumber,\n\tchildren,\n}: {\n\texerciseNumber: number\n\tchildren: React.ReactNode\n}) {\n\tconst progressClassName = useExerciseProgressClassName(exerciseNumber)\n\treturn (\n\t\t<motion.li\n\t\t\tvariants={itemVariants}\n\t\t\tclassName={cn(\n\t\t\t\t// add gap of 3 to children, but using padding so the progress extends through the whole height\n\t\t\t\t'py-[6px] first:pt-3 last:pb-3',\n\t\t\t\tprogressClassName ? `${progressClassName} before:border-t` : null,\n\t\t\t)}\n\t\t>\n\t\t\t<span className=\"ml-2\">{children}</span>\n\t\t</motion.li>\n\t)\n}\n\nfunction NavigationExerciseStepListItem({\n\tchildren,\n\t...progressItemSearch\n}: {\n\tchildren: React.ReactNode\n} & ProgressItemSearch) {\n\tconst progressClassName = useProgressItemClassName(progressItemSearch)\n\treturn (\n\t\t<motion.li\n\t\t\tvariants={itemVariants}\n\t\t\tclassName={cn(\n\t\t\t\t// add gap of 3 to children, but using padding so the progress extends through the whole height\n\t\t\t\t'py-[6px] first:pt-3 last:pb-3',\n\t\t\t\tprogressClassName ? `${progressClassName} before:border-t` : null,\n\t\t\t)}\n\t\t>\n\t\t\t<span className=\"ml-2\">{children}</span>\n\t\t</motion.li>\n\t)\n}\n\nconst OPENED_MENU_WIDTH = 400\n\nfunction Navigation({\n\tisMenuOpened,\n\tonMenuOpenChange: setMenuOpened,\n}: {\n\tisMenuOpened: boolean\n\tonMenuOpenChange: (change: boolean) => void\n}) {\n\tconst data = useLoaderData<typeof loader>()\n\tconst user = useOptionalUser()\n\tconst nextExerciseRoute = useNextExerciseRoute()\n\tconst params = useParams()\n\tconst { users } = usePresence()\n\n\tconst exercise = data.exercises.find(\n\t\te => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tconst app =\n\t\tparams.type === 'solution'\n\t\t\t? exercise?.solutions.find(\n\t\t\t\t\ts => s.stepNumber === Number(params.stepNumber),\n\t\t\t\t)\n\t\t\t: params.type === 'problem'\n\t\t\t\t? exercise?.problems.find(\n\t\t\t\t\t\tp => p.stepNumber === Number(params.stepNumber),\n\t\t\t\t\t)\n\t\t\t\t: null\n\n\t// container\n\tconst menuControls = useAnimationControls()\n\tconst menuVariants = {\n\t\tclose: { width: 56 },\n\t\topen: { width: OPENED_MENU_WIDTH },\n\t}\n\n\t// items\n\tconst listVariants = {\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.05,\n\t\t\t\twhen: 'beforeChildren',\n\t\t\t\tstaggerChildren: 0.03,\n\t\t\t},\n\t\t},\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t},\n\t}\n\tconst exNum = Number(params.exerciseNumber).toString().padStart(2, '0')\n\n\treturn (\n\t\t<nav className=\"flex border-r\">\n\t\t\t<motion.div\n\t\t\t\tinitial={isMenuOpened ? 'open' : 'close'}\n\t\t\t\tvariants={menuVariants}\n\t\t\t\tanimate={menuControls}\n\t\t\t>\n\t\t\t\t<div className=\"flex h-full flex-col items-center justify-between\">\n\t\t\t\t\t<NavToggle\n\t\t\t\t\t\ttitle={data.workshopTitle}\n\t\t\t\t\t\tmenuControls={menuControls}\n\t\t\t\t\t\tisMenuOpened={isMenuOpened}\n\t\t\t\t\t\tsetMenuOpened={setMenuOpened}\n\t\t\t\t\t/>\n\t\t\t\t\t{isMenuOpened && (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tstyle={{ width: OPENED_MENU_WIDTH }}\n\t\t\t\t\t\t\tclassName=\"flex flex-grow flex-col justify-between overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar\"\n\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<motion.ul\n\t\t\t\t\t\t\t\tvariants={listVariants}\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\t\tclassName=\"flex flex-col\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{data.exercises.map(({ exerciseNumber, title, steps }) => {\n\t\t\t\t\t\t\t\t\tconst isActive =\n\t\t\t\t\t\t\t\t\t\tNumber(params.exerciseNumber) === exerciseNumber\n\t\t\t\t\t\t\t\t\tconst showPlayground =\n\t\t\t\t\t\t\t\t\t\t!isActive &&\n\t\t\t\t\t\t\t\t\t\tdata.playground.exerciseNumber === exerciseNumber\n\t\t\t\t\t\t\t\t\tconst exerciseNum = exerciseNumber.toString().padStart(2, '0')\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigationExerciseListItem\n\t\t\t\t\t\t\t\t\t\t\tkey={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}`}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ 'bg-foreground text-background': isActive },\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t\t\t\t\t{showPlayground ? ' 🛝' : null}\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t{isActive ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<motion.ul\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariants={listVariants}\n\t\t\t\t\t\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"ml-4 mt-4 flex flex-col\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"instructions\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!params.stepNumber,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIntro\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{steps\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.map(({ name, stepNumber, title }) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isActive =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNumber(params.stepNumber) === stepNumber\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst step = stepNumber\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.padStart(2, '0')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isPlayground =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname === data.playground.appName\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={stepNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"step\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstepNumber={stepNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}/${step}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{isPlayground\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? `${step}. ${title} 🛝`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: `${step}. ${title}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}/finished`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background': isActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t📝 Elaboration\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</NavLink>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t</motion.ul>\n\t\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t</NavigationExerciseListItem>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</motion.ul>\n\t\t\t\t\t\t\t<div className=\"mt-6\">\n\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\tto=\"/finished\"\n\t\t\t\t\t\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\t\t\t\t\t\tclsx(\n\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"]':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisActive,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t📝 Workshop Feedback\n\t\t\t\t\t\t\t\t</NavLink>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t)}\n\t\t\t\t\t{!isMenuOpened && (\n\t\t\t\t\t\t<div className=\"flex flex-grow flex-col justify-center\">\n\t\t\t\t\t\t\t<div className=\"orientation-sideways w-full font-mono text-sm font-medium uppercase leading-none\">\n\t\t\t\t\t\t\t\t{exercise?.title ? (\n\t\t\t\t\t\t\t\t\t<Link to={`/${exNum}`}>{exercise.title}</Link>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t{exercise?.title && app?.title ? ' — ' : null}\n\t\t\t\t\t\t\t\t{app?.title ? (\n\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\tto={`/${exNum}/${app.stepNumber\n\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t.padStart(2, '0')}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{app.title}\n\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex w-full items-center justify-start border-t p-4 transition-[height]',\n\t\t\t\t\t\t\tisMenuOpened && users.length > 4 ? 'h-28' : 'h-14',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tstyle={isMenuOpened ? { width: OPENED_MENU_WIDTH } : {}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FacePile isMenuOpened={isMenuOpened} />\n\t\t\t\t\t</div>\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? null : user ? (\n\t\t\t\t\t\t<SimpleTooltip content={isMenuOpened ? null : 'Your account'}>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tclassName=\"flex h-14 w-full items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline\"\n\t\t\t\t\t\t\t\tto=\"/account\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{user.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\talt={user.name ?? user.email}\n\t\t\t\t\t\t\t\t\t\tsrc={user.avatarUrl}\n\t\t\t\t\t\t\t\t\t\tclassName=\"h-full rounded-full\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Icon name=\"User\" className=\"flex-shrink-0\" size=\"lg\" />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{isMenuOpened ? (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"flex items-center whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tYour Account\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<span className=\"sr-only\">Your account</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? null : user && nextExerciseRoute ? (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tcontent={isMenuOpened ? null : 'Continue to next lesson'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={nextExerciseRoute}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t'flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tstate={{ from: 'continue next lesson button' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"FastForward\" className=\"flex-shrink-0\" size=\"md\" />\n\t\t\t\t\t\t\t\t{isMenuOpened ? (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"flex items-center whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tContinue to next lesson\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<span className=\"sr-only\">Continue to next lesson</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t) : null}\n\t\t\t\t\t<div className=\"mb-4 w-full self-start border-t pl-3 pt-[15px]\">\n\t\t\t\t\t\t<ThemeSwitch />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t</nav>\n\t)\n}\n\nfunction NavToggle({\n\ttitle,\n\tisMenuOpened,\n\tsetMenuOpened,\n\tmenuControls,\n}: {\n\ttitle: string\n\tisMenuOpened: boolean\n\tsetMenuOpened: (value: boolean) => void\n\tmenuControls: AnimationControls\n}) {\n\tconst path01Variants = {\n\t\topen: { d: 'M3.06061 2.99999L21.0606 21' },\n\t\tclosed: { d: 'M0 9.5L24 9.5' },\n\t}\n\tconst path02Variants = {\n\t\topen: { d: 'M3.00006 21.0607L21 3.06064' },\n\t\tmoving: { d: 'M0 14.5L24 14.5' },\n\t\tclosed: { d: 'M0 14.5L15 14.5' },\n\t}\n\tconst path01Controls = useAnimationControls()\n\tconst path02Controls = useAnimationControls()\n\n\tasync function toggleMenu() {\n\t\tvoid menuControls.start(isMenuOpened ? 'close' : 'open')\n\t\tsetMenuOpened(!isMenuOpened)\n\t\tif (isMenuOpened) {\n\t\t\tvoid path01Controls.start(path01Variants.closed)\n\t\t\tawait path02Controls.start(path02Variants.moving)\n\t\t\tvoid path02Controls.start(path02Variants.closed)\n\t\t} else {\n\t\t\tawait path02Controls.start(path02Variants.moving)\n\t\t\tvoid path01Controls.start(path01Variants.open)\n\t\t\tvoid path02Controls.start(path02Variants.open)\n\t\t}\n\t}\n\n\tconst latestToggleMenu = React.useRef(toggleMenu)\n\tReact.useEffect(() => {\n\t\tlatestToggleMenu.current = toggleMenu\n\t})\n\n\tReact.useEffect(() => {\n\t\tif (!isMenuOpened) return\n\n\t\tfunction handleKeyUp(event: KeyboardEvent) {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tvoid latestToggleMenu.current()\n\t\t\t}\n\t\t}\n\t\tdocument.addEventListener('keyup', handleKeyUp)\n\t\treturn () => document.removeEventListener('keyup', handleKeyUp)\n\t}, [isMenuOpened])\n\n\treturn (\n\t\t<div className=\"relative inline-flex h-14 w-full items-center justify-between overflow-hidden border-b\">\n\t\t\t<button\n\t\t\t\tclassName=\"flex h-14 w-14 items-center justify-center\"\n\t\t\t\taria-label=\"Open Navigation menu\"\n\t\t\t\tonClick={toggleMenu}\n\t\t\t>\n\t\t\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n\t\t\t\t\t<motion.path\n\t\t\t\t\t\t{...path01Variants.closed}\n\t\t\t\t\t\tanimate={path01Controls}\n\t\t\t\t\t\ttransition={{ duration: 0.2 }}\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t/>\n\t\t\t\t\t<motion.path\n\t\t\t\t\t\t{...path02Variants.closed}\n\t\t\t\t\t\tanimate={path02Controls}\n\t\t\t\t\t\ttransition={{ duration: 0.2 }}\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t</button>\n\t\t\t{isMenuOpened && (\n\t\t\t\t<motion.p\n\t\t\t\t\ttransition={{ delay: 0.2 }}\n\t\t\t\t\tinitial={{ opacity: 0, y: 5 }}\n\t\t\t\t\tanimate={{ opacity: 1, y: 0 }}\n\t\t\t\t\tclassName=\"absolute right-5 whitespace-nowrap font-mono text-sm uppercase\"\n\t\t\t\t>\n\t\t\t\t\t<Link to=\"/\">{title}</Link>\n\t\t\t\t</motion.p>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["stopAnimation","visualElement","value","setVariants","variantLabels","key","variant","setTarget","child","setValues","definition","animationControls","subscribers","controls","transitionOverride","animations","animateVisualElement","useAnimationControls","useConstant","useIsomorphicLayoutEffect","opacities","shadows","getScoreClassNames","score","opacityNumber","shadowNumber","cn","FacePile","isMenuOpened","loggedInUser","useOptionalUser","users","usePresence","limit","numberOverLimit","tiffany","jsx","Link","overLimitLabel","jsxs","TooltipProvider","user","scoreClassNames","locationLabel","getLocationLabel","Tooltip","TooltipTrigger","Icon","TooltipContent","headers","setMenuOpened","React.useState","EpicWebBanner","Navigation","Outlet","location","exercise","exercisePortion","s","itemVariants","NavigationExerciseListItem","exerciseNumber","children","progressClassName","motion","progressItemSearch","useProgressItemClassName","OPENED_MENU_WIDTH","data","useLoaderData","nextExerciseRoute","useNextExerciseRoute","params","useParams","e","app","p","menuControls","menuVariants","listVariants","exNum","NavToggle","title","steps","isActive","showPlayground","exerciseNum","clsx","NavigationExerciseStepListItem","name","stepNumber","title2","isPlayground","step","isActive2","NavLink","SimpleTooltip","ThemeSwitch","path01Variants","path02Variants","path01Controls","path02Controls","toggleMenu","latestToggleMenu","React.useRef","React.useEffect","handleKeyUp","event"],"mappings":"6iBAIA,SAASA,GAAcC,EAAe,CAClCA,EAAc,OAAO,QAASC,GAAUA,EAAM,KAAI,CAAE,CACxD,CACA,SAASC,EAAYF,EAAeG,EAAe,CACxB,CAAC,GAAGA,CAAa,EAAE,QAAO,EAClC,QAASC,GAAQ,CAC5B,MAAMC,EAAUL,EAAc,WAAWI,CAAG,EAC5CC,GAAWC,EAAUN,EAAeK,CAAO,EACvCL,EAAc,iBACdA,EAAc,gBAAgB,QAASO,GAAU,CAC7CL,EAAYK,EAAOJ,CAAa,CAChD,CAAa,CAEb,CAAK,CACL,CACA,SAASK,GAAUR,EAAeS,EAAY,CAC1C,GAAI,MAAM,QAAQA,CAAU,EACxB,OAAOP,EAAYF,EAAeS,CAAU,EAE3C,GAAI,OAAOA,GAAe,SAC3B,OAAOP,EAAYF,EAAe,CAACS,CAAU,CAAC,EAG9CH,EAAUN,EAAeS,CAAU,CAE3C,CA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CAED,CAAA,CAAA,EAAAzE,GAAAQ,MAAA4B,EAAA,EAAA,CACD,WAAA,CAAA,MAAA,EAAA,EAAA,QAAA,CAEE,QAAA,EAAA,EAAA,CAhGC,EAiGN,QAAA,CAAA,QAAA,EAED,EAAA,CACF,EACA,UAAA,iEACE,SAAA5B,EAAA,IAAAC,EAAA,CAAA,GAAA,IAAA,SACA6C,CAAG,CAAA,CAEF,CACC,CAAA,CAAA,CACA,CAAA","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"_layout-D7Qo_r0X.js","sources":["../../../../../node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs","../../../../../node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs","../../../app/routes/_app+/_layout.tsx"],"sourcesContent":["import { invariant } from '../../utils/errors.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { animateVisualElement } from '../interfaces/visual-element.mjs';\n\nfunction stopAnimation(visualElement) {\n visualElement.values.forEach((value) => value.stop());\n}\nfunction setVariants(visualElement, variantLabels) {\n const reversedLabels = [...variantLabels].reverse();\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key);\n variant && setTarget(visualElement, variant);\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels);\n });\n }\n });\n}\nfunction setValues(visualElement, definition) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition);\n }\n else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition]);\n }\n else {\n setTarget(visualElement, definition);\n }\n}\n/**\n * @public\n */\nfunction animationControls() {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false;\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set();\n const controls = {\n subscribe(visualElement) {\n subscribers.add(visualElement);\n return () => void subscribers.delete(visualElement);\n },\n start(definition, transitionOverride) {\n invariant(hasMounted, \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\n const animations = [];\n subscribers.forEach((visualElement) => {\n animations.push(animateVisualElement(visualElement, definition, {\n transitionOverride,\n }));\n });\n return Promise.all(animations);\n },\n set(definition) {\n invariant(hasMounted, \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition);\n });\n },\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement);\n });\n },\n mount() {\n hasMounted = true;\n return () => {\n hasMounted = false;\n controls.stop();\n };\n },\n };\n return controls;\n}\n\nexport { animationControls, setValues };\n","import { animationControls } from './animation-controls.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * Creates `AnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `AnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return <motion.div animate={controls} />\n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nfunction useAnimationControls() {\n const controls = useConstant(animationControls);\n useIsomorphicLayoutEffect(controls.mount, []);\n return controls;\n}\nconst useAnimation = useAnimationControls;\n\nexport { useAnimation, useAnimationControls };\n","import {\n\textractNumbersAndTypeFromAppNameOrPath,\n\tgetExercises,\n\tgetPlaygroundAppName,\n\tgetWorkshopTitle,\n} from '@epic-web/workshop-utils/apps.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\ttype LoaderFunctionArgs,\n\ttype HeadersFunction,\n\tjson,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tNavLink,\n\tOutlet,\n\tuseLoaderData,\n\tuseParams,\n} from '@remix-run/react'\nimport { clsx } from 'clsx'\nimport {\n\ttype AnimationControls,\n\tmotion,\n\tuseAnimationControls,\n} from 'framer-motion'\nimport * as React from 'react'\nimport {\n\tuseNextExerciseRoute,\n\tuseExerciseProgressClassName,\n\ttype ProgressItemSearch,\n\tuseProgressItemClassName,\n} from '../progress.tsx'\nimport { ThemeSwitch } from '../theme/index.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport {\n\tSimpleTooltip,\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from '#app/components/ui/tooltip.tsx'\nimport { useOptionalUser } from '#app/components/user.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { type User, usePresence } from '#app/utils/presence.tsx'\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tconst [exercises, workshopTitle, playgroundAppName] = await Promise.all([\n\t\tgetExercises({ request, timings }),\n\t\tgetWorkshopTitle(),\n\t\tgetPlaygroundAppName(),\n\t])\n\n\tconst playground = {\n\t\tappName: playgroundAppName,\n\t\texerciseNumber: Number(\n\t\t\textractNumbersAndTypeFromAppNameOrPath(playgroundAppName ?? '')\n\t\t\t\t?.exerciseNumber,\n\t\t),\n\t}\n\n\tconst result = json(\n\t\t{\n\t\t\tworkshopTitle,\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\tsolutions: e.solutions.map(({ stepNumber, title, name }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle,\n\t\t\t\t\tname,\n\t\t\t\t})),\n\t\t\t\tproblems: e.problems.map(({ stepNumber, title, name }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle,\n\t\t\t\t\tname,\n\t\t\t\t})),\n\t\t\t\tsteps: e.steps.map(({ stepNumber, problem, solution }) => ({\n\t\t\t\t\tstepNumber,\n\t\t\t\t\ttitle: problem?.title ?? solution?.title ?? 'Unknown',\n\t\t\t\t\tname: problem?.name ?? solution?.name ?? 'Unknown',\n\t\t\t\t})),\n\t\t\t})),\n\t\t\tplayground,\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\tVary: 'Cookie',\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\tVary: 'Cookie',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst opacities = ['opacity-70', 'opacity-80', 'opacity-90', 'opacity-100']\nconst shadows = [\n\t'shadow-[0_0_2px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_4px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_7px_0_rgba(0,0,0,0.3)]',\n\t'shadow-[0_0_10px_0_rgba(0,0,0,0.3)]',\n]\nfunction getScoreClassNames(score: number) {\n\tconst opacityNumber = Math.round(score * opacities.length - 1)\n\tconst shadowNumber = Math.round(score * shadows.length - 1)\n\treturn cn(\n\t\t'shadow-purple-700 hover:opacity-100 focus:opacity-100 dark:shadow-purple-200',\n\t\topacities[opacityNumber] ?? 'opacity-60',\n\t\tshadows[shadowNumber] ?? 'shadow-none',\n\t\tscore === 1 ? 'animate-pulse hover:animate-none focus:animate-none' : null,\n\t)\n}\n\nfunction FacePile({ isMenuOpened }: { isMenuOpened: boolean }) {\n\tconst loggedInUser = useOptionalUser()\n\tconst { users } = usePresence()\n\tconst limit = isMenuOpened ? 17 : 0\n\tconst numberOverLimit = users.length - limit\n\tif (!users.length) return null\n\tconst tiffany =\n\t\tisMenuOpened && users.length === 1 ? (\n\t\t\t<Link\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\tto=\"https://www.youtube.com/watch?v=w6Q3mHyzn78\"\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\talt=\"Tiffany Tunes\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'h-8 w-8 rounded-full border object-cover',\n\t\t\t\t\t\tgetScoreClassNames(1),\n\t\t\t\t\t)}\n\t\t\t\t\tsrc=\"https://github-production-user-asset-6210df.s3.amazonaws.com/1500684/277090714-b26e5961-4ee5-4c20-abdb-b04c1c480f2b.png\"\n\t\t\t\t/>\n\t\t\t</Link>\n\t\t) : null\n\tconst overLimitLabel = `${numberOverLimit}${\n\t\tisMenuOpened ? ' more ' : ' '\n\t}Epic Web Dev${numberOverLimit === 1 ? '' : 's'} working now`\n\treturn (\n\t\t<div className=\"flex flex-wrap items-center gap-2\">\n\t\t\t<TooltipProvider>\n\t\t\t\t{users.slice(0, limit).map(({ user, score }) => {\n\t\t\t\t\tconst scoreClassNames = getScoreClassNames(score)\n\t\t\t\t\tconst locationLabel = getLocationLabel(user.location)\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Tooltip key={user.id}>\n\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t{user.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\t\talt={user.name || 'Epic Web Dev'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'h-8 w-8 rounded-full border object-cover',\n\t\t\t\t\t\t\t\t\t\t\tscoreClassNames,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\tsrc={user.avatarUrl}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\t\taria-label={user.name || 'Epic Web Dev'}\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'flex h-8 w-8 items-center justify-center rounded-full border',\n\t\t\t\t\t\t\t\t\t\t\tscoreClassNames,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Icon name=\"User\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t<span className=\"flex flex-col items-center justify-center gap-1\">\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t{user.name || 'An EPIC Web Dev'}{' '}\n\t\t\t\t\t\t\t\t\t\t{locationLabel\n\t\t\t\t\t\t\t\t\t\t\t? ` is working ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tscore === 1 && loggedInUser?.id !== user.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'with you'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t} on`\n\t\t\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{locationLabel?.line1 ? (\n\t\t\t\t\t\t\t\t\t\t<span>{locationLabel.line1}</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{locationLabel?.line2 ? (\n\t\t\t\t\t\t\t\t\t\t<span>{locationLabel.line2}</span>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t\t{tiffany}\n\t\t\t\t{numberOverLimit > 0 ? (\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\taria-label={overLimitLabel}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'flex items-center justify-center rounded-full border bg-accent text-xs text-accent-foreground',\n\t\t\t\t\t\t\t\t\tisMenuOpened ? 'h-8 w-8' : 'h-6 w-6',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'pointer-events-none overflow-hidden text-ellipsis whitespace-nowrap text-center',\n\t\t\t\t\t\t\t\t\t\tisMenuOpened ? 'w-8' : 'w-6',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{isMenuOpened ? `+${numberOverLimit}` : numberOverLimit}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>{overLimitLabel}</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : null}\n\t\t\t</TooltipProvider>\n\t\t</div>\n\t)\n}\n\nexport default function App() {\n\tconst user = useOptionalUser()\n\n\tconst [isMenuOpened, setMenuOpened] = React.useState(false)\n\n\treturn (\n\t\t<div className=\"flex flex-col\">\n\t\t\t{user ? null : <EpicWebBanner />}\n\t\t\t<div\n\t\t\t\tclassName={cn('flex flex-grow', {\n\t\t\t\t\t'h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]':\n\t\t\t\t\t\t!user,\n\t\t\t\t\t'h-[calc(100vh-112px-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))]':\n\t\t\t\t\t\tENV.EPICSHOP_DEPLOYED,\n\t\t\t\t\t'h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]':\n\t\t\t\t\t\tuser,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Navigation\n\t\t\t\t\tisMenuOpened={isMenuOpened}\n\t\t\t\t\tonMenuOpenChange={setMenuOpened}\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'h-full w-full max-w-[calc(100%-56px)]',\n\t\t\t\t\t\tisMenuOpened ? 'hidden md:block' : '',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<Outlet />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction getLocationLabel(location: User['location']) {\n\tif (!location) return null\n\n\tconst { exercise } = location\n\n\tconst exercisePortion = [\n\t\texercise\n\t\t\t? [exercise.exerciseNumber, exercise.stepNumber]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.map(s => s.toString().padStart(2, '0'))\n\t\t\t\t\t.join('/')\n\t\t\t: null,\n\t\texercise?.type,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' - ')\n\treturn { line1: location.workshopTitle, line2: exercisePortion }\n}\n\nfunction EpicWebBanner() {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'z-10 flex items-center justify-between border-b bg-gradient-to-tr from-blue-500 to-indigo-500 pl-4 text-white',\n\t\t\t\tENV.EPICSHOP_DEPLOYED ? 'h-[112px] md:h-[64px]' : 'h-16',\n\t\t\t)}\n\t\t>\n\t\t\t<div className=\"flex flex-1 flex-wrap items-center gap-4\">\n\t\t\t\t<Icon name=\"EpicWeb\" size=\"lg\" />\n\t\t\t\t<div className=\"flex flex-1 flex-wrap items-center\">\n\t\t\t\t\t<p className=\"mr-2\">\n\t\t\t\t\t\tWelcome to the{' '}\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"https://www.epicweb.dev\"\n\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tEpicWeb.dev\n\t\t\t\t\t\t</Link>{' '}\n\t\t\t\t\t\tWorkshop app!\n\t\t\t\t\t</p>\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? (\n\t\t\t\t\t\t<small className=\"text-sm\">\n\t\t\t\t\t\t\tThis is the deployed version.{' '}\n\t\t\t\t\t\t\t{ENV.EPICSHOP_GITHUB_ROOT ? (\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\tto={ENV.EPICSHOP_GITHUB_ROOT}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tRun locally\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t) : null}{' '}\n\t\t\t\t\t\t\tfor full experience.\n\t\t\t\t\t\t</small>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-col items-center md:flex-row\">\n\t\t\t\t<Link\n\t\t\t\t\tto=\"https://www.epicweb.dev\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"drop-shadow-sm\">Join Epic Web</span>\n\t\t\t\t\t<span>↗︎</span>\n\t\t\t\t</Link>\n\t\t\t\t<Link\n\t\t\t\t\tto={\n\t\t\t\t\t\tENV.EPICSHOP_DEPLOYED ? 'https://www.epicweb.dev/login' : '/login'\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30\"\n\t\t\t\t>\n\t\t\t\t\t<Icon name=\"User\" size=\"lg\" />\n\t\t\t\t\t<span className=\"drop-shadow-sm\">Login</span>\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nconst itemVariants = {\n\thidden: { opacity: 0, x: -20 },\n\tvisible: { opacity: 1, x: 0 },\n}\nfunction NavigationExerciseListItem({\n\texerciseNumber,\n\tchildren,\n}: {\n\texerciseNumber: number\n\tchildren: React.ReactNode\n}) {\n\tconst progressClassName = useExerciseProgressClassName(exerciseNumber)\n\treturn (\n\t\t<motion.li\n\t\t\tvariants={itemVariants}\n\t\t\tclassName={cn(\n\t\t\t\t// add gap of 3 to children, but using padding so the progress extends through the whole height\n\t\t\t\t'py-[6px] first:pt-3 last:pb-3',\n\t\t\t\tprogressClassName ? `${progressClassName} before:border-t` : null,\n\t\t\t)}\n\t\t>\n\t\t\t<span className=\"ml-2\">{children}</span>\n\t\t</motion.li>\n\t)\n}\n\nfunction NavigationExerciseStepListItem({\n\tchildren,\n\t...progressItemSearch\n}: {\n\tchildren: React.ReactNode\n} & ProgressItemSearch) {\n\tconst progressClassName = useProgressItemClassName(progressItemSearch)\n\treturn (\n\t\t<motion.li\n\t\t\tvariants={itemVariants}\n\t\t\tclassName={cn(\n\t\t\t\t// add gap of 3 to children, but using padding so the progress extends through the whole height\n\t\t\t\t'py-[6px] first:pt-3 last:pb-3',\n\t\t\t\tprogressClassName ? `${progressClassName} before:border-t` : null,\n\t\t\t)}\n\t\t>\n\t\t\t<span className=\"ml-2\">{children}</span>\n\t\t</motion.li>\n\t)\n}\n\nconst OPENED_MENU_WIDTH = 400\n\nfunction Navigation({\n\tisMenuOpened,\n\tonMenuOpenChange: setMenuOpened,\n}: {\n\tisMenuOpened: boolean\n\tonMenuOpenChange: (change: boolean) => void\n}) {\n\tconst data = useLoaderData<typeof loader>()\n\tconst user = useOptionalUser()\n\tconst nextExerciseRoute = useNextExerciseRoute()\n\tconst params = useParams()\n\tconst { users } = usePresence()\n\n\tconst exercise = data.exercises.find(\n\t\te => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tconst app =\n\t\tparams.type === 'solution'\n\t\t\t? exercise?.solutions.find(\n\t\t\t\t\ts => s.stepNumber === Number(params.stepNumber),\n\t\t\t\t)\n\t\t\t: params.type === 'problem'\n\t\t\t\t? exercise?.problems.find(\n\t\t\t\t\t\tp => p.stepNumber === Number(params.stepNumber),\n\t\t\t\t\t)\n\t\t\t\t: null\n\n\t// container\n\tconst menuControls = useAnimationControls()\n\tconst menuVariants = {\n\t\tclose: { width: 56 },\n\t\topen: { width: OPENED_MENU_WIDTH },\n\t}\n\n\t// items\n\tconst listVariants = {\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\ttransition: {\n\t\t\t\tduration: 0.05,\n\t\t\t\twhen: 'beforeChildren',\n\t\t\t\tstaggerChildren: 0.03,\n\t\t\t},\n\t\t},\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t},\n\t}\n\tconst exNum = Number(params.exerciseNumber).toString().padStart(2, '0')\n\n\treturn (\n\t\t<nav className=\"flex border-r\">\n\t\t\t<motion.div\n\t\t\t\tinitial={isMenuOpened ? 'open' : 'close'}\n\t\t\t\tvariants={menuVariants}\n\t\t\t\tanimate={menuControls}\n\t\t\t>\n\t\t\t\t<div className=\"flex h-full flex-col items-center justify-between\">\n\t\t\t\t\t<NavToggle\n\t\t\t\t\t\ttitle={data.workshopTitle}\n\t\t\t\t\t\tmenuControls={menuControls}\n\t\t\t\t\t\tisMenuOpened={isMenuOpened}\n\t\t\t\t\t\tsetMenuOpened={setMenuOpened}\n\t\t\t\t\t/>\n\t\t\t\t\t{isMenuOpened && (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tstyle={{ width: OPENED_MENU_WIDTH }}\n\t\t\t\t\t\t\tclassName=\"flex flex-grow flex-col justify-between overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar\"\n\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<motion.ul\n\t\t\t\t\t\t\t\tvariants={listVariants}\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\t\tclassName=\"flex flex-col\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{data.exercises.map(({ exerciseNumber, title, steps }) => {\n\t\t\t\t\t\t\t\t\tconst isActive =\n\t\t\t\t\t\t\t\t\t\tNumber(params.exerciseNumber) === exerciseNumber\n\t\t\t\t\t\t\t\t\tconst showPlayground =\n\t\t\t\t\t\t\t\t\t\t!isActive &&\n\t\t\t\t\t\t\t\t\t\tdata.playground.exerciseNumber === exerciseNumber\n\t\t\t\t\t\t\t\t\tconst exerciseNum = exerciseNumber.toString().padStart(2, '0')\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<NavigationExerciseListItem\n\t\t\t\t\t\t\t\t\t\t\tkey={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}`}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ 'bg-foreground text-background': isActive },\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t\t\t\t\t{showPlayground ? ' 🛝' : null}\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t{isActive ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<motion.ul\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariants={listVariants}\n\t\t\t\t\t\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"ml-4 mt-4 flex flex-col\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"instructions\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!params.stepNumber,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIntro\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{steps\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.map(({ name, stepNumber, title }) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isActive =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNumber(params.stepNumber) === stepNumber\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst step = stepNumber\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.padStart(2, '0')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isPlayground =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname === data.playground.appName\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={stepNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"step\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstepNumber={stepNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}/${step}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{isPlayground\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? `${step}. ${title} 🛝`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: `${step}. ${title}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<NavigationExerciseStepListItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texerciseNumber={exerciseNumber}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto={`/${exerciseNum}/finished`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"] hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bg-foreground text-background': isActive,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t📝 Elaboration\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</NavLink>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</NavigationExerciseStepListItem>\n\t\t\t\t\t\t\t\t\t\t\t\t</motion.ul>\n\t\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t</NavigationExerciseListItem>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</motion.ul>\n\t\t\t\t\t\t\t<div className=\"mt-6\">\n\t\t\t\t\t\t\t\t<NavLink\n\t\t\t\t\t\t\t\t\tto=\"/finished\"\n\t\t\t\t\t\t\t\t\tclassName={({ isActive }) =>\n\t\t\t\t\t\t\t\t\t\tclsx(\n\t\t\t\t\t\t\t\t\t\t\t'relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline',\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[\"\"]':\n\t\t\t\t\t\t\t\t\t\t\t\t\tisActive,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t📝 Workshop Feedback\n\t\t\t\t\t\t\t\t</NavLink>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t)}\n\t\t\t\t\t{!isMenuOpened && (\n\t\t\t\t\t\t<div className=\"flex flex-grow flex-col justify-center\">\n\t\t\t\t\t\t\t<div className=\"orientation-sideways w-full font-mono text-sm font-medium uppercase leading-none\">\n\t\t\t\t\t\t\t\t{exercise?.title ? (\n\t\t\t\t\t\t\t\t\t<Link to={`/${exNum}`}>{exercise.title}</Link>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t{exercise?.title && app?.title ? ' — ' : null}\n\t\t\t\t\t\t\t\t{app?.title ? (\n\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\tto={`/${exNum}/${app.stepNumber\n\t\t\t\t\t\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t\t\t\t\t\t.padStart(2, '0')}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{app.title}\n\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex w-full items-center justify-start border-t p-4 transition-[height]',\n\t\t\t\t\t\t\tisMenuOpened && users.length > 4 ? 'h-28' : 'h-14',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tstyle={isMenuOpened ? { width: OPENED_MENU_WIDTH } : {}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FacePile isMenuOpened={isMenuOpened} />\n\t\t\t\t\t</div>\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? null : user ? (\n\t\t\t\t\t\t<SimpleTooltip content={isMenuOpened ? null : 'Your account'}>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tclassName=\"flex h-14 w-full items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline\"\n\t\t\t\t\t\t\t\tto=\"/account\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{user.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\talt={user.name ?? user.email}\n\t\t\t\t\t\t\t\t\t\tsrc={user.avatarUrl}\n\t\t\t\t\t\t\t\t\t\tclassName=\"h-full rounded-full\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<Icon name=\"User\" className=\"flex-shrink-0\" size=\"lg\" />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{isMenuOpened ? (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"flex items-center whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tYour Account\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<span className=\"sr-only\">Your account</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{ENV.EPICSHOP_DEPLOYED ? null : user && nextExerciseRoute ? (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tcontent={isMenuOpened ? null : 'Continue to next lesson'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={nextExerciseRoute}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t\tclassName={clsx(\n\t\t\t\t\t\t\t\t\t'flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tstate={{ from: 'continue next lesson button' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"FastForward\" className=\"flex-shrink-0\" size=\"md\" />\n\t\t\t\t\t\t\t\t{isMenuOpened ? (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"flex items-center whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tContinue to next lesson\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<span className=\"sr-only\">Continue to next lesson</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t) : null}\n\t\t\t\t\t<div className=\"mb-4 w-full self-start border-t pl-3 pt-[15px]\">\n\t\t\t\t\t\t<ThemeSwitch />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t</nav>\n\t)\n}\n\nfunction NavToggle({\n\ttitle,\n\tisMenuOpened,\n\tsetMenuOpened,\n\tmenuControls,\n}: {\n\ttitle: string\n\tisMenuOpened: boolean\n\tsetMenuOpened: (value: boolean) => void\n\tmenuControls: AnimationControls\n}) {\n\tconst path01Variants = {\n\t\topen: { d: 'M3.06061 2.99999L21.0606 21' },\n\t\tclosed: { d: 'M0 9.5L24 9.5' },\n\t}\n\tconst path02Variants = {\n\t\topen: { d: 'M3.00006 21.0607L21 3.06064' },\n\t\tmoving: { d: 'M0 14.5L24 14.5' },\n\t\tclosed: { d: 'M0 14.5L15 14.5' },\n\t}\n\tconst path01Controls = useAnimationControls()\n\tconst path02Controls = useAnimationControls()\n\n\tasync function toggleMenu() {\n\t\tvoid menuControls.start(isMenuOpened ? 'close' : 'open')\n\t\tsetMenuOpened(!isMenuOpened)\n\t\tif (isMenuOpened) {\n\t\t\tvoid path01Controls.start(path01Variants.closed)\n\t\t\tawait path02Controls.start(path02Variants.moving)\n\t\t\tvoid path02Controls.start(path02Variants.closed)\n\t\t} else {\n\t\t\tawait path02Controls.start(path02Variants.moving)\n\t\t\tvoid path01Controls.start(path01Variants.open)\n\t\t\tvoid path02Controls.start(path02Variants.open)\n\t\t}\n\t}\n\n\tconst latestToggleMenu = React.useRef(toggleMenu)\n\tReact.useEffect(() => {\n\t\tlatestToggleMenu.current = toggleMenu\n\t})\n\n\tReact.useEffect(() => {\n\t\tif (!isMenuOpened) return\n\n\t\tfunction handleKeyUp(event: KeyboardEvent) {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tvoid latestToggleMenu.current()\n\t\t\t}\n\t\t}\n\t\tdocument.addEventListener('keyup', handleKeyUp)\n\t\treturn () => document.removeEventListener('keyup', handleKeyUp)\n\t}, [isMenuOpened])\n\n\treturn (\n\t\t<div className=\"relative inline-flex h-14 w-full items-center justify-between overflow-hidden border-b\">\n\t\t\t<button\n\t\t\t\tclassName=\"flex h-14 w-14 items-center justify-center\"\n\t\t\t\taria-label=\"Open Navigation menu\"\n\t\t\t\tonClick={toggleMenu}\n\t\t\t>\n\t\t\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n\t\t\t\t\t<motion.path\n\t\t\t\t\t\t{...path01Variants.closed}\n\t\t\t\t\t\tanimate={path01Controls}\n\t\t\t\t\t\ttransition={{ duration: 0.2 }}\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t/>\n\t\t\t\t\t<motion.path\n\t\t\t\t\t\t{...path02Variants.closed}\n\t\t\t\t\t\tanimate={path02Controls}\n\t\t\t\t\t\ttransition={{ duration: 0.2 }}\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t</button>\n\t\t\t{isMenuOpened && (\n\t\t\t\t<motion.p\n\t\t\t\t\ttransition={{ delay: 0.2 }}\n\t\t\t\t\tinitial={{ opacity: 0, y: 5 }}\n\t\t\t\t\tanimate={{ opacity: 1, y: 0 }}\n\t\t\t\t\tclassName=\"absolute right-5 whitespace-nowrap font-mono text-sm uppercase\"\n\t\t\t\t>\n\t\t\t\t\t<Link to=\"/\">{title}</Link>\n\t\t\t\t</motion.p>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["stopAnimation","visualElement","value","setVariants","variantLabels","key","variant","setTarget","child","setValues","definition","animationControls","subscribers","controls","transitionOverride","animations","animateVisualElement","useAnimationControls","useConstant","useIsomorphicLayoutEffect","opacities","shadows","getScoreClassNames","score","opacityNumber","shadowNumber","cn","FacePile","isMenuOpened","loggedInUser","useOptionalUser","users","usePresence","limit","numberOverLimit","tiffany","jsx","Link","overLimitLabel","jsxs","TooltipProvider","user","scoreClassNames","locationLabel","getLocationLabel","Tooltip","TooltipTrigger","Icon","TooltipContent","headers","setMenuOpened","React.useState","EpicWebBanner","Navigation","Outlet","location","exercise","exercisePortion","s","itemVariants","NavigationExerciseListItem","exerciseNumber","children","progressClassName","motion","progressItemSearch","useProgressItemClassName","OPENED_MENU_WIDTH","data","useLoaderData","nextExerciseRoute","useNextExerciseRoute","params","useParams","e","app","p","menuControls","menuVariants","listVariants","exNum","NavToggle","title","steps","isActive","showPlayground","exerciseNum","clsx","NavigationExerciseStepListItem","name","stepNumber","title2","isPlayground","step","isActive2","NavLink","SimpleTooltip","ThemeSwitch","path01Variants","path02Variants","path01Controls","path02Controls","toggleMenu","latestToggleMenu","React.useRef","React.useEffect","handleKeyUp","event"],"mappings":"6iBAIA,SAASA,GAAcC,EAAe,CAClCA,EAAc,OAAO,QAASC,GAAUA,EAAM,KAAI,CAAE,CACxD,CACA,SAASC,EAAYF,EAAeG,EAAe,CACxB,CAAC,GAAGA,CAAa,EAAE,QAAO,EAClC,QAASC,GAAQ,CAC5B,MAAMC,EAAUL,EAAc,WAAWI,CAAG,EAC5CC,GAAWC,EAAUN,EAAeK,CAAO,EACvCL,EAAc,iBACdA,EAAc,gBAAgB,QAASO,GAAU,CAC7CL,EAAYK,EAAOJ,CAAa,CAChD,CAAa,CAEb,CAAK,CACL,CACA,SAASK,GAAUR,EAAeS,EAAY,CAC1C,GAAI,MAAM,QAAQA,CAAU,EACxB,OAAOP,EAAYF,EAAeS,CAAU,EAE3C,GAAI,OAAOA,GAAe,SAC3B,OAAOP,EAAYF,EAAe,CAACS,CAAU,CAAC,EAG9CH,EAAUN,EAAeS,CAAU,CAE3C,CAIA,SAASC,IAAoB,CAQzB,MAAMC,EAAc,IAAI,IAClBC,EAAW,CACb,UAAUZ,EAAe,CACrB,OAAAW,EAAY,IAAIX,CAAa,EACtB,IAAM,KAAKW,EAAY,OAAOX,CAAa,CACrD,EACD,MAAMS,EAAYI,EAAoB,CAElC,MAAMC,EAAa,CAAA,EACnB,OAAAH,EAAY,QAASX,GAAkB,CACnCc,EAAW,KAAKC,EAAqBf,EAAeS,EAAY,CAC5D,mBAAAI,CACH,CAAA,CAAC,CAClB,CAAa,EACM,QAAQ,IAAIC,CAAU,CAChC,EACD,IAAIL,EAAY,CAEZ,OAAOE,EAAY,QAASX,GAAkB,CAC1CQ,GAAUR,EAAeS,CAAU,CACnD,CAAa,CACJ,EACD,MAAO,CACHE,EAAY,QAASX,GAAkB,CACnCD,GAAcC,CAAa,CAC3C,CAAa,CACJ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ACL,EACAG,EAAAA,UAAA,IAAA,CAEA,GAAA,CAAA7E,EAAA,OAAC,SAAA8E,EAAAC,EAAA,CAAAA,EAAA,MAAA,UAAAJ,EAAA,SAES,CAER,gBAAA,iBAAA,QAAAG,CAAA,EACA,IAAA,SAAA,oBAAA,QAAAA,CAAA,CAAA,EAAA,CAAA9E,CAAA,CAAA,EAGAW,EAAAA,KAAA,MAAA,CACD,UAAA,yFAEC,SAAA,CAAAH,EAAA,IAAA,SAAA,CAEmB,UAAA,6CACrB,aAAA,uBAAA,QAAAkE,EAnBK,SAAA/D,EAAA,KAAA,MAAA,CAoBN,MAAA,KAAA,OAAA,KAGH,QAAA,YAAC,SAAA,CAAAH,EAAAA,IAAA4B,EAAA,KAAA,CAAA,GAAAkC,EAAA,OAAA,QAAAE,EAEA,WAAA,CAEA,SAAA,EAAC,EAAA,OAAA,eACA,YAAA,GAAmB,CAAA,EAAAhE,EAAAA,IAAA4B,EAAA,KACV,CAAA,GAAAmC,EAAA,OAGP,QAAAE,EACA,WAAA,CAAA,SAAA,EAEA,EACD,OAAA,eAED,YAAA,GAAA,CAAA,CAAA,CAAA,CAED,CAAA,CAAA,EAAAzE,GAAAQ,MAAA4B,EAAA,EAAA,CACD,WAAA,CAAA,MAAA,EAAA,EAAA,QAAA,CAEE,QAAA,EAAA,EAAA,CAhGC,EAiGN,QAAA,CAAA,QAAA,EAED,EAAA,CACF,EACA,UAAA,iEACE,SAAA5B,EAAA,IAAAC,EAAA,CAAA,GAAA,IAAA,SACA6C,CAAG,CAAA,CAEF,CACC,CAAA,CAAA,CACA,CAAA","x_google_ignoreList":[0,1]}
@@ -0,0 +1,36 @@
1
+ import{e as k,r as d,j as p}from"./index-D1WEsmVZ.js";import{b as C}from"./components-Dj3sm47B.js";function g(e){function r(o,t){var a;const s=e[t];if(!s)throw new Error(`Unknown client hint: ${typeof t=="string"?t:"Unknown"}`);const u=(a=o.split(";").map(c=>c.trim()).find(c=>c.startsWith(s.cookieName+"=")))==null?void 0:a.split("=")[1];return u?decodeURIComponent(u):null}function n(o){const t=typeof document<"u"?document.cookie:typeof o<"u"?o.headers.get("Cookie")??"":"";return Object.entries(e).reduce((s,[u,a])=>{const c=u;return"transform"in a?s[c]=a.transform(r(t,c)??a.fallback):s[c]=r(t,c)??a.fallback,s},{})}function i(){return`
2
+ // This block of code allows us to check if the client hints have changed and
3
+ // force a reload of the page with updated hints if they have so you don't get
4
+ // a flash of incorrect content.
5
+ function checkClientHints() {
6
+ if (!navigator.cookieEnabled) return;
7
+
8
+ // set a short-lived cookie to make sure we can set cookies
9
+ document.cookie = "canSetCookies=1; Max-Age=60; SameSite=Lax";
10
+ const canSetCookies = document.cookie.includes("canSetCookies=1");
11
+ document.cookie = "canSetCookies=; Max-Age=-1; path=/";
12
+ if (!canSetCookies) return;
13
+
14
+ const cookies = document.cookie.split(';').map(c => c.trim()).reduce((acc, cur) => {
15
+ const [key, value] = cur.split('=');
16
+ acc[key] = value;
17
+ return acc;
18
+ }, {});
19
+
20
+ let cookieChanged = false;
21
+ const hints = [
22
+ ${Object.values(e).map(o=>{const t=JSON.stringify(o.cookieName);return`{ name: ${t}, actual: String(${o.getValueCode}), value: cookies[${t}] != null ? cookies[${t}] : encodeURIComponent("${o.fallback}") }`}).join(`,
23
+ `)}
24
+ ];
25
+ for (const hint of hints) {
26
+ document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; path=/';
27
+ if (decodeURIComponent(hint.value) !== hint.actual) {
28
+ cookieChanged = true;
29
+ }
30
+ }
31
+ if (cookieChanged) window.location.reload();
32
+ }
33
+
34
+ checkClientHints();
35
+ `}return{getHints:n,getClientHintCheckScript:i}}const l={cookieName:"CH-prefers-color-scheme",getValueCode:"window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'",fallback:"light",transform(e){return e==="dark"?"dark":"light"}};function v(e,r=l.cookieName){const n=window.matchMedia("(prefers-color-scheme: dark)");function i(){const o=n.matches?"dark":"light";document.cookie=`${r}=${o}; Max-Age=31536000; Path=/`,e(o)}return n.addEventListener("change",i),function(){n.removeEventListener("change",i)}}const m={cookieName:"CH-reduced-motion",getValueCode:"window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'reduce' : 'no-preference'",fallback:"no-preference",transform(e){return e==="reduce"?"reduce":"no-preference"}};function H(e,r=m.cookieName){const n=window.matchMedia("(prefers-reduced-motion: reduce)");function i(){const o=n.matches?"reduce":"no-preference";document.cookie=`${r}=${o}; Max-Age=31536000; Path=/`,e(o)}return n.addEventListener("change",i),function(){n.removeEventListener("change",i)}}const S={cookieName:"CH-time-zone",getValueCode:"Intl.DateTimeFormat().resolvedOptions().timeZone",fallback:"UTC"};function w(){return C("root").requestInfo}const h="EpicShop_CH-prefers-color-scheme",f="EpicShop_CH-reduced-motion",M=g({theme:{...l,cookieName:h},timeZone:{...S,cookieName:"EpicShop_CH-time-zone"},reducedMotion:{...m,cookieName:f}});function E(){return w().hints}function $(){const{revalidate:e}=k();return d.useEffect(()=>v(()=>e(),h),[e]),d.useEffect(()=>H(()=>e(),f),[e]),p.jsx("script",{dangerouslySetInnerHTML:{__html:M.getClientHintCheckScript()}})}export{$ as C,w as a,E as u};
36
+ //# sourceMappingURL=client-hints-KnbHFIgn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-hints-KnbHFIgn.js","sources":["../../../../../node_modules/@epic-web/client-hints/dist/index.js","../../../../../node_modules/@epic-web/client-hints/dist/color-scheme.js","../../../../../node_modules/@epic-web/client-hints/dist/reduced-motion.js","../../../../../node_modules/@epic-web/client-hints/dist/time-zone.js","../../../app/utils/request-info.ts","../../../app/utils/client-hints.tsx"],"sourcesContent":["export function getHintUtils(hints) {\n function getCookieValue(cookieString, name) {\n const hint = hints[name];\n if (!hint) {\n throw new Error(`Unknown client hint: ${typeof name === 'string' ? name : 'Unknown'}`);\n }\n const value = cookieString\n .split(';')\n .map((c) => c.trim())\n .find((c) => c.startsWith(hint.cookieName + '='))\n ?.split('=')[1];\n return value ? decodeURIComponent(value) : null;\n }\n function getHints(request) {\n const cookieString = typeof document !== 'undefined'\n ? document.cookie\n : typeof request !== 'undefined'\n ? request.headers.get('Cookie') ?? ''\n : '';\n return Object.entries(hints).reduce((acc, [name, hint]) => {\n const hintName = name;\n if ('transform' in hint) {\n // @ts-expect-error - this is fine (PRs welcome though)\n acc[hintName] = hint.transform(getCookieValue(cookieString, hintName) ?? hint.fallback);\n }\n else {\n // @ts-expect-error - this is fine (PRs welcome though)\n acc[hintName] = getCookieValue(cookieString, hintName) ?? hint.fallback;\n }\n return acc;\n }, {});\n }\n /**\n * This returns a string of JavaScript that can be used to check if the client\n * hints have changed and will reload the page if they have.\n */\n function getClientHintCheckScript() {\n return `\n// This block of code allows us to check if the client hints have changed and\n// force a reload of the page with updated hints if they have so you don't get\n// a flash of incorrect content.\nfunction checkClientHints() {\n\tif (!navigator.cookieEnabled) return;\n\n\t// set a short-lived cookie to make sure we can set cookies\n\tdocument.cookie = \"canSetCookies=1; Max-Age=60; SameSite=Lax\";\n\tconst canSetCookies = document.cookie.includes(\"canSetCookies=1\");\n\tdocument.cookie = \"canSetCookies=; Max-Age=-1; path=/\";\n\tif (!canSetCookies) return;\n\n\tconst cookies = document.cookie.split(';').map(c => c.trim()).reduce((acc, cur) => {\n\t\tconst [key, value] = cur.split('=');\n\t\tacc[key] = value;\n\t\treturn acc;\n\t}, {});\n\n\tlet cookieChanged = false;\n\tconst hints = [\n\t${Object.values(hints)\n .map((hint) => {\n const cookieName = JSON.stringify(hint.cookieName);\n return `{ name: ${cookieName}, actual: String(${hint.getValueCode}), value: cookies[${cookieName}] != null ? cookies[${cookieName}] : encodeURIComponent(\"${hint.fallback}\") }`;\n })\n .join(',\\n')}\n\t];\n\tfor (const hint of hints) {\n\t\tdocument.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; path=/';\n\t\tif (decodeURIComponent(hint.value) !== hint.actual) {\n\t\t\tcookieChanged = true;\n\t\t}\n\t}\n\tif (cookieChanged) window.location.reload();\n}\n\ncheckClientHints();\n`;\n }\n return { getHints, getClientHintCheckScript };\n}\n","export const clientHint = {\n cookieName: 'CH-prefers-color-scheme',\n getValueCode: `window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'`,\n fallback: 'light',\n transform(value) {\n return value === 'dark' ? 'dark' : 'light';\n },\n};\n/**\n * Subscribe to changes in the user's color scheme preference. Optionally pass\n * in a cookie name to use for the cookie that will be set if different from the\n * default.\n */\nexport function subscribeToSchemeChange(subscriber, cookieName = clientHint.cookieName) {\n const schemaMatch = window.matchMedia('(prefers-color-scheme: dark)');\n function handleThemeChange() {\n const value = schemaMatch.matches ? 'dark' : 'light';\n document.cookie = `${cookieName}=${value}; Max-Age=31536000; Path=/`;\n subscriber(value);\n }\n schemaMatch.addEventListener('change', handleThemeChange);\n return function cleanupSchemaChange() {\n schemaMatch.removeEventListener('change', handleThemeChange);\n };\n}\n","export const clientHint = {\n cookieName: 'CH-reduced-motion',\n getValueCode: `window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'reduce' : 'no-preference'`,\n fallback: 'no-preference',\n transform(value) {\n return value === 'reduce' ? 'reduce' : 'no-preference';\n },\n};\n/**\n * Subscribe to changes in the user's motion preference. Optionally pass\n * in a cookie name to use for the cookie that will be set if different from the\n * default.\n */\nexport function subscribeToMotionChange(subscriber, cookieName = clientHint.cookieName) {\n const motionMatch = window.matchMedia('(prefers-reduced-motion: reduce)');\n function handleMotionChange() {\n const value = motionMatch.matches ? 'reduce' : 'no-preference';\n document.cookie = `${cookieName}=${value}; Max-Age=31536000; Path=/`;\n subscriber(value);\n }\n motionMatch.addEventListener('change', handleMotionChange);\n return function cleanupMotionChange() {\n motionMatch.removeEventListener('change', handleMotionChange);\n };\n}\n","export const clientHint = {\n cookieName: 'CH-time-zone',\n getValueCode: 'Intl.DateTimeFormat().resolvedOptions().timeZone',\n fallback: 'UTC',\n};\n","import { type SerializeFrom } from '@remix-run/node'\nimport { useRouteLoaderData } from '@remix-run/react'\nimport { type loader as rootLoader } from '#app/root.tsx'\n\n/**\n * @returns the request info from the root loader\n */\nexport function useRequestInfo() {\n\tconst data = useRouteLoaderData('root') as SerializeFrom<typeof rootLoader>\n\treturn data.requestInfo\n}\n","/**\n * This file contains utilities for using client hints for user preference which\n * are needed by the server, but are only known by the browser.\n */\nimport { getHintUtils } from '@epic-web/client-hints'\nimport {\n\tclientHint as colorSchemeHint,\n\tsubscribeToSchemeChange,\n} from '@epic-web/client-hints/color-scheme'\nimport {\n\tclientHint as reducedMotionHint,\n\tsubscribeToMotionChange,\n} from '@epic-web/client-hints/reduced-motion'\nimport { clientHint as timeZoneHint } from '@epic-web/client-hints/time-zone'\nimport { useRevalidator } from '@remix-run/react'\nimport * as React from 'react'\nimport { useRequestInfo } from './request-info.ts'\n\nconst themeCookieName = 'EpicShop_CH-prefers-color-scheme'\nconst motionCookieName = 'EpicShop_CH-reduced-motion'\nconst hintsUtils = getHintUtils({\n\ttheme: {\n\t\t...colorSchemeHint,\n\t\tcookieName: themeCookieName,\n\t},\n\ttimeZone: {\n\t\t...timeZoneHint,\n\t\tcookieName: 'EpicShop_CH-time-zone',\n\t},\n\treducedMotion: {\n\t\t...reducedMotionHint,\n\t\tcookieName: motionCookieName,\n\t},\n\t// add other hints here\n})\n\nexport const { getHints } = hintsUtils\n\n/**\n * @returns an object with the client hints and their values\n */\nexport function useHints() {\n\tconst requestInfo = useRequestInfo()\n\treturn requestInfo.hints\n}\n\n/**\n * @returns inline script element that checks for client hints and sets cookies\n * if they are not set then reloads the page if any cookie was set to an\n * inaccurate value.\n */\nexport function ClientHintCheck() {\n\tconst { revalidate } = useRevalidator()\n\tReact.useEffect(\n\t\t() => subscribeToSchemeChange(() => revalidate(), themeCookieName),\n\t\t[revalidate],\n\t)\n\tReact.useEffect(\n\t\t() => subscribeToMotionChange(() => revalidate(), motionCookieName),\n\t\t[revalidate],\n\t)\n\n\treturn (\n\t\t<script\n\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t__html: hintsUtils.getClientHintCheckScript(),\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["getHintUtils","hints","getCookieValue","cookieString","name","hint","value","_a","getHints","request","acc","hintName","getClientHintCheckScript","cookieName","clientHint","subscribeToSchemeChange","subscriber","schemaMatch","handleThemeChange","subscribeToMotionChange","motionMatch","handleMotionChange","useRequestInfo","useRouteLoaderData","themeCookieName","motionCookieName","hintsUtils","colorSchemeHint","timeZoneHint","reducedMotionHint","useHints","ClientHintCheck","revalidate","useRevalidator","React.useEffect","jsx"],"mappings":"mGAAO,SAASA,EAAaC,EAAO,CAChC,SAASC,EAAeC,EAAcC,EAAM,OACxC,MAAMC,EAAOJ,EAAMG,CAAI,EACvB,GAAI,CAACC,EACD,MAAM,IAAI,MAAM,wBAAwB,OAAOD,GAAS,SAAWA,EAAO,SAAS,EAAE,EAEzF,MAAME,GAAQC,EAAAJ,EACT,MAAM,GAAG,EACT,IAAK,GAAM,EAAE,KAAI,CAAE,EACnB,KAAM,GAAM,EAAE,WAAWE,EAAK,WAAa,GAAG,CAAC,IAHtC,YAAAE,EAIR,MAAM,KAAK,GACjB,OAAOD,EAAQ,mBAAmBA,CAAK,EAAI,IAC9C,CACD,SAASE,EAASC,EAAS,CACvB,MAAMN,EAAe,OAAO,SAAa,IACnC,SAAS,OACT,OAAOM,EAAY,IACfA,EAAQ,QAAQ,IAAI,QAAQ,GAAK,GACjC,GACV,OAAO,OAAO,QAAQR,CAAK,EAAE,OAAO,CAACS,EAAK,CAACN,EAAMC,CAAI,IAAM,CACvD,MAAMM,EAAWP,EACjB,MAAI,cAAeC,EAEfK,EAAIC,CAAQ,EAAIN,EAAK,UAAUH,EAAeC,EAAcQ,CAAQ,GAAKN,EAAK,QAAQ,EAItFK,EAAIC,CAAQ,EAAIT,EAAeC,EAAcQ,CAAQ,GAAKN,EAAK,SAE5DK,CACV,EAAE,CAAE,CAAA,CACR,CAKD,S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AAGP,CAAU,IAAIP,CAAK,6BACxCU,EAAWV,CAAK,CACnB,CACD,OAAAc,EAAY,iBAAiB,SAAUC,CAAkB,EAClD,UAA+B,CAClCD,EAAY,oBAAoB,SAAUC,CAAkB,CACpE,CACA,CCxBO,MAAMP,EAAa,CACtB,WAAY,eACZ,aAAc,mDACd,SAAU,KACd,ECGO,SAASQ,GAAiB,CAEhC,OADaC,EAAmB,MAAM,EAC1B,WACb,CCQA,MAAMC,EAAkB,mCAClBC,EAAmB,6BACnBC,EAAa1B,EAAa,CAC/B,MAAO,CACN,GAAG2B,EACH,WAAYH,CACb,EACA,SAAU,CACT,GAAGI,EACH,WAAY,uBACb,EACA,cAAe,CACd,GAAGC,EACH,WAAYJ,CACb,CAED,CAAC,EAOM,SAASK,GAAW,CAE1B,OADoBR,IACD,KACpB,CAOO,SAASS,GAAkB,CAC3B,KAAA,CAAE,WAAAC,GAAeC,IACjBC,OAAAA,EAAA,UACL,IAAMnB,EAAwB,IAAMiB,IAAcR,CAAe,EACjE,CAACQ,CAAU,CAAA,EAENE,EAAA,UACL,IAAMf,EAAwB,IAAMa,IAAcP,CAAgB,EAClE,CAACO,CAAU,CAAA,EAIXG,EAAA,IAAC,SAAA,CACA,wBAAyB,CACxB,OAAQT,EAAW,yBAAyB,CAC7C,CAAA,CAAA,CAGH","x_google_ignoreList":[0,1,2,3]}
@@ -1,2 +1,2 @@
1
- import{c as e,j as r}from"./index-D1WEsmVZ.js";import{d as o,c as m}from"./misc-CXGQ7VS9.js";import{D as n}from"./diff-MSYB00VZ.js";import{N as p}from"./nav-chevrons-D8c9lJW6.js";import{u as f,d as c}from"./components-Dj3sm47B.js";import"./clsx-B-dksMZM.js";import"./tooltip-CVFWPOu0.js";import"./mdx-DdywIxB6.js";import"./epic-video-BwJwnV_j.js";import"./loading-CaagEELb.js";import"./client-hints-BHTHvBjk.js";import"./index-zG3_j9lj.js";import"./index-B8k-Gd1G.js";import"./progress-bar-DX6yYES2.js";function S(){const s=f(),[a]=c();new URLSearchParams(a).set("forceFresh","diff");const i=e(),t=o.useSpinDelay(i.state!=="idle",{delay:200,minDuration:200});return r.jsxs("div",{className:m("grid h-full grid-rows-[1fr,auto]",{"cursor-wait opacity-30":t}),children:[r.jsx("div",{className:"overflow-y-auto",children:r.jsx(n,{diff:s.diff,allApps:s.allApps})}),r.jsx("div",{className:"flex h-16 items-center justify-end border-t",children:r.jsx(p,{prev:s.prevLink,next:s.nextLink})})]})}export{S as default};
2
- //# sourceMappingURL=diff-Blb5EPiO.js.map
1
+ import{c as e,j as r}from"./index-D1WEsmVZ.js";import{d as o,c as m}from"./misc-CXGQ7VS9.js";import{D as n}from"./diff-CT3-9rtW.js";import{N as p}from"./nav-chevrons-D8c9lJW6.js";import{u as f,d as c}from"./components-Dj3sm47B.js";import"./clsx-B-dksMZM.js";import"./tooltip-CVFWPOu0.js";import"./mdx-ytg-y2nh.js";import"./epic-video-Df7qGSN7.js";import"./loading-D-DClzm1.js";import"./client-hints-KnbHFIgn.js";import"./index-CLnz0tXz.js";import"./index-B8k-Gd1G.js";import"./progress-bar-DX6yYES2.js";function S(){const s=f(),[a]=c();new URLSearchParams(a).set("forceFresh","diff");const i=e(),t=o.useSpinDelay(i.state!=="idle",{delay:200,minDuration:200});return r.jsxs("div",{className:m("grid h-full grid-rows-[1fr,auto]",{"cursor-wait opacity-30":t}),children:[r.jsx("div",{className:"overflow-y-auto",children:r.jsx(n,{diff:s.diff,allApps:s.allApps})}),r.jsx("div",{className:"flex h-16 items-center justify-end border-t",children:r.jsx(p,{prev:s.prevLink,next:s.nextLink})})]})}export{S as default};
2
+ //# sourceMappingURL=diff-CLRdJhCn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff-Blb5EPiO.js","sources":["../../../app/routes/diff.tsx"],"sourcesContent":["import {\n\tgetAppByName,\n\tgetApps,\n\tisExerciseStepApp,\n\tgetAppDisplayName,\n} from '@epic-web/workshop-utils/apps.server'\nimport { makeTimings } from '@epic-web/workshop-utils/timing.server'\nimport { defer, type LoaderFunctionArgs } from '@remix-run/node'\nimport { useLoaderData, useNavigation, useSearchParams } from '@remix-run/react'\nimport { useSpinDelay } from 'spin-delay'\nimport { Diff } from '#app/components/diff.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { getDiffCode } from '#app/utils/diff.server.ts'\nimport { cn } from '#app/utils/misc.tsx'\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tconst reqUrl = new URL(request.url)\n\tconst searchParams = reqUrl.searchParams\n\tconst timings = makeTimings('diffLoader')\n\tconst cacheOptions = { request, timings }\n\tconst allAppsFull = await getApps()\n\tconst app1Name = reqUrl.searchParams.get('app1')\n\tconst app2Name = reqUrl.searchParams.get('app2')\n\n\tconst usingDefaultApp1 = !app1Name\n\n\t// defaults to first problem app\n\tconst app1 = app1Name\n\t\t? await getAppByName(app1Name)\n\t\t: allAppsFull.filter(isExerciseStepApp).at(0)\n\n\t// defaults to last exercise step app\n\tconst app2 = app2Name\n\t\t? await getAppByName(app2Name)\n\t\t: allAppsFull.filter(isExerciseStepApp).at(-1)\n\n\tasync function getDiffProp() {\n\t\tif (!app1 || !app2) {\n\t\t\treturn {\n\t\t\t\tapp1: app1?.name,\n\t\t\t\tapp2: app2?.name,\n\t\t\t\tdiffCode: null,\n\t\t\t}\n\t\t}\n\t\tconst diffCode = await getDiffCode(app1, app2, {\n\t\t\t...cacheOptions,\n\t\t\tforceFresh: searchParams.get('forceFresh') === 'diff',\n\t\t}).catch(e => {\n\t\t\tconsole.error(e)\n\t\t\treturn null\n\t\t})\n\t\treturn {\n\t\t\tapp1: app1.name,\n\t\t\tapp2: app2.name,\n\t\t\tdiffCode,\n\t\t}\n\t}\n\n\tconst allApps = allAppsFull\n\t\t.filter((a, i, ar) => ar.findIndex(b => a.name === b.name) === i)\n\t\t.map(a => ({\n\t\t\tdisplayName: getAppDisplayName(a, allAppsFull),\n\t\t\tname: a.name,\n\t\t\ttitle: a.title,\n\t\t\ttype: a.type,\n\t\t}))\n\n\tconst diff = getDiffProp()\n\tconst app1Index = allApps.findIndex(a => a.name === app1?.name)\n\tconst prevApp1Index = usingDefaultApp1\n\t\t? allApps.length - 2\n\t\t: app1Index === 0\n\t\t\t? -2\n\t\t\t: app1Index - 1\n\tconst prevApp2Index = prevApp1Index + 1\n\tconst nextApp1Index = usingDefaultApp1\n\t\t? 0\n\t\t: app1Index + 1 < allApps.length\n\t\t\t? app1Index + 1\n\t\t\t: -2\n\tconst nextApp2Index = nextApp1Index + 1\n\tconst prevApp1 = allAppsFull[prevApp1Index]?.name\n\tconst prevApp2 = allAppsFull[prevApp2Index]?.name\n\tconst nextApp1 = allAppsFull[nextApp1Index]?.name\n\tconst nextApp2 = allAppsFull[nextApp2Index]?.name\n\tconst prevSearchParams = new URLSearchParams(reqUrl.searchParams)\n\tprevSearchParams.set('app1', prevApp1 ?? '')\n\tprevSearchParams.set('app2', prevApp2 ?? '')\n\tconst nextSearchParams = new URLSearchParams(reqUrl.searchParams)\n\tnextSearchParams.set('app1', nextApp1 ?? '')\n\tnextSearchParams.set('app2', nextApp2 ?? '')\n\treturn defer({\n\t\tallApps,\n\t\tdiff,\n\t\tprevLink:\n\t\t\tprevApp1 && prevApp2\n\t\t\t\t? { to: `/diff?${prevSearchParams}`, 'aria-label': 'Previous App' }\n\t\t\t\t: { to: '/diff' },\n\t\tnextLink:\n\t\t\tnextApp1 && nextApp2\n\t\t\t\t? { to: `/diff?${nextSearchParams}`, 'aria-label': 'Next App' }\n\t\t\t\t: { to: '/diff' },\n\t})\n}\n\nexport default function DiffViewer() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst [params] = useSearchParams()\n\tconst paramsWithForcedRefresh = new URLSearchParams(params)\n\tparamsWithForcedRefresh.set('forceFresh', 'diff')\n\tconst navigation = useNavigation()\n\tconst isNavigating = useSpinDelay(navigation.state !== 'idle', {\n\t\tdelay: 200,\n\t\tminDuration: 200,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid h-full grid-rows-[1fr,auto]', {\n\t\t\t\t'cursor-wait opacity-30': isNavigating,\n\t\t\t})}\n\t\t>\n\t\t\t<div className=\"overflow-y-auto\">\n\t\t\t\t<Diff diff={data.diff} allApps={data.allApps} />\n\t\t\t</div>\n\t\t\t<div className=\"flex h-16 items-center justify-end border-t\">\n\t\t\t\t<NavChevrons prev={data.prevLink} next={data.nextLink} />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":["DiffViewer","data","useLoaderData","params","useSearchParams","navigation","useNavigation","isNavigating","useSpinDelay","jsxs","jsx","Diff","NavChevrons"],"mappings":"ufAKO,SAAAA,GAAA,CACP,MAAAC,EAA4BC,IAC5B,CAASC,CAAsC,EAAAC,wBACeD,CAAA,EACjC,IAAA,aAAA,MAAA,EAC7B,MAAAE,EAAqBC,IACrBC,EAA4BC,EAAA,aAAAH,EAAA,QAAA,OAAA,CAC5B,MAA4B,IAC5B,YAAmB,GAEnB,CAAsB,EACrB,OAAuBI,EAAAA,KAAA,MAAW,CAClC,+CAA4B,CACtB,yBAAkCF,CACxC,CAAM,EACA,SAAA,CAA4BG,EAAA,IAAA,MAAA,CAClC,UAAiB,kBACjB,SAAqCA,EAAA,IAAAC,EAAA,CAE/B,YAGA,QACHV,EAAA,OAIH,CAAM,CAIN,CAAA,EAA6BS,EAAA,IAAA,MAAA,CACxB,UAAS,8CACL,SAAAA,EAAA,IAAAE,EAAA,CACN,KAAMX,EAAM,SACZ,KAAMA,EAAM,QAAA,CAAA,CACF,CACX,CAAA,CAAA,CACD,CACA"}
1
+ {"version":3,"file":"diff-CLRdJhCn.js","sources":["../../../app/routes/diff.tsx"],"sourcesContent":["import {\n\tgetAppByName,\n\tgetApps,\n\tisExerciseStepApp,\n\tgetAppDisplayName,\n} from '@epic-web/workshop-utils/apps.server'\nimport { makeTimings } from '@epic-web/workshop-utils/timing.server'\nimport { defer, type LoaderFunctionArgs } from '@remix-run/node'\nimport { useLoaderData, useNavigation, useSearchParams } from '@remix-run/react'\nimport { useSpinDelay } from 'spin-delay'\nimport { Diff } from '#app/components/diff.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { getDiffCode } from '#app/utils/diff.server.ts'\nimport { cn } from '#app/utils/misc.tsx'\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tconst reqUrl = new URL(request.url)\n\tconst searchParams = reqUrl.searchParams\n\tconst timings = makeTimings('diffLoader')\n\tconst cacheOptions = { request, timings }\n\tconst allAppsFull = await getApps()\n\tconst app1Name = reqUrl.searchParams.get('app1')\n\tconst app2Name = reqUrl.searchParams.get('app2')\n\n\tconst usingDefaultApp1 = !app1Name\n\n\t// defaults to first problem app\n\tconst app1 = app1Name\n\t\t? await getAppByName(app1Name)\n\t\t: allAppsFull.filter(isExerciseStepApp).at(0)\n\n\t// defaults to last exercise step app\n\tconst app2 = app2Name\n\t\t? await getAppByName(app2Name)\n\t\t: allAppsFull.filter(isExerciseStepApp).at(-1)\n\n\tasync function getDiffProp() {\n\t\tif (!app1 || !app2) {\n\t\t\treturn {\n\t\t\t\tapp1: app1?.name,\n\t\t\t\tapp2: app2?.name,\n\t\t\t\tdiffCode: null,\n\t\t\t}\n\t\t}\n\t\tconst diffCode = await getDiffCode(app1, app2, {\n\t\t\t...cacheOptions,\n\t\t\tforceFresh: searchParams.get('forceFresh') === 'diff',\n\t\t}).catch(e => {\n\t\t\tconsole.error(e)\n\t\t\treturn null\n\t\t})\n\t\treturn {\n\t\t\tapp1: app1.name,\n\t\t\tapp2: app2.name,\n\t\t\tdiffCode,\n\t\t}\n\t}\n\n\tconst allApps = allAppsFull\n\t\t.filter((a, i, ar) => ar.findIndex(b => a.name === b.name) === i)\n\t\t.map(a => ({\n\t\t\tdisplayName: getAppDisplayName(a, allAppsFull),\n\t\t\tname: a.name,\n\t\t\ttitle: a.title,\n\t\t\ttype: a.type,\n\t\t}))\n\n\tconst diff = getDiffProp()\n\tconst app1Index = allApps.findIndex(a => a.name === app1?.name)\n\tconst prevApp1Index = usingDefaultApp1\n\t\t? allApps.length - 2\n\t\t: app1Index === 0\n\t\t\t? -2\n\t\t\t: app1Index - 1\n\tconst prevApp2Index = prevApp1Index + 1\n\tconst nextApp1Index = usingDefaultApp1\n\t\t? 0\n\t\t: app1Index + 1 < allApps.length\n\t\t\t? app1Index + 1\n\t\t\t: -2\n\tconst nextApp2Index = nextApp1Index + 1\n\tconst prevApp1 = allAppsFull[prevApp1Index]?.name\n\tconst prevApp2 = allAppsFull[prevApp2Index]?.name\n\tconst nextApp1 = allAppsFull[nextApp1Index]?.name\n\tconst nextApp2 = allAppsFull[nextApp2Index]?.name\n\tconst prevSearchParams = new URLSearchParams(reqUrl.searchParams)\n\tprevSearchParams.set('app1', prevApp1 ?? '')\n\tprevSearchParams.set('app2', prevApp2 ?? '')\n\tconst nextSearchParams = new URLSearchParams(reqUrl.searchParams)\n\tnextSearchParams.set('app1', nextApp1 ?? '')\n\tnextSearchParams.set('app2', nextApp2 ?? '')\n\treturn defer({\n\t\tallApps,\n\t\tdiff,\n\t\tprevLink:\n\t\t\tprevApp1 && prevApp2\n\t\t\t\t? { to: `/diff?${prevSearchParams}`, 'aria-label': 'Previous App' }\n\t\t\t\t: { to: '/diff' },\n\t\tnextLink:\n\t\t\tnextApp1 && nextApp2\n\t\t\t\t? { to: `/diff?${nextSearchParams}`, 'aria-label': 'Next App' }\n\t\t\t\t: { to: '/diff' },\n\t})\n}\n\nexport default function DiffViewer() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst [params] = useSearchParams()\n\tconst paramsWithForcedRefresh = new URLSearchParams(params)\n\tparamsWithForcedRefresh.set('forceFresh', 'diff')\n\tconst navigation = useNavigation()\n\tconst isNavigating = useSpinDelay(navigation.state !== 'idle', {\n\t\tdelay: 200,\n\t\tminDuration: 200,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid h-full grid-rows-[1fr,auto]', {\n\t\t\t\t'cursor-wait opacity-30': isNavigating,\n\t\t\t})}\n\t\t>\n\t\t\t<div className=\"overflow-y-auto\">\n\t\t\t\t<Diff diff={data.diff} allApps={data.allApps} />\n\t\t\t</div>\n\t\t\t<div className=\"flex h-16 items-center justify-end border-t\">\n\t\t\t\t<NavChevrons prev={data.prevLink} next={data.nextLink} />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n"],"names":["DiffViewer","data","useLoaderData","params","useSearchParams","navigation","useNavigation","isNavigating","useSpinDelay","jsxs","jsx","Diff","NavChevrons"],"mappings":"ufAKO,SAAAA,GAAA,CACP,MAAAC,EAA4BC,IAC5B,CAASC,CAAsC,EAAAC,wBACeD,CAAA,EACjC,IAAA,aAAA,MAAA,EAC7B,MAAAE,EAAqBC,IACrBC,EAA4BC,EAAA,aAAAH,EAAA,QAAA,OAAA,CAC5B,MAA4B,IAC5B,YAAmB,GAEnB,CAAsB,EACrB,OAAuBI,EAAAA,KAAA,MAAW,CAClC,+CAA4B,CACtB,yBAAkCF,CACxC,CAAM,EACA,SAAA,CAA4BG,EAAA,IAAA,MAAA,CAClC,UAAiB,kBACjB,SAAqCA,EAAA,IAAAC,EAAA,CAE/B,YAGA,QACHV,EAAA,OAIH,CAAM,CAIN,CAAA,EAA6BS,EAAA,IAAA,MAAA,CACxB,UAAS,8CACL,SAAAA,EAAA,IAAAE,EAAA,CACN,KAAMX,EAAM,SACZ,KAAMA,EAAM,QAAA,CAAA,CACF,CACX,CAAA,CAAA,CACD,CACA"}
@@ -1,4 +1,4 @@
1
- import{r,R as S,j as g,c as Xt}from"./index-D1WEsmVZ.js";import{g as M,_ as I,$ as ye,d as D,n as Ue,f as Ge,k as wt,e as pe,l as Zt,i as me,m as Qt,h as O,q,o as Jt,r as en,p as tn,j as nn,S as ot}from"./tooltip-CVFWPOu0.js";import{$ as on,r as St,m as rn,d as cn,A as an,L as sn,F as ln}from"./components-Dj3sm47B.js";import{c as ve}from"./clsx-B-dksMZM.js";import{I as F,d as dn,c as un}from"./misc-CXGQ7VS9.js";import{M as fn}from"./mdx-DdywIxB6.js";const pn=r.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...c}=e;return o?on.createPortal(r.createElement(M.div,I({},c,{ref:n})),o):null});function Ct(e){const n=e+"CollectionProvider",[t,o]=ye(n),[c,s]=t(n,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:h,children:i}=x,m=S.useRef(null),p=S.useRef(new Map).current;return S.createElement(c,{scope:h,itemMap:p,collectionRef:m},i)},a=e+"CollectionSlot",d=S.forwardRef((x,h)=>{const{scope:i,children:m}=x,p=s(a,i),f=D(h,p.collectionRef);return S.createElement(Ue,{ref:f},m)}),u=e+"CollectionItemSlot",v="data-radix-collection-item",b=S.forwardRef((x,h)=>{const{scope:i,children:m,...p}=x,f=S.useRef(null),$=D(h,f),E=s(u,i);return S.useEffect(()=>(E.itemMap.set(f,{ref:f,...p}),()=>void E.itemMap.delete(f))),S.createElement(Ue,{[v]:"",ref:$},m)});function w(x){const h=s(e+"CollectionConsumer",x);return S.useCallback(()=>{const m=h.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${v}]`));return Array.from(h.itemMap.values()).sort((E,y)=>p.indexOf(E.ref.current)-p.indexOf(y.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:d,ItemSlot:b},w,o]}const mn=r.createContext(void 0);function Et(e){const n=r.useContext(mn);return e||n||"ltr"}function rt(e,[n,t]){return Math.min(t,Math.max(n,e))}let je=0;function vn(){r.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:ct()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:ct()),je++,()=>{je===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),je--}},[])}function ct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Ve="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",at={bubbles:!1,cancelable:!0},hn=r.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:s,...l}=e,[a,d]=r.useState(null),u=Ge(c),v=Ge(s),b=r.useRef(null),w=D(n,i=>d(i)),x=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(o){let i=function($){if(x.paused||!a)return;const E=$.target;a.contains(E)?b.current=E:J(b.current,{select:!0})},m=function($){if(x.paused||!a)return;const E=$.relatedTarget;E!==null&&(a.contains(E)||J(b.current,{select:!0}))},p=function($){if(document.activeElement===document.body)for(const y of $)y.removedNodes.length>0&&J(a)};document.addEventListener("focusin",i),document.addEventListener("focusout",m);const f=new MutationObserver(p);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",i),document.removeEventListener("focusout",m),f.disconnect()}}},[o,a,x.paused]),r.useEffect(()=>{if(a){lt.add(x);const i=document.activeElement;if(!a.contains(i)){const p=new CustomEvent(Ve,at);a.addEventListener(Ve,u),a.dispatchEvent(p),p.defaultPrevented||(bn(Sn(yt(a)),{select:!0}),document.activeElement===i&&J(a))}return()=>{a.removeEventListener(Ve,u),setTimeout(()=>{const p=new CustomEvent(Fe,at);a.addEventListener(Fe,v),a.dispatchEvent(p),p.defaultPrevented||J(i??document.body,{select:!0}),a.removeEventListener(Fe,v),lt.remove(x)},0)}}},[a,u,v,x]);const h=r.useCallback(i=>{if(!t&&!o||x.paused)return;const m=i.key==="Tab"&&!i.altKey&&!i.ctrlKey&&!i.metaKey,p=document.activeElement;if(m&&p){const f=i.currentTarget,[$,E]=$n(f);$&&E?!i.shiftKey&&p===E?(i.preventDefault(),t&&J($,{select:!0})):i.shiftKey&&p===$&&(i.preventDefault(),t&&J(E,{select:!0})):p===f&&i.preventDefault()}},[t,o,x.paused]);return r.createElement(M.div,I({tabIndex:-1},l,{ref:w,onKeyDown:h}))});function bn(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(J(o,{select:n}),document.activeElement!==t)return}function $n(e){const n=yt(e),t=st(n,e),o=st(n.reverse(),e);return[t,o]}function yt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function st(e,n){for(const t of e)if(!gn(t,{upTo:n}))return t}function gn(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xn(e){return e instanceof HTMLInputElement&&"select"in e}function J(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&xn(e)&&n&&e.select()}}const lt=wn();function wn(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=it(e,n),e.unshift(n)},remove(n){var t;e=it(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function it(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Sn(e){return e.filter(n=>n.tagName!=="A")}function Cn(e){const n=r.useRef({value:e,previous:e});return r.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var En=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,$e=new WeakMap,ge={},Be=0,It=function(e){return e&&(e.host||It(e.parentNode))},yn=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=It(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},In=function(e,n,t,o){var c=yn(n,Array.isArray(e)?e:[e]);ge[t]||(ge[t]=new WeakMap);var s=ge[t],l=[],a=new Set,d=new Set(c),u=function(b){!b||a.has(b)||(a.add(b),u(b.parentNode))};c.forEach(u);var v=function(b){!b||d.has(b)||Array.prototype.forEach.call(b.children,function(w){if(a.has(w))v(w);else try{var x=w.getAttribute(o),h=x!==null&&x!=="false",i=(ae.get(w)||0)+1,m=(s.get(w)||0)+1;ae.set(w,i),s.set(w,m),l.push(w),i===1&&h&&$e.set(w,!0),m===1&&w.setAttribute(t,"true"),h||w.setAttribute(o,"true")}catch(p){console.error("aria-hidden: cannot operate on ",w,p)}})};return v(n),a.clear(),Be++,function(){l.forEach(function(b){var w=ae.get(b)-1,x=s.get(b)-1;ae.set(b,w),s.set(b,x),w||($e.has(b)||b.removeAttribute(o),$e.delete(b)),x||b.removeAttribute(t)}),Be--,Be||(ae=new WeakMap,ae=new WeakMap,$e=new WeakMap,ge={})}},Rn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),c=n||En(e);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live]"))),In(o,c,t,"aria-hidden")):function(){return null}},G=function(){return G=Object.assign||function(n){for(var t,o=1,c=arguments.length;o<c;o++){t=arguments[o];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},G.apply(this,arguments)};function Rt(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(e);c<o.length;c++)n.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(t[o[c]]=e[o[c]]);return t}function _n(e,n,t){if(t||arguments.length===2)for(var o=0,c=n.length,s;o<c;o++)(s||!(o in n))&&(s||(s=Array.prototype.slice.call(n,0,o)),s[o]=n[o]);return e.concat(s||Array.prototype.slice.call(n))}var Ce="right-scroll-bar-position",Ee="width-before-scroll-bar",Tn="with-scroll-bars-hidden",Pn="--removed-body-scroll-bar-size";function He(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function An(e,n){var t=r.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var c=t.value;c!==o&&(t.value=o,t.callback(o,c))}}}})[0];return t.callback=n,t.facade}var Nn=typeof window<"u"?r.useLayoutEffect:r.useEffect,dt=new WeakMap;function Mn(e,n){var t=An(n||null,function(o){return e.forEach(function(c){return He(c,o)})});return Nn(function(){var o=dt.get(t);if(o){var c=new Set(o),s=new Set(e),l=t.current;c.forEach(function(a){s.has(a)||He(a,null)}),s.forEach(function(a){c.has(a)||He(a,l)})}dt.set(t,e)},[e]),t}function On(e){return e}function kn(e,n){n===void 0&&(n=On);var t=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(s){var l=n(s,o);return t.push(l),function(){t=t.filter(function(a){return a!==l})}},assignSyncMedium:function(s){for(o=!0;t.length;){var l=t;t=[],l.forEach(s)}t={push:function(a){return s(a)},filter:function(){return t}}},assignMedium:function(s){o=!0;var l=[];if(t.length){var a=t;t=[],a.forEach(s),l=t}var d=function(){var v=l;l=[],v.forEach(s)},u=function(){return Promise.resolve().then(d)};u(),t={push:function(v){l.push(v),u()},filter:function(v){return l=l.filter(v),t}}}};return c}function Dn(e){e===void 0&&(e={});var n=kn(null);return n.options=G({async:!0,ssr:!1},e),n}var _t=function(e){var n=e.sideCar,t=Rt(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,G({},t))};_t.isSideCarExport=!0;function Ln(e,n){return e.useMedium(n),_t}var Tt=Dn(),We=function(){},Ie=r.forwardRef(function(e,n){var t=r.useRef(null),o=r.useState({onScrollCapture:We,onWheelCapture:We,onTouchMoveCapture:We}),c=o[0],s=o[1],l=e.forwardProps,a=e.children,d=e.className,u=e.removeScrollBar,v=e.enabled,b=e.shards,w=e.sideCar,x=e.noIsolation,h=e.inert,i=e.allowPinchZoom,m=e.as,p=m===void 0?"div":m,f=Rt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=w,E=Mn([t,n]),y=G(G({},f),c);return r.createElement(r.Fragment,null,v&&r.createElement($,{sideCar:Tt,removeScrollBar:u,shards:b,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!i,lockRef:t}),l?r.cloneElement(r.Children.only(a),G(G({},y),{ref:E})):r.createElement(p,G({},y,{className:d,ref:E}),a))});Ie.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ie.classNames={fullWidth:Ee,zeroRight:Ce};var jn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=jn();return n&&e.setAttribute("nonce",n),e}function Fn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function Bn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var Hn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=Vn())&&(Fn(n,t),Bn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},Wn=function(){var e=Hn();return function(n,t){r.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Pt=function(){var e=Wn(),n=function(t){var o=t.styles,c=t.dynamic;return e(o,c),null};return n},Kn={left:0,top:0,right:0,gap:0},Ke=function(e){return parseInt(e||"",10)||0},Un=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],c=n[e==="padding"?"paddingRight":"marginRight"];return[Ke(t),Ke(o),Ke(c)]},Gn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kn;var n=Un(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},Yn=Pt(),ie="data-scroll-locked",zn=function(e,n,t,o){var c=e.left,s=e.top,l=e.right,a=e.gap;return t===void 0&&(t="margin"),`
1
+ import{r,R as S,j as g,c as Xt}from"./index-D1WEsmVZ.js";import{g as M,_ as I,$ as ye,d as D,n as Ue,f as Ge,k as wt,e as pe,l as Zt,i as me,m as Qt,h as O,q,o as Jt,r as en,p as tn,j as nn,S as ot}from"./tooltip-CVFWPOu0.js";import{$ as on,r as St,m as rn,d as cn,A as an,L as sn,F as ln}from"./components-Dj3sm47B.js";import{c as ve}from"./clsx-B-dksMZM.js";import{I as F,d as dn,c as un}from"./misc-CXGQ7VS9.js";import{M as fn}from"./mdx-ytg-y2nh.js";const pn=r.forwardRef((e,n)=>{var t;const{container:o=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...c}=e;return o?on.createPortal(r.createElement(M.div,I({},c,{ref:n})),o):null});function Ct(e){const n=e+"CollectionProvider",[t,o]=ye(n),[c,s]=t(n,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:h,children:i}=x,m=S.useRef(null),p=S.useRef(new Map).current;return S.createElement(c,{scope:h,itemMap:p,collectionRef:m},i)},a=e+"CollectionSlot",d=S.forwardRef((x,h)=>{const{scope:i,children:m}=x,p=s(a,i),f=D(h,p.collectionRef);return S.createElement(Ue,{ref:f},m)}),u=e+"CollectionItemSlot",v="data-radix-collection-item",b=S.forwardRef((x,h)=>{const{scope:i,children:m,...p}=x,f=S.useRef(null),$=D(h,f),E=s(u,i);return S.useEffect(()=>(E.itemMap.set(f,{ref:f,...p}),()=>void E.itemMap.delete(f))),S.createElement(Ue,{[v]:"",ref:$},m)});function w(x){const h=s(e+"CollectionConsumer",x);return S.useCallback(()=>{const m=h.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${v}]`));return Array.from(h.itemMap.values()).sort((E,y)=>p.indexOf(E.ref.current)-p.indexOf(y.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:d,ItemSlot:b},w,o]}const mn=r.createContext(void 0);function Et(e){const n=r.useContext(mn);return e||n||"ltr"}function rt(e,[n,t]){return Math.min(t,Math.max(n,e))}let je=0;function vn(){r.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:ct()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:ct()),je++,()=>{je===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),je--}},[])}function ct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Ve="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",at={bubbles:!1,cancelable:!0},hn=r.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:s,...l}=e,[a,d]=r.useState(null),u=Ge(c),v=Ge(s),b=r.useRef(null),w=D(n,i=>d(i)),x=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(o){let i=function($){if(x.paused||!a)return;const E=$.target;a.contains(E)?b.current=E:J(b.current,{select:!0})},m=function($){if(x.paused||!a)return;const E=$.relatedTarget;E!==null&&(a.contains(E)||J(b.current,{select:!0}))},p=function($){if(document.activeElement===document.body)for(const y of $)y.removedNodes.length>0&&J(a)};document.addEventListener("focusin",i),document.addEventListener("focusout",m);const f=new MutationObserver(p);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",i),document.removeEventListener("focusout",m),f.disconnect()}}},[o,a,x.paused]),r.useEffect(()=>{if(a){lt.add(x);const i=document.activeElement;if(!a.contains(i)){const p=new CustomEvent(Ve,at);a.addEventListener(Ve,u),a.dispatchEvent(p),p.defaultPrevented||(bn(Sn(yt(a)),{select:!0}),document.activeElement===i&&J(a))}return()=>{a.removeEventListener(Ve,u),setTimeout(()=>{const p=new CustomEvent(Fe,at);a.addEventListener(Fe,v),a.dispatchEvent(p),p.defaultPrevented||J(i??document.body,{select:!0}),a.removeEventListener(Fe,v),lt.remove(x)},0)}}},[a,u,v,x]);const h=r.useCallback(i=>{if(!t&&!o||x.paused)return;const m=i.key==="Tab"&&!i.altKey&&!i.ctrlKey&&!i.metaKey,p=document.activeElement;if(m&&p){const f=i.currentTarget,[$,E]=$n(f);$&&E?!i.shiftKey&&p===E?(i.preventDefault(),t&&J($,{select:!0})):i.shiftKey&&p===$&&(i.preventDefault(),t&&J(E,{select:!0})):p===f&&i.preventDefault()}},[t,o,x.paused]);return r.createElement(M.div,I({tabIndex:-1},l,{ref:w,onKeyDown:h}))});function bn(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(J(o,{select:n}),document.activeElement!==t)return}function $n(e){const n=yt(e),t=st(n,e),o=st(n.reverse(),e);return[t,o]}function yt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function st(e,n){for(const t of e)if(!gn(t,{upTo:n}))return t}function gn(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xn(e){return e instanceof HTMLInputElement&&"select"in e}function J(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&xn(e)&&n&&e.select()}}const lt=wn();function wn(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=it(e,n),e.unshift(n)},remove(n){var t;e=it(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function it(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Sn(e){return e.filter(n=>n.tagName!=="A")}function Cn(e){const n=r.useRef({value:e,previous:e});return r.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var En=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,$e=new WeakMap,ge={},Be=0,It=function(e){return e&&(e.host||It(e.parentNode))},yn=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=It(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},In=function(e,n,t,o){var c=yn(n,Array.isArray(e)?e:[e]);ge[t]||(ge[t]=new WeakMap);var s=ge[t],l=[],a=new Set,d=new Set(c),u=function(b){!b||a.has(b)||(a.add(b),u(b.parentNode))};c.forEach(u);var v=function(b){!b||d.has(b)||Array.prototype.forEach.call(b.children,function(w){if(a.has(w))v(w);else try{var x=w.getAttribute(o),h=x!==null&&x!=="false",i=(ae.get(w)||0)+1,m=(s.get(w)||0)+1;ae.set(w,i),s.set(w,m),l.push(w),i===1&&h&&$e.set(w,!0),m===1&&w.setAttribute(t,"true"),h||w.setAttribute(o,"true")}catch(p){console.error("aria-hidden: cannot operate on ",w,p)}})};return v(n),a.clear(),Be++,function(){l.forEach(function(b){var w=ae.get(b)-1,x=s.get(b)-1;ae.set(b,w),s.set(b,x),w||($e.has(b)||b.removeAttribute(o),$e.delete(b)),x||b.removeAttribute(t)}),Be--,Be||(ae=new WeakMap,ae=new WeakMap,$e=new WeakMap,ge={})}},Rn=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),c=n||En(e);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live]"))),In(o,c,t,"aria-hidden")):function(){return null}},G=function(){return G=Object.assign||function(n){for(var t,o=1,c=arguments.length;o<c;o++){t=arguments[o];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=t[s])}return n},G.apply(this,arguments)};function Rt(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(e);c<o.length;c++)n.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(e,o[c])&&(t[o[c]]=e[o[c]]);return t}function _n(e,n,t){if(t||arguments.length===2)for(var o=0,c=n.length,s;o<c;o++)(s||!(o in n))&&(s||(s=Array.prototype.slice.call(n,0,o)),s[o]=n[o]);return e.concat(s||Array.prototype.slice.call(n))}var Ce="right-scroll-bar-position",Ee="width-before-scroll-bar",Tn="with-scroll-bars-hidden",Pn="--removed-body-scroll-bar-size";function He(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function An(e,n){var t=r.useState(function(){return{value:e,callback:n,facade:{get current(){return t.value},set current(o){var c=t.value;c!==o&&(t.value=o,t.callback(o,c))}}}})[0];return t.callback=n,t.facade}var Nn=typeof window<"u"?r.useLayoutEffect:r.useEffect,dt=new WeakMap;function Mn(e,n){var t=An(n||null,function(o){return e.forEach(function(c){return He(c,o)})});return Nn(function(){var o=dt.get(t);if(o){var c=new Set(o),s=new Set(e),l=t.current;c.forEach(function(a){s.has(a)||He(a,null)}),s.forEach(function(a){c.has(a)||He(a,l)})}dt.set(t,e)},[e]),t}function On(e){return e}function kn(e,n){n===void 0&&(n=On);var t=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:e},useMedium:function(s){var l=n(s,o);return t.push(l),function(){t=t.filter(function(a){return a!==l})}},assignSyncMedium:function(s){for(o=!0;t.length;){var l=t;t=[],l.forEach(s)}t={push:function(a){return s(a)},filter:function(){return t}}},assignMedium:function(s){o=!0;var l=[];if(t.length){var a=t;t=[],a.forEach(s),l=t}var d=function(){var v=l;l=[],v.forEach(s)},u=function(){return Promise.resolve().then(d)};u(),t={push:function(v){l.push(v),u()},filter:function(v){return l=l.filter(v),t}}}};return c}function Dn(e){e===void 0&&(e={});var n=kn(null);return n.options=G({async:!0,ssr:!1},e),n}var _t=function(e){var n=e.sideCar,t=Rt(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,G({},t))};_t.isSideCarExport=!0;function Ln(e,n){return e.useMedium(n),_t}var Tt=Dn(),We=function(){},Ie=r.forwardRef(function(e,n){var t=r.useRef(null),o=r.useState({onScrollCapture:We,onWheelCapture:We,onTouchMoveCapture:We}),c=o[0],s=o[1],l=e.forwardProps,a=e.children,d=e.className,u=e.removeScrollBar,v=e.enabled,b=e.shards,w=e.sideCar,x=e.noIsolation,h=e.inert,i=e.allowPinchZoom,m=e.as,p=m===void 0?"div":m,f=Rt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=w,E=Mn([t,n]),y=G(G({},f),c);return r.createElement(r.Fragment,null,v&&r.createElement($,{sideCar:Tt,removeScrollBar:u,shards:b,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!i,lockRef:t}),l?r.cloneElement(r.Children.only(a),G(G({},y),{ref:E})):r.createElement(p,G({},y,{className:d,ref:E}),a))});Ie.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ie.classNames={fullWidth:Ee,zeroRight:Ce};var jn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=jn();return n&&e.setAttribute("nonce",n),e}function Fn(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function Bn(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var Hn=function(){var e=0,n=null;return{add:function(t){e==0&&(n=Vn())&&(Fn(n,t),Bn(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},Wn=function(){var e=Hn();return function(n,t){r.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&t])}},Pt=function(){var e=Wn(),n=function(t){var o=t.styles,c=t.dynamic;return e(o,c),null};return n},Kn={left:0,top:0,right:0,gap:0},Ke=function(e){return parseInt(e||"",10)||0},Un=function(e){var n=window.getComputedStyle(document.body),t=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],c=n[e==="padding"?"paddingRight":"marginRight"];return[Ke(t),Ke(o),Ke(c)]},Gn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kn;var n=Un(e),t=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-t+n[2]-n[0])}},Yn=Pt(),ie="data-scroll-locked",zn=function(e,n,t,o){var c=e.left,s=e.top,l=e.right,a=e.gap;return t===void 0&&(t="margin"),`
2
2
  .`.concat(Tn,` {
3
3
  overflow: hidden `).concat(o,`;
4
4
  padding-right: `).concat(a,"px ").concat(o,`;
@@ -39,4 +39,4 @@ import{r,R as S,j as g,c as Xt}from"./index-D1WEsmVZ.js";import{g as M,_ as I,$
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
41
  `)},ao=0,le=[];function so(e){var n=r.useRef([]),t=r.useRef([0,0]),o=r.useRef(),c=r.useState(ao++)[0],s=r.useState(function(){return Pt()})[0],l=r.useRef(e);r.useEffect(function(){l.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var i=_n([e.lockRef.current],(e.shards||[]).map(mt),!0).filter(Boolean);return i.forEach(function(m){return m.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),i.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var a=r.useCallback(function(i,m){if("touches"in i&&i.touches.length===2)return!l.current.allowPinchZoom;var p=we(i),f=t.current,$="deltaX"in i?i.deltaX:f[0]-p[0],E="deltaY"in i?i.deltaY:f[1]-p[1],y,j=i.target,T=Math.abs($)>Math.abs(E)?"h":"v";if("touches"in i&&T==="h"&&j.type==="range")return!1;var N=ft(T,j);if(!N)return!0;if(N?y=T:(y=T==="v"?"h":"v",N=ft(T,j)),!N)return!1;if(!o.current&&"changedTouches"in i&&($||E)&&(o.current=y),!y)return!0;var L=o.current||y;return oo(L,m,i,L==="h"?$:E,!0)},[]),d=r.useCallback(function(i){var m=i;if(!(!le.length||le[le.length-1]!==s)){var p="deltaY"in m?pt(m):we(m),f=n.current.filter(function(y){return y.name===m.type&&y.target===m.target&&ro(y.delta,p)})[0];if(f&&f.should){m.cancelable&&m.preventDefault();return}if(!f){var $=(l.current.shards||[]).map(mt).filter(Boolean).filter(function(y){return y.contains(m.target)}),E=$.length>0?a(m,$[0]):!l.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),u=r.useCallback(function(i,m,p,f){var $={name:i,delta:m,target:p,should:f};n.current.push($),setTimeout(function(){n.current=n.current.filter(function(E){return E!==$})},1)},[]),v=r.useCallback(function(i){t.current=we(i),o.current=void 0},[]),b=r.useCallback(function(i){u(i.type,pt(i),i.target,a(i,e.lockRef.current))},[]),w=r.useCallback(function(i){u(i.type,we(i),i.target,a(i,e.lockRef.current))},[]);r.useEffect(function(){return le.push(s),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:w}),document.addEventListener("wheel",d,se),document.addEventListener("touchmove",d,se),document.addEventListener("touchstart",v,se),function(){le=le.filter(function(i){return i!==s}),document.removeEventListener("wheel",d,se),document.removeEventListener("touchmove",d,se),document.removeEventListener("touchstart",v,se)}},[]);var x=e.removeScrollBar,h=e.inert;return r.createElement(r.Fragment,null,h?r.createElement(s,{styles:co(c)}):null,x?r.createElement(Xn,{gapMode:"margin"}):null)}const lo=Ln(Tt,so);var Ot=r.forwardRef(function(e,n){return r.createElement(Ie,G({},e,{ref:n,sideCar:lo}))});Ot.classNames=Ie.classNames;const io=Ot,uo=[" ","Enter","ArrowUp","ArrowDown"],fo=[" ","Enter"],Re="Select",[_e,Te,po]=Ct(Re),[ue,Yr]=ye(Re,[po,wt]),Xe=wt(),[mo,ne]=ue(Re),[vo,ho]=ue(Re),bo=e=>{const{__scopeSelect:n,children:t,open:o,defaultOpen:c,onOpenChange:s,value:l,defaultValue:a,onValueChange:d,dir:u,name:v,autoComplete:b,disabled:w,required:x}=e,h=Xe(n),[i,m]=r.useState(null),[p,f]=r.useState(null),[$,E]=r.useState(!1),y=Et(u),[j=!1,T]=pe({prop:o,defaultProp:c,onChange:s}),[N,L]=pe({prop:l,defaultProp:a,onChange:d}),W=r.useRef(null),te=i?!!i.closest("form"):!0,[K,X]=r.useState(new Set),Z=Array.from(K).map(k=>k.props.value).join(";");return r.createElement(Zt,h,r.createElement(mo,{required:x,scope:n,trigger:i,onTriggerChange:m,valueNode:p,onValueNodeChange:f,valueNodeHasChildren:$,onValueNodeHasChildrenChange:E,contentId:me(),value:N,onValueChange:L,open:j,onOpenChange:T,dir:y,triggerPointerDownPosRef:W,disabled:w},r.createElement(_e.Provider,{scope:n},r.createElement(vo,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(k=>{X(U=>new Set(U).add(k))},[]),onNativeOptionRemove:r.useCallback(k=>{X(U=>{const Y=new Set(U);return Y.delete(k),Y})},[])},t)),te?r.createElement(Vt,{key:Z,"aria-hidden":!0,required:x,tabIndex:-1,name:v,autoComplete:b,value:N,onChange:k=>L(k.target.value),disabled:w},N===void 0?r.createElement("option",{value:""}):null,Array.from(K)):null))},$o="SelectTrigger",go=r.forwardRef((e,n)=>{const{__scopeSelect:t,disabled:o=!1,...c}=e,s=Xe(t),l=ne($o,t),a=l.disabled||o,d=D(n,l.onTriggerChange),u=Te(t),[v,b,w]=Ft(h=>{const i=u().filter(f=>!f.disabled),m=i.find(f=>f.value===l.value),p=Bt(i,h,m);p!==void 0&&l.onValueChange(p.value)}),x=()=>{a||(l.onOpenChange(!0),w())};return r.createElement(Qt,I({asChild:!0},s),r.createElement(M.button,I({type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":jt(l.value)?"":void 0},c,{ref:d,onClick:O(c.onClick,h=>{h.currentTarget.focus()}),onPointerDown:O(c.onPointerDown,h=>{const i=h.target;i.hasPointerCapture(h.pointerId)&&i.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(x(),l.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:O(c.onKeyDown,h=>{const i=v.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&b(h.key),!(i&&h.key===" ")&&uo.includes(h.key)&&(x(),h.preventDefault())})})))}),xo="SelectValue",wo=r.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:c,children:s,placeholder:l="",...a}=e,d=ne(xo,t),{onValueNodeHasChildrenChange:u}=d,v=s!==void 0,b=D(n,d.onValueNodeChange);return q(()=>{u(v)},[u,v]),r.createElement(M.span,I({},a,{ref:b,style:{pointerEvents:"none"}}),jt(d.value)?r.createElement(r.Fragment,null,l):s)}),So=r.forwardRef((e,n)=>{const{__scopeSelect:t,children:o,...c}=e;return r.createElement(M.span,I({"aria-hidden":!0},c,{ref:n}),o||"▼")}),Co=e=>r.createElement(pn,I({asChild:!0},e)),de="SelectContent",Eo=r.forwardRef((e,n)=>{const t=ne(de,e.__scopeSelect),[o,c]=r.useState();if(q(()=>{c(new DocumentFragment)},[]),!t.open){const s=o;return s?St.createPortal(r.createElement(kt,{scope:e.__scopeSelect},r.createElement(_e.Slot,{scope:e.__scopeSelect},r.createElement("div",null,e.children))),s):null}return r.createElement(yo,I({},e,{ref:n}))}),z=10,[kt,oe]=ue(de),yo=r.forwardRef((e,n)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:d,align:u,alignOffset:v,arrowPadding:b,collisionBoundary:w,collisionPadding:x,sticky:h,hideWhenDetached:i,avoidCollisions:m,...p}=e,f=ne(de,t),[$,E]=r.useState(null),[y,j]=r.useState(null),T=D(n,C=>E(C)),[N,L]=r.useState(null),[W,te]=r.useState(null),K=Te(t),[X,Z]=r.useState(!1),k=r.useRef(!1);r.useEffect(()=>{if($)return Rn($)},[$]),vn();const U=r.useCallback(C=>{const[P,...V]=K().map(_=>_.ref.current),[A]=V.slice(-1),R=document.activeElement;for(const _ of C)if(_===R||(_==null||_.scrollIntoView({block:"nearest"}),_===P&&y&&(y.scrollTop=0),_===A&&y&&(y.scrollTop=y.scrollHeight),_==null||_.focus(),document.activeElement!==R))return},[K,y]),Y=r.useCallback(()=>U([N,$]),[U,N,$]);r.useEffect(()=>{X&&Y()},[X,Y]);const{onOpenChange:re,triggerPointerDownPosRef:Q}=f;r.useEffect(()=>{if($){let C={x:0,y:0};const P=A=>{var R,_,B,H;C={x:Math.abs(Math.round(A.pageX)-((R=(_=Q.current)===null||_===void 0?void 0:_.x)!==null&&R!==void 0?R:0)),y:Math.abs(Math.round(A.pageY)-((B=(H=Q.current)===null||H===void 0?void 0:H.y)!==null&&B!==void 0?B:0))}},V=A=>{C.x<=10&&C.y<=10?A.preventDefault():$.contains(A.target)||re(!1),document.removeEventListener("pointermove",P),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",V,{capture:!0})}}},[$,re,Q]),r.useEffect(()=>{const C=()=>re(!1);return window.addEventListener("blur",C),window.addEventListener("resize",C),()=>{window.removeEventListener("blur",C),window.removeEventListener("resize",C)}},[re]);const[Ne,he]=Ft(C=>{const P=K().filter(R=>!R.disabled),V=P.find(R=>R.ref.current===document.activeElement),A=Bt(P,C,V);A&&setTimeout(()=>A.ref.current.focus())}),Me=r.useCallback((C,P,V)=>{const A=!k.current&&!V;(f.value!==void 0&&f.value===P||A)&&(L(C),A&&(k.current=!0))},[f.value]),Oe=r.useCallback(()=>$==null?void 0:$.focus(),[$]),ce=r.useCallback((C,P,V)=>{const A=!k.current&&!V;(f.value!==void 0&&f.value===P||A)&&te(C)},[f.value]),be=o==="popper"?vt:Io,fe=be===vt?{side:a,sideOffset:d,align:u,alignOffset:v,arrowPadding:b,collisionBoundary:w,collisionPadding:x,sticky:h,hideWhenDetached:i,avoidCollisions:m}:{};return r.createElement(kt,{scope:t,content:$,viewport:y,onViewportChange:j,itemRefCallback:Me,selectedItem:N,onItemLeave:Oe,itemTextRefCallback:ce,focusSelectedItem:Y,selectedItemText:W,position:o,isPositioned:X,searchRef:Ne},r.createElement(io,{as:Ue,allowPinchZoom:!0},r.createElement(hn,{asChild:!0,trapped:f.open,onMountAutoFocus:C=>{C.preventDefault()},onUnmountAutoFocus:O(c,C=>{var P;(P=f.trigger)===null||P===void 0||P.focus({preventScroll:!0}),C.preventDefault()})},r.createElement(Jt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:C=>C.preventDefault(),onDismiss:()=>f.onOpenChange(!1)},r.createElement(be,I({role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:C=>C.preventDefault()},p,fe,{onPlaced:()=>Z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:O(p.onKeyDown,C=>{const P=C.ctrlKey||C.altKey||C.metaKey;if(C.key==="Tab"&&C.preventDefault(),!P&&C.key.length===1&&he(C.key),["ArrowUp","ArrowDown","Home","End"].includes(C.key)){let A=K().filter(R=>!R.disabled).map(R=>R.ref.current);if(["ArrowUp","End"].includes(C.key)&&(A=A.slice().reverse()),["ArrowUp","ArrowDown"].includes(C.key)){const R=C.target,_=A.indexOf(R);A=A.slice(_+1)}setTimeout(()=>U(A)),C.preventDefault()}})}))))))}),Io=r.forwardRef((e,n)=>{const{__scopeSelect:t,onPlaced:o,...c}=e,s=ne(de,t),l=oe(de,t),[a,d]=r.useState(null),[u,v]=r.useState(null),b=D(n,T=>v(T)),w=Te(t),x=r.useRef(!1),h=r.useRef(!0),{viewport:i,selectedItem:m,selectedItemText:p,focusSelectedItem:f}=l,$=r.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&i&&m&&p){const T=s.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),W=p.getBoundingClientRect();if(s.dir!=="rtl"){const R=W.left-N.left,_=L.left-R,B=T.left-_,H=T.width+B,ke=Math.max(H,N.width),De=window.innerWidth-z,Le=rt(_,[z,De-ke]);a.style.minWidth=H+"px",a.style.left=Le+"px"}else{const R=N.right-W.right,_=window.innerWidth-L.right-R,B=window.innerWidth-T.right-_,H=T.width+B,ke=Math.max(H,N.width),De=window.innerWidth-z,Le=rt(_,[z,De-ke]);a.style.minWidth=H+"px",a.style.right=Le+"px"}const te=w(),K=window.innerHeight-z*2,X=i.scrollHeight,Z=window.getComputedStyle(u),k=parseInt(Z.borderTopWidth,10),U=parseInt(Z.paddingTop,10),Y=parseInt(Z.borderBottomWidth,10),re=parseInt(Z.paddingBottom,10),Q=k+U+X+re+Y,Ne=Math.min(m.offsetHeight*5,Q),he=window.getComputedStyle(i),Me=parseInt(he.paddingTop,10),Oe=parseInt(he.paddingBottom,10),ce=T.top+T.height/2-z,be=K-ce,fe=m.offsetHeight/2,C=m.offsetTop+fe,P=k+U+C,V=Q-P;if(P<=ce){const R=m===te[te.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-i.offsetTop-i.offsetHeight,B=Math.max(be,fe+(R?Oe:0)+_+Y),H=P+B;a.style.height=H+"px"}else{const R=m===te[0].ref.current;a.style.top="0px";const B=Math.max(ce,k+i.offsetTop+(R?Me:0)+fe)+V;a.style.height=B+"px",i.scrollTop=P-ce+i.offsetTop}a.style.margin=`${z}px 0`,a.style.minHeight=Ne+"px",a.style.maxHeight=K+"px",o==null||o(),requestAnimationFrame(()=>x.current=!0)}},[w,s.trigger,s.valueNode,a,u,i,m,p,s.dir,o]);q(()=>$(),[$]);const[E,y]=r.useState();q(()=>{u&&y(window.getComputedStyle(u).zIndex)},[u]);const j=r.useCallback(T=>{T&&h.current===!0&&($(),f==null||f(),h.current=!1)},[$,f]);return r.createElement(Ro,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:x,onScrollButtonChange:j},r.createElement("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},r.createElement(M.div,I({},c,{ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}}))))}),vt=r.forwardRef((e,n)=>{const{__scopeSelect:t,align:o="start",collisionPadding:c=z,...s}=e,l=Xe(t);return r.createElement(tn,I({},l,s,{ref:n,align:o,collisionPadding:c,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Ro,Ze]=ue(de,{}),ht="SelectViewport",_o=r.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,c=oe(ht,t),s=Ze(ht,t),l=D(n,c.onViewportChange),a=r.useRef(0);return r.createElement(r.Fragment,null,r.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),r.createElement(_e.Slot,{scope:t},r.createElement(M.div,I({"data-radix-select-viewport":"",role:"presentation"},o,{ref:l,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:O(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=s;if(b!=null&&b.current&&v){const w=Math.abs(a.current-u.scrollTop);if(w>0){const x=window.innerHeight-z*2,h=parseFloat(v.style.minHeight),i=parseFloat(v.style.height),m=Math.max(h,i);if(m<x){const p=m+w,f=Math.min(x,p),$=p-f;v.style.height=f+"px",v.style.bottom==="0px"&&(u.scrollTop=$>0?$:0,v.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),To="SelectGroup",[Po,Ao]=ue(To),No=r.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,c=me();return r.createElement(Po,{scope:t,id:c},r.createElement(M.div,I({role:"group","aria-labelledby":c},o,{ref:n})))}),Mo="SelectLabel",Oo=r.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e,c=Ao(Mo,t);return r.createElement(M.div,I({id:c.id},o,{ref:n}))}),ze="SelectItem",[ko,Dt]=ue(ze),Do=r.forwardRef((e,n)=>{const{__scopeSelect:t,value:o,disabled:c=!1,textValue:s,...l}=e,a=ne(ze,t),d=oe(ze,t),u=a.value===o,[v,b]=r.useState(s??""),[w,x]=r.useState(!1),h=D(n,p=>{var f;return(f=d.itemRefCallback)===null||f===void 0?void 0:f.call(d,p,o,c)}),i=me(),m=()=>{c||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.createElement(ko,{scope:t,value:o,disabled:c,textId:i,isSelected:u,onItemTextChange:r.useCallback(p=>{b(f=>{var $;return f||(($=p==null?void 0:p.textContent)!==null&&$!==void 0?$:"").trim()})},[])},r.createElement(_e.ItemSlot,{scope:t,value:o,disabled:c,textValue:v},r.createElement(M.div,I({role:"option","aria-labelledby":i,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1},l,{ref:h,onFocus:O(l.onFocus,()=>x(!0)),onBlur:O(l.onBlur,()=>x(!1)),onPointerUp:O(l.onPointerUp,m),onPointerMove:O(l.onPointerMove,p=>{if(c){var f;(f=d.onItemLeave)===null||f===void 0||f.call(d)}else p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:O(l.onPointerLeave,p=>{if(p.currentTarget===document.activeElement){var f;(f=d.onItemLeave)===null||f===void 0||f.call(d)}}),onKeyDown:O(l.onKeyDown,p=>{var f;((f=d.searchRef)===null||f===void 0?void 0:f.current)!==""&&p.key===" "||(fo.includes(p.key)&&m(),p.key===" "&&p.preventDefault())})}))))}),Se="SelectItemText",Lo=r.forwardRef((e,n)=>{const{__scopeSelect:t,className:o,style:c,...s}=e,l=ne(Se,t),a=oe(Se,t),d=Dt(Se,t),u=ho(Se,t),[v,b]=r.useState(null),w=D(n,p=>b(p),d.onItemTextChange,p=>{var f;return(f=a.itemTextRefCallback)===null||f===void 0?void 0:f.call(a,p,d.value,d.disabled)}),x=v==null?void 0:v.textContent,h=r.useMemo(()=>r.createElement("option",{key:d.value,value:d.value,disabled:d.disabled},x),[d.disabled,d.value,x]),{onNativeOptionAdd:i,onNativeOptionRemove:m}=u;return q(()=>(i(h),()=>m(h)),[i,m,h]),r.createElement(r.Fragment,null,r.createElement(M.span,I({id:d.textId},s,{ref:w})),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?St.createPortal(s.children,l.valueNode):null)}),jo="SelectItemIndicator",Vo=r.forwardRef((e,n)=>{const{__scopeSelect:t,...o}=e;return Dt(jo,t).isSelected?r.createElement(M.span,I({"aria-hidden":!0},o,{ref:n})):null}),bt="SelectScrollUpButton",Fo=r.forwardRef((e,n)=>{const t=oe(bt,e.__scopeSelect),o=Ze(bt,e.__scopeSelect),[c,s]=r.useState(!1),l=D(n,o.onScrollButtonChange);return q(()=>{if(t.viewport&&t.isPositioned){let d=function(){const u=a.scrollTop>0;s(u)};const a=t.viewport;return d(),a.addEventListener("scroll",d),()=>a.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),c?r.createElement(Lt,I({},e,{ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=t;a&&d&&(a.scrollTop=a.scrollTop-d.offsetHeight)}})):null}),$t="SelectScrollDownButton",Bo=r.forwardRef((e,n)=>{const t=oe($t,e.__scopeSelect),o=Ze($t,e.__scopeSelect),[c,s]=r.useState(!1),l=D(n,o.onScrollButtonChange);return q(()=>{if(t.viewport&&t.isPositioned){let d=function(){const u=a.scrollHeight-a.clientHeight,v=Math.ceil(a.scrollTop)<u;s(v)};const a=t.viewport;return d(),a.addEventListener("scroll",d),()=>a.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),c?r.createElement(Lt,I({},e,{ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:d}=t;a&&d&&(a.scrollTop=a.scrollTop+d.offsetHeight)}})):null}),Lt=r.forwardRef((e,n)=>{const{__scopeSelect:t,onAutoScroll:o,...c}=e,s=oe("SelectScrollButton",t),l=r.useRef(null),a=Te(t),d=r.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),q(()=>{var u;const v=a().find(b=>b.ref.current===document.activeElement);v==null||(u=v.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[a]),r.createElement(M.div,I({"aria-hidden":!0},c,{ref:n,style:{flexShrink:0,...c.style},onPointerDown:O(c.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:O(c.onPointerMove,()=>{var u;(u=s.onItemLeave)===null||u===void 0||u.call(s),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:O(c.onPointerLeave,()=>{d()})}))});function jt(e){return e===""||e===void 0}const Vt=r.forwardRef((e,n)=>{const{value:t,...o}=e,c=r.useRef(null),s=D(n,c),l=Cn(t);return r.useEffect(()=>{const a=c.current,d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const b=new Event("change",{bubbles:!0});v.call(a,t),a.dispatchEvent(b)}},[l,t]),r.createElement(en,{asChild:!0},r.createElement("select",I({},o,{ref:s,defaultValue:t})))});Vt.displayName="BubbleSelect";function Ft(e){const n=Ge(e),t=r.useRef(""),o=r.useRef(0),c=r.useCallback(l=>{const a=t.current+l;n(a),function d(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>d(""),1e3))}(a)},[n]),s=r.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,c,s]}function Bt(e,n,t){const c=n.length>1&&Array.from(n).every(u=>u===n[0])?n[0]:n,s=t?e.indexOf(t):-1;let l=Ho(e,Math.max(s,0));c.length===1&&(l=l.filter(u=>u!==t));const d=l.find(u=>u.textValue.toLowerCase().startsWith(c.toLowerCase()));return d!==t?d:void 0}function Ho(e,n){return e.map((t,o)=>e[(n+o)%e.length])}const Wo=bo,Ko=go,Uo=wo,Go=So,Yo=Co,zo=Eo,qo=_o,Xo=No,Zo=Oo,Qo=Do,Jo=Lo,er=Vo,tr=Fo,nr=Bo,Ht="Collapsible",[or,Wt]=ye(Ht),[rr,Qe]=or(Ht),cr=r.forwardRef((e,n)=>{const{__scopeCollapsible:t,open:o,defaultOpen:c,disabled:s,onOpenChange:l,...a}=e,[d=!1,u]=pe({prop:o,defaultProp:c,onChange:l});return r.createElement(rr,{scope:t,disabled:s,contentId:me(),open:d,onOpenToggle:r.useCallback(()=>u(v=>!v),[u])},r.createElement(M.div,I({"data-state":Je(d),"data-disabled":s?"":void 0},a,{ref:n})))}),ar="CollapsibleTrigger",sr=r.forwardRef((e,n)=>{const{__scopeCollapsible:t,...o}=e,c=Qe(ar,t);return r.createElement(M.button,I({type:"button","aria-controls":c.contentId,"aria-expanded":c.open||!1,"data-state":Je(c.open),"data-disabled":c.disabled?"":void 0,disabled:c.disabled},o,{ref:n,onClick:O(e.onClick,c.onOpenToggle)}))}),Kt="CollapsibleContent",lr=r.forwardRef((e,n)=>{const{forceMount:t,...o}=e,c=Qe(Kt,e.__scopeCollapsible);return r.createElement(nn,{present:t||c.open},({present:s})=>r.createElement(ir,I({},o,{ref:n,present:s})))}),ir=r.forwardRef((e,n)=>{const{__scopeCollapsible:t,present:o,children:c,...s}=e,l=Qe(Kt,t),[a,d]=r.useState(o),u=r.useRef(null),v=D(n,u),b=r.useRef(0),w=b.current,x=r.useRef(0),h=x.current,i=l.open||a,m=r.useRef(i),p=r.useRef();return r.useEffect(()=>{const f=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(f)},[]),q(()=>{const f=u.current;if(f){p.current=p.current||{transitionDuration:f.style.transitionDuration,animationName:f.style.animationName},f.style.transitionDuration="0s",f.style.animationName="none";const $=f.getBoundingClientRect();b.current=$.height,x.current=$.width,m.current||(f.style.transitionDuration=p.current.transitionDuration,f.style.animationName=p.current.animationName),d(o)}},[l.open,o]),r.createElement(M.div,I({"data-state":Je(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!i},s,{ref:v,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style}}),i&&c)});function Je(e){return e?"open":"closed"}const dr=cr,ur=sr,fr=lr,ee="Accordion",pr=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[et,mr,vr]=Ct(ee),[Pe,zr]=ye(ee,[vr,Wt]),tt=Wt(),Ut=S.forwardRef((e,n)=>{const{type:t,...o}=e,c=o,s=o;return S.createElement(et.Provider,{scope:e.__scopeAccordion},t==="multiple"?S.createElement(gr,I({},s,{ref:n})):S.createElement($r,I({},c,{ref:n})))});Ut.propTypes={type(e){const n=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof n=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(n)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[Gt,hr]=Pe(ee),[Yt,br]=Pe(ee,{collapsible:!1}),$r=S.forwardRef((e,n)=>{const{value:t,defaultValue:o,onValueChange:c=()=>{},collapsible:s=!1,...l}=e,[a,d]=pe({prop:t,defaultProp:o,onChange:c});return S.createElement(Gt,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:d,onItemClose:S.useCallback(()=>s&&d(""),[s,d])},S.createElement(Yt,{scope:e.__scopeAccordion,collapsible:s},S.createElement(zt,I({},l,{ref:n}))))}),gr=S.forwardRef((e,n)=>{const{value:t,defaultValue:o,onValueChange:c=()=>{},...s}=e,[l=[],a]=pe({prop:t,defaultProp:o,onChange:c}),d=S.useCallback(v=>a((b=[])=>[...b,v]),[a]),u=S.useCallback(v=>a((b=[])=>b.filter(w=>w!==v)),[a]);return S.createElement(Gt,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u},S.createElement(Yt,{scope:e.__scopeAccordion,collapsible:!0},S.createElement(zt,I({},s,{ref:n}))))}),[xr,Ae]=Pe(ee),zt=S.forwardRef((e,n)=>{const{__scopeAccordion:t,disabled:o,dir:c,orientation:s="vertical",...l}=e,a=S.useRef(null),d=D(a,n),u=mr(t),b=Et(c)==="ltr",w=O(e.onKeyDown,x=>{var h;if(!pr.includes(x.key))return;const i=x.target,m=u().filter(L=>{var W;return!((W=L.ref.current)!==null&&W!==void 0&&W.disabled)}),p=m.findIndex(L=>L.ref.current===i),f=m.length;if(p===-1)return;x.preventDefault();let $=p;const E=0,y=f-1,j=()=>{$=p+1,$>y&&($=E)},T=()=>{$=p-1,$<E&&($=y)};switch(x.key){case"Home":$=E;break;case"End":$=y;break;case"ArrowRight":s==="horizontal"&&(b?j():T());break;case"ArrowDown":s==="vertical"&&j();break;case"ArrowLeft":s==="horizontal"&&(b?T():j());break;case"ArrowUp":s==="vertical"&&T();break}const N=$%f;(h=m[N].ref.current)===null||h===void 0||h.focus()});return S.createElement(xr,{scope:t,disabled:o,direction:c,orientation:s},S.createElement(et.Slot,{scope:t},S.createElement(M.div,I({},l,{"data-orientation":s,ref:d,onKeyDown:o?void 0:w}))))}),qe="AccordionItem",[wr,nt]=Pe(qe),Sr=S.forwardRef((e,n)=>{const{__scopeAccordion:t,value:o,...c}=e,s=Ae(qe,t),l=hr(qe,t),a=tt(t),d=me(),u=o&&l.value.includes(o)||!1,v=s.disabled||e.disabled;return S.createElement(wr,{scope:t,open:u,disabled:v,triggerId:d},S.createElement(dr,I({"data-orientation":s.orientation,"data-state":qt(u)},a,c,{ref:n,disabled:v,open:u,onOpenChange:b=>{b?l.onItemOpen(o):l.onItemClose(o)}})))}),Cr="AccordionHeader",Er=S.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,c=Ae(ee,t),s=nt(Cr,t);return S.createElement(M.h3,I({"data-orientation":c.orientation,"data-state":qt(s.open),"data-disabled":s.disabled?"":void 0},o,{ref:n}))}),gt="AccordionTrigger",yr=S.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,c=Ae(ee,t),s=nt(gt,t),l=br(gt,t),a=tt(t);return S.createElement(et.ItemSlot,{scope:t},S.createElement(ur,I({"aria-disabled":s.open&&!l.collapsible||void 0,"data-orientation":c.orientation,id:s.triggerId},a,o,{ref:n})))}),Ir="AccordionContent",Rr=S.forwardRef((e,n)=>{const{__scopeAccordion:t,...o}=e,c=Ae(ee,t),s=nt(Ir,t),l=tt(t);return S.createElement(fr,I({role:"region","aria-labelledby":s.triggerId,"data-orientation":c.orientation},l,o,{ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function qt(e){return e?"open":"closed"}const _r=Ut,Tr=Sr,Pr=Er,Ar=yr,Nr=Rr,Mr=({title:e,children:n,variant:t,icon:o,forceMount:c=!1})=>{const s=()=>{switch(t){case"changed":return g.jsx(F,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"});case"renamed":return g.jsx(F,{name:"Renamed","aria-label":"Renamed",className:"text-[#fb923c]"});case"added":return g.jsx(F,{name:"Added","aria-label":"Added",className:"text-[#10b981]"});case"deleted":return g.jsx(F,{name:"Deleted","aria-label":"Deleted",className:"text-[#ef4444]"});default:return g.jsx(F,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"})}},l=()=>{switch(t){case"changed":return"modified";default:return t}},a=e.replace(/\\\\/g,"\\");return g.jsxs(Tr,{value:e,children:[g.jsxs(kr,{variant:l(),children:[o||s()," ",a]}),g.jsx(Dr,{forceMount:c,className:ve("prose max-w-none whitespace-pre-wrap dark:prose-invert prose-pre:m-0 prose-pre:mb-1 prose-pre:rounded-none",{"radix-state-closed:hidden":c}),children:n})]})},Or=Mr,kr=r.forwardRef(({children:e,className:n,variant:t,...o},c)=>g.jsx(Pr,{className:"flex",asChild:!0,children:g.jsxs(Ar,{className:ve("group flex w-full items-center justify-between border-b p-4 pr-3 font-mono text-sm font-medium leading-none hover:bg-foreground/20",n),...o,ref:c,children:[g.jsx("div",{className:"flex items-center gap-1.5",children:e}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"font-mono text-xs font-normal uppercase text-muted-foreground",children:t}),g.jsx(F,{name:"TriangleDownSmall",className:"transition group-radix-state-open:rotate-180","aria-hidden":!0})]})]})})),Dr=r.forwardRef(({children:e,className:n,...t},o)=>g.jsx(Nr,{className:ve("",n),...t,ref:o,children:g.jsx("div",{children:e})})),Lr=e=>g.jsx("pre",{...e}),jr={Accordion:Or,pre:Lr};function qr({diff:e,allApps:n}){const t=rn(),[o]=cn(),c=new URLSearchParams(o);c.set("forceFresh","diff");const s=Xt(),l=dn.useSpinDelay(s.state!=="idle",{delay:0,minDuration:1e3}),a=[];for(const[d,u]of o.entries())d==="app1"||d==="app2"||a.push(g.jsx("input",{type:"hidden",name:d,value:u},d));return g.jsx(r.Suspense,{fallback:g.jsx("div",{className:"flex items-center justify-center p-8",children:g.jsx(ot,{content:"Loading diff",children:g.jsx(F,{name:"Refresh",className:"animate-spin"})})}),children:g.jsx(an,{resolve:e,errorElement:g.jsx("p",{className:"p-6 text-foreground-danger",children:"There was an error calculating the diff. Sorry."}),children:d=>g.jsxs("div",{className:"flex h-full w-full flex-col",children:[g.jsxs("div",{className:"flex h-14 min-h-14 w-full overflow-x-hidden border-b",children:[g.jsx("div",{className:"border-r",children:g.jsx(ot,{content:"Reload diff",children:g.jsx(sn,{to:`.?${c}`,className:"flex h-full w-14 items-center justify-center",children:g.jsx(F,{name:"Refresh",className:un({"animate-spin":l})})})})}),g.jsxs(ln,{onChange:u=>t(u.currentTarget),className:"flex h-full flex-1 items-center overflow-x-auto scrollbar-thin scrollbar-thumb-scrollbar",children:[a,g.jsx(xt,{name:"app1",label:"App 1",className:"border-r",allApps:n,defaultValue:d.app1}),g.jsx(xt,{name:"app2",label:"App 2",allApps:n,defaultValue:d.app2})]},`${d.app1}${d.app2}`)]}),g.jsx("div",{className:"flex-grow overflow-y-scroll scrollbar-thin scrollbar-thumb-scrollbar",children:d.diffCode?g.jsx("div",{children:g.jsx(_r,{className:"w-full",type:"multiple",children:g.jsx(fn,{code:d.diffCode,components:jr})})}):d.app1&&d.app2?g.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"There was a problem generating the diff"}):g.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"Select two apps to compare"})})]})})})}function xt({name:e,label:n,className:t,allApps:o,defaultValue:c}){return g.jsxs(Wo,{name:e,defaultValue:c,children:[g.jsxs(Ko,{className:ve("flex h-full w-full max-w-[50%] items-center justify-between px-3 text-left radix-placeholder:text-gray-500 focus-visible:outline-none",t),"aria-label":`Select ${n} for git Diff`,children:[g.jsxs("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:[n,":"," ",g.jsx(Fr,{placeholder:`Select ${n}`,className:"inline-block w-40 text-ellipsis"})]}),g.jsx(Go,{className:"",children:g.jsx(F,{name:"TriangleDownSmall"})})]}),g.jsx(Yo,{children:g.jsxs(zo,{position:"popper",align:"start",className:"z-20 max-h-[50vh] bg-black text-white lg:max-h-[70vh]",children:[g.jsx(tr,{className:"flex h-5 cursor-default items-center justify-center ",children:g.jsx(F,{name:"ChevronUp"})}),g.jsx(qo,{className:"p-3",children:g.jsxs(Xo,{children:[g.jsx(Zo,{className:"px-5 pb-3 font-mono uppercase",children:n}),o.map(s=>g.jsx(Vr,{value:s.name,children:s.displayName},s.name))]})}),g.jsx(nr,{className:"flex h-5 cursor-default items-center justify-center ",children:g.jsx(F,{name:"ChevronDown"})})]})})]})}const Vr=S.forwardRef(({children:e,className:n,...t},o)=>g.jsxs(Qo,{className:ve("relative flex cursor-pointer select-none items-center rounded px-10 py-2 leading-none opacity-80 radix-disabled:text-red-500 radix-highlighted:opacity-100 radix-highlighted:outline-none radix-state-checked:opacity-100",n),...t,ref:o,children:[g.jsx(Jo,{children:e}),g.jsx(er,{className:"absolute left-0 inline-flex w-[25px] items-center justify-center",children:g.jsx(F,{name:"CheckSmall"})})]})),Fr=S.forwardRef(({children:e,className:n,...t},o)=>g.jsx(Uo,{...t,ref:o,children:t.value}));export{Ct as $,Or as A,qr as D,Et as a,Wo as b,Ko as c,Uo as d,Go as e,Yo as f,zo as g,tr as h,qo as i,Xo as j,Zo as k,nr as l,Qo as m,Jo as n,er as o,_r as p,pn as q,Rn as r,io as s,vn as t,hn as u};
42
- //# sourceMappingURL=diff-MSYB00VZ.js.map
42
+ //# sourceMappingURL=diff-CT3-9rtW.js.map