import{L as w}from"./CircularLoading-DsrD9y3A.js";import{e as D,r as n,Q as k,ag as x,f as i,j as I,v as u,ba as C,g as c,aO as E}from"./jwt-decode.esm-D5_MAYoy.js";import{W}from"./Watermark-DICrXuS1.js";import{u as $}from"./userStore-B-XhgirN.js";import{b as S}from"./consoleCapture-BXdMW5_u.js";import{b as V}from"./workspaceStore-NtJqbJSB.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="3d343830-f735-493c-8428-3bd22db0fda6",e._sentryDebugIdIdentifier="sentry-dbid-3d343830-f735-493c-8428-3bd22db0fda6")}catch{}})();const j={class:"page-container"},L={key:0,class:"loading"},M={key:1,class:"error-container"},P=["srcdoc"],R=D({__name:"PageStageView",props:{uiData:{}},setup(e){const a=e,f=x(),p=n(!0),d=n(""),s=n(!1),g=n(null);return k(async()=>{const t=$();t.loadJWT();try{const l=a.uiData.path?`/_page/${a.uiData.path}`:"/_page-home",o=await V(l,{headers:t.authHeaders});if(o.status===401){t.removeJWT(),f.push({name:"playerLogin",query:{redirect:`/${a.uiData.path}`}});return}if(o.ok){const m=await o.text(),r=o.headers.get("X-Execution-Id"),b=o.headers.get("X-Abstra-Debug")==="true";if(m){const _=`<base href="${l}" target="_top">`,h=t.jwt?`<meta name="abstra-auth-token" content="${t.jwt}">`:"",v=r?`<meta name="abstra-execution-id" content="${r}">`:"",y=r&&b?S(r,a.uiData.id):"";d.value=_+h+v+y+m}else s.value=!0}else s.value=!0}catch{s.value=!0}p.value=!1}),(t,l)=>(c(),i("div",j,[p.value?(c(),i("div",L,[u(w)])):s.value?(c(),i("div",M,[u(C,{"error-message":null,"execution-id":null,locale:"en"})])):d.value?(c(),i("iframe",{key:2,ref_key:"iframeRef",ref:g,class:"page-iframe",srcdoc:d.value,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-top-navigation-by-user-activation"},null,8,P)):I("",!0),u(W,{"page-id":e.uiData.id,locale:"en"},null,8,["page-id"])]))}}),A=E(R,[["__scopeId","data-v-dcbf338d"]]);export{A as P};
//# sourceMappingURL=PageStageView-D7KHIIU2.js.map
