import{d as x,v as P,r as F,K as R,b as n,c as d,z as e,t as B,e as i,x as I,H as q,J as E,q as D}from"./registerWidgets.240bf3ff.js";import{L as C}from"./CircularLoading.846828c4.js";import{E as L}from"./Error.e50c32b2.js";import{F as N,R as H}from"./broker.814a162e.js";import{B as M}from"./BackButton.6d21a528.js";import{a as _}from"./asyncComputed.e710533c.js";import{F as V}from"./forms.0c5bd2c6.js";import{W}from"./workspaces.1aaecf60.js";import"./lottie.b1d7a5e6.js";import"./passwordlessManager.0554ad1a.js";import"./pubsub.83908d54.js";import"./icons.8dbdad3c.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.4365f5b1.js";import"./Passwordless.fa44d239.js";import"./executeJs.7c542955.js";import"./PlayerNavbar.bb822c94.js";import"./index.b8bf5795.js";import"./WidgetsFrame.a2454146.js";import"./colors.9e0ee383.js";import"./Modal.ba42d121.js";import"./activeRecord.d21ad35a.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]="7c947421-4ddd-43f9-9a73-110d3e080a79",a._sentryDebugIdIdentifier="sentry-dbid-7c947421-4ddd-43f9-9a73-110d3e080a79")}catch{}})();const z={class:"page"},J={key:1,class:"error"},K={key:2,style:{width:"100%",height:"100%",display:"flex"}},S={style:{width:"100%",height:"100%",display:"flex"}},U=x({__name:"FormPreview",setup(a){const t=q(),r=E(),s=P({started:!1}),m=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!s.started){(o=m.value)==null||o.run();return}s.started=!1},g=({path:o,type:l})=>{l==="dash"?t.push({name:"dashPreview",params:{dashPath:o},query:r.query}):(t.push({name:"form-preview",params:{formPath:o},query:r.query}),p())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},k=()=>{s.started=!0},b=()=>{s.started=!1};return(o,l)=>(n(),d("div",z,[e(h)||!e(c)||!e(f)?(n(),B(C,{key:0})):e(u)?(n(),d("div",J,[i(L,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),d("main",K,[I("div",S,[i(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(f)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:v,onExit:b,onStart:k},null,8,["form","params","broker"]),i(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.cee29970.js.map
