'use strict';

var index = require('./index-BjHIBY-I.js');
var hotkeys = require('./hotkeys-BtR8uxvl.js');

const menuItemMetaCss = () => `@charset "UTF-8";:host(limel-menu-item-meta){order:4;transform:translateX(0.5rem);display:inline-flex;align-items:center;gap:0.5rem;max-width:50%}*{box-sizing:border-box}limel-badge{--badge-background-color:var(       --notification-badge-background-color,       rgb(var(--color-red-default))   );--badge-text-color:var(       --notification-badge-text-color,       rgb(var(--color-white))   )}.command-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:0.7;font-size:var(--limel-theme-default-small-font-size)}.chevron{flex-shrink:0;border-color:transparent;border-left-color:var(--limel-theme-text-secondary-on-background-color);border-width:0.25rem 0 0.25rem 0.375rem;border-style:solid}`;

const MenuItemMeta = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        /**
         * Will be set to `true` when the menu item is disabled.
         */
        this.disabled = false;
        /**
         * Shows a submenu chevron to indicate nested items
         */
        this.showChevron = false;
    }
    render() {
        return (index.h(index.Host, { key: '4341b1cd34952fdd2dc40bc3c4b7eb909646d880' }, this.renderCommandText(), this.renderBadge(), this.renderChevron()));
    }
    renderCommandText() {
        if (this.hotkey) {
            const hotkey = hotkeys.normalizeHotkeyString(this.hotkey);
            if (hotkey) {
                return index.h("limel-hotkey", { value: hotkey, disabled: this.disabled });
            }
        }
        if (!this.commandText) {
            return;
        }
        return index.h("span", { class: "command-text" }, this.commandText);
    }
    renderBadge() {
        if (this.badge === undefined) {
            return;
        }
        return index.h("limel-badge", { label: String(this.badge) });
    }
    renderChevron() {
        if (!this.showChevron) {
            return;
        }
        return index.h("div", { class: "chevron", "aria-hidden": "true" });
    }
};
MenuItemMeta.style = menuItemMetaCss();

exports.limel_menu_item_meta = MenuItemMeta;
