//#region ../../node_modules/markdown-table/index.js
function e(e) {
	return e.length;
}
function t(t, i) {
	let a = i || {}, o = (a.align || []).concat(), s = a.stringLength || e, c = [], l = [], u = [], d = [], f = 0, p = -1;
	for (; ++p < t.length;) {
		let e = [], r = [], i = -1;
		for (t[p].length > f && (f = t[p].length); ++i < t[p].length;) {
			let o = n(t[p][i]);
			if (a.alignDelimiters !== !1) {
				let e = s(o);
				r[i] = e, (d[i] === void 0 || e > d[i]) && (d[i] = e);
			}
			e.push(o);
		}
		l[p] = e, u[p] = r;
	}
	let m = -1;
	if (typeof o == "object" && "length" in o) for (; ++m < f;) c[m] = r(o[m]);
	else {
		let e = r(o);
		for (; ++m < f;) c[m] = e;
	}
	m = -1;
	let h = [], g = [];
	for (; ++m < f;) {
		let e = c[m], t = "", n = "";
		e === 99 ? (t = ":", n = ":") : e === 108 ? t = ":" : e === 114 && (n = ":");
		let r = a.alignDelimiters === !1 ? 1 : Math.max(1, d[m] - t.length - n.length), i = t + "-".repeat(r) + n;
		a.alignDelimiters !== !1 && (r = t.length + r + n.length, r > d[m] && (d[m] = r), g[m] = r), h[m] = i;
	}
	l.splice(1, 0, h), u.splice(1, 0, g), p = -1;
	let _ = [];
	for (; ++p < l.length;) {
		let e = l[p], t = u[p];
		m = -1;
		let n = [];
		for (; ++m < f;) {
			let r = e[m] || "", i = "", o = "";
			if (a.alignDelimiters !== !1) {
				let e = d[m] - (t[m] || 0), n = c[m];
				n === 114 ? i = " ".repeat(e) : n === 99 ? e % 2 ? (i = " ".repeat(e / 2 + .5), o = " ".repeat(e / 2 - .5)) : (i = " ".repeat(e / 2), o = i) : o = " ".repeat(e);
			}
			a.delimiterStart !== !1 && !m && n.push("|"), a.padding !== !1 && !(a.alignDelimiters === !1 && r === "") && (a.delimiterStart !== !1 || m) && n.push(" "), a.alignDelimiters !== !1 && n.push(i), n.push(r), a.alignDelimiters !== !1 && n.push(o), a.padding !== !1 && n.push(" "), (a.delimiterEnd !== !1 || m !== f - 1) && n.push("|");
		}
		_.push(a.delimiterEnd === !1 ? n.join("").replace(/ +$/, "") : n.join(""));
	}
	return _.join("\n");
}
function n(e) {
	return e == null ? "" : String(e);
}
function r(e) {
	let t = typeof e == "string" ? e.codePointAt(0) : 0;
	return t === 67 || t === 99 ? 99 : t === 76 || t === 108 ? 108 : t === 82 || t === 114 ? 114 : 0;
}
//#endregion
export { t as markdownTable };
