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 i,s as r}from"./machine.-tangy-colts-beg-869.js";import{h as l,a as C,c as b,u}from"./commonut-tangy-colts-beg-567.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const p=c(({helpers:e})=>({states:{components:[b(e),{componentName:e.componentName.mixInput,helperText:o("Enter contact ID, to subscribe or unsubscribe from the contact list"),id:"contact-id",label:o("Contact ID"),onChange:"HANDLE_CONTACT_ID",path:"contact",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.mixInput,helperText:o("Enter automation ID, to subscribe or unsubscribe from the contact list"),id:"list-id",label:o("List ID"),onChange:"HANDLE_LIST_ID",path:"list",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:e.componentName.select,helperText:o("Choose the action for subscribe or unsubscribe"),id:"action-type",label:o("Action"),onChange:"SELECT_ACTION",options:[{label:o("Subscribe"),value:"subscribe"},{label:o("Unsubscribe"),value:"unsubscribe"}],path:"action-type",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:C,IF_CONNECTION_SELECTED:({$:t})=>{var n;return s((n=t.getComponent("connection-id"))==null?void 0:n.value)},ON_MACHINE_LOAD:({$:t})=>{r(t,[{db:"connectionId",id:"connection-id"},{db:"urlDb",id:"url"},{db:"contactId",id:"contact-id"},{db:"listId",id:"list-id"},{db:"actionType",id:"action-type"}]),u({$:t})},SET_CONNECTION:async({$:t,e:n})=>{t.setThisComponent(a=>{a.value=n}),t.setDb(a=>{a.connectionId=n,a.urlDb=""})},HANDLE_CONTACT_ID:i("contactId"),HANDLE_LIST_ID:i("listId"),HANDLE_URL:l,SELECT_ACTION:i("actionType")}}));export{p as default};
