import { _ as j } from "./usePress-BuLomD_X.es.js";
import { $ as gr } from "./context-DW7UvQ8z.es.js";
import { useRef as Mr, useMemo as Dr } from "react";
function pr(r, e) {
  let t = Mr(null);
  return r && t.current && e(r, t.current) && (r = t.current), t.current = r, r;
}
function S(r, e) {
  return r - e * Math.floor(r / e);
}
const Ne = 1721426;
function v(r, e, t, n) {
  e = _(r, e);
  let a = e - 1, o = -2;
  return t <= 2 ? o = 0 : D(e) && (o = -1), Ne - 1 + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + Math.floor((367 * t - 362) / 12 + o + n);
}
function D(r) {
  return r % 4 === 0 && (r % 100 !== 0 || r % 400 === 0);
}
function _(r, e) {
  return r === "BC" ? 1 - e : e;
}
function X(r) {
  let e = "AD";
  return r <= 0 && (e = "BC", r = 1 - r), [
    e,
    r
  ];
}
const wr = {
  standard: [
    31,
    28,
    31,
    30,
    31,
    30,
    31,
    31,
    30,
    31,
    30,
    31
  ],
  leapyear: [
    31,
    29,
    31,
    30,
    31,
    30,
    31,
    31,
    30,
    31,
    30,
    31
  ]
};
class $ {
  fromJulianDay(e) {
    let t = e, n = t - Ne, a = Math.floor(n / 146097), o = S(n, 146097), i = Math.floor(o / 36524), f = S(o, 36524), s = Math.floor(f / 1461), l = S(f, 1461), I = Math.floor(l / 365), A = a * 400 + i * 100 + s * 4 + I + (i !== 4 && I !== 4 ? 1 : 0), [x, p] = X(A), g = t - v(x, p, 1, 1), ee = 2;
    t < v(x, p, 3, 1) ? ee = 0 : D(p) && (ee = 1);
    let ve = Math.floor(((g + ee) * 12 + 373) / 367), br = t - v(x, p, ve, 1) + 1;
    return new c(x, p, ve, br);
  }
  toJulianDay(e) {
    return v(e.era, e.year, e.month, e.day);
  }
  getDaysInMonth(e) {
    return wr[D(e.year) ? "leapyear" : "standard"][e.month - 1];
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getMonthsInYear(e) {
    return 12;
  }
  getDaysInYear(e) {
    return D(e.year) ? 366 : 365;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  getYearsInEra(e) {
    return 9999;
  }
  getEras() {
    return [
      "BC",
      "AD"
    ];
  }
  isInverseEra(e) {
    return e.era === "BC";
  }
  balanceDate(e) {
    e.year <= 0 && (e.era = e.era === "BC" ? "AD" : "BC", e.year = 1 - e.year);
  }
  constructor() {
    this.identifier = "gregory";
  }
}
const vr = {
  "001": 1,
  AD: 1,
  AE: 6,
  AF: 6,
  AI: 1,
  AL: 1,
  AM: 1,
  AN: 1,
  AR: 1,
  AT: 1,
  AU: 1,
  AX: 1,
  AZ: 1,
  BA: 1,
  BE: 1,
  BG: 1,
  BH: 6,
  BM: 1,
  BN: 1,
  BY: 1,
  CH: 1,
  CL: 1,
  CM: 1,
  CN: 1,
  CR: 1,
  CY: 1,
  CZ: 1,
  DE: 1,
  DJ: 6,
  DK: 1,
  DZ: 6,
  EC: 1,
  EE: 1,
  EG: 6,
  ES: 1,
  FI: 1,
  FJ: 1,
  FO: 1,
  FR: 1,
  GB: 1,
  GE: 1,
  GF: 1,
  GP: 1,
  GR: 1,
  HR: 1,
  HU: 1,
  IE: 1,
  IQ: 6,
  IR: 6,
  IS: 1,
  IT: 1,
  JO: 6,
  KG: 1,
  KW: 6,
  KZ: 1,
  LB: 1,
  LI: 1,
  LK: 1,
  LT: 1,
  LU: 1,
  LV: 1,
  LY: 6,
  MC: 1,
  MD: 1,
  ME: 1,
  MK: 1,
  MN: 1,
  MQ: 1,
  MV: 5,
  MY: 1,
  NL: 1,
  NO: 1,
  NZ: 1,
  OM: 6,
  PL: 1,
  QA: 6,
  RE: 1,
  RO: 1,
  RS: 1,
  RU: 1,
  SD: 6,
  SE: 1,
  SI: 1,
  SK: 1,
  SM: 1,
  SY: 6,
  TJ: 1,
  TM: 1,
  TR: 1,
  UA: 1,
  UY: 1,
  UZ: 1,
  VA: 1,
  VN: 1,
  XK: 1
};
function qe(r, e) {
  return e = h(e, r.calendar), r.era === e.era && r.year === e.year && r.month === e.month && r.day === e.day;
}
function vt(r, e) {
  return e = h(e, r.calendar), r = Z(r), e = Z(e), r.era === e.era && r.year === e.year && r.month === e.month;
}
function Et(r, e) {
  return He(r.calendar, e.calendar) && qe(r, e);
}
function He(r, e) {
  var t, n, a, o;
  return (o = (a = (t = r.isEqual) === null || t === void 0 ? void 0 : t.call(r, e)) !== null && a !== void 0 ? a : (n = e.isEqual) === null || n === void 0 ? void 0 : n.call(e, r)) !== null && o !== void 0 ? o : r.identifier === e.identifier;
}
function It(r, e) {
  return qe(r, Ar(e));
}
const Er = {
  sun: 0,
  mon: 1,
  tue: 2,
  wed: 3,
  thu: 4,
  fri: 5,
  sat: 6
};
function Pe(r, e, t) {
  let n = r.calendar.toJulianDay(r), a = t ? Er[t] : Sr(e), o = Math.ceil(n + 1 - a) % 7;
  return o < 0 && (o += 7), o;
}
function Ir(r) {
  return m(Date.now(), r);
}
function Ar(r) {
  return Tr(Ir(r));
}
function Ze(r, e) {
  return r.calendar.toJulianDay(r) - e.calendar.toJulianDay(e);
}
function We(r, e) {
  return Ee(r) - Ee(e);
}
function Ee(r) {
  return r.hour * 36e5 + r.minute * 6e4 + r.second * 1e3 + r.millisecond;
}
let re = null;
function Ve() {
  return re == null && (re = new Intl.DateTimeFormat().resolvedOptions().timeZone), re;
}
function Z(r) {
  return r.subtract({
    days: r.day - 1
  });
}
function At(r) {
  return r.add({
    days: r.calendar.getDaysInMonth(r) - r.day
  });
}
function xt(r) {
  return Z(r.subtract({
    months: r.month - 1
  }));
}
function Ct(r) {
  return r.calendar.getMinimumMonthInYear ? r.calendar.getMinimumMonthInYear(r) : 1;
}
function St(r) {
  return r.calendar.getMinimumDayInMonth ? r.calendar.getMinimumDayInMonth(r) : 1;
}
function xr(r, e, t) {
  let n = Pe(r, e, t);
  return r.subtract({
    days: n
  });
}
function Yt(r, e, t) {
  return xr(r, e, t).add({
    days: 6
  });
}
const Ie = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map();
function Cr(r) {
  if (Intl.Locale) {
    let t = Ie.get(r);
    return t || (t = new Intl.Locale(r).maximize().region, t && Ie.set(r, t)), t;
  }
  let e = r.split("-")[1];
  return e === "u" ? void 0 : e;
}
function Sr(r) {
  let e = te.get(r);
  if (!e) {
    if (Intl.Locale) {
      let n = new Intl.Locale(r);
      if ("getWeekInfo" in n && (e = n.getWeekInfo(), e))
        return te.set(r, e), e.firstDay;
    }
    let t = Cr(r);
    if (r.includes("-fw-")) {
      let n = r.split("-fw-")[1].split("-")[0];
      n === "mon" ? e = {
        firstDay: 1
      } : n === "tue" ? e = {
        firstDay: 2
      } : n === "wed" ? e = {
        firstDay: 3
      } : n === "thu" ? e = {
        firstDay: 4
      } : n === "fri" ? e = {
        firstDay: 5
      } : n === "sat" ? e = {
        firstDay: 6
      } : e = {
        firstDay: 0
      };
    } else r.includes("-ca-iso8601") ? e = {
      firstDay: 1
    } : e = {
      firstDay: t && vr[t] || 0
    };
    te.set(r, e);
  }
  return e.firstDay;
}
function Bt(r, e, t) {
  let n = r.calendar.getDaysInMonth(r);
  return Math.ceil((Pe(Z(r), e, t) + n) / 7);
}
function Tt(r, e) {
  return r && e ? r.compare(e) <= 0 ? r : e : r || e;
}
function Ut(r, e) {
  return r && e ? r.compare(e) >= 0 ? r : e : r || e;
}
function T(r) {
  r = h(r, new $());
  let e = _(r.era, r.year);
  return Ke(e, r.month, r.day, r.hour, r.minute, r.second, r.millisecond);
}
function Ke(r, e, t, n, a, o, i) {
  let f = /* @__PURE__ */ new Date();
  return f.setUTCHours(n, a, o, i), f.setUTCFullYear(r, e - 1, t), f.getTime();
}
function se(r, e) {
  if (e === "UTC") return 0;
  if (r > 0 && e === Ve()) return new Date(r).getTimezoneOffset() * -6e4;
  let { year: t, month: n, day: a, hour: o, minute: i, second: f } = Ge(r, e);
  return Ke(t, n, a, o, i, f, 0) - Math.floor(r / 1e3) * 1e3;
}
const Ae = /* @__PURE__ */ new Map();
function Ge(r, e) {
  let t = Ae.get(e);
  t || (t = new Intl.DateTimeFormat("en-US", {
    timeZone: e,
    hour12: !1,
    era: "short",
    year: "numeric",
    month: "numeric",
    day: "numeric",
    hour: "numeric",
    minute: "numeric",
    second: "numeric"
  }), Ae.set(e, t));
  let n = t.formatToParts(new Date(r)), a = {};
  for (let o of n) o.type !== "literal" && (a[o.type] = o.value);
  return {
    // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
    year: a.era === "BC" || a.era === "B" ? -a.year + 1 : +a.year,
    month: +a.month,
    day: +a.day,
    hour: a.hour === "24" ? 0 : +a.hour,
    minute: +a.minute,
    second: +a.second
  };
}
const xe = 864e5;
function Yr(r, e, t, n) {
  return (t === n ? [
    t
  ] : [
    t,
    n
  ]).filter((o) => Br(r, e, o));
}
function Br(r, e, t) {
  let n = Ge(t, e);
  return r.year === n.year && r.month === n.month && r.day === n.day && r.hour === n.hour && r.minute === n.minute && r.second === n.second;
}
function y(r, e, t = "compatible") {
  let n = U(r);
  if (e === "UTC") return T(n);
  if (e === Ve() && t === "compatible") {
    n = h(n, new $());
    let s = /* @__PURE__ */ new Date(), l = _(n.era, n.year);
    return s.setFullYear(l, n.month - 1, n.day), s.setHours(n.hour, n.minute, n.second, n.millisecond), s.getTime();
  }
  let a = T(n), o = se(a - xe, e), i = se(a + xe, e), f = Yr(n, e, a - o, a - i);
  if (f.length === 1) return f[0];
  if (f.length > 1) switch (t) {
    // 'compatible' means 'earlier' for "fall back" transitions
    case "compatible":
    case "earlier":
      return f[0];
    case "later":
      return f[f.length - 1];
    case "reject":
      throw new RangeError("Multiple possible absolute times found");
  }
  switch (t) {
    case "earlier":
      return Math.min(a - o, a - i);
    // 'compatible' means 'later' for "spring forward" transitions
    case "compatible":
    case "later":
      return Math.max(a - o, a - i);
    case "reject":
      throw new RangeError("No such absolute time found");
  }
}
function je(r, e, t = "compatible") {
  return new Date(y(r, e, t));
}
function m(r, e) {
  let t = se(r, e), n = new Date(r + t), a = n.getUTCFullYear(), o = n.getUTCMonth() + 1, i = n.getUTCDate(), f = n.getUTCHours(), s = n.getUTCMinutes(), l = n.getUTCSeconds(), I = n.getUTCMilliseconds();
  return new Q(a < 1 ? "BC" : "AD", a < 1 ? -a + 1 : a, o, i, e, t, f, s, l, I);
}
function Tr(r) {
  return new c(r.calendar, r.era, r.year, r.month, r.day);
}
function U(r, e) {
  let t = 0, n = 0, a = 0, o = 0;
  if ("timeZone" in r) ({ hour: t, minute: n, second: a, millisecond: o } = r);
  else if ("hour" in r && !e) return r;
  return e && ({ hour: t, minute: n, second: a, millisecond: o } = e), new O(r.calendar, r.era, r.year, r.month, r.day, t, n, a, o);
}
function Rt(r) {
  return new Me(r.hour, r.minute, r.second, r.millisecond);
}
function h(r, e) {
  if (He(r.calendar, e)) return r;
  let t = e.fromJulianDay(r.calendar.toJulianDay(r)), n = r.copy();
  return n.calendar = e, n.era = t.era, n.year = t.year, n.month = t.month, n.day = t.day, E(n), n;
}
function Ur(r, e, t) {
  if (r instanceof Q)
    return r.timeZone === e ? r : Jr(r, e);
  let n = y(r, e, t);
  return m(n, e);
}
function Rr(r) {
  let e = T(r) - r.offset;
  return new Date(e);
}
function Jr(r, e) {
  let t = T(r) - r.offset;
  return h(m(t, e), r.calendar);
}
const R = 36e5;
function z(r, e) {
  let t = r.copy(), n = "hour" in t ? rr(t, e) : 0;
  ce(t, e.years || 0), t.calendar.balanceYearMonth && t.calendar.balanceYearMonth(t, r), t.month += e.months || 0, le(t), Xe(t), t.day += (e.weeks || 0) * 7, t.day += e.days || 0, t.day += n, Lr(t), t.calendar.balanceDate && t.calendar.balanceDate(t), t.year < 1 && (t.year = 1, t.month = 1, t.day = 1);
  let a = t.calendar.getYearsInEra(t);
  if (t.year > a) {
    var o, i;
    let s = (o = (i = t.calendar).isInverseEra) === null || o === void 0 ? void 0 : o.call(i, t);
    t.year = a, t.month = s ? 1 : t.calendar.getMonthsInYear(t), t.day = s ? 1 : t.calendar.getDaysInMonth(t);
  }
  t.month < 1 && (t.month = 1, t.day = 1);
  let f = t.calendar.getMonthsInYear(t);
  return t.month > f && (t.month = f, t.day = t.calendar.getDaysInMonth(t)), t.day = Math.max(1, Math.min(t.calendar.getDaysInMonth(t), t.day)), t;
}
function ce(r, e) {
  var t, n;
  !((t = (n = r.calendar).isInverseEra) === null || t === void 0) && t.call(n, r) && (e = -e), r.year += e;
}
function le(r) {
  for (; r.month < 1; )
    ce(r, -1), r.month += r.calendar.getMonthsInYear(r);
  let e = 0;
  for (; r.month > (e = r.calendar.getMonthsInYear(r)); )
    r.month -= e, ce(r, 1);
}
function Lr(r) {
  for (; r.day < 1; )
    r.month--, le(r), r.day += r.calendar.getDaysInMonth(r);
  for (; r.day > r.calendar.getDaysInMonth(r); )
    r.day -= r.calendar.getDaysInMonth(r), r.month++, le(r);
}
function Xe(r) {
  r.month = Math.max(1, Math.min(r.calendar.getMonthsInYear(r), r.month)), r.day = Math.max(1, Math.min(r.calendar.getDaysInMonth(r), r.day));
}
function E(r) {
  r.calendar.constrainDate && r.calendar.constrainDate(r), r.year = Math.max(1, Math.min(r.calendar.getYearsInEra(r), r.year)), Xe(r);
}
function de(r) {
  let e = {};
  for (let t in r) typeof r[t] == "number" && (e[t] = -r[t]);
  return e;
}
function ze(r, e) {
  return z(r, de(e));
}
function ye(r, e) {
  let t = r.copy();
  return e.era != null && (t.era = e.era), e.year != null && (t.year = e.year), e.month != null && (t.month = e.month), e.day != null && (t.day = e.day), E(t), t;
}
function k(r, e) {
  let t = r.copy();
  return e.hour != null && (t.hour = e.hour), e.minute != null && (t.minute = e.minute), e.second != null && (t.second = e.second), e.millisecond != null && (t.millisecond = e.millisecond), er(t), t;
}
function kr(r) {
  r.second += Math.floor(r.millisecond / 1e3), r.millisecond = F(r.millisecond, 1e3), r.minute += Math.floor(r.second / 60), r.second = F(r.second, 60), r.hour += Math.floor(r.minute / 60), r.minute = F(r.minute, 60);
  let e = Math.floor(r.hour / 24);
  return r.hour = F(r.hour, 24), e;
}
function er(r) {
  r.millisecond = Math.max(0, Math.min(r.millisecond, 1e3)), r.second = Math.max(0, Math.min(r.second, 59)), r.minute = Math.max(0, Math.min(r.minute, 59)), r.hour = Math.max(0, Math.min(r.hour, 23));
}
function F(r, e) {
  let t = r % e;
  return t < 0 && (t += e), t;
}
function rr(r, e) {
  return r.hour += e.hours || 0, r.minute += e.minutes || 0, r.second += e.seconds || 0, r.millisecond += e.milliseconds || 0, kr(r);
}
function tr(r, e) {
  let t = r.copy();
  return rr(t, e), t;
}
function Or(r, e) {
  return tr(r, de(e));
}
function me(r, e, t, n) {
  let a = r.copy();
  switch (e) {
    case "era": {
      let f = r.calendar.getEras(), s = f.indexOf(r.era);
      if (s < 0) throw new Error("Invalid era: " + r.era);
      s = b(s, t, 0, f.length - 1, n?.round), a.era = f[s], E(a);
      break;
    }
    case "year":
      var o, i;
      !((o = (i = a.calendar).isInverseEra) === null || o === void 0) && o.call(i, a) && (t = -t), a.year = b(r.year, t, -1 / 0, 9999, n?.round), a.year === -1 / 0 && (a.year = 1), a.calendar.balanceYearMonth && a.calendar.balanceYearMonth(a, r);
      break;
    case "month":
      a.month = b(r.month, t, 1, r.calendar.getMonthsInYear(r), n?.round);
      break;
    case "day":
      a.day = b(r.day, t, 1, r.calendar.getDaysInMonth(r), n?.round);
      break;
    default:
      throw new Error("Unsupported field " + e);
  }
  return r.calendar.balanceDate && r.calendar.balanceDate(a), E(a), a;
}
function be(r, e, t, n) {
  let a = r.copy();
  switch (e) {
    case "hour": {
      let o = r.hour, i = 0, f = 23;
      if (n?.hourCycle === 12) {
        let s = o >= 12;
        i = s ? 12 : 0, f = s ? 23 : 11;
      }
      a.hour = b(o, t, i, f, n?.round);
      break;
    }
    case "minute":
      a.minute = b(r.minute, t, 0, 59, n?.round);
      break;
    case "second":
      a.second = b(r.second, t, 0, 59, n?.round);
      break;
    case "millisecond":
      a.millisecond = b(r.millisecond, t, 0, 999, n?.round);
      break;
    default:
      throw new Error("Unsupported field " + e);
  }
  return a;
}
function b(r, e, t, n, a = !1) {
  if (a) {
    r += Math.sign(e), r < t && (r = n);
    let o = Math.abs(e);
    e > 0 ? r = Math.ceil(r / o) * o : r = Math.floor(r / o) * o, r > n && (r = t);
  } else
    r += e, r < t ? r = n - (t - r - 1) : r > n && (r = t + (r - n - 1));
  return r;
}
function nr(r, e) {
  let t;
  if (e.years != null && e.years !== 0 || e.months != null && e.months !== 0 || e.weeks != null && e.weeks !== 0 || e.days != null && e.days !== 0) {
    let a = z(U(r), {
      years: e.years,
      months: e.months,
      weeks: e.weeks,
      days: e.days
    });
    t = y(a, r.timeZone);
  } else
    t = T(r) - r.offset;
  t += e.milliseconds || 0, t += (e.seconds || 0) * 1e3, t += (e.minutes || 0) * 6e4, t += (e.hours || 0) * 36e5;
  let n = m(t, r.timeZone);
  return h(n, r.calendar);
}
function Qr(r, e) {
  return nr(r, de(e));
}
function _r(r, e, t, n) {
  switch (e) {
    case "hour": {
      let a = 0, o = 23;
      if (n?.hourCycle === 12) {
        let g = r.hour >= 12;
        a = g ? 12 : 0, o = g ? 23 : 11;
      }
      let i = U(r), f = h(k(i, {
        hour: a
      }), new $()), s = [
        y(f, r.timeZone, "earlier"),
        y(f, r.timeZone, "later")
      ].filter((g) => m(g, r.timeZone).day === f.day)[0], l = h(k(i, {
        hour: o
      }), new $()), I = [
        y(l, r.timeZone, "earlier"),
        y(l, r.timeZone, "later")
      ].filter((g) => m(g, r.timeZone).day === l.day).pop(), A = T(r) - r.offset, x = Math.floor(A / R), p = A % R;
      return A = b(x, t, Math.floor(s / R), Math.floor(I / R), n?.round) * R + p, h(m(A, r.timeZone), r.calendar);
    }
    case "minute":
    case "second":
    case "millisecond":
      return be(r, e, t, n);
    case "era":
    case "year":
    case "month":
    case "day": {
      let a = me(U(r), e, t, n), o = y(a, r.timeZone);
      return h(m(o, r.timeZone), r.calendar);
    }
    default:
      throw new Error("Unsupported field " + e);
  }
}
function Fr(r, e, t) {
  let n = U(r), a = k(ye(n, e), e);
  if (a.compare(n) === 0) return r;
  let o = y(a, r.timeZone, t);
  return h(m(o, r.timeZone), r.calendar);
}
const Nr = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/, qr = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/, ar = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
function Jt(r) {
  let e = r.match(Nr);
  if (!e)
    throw ar.test(r) ? new Error(`Invalid ISO 8601 date string: ${r}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date string: " + r);
  let t = new c(d(e[1], 0, 9999), d(e[2], 1, 12), 1);
  return t.day = d(e[3], 1, t.calendar.getDaysInMonth(t)), t;
}
function Lt(r) {
  let e = r.match(qr);
  if (!e)
    throw ar.test(r) ? new Error(`Invalid ISO 8601 date time string: ${r}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date time string: " + r);
  let t = d(e[1], -9999, 9999), n = t < 1 ? "BC" : "AD", a = new O(n, t < 1 ? -t + 1 : t, d(e[2], 1, 12), 1, e[4] ? d(e[4], 0, 23) : 0, e[5] ? d(e[5], 0, 59) : 0, e[6] ? d(e[6], 0, 59) : 0, e[7] ? d(e[7], 0, 1 / 0) * 1e3 : 0);
  return a.day = d(e[3], 0, a.calendar.getDaysInMonth(a)), a;
}
function d(r, e, t) {
  let n = Number(r);
  if (n < e || n > t) throw new RangeError(`Value out of range: ${e} <= ${n} <= ${t}`);
  return n;
}
function or(r) {
  return `${String(r.hour).padStart(2, "0")}:${String(r.minute).padStart(2, "0")}:${String(r.second).padStart(2, "0")}${r.millisecond ? String(r.millisecond / 1e3).slice(1) : ""}`;
}
function ir(r) {
  let e = h(r, new $()), t;
  return e.era === "BC" ? t = e.year === 1 ? "0000" : "-" + String(Math.abs(1 - e.year)).padStart(6, "00") : t = String(e.year).padStart(4, "0"), `${t}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
}
function fr(r) {
  return `${ir(r)}T${or(r)}`;
}
function Hr(r) {
  let e = Math.sign(r) < 0 ? "-" : "+";
  r = Math.abs(r);
  let t = Math.floor(r / 36e5), n = Math.floor(r % 36e5 / 6e4), a = Math.floor(r % 36e5 % 6e4 / 1e3), o = `${e}${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
  return a !== 0 && (o += `:${String(a).padStart(2, "0")}`), o;
}
function Pr(r) {
  return `${fr(r)}${Hr(r.offset)}[${r.timeZone}]`;
}
function ge(r) {
  let e = typeof r[0] == "object" ? r.shift() : new $(), t;
  if (typeof r[0] == "string") t = r.shift();
  else {
    let i = e.getEras();
    t = i[i.length - 1];
  }
  let n = r.shift(), a = r.shift(), o = r.shift();
  return [
    e,
    t,
    n,
    a,
    o
  ];
}
var Zr = /* @__PURE__ */ new WeakMap();
class c {
  /** Returns a copy of this date. */
  copy() {
    return this.era ? new c(this.calendar, this.era, this.year, this.month, this.day) : new c(this.calendar, this.year, this.month, this.day);
  }
  /** Returns a new `CalendarDate` with the given duration added to it. */
  add(e) {
    return z(this, e);
  }
  /** Returns a new `CalendarDate` with the given duration subtracted from it. */
  subtract(e) {
    return ze(this, e);
  }
  /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
  set(e) {
    return ye(this, e);
  }
  /**
  * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
  * When the resulting value reaches the limits of the field, it wraps around.
  */
  cycle(e, t, n) {
    return me(this, e, t, n);
  }
  /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
  toDate(e) {
    return je(this, e);
  }
  /** Converts the date to an ISO 8601 formatted string. */
  toString() {
    return ir(this);
  }
  /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
  compare(e) {
    return Ze(this, e);
  }
  constructor(...e) {
    j(this, Zr, {
      writable: !0,
      value: void 0
    });
    let [t, n, a, o, i] = ge(e);
    this.calendar = t, this.era = n, this.year = a, this.month = o, this.day = i, E(this);
  }
}
var Wr = /* @__PURE__ */ new WeakMap();
class Me {
  /** Returns a copy of this time. */
  copy() {
    return new Me(this.hour, this.minute, this.second, this.millisecond);
  }
  /** Returns a new `Time` with the given duration added to it. */
  add(e) {
    return tr(this, e);
  }
  /** Returns a new `Time` with the given duration subtracted from it. */
  subtract(e) {
    return Or(this, e);
  }
  /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */
  set(e) {
    return k(this, e);
  }
  /**
  * Returns a new `Time` with the given field adjusted by a specified amount.
  * When the resulting value reaches the limits of the field, it wraps around.
  */
  cycle(e, t, n) {
    return be(this, e, t, n);
  }
  /** Converts the time to an ISO 8601 formatted string. */
  toString() {
    return or(this);
  }
  /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */
  compare(e) {
    return We(this, e);
  }
  constructor(e = 0, t = 0, n = 0, a = 0) {
    j(this, Wr, {
      writable: !0,
      value: void 0
    }), this.hour = e, this.minute = t, this.second = n, this.millisecond = a, er(this);
  }
}
var Vr = /* @__PURE__ */ new WeakMap();
class O {
  /** Returns a copy of this date. */
  copy() {
    return this.era ? new O(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new O(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
  }
  /** Returns a new `CalendarDateTime` with the given duration added to it. */
  add(e) {
    return z(this, e);
  }
  /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
  subtract(e) {
    return ze(this, e);
  }
  /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
  set(e) {
    return ye(k(this, e), e);
  }
  /**
  * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
  * When the resulting value reaches the limits of the field, it wraps around.
  */
  cycle(e, t, n) {
    switch (e) {
      case "era":
      case "year":
      case "month":
      case "day":
        return me(this, e, t, n);
      default:
        return be(this, e, t, n);
    }
  }
  /** Converts the date to a native JavaScript Date object in the given time zone. */
  toDate(e, t) {
    return je(this, e, t);
  }
  /** Converts the date to an ISO 8601 formatted string. */
  toString() {
    return fr(this);
  }
  /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
  compare(e) {
    let t = Ze(this, e);
    return t === 0 ? We(this, U(e)) : t;
  }
  constructor(...e) {
    j(this, Vr, {
      writable: !0,
      value: void 0
    });
    let [t, n, a, o, i] = ge(e);
    this.calendar = t, this.era = n, this.year = a, this.month = o, this.day = i, this.hour = e.shift() || 0, this.minute = e.shift() || 0, this.second = e.shift() || 0, this.millisecond = e.shift() || 0, E(this);
  }
}
var Kr = /* @__PURE__ */ new WeakMap();
class Q {
  /** Returns a copy of this date. */
  copy() {
    return this.era ? new Q(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new Q(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
  }
  /** Returns a new `ZonedDateTime` with the given duration added to it. */
  add(e) {
    return nr(this, e);
  }
  /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
  subtract(e) {
    return Qr(this, e);
  }
  /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
  set(e, t) {
    return Fr(this, e, t);
  }
  /**
  * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
  * When the resulting value reaches the limits of the field, it wraps around.
  */
  cycle(e, t, n) {
    return _r(this, e, t, n);
  }
  /** Converts the date to a native JavaScript Date object. */
  toDate() {
    return Rr(this);
  }
  /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
  toString() {
    return Pr(this);
  }
  /** Converts the date to an ISO 8601 formatted string in UTC. */
  toAbsoluteString() {
    return this.toDate().toISOString();
  }
  /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
  compare(e) {
    return this.toDate().getTime() - Ur(e, this.timeZone).toDate().getTime();
  }
  constructor(...e) {
    j(this, Kr, {
      writable: !0,
      value: void 0
    });
    let [t, n, a, o, i] = ge(e), f = e.shift(), s = e.shift();
    this.calendar = t, this.era = n, this.year = a, this.month = o, this.day = i, this.timeZone = f, this.offset = s, this.hour = e.shift() || 0, this.minute = e.shift() || 0, this.second = e.shift() || 0, this.millisecond = e.shift() || 0, E(this);
  }
}
const Y = [
  [
    1868,
    9,
    8
  ],
  [
    1912,
    7,
    30
  ],
  [
    1926,
    12,
    25
  ],
  [
    1989,
    1,
    8
  ],
  [
    2019,
    5,
    1
  ]
], Gr = [
  [
    1912,
    7,
    29
  ],
  [
    1926,
    12,
    24
  ],
  [
    1989,
    1,
    7
  ],
  [
    2019,
    4,
    30
  ]
], q = [
  1867,
  1911,
  1925,
  1988,
  2018
], M = [
  "meiji",
  "taisho",
  "showa",
  "heisei",
  "reiwa"
];
function Ce(r) {
  const e = Y.findIndex(([t, n, a]) => r.year < t || r.year === t && r.month < n || r.year === t && r.month === n && r.day < a);
  return e === -1 ? Y.length - 1 : e === 0 ? 0 : e - 1;
}
function ne(r) {
  let e = q[M.indexOf(r.era)];
  if (!e) throw new Error("Unknown era: " + r.era);
  return new c(r.year + e, r.month, r.day);
}
class jr extends $ {
  fromJulianDay(e) {
    let t = super.fromJulianDay(e), n = Ce(t);
    return new c(this, M[n], t.year - q[n], t.month, t.day);
  }
  toJulianDay(e) {
    return super.toJulianDay(ne(e));
  }
  balanceDate(e) {
    let t = ne(e), n = Ce(t);
    M[n] !== e.era && (e.era = M[n], e.year = t.year - q[n]), this.constrainDate(e);
  }
  constrainDate(e) {
    let t = M.indexOf(e.era), n = Gr[t];
    if (n != null) {
      let [a, o, i] = n, f = a - q[t];
      e.year = Math.max(1, Math.min(f, e.year)), e.year === f && (e.month = Math.min(o, e.month), e.month === o && (e.day = Math.min(i, e.day)));
    }
    if (e.year === 1 && t >= 0) {
      let [, a, o] = Y[t];
      e.month = Math.max(a, e.month), e.month === a && (e.day = Math.max(o, e.day));
    }
  }
  getEras() {
    return M;
  }
  getYearsInEra(e) {
    let t = M.indexOf(e.era), n = Y[t], a = Y[t + 1];
    if (a == null)
      return 9999 - n[0] + 1;
    let o = a[0] - n[0];
    return (e.month < a[1] || e.month === a[1] && e.day < a[2]) && o++, o;
  }
  getDaysInMonth(e) {
    return super.getDaysInMonth(ne(e));
  }
  getMinimumMonthInYear(e) {
    let t = Se(e);
    return t ? t[1] : 1;
  }
  getMinimumDayInMonth(e) {
    let t = Se(e);
    return t && e.month === t[1] ? t[2] : 1;
  }
  constructor(...e) {
    super(...e), this.identifier = "japanese";
  }
}
function Se(r) {
  if (r.year === 1) {
    let e = M.indexOf(r.era);
    return Y[e];
  }
}
const sr = -543;
class Xr extends $ {
  fromJulianDay(e) {
    let t = super.fromJulianDay(e), n = _(t.era, t.year);
    return new c(this, n - sr, t.month, t.day);
  }
  toJulianDay(e) {
    return super.toJulianDay(Ye(e));
  }
  getEras() {
    return [
      "BE"
    ];
  }
  getDaysInMonth(e) {
    return super.getDaysInMonth(Ye(e));
  }
  balanceDate() {
  }
  constructor(...e) {
    super(...e), this.identifier = "buddhist";
  }
}
function Ye(r) {
  let [e, t] = X(r.year + sr);
  return new c(e, t, r.month, r.day);
}
const W = 1911;
function cr(r) {
  return r.era === "minguo" ? r.year + W : 1 - r.year + W;
}
function Be(r) {
  let e = r - W;
  return e > 0 ? [
    "minguo",
    e
  ] : [
    "before_minguo",
    1 - e
  ];
}
class zr extends $ {
  fromJulianDay(e) {
    let t = super.fromJulianDay(e), n = _(t.era, t.year), [a, o] = Be(n);
    return new c(this, a, o, t.month, t.day);
  }
  toJulianDay(e) {
    return super.toJulianDay(Te(e));
  }
  getEras() {
    return [
      "before_minguo",
      "minguo"
    ];
  }
  balanceDate(e) {
    let [t, n] = Be(cr(e));
    e.era = t, e.year = n;
  }
  isInverseEra(e) {
    return e.era === "before_minguo";
  }
  getDaysInMonth(e) {
    return super.getDaysInMonth(Te(e));
  }
  getYearsInEra(e) {
    return e.era === "before_minguo" ? 9999 : 9999 - W;
  }
  constructor(...e) {
    super(...e), this.identifier = "roc";
  }
}
function Te(r) {
  let [e, t] = X(cr(r));
  return new c(e, t, r.month, r.day);
}
const Ue = 1948320, Re = [
  0,
  31,
  62,
  93,
  124,
  155,
  186,
  216,
  246,
  276,
  306,
  336
  // Esfand
];
class et {
  fromJulianDay(e) {
    let t = e - Ue, n = 1 + Math.floor((33 * t + 3) / 12053), a = 365 * (n - 1) + Math.floor((8 * n + 21) / 33), o = t - a, i = o < 216 ? Math.floor(o / 31) : Math.floor((o - 6) / 30), f = o - Re[i] + 1;
    return new c(this, n, i + 1, f);
  }
  toJulianDay(e) {
    let t = Ue - 1 + 365 * (e.year - 1) + Math.floor((8 * e.year + 21) / 33);
    return t += Re[e.month - 1], t += e.day, t;
  }
  getMonthsInYear() {
    return 12;
  }
  getDaysInMonth(e) {
    return e.month <= 6 ? 31 : e.month <= 11 || S(25 * e.year + 11, 33) < 8 ? 30 : 29;
  }
  getEras() {
    return [
      "AP"
    ];
  }
  getYearsInEra() {
    return 9377;
  }
  constructor() {
    this.identifier = "persian";
  }
}
const ae = 78, Je = 80;
class rt extends $ {
  fromJulianDay(e) {
    let t = super.fromJulianDay(e), n = t.year - ae, a = e - v(t.era, t.year, 1, 1), o;
    a < Je ? (n--, o = D(t.year - 1) ? 31 : 30, a += o + 155 + 90 + 10) : (o = D(t.year) ? 31 : 30, a -= Je);
    let i, f;
    if (a < o)
      i = 1, f = a + 1;
    else {
      let s = a - o;
      s < 155 ? (i = Math.floor(s / 31) + 2, f = s % 31 + 1) : (s -= 155, i = Math.floor(s / 30) + 7, f = s % 30 + 1);
    }
    return new c(this, n, i, f);
  }
  toJulianDay(e) {
    let t = e.year + ae, [n, a] = X(t), o, i;
    return D(a) ? (o = 31, i = v(n, a, 3, 21)) : (o = 30, i = v(n, a, 3, 22)), e.month === 1 ? i + e.day - 1 : (i += o + Math.min(e.month - 2, 5) * 31, e.month >= 8 && (i += (e.month - 7) * 30), i += e.day - 1, i);
  }
  getDaysInMonth(e) {
    return e.month === 1 && D(e.year + ae) || e.month >= 2 && e.month <= 6 ? 31 : 30;
  }
  getYearsInEra() {
    return 9919;
  }
  getEras() {
    return [
      "saka"
    ];
  }
  balanceDate() {
  }
  constructor(...e) {
    super(...e), this.identifier = "indian";
  }
}
const V = 1948440, Le = 1948439, u = 1300, C = 1600, tt = 460322;
function K(r, e, t, n) {
  return n + Math.ceil(29.5 * (t - 1)) + (e - 1) * 354 + Math.floor((3 + 11 * e) / 30) + r - 1;
}
function lr(r, e, t) {
  let n = Math.floor((30 * (t - e) + 10646) / 10631), a = Math.min(12, Math.ceil((t - (29 + K(e, n, 1, 1))) / 29.5) + 1), o = t - K(e, n, a, 1) + 1;
  return new c(r, n, a, o);
}
function ke(r) {
  return (14 + 11 * r) % 30 < 11;
}
class De {
  fromJulianDay(e) {
    return lr(this, V, e);
  }
  toJulianDay(e) {
    return K(V, e.year, e.month, e.day);
  }
  getDaysInMonth(e) {
    let t = 29 + e.month % 2;
    return e.month === 12 && ke(e.year) && t++, t;
  }
  getMonthsInYear() {
    return 12;
  }
  getDaysInYear(e) {
    return ke(e.year) ? 355 : 354;
  }
  getYearsInEra() {
    return 9665;
  }
  getEras() {
    return [
      "AH"
    ];
  }
  constructor() {
    this.identifier = "islamic-civil";
  }
}
class nt extends De {
  fromJulianDay(e) {
    return lr(this, Le, e);
  }
  toJulianDay(e) {
    return K(Le, e.year, e.month, e.day);
  }
  constructor(...e) {
    super(...e), this.identifier = "islamic-tbla";
  }
}
const at = "qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";
let ue, B;
function H(r) {
  return tt + B[r - u];
}
function J(r, e) {
  let t = r - u, n = 1 << 11 - (e - 1);
  return (ue[t] & n) === 0 ? 29 : 30;
}
function Oe(r, e) {
  let t = H(r);
  for (let n = 1; n < e; n++) t += J(r, n);
  return t;
}
function Qe(r) {
  return B[r + 1 - u] - B[r - u];
}
class ot extends De {
  fromJulianDay(e) {
    let t = e - V, n = H(u), a = H(C);
    if (t < n || t > a) return super.fromJulianDay(e);
    {
      let o = u - 1, i = 1, f = 1;
      for (; f > 0; ) {
        o++, f = t - H(o) + 1;
        let s = Qe(o);
        if (f === s) {
          i = 12;
          break;
        } else if (f < s) {
          let l = J(o, i);
          for (i = 1; f > l; )
            f -= l, i++, l = J(o, i);
          break;
        }
      }
      return new c(this, o, i, t - Oe(o, i) + 1);
    }
  }
  toJulianDay(e) {
    return e.year < u || e.year > C ? super.toJulianDay(e) : V + Oe(e.year, e.month) + (e.day - 1);
  }
  getDaysInMonth(e) {
    return e.year < u || e.year > C ? super.getDaysInMonth(e) : J(e.year, e.month);
  }
  getDaysInYear(e) {
    return e.year < u || e.year > C ? super.getDaysInYear(e) : Qe(e.year);
  }
  constructor() {
    if (super(), this.identifier = "islamic-umalqura", ue || (ue = new Uint16Array(Uint8Array.from(atob(at), (e) => e.charCodeAt(0)).buffer)), !B) {
      B = new Uint32Array(C - u + 1);
      let e = 0;
      for (let t = u; t <= C; t++) {
        B[t - u] = e;
        for (let n = 1; n <= 12; n++) e += J(t, n);
      }
    }
  }
}
const _e = 347997, ur = 1080, hr = 24 * ur, it = 29, ft = 12 * ur + 793, st = it * hr + ft;
function w(r) {
  return S(r * 7 + 1, 19) < 7;
}
function P(r) {
  let e = Math.floor((235 * r - 234) / 19), t = 12084 + 13753 * e, n = e * 29 + Math.floor(t / 25920);
  return S(3 * (n + 1), 7) < 3 && (n += 1), n;
}
function ct(r) {
  let e = P(r - 1), t = P(r);
  return P(r + 1) - t === 356 ? 2 : t - e === 382 ? 1 : 0;
}
function L(r) {
  return P(r) + ct(r);
}
function $r(r) {
  return L(r + 1) - L(r);
}
function lt(r) {
  let e = $r(r);
  switch (e > 380 && (e -= 30), e) {
    case 353:
      return 0;
    // deficient
    case 354:
      return 1;
    // normal
    case 355:
      return 2;
  }
}
function N(r, e) {
  if (e >= 6 && !w(r) && e++, e === 4 || e === 7 || e === 9 || e === 11 || e === 13) return 29;
  let t = lt(r);
  return e === 2 ? t === 2 ? 30 : 29 : e === 3 ? t === 0 ? 29 : 30 : e === 6 ? w(r) ? 30 : 0 : 30;
}
class ut {
  fromJulianDay(e) {
    let t = e - _e, n = t * hr / st, a = Math.floor((19 * n + 234) / 235) + 1, o = L(a), i = Math.floor(t - o);
    for (; i < 1; )
      a--, o = L(a), i = Math.floor(t - o);
    let f = 1, s = 0;
    for (; s < i; )
      s += N(a, f), f++;
    f--, s -= N(a, f);
    let l = i - s;
    return new c(this, a, f, l);
  }
  toJulianDay(e) {
    let t = L(e.year);
    for (let n = 1; n < e.month; n++) t += N(e.year, n);
    return t + e.day + _e;
  }
  getDaysInMonth(e) {
    return N(e.year, e.month);
  }
  getMonthsInYear(e) {
    return w(e.year) ? 13 : 12;
  }
  getDaysInYear(e) {
    return $r(e.year);
  }
  getYearsInEra() {
    return 9999;
  }
  getEras() {
    return [
      "AM"
    ];
  }
  balanceYearMonth(e, t) {
    t.year !== e.year && (w(t.year) && !w(e.year) && t.month > 6 ? e.month-- : !w(t.year) && w(e.year) && t.month > 6 && e.month++);
  }
  constructor() {
    this.identifier = "hebrew";
  }
}
const he = 1723856, Fe = 1824665, $e = 5500;
function G(r, e, t, n) {
  return r + 365 * e + Math.floor(e / 4) + 30 * (t - 1) + n - 1;
}
function pe(r, e) {
  let t = Math.floor(4 * (e - r) / 1461), n = 1 + Math.floor((e - G(r, t, 1, 1)) / 30), a = e + 1 - G(r, t, n, 1);
  return [
    t,
    n,
    a
  ];
}
function dr(r) {
  return Math.floor(r % 4 / 3);
}
function yr(r, e) {
  return e % 13 !== 0 ? 30 : dr(r) + 5;
}
class we {
  fromJulianDay(e) {
    let [t, n, a] = pe(he, e), o = "AM";
    return t <= 0 && (o = "AA", t += $e), new c(this, o, t, n, a);
  }
  toJulianDay(e) {
    let t = e.year;
    return e.era === "AA" && (t -= $e), G(he, t, e.month, e.day);
  }
  getDaysInMonth(e) {
    return yr(e.year, e.month);
  }
  getMonthsInYear() {
    return 13;
  }
  getDaysInYear(e) {
    return 365 + dr(e.year);
  }
  getYearsInEra(e) {
    return e.era === "AA" ? 9999 : 9991;
  }
  getEras() {
    return [
      "AA",
      "AM"
    ];
  }
  constructor() {
    this.identifier = "ethiopic";
  }
}
class ht extends we {
  fromJulianDay(e) {
    let [t, n, a] = pe(he, e);
    return t += $e, new c(this, "AA", t, n, a);
  }
  getEras() {
    return [
      "AA"
    ];
  }
  getYearsInEra() {
    return 9999;
  }
  constructor(...e) {
    super(...e), this.identifier = "ethioaa";
  }
}
class $t extends we {
  fromJulianDay(e) {
    let [t, n, a] = pe(Fe, e), o = "CE";
    return t <= 0 && (o = "BCE", t = 1 - t), new c(this, o, t, n, a);
  }
  toJulianDay(e) {
    let t = e.year;
    return e.era === "BCE" && (t = 1 - t), G(Fe, t, e.month, e.day);
  }
  getDaysInMonth(e) {
    let t = e.year;
    return e.era === "BCE" && (t = 1 - t), yr(t, e.month);
  }
  isInverseEra(e) {
    return e.era === "BCE";
  }
  balanceDate(e) {
    e.year <= 0 && (e.era = e.era === "BCE" ? "CE" : "BCE", e.year = 1 - e.year);
  }
  getEras() {
    return [
      "BCE",
      "CE"
    ];
  }
  getYearsInEra(e) {
    return e.era === "BCE" ? 9999 : 9715;
  }
  constructor(...e) {
    super(...e), this.identifier = "coptic";
  }
}
function kt(r) {
  switch (r) {
    case "buddhist":
      return new Xr();
    case "ethiopic":
      return new we();
    case "ethioaa":
      return new ht();
    case "coptic":
      return new $t();
    case "hebrew":
      return new ut();
    case "indian":
      return new rt();
    case "islamic-civil":
      return new De();
    case "islamic-tbla":
      return new nt();
    case "islamic-umalqura":
      return new ot();
    case "japanese":
      return new jr();
    case "persian":
      return new et();
    case "roc":
      return new zr();
    case "gregory":
    default:
      return new $();
  }
}
let oe = /* @__PURE__ */ new Map();
class dt {
  /** Formats a date as a string according to the locale and format options passed to the constructor. */
  format(e) {
    return this.formatter.format(e);
  }
  /** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */
  formatToParts(e) {
    return this.formatter.formatToParts(e);
  }
  /** Formats a date range as a string. */
  formatRange(e, t) {
    if (typeof this.formatter.formatRange == "function")
      return this.formatter.formatRange(e, t);
    if (t < e) throw new RangeError("End date must be >= start date");
    return `${this.formatter.format(e)} – ${this.formatter.format(t)}`;
  }
  /** Formats a date range as an array of parts. */
  formatRangeToParts(e, t) {
    if (typeof this.formatter.formatRangeToParts == "function")
      return this.formatter.formatRangeToParts(e, t);
    if (t < e) throw new RangeError("End date must be >= start date");
    let n = this.formatter.formatToParts(e), a = this.formatter.formatToParts(t);
    return [
      ...n.map((o) => ({
        ...o,
        source: "startRange"
      })),
      {
        type: "literal",
        value: " – ",
        source: "shared"
      },
      ...a.map((o) => ({
        ...o,
        source: "endRange"
      }))
    ];
  }
  /** Returns the resolved formatting options based on the values passed to the constructor. */
  resolvedOptions() {
    let e = this.formatter.resolvedOptions();
    return bt() && (this.resolvedHourCycle || (this.resolvedHourCycle = gt(e.locale, this.options)), e.hourCycle = this.resolvedHourCycle, e.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12"), e.calendar === "ethiopic-amete-alem" && (e.calendar = "ethioaa"), e;
  }
  constructor(e, t = {}) {
    this.formatter = mr(e, t), this.options = t;
  }
}
const yt = {
  true: {
    // Only Japanese uses the h11 style for 12 hour time. All others use h12.
    ja: "h11"
  },
  false: {}
};
function mr(r, e = {}) {
  if (typeof e.hour12 == "boolean" && mt()) {
    e = {
      ...e
    };
    let a = yt[String(e.hour12)][r.split("-")[0]], o = e.hour12 ? "h12" : "h23";
    e.hourCycle = a ?? o, delete e.hour12;
  }
  let t = r + (e ? Object.entries(e).sort((a, o) => a[0] < o[0] ? -1 : 1).join() : "");
  if (oe.has(t)) return oe.get(t);
  let n = new Intl.DateTimeFormat(r, e);
  return oe.set(t, n), n;
}
let ie = null;
function mt() {
  return ie == null && (ie = new Intl.DateTimeFormat("en-US", {
    hour: "numeric",
    hour12: !1
  }).format(new Date(2020, 2, 3, 0)) === "24"), ie;
}
let fe = null;
function bt() {
  return fe == null && (fe = new Intl.DateTimeFormat("fr", {
    hour: "numeric",
    hour12: !1
  }).resolvedOptions().hourCycle === "h12"), fe;
}
function gt(r, e) {
  if (!e.timeStyle && !e.hour) return;
  r = r.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, ""), r += (r.includes("-u-") ? "" : "-u") + "-nu-latn";
  let t = mr(r, {
    ...e,
    timeZone: void 0
    // use local timezone
  }), n = parseInt(t.formatToParts(new Date(2020, 2, 3, 0)).find((o) => o.type === "hour").value, 10), a = parseInt(t.formatToParts(new Date(2020, 2, 3, 23)).find((o) => o.type === "hour").value, 10);
  if (n === 0 && a === 23) return "h23";
  if (n === 24 && a === 23) return "h24";
  if (n === 0 && a === 11) return "h11";
  if (n === 12 && a === 11) return "h12";
  throw new Error("Unexpected hour cycle result");
}
function Ot(r) {
  r = pr(r ?? {}, Mt);
  let { locale: e } = gr();
  return Dr(() => new dt(e, r), [
    e,
    r
  ]);
}
function Mt(r, e) {
  if (r === e) return !0;
  let t = Object.keys(r), n = Object.keys(e);
  if (t.length !== n.length) return !1;
  for (let a of t)
    if (e[a] !== r[a]) return !1;
  return !0;
}
export {
  dt as $,
  St as A,
  Ct as B,
  Ur as C,
  Rt as D,
  Lt as E,
  Jt as F,
  U as a,
  Tr as b,
  Ve as c,
  Ar as d,
  Ot as e,
  qe as f,
  Z as g,
  At as h,
  xr as i,
  Bt as j,
  pr as k,
  Et as l,
  It as m,
  Ut as n,
  Tt as o,
  xt as p,
  h as q,
  He as r,
  Pe as s,
  Yt as t,
  $ as u,
  kt as v,
  vt as w,
  c as x,
  Me as y,
  Ir as z
};
//# sourceMappingURL=useDateFormatter-9juUpmrj.es.js.map
