import{d as R,r as y,G as T,b as c,c as f,w as d,f as n,er as w,ez as x,e as K,b0 as B,eA as E,u as a,bu as F,c4 as I,c5 as C,H as A,ex as D,bP as M}from"./registerWidgets.4340e287.js";import{R as N}from"./SmartConsole.a2b6bdb5.js";import{c as P,A as b}from"./Title.4165770a.js";import{F as L}from"./Form.7b78c348.js";import{W as V}from"./workspaces.ff4ec9b2.js";import{R as W,F as G}from"./broker.439256b4.js";import{a as H}from"./asyncComputed.a4cc4ebe.js";import{r as U}from"./index.bdeb3c9e.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="f3643e6e-0ca6-4a9c-8eea-29cca3d05e79",o._sentryDebugIdIdentifier="sentry-dbid-f3643e6e-0ca6-4a9c-8eea-29cca3d05e79")}catch{}})();const z="forms_workspace_id_path_key",$="This path is already being used by another form or dash on your workspace",ae=R({__name:"FormSettings",props:{form:{}},setup(o){const e=y(o.form),m=[{label:"General",props:[{label:"Form name",valueKey:"title"}]},{label:"Welcome Screen",props:[{label:"Title",valueKey:"welcomeTitle"},{label:"Subtitle",valueKey:"startMessage"},{label:"Start button text",valueKey:"startButtonText"}]},{label:"Ending Screen",props:[{label:"Title",valueKey:"endMessage"},{label:"Restart button text",valueKey:"restartButtonText"}]},{label:"Alert Messages",props:[{label:"Error message",valueKey:"errorMessage"}]}],g=T({pathError:null,sectionsShown:[!0,!1,!1]}),v=l=>{l.detail.includes(z)&&(g.pathError=$)};return addEventListener("hasura-error",v),(l,u)=>(c(),f(a(L),{layout:"vertical"},{default:d(()=>[n(N,{runtime:e.value},null,8,["runtime"]),(c(),w(F,null,x(m,r=>K("div",{key:r.label},[n(a(P),{level:3},{default:d(()=>[B(E(r.label),1)]),_:2},1024),(c(!0),w(F,null,x(r.props,s=>(c(),f(a(b),{key:s.label,label:s.label},{default:d(()=>[n(a(I),{type:"text",value:e.value[s.valueKey],onChange:p=>e.value[s.valueKey]=p.target.value},null,8,["value","onChange"])]),_:2},1032,["label"]))),128))])),64)),n(a(b),{label:"Start smart form automatically"},{default:d(()=>[n(a(C),{checked:e.value.autoStart,"onUpdate:checked":u[0]||(u[0]=r=>e.value.autoStart=r)},null,8,["checked"])]),_:1}),n(a(b),{label:"Allow the user to restart the smart form after it is over"},{default:d(()=>[n(a(C),{checked:e.value.allowRestart,"onUpdate:checked":u[1]||(u[1]=r=>e.value.allowRestart=r)},null,8,["checked"])]),_:1})]),_:1}))}}),te=R({__name:"FormTester",props:{form:{},logService:{}},setup(o,{expose:i}){var h,k,_,S;const e=o,{result:m,loading:g}=H(()=>V.get()),v=y({}),l=A(()=>W.create({formPath:e.form.path}));(h=l.value)==null||h.on("stdout",t=>{e.logService.log({type:"stdout",log:t.log})}),(k=l.value)==null||k.on("stderr",t=>{e.logService.log({type:"stderr",log:t.log})}),(_=l.value)==null||_.onClose(()=>{e.logService.log({type:"stderr",log:"Program closed"})}),(S=l.value)==null||S.on("files:changed",()=>{e.logService.log({type:"files-changed",log:"Files changed"})});const u=D(),r=({path:t})=>{U("editor",u,t)},s=y(null);async function p(){var t;return e.logService.log({type:"restart"}),(t=s.value)==null?void 0:t.run()}return i({restart:p}),(t,j)=>a(g)||!a(m)?(c(),f(a(M),{key:0})):(c(),f(G,{key:1,ref_key:"runner",ref:s,form:t.form.makeRunnerData(a(m)),params:v.value,"is-preview":"","enable-auto-focus":"",broker:l.value,onNavigate:r,onLogout:p},null,8,["form","params","broker"]))}});export{te as _,ae as a};
//# sourceMappingURL=FormTester.vue_vue_type_script_setup_true_lang.f94aa34a.js.map
