import{r as u,d as f,e5 as h,k as y,j as w,m as g,a as v,o as b,_ as I}from"./jwt-decode.esm.febfd28e.js";import{l as d}from"./fetch.30d47f3a.js";import{u as k}from"./polling.4a7f8a79.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]="38b23e66-91c5-4037-a502-3d30f5205c68",t._sentryDebugIdIdentifier="sentry-dbid-38b23e66-91c5-4037-a502-3d30f5205c68")}catch{}})();const _=4,C=t=>{const n=t.router,r=u(""),s=u(Array(_).fill(!0));let a=0;const l=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),1e3),m=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),s.value[a]=m.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:p}=k({task:l,interval:2e3}),i=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{i()},1e3);return}const o=await e.json();o.waitingRoomUrl&&(r.value=o.waitingRoomUrl,c())};return{setup:i,cleanUp:p}},H=f({__name:"Home",setup(t){const n=h(),{setup:r,cleanUp:s}=C({router:n});return y(()=>{r()}),w(()=>{s()}),(a,l)=>{const c=g("RouterView");return b(),v(c,{class:"router"})}}});const U=I(H,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home.c361bc01.js.map
