UNPKG

@boichikpro/vue3-date-time-picker

Version:
1,694 lines 283 kB
import { isRef as Ys, ref as V, watch as Z, onMounted as ze, onUnmounted as xn, readonly as Ns, defineComponent as K, toRef as an, h as Ps, onBeforeUnmount as Kt, withDirectives as tt, openBlock as C, createElementBlock as R, vModelText as Hs, createElementVNode as $, inject as ee, computed as M, normalizeClass as qe, createVNode as q, Fragment as pe, renderSlot as Fe, createCommentVNode as ie, createBlock as re, unref as me, withCtx as we, createTextVNode as Aa, toDisplayString as Me, resolveDynamicComponent as Vt, renderList as We, vShow as pt, mergeModels as Hr, useModel as gt, mergeProps as In, toHandlers as Rn, useId as $s, nextTick as Ws, Teleport as Us, normalizeStyle as $r, useSlots as Wr, provide as Ve } from "vue"; import { parse as Xn, isValid as Ea, getDaysInMonth as sa, startOfWeek as Xs, addDays as pn, startOfMonth as js, endOfMonth as zs, getDay as qs, subDays as Gs, eachDayOfInterval as Zs, isSameDay as Ut, set as Ks, addMonths as Mn, isSameMonth as jn, setYear as Ur, setMonth as Qs, isSameYear as zn, subYears as ia, subMonths as la, addYears as oa, isBefore as He, isAfter as ua, format as mn, getDefaultOptions as Js, parseISO as xa, isDate as Dt, isEqual as ei, setHours as kt, setMinutes as Ln, setSeconds as Ma } from "date-fns"; import { useI18n as ti } from "vue-i18n"; /* empty css */ const ni = { 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" } }, ai = (n, e, t) => { let a; const r = ni[n]; return typeof r == "string" ? a = r : e === 1 ? a = r.one : a = r.other.replace("{{count}}", e.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + a : a + " ago" : a; }; function Yn(n) { return (e = {}) => { const t = e.width ? String(e.width) : n.defaultWidth; return n.formats[t] || n.formats[n.defaultWidth]; }; } const ri = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, si = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, ii = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, li = { date: Yn({ formats: ri, defaultWidth: "full" }), time: Yn({ formats: si, defaultWidth: "full" }), dateTime: Yn({ formats: ii, defaultWidth: "full" }) }, oi = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, ui = (n, e, t, a) => oi[n]; function Ht(n) { return (e, t) => { const a = t != null && t.context ? String(t.context) : "standalone"; let r; if (a === "formatting" && n.formattingValues) { const i = n.defaultFormattingWidth || n.defaultWidth, l = t != null && t.width ? String(t.width) : i; r = n.formattingValues[l] || n.formattingValues[i]; } else { const i = n.defaultWidth, l = t != null && t.width ? String(t.width) : n.defaultWidth; r = n.values[l] || n.values[i]; } const s = n.argumentCallback ? n.argumentCallback(e) : e; return r[s]; }; } const ci = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, di = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, hi = { 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" ] }, fi = { 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" ] }, pi = { 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" } }, mi = { 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" } }, vi = (n, e) => { const t = Number(n), a = t % 100; if (a > 20 || a < 10) switch (a % 10) { case 1: return t + "st"; case 2: return t + "nd"; case 3: return t + "rd"; } return t + "th"; }, gi = { ordinalNumber: vi, era: Ht({ values: ci, defaultWidth: "wide" }), quarter: Ht({ values: di, defaultWidth: "wide", argumentCallback: (n) => n - 1 }), month: Ht({ values: hi, defaultWidth: "wide" }), day: Ht({ values: fi, defaultWidth: "wide" }), dayPeriod: Ht({ values: pi, defaultWidth: "wide", formattingValues: mi, defaultFormattingWidth: "wide" }) }; function $t(n) { return (e, t = {}) => { const a = t.width, r = a && n.matchPatterns[a] || n.matchPatterns[n.defaultMatchWidth], s = e.match(r); if (!s) return null; const i = s[0], l = a && n.parsePatterns[a] || n.parsePatterns[n.defaultParseWidth], o = Array.isArray(l) ? bi(l, (d) => d.test(i)) : ( // [TODO] -- I challenge you to fix the type yi(l, (d) => d.test(i)) ); let c; c = n.valueCallback ? n.valueCallback(o) : o, c = t.valueCallback ? ( // [TODO] -- I challenge you to fix the type t.valueCallback(c) ) : c; const u = e.slice(i.length); return { value: c, rest: u }; }; } function yi(n, e) { for (const t in n) if (Object.prototype.hasOwnProperty.call(n, t) && e(n[t])) return t; } function bi(n, e) { for (let t = 0; t < n.length; t++) if (e(n[t])) return t; } function _i(n) { return (e, t = {}) => { const a = e.match(n.matchPattern); if (!a) return null; const r = a[0], s = e.match(n.parsePattern); if (!s) return null; let i = n.valueCallback ? n.valueCallback(s[0]) : s[0]; i = t.valueCallback ? t.valueCallback(i) : i; const l = e.slice(r.length); return { value: i, rest: l }; }; } const ki = /^(\d+)(th|st|nd|rd)?/i, wi = /\d+/i, Ai = { 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 }, Ei = { any: [/^b/i, /^(a|c)/i] }, xi = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, Mi = { any: [/1/i, /2/i, /3/i, /4/i] }, Di = { 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 }, Ti = { 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 ] }, Si = { 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 }, Fi = { 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] }, Ci = { 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 }, Oi = { 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 } }, Vi = { ordinalNumber: _i({ matchPattern: ki, parsePattern: wi, valueCallback: (n) => parseInt(n, 10) }), era: $t({ matchPatterns: Ai, defaultMatchWidth: "wide", parsePatterns: Ei, defaultParseWidth: "any" }), quarter: $t({ matchPatterns: xi, defaultMatchWidth: "wide", parsePatterns: Mi, defaultParseWidth: "any", valueCallback: (n) => n + 1 }), month: $t({ matchPatterns: Di, defaultMatchWidth: "wide", parsePatterns: Ti, defaultParseWidth: "any" }), day: $t({ matchPatterns: Si, defaultMatchWidth: "wide", parsePatterns: Fi, defaultParseWidth: "any" }), dayPeriod: $t({ matchPatterns: Ci, defaultMatchWidth: "any", parsePatterns: Oi, defaultParseWidth: "any" }) }, Bi = { code: "en-US", formatDistance: ai, formatLong: li, formatRelative: ui, localize: gi, match: Vi, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; let Ii = {}; function Dn() { return Ii; } const Xr = 6048e5, Ri = 864e5, Da = Symbol.for("constructDateFrom"); function at(n, e) { return typeof n == "function" ? n(e) : n && typeof n == "object" && Da in n ? n[Da](e) : n instanceof Date ? new n.constructor(e) : new Date(e); } function Ce(n, e) { return at(e || n, n); } function Ta(n) { const e = Ce(n), t = new Date( Date.UTC( e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds() ) ); return t.setUTCFullYear(e.getFullYear()), +n - +t; } function Li(n, ...e) { const t = at.bind( null, e.find((a) => typeof a == "object") ); return e.map(t); } function Sa(n, e) { const t = Ce(n, e == null ? void 0 : e.in); return t.setHours(0, 0, 0, 0), t; } function Yi(n, e, t) { const [a, r] = Li( t == null ? void 0 : t.in, n, e ), s = Sa(a), i = Sa(r), l = +s - Ta(s), o = +i - Ta(i); return Math.round((l - o) / Ri); } function Ni(n, e) { const t = Ce(n, e == null ? void 0 : e.in); return t.setFullYear(t.getFullYear(), 0, 1), t.setHours(0, 0, 0, 0), t; } function Pi(n, e) { const t = Ce(n, e == null ? void 0 : e.in); return Yi(t, Ni(t)) + 1; } function zt(n, e) { var l, o, c, u; const t = Dn(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((o = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : o.weekStartsOn) ?? t.weekStartsOn ?? ((u = (c = t.locale) == null ? void 0 : c.options) == null ? void 0 : u.weekStartsOn) ?? 0, r = Ce(n, e == null ? void 0 : e.in), s = r.getDay(), i = (s < a ? 7 : 0) + s - a; return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r; } function vn(n, e) { return zt(n, { ...e, weekStartsOn: 1 }); } function jr(n, e) { const t = Ce(n, e == null ? void 0 : e.in), a = t.getFullYear(), r = at(t, 0); r.setFullYear(a + 1, 0, 4), r.setHours(0, 0, 0, 0); const s = vn(r), i = at(t, 0); i.setFullYear(a, 0, 4), i.setHours(0, 0, 0, 0); const l = vn(i); return t.getTime() >= s.getTime() ? a + 1 : t.getTime() >= l.getTime() ? a : a - 1; } function Hi(n, e) { const t = jr(n, e), a = at(n, 0); return a.setFullYear(t, 0, 4), a.setHours(0, 0, 0, 0), vn(a); } function $i(n, e) { const t = Ce(n, e == null ? void 0 : e.in), a = +vn(t) - +Hi(t); return Math.round(a / Xr) + 1; } function zr(n, e) { var u, d, f, h; const t = Ce(n, e == null ? void 0 : e.in), a = t.getFullYear(), r = Dn(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((d = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = at((e == null ? void 0 : e.in) || n, 0); i.setFullYear(a + 1, 0, s), i.setHours(0, 0, 0, 0); const l = zt(i, e), o = at((e == null ? void 0 : e.in) || n, 0); o.setFullYear(a, 0, s), o.setHours(0, 0, 0, 0); const c = zt(o, e); return +t >= +l ? a + 1 : +t >= +c ? a : a - 1; } function Wi(n, e) { var l, o, c, u; const t = Dn(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((o = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : o.firstWeekContainsDate) ?? t.firstWeekContainsDate ?? ((u = (c = t.locale) == null ? void 0 : c.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1, r = zr(n, e), s = at((e == null ? void 0 : e.in) || n, 0); return s.setFullYear(r, 0, a), s.setHours(0, 0, 0, 0), zt(s, e); } function Ui(n, e) { const t = Ce(n, e == null ? void 0 : e.in), a = +zt(t, e) - +Wi(t, e); return Math.round(a / Xr) + 1; } function G(n, e) { const t = n < 0 ? "-" : "", a = Math.abs(n).toString().padStart(e, "0"); return t + a; } const Je = { // Year y(n, e) { const t = n.getFullYear(), a = t > 0 ? t : 1 - t; return G(e === "yy" ? a % 100 : a, e.length); }, // Month M(n, e) { const t = n.getMonth(); return e === "M" ? String(t + 1) : G(t + 1, 2); }, // Day of the month d(n, e) { return G(n.getDate(), e.length); }, // AM or PM a(n, e) { const t = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (e) { 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, e) { return G(n.getHours() % 12 || 12, e.length); }, // Hour [0-23] H(n, e) { return G(n.getHours(), e.length); }, // Minute m(n, e) { return G(n.getMinutes(), e.length); }, // Second s(n, e) { return G(n.getSeconds(), e.length); }, // Fraction of second S(n, e) { const t = e.length, a = n.getMilliseconds(), r = Math.trunc( a * Math.pow(10, t - 3) ); return G(r, e.length); } }, wt = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, Fa = { // Era G: function(n, e, t) { const a = n.getFullYear() > 0 ? 1 : 0; switch (e) { case "G": case "GG": case "GGG": return t.era(a, { width: "abbreviated" }); case "GGGGG": return t.era(a, { width: "narrow" }); case "GGGG": default: return t.era(a, { width: "wide" }); } }, // Year y: function(n, e, t) { if (e === "yo") { const a = n.getFullYear(), r = a > 0 ? a : 1 - a; return t.ordinalNumber(r, { unit: "year" }); } return Je.y(n, e); }, // Local week-numbering year Y: function(n, e, t, a) { const r = zr(n, a), s = r > 0 ? r : 1 - r; if (e === "YY") { const i = s % 100; return G(i, 2); } return e === "Yo" ? t.ordinalNumber(s, { unit: "year" }) : G(s, e.length); }, // ISO week-numbering year R: function(n, e) { const t = jr(n); return G(t, e.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, e) { const t = n.getFullYear(); return G(t, e.length); }, // Quarter Q: function(n, e, t) { const a = Math.ceil((n.getMonth() + 1) / 3); switch (e) { case "Q": return String(a); case "QQ": return G(a, 2); case "Qo": return t.ordinalNumber(a, { unit: "quarter" }); case "QQQ": return t.quarter(a, { width: "abbreviated", context: "formatting" }); case "QQQQQ": return t.quarter(a, { width: "narrow", context: "formatting" }); case "QQQQ": default: return t.quarter(a, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(n, e, t) { const a = Math.ceil((n.getMonth() + 1) / 3); switch (e) { case "q": return String(a); case "qq": return G(a, 2); case "qo": return t.ordinalNumber(a, { unit: "quarter" }); case "qqq": return t.quarter(a, { width: "abbreviated", context: "standalone" }); case "qqqqq": return t.quarter(a, { width: "narrow", context: "standalone" }); case "qqqq": default: return t.quarter(a, { width: "wide", context: "standalone" }); } }, // Month M: function(n, e, t) { const a = n.getMonth(); switch (e) { case "M": case "MM": return Je.M(n, e); case "Mo": return t.ordinalNumber(a + 1, { unit: "month" }); case "MMM": return t.month(a, { width: "abbreviated", context: "formatting" }); case "MMMMM": return t.month(a, { width: "narrow", context: "formatting" }); case "MMMM": default: return t.month(a, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(n, e, t) { const a = n.getMonth(); switch (e) { case "L": return String(a + 1); case "LL": return G(a + 1, 2); case "Lo": return t.ordinalNumber(a + 1, { unit: "month" }); case "LLL": return t.month(a, { width: "abbreviated", context: "standalone" }); case "LLLLL": return t.month(a, { width: "narrow", context: "standalone" }); case "LLLL": default: return t.month(a, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(n, e, t, a) { const r = Ui(n, a); return e === "wo" ? t.ordinalNumber(r, { unit: "week" }) : G(r, e.length); }, // ISO week of year I: function(n, e, t) { const a = $i(n); return e === "Io" ? t.ordinalNumber(a, { unit: "week" }) : G(a, e.length); }, // Day of the month d: function(n, e, t) { return e === "do" ? t.ordinalNumber(n.getDate(), { unit: "date" }) : Je.d(n, e); }, // Day of year D: function(n, e, t) { const a = Pi(n); return e === "Do" ? t.ordinalNumber(a, { unit: "dayOfYear" }) : G(a, e.length); }, // Day of week E: function(n, e, t) { const a = n.getDay(); switch (e) { case "E": case "EE": case "EEE": return t.day(a, { width: "abbreviated", context: "formatting" }); case "EEEEE": return t.day(a, { width: "narrow", context: "formatting" }); case "EEEEEE": return t.day(a, { width: "short", context: "formatting" }); case "EEEE": default: return t.day(a, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(n, e, t, a) { const r = n.getDay(), s = (r - a.weekStartsOn + 8) % 7 || 7; switch (e) { case "e": return String(s); case "ee": return G(s, 2); case "eo": return t.ordinalNumber(s, { unit: "day" }); case "eee": return t.day(r, { width: "abbreviated", context: "formatting" }); case "eeeee": return t.day(r, { width: "narrow", context: "formatting" }); case "eeeeee": return t.day(r, { width: "short", context: "formatting" }); case "eeee": default: return t.day(r, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(n, e, t, a) { const r = n.getDay(), s = (r - a.weekStartsOn + 8) % 7 || 7; switch (e) { case "c": return String(s); case "cc": return G(s, e.length); case "co": return t.ordinalNumber(s, { unit: "day" }); case "ccc": return t.day(r, { width: "abbreviated", context: "standalone" }); case "ccccc": return t.day(r, { width: "narrow", context: "standalone" }); case "cccccc": return t.day(r, { width: "short", context: "standalone" }); case "cccc": default: return t.day(r, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(n, e, t) { const a = n.getDay(), r = a === 0 ? 7 : a; switch (e) { case "i": return String(r); case "ii": return G(r, e.length); case "io": return t.ordinalNumber(r, { unit: "day" }); case "iii": return t.day(a, { width: "abbreviated", context: "formatting" }); case "iiiii": return t.day(a, { width: "narrow", context: "formatting" }); case "iiiiii": return t.day(a, { width: "short", context: "formatting" }); case "iiii": default: return t.day(a, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(n, e, t) { const r = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (e) { 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, e, t) { const a = n.getHours(); let r; switch (a === 12 ? r = wt.noon : a === 0 ? r = wt.midnight : r = a / 12 >= 1 ? "pm" : "am", e) { 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, e, t) { const a = n.getHours(); let r; switch (a >= 17 ? r = wt.evening : a >= 12 ? r = wt.afternoon : a >= 4 ? r = wt.morning : r = wt.night, e) { 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, e, t) { if (e === "ho") { let a = n.getHours() % 12; return a === 0 && (a = 12), t.ordinalNumber(a, { unit: "hour" }); } return Je.h(n, e); }, // Hour [0-23] H: function(n, e, t) { return e === "Ho" ? t.ordinalNumber(n.getHours(), { unit: "hour" }) : Je.H(n, e); }, // Hour [0-11] K: function(n, e, t) { const a = n.getHours() % 12; return e === "Ko" ? t.ordinalNumber(a, { unit: "hour" }) : G(a, e.length); }, // Hour [1-24] k: function(n, e, t) { let a = n.getHours(); return a === 0 && (a = 24), e === "ko" ? t.ordinalNumber(a, { unit: "hour" }) : G(a, e.length); }, // Minute m: function(n, e, t) { return e === "mo" ? t.ordinalNumber(n.getMinutes(), { unit: "minute" }) : Je.m(n, e); }, // Second s: function(n, e, t) { return e === "so" ? t.ordinalNumber(n.getSeconds(), { unit: "second" }) : Je.s(n, e); }, // Fraction of second S: function(n, e) { return Je.S(n, e); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(n, e, t) { const a = n.getTimezoneOffset(); if (a === 0) return "Z"; switch (e) { case "X": return Oa(a); case "XXXX": case "XX": return ct(a); case "XXXXX": case "XXX": default: return ct(a, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(n, e, t) { const a = n.getTimezoneOffset(); switch (e) { case "x": return Oa(a); case "xxxx": case "xx": return ct(a); case "xxxxx": case "xxx": default: return ct(a, ":"); } }, // Timezone (GMT) O: function(n, e, t) { const a = n.getTimezoneOffset(); switch (e) { case "O": case "OO": case "OOO": return "GMT" + Ca(a, ":"); case "OOOO": default: return "GMT" + ct(a, ":"); } }, // Timezone (specific non-location) z: function(n, e, t) { const a = n.getTimezoneOffset(); switch (e) { case "z": case "zz": case "zzz": return "GMT" + Ca(a, ":"); case "zzzz": default: return "GMT" + ct(a, ":"); } }, // Seconds timestamp t: function(n, e, t) { const a = Math.trunc(+n / 1e3); return G(a, e.length); }, // Milliseconds timestamp T: function(n, e, t) { return G(+n, e.length); } }; function Ca(n, e = "") { const t = n > 0 ? "-" : "+", a = Math.abs(n), r = Math.trunc(a / 60), s = a % 60; return s === 0 ? t + String(r) : t + String(r) + e + G(s, 2); } function Oa(n, e) { return n % 60 === 0 ? (n > 0 ? "-" : "+") + G(Math.abs(n) / 60, 2) : ct(n, e); } function ct(n, e = "") { const t = n > 0 ? "-" : "+", a = Math.abs(n), r = G(Math.trunc(a / 60), 2), s = G(a % 60, 2); return t + r + e + s; } const Va = (n, e) => { switch (n) { case "P": return e.date({ width: "short" }); case "PP": return e.date({ width: "medium" }); case "PPP": return e.date({ width: "long" }); case "PPPP": default: return e.date({ width: "full" }); } }, qr = (n, e) => { switch (n) { case "p": return e.time({ width: "short" }); case "pp": return e.time({ width: "medium" }); case "ppp": return e.time({ width: "long" }); case "pppp": default: return e.time({ width: "full" }); } }, Xi = (n, e) => { const t = n.match(/(P+)(p+)?/) || [], a = t[1], r = t[2]; if (!r) return Va(n, e); let s; switch (a) { case "P": s = e.dateTime({ width: "short" }); break; case "PP": s = e.dateTime({ width: "medium" }); break; case "PPP": s = e.dateTime({ width: "long" }); break; case "PPPP": default: s = e.dateTime({ width: "full" }); break; } return s.replace("{{date}}", Va(a, e)).replace("{{time}}", qr(r, e)); }, ji = { p: qr, P: Xi }, zi = /^D+$/, qi = /^Y+$/, Gi = ["D", "DD", "YY", "YYYY"]; function Zi(n) { return zi.test(n); } function Ki(n) { return qi.test(n); } function Qi(n, e, t) { const a = Ji(n, e, t); if (console.warn(a), Gi.includes(n)) throw new RangeError(a); } function Ji(n, e, t) { const a = n[0] === "Y" ? "years" : "days of the month"; return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${a} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } function el(n) { return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]"; } function tl(n) { return !(!el(n) && typeof n != "number" || isNaN(+Ce(n))); } const nl = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, al = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, rl = /^'([^]*?)'?$/, sl = /''/g, il = /[a-zA-Z]/; function Gr(n, e, t) { var u, d, f, h, m, k, b, S; const a = Dn(), r = (t == null ? void 0 : t.locale) ?? a.locale ?? Bi, s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : d.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (f = a.locale) == null ? void 0 : f.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = (t == null ? void 0 : t.weekStartsOn) ?? ((k = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : k.weekStartsOn) ?? a.weekStartsOn ?? ((S = (b = a.locale) == null ? void 0 : b.options) == null ? void 0 : S.weekStartsOn) ?? 0, l = Ce(n, t == null ? void 0 : t.in); if (!tl(l)) throw new RangeError("Invalid time value"); let o = e.match(al).map((g) => { const y = g[0]; if (y === "p" || y === "P") { const E = ji[y]; return E(g, r.formatLong); } return g; }).join("").match(nl).map((g) => { if (g === "''") return { isToken: !1, value: "'" }; const y = g[0]; if (y === "'") return { isToken: !1, value: ll(g) }; if (Fa[y]) return { isToken: !0, value: g }; if (y.match(il)) throw new RangeError( "Format string contains an unescaped latin alphabet character `" + y + "`" ); return { isToken: !1, value: g }; }); r.localize.preprocessor && (o = r.localize.preprocessor(l, o)); const c = { firstWeekContainsDate: s, weekStartsOn: i, locale: r }; return o.map((g) => { if (!g.isToken) return g.value; const y = g.value; (!(t != null && t.useAdditionalWeekYearTokens) && Ki(y) || !(t != null && t.useAdditionalDayOfYearTokens) && Zi(y)) && Qi(y, e, String(n)); const E = Fa[y[0]]; return E(l, y, r.localize, c); }).join(""); } function ll(n) { const e = n.match(rl); return e ? e[1].replace(sl, "'") : n; } const ne = (n) => !!n && n instanceof Date && !Number.isNaN(new Date(n).valueOf()); function nt(n) { return typeof n == "string" || n instanceof String; } function Ba(n) { var e; return typeof n == "object" && n != null && (n == null || (e = n.constructor) == null ? void 0 : e.name) === "Object"; } function Zr(n, e) { return Array.isArray(e) ? Zr(n, (t, a) => e.includes(a)) : Object.entries(n).reduce((t, a) => { let [r, s] = a; return e(s, r) && (t[r] = s), t; }, {}); } const H = { NONE: "NONE", LEFT: "LEFT", FORCE_LEFT: "FORCE_LEFT", RIGHT: "RIGHT", FORCE_RIGHT: "FORCE_RIGHT" }; function ol(n) { switch (n) { case H.LEFT: return H.FORCE_LEFT; case H.RIGHT: return H.FORCE_RIGHT; default: return n; } } function Nn(n) { return n.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1"); } function gn(n, e) { if (e === n) return !0; const t = Array.isArray(e), a = Array.isArray(n); let r; if (t && a) { if (e.length != n.length) return !1; for (r = 0; r < e.length; r++) if (!gn(e[r], n[r])) return !1; return !0; } if (t != a) return !1; if (e && n && typeof e == "object" && typeof n == "object") { const s = e instanceof Date, i = n instanceof Date; if (s && i) return e.getTime() == n.getTime(); if (s != i) return !1; const l = e instanceof RegExp, o = n instanceof RegExp; if (l && o) return e.toString() == n.toString(); if (l != o) return !1; const c = Object.keys(e); for (r = 0; r < c.length; r++) if (!Object.prototype.hasOwnProperty.call(n, c[r])) return !1; for (r = 0; r < c.length; r++) if (!gn(n[c[r]], e[c[r]])) return !1; return !0; } else if (e && n && typeof e == "function" && typeof n == "function") return e.toString() === n.toString(); return !1; } class ul { /** Current input value */ /** Current cursor position */ /** Old input value */ /** Old selection */ constructor(e) { for (Object.assign(this, e); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); ) --this.oldSelection.start; if (this.insertedCount) for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); ) this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos; } /** Start changing position */ get startChangePos() { return Math.min(this.cursorPos, this.oldSelection.start); } /** Inserted symbols count */ get insertedCount() { return this.cursorPos - this.startChangePos; } /** Inserted symbols */ get inserted() { return this.value.substr(this.startChangePos, this.insertedCount); } /** Removed symbols count */ get removedCount() { return Math.max(this.oldSelection.end - this.startChangePos || // for Delete this.oldValue.length - this.value.length, 0); } /** Removed symbols */ get removed() { return this.oldValue.substr(this.startChangePos, this.removedCount); } /** Unchanged head symbols */ get head() { return this.value.substring(0, this.startChangePos); } /** Unchanged tail symbols */ get tail() { return this.value.substring(this.startChangePos + this.insertedCount); } /** Remove direction */ get removeDirection() { return !this.removedCount || this.insertedCount ? H.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace) this.oldSelection.end === this.oldSelection.start ? H.RIGHT : H.LEFT; } } function B(n, e) { return new B.InputMask(n, e); } function Kr(n) { if (n == null) throw new Error("mask property should be defined"); return n instanceof RegExp ? B.MaskedRegExp : nt(n) ? B.MaskedPattern : n === Date ? B.MaskedDate : n === Number ? B.MaskedNumber : Array.isArray(n) || n === Array ? B.MaskedDynamic : B.Masked && n.prototype instanceof B.Masked ? n : B.Masked && n instanceof B.Masked ? n.constructor : n instanceof Function ? B.MaskedFunction : (console.warn("Mask not found for mask", n), B.Masked); } function qt(n) { if (!n) throw new Error("Options in not defined"); if (B.Masked) { if (n.prototype instanceof B.Masked) return { mask: n }; const { mask: e = void 0, ...t } = n instanceof B.Masked ? { mask: n } : Ba(n) && n.mask instanceof B.Masked ? n : {}; if (e) { const a = e.mask; return { ...Zr(e, (r, s) => !s.startsWith("_")), mask: e.constructor, _mask: a, ...t }; } } return Ba(n) ? { ...n } : { mask: n }; } function Ue(n) { if (B.Masked && n instanceof B.Masked) return n; const e = qt(n), t = Kr(e.mask); if (!t) throw new Error("Masked class is not found for provided mask " + e.mask + ", appropriate module needs to be imported manually before creating mask."); return e.mask === t && delete e.mask, e._mask && (e.mask = e._mask, delete e._mask), new t(e); } B.createMask = Ue; class ca { /** */ /** */ /** */ /** Safely returns selection start */ get selectionStart() { let e; try { e = this._unsafeSelectionStart; } catch { } return e ?? this.value.length; } /** Safely returns selection end */ get selectionEnd() { let e; try { e = this._unsafeSelectionEnd; } catch { } return e ?? this.value.length; } /** Safely sets element selection */ select(e, t) { if (!(e == null || t == null || e === this.selectionStart && t === this.selectionEnd)) try { this._unsafeSelect(e, t); } catch { } } /** */ get isActive() { return !1; } /** */ /** */ /** */ } B.MaskElement = ca; const Ia = 90, cl = 89; class Tn extends ca { /** HTMLElement to use mask on */ constructor(e) { super(), this.input = e, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this); } get rootElement() { var e, t, a; return (e = (t = (a = this.input).getRootNode) == null ? void 0 : t.call(a)) != null ? e : document; } /** Is element in focus */ get isActive() { return this.input === this.rootElement.activeElement; } /** Binds HTMLElement events to mask internal events */ bindEvents(e) { this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", e.drop), this.input.addEventListener("click", e.click), this.input.addEventListener("focus", e.focus), this.input.addEventListener("blur", e.commit), this._handlers = e; } _onKeydown(e) { if (this._handlers.redo && (e.keyCode === Ia && e.shiftKey && (e.metaKey || e.ctrlKey) || e.keyCode === cl && e.ctrlKey)) return e.preventDefault(), this._handlers.redo(e); if (this._handlers.undo && e.keyCode === Ia && (e.metaKey || e.ctrlKey)) return e.preventDefault(), this._handlers.undo(e); e.isComposing || this._handlers.selectionChange(e); } _onBeforeinput(e) { if (e.inputType === "historyUndo" && this._handlers.undo) return e.preventDefault(), this._handlers.undo(e); if (e.inputType === "historyRedo" && this._handlers.redo) return e.preventDefault(), this._handlers.redo(e); } _onCompositionEnd(e) { this._handlers.input(e); } _onInput(e) { e.isComposing || this._handlers.input(e); } /** Unbinds HTMLElement events to mask internal events */ unbindEvents() { this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {}; } } B.HTMLMaskElement = Tn; class dl extends Tn { /** InputElement to use mask on */ constructor(e) { super(e), this.input = e; } /** Returns InputElement selection start */ get _unsafeSelectionStart() { return this.input.selectionStart != null ? this.input.selectionStart : this.value.length; } /** Returns InputElement selection end */ get _unsafeSelectionEnd() { return this.input.selectionEnd; } /** Sets InputElement selection */ _unsafeSelect(e, t) { this.input.setSelectionRange(e, t); } get value() { return this.input.value; } set value(e) { this.input.value = e; } } B.HTMLMaskElement = Tn; class Qr extends Tn { /** Returns HTMLElement selection start */ get _unsafeSelectionStart() { const e = this.rootElement, t = e.getSelection && e.getSelection(), a = t && t.anchorOffset, r = t && t.focusOffset; return r == null || a == null || a < r ? a : r; } /** Returns HTMLElement selection end */ get _unsafeSelectionEnd() { const e = this.rootElement, t = e.getSelection && e.getSelection(), a = t && t.anchorOffset, r = t && t.focusOffset; return r == null || a == null || a > r ? a : r; } /** Sets HTMLElement selection */ _unsafeSelect(e, t) { if (!this.rootElement.createRange) return; const a = this.rootElement.createRange(); a.setStart(this.input.firstChild || this.input, e), a.setEnd(this.input.lastChild || this.input, t); const r = this.rootElement, s = r.getSelection && r.getSelection(); s && (s.removeAllRanges(), s.addRange(a)); } /** HTMLElement value */ get value() { return this.input.textContent || ""; } set value(e) { this.input.textContent = e; } } B.HTMLContenteditableMaskElement = Qr; class Sn { constructor() { this.states = [], this.currentIndex = 0; } get currentState() { return this.states[this.currentIndex]; } get isEmpty() { return this.states.length === 0; } push(e) { this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(e), this.states.length > Sn.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1; } go(e) { return this.currentIndex = Math.min(Math.max(this.currentIndex + e, 0), this.states.length - 1), this.currentState; } undo() { return this.go(-1); } redo() { return this.go(1); } clear() { this.states.length = 0, this.currentIndex = 0; } } Sn.MAX_LENGTH = 100; class hl { /** View element */ /** Internal {@link Masked} model */ constructor(e, t) { this.el = e instanceof ca ? e : e.isContentEditable && e.tagName !== "INPUT" && e.tagName !== "TEXTAREA" ? new Qr(e) : new dl(e), this.masked = Ue(t), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new Sn(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange(); } maskEquals(e) { var t; return e == null || ((t = this.masked) == null ? void 0 : t.maskEquals(e)); } /** Masked */ get mask() { return this.masked.mask; } set mask(e) { if (this.maskEquals(e)) return; if (!(e instanceof B.Masked) && this.masked.constructor === Kr(e)) { this.masked.updateOptions({ mask: e }); return; } const t = e instanceof B.Masked ? e : Ue({ mask: e }); t.unmaskedValue = this.masked.unmaskedValue, this.masked = t; } /** Raw value */ get value() { return this._value; } set value(e) { this.value !== e && (this.masked.value = e, this.updateControl("auto")); } /** Unmasked value */ get unmaskedValue() { return this._unmaskedValue; } set unmaskedValue(e) { this.unmaskedValue !== e && (this.masked.unmaskedValue = e, this.updateControl("auto")); } /** Raw input value */ get rawInputValue() { return this._rawInputValue; } set rawInputValue(e) { this.rawInputValue !== e && (this.masked.rawInputValue = e, this.updateControl(), this.alignCursor()); } /** Typed unmasked value */ get typedValue() { return this.masked.typedValue; } set typedValue(e) { this.masked.typedValueEquals(e) || (this.masked.typedValue = e, this.updateControl("auto")); } /** Display value */ get displayValue() { return this.masked.displayValue; } /** Starts listening to element events */ _bindEvents() { this.el.bindEvents({ selectionChange: this._saveSelection, input: this._onInput, drop: this._onDrop, click: this._onClick, focus: this._onFocus, commit: this._onChange, undo: this._onUndo, redo: this._onRedo }); } /** Stops listening to element events */ _unbindEvents() { this.el && this.el.unbindEvents(); } /** Fires custom event */ _fireEvent(e, t) { const a = this._listeners[e]; a && a.forEach((r) => r(t)); } /** Current selection start */ get selectionStart() { return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart; } /** Current cursor position */ get cursorPos() { return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd; } set cursorPos(e) { !this.el || !this.el.isActive || (this.el.select(e, e), this._saveSelection()); } /** Stores current selection */ _saveSelection() { this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = { start: this.selectionStart, end: this.cursorPos }; } /** Syncronizes model value from view */ updateValue() { this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue; } /** Syncronizes view from model value, fires change events */ updateControl(e) { const t = this.masked.unmaskedValue, a = this.masked.value, r = this.masked.rawInputValue, s = this.displayValue, i = this.unmaskedValue !== t || this.value !== a || this._rawInputValue !== r; this._unmaskedValue = t, this._value = a, this._rawInputValue = r, this.el.value !== s && (this.el.value = s), e === "auto" ? this.alignCursor() : e != null && (this.cursorPos = e), i && this._fireChangeEvents(), !this._historyChanging && (i || this.history.isEmpty) && this.history.push({ unmaskedValue: t, selection: { start: this.selectionStart, end: this.cursorPos } }); } /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */ updateOptions(e) { const { mask: t, ...a } = e, r = !this.maskEquals(t), s = this.masked.optionsIsChanged(a); r && (this.mask = t), s && this.masked.updateOptions(a), (r || s) && this.updateControl(); } /** Updates cursor */ updateCursor(e) { e != null && (this.cursorPos = e, this._delayUpdateCursor(e)); } /** Delays cursor update to support mobile browsers */ _delayUpdateCursor(e) { this._abortUpdateCursor(), this._changingCursorPos = e, this._cursorChanging = setTimeout(() => { this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor()); }, 10); } /** Fires custom events */ _fireChangeEvents() { this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent); } /** Aborts delayed cursor update */ _abortUpdateCursor() { this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging); } /** Aligns cursor to nearest available position */ alignCursor() { this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, H.LEFT)); } /** Aligns cursor only if selection is empty */ alignCursorFriendly() { this.selectionStart === this.cursorPos && this.alignCursor(); } /** Adds listener on custom event */ on(e, t) { return this._listeners[e] || (this._listeners[e] = []), this._listeners[e].push(t), this; } /** Removes custom event listener */ off(e, t) { if (!this._listeners[e]) return this; if (!t) return delete this._listeners[e], this; const a = this._listeners[e].indexOf(t); return a >= 0 && this._listeners[e].splice(a, 1), this; } /** Handles view input event */ _onInput(e) { this._inputEvent = e, this._abortUpdateCursor(); const t = new ul({ // new state value: this.el.value, cursorPos: this.cursorPos, // old state oldValue: this.displayValue, oldSelection: this._selection }), a = this.masked.rawInputValue, r = this.masked.splice(t.startChangePos, t.removed.length, t.inserted, t.removeDirection, { input: !0, raw: !0 }).offset, s = a === this.masked.rawInputValue ? t.remov