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.75ad232d.js";import{L as C}from"./CircularLoading.a5d89224.js";import{E as L}from"./Error.4d95109c.js";import{F as N,R as H}from"./broker.e9e43f98.js";import{B as M}from"./BackButton.75ccb1c4.js";import{a as _}from"./asyncComputed.62fdaa3d.js";import{F as V}from"./forms.ec5efe06.js";import{W}from"./workspaces.59d4dbff.js";import"./lottie.24c4e251.js";import"./passwordlessManager.e427d83f.js";import"./pubsub.98e48b80.js";import"./icons.79136e9f.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.94563a79.js";import"./Passwordless.fbe1299e.js";import"./executeJs.36329e9a.js";import"./PlayerNavbar.f4ffe1a1.js";import"./index.6150da77.js";import"./WidgetsFrame.151ac7b7.js";import"./colors.55a42b18.js";import"./Modal.5f99340f.js";import"./activeRecord.91b12e0f.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]="d3833495-6ca4-40a2-a28c-76ca5e8d880c",a._sentryDebugIdIdentifier="sentry-dbid-d3833495-6ca4-40a2-a28c-76ca5e8d880c")}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}),c=F(null),{loading:h,result:m,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=c.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(m)||!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:c,form:e(m).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.641a17f1.js.map
