import{b as a,i as m}from"./useflows-BpG3C9m1.js";import{s as r,e as s}from"./main-few-lands-burn.js";import{s as l}from"./machine.-BRuqPpdF.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const c=async()=>r("bit-form/get-forms"),i=async t=>{t.setComponent("form-id",e=>{e.loading=!0});const{data:o,status:n}=await c();if(n==="error"){t.setComponent("form-id",e=>{t.util.isSelectComponent(e)&&(e.status=n,e.loading=!1,e.invalidMessage=o)});return}t.setComponent("form-id",e=>{t.util.isSelectComponent(e)&&(e.options=o,e.loading=!1,e.status=void 0)})},F=a(({helpers:t})=>({states:{components:[{componentName:t.componentName.select,fieldType:"config",id:"form-id",label:s("Forms"),onChange:"SELECT_FORM",onRefetch:"REFETCH_FORMS",optionFilterProp:"label",options:[],placeholder:s("Select a form"),render:!0,showSearch:!0,value:void 0},{componentName:t.componentName.hookListener,fieldType:"config",id:"hook-listener",label:s("Listen Hook"),render:({$:o})=>m(o.getComponent("form-id")?.value)}]},actions:{ON_MACHINE_LOAD:async({$:o})=>{l(o,[{db:"formId",id:"form-id"}]),await i(o)},REFETCH_FORMS:async({$:o})=>i(o),SELECT_FORM:async({$:o,e:n})=>{o.setThisComponent(e=>{e.value=n}),o.setDb({formId:n})}}}));export{F as default};
