import{b as m,i as E}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s as h,h as o}from"./machine.-BRuqPpdF.js";import{h as d,c}from"./commons.-bP-saOXM.js";import{f as r,a as l,b as i}from"./machineh-5vGV0ecU.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const H=m(({helpers:a})=>({states:{components:[c(a),{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("Select the spreadsheet."),id:"spreadsheet-id",label:t("Spreadsheet"),onChange:"HANDLE_SPREADSHEET",onRefetch:"REFETCH_SPREADSHEETS",optionFilterProp:"label",options:[],render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("Select the sheet."),id:"sheet-title",label:t("Sheet"),onChange:"HANDLE_SHEET",onRefetch:"REFETCH_SHEETS",optionFilterProp:"label",options:[],render:"IF_SPREADSHEET_SELECTED",required:!0,showSearch:!0,value:void 0},{allowClear:!0,componentName:a.componentName.select,fieldType:"config",helperText:t("The column to search in."),id:"column-name",label:t("Column Name"),onChange:"HANDLE_COLUMN_NAME",onRefetch:"REFETCH_HEADER_ROWS",optionFilterProp:"label",options:[],render:"IF_SHEET_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:t("The value to search for. Leave empty to return all rows."),id:"search-value",label:t("Search Value"),onChange:"HANDLE_SEARCH_VALUE",path:"searchValue",render:"IF_SHEET_SELECTED",required:!1,value:[]},{componentName:a.componentName.switch,helperText:t("If enabled, only an exact match will be returned."),id:"match-case",label:t("Exact Match?"),onChange:"HANDLE_MATCH_CASE",path:"matchCase",render:"IF_SHEET_SELECTED",size:"small",value:!1},{componentName:a.componentName.mixInput,helperText:t("The row number to start searching from."),id:"starting-row",label:t("Starting Row"),onChange:"HANDLE_STARTING_ROW",path:"startingRow",render:"IF_SHEET_SELECTED",required:!1,value:[]},{componentName:a.componentName.mixInput,helperText:t("The number of rows to return (default is 1)."),id:"number-of-rows",label:t("Number of Rows"),onChange:"HANDLE_NUMBER_OF_ROWS",path:"numberOfRows",render:"IF_SHEET_SELECTED",required:!1,value:[]},{componentName:a.componentName.mixInput,helperText:t("Which row contains the headers? (Default is 1)"),id:"header-row",label:t("Header Row"),onChange:"HANDLE_HEADER_ROW",path:"headerRow",render:"IF_SHEET_SELECTED",required:!1,value:[]}]},actions:{CONNECTION_ADD_CHANGE:d,HANDLE_COLUMN_NAME:o("columnName"),HANDLE_EXACT_MATCH:o("matchCase"),HANDLE_HEADER_ROW:o("headerRow"),HANDLE_MATCH_CASE:o("matchCase"),HANDLE_NUMBER_OF_ROWS:o("numberOfRows"),HANDLE_SEARCH_VALUE:o("searchValue"),HANDLE_STARTING_ROW:o("startingRow"),IF_CONNECTION_SELECTED:({$:e})=>E(e.getComponent("connection-id")?.value),IF_SHEET_SELECTED:({$:e})=>E(e.getComponent("sheet-title")?.value),IF_SPREADSHEET_SELECTED:({$:e})=>E(e.getComponent("spreadsheet-id")?.value),REFETCH_HEADER_ROWS:({$:e})=>i(e),REFETCH_SHEETS:({$:e})=>l(e),REFETCH_SPREADSHEETS:({$:e})=>r(e),SET_CONNECTION:({$:e,e:n})=>{o("connectionId")({$:e,e:n}),r(e)},HANDLE_SPREADSHEET:({$:e,e:n})=>{o("spreadsheetId")({$:e,e:n}),e.setComponent("sheet-title",s=>{s.value=void 0}),l(e)},HANDLE_SHEET:({$:e,e:n})=>{o("sheetTitle")({$:e,e:n}),i(e)},ON_MACHINE_LOAD:({$:e})=>{h(e,[{db:"connectionId",id:"connection-id"},{db:"spreadsheetId",id:"spreadsheet-id"},{db:"sheetTitle",id:"sheet-title"},{db:"columnName",id:"column-name"},{db:"searchValue",id:"search-value"},{db:"matchCase",id:"match-case"},{db:"startingRow",id:"starting-row"},{db:"numberOfRows",id:"number-of-rows"},{db:"headerRow",id:"header-row"}]),Promise.all([r(e),l(e),i(e)])}}}));export{H as default};
