import{d as x,J as R,K as F,w as B,r as I,L as E,b as i,c as m,A as e,u as q,e as d,y as D,t as L}from"./registerWidgets.a9b9c198.js";import{L as C}from"./CircularLoading.7f46cf05.js";import{E as N}from"./Error.79824bcd.js";import{F as M,R as V}from"./broker.d38286f8.js";import{B as W}from"./BackButton.ef5c329d.js";import{a as _}from"./asyncComputed.380e0794.js";import{F as A}from"./forms.17df1800.js";import{W as H}from"./workspaces.3f458914.js";import{r as J}from"./index.e0dbf129.js";import"./lottie.cb2a87b3.js";import"./passwordlessManager.18e9d509.js";import"./pubsub.d6cf90d7.js";import"./Passwordless.3e56a551.js";import"./icons.e4ff78f2.js";import"./executeJs.28eb4656.js";import"./PlayerNavbar.8c4f0639.js";import"./Steps.0d4f20d5.js";import"./Modal.0c783a31.js";import"./WidgetsFrame.761f181e.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.d2040fb1.js";import"./activeRecord.ded96690.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="767f220e-78f4-46bf-bcad-445140a49568",a._sentryDebugIdIdentifier="sentry-dbid-767f220e-78f4-46bf-bcad-445140a49568")}catch{}})();const K={class:"page"},S={key:1,class:"error"},U={key:2,style:{width:"100%",height:"100%",display:"flex"}},$={style:{width:"100%",height:"100%",display:"flex"}},j=x({__name:"FormPreview",setup(a){const t=R(),o=F(),s=B({started:!1});function y(r,n){J("preview",t,r,n)}const c=I(null),{loading:h,result:f,error:u,refetch:p}=_(()=>A.get(o.params.formPath)),{result:l}=_(()=>H.get()),v=E(()=>V.create({formPath:o.params.formPath})),w=async()=>{var r;if(!s.started){(r=c.value)==null||r.run();return}s.started=!1},g=({path:r,type:n})=>{n==="dash"?t.push({name:"dashPreview",params:{dashPath:r},query:o.query}):(t.push({name:"formPreview",params:{formPath:r},query:o.query}),p())},b=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),m("div",K,[e(h)||!e(f)||!e(l)?(i(),q(C,{key:0})):e(u)?(i(),m("div",S,[d(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),m("main",U,[D("div",$,[d(M,{ref_key:"runner",ref:c,form:e(f).makeRunnerData(e(l)),params:e(o).query,"is-preview":!0,"enable-auto-focus":!0,broker:v.value,style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:w,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),d(W,{onExitFullscreenPreview:b})])]))]))}});const pe=L(j,[["__scopeId","data-v-fa4f1951"]]);export{pe as default};
//# sourceMappingURL=FormPreview.a52a83a2.js.map
