//#region src/utils/formatRelativeTime.ts
var e = 6e4, t = 36e5, n = 864e5;
function r(r, i, a, o) {
	let s = new Date(r).getTime();
	if (Number.isNaN(s)) return null;
	let c = Date.now() - s;
	if (c < -e) return null;
	let l = Math.floor(c / e), u = Math.floor(c / t), d = Math.floor(c / n);
	return l < 1 ? i.justNow : l < 60 ? a ? a(i.minutesAgo, { minutes: l }) : i.minutesAgo.replace("{minutes}", String(l)) : u < 24 ? a ? a(i.hoursAgo, { hours: u }) : i.hoursAgo.replace("{hours}", String(u)) : o !== void 0 && d >= o ? null : a ? a(i.daysAgo, { days: d }) : i.daysAgo.replace("{days}", String(d));
}
//#endregion
export { r as t };
