import{b as m,i as o}from"./useflows-BpG3C9m1.js";import{e}from"./main-few-lands-burn.js";import{s as l,h as n}from"./machine.-BRuqPpdF.js";import{h as i,c as E,f as r,a as p}from"./mysqlcom-CIX_d5mm.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const C=m(({helpers:t})=>({states:{components:[p(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:e("Select the table you want to query."),id:"table-name",label:e("Table"),onChange:"SELECT_TABLE",onRefetch:"REFETCH_TABLES",optionFilterProp:"label",options:[],placeholder:e("Select a table"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:e("Optional. SQL WHERE clause without the WHERE keyword, e.g. status = ? AND age > ?"),id:"where",label:e("Where Condition"),onChange:"SET_WHERE",path:"where",render:"IF_TABLE_SELECTED",value:[]},{addItemButtonLabel:e("Add Parameter"),componentName:t.componentName.repeaterField,fieldsMetaData:[{componentName:t.componentName.mixInput,label:e("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],helperText:e("Bound to ? placeholders in the where condition, in order."),id:"where-params",inputGroupProps:{label:e("Parameter #{COUNT}")},label:e("Where Parameters"),onChange:"SET_WHERE_PARAMS",path:"whereParams",render:"IF_TABLE_SELECTED",value:[],wrapperClassName:"mt-3"},{componentName:t.componentName.mixInput,helperText:e("Optional. Maximum number of rows to return."),id:"limit",label:e("Limit"),onChange:"SET_LIMIT",path:"limit",render:"IF_TABLE_SELECTED",value:[]}]},actions:{...E,IF_CONNECTION_SELECTED:({$:a})=>o(a.getComponent("connection-id")?.value),IF_TABLE_SELECTED:({$:a})=>o(a.getComponent("table-name")?.value),REFETCH_TABLES:({$:a})=>r(a),SELECT_TABLE:n("tableName"),SET_CONNECTION:i,SET_LIMIT:n("limit"),SET_WHERE:n("where"),SET_WHERE_PARAMS:n("whereParams"),ON_MACHINE_LOAD:({$:a})=>{l(a,[{db:"connectionId",id:"connection-id"},{db:"tableName",id:"table-name"},{db:"where",id:"where"},{db:"whereParams",id:"where-params"},{db:"limit",id:"limit"}]),r(a)}}}));export{C as default};
