/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { BADGE_CONSTANTS } from './badge-constants';
export class BadgeFoundation {
    constructor(_adapter) {
        this._adapter = _adapter;
        this._dot = false;
        this._open = true;
    }
    initialize() {
        this._applyDot();
        this._setOpen();
    }
    _applyDot() {
        if (this._dot) {
            this._adapter.setRootClass(BADGE_CONSTANTS.classes.DOT);
            this._adapter.setHostAttribute(BADGE_CONSTANTS.attributes.DOT);
        }
        else {
            this._adapter.removeRootClass(BADGE_CONSTANTS.classes.DOT);
            this._adapter.removeHostAttribute(BADGE_CONSTANTS.attributes.DOT);
        }
    }
    _setOpen() {
        if (this._open) {
            this._adapter.setRootClass(BADGE_CONSTANTS.classes.OPEN);
            this._adapter.setHostAttribute(BADGE_CONSTANTS.attributes.OPEN);
        }
        else {
            this._adapter.removeRootClass(BADGE_CONSTANTS.classes.OPEN);
            this._adapter.removeHostAttribute(BADGE_CONSTANTS.attributes.OPEN);
        }
    }
    get dot() {
        return this._dot;
    }
    set dot(value) {
        if (this._dot !== value) {
            this._dot = value;
            this._applyDot();
        }
    }
    get open() {
        return this._open;
    }
    set open(value) {
        if (this._open !== value) {
            this._open = value;
            this._setOpen();
        }
    }
}
