"use client";
import { getDefaultOptions as c } from "./_lib/defaultOptions.js";
import { toDate as f } from "./toDate.js";
function O(o, e) {
  const a = c(), s = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, t = f(o, e?.in), n = t.getDay(), r = (n < s ? 7 : 0) + n - s;
  return t.setDate(t.getDate() - r), t.setHours(0, 0, 0, 0), t;
}
export {
  O as default,
  O as startOfWeek
};
