/*! phoscon-app 2024-02-26 */

const{Machine:Machine,actions:actions}=XState,{interpret:interpret}=XStateInterpreter,{choose:choose}=actions;export const getMachine=(views,constants,factorys)=>{const stateHandlerMap={overviewFactory:factorys.overviewHandlerFactory(views.overviewView,views.scheduleListView,views.navView,constants),emptyviewFactory:factorys.emptyHandlerFactory(views.emptyView,views.overviewView,views.scheduleListView,views.navView,constants),navviewFactory:factorys.navHandlerFactory(views.navView,constants),scheduleListviewFactory:factorys.scheduleListHandlerFactory(views.scheduleListView,views.overviewView,constants),sceneListviewFactory:factorys.sceneListHandlerFactory(views.sceneListView,views.overviewView,constants)};let machine=Machine({id:"scenesMachine",initial:"overview",states:{overview:{on:{OVERVIEW:"overview",EMPTY:"empty",SCHEDULE_SELECTED:{actions:["callScheduleListviewFactory"]},SCENE_SELECTED:{actions:["callSceneListviewFactory"]},GROUP_OFF:{actions:["callSceneListviewFactory"]},ADD_SCHEDULE:{actions:["callOverviewFactory"]},ACTIVATE_SCHEDULE:{actions:["callOverviewFactory"]},DEACTIVATE_SCHEDULE:{actions:["callOverviewFactory"]},WEEKDAY_CLICKED:{actions:["callOverviewFactory"]},TIMER_FINISHED:{actions:["callOverviewFactory"]},FADING_TIME_CHANGED:{actions:["callOverviewFactory"]},TIME_CHANGED:{actions:["callOverviewFactory"]},DELETE_CLICKED:{actions:["callOverviewFactory"]},RENAME_CLICKED:{actions:["callOverviewFactory"]},TOGGLE_FADING:{actions:["callOverviewFactory"]}},onEntry:["callOverviewFactory"],onExit:["callOverviewFactory"]},empty:{on:{OVERVIEW:"overview",EMPTY:"empty",ADD_SCHEDULE:{actions:["callEmptyviewFactory"]}},onEntry:["callEmptyviewFactory"],onExit:["callEmptyviewFactory"]}}},{actions:{callOverviewFactory:stateHandlerMap.overviewFactory,callEmptyviewFactory:stateHandlerMap.emptyviewFactory,callNavviewFactory:stateHandlerMap.navviewFactory,callScheduleListviewFactory:stateHandlerMap.scheduleListviewFactory,callSceneListviewFactory:stateHandlerMap.sceneListviewFactory}}),service=interpret(machine).onTransition(state=>{console.log("machine event: "+state.event.type)});return service.start(),{machine:machine,service:service}};