UNPKG

welcome-ui

Version:

Customizable design system with react • styled-components • styled-system and ariakit.

1,954 lines (1,953 loc) 261 kB
"use client"; var ya = Object.defineProperty; var Da = (n, a, t) => a in n ? ya(n, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[a] = t; var b = (n, a, t) => Da(n, typeof a != "symbol" ? a + "" : a, t); import { j as X } from "./jsx-runtime-Bqq1Hxg9.mjs"; import * as T from "react"; import f, { useLayoutEffect as Hr, cloneElement as Qr, createRef as Pe, Component as Z, useRef as Qt, useCallback as xa, useEffect as qr, createElement as Ma, useState as tr, useMemo as rr, forwardRef as Ca } from "react"; import { StyledButton as Sa, Button as ar } from "./Button.mjs"; import { StyledIcon as Pa } from "./Icon.mjs"; import { L as Ea } from "./index-eYXK9_x4.mjs"; import { R as Ta } from "./index-DtWZjMb5.mjs"; import { StyledSelect as Oa, Select as nr } from "./Select.mjs"; import { g as Na } from "./_commonjsHelpers-CXJ7dpIk.mjs"; import { ClearButton as Ya } from "./ClearButton.mjs"; import { IconGroupWrapper as Br, IconWrapper as Kr } from "./Field.mjs"; import { d as jr, F as Ia } from "./field-styles-CfVLcVQp.mjs"; import Ke, { system as Vr, css as je, th as at } from "@xstyled/styled-components"; import { r as Ra, R as La } from "./index-Dct42YPA.mjs"; import { A as Fa, L as Aa, g as or, N as Wa, B as Ha } from "./floating-ui.dom.browser.min-Bza9K_UR.mjs"; function $r(n) { var a, t, e = ""; if (typeof n == "string" || typeof n == "number") e += n; else if (typeof n == "object") if (Array.isArray(n)) { var r = n.length; for (a = 0; a < r; a++) n[a] && (t = $r(n[a])) && (e && (e += " "), e += t); } else for (t in n) n[t] && (e && (e += " "), e += t); return e; } function ee() { for (var n, a, t = 0, e = "", r = arguments.length; t < r; t++) (n = arguments[t]) && (a = $r(n)) && (e && (e += " "), e += a); return e; } const Ur = 6048e5, Qa = 864e5, St = 6e4, Pt = 36e5, qa = 1e3, ir = Symbol.for("constructDateFrom"); function B(n, a) { return typeof n == "function" ? n(a) : n && typeof n == "object" && ir in n ? n[ir](a) : n instanceof Date ? new n.constructor(a) : new Date(a); } function x(n, a) { return B(a || n, n); } function de(n, a, t) { const e = x(n, t == null ? void 0 : t.in); return isNaN(a) ? B((t == null ? void 0 : t.in) || n, NaN) : (a && e.setDate(e.getDate() + a), e); } function ue(n, a, t) { const e = x(n, t == null ? void 0 : t.in); if (isNaN(a)) return B(n, NaN); if (!a) return e; const r = e.getDate(), o = B(n, e.getTime()); o.setMonth(e.getMonth() + a + 1, 0); const i = o.getDate(); return r >= i ? o : (e.setFullYear( o.getFullYear(), o.getMonth(), r ), e); } function zr(n, a, t) { return B(n, +x(n) + a); } function Ba(n, a, t) { return zr(n, a * Pt); } let Ka = {}; function Le() { return Ka; } function ye(n, a) { var s, c, d, l; const t = Le(), e = (a == null ? void 0 : a.weekStartsOn) ?? ((c = (s = a == null ? void 0 : a.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? t.weekStartsOn ?? ((l = (d = t.locale) == null ? void 0 : d.options) == null ? void 0 : l.weekStartsOn) ?? 0, r = x(n, a == null ? void 0 : a.in), o = r.getDay(), i = (o < e ? 7 : 0) + o - e; return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r; } function He(n, a) { return ye(n, { ...a, weekStartsOn: 1 }); } function Gr(n, a) { const t = x(n, a == null ? void 0 : a.in), e = t.getFullYear(), r = B(t, 0); r.setFullYear(e + 1, 0, 4), r.setHours(0, 0, 0, 0); const o = He(r), i = B(t, 0); i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0); const s = He(i); return t.getTime() >= o.getTime() ? e + 1 : t.getTime() >= s.getTime() ? e : e - 1; } function vt(n) { const a = x(n), t = new Date( Date.UTC( a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds() ) ); return t.setUTCFullYear(a.getFullYear()), +n - +t; } function De(n, ...a) { const t = B.bind( null, n || a.find((e) => typeof e == "object") ); return a.map(t); } function Ie(n, a) { const t = x(n, a == null ? void 0 : a.in); return t.setHours(0, 0, 0, 0), t; } function Qe(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ), o = Ie(e), i = Ie(r), s = +o - vt(o), c = +i - vt(i); return Math.round((s - c) / Qa); } function ja(n, a) { const t = Gr(n, a), e = B(n, 0); return e.setFullYear(t, 0, 4), e.setHours(0, 0, 0, 0), He(e); } function qt(n, a, t) { const e = x(n, t == null ? void 0 : t.in); return e.setTime(e.getTime() + a * St), e; } function $t(n, a, t) { return ue(n, a * 3, t); } function Va(n, a, t) { return zr(n, a * 1e3); } function _t(n, a, t) { return de(n, a * 7, t); } function _e(n, a, t) { return ue(n, a * 12, t); } function sr(n, a) { let t, e = a == null ? void 0 : a.in; return n.forEach((r) => { !e && typeof r == "object" && (e = B.bind(null, r)); const o = x(r, e); (!t || t < o || isNaN(+o)) && (t = o); }), B(e, t || NaN); } function cr(n, a) { let t, e = a == null ? void 0 : a.in; return n.forEach((r) => { !e && typeof r == "object" && (e = B.bind(null, r)); const o = x(r, e); (!t || t > o || isNaN(+o)) && (t = o); }), B(e, t || NaN); } function $a(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ); return +Ie(e) == +Ie(r); } function ge(n) { return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]"; } function gt(n) { return !(!ge(n) && typeof n != "number" || isNaN(+x(n))); } function kt(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ), o = e.getFullYear() - r.getFullYear(), i = e.getMonth() - r.getMonth(); return o * 12 + i; } function Ne(n, a) { const t = x(n, a == null ? void 0 : a.in); return Math.trunc(t.getMonth() / 3) + 1; } function wt(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ), o = e.getFullYear() - r.getFullYear(), i = Ne(e) - Ne(r); return o * 4 + i; } function bt(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ); return e.getFullYear() - r.getFullYear(); } function Ua(n, a, t) { const [e, r] = De( t == null ? void 0 : t.in, n, a ), o = lr(e, r), i = Math.abs( Qe(e, r) ); e.setDate(e.getDate() - o * i); const s = +(lr(e, r) === -o), c = o * (i - s); return c === 0 ? 0 : c; } function lr(n, a) { const t = n.getFullYear() - a.getFullYear() || n.getMonth() - a.getMonth() || n.getDate() - a.getDate() || n.getHours() - a.getHours() || n.getMinutes() - a.getMinutes() || n.getSeconds() - a.getSeconds() || n.getMilliseconds() - a.getMilliseconds(); return t < 0 ? -1 : t > 0 ? 1 : t; } function Xr(n, a) { const t = x(n, a == null ? void 0 : a.in); return t.setHours(23, 59, 59, 999), t; } function Zr(n, a) { const t = x(n, a == null ? void 0 : a.in), e = t.getMonth(); return t.setFullYear(t.getFullYear(), e + 1, 0), t.setHours(23, 59, 59, 999), t; } function Bt(n, a) { const t = x(n, a == null ? void 0 : a.in), e = t.getMonth(), r = e - e % 3; return t.setMonth(r, 1), t.setHours(0, 0, 0, 0), t; } function Jr(n, a) { const t = x(n, a == null ? void 0 : a.in); return t.setDate(1), t.setHours(0, 0, 0, 0), t; } function ea(n, a) { const t = x(n, a == null ? void 0 : a.in), e = t.getFullYear(); return t.setFullYear(e + 1, 0, 0), t.setHours(23, 59, 59, 999), t; } function Et(n, a) { const t = x(n, a == null ? void 0 : a.in); return t.setFullYear(t.getFullYear(), 0, 1), t.setHours(0, 0, 0, 0), t; } function za(n, a) { var s, c; const t = Le(), e = t.weekStartsOn ?? ((c = (s = t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? 0, r = x(n, a == null ? void 0 : a.in), o = r.getDay(), i = (o < e ? -7 : 0) + 6 - (o - e); return r.setDate(r.getDate() + i), r.setHours(23, 59, 59, 999), r; } const Ga = { 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" } }, Xa = (n, a, t) => { let e; const r = Ga[n]; return typeof r == "string" ? e = r : a === 1 ? e = r.one : e = r.other.replace("{{count}}", a.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + e : e + " ago" : e; }; function Nt(n) { return (a = {}) => { const t = a.width ? String(a.width) : n.defaultWidth; return n.formats[t] || n.formats[n.defaultWidth]; }; } const Za = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, Ja = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, en = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, tn = { date: Nt({ formats: Za, defaultWidth: "full" }), time: Nt({ formats: Ja, defaultWidth: "full" }), dateTime: Nt({ formats: en, defaultWidth: "full" }) }, rn = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, an = (n, a, t, e) => rn[n]; function Ve(n) { return (a, t) => { const e = t != null && t.context ? String(t.context) : "standalone"; let r; if (e === "formatting" && n.formattingValues) { const i = n.defaultFormattingWidth || n.defaultWidth, s = t != null && t.width ? String(t.width) : i; r = n.formattingValues[s] || n.formattingValues[i]; } else { const i = n.defaultWidth, s = t != null && t.width ? String(t.width) : n.defaultWidth; r = n.values[s] || n.values[i]; } const o = n.argumentCallback ? n.argumentCallback(a) : a; return r[o]; }; } const nn = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, on = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, sn = { 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" ] }, cn = { 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" ] }, ln = { 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" } }, dn = { 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" } }, un = (n, a) => { const t = Number(n), e = t % 100; if (e > 20 || e < 10) switch (e % 10) { case 1: return t + "st"; case 2: return t + "nd"; case 3: return t + "rd"; } return t + "th"; }, pn = { ordinalNumber: un, era: Ve({ values: nn, defaultWidth: "wide" }), quarter: Ve({ values: on, defaultWidth: "wide", argumentCallback: (n) => n - 1 }), month: Ve({ values: sn, defaultWidth: "wide" }), day: Ve({ values: cn, defaultWidth: "wide" }), dayPeriod: Ve({ values: ln, defaultWidth: "wide", formattingValues: dn, defaultFormattingWidth: "wide" }) }; function $e(n) { return (a, t = {}) => { const e = t.width, r = e && n.matchPatterns[e] || n.matchPatterns[n.defaultMatchWidth], o = a.match(r); if (!o) return null; const i = o[0], s = e && n.parsePatterns[e] || n.parsePatterns[n.defaultParseWidth], c = Array.isArray(s) ? hn(s, (u) => u.test(i)) : ( // [TODO] -- I challenge you to fix the type fn(s, (u) => u.test(i)) ); let d; d = n.valueCallback ? n.valueCallback(c) : c, d = t.valueCallback ? ( // [TODO] -- I challenge you to fix the type t.valueCallback(d) ) : d; const l = a.slice(i.length); return { value: d, rest: l }; }; } function fn(n, a) { for (const t in n) if (Object.prototype.hasOwnProperty.call(n, t) && a(n[t])) return t; } function hn(n, a) { for (let t = 0; t < n.length; t++) if (a(n[t])) return t; } function mn(n) { return (a, t = {}) => { const e = a.match(n.matchPattern); if (!e) return null; const r = e[0], o = a.match(n.parsePattern); if (!o) return null; let i = n.valueCallback ? n.valueCallback(o[0]) : o[0]; i = t.valueCallback ? t.valueCallback(i) : i; const s = a.slice(r.length); return { value: i, rest: s }; }; } const vn = /^(\d+)(th|st|nd|rd)?/i, _n = /\d+/i, gn = { 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 }, kn = { any: [/^b/i, /^(a|c)/i] }, wn = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, bn = { any: [/1/i, /2/i, /3/i, /4/i] }, yn = { 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 }, Dn = { 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 ] }, xn = { 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 }, Mn = { 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] }, Cn = { 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 }, Sn = { 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 } }, Pn = { ordinalNumber: mn({ matchPattern: vn, parsePattern: _n, valueCallback: (n) => parseInt(n, 10) }), era: $e({ matchPatterns: gn, defaultMatchWidth: "wide", parsePatterns: kn, defaultParseWidth: "any" }), quarter: $e({ matchPatterns: wn, defaultMatchWidth: "wide", parsePatterns: bn, defaultParseWidth: "any", valueCallback: (n) => n + 1 }), month: $e({ matchPatterns: yn, defaultMatchWidth: "wide", parsePatterns: Dn, defaultParseWidth: "any" }), day: $e({ matchPatterns: xn, defaultMatchWidth: "wide", parsePatterns: Mn, defaultParseWidth: "any" }), dayPeriod: $e({ matchPatterns: Cn, defaultMatchWidth: "any", parsePatterns: Sn, defaultParseWidth: "any" }) }, ta = { code: "en-US", formatDistance: Xa, formatLong: tn, formatRelative: an, localize: pn, match: Pn, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function En(n, a) { const t = x(n, a == null ? void 0 : a.in); return Qe(t, Et(t)) + 1; } function Ut(n, a) { const t = x(n, a == null ? void 0 : a.in), e = +He(t) - +ja(t); return Math.round(e / Ur) + 1; } function zt(n, a) { var l, u, p, h; const t = x(n, a == null ? void 0 : a.in), e = t.getFullYear(), r = Le(), o = (a == null ? void 0 : a.firstWeekContainsDate) ?? ((u = (l = a == null ? void 0 : a.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (p = r.locale) == null ? void 0 : p.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = B((a == null ? void 0 : a.in) || n, 0); i.setFullYear(e + 1, 0, o), i.setHours(0, 0, 0, 0); const s = ye(i, a), c = B((a == null ? void 0 : a.in) || n, 0); c.setFullYear(e, 0, o), c.setHours(0, 0, 0, 0); const d = ye(c, a); return +t >= +s ? e + 1 : +t >= +d ? e : e - 1; } function Tn(n, a) { var s, c, d, l; const t = Le(), e = (a == null ? void 0 : a.firstWeekContainsDate) ?? ((c = (s = a == null ? void 0 : a.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? t.firstWeekContainsDate ?? ((l = (d = t.locale) == null ? void 0 : d.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, r = zt(n, a), o = B((a == null ? void 0 : a.in) || n, 0); return o.setFullYear(r, 0, e), o.setHours(0, 0, 0, 0), ye(o, a); } function ra(n, a) { const t = x(n, a == null ? void 0 : a.in), e = +ye(t, a) - +Tn(t, a); return Math.round(e / Ur) + 1; } function q(n, a) { const t = n < 0 ? "-" : "", e = Math.abs(n).toString().padStart(a, "0"); return t + e; } const xe = { // Year y(n, a) { const t = n.getFullYear(), e = t > 0 ? t : 1 - t; return q(a === "yy" ? e % 100 : e, a.length); }, // Month M(n, a) { const t = n.getMonth(); return a === "M" ? String(t + 1) : q(t + 1, 2); }, // Day of the month d(n, a) { return q(n.getDate(), a.length); }, // AM or PM a(n, a) { const t = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (a) { case "a": case "aa": return t.toUpperCase(); case "aaa": return t; case "aaaaa": return t[0]; case "aaaa": default: return t === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(n, a) { return q(n.getHours() % 12 || 12, a.length); }, // Hour [0-23] H(n, a) { return q(n.getHours(), a.length); }, // Minute m(n, a) { return q(n.getMinutes(), a.length); }, // Second s(n, a) { return q(n.getSeconds(), a.length); }, // Fraction of second S(n, a) { const t = a.length, e = n.getMilliseconds(), r = Math.trunc( e * Math.pow(10, t - 3) ); return q(r, a.length); } }, Fe = { midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, dr = { // Era G: function(n, a, t) { const e = n.getFullYear() > 0 ? 1 : 0; switch (a) { // AD, BC case "G": case "GG": case "GGG": return t.era(e, { width: "abbreviated" }); // A, B case "GGGGG": return t.era(e, { width: "narrow" }); // Anno Domini, Before Christ case "GGGG": default: return t.era(e, { width: "wide" }); } }, // Year y: function(n, a, t) { if (a === "yo") { const e = n.getFullYear(), r = e > 0 ? e : 1 - e; return t.ordinalNumber(r, { unit: "year" }); } return xe.y(n, a); }, // Local week-numbering year Y: function(n, a, t, e) { const r = zt(n, e), o = r > 0 ? r : 1 - r; if (a === "YY") { const i = o % 100; return q(i, 2); } return a === "Yo" ? t.ordinalNumber(o, { unit: "year" }) : q(o, a.length); }, // ISO week-numbering year R: function(n, a) { const t = Gr(n); return q(t, a.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(n, a) { const t = n.getFullYear(); return q(t, a.length); }, // Quarter Q: function(n, a, t) { const e = Math.ceil((n.getMonth() + 1) / 3); switch (a) { // 1, 2, 3, 4 case "Q": return String(e); // 01, 02, 03, 04 case "QQ": return q(e, 2); // 1st, 2nd, 3rd, 4th case "Qo": return t.ordinalNumber(e, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "QQQ": return t.quarter(e, { width: "abbreviated", context: "formatting" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "QQQQQ": return t.quarter(e, { width: "narrow", context: "formatting" }); // 1st quarter, 2nd quarter, ... case "QQQQ": default: return t.quarter(e, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(n, a, t) { const e = Math.ceil((n.getMonth() + 1) / 3); switch (a) { // 1, 2, 3, 4 case "q": return String(e); // 01, 02, 03, 04 case "qq": return q(e, 2); // 1st, 2nd, 3rd, 4th case "qo": return t.ordinalNumber(e, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "qqq": return t.quarter(e, { width: "abbreviated", context: "standalone" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "qqqqq": return t.quarter(e, { width: "narrow", context: "standalone" }); // 1st quarter, 2nd quarter, ... case "qqqq": default: return t.quarter(e, { width: "wide", context: "standalone" }); } }, // Month M: function(n, a, t) { const e = n.getMonth(); switch (a) { case "M": case "MM": return xe.M(n, a); // 1st, 2nd, ..., 12th case "Mo": return t.ordinalNumber(e + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "MMM": return t.month(e, { width: "abbreviated", context: "formatting" }); // J, F, ..., D case "MMMMM": return t.month(e, { width: "narrow", context: "formatting" }); // January, February, ..., December case "MMMM": default: return t.month(e, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(n, a, t) { const e = n.getMonth(); switch (a) { // 1, 2, ..., 12 case "L": return String(e + 1); // 01, 02, ..., 12 case "LL": return q(e + 1, 2); // 1st, 2nd, ..., 12th case "Lo": return t.ordinalNumber(e + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "LLL": return t.month(e, { width: "abbreviated", context: "standalone" }); // J, F, ..., D case "LLLLL": return t.month(e, { width: "narrow", context: "standalone" }); // January, February, ..., December case "LLLL": default: return t.month(e, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(n, a, t, e) { const r = ra(n, e); return a === "wo" ? t.ordinalNumber(r, { unit: "week" }) : q(r, a.length); }, // ISO week of year I: function(n, a, t) { const e = Ut(n); return a === "Io" ? t.ordinalNumber(e, { unit: "week" }) : q(e, a.length); }, // Day of the month d: function(n, a, t) { return a === "do" ? t.ordinalNumber(n.getDate(), { unit: "date" }) : xe.d(n, a); }, // Day of year D: function(n, a, t) { const e = En(n); return a === "Do" ? t.ordinalNumber(e, { unit: "dayOfYear" }) : q(e, a.length); }, // Day of week E: function(n, a, t) { const e = n.getDay(); switch (a) { // Tue case "E": case "EE": case "EEE": return t.day(e, { width: "abbreviated", context: "formatting" }); // T case "EEEEE": return t.day(e, { width: "narrow", context: "formatting" }); // Tu case "EEEEEE": return t.day(e, { width: "short", context: "formatting" }); // Tuesday case "EEEE": default: return t.day(e, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(n, a, t, e) { const r = n.getDay(), o = (r - e.weekStartsOn + 8) % 7 || 7; switch (a) { // Numerical value (Nth day of week with current locale or weekStartsOn) case "e": return String(o); // Padded numerical value case "ee": return q(o, 2); // 1st, 2nd, ..., 7th case "eo": return t.ordinalNumber(o, { unit: "day" }); case "eee": return t.day(r, { width: "abbreviated", context: "formatting" }); // T case "eeeee": return t.day(r, { width: "narrow", context: "formatting" }); // Tu case "eeeeee": return t.day(r, { width: "short", context: "formatting" }); // Tuesday case "eeee": default: return t.day(r, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(n, a, t, e) { const r = n.getDay(), o = (r - e.weekStartsOn + 8) % 7 || 7; switch (a) { // Numerical value (same as in `e`) case "c": return String(o); // Padded numerical value case "cc": return q(o, a.length); // 1st, 2nd, ..., 7th case "co": return t.ordinalNumber(o, { unit: "day" }); case "ccc": return t.day(r, { width: "abbreviated", context: "standalone" }); // T case "ccccc": return t.day(r, { width: "narrow", context: "standalone" }); // Tu case "cccccc": return t.day(r, { width: "short", context: "standalone" }); // Tuesday case "cccc": default: return t.day(r, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(n, a, t) { const e = n.getDay(), r = e === 0 ? 7 : e; switch (a) { // 2 case "i": return String(r); // 02 case "ii": return q(r, a.length); // 2nd case "io": return t.ordinalNumber(r, { unit: "day" }); // Tue case "iii": return t.day(e, { width: "abbreviated", context: "formatting" }); // T case "iiiii": return t.day(e, { width: "narrow", context: "formatting" }); // Tu case "iiiiii": return t.day(e, { width: "short", context: "formatting" }); // Tuesday case "iiii": default: return t.day(e, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(n, a, t) { const r = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (a) { case "a": case "aa": return t.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "aaa": return t.dayPeriod(r, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "aaaaa": return t.dayPeriod(r, { width: "narrow", context: "formatting" }); case "aaaa": default: return t.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // AM, PM, midnight, noon b: function(n, a, t) { const e = n.getHours(); let r; switch (e === 12 ? r = Fe.noon : e === 0 ? r = Fe.midnight : r = e / 12 >= 1 ? "pm" : "am", a) { case "b": case "bb": return t.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "bbb": return t.dayPeriod(r, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return t.dayPeriod(r, { width: "narrow", context: "formatting" }); case "bbbb": default: return t.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // in the morning, in the afternoon, in the evening, at night B: function(n, a, t) { const e = n.getHours(); let r; switch (e >= 17 ? r = Fe.evening : e >= 12 ? r = Fe.afternoon : e >= 4 ? r = Fe.morning : r = Fe.night, a) { case "B": case "BB": case "BBB": return t.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "BBBBB": return t.dayPeriod(r, { width: "narrow", context: "formatting" }); case "BBBB": default: return t.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // Hour [1-12] h: function(n, a, t) { if (a === "ho") { let e = n.getHours() % 12; return e === 0 && (e = 12), t.ordinalNumber(e, { unit: "hour" }); } return xe.h(n, a); }, // Hour [0-23] H: function(n, a, t) { return a === "Ho" ? t.ordinalNumber(n.getHours(), { unit: "hour" }) : xe.H(n, a); }, // Hour [0-11] K: function(n, a, t) { const e = n.getHours() % 12; return a === "Ko" ? t.ordinalNumber(e, { unit: "hour" }) : q(e, a.length); }, // Hour [1-24] k: function(n, a, t) { let e = n.getHours(); return e === 0 && (e = 24), a === "ko" ? t.ordinalNumber(e, { unit: "hour" }) : q(e, a.length); }, // Minute m: function(n, a, t) { return a === "mo" ? t.ordinalNumber(n.getMinutes(), { unit: "minute" }) : xe.m(n, a); }, // Second s: function(n, a, t) { return a === "so" ? t.ordinalNumber(n.getSeconds(), { unit: "second" }) : xe.s(n, a); }, // Fraction of second S: function(n, a) { return xe.S(n, a); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(n, a, t) { const e = n.getTimezoneOffset(); if (e === 0) return "Z"; switch (a) { // Hours and optional minutes case "X": return pr(e); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XX` case "XXXX": case "XX": return Te(e); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XXX` case "XXXXX": case "XXX": // Hours and minutes with `:` delimiter default: return Te(e, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(n, a, t) { const e = n.getTimezoneOffset(); switch (a) { // Hours and optional minutes case "x": return pr(e); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xx` case "xxxx": case "xx": return Te(e); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xxx` case "xxxxx": case "xxx": // Hours and minutes with `:` delimiter default: return Te(e, ":"); } }, // Timezone (GMT) O: function(n, a, t) { const e = n.getTimezoneOffset(); switch (a) { // Short case "O": case "OO": case "OOO": return "GMT" + ur(e, ":"); // Long case "OOOO": default: return "GMT" + Te(e, ":"); } }, // Timezone (specific non-location) z: function(n, a, t) { const e = n.getTimezoneOffset(); switch (a) { // Short case "z": case "zz": case "zzz": return "GMT" + ur(e, ":"); // Long case "zzzz": default: return "GMT" + Te(e, ":"); } }, // Seconds timestamp t: function(n, a, t) { const e = Math.trunc(+n / 1e3); return q(e, a.length); }, // Milliseconds timestamp T: function(n, a, t) { return q(+n, a.length); } }; function ur(n, a = "") { const t = n > 0 ? "-" : "+", e = Math.abs(n), r = Math.trunc(e / 60), o = e % 60; return o === 0 ? t + String(r) : t + String(r) + a + q(o, 2); } function pr(n, a) { return n % 60 === 0 ? (n > 0 ? "-" : "+") + q(Math.abs(n) / 60, 2) : Te(n, a); } function Te(n, a = "") { const t = n > 0 ? "-" : "+", e = Math.abs(n), r = q(Math.trunc(e / 60), 2), o = q(e % 60, 2); return t + r + a + o; } const fr = (n, a) => { switch (n) { case "P": return a.date({ width: "short" }); case "PP": return a.date({ width: "medium" }); case "PPP": return a.date({ width: "long" }); case "PPPP": default: return a.date({ width: "full" }); } }, aa = (n, a) => { switch (n) { case "p": return a.time({ width: "short" }); case "pp": return a.time({ width: "medium" }); case "ppp": return a.time({ width: "long" }); case "pppp": default: return a.time({ width: "full" }); } }, On = (n, a) => { const t = n.match(/(P+)(p+)?/) || [], e = t[1], r = t[2]; if (!r) return fr(n, a); let o; switch (e) { case "P": o = a.dateTime({ width: "short" }); break; case "PP": o = a.dateTime({ width: "medium" }); break; case "PPP": o = a.dateTime({ width: "long" }); break; case "PPPP": default: o = a.dateTime({ width: "full" }); break; } return o.replace("{{date}}", fr(e, a)).replace("{{time}}", aa(r, a)); }, Kt = { p: aa, P: On }, Nn = /^D+$/, Yn = /^Y+$/, In = ["D", "DD", "YY", "YYYY"]; function Rn(n) { return Nn.test(n); } function Ln(n) { return Yn.test(n); } function Fn(n, a, t) { const e = An(n, a, t); if (console.warn(e), In.includes(n)) throw new RangeError(e); } function An(n, a, t) { const e = n[0] === "Y" ? "years" : "days of the month"; return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } const Wn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Hn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qn = /^'([^]*?)'?$/, qn = /''/g, Bn = /[a-zA-Z]/; function hr(n, a, t) { var l, u, p, h, m, g, _, y; const e = Le(), r = (t == null ? void 0 : t.locale) ?? e.locale ?? ta, o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((h = (p = e.locale) == null ? void 0 : p.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = (t == null ? void 0 : t.weekStartsOn) ?? ((g = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : g.weekStartsOn) ?? e.weekStartsOn ?? ((y = (_ = e.locale) == null ? void 0 : _.options) == null ? void 0 : y.weekStartsOn) ?? 0, s = x(n, t == null ? void 0 : t.in); if (!gt(s)) throw new RangeError("Invalid time value"); let c = a.match(Hn).map((S) => { const M = S[0]; if (M === "p" || M === "P") { const E = Kt[M]; return E(S, r.formatLong); } return S; }).join("").match(Wn).map((S) => { if (S === "''") return { isToken: !1, value: "'" }; const M = S[0]; if (M === "'") return { isToken: !1, value: Kn(S) }; if (dr[M]) return { isToken: !0, value: S }; if (M.match(Bn)) throw new RangeError( "Format string contains an unescaped latin alphabet character `" + M + "`" ); return { isToken: !1, value: S }; }); r.localize.preprocessor && (c = r.localize.preprocessor(s, c)); const d = { firstWeekContainsDate: o, weekStartsOn: i, locale: r }; return c.map((S) => { if (!S.isToken) return S.value; const M = S.value; (!(t != null && t.useAdditionalWeekYearTokens) && Ln(M) || !(t != null && t.useAdditionalDayOfYearTokens) && Rn(M)) && Fn(M, a, String(n)); const E = dr[M[0]]; return E(s, M, r.localize, d); }).join(""); } function Kn(n) { const a = n.match(Qn); return a ? a[1].replace(qn, "'") : n; } function mr(n, a) { return x(n, a == null ? void 0 : a.in).getDate(); } function jn(n, a) { return x(n, a == null ? void 0 : a.in).getDay(); } function Vn(n, a) { const t = x(n, a == null ? void 0 : a.in), e = t.getFullYear(), r = t.getMonth(), o = B(t, 0); return o.setFullYear(e, r + 1, 0), o.setHours(0, 0, 0, 0), o.getDate(); } function $n() { return Object.assign({}, Le()); } function ke(n, a) { return x(n, a == null ? void 0 : a.in).getHours(); } function Un(n, a) { const t = x(n, a == null ? void 0 : a.in).getDay(); return t === 0 ? 7 : t; } function we(n, a) { return x(n, a == null ? void 0 : a.in).getMinutes(); } function re(n, a) { return x(n, a == null ? void 0 : a.in).getMonth(); } function Ce(n) { return x(n).getSeconds(); } function jt(n) { return +x(n); } function Y(n, a) { return x(n, a == null ? void 0 : a.in).getFullYear(); } function Ee(n, a) { return +x(n) > +x(a); } function Re(n, a) { return +x(n) < +x(a); } function zn(n, a) { return +x(n) == +x(a); } function Gn(n, a) { const t = Xn(a) ? new a(0) : B(a, 0); return t.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), t.setHours( n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds() ), t; } function Xn(n) { var a; return typeof n == "function" && ((a = n.prototype) == null ? void 0 : a.constructor) === n; } const Zn = 10; class na { constructor() { b(this, "subPriority", 0); } validate(a, t) { return !0; } } class Jn extends na { constructor(a, t, e, r, o) { super(), this.value = a, this.validateValue = t, this.setValue = e, this.priority = r, o && (this.subPriority = o); } validate(a, t) { return this.validateValue(a, this.value, t); } set(a, t, e) { return this.setValue(a, t, this.value, e); } } class eo extends na { constructor(t, e) { super(); b(this, "priority", Zn); b(this, "subPriority", -1); this.context = t || ((r) => B(e, r)); } set(t, e) { return e.timestampIsSet ? t : B(t, Gn(t, this.context)); } } class W { run(a, t, e, r) { const o = this.parse(a, t, e, r); return o ? { setter: new Jn( o.value, this.validate, this.set, this.priority, this.subPriority ), rest: o.rest } : null; } validate(a, t, e) { return !0; } } class to extends W { constructor() { super(...arguments); b(this, "priority", 140); b(this, "incompatibleTokens", ["R", "u", "t", "T"]); } parse(t, e, r) { switch (e) { // AD, BC case "G": case "GG": case "GGG": return r.era(t, { width: "abbreviated" }) || r.era(t, { width: "narrow" }); // A, B case "GGGGG": return r.era(t, { width: "narrow" }); // Anno Domini, Before Christ case "GGGG": default: return r.era(t, { width: "wide" }) || r.era(t, { width: "abbreviated" }) || r.era(t, { width: "narrow" }); } } set(t, e, r) { return e.era = r, t.setFullYear(r, 0, 1), t.setHours(0, 0, 0, 0), t; } } const z = { month: /^(1[0-2]|0?\d)/, // 0 to 12 date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 minute: /^[0-5]?\d/, // 0 to 59 second: /^[0-5]?\d/, // 0 to 59 singleDigit: /^\d/, // 0 to 9 twoDigits: /^\d{1,2}/, // 0 to 99 threeDigits: /^\d{1,3}/, // 0 to 999 fourDigits: /^\d{1,4}/, // 0 to 9999 anyDigitsSigned: /^-?\d+/, singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9 twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99 threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999 fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999 }, he = { basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, basic: /^([+-])(\d{2})(\d{2})|Z/, basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, extended: /^([+-])(\d{2}):(\d{2})|Z/, extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ }; function G(n, a) { return n && { value: a(n.value), rest: n.rest }; } function $(n, a) { const t = a.match(n); return t ? { value: parseInt(t[0], 10), rest: a.slice(t[0].length) } : null; } function me(n, a) { const t = a.match(n); if (!t) return null; if (t[0] === "Z") return { value: 0, rest: a.slice(1) }; const e = t[1] === "+" ? 1 : -1, r = t[2] ? parseInt(t[2], 10) : 0, o = t[3] ? parseInt(t[3], 10) : 0, i = t[5] ? parseInt(t[5], 10) : 0; return { value: e * (r * Pt + o * St + i * qa), rest: a.slice(t[0].length) }; } function oa(n) { return $(z.anyDigitsSigned, n); } function U(n, a) { switch (n) { case 1: return $(z.singleDigit, a); case 2: return $(z.twoDigits, a); case 3: return $(z.threeDigits, a); case 4: return $(z.fourDigits, a); default: return $(new RegExp("^\\d{1," + n + "}"), a); } } function yt(n, a) { switch (n) { case 1: return $(z.singleDigitSigned, a); case 2: return $(z.twoDigitsSigned, a); case 3: return $(z.threeDigitsSigned, a); case 4: return $(z.fourDigitsSigned, a); default: return $(new RegExp("^-?\\d{1," + n + "}"), a); } } function Gt(n) { switch (n) { case "morning": return 4; case "evening": return 17; case "pm": case "noon": case "afternoon": return 12; case "am": case "midnight": case "night": default: return 0; } } function ia(n, a) { const t = a > 0, e = t ? a : 1 - a; let r; if (e <= 50) r = n || 100; else { const o = e + 50, i = Math.trunc(o / 100) * 100, s = n >= o % 100; r = n + i - (s ? 100 : 0); } return t ? r : 1 - r; } function sa(n) { return n % 400 === 0 || n % 4 === 0 && n % 100 !== 0; } class ro extends W { constructor() { super(...arguments); b(this, "priority", 130); b(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]); } parse(t, e, r) { const o = (i) => ({ year: i, isTwoDigitYear: e === "yy" }); switch (e) { case "y": return G(U(4, t), o); case "yo": return G( r.ordinalNumber(t, { unit: "year" }), o ); default: return G(U(e.length, t), o); } } validate(t, e) { return e.isTwoDigitYear || e.year > 0; } set(t, e, r) { const o = t.getFullYear(); if (r.isTwoDigitYear) { const s = ia( r.year, o ); return t.setFullYear(s, 0, 1), t.setHours(0, 0, 0, 0), t; } const i = !("era" in e) || e.era === 1 ? r.year : 1 - r.year; return t.setFullYear(i, 0, 1), t.setHours(0, 0, 0, 0), t; } } class ao extends W { constructor() { super(...arguments); b(this, "priority", 130); b(this, "incompatibleTokens", [ "y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T" ]); } parse(t, e, r) { const o = (i) => ({ year: i, isTwoDigitYear: e === "YY" }); switch (e) { case "Y": return G(U(4, t), o); case "Yo": return G( r.ordinalNumber(t, { unit: "year" }), o ); default: return G(U(e.length, t), o); } } validate(t, e) { return e.isTwoDigitYear || e.year > 0; } set(t, e, r, o) { const i = zt(t, o); if (r.isTwoDigitYear) { const c = ia( r.year, i ); return t.setFullYear( c, 0, o.firstWeekContainsDate ), t.setHours(0, 0, 0, 0), ye(t, o); } const s = !("era" in e) || e.era === 1 ? r.year : 1 - r.year; return t.setFullYear(s, 0, o.firstWeekContainsDate), t.setHours(0, 0, 0, 0), ye(t, o); } } class no extends W { constructor() { super(...arguments); b(this, "priority", 130); b(this, "incompatibleTokens", [ "G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T" ]); } parse(t, e) { return yt(e === "R" ? 4 : e.length, t); } set(t, e, r) { const o = B(t, 0); return o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0), He(o); } } class oo extends W { constructor() { super(...arguments); b(this, "priority", 130); b(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]); } parse(t, e) { return yt(e === "u" ? 4 : e.length, t); } set(t, e, r) { return t.setFullYear(r, 0, 1), t.setHours(0, 0, 0, 0), t; } } class io extends W { constructor() { super(...arguments); b(this, "priority", 120); b(this, "incompatibleTokens", [ "Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T" ]); } parse(t, e, r) { switch (e) { // 1, 2, 3, 4 case "Q": case "QQ": return U(e.length, t); // 1st, 2nd, 3rd, 4th case "Qo": return r.ordinalNumber(t, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "QQQ": return r.quarter(t, { width: "abbreviated", context: "formatting" }) || r.quarter(t, { width: "narrow", context: "formatting" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "QQQQQ": return r.quarter(t, { width: "narrow", context: "formatting" }); // 1st quarter, 2nd quarter, ... case "QQQQ": default: return r.quarter(t, { width: "wide", context: "formatting" }) || r.quarter(t, { width: "abbreviated", context: "formatting" }) || r.quarter(t, { width: "narrow", context: "formatting" }); } } validate(t, e) { return e >= 1 && e <= 4; } set(t, e, r) { return t.setMonth((r - 1) * 3, 1), t.setHours(0, 0, 0, 0), t; } } class so extends W { constructor() { super(...arguments); b(this, "priority", 120); b(this, "incompatibleTokens", [ "Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T" ]); } parse(t, e, r) { switch (e) { // 1, 2, 3, 4 case "q": case "qq": return U(e.length, t); // 1st, 2nd, 3rd, 4th case "qo": return r.ordinalNumber(t, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "qqq": return r.quarter(t, { width: "abbreviated", context: "standalone" }) || r.quarter(t, { width: "narrow", context: "standalone" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "qqqqq":