import{w as b,a as j,c as E,d as T,e as A}from"./chunk-JZWAC4HX-5kJHQiQ9.js";import{j as r}from"./jsx-runtime-C4_65a1U.js";import{g as N,R as C,P as I,C as n,a as H,D as R}from"./playground-C4QIhIKO.js";import{U as S}from"./diff-PcNZndED.js";import{G as U}from"./error-boundary-BC83xzIm.js";import{u as B}from"./workshop-config-BVRT-ayZ.js";import{u as _}from"./misc-DRDyxdMg.js";import{P as m}from"./preview-BAlV6VKj.js";import{T as O}from"./tests-C90TUU9M.js";import"./index-B9zr-vzA.js";import"./loading-DDR0n-s7.js";import"./index-BYdxj4vr.js";import"./tooltip-mkBMB3mq.js";import"./index-BzPxupzT.js";import"./root-loader-Cnwtpb_k.js";import"./pe-P58jSSsB.js";import"./schemas-RF4TJjJw.js";import"./discord-ZYoLupbQ.js";import"./user-Pnhys2oT.js";import"./online-CrGTaAx4.js";import"./index-CldIuqPt.js";import"./index-CysPQE2L.js";import"./status-indicator-C9XU9QIy.js";import"./index-nErvdZSM.js";import"./set-playground-MpIvTYrh.js";import"./button-hlYIgazA.js";import"./onboarding-indicator-M7ZykuXy.js";import"./progress-bar-BwLqNk15.js";import"./dialog-SjeUEqVR.js";import"./playground-window-Dh2I6AWX.js";import"./accordion-jQibABc-.js";import"./mdx-CNkHFdBV.js";import"./epic-video-BZ1AWKL2.js";import"./use-event-source-Dip1vrZy.js";import"./format-CKpZi3Um.js";import"./preload-helper-DqNgO5-4.js";import"./launch-editor-CwyOLU4S.js";import"./revalidation-ws-bT9ZdRVV.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};i.SENTRY_RELEASE={id:"8a6db0ac5fe78363b0c97fe458a96ce773bf357c"};var e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="580fe49c-dac0-4e51-b2f7-b198127ab260",i._sentryDebugIdIdentifier="sentry-dbid-580fe49c-dac0-4e51-b2f7-b198127ab260")}catch{}})();const p=["playground","problem","solution","tests","diff","chat"],k=i=>!!(i&&p.includes(i)),bs=b(function({loaderData:e}){const{inBrowserBrowserRef:l}=E(),d=B(),[f]=T(),u=f.get("preview"),h=_(),y=A();function a(s){if(s==="tests")return ENV.EPICSHOP_DEPLOYED||!e.playground||e.playground.test.type==="none";if(s==="problem"||s==="solution"){if(e[s]?.dev.type==="none")return!0;if(ENV.EPICSHOP_DEPLOYED){const t=e[s]?.dev.type;return t!=="browser"&&t!=="export"&&!e[s]?.stackBlitzUrl}}return s==="playground"&&ENV.EPICSHOP_DEPLOYED?!0:s==="chat"?!d.product.discordChannelId:!1}function x(s){if(s==="tests"){if(!e.playground)return null;const{isTestRunning:t,testExitCode:o}=e.playground;return t?"running":o===0?"passed":o!==null&&o!==0?"failed":null}return(s==="problem"||s==="solution"||s==="playground")&&(s==="playground"?e.playground:e[s])?.isRunning?"running":null}const g=k(u)?u:p.find(s=>!a(s)),c=`/diff?${new URLSearchParams({app1:e.problem?.name??"",app2:e.solution?.name??""})}`;function w(s){s.altKey&&!s.ctrlKey&&!s.shiftKey&&!s.metaKey&&(s.preventDefault(),y(c))}const v=p.map(s=>{const t=a(s),o=x(s),P=s==="diff"&&h?c:`?${N(f,s,"playground")}`;return{id:s,label:s,hidden:t,status:o,to:P,onClick:s==="diff"?w:void 0}});return r.jsxs(C,{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden sm:col-span-1 sm:row-span-1",value:g,children:[r.jsx(I,{tabs:v}),r.jsxs("div",{className:"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden",children:[r.jsx(n,{value:"playground",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:r.jsx(H,{appInfo:e.playground,problemAppName:e.problem?.name,inBrowserBrowserRef:l,allApps:e.allApps,isUpToDate:e.playground?.isUpToDate??!1})}),r.jsx(n,{value:"problem",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:r.jsx(m,{appInfo:e.problem,inBrowserBrowserRef:l})}),r.jsx(n,{value:"solution",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:r.jsx(m,{appInfo:e.solution,inBrowserBrowserRef:l})}),r.jsx(n,{value:"tests",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start overflow-hidden",children:r.jsx(O,{appInfo:e.playground,problemAppName:e.problem?.name,allApps:e.allApps,isUpToDate:e.playground?.isUpToDate??!1,userHasAccessPromise:e.userHasAccessPromise})}),r.jsx(n,{value:"diff",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:r.jsx(S,{diff:e.diff,allApps:e.allApps,userHasAccessPromise:e.userHasAccessPromise})}),r.jsx(n,{value:"chat",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:r.jsx(R,{discordPostsPromise:e.discordPostsPromise})})]})]})}),js=j(function(){return r.jsx(U,{statusHandlers:{404:()=>r.jsx("p",{children:"Sorry, we couldn't find an app here."})}})});export{js as ErrorBoundary,bs as default};
//# sourceMappingURL=index-CurEoIn-.js.map
