import{d as x,ex as R,ey as F,G as B,r as I,H as E,b as i,d2 as d,u as e,c as q,f as m,e as D,v as C}from"./registerWidgets.e46eca28.js";import{L}from"./CircularLoading.484aa2f6.js";import{E as N}from"./Error.871366c2.js";import{F as H,R as M}from"./broker.59f9a113.js";import{B as V}from"./BackButton.916daf80.js";import{a as _}from"./asyncComputed.15fd30e0.js";import{F as W}from"./forms.e1efaa71.js";import{W as G}from"./workspaces.5c5c851b.js";import{r as S}from"./index.2ced575c.js";import"./lottie.2b81658b.js";import"./passwordlessManager.f4cc4f94.js";import"./pubsub.8f2ecd1e.js";import"./storage.f303ee10.js";import"./Passwordless.5a77ee63.js";import"./icons.db549bc5.js";import"./executeJs.a5a141fd.js";import"./PlayerNavbar.6a57e760.js";import"./Steps.deb305bb.js";import"./Modal.47e24ea4.js";import"./WidgetsFrame.71d81391.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.114e5eb7.js";import"./activeRecord.d83b1b14.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]="2df7f1b6-dc0f-4c75-801b-0667fd9c625b",s._sentryDebugIdIdentifier="sentry-dbid-2df7f1b6-dc0f-4c75-801b-0667fd9c625b")}catch{}})();const U={class:"page"},$={key:1,class:"error"},j={key:2,style:{width:"100%",height:"100%",display:"flex"}},z={style:{width:"100%",height:"100%",display:"flex"}},A=x({__name:"FormPreview",setup(s){const t=R(),o=F(),a=B({started:!1});function y(r,n){S("preview",t,r,n)}const c=I(null),{loading:h,result:f,error:u,refetch:p}=_(()=>W.get(o.params.formPath)),{result:l}=_(()=>G.get()),v=E(()=>M.create({formPath:o.params.formPath})),b=async()=>{var r;if(!a.started){(r=c.value)==null||r.run();return}a.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())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{a.started=!0},P=()=>{a.started=!1};return(r,n)=>(i(),d("div",U,[e(h)||!e(f)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),d("div",$,[m(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",j,[D("div",z,[m(H,{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:g,onLogout:b,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),m(V,{onExitFullscreenPreview:w})])]))]))}});const le=C(A,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.08b18e5c.js.map
