UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

1,689 lines 90.5 kB
import { r as Qe } from "./chunk-cI0lbGMq.js"; import d, { createContext as Nn, useCallback as $, useContext as Cn, useEffect as Yn, useLayoutEffect as Tn, useMemo as Se, useRef as Ne, useState as Ze } from "react"; function xn(e, t, n = "long") { return new Intl.DateTimeFormat("en-US", { hour: "numeric", timeZone: e, timeZoneName: n }).format(t).split(/\s/g).slice(2).join(" "); } var Pn = {}, he = {}; function oe(e, t) { try { const n = (Pn[e] ||= new Intl.DateTimeFormat("en-US", { timeZone: e, timeZoneName: "longOffset" }).format)(t).split("GMT")[1]; return n in he ? he[n] : ct(n, n.split(":")); } catch { if (e in he) return he[e]; const n = e?.match(En); return n ? ct(e, n.slice(1)) : NaN; } } var En = /([+-]\d\d):?(\d\d)?/; function ct(e, t) { const n = +(t[0] || 0), r = +(t[1] || 0), o = +(t[2] || 0) / 60; return he[e] = n * 60 + r > 0 ? n * 60 + r + o : n * 60 - r - o; } var me = class ye extends Date { constructor(...t) { super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(oe(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), pt(this, NaN), ze(this)) : this.setTime(Date.now()); } static tz(t, ...n) { return n.length ? new ye(...n, t) : new ye(Date.now(), t); } withTimeZone(t) { return new ye(+this, t); } getTimezoneOffset() { const t = -oe(this.timeZone, this); return t > 0 ? Math.floor(t) : Math.ceil(t); } setTime(t) { return Date.prototype.setTime.apply(this, arguments), ze(this), +this; } [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) { return new ye(+new Date(t), this.timeZone); } }, lt = /^(get|set)(?!UTC)/; Object.getOwnPropertyNames(Date.prototype).forEach((e) => { if (!lt.test(e)) return; const t = e.replace(lt, "$1UTC"); me.prototype[t] && (e.startsWith("get") ? me.prototype[e] = function() { return this.internal[t](); } : (me.prototype[e] = function() { return Date.prototype[t].apply(this.internal, arguments), Fn(this), +this; }, me.prototype[t] = function() { return Date.prototype[t].apply(this, arguments), ze(this), +this; })); }); function ze(e) { e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-oe(e.timeZone, e) * 60)); } function Fn(e) { Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), pt(e); } function pt(e) { const t = oe(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e); r.setUTCHours(r.getUTCHours() - 1); const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = o - -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours(); a && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a); const i = o - n; i && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + i); const u = /* @__PURE__ */ new Date(+e); u.setUTCSeconds(0); const c = o > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, f = Math.round(-(oe(e.timeZone, e) * 60)) % 60; (f || c) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + c)); const l = oe(e.timeZone, e), g = l > 0 ? Math.floor(l) : Math.ceil(l), b = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, k = g !== n, S = b - i; if (k && S) { Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S); const w = oe(e.timeZone, e), T = g - (w > 0 ? Math.floor(w) : Math.ceil(w)); T && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + T), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + T)); } } var j = class ve extends me { static tz(t, ...n) { return n.length ? new ve(...n, t) : new ve(Date.now(), t); } toISOString() { const [t, n, r] = this.tzComponents(), o = `${t}${n}:${r}`; return this.internal.toISOString().slice(0, -1) + o; } toString() { return `${this.toDateString()} ${this.toTimeString()}`; } toDateString() { const [t, n, r, o] = this.internal.toUTCString().split(" "); return `${t?.slice(0, -1)} ${r} ${n} ${o}`; } toTimeString() { const t = this.internal.toUTCString().split(" ")[4], [n, r, o] = this.tzComponents(); return `${t} GMT${n}${r}${o} (${xn(this.timeZone, this)})`; } toLocaleString(t, n) { return Date.prototype.toLocaleString.call(this, t, { ...n, timeZone: n?.timeZone || this.timeZone }); } toLocaleDateString(t, n) { return Date.prototype.toLocaleDateString.call(this, t, { ...n, timeZone: n?.timeZone || this.timeZone }); } toLocaleTimeString(t, n) { return Date.prototype.toLocaleTimeString.call(this, t, { ...n, timeZone: n?.timeZone || this.timeZone }); } tzComponents() { const t = this.getTimezoneOffset(); return [ t > 0 ? "-" : "+", String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), String(Math.abs(t) % 60).padStart(2, "0") ]; } withTimeZone(t) { return new ve(+this, t); } [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) { return new ve(+new Date(t), this.timeZone); } }, _n = 365.2425, Bn = Math.pow(10, 8) * 24 * 60 * 60 * 1e3, Ea = -Bn, kt = 6048e5, In = 864e5, Hn = 3600, Ot = Hn * 24, Fa = Ot * 7, An = Ot * _n, qn = An / 12, _a = qn * 3, ft = /* @__PURE__ */ Symbol.for("constructDateFrom"); function B(e, t) { return typeof e == "function" ? e(t) : e && typeof e == "object" && ft in e ? e[ft](t) : e instanceof Date ? new e.constructor(t) : new Date(t); } function Y(e, t) { return B(t || e, e); } function Wt(e, t, n) { const r = Y(e, n?.in); return isNaN(t) ? B(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r); } function St(e, t, n) { const r = Y(e, n?.in); if (isNaN(t)) return B(n?.in || e, NaN); if (!t) return r; const o = r.getDate(), a = B(n?.in || e, r.getTime()); return a.setMonth(r.getMonth() + t + 1, 0), o >= a.getDate() ? a : (r.setFullYear(a.getFullYear(), a.getMonth(), o), r); } var Gn = {}; function De() { return Gn; } function ue(e, t) { const n = De(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = Y(e, t?.in), a = o.getDay(), s = (a < r ? 7 : 0) + a - r; return o.setDate(o.getDate() - s), o.setHours(0, 0, 0, 0), o; } function be(e, t) { return ue(e, { ...t, weekStartsOn: 1 }); } function Nt(e, t) { const n = Y(e, t?.in), r = n.getFullYear(), o = B(n, 0); o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0); const a = be(o), s = B(n, 0); s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0); const i = be(s); return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1; } function dt(e) { const t = Y(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds())); return n.setUTCFullYear(t.getFullYear()), +e - +n; } function ce(e, ...t) { const n = B.bind(null, e || t.find((r) => typeof r == "object")); return t.map(n); } function we(e, t) { const n = Y(e, t?.in); return n.setHours(0, 0, 0, 0), n; } function Ve(e, t, n) { const [r, o] = ce(n?.in, e, t), a = we(r), s = we(o), i = +a - dt(a), u = +s - dt(s); return Math.round((i - u) / In); } function $n(e, t) { const n = Nt(e, t), r = B(t?.in || e, 0); return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), be(r); } function jn(e, t, n) { return Wt(e, t * 7, n); } function Rn(e, t, n) { return St(e, t * 12, n); } function Zn(e, t) { let n, r = t?.in; return e.forEach((o) => { !r && typeof o == "object" && (r = B.bind(null, o)); const a = Y(o, r); (!n || n < a || isNaN(+a)) && (n = a); }), B(r, n || NaN); } function zn(e, t) { let n, r = t?.in; return e.forEach((o) => { !r && typeof o == "object" && (r = B.bind(null, o)); const a = Y(o, r); (!n || n > a || isNaN(+a)) && (n = a); }), B(r, n || NaN); } function Un(e, t, n) { const [r, o] = ce(n?.in, e, t); return +we(r) == +we(o); } function Ct(e) { return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]"; } function Qn(e) { return !(!Ct(e) && typeof e != "number" || isNaN(+Y(e))); } function Yt(e, t, n) { const [r, o] = ce(n?.in, e, t), a = r.getFullYear() - o.getFullYear(), s = r.getMonth() - o.getMonth(); return a * 12 + s; } function Vn(e, t) { const n = Y(e, t?.in), r = n.getMonth(); return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n; } function Tt(e, t) { const [n, r] = ce(e, t.start, t.end); return { start: n, end: r }; } function Kn(e, t) { const { start: n, end: r } = Tt(t?.in, e); let o = +n > +r; const a = o ? +n : +r, s = o ? r : n; s.setHours(0, 0, 0, 0), s.setDate(1); let i = t?.step ?? 1; if (!i) return []; i < 0 && (i = -i, o = !o); const u = []; for (; +s <= a; ) u.push(B(n, s)), s.setMonth(s.getMonth() + i); return o ? u.reverse() : u; } function Xn(e, t) { const n = Y(e, t?.in); return n.setDate(1), n.setHours(0, 0, 0, 0), n; } function Jn(e, t) { const n = Y(e, t?.in), r = n.getFullYear(); return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n; } function xt(e, t) { const n = Y(e, t?.in); return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n; } function Ln(e, t) { const { start: n, end: r } = Tt(t?.in, e); let o = +n > +r; const a = o ? +n : +r, s = o ? r : n; s.setHours(0, 0, 0, 0), s.setMonth(0, 1); let i = t?.step ?? 1; if (!i) return []; i < 0 && (i = -i, o = !o); const u = []; for (; +s <= a; ) u.push(B(n, s)), s.setFullYear(s.getFullYear() + i); return o ? u.reverse() : u; } function Pt(e, t) { const n = De(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = Y(e, t?.in), a = o.getDay(), s = (a < r ? -7 : 0) + 6 - (a - r); return o.setDate(o.getDate() + s), o.setHours(23, 59, 59, 999), o; } function er(e, t) { return Pt(e, { ...t, weekStartsOn: 1 }); } var tr = { 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" } }, nr = (e, t, n) => { let r; const o = tr[e]; return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r; }; function qe(e) { return (t = {}) => { const n = t.width ? String(t.width) : e.defaultWidth; return e.formats[n] || e.formats[e.defaultWidth]; }; } var rr = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, or = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, ar = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, sr = { date: qe({ formats: rr, defaultWidth: "full" }), time: qe({ formats: or, defaultWidth: "full" }), dateTime: qe({ formats: ar, defaultWidth: "full" }) }, ir = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, ur = (e, t, n, r) => ir[e]; function fe(e) { return (t, n) => { const r = n?.context ? String(n.context) : "standalone"; let o; if (r === "formatting" && e.formattingValues) { const s = e.defaultFormattingWidth || e.defaultWidth, i = n?.width ? String(n.width) : s; o = e.formattingValues[i] || e.formattingValues[s]; } else { const s = e.defaultWidth, i = n?.width ? String(n.width) : e.defaultWidth; o = e.values[i] || e.values[s]; } const a = e.argumentCallback ? e.argumentCallback(t) : t; return o[a]; }; } var cr = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, lr = { narrow: [ "1", "2", "3", "4" ], abbreviated: [ "Q1", "Q2", "Q3", "Q4" ], wide: [ "1st quarter", "2nd quarter", "3rd quarter", "4th quarter" ] }, fr = { 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" ] }, dr = { 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" ] }, hr = { 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" } }, mr = { 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" } }, yr = (e, t) => { const n = Number(e), 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"; }, vr = { ordinalNumber: yr, era: fe({ values: cr, defaultWidth: "wide" }), quarter: fe({ values: lr, defaultWidth: "wide", argumentCallback: (e) => e - 1 }), month: fe({ values: fr, defaultWidth: "wide" }), day: fe({ values: dr, defaultWidth: "wide" }), dayPeriod: fe({ values: hr, defaultWidth: "wide", formattingValues: mr, defaultFormattingWidth: "wide" }) }; function de(e) { return (t, n = {}) => { const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(o); if (!a) return null; const s = a[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(i) ? br(i, (l) => l.test(s)) : gr(i, (l) => l.test(s)); let c; c = e.valueCallback ? e.valueCallback(u) : u, c = n.valueCallback ? n.valueCallback(c) : c; const f = t.slice(s.length); return { value: c, rest: f }; }; } function gr(e, t) { for (const n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n; } function br(e, t) { for (let n = 0; n < e.length; n++) if (t(e[n])) return n; } function wr(e) { return (t, n = {}) => { const r = t.match(e.matchPattern); if (!r) return null; const o = r[0], a = t.match(e.parsePattern); if (!a) return null; let s = e.valueCallback ? e.valueCallback(a[0]) : a[0]; s = n.valueCallback ? n.valueCallback(s) : s; const i = t.slice(o.length); return { value: s, rest: i }; }; } var Dr = /^(\d+)(th|st|nd|rd)?/i, Mr = /\d+/i, pr = { 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 }, kr = { any: [/^b/i, /^(a|c)/i] }, Or = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, Wr = { any: [ /1/i, /2/i, /3/i, /4/i ] }, Sr = { 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 }, Nr = { 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 ] }, Cr = { 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 }, Yr = { 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 ] }, Tr = { 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 }, xr = { 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 } }, Pr = { ordinalNumber: wr({ matchPattern: Dr, parsePattern: Mr, valueCallback: (e) => parseInt(e, 10) }), era: de({ matchPatterns: pr, defaultMatchWidth: "wide", parsePatterns: kr, defaultParseWidth: "any" }), quarter: de({ matchPatterns: Or, defaultMatchWidth: "wide", parsePatterns: Wr, defaultParseWidth: "any", valueCallback: (e) => e + 1 }), month: de({ matchPatterns: Sr, defaultMatchWidth: "wide", parsePatterns: Nr, defaultParseWidth: "any" }), day: de({ matchPatterns: Cr, defaultMatchWidth: "wide", parsePatterns: Yr, defaultParseWidth: "any" }), dayPeriod: de({ matchPatterns: Tr, defaultMatchWidth: "any", parsePatterns: xr, defaultParseWidth: "any" }) }, ie = { code: "en-US", formatDistance: nr, formatLong: sr, formatRelative: ur, localize: vr, match: Pr, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function Er(e, t) { const n = Y(e, t?.in); return Ve(n, xt(n)) + 1; } function Ke(e, t) { const n = Y(e, t?.in), r = +be(n) - +$n(n); return Math.round(r / kt) + 1; } function Et(e, t) { const n = Y(e, t?.in), r = n.getFullYear(), o = De(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, s = B(t?.in || e, 0); s.setFullYear(r + 1, 0, a), s.setHours(0, 0, 0, 0); const i = ue(s, t), u = B(t?.in || e, 0); u.setFullYear(r, 0, a), u.setHours(0, 0, 0, 0); const c = ue(u, t); return +n >= +i ? r + 1 : +n >= +c ? r : r - 1; } function Fr(e, t) { const n = De(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = Et(e, t), a = B(t?.in || e, 0); return a.setFullYear(o, 0, r), a.setHours(0, 0, 0, 0), ue(a, t); } function Xe(e, t) { const n = Y(e, t?.in), r = +ue(n, t) - +Fr(n, t); return Math.round(r / kt) + 1; } function C(e, t) { return (e < 0 ? "-" : "") + Math.abs(e).toString().padStart(t, "0"); } var te = { y(e, t) { const n = e.getFullYear(), r = n > 0 ? n : 1 - n; return C(t === "yy" ? r % 100 : r, t.length); }, M(e, t) { const n = e.getMonth(); return t === "M" ? String(n + 1) : C(n + 1, 2); }, d(e, t) { return C(e.getDate(), t.length); }, a(e, t) { const n = e.getHours() / 12 >= 1 ? "pm" : "am"; switch (t) { 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(e, t) { return C(e.getHours() % 12 || 12, t.length); }, H(e, t) { return C(e.getHours(), t.length); }, m(e, t) { return C(e.getMinutes(), t.length); }, s(e, t) { return C(e.getSeconds(), t.length); }, S(e, t) { const n = t.length, r = e.getMilliseconds(); return C(Math.trunc(r * Math.pow(10, n - 3)), t.length); } }, ae = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, ht = { G: function(e, t, n) { const r = e.getFullYear() > 0 ? 1 : 0; switch (t) { 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(e, t, n) { if (t === "yo") { const r = e.getFullYear(), o = r > 0 ? r : 1 - r; return n.ordinalNumber(o, { unit: "year" }); } return te.y(e, t); }, Y: function(e, t, n, r) { const o = Et(e, r), a = o > 0 ? o : 1 - o; return t === "YY" ? C(a % 100, 2) : t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : C(a, t.length); }, R: function(e, t) { return C(Nt(e), t.length); }, u: function(e, t) { return C(e.getFullYear(), t.length); }, Q: function(e, t, n) { const r = Math.ceil((e.getMonth() + 1) / 3); switch (t) { case "Q": return String(r); case "QQ": return C(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(e, t, n) { const r = Math.ceil((e.getMonth() + 1) / 3); switch (t) { case "q": return String(r); case "qq": return C(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(e, t, n) { const r = e.getMonth(); switch (t) { case "M": case "MM": return te.M(e, t); 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(e, t, n) { const r = e.getMonth(); switch (t) { case "L": return String(r + 1); case "LL": return C(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(e, t, n, r) { const o = Xe(e, r); return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : C(o, t.length); }, I: function(e, t, n) { const r = Ke(e); return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : C(r, t.length); }, d: function(e, t, n) { return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : te.d(e, t); }, D: function(e, t, n) { const r = Er(e); return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : C(r, t.length); }, E: function(e, t, n) { const r = e.getDay(); switch (t) { 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(e, t, n, r) { const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7; switch (t) { case "e": return String(a); case "ee": return C(a, 2); case "eo": return n.ordinalNumber(a, { unit: "day" }); case "eee": return n.day(o, { width: "abbreviated", context: "formatting" }); case "eeeee": return n.day(o, { width: "narrow", context: "formatting" }); case "eeeeee": return n.day(o, { width: "short", context: "formatting" }); default: return n.day(o, { width: "wide", context: "formatting" }); } }, c: function(e, t, n, r) { const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7; switch (t) { case "c": return String(a); case "cc": return C(a, t.length); case "co": return n.ordinalNumber(a, { unit: "day" }); case "ccc": return n.day(o, { width: "abbreviated", context: "standalone" }); case "ccccc": return n.day(o, { width: "narrow", context: "standalone" }); case "cccccc": return n.day(o, { width: "short", context: "standalone" }); default: return n.day(o, { width: "wide", context: "standalone" }); } }, i: function(e, t, n) { const r = e.getDay(), o = r === 0 ? 7 : r; switch (t) { case "i": return String(o); case "ii": return C(o, t.length); case "io": return n.ordinalNumber(o, { 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(e, t, n) { const r = e.getHours() / 12 >= 1 ? "pm" : "am"; switch (t) { 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(e, t, n) { const r = e.getHours(); let o; switch (r === 12 ? o = ae.noon : r === 0 ? o = ae.midnight : o = r / 12 >= 1 ? "pm" : "am", t) { case "b": case "bb": return n.dayPeriod(o, { width: "abbreviated", context: "formatting" }); case "bbb": return n.dayPeriod(o, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return n.dayPeriod(o, { width: "narrow", context: "formatting" }); default: return n.dayPeriod(o, { width: "wide", context: "formatting" }); } }, B: function(e, t, n) { const r = e.getHours(); let o; switch (r >= 17 ? o = ae.evening : r >= 12 ? o = ae.afternoon : r >= 4 ? o = ae.morning : o = ae.night, t) { case "B": case "BB": case "BBB": return n.dayPeriod(o, { width: "abbreviated", context: "formatting" }); case "BBBBB": return n.dayPeriod(o, { width: "narrow", context: "formatting" }); default: return n.dayPeriod(o, { width: "wide", context: "formatting" }); } }, h: function(e, t, n) { if (t === "ho") { let r = e.getHours() % 12; return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" }); } return te.h(e, t); }, H: function(e, t, n) { return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : te.H(e, t); }, K: function(e, t, n) { const r = e.getHours() % 12; return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : C(r, t.length); }, k: function(e, t, n) { let r = e.getHours(); return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : C(r, t.length); }, m: function(e, t, n) { return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : te.m(e, t); }, s: function(e, t, n) { return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : te.s(e, t); }, S: function(e, t) { return te.S(e, t); }, X: function(e, t, n) { const r = e.getTimezoneOffset(); if (r === 0) return "Z"; switch (t) { case "X": return yt(r); case "XXXX": case "XX": return re(r); default: return re(r, ":"); } }, x: function(e, t, n) { const r = e.getTimezoneOffset(); switch (t) { case "x": return yt(r); case "xxxx": case "xx": return re(r); default: return re(r, ":"); } }, O: function(e, t, n) { const r = e.getTimezoneOffset(); switch (t) { case "O": case "OO": case "OOO": return "GMT" + mt(r, ":"); default: return "GMT" + re(r, ":"); } }, z: function(e, t, n) { const r = e.getTimezoneOffset(); switch (t) { case "z": case "zz": case "zzz": return "GMT" + mt(r, ":"); default: return "GMT" + re(r, ":"); } }, t: function(e, t, n) { return C(Math.trunc(+e / 1e3), t.length); }, T: function(e, t, n) { return C(+e, t.length); } }; function mt(e, t = "") { const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), a = r % 60; return a === 0 ? n + String(o) : n + String(o) + t + C(a, 2); } function yt(e, t) { return e % 60 === 0 ? (e > 0 ? "-" : "+") + C(Math.abs(e) / 60, 2) : re(e, t); } function re(e, t = "") { const n = e > 0 ? "-" : "+", r = Math.abs(e), o = C(Math.trunc(r / 60), 2), a = C(r % 60, 2); return n + o + t + a; } var vt = (e, t) => { switch (e) { case "P": return t.date({ width: "short" }); case "PP": return t.date({ width: "medium" }); case "PPP": return t.date({ width: "long" }); default: return t.date({ width: "full" }); } }, Ft = (e, t) => { switch (e) { case "p": return t.time({ width: "short" }); case "pp": return t.time({ width: "medium" }); case "ppp": return t.time({ width: "long" }); default: return t.time({ width: "full" }); } }, _r = (e, t) => { const n = e.match(/(P+)(p+)?/) || [], r = n[1], o = n[2]; if (!o) return vt(e, t); let a; switch (r) { case "P": a = t.dateTime({ width: "short" }); break; case "PP": a = t.dateTime({ width: "medium" }); break; case "PPP": a = t.dateTime({ width: "long" }); break; default: a = t.dateTime({ width: "full" }); break; } return a.replace("{{date}}", vt(r, t)).replace("{{time}}", Ft(o, t)); }, Br = { p: Ft, P: _r }, Ir = /^D+$/, Hr = /^Y+$/, Ar = [ "D", "DD", "YY", "YYYY" ]; function qr(e) { return Ir.test(e); } function Gr(e) { return Hr.test(e); } function $r(e, t, n) { const r = jr(e, t, n); if (console.warn(r), Ar.includes(e)) throw new RangeError(r); } function jr(e, t, n) { const r = e[0] === "Y" ? "years" : "days of the month"; return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } var Rr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Zr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, zr = /^'([^]*?)'?$/, Ur = /''/g, Qr = /[a-zA-Z]/; function ge(e, t, n) { const r = De(), o = n?.locale ?? r.locale ?? ie, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = Y(e, n?.in); if (!Qn(i)) throw new RangeError("Invalid time value"); let u = t.match(Zr).map((f) => { const l = f[0]; if (l === "p" || l === "P") { const g = Br[l]; return g(f, o.formatLong); } return f; }).join("").match(Rr).map((f) => { if (f === "''") return { isToken: !1, value: "'" }; const l = f[0]; if (l === "'") return { isToken: !1, value: Vr(f) }; if (ht[l]) return { isToken: !0, value: f }; if (l.match(Qr)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + l + "`"); return { isToken: !1, value: f }; }); o.localize.preprocessor && (u = o.localize.preprocessor(i, u)); const c = { firstWeekContainsDate: a, weekStartsOn: s, locale: o }; return u.map((f) => { if (!f.isToken) return f.value; const l = f.value; (!n?.useAdditionalWeekYearTokens && Gr(l) || !n?.useAdditionalDayOfYearTokens && qr(l)) && $r(l, t, String(e)); const g = ht[l[0]]; return g(i, l, o.localize, c); }).join(""); } function Vr(e) { const t = e.match(zr); return t ? t[1].replace(Ur, "'") : e; } function Kr(e, t) { const n = Y(e, t?.in), r = n.getFullYear(), o = n.getMonth(), a = B(n, 0); return a.setFullYear(r, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate(); } function Xr(e, t) { return Y(e, t?.in).getMonth(); } function Jr(e, t) { return Y(e, t?.in).getFullYear(); } function Lr(e, t) { return +Y(e) > +Y(t); } function eo(e, t) { return +Y(e) < +Y(t); } function to(e, t, n) { const [r, o] = ce(n?.in, e, t); return r.getFullYear() === o.getFullYear() && r.getMonth() === o.getMonth(); } function no(e, t, n) { const [r, o] = ce(n?.in, e, t); return r.getFullYear() === o.getFullYear(); } function ro(e, t, n) { const r = Y(e, n?.in), o = r.getFullYear(), a = r.getDate(), s = B(n?.in || e, 0); s.setFullYear(o, t, 15), s.setHours(0, 0, 0, 0); const i = Kr(s); return r.setMonth(t, Math.min(a, i)), r; } function oo(e, t, n) { const r = Y(e, n?.in); return isNaN(+r) ? B(n?.in || e, NaN) : (r.setFullYear(t), r); } var gt = 5, ao = 4; function so(e, t) { const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), a = t.addDays(o, gt * 7 - 1); return t.getMonth(e) === t.getMonth(a) ? gt : ao; } function _t(e, t) { const n = t.startOfMonth(e), r = n.getDay(); return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1)); } function io(e, t) { const n = _t(e, t), r = so(e, t); return t.addDays(n, r * 7 - 1); } var Bt = { ...ie, labels: { labelDayButton: (e, t, n, r) => { let o; r && typeof r.format == "function" ? o = r.format.bind(r) : o = (s, i) => ge(s, i, { locale: ie, ...n }); let a = o(e, "PPPP"); return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a; }, labelMonthDropdown: "Choose the Month", labelNext: "Go to the Next Month", labelPrevious: "Go to the Previous Month", labelWeekNumber: (e) => `Week ${e}`, labelYearDropdown: "Choose the Year", labelGrid: (e, t, n) => { let r; return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => ge(o, a, { locale: ie, ...t }), r(e, "LLLL yyyy"); }, labelGridcell: (e, t, n, r) => { let o; r && typeof r.format == "function" ? o = r.format.bind(r) : o = (s, i) => ge(s, i, { locale: ie, ...n }); let a = o(e, "PPPP"); return t?.today && (a = `Today, ${a}`), a; }, labelNav: "Navigation bar", labelWeekNumberHeader: "Week Number", labelWeekday: (e, t, n) => { let r; return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => ge(o, a, { locale: ie, ...t }), r(e, "cccc"); } } }, K = class Ue { constructor(t, n) { this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? j.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, o, a) => this.overrides?.newDate ? this.overrides.newDate(r, o, a) : this.options.timeZone ? new j(r, o, a, this.options.timeZone) : new Date(r, o, a), this.addDays = (r, o) => this.overrides?.addDays ? this.overrides.addDays(r, o) : Wt(r, o), this.addMonths = (r, o) => this.overrides?.addMonths ? this.overrides.addMonths(r, o) : St(r, o), this.addWeeks = (r, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, o) : jn(r, o), this.addYears = (r, o) => this.overrides?.addYears ? this.overrides.addYears(r, o) : Rn(r, o), this.differenceInCalendarDays = (r, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : Ve(r, o), this.differenceInCalendarMonths = (r, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : Yt(r, o), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Kn(r), this.eachYearOfInterval = (r) => { const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : Ln(r), a = new Set(o.map((i) => this.getYear(i))); if (a.size === o.length) return o; const s = []; return a.forEach((i) => { s.push(new Date(i, 0, 1)); }), s; }, this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : io(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : er(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : Vn(r), this.endOfWeek = (r, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, o) : Pt(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : Jn(r), this.format = (r, o, a) => { const s = this.overrides?.format ? this.overrides.format(r, o, this.options) : ge(r, o, this.options); return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s; }, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : Ke(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : Xr(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : Jr(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : Xe(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : Lr(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : eo(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : Ct(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : Un(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : to(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : no(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : Zn(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : zn(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : ro(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : oo(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : _t(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : we(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : be(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : Xn(r), this.startOfWeek = (r, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : ue(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : xt(r), this.options = { locale: Bt, ...t }, this.overrides = n; } getDigitMap() { const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", { numberingSystem: t }), r = {}; for (let o = 0; o < 10; o++) r[o.toString()] = n.format(o); return r; } replaceDigits(t) { const n = this.getDigitMap(); return t.replace(/\d/g, (r) => n[r] || r); } formatNumber(t) { return this.replaceDigits(t.toString()); } getMonthYearOrder() { const t = this.options.locale?.code; return t && Ue.yearFirstLocales.has(t) ? "year-first" : "month-first"; } formatMonthYear(t) { const { locale: n, timeZone: r, numerals: o } = this.options, a = n?.code; if (a && Ue.yearFirstLocales.has(a)) try { return new Intl.DateTimeFormat(a, { month: "long", year: "numeric", timeZone: r, numberingSystem: o }).format(t); } catch { } const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y"; return this.format(t, s); } }; K.yearFirstLocales = /* @__PURE__ */ new Set([ "eu", "hu", "ja", "ja-Hira", "ja-JP", "ko", "ko-KR", "lt", "lt-LT", "lv", "lv-LV", "mn", "mn-MN", "zh", "zh-CN", "zh-HK", "zh-TW" ]); var X = new K(), It = class { constructor(e, t, n = X) { this.date = e, this.displayMonth = t, this.outside = !!(t && !n.isSameMonth(e, t)), this.dateLib = n, this.isoDate = n.format(e, "yyyy-MM-dd"), this.displayMonthId = n.format(t, "yyyy-MM"), this.dateMonthId = n.format(e, "yyyy-MM"); } isEqualTo(e) { return this.dateLib.isSameDay(e.date, this.date) && this.dateLib.isSameMonth(e.displayMonth, this.displayMonth); } }, uo = class { constructor(e, t) { this.date = e, this.weeks = t; } }, co = class { constructor(e, t) { this.days = t, this.weekNumber = e; } }; function lo(e) { return d.createElement("button", { ...e }); } function fo(e) { return d.createElement("span", { ...e }); } function ho(e) { const { size: t = 24, orientation: n = "left", className: r } = e; return d.createElement("svg", { className: r, width: t, height: t, viewBox: "0 0 24 24" }, n === "up" && d.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }), n === "down" && d.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }), n === "left" && d.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }), n === "right" && d.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })); } function mo(e) { const { day: t, modifiers: n, ...r } = e; return d.createElement("td", { ...r }); } function yo(e) { const { day: t, modifiers: n, ...r } = e, o = d.useRef(null); return d.useEffect(() => { n.focused && o.current?.focus(); }, [n.focused]), d.createElement("button", { ref: o, ...r }); } var m; (function(e) { e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown"; })(m || (m = {})); var E; (function(e) { e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today"; })(E || (E = {})); var Q; (function(e) { e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected"; })(Q || (Q = {})); var A; (function(e) { e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit"; })(A || (A = {})); function vo(e) { const { options: t, className: n, components: r, classNames: o, ...a } = e, s = [o[m.Dropdown], n].join(" "), i = t?.find(({ value: u }) => u === a.value); return d.createElement("span", { "data-disabled": a.disabled, className: o[m.DropdownRoot] }, d.createElement(r.Select, { className: s, ...a }, t?.map(({ value: u, label: c, disabled: f }) => d.createElement(r.Option, { key: u, value: u, disabled: f }, c))), d.createElement("span", { className: o[m.CaptionLabel], "aria-hidden": !0 }, i?.label, d.createElement(r.Chevron, { orientation: "down", size: 18, className: o[m.Chevron] }))); } function go(e) { return d.createElement("div", { ...e }); } function bo(e) { return d.createElement("div", { ...e }); } function wo(e) { const { calendarMonth: t, displayIndex: n, ...r } = e; return d.createElement("div", { ...r }, e.children); } function Do(e) { const { calendarMonth: t, displayIndex: n, ...r } = e; return d.createElement("div", { ...r }); } function Mo(e) { return d.createElement("table", { ...e }); } function po(e) { return d.createElement("div", { ...e }); } var Ht = Nn(void 0); function Me() { const e = Cn(Ht); if (e === void 0) throw new Error("useDayPicker() must be used within a custom component."); return e; } function ko(e) { const { components: t } = Me(); return d.createElement(t.Dropdown, { ...e }); } function Oo(e) { const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...a } = e, { components: s, classNames: i, labels: { labelPrevious: u, labelNext: c } } = Me(), f = $((g) => { o && n?.(g); }, [o, n]), l = $((g) => { r && t?.(g); }, [r, t]); return d.createElement("nav", { ...a }, d.createElement(s.PreviousMonthButton, { type: "button", className: i[m.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled