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