import{aa as c,ab as i}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as a,s as m}from"./machine.-tangy-colts-beg-869.js";import{h as T,a as l,c as d}from"./flowluco-tangy-colts-beg-376.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,o){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,o),o)}};const C=c(({helpers:n})=>({states:{components:[d(n),{allowClear:!0,componentName:n.componentName.select,fieldType:"config",helperText:e("Select the account type."),id:"account-type-id",label:e("Account Type"),onChange:"SET_ACCOUNT_TYPE_ID",options:[{label:e("Organization"),value:1},{label:e("Contact"),value:2}],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the company name."),id:"name",label:e("Company Name"),onChange:"SET_NAME",render:"IF_ORGANIZATION_TYPE",required:!0,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the first name of the contact."),id:"first-name",label:e("First Name"),onChange:"SET_FIRST_NAME",render:"IF_CONTACT_TYPE",required:!1,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the last name of the contact."),id:"last-name",label:e("Last Name"),onChange:"SET_LAST_NAME",render:"IF_CONTACT_TYPE",required:!1,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the email address of the account."),id:"email",label:e("Email"),onChange:"SET_EMAIL",render:"IF_ACCOUNT_TYPE_SELECTED",required:!1,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the phone number of the account."),id:"phone",label:e("Phone"),onChange:"SET_PHONE",render:"IF_ACCOUNT_TYPE_SELECTED",required:!1,value:void 0},{componentName:n.componentName.mixInput,fieldType:"config",helperText:e("Enter the position/title of the contact."),id:"position",label:e("Position"),onChange:"SET_POSITION",render:"IF_CONTACT_TYPE",required:!1,value:void 0}]},actions:{ON_MACHINE_LOAD:({$:o})=>{m(o,[{db:"connectionId",id:"connection-id"},{db:"name",id:"name"},{db:"firstName",id:"first-name"},{db:"lastName",id:"last-name"},{db:"accountTypeId",id:"account-type-id"},{db:"email",id:"email"},{db:"phone",id:"phone"},{db:"position",id:"position"}])},CONNECTION_ADD_CHANGE:l,SET_DOMAIN:T,SET_CONNECTION:a("connectionId"),SET_NAME:a("name"),SET_FIRST_NAME:a("firstName"),SET_LAST_NAME:a("lastName"),SET_ACCOUNT_TYPE_ID:a("accountTypeId"),SET_EMAIL:a("email"),SET_PHONE:a("phone"),SET_POSITION:a("position"),IF_ACCOUNT_TYPE_SELECTED:({$:o})=>{var t;return i((t=o.getComponent("account-type-id"))==null?void 0:t.value)},IF_CONNECTION_SELECTED:({$:o})=>{var t;return i((t=o.getComponent("connection-id"))==null?void 0:t.value)},IF_CONTACT_TYPE:({$:o})=>{var t;return((t=o.getComponent("account-type-id"))==null?void 0:t.value)===2},IF_ORGANIZATION_TYPE:({$:o})=>{var t;return((t=o.getComponent("account-type-id"))==null?void 0:t.value)===1}}}));export{C as default};
