import{d as v,G as y,b as n,c as k,y as r,t as l,B as c,F as D,L as P,K as g,q as w}from"./registerWidgets.d12d7cf9.js";import{D as B,n as q}from"./DashPlayer.526e44da.js";import{a as m,L as x}from"./CircularLoading.89577a16.js";import{r as R}from"./index.7a773bce.js";import{B as I}from"./BackButton.f34770a2.js";import{D as C}from"./dashes.8e41d473.js";import{W as F}from"./workspaces.32af92db.js";import"./WidgetsFrame.015f5931.js";import"./icons.a63cb90b.js";import"./Modal.8745ec05.js";import"./runnerData.12d27e35.js";import"./log.2520bfaa.js";import"./utils.3371dfe5.js";const L=v({__name:"DashPreview",setup(E){const t=P(),s=g(),i=({id:e,type:o})=>{o==="dash"?(s.push({name:"dashPreview",params:{dashId:e},query:t.query}),_()):s.push({name:"form-preview",params:{formId:e},query:t.query})},d=()=>{var e;!((e=a.value)!=null&&e.path)||s.push(`/_editor/dash/${encodeURIComponent(a.value.path)}`)},{loading:h,result:a,refetch:_}=m(()=>C.get(t.params.dashPath)),{result:u}=m(()=>F.get()),p=y(()=>{if(!a.value||!u.value||!a.value.makeRunnerData(u.value))return null;const e=q.create(a.value.makeRunnerData(u.value),!1);return e.onRedirect(({url:o,queryParams:f})=>R(s,o,f)),e});return(e,o)=>(n(),k(D,null,[r(h)||!r(a)?(n(),l(x,{key:0,class:"loading",justify:"center"})):c("",!0),r(p)?(n(),l(B,{key:1,class:"player",dash:r(p).runnerData,"is-preview":!0,params:r(t).query,"dash-player-state":r(p),onNavigate:i},null,8,["dash","params","dash-player-state"])):c("",!0),r(a)?(n(),l(I,{key:2,onExitFullscreenPreview:d})):c("",!0)],64))}});const H=w(L,[["__scopeId","data-v-dde58483"]]);export{H as default};
//# sourceMappingURL=DashPreview.94ee56a2.js.map
