import template from "../eden-main-ui.template.js";
import styles from "../eden-main-ui.styles.js";
export function resolveMainUiFlags(user) {
    return {
        isEditor: Boolean(user?.roles?.includes("eden_editor")),
        isAdmin: Boolean(user?.roles?.includes("eden_admin")),
        isSuperAdmin: Boolean(user?.email === "mail@jeantinland.com"),
    };
}
export function initMainUiShadow(host, templateData) {
    const shadowRoot = host.attachShadow({ mode: "open" });
    shadowRoot.innerHTML = template(templateData);
    const sheet = new CSSStyleSheet();
    sheet.replaceSync(styles);
    shadowRoot.adoptedStyleSheets = [sheet];
}
