import { EdenMode } from "../types.js";
export function activateEden(eden) {
    eden.editors.map((editor) => editor.activate());
    changeEdenMode(EdenMode.editing);
}
export function desactivateEden(eden) {
    eden.editors.map((editor) => editor.desactivate());
    changeEdenMode(EdenMode.connected);
}
export function displayEdenInfo(eden) {
    eden.editors.map((editor) => editor.displayInfo());
    changeEdenMode(EdenMode.info);
}
export function hideEdenInfo(eden) {
    eden.editors.map((editor) => editor.hideInfo());
    changeEdenMode(EdenMode.connected);
}
export function changeEdenMode(mode) {
    window.sessionStorage.removeItem("old-eden-mode");
    if (mode) {
        document.documentElement.setAttribute("data-eden-mode", mode);
        window.sessionStorage.setItem("old-eden-mode", mode);
    }
    if (window.setEdenMode) {
        window.setEdenMode(mode);
    }
}
