import{aa as m,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as o,s}from"./machine.-tangy-colts-beg-869.js";import{h as E,c}from"./googleca-tangy-colts-beg-652.js";import{a as i}from"./machineh-tangy-colts-beg-81.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const p=m(({helpers:t})=>({states:{components:[c(t),{componentName:t.componentName.switch,helperText:n("If enabled, returns all events from all calendars. Other filters will be ignored."),id:"returnAll",label:n("Return All"),onChange:"SET_RETURN_ALL",path:"returnAll",render:"IF_CONNECTION_SELECTED",size:"small",value:!1},{componentName:t.componentName.select,fieldType:"config",helperText:n("Select the calendar to retrieve events from."),id:"calendar-id",label:n("Select Calendar"),onChange:"HANDLE_SELECT_CALENDAR",onRefetch:"REFETCH_CALENDAR_LIST",options:[],path:"calendar-id",render:"IF_NOT_RETURN_ALL",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:n("Enter the start time for the time range (e.g., 2025-01-14T07:09:50.000Z). Leave empty to use current time."),id:"time-min",label:n("Start Time (After)"),onChange:"SET_TIME_MIN",path:"timeMin",render:"IF_NOT_RETURN_ALL",value:[]},{componentName:t.componentName.mixInput,helperText:n("Enter the end time for the time range (e.g., 2025-01-20T07:09:50.000Z). Leave empty to use one week from now."),id:"time-max",label:n("End Time (Before)"),onChange:"SET_TIME_MAX",path:"timeMax",render:"IF_NOT_RETURN_ALL",value:[]},{componentName:t.componentName.mixInput,helperText:n("Enter the maximum number of results to return."),id:"max-results",label:n("Max Results"),onChange:"SET_MAX_RESULTS",path:"maxResults",render:"IF_NOT_RETURN_ALL",value:[]},{componentName:t.componentName.switch,helperText:n("Whether to expand recurring events into instances and only return single one-off events."),id:"single-events",label:n("Single Events"),onChange:"SET_SINGLE_EVENTS",path:"singleEvents",render:"IF_NOT_RETURN_ALL",size:"small",value:!1}]},actions:{CONNECTION_ADD_CHANGE:E,HANDLE_SELECT_CALENDAR:o("calendarId"),IF_CONNECTION_SELECTED:({$:e})=>{var a;return l((a=e.getComponent("connection-id"))==null?void 0:a.value)},REFETCH_CALENDAR_LIST:({$:e})=>i(e),SET_MAX_RESULTS:o("maxResults"),SET_RETURN_ALL:o("returnAll"),SET_SINGLE_EVENTS:o("singleEvents"),SET_TIME_MAX:o("timeMax"),SET_TIME_MIN:o("timeMin"),IF_NOT_RETURN_ALL:({$:e})=>{var a,r;return l((a=e.getComponent("connection-id"))==null?void 0:a.value)&&((r=e.getComponent("returnAll"))==null?void 0:r.value)===!1},SET_CONNECTION:async({$:e,e:a})=>{o("connectionId")({$:e,e:a}),await i(e)},ON_MACHINE_LOAD:async({$:e})=>{s(e,[{db:"connectionId",id:"connection-id"},{db:"calendarId",id:"calendar-id"},{db:"timeMin",id:"time-min"},{db:"returnAll",id:"returnAll"},{db:"timeMax",id:"time-max"},{db:"maxResults",id:"max-results"},{db:"singleEvents",id:"single-events"}]),await i(e)}}}));export{p as default};
