import{aa as c,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{s as r}from"./machine.-tangy-colts-beg-869.js";import{a as i,b as l}from"./machineh-tangy-colts-beg-95.js";import{h as d,c as m}from"./notionco-tangy-colts-beg-866.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 u=c(({helpers:o})=>({states:{components:[m(o),{componentName:o.componentName.select,fieldType:"config",id:"database-id",label:n("Database"),onChange:"SELECT_DATABASE",onRefetch:"REFETCH_DATABASE",optionFilterProp:"label",options:[],placeholder:n("Select a Database"),render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{addItemButtonLabel:"Add Column",componentName:o.componentName.repeaterField,fieldsMetaData:[{componentName:o.componentName.select,label:n("Field"),name:"notionField",options:[],required:!0,showSearch:!0,style:{width:200},value:""},{componentName:o.componentName.mixInput,label:n("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-properties",label:n("Properties"),onChange:"ON_CHANGE_FIELD",path:"FieldProperties",render:"IF_DATABASE_ID_SELECTED",value:[]}]},actions:{IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},IF_DATABASE_ID_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("database-id"))==null?void 0:a.value)},ON_CHANGE_FIELD:({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.FieldProperties=a})},ON_MACHINE_LOAD:async({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"},{db:"databaseId",id:"database-id"},{db:"FieldProperties",id:"field-properties"}]),await i(e),await l(e)},REFETCH_DATABASE:async({$:e})=>{await i(e)},SELECT_DATABASE:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.databaseId=a}),await l(e)},SELECT_TITLE:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a.target.value}),e.setDb(t=>{t.titleId=a.target.value})},SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.connectionId=a}),await i(e)},CONNECTION_ADD_CHANGE:d}}));export{u as default};
