UNPKG

@tiaohsun/vue-datepicker

Version:

A Vue 3 datepicker with multi-calendar support, styled with Tailwind CSS

1,567 lines 260 kB
import { defineComponent as Ce, ref as W, computed as C, watch as de, createElementBlock as L, openBlock as A, Fragment as De, renderList as $e, withDirectives as Ee, createCommentVNode as ce, vModelText as We, toDisplayString as oe, nextTick as Se, createElementVNode as _, withModifiers as we, normalizeClass as ge, renderSlot as pe, onMounted as Ht, onBeforeUnmount as Bt, createVNode as ue, createTextVNode as ba, unref as V, withKeys as Fe, vModelSelect as Mt, createSlots as ct, withCtx as dt, normalizeProps as ft, guardReactiveProps as mt, isMemoSame as jr, createBlock as _r, useSlots as Jr, toRef as zt, onBeforeMount as Xa, mergeProps as er, isRef as Ma } from "vue"; import ie from "dayjs"; function vt(r) { return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r; } var wt = { exports: {} }, Kr = wt.exports, wa; function Qr() { return wa || (wa = 1, function(r, e) { (function(t, a) { r.exports = a(); })(Kr, function() { var t = "minute", a = /[+-]\d\d(?::?\d\d)?/g, n = /([+-]|\d\d)/g; return function(o, l, s) { var u = l.prototype; s.utc = function(f) { var p = { date: f, utc: !0, args: arguments }; return new l(p); }, u.utc = function(f) { var p = s(this.toDate(), { locale: this.$L, utc: !0 }); return f ? p.add(this.utcOffset(), t) : p; }, u.local = function() { return s(this.toDate(), { locale: this.$L, utc: !1 }); }; var i = u.parse; u.parse = function(f) { f.utc && (this.$u = !0), this.$utils().u(f.$offset) || (this.$offset = f.$offset), i.call(this, f); }; var m = u.init; u.init = function() { if (this.$u) { var f = this.$d; this.$y = f.getUTCFullYear(), this.$M = f.getUTCMonth(), this.$D = f.getUTCDate(), this.$W = f.getUTCDay(), this.$H = f.getUTCHours(), this.$m = f.getUTCMinutes(), this.$s = f.getUTCSeconds(), this.$ms = f.getUTCMilliseconds(); } else m.call(this); }; var g = u.utcOffset; u.utcOffset = function(f, p) { var c = this.$utils().u; if (c(f)) return this.$u ? 0 : c(this.$offset) ? g.call(this) : this.$offset; if (typeof f == "string" && (f = function(b) { b === void 0 && (b = ""); var $ = b.match(a); if (!$) return null; var d = ("" + $[0]).match(n) || ["-", 0, 0], y = d[0], D = 60 * +d[1] + +d[2]; return D === 0 ? 0 : y === "+" ? D : -D; }(f), f === null)) return this; var w = Math.abs(f) <= 16 ? 60 * f : f, S = this; if (p) return S.$offset = w, S.$u = f === 0, S; if (f !== 0) { var h = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); (S = this.local().add(w + h, t)).$offset = w, S.$x.$localOffset = h; } else S = this.utc(); return S; }; var v = u.format; u.format = function(f) { var p = f || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : ""); return v.call(this, p); }, u.valueOf = function() { var f = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); return this.$d.valueOf() - 6e4 * f; }, u.isUTC = function() { return !!this.$u; }, u.toISOString = function() { return this.toDate().toISOString(); }, u.toString = function() { return this.toDate().toUTCString(); }; var k = u.toDate; u.toDate = function(f) { return f === "s" && this.$offset ? s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : k.call(this); }; var T = u.diff; u.diff = function(f, p, c) { if (f && this.$u === f.$u) return T.call(this, f, p, c); var w = this.local(), S = s(f).local(); return T.call(w, S, p, c); }; }; }); }(wt)), wt.exports; } var Zr = Qr(); const Gr = /* @__PURE__ */ vt(Zr); var St = { exports: {} }, Xr = St.exports, Sa; function en() { return Sa || (Sa = 1, function(r, e) { (function(t, a) { r.exports = a(); })(Xr, function() { var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, a = {}; return function(n, o, l) { var s, u = function(v, k, T) { T === void 0 && (T = {}); var f = new Date(v), p = function(c, w) { w === void 0 && (w = {}); var S = w.timeZoneName || "short", h = c + "|" + S, b = a[h]; return b || (b = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: c, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: S }), a[h] = b), b; }(k, T); return p.formatToParts(f); }, i = function(v, k) { for (var T = u(v, k), f = [], p = 0; p < T.length; p += 1) { var c = T[p], w = c.type, S = c.value, h = t[w]; h >= 0 && (f[h] = parseInt(S, 10)); } var b = f[3], $ = b === 24 ? 0 : b, d = f[0] + "-" + f[1] + "-" + f[2] + " " + $ + ":" + f[4] + ":" + f[5] + ":000", y = +v; return (l.utc(d).valueOf() - (y -= y % 1e3)) / 6e4; }, m = o.prototype; m.tz = function(v, k) { v === void 0 && (v = s); var T, f = this.utcOffset(), p = this.toDate(), c = p.toLocaleString("en-US", { timeZone: v }), w = Math.round((p - new Date(c)) / 1e3 / 60), S = 15 * -Math.round(p.getTimezoneOffset() / 15) - w; if (!Number(S)) T = this.utcOffset(0, k); else if (T = l(c, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(S, !0), k) { var h = T.utcOffset(); T = T.add(f - h, "minute"); } return T.$x.$timezone = v, T; }, m.offsetName = function(v) { var k = this.$x.$timezone || l.tz.guess(), T = u(this.valueOf(), k, { timeZoneName: v }).find(function(f) { return f.type.toLowerCase() === "timezonename"; }); return T && T.value; }; var g = m.startOf; m.startOf = function(v, k) { if (!this.$x || !this.$x.$timezone) return g.call(this, v, k); var T = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); return g.call(T, v, k).tz(this.$x.$timezone, !0); }, l.tz = function(v, k, T) { var f = T && k, p = T || k || s, c = i(+l(), p); if (typeof v != "string") return l(v).tz(p); var w = function($, d, y) { var D = $ - 60 * d * 1e3, P = i(D, y); if (d === P) return [D, d]; var z = i(D -= 60 * (P - d) * 1e3, y); return P === z ? [D, P] : [$ - 60 * Math.min(P, z) * 1e3, Math.max(P, z)]; }(l.utc(v, f).valueOf(), c, p), S = w[0], h = w[1], b = l(S).utcOffset(h); return b.$x.$timezone = p, b; }, l.tz.guess = function() { return Intl.DateTimeFormat().resolvedOptions().timeZone; }, l.tz.setDefault = function(v) { s = v; }; }; }); }(St)), St.exports; } var tn = en(); const an = /* @__PURE__ */ vt(tn); var kt = { exports: {} }, rn = kt.exports, ka; function nn() { return ka || (ka = 1, function(r, e) { (function(t, a) { r.exports = a(); })(rn, function() { var t = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, a = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, o = /\d\d/, l = /\d\d?/, s = /\d*[^-_:/,()\s\d]+/, u = {}, i = function(p) { return (p = +p) + (p > 68 ? 1900 : 2e3); }, m = function(p) { return function(c) { this[p] = +c; }; }, g = [/[+-]\d\d:?(\d\d)?|Z/, function(p) { (this.zone || (this.zone = {})).offset = function(c) { if (!c || c === "Z") return 0; var w = c.match(/([+-]|\d\d)/g), S = 60 * w[1] + (+w[2] || 0); return S === 0 ? 0 : w[0] === "+" ? -S : S; }(p); }], v = function(p) { var c = u[p]; return c && (c.indexOf ? c : c.s.concat(c.f)); }, k = function(p, c) { var w, S = u.meridiem; if (S) { for (var h = 1; h <= 24; h += 1) if (p.indexOf(S(h, 0, c)) > -1) { w = h > 12; break; } } else w = p === (c ? "pm" : "PM"); return w; }, T = { A: [s, function(p) { this.afternoon = k(p, !1); }], a: [s, function(p) { this.afternoon = k(p, !0); }], Q: [n, function(p) { this.month = 3 * (p - 1) + 1; }], S: [n, function(p) { this.milliseconds = 100 * +p; }], SS: [o, function(p) { this.milliseconds = 10 * +p; }], SSS: [/\d{3}/, function(p) { this.milliseconds = +p; }], s: [l, m("seconds")], ss: [l, m("seconds")], m: [l, m("minutes")], mm: [l, m("minutes")], H: [l, m("hours")], h: [l, m("hours")], HH: [l, m("hours")], hh: [l, m("hours")], D: [l, m("day")], DD: [o, m("day")], Do: [s, function(p) { var c = u.ordinal, w = p.match(/\d+/); if (this.day = w[0], c) for (var S = 1; S <= 31; S += 1) c(S).replace(/\[|\]/g, "") === p && (this.day = S); }], w: [l, m("week")], ww: [o, m("week")], M: [l, m("month")], MM: [o, m("month")], MMM: [s, function(p) { var c = v("months"), w = (v("monthsShort") || c.map(function(S) { return S.slice(0, 3); })).indexOf(p) + 1; if (w < 1) throw new Error(); this.month = w % 12 || w; }], MMMM: [s, function(p) { var c = v("months").indexOf(p) + 1; if (c < 1) throw new Error(); this.month = c % 12 || c; }], Y: [/[+-]?\d+/, m("year")], YY: [o, function(p) { this.year = i(p); }], YYYY: [/\d{4}/, m("year")], Z: g, ZZ: g }; function f(p) { var c, w; c = p, w = u && u.formats; for (var S = (p = c.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(P, z, J) { var j = J && J.toUpperCase(); return z || w[J] || t[J] || w[j].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(X, Z, I) { return Z || I.slice(1); }); })).match(a), h = S.length, b = 0; b < h; b += 1) { var $ = S[b], d = T[$], y = d && d[0], D = d && d[1]; S[b] = D ? { regex: y, parser: D } : $.replace(/^\[|\]$/g, ""); } return function(P) { for (var z = {}, J = 0, j = 0; J < h; J += 1) { var X = S[J]; if (typeof X == "string") j += X.length; else { var Z = X.regex, I = X.parser, E = P.slice(j), M = Z.exec(E)[0]; I.call(z, M), P = P.replace(M, ""); } } return function(H) { var q = H.afternoon; if (q !== void 0) { var ee = H.hours; q ? ee < 12 && (H.hours += 12) : ee === 12 && (H.hours = 0), delete H.afternoon; } }(z), z; }; } return function(p, c, w) { w.p.customParseFormat = !0, p && p.parseTwoDigitYear && (i = p.parseTwoDigitYear); var S = c.prototype, h = S.parse; S.parse = function(b) { var $ = b.date, d = b.utc, y = b.args; this.$u = d; var D = y[1]; if (typeof D == "string") { var P = y[2] === !0, z = y[3] === !0, J = P || z, j = y[2]; z && (j = y[2]), u = this.$locale(), !P && j && (u = w.Ls[j]), this.$d = function(E, M, H, q) { try { if (["x", "X"].indexOf(M) > -1) return new Date((M === "X" ? 1e3 : 1) * E); var ee = f(M)(E), me = ee.year, se = ee.month, R = ee.day, Y = ee.hours, B = ee.minutes, te = ee.seconds, Q = ee.milliseconds, N = ee.zone, K = ee.week, ae = /* @__PURE__ */ new Date(), he = R || (me || se ? 1 : ae.getDate()), ye = me || ae.getFullYear(), Me = 0; me && !se || (Me = se > 0 ? se - 1 : ae.getMonth()); var be, F = Y || 0, x = B || 0, U = te || 0, re = Q || 0; return N ? new Date(Date.UTC(ye, Me, he, F, x, U, re + 60 * N.offset * 1e3)) : H ? new Date(Date.UTC(ye, Me, he, F, x, U, re)) : (be = new Date(ye, Me, he, F, x, U, re), K && (be = q(be).week(K).toDate()), be); } catch { return /* @__PURE__ */ new Date(""); } }($, D, d, w), this.init(), j && j !== !0 && (this.$L = this.locale(j).$L), J && $ != this.format(D) && (this.$d = /* @__PURE__ */ new Date("")), u = {}; } else if (D instanceof Array) for (var X = D.length, Z = 1; Z <= X; Z += 1) { y[1] = D[Z - 1]; var I = w.apply(this, y); if (I.isValid()) { this.$d = I.$d, this.$L = I.$L, this.init(); break; } Z === X && (this.$d = /* @__PURE__ */ new Date("")); } else h.call(this, b); }; }; }); }(kt)), kt.exports; } var on = nn(); const tr = /* @__PURE__ */ vt(on); var Tt = { exports: {} }, ln = Tt.exports, Ta; function sn() { return Ta || (Ta = 1, function(r, e) { (function(t, a) { r.exports = a(); })(ln, function() { var t = "week", a = "year"; return function(n, o, l) { var s = o.prototype; s.week = function(u) { if (u === void 0 && (u = null), u !== null) return this.add(7 * (u - this.week()), "day"); var i = this.$locale().yearStart || 1; if (this.month() === 11 && this.date() > 25) { var m = l(this).startOf(a).add(1, a).date(i), g = l(this).endOf(t); if (m.isBefore(g)) return 1; } var v = l(this).startOf(a).date(i).startOf(t).subtract(1, "millisecond"), k = this.diff(v, t, !0); return k < 0 ? l(this).startOf("week").week() : Math.ceil(k); }, s.weeks = function(u) { return u === void 0 && (u = null), this.week(u); }; }; }); }(Tt)), Tt.exports; } var un = sn(); const cn = /* @__PURE__ */ vt(un); var xt = { exports: {} }, dn = xt.exports, xa; function fn() { return xa || (xa = 1, function(r, e) { (function(t, a) { r.exports = a(); })(dn, function() { return function(t, a, n) { var o = a.prototype, l = function(g) { return g && (g.indexOf ? g : g.s); }, s = function(g, v, k, T, f) { var p = g.name ? g : g.$locale(), c = l(p[v]), w = l(p[k]), S = c || w.map(function(b) { return b.slice(0, T); }); if (!f) return S; var h = p.weekStart; return S.map(function(b, $) { return S[($ + (h || 0)) % 7]; }); }, u = function() { return n.Ls[n.locale()]; }, i = function(g, v) { return g.formats[v] || function(k) { return k.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(T, f, p) { return f || p.slice(1); }); }(g.formats[v.toUpperCase()]); }, m = function() { var g = this; return { months: function(v) { return v ? v.format("MMMM") : s(g, "months"); }, monthsShort: function(v) { return v ? v.format("MMM") : s(g, "monthsShort", "months", 3); }, firstDayOfWeek: function() { return g.$locale().weekStart || 0; }, weekdays: function(v) { return v ? v.format("dddd") : s(g, "weekdays"); }, weekdaysMin: function(v) { return v ? v.format("dd") : s(g, "weekdaysMin", "weekdays", 2); }, weekdaysShort: function(v) { return v ? v.format("ddd") : s(g, "weekdaysShort", "weekdays", 3); }, longDateFormat: function(v) { return i(g.$locale(), v); }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal }; }; o.localeData = function() { return m.bind(this)(); }, n.localeData = function() { var g = u(); return { firstDayOfWeek: function() { return g.weekStart || 0; }, weekdays: function() { return n.weekdays(); }, weekdaysShort: function() { return n.weekdaysShort(); }, weekdaysMin: function() { return n.weekdaysMin(); }, months: function() { return n.months(); }, monthsShort: function() { return n.monthsShort(); }, longDateFormat: function(v) { return i(g, v); }, meridiem: g.meridiem, ordinal: g.ordinal }; }, n.months = function() { return s(u(), "months"); }, n.monthsShort = function() { return s(u(), "monthsShort", "months", 3); }, n.weekdays = function(g) { return s(u(), "weekdays", null, null, g); }, n.weekdaysShort = function(g) { return s(u(), "weekdaysShort", "weekdays", 3, g); }, n.weekdaysMin = function(g) { return s(u(), "weekdaysMin", "weekdays", 2, g); }; }; }); }(xt)), xt.exports; } var mn = fn(); const hn = /* @__PURE__ */ vt(mn); ie.extend(tr); const Ca = { "en-US": ["MM/DD/YYYY", "M/D/YYYY"], "en-GB": ["DD/MM/YYYY", "D/M/YYYY"], "zh-TW": ["YYYY-MM-DD", "YYYY/MM/DD"], "zh-CN": ["YYYY-MM-DD", "YYYY/MM/DD"] }, Ya = [ "YYYY-MM-DD", "YYYY/MM/DD", "DD/MM/YYYY", "MM/DD/YYYY", "DD-MM-YYYY", "MM-DD-YYYY", "YY-MM-DD", "YY/MM/DD" ]; class vn { locale; calendar; preferredFormats; constructor(e = "zh-TW", t = "gregory") { this.locale = e, this.calendar = t, this.preferredFormats = [ ...Ca[e] || [], ...Ya ]; } parse(e) { if (!e || typeof e != "string") return { success: !1, date: null, format: null, confidence: 0 }; const t = e.trim(); try { const a = this.tryParseWithPlugins(t); if (a.success) return a; for (const n of this.preferredFormats) { const o = this.tryParseWithFormat(t, n); if (o.success) return { ...o, confidence: 0.9 }; } return this.fallbackParse(t); } catch (a) { return console.warn("日期解析失敗:", a), { success: !1, date: null, format: null, confidence: 0 }; } } tryParseWithPlugins(e) { switch (this.calendar) { case "roc": const t = new kr(); if (t.canParseInput(e)) { const a = t.parseInput(e, this.locale); if (a) return { success: !0, date: a, format: "roc-plugin", confidence: 0.95, calendarSystem: "roc" }; } break; } return { success: !1, date: null, format: null, confidence: 0 }; } tryParseWithFormat(e, t) { try { const a = ie(e, t, !0); if (a.isValid()) return { success: !0, date: { year: a.year(), month: a.month() + 1, day: a.date(), hour: a.hour() || 0, minute: a.minute() || 0, second: a.second() || 0 }, format: t, confidence: 1, calendarSystem: "gregory" }; } catch { } return { success: !1, date: null, format: null, confidence: 0 }; } fallbackParse(e) { try { const t = ie(e); if (t.isValid()) return { success: !0, date: { year: t.year(), month: t.month() + 1, day: t.date(), hour: t.hour() || 0, minute: t.minute() || 0, second: t.second() || 0 }, format: "auto-detected", confidence: 0.6, calendarSystem: "gregory" }; } catch { } return { success: !1, date: null, format: null, confidence: 0 }; } setLocale(e) { this.locale = e, this.preferredFormats = [ ...Ca[e] || [], ...Ya ]; } setCalendar(e) { this.calendar = e; } } const ot = new vn(); function pn(r, e = "zh-TW", t = "gregory") { return e !== ot.locale && ot.setLocale(e), t !== ot.calendar && ot.setCalendar(t), ot.parse(r); } function Ke(r, e) { return r - e * Math.floor(r / e); } const ar = 1721426; function ze(r, e, t, a) { e = pt(r, e); let n = e - 1, o = -2; return t <= 2 ? o = 0 : qe(e) && (o = -1), ar - 1 + 365 * n + Math.floor(n / 4) - Math.floor(n / 100) + Math.floor(n / 400) + Math.floor((367 * t - 362) / 12 + o + a); } function qe(r) { return r % 4 === 0 && (r % 100 !== 0 || r % 400 === 0); } function pt(r, e) { return r === "BC" ? 1 - e : e; } function qt(r) { let e = "AD"; return r <= 0 && (e = "BC", r = 1 - r), [ e, r ]; } const gn = { standard: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], leapyear: [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ] }; class xe { fromJulianDay(e) { let t = e, a = t - ar, n = Math.floor(a / 146097), o = Ke(a, 146097), l = Math.floor(o / 36524), s = Ke(o, 36524), u = Math.floor(s / 1461), i = Ke(s, 1461), m = Math.floor(i / 365), g = n * 400 + l * 100 + u * 4 + m + (l !== 4 && m !== 4 ? 1 : 0), [v, k] = qt(g), T = t - ze(v, k, 1, 1), f = 2; t < ze(v, k, 3, 1) ? f = 0 : qe(k) && (f = 1); let p = Math.floor(((T + f) * 12 + 373) / 367), c = t - ze(v, k, p, 1) + 1; return new le(v, k, p, c); } toJulianDay(e) { return ze(e.era, e.year, e.month, e.day); } getDaysInMonth(e) { return gn[qe(e.year) ? "leapyear" : "standard"][e.month - 1]; } // eslint-disable-next-line @typescript-eslint/no-unused-vars getMonthsInYear(e) { return 12; } getDaysInYear(e) { return qe(e.year) ? 366 : 365; } // eslint-disable-next-line @typescript-eslint/no-unused-vars getYearsInEra(e) { return 9999; } getEras() { return [ "BC", "AD" ]; } isInverseEra(e) { return e.era === "BC"; } balanceDate(e) { e.year <= 0 && (e.era = e.era === "BC" ? "AD" : "BC", e.year = 1 - e.year); } constructor() { this.identifier = "gregory"; } } const yn = { "001": 1, AD: 1, AE: 6, AF: 6, AI: 1, AL: 1, AM: 1, AN: 1, AR: 1, AT: 1, AU: 1, AX: 1, AZ: 1, BA: 1, BE: 1, BG: 1, BH: 6, BM: 1, BN: 1, BY: 1, CH: 1, CL: 1, CM: 1, CN: 1, CR: 1, CY: 1, CZ: 1, DE: 1, DJ: 6, DK: 1, DZ: 6, EC: 1, EE: 1, EG: 6, ES: 1, FI: 1, FJ: 1, FO: 1, FR: 1, GB: 1, GE: 1, GF: 1, GP: 1, GR: 1, HR: 1, HU: 1, IE: 1, IQ: 6, IR: 6, IS: 1, IT: 1, JO: 6, KG: 1, KW: 6, KZ: 1, LB: 1, LI: 1, LK: 1, LT: 1, LU: 1, LV: 1, LY: 6, MC: 1, MD: 1, ME: 1, MK: 1, MN: 1, MQ: 1, MV: 5, MY: 1, NL: 1, NO: 1, NZ: 1, OM: 6, PL: 1, QA: 6, RE: 1, RO: 1, RS: 1, RU: 1, SD: 6, SE: 1, SI: 1, SK: 1, SM: 1, SY: 6, TJ: 1, TM: 1, TR: 1, UA: 1, UY: 1, UZ: 1, VA: 1, VN: 1, XK: 1 }; function $n(r, e) { var t, a, n, o; return (o = (n = (t = r.isEqual) === null || t === void 0 ? void 0 : t.call(r, e)) !== null && n !== void 0 ? n : (a = e.isEqual) === null || a === void 0 ? void 0 : a.call(e, r)) !== null && o !== void 0 ? o : r.identifier === e.identifier; } function rr(r, e, t) { let a = r.calendar.toJulianDay(r), n = kn(e), o = Math.ceil(a + 1 - n) % 7; return o < 0 && (o += 7), o; } function Dn(r) { return Le(Date.now(), r); } function bn(r) { return Yn(Dn(r)); } function nr(r, e) { return r.calendar.toJulianDay(r) - e.calendar.toJulianDay(e); } function Mn(r, e) { return Ra(r) - Ra(e); } function Ra(r) { return r.hour * 36e5 + r.minute * 6e4 + r.second * 1e3 + r.millisecond; } let Wt = null; function fa() { return Wt == null && (Wt = new Intl.DateTimeFormat().resolvedOptions().timeZone), Wt; } function wn(r) { return r.subtract({ days: r.day - 1 }); } const Ea = /* @__PURE__ */ new Map(); function Sn(r) { if (Intl.Locale) { let t = Ea.get(r); return t || (t = new Intl.Locale(r).maximize().region, t && Ea.set(r, t)), t; } let e = r.split("-")[1]; return e === "u" ? void 0 : e; } function kn(r) { let e = Sn(r); return e && yn[e] || 0; } function Tn(r, e, t) { let a = r.calendar.getDaysInMonth(r); return Math.ceil((rr(wn(r), e) + a) / 7); } function tt(r) { r = ke(r, new xe()); let e = pt(r.era, r.year); return or(e, r.month, r.day, r.hour, r.minute, r.second, r.millisecond); } function or(r, e, t, a, n, o, l) { let s = /* @__PURE__ */ new Date(); return s.setUTCHours(a, n, o, l), s.setUTCFullYear(r, e - 1, t), s.getTime(); } function Zt(r, e) { if (e === "UTC") return 0; if (r > 0 && e === fa()) return new Date(r).getTimezoneOffset() * -6e4; let { year: t, month: a, day: n, hour: o, minute: l, second: s } = lr(r, e); return or(t, a, n, o, l, s, 0) - Math.floor(r / 1e3) * 1e3; } const Ia = /* @__PURE__ */ new Map(); function lr(r, e) { let t = Ia.get(e); t || (t = new Intl.DateTimeFormat("en-US", { timeZone: e, hour12: !1, era: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }), Ia.set(e, t)); let a = t.formatToParts(new Date(r)), n = {}; for (let o of a) o.type !== "literal" && (n[o.type] = o.value); return { // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253 year: n.era === "BC" || n.era === "B" ? -n.year + 1 : +n.year, month: +n.month, day: +n.day, hour: n.hour === "24" ? 0 : +n.hour, minute: +n.minute, second: +n.second }; } const Oa = 864e5; function xn(r, e, t, a) { return (t === a ? [ t ] : [ t, a ]).filter((o) => Cn(r, e, o)); } function Cn(r, e, t) { let a = lr(t, e); return r.year === a.year && r.month === a.month && r.day === a.day && r.hour === a.hour && r.minute === a.minute && r.second === a.second; } function Pe(r, e, t = "compatible") { let a = at(r); if (e === "UTC") return tt(a); if (e === fa() && t === "compatible") { a = ke(a, new xe()); let u = /* @__PURE__ */ new Date(), i = pt(a.era, a.year); return u.setFullYear(i, a.month - 1, a.day), u.setHours(a.hour, a.minute, a.second, a.millisecond), u.getTime(); } let n = tt(a), o = Zt(n - Oa, e), l = Zt(n + Oa, e), s = xn(a, e, n - o, n - l); if (s.length === 1) return s[0]; if (s.length > 1) switch (t) { // 'compatible' means 'earlier' for "fall back" transitions case "compatible": case "earlier": return s[0]; case "later": return s[s.length - 1]; case "reject": throw new RangeError("Multiple possible absolute times found"); } switch (t) { case "earlier": return Math.min(n - o, n - l); // 'compatible' means 'later' for "spring forward" transitions case "compatible": case "later": return Math.max(n - o, n - l); case "reject": throw new RangeError("No such absolute time found"); } } function sr(r, e, t = "compatible") { return new Date(Pe(r, e, t)); } function Le(r, e) { let t = Zt(r, e), a = new Date(r + t), n = a.getUTCFullYear(), o = a.getUTCMonth() + 1, l = a.getUTCDate(), s = a.getUTCHours(), u = a.getUTCMinutes(), i = a.getUTCSeconds(), m = a.getUTCMilliseconds(); return new ht(n < 1 ? "BC" : "AD", n < 1 ? -n + 1 : n, o, l, e, t, s, u, i, m); } function Yn(r) { return new le(r.calendar, r.era, r.year, r.month, r.day); } function at(r, e) { let t = 0, a = 0, n = 0, o = 0; if ("timeZone" in r) ({ hour: t, minute: a, second: n, millisecond: o } = r); else if ("hour" in r && !e) return r; return e && ({ hour: t, minute: a, second: n, millisecond: o } = e), new rt(r.calendar, r.era, r.year, r.month, r.day, t, a, n, o); } function ke(r, e) { if ($n(r.calendar, e)) return r; let t = e.fromJulianDay(r.calendar.toJulianDay(r)), a = r.copy(); return a.calendar = e, a.era = t.era, a.year = t.year, a.month = t.month, a.day = t.day, je(a), a; } function Rn(r, e, t) { if (r instanceof ht) return r.timeZone === e ? r : In(r, e); let a = Pe(r, e, t); return Le(a, e); } function En(r) { let e = tt(r) - r.offset; return new Date(e); } function In(r, e) { let t = tt(r) - r.offset; return ke(Le(t, e), r.calendar); } const lt = 36e5; function Ut(r, e) { let t = r.copy(), a = "hour" in t ? Pn(t, e) : 0; Gt(t, e.years || 0), t.calendar.balanceYearMonth && t.calendar.balanceYearMonth(t, r), t.month += e.months || 0, Xt(t), ir(t), t.day += (e.weeks || 0) * 7, t.day += e.days || 0, t.day += a, On(t), t.calendar.balanceDate && t.calendar.balanceDate(t), t.year < 1 && (t.year = 1, t.month = 1, t.day = 1); let n = t.calendar.getYearsInEra(t); if (t.year > n) { var o, l; let u = (o = (l = t.calendar).isInverseEra) === null || o === void 0 ? void 0 : o.call(l, t); t.year = n, t.month = u ? 1 : t.calendar.getMonthsInYear(t), t.day = u ? 1 : t.calendar.getDaysInMonth(t); } t.month < 1 && (t.month = 1, t.day = 1); let s = t.calendar.getMonthsInYear(t); return t.month > s && (t.month = s, t.day = t.calendar.getDaysInMonth(t)), t.day = Math.max(1, Math.min(t.calendar.getDaysInMonth(t), t.day)), t; } function Gt(r, e) { var t, a; !((t = (a = r.calendar).isInverseEra) === null || t === void 0) && t.call(a, r) && (e = -e), r.year += e; } function Xt(r) { for (; r.month < 1; ) Gt(r, -1), r.month += r.calendar.getMonthsInYear(r); let e = 0; for (; r.month > (e = r.calendar.getMonthsInYear(r)); ) r.month -= e, Gt(r, 1); } function On(r) { for (; r.day < 1; ) r.month--, Xt(r), r.day += r.calendar.getDaysInMonth(r); for (; r.day > r.calendar.getDaysInMonth(r); ) r.day -= r.calendar.getDaysInMonth(r), r.month++, Xt(r); } function ir(r) { r.month = Math.max(1, Math.min(r.calendar.getMonthsInYear(r), r.month)), r.day = Math.max(1, Math.min(r.calendar.getDaysInMonth(r), r.day)); } function je(r) { r.calendar.constrainDate && r.calendar.constrainDate(r), r.year = Math.max(1, Math.min(r.calendar.getYearsInEra(r), r.year)), ir(r); } function ur(r) { let e = {}; for (let t in r) typeof r[t] == "number" && (e[t] = -r[t]); return e; } function cr(r, e) { return Ut(r, ur(e)); } function ma(r, e) { let t = r.copy(); return e.era != null && (t.era = e.era), e.year != null && (t.year = e.year), e.month != null && (t.month = e.month), e.day != null && (t.day = e.day), je(t), t; } function Et(r, e) { let t = r.copy(); return e.hour != null && (t.hour = e.hour), e.minute != null && (t.minute = e.minute), e.second != null && (t.second = e.second), e.millisecond != null && (t.millisecond = e.millisecond), Fn(t), t; } function Vn(r) { r.second += Math.floor(r.millisecond / 1e3), r.millisecond = yt(r.millisecond, 1e3), r.minute += Math.floor(r.second / 60), r.second = yt(r.second, 60), r.hour += Math.floor(r.minute / 60), r.minute = yt(r.minute, 60); let e = Math.floor(r.hour / 24); return r.hour = yt(r.hour, 24), e; } function Fn(r) { r.millisecond = Math.max(0, Math.min(r.millisecond, 1e3)), r.second = Math.max(0, Math.min(r.second, 59)), r.minute = Math.max(0, Math.min(r.minute, 59)), r.hour = Math.max(0, Math.min(r.hour, 23)); } function yt(r, e) { let t = r % e; return t < 0 && (t += e), t; } function Pn(r, e) { return r.hour += e.hours || 0, r.minute += e.minutes || 0, r.second += e.seconds || 0, r.millisecond += e.milliseconds || 0, Vn(r); } function ha(r, e, t, a) { let n = r.copy(); switch (e) { case "era": { let s = r.calendar.getEras(), u = s.indexOf(r.era); if (u < 0) throw new Error("Invalid era: " + r.era); u = He(u, t, 0, s.length - 1, a?.round), n.era = s[u], je(n); break; } case "year": var o, l; !((o = (l = n.calendar).isInverseEra) === null || o === void 0) && o.call(l, n) && (t = -t), n.year = He(r.year, t, -1 / 0, 9999, a?.round), n.year === -1 / 0 && (n.year = 1), n.calendar.balanceYearMonth && n.calendar.balanceYearMonth(n, r); break; case "month": n.month = He(r.month, t, 1, r.calendar.getMonthsInYear(r), a?.round); break; case "day": n.day = He(r.day, t, 1, r.calendar.getDaysInMonth(r), a?.round); break; default: throw new Error("Unsupported field " + e); } return r.calendar.balanceDate && r.calendar.balanceDate(n), je(n), n; } function dr(r, e, t, a) { let n = r.copy(); switch (e) { case "hour": { let o = r.hour, l = 0, s = 23; if (a?.hourCycle === 12) { let u = o >= 12; l = u ? 12 : 0, s = u ? 23 : 11; } n.hour = He(o, t, l, s, a?.round); break; } case "minute": n.minute = He(r.minute, t, 0, 59, a?.round); break; case "second": n.second = He(r.second, t, 0, 59, a?.round); break; case "millisecond": n.millisecond = He(r.millisecond, t, 0, 999, a?.round); break; default: throw new Error("Unsupported field " + e); } return n; } function He(r, e, t, a, n = !1) { if (n) { r += Math.sign(e), r < t && (r = a); let o = Math.abs(e); e > 0 ? r = Math.ceil(r / o) * o : r = Math.floor(r / o) * o, r > a && (r = t); } else r += e, r < t ? r = a - (t - r - 1) : r > a && (r = t + (r - a - 1)); return r; } function fr(r, e) { let t; if (e.years != null && e.years !== 0 || e.months != null && e.months !== 0 || e.weeks != null && e.weeks !== 0 || e.days != null && e.days !== 0) { let n = Ut(at(r), { years: e.years, months: e.months, weeks: e.weeks, days: e.days }); t = Pe(n, r.timeZone); } else t = tt(r) - r.offset; t += e.milliseconds || 0, t += (e.seconds || 0) * 1e3, t += (e.minutes || 0) * 6e4, t += (e.hours || 0) * 36e5; let a = Le(t, r.timeZone); return ke(a, r.calendar); } function An(r, e) { return fr(r, ur(e)); } function Ln(r, e, t, a) { switch (e) { case "hour": { let n = 0, o = 23; if (a?.hourCycle === 12) { let T = r.hour >= 12; n = T ? 12 : 0, o = T ? 23 : 11; } let l = at(r), s = ke(Et(l, { hour: n }), new xe()), u = [ Pe(s, r.timeZone, "earlier"), Pe(s, r.timeZone, "later") ].filter((T) => Le(T, r.timeZone).day === s.day)[0], i = ke(Et(l, { hour: o }), new xe()), m = [ Pe(i, r.timeZone, "earlier"), Pe(i, r.timeZone, "later") ].filter((T) => Le(T, r.timeZone).day === i.day).pop(), g = tt(r) - r.offset, v = Math.floor(g / lt), k = g % lt; return g = He(v, t, Math.floor(u / lt), Math.floor(m / lt), a?.round) * lt + k, ke(Le(g, r.timeZone), r.calendar); } case "minute": case "second": case "millisecond": return dr(r, e, t, a); case "era": case "year": case "month": case "day": { let n = ha(at(r), e, t, a), o = Pe(n, r.timeZone); return ke(Le(o, r.timeZone), r.calendar); } default: throw new Error("Unsupported field " + e); } } function Hn(r, e, t) { let a = at(r), n = Et(ma(a, e), e); if (n.compare(a) === 0) return r; let o = Pe(n, r.timeZone, t); return ke(Le(o, r.timeZone), r.calendar); } function Bn(r) { return `${String(r.hour).padStart(2, "0")}:${String(r.minute).padStart(2, "0")}:${String(r.second).padStart(2, "0")}${r.millisecond ? String(r.millisecond / 1e3).slice(1) : ""}`; } function mr(r) { let e = ke(r, new xe()), t; return e.era === "BC" ? t = e.year === 1 ? "0000" : "-" + String(Math.abs(1 - e.year)).padStart(6, "00") : t = String(e.year).padStart(4, "0"), `${t}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`; } function hr(r) { return `${mr(r)}T${Bn(r)}`; } function qn(r) { let e = Math.sign(r) < 0 ? "-" : "+"; r = Math.abs(r); let t = Math.floor(r / 36e5), a = r % 36e5 / 6e4; return `${e}${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`; } function Un(r) { return `${hr(r)}${qn(r.offset)}[${r.timeZone}]`; } function Nn(r, e) { if (e.has(r)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } function va(r, e, t) { Nn(r, e), e.set(r, t); } function pa(r) { let e = typeof r[0] == "object" ? r.shift() : new xe(), t; if (typeof r[0] == "string") t = r.shift(); else { let l = e.getEras(); t = l[l.length - 1]; } let a = r.shift(), n = r.shift(), o = r.shift(); return [ e, t, a, n, o ]; } var zn = /* @__PURE__ */ new WeakMap(); class le { /** Returns a copy of this date. */ copy() { return this.era ? new le(this.calendar, this.era, this.year, this.month, this.day) : new le(this.calendar, this.year, this.month, this.day); } /** Returns a new `CalendarDate` with the given duration added to it. */ add(e) { return Ut(this, e); } /** Returns a new `CalendarDate` with the given duration subtracted from it. */ subtract(e) { return cr(this, e); } /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(e) { return ma(this, e); } /** * Returns a new `CalendarDate` with the given field adjusted by a specified amount. * When the resulting value reaches the limits of the field, it wraps around. */ cycle(e, t, a) { return ha(this, e, t, a); } /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */ toDate(e) { return sr(this, e); } /** Converts the date to an ISO 8601 formatted string. */ toString() { return mr(this); } /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(e) { return nr(this, e); } constructor(...e) { va(this, zn, { writable: !0, value: void 0 }); let [t, a, n, o, l] = pa(e); this.calendar = t, this.era = a, this.year = n, this.month = o, this.day = l, je(this); } } var Wn = /* @__PURE__ */ new WeakMap(); class rt { /** Returns a copy of this date. */ copy() { return this.era ? new rt(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new rt(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); } /** Returns a new `CalendarDateTime` with the given duration added to it. */ add(e) { return Ut(this, e); } /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */ subtract(e) { return cr(this, e); } /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(e) { return ma(Et(this, e), e); } /** * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount. * When the resulting value reaches the limits of the field, it wraps around. */ cycle(e, t, a) { switch (e) { case "era": case "year": case "month": case "day": return ha(this, e, t, a); default: return dr(this, e, t, a); } } /** Converts the date to a native JavaScript Date object in the given time zone. */ toDate(e, t) { return sr(this, e, t); } /** Converts the date to an ISO 8601 formatted string. */ toString() { return hr(this); } /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(e) { let t = nr(this, e); return t === 0 ? Mn(this, at(e)) : t; } constructor(...e) { va(this, Wn, { writable: !0, value: void 0 }); let [t, a, n, o, l] = pa(e); this.calendar = t, this.era = a, this.year = n, this.month = o, this.day = l, this.hour = e.shift() || 0, this.minute = e.shift() || 0, this.second = e.shift() || 0, this.millisecond = e.shift() || 0, je(this); } } var jn = /* @__PURE__ */ new WeakMap(); class ht { /** Returns a copy of this date. */ copy() { return this.era ? new ht(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new ht(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond); } /** Returns a new `ZonedDateTime` with the given duration added to it. */ add(e) { return fr(this, e); } /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */ subtract(e) { return An(this, e); } /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(e, t) { return Hn(this, e, t); } /** * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount. * When the resulting value reaches the limits of the field, it wraps around. */ cycle(e, t, a) { return Ln(this, e, t, a); } /** Converts the date to a native JavaScript Date object. */ toDate() { return En(this); } /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */ toString() { return Un(this); } /** Converts the date to an ISO 8601 formatted string in UTC. */ toAbsoluteString() { return this.toDate().toISOString(); } /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */ compare(e) { return this.toDate().getTime() - Rn(e, this.timeZone).toDate().getTime(); } constructor(...e) { va(this, jn, { writable: !0, value: void 0 }); let [t, a, n, o, l] = pa(e), s = e.shift(), u = e.shift(); this.calendar = t, this.era = a, this.year = n, this.month = o, this.day = l, this.timeZone = s, this.offset = u, this.hour = e.shift() || 0, this.minute = e.shift() || 0, this.second = e.shift() || 0, this.millisecond = e.shift() || 0, je(this); } } const Qe = [ [ 1868, 9, 8 ], [ 1912, 7, 30 ], [ 1926, 12, 25 ], [ 1989, 1, 8 ], [ 2019, 5, 1 ] ], _n = [ [ 1912, 7, 29 ], [ 1926, 12, 24 ], [ 1989, 1, 7 ], [ 2019, 4, 30 ] ], Ct = [ 1867, 1911, 1925, 1988, 2018 ], Be = [ "meiji", "taisho", "showa", "heisei", "reiwa" ]; function Va(r) { const e = Qe.findIndex(([t, a, n]) => r.year < t || r.year === t && r.month < a || r.year === t && r.month === a && r.day < n); return e === -1 ? Qe.length - 1 : e === 0 ? 0 : e - 1; } function jt(r) { let e = Ct[Be.indexOf(r.era)]; if (!e) throw new Error("Unknown era: " + r.era); return new le(r.year + e, r.month, r.day); } class Jn extends xe { fromJulianDay(e) { let t = super.fromJulianDay(e), a = Va(t); return new le(this, Be[a], t.year - Ct[a], t.month, t.day); } toJulianDay(e) { return super.toJulianDay(jt(e)); } balanceDate(e) { let t = jt(e), a = Va(t); Be[a] !== e.era && (e.era = Be[a], e.year = t.year - Ct[a]), this.constrainDate(e); } constrainDate(e) { let t = Be.indexOf(e.era), a = _n[t]; if (a != null) { let [n, o, l] = a, s = n - Ct[t]; e.year = Math.max(1, Math.min(s, e.year)), e.year === s && (e.month = Math.min(o, e.month), e.month === o && (e.day = Math.min(l, e.day))); } if (e.year === 1 && t >= 0) { let [, n, o] = Qe[t]; e.month = Math.max(n, e.month), e.month === n && (e.day = Math.max(o, e.day)); } } getEras() { return Be; } getYearsInEra(e) { let t = Be.indexOf(e.era), a = Qe[t], n = Qe[t + 1]; if (n == null) return 9999 - a[0] + 1; let o = n[0] - a[0]; return (e.month < n[1] || e.month === n[1] && e.day < n[2]) && o++, o; } getDaysInMonth(e) { return super.getDaysInMonth(jt(e)); } getMinimumMonthInYear(e) { let t = Fa(e); return t ? t[1] : 1; } getMinimumDayInMonth(e) { let t = Fa(e); return t && e.month === t[1] ? t[2] : 1; } constructor(...e) { super(...e), this.identifier = "japanese"; } } function Fa(r) { if (r.year === 1) { let e = Be.indexOf(r.era); return Qe[e]; } } const vr = -543; class Kn extends xe { fromJulianDay(e) { let t = super.fromJulianDay(e), a = pt(t.era, t.year); return new le(this, a - vr, t.month, t.day); } toJulianDay(e) { return super.toJulianDay(Pa(e)); } getEras() { return [ "BE" ]; } getDaysInMonth(e) { return super.getDaysInMonth(Pa(e)); } balanceDate() { } constructor(...e) { super(...e), this.identifier = "buddhist"; } } function Pa(r) { let [e, t] = qt(r.year + vr); return new le(e, t, r.month, r.day); } const It = 1911; function pr(r) { return r.era === "minguo" ? r.year + It : 1 - r.year + It; } function Aa(r) { let e = r - It; return e > 0 ? [ "minguo", e ] : [ "before_minguo", 1 - e ]; } class Qn extends xe { fromJulianDay(e) { let t = super.fromJulianDay(e), a = pt(t.era, t.year), [n, o] = Aa(a); return new le(this, n, o, t.month, t.day); } toJulianDay(e) { return super.toJulianDay(La(e)); } getEras() { return [ "before_minguo", "minguo" ]; } balanceDate(e) { let [t, a] = Aa(pr(e)); e.era = t, e.year = a; } isInverseEra(e) { return e.era === "before_minguo"; } getDaysInMonth(e) { return super.getDaysInMonth(La(e)); } getYearsInEra(e) { return e.era === "before_minguo" ? 9999 : 9999 - It; } constructor(...e) { super(...e), this.identifier = "roc"; } } function La(r) { let [e, t] = qt(pr(r)); return new le(e, t, r.month, r.day); } const Ha = 1948320, Ba = [ 0, 31, 62, 93, 124, 155, 186, 216, 246, 276, 306, 336 // Esfand ]; class Zn { fromJulianDay(e) { let t = e - Ha, a = 1 + Math.floor((33 * t + 3) / 12053), n = 365 * (a - 1) + Math.floor((8 * a + 21) / 33), o = t - n, l = o < 216 ? Math.floor(o / 31) : Math.floor((o - 6) / 30), s = o - Ba[l] + 1; return new le(this, a, l + 1, s); } toJulianDay(e) { let t = Ha - 1 + 365 * (e.year - 1) + Math.floor((8 * e.year + 21) / 33); return t += Ba[e.month - 1], t += e.day, t; } getMonthsInYear() { return 12; } getDaysInMonth(e) { return e.month <= 6 ? 31 : e.month <= 11 || Ke(25 * e.year + 11, 33) < 8 ? 30 : 29; } getEras() { return [ "AP" ]; } getYearsInEra() { return 9377; } constructor() { this.identifier = "persian"; } } const _t = 78, qa = 80; class Gn extends xe { fromJulianDay(e) { let t = super.fromJulianDay(e), a = t.year - _t, n = e - ze(t.era, t.year, 1, 1), o; n < qa ? (a--, o = qe(t.year - 1) ? 31 : 30, n += o + 155 + 90 + 10) : (o = qe(t.year) ? 31 : 30, n -= qa); let l, s; if (n < o) l = 1, s = n + 1; else { let u = n - o; u < 155 ? (l = Math.floor(u / 31) + 2, s = u % 31 + 1) : (u -= 155, l = Math.floor(u / 30) + 7, s = u % 30 + 1); } return new le(this, a, l, s); } toJulianDay(e) { let t = e.year + _t, [a, n] = qt(t), o, l; return qe(n) ? (o = 31, l = ze(a, n, 3, 21)) : (o = 30, l = ze(a, n, 3, 22)), e.month === 1 ? l + e.day - 1 : (l += o + Math.min(e.month - 2, 5) * 31, e.month >= 8 && (l += (e.month - 7) * 30), l += e.day - 1, l); } getDaysInMonth(e) { return e.month === 1 && qe(e.year + _t) || e.month >= 2 && e.month <= 6 ? 31 : 30; } getYearsInEra() { return 9919; } getEras() { return [ "saka" ]; } balanceDate() { } constructor(...e) { super(...e), this.identifier = "indian"; } } const Ot = 1948440, Ua = 1948439, Ye = 1300, _e = 1600, Xn = 460322; function Vt(r, e, t, a) { return a + Math.ceil(29.5 * (t - 1)) + (e - 1) * 354 + Math.floor((3 + 11 * e) / 30) + r - 1; } function gr(r, e, t) { let a = Math.floor((30 * (t - e) + 10646) / 10631), n = Math.min(12, Math.ceil((t - (29 + Vt(e, a, 1, 1))) / 29.5) + 1), o = t - Vt(e, a, n, 1) + 1; return new le(r, a, n, o); } function Na(r) { return (14 + 11 * r) % 30 < 11; } class ga { fromJulianDay(e) { return gr(this, Ot, e); } toJulianDay(e) { return Vt(Ot, e.year, e.month, e.day); } getDaysInMonth(e) { let t = 29 + e.month % 2; return e.month === 12 && Na(e.year) && t++, t; } getMonthsInYear() { return 12; } getDaysInYear(e) { return Na(e.year) ? 355 : 354; } getYearsInEra() { return 9665; } getEras() { return [ "AH" ]; } constructor() { this.identifier = "islamic-civil"; } } class eo extends ga { fromJulianDay(e) { return gr(this, Ua, e); } toJulianDay(e) { return Vt(Ua, e.year, e.month, e.day); } constructor(...e) { super(...e), this.identifier = "islamic-tbla"; } } const to = "qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbW