import{aa as s,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{s as m}from"./machine.-tangy-colts-beg-869.js";import{h as d,a as l,c as r,f as n}from"./machineh-tangy-colts-beg-396.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 h=s(({helpers:a})=>({states:{components:[r(a),{allowClear:!0,componentName:a.componentName.select,fieldType:"config",id:"list-id",isLoadable:!0,label:o("List ID"),onChange:"SET_LIST",onRefetch:"REFETCH_LIST",optionFilterProp:"label",options:[],placeholder:o("Select a List"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{addItemButtonLabel:"Add Email",componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.mixInput,label:o("Email"),name:"email",required:!0,value:void 0,wrapperClassName:"w-100"}],id:"email-list",inputGroupProps:{label:o("Email #{COUNT}")},label:o("Emails"),loading:!1,onChange:"ON_EMAIL_FIELD_CHANGE",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{e.setThisComponent(i=>{i.value=t}),e.setDb(i=>{i.connectionId=t}),await n(e)},IF_CONNECTION_SELECTED:({$:e})=>{var t;return c((t=e.getComponent("connection-id"))==null?void 0:t.value)},REFETCH_LIST:async({$:e})=>{await n(e)},SET_LIST:l("list"),ON_EMAIL_FIELD_CHANGE:l("emails"),CONNECTION_ADD_CHANGE:d,ON_MACHINE_LOAD:async({$:e})=>{var t;m(e,[{db:"connectionId",id:"connection-id"},{db:"list",id:"list-id"},{db:"emails",id:"email-list"}]),(t=e.db)!=null&&t.connectionId&&await n(e)}}}));export{h as default};
