import{d as x,v as P,r as F,K as R,b as n,c as i,z as e,t as B,e as d,x as I,H as q,J as E,q as D}from"./registerWidgets.1fe34791.js";import{L as C}from"./CircularLoading.d753f33f.js";import{E as L}from"./Error.15818607.js";import{F as N,R as H}from"./broker.53f3a2ac.js";import{B as M}from"./BackButton.8f6bf9a1.js";import{a as _}from"./asyncComputed.92243be5.js";import{F as V}from"./forms.55bef7bd.js";import{W}from"./workspaces.c8d826f7.js";import"./lottie.e5b4ac5e.js";import"./passwordlessManager.4fd7bb4b.js";import"./pubsub.b559dee6.js";import"./icons.6936d0f0.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.fafd2505.js";import"./Passwordless.db8c8e00.js";import"./executeJs.d22827db.js";import"./PlayerNavbar.06a8d391.js";import"./index.09c5c1c7.js";import"./WidgetsFrame.1635059a.js";import"./colors.c0e9a7d1.js";import"./Modal.1d6d71ee.js";import"./activeRecord.74b17129.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]="39719d97-8228-4aec-8638-98010ad2c2a8",a._sentryDebugIdIdentifier="sentry-dbid-39719d97-8228-4aec-8638-98010ad2c2a8")}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:l}=_(()=>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:f})=>{f==="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,f)=>(n(),i("div",z,[e(h)||!e(c)||!e(l)?(n(),B(C,{key:0})):e(u)?(n(),i("div",J,[d(L,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(l)),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"]),d(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.9cdaceb9.js.map
