@epic-web/workshop-app 4.26.2 → 4.27.0

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 (51) hide show
  1. package/build/client/assets/{_exerciseNumber-B_1LTOMl.js → _exerciseNumber-DeMmiDU5.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-B_1LTOMl.js.map → _exerciseNumber-DeMmiDU5.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-DHl9ou1s.js → _exerciseNumber_.finished-DM5HZX6r.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-DHl9ou1s.js.map → _exerciseNumber_.finished-DM5HZX6r.js.map} +1 -1
  5. package/build/client/assets/{_layout-TpI4uc69.js → _layout-5idP3Bqx.js} +2 -2
  6. package/build/client/assets/{_layout-TpI4uc69.js.map → _layout-5idP3Bqx.js.map} +1 -1
  7. package/build/client/assets/{_layout-CksyTzND.js → _layout-DkGEbcMk.js} +2 -2
  8. package/build/client/assets/{_layout-CksyTzND.js.map → _layout-DkGEbcMk.js.map} +1 -1
  9. package/build/client/assets/{account-DWhUP9x5.js → account-D1DCJCnR.js} +2 -2
  10. package/build/client/assets/{account-DWhUP9x5.js.map → account-D1DCJCnR.js.map} +1 -1
  11. package/build/client/assets/{diff-CKxYA_sC.js → diff-CU8At1c4.js} +2 -2
  12. package/build/client/assets/{diff-CKxYA_sC.js.map → diff-CU8At1c4.js.map} +1 -1
  13. package/build/client/assets/diff-hoOood-9.js +2 -0
  14. package/build/client/assets/diff-hoOood-9.js.map +1 -0
  15. package/build/client/assets/discord-BBRM_H3g.js +2 -0
  16. package/build/client/assets/discord-BBRM_H3g.js.map +1 -0
  17. package/build/client/assets/{discord-OBIm1mMI.js → discord-CgdmSzxV.js} +2 -2
  18. package/build/client/assets/{discord-OBIm1mMI.js.map → discord-CgdmSzxV.js.map} +1 -1
  19. package/build/client/assets/{epic-video-CzGRLoYH.js → epic-video-BFcdejfC.js} +2 -2
  20. package/build/client/assets/{epic-video-CzGRLoYH.js.map → epic-video-BFcdejfC.js.map} +1 -1
  21. package/build/client/assets/{finished-Bb9g_iPq.js → finished-C_v7hO19.js} +2 -2
  22. package/build/client/assets/{finished-Bb9g_iPq.js.map → finished-C_v7hO19.js.map} +1 -1
  23. package/build/client/assets/{index-C-VazAW9.js → index-BHeB-0xq.js} +2 -2
  24. package/build/client/assets/{index-C-VazAW9.js.map → index-BHeB-0xq.js.map} +1 -1
  25. package/build/client/assets/{index-BVys5A_i.js → index-CsPok4Mn.js} +2 -2
  26. package/build/client/assets/{index-BVys5A_i.js.map → index-CsPok4Mn.js.map} +1 -1
  27. package/build/client/assets/login-Ca9EDpZj.js +2 -0
  28. package/build/client/assets/{login-L4mUv67t.js.map → login-Ca9EDpZj.js.map} +1 -1
  29. package/build/client/assets/manifest-93b38e47.js +1 -0
  30. package/build/client/assets/{mdx-CGcvotZI.js → mdx-DvqHp8UI.js} +2 -2
  31. package/build/client/assets/{mdx-CGcvotZI.js.map → mdx-DvqHp8UI.js.map} +1 -1
  32. package/build/client/assets/{onboarding-Ci4QCevA.js → onboarding-Dc2TmI9y.js} +2 -2
  33. package/build/client/assets/{onboarding-Ci4QCevA.js.map → onboarding-Dc2TmI9y.js.map} +1 -1
  34. package/build/client/assets/test-Cy-fo6gv.js +2 -0
  35. package/build/client/assets/{test-DL_jD5Wc.js.map → test-Cy-fo6gv.js.map} +1 -1
  36. package/build/client/assets/tests-DmimqC1q.js +4 -0
  37. package/build/client/assets/{tests-BHsX0R-r.js.map → tests-DmimqC1q.js.map} +1 -1
  38. package/build/client/assets/user-DvujSs-t.js +2 -0
  39. package/build/client/assets/{user-D6tTg1yS.js.map → user-DvujSs-t.js.map} +1 -1
  40. package/build/server/index.js +35 -13
  41. package/build/server/index.js.map +1 -1
  42. package/package.json +3 -3
  43. package/build/client/assets/diff-B5EME8RQ.js +0 -2
  44. package/build/client/assets/diff-B5EME8RQ.js.map +0 -1
  45. package/build/client/assets/discord-pvbkb0tl.js +0 -2
  46. package/build/client/assets/discord-pvbkb0tl.js.map +0 -1
  47. package/build/client/assets/login-L4mUv67t.js +0 -2
  48. package/build/client/assets/manifest-c0629f94.js +0 -1
  49. package/build/client/assets/test-DL_jD5Wc.js +0 -2
  50. package/build/client/assets/tests-BHsX0R-r.js +0 -4
  51. package/build/client/assets/user-D6tTg1yS.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"login-L4mUv67t.js","sources":["../../../app/utils/auth-events.ts","../../../app/routes/login-sse.tsx","../../../app/routes/_app+/login.tsx"],"sourcesContent":["export const EVENTS = {\n\tUSER_CODE_RECEIVED: 'USER_CODE_RECEIVED',\n\tAUTH_RESOLVED: 'AUTH_RESOLVED',\n\tAUTH_REJECTED: 'AUTH_REJECTED',\n} as const\nexport type EventTypes = keyof typeof EVENTS\n","import { type LoaderFunctionArgs } from '@remix-run/node'\nimport { eventStream } from 'remix-utils/sse/server'\nimport { z } from 'zod'\nimport { EVENTS } from '#app/utils/auth-events.ts'\nimport { authEmitter } from '#app/utils/auth.server.ts'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\n\nconst CodeReceivedEventSchema = z.object({\n\ttype: z.literal(EVENTS.USER_CODE_RECEIVED),\n\tcode: z.string(),\n\turl: z.string(),\n})\nconst AuthResolvedEventSchema = z.object({\n\ttype: z.literal(EVENTS.AUTH_RESOLVED),\n})\nconst AuthRejectedEventSchema = z.object({\n\ttype: z.literal(EVENTS.AUTH_REJECTED),\n\terror: z.string().optional().default('Unknown error'),\n})\nexport const EventSchema = z.union([\n\tCodeReceivedEventSchema,\n\tAuthResolvedEventSchema,\n\tAuthRejectedEventSchema,\n])\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\treturn eventStream(request.signal, function setup(send) {\n\t\tfunction handleCodeReceived(data: any) {\n\t\t\tsend({\n\t\t\t\tdata: JSON.stringify(\n\t\t\t\t\tCodeReceivedEventSchema.parse({\n\t\t\t\t\t\ttype: EVENTS.USER_CODE_RECEIVED,\n\t\t\t\t\t\t...data,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t})\n\t\t}\n\t\tfunction handleAuthResolved() {\n\t\t\tsend({ data: JSON.stringify({ type: EVENTS.AUTH_RESOLVED }) })\n\t\t}\n\t\tfunction handleAuthRejected(data: any) {\n\t\t\tconst result = AuthRejectedEventSchema.safeParse(data)\n\t\t\tif (result.success) {\n\t\t\t\tsend({ data: JSON.stringify(result.data) })\n\t\t\t} else {\n\t\t\t\tconsole.error('Error parsing auth rejected event', result.error, data)\n\t\t\t}\n\t\t}\n\t\tauthEmitter.on(EVENTS.USER_CODE_RECEIVED, handleCodeReceived)\n\t\tauthEmitter.on(EVENTS.AUTH_RESOLVED, handleAuthResolved)\n\t\tauthEmitter.on(EVENTS.AUTH_REJECTED, handleAuthRejected)\n\t\treturn () => {\n\t\t\tauthEmitter.off(EVENTS.USER_CODE_RECEIVED, handleCodeReceived)\n\t\t\tauthEmitter.off(EVENTS.AUTH_RESOLVED, handleAuthResolved)\n\t\t\tauthEmitter.off(EVENTS.AUTH_REJECTED, handleAuthRejected)\n\t\t}\n\t})\n}\n","import { getAuthInfo } from '@epic-web/workshop-utils/db.server'\nimport { type SEOHandle } from '@nasa-gcn/remix-seo'\nimport { json, redirect } from '@remix-run/node'\nimport { useFetcher, useNavigate, useRevalidator } from '@remix-run/react'\nimport { useEffect, useState } from 'react'\nimport { useEventSource } from 'remix-utils/sse/react'\nimport { Button, ButtonLink } from '#app/components/button.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { Logo } from '#app/components/product.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.js'\nimport { EVENTS } from '#app/utils/auth-events.ts'\nimport { registerDevice } from '#app/utils/auth.server.ts'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\nimport { EventSchema } from '../login-sse.tsx'\n\nexport const handle: SEOHandle = {\n\tgetSitemapEntries: () => null,\n}\n\nexport async function loader() {\n\tensureUndeployed()\n\tconst isAuthenticated = Boolean(await getAuthInfo())\n\tif (isAuthenticated) throw redirect('/account')\n\treturn json({})\n}\n\nexport async function action() {\n\tensureUndeployed()\n\tvoid registerDevice()\n\treturn json({ status: 'pending' } as const)\n}\n\nexport default function Login() {\n\tconst {\n\t\tproduct: { displayName },\n\t} = useWorkshopConfig()\n\tconst loginFetcher = useFetcher<typeof action>()\n\tconst [clickedVerificationLink, setClickedVerificationLink] = useState(false)\n\tconst [authError, setAuthError] = useState<null | string>(null)\n\tconst [userCodeInfo, setUserCodeInfo] = useState<null | {\n\t\tcode: string\n\t\turl: string\n\t}>(null)\n\tconst navigate = useNavigate()\n\tconst revalidator = useRevalidator()\n\tconst lastMessage = useEventSource(`/login-sse`)\n\tuseEffect(() => {\n\t\tif (!lastMessage) return\n\n\t\tconst parsed = JSON.parse(lastMessage)\n\t\tconst result = EventSchema.safeParse(parsed)\n\t\tif (!result.success) {\n\t\t\tconsole.error(result.error.flatten())\n\t\t\treturn\n\t\t}\n\t\tswitch (result.data.type) {\n\t\t\tcase EVENTS.USER_CODE_RECEIVED: {\n\t\t\t\tsetUserCodeInfo(result.data)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase EVENTS.AUTH_RESOLVED: {\n\t\t\t\trevalidator.revalidate()\n\t\t\t\tnavigate('/')\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase EVENTS.AUTH_REJECTED: {\n\t\t\t\tsetAuthError(result.data.error)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}, [lastMessage, navigate, revalidator])\n\n\treturn (\n\t\t<main className=\"flex h-full w-full flex-grow flex-col items-center justify-center p-10 text-center\">\n\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t<Logo className=\"h-16 w-16\" />\n\t\t\t\t<h1 className=\"pt-5 text-2xl font-semibold md:text-3xl\">\n\t\t\t\t\tAuthenticate with {displayName}\n\t\t\t\t</h1>\n\t\t\t\t<h2 className=\"max-w-sm pt-3 text-base text-gray-700 dark:text-gray-300\">\n\t\t\t\t\tIf you have purchased {displayName}, you'll be able to watch videos,\n\t\t\t\t\ttrack progress, and more!\n\t\t\t\t</h2>\n\t\t\t\t<div className=\"flex w-full flex-col items-center pt-5\">\n\t\t\t\t\t{userCodeInfo ? (\n\t\t\t\t\t\t<div className=\"flex w-full flex-col items-center gap-3\">\n\t\t\t\t\t\t\t<div className=\"my-2 flex w-full flex-col items-center gap-2\">\n\t\t\t\t\t\t\t\t<p className=\"text-lg\">Your verification code is: </p>\n\t\t\t\t\t\t\t\t<div className=\"mb-3 w-full bg-gray-100 px-5 py-3 text-lg font-bold dark:bg-black/40\">\n\t\t\t\t\t\t\t\t\t<code>{userCodeInfo.code}</code>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<ButtonLink\n\t\t\t\t\t\t\t\tvarient=\"primary\"\n\t\t\t\t\t\t\t\tto={userCodeInfo.url}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noreferrer\"\n\t\t\t\t\t\t\t\tonClick={() => setClickedVerificationLink(true)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tContinue\n\t\t\t\t\t\t\t</ButtonLink>\n\t\t\t\t\t\t\t{clickedVerificationLink ? (\n\t\t\t\t\t\t\t\t<div className=\"pt-5 opacity-60\">\n\t\t\t\t\t\t\t\t\t<Loading>Waiting for confirmation</Loading>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<loginFetcher.Form method=\"POST\">\n\t\t\t\t\t\t\t<Button varient=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t{loginFetcher.state === 'idle' &&\n\t\t\t\t\t\t\t\tloginFetcher.data?.status !== 'pending'\n\t\t\t\t\t\t\t\t\t? `Retrieve Code`\n\t\t\t\t\t\t\t\t\t: `Retrieving Code...`}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</loginFetcher.Form>\n\t\t\t\t\t)}\n\t\t\t\t\t{authError ? (\n\t\t\t\t\t\t<div className=\"mt-4 text-red-500\">\n\t\t\t\t\t\t\tThere was an error: <pre>{authError}</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n"],"names":["EVENTS","CodeReceivedEventSchema","z","object","type","literal","USER_CODE_RECEIVED","code","string","url","AuthResolvedEventSchema","AUTH_RESOLVED","AuthRejectedEventSchema","AUTH_REJECTED","error","optional","default","EventSchema","union","handle","getSitemapEntries","Login","product","displayName","useWorkshopConfig","loginFetcher","useFetcher","clickedVerificationLink","setClickedVerificationLink","useState","authError","setAuthError","userCodeInfo","setUserCodeInfo","navigate","useNavigate","revalidator","useRevalidator","lastMessage","useEventSource","useEffect","parsed","JSON","parse","result","safeParse","success","console","flatten","data","revalidate","className","children","jsxs","jsx","Logo","ButtonLink","varient","to","target","rel","onClick","Loading","Form","method","Button","state","status"],"mappings":"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"}
