import{aa as C,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{s as l}from"./machine.-tangy-colts-beg-869.js";import{a as c}from"./machineh-tangy-colts-beg-587.js";import{h as s,c as T}from"./suitedas-tangy-colts-beg-185.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=C(({helpers:a})=>({states:{components:[T(a),{componentName:a.componentName.select,fieldType:"config",id:"chose-contact-id",label:n("Chose Contacts"),onChange:"CONTACTS",optionFilterProp:"label",options:[{label:n("Get all Contact"),value:"getAllContact"},{label:n("Get Specific Contact"),value:"getSpecificContact"}],placeholder:n("Chose contact type"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,style:{width:180},value:"getAllContact"},{componentName:a.componentName.mixInput,fieldType:"config",helperText:n("Page number must be a numeric value."),id:"page-number",label:n("Page Number"),onChange:"SET_PAGE_NUMBER",render:"IF_ALL_CONTACT_SELECTED",value:[]},{componentName:a.componentName.select,fieldType:"config",id:"contact-id",isLoadable:!0,label:n("Select Contact"),onChange:"SET_CONTACT",onLoadData:"ON_LOAD_CONTACT_DATA",onRefetch:"REFETCH_CAMPAIGN_LIST",optionFilterProp:"label",options:[],placeholder:n("Select a Contact"),render:"IF_CONTACT_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.connectionId=t}),await c(e)},IF_CONNECTION_SELECTED:({$:e})=>{var t;return i((t=e.getComponent("connection-id"))==null?void 0:t.value)},IF_CONTACT_SELECTED:({$:e})=>{var t;return((t=e.getComponent("chose-contact-id"))==null?void 0:t.value)==="getSpecificContact"},IF_ALL_CONTACT_SELECTED:({$:e})=>{var t,o;if(((t=e.getComponent("chose-contact-id"))==null?void 0:t.value)==="getAllContact"&&i((o=e.getComponent("connection-id"))==null?void 0:o.value))return!0},REFETCH_CAMPAIGN_LIST:async({$:e})=>{await c(e)},SET_CONTACT:({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.contactId=t})},CONTACTS:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.addTo=t}),await c(e)},SET_PAGE_NUMBER:async({$:e,e:t})=>{e.setThisComponent(o=>{o.value=t}),e.setDb(o=>{o.pageNumber=t})},ON_LOAD_CONTACT_DATA:async({$:e,e:t})=>{await c(e,t.count+1)},CONNECTION_ADD_CHANGE:s,ON_MACHINE_LOAD:async({$:e})=>{l(e,[{db:"connectionId",id:"connection-id"},{db:"contactId",id:"contact-id"},{db:"choseContactId",id:"chose-contact-id"},{db:"pageNumber",id:"page-number"}])}}}));export{h as default};
