const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.client-n7WV83J2.js","assets/index-B9zr-vzA.js"])))=>i.map(i=>d[i]);
import{_ as f}from"./preload-helper-DqNgO5-4.js";import{j as e}from"./jsx-runtime-C4_65a1U.js";import{r as o}from"./index-B9zr-vzA.js";import{h as p,i as x,j as l}from"./chunk-JZWAC4HX-5kJHQiQ9.js";import{g as j}from"./misc-DRDyxdMg.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"8a6db0ac5fe78363b0c97fe458a96ce773bf357c"};var t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="a2c0967e-e89a-4818-9a33-6fcb3f920535",r._sentryDebugIdIdentifier="sentry-dbid-a2c0967e-e89a-4818-9a33-6fcb3f920535")}catch{}})();const m=await f(()=>import("./index.client-n7WV83J2.js"),__vite__mapDeps([0,1])).catch(r=>(console.warn("Failed to import @sentry/react-router:",r instanceof Error?r.message:String(r),"- Sentry monitoring will be disabled but the application will continue to work normally"),null)),y={400:({error:r})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Request"}),e.jsx("p",{children:r.data})]}),401:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Unauthorized"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),403:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Forbidden"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),404:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Not Found"}),e.jsx("p",{children:"Sorry, we couldn't find what you were looking for."})]}),500:({error:r})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Internal Server Error"}),e.jsx("p",{children:"Sorry, something went wrong on our end."}),e.jsx("p",{children:r.data})]}),502:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Gateway"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]}),503:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Service Unavailable"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]})};function S({className:r="container flex items-center justify-center p-20 text-h2 flex-col gap-6",defaultStatusHandler:t=({error:n})=>e.jsxs("p",{children:[n.status," ",n.data]}),statusHandlers:i,unexpectedErrorHandler:c=n=>e.jsx("p",{children:j(n)})}){const[n,d]=o.useState(!1),s=p(),h=x(),a=l(s),u={...y,...i};return o.useEffect(()=>{a||ENV.EPICSHOP_IS_PUBLISHED&&m?.captureException(s)},[s,a]),o.useEffect(()=>{s instanceof Error&&s.message.includes("Failed to fetch")&&fetch("/resources/healthcheck").catch(()=>{d(!0)})},[s]),typeof document<"u"&&console.error(s),e.jsxs("div",{className:r,children:[n?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6",children:[e.jsx("h1",{className:"text-h2 font-bold",children:"Server is down"}),e.jsx("p",{className:"text-body-md",children:ENV.EPICSHOP_DEPLOYED?"Sorry, we're having a temporary problem. Please try again later.":"Your server is not running. Please restart the workshop app."})]}):null,l(s)?(u?.[s.status]??t)({error:s,params:h}):c(s)]})}export{S as G};
//# sourceMappingURL=error-boundary-BC83xzIm.js.map
