import { constructFrom as l } from "./constructFrom.js";
import { getWeekYear as m } from "./getWeekYear.js";
import { startOfWeek as o } from "./startOfWeek.js";
import { getDefaultOptions as W } from "./_lib/defaultOptions.js";
function Y(r, e) {
  var f, s, n, c;
  const a = W(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((s = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : s.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((c = (n = a.locale) == null ? void 0 : n.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, k = m(r, e), t = l(r, 0);
  return t.setFullYear(k, 0, i), t.setHours(0, 0, 0, 0), o(t, e);
}
export {
  Y as default,
  Y as startOfWeekYear
};
