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.2d3a9fa1.js";import{L}from"./CircularLoading.7f8cdc69.js";import{E as N}from"./Error.9e711c7a.js";import{F as M,R as V}from"./broker.2019863b.js";import{B as W}from"./BackButton.9f23fa5d.js";import{a as _}from"./asyncComputed.da67dddd.js";import{F as H}from"./forms.205774f9.js";import{W as S}from"./workspaces.98c3e654.js";import{r as U}from"./index.1a3a4850.js";import"./lottie.8f8e4fb5.js";import"./passwordlessManager.7fdb47fd.js";import"./pubsub.f5cc447b.js";import"./storage.2f9edc3d.js";import"./Passwordless.f47b04f0.js";import"./icons.ef35efa7.js";import"./executeJs.76e35dd0.js";import"./PlayerNavbar.fdd6bac1.js";import"./Steps.27fe6056.js";import"./Modal.0a34e3f8.js";import"./WidgetsFrame.c6f4d7d9.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.d48002ff.js";import"./activeRecord.85525a95.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]="5aaf8131-20d1-4e29-ac49-c02ff5b18d94",a._sentryDebugIdIdentifier="sentry-dbid-5aaf8131-20d1-4e29-ac49-c02ff5b18d94")}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:f,error:u,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(f)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),d("div",j,[m(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",z,[D("div",A,[m(M,{ref_key:"runner",ref:c,form:e(f).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 le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.b516cf3e.js.map
