import{aa as T,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as n,s as c}from"./machine.-tangy-colts-beg-869.js";import{h as _,f as l,a as E,b as i,c as h,d as m}from"./zohoproj-tangy-colts-beg-65.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 S=T(({helpers:a})=>({states:{components:[m(a),{componentName:a.componentName.select,fieldType:"config",helperText:t("Select the portal where you want to create the milestone."),id:"portal-id",label:t("Portal ID"),onChange:"HANDLE_SELECT_PORTAL",onRefetch:"REFETCH_PORTAL_LIST",options:[],path:"portal-id",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:a.componentName.select,fieldType:"config",helperText:t("Select the project where you want to create the milestone."),id:"project-id",label:t("Project ID"),onChange:"HANDLE_SELECT_PROJECT",onRefetch:"REFETCH_PROJECT_LIST",options:[],path:"project-id",render:"IF_PORTAL_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:t("Enter the title for the milestone."),id:"title",label:t("Title"),onChange:"SET_TITLE",path:"name",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:a.componentName.mixInput,helperText:t("Enter the milestone start date in MM-DD-YYYY format (e.g., 12-20-2025)."),id:"start-date",label:t("Start Date"),onChange:"SET_START_DATE",path:"start_date",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:t("Enter the milestone end date in MM-DD-YYYY format (e.g., 12-31-2025)."),id:"end-date",label:t("End Date"),onChange:"SET_END_DATE",path:"end_date",render:"IF_CONNECTION_SELECTED",value:[]},{allowClear:!0,componentName:a.componentName.select,helperText:t("Select the owner of the milestone."),id:"owner-id",label:t("Owner ID"),onChange:"SET_OWNER_ID",onRefetch:"REFETCH_OWNER_LIST",options:[],path:"owner_zpuid",render:"IF_PORTAL_SELECTED",showSearch:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,helperText:t("Select the flag type for the milestone."),id:"flag",label:t("Flag"),onChange:"SET_FLAG",options:[{label:t("Internal"),value:"internal"},{label:t("External"),value:"external"}],path:"flag",render:"IF_CONNECTION_SELECTED",value:void 0}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_SELECT_PROJECT:n("projectId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("connection-id"))==null?void 0:o.value)},REFETCH_OWNER_LIST:({$:e})=>i(e),REFETCH_PORTAL_LIST:({$:e})=>E(e),REFETCH_PROJECT_LIST:({$:e})=>l(e),SET_DOMAIN:_,SET_END_DATE:n("endDate"),SET_FLAG:n("flag"),SET_OWNER_ID:n("ownerId"),SET_START_DATE:n("startDate"),SET_TITLE:n("title"),HANDLE_SELECT_PORTAL:async({$:e,e:o})=>{n("portalId")({$:e,e:o}),await Promise.all([l(e),i(e)])},IF_PORTAL_SELECTED:({$:e})=>{var o,d;return r((o=e.getComponent("connection-id"))==null?void 0:o.value)&&r((d=e.getComponent("portal-id"))==null?void 0:d.value)},SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),E(e)},ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"portalId",id:"portal-id"},{db:"projectId",id:"project-id"},{db:"title",id:"title"},{db:"startDate",id:"start-date"},{db:"endDate",id:"end-date"},{db:"ownerId",id:"owner-id"},{db:"flag",id:"flag"}]),await Promise.all([l(e),i(e),E(e)])}}}));export{S as default};
