/*! phoscon-app 2023-07-31 */

import*as sceneFunctions from"./scene-functions.js";export var emptyHandlerFactory=(view,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.states.EMPTY?view.show():type===c.events.ADD_SCENE?sceneFunctions.addScene():view.hide()};export var overviewHandlerFactory=(view,sceneListView,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.states.OVERVIEW?(app.currentSite="SCENE_LIGHTS",view.show()):type===c.states.INIT?screenMin(SCREEN_MIN_WIDTH_TABLET_PORTRAIT)&&view.show():type===c.events.BULB_CLICKED?sceneFunctions.toggleLight(event.model):type===c.events.DELETE_CLICKED?sceneFunctions.deleteScene(view,sceneListView,constants):type===c.events.ADD_SCENE?sceneFunctions.addScene():type===c.events.EDIT_SCENE_CLICKED?event.view.openScene(sceneListView):view.hide()};export var settingsHandlerFactory=(view,navView,listView,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.states.SETTINGS?(app.currentSite="SCENE_SETTINGS",view.show()):type===c.events.FADING_TIME_CHANGED?sceneFunctions.fadingTimeChanged(view,navView,event.event,constants):type===c.events.DELETE_CLICKED?sceneFunctions.deleteScene(listView):type===c.events.ADD_SCENE?sceneFunctions.addScene():view.hide()};export var navHandlerFactory=(view,settingsView,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.events.SAVE_CLICKED?sceneFunctions.saveScene(view,null,constants):type===c.events.SET_SCENE_STATE_IDLE?sceneFunctions.setSceneStateIdle(view,settingsView,constants):type===c.events.SCENE_CHANGED&&sceneFunctions.sceneChanged(view,constants)};export var sceneListHandlerFactory=(view,settingsView,constants)=>(ctx,event)=>{let c=constants;event.type===c.events.SCENE_SELECTED&&sceneFunctions.setActiveScene(view,settingsView,constants)};