var I = 365.2425, Q = Math.pow(10, 8) * 24 * 60 * 60 * 1e3, $t = -Q, C = 6048e5, j = 864e5, Ut = 6e4, Kt = 36e5, A = 3600, E = A * 24, Zt = E * 7, R = E * I, L = R / 12, zt = L * 3, W = /* @__PURE__ */ Symbol.for("constructDateFrom");
function l(t, e) {
  return typeof t == "function" ? t(e) : t && typeof t == "object" && W in t ? t[W](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
}
function f(t, e) {
  return l(e || t, t);
}
function G(t, e, n) {
  const r = f(t, n?.in);
  return isNaN(e) ? l(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
}
var V = {};
function k() {
  return V;
}
function p(t, e) {
  const n = k(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = f(t, e?.in), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
  return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
}
function M(t, e) {
  return p(t, {
    ...e,
    weekStartsOn: 1
  });
}
function N(t, e) {
  const n = f(t, e?.in), r = n.getFullYear(), a = l(n, 0);
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
  const i = M(a), o = l(n, 0);
  o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
  const u = M(o);
  return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
}
function x(t) {
  const e = f(t), n = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
}
function q(t, ...e) {
  const n = l.bind(null, t || e.find((r) => typeof r == "object"));
  return e.map(n);
}
function O(t, e) {
  const n = f(t, e?.in);
  return n.setHours(0, 0, 0, 0), n;
}
function X(t, e, n) {
  const [r, a] = q(n?.in, t, e), i = O(r), o = O(a), u = +i - x(i), h = +o - x(o);
  return Math.round((u - h) / j);
}
function B(t, e) {
  const n = N(t, e), r = l(e?.in || t, 0);
  return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), M(r);
}
function te(t, e, n) {
  return G(t, e * 7, n);
}
function ee(t, e, n) {
  const [r, a] = q(n?.in, t, e);
  return +O(r) == +O(a);
}
function J(t) {
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
}
function $(t) {
  return !(!J(t) && typeof t != "number" || isNaN(+f(t)));
}
function U(t, e) {
  const n = f(t, e?.in);
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function ne(t, e) {
  const n = k(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = f(t, e?.in), i = a.getDay(), o = (i < r ? -7 : 0) + 6 - (i - r);
  return a.setDate(a.getDate() + o), a.setHours(23, 59, 59, 999), a;
}
var K = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, Z = (t, e, n) => {
  let r;
  const a = K[t];
  return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
};
function D(t) {
  return (e = {}) => {
    const n = e.width ? String(e.width) : t.defaultWidth;
    return t.formats[n] || t.formats[t.defaultWidth];
  };
}
var z = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, tt = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, et = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, nt = {
  date: D({
    formats: z,
    defaultWidth: "full"
  }),
  time: D({
    formats: tt,
    defaultWidth: "full"
  }),
  dateTime: D({
    formats: et,
    defaultWidth: "full"
  })
}, rt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, at = (t, e, n, r) => rt[t];
function b(t) {
  return (e, n) => {
    const r = n?.context ? String(n.context) : "standalone";
    let a;
    if (r === "formatting" && t.formattingValues) {
      const o = t.defaultFormattingWidth || t.defaultWidth, u = n?.width ? String(n.width) : o;
      a = t.formattingValues[u] || t.formattingValues[o];
    } else {
      const o = t.defaultWidth, u = n?.width ? String(n.width) : t.defaultWidth;
      a = t.values[u] || t.values[o];
    }
    const i = t.argumentCallback ? t.argumentCallback(e) : e;
    return a[i];
  };
}
var it = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, ot = {
  narrow: [
    "1",
    "2",
    "3",
    "4"
  ],
  abbreviated: [
    "Q1",
    "Q2",
    "Q3",
    "Q4"
  ],
  wide: [
    "1st quarter",
    "2nd quarter",
    "3rd quarter",
    "4th quarter"
  ]
}, st = {
  narrow: [
    "J",
    "F",
    "M",
    "A",
    "M",
    "J",
    "J",
    "A",
    "S",
    "O",
    "N",
    "D"
  ],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
}, ut = {
  narrow: [
    "S",
    "M",
    "T",
    "W",
    "T",
    "F",
    "S"
  ],
  short: [
    "Su",
    "Mo",
    "Tu",
    "We",
    "Th",
    "Fr",
    "Sa"
  ],
  abbreviated: [
    "Sun",
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri",
    "Sat"
  ],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
}, ct = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, dt = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, ft = (t, e) => {
  const n = Number(t), r = n % 100;
  if (r > 20 || r < 10) switch (r % 10) {
    case 1:
      return n + "st";
    case 2:
      return n + "nd";
    case 3:
      return n + "rd";
  }
  return n + "th";
}, ht = {
  ordinalNumber: ft,
  era: b({
    values: it,
    defaultWidth: "wide"
  }),
  quarter: b({
    values: ot,
    defaultWidth: "wide",
    argumentCallback: (t) => t - 1
  }),
  month: b({
    values: st,
    defaultWidth: "wide"
  }),
  day: b({
    values: ut,
    defaultWidth: "wide"
  }),
  dayPeriod: b({
    values: ct,
    defaultWidth: "wide",
    formattingValues: dt,
    defaultFormattingWidth: "wide"
  })
};
function v(t) {
  return (e, n = {}) => {
    const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
    if (!i) return null;
    const o = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(u) ? lt(u, (c) => c.test(o)) : mt(u, (c) => c.test(o));
    let m;
    m = t.valueCallback ? t.valueCallback(h) : h, m = n.valueCallback ? n.valueCallback(m) : m;
    const d = e.slice(o.length);
    return {
      value: m,
      rest: d
    };
  };
}
function mt(t, e) {
  for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n])) return n;
}
function lt(t, e) {
  for (let n = 0; n < t.length; n++) if (e(t[n])) return n;
}
function gt(t) {
  return (e, n = {}) => {
    const r = e.match(t.matchPattern);
    if (!r) return null;
    const a = r[0], i = e.match(t.parsePattern);
    if (!i) return null;
    let o = t.valueCallback ? t.valueCallback(i[0]) : i[0];
    o = n.valueCallback ? n.valueCallback(o) : o;
    const u = e.slice(a.length);
    return {
      value: o,
      rest: u
    };
  };
}
var wt = /^(\d+)(th|st|nd|rd)?/i, yt = /\d+/i, bt = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, vt = { any: [/^b/i, /^(a|c)/i] }, pt = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, kt = { any: [
  /1/i,
  /2/i,
  /3/i,
  /4/i
] }, Mt = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, Ot = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
}, Pt = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, Dt = {
  narrow: [
    /^s/i,
    /^m/i,
    /^t/i,
    /^w/i,
    /^t/i,
    /^f/i,
    /^s/i
  ],
  any: [
    /^su/i,
    /^m/i,
    /^tu/i,
    /^w/i,
    /^th/i,
    /^f/i,
    /^sa/i
  ]
}, Wt = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, xt = { any: {
  am: /^a/i,
  pm: /^p/i,
  midnight: /^mi/i,
  noon: /^no/i,
  morning: /morning/i,
  afternoon: /afternoon/i,
  evening: /evening/i,
  night: /night/i
} }, St = {
  ordinalNumber: gt({
    matchPattern: wt,
    parsePattern: yt,
    valueCallback: (t) => parseInt(t, 10)
  }),
  era: v({
    matchPatterns: bt,
    defaultMatchWidth: "wide",
    parsePatterns: vt,
    defaultParseWidth: "any"
  }),
  quarter: v({
    matchPatterns: pt,
    defaultMatchWidth: "wide",
    parsePatterns: kt,
    defaultParseWidth: "any",
    valueCallback: (t) => t + 1
  }),
  month: v({
    matchPatterns: Mt,
    defaultMatchWidth: "wide",
    parsePatterns: Ot,
    defaultParseWidth: "any"
  }),
  day: v({
    matchPatterns: Pt,
    defaultMatchWidth: "wide",
    parsePatterns: Dt,
    defaultParseWidth: "any"
  }),
  dayPeriod: v({
    matchPatterns: Wt,
    defaultMatchWidth: "any",
    parsePatterns: xt,
    defaultParseWidth: "any"
  })
}, Yt = {
  code: "en-US",
  formatDistance: Z,
  formatLong: nt,
  formatRelative: at,
  localize: ht,
  match: St,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function Tt(t, e) {
  const n = f(t, e?.in);
  return X(n, U(n)) + 1;
}
function Ft(t, e) {
  const n = f(t, e?.in), r = +M(n) - +B(n);
  return Math.round(r / C) + 1;
}
function H(t, e) {
  const n = f(t, e?.in), r = n.getFullYear(), a = k(), i = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, o = l(e?.in || t, 0);
  o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
  const u = p(o, e), h = l(e?.in || t, 0);
  h.setFullYear(r, 0, i), h.setHours(0, 0, 0, 0);
  const m = p(h, e);
  return +n >= +u ? r + 1 : +n >= +m ? r : r - 1;
}
function Ct(t, e) {
  const n = k(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = H(t, e), i = l(e?.in || t, 0);
  return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), p(i, e);
}
function Et(t, e) {
  const n = f(t, e?.in), r = +p(n, e) - +Ct(n, e);
  return Math.round(r / C) + 1;
}
function s(t, e) {
  return (t < 0 ? "-" : "") + Math.abs(t).toString().padStart(e, "0");
}
var g = {
  y(t, e) {
    const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
    return s(e === "yy" ? r % 100 : r, e.length);
  },
  M(t, e) {
    const n = t.getMonth();
    return e === "M" ? String(n + 1) : s(n + 1, 2);
  },
  d(t, e) {
    return s(t.getDate(), e.length);
  },
  a(t, e) {
    const n = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (e) {
      case "a":
      case "aa":
        return n.toUpperCase();
      case "aaa":
        return n;
      case "aaaaa":
        return n[0];
      default:
        return n === "am" ? "a.m." : "p.m.";
    }
  },
  h(t, e) {
    return s(t.getHours() % 12 || 12, e.length);
  },
  H(t, e) {
    return s(t.getHours(), e.length);
  },
  m(t, e) {
    return s(t.getMinutes(), e.length);
  },
  s(t, e) {
    return s(t.getSeconds(), e.length);
  },
  S(t, e) {
    const n = e.length, r = t.getMilliseconds();
    return s(Math.trunc(r * Math.pow(10, n - 3)), e.length);
  }
}, y = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, S = {
  G: function(t, e, n) {
    const r = t.getFullYear() > 0 ? 1 : 0;
    switch (e) {
      case "G":
      case "GG":
      case "GGG":
        return n.era(r, { width: "abbreviated" });
      case "GGGGG":
        return n.era(r, { width: "narrow" });
      default:
        return n.era(r, { width: "wide" });
    }
  },
  y: function(t, e, n) {
    if (e === "yo") {
      const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
      return n.ordinalNumber(a, { unit: "year" });
    }
    return g.y(t, e);
  },
  Y: function(t, e, n, r) {
    const a = H(t, r), i = a > 0 ? a : 1 - a;
    return e === "YY" ? s(i % 100, 2) : e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : s(i, e.length);
  },
  R: function(t, e) {
    return s(N(t), e.length);
  },
  u: function(t, e) {
    return s(t.getFullYear(), e.length);
  },
  Q: function(t, e, n) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (e) {
      case "Q":
        return String(r);
      case "QQ":
        return s(r, 2);
      case "Qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "QQQ":
        return n.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return n.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      default:
        return n.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  q: function(t, e, n) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (e) {
      case "q":
        return String(r);
      case "qq":
        return s(r, 2);
      case "qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "qqq":
        return n.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return n.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      default:
        return n.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  M: function(t, e, n) {
    const r = t.getMonth();
    switch (e) {
      case "M":
      case "MM":
        return g.M(t, e);
      case "Mo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "MMM":
        return n.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return n.month(r, {
          width: "narrow",
          context: "formatting"
        });
      default:
        return n.month(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  L: function(t, e, n) {
    const r = t.getMonth();
    switch (e) {
      case "L":
        return String(r + 1);
      case "LL":
        return s(r + 1, 2);
      case "Lo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "LLL":
        return n.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return n.month(r, {
          width: "narrow",
          context: "standalone"
        });
      default:
        return n.month(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  w: function(t, e, n, r) {
    const a = Et(t, r);
    return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, e.length);
  },
  I: function(t, e, n) {
    const r = Ft(t);
    return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, e.length);
  },
  d: function(t, e, n) {
    return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : g.d(t, e);
  },
  D: function(t, e, n) {
    const r = Tt(t);
    return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, e.length);
  },
  E: function(t, e, n) {
    const r = t.getDay();
    switch (e) {
      case "E":
      case "EE":
      case "EEE":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  e: function(t, e, n, r) {
    const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (e) {
      case "e":
        return String(i);
      case "ee":
        return s(i, 2);
      case "eo":
        return n.ordinalNumber(i, { unit: "day" });
      case "eee":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  c: function(t, e, n, r) {
    const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (e) {
      case "c":
        return String(i);
      case "cc":
        return s(i, e.length);
      case "co":
        return n.ordinalNumber(i, { unit: "day" });
      case "ccc":
        return n.day(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return n.day(a, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return n.day(a, {
          width: "short",
          context: "standalone"
        });
      default:
        return n.day(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  i: function(t, e, n) {
    const r = t.getDay(), a = r === 0 ? 7 : r;
    switch (e) {
      case "i":
        return String(a);
      case "ii":
        return s(a, e.length);
      case "io":
        return n.ordinalNumber(a, { unit: "day" });
      case "iii":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  a: function(t, e, n) {
    const r = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (e) {
      case "a":
      case "aa":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(r, {
          width: "narrow",
          context: "formatting"
        });
      default:
        return n.dayPeriod(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  b: function(t, e, n) {
    const r = t.getHours();
    let a;
    switch (r === 12 ? a = y.noon : r === 0 ? a = y.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
      case "b":
      case "bb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  B: function(t, e, n) {
    const r = t.getHours();
    let a;
    switch (r >= 17 ? a = y.evening : r >= 12 ? a = y.afternoon : r >= 4 ? a = y.morning : a = y.night, e) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  h: function(t, e, n) {
    if (e === "ho") {
      let r = t.getHours() % 12;
      return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
    }
    return g.h(t, e);
  },
  H: function(t, e, n) {
    return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : g.H(t, e);
  },
  K: function(t, e, n) {
    const r = t.getHours() % 12;
    return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
  },
  k: function(t, e, n) {
    let r = t.getHours();
    return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
  },
  m: function(t, e, n) {
    return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : g.m(t, e);
  },
  s: function(t, e, n) {
    return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : g.s(t, e);
  },
  S: function(t, e) {
    return g.S(t, e);
  },
  X: function(t, e, n) {
    const r = t.getTimezoneOffset();
    if (r === 0) return "Z";
    switch (e) {
      case "X":
        return T(r);
      case "XXXX":
      case "XX":
        return w(r);
      default:
        return w(r, ":");
    }
  },
  x: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      case "x":
        return T(r);
      case "xxxx":
      case "xx":
        return w(r);
      default:
        return w(r, ":");
    }
  },
  O: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Y(r, ":");
      default:
        return "GMT" + w(r, ":");
    }
  },
  z: function(t, e, n) {
    const r = t.getTimezoneOffset();
    switch (e) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Y(r, ":");
      default:
        return "GMT" + w(r, ":");
    }
  },
  t: function(t, e, n) {
    return s(Math.trunc(+t / 1e3), e.length);
  },
  T: function(t, e, n) {
    return s(+t, e.length);
  }
};
function Y(t, e = "") {
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
  return i === 0 ? n + String(a) : n + String(a) + e + s(i, 2);
}
function T(t, e) {
  return t % 60 === 0 ? (t > 0 ? "-" : "+") + s(Math.abs(t) / 60, 2) : w(t, e);
}
function w(t, e = "") {
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = s(Math.trunc(r / 60), 2), i = s(r % 60, 2);
  return n + a + e + i;
}
var F = (t, e) => {
  switch (t) {
    case "P":
      return e.date({ width: "short" });
    case "PP":
      return e.date({ width: "medium" });
    case "PPP":
      return e.date({ width: "long" });
    default:
      return e.date({ width: "full" });
  }
}, _ = (t, e) => {
  switch (t) {
    case "p":
      return e.time({ width: "short" });
    case "pp":
      return e.time({ width: "medium" });
    case "ppp":
      return e.time({ width: "long" });
    default:
      return e.time({ width: "full" });
  }
}, Nt = (t, e) => {
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
  if (!a) return F(t, e);
  let i;
  switch (r) {
    case "P":
      i = e.dateTime({ width: "short" });
      break;
    case "PP":
      i = e.dateTime({ width: "medium" });
      break;
    case "PPP":
      i = e.dateTime({ width: "long" });
      break;
    default:
      i = e.dateTime({ width: "full" });
      break;
  }
  return i.replace("{{date}}", F(r, e)).replace("{{time}}", _(a, e));
}, qt = {
  p: _,
  P: Nt
}, Ht = /^D+$/, _t = /^Y+$/, It = [
  "D",
  "DD",
  "YY",
  "YYYY"
];
function Qt(t) {
  return Ht.test(t);
}
function jt(t) {
  return _t.test(t);
}
function At(t, e, n) {
  const r = Rt(t, e, n);
  if (console.warn(r), It.includes(t)) throw new RangeError(r);
}
function Rt(t, e, n) {
  const r = t[0] === "Y" ? "years" : "days of the month";
  return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
var Lt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Gt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Vt = /^'([^]*?)'?$/, Xt = /''/g, Bt = /[a-zA-Z]/;
function re(t, e, n) {
  const r = k(), a = n?.locale ?? r.locale ?? Yt, i = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, u = f(t, n?.in);
  if (!$(u)) throw new RangeError("Invalid time value");
  let h = e.match(Gt).map((d) => {
    const c = d[0];
    if (c === "p" || c === "P") {
      const P = qt[c];
      return P(d, a.formatLong);
    }
    return d;
  }).join("").match(Lt).map((d) => {
    if (d === "''") return {
      isToken: !1,
      value: "'"
    };
    const c = d[0];
    if (c === "'") return {
      isToken: !1,
      value: Jt(d)
    };
    if (S[c]) return {
      isToken: !0,
      value: d
    };
    if (c.match(Bt)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + c + "`");
    return {
      isToken: !1,
      value: d
    };
  });
  a.localize.preprocessor && (h = a.localize.preprocessor(u, h));
  const m = {
    firstWeekContainsDate: i,
    weekStartsOn: o,
    locale: a
  };
  return h.map((d) => {
    if (!d.isToken) return d.value;
    const c = d.value;
    (!n?.useAdditionalWeekYearTokens && jt(c) || !n?.useAdditionalDayOfYearTokens && Qt(c)) && At(c, e, String(t));
    const P = S[c[0]];
    return P(u, c, a.localize, m);
  }).join("");
}
function Jt(t) {
  const e = t.match(Vt);
  return e ? e[1].replace(Xt, "'") : t;
}
export {
  l as _,
  ne as a,
  ee as c,
  O as d,
  q as f,
  f as g,
  G as h,
  Yt as i,
  te as l,
  p as m,
  Et as n,
  U as o,
  M as p,
  Ft as r,
  J as s,
  re as t,
  X as u,
  Kt as v,
  Ut as y
};

//# sourceMappingURL=format.js.map