/*! phoscon-app 2024-10-07 */

import{ButtonEvents,GeneralStates,StateEvents,UiStates,KeyEvents}from"./state-constants.js";import{deactivateSettings,startProgressbar}from"./network-main-functions.js";export var apCase8HandlerFactory=(view,setState)=>event=>{if(event===StateEvents.ENTER_STATE)view.show(),view.page1();else if(event===StateEvents.LEAVE_STATE);else if(event===ButtonEvents.CLOSE_PRESSED)view.hide(),setState(UiStates.AP);else if(event===ButtonEvents.NEXT_PRESSED)setState(UiStates.CASE_8_DEACTIVATE);else{if(event!==KeyEvents.ESC_PRESSED)return StateEvents.NOT_HANDLED;view.hide(),setState(UiStates.AP)}};export var apCase8DeactivateHandlerFactory=(view,setState)=>event=>{if(event===StateEvents.ENTER_STATE)view.pageDeactivate(),deactivateSettings("deactivated").then(()=>startProgressbar("case8ProgressBar",15)).then(()=>view.hide()).then(()=>setState(UiStates.AP));else if(event===StateEvents.LEAVE_STATE);else if(event===ButtonEvents.CLOSE_PRESSED)view.hide(),setState(UiStates.AP);else{if(event!==KeyEvents.ESC_PRESSED)return StateEvents.NOT_HANDLED;view.hide(),setState(UiStates.AP)}};