/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { coerceBoolean, FoundationProperty } from '@tylertech/forge-core';
import { BaseComponent } from '../../core/base/base-component';
import { OVERLAY_CONSTANTS } from '../overlay-constants';
export class OverlayAware extends BaseComponent {
    constructor() {
        super();
    }
    position() {
        this._foundation.position();
    }
    attributeChangedCallback(name, _oldValue, newValue) {
        switch (name) {
            case OVERLAY_CONSTANTS.observedAttributes.ANCHOR:
                this.anchor = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.NO_ANCHOR:
                this.noAnchor = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.OPEN:
                this.open = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.INLINE:
                this.inline = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.PLACEMENT:
                this.placement = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.POSITION_STRATEGY:
                this.positionStrategy = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.HIDE:
                this.hide = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.PERSISTENT:
                this.persistent = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.SHIFT:
                this.shift = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.FLIP:
                this.flip = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.BOUNDARY:
                this.boundary = newValue;
                break;
        }
    }
    get overlay() {
        return this._foundation.overlayElement;
    }
}
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "anchorElement", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "anchor", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "noAnchor", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "open", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "inline", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "placement", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "positionStrategy", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "offset", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "shift", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "hide", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "persistent", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "flip", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "boundary", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "boundaryElement", void 0);
__decorate([
    FoundationProperty()
], OverlayAware.prototype, "fallbackPlacements", void 0);
