import{aa as d,ab as n}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as i,s}from"./machine.-tangy-colts-beg-869.js";import{h,f as E,a as r,i as c,c as C,d as _}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 L=d(({helpers:a})=>({states:{components:[_(a),{componentName:a.componentName.select,fieldType:"config",helperText:o("Select the portal where you want to create the tasklist."),id:"portal-id",label:o("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:o("Select the project where you want to create the tasklist."),id:"project-id",label:o("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:o("Enter the name for the tasklist."),id:"name",label:o("Name"),onChange:"SET_NAME",path:"name",render:"IF_CONNECTION_SELECTED",required:!0,value:[]},{componentName:a.componentName.select,helperText:o("Select the flag type for the tasklist."),id:"flag",label:o("Flag"),onChange:"SET_FLAG",options:[{label:o("Internal"),value:"internal"},{label:o("External"),value:"external"}],path:"flag",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:a.componentName.select,fieldType:"config",helperText:o("Select the milestone for the tasklist."),id:"milestone-id",label:o("Milestone ID"),onChange:"SET_MILESTONE_ID",onRefetch:"REFETCH_MILESTONE_LIST",options:[],path:"milestone_id",render:"IF_PROJECT_SELECTED",showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:C,IF_CONNECTION_SELECTED:({$:e})=>{var t;return n((t=e.getComponent("connection-id"))==null?void 0:t.value)},REFETCH_MILESTONE_LIST:({$:e})=>c(e),REFETCH_PORTAL_LIST:({$:e})=>r(e),REFETCH_PROJECT_LIST:({$:e})=>E(e),SET_DOMAIN:h,SET_FLAG:i("flag"),SET_MILESTONE_ID:i("milestoneId"),SET_NAME:i("name"),HANDLE_SELECT_PORTAL:({$:e,e:t})=>{i("portalId")({$:e,e:t}),E(e)},HANDLE_SELECT_PROJECT:({$:e,e:t})=>{i("projectId")({$:e,e:t}),c(e)},IF_PORTAL_SELECTED:({$:e})=>{var t,l;return n((t=e.getComponent("connection-id"))==null?void 0:t.value)&&n((l=e.getComponent("portal-id"))==null?void 0:l.value)},IF_PROJECT_SELECTED:({$:e})=>{var t,l,T;return n((t=e.getComponent("connection-id"))==null?void 0:t.value)&&n((l=e.getComponent("portal-id"))==null?void 0:l.value)&&n((T=e.getComponent("project-id"))==null?void 0:T.value)},SET_CONNECTION:({$:e,e:t})=>{i("connectionId")({$:e,e:t}),r(e)},ON_MACHINE_LOAD:async({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"portalId",id:"portal-id"},{db:"projectId",id:"project-id"},{db:"name",id:"name"},{db:"flag",id:"flag"},{db:"milestoneId",id:"milestone-id"}]),await Promise.all([r(e),E(e),c(e)])}}}));export{L as default};
