import{d as g,ey as k,ex as w,b as s,c as m,w as n,b0 as h,u as e,cb as x,r as y,f as i,eu as f,eD as B}from"./registerWidgets.ca57da3e.js";import{_ as C,a as $}from"./FormTester.vue_vue_type_script_setup_true_lang.fe5cf24f.js";import{S as I,L as P}from"./SmartConsole.9884c3ed.js";import{a as R}from"./asyncComputed.ae0b6a3c.js";import{F as T}from"./forms.5015911b.js";import{W as D}from"./workspaces.0ed1b422.js";import{_ as S}from"./SaveButton.vue_vue_type_script_setup_true_lang.f4f91b79.js";import{_ as N}from"./DocsButton.vue_vue_type_script_setup_true_lang.e215c49e.js";import{B as F}from"./BaseLayout.6a4d2025.js";import{a as b,T as L}from"./index.074f39fb.js";import"./index.dcb9970b.js";import{c as V}from"./index.3efb162e.js";import"./Title.e5d7f1b0.js";import"./transButton.a2961478.js";import"./FormItem.a9f8aa72.js";import"./Form.78fca70f.js";import"./broker.84aa32b4.js";import"./passwordlessManager.8d47b009.js";import"./pubsub.277d05a3.js";import"./storage.2a7aac1e.js";import"./Passwordless.dec7e85f.js";import"./CircularLoading.716a5772.js";import"./icons.1efe7950.js";import"./executeJs.c4f1fb52.js";import"./PlayerNavbar.dd762667.js";import"./index.56c756a6.js";import"./Steps.2df1321f.js";import"./Modal.db45c3f3.js";import"./WidgetsFrame.7a78af2f.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.fdeff461.js";import"./dashes.8ed8444a.js";import"./activeRecord.f8743cd4.js";import"./hooks.60a5ffb4.js";import"./jobs.f78a8656.js";import"./uuid.372ac027.js";import"./index.9943ced7.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="77e52b09-9ef6-4427-a034-489a38f8f06f",r._sentryDebugIdIdentifier="sentry-dbid-77e52b09-9ef6-4427-a034-489a38f8f06f")}catch{}})();const q=g({__name:"PreviewButton",props:{model:{}},setup(r){const a=r,p=k(),u=w(),o=()=>{const l=p.query;u.push({path:`/_editor/${a.model.routeName}/${encodeURIComponent(a.model.path)}/preview`,query:l})};return(l,t)=>(s(),m(e(x),{class:"preview-button",onClick:o},{default:n(()=>[h(" Preview ")]),_:1}))}}),ke=g({__name:"FormEditor",setup(r){const a=w(),p=k(),u=y(null),o=y("test");function l(){a.push({name:"forms"})}const{result:t}=R(()=>Promise.all([D.get(),T.get(p.params.formPath)]).then(([v,c])=>B({workspace:v,form:c}))),_=P.create();return(v,c)=>(s(),m(F,{"full-canvas":o.value==="test"},{navbar:n(()=>[e(t)?(s(),m(e(V),{key:0,title:e(t).form.title,onBack:l},{footer:n(()=>[i(e(L),{"active-key":o.value,"onUpdate:activeKey":c[0]||(c[0]=d=>o.value=d)},{default:n(()=>[i(e(b),{key:"test",tab:"Test"}),i(e(b),{key:"settings",tab:"Settings"})]),_:1},8,["active-key"])]),extra:n(()=>[i(N,{path:"forms/overview"}),i(q,{model:e(t).form},null,8,["model"]),o.value==="settings"?(s(),m(S,{key:0,model:e(t).form},null,8,["model"])):f("",!0)]),_:1},8,["title"])):f("",!0)]),content:n(()=>[e(t)&&o.value==="test"?(s(),m(C,{key:0,ref_key:"tester",ref:u,form:e(t).form,"log-service":e(_)},null,8,["form","log-service"])):f("",!0),e(t)&&o.value==="settings"?(s(),m($,{key:1,form:e(t).form},null,8,["form"])):f("",!0)]),footer:n(()=>{var d;return[e(t)&&o.value==="test"?(s(),m(I,{key:0,runtime:"forms","log-service":e(_),onRestart:(d=u.value)==null?void 0:d.restart},null,8,["log-service","onRestart"])):f("",!0)]}),_:1},8,["full-canvas"]))}});export{ke as default};
//# sourceMappingURL=FormEditor.0a8b3d54.js.map
