import{aa as d,ab as m}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as o,s}from"./machine.-tangy-colts-beg-869.js";import{h as c,c as r,s as u}from"./commonut-tangy-colts-beg-715.js";import{f as l,a as i}from"./machineh-tangy-colts-beg-435.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,t){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,t),t)}};const I=d(({helpers:a})=>({states:{components:[r(a),{componentName:a.componentName.mixInput,fieldType:"config",id:"id",label:e("Subscriber ID"),onChange:"HANDLE_ID",placeholder:e("Enter the subscriber ID"),render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:a.componentName.select,id:"lists",label:e("Select List"),mode:"multiple",onChange:"SELECT_LIST",onRefetch:"REFETCH_LISTS",options:[],path:"lists",render:"IF_CONNECTION_SELECTED",value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Field"),name:"newsletterField",options:u,required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-map",label:e("Subscriber Field Map"),nonRemovableRows:[],onChange:"HANDLE_FIELD_MAPPING",path:"field_map",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.select,id:"gender",label:e("Select Gender"),onChange:"SELECT_GENDER",options:[{label:e("Male"),value:"M"},{label:e("Female"),value:"F"},{label:e("Not specified"),value:"N"}],path:"gender",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.select,id:"status",label:e("Select Status"),onChange:"SELECT_STATUS",options:[{label:e("Confirmed"),value:"confirmed"},{label:e("Not Confirmed"),value:"not_confirmed"},{label:e("Unsubscribed"),value:"unsubscribed"},{label:e("Bounced"),value:"bounced"},{label:e("Complained"),value:"complained"}],path:"status",render:"IF_CONNECTION_SELECTED",value:void 0},{addItemButtonLabel:e("Add Field"),componentName:a.componentName.repeaterField,fieldsMetaData:[{componentName:a.componentName.select,label:e("Field"),name:"newsletterCustomField",options:[],required:!0,style:{width:150},value:""},{componentName:a.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"custom-field-map",label:e("Custom Field Map"),labelActionIconName:"refresh-custom-fields",labelActionOnClick:"REFETCH_CUSTOM_FIELDS",labelActionText:e("Refetch Custom Fields"),nonRemovableRows:[],onChange:"HANDLE_CUSTOM_FIELD_MAPPING",path:"customFieldMap",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{IF_CONNECTION_SELECTED:({$:t})=>{var n;return m((n=t.getComponent("connection-id"))==null?void 0:n.value)},CONNECTION_ADD_CHANGE:c,HANDLE_CUSTOM_FIELD_MAPPING:o("customFieldMap"),HANDLE_FIELD_MAPPING:o("fieldMap"),HANDLE_ID:o("id"),SELECT_GENDER:o("gender"),SELECT_LIST:o("lists"),SELECT_STATUS:o("status"),SET_CONNECTION:o("connectionId"),ON_MACHINE_LOAD:async({$:t})=>{s(t,[{db:"connectionId",id:"connection-id"},{db:"fieldMap",id:"field-map"},{db:"customFieldMap",id:"custom-field-map"},{db:"lists",id:"lists"},{db:"gender",id:"gender"},{db:"status",id:"status"},{db:"id",id:"id"}]),await Promise.all([i(t),l(t)])},REFETCH_LISTS:({$:t})=>{i(t)},REFETCH_CUSTOM_FIELDS:({$:t})=>{l(t)}}}));export{I as default};
