import{b as l,i}from"./useflows-BpG3C9m1.js";import{e as t}from"./main-few-lands-burn.js";import{s as d,h as n}from"./machine.-BRuqPpdF.js";import{h,c as S}from"./commons.-bP-saOXM.js";import{f as s,a}from"./machineh-5vGV0ecU.js";import"./mutative-C6xjlr6O.js";import"./lodash-YpNkAOPN.js";const N=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.switch,fieldType:"config",helperText:t("If the first row contains headers, they will be preserved when clearing."),id:"is-first-row-headers",label:t("Is First Row Headers?"),onChange:"HANDLE_IS_FIRST_ROW_HEADERS",path:"isFirstRowHeaders",render:"IF_SHEET_SELECTED",size:"small",value:!1}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_IS_FIRST_ROW_HEADERS:n("isFirstRowHeaders"),HANDLE_SHEET:n("sheetTitle"),IF_CONNECTION_SELECTED:({$:e})=>i(e.getComponent("connection-id")?.value),IF_SHEET_SELECTED:({$:e})=>i(e.getComponent("sheet-title")?.value),IF_SPREADSHEET_SELECTED:({$:e})=>i(e.getComponent("spreadsheet-id")?.value),REFETCH_SHEETS:({$:e})=>a(e),REFETCH_SPREADSHEETS:({$:e})=>s(e),SET_CONNECTION:({$:e,e:E})=>{n("connectionId")({$:e,e:E}),s(e)},HANDLE_SPREADSHEET:({$:e,e:E})=>{n("spreadsheetId")({$:e,e:E}),e.setComponent("sheet-title",r=>{r.value=void 0}),a(e)},ON_MACHINE_LOAD:({$:e})=>{d(e,[{db:"connectionId",id:"connection-id"},{db:"spreadsheetId",id:"spreadsheet-id"},{db:"sheetTitle",id:"sheet-title"},{db:"isFirstRowHeaders",id:"is-first-row-headers"}]),Promise.all([s(e),a(e)])}}}));export{N as default};
