import { n as e, t } from "../../utils-C_mWfcFX.js";
//#region src/display/severity-indicator/index.ts
var n = {
	critical: "Critical",
	high: "High",
	medium: "Medium",
	low: "Low",
	info: "Info",
	none: "None"
}, r = class {
	el;
	indicatorId;
	currentLevel;
	iconEl = null;
	labelEl = null;
	showLabel;
	showIcon;
	compact;
	constructor(r) {
		this.indicatorId = e("cmm-severity"), this.currentLevel = r.level, this.showLabel = r.showLabel !== !1, this.showIcon = r.showIcon !== !1, this.compact = r.compact === !0, this.el = document.createElement("div"), this.el.id = this.indicatorId, this.el.className = this.buildClassName(r.className), this.el.setAttribute("role", "status"), this.el.setAttribute("aria-label", `Severity: ${n[this.currentLevel]}`), this.showIcon && (this.iconEl = document.createElement("span"), this.iconEl.className = "cmm-severity__icon", this.iconEl.setAttribute("aria-hidden", "true"), this.el.appendChild(this.iconEl)), this.showLabel && (this.labelEl = document.createElement("span"), this.labelEl.className = "cmm-severity__label", this.labelEl.textContent = n[this.currentLevel], this.el.appendChild(this.labelEl)), r.container !== void 0 && t(r.container).appendChild(this.el);
	}
	setLevel(e) {
		this.el.classList.remove(`cmm-severity--${this.currentLevel}`), this.currentLevel = e, this.el.classList.add(`cmm-severity--${this.currentLevel}`), this.el.setAttribute("aria-label", `Severity: ${n[this.currentLevel]}`), this.labelEl !== null && (this.labelEl.textContent = n[this.currentLevel]);
	}
	destroy() {
		this.el.remove();
	}
	buildClassName(e) {
		let t = ["cmm-severity", `cmm-severity--${this.currentLevel}`];
		return this.compact && t.push("cmm-severity--compact"), e && t.push(e), t.join(" ");
	}
};
//#endregion
export { r as SeverityIndicator };

//# sourceMappingURL=index.js.map