import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c as d,bu as e,u as q,e as m,er as D,t as C}from"./registerWidgets.a7f9f083.js";import{L}from"./CircularLoading.f04a39f3.js";import{E as N}from"./Error.3f0783b1.js";import{F as M,R as V}from"./broker.b0552add.js";import{B as W}from"./BackButton.547357d3.js";import{a as _}from"./asyncComputed.b85a7eae.js";import{F as H}from"./forms.3209df4e.js";import{W as S}from"./workspaces.cd7ce6b5.js";import{r as U}from"./index.3cb779ee.js";import"./lottie.0b007633.js";import"./passwordlessManager.c97a120a.js";import"./pubsub.e3e6423a.js";import"./Passwordless.60541298.js";import"./icons.71d8e4fb.js";import"./executeJs.f647ea9a.js";import"./PlayerNavbar.ea2c3e5c.js";import"./Steps.2d54b29e.js";import"./Modal.9197d569.js";import"./WidgetsFrame.afc734a7.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.2548dd3d.js";import"./activeRecord.8c74a961.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]="f47029a7-7894-4202-aba9-c6d72e06881d",a._sentryDebugIdIdentifier="sentry-dbid-f47029a7-7894-4202-aba9-c6d72e06881d")}catch{}})();const $={class:"page"},j={key:1,class:"error"},z={key:2,style:{width:"100%",height:"100%",display:"flex"}},A={style:{width:"100%",height:"100%",display:"flex"}},G=x({__name:"FormPreview",setup(a){const t=F(),o=R(),s=B({started:!1});function y(r,n){U("preview",t,r,n)}const c=I(null),{loading:h,result:u,error:f,refetch:p}=_(()=>H.get(o.params.formPath)),{result:l}=_(()=>S.get()),v=E(()=>V.create({formPath:o.params.formPath})),g=async()=>{var r;if(!s.started){(r=c.value)==null||r.run();return}s.started=!1},w=({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())},k=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},b=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),d("div",$,[e(h)||!e(u)||!e(l)?(i(),q(L,{key:0})):e(f)?(i(),d("div",j,[m(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",z,[D("div",A,[m(M,{ref_key:"runner",ref:c,form:e(u).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:w,onLogout:g,onExit:P,onStart:b,onRedirect:y},null,8,["form","params","broker"]),m(W,{onExitFullscreenPreview:k})])]))]))}});const pe=C(G,[["__scopeId","data-v-fa4f1951"]]);export{pe as default};
//# sourceMappingURL=FormPreview.562df1f4.js.map
