import { t as e } from "../utils-C_mWfcFX.js";
//#region src/layout/page-header.ts
var t = class {
	el;
	constructor(t) {
		this.el = document.createElement("header"), this.el.className = this.buildClassName(t);
		let n = document.createElement("div");
		n.className = "cmm-page-header__top";
		let r = document.createElement("div");
		if (r.className = "cmm-page-header__copy", t.eyebrow !== void 0) {
			let e = document.createElement("div");
			e.className = "cmm-page-header__eyebrow", e.textContent = t.eyebrow, r.appendChild(e);
		}
		let i = document.createElement("h1");
		if (i.className = `cmm-page-header__title${t.tight === !0 ? " cmm-page-header__title--tight" : ""}`, i.textContent = t.title, r.appendChild(i), t.lede !== void 0) {
			let e = document.createElement("p");
			e.className = "cmm-page-header__lede", e.textContent = t.lede, r.appendChild(e);
		}
		if (n.appendChild(r), t.actions !== void 0 && t.actions.length > 0) {
			let e = document.createElement("div");
			e.className = "cmm-page-header__actions";
			for (let n of t.actions) e.appendChild(n);
			n.appendChild(e);
		}
		this.el.appendChild(n), t.metadata !== void 0 && t.metadata.length > 0 && this.el.appendChild(this.createMetadata(t.metadata)), t.container !== void 0 && e(t.container).appendChild(this.el);
	}
	createMetadata(e) {
		let t = document.createElement("div");
		t.className = "cmm-page-header__metadata";
		for (let n of e) {
			let e = document.createElement("span");
			e.className = "cmm-page-header__metadata-item", typeof n == "string" ? e.textContent = n : e.appendChild(n), t.appendChild(e);
		}
		return t;
	}
	buildClassName(e) {
		return ["cmm-page-header", e.className].filter(Boolean).join(" ");
	}
};
function n(e) {
	return new t(e).el;
}
//#endregion
export { t as PageHeader, n as createPageHeader };

//# sourceMappingURL=page-header.js.map