1
+ {"version":3,"file":"login-Ca9EDpZj.js","sources":["../../../app/utils/auth-events.ts","../../../app/routes/login-sse.tsx","../../../app/routes/_app+/login.tsx"],"sourcesContent":["export const EVENTS = {\n\tUSER_CODE_RECEIVED: 'USER_CODE_RECEIVED',\n\tAUTH_RESOLVED: 'AUTH_RESOLVED',\n\tAUTH_REJECTED: 'AUTH_REJECTED',\n} as const\nexport type EventTypes = keyof typeof EVENTS\n","import { type LoaderFunctionArgs } from '@remix-run/node'\nimport { eventStream } from 'remix-utils/sse/server'\nimport { z } from 'zod'\nimport { EVENTS } from '#app/utils/auth-events.ts'\nimport { authEmitter } from '#app/utils/auth.server.ts'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\n\nconst CodeReceivedEventSchema = z.object({\n\ttype: z.literal(EVENTS.USER_CODE_RECEIVED),\n\tcode: z.string(),\n\turl: z.string(),\n})\nconst AuthResolvedEventSchema = z.object({\n\ttype: z.literal(EVENTS.AUTH_RESOLVED),\n})\nconst AuthRejectedEventSchema = z.object({\n\ttype: z.literal(EVENTS.AUTH_REJECTED),\n\terror: z.string().optional().default('Unknown error'),\n})\nexport const EventSchema = z.union([\n\tCodeReceivedEventSchema,\n\tAuthResolvedEventSchema,\n\tAuthRejectedEventSchema,\n])\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\treturn eventStream(request.signal, function setup(send) {\n\t\tfunction handleCodeReceived(data: any) {\n\t\t\tsend({\n\t\t\t\tdata: JSON.stringify(\n\t\t\t\t\tCodeReceivedEventSchema.parse({\n\t\t\t\t\t\ttype: EVENTS.USER_CODE_RECEIVED,\n\t\t\t\t\t\t...data,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t})\n\t\t}\n\t\tfunction handleAuthResolved() {\n\t\t\tsend({ data: JSON.stringify({ type: EVENTS.AUTH_RESOLVED }) })\n\t\t}\n\t\tfunction handleAuthRejected(data: any) {\n\t\t\tconst result = AuthRejectedEventSchema.safeParse(data)\n\t\t\tif (result.success) {\n\t\t\t\tsend({ data: JSON.stringify(result.data) })\n\t\t\t} else {\n\t\t\t\tconsole.error('Error parsing auth rejected event', result.error, data)\n\t\t\t}\n\t\t}\n\t\tauthEmitter.on(EVENTS.USER_CODE_RECEIVED, handleCodeReceived)\n\t\tauthEmitter.on(EVENTS.AUTH_RESOLVED, handleAuthResolved)\n\t\tauthEmitter.on(EVENTS.AUTH_REJECTED, handleAuthRejected)\n\t\treturn () => {\n\t\t\tauthEmitter.off(EVENTS.USER_CODE_RECEIVED, handleCodeReceived)\n\t\t\tauthEmitter.off(EVENTS.AUTH_RESOLVED, handleAuthResolved)\n\t\t\tauthEmitter.off(EVENTS.AUTH_REJECTED, handleAuthRejected)\n\t\t}\n\t})\n}\n","import { getAuthInfo } from '@epic-web/workshop-utils/db.server'\nimport { type SEOHandle } from '@nasa-gcn/remix-seo'\nimport { json, redirect } from '@remix-run/node'\nimport { useFetcher, useNavigate, useRevalidator } from '@remix-run/react'\nimport { useEffect, useState } from 'react'\nimport { useEventSource } from 'remix-utils/sse/react'\nimport { Button, ButtonLink } from '#app/components/button.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { Logo } from '#app/components/product.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.js'\nimport { EVENTS } from '#app/utils/auth-events.ts'\nimport { registerDevice } from '#app/utils/auth.server.ts'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\nimport { EventSchema } from '../login-sse.tsx'\n\nexport const handle: SEOHandle = {\n\tgetSitemapEntries: () => null,\n}\n\nexport async function loader() {\n\tensureUndeployed()\n\tconst isAuthenticated = Boolean(await getAuthInfo())\n\tif (isAuthenticated) throw redirect('/account')\n\treturn json({})\n}\n\nexport async function action() {\n\tensureUndeployed()\n\tvoid registerDevice()\n\treturn json({ status: 'pending' } as const)\n}\n\nexport default function Login() {\n\tconst {\n\t\tproduct: { displayName },\n\t} = useWorkshopConfig()\n\tconst loginFetcher = useFetcher<typeof action>()\n\tconst [clickedVerificationLink, setClickedVerificationLink] = useState(false)\n\tconst [authError, setAuthError] = useState<null | string>(null)\n\tconst [userCodeInfo, setUserCodeInfo] = useState<null | {\n\t\tcode: string\n\t\turl: string\n\t}>(null)\n\tconst navigate = useNavigate()\n\tconst revalidator = useRevalidator()\n\tconst lastMessage = useEventSource(`/login-sse`)\n\tuseEffect(() => {\n\t\tif (!lastMessage) return\n\n\t\tconst parsed = JSON.parse(lastMessage)\n\t\tconst result = EventSchema.safeParse(parsed)\n\t\tif (!result.success) {\n\t\t\tconsole.error(result.error.flatten())\n\t\t\treturn\n\t\t}\n\t\tswitch (result.data.type) {\n\t\t\tcase EVENTS.USER_CODE_RECEIVED: {\n\t\t\t\tsetUserCodeInfo(result.data)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase EVENTS.AUTH_RESOLVED: {\n\t\t\t\trevalidator.revalidate()\n\t\t\t\tnavigate('/')\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase EVENTS.AUTH_REJECTED: {\n\t\t\t\tsetAuthError(result.data.error)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}, [lastMessage, navigate, revalidator])\n\n\treturn (\n\t\t<main className=\"flex h-full w-full flex-grow flex-col items-center justify-center p-10 text-center\">\n\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t<Logo className=\"h-16 w-16\" />\n\t\t\t\t<h1 className=\"pt-5 text-2xl font-semibold md:text-3xl\">\n\t\t\t\t\tAuthenticate with {displayName}\n\t\t\t\t</h1>\n\t\t\t\t<h2 className=\"max-w-sm pt-3 text-base text-gray-700 dark:text-gray-300\">\n\t\t\t\t\tIf you have access to this workshop on {displayName}, you'll be able\n\t\t\t\t\tto watch videos, track progress, and more!\n\t\t\t\t</h2>\n\t\t\t\t<div className=\"flex w-full flex-col items-center pt-5\">\n\t\t\t\t\t{userCodeInfo ? (\n\t\t\t\t\t\t<div className=\"flex w-full flex-col items-center gap-3\">\n\t\t\t\t\t\t\t<div className=\"my-2 flex w-full flex-col items-center gap-2\">\n\t\t\t\t\t\t\t\t<p className=\"text-lg\">Your verification code is: </p>\n\t\t\t\t\t\t\t\t<div className=\"mb-3 w-full bg-gray-100 px-5 py-3 text-lg font-bold dark:bg-black/40\">\n\t\t\t\t\t\t\t\t\t<code>{userCodeInfo.code}</code>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<ButtonLink\n\t\t\t\t\t\t\t\tvarient=\"primary\"\n\t\t\t\t\t\t\t\tto={userCodeInfo.url}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noreferrer\"\n\t\t\t\t\t\t\t\tonClick={() => setClickedVerificationLink(true)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tContinue\n\t\t\t\t\t\t\t</ButtonLink>\n\t\t\t\t\t\t\t{clickedVerificationLink ? (\n\t\t\t\t\t\t\t\t<div className=\"pt-5 opacity-60\">\n\t\t\t\t\t\t\t\t\t<Loading>Waiting for confirmation</Loading>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<loginFetcher.Form method=\"POST\">\n\t\t\t\t\t\t\t<Button varient=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t{loginFetcher.state === 'idle' &&\n\t\t\t\t\t\t\t\tloginFetcher.data?.status !== 'pending'\n\t\t\t\t\t\t\t\t\t? `Retrieve Code`\n\t\t\t\t\t\t\t\t\t: `Retrieving Code...`}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</loginFetcher.Form>\n\t\t\t\t\t)}\n\t\t\t\t\t{authError ? (\n\t\t\t\t\t\t<div className=\"mt-4 text-red-500\">\n\t\t\t\t\t\t\tThere was an error: <pre>{authError}</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n"],"names":["EVENTS","CodeReceivedEventSchema","z","object","type","literal","USER_CODE_RECEIVED","code","string","url","AuthResolvedEventSchema","AUTH_RESOLVED","AuthRejectedEventSchema","AUTH_REJECTED","error","optional","default","EventSchema","union","handle","getSitemapEntries","Login","product","displayName","useWorkshopConfig","loginFetcher","useFetcher","clickedVerificationLink","setClickedVerificationLink","useState","authError","setAuthError","userCodeInfo","setUserCodeInfo","navigate","useNavigate","revalidator","useRevalidator","lastMessage","useEventSource","useEffect","parsed","JSON","parse","result","safeParse","success","console","flatten","data","revalidate","className","children","jsxs","jsx","Logo","ButtonLink","varient","to","target","rel","onClick","Loading","Form","method","Button","state","status"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ window.__remixManifest={"entry":{"module":"/assets/entry.client-3M2p-8I3.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/root-CbC_P7jJ.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/error-boundary-CqgVAFiu.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-B-hHvmeV.js","/assets/index-DlJAkutV.js","/assets/presence-Cr--lRCr.js","/assets/seo-pBpFCWsy.js"],"css":[]},"routes/$":{"id":"routes/$","parentId":"root","path":"*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/_-C82olNpL.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/error-boundary-CqgVAFiu.js"],"css":[]},"routes/_app+/_layout":{"id":"routes/_app+/_layout","parentId":"root","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_layout-DkGEbcMk.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/workshop-config-CL4F08kr.js","/assets/product-f8Gd2MQ6.js","/assets/index-j_VpxCZh.js","/assets/user-DvujSs-t.js","/assets/presence-Cr--lRCr.js","/assets/progress-C7kc6YXZ.js"],"css":[]},"routes/_app+/account":{"id":"routes/_app+/account","parentId":"routes/_app+/_layout","path":"account","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/account-D1DCJCnR.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/button-CQ6cnotS.js","/assets/tooltip-DTFU8ajx.js","/assets/user-DvujSs-t.js","/assets/presence-Cr--lRCr.js"],"css":[]},"routes/_app+/app.$appName+/$":{"id":"routes/_app+/app.$appName+/$","parentId":"routes/_app+/_layout","path":"app/:appName/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/app.$appName+/api.$":{"id":"routes/_app+/app.$appName+/api.$","parentId":"routes/_app+/_layout","path":"app/:appName/api/*","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/api._-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/app.$appName+/epic_ws[.js]":{"id":"routes/_app+/app.$appName+/epic_ws[.js]","parentId":"routes/_app+/_layout","path":"app/:appName/epic_ws.js","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/epic_ws_.js_-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/app.$appName+/index":{"id":"routes/_app+/app.$appName+/index","parentId":"routes/_app+/_layout","path":"app/:appName/","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/index-K6Dvbx-E.js","imports":[],"css":[]},"routes/_app+/app.$appName+/test.$testName":{"id":"routes/_app+/app.$appName+/test.$testName","parentId":"routes/_app+/_layout","path":"app/:appName/test/:testName","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/test._testName-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/app.$appName+/test.epic_ws[.js]":{"id":"routes/_app+/app.$appName+/test.epic_ws[.js]","parentId":"routes/_app+/_layout","path":"app/:appName/test/epic_ws.js","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/test.epic_ws_.js_-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/discord":{"id":"routes/_app+/discord","parentId":"routes/_app+/_layout","path":"discord","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/discord-BBRM_H3g.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/user-DvujSs-t.js","/assets/discord-CgdmSzxV.js"],"css":[]},"routes/_app+/exercise+/_layout":{"id":"routes/_app+/exercise+/_layout","parentId":"routes/_app+/_layout","path":"exercise","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_layout-BUs3av-e.js","imports":["/assets/index-1cKOJFpX.js"],"css":[]},"routes/_app+/exercise+/$exerciseNumber":{"id":"routes/_app+/exercise+/$exerciseNumber","parentId":"routes/_app+/exercise+/_layout","path":":exerciseNumber","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/_exerciseNumber-DeMmiDU5.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-Dx5GmdYq.js","/assets/mdx-DvqHp8UI.js","/assets/progress-C7kc6YXZ.js","/assets/seo-pBpFCWsy.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber","parentId":"routes/_app+/exercise+/_layout","path":":exerciseNumber/:stepNumber","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/_exerciseNumber_._stepNumber-qCtEMlS2.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js"],"css":[]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/_layout":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/_layout","parentId":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber","path":":type","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/_layout-5idP3Bqx.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-j_VpxCZh.js","/assets/index-9dWszLxO.js","/assets/index-Dx5GmdYq.js","/assets/error-boundary-CqgVAFiu.js","/assets/nav-chevrons-Cbc1bd_j.js","/assets/mdx-DvqHp8UI.js","/assets/progress-C7kc6YXZ.js","/assets/set-playground-Cr0qL9N9.js","/assets/seo-pBpFCWsy.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/app":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/app","parentId":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/_layout","path":"app","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/app-C-oFaj2l.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/button-CQ6cnotS.js","/assets/loading-CF7oQHQf.js","/assets/progress-bar-bUuKn1Q8.js","/assets/preview-WJ-QYhx8.js"],"css":[]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/index":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/index","parentId":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/_layout","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/index-CsPok4Mn.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/tooltip-DTFU8ajx.js","/assets/index-j_VpxCZh.js","/assets/index-9dWszLxO.js","/assets/request-info-CEhUGODY.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/accordion-CKwXYK9L.js","/assets/mdx-DvqHp8UI.js","/assets/use-event-source-A_0lEOPX.js","/assets/set-playground-Cr0qL9N9.js","/assets/button-CQ6cnotS.js","/assets/diff-hoOood-9.js","/assets/error-boundary-CqgVAFiu.js","/assets/discord-CgdmSzxV.js","/assets/index-B-hHvmeV.js","/assets/tests-DmimqC1q.js","/assets/preview-WJ-QYhx8.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/test":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/test","parentId":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/_layout","path":"test","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/test-Cy-fo6gv.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/index-j_VpxCZh.js","/assets/index-9dWszLxO.js","/assets/progress-bar-bUuKn1Q8.js","/assets/epic-video-BFcdejfC.js","/assets/accordion-CKwXYK9L.js","/assets/use-event-source-A_0lEOPX.js","/assets/set-playground-Cr0qL9N9.js","/assets/tests-DmimqC1q.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.index":{"id":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber.index","parentId":"routes/_app+/exercise+/$exerciseNumber_.$stepNumber","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_exerciseNumber_._stepNumber.index-l0sNRNKZ.js","imports":[],"css":[]},"routes/_app+/exercise+/$exerciseNumber_.finished":{"id":"routes/_app+/exercise+/$exerciseNumber_.finished","parentId":"routes/_app+/exercise+/_layout","path":":exerciseNumber/finished","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_exerciseNumber_.finished-DM5HZX6r.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-Dx5GmdYq.js","/assets/nav-chevrons-Cbc1bd_j.js","/assets/mdx-DvqHp8UI.js","/assets/progress-C7kc6YXZ.js","/assets/seo-pBpFCWsy.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/finished":{"id":"routes/_app+/finished","parentId":"routes/_app+/_layout","path":"finished","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/finished-C_v7hO19.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-Dx5GmdYq.js","/assets/nav-chevrons-Cbc1bd_j.js","/assets/mdx-DvqHp8UI.js","/assets/seo-pBpFCWsy.js","/assets/progress-C7kc6YXZ.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/index":{"id":"routes/_app+/index","parentId":"routes/_app+/_layout","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":true,"module":"/assets/index-BHeB-0xq.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/index-Dx5GmdYq.js","/assets/error-boundary-CqgVAFiu.js","/assets/mdx-DvqHp8UI.js","/assets/progress-C7kc6YXZ.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/_app+/login":{"id":"routes/_app+/login","parentId":"routes/_app+/_layout","path":"login","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/login-Ca9EDpZj.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/workshop-config-CL4F08kr.js","/assets/use-event-source-A_0lEOPX.js","/assets/button-CQ6cnotS.js","/assets/loading-CF7oQHQf.js","/assets/product-f8Gd2MQ6.js"],"css":[]},"routes/_app+/support":{"id":"routes/_app+/support","parentId":"routes/_app+/_layout","path":"support","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/support-hcqGIpir.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js"],"css":[]},"routes/admin+/_layout":{"id":"routes/admin+/_layout","parentId":"root","path":"admin","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/_layout-DATuycts.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/pe-CUZaIcdt.js","/assets/tooltip-DTFU8ajx.js","/assets/progress-C7kc6YXZ.js"],"css":[]},"routes/admin+/apps":{"id":"routes/admin+/apps","parentId":"routes/admin+/_layout","path":"apps","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/apps-DP2rzg_V.js","imports":[],"css":[]},"routes/admin+/cache":{"id":"routes/admin+/cache","parentId":"routes/admin+/_layout","path":"cache","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/cache-l0sNRNKZ.js","imports":[],"css":[]},"routes/apps":{"id":"routes/apps","parentId":"root","path":"apps","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/apps-l0sNRNKZ.js","imports":[],"css":[]},"routes/diff":{"id":"routes/diff","parentId":"root","path":"diff","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/diff-CU8At1c4.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/tooltip-DTFU8ajx.js","/assets/index-j_VpxCZh.js","/assets/index-9dWszLxO.js","/assets/request-info-CEhUGODY.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/epic-video-BFcdejfC.js","/assets/progress-bar-bUuKn1Q8.js","/assets/accordion-CKwXYK9L.js","/assets/mdx-DvqHp8UI.js","/assets/diff-hoOood-9.js","/assets/nav-chevrons-Cbc1bd_j.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/discord.callback":{"id":"routes/discord.callback","parentId":"root","path":"discord/callback","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/discord.callback-l0sNRNKZ.js","imports":[],"css":[]},"routes/exercises":{"id":"routes/exercises","parentId":"root","path":"exercises","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/exercises-l0sNRNKZ.js","imports":[],"css":[]},"routes/launch-editor":{"id":"routes/launch-editor","parentId":"root","path":"launch-editor","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/launch-editor-l0sNRNKZ.js","imports":[],"css":[]},"routes/login-sse":{"id":"routes/login-sse","parentId":"root","path":"login-sse","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/login-sse-l0sNRNKZ.js","imports":[],"css":[]},"routes/og":{"id":"routes/og","parentId":"root","path":"og","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/og-l0sNRNKZ.js","imports":[],"css":[]},"routes/onboarding":{"id":"routes/onboarding","parentId":"root","path":"onboarding","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/onboarding-Dc2TmI9y.js","imports":["/assets/index-1cKOJFpX.js","/assets/components-CME-nGId.js","/assets/misc-Txs7O6JX.js","/assets/request-info-CEhUGODY.js","/assets/tooltip-DTFU8ajx.js","/assets/pe-CUZaIcdt.js","/assets/index-DlJAkutV.js","/assets/loading-CF7oQHQf.js","/assets/user-DvujSs-t.js","/assets/workshop-config-CL4F08kr.js","/assets/button-CQ6cnotS.js","/assets/epic-video-BFcdejfC.js"],"css":["/assets/epic-video-DUnRvy1A.css"]},"routes/processes":{"id":"routes/processes","parentId":"root","path":"processes","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/processes-l0sNRNKZ.js","imports":[],"css":[]},"routes/progress":{"id":"routes/progress","parentId":"root","path":"progress","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/progress-l0sNRNKZ.js","imports":[],"css":[]},"routes/robots[.]txt":{"id":"routes/robots[.]txt","parentId":"root","path":"robots.txt","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/robots_._txt-l0sNRNKZ.js","imports":[],"css":[]},"routes/set-playground":{"id":"routes/set-playground","parentId":"root","path":"set-playground","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/set-playground-l0sNRNKZ.js","imports":[],"css":[]},"routes/sitemap[.]xml":{"id":"routes/sitemap[.]xml","parentId":"root","path":"sitemap.xml","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/sitemap_._xml-l0sNRNKZ.js","imports":[],"css":[]},"routes/start":{"id":"routes/start","parentId":"root","path":"start","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/start-l0sNRNKZ.js","imports":[],"css":[]},"routes/test":{"id":"routes/test","parentId":"root","path":"test","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/test-l0sNRNKZ.js","imports":[],"css":[]},"routes/theme/index":{"id":"routes/theme/index","parentId":"root","path":"theme","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/index-l0sNRNKZ.js","imports":[],"css":[]},"routes/update-mdx-cache":{"id":"routes/update-mdx-cache","parentId":"root","path":"update-mdx-cache","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/update-mdx-cache-l0sNRNKZ.js","imports":[],"css":[]},"routes/video-player/index":{"id":"routes/video-player/index","parentId":"root","path":"video-player","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasErrorBoundary":false,"module":"/assets/index-DP2rzg_V.js","imports":[],"css":[]}},"url":"/assets/manifest-93b38e47.js","version":"93b38e47"};
@@ -1,2 +1,2 @@
1
- var Qt=Object.defineProperty;var Lt=n=>{throw TypeError(n)};var te=(n,e,i)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var O=(n,e,i)=>te(n,typeof e!="symbol"?e+"":e,i),xt=(n,e,i)=>e.has(n)||Lt("Cannot "+i);var t=(n,e,i)=>(xt(n,e,"read from private field"),i?i.call(n):e.get(n)),m=(n,e,i)=>e.has(n)?Lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(xt(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),u=(n,e,i)=>(xt(n,e,"access private method"),i);var mt=(n,e,i,s)=>({set _(o){f(n,e,o,i)},get _(){return t(n,e,s)}});import{j as g,r as at}from"./index-1cKOJFpX.js";import{c as St,I as ee,a as ie,H as ht,A as se}from"./misc-Txs7O6JX.js";import{e as ne,L as Ht,a as re,r as oe,u as ae}from"./components-CME-nGId.js";import{V as he,D as le}from"./epic-video-CzGRLoYH.js";import{s as ce}from"./progress-bar-bUuKn1Q8.js";import{u as ue}from"./pe-CUZaIcdt.js";import{u as fe}from"./request-info-CEhUGODY.js";function de(){const n=ne("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function Ut(n){const e=re();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function pe({file:n,appFile:e,appName:i,syncTo:s,line:o,column:r,children:a,onUpdate:h}){var _;const c=Ut(h),b=ue(),v=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return g.jsxs(c.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[b,ce,g.jsx("input",{type:"hidden",name:"line",value:o}),g.jsx("input",{type:"hidden",name:"column",value:r}),g.jsx("input",{type:"hidden",name:"type",value:w}),g.jsx("input",{type:"hidden",name:"file",value:n}),g.jsx("input",{type:"hidden",name:"appName",value:i}),v==null?void 0:v.map(j=>g.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?g.jsxs(g.Fragment,{children:[g.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),g.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),g.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),g.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,g.jsx("button",{type:"submit",className:St("launch_button",c.state==="idle"?null:"cursor-progress",((_=c.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:a})]})}function ge({file:n,appFile:e,appName:i,line:s,children:o}){const r=de(),a=fe();if(Array.isArray(e))return g.jsx("div",{children:"Cannot open more than one file"});if(n){const b=v=>v.replace(/\\/g,"/");return g.jsx("a",{className:"launch_button !no-underline",href:b(n).replace(b(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:o})}const h=r.find(b=>b.name===i),c=[...(h==null?void 0:h.relativePath.split(a.separator))??[],e+(s?`#L${s}`:"")].join("/");return g.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${c}`,rel:"noreferrer",target:"_blank",children:o})}function We({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const o=Ut(),r=h=>{if(!h.altKey||ENV.EPICSHOP_DEPLOYED)return;h.preventDefault();const c=new FormData,b=i?"file":"appFile";c.append(b,i??n),c.append("type",b),e&&c.append("appName",e),o.submit(c,{method:"POST",action:"/launch-editor"})},a=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return g.jsxs(Ht,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${a}/${s}/${n}`.replace(/\\/g,"/"),children:[g.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),g.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Vt=ENV.EPICSHOP_DEPLOYED?ge:pe,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bt=new Set,At=typeof process=="object"&&process?process:{},$t=(n,e,i,s)=>{typeof At.emitWarning=="function"?At.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let yt=globalThis.AbortController,It=globalThis.AbortSignal;var Mt;if(typeof yt>"u"){It=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",!1)}addEventListener(s,o){this._onabort.push(o)}},yt=class{constructor(){O(this,"signal",new It);e()}abort(s){var o,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const a of this.signal._onabort)a(s);(r=(o=this.signal).onabort)==null||r.call(o,s)}}};let n=((Mt=At.env)==null?void 0:Mt.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,$t("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const me=n=>!Bt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),qt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?bt:null:null;class bt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){O(this,"heap");O(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=qt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,m(nt,ct,!1);let Ft=nt;var Gt,kt,U,I,V,B,ut,F,$,A,E,p,R,M,P,T,q,D,X,Y,G,K,it,N,l,Ct,rt,Z,pt,k,Xt,ot,ft,gt,tt,et,Tt,wt,_t,S,Dt,dt;const Rt=class Rt{constructor(e){m(this,l);m(this,U);m(this,I);m(this,V);m(this,B);m(this,ut);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");m(this,F);m(this,$);m(this,A);m(this,E);m(this,p);m(this,R);m(this,M);m(this,P);m(this,T);m(this,q);m(this,D);m(this,X);m(this,Y);m(this,G);m(this,K);m(this,it);m(this,N);m(this,rt,()=>{});m(this,Z,()=>{});m(this,pt,()=>{});m(this,k,()=>!1);m(this,ot,e=>{});m(this,ft,(e,i,s)=>{});m(this,gt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,Gt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:b,disposeAfter:v,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,noDeleteOnFetchRejection:d,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:z,ignoreFetchAbort:H}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const st=i?qt(i):Array;if(!st)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,I,_),this.maxEntrySize=j||t(this,I),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,I)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,it,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new st(i)),f(this,M,new st(i)),f(this,P,0),f(this,T,0),f(this,q,Ft.create(i)),f(this,F,0),f(this,$,0),typeof b=="function"&&f(this,V,b),typeof v=="function"?(f(this,B,v),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!d,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,I)!==0&&!Q(t(this,I)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");u(this,l,Xt).call(this)}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=Q(o)||o===0?o:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");u(this,l,Ct).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,I)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,I)){const J="LRU_CACHE_UNBOUNDED";me(J)&&(Bt.add(J),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Rt))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return u(s=e,l,S).call(s,i)},backgroundFetch:(i,s,o,r)=>{var a;return u(a=e,l,_t).call(a,i,s,o,r)},moveToTail:i=>{var s;return u(s=e,l,dt).call(s,i)},indexes:i=>{var s;return u(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return u(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,k).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,I)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of u(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of u(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(kt=Symbol.iterator,Gt=Symbol.toStringTag,kt)](){return this.entries()}find(e,i={}){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of u(this,l,et).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of u(this,l,et).call(this,{allowStale:!0}))t(this,k).call(this,i)&&(this.delete(t(this,E)[i]),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],o=u(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;const r={value:o};if(t(this,G)&&t(this,Y)){const a=t(this,G)[i],h=t(this,Y)[i];if(a&&h){const c=a-(lt.now()-h);r.ttl=c,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of u(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],o=t(this,p)[i],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0||s===void 0)continue;const a={value:r};if(t(this,G)&&t(this,Y)){a.ttl=t(this,G)[i];const h=lt.now()-t(this,Y)[i];a.start=Math.floor(Date.now()-h)}t(this,X)&&(a.size=t(this,X)[i]),e.unshift([s,a])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const o=Date.now()-s.start;s.start=lt.now()-o}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const v=t(this,gt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&v>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?u(this,l,wt).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,M)[w]=t(this,T),f(this,T,w),mt(this,F)._++,t(this,ft).call(this,w,v,c),c&&(c.set="add"),b=!1;else{u(this,l,dt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,it)&&u(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!a&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else a||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,ft).call(this,w,v,c),t(this,p)[w]=i,c){c.set="replace";const y=d&&u(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(o!==0&&!t(this,G)&&u(this,l,Ct).call(this),t(this,G)&&(b||t(this,pt).call(this,w,o,r),c&&t(this,Z).call(this,c,w)),!a&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(u(this,l,wt).call(this,!0),u(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,r=t(this,A).get(e);if(r!==void 0){const a=t(this,p)[r];if(u(this,l,S).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(t(this,k).call(this,r))o&&(o.has="stale",t(this,Z).call(this,o,r));else return s&&t(this,rt).call(this,r),o&&(o.has="hit",t(this,Z).call(this,o,r)),!0}else o&&(o.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,k).call(this,o))return;const r=t(this,p)[o];return u(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,it))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:b,noUpdateTTL:v,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const H=u(this,l,_t).call(this,e,z,W,x);return H.__returned=H}else{const H=t(this,p)[z];if(u(this,l,S).call(this,H)){const Wt=s&&H.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Wt&&(d.returnedStale=!0)),Wt?H.__staleWhileFetching:H.__returned=H}const st=t(this,k).call(this,z);if(!C&&!st)return d&&(d.fetch="hit"),u(this,l,dt).call(this,z),o&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),H;const J=u(this,l,_t).call(this,e,z,W,x),Nt=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=st?"stale":"refresh",Nt&&st&&(d.returnedStale=!0)),Nt?J.__staleWhileFetching:J.__returned=J}}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,h=t(this,A).get(e);if(h!==void 0){const c=t(this,p)[h],b=u(this,l,S).call(this,c);return a&&t(this,Z).call(this,a,h),t(this,k).call(this,h)?(a&&(a.get="stale"),b?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?c.__staleWhileFetching:void 0):(r||this.delete(e),a&&s&&(a.returnedStale=!0),s?c:void 0)):(a&&(a.get="hit"),b?c.__staleWhileFetching:(u(this,l,dt).call(this,h),o&&t(this,rt).call(this,h),c))}else a&&(a.get="miss")}delete(e){var s,o,r,a;let i=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(i=!0,t(this,F)===1)this.clear();else{t(this,ot).call(this,h);const c=t(this,p)[h];if(u(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((s=t(this,V))==null||s.call(this,c,e,"delete")),t(this,N)&&((o=t(this,D))==null||o.push([c,e,"delete"]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,M)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const b=t(this,M)[h];t(this,R)[b]=t(this,R)[h];const v=t(this,R)[h];t(this,M)[v]=t(this,M)[h]}mt(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((r=t(this,D))!=null&&r.length)){const h=t(this,D);let c;for(;c=h==null?void 0:h.shift();)(a=t(this,B))==null||a.call(this,...c)}return i}clear(){var e,i,s;for(const o of u(this,l,et).call(this,{allowStale:!0})){const r=t(this,p)[o];if(u(this,l,S).call(this,r))r.__abortController.abort(new Error("deleted"));else{const a=t(this,E)[o];t(this,K)&&((e=t(this,V))==null||e.call(this,r,a,"delete")),t(this,N)&&((i=t(this,D))==null||i.push([r,a,"delete"]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const o=t(this,D);let r;for(;r=o==null?void 0:o.shift();)(s=t(this,B))==null||s.call(this,...r)}}};U=new WeakMap,I=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,it=new WeakMap,N=new WeakMap,l=new WeakSet,Ct=function(){const e=new bt(t(this,U)),i=new bt(t(this,U));f(this,G,e),f(this,Y,i),f(this,pt,(r,a,h=lt.now())=>{if(i[r]=a!==0?h:0,e[r]=a,a!==0&&this.ttlAutopurge){const c=setTimeout(()=>{t(this,k).call(this,r)&&this.delete(t(this,E)[r])},a+1);c.unref&&c.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,a)=>{if(e[a]){const h=e[a],c=i[a];if(!h||!c)return;r.ttl=h,r.start=c,r.now=s||o();const b=r.now-c;r.remainingTTL=h-b}});let s=0;const o=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return r};this.getRemainingTTL=r=>{const a=t(this,A).get(r);if(a===void 0)return 0;const h=e[a],c=i[a];if(!h||!c)return 1/0;const b=(s||o())-c;return h-b},f(this,k,r=>{const a=i[r],h=e[r];return!!h&&!!a&&(s||o())-a>h})},rt=new WeakMap,Z=new WeakMap,pt=new WeakMap,k=new WeakMap,Xt=function(){const e=new bt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,gt,(i,s,o,r)=>{if(u(this,l,S).call(this,s))return 0;if(!Q(o))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(o=r(s,i),!Q(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),f(this,ft,(i,s,o)=>{if(e[i]=s,t(this,I)){const r=t(this,I)-e[i];for(;t(this,$)>r;)u(this,l,wt).call(this,!0)}f(this,$,t(this,$)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,$))})},ot=new WeakMap,ft=new WeakMap,gt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,M)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Tt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},wt=function(e){var r,a;const i=t(this,P),s=t(this,E)[i],o=t(this,p)[i];return t(this,it)&&u(this,l,S).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,o,s,"evict")),t(this,N)&&((a=t(this,D))==null||a.push([o,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),mt(this,F)._--,i},_t=function(e,i,s,o){const r=i===void 0?void 0:t(this,p)[i];if(u(this,l,S).call(this,r))return r;const a=new yt,{signal:h}=s;h==null||h.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});const c={signal:a.signal,options:s,context:o},b=(x,C=!1)=>{const{aborted:d}=a.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(a.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,c.options))),x},v=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=a.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?this.delete(e):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,c);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>b(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(b,v),j=Object.assign(_,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,it))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof yt},Dt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i},dt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):u(this,l,Dt).call(this,t(this,M)[e],t(this,R)[e]),u(this,l,Dt).call(this,t(this,T),e),f(this,T,e))};let jt=Rt;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.getMDXComponent=ye;Et.getMDXExport=Kt;var be=Pt(at),we=Pt(g),_e=Pt(oe);function Yt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Yt=function(s){return s?i:e})(n)}function Pt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Yt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var a=o?Object.getOwnPropertyDescriptor(n,r):null;a&&(a.get||a.set)?Object.defineProperty(s,r,a):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function ye(n,e){return Kt(n,e).default}function Kt(n,e){const i={React:be,ReactDOM:_e,_jsx_runtime:we,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var Se=Et;const Ot=n=>n.replace(/\\/g,"/");function Zt(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const zt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Ee({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":o,"data-type":r}){var L;const a=ae();if(r==="other"||!n||!e||!i)return null;const h=Ot(((L=a[a.type])==null?void 0:L.fullPath)??""),c=!i.startsWith(h),b=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],v=n.split(","),w=b.filter(_=>v.includes(_));return g.jsx(g.Fragment,{children:w.map(_=>{var d;const j=a[_];if(_==="playground"){const y=a.playground&&a.playground.appName!==((d=a.problem)==null?void 0:d.name);if(!j||y||c)return g.jsxs("button",{className:St(zt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":c?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[Ot(j.fullPath),Ot(e)].join(s),C=Zt(x,s,_);return g.jsx(Vt,{file:x,line:Number(o??1),children:g.jsxs("span",{title:C,className:zt,children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function xe(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),g.jsx("button",{className:ie(zt,"w-12 uppercase"),onClick:i=>{var r,a,h;e(!0);const o=((h=(a=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:a.querySelector("pre"))==null?void 0:h.textContent)||"";navigator.clipboard.writeText(o)},children:n?"copied":"copy"})}function Oe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":o,"data-nocopy":r,"data-sep":a}=e,h=r===void 0;function c(){if(o&&a)return!s||s.includes("..")?{"data-filename":Zt(o,a)}:{"data-filename":s.replace(/\//g,a)}}return g.jsxs("div",{className:"group relative",children:[g.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?g.jsx(Ee,{...e}):null,h?g.jsx(xe,{}):null]}),g.jsx("pre",{...e,className:St("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...c(),children:n})]})}const ve={h1:n=>g.jsx(ht,{...n,as:"h1"}),h2:n=>g.jsx(ht,{...n,as:"h2"}),h3:n=>g.jsx(ht,{...n,as:"h3"}),h4:n=>g.jsx(ht,{...n,as:"h4"}),h5:n=>g.jsx(ht,{...n,as:"h5"}),h6:n=>g.jsx(ht,{...n,as:"h6"}),a:se,p:n=>g.jsx("div",{...n}),pre:n=>g.jsx("pre",{...n,className:St("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Vt,VideoEmbed:he,EpicVideo:le};function Ae(n){const e=Se.getMDXComponent(n);function i({components:s,...o}){const r=at.useMemo(()=>({...ve,...s}),[s]);return g.jsx(e,{components:r,...o})}return i}const vt=new jt({max:1e3});function Fe(n){return at.useMemo(()=>{if(vt.has(n))return vt.get(n);const e=Ae(n);return vt.set(n,e),e},[n])}function Me({code:n,components:e}){const i=Fe(n),s=at.useMemo(()=>({Icon:ee,pre:Oe,Link:Ht,...e}),[e]);return g.jsx(i,{components:s})}export{We as E,Vt as L,Me as M};
2
- //# sourceMappingURL=mdx-CGcvotZI.js.map
1
+ var Qt=Object.defineProperty;var Lt=n=>{throw TypeError(n)};var te=(n,e,i)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var O=(n,e,i)=>te(n,typeof e!="symbol"?e+"":e,i),xt=(n,e,i)=>e.has(n)||Lt("Cannot "+i);var t=(n,e,i)=>(xt(n,e,"read from private field"),i?i.call(n):e.get(n)),m=(n,e,i)=>e.has(n)?Lt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(xt(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),u=(n,e,i)=>(xt(n,e,"access private method"),i);var mt=(n,e,i,s)=>({set _(o){f(n,e,o,i)},get _(){return t(n,e,s)}});import{j as g,r as at}from"./index-1cKOJFpX.js";import{c as St,I as ee,a as ie,H as ht,A as se}from"./misc-Txs7O6JX.js";import{e as ne,L as Ht,a as re,r as oe,u as ae}from"./components-CME-nGId.js";import{V as he,D as le}from"./epic-video-BFcdejfC.js";import{s as ce}from"./progress-bar-bUuKn1Q8.js";import{u as ue}from"./pe-CUZaIcdt.js";import{u as fe}from"./request-info-CEhUGODY.js";function de(){const n=ne("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function Ut(n){const e=re();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function pe({file:n,appFile:e,appName:i,syncTo:s,line:o,column:r,children:a,onUpdate:h}){var _;const c=Ut(h),b=ue(),v=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return g.jsxs(c.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[b,ce,g.jsx("input",{type:"hidden",name:"line",value:o}),g.jsx("input",{type:"hidden",name:"column",value:r}),g.jsx("input",{type:"hidden",name:"type",value:w}),g.jsx("input",{type:"hidden",name:"file",value:n}),g.jsx("input",{type:"hidden",name:"appName",value:i}),v==null?void 0:v.map(j=>g.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?g.jsxs(g.Fragment,{children:[g.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),g.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),g.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),g.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,g.jsx("button",{type:"submit",className:St("launch_button",c.state==="idle"?null:"cursor-progress",((_=c.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:a})]})}function ge({file:n,appFile:e,appName:i,line:s,children:o}){const r=de(),a=fe();if(Array.isArray(e))return g.jsx("div",{children:"Cannot open more than one file"});if(n){const b=v=>v.replace(/\\/g,"/");return g.jsx("a",{className:"launch_button !no-underline",href:b(n).replace(b(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:o})}const h=r.find(b=>b.name===i),c=[...(h==null?void 0:h.relativePath.split(a.separator))??[],e+(s?`#L${s}`:"")].join("/");return g.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${c}`,rel:"noreferrer",target:"_blank",children:o})}function We({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const o=Ut(),r=h=>{if(!h.altKey||ENV.EPICSHOP_DEPLOYED)return;h.preventDefault();const c=new FormData,b=i?"file":"appFile";c.append(b,i??n),c.append("type",b),e&&c.append("appName",e),o.submit(c,{method:"POST",action:"/launch-editor"})},a=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return g.jsxs(Ht,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${a}/${s}/${n}`.replace(/\\/g,"/"),children:[g.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),g.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Vt=ENV.EPICSHOP_DEPLOYED?ge:pe,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bt=new Set,At=typeof process=="object"&&process?process:{},$t=(n,e,i,s)=>{typeof At.emitWarning=="function"?At.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let yt=globalThis.AbortController,It=globalThis.AbortSignal;var Mt;if(typeof yt>"u"){It=class{constructor(){O(this,"onabort");O(this,"_onabort",[]);O(this,"reason");O(this,"aborted",!1)}addEventListener(s,o){this._onabort.push(o)}},yt=class{constructor(){O(this,"signal",new It);e()}abort(s){var o,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const a of this.signal._onabort)a(s);(r=(o=this.signal).onabort)==null||r.call(o,s)}}};let n=((Mt=At.env)==null?void 0:Mt.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,$t("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const me=n=>!Bt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),qt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?bt:null:null;class bt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){O(this,"heap");O(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=qt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,m(nt,ct,!1);let Ft=nt;var Gt,kt,U,I,V,B,ut,F,$,A,E,p,R,M,P,T,q,D,X,Y,G,K,it,N,l,Ct,rt,Z,pt,k,Xt,ot,ft,gt,tt,et,Tt,wt,_t,S,Dt,dt;const Rt=class Rt{constructor(e){m(this,l);m(this,U);m(this,I);m(this,V);m(this,B);m(this,ut);O(this,"ttl");O(this,"ttlResolution");O(this,"ttlAutopurge");O(this,"updateAgeOnGet");O(this,"updateAgeOnHas");O(this,"allowStale");O(this,"noDisposeOnSet");O(this,"noUpdateTTL");O(this,"maxEntrySize");O(this,"sizeCalculation");O(this,"noDeleteOnFetchRejection");O(this,"noDeleteOnStaleGet");O(this,"allowStaleOnFetchAbort");O(this,"allowStaleOnFetchRejection");O(this,"ignoreFetchAbort");m(this,F);m(this,$);m(this,A);m(this,E);m(this,p);m(this,R);m(this,M);m(this,P);m(this,T);m(this,q);m(this,D);m(this,X);m(this,Y);m(this,G);m(this,K);m(this,it);m(this,N);m(this,rt,()=>{});m(this,Z,()=>{});m(this,pt,()=>{});m(this,k,()=>!1);m(this,ot,e=>{});m(this,ft,(e,i,s)=>{});m(this,gt,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});O(this,Gt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:c,dispose:b,disposeAfter:v,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,noDeleteOnFetchRejection:d,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:z,ignoreFetchAbort:H}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const st=i?qt(i):Array;if(!st)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,I,_),this.maxEntrySize=j||t(this,I),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,I)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,it,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new st(i)),f(this,M,new st(i)),f(this,P,0),f(this,T,0),f(this,q,Ft.create(i)),f(this,F,0),f(this,$,0),typeof b=="function"&&f(this,V,b),typeof v=="function"?(f(this,B,v),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!d,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,I)!==0&&!Q(t(this,I)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");u(this,l,Xt).call(this)}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!h,this.ttlResolution=Q(o)||o===0?o:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");u(this,l,Ct).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,I)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,I)){const J="LRU_CACHE_UNBOUNDED";me(J)&&(Bt.add(J),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,Rt))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,M),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return u(s=e,l,S).call(s,i)},backgroundFetch:(i,s,o,r)=>{var a;return u(a=e,l,_t).call(a,i,s,o,r)},moveToTail:i=>{var s;return u(s=e,l,dt).call(s,i)},indexes:i=>{var s;return u(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return u(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,k).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,I)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of u(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of u(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of u(this,l,tt).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of u(this,l,et).call(this))t(this,p)[e]!==void 0&&!u(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(kt=Symbol.iterator,Gt=Symbol.toStringTag,kt)](){return this.entries()}find(e,i={}){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of u(this,l,tt).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of u(this,l,et).call(this)){const o=t(this,p)[s],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of u(this,l,et).call(this,{allowStale:!0}))t(this,k).call(this,i)&&(this.delete(t(this,E)[i]),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],o=u(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;const r={value:o};if(t(this,G)&&t(this,Y)){const a=t(this,G)[i],h=t(this,Y)[i];if(a&&h){const c=a-(lt.now()-h);r.ttl=c,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of u(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],o=t(this,p)[i],r=u(this,l,S).call(this,o)?o.__staleWhileFetching:o;if(r===void 0||s===void 0)continue;const a={value:r};if(t(this,G)&&t(this,Y)){a.ttl=t(this,G)[i];const h=lt.now()-t(this,Y)[i];a.start=Math.floor(Date.now()-h)}t(this,X)&&(a.size=t(this,X)[i]),e.unshift([s,a])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const o=Date.now()-s.start;s.start=lt.now()-o}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:c}=s;let{noUpdateTTL:b=this.noUpdateTTL}=s;const v=t(this,gt).call(this,e,i,s.size||0,h);if(this.maxEntrySize&&v>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?u(this,l,wt).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,M)[w]=t(this,T),f(this,T,w),mt(this,F)._++,t(this,ft).call(this,w,v,c),c&&(c.set="add"),b=!1;else{u(this,l,dt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,it)&&u(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!a&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else a||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,ft).call(this,w,v,c),t(this,p)[w]=i,c){c.set="replace";const y=d&&u(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(c.oldValue=y)}}else c&&(c.set="update")}if(o!==0&&!t(this,G)&&u(this,l,Ct).call(this),t(this,G)&&(b||t(this,pt).call(this,w,o,r),c&&t(this,Z).call(this,c,w)),!a&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(u(this,l,wt).call(this,!0),u(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,r=t(this,A).get(e);if(r!==void 0){const a=t(this,p)[r];if(u(this,l,S).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(t(this,k).call(this,r))o&&(o.has="stale",t(this,Z).call(this,o,r));else return s&&t(this,rt).call(this,r),o&&(o.has="hit",t(this,Z).call(this,o,r)),!0}else o&&(o.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,o=t(this,A).get(e);if(o===void 0||!s&&t(this,k).call(this,o))return;const r=t(this,p)[o];return u(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:c=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,it))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:h,size:c,sizeCalculation:b,noUpdateTTL:v,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const H=u(this,l,_t).call(this,e,z,W,x);return H.__returned=H}else{const H=t(this,p)[z];if(u(this,l,S).call(this,H)){const Wt=s&&H.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Wt&&(d.returnedStale=!0)),Wt?H.__staleWhileFetching:H.__returned=H}const st=t(this,k).call(this,z);if(!C&&!st)return d&&(d.fetch="hit"),u(this,l,dt).call(this,z),o&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),H;const J=u(this,l,_t).call(this,e,z,W,x),Nt=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=st?"stale":"refresh",Nt&&st&&(d.returnedStale=!0)),Nt?J.__staleWhileFetching:J.__returned=J}}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=i,h=t(this,A).get(e);if(h!==void 0){const c=t(this,p)[h],b=u(this,l,S).call(this,c);return a&&t(this,Z).call(this,a,h),t(this,k).call(this,h)?(a&&(a.get="stale"),b?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?c.__staleWhileFetching:void 0):(r||this.delete(e),a&&s&&(a.returnedStale=!0),s?c:void 0)):(a&&(a.get="hit"),b?c.__staleWhileFetching:(u(this,l,dt).call(this,h),o&&t(this,rt).call(this,h),c))}else a&&(a.get="miss")}delete(e){var s,o,r,a;let i=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(i=!0,t(this,F)===1)this.clear();else{t(this,ot).call(this,h);const c=t(this,p)[h];if(u(this,l,S).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((s=t(this,V))==null||s.call(this,c,e,"delete")),t(this,N)&&((o=t(this,D))==null||o.push([c,e,"delete"]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,M)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const b=t(this,M)[h];t(this,R)[b]=t(this,R)[h];const v=t(this,R)[h];t(this,M)[v]=t(this,M)[h]}mt(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((r=t(this,D))!=null&&r.length)){const h=t(this,D);let c;for(;c=h==null?void 0:h.shift();)(a=t(this,B))==null||a.call(this,...c)}return i}clear(){var e,i,s;for(const o of u(this,l,et).call(this,{allowStale:!0})){const r=t(this,p)[o];if(u(this,l,S).call(this,r))r.__abortController.abort(new Error("deleted"));else{const a=t(this,E)[o];t(this,K)&&((e=t(this,V))==null||e.call(this,r,a,"delete")),t(this,N)&&((i=t(this,D))==null||i.push([r,a,"delete"]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const o=t(this,D);let r;for(;r=o==null?void 0:o.shift();)(s=t(this,B))==null||s.call(this,...r)}}};U=new WeakMap,I=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,M=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,it=new WeakMap,N=new WeakMap,l=new WeakSet,Ct=function(){const e=new bt(t(this,U)),i=new bt(t(this,U));f(this,G,e),f(this,Y,i),f(this,pt,(r,a,h=lt.now())=>{if(i[r]=a!==0?h:0,e[r]=a,a!==0&&this.ttlAutopurge){const c=setTimeout(()=>{t(this,k).call(this,r)&&this.delete(t(this,E)[r])},a+1);c.unref&&c.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,a)=>{if(e[a]){const h=e[a],c=i[a];if(!h||!c)return;r.ttl=h,r.start=c,r.now=s||o();const b=r.now-c;r.remainingTTL=h-b}});let s=0;const o=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return r};this.getRemainingTTL=r=>{const a=t(this,A).get(r);if(a===void 0)return 0;const h=e[a],c=i[a];if(!h||!c)return 1/0;const b=(s||o())-c;return h-b},f(this,k,r=>{const a=i[r],h=e[r];return!!h&&!!a&&(s||o())-a>h})},rt=new WeakMap,Z=new WeakMap,pt=new WeakMap,k=new WeakMap,Xt=function(){const e=new bt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,gt,(i,s,o,r)=>{if(u(this,l,S).call(this,s))return 0;if(!Q(o))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(o=r(s,i),!Q(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),f(this,ft,(i,s,o)=>{if(e[i]=s,t(this,I)){const r=t(this,I)-e[i];for(;t(this,$)>r;)u(this,l,wt).call(this,!0)}f(this,$,t(this,$)+e[i]),o&&(o.entrySize=s,o.totalCalculatedSize=t(this,$))})},ot=new WeakMap,ft=new WeakMap,gt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,M)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!u(this,l,Tt).call(this,i)||((e||!t(this,k).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Tt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},wt=function(e){var r,a;const i=t(this,P),s=t(this,E)[i],o=t(this,p)[i];return t(this,it)&&u(this,l,S).call(this,o)?o.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,o,s,"evict")),t(this,N)&&((a=t(this,D))==null||a.push([o,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),mt(this,F)._--,i},_t=function(e,i,s,o){const r=i===void 0?void 0:t(this,p)[i];if(u(this,l,S).call(this,r))return r;const a=new yt,{signal:h}=s;h==null||h.addEventListener("abort",()=>a.abort(h.reason),{signal:a.signal});const c={signal:a.signal,options:s,context:o},b=(x,C=!1)=>{const{aborted:d}=a.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(a.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,c.options))),x},v=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=a.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?this.delete(e):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,c);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>b(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(b,v),j=Object.assign(_,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,it))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof yt},Dt=function(e,i){t(this,M)[i]=e,t(this,R)[e]=i},dt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):u(this,l,Dt).call(this,t(this,M)[e],t(this,R)[e]),u(this,l,Dt).call(this,t(this,T),e),f(this,T,e))};let jt=Rt;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.getMDXComponent=ye;Et.getMDXExport=Kt;var be=Pt(at),we=Pt(g),_e=Pt(oe);function Yt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Yt=function(s){return s?i:e})(n)}function Pt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Yt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var a=o?Object.getOwnPropertyDescriptor(n,r):null;a&&(a.get||a.set)?Object.defineProperty(s,r,a):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function ye(n,e){return Kt(n,e).default}function Kt(n,e){const i={React:be,ReactDOM:_e,_jsx_runtime:we,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var Se=Et;const Ot=n=>n.replace(/\\/g,"/");function Zt(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const zt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Ee({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":o,"data-type":r}){var L;const a=ae();if(r==="other"||!n||!e||!i)return null;const h=Ot(((L=a[a.type])==null?void 0:L.fullPath)??""),c=!i.startsWith(h),b=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],v=n.split(","),w=b.filter(_=>v.includes(_));return g.jsx(g.Fragment,{children:w.map(_=>{var d;const j=a[_];if(_==="playground"){const y=a.playground&&a.playground.appName!==((d=a.problem)==null?void 0:d.name);if(!j||y||c)return g.jsxs("button",{className:St(zt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":c?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[Ot(j.fullPath),Ot(e)].join(s),C=Zt(x,s,_);return g.jsx(Vt,{file:x,line:Number(o??1),children:g.jsxs("span",{title:C,className:zt,children:[g.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function xe(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),g.jsx("button",{className:ie(zt,"w-12 uppercase"),onClick:i=>{var r,a,h;e(!0);const o=((h=(a=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:a.querySelector("pre"))==null?void 0:h.textContent)||"";navigator.clipboard.writeText(o)},children:n?"copied":"copy"})}function Oe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":o,"data-nocopy":r,"data-sep":a}=e,h=r===void 0;function c(){if(o&&a)return!s||s.includes("..")?{"data-filename":Zt(o,a)}:{"data-filename":s.replace(/\//g,a)}}return g.jsxs("div",{className:"group relative",children:[g.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?g.jsx(Ee,{...e}):null,h?g.jsx(xe,{}):null]}),g.jsx("pre",{...e,className:St("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...c(),children:n})]})}const ve={h1:n=>g.jsx(ht,{...n,as:"h1"}),h2:n=>g.jsx(ht,{...n,as:"h2"}),h3:n=>g.jsx(ht,{...n,as:"h3"}),h4:n=>g.jsx(ht,{...n,as:"h4"}),h5:n=>g.jsx(ht,{...n,as:"h5"}),h6:n=>g.jsx(ht,{...n,as:"h6"}),a:se,p:n=>g.jsx("div",{...n}),pre:n=>g.jsx("pre",{...n,className:St("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Vt,VideoEmbed:he,EpicVideo:le};function Ae(n){const e=Se.getMDXComponent(n);function i({components:s,...o}){const r=at.useMemo(()=>({...ve,...s}),[s]);return g.jsx(e,{components:r,...o})}return i}const vt=new jt({max:1e3});function Fe(n){return at.useMemo(()=>{if(vt.has(n))return vt.get(n);const e=Ae(n);return vt.set(n,e),e},[n])}function Me({code:n,components:e}){const i=Fe(n),s=at.useMemo(()=>({Icon:ee,pre:Oe,Link:Ht,...e}),[e]);return g.jsx(i,{components:s})}export{We as E,Vt as L,Me as M};
2
+ //# sourceMappingURL=mdx-DvqHp8UI.js.map