import{d as P,v as x,r as F,K as R,b as n,c as i,z as e,t as B,e as d,x as I,H as q,J as E,q as D}from"./registerWidgets.ad696c68.js";import{L}from"./CircularLoading.1b0ceab6.js";import{E as C}from"./Error.1fa9e8b0.js";import{F as N,R as H}from"./broker.0b03ffc6.js";import{B as M}from"./BackButton.9130c98a.js";import{a as _}from"./asyncComputed.40a67fe8.js";import{F as V}from"./forms.b1d3d225.js";import{W}from"./workspaces.d73a0523.js";import"./lottie.d1a83079.js";import"./passwordlessManager.86ad8b48.js";import"./icons.1c1f9d53.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.a0f7f94d.js";import"./Passwordless.896adb7f.js";import"./executeJs.5aebf107.js";import"./PlayerNavbar.049fd037.js";import"./index.5e96dbf3.js";import"./WidgetsFrame.afffe632.js";import"./colors.698f0f3f.js";import"./Modal.d606972f.js";import"./log.812f9d15.js";import"./activeRecord.da3a3625.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]="dddf92ac-8d20-4b17-aa6f-ffe298c187ad",a._sentryDebugIdIdentifier="sentry-dbid-dddf92ac-8d20-4b17-aa6f-ffe298c187ad")}catch{}})();const z={class:"page"},J={key:1,class:"error"},K={key:2,style:{width:"100%",height:"100%",display:"flex"}},S={style:{width:"100%",height:"100%",display:"flex"}},U=P({__name:"FormPreview",setup(a){const t=q(),r=E(),s=x({started:!1}),m=F(null),{loading:h,result:c,error:f,refetch:u}=_(()=>V.get(r.params.formPath)),{result:p}=_(()=>W.get()),y=R(()=>H.create({isLocal:!1,formPath:r.params.formPath,isPreview:!0})),v=async()=>{var o;if(!s.started){(o=m.value)==null||o.run();return}s.started=!1},g=({path:o,type:l})=>{l==="dash"?t.push({name:"dashPreview",params:{dashPath:o},query:r.query}):(t.push({name:"form-preview",params:{formPath:o},query:r.query}),u())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},b=()=>{s.started=!0},k=()=>{s.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(c)||!e(p)?(n(),B(L,{key:0})):e(f)?(n(),i("div",J,[d(C,{error:e(f),onReload:e(u)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(p)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:v,onExit:k,onStart:b},null,8,["form","params","broker"]),d(M,{onExitFullscreenPreview:w})])]))]))}});const fe=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{fe as default};
//# sourceMappingURL=FormPreview.0fc58bd4.js.map
