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.92d2f644.js";import{L}from"./CircularLoading.e3659467.js";import{E as N}from"./Error.44b88286.js";import{F as M,R as V}from"./broker.dd00d469.js";import{B as W}from"./BackButton.1708a07b.js";import{a as _}from"./asyncComputed.969e5e52.js";import{F as H}from"./forms.ec308b4d.js";import{W as S}from"./workspaces.c2950343.js";import{r as U}from"./index.75f517f3.js";import"./lottie.8475a642.js";import"./passwordlessManager.d1484834.js";import"./pubsub.cabffe13.js";import"./storage.63ab52ef.js";import"./Passwordless.493e6d57.js";import"./icons.f7e2c66d.js";import"./executeJs.3da04476.js";import"./PlayerNavbar.e2f19917.js";import"./Steps.b001c6e8.js";import"./Modal.2ef1e90a.js";import"./WidgetsFrame.c49cae71.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.0b91cf80.js";import"./activeRecord.1a640186.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]="172522f8-119c-4754-aca8-d9213fd91123",a._sentryDebugIdIdentifier="sentry-dbid-172522f8-119c-4754-aca8-d9213fd91123")}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 le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.13db077d.js.map
