import{d as x,H as P,J as F,v as R,r as B,K as I,b as n,c as i,z as e,t as q,e as d,x as E,q as D}from"./registerWidgets.cecc7add.js";import{L as C}from"./CircularLoading.45f7b299.js";import{E as L}from"./Error.368d18cc.js";import{F as N,R as H}from"./broker.352d6f95.js";import{B as M}from"./BackButton.5be26fba.js";import{a as _}from"./asyncComputed.08fdcc30.js";import{F as V}from"./forms.88a7aa49.js";import{W}from"./workspaces.9e1715c9.js";import"./lottie.79ce2fdf.js";import"./passwordlessManager.8b0c672e.js";import"./pubsub.a43e35aa.js";import"./Passwordless.0943eeec.js";import"./icons.a47594f6.js";import"./executeJs.5aff51e5.js";import"./PlayerNavbar.208ad882.js";import"./index.a0dcefc8.js";import"./Steps.5d7ea3ec.js";import"./Modal.4485a18b.js";import"./WidgetsFrame.bbded71d.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.bfc19705.js";import"./activeRecord.2a9ab687.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="61564705-6234-4ebe-bb94-3fda3179c1f7",s._sentryDebugIdIdentifier="sentry-dbid-61564705-6234-4ebe-bb94-3fda3179c1f7")}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(s){const t=P(),r=F(),a=R({started:!1}),m=B(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=I(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!a.started){(o=m.value)==null||o.run();return}a.started=!1},b=({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())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},w=()=>{a.started=!0},k=()=>{a.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(c)||!e(f)?(n(),q(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,[E("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(f)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:y.value,style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:b,onLogout:v,onExit:k,onStart:w},null,8,["form","params","broker"]),d(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.7f3f62c8.js.map
