import{aa as d,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as i}from"./main-tangy-colts-beg.js";import{h as n,s as E}from"./machine.-tangy-colts-beg-869.js";import{h as c,c as C}from"./commons.-tangy-colts-beg-359.js";import{f as t,b as l,h}from"./machineh-tangy-colts-beg-169.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const T=d(({helpers:o})=>({states:{components:[C(o),{componentName:o.componentName.mixInput,fieldType:"config",helperText:i("Select the file you want to upload to Google Drive."),id:"file-upload",label:i("File"),onChange:"SET_FILE_UPLOAD",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:o.componentName.mixInput,fieldType:"config",helperText:i("Enter the name for the uploaded file. If not specified, the original file name will be used."),id:"file-name",label:i("File Name"),onChange:"SET_FILE_NAME",render:"IF_CONNECTION_SELECTED",value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:i("Select the drive where to upload the file."),id:"drive-id",label:i("Parent Drive"),onChange:"SELECT_DRIVE",onRefetch:"REFETCH_DRIVES",options:[],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:i("Select the folder where to upload the file."),id:"folder-id",label:i("Parent Folder"),onChange:"SELECT_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{n("connectionId")({$:e,e:a}),await Promise.all([l(e),t(e)]),h(e,o)},CONNECTION_ADD_CHANGE:c,IF_CONNECTION_SELECTED:({$:e})=>{var a;return r((a=e.getComponent("connection-id"))==null?void 0:a.value)},REFETCH_DRIVES:({$:e})=>l(e),REFETCH_FOLDERS:({$:e})=>t(e),SELECT_DRIVE:n("driveId"),SELECT_FOLDER:n("folderId"),SET_FILE_NAME:n("fileName"),SET_FILE_UPLOAD:n("fileUpload"),ON_MACHINE_LOAD:async({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"fileUpload",id:"file-upload"},{db:"fileName",id:"file-name"},{db:"driveId",id:"drive-id"},{db:"folderId",id:"folder-id"}]),await Promise.all([l(e),t(e)])}}}));export{T as default};
