import{w as j,a as b,c as E,d as T,e as A}from"./chunk-EVOBXE3Y-Bmgys8-c.js";import{j as r}from"./jsx-runtime-hUI6LOBV.js";import{g as N,R as C,P as I,C as n,a as H,D as R}from"./playground-DmBtp9Rr.js";import{U as S}from"./diff-Cxjt3lxZ.js";import{G as U}from"./error-boundary-C8cCfAXR.js";import{u as B}from"./workshop-config-BNvMPSev.js";import{u as _}from"./misc-BNcbB3dR.js";import{P as m}from"./preview-DsrzZJ3M.js";import{T as O}from"./tests-G4o5iHU_.js";import"./index-CFdT0RIo.js";import"./loading-Cf-_cX4u.js";import"./index-BiGqsMpe.js";import"./tooltip-CoTdGGXz.js";import"./index-ZNADqOyW.js";import"./root-loader-ByAKsmmv.js";import"./pe-BRA_K7Pt.js";import"./schemas-Bn3zadsT.js";import"./discord-D1A57oEc.js";import"./user-BrD2IM_u.js";import"./online-BM9kpW1W.js";import"./index-DDpCzuT4.js";import"./index-SfOF7hjq.js";import"./status-indicator-DQNahQlq.js";import"./index-Bh67Vwl7.js";import"./set-playground-DyT4jldX.js";import"./button-BYp3RcB5.js";import"./onboarding-indicator-CS7d1RLw.js";import"./progress-bar-8MSIg-hJ.js";import"./dialog-7CAwytT4.js";import"./playground-window-53zTrrRT.js";import"./react-error-boundary-DgOlQwwM.js";import"./preload-helper-DLdknYSj.js";import"./launch-editor-DiQgdwg7.js";import"./epic-video-CaAYhEZJ.js";import"./format-C6HW_OzJ.js";import"./revalidation-ws-DjL8N8TA.js";import"./mdx-C9OwPmWH.js";import"./popover-D_79GoKZ.js";import"./index-DkUG1N7T.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:"66e9b849450b819e11683314a547a341cb57f7d0"};var e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="9df7fac5-a33c-4cb5-9b55-18e3f109021d",i._sentryDebugIdIdentifier="sentry-dbid-9df7fac5-a33c-4cb5-9b55-18e3f109021d")}catch{}})();const p=["playground","problem","solution","tests","diff","chat"],k=i=>!!(i&&p.includes(i)),bs=j(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})})]})]})}),Es=b(function(){return r.jsx(U,{statusHandlers:{404:()=>r.jsx("p",{children:"Sorry, we couldn't find an app here."})}})});export{Es as ErrorBoundary,bs as default};
//# sourceMappingURL=index-D5dMhZeG.js.map
