'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-0f211bec.js');

const BceMenu = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.vertical = false;
        this.right = false;
        this.toggleDesktop = false;
        this.active = false;
        this.close = () => {
            this.active = false;
        };
    }
    handleResize() {
        requestAnimationFrame(() => {
            if (window.innerWidth < 1024) {
                this.active = false;
            }
            else if (window.innerWidth > 1024 && !this.toggleDesktop) {
                this.active = true;
            }
        });
    }
    toggleMenu() {
        this.active = !this.active;
    }
    componentDidLoad() {
        if (!this.toggleDesktop && window.innerWidth > 1024) {
            this.active = true;
        }
    }
    render() {
        return (core.h(core.Host, { class: this.right ? 'right' : 'left', active: this.active }, window.innerWidth < 1024 ? (core.h("bce-icon", { onClick: this.close, raw: 'times-circle', pre: 'fas', size: '3x' })) : (''), core.h("div", { class: {
                menu: true,
                horizontal: !this.vertical,
                vertical: this.vertical
            } }, core.h("slot", null))));
    }
    static get style() { return "bce-menu{--bce-color-l:var(--bce-color-dark-l);--bce-color-n:var(--bce-color-dark-n);--bce-color-d:var(--bce-color-dark-d);--bce-color-t:var(--bce-color-dark-t);background-color:var(--bce-color-n);height:100%;z-index:6;display:none}bce-menu>bce-icon{position:absolute;top:2rem;right:1.25rem;color:#fff;z-index:6}bce-menu>.menu{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;top:0;left:0;bottom:0;right:0;z-index:5;font-size:1.5rem;background-color:var(--bce-color-n)}bce-menu>div>a{text-decoration:none;text-transform:uppercase}bce-menu>div>a,bce-menu>div>a:active,bce-menu>div>a:hover{color:var(--bce-color-t)}\@media screen and (min-width:1024px){bce-menu .menu{position:relative;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:start;align-items:flex-start;font-size:1.2rem;top:0}bce-menu .menu.horizontal{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}bce-menu .menu.vertical{-ms-flex-direction:column;flex-direction:column}bce-menu .menu.vertical>a{margin:1rem}bce-menu.left{-webkit-animation:slide-in-l .3s ease-in-out;animation:slide-in-l .3s ease-in-out}bce-menu.right{-ms-flex-order:1;order:1;-webkit-animation:slide-in-r .3s ease-in-out;animation:slide-in-r .3s ease-in-out}}bce-menu[active]{display:-ms-flexbox;display:flex}\@-webkit-keyframes slide-in-r{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}\@keyframes slide-in-r{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}\@-webkit-keyframes slide-in-l{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}\@keyframes slide-in-l{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}"; }
};

exports.bce_menu = BceMenu;
