import { n as e, t } from "../../utils-C_mWfcFX.js";
//#region src/display/status-dot/index.ts
var n = class {
	el;
	statusDotId;
	currentStatus;
	currentSize;
	constructor(n = {}) {
		this.statusDotId = e("cmm-status-dot"), this.currentStatus = n.status ?? "neutral", this.currentSize = r(n.size), this.el = document.createElement("span"), this.el.id = this.statusDotId, this.el.className = this.buildClassName(n), n.decorative === !1 ? (this.el.setAttribute("role", "img"), this.el.setAttribute("aria-label", n.label ?? this.currentStatus)) : n.label === void 0 ? this.el.setAttribute("aria-hidden", "true") : (this.el.setAttribute("role", "img"), this.el.setAttribute("aria-label", n.label)), n.container !== void 0 && t(n.container).appendChild(this.el);
	}
	setStatus(e) {
		this.el.classList.remove(`cmm-status-dot--${this.currentStatus}`), this.currentStatus = e, this.el.classList.add(`cmm-status-dot--${this.currentStatus}`);
	}
	setSize(e) {
		this.el.classList.remove(`cmm-status-dot--${this.currentSize}`), this.currentSize = r(e), this.el.classList.add(`cmm-status-dot--${this.currentSize}`);
	}
	setLabel(e) {
		if (e === null) {
			this.el.removeAttribute("role"), this.el.removeAttribute("aria-label"), this.el.setAttribute("aria-hidden", "true");
			return;
		}
		this.el.removeAttribute("aria-hidden"), this.el.setAttribute("role", "img"), this.el.setAttribute("aria-label", e);
	}
	destroy() {
		this.el.remove();
	}
	buildClassName(e) {
		let t = [
			"cmm-status-dot",
			`cmm-status-dot--${this.currentStatus}`,
			`cmm-status-dot--${this.currentSize}`
		];
		return e.pulse === !0 && t.push("cmm-status-dot--pulse"), e.className && t.push(e.className), t.join(" ");
	}
};
function r(e = "sm") {
	return e === 8 || e === "md" ? "md" : "sm";
}
//#endregion
export { n as StatusDot, r as normalizeStatusDotSize };

//# sourceMappingURL=index.js.map