/*! phoscon-app 2025-10-13 */

import{initIkeaPages}from"./ikea/map-ikea.js";import{initIkeaLengthPages}from"./ikea/map-ikea-length.js";import{initAqaraLengthPages}from"./aqara/map-aqara-length.js";import{initBlindSwitchEditorPages}from"./map-blind-switch-editor.js";export function initPages(pageParams){let c=pageParams.constants,s=pageParams.scanStates,ikeaPages=initIkeaPages(pageParams),ikeaLengthPages=initIkeaLengthPages(pageParams),aqaraLengthPages=initAqaraLengthPages(pageParams),blindSwitchEditorPages=initBlindSwitchEditorPages(pageParams);return[{id:c.PAGE_INIT,url:"",eventHandler:[{event:c.BTN_ADD_BLIND_PRESSED,actions:[{type:s.START_SCAN,data:180},{type:s.SHOW_PROGRESS}]},{event:c.BTN_STOP_BLIND_PRESSED,actions:[{type:s.STOP_SCAN},{type:s.HIDE_PROGRESS}]},{event:"DEVICE_UPDATED",actions:[{type:c.UPDATE_VIEW,data:"overview"}]},{event:"BTN_UP_PRESSED",actions:[{type:c.CALL_FUNC,data:"slideBlindUp"}]},{event:"BTN_DOWN_PRESSED",actions:[{type:c.CALL_FUNC,data:"slideBlindDown"}]},{event:"BTN_ASSIGN_SWITCH_PRESSED",actions:[{type:c.OPEN_MODAL,data:"blindWizardModal"},{type:c.CALL_PAGE,data:"CHOSE_SWITCH"},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.DANGER}},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.SUCCESS}}]},{event:"BTN_BLIND_LENGTH_PRESSED_IKEA",actions:[{type:c.OPEN_MODAL,data:"blindWizardModal"},{type:c.CALL_PAGE,data:"IKEA_LENGTH_PAGE_RESET"},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.DANGER}},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.SUCCESS}}]},{event:"BTN_BLIND_LENGTH_PRESSED_AQARA",actions:[{type:c.OPEN_MODAL,data:"blindWizardModal"},{type:c.CALL_PAGE,data:"AQARA_LENGTH_PAGE_RESET"},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.DANGER}},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.SUCCESS}}]},{event:c.BTN_CLOSE_PRESSED,actions:[{type:s.STOP_SCAN},{type:c.CLOSE_MODAL,data:"blindWizardModal"}]}]},{id:c.PAGE_CONNECT,url:"devices-blinds/ikea/fyrtur-kadrilj/page-1.html",eventHandler:[{event:c.ON_ENTRY,actions:[{type:c.SHOW_PAGE,data:"BLIND_CONNECT_PAGE_1"},{type:c.ADD_CLASS_ELEM,data:{identifier:c.BTN_NEXT,c:c.DISABLE}},{type:c.REMOVE_CLASS_ELEM,data:{identifier:c.MODAL_FOOTER,c:c.DANGER}},{type:s.START_SCAN,data:120}]},{event:s.DEVICE_ADDED,actions:[{type:s.STOP_SCAN},{type:c.CALL_PAGE,data:"BLIND_CONNECT_SUCCESS"}]},{event:s.NO_DEVICE_ADDED,actions:[{type:s.STOP_SCAN},{type:c.CALL_PAGE,data:"BLIND_CONNECT_ERROR"}]},{event:c.BTN_PREV_PRESSED,actions:[{type:s.STOP_SCAN},{type:c.CLOSE_MODAL,data:"blindWizardModal"}]},{event:c.BTN_CLOSE_PRESSED,actions:[{type:s.STOP_SCAN},{type:c.CLOSE_MODAL,data:"blindWizardModal"}]}]},...ikeaPages,...ikeaLengthPages,...aqaraLengthPages,...blindSwitchEditorPages]};