import{b as i,i as m}from"./useflows-BpG3C9m1.js";import{e as a}from"./main-few-lands-burn.js";import{s as r,h as o}from"./machine.-BRuqPpdF.js";import{h as E,c as C,f as c,s as n,a as d}from"./mysqlcom-CIX_d5mm.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const l=["column-data","match-column"],b=i(({helpers:t})=>({states:{components:[d(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the table you want to update rows in."),id:"table-name",label:a("Table"),onChange:"SELECT_TABLE",onRefetch:"REFETCH_TABLES",optionFilterProp:"label",options:[],placeholder:a("Select a table"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.select,fieldType:"config",helperText:a("Rows where this column equals the match value will be updated."),id:"match-column",label:a("Match Column"),onChange:"SELECT_MATCH_COLUMN",optionFilterProp:"label",options:[],placeholder:a("Select a column"),render:"IF_TABLE_SELECTED",showSearch:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:a("Enter the value to match for updating rows."),id:"match-value",label:a("Match Value"),onChange:"SET_MATCH_VALUE",path:"matchValue",render:"IF_TABLE_SELECTED",required:!0,value:[]},{addItemButtonLabel:a("Add Column"),componentName:t.componentName.repeaterField,fieldsMetaData:[{componentName:t.componentName.select,label:a("Column"),name:"column",options:[],required:!0,showSearch:!0,style:{width:140},value:""},{componentName:t.componentName.mixInput,label:a("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"column-data",inputGroupProps:{label:a("Column #{COUNT}")},label:a("Columns to Update"),labelActionIconName:"refresh-cw",labelActionOnClick:"REFETCH_COLUMNS",labelActionText:a("Refetch Columns"),onChange:"SET_COLUMN_DATA",path:"columnData",render:"IF_TABLE_SELECTED",value:[],wrapperClassName:"mt-3"}]},actions:{...C,IF_CONNECTION_SELECTED:({$:e})=>m(e.getComponent("connection-id")?.value),IF_TABLE_SELECTED:({$:e})=>m(e.getComponent("table-name")?.value),REFETCH_COLUMNS:({$:e})=>n(e,l),REFETCH_TABLES:({$:e})=>c(e),SELECT_MATCH_COLUMN:o("matchColumn"),SET_COLUMN_DATA:o("columnData"),SET_CONNECTION:E,SET_MATCH_VALUE:o("matchValue"),SELECT_TABLE:({$:e,e:u})=>{o("tableName")({$:e,e:u}),n(e,l)},ON_MACHINE_LOAD:({$:e})=>{r(e,[{db:"connectionId",id:"connection-id"},{db:"tableName",id:"table-name"},{db:"matchColumn",id:"match-column"},{db:"matchValue",id:"match-value"},{db:"columnData",id:"column-data"}]),Promise.all([c(e),n(e,l)])}}}));export{b as default};
