const i = (l, c = null) => {
  const s = [];
  let n = null;
  const r = (t) => new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime(), D = /* @__PURE__ */ new Date(), y = r(D), o = new Date(D);
  o.setDate(o.getDate() - 1);
  const g = r(o), u = (t) => {
    const a = new Date(t * 1e3), e = r(a);
    return e === y ? "Сегодня" : e === g ? "Вчера" : a.toLocaleDateString();
  };
  c !== null && (n = u(c));
  for (let t = 0; t < l.length; t++) {
    const a = l[t], e = u(a.timestamp);
    e !== n && (s.push({
      isSeparator: !0,
      day: e,
      text: e,
      type: "system.date"
    }), n = e), s.push(a);
  }
  return s;
};
export {
  i as insertDaySeparators
};
