"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleManagementDebugRequests = handleManagementDebugRequests;
const debugCommands_1 = require("./debugCommands");
function handleManagementDebugRequests(onCommand, dispatch, frontApplet) {
    onCommand(async (commandEvent) => {
        switch (commandEvent.command.type) {
            case debugCommands_1.ManagementDebugEnableRequest:
                await frontApplet.management.debug.enable();
                await dispatch({
                    type: debugCommands_1.ManagementDebugEnableResult,
                    result: {},
                });
                break;
            case debugCommands_1.ManagementDebugDisableRequest:
                await frontApplet.management.debug.disable();
                await dispatch({
                    type: debugCommands_1.ManagementDebugDisableResult,
                    result: {},
                });
                break;
            case debugCommands_1.ManagementDebugIsEnabledRequest:
                await dispatch({
                    type: debugCommands_1.ManagementDebugIsEnabledResult,
                    result: await frontApplet.management.debug.isEnabled(),
                });
                break;
            default:
        }
    });
}
//# sourceMappingURL=handleDebugRequests.js.map