import{L as D}from"./CircularLoading-Ci5NXlB6.js";import{e as w,r as n,R as k,ah as x,f as c,j as I,v as l,ba as C,g as i,aO as E}from"./jwt-decode.esm-CkJiA_gX.js";import{W}from"./Watermark-Unyyiz0z.js";import{u as $}from"./userStore-DDtS-BMz.js";import{b as R}from"./consoleCapture-CIe9qNfI.js";import{b as S}from"./workspaceStore-zFqD9Jhd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7d51c99d-d39f-441c-8493-1088f8a0303c",e._sentryDebugIdIdentifier="sentry-dbid-7d51c99d-d39f-441c-8493-1088f8a0303c")}catch{}})();const V={class:"page-container"},j={key:0,class:"loading"},L={key:1,class:"error-container"},M=["srcdoc"],P=w({__name:"PageStageView",props:{uiData:{}},setup(e){const t=e,f=x(),p=n(!0),u=n(""),s=n(!1),g=n(null);return k(async()=>{const a=$();a.loadJWT();try{const d=t.uiData.path?`/_page/${t.uiData.path}`:"/_page-home",o=await S(d,{headers:a.authHeaders});if(o.status===401){a.removeJWT(),f.push({name:"playerLogin",query:{redirect:`/${t.uiData.path}`}});return}if(o.ok){const m=await o.text(),r=o.headers.get("X-Execution-Id"),_=o.headers.get("X-Abstra-Debug")==="true";if(m){const h=`<base href="${d}" target="_top">`,b=a.jwt?`<meta name="abstra-auth-token" content="${a.jwt}">`:"",y=r?`<meta name="abstra-execution-id" content="${r}">`:"",v=r&&_?R(r,t.uiData.id):"";u.value=h+b+y+v+m}else s.value=!0}else s.value=!0}catch{s.value=!0}p.value=!1}),(a,d)=>(i(),c("div",V,[p.value?(i(),c("div",j,[l(D)])):s.value?(i(),c("div",L,[l(C,{"error-message":null,"execution-id":null,locale:"en"})])):u.value?(i(),c("iframe",{key:2,ref_key:"iframeRef",ref:g,class:"page-iframe",srcdoc:u.value},null,8,M)):I("",!0),l(W,{"page-id":e.uiData.id,locale:"en"},null,8,["page-id"])]))}}),A=E(P,[["__scopeId","data-v-0847c51d"]]);export{A as P};
//# sourceMappingURL=PageStageView-BCan8PWO.js.map
