import{aa as r,ab as E}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as n,s as d}from"./machine.-tangy-colts-beg-869.js";import{h as T,a as C,c as l}from"./flowluco-tangy-colts-beg-376.js";import{f as i,a as c,b as p}from"./machineh-tangy-colts-beg-571.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const h=r(({helpers:o})=>({states:{components:[l(o),{componentName:o.componentName.mixInput,fieldType:"config",helperText:t("Enter the name of the opportunity."),id:"opportunity-name",label:t("Opportunity Name"),onChange:"SET_OPPORTUNITY_NAME",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:o.componentName.mixInput,fieldType:"config",helperText:t("Enter the opportunity ID to update."),id:"opportunity-id",label:t("Opportunity ID"),onChange:"SET_OPPORTUNITY_ID",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:t("Select the company for this opportunity."),id:"account-id",label:t("Select Company"),onChange:"SELECT_COMPANY",onRefetch:"REFETCH_COMPANIES",options:[],render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:t("Select the contact for this opportunity."),id:"contact-id",label:t("Select Contact"),onChange:"SELECT_CONTACT",onRefetch:"REFETCH_CONTACTS",options:[],render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:t("Select the stage for this opportunity."),id:"stage-id",label:t("Select Stage"),onChange:"SELECT_STAGE",onRefetch:"REFETCH_STAGES",options:[],render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{componentName:o.componentName.mixInput,fieldType:"config",helperText:t("Enter the amount/value of the opportunity."),id:"amount",label:t("Amount"),onChange:"SET_AMOUNT",render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{componentName:o.componentName.mixInput,fieldType:"config",helperText:t("Enter the description of the opportunity."),id:"description",label:t("Description"),onChange:"SET_DESCRIPTION",render:"IF_CONNECTION_SELECTED",required:!1,value:void 0}]},actions:{ON_MACHINE_LOAD:async({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"opportunityId",id:"opportunity-id"},{db:"opportunityName",id:"opportunity-name"},{db:"accountId",id:"account-id"},{db:"contactId",id:"contact-id"},{db:"stageId",id:"stage-id"},{db:"amount",id:"amount"},{db:"description",id:"description"}]),await Promise.all([p(e),c(e),i(e)])},CONNECTION_ADD_CHANGE:C,SET_DOMAIN:T,SET_CONNECTION:async({$:e,e:a})=>{n("connectionId")({$:e,e:a}),await Promise.all([p(e),c(e),i(e)])},SET_OPPORTUNITY_ID:n("opportunityId"),SET_OPPORTUNITY_NAME:n("opportunityName"),SELECT_COMPANY:n("accountId"),SELECT_CONTACT:n("contactId"),SELECT_STAGE:n("stageId"),SET_AMOUNT:n("amount"),SET_DESCRIPTION:n("description"),REFETCH_COMPANIES:({$:e})=>p(e),REFETCH_CONTACTS:({$:e})=>c(e),REFETCH_STAGES:({$:e})=>i(e),IF_CONNECTION_SELECTED:({$:e})=>{var a;return E((a=e.getComponent("connection-id"))==null?void 0:a.value)}}}));export{h as default};
