/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, FoundationProperty } from '@tylertech/forge-core';
import { BaseComponent } from '../core/base/base-component';
import { ExpansionPanelComponent } from '../expansion-panel';
import { AccordionAdapter } from './accordion-adapter';
import { ACCORDION_CONSTANTS } from './accordion-constants';
import { AccordionFoundation } from './accordion-foundation';
/**
 * The custom element class behind the `<forge-accordion>` web component.
 *
 * This component is intended to wrap and orchestrate child expansion panels
 * so that only one expansion panel is open at a time.
 *
 * @tag forge-accordion
 */
let AccordionComponent = class AccordionComponent extends BaseComponent {
    constructor() {
        super();
        this._foundation = new AccordionFoundation(new AccordionAdapter(this));
    }
    static get observedAttributes() {
        return [
            ACCORDION_CONSTANTS.attributes.PANEL_SELECTOR
        ];
    }
    initializedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case ACCORDION_CONSTANTS.attributes.PANEL_SELECTOR:
                this.panelSelector = newValue;
                break;
        }
    }
};
__decorate([
    FoundationProperty()
], AccordionComponent.prototype, "panelSelector", void 0);
AccordionComponent = __decorate([
    CustomElement({
        name: ACCORDION_CONSTANTS.elementName,
        dependencies: [ExpansionPanelComponent]
    })
], AccordionComponent);
export { AccordionComponent };
