nhanh-pure-function 4.4.0 → 4.5.0
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/Animate/index.d.ts +2 -2
- package/dist/Element/Runtime/drop.d.ts +45 -0
- package/dist/Element/Runtime/index.d.ts +2 -1
- package/dist/Math/index.d.ts +9 -3
- package/dist/Utility/Runtime/shortcutKey.d.ts +25 -15
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +835 -653
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}._nhanh_canvas{cursor:initial}._nhanh_canvas:active{cursor:pointer}._nhanh_canvas._nhanh_canvas_draggable{cursor:grab}._nhanh_canvas._nhanh_canvas_draggable:active{cursor:grabbing}._nhanh_canvas_hover_overlay{cursor:pointer!important}._nhanh_canvas_hover_overlay:active{cursor:grabbing!important}._nhanh_canvas_hover_overlay_draggable{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable:active{cursor:move!important}._nhanh_canvas_hover_overlay_draggable_ew{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable_ew:active{cursor:e-resize!important;cursor:ew-resize!important}._nhanh_canvas_hover_overlay_draggable_ns{cursor:pointer!important}._nhanh_canvas_hover_overlay_draggable_ns:active{cursor:n-resize!important;cursor:ns-resize!important}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var ii = Object.defineProperty;
|
|
3
|
+
var be = (r) => {
|
|
4
4
|
throw TypeError(r);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var d = (r, i, t) =>
|
|
8
|
-
var x = (r, i, t) => (
|
|
9
|
-
const
|
|
6
|
+
var si = (r, i, t) => i in r ? ii(r, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[i] = t;
|
|
7
|
+
var d = (r, i, t) => si(r, typeof i != "symbol" ? i + "" : i, t), Pe = (r, i, t) => i.has(r) || be("Cannot " + t);
|
|
8
|
+
var x = (r, i, t) => (Pe(r, i, "read from private field"), t ? t.call(r) : i.get(r)), L = (r, i, t) => i.has(r) ? be("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(r) : i.set(r, t), M = (r, i, t, e) => (Pe(r, i, "write to private field"), e ? e.call(r, t) : i.set(r, t), t);
|
|
9
|
+
const ni = {
|
|
10
10
|
".mp3": "audio/mpeg",
|
|
11
11
|
".mp4": "video/mp4",
|
|
12
12
|
".m4a": "audio/mp4",
|
|
@@ -68,7 +68,7 @@ const Qe = {
|
|
|
68
68
|
".otf": "font/otf",
|
|
69
69
|
".eot": "application/vnd.ms-fontobject",
|
|
70
70
|
".map": "application/json"
|
|
71
|
-
},
|
|
71
|
+
}, te = {
|
|
72
72
|
image: [
|
|
73
73
|
".jpg",
|
|
74
74
|
".jpeg",
|
|
@@ -248,7 +248,7 @@ const Qe = {
|
|
|
248
248
|
".awk",
|
|
249
249
|
".php"
|
|
250
250
|
]
|
|
251
|
-
},
|
|
251
|
+
}, Ce = [
|
|
252
252
|
"",
|
|
253
253
|
"万",
|
|
254
254
|
"亿",
|
|
@@ -262,7 +262,7 @@ const Qe = {
|
|
|
262
262
|
"正",
|
|
263
263
|
"载",
|
|
264
264
|
"极"
|
|
265
|
-
],
|
|
265
|
+
], $s = ["_self", "_blank", "_parent", "_top"], Le = {
|
|
266
266
|
// 北美标准尺寸 (毫米)
|
|
267
267
|
Letter: { width: 215.9, height: 279.4 },
|
|
268
268
|
// 8.5 × 11 英寸
|
|
@@ -315,10 +315,10 @@ const Qe = {
|
|
|
315
315
|
C6: { width: 114, height: 162 },
|
|
316
316
|
C7: { width: 81, height: 114 },
|
|
317
317
|
C8: { width: 57, height: 81 }
|
|
318
|
-
},
|
|
318
|
+
}, js = Object.keys(Le).map(
|
|
319
319
|
(r) => ({ value: r, label: r })
|
|
320
320
|
);
|
|
321
|
-
function
|
|
321
|
+
function Ut(r, i = 500) {
|
|
322
322
|
let t, e = !0;
|
|
323
323
|
function s(n) {
|
|
324
324
|
if (!e) return;
|
|
@@ -328,21 +328,21 @@ function Bt(r, i = 500) {
|
|
|
328
328
|
}
|
|
329
329
|
return requestAnimationFrame(s), () => e = !1;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Ws(r, i, t, e, s = 4) {
|
|
332
332
|
let n = r, o = !1, a = 1, l = r, c = i, h = t;
|
|
333
333
|
const u = () => {
|
|
334
334
|
const b = (c - l) / h;
|
|
335
335
|
return Number(b.toFixed(s));
|
|
336
336
|
};
|
|
337
337
|
let f = u();
|
|
338
|
-
const m = (b) => Math.min(Math.max(b, l), c), g = (b) => Number(b.toFixed(s)), p = (b, P,
|
|
339
|
-
const
|
|
340
|
-
return b >= P &&
|
|
341
|
-
}, y = (b, P,
|
|
342
|
-
const
|
|
343
|
-
return
|
|
338
|
+
const m = (b) => Math.min(Math.max(b, l), c), g = (b) => Number(b.toFixed(s)), p = (b, P, _) => {
|
|
339
|
+
const O = [];
|
|
340
|
+
return b >= P && O.push("最小值必须小于最大值"), _ <= 0 ? O.push("分段数必须为正数") : u() == 0 && O.push("数值精度过低,致使动画步长为 0"), O;
|
|
341
|
+
}, y = (b, P, _) => {
|
|
342
|
+
const O = p(b, P, _);
|
|
343
|
+
return O.length > 0 ? (console.error(`参数更新失败: ${O.join("; ")}`), !1) : (l = b, c = P, h = _, f = u(), n = m(n), !0);
|
|
344
344
|
}, w = () => {
|
|
345
|
-
o && (a = n >= c ? -1 : n <= l ? 1 : a, n = m(n + f * a), e(g(n)), requestAnimationFrame(w));
|
|
345
|
+
o && (a = n >= c ? -1 : n <= l ? 1 : a, n = m(n + f * a), e(g(n), a), requestAnimationFrame(w));
|
|
346
346
|
};
|
|
347
347
|
return {
|
|
348
348
|
/** 启动/继续动画 */
|
|
@@ -365,7 +365,7 @@ function Hs(r, i, t, e, s = 4) {
|
|
|
365
365
|
getParams: () => ({ min: l, max: c, steps: h, precision: s, stepSize: f })
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function ri(r, i, t, e, s = 4) {
|
|
369
369
|
if (t <= 0) return console.error("动画步数 必须为正数");
|
|
370
370
|
const n = (u) => Number(u.toFixed(s)), o = i - r, a = n(Math.abs(o) / t);
|
|
371
371
|
if (a === 0) return console.error("数值精度过低,致使动画步长为 0");
|
|
@@ -376,7 +376,7 @@ function Je(r, i, t, e, s = 4) {
|
|
|
376
376
|
};
|
|
377
377
|
h();
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function qs(r, i, t, e) {
|
|
380
380
|
const s = (l) => 3 * (1 - l) ** 2 * l * r + 3 * (1 - l) * l ** 2 * t + l ** 3, n = (l) => 3 * (1 - l) ** 2 * l * i + 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 Fs(r, i, t, e) {
|
|
|
404
404
|
return n(a(c));
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Ks(r, i = "image/png") {
|
|
408
408
|
try {
|
|
409
409
|
let t, e = i;
|
|
410
410
|
if (r instanceof File)
|
|
@@ -441,17 +441,17 @@ function zs(r, i = "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
|
-
function
|
|
447
|
+
function Qs(r, i, t = 2) {
|
|
448
448
|
return !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : i === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (r / i * 100).toFixed(t) + "%";
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function se(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 Js(r, i) {
|
|
455
455
|
const t = {
|
|
456
456
|
join: !0,
|
|
457
457
|
suffix: "",
|
|
@@ -462,16 +462,16 @@ function Gs(r, i) {
|
|
|
462
462
|
}, o = Number(r);
|
|
463
463
|
if (isNaN(o)) return e ? `0${s}` : [0, s];
|
|
464
464
|
const a = Math.abs(o), l = o >= 0, c = Math.max(0, Math.floor(Math.log10(a) / 4)), h = Math.pow(1e4, c), u = a / h, f = (l ? 1 : -1) * parseFloat(u.toFixed(Math.max(0, n)));
|
|
465
|
-
return e ? `${f}${
|
|
465
|
+
return e ? `${f}${Ce[c]}${s}` : [f, Ce[c] + s];
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function tn(r) {
|
|
468
468
|
const i = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
469
469
|
let t = 0;
|
|
470
470
|
for (; r > 1024; )
|
|
471
471
|
r /= 1024, t++;
|
|
472
472
|
return `${Math.round(r * 100) / 100} ${i[t]}`;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function oi(r, i = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
475
475
|
const e = new Date(r);
|
|
476
476
|
if (isNaN(e.getTime()))
|
|
477
477
|
return console.error("Invalid date"), "";
|
|
@@ -490,15 +490,15 @@ function ti(r, i = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
|
490
490
|
return t ? String(o).padStart(2, "0") : String(o);
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function ne(r, i = "file") {
|
|
494
494
|
if (!r || (r = String(r).trim(), r === "")) return i;
|
|
495
495
|
const t = r.split("/");
|
|
496
496
|
return t[t.length - 1].split("?")[0];
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function en(r, i) {
|
|
499
499
|
return r = r.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), i ? r.replace(/[^a-zA-Z]+/g, "") : r;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function sn(r, i, t = ",") {
|
|
502
502
|
const e = new RegExp(
|
|
503
503
|
`(^|${t})${i}(${t}|$)`,
|
|
504
504
|
"g"
|
|
@@ -507,7 +507,7 @@ function $s(r, i, t = ",") {
|
|
|
507
507
|
return n === o ? t : "";
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function nn(r, i = !0) {
|
|
511
511
|
const t = {
|
|
512
512
|
"\b": "\\b",
|
|
513
513
|
" ": "\\t",
|
|
@@ -524,7 +524,7 @@ function js(r, i = !0) {
|
|
|
524
524
|
(s) => t[s]
|
|
525
525
|
) : r.replace(/\\[btnvfrs]/g, (s) => e[s] || s);
|
|
526
526
|
}
|
|
527
|
-
const
|
|
527
|
+
const Nt = [
|
|
528
528
|
["年", 365 * 24 * 60 * 60 * 1e3],
|
|
529
529
|
["月", 30 * 24 * 60 * 60 * 1e3],
|
|
530
530
|
["周", 7 * 24 * 60 * 60 * 1e3],
|
|
@@ -534,21 +534,21 @@ const It = [
|
|
|
534
534
|
["秒", 1e3],
|
|
535
535
|
["毫秒", 1]
|
|
536
536
|
];
|
|
537
|
-
function
|
|
537
|
+
function rn(r, i) {
|
|
538
538
|
if (!Number.isFinite(r) || r < 0) return "0毫秒";
|
|
539
539
|
r = Math.round(r);
|
|
540
|
-
const t = i ?
|
|
541
|
-
for (let s = e; s <
|
|
542
|
-
const [n, o] =
|
|
540
|
+
const t = i ? Nt.findIndex(([s]) => s === i) : 0, e = t === -1 ? 0 : t;
|
|
541
|
+
for (let s = e; s < Nt.length; s++) {
|
|
542
|
+
const [n, o] = Nt[s];
|
|
543
543
|
if (r >= o) {
|
|
544
544
|
const a = o === 1 ? r : Math.round(r / o * 10) / 10;
|
|
545
545
|
let l = Number.isInteger(a) ? a : a.toFixed(1).replace(/\.0$/, "");
|
|
546
|
-
return n ===
|
|
546
|
+
return n === Nt[e][0] && (l = se(Number(l))), `${l}${n}`;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
return "0毫秒";
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function on(r, i) {
|
|
552
552
|
if (i < 1)
|
|
553
553
|
return console.error("分割大小必须大于0"), [];
|
|
554
554
|
const t = [];
|
|
@@ -558,24 +558,24 @@ function qs(r, i) {
|
|
|
558
558
|
}
|
|
559
559
|
return t;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function we(r, i = 2) {
|
|
562
562
|
if (Array.isArray(r) && r.length >= i) {
|
|
563
563
|
for (let e = 0; e < r.length; e++)
|
|
564
564
|
if (typeof r[e] != "number" || !Number.isFinite(r[e])) return !1;
|
|
565
565
|
} else return !1;
|
|
566
566
|
return !0;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function Gt(r, i = 1, t = 2) {
|
|
569
569
|
if (Array.isArray(r) && r.length >= i) {
|
|
570
570
|
for (let s = 0; s < r.length; s++)
|
|
571
|
-
if (!
|
|
571
|
+
if (!we(r[s], t)) return !1;
|
|
572
572
|
} else return !1;
|
|
573
573
|
return !0;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function an(r, i, t) {
|
|
576
576
|
return Math.abs(r - i) <= t;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function ln(r, i) {
|
|
579
579
|
let t = !1;
|
|
580
580
|
const { x: e, y: s } = r, n = i.length;
|
|
581
581
|
for (let o = 0, a = n - 1; o < n; a = o++) {
|
|
@@ -584,7 +584,7 @@ function Zs(r, i) {
|
|
|
584
584
|
}
|
|
585
585
|
return t;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function cn(r, i, t, e) {
|
|
588
588
|
const s = Math.min(r[0], i[0]), n = Math.max(r[0], i[0]), o = Math.min(r[1], i[1]), a = Math.max(r[1], i[1]), l = [
|
|
589
589
|
[s, o],
|
|
590
590
|
// 左上
|
|
@@ -608,10 +608,10 @@ function Qs(r, i, t, e) {
|
|
|
608
608
|
}
|
|
609
609
|
return m && g;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function re(r) {
|
|
612
612
|
return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function hn(r) {
|
|
615
615
|
return [
|
|
616
616
|
"https:",
|
|
617
617
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -635,7 +635,7 @@ function Js(r) {
|
|
|
635
635
|
// VPN协议,用于创建安全的网络连接
|
|
636
636
|
].some((t) => r.startsWith(t));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function un(r) {
|
|
639
639
|
return new Promise((i, t) => {
|
|
640
640
|
if (typeof r != "string" || r.trim() === "" || !r.includes("://")) {
|
|
641
641
|
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
@@ -668,11 +668,11 @@ const ot = class ot {
|
|
|
668
668
|
static check(i, t) {
|
|
669
669
|
if (!i || typeof i != "string")
|
|
670
670
|
return console.error("Invalid URL provided"), t ? !1 : "unknown";
|
|
671
|
-
const e =
|
|
671
|
+
const e = ne(i).toLowerCase();
|
|
672
672
|
if (t) {
|
|
673
|
-
if (!
|
|
673
|
+
if (!te.hasOwnProperty(t))
|
|
674
674
|
return console.error(`Unknown file type: ${t}`), "unknown";
|
|
675
|
-
const s =
|
|
675
|
+
const s = te[t];
|
|
676
676
|
return ot._checkExtension(e, s);
|
|
677
677
|
}
|
|
678
678
|
return ot._detectFileType(e);
|
|
@@ -687,7 +687,7 @@ const ot = class ot {
|
|
|
687
687
|
*/
|
|
688
688
|
static parseAddresses(i) {
|
|
689
689
|
return !i || typeof i != "string" ? (console.error("Invalid URL provided"), []) : i.split(",").map((t) => {
|
|
690
|
-
const e =
|
|
690
|
+
const e = ne(t), s = this.check(t);
|
|
691
691
|
return { url: t, name: e, type: s };
|
|
692
692
|
});
|
|
693
693
|
}
|
|
@@ -715,7 +715,7 @@ const ot = class ot {
|
|
|
715
715
|
* @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
|
|
716
716
|
*/
|
|
717
717
|
static _normalizeType(i) {
|
|
718
|
-
return i.startsWith(".") && !i.includes("/") ?
|
|
718
|
+
return i.startsWith(".") && !i.includes("/") ? ni[i.toLowerCase()] || i : i.includes("/") ? i : `${i}/*`;
|
|
719
719
|
}
|
|
720
720
|
/**
|
|
721
721
|
* 检查URL是否具有任何指定的文件扩展名
|
|
@@ -739,13 +739,13 @@ const ot = class ot {
|
|
|
739
739
|
}
|
|
740
740
|
};
|
|
741
741
|
// 缓存文件扩展名的条目,以提高性能
|
|
742
|
-
d(ot, "cachedEntries", Object.entries(
|
|
743
|
-
let
|
|
744
|
-
const
|
|
745
|
-
function
|
|
746
|
-
return r ? r.match(
|
|
742
|
+
d(ot, "cachedEntries", Object.entries(te));
|
|
743
|
+
let Se = ot;
|
|
744
|
+
const ai = /\w*(?:\[\d+\])+|\w+/g, Te = /^\w*(?:\[\d+\])+$/, Ie = /\w+|(\[\d+\])/g, Ne = /\[(\d+)\]/;
|
|
745
|
+
function He(r) {
|
|
746
|
+
return r ? r.match(ai) || [] : [];
|
|
747
747
|
}
|
|
748
|
-
class
|
|
748
|
+
class dn {
|
|
749
749
|
constructor(i = {}) {
|
|
750
750
|
d(this, "stack", []);
|
|
751
751
|
d(this, "_index", 0);
|
|
@@ -874,7 +874,7 @@ class en {
|
|
|
874
874
|
e(t);
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
const
|
|
877
|
+
const li = {
|
|
878
878
|
// 修饰键
|
|
879
879
|
ctrl: "control",
|
|
880
880
|
ctl: "control",
|
|
@@ -903,8 +903,7 @@ const ii = {
|
|
|
903
903
|
down: "arrowdown",
|
|
904
904
|
left: "arrowleft",
|
|
905
905
|
right: "arrowright"
|
|
906
|
-
}
|
|
907
|
-
class sn {
|
|
906
|
+
}, at = class at {
|
|
908
907
|
constructor(i) {
|
|
909
908
|
/** 最近一次 `mousedown` 的目标,供 `scopeType: "click"` 使用 */
|
|
910
909
|
d(this, "lastClickDom");
|
|
@@ -927,18 +926,26 @@ class sn {
|
|
|
927
926
|
this.downKeys = [];
|
|
928
927
|
});
|
|
929
928
|
d(this, "handleKeyDown", (i) => {
|
|
930
|
-
const t = this.normalizeKey(i.key);
|
|
931
|
-
this.downKeys.includes(t)
|
|
932
|
-
|
|
933
|
-
|
|
929
|
+
const t = this.normalizeKey(i.key), e = i.repeat;
|
|
930
|
+
if (this.downKeys.includes(t)) {
|
|
931
|
+
if (!e) return;
|
|
932
|
+
} else
|
|
933
|
+
this.downKeys.push(t);
|
|
934
|
+
this.debug && console.log(
|
|
935
|
+
`[Shortcut Debug] 📥 keydown -> "${t}" ${e ? "(repeat)" : ""} | 当前按压序列: [${this.downKeys.join(", ")}]`
|
|
936
|
+
), this.checkBindings(i, e);
|
|
934
937
|
});
|
|
935
938
|
d(this, "handleKeyUp", (i) => {
|
|
936
939
|
const t = this.normalizeKey(i.key), e = this.downKeys.indexOf(t);
|
|
937
940
|
e !== -1 && (this.downKeys.splice(e, 1), this.debug && console.log(
|
|
938
941
|
`[Shortcut Debug] 📤 keyup -> "${t}" | 剩余按压序列: [${this.downKeys.join(", ")}]`
|
|
939
|
-
))
|
|
942
|
+
)), this.bindings.forEach((s) => {
|
|
943
|
+
s.allowRepeat && s.currentIndex === s.sequence.length - 1 && s.sequence[s.currentIndex].includes(t) && this.resetBinding(s);
|
|
944
|
+
});
|
|
940
945
|
});
|
|
941
|
-
this.debug = !!i,
|
|
946
|
+
this.debug = !!i, at.activeInstances++, at.activeInstances > 1 && console.warn(
|
|
947
|
+
`[_Utility_ShortcutManager] 检测到当前页面存在 ${at.activeInstances} 个活跃实例。请确保不再使用的实例已显式调用 \`destroy()\` 以释放全局 window 监听器,避免内存泄漏。`
|
|
948
|
+
), window.addEventListener("mouseover", this.handleMouseOver), window.addEventListener("mousedown", this.handleMouseDown), window.addEventListener("keydown", this.handleKeyDown), window.addEventListener("keyup", this.handleKeyUp), window.addEventListener("blur", this.clearKeys);
|
|
942
949
|
}
|
|
943
950
|
/**
|
|
944
951
|
* 注册快捷键。
|
|
@@ -960,33 +967,48 @@ class sn {
|
|
|
960
967
|
const t = this.bindings.get(i);
|
|
961
968
|
t != null && t.timerId && window.clearTimeout(t.timerId), this.bindings.delete(i);
|
|
962
969
|
}
|
|
963
|
-
/**
|
|
970
|
+
/**
|
|
971
|
+
* 彻底销毁当前实例,清空所有快捷键绑定,并移除全局 window 事件监听器。
|
|
972
|
+
*
|
|
973
|
+
* ⚠️ **调用时机**:在单页应用(如 Vue/React 组件卸载)或不需要快捷键时**务必调用**。
|
|
974
|
+
*/
|
|
964
975
|
destroy() {
|
|
965
|
-
this.bindings.forEach((i) => i.timerId && window.clearTimeout(i.timerId)), this.bindings.clear(), this.downKeys = [], this.lastClickDom = void 0, this.lastHoverDom = void 0, window.removeEventListener("mouseover", this.handleMouseOver), window.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("keydown", this.handleKeyDown), window.removeEventListener("keyup", this.handleKeyUp), window.removeEventListener("blur", this.clearKeys)
|
|
976
|
+
this.bindings.forEach((i) => i.timerId && window.clearTimeout(i.timerId)), this.bindings.clear(), this.downKeys = [], this.lastClickDom = void 0, this.lastHoverDom = void 0, window.removeEventListener("mouseover", this.handleMouseOver), window.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("keydown", this.handleKeyDown), window.removeEventListener("keyup", this.handleKeyUp), window.removeEventListener("blur", this.clearKeys), at.activeInstances = Math.max(
|
|
977
|
+
0,
|
|
978
|
+
at.activeInstances - 1
|
|
979
|
+
);
|
|
966
980
|
}
|
|
967
981
|
/**
|
|
968
982
|
* 遍历所有绑定:校验作用域与输入上下文后,用数组匹配当前步骤;
|
|
969
983
|
* 完全匹配则推进序列或触发回调,前缀匹配则等待,否则重置。
|
|
970
984
|
*/
|
|
971
|
-
checkBindings(i) {
|
|
972
|
-
let
|
|
973
|
-
const
|
|
974
|
-
this.bindings.forEach((
|
|
975
|
-
const
|
|
976
|
-
if (!this.isValidScope(
|
|
977
|
-
this.debug && this.isPrefixMatch(this.downKeys,
|
|
978
|
-
`[Shortcut Debug] ⚠️ 快捷键 "${
|
|
985
|
+
checkBindings(i, t) {
|
|
986
|
+
let e = !1;
|
|
987
|
+
const s = document.activeElement, n = Date.now();
|
|
988
|
+
this.bindings.forEach((o, a) => {
|
|
989
|
+
const l = o.sequence[o.currentIndex];
|
|
990
|
+
if (!this.isValidScope(o)) {
|
|
991
|
+
this.debug && this.isPrefixMatch(this.downKeys, l) && console.warn(
|
|
992
|
+
`[Shortcut Debug] ⚠️ 快捷键 "${a}" 匹配成功但由于作用域限制(scope: ${o.scope})未触发`
|
|
979
993
|
);
|
|
980
994
|
return;
|
|
981
995
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
996
|
+
if (this.isValidContext(o, s))
|
|
997
|
+
if (this.isExactMatch(this.downKeys, l))
|
|
998
|
+
if (e = !0, o.currentIndex === o.sequence.length - 1) {
|
|
999
|
+
if (t && (!o.allowRepeat || o.repeatInterval && o.lastFiredAt && n - o.lastFiredAt < o.repeatInterval))
|
|
1000
|
+
return;
|
|
1001
|
+
this.debug && console.log(
|
|
1002
|
+
`[Shortcut Debug] 🎉 成功触发快捷键: "${a}"`
|
|
1003
|
+
), o.callback(i), o.lastFiredAt = n, o.allowRepeat || this.resetBinding(o);
|
|
1004
|
+
} else
|
|
1005
|
+
t || (this.debug && console.log(
|
|
1006
|
+
`[Shortcut Debug] ⏳ 序列匹配中进度: (${o.currentIndex + 1}/${o.sequence.length}),等待下一步...`
|
|
1007
|
+
), o.currentIndex++, this.startSequenceTimer(o));
|
|
1008
|
+
else this.isPrefixMatch(this.downKeys, l) || o.currentIndex > 0 && (this.debug && console.log(
|
|
1009
|
+
`[Shortcut Debug] 🛑 按键序列不匹配,重置快捷键 "${a}" 的进度`
|
|
1010
|
+
), this.resetBinding(o));
|
|
1011
|
+
}), e && i.preventDefault();
|
|
990
1012
|
}
|
|
991
1013
|
/** 启动多步序列超时;超时未按下一步则重置 `currentIndex` */
|
|
992
1014
|
startSequenceTimer(i) {
|
|
@@ -995,7 +1017,7 @@ class sn {
|
|
|
995
1017
|
}, i.timeout ?? 5e3);
|
|
996
1018
|
}
|
|
997
1019
|
resetBinding(i) {
|
|
998
|
-
i.currentIndex = 0, i.timerId && (window.clearTimeout(i.timerId), i.timerId = void 0);
|
|
1020
|
+
i.currentIndex = 0, i.lastFiredAt = void 0, i.timerId && (window.clearTimeout(i.timerId), i.timerId = void 0);
|
|
999
1021
|
}
|
|
1000
1022
|
isValidScope(i) {
|
|
1001
1023
|
var t;
|
|
@@ -1020,7 +1042,7 @@ class sn {
|
|
|
1020
1042
|
*/
|
|
1021
1043
|
normalizeKey(i) {
|
|
1022
1044
|
const t = i.toLowerCase();
|
|
1023
|
-
return
|
|
1045
|
+
return li[t] ?? t;
|
|
1024
1046
|
}
|
|
1025
1047
|
/** 当前按下键与预期组合键在长度与顺序上完全一致 */
|
|
1026
1048
|
isExactMatch(i, t) {
|
|
@@ -1033,8 +1055,11 @@ class sn {
|
|
|
1033
1055
|
isPrefixMatch(i, t) {
|
|
1034
1056
|
return i.length > t.length ? !1 : i.every((e, s) => e === t[s]);
|
|
1035
1057
|
}
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1058
|
+
};
|
|
1059
|
+
// 静态计数器:记录当前活跃的实例数量
|
|
1060
|
+
d(at, "activeInstances", 0);
|
|
1061
|
+
let Ee = at;
|
|
1062
|
+
function fn(r, i = 3e3) {
|
|
1038
1063
|
if (typeof r != "function")
|
|
1039
1064
|
return console.error("非函数:", r);
|
|
1040
1065
|
const t = window.requestIdleCallback, e = function(s) {
|
|
@@ -1042,7 +1067,7 @@ function nn(r, i = 3e3) {
|
|
|
1042
1067
|
};
|
|
1043
1068
|
t ? t(e, { timeout: i }) : requestAnimationFrame(() => r());
|
|
1044
1069
|
}
|
|
1045
|
-
function
|
|
1070
|
+
function ci(r, i) {
|
|
1046
1071
|
const t = Date.now();
|
|
1047
1072
|
return new Promise((e, s) => {
|
|
1048
1073
|
const n = () => {
|
|
@@ -1054,19 +1079,19 @@ function si(r, i) {
|
|
|
1054
1079
|
n();
|
|
1055
1080
|
});
|
|
1056
1081
|
}
|
|
1057
|
-
function
|
|
1082
|
+
function ct(r, i, t = [], e = Date.now()) {
|
|
1058
1083
|
if (e < Date.now() - 50) {
|
|
1059
1084
|
console.error("_MergeObjects 合并异常:疑似死循环");
|
|
1060
1085
|
return;
|
|
1061
1086
|
}
|
|
1062
|
-
const s =
|
|
1087
|
+
const s = re(r), n = re(i);
|
|
1063
1088
|
if (s != n) return i;
|
|
1064
1089
|
if (s == "object" || s == "array") {
|
|
1065
1090
|
if (t.some(([o, a]) => o == r && a == i)) return r;
|
|
1066
1091
|
if (t.push([r, i]), s == "object") {
|
|
1067
1092
|
for (const o in i)
|
|
1068
1093
|
if (Object.prototype.hasOwnProperty.call(i, o)) {
|
|
1069
|
-
const a = i[o], l = r[o], c =
|
|
1094
|
+
const a = i[o], l = r[o], c = ct(
|
|
1070
1095
|
l,
|
|
1071
1096
|
a,
|
|
1072
1097
|
t,
|
|
@@ -1077,7 +1102,7 @@ function lt(r, i, t = [], e = Date.now()) {
|
|
|
1077
1102
|
return r;
|
|
1078
1103
|
} else if (s == "array")
|
|
1079
1104
|
return i.forEach((o, a) => {
|
|
1080
|
-
const l = o, c = r[a], h =
|
|
1105
|
+
const l = o, c = r[a], h = ct(
|
|
1081
1106
|
c,
|
|
1082
1107
|
l,
|
|
1083
1108
|
t,
|
|
@@ -1087,13 +1112,13 @@ function lt(r, i, t = [], e = Date.now()) {
|
|
|
1087
1112
|
}), r;
|
|
1088
1113
|
} else return i;
|
|
1089
1114
|
}
|
|
1090
|
-
function
|
|
1115
|
+
function oe(r = "") {
|
|
1091
1116
|
return r + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
|
|
1092
1117
|
const t = Math.random() * 16 | 0;
|
|
1093
1118
|
return (i === "x" ? t : t & 3 | 8).toString(16);
|
|
1094
1119
|
});
|
|
1095
1120
|
}
|
|
1096
|
-
function
|
|
1121
|
+
function Fe(r, i) {
|
|
1097
1122
|
let t;
|
|
1098
1123
|
return function(...e) {
|
|
1099
1124
|
clearTimeout(t), t = setTimeout(() => {
|
|
@@ -1101,7 +1126,7 @@ function Le(r, i) {
|
|
|
1101
1126
|
}, i);
|
|
1102
1127
|
};
|
|
1103
1128
|
}
|
|
1104
|
-
function
|
|
1129
|
+
function mn(r, i) {
|
|
1105
1130
|
let t = -1 / 0;
|
|
1106
1131
|
return function(...e) {
|
|
1107
1132
|
const s = performance.now();
|
|
@@ -1115,52 +1140,52 @@ function rn(r, i) {
|
|
|
1115
1140
|
}
|
|
1116
1141
|
};
|
|
1117
1142
|
}
|
|
1118
|
-
function
|
|
1143
|
+
function pn(r, i) {
|
|
1119
1144
|
if (!r || !i) return r;
|
|
1120
|
-
const t =
|
|
1145
|
+
const t = He(i);
|
|
1121
1146
|
return t.length ? t.reduce((e, s, n) => {
|
|
1122
1147
|
const o = n === t.length - 1;
|
|
1123
|
-
if (
|
|
1124
|
-
const a = s.match(
|
|
1148
|
+
if (Te.test(s)) {
|
|
1149
|
+
const a = s.match(Ie) || [];
|
|
1125
1150
|
return a.reduce((l, c, h) => {
|
|
1126
1151
|
if (/^\w+$/.test(c))
|
|
1127
1152
|
return l[c] || (h < a.length - 1 ? [] : {});
|
|
1128
|
-
const u = c.match(
|
|
1153
|
+
const u = c.match(Ne), f = u ? parseInt(u[1], 10) : 0, m = h === a.length - 1;
|
|
1129
1154
|
return m && o ? l[f] : l[f] || (m ? {} : []);
|
|
1130
1155
|
}, e);
|
|
1131
1156
|
}
|
|
1132
1157
|
return o ? e[s] : e[s] || {};
|
|
1133
1158
|
}, r) : r;
|
|
1134
1159
|
}
|
|
1135
|
-
function
|
|
1160
|
+
function gn(r, i, t, e) {
|
|
1136
1161
|
if (!r || !i) return t;
|
|
1137
|
-
const s =
|
|
1162
|
+
const s = He(i);
|
|
1138
1163
|
return s.length ? s.reduce((n, o, a) => {
|
|
1139
1164
|
const l = a === s.length - 1;
|
|
1140
|
-
if (
|
|
1141
|
-
const c = o.match(
|
|
1165
|
+
if (Te.test(o)) {
|
|
1166
|
+
const c = o.match(Ie) || [];
|
|
1142
1167
|
return c.reduce((h, u, f) => {
|
|
1143
1168
|
const m = f === c.length - 1;
|
|
1144
1169
|
if (/^\w+$/.test(u))
|
|
1145
1170
|
return h.hasOwnProperty(u) || (h[u] = []), h[u];
|
|
1146
|
-
const g = u.match(
|
|
1171
|
+
const g = u.match(Ne), p = g ? parseInt(g[1], 10) : 0, y = m && l;
|
|
1147
1172
|
return h.hasOwnProperty(p) ? y && !e && (h[p] = t) : h[p] = y ? t : m ? {} : [], h[p];
|
|
1148
1173
|
}, n);
|
|
1149
1174
|
}
|
|
1150
1175
|
return l ? ((!e || !n.hasOwnProperty(o)) && (n[o] = t), n[o]) : (n.hasOwnProperty(o) || (n[o] = {}), n[o]);
|
|
1151
1176
|
}, r) : t;
|
|
1152
1177
|
}
|
|
1153
|
-
function
|
|
1178
|
+
function vn(r) {
|
|
1154
1179
|
return r.map((i, t) => r.slice(t).concat(r.slice(0, t)));
|
|
1155
1180
|
}
|
|
1156
|
-
function
|
|
1181
|
+
function hi(r) {
|
|
1157
1182
|
const i = window.structuredClone, t = (e, s = /* @__PURE__ */ new WeakMap()) => {
|
|
1158
1183
|
const n = e;
|
|
1159
1184
|
if (n === null || typeof n != "object")
|
|
1160
1185
|
return n;
|
|
1161
1186
|
if (s.has(n))
|
|
1162
1187
|
return s.get(n);
|
|
1163
|
-
switch (
|
|
1188
|
+
switch (re(n)) {
|
|
1164
1189
|
case "array": {
|
|
1165
1190
|
const a = [];
|
|
1166
1191
|
s.set(n, a);
|
|
@@ -1244,7 +1269,7 @@ function ni(r) {
|
|
|
1244
1269
|
return console.warn("structuredClone error:", e), i && t(r);
|
|
1245
1270
|
}
|
|
1246
1271
|
}
|
|
1247
|
-
function
|
|
1272
|
+
function ui(r, i) {
|
|
1248
1273
|
const t = [
|
|
1249
1274
|
[11, "#d03050"],
|
|
1250
1275
|
[8, "#f0a020"],
|
|
@@ -1276,7 +1301,7 @@ function ri(r, i) {
|
|
|
1276
1301
|
), f;
|
|
1277
1302
|
};
|
|
1278
1303
|
}
|
|
1279
|
-
function
|
|
1304
|
+
function yn(r) {
|
|
1280
1305
|
const i = Date.now();
|
|
1281
1306
|
let t = performance.now();
|
|
1282
1307
|
for (; Date.now() - i < r; ) {
|
|
@@ -1289,7 +1314,7 @@ function cn(r) {
|
|
|
1289
1314
|
}
|
|
1290
1315
|
return Date.now() - i;
|
|
1291
1316
|
}
|
|
1292
|
-
class
|
|
1317
|
+
class di {
|
|
1293
1318
|
constructor() {
|
|
1294
1319
|
}
|
|
1295
1320
|
/**
|
|
@@ -1471,9 +1496,9 @@ class oi {
|
|
|
1471
1496
|
return `hsva(${Math.round(s)}, ${Math.round(n)}%, ${Math.round(o)}%, ${a})`;
|
|
1472
1497
|
}
|
|
1473
1498
|
}
|
|
1474
|
-
d(
|
|
1475
|
-
var
|
|
1476
|
-
class
|
|
1499
|
+
d(di, "DEFAULT_ALPHA", 1);
|
|
1500
|
+
var wt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(wt || {});
|
|
1501
|
+
class wn {
|
|
1477
1502
|
constructor(i, t) {
|
|
1478
1503
|
/** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
|
|
1479
1504
|
d(this, "soundSources");
|
|
@@ -1563,11 +1588,11 @@ class hn {
|
|
|
1563
1588
|
}), l;
|
|
1564
1589
|
}
|
|
1565
1590
|
}
|
|
1566
|
-
function
|
|
1591
|
+
function _e(r, i) {
|
|
1567
1592
|
for (const t of Object.keys(i))
|
|
1568
1593
|
i[t] !== void 0 && (r[t] = i[t]);
|
|
1569
1594
|
}
|
|
1570
|
-
class
|
|
1595
|
+
class xn {
|
|
1571
1596
|
constructor(i) {
|
|
1572
1597
|
/** WebSocket地址 */
|
|
1573
1598
|
d(this, "url");
|
|
@@ -1608,7 +1633,7 @@ class un {
|
|
|
1608
1633
|
});
|
|
1609
1634
|
if (!i) return;
|
|
1610
1635
|
const { url: t, ping: e, maxRetryCount: s, retryInterval: n } = i;
|
|
1611
|
-
e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e :
|
|
1636
|
+
e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e : _e(this.pingConfig, e)), _e(this.retryConfig, {
|
|
1612
1637
|
maxCount: s,
|
|
1613
1638
|
interval: n
|
|
1614
1639
|
}), t && this.start(t);
|
|
@@ -1659,7 +1684,7 @@ class un {
|
|
|
1659
1684
|
(i = this.socket) == null || i.close(), this.socket = void 0;
|
|
1660
1685
|
}
|
|
1661
1686
|
}
|
|
1662
|
-
function
|
|
1687
|
+
function bn(r, i = 10) {
|
|
1663
1688
|
let t = 0, e = i;
|
|
1664
1689
|
function s() {
|
|
1665
1690
|
if (e > 0)
|
|
@@ -1673,7 +1698,7 @@ function dn(r, i = 10) {
|
|
|
1673
1698
|
t = Date.now(), s();
|
|
1674
1699
|
});
|
|
1675
1700
|
}
|
|
1676
|
-
function
|
|
1701
|
+
function Pn(r) {
|
|
1677
1702
|
const i = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
1678
1703
|
function e() {
|
|
1679
1704
|
return navigator.clipboard.writeText(r).then(i).catch(t);
|
|
@@ -1700,8 +1725,8 @@ function fn(r) {
|
|
|
1700
1725
|
}
|
|
1701
1726
|
return navigator.clipboard ? e().catch(o) : o();
|
|
1702
1727
|
}
|
|
1703
|
-
function
|
|
1704
|
-
const t =
|
|
1728
|
+
function Cn(r, i) {
|
|
1729
|
+
const t = Le[r];
|
|
1705
1730
|
if (!t) return console.error(`未知纸张类型: ${r}`);
|
|
1706
1731
|
const { width: e, height: s } = t, n = (g) => g / 25.4, a = typeof window < "u" ? window.devicePixelRatio * 96 : 300, l = (g) => Math.round(n(g) * a), c = l(e), h = l(s), u = l(i), f = Math.max(0, c - 2 * u), m = Math.max(0, h - 2 * u);
|
|
1707
1732
|
return {
|
|
@@ -1717,7 +1742,7 @@ function mn(r, i) {
|
|
|
1717
1742
|
paperHeightPx: h
|
|
1718
1743
|
};
|
|
1719
1744
|
}
|
|
1720
|
-
class
|
|
1745
|
+
class Ht {
|
|
1721
1746
|
constructor() {
|
|
1722
1747
|
}
|
|
1723
1748
|
/** 初始化标签页管理器 */
|
|
@@ -1737,13 +1762,13 @@ class Nt {
|
|
|
1737
1762
|
/** 处理BroadcastChannel消息 */
|
|
1738
1763
|
static handleChannelMessage(i) {
|
|
1739
1764
|
const { type: t, responseKey: e, name: s } = i.data;
|
|
1740
|
-
if (t ===
|
|
1765
|
+
if (t === wt.RESPONSE) {
|
|
1741
1766
|
const n = this.pendingQueries.get(e);
|
|
1742
1767
|
n == null || n.forEach((o) => o(s));
|
|
1743
|
-
} else if (t ===
|
|
1768
|
+
} else if (t === wt.QUERY) {
|
|
1744
1769
|
if (this.pendingQueries.has(e) || s != "*" && s != window.name) return;
|
|
1745
1770
|
const n = {
|
|
1746
|
-
type:
|
|
1771
|
+
type: wt.RESPONSE,
|
|
1747
1772
|
responseKey: e,
|
|
1748
1773
|
name: window.name
|
|
1749
1774
|
};
|
|
@@ -1759,16 +1784,16 @@ class Nt {
|
|
|
1759
1784
|
const o = "请先初始化标签页管理器";
|
|
1760
1785
|
return console.error(o), Promise.reject(o);
|
|
1761
1786
|
}
|
|
1762
|
-
const t =
|
|
1787
|
+
const t = oe();
|
|
1763
1788
|
let e = !1;
|
|
1764
1789
|
const s = this.pendingQueries.get(t) || [];
|
|
1765
1790
|
s.push(() => e = !0), this.pendingQueries.set(t, s);
|
|
1766
1791
|
const n = {
|
|
1767
|
-
type:
|
|
1792
|
+
type: wt.QUERY,
|
|
1768
1793
|
responseKey: t,
|
|
1769
1794
|
name: i
|
|
1770
1795
|
};
|
|
1771
|
-
return this.channel.postMessage(n),
|
|
1796
|
+
return this.channel.postMessage(n), ci(() => e, this.timeout).finally(
|
|
1772
1797
|
() => this.pendingQueries.delete(t)
|
|
1773
1798
|
);
|
|
1774
1799
|
}
|
|
@@ -1790,10 +1815,10 @@ class Nt {
|
|
|
1790
1815
|
const n = "请先初始化标签页管理器";
|
|
1791
1816
|
return console.error(n), Promise.reject(n);
|
|
1792
1817
|
}
|
|
1793
|
-
const i =
|
|
1818
|
+
const i = oe(), t = [], e = this.pendingQueries.get(i) || [];
|
|
1794
1819
|
e.push((n) => t.push(n)), this.pendingQueries.set(i, e);
|
|
1795
1820
|
const s = {
|
|
1796
|
-
type:
|
|
1821
|
+
type: wt.QUERY,
|
|
1797
1822
|
responseKey: i,
|
|
1798
1823
|
name: "*"
|
|
1799
1824
|
};
|
|
@@ -1805,15 +1830,15 @@ class Nt {
|
|
|
1805
1830
|
}
|
|
1806
1831
|
}
|
|
1807
1832
|
/** 初始化完成标志 */
|
|
1808
|
-
d(
|
|
1809
|
-
d(
|
|
1810
|
-
d(
|
|
1833
|
+
d(Ht, "initFinish", !1), /** 频道 */
|
|
1834
|
+
d(Ht, "channel", new BroadcastChannel("nhanh-pure-function")), /** 等待回执消息时间上限(上限) */
|
|
1835
|
+
d(Ht, "timeout", 150), /**
|
|
1811
1836
|
* 待处理查询
|
|
1812
1837
|
* @param key 回执消息key
|
|
1813
1838
|
* @param callback 匹配标签页的回调函数
|
|
1814
1839
|
*/
|
|
1815
|
-
d(
|
|
1816
|
-
class
|
|
1840
|
+
d(Ht, "pendingQueries", /* @__PURE__ */ new Map());
|
|
1841
|
+
class Sn {
|
|
1817
1842
|
constructor() {
|
|
1818
1843
|
/** 用户状态:active(活跃) / idle(闲置) */
|
|
1819
1844
|
d(this, "status", "active");
|
|
@@ -1862,7 +1887,7 @@ class pn {
|
|
|
1862
1887
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
1863
1888
|
* MIT Licence
|
|
1864
1889
|
*/
|
|
1865
|
-
var
|
|
1890
|
+
var ae = 9e15, ut = 1e9, le = "0123456789abcdef", Xt = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Yt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", ce = {
|
|
1866
1891
|
// These values must be integers within the stated ranges (inclusive).
|
|
1867
1892
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
1868
1893
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -1915,12 +1940,12 @@ var re = 9e15, ht = 1e9, oe = "0123456789abcdef", Gt = "2.3025850929940456840179
|
|
|
1915
1940
|
// -1 to -EXP_LIMIT
|
|
1916
1941
|
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
1917
1942
|
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
1918
|
-
maxE:
|
|
1943
|
+
maxE: ae,
|
|
1919
1944
|
// 1 to EXP_LIMIT
|
|
1920
1945
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
1921
1946
|
crypto: !1
|
|
1922
1947
|
// true/false
|
|
1923
|
-
},
|
|
1948
|
+
}, ze, st, E = !0, Kt = "[DecimalError] ", ht = Kt + "Invalid argument: ", Be = Kt + "Precision limit exceeded", Ue = Kt + "crypto unavailable", Ge = "[object Decimal]", F = Math.floor, I = Math.pow, fi = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, mi = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, pi = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Xe = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Z = 1e7, S = 7, gi = 9007199254740991, vi = Xt.length - 1, he = Yt.length - 1, v = { toStringTag: Ge };
|
|
1924
1949
|
v.absoluteValue = v.abs = function() {
|
|
1925
1950
|
var r = new this.constructor(this);
|
|
1926
1951
|
return r.s < 0 && (r.s = 1), C(r);
|
|
@@ -1931,7 +1956,7 @@ v.ceil = function() {
|
|
|
1931
1956
|
v.clampedTo = v.clamp = function(r, i) {
|
|
1932
1957
|
var t, e = this, s = e.constructor;
|
|
1933
1958
|
if (r = new s(r), i = new s(i), !r.s || !i.s) return new s(NaN);
|
|
1934
|
-
if (r.gt(i)) throw Error(
|
|
1959
|
+
if (r.gt(i)) throw Error(ht + i);
|
|
1935
1960
|
return t = e.cmp(r), t < 0 ? r : e.cmp(i) > 0 ? i : new s(e);
|
|
1936
1961
|
};
|
|
1937
1962
|
v.comparedTo = v.cmp = function(r) {
|
|
@@ -1947,13 +1972,13 @@ v.comparedTo = v.cmp = function(r) {
|
|
|
1947
1972
|
};
|
|
1948
1973
|
v.cosine = v.cos = function() {
|
|
1949
1974
|
var r, i, t = this, e = t.constructor;
|
|
1950
|
-
return t.d ? t.d[0] ? (r = e.precision, i = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t =
|
|
1975
|
+
return t.d ? t.d[0] ? (r = e.precision, i = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = yi(e, qe(e, t)), e.precision = r, e.rounding = i, C(st == 2 || st == 3 ? t.neg() : t, r, i, !0)) : new e(1) : new e(NaN);
|
|
1951
1976
|
};
|
|
1952
1977
|
v.cubeRoot = v.cbrt = function() {
|
|
1953
1978
|
var r, i, t, e, s, n, o, a, l, c, h = this, u = h.constructor;
|
|
1954
1979
|
if (!h.isFinite() || h.isZero()) return new u(h);
|
|
1955
|
-
for (
|
|
1956
|
-
if (a = e, l = a.times(a).times(a), c = l.plus(h), e =
|
|
1980
|
+
for (E = !1, n = h.s * I(h.s * h, 1 / 3), !n || Math.abs(n) == 1 / 0 ? (t = N(h.d), r = h.e, (n = (r - t.length + 1) % 3) && (t += n == 1 || n == -2 ? "0" : "00"), n = I(t, 1 / 3), r = F((r + 1) / 3) - (r % 3 == (r < 0 ? -1 : 2)), n == 1 / 0 ? t = "5e" + r : (t = n.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + r), e = new u(t), e.s = h.s) : e = new u(n.toString()), o = (r = u.precision) + 3; ; )
|
|
1981
|
+
if (a = e, l = a.times(a).times(a), c = l.plus(h), e = A(c.plus(h).times(a), c.plus(l), o + 2, 1), N(a.d).slice(0, o) === (t = N(e.d)).slice(0, o))
|
|
1957
1982
|
if (t = t.slice(o - 3, o + 1), t == "9999" || !s && t == "4999") {
|
|
1958
1983
|
if (!s && (C(a, r + 1, 0), a.times(a).times(a).eq(h))) {
|
|
1959
1984
|
e = a;
|
|
@@ -1964,7 +1989,7 @@ v.cubeRoot = v.cbrt = function() {
|
|
|
1964
1989
|
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (C(e, r + 1, 1), i = !e.times(e).times(e).eq(h));
|
|
1965
1990
|
break;
|
|
1966
1991
|
}
|
|
1967
|
-
return
|
|
1992
|
+
return E = !0, C(e, r, u.rounding, i);
|
|
1968
1993
|
};
|
|
1969
1994
|
v.decimalPlaces = v.dp = function() {
|
|
1970
1995
|
var r, i = this.d, t = NaN;
|
|
@@ -1975,11 +2000,11 @@ v.decimalPlaces = v.dp = function() {
|
|
|
1975
2000
|
return t;
|
|
1976
2001
|
};
|
|
1977
2002
|
v.dividedBy = v.div = function(r) {
|
|
1978
|
-
return
|
|
2003
|
+
return A(this, new this.constructor(r));
|
|
1979
2004
|
};
|
|
1980
2005
|
v.dividedToIntegerBy = v.divToInt = function(r) {
|
|
1981
2006
|
var i = this, t = i.constructor;
|
|
1982
|
-
return C(
|
|
2007
|
+
return C(A(i, new t(r), 0, 1, 1), t.precision, t.rounding);
|
|
1983
2008
|
};
|
|
1984
2009
|
v.equals = v.eq = function(r) {
|
|
1985
2010
|
return this.cmp(r) === 0;
|
|
@@ -1998,7 +2023,7 @@ v.hyperbolicCosine = v.cosh = function() {
|
|
|
1998
2023
|
var r, i, t, e, s, n = this, o = n.constructor, a = new o(1);
|
|
1999
2024
|
if (!n.isFinite()) return new o(n.s ? 1 / 0 : NaN);
|
|
2000
2025
|
if (n.isZero()) return a;
|
|
2001
|
-
t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, s = n.d.length, s < 32 ? (r = Math.ceil(s / 3), i = (1 /
|
|
2026
|
+
t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, s = n.d.length, s < 32 ? (r = Math.ceil(s / 3), i = (1 / Qt(4, r)).toString()) : (r = 16, i = "2.3283064365386962890625e-10"), n = Dt(o, 1, n.times(i), new o(1), !0);
|
|
2002
2027
|
for (var l, c = r, h = new o(8); c--; )
|
|
2003
2028
|
l = n.times(n), n = a.minus(l.times(h.minus(l.times(h))));
|
|
2004
2029
|
return C(n, o.precision = t, o.rounding = e, !0);
|
|
@@ -2007,9 +2032,9 @@ v.hyperbolicSine = v.sinh = function() {
|
|
|
2007
2032
|
var r, i, t, e, s = this, n = s.constructor;
|
|
2008
2033
|
if (!s.isFinite() || s.isZero()) return new n(s);
|
|
2009
2034
|
if (i = n.precision, t = n.rounding, n.precision = i + Math.max(s.e, s.sd()) + 4, n.rounding = 1, e = s.d.length, e < 3)
|
|
2010
|
-
s =
|
|
2035
|
+
s = Dt(n, 2, s, s, !0);
|
|
2011
2036
|
else {
|
|
2012
|
-
r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, s = s.times(1 /
|
|
2037
|
+
r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, s = s.times(1 / Qt(5, r)), s = Dt(n, 2, s, s, !0);
|
|
2013
2038
|
for (var o, a = new n(5), l = new n(16), c = new n(20); r--; )
|
|
2014
2039
|
o = s.times(s), s = s.times(a.plus(o.times(l.times(o).plus(c))));
|
|
2015
2040
|
}
|
|
@@ -2017,7 +2042,7 @@ v.hyperbolicSine = v.sinh = function() {
|
|
|
2017
2042
|
};
|
|
2018
2043
|
v.hyperbolicTangent = v.tanh = function() {
|
|
2019
2044
|
var r, i, t = this, e = t.constructor;
|
|
2020
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 7, e.rounding = 1,
|
|
2045
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 7, e.rounding = 1, A(t.sinh(), t.cosh(), e.precision = r, e.rounding = i)) : new e(t.s);
|
|
2021
2046
|
};
|
|
2022
2047
|
v.inverseCosine = v.acos = function() {
|
|
2023
2048
|
var r = this, i = r.constructor, t = r.abs().cmp(1), e = i.precision, s = i.rounding;
|
|
@@ -2025,15 +2050,15 @@ v.inverseCosine = v.acos = function() {
|
|
|
2025
2050
|
};
|
|
2026
2051
|
v.inverseHyperbolicCosine = v.acosh = function() {
|
|
2027
2052
|
var r, i, t = this, e = t.constructor;
|
|
2028
|
-
return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, i = e.rounding, e.precision = r + Math.max(Math.abs(t.e), t.sd()) + 4, e.rounding = 1,
|
|
2053
|
+
return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, i = e.rounding, e.precision = r + Math.max(Math.abs(t.e), t.sd()) + 4, e.rounding = 1, E = !1, t = t.times(t).minus(1).sqrt().plus(t), E = !0, e.precision = r, e.rounding = i, t.ln()) : new e(t);
|
|
2029
2054
|
};
|
|
2030
2055
|
v.inverseHyperbolicSine = v.asinh = function() {
|
|
2031
2056
|
var r, i, t = this, e = t.constructor;
|
|
2032
|
-
return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, e.rounding = 1,
|
|
2057
|
+
return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, e.rounding = 1, E = !1, t = t.times(t).plus(1).sqrt().plus(t), E = !0, e.precision = r, e.rounding = i, t.ln());
|
|
2033
2058
|
};
|
|
2034
2059
|
v.inverseHyperbolicTangent = v.atanh = function() {
|
|
2035
2060
|
var r, i, t, e, s = this, n = s.constructor;
|
|
2036
|
-
return s.isFinite() ? s.e >= 0 ? new n(s.abs().eq(1) ? s.s / 0 : s.isZero() ? s : NaN) : (r = n.precision, i = n.rounding, e = s.sd(), Math.max(e, r) < 2 * -s.e - 1 ? C(new n(s), r, i, !0) : (n.precision = t = e - s.e, s =
|
|
2061
|
+
return s.isFinite() ? s.e >= 0 ? new n(s.abs().eq(1) ? s.s / 0 : s.isZero() ? s : NaN) : (r = n.precision, i = n.rounding, e = s.sd(), Math.max(e, r) < 2 * -s.e - 1 ? C(new n(s), r, i, !0) : (n.precision = t = e - s.e, s = A(s.plus(1), new n(1).minus(s), t + r, 1), n.precision = r + 4, n.rounding = 1, s = s.ln(), n.precision = r, n.rounding = i, s.times(0.5))) : new n(NaN);
|
|
2037
2062
|
};
|
|
2038
2063
|
v.inverseSine = v.asin = function() {
|
|
2039
2064
|
var r, i, t, e, s = this, n = s.constructor;
|
|
@@ -2044,17 +2069,17 @@ v.inverseTangent = v.atan = function() {
|
|
|
2044
2069
|
if (c.isFinite()) {
|
|
2045
2070
|
if (c.isZero())
|
|
2046
2071
|
return new h(c);
|
|
2047
|
-
if (c.abs().eq(1) && u + 4 <=
|
|
2072
|
+
if (c.abs().eq(1) && u + 4 <= he)
|
|
2048
2073
|
return o = tt(h, u + 4, f).times(0.25), o.s = c.s, o;
|
|
2049
2074
|
} else {
|
|
2050
2075
|
if (!c.s) return new h(NaN);
|
|
2051
|
-
if (u + 4 <=
|
|
2076
|
+
if (u + 4 <= he)
|
|
2052
2077
|
return o = tt(h, u + 4, f).times(0.5), o.s = c.s, o;
|
|
2053
2078
|
}
|
|
2054
2079
|
for (h.precision = a = u + 10, h.rounding = 1, t = Math.min(28, a / S + 2 | 0), r = t; r; --r) c = c.div(c.times(c).plus(1).sqrt().plus(1));
|
|
2055
|
-
for (
|
|
2080
|
+
for (E = !1, i = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), s = c; r !== -1; )
|
|
2056
2081
|
if (s = s.times(l), n = o.minus(s.div(e += 2)), s = s.times(l), o = n.plus(s.div(e += 2)), o.d[i] !== void 0) for (r = i; o.d[r] === n.d[r] && r--; ) ;
|
|
2057
|
-
return t && (o = o.times(2 << t - 1)),
|
|
2082
|
+
return t && (o = o.times(2 << t - 1)), E = !0, C(o, h.precision = u, h.rounding = f, !0);
|
|
2058
2083
|
};
|
|
2059
2084
|
v.isFinite = function() {
|
|
2060
2085
|
return !!this.d;
|
|
@@ -2097,14 +2122,14 @@ v.logarithm = v.log = function(r) {
|
|
|
2097
2122
|
for (s = t[0]; s % 10 === 0; ) s /= 10;
|
|
2098
2123
|
n = s !== 1;
|
|
2099
2124
|
}
|
|
2100
|
-
if (
|
|
2125
|
+
if (E = !1, a = u + m, o = lt(c, a), e = i ? $t(h, a + 10) : lt(r, a), l = A(o, e, a, 1), At(l.d, s = u, f))
|
|
2101
2126
|
do
|
|
2102
|
-
if (a += 10, o =
|
|
2127
|
+
if (a += 10, o = lt(c, a), e = i ? $t(h, a + 10) : lt(r, a), l = A(o, e, a, 1), !n) {
|
|
2103
2128
|
+N(l.d).slice(s + 1, s + 15) + 1 == 1e14 && (l = C(l, u + 1, 0));
|
|
2104
2129
|
break;
|
|
2105
2130
|
}
|
|
2106
|
-
while (
|
|
2107
|
-
return
|
|
2131
|
+
while (At(l.d, s += 10, f));
|
|
2132
|
+
return E = !0, C(l, u, f);
|
|
2108
2133
|
};
|
|
2109
2134
|
v.minus = v.sub = function(r) {
|
|
2110
2135
|
var i, t, e, s, n, o, a, l, c, h, u, f, m = this, g = m.constructor;
|
|
@@ -2116,7 +2141,7 @@ v.minus = v.sub = function(r) {
|
|
|
2116
2141
|
if (f[0]) r.s = -r.s;
|
|
2117
2142
|
else if (c[0]) r = new g(m);
|
|
2118
2143
|
else return new g(l === 3 ? -0 : 0);
|
|
2119
|
-
return
|
|
2144
|
+
return E ? C(r, a, l) : r;
|
|
2120
2145
|
}
|
|
2121
2146
|
if (t = F(r.e / S), h = F(m.e / S), c = c.slice(), n = h - t, n) {
|
|
2122
2147
|
for (u = n < 0, u ? (i = c, n = -n, o = f.length) : (i = f, t = h, o = c.length), e = Math.max(Math.ceil(a / S), o) + 2, n > e && (n = e, i.length = 1), i.reverse(), e = n; e--; ) i.push(0);
|
|
@@ -2139,17 +2164,17 @@ v.minus = v.sub = function(r) {
|
|
|
2139
2164
|
}
|
|
2140
2165
|
for (; c[--o] === 0; ) c.pop();
|
|
2141
2166
|
for (; c[0] === 0; c.shift()) --t;
|
|
2142
|
-
return c[0] ? (r.d = c, r.e =
|
|
2167
|
+
return c[0] ? (r.d = c, r.e = Zt(c, t), E ? C(r, a, l) : r) : new g(l === 3 ? -0 : 0);
|
|
2143
2168
|
};
|
|
2144
2169
|
v.modulo = v.mod = function(r) {
|
|
2145
2170
|
var i, t = this, e = t.constructor;
|
|
2146
|
-
return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ? C(new e(t), e.precision, e.rounding) : (
|
|
2171
|
+
return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ? C(new e(t), e.precision, e.rounding) : (E = !1, e.modulo == 9 ? (i = A(t, r.abs(), 0, 3, 1), i.s *= r.s) : i = A(t, r, 0, e.modulo, 1), i = i.times(r), E = !0, t.minus(i));
|
|
2147
2172
|
};
|
|
2148
2173
|
v.naturalExponential = v.exp = function() {
|
|
2149
|
-
return
|
|
2174
|
+
return ue(this);
|
|
2150
2175
|
};
|
|
2151
2176
|
v.naturalLogarithm = v.ln = function() {
|
|
2152
|
-
return
|
|
2177
|
+
return lt(this);
|
|
2153
2178
|
};
|
|
2154
2179
|
v.negated = v.neg = function() {
|
|
2155
2180
|
var r = new this.constructor(this);
|
|
@@ -2162,7 +2187,7 @@ v.plus = v.add = function(r) {
|
|
|
2162
2187
|
if (u.s != r.s)
|
|
2163
2188
|
return r.s = -r.s, u.minus(r);
|
|
2164
2189
|
if (c = u.d, h = r.d, a = f.precision, l = f.rounding, !c[0] || !h[0])
|
|
2165
|
-
return h[0] || (r = new f(u)),
|
|
2190
|
+
return h[0] || (r = new f(u)), E ? C(r, a, l) : r;
|
|
2166
2191
|
if (n = F(u.e / S), e = F(r.e / S), c = c.slice(), s = n - e, s) {
|
|
2167
2192
|
for (s < 0 ? (t = c, s = -s, o = h.length) : (t = h, e = n, o = c.length), n = Math.ceil(a / S), o = n > o ? n + 1 : o + 1, s > o && (s = o, t.length = 1), t.reverse(); s--; ) t.push(0);
|
|
2168
2193
|
t.reverse();
|
|
@@ -2170,12 +2195,12 @@ v.plus = v.add = function(r) {
|
|
|
2170
2195
|
for (o = c.length, s = h.length, o - s < 0 && (s = o, t = h, h = c, c = t), i = 0; s; )
|
|
2171
2196
|
i = (c[--s] = c[s] + h[s] + i) / Z | 0, c[s] %= Z;
|
|
2172
2197
|
for (i && (c.unshift(i), ++e), o = c.length; c[--o] == 0; ) c.pop();
|
|
2173
|
-
return r.d = c, r.e =
|
|
2198
|
+
return r.d = c, r.e = Zt(c, e), E ? C(r, a, l) : r;
|
|
2174
2199
|
};
|
|
2175
2200
|
v.precision = v.sd = function(r) {
|
|
2176
2201
|
var i, t = this;
|
|
2177
|
-
if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(
|
|
2178
|
-
return t.d ? (i =
|
|
2202
|
+
if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ht + r);
|
|
2203
|
+
return t.d ? (i = Ye(t.d), r && t.e + 1 > i && (i = t.e + 1)) : i = NaN, i;
|
|
2179
2204
|
};
|
|
2180
2205
|
v.round = function() {
|
|
2181
2206
|
var r = this, i = r.constructor;
|
|
@@ -2183,14 +2208,14 @@ v.round = function() {
|
|
|
2183
2208
|
};
|
|
2184
2209
|
v.sine = v.sin = function() {
|
|
2185
2210
|
var r, i, t = this, e = t.constructor;
|
|
2186
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t =
|
|
2211
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = xi(e, qe(e, t)), e.precision = r, e.rounding = i, C(st > 2 ? t.neg() : t, r, i, !0)) : new e(NaN);
|
|
2187
2212
|
};
|
|
2188
2213
|
v.squareRoot = v.sqrt = function() {
|
|
2189
2214
|
var r, i, t, e, s, n, o = this, a = o.d, l = o.e, c = o.s, h = o.constructor;
|
|
2190
2215
|
if (c !== 1 || !a || !a[0])
|
|
2191
2216
|
return new h(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
|
|
2192
|
-
for (
|
|
2193
|
-
if (n = e, e = n.plus(
|
|
2217
|
+
for (E = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (i = N(a), (i.length + l) % 2 == 0 && (i += "0"), c = Math.sqrt(i), l = F((l + 1) / 2) - (l < 0 || l % 2), c == 1 / 0 ? i = "5e" + l : (i = c.toExponential(), i = i.slice(0, i.indexOf("e") + 1) + l), e = new h(i)) : e = new h(c.toString()), t = (l = h.precision) + 3; ; )
|
|
2218
|
+
if (n = e, e = n.plus(A(o, n, t + 2, 1)).times(0.5), N(n.d).slice(0, t) === (i = N(e.d)).slice(0, t))
|
|
2194
2219
|
if (i = i.slice(t - 3, t + 1), i == "9999" || !s && i == "4999") {
|
|
2195
2220
|
if (!s && (C(n, l + 1, 0), n.times(n).eq(o))) {
|
|
2196
2221
|
e = n;
|
|
@@ -2201,11 +2226,11 @@ v.squareRoot = v.sqrt = function() {
|
|
|
2201
2226
|
(!+i || !+i.slice(1) && i.charAt(0) == "5") && (C(e, l + 1, 1), r = !e.times(e).eq(o));
|
|
2202
2227
|
break;
|
|
2203
2228
|
}
|
|
2204
|
-
return
|
|
2229
|
+
return E = !0, C(e, l, h.rounding, r);
|
|
2205
2230
|
};
|
|
2206
2231
|
v.tangent = v.tan = function() {
|
|
2207
2232
|
var r, i, t = this, e = t.constructor;
|
|
2208
|
-
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t =
|
|
2233
|
+
return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, i = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t = A(t, new e(1).minus(t.times(t)).sqrt(), r + 10, 0), e.precision = r, e.rounding = i, C(st == 2 || st == 4 ? t.neg() : t, r, i, !0)) : new e(NaN);
|
|
2209
2234
|
};
|
|
2210
2235
|
v.times = v.mul = function(r) {
|
|
2211
2236
|
var i, t, e, s, n, o, a, l, c, h = this, u = h.constructor, f = h.d, m = (r = new u(r)).d;
|
|
@@ -2218,38 +2243,38 @@ v.times = v.mul = function(r) {
|
|
|
2218
2243
|
n[s] = (n[s] + i) % Z | 0;
|
|
2219
2244
|
}
|
|
2220
2245
|
for (; !n[--o]; ) n.pop();
|
|
2221
|
-
return i ? ++t : n.shift(), r.d = n, r.e =
|
|
2246
|
+
return i ? ++t : n.shift(), r.d = n, r.e = Zt(n, t), E ? C(r, u.precision, u.rounding) : r;
|
|
2222
2247
|
};
|
|
2223
2248
|
v.toBinary = function(r, i) {
|
|
2224
|
-
return
|
|
2249
|
+
return xe(this, 2, r, i);
|
|
2225
2250
|
};
|
|
2226
2251
|
v.toDecimalPlaces = v.toDP = function(r, i) {
|
|
2227
2252
|
var t = this, e = t.constructor;
|
|
2228
|
-
return t = new e(t), r === void 0 ? t : (U(r, 0,
|
|
2253
|
+
return t = new e(t), r === void 0 ? t : (U(r, 0, ut), i === void 0 ? i = e.rounding : U(i, 0, 8), C(t, r + t.e + 1, i));
|
|
2229
2254
|
};
|
|
2230
2255
|
v.toExponential = function(r, i) {
|
|
2231
2256
|
var t, e = this, s = e.constructor;
|
|
2232
|
-
return r === void 0 ? t = et(e, !0) : (U(r, 0,
|
|
2257
|
+
return r === void 0 ? t = et(e, !0) : (U(r, 0, ut), i === void 0 ? i = s.rounding : U(i, 0, 8), e = C(new s(e), r + 1, i), t = et(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
|
|
2233
2258
|
};
|
|
2234
2259
|
v.toFixed = function(r, i) {
|
|
2235
2260
|
var t, e, s = this, n = s.constructor;
|
|
2236
|
-
return r === void 0 ? t = et(s) : (U(r, 0,
|
|
2261
|
+
return r === void 0 ? t = et(s) : (U(r, 0, ut), i === void 0 ? i = n.rounding : U(i, 0, 8), e = C(new n(s), r + s.e + 1, i), t = et(e, !1, r + e.e + 1)), s.isNeg() && !s.isZero() ? "-" + t : t;
|
|
2237
2262
|
};
|
|
2238
2263
|
v.toFraction = function(r) {
|
|
2239
2264
|
var i, t, e, s, n, o, a, l, c, h, u, f, m = this, g = m.d, p = m.constructor;
|
|
2240
2265
|
if (!g) return new p(m);
|
|
2241
|
-
if (c = t = new p(1), e = l = new p(0), i = new p(e), n = i.e =
|
|
2266
|
+
if (c = t = new p(1), e = l = new p(0), i = new p(e), n = i.e = Ye(g) - m.e - 1, o = n % S, i.d[0] = I(10, o < 0 ? S + o : o), r == null)
|
|
2242
2267
|
r = n > 0 ? i : c;
|
|
2243
2268
|
else {
|
|
2244
|
-
if (a = new p(r), !a.isInt() || a.lt(c)) throw Error(
|
|
2269
|
+
if (a = new p(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
|
|
2245
2270
|
r = a.gt(i) ? n > 0 ? i : c : a;
|
|
2246
2271
|
}
|
|
2247
|
-
for (
|
|
2272
|
+
for (E = !1, a = new p(N(g)), h = p.precision, p.precision = n = g.length * S * 2; u = A(a, i, 0, 1, 1), s = t.plus(u.times(e)), s.cmp(r) != 1; )
|
|
2248
2273
|
t = e, e = s, s = c, c = l.plus(u.times(s)), l = s, s = i, i = a.minus(u.times(s)), a = s;
|
|
2249
|
-
return s =
|
|
2274
|
+
return s = A(r.minus(t), e, 0, 1, 1), l = l.plus(s.times(c)), t = t.plus(s.times(e)), l.s = c.s = m.s, f = A(c, e, n, 1).minus(m).abs().cmp(A(l, t, n, 1).minus(m).abs()) < 1 ? [c, e] : [l, t], p.precision = h, E = !0, f;
|
|
2250
2275
|
};
|
|
2251
2276
|
v.toHexadecimal = v.toHex = function(r, i) {
|
|
2252
|
-
return
|
|
2277
|
+
return xe(this, 16, r, i);
|
|
2253
2278
|
};
|
|
2254
2279
|
v.toNearest = function(r, i) {
|
|
2255
2280
|
var t = this, e = t.constructor;
|
|
@@ -2261,35 +2286,35 @@ v.toNearest = function(r, i) {
|
|
|
2261
2286
|
if (!r.d)
|
|
2262
2287
|
return r.s && (r.s = t.s), r;
|
|
2263
2288
|
}
|
|
2264
|
-
return r.d[0] ? (
|
|
2289
|
+
return r.d[0] ? (E = !1, t = A(t, r, 0, i, 1).times(r), E = !0, C(t)) : (r.s = t.s, t = r), t;
|
|
2265
2290
|
};
|
|
2266
2291
|
v.toNumber = function() {
|
|
2267
2292
|
return +this;
|
|
2268
2293
|
};
|
|
2269
2294
|
v.toOctal = function(r, i) {
|
|
2270
|
-
return
|
|
2295
|
+
return xe(this, 8, r, i);
|
|
2271
2296
|
};
|
|
2272
2297
|
v.toPower = v.pow = function(r) {
|
|
2273
2298
|
var i, t, e, s, n, o, a = this, l = a.constructor, c = +(r = new l(r));
|
|
2274
2299
|
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(I(+a, c));
|
|
2275
2300
|
if (a = new l(a), a.eq(1)) return a;
|
|
2276
2301
|
if (e = l.precision, n = l.rounding, r.eq(1)) return C(a, e, n);
|
|
2277
|
-
if (i = F(r.e / S), i >= r.d.length - 1 && (t = c < 0 ? -c : c) <=
|
|
2278
|
-
return s =
|
|
2302
|
+
if (i = F(r.e / S), i >= r.d.length - 1 && (t = c < 0 ? -c : c) <= gi)
|
|
2303
|
+
return s = $e(l, a, t, e), r.s < 0 ? new l(1).div(s) : C(s, e, n);
|
|
2279
2304
|
if (o = a.s, o < 0) {
|
|
2280
2305
|
if (i < r.d.length - 1) return new l(NaN);
|
|
2281
2306
|
if (r.d[i] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
2282
2307
|
return a.s = o, a;
|
|
2283
2308
|
}
|
|
2284
|
-
return t = I(+a, c), i = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, i > l.maxE + 1 || i < l.minE - 1 ? new l(i > 0 ? o / 0 : 0) : (
|
|
2309
|
+
return t = I(+a, c), i = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, i > l.maxE + 1 || i < l.minE - 1 ? new l(i > 0 ? o / 0 : 0) : (E = !1, l.rounding = a.s = 1, t = Math.min(12, (i + "").length), s = ue(r.times(lt(a, e + t)), e), s.d && (s = C(s, e + 5, 1), At(s.d, e, n) && (i = e + 10, s = C(ue(r.times(lt(a, i + t)), i), i + 5, 1), +N(s.d).slice(e + 1, e + 15) + 1 == 1e14 && (s = C(s, e + 1, 0)))), s.s = o, E = !0, l.rounding = n, C(s, e, n));
|
|
2285
2310
|
};
|
|
2286
2311
|
v.toPrecision = function(r, i) {
|
|
2287
2312
|
var t, e = this, s = e.constructor;
|
|
2288
|
-
return r === void 0 ? t = et(e, e.e <= s.toExpNeg || e.e >= s.toExpPos) : (U(r, 1,
|
|
2313
|
+
return r === void 0 ? t = et(e, e.e <= s.toExpNeg || e.e >= s.toExpPos) : (U(r, 1, ut), i === void 0 ? i = s.rounding : U(i, 0, 8), e = C(new s(e), r, i), t = et(e, r <= e.e || e.e <= s.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
|
|
2289
2314
|
};
|
|
2290
2315
|
v.toSignificantDigits = v.toSD = function(r, i) {
|
|
2291
2316
|
var t = this, e = t.constructor;
|
|
2292
|
-
return r === void 0 ? (r = e.precision, i = e.rounding) : (U(r, 1,
|
|
2317
|
+
return r === void 0 ? (r = e.precision, i = e.rounding) : (U(r, 1, ut), i === void 0 ? i = e.rounding : U(i, 0, 8)), C(new e(t), r, i);
|
|
2293
2318
|
};
|
|
2294
2319
|
v.toString = function() {
|
|
2295
2320
|
var r = this, i = r.constructor, t = et(r, r.e <= i.toExpNeg || r.e >= i.toExpPos);
|
|
@@ -2315,32 +2340,32 @@ function N(r) {
|
|
|
2315
2340
|
}
|
|
2316
2341
|
function U(r, i, t) {
|
|
2317
2342
|
if (r !== ~~r || r < i || r > t)
|
|
2318
|
-
throw Error(
|
|
2343
|
+
throw Error(ht + r);
|
|
2319
2344
|
}
|
|
2320
|
-
function
|
|
2345
|
+
function At(r, i, t, e) {
|
|
2321
2346
|
var s, n, o, a;
|
|
2322
2347
|
for (n = r[0]; n >= 10; n /= 10) --i;
|
|
2323
2348
|
return --i < 0 ? (i += S, s = 0) : (s = Math.ceil((i + 1) / S), i %= S), n = I(10, S - i), a = r[s] % n | 0, e == null ? i < 3 ? (i == 0 ? a = a / 100 | 0 : i == 1 && (a = a / 10 | 0), o = t < 4 && a == 99999 || t > 3 && a == 49999 || a == 5e4 || a == 0) : o = (t < 4 && a + 1 == n || t > 3 && a + 1 == n / 2) && (r[s + 1] / n / 100 | 0) == I(10, i - 2) - 1 || (a == n / 2 || a == 0) && (r[s + 1] / n / 100 | 0) == 0 : i < 4 ? (i == 0 ? a = a / 1e3 | 0 : i == 1 ? a = a / 100 | 0 : i == 2 && (a = a / 10 | 0), o = (e || t < 4) && a == 9999 || !e && t > 3 && a == 4999) : o = ((e || t < 4) && a + 1 == n || !e && t > 3 && a + 1 == n / 2) && (r[s + 1] / n / 1e3 | 0) == I(10, i - 3) - 1, o;
|
|
2324
2349
|
}
|
|
2325
|
-
function
|
|
2350
|
+
function zt(r, i, t) {
|
|
2326
2351
|
for (var e, s = [0], n, o = 0, a = r.length; o < a; ) {
|
|
2327
2352
|
for (n = s.length; n--; ) s[n] *= i;
|
|
2328
|
-
for (s[0] +=
|
|
2353
|
+
for (s[0] += le.indexOf(r.charAt(o++)), e = 0; e < s.length; e++)
|
|
2329
2354
|
s[e] > t - 1 && (s[e + 1] === void 0 && (s[e + 1] = 0), s[e + 1] += s[e] / t | 0, s[e] %= t);
|
|
2330
2355
|
}
|
|
2331
2356
|
return s.reverse();
|
|
2332
2357
|
}
|
|
2333
|
-
function
|
|
2358
|
+
function yi(r, i) {
|
|
2334
2359
|
var t, e, s;
|
|
2335
2360
|
if (i.isZero()) return i;
|
|
2336
|
-
e = i.d.length, e < 32 ? (t = Math.ceil(e / 3), s = (1 /
|
|
2361
|
+
e = i.d.length, e < 32 ? (t = Math.ceil(e / 3), s = (1 / Qt(4, t)).toString()) : (t = 16, s = "2.3283064365386962890625e-10"), r.precision += t, i = Dt(r, 1, i.times(s), new r(1));
|
|
2337
2362
|
for (var n = t; n--; ) {
|
|
2338
2363
|
var o = i.times(i);
|
|
2339
2364
|
i = o.times(o).minus(o).times(8).plus(1);
|
|
2340
2365
|
}
|
|
2341
2366
|
return r.precision -= t, i;
|
|
2342
2367
|
}
|
|
2343
|
-
var
|
|
2368
|
+
var A = /* @__PURE__ */ function() {
|
|
2344
2369
|
function r(e, s, n) {
|
|
2345
2370
|
var o, a = 0, l = e.length;
|
|
2346
2371
|
for (e = e.slice(); l--; )
|
|
@@ -2365,35 +2390,35 @@ var V = /* @__PURE__ */ function() {
|
|
|
2365
2390
|
for (; !e[0] && e.length > 1; ) e.shift();
|
|
2366
2391
|
}
|
|
2367
2392
|
return function(e, s, n, o, a, l) {
|
|
2368
|
-
var c, h, u, f, m, g, p, y, w, b, P,
|
|
2369
|
-
if (!H || !H[0] || !
|
|
2370
|
-
return new
|
|
2393
|
+
var c, h, u, f, m, g, p, y, w, b, P, _, O, G, Lt, dt, nt, yt, X, Tt, It = e.constructor, Jt = e.s == s.s ? 1 : -1, H = e.d, V = s.d;
|
|
2394
|
+
if (!H || !H[0] || !V || !V[0])
|
|
2395
|
+
return new It(
|
|
2371
2396
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
2372
|
-
!e.s || !s.s || (H ?
|
|
2397
|
+
!e.s || !s.s || (H ? V && H[0] == V[0] : !V) ? NaN : (
|
|
2373
2398
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
2374
|
-
H && H[0] == 0 || !
|
|
2399
|
+
H && H[0] == 0 || !V ? Jt * 0 : Jt / 0
|
|
2375
2400
|
)
|
|
2376
2401
|
);
|
|
2377
|
-
for (l ? (m = 1, h = e.e - s.e) : (l = Z, m = S, h = F(e.e / m) - F(s.e / m)), X =
|
|
2378
|
-
if (
|
|
2402
|
+
for (l ? (m = 1, h = e.e - s.e) : (l = Z, m = S, h = F(e.e / m) - F(s.e / m)), X = V.length, nt = H.length, w = new It(Jt), b = w.d = [], u = 0; V[u] == (H[u] || 0); u++) ;
|
|
2403
|
+
if (V[u] > (H[u] || 0) && h--, n == null ? (G = n = It.precision, o = It.rounding) : a ? G = n + (e.e - s.e) + 1 : G = n, G < 0)
|
|
2379
2404
|
b.push(1), g = !0;
|
|
2380
2405
|
else {
|
|
2381
2406
|
if (G = G / m + 2 | 0, u = 0, X == 1) {
|
|
2382
|
-
for (f = 0,
|
|
2383
|
-
|
|
2407
|
+
for (f = 0, V = V[0], G++; (u < nt || f) && G--; u++)
|
|
2408
|
+
Lt = f * l + (H[u] || 0), b[u] = Lt / V | 0, f = Lt % V | 0;
|
|
2384
2409
|
g = f || u < nt;
|
|
2385
2410
|
} else {
|
|
2386
|
-
for (f = l / (
|
|
2387
|
-
|
|
2411
|
+
for (f = l / (V[0] + 1) | 0, f > 1 && (V = r(V, f, l), H = r(H, f, l), X = V.length, nt = H.length), dt = X, P = H.slice(0, X), _ = P.length; _ < X; ) P[_++] = 0;
|
|
2412
|
+
Tt = V.slice(), Tt.unshift(0), yt = V[0], V[1] >= l / 2 && ++yt;
|
|
2388
2413
|
do
|
|
2389
|
-
f = 0, c = i(
|
|
2390
|
-
while ((
|
|
2414
|
+
f = 0, c = i(V, P, X, _), c < 0 ? (O = P[0], X != _ && (O = O * l + (P[1] || 0)), f = O / yt | 0, f > 1 ? (f >= l && (f = l - 1), p = r(V, f, l), y = p.length, _ = P.length, c = i(p, P, y, _), c == 1 && (f--, t(p, X < y ? Tt : V, y, l))) : (f == 0 && (c = f = 1), p = V.slice()), y = p.length, y < _ && p.unshift(0), t(P, p, _, l), c == -1 && (_ = P.length, c = i(V, P, X, _), c < 1 && (f++, t(P, X < _ ? Tt : V, _, l))), _ = P.length) : c === 0 && (f++, P = [0]), b[u++] = f, c && P[0] ? P[_++] = H[dt] || 0 : (P = [H[dt]], _ = 1);
|
|
2415
|
+
while ((dt++ < nt || P[0] !== void 0) && G--);
|
|
2391
2416
|
g = P[0] !== void 0;
|
|
2392
2417
|
}
|
|
2393
2418
|
b[0] || b.shift();
|
|
2394
2419
|
}
|
|
2395
2420
|
if (m == 1)
|
|
2396
|
-
w.e = h,
|
|
2421
|
+
w.e = h, ze = g;
|
|
2397
2422
|
else {
|
|
2398
2423
|
for (u = 1, f = b[0]; f >= 10; f /= 10) u++;
|
|
2399
2424
|
w.e = u + h * m - 1, C(w, a ? n + w.e + 1 : n, o, g);
|
|
@@ -2434,28 +2459,28 @@ function C(r, i, t, e) {
|
|
|
2434
2459
|
}
|
|
2435
2460
|
for (n = u.length; u[--n] === 0; ) u.pop();
|
|
2436
2461
|
}
|
|
2437
|
-
return
|
|
2462
|
+
return E && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
|
|
2438
2463
|
}
|
|
2439
2464
|
function et(r, i, t) {
|
|
2440
|
-
if (!r.isFinite()) return
|
|
2465
|
+
if (!r.isFinite()) return We(r);
|
|
2441
2466
|
var e, s = r.e, n = N(r.d), o = n.length;
|
|
2442
2467
|
return i ? (t && (e = t - o) > 0 ? n = n.charAt(0) + "." + n.slice(1) + rt(e) : o > 1 && (n = n.charAt(0) + "." + n.slice(1)), n = n + (r.e < 0 ? "e" : "e+") + r.e) : s < 0 ? (n = "0." + rt(-s - 1) + n, t && (e = t - o) > 0 && (n += rt(e))) : s >= o ? (n += rt(s + 1 - o), t && (e = t - s - 1) > 0 && (n = n + "." + rt(e))) : ((e = s + 1) < o && (n = n.slice(0, e) + "." + n.slice(e)), t && (e = t - o) > 0 && (s + 1 === o && (n += "."), n += rt(e))), n;
|
|
2443
2468
|
}
|
|
2444
|
-
function
|
|
2469
|
+
function Zt(r, i) {
|
|
2445
2470
|
var t = r[0];
|
|
2446
2471
|
for (i *= S; t >= 10; t /= 10) i++;
|
|
2447
2472
|
return i;
|
|
2448
2473
|
}
|
|
2449
|
-
function
|
|
2450
|
-
if (i >
|
|
2451
|
-
throw
|
|
2452
|
-
return C(new r(
|
|
2474
|
+
function $t(r, i, t) {
|
|
2475
|
+
if (i > vi)
|
|
2476
|
+
throw E = !0, t && (r.precision = t), Error(Be);
|
|
2477
|
+
return C(new r(Xt), i, 1, !0);
|
|
2453
2478
|
}
|
|
2454
2479
|
function tt(r, i, t) {
|
|
2455
|
-
if (i >
|
|
2456
|
-
return C(new r(
|
|
2480
|
+
if (i > he) throw Error(Be);
|
|
2481
|
+
return C(new r(Yt), i, t, !0);
|
|
2457
2482
|
}
|
|
2458
|
-
function
|
|
2483
|
+
function Ye(r) {
|
|
2459
2484
|
var i = r.length - 1, t = i * S + 1;
|
|
2460
2485
|
if (i = r[i], i) {
|
|
2461
2486
|
for (; i % 10 == 0; i /= 10) t--;
|
|
@@ -2467,21 +2492,21 @@ function rt(r) {
|
|
|
2467
2492
|
for (var i = ""; r--; ) i += "0";
|
|
2468
2493
|
return i;
|
|
2469
2494
|
}
|
|
2470
|
-
function
|
|
2495
|
+
function $e(r, i, t, e) {
|
|
2471
2496
|
var s, n = new r(1), o = Math.ceil(e / S + 4);
|
|
2472
|
-
for (
|
|
2473
|
-
if (t % 2 && (n = n.times(i),
|
|
2497
|
+
for (E = !1; ; ) {
|
|
2498
|
+
if (t % 2 && (n = n.times(i), De(n.d, o) && (s = !0)), t = F(t / 2), t === 0) {
|
|
2474
2499
|
t = n.d.length - 1, s && n.d[t] === 0 && ++n.d[t];
|
|
2475
2500
|
break;
|
|
2476
2501
|
}
|
|
2477
|
-
i = i.times(i),
|
|
2502
|
+
i = i.times(i), De(i.d, o);
|
|
2478
2503
|
}
|
|
2479
|
-
return
|
|
2504
|
+
return E = !0, n;
|
|
2480
2505
|
}
|
|
2481
|
-
function
|
|
2506
|
+
function Me(r) {
|
|
2482
2507
|
return r.d[r.d.length - 1] & 1;
|
|
2483
2508
|
}
|
|
2484
|
-
function
|
|
2509
|
+
function je(r, i, t) {
|
|
2485
2510
|
for (var e, s, n = new r(i[0]), o = 0; ++o < i.length; ) {
|
|
2486
2511
|
if (s = new r(i[o]), !s.s) {
|
|
2487
2512
|
n = s;
|
|
@@ -2491,52 +2516,52 @@ function Ue(r, i, t) {
|
|
|
2491
2516
|
}
|
|
2492
2517
|
return n;
|
|
2493
2518
|
}
|
|
2494
|
-
function
|
|
2519
|
+
function ue(r, i) {
|
|
2495
2520
|
var t, e, s, n, o, a, l, c = 0, h = 0, u = 0, f = r.constructor, m = f.rounding, g = f.precision;
|
|
2496
2521
|
if (!r.d || !r.d[0] || r.e > 17)
|
|
2497
2522
|
return new f(r.d ? r.d[0] ? r.s < 0 ? 0 : 1 / 0 : 1 : r.s ? r.s < 0 ? 0 : r : NaN);
|
|
2498
|
-
for (i == null ? (
|
|
2523
|
+
for (i == null ? (E = !1, l = g) : l = i, a = new f(0.03125); r.e > -2; )
|
|
2499
2524
|
r = r.times(a), u += 5;
|
|
2500
2525
|
for (e = Math.log(I(2, u)) / Math.LN10 * 2 + 5 | 0, l += e, t = n = o = new f(1), f.precision = l; ; ) {
|
|
2501
|
-
if (n = C(n.times(r), l, 1), t = t.times(++h), a = o.plus(
|
|
2526
|
+
if (n = C(n.times(r), l, 1), t = t.times(++h), a = o.plus(A(n, t, l, 1)), N(a.d).slice(0, l) === N(o.d).slice(0, l)) {
|
|
2502
2527
|
for (s = u; s--; ) o = C(o.times(o), l, 1);
|
|
2503
2528
|
if (i == null)
|
|
2504
|
-
if (c < 3 &&
|
|
2529
|
+
if (c < 3 && At(o.d, l - e, m, c))
|
|
2505
2530
|
f.precision = l += 10, t = n = a = new f(1), h = 0, c++;
|
|
2506
2531
|
else
|
|
2507
|
-
return C(o, f.precision = g, m,
|
|
2532
|
+
return C(o, f.precision = g, m, E = !0);
|
|
2508
2533
|
else
|
|
2509
2534
|
return f.precision = g, o;
|
|
2510
2535
|
}
|
|
2511
2536
|
o = a;
|
|
2512
2537
|
}
|
|
2513
2538
|
}
|
|
2514
|
-
function
|
|
2539
|
+
function lt(r, i) {
|
|
2515
2540
|
var t, e, s, n, o, a, l, c, h, u, f, m = 1, g = 10, p = r, y = p.d, w = p.constructor, b = w.rounding, P = w.precision;
|
|
2516
2541
|
if (p.s < 0 || !y || !y[0] || !p.e && y[0] == 1 && y.length == 1)
|
|
2517
2542
|
return new w(y && !y[0] ? -1 / 0 : p.s != 1 ? NaN : y ? 0 : p);
|
|
2518
|
-
if (i == null ? (
|
|
2543
|
+
if (i == null ? (E = !1, h = P) : h = i, w.precision = h += g, t = N(y), e = t.charAt(0), Math.abs(n = p.e) < 15e14) {
|
|
2519
2544
|
for (; e < 7 && e != 1 || e == 1 && t.charAt(1) > 3; )
|
|
2520
2545
|
p = p.times(r), t = N(p.d), e = t.charAt(0), m++;
|
|
2521
2546
|
n = p.e, e > 1 ? (p = new w("0." + t), n++) : p = new w(e + "." + t.slice(1));
|
|
2522
2547
|
} else
|
|
2523
|
-
return c =
|
|
2524
|
-
for (u = p, l = o = p =
|
|
2525
|
-
if (o = C(o.times(f), h, 1), c = l.plus(
|
|
2526
|
-
if (l = l.times(2), n !== 0 && (l = l.plus(
|
|
2527
|
-
if (
|
|
2528
|
-
w.precision = h += g, c = o = p =
|
|
2548
|
+
return c = $t(w, h + 2, P).times(n + ""), p = lt(new w(e + "." + t.slice(1)), h - g).plus(c), w.precision = P, i == null ? C(p, P, b, E = !0) : p;
|
|
2549
|
+
for (u = p, l = o = p = A(p.minus(1), p.plus(1), h, 1), f = C(p.times(p), h, 1), s = 3; ; ) {
|
|
2550
|
+
if (o = C(o.times(f), h, 1), c = l.plus(A(o, new w(s), h, 1)), N(c.d).slice(0, h) === N(l.d).slice(0, h))
|
|
2551
|
+
if (l = l.times(2), n !== 0 && (l = l.plus($t(w, h + 2, P).times(n + ""))), l = A(l, new w(m), h, 1), i == null)
|
|
2552
|
+
if (At(l.d, h - g, b, a))
|
|
2553
|
+
w.precision = h += g, c = o = p = A(u.minus(1), u.plus(1), h, 1), f = C(p.times(p), h, 1), s = a = 1;
|
|
2529
2554
|
else
|
|
2530
|
-
return C(l, w.precision = P, b,
|
|
2555
|
+
return C(l, w.precision = P, b, E = !0);
|
|
2531
2556
|
else
|
|
2532
2557
|
return w.precision = P, l;
|
|
2533
2558
|
l = c, s += 2;
|
|
2534
2559
|
}
|
|
2535
2560
|
}
|
|
2536
|
-
function
|
|
2561
|
+
function We(r) {
|
|
2537
2562
|
return String(r.s * r.s / 0);
|
|
2538
2563
|
}
|
|
2539
|
-
function
|
|
2564
|
+
function Bt(r, i) {
|
|
2540
2565
|
var t, e, s;
|
|
2541
2566
|
for ((t = i.indexOf(".")) > -1 && (i = i.replace(".", "")), (e = i.search(/e/i)) > 0 ? (t < 0 && (t = e), t += +i.slice(e + 1), i = i.substring(0, e)) : t < 0 && (t = i.length), e = 0; i.charCodeAt(e) === 48; e++) ;
|
|
2542
2567
|
for (s = i.length; i.charCodeAt(s - 1) === 48; --s) ;
|
|
@@ -2547,53 +2572,53 @@ function zt(r, i) {
|
|
|
2547
2572
|
} else
|
|
2548
2573
|
e -= s;
|
|
2549
2574
|
for (; e--; ) i += "0";
|
|
2550
|
-
r.d.push(+i),
|
|
2575
|
+
r.d.push(+i), E && (r.e > r.constructor.maxE ? (r.d = null, r.e = NaN) : r.e < r.constructor.minE && (r.e = 0, r.d = [0]));
|
|
2551
2576
|
} else
|
|
2552
2577
|
r.e = 0, r.d = [0];
|
|
2553
2578
|
return r;
|
|
2554
2579
|
}
|
|
2555
|
-
function
|
|
2580
|
+
function wi(r, i) {
|
|
2556
2581
|
var t, e, s, n, o, a, l, c, h;
|
|
2557
2582
|
if (i.indexOf("_") > -1) {
|
|
2558
|
-
if (i = i.replace(/(\d)_(?=\d)/g, "$1"),
|
|
2583
|
+
if (i = i.replace(/(\d)_(?=\d)/g, "$1"), Xe.test(i)) return Bt(r, i);
|
|
2559
2584
|
} else if (i === "Infinity" || i === "NaN")
|
|
2560
2585
|
return +i || (r.s = NaN), r.e = NaN, r.d = null, r;
|
|
2561
|
-
if (
|
|
2586
|
+
if (mi.test(i))
|
|
2562
2587
|
t = 16, i = i.toLowerCase();
|
|
2563
|
-
else if (
|
|
2588
|
+
else if (fi.test(i))
|
|
2564
2589
|
t = 2;
|
|
2565
|
-
else if (
|
|
2590
|
+
else if (pi.test(i))
|
|
2566
2591
|
t = 8;
|
|
2567
2592
|
else
|
|
2568
|
-
throw Error(
|
|
2569
|
-
for (n = i.search(/p/i), n > 0 ? (l = +i.slice(n + 1), i = i.substring(2, n)) : i = i.slice(2), n = i.indexOf("."), o = n >= 0, e = r.constructor, o && (i = i.replace(".", ""), a = i.length, n = a - n, s =
|
|
2570
|
-
return n < 0 ? new e(r.s * 0) : (r.e =
|
|
2593
|
+
throw Error(ht + i);
|
|
2594
|
+
for (n = i.search(/p/i), n > 0 ? (l = +i.slice(n + 1), i = i.substring(2, n)) : i = i.slice(2), n = i.indexOf("."), o = n >= 0, e = r.constructor, o && (i = i.replace(".", ""), a = i.length, n = a - n, s = $e(e, new e(t), n, n * 2)), c = zt(i, t, Z), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
|
|
2595
|
+
return n < 0 ? new e(r.s * 0) : (r.e = Zt(c, h), r.d = c, E = !1, o && (r = A(r, s, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : k.pow(2, l))), E = !0, r);
|
|
2571
2596
|
}
|
|
2572
|
-
function
|
|
2597
|
+
function xi(r, i) {
|
|
2573
2598
|
var t, e = i.d.length;
|
|
2574
2599
|
if (e < 3)
|
|
2575
|
-
return i.isZero() ? i :
|
|
2576
|
-
t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, i = i.times(1 /
|
|
2600
|
+
return i.isZero() ? i : Dt(r, 2, i, i);
|
|
2601
|
+
t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, i = i.times(1 / Qt(5, t)), i = Dt(r, 2, i, i);
|
|
2577
2602
|
for (var s, n = new r(5), o = new r(16), a = new r(20); t--; )
|
|
2578
2603
|
s = i.times(i), i = i.times(n.plus(s.times(o.times(s).minus(a))));
|
|
2579
2604
|
return i;
|
|
2580
2605
|
}
|
|
2581
|
-
function
|
|
2606
|
+
function Dt(r, i, t, e, s) {
|
|
2582
2607
|
var n, o, a, l, c = r.precision, h = Math.ceil(c / S);
|
|
2583
|
-
for (
|
|
2584
|
-
if (o =
|
|
2608
|
+
for (E = !1, l = t.times(t), a = new r(e); ; ) {
|
|
2609
|
+
if (o = A(a.times(l), new r(i++ * i++), c, 1), a = s ? e.plus(o) : e.minus(o), e = A(o.times(l), new r(i++ * i++), c, 1), o = a.plus(e), o.d[h] !== void 0) {
|
|
2585
2610
|
for (n = h; o.d[n] === a.d[n] && n--; ) ;
|
|
2586
2611
|
if (n == -1) break;
|
|
2587
2612
|
}
|
|
2588
2613
|
n = a, a = e, e = o, o = n;
|
|
2589
2614
|
}
|
|
2590
|
-
return
|
|
2615
|
+
return E = !0, o.d.length = h + 1, o;
|
|
2591
2616
|
}
|
|
2592
|
-
function
|
|
2617
|
+
function Qt(r, i) {
|
|
2593
2618
|
for (var t = r; --i; ) t *= r;
|
|
2594
2619
|
return t;
|
|
2595
2620
|
}
|
|
2596
|
-
function
|
|
2621
|
+
function qe(r, i) {
|
|
2597
2622
|
var t, e = i.s < 0, s = tt(r, r.precision, 1), n = s.times(0.5);
|
|
2598
2623
|
if (i = i.abs(), i.lte(n))
|
|
2599
2624
|
return st = e ? 4 : 1, i;
|
|
@@ -2601,31 +2626,31 @@ function Xe(r, i) {
|
|
|
2601
2626
|
st = e ? 3 : 2;
|
|
2602
2627
|
else {
|
|
2603
2628
|
if (i = i.minus(t.times(s)), i.lte(n))
|
|
2604
|
-
return st =
|
|
2605
|
-
st =
|
|
2629
|
+
return st = Me(t) ? e ? 2 : 3 : e ? 4 : 1, i;
|
|
2630
|
+
st = Me(t) ? e ? 1 : 4 : e ? 3 : 2;
|
|
2606
2631
|
}
|
|
2607
2632
|
return i.minus(s).abs();
|
|
2608
2633
|
}
|
|
2609
|
-
function
|
|
2634
|
+
function xe(r, i, t, e) {
|
|
2610
2635
|
var s, n, o, a, l, c, h, u, f, m = r.constructor, g = t !== void 0;
|
|
2611
|
-
if (g ? (U(t, 1,
|
|
2612
|
-
h =
|
|
2636
|
+
if (g ? (U(t, 1, ut), e === void 0 ? e = m.rounding : U(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
|
|
2637
|
+
h = We(r);
|
|
2613
2638
|
else {
|
|
2614
|
-
for (h = et(r), o = h.indexOf("."), g ? (s = 2, i == 16 ? t = t * 4 - 3 : i == 8 && (t = t * 3 - 2)) : s = i, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d =
|
|
2639
|
+
for (h = et(r), o = h.indexOf("."), g ? (s = 2, i == 16 ? t = t * 4 - 3 : i == 8 && (t = t * 3 - 2)) : s = i, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d = zt(et(f), 10, s), f.e = f.d.length), u = zt(h, 10, s), n = l = u.length; u[--l] == 0; ) u.pop();
|
|
2615
2640
|
if (!u[0])
|
|
2616
2641
|
h = g ? "0p+0" : "0";
|
|
2617
2642
|
else {
|
|
2618
|
-
if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r =
|
|
2643
|
+
if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r = A(r, f, t, e, 0, s), u = r.d, n = r.e, c = ze), o = u[t], a = s / 2, c = c || u[t + 1] !== void 0, c = e < 4 ? (o !== void 0 || c) && (e === 0 || e === (r.s < 0 ? 3 : 2)) : o > a || o === a && (e === 4 || c || e === 6 && u[t - 1] & 1 || e === (r.s < 0 ? 8 : 7)), u.length = t, c)
|
|
2619
2644
|
for (; ++u[--t] > s - 1; )
|
|
2620
2645
|
u[t] = 0, t || (++n, u.unshift(1));
|
|
2621
2646
|
for (l = u.length; !u[l - 1]; --l) ;
|
|
2622
|
-
for (o = 0, h = ""; o < l; o++) h +=
|
|
2647
|
+
for (o = 0, h = ""; o < l; o++) h += le.charAt(u[o]);
|
|
2623
2648
|
if (g) {
|
|
2624
2649
|
if (l > 1)
|
|
2625
2650
|
if (i == 16 || i == 8) {
|
|
2626
2651
|
for (o = i == 16 ? 4 : 3, --l; l % o; l++) h += "0";
|
|
2627
|
-
for (u =
|
|
2628
|
-
for (o = 1, h = "1."; o < l; o++) h +=
|
|
2652
|
+
for (u = zt(h, s, i), l = u.length; !u[l - 1]; --l) ;
|
|
2653
|
+
for (o = 1, h = "1."; o < l; o++) h += le.charAt(u[o]);
|
|
2629
2654
|
} else
|
|
2630
2655
|
h = h.charAt(0) + "." + h.slice(1);
|
|
2631
2656
|
h = h + (n < 0 ? "p" : "p+") + n;
|
|
@@ -2639,54 +2664,54 @@ function ve(r, i, t, e) {
|
|
|
2639
2664
|
}
|
|
2640
2665
|
return r.s < 0 ? "-" + h : h;
|
|
2641
2666
|
}
|
|
2642
|
-
function
|
|
2667
|
+
function De(r, i) {
|
|
2643
2668
|
if (r.length > i)
|
|
2644
2669
|
return r.length = i, !0;
|
|
2645
2670
|
}
|
|
2646
|
-
function
|
|
2671
|
+
function bi(r) {
|
|
2647
2672
|
return new this(r).abs();
|
|
2648
2673
|
}
|
|
2649
|
-
function
|
|
2674
|
+
function Pi(r) {
|
|
2650
2675
|
return new this(r).acos();
|
|
2651
2676
|
}
|
|
2652
|
-
function
|
|
2677
|
+
function Ci(r) {
|
|
2653
2678
|
return new this(r).acosh();
|
|
2654
2679
|
}
|
|
2655
|
-
function
|
|
2680
|
+
function Si(r, i) {
|
|
2656
2681
|
return new this(r).plus(i);
|
|
2657
2682
|
}
|
|
2658
|
-
function
|
|
2683
|
+
function Ei(r) {
|
|
2659
2684
|
return new this(r).asin();
|
|
2660
2685
|
}
|
|
2661
|
-
function
|
|
2686
|
+
function _i(r) {
|
|
2662
2687
|
return new this(r).asinh();
|
|
2663
2688
|
}
|
|
2664
|
-
function
|
|
2689
|
+
function Mi(r) {
|
|
2665
2690
|
return new this(r).atan();
|
|
2666
2691
|
}
|
|
2667
|
-
function
|
|
2692
|
+
function Di(r) {
|
|
2668
2693
|
return new this(r).atanh();
|
|
2669
2694
|
}
|
|
2670
|
-
function
|
|
2695
|
+
function ki(r, i) {
|
|
2671
2696
|
r = new this(r), i = new this(i);
|
|
2672
2697
|
var t, e = this.precision, s = this.rounding, n = e + 4;
|
|
2673
|
-
return !r.s || !i.s ? t = new this(NaN) : !r.d && !i.d ? (t = tt(this, n, 1).times(i.s > 0 ? 0.25 : 0.75), t.s = r.s) : !i.d || r.isZero() ? (t = i.s < 0 ? tt(this, e, s) : new this(0), t.s = r.s) : !r.d || i.isZero() ? (t = tt(this, n, 1).times(0.5), t.s = r.s) : i.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(
|
|
2698
|
+
return !r.s || !i.s ? t = new this(NaN) : !r.d && !i.d ? (t = tt(this, n, 1).times(i.s > 0 ? 0.25 : 0.75), t.s = r.s) : !i.d || r.isZero() ? (t = i.s < 0 ? tt(this, e, s) : new this(0), t.s = r.s) : !r.d || i.isZero() ? (t = tt(this, n, 1).times(0.5), t.s = r.s) : i.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(A(r, i, n, 1)), i = tt(this, n, 1), this.precision = e, this.rounding = s, t = r.s < 0 ? t.minus(i) : t.plus(i)) : t = this.atan(A(r, i, n, 1)), t;
|
|
2674
2699
|
}
|
|
2675
|
-
function
|
|
2700
|
+
function Ri(r) {
|
|
2676
2701
|
return new this(r).cbrt();
|
|
2677
2702
|
}
|
|
2678
|
-
function
|
|
2703
|
+
function Ai(r) {
|
|
2679
2704
|
return C(r = new this(r), r.e + 1, 2);
|
|
2680
2705
|
}
|
|
2681
|
-
function
|
|
2706
|
+
function Vi(r, i, t) {
|
|
2682
2707
|
return new this(r).clamp(i, t);
|
|
2683
2708
|
}
|
|
2684
|
-
function
|
|
2685
|
-
if (!r || typeof r != "object") throw Error(
|
|
2709
|
+
function Oi(r) {
|
|
2710
|
+
if (!r || typeof r != "object") throw Error(Kt + "Object expected");
|
|
2686
2711
|
var i, t, e, s = r.defaults === !0, n = [
|
|
2687
2712
|
"precision",
|
|
2688
2713
|
1,
|
|
2689
|
-
|
|
2714
|
+
ut,
|
|
2690
2715
|
"rounding",
|
|
2691
2716
|
0,
|
|
2692
2717
|
8,
|
|
@@ -2695,10 +2720,10 @@ function Mi(r) {
|
|
|
2695
2720
|
0,
|
|
2696
2721
|
"toExpPos",
|
|
2697
2722
|
0,
|
|
2698
|
-
|
|
2723
|
+
ae,
|
|
2699
2724
|
"maxE",
|
|
2700
2725
|
0,
|
|
2701
|
-
|
|
2726
|
+
ae,
|
|
2702
2727
|
"minE",
|
|
2703
2728
|
-9e15,
|
|
2704
2729
|
0,
|
|
@@ -2707,35 +2732,35 @@ function Mi(r) {
|
|
|
2707
2732
|
9
|
|
2708
2733
|
];
|
|
2709
2734
|
for (i = 0; i < n.length; i += 3)
|
|
2710
|
-
if (t = n[i], s && (this[t] =
|
|
2735
|
+
if (t = n[i], s && (this[t] = ce[t]), (e = r[t]) !== void 0)
|
|
2711
2736
|
if (F(e) === e && e >= n[i + 1] && e <= n[i + 2]) this[t] = e;
|
|
2712
|
-
else throw Error(
|
|
2713
|
-
if (t = "crypto", s && (this[t] =
|
|
2737
|
+
else throw Error(ht + t + ": " + e);
|
|
2738
|
+
if (t = "crypto", s && (this[t] = ce[t]), (e = r[t]) !== void 0)
|
|
2714
2739
|
if (e === !0 || e === !1 || e === 0 || e === 1)
|
|
2715
2740
|
if (e)
|
|
2716
2741
|
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
2717
2742
|
this[t] = !0;
|
|
2718
2743
|
else
|
|
2719
|
-
throw Error(
|
|
2744
|
+
throw Error(Ue);
|
|
2720
2745
|
else
|
|
2721
2746
|
this[t] = !1;
|
|
2722
2747
|
else
|
|
2723
|
-
throw Error(
|
|
2748
|
+
throw Error(ht + t + ": " + e);
|
|
2724
2749
|
return this;
|
|
2725
2750
|
}
|
|
2726
|
-
function
|
|
2751
|
+
function Li(r) {
|
|
2727
2752
|
return new this(r).cos();
|
|
2728
2753
|
}
|
|
2729
|
-
function
|
|
2754
|
+
function Ti(r) {
|
|
2730
2755
|
return new this(r).cosh();
|
|
2731
2756
|
}
|
|
2732
|
-
function
|
|
2757
|
+
function Ke(r) {
|
|
2733
2758
|
var i, t, e;
|
|
2734
2759
|
function s(n) {
|
|
2735
2760
|
var o, a, l, c = this;
|
|
2736
2761
|
if (!(c instanceof s)) return new s(n);
|
|
2737
|
-
if (c.constructor = s,
|
|
2738
|
-
c.s = n.s,
|
|
2762
|
+
if (c.constructor = s, ke(n)) {
|
|
2763
|
+
c.s = n.s, E ? !n.d || n.e > s.maxE ? (c.e = NaN, c.d = null) : n.e < s.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);
|
|
2739
2764
|
return;
|
|
2740
2765
|
}
|
|
2741
2766
|
if (l = typeof n, l === "number") {
|
|
@@ -2745,79 +2770,79 @@ function Ye(r) {
|
|
|
2745
2770
|
}
|
|
2746
2771
|
if (n < 0 ? (n = -n, c.s = -1) : c.s = 1, n === ~~n && n < 1e7) {
|
|
2747
2772
|
for (o = 0, a = n; a >= 10; a /= 10) o++;
|
|
2748
|
-
|
|
2773
|
+
E ? o > s.maxE ? (c.e = NaN, c.d = null) : o < s.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [n]) : (c.e = o, c.d = [n]);
|
|
2749
2774
|
return;
|
|
2750
2775
|
}
|
|
2751
2776
|
if (n * 0 !== 0) {
|
|
2752
2777
|
n || (c.s = NaN), c.e = NaN, c.d = null;
|
|
2753
2778
|
return;
|
|
2754
2779
|
}
|
|
2755
|
-
return
|
|
2780
|
+
return Bt(c, n.toString());
|
|
2756
2781
|
}
|
|
2757
2782
|
if (l === "string")
|
|
2758
|
-
return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1),
|
|
2783
|
+
return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Xe.test(n) ? Bt(c, n) : wi(c, n);
|
|
2759
2784
|
if (l === "bigint")
|
|
2760
|
-
return n < 0 ? (n = -n, c.s = -1) : c.s = 1,
|
|
2761
|
-
throw Error(
|
|
2785
|
+
return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Bt(c, n.toString());
|
|
2786
|
+
throw Error(ht + n);
|
|
2762
2787
|
}
|
|
2763
|
-
if (s.prototype = v, s.ROUND_UP = 0, s.ROUND_DOWN = 1, s.ROUND_CEIL = 2, s.ROUND_FLOOR = 3, s.ROUND_HALF_UP = 4, s.ROUND_HALF_DOWN = 5, s.ROUND_HALF_EVEN = 6, s.ROUND_HALF_CEIL = 7, s.ROUND_HALF_FLOOR = 8, s.EUCLID = 9, s.config = s.set =
|
|
2788
|
+
if (s.prototype = v, s.ROUND_UP = 0, s.ROUND_DOWN = 1, s.ROUND_CEIL = 2, s.ROUND_FLOOR = 3, s.ROUND_HALF_UP = 4, s.ROUND_HALF_DOWN = 5, s.ROUND_HALF_EVEN = 6, s.ROUND_HALF_CEIL = 7, s.ROUND_HALF_FLOOR = 8, s.EUCLID = 9, s.config = s.set = Oi, s.clone = Ke, s.isDecimal = ke, s.abs = bi, s.acos = Pi, s.acosh = Ci, s.add = Si, s.asin = Ei, s.asinh = _i, s.atan = Mi, s.atanh = Di, s.atan2 = ki, s.cbrt = Ri, s.ceil = Ai, s.clamp = Vi, s.cos = Li, s.cosh = Ti, s.div = Ii, s.exp = Ni, s.floor = Hi, s.hypot = Fi, s.ln = zi, s.log = Bi, s.log10 = Gi, s.log2 = Ui, s.max = Xi, s.min = Yi, s.mod = $i, s.mul = ji, s.pow = Wi, s.random = qi, s.round = Ki, s.sign = Zi, s.sin = Qi, s.sinh = Ji, s.sqrt = ts, s.sub = es, s.sum = is, s.tan = ss, s.tanh = ns, s.trunc = rs, r === void 0 && (r = {}), r && r.defaults !== !0)
|
|
2764
2789
|
for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], i = 0; i < e.length; ) r.hasOwnProperty(t = e[i++]) || (r[t] = this[t]);
|
|
2765
2790
|
return s.config(r), s;
|
|
2766
2791
|
}
|
|
2767
|
-
function
|
|
2792
|
+
function Ii(r, i) {
|
|
2768
2793
|
return new this(r).div(i);
|
|
2769
2794
|
}
|
|
2770
|
-
function
|
|
2795
|
+
function Ni(r) {
|
|
2771
2796
|
return new this(r).exp();
|
|
2772
2797
|
}
|
|
2773
|
-
function
|
|
2798
|
+
function Hi(r) {
|
|
2774
2799
|
return C(r = new this(r), r.e + 1, 3);
|
|
2775
2800
|
}
|
|
2776
|
-
function
|
|
2801
|
+
function Fi() {
|
|
2777
2802
|
var r, i, t = new this(0);
|
|
2778
|
-
for (
|
|
2803
|
+
for (E = !1, r = 0; r < arguments.length; )
|
|
2779
2804
|
if (i = new this(arguments[r++]), i.d)
|
|
2780
2805
|
t.d && (t = t.plus(i.times(i)));
|
|
2781
2806
|
else {
|
|
2782
2807
|
if (i.s)
|
|
2783
|
-
return
|
|
2808
|
+
return E = !0, new this(1 / 0);
|
|
2784
2809
|
t = i;
|
|
2785
2810
|
}
|
|
2786
|
-
return
|
|
2811
|
+
return E = !0, t.sqrt();
|
|
2787
2812
|
}
|
|
2788
|
-
function
|
|
2789
|
-
return r instanceof k || r && r.toStringTag ===
|
|
2813
|
+
function ke(r) {
|
|
2814
|
+
return r instanceof k || r && r.toStringTag === Ge || !1;
|
|
2790
2815
|
}
|
|
2791
|
-
function
|
|
2816
|
+
function zi(r) {
|
|
2792
2817
|
return new this(r).ln();
|
|
2793
2818
|
}
|
|
2794
|
-
function
|
|
2819
|
+
function Bi(r, i) {
|
|
2795
2820
|
return new this(r).log(i);
|
|
2796
2821
|
}
|
|
2797
|
-
function
|
|
2822
|
+
function Ui(r) {
|
|
2798
2823
|
return new this(r).log(2);
|
|
2799
2824
|
}
|
|
2800
|
-
function
|
|
2825
|
+
function Gi(r) {
|
|
2801
2826
|
return new this(r).log(10);
|
|
2802
2827
|
}
|
|
2803
|
-
function
|
|
2804
|
-
return
|
|
2828
|
+
function Xi() {
|
|
2829
|
+
return je(this, arguments, -1);
|
|
2805
2830
|
}
|
|
2806
|
-
function
|
|
2807
|
-
return
|
|
2831
|
+
function Yi() {
|
|
2832
|
+
return je(this, arguments, 1);
|
|
2808
2833
|
}
|
|
2809
|
-
function
|
|
2834
|
+
function $i(r, i) {
|
|
2810
2835
|
return new this(r).mod(i);
|
|
2811
2836
|
}
|
|
2812
|
-
function
|
|
2837
|
+
function ji(r, i) {
|
|
2813
2838
|
return new this(r).mul(i);
|
|
2814
2839
|
}
|
|
2815
|
-
function
|
|
2840
|
+
function Wi(r, i) {
|
|
2816
2841
|
return new this(r).pow(i);
|
|
2817
2842
|
}
|
|
2818
|
-
function
|
|
2843
|
+
function qi(r) {
|
|
2819
2844
|
var i, t, e, s, n = 0, o = new this(1), a = [];
|
|
2820
|
-
if (r === void 0 ? r = this.precision : U(r, 1,
|
|
2845
|
+
if (r === void 0 ? r = this.precision : U(r, 1, ut), e = Math.ceil(r / S), this.crypto)
|
|
2821
2846
|
if (crypto.getRandomValues)
|
|
2822
2847
|
for (i = crypto.getRandomValues(new Uint32Array(e)); n < e; )
|
|
2823
2848
|
s = i[n], s >= 429e7 ? i[n] = crypto.getRandomValues(new Uint32Array(1))[0] : a[n++] = s % 1e7;
|
|
@@ -2826,7 +2851,7 @@ function Gi(r) {
|
|
|
2826
2851
|
s = i[n] + (i[n + 1] << 8) + (i[n + 2] << 16) + ((i[n + 3] & 127) << 24), s >= 214e7 ? crypto.randomBytes(4).copy(i, n) : (a.push(s % 1e7), n += 4);
|
|
2827
2852
|
n = e / 4;
|
|
2828
2853
|
} else
|
|
2829
|
-
throw Error(
|
|
2854
|
+
throw Error(Ue);
|
|
2830
2855
|
else for (; n < e; ) a[n++] = Math.random() * 1e7 | 0;
|
|
2831
2856
|
for (e = a[--n], r %= S, e && r && (s = I(10, S - r), a[n] = (e / s | 0) * s); a[n] === 0; n--) a.pop();
|
|
2832
2857
|
if (n < 0)
|
|
@@ -2838,44 +2863,44 @@ function Gi(r) {
|
|
|
2838
2863
|
}
|
|
2839
2864
|
return o.e = t, o.d = a, o;
|
|
2840
2865
|
}
|
|
2841
|
-
function
|
|
2866
|
+
function Ki(r) {
|
|
2842
2867
|
return C(r = new this(r), r.e + 1, this.rounding);
|
|
2843
2868
|
}
|
|
2844
|
-
function
|
|
2869
|
+
function Zi(r) {
|
|
2845
2870
|
return r = new this(r), r.d ? r.d[0] ? r.s : 0 * r.s : r.s || NaN;
|
|
2846
2871
|
}
|
|
2847
|
-
function
|
|
2872
|
+
function Qi(r) {
|
|
2848
2873
|
return new this(r).sin();
|
|
2849
2874
|
}
|
|
2850
|
-
function
|
|
2875
|
+
function Ji(r) {
|
|
2851
2876
|
return new this(r).sinh();
|
|
2852
2877
|
}
|
|
2853
|
-
function
|
|
2878
|
+
function ts(r) {
|
|
2854
2879
|
return new this(r).sqrt();
|
|
2855
2880
|
}
|
|
2856
|
-
function
|
|
2881
|
+
function es(r, i) {
|
|
2857
2882
|
return new this(r).sub(i);
|
|
2858
2883
|
}
|
|
2859
|
-
function
|
|
2884
|
+
function is() {
|
|
2860
2885
|
var r = 0, i = arguments, t = new this(i[r]);
|
|
2861
|
-
for (
|
|
2862
|
-
return
|
|
2886
|
+
for (E = !1; t.s && ++r < i.length; ) t = t.plus(i[r]);
|
|
2887
|
+
return E = !0, C(t, this.precision, this.rounding);
|
|
2863
2888
|
}
|
|
2864
|
-
function
|
|
2889
|
+
function ss(r) {
|
|
2865
2890
|
return new this(r).tan();
|
|
2866
2891
|
}
|
|
2867
|
-
function
|
|
2892
|
+
function ns(r) {
|
|
2868
2893
|
return new this(r).tanh();
|
|
2869
2894
|
}
|
|
2870
|
-
function
|
|
2895
|
+
function rs(r) {
|
|
2871
2896
|
return C(r = new this(r), r.e + 1, 1);
|
|
2872
2897
|
}
|
|
2873
2898
|
v[Symbol.for("nodejs.util.inspect.custom")] = v.toString;
|
|
2874
2899
|
v[Symbol.toStringTag] = "Decimal";
|
|
2875
|
-
var k = v.constructor =
|
|
2876
|
-
Gt = new k(Gt);
|
|
2900
|
+
var k = v.constructor = Ke(ce);
|
|
2877
2901
|
Xt = new k(Xt);
|
|
2878
|
-
|
|
2902
|
+
Yt = new k(Yt);
|
|
2903
|
+
class os {
|
|
2879
2904
|
constructor() {
|
|
2880
2905
|
/** 父级 */
|
|
2881
2906
|
d(this, "parent");
|
|
@@ -2910,7 +2935,7 @@ class ts {
|
|
|
2910
2935
|
(i = this.parent) == null || i.removeChild(this);
|
|
2911
2936
|
}
|
|
2912
2937
|
}
|
|
2913
|
-
class
|
|
2938
|
+
class as extends os {
|
|
2914
2939
|
constructor() {
|
|
2915
2940
|
super(...arguments);
|
|
2916
2941
|
d(this, "_isVisible", !0);
|
|
@@ -2956,12 +2981,12 @@ class es extends ts {
|
|
|
2956
2981
|
return !0;
|
|
2957
2982
|
}
|
|
2958
2983
|
}
|
|
2959
|
-
let
|
|
2984
|
+
let ls = class extends as {
|
|
2960
2985
|
constructor(i) {
|
|
2961
|
-
super(), i.name = i.name ||
|
|
2986
|
+
super(), i.name = i.name || oe("default-name-"), Object.assign(this, { ...i });
|
|
2962
2987
|
}
|
|
2963
2988
|
};
|
|
2964
|
-
class
|
|
2989
|
+
class cs extends ls {
|
|
2965
2990
|
constructor(t) {
|
|
2966
2991
|
super(t);
|
|
2967
2992
|
d(this, "_isInteractive", !0);
|
|
@@ -3040,7 +3065,7 @@ class ss extends is {
|
|
|
3040
3065
|
return (this.parent ? this.parent[t] : !0) && e && (s ? this.isInteractive : !0);
|
|
3041
3066
|
}
|
|
3042
3067
|
}
|
|
3043
|
-
class
|
|
3068
|
+
class hs {
|
|
3044
3069
|
constructor(i) {
|
|
3045
3070
|
d(this, "propagationStopped", !1);
|
|
3046
3071
|
this.data = i;
|
|
@@ -3052,7 +3077,7 @@ class ns {
|
|
|
3052
3077
|
return !this.propagationStopped;
|
|
3053
3078
|
}
|
|
3054
3079
|
}
|
|
3055
|
-
class Vt extends
|
|
3080
|
+
class Vt extends cs {
|
|
3056
3081
|
constructor() {
|
|
3057
3082
|
super(...arguments);
|
|
3058
3083
|
//#region 4. 添加事件管理器
|
|
@@ -3170,7 +3195,7 @@ class Vt extends ss {
|
|
|
3170
3195
|
var c, h;
|
|
3171
3196
|
if (!this[n]) return;
|
|
3172
3197
|
this.updateStates(t, e);
|
|
3173
|
-
const o = new
|
|
3198
|
+
const o = new hs(e);
|
|
3174
3199
|
this.listeners[t].forEach((u) => u(o, s));
|
|
3175
3200
|
const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDrag", "notifyWheel"].includes(a) ? e : e.state;
|
|
3176
3201
|
o.canPropagate && ((c = this.parent) == null || c[a](l, s)), (h = this.sharedControllers[t]) == null || h.forEach(
|
|
@@ -3226,7 +3251,7 @@ class Vt extends ss {
|
|
|
3226
3251
|
}
|
|
3227
3252
|
//#region 6. 添加事件通知方法
|
|
3228
3253
|
}
|
|
3229
|
-
class
|
|
3254
|
+
class us extends Vt {
|
|
3230
3255
|
constructor(t) {
|
|
3231
3256
|
super(t);
|
|
3232
3257
|
/** 画布元素 */
|
|
@@ -3500,7 +3525,7 @@ class rs extends Vt {
|
|
|
3500
3525
|
) : l(t);
|
|
3501
3526
|
}
|
|
3502
3527
|
}
|
|
3503
|
-
class
|
|
3528
|
+
class ds extends us {
|
|
3504
3529
|
constructor(t) {
|
|
3505
3530
|
super(t);
|
|
3506
3531
|
/** 主题 */
|
|
@@ -3748,10 +3773,10 @@ class os extends rs {
|
|
|
3748
3773
|
setStyle(t) {
|
|
3749
3774
|
for (const e in t)
|
|
3750
3775
|
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
3751
|
-
const s =
|
|
3776
|
+
const s = hi(
|
|
3752
3777
|
this.style[e] || this.style[this.theme]
|
|
3753
3778
|
);
|
|
3754
|
-
|
|
3779
|
+
ct(s, t[e]), this.style[e] = s;
|
|
3755
3780
|
}
|
|
3756
3781
|
this.initStyle();
|
|
3757
3782
|
}
|
|
@@ -4026,7 +4051,7 @@ class D extends Vt {
|
|
|
4026
4051
|
handleValuePosition(t, e) {
|
|
4027
4052
|
let { value: s, position: n, mainCanvas: o } = this;
|
|
4028
4053
|
if (!o) return !1;
|
|
4029
|
-
const a = t === "array1D" ?
|
|
4054
|
+
const a = t === "array1D" ? we : Gt, [l, c] = [
|
|
4030
4055
|
a(s) && (!e || s.length >= e),
|
|
4031
4056
|
a(n) && (!e || n.length >= e)
|
|
4032
4057
|
], h = {
|
|
@@ -4087,7 +4112,7 @@ class D extends Vt {
|
|
|
4087
4112
|
}
|
|
4088
4113
|
}
|
|
4089
4114
|
d(D, "ctx", document.createElement("canvas").getContext("2d"));
|
|
4090
|
-
class
|
|
4115
|
+
class de extends D {
|
|
4091
4116
|
constructor(t) {
|
|
4092
4117
|
super(t);
|
|
4093
4118
|
d(this, "_draw");
|
|
@@ -4195,7 +4220,7 @@ class R {
|
|
|
4195
4220
|
return new k(i).div(t).toNumber();
|
|
4196
4221
|
}
|
|
4197
4222
|
}
|
|
4198
|
-
class
|
|
4223
|
+
class fe extends D {
|
|
4199
4224
|
constructor(t) {
|
|
4200
4225
|
super(t);
|
|
4201
4226
|
/** 文字偏差 */
|
|
@@ -4295,7 +4320,7 @@ class ue extends D {
|
|
|
4295
4320
|
}
|
|
4296
4321
|
}
|
|
4297
4322
|
}
|
|
4298
|
-
class
|
|
4323
|
+
class vt extends D {
|
|
4299
4324
|
constructor(t) {
|
|
4300
4325
|
super(t);
|
|
4301
4326
|
d(this, "angle", 2 * Math.PI);
|
|
@@ -4340,7 +4365,7 @@ class gt extends D {
|
|
|
4340
4365
|
cancelAndRestartAnimation(t, e, s) {
|
|
4341
4366
|
this.fillProgress.scheduleCallback();
|
|
4342
4367
|
let n = 0;
|
|
4343
|
-
this.fillProgress.scheduleCallback =
|
|
4368
|
+
this.fillProgress.scheduleCallback = Ut((o) => {
|
|
4344
4369
|
!this.fillProgress || !o || (this.fillProgress.progress += (o - n) * (t ? 1 : -1), n = o, this.fillProgress.progress = Math.min(
|
|
4345
4370
|
1,
|
|
4346
4371
|
Math.max(0, this.fillProgress.progress)
|
|
@@ -4352,7 +4377,7 @@ class gt extends D {
|
|
|
4352
4377
|
this.fillProgress = {
|
|
4353
4378
|
lineWidthOffset: 0,
|
|
4354
4379
|
progress: 0,
|
|
4355
|
-
scheduleCallback:
|
|
4380
|
+
scheduleCallback: Ut((s) => {
|
|
4356
4381
|
this.fillProgress && (this.fillProgress.progress = s, this.updateLineWidthOffset(t));
|
|
4357
4382
|
}, e)
|
|
4358
4383
|
};
|
|
@@ -4411,7 +4436,7 @@ class gt extends D {
|
|
|
4411
4436
|
}
|
|
4412
4437
|
}
|
|
4413
4438
|
}
|
|
4414
|
-
class
|
|
4439
|
+
class Ze extends D {
|
|
4415
4440
|
constructor(t) {
|
|
4416
4441
|
super(t);
|
|
4417
4442
|
/** 控制点 */
|
|
@@ -4510,7 +4535,7 @@ class $e extends D {
|
|
|
4510
4535
|
tryCreateNewHandlePoint(t, e) {
|
|
4511
4536
|
var c;
|
|
4512
4537
|
if (!this.isPointInStroke(t, e)) return;
|
|
4513
|
-
const s = this.getExtendedDynamicPositions(), n =
|
|
4538
|
+
const s = this.getExtendedDynamicPositions(), n = fs([t, e], s);
|
|
4514
4539
|
if (n === -1) return;
|
|
4515
4540
|
const [o, a] = this.getAdjacentIndices(n), l = this.createNewHandlePoint(o, a);
|
|
4516
4541
|
this.insertHandlePoint(n, l), this.lockHandlePointCreationTemporarily(), (c = this.notifyReload) == null || c.call(this);
|
|
@@ -4531,17 +4556,17 @@ class $e extends D {
|
|
|
4531
4556
|
}
|
|
4532
4557
|
/** 创建新的控制点 */
|
|
4533
4558
|
createNewHandlePoint(t, e) {
|
|
4534
|
-
const s =
|
|
4559
|
+
const s = ee(
|
|
4535
4560
|
this.value[t],
|
|
4536
4561
|
this.value[e]
|
|
4537
|
-
), n =
|
|
4562
|
+
), n = ee(
|
|
4538
4563
|
this.position[t],
|
|
4539
4564
|
this.position[e]
|
|
4540
|
-
), o =
|
|
4565
|
+
), o = ee(
|
|
4541
4566
|
this.dynamicPosition[t],
|
|
4542
4567
|
this.dynamicPosition[e]
|
|
4543
4568
|
);
|
|
4544
|
-
return new
|
|
4569
|
+
return new vt({
|
|
4545
4570
|
value: s,
|
|
4546
4571
|
position: n,
|
|
4547
4572
|
dynamicPosition: o,
|
|
@@ -4580,7 +4605,7 @@ class $e extends D {
|
|
|
4580
4605
|
let { value: t, position: e, dynamicPosition: s, offset: n, isHandlePointsVisible: o } = this;
|
|
4581
4606
|
!s || !o || (t == null || t.forEach((a, l) => {
|
|
4582
4607
|
if (!this.handlePoints[l]) {
|
|
4583
|
-
const c = new
|
|
4608
|
+
const c = new vt({
|
|
4584
4609
|
value: [0, 0],
|
|
4585
4610
|
mainCanvas: this.mainCanvas,
|
|
4586
4611
|
isDraggable: !0,
|
|
@@ -4609,12 +4634,12 @@ class $e extends D {
|
|
|
4609
4634
|
});
|
|
4610
4635
|
}
|
|
4611
4636
|
}
|
|
4612
|
-
function
|
|
4637
|
+
function fs(r, i, t = 10) {
|
|
4613
4638
|
if (i.length === 0) return 0;
|
|
4614
4639
|
if (i.length === 1) return 1;
|
|
4615
4640
|
let e = 1 / 0, s = -1;
|
|
4616
4641
|
for (let n = 0; n < i.length - 1; n++) {
|
|
4617
|
-
const o =
|
|
4642
|
+
const o = Bs(
|
|
4618
4643
|
r,
|
|
4619
4644
|
i[n],
|
|
4620
4645
|
i[n + 1]
|
|
@@ -4625,11 +4650,11 @@ function as(r, i, t = 10) {
|
|
|
4625
4650
|
}
|
|
4626
4651
|
return s;
|
|
4627
4652
|
}
|
|
4628
|
-
function
|
|
4629
|
-
const { x: t, y: e } =
|
|
4653
|
+
function ee(r, i) {
|
|
4654
|
+
const { x: t, y: e } = ei(...r, ...i);
|
|
4630
4655
|
return [t, e];
|
|
4631
4656
|
}
|
|
4632
|
-
class
|
|
4657
|
+
class me extends Ze {
|
|
4633
4658
|
constructor(t) {
|
|
4634
4659
|
super(t);
|
|
4635
4660
|
d(this, "_isInfinite");
|
|
@@ -4670,7 +4695,7 @@ class de extends $e {
|
|
|
4670
4695
|
if (this.isInfinite) {
|
|
4671
4696
|
this.isRecalculate && this.updateDynamicPosition();
|
|
4672
4697
|
const { width: t, height: e } = this.mainCanvas.rect;
|
|
4673
|
-
return
|
|
4698
|
+
return ms(
|
|
4674
4699
|
[0, 0],
|
|
4675
4700
|
[t, e],
|
|
4676
4701
|
this.finalDynamicPosition[0],
|
|
@@ -4691,7 +4716,7 @@ class de extends $e {
|
|
|
4691
4716
|
var o;
|
|
4692
4717
|
const e = this.mainCanvas, s = e.style[e.theme].line;
|
|
4693
4718
|
let n = {};
|
|
4694
|
-
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || s : typeof this.style == "object" ? n =
|
|
4719
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || s : typeof this.style == "object" ? n = ct(
|
|
4695
4720
|
JSON.parse(JSON.stringify(s)),
|
|
4696
4721
|
this.style
|
|
4697
4722
|
) : n = s, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
@@ -4720,12 +4745,12 @@ class de extends $e {
|
|
|
4720
4745
|
const { rect: n } = e, [o, a] = s, l = [a[0] - o[0], a[1] - o[1]];
|
|
4721
4746
|
if (l[0] === 0 && l[1] === 0)
|
|
4722
4747
|
return console.error("重合点无法确定方向");
|
|
4723
|
-
const c =
|
|
4748
|
+
const c = Re(
|
|
4724
4749
|
o,
|
|
4725
4750
|
[-l[0], -l[1]],
|
|
4726
4751
|
n.width,
|
|
4727
4752
|
n.height
|
|
4728
|
-
), h =
|
|
4753
|
+
), h = Re(
|
|
4729
4754
|
a,
|
|
4730
4755
|
l,
|
|
4731
4756
|
n.width,
|
|
@@ -4740,7 +4765,7 @@ class de extends $e {
|
|
|
4740
4765
|
}
|
|
4741
4766
|
}
|
|
4742
4767
|
}
|
|
4743
|
-
function
|
|
4768
|
+
function Re(r, i, t, e) {
|
|
4744
4769
|
const [s, n] = r, [o, a] = i;
|
|
4745
4770
|
let l = 1 / 0;
|
|
4746
4771
|
if (o !== 0) {
|
|
@@ -4753,7 +4778,7 @@ function Ee(r, i, t, e) {
|
|
|
4753
4778
|
}
|
|
4754
4779
|
return l === 1 / 0 ? r : [s + o * l, n + a * l];
|
|
4755
4780
|
}
|
|
4756
|
-
function
|
|
4781
|
+
function ms(r, i, t, e) {
|
|
4757
4782
|
const s = Math.min(r[0], i[0]), n = Math.max(r[0], i[0]), o = Math.min(r[1], i[1]), a = Math.max(r[1], i[1]), l = [
|
|
4758
4783
|
[s, o],
|
|
4759
4784
|
// 左上
|
|
@@ -4777,7 +4802,7 @@ function ls(r, i, t, e) {
|
|
|
4777
4802
|
}
|
|
4778
4803
|
return m && g;
|
|
4779
4804
|
}
|
|
4780
|
-
class
|
|
4805
|
+
class pe extends Ze {
|
|
4781
4806
|
constructor(t) {
|
|
4782
4807
|
super(t);
|
|
4783
4808
|
d(this, "_isRect", !1);
|
|
@@ -4872,7 +4897,7 @@ class fe extends $e {
|
|
|
4872
4897
|
var c;
|
|
4873
4898
|
const e = this.isHover, s = this.mainCanvas, n = s.style[s.theme].polygon;
|
|
4874
4899
|
let o = {};
|
|
4875
|
-
typeof this.style == "string" ? o = ((c = s.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o =
|
|
4900
|
+
typeof this.style == "string" ? o = ((c = s.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = ct(
|
|
4876
4901
|
JSON.parse(JSON.stringify(n)),
|
|
4877
4902
|
this.style
|
|
4878
4903
|
) : o = n;
|
|
@@ -4914,7 +4939,7 @@ class fe extends $e {
|
|
|
4914
4939
|
}
|
|
4915
4940
|
}
|
|
4916
4941
|
}
|
|
4917
|
-
class
|
|
4942
|
+
class ge extends D {
|
|
4918
4943
|
constructor(t) {
|
|
4919
4944
|
super(t);
|
|
4920
4945
|
d(this, "_isFill", !1);
|
|
@@ -5108,7 +5133,7 @@ class me extends D {
|
|
|
5108
5133
|
var c;
|
|
5109
5134
|
const e = this.isHover, s = this.mainCanvas, n = s.style[s.theme].arc;
|
|
5110
5135
|
let o = {};
|
|
5111
|
-
typeof this.style == "string" ? o = ((c = s.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o =
|
|
5136
|
+
typeof this.style == "string" ? o = ((c = s.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = ct(
|
|
5112
5137
|
JSON.parse(JSON.stringify(n)),
|
|
5113
5138
|
this.style
|
|
5114
5139
|
) : o = n;
|
|
@@ -5138,14 +5163,14 @@ class me extends D {
|
|
|
5138
5163
|
offset: c
|
|
5139
5164
|
} = this;
|
|
5140
5165
|
if (!t || !a || !l) return;
|
|
5141
|
-
const [h, u] =
|
|
5166
|
+
const [h, u] = ps(
|
|
5142
5167
|
...e,
|
|
5143
5168
|
s,
|
|
5144
5169
|
n,
|
|
5145
5170
|
o,
|
|
5146
5171
|
t.axisConfig.x,
|
|
5147
5172
|
t.axisConfig.y
|
|
5148
|
-
), f = (w) => new
|
|
5173
|
+
), f = (w) => new vt({
|
|
5149
5174
|
name: w,
|
|
5150
5175
|
offset: c,
|
|
5151
5176
|
value: [0, 0],
|
|
@@ -5242,14 +5267,14 @@ class me extends D {
|
|
|
5242
5267
|
}
|
|
5243
5268
|
}
|
|
5244
5269
|
}
|
|
5245
|
-
function
|
|
5270
|
+
function ps(r, i, t, e, s, n = 1, o = 1) {
|
|
5246
5271
|
const a = r + t * Math.cos(e) * n, l = i + t * Math.sin(e) * o, c = r + t * Math.cos(s) * n, h = i + t * Math.sin(s) * o;
|
|
5247
5272
|
return [
|
|
5248
5273
|
[a, l],
|
|
5249
5274
|
[c, h]
|
|
5250
5275
|
];
|
|
5251
5276
|
}
|
|
5252
|
-
class
|
|
5277
|
+
class ve extends D {
|
|
5253
5278
|
constructor(t) {
|
|
5254
5279
|
super(t);
|
|
5255
5280
|
/** 控制点 */
|
|
@@ -5334,7 +5359,7 @@ class pe extends D {
|
|
|
5334
5359
|
var o;
|
|
5335
5360
|
const e = this.mainCanvas, s = e.style[e.theme].arcTo;
|
|
5336
5361
|
let n = {};
|
|
5337
|
-
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || s : typeof this.style == "object" ? n =
|
|
5362
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || s : typeof this.style == "object" ? n = ct(
|
|
5338
5363
|
JSON.parse(JSON.stringify(s)),
|
|
5339
5364
|
this.style
|
|
5340
5365
|
) : n = s, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
@@ -5347,7 +5372,7 @@ class pe extends D {
|
|
|
5347
5372
|
var c, h;
|
|
5348
5373
|
let { value: t, position: e, dynamicPosition: s, isHandlePointsVisible: n } = this;
|
|
5349
5374
|
if (!s || !n) return;
|
|
5350
|
-
const o = () => new
|
|
5375
|
+
const o = () => new vt({
|
|
5351
5376
|
value: [0, 0],
|
|
5352
5377
|
mainCanvas: this.mainCanvas,
|
|
5353
5378
|
isDraggable: !0,
|
|
@@ -5373,8 +5398,8 @@ class pe extends D {
|
|
|
5373
5398
|
if (!this.mainCanvas) return;
|
|
5374
5399
|
let { value: t, position: e } = this;
|
|
5375
5400
|
const [s, n] = [
|
|
5376
|
-
|
|
5377
|
-
|
|
5401
|
+
Gt(t) && t.length > 1,
|
|
5402
|
+
Gt(e) && e.length > 1
|
|
5378
5403
|
];
|
|
5379
5404
|
if (!s && !n)
|
|
5380
5405
|
return this.handlePoints = void 0, this.internalUpdate({ dynamicPosition: void 0 });
|
|
@@ -5416,7 +5441,7 @@ class pe extends D {
|
|
|
5416
5441
|
}
|
|
5417
5442
|
}
|
|
5418
5443
|
}
|
|
5419
|
-
class
|
|
5444
|
+
class gs extends ds {
|
|
5420
5445
|
constructor(t) {
|
|
5421
5446
|
super(t);
|
|
5422
5447
|
/** 监听元素大小 */
|
|
@@ -5433,7 +5458,7 @@ class hs extends os {
|
|
|
5433
5458
|
maxYV: 0
|
|
5434
5459
|
});
|
|
5435
5460
|
/** 测量重绘性能 */
|
|
5436
|
-
d(this, "measureRedrawPerformance",
|
|
5461
|
+
d(this, "measureRedrawPerformance", ui(
|
|
5437
5462
|
() => {
|
|
5438
5463
|
this.isRendering = !0, this.redraw(), this.redrawInNextRenderFrame = !1, this.isRendering = !1;
|
|
5439
5464
|
},
|
|
@@ -5446,7 +5471,7 @@ class hs extends os {
|
|
|
5446
5471
|
}
|
|
5447
5472
|
));
|
|
5448
5473
|
this.canvas && (this.resizeObserver = new ResizeObserver(
|
|
5449
|
-
|
|
5474
|
+
Fe(() => {
|
|
5450
5475
|
[this.canvas.width, this.canvas.height] = [
|
|
5451
5476
|
this.rect.width,
|
|
5452
5477
|
this.rect.height
|
|
@@ -5493,7 +5518,7 @@ class hs extends os {
|
|
|
5493
5518
|
if (a !== h) return h - a;
|
|
5494
5519
|
if (l !== u)
|
|
5495
5520
|
return u - l;
|
|
5496
|
-
const m = (g) => g instanceof
|
|
5521
|
+
const m = (g) => g instanceof de ? 5 : g instanceof fe ? 4 : g instanceof vt ? 3 : g instanceof me || g instanceof ge || g instanceof ve ? 2 : g instanceof pe ? 1 : 0;
|
|
5497
5522
|
return m(f) - m(c);
|
|
5498
5523
|
}
|
|
5499
5524
|
), this.currentDrawOverlays = t.map(
|
|
@@ -5528,7 +5553,7 @@ class hs extends os {
|
|
|
5528
5553
|
(t = this.resizeObserver) == null || t.disconnect();
|
|
5529
5554
|
}
|
|
5530
5555
|
}
|
|
5531
|
-
class
|
|
5556
|
+
class vs extends gs {
|
|
5532
5557
|
constructor(t) {
|
|
5533
5558
|
super(t);
|
|
5534
5559
|
/** 鼠标是否在画布内 */
|
|
@@ -5638,16 +5663,16 @@ class us extends hs {
|
|
|
5638
5663
|
keydown(t) {
|
|
5639
5664
|
const { mouseInCanvas: e, offset: s, delta: n, axisConfig: o } = this, a = t.key;
|
|
5640
5665
|
if (!e || !this.isDraggable || this.isAuto) return;
|
|
5641
|
-
const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (
|
|
5666
|
+
const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (Gt(c.value) ? "Matrix" : we(c.value) ? "Single" : !1), f = (y, w) => {
|
|
5642
5667
|
if (!u)
|
|
5643
5668
|
return s.x += y * l, s.y += w * l, !0;
|
|
5644
|
-
const b = this.getAxisValueByPoint(l, 0).xV, [P,
|
|
5669
|
+
const b = this.getAxisValueByPoint(l, 0).xV, [P, _] = [b * o.x, b * o.y];
|
|
5645
5670
|
if (u === "Single") {
|
|
5646
|
-
const
|
|
5647
|
-
|
|
5671
|
+
const O = c.value;
|
|
5672
|
+
O[0] += y * P, O[1] += w * _;
|
|
5648
5673
|
} else
|
|
5649
|
-
c.value.forEach((
|
|
5650
|
-
|
|
5674
|
+
c.value.forEach((O) => {
|
|
5675
|
+
O[0] += y * P, O[1] += w * _;
|
|
5651
5676
|
});
|
|
5652
5677
|
return c.value = [...c.value], !0;
|
|
5653
5678
|
}, m = (y) => (this.setScale("center", y * n), !0), p = {
|
|
@@ -5773,17 +5798,17 @@ class us extends hs {
|
|
|
5773
5798
|
} else if (e.length === 2) {
|
|
5774
5799
|
const { clientX: h, clientY: u } = e[0], { clientX: f, clientY: m } = e[1];
|
|
5775
5800
|
if (s.length == 2) {
|
|
5776
|
-
const g =
|
|
5801
|
+
const g = Oe(
|
|
5777
5802
|
s[0],
|
|
5778
5803
|
n[0],
|
|
5779
5804
|
s[1],
|
|
5780
5805
|
n[1]
|
|
5781
|
-
), p =
|
|
5806
|
+
), p = Oe(
|
|
5782
5807
|
h,
|
|
5783
5808
|
u,
|
|
5784
5809
|
f,
|
|
5785
5810
|
m
|
|
5786
|
-
), { x: y, y: w } =
|
|
5811
|
+
), { x: y, y: w } = ei(
|
|
5787
5812
|
h,
|
|
5788
5813
|
u,
|
|
5789
5814
|
f,
|
|
@@ -5966,7 +5991,7 @@ class $ extends Vt {
|
|
|
5966
5991
|
}
|
|
5967
5992
|
}
|
|
5968
5993
|
}
|
|
5969
|
-
class
|
|
5994
|
+
class Rt extends Vt {
|
|
5970
5995
|
constructor(t) {
|
|
5971
5996
|
super(t);
|
|
5972
5997
|
/** 图层群组 */
|
|
@@ -6039,7 +6064,7 @@ class kt extends Vt {
|
|
|
6039
6064
|
return [];
|
|
6040
6065
|
}
|
|
6041
6066
|
}
|
|
6042
|
-
class
|
|
6067
|
+
class ys extends vs {
|
|
6043
6068
|
/** 获取默认覆盖物群组 */
|
|
6044
6069
|
getDefaultOverlayGroup() {
|
|
6045
6070
|
var c, h, u, f, m, g, p;
|
|
@@ -6064,7 +6089,7 @@ class ds extends us {
|
|
|
6064
6089
|
const t = [], e = i !== void 0 ? Array.isArray(i) ? [...i] : [i] : Array.from(this.layerGroups.values());
|
|
6065
6090
|
for (; e.length > 0; ) {
|
|
6066
6091
|
const s = e.pop();
|
|
6067
|
-
if (s instanceof
|
|
6092
|
+
if (s instanceof Rt) {
|
|
6068
6093
|
if (!s.isVisible) continue;
|
|
6069
6094
|
e.push(...s.layers.values());
|
|
6070
6095
|
} else if (s instanceof $) {
|
|
@@ -6079,7 +6104,7 @@ class ds extends us {
|
|
|
6079
6104
|
return t;
|
|
6080
6105
|
}
|
|
6081
6106
|
}
|
|
6082
|
-
class
|
|
6107
|
+
class ws extends ys {
|
|
6083
6108
|
/** 缩放画布 */
|
|
6084
6109
|
zoom(i) {
|
|
6085
6110
|
const { canvas: t, rect: e } = this;
|
|
@@ -6112,7 +6137,7 @@ class fs extends ds {
|
|
|
6112
6137
|
super.setDefaultCenter(i), this.redrawOnce();
|
|
6113
6138
|
}
|
|
6114
6139
|
}
|
|
6115
|
-
class
|
|
6140
|
+
class xs extends ws {
|
|
6116
6141
|
/**
|
|
6117
6142
|
* 调整视图以适应指定覆盖层
|
|
6118
6143
|
* @param overlays 目标覆盖层数组,默认使用全部可见覆盖层
|
|
@@ -6170,11 +6195,11 @@ class ms extends fs {
|
|
|
6170
6195
|
const m = i / u, g = t / f, p = Math.max(m, g), y = a.count, w = y / a.min, b = n * o;
|
|
6171
6196
|
let P;
|
|
6172
6197
|
if (p > w) {
|
|
6173
|
-
const
|
|
6174
|
-
P = 1 - ((y *
|
|
6198
|
+
const _ = Math.ceil(p / w);
|
|
6199
|
+
P = 1 - ((y * _ / p - a.min) / a.min + (_ - 2)) * b;
|
|
6175
6200
|
} else {
|
|
6176
|
-
const
|
|
6177
|
-
P = 1 + ((y / G / p - a.min) / a.min +
|
|
6201
|
+
const _ = (dt, nt, yt) => dt < nt ? yt - 1 : _(dt / 2, nt, yt + 1), O = _(w, p, 0), G = Math.pow(2, O);
|
|
6202
|
+
P = 1 + ((y / G / p - a.min) / a.min + O) * b;
|
|
6178
6203
|
}
|
|
6179
6204
|
return s !== void 0 && (P = Math.min(s, P)), P = new k(P).div(o).round().mul(o).toNumber(), P;
|
|
6180
6205
|
}
|
|
@@ -6224,13 +6249,13 @@ class ms extends fs {
|
|
|
6224
6249
|
animateScale(i, t, e, s) {
|
|
6225
6250
|
const n = t - i;
|
|
6226
6251
|
let o = 0;
|
|
6227
|
-
|
|
6252
|
+
Ut((a) => {
|
|
6228
6253
|
!this.isAuto || !this.canvas || !this.isInteractive || (this.setScale("center", (a - o) * n), o = a, this.redrawOnce(), a === 1 && s());
|
|
6229
6254
|
}, e);
|
|
6230
6255
|
}
|
|
6231
6256
|
/** 执行偏移动画 */
|
|
6232
6257
|
animateOffset(i, t, e, s) {
|
|
6233
|
-
|
|
6258
|
+
Ut((n) => {
|
|
6234
6259
|
!this.isAuto || !this.canvas || !this.isInteractive || (this.offset = {
|
|
6235
6260
|
x: Number((i.x + t.x * n).toFixed(0)),
|
|
6236
6261
|
y: Number((i.y + t.y * n).toFixed(0))
|
|
@@ -6255,7 +6280,7 @@ class ms extends fs {
|
|
|
6255
6280
|
});
|
|
6256
6281
|
}
|
|
6257
6282
|
}
|
|
6258
|
-
class
|
|
6283
|
+
class bs extends xs {
|
|
6259
6284
|
/** 开关坐标轴 */
|
|
6260
6285
|
toggleAxis(i) {
|
|
6261
6286
|
this.drawAxis.toggleAxis(i), this.redrawOnce();
|
|
@@ -6280,7 +6305,7 @@ class ps extends ms {
|
|
|
6280
6305
|
return this.isInteractive = i ?? !this.isInteractive, this.isInteractive;
|
|
6281
6306
|
}
|
|
6282
6307
|
}
|
|
6283
|
-
class
|
|
6308
|
+
class Ps extends bs {
|
|
6284
6309
|
/**
|
|
6285
6310
|
* 清除指定区域的像素点
|
|
6286
6311
|
* @param ctx - Canvas 2D绘图上下文
|
|
@@ -6291,9 +6316,9 @@ class gs extends ps {
|
|
|
6291
6316
|
i.save(), i.beginPath(), i.clip(t), i.clearRect(0, 0, e, s), i.restore();
|
|
6292
6317
|
}
|
|
6293
6318
|
}
|
|
6294
|
-
class
|
|
6319
|
+
class Cs extends Ps {
|
|
6295
6320
|
}
|
|
6296
|
-
class
|
|
6321
|
+
class Ss {
|
|
6297
6322
|
constructor(i) {
|
|
6298
6323
|
/** 画布 */
|
|
6299
6324
|
d(this, "canvas");
|
|
@@ -6408,22 +6433,22 @@ class ys {
|
|
|
6408
6433
|
const y = s.y > c || s.y < 0;
|
|
6409
6434
|
let w = s.x > 0 ? s.x % g : s.x < 0 ? g + s.x % g : 0, b = i.getAxisValueByPoint((w - s.x) * n.x, 0).xV;
|
|
6410
6435
|
for (; w <= l; ) {
|
|
6411
|
-
const P =
|
|
6412
|
-
b !== 0 && this.drawText(P, w -
|
|
6436
|
+
const P = se(b), _ = h(P);
|
|
6437
|
+
b !== 0 && this.drawText(P, w - _ / 2, p, y), w += g, b = new k(m).mul(n.x).add(b).toNumber();
|
|
6413
6438
|
}
|
|
6414
6439
|
}
|
|
6415
6440
|
{
|
|
6416
6441
|
const p = s.x > l || s.x < 0;
|
|
6417
6442
|
let y = s.y > 0 ? s.y % g : s.y < 0 ? g + s.y % g : 0, w = i.getAxisValueByPoint(0, (y - s.y) * n.y).yV;
|
|
6418
6443
|
for (; y <= c; ) {
|
|
6419
|
-
const b =
|
|
6420
|
-
let
|
|
6421
|
-
|
|
6444
|
+
const b = se(w), P = h(b);
|
|
6445
|
+
let _ = s.x - P - u;
|
|
6446
|
+
_ = Math.max(Math.min(_, l - P - u), u), w != 0 && this.drawText(b, _, y + f / 2, p), y += g, w = new k(m).mul(n.y).add(w).toNumber();
|
|
6422
6447
|
}
|
|
6423
6448
|
}
|
|
6424
6449
|
}
|
|
6425
6450
|
}
|
|
6426
|
-
class
|
|
6451
|
+
class Es {
|
|
6427
6452
|
constructor(i) {
|
|
6428
6453
|
/** 绑定的画布实例 */
|
|
6429
6454
|
d(this, "canvas");
|
|
@@ -6527,7 +6552,7 @@ class ws {
|
|
|
6527
6552
|
}
|
|
6528
6553
|
}
|
|
6529
6554
|
}
|
|
6530
|
-
class
|
|
6555
|
+
class _s {
|
|
6531
6556
|
/**
|
|
6532
6557
|
* 计算默认缩放比例,使图像适配视图容器
|
|
6533
6558
|
* @param naturalWidth 图像原始宽度
|
|
@@ -6562,7 +6587,7 @@ class xs {
|
|
|
6562
6587
|
};
|
|
6563
6588
|
}
|
|
6564
6589
|
}
|
|
6565
|
-
class
|
|
6590
|
+
class Ms extends D {
|
|
6566
6591
|
constructor(t) {
|
|
6567
6592
|
super(t);
|
|
6568
6593
|
d(this, "_ready", !1);
|
|
@@ -6620,12 +6645,12 @@ class bs extends D {
|
|
|
6620
6645
|
const g = u.w / u.h, p = f / m;
|
|
6621
6646
|
if (o === "fill") return u;
|
|
6622
6647
|
if (o === "contain" || o === "scale-down") {
|
|
6623
|
-
const b = Math.min(u.w / f, u.h / m), P = o === "scale-down" ? Math.min(1, b) : b,
|
|
6648
|
+
const b = Math.min(u.w / f, u.h / m), P = o === "scale-down" ? Math.min(1, b) : b, _ = f * P, O = m * P;
|
|
6624
6649
|
return {
|
|
6625
|
-
x: u.x + (u.w -
|
|
6626
|
-
y: u.y + (u.h -
|
|
6627
|
-
w:
|
|
6628
|
-
h:
|
|
6650
|
+
x: u.x + (u.w - _) / 2,
|
|
6651
|
+
y: u.y + (u.h - O) / 2,
|
|
6652
|
+
w: _,
|
|
6653
|
+
h: O
|
|
6629
6654
|
};
|
|
6630
6655
|
}
|
|
6631
6656
|
if (p > g) {
|
|
@@ -6651,7 +6676,7 @@ class bs extends D {
|
|
|
6651
6676
|
this.mainCanvas && (this.ready = !1, this.url && (this.image.src = this.url), this.handleValuePosition("array2D", 1));
|
|
6652
6677
|
}
|
|
6653
6678
|
}
|
|
6654
|
-
class
|
|
6679
|
+
class Ae extends Ms {
|
|
6655
6680
|
constructor(t) {
|
|
6656
6681
|
super(t);
|
|
6657
6682
|
d(this, "defaultDrag", (t, e) => {
|
|
@@ -6687,7 +6712,7 @@ class Me extends bs {
|
|
|
6687
6712
|
var o;
|
|
6688
6713
|
const e = this.mainCanvas, s = e.style[e.theme].billboard;
|
|
6689
6714
|
let n = {};
|
|
6690
|
-
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || s : typeof this.style == "object" ? n =
|
|
6715
|
+
return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || s : typeof this.style == "object" ? n = ct(
|
|
6691
6716
|
JSON.parse(JSON.stringify(s)),
|
|
6692
6717
|
this.style
|
|
6693
6718
|
) : n = s, t && this.setBaseLineStyle(t, n.stroke), n;
|
|
@@ -6714,15 +6739,15 @@ class Me extends bs {
|
|
|
6714
6739
|
}
|
|
6715
6740
|
}
|
|
6716
6741
|
}
|
|
6717
|
-
function
|
|
6742
|
+
function Ft(r) {
|
|
6718
6743
|
return [r].flat(1 / 0);
|
|
6719
6744
|
}
|
|
6720
|
-
class T extends
|
|
6745
|
+
class T extends Cs {
|
|
6721
6746
|
constructor(t) {
|
|
6722
6747
|
super(t);
|
|
6723
6748
|
/** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
|
|
6724
6749
|
d(this, "overlayCreator");
|
|
6725
|
-
this.drawAxis = new
|
|
6750
|
+
this.drawAxis = new Ss(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new Es(this), this.initLayerGroups(), this.updateCenter();
|
|
6726
6751
|
}
|
|
6727
6752
|
initLayerGroups() {
|
|
6728
6753
|
const t = new $({ name: "其他图层", zIndex: 1 });
|
|
@@ -6739,7 +6764,7 @@ class T extends vs {
|
|
|
6739
6764
|
a.addGroup(new Y({ name: "文字覆盖物群组" }));
|
|
6740
6765
|
const l = new $({ name: "自定义绘制图层", zIndex: 7 });
|
|
6741
6766
|
l.addGroup(new Y({ name: "自定义绘制覆盖物群组" }));
|
|
6742
|
-
const c = new
|
|
6767
|
+
const c = new Rt({ name: "默认图层群组" });
|
|
6743
6768
|
c.addLayer([
|
|
6744
6769
|
a,
|
|
6745
6770
|
o,
|
|
@@ -6756,11 +6781,11 @@ class T extends vs {
|
|
|
6756
6781
|
}
|
|
6757
6782
|
/** 设置图层群组 */
|
|
6758
6783
|
setLayerGroup(t) {
|
|
6759
|
-
t instanceof
|
|
6784
|
+
t instanceof Rt && (this.layerGroups.set(t.name, t), t.setNotifyReload(() => this.redrawOnce()), t.setMainCanvas(this), t.parent = this);
|
|
6760
6785
|
}
|
|
6761
6786
|
/** 移除图层群组 */
|
|
6762
6787
|
removeLayerGroup(t) {
|
|
6763
|
-
t instanceof
|
|
6788
|
+
t instanceof Rt && (this.layerGroups.delete(t.name), t.setNotifyReload(), t.setMainCanvas(), t.parent = void 0, this.redrawOnce());
|
|
6764
6789
|
}
|
|
6765
6790
|
removeChild(t) {
|
|
6766
6791
|
this.removeLayerGroup(t);
|
|
@@ -6768,11 +6793,11 @@ class T extends vs {
|
|
|
6768
6793
|
/** 添加图层 */
|
|
6769
6794
|
addLayer(t) {
|
|
6770
6795
|
const e = this.layerGroups.get("默认图层群组");
|
|
6771
|
-
e && e.addLayer(
|
|
6796
|
+
e && e.addLayer(Ft(t));
|
|
6772
6797
|
}
|
|
6773
6798
|
/** 移除图层 */
|
|
6774
6799
|
removeLayer(t) {
|
|
6775
|
-
|
|
6800
|
+
Ft(t).forEach((e) => e.remove());
|
|
6776
6801
|
}
|
|
6777
6802
|
/** 添加覆盖物 */
|
|
6778
6803
|
addOverlay(t) {
|
|
@@ -6785,13 +6810,13 @@ class T extends vs {
|
|
|
6785
6810
|
overlays_billboard: l,
|
|
6786
6811
|
overlays_other: c
|
|
6787
6812
|
} = this.getDefaultOverlayGroup() || {};
|
|
6788
|
-
|
|
6789
|
-
h instanceof
|
|
6813
|
+
Ft(t).forEach((h) => {
|
|
6814
|
+
h instanceof fe ? e == null || e.addOverlay(h) : h instanceof vt ? s == null || s.addOverlay(h) : h instanceof me || h instanceof ge || h instanceof ve ? n == null || n.addOverlay(h) : h instanceof pe ? o == null || o.addOverlay(h) : h instanceof de ? a == null || a.addOverlay(h) : h instanceof Ae ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
|
|
6790
6815
|
});
|
|
6791
6816
|
}
|
|
6792
6817
|
/** 移除覆盖物 */
|
|
6793
6818
|
removeOverlay(t) {
|
|
6794
|
-
|
|
6819
|
+
Ft(t).forEach((e) => e.remove());
|
|
6795
6820
|
}
|
|
6796
6821
|
/** 销毁 */
|
|
6797
6822
|
destroy() {
|
|
@@ -6799,19 +6824,19 @@ class T extends vs {
|
|
|
6799
6824
|
}
|
|
6800
6825
|
}
|
|
6801
6826
|
/** 视图适配工具:默认缩放、居中计算 */
|
|
6802
|
-
d(T, "ViewFit",
|
|
6803
|
-
d(T, "LayerGroup",
|
|
6827
|
+
d(T, "ViewFit", _s), /** 图层群组 */
|
|
6828
|
+
d(T, "LayerGroup", Rt), /** 图层 */
|
|
6804
6829
|
d(T, "Layer", $), /** 覆盖物群组 */
|
|
6805
6830
|
d(T, "OverlayGroup", Y), /** 文字 */
|
|
6806
|
-
d(T, "Text",
|
|
6807
|
-
d(T, "Point",
|
|
6808
|
-
d(T, "Line",
|
|
6809
|
-
d(T, "Polygon",
|
|
6810
|
-
d(T, "Custom",
|
|
6811
|
-
d(T, "Arc",
|
|
6812
|
-
d(T, "ArcTo",
|
|
6813
|
-
d(T, "Billboard",
|
|
6814
|
-
class
|
|
6831
|
+
d(T, "Text", fe), /** 点位 */
|
|
6832
|
+
d(T, "Point", vt), /** 线段 */
|
|
6833
|
+
d(T, "Line", me), /** 多边形 */
|
|
6834
|
+
d(T, "Polygon", pe), /** 自定义绘制 */
|
|
6835
|
+
d(T, "Custom", de), /** 圆弧 */
|
|
6836
|
+
d(T, "Arc", ge), /** 圆角 */
|
|
6837
|
+
d(T, "ArcTo", ve), /** 图片 */
|
|
6838
|
+
d(T, "Billboard", Ae);
|
|
6839
|
+
class Ds {
|
|
6815
6840
|
/** @param id canvas DOM id(通过 getElementById 定位) */
|
|
6816
6841
|
constructor(i) {
|
|
6817
6842
|
/** Canvas DOM id(用于 `document.getElementById` 定位) */
|
|
@@ -6865,7 +6890,7 @@ class Ps {
|
|
|
6865
6890
|
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0);
|
|
6866
6891
|
}
|
|
6867
6892
|
}
|
|
6868
|
-
class
|
|
6893
|
+
class ks {
|
|
6869
6894
|
/**
|
|
6870
6895
|
* @param canvas 绑定 mousedown 的 canvas
|
|
6871
6896
|
* @param onOffsetDelta 拖拽时的 dx 回调(由外部映射到时间偏移)
|
|
@@ -6904,7 +6929,7 @@ class Cs {
|
|
|
6904
6929
|
this.canvas.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
6905
6930
|
}
|
|
6906
6931
|
}
|
|
6907
|
-
class
|
|
6932
|
+
class Rs {
|
|
6908
6933
|
/**
|
|
6909
6934
|
* @param canvas 绑定 wheel 事件的 canvas
|
|
6910
6935
|
* @param getTimeSpacing 读取当前 timeSpacing 的函数
|
|
@@ -6939,7 +6964,7 @@ class Ss {
|
|
|
6939
6964
|
this.canvas.removeEventListener("wheel", this.handleWheel);
|
|
6940
6965
|
}
|
|
6941
6966
|
}
|
|
6942
|
-
class
|
|
6967
|
+
class As {
|
|
6943
6968
|
/**
|
|
6944
6969
|
* 只负责计算鼠标所在 x/y 对应的时间,并把结果通知给 TimeAxis(不直接操作 DOM)。
|
|
6945
6970
|
*/
|
|
@@ -6976,10 +7001,10 @@ class _s {
|
|
|
6976
7001
|
this.canvas.removeEventListener("mousemove", this.handleMouseMove), this.canvas.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
6977
7002
|
}
|
|
6978
7003
|
}
|
|
6979
|
-
const
|
|
7004
|
+
const Vs = {
|
|
6980
7005
|
easeInOutQuad: (r) => r < 0.5 ? 2 * r * r : 1 - Math.pow(-2 * r + 2, 2) / 2
|
|
6981
7006
|
};
|
|
6982
|
-
class
|
|
7007
|
+
class Os {
|
|
6983
7008
|
/**
|
|
6984
7009
|
* 创建时间轴引擎:会在构造后 `requestAnimationFrame` 初始化并开始渲染。
|
|
6985
7010
|
* @param id canvas DOM id
|
|
@@ -7025,13 +7050,13 @@ class Ms {
|
|
|
7025
7050
|
* 可用于叠加额外图形(如指示线、事件点等)
|
|
7026
7051
|
*/
|
|
7027
7052
|
d(this, "onDrawOverlay");
|
|
7028
|
-
this.canvasManager = new
|
|
7053
|
+
this.canvasManager = new Ds(i), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
|
|
7029
7054
|
}
|
|
7030
7055
|
/** 初始化交互:拖拽平移、滚轮缩放、鼠标时间通知,并触发首次绘制 */
|
|
7031
7056
|
init() {
|
|
7032
7057
|
if (!this.canvasManager.init(() => this.render())) return;
|
|
7033
7058
|
const t = this.canvasManager.getCanvas();
|
|
7034
|
-
t && (this.offsetDrag = new
|
|
7059
|
+
t && (this.offsetDrag = new ks(
|
|
7035
7060
|
t,
|
|
7036
7061
|
(e) => {
|
|
7037
7062
|
this.currentTime -= Math.round(
|
|
@@ -7041,14 +7066,14 @@ class Ms {
|
|
|
7041
7066
|
() => {
|
|
7042
7067
|
this.stopCenterTimeAnimation();
|
|
7043
7068
|
}
|
|
7044
|
-
), this.wheelZoom = new
|
|
7069
|
+
), this.wheelZoom = new Rs(
|
|
7045
7070
|
t,
|
|
7046
7071
|
() => this.timeSpacing,
|
|
7047
7072
|
(e, s) => {
|
|
7048
7073
|
const n = this.getTimeAtCanvasX(s);
|
|
7049
7074
|
this.timeSpacing = e, this.setTimeAtCanvasX(n, s), this.render();
|
|
7050
7075
|
}
|
|
7051
|
-
), this.centerTime = Date.now(), this.mouseTimeReporter = new
|
|
7076
|
+
), this.centerTime = Date.now(), this.mouseTimeReporter = new As(
|
|
7052
7077
|
t,
|
|
7053
7078
|
(e) => this.getTimeAtCanvasX(e),
|
|
7054
7079
|
(e) => {
|
|
@@ -7092,7 +7117,7 @@ class Ms {
|
|
|
7092
7117
|
for (; y <= f; ) {
|
|
7093
7118
|
const w = p % o === 0, b = w ? a : l;
|
|
7094
7119
|
if (i.fillRect(y, 0, 1, b), w) {
|
|
7095
|
-
const P =
|
|
7120
|
+
const P = oi(g, "MM-DD hh:mm:ss");
|
|
7096
7121
|
i.fillText(P, y, c), g += t;
|
|
7097
7122
|
}
|
|
7098
7123
|
y += m, p++;
|
|
@@ -7147,8 +7172,8 @@ class Ms {
|
|
|
7147
7172
|
Math.max(0.5, h)
|
|
7148
7173
|
);
|
|
7149
7174
|
return Math.max(1, Math.round(u * 60));
|
|
7150
|
-
})(), a = (t == null ? void 0 : t.curve) ??
|
|
7151
|
-
|
|
7175
|
+
})(), a = (t == null ? void 0 : t.curve) ?? Vs.easeInOutQuad;
|
|
7176
|
+
ri(
|
|
7152
7177
|
0,
|
|
7153
7178
|
1,
|
|
7154
7179
|
o,
|
|
@@ -7169,7 +7194,7 @@ class Ms {
|
|
|
7169
7194
|
(i = this.offsetDrag) == null || i.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
|
|
7170
7195
|
}
|
|
7171
7196
|
}
|
|
7172
|
-
class
|
|
7197
|
+
class _n extends Os {
|
|
7173
7198
|
/**
|
|
7174
7199
|
* 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
|
|
7175
7200
|
* @param rect 矩形区域,用于计算渐变起止点
|
|
@@ -7214,6 +7239,161 @@ class vn extends Ms {
|
|
|
7214
7239
|
p && (t.fillStyle = p), h && (t.strokeStyle = h), t.lineWidth = u, t.beginPath(), typeof t.roundRect == "function" ? t.roundRect(f, o, g, a + o, l) : t.rect(f, o, g, a + o), c && t.fill(), h && t.stroke();
|
|
7215
7240
|
}
|
|
7216
7241
|
}
|
|
7242
|
+
const ye = {
|
|
7243
|
+
image: "image/",
|
|
7244
|
+
video: "video/",
|
|
7245
|
+
audio: "audio/",
|
|
7246
|
+
application: "application/"
|
|
7247
|
+
};
|
|
7248
|
+
function Ve(r) {
|
|
7249
|
+
return typeof r == "string" ? document.querySelector(r) : r;
|
|
7250
|
+
}
|
|
7251
|
+
function Ls(r) {
|
|
7252
|
+
return r.some(
|
|
7253
|
+
(i) => i === "text/plain" || i.startsWith("text/")
|
|
7254
|
+
);
|
|
7255
|
+
}
|
|
7256
|
+
function Ts(r) {
|
|
7257
|
+
return r.includes("Files");
|
|
7258
|
+
}
|
|
7259
|
+
function Qe(r) {
|
|
7260
|
+
return typeof r == "string" && (r.includes(".") || r.includes("/"));
|
|
7261
|
+
}
|
|
7262
|
+
function Is(r, i) {
|
|
7263
|
+
if (!i) return !0;
|
|
7264
|
+
const t = i.split(",").map((n) => n.trim().toLowerCase()), e = r.name.toLowerCase(), s = r.type.toLowerCase();
|
|
7265
|
+
return t.some((n) => {
|
|
7266
|
+
if (n.startsWith("."))
|
|
7267
|
+
return e.endsWith(n);
|
|
7268
|
+
if (n.endsWith("/*")) {
|
|
7269
|
+
const o = n.replace("/*", "/");
|
|
7270
|
+
return s.startsWith(o);
|
|
7271
|
+
}
|
|
7272
|
+
return s === n;
|
|
7273
|
+
});
|
|
7274
|
+
}
|
|
7275
|
+
function ie(r, i) {
|
|
7276
|
+
return r ? (Array.isArray(r) ? r : [r]).some((e) => typeof e == "object" && e !== null && "matchTypes" in e ? e.matchTypes(i) : e === "text" ? Ls(i) : Qe(e) || e === "file" || e in ye ? Ts(i) : !1) : !0;
|
|
7277
|
+
}
|
|
7278
|
+
async function Ns(r, i) {
|
|
7279
|
+
if (!i) return [];
|
|
7280
|
+
const t = Array.from(i.files), e = Array.from(i.items);
|
|
7281
|
+
if (!r) return [...t, ...e];
|
|
7282
|
+
const s = Array.isArray(r) ? r : [r], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
7283
|
+
for (const l of s)
|
|
7284
|
+
if (typeof l == "object" && l !== null && "matchItem" in l)
|
|
7285
|
+
e.forEach((c) => {
|
|
7286
|
+
if (l.matchItem(c))
|
|
7287
|
+
if (c.kind === "file") {
|
|
7288
|
+
const h = c.getAsFile();
|
|
7289
|
+
h && n.add(h);
|
|
7290
|
+
} else c.kind === "string" && o.add(c);
|
|
7291
|
+
});
|
|
7292
|
+
else if (l === "text")
|
|
7293
|
+
e.forEach((c) => {
|
|
7294
|
+
(c.type === "text/plain" || c.type.startsWith("text/")) && o.add(c);
|
|
7295
|
+
});
|
|
7296
|
+
else if (l === "file")
|
|
7297
|
+
t.forEach((c) => n.add(c));
|
|
7298
|
+
else if (Qe(l))
|
|
7299
|
+
t.forEach((c) => {
|
|
7300
|
+
Is(c, l) && n.add(c);
|
|
7301
|
+
});
|
|
7302
|
+
else if (l in ye) {
|
|
7303
|
+
const c = ye[l];
|
|
7304
|
+
t.forEach((h) => {
|
|
7305
|
+
h.type.startsWith(c) && n.add(h);
|
|
7306
|
+
});
|
|
7307
|
+
}
|
|
7308
|
+
const a = Array.from(n);
|
|
7309
|
+
if (o.size > 0) {
|
|
7310
|
+
const l = Array.from(o).map(
|
|
7311
|
+
(h) => new Promise((u) => h.getAsString(u))
|
|
7312
|
+
), c = await Promise.all(l);
|
|
7313
|
+
a.push(...c);
|
|
7314
|
+
}
|
|
7315
|
+
return a;
|
|
7316
|
+
}
|
|
7317
|
+
class Mn {
|
|
7318
|
+
constructor() {
|
|
7319
|
+
d(this, "entries", /* @__PURE__ */ new Map());
|
|
7320
|
+
d(this, "onDragEnter", (i) => {
|
|
7321
|
+
var o;
|
|
7322
|
+
const t = i.currentTarget, e = this.entries.get(t);
|
|
7323
|
+
if (!e) return;
|
|
7324
|
+
const s = i.dataTransfer ? Array.from(i.dataTransfer.types) : [], n = e.rules.filter(
|
|
7325
|
+
(a) => ie(a.targetType, s)
|
|
7326
|
+
);
|
|
7327
|
+
n.length !== 0 && (e.dragDepth += 1, e.dragDepth === 1 && (e.isActive = !0, (o = e.globalActiveCallback) == null || o.call(e, !0), n.forEach((a) => {
|
|
7328
|
+
var l;
|
|
7329
|
+
e.activeRules.add(a), (l = a.activeCallback) == null || l.call(a, !0);
|
|
7330
|
+
})));
|
|
7331
|
+
});
|
|
7332
|
+
d(this, "onDragLeave", (i) => {
|
|
7333
|
+
var s;
|
|
7334
|
+
const t = i.currentTarget, e = this.entries.get(t);
|
|
7335
|
+
e && (e.dragDepth = Math.max(0, e.dragDepth - 1), e.dragDepth === 0 && e.isActive && (e.isActive = !1, (s = e.globalActiveCallback) == null || s.call(e, !1), e.activeRules.forEach((n) => {
|
|
7336
|
+
var o;
|
|
7337
|
+
return (o = n.activeCallback) == null ? void 0 : o.call(n, !1);
|
|
7338
|
+
}), e.activeRules.clear()));
|
|
7339
|
+
});
|
|
7340
|
+
d(this, "onDragOver", (i) => {
|
|
7341
|
+
const t = i.currentTarget, e = this.entries.get(t);
|
|
7342
|
+
if (!e) return;
|
|
7343
|
+
const s = i.dataTransfer ? Array.from(i.dataTransfer.types) : [];
|
|
7344
|
+
e.rules.some(
|
|
7345
|
+
(o) => ie(o.targetType, s)
|
|
7346
|
+
) && (i.preventDefault(), i.dataTransfer && (i.dataTransfer.dropEffect = "copy"));
|
|
7347
|
+
});
|
|
7348
|
+
d(this, "onDrop", async (i) => {
|
|
7349
|
+
var o;
|
|
7350
|
+
const t = i.currentTarget, e = this.entries.get(t);
|
|
7351
|
+
if (!e) return;
|
|
7352
|
+
const s = i.dataTransfer ? Array.from(i.dataTransfer.types) : [], n = e.rules.filter(
|
|
7353
|
+
(a) => ie(a.targetType, s)
|
|
7354
|
+
);
|
|
7355
|
+
n.length !== 0 && (i.preventDefault(), e.dragDepth = 0, e.isActive = !1, (o = e.globalActiveCallback) == null || o.call(e, !1), e.activeRules.forEach((a) => {
|
|
7356
|
+
var l;
|
|
7357
|
+
return (l = a.activeCallback) == null ? void 0 : l.call(a, !1);
|
|
7358
|
+
}), e.activeRules.clear(), n.forEach(async (a) => {
|
|
7359
|
+
const l = await Ns(a.targetType, i.dataTransfer);
|
|
7360
|
+
a.dropCallback(l);
|
|
7361
|
+
}));
|
|
7362
|
+
});
|
|
7363
|
+
}
|
|
7364
|
+
extractRules(i) {
|
|
7365
|
+
if ("rules" in i && Array.isArray(i.rules))
|
|
7366
|
+
return i.rules;
|
|
7367
|
+
const t = i;
|
|
7368
|
+
return [
|
|
7369
|
+
{
|
|
7370
|
+
targetType: t.targetType,
|
|
7371
|
+
dropCallback: t.dropCallback,
|
|
7372
|
+
activeCallback: t.activeCallback
|
|
7373
|
+
}
|
|
7374
|
+
];
|
|
7375
|
+
}
|
|
7376
|
+
add(i) {
|
|
7377
|
+
const t = Ve(i.dom);
|
|
7378
|
+
if (!t || this.entries.has(t)) return;
|
|
7379
|
+
const e = this.extractRules(i);
|
|
7380
|
+
t.addEventListener("dragenter", this.onDragEnter), t.addEventListener("dragleave", this.onDragLeave), t.addEventListener("dragover", this.onDragOver), t.addEventListener("drop", this.onDrop), this.entries.set(t, {
|
|
7381
|
+
dom: t,
|
|
7382
|
+
rules: e,
|
|
7383
|
+
globalActiveCallback: i.activeCallback,
|
|
7384
|
+
dragDepth: 0,
|
|
7385
|
+
isActive: !1,
|
|
7386
|
+
activeRules: /* @__PURE__ */ new Set()
|
|
7387
|
+
});
|
|
7388
|
+
}
|
|
7389
|
+
delete(i) {
|
|
7390
|
+
const t = Ve(i);
|
|
7391
|
+
!t || !this.entries.has(t) || (t.removeEventListener("dragenter", this.onDragEnter), t.removeEventListener("dragleave", this.onDragLeave), t.removeEventListener("dragover", this.onDragOver), t.removeEventListener("drop", this.onDrop), this.entries.delete(t));
|
|
7392
|
+
}
|
|
7393
|
+
destroy() {
|
|
7394
|
+
this.entries.keys().forEach((i) => this.delete(i));
|
|
7395
|
+
}
|
|
7396
|
+
}
|
|
7217
7397
|
function Ot(r) {
|
|
7218
7398
|
if (typeof r == "string") {
|
|
7219
7399
|
const i = document.querySelector(r);
|
|
@@ -7223,35 +7403,35 @@ function Ot(r) {
|
|
|
7223
7403
|
} else
|
|
7224
7404
|
return r || document.documentElement;
|
|
7225
7405
|
}
|
|
7226
|
-
function
|
|
7406
|
+
function Je(r) {
|
|
7227
7407
|
const i = Ot(r);
|
|
7228
7408
|
return i ? i.requestFullscreen ? i.requestFullscreen() : i.mozRequestFullScreen ? i.mozRequestFullScreen() : i.webkitRequestFullscreen ? i.webkitRequestFullscreen() : i.msRequestFullscreen ? i.msRequestFullscreen() : Promise.reject("No Fullscreen API") : Promise.reject("No Element");
|
|
7229
7409
|
}
|
|
7230
|
-
function
|
|
7410
|
+
function ti() {
|
|
7231
7411
|
const r = document;
|
|
7232
7412
|
return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
7233
7413
|
}
|
|
7234
|
-
function
|
|
7414
|
+
function jt(r) {
|
|
7235
7415
|
const i = Ot(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
7236
7416
|
return i == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
7237
7417
|
}
|
|
7238
|
-
function
|
|
7418
|
+
function Dn(r) {
|
|
7239
7419
|
if (r = Ot(r), !!r)
|
|
7240
7420
|
return function() {
|
|
7241
|
-
|
|
7421
|
+
jt(r) ? ti() : Je(r);
|
|
7242
7422
|
};
|
|
7243
7423
|
}
|
|
7244
|
-
function
|
|
7424
|
+
function kn(r, i) {
|
|
7245
7425
|
const t = Ot(i);
|
|
7246
7426
|
if (!t) return;
|
|
7247
7427
|
const e = () => {
|
|
7248
|
-
r(
|
|
7428
|
+
r(jt(t));
|
|
7249
7429
|
};
|
|
7250
7430
|
return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
|
|
7251
7431
|
document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
|
|
7252
7432
|
};
|
|
7253
7433
|
}
|
|
7254
|
-
class
|
|
7434
|
+
class Rn {
|
|
7255
7435
|
constructor(i, t) {
|
|
7256
7436
|
/** 要全屏展示的目标元素 */
|
|
7257
7437
|
d(this, "targetElement");
|
|
@@ -7271,19 +7451,19 @@ class xn {
|
|
|
7271
7451
|
}
|
|
7272
7452
|
/** 使目标元素进入浏览器全屏 */
|
|
7273
7453
|
enter() {
|
|
7274
|
-
this.targetElement &&
|
|
7454
|
+
this.targetElement && Je(this.targetElement);
|
|
7275
7455
|
}
|
|
7276
7456
|
/** 退出浏览器全屏(不区分由哪个元素进入) */
|
|
7277
7457
|
exit() {
|
|
7278
|
-
this.targetElement &&
|
|
7458
|
+
this.targetElement && ti();
|
|
7279
7459
|
}
|
|
7280
7460
|
/** 若当前已为该目标全屏则退出,否则进入全屏 */
|
|
7281
7461
|
toggle() {
|
|
7282
|
-
this.targetElement && (
|
|
7462
|
+
this.targetElement && (jt(this.targetElement) ? this.exit() : this.enter());
|
|
7283
7463
|
}
|
|
7284
7464
|
attachFullscreenChangeListeners() {
|
|
7285
7465
|
const i = () => {
|
|
7286
|
-
!this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(
|
|
7466
|
+
!this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(jt(this.targetElement));
|
|
7287
7467
|
};
|
|
7288
7468
|
document.addEventListener("fullscreenchange", i), document.addEventListener(
|
|
7289
7469
|
"webkitfullscreenchange",
|
|
@@ -7313,8 +7493,8 @@ class xn {
|
|
|
7313
7493
|
(i = this.detachFullscreenListeners) == null || i.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
|
|
7314
7494
|
}
|
|
7315
7495
|
}
|
|
7316
|
-
function
|
|
7317
|
-
const i =
|
|
7496
|
+
function An(r) {
|
|
7497
|
+
const i = Fe(r, 100);
|
|
7318
7498
|
let t = 0, e = 0;
|
|
7319
7499
|
return function(s) {
|
|
7320
7500
|
const n = s.target;
|
|
@@ -7342,7 +7522,7 @@ function bn(r) {
|
|
|
7342
7522
|
f(), m();
|
|
7343
7523
|
};
|
|
7344
7524
|
}
|
|
7345
|
-
function
|
|
7525
|
+
function Vn(r, i, t) {
|
|
7346
7526
|
const { isClickAllowed: e, uiLibrary: s = ["naiveUI", "ElementPlus", "Element"] } = t || {}, n = function(l) {
|
|
7347
7527
|
const c = [];
|
|
7348
7528
|
for (const h in l)
|
|
@@ -7374,21 +7554,21 @@ function Pn(r, i, t) {
|
|
|
7374
7554
|
() => document.addEventListener("mousedown", a)
|
|
7375
7555
|
);
|
|
7376
7556
|
}
|
|
7377
|
-
var j,
|
|
7378
|
-
class
|
|
7557
|
+
var j, ft, mt, bt, Pt, Q, J, it, Ct;
|
|
7558
|
+
class On {
|
|
7379
7559
|
constructor() {
|
|
7380
7560
|
L(this, j);
|
|
7381
|
-
L(this,
|
|
7382
|
-
L(this,
|
|
7383
|
-
L(this, xt, 0);
|
|
7561
|
+
L(this, ft, !1);
|
|
7562
|
+
L(this, mt, {});
|
|
7384
7563
|
L(this, bt, 0);
|
|
7564
|
+
L(this, Pt, 0);
|
|
7385
7565
|
L(this, Q, 0);
|
|
7386
7566
|
L(this, J, 0);
|
|
7387
7567
|
L(this, it);
|
|
7388
|
-
L(this,
|
|
7568
|
+
L(this, Ct);
|
|
7389
7569
|
}
|
|
7390
7570
|
init(i, t) {
|
|
7391
|
-
this.finish(), M(this, j, i), M(this, it, t == null ? void 0 : t.limit), M(this,
|
|
7571
|
+
this.finish(), M(this, j, i), M(this, it, t == null ? void 0 : t.limit), M(this, Ct, t == null ? void 0 : t.dragDom), M(this, mt, {
|
|
7392
7572
|
mousedown: this.mousedown.bind(this),
|
|
7393
7573
|
mousemove: this.mousemove.bind(this),
|
|
7394
7574
|
mouseup: this.mouseup.bind(this)
|
|
@@ -7400,7 +7580,7 @@ class Cn {
|
|
|
7400
7580
|
bindOrUnbindEvent(i) {
|
|
7401
7581
|
const t = i === "bind" ? "addEventListener" : "removeEventListener";
|
|
7402
7582
|
if (!x(this, j)) return console.error("No DOM");
|
|
7403
|
-
x(this, j)[t]("mousedown", x(this,
|
|
7583
|
+
x(this, j)[t]("mousedown", x(this, mt).mousedown), document[t]("mousemove", x(this, mt).mousemove), document[t]("mouseup", x(this, mt).mouseup);
|
|
7404
7584
|
}
|
|
7405
7585
|
alterLocation() {
|
|
7406
7586
|
if (!x(this, j)) return console.error("No DOM");
|
|
@@ -7408,36 +7588,36 @@ class Cn {
|
|
|
7408
7588
|
}
|
|
7409
7589
|
mousedown(i) {
|
|
7410
7590
|
if (!x(this, j)) return console.error("No DOM");
|
|
7411
|
-
if (x(this,
|
|
7412
|
-
document.body.classList.add("no-select"), M(this,
|
|
7591
|
+
if (x(this, Ct) && i.target != x(this, Ct)) return;
|
|
7592
|
+
document.body.classList.add("no-select"), M(this, ft, !0);
|
|
7413
7593
|
const t = x(this, j).getBoundingClientRect(), { pageX: e, pageY: s } = i;
|
|
7414
|
-
M(this,
|
|
7594
|
+
M(this, bt, e), M(this, Pt, s), M(this, Q, t.y), M(this, J, t.x);
|
|
7415
7595
|
}
|
|
7416
7596
|
mousemove(i) {
|
|
7417
7597
|
const { pageX: t, pageY: e } = i;
|
|
7418
|
-
x(this,
|
|
7598
|
+
x(this, ft) && (M(this, Q, x(this, Q) + (e - x(this, Pt))), M(this, J, x(this, J) + (t - x(this, bt))), M(this, bt, t), M(this, Pt, e), this.alterLocation());
|
|
7419
7599
|
}
|
|
7420
7600
|
mouseup() {
|
|
7421
|
-
x(this,
|
|
7601
|
+
x(this, ft) && (M(this, ft, !1), document.body.classList.remove("no-select"));
|
|
7422
7602
|
}
|
|
7423
7603
|
}
|
|
7424
|
-
j = new WeakMap(),
|
|
7425
|
-
var W,
|
|
7426
|
-
class
|
|
7604
|
+
j = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), bt = new WeakMap(), Pt = new WeakMap(), Q = new WeakMap(), J = new WeakMap(), it = new WeakMap(), Ct = new WeakMap();
|
|
7605
|
+
var W, pt, gt, St, Et, q, K, B, _t, Mt;
|
|
7606
|
+
class Ln {
|
|
7427
7607
|
constructor() {
|
|
7428
7608
|
L(this, W);
|
|
7429
|
-
L(this,
|
|
7430
|
-
L(this,
|
|
7431
|
-
L(this, Ct, 0);
|
|
7609
|
+
L(this, pt, !1);
|
|
7610
|
+
L(this, gt, {});
|
|
7432
7611
|
L(this, St, 0);
|
|
7612
|
+
L(this, Et, 0);
|
|
7433
7613
|
L(this, q, 0);
|
|
7434
7614
|
L(this, K, 0);
|
|
7435
7615
|
L(this, B);
|
|
7436
7616
|
L(this, _t);
|
|
7437
|
-
L(this,
|
|
7617
|
+
L(this, Mt);
|
|
7438
7618
|
}
|
|
7439
7619
|
init(i, t = {}) {
|
|
7440
|
-
this.finish(), M(this, W, i), M(this, B, t.limit), M(this, _t, t.update_move), M(this,
|
|
7620
|
+
this.finish(), M(this, W, i), M(this, B, t.limit), M(this, _t, t.update_move), M(this, Mt, t.update_up), M(this, gt, {
|
|
7441
7621
|
mousedown: this.mousedown.bind(this),
|
|
7442
7622
|
mousemove: this.mousemove.bind(this),
|
|
7443
7623
|
mouseup: this.mouseup.bind(this)
|
|
@@ -7449,7 +7629,7 @@ class Sn {
|
|
|
7449
7629
|
bindOrUnbindEvent(i) {
|
|
7450
7630
|
const t = i === "bind" ? "addEventListener" : "removeEventListener";
|
|
7451
7631
|
if (!x(this, W)) return console.error("No DOM");
|
|
7452
|
-
x(this, W)[t]("mousedown", x(this,
|
|
7632
|
+
x(this, W)[t]("mousedown", x(this, gt).mousedown), document[t]("mousemove", x(this, gt).mousemove), document[t]("mouseup", x(this, gt).mouseup);
|
|
7453
7633
|
}
|
|
7454
7634
|
updateValue() {
|
|
7455
7635
|
const i = {
|
|
@@ -7472,22 +7652,22 @@ class Sn {
|
|
|
7472
7652
|
}
|
|
7473
7653
|
mousedown(i) {
|
|
7474
7654
|
if (!x(this, W)) return console.error("No DOM");
|
|
7475
|
-
document.body.classList.add("no-select"), M(this,
|
|
7655
|
+
document.body.classList.add("no-select"), M(this, pt, !0);
|
|
7476
7656
|
const t = x(this, W).getBoundingClientRect();
|
|
7477
|
-
M(this,
|
|
7657
|
+
M(this, Et, t.y), M(this, St, t.x);
|
|
7478
7658
|
const { pageX: e, pageY: s } = i;
|
|
7479
|
-
M(this, q, s - x(this,
|
|
7659
|
+
M(this, q, s - x(this, Et)), M(this, K, e - x(this, St)), this.alterLocation();
|
|
7480
7660
|
}
|
|
7481
7661
|
mousemove(i) {
|
|
7482
7662
|
const { pageX: t, pageY: e } = i;
|
|
7483
|
-
x(this,
|
|
7663
|
+
x(this, pt) && (M(this, q, e - x(this, Et)), M(this, K, t - x(this, St)), this.alterLocation());
|
|
7484
7664
|
}
|
|
7485
7665
|
mouseup() {
|
|
7486
|
-
x(this,
|
|
7666
|
+
x(this, pt) && (M(this, pt, !1), document.body.classList.remove("no-select"), x(this, Mt) && x(this, Mt).call(this, this.updateValue()));
|
|
7487
7667
|
}
|
|
7488
7668
|
}
|
|
7489
|
-
W = new WeakMap(),
|
|
7490
|
-
function
|
|
7669
|
+
W = new WeakMap(), pt = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), q = new WeakMap(), K = new WeakMap(), B = new WeakMap(), _t = new WeakMap(), Mt = new WeakMap();
|
|
7670
|
+
function Tn(r, i) {
|
|
7491
7671
|
if (typeof r == "number") return r;
|
|
7492
7672
|
if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
|
|
7493
7673
|
const t = document.createElement("div");
|
|
@@ -7495,7 +7675,7 @@ function _n(r, i) {
|
|
|
7495
7675
|
const e = t.getBoundingClientRect().width;
|
|
7496
7676
|
return i.removeChild(t), e;
|
|
7497
7677
|
}
|
|
7498
|
-
function
|
|
7678
|
+
function In(r, i) {
|
|
7499
7679
|
if (!r) return;
|
|
7500
7680
|
let t, e;
|
|
7501
7681
|
if (typeof i == "string") {
|
|
@@ -7512,7 +7692,7 @@ function En(r, i) {
|
|
|
7512
7692
|
const s = t / e;
|
|
7513
7693
|
return s > r ? [r * e, e] : s < r ? [t, t / r] : [t, e];
|
|
7514
7694
|
}
|
|
7515
|
-
function
|
|
7695
|
+
function Nn(r, i = 5e3) {
|
|
7516
7696
|
return new Promise((t, e) => {
|
|
7517
7697
|
const s = new Image();
|
|
7518
7698
|
s.src = r;
|
|
@@ -7528,7 +7708,7 @@ function Mn(r, i = 5e3) {
|
|
|
7528
7708
|
}, s.crossOrigin = "Anonymous";
|
|
7529
7709
|
});
|
|
7530
7710
|
}
|
|
7531
|
-
function
|
|
7711
|
+
function Hn(r) {
|
|
7532
7712
|
const t = document.getElementById(r).querySelectorAll("img"), e = t.length, s = [];
|
|
7533
7713
|
let n = 0;
|
|
7534
7714
|
return e === 0 ? Promise.resolve({
|
|
@@ -7570,14 +7750,14 @@ function Dn(r) {
|
|
|
7570
7750
|
});
|
|
7571
7751
|
});
|
|
7572
7752
|
}
|
|
7573
|
-
function
|
|
7753
|
+
function Fn(r) {
|
|
7574
7754
|
return new Promise((i, t) => {
|
|
7575
7755
|
fetch(r).then((e) => i(e.text())).catch((e) => {
|
|
7576
7756
|
console.error("Error fetching :", e), t(e);
|
|
7577
7757
|
});
|
|
7578
7758
|
});
|
|
7579
7759
|
}
|
|
7580
|
-
function
|
|
7760
|
+
function zn(r) {
|
|
7581
7761
|
const i = document.createElement("input");
|
|
7582
7762
|
return i.type = "file", i.accept = (r == null ? void 0 : r.accept) || "", i.multiple = (r == null ? void 0 : r.multiple) || !1, new Promise((t, e) => {
|
|
7583
7763
|
i.addEventListener("change", (s) => {
|
|
@@ -7586,7 +7766,7 @@ function Rn(r) {
|
|
|
7586
7766
|
}), i.click();
|
|
7587
7767
|
});
|
|
7588
7768
|
}
|
|
7589
|
-
function
|
|
7769
|
+
function Hs(r) {
|
|
7590
7770
|
const {
|
|
7591
7771
|
href: i,
|
|
7592
7772
|
fileName: t,
|
|
@@ -7595,7 +7775,7 @@ function Ds(r) {
|
|
|
7595
7775
|
autoDownload: n = !0
|
|
7596
7776
|
} = r;
|
|
7597
7777
|
let o, a = !1, l = null, c;
|
|
7598
|
-
const h = t ||
|
|
7778
|
+
const h = t || ne(i, "downloaded_file");
|
|
7599
7779
|
c = decodeURIComponent(h);
|
|
7600
7780
|
const u = () => {
|
|
7601
7781
|
if (!l) return;
|
|
@@ -7625,24 +7805,24 @@ function Ds(r) {
|
|
|
7625
7805
|
!a && l && u();
|
|
7626
7806
|
} };
|
|
7627
7807
|
}
|
|
7628
|
-
function
|
|
7808
|
+
function Bn(r, i, t) {
|
|
7629
7809
|
if (!t) {
|
|
7630
7810
|
let n = i.replace(/^[^.]+./, "");
|
|
7631
7811
|
n = n == i ? "text/plain" : "application/" + n, t = { type: n };
|
|
7632
7812
|
}
|
|
7633
7813
|
const e = new Blob(r, t), s = URL.createObjectURL(e);
|
|
7634
|
-
|
|
7814
|
+
Hs({ href: s, fileName: i });
|
|
7635
7815
|
}
|
|
7636
|
-
const
|
|
7637
|
-
function
|
|
7638
|
-
const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(i,
|
|
7816
|
+
const Fs = Math.PI / 2, Wt = Math.PI / 180, qt = 6378137, zs = 85.05112878;
|
|
7817
|
+
function Un(r, i) {
|
|
7818
|
+
const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(i, zs), -85.05112878), s = t * Wt * qt, n = e * Wt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * qt;
|
|
7639
7819
|
return [s, o];
|
|
7640
7820
|
}
|
|
7641
|
-
function
|
|
7642
|
-
const t = r /
|
|
7821
|
+
function Gn(r, i) {
|
|
7822
|
+
const t = r / qt / Wt, e = (2 * Math.atan(Math.exp(i / qt)) - Fs) / Wt;
|
|
7643
7823
|
return [t, e];
|
|
7644
7824
|
}
|
|
7645
|
-
function
|
|
7825
|
+
function Bs(r, i, t) {
|
|
7646
7826
|
const [e, s] = r, [n, o] = i, [a, l] = t, c = (a - n) ** 2 + (l - o) ** 2;
|
|
7647
7827
|
if (c === 0) return Math.sqrt((e - n) ** 2 + (s - o) ** 2);
|
|
7648
7828
|
let h = ((e - n) * (a - n) + (s - o) * (l - o)) / c;
|
|
@@ -7650,21 +7830,21 @@ function Vs(r, i, t) {
|
|
|
7650
7830
|
(e - (n + h * (a - n))) ** 2 + (s - (o + h * (l - o))) ** 2
|
|
7651
7831
|
);
|
|
7652
7832
|
}
|
|
7653
|
-
function
|
|
7833
|
+
function Xn(r, i, t, e, s, n = 1, o = 1) {
|
|
7654
7834
|
const a = r + t * Math.cos(e) * n, l = i + t * Math.sin(e) * o, c = r + t * Math.cos(s) * n, h = i + t * Math.sin(s) * o;
|
|
7655
7835
|
return [
|
|
7656
7836
|
[a, l],
|
|
7657
7837
|
[c, h]
|
|
7658
7838
|
];
|
|
7659
7839
|
}
|
|
7660
|
-
function
|
|
7840
|
+
function Oe(r, i, t, e) {
|
|
7661
7841
|
return Math.hypot(Math.abs(t - r), Math.abs(e - i));
|
|
7662
7842
|
}
|
|
7663
|
-
function
|
|
7843
|
+
function ei(r, i, t, e) {
|
|
7664
7844
|
const s = (r + t) / 2, n = (i + e) / 2;
|
|
7665
7845
|
return { x: s, y: n };
|
|
7666
7846
|
}
|
|
7667
|
-
function
|
|
7847
|
+
function Yn(r, i, t, e) {
|
|
7668
7848
|
const [s, n] = r, [o, a] = i;
|
|
7669
7849
|
let l = 1 / 0;
|
|
7670
7850
|
if (o !== 0) {
|
|
@@ -7677,7 +7857,7 @@ function Tn(r, i, t, e) {
|
|
|
7677
7857
|
}
|
|
7678
7858
|
return l === 1 / 0 ? r : [s + o * l, n + a * l];
|
|
7679
7859
|
}
|
|
7680
|
-
const
|
|
7860
|
+
const Us = /* @__PURE__ */ new Set([
|
|
7681
7861
|
"sin",
|
|
7682
7862
|
"cos",
|
|
7683
7863
|
"tan",
|
|
@@ -7685,9 +7865,9 @@ const Os = /* @__PURE__ */ new Set([
|
|
|
7685
7865
|
"acos",
|
|
7686
7866
|
"atan",
|
|
7687
7867
|
"atan2"
|
|
7688
|
-
]),
|
|
7868
|
+
]), $n = new Proxy(Math, {
|
|
7689
7869
|
get(r, i) {
|
|
7690
|
-
return
|
|
7870
|
+
return Us.has(i) ? function(...t) {
|
|
7691
7871
|
const e = t.map((s) => s / 180 * Math.PI);
|
|
7692
7872
|
return r[i](...e);
|
|
7693
7873
|
} : r[i];
|
|
@@ -7701,28 +7881,29 @@ const Os = /* @__PURE__ */ new Set([
|
|
|
7701
7881
|
throw new Error("DegreeMath 是只读的,不能删除属性");
|
|
7702
7882
|
}
|
|
7703
7883
|
});
|
|
7704
|
-
function
|
|
7884
|
+
function jn(r, i) {
|
|
7705
7885
|
const t = r.length;
|
|
7706
|
-
if (t === 0) return [0, 0];
|
|
7707
|
-
if (t === 1) return [r[0][0], r[0][1]];
|
|
7886
|
+
if (t === 0) return [0, 0, 0];
|
|
7887
|
+
if (t === 1) return [r[0][0], r[0][1], 0];
|
|
7708
7888
|
const e = i;
|
|
7709
|
-
let s = r.map((
|
|
7710
|
-
for (; s.length >
|
|
7711
|
-
const
|
|
7712
|
-
for (let
|
|
7713
|
-
|
|
7714
|
-
(1 - e) * s[
|
|
7715
|
-
(1 - e) * s[
|
|
7889
|
+
let s = r.map((f) => [f[0], f[1]]);
|
|
7890
|
+
for (; s.length > 2; ) {
|
|
7891
|
+
const f = [];
|
|
7892
|
+
for (let m = 0; m < s.length - 1; m++)
|
|
7893
|
+
f.push([
|
|
7894
|
+
(1 - e) * s[m][0] + e * s[m + 1][0],
|
|
7895
|
+
(1 - e) * s[m][1] + e * s[m + 1][1]
|
|
7716
7896
|
]);
|
|
7717
|
-
s =
|
|
7897
|
+
s = f;
|
|
7718
7898
|
}
|
|
7719
|
-
|
|
7899
|
+
const n = s[0], o = s[1], a = (1 - e) * n[0] + e * o[0], l = (1 - e) * n[1] + e * o[1], c = o[0] - n[0], h = o[1] - n[1], u = Math.atan2(h, c);
|
|
7900
|
+
return [a, l, u];
|
|
7720
7901
|
}
|
|
7721
|
-
function
|
|
7902
|
+
function Wn(r, i, t) {
|
|
7722
7903
|
const e = Math.abs(r) || 1, s = i * Math.PI * 2, n = e * Math.cos(s), o = Math.sin(s);
|
|
7723
7904
|
return t ? [(n + e) / (2 * e), (o + 1) / 2] : [n, o];
|
|
7724
7905
|
}
|
|
7725
|
-
class
|
|
7906
|
+
class xt {
|
|
7726
7907
|
constructor(i, t) {
|
|
7727
7908
|
d(this, "resolve");
|
|
7728
7909
|
d(this, "reject");
|
|
@@ -7739,42 +7920,42 @@ class wt {
|
|
|
7739
7920
|
}) : i ? (t = this.resolve) == null || t.call(this) : (e = this.reject) == null || e.call(this), i;
|
|
7740
7921
|
}
|
|
7741
7922
|
}
|
|
7742
|
-
class
|
|
7923
|
+
class Gs extends xt {
|
|
7743
7924
|
constructor(i) {
|
|
7744
7925
|
super(), this.resolve = i;
|
|
7745
7926
|
}
|
|
7746
7927
|
warning(...i) {
|
|
7747
7928
|
const t = () => {
|
|
7748
7929
|
var e, s;
|
|
7749
|
-
return (s = (e =
|
|
7930
|
+
return (s = (e = kt.tips).warning) == null ? void 0 : s.call(e, ...i);
|
|
7750
7931
|
};
|
|
7751
|
-
return new
|
|
7932
|
+
return new xt(this.resolve, t);
|
|
7752
7933
|
}
|
|
7753
7934
|
error(...i) {
|
|
7754
7935
|
const t = () => {
|
|
7755
7936
|
var e, s;
|
|
7756
|
-
return (s = (e =
|
|
7937
|
+
return (s = (e = kt.tips).error) == null ? void 0 : s.call(e, ...i);
|
|
7757
7938
|
};
|
|
7758
|
-
return new
|
|
7939
|
+
return new xt(this.resolve, t);
|
|
7759
7940
|
}
|
|
7760
7941
|
}
|
|
7761
|
-
class
|
|
7942
|
+
class Xs extends xt {
|
|
7762
7943
|
constructor(i) {
|
|
7763
7944
|
super(), this.reject = i;
|
|
7764
7945
|
}
|
|
7765
7946
|
info(...i) {
|
|
7766
7947
|
const t = () => {
|
|
7767
7948
|
var e, s;
|
|
7768
|
-
return (s = (e =
|
|
7949
|
+
return (s = (e = kt.tips).info) == null ? void 0 : s.call(e, ...i);
|
|
7769
7950
|
};
|
|
7770
|
-
return new
|
|
7951
|
+
return new xt(t, this.reject);
|
|
7771
7952
|
}
|
|
7772
7953
|
success(...i) {
|
|
7773
7954
|
const t = () => {
|
|
7774
7955
|
var e, s;
|
|
7775
|
-
return (s = (e =
|
|
7956
|
+
return (s = (e = kt.tips).success) == null ? void 0 : s.call(e, ...i);
|
|
7776
7957
|
};
|
|
7777
|
-
return new
|
|
7958
|
+
return new xt(t, this.reject);
|
|
7778
7959
|
}
|
|
7779
7960
|
}
|
|
7780
7961
|
const z = class z {
|
|
@@ -7791,7 +7972,7 @@ const z = class z {
|
|
|
7791
7972
|
var s, n;
|
|
7792
7973
|
return (n = (s = z.tips)[i]) == null ? void 0 : n.call(s, ...t);
|
|
7793
7974
|
};
|
|
7794
|
-
return new
|
|
7975
|
+
return new Gs(e);
|
|
7795
7976
|
};
|
|
7796
7977
|
}
|
|
7797
7978
|
static rejectTip(i) {
|
|
@@ -7800,7 +7981,7 @@ const z = class z {
|
|
|
7800
7981
|
var s, n;
|
|
7801
7982
|
return (n = (s = z.tips)[i]) == null ? void 0 : n.call(s, ...t);
|
|
7802
7983
|
};
|
|
7803
|
-
return new
|
|
7984
|
+
return new Xs(e);
|
|
7804
7985
|
};
|
|
7805
7986
|
}
|
|
7806
7987
|
};
|
|
@@ -7810,91 +7991,92 @@ d(z, "tips", {
|
|
|
7810
7991
|
warning: void 0,
|
|
7811
7992
|
error: void 0
|
|
7812
7993
|
}), d(z, "info", z.resolveTip("info")), d(z, "success", z.resolveTip("success")), d(z, "warning", z.rejectTip("warning")), d(z, "error", z.rejectTip("error"));
|
|
7813
|
-
let
|
|
7994
|
+
let kt = z;
|
|
7814
7995
|
export {
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7996
|
+
ni as EXTENSION_TO_MIME,
|
|
7997
|
+
te as FILE_EXTENSIONS,
|
|
7998
|
+
Le as PAPER_SIZE_DEFINITIONS,
|
|
7999
|
+
js as PAPER_SIZE_OPTIONS,
|
|
8000
|
+
Ce as UNIT_LABELS,
|
|
8001
|
+
$s as WINDOW_TARGET,
|
|
8002
|
+
Ws as _Animate_CreateOscillator,
|
|
8003
|
+
qs as _Animate_CubicBezier,
|
|
8004
|
+
ri as _Animate_NumericTransition,
|
|
8005
|
+
Ut as _Animate_Schedule,
|
|
8006
|
+
Ks as _Blob_ConvertDataToImageUrl,
|
|
8007
|
+
Cn as _Browser_CalculatePrintableArea,
|
|
8008
|
+
Pn as _Browser_CopyToClipboard,
|
|
8009
|
+
bn as _Browser_GetFrameRate,
|
|
8010
|
+
Sn as _Browser_IdleDetection,
|
|
8011
|
+
Ht as _Browser_SameOriginTabManager,
|
|
8012
|
+
wn as _Browser_SoundEffects,
|
|
8013
|
+
xn as _Browser_WebSocketClient,
|
|
7833
8014
|
T as _Canvas_Axis,
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
8015
|
+
_n as _Canvas_TimeAxis,
|
|
8016
|
+
In as _Element_CalculateCanvasSize,
|
|
8017
|
+
Hn as _Element_CheckImagesLoaded,
|
|
8018
|
+
Vn as _Element_CloseOnOutsideClick,
|
|
8019
|
+
On as _Element_Drag,
|
|
8020
|
+
Mn as _Element_DropZoneManager,
|
|
8021
|
+
Je as _Element_EnterFullscreen,
|
|
8022
|
+
ti as _Element_ExitFullscreen,
|
|
8023
|
+
Dn as _Element_Fullscreen,
|
|
8024
|
+
Rn as _Element_FullscreenController,
|
|
8025
|
+
kn as _Element_FullscreenObserver,
|
|
8026
|
+
Tn as _Element_GetOtherSizeInPixels,
|
|
8027
|
+
jt as _Element_IsFullscreen,
|
|
8028
|
+
Nn as _Element_LoadImage,
|
|
8029
|
+
Ln as _Element_LocalDrag,
|
|
8030
|
+
An as _Element_ScrollEndListener,
|
|
8031
|
+
Bn as _File_CreateAndDownload,
|
|
8032
|
+
Hs as _File_Download,
|
|
8033
|
+
Fn as _File_Read,
|
|
8034
|
+
zn as _File_Select,
|
|
8035
|
+
en as _Format_CamelCase,
|
|
8036
|
+
Zs as _Format_CapitalizeFirstLetter,
|
|
8037
|
+
on as _Format_ChunkArray,
|
|
8038
|
+
sn as _Format_ExcludeSubstring,
|
|
8039
|
+
tn as _Format_FileSize,
|
|
8040
|
+
ne as _Format_HrefName,
|
|
8041
|
+
rn as _Format_MillisecondToReadable,
|
|
8042
|
+
se as _Format_NumberWithCommas,
|
|
8043
|
+
Js as _Format_NumberWithUnit,
|
|
8044
|
+
Qs as _Format_Percentage,
|
|
8045
|
+
oi as _Format_Timestamp,
|
|
8046
|
+
nn as _Format_ToggleInvisibleChars,
|
|
8047
|
+
Oe as _Math_CalculateDistance2D,
|
|
8048
|
+
$n as _Math_Degree,
|
|
8049
|
+
Xn as _Math_GetArcPoints,
|
|
8050
|
+
jn as _Math_GetBezierCurveNodes,
|
|
8051
|
+
Yn as _Math_GetBoundaryIntersection,
|
|
8052
|
+
Wn as _Math_GetEllipsePoints,
|
|
8053
|
+
ei as _Math_GetMidpoint,
|
|
8054
|
+
Un as _Math_LngLatToPlane,
|
|
8055
|
+
Gn as _Math_PlaneToLngLat,
|
|
8056
|
+
Bs as _Math_PointToLineDistance,
|
|
8057
|
+
kt as _Tip,
|
|
8058
|
+
hi as _Utility_Clone,
|
|
8059
|
+
di as _Utility_ColorConverter,
|
|
8060
|
+
Fe as _Utility_Debounce,
|
|
8061
|
+
fn as _Utility_ExecuteWhenIdle,
|
|
8062
|
+
oe as _Utility_GenerateUUID,
|
|
8063
|
+
pn as _Utility_GetTargetByPath,
|
|
8064
|
+
ct as _Utility_MergeObjects,
|
|
8065
|
+
vn as _Utility_RotateList,
|
|
8066
|
+
gn as _Utility_SetTargetByPath,
|
|
8067
|
+
Ee as _Utility_ShortcutManager,
|
|
8068
|
+
yn as _Utility_Sleep,
|
|
8069
|
+
mn as _Utility_Throttle,
|
|
8070
|
+
ui as _Utility_TimeConsumption,
|
|
8071
|
+
dn as _Utility_UndoRedoHistory,
|
|
8072
|
+
ci as _Utility_WaitForCondition,
|
|
8073
|
+
un as _Valid_CheckConnectionWithXHR,
|
|
8074
|
+
re as _Valid_DataType,
|
|
8075
|
+
cn as _Valid_DoesInfiniteLineIntersectRectangle,
|
|
8076
|
+
Se as _Valid_FileTypeChecker,
|
|
8077
|
+
Gt as _Valid_Is2DNumberArray,
|
|
8078
|
+
an as _Valid_IsInMargin,
|
|
8079
|
+
we as _Valid_IsNumberArray,
|
|
8080
|
+
ln as _Valid_IsPointInPolygon,
|
|
8081
|
+
hn as _Valid_IsSecureContext
|
|
7900
8082
|
};
|