import{aa as r,ab as C}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as n,s as l}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as E}from"./gohighle-tangy-colts-beg-43.js";import{d as c,b as i}from"./machineh-tangy-colts-beg-622.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const f=r(({helpers:e})=>({states:{components:[E(e),{componentName:e.componentName.select,fieldType:"config",helperText:a("Select the contact to add to the workflow."),id:"contact-id",label:a("Select Contact"),onChange:"HANDLE_SELECT_CONTACT",onRefetch:"REFETCH_CONTACT_LIST",options:[],path:"contactId",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:e.componentName.select,fieldType:"config",helperText:a("Select the workflow to add the contact to."),id:"workflow-id",label:a("Select Workflow"),onChange:"HANDLE_SELECT_WORKFLOW",onRefetch:"REFETCH_WORKFLOW_LIST",options:[],path:"workflowId",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:d,HANDLE_SELECT_CONTACT:n("contactId"),HANDLE_SELECT_WORKFLOW:n("workflowId"),IF_CONNECTION_SELECTED:({$:o})=>{var t;return C((t=o.getComponent("connection-id"))==null?void 0:t.value)},REFETCH_CONTACT_LIST:({$:o})=>i(o),REFETCH_WORKFLOW_LIST:({$:o})=>c(o),SET_CONNECTION:async({$:o,e:t})=>{n("connectionId")({$:o,e:t}),await Promise.all([i(o),c(o)])},ON_MACHINE_LOAD:async({$:o})=>{l(o,[{db:"connectionId",id:"connection-id"},{db:"contactId",id:"contact-id"},{db:"workflowId",id:"workflow-id"}]),await Promise.all([i(o),c(o)])}}}));export{f as default};
