import{r as u,e as m,S as h,x as E,n as I,a6 as w,ag as g,g as y,aO as T}from"./jwt-decode.esm-D4VPbsXq.js";import{l as d}from"./fetch-CWco3vRl.js";import{u as C}from"./polling-U3JIOgJS.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]="9802a6a6-4da7-41df-888f-60b93731ee9e",t._sentryDebugIdIdentifier="sentry-dbid-9802a6a6-4da7-41df-888f-60b93731ee9e")}catch{}})();const _=8,H=3e3,L=3e3,R=1e3,b=t=>{const n=t.router,a=u(""),r=u(Array(_).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),H),p=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),r.value[s]=p.status===200}catch{r.value[s]=!1}if(s=(s+1)%_,r.value.every(e=>!e)&&a.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=a.value+"?"+o.toString()}},{startPolling:c,endPolling:f}=C({task:i,interval:L}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},R);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},v=m({__name:"Home",setup(t){const n=g(),{setup:a,cleanUp:r}=b({router:n});return h(()=>{a()}),E(()=>{r()}),(s,i)=>{const c=w("RouterView");return y(),I(c,{class:"router"})}}}),D=T(v,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-CMI294qc.js.map
