import { r as registerInstance, e as getIonMode, h, H as Host } from './core-9991b89e.js';
import { u as updateVisibility, t as toggleMenu } from './menu-toggle-util-46ad7ae9.js';

const MenuToggle = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.visible = false;
        /**
         * Automatically hides the content when the corresponding menu is not active.
         *
         * By default, it's `true`. Change it to `false` in order to
         * keep `ion-menu-toggle` always visible regardless the state of the menu.
         */
        this.autoHide = true;
        this.setVisibility = async () => {
            this.visible = await updateVisibility(this.menu);
        };
        this.onClick = async () => {
            await toggleMenu(this.menu);
        };
    }
    async componentDidLoad() {
        await this.setVisibility();
    }
    async visibilityChanged() {
        await this.setVisibility();
    }
    render() {
        const mode = getIonMode(this);
        const hidden = this.autoHide && !this.visible;
        return (h(Host, { onClick: this.onClick, "aria-hidden": hidden ? 'true' : null, class: {
                [mode]: true,
                'menu-toggle-hidden': hidden,
            } }, h("slot", null)));
    }
    static get style() { return ":host(.menu-toggle-hidden){display:none}"; }
};

export { MenuToggle as ion_menu_toggle };
