/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, attachShadowTemplate, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';
import { tylIconKeyboardArrowRight, tylIconKeyboardArrowDown } from '@tylertech/tyler-icons/standard';
import { OpenIconFoundation } from './open-icon-foundation';
import { OpenIconAdapter } from './open-icon-adapter';
import { OPEN_ICON_CONSTANTS } from './open-icon-constants';
import { IconRegistry, IconComponent } from '../icon';
import { BaseComponent } from '../core/base/base-component';
const template = '<template><span class=\"forge-open-icon\" part=\"root\"><forge-icon class=\"icon\" part=\"icon\"></forge-icon></span></template>';
const styles = '.forge-open-icon{color:#757575;color:var(--forge-theme-icon-color,#757575)}.forge-open-icon .icon{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.forge-open-icon.forge-open-icon--open .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host{line-height:.5}:host([hidden]){display:none}';
/**
 * The web component class behind the `<forge-open-icon>` custom element.
 *
 * @tag forge-open-icon
 */
let OpenIconComponent = class OpenIconComponent extends BaseComponent {
    constructor() {
        super();
        IconRegistry.define([tylIconKeyboardArrowRight, tylIconKeyboardArrowDown]);
        attachShadowTemplate(this, template, styles);
        this._foundation = new OpenIconFoundation(new OpenIconAdapter(this));
    }
    static get observedAttributes() {
        return [
            OPEN_ICON_CONSTANTS.attributes.OPEN,
            OPEN_ICON_CONSTANTS.attributes.ORIENTATION
        ];
    }
    initializedCallback() {
        this._foundation.initialize();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case OPEN_ICON_CONSTANTS.attributes.OPEN:
                this.open = coerceBoolean(newValue);
                break;
            case OPEN_ICON_CONSTANTS.attributes.ORIENTATION:
                this.orientation = newValue;
                break;
        }
    }
};
__decorate([
    FoundationProperty()
], OpenIconComponent.prototype, "open", void 0);
__decorate([
    FoundationProperty()
], OpenIconComponent.prototype, "orientation", void 0);
OpenIconComponent = __decorate([
    CustomElement({
        name: OPEN_ICON_CONSTANTS.elementName,
        dependencies: [IconComponent]
    })
], OpenIconComponent);
export { OpenIconComponent };
