import{aa as r,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as E,s as T}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as _}from"./googleca-tangy-colts-beg-652.js";import{f as c,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(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const p=r(({helpers:n})=>({states:{components:[_(n),{componentName:n.componentName.select,fieldType:"config",helperText:o("Select the calendar you want to retrieve events from. Only events from this calendar will be listed."),id:"calendar-id",label:o("Select Calendar"),onChange:"HANDLE_SELECT_CALENDAR",onRefetch:"REFETCH_CALENDAR_LIST",options:[],path:"calendar-id",render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:n.componentName.switch,fieldType:"config",helperText:o("Turn on to select any event from the calendar."),id:"select-event-toggle",label:o("Turn on to select any event from it"),onChange:"SET_SELECT_EVENT_TOGGLE",render:"IF_CONNECTION_SELECTED",size:"small",value:!1},{componentName:n.componentName.mixInput,helperText:o("Enter the event ID to retrieve."),id:"event-id",label:o("Event ID"),onChange:"SET_EVENT_ID",path:"eventMixInputId",render:"IF_EVENT_SELECTOR_NOT_SELECTED",required:!0,value:[]},{componentName:n.componentName.select,helperText:o("Select an event from the calendar."),id:"event-select",label:o("Select Event"),onChange:"HANDLE_SELECT_EVENT",onRefetch:"REFETCH_EVENTS_LIST",optionFilterProp:"label",options:[],path:"eventSelectorId",render:"IF_EVENT_SELECTOR_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:d,HANDLE_SELECT_EVENT:E("eventSelectorId"),IF_CONNECTION_SELECTED:({$:e})=>{var t;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)},REFETCH_CALENDAR_LIST:({$:e})=>i(e),REFETCH_EVENTS_LIST:({$:e})=>c(e),SET_EVENT_ID:E("eventMixInputId"),SET_SELECT_EVENT_TOGGLE:E("selectEventToggle"),IF_EVENT_SELECTOR_SELECTED:({$:e})=>{var t,a;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)&&((a=e.getComponent("select-event-toggle"))==null?void 0:a.value)===!0},IF_EVENT_SELECTOR_NOT_SELECTED:({$:e})=>{var t,a;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)&&((a=e.getComponent("select-event-toggle"))==null?void 0:a.value)===!1},SET_CONNECTION:async({$:e,e:t})=>{E("connectionId")({$:e,e:t}),await i(e)},HANDLE_SELECT_CALENDAR:async({$:e,e:t})=>{E("calendarId")({$:e,e:t}),await c(e)},ON_MACHINE_LOAD:async({$:e})=>{T(e,[{db:"connectionId",id:"connection-id"},{db:"calendarId",id:"calendar-id"},{db:"eventMixInputId",id:"event-id"},{db:"eventSelectorId",id:"event-select"},{db:"selectEventToggle",id:"select-event-toggle"}]),await Promise.all([i(e),c(e)])}}}));export{p as default};
