nhanh-pure-function 4.2.2 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Canvas/Axis/OverlayGroup/billboard.d.ts +1 -1
- package/dist/File/index.d.ts +9 -0
- package/dist/Utility/index.d.ts +83 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +607 -412
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ var we = (r) => {
|
|
|
5
5
|
};
|
|
6
6
|
var Qe = (r, s, t) => s in r ? Ze(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
7
7
|
var d = (r, s, t) => Qe(r, typeof s != "symbol" ? s + "" : s, t), xe = (r, s, t) => s.has(r) || we("Cannot " + t);
|
|
8
|
-
var x = (r, s, t) => (xe(r, s, "read from private field"), t ? t.call(r) : s.get(r)), L = (r, s, t) => s.has(r) ? we("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t),
|
|
8
|
+
var x = (r, s, t) => (xe(r, s, "read from private field"), t ? t.call(r) : s.get(r)), L = (r, s, t) => s.has(r) ? we("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), _ = (r, s, t, e) => (xe(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
|
|
9
9
|
const Je = {
|
|
10
10
|
".mp3": "audio/mpeg",
|
|
11
11
|
".mp4": "video/mp4",
|
|
@@ -262,7 +262,7 @@ const Je = {
|
|
|
262
262
|
"正",
|
|
263
263
|
"载",
|
|
264
264
|
"极"
|
|
265
|
-
],
|
|
265
|
+
], Ts = ["_self", "_blank", "_parent", "_top"], De = {
|
|
266
266
|
// 北美标准尺寸 (毫米)
|
|
267
267
|
Letter: { width: 215.9, height: 279.4 },
|
|
268
268
|
// 8.5 × 11 英寸
|
|
@@ -315,7 +315,7 @@ const Je = {
|
|
|
315
315
|
C6: { width: 114, height: 162 },
|
|
316
316
|
C7: { width: 81, height: 114 },
|
|
317
317
|
C8: { width: 57, height: 81 }
|
|
318
|
-
},
|
|
318
|
+
}, Is = Object.keys(De).map(
|
|
319
319
|
(r) => ({ value: r, label: r })
|
|
320
320
|
);
|
|
321
321
|
function Wt(r, s = 500) {
|
|
@@ -328,19 +328,19 @@ function Wt(r, s = 500) {
|
|
|
328
328
|
}
|
|
329
329
|
return requestAnimationFrame(i), () => e = !1;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Ns(r, s, t, e, i = 2) {
|
|
332
332
|
let n = r, o = !1, a = 1, l = r, c = s, h = t;
|
|
333
333
|
const u = () => {
|
|
334
334
|
const P = (c - l) / h;
|
|
335
335
|
return Number(P.toFixed(i));
|
|
336
336
|
};
|
|
337
337
|
let f = u();
|
|
338
|
-
const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b,
|
|
339
|
-
const
|
|
340
|
-
return P >= b &&
|
|
341
|
-
}, y = (P, b,
|
|
342
|
-
const
|
|
343
|
-
return
|
|
338
|
+
const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b, M) => {
|
|
339
|
+
const O = [];
|
|
340
|
+
return P >= b && O.push("最小值必须小于最大值"), M <= 0 ? O.push("分段数必须为正数") : u() == 0 && O.push("数值精度过低,致使动画步长为 0"), O;
|
|
341
|
+
}, y = (P, b, M) => {
|
|
342
|
+
const O = g(P, b, M);
|
|
343
|
+
return O.length > 0 ? (console.error(`参数更新失败: ${O.join("; ")}`), !1) : (l = P, c = b, h = M, f = u(), n = m(n), !0);
|
|
344
344
|
}, w = () => {
|
|
345
345
|
o && (a = n >= c ? -1 : n <= l ? 1 : a, n = m(n + f * a), e(p(n)), requestAnimationFrame(w));
|
|
346
346
|
};
|
|
@@ -376,7 +376,7 @@ function Ke(r, s, t, e, i = 4) {
|
|
|
376
376
|
};
|
|
377
377
|
h();
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Hs(r, s, t, e) {
|
|
380
380
|
const i = (l) => 3 * (1 - l) ** 2 * l * r + 3 * (1 - l) * l ** 2 * t + l ** 3, n = (l) => 3 * (1 - l) ** 2 * l * s + 3 * (1 - l) * l ** 2 * e + l ** 3, o = (l) => 3 * r * (1 - l) * (1 - 3 * l) + 3 * t * (2 * l - 3 * l ** 2) + 3 * l ** 2, a = (l) => {
|
|
381
381
|
if (l <= 0) return 0;
|
|
382
382
|
if (l >= 1) return 1;
|
|
@@ -404,7 +404,7 @@ function Ns(r, s, t, e) {
|
|
|
404
404
|
return n(a(c));
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Fs(r, s = "image/png") {
|
|
408
408
|
try {
|
|
409
409
|
let t, e = s;
|
|
410
410
|
if (r instanceof File)
|
|
@@ -441,7 +441,7 @@ function Hs(r, s = "image/png") {
|
|
|
441
441
|
), null;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function zs(r) {
|
|
445
445
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
446
446
|
}
|
|
447
447
|
function Bs(r, s, t = 2) {
|
|
@@ -451,7 +451,7 @@ function le(r) {
|
|
|
451
451
|
const t = r.toString().split("."), e = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
452
452
|
return t.length > 1 ? e + "." + t[1] : e;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Us(r, s) {
|
|
455
455
|
const t = {
|
|
456
456
|
join: !0,
|
|
457
457
|
suffix: "",
|
|
@@ -495,10 +495,10 @@ function ce(r, s = "file") {
|
|
|
495
495
|
const t = r.split("/");
|
|
496
496
|
return t[t.length - 1].split("?")[0];
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Xs(r, s) {
|
|
499
499
|
return r = r.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), s ? r.replace(/[^a-zA-Z]+/g, "") : r;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Ys(r, s, t = ",") {
|
|
502
502
|
const e = new RegExp(
|
|
503
503
|
`(^|${t})${s}(${t}|$)`,
|
|
504
504
|
"g"
|
|
@@ -507,7 +507,7 @@ function Xs(r, s, t = ",") {
|
|
|
507
507
|
return n === o ? t : "";
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function js(r, s = !0) {
|
|
511
511
|
const t = {
|
|
512
512
|
"\b": "\\b",
|
|
513
513
|
" ": "\\t",
|
|
@@ -534,7 +534,7 @@ const It = [
|
|
|
534
534
|
["秒", 1e3],
|
|
535
535
|
["毫秒", 1]
|
|
536
536
|
];
|
|
537
|
-
function
|
|
537
|
+
function Ws(r, s) {
|
|
538
538
|
if (!Number.isFinite(r) || r < 0) return "0毫秒";
|
|
539
539
|
r = Math.round(r);
|
|
540
540
|
const t = s ? It.findIndex(([i]) => i === s) : 0, e = t === -1 ? 0 : t;
|
|
@@ -548,7 +548,7 @@ function js(r, s) {
|
|
|
548
548
|
}
|
|
549
549
|
return "0毫秒";
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function $s(r, s) {
|
|
552
552
|
if (s < 1)
|
|
553
553
|
return console.error("分割大小必须大于0"), [];
|
|
554
554
|
const t = [];
|
|
@@ -565,7 +565,7 @@ function ve(r, s = 2) {
|
|
|
565
565
|
} else return !1;
|
|
566
566
|
return !0;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function $t(r, s = 1, t = 2) {
|
|
569
569
|
if (Array.isArray(r) && r.length >= s) {
|
|
570
570
|
for (let i = 0; i < r.length; i++)
|
|
571
571
|
if (!ve(r[i], t)) return !1;
|
|
@@ -575,7 +575,7 @@ function qt(r, s = 1, t = 2) {
|
|
|
575
575
|
function qs(r, s, t) {
|
|
576
576
|
return Math.abs(r - s) <= t;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Zs(r, s) {
|
|
579
579
|
let t = !1;
|
|
580
580
|
const { x: e, y: i } = r, n = s.length;
|
|
581
581
|
for (let o = 0, a = n - 1; o < n; a = o++) {
|
|
@@ -584,7 +584,7 @@ function $s(r, s) {
|
|
|
584
584
|
}
|
|
585
585
|
return t;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Qs(r, s, t, e) {
|
|
588
588
|
const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
|
|
589
589
|
[i, o],
|
|
590
590
|
// 左上
|
|
@@ -611,7 +611,7 @@ function Zs(r, s, t, e) {
|
|
|
611
611
|
function he(r) {
|
|
612
612
|
return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Js(r) {
|
|
615
615
|
return [
|
|
616
616
|
"https:",
|
|
617
617
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -635,7 +635,7 @@ function Qs(r) {
|
|
|
635
635
|
// VPN协议,用于创建安全的网络连接
|
|
636
636
|
].some((t) => r.startsWith(t));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Ks(r) {
|
|
639
639
|
return new Promise((s, t) => {
|
|
640
640
|
if (typeof r != "string" || r.trim() === "" || !r.includes("://")) {
|
|
641
641
|
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
@@ -743,11 +743,11 @@ const it = class it {
|
|
|
743
743
|
// 缓存文件扩展名的条目,以提高性能
|
|
744
744
|
d(it, "cachedEntries", Object.entries(re));
|
|
745
745
|
let be = it;
|
|
746
|
-
const ei = /\w*(?:\[\d+\])+|\w+/g, ke = /^\w*(?:\[\d+\])+$/, Ve = /\w+|(\[\d+\])/g,
|
|
747
|
-
function
|
|
746
|
+
const ei = /\w*(?:\[\d+\])+|\w+/g, ke = /^\w*(?:\[\d+\])+$/, Ve = /\w+|(\[\d+\])/g, Ae = /\[(\d+)\]/;
|
|
747
|
+
function Oe(r) {
|
|
748
748
|
return r ? r.match(ei) || [] : [];
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function tn(r, s = 3e3) {
|
|
751
751
|
if (typeof r != "function")
|
|
752
752
|
return console.error("非函数:", r);
|
|
753
753
|
const t = window.requestIdleCallback, e = function(i) {
|
|
@@ -814,7 +814,7 @@ function Le(r, s) {
|
|
|
814
814
|
}, s);
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function en(r, s) {
|
|
818
818
|
let t = -1 / 0;
|
|
819
819
|
return function(...e) {
|
|
820
820
|
const i = performance.now();
|
|
@@ -828,9 +828,9 @@ function tn(r, s) {
|
|
|
828
828
|
}
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function sn(r, s) {
|
|
832
832
|
if (!r || !s) return r;
|
|
833
|
-
const t =
|
|
833
|
+
const t = Oe(s);
|
|
834
834
|
return t.length ? t.reduce((e, i, n) => {
|
|
835
835
|
const o = n === t.length - 1;
|
|
836
836
|
if (ke.test(i)) {
|
|
@@ -838,16 +838,16 @@ function en(r, s) {
|
|
|
838
838
|
return a.reduce((l, c, h) => {
|
|
839
839
|
if (/^\w+$/.test(c))
|
|
840
840
|
return l[c] || (h < a.length - 1 ? [] : {});
|
|
841
|
-
const u = c.match(
|
|
841
|
+
const u = c.match(Ae), f = u ? parseInt(u[1], 10) : 0, m = h === a.length - 1;
|
|
842
842
|
return m && o ? l[f] : l[f] || (m ? {} : []);
|
|
843
843
|
}, e);
|
|
844
844
|
}
|
|
845
845
|
return o ? e[i] : e[i] || {};
|
|
846
846
|
}, r) : r;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function nn(r, s, t, e) {
|
|
849
849
|
if (!r || !s) return t;
|
|
850
|
-
const i =
|
|
850
|
+
const i = Oe(s);
|
|
851
851
|
return i.length ? i.reduce((n, o, a) => {
|
|
852
852
|
const l = a === i.length - 1;
|
|
853
853
|
if (ke.test(o)) {
|
|
@@ -856,14 +856,14 @@ function sn(r, s, t, e) {
|
|
|
856
856
|
const m = f === c.length - 1;
|
|
857
857
|
if (/^\w+$/.test(u))
|
|
858
858
|
return h.hasOwnProperty(u) || (h[u] = []), h[u];
|
|
859
|
-
const p = u.match(
|
|
859
|
+
const p = u.match(Ae), g = p ? parseInt(p[1], 10) : 0, y = m && l;
|
|
860
860
|
return h.hasOwnProperty(g) ? y && !e && (h[g] = t) : h[g] = y ? t : m ? {} : [], h[g];
|
|
861
861
|
}, n);
|
|
862
862
|
}
|
|
863
863
|
return l ? ((!e || !n.hasOwnProperty(o)) && (n[o] = t), n[o]) : (n.hasOwnProperty(o) || (n[o] = {}), n[o]);
|
|
864
864
|
}, r) : t;
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function rn(r) {
|
|
867
867
|
return r.map((s, t) => r.slice(t).concat(r.slice(0, t)));
|
|
868
868
|
}
|
|
869
869
|
function si(r) {
|
|
@@ -989,7 +989,7 @@ function ni(r, s) {
|
|
|
989
989
|
), f;
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function on(r) {
|
|
993
993
|
const s = Date.now();
|
|
994
994
|
let t = performance.now();
|
|
995
995
|
for (; Date.now() - s < r; ) {
|
|
@@ -1002,8 +1002,191 @@ function rn(r) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
return Date.now() - s;
|
|
1004
1004
|
}
|
|
1005
|
+
class ri {
|
|
1006
|
+
constructor() {
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* 数值钳制,确保在合法区间内。
|
|
1010
|
+
*/
|
|
1011
|
+
static clamp(s, t, e) {
|
|
1012
|
+
return Math.min(Math.max(s, t), e);
|
|
1013
|
+
}
|
|
1014
|
+
static normalizeHue(s) {
|
|
1015
|
+
return (s % 360 + 360) % 360;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* 根据色相分段与色度参数生成 RGB(0-255)。
|
|
1019
|
+
*/
|
|
1020
|
+
static chromaToRgb(s, t, e) {
|
|
1021
|
+
const i = t * (1 - Math.abs(s / 60 % 2 - 1));
|
|
1022
|
+
let n = 0, o = 0, a = 0;
|
|
1023
|
+
return s < 60 ? [n, o, a] = [t, i, 0] : s < 120 ? [n, o, a] = [i, t, 0] : s < 180 ? [n, o, a] = [0, t, i] : s < 240 ? [n, o, a] = [0, i, t] : s < 300 ? [n, o, a] = [i, 0, t] : [n, o, a] = [t, 0, i], {
|
|
1024
|
+
r: (n + e) * 255,
|
|
1025
|
+
g: (o + e) * 255,
|
|
1026
|
+
b: (a + e) * 255
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
static resolveAlpha(s, t) {
|
|
1030
|
+
return Number.isFinite(s) ? this.clamp(s, 0, 1) : t;
|
|
1031
|
+
}
|
|
1032
|
+
static toRoundedRgbString(s, t, e) {
|
|
1033
|
+
return `rgb(${Math.round(s)}, ${Math.round(t)}, ${Math.round(e)})`;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* HSL 转 RGB。
|
|
1037
|
+
* h: 0-360, s/l: 0-100
|
|
1038
|
+
*/
|
|
1039
|
+
static hslToRgb(s, t, e) {
|
|
1040
|
+
const i = this.normalizeHue(s), n = this.clamp(t, 0, 100) / 100, o = this.clamp(e, 0, 100) / 100, a = (1 - Math.abs(2 * o - 1)) * n, l = o - a / 2;
|
|
1041
|
+
return this.chromaToRgb(i, a, l);
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* HSV 转 RGB。
|
|
1045
|
+
* h: 0-360, s/v: 0-100
|
|
1046
|
+
*/
|
|
1047
|
+
static hsvToRgb(s, t, e) {
|
|
1048
|
+
const i = this.normalizeHue(s), n = this.clamp(t, 0, 100) / 100, o = this.clamp(e, 0, 100) / 100, a = o * n, l = o - a;
|
|
1049
|
+
return this.chromaToRgb(i, a, l);
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* 解析任意受支持的颜色格式并标准化为 RGBA。
|
|
1053
|
+
*/
|
|
1054
|
+
static parseColor(s) {
|
|
1055
|
+
const t = s.trim().toLowerCase();
|
|
1056
|
+
if (t.startsWith("#")) {
|
|
1057
|
+
const o = t.slice(1);
|
|
1058
|
+
if (o.length === 3 || o.length === 4) {
|
|
1059
|
+
const [a, l, c, h = "f"] = o.split("");
|
|
1060
|
+
return {
|
|
1061
|
+
r: parseInt(`${a}${a}`, 16),
|
|
1062
|
+
g: parseInt(`${l}${l}`, 16),
|
|
1063
|
+
b: parseInt(`${c}${c}`, 16),
|
|
1064
|
+
a: parseInt(`${h}${h}`, 16) / 255
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
if (o.length === 6 || o.length === 8) {
|
|
1068
|
+
const a = parseInt(o.slice(0, 2), 16), l = parseInt(o.slice(2, 4), 16), c = parseInt(o.slice(4, 6), 16), h = o.length === 8 ? parseInt(o.slice(6, 8), 16) / 255 : this.DEFAULT_ALPHA;
|
|
1069
|
+
return { r: a, g: l, b: c, a: h };
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
const e = t.match(/^rgba?\(([^)]+)\)$/);
|
|
1073
|
+
if (e) {
|
|
1074
|
+
const o = e[1].split(",").map((a) => a.trim());
|
|
1075
|
+
if (o.length >= 3) {
|
|
1076
|
+
const a = this.clamp(Number(o[0]), 0, 255), l = this.clamp(Number(o[1]), 0, 255), c = this.clamp(Number(o[2]), 0, 255), h = o.length >= 4 ? this.clamp(Number(o[3]), 0, 1) : this.DEFAULT_ALPHA;
|
|
1077
|
+
return { r: a, g: l, b: c, a: h };
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
const i = t.match(/^hsl\(([^)]+)\)$/);
|
|
1081
|
+
if (i) {
|
|
1082
|
+
const o = i[1].split(",").map((a) => a.trim().replace("%", ""));
|
|
1083
|
+
if (o.length >= 3) {
|
|
1084
|
+
const a = Number(o[0]), l = Number(o[1]), c = Number(o[2]);
|
|
1085
|
+
return { ...this.hslToRgb(a, l, c), a: this.DEFAULT_ALPHA };
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
const n = t.match(/^hsv\(([^)]+)\)$/);
|
|
1089
|
+
if (n) {
|
|
1090
|
+
const o = n[1].split(",").map((a) => a.trim().replace("%", ""));
|
|
1091
|
+
if (o.length >= 3) {
|
|
1092
|
+
const a = Number(o[0]), l = Number(o[1]), c = Number(o[2]);
|
|
1093
|
+
return { ...this.hsvToRgb(a, l, c), a: this.DEFAULT_ALPHA };
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
return console.error("Invalid color format", s), { r: 0, g: 0, b: 0, a: this.DEFAULT_ALPHA };
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* 十进制颜色分量转两位十六进制字符串。
|
|
1100
|
+
*/
|
|
1101
|
+
static toHexPart(s) {
|
|
1102
|
+
return Math.round(this.clamp(s, 0, 255)).toString(16).padStart(2, "0");
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* RGB 转 HSL。
|
|
1106
|
+
* 返回 h:0-360, s/l:0-100
|
|
1107
|
+
*/
|
|
1108
|
+
static rgbToHsl(s, t, e) {
|
|
1109
|
+
const i = this.clamp(s, 0, 255) / 255, n = this.clamp(t, 0, 255) / 255, o = this.clamp(e, 0, 255) / 255, a = Math.max(i, n, o), l = Math.min(i, n, o), c = a - l;
|
|
1110
|
+
let h = 0;
|
|
1111
|
+
c !== 0 && (a === i ? h = 60 * ((n - o) / c % 6) : a === n ? h = 60 * ((o - i) / c + 2) : h = 60 * ((i - n) / c + 4)), h < 0 && (h += 360);
|
|
1112
|
+
const u = (a + l) / 2, f = c === 0 ? 0 : c / (1 - Math.abs(2 * u - 1));
|
|
1113
|
+
return { h, s: f * 100, l: u * 100 };
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* RGB 转 HSV。
|
|
1117
|
+
* 返回 h:0-360, s/v:0-100
|
|
1118
|
+
*/
|
|
1119
|
+
static rgbToHsv(s, t, e) {
|
|
1120
|
+
const i = this.clamp(s, 0, 255) / 255, n = this.clamp(t, 0, 255) / 255, o = this.clamp(e, 0, 255) / 255, a = Math.max(i, n, o), l = Math.min(i, n, o), c = a - l;
|
|
1121
|
+
let h = 0;
|
|
1122
|
+
c !== 0 && (a === i ? h = 60 * ((n - o) / c % 6) : a === n ? h = 60 * ((o - i) / c + 2) : h = 60 * ((i - n) / c + 4)), h < 0 && (h += 360);
|
|
1123
|
+
const u = a === 0 ? 0 : c / a, f = a;
|
|
1124
|
+
return { h, s: u * 100, v: f * 100 };
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* 转换为 HEX(#RRGGBB)。
|
|
1128
|
+
*/
|
|
1129
|
+
static toHex(s) {
|
|
1130
|
+
const { r: t, g: e, b: i } = this.parseColor(s);
|
|
1131
|
+
return `#${this.toHexPart(t)}${this.toHexPart(e)}${this.toHexPart(i)}`;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* 转换为 HEXA(#RRGGBBAA)。
|
|
1135
|
+
* alpha 不传时保留输入颜色中的透明度(默认 1)。
|
|
1136
|
+
*/
|
|
1137
|
+
static toHexa(s, t) {
|
|
1138
|
+
const { r: e, g: i, b: n, a: o } = this.parseColor(s), a = this.resolveAlpha(t, o);
|
|
1139
|
+
return `#${this.toHexPart(e)}${this.toHexPart(i)}${this.toHexPart(n)}${this.toHexPart(a * 255)}`;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* 转换为 RGB(rgb(r, g, b))。
|
|
1143
|
+
*/
|
|
1144
|
+
static toRgb(s) {
|
|
1145
|
+
const { r: t, g: e, b: i } = this.parseColor(s);
|
|
1146
|
+
return this.toRoundedRgbString(t, e, i);
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* 转换为 RGBA(rgba(r, g, b, a))。
|
|
1150
|
+
* alpha 不传时保留输入颜色中的透明度(默认 1)。
|
|
1151
|
+
*/
|
|
1152
|
+
static toRgba(s, t) {
|
|
1153
|
+
const e = this.parseColor(s), i = this.resolveAlpha(t, e.a);
|
|
1154
|
+
return `rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${i})`;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* 转换为 HSL(hsl(h, s%, l%))。
|
|
1158
|
+
*/
|
|
1159
|
+
static toHsl(s) {
|
|
1160
|
+
const { r: t, g: e, b: i } = this.parseColor(s), { h: n, s: o, l: a } = this.rgbToHsl(t, e, i);
|
|
1161
|
+
return `hsl(${Math.round(n)}, ${Math.round(o)}%, ${Math.round(a)}%)`;
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* 转换为 HSLA(hsla(h, s%, l%, a))。
|
|
1165
|
+
* alpha 不传时保留输入颜色中的透明度(默认 1)。
|
|
1166
|
+
*/
|
|
1167
|
+
static toHsla(s, t) {
|
|
1168
|
+
const e = this.parseColor(s), { h: i, s: n, l: o } = this.rgbToHsl(e.r, e.g, e.b), a = this.resolveAlpha(t, e.a);
|
|
1169
|
+
return `hsla(${Math.round(i)}, ${Math.round(n)}%, ${Math.round(o)}%, ${a})`;
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* 转换为 HSV(hsv(h, s%, v%))。
|
|
1173
|
+
*/
|
|
1174
|
+
static toHsv(s) {
|
|
1175
|
+
const { r: t, g: e, b: i } = this.parseColor(s), { h: n, s: o, v: a } = this.rgbToHsv(t, e, i);
|
|
1176
|
+
return `hsv(${Math.round(n)}, ${Math.round(o)}%, ${Math.round(a)}%)`;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* 转换为 HSVA(hsva(h, s%, v%, a))。
|
|
1180
|
+
* alpha 不传时保留输入颜色中的透明度(默认 1)。
|
|
1181
|
+
*/
|
|
1182
|
+
static toHsva(s, t) {
|
|
1183
|
+
const e = this.parseColor(s), { h: i, s: n, v: o } = this.rgbToHsv(e.r, e.g, e.b), a = this.resolveAlpha(t, e.a);
|
|
1184
|
+
return `hsva(${Math.round(i)}, ${Math.round(n)}%, ${Math.round(o)}%, ${a})`;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
d(ri, "DEFAULT_ALPHA", 1);
|
|
1005
1188
|
var yt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(yt || {});
|
|
1006
|
-
class
|
|
1189
|
+
class an {
|
|
1007
1190
|
constructor(s, t) {
|
|
1008
1191
|
/** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
|
|
1009
1192
|
d(this, "soundSources");
|
|
@@ -1097,7 +1280,7 @@ function Ce(r, s) {
|
|
|
1097
1280
|
for (const t of Object.keys(s))
|
|
1098
1281
|
s[t] !== void 0 && (r[t] = s[t]);
|
|
1099
1282
|
}
|
|
1100
|
-
class
|
|
1283
|
+
class ln {
|
|
1101
1284
|
constructor(s) {
|
|
1102
1285
|
/** WebSocket地址 */
|
|
1103
1286
|
d(this, "url");
|
|
@@ -1189,7 +1372,7 @@ class an {
|
|
|
1189
1372
|
(s = this.socket) == null || s.close(), this.socket = void 0;
|
|
1190
1373
|
}
|
|
1191
1374
|
}
|
|
1192
|
-
function
|
|
1375
|
+
function cn(r, s = 10) {
|
|
1193
1376
|
let t = 0, e = s;
|
|
1194
1377
|
function i() {
|
|
1195
1378
|
if (e > 0)
|
|
@@ -1203,7 +1386,7 @@ function ln(r, s = 10) {
|
|
|
1203
1386
|
t = Date.now(), i();
|
|
1204
1387
|
});
|
|
1205
1388
|
}
|
|
1206
|
-
function
|
|
1389
|
+
function hn(r) {
|
|
1207
1390
|
const s = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
1208
1391
|
function e() {
|
|
1209
1392
|
return navigator.clipboard.writeText(r).then(s).catch(t);
|
|
@@ -1230,8 +1413,8 @@ function cn(r) {
|
|
|
1230
1413
|
}
|
|
1231
1414
|
return navigator.clipboard ? e().catch(o) : o();
|
|
1232
1415
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const t =
|
|
1416
|
+
function un(r, s) {
|
|
1417
|
+
const t = De[r];
|
|
1235
1418
|
if (!t) return console.error(`未知纸张类型: ${r}`);
|
|
1236
1419
|
const { width: e, height: i } = t, n = (p) => p / 25.4, a = typeof window < "u" ? window.devicePixelRatio * 96 : 300, l = (p) => Math.round(n(p) * a), c = l(e), h = l(i), u = l(s), f = Math.max(0, c - 2 * u), m = Math.max(0, h - 2 * u);
|
|
1237
1420
|
return {
|
|
@@ -1343,7 +1526,7 @@ d(Nt, "timeout", 150), /**
|
|
|
1343
1526
|
* @param callback 匹配标签页的回调函数
|
|
1344
1527
|
*/
|
|
1345
1528
|
d(Nt, "pendingQueries", /* @__PURE__ */ new Map());
|
|
1346
|
-
class
|
|
1529
|
+
class dn {
|
|
1347
1530
|
constructor() {
|
|
1348
1531
|
/** 用户状态:active(活跃) / idle(闲置) */
|
|
1349
1532
|
d(this, "status", "active");
|
|
@@ -1392,7 +1575,7 @@ class un {
|
|
|
1392
1575
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
1393
1576
|
* MIT Licence
|
|
1394
1577
|
*/
|
|
1395
|
-
var de = 9e15, ut = 1e9, fe = "0123456789abcdef",
|
|
1578
|
+
var de = 9e15, ut = 1e9, fe = "0123456789abcdef", qt = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Zt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", me = {
|
|
1396
1579
|
// These values must be integers within the stated ranges (inclusive).
|
|
1397
1580
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
1398
1581
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -1450,7 +1633,7 @@ var de = 9e15, ut = 1e9, fe = "0123456789abcdef", $t = "2.3025850929940456840179
|
|
|
1450
1633
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
1451
1634
|
crypto: !1
|
|
1452
1635
|
// true/false
|
|
1453
|
-
}, Te, nt, E = !0, ee = "[DecimalError] ", ht = ee + "Invalid argument: ", Ie = ee + "Precision limit exceeded", Ne = ee + "crypto unavailable", He = "[object Decimal]", F = Math.floor, I = Math.pow,
|
|
1636
|
+
}, Te, nt, E = !0, ee = "[DecimalError] ", ht = ee + "Invalid argument: ", Ie = ee + "Precision limit exceeded", Ne = ee + "crypto unavailable", He = "[object Decimal]", F = Math.floor, I = Math.pow, oi = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, ai = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, li = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Fe = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Q = 1e7, S = 7, ci = 9007199254740991, hi = qt.length - 1, ge = Zt.length - 1, v = { toStringTag: He };
|
|
1454
1637
|
v.absoluteValue = v.abs = function() {
|
|
1455
1638
|
var r = new this.constructor(this);
|
|
1456
1639
|
return r.s < 0 && (r.s = 1), C(r);
|
|
@@ -1477,7 +1660,7 @@ v.comparedTo = v.cmp = function(r) {
|
|
|
1477
1660
|
};
|
|
1478
1661
|
v.cosine = v.cos = function() {
|
|
1479
1662
|
var r, s, t = this, e = t.constructor;
|
|
1480
|
-
return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t =
|
|
1663
|
+
return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = ui(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt == 2 || nt == 3 ? t.neg() : t, r, s, !0)) : new e(1) : new e(NaN);
|
|
1481
1664
|
};
|
|
1482
1665
|
v.cubeRoot = v.cbrt = function() {
|
|
1483
1666
|
var r, s, t, e, i, n, o, a, l, c, h = this, u = h.constructor;
|
|
@@ -1528,7 +1711,7 @@ v.hyperbolicCosine = v.cosh = function() {
|
|
|
1528
1711
|
var r, s, t, e, i, n = this, o = n.constructor, a = new o(1);
|
|
1529
1712
|
if (!n.isFinite()) return new o(n.s ? 1 / 0 : NaN);
|
|
1530
1713
|
if (n.isZero()) return a;
|
|
1531
|
-
t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / se(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n =
|
|
1714
|
+
t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / se(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n = _t(o, 1, n.times(s), new o(1), !0);
|
|
1532
1715
|
for (var l, c = r, h = new o(8); c--; )
|
|
1533
1716
|
l = n.times(n), n = a.minus(l.times(h.minus(l.times(h))));
|
|
1534
1717
|
return C(n, o.precision = t, o.rounding = e, !0);
|
|
@@ -1537,9 +1720,9 @@ v.hyperbolicSine = v.sinh = function() {
|
|
|
1537
1720
|
var r, s, t, e, i = this, n = i.constructor;
|
|
1538
1721
|
if (!i.isFinite() || i.isZero()) return new n(i);
|
|
1539
1722
|
if (s = n.precision, t = n.rounding, n.precision = s + Math.max(i.e, i.sd()) + 4, n.rounding = 1, e = i.d.length, e < 3)
|
|
1540
|
-
i =
|
|
1723
|
+
i = _t(n, 2, i, i, !0);
|
|
1541
1724
|
else {
|
|
1542
|
-
r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / se(5, r)), i =
|
|
1725
|
+
r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / se(5, r)), i = _t(n, 2, i, i, !0);
|
|
1543
1726
|
for (var o, a = new n(5), l = new n(16), c = new n(20); r--; )
|
|
1544
1727
|
o = i.times(i), i = i.times(a.plus(o.times(l.times(o).plus(c))));
|
|
1545
1728
|
}
|
|
@@ -1705,7 +1888,7 @@ v.plus = v.add = function(r) {
|
|
|
1705
1888
|
v.precision = v.sd = function(r) {
|
|
1706
1889
|
var s, t = this;
|
|
1707
1890
|
if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ht + r);
|
|
1708
|
-
return t.d ? (s =
|
|
1891
|
+
return t.d ? (s = ze(t.d), r && t.e + 1 > s && (s = t.e + 1)) : s = NaN, s;
|
|
1709
1892
|
};
|
|
1710
1893
|
v.round = function() {
|
|
1711
1894
|
var r = this, s = r.constructor;
|
|
@@ -1713,7 +1896,7 @@ v.round = function() {
|
|
|
1713
1896
|
};
|
|
1714
1897
|
v.sine = v.sin = function() {
|
|
1715
1898
|
var r, s, t = this, e = t.constructor;
|
|
1716
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t =
|
|
1899
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = fi(e, Xe(e, t)), e.precision = r, e.rounding = s, C(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
|
|
1717
1900
|
};
|
|
1718
1901
|
v.squareRoot = v.sqrt = function() {
|
|
1719
1902
|
var r, s, t, e, i, n, o = this, a = o.d, l = o.e, c = o.s, h = o.constructor;
|
|
@@ -1755,20 +1938,20 @@ v.toBinary = function(r, s) {
|
|
|
1755
1938
|
};
|
|
1756
1939
|
v.toDecimalPlaces = v.toDP = function(r, s) {
|
|
1757
1940
|
var t = this, e = t.constructor;
|
|
1758
|
-
return t = new e(t), r === void 0 ? t : (
|
|
1941
|
+
return t = new e(t), r === void 0 ? t : (U(r, 0, ut), s === void 0 ? s = e.rounding : U(s, 0, 8), C(t, r + t.e + 1, s));
|
|
1759
1942
|
};
|
|
1760
1943
|
v.toExponential = function(r, s) {
|
|
1761
1944
|
var t, e = this, i = e.constructor;
|
|
1762
|
-
return r === void 0 ? t = et(e, !0) : (
|
|
1945
|
+
return r === void 0 ? t = et(e, !0) : (U(r, 0, ut), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r + 1, s), t = et(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
|
|
1763
1946
|
};
|
|
1764
1947
|
v.toFixed = function(r, s) {
|
|
1765
1948
|
var t, e, i = this, n = i.constructor;
|
|
1766
|
-
return r === void 0 ? t = et(i) : (
|
|
1949
|
+
return r === void 0 ? t = et(i) : (U(r, 0, ut), s === void 0 ? s = n.rounding : U(s, 0, 8), e = C(new n(i), r + i.e + 1, s), t = et(e, !1, r + e.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
|
|
1767
1950
|
};
|
|
1768
1951
|
v.toFraction = function(r) {
|
|
1769
1952
|
var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.d, g = m.constructor;
|
|
1770
1953
|
if (!p) return new g(m);
|
|
1771
|
-
if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e =
|
|
1954
|
+
if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e = ze(p) - m.e - 1, o = n % S, s.d[0] = I(10, o < 0 ? S + o : o), r == null)
|
|
1772
1955
|
r = n > 0 ? s : c;
|
|
1773
1956
|
else {
|
|
1774
1957
|
if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
|
|
@@ -1787,7 +1970,7 @@ v.toNearest = function(r, s) {
|
|
|
1787
1970
|
if (!t.d) return t;
|
|
1788
1971
|
r = new e(1), s = e.rounding;
|
|
1789
1972
|
} else {
|
|
1790
|
-
if (r = new e(r), s === void 0 ? s = e.rounding :
|
|
1973
|
+
if (r = new e(r), s === void 0 ? s = e.rounding : U(s, 0, 8), !t.d) return r.s ? t : r;
|
|
1791
1974
|
if (!r.d)
|
|
1792
1975
|
return r.s && (r.s = t.s), r;
|
|
1793
1976
|
}
|
|
@@ -1804,8 +1987,8 @@ v.toPower = v.pow = function(r) {
|
|
|
1804
1987
|
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(I(+a, c));
|
|
1805
1988
|
if (a = new l(a), a.eq(1)) return a;
|
|
1806
1989
|
if (e = l.precision, n = l.rounding, r.eq(1)) return C(a, e, n);
|
|
1807
|
-
if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <=
|
|
1808
|
-
return i =
|
|
1990
|
+
if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <= ci)
|
|
1991
|
+
return i = Be(l, a, t, e), r.s < 0 ? new l(1).div(i) : C(i, e, n);
|
|
1809
1992
|
if (o = a.s, o < 0) {
|
|
1810
1993
|
if (s < r.d.length - 1) return new l(NaN);
|
|
1811
1994
|
if (r.d[s] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
@@ -1815,11 +1998,11 @@ v.toPower = v.pow = function(r) {
|
|
|
1815
1998
|
};
|
|
1816
1999
|
v.toPrecision = function(r, s) {
|
|
1817
2000
|
var t, e = this, i = e.constructor;
|
|
1818
|
-
return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (
|
|
2001
|
+
return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (U(r, 1, ut), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r, s), t = et(e, r <= e.e || e.e <= i.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
|
|
1819
2002
|
};
|
|
1820
2003
|
v.toSignificantDigits = v.toSD = function(r, s) {
|
|
1821
2004
|
var t = this, e = t.constructor;
|
|
1822
|
-
return r === void 0 ? (r = e.precision, s = e.rounding) : (
|
|
2005
|
+
return r === void 0 ? (r = e.precision, s = e.rounding) : (U(r, 1, ut), s === void 0 ? s = e.rounding : U(s, 0, 8)), C(new e(t), r, s);
|
|
1823
2006
|
};
|
|
1824
2007
|
v.toString = function() {
|
|
1825
2008
|
var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
|
|
@@ -1843,7 +2026,7 @@ function N(r) {
|
|
|
1843
2026
|
for (; o % 10 === 0; ) o /= 10;
|
|
1844
2027
|
return n + o;
|
|
1845
2028
|
}
|
|
1846
|
-
function
|
|
2029
|
+
function U(r, s, t) {
|
|
1847
2030
|
if (r !== ~~r || r < s || r > t)
|
|
1848
2031
|
throw Error(ht + r);
|
|
1849
2032
|
}
|
|
@@ -1860,10 +2043,10 @@ function Ft(r, s, t) {
|
|
|
1860
2043
|
}
|
|
1861
2044
|
return i.reverse();
|
|
1862
2045
|
}
|
|
1863
|
-
function
|
|
2046
|
+
function ui(r, s) {
|
|
1864
2047
|
var t, e, i;
|
|
1865
2048
|
if (s.isZero()) return s;
|
|
1866
|
-
e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / se(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s =
|
|
2049
|
+
e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / se(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s = _t(r, 1, s.times(i), new r(1));
|
|
1867
2050
|
for (var n = t; n--; ) {
|
|
1868
2051
|
var o = s.times(s);
|
|
1869
2052
|
s = o.times(o).minus(o).times(8).plus(1);
|
|
@@ -1895,29 +2078,29 @@ var V = /* @__PURE__ */ function() {
|
|
|
1895
2078
|
for (; !e[0] && e.length > 1; ) e.shift();
|
|
1896
2079
|
}
|
|
1897
2080
|
return function(e, i, n, o, a, l) {
|
|
1898
|
-
var c, h, u, f, m, p, g, y, w, P, b,
|
|
1899
|
-
if (!H || !H[0] || !
|
|
2081
|
+
var c, h, u, f, m, p, g, y, w, P, b, M, O, G, Ot, dt, rt, vt, X, Lt, Tt = e.constructor, ne = e.s == i.s ? 1 : -1, H = e.d, A = i.d;
|
|
2082
|
+
if (!H || !H[0] || !A || !A[0])
|
|
1900
2083
|
return new Tt(
|
|
1901
2084
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
1902
|
-
!e.s || !i.s || (H ?
|
|
2085
|
+
!e.s || !i.s || (H ? A && H[0] == A[0] : !A) ? NaN : (
|
|
1903
2086
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
1904
|
-
H && H[0] == 0 || !
|
|
2087
|
+
H && H[0] == 0 || !A ? ne * 0 : ne / 0
|
|
1905
2088
|
)
|
|
1906
2089
|
);
|
|
1907
|
-
for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), X =
|
|
1908
|
-
if (
|
|
2090
|
+
for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), X = A.length, rt = H.length, w = new Tt(ne), P = w.d = [], u = 0; A[u] == (H[u] || 0); u++) ;
|
|
2091
|
+
if (A[u] > (H[u] || 0) && h--, n == null ? (G = n = Tt.precision, o = Tt.rounding) : a ? G = n + (e.e - i.e) + 1 : G = n, G < 0)
|
|
1909
2092
|
P.push(1), p = !0;
|
|
1910
2093
|
else {
|
|
1911
|
-
if (
|
|
1912
|
-
for (f = 0,
|
|
1913
|
-
|
|
2094
|
+
if (G = G / m + 2 | 0, u = 0, X == 1) {
|
|
2095
|
+
for (f = 0, A = A[0], G++; (u < rt || f) && G--; u++)
|
|
2096
|
+
Ot = f * l + (H[u] || 0), P[u] = Ot / A | 0, f = Ot % A | 0;
|
|
1914
2097
|
p = f || u < rt;
|
|
1915
2098
|
} else {
|
|
1916
|
-
for (f = l / (
|
|
1917
|
-
Lt =
|
|
2099
|
+
for (f = l / (A[0] + 1) | 0, f > 1 && (A = r(A, f, l), H = r(H, f, l), X = A.length, rt = H.length), dt = X, b = H.slice(0, X), M = b.length; M < X; ) b[M++] = 0;
|
|
2100
|
+
Lt = A.slice(), Lt.unshift(0), vt = A[0], A[1] >= l / 2 && ++vt;
|
|
1918
2101
|
do
|
|
1919
|
-
f = 0, c = s(
|
|
1920
|
-
while ((dt++ < rt || b[0] !== void 0) &&
|
|
2102
|
+
f = 0, c = s(A, b, X, M), c < 0 ? (O = b[0], X != M && (O = O * l + (b[1] || 0)), f = O / vt | 0, f > 1 ? (f >= l && (f = l - 1), g = r(A, f, l), y = g.length, M = b.length, c = s(g, b, y, M), c == 1 && (f--, t(g, X < y ? Lt : A, y, l))) : (f == 0 && (c = f = 1), g = A.slice()), y = g.length, y < M && g.unshift(0), t(b, g, M, l), c == -1 && (M = b.length, c = s(A, b, X, M), c < 1 && (f++, t(b, X < M ? Lt : A, M, l))), M = b.length) : c === 0 && (f++, b = [0]), P[u++] = f, c && b[0] ? b[M++] = H[dt] || 0 : (b = [H[dt]], M = 1);
|
|
2103
|
+
while ((dt++ < rt || b[0] !== void 0) && G--);
|
|
1921
2104
|
p = b[0] !== void 0;
|
|
1922
2105
|
}
|
|
1923
2106
|
P[0] || P.shift();
|
|
@@ -1967,7 +2150,7 @@ function C(r, s, t, e) {
|
|
|
1967
2150
|
return E && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
|
|
1968
2151
|
}
|
|
1969
2152
|
function et(r, s, t) {
|
|
1970
|
-
if (!r.isFinite()) return
|
|
2153
|
+
if (!r.isFinite()) return Ge(r);
|
|
1971
2154
|
var e, i = r.e, n = N(r.d), o = n.length;
|
|
1972
2155
|
return s ? (t && (e = t - o) > 0 ? n = n.charAt(0) + "." + n.slice(1) + ot(e) : o > 1 && (n = n.charAt(0) + "." + n.slice(1)), n = n + (r.e < 0 ? "e" : "e+") + r.e) : i < 0 ? (n = "0." + ot(-i - 1) + n, t && (e = t - o) > 0 && (n += ot(e))) : i >= o ? (n += ot(i + 1 - o), t && (e = t - i - 1) > 0 && (n = n + "." + ot(e))) : ((e = i + 1) < o && (n = n.slice(0, e) + "." + n.slice(e)), t && (e = t - o) > 0 && (i + 1 === o && (n += "."), n += ot(e))), n;
|
|
1973
2156
|
}
|
|
@@ -1977,15 +2160,15 @@ function ie(r, s) {
|
|
|
1977
2160
|
return s;
|
|
1978
2161
|
}
|
|
1979
2162
|
function Qt(r, s, t) {
|
|
1980
|
-
if (s >
|
|
2163
|
+
if (s > hi)
|
|
1981
2164
|
throw E = !0, t && (r.precision = t), Error(Ie);
|
|
1982
|
-
return C(new r(
|
|
2165
|
+
return C(new r(qt), s, 1, !0);
|
|
1983
2166
|
}
|
|
1984
2167
|
function tt(r, s, t) {
|
|
1985
2168
|
if (s > ge) throw Error(Ie);
|
|
1986
2169
|
return C(new r(Zt), s, t, !0);
|
|
1987
2170
|
}
|
|
1988
|
-
function
|
|
2171
|
+
function ze(r) {
|
|
1989
2172
|
var s = r.length - 1, t = s * S + 1;
|
|
1990
2173
|
if (s = r[s], s) {
|
|
1991
2174
|
for (; s % 10 == 0; s /= 10) t--;
|
|
@@ -1997,7 +2180,7 @@ function ot(r) {
|
|
|
1997
2180
|
for (var s = ""; r--; ) s += "0";
|
|
1998
2181
|
return s;
|
|
1999
2182
|
}
|
|
2000
|
-
function
|
|
2183
|
+
function Be(r, s, t, e) {
|
|
2001
2184
|
var i, n = new r(1), o = Math.ceil(e / S + 4);
|
|
2002
2185
|
for (E = !1; ; ) {
|
|
2003
2186
|
if (t % 2 && (n = n.times(s), Ee(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
|
|
@@ -2011,7 +2194,7 @@ function ze(r, s, t, e) {
|
|
|
2011
2194
|
function Se(r) {
|
|
2012
2195
|
return r.d[r.d.length - 1] & 1;
|
|
2013
2196
|
}
|
|
2014
|
-
function
|
|
2197
|
+
function Ue(r, s, t) {
|
|
2015
2198
|
for (var e, i, n = new r(s[0]), o = 0; ++o < s.length; ) {
|
|
2016
2199
|
if (i = new r(s[o]), !i.s) {
|
|
2017
2200
|
n = i;
|
|
@@ -2063,10 +2246,10 @@ function at(r, s) {
|
|
|
2063
2246
|
l = c, i += 2;
|
|
2064
2247
|
}
|
|
2065
2248
|
}
|
|
2066
|
-
function
|
|
2249
|
+
function Ge(r) {
|
|
2067
2250
|
return String(r.s * r.s / 0);
|
|
2068
2251
|
}
|
|
2069
|
-
function
|
|
2252
|
+
function zt(r, s) {
|
|
2070
2253
|
var t, e, i;
|
|
2071
2254
|
for ((t = s.indexOf(".")) > -1 && (s = s.replace(".", "")), (e = s.search(/e/i)) > 0 ? (t < 0 && (t = e), t += +s.slice(e + 1), s = s.substring(0, e)) : t < 0 && (t = s.length), e = 0; s.charCodeAt(e) === 48; e++) ;
|
|
2072
2255
|
for (i = s.length; s.charCodeAt(i - 1) === 48; --i) ;
|
|
@@ -2082,33 +2265,33 @@ function Bt(r, s) {
|
|
|
2082
2265
|
r.e = 0, r.d = [0];
|
|
2083
2266
|
return r;
|
|
2084
2267
|
}
|
|
2085
|
-
function
|
|
2268
|
+
function di(r, s) {
|
|
2086
2269
|
var t, e, i, n, o, a, l, c, h;
|
|
2087
2270
|
if (s.indexOf("_") > -1) {
|
|
2088
|
-
if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return
|
|
2271
|
+
if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return zt(r, s);
|
|
2089
2272
|
} else if (s === "Infinity" || s === "NaN")
|
|
2090
2273
|
return +s || (r.s = NaN), r.e = NaN, r.d = null, r;
|
|
2091
|
-
if (
|
|
2274
|
+
if (ai.test(s))
|
|
2092
2275
|
t = 16, s = s.toLowerCase();
|
|
2093
|
-
else if (
|
|
2276
|
+
else if (oi.test(s))
|
|
2094
2277
|
t = 2;
|
|
2095
|
-
else if (
|
|
2278
|
+
else if (li.test(s))
|
|
2096
2279
|
t = 8;
|
|
2097
2280
|
else
|
|
2098
2281
|
throw Error(ht + s);
|
|
2099
|
-
for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i =
|
|
2100
|
-
return n < 0 ? new e(r.s * 0) : (r.e = ie(c, h), r.d = c, E = !1, o && (r = V(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) :
|
|
2282
|
+
for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i = Be(e, new e(t), n, n * 2)), c = Ft(s, t, Q), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
|
|
2283
|
+
return n < 0 ? new e(r.s * 0) : (r.e = ie(c, h), r.d = c, E = !1, o && (r = V(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : D.pow(2, l))), E = !0, r);
|
|
2101
2284
|
}
|
|
2102
|
-
function
|
|
2285
|
+
function fi(r, s) {
|
|
2103
2286
|
var t, e = s.d.length;
|
|
2104
2287
|
if (e < 3)
|
|
2105
|
-
return s.isZero() ? s :
|
|
2106
|
-
t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / se(5, t)), s =
|
|
2288
|
+
return s.isZero() ? s : _t(r, 2, s, s);
|
|
2289
|
+
t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / se(5, t)), s = _t(r, 2, s, s);
|
|
2107
2290
|
for (var i, n = new r(5), o = new r(16), a = new r(20); t--; )
|
|
2108
2291
|
i = s.times(s), s = s.times(n.plus(i.times(o.times(i).minus(a))));
|
|
2109
2292
|
return s;
|
|
2110
2293
|
}
|
|
2111
|
-
function
|
|
2294
|
+
function _t(r, s, t, e, i) {
|
|
2112
2295
|
var n, o, a, l, c = r.precision, h = Math.ceil(c / S);
|
|
2113
2296
|
for (E = !1, l = t.times(t), a = new r(e); ; ) {
|
|
2114
2297
|
if (o = V(a.times(l), new r(s++ * s++), c, 1), a = i ? e.plus(o) : e.minus(o), e = V(o.times(l), new r(s++ * s++), c, 1), o = a.plus(e), o.d[h] !== void 0) {
|
|
@@ -2138,8 +2321,8 @@ function Xe(r, s) {
|
|
|
2138
2321
|
}
|
|
2139
2322
|
function ye(r, s, t, e) {
|
|
2140
2323
|
var i, n, o, a, l, c, h, u, f, m = r.constructor, p = t !== void 0;
|
|
2141
|
-
if (p ? (
|
|
2142
|
-
h =
|
|
2324
|
+
if (p ? (U(t, 1, ut), e === void 0 ? e = m.rounding : U(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
|
|
2325
|
+
h = Ge(r);
|
|
2143
2326
|
else {
|
|
2144
2327
|
for (h = et(r), o = h.indexOf("."), p ? (i = 2, s == 16 ? t = t * 4 - 3 : s == 8 && (t = t * 3 - 2)) : i = s, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d = Ft(et(f), 10, i), f.e = f.d.length), u = Ft(h, 10, i), n = l = u.length; u[--l] == 0; ) u.pop();
|
|
2145
2328
|
if (!u[0])
|
|
@@ -2173,45 +2356,45 @@ function Ee(r, s) {
|
|
|
2173
2356
|
if (r.length > s)
|
|
2174
2357
|
return r.length = s, !0;
|
|
2175
2358
|
}
|
|
2176
|
-
function
|
|
2359
|
+
function mi(r) {
|
|
2177
2360
|
return new this(r).abs();
|
|
2178
2361
|
}
|
|
2179
|
-
function
|
|
2362
|
+
function gi(r) {
|
|
2180
2363
|
return new this(r).acos();
|
|
2181
2364
|
}
|
|
2182
|
-
function
|
|
2365
|
+
function pi(r) {
|
|
2183
2366
|
return new this(r).acosh();
|
|
2184
2367
|
}
|
|
2185
|
-
function
|
|
2368
|
+
function vi(r, s) {
|
|
2186
2369
|
return new this(r).plus(s);
|
|
2187
2370
|
}
|
|
2188
|
-
function
|
|
2371
|
+
function yi(r) {
|
|
2189
2372
|
return new this(r).asin();
|
|
2190
2373
|
}
|
|
2191
|
-
function
|
|
2374
|
+
function wi(r) {
|
|
2192
2375
|
return new this(r).asinh();
|
|
2193
2376
|
}
|
|
2194
|
-
function
|
|
2377
|
+
function xi(r) {
|
|
2195
2378
|
return new this(r).atan();
|
|
2196
2379
|
}
|
|
2197
|
-
function
|
|
2380
|
+
function Pi(r) {
|
|
2198
2381
|
return new this(r).atanh();
|
|
2199
2382
|
}
|
|
2200
|
-
function
|
|
2383
|
+
function bi(r, s) {
|
|
2201
2384
|
r = new this(r), s = new this(s);
|
|
2202
2385
|
var t, e = this.precision, i = this.rounding, n = e + 4;
|
|
2203
2386
|
return !r.s || !s.s ? t = new this(NaN) : !r.d && !s.d ? (t = tt(this, n, 1).times(s.s > 0 ? 0.25 : 0.75), t.s = r.s) : !s.d || r.isZero() ? (t = s.s < 0 ? tt(this, e, i) : new this(0), t.s = r.s) : !r.d || s.isZero() ? (t = tt(this, n, 1).times(0.5), t.s = r.s) : s.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(V(r, s, n, 1)), s = tt(this, n, 1), this.precision = e, this.rounding = i, t = r.s < 0 ? t.minus(s) : t.plus(s)) : t = this.atan(V(r, s, n, 1)), t;
|
|
2204
2387
|
}
|
|
2205
|
-
function
|
|
2388
|
+
function Ci(r) {
|
|
2206
2389
|
return new this(r).cbrt();
|
|
2207
2390
|
}
|
|
2208
|
-
function
|
|
2391
|
+
function Si(r) {
|
|
2209
2392
|
return C(r = new this(r), r.e + 1, 2);
|
|
2210
2393
|
}
|
|
2211
|
-
function
|
|
2394
|
+
function Ei(r, s, t) {
|
|
2212
2395
|
return new this(r).clamp(s, t);
|
|
2213
2396
|
}
|
|
2214
|
-
function
|
|
2397
|
+
function Mi(r) {
|
|
2215
2398
|
if (!r || typeof r != "object") throw Error(ee + "Object expected");
|
|
2216
2399
|
var s, t, e, i = r.defaults === !0, n = [
|
|
2217
2400
|
"precision",
|
|
@@ -2256,7 +2439,7 @@ function Ei(r) {
|
|
|
2256
2439
|
function _i(r) {
|
|
2257
2440
|
return new this(r).cos();
|
|
2258
2441
|
}
|
|
2259
|
-
function
|
|
2442
|
+
function Ri(r) {
|
|
2260
2443
|
return new this(r).cosh();
|
|
2261
2444
|
}
|
|
2262
2445
|
function Ye(r) {
|
|
@@ -2264,7 +2447,7 @@ function Ye(r) {
|
|
|
2264
2447
|
function i(n) {
|
|
2265
2448
|
var o, a, l, c = this;
|
|
2266
2449
|
if (!(c instanceof i)) return new i(n);
|
|
2267
|
-
if (c.constructor = i,
|
|
2450
|
+
if (c.constructor = i, Me(n)) {
|
|
2268
2451
|
c.s = n.s, E ? !n.d || n.e > i.maxE ? (c.e = NaN, c.d = null) : n.e < i.minE ? (c.e = 0, c.d = [0]) : (c.e = n.e, c.d = n.d.slice()) : (c.e = n.e, c.d = n.d ? n.d.slice() : n.d);
|
|
2269
2452
|
return;
|
|
2270
2453
|
}
|
|
@@ -2282,28 +2465,28 @@ function Ye(r) {
|
|
|
2282
2465
|
n || (c.s = NaN), c.e = NaN, c.d = null;
|
|
2283
2466
|
return;
|
|
2284
2467
|
}
|
|
2285
|
-
return
|
|
2468
|
+
return zt(c, n.toString());
|
|
2286
2469
|
}
|
|
2287
2470
|
if (l === "string")
|
|
2288
|
-
return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Fe.test(n) ?
|
|
2471
|
+
return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Fe.test(n) ? zt(c, n) : di(c, n);
|
|
2289
2472
|
if (l === "bigint")
|
|
2290
|
-
return n < 0 ? (n = -n, c.s = -1) : c.s = 1,
|
|
2473
|
+
return n < 0 ? (n = -n, c.s = -1) : c.s = 1, zt(c, n.toString());
|
|
2291
2474
|
throw Error(ht + n);
|
|
2292
2475
|
}
|
|
2293
|
-
if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set =
|
|
2476
|
+
if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = Mi, i.clone = Ye, i.isDecimal = Me, i.abs = mi, i.acos = gi, i.acosh = pi, i.add = vi, i.asin = yi, i.asinh = wi, i.atan = xi, i.atanh = Pi, i.atan2 = bi, i.cbrt = Ci, i.ceil = Si, i.clamp = Ei, i.cos = _i, i.cosh = Ri, i.div = Di, i.exp = ki, i.floor = Vi, i.hypot = Ai, i.ln = Oi, i.log = Li, i.log10 = Ii, i.log2 = Ti, i.max = Ni, i.min = Hi, i.mod = Fi, i.mul = zi, i.pow = Bi, i.random = Ui, i.round = Gi, i.sign = Xi, i.sin = Yi, i.sinh = ji, i.sqrt = Wi, i.sub = $i, i.sum = qi, i.tan = Zi, i.tanh = Qi, i.trunc = Ji, r === void 0 && (r = {}), r && r.defaults !== !0)
|
|
2294
2477
|
for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], s = 0; s < e.length; ) r.hasOwnProperty(t = e[s++]) || (r[t] = this[t]);
|
|
2295
2478
|
return i.config(r), i;
|
|
2296
2479
|
}
|
|
2297
2480
|
function Di(r, s) {
|
|
2298
2481
|
return new this(r).div(s);
|
|
2299
2482
|
}
|
|
2300
|
-
function
|
|
2483
|
+
function ki(r) {
|
|
2301
2484
|
return new this(r).exp();
|
|
2302
2485
|
}
|
|
2303
|
-
function
|
|
2486
|
+
function Vi(r) {
|
|
2304
2487
|
return C(r = new this(r), r.e + 1, 3);
|
|
2305
2488
|
}
|
|
2306
|
-
function
|
|
2489
|
+
function Ai() {
|
|
2307
2490
|
var r, s, t = new this(0);
|
|
2308
2491
|
for (E = !1, r = 0; r < arguments.length; )
|
|
2309
2492
|
if (s = new this(arguments[r++]), s.d)
|
|
@@ -2315,39 +2498,39 @@ function Vi() {
|
|
|
2315
2498
|
}
|
|
2316
2499
|
return E = !0, t.sqrt();
|
|
2317
2500
|
}
|
|
2318
|
-
function
|
|
2319
|
-
return r instanceof
|
|
2501
|
+
function Me(r) {
|
|
2502
|
+
return r instanceof D || r && r.toStringTag === He || !1;
|
|
2320
2503
|
}
|
|
2321
2504
|
function Oi(r) {
|
|
2322
2505
|
return new this(r).ln();
|
|
2323
2506
|
}
|
|
2324
|
-
function
|
|
2507
|
+
function Li(r, s) {
|
|
2325
2508
|
return new this(r).log(s);
|
|
2326
2509
|
}
|
|
2327
|
-
function
|
|
2510
|
+
function Ti(r) {
|
|
2328
2511
|
return new this(r).log(2);
|
|
2329
2512
|
}
|
|
2330
|
-
function
|
|
2513
|
+
function Ii(r) {
|
|
2331
2514
|
return new this(r).log(10);
|
|
2332
2515
|
}
|
|
2333
|
-
function Ii() {
|
|
2334
|
-
return Ge(this, arguments, -1);
|
|
2335
|
-
}
|
|
2336
2516
|
function Ni() {
|
|
2337
|
-
return
|
|
2517
|
+
return Ue(this, arguments, -1);
|
|
2338
2518
|
}
|
|
2339
|
-
function Hi(
|
|
2340
|
-
return
|
|
2519
|
+
function Hi() {
|
|
2520
|
+
return Ue(this, arguments, 1);
|
|
2341
2521
|
}
|
|
2342
2522
|
function Fi(r, s) {
|
|
2523
|
+
return new this(r).mod(s);
|
|
2524
|
+
}
|
|
2525
|
+
function zi(r, s) {
|
|
2343
2526
|
return new this(r).mul(s);
|
|
2344
2527
|
}
|
|
2345
2528
|
function Bi(r, s) {
|
|
2346
2529
|
return new this(r).pow(s);
|
|
2347
2530
|
}
|
|
2348
|
-
function
|
|
2531
|
+
function Ui(r) {
|
|
2349
2532
|
var s, t, e, i, n = 0, o = new this(1), a = [];
|
|
2350
|
-
if (r === void 0 ? r = this.precision :
|
|
2533
|
+
if (r === void 0 ? r = this.precision : U(r, 1, ut), e = Math.ceil(r / S), this.crypto)
|
|
2351
2534
|
if (crypto.getRandomValues)
|
|
2352
2535
|
for (s = crypto.getRandomValues(new Uint32Array(e)); n < e; )
|
|
2353
2536
|
i = s[n], i >= 429e7 ? s[n] = crypto.getRandomValues(new Uint32Array(1))[0] : a[n++] = i % 1e7;
|
|
@@ -2371,19 +2554,19 @@ function zi(r) {
|
|
|
2371
2554
|
function Gi(r) {
|
|
2372
2555
|
return C(r = new this(r), r.e + 1, this.rounding);
|
|
2373
2556
|
}
|
|
2374
|
-
function
|
|
2557
|
+
function Xi(r) {
|
|
2375
2558
|
return r = new this(r), r.d ? r.d[0] ? r.s : 0 * r.s : r.s || NaN;
|
|
2376
2559
|
}
|
|
2377
|
-
function
|
|
2560
|
+
function Yi(r) {
|
|
2378
2561
|
return new this(r).sin();
|
|
2379
2562
|
}
|
|
2380
|
-
function
|
|
2563
|
+
function ji(r) {
|
|
2381
2564
|
return new this(r).sinh();
|
|
2382
2565
|
}
|
|
2383
|
-
function
|
|
2566
|
+
function Wi(r) {
|
|
2384
2567
|
return new this(r).sqrt();
|
|
2385
2568
|
}
|
|
2386
|
-
function
|
|
2569
|
+
function $i(r, s) {
|
|
2387
2570
|
return new this(r).sub(s);
|
|
2388
2571
|
}
|
|
2389
2572
|
function qi() {
|
|
@@ -2391,21 +2574,21 @@ function qi() {
|
|
|
2391
2574
|
for (E = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
|
|
2392
2575
|
return E = !0, C(t, this.precision, this.rounding);
|
|
2393
2576
|
}
|
|
2394
|
-
function
|
|
2577
|
+
function Zi(r) {
|
|
2395
2578
|
return new this(r).tan();
|
|
2396
2579
|
}
|
|
2397
|
-
function
|
|
2580
|
+
function Qi(r) {
|
|
2398
2581
|
return new this(r).tanh();
|
|
2399
2582
|
}
|
|
2400
|
-
function
|
|
2583
|
+
function Ji(r) {
|
|
2401
2584
|
return C(r = new this(r), r.e + 1, 1);
|
|
2402
2585
|
}
|
|
2403
2586
|
v[Symbol.for("nodejs.util.inspect.custom")] = v.toString;
|
|
2404
2587
|
v[Symbol.toStringTag] = "Decimal";
|
|
2405
|
-
var
|
|
2406
|
-
|
|
2407
|
-
Zt = new
|
|
2408
|
-
class
|
|
2588
|
+
var D = v.constructor = Ye(me);
|
|
2589
|
+
qt = new D(qt);
|
|
2590
|
+
Zt = new D(Zt);
|
|
2591
|
+
class Ki {
|
|
2409
2592
|
constructor() {
|
|
2410
2593
|
/** 父级 */
|
|
2411
2594
|
d(this, "parent");
|
|
@@ -2435,7 +2618,7 @@ class Ji {
|
|
|
2435
2618
|
this.mainCanvas = s;
|
|
2436
2619
|
}
|
|
2437
2620
|
}
|
|
2438
|
-
class
|
|
2621
|
+
class ts extends Ki {
|
|
2439
2622
|
constructor() {
|
|
2440
2623
|
super(...arguments);
|
|
2441
2624
|
d(this, "_isVisible", !0);
|
|
@@ -2481,12 +2664,12 @@ class Ki extends Ji {
|
|
|
2481
2664
|
return !0;
|
|
2482
2665
|
}
|
|
2483
2666
|
}
|
|
2484
|
-
let
|
|
2667
|
+
let es = class extends ts {
|
|
2485
2668
|
constructor(s) {
|
|
2486
2669
|
super(), s.name = s.name || ue("default-name-"), Object.assign(this, { ...s });
|
|
2487
2670
|
}
|
|
2488
2671
|
};
|
|
2489
|
-
class
|
|
2672
|
+
class is extends es {
|
|
2490
2673
|
constructor(t) {
|
|
2491
2674
|
super(t);
|
|
2492
2675
|
d(this, "_isInteractive", !0);
|
|
@@ -2565,7 +2748,7 @@ class es extends ts {
|
|
|
2565
2748
|
return (this.parent ? this.parent[t] : !0) && e && (i ? this.isInteractive : !0);
|
|
2566
2749
|
}
|
|
2567
2750
|
}
|
|
2568
|
-
class
|
|
2751
|
+
class ss {
|
|
2569
2752
|
constructor(s) {
|
|
2570
2753
|
d(this, "propagationStopped", !1);
|
|
2571
2754
|
this.data = s;
|
|
@@ -2577,7 +2760,7 @@ class is {
|
|
|
2577
2760
|
return !this.propagationStopped;
|
|
2578
2761
|
}
|
|
2579
2762
|
}
|
|
2580
|
-
class Vt extends
|
|
2763
|
+
class Vt extends is {
|
|
2581
2764
|
constructor() {
|
|
2582
2765
|
super(...arguments);
|
|
2583
2766
|
//#region 4. 添加事件管理器
|
|
@@ -2695,7 +2878,7 @@ class Vt extends es {
|
|
|
2695
2878
|
var c, h;
|
|
2696
2879
|
if (!this[n]) return;
|
|
2697
2880
|
this.updateStates(t, e);
|
|
2698
|
-
const o = new
|
|
2881
|
+
const o = new ss(e);
|
|
2699
2882
|
this.listeners[t].forEach((u) => u(o, i));
|
|
2700
2883
|
const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDragg", "notifyWheel"].includes(a) ? e : e.state;
|
|
2701
2884
|
o.canPropagate && ((c = this.parent) == null || c[a](l, i)), (h = this.sharedControllers[t]) == null || h.forEach(
|
|
@@ -2751,7 +2934,7 @@ class Vt extends es {
|
|
|
2751
2934
|
}
|
|
2752
2935
|
//#region 6. 添加事件通知方法
|
|
2753
2936
|
}
|
|
2754
|
-
class
|
|
2937
|
+
class ns extends Vt {
|
|
2755
2938
|
constructor(t) {
|
|
2756
2939
|
super(t);
|
|
2757
2940
|
/** 画布元素 */
|
|
@@ -2908,7 +3091,7 @@ class ss extends Vt {
|
|
|
2908
3091
|
let l, c;
|
|
2909
3092
|
t === "center" ? (l = a.left + a.width / 2, c = a.top + a.height / 2) : [l, c] = [t.clientX, t.clientY];
|
|
2910
3093
|
const h = this.getMousePositionOnAxis({ clientX: l, clientY: c }), u = this.getAxisValueByPoint(h.x, h.y);
|
|
2911
|
-
this.scale = new
|
|
3094
|
+
this.scale = new D(this.scale).add(e).toNumber(), this.isScaleUpdated = !0, this.updateSize();
|
|
2912
3095
|
const f = this.getAxisPointByValue(
|
|
2913
3096
|
u.xV,
|
|
2914
3097
|
u.yV
|
|
@@ -2942,7 +3125,7 @@ class ss extends Vt {
|
|
|
2942
3125
|
*/
|
|
2943
3126
|
getGridSize(t) {
|
|
2944
3127
|
const { cycle: e, delta: i, axisConfig: n } = this;
|
|
2945
|
-
let o = new
|
|
3128
|
+
let o = new D(t).sub(1).abs().mod(e * i).div(i).toNumber();
|
|
2946
3129
|
return o = t < 1 && o != 0 ? e - o : o, Number(((o / e + 1) * n.min).toFixed(0));
|
|
2947
3130
|
}
|
|
2948
3131
|
/**
|
|
@@ -2954,11 +3137,11 @@ class ss extends Vt {
|
|
|
2954
3137
|
const { axisConfig: e, cycle: i, delta: n } = this, o = e.count, a = i * n;
|
|
2955
3138
|
if (t === 1) return o;
|
|
2956
3139
|
if (t > 1) {
|
|
2957
|
-
const l = new
|
|
2958
|
-
return new
|
|
3140
|
+
const l = new D(t).sub(1).div(a).floor();
|
|
3141
|
+
return new D(o).div(new D(2).pow(l)).toNumber();
|
|
2959
3142
|
} else {
|
|
2960
|
-
const l = new
|
|
2961
|
-
return new
|
|
3143
|
+
const l = new D(1).sub(t).div(a).ceil();
|
|
3144
|
+
return new D(o).mul(new D(2).pow(l)).toNumber();
|
|
2962
3145
|
}
|
|
2963
3146
|
}
|
|
2964
3147
|
/** 获取每个网格表示的数字 */
|
|
@@ -2981,7 +3164,7 @@ class ss extends Vt {
|
|
|
2981
3164
|
xV: t / n.min * n.count,
|
|
2982
3165
|
yV: e / n.min * n.count
|
|
2983
3166
|
};
|
|
2984
|
-
const o = this.getNowGridCount, a = new
|
|
3167
|
+
const o = this.getNowGridCount, a = new D(t).div(n.size).mul(o).toFixed(8), l = new D(e).div(n.size).mul(o).toFixed(8);
|
|
2985
3168
|
return { xV: Number(a), yV: Number(l) };
|
|
2986
3169
|
}
|
|
2987
3170
|
/** 通过坐标轴上的值 获取坐标轴上的点 */
|
|
@@ -2992,7 +3175,7 @@ class ss extends Vt {
|
|
|
2992
3175
|
x: t / n.count * n.min,
|
|
2993
3176
|
y: e / n.count * n.min
|
|
2994
3177
|
};
|
|
2995
|
-
const o = this.getNowGridCount, a = new
|
|
3178
|
+
const o = this.getNowGridCount, a = new D(t).div(o).mul(n.size).toFixed(3), l = new D(e).div(o).mul(n.size).toFixed(3);
|
|
2996
3179
|
return { x: Number(a), y: Number(l) };
|
|
2997
3180
|
}
|
|
2998
3181
|
/** 获取最大/小的 值 */
|
|
@@ -3022,7 +3205,7 @@ class ss extends Vt {
|
|
|
3022
3205
|
) : l(t);
|
|
3023
3206
|
}
|
|
3024
3207
|
}
|
|
3025
|
-
class
|
|
3208
|
+
class rs extends ns {
|
|
3026
3209
|
constructor(t) {
|
|
3027
3210
|
super(t);
|
|
3028
3211
|
/** 主题 */
|
|
@@ -3282,7 +3465,7 @@ class ns extends ss {
|
|
|
3282
3465
|
t in this.style && (this.theme = t, this.isThemeUpdated = !0);
|
|
3283
3466
|
}
|
|
3284
3467
|
}
|
|
3285
|
-
class
|
|
3468
|
+
class R extends Vt {
|
|
3286
3469
|
constructor(t) {
|
|
3287
3470
|
t = { ...t }, t.isDraggable = t.isDraggable ?? !1;
|
|
3288
3471
|
const { mainCanvas: e, notifyReload: i } = t;
|
|
@@ -3548,7 +3731,7 @@ class D extends Vt {
|
|
|
3548
3731
|
handleValuePosition(t, e) {
|
|
3549
3732
|
let { value: i, position: n, mainCanvas: o } = this;
|
|
3550
3733
|
if (!o) return !1;
|
|
3551
|
-
const a = t === "array1D" ? ve :
|
|
3734
|
+
const a = t === "array1D" ? ve : $t, [l, c] = [
|
|
3552
3735
|
a(i) && (!e || i.length >= e),
|
|
3553
3736
|
a(n) && (!e || n.length >= e)
|
|
3554
3737
|
], h = {
|
|
@@ -3605,8 +3788,8 @@ class D extends Vt {
|
|
|
3605
3788
|
return this.isInteractive ? this.isDraggable ? "_nhanh_canvas_hover_overlay_draggable" : "_nhanh_canvas_hover_overlay" : void 0;
|
|
3606
3789
|
}
|
|
3607
3790
|
}
|
|
3608
|
-
d(
|
|
3609
|
-
class
|
|
3791
|
+
d(R, "ctx", document.createElement("canvas").getContext("2d"));
|
|
3792
|
+
class Bt extends R {
|
|
3610
3793
|
constructor(t) {
|
|
3611
3794
|
super(t);
|
|
3612
3795
|
d(this, "_draw");
|
|
@@ -3639,13 +3822,13 @@ class zt extends D {
|
|
|
3639
3822
|
n[1],
|
|
3640
3823
|
!0
|
|
3641
3824
|
);
|
|
3642
|
-
e.push([o.x, o.y]), n[0] != 0 ? i = new
|
|
3825
|
+
e.push([o.x, o.y]), n[0] != 0 ? i = new D(o.x).div(n[0]).toNumber() : n[1] != 0 && (i = new D(o.y).div(n[1]).toNumber());
|
|
3643
3826
|
} else
|
|
3644
3827
|
e.push([
|
|
3645
3828
|
// this.mainCanvas!.preservePrecision(scale * item[0]),
|
|
3646
3829
|
// this.mainCanvas!.preservePrecision(scale * item[1]),
|
|
3647
|
-
new
|
|
3648
|
-
new
|
|
3830
|
+
new D(i).mul(n[0]).toNumber(),
|
|
3831
|
+
new D(i).mul(n[1]).toNumber()
|
|
3649
3832
|
]);
|
|
3650
3833
|
}), e;
|
|
3651
3834
|
}
|
|
@@ -3659,13 +3842,13 @@ class zt extends D {
|
|
|
3659
3842
|
n[1],
|
|
3660
3843
|
!0
|
|
3661
3844
|
);
|
|
3662
|
-
e.push([a.xV, a.yV]), n[0] != 0 ? i = new
|
|
3845
|
+
e.push([a.xV, a.yV]), n[0] != 0 ? i = new D(a.xV).div(n[0]).toNumber() : n[1] != 0 && (i = new D(a.yV).div(n[1]).toNumber());
|
|
3663
3846
|
} else
|
|
3664
3847
|
e.push([
|
|
3665
3848
|
// this.mainCanvas!.preservePrecision(scale * item[0]),
|
|
3666
3849
|
// this.mainCanvas!.preservePrecision(scale * item[1]),
|
|
3667
|
-
new
|
|
3668
|
-
new
|
|
3850
|
+
new D(i).mul(n[0]).toNumber(),
|
|
3851
|
+
new D(i).mul(n[1]).toNumber()
|
|
3669
3852
|
]);
|
|
3670
3853
|
}), e;
|
|
3671
3854
|
}
|
|
@@ -3702,19 +3885,19 @@ class zt extends D {
|
|
|
3702
3885
|
}
|
|
3703
3886
|
class k {
|
|
3704
3887
|
static add(s, t) {
|
|
3705
|
-
return new
|
|
3888
|
+
return new D(s).add(t).toNumber();
|
|
3706
3889
|
}
|
|
3707
3890
|
static sub(s, t) {
|
|
3708
|
-
return new
|
|
3891
|
+
return new D(s).sub(t).toNumber();
|
|
3709
3892
|
}
|
|
3710
3893
|
static mul(s, t) {
|
|
3711
|
-
return new
|
|
3894
|
+
return new D(s).mul(t).toNumber();
|
|
3712
3895
|
}
|
|
3713
3896
|
static div(s, t) {
|
|
3714
|
-
return new
|
|
3897
|
+
return new D(s).div(t).toNumber();
|
|
3715
3898
|
}
|
|
3716
3899
|
}
|
|
3717
|
-
class
|
|
3900
|
+
class Ut extends R {
|
|
3718
3901
|
constructor(t) {
|
|
3719
3902
|
super(t);
|
|
3720
3903
|
/** 文字偏差 */
|
|
@@ -3763,7 +3946,7 @@ class Gt extends D {
|
|
|
3763
3946
|
});
|
|
3764
3947
|
}
|
|
3765
3948
|
isPointInPath(t, e) {
|
|
3766
|
-
return this.path ?
|
|
3949
|
+
return this.path ? R.ctx.isPointInPath(this.path, t, e) : !1;
|
|
3767
3950
|
}
|
|
3768
3951
|
isPointInStroke(t, e) {
|
|
3769
3952
|
return !1;
|
|
@@ -3772,7 +3955,7 @@ class Gt extends D {
|
|
|
3772
3955
|
if (!this.mainCanvas) return;
|
|
3773
3956
|
if (!this.text || this.text.length == 0)
|
|
3774
3957
|
return this.internalUpdate({ dynamicPosition: void 0 });
|
|
3775
|
-
const t =
|
|
3958
|
+
const t = R.ctx;
|
|
3776
3959
|
this.setOverlayStyles(t);
|
|
3777
3960
|
const e = t.measureText(this.text);
|
|
3778
3961
|
this.textOffset = {
|
|
@@ -3814,7 +3997,7 @@ class Gt extends D {
|
|
|
3814
3997
|
}
|
|
3815
3998
|
}
|
|
3816
3999
|
}
|
|
3817
|
-
class lt extends
|
|
4000
|
+
class lt extends R {
|
|
3818
4001
|
constructor(t) {
|
|
3819
4002
|
super(t);
|
|
3820
4003
|
d(this, "angle", 2 * Math.PI);
|
|
@@ -3884,13 +4067,13 @@ class lt extends D {
|
|
|
3884
4067
|
e !== this.fillProgress.lineWidthOffset && (this.fillProgress.lineWidthOffset = e, (i = this.notifyReload) == null || i.call(this));
|
|
3885
4068
|
}
|
|
3886
4069
|
isPointInPath(t, e) {
|
|
3887
|
-
return this.path ?
|
|
4070
|
+
return this.path ? R.ctx.isPointInPath(this.path, t, e) : !1;
|
|
3888
4071
|
}
|
|
3889
4072
|
isPointInStroke(t, e) {
|
|
3890
4073
|
var i;
|
|
3891
4074
|
if (this.path && this.mainCanvas) {
|
|
3892
|
-
const { width: n } = this.setOverlayStyles(
|
|
3893
|
-
return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 :
|
|
4075
|
+
const { width: n } = this.setOverlayStyles(R.ctx);
|
|
4076
|
+
return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 : R.ctx.isPointInStroke(this.path, t, e);
|
|
3894
4077
|
}
|
|
3895
4078
|
return !1;
|
|
3896
4079
|
}
|
|
@@ -3930,7 +4113,7 @@ class lt extends D {
|
|
|
3930
4113
|
}
|
|
3931
4114
|
}
|
|
3932
4115
|
}
|
|
3933
|
-
class je extends
|
|
4116
|
+
class je extends R {
|
|
3934
4117
|
constructor(t) {
|
|
3935
4118
|
super(t);
|
|
3936
4119
|
/** 控制点 */
|
|
@@ -3983,11 +4166,14 @@ class je extends D {
|
|
|
3983
4166
|
k.add(this.dynamicPosition[u][1], c.dynamicPosition)
|
|
3984
4167
|
];
|
|
3985
4168
|
}), this.handlePoints.forEach((h, u) => {
|
|
3986
|
-
h.internalUpdate(
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
4169
|
+
h.internalUpdate(
|
|
4170
|
+
{
|
|
4171
|
+
value: this.value[u],
|
|
4172
|
+
position: this.position[u],
|
|
4173
|
+
dynamicPosition: this.dynamicPosition[u]
|
|
4174
|
+
},
|
|
4175
|
+
!0
|
|
4176
|
+
);
|
|
3991
4177
|
}), this.lockedCanCreateOrDeleteHandlePoint = !0;
|
|
3992
4178
|
};
|
|
3993
4179
|
if (this.isHandlePointsVisible) {
|
|
@@ -4026,7 +4212,7 @@ class je extends D {
|
|
|
4026
4212
|
tryCreateNewHandlePoint(t, e) {
|
|
4027
4213
|
var c;
|
|
4028
4214
|
if (!this.isPointInStroke(t, e)) return;
|
|
4029
|
-
const i = this.getExtendedDynamicPositions(), n =
|
|
4215
|
+
const i = this.getExtendedDynamicPositions(), n = os([t, e], i);
|
|
4030
4216
|
if (n === -1) return;
|
|
4031
4217
|
const [o, a] = this.getAdjacentIndices(n), l = this.createNewHandlePoint(o, a);
|
|
4032
4218
|
this.insertHandlePoint(n, l), this.lockHandlePointCreationTemporarily(), (c = this.notifyReload) == null || c.call(this);
|
|
@@ -4125,12 +4311,12 @@ class je extends D {
|
|
|
4125
4311
|
});
|
|
4126
4312
|
}
|
|
4127
4313
|
}
|
|
4128
|
-
function
|
|
4314
|
+
function os(r, s, t = 10) {
|
|
4129
4315
|
if (s.length === 0) return 0;
|
|
4130
4316
|
if (s.length === 1) return 1;
|
|
4131
4317
|
let e = 1 / 0, i = -1;
|
|
4132
4318
|
for (let n = 0; n < s.length - 1; n++) {
|
|
4133
|
-
const o =
|
|
4319
|
+
const o = ks(
|
|
4134
4320
|
r,
|
|
4135
4321
|
s[n],
|
|
4136
4322
|
s[n + 1]
|
|
@@ -4142,10 +4328,10 @@ function rs(r, s, t = 10) {
|
|
|
4142
4328
|
return i;
|
|
4143
4329
|
}
|
|
4144
4330
|
function oe(r, s) {
|
|
4145
|
-
const { x: t, y: e } =
|
|
4331
|
+
const { x: t, y: e } = qe(...r, ...s);
|
|
4146
4332
|
return [t, e];
|
|
4147
4333
|
}
|
|
4148
|
-
class
|
|
4334
|
+
class Gt extends je {
|
|
4149
4335
|
constructor(t) {
|
|
4150
4336
|
super(t);
|
|
4151
4337
|
d(this, "_isInfinite");
|
|
@@ -4169,7 +4355,7 @@ class Ut extends je {
|
|
|
4169
4355
|
return !1;
|
|
4170
4356
|
}
|
|
4171
4357
|
isPointInStroke(t, e) {
|
|
4172
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4358
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(R.ctx), this.isDraggable && (R.ctx.lineWidth = Math.max(R.ctx.lineWidth, 20)), R.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4173
4359
|
}
|
|
4174
4360
|
isPointInAnywhere(t, e) {
|
|
4175
4361
|
return ((n) => {
|
|
@@ -4186,7 +4372,7 @@ class Ut extends je {
|
|
|
4186
4372
|
if (this.isInfinite) {
|
|
4187
4373
|
this.isRecalculate && this.updateDynamicPosition();
|
|
4188
4374
|
const { width: t, height: e } = this.mainCanvas.rect;
|
|
4189
|
-
return
|
|
4375
|
+
return as(
|
|
4190
4376
|
[0, 0],
|
|
4191
4377
|
[t, e],
|
|
4192
4378
|
this.finalDynamicPosition[0],
|
|
@@ -4236,12 +4422,12 @@ class Ut extends je {
|
|
|
4236
4422
|
const { rect: n } = e, [o, a] = i, l = [a[0] - o[0], a[1] - o[1]];
|
|
4237
4423
|
if (l[0] === 0 && l[1] === 0)
|
|
4238
4424
|
return console.error("重合点无法确定方向");
|
|
4239
|
-
const c =
|
|
4425
|
+
const c = _e(
|
|
4240
4426
|
o,
|
|
4241
4427
|
[-l[0], -l[1]],
|
|
4242
4428
|
n.width,
|
|
4243
4429
|
n.height
|
|
4244
|
-
), h =
|
|
4430
|
+
), h = _e(
|
|
4245
4431
|
a,
|
|
4246
4432
|
l,
|
|
4247
4433
|
n.width,
|
|
@@ -4256,7 +4442,7 @@ class Ut extends je {
|
|
|
4256
4442
|
}
|
|
4257
4443
|
}
|
|
4258
4444
|
}
|
|
4259
|
-
function
|
|
4445
|
+
function _e(r, s, t, e) {
|
|
4260
4446
|
const [i, n] = r, [o, a] = s;
|
|
4261
4447
|
let l = 1 / 0;
|
|
4262
4448
|
if (o !== 0) {
|
|
@@ -4269,7 +4455,7 @@ function Me(r, s, t, e) {
|
|
|
4269
4455
|
}
|
|
4270
4456
|
return l === 1 / 0 ? r : [i + o * l, n + a * l];
|
|
4271
4457
|
}
|
|
4272
|
-
function
|
|
4458
|
+
function as(r, s, t, e) {
|
|
4273
4459
|
const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
|
|
4274
4460
|
[i, o],
|
|
4275
4461
|
// 左上
|
|
@@ -4335,10 +4521,10 @@ class Xt extends je {
|
|
|
4335
4521
|
this.initValueScope();
|
|
4336
4522
|
}
|
|
4337
4523
|
isPointInPath(t, e) {
|
|
4338
|
-
return this.path ?
|
|
4524
|
+
return this.path ? R.ctx.isPointInPath(this.path, t, e) : !1;
|
|
4339
4525
|
}
|
|
4340
4526
|
isPointInStroke(t, e) {
|
|
4341
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4527
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(R.ctx), this.isDraggable && (R.ctx.lineWidth = Math.max(R.ctx.lineWidth, 20)), R.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4342
4528
|
}
|
|
4343
4529
|
isPointInAnywhere(t, e) {
|
|
4344
4530
|
return ((n) => {
|
|
@@ -4430,7 +4616,7 @@ class Xt extends je {
|
|
|
4430
4616
|
}
|
|
4431
4617
|
}
|
|
4432
4618
|
}
|
|
4433
|
-
class Yt extends
|
|
4619
|
+
class Yt extends R {
|
|
4434
4620
|
constructor(t) {
|
|
4435
4621
|
super(t);
|
|
4436
4622
|
d(this, "_isFill", !1);
|
|
@@ -4602,10 +4788,10 @@ class Yt extends D {
|
|
|
4602
4788
|
}));
|
|
4603
4789
|
}
|
|
4604
4790
|
isPointInPath(t, e) {
|
|
4605
|
-
return this.isFill && this.path ?
|
|
4791
|
+
return this.isFill && this.path ? R.ctx.isPointInPath(this.path, t, e) : !1;
|
|
4606
4792
|
}
|
|
4607
4793
|
isPointInStroke(t, e) {
|
|
4608
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
4794
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(R.ctx), this.isDraggable && (R.ctx.lineWidth = Math.max(R.ctx.lineWidth, 20)), R.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4609
4795
|
}
|
|
4610
4796
|
isPointInAnywhere(t, e) {
|
|
4611
4797
|
return ((n) => {
|
|
@@ -4654,7 +4840,7 @@ class Yt extends D {
|
|
|
4654
4840
|
offset: c
|
|
4655
4841
|
} = this;
|
|
4656
4842
|
if (!t || !a || !l) return;
|
|
4657
|
-
const [h, u] =
|
|
4843
|
+
const [h, u] = ls(
|
|
4658
4844
|
...e,
|
|
4659
4845
|
i,
|
|
4660
4846
|
n,
|
|
@@ -4758,14 +4944,14 @@ class Yt extends D {
|
|
|
4758
4944
|
}
|
|
4759
4945
|
}
|
|
4760
4946
|
}
|
|
4761
|
-
function
|
|
4947
|
+
function ls(r, s, t, e, i, n = 1, o = 1) {
|
|
4762
4948
|
const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
|
|
4763
4949
|
return [
|
|
4764
4950
|
[a, l],
|
|
4765
4951
|
[c, h]
|
|
4766
4952
|
];
|
|
4767
4953
|
}
|
|
4768
|
-
class jt extends
|
|
4954
|
+
class jt extends R {
|
|
4769
4955
|
constructor(t) {
|
|
4770
4956
|
super(t);
|
|
4771
4957
|
/** 控制点 */
|
|
@@ -4830,7 +5016,7 @@ class jt extends D {
|
|
|
4830
5016
|
return !1;
|
|
4831
5017
|
}
|
|
4832
5018
|
isPointInStroke(t, e) {
|
|
4833
|
-
return this.path && this.mainCanvas ? (this.setOverlayStyles(
|
|
5019
|
+
return this.path && this.mainCanvas ? (this.setOverlayStyles(R.ctx), this.isDraggable && (R.ctx.lineWidth = Math.max(R.ctx.lineWidth, 20)), R.ctx.isPointInStroke(this.path, t, e)) : !1;
|
|
4834
5020
|
}
|
|
4835
5021
|
isPointInAnywhere(t, e) {
|
|
4836
5022
|
return ((n) => {
|
|
@@ -4889,8 +5075,8 @@ class jt extends D {
|
|
|
4889
5075
|
if (!this.mainCanvas) return;
|
|
4890
5076
|
let { value: t, position: e } = this;
|
|
4891
5077
|
const [i, n] = [
|
|
4892
|
-
|
|
4893
|
-
|
|
5078
|
+
$t(t) && t.length > 1,
|
|
5079
|
+
$t(e) && e.length > 1
|
|
4894
5080
|
];
|
|
4895
5081
|
if (!i && !n)
|
|
4896
5082
|
return this.handlePoints = void 0, this.internalUpdate({ dynamicPosition: void 0 });
|
|
@@ -4932,7 +5118,7 @@ class jt extends D {
|
|
|
4932
5118
|
}
|
|
4933
5119
|
}
|
|
4934
5120
|
}
|
|
4935
|
-
class
|
|
5121
|
+
class cs extends rs {
|
|
4936
5122
|
constructor(t) {
|
|
4937
5123
|
super(t);
|
|
4938
5124
|
/** 监听元素大小 */
|
|
@@ -5009,7 +5195,7 @@ class ls extends ns {
|
|
|
5009
5195
|
if (a !== h) return h - a;
|
|
5010
5196
|
if (l !== u)
|
|
5011
5197
|
return u - l;
|
|
5012
|
-
const m = (p) => p instanceof
|
|
5198
|
+
const m = (p) => p instanceof Bt ? 5 : p instanceof Ut ? 4 : p instanceof lt ? 3 : p instanceof Gt || p instanceof Yt || p instanceof jt ? 2 : p instanceof Xt ? 1 : 0;
|
|
5013
5199
|
return m(f) - m(c);
|
|
5014
5200
|
}
|
|
5015
5201
|
), this.currentDrawOverlays = t.map(
|
|
@@ -5044,7 +5230,7 @@ class ls extends ns {
|
|
|
5044
5230
|
(t = this.resizeObserver) == null || t.disconnect();
|
|
5045
5231
|
}
|
|
5046
5232
|
}
|
|
5047
|
-
class
|
|
5233
|
+
class hs extends cs {
|
|
5048
5234
|
constructor(t) {
|
|
5049
5235
|
super(t);
|
|
5050
5236
|
/** 鼠标是否在画布内 */
|
|
@@ -5147,16 +5333,16 @@ class cs extends ls {
|
|
|
5147
5333
|
keydown(t) {
|
|
5148
5334
|
const { mouseInCanvas: e, offset: i, delta: n, axisConfig: o } = this, a = t.key;
|
|
5149
5335
|
if (!e || !this.isDraggable || this.isAuto) return;
|
|
5150
|
-
const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (
|
|
5336
|
+
const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && ($t(c.value) ? "Matrix" : ve(c.value) ? "Single" : !1), f = (y, w) => {
|
|
5151
5337
|
if (!u)
|
|
5152
5338
|
return i.x += y * l, i.y += w * l, !0;
|
|
5153
|
-
const P = this.getAxisValueByPoint(l, 0).xV, [b,
|
|
5339
|
+
const P = this.getAxisValueByPoint(l, 0).xV, [b, M] = [P * o.x, P * o.y];
|
|
5154
5340
|
if (u === "Single") {
|
|
5155
|
-
const
|
|
5156
|
-
|
|
5341
|
+
const O = c.value;
|
|
5342
|
+
O[0] += y * b, O[1] += w * M;
|
|
5157
5343
|
} else
|
|
5158
|
-
c.value.forEach((
|
|
5159
|
-
|
|
5344
|
+
c.value.forEach((O) => {
|
|
5345
|
+
O[0] += y * b, O[1] += w * M;
|
|
5160
5346
|
});
|
|
5161
5347
|
return c.value = [...c.value], !0;
|
|
5162
5348
|
}, m = (y) => (this.setScale("center", y * n), !0), g = {
|
|
@@ -5268,17 +5454,17 @@ class cs extends ls {
|
|
|
5268
5454
|
} else if (e.length === 2) {
|
|
5269
5455
|
const { clientX: h, clientY: u } = e[0], { clientX: f, clientY: m } = e[1];
|
|
5270
5456
|
if (i.length == 2) {
|
|
5271
|
-
const p =
|
|
5457
|
+
const p = Re(
|
|
5272
5458
|
i[0],
|
|
5273
5459
|
n[0],
|
|
5274
5460
|
i[1],
|
|
5275
5461
|
n[1]
|
|
5276
|
-
), g =
|
|
5462
|
+
), g = Re(
|
|
5277
5463
|
h,
|
|
5278
5464
|
u,
|
|
5279
5465
|
f,
|
|
5280
5466
|
m
|
|
5281
|
-
), { x: y, y: w } =
|
|
5467
|
+
), { x: y, y: w } = qe(
|
|
5282
5468
|
h,
|
|
5283
5469
|
u,
|
|
5284
5470
|
f,
|
|
@@ -5453,7 +5639,7 @@ class j extends Vt {
|
|
|
5453
5639
|
}
|
|
5454
5640
|
}
|
|
5455
5641
|
}
|
|
5456
|
-
class
|
|
5642
|
+
class Dt extends Vt {
|
|
5457
5643
|
constructor(t) {
|
|
5458
5644
|
super(t);
|
|
5459
5645
|
/** 图层群组 */
|
|
@@ -5522,7 +5708,7 @@ class Rt extends Vt {
|
|
|
5522
5708
|
return [];
|
|
5523
5709
|
}
|
|
5524
5710
|
}
|
|
5525
|
-
class
|
|
5711
|
+
class us extends hs {
|
|
5526
5712
|
/** 获取默认覆盖物群组 */
|
|
5527
5713
|
getDefaultOverlayGroup() {
|
|
5528
5714
|
var c, h, u, f, m, p, g;
|
|
@@ -5547,7 +5733,7 @@ class hs extends cs {
|
|
|
5547
5733
|
const t = [], e = s !== void 0 ? Array.isArray(s) ? [...s] : [s] : Array.from(this.layerGroups.values());
|
|
5548
5734
|
for (; e.length > 0; ) {
|
|
5549
5735
|
const i = e.pop();
|
|
5550
|
-
if (i instanceof
|
|
5736
|
+
if (i instanceof Dt) {
|
|
5551
5737
|
if (!i.isVisible) continue;
|
|
5552
5738
|
e.push(...i.layers.values());
|
|
5553
5739
|
} else if (i instanceof j) {
|
|
@@ -5562,7 +5748,7 @@ class hs extends cs {
|
|
|
5562
5748
|
return t;
|
|
5563
5749
|
}
|
|
5564
5750
|
}
|
|
5565
|
-
class
|
|
5751
|
+
class ds extends us {
|
|
5566
5752
|
/** 缩放画布 */
|
|
5567
5753
|
zoom(s) {
|
|
5568
5754
|
const { canvas: t, rect: e } = this;
|
|
@@ -5595,7 +5781,7 @@ class us extends hs {
|
|
|
5595
5781
|
super.setDefaultCenter(s), this.redrawOnce();
|
|
5596
5782
|
}
|
|
5597
5783
|
}
|
|
5598
|
-
class
|
|
5784
|
+
class fs extends ds {
|
|
5599
5785
|
/**
|
|
5600
5786
|
* 调整视图以适应指定覆盖层
|
|
5601
5787
|
* @param overlays 目标覆盖层数组,默认使用全部可见覆盖层
|
|
@@ -5653,13 +5839,13 @@ class ds extends us {
|
|
|
5653
5839
|
const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min, P = n * o;
|
|
5654
5840
|
let b;
|
|
5655
5841
|
if (g > w) {
|
|
5656
|
-
const
|
|
5657
|
-
b = 1 - ((y *
|
|
5842
|
+
const M = Math.ceil(g / w);
|
|
5843
|
+
b = 1 - ((y * M / g - a.min) / a.min + (M - 2)) * P;
|
|
5658
5844
|
} else {
|
|
5659
|
-
const
|
|
5660
|
-
b = 1 + ((y /
|
|
5845
|
+
const M = (dt, rt, vt) => dt < rt ? vt - 1 : M(dt / 2, rt, vt + 1), O = M(w, g, 0), G = Math.pow(2, O);
|
|
5846
|
+
b = 1 + ((y / G / g - a.min) / a.min + O) * P;
|
|
5661
5847
|
}
|
|
5662
|
-
return i !== void 0 && (b = Math.min(i, b)), b = new
|
|
5848
|
+
return i !== void 0 && (b = Math.min(i, b)), b = new D(b).div(o).round().mul(o).toNumber(), b;
|
|
5663
5849
|
}
|
|
5664
5850
|
/** 计算目标位置偏移 */
|
|
5665
5851
|
calculateOffsetDifference(s, t, e, i, n) {
|
|
@@ -5738,7 +5924,7 @@ class ds extends us {
|
|
|
5738
5924
|
});
|
|
5739
5925
|
}
|
|
5740
5926
|
}
|
|
5741
|
-
class
|
|
5927
|
+
class ms extends fs {
|
|
5742
5928
|
/** 开关坐标轴 */
|
|
5743
5929
|
toggleAxis(s) {
|
|
5744
5930
|
this.drawAxis.toggleAxis(s), this.redrawOnce();
|
|
@@ -5763,7 +5949,7 @@ class fs extends ds {
|
|
|
5763
5949
|
return this.isInteractive = s ?? !this.isInteractive, this.isInteractive;
|
|
5764
5950
|
}
|
|
5765
5951
|
}
|
|
5766
|
-
class
|
|
5952
|
+
class gs extends ms {
|
|
5767
5953
|
/**
|
|
5768
5954
|
* 清除指定区域的像素点
|
|
5769
5955
|
* @param ctx - Canvas 2D绘图上下文
|
|
@@ -5774,9 +5960,9 @@ class ms extends fs {
|
|
|
5774
5960
|
s.save(), s.beginPath(), s.clip(t), s.clearRect(0, 0, e, i), s.restore();
|
|
5775
5961
|
}
|
|
5776
5962
|
}
|
|
5777
|
-
class
|
|
5963
|
+
class ps extends gs {
|
|
5778
5964
|
}
|
|
5779
|
-
class
|
|
5965
|
+
class vs {
|
|
5780
5966
|
constructor(s) {
|
|
5781
5967
|
/** 画布 */
|
|
5782
5968
|
d(this, "canvas");
|
|
@@ -5891,8 +6077,8 @@ class ps {
|
|
|
5891
6077
|
const y = i.y > c || i.y < 0;
|
|
5892
6078
|
let w = i.x > 0 ? i.x % p : i.x < 0 ? p + i.x % p : 0, P = s.getAxisValueByPoint((w - i.x) * n.x, 0).xV;
|
|
5893
6079
|
for (; w <= l; ) {
|
|
5894
|
-
const b = le(P),
|
|
5895
|
-
P !== 0 && this.drawText(b, w -
|
|
6080
|
+
const b = le(P), M = h(b);
|
|
6081
|
+
P !== 0 && this.drawText(b, w - M / 2, g, y), w += p, P = new D(m).mul(n.x).add(P).toNumber();
|
|
5896
6082
|
}
|
|
5897
6083
|
}
|
|
5898
6084
|
{
|
|
@@ -5900,13 +6086,13 @@ class ps {
|
|
|
5900
6086
|
let y = i.y > 0 ? i.y % p : i.y < 0 ? p + i.y % p : 0, w = s.getAxisValueByPoint(0, (y - i.y) * n.y).yV;
|
|
5901
6087
|
for (; y <= c; ) {
|
|
5902
6088
|
const P = le(w), b = h(P);
|
|
5903
|
-
let
|
|
5904
|
-
|
|
6089
|
+
let M = i.x - b - u;
|
|
6090
|
+
M = Math.max(Math.min(M, l - b - u), u), w != 0 && this.drawText(P, M, y + f / 2, g), y += p, w = new D(m).mul(n.y).add(w).toNumber();
|
|
5905
6091
|
}
|
|
5906
6092
|
}
|
|
5907
6093
|
}
|
|
5908
6094
|
}
|
|
5909
|
-
class
|
|
6095
|
+
class ys {
|
|
5910
6096
|
constructor(s) {
|
|
5911
6097
|
/** 绑定的画布实例 */
|
|
5912
6098
|
d(this, "canvas");
|
|
@@ -6010,7 +6196,7 @@ class vs {
|
|
|
6010
6196
|
}
|
|
6011
6197
|
}
|
|
6012
6198
|
}
|
|
6013
|
-
class
|
|
6199
|
+
class ws {
|
|
6014
6200
|
/**
|
|
6015
6201
|
* 计算默认缩放比例,使图像适配视图容器
|
|
6016
6202
|
* @param naturalWidth 图像原始宽度
|
|
@@ -6045,13 +6231,18 @@ class ys {
|
|
|
6045
6231
|
};
|
|
6046
6232
|
}
|
|
6047
6233
|
}
|
|
6048
|
-
class
|
|
6049
|
-
constructor() {
|
|
6050
|
-
super(
|
|
6234
|
+
class xs extends R {
|
|
6235
|
+
constructor(t) {
|
|
6236
|
+
super(t);
|
|
6051
6237
|
d(this, "_ready", !1);
|
|
6052
6238
|
d(this, "image", new Image());
|
|
6053
6239
|
d(this, "_url");
|
|
6054
6240
|
d(this, "_objectFit", "fill");
|
|
6241
|
+
this.image.onload = () => {
|
|
6242
|
+
this.ready = !0;
|
|
6243
|
+
}, this.image.onerror = () => {
|
|
6244
|
+
this.ready = !1, console.error("图片加载失败");
|
|
6245
|
+
};
|
|
6055
6246
|
}
|
|
6056
6247
|
get ready() {
|
|
6057
6248
|
return this._ready;
|
|
@@ -6098,12 +6289,12 @@ class ws extends D {
|
|
|
6098
6289
|
const p = u.w / u.h, g = f / m;
|
|
6099
6290
|
if (o === "fill") return u;
|
|
6100
6291
|
if (o === "contain" || o === "scale-down") {
|
|
6101
|
-
const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P,
|
|
6292
|
+
const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P, M = f * b, O = m * b;
|
|
6102
6293
|
return {
|
|
6103
|
-
x: u.x + (u.w -
|
|
6104
|
-
y: u.y + (u.h -
|
|
6105
|
-
w:
|
|
6106
|
-
h:
|
|
6294
|
+
x: u.x + (u.w - M) / 2,
|
|
6295
|
+
y: u.y + (u.h - O) / 2,
|
|
6296
|
+
w: M,
|
|
6297
|
+
h: O
|
|
6107
6298
|
};
|
|
6108
6299
|
}
|
|
6109
6300
|
if (g > p) {
|
|
@@ -6125,18 +6316,11 @@ class ws extends D {
|
|
|
6125
6316
|
sh: y
|
|
6126
6317
|
};
|
|
6127
6318
|
}
|
|
6128
|
-
loadImage() {
|
|
6129
|
-
this.ready = !1, this.url && (this.image.onload = () => {
|
|
6130
|
-
this.ready = !0;
|
|
6131
|
-
}, this.image.onerror = () => {
|
|
6132
|
-
this.ready = !1, console.error("图片加载失败");
|
|
6133
|
-
}, this.image.src = this.url);
|
|
6134
|
-
}
|
|
6135
6319
|
updateBaseData() {
|
|
6136
|
-
this.mainCanvas && (this.
|
|
6320
|
+
this.mainCanvas && (this.ready = !1, this.url && (this.image.src = this.url), this.handleValuePosition("array2D", 1));
|
|
6137
6321
|
}
|
|
6138
6322
|
}
|
|
6139
|
-
class ae extends
|
|
6323
|
+
class ae extends xs {
|
|
6140
6324
|
constructor(t) {
|
|
6141
6325
|
super(t);
|
|
6142
6326
|
d(this, "defaultDragg", (t, e) => {
|
|
@@ -6162,7 +6346,7 @@ class ae extends ws {
|
|
|
6162
6346
|
this.initValueScope();
|
|
6163
6347
|
}
|
|
6164
6348
|
isPointInPath(t, e) {
|
|
6165
|
-
return this.path ?
|
|
6349
|
+
return this.path ? R.ctx.isPointInPath(this.path, t, e) : !1;
|
|
6166
6350
|
}
|
|
6167
6351
|
isPointInStroke(t, e) {
|
|
6168
6352
|
return !1;
|
|
@@ -6202,12 +6386,12 @@ class ae extends ws {
|
|
|
6202
6386
|
function Ht(r) {
|
|
6203
6387
|
return [r].flat(1 / 0);
|
|
6204
6388
|
}
|
|
6205
|
-
class T extends
|
|
6389
|
+
class T extends ps {
|
|
6206
6390
|
constructor(t) {
|
|
6207
6391
|
super(t);
|
|
6208
6392
|
/** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
|
|
6209
6393
|
d(this, "overlayCreator");
|
|
6210
|
-
this.drawAxis = new
|
|
6394
|
+
this.drawAxis = new vs(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new ys(this), this.initLayerGroups(), this.updateCenter();
|
|
6211
6395
|
}
|
|
6212
6396
|
initLayerGroups() {
|
|
6213
6397
|
const t = new j({ name: "其他图层", zIndex: 1 });
|
|
@@ -6224,7 +6408,7 @@ class T extends gs {
|
|
|
6224
6408
|
a.addGroup(new Y({ name: "文字覆盖物群组" }));
|
|
6225
6409
|
const l = new j({ name: "自定义绘制图层", zIndex: 7 });
|
|
6226
6410
|
l.addGroup(new Y({ name: "自定义绘制覆盖物群组" }));
|
|
6227
|
-
const c = new
|
|
6411
|
+
const c = new Dt({ name: "默认图层群组" });
|
|
6228
6412
|
c.addLayer([
|
|
6229
6413
|
a,
|
|
6230
6414
|
o,
|
|
@@ -6241,11 +6425,11 @@ class T extends gs {
|
|
|
6241
6425
|
}
|
|
6242
6426
|
/** 设置图层群组 */
|
|
6243
6427
|
setLayerGroup(t) {
|
|
6244
|
-
t instanceof
|
|
6428
|
+
t instanceof Dt && (this.layerGroups.set(t.name, t), t.setNotifyReload(() => this.redrawOnce()), t.setMainCanvas(this), t.parent = this);
|
|
6245
6429
|
}
|
|
6246
6430
|
/** 移除图层群组 */
|
|
6247
6431
|
removeLayerGroup(t) {
|
|
6248
|
-
t instanceof
|
|
6432
|
+
t instanceof Dt && (this.layerGroups.delete(t.name), t.setNotifyReload(), t.setMainCanvas(), t.parent = void 0, this.redrawOnce());
|
|
6249
6433
|
}
|
|
6250
6434
|
/** 添加图层 */
|
|
6251
6435
|
addLayer(t) {
|
|
@@ -6269,7 +6453,7 @@ class T extends gs {
|
|
|
6269
6453
|
overlays_other: c
|
|
6270
6454
|
} = this.getDefaultOverlayGroup() || {};
|
|
6271
6455
|
Ht(t).forEach((h) => {
|
|
6272
|
-
h instanceof
|
|
6456
|
+
h instanceof Ut ? e == null || e.addOverlay(h) : h instanceof lt ? i == null || i.addOverlay(h) : h instanceof Gt || h instanceof Yt || h instanceof jt ? n == null || n.addOverlay(h) : h instanceof Xt ? o == null || o.addOverlay(h) : h instanceof Bt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
|
|
6273
6457
|
});
|
|
6274
6458
|
}
|
|
6275
6459
|
/** 移除覆盖物 */
|
|
@@ -6284,7 +6468,7 @@ class T extends gs {
|
|
|
6284
6468
|
overlays_other: c
|
|
6285
6469
|
} = this.getDefaultOverlayGroup() || {};
|
|
6286
6470
|
Ht(t).forEach((h) => {
|
|
6287
|
-
h instanceof
|
|
6471
|
+
h instanceof Ut ? e == null || e.removeOverlay(h) : h instanceof lt ? i == null || i.removeOverlay(h) : h instanceof Gt || h instanceof Yt || h instanceof jt ? n == null || n.removeOverlay(h) : h instanceof Xt ? o == null || o.removeOverlay(h) : h instanceof Bt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.removeOverlay(h) : c == null || c.removeOverlay(h);
|
|
6288
6472
|
});
|
|
6289
6473
|
}
|
|
6290
6474
|
/** 销毁 */
|
|
@@ -6293,19 +6477,19 @@ class T extends gs {
|
|
|
6293
6477
|
}
|
|
6294
6478
|
}
|
|
6295
6479
|
/** 视图适配工具:默认缩放、居中计算 */
|
|
6296
|
-
d(T, "ViewFit",
|
|
6297
|
-
d(T, "LayerGroup",
|
|
6480
|
+
d(T, "ViewFit", ws), /** 图层群组 */
|
|
6481
|
+
d(T, "LayerGroup", Dt), /** 图层 */
|
|
6298
6482
|
d(T, "Layer", j), /** 覆盖物群组 */
|
|
6299
6483
|
d(T, "OverlayGroup", Y), /** 文字 */
|
|
6300
|
-
d(T, "Text",
|
|
6484
|
+
d(T, "Text", Ut), /** 点位 */
|
|
6301
6485
|
d(T, "Point", lt), /** 线段 */
|
|
6302
|
-
d(T, "Line",
|
|
6486
|
+
d(T, "Line", Gt), /** 多边形 */
|
|
6303
6487
|
d(T, "Polygon", Xt), /** 自定义绘制 */
|
|
6304
|
-
d(T, "Custom",
|
|
6488
|
+
d(T, "Custom", Bt), /** 圆弧 */
|
|
6305
6489
|
d(T, "Arc", Yt), /** 圆角 */
|
|
6306
6490
|
d(T, "ArcTo", jt), /** 图片 */
|
|
6307
6491
|
d(T, "Billboard", ae);
|
|
6308
|
-
class
|
|
6492
|
+
class Ps {
|
|
6309
6493
|
/** @param id canvas DOM id(通过 getElementById 定位) */
|
|
6310
6494
|
constructor(s) {
|
|
6311
6495
|
/** Canvas DOM id(用于 `document.getElementById` 定位) */
|
|
@@ -6359,7 +6543,7 @@ class xs {
|
|
|
6359
6543
|
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0);
|
|
6360
6544
|
}
|
|
6361
6545
|
}
|
|
6362
|
-
class
|
|
6546
|
+
class bs {
|
|
6363
6547
|
/**
|
|
6364
6548
|
* @param canvas 绑定 mousedown 的 canvas
|
|
6365
6549
|
* @param onOffsetDelta 拖拽时的 dx 回调(由外部映射到时间偏移)
|
|
@@ -6398,7 +6582,7 @@ class Ps {
|
|
|
6398
6582
|
this.canvas.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
6399
6583
|
}
|
|
6400
6584
|
}
|
|
6401
|
-
class
|
|
6585
|
+
class Cs {
|
|
6402
6586
|
/**
|
|
6403
6587
|
* @param canvas 绑定 wheel 事件的 canvas
|
|
6404
6588
|
* @param getTimeSpacing 读取当前 timeSpacing 的函数
|
|
@@ -6433,7 +6617,7 @@ class bs {
|
|
|
6433
6617
|
this.canvas.removeEventListener("wheel", this.handleWheel);
|
|
6434
6618
|
}
|
|
6435
6619
|
}
|
|
6436
|
-
class
|
|
6620
|
+
class Ss {
|
|
6437
6621
|
/**
|
|
6438
6622
|
* 只负责计算鼠标所在 x/y 对应的时间,并把结果通知给 TimeAxis(不直接操作 DOM)。
|
|
6439
6623
|
*/
|
|
@@ -6470,10 +6654,10 @@ class Cs {
|
|
|
6470
6654
|
this.canvas.removeEventListener("mousemove", this.handleMouseMove), this.canvas.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
6471
6655
|
}
|
|
6472
6656
|
}
|
|
6473
|
-
const
|
|
6657
|
+
const Es = {
|
|
6474
6658
|
easeInOutQuad: (r) => r < 0.5 ? 2 * r * r : 1 - Math.pow(-2 * r + 2, 2) / 2
|
|
6475
6659
|
};
|
|
6476
|
-
class
|
|
6660
|
+
class Ms {
|
|
6477
6661
|
/**
|
|
6478
6662
|
* 创建时间轴引擎:会在构造后 `requestAnimationFrame` 初始化并开始渲染。
|
|
6479
6663
|
* @param id canvas DOM id
|
|
@@ -6519,13 +6703,13 @@ class Es {
|
|
|
6519
6703
|
* 可用于叠加额外图形(如指示线、事件点等)
|
|
6520
6704
|
*/
|
|
6521
6705
|
d(this, "onDrawOverlay");
|
|
6522
|
-
this.canvasManager = new
|
|
6706
|
+
this.canvasManager = new Ps(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
|
|
6523
6707
|
}
|
|
6524
6708
|
/** 初始化交互:拖拽平移、滚轮缩放、鼠标时间通知,并触发首次绘制 */
|
|
6525
6709
|
init() {
|
|
6526
6710
|
if (!this.canvasManager.init(() => this.render())) return;
|
|
6527
6711
|
const t = this.canvasManager.getCanvas();
|
|
6528
|
-
t && (this.offsetDrag = new
|
|
6712
|
+
t && (this.offsetDrag = new bs(
|
|
6529
6713
|
t,
|
|
6530
6714
|
(e) => {
|
|
6531
6715
|
this.currentTime -= Math.round(
|
|
@@ -6535,14 +6719,14 @@ class Es {
|
|
|
6535
6719
|
() => {
|
|
6536
6720
|
this.stopCenterTimeAnimation();
|
|
6537
6721
|
}
|
|
6538
|
-
), this.wheelZoom = new
|
|
6722
|
+
), this.wheelZoom = new Cs(
|
|
6539
6723
|
t,
|
|
6540
6724
|
() => this.timeSpacing,
|
|
6541
6725
|
(e, i) => {
|
|
6542
6726
|
const n = this.getTimeAtCanvasX(i);
|
|
6543
6727
|
this.timeSpacing = e, this.setTimeAtCanvasX(n, i), this.render();
|
|
6544
6728
|
}
|
|
6545
|
-
), this.centerTime = Date.now(), this.mouseTimeReporter = new
|
|
6729
|
+
), this.centerTime = Date.now(), this.mouseTimeReporter = new Ss(
|
|
6546
6730
|
t,
|
|
6547
6731
|
(e) => this.getTimeAtCanvasX(e),
|
|
6548
6732
|
(e) => {
|
|
@@ -6641,7 +6825,7 @@ class Es {
|
|
|
6641
6825
|
Math.max(0.5, h)
|
|
6642
6826
|
);
|
|
6643
6827
|
return Math.max(1, Math.round(u * 60));
|
|
6644
|
-
})(), a = (t == null ? void 0 : t.curve) ??
|
|
6828
|
+
})(), a = (t == null ? void 0 : t.curve) ?? Es.easeInOutQuad;
|
|
6645
6829
|
Ke(
|
|
6646
6830
|
0,
|
|
6647
6831
|
1,
|
|
@@ -6663,7 +6847,7 @@ class Es {
|
|
|
6663
6847
|
(s = this.offsetDrag) == null || s.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
|
|
6664
6848
|
}
|
|
6665
6849
|
}
|
|
6666
|
-
class
|
|
6850
|
+
class mn extends Ms {
|
|
6667
6851
|
/**
|
|
6668
6852
|
* 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
|
|
6669
6853
|
* @param rect 矩形区域,用于计算渐变起止点
|
|
@@ -6708,7 +6892,7 @@ class fn extends Es {
|
|
|
6708
6892
|
g && (t.fillStyle = g), h && (t.strokeStyle = h), t.lineWidth = u, t.beginPath(), typeof t.roundRect == "function" ? t.roundRect(f, o, p, a + o, l) : t.rect(f, o, p, a + o), c && t.fill(), h && t.stroke();
|
|
6709
6893
|
}
|
|
6710
6894
|
}
|
|
6711
|
-
function
|
|
6895
|
+
function At(r) {
|
|
6712
6896
|
if (typeof r == "string") {
|
|
6713
6897
|
const s = document.querySelector(r);
|
|
6714
6898
|
if (s)
|
|
@@ -6718,25 +6902,25 @@ function Ot(r) {
|
|
|
6718
6902
|
return r || document.documentElement;
|
|
6719
6903
|
}
|
|
6720
6904
|
function We(r) {
|
|
6721
|
-
const s =
|
|
6905
|
+
const s = At(r);
|
|
6722
6906
|
return s ? s.requestFullscreen ? s.requestFullscreen() : s.mozRequestFullScreen ? s.mozRequestFullScreen() : s.webkitRequestFullscreen ? s.webkitRequestFullscreen() : s.msRequestFullscreen ? s.msRequestFullscreen() : Promise.reject("No Fullscreen API") : Promise.reject("No Element");
|
|
6723
6907
|
}
|
|
6724
|
-
function
|
|
6908
|
+
function $e() {
|
|
6725
6909
|
const r = document;
|
|
6726
6910
|
return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
6727
6911
|
}
|
|
6728
6912
|
function Jt(r) {
|
|
6729
|
-
const s =
|
|
6913
|
+
const s = At(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
6730
6914
|
return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
6731
6915
|
}
|
|
6732
|
-
function
|
|
6733
|
-
if (r =
|
|
6916
|
+
function gn(r) {
|
|
6917
|
+
if (r = At(r), !!r)
|
|
6734
6918
|
return function() {
|
|
6735
|
-
Jt(r) ?
|
|
6919
|
+
Jt(r) ? $e() : We(r);
|
|
6736
6920
|
};
|
|
6737
6921
|
}
|
|
6738
|
-
function
|
|
6739
|
-
const t =
|
|
6922
|
+
function pn(r, s) {
|
|
6923
|
+
const t = At(s);
|
|
6740
6924
|
if (!t) return;
|
|
6741
6925
|
const e = () => {
|
|
6742
6926
|
r(Jt(t));
|
|
@@ -6745,7 +6929,7 @@ function gn(r, s) {
|
|
|
6745
6929
|
document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
|
|
6746
6930
|
};
|
|
6747
6931
|
}
|
|
6748
|
-
class
|
|
6932
|
+
class vn {
|
|
6749
6933
|
constructor(s, t) {
|
|
6750
6934
|
/** 要全屏展示的目标元素 */
|
|
6751
6935
|
d(this, "targetElement");
|
|
@@ -6761,7 +6945,7 @@ class pn {
|
|
|
6761
6945
|
* 设置或更新目标元素(`HTMLElement` 或 CSS 选择器;未传时内部会回退到 `document.documentElement`)
|
|
6762
6946
|
*/
|
|
6763
6947
|
init(s) {
|
|
6764
|
-
this.targetElement =
|
|
6948
|
+
this.targetElement = At(s);
|
|
6765
6949
|
}
|
|
6766
6950
|
/** 使目标元素进入浏览器全屏 */
|
|
6767
6951
|
enter() {
|
|
@@ -6769,7 +6953,7 @@ class pn {
|
|
|
6769
6953
|
}
|
|
6770
6954
|
/** 退出浏览器全屏(不区分由哪个元素进入) */
|
|
6771
6955
|
exit() {
|
|
6772
|
-
this.targetElement &&
|
|
6956
|
+
this.targetElement && $e();
|
|
6773
6957
|
}
|
|
6774
6958
|
/** 若当前已为该目标全屏则退出,否则进入全屏 */
|
|
6775
6959
|
toggle() {
|
|
@@ -6807,7 +6991,7 @@ class pn {
|
|
|
6807
6991
|
(s = this.detachFullscreenListeners) == null || s.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
|
|
6808
6992
|
}
|
|
6809
6993
|
}
|
|
6810
|
-
function
|
|
6994
|
+
function yn(r) {
|
|
6811
6995
|
const s = Le(r, 100);
|
|
6812
6996
|
let t = 0, e = 0;
|
|
6813
6997
|
return function(i) {
|
|
@@ -6836,7 +7020,7 @@ function vn(r) {
|
|
|
6836
7020
|
f(), m();
|
|
6837
7021
|
};
|
|
6838
7022
|
}
|
|
6839
|
-
function
|
|
7023
|
+
function wn(r, s, t) {
|
|
6840
7024
|
const { isClickAllowed: e, uiLibrary: i = ["naiveUI", "ElementPlus", "Element"] } = t || {}, n = function(l) {
|
|
6841
7025
|
const c = [];
|
|
6842
7026
|
for (const h in l)
|
|
@@ -6869,7 +7053,7 @@ function yn(r, s, t) {
|
|
|
6869
7053
|
);
|
|
6870
7054
|
}
|
|
6871
7055
|
var W, ft, mt, xt, Pt, J, K, st, bt;
|
|
6872
|
-
class
|
|
7056
|
+
class xn {
|
|
6873
7057
|
constructor() {
|
|
6874
7058
|
L(this, W);
|
|
6875
7059
|
L(this, ft, !1);
|
|
@@ -6882,7 +7066,7 @@ class wn {
|
|
|
6882
7066
|
L(this, bt);
|
|
6883
7067
|
}
|
|
6884
7068
|
init(s, t) {
|
|
6885
|
-
this.finish(),
|
|
7069
|
+
this.finish(), _(this, W, s), _(this, st, t == null ? void 0 : t.limit), _(this, bt, t == null ? void 0 : t.dragDom), _(this, mt, {
|
|
6886
7070
|
mousedown: this.mousedown.bind(this),
|
|
6887
7071
|
mousemove: this.mousemove.bind(this),
|
|
6888
7072
|
mouseup: this.mouseup.bind(this)
|
|
@@ -6898,40 +7082,40 @@ class wn {
|
|
|
6898
7082
|
}
|
|
6899
7083
|
alterLocation() {
|
|
6900
7084
|
if (!x(this, W)) return console.error("No DOM");
|
|
6901
|
-
x(this, st) && (
|
|
7085
|
+
x(this, st) && (_(this, J, Math.min(x(this, J), x(this, st).max.top)), _(this, J, Math.max(x(this, J), x(this, st).min.top)), _(this, K, Math.min(x(this, K), x(this, st).max.left)), _(this, K, Math.max(x(this, K), x(this, st).min.left))), x(this, W).style.setProperty("--top", x(this, J) + "px"), x(this, W).style.setProperty("--left", x(this, K) + "px");
|
|
6902
7086
|
}
|
|
6903
7087
|
mousedown(s) {
|
|
6904
7088
|
if (!x(this, W)) return console.error("No DOM");
|
|
6905
7089
|
if (x(this, bt) && s.target != x(this, bt)) return;
|
|
6906
|
-
document.body.classList.add("no-select"),
|
|
7090
|
+
document.body.classList.add("no-select"), _(this, ft, !0);
|
|
6907
7091
|
const t = x(this, W).getBoundingClientRect(), { pageX: e, pageY: i } = s;
|
|
6908
|
-
|
|
7092
|
+
_(this, xt, e), _(this, Pt, i), _(this, J, t.y), _(this, K, t.x);
|
|
6909
7093
|
}
|
|
6910
7094
|
mousemove(s) {
|
|
6911
7095
|
const { pageX: t, pageY: e } = s;
|
|
6912
|
-
x(this, ft) && (
|
|
7096
|
+
x(this, ft) && (_(this, J, x(this, J) + (e - x(this, Pt))), _(this, K, x(this, K) + (t - x(this, xt))), _(this, xt, t), _(this, Pt, e), this.alterLocation());
|
|
6913
7097
|
}
|
|
6914
7098
|
mouseup() {
|
|
6915
|
-
x(this, ft) && (
|
|
7099
|
+
x(this, ft) && (_(this, ft, !1), document.body.classList.remove("no-select"));
|
|
6916
7100
|
}
|
|
6917
7101
|
}
|
|
6918
7102
|
W = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), Pt = new WeakMap(), J = new WeakMap(), K = new WeakMap(), st = new WeakMap(), bt = new WeakMap();
|
|
6919
|
-
var
|
|
6920
|
-
class
|
|
7103
|
+
var $, gt, pt, Ct, St, q, Z, B, Et, Mt;
|
|
7104
|
+
class Pn {
|
|
6921
7105
|
constructor() {
|
|
6922
|
-
L(this,
|
|
7106
|
+
L(this, $);
|
|
6923
7107
|
L(this, gt, !1);
|
|
6924
7108
|
L(this, pt, {});
|
|
6925
7109
|
L(this, Ct, 0);
|
|
6926
7110
|
L(this, St, 0);
|
|
6927
|
-
L(this,
|
|
7111
|
+
L(this, q, 0);
|
|
6928
7112
|
L(this, Z, 0);
|
|
6929
|
-
L(this,
|
|
7113
|
+
L(this, B);
|
|
6930
7114
|
L(this, Et);
|
|
6931
|
-
L(this,
|
|
7115
|
+
L(this, Mt);
|
|
6932
7116
|
}
|
|
6933
7117
|
init(s, t = {}) {
|
|
6934
|
-
this.finish(),
|
|
7118
|
+
this.finish(), _(this, $, s), _(this, B, t.limit), _(this, Et, t.update_move), _(this, Mt, t.update_up), _(this, pt, {
|
|
6935
7119
|
mousedown: this.mousedown.bind(this),
|
|
6936
7120
|
mousemove: this.mousemove.bind(this),
|
|
6937
7121
|
mouseup: this.mouseup.bind(this)
|
|
@@ -6942,17 +7126,17 @@ class xn {
|
|
|
6942
7126
|
}
|
|
6943
7127
|
bindOrUnbindEvent(s) {
|
|
6944
7128
|
const t = s === "bind" ? "addEventListener" : "removeEventListener";
|
|
6945
|
-
if (!x(this,
|
|
6946
|
-
x(this,
|
|
7129
|
+
if (!x(this, $)) return console.error("No DOM");
|
|
7130
|
+
x(this, $)[t]("mousedown", x(this, pt).mousedown), document[t]("mousemove", x(this, pt).mousemove), document[t]("mouseup", x(this, pt).mouseup);
|
|
6947
7131
|
}
|
|
6948
7132
|
updateValue() {
|
|
6949
7133
|
const s = {
|
|
6950
|
-
top: x(this,
|
|
7134
|
+
top: x(this, q),
|
|
6951
7135
|
left: x(this, Z),
|
|
6952
7136
|
percentage: { top: 0, left: 0 }
|
|
6953
7137
|
};
|
|
6954
|
-
if (x(this,
|
|
6955
|
-
const t = (e) => x(this,
|
|
7138
|
+
if (x(this, B)) {
|
|
7139
|
+
const t = (e) => x(this, B) ? (s[e] - x(this, B).min[e]) / (x(this, B).max[e] - x(this, B).min[e]) : 0;
|
|
6956
7140
|
s.percentage = {
|
|
6957
7141
|
top: t("top") || 0,
|
|
6958
7142
|
left: t("left") || 0
|
|
@@ -6961,27 +7145,27 @@ class xn {
|
|
|
6961
7145
|
return s;
|
|
6962
7146
|
}
|
|
6963
7147
|
alterLocation() {
|
|
6964
|
-
if (!x(this,
|
|
6965
|
-
x(this,
|
|
7148
|
+
if (!x(this, $)) return console.error("No DOM");
|
|
7149
|
+
x(this, B) && (_(this, q, Math.min(x(this, q), x(this, B).max.top)), _(this, q, Math.max(x(this, q), x(this, B).min.top)), _(this, Z, Math.min(x(this, Z), x(this, B).max.left)), _(this, Z, Math.max(x(this, Z), x(this, B).min.left))), x(this, Et) && x(this, Et).call(this, this.updateValue()), x(this, $).style.setProperty("--top", x(this, q) + "px"), x(this, $).style.setProperty("--left", x(this, Z) + "px");
|
|
6966
7150
|
}
|
|
6967
7151
|
mousedown(s) {
|
|
6968
|
-
if (!x(this,
|
|
6969
|
-
document.body.classList.add("no-select"),
|
|
6970
|
-
const t = x(this,
|
|
6971
|
-
|
|
7152
|
+
if (!x(this, $)) return console.error("No DOM");
|
|
7153
|
+
document.body.classList.add("no-select"), _(this, gt, !0);
|
|
7154
|
+
const t = x(this, $).getBoundingClientRect();
|
|
7155
|
+
_(this, St, t.y), _(this, Ct, t.x);
|
|
6972
7156
|
const { pageX: e, pageY: i } = s;
|
|
6973
|
-
|
|
7157
|
+
_(this, q, i - x(this, St)), _(this, Z, e - x(this, Ct)), this.alterLocation();
|
|
6974
7158
|
}
|
|
6975
7159
|
mousemove(s) {
|
|
6976
7160
|
const { pageX: t, pageY: e } = s;
|
|
6977
|
-
x(this, gt) && (
|
|
7161
|
+
x(this, gt) && (_(this, q, e - x(this, St)), _(this, Z, t - x(this, Ct)), this.alterLocation());
|
|
6978
7162
|
}
|
|
6979
7163
|
mouseup() {
|
|
6980
|
-
x(this, gt) && (
|
|
7164
|
+
x(this, gt) && (_(this, gt, !1), document.body.classList.remove("no-select"), x(this, Mt) && x(this, Mt).call(this, this.updateValue()));
|
|
6981
7165
|
}
|
|
6982
7166
|
}
|
|
6983
|
-
|
|
6984
|
-
function
|
|
7167
|
+
$ = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), q = new WeakMap(), Z = new WeakMap(), B = new WeakMap(), Et = new WeakMap(), Mt = new WeakMap();
|
|
7168
|
+
function bn(r, s) {
|
|
6985
7169
|
if (typeof r == "number") return r;
|
|
6986
7170
|
if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
|
|
6987
7171
|
const t = document.createElement("div");
|
|
@@ -6989,7 +7173,7 @@ function Pn(r, s) {
|
|
|
6989
7173
|
const e = t.getBoundingClientRect().width;
|
|
6990
7174
|
return s.removeChild(t), e;
|
|
6991
7175
|
}
|
|
6992
|
-
function
|
|
7176
|
+
function Cn(r, s) {
|
|
6993
7177
|
if (!r) return;
|
|
6994
7178
|
let t, e;
|
|
6995
7179
|
if (typeof s == "string") {
|
|
@@ -7006,7 +7190,7 @@ function bn(r, s) {
|
|
|
7006
7190
|
const i = t / e;
|
|
7007
7191
|
return i > r ? [r * e, e] : i < r ? [t, t / r] : [t, e];
|
|
7008
7192
|
}
|
|
7009
|
-
function
|
|
7193
|
+
function Sn(r, s = 5e3) {
|
|
7010
7194
|
return new Promise((t, e) => {
|
|
7011
7195
|
const i = new Image();
|
|
7012
7196
|
i.src = r;
|
|
@@ -7022,7 +7206,7 @@ function Cn(r, s = 5e3) {
|
|
|
7022
7206
|
}, i.crossOrigin = "Anonymous";
|
|
7023
7207
|
});
|
|
7024
7208
|
}
|
|
7025
|
-
function
|
|
7209
|
+
function En(r) {
|
|
7026
7210
|
const t = document.getElementById(r).querySelectorAll("img"), e = t.length, i = [];
|
|
7027
7211
|
let n = 0;
|
|
7028
7212
|
return e === 0 ? Promise.resolve({
|
|
@@ -7064,13 +7248,22 @@ function Sn(r) {
|
|
|
7064
7248
|
});
|
|
7065
7249
|
});
|
|
7066
7250
|
}
|
|
7067
|
-
function
|
|
7251
|
+
function Mn(r) {
|
|
7068
7252
|
return new Promise((s, t) => {
|
|
7069
7253
|
fetch(r).then((e) => s(e.text())).catch((e) => {
|
|
7070
7254
|
console.error("Error fetching :", e), t(e);
|
|
7071
7255
|
});
|
|
7072
7256
|
});
|
|
7073
7257
|
}
|
|
7258
|
+
function _n(r) {
|
|
7259
|
+
const s = document.createElement("input");
|
|
7260
|
+
return s.type = "file", s.accept = (r == null ? void 0 : r.accept) || "", s.multiple = (r == null ? void 0 : r.multiple) || !1, new Promise((t, e) => {
|
|
7261
|
+
s.addEventListener("change", (i) => {
|
|
7262
|
+
const n = i.target.files;
|
|
7263
|
+
n ? t(Array.from(n)) : e();
|
|
7264
|
+
}), s.click();
|
|
7265
|
+
});
|
|
7266
|
+
}
|
|
7074
7267
|
function _s(r) {
|
|
7075
7268
|
const {
|
|
7076
7269
|
href: s,
|
|
@@ -7110,7 +7303,7 @@ function _s(r) {
|
|
|
7110
7303
|
!a && l && u();
|
|
7111
7304
|
} };
|
|
7112
7305
|
}
|
|
7113
|
-
function
|
|
7306
|
+
function Rn(r, s, t) {
|
|
7114
7307
|
if (!t) {
|
|
7115
7308
|
let n = s.replace(/^[^.]+./, "");
|
|
7116
7309
|
n = n == s ? "text/plain" : "application/" + n, t = { type: n };
|
|
@@ -7118,16 +7311,16 @@ function _n(r, s, t) {
|
|
|
7118
7311
|
const e = new Blob(r, t), i = URL.createObjectURL(e);
|
|
7119
7312
|
_s({ href: i, fileName: s });
|
|
7120
7313
|
}
|
|
7121
|
-
const
|
|
7122
|
-
function
|
|
7314
|
+
const Rs = Math.PI / 2, Kt = Math.PI / 180, te = 6378137, Ds = 85.05112878;
|
|
7315
|
+
function Dn(r, s) {
|
|
7123
7316
|
const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s, Ds), -85.05112878), i = t * Kt * te, n = e * Kt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * te;
|
|
7124
7317
|
return [i, o];
|
|
7125
7318
|
}
|
|
7126
|
-
function
|
|
7127
|
-
const t = r / te / Kt, e = (2 * Math.atan(Math.exp(s / te)) -
|
|
7319
|
+
function kn(r, s) {
|
|
7320
|
+
const t = r / te / Kt, e = (2 * Math.atan(Math.exp(s / te)) - Rs) / Kt;
|
|
7128
7321
|
return [t, e];
|
|
7129
7322
|
}
|
|
7130
|
-
function
|
|
7323
|
+
function ks(r, s, t) {
|
|
7131
7324
|
const [e, i] = r, [n, o] = s, [a, l] = t, c = (a - n) ** 2 + (l - o) ** 2;
|
|
7132
7325
|
if (c === 0) return Math.sqrt((e - n) ** 2 + (i - o) ** 2);
|
|
7133
7326
|
let h = ((e - n) * (a - n) + (i - o) * (l - o)) / c;
|
|
@@ -7135,21 +7328,21 @@ function Rs(r, s, t) {
|
|
|
7135
7328
|
(e - (n + h * (a - n))) ** 2 + (i - (o + h * (l - o))) ** 2
|
|
7136
7329
|
);
|
|
7137
7330
|
}
|
|
7138
|
-
function
|
|
7331
|
+
function Vn(r, s, t, e, i, n = 1, o = 1) {
|
|
7139
7332
|
const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
|
|
7140
7333
|
return [
|
|
7141
7334
|
[a, l],
|
|
7142
7335
|
[c, h]
|
|
7143
7336
|
];
|
|
7144
7337
|
}
|
|
7145
|
-
function
|
|
7338
|
+
function Re(r, s, t, e) {
|
|
7146
7339
|
return Math.hypot(Math.abs(t - r), Math.abs(e - s));
|
|
7147
7340
|
}
|
|
7148
|
-
function
|
|
7341
|
+
function qe(r, s, t, e) {
|
|
7149
7342
|
const i = (r + t) / 2, n = (s + e) / 2;
|
|
7150
7343
|
return { x: i, y: n };
|
|
7151
7344
|
}
|
|
7152
|
-
function
|
|
7345
|
+
function An(r, s, t, e) {
|
|
7153
7346
|
const [i, n] = r, [o, a] = s;
|
|
7154
7347
|
let l = 1 / 0;
|
|
7155
7348
|
if (o !== 0) {
|
|
@@ -7162,7 +7355,7 @@ function kn(r, s, t, e) {
|
|
|
7162
7355
|
}
|
|
7163
7356
|
return l === 1 / 0 ? r : [i + o * l, n + a * l];
|
|
7164
7357
|
}
|
|
7165
|
-
const
|
|
7358
|
+
const Vs = /* @__PURE__ */ new Set([
|
|
7166
7359
|
"sin",
|
|
7167
7360
|
"cos",
|
|
7168
7361
|
"tan",
|
|
@@ -7170,9 +7363,9 @@ const ks = /* @__PURE__ */ new Set([
|
|
|
7170
7363
|
"acos",
|
|
7171
7364
|
"atan",
|
|
7172
7365
|
"atan2"
|
|
7173
|
-
]),
|
|
7366
|
+
]), On = new Proxy(Math, {
|
|
7174
7367
|
get(r, s) {
|
|
7175
|
-
return
|
|
7368
|
+
return Vs.has(s) ? function(...t) {
|
|
7176
7369
|
const e = t.map((i) => i / 180 * Math.PI);
|
|
7177
7370
|
return r[s](...e);
|
|
7178
7371
|
} : r[s];
|
|
@@ -7203,21 +7396,21 @@ class wt {
|
|
|
7203
7396
|
}) : s ? (t = this.resolve) == null || t.call(this) : (e = this.reject) == null || e.call(this), s;
|
|
7204
7397
|
}
|
|
7205
7398
|
}
|
|
7206
|
-
class
|
|
7399
|
+
class As extends wt {
|
|
7207
7400
|
constructor(s) {
|
|
7208
7401
|
super(), this.resolve = s;
|
|
7209
7402
|
}
|
|
7210
7403
|
warning(...s) {
|
|
7211
7404
|
const t = () => {
|
|
7212
7405
|
var e, i;
|
|
7213
|
-
return (i = (e =
|
|
7406
|
+
return (i = (e = Rt.tips).warning) == null ? void 0 : i.call(e, ...s);
|
|
7214
7407
|
};
|
|
7215
7408
|
return new wt(this.resolve, t);
|
|
7216
7409
|
}
|
|
7217
7410
|
error(...s) {
|
|
7218
7411
|
const t = () => {
|
|
7219
7412
|
var e, i;
|
|
7220
|
-
return (i = (e =
|
|
7413
|
+
return (i = (e = Rt.tips).error) == null ? void 0 : i.call(e, ...s);
|
|
7221
7414
|
};
|
|
7222
7415
|
return new wt(this.resolve, t);
|
|
7223
7416
|
}
|
|
@@ -7229,136 +7422,138 @@ class Os extends wt {
|
|
|
7229
7422
|
info(...s) {
|
|
7230
7423
|
const t = () => {
|
|
7231
7424
|
var e, i;
|
|
7232
|
-
return (i = (e =
|
|
7425
|
+
return (i = (e = Rt.tips).info) == null ? void 0 : i.call(e, ...s);
|
|
7233
7426
|
};
|
|
7234
7427
|
return new wt(t, this.reject);
|
|
7235
7428
|
}
|
|
7236
7429
|
success(...s) {
|
|
7237
7430
|
const t = () => {
|
|
7238
7431
|
var e, i;
|
|
7239
|
-
return (i = (e =
|
|
7432
|
+
return (i = (e = Rt.tips).success) == null ? void 0 : i.call(e, ...s);
|
|
7240
7433
|
};
|
|
7241
7434
|
return new wt(t, this.reject);
|
|
7242
7435
|
}
|
|
7243
7436
|
}
|
|
7244
|
-
const
|
|
7437
|
+
const z = class z {
|
|
7245
7438
|
/**
|
|
7246
7439
|
* 构造函数
|
|
7247
7440
|
* @throws 如果尝试实例化该类,则抛出错误,因为应该使用静态方法
|
|
7248
7441
|
*/
|
|
7249
7442
|
constructor() {
|
|
7250
|
-
if (new.target ===
|
|
7443
|
+
if (new.target === z)
|
|
7251
7444
|
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
7252
7445
|
}
|
|
7253
7446
|
static register(s, t) {
|
|
7254
7447
|
if (typeof t != "function")
|
|
7255
7448
|
return console.error("TipHandler must be a function");
|
|
7256
|
-
|
|
7449
|
+
z.tips[s] = t;
|
|
7257
7450
|
}
|
|
7258
7451
|
static resolveTip(s) {
|
|
7259
7452
|
return function(...t) {
|
|
7260
7453
|
const e = () => {
|
|
7261
7454
|
var i, n;
|
|
7262
|
-
return (n = (i =
|
|
7455
|
+
return (n = (i = z.tips)[s]) == null ? void 0 : n.call(i, ...t);
|
|
7263
7456
|
};
|
|
7264
|
-
return new
|
|
7457
|
+
return new As(e);
|
|
7265
7458
|
};
|
|
7266
7459
|
}
|
|
7267
7460
|
static rejectTip(s) {
|
|
7268
7461
|
return function(...t) {
|
|
7269
7462
|
const e = () => {
|
|
7270
7463
|
var i, n;
|
|
7271
|
-
return (n = (i =
|
|
7464
|
+
return (n = (i = z.tips)[s]) == null ? void 0 : n.call(i, ...t);
|
|
7272
7465
|
};
|
|
7273
7466
|
return new Os(e);
|
|
7274
7467
|
};
|
|
7275
7468
|
}
|
|
7276
7469
|
};
|
|
7277
|
-
d(
|
|
7470
|
+
d(z, "tips", {
|
|
7278
7471
|
info: void 0,
|
|
7279
7472
|
success: void 0,
|
|
7280
7473
|
warning: void 0,
|
|
7281
7474
|
error: void 0
|
|
7282
|
-
}), d(
|
|
7283
|
-
let
|
|
7475
|
+
}), d(z, "info", z.resolveTip("info")), d(z, "success", z.resolveTip("success")), d(z, "warning", z.rejectTip("warning")), d(z, "error", z.rejectTip("error"));
|
|
7476
|
+
let Rt = z;
|
|
7284
7477
|
export {
|
|
7285
7478
|
Je as EXTENSION_TO_MIME,
|
|
7286
7479
|
re as FILE_EXTENSIONS,
|
|
7287
|
-
|
|
7288
|
-
|
|
7480
|
+
De as PAPER_SIZE_DEFINITIONS,
|
|
7481
|
+
Is as PAPER_SIZE_OPTIONS,
|
|
7289
7482
|
Pe as UNIT_LABELS,
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7483
|
+
Ts as WINDOW_TARGET,
|
|
7484
|
+
Ns as _Animate_CreateOscillator,
|
|
7485
|
+
Hs as _Animate_CubicBezier,
|
|
7293
7486
|
Ke as _Animate_NumericTransition,
|
|
7294
7487
|
Wt as _Animate_Schedule,
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7488
|
+
Fs as _Blob_ConvertDataToImageUrl,
|
|
7489
|
+
un as _Browser_CalculatePrintableArea,
|
|
7490
|
+
hn as _Browser_CopyToClipboard,
|
|
7491
|
+
cn as _Browser_GetFrameRate,
|
|
7492
|
+
dn as _Browser_IdleDetection,
|
|
7300
7493
|
Nt as _Browser_SameOriginTabManager,
|
|
7301
|
-
|
|
7302
|
-
|
|
7494
|
+
an as _Browser_SoundEffects,
|
|
7495
|
+
ln as _Browser_WebSocketClient,
|
|
7303
7496
|
T as _Canvas_Axis,
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7497
|
+
mn as _Canvas_TimeAxis,
|
|
7498
|
+
Cn as _Element_CalculateCanvasSize,
|
|
7499
|
+
En as _Element_CheckImagesLoaded,
|
|
7500
|
+
wn as _Element_CloseOnOutsideClick,
|
|
7501
|
+
xn as _Element_Drag,
|
|
7309
7502
|
We as _Element_EnterFullscreen,
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7503
|
+
$e as _Element_ExitFullscreen,
|
|
7504
|
+
gn as _Element_Fullscreen,
|
|
7505
|
+
vn as _Element_FullscreenController,
|
|
7506
|
+
pn as _Element_FullscreenObserver,
|
|
7507
|
+
bn as _Element_GetOtherSizeInPixels,
|
|
7315
7508
|
Jt as _Element_IsFullscreen,
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7509
|
+
Sn as _Element_LoadImage,
|
|
7510
|
+
Pn as _Element_LocalDrag,
|
|
7511
|
+
yn as _Element_ScrollEndListener,
|
|
7512
|
+
Rn as _File_CreateAndDownload,
|
|
7320
7513
|
_s as _File_Download,
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7514
|
+
Mn as _File_Read,
|
|
7515
|
+
_n as _File_Select,
|
|
7516
|
+
Xs as _Format_CamelCase,
|
|
7517
|
+
zs as _Format_CapitalizeFirstLetter,
|
|
7518
|
+
$s as _Format_ChunkArray,
|
|
7519
|
+
Ys as _Format_ExcludeSubstring,
|
|
7326
7520
|
Gs as _Format_FileSize,
|
|
7327
7521
|
ce as _Format_HrefName,
|
|
7328
|
-
|
|
7522
|
+
Ws as _Format_MillisecondToReadable,
|
|
7329
7523
|
le as _Format_NumberWithCommas,
|
|
7330
|
-
|
|
7524
|
+
Us as _Format_NumberWithUnit,
|
|
7331
7525
|
Bs as _Format_Percentage,
|
|
7332
7526
|
ti as _Format_Timestamp,
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7527
|
+
js as _Format_ToggleInvisibleChars,
|
|
7528
|
+
Re as _Math_CalculateDistance2D,
|
|
7529
|
+
On as _Math_Degree,
|
|
7530
|
+
Vn as _Math_GetArcPoints,
|
|
7531
|
+
An as _Math_GetBoundaryIntersection,
|
|
7532
|
+
qe as _Math_GetMidpoint,
|
|
7533
|
+
Dn as _Math_LngLatToPlane,
|
|
7534
|
+
kn as _Math_PlaneToLngLat,
|
|
7535
|
+
ks as _Math_PointToLineDistance,
|
|
7536
|
+
Rt as _Tip,
|
|
7343
7537
|
si as _Utility_Clone,
|
|
7538
|
+
ri as _Utility_ColorConverter,
|
|
7344
7539
|
Le as _Utility_Debounce,
|
|
7345
|
-
|
|
7540
|
+
tn as _Utility_ExecuteWhenIdle,
|
|
7346
7541
|
ue as _Utility_GenerateUUID,
|
|
7347
|
-
|
|
7542
|
+
sn as _Utility_GetTargetByPath,
|
|
7348
7543
|
ct as _Utility_MergeObjects,
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7544
|
+
rn as _Utility_RotateList,
|
|
7545
|
+
nn as _Utility_SetTargetByPath,
|
|
7546
|
+
on as _Utility_Sleep,
|
|
7547
|
+
en as _Utility_Throttle,
|
|
7353
7548
|
ni as _Utility_TimeConsumption,
|
|
7354
7549
|
ii as _Utility_WaitForCondition,
|
|
7355
|
-
|
|
7550
|
+
Ks as _Valid_CheckConnectionWithXHR,
|
|
7356
7551
|
he as _Valid_DataType,
|
|
7357
|
-
|
|
7552
|
+
Qs as _Valid_DoesInfiniteLineIntersectRectangle,
|
|
7358
7553
|
be as _Valid_FileTypeChecker,
|
|
7359
|
-
|
|
7554
|
+
$t as _Valid_Is2DNumberArray,
|
|
7360
7555
|
qs as _Valid_IsInMargin,
|
|
7361
7556
|
ve as _Valid_IsNumberArray,
|
|
7362
|
-
|
|
7363
|
-
|
|
7557
|
+
Zs as _Valid_IsPointInPolygon,
|
|
7558
|
+
Js as _Valid_IsSecureContext
|
|
7364
7559
|
};
|