import{d as x,J as R,K as F,w as B,r as I,L as E,b as i,c,A as e,u as q,e as d,y as D,t as L}from"./registerWidgets.163fba07.js";import{L as C}from"./CircularLoading.926802eb.js";import{E as N}from"./Error.503257d7.js";import{F as M,R as V}from"./broker.3bcefec6.js";import{B as W}from"./BackButton.41535605.js";import{a as _}from"./asyncComputed.5f7867b2.js";import{F as A}from"./forms.37d2d619.js";import{W as H}from"./workspaces.e858f4ee.js";import{r as J}from"./index.0f874dbb.js";import"./lottie.981a9cff.js";import"./passwordlessManager.055571e3.js";import"./pubsub.2d612358.js";import"./Passwordless.5a241617.js";import"./icons.89f10f59.js";import"./executeJs.6264eb3b.js";import"./PlayerNavbar.69057de4.js";import"./Steps.c7e4143d.js";import"./Modal.ea6a3e3a.js";import"./WidgetsFrame.4b54ae2c.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.46c53e30.js";import"./activeRecord.b56127d8.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]="cec4d152-9535-4b28-910c-1b3d7cfaa094",a._sentryDebugIdIdentifier="sentry-dbid-cec4d152-9535-4b28-910c-1b3d7cfaa094")}catch{}})();const K={class:"page"},S={key:1,class:"error"},U={key:2,style:{width:"100%",height:"100%",display:"flex"}},$={style:{width:"100%",height:"100%",display:"flex"}},j=x({__name:"FormPreview",setup(a){const t=R(),o=F(),s=B({started:!1});function y(r,n){J("preview",t,r,n)}const m=I(null),{loading:h,result:u,error:f,refetch:p}=_(()=>A.get(o.params.formPath)),{result:l}=_(()=>H.get()),v=E(()=>V.create({formPath:o.params.formPath})),w=async()=>{var r;if(!s.started){(r=m.value)==null||r.run();return}s.started=!1},g=({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())},b=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),c("div",K,[e(h)||!e(u)||!e(l)?(i(),q(C,{key:0})):e(f)?(i(),c("div",S,[d(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),c("main",U,[D("div",$,[d(M,{ref_key:"runner",ref:m,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:g,onLogout:w,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),d(W,{onExitFullscreenPreview:b})])]))]))}});const pe=L(j,[["__scopeId","data-v-fa4f1951"]]);export{pe as default};
//# sourceMappingURL=FormPreview.8b93caee.js.map
