import{b as l,i as r}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s,h as n}from"./machine.-BRuqPpdF.js";import{h,c as S}from"./commons.-bP-saOXM.js";import{f as a,a as i}from"./machineh-5vGV0ecU.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const D=l(({helpers:o})=>({states:{components:[S(o),{allowClear:!0,componentName:o.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:o.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},{componentName:o.componentName.mixInput,helperText:t("The row ID (number) to get from the sheet."),id:"row-id",label:t("Row ID"),onChange:"HANDLE_ROW_ID",path:"rowId",render:"IF_SHEET_SELECTED",required:!0,value:[]}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_ROW_ID:n("rowId"),HANDLE_SHEET:n("sheetTitle"),IF_CONNECTION_SELECTED:({$:e})=>r(e.getComponent("connection-id")?.value),IF_SHEET_SELECTED:({$:e})=>r(e.getComponent("sheet-title")?.value),IF_SPREADSHEET_SELECTED:({$:e})=>r(e.getComponent("spreadsheet-id")?.value),REFETCH_SHEETS:({$:e})=>i(e),REFETCH_SPREADSHEETS:({$:e})=>a(e),SET_CONNECTION:({$:e,e:E})=>{n("connectionId")({$:e,e:E}),a(e)},HANDLE_SPREADSHEET:({$:e,e:E})=>{n("spreadsheetId")({$:e,e:E}),e.setComponent("sheet-title",d=>{d.value=void 0}),i(e)},ON_MACHINE_LOAD:({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"spreadsheetId",id:"spreadsheet-id"},{db:"sheetTitle",id:"sheet-title"},{db:"rowId",id:"row-id"}]),Promise.all([a(e),i(e)])}}}));export{D as default};
