import{aa as i,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{s as c}from"./machine.-tangy-colts-beg-869.js";import{h as m,c as r}from"./suitedas-tangy-colts-beg-185.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const C=i(({helpers:n})=>({states:{components:[r(n),{componentName:n.componentName.note,fieldType:"config",id:"note",note:["To get an audience ID in Suitedash, navigate to Marketing > Audiences. Then select your desired Audience ID."],render:"IF_CONNECTION_SELECTED"},{addItemButtonLabel:"Add Item",componentName:n.componentName.repeaterField,direction:"vertical",fieldsMetaData:[{componentName:n.componentName.mixInput,label:o("Email"),name:"email",required:!0,value:void 0},{componentName:n.componentName.mixInput,label:o("First Name"),name:"first_name",required:!0,value:void 0},{componentName:n.componentName.mixInput,label:o("Last Name"),name:"last_name",required:!0,value:void 0},{componentName:n.componentName.mixInput,label:o("Audiences ID"),name:"audiences",required:!0,value:void 0}],id:"subscribes-list",inputGroupProps:{label:o("Subscriber #{COUNT}")},label:o("Subscribe"),loading:!1,onChange:"ON_FIELD_MAP_CHANGE",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.connectionId=a})},IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},ON_FIELD_MAP_CHANGE:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.subscribes=a})},CONNECTION_ADD_CHANGE:m,ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"subscribes",id:"subscribes-list"}])}}}));export{C as default};
