var zt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Kt(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function G(t) {
  if (t.__esModule)
    return t;
  var n = t.default;
  if (typeof n == "function") {
    var e = function r() {
      return this instanceof r ? Reflect.construct(n, arguments, this.constructor) : n.apply(this, arguments);
    };
    e.prototype = n.prototype;
  } else
    e = {};
  return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
    var a = Object.getOwnPropertyDescriptor(t, r);
    Object.defineProperty(e, r, a.get ? a : {
      enumerable: !0,
      get: function() {
        return t[r];
      }
    });
  }), e;
}
function m(t) {
  const n = Object.prototype.toString.call(t);
  return t instanceof Date || typeof t == "object" && n === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || n === "[object Number]" || typeof t == "string" || n === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
}
function b(t, n) {
  return t instanceof Date ? new t.constructor(n) : new Date(n);
}
const Q = 6048e5, R = 864e5, Zt = 6e4, te = 36e5, ee = 1e3;
let A = {};
function W() {
  return A;
}
function D(t, n) {
  var u, c, d, h;
  const e = W(), r = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (u = n == null ? void 0 : n.locale) == null ? void 0 : u.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((h = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? 0, a = m(t), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
  return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
}
function x(t) {
  return D(t, { weekStartsOn: 1 });
}
function X(t) {
  const n = m(t), e = n.getFullYear(), r = b(t, 0);
  r.setFullYear(e + 1, 0, 4), r.setHours(0, 0, 0, 0);
  const a = x(r), i = b(t, 0);
  i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0);
  const s = x(i);
  return n.getTime() >= a.getTime() ? e + 1 : n.getTime() >= s.getTime() ? e : e - 1;
}
function C(t) {
  const n = m(t);
  return n.setHours(0, 0, 0, 0), n;
}
function q(t) {
  const n = m(t), e = new Date(
    Date.UTC(
      n.getFullYear(),
      n.getMonth(),
      n.getDate(),
      n.getHours(),
      n.getMinutes(),
      n.getSeconds(),
      n.getMilliseconds()
    )
  );
  return e.setUTCFullYear(n.getFullYear()), +t - +e;
}
function I(t, n) {
  const e = C(t), r = C(n), a = +e - q(e), i = +r - q(r);
  return Math.round((a - i) / R);
}
function V(t) {
  const n = X(t), e = b(t, 0);
  return e.setFullYear(n, 0, 4), e.setHours(0, 0, 0, 0), x(e);
}
function $(t) {
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
}
function J(t) {
  if (!$(t) && typeof t != "number")
    return !1;
  const n = m(t);
  return !isNaN(Number(n));
}
function U(t) {
  const n = m(t), e = b(t, 0);
  return e.setFullYear(n.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
}
const z = {
  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"
  }
}, K = (t, n, e) => {
  let r;
  const a = z[t];
  return typeof a == "string" ? r = a : n === 1 ? r = a.one : r = a.other.replace("{{count}}", n.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
};
function T(t) {
  return (n = {}) => {
    const e = n.width ? String(n.width) : t.defaultWidth;
    return t.formats[e] || t.formats[t.defaultWidth];
  };
}
const 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: T({
    formats: Z,
    defaultWidth: "full"
  }),
  time: T({
    formats: tt,
    defaultWidth: "full"
  }),
  dateTime: T({
    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, n, e, r) => rt[t];
function k(t) {
  return (n, e) => {
    const r = e != null && e.context ? String(e.context) : "standalone";
    let a;
    if (r === "formatting" && t.formattingValues) {
      const s = t.defaultFormattingWidth || t.defaultWidth, u = e != null && e.width ? String(e.width) : s;
      a = t.formattingValues[u] || t.formattingValues[s];
    } else {
      const s = t.defaultWidth, u = e != null && e.width ? String(e.width) : t.defaultWidth;
      a = t.values[u] || t.values[s];
    }
    const i = t.argumentCallback ? t.argumentCallback(n) : n;
    return a[i];
  };
}
const 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, n) => {
  const e = Number(t), r = e % 100;
  if (r > 20 || r < 10)
    switch (r % 10) {
      case 1:
        return e + "st";
      case 2:
        return e + "nd";
      case 3:
        return e + "rd";
    }
  return e + "th";
}, ht = {
  ordinalNumber: ft,
  era: k({
    values: it,
    defaultWidth: "wide"
  }),
  quarter: k({
    values: ot,
    defaultWidth: "wide",
    argumentCallback: (t) => t - 1
  }),
  month: k({
    values: st,
    defaultWidth: "wide"
  }),
  day: k({
    values: ut,
    defaultWidth: "wide"
  }),
  dayPeriod: k({
    values: ct,
    defaultWidth: "wide",
    formattingValues: dt,
    defaultFormattingWidth: "wide"
  })
};
function v(t) {
  return (n, e = {}) => {
    const r = e.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = n.match(a);
    if (!i)
      return null;
    const s = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(u) ? mt(u, (g) => g.test(s)) : (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      lt(u, (g) => g.test(s))
    );
    let d;
    d = t.valueCallback ? t.valueCallback(c) : c, d = e.valueCallback ? (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      e.valueCallback(d)
    ) : d;
    const h = n.slice(s.length);
    return { value: d, rest: h };
  };
}
function lt(t, n) {
  for (const e in t)
    if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
      return e;
}
function mt(t, n) {
  for (let e = 0; e < t.length; e++)
    if (n(t[e]))
      return e;
}
function gt(t) {
  return (n, e = {}) => {
    const r = n.match(t.matchPattern);
    if (!r)
      return null;
    const a = r[0], i = n.match(t.parsePattern);
    if (!i)
      return null;
    let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
    s = e.valueCallback ? e.valueCallback(s) : s;
    const u = n.slice(a.length);
    return { value: s, rest: u };
  };
}
const 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
}, Ot = {
  any: [/^b/i, /^(a|c)/i]
}, Pt = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, Mt = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, kt = {
  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
}, vt = {
  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
  ]
}, Dt = {
  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
}, xt = {
  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
}, St = {
  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
  }
}, Tt = {
  ordinalNumber: gt({
    matchPattern: wt,
    parsePattern: yt,
    valueCallback: (t) => parseInt(t, 10)
  }),
  era: v({
    matchPatterns: bt,
    defaultMatchWidth: "wide",
    parsePatterns: Ot,
    defaultParseWidth: "any"
  }),
  quarter: v({
    matchPatterns: Pt,
    defaultMatchWidth: "wide",
    parsePatterns: Mt,
    defaultParseWidth: "any",
    valueCallback: (t) => t + 1
  }),
  month: v({
    matchPatterns: kt,
    defaultMatchWidth: "wide",
    parsePatterns: vt,
    defaultParseWidth: "any"
  }),
  day: v({
    matchPatterns: Dt,
    defaultMatchWidth: "wide",
    parsePatterns: xt,
    defaultParseWidth: "any"
  }),
  dayPeriod: v({
    matchPatterns: Wt,
    defaultMatchWidth: "any",
    parsePatterns: St,
    defaultParseWidth: "any"
  })
}, Yt = {
  code: "en-US",
  formatDistance: K,
  formatLong: nt,
  formatRelative: at,
  localize: ht,
  match: Tt,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function pt(t) {
  const n = m(t);
  return I(n, U(n)) + 1;
}
function Et(t) {
  const n = m(t), e = +x(n) - +V(n);
  return Math.round(e / Q) + 1;
}
function L(t, n) {
  var h, g, P, M;
  const e = m(t), r = e.getFullYear(), a = W(), i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((g = (h = n == null ? void 0 : n.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (P = a.locale) == null ? void 0 : P.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = b(t, 0);
  s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
  const u = D(s, n), c = b(t, 0);
  c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
  const d = D(c, n);
  return e.getTime() >= u.getTime() ? r + 1 : e.getTime() >= d.getTime() ? r : r - 1;
}
function Ft(t, n) {
  var u, c, d, h;
  const e = W(), r = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((c = (u = n == null ? void 0 : n.locale) == null ? void 0 : u.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((h = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, a = L(t, n), i = b(t, 0);
  return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), D(i, n);
}
function Ct(t, n) {
  const e = m(t), r = +D(e, n) - +Ft(e, n);
  return Math.round(r / Q) + 1;
}
function o(t, n) {
  const e = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(n, "0");
  return e + r;
}
const w = {
  // Year
  y(t, n) {
    const e = t.getFullYear(), r = e > 0 ? e : 1 - e;
    return o(n === "yy" ? r % 100 : r, n.length);
  },
  // Month
  M(t, n) {
    const e = t.getMonth();
    return n === "M" ? String(e + 1) : o(e + 1, 2);
  },
  // Day of the month
  d(t, n) {
    return o(t.getDate(), n.length);
  },
  // AM or PM
  a(t, n) {
    const e = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (n) {
      case "a":
      case "aa":
        return e.toUpperCase();
      case "aaa":
        return e;
      case "aaaaa":
        return e[0];
      case "aaaa":
      default:
        return e === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(t, n) {
    return o(t.getHours() % 12 || 12, n.length);
  },
  // Hour [0-23]
  H(t, n) {
    return o(t.getHours(), n.length);
  },
  // Minute
  m(t, n) {
    return o(t.getMinutes(), n.length);
  },
  // Second
  s(t, n) {
    return o(t.getSeconds(), n.length);
  },
  // Fraction of second
  S(t, n) {
    const e = n.length, r = t.getMilliseconds(), a = Math.trunc(
      r * Math.pow(10, e - 3)
    );
    return o(a, n.length);
  }
}, O = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, N = {
  // Era
  G: function(t, n, e) {
    const r = t.getFullYear() > 0 ? 1 : 0;
    switch (n) {
      case "G":
      case "GG":
      case "GGG":
        return e.era(r, { width: "abbreviated" });
      case "GGGGG":
        return e.era(r, { width: "narrow" });
      case "GGGG":
      default:
        return e.era(r, { width: "wide" });
    }
  },
  // Year
  y: function(t, n, e) {
    if (n === "yo") {
      const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
      return e.ordinalNumber(a, { unit: "year" });
    }
    return w.y(t, n);
  },
  // Local week-numbering year
  Y: function(t, n, e, r) {
    const a = L(t, r), i = a > 0 ? a : 1 - a;
    if (n === "YY") {
      const s = i % 100;
      return o(s, 2);
    }
    return n === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : o(i, n.length);
  },
  // ISO week-numbering year
  R: function(t, n) {
    const e = X(t);
    return o(e, n.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(t, n) {
    const e = t.getFullYear();
    return o(e, n.length);
  },
  // Quarter
  Q: function(t, n, e) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (n) {
      case "Q":
        return String(r);
      case "QQ":
        return o(r, 2);
      case "Qo":
        return e.ordinalNumber(r, { unit: "quarter" });
      case "QQQ":
        return e.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return e.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return e.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(t, n, e) {
    const r = Math.ceil((t.getMonth() + 1) / 3);
    switch (n) {
      case "q":
        return String(r);
      case "qq":
        return o(r, 2);
      case "qo":
        return e.ordinalNumber(r, { unit: "quarter" });
      case "qqq":
        return e.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return e.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return e.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(t, n, e) {
    const r = t.getMonth();
    switch (n) {
      case "M":
      case "MM":
        return w.M(t, n);
      case "Mo":
        return e.ordinalNumber(r + 1, { unit: "month" });
      case "MMM":
        return e.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return e.month(r, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return e.month(r, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(t, n, e) {
    const r = t.getMonth();
    switch (n) {
      case "L":
        return String(r + 1);
      case "LL":
        return o(r + 1, 2);
      case "Lo":
        return e.ordinalNumber(r + 1, { unit: "month" });
      case "LLL":
        return e.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return e.month(r, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return e.month(r, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(t, n, e, r) {
    const a = Ct(t, r);
    return n === "wo" ? e.ordinalNumber(a, { unit: "week" }) : o(a, n.length);
  },
  // ISO week of year
  I: function(t, n, e) {
    const r = Et(t);
    return n === "Io" ? e.ordinalNumber(r, { unit: "week" }) : o(r, n.length);
  },
  // Day of the month
  d: function(t, n, e) {
    return n === "do" ? e.ordinalNumber(t.getDate(), { unit: "date" }) : w.d(t, n);
  },
  // Day of year
  D: function(t, n, e) {
    const r = pt(t);
    return n === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : o(r, n.length);
  },
  // Day of week
  E: function(t, n, e) {
    const r = t.getDay();
    switch (n) {
      case "E":
      case "EE":
      case "EEE":
        return e.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return e.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return e.day(r, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return e.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(t, n, e, r) {
    const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (n) {
      case "e":
        return String(i);
      case "ee":
        return o(i, 2);
      case "eo":
        return e.ordinalNumber(i, { unit: "day" });
      case "eee":
        return e.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return e.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return e.day(a, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return e.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(t, n, e, r) {
    const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
    switch (n) {
      case "c":
        return String(i);
      case "cc":
        return o(i, n.length);
      case "co":
        return e.ordinalNumber(i, { unit: "day" });
      case "ccc":
        return e.day(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return e.day(a, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return e.day(a, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return e.day(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(t, n, e) {
    const r = t.getDay(), a = r === 0 ? 7 : r;
    switch (n) {
      case "i":
        return String(a);
      case "ii":
        return o(a, n.length);
      case "io":
        return e.ordinalNumber(a, { unit: "day" });
      case "iii":
        return e.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return e.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return e.day(r, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return e.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(t, n, e) {
    const a = t.getHours() / 12 >= 1 ? "pm" : "am";
    switch (n) {
      case "a":
      case "aa":
        return e.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return e.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return e.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return e.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(t, n, e) {
    const r = t.getHours();
    let a;
    switch (r === 12 ? a = O.noon : r === 0 ? a = O.midnight : a = r / 12 >= 1 ? "pm" : "am", n) {
      case "b":
      case "bb":
        return e.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return e.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return e.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return e.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(t, n, e) {
    const r = t.getHours();
    let a;
    switch (r >= 17 ? a = O.evening : r >= 12 ? a = O.afternoon : r >= 4 ? a = O.morning : a = O.night, n) {
      case "B":
      case "BB":
      case "BBB":
        return e.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return e.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return e.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(t, n, e) {
    if (n === "ho") {
      let r = t.getHours() % 12;
      return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
    }
    return w.h(t, n);
  },
  // Hour [0-23]
  H: function(t, n, e) {
    return n === "Ho" ? e.ordinalNumber(t.getHours(), { unit: "hour" }) : w.H(t, n);
  },
  // Hour [0-11]
  K: function(t, n, e) {
    const r = t.getHours() % 12;
    return n === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, n.length);
  },
  // Hour [1-24]
  k: function(t, n, e) {
    let r = t.getHours();
    return r === 0 && (r = 24), n === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : o(r, n.length);
  },
  // Minute
  m: function(t, n, e) {
    return n === "mo" ? e.ordinalNumber(t.getMinutes(), { unit: "minute" }) : w.m(t, n);
  },
  // Second
  s: function(t, n, e) {
    return n === "so" ? e.ordinalNumber(t.getSeconds(), { unit: "second" }) : w.s(t, n);
  },
  // Fraction of second
  S: function(t, n) {
    return w.S(t, n);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(t, n, e) {
    const r = t.getTimezoneOffset();
    if (r === 0)
      return "Z";
    switch (n) {
      case "X":
        return j(r);
      case "XXXX":
      case "XX":
        return y(r);
      case "XXXXX":
      case "XXX":
      default:
        return y(r, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(t, n, e) {
    const r = t.getTimezoneOffset();
    switch (n) {
      case "x":
        return j(r);
      case "xxxx":
      case "xx":
        return y(r);
      case "xxxxx":
      case "xxx":
      default:
        return y(r, ":");
    }
  },
  // Timezone (GMT)
  O: function(t, n, e) {
    const r = t.getTimezoneOffset();
    switch (n) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + _(r, ":");
      case "OOOO":
      default:
        return "GMT" + y(r, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(t, n, e) {
    const r = t.getTimezoneOffset();
    switch (n) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + _(r, ":");
      case "zzzz":
      default:
        return "GMT" + y(r, ":");
    }
  },
  // Seconds timestamp
  t: function(t, n, e) {
    const r = Math.trunc(t.getTime() / 1e3);
    return o(r, n.length);
  },
  // Milliseconds timestamp
  T: function(t, n, e) {
    const r = t.getTime();
    return o(r, n.length);
  }
};
function _(t, n = "") {
  const e = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
  return i === 0 ? e + String(a) : e + String(a) + n + o(i, 2);
}
function j(t, n) {
  return t % 60 === 0 ? (t > 0 ? "-" : "+") + o(Math.abs(t) / 60, 2) : y(t, n);
}
function y(t, n = "") {
  const e = t > 0 ? "-" : "+", r = Math.abs(t), a = o(Math.trunc(r / 60), 2), i = o(r % 60, 2);
  return e + a + n + i;
}
const H = (t, n) => {
  switch (t) {
    case "P":
      return n.date({ width: "short" });
    case "PP":
      return n.date({ width: "medium" });
    case "PPP":
      return n.date({ width: "long" });
    case "PPPP":
    default:
      return n.date({ width: "full" });
  }
}, B = (t, n) => {
  switch (t) {
    case "p":
      return n.time({ width: "short" });
    case "pp":
      return n.time({ width: "medium" });
    case "ppp":
      return n.time({ width: "long" });
    case "pppp":
    default:
      return n.time({ width: "full" });
  }
}, qt = (t, n) => {
  const e = t.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
  if (!a)
    return H(t, n);
  let i;
  switch (r) {
    case "P":
      i = n.dateTime({ width: "short" });
      break;
    case "PP":
      i = n.dateTime({ width: "medium" });
      break;
    case "PPP":
      i = n.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      i = n.dateTime({ width: "full" });
      break;
  }
  return i.replace("{{date}}", H(r, n)).replace("{{time}}", B(a, n));
}, Nt = {
  p: B,
  P: qt
}, _t = /^D+$/, jt = /^Y+$/, Ht = ["D", "DD", "YY", "YYYY"];
function Qt(t) {
  return _t.test(t);
}
function Xt(t) {
  return jt.test(t);
}
function Lt(t, n, e) {
  const r = Bt(t, n, e);
  if (console.warn(r), Ht.includes(t))
    throw new RangeError(r);
}
function Bt(t, n, e) {
  const r = t[0] === "Y" ? "years" : "days of the month";
  return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const Gt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Rt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, At = /^'([^]*?)'?$/, It = /''/g, Vt = /[a-zA-Z]/;
function ne(t, n, e) {
  var h, g, P, M, Y, p, E, F;
  const r = W(), a = (e == null ? void 0 : e.locale) ?? r.locale ?? Yt, i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((g = (h = e == null ? void 0 : e.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((M = (P = r.locale) == null ? void 0 : P.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = (e == null ? void 0 : e.weekStartsOn) ?? ((p = (Y = e == null ? void 0 : e.locale) == null ? void 0 : Y.options) == null ? void 0 : p.weekStartsOn) ?? r.weekStartsOn ?? ((F = (E = r.locale) == null ? void 0 : E.options) == null ? void 0 : F.weekStartsOn) ?? 0, u = m(t);
  if (!J(u))
    throw new RangeError("Invalid time value");
  let c = n.match(Rt).map((l) => {
    const f = l[0];
    if (f === "p" || f === "P") {
      const S = Nt[f];
      return S(l, a.formatLong);
    }
    return l;
  }).join("").match(Gt).map((l) => {
    if (l === "''")
      return { isToken: !1, value: "'" };
    const f = l[0];
    if (f === "'")
      return { isToken: !1, value: $t(l) };
    if (N[f])
      return { isToken: !0, value: l };
    if (f.match(Vt))
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + f + "`"
      );
    return { isToken: !1, value: l };
  });
  a.localize.preprocessor && (c = a.localize.preprocessor(u, c));
  const d = {
    firstWeekContainsDate: i,
    weekStartsOn: s,
    locale: a
  };
  return c.map((l) => {
    if (!l.isToken)
      return l.value;
    const f = l.value;
    (!(e != null && e.useAdditionalWeekYearTokens) && Xt(f) || !(e != null && e.useAdditionalDayOfYearTokens) && Qt(f)) && Lt(f, n, String(t));
    const S = N[f[0]];
    return S(u, f, a.localize, d);
  }).join("");
}
function $t(t) {
  const n = t.match(At);
  return n ? n[1].replace(It, "'") : t;
}
const Jt = {}, Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Jt
}, Symbol.toStringTag, { value: "Module" })), re = /* @__PURE__ */ G(Ut);
export {
  W as a,
  Zt as b,
  b as c,
  ee as d,
  L as e,
  x as f,
  Kt as g,
  Ct as h,
  Et as i,
  q as j,
  Yt as k,
  Nt as l,
  te as m,
  Xt as n,
  Qt as o,
  ne as p,
  zt as q,
  re as r,
  D as s,
  m as t,
  Lt as w
};
//# sourceMappingURL=___vite-browser-external_commonjs-proxy-4cfd28c1.js.map
