@vexip-ui/utils
Advanced tools
Comparing version 1.5.0 to 1.6.0
1418
dist/index.js
@@ -1,1417 +0,1 @@ | ||
const Tt = "[-\\+]?\\d+%?", $t = "[-\\+]?\\d*\\.\\d+%?", E = `(?:${$t})|(?:${Tt})`, Rt = `[\\s|\\(]+(${E})[,|\\s]+(${E})[,|\\s]+(${E})\\s*\\)?`, H = `[\\s|\\(]+(${E})[,|\\s]+(${E})[,|\\s]+(${E})[,|\\s]+(${E})\\s*\\)?`, ut = new RegExp(`rgb${Rt}`), lt = new RegExp(`rgba${H}`), dt = new RegExp(`hsl${H}`), ht = new RegExp(`hsla${H}`), gt = new RegExp(`hsv${H}`), pt = new RegExp(`hsva${H}`), bt = /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, mt = /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, yt = /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, Mt = /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, L = Object.freeze({ | ||
aliceblue: "f0f8ff", | ||
antiquewhite: "faebd7", | ||
aqua: "0ff", | ||
aquamarine: "7fffd4", | ||
azure: "f0ffff", | ||
beige: "f5f5dc", | ||
bisque: "ffe4c4", | ||
black: "000", | ||
blanchedalmond: "ffebcd", | ||
blue: "00f", | ||
blueviolet: "8a2be2", | ||
brown: "a52a2a", | ||
burlywood: "deb887", | ||
burntsienna: "ea7e5d", | ||
cadetblue: "5f9ea0", | ||
chartreuse: "7fff00", | ||
chocolate: "d2691e", | ||
coral: "ff7f50", | ||
cornflowerblue: "6495ed", | ||
cornsilk: "fff8dc", | ||
crimson: "dc143c", | ||
cyan: "0ff", | ||
darkblue: "00008b", | ||
darkcyan: "008b8b", | ||
darkgoldenrod: "b8860b", | ||
darkgray: "a9a9a9", | ||
darkgreen: "006400", | ||
darkgrey: "a9a9a9", | ||
darkkhaki: "bdb76b", | ||
darkmagenta: "8b008b", | ||
darkolivegreen: "556b2f", | ||
darkorange: "ff8c00", | ||
darkorchid: "9932cc", | ||
darkred: "8b0000", | ||
darksalmon: "e9967a", | ||
darkseagreen: "8fbc8f", | ||
darkslateblue: "483d8b", | ||
darkslategray: "2f4f4f", | ||
darkslategrey: "2f4f4f", | ||
darkturquoise: "00ced1", | ||
darkviolet: "9400d3", | ||
deeppink: "ff1493", | ||
deepskyblue: "00bfff", | ||
dimgray: "696969", | ||
dimgrey: "696969", | ||
dodgerblue: "1e90ff", | ||
firebrick: "b22222", | ||
floralwhite: "fffaf0", | ||
forestgreen: "228b22", | ||
fuchsia: "f0f", | ||
gainsboro: "dcdcdc", | ||
ghostwhite: "f8f8ff", | ||
gold: "ffd700", | ||
goldenrod: "daa520", | ||
gray: "808080", | ||
green: "008000", | ||
greenyellow: "adff2f", | ||
grey: "808080", | ||
honeydew: "f0fff0", | ||
hotpink: "ff69b4", | ||
indianred: "cd5c5c", | ||
indigo: "4b0082", | ||
ivory: "fffff0", | ||
khaki: "f0e68c", | ||
lavender: "e6e6fa", | ||
lavenderblush: "fff0f5", | ||
lawngreen: "7cfc00", | ||
lemonchiffon: "fffacd", | ||
lightblue: "add8e6", | ||
lightcoral: "f08080", | ||
lightcyan: "e0ffff", | ||
lightgoldenrodyellow: "fafad2", | ||
lightgray: "d3d3d3", | ||
lightgreen: "90ee90", | ||
lightgrey: "d3d3d3", | ||
lightpink: "ffb6c1", | ||
lightsalmon: "ffa07a", | ||
lightseagreen: "20b2aa", | ||
lightskyblue: "87cefa", | ||
lightslategray: "789", | ||
lightslategrey: "789", | ||
lightsteelblue: "b0c4de", | ||
lightyellow: "ffffe0", | ||
lime: "0f0", | ||
limegreen: "32cd32", | ||
linen: "faf0e6", | ||
magenta: "f0f", | ||
maroon: "800000", | ||
mediumaquamarine: "66cdaa", | ||
mediumblue: "0000cd", | ||
mediumorchid: "ba55d3", | ||
mediumpurple: "9370db", | ||
mediumseagreen: "3cb371", | ||
mediumslateblue: "7b68ee", | ||
mediumspringgreen: "00fa9a", | ||
mediumturquoise: "48d1cc", | ||
mediumvioletred: "c71585", | ||
midnightblue: "191970", | ||
mintcream: "f5fffa", | ||
mistyrose: "ffe4e1", | ||
moccasin: "ffe4b5", | ||
navajowhite: "ffdead", | ||
navy: "000080", | ||
oldlace: "fdf5e6", | ||
olive: "808000", | ||
olivedrab: "6b8e23", | ||
orange: "ffa500", | ||
orangered: "ff4500", | ||
orchid: "da70d6", | ||
palegoldenrod: "eee8aa", | ||
palegreen: "98fb98", | ||
paleturquoise: "afeeee", | ||
palevioletred: "db7093", | ||
papayawhip: "ffefd5", | ||
peachpuff: "ffdab9", | ||
peru: "cd853f", | ||
pink: "ffc0cb", | ||
plum: "dda0dd", | ||
powderblue: "b0e0e6", | ||
purple: "800080", | ||
rebeccapurple: "663399", | ||
red: "f00", | ||
rosybrown: "bc8f8f", | ||
royalblue: "4169e1", | ||
saddlebrown: "8b4513", | ||
salmon: "fa8072", | ||
sandybrown: "f4a460", | ||
seagreen: "2e8b57", | ||
seashell: "fff5ee", | ||
sienna: "a0522d", | ||
silver: "c0c0c0", | ||
skyblue: "87ceeb", | ||
slateblue: "6a5acd", | ||
slategray: "708090", | ||
slategrey: "708090", | ||
snow: "fffafa", | ||
springgreen: "00ff7f", | ||
steelblue: "4682b4", | ||
tan: "d2b48c", | ||
teal: "008080", | ||
thistle: "d8bfd8", | ||
tomato: "ff6347", | ||
turquoise: "40e0d0", | ||
violet: "ee82ee", | ||
wheat: "f5deb3", | ||
white: "fff", | ||
whitesmoke: "f5f5f5", | ||
yellow: "ff0", | ||
yellowgreen: "9acd32" | ||
}), Ft = Object.freeze(new Set(Object.keys(L))); | ||
function He(t) { | ||
return t = String(t).trim().toLowerCase(), t ? t === "transparent" || L[t] ? !0 : t === "transparent" || Ft.has(t) || ut.test(t) || lt.test(t) || dt.test(t) || ht.test(t) || gt.test(t) || pt.test(t) || bt.test(t) || mt.test(t) || yt.test(t) || Mt.test(t) : !1; | ||
} | ||
function Dt(t) { | ||
if (t = t.toString().trim().toLowerCase(), t === "transparent") | ||
return { r: 0, g: 0, b: 0, a: 0, format: "name", toString: g }; | ||
let e = !1; | ||
L[t] && (t = L[t], e = !0); | ||
let n; | ||
if (n = ut.exec(t)) { | ||
const { r, g: o, b: i } = _(n[1], n[2], n[3]); | ||
return { r: r * 255, g: o * 255, b: i * 255, format: "rgb", toString: g }; | ||
} | ||
if (n = lt.exec(t)) { | ||
const { r, g: o, b: i } = _(n[1], n[2], n[3]); | ||
return { | ||
r: r * 255, | ||
g: o * 255, | ||
b: i * 255, | ||
a: k(n[4]), | ||
format: "rgba", | ||
toString: g | ||
}; | ||
} | ||
if (n = dt.exec(t)) { | ||
const { h: r, s: o, l: i } = U(n[0], n[1], n[3]); | ||
return { h: r * 360, s: o, l: i, format: "hsl", toString: Y }; | ||
} | ||
if (n = ht.exec(t)) { | ||
const { h: r, s: o, l: i } = U(n[0], n[1], n[3]); | ||
return { | ||
h: r * 360, | ||
s: o, | ||
l: i, | ||
a: k(n[4]), | ||
format: "hsla", | ||
toString: Y | ||
}; | ||
} | ||
if (n = gt.exec(t)) { | ||
const { h: r, s: o, v: i } = B(n[0], n[1], n[3]); | ||
return { h: r * 360, s: o, v: i, format: "hsv", toString: G }; | ||
} | ||
if (n = pt.exec(t)) { | ||
const { h: r, s: o, v: i } = B(n[0], n[1], n[3]); | ||
return { | ||
h: r * 360, | ||
s: o, | ||
v: i, | ||
a: k(n[4]), | ||
format: "hsva", | ||
toString: G | ||
}; | ||
} | ||
return (n = bt.exec(t)) ? { | ||
r: parseInt(`${n[1]}${n[1]}`, 16), | ||
g: parseInt(`${n[2]}${n[2]}`, 16), | ||
b: parseInt(`${n[3]}${n[3]}`, 16), | ||
format: e ? "name" : "hex3", | ||
toString: g | ||
} : (n = mt.exec(t)) ? { | ||
r: parseInt(`${n[1]}${n[1]}`, 16), | ||
g: parseInt(`${n[2]}${n[2]}`, 16), | ||
b: parseInt(`${n[3]}${n[3]}`, 16), | ||
a: nt(`${n[4]}${n[4]}`), | ||
format: e ? "name" : "hex4", | ||
toString: g | ||
} : (n = yt.exec(t)) ? { | ||
r: parseInt(n[1], 16), | ||
g: parseInt(n[2], 16), | ||
b: parseInt(n[3], 16), | ||
format: e ? "name" : "hex6", | ||
toString: g | ||
} : (n = Mt.exec(t)) ? { | ||
r: parseInt(n[1], 16), | ||
g: parseInt(n[2], 16), | ||
b: parseInt(n[3], 16), | ||
a: nt(n[4]), | ||
format: e ? "name" : "hex8", | ||
toString: g | ||
} : null; | ||
} | ||
function Ce(t) { | ||
const { a: e, ...n } = N(t); | ||
delete n.format; | ||
const r = xt(n.r, n.g, n.b), o = Ct(n.r, n.g, n.b), i = It(n.r, n.g, n.b), s = Lt(n.r, n.g, n.b, e); | ||
return { | ||
rgb: n, | ||
hsl: r, | ||
hsv: o, | ||
hex: i, | ||
alpha: e, | ||
rgba: { ...n, a: e, format: "rgba" }, | ||
hsla: { ...r, a: e, format: "hsla" }, | ||
hsva: { ...o, a: e, format: "hsva" }, | ||
hex8: s, | ||
origin: t | ||
}; | ||
} | ||
function N(t) { | ||
let e = { r: 0, g: 0, b: 0 }, n = 1, r; | ||
return typeof t == "string" ? r = Dt(t) : r = t, r !== null && typeof r == "object" && ("l" in r ? e = Ot(r.h, r.s, r.l) : "v" in r && (e = Ht(r.h, r.s, r.v)), r.a && (n = k(r.a), Number.isNaN(n) && (n = 1)), e = r), { ...e, a: n, format: "rgba", toString: g }; | ||
} | ||
function U(t, e, n) { | ||
return { | ||
h: p(t, 0, 360) / 360, | ||
s: p(T(e) ? $(e) : e, 0, 1), | ||
l: p(T(n) ? $(n) : n, 0, 1) | ||
}; | ||
} | ||
function _(t, e, n) { | ||
return { | ||
r: p(t, 0, 255) / 255, | ||
g: p(e, 0, 255) / 255, | ||
b: p(n, 0, 255) / 255 | ||
}; | ||
} | ||
function B(t, e, n) { | ||
return { | ||
h: p(t, 0, 360) / 360, | ||
s: p(T(e) ? $(e) : e, 0, 1), | ||
v: p(T(n) ? $(n) : n, 0, 1) | ||
}; | ||
} | ||
function k(t) { | ||
return p(T(t) ? $(t) : t, 0, 1); | ||
} | ||
function Ot(t, e, n) { | ||
let r, o, i; | ||
if ({ h: t, s: e, l: n } = U(t, e, n), e === 0) | ||
r = o = i = n; | ||
else { | ||
const s = n < 0.5 ? 1 * (1 + e) : n + e - n * e, c = 2 * n - s; | ||
r = K(c, s, t + 1 / 3), o = K(c, s, t), i = K(c, s, t - 1 / 3); | ||
} | ||
return r *= 255, o *= 255, i *= 255, { r, g: o, b: i, toString: g }; | ||
} | ||
function xt(t, e, n) { | ||
({ r: t, g: e, b: n } = _(t, e, n)); | ||
const r = Math.max(t, e, n), o = Math.min(t, e, n); | ||
let i, s; | ||
const c = (r + o) / 2; | ||
if (r === o) | ||
i = s = 0; | ||
else { | ||
const f = r - o; | ||
switch (s = c > 0.5 ? f / (2 - r - o) : f / (r + o), r) { | ||
case t: { | ||
i = (e - n) / f + (e < n ? 6 : 0); | ||
break; | ||
} | ||
case e: { | ||
i = (n - t) / f + 2; | ||
break; | ||
} | ||
case n: { | ||
i = (t - e) / f + 4; | ||
break; | ||
} | ||
default: | ||
i = 0; | ||
} | ||
i *= 60; | ||
} | ||
return { h: i, s, l: c, toString: Y }; | ||
} | ||
function Ie(t, e, n) { | ||
({ h: t, s: e, l: n } = U(t, e, n)); | ||
const r = 0.5 * (2 * n + e * (1 - Math.abs(2 * n - 1))); | ||
return e = 2 * (r - n) / r, { h: t * 360, s: e, v: r, toString: G }; | ||
} | ||
function Le(t, e, n) { | ||
({ h: t, s: e, v: n } = B(t, e, n)); | ||
const r = 0.5 * n * (2 - e); | ||
return e = n * e / (1 - Math.abs(2 * r - 1)), { h: t * 360, s: e, l: r, toString: Y }; | ||
} | ||
function Ht(t, e, n) { | ||
({ h: t, s: e, v: n } = B(t, e, n)), t *= 6; | ||
const r = Math.floor(t), o = t - r, i = n * (1 - e), s = n * (1 - o * e), c = n * (1 - (1 - o) * e), f = r % 6; | ||
let u = [n, s, i, i, c, n][f], a = [c, n, n, s, i, i][f], d = [i, i, c, n, n, s][f]; | ||
return u *= 255, a *= 255, d *= 255, { r: u, g: a, b: d, toString: g }; | ||
} | ||
function Ct(t, e, n) { | ||
({ r: t, g: e, b: n } = _(t, e, n)); | ||
const r = Math.max(t, e, n), o = Math.min(t, e, n); | ||
let i; | ||
const s = r, c = r - o, f = r === 0 ? 0 : c / r; | ||
if (r === o) | ||
i = 0; | ||
else { | ||
switch (r) { | ||
case t: { | ||
i = (e - n) / c + (e < n ? 6 : 0); | ||
break; | ||
} | ||
case e: { | ||
i = (n - t) / c + 2; | ||
break; | ||
} | ||
case n: { | ||
i = (t - e) / c + 4; | ||
break; | ||
} | ||
default: | ||
i = 0; | ||
} | ||
i *= 60; | ||
} | ||
return { h: i, s: f, v: s, toString: G }; | ||
} | ||
function It(t, e, n, r = !1) { | ||
({ r: t, g: e, b: n } = _(t, e, n)); | ||
const o = [ | ||
S(Math.round(t * 255).toString(16)), | ||
S(Math.round(e * 255).toString(16)), | ||
S(Math.round(n * 255).toString(16)) | ||
]; | ||
return r && w(o[0]) && w(o[1]) && w(o[2]) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : "#" + o.join(""); | ||
} | ||
function Lt(t, e, n, r, o = !1) { | ||
({ r: t, g: e, b: n } = _(t, e, n)); | ||
const i = [ | ||
S(Math.round(t * 255).toString(16)), | ||
S(Math.round(e * 255).toString(16)), | ||
S(Math.round(n * 255).toString(16)), | ||
S(Ut(k(r))) | ||
]; | ||
return o && w(i[0]) && w(i[1]) && w(i[2]) && w(i[3]) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : "#" + i.join(""); | ||
} | ||
function Ue(t, e, n = 0.5) { | ||
if (!t && !e) | ||
return { r: 0, g: 0, b: 0, a: 1 }; | ||
if (!t) | ||
return N(e); | ||
if (!e) | ||
return N(t); | ||
const r = N(t), o = N(e), i = p(n, 0, 1), s = i * 2 - 1, c = r.a - o.a, u = ((s * c === -1 ? s : (s + c) / (1 + s * c)) + 1) / 2, a = 1 - u; | ||
return { | ||
r: Math.round(r.r * u + o.r * a), | ||
g: Math.round(r.g * u + o.g * a), | ||
b: Math.round(r.b * u + o.b * a), | ||
a: Math.round(r.a * i + o.a * (1 - i)), | ||
format: "rgba", | ||
toString: g | ||
}; | ||
} | ||
function Be(t, e) { | ||
const n = N(t); | ||
return n.a = k(T(e) ? $(e) : e), n; | ||
} | ||
function S(t) { | ||
return t.length === 1 ? `0${t}` : t.toString(); | ||
} | ||
function w(t) { | ||
return t.charAt(0) === t.charAt(1); | ||
} | ||
function Ut(t) { | ||
return Math.round(parseFloat(t) * 255).toString(16); | ||
} | ||
function nt(t) { | ||
return parseInt(t, 16) / 255; | ||
} | ||
function p(t, e, n) { | ||
return Math.max(e, Math.min(n, parseFloat(t))); | ||
} | ||
function K(t, e, n) { | ||
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t; | ||
} | ||
function T(t) { | ||
return t.toString().trim().includes("%"); | ||
} | ||
function $(t) { | ||
const e = parseFloat(t) / 100; | ||
return Number.isNaN(e) ? 0 : e; | ||
} | ||
function g() { | ||
return this.a && this.a >= 0 && this.a < 1 ? `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})` : `rgb(${this.r}, ${this.g}, ${this.b})`; | ||
} | ||
function Y() { | ||
return this.a && this.a >= 0 && this.a < 1 ? `hsla(${this.h}, ${this.s}, ${this.l}, ${this.a})` : `hsl(${this.h}, ${this.s}, ${this.l})`; | ||
} | ||
function G() { | ||
return this.a && this.a >= 0 && this.a < 1 ? `hsva(${this.h}, ${this.s}, ${this.v}, ${this.a})` : `hsv(${this.h}, ${this.s}, ${this.v})`; | ||
} | ||
const Bt = Object.prototype.toString, Yt = Object.prototype.hasOwnProperty; | ||
function C(t, e) { | ||
return Bt.call(t) === `[object ${e}]`; | ||
} | ||
function Ye(t, e) { | ||
return Yt.call(t, e); | ||
} | ||
function M(t) { | ||
return t != null; | ||
} | ||
function Ge(t) { | ||
return t == null; | ||
} | ||
function qe(t) { | ||
return typeof t == "number"; | ||
} | ||
function Pe(t) { | ||
return Number.isNaN(t); | ||
} | ||
function We(t) { | ||
return typeof t == "string"; | ||
} | ||
function ve(t) { | ||
return typeof t == "boolean"; | ||
} | ||
function ze(t) { | ||
return t === !0; | ||
} | ||
function je(t) { | ||
return t === !1; | ||
} | ||
function Ke(t) { | ||
return typeof t == "symbol"; | ||
} | ||
function Qe(t) { | ||
return typeof t == "bigint"; | ||
} | ||
function Xe(t) { | ||
return Array.isArray(t); | ||
} | ||
function q(t) { | ||
return C(t, "Object"); | ||
} | ||
function Ve(t) { | ||
return !!t && typeof t.then == "function" && typeof t.catch == "function"; | ||
} | ||
function Gt(t) { | ||
return typeof t == "function"; | ||
} | ||
function Ze(t) { | ||
return C(t, "Set"); | ||
} | ||
function Je(t) { | ||
return C(t, "Map"); | ||
} | ||
function tn(t) { | ||
return C(t, "Date"); | ||
} | ||
function en(t) { | ||
return C(t, "RegExp"); | ||
} | ||
function nn(t) { | ||
return Array.isArray(t) || typeof t == "string" ? t.length === 0 : t instanceof Map || t instanceof Set ? t.size === 0 : q(t) ? Object.keys(t).length === 0 : !1; | ||
} | ||
function rn() { | ||
} | ||
function on(t, e = 1, n = 1) { | ||
const r = []; | ||
for (let o = 0; o < t; ++o) | ||
r.push(e + o * n); | ||
return r; | ||
} | ||
function sn(t) { | ||
return Object.prototype.toString.call(t).slice(8, -1); | ||
} | ||
function cn(t = 16) { | ||
const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", n = e.length; | ||
let r = ""; | ||
for (; t--; ) | ||
r += e.charAt(Math.floor(Math.random() * n)); | ||
return r; | ||
} | ||
function rt(t) { | ||
return t & -t; | ||
} | ||
function fn(t, e = 0) { | ||
const n = new Array(t + 1).fill(0); | ||
function r(c, f) { | ||
if (!(!f || c >= t)) | ||
for (c += 1; c <= t; ) | ||
n[c] += f, c += rt(c); | ||
} | ||
function o(c = t) { | ||
if (c <= 0) | ||
return 0; | ||
c > t && (c = t); | ||
let f = c * e; | ||
for (; c > 0; ) | ||
f += n[c], c -= rt(c); | ||
return f; | ||
} | ||
function i(c) { | ||
return o(c + 1) - o(c); | ||
} | ||
function s(c) { | ||
let f = 0, u = t; | ||
for (; u > f; ) { | ||
const a = Math.floor((f + u) / 2), d = o(a); | ||
if (d > c) { | ||
u = a; | ||
continue; | ||
} else if (d < c) { | ||
if (f === a) | ||
return o(f + 1) <= c ? f + 1 : f; | ||
f = a; | ||
} else | ||
return a; | ||
} | ||
return f; | ||
} | ||
return { add: r, sum: o, get: i, boundIndex: s }; | ||
} | ||
function an(t) { | ||
const e = parseFloat(t); | ||
return Number.isNaN(e) ? 0 : e; | ||
} | ||
function A(t) { | ||
return t < 10 ? `0${t}` : t.toString(); | ||
} | ||
function un(t, e = 3, n = ",") { | ||
if (typeof t != "number" && (t = parseFloat(t)), Number.isNaN(t)) | ||
return "0"; | ||
let [r, o] = String(t).split("."); | ||
const i = new RegExp(`(\\d+)(\\d{${e}})`); | ||
for (; i.test(r); ) | ||
r = r.replace(i, `$1${n}$2`); | ||
return o = o ? `.${o}` : "", `${r}${o}`; | ||
} | ||
function qt(t, e) { | ||
if (e === 0) | ||
return Math.round(t); | ||
let n = String(t); | ||
const r = n.indexOf("."); | ||
if (r === -1) | ||
return t; | ||
const o = n.replace(".", "").split(""), i = r + e; | ||
return o[i] ? (n.charAt(i + 1) === "5" ? n = n.substring(0, i + 1) + "6" : n = n.substring(0, i + 2), parseFloat(Number(n).toFixed(e))) : t; | ||
} | ||
function ln(t, e, n) { | ||
return qt(t * e, n); | ||
} | ||
function dn(t, e) { | ||
if (e < 0 || e > 1) | ||
return Math.round(t); | ||
const n = Math.ceil(t); | ||
return t + e >= n ? n : Math.floor(t); | ||
} | ||
function hn(t, e, n) { | ||
return Math.max(e, Math.min(n, parseFloat(t))); | ||
} | ||
const Pt = Object.freeze(["B", "KB", "MB", "GB", "TB", "AUTO"]); | ||
function gn(t, e = "AUTO") { | ||
let n = e.toUpperCase(); | ||
n = Pt.includes(n) ? n : "AUTO"; | ||
let r; | ||
switch (n) { | ||
case "AUTO": | ||
r = 0; | ||
break; | ||
case "KB": | ||
r = 1; | ||
break; | ||
case "MB": | ||
r = 2; | ||
break; | ||
case "GB": | ||
r = 3; | ||
break; | ||
case "TB": | ||
r = 4; | ||
break; | ||
default: | ||
return t; | ||
} | ||
let o; | ||
if (r) | ||
o = t / 1024 ** r; | ||
else | ||
for (o = t; o > 1024 && !(r > 4); ++r) | ||
o = o / 1024; | ||
return o; | ||
} | ||
function m(t) { | ||
const e = t.toString().split(/[eE]/), n = (e[0].split(".")[1] || "").length - +(e[1] || 0); | ||
return n > 0 ? n : 0; | ||
} | ||
function Et(t, e = 15) { | ||
return +parseFloat(Number(t).toPrecision(e)); | ||
} | ||
function P(t) { | ||
const e = String(t); | ||
if (!e.includes("e")) | ||
return Number(e.replace(".", "")); | ||
const n = m(t); | ||
return n > 0 ? Et(Number(t) * 10 ** n) : Number(t); | ||
} | ||
function W(t) { | ||
return (...e) => { | ||
let n = e[0]; | ||
for (let r = 1, o = e.length; r < o; ++r) | ||
n = t(n, e[r]); | ||
return n; | ||
}; | ||
} | ||
const x = W((t, e) => { | ||
const n = P(t), r = P(e), o = m(t) + m(e); | ||
return n * r / 10 ** o; | ||
}), pn = W((t, e) => { | ||
const n = 10 ** Math.max(m(t), m(e)); | ||
return (x(t, n) + x(e, n)) / n; | ||
}), bn = W((t, e) => { | ||
const n = 10 ** Math.max(m(t), m(e)); | ||
return (x(t, n) - x(e, n)) / n; | ||
}), mn = W((t, e) => { | ||
const n = P(t), r = P(e); | ||
return x(n / r, Et(10 ** (m(e) - m(t)))); | ||
}), F = 1e3, I = 60, Wt = I * F, v = 60, vt = v * I, zt = vt * F, St = 24, jt = St * v, Kt = jt * I, Qt = Kt * F, V = 7, Xt = V * St, Vt = Xt * v, Zt = Vt * I, Jt = Zt * F, wt = 3, te = 4, ee = te * wt, ne = { | ||
y(t, e) { | ||
const n = t.getFullYear(); | ||
return e.length === 4 ? n : n % 1e3 % 100; | ||
}, | ||
M(t, e) { | ||
const n = t.getMonth() + 1; | ||
return e.length === 2 ? A(n) : n; | ||
}, | ||
d(t, e) { | ||
const n = t.getDate(); | ||
return e.length === 2 ? A(n) : n; | ||
}, | ||
H(t, e) { | ||
const n = t.getHours(); | ||
return e.length === 2 ? A(n) : n; | ||
}, | ||
m(t, e) { | ||
const n = t.getMinutes(); | ||
return e.length === 2 ? A(n) : n; | ||
}, | ||
s(t, e) { | ||
const n = t.getSeconds(); | ||
return e.length === 2 ? A(n) : n; | ||
}, | ||
q(t, e) { | ||
const n = Math.ceil((t.getMonth() + 1) / 3); | ||
return e.length === 2 ? A(n) : n; | ||
} | ||
}, re = /[yMdHmsq](\w)*|./g, oe = /'(.+?)'/g; | ||
function l(t, e = !1) { | ||
const n = new Date(t); | ||
if (e && Number.isNaN(+n)) | ||
throw new RangeError("Invalid date value"); | ||
return n; | ||
} | ||
function yn(t, e = "yyyy-MM-dd HH:mm:ss") { | ||
t = l(t); | ||
const n = e.match(re), r = n == null ? void 0 : n.length; | ||
if (!r) | ||
return e; | ||
let o = 0, i = ""; | ||
for (; o < r; ) { | ||
const s = n[o], c = s[0], f = ne[c]; | ||
f ? i += f(t, s) : i += s, ++o; | ||
} | ||
return i.replace(oe, "$1"); | ||
} | ||
function X(t) { | ||
return t = l(t), Math.floor(t.getMonth() / 3) + 1; | ||
} | ||
const ie = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"]; | ||
function Mn(t) { | ||
return ie[t.getDay()]; | ||
} | ||
function se(t, e) { | ||
return t = l(t), t.setTime(t.getTime() + e), t; | ||
} | ||
function ce(t, e) { | ||
return e *= F, se(t, e); | ||
} | ||
function fe(t, e) { | ||
return e *= I, ce(t, e); | ||
} | ||
function ae(t, e) { | ||
return e *= v, fe(t, e); | ||
} | ||
function En(t, e) { | ||
return e *= 12, ae(t, e); | ||
} | ||
function Z(t, e) { | ||
return t = l(t), e = ~~e, t.setDate(t.getDate() + e), t; | ||
} | ||
function Sn(t, e) { | ||
return e *= V, Z(t, e); | ||
} | ||
function J(t, e) { | ||
return t = l(t), e = ~~e, t.setMonth(t.getMonth() + e), t; | ||
} | ||
function wn(t, e) { | ||
return e *= wt, J(t, e); | ||
} | ||
function An(t, e) { | ||
return e *= ee, J(t, e); | ||
} | ||
function Nn(t, e = 42, n = 1) { | ||
t = l(t); | ||
const r = []; | ||
for (let o = 0; o < e; ++o) | ||
r.push(Z(t, o * n)); | ||
return r; | ||
} | ||
function kn(t, e = 12, n = 1) { | ||
t = l(t); | ||
const r = []; | ||
for (let o = 0; o < e; ++o) | ||
r.push(J(t, o * n)); | ||
return r; | ||
} | ||
function _n(t) { | ||
var n; | ||
const e = (n = t.getDay()) != null ? n : 7; | ||
return Z(t, -e); | ||
} | ||
function ot(t) { | ||
return t = l(t), t.setMilliseconds(0), t; | ||
} | ||
function it(t) { | ||
return t = l(t), t.setSeconds(0, 0), t; | ||
} | ||
function st(t) { | ||
return t = l(t), t.setMinutes(0, 0, 0), t; | ||
} | ||
function ct(t) { | ||
return t = l(t), t.setHours(0, 0, 0, 0), t; | ||
} | ||
function Tn(t) { | ||
return t = l(t), t.setHours(23, 59, 59, 999), t; | ||
} | ||
function ft(t, e = 0) { | ||
e = e % 7, e < 0 && (e += 7), t = l(t); | ||
const n = t.getDay(), r = (n < e ? 7 : 0) + n - e; | ||
return t.setDate(t.getDate() - r), t.setHours(0, 0, 0, 0), t; | ||
} | ||
function $n(t) { | ||
return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0; | ||
} | ||
function Rn(t, e = 1) { | ||
t = l(t); | ||
const n = t.getFullYear(), r = t.getMonth() + 1, o = t.getDate(), i = n % 4 === 0 && n % 100 !== 0 || n % 400 === 0; | ||
let s; | ||
return r < 7 ? r !== 2 ? s = 30 + r % 2 : i ? s = 29 : s = 28 : s = 31 - r % 2, e = e % s, e < 0 && (e += s), o < e && t.setMonth(r - 1), t.setDate(e), t.setHours(0, 0, 0, 0), t; | ||
} | ||
function Fn(t) { | ||
t = l(t); | ||
const e = X(t); | ||
return t.setDate(1), t.setHours(0, 0, 0, 0), t.setMonth((e - 1) * 3), t; | ||
} | ||
function Dn(t, e = 0) { | ||
e = e % 11, e < 0 && (e += 11), t = l(t); | ||
const n = t.getMonth(), r = (n < e ? 11 : 0) + n - e; | ||
return t.setMonth(t.getMonth() - r), t.setDate(1), t.setHours(0, 0, 0, 0), t; | ||
} | ||
function tt(t, e) { | ||
return t = l(t), e = l(e), e.getTime() - t.getTime(); | ||
} | ||
function ue(t, e) { | ||
const n = tt(t, e) / F; | ||
return n > 0 ? Math.floor(n) : Math.ceil(n); | ||
} | ||
function le(t, e) { | ||
const n = tt(t, e) / Wt; | ||
return n > 0 ? Math.floor(n) : Math.ceil(n); | ||
} | ||
function de(t, e) { | ||
const n = tt(t, e) / zt; | ||
return n > 0 ? Math.floor(n) : Math.ceil(n); | ||
} | ||
function he(t, e) { | ||
return t = ct(t), e = ct(e), (e.getTime() - t.getTime()) / Qt; | ||
} | ||
function On(t, e, n = 0) { | ||
return t = ft(t, n), e = ft(e, n), (e.getTime() - t.getTime()) / Jt; | ||
} | ||
function ge(t, e) { | ||
t = l(t), e = l(e); | ||
const n = e.getFullYear() - t.getFullYear(), r = e.getMonth() - t.getMonth(); | ||
return n * 12 + r; | ||
} | ||
function xn(t, e) { | ||
t = l(t), e = l(e); | ||
const n = e.getFullYear() - t.getFullYear(), r = X(e) - X(t); | ||
return n * 4 + r; | ||
} | ||
function pe(t, e) { | ||
return t = l(t), e = l(e), e.getFullYear() - t.getFullYear(); | ||
} | ||
function be(t, e) { | ||
t = l(t), e = l(e); | ||
const n = t.getTime() - e.getTime(); | ||
return n < 0 ? -1 : n > 0 ? 1 : n; | ||
} | ||
function R(t, e) { | ||
return -be(t, e); | ||
} | ||
function Hn(t, e) { | ||
return t = ot(t), e = ot(e), ue(t, e); | ||
} | ||
function Cn(t, e) { | ||
return t = it(t), e = it(e), le(t, e); | ||
} | ||
function In(t, e) { | ||
return t = st(t), e = st(e), de(t, e); | ||
} | ||
function me(t, e) { | ||
const n = R(t, e), r = Math.abs(he(t, e)); | ||
t = l(t), t.setDate(t.getDate() + n * r); | ||
const o = R(t, e) === -n; | ||
return n * (r - (o ? 1 : 0)); | ||
} | ||
function Ln(t, e) { | ||
const n = me(t, e) / V; | ||
return n > 0 ? Math.floor(n) : Math.ceil(n); | ||
} | ||
function ye(t, e) { | ||
const n = R(t, e), r = Math.abs(ge(t, e)); | ||
t = l(t), t.setMonth(t.getMonth() + n * r); | ||
const o = R(t, e) === -n; | ||
return n * (r - (o ? 1 : 0)); | ||
} | ||
function Un(t, e) { | ||
const n = ye(t, e) / 3; | ||
return n > 0 ? Math.floor(n) : Math.ceil(n); | ||
} | ||
function Bn(t, e) { | ||
const n = R(t, e), r = Math.abs(pe(t, e)); | ||
t = l(t), t.setFullYear(t.getFullYear() + n * r); | ||
const o = R(t, e) === -n; | ||
return n * (r - (o ? 1 : 0)); | ||
} | ||
function Me(t) { | ||
if (t === null || typeof t != "object") | ||
return t; | ||
const e = Array.isArray(t) ? [] : {}, n = [ | ||
{ | ||
parent: e, | ||
key: void 0, | ||
data: t | ||
} | ||
]; | ||
for (; n.length; ) { | ||
const r = n.pop(), { parent: o, key: i, data: s } = r, c = Array.isArray(s) ? "array" : "object"; | ||
if (!o) | ||
continue; | ||
let f = o; | ||
typeof i < "u" && (f = o[i] = c === "array" ? [] : {}), Object.keys(s).forEach((u) => { | ||
const a = s[u]; | ||
a === s ? f[u] = f : a !== null && typeof a == "object" ? n.push({ | ||
parent: f, | ||
key: u, | ||
data: a | ||
}) : f[u] = a; | ||
}); | ||
} | ||
return e; | ||
} | ||
const Ee = "This object was destroyed, do not use it anywhere", Se = () => !0; | ||
function Yn(t, e = Ee) { | ||
const n = () => { | ||
throw new Error(e); | ||
}; | ||
Object.keys(t).forEach((r) => { | ||
typeof t[r] == "function" ? t[r] = n.bind(t) : t[r] = null; | ||
}), Object.getOwnPropertyNames(t.constructor.prototype).forEach((r) => { | ||
r !== "constructor" && typeof t[r] == "function" && (t[r] = n.bind(t)); | ||
}), t.isDestroyed = Se; | ||
} | ||
const we = M(window) && ("ontouchstart" in window || Ae() > 0), Gn = we ? "touchstart" : "click"; | ||
function Ae() { | ||
return M(navigator) && (navigator.maxTouchPoints || navigator.msMaxTouchPoints) || 0; | ||
} | ||
const b = /* @__PURE__ */ new Map(); | ||
function qn(t) { | ||
b.has(t) || b.set(t, /* @__PURE__ */ new Set()); | ||
} | ||
function Pn(t) { | ||
var e; | ||
return (e = b.get(t)) != null ? e : b.set(t, /* @__PURE__ */ new Set()).get(t); | ||
} | ||
function Wn(t, e) { | ||
if (typeof e == "string" && (e = [e]), Array.isArray(e)) | ||
for (let n = 0, r = e.length; n < r; ++n) { | ||
const o = e[n]; | ||
b.has(o) || b.set(o, /* @__PURE__ */ new Set()), b.get(o).add(t); | ||
} | ||
} | ||
function vn(t, e) { | ||
var n; | ||
if (typeof e == "string" && (e = [e]), Array.isArray(e)) | ||
for (let r = 0, o = e.length; r < o; ++r) { | ||
const i = e[r]; | ||
b.has(i) && ((n = b.get(i)) == null || n.delete(t)); | ||
} | ||
} | ||
function zn(t, e, n = window.Event) { | ||
const { type: r, bubbles: o = !1, cancelable: i = !1, ...s } = e; | ||
if (!M(r) || r === "") | ||
return !1; | ||
let c; | ||
return M(n) ? c = new n(r, { bubbles: o, cancelable: i }) : (c = document.createEvent("HTMLEvents"), c.initEvent(r, o, i)), Object.assign(c, s), t.dispatchEvent(c); | ||
} | ||
const Ne = [ | ||
"button", | ||
"[href]:not(.disabled)", | ||
"input", | ||
"select", | ||
"textarea", | ||
"[tabindex]", | ||
"[contenteditable]" | ||
].map((t) => `${t}:not(:disabled):not([disabled])`).join(", "); | ||
function z(t) { | ||
return !!t && t.nodeType === Node.ELEMENT_NODE; | ||
} | ||
function ke(t) { | ||
return z(t) ? t : document.body; | ||
} | ||
function _e(t, e) { | ||
return t ? Array.from(ke(e).querySelectorAll(t)) : []; | ||
} | ||
function jn(t) { | ||
const e = document.activeElement; | ||
return !z(t) || !e ? !1 : t === e || At(e, t); | ||
} | ||
function At(t, e) { | ||
if (!t || !e) | ||
return !1; | ||
const n = e.__transferElement; | ||
return e.contains(t) || !!n && (n === t || n.contains(t)); | ||
} | ||
function Te(t) { | ||
if (!z(t) || !t.parentNode || !At(t, document.body) || t.style.display === "none") | ||
return !0; | ||
const e = t.getBoundingClientRect(); | ||
return !(e && e.width > 0 && e.height > 0); | ||
} | ||
function $e(t) { | ||
return !Te(t); | ||
} | ||
function Re(t) { | ||
return !z(t) || t.hasAttribute("disabled") && t.getAttribute("disabled") !== "false" || t.disabled; | ||
} | ||
function Kn(t, e = !1) { | ||
const n = e ? () => !1 : Re; | ||
return _e(Ne, t).filter((r) => $e(r) && r.tabIndex > -1 && !n(r)); | ||
} | ||
const Fe = /["'&<>]/; | ||
function Qn(t) { | ||
const e = "" + t, n = Fe.exec(e); | ||
if (!n) | ||
return e; | ||
let r = "", o, i, s = 0; | ||
for (i = n.index; i < e.length; i++) { | ||
switch (e.charCodeAt(i)) { | ||
case 34: | ||
o = """; | ||
break; | ||
case 38: | ||
o = "&"; | ||
break; | ||
case 39: | ||
o = "'"; | ||
break; | ||
case 60: | ||
o = "<"; | ||
break; | ||
case 62: | ||
o = ">"; | ||
break; | ||
default: | ||
continue; | ||
} | ||
s !== i && (r += e.substring(s, i)), s = i + 1, r += o; | ||
} | ||
return s !== i ? r + e.substring(s, i) : r; | ||
} | ||
function Xn() { | ||
const t = /* @__PURE__ */ new Map(); | ||
return { | ||
on(e, n) { | ||
const r = t.get(e); | ||
(r == null ? void 0 : r.add(n)) || t.set(e, /* @__PURE__ */ new Set([n])); | ||
}, | ||
off(e, n) { | ||
const r = t.get(e); | ||
r && r.delete(n); | ||
}, | ||
clear(e) { | ||
const n = t.get(e); | ||
n && n.clear(); | ||
}, | ||
clearAll() { | ||
t.clear(); | ||
}, | ||
emit(e, ...n) { | ||
const r = t.get(e); | ||
r && r.forEach((o) => { | ||
o(...n); | ||
}); | ||
} | ||
}; | ||
} | ||
function Vn(t, e = 16) { | ||
if (typeof t != "function") | ||
return t; | ||
let n = Date.now(), r; | ||
return function(...o) { | ||
const i = Date.now(), s = n + e - i; | ||
clearTimeout(r), s <= 0 ? (t(...o), n = Date.now()) : r = window.setTimeout(() => { | ||
t(...o); | ||
}, e); | ||
}; | ||
} | ||
function Zn(t, e = 100) { | ||
if (typeof t != "function") | ||
return t; | ||
let n; | ||
return function(...r) { | ||
clearTimeout(n), n = window.setTimeout(() => { | ||
t(...r); | ||
}, e); | ||
}; | ||
} | ||
function Jn(t) { | ||
if (typeof t != "function") | ||
return t; | ||
let e = !1, n; | ||
return function(...r) { | ||
n = r, e || (e = !0, Promise.resolve().then(() => { | ||
t(...n), e = !1; | ||
})); | ||
}; | ||
} | ||
function tr(t) { | ||
if (typeof t != "function") | ||
return t; | ||
let e = !1, n; | ||
return function(...r) { | ||
n = r, e || (e = !0, requestAnimationFrame(() => { | ||
t(...n), e = !1; | ||
})); | ||
}; | ||
} | ||
const D = /* @__PURE__ */ new Set(), Nt = /* @__PURE__ */ new WeakMap(); | ||
function De() { | ||
D.forEach((t) => { | ||
t(...Nt.get(t)); | ||
}), D.clear(); | ||
} | ||
function er(t, ...e) { | ||
if (typeof t != "function") | ||
return t; | ||
Nt.set(t, e), !D.has(t) && (D.add(t), D.size === 1 && Promise.resolve().then(De)); | ||
} | ||
const O = /* @__PURE__ */ new Set(), kt = /* @__PURE__ */ new WeakMap(); | ||
function Oe() { | ||
O.forEach((t) => { | ||
t(...kt.get(t)); | ||
}), O.clear(); | ||
} | ||
function nr(t, ...e) { | ||
if (typeof t != "function") | ||
return t; | ||
kt.set(t, e), !O.has(t) && (O.add(t), O.size === 1 && requestAnimationFrame(Oe)); | ||
} | ||
let Q = null; | ||
function rr() { | ||
if (!window || !document) | ||
return !0; | ||
if (Q === null) { | ||
const t = document.createElement("div"); | ||
t.style.display = "flex", t.style.flexDirection = "column", t.style.rowGap = "1px", t.appendChild(document.createElement("div")), t.appendChild(document.createElement("div")), document.body.appendChild(t), Q = t.scrollHeight === 1, document.body.removeChild(t); | ||
} | ||
return Q; | ||
} | ||
function or(t, e, n = (r) => r) { | ||
const r = {}; | ||
if (!M(e)) | ||
return r; | ||
const o = Gt(e) ? e : (i) => i[e]; | ||
return t.forEach((i) => { | ||
const s = o(i); | ||
M(s) && (r[s] = n(i)); | ||
}), r; | ||
} | ||
function ir(t, e, n = !1) { | ||
let r = -1; | ||
return n || typeof e != "function" ? r = t.findIndex((o) => o === e) : r = t.findIndex(e), ~r ? t.splice(r, 1)[0] : null; | ||
} | ||
function sr(t, e = []) { | ||
(typeof e == "string" || typeof e == "function") && (e = [e]); | ||
const n = e.length, r = {}; | ||
for (const o of t) { | ||
let i; | ||
for (let s = 0; s < n; ++s) { | ||
const c = s === n - 1, f = e[s], u = typeof f == "function" ? f(o) : o[f]; | ||
i ? (i[u] || (i[u] = c ? [] : {}), i = i[u]) : (r[u] || (r[u] = c ? [] : {}), i = r[u]); | ||
} | ||
i.push(o); | ||
} | ||
return r; | ||
} | ||
function cr(t, e = {}) { | ||
const { | ||
keyField: n = "id", | ||
childField: r = "children", | ||
parentField: o = "parent", | ||
rootId: i = null | ||
} = e, s = M(i) && i !== "", c = [], f = /* @__PURE__ */ new Map(); | ||
for (let u = 0, a = t.length; u < a; ++u) { | ||
const d = t[u], h = d[n]; | ||
if (!(s ? h === i : !h)) | ||
if (f.has(h) ? d[r] = f.get(h) : (d[r] = [], f.set(h, d[r])), d[o] && (!s || d[o] !== i)) { | ||
const y = d[o]; | ||
f.has(y) || f.set(y, []), f.get(y).push(d); | ||
} else | ||
c.push(d); | ||
} | ||
return c; | ||
} | ||
function fr(t, e = {}) { | ||
const { | ||
keyField: n = "id", | ||
childField: r = "children", | ||
parentField: o = "parent", | ||
rootId: i = null | ||
} = e, s = M(i) && i !== "", c = [], f = [...t]; | ||
let u = 1; | ||
for (; f.length; ) { | ||
const a = f.shift(); | ||
let d = []; | ||
const h = a[r]; | ||
Array.isArray(h) && h.length && (d = h), a[n] || (a[n] = u++); | ||
const y = a[n]; | ||
(s ? a[o] === i : !a[o]) && (a[o] = i); | ||
for (let j = 0, _t = d.length; j < _t; ++j) { | ||
const et = d[j]; | ||
et[o] = y, f.push(et); | ||
} | ||
c.push(a); | ||
} | ||
return c; | ||
} | ||
const at = (t, e) => Number.isNaN(Number(t) - Number(e)) ? String(t).localeCompare(e) : t - e; | ||
function ar(t, e) { | ||
if (!t.sort || q(e) && !e.key || !e.length) | ||
return t; | ||
const n = Array.from(t); | ||
Array.isArray(e) || (e = [e]); | ||
const r = e.map((o) => typeof o == "string" ? { | ||
key: o, | ||
method: at, | ||
type: "asc" | ||
} : o).map((o) => (typeof o.accessor != "function" && (o.accessor = (i) => i[o.key]), typeof o.method != "function" && (o.method = at), o.params = Array.isArray(o.params) ? o.params : [], o)); | ||
return n.sort((o, i) => { | ||
let s = 0; | ||
for (const c of r) { | ||
const { method: f, type: u, accessor: a, params: d } = c, h = u === "desc", y = f(a(o, ...d), a(i, ...d)); | ||
if (s = h ? -y : y, s) | ||
break; | ||
} | ||
return s; | ||
}), n; | ||
} | ||
function ur(t, e, n = !0) { | ||
t = n ? Me(t) : t; | ||
const r = [ | ||
{ | ||
source: t, | ||
target: e | ||
} | ||
]; | ||
for (; r.length; ) { | ||
const { source: o, target: i } = r.pop(); | ||
Object.keys(i).forEach((s) => { | ||
q(i[s]) ? (q(o[s]) || (o[s] = {}), r.push({ | ||
source: o[s], | ||
target: i[s] | ||
})) : Array.isArray(i[s]) ? (Array.isArray(o[s]) || (o[s] = []), r.push({ | ||
source: o[s], | ||
target: i[s] | ||
})) : o[s] = i[s]; | ||
}); | ||
} | ||
return t; | ||
} | ||
function lr(t) { | ||
return t.charAt(0).toLowerCase() + t.slice(1).replace(/([A-Z])/g, "-$1").toLowerCase(); | ||
} | ||
function xe(t) { | ||
return t.charAt(0).toUpperCase() + t.slice(1).replace(/-(\w)/g, (e, n) => n ? n.toUpperCase() : ""); | ||
} | ||
function dr(t) { | ||
const e = xe(t); | ||
return e.charAt(0).toLowerCase() + e.slice(1); | ||
} | ||
export { | ||
Gn as CLICK_TYPE, | ||
Ft as COLOR_NAMES, | ||
St as DAY_ON_HOURS, | ||
Qt as DAY_ON_MILLIS, | ||
jt as DAY_ON_MINUTES, | ||
Kt as DAY_ON_SECONDS, | ||
bt as HEX_REG_3, | ||
mt as HEX_REG_4, | ||
yt as HEX_REG_6, | ||
Mt as HEX_REG_8, | ||
zt as HOUR_ON_MILLS, | ||
v as HOUR_ON_MINUTES, | ||
vt as HOUR_ON_SECONDS, | ||
ht as HSLA_REG, | ||
dt as HSL_REG, | ||
pt as HSVA_REG, | ||
gt as HSV_REG, | ||
Wt as MINUTE_ON_MILLS, | ||
I as MINUTE_ON_SECONDS, | ||
L as NAMED_COLORS, | ||
wt as QUARTER_ON_MONTHS, | ||
lt as RGBA_REG, | ||
ut as RGB_REG, | ||
F as SECOND_ON_MILLS, | ||
we as USE_TOUCH, | ||
V as WEEK_ON_DAYS, | ||
Xt as WEEK_ON_HOURS, | ||
Jt as WEEK_ON_MILLIS, | ||
Vt as WEEK_ON_MINUTES, | ||
Zt as WEEK_ON_SECONDS, | ||
ee as YEAR_ON_MONTHS, | ||
te as YEAR_ON_QUARTERS, | ||
Z as addDays, | ||
En as addHalfDays, | ||
ae as addHours, | ||
se as addMilliseconds, | ||
fe as addMinutes, | ||
J as addMonths, | ||
wn as addQuarters, | ||
ce as addSeconds, | ||
Sn as addWeeks, | ||
An as addYears, | ||
Be as adjustAlpha, | ||
hn as boundRange, | ||
be as compareAsc, | ||
R as compareDesc, | ||
At as contains, | ||
fn as createBITree, | ||
qn as createEvent, | ||
Xn as createEventEmitter, | ||
Zn as debounce, | ||
tr as debounceFrame, | ||
Jn as debounceMinor, | ||
Me as deepClone, | ||
Yn as destroyObject, | ||
he as differenceDays, | ||
me as differenceFullDays, | ||
In as differenceFullHours, | ||
Cn as differenceFullMinutes, | ||
ye as differenceFullMonths, | ||
Un as differenceFullQuarters, | ||
Hn as differenceFullSeconds, | ||
Ln as differenceFullWeeks, | ||
Bn as differenceFullYears, | ||
de as differenceHours, | ||
tt as differenceMilliseconds, | ||
le as differenceMinutes, | ||
ge as differenceMonths, | ||
xn as differenceQuarters, | ||
ue as differenceSeconds, | ||
On as differenceWeeks, | ||
pe as differenceYears, | ||
m as digitLength, | ||
vn as disconnect, | ||
zn as dispatchEvent, | ||
mn as divide, | ||
A as doubleDigits, | ||
Tn as endOfDay, | ||
Qn as escapeHtml, | ||
fr as flatTree, | ||
yn as format, | ||
gn as formatByteSize, | ||
Mn as getChineseWeek, | ||
_n as getLastSunday, | ||
Pn as getObservers, | ||
X as getQuarter, | ||
sn as getType, | ||
sr as groupByProps, | ||
Ye as has, | ||
Ie as hslToHsv, | ||
Ot as hslToRgb, | ||
Le as hsvToHsl, | ||
Ht as hsvToRgb, | ||
C as is, | ||
Xe as isArray, | ||
Qe as isBigInt, | ||
ve as isBoolean, | ||
He as isColor, | ||
tn as isDate, | ||
M as isDefined, | ||
Re as isDisabled, | ||
nn as isEmpty, | ||
je as isFalse, | ||
jn as isFocusIn, | ||
Gt as isFunction, | ||
Te as isHidden, | ||
$n as isLeepYear, | ||
Je as isMap, | ||
Pe as isNaN, | ||
Ge as isNull, | ||
qe as isNumber, | ||
q as isObject, | ||
Ve as isPromise, | ||
en as isRegExp, | ||
Ze as isSet, | ||
We as isString, | ||
Ke as isSymbol, | ||
ze as isTrue, | ||
$e as isVisible, | ||
ur as mergeObjects, | ||
bn as minus, | ||
Ue as mixColor, | ||
ln as multipleFixed, | ||
nr as nextFrameOnce, | ||
er as nextTickOnce, | ||
rn as noop, | ||
k as normalizeAlpha, | ||
U as normalizeHsl, | ||
B as normalizeHsv, | ||
_ as normalizeRgb, | ||
Wn as observe, | ||
Ce as parseColor, | ||
N as parseColorToRgba, | ||
Dt as parseStringColor, | ||
pn as plus, | ||
_e as queryAll, | ||
Kn as queryTabables, | ||
cn as randomString, | ||
on as range, | ||
Nn as rangeDate, | ||
kn as rangeMonth, | ||
ir as removeArrayItem, | ||
It as rgbToHex, | ||
xt as rgbToHsl, | ||
Ct as rgbToHsv, | ||
Lt as rgbaToHex, | ||
dn as round, | ||
un as segmentNumber, | ||
ar as sortByProps, | ||
ct as startOfDay, | ||
st as startOfHour, | ||
it as startOfMinute, | ||
Rn as startOfMonth, | ||
Fn as startOfQuarter, | ||
ot as startOfSecond, | ||
ft as startOfWeek, | ||
Dn as startOfYear, | ||
rr as supportFlexGap, | ||
Vn as throttle, | ||
x as times, | ||
dr as toCamelCase, | ||
xe as toCapitalCase, | ||
l as toDate, | ||
qt as toFixed, | ||
lr as toKebabCase, | ||
an as toNumber, | ||
Et as toPrecision, | ||
or as transformListToMap, | ||
cr as transformTree | ||
}; | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const pt="[-\\+]?\\d+%?",bt="[-\\+]?\\d*\\.\\d+%?",M=`(?:${bt})|(?:${pt})`,mt=`[\\s|\\(]+(${M})[,|\\s]+(${M})[,|\\s]+(${M})\\s*\\)?`,G=`[\\s|\\(]+(${M})[,|\\s]+(${M})[,|\\s]+(${M})[,|\\s]+(${M})\\s*\\)?`,ie=new RegExp(`rgb${mt}`),ae=new RegExp(`rgba${G}`),ce=new RegExp(`hsl${G}`),fe=new RegExp(`hsla${G}`),ue=new RegExp(`hsv${G}`),le=new RegExp(`hsva${G}`),de=/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ge=/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,he=/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,pe=/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,I=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),Ae=Object.freeze(new Set(Object.keys(I)));function yt(e){return e=String(e).trim().toLowerCase(),e?e==="transparent"||I[e]?!0:e==="transparent"||Ae.has(e)||ie.test(e)||ae.test(e)||ce.test(e)||fe.test(e)||ue.test(e)||le.test(e)||de.test(e)||ge.test(e)||he.test(e)||pe.test(e):!1}function Oe(e){if(e=e.toString().trim().toLowerCase(),e==="transparent")return{r:0,g:0,b:0,a:0,format:"name",toString:h};let t=!1;I[e]&&(e=I[e],t=!0);let n;if(n=ie.exec(e)){const{r,g:o,b:s}=O(n[1],n[2],n[3]);return{r:r*255,g:o*255,b:s*255,format:"rgb",toString:h}}if(n=ae.exec(e)){const{r,g:o,b:s}=O(n[1],n[2],n[3]);return{r:r*255,g:o*255,b:s*255,a:A(n[4]),format:"rgba",toString:h}}if(n=ce.exec(e)){const{h:r,s:o,l:s}=L(n[0],n[1],n[3]);return{h:r*360,s:o,l:s,format:"hsl",toString:v}}if(n=fe.exec(e)){const{h:r,s:o,l:s}=L(n[0],n[1],n[3]);return{h:r*360,s:o,l:s,a:A(n[4]),format:"hsla",toString:v}}if(n=ue.exec(e)){const{h:r,s:o,v:s}=U(n[0],n[1],n[3]);return{h:r*360,s:o,v:s,format:"hsv",toString:W}}if(n=le.exec(e)){const{h:r,s:o,v:s}=U(n[0],n[1],n[3]);return{h:r*360,s:o,v:s,a:A(n[4]),format:"hsva",toString:W}}return(n=de.exec(e))?{r:parseInt(`${n[1]}${n[1]}`,16),g:parseInt(`${n[2]}${n[2]}`,16),b:parseInt(`${n[3]}${n[3]}`,16),format:t?"name":"hex3",toString:h}:(n=ge.exec(e))?{r:parseInt(`${n[1]}${n[1]}`,16),g:parseInt(`${n[2]}${n[2]}`,16),b:parseInt(`${n[3]}${n[3]}`,16),a:Se(`${n[4]}${n[4]}`),format:t?"name":"hex4",toString:h}:(n=he.exec(e))?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),format:t?"name":"hex6",toString:h}:(n=pe.exec(e))?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:Se(n[4]),format:t?"name":"hex8",toString:h}:null}function Et(e){const{a:t,...n}=S(e);delete n.format;const r=Re(n.r,n.g,n.b),o=De(n.r,n.g,n.b),s=He(n.r,n.g,n.b),i=Fe(n.r,n.g,n.b,t);return{rgb:n,hsl:r,hsv:o,hex:s,alpha:t,rgba:{...n,a:t,format:"rgba"},hsla:{...r,a:t,format:"hsla"},hsva:{...o,a:t,format:"hsva"},hex8:i,origin:e}}function S(e){let t={r:0,g:0,b:0},n=1,r;return typeof e=="string"?r=Oe(e):r=e,r!==null&&typeof r=="object"&&("l"in r?t=Te(r.h,r.s,r.l):"v"in r&&(t=we(r.h,r.s,r.v)),r.a&&(n=A(r.a),Number.isNaN(n)&&(n=1)),t=r),{...t,a:n,format:"rgba",toString:h}}function L(e,t,n){return{h:p(e,0,360)/360,s:p(D(t)?H(t):t,0,1),l:p(D(n)?H(n):n,0,1)}}function O(e,t,n){return{r:p(e,0,255)/255,g:p(t,0,255)/255,b:p(n,0,255)/255}}function U(e,t,n){return{h:p(e,0,360)/360,s:p(D(t)?H(t):t,0,1),v:p(D(n)?H(n):n,0,1)}}function A(e){return p(D(e)?H(e):e,0,1)}function Te(e,t,n){let r,o,s;if({h:e,s:t,l:n}=L(e,t,n),t===0)r=o=s=n;else{const i=n<.5?1*(1+t):n+t-n*t,a=2*n-i;r=J(a,i,e+1/3),o=J(a,i,e),s=J(a,i,e-1/3)}return r*=255,o*=255,s*=255,{r,g:o,b:s,toString:h}}function Re(e,t,n){({r:e,g:t,b:n}=O(e,t,n));const r=Math.max(e,t,n),o=Math.min(e,t,n);let s,i;const a=(r+o)/2;if(r===o)s=i=0;else{const c=r-o;switch(i=a>.5?c/(2-r-o):c/(r+o),r){case e:{s=(t-n)/c+(t<n?6:0);break}case t:{s=(n-e)/c+2;break}case n:{s=(e-t)/c+4;break}default:s=0}s*=60}return{h:s,s:i,l:a,toString:v}}function Mt(e,t,n){({h:e,s:t,l:n}=L(e,t,n));const r=.5*(2*n+t*(1-Math.abs(2*n-1)));return t=2*(r-n)/r,{h:e*360,s:t,v:r,toString:W}}function St(e,t,n){({h:e,s:t,v:n}=U(e,t,n));const r=.5*n*(2-t);return t=n*t/(1-Math.abs(2*r-1)),{h:e*360,s:t,l:r,toString:v}}function we(e,t,n){({h:e,s:t,v:n}=U(e,t,n)),e*=6;const r=Math.floor(e),o=e-r,s=n*(1-t),i=n*(1-o*t),a=n*(1-(1-o)*t),c=r%6;let u=[n,i,s,s,a,n][c],f=[a,n,n,i,s,s][c],d=[s,s,a,n,n,i][c];return u*=255,f*=255,d*=255,{r:u,g:f,b:d,toString:h}}function De(e,t,n){({r:e,g:t,b:n}=O(e,t,n));const r=Math.max(e,t,n),o=Math.min(e,t,n);let s;const i=r,a=r-o,c=r===0?0:a/r;if(r===o)s=0;else{switch(r){case e:{s=(t-n)/a+(t<n?6:0);break}case t:{s=(n-e)/a+2;break}case n:{s=(e-t)/a+4;break}default:s=0}s*=60}return{h:s,s:c,v:i,toString:W}}function He(e,t,n,r=!1){({r:e,g:t,b:n}=O(e,t,n));const o=[_(Math.round(e*255).toString(16)),_(Math.round(t*255).toString(16)),_(Math.round(n*255).toString(16))];return r&&N(o[0])&&N(o[1])&&N(o[2])?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):"#"+o.join("")}function Fe(e,t,n,r,o=!1){({r:e,g:t,b:n}=O(e,t,n));const s=[_(Math.round(e*255).toString(16)),_(Math.round(t*255).toString(16)),_(Math.round(n*255).toString(16)),_(At(A(r)))];return o&&N(s[0])&&N(s[1])&&N(s[2])&&N(s[3])?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):"#"+s.join("")}function _t(e,t,n=.5){if(!e&&!t)return{r:0,g:0,b:0,a:1};if(!e)return S(t);if(!t)return S(e);const r=S(e),o=S(t),s=p(n,0,1),i=s*2-1,a=r.a-o.a,u=((i*a===-1?i:(i+a)/(1+i*a))+1)/2,f=1-u;return{r:Math.round(r.r*u+o.r*f),g:Math.round(r.g*u+o.g*f),b:Math.round(r.b*u+o.b*f),a:Math.round(r.a*s+o.a*(1-s)),format:"rgba",toString:h}}function Nt(e,t){const n=S(e);return n.a=A(D(t)?H(t):t),n}function _(e){return e.length===1?`0${e}`:e.toString()}function N(e){return e.charAt(0)===e.charAt(1)}function At(e){return Math.round(parseFloat(e)*255).toString(16)}function Se(e){return parseInt(e,16)/255}function p(e,t,n){return Math.max(t,Math.min(n,parseFloat(e)))}function J(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function D(e){return e.toString().trim().includes("%")}function H(e){const t=parseFloat(e)/100;return Number.isNaN(t)?0:t}function h(){return this.a&&this.a>=0&&this.a<1?`rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`:`rgb(${this.r}, ${this.g}, ${this.b})`}function v(){return this.a&&this.a>=0&&this.a<1?`hsla(${this.h}, ${this.s}, ${this.l}, ${this.a})`:`hsl(${this.h}, ${this.s}, ${this.l})`}function W(){return this.a&&this.a>=0&&this.a<1?`hsva(${this.h}, ${this.s}, ${this.v}, ${this.a})`:`hsv(${this.h}, ${this.s}, ${this.v})`}const Ot=Object.prototype.toString,Tt=Object.prototype.hasOwnProperty;function k(e,t){return Ot.call(e)===`[object ${t}]`}function Rt(e,t){return Tt.call(e,t)}function T(e){return e!=null}function wt(e){return e==null}function Dt(e){return typeof e=="number"}function Ht(e){return Number.isNaN(e)}function Ft(e){return typeof e=="string"}function kt(e){return typeof e=="boolean"}function Ct(e){return e===!0}function $t(e){return e===!1}function xt(e){return typeof e=="symbol"}function It(e){return typeof e=="bigint"}function Lt(e){return Array.isArray(e)}function Y(e){return k(e,"Object")}function Ut(e){return!!e&&typeof e.then=="function"&&typeof e.catch=="function"}function ke(e){return typeof e=="function"}function Yt(e){return k(e,"Set")}function Gt(e){return k(e,"Map")}function Bt(e){return k(e,"Date")}function vt(e){return k(e,"RegExp")}function Wt(e){return Array.isArray(e)||typeof e=="string"?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Y(e)?Object.keys(e).length===0:!1}function Pt(){}function qt(e,t=1,n=1){const r=[];for(let o=0;o<e;++o)r.push(t+o*n);return r}function zt(e){return Object.prototype.toString.call(e).slice(8,-1)}function jt(e=16){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",n=t.length;let r="";for(;e--;)r+=t.charAt(Math.floor(Math.random()*n));return r}function _e(e){return e&-e}function Kt(e,t=0){const n=new Array(e+1).fill(0);function r(a,c){if(!(!c||a>=e))for(a+=1;a<=e;)n[a]+=c,a+=_e(a)}function o(a=e){if(a<=0)return 0;a>e&&(a=e);let c=a*t;for(;a>0;)c+=n[a],a-=_e(a);return c}function s(a){return o(a+1)-o(a)}function i(a){let c=0,u=e;for(;u>c;){const f=Math.floor((c+u)/2),d=o(f);if(d>a){u=f;continue}else if(d<a){if(c===f)return o(c+1)<=a?c+1:c;c=f}else return f}return c}return{add:r,sum:o,get:s,boundIndex:i}}function Qt(e){const t=parseFloat(e);return Number.isNaN(t)?0:t}function E(e){return e<10?`0${e}`:e.toString()}function Xt(e,t=3,n=","){if(typeof e!="number"&&(e=parseFloat(e)),Number.isNaN(e))return"0";let[r,o]=String(e).split(".");const s=new RegExp(`(\\d+)(\\d{${t}})`);for(;s.test(r);)r=r.replace(s,`$1${n}$2`);return o=o?`.${o}`:"",`${r}${o}`}function Ce(e,t){if(t===0)return Math.round(e);let n=String(e);const r=n.indexOf(".");if(r===-1)return e;const o=n.replace(".","").split(""),s=r+t;return o[s]?(n.charAt(s+1)==="5"?n=n.substring(0,s+1)+"6":n=n.substring(0,s+2),parseFloat(Number(n).toFixed(t))):e}function Vt(e,t,n){return Ce(e*t,n)}function Zt(e,t){if(t<0||t>1)return Math.round(e);const n=Math.ceil(e);return e+t>=n?n:Math.floor(e)}function Jt(e,t,n){return Math.max(t,Math.min(n,parseFloat(e)))}const en=Object.freeze(["B","KB","MB","GB","TB","AUTO"]);function tn(e,t="AUTO"){let n=t.toUpperCase();n=en.includes(n)?n:"AUTO";let r;switch(n){case"AUTO":r=0;break;case"KB":r=1;break;case"MB":r=2;break;case"GB":r=3;break;case"TB":r=4;break;default:return e}let o;if(r)o=e/1024**r;else for(o=e;o>1024&&!(r>4);++r)o=o/1024;return o}function b(e){const t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function be(e,t=15){return+parseFloat(Number(e).toPrecision(t))}function P(e){const t=String(e);if(!t.includes("e"))return Number(t.replace(".",""));const n=b(e);return n>0?be(Number(e)*10**n):Number(e)}function z(e){return(...t)=>{let n=t[0];for(let r=1,o=t.length;r<o;++r)n=e(n,t[r]);return n}}const F=z((e,t)=>{const n=P(e),r=P(t),o=b(e)+b(t);return n*r/10**o}),nn=z((e,t)=>{const n=10**Math.max(b(e),b(t));return(F(e,n)+F(t,n))/n}),rn=z((e,t)=>{const n=10**Math.max(b(e),b(t));return(F(e,n)-F(t,n))/n}),on=z((e,t)=>{const n=P(e),r=P(t);return F(n/r,be(10**(b(t)-b(e))))}),w=1e3,C=60,$e=C*w,B=60,xe=B*C,Ie=xe*w,me=24,Le=me*B,Ue=Le*C,Ye=Ue*w,j=7,Ge=j*me,Be=Ge*B,ve=Be*C,We=ve*w,ye=3,Pe=4,qe=Pe*ye,sn={y(e,t){const n=e.getFullYear();return t.length===4?n:n%1e3%100},M(e,t){const n=e.getMonth()+1;return t.length===2?E(n):n},d(e,t){const n=e.getDate();return t.length===2?E(n):n},H(e,t){const n=e.getHours();return t.length===2?E(n):n},m(e,t){const n=e.getMinutes();return t.length===2?E(n):n},s(e,t){const n=e.getSeconds();return t.length===2?E(n):n},q(e,t){const n=Math.ceil((e.getMonth()+1)/3);return t.length===2?E(n):n}},an=/[yMdHmsq](\w)*|./g,cn=/'(.+?)'/g;function l(e,t=!1){const n=new Date(e);if(t&&Number.isNaN(+n))throw new RangeError("Invalid date value");return n}function fn(e,t="yyyy-MM-dd HH:mm:ss"){e=l(e);const n=t.match(an),r=n==null?void 0:n.length;if(!r)return t;let o=0,s="";for(;o<r;){const i=n[o],a=i[0],c=sn[a];c?s+=c(e,i):s+=i,++o}return s.replace(cn,"$1")}function q(e){return e=l(e),Math.floor(e.getMonth()/3)+1}const un=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"];function ln(e){return un[e.getDay()]}function ze(e,t){return e=l(e),e.setTime(e.getTime()+t),e}function je(e,t){return t*=w,ze(e,t)}function Ke(e,t){return t*=C,je(e,t)}function Qe(e,t){return t*=B,Ke(e,t)}function dn(e,t){return t*=12,Qe(e,t)}function K(e,t){return e=l(e),t=~~t,e.setDate(e.getDate()+t),e}function gn(e,t){return t*=j,K(e,t)}function Q(e,t){return e=l(e),t=~~t,e.setMonth(e.getMonth()+t),e}function hn(e,t){return t*=ye,Q(e,t)}function pn(e,t){return t*=qe,Q(e,t)}function bn(e,t=42,n=1){e=l(e);const r=[];for(let o=0;o<t;++o)r.push(K(e,o*n));return r}function mn(e,t=12,n=1){e=l(e);const r=[];for(let o=0;o<t;++o)r.push(Q(e,o*n));return r}function yn(e){var n;const t=(n=e.getDay())!=null?n:7;return K(e,-t)}function te(e){return e=l(e),e.setMilliseconds(0),e}function ne(e){return e=l(e),e.setSeconds(0,0),e}function re(e){return e=l(e),e.setMinutes(0,0,0),e}function oe(e){return e=l(e),e.setHours(0,0,0,0),e}function En(e){return e=l(e),e.setHours(23,59,59,999),e}function se(e,t=0){t=t%7,t<0&&(t+=7),e=l(e);const n=e.getDay(),r=(n<t?7:0)+n-t;return e.setDate(e.getDate()-r),e.setHours(0,0,0,0),e}function Mn(e){return e%4===0&&e%100!==0||e%400===0}function Sn(e,t=1){e=l(e);const n=e.getFullYear(),r=e.getMonth()+1,o=e.getDate(),s=n%4===0&&n%100!==0||n%400===0;let i;return r<7?r!==2?i=30+r%2:s?i=29:i=28:i=31-r%2,t=t%i,t<0&&(t+=i),o<t&&e.setMonth(r-1),e.setDate(t),e.setHours(0,0,0,0),e}function _n(e){e=l(e);const t=q(e);return e.setDate(1),e.setHours(0,0,0,0),e.setMonth((t-1)*3),e}function Nn(e,t=0){t=t%11,t<0&&(t+=11),e=l(e);const n=e.getMonth(),r=(n<t?11:0)+n-t;return e.setMonth(e.getMonth()-r),e.setDate(1),e.setHours(0,0,0,0),e}function X(e,t){return e=l(e),t=l(t),t.getTime()-e.getTime()}function Xe(e,t){const n=X(e,t)/w;return n>0?Math.floor(n):Math.ceil(n)}function Ve(e,t){const n=X(e,t)/$e;return n>0?Math.floor(n):Math.ceil(n)}function Ze(e,t){const n=X(e,t)/Ie;return n>0?Math.floor(n):Math.ceil(n)}function Je(e,t){return e=oe(e),t=oe(t),(t.getTime()-e.getTime())/Ye}function An(e,t,n=0){return e=se(e,n),t=se(t,n),(t.getTime()-e.getTime())/We}function et(e,t){e=l(e),t=l(t);const n=t.getFullYear()-e.getFullYear(),r=t.getMonth()-e.getMonth();return n*12+r}function On(e,t){e=l(e),t=l(t);const n=t.getFullYear()-e.getFullYear(),r=q(t)-q(e);return n*4+r}function tt(e,t){return e=l(e),t=l(t),t.getFullYear()-e.getFullYear()}function nt(e,t){e=l(e),t=l(t);const n=e.getTime()-t.getTime();return n<0?-1:n>0?1:n}function R(e,t){return-nt(e,t)}function Tn(e,t){return e=te(e),t=te(t),Xe(e,t)}function Rn(e,t){return e=ne(e),t=ne(t),Ve(e,t)}function wn(e,t){return e=re(e),t=re(t),Ze(e,t)}function rt(e,t){const n=R(e,t),r=Math.abs(Je(e,t));e=l(e),e.setDate(e.getDate()+n*r);const o=R(e,t)===-n;return n*(r-(o?1:0))}function Dn(e,t){const n=rt(e,t)/j;return n>0?Math.floor(n):Math.ceil(n)}function ot(e,t){const n=R(e,t),r=Math.abs(et(e,t));e=l(e),e.setMonth(e.getMonth()+n*r);const o=R(e,t)===-n;return n*(r-(o?1:0))}function Hn(e,t){const n=ot(e,t)/3;return n>0?Math.floor(n):Math.ceil(n)}function Fn(e,t){const n=R(e,t),r=Math.abs(tt(e,t));e=l(e),e.setFullYear(e.getFullYear()+n*r);const o=R(e,t)===-n;return n*(r-(o?1:0))}function st(e){if(e===null||typeof e!="object")return e;const t=Array.isArray(e)?[]:{},n=[{parent:t,key:void 0,data:e}];for(;n.length;){const r=n.pop(),{parent:o,key:s,data:i}=r,a=Array.isArray(i)?"array":"object";if(!o)continue;let c=o;typeof s<"u"&&(c=o[s]=a==="array"?[]:{}),Object.keys(i).forEach(u=>{const f=i[u];f===i?c[u]=c:f!==null&&typeof f=="object"?n.push({parent:c,key:u,data:f}):c[u]=f})}return t}const kn="This object was destroyed, do not use it anywhere",Cn=()=>!0;function $n(e,t=kn){const n=()=>{throw new Error(t)};Object.keys(e).forEach(r=>{typeof e[r]=="function"?e[r]=n.bind(e):e[r]=null}),Object.getOwnPropertyNames(e.constructor.prototype).forEach(r=>{r!=="constructor"&&typeof e[r]=="function"&&(e[r]=n.bind(e))}),e.isDestroyed=Cn}const it=typeof window<"u"&&("ontouchstart"in window||In()>0),xn=it?"touchstart":"click";function In(){return typeof navigator<"u"&&(navigator.maxTouchPoints||navigator.msMaxTouchPoints)||0}const m=new Map;function Ln(e){m.has(e)||m.set(e,new Set)}function Un(e){var t;return(t=m.get(e))!=null?t:m.set(e,new Set).get(e)}function Yn(e,t){if(typeof t=="string"&&(t=[t]),Array.isArray(t))for(let n=0,r=t.length;n<r;++n){const o=t[n];m.has(o)||m.set(o,new Set),m.get(o).add(e)}}function Gn(e,t){var n;if(typeof t=="string"&&(t=[t]),Array.isArray(t))for(let r=0,o=t.length;r<o;++r){const s=t[r];m.has(s)&&((n=m.get(s))==null||n.delete(e))}}function Bn(e,t,n=window.Event){const{type:r,bubbles:o=!1,cancelable:s=!1,...i}=t;if(!T(r)||r==="")return!1;let a;return T(n)?a=new n(r,{bubbles:o,cancelable:s}):(a=document.createEvent("HTMLEvents"),a.initEvent(r,o,s)),Object.assign(a,i),e.dispatchEvent(a)}const vn=["button","[href]:not(.disabled)","input","select","textarea","[tabindex]","[contenteditable]"].map(e=>`${e}:not(:disabled):not([disabled])`).join(", ");function V(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}function Wn(e){return V(e)?e:document.body}function at(e,t){return e?Array.from(Wn(t).querySelectorAll(e)):[]}function Pn(e){const t=document.activeElement;return!V(e)||!t?!1:e===t||Ee(t,e)}function Ee(e,t){if(!e||!t)return!1;const n=t.__transferElement;return t.contains(e)||!!n&&(n===e||n.contains(e))}function ct(e){if(!V(e)||!e.parentNode||!Ee(e,document.body)||e.style.display==="none")return!0;const t=e.getBoundingClientRect();return!(t&&t.width>0&&t.height>0)}function ft(e){return!ct(e)}function ut(e){return!V(e)||e.hasAttribute("disabled")&&e.getAttribute("disabled")!=="false"||e.disabled}function qn(e,t=!1){const n=t?()=>!1:ut;return at(vn,e).filter(r=>ft(r)&&r.tabIndex>-1&&!n(r))}const zn=/["'&<>]/;function jn(e){const t=""+e,n=zn.exec(t);if(!n)return t;let r="",o,s,i=0;for(s=n.index;s<t.length;s++){switch(t.charCodeAt(s)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}i!==s&&(r+=t.substring(i,s)),i=s+1,r+=o}return i!==s?r+t.substring(i,s):r}function Kn(){const e=new Map;return{on(t,n){const r=e.get(t);(r==null?void 0:r.add(n))||e.set(t,new Set([n]))},off(t,n){const r=e.get(t);r&&r.delete(n)},clear(t){const n=e.get(t);n&&n.clear()},clearAll(){e.clear()},emit(t,...n){const r=e.get(t);r&&r.forEach(o=>{o(...n)})}}}function Qn(e,t=16){if(typeof e!="function")return e;let n=Date.now(),r;return function(...o){const s=Date.now(),i=n+t-s;clearTimeout(r),i<=0?(e(...o),n=Date.now()):r=setTimeout(()=>{e(...o)},t)}}function Xn(e,t=100){if(typeof e!="function")return e;let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Vn(e){if(typeof e!="function")return e;let t=!1,n;return function(...r){n=r,t||(t=!0,Promise.resolve().then(()=>{e(...n),t=!1}))}}function Zn(e){if(typeof e!="function")return e;let t=!1,n;return function(...r){n=r,t||(t=!0,requestAnimationFrame(()=>{e(...n),t=!1}))}}const $=new Set,lt=new WeakMap;function Jn(){$.forEach(e=>{e(...lt.get(e))}),$.clear()}function er(e,...t){if(typeof e!="function")return e;lt.set(e,t),!$.has(e)&&($.add(e),$.size===1&&Promise.resolve().then(Jn))}const x=new Set,dt=new WeakMap;function tr(){x.forEach(e=>{e(...dt.get(e))}),x.clear()}function nr(e,...t){if(typeof e!="function")return e;dt.set(e,t),!x.has(e)&&(x.add(e),x.size===1&&requestAnimationFrame(tr))}let ee=null;function rr(){if(!window||!document)return!0;if(ee===null){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),ee=e.scrollHeight===1,document.body.removeChild(e)}return ee}function or(e,t,n=r=>r){const r={};if(!T(t))return r;const o=ke(t)?t:s=>s[t];return e.forEach(s=>{const i=o(s);T(i)&&(r[i]=n(s))}),r}function sr(e,t,n=!1){let r=-1;return n||typeof t!="function"?r=e.findIndex(o=>o===t):r=e.findIndex(t),~r?e.splice(r,1)[0]:null}function ir(e,t=[]){(typeof t=="string"||typeof t=="function")&&(t=[t]);const n=t.length,r={};for(const o of e){let s;for(let i=0;i<n;++i){const a=i===n-1,c=t[i],u=typeof c=="function"?c(o):o[c];s?(s[u]||(s[u]=a?[]:{}),s=s[u]):(r[u]||(r[u]=a?[]:{}),s=r[u])}s.push(o)}return r}function ar(e,t={}){const{keyField:n="id",childField:r="children",parentField:o="parent",rootId:s=null}=t,i=T(s)&&s!=="",a=[],c=new Map;for(let u=0,f=e.length;u<f;++u){const d=e[u],g=d[n];if(!(i?g===s:!g))if(c.has(g)?d[r]=c.get(g):(d[r]=[],c.set(g,d[r])),d[o]&&(!i||d[o]!==s)){const y=d[o];c.has(y)||c.set(y,[]),c.get(y).push(d)}else a.push(d)}return a}function cr(e,t={}){const{keyField:n="id",childField:r="children",parentField:o="parent",rootId:s=null}=t,i=T(s)&&s!=="",a=[],c=[...e];let u=1;for(;c.length;){const f=c.shift();let d=[];const g=f[r];Array.isArray(g)&&g.length&&(d=g),f[n]||(f[n]=u++);const y=f[n];(i?f[o]===s:!f[o])&&(f[o]=s);for(let Z=0,ht=d.length;Z<ht;++Z){const Me=d[Z];Me[o]=y,c.push(Me)}a.push(f)}return a}const Ne=(e,t)=>Number.isNaN(Number(e)-Number(t))?String(e).localeCompare(t):e-t;function fr(e,t){if(!e.sort||Y(t)&&!t.key||!t.length)return e;const n=Array.from(e);Array.isArray(t)||(t=[t]);const r=t.map(o=>typeof o=="string"?{key:o,method:Ne,type:"asc"}:o).map(o=>(typeof o.accessor!="function"&&(o.accessor=s=>s[o.key]),typeof o.method!="function"&&(o.method=Ne),o.params=Array.isArray(o.params)?o.params:[],o));return n.sort((o,s)=>{let i=0;for(const a of r){const{method:c,type:u,accessor:f,params:d}=a,g=u==="desc",y=c(f(o,...d),f(s,...d));if(i=g?-y:y,i)break}return i}),n}function ur(e,t,n=!0){e=n?st(e):e;const r=[{source:e,target:t}];for(;r.length;){const{source:o,target:s}=r.pop();Object.keys(s).forEach(i=>{Y(s[i])?(Y(o[i])||(o[i]={}),r.push({source:o[i],target:s[i]})):Array.isArray(s[i])?(Array.isArray(o[i])||(o[i]=[]),r.push({source:o[i],target:s[i]})):o[i]=s[i]})}return e}function lr(e){return e.charAt(0).toLowerCase()+e.slice(1).replace(/([A-Z])/g,"-$1").toLowerCase()}function gt(e){return e.charAt(0).toUpperCase()+e.slice(1).replace(/-(\w)/g,(t,n)=>n?n.toUpperCase():"")}function dr(e){const t=gt(e);return t.charAt(0).toLowerCase()+t.slice(1)}exports.CLICK_TYPE=xn;exports.COLOR_NAMES=Ae;exports.DAY_ON_HOURS=me;exports.DAY_ON_MILLIS=Ye;exports.DAY_ON_MINUTES=Le;exports.DAY_ON_SECONDS=Ue;exports.HEX_REG_3=de;exports.HEX_REG_4=ge;exports.HEX_REG_6=he;exports.HEX_REG_8=pe;exports.HOUR_ON_MILLS=Ie;exports.HOUR_ON_MINUTES=B;exports.HOUR_ON_SECONDS=xe;exports.HSLA_REG=fe;exports.HSL_REG=ce;exports.HSVA_REG=le;exports.HSV_REG=ue;exports.MINUTE_ON_MILLS=$e;exports.MINUTE_ON_SECONDS=C;exports.NAMED_COLORS=I;exports.QUARTER_ON_MONTHS=ye;exports.RGBA_REG=ae;exports.RGB_REG=ie;exports.SECOND_ON_MILLS=w;exports.USE_TOUCH=it;exports.WEEK_ON_DAYS=j;exports.WEEK_ON_HOURS=Ge;exports.WEEK_ON_MILLIS=We;exports.WEEK_ON_MINUTES=Be;exports.WEEK_ON_SECONDS=ve;exports.YEAR_ON_MONTHS=qe;exports.YEAR_ON_QUARTERS=Pe;exports.addDays=K;exports.addHalfDays=dn;exports.addHours=Qe;exports.addMilliseconds=ze;exports.addMinutes=Ke;exports.addMonths=Q;exports.addQuarters=hn;exports.addSeconds=je;exports.addWeeks=gn;exports.addYears=pn;exports.adjustAlpha=Nt;exports.boundRange=Jt;exports.compareAsc=nt;exports.compareDesc=R;exports.contains=Ee;exports.createBITree=Kt;exports.createEvent=Ln;exports.createEventEmitter=Kn;exports.debounce=Xn;exports.debounceFrame=Zn;exports.debounceMinor=Vn;exports.deepClone=st;exports.destroyObject=$n;exports.differenceDays=Je;exports.differenceFullDays=rt;exports.differenceFullHours=wn;exports.differenceFullMinutes=Rn;exports.differenceFullMonths=ot;exports.differenceFullQuarters=Hn;exports.differenceFullSeconds=Tn;exports.differenceFullWeeks=Dn;exports.differenceFullYears=Fn;exports.differenceHours=Ze;exports.differenceMilliseconds=X;exports.differenceMinutes=Ve;exports.differenceMonths=et;exports.differenceQuarters=On;exports.differenceSeconds=Xe;exports.differenceWeeks=An;exports.differenceYears=tt;exports.digitLength=b;exports.disconnect=Gn;exports.dispatchEvent=Bn;exports.divide=on;exports.doubleDigits=E;exports.endOfDay=En;exports.escapeHtml=jn;exports.flatTree=cr;exports.format=fn;exports.formatByteSize=tn;exports.getChineseWeek=ln;exports.getLastSunday=yn;exports.getObservers=Un;exports.getQuarter=q;exports.getType=zt;exports.groupByProps=ir;exports.has=Rt;exports.hslToHsv=Mt;exports.hslToRgb=Te;exports.hsvToHsl=St;exports.hsvToRgb=we;exports.is=k;exports.isArray=Lt;exports.isBigInt=It;exports.isBoolean=kt;exports.isColor=yt;exports.isDate=Bt;exports.isDefined=T;exports.isDisabled=ut;exports.isEmpty=Wt;exports.isFalse=$t;exports.isFocusIn=Pn;exports.isFunction=ke;exports.isHidden=ct;exports.isLeepYear=Mn;exports.isMap=Gt;exports.isNaN=Ht;exports.isNull=wt;exports.isNumber=Dt;exports.isObject=Y;exports.isPromise=Ut;exports.isRegExp=vt;exports.isSet=Yt;exports.isString=Ft;exports.isSymbol=xt;exports.isTrue=Ct;exports.isVisible=ft;exports.mergeObjects=ur;exports.minus=rn;exports.mixColor=_t;exports.multipleFixed=Vt;exports.nextFrameOnce=nr;exports.nextTickOnce=er;exports.noop=Pt;exports.normalizeAlpha=A;exports.normalizeHsl=L;exports.normalizeHsv=U;exports.normalizeRgb=O;exports.observe=Yn;exports.parseColor=Et;exports.parseColorToRgba=S;exports.parseStringColor=Oe;exports.plus=nn;exports.queryAll=at;exports.queryTabables=qn;exports.randomString=jt;exports.range=qt;exports.rangeDate=bn;exports.rangeMonth=mn;exports.removeArrayItem=sr;exports.rgbToHex=He;exports.rgbToHsl=Re;exports.rgbToHsv=De;exports.rgbaToHex=Fe;exports.round=Zt;exports.segmentNumber=Xt;exports.sortByProps=fr;exports.startOfDay=oe;exports.startOfHour=re;exports.startOfMinute=ne;exports.startOfMonth=Sn;exports.startOfQuarter=_n;exports.startOfSecond=te;exports.startOfWeek=se;exports.startOfYear=Nn;exports.supportFlexGap=rr;exports.throttle=Qn;exports.times=F;exports.toCamelCase=dr;exports.toCapitalCase=gt;exports.toDate=l;exports.toFixed=Ce;exports.toKebabCase=lr;exports.toNumber=Qt;exports.toPrecision=be;exports.transformListToMap=or;exports.transformTree=ar; |
{ | ||
"name": "@vexip-ui/utils", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"license": "MIT", | ||
"author": "qmhc", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -17,7 +16,7 @@ "private": false, | ||
], | ||
"homepage": "https://github.com/qmhc/vexip-ui/tree/main/common/config#readme", | ||
"homepage": "https://github.com/vexip-ui/vexip-ui/tree/main/common/utils#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/qmhc/vexip-ui.git", | ||
"directory": "common/config" | ||
"url": "git+https://github.com/vexip-ui/vexip-ui.git", | ||
"directory": "common/utils" | ||
}, | ||
@@ -30,4 +29,5 @@ "devDependencies": { | ||
"scripts": { | ||
"build": "vite build" | ||
"build": "vite build", | ||
"test": "vitest" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
100794
6
2521
1
No