import{aa as s,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{s as E}from"./machine.-tangy-colts-beg-869.js";import{a as p,c as l}from"./commonut-tangy-colts-beg-402.js";import{f as r,a as i}from"./machineh-tangy-colts-beg-290.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};function h(n){return n==null||n===""}const R=s(({helpers:n})=>({states:{components:[l(n),{componentName:n.componentName.select,helperText:a("Select owner to get the repository"),id:"owner",label:a("Owner"),onChange:"SELECT_OWNER",onRefetch:"REFETCH_OWNER",optionFilterProp:"label",options:[],path:"owner",placeholder:a("Select Owner"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{componentName:n.componentName.select,helperText:a("Select the repository to get"),id:"repository",label:a("Repository"),onChange:"SELECT_REPOSITORY",onRefetch:"REFETCH_REPOSITORY",optionFilterProp:"label",options:[],path:"repository",placeholder:a("Select a Repository"),render:"IS_OWNER_SELECTED",showSearch:!0,value:void 0}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var o;return c((o=e.getComponent("connection-id"))==null?void 0:o.value)},IS_OWNER_SELECTED:({$:e})=>{var o;return!h((o=e.getComponent("owner"))==null?void 0:o.value)},ON_MACHINE_LOAD:async({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"ownerDb",id:"owner"},{db:"repositoryDb",id:"repository"}]),await Promise.all([r(e),i(e)])},REFETCH_OWNER:({$:e})=>i(e),REFETCH_REPOSITORY:({$:e})=>r(e),SELECT_OWNER:async({$:e,e:o})=>{e.setThisComponent(t=>{t.value=o}),e.setDb(t=>{t.ownerDb=o}),await r(e)},SELECT_REPOSITORY:async({$:e,e:o})=>{e.setThisComponent(t=>{t.value=o}),e.setDb(t=>{t.repositoryDb=o})},SET_CONNECTION:async({$:e,e:o})=>{e.setThisComponent(t=>{t.value=o}),e.setDb(t=>{t.connectionId=o}),await Promise.all([i(e),r(e)])},CONNECTION_ADD_CHANGE:p}}));export{R as default};
