//#region src/utils/sorting.ts
function e(e) {
	return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e);
}
function t(t, n) {
	let r = e(t), i = e(n), a = Number(r), o = Number(i);
	return !Number.isNaN(a) && !Number.isNaN(o) && r !== "" && i !== "" ? a - o : r.localeCompare(i);
}
function n(e, n, r) {
	let i = [...e];
	return i.sort((e, i) => {
		let a = t(r(e), r(i));
		return n === "desc" ? -a : a;
	}), i;
}
function r(e, t, n) {
	return e === n ? t === "asc" ? {
		key: n,
		direction: "desc"
	} : null : {
		key: n,
		direction: "asc"
	};
}
//#endregion
export { r as n, n as r, t };

//# sourceMappingURL=sorting-CclEKVQk.js.map