import{L as D}from"./CircularLoading-ylUWWooD.js";import{e as w,r as n,Q as k,ag as x,f as c,j as I,v as l,ba as C,g as i,aO as E}from"./jwt-decode.esm-CW-ehmUm.js";import{W}from"./Watermark-DjDnHfrp.js";import{u as $}from"./userStore-C91zXrXx.js";import{b as S}from"./consoleCapture-DPCsPq9K.js";import{b as V}from"./workspaceStore-DcnxpW_c.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]="b99ac803-4606-45fe-b90f-013d883d3b70",e._sentryDebugIdIdentifier="sentry-dbid-b99ac803-4606-45fe-b90f-013d883d3b70")}catch{}})();const j={class:"page-container"},L={key:0,class:"loading"},M={key:1,class:"error-container"},P=["srcdoc"],R=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 V(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"),b=o.headers.get("X-Abstra-Debug")==="true";if(m){const _=`<base href="${d}" target="_top">`,h=a.jwt?`<meta name="abstra-auth-token" content="${a.jwt}">`:"",y=r?`<meta name="abstra-execution-id" content="${r}">`:"",v=r&&b?S(r,t.uiData.id):"";u.value=_+h+y+v+m}else s.value=!0}else s.value=!0}catch{s.value=!0}p.value=!1}),(a,d)=>(i(),c("div",j,[p.value?(i(),c("div",L,[l(D)])):s.value?(i(),c("div",M,[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,P)):I("",!0),l(W,{"page-id":e.uiData.id,locale:"en"},null,8,["page-id"])]))}}),A=E(R,[["__scopeId","data-v-0847c51d"]]);export{A as P};
//# sourceMappingURL=PageStageView-Ifl3m5Mh.js.map
