@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,792 lines • 64.4 kB
JavaScript
var Le = Object.defineProperty;
var je = (e, n, t) => n in e ? Le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
var ce = (e, n, t) => je(e, typeof n != "symbol" ? n + "" : n, t);
import { ref as p, computed as w, watch as Q } from "vue";
import k from "bignumber.js";
import { isUndefined as ze } from "lodash-es";
import { useGuid as Ue } from "../common/index.esm.js";
function ke(e) {
const n = e.nativeElement ? e.nativeElement : e;
return n.classList !== void 0 && n.classList !== null ? n : null;
}
function pe(e, n) {
if (n === void 0)
return;
const t = ke(e);
t && t.classList.remove(n);
}
function be(e, n) {
if (n === void 0)
return;
const t = ke(e);
t && t.classList.add(n);
}
const le = [
{ size: "sm", width: 576 },
{ size: "md", width: 768 },
// { size: 'lg', width: 888 }, 输入控件有此处断点,但没有此处样式
{ size: "xl", width: 1200 },
{ size: "el", width: 1690 }
];
function Ce(e) {
e.resizeObserver && (e.resizeObserver.disconnect(), e.sharedObject = null);
}
function _e(e, n, t = 0) {
const r = [];
if (!n)
return;
const a = t || n.getBoundingClientRect().width, i = parseFloat(a);
for (let o = 0; o < le.length; o++)
le[o].width <= i && r.push(le[o].size);
if (e.className.join(",") !== r.join(",")) {
if (e.className.length - r.length > 0)
for (let s = r.length; s < e.className.length; s++)
pe(n, "f-area-response--" + e.className[s]);
else
for (let s = e.className.length; s < r.length; s++)
be(n, "f-area-response--" + r[s]);
e.className = [...r];
}
}
function Xe(e, n) {
e.enable && e.autoWidth ? e.resizeObserver || (e.resizeObserver = new ResizeObserver((t) => {
if (!t || t.length < 1 || !t[0].contentRect)
return;
const r = t[0].contentRect;
Math.abs(parseInt(r.width + "") - e.width) > e.threshold && (_e(e, n, r.width), e.width = parseInt(r.width + ""));
}), e.resizeObserver.observe(n)) : Ce(e);
}
function ye(e, n) {
if (e.enable)
be(n, "f-area-response"), _e(e, n);
else {
pe(n, "f-area-response");
for (let t = e.className.length; t > 0; t--)
be(n, "f-area-response--" + e.className[t]);
e.className = [];
}
Xe(e, n);
}
function ve(e, n) {
n.value && Object.prototype.hasOwnProperty.call(n.value, "enable") && (e.enable = n.value.enable), n.value && Object.prototype.hasOwnProperty.call(n.value, "autoWidth") && (e.autoWidth = n.value.autoWidth);
}
const fe = {
// 在绑定元素的父组件
// 及他自己的所有子节点都挂载完成后调用
mounted: (e, n, t) => {
t.sharedObject = {
className: [],
resizeObserver: null,
enable: !0,
autoWidth: !0,
threshold: 10,
width: 0
}, ve(t.sharedObject, n), ye(t.sharedObject, e);
},
// 在绑定元素的父组件
// 及他自己的所有子节点都更新后调用
updated: function(e, n, t, r) {
t.sharedObject = r.sharedObject, ve(t.sharedObject, n), ye(t.sharedObject, e);
},
// 绑定元素的父组件卸载前调用
beforeUnmount(e, n, t) {
Ce(t.sharedObject);
}
};
function Sn(e, n, t, r, a) {
const i = p(e.disabled), o = p(!1), s = p("text"), c = p(e.showBorder), d = p(e.textAlign), m = p(e.updateOn), b = p(!1), x = w(() => e.editable || !e.readonly), D = w(() => e.editable && !e.disabled && !e.readonly), y = w(() => !e.disabled && o.value), u = w(() => t.value === "" || t.value === null || t.value === void 0), l = w(() => (e.disabled || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), h = w(() => e.readonly || !e.editable), S = w(() => e.enableTitle ? t.value : ""), C = w(() => ({
"form-control": !0,
"f-utils-fill": !0,
"text-left": d.value === "left",
"text-center": d.value === "center",
"text-right": d.value === "right"
})), W = w(() => {
const f = {
"f-cmp-inputgroup": !0,
"input-group": !0,
"f-state-disabled": i.value,
"f-state-editable": D.value,
"f-state-readonly": h.value,
"f-state-focus": y.value,
"input-group--has-clear": b.value
};
return (e.customClass || "").split(" ").reduce((F, re) => (F[re] = !0, F), f), f;
}), B = w(() => c.value ? "" : "border-width : 0 ");
function z(f, v = !0) {
t.value = f, r.value !== f && (r.value = f), v && n.emit("change", f), n.emit("update:modelValue", f), n.emit("update:value", f);
}
Q(
() => e.modelValue,
(f, v) => {
f !== v && (t.value = f, r.value = f);
}
), Q(() => e.disabled, (f, v) => {
f !== v && (i.value = f);
});
function H(f) {
var v, F, re;
if (f.stopPropagation(), f.target !== ((v = a.value) == null ? void 0 : v.querySelector("span.input-group-clear")) && f.target !== ((F = a.value) == null ? void 0 : F.querySelector("textarea")) && f.target !== ((re = a.value) == null ? void 0 : re.querySelector("input")))
return o.value = !1, n.emit("blur", f), document.removeEventListener("click", H), !1;
}
function R(f) {
n.emit("click", f);
}
function _(f) {
console.log("获取焦点"), !e.disabled && (c.value && (o.value = !0), x.value && n.emit("focus", f), document.addEventListener("click", H));
}
function G(f) {
n.emit("input", f.target.value);
const v = f.target.value;
r.value = v, m.value === "change" && (n.emit("update:modelValue", v), n.emit("update:value", v), n.emit("change", v));
}
function V(f) {
n.emit("keydown", f);
}
function q(f) {
n.emit("keyup", f);
}
function P(f) {
f.target.tagName !== "INPUT" && f.preventDefault(), f.stopPropagation(), n.emit("mousedownEvent", f);
}
function E(f) {
n.emit("mouseupEvent", f);
}
function ne(f) {
if (m.value === "blur") {
const v = f.target.value;
f.stopPropagation(), z(v);
}
}
return {
changeTextBoxValue: z,
disabled: i,
displayText: r,
editable: D,
hasFocused: y,
inputGroupClass: W,
inputType: s,
isEmpty: u,
modelValue: t,
readonly: h,
// onBlur,
hasClearClass: b,
onClick: R,
onFocus: _,
onInput: G,
onKeydown: V,
onKeyup: q,
onMousedown: P,
onMouseup: E,
onTextBoxValueChange: ne,
placeholder: l,
textBoxClass: C,
textBoxTitle: S,
inputGroupStyle: B
};
}
function An(e, n, t, r) {
const a = p(e.disabled), i = p(!1), o = p("text"), s = p(e.showBorder), c = p(e.textAlign);
w(() => e.editable || !e.readonly);
const d = w(() => e.editable && !e.disabled && !e.readonly), m = w(() => !e.disabled && i.value), b = w(() => t.value === "" || t.value === null || t.value === void 0), x = w(() => e.placeholder), D = w(() => e.readonly || !e.editable), y = w(() => e.enableTitle ? t.value : ""), u = w(() => ({
"form-control": !0,
// 'f-utils-fill': true,
"text-left": c.value === "left",
"text-center": c.value === "center",
"text-right": c.value === "right"
})), l = w(() => ({
"f-cmp-inputgroup": !0,
"input-group": !0,
"f-state-disabled": !0,
"f-state-editable": !1,
"f-state-readonly": !0
// 'f-state-focus': hasFocused.value
})), h = w(() => s.value ? "" : "border-width : 0 ");
function S(C, W = !0) {
}
return {
changeTextBoxValue: S,
disabled: a,
displayText: r,
editable: d,
hasFocused: m,
inputGroupClass: l,
inputType: o,
isEmpty: b,
modelValue: t,
readonly: D,
// onBlur,
// onClick,
// onFocus,
// onInput,
// onKeydown,
// onKeyup,
// onMousedown,
// onTextBoxValueChange,
placeholder: x,
textBoxClass: u,
textBoxTitle: y,
inputGroupStyle: h
};
}
function Yn(e, n, t) {
const r = p(!1), a = w(() => e.enableClear && !e.readonly && !e.disabled), { changeTextBoxValue: i, displayText: o, hasFocused: s, modelValue: c, isEmpty: d, hasClearClass: m } = t;
function b(h) {
r.value = h, m && (m.value = r.value);
}
Q(o, () => {
s != null && s.value ? b(!!(o != null && o.value)) : b(!1);
}), Q(() => s == null ? void 0 : s.value, (h) => {
!h && b(!1);
});
const x = w(() => ({
"input-group-text": !0,
"input-group-clear": !0
})), D = w(() => ({
width: "24px",
display: r.value ? "flex" : "none"
}));
function y(h) {
h.stopPropagation(), a.value && (i("", !0), b(!r.value), n.emit("clear"));
}
function u(h) {
var B, z;
const S = ((B = h.target.querySelector("input")) == null ? void 0 : B.value) || "", C = ((z = h.target.querySelector("textarea")) == null ? void 0 : z.value) || "", W = S || C;
W !== c.value && (c.value = W), a.value && b(!!W);
}
function l(h) {
a.value && b(!1);
}
return { clearButtonClass: x, clearButtonStyle: D, hasShownClearButton: r, onClearValue: y, onMouseEnter: u, onMouseLeave: l, shouldShowClearButton: a };
}
const Qe = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, Ge = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 };
class Se {
constructor() {
ce(this, "regexes", {
YEAR: "[1-9]\\d{3}",
MONTH: "1[0-2]|0?[1-9]",
MONTH2: "1[0-2]|0[1-9]",
MONTHNAME: "jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december",
DAYNAME: "mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday",
DAY: "3[01]|[12]\\d|0?[1-9]",
DAY2: "3[01]|[12]\\d|0[1-9]",
TIMEZONE: "[+-][01]\\d\\:?[0-5]\\d",
H24: "[01]\\d|2[0-3]",
MIN: "[0-5]\\d",
SEC: "[0-5]\\d",
MS: "\\d{3,}",
H12: "0?[1-9]|1[012]",
AMPM: "am|pm",
UNIT: "year|month|week|day|hour|minute|second|millisecond"
});
ce(this, "patterns", [
// 2010-03-15
["iso_8601", this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"), "$2/$3/$1"],
// 3-15-2010
["us", this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"), "$1/$3/$4"],
// 15.03.2010
["world", this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"), "$3/$1/$4"],
// 15-Mar-2010, 8 Dec 2011, "Thu, 8 Dec 2011"
["chicago", this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"), "$3 $1, $4"],
// "March 4, 2012", "Mar 4 2012", "Sun Mar 4 2012"
["conversational", this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"), "$1 $2, $3"],
// Tue Jun 22 17:47:27 +0000 2010
[
"month_day_time_year",
this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"),
(n) => {
const t = ("" + this.getMonthByName(n[1])).padStart(2, "0"), r = ("" + n[2]).padStart(2, "0"), a = n[5], i = n[3], o = n[4], s = a + "-" + t + "-" + r + "T" + i + o;
return isNaN(s) ? !1 : s;
}
],
// @123456789
[
"unix",
/^@(-?\d+)$/,
(n) => this.create(parseInt(n[1], 10) * 1e3)
],
// 24-hour time (This will help catch Date objects that are casted to a string)
[
"24_hour",
this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"),
(n) => {
let t;
const r = n[1];
if (r) {
if (t = this.create(r), isNaN(t))
return !1;
} else
t = /* @__PURE__ */ new Date(), t.setMilliseconds(0);
const a = n[2], i = n[3], o = n[4], s = n[5];
return t.setHours(parseFloat(a), parseFloat(i), parseFloat(o || 0)), s && t.setMilliseconds(+String(s).slice(0, 3)), t;
}
],
// 12-hour time
[
"12_hour",
this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"),
(n) => {
let t;
const r = n[1];
if (r) {
if (t = this.create(r), isNaN(t))
return !1;
} else
t = /* @__PURE__ */ new Date(), t.setMilliseconds(0);
let a = parseFloat(n[2]);
a = n[5].toLowerCase() === "am" ? a === 12 ? 0 : a : a === 12 ? 12 : a + 12;
const i = n[3], o = n[4];
return t.setHours(a, parseFloat(i || 0), parseFloat(o || 0)), t;
}
]
]);
}
makePattern(n) {
return n = n.replace(/_([A-Z][A-Z0-9]+)_/g, (t, r) => this.regexes[r]), new RegExp(n, "i");
}
getMonthByName(n) {
return Qe[String(n).slice(0, 3).toLowerCase()];
}
getWeekdayByName(n) {
return Ge[String(n).slice(0, 3).toLowerCase()];
}
parse(n) {
if (!isNaN(Number(n)))
return new Date(n);
if (n = String(n).replace(/^\s*(.*)\s*$/, "$1"), n = n.replace(/\s{2,}/g, " "), n === "")
return Date.now();
let t = 0;
for (; t < this.patterns.length; ) {
const r = this.patterns[t];
let a, i;
typeof r[0] == "string" ? (i = r[1], a = r[2]) : (i = r[0], a = r[1]);
const o = n.match(i);
if (!o) {
t++;
continue;
}
if (typeof a == "function") {
const s = a(o);
if (s instanceof Date)
return s;
} else {
const s = Date.parse(n.replace(i, a));
if (!isNaN(s))
return new Date(s);
}
t++;
}
return NaN;
}
create(n) {
return n == null ? Date.now() : n instanceof Date ? n : this.parse(n);
}
}
function Y(e) {
const n = Object.prototype.toString.call(e);
return e instanceof Date || typeof e == "object" && n === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || n === "[object Number]" || typeof e == "string" || n === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
}
function j(e, n) {
return e instanceof Date ? new e.constructor(n) : new Date(n);
}
const Ae = 6048e5, Ve = 864e5, Ye = 6e4, We = 36e5;
let Ze = {};
function se() {
return Ze;
}
function te(e, n) {
var s, c, d, m;
const t = se(), r = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? t.weekStartsOn ?? ((m = (d = t.locale) == null ? void 0 : d.options) == null ? void 0 : m.weekStartsOn) ?? 0, a = Y(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
}
function oe(e) {
return te(e, { weekStartsOn: 1 });
}
function Pe(e) {
const n = Y(e), t = n.getFullYear(), r = j(e, 0);
r.setFullYear(t + 1, 0, 4), r.setHours(0, 0, 0, 0);
const a = oe(r), i = j(e, 0);
i.setFullYear(t, 0, 4), i.setHours(0, 0, 0, 0);
const o = oe(i);
return n.getTime() >= a.getTime() ? t + 1 : n.getTime() >= o.getTime() ? t : t - 1;
}
function De(e) {
const n = Y(e);
return n.setHours(0, 0, 0, 0), n;
}
function Me(e) {
const n = Y(e), t = new Date(
Date.UTC(
n.getFullYear(),
n.getMonth(),
n.getDate(),
n.getHours(),
n.getMinutes(),
n.getSeconds(),
n.getMilliseconds()
)
);
return t.setUTCFullYear(n.getFullYear()), +e - +t;
}
function Je(e, n) {
const t = De(e), r = De(n), a = +t - Me(t), i = +r - Me(r);
return Math.round((a - i) / Ve);
}
function Ke(e) {
const n = Pe(e), t = j(e, 0);
return t.setFullYear(n, 0, 4), t.setHours(0, 0, 0, 0), oe(t);
}
function et(e) {
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
}
function Ee(e) {
if (!et(e) && typeof e != "number")
return !1;
const n = Y(e);
return !isNaN(Number(n));
}
function tt(e) {
const n = Y(e), t = j(e, 0);
return t.setFullYear(n.getFullYear(), 0, 1), t.setHours(0, 0, 0, 0), t;
}
const nt = {
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"
}
}, rt = (e, n, t) => {
let r;
const a = nt[e];
return typeof a == "string" ? r = a : n === 1 ? r = a.one : r = a.other.replace("{{count}}", n.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + r : r + " ago" : r;
};
function de(e) {
return (n = {}) => {
const t = n.width ? String(n.width) : e.defaultWidth;
return e.formats[t] || e.formats[e.defaultWidth];
};
}
const at = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}, it = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}, ot = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}, st = {
date: de({
formats: at,
defaultWidth: "full"
}),
time: de({
formats: it,
defaultWidth: "full"
}),
dateTime: de({
formats: ot,
defaultWidth: "full"
})
}, ut = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}, ct = (e, n, t, r) => ut[e];
function Z(e) {
return (n, t) => {
const r = t != null && t.context ? String(t.context) : "standalone";
let a;
if (r === "formatting" && e.formattingValues) {
const o = e.defaultFormattingWidth || e.defaultWidth, s = t != null && t.width ? String(t.width) : o;
a = e.formattingValues[s] || e.formattingValues[o];
} else {
const o = e.defaultWidth, s = t != null && t.width ? String(t.width) : e.defaultWidth;
a = e.values[s] || e.values[o];
}
const i = e.argumentCallback ? e.argumentCallback(n) : n;
return a[i];
};
}
const lt = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}, ft = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, dt = {
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"
]
}, mt = {
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"
]
}, ht = {
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"
}
}, gt = {
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"
}
}, wt = (e, n) => {
const t = Number(e), r = t % 100;
if (r > 20 || r < 10)
switch (r % 10) {
case 1:
return t + "st";
case 2:
return t + "nd";
case 3:
return t + "rd";
}
return t + "th";
}, bt = {
ordinalNumber: wt,
era: Z({
values: lt,
defaultWidth: "wide"
}),
quarter: Z({
values: ft,
defaultWidth: "wide",
argumentCallback: (e) => e - 1
}),
month: Z({
values: dt,
defaultWidth: "wide"
}),
day: Z({
values: mt,
defaultWidth: "wide"
}),
dayPeriod: Z({
values: ht,
defaultWidth: "wide",
formattingValues: gt,
defaultFormattingWidth: "wide"
})
};
function J(e) {
return (n, t = {}) => {
const r = t.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = n.match(a);
if (!i)
return null;
const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? vt(s, (b) => b.test(o)) : (
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
yt(s, (b) => b.test(o))
);
let d;
d = e.valueCallback ? e.valueCallback(c) : c, d = t.valueCallback ? (
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
t.valueCallback(d)
) : d;
const m = n.slice(o.length);
return { value: d, rest: m };
};
}
function yt(e, n) {
for (const t in e)
if (Object.prototype.hasOwnProperty.call(e, t) && n(e[t]))
return t;
}
function vt(e, n) {
for (let t = 0; t < e.length; t++)
if (n(e[t]))
return t;
}
function Dt(e) {
return (n, t = {}) => {
const r = n.match(e.matchPattern);
if (!r) return null;
const a = r[0], i = n.match(e.parsePattern);
if (!i) return null;
let o = e.valueCallback ? e.valueCallback(i[0]) : i[0];
o = t.valueCallback ? t.valueCallback(o) : o;
const s = n.slice(a.length);
return { value: o, rest: s };
};
}
const Mt = /^(\d+)(th|st|nd|rd)?/i, Nt = /\d+/i, Ot = {
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
}, Tt = {
any: [/^b/i, /^(a|c)/i]
}, xt = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}, kt = {
any: [/1/i, /2/i, /3/i, /4/i]
}, pt = {
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
}, Ct = {
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
]
}, _t = {
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
}, St = {
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]
}, At = {
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
}, Yt = {
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
}
}, Wt = {
ordinalNumber: Dt({
matchPattern: Mt,
parsePattern: Nt,
valueCallback: (e) => parseInt(e, 10)
}),
era: J({
matchPatterns: Ot,
defaultMatchWidth: "wide",
parsePatterns: Tt,
defaultParseWidth: "any"
}),
quarter: J({
matchPatterns: xt,
defaultMatchWidth: "wide",
parsePatterns: kt,
defaultParseWidth: "any",
valueCallback: (e) => e + 1
}),
month: J({
matchPatterns: pt,
defaultMatchWidth: "wide",
parsePatterns: Ct,
defaultParseWidth: "any"
}),
day: J({
matchPatterns: _t,
defaultMatchWidth: "wide",
parsePatterns: St,
defaultParseWidth: "any"
}),
dayPeriod: J({
matchPatterns: At,
defaultMatchWidth: "any",
parsePatterns: Yt,
defaultParseWidth: "any"
})
}, Pt = {
code: "en-US",
formatDistance: rt,
formatLong: st,
formatRelative: ct,
localize: bt,
match: Wt,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
function Et(e) {
const n = Y(e);
return Je(n, tt(n)) + 1;
}
function Bt(e) {
const n = Y(e), t = +oe(n) - +Ke(n);
return Math.round(t / Ae) + 1;
}
function Be(e, n) {
var m, b, x, D;
const t = Y(e), r = t.getFullYear(), a = se(), i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((b = (m = n == null ? void 0 : n.locale) == null ? void 0 : m.options) == null ? void 0 : b.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((D = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : D.firstWeekContainsDate) ?? 1, o = j(e, 0);
o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
const s = te(o, n), c = j(e, 0);
c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
const d = te(c, n);
return t.getTime() >= s.getTime() ? r + 1 : t.getTime() >= d.getTime() ? r : r - 1;
}
function Ht(e, n) {
var s, c, d, m;
const t = se(), r = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((c = (s = n == null ? void 0 : n.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? t.firstWeekContainsDate ?? ((m = (d = t.locale) == null ? void 0 : d.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = Be(e, n), i = j(e, 0);
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), te(i, n);
}
function Rt(e, n) {
const t = Y(e), r = +te(t, n) - +Ht(t, n);
return Math.round(r / Ae) + 1;
}
function g(e, n) {
const t = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(n, "0");
return t + r;
}
const I = {
// Year
y(e, n) {
const t = e.getFullYear(), r = t > 0 ? t : 1 - t;
return g(n === "yy" ? r % 100 : r, n.length);
},
// Month
M(e, n) {
const t = e.getMonth();
return n === "M" ? String(t + 1) : g(t + 1, 2);
},
// Day of the month
d(e, n) {
return g(e.getDate(), n.length);
},
// AM or PM
a(e, n) {
const t = e.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
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(e, n) {
return g(e.getHours() % 12 || 12, n.length);
},
// Hour [0-23]
H(e, n) {
return g(e.getHours(), n.length);
},
// Minute
m(e, n) {
return g(e.getMinutes(), n.length);
},
// Second
s(e, n) {
return g(e.getSeconds(), n.length);
},
// Fraction of second
S(e, n) {
const t = n.length, r = e.getMilliseconds(), a = Math.trunc(
r * Math.pow(10, t - 3)
);
return g(a, n.length);
}
}, U = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}, Ne = {
// Era
G: function(e, n, t) {
const r = e.getFullYear() > 0 ? 1 : 0;
switch (n) {
case "G":
case "GG":
case "GGG":
return t.era(r, { width: "abbreviated" });
case "GGGGG":
return t.era(r, { width: "narrow" });
case "GGGG":
default:
return t.era(r, { width: "wide" });
}
},
// Year
y: function(e, n, t) {
if (n === "yo") {
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
return t.ordinalNumber(a, { unit: "year" });
}
return I.y(e, n);
},
// Local week-numbering year
Y: function(e, n, t, r) {
const a = Be(e, r), i = a > 0 ? a : 1 - a;
if (n === "YY") {
const o = i % 100;
return g(o, 2);
}
return n === "Yo" ? t.ordinalNumber(i, { unit: "year" }) : g(i, n.length);
},
// ISO week-numbering year
R: function(e, n) {
const t = Pe(e);
return g(t, n.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function(e, n) {
const t = e.getFullYear();
return g(t, n.length);
},
// Quarter
Q: function(e, n, t) {
const r = Math.ceil((e.getMonth() + 1) / 3);
switch (n) {
case "Q":
return String(r);
case "QQ":
return g(r, 2);
case "Qo":
return t.ordinalNumber(r, { unit: "quarter" });
case "QQQ":
return t.quarter(r, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return t.quarter(r, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return t.quarter(r, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone quarter
q: function(e, n, t) {
const r = Math.ceil((e.getMonth() + 1) / 3);
switch (n) {
case "q":
return String(r);
case "qq":
return g(r, 2);
case "qo":
return t.ordinalNumber(r, { unit: "quarter" });
case "qqq":
return t.quarter(r, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return t.quarter(r, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return t.quarter(r, {
width: "wide",
context: "standalone"
});
}
},
// Month
M: function(e, n, t) {
const r = e.getMonth();
switch (n) {
case "M":
case "MM":
return I.M(e, n);
case "Mo":
return t.ordinalNumber(r + 1, { unit: "month" });
case "MMM":
return t.month(r, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return t.month(r, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return t.month(r, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function(e, n, t) {
const r = e.getMonth();
switch (n) {
case "L":
return String(r + 1);
case "LL":
return g(r + 1, 2);
case "Lo":
return t.ordinalNumber(r + 1, { unit: "month" });
case "LLL":
return t.month(r, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return t.month(r, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return t.month(r, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function(e, n, t, r) {
const a = Rt(e, r);
return n === "wo" ? t.ordinalNumber(a, { unit: "week" }) : g(a, n.length);
},
// ISO week of year
I: function(e, n, t) {
const r = Bt(e);
return n === "Io" ? t.ordinalNumber(r, { unit: "week" }) : g(r, n.length);
},
// Day of the month
d: function(e, n, t) {
return n === "do" ? t.ordinalNumber(e.getDate(), { unit: "date" }) : I.d(e, n);
},
// Day of year
D: function(e, n, t) {
const r = Et(e);
return n === "Do" ? t.ordinalNumber(r, { unit: "dayOfYear" }) : g(r, n.length);
},
// Day of week
E: function(e, n, t) {
const r = e.getDay();
switch (n) {
case "E":
case "EE":
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"
});
}
},
// Local day of week
e: function(e, n, t, r) {
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "e":
return String(i);
case "ee":
return g(i, 2);
case "eo":
return t.ordinalNumber(i, { unit: "day" });
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"
});
}
},
// Stand-alone local day of week
c: function(e, n, t, r) {
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "c":
return String(i);
case "cc":
return g(i, n.length);
case "co":
return t.ordinalNumber(i, { unit: "day" });
case "ccc":
return t.day(a, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return t.day(a, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return t.day(a, {
width: "short",
context: "standalone"
});
case "cccc":
default:
return t.day(a, {
width: "wide",
context: "standalone"
});
}
},
// ISO day of week
i: function(e, n, t) {
const r = e.getDay(), a = r === 0 ? 7 : r;
switch (n) {
case "i":
return String(a);
case "ii":
return g(a, n.length);
case "io":
return t.ordinalNumber(a, { unit: "day" });
case "iii":
return t.day(r, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return t.day(r, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return t.day(r, {
width: "short",
context: "formatting"
});
case "iiii":
default:
return t.day(r, {
width: "wide",
context: "formatting"
});
}
},
// AM or PM
a: function(e, n, t) {
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return t.dayPeriod(a, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return t.dayPeriod(a, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return t.dayPeriod(a, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return t.dayPeriod(a, {
width: "wide",
context: "formatting"
});
}
},
// AM, PM, midnight, noon
b: function(e, n, t) {
const r = e.getHours();
let a;
switch (r === 12 ? a = U.noon : r === 0 ? a = U.midnight : a = r / 12 >= 1 ? "pm" : "am", n) {
case "b":
case "bb":
return t.dayPeriod(a, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return t.dayPeriod(a, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return t.dayPeriod(a, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return t.dayPeriod(a, {
width: "wide",
context: "formatting"
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function(e, n, t) {
const r = e.getHours();
let a;
switch (r >= 17 ? a = U.evening : r >= 12 ? a = U.afternoon : r >= 4 ? a = U.morning : a = U.night, n) {
case "B":
case "BB":
case "BBB":
return t.dayPeriod(a, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return t.dayPeriod(a, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return t.dayPeriod(a, {
width: "wide",
context: "formatting"
});
}
},
// Hour [1-12]
h: function(e, n, t) {
if (n === "ho") {
let r = e.getHours() % 12;
return r === 0 && (r = 12), t.ordinalNumber(r, { unit: "hour" });
}
return I.h(e, n);
},
// Hour [0-23]
H: function(e, n, t) {
return n === "Ho" ? t.ordinalNumber(e.getHours(), { unit: "hour" }) : I.H(e, n);
},
// Hour [0-11]
K: function(e, n, t) {
const r = e.getHours() % 12;
return n === "Ko" ? t.ordinalNumber(r, { unit: "hour" }) : g(r, n.length);
},
// Hour [1-24]
k: function(e, n, t) {
let r = e.getHours();
return r === 0 && (r = 24), n === "ko" ? t.ordinalNumber(r, { unit: "hour" }) : g(r, n.length);
},
// Minute
m: function(e, n, t) {
return n === "mo" ? t.ordinalNumber(e.getMinutes(), { unit: "minute" }) : I.m(e, n);
},
// Second
s: function(e, n, t) {
return n === "so" ? t.ordinalNumber(e.getSeconds(), { unit: "second" }) : I.s(e, n);
},
// Fraction of second
S: function(e, n) {
return I.S(e, n);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function(e, n, t) {
const r = e.getTimezoneOffset();
if (r === 0)
return "Z";
switch (n) {
case "X":
return Te(r);
case "XXXX":
case "XX":
return L(r);
case "XXXXX":
case "XXX":
default:
return L(r, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function(e, n, t) {
const r = e.getTimezoneOffset();
switch (n) {
case "x":
return Te(r);
case "xxxx":
case "xx":
return L(r);
case "xxxxx":
case "xxx":
default:
return L(r, ":");
}
},
// Timezone (GMT)
O: function(e, n, t) {
const r = e.getTimezoneOffset();
switch (n) {
case "O":
case "OO":
case "OOO":
return "GMT" + Oe(r, ":");
case "OOOO":
default:
return "GMT" + L(r, ":");
}
},
// Timezone (specific non-location)
z: function(e, n, t) {
const r = e.getTimezoneOffset();
switch (n) {
case "z":
case "zz":
case "zzz":
return "GMT" + Oe(r, ":");
case "zzzz":
default:
return "GMT" + L(r, ":");
}
},
// Seconds timestamp
t: function(e, n, t) {
const r = Math.trunc(e.getTime() / 1e3);
return g(r, n.length);
},
// Milliseconds timestamp
T: function(e, n, t) {
const r = e.getTime();
return g(r, n.length);
}
};
function Oe(e, n = "") {
const t = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
return i === 0 ? t + String(a) : t + String(a) + n + g(i, 2);
}
function Te(e, n) {
return e % 60 === 0 ? (e > 0 ? "-" : "+") + g(Math.abs(e) / 60, 2) : L(e, n);
}
function L(e, n = "") {
const t = e > 0 ? "-" : "+", r = Math.abs(e), a = g(Math.trunc(r / 60), 2), i = g(r % 60, 2);
return t + a + n + i;
}
const xe = (e, n) => {
switch (e) {
case "P":
return n.date({ width: "short" });
case "PP":
return n.date({ width: "medium" });
case "PPP":
return n.date({ width: "long" });
case "PPPP":
default:
return n.date({ width: "full" });
}
}, He = (e, n) => {
switch (e) {
case "p":
return n.time({ width: "short" });
case "pp":
return n.time({ width: "medium" });
case "ppp":
return n.time({ width: "long" });
case "pppp":
default:
return n.time({ width: "full" });
}
}, qt = (e, n) => {
const t = e.match(/(P+)(p+)?/) || [], r = t[1], a = t[2];
if (!a)
return xe(e, n);
let i;
switch (r) {
case "P":
i = n.dateTime({ width: "short" });
break;
case "PP":
i = n.dateTime({ width: "medium" });
break;
case "PPP":
i = n.dateTime({ width: "long" });
break;
case "PPPP":
default:
i = n.dateTime({ width: "full" });
break;
}
return i.replace("{{date}}", xe(r, n)).replace("{{time}}", He(a, n));
}, Ft = {
p: He,
P: qt
}, It = /^D+$/, $t = /^Y+$/, Lt = ["D", "DD", "YY", "YYYY"];
function jt(e) {
return It.test(e);
}
function zt(e) {
return $t.test(e);
}
function Ut(e, n, t) {
const r = Xt(e, n, t);
if (console.warn(r), Lt.includes(e)) throw new RangeError(r);
}
function Xt(e, n, t) {
const r = e[0] === "Y" ? "years" : "days of the month";
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${n}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const Qt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Gt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Vt = /^'([^]*?)'?$/, Zt = /''/g, Jt = /[a-zA-Z]/;
function ae(e, n, t) {
var m, b, x, D;
const r = se(), a = r.locale ?? Pt, i = r.firstWeekContainsDate ?? ((b = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, o = r.weekStartsOn ?? ((D = (x = r.locale) == null ? void 0 : x.options) == null ? void 0 : D.weekStartsOn) ?? 0, s = Y(e);
if (!Ee(s))
throw new RangeError("Invalid time value");
let c = n.match(Gt).map((y) => {
const u = y[0];
if (u === "p" || u === "P") {
const l = Ft[u];
return l(y, a.formatLong);
}
return y;
}).join("").match(Qt).map((y) => {
if (y === "''")
return { isToken: !1, value: "'" };
const u = y[0];
if (u === "'")
return { isToken: !1, value: Kt(y) };
if (Ne[u])
return { isToken: !0, value: y };
if (u.match(Jt))
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" + u + "`"
);
return { isToken: !1, value: y };
});
a.localize.preprocessor && (c = a.localize.preprocessor(s, c));
const d = {
firstWeekContainsDate: i,
weekStartsOn: o,
locale: a
};
return c.map((y) => {
if (!y.isToken) return y.value;
const u = y.value;
(zt(u) || jt(u)) && Ut(u, n, String(e));
const l = Ne[u[0]];
return l(s, u, a.localize, d);
}).join("");
}
function Kt(e) {
const n = e.match(Vt);
return n ? n[1].replace(Zt, "'") : e;
}
function me(e, n) {
const r = rn(e);
let a;
if (r.date) {
const c = an(r.date, 2);
a = on(c.restDateString, c.year);
}
if (!a || isNaN(a.getTime()))
return /* @__PURE__ */ new Date(NaN);
const i = a.getTime();
let o = 0, s;
if (r.time && (o = sn(r.time), isNaN(o)))
return /* @__PURE__ */ new Date(NaN);
if (r.timezone) {
if (s = un(r.timezone), isNaN(s))
return /* @__PURE__ */ new Date(NaN);
} else {
const c = new Date(i + o), d = /* @__PURE__ */ new Date(0);
return d.setFullYear(
c.getUTCFullYear(),
c.getUTCMonth(),
c.getUTCDate()
), d.setHours(
c.getUTCHours(),
c.getUTCMinutes(),
c.getUTCSeconds(),
c.getUTCMilliseconds()
), d;
}
return new Date(i + o + s);
}
const ie = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
}, en = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, tn = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, nn = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function rn(e) {
const n = {}, t = e.split(ie.dateTimeDelimiter);
let r;
if (t.length > 2)
return n;
if (/:/.test(t[0]) ? r = t[0] : (n.date = t[0], r = t[1], ie.timeZoneDelimiter.test(n.date) && (n.date = e.split(ie.timeZoneDelimiter)[0], r = e.substr(
n.date.length,
e.length
))), r) {
const a = ie.timezone.exec(r);
a ? (n.time = r.replace(a[1], ""), n.timezone = a[1]) : n.time = r;
}
return n;
}
function an(e, n) {
const t = new RegExp(
"^(?:(\\d{4}|[+-]\\d{" + (4 + n) + "})|(\\d{2}|[+-]\\d{" + (2 + n) + "})$)"
), r = e.match(t);
if (!r) return { year: NaN, restDateString: "" };
const a = r[1] ? parseInt(r[1]) : null, i = r[2] ? parseInt(r[2]) : null;
return {
year: i === null ? a : i * 100,
restDateString: e.slice((r[1] || r[2]).length)
};
}
function on(e, n) {
if (n === null) return /* @__PURE__ */ new Date(NaN);
const t = e.match(en);
if (!t) return /* @__PURE__ */ new Date(NaN);
const r = !!t[4], a = K(t[1]), i = K(t[2]) - 1, o = K(t[3]), s = K(t[4]), c = K(t[5]) - 1;
if (r)
return mn(n, s, c) ? cn(n, s, c) : /* @__PURE__ */ new Date(NaN);
{
const d = /* @__PURE__ */ new Date(0);
return !fn(n, i, o) || !dn(n, a) ? /* @__PURE__ */ new Date(NaN) : (d.setUTCFullYear(n, i, Math.max(a, o)), d);
}
}
function K(e) {
return e ? parseInt(e) : 1;
}
function sn(e) {
const n = e.match(tn);
if (!n) return NaN;
const t = he(n[1]), r = he(n[2]), a = he(n[3]);
return hn(t, r, a) ? t * We + r * Ye + a * 1e3 : NaN;
}
function he(e) {
return e && parseFloat(e.replace(",", ".")) || 0;
}
function un(e) {
if (e === "Z") return 0;
const n = e.match(nn);
if (!n) return 0;
const t = n[1] === "+" ? -1 : 1, r = parseInt(n[2]), a = n[3] && parseInt(n[3]) || 0;
return gn(r, a) ? t * (r * We + a * Ye) : NaN;
}
function cn(e, n, t) {
const r = /* @__PURE__ */ new Date(0);
r.setUTCFullYear(e, 0, 4);
const a = r.getUTCDay() || 7, i = (n - 1) * 7 + t + 1 - a;
return r.setUTCDate(r.getUTCDate() + i), r;
}
const ln = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function Re(e) {
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
}
function fn(e, n, t) {
return n >= 0 && n <= 11 && t >= 1 && t <= (ln[n] || (Re(e) ? 29 : 28));
}
function dn(e, n) {
return n >= 1 && n <= (Re(e) ? 366 : 365);
}
function mn(e, n, t) {
return n >= 1 && n <= 53 && t >= 0 && t <= 6;
}
function hn(e, n, t) {
return e === 24 ? n === 0 && t === 0 : t >= 0 && t < 60 && n >= 0 && n < 60 && e >= 0 && e < 25;
}
function gn(e, n) {
return n >= 0 && n <= 59;
}
function Wn() {
const e = new Se();
function n(t, r) {
var i;
if (!t || typeof t == "string" && t.indexOf("0001") === 0)
return "";
if (t instanceof Date)
return ae(t, r);
let a = me(t);
if (a == "Invalid Date" && (a = e.create(t) || new Date(t)), Ee(a))
return a = me(ae(a, "yyyy-MM-dd HH:mm:ss")), ae(a, r);
if (r.indexOf("HH") === 0 || r.indexOf("hh") === 0) {
const o = (i = t.match(/\d*/g)) == null ? void 0 : i.filter((c) => c !== "").join(":");
(r === "HH" || r === "hh") && (r += ":mm");
const s = me("2024-06-05 " + o);
return ae(s, r);
}
return "";
}
return {
formatTo: n
};
}
function Pn() {
function e() {
const t = (r) => {
const a = Math.random() * 16 | 0;
return (r === "x" ? a : a & 3 | 8).toString(16);
};
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, t);
}
function n(t, r) {
const a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = [];
let o;
if (r = r || a.length, t)
for (o = 0; o < t; o++)
i[o] = a[0 | Math.random() * r];
else {
let s;
for (i[8] = i[13] = i[18] = i[23] = "-", i[14] = "4", o = 0; o < 36; o++)
i[o] || (s = 0 | Math.random() * 16, i[o] = a[o === 19 ? s & 3 | 8 : s]);
}
return i.join("");
}
return { guid: e, uuid: n };
}
function En() {
function e(u, l = null) {
return Array.isArray(u) ? k.max.apply(null, u).toFixed() : u && l ? k.maximum(u, l).toFixed() : (console.error("请提供比较的值firstValue、secondValue."), "");
}
function n(u, l = null) {
return Array.isArray(u) ? k.min.apply(null, u).toFixed() : u && l ? k.minimum(u, l).toFixed() : (console.error("请提供比较的值firstValue、secondValue."), "");
}
function t(u) {
return k.sum.apply(null, u).toFixed();
}
function r(u, l) {
return new k(u).div(l).toFixed();
}
function a(u, l) {
return new k(u).plus(l).toFixed();
}
function i(u, l) {
return new k(u).times(l).toFixed();
}
function o(u, l) {
return new k(u).minus(l).toFixed();
}
function s(u, l) {
return new k(u).eq(l);
}
function c(u, l) {
return new k(u).lt(l);
}
function d(u, l) {
return new k(u).gt(l);
}
function m(u) {
return new k(u).toNumber();
}
function b(u, l = 0) {
return new k(u).toFixed(l);
}
function x(u) {
const l = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], h = ["", "拾", "佰", "仟"], S = ["", "万", "亿", "兆"], C = ["角", "分", "毫", "厘"], W = "整", B = "元";
let H, R, _ = "", G;
if (u === "")
return "";
const V = parseFloat(u);
if (V >= 1e15)
return "";
if (V === 0)
return _ = l[0] + B + W, _;
if (u