import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c as m,bu as e,u as q,e as d,er as D,t as C}from"./registerWidgets.59747b32.js";import{L}from"./CircularLoading.eebf6e84.js";import{E as N}from"./Error.eef2a4b4.js";import{F as M,R as V}from"./broker.3d7c8f8c.js";import{B as W}from"./BackButton.33e2a4bf.js";import{a as _}from"./asyncComputed.1d4b957f.js";import{F as H}from"./forms.fb0b4e47.js";import{W as S}from"./workspaces.69ae4514.js";import{r as U}from"./index.135ae79e.js";import"./lottie.15d20c75.js";import"./passwordlessManager.794d3db6.js";import"./pubsub.cfb8c19f.js";import"./storage.e0256989.js";import"./Passwordless.af9fa329.js";import"./icons.8e518be5.js";import"./executeJs.977da00c.js";import"./PlayerNavbar.6a6dc5eb.js";import"./Steps.60776a12.js";import"./Modal.9da25f39.js";import"./WidgetsFrame.2536274d.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.a3a0153d.js";import"./activeRecord.e2c0e940.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]="292683fa-31fb-4aa4-9c81-0f6f7d7f8819",a._sentryDebugIdIdentifier="sentry-dbid-292683fa-31fb-4aa4-9c81-0f6f7d7f8819")}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 f=I(null),{loading:h,result:c,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=f.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(),m("div",$,[e(h)||!e(c)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),m("div",j,[d(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),m("main",z,[D("div",A,[d(M,{ref_key:"runner",ref:f,form:e(c).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"]),d(W,{onExitFullscreenPreview:k})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.cad99865.js.map
