import{r as u,e as m,Q as h,P as E,n as I,a4 as w,ag as g,g as y,aN as T}from"./jwt-decode.esm-Di13oRQw.js";import{l as d}from"./fetch-D5TanjDu.js";import{u as C}from"./polling-DfdZhm_M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="5532983f-33eb-4bd2-8150-0dcd5f387f25",t._sentryDebugIdIdentifier="sentry-dbid-5532983f-33eb-4bd2-8150-0dcd5f387f25")}catch{}})();const _=8,b=3e3,H=3e3,L=1e3,R=t=>{const n=t.router,r=u(""),s=u(Array(_).fill(!0));let a=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),b),p=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),s.value[a]=p.status===200}catch{s.value[a]=!1}if(a=(a+1)%_,s.value.every(e=>!e)&&r.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=r.value+"?"+o.toString()}},{startPolling:c,endPolling:f}=C({task:i,interval:H}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},L);return}const o=await e.json();o.waitingRoomUrl&&(r.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},v=m({__name:"Home",setup(t){const n=g(),{setup:r,cleanUp:s}=R({router:n});return h(()=>{r()}),E(()=>{s()}),(a,i)=>{const c=w("RouterView");return y(),I(c,{class:"router"})}}}),k=T(v,[["__scopeId","data-v-3737a9c1"]]);export{k as default};
//# sourceMappingURL=Home-D6kQok8q.js.map
