import{r as u,e as m,N as h,n as E,f as I,ab as w,ai as y,h as T,aO as b}from"./jwt-decode.esm-BJTSBhUK.js";import{l as d}from"./fetch-6ZdEdsKW.js";import{u as C}from"./polling-nRDcqq70.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]="c26c75d4-2b59-4b8f-9fd0-d4d8191f1a16",t._sentryDebugIdIdentifier="sentry-dbid-c26c75d4-2b59-4b8f-9fd0-d4d8191f1a16")}catch{}})();const _=8,g=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(),g),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=y(),{setup:r,cleanUp:s}=R({router:n});return h(()=>{r()}),E(()=>{s()}),(a,i)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),D=b(v,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-Bl7kpAP1.js.map
