import{aa as E,ab as n}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as i,s as r}from"./machine.-tangy-colts-beg-869.js";import{f as l,b as c,h as s,c as d,d as C}from"./machineh-tangy-colts-beg-230.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 m=E(({helpers:a})=>({states:{components:[d(a),{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:o("Select your Airtable Base from the list."),id:"base-id",label:o("Select Base"),onChange:"SELECT_BASE",onRefetch:"REFETCH_BASES",optionFilterProp:"label",options:[],placeholder:o("Select Base"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:o("Select the table where you want to get a record."),id:"table-id",label:o("Select Table"),onChange:"SELECT_TABLE",onRefetch:"REFETCH_TABLES",optionFilterProp:"label",options:[],path:"table-id",render:"IF_BASE_ID_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:s,SELECT_BASE:({$:e,e:t})=>{i("baseId")({$:e,e:t}),l(e)},SELECT_TABLE:({$:e,e:t})=>{i("tableId")({$:e,e:t})},IF_BASE_ID_SELECTED:({$:e})=>{var t;return n((t=e.getComponent("base-id"))==null?void 0:t.value)},IF_CONNECTION_SELECTED:({$:e})=>{var t;return n((t=e.getComponent("connection-id"))==null?void 0:t.value)},IF_TABLE_SELECTED:({$:e})=>{var t;return n((t=e.getComponent("table-id"))==null?void 0:t.value)},ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"},{db:"baseId",id:"base-id"},{db:"tableId",id:"table-id"}]),await Promise.all([c(e),l(e)])},REFETCH_BASES:({$:e})=>c(e),REFETCH_TABLES:({$:e})=>l(e),SET_CONNECTION:({$:e,e:t})=>{i("connectionId")({$:e,e:t}),c(e),C(e,a)}}}));export{m as default};
