/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, attachLightTemplate, FoundationProperty } from '@tylertech/forge-core';
import { tylIconHelp } from '@tylertech/tyler-icons/standard';
import { MenuComponent } from '../../menu';
import { AppBarHelpButtonAdapter } from './app-bar-help-button-adapter';
import { AppBarHelpButtonFoundation } from './app-bar-help-button-foundation';
import { APP_BAR_HELP_BUTTON_CONSTANTS } from './app-bar-help-button-constants';
import { IconButtonComponent } from '../../icon-button';
import { TooltipComponent } from '../../tooltip';
import { IconRegistry } from '../../icon';
import { BaseComponent } from '../../core/base/base-component';
const template = '<template><forge-menu placement=\"bottom-end\"><forge-icon-button><forge-icon name=\"help\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"bottom\">Help</forge-tooltip></forge-menu></template>';
/**
 * @tag forge-app-bar-help-button
 *
 * @description A utility component with predefined icon and descriptions for use in an app bar `end` slot.
 *
 * @property {IMenuOption[]} options - The menu options to display when the button is clicked
 * @property {string} icon - The name of an alternative icon to display.
 *
 * @attribute {string} [icon] - The name of an alternative icon to display.
 * @attribute {string} [aria-label] - The aria-label to apply to the button.
 * @attribute {string} [aria-labelledby] - The id of an element to use as the aria-labelledby attribute.
 */
let AppBarHelpButtonComponent = class AppBarHelpButtonComponent extends BaseComponent {
    static get observedAttributes() {
        return [
            APP_BAR_HELP_BUTTON_CONSTANTS.attributes.ICON
        ];
    }
    constructor() {
        super();
        IconRegistry.define(tylIconHelp);
        this._foundation = new AppBarHelpButtonFoundation(new AppBarHelpButtonAdapter(this));
    }
    initializedCallback() {
        attachLightTemplate(this, template);
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case APP_BAR_HELP_BUTTON_CONSTANTS.attributes.ICON:
                this.icon = newValue;
                break;
        }
    }
};
__decorate([
    FoundationProperty()
], AppBarHelpButtonComponent.prototype, "options", void 0);
__decorate([
    FoundationProperty()
], AppBarHelpButtonComponent.prototype, "icon", void 0);
AppBarHelpButtonComponent = __decorate([
    CustomElement({
        name: APP_BAR_HELP_BUTTON_CONSTANTS.elementName,
        dependencies: [
            MenuComponent,
            IconButtonComponent,
            TooltipComponent
        ]
    })
], AppBarHelpButtonComponent);
export { AppBarHelpButtonComponent };
