nhanh-pure-function 4.0.0 → 4.2.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/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 Ye = Object.defineProperty;
3
- var pe = (r) => {
2
+ var Ze = Object.defineProperty;
3
+ var we = (r) => {
4
4
  throw TypeError(r);
5
5
  };
6
- var je = (r, s, t) => s in r ? Ye(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
7
- var d = (r, s, t) => je(r, typeof s != "symbol" ? s + "" : s, t), ve = (r, s, t) => s.has(r) || pe("Cannot " + t);
8
- var x = (r, s, t) => (ve(r, s, "read from private field"), t ? t.call(r) : s.get(r)), N = (r, s, t) => s.has(r) ? pe("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), E = (r, s, t, e) => (ve(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
9
- const We = {
6
+ var Qe = (r, s, t) => s in r ? Ze(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
7
+ var d = (r, s, t) => Qe(r, typeof s != "symbol" ? s + "" : s, t), xe = (r, s, t) => s.has(r) || we("Cannot " + t);
8
+ var x = (r, s, t) => (xe(r, s, "read from private field"), t ? t.call(r) : s.get(r)), L = (r, s, t) => s.has(r) ? we("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), M = (r, s, t, e) => (xe(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
9
+ const Je = {
10
10
  ".mp3": "audio/mpeg",
11
11
  ".mp4": "video/mp4",
12
12
  ".m4a": "audio/mp4",
@@ -68,7 +68,7 @@ const We = {
68
68
  ".otf": "font/otf",
69
69
  ".eot": "application/vnd.ms-fontobject",
70
70
  ".map": "application/json"
71
- }, ee = {
71
+ }, re = {
72
72
  image: [
73
73
  ".jpg",
74
74
  ".jpeg",
@@ -248,7 +248,7 @@ const We = {
248
248
  ".awk",
249
249
  ".php"
250
250
  ]
251
- }, ye = [
251
+ }, Pe = [
252
252
  "",
253
253
  "万",
254
254
  "亿",
@@ -262,7 +262,7 @@ const We = {
262
262
  "正",
263
263
  "载",
264
264
  "极"
265
- ], Rs = ["_self", "_blank", "_parent", "_top"], _e = {
265
+ ], Ls = ["_self", "_blank", "_parent", "_top"], Re = {
266
266
  // 北美标准尺寸 (毫米)
267
267
  Letter: { width: 215.9, height: 279.4 },
268
268
  // 8.5 × 11 英寸
@@ -315,10 +315,10 @@ const We = {
315
315
  C6: { width: 114, height: 162 },
316
316
  C7: { width: 81, height: 114 },
317
317
  C8: { width: 57, height: 81 }
318
- }, ks = Object.keys(_e).map(
318
+ }, Ts = Object.keys(Re).map(
319
319
  (r) => ({ value: r, label: r })
320
320
  );
321
- function Ut(r, s = 500) {
321
+ function Wt(r, s = 500) {
322
322
  let t, e = !0;
323
323
  function i(n) {
324
324
  if (!e) return;
@@ -328,26 +328,26 @@ function Ut(r, s = 500) {
328
328
  }
329
329
  return requestAnimationFrame(i), () => e = !1;
330
330
  }
331
- function Os(r, s, t, e, i = 2) {
331
+ function Is(r, s, t, e, i = 2) {
332
332
  let n = r, o = !1, a = 1, l = r, c = s, h = t;
333
333
  const u = () => {
334
- const b = (c - l) / h;
335
- return Number(b.toFixed(i));
334
+ const P = (c - l) / h;
335
+ return Number(P.toFixed(i));
336
336
  };
337
337
  let f = u();
338
- const m = (b) => Math.min(Math.max(b, l), c), p = (b) => Number(b.toFixed(i)), g = (b, C, M) => {
338
+ const m = (P) => Math.min(Math.max(P, l), c), p = (P) => Number(P.toFixed(i)), g = (P, b, _) => {
339
339
  const A = [];
340
- return b >= C && A.push("最小值必须小于最大值"), M <= 0 ? A.push("分段数必须为正数") : u() == 0 && A.push("数值精度过低,致使动画步长为 0"), A;
341
- }, y = (b, C, M) => {
342
- const A = g(b, C, M);
343
- return A.length > 0 ? (console.error(`参数更新失败: ${A.join("; ")}`), !1) : (l = b, c = C, h = M, f = u(), n = m(n), !0);
340
+ return P >= b && A.push("最小值必须小于最大值"), _ <= 0 ? A.push("分段数必须为正数") : u() == 0 && A.push("数值精度过低,致使动画步长为 0"), A;
341
+ }, y = (P, b, _) => {
342
+ const A = g(P, b, _);
343
+ return A.length > 0 ? (console.error(`参数更新失败: ${A.join("; ")}`), !1) : (l = P, c = b, h = _, f = u(), n = m(n), !0);
344
344
  }, w = () => {
345
345
  o && (a = n >= c ? -1 : n <= l ? 1 : a, n = m(n + f * a), e(p(n)), requestAnimationFrame(w));
346
346
  };
347
347
  return {
348
348
  /** 启动/继续动画 */
349
- play(b = n) {
350
- if (n = m(b), g(l, c, h).length)
349
+ play(P = n) {
350
+ if (n = m(P), g(l, c, h).length)
351
351
  return console.error("配置参数错误", this.getParams());
352
352
  o || (o = !0, w());
353
353
  },
@@ -365,7 +365,7 @@ function Os(r, s, t, e, i = 2) {
365
365
  getParams: () => ({ min: l, max: c, steps: h, precision: i, stepSize: f })
366
366
  };
367
367
  }
368
- function qe(r, s, t, e, i = 2) {
368
+ function Ke(r, s, t, e, i = 4) {
369
369
  if (t <= 0) return console.error("动画步数 必须为正数");
370
370
  const n = (u) => Number(u.toFixed(i)), o = s - r, a = n(Math.abs(o) / t);
371
371
  if (a === 0) return console.error("数值精度过低,致使动画步长为 0");
@@ -376,7 +376,35 @@ function qe(r, s, t, e, i = 2) {
376
376
  };
377
377
  h();
378
378
  }
379
- function As(r, s = "image/png") {
379
+ function Ns(r, s, t, e) {
380
+ const i = (l) => 3 * (1 - l) ** 2 * l * r + 3 * (1 - l) * l ** 2 * t + l ** 3, n = (l) => 3 * (1 - l) ** 2 * l * s + 3 * (1 - l) * l ** 2 * e + l ** 3, o = (l) => 3 * r * (1 - l) * (1 - 3 * l) + 3 * t * (2 * l - 3 * l ** 2) + 3 * l ** 2, a = (l) => {
381
+ if (l <= 0) return 0;
382
+ if (l >= 1) return 1;
383
+ let c = l;
384
+ for (let f = 0; f < 8; f++) {
385
+ const m = i(c) - l;
386
+ if (Math.abs(m) < 1e-6) return c;
387
+ const p = o(c);
388
+ if (Math.abs(p) < 1e-6) break;
389
+ const g = c - m / p;
390
+ if (g < 0 || g > 1) break;
391
+ c = g;
392
+ }
393
+ let h = 0, u = 1;
394
+ c = l;
395
+ for (let f = 0; f < 24; f++) {
396
+ const m = i(c) - l;
397
+ if (Math.abs(m) < 1e-6) return c;
398
+ m > 0 ? u = c : h = c, c = (h + u) / 2;
399
+ }
400
+ return c;
401
+ };
402
+ return (l) => {
403
+ const c = Math.min(1, Math.max(0, l));
404
+ return n(a(c));
405
+ };
406
+ }
407
+ function Hs(r, s = "image/png") {
380
408
  try {
381
409
  let t, e = s;
382
410
  if (r instanceof File)
@@ -413,17 +441,17 @@ function As(r, s = "image/png") {
413
441
  ), null;
414
442
  }
415
443
  }
416
- function Ns(r) {
444
+ function Fs(r) {
417
445
  return r.charAt(0).toUpperCase() + r.slice(1);
418
446
  }
419
- function Is(r, s, t = 2) {
447
+ function Bs(r, s, t = 2) {
420
448
  return !Number.isFinite(r) || !Number.isFinite(s) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : s === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (r / s * 100).toFixed(t) + "%";
421
449
  }
422
- function se(r) {
450
+ function le(r) {
423
451
  const t = r.toString().split("."), e = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
424
452
  return t.length > 1 ? e + "." + t[1] : e;
425
453
  }
426
- function Ls(r, s) {
454
+ function Gs(r, s) {
427
455
  const t = {
428
456
  join: !0,
429
457
  suffix: "",
@@ -434,16 +462,16 @@ function Ls(r, s) {
434
462
  }, o = Number(r);
435
463
  if (isNaN(o)) return e ? `0${i}` : [0, i];
436
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)));
437
- return e ? `${f}${ye[c]}${i}` : [f, ye[c] + i];
465
+ return e ? `${f}${Pe[c]}${i}` : [f, Pe[c] + i];
438
466
  }
439
- function Ts(r) {
467
+ function Us(r) {
440
468
  const s = ["B", "KB", "MB", "GB", "TB", "PB"];
441
469
  let t = 0;
442
470
  for (; r > 1024; )
443
471
  r /= 1024, t++;
444
472
  return `${Math.round(r * 100) / 100} ${s[t]}`;
445
473
  }
446
- function $e(r, s = "YYYY-MM-DD hh:mm:ss", t = !0) {
474
+ function ti(r, s = "YYYY-MM-DD hh:mm:ss", t = !0) {
447
475
  const e = new Date(r);
448
476
  if (isNaN(e.getTime()))
449
477
  return console.error("Invalid date"), "";
@@ -462,15 +490,15 @@ function $e(r, s = "YYYY-MM-DD hh:mm:ss", t = !0) {
462
490
  return t ? String(o).padStart(2, "0") : String(o);
463
491
  });
464
492
  }
465
- function ne(r, s = "file") {
493
+ function ce(r, s = "file") {
466
494
  if (!r || (r = String(r).trim(), r === "")) return s;
467
495
  const t = r.split("/");
468
496
  return t[t.length - 1].split("?")[0];
469
497
  }
470
- function Hs(r, s) {
498
+ function Xs(r, s) {
471
499
  return r = r.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), s ? r.replace(/[^a-zA-Z]+/g, "") : r;
472
500
  }
473
- function Fs(r, s, t = ",") {
501
+ function zs(r, s, t = ",") {
474
502
  const e = new RegExp(
475
503
  `(^|${t})${s}(${t}|$)`,
476
504
  "g"
@@ -479,7 +507,7 @@ function Fs(r, s, t = ",") {
479
507
  return n === o ? t : "";
480
508
  });
481
509
  }
482
- function Bs(r, s = !0) {
510
+ function Ys(r, s = !0) {
483
511
  const t = {
484
512
  "\b": "\\b",
485
513
  " ": "\\t",
@@ -496,7 +524,7 @@ function Bs(r, s = !0) {
496
524
  (i) => t[i]
497
525
  ) : r.replace(/\\[btnvfrs]/g, (i) => e[i] || i);
498
526
  }
499
- const Nt = [
527
+ const It = [
500
528
  ["年", 365 * 24 * 60 * 60 * 1e3],
501
529
  ["月", 30 * 24 * 60 * 60 * 1e3],
502
530
  ["周", 7 * 24 * 60 * 60 * 1e3],
@@ -506,21 +534,21 @@ const Nt = [
506
534
  ["秒", 1e3],
507
535
  ["毫秒", 1]
508
536
  ];
509
- function Xs(r, s) {
537
+ function js(r, s) {
510
538
  if (!Number.isFinite(r) || r < 0) return "0毫秒";
511
539
  r = Math.round(r);
512
- const t = s ? Nt.findIndex(([i]) => i === s) : 0, e = t === -1 ? 0 : t;
513
- for (let i = e; i < Nt.length; i++) {
514
- const [n, o] = Nt[i];
540
+ const t = s ? It.findIndex(([i]) => i === s) : 0, e = t === -1 ? 0 : t;
541
+ for (let i = e; i < It.length; i++) {
542
+ const [n, o] = It[i];
515
543
  if (r >= o) {
516
544
  const a = o === 1 ? r : Math.round(r / o * 10) / 10;
517
545
  let l = Number.isInteger(a) ? a : a.toFixed(1).replace(/\.0$/, "");
518
- return n === Nt[e][0] && (l = se(Number(l))), `${l}${n}`;
546
+ return n === It[e][0] && (l = le(Number(l))), `${l}${n}`;
519
547
  }
520
548
  }
521
549
  return "0毫秒";
522
550
  }
523
- function Gs(r, s) {
551
+ function Ws(r, s) {
524
552
  if (s < 1)
525
553
  return console.error("分割大小必须大于0"), [];
526
554
  const t = [];
@@ -530,24 +558,24 @@ function Gs(r, s) {
530
558
  }
531
559
  return t;
532
560
  }
533
- function me(r, s = 2) {
561
+ function ve(r, s = 2) {
534
562
  if (Array.isArray(r) && r.length >= s) {
535
563
  for (let e = 0; e < r.length; e++)
536
564
  if (typeof r[e] != "number" || !Number.isFinite(r[e])) return !1;
537
565
  } else return !1;
538
566
  return !0;
539
567
  }
540
- function zt(r, s = 1, t = 2) {
568
+ function qt(r, s = 1, t = 2) {
541
569
  if (Array.isArray(r) && r.length >= s) {
542
570
  for (let i = 0; i < r.length; i++)
543
- if (!me(r[i], t)) return !1;
571
+ if (!ve(r[i], t)) return !1;
544
572
  } else return !1;
545
573
  return !0;
546
574
  }
547
- function Us(r, s, t) {
575
+ function qs(r, s, t) {
548
576
  return Math.abs(r - s) <= t;
549
577
  }
550
- function zs(r, s) {
578
+ function $s(r, s) {
551
579
  let t = !1;
552
580
  const { x: e, y: i } = r, n = s.length;
553
581
  for (let o = 0, a = n - 1; o < n; a = o++) {
@@ -556,7 +584,7 @@ function zs(r, s) {
556
584
  }
557
585
  return t;
558
586
  }
559
- function Ys(r, s, t, e) {
587
+ function Zs(r, s, t, e) {
560
588
  const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
561
589
  [i, o],
562
590
  // 左上
@@ -580,10 +608,10 @@ function Ys(r, s, t, e) {
580
608
  }
581
609
  return m && p;
582
610
  }
583
- function re(r) {
611
+ function he(r) {
584
612
  return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
585
613
  }
586
- function js(r) {
614
+ function Qs(r) {
587
615
  return [
588
616
  "https:",
589
617
  // HTTPS协议,用于安全地浏览网页
@@ -607,7 +635,7 @@ function js(r) {
607
635
  // VPN协议,用于创建安全的网络连接
608
636
  ].some((t) => r.startsWith(t));
609
637
  }
610
- function Ws(r) {
638
+ function Js(r) {
611
639
  return new Promise((s, t) => {
612
640
  if (typeof r != "string" || r.trim() === "" || !r.includes("://")) {
613
641
  t(new Error("Invalid URL: Must be a non-empty string"));
@@ -634,22 +662,22 @@ function Ws(r) {
634
662
  }
635
663
  });
636
664
  }
637
- const tt = class tt {
665
+ const it = class it {
638
666
  constructor() {
639
- if (new.target === tt)
667
+ if (new.target === it)
640
668
  throw new Error("请直接使用静态方法,而不是实例化此类");
641
669
  }
642
670
  static check(s, t) {
643
671
  if (!s || typeof s != "string")
644
672
  return console.error("Invalid URL provided"), t ? !1 : "unknown";
645
- const e = ne(s).toLowerCase();
673
+ const e = ce(s).toLowerCase();
646
674
  if (t) {
647
- if (!ee.hasOwnProperty(t))
675
+ if (!re.hasOwnProperty(t))
648
676
  return console.error(`Unknown file type: ${t}`), "unknown";
649
- const i = ee[t];
650
- return tt._checkExtension(e, i);
677
+ const i = re[t];
678
+ return it._checkExtension(e, i);
651
679
  }
652
- return tt._detectFileType(e);
680
+ return it._detectFileType(e);
653
681
  }
654
682
  /**
655
683
  * 静态方法,用于解析地址信息
@@ -661,7 +689,7 @@ const tt = class tt {
661
689
  */
662
690
  static parseAddresses(s) {
663
691
  return !s || typeof s != "string" ? (console.error("Invalid URL provided"), []) : s.split(",").map((t) => {
664
- const e = ne(t), i = this.check(t);
692
+ const e = ce(t), i = this.check(t);
665
693
  return { url: t, name: e, type: i };
666
694
  });
667
695
  }
@@ -674,7 +702,7 @@ const tt = class tt {
674
702
  static matchesMimeType(s, t) {
675
703
  if (!t) return !0;
676
704
  if (typeof s != "string" || typeof t != "string") return !1;
677
- const e = tt._normalizeType(s), i = t.split(",").map((a) => tt._normalizeType(a.trim())), [n, o = "*"] = e.split("/");
705
+ const e = it._normalizeType(s), i = t.split(",").map((a) => it._normalizeType(a.trim())), [n, o = "*"] = e.split("/");
678
706
  return i.some((a) => {
679
707
  const [l, c = "*"] = a.split("/");
680
708
  return (l === "*" || n === "*" || l === n) && (c === "*" || o === "*" || c === o);
@@ -689,7 +717,7 @@ const tt = class tt {
689
717
  * @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
690
718
  */
691
719
  static _normalizeType(s) {
692
- return s.startsWith(".") && !s.includes("/") ? We[s.toLowerCase()] || s : s.includes("/") ? s : `${s}/*`;
720
+ return s.startsWith(".") && !s.includes("/") ? Je[s.toLowerCase()] || s : s.includes("/") ? s : `${s}/*`;
693
721
  }
694
722
  /**
695
723
  * 检查URL是否具有任何指定的文件扩展名
@@ -706,20 +734,20 @@ const tt = class tt {
706
734
  * @returns {string} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
707
735
  */
708
736
  static _detectFileType(s) {
709
- for (const [t, e] of tt.cachedEntries)
737
+ for (const [t, e] of it.cachedEntries)
710
738
  if (e.some((i) => s.endsWith(i)))
711
739
  return t;
712
740
  return "unknown";
713
741
  }
714
742
  };
715
743
  // 缓存文件扩展名的条目,以提高性能
716
- d(tt, "cachedEntries", Object.entries(ee));
717
- let we = tt;
718
- const Ze = /\w*(?:\[\d+\])+|\w+/g, Me = /^\w*(?:\[\d+\])+$/, Ee = /\w+|(\[\d+\])/g, De = /\[(\d+)\]/;
719
- function Ve(r) {
720
- return r ? r.match(Ze) || [] : [];
744
+ d(it, "cachedEntries", Object.entries(re));
745
+ let be = it;
746
+ const ei = /\w*(?:\[\d+\])+|\w+/g, ke = /^\w*(?:\[\d+\])+$/, Ve = /\w+|(\[\d+\])/g, Oe = /\[(\d+)\]/;
747
+ function Ae(r) {
748
+ return r ? r.match(ei) || [] : [];
721
749
  }
722
- function qs(r, s = 3e3) {
750
+ function Ks(r, s = 3e3) {
723
751
  if (typeof r != "function")
724
752
  return console.error("非函数:", r);
725
753
  const t = window.requestIdleCallback, e = function(i) {
@@ -727,7 +755,7 @@ function qs(r, s = 3e3) {
727
755
  };
728
756
  t ? t(e, { timeout: s }) : requestAnimationFrame(() => r());
729
757
  }
730
- function Qe(r, s) {
758
+ function ii(r, s) {
731
759
  const t = Date.now();
732
760
  return new Promise((e, i) => {
733
761
  const n = () => {
@@ -739,19 +767,19 @@ function Qe(r, s) {
739
767
  n();
740
768
  });
741
769
  }
742
- function pt(r, s, t = [], e = Date.now()) {
770
+ function ct(r, s, t = [], e = Date.now()) {
743
771
  if (e < Date.now() - 50) {
744
772
  console.error("_MergeObjects 合并异常:疑似死循环");
745
773
  return;
746
774
  }
747
- const i = re(r), n = re(s);
775
+ const i = he(r), n = he(s);
748
776
  if (i != n) return s;
749
777
  if (i == "object" || i == "array") {
750
778
  if (t.some(([o, a]) => o == r && a == s)) return r;
751
779
  if (t.push([r, s]), i == "object") {
752
780
  for (const o in s)
753
781
  if (Object.prototype.hasOwnProperty.call(s, o)) {
754
- const a = s[o], l = r[o], c = pt(
782
+ const a = s[o], l = r[o], c = ct(
755
783
  l,
756
784
  a,
757
785
  t,
@@ -762,7 +790,7 @@ function pt(r, s, t = [], e = Date.now()) {
762
790
  return r;
763
791
  } else if (i == "array")
764
792
  return s.forEach((o, a) => {
765
- const l = o, c = r[a], h = pt(
793
+ const l = o, c = r[a], h = ct(
766
794
  c,
767
795
  l,
768
796
  t,
@@ -772,13 +800,13 @@ function pt(r, s, t = [], e = Date.now()) {
772
800
  }), r;
773
801
  } else return s;
774
802
  }
775
- function oe(r = "") {
803
+ function ue(r = "") {
776
804
  return r + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(s) {
777
805
  const t = Math.random() * 16 | 0;
778
806
  return (s === "x" ? t : t & 3 | 8).toString(16);
779
807
  });
780
808
  }
781
- function Re(r, s) {
809
+ function Le(r, s) {
782
810
  let t;
783
811
  return function(...e) {
784
812
  clearTimeout(t), t = setTimeout(() => {
@@ -786,7 +814,7 @@ function Re(r, s) {
786
814
  }, s);
787
815
  };
788
816
  }
789
- function $s(r, s) {
817
+ function tn(r, s) {
790
818
  let t = -1 / 0;
791
819
  return function(...e) {
792
820
  const i = performance.now();
@@ -800,52 +828,52 @@ function $s(r, s) {
800
828
  }
801
829
  };
802
830
  }
803
- function Zs(r, s) {
831
+ function en(r, s) {
804
832
  if (!r || !s) return r;
805
- const t = Ve(s);
833
+ const t = Ae(s);
806
834
  return t.length ? t.reduce((e, i, n) => {
807
835
  const o = n === t.length - 1;
808
- if (Me.test(i)) {
809
- const a = i.match(Ee) || [];
836
+ if (ke.test(i)) {
837
+ const a = i.match(Ve) || [];
810
838
  return a.reduce((l, c, h) => {
811
839
  if (/^\w+$/.test(c))
812
840
  return l[c] || (h < a.length - 1 ? [] : {});
813
- const u = c.match(De), f = u ? parseInt(u[1], 10) : 0, m = h === a.length - 1;
841
+ const u = c.match(Oe), f = u ? parseInt(u[1], 10) : 0, m = h === a.length - 1;
814
842
  return m && o ? l[f] : l[f] || (m ? {} : []);
815
843
  }, e);
816
844
  }
817
845
  return o ? e[i] : e[i] || {};
818
846
  }, r) : r;
819
847
  }
820
- function Qs(r, s, t, e) {
848
+ function sn(r, s, t, e) {
821
849
  if (!r || !s) return t;
822
- const i = Ve(s);
850
+ const i = Ae(s);
823
851
  return i.length ? i.reduce((n, o, a) => {
824
852
  const l = a === i.length - 1;
825
- if (Me.test(o)) {
826
- const c = o.match(Ee) || [];
853
+ if (ke.test(o)) {
854
+ const c = o.match(Ve) || [];
827
855
  return c.reduce((h, u, f) => {
828
856
  const m = f === c.length - 1;
829
857
  if (/^\w+$/.test(u))
830
858
  return h.hasOwnProperty(u) || (h[u] = []), h[u];
831
- const p = u.match(De), g = p ? parseInt(p[1], 10) : 0, y = m && l;
859
+ const p = u.match(Oe), g = p ? parseInt(p[1], 10) : 0, y = m && l;
832
860
  return h.hasOwnProperty(g) ? y && !e && (h[g] = t) : h[g] = y ? t : m ? {} : [], h[g];
833
861
  }, n);
834
862
  }
835
863
  return l ? ((!e || !n.hasOwnProperty(o)) && (n[o] = t), n[o]) : (n.hasOwnProperty(o) || (n[o] = {}), n[o]);
836
864
  }, r) : t;
837
865
  }
838
- function Js(r) {
866
+ function nn(r) {
839
867
  return r.map((s, t) => r.slice(t).concat(r.slice(0, t)));
840
868
  }
841
- function Je(r) {
869
+ function si(r) {
842
870
  const s = window.structuredClone, t = (e, i = /* @__PURE__ */ new WeakMap()) => {
843
871
  const n = e;
844
872
  if (n === null || typeof n != "object")
845
873
  return n;
846
874
  if (i.has(n))
847
875
  return i.get(n);
848
- switch (re(n)) {
876
+ switch (he(n)) {
849
877
  case "array": {
850
878
  const a = [];
851
879
  i.set(n, a);
@@ -929,7 +957,7 @@ function Je(r) {
929
957
  return console.warn("structuredClone error:", e), s && t(r);
930
958
  }
931
959
  }
932
- function Ke(r, s) {
960
+ function ni(r, s) {
933
961
  const t = [
934
962
  [11, "#d03050"],
935
963
  [8, "#f0a020"],
@@ -961,7 +989,7 @@ function Ke(r, s) {
961
989
  ), f;
962
990
  };
963
991
  }
964
- function Ks(r) {
992
+ function rn(r) {
965
993
  const s = Date.now();
966
994
  let t = performance.now();
967
995
  for (; Date.now() - s < r; ) {
@@ -974,7 +1002,193 @@ function Ks(r) {
974
1002
  }
975
1003
  return Date.now() - s;
976
1004
  }
977
- function tn(r, s = 10) {
1005
+ var yt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(yt || {});
1006
+ class on {
1007
+ constructor(s, t) {
1008
+ /** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
1009
+ d(this, "soundSources");
1010
+ /** 各 key 下载任务,避免重复发起 */
1011
+ d(this, "preloadTasks", /* @__PURE__ */ new Map());
1012
+ this.soundSources = { ...s };
1013
+ const e = t == null ? void 0 : t.holdKeys;
1014
+ if (e != null && e.length)
1015
+ for (const i of e)
1016
+ this.fetchAndReplaceSource(i);
1017
+ }
1018
+ preload(s) {
1019
+ const t = Array.isArray(s) ? s : [s];
1020
+ return Promise.all(t.map((e) => this.fetchAndReplaceSource(e))).then(
1021
+ () => {
1022
+ }
1023
+ );
1024
+ }
1025
+ fetchAndReplaceSource(s) {
1026
+ const t = this.preloadTasks.get(s);
1027
+ if (t) return t;
1028
+ const e = this.soundSources[s];
1029
+ if (!e)
1030
+ return Promise.reject(new Error(`未找到对应音效资源: ${String(s)}`));
1031
+ if (e.startsWith("blob:")) {
1032
+ const n = Promise.resolve();
1033
+ return this.preloadTasks.set(s, n), n;
1034
+ }
1035
+ const i = fetch(e).then((n) => {
1036
+ if (!n.ok)
1037
+ throw new Error(`音效下载失败: ${n.status} ${e}`);
1038
+ return n.blob();
1039
+ }).then((n) => {
1040
+ const o = this.soundSources[s], a = URL.createObjectURL(n);
1041
+ this.soundSources[s] = a, o.startsWith("blob:") && o !== a && URL.revokeObjectURL(o);
1042
+ }).catch((n) => {
1043
+ throw this.preloadTasks.delete(s), n instanceof Error ? n : new Error(String(n));
1044
+ });
1045
+ return this.preloadTasks.set(s, i), i;
1046
+ }
1047
+ /**
1048
+ * 根据 key 播放音效
1049
+ * @param key 资源 key
1050
+ * @param options 播放配置(循环等)
1051
+ */
1052
+ play(s, t) {
1053
+ const e = this.soundSources[s];
1054
+ return e ? this.playUrl(e, t) : (console.warn(`未找到对应音效资源: ${String(s)}`), () => {
1055
+ });
1056
+ }
1057
+ /**
1058
+ * 根据 URL 播放音效
1059
+ * @param url 音频地址
1060
+ * @param options 播放配置(循环等)
1061
+ * @returns 停止播放的方法
1062
+ */
1063
+ playUrl(s, t) {
1064
+ if (!s) {
1065
+ console.error("音效资源地址为空");
1066
+ return;
1067
+ }
1068
+ const e = new Audio(s), i = (t == null ? void 0 : t.loopCount) !== void 0 && t.loopCount > 0 ? t.loopCount : void 0, n = (t == null ? void 0 : t.loop) && i === void 0;
1069
+ let o = 0, a = !1;
1070
+ const l = () => {
1071
+ a || (a = !0, e.pause(), e.currentTime = 0, e.removeEventListener("ended", c), e.onerror = null);
1072
+ }, c = () => {
1073
+ if (!a) {
1074
+ if (n) {
1075
+ e.currentTime = 0, e.play().catch((h) => {
1076
+ console.warn("循环音效再次播放失败:", h), l();
1077
+ });
1078
+ return;
1079
+ }
1080
+ if (i !== void 0 && o + 1 < i) {
1081
+ o += 1, e.currentTime = 0, e.play().catch((h) => {
1082
+ console.warn("循环音效再次播放失败:", h), l();
1083
+ });
1084
+ return;
1085
+ }
1086
+ l();
1087
+ }
1088
+ };
1089
+ return e.addEventListener("ended", c), e.onerror = () => {
1090
+ a || (console.error(`音效资源加载失败: ${s}`), l());
1091
+ }, e.play().catch((h) => {
1092
+ a || (console.warn("音效播放失败(可能是自动播放策略限制):", h), l());
1093
+ }), l;
1094
+ }
1095
+ }
1096
+ function Ce(r, s) {
1097
+ for (const t of Object.keys(s))
1098
+ s[t] !== void 0 && (r[t] = s[t]);
1099
+ }
1100
+ class an {
1101
+ constructor(s) {
1102
+ /** WebSocket地址 */
1103
+ d(this, "url");
1104
+ /** WebSocket实例 */
1105
+ d(this, "socket");
1106
+ /** 连接回调 */
1107
+ d(this, "onopen");
1108
+ /** 接收消息回调 */
1109
+ d(this, "onmessage");
1110
+ /** 错误回调 */
1111
+ d(this, "onerror");
1112
+ /** 关闭回调 */
1113
+ d(this, "onclose");
1114
+ /** ping 配置 */
1115
+ d(this, "pingConfig", {
1116
+ /** 是否启用 */
1117
+ enabled: !1,
1118
+ /** 间隔(毫秒) */
1119
+ interval: 1e3 * 30,
1120
+ /** 发送内容 */
1121
+ content: "ping"
1122
+ });
1123
+ /** ping 定时器 */
1124
+ d(this, "pingTimer");
1125
+ /** 重试配置 */
1126
+ d(this, "retryConfig", {
1127
+ /** 最大次数 */
1128
+ maxCount: 3,
1129
+ /** 当前次数 */
1130
+ currentCount: 0,
1131
+ /** 间隔(毫秒) */
1132
+ interval: 1e3
1133
+ });
1134
+ /** 发送信息 */
1135
+ d(this, "send", (s) => {
1136
+ var t;
1137
+ return this.ready ? ((t = this.socket) == null || t.send(s), !0) : !1;
1138
+ });
1139
+ if (!s) return;
1140
+ const { url: t, ping: e, maxRetryCount: i, retryInterval: n } = s;
1141
+ e !== void 0 && (typeof e == "boolean" ? this.pingConfig.enabled = e : Ce(this.pingConfig, e)), Ce(this.retryConfig, {
1142
+ maxCount: i,
1143
+ interval: n
1144
+ }), t && this.start(t);
1145
+ }
1146
+ /** 是否准备完毕 */
1147
+ get ready() {
1148
+ var s;
1149
+ return ((s = this.socket) == null ? void 0 : s.readyState) === WebSocket.OPEN;
1150
+ }
1151
+ /** 开始ping */
1152
+ startPing() {
1153
+ const { interval: s, content: t, enabled: e } = this.pingConfig;
1154
+ e && (this.pingTimer = setInterval(() => {
1155
+ var i;
1156
+ this.ready ? (i = this.socket) == null || i.send(t) : console.warn("WebSocket未就绪,无法发送ping");
1157
+ }, s));
1158
+ }
1159
+ /** 开始重试 */
1160
+ startRetry() {
1161
+ const { maxCount: s, interval: t, currentCount: e } = this.retryConfig;
1162
+ if (s <= e) {
1163
+ console.error("WebSocket重试次数已用完"), this.retryConfig.currentCount = 0;
1164
+ return;
1165
+ }
1166
+ this.retryConfig.currentCount++, setTimeout(() => this.start(this.url), t);
1167
+ }
1168
+ /** 开始 */
1169
+ start(s) {
1170
+ const t = new WebSocket(s);
1171
+ this.socket = t, this.url = s, t.onopen = (e) => {
1172
+ var i;
1173
+ console.log("WebSocket已连接"), this.startPing(), this.retryConfig.currentCount = 0, (i = this.onopen) == null || i.call(this, e);
1174
+ }, t.onmessage = (e) => {
1175
+ var i;
1176
+ (i = this.onmessage) == null || i.call(this, e);
1177
+ }, t.onerror = (e) => {
1178
+ var i;
1179
+ console.error("WebSocket错误:", e), clearInterval(this.pingTimer), this.startRetry(), (i = this.onerror) == null || i.call(this, e);
1180
+ }, t.onclose = (e) => {
1181
+ var i;
1182
+ console.log("WebSocket已关闭"), clearInterval(this.pingTimer), (i = this.onclose) == null || i.call(this, e);
1183
+ };
1184
+ }
1185
+ /** 停止 */
1186
+ stop() {
1187
+ var s;
1188
+ (s = this.socket) == null || s.close(), this.socket = void 0;
1189
+ }
1190
+ }
1191
+ function ln(r, s = 10) {
978
1192
  let t = 0, e = s;
979
1193
  function i() {
980
1194
  if (e > 0)
@@ -988,7 +1202,7 @@ function tn(r, s = 10) {
988
1202
  t = Date.now(), i();
989
1203
  });
990
1204
  }
991
- function en(r) {
1205
+ function cn(r) {
992
1206
  const s = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
993
1207
  function e() {
994
1208
  return navigator.clipboard.writeText(r).then(s).catch(t);
@@ -1015,8 +1229,8 @@ function en(r) {
1015
1229
  }
1016
1230
  return navigator.clipboard ? e().catch(o) : o();
1017
1231
  }
1018
- function sn(r, s) {
1019
- const t = _e[r];
1232
+ function hn(r, s) {
1233
+ const t = Re[r];
1020
1234
  if (!t) return console.error(`未知纸张类型: ${r}`);
1021
1235
  const { width: e, height: i } = t, n = (p) => p / 25.4, a = typeof window < "u" ? window.devicePixelRatio * 96 : 300, l = (p) => Math.round(n(p) * a), c = l(e), h = l(i), u = l(s), f = Math.max(0, c - 2 * u), m = Math.max(0, h - 2 * u);
1022
1236
  return {
@@ -1032,7 +1246,7 @@ function sn(r, s) {
1032
1246
  paperHeightPx: h
1033
1247
  };
1034
1248
  }
1035
- class It {
1249
+ class Nt {
1036
1250
  constructor() {
1037
1251
  }
1038
1252
  /** 初始化标签页管理器 */
@@ -1052,13 +1266,13 @@ class It {
1052
1266
  /** 处理BroadcastChannel消息 */
1053
1267
  static handleChannelMessage(s) {
1054
1268
  const { type: t, responseKey: e, name: i } = s.data;
1055
- if (t === "response") {
1269
+ if (t === yt.RESPONSE) {
1056
1270
  const n = this.pendingQueries.get(e);
1057
1271
  n == null || n.forEach((o) => o(i));
1058
- } else if (t === "query") {
1272
+ } else if (t === yt.QUERY) {
1059
1273
  if (this.pendingQueries.has(e) || i != "*" && i != window.name) return;
1060
1274
  const n = {
1061
- type: "response",
1275
+ type: yt.RESPONSE,
1062
1276
  responseKey: e,
1063
1277
  name: window.name
1064
1278
  };
@@ -1074,16 +1288,16 @@ class It {
1074
1288
  const o = "请先初始化标签页管理器";
1075
1289
  return console.error(o), Promise.reject(o);
1076
1290
  }
1077
- const t = oe();
1291
+ const t = ue();
1078
1292
  let e = !1;
1079
1293
  const i = this.pendingQueries.get(t) || [];
1080
1294
  i.push(() => e = !0), this.pendingQueries.set(t, i);
1081
1295
  const n = {
1082
- type: "query",
1296
+ type: yt.QUERY,
1083
1297
  responseKey: t,
1084
1298
  name: s
1085
1299
  };
1086
- return this.channel.postMessage(n), Qe(() => e, this.timeout).finally(
1300
+ return this.channel.postMessage(n), ii(() => e, this.timeout).finally(
1087
1301
  () => this.pendingQueries.delete(t)
1088
1302
  );
1089
1303
  }
@@ -1105,10 +1319,10 @@ class It {
1105
1319
  const n = "请先初始化标签页管理器";
1106
1320
  return console.error(n), Promise.reject(n);
1107
1321
  }
1108
- const s = oe(), t = [], e = this.pendingQueries.get(s) || [];
1322
+ const s = ue(), t = [], e = this.pendingQueries.get(s) || [];
1109
1323
  e.push((n) => t.push(n)), this.pendingQueries.set(s, e);
1110
1324
  const i = {
1111
- type: "query",
1325
+ type: yt.QUERY,
1112
1326
  responseKey: s,
1113
1327
  name: "*"
1114
1328
  };
@@ -1120,14 +1334,56 @@ class It {
1120
1334
  }
1121
1335
  }
1122
1336
  /** 初始化完成标志 */
1123
- d(It, "initFinish", !1), /** 频道 */
1124
- d(It, "channel", new BroadcastChannel("nhanh-pure-function")), /** 等待回执消息时间上限(上限) */
1125
- d(It, "timeout", 150), /**
1337
+ d(Nt, "initFinish", !1), /** 频道 */
1338
+ d(Nt, "channel", new BroadcastChannel("nhanh-pure-function")), /** 等待回执消息时间上限(上限) */
1339
+ d(Nt, "timeout", 150), /**
1126
1340
  * 待处理查询
1127
1341
  * @param key 回执消息key
1128
1342
  * @param callback 匹配标签页的回调函数
1129
1343
  */
1130
- d(It, "pendingQueries", /* @__PURE__ */ new Map());
1344
+ d(Nt, "pendingQueries", /* @__PURE__ */ new Map());
1345
+ class un {
1346
+ constructor() {
1347
+ /** 用户状态:active(活跃) / idle(闲置) */
1348
+ d(this, "status", "active");
1349
+ /** 活跃状态回调通知集合(key: 回调标识,value: 回调函数) */
1350
+ d(this, "activeCallbacks", /* @__PURE__ */ new Map());
1351
+ /** 闲置状态回调通知集合(key: 回调标识,value: 回调函数) */
1352
+ d(this, "idleCallbacks", /* @__PURE__ */ new Map());
1353
+ /** 闲置时间(分钟) */
1354
+ d(this, "idleTime", 5);
1355
+ /** 闲置判定定时器(5分钟无操作触发闲置状态) */
1356
+ d(this, "timeoutTimer");
1357
+ /**
1358
+ * 激活为活跃状态
1359
+ * 触发活跃回调,并重置定时器
1360
+ */
1361
+ d(this, "activate", () => {
1362
+ this.status === "idle" && (this.status = "active", console.log(
1363
+ "%c已进入活跃状态",
1364
+ "background: #4CAF50; color: white; padding: 2px 4px; border-radius: 4px; font-weight: bold;"
1365
+ ), this.activeCallbacks.forEach((s) => s())), this.resetTimeoutTimer();
1366
+ });
1367
+ /**
1368
+ * 标记为闲置状态
1369
+ * 触发闲置回调,并清除定时器
1370
+ */
1371
+ d(this, "markAsIdle", () => {
1372
+ this.timeoutTimer && clearTimeout(this.timeoutTimer), this.status === "active" && (this.status = "idle", console.log(
1373
+ "%c已进入闲置状态",
1374
+ "background: #9E9E9E; color: white; padding: 2px 4px; border-radius: 4px; font-weight: bold;"
1375
+ ), this.idleCallbacks.forEach((s) => s()));
1376
+ });
1377
+ window.addEventListener("keypress", this.activate), window.addEventListener("mousemove", this.activate), window.addEventListener("mousedown", this.activate), window.addEventListener("wheel", this.activate), this.resetTimeoutTimer();
1378
+ }
1379
+ /**
1380
+ * 重置闲置判定定时器
1381
+ * 每次用户操作时重置,重新开始5分钟计时
1382
+ */
1383
+ resetTimeoutTimer() {
1384
+ this.timeoutTimer && clearTimeout(this.timeoutTimer), this.timeoutTimer = setTimeout(this.markAsIdle, 1e3 * 60 * this.idleTime);
1385
+ }
1386
+ }
1131
1387
  /*!
1132
1388
  * decimal.js v10.5.0
1133
1389
  * An arbitrary-precision Decimal type for JavaScript.
@@ -1135,7 +1391,7 @@ d(It, "pendingQueries", /* @__PURE__ */ new Map());
1135
1391
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
1136
1392
  * MIT Licence
1137
1393
  */
1138
- var ae = 9e15, ht = 1e9, le = "0123456789abcdef", Yt = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", jt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", ce = {
1394
+ var de = 9e15, ut = 1e9, fe = "0123456789abcdef", $t = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Zt = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", me = {
1139
1395
  // These values must be integers within the stated ranges (inclusive).
1140
1396
  // Most of these values can be changed at run-time using the `Decimal.config` method.
1141
1397
  // The maximum number of significant digits of the result of a calculation or base conversion.
@@ -1188,23 +1444,23 @@ var ae = 9e15, ht = 1e9, le = "0123456789abcdef", Yt = "2.3025850929940456840179
1188
1444
  // -1 to -EXP_LIMIT
1189
1445
  // The maximum exponent value, above which overflow to Infinity occurs.
1190
1446
  // JavaScript numbers: 308 (1.7976931348623157e+308)
1191
- maxE: ae,
1447
+ maxE: de,
1192
1448
  // 1 to EXP_LIMIT
1193
1449
  // Whether to use cryptographically-secure random number generation, if available.
1194
1450
  crypto: !1
1195
1451
  // true/false
1196
- }, ke, nt, _ = !0, Zt = "[DecimalError] ", ct = Zt + "Invalid argument: ", Oe = Zt + "Precision limit exceeded", Ae = Zt + "crypto unavailable", Ne = "[object Decimal]", F = Math.floor, I = Math.pow, ti = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, ei = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, ii = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Ie = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, $ = 1e7, S = 7, si = 9007199254740991, ni = Yt.length - 1, he = jt.length - 1, v = { toStringTag: Ne };
1452
+ }, Te, nt, E = !0, ee = "[DecimalError] ", ht = ee + "Invalid argument: ", Ie = ee + "Precision limit exceeded", Ne = ee + "crypto unavailable", He = "[object Decimal]", F = Math.floor, I = Math.pow, ri = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, oi = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, ai = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Fe = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Q = 1e7, S = 7, li = 9007199254740991, ci = $t.length - 1, ge = Zt.length - 1, v = { toStringTag: He };
1197
1453
  v.absoluteValue = v.abs = function() {
1198
1454
  var r = new this.constructor(this);
1199
- return r.s < 0 && (r.s = 1), P(r);
1455
+ return r.s < 0 && (r.s = 1), C(r);
1200
1456
  };
1201
1457
  v.ceil = function() {
1202
- return P(new this.constructor(this), this.e + 1, 2);
1458
+ return C(new this.constructor(this), this.e + 1, 2);
1203
1459
  };
1204
1460
  v.clampedTo = v.clamp = function(r, s) {
1205
1461
  var t, e = this, i = e.constructor;
1206
1462
  if (r = new i(r), s = new i(s), !r.s || !s.s) return new i(NaN);
1207
- if (r.gt(s)) throw Error(ct + s);
1463
+ if (r.gt(s)) throw Error(ht + s);
1208
1464
  return t = e.cmp(r), t < 0 ? r : e.cmp(s) > 0 ? s : new i(e);
1209
1465
  };
1210
1466
  v.comparedTo = v.cmp = function(r) {
@@ -1220,24 +1476,24 @@ v.comparedTo = v.cmp = function(r) {
1220
1476
  };
1221
1477
  v.cosine = v.cos = function() {
1222
1478
  var r, s, t = this, e = t.constructor;
1223
- return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = ri(e, Be(e, t)), e.precision = r, e.rounding = s, P(nt == 2 || nt == 3 ? t.neg() : t, r, s, !0)) : new e(1) : new e(NaN);
1479
+ return t.d ? t.d[0] ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = hi(e, ze(e, t)), e.precision = r, e.rounding = s, C(nt == 2 || nt == 3 ? t.neg() : t, r, s, !0)) : new e(1) : new e(NaN);
1224
1480
  };
1225
1481
  v.cubeRoot = v.cbrt = function() {
1226
1482
  var r, s, t, e, i, n, o, a, l, c, h = this, u = h.constructor;
1227
1483
  if (!h.isFinite() || h.isZero()) return new u(h);
1228
- for (_ = !1, n = h.s * I(h.s * h, 1 / 3), !n || Math.abs(n) == 1 / 0 ? (t = T(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; ; )
1229
- if (a = e, l = a.times(a).times(a), c = l.plus(h), e = R(c.plus(h).times(a), c.plus(l), o + 2, 1), T(a.d).slice(0, o) === (t = T(e.d)).slice(0, o))
1484
+ 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; ; )
1485
+ if (a = e, l = a.times(a).times(a), c = l.plus(h), e = V(c.plus(h).times(a), c.plus(l), o + 2, 1), N(a.d).slice(0, o) === (t = N(e.d)).slice(0, o))
1230
1486
  if (t = t.slice(o - 3, o + 1), t == "9999" || !i && t == "4999") {
1231
- if (!i && (P(a, r + 1, 0), a.times(a).times(a).eq(h))) {
1487
+ if (!i && (C(a, r + 1, 0), a.times(a).times(a).eq(h))) {
1232
1488
  e = a;
1233
1489
  break;
1234
1490
  }
1235
1491
  o += 4, i = 1;
1236
1492
  } else {
1237
- (!+t || !+t.slice(1) && t.charAt(0) == "5") && (P(e, r + 1, 1), s = !e.times(e).times(e).eq(h));
1493
+ (!+t || !+t.slice(1) && t.charAt(0) == "5") && (C(e, r + 1, 1), s = !e.times(e).times(e).eq(h));
1238
1494
  break;
1239
1495
  }
1240
- return _ = !0, P(e, r, u.rounding, s);
1496
+ return E = !0, C(e, r, u.rounding, s);
1241
1497
  };
1242
1498
  v.decimalPlaces = v.dp = function() {
1243
1499
  var r, s = this.d, t = NaN;
@@ -1248,17 +1504,17 @@ v.decimalPlaces = v.dp = function() {
1248
1504
  return t;
1249
1505
  };
1250
1506
  v.dividedBy = v.div = function(r) {
1251
- return R(this, new this.constructor(r));
1507
+ return V(this, new this.constructor(r));
1252
1508
  };
1253
1509
  v.dividedToIntegerBy = v.divToInt = function(r) {
1254
1510
  var s = this, t = s.constructor;
1255
- return P(R(s, new t(r), 0, 1, 1), t.precision, t.rounding);
1511
+ return C(V(s, new t(r), 0, 1, 1), t.precision, t.rounding);
1256
1512
  };
1257
1513
  v.equals = v.eq = function(r) {
1258
1514
  return this.cmp(r) === 0;
1259
1515
  };
1260
1516
  v.floor = function() {
1261
- return P(new this.constructor(this), this.e + 1, 3);
1517
+ return C(new this.constructor(this), this.e + 1, 3);
1262
1518
  };
1263
1519
  v.greaterThan = v.gt = function(r) {
1264
1520
  return this.cmp(r) > 0;
@@ -1271,10 +1527,10 @@ v.hyperbolicCosine = v.cosh = function() {
1271
1527
  var r, s, t, e, i, n = this, o = n.constructor, a = new o(1);
1272
1528
  if (!n.isFinite()) return new o(n.s ? 1 / 0 : NaN);
1273
1529
  if (n.isZero()) return a;
1274
- t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / Jt(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n = Mt(o, 1, n.times(s), new o(1), !0);
1530
+ t = o.precision, e = o.rounding, o.precision = t + Math.max(n.e, n.sd()) + 4, o.rounding = 1, i = n.d.length, i < 32 ? (r = Math.ceil(i / 3), s = (1 / se(4, r)).toString()) : (r = 16, s = "2.3283064365386962890625e-10"), n = Mt(o, 1, n.times(s), new o(1), !0);
1275
1531
  for (var l, c = r, h = new o(8); c--; )
1276
1532
  l = n.times(n), n = a.minus(l.times(h.minus(l.times(h))));
1277
- return P(n, o.precision = t, o.rounding = e, !0);
1533
+ return C(n, o.precision = t, o.rounding = e, !0);
1278
1534
  };
1279
1535
  v.hyperbolicSine = v.sinh = function() {
1280
1536
  var r, s, t, e, i = this, n = i.constructor;
@@ -1282,52 +1538,52 @@ v.hyperbolicSine = v.sinh = function() {
1282
1538
  if (s = n.precision, t = n.rounding, n.precision = s + Math.max(i.e, i.sd()) + 4, n.rounding = 1, e = i.d.length, e < 3)
1283
1539
  i = Mt(n, 2, i, i, !0);
1284
1540
  else {
1285
- r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / Jt(5, r)), i = Mt(n, 2, i, i, !0);
1541
+ r = 1.4 * Math.sqrt(e), r = r > 16 ? 16 : r | 0, i = i.times(1 / se(5, r)), i = Mt(n, 2, i, i, !0);
1286
1542
  for (var o, a = new n(5), l = new n(16), c = new n(20); r--; )
1287
1543
  o = i.times(i), i = i.times(a.plus(o.times(l.times(o).plus(c))));
1288
1544
  }
1289
- return n.precision = s, n.rounding = t, P(i, s, t, !0);
1545
+ return n.precision = s, n.rounding = t, C(i, s, t, !0);
1290
1546
  };
1291
1547
  v.hyperbolicTangent = v.tanh = function() {
1292
1548
  var r, s, t = this, e = t.constructor;
1293
- return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 7, e.rounding = 1, R(t.sinh(), t.cosh(), e.precision = r, e.rounding = s)) : new e(t.s);
1549
+ return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 7, e.rounding = 1, V(t.sinh(), t.cosh(), e.precision = r, e.rounding = s)) : new e(t.s);
1294
1550
  };
1295
1551
  v.inverseCosine = v.acos = function() {
1296
1552
  var r = this, s = r.constructor, t = r.abs().cmp(1), e = s.precision, i = s.rounding;
1297
- return t !== -1 ? t === 0 ? r.isNeg() ? J(s, e, i) : new s(0) : new s(NaN) : r.isZero() ? J(s, e + 4, i).times(0.5) : (s.precision = e + 6, s.rounding = 1, r = new s(1).minus(r).div(r.plus(1)).sqrt().atan(), s.precision = e, s.rounding = i, r.times(2));
1553
+ return t !== -1 ? t === 0 ? r.isNeg() ? tt(s, e, i) : new s(0) : new s(NaN) : r.isZero() ? tt(s, e + 4, i).times(0.5) : (s.precision = e + 6, s.rounding = 1, r = new s(1).minus(r).div(r.plus(1)).sqrt().atan(), s.precision = e, s.rounding = i, r.times(2));
1298
1554
  };
1299
1555
  v.inverseHyperbolicCosine = v.acosh = function() {
1300
1556
  var r, s, t = this, e = t.constructor;
1301
- return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, s = e.rounding, e.precision = r + Math.max(Math.abs(t.e), t.sd()) + 4, e.rounding = 1, _ = !1, t = t.times(t).minus(1).sqrt().plus(t), _ = !0, e.precision = r, e.rounding = s, t.ln()) : new e(t);
1557
+ return t.lte(1) ? new e(t.eq(1) ? 0 : NaN) : t.isFinite() ? (r = e.precision, s = 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 = s, t.ln()) : new e(t);
1302
1558
  };
1303
1559
  v.inverseHyperbolicSine = v.asinh = function() {
1304
1560
  var r, s, t = this, e = t.constructor;
1305
- return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, e.rounding = 1, _ = !1, t = t.times(t).plus(1).sqrt().plus(t), _ = !0, e.precision = r, e.rounding = s, t.ln());
1561
+ return !t.isFinite() || t.isZero() ? new e(t) : (r = e.precision, s = 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 = s, t.ln());
1306
1562
  };
1307
1563
  v.inverseHyperbolicTangent = v.atanh = function() {
1308
1564
  var r, s, t, e, i = this, n = i.constructor;
1309
- return i.isFinite() ? i.e >= 0 ? new n(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (r = n.precision, s = n.rounding, e = i.sd(), Math.max(e, r) < 2 * -i.e - 1 ? P(new n(i), r, s, !0) : (n.precision = t = e - i.e, i = R(i.plus(1), new n(1).minus(i), t + r, 1), n.precision = r + 4, n.rounding = 1, i = i.ln(), n.precision = r, n.rounding = s, i.times(0.5))) : new n(NaN);
1565
+ return i.isFinite() ? i.e >= 0 ? new n(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (r = n.precision, s = n.rounding, e = i.sd(), Math.max(e, r) < 2 * -i.e - 1 ? C(new n(i), r, s, !0) : (n.precision = t = e - i.e, i = V(i.plus(1), new n(1).minus(i), t + r, 1), n.precision = r + 4, n.rounding = 1, i = i.ln(), n.precision = r, n.rounding = s, i.times(0.5))) : new n(NaN);
1310
1566
  };
1311
1567
  v.inverseSine = v.asin = function() {
1312
1568
  var r, s, t, e, i = this, n = i.constructor;
1313
- return i.isZero() ? new n(i) : (s = i.abs().cmp(1), t = n.precision, e = n.rounding, s !== -1 ? s === 0 ? (r = J(n, t + 4, e).times(0.5), r.s = i.s, r) : new n(NaN) : (n.precision = t + 6, n.rounding = 1, i = i.div(new n(1).minus(i.times(i)).sqrt().plus(1)).atan(), n.precision = t, n.rounding = e, i.times(2)));
1569
+ return i.isZero() ? new n(i) : (s = i.abs().cmp(1), t = n.precision, e = n.rounding, s !== -1 ? s === 0 ? (r = tt(n, t + 4, e).times(0.5), r.s = i.s, r) : new n(NaN) : (n.precision = t + 6, n.rounding = 1, i = i.div(new n(1).minus(i.times(i)).sqrt().plus(1)).atan(), n.precision = t, n.rounding = e, i.times(2)));
1314
1570
  };
1315
1571
  v.inverseTangent = v.atan = function() {
1316
1572
  var r, s, t, e, i, n, o, a, l, c = this, h = c.constructor, u = h.precision, f = h.rounding;
1317
1573
  if (c.isFinite()) {
1318
1574
  if (c.isZero())
1319
1575
  return new h(c);
1320
- if (c.abs().eq(1) && u + 4 <= he)
1321
- return o = J(h, u + 4, f).times(0.25), o.s = c.s, o;
1576
+ if (c.abs().eq(1) && u + 4 <= ge)
1577
+ return o = tt(h, u + 4, f).times(0.25), o.s = c.s, o;
1322
1578
  } else {
1323
1579
  if (!c.s) return new h(NaN);
1324
- if (u + 4 <= he)
1325
- return o = J(h, u + 4, f).times(0.5), o.s = c.s, o;
1580
+ if (u + 4 <= ge)
1581
+ return o = tt(h, u + 4, f).times(0.5), o.s = c.s, o;
1326
1582
  }
1327
1583
  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));
1328
- for (_ = !1, s = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), i = c; r !== -1; )
1584
+ for (E = !1, s = Math.ceil(a / S), e = 1, l = c.times(c), o = new h(c), i = c; r !== -1; )
1329
1585
  if (i = i.times(l), n = o.minus(i.div(e += 2)), i = i.times(l), o = n.plus(i.div(e += 2)), o.d[s] !== void 0) for (r = s; o.d[r] === n.d[r] && r--; ) ;
1330
- return t && (o = o.times(2 << t - 1)), _ = !0, P(o, h.precision = u, h.rounding = f, !0);
1586
+ return t && (o = o.times(2 << t - 1)), E = !0, C(o, h.precision = u, h.rounding = f, !0);
1331
1587
  };
1332
1588
  v.isFinite = function() {
1333
1589
  return !!this.d;
@@ -1370,14 +1626,14 @@ v.logarithm = v.log = function(r) {
1370
1626
  for (i = t[0]; i % 10 === 0; ) i /= 10;
1371
1627
  n = i !== 1;
1372
1628
  }
1373
- if (_ = !1, a = u + m, o = at(c, a), e = s ? Wt(h, a + 10) : at(r, a), l = R(o, e, a, 1), Vt(l.d, i = u, f))
1629
+ if (E = !1, a = u + m, o = at(c, a), e = s ? Qt(h, a + 10) : at(r, a), l = V(o, e, a, 1), kt(l.d, i = u, f))
1374
1630
  do
1375
- if (a += 10, o = at(c, a), e = s ? Wt(h, a + 10) : at(r, a), l = R(o, e, a, 1), !n) {
1376
- +T(l.d).slice(i + 1, i + 15) + 1 == 1e14 && (l = P(l, u + 1, 0));
1631
+ if (a += 10, o = at(c, a), e = s ? Qt(h, a + 10) : at(r, a), l = V(o, e, a, 1), !n) {
1632
+ +N(l.d).slice(i + 1, i + 15) + 1 == 1e14 && (l = C(l, u + 1, 0));
1377
1633
  break;
1378
1634
  }
1379
- while (Vt(l.d, i += 10, f));
1380
- return _ = !0, P(l, u, f);
1635
+ while (kt(l.d, i += 10, f));
1636
+ return E = !0, C(l, u, f);
1381
1637
  };
1382
1638
  v.minus = v.sub = function(r) {
1383
1639
  var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.constructor;
@@ -1389,7 +1645,7 @@ v.minus = v.sub = function(r) {
1389
1645
  if (f[0]) r.s = -r.s;
1390
1646
  else if (c[0]) r = new p(m);
1391
1647
  else return new p(l === 3 ? -0 : 0);
1392
- return _ ? P(r, a, l) : r;
1648
+ return E ? C(r, a, l) : r;
1393
1649
  }
1394
1650
  if (t = F(r.e / S), h = F(m.e / S), c = c.slice(), n = h - t, n) {
1395
1651
  for (u = n < 0, u ? (s = c, n = -n, o = f.length) : (s = f, t = h, o = c.length), e = Math.max(Math.ceil(a / S), o) + 2, n > e && (n = e, s.length = 1), s.reverse(), e = n; e--; ) s.push(0);
@@ -1405,28 +1661,28 @@ v.minus = v.sub = function(r) {
1405
1661
  for (u && (s = c, c = f, f = s, r.s = -r.s), o = c.length, e = f.length - o; e > 0; --e) c[o++] = 0;
1406
1662
  for (e = f.length; e > n; ) {
1407
1663
  if (c[--e] < f[e]) {
1408
- for (i = e; i && c[--i] === 0; ) c[i] = $ - 1;
1409
- --c[i], c[e] += $;
1664
+ for (i = e; i && c[--i] === 0; ) c[i] = Q - 1;
1665
+ --c[i], c[e] += Q;
1410
1666
  }
1411
1667
  c[e] -= f[e];
1412
1668
  }
1413
1669
  for (; c[--o] === 0; ) c.pop();
1414
1670
  for (; c[0] === 0; c.shift()) --t;
1415
- return c[0] ? (r.d = c, r.e = Qt(c, t), _ ? P(r, a, l) : r) : new p(l === 3 ? -0 : 0);
1671
+ return c[0] ? (r.d = c, r.e = ie(c, t), E ? C(r, a, l) : r) : new p(l === 3 ? -0 : 0);
1416
1672
  };
1417
1673
  v.modulo = v.mod = function(r) {
1418
1674
  var s, t = this, e = t.constructor;
1419
- return r = new e(r), !t.d || !r.s || r.d && !r.d[0] ? new e(NaN) : !r.d || t.d && !t.d[0] ? P(new e(t), e.precision, e.rounding) : (_ = !1, e.modulo == 9 ? (s = R(t, r.abs(), 0, 3, 1), s.s *= r.s) : s = R(t, r, 0, e.modulo, 1), s = s.times(r), _ = !0, t.minus(s));
1675
+ 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 ? (s = V(t, r.abs(), 0, 3, 1), s.s *= r.s) : s = V(t, r, 0, e.modulo, 1), s = s.times(r), E = !0, t.minus(s));
1420
1676
  };
1421
1677
  v.naturalExponential = v.exp = function() {
1422
- return ue(this);
1678
+ return pe(this);
1423
1679
  };
1424
1680
  v.naturalLogarithm = v.ln = function() {
1425
1681
  return at(this);
1426
1682
  };
1427
1683
  v.negated = v.neg = function() {
1428
1684
  var r = new this.constructor(this);
1429
- return r.s = -r.s, P(r);
1685
+ return r.s = -r.s, C(r);
1430
1686
  };
1431
1687
  v.plus = v.add = function(r) {
1432
1688
  var s, t, e, i, n, o, a, l, c, h, u = this, f = u.constructor;
@@ -1435,50 +1691,50 @@ v.plus = v.add = function(r) {
1435
1691
  if (u.s != r.s)
1436
1692
  return r.s = -r.s, u.minus(r);
1437
1693
  if (c = u.d, h = r.d, a = f.precision, l = f.rounding, !c[0] || !h[0])
1438
- return h[0] || (r = new f(u)), _ ? P(r, a, l) : r;
1694
+ return h[0] || (r = new f(u)), E ? C(r, a, l) : r;
1439
1695
  if (n = F(u.e / S), e = F(r.e / S), c = c.slice(), i = n - e, i) {
1440
1696
  for (i < 0 ? (t = c, i = -i, o = h.length) : (t = h, e = n, o = c.length), n = Math.ceil(a / S), o = n > o ? n + 1 : o + 1, i > o && (i = o, t.length = 1), t.reverse(); i--; ) t.push(0);
1441
1697
  t.reverse();
1442
1698
  }
1443
1699
  for (o = c.length, i = h.length, o - i < 0 && (i = o, t = h, h = c, c = t), s = 0; i; )
1444
- s = (c[--i] = c[i] + h[i] + s) / $ | 0, c[i] %= $;
1700
+ s = (c[--i] = c[i] + h[i] + s) / Q | 0, c[i] %= Q;
1445
1701
  for (s && (c.unshift(s), ++e), o = c.length; c[--o] == 0; ) c.pop();
1446
- return r.d = c, r.e = Qt(c, e), _ ? P(r, a, l) : r;
1702
+ return r.d = c, r.e = ie(c, e), E ? C(r, a, l) : r;
1447
1703
  };
1448
1704
  v.precision = v.sd = function(r) {
1449
1705
  var s, t = this;
1450
- if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ct + r);
1451
- return t.d ? (s = Le(t.d), r && t.e + 1 > s && (s = t.e + 1)) : s = NaN, s;
1706
+ if (r !== void 0 && r !== !!r && r !== 1 && r !== 0) throw Error(ht + r);
1707
+ return t.d ? (s = Be(t.d), r && t.e + 1 > s && (s = t.e + 1)) : s = NaN, s;
1452
1708
  };
1453
1709
  v.round = function() {
1454
1710
  var r = this, s = r.constructor;
1455
- return P(new s(r), r.e + 1, s.rounding);
1711
+ return C(new s(r), r.e + 1, s.rounding);
1456
1712
  };
1457
1713
  v.sine = v.sin = function() {
1458
1714
  var r, s, t = this, e = t.constructor;
1459
- return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = ai(e, Be(e, t)), e.precision = r, e.rounding = s, P(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
1715
+ return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + Math.max(t.e, t.sd()) + S, e.rounding = 1, t = di(e, ze(e, t)), e.precision = r, e.rounding = s, C(nt > 2 ? t.neg() : t, r, s, !0)) : new e(NaN);
1460
1716
  };
1461
1717
  v.squareRoot = v.sqrt = function() {
1462
1718
  var r, s, t, e, i, n, o = this, a = o.d, l = o.e, c = o.s, h = o.constructor;
1463
1719
  if (c !== 1 || !a || !a[0])
1464
1720
  return new h(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
1465
- for (_ = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (s = T(a), (s.length + l) % 2 == 0 && (s += "0"), c = Math.sqrt(s), l = F((l + 1) / 2) - (l < 0 || l % 2), c == 1 / 0 ? s = "5e" + l : (s = c.toExponential(), s = s.slice(0, s.indexOf("e") + 1) + l), e = new h(s)) : e = new h(c.toString()), t = (l = h.precision) + 3; ; )
1466
- if (n = e, e = n.plus(R(o, n, t + 2, 1)).times(0.5), T(n.d).slice(0, t) === (s = T(e.d)).slice(0, t))
1721
+ for (E = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (s = N(a), (s.length + l) % 2 == 0 && (s += "0"), c = Math.sqrt(s), l = F((l + 1) / 2) - (l < 0 || l % 2), c == 1 / 0 ? s = "5e" + l : (s = c.toExponential(), s = s.slice(0, s.indexOf("e") + 1) + l), e = new h(s)) : e = new h(c.toString()), t = (l = h.precision) + 3; ; )
1722
+ if (n = e, e = n.plus(V(o, n, t + 2, 1)).times(0.5), N(n.d).slice(0, t) === (s = N(e.d)).slice(0, t))
1467
1723
  if (s = s.slice(t - 3, t + 1), s == "9999" || !i && s == "4999") {
1468
- if (!i && (P(n, l + 1, 0), n.times(n).eq(o))) {
1724
+ if (!i && (C(n, l + 1, 0), n.times(n).eq(o))) {
1469
1725
  e = n;
1470
1726
  break;
1471
1727
  }
1472
1728
  t += 4, i = 1;
1473
1729
  } else {
1474
- (!+s || !+s.slice(1) && s.charAt(0) == "5") && (P(e, l + 1, 1), r = !e.times(e).eq(o));
1730
+ (!+s || !+s.slice(1) && s.charAt(0) == "5") && (C(e, l + 1, 1), r = !e.times(e).eq(o));
1475
1731
  break;
1476
1732
  }
1477
- return _ = !0, P(e, l, h.rounding, r);
1733
+ return E = !0, C(e, l, h.rounding, r);
1478
1734
  };
1479
1735
  v.tangent = v.tan = function() {
1480
1736
  var r, s, t = this, e = t.constructor;
1481
- return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t = R(t, new e(1).minus(t.times(t)).sqrt(), r + 10, 0), e.precision = r, e.rounding = s, P(nt == 2 || nt == 4 ? t.neg() : t, r, s, !0)) : new e(NaN);
1737
+ return t.isFinite() ? t.isZero() ? new e(t) : (r = e.precision, s = e.rounding, e.precision = r + 10, e.rounding = 1, t = t.sin(), t.s = 1, t = V(t, new e(1).minus(t.times(t)).sqrt(), r + 10, 0), e.precision = r, e.rounding = s, C(nt == 2 || nt == 4 ? t.neg() : t, r, s, !0)) : new e(NaN);
1482
1738
  };
1483
1739
  v.times = v.mul = function(r) {
1484
1740
  var s, t, e, i, n, o, a, l, c, h = this, u = h.constructor, f = h.d, m = (r = new u(r)).d;
@@ -1487,42 +1743,42 @@ v.times = v.mul = function(r) {
1487
1743
  for (t = F(h.e / S) + F(r.e / S), l = f.length, c = m.length, l < c && (n = f, f = m, m = n, o = l, l = c, c = o), n = [], o = l + c, e = o; e--; ) n.push(0);
1488
1744
  for (e = c; --e >= 0; ) {
1489
1745
  for (s = 0, i = l + e; i > e; )
1490
- a = n[i] + m[e] * f[i - e - 1] + s, n[i--] = a % $ | 0, s = a / $ | 0;
1491
- n[i] = (n[i] + s) % $ | 0;
1746
+ a = n[i] + m[e] * f[i - e - 1] + s, n[i--] = a % Q | 0, s = a / Q | 0;
1747
+ n[i] = (n[i] + s) % Q | 0;
1492
1748
  }
1493
1749
  for (; !n[--o]; ) n.pop();
1494
- return s ? ++t : n.shift(), r.d = n, r.e = Qt(n, t), _ ? P(r, u.precision, u.rounding) : r;
1750
+ return s ? ++t : n.shift(), r.d = n, r.e = ie(n, t), E ? C(r, u.precision, u.rounding) : r;
1495
1751
  };
1496
1752
  v.toBinary = function(r, s) {
1497
- return ge(this, 2, r, s);
1753
+ return ye(this, 2, r, s);
1498
1754
  };
1499
1755
  v.toDecimalPlaces = v.toDP = function(r, s) {
1500
1756
  var t = this, e = t.constructor;
1501
- return t = new e(t), r === void 0 ? t : (G(r, 0, ht), s === void 0 ? s = e.rounding : G(s, 0, 8), P(t, r + t.e + 1, s));
1757
+ return t = new e(t), r === void 0 ? t : (U(r, 0, ut), s === void 0 ? s = e.rounding : U(s, 0, 8), C(t, r + t.e + 1, s));
1502
1758
  };
1503
1759
  v.toExponential = function(r, s) {
1504
1760
  var t, e = this, i = e.constructor;
1505
- return r === void 0 ? t = K(e, !0) : (G(r, 0, ht), s === void 0 ? s = i.rounding : G(s, 0, 8), e = P(new i(e), r + 1, s), t = K(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
1761
+ return r === void 0 ? t = et(e, !0) : (U(r, 0, ut), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r + 1, s), t = et(e, !0, r + 1)), e.isNeg() && !e.isZero() ? "-" + t : t;
1506
1762
  };
1507
1763
  v.toFixed = function(r, s) {
1508
1764
  var t, e, i = this, n = i.constructor;
1509
- return r === void 0 ? t = K(i) : (G(r, 0, ht), s === void 0 ? s = n.rounding : G(s, 0, 8), e = P(new n(i), r + i.e + 1, s), t = K(e, !1, r + e.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
1765
+ return r === void 0 ? t = et(i) : (U(r, 0, ut), s === void 0 ? s = n.rounding : U(s, 0, 8), e = C(new n(i), r + i.e + 1, s), t = et(e, !1, r + e.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
1510
1766
  };
1511
1767
  v.toFraction = function(r) {
1512
1768
  var s, t, e, i, n, o, a, l, c, h, u, f, m = this, p = m.d, g = m.constructor;
1513
1769
  if (!p) return new g(m);
1514
- if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e = Le(p) - m.e - 1, o = n % S, s.d[0] = I(10, o < 0 ? S + o : o), r == null)
1770
+ if (c = t = new g(1), e = l = new g(0), s = new g(e), n = s.e = Be(p) - m.e - 1, o = n % S, s.d[0] = I(10, o < 0 ? S + o : o), r == null)
1515
1771
  r = n > 0 ? s : c;
1516
1772
  else {
1517
- if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ct + a);
1773
+ if (a = new g(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
1518
1774
  r = a.gt(s) ? n > 0 ? s : c : a;
1519
1775
  }
1520
- for (_ = !1, a = new g(T(p)), h = g.precision, g.precision = n = p.length * S * 2; u = R(a, s, 0, 1, 1), i = t.plus(u.times(e)), i.cmp(r) != 1; )
1776
+ for (E = !1, a = new g(N(p)), h = g.precision, g.precision = n = p.length * S * 2; u = V(a, s, 0, 1, 1), i = t.plus(u.times(e)), i.cmp(r) != 1; )
1521
1777
  t = e, e = i, i = c, c = l.plus(u.times(i)), l = i, i = s, s = a.minus(u.times(i)), a = i;
1522
- return i = R(r.minus(t), e, 0, 1, 1), l = l.plus(i.times(c)), t = t.plus(i.times(e)), l.s = c.s = m.s, f = R(c, e, n, 1).minus(m).abs().cmp(R(l, t, n, 1).minus(m).abs()) < 1 ? [c, e] : [l, t], g.precision = h, _ = !0, f;
1778
+ return i = V(r.minus(t), e, 0, 1, 1), l = l.plus(i.times(c)), t = t.plus(i.times(e)), l.s = c.s = m.s, f = V(c, e, n, 1).minus(m).abs().cmp(V(l, t, n, 1).minus(m).abs()) < 1 ? [c, e] : [l, t], g.precision = h, E = !0, f;
1523
1779
  };
1524
1780
  v.toHexadecimal = v.toHex = function(r, s) {
1525
- return ge(this, 16, r, s);
1781
+ return ye(this, 16, r, s);
1526
1782
  };
1527
1783
  v.toNearest = function(r, s) {
1528
1784
  var t = this, e = t.constructor;
@@ -1530,52 +1786,52 @@ v.toNearest = function(r, s) {
1530
1786
  if (!t.d) return t;
1531
1787
  r = new e(1), s = e.rounding;
1532
1788
  } else {
1533
- if (r = new e(r), s === void 0 ? s = e.rounding : G(s, 0, 8), !t.d) return r.s ? t : r;
1789
+ if (r = new e(r), s === void 0 ? s = e.rounding : U(s, 0, 8), !t.d) return r.s ? t : r;
1534
1790
  if (!r.d)
1535
1791
  return r.s && (r.s = t.s), r;
1536
1792
  }
1537
- return r.d[0] ? (_ = !1, t = R(t, r, 0, s, 1).times(r), _ = !0, P(t)) : (r.s = t.s, t = r), t;
1793
+ return r.d[0] ? (E = !1, t = V(t, r, 0, s, 1).times(r), E = !0, C(t)) : (r.s = t.s, t = r), t;
1538
1794
  };
1539
1795
  v.toNumber = function() {
1540
1796
  return +this;
1541
1797
  };
1542
1798
  v.toOctal = function(r, s) {
1543
- return ge(this, 8, r, s);
1799
+ return ye(this, 8, r, s);
1544
1800
  };
1545
1801
  v.toPower = v.pow = function(r) {
1546
1802
  var s, t, e, i, n, o, a = this, l = a.constructor, c = +(r = new l(r));
1547
1803
  if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(I(+a, c));
1548
1804
  if (a = new l(a), a.eq(1)) return a;
1549
- if (e = l.precision, n = l.rounding, r.eq(1)) return P(a, e, n);
1550
- if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <= si)
1551
- return i = Te(l, a, t, e), r.s < 0 ? new l(1).div(i) : P(i, e, n);
1805
+ if (e = l.precision, n = l.rounding, r.eq(1)) return C(a, e, n);
1806
+ if (s = F(r.e / S), s >= r.d.length - 1 && (t = c < 0 ? -c : c) <= li)
1807
+ return i = Ge(l, a, t, e), r.s < 0 ? new l(1).div(i) : C(i, e, n);
1552
1808
  if (o = a.s, o < 0) {
1553
1809
  if (s < r.d.length - 1) return new l(NaN);
1554
1810
  if (r.d[s] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
1555
1811
  return a.s = o, a;
1556
1812
  }
1557
- return t = I(+a, c), s = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + T(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, s > l.maxE + 1 || s < l.minE - 1 ? new l(s > 0 ? o / 0 : 0) : (_ = !1, l.rounding = a.s = 1, t = Math.min(12, (s + "").length), i = ue(r.times(at(a, e + t)), e), i.d && (i = P(i, e + 5, 1), Vt(i.d, e, n) && (s = e + 10, i = P(ue(r.times(at(a, s + t)), s), s + 5, 1), +T(i.d).slice(e + 1, e + 15) + 1 == 1e14 && (i = P(i, e + 1, 0)))), i.s = o, _ = !0, l.rounding = n, P(i, e, n));
1813
+ return t = I(+a, c), s = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, s > l.maxE + 1 || s < l.minE - 1 ? new l(s > 0 ? o / 0 : 0) : (E = !1, l.rounding = a.s = 1, t = Math.min(12, (s + "").length), i = pe(r.times(at(a, e + t)), e), i.d && (i = C(i, e + 5, 1), kt(i.d, e, n) && (s = e + 10, i = C(pe(r.times(at(a, s + t)), s), s + 5, 1), +N(i.d).slice(e + 1, e + 15) + 1 == 1e14 && (i = C(i, e + 1, 0)))), i.s = o, E = !0, l.rounding = n, C(i, e, n));
1558
1814
  };
1559
1815
  v.toPrecision = function(r, s) {
1560
1816
  var t, e = this, i = e.constructor;
1561
- return r === void 0 ? t = K(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (G(r, 1, ht), s === void 0 ? s = i.rounding : G(s, 0, 8), e = P(new i(e), r, s), t = K(e, r <= e.e || e.e <= i.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
1817
+ return r === void 0 ? t = et(e, e.e <= i.toExpNeg || e.e >= i.toExpPos) : (U(r, 1, ut), s === void 0 ? s = i.rounding : U(s, 0, 8), e = C(new i(e), r, s), t = et(e, r <= e.e || e.e <= i.toExpNeg, r)), e.isNeg() && !e.isZero() ? "-" + t : t;
1562
1818
  };
1563
1819
  v.toSignificantDigits = v.toSD = function(r, s) {
1564
1820
  var t = this, e = t.constructor;
1565
- return r === void 0 ? (r = e.precision, s = e.rounding) : (G(r, 1, ht), s === void 0 ? s = e.rounding : G(s, 0, 8)), P(new e(t), r, s);
1821
+ return r === void 0 ? (r = e.precision, s = e.rounding) : (U(r, 1, ut), s === void 0 ? s = e.rounding : U(s, 0, 8)), C(new e(t), r, s);
1566
1822
  };
1567
1823
  v.toString = function() {
1568
- var r = this, s = r.constructor, t = K(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
1824
+ var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
1569
1825
  return r.isNeg() && !r.isZero() ? "-" + t : t;
1570
1826
  };
1571
1827
  v.truncated = v.trunc = function() {
1572
- return P(new this.constructor(this), this.e + 1, 1);
1828
+ return C(new this.constructor(this), this.e + 1, 1);
1573
1829
  };
1574
1830
  v.valueOf = v.toJSON = function() {
1575
- var r = this, s = r.constructor, t = K(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
1831
+ var r = this, s = r.constructor, t = et(r, r.e <= s.toExpNeg || r.e >= s.toExpPos);
1576
1832
  return r.isNeg() ? "-" + t : t;
1577
1833
  };
1578
- function T(r) {
1834
+ function N(r) {
1579
1835
  var s, t, e, i = r.length - 1, n = "", o = r[0];
1580
1836
  if (i > 0) {
1581
1837
  for (n += o, s = 1; s < i; s++)
@@ -1586,34 +1842,34 @@ function T(r) {
1586
1842
  for (; o % 10 === 0; ) o /= 10;
1587
1843
  return n + o;
1588
1844
  }
1589
- function G(r, s, t) {
1845
+ function U(r, s, t) {
1590
1846
  if (r !== ~~r || r < s || r > t)
1591
- throw Error(ct + r);
1847
+ throw Error(ht + r);
1592
1848
  }
1593
- function Vt(r, s, t, e) {
1849
+ function kt(r, s, t, e) {
1594
1850
  var i, n, o, a;
1595
1851
  for (n = r[0]; n >= 10; n /= 10) --s;
1596
1852
  return --s < 0 ? (s += S, i = 0) : (i = Math.ceil((s + 1) / S), s %= S), n = I(10, S - s), a = r[i] % n | 0, e == null ? s < 3 ? (s == 0 ? a = a / 100 | 0 : s == 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[i + 1] / n / 100 | 0) == I(10, s - 2) - 1 || (a == n / 2 || a == 0) && (r[i + 1] / n / 100 | 0) == 0 : s < 4 ? (s == 0 ? a = a / 1e3 | 0 : s == 1 ? a = a / 100 | 0 : s == 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[i + 1] / n / 1e3 | 0) == I(10, s - 3) - 1, o;
1597
1853
  }
1598
- function Tt(r, s, t) {
1854
+ function Ft(r, s, t) {
1599
1855
  for (var e, i = [0], n, o = 0, a = r.length; o < a; ) {
1600
1856
  for (n = i.length; n--; ) i[n] *= s;
1601
- for (i[0] += le.indexOf(r.charAt(o++)), e = 0; e < i.length; e++)
1857
+ for (i[0] += fe.indexOf(r.charAt(o++)), e = 0; e < i.length; e++)
1602
1858
  i[e] > t - 1 && (i[e + 1] === void 0 && (i[e + 1] = 0), i[e + 1] += i[e] / t | 0, i[e] %= t);
1603
1859
  }
1604
1860
  return i.reverse();
1605
1861
  }
1606
- function ri(r, s) {
1862
+ function hi(r, s) {
1607
1863
  var t, e, i;
1608
1864
  if (s.isZero()) return s;
1609
- e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / Jt(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s = Mt(r, 1, s.times(i), new r(1));
1865
+ e = s.d.length, e < 32 ? (t = Math.ceil(e / 3), i = (1 / se(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), r.precision += t, s = Mt(r, 1, s.times(i), new r(1));
1610
1866
  for (var n = t; n--; ) {
1611
1867
  var o = s.times(s);
1612
1868
  s = o.times(o).minus(o).times(8).plus(1);
1613
1869
  }
1614
1870
  return r.precision -= t, s;
1615
1871
  }
1616
- var R = /* @__PURE__ */ function() {
1872
+ var V = /* @__PURE__ */ function() {
1617
1873
  function r(e, i, n) {
1618
1874
  var o, a = 0, l = e.length;
1619
1875
  for (e = e.slice(); l--; )
@@ -1638,43 +1894,43 @@ var R = /* @__PURE__ */ function() {
1638
1894
  for (; !e[0] && e.length > 1; ) e.shift();
1639
1895
  }
1640
1896
  return function(e, i, n, o, a, l) {
1641
- var c, h, u, f, m, p, g, y, w, b, C, M, A, U, kt, ut, rt, vt, z, Ot, At = e.constructor, te = e.s == i.s ? 1 : -1, H = e.d, k = i.d;
1642
- if (!H || !H[0] || !k || !k[0])
1643
- return new At(
1897
+ var c, h, u, f, m, p, g, y, w, P, b, _, A, X, At, dt, rt, vt, z, Lt, Tt = e.constructor, ne = e.s == i.s ? 1 : -1, H = e.d, O = i.d;
1898
+ if (!H || !H[0] || !O || !O[0])
1899
+ return new Tt(
1644
1900
  // Return NaN if either NaN, or both Infinity or 0.
1645
- !e.s || !i.s || (H ? k && H[0] == k[0] : !k) ? NaN : (
1901
+ !e.s || !i.s || (H ? O && H[0] == O[0] : !O) ? NaN : (
1646
1902
  // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
1647
- H && H[0] == 0 || !k ? te * 0 : te / 0
1903
+ H && H[0] == 0 || !O ? ne * 0 : ne / 0
1648
1904
  )
1649
1905
  );
1650
- for (l ? (m = 1, h = e.e - i.e) : (l = $, m = S, h = F(e.e / m) - F(i.e / m)), z = k.length, rt = H.length, w = new At(te), b = w.d = [], u = 0; k[u] == (H[u] || 0); u++) ;
1651
- if (k[u] > (H[u] || 0) && h--, n == null ? (U = n = At.precision, o = At.rounding) : a ? U = n + (e.e - i.e) + 1 : U = n, U < 0)
1652
- b.push(1), p = !0;
1906
+ for (l ? (m = 1, h = e.e - i.e) : (l = Q, m = S, h = F(e.e / m) - F(i.e / m)), z = O.length, rt = H.length, w = new Tt(ne), P = w.d = [], u = 0; O[u] == (H[u] || 0); u++) ;
1907
+ if (O[u] > (H[u] || 0) && h--, n == null ? (X = n = Tt.precision, o = Tt.rounding) : a ? X = n + (e.e - i.e) + 1 : X = n, X < 0)
1908
+ P.push(1), p = !0;
1653
1909
  else {
1654
- if (U = U / m + 2 | 0, u = 0, z == 1) {
1655
- for (f = 0, k = k[0], U++; (u < rt || f) && U--; u++)
1656
- kt = f * l + (H[u] || 0), b[u] = kt / k | 0, f = kt % k | 0;
1910
+ if (X = X / m + 2 | 0, u = 0, z == 1) {
1911
+ for (f = 0, O = O[0], X++; (u < rt || f) && X--; u++)
1912
+ At = f * l + (H[u] || 0), P[u] = At / O | 0, f = At % O | 0;
1657
1913
  p = f || u < rt;
1658
1914
  } else {
1659
- for (f = l / (k[0] + 1) | 0, f > 1 && (k = r(k, f, l), H = r(H, f, l), z = k.length, rt = H.length), ut = z, C = H.slice(0, z), M = C.length; M < z; ) C[M++] = 0;
1660
- Ot = k.slice(), Ot.unshift(0), vt = k[0], k[1] >= l / 2 && ++vt;
1915
+ for (f = l / (O[0] + 1) | 0, f > 1 && (O = r(O, f, l), H = r(H, f, l), z = O.length, rt = H.length), dt = z, b = H.slice(0, z), _ = b.length; _ < z; ) b[_++] = 0;
1916
+ Lt = O.slice(), Lt.unshift(0), vt = O[0], O[1] >= l / 2 && ++vt;
1661
1917
  do
1662
- f = 0, c = s(k, C, z, M), c < 0 ? (A = C[0], z != M && (A = A * l + (C[1] || 0)), f = A / vt | 0, f > 1 ? (f >= l && (f = l - 1), g = r(k, f, l), y = g.length, M = C.length, c = s(g, C, y, M), c == 1 && (f--, t(g, z < y ? Ot : k, y, l))) : (f == 0 && (c = f = 1), g = k.slice()), y = g.length, y < M && g.unshift(0), t(C, g, M, l), c == -1 && (M = C.length, c = s(k, C, z, M), c < 1 && (f++, t(C, z < M ? Ot : k, M, l))), M = C.length) : c === 0 && (f++, C = [0]), b[u++] = f, c && C[0] ? C[M++] = H[ut] || 0 : (C = [H[ut]], M = 1);
1663
- while ((ut++ < rt || C[0] !== void 0) && U--);
1664
- p = C[0] !== void 0;
1918
+ f = 0, c = s(O, b, z, _), c < 0 ? (A = b[0], z != _ && (A = A * l + (b[1] || 0)), f = A / vt | 0, f > 1 ? (f >= l && (f = l - 1), g = r(O, f, l), y = g.length, _ = b.length, c = s(g, b, y, _), c == 1 && (f--, t(g, z < y ? Lt : O, y, l))) : (f == 0 && (c = f = 1), g = O.slice()), y = g.length, y < _ && g.unshift(0), t(b, g, _, l), c == -1 && (_ = b.length, c = s(O, b, z, _), c < 1 && (f++, t(b, z < _ ? Lt : O, _, l))), _ = b.length) : c === 0 && (f++, b = [0]), P[u++] = f, c && b[0] ? b[_++] = H[dt] || 0 : (b = [H[dt]], _ = 1);
1919
+ while ((dt++ < rt || b[0] !== void 0) && X--);
1920
+ p = b[0] !== void 0;
1665
1921
  }
1666
- b[0] || b.shift();
1922
+ P[0] || P.shift();
1667
1923
  }
1668
1924
  if (m == 1)
1669
- w.e = h, ke = p;
1925
+ w.e = h, Te = p;
1670
1926
  else {
1671
- for (u = 1, f = b[0]; f >= 10; f /= 10) u++;
1672
- w.e = u + h * m - 1, P(w, a ? n + w.e + 1 : n, o, p);
1927
+ for (u = 1, f = P[0]; f >= 10; f /= 10) u++;
1928
+ w.e = u + h * m - 1, C(w, a ? n + w.e + 1 : n, o, p);
1673
1929
  }
1674
1930
  return w;
1675
1931
  };
1676
1932
  }();
1677
- function P(r, s, t, e) {
1933
+ function C(r, s, t, e) {
1678
1934
  var i, n, o, a, l, c, h, u, f, m = r.constructor;
1679
1935
  t: if (s != null) {
1680
1936
  if (u = r.d, !u) return r;
@@ -1699,36 +1955,36 @@ function P(r, s, t, e) {
1699
1955
  if (f == 0) {
1700
1956
  for (n = 1, o = u[0]; o >= 10; o /= 10) n++;
1701
1957
  for (o = u[0] += a, a = 1; o >= 10; o /= 10) a++;
1702
- n != a && (r.e++, u[0] == $ && (u[0] = 1));
1958
+ n != a && (r.e++, u[0] == Q && (u[0] = 1));
1703
1959
  break;
1704
1960
  } else {
1705
- if (u[f] += a, u[f] != $) break;
1961
+ if (u[f] += a, u[f] != Q) break;
1706
1962
  u[f--] = 0, a = 1;
1707
1963
  }
1708
1964
  for (n = u.length; u[--n] === 0; ) u.pop();
1709
1965
  }
1710
- return _ && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
1966
+ return E && (r.e > m.maxE ? (r.d = null, r.e = NaN) : r.e < m.minE && (r.e = 0, r.d = [0])), r;
1711
1967
  }
1712
- function K(r, s, t) {
1713
- if (!r.isFinite()) return Fe(r);
1714
- var e, i = r.e, n = T(r.d), o = n.length;
1968
+ function et(r, s, t) {
1969
+ if (!r.isFinite()) return Xe(r);
1970
+ var e, i = r.e, n = N(r.d), o = n.length;
1715
1971
  return s ? (t && (e = t - o) > 0 ? n = n.charAt(0) + "." + n.slice(1) + ot(e) : o > 1 && (n = n.charAt(0) + "." + n.slice(1)), n = n + (r.e < 0 ? "e" : "e+") + r.e) : i < 0 ? (n = "0." + ot(-i - 1) + n, t && (e = t - o) > 0 && (n += ot(e))) : i >= o ? (n += ot(i + 1 - o), t && (e = t - i - 1) > 0 && (n = n + "." + ot(e))) : ((e = i + 1) < o && (n = n.slice(0, e) + "." + n.slice(e)), t && (e = t - o) > 0 && (i + 1 === o && (n += "."), n += ot(e))), n;
1716
1972
  }
1717
- function Qt(r, s) {
1973
+ function ie(r, s) {
1718
1974
  var t = r[0];
1719
1975
  for (s *= S; t >= 10; t /= 10) s++;
1720
1976
  return s;
1721
1977
  }
1722
- function Wt(r, s, t) {
1723
- if (s > ni)
1724
- throw _ = !0, t && (r.precision = t), Error(Oe);
1725
- return P(new r(Yt), s, 1, !0);
1978
+ function Qt(r, s, t) {
1979
+ if (s > ci)
1980
+ throw E = !0, t && (r.precision = t), Error(Ie);
1981
+ return C(new r($t), s, 1, !0);
1726
1982
  }
1727
- function J(r, s, t) {
1728
- if (s > he) throw Error(Oe);
1729
- return P(new r(jt), s, t, !0);
1983
+ function tt(r, s, t) {
1984
+ if (s > ge) throw Error(Ie);
1985
+ return C(new r(Zt), s, t, !0);
1730
1986
  }
1731
- function Le(r) {
1987
+ function Be(r) {
1732
1988
  var s = r.length - 1, t = s * S + 1;
1733
1989
  if (s = r[s], s) {
1734
1990
  for (; s % 10 == 0; s /= 10) t--;
@@ -1740,21 +1996,21 @@ function ot(r) {
1740
1996
  for (var s = ""; r--; ) s += "0";
1741
1997
  return s;
1742
1998
  }
1743
- function Te(r, s, t, e) {
1999
+ function Ge(r, s, t, e) {
1744
2000
  var i, n = new r(1), o = Math.ceil(e / S + 4);
1745
- for (_ = !1; ; ) {
1746
- if (t % 2 && (n = n.times(s), Pe(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
2001
+ for (E = !1; ; ) {
2002
+ if (t % 2 && (n = n.times(s), Ee(n.d, o) && (i = !0)), t = F(t / 2), t === 0) {
1747
2003
  t = n.d.length - 1, i && n.d[t] === 0 && ++n.d[t];
1748
2004
  break;
1749
2005
  }
1750
- s = s.times(s), Pe(s.d, o);
2006
+ s = s.times(s), Ee(s.d, o);
1751
2007
  }
1752
- return _ = !0, n;
2008
+ return E = !0, n;
1753
2009
  }
1754
- function xe(r) {
2010
+ function Se(r) {
1755
2011
  return r.d[r.d.length - 1] & 1;
1756
2012
  }
1757
- function He(r, s, t) {
2013
+ function Ue(r, s, t) {
1758
2014
  for (var e, i, n = new r(s[0]), o = 0; ++o < s.length; ) {
1759
2015
  if (i = new r(s[o]), !i.s) {
1760
2016
  n = i;
@@ -1764,20 +2020,20 @@ function He(r, s, t) {
1764
2020
  }
1765
2021
  return n;
1766
2022
  }
1767
- function ue(r, s) {
2023
+ function pe(r, s) {
1768
2024
  var t, e, i, n, o, a, l, c = 0, h = 0, u = 0, f = r.constructor, m = f.rounding, p = f.precision;
1769
2025
  if (!r.d || !r.d[0] || r.e > 17)
1770
2026
  return new f(r.d ? r.d[0] ? r.s < 0 ? 0 : 1 / 0 : 1 : r.s ? r.s < 0 ? 0 : r : NaN);
1771
- for (s == null ? (_ = !1, l = p) : l = s, a = new f(0.03125); r.e > -2; )
2027
+ for (s == null ? (E = !1, l = p) : l = s, a = new f(0.03125); r.e > -2; )
1772
2028
  r = r.times(a), u += 5;
1773
2029
  for (e = Math.log(I(2, u)) / Math.LN10 * 2 + 5 | 0, l += e, t = n = o = new f(1), f.precision = l; ; ) {
1774
- if (n = P(n.times(r), l, 1), t = t.times(++h), a = o.plus(R(n, t, l, 1)), T(a.d).slice(0, l) === T(o.d).slice(0, l)) {
1775
- for (i = u; i--; ) o = P(o.times(o), l, 1);
2030
+ if (n = C(n.times(r), l, 1), t = t.times(++h), a = o.plus(V(n, t, l, 1)), N(a.d).slice(0, l) === N(o.d).slice(0, l)) {
2031
+ for (i = u; i--; ) o = C(o.times(o), l, 1);
1776
2032
  if (s == null)
1777
- if (c < 3 && Vt(o.d, l - e, m, c))
2033
+ if (c < 3 && kt(o.d, l - e, m, c))
1778
2034
  f.precision = l += 10, t = n = a = new f(1), h = 0, c++;
1779
2035
  else
1780
- return P(o, f.precision = p, m, _ = !0);
2036
+ return C(o, f.precision = p, m, E = !0);
1781
2037
  else
1782
2038
  return f.precision = p, o;
1783
2039
  }
@@ -1785,31 +2041,31 @@ function ue(r, s) {
1785
2041
  }
1786
2042
  }
1787
2043
  function at(r, s) {
1788
- var t, e, i, n, o, a, l, c, h, u, f, m = 1, p = 10, g = r, y = g.d, w = g.constructor, b = w.rounding, C = w.precision;
2044
+ var t, e, i, n, o, a, l, c, h, u, f, m = 1, p = 10, g = r, y = g.d, w = g.constructor, P = w.rounding, b = w.precision;
1789
2045
  if (g.s < 0 || !y || !y[0] || !g.e && y[0] == 1 && y.length == 1)
1790
2046
  return new w(y && !y[0] ? -1 / 0 : g.s != 1 ? NaN : y ? 0 : g);
1791
- if (s == null ? (_ = !1, h = C) : h = s, w.precision = h += p, t = T(y), e = t.charAt(0), Math.abs(n = g.e) < 15e14) {
2047
+ if (s == null ? (E = !1, h = b) : h = s, w.precision = h += p, t = N(y), e = t.charAt(0), Math.abs(n = g.e) < 15e14) {
1792
2048
  for (; e < 7 && e != 1 || e == 1 && t.charAt(1) > 3; )
1793
- g = g.times(r), t = T(g.d), e = t.charAt(0), m++;
2049
+ g = g.times(r), t = N(g.d), e = t.charAt(0), m++;
1794
2050
  n = g.e, e > 1 ? (g = new w("0." + t), n++) : g = new w(e + "." + t.slice(1));
1795
2051
  } else
1796
- return c = Wt(w, h + 2, C).times(n + ""), g = at(new w(e + "." + t.slice(1)), h - p).plus(c), w.precision = C, s == null ? P(g, C, b, _ = !0) : g;
1797
- for (u = g, l = o = g = R(g.minus(1), g.plus(1), h, 1), f = P(g.times(g), h, 1), i = 3; ; ) {
1798
- if (o = P(o.times(f), h, 1), c = l.plus(R(o, new w(i), h, 1)), T(c.d).slice(0, h) === T(l.d).slice(0, h))
1799
- if (l = l.times(2), n !== 0 && (l = l.plus(Wt(w, h + 2, C).times(n + ""))), l = R(l, new w(m), h, 1), s == null)
1800
- if (Vt(l.d, h - p, b, a))
1801
- w.precision = h += p, c = o = g = R(u.minus(1), u.plus(1), h, 1), f = P(g.times(g), h, 1), i = a = 1;
2052
+ return c = Qt(w, h + 2, b).times(n + ""), g = at(new w(e + "." + t.slice(1)), h - p).plus(c), w.precision = b, s == null ? C(g, b, P, E = !0) : g;
2053
+ for (u = g, l = o = g = V(g.minus(1), g.plus(1), h, 1), f = C(g.times(g), h, 1), i = 3; ; ) {
2054
+ if (o = C(o.times(f), h, 1), c = l.plus(V(o, new w(i), h, 1)), N(c.d).slice(0, h) === N(l.d).slice(0, h))
2055
+ if (l = l.times(2), n !== 0 && (l = l.plus(Qt(w, h + 2, b).times(n + ""))), l = V(l, new w(m), h, 1), s == null)
2056
+ if (kt(l.d, h - p, P, a))
2057
+ w.precision = h += p, c = o = g = V(u.minus(1), u.plus(1), h, 1), f = C(g.times(g), h, 1), i = a = 1;
1802
2058
  else
1803
- return P(l, w.precision = C, b, _ = !0);
2059
+ return C(l, w.precision = b, P, E = !0);
1804
2060
  else
1805
- return w.precision = C, l;
2061
+ return w.precision = b, l;
1806
2062
  l = c, i += 2;
1807
2063
  }
1808
2064
  }
1809
- function Fe(r) {
2065
+ function Xe(r) {
1810
2066
  return String(r.s * r.s / 0);
1811
2067
  }
1812
- function Ht(r, s) {
2068
+ function Bt(r, s) {
1813
2069
  var t, e, i;
1814
2070
  for ((t = s.indexOf(".")) > -1 && (s = s.replace(".", "")), (e = s.search(/e/i)) > 0 ? (t < 0 && (t = e), t += +s.slice(e + 1), s = s.substring(0, e)) : t < 0 && (t = s.length), e = 0; s.charCodeAt(e) === 48; e++) ;
1815
2071
  for (i = s.length; s.charCodeAt(i - 1) === 48; --i) ;
@@ -1820,85 +2076,85 @@ function Ht(r, s) {
1820
2076
  } else
1821
2077
  e -= i;
1822
2078
  for (; e--; ) s += "0";
1823
- r.d.push(+s), _ && (r.e > r.constructor.maxE ? (r.d = null, r.e = NaN) : r.e < r.constructor.minE && (r.e = 0, r.d = [0]));
2079
+ r.d.push(+s), E && (r.e > r.constructor.maxE ? (r.d = null, r.e = NaN) : r.e < r.constructor.minE && (r.e = 0, r.d = [0]));
1824
2080
  } else
1825
2081
  r.e = 0, r.d = [0];
1826
2082
  return r;
1827
2083
  }
1828
- function oi(r, s) {
2084
+ function ui(r, s) {
1829
2085
  var t, e, i, n, o, a, l, c, h;
1830
2086
  if (s.indexOf("_") > -1) {
1831
- if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Ie.test(s)) return Ht(r, s);
2087
+ if (s = s.replace(/(\d)_(?=\d)/g, "$1"), Fe.test(s)) return Bt(r, s);
1832
2088
  } else if (s === "Infinity" || s === "NaN")
1833
2089
  return +s || (r.s = NaN), r.e = NaN, r.d = null, r;
1834
- if (ei.test(s))
2090
+ if (oi.test(s))
1835
2091
  t = 16, s = s.toLowerCase();
1836
- else if (ti.test(s))
2092
+ else if (ri.test(s))
1837
2093
  t = 2;
1838
- else if (ii.test(s))
2094
+ else if (ai.test(s))
1839
2095
  t = 8;
1840
2096
  else
1841
- throw Error(ct + s);
1842
- for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i = Te(e, new e(t), n, n * 2)), c = Tt(s, t, $), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
1843
- return n < 0 ? new e(r.s * 0) : (r.e = Qt(c, h), r.d = c, _ = !1, o && (r = R(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : D.pow(2, l))), _ = !0, r);
2097
+ throw Error(ht + s);
2098
+ for (n = s.search(/p/i), n > 0 ? (l = +s.slice(n + 1), s = s.substring(2, n)) : s = s.slice(2), n = s.indexOf("."), o = n >= 0, e = r.constructor, o && (s = s.replace(".", ""), a = s.length, n = a - n, i = Ge(e, new e(t), n, n * 2)), c = Ft(s, t, Q), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
2099
+ return n < 0 ? new e(r.s * 0) : (r.e = ie(c, h), r.d = c, E = !1, o && (r = V(r, i, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? I(2, l) : R.pow(2, l))), E = !0, r);
1844
2100
  }
1845
- function ai(r, s) {
2101
+ function di(r, s) {
1846
2102
  var t, e = s.d.length;
1847
2103
  if (e < 3)
1848
2104
  return s.isZero() ? s : Mt(r, 2, s, s);
1849
- t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / Jt(5, t)), s = Mt(r, 2, s, s);
2105
+ t = 1.4 * Math.sqrt(e), t = t > 16 ? 16 : t | 0, s = s.times(1 / se(5, t)), s = Mt(r, 2, s, s);
1850
2106
  for (var i, n = new r(5), o = new r(16), a = new r(20); t--; )
1851
2107
  i = s.times(s), s = s.times(n.plus(i.times(o.times(i).minus(a))));
1852
2108
  return s;
1853
2109
  }
1854
2110
  function Mt(r, s, t, e, i) {
1855
2111
  var n, o, a, l, c = r.precision, h = Math.ceil(c / S);
1856
- for (_ = !1, l = t.times(t), a = new r(e); ; ) {
1857
- if (o = R(a.times(l), new r(s++ * s++), c, 1), a = i ? e.plus(o) : e.minus(o), e = R(o.times(l), new r(s++ * s++), c, 1), o = a.plus(e), o.d[h] !== void 0) {
2112
+ for (E = !1, l = t.times(t), a = new r(e); ; ) {
2113
+ if (o = V(a.times(l), new r(s++ * s++), c, 1), a = i ? e.plus(o) : e.minus(o), e = V(o.times(l), new r(s++ * s++), c, 1), o = a.plus(e), o.d[h] !== void 0) {
1858
2114
  for (n = h; o.d[n] === a.d[n] && n--; ) ;
1859
2115
  if (n == -1) break;
1860
2116
  }
1861
2117
  n = a, a = e, e = o, o = n;
1862
2118
  }
1863
- return _ = !0, o.d.length = h + 1, o;
2119
+ return E = !0, o.d.length = h + 1, o;
1864
2120
  }
1865
- function Jt(r, s) {
2121
+ function se(r, s) {
1866
2122
  for (var t = r; --s; ) t *= r;
1867
2123
  return t;
1868
2124
  }
1869
- function Be(r, s) {
1870
- var t, e = s.s < 0, i = J(r, r.precision, 1), n = i.times(0.5);
2125
+ function ze(r, s) {
2126
+ var t, e = s.s < 0, i = tt(r, r.precision, 1), n = i.times(0.5);
1871
2127
  if (s = s.abs(), s.lte(n))
1872
2128
  return nt = e ? 4 : 1, s;
1873
2129
  if (t = s.divToInt(i), t.isZero())
1874
2130
  nt = e ? 3 : 2;
1875
2131
  else {
1876
2132
  if (s = s.minus(t.times(i)), s.lte(n))
1877
- return nt = xe(t) ? e ? 2 : 3 : e ? 4 : 1, s;
1878
- nt = xe(t) ? e ? 1 : 4 : e ? 3 : 2;
2133
+ return nt = Se(t) ? e ? 2 : 3 : e ? 4 : 1, s;
2134
+ nt = Se(t) ? e ? 1 : 4 : e ? 3 : 2;
1879
2135
  }
1880
2136
  return s.minus(i).abs();
1881
2137
  }
1882
- function ge(r, s, t, e) {
2138
+ function ye(r, s, t, e) {
1883
2139
  var i, n, o, a, l, c, h, u, f, m = r.constructor, p = t !== void 0;
1884
- if (p ? (G(t, 1, ht), e === void 0 ? e = m.rounding : G(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
1885
- h = Fe(r);
2140
+ if (p ? (U(t, 1, ut), e === void 0 ? e = m.rounding : U(e, 0, 8)) : (t = m.precision, e = m.rounding), !r.isFinite())
2141
+ h = Xe(r);
1886
2142
  else {
1887
- for (h = K(r), o = h.indexOf("."), p ? (i = 2, s == 16 ? t = t * 4 - 3 : s == 8 && (t = t * 3 - 2)) : i = s, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d = Tt(K(f), 10, i), f.e = f.d.length), u = Tt(h, 10, i), n = l = u.length; u[--l] == 0; ) u.pop();
2143
+ for (h = et(r), o = h.indexOf("."), p ? (i = 2, s == 16 ? t = t * 4 - 3 : s == 8 && (t = t * 3 - 2)) : i = s, o >= 0 && (h = h.replace(".", ""), f = new m(1), f.e = h.length - o, f.d = Ft(et(f), 10, i), f.e = f.d.length), u = Ft(h, 10, i), n = l = u.length; u[--l] == 0; ) u.pop();
1888
2144
  if (!u[0])
1889
2145
  h = p ? "0p+0" : "0";
1890
2146
  else {
1891
- if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r = R(r, f, t, e, 0, i), u = r.d, n = r.e, c = ke), o = u[t], a = i / 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)
2147
+ if (o < 0 ? n-- : (r = new m(r), r.d = u, r.e = n, r = V(r, f, t, e, 0, i), u = r.d, n = r.e, c = Te), o = u[t], a = i / 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)
1892
2148
  for (; ++u[--t] > i - 1; )
1893
2149
  u[t] = 0, t || (++n, u.unshift(1));
1894
2150
  for (l = u.length; !u[l - 1]; --l) ;
1895
- for (o = 0, h = ""; o < l; o++) h += le.charAt(u[o]);
2151
+ for (o = 0, h = ""; o < l; o++) h += fe.charAt(u[o]);
1896
2152
  if (p) {
1897
2153
  if (l > 1)
1898
2154
  if (s == 16 || s == 8) {
1899
2155
  for (o = s == 16 ? 4 : 3, --l; l % o; l++) h += "0";
1900
- for (u = Tt(h, i, s), l = u.length; !u[l - 1]; --l) ;
1901
- for (o = 1, h = "1."; o < l; o++) h += le.charAt(u[o]);
2156
+ for (u = Ft(h, i, s), l = u.length; !u[l - 1]; --l) ;
2157
+ for (o = 1, h = "1."; o < l; o++) h += fe.charAt(u[o]);
1902
2158
  } else
1903
2159
  h = h.charAt(0) + "." + h.slice(1);
1904
2160
  h = h + (n < 0 ? "p" : "p+") + n;
@@ -1912,54 +2168,54 @@ function ge(r, s, t, e) {
1912
2168
  }
1913
2169
  return r.s < 0 ? "-" + h : h;
1914
2170
  }
1915
- function Pe(r, s) {
2171
+ function Ee(r, s) {
1916
2172
  if (r.length > s)
1917
2173
  return r.length = s, !0;
1918
2174
  }
1919
- function li(r) {
2175
+ function fi(r) {
1920
2176
  return new this(r).abs();
1921
2177
  }
1922
- function ci(r) {
2178
+ function mi(r) {
1923
2179
  return new this(r).acos();
1924
2180
  }
1925
- function hi(r) {
2181
+ function gi(r) {
1926
2182
  return new this(r).acosh();
1927
2183
  }
1928
- function ui(r, s) {
2184
+ function pi(r, s) {
1929
2185
  return new this(r).plus(s);
1930
2186
  }
1931
- function di(r) {
2187
+ function vi(r) {
1932
2188
  return new this(r).asin();
1933
2189
  }
1934
- function fi(r) {
2190
+ function yi(r) {
1935
2191
  return new this(r).asinh();
1936
2192
  }
1937
- function mi(r) {
2193
+ function wi(r) {
1938
2194
  return new this(r).atan();
1939
2195
  }
1940
- function gi(r) {
2196
+ function xi(r) {
1941
2197
  return new this(r).atanh();
1942
2198
  }
1943
- function pi(r, s) {
2199
+ function Pi(r, s) {
1944
2200
  r = new this(r), s = new this(s);
1945
2201
  var t, e = this.precision, i = this.rounding, n = e + 4;
1946
- return !r.s || !s.s ? t = new this(NaN) : !r.d && !s.d ? (t = J(this, n, 1).times(s.s > 0 ? 0.25 : 0.75), t.s = r.s) : !s.d || r.isZero() ? (t = s.s < 0 ? J(this, e, i) : new this(0), t.s = r.s) : !r.d || s.isZero() ? (t = J(this, n, 1).times(0.5), t.s = r.s) : s.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(R(r, s, n, 1)), s = J(this, n, 1), this.precision = e, this.rounding = i, t = r.s < 0 ? t.minus(s) : t.plus(s)) : t = this.atan(R(r, s, n, 1)), t;
2202
+ return !r.s || !s.s ? t = new this(NaN) : !r.d && !s.d ? (t = tt(this, n, 1).times(s.s > 0 ? 0.25 : 0.75), t.s = r.s) : !s.d || r.isZero() ? (t = s.s < 0 ? tt(this, e, i) : new this(0), t.s = r.s) : !r.d || s.isZero() ? (t = tt(this, n, 1).times(0.5), t.s = r.s) : s.s < 0 ? (this.precision = n, this.rounding = 1, t = this.atan(V(r, s, n, 1)), s = tt(this, n, 1), this.precision = e, this.rounding = i, t = r.s < 0 ? t.minus(s) : t.plus(s)) : t = this.atan(V(r, s, n, 1)), t;
1947
2203
  }
1948
- function vi(r) {
2204
+ function bi(r) {
1949
2205
  return new this(r).cbrt();
1950
2206
  }
1951
- function yi(r) {
1952
- return P(r = new this(r), r.e + 1, 2);
2207
+ function Ci(r) {
2208
+ return C(r = new this(r), r.e + 1, 2);
1953
2209
  }
1954
- function wi(r, s, t) {
2210
+ function Si(r, s, t) {
1955
2211
  return new this(r).clamp(s, t);
1956
2212
  }
1957
- function xi(r) {
1958
- if (!r || typeof r != "object") throw Error(Zt + "Object expected");
2213
+ function Ei(r) {
2214
+ if (!r || typeof r != "object") throw Error(ee + "Object expected");
1959
2215
  var s, t, e, i = r.defaults === !0, n = [
1960
2216
  "precision",
1961
2217
  1,
1962
- ht,
2218
+ ut,
1963
2219
  "rounding",
1964
2220
  0,
1965
2221
  8,
@@ -1968,10 +2224,10 @@ function xi(r) {
1968
2224
  0,
1969
2225
  "toExpPos",
1970
2226
  0,
1971
- ae,
2227
+ de,
1972
2228
  "maxE",
1973
2229
  0,
1974
- ae,
2230
+ de,
1975
2231
  "minE",
1976
2232
  -9e15,
1977
2233
  0,
@@ -1980,35 +2236,35 @@ function xi(r) {
1980
2236
  9
1981
2237
  ];
1982
2238
  for (s = 0; s < n.length; s += 3)
1983
- if (t = n[s], i && (this[t] = ce[t]), (e = r[t]) !== void 0)
2239
+ if (t = n[s], i && (this[t] = me[t]), (e = r[t]) !== void 0)
1984
2240
  if (F(e) === e && e >= n[s + 1] && e <= n[s + 2]) this[t] = e;
1985
- else throw Error(ct + t + ": " + e);
1986
- if (t = "crypto", i && (this[t] = ce[t]), (e = r[t]) !== void 0)
2241
+ else throw Error(ht + t + ": " + e);
2242
+ if (t = "crypto", i && (this[t] = me[t]), (e = r[t]) !== void 0)
1987
2243
  if (e === !0 || e === !1 || e === 0 || e === 1)
1988
2244
  if (e)
1989
2245
  if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
1990
2246
  this[t] = !0;
1991
2247
  else
1992
- throw Error(Ae);
2248
+ throw Error(Ne);
1993
2249
  else
1994
2250
  this[t] = !1;
1995
2251
  else
1996
- throw Error(ct + t + ": " + e);
2252
+ throw Error(ht + t + ": " + e);
1997
2253
  return this;
1998
2254
  }
1999
- function Pi(r) {
2255
+ function _i(r) {
2000
2256
  return new this(r).cos();
2001
2257
  }
2002
- function bi(r) {
2258
+ function Mi(r) {
2003
2259
  return new this(r).cosh();
2004
2260
  }
2005
- function Xe(r) {
2261
+ function Ye(r) {
2006
2262
  var s, t, e;
2007
2263
  function i(n) {
2008
2264
  var o, a, l, c = this;
2009
2265
  if (!(c instanceof i)) return new i(n);
2010
- if (c.constructor = i, be(n)) {
2011
- c.s = n.s, _ ? !n.d || n.e > i.maxE ? (c.e = NaN, c.d = null) : n.e < i.minE ? (c.e = 0, c.d = [0]) : (c.e = n.e, c.d = n.d.slice()) : (c.e = n.e, c.d = n.d ? n.d.slice() : n.d);
2266
+ if (c.constructor = i, _e(n)) {
2267
+ c.s = n.s, E ? !n.d || n.e > i.maxE ? (c.e = NaN, c.d = null) : n.e < i.minE ? (c.e = 0, c.d = [0]) : (c.e = n.e, c.d = n.d.slice()) : (c.e = n.e, c.d = n.d ? n.d.slice() : n.d);
2012
2268
  return;
2013
2269
  }
2014
2270
  if (l = typeof n, l === "number") {
@@ -2018,79 +2274,79 @@ function Xe(r) {
2018
2274
  }
2019
2275
  if (n < 0 ? (n = -n, c.s = -1) : c.s = 1, n === ~~n && n < 1e7) {
2020
2276
  for (o = 0, a = n; a >= 10; a /= 10) o++;
2021
- _ ? o > i.maxE ? (c.e = NaN, c.d = null) : o < i.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [n]) : (c.e = o, c.d = [n]);
2277
+ E ? o > i.maxE ? (c.e = NaN, c.d = null) : o < i.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [n]) : (c.e = o, c.d = [n]);
2022
2278
  return;
2023
2279
  }
2024
2280
  if (n * 0 !== 0) {
2025
2281
  n || (c.s = NaN), c.e = NaN, c.d = null;
2026
2282
  return;
2027
2283
  }
2028
- return Ht(c, n.toString());
2284
+ return Bt(c, n.toString());
2029
2285
  }
2030
2286
  if (l === "string")
2031
- return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Ie.test(n) ? Ht(c, n) : oi(c, n);
2287
+ return (a = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (a === 43 && (n = n.slice(1)), c.s = 1), Fe.test(n) ? Bt(c, n) : ui(c, n);
2032
2288
  if (l === "bigint")
2033
- return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Ht(c, n.toString());
2034
- throw Error(ct + n);
2289
+ return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Bt(c, n.toString());
2290
+ throw Error(ht + n);
2035
2291
  }
2036
- if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = xi, i.clone = Xe, i.isDecimal = be, i.abs = li, i.acos = ci, i.acosh = hi, i.add = ui, i.asin = di, i.asinh = fi, i.atan = mi, i.atanh = gi, i.atan2 = pi, i.cbrt = vi, i.ceil = yi, i.clamp = wi, i.cos = Pi, i.cosh = bi, i.div = Ci, i.exp = Si, i.floor = _i, i.hypot = Mi, i.ln = Ei, i.log = Di, i.log10 = Ri, i.log2 = Vi, i.max = ki, i.min = Oi, i.mod = Ai, i.mul = Ni, i.pow = Ii, i.random = Li, i.round = Ti, i.sign = Hi, i.sin = Fi, i.sinh = Bi, i.sqrt = Xi, i.sub = Gi, i.sum = Ui, i.tan = zi, i.tanh = Yi, i.trunc = ji, r === void 0 && (r = {}), r && r.defaults !== !0)
2292
+ if (i.prototype = v, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = Ei, i.clone = Ye, i.isDecimal = _e, i.abs = fi, i.acos = mi, i.acosh = gi, i.add = pi, i.asin = vi, i.asinh = yi, i.atan = wi, i.atanh = xi, i.atan2 = Pi, i.cbrt = bi, i.ceil = Ci, i.clamp = Si, i.cos = _i, i.cosh = Mi, i.div = Di, i.exp = Ri, i.floor = ki, i.hypot = Vi, i.ln = Oi, i.log = Ai, i.log10 = Ti, i.log2 = Li, i.max = Ii, i.min = Ni, i.mod = Hi, i.mul = Fi, i.pow = Bi, i.random = Gi, i.round = Ui, i.sign = Xi, i.sin = zi, i.sinh = Yi, i.sqrt = ji, i.sub = Wi, i.sum = qi, i.tan = $i, i.tanh = Zi, i.trunc = Qi, r === void 0 && (r = {}), r && r.defaults !== !0)
2037
2293
  for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], s = 0; s < e.length; ) r.hasOwnProperty(t = e[s++]) || (r[t] = this[t]);
2038
2294
  return i.config(r), i;
2039
2295
  }
2040
- function Ci(r, s) {
2296
+ function Di(r, s) {
2041
2297
  return new this(r).div(s);
2042
2298
  }
2043
- function Si(r) {
2299
+ function Ri(r) {
2044
2300
  return new this(r).exp();
2045
2301
  }
2046
- function _i(r) {
2047
- return P(r = new this(r), r.e + 1, 3);
2302
+ function ki(r) {
2303
+ return C(r = new this(r), r.e + 1, 3);
2048
2304
  }
2049
- function Mi() {
2305
+ function Vi() {
2050
2306
  var r, s, t = new this(0);
2051
- for (_ = !1, r = 0; r < arguments.length; )
2307
+ for (E = !1, r = 0; r < arguments.length; )
2052
2308
  if (s = new this(arguments[r++]), s.d)
2053
2309
  t.d && (t = t.plus(s.times(s)));
2054
2310
  else {
2055
2311
  if (s.s)
2056
- return _ = !0, new this(1 / 0);
2312
+ return E = !0, new this(1 / 0);
2057
2313
  t = s;
2058
2314
  }
2059
- return _ = !0, t.sqrt();
2315
+ return E = !0, t.sqrt();
2060
2316
  }
2061
- function be(r) {
2062
- return r instanceof D || r && r.toStringTag === Ne || !1;
2317
+ function _e(r) {
2318
+ return r instanceof R || r && r.toStringTag === He || !1;
2063
2319
  }
2064
- function Ei(r) {
2320
+ function Oi(r) {
2065
2321
  return new this(r).ln();
2066
2322
  }
2067
- function Di(r, s) {
2323
+ function Ai(r, s) {
2068
2324
  return new this(r).log(s);
2069
2325
  }
2070
- function Vi(r) {
2326
+ function Li(r) {
2071
2327
  return new this(r).log(2);
2072
2328
  }
2073
- function Ri(r) {
2329
+ function Ti(r) {
2074
2330
  return new this(r).log(10);
2075
2331
  }
2076
- function ki() {
2077
- return He(this, arguments, -1);
2332
+ function Ii() {
2333
+ return Ue(this, arguments, -1);
2078
2334
  }
2079
- function Oi() {
2080
- return He(this, arguments, 1);
2335
+ function Ni() {
2336
+ return Ue(this, arguments, 1);
2081
2337
  }
2082
- function Ai(r, s) {
2338
+ function Hi(r, s) {
2083
2339
  return new this(r).mod(s);
2084
2340
  }
2085
- function Ni(r, s) {
2341
+ function Fi(r, s) {
2086
2342
  return new this(r).mul(s);
2087
2343
  }
2088
- function Ii(r, s) {
2344
+ function Bi(r, s) {
2089
2345
  return new this(r).pow(s);
2090
2346
  }
2091
- function Li(r) {
2347
+ function Gi(r) {
2092
2348
  var s, t, e, i, n = 0, o = new this(1), a = [];
2093
- if (r === void 0 ? r = this.precision : G(r, 1, ht), e = Math.ceil(r / S), this.crypto)
2349
+ if (r === void 0 ? r = this.precision : U(r, 1, ut), e = Math.ceil(r / S), this.crypto)
2094
2350
  if (crypto.getRandomValues)
2095
2351
  for (s = crypto.getRandomValues(new Uint32Array(e)); n < e; )
2096
2352
  i = s[n], i >= 429e7 ? s[n] = crypto.getRandomValues(new Uint32Array(1))[0] : a[n++] = i % 1e7;
@@ -2099,7 +2355,7 @@ function Li(r) {
2099
2355
  i = s[n] + (s[n + 1] << 8) + (s[n + 2] << 16) + ((s[n + 3] & 127) << 24), i >= 214e7 ? crypto.randomBytes(4).copy(s, n) : (a.push(i % 1e7), n += 4);
2100
2356
  n = e / 4;
2101
2357
  } else
2102
- throw Error(Ae);
2358
+ throw Error(Ne);
2103
2359
  else for (; n < e; ) a[n++] = Math.random() * 1e7 | 0;
2104
2360
  for (e = a[--n], r %= S, e && r && (i = I(10, S - r), a[n] = (e / i | 0) * i); a[n] === 0; n--) a.pop();
2105
2361
  if (n < 0)
@@ -2111,44 +2367,44 @@ function Li(r) {
2111
2367
  }
2112
2368
  return o.e = t, o.d = a, o;
2113
2369
  }
2114
- function Ti(r) {
2115
- return P(r = new this(r), r.e + 1, this.rounding);
2370
+ function Ui(r) {
2371
+ return C(r = new this(r), r.e + 1, this.rounding);
2116
2372
  }
2117
- function Hi(r) {
2373
+ function Xi(r) {
2118
2374
  return r = new this(r), r.d ? r.d[0] ? r.s : 0 * r.s : r.s || NaN;
2119
2375
  }
2120
- function Fi(r) {
2376
+ function zi(r) {
2121
2377
  return new this(r).sin();
2122
2378
  }
2123
- function Bi(r) {
2379
+ function Yi(r) {
2124
2380
  return new this(r).sinh();
2125
2381
  }
2126
- function Xi(r) {
2382
+ function ji(r) {
2127
2383
  return new this(r).sqrt();
2128
2384
  }
2129
- function Gi(r, s) {
2385
+ function Wi(r, s) {
2130
2386
  return new this(r).sub(s);
2131
2387
  }
2132
- function Ui() {
2388
+ function qi() {
2133
2389
  var r = 0, s = arguments, t = new this(s[r]);
2134
- for (_ = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
2135
- return _ = !0, P(t, this.precision, this.rounding);
2390
+ for (E = !1; t.s && ++r < s.length; ) t = t.plus(s[r]);
2391
+ return E = !0, C(t, this.precision, this.rounding);
2136
2392
  }
2137
- function zi(r) {
2393
+ function $i(r) {
2138
2394
  return new this(r).tan();
2139
2395
  }
2140
- function Yi(r) {
2396
+ function Zi(r) {
2141
2397
  return new this(r).tanh();
2142
2398
  }
2143
- function ji(r) {
2144
- return P(r = new this(r), r.e + 1, 1);
2399
+ function Qi(r) {
2400
+ return C(r = new this(r), r.e + 1, 1);
2145
2401
  }
2146
2402
  v[Symbol.for("nodejs.util.inspect.custom")] = v.toString;
2147
2403
  v[Symbol.toStringTag] = "Decimal";
2148
- var D = v.constructor = Xe(ce);
2149
- Yt = new D(Yt);
2150
- jt = new D(jt);
2151
- class Wi {
2404
+ var R = v.constructor = Ye(me);
2405
+ $t = new R($t);
2406
+ Zt = new R(Zt);
2407
+ class Ji {
2152
2408
  constructor() {
2153
2409
  /** 父级 */
2154
2410
  d(this, "parent");
@@ -2178,7 +2434,7 @@ class Wi {
2178
2434
  this.mainCanvas = s;
2179
2435
  }
2180
2436
  }
2181
- class qi extends Wi {
2437
+ class Ki extends Ji {
2182
2438
  constructor() {
2183
2439
  super(...arguments);
2184
2440
  d(this, "_isVisible", !0);
@@ -2224,12 +2480,12 @@ class qi extends Wi {
2224
2480
  return !0;
2225
2481
  }
2226
2482
  }
2227
- let $i = class extends qi {
2483
+ let ts = class extends Ki {
2228
2484
  constructor(s) {
2229
- super(), s.name = s.name || oe("default-name-"), Object.assign(this, { ...s });
2485
+ super(), s.name = s.name || ue("default-name-"), Object.assign(this, { ...s });
2230
2486
  }
2231
2487
  };
2232
- class Zi extends $i {
2488
+ class es extends ts {
2233
2489
  constructor(t) {
2234
2490
  super(t);
2235
2491
  d(this, "_isInteractive", !0);
@@ -2308,7 +2564,7 @@ class Zi extends $i {
2308
2564
  return (this.parent ? this.parent[t] : !0) && e && (i ? this.isInteractive : !0);
2309
2565
  }
2310
2566
  }
2311
- class Qi {
2567
+ class is {
2312
2568
  constructor(s) {
2313
2569
  d(this, "propagationStopped", !1);
2314
2570
  this.data = s;
@@ -2320,7 +2576,7 @@ class Qi {
2320
2576
  return !this.propagationStopped;
2321
2577
  }
2322
2578
  }
2323
- class Rt extends Zi {
2579
+ class Vt extends es {
2324
2580
  constructor() {
2325
2581
  super(...arguments);
2326
2582
  //#region 4. 添加事件管理器
@@ -2438,7 +2694,7 @@ class Rt extends Zi {
2438
2694
  var c, h;
2439
2695
  if (!this[n]) return;
2440
2696
  this.updateStates(t, e);
2441
- const o = new Qi(e);
2697
+ const o = new is(e);
2442
2698
  this.listeners[t].forEach((u) => u(o, i));
2443
2699
  const a = "notify" + (t.charAt(0).toUpperCase() + t.slice(1)), l = ["notifyDragg", "notifyWheel"].includes(a) ? e : e.state;
2444
2700
  o.canPropagate && ((c = this.parent) == null || c[a](l, i)), (h = this.sharedControllers[t]) == null || h.forEach(
@@ -2494,7 +2750,7 @@ class Rt extends Zi {
2494
2750
  }
2495
2751
  //#region 6. 添加事件通知方法
2496
2752
  }
2497
- class Ji extends Rt {
2753
+ class ss extends Vt {
2498
2754
  constructor(t) {
2499
2755
  super(t);
2500
2756
  /** 画布元素 */
@@ -2617,12 +2873,12 @@ class Ji extends Rt {
2617
2873
  }
2618
2874
  }, f = (g, y, w) => {
2619
2875
  if (g !== void 0) {
2620
- const b = u.vertical(g, w);
2621
- if (b !== void 0) return b;
2876
+ const P = u.vertical(g, w);
2877
+ if (P !== void 0) return P;
2622
2878
  }
2623
2879
  if (y !== void 0) {
2624
- const b = u.reverse(y, w);
2625
- if (b !== void 0) return b;
2880
+ const P = u.reverse(y, w);
2881
+ if (P !== void 0) return P;
2626
2882
  }
2627
2883
  return w / 2;
2628
2884
  }, m = f(a, l, o);
@@ -2651,7 +2907,7 @@ class Ji extends Rt {
2651
2907
  let l, c;
2652
2908
  t === "center" ? (l = a.left + a.width / 2, c = a.top + a.height / 2) : [l, c] = [t.clientX, t.clientY];
2653
2909
  const h = this.getMousePositionOnAxis({ clientX: l, clientY: c }), u = this.getAxisValueByPoint(h.x, h.y);
2654
- this.scale = new D(this.scale).add(e).toNumber(), this.isScaleUpdated = !0, this.updateSize();
2910
+ this.scale = new R(this.scale).add(e).toNumber(), this.isScaleUpdated = !0, this.updateSize();
2655
2911
  const f = this.getAxisPointByValue(
2656
2912
  u.xV,
2657
2913
  u.yV
@@ -2685,7 +2941,7 @@ class Ji extends Rt {
2685
2941
  */
2686
2942
  getGridSize(t) {
2687
2943
  const { cycle: e, delta: i, axisConfig: n } = this;
2688
- let o = new D(t).sub(1).abs().mod(e * i).div(i).toNumber();
2944
+ let o = new R(t).sub(1).abs().mod(e * i).div(i).toNumber();
2689
2945
  return o = t < 1 && o != 0 ? e - o : o, Number(((o / e + 1) * n.min).toFixed(0));
2690
2946
  }
2691
2947
  /**
@@ -2697,11 +2953,11 @@ class Ji extends Rt {
2697
2953
  const { axisConfig: e, cycle: i, delta: n } = this, o = e.count, a = i * n;
2698
2954
  if (t === 1) return o;
2699
2955
  if (t > 1) {
2700
- const l = new D(t).sub(1).div(a).floor();
2701
- return new D(o).div(new D(2).pow(l)).toNumber();
2956
+ const l = new R(t).sub(1).div(a).floor();
2957
+ return new R(o).div(new R(2).pow(l)).toNumber();
2702
2958
  } else {
2703
- const l = new D(1).sub(t).div(a).ceil();
2704
- return new D(o).mul(new D(2).pow(l)).toNumber();
2959
+ const l = new R(1).sub(t).div(a).ceil();
2960
+ return new R(o).mul(new R(2).pow(l)).toNumber();
2705
2961
  }
2706
2962
  }
2707
2963
  /** 获取每个网格表示的数字 */
@@ -2724,7 +2980,7 @@ class Ji extends Rt {
2724
2980
  xV: t / n.min * n.count,
2725
2981
  yV: e / n.min * n.count
2726
2982
  };
2727
- const o = this.getNowGridCount, a = new D(t).div(n.size).mul(o).toFixed(8), l = new D(e).div(n.size).mul(o).toFixed(8);
2983
+ const o = this.getNowGridCount, a = new R(t).div(n.size).mul(o).toFixed(8), l = new R(e).div(n.size).mul(o).toFixed(8);
2728
2984
  return { xV: Number(a), yV: Number(l) };
2729
2985
  }
2730
2986
  /** 通过坐标轴上的值 获取坐标轴上的点 */
@@ -2735,7 +2991,7 @@ class Ji extends Rt {
2735
2991
  x: t / n.count * n.min,
2736
2992
  y: e / n.count * n.min
2737
2993
  };
2738
- const o = this.getNowGridCount, a = new D(t).div(o).mul(n.size).toFixed(3), l = new D(e).div(o).mul(n.size).toFixed(3);
2994
+ const o = this.getNowGridCount, a = new R(t).div(o).mul(n.size).toFixed(3), l = new R(e).div(o).mul(n.size).toFixed(3);
2739
2995
  return { x: Number(a), y: Number(l) };
2740
2996
  }
2741
2997
  /** 获取最大/小的 值 */
@@ -2765,7 +3021,7 @@ class Ji extends Rt {
2765
3021
  ) : l(t);
2766
3022
  }
2767
3023
  }
2768
- class Ki extends Ji {
3024
+ class ns extends ss {
2769
3025
  constructor(t) {
2770
3026
  super(t);
2771
3027
  /** 主题 */
@@ -2869,6 +3125,18 @@ class Ki extends Ji {
2869
3125
  width: 14,
2870
3126
  fill: "#036933"
2871
3127
  }
3128
+ },
3129
+ billboard: {
3130
+ stroke: {
3131
+ color: "#d03050",
3132
+ color_hover: "#d03050",
3133
+ width: 4,
3134
+ dash: !1,
3135
+ dashGap: [5, 10],
3136
+ dashOffset: 0,
3137
+ cap: "round",
3138
+ join: "round"
3139
+ }
2872
3140
  }
2873
3141
  },
2874
3142
  dark: {
@@ -2967,6 +3235,18 @@ class Ki extends Ji {
2967
3235
  width: 14,
2968
3236
  fill: "#7efbd1"
2969
3237
  }
3238
+ },
3239
+ billboard: {
3240
+ stroke: {
3241
+ color: "#e88080",
3242
+ color_hover: "#e88080",
3243
+ width: 4,
3244
+ dash: !1,
3245
+ dashGap: [5, 10],
3246
+ dashOffset: 0,
3247
+ cap: "round",
3248
+ join: "round"
3249
+ }
2970
3250
  }
2971
3251
  }
2972
3252
  });
@@ -2989,10 +3269,10 @@ class Ki extends Ji {
2989
3269
  setStyle(t) {
2990
3270
  for (const e in t)
2991
3271
  if (Object.prototype.hasOwnProperty.call(t, e)) {
2992
- const i = Je(
3272
+ const i = si(
2993
3273
  this.style[e] || this.style[this.theme]
2994
3274
  );
2995
- pt(i, t[e]), this.style[e] = i;
3275
+ ct(i, t[e]), this.style[e] = i;
2996
3276
  }
2997
3277
  this.initStyle();
2998
3278
  }
@@ -3001,7 +3281,7 @@ class Ki extends Ji {
3001
3281
  t in this.style && (this.theme = t, this.isThemeUpdated = !0);
3002
3282
  }
3003
3283
  }
3004
- class V extends Rt {
3284
+ class D extends Vt {
3005
3285
  constructor(t) {
3006
3286
  t = { ...t }, t.isDraggable = t.isDraggable ?? !1;
3007
3287
  const { mainCanvas: e, notifyReload: i } = t;
@@ -3267,7 +3547,7 @@ class V extends Rt {
3267
3547
  handleValuePosition(t, e) {
3268
3548
  let { value: i, position: n, mainCanvas: o } = this;
3269
3549
  if (!o) return !1;
3270
- const a = t === "array1D" ? me : zt, [l, c] = [
3550
+ const a = t === "array1D" ? ve : qt, [l, c] = [
3271
3551
  a(i) && (!e || i.length >= e),
3272
3552
  a(n) && (!e || n.length >= e)
3273
3553
  ], h = {
@@ -3324,8 +3604,8 @@ class V extends Rt {
3324
3604
  return this.isInteractive ? this.isDraggable ? "_nhanh_canvas_hover_overlay_draggable" : "_nhanh_canvas_hover_overlay" : void 0;
3325
3605
  }
3326
3606
  }
3327
- d(V, "ctx", document.createElement("canvas").getContext("2d"));
3328
- class Ft extends V {
3607
+ d(D, "ctx", document.createElement("canvas").getContext("2d"));
3608
+ class Gt extends D {
3329
3609
  constructor(t) {
3330
3610
  super(t);
3331
3611
  d(this, "_draw");
@@ -3358,13 +3638,13 @@ class Ft extends V {
3358
3638
  n[1],
3359
3639
  !0
3360
3640
  );
3361
- e.push([o.x, o.y]), n[0] != 0 ? i = new D(o.x).div(n[0]).toNumber() : n[1] != 0 && (i = new D(o.y).div(n[1]).toNumber());
3641
+ e.push([o.x, o.y]), n[0] != 0 ? i = new R(o.x).div(n[0]).toNumber() : n[1] != 0 && (i = new R(o.y).div(n[1]).toNumber());
3362
3642
  } else
3363
3643
  e.push([
3364
3644
  // this.mainCanvas!.preservePrecision(scale * item[0]),
3365
3645
  // this.mainCanvas!.preservePrecision(scale * item[1]),
3366
- new D(i).mul(n[0]).toNumber(),
3367
- new D(i).mul(n[1]).toNumber()
3646
+ new R(i).mul(n[0]).toNumber(),
3647
+ new R(i).mul(n[1]).toNumber()
3368
3648
  ]);
3369
3649
  }), e;
3370
3650
  }
@@ -3378,13 +3658,13 @@ class Ft extends V {
3378
3658
  n[1],
3379
3659
  !0
3380
3660
  );
3381
- e.push([a.xV, a.yV]), n[0] != 0 ? i = new D(a.xV).div(n[0]).toNumber() : n[1] != 0 && (i = new D(a.yV).div(n[1]).toNumber());
3661
+ e.push([a.xV, a.yV]), n[0] != 0 ? i = new R(a.xV).div(n[0]).toNumber() : n[1] != 0 && (i = new R(a.yV).div(n[1]).toNumber());
3382
3662
  } else
3383
3663
  e.push([
3384
3664
  // this.mainCanvas!.preservePrecision(scale * item[0]),
3385
3665
  // this.mainCanvas!.preservePrecision(scale * item[1]),
3386
- new D(i).mul(n[0]).toNumber(),
3387
- new D(i).mul(n[1]).toNumber()
3666
+ new R(i).mul(n[0]).toNumber(),
3667
+ new R(i).mul(n[1]).toNumber()
3388
3668
  ]);
3389
3669
  }), e;
3390
3670
  }
@@ -3419,21 +3699,21 @@ class Ft extends V {
3419
3699
  }
3420
3700
  }
3421
3701
  }
3422
- class O {
3702
+ class k {
3423
3703
  static add(s, t) {
3424
- return new D(s).add(t).toNumber();
3704
+ return new R(s).add(t).toNumber();
3425
3705
  }
3426
3706
  static sub(s, t) {
3427
- return new D(s).sub(t).toNumber();
3707
+ return new R(s).sub(t).toNumber();
3428
3708
  }
3429
3709
  static mul(s, t) {
3430
- return new D(s).mul(t).toNumber();
3710
+ return new R(s).mul(t).toNumber();
3431
3711
  }
3432
3712
  static div(s, t) {
3433
- return new D(s).div(t).toNumber();
3713
+ return new R(s).div(t).toNumber();
3434
3714
  }
3435
3715
  }
3436
- class Bt extends V {
3716
+ class Ut extends D {
3437
3717
  constructor(t) {
3438
3718
  super(t);
3439
3719
  /** 文字偏差 */
@@ -3445,16 +3725,16 @@ class Bt extends V {
3445
3725
  this.internalUpdate(
3446
3726
  {
3447
3727
  value: [
3448
- O.add(this.value[0], o.value),
3449
- O.add(this.value[1], a.value)
3728
+ k.add(this.value[0], o.value),
3729
+ k.add(this.value[1], a.value)
3450
3730
  ],
3451
3731
  position: [
3452
- O.add(this.position[0], o.position),
3453
- O.add(this.position[1], a.position)
3732
+ k.add(this.position[0], o.position),
3733
+ k.add(this.position[1], a.position)
3454
3734
  ],
3455
3735
  dynamicPosition: [
3456
- O.add(this.dynamicPosition[0], o.dynamicPosition),
3457
- O.add(this.dynamicPosition[1], a.dynamicPosition)
3736
+ k.add(this.dynamicPosition[0], o.dynamicPosition),
3737
+ k.add(this.dynamicPosition[1], a.dynamicPosition)
3458
3738
  ]
3459
3739
  },
3460
3740
  !0
@@ -3482,7 +3762,7 @@ class Bt extends V {
3482
3762
  });
3483
3763
  }
3484
3764
  isPointInPath(t, e) {
3485
- return this.path ? V.ctx.isPointInPath(this.path, t, e) : !1;
3765
+ return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
3486
3766
  }
3487
3767
  isPointInStroke(t, e) {
3488
3768
  return !1;
@@ -3491,7 +3771,7 @@ class Bt extends V {
3491
3771
  if (!this.mainCanvas) return;
3492
3772
  if (!this.text || this.text.length == 0)
3493
3773
  return this.internalUpdate({ dynamicPosition: void 0 });
3494
- const t = V.ctx;
3774
+ const t = D.ctx;
3495
3775
  this.setOverlayStyles(t);
3496
3776
  const e = t.measureText(this.text);
3497
3777
  this.textOffset = {
@@ -3533,7 +3813,7 @@ class Bt extends V {
3533
3813
  }
3534
3814
  }
3535
3815
  }
3536
- class lt extends V {
3816
+ class lt extends D {
3537
3817
  constructor(t) {
3538
3818
  super(t);
3539
3819
  d(this, "angle", 2 * Math.PI);
@@ -3543,16 +3823,16 @@ class lt extends V {
3543
3823
  this.internalUpdate(
3544
3824
  {
3545
3825
  value: [
3546
- O.add(this.value[0], o.value),
3547
- O.add(this.value[1], a.value)
3826
+ k.add(this.value[0], o.value),
3827
+ k.add(this.value[1], a.value)
3548
3828
  ],
3549
3829
  position: [
3550
- O.add(this.position[0], o.position),
3551
- O.add(this.position[1], a.position)
3830
+ k.add(this.position[0], o.position),
3831
+ k.add(this.position[1], a.position)
3552
3832
  ],
3553
3833
  dynamicPosition: [
3554
- O.add(this.dynamicPosition[0], o.dynamicPosition),
3555
- O.add(this.dynamicPosition[1], a.dynamicPosition)
3834
+ k.add(this.dynamicPosition[0], o.dynamicPosition),
3835
+ k.add(this.dynamicPosition[1], a.dynamicPosition)
3556
3836
  ]
3557
3837
  },
3558
3838
  !0
@@ -3578,7 +3858,7 @@ class lt extends V {
3578
3858
  cancelAndRestartAnimation(t, e, i) {
3579
3859
  this.fillProgress.scheduleCallback();
3580
3860
  let n = 0;
3581
- this.fillProgress.scheduleCallback = Ut((o) => {
3861
+ this.fillProgress.scheduleCallback = Wt((o) => {
3582
3862
  !this.fillProgress || !o || (this.fillProgress.progress += (o - n) * (t ? 1 : -1), n = o, this.fillProgress.progress = Math.min(
3583
3863
  1,
3584
3864
  Math.max(0, this.fillProgress.progress)
@@ -3590,7 +3870,7 @@ class lt extends V {
3590
3870
  this.fillProgress = {
3591
3871
  lineWidthOffset: 0,
3592
3872
  progress: 0,
3593
- scheduleCallback: Ut((i) => {
3873
+ scheduleCallback: Wt((i) => {
3594
3874
  this.fillProgress && (this.fillProgress.progress = i, this.updateLineWidthOffset(t));
3595
3875
  }, e)
3596
3876
  };
@@ -3603,13 +3883,13 @@ class lt extends V {
3603
3883
  e !== this.fillProgress.lineWidthOffset && (this.fillProgress.lineWidthOffset = e, (i = this.notifyReload) == null || i.call(this));
3604
3884
  }
3605
3885
  isPointInPath(t, e) {
3606
- return this.path ? V.ctx.isPointInPath(this.path, t, e) : !1;
3886
+ return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
3607
3887
  }
3608
3888
  isPointInStroke(t, e) {
3609
3889
  var i;
3610
3890
  if (this.path && this.mainCanvas) {
3611
- const { width: n } = this.setOverlayStyles(V.ctx);
3612
- return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 : V.ctx.isPointInStroke(this.path, t, e);
3891
+ const { width: n } = this.setOverlayStyles(D.ctx);
3892
+ return ((i = this.fillProgress) == null ? void 0 : i.lineWidthOffset) == n ? !1 : D.ctx.isPointInStroke(this.path, t, e);
3613
3893
  }
3614
3894
  return !1;
3615
3895
  }
@@ -3649,7 +3929,7 @@ class lt extends V {
3649
3929
  }
3650
3930
  }
3651
3931
  }
3652
- class Ge extends V {
3932
+ class je extends D {
3653
3933
  constructor(t) {
3654
3934
  super(t);
3655
3935
  /** 控制点 */
@@ -3692,14 +3972,14 @@ class Ge extends V {
3692
3972
  const { offsetX: o, offsetY: a } = t.data, { x: l, y: c } = this.calculateOffset(o, a);
3693
3973
  this.value.forEach((h, u) => {
3694
3974
  this.value[u] = [
3695
- O.add(this.value[u][0], l.value),
3696
- O.add(this.value[u][1], c.value)
3975
+ k.add(this.value[u][0], l.value),
3976
+ k.add(this.value[u][1], c.value)
3697
3977
  ], this.position[u] = [
3698
- O.add(this.position[u][0], l.position),
3699
- O.add(this.position[u][1], c.position)
3978
+ k.add(this.position[u][0], l.position),
3979
+ k.add(this.position[u][1], c.position)
3700
3980
  ], this.dynamicPosition[u] = [
3701
- O.add(this.dynamicPosition[u][0], l.dynamicPosition),
3702
- O.add(this.dynamicPosition[u][1], c.dynamicPosition)
3981
+ k.add(this.dynamicPosition[u][0], l.dynamicPosition),
3982
+ k.add(this.dynamicPosition[u][1], c.dynamicPosition)
3703
3983
  ];
3704
3984
  }), this.handlePoints.forEach((h, u) => {
3705
3985
  h.internalUpdate({
@@ -3745,7 +4025,7 @@ class Ge extends V {
3745
4025
  tryCreateNewHandlePoint(t, e) {
3746
4026
  var c;
3747
4027
  if (!this.isPointInStroke(t, e)) return;
3748
- const i = this.getExtendedDynamicPositions(), n = ts([t, e], i);
4028
+ const i = this.getExtendedDynamicPositions(), n = rs([t, e], i);
3749
4029
  if (n === -1) return;
3750
4030
  const [o, a] = this.getAdjacentIndices(n), l = this.createNewHandlePoint(o, a);
3751
4031
  this.insertHandlePoint(n, l), this.lockHandlePointCreationTemporarily(), (c = this.notifyReload) == null || c.call(this);
@@ -3766,13 +4046,13 @@ class Ge extends V {
3766
4046
  }
3767
4047
  /** 创建新的控制点 */
3768
4048
  createNewHandlePoint(t, e) {
3769
- const i = ie(
4049
+ const i = oe(
3770
4050
  this.value[t],
3771
4051
  this.value[e]
3772
- ), n = ie(
4052
+ ), n = oe(
3773
4053
  this.position[t],
3774
4054
  this.position[e]
3775
- ), o = ie(
4055
+ ), o = oe(
3776
4056
  this.dynamicPosition[t],
3777
4057
  this.dynamicPosition[e]
3778
4058
  );
@@ -3844,12 +4124,12 @@ class Ge extends V {
3844
4124
  });
3845
4125
  }
3846
4126
  }
3847
- function ts(r, s, t = 10) {
4127
+ function rs(r, s, t = 10) {
3848
4128
  if (s.length === 0) return 0;
3849
4129
  if (s.length === 1) return 1;
3850
4130
  let e = 1 / 0, i = -1;
3851
4131
  for (let n = 0; n < s.length - 1; n++) {
3852
- const o = _s(
4132
+ const o = Rs(
3853
4133
  r,
3854
4134
  s[n],
3855
4135
  s[n + 1]
@@ -3860,11 +4140,11 @@ function ts(r, s, t = 10) {
3860
4140
  }
3861
4141
  return i;
3862
4142
  }
3863
- function ie(r, s) {
3864
- const { x: t, y: e } = ze(...r, ...s);
4143
+ function oe(r, s) {
4144
+ const { x: t, y: e } = $e(...r, ...s);
3865
4145
  return [t, e];
3866
4146
  }
3867
- class Xt extends Ge {
4147
+ class Xt extends je {
3868
4148
  constructor(t) {
3869
4149
  super(t);
3870
4150
  d(this, "_isInfinite");
@@ -3888,7 +4168,7 @@ class Xt extends Ge {
3888
4168
  return !1;
3889
4169
  }
3890
4170
  isPointInStroke(t, e) {
3891
- return this.path && this.mainCanvas ? (this.setOverlayStyles(V.ctx), this.isDraggable && (V.ctx.lineWidth = Math.max(V.ctx.lineWidth, 20)), V.ctx.isPointInStroke(this.path, t, e)) : !1;
4171
+ return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
3892
4172
  }
3893
4173
  isPointInAnywhere(t, e) {
3894
4174
  return ((n) => {
@@ -3905,7 +4185,7 @@ class Xt extends Ge {
3905
4185
  if (this.isInfinite) {
3906
4186
  this.isRecalculate && this.updateDynamicPosition();
3907
4187
  const { width: t, height: e } = this.mainCanvas.rect;
3908
- return es(
4188
+ return os(
3909
4189
  [0, 0],
3910
4190
  [t, e],
3911
4191
  this.finalDynamicPosition[0],
@@ -3926,7 +4206,7 @@ class Xt extends Ge {
3926
4206
  var o;
3927
4207
  const e = this.mainCanvas, i = e.style[e.theme].line;
3928
4208
  let n = {};
3929
- return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n = pt(
4209
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.line) || i : typeof this.style == "object" ? n = ct(
3930
4210
  JSON.parse(JSON.stringify(i)),
3931
4211
  this.style
3932
4212
  ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
@@ -3955,12 +4235,12 @@ class Xt extends Ge {
3955
4235
  const { rect: n } = e, [o, a] = i, l = [a[0] - o[0], a[1] - o[1]];
3956
4236
  if (l[0] === 0 && l[1] === 0)
3957
4237
  return console.error("重合点无法确定方向");
3958
- const c = Ce(
4238
+ const c = Me(
3959
4239
  o,
3960
4240
  [-l[0], -l[1]],
3961
4241
  n.width,
3962
4242
  n.height
3963
- ), h = Ce(
4243
+ ), h = Me(
3964
4244
  a,
3965
4245
  l,
3966
4246
  n.width,
@@ -3975,7 +4255,7 @@ class Xt extends Ge {
3975
4255
  }
3976
4256
  }
3977
4257
  }
3978
- function Ce(r, s, t, e) {
4258
+ function Me(r, s, t, e) {
3979
4259
  const [i, n] = r, [o, a] = s;
3980
4260
  let l = 1 / 0;
3981
4261
  if (o !== 0) {
@@ -3988,7 +4268,7 @@ function Ce(r, s, t, e) {
3988
4268
  }
3989
4269
  return l === 1 / 0 ? r : [i + o * l, n + a * l];
3990
4270
  }
3991
- function es(r, s, t, e) {
4271
+ function os(r, s, t, e) {
3992
4272
  const i = Math.min(r[0], s[0]), n = Math.max(r[0], s[0]), o = Math.min(r[1], s[1]), a = Math.max(r[1], s[1]), l = [
3993
4273
  [i, o],
3994
4274
  // 左上
@@ -4012,7 +4292,7 @@ function es(r, s, t, e) {
4012
4292
  }
4013
4293
  return m && p;
4014
4294
  }
4015
- class Gt extends Ge {
4295
+ class zt extends je {
4016
4296
  constructor(t) {
4017
4297
  super(t);
4018
4298
  d(this, "_isRect", !1);
@@ -4054,10 +4334,10 @@ class Gt extends Ge {
4054
4334
  this.initValueScope();
4055
4335
  }
4056
4336
  isPointInPath(t, e) {
4057
- return this.path ? V.ctx.isPointInPath(this.path, t, e) : !1;
4337
+ return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
4058
4338
  }
4059
4339
  isPointInStroke(t, e) {
4060
- return this.path && this.mainCanvas ? (this.setOverlayStyles(V.ctx), this.isDraggable && (V.ctx.lineWidth = Math.max(V.ctx.lineWidth, 20)), V.ctx.isPointInStroke(this.path, t, e)) : !1;
4340
+ return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
4061
4341
  }
4062
4342
  isPointInAnywhere(t, e) {
4063
4343
  return ((n) => {
@@ -4107,7 +4387,7 @@ class Gt extends Ge {
4107
4387
  var c;
4108
4388
  const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].polygon;
4109
4389
  let o = {};
4110
- typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = pt(
4390
+ typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.polygon) || n : typeof this.style == "object" ? o = ct(
4111
4391
  JSON.parse(JSON.stringify(n)),
4112
4392
  this.style
4113
4393
  ) : o = n;
@@ -4149,7 +4429,7 @@ class Gt extends Ge {
4149
4429
  }
4150
4430
  }
4151
4431
  }
4152
- class de extends V {
4432
+ class Yt extends D {
4153
4433
  constructor(t) {
4154
4434
  super(t);
4155
4435
  d(this, "_isFill", !1);
@@ -4181,16 +4461,16 @@ class de extends V {
4181
4461
  u.internalUpdate(
4182
4462
  {
4183
4463
  value: [
4184
- O.add(u.value[0], a.value),
4185
- O.add(u.value[1], l.value)
4464
+ k.add(u.value[0], a.value),
4465
+ k.add(u.value[1], l.value)
4186
4466
  ],
4187
4467
  position: [
4188
- O.add(u.position[0], a.position),
4189
- O.add(u.position[1], l.position)
4468
+ k.add(u.position[0], a.position),
4469
+ k.add(u.position[1], l.position)
4190
4470
  ],
4191
4471
  dynamicPosition: [
4192
- O.add(u.dynamicPosition[0], a.dynamicPosition),
4193
- O.add(u.dynamicPosition[1], l.dynamicPosition)
4472
+ k.add(u.dynamicPosition[0], a.dynamicPosition),
4473
+ k.add(u.dynamicPosition[1], l.dynamicPosition)
4194
4474
  ]
4195
4475
  },
4196
4476
  !0
@@ -4321,10 +4601,10 @@ class de extends V {
4321
4601
  }));
4322
4602
  }
4323
4603
  isPointInPath(t, e) {
4324
- return this.isFill && this.path ? V.ctx.isPointInPath(this.path, t, e) : !1;
4604
+ return this.isFill && this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
4325
4605
  }
4326
4606
  isPointInStroke(t, e) {
4327
- return this.path && this.mainCanvas ? (this.setOverlayStyles(V.ctx), this.isDraggable && (V.ctx.lineWidth = Math.max(V.ctx.lineWidth, 20)), V.ctx.isPointInStroke(this.path, t, e)) : !1;
4607
+ return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
4328
4608
  }
4329
4609
  isPointInAnywhere(t, e) {
4330
4610
  return ((n) => {
@@ -4343,7 +4623,7 @@ class de extends V {
4343
4623
  var c;
4344
4624
  const e = this.isHover, i = this.mainCanvas, n = i.style[i.theme].arc;
4345
4625
  let o = {};
4346
- typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = pt(
4626
+ typeof this.style == "string" ? o = ((c = i.style[this.style]) == null ? void 0 : c.arc) || n : typeof this.style == "object" ? o = ct(
4347
4627
  JSON.parse(JSON.stringify(n)),
4348
4628
  this.style
4349
4629
  ) : o = n;
@@ -4373,7 +4653,7 @@ class de extends V {
4373
4653
  offset: c
4374
4654
  } = this;
4375
4655
  if (!t || !a || !l) return;
4376
- const [h, u] = is(
4656
+ const [h, u] = as(
4377
4657
  ...e,
4378
4658
  i,
4379
4659
  n,
@@ -4387,8 +4667,8 @@ class de extends V {
4387
4667
  isDraggable: !0,
4388
4668
  mainCanvas: this.mainCanvas,
4389
4669
  notifyReload: () => {
4390
- var b;
4391
- return (b = this.notifyReload) == null ? void 0 : b.call(this);
4670
+ var P;
4671
+ return (P = this.notifyReload) == null ? void 0 : P.call(this);
4392
4672
  }
4393
4673
  }), m = this.handlePoints.start || f("start"), p = this.handlePoints.end || f("end"), g = this.handlePoints.radius || f("radius");
4394
4674
  m.value = h, p.value = u;
@@ -4477,14 +4757,14 @@ class de extends V {
4477
4757
  }
4478
4758
  }
4479
4759
  }
4480
- function is(r, s, t, e, i, n = 1, o = 1) {
4760
+ function as(r, s, t, e, i, n = 1, o = 1) {
4481
4761
  const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
4482
4762
  return [
4483
4763
  [a, l],
4484
4764
  [c, h]
4485
4765
  ];
4486
4766
  }
4487
- class fe extends V {
4767
+ class jt extends D {
4488
4768
  constructor(t) {
4489
4769
  super(t);
4490
4770
  /** 控制点 */
@@ -4549,7 +4829,7 @@ class fe extends V {
4549
4829
  return !1;
4550
4830
  }
4551
4831
  isPointInStroke(t, e) {
4552
- return this.path && this.mainCanvas ? (this.setOverlayStyles(V.ctx), this.isDraggable && (V.ctx.lineWidth = Math.max(V.ctx.lineWidth, 20)), V.ctx.isPointInStroke(this.path, t, e)) : !1;
4832
+ return this.path && this.mainCanvas ? (this.setOverlayStyles(D.ctx), this.isDraggable && (D.ctx.lineWidth = Math.max(D.ctx.lineWidth, 20)), D.ctx.isPointInStroke(this.path, t, e)) : !1;
4553
4833
  }
4554
4834
  isPointInAnywhere(t, e) {
4555
4835
  return ((n) => {
@@ -4569,7 +4849,7 @@ class fe extends V {
4569
4849
  var o;
4570
4850
  const e = this.mainCanvas, i = e.style[e.theme].arcTo;
4571
4851
  let n = {};
4572
- return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n = pt(
4852
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.arcTo) || i : typeof this.style == "object" ? n = ct(
4573
4853
  JSON.parse(JSON.stringify(i)),
4574
4854
  this.style
4575
4855
  ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
@@ -4608,8 +4888,8 @@ class fe extends V {
4608
4888
  if (!this.mainCanvas) return;
4609
4889
  let { value: t, position: e } = this;
4610
4890
  const [i, n] = [
4611
- zt(t) && t.length > 1,
4612
- zt(e) && e.length > 1
4891
+ qt(t) && t.length > 1,
4892
+ qt(e) && e.length > 1
4613
4893
  ];
4614
4894
  if (!i && !n)
4615
4895
  return this.handlePoints = void 0, this.internalUpdate({ dynamicPosition: void 0 });
@@ -4651,7 +4931,7 @@ class fe extends V {
4651
4931
  }
4652
4932
  }
4653
4933
  }
4654
- class ss extends Ki {
4934
+ class ls extends ns {
4655
4935
  constructor(t) {
4656
4936
  super(t);
4657
4937
  /** 监听元素大小 */
@@ -4668,7 +4948,7 @@ class ss extends Ki {
4668
4948
  maxYV: 0
4669
4949
  });
4670
4950
  /** 测量重绘性能 */
4671
- d(this, "measureRedrawPerformance", Ke(
4951
+ d(this, "measureRedrawPerformance", ni(
4672
4952
  () => {
4673
4953
  this.isRendering = !0, this.redraw(), this.redrawInNextRenderFrame = !1, this.isRendering = !1;
4674
4954
  },
@@ -4681,7 +4961,7 @@ class ss extends Ki {
4681
4961
  }
4682
4962
  ));
4683
4963
  this.canvas && (this.resizeObserver = new ResizeObserver(
4684
- Re(() => {
4964
+ Le(() => {
4685
4965
  [this.canvas.width, this.canvas.height] = [
4686
4966
  this.rect.width,
4687
4967
  this.rect.height
@@ -4728,7 +5008,7 @@ class ss extends Ki {
4728
5008
  if (a !== h) return h - a;
4729
5009
  if (l !== u)
4730
5010
  return u - l;
4731
- const m = (p) => p instanceof Ft ? 5 : p instanceof Bt ? 4 : p instanceof lt ? 3 : p instanceof Xt || p instanceof de || p instanceof fe ? 2 : p instanceof Gt ? 1 : 0;
5011
+ const m = (p) => p instanceof Gt ? 5 : p instanceof Ut ? 4 : p instanceof lt ? 3 : p instanceof Xt || p instanceof Yt || p instanceof jt ? 2 : p instanceof zt ? 1 : 0;
4732
5012
  return m(f) - m(c);
4733
5013
  }
4734
5014
  ), this.currentDrawOverlays = t.map(
@@ -4763,7 +5043,7 @@ class ss extends Ki {
4763
5043
  (t = this.resizeObserver) == null || t.disconnect();
4764
5044
  }
4765
5045
  }
4766
- class ns extends ss {
5046
+ class cs extends ls {
4767
5047
  constructor(t) {
4768
5048
  super(t);
4769
5049
  /** 鼠标是否在画布内 */
@@ -4866,16 +5146,16 @@ class ns extends ss {
4866
5146
  keydown(t) {
4867
5147
  const { mouseInCanvas: e, offset: i, delta: n, axisConfig: o } = this, a = t.key;
4868
5148
  if (!e || !this.isDraggable || this.isAuto) return;
4869
- const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (zt(c.value) ? "Matrix" : me(c.value) ? "Single" : !1), f = (y, w) => {
5149
+ const l = this.getStep(a), c = this.lastClickedOverlay, u = (c == null ? void 0 : c.isDraggable) && this.currentDrawOverlays.includes(c) && (qt(c.value) ? "Matrix" : ve(c.value) ? "Single" : !1), f = (y, w) => {
4870
5150
  if (!u)
4871
5151
  return i.x += y * l, i.y += w * l, !0;
4872
- const b = this.getAxisValueByPoint(l, 0).xV, [C, M] = [b * o.x, b * o.y];
5152
+ const P = this.getAxisValueByPoint(l, 0).xV, [b, _] = [P * o.x, P * o.y];
4873
5153
  if (u === "Single") {
4874
5154
  const A = c.value;
4875
- A[0] += y * C, A[1] += w * M;
5155
+ A[0] += y * b, A[1] += w * _;
4876
5156
  } else
4877
5157
  c.value.forEach((A) => {
4878
- A[0] += y * C, A[1] += w * M;
5158
+ A[0] += y * b, A[1] += w * _;
4879
5159
  });
4880
5160
  return c.value = [...c.value], !0;
4881
5161
  }, m = (y) => (this.setScale("center", y * n), !0), g = {
@@ -4987,17 +5267,17 @@ class ns extends ss {
4987
5267
  } else if (e.length === 2) {
4988
5268
  const { clientX: h, clientY: u } = e[0], { clientX: f, clientY: m } = e[1];
4989
5269
  if (i.length == 2) {
4990
- const p = Se(
5270
+ const p = De(
4991
5271
  i[0],
4992
5272
  n[0],
4993
5273
  i[1],
4994
5274
  n[1]
4995
- ), g = Se(
5275
+ ), g = De(
4996
5276
  h,
4997
5277
  u,
4998
5278
  f,
4999
5279
  m
5000
- ), { x: y, y: w } = ze(
5280
+ ), { x: y, y: w } = $e(
5001
5281
  h,
5002
5282
  u,
5003
5283
  f,
@@ -5018,7 +5298,7 @@ class ns extends ss {
5018
5298
  super.destroy(), (t = this.unBind) == null || t.call(this);
5019
5299
  }
5020
5300
  }
5021
- class et extends Rt {
5301
+ class Y extends Vt {
5022
5302
  constructor(t) {
5023
5303
  super(t);
5024
5304
  /** 覆盖物集合 */
@@ -5041,7 +5321,7 @@ class et extends Rt {
5041
5321
  );
5042
5322
  }
5043
5323
  /** 添加覆盖物 */
5044
- addOverlays(t) {
5324
+ addOverlay(t) {
5045
5325
  var e;
5046
5326
  [t].flat().forEach((i) => {
5047
5327
  i.setNotifyReload(this.notifyReload), i.setMainCanvas(this.mainCanvas), i.parent = this, this.overlays.add(i);
@@ -5052,14 +5332,14 @@ class et extends Rt {
5052
5332
  return this.overlays.has(t);
5053
5333
  }
5054
5334
  /** 移除覆盖物 */
5055
- removeOverlays(t) {
5335
+ removeOverlay(t) {
5056
5336
  var e;
5057
5337
  [t].flat().forEach((i) => {
5058
5338
  this.overlays.delete(i), i.setNotifyReload(), i.setMainCanvas(), i.parent = void 0;
5059
5339
  }), (e = this.notifyReload) == null || e.call(this);
5060
5340
  }
5061
5341
  /** 清空覆盖物 */
5062
- clearOverlays() {
5342
+ clearOverlay() {
5063
5343
  var t;
5064
5344
  (t = this.notifyReload) == null || t.call(this), this.overlays.forEach((e) => {
5065
5345
  e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
@@ -5077,7 +5357,7 @@ class et extends Rt {
5077
5357
  }), t;
5078
5358
  }
5079
5359
  }
5080
- class it extends Rt {
5360
+ class j extends Vt {
5081
5361
  constructor(t) {
5082
5362
  super(t);
5083
5363
  d(this, "_zIndex", 4);
@@ -5123,7 +5403,7 @@ class it extends Rt {
5123
5403
  /** 添加覆盖物组 */
5124
5404
  addGroup(t) {
5125
5405
  [t].flat().forEach((e) => {
5126
- e instanceof et && (this.setGroupNotifyReload(e), e.setMainCanvas(this.mainCanvas), e.parent = this, this.groups.set(e.name, e));
5406
+ e instanceof Y && (this.setGroupNotifyReload(e), e.setMainCanvas(this.mainCanvas), e.parent = this, this.groups.set(e.name, e));
5127
5407
  });
5128
5408
  }
5129
5409
  /** 移除覆盖物组 */
@@ -5131,7 +5411,7 @@ class it extends Rt {
5131
5411
  var i;
5132
5412
  let e = !1;
5133
5413
  [t].flat().forEach((n) => {
5134
- n instanceof et && (this.groups.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
5414
+ n instanceof Y && (this.groups.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
5135
5415
  }), e && ((i = this.notifyReload) == null || i.call(this));
5136
5416
  }
5137
5417
  /** 清空覆盖物 */
@@ -5162,7 +5442,7 @@ class it extends Rt {
5162
5442
  }
5163
5443
  }
5164
5444
  }
5165
- class Dt extends Rt {
5445
+ class Rt extends Vt {
5166
5446
  constructor(t) {
5167
5447
  super(t);
5168
5448
  /** 图层群组 */
@@ -5193,7 +5473,7 @@ class Dt extends Rt {
5193
5473
  /** 添加图层 */
5194
5474
  addLayer(t) {
5195
5475
  [t].flat().forEach((e) => {
5196
- e instanceof it && (e.setNotifyReload(this.notifyReload), e.setMainCanvas(this.mainCanvas), e.parent = this, this.layers.set(e.name, e));
5476
+ e instanceof j && (e.setNotifyReload(this.notifyReload), e.setMainCanvas(this.mainCanvas), e.parent = this, this.layers.set(e.name, e));
5197
5477
  });
5198
5478
  }
5199
5479
  /** 删除图层 */
@@ -5201,11 +5481,11 @@ class Dt extends Rt {
5201
5481
  var i;
5202
5482
  let e = !1;
5203
5483
  [t].flat().forEach((n) => {
5204
- n instanceof it && (this.layers.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
5484
+ n instanceof j && (this.layers.delete(n.name), n.setNotifyReload(), n.setMainCanvas(), n.parent = void 0, e = !0);
5205
5485
  }), e && ((i = this.notifyReload) == null || i.call(this));
5206
5486
  }
5207
5487
  /** 清空图层 */
5208
- clearLayers() {
5488
+ clearLayer() {
5209
5489
  var t;
5210
5490
  this.layers.size && (this.layers.forEach((e) => {
5211
5491
  e.setNotifyReload(), e.setMainCanvas(), e.parent = void 0;
@@ -5226,19 +5506,21 @@ class Dt extends Rt {
5226
5506
  return [];
5227
5507
  }
5228
5508
  }
5229
- class rs extends ns {
5509
+ class hs extends cs {
5230
5510
  /** 获取默认覆盖物群组 */
5231
5511
  getDefaultOverlayGroup() {
5232
- var a, l, c, h, u;
5512
+ var c, h, u, f, m, p, g;
5233
5513
  const s = this.layerGroups.get("默认图层群组");
5234
5514
  if (!s) return;
5235
- const t = (a = s.getLayer("点位图层")) == null ? void 0 : a.getGroup("点位覆盖物群组"), e = (l = s.getLayer("线段图层")) == null ? void 0 : l.getGroup("线段覆盖物群组"), i = (c = s.getLayer("多边形图层")) == null ? void 0 : c.getGroup("多边形覆盖物群组"), n = (h = s.getLayer("文字图层")) == null ? void 0 : h.getGroup("文字覆盖物群组"), o = (u = s.getLayer("自定义绘制图层")) == null ? void 0 : u.getGroup("自定义绘制覆盖物群组");
5515
+ const t = (c = s.getLayer("点位图层")) == null ? void 0 : c.getGroup("点位覆盖物群组"), e = (h = s.getLayer("线段图层")) == null ? void 0 : h.getGroup("线段覆盖物群组"), i = (u = s.getLayer("多边形图层")) == null ? void 0 : u.getGroup("多边形覆盖物群组"), n = (f = s.getLayer("文字图层")) == null ? void 0 : f.getGroup("文字覆盖物群组"), o = (m = s.getLayer("自定义绘制图层")) == null ? void 0 : m.getGroup("自定义绘制覆盖物群组"), a = (p = s.getLayer("图片图层")) == null ? void 0 : p.getGroup("图片覆盖物群组"), l = (g = s.getLayer("其他图层")) == null ? void 0 : g.getGroup("其他覆盖物群组");
5236
5516
  return {
5237
5517
  overlays_text: n,
5238
5518
  overlays_point: t,
5239
5519
  overlays_line: e,
5240
5520
  overlays_polygon: i,
5241
- overlays_custom: o
5521
+ overlays_custom: o,
5522
+ overlays_billboard: a,
5523
+ overlays_other: l
5242
5524
  };
5243
5525
  }
5244
5526
  /**
@@ -5249,13 +5531,13 @@ class rs extends ns {
5249
5531
  const t = [], e = s !== void 0 ? Array.isArray(s) ? [...s] : [s] : Array.from(this.layerGroups.values());
5250
5532
  for (; e.length > 0; ) {
5251
5533
  const i = e.pop();
5252
- if (i instanceof Dt) {
5534
+ if (i instanceof Rt) {
5253
5535
  if (!i.isVisible) continue;
5254
5536
  e.push(...i.layers.values());
5255
- } else if (i instanceof it) {
5537
+ } else if (i instanceof j) {
5256
5538
  if (!i.isVisible) continue;
5257
5539
  e.push(...i.groups.values());
5258
- } else if (i instanceof et) {
5540
+ } else if (i instanceof Y) {
5259
5541
  if (!i.isVisible) continue;
5260
5542
  e.push(...i.overlays.values());
5261
5543
  } else
@@ -5264,7 +5546,7 @@ class rs extends ns {
5264
5546
  return t;
5265
5547
  }
5266
5548
  }
5267
- class os extends rs {
5549
+ class us extends hs {
5268
5550
  /** 缩放画布 */
5269
5551
  zoom(s) {
5270
5552
  const { canvas: t, rect: e } = this;
@@ -5297,7 +5579,7 @@ class os extends rs {
5297
5579
  super.setDefaultCenter(s), this.redrawOnce();
5298
5580
  }
5299
5581
  }
5300
- class as extends os {
5582
+ class ds extends us {
5301
5583
  /**
5302
5584
  * 调整视图以适应指定覆盖层
5303
5585
  * @param overlays 目标覆盖层数组,默认使用全部可见覆盖层
@@ -5352,16 +5634,16 @@ class as extends os {
5352
5634
  const { cycle: n, delta: o, axisConfig: a, rect: l } = this, { width: c, height: h } = l, u = Math.max(0, c - e[1] - e[3]) || c, f = Math.max(0, h - e[0] - e[2]) || h;
5353
5635
  if (u <= 0 || f <= 0)
5354
5636
  return console.warn("无效的可视区域尺寸,边距设置可能不合理"), this.scale;
5355
- const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min, b = n * o;
5356
- let C;
5637
+ const m = s / u, p = t / f, g = Math.max(m, p), y = a.count, w = y / a.min, P = n * o;
5638
+ let b;
5357
5639
  if (g > w) {
5358
- const M = Math.ceil(g / w);
5359
- C = 1 - ((y * M / g - a.min) / a.min + (M - 2)) * b;
5640
+ const _ = Math.ceil(g / w);
5641
+ b = 1 - ((y * _ / g - a.min) / a.min + (_ - 2)) * P;
5360
5642
  } else {
5361
- const M = (ut, rt, vt) => ut < rt ? vt - 1 : M(ut / 2, rt, vt + 1), A = M(w, g, 0), U = Math.pow(2, A);
5362
- C = 1 + ((y / U / g - a.min) / a.min + A) * b;
5643
+ const _ = (dt, rt, vt) => dt < rt ? vt - 1 : _(dt / 2, rt, vt + 1), A = _(w, g, 0), X = Math.pow(2, A);
5644
+ b = 1 + ((y / X / g - a.min) / a.min + A) * P;
5363
5645
  }
5364
- return i !== void 0 && (C = Math.min(i, C)), C = new D(C).div(o).round().mul(o).toNumber(), C;
5646
+ return i !== void 0 && (b = Math.min(i, b)), b = new R(b).div(o).round().mul(o).toNumber(), b;
5365
5647
  }
5366
5648
  /** 计算目标位置偏移 */
5367
5649
  calculateOffsetDifference(s, t, e, i, n) {
@@ -5409,13 +5691,13 @@ class as extends os {
5409
5691
  animateScale(s, t, e, i) {
5410
5692
  const n = t - s;
5411
5693
  let o = 0;
5412
- Ut((a) => {
5694
+ Wt((a) => {
5413
5695
  !this.isAuto || !this.canvas || !this.isInteractive || (this.setScale("center", (a - o) * n), o = a, this.redrawOnce(), a === 1 && i());
5414
5696
  }, e);
5415
5697
  }
5416
5698
  /** 执行偏移动画 */
5417
5699
  animateOffset(s, t, e, i) {
5418
- Ut((n) => {
5700
+ Wt((n) => {
5419
5701
  !this.isAuto || !this.canvas || !this.isInteractive || (this.offset = {
5420
5702
  x: Number((s.x + t.x * n).toFixed(0)),
5421
5703
  y: Number((s.y + t.y * n).toFixed(0))
@@ -5440,7 +5722,7 @@ class as extends os {
5440
5722
  });
5441
5723
  }
5442
5724
  }
5443
- class ls extends as {
5725
+ class fs extends ds {
5444
5726
  /** 开关坐标轴 */
5445
5727
  toggleAxis(s) {
5446
5728
  this.drawAxis.toggleAxis(s), this.redrawOnce();
@@ -5465,7 +5747,7 @@ class ls extends as {
5465
5747
  return this.isInteractive = s ?? !this.isInteractive, this.isInteractive;
5466
5748
  }
5467
5749
  }
5468
- class cs extends ls {
5750
+ class ms extends fs {
5469
5751
  /**
5470
5752
  * 清除指定区域的像素点
5471
5753
  * @param ctx - Canvas 2D绘图上下文
@@ -5476,9 +5758,9 @@ class cs extends ls {
5476
5758
  s.save(), s.beginPath(), s.clip(t), s.clearRect(0, 0, e, i), s.restore();
5477
5759
  }
5478
5760
  }
5479
- class hs extends cs {
5761
+ class gs extends ms {
5480
5762
  }
5481
- class us {
5763
+ class ps {
5482
5764
  constructor(s) {
5483
5765
  /** 画布 */
5484
5766
  d(this, "canvas");
@@ -5591,35 +5873,39 @@ class us {
5591
5873
  let g = i.y + f + u;
5592
5874
  g = Math.max(Math.min(g, c - u), u + f);
5593
5875
  const y = i.y > c || i.y < 0;
5594
- let w = i.x > 0 ? i.x % p : i.x < 0 ? p + i.x % p : 0, b = s.getAxisValueByPoint((w - i.x) * n.x, 0).xV;
5876
+ let w = i.x > 0 ? i.x % p : i.x < 0 ? p + i.x % p : 0, P = s.getAxisValueByPoint((w - i.x) * n.x, 0).xV;
5595
5877
  for (; w <= l; ) {
5596
- const C = se(b), M = h(C);
5597
- b !== 0 && this.drawText(C, w - M / 2, g, y), w += p, b = new D(m).mul(n.x).add(b).toNumber();
5878
+ const b = le(P), _ = h(b);
5879
+ P !== 0 && this.drawText(b, w - _ / 2, g, y), w += p, P = new R(m).mul(n.x).add(P).toNumber();
5598
5880
  }
5599
5881
  }
5600
5882
  {
5601
5883
  const g = i.x > l || i.x < 0;
5602
5884
  let y = i.y > 0 ? i.y % p : i.y < 0 ? p + i.y % p : 0, w = s.getAxisValueByPoint(0, (y - i.y) * n.y).yV;
5603
5885
  for (; y <= c; ) {
5604
- const b = se(w), C = h(b);
5605
- let M = i.x - C - u;
5606
- M = Math.max(Math.min(M, l - C - u), u), w != 0 && this.drawText(b, M, y + f / 2, g), y += p, w = new D(m).mul(n.y).add(w).toNumber();
5886
+ const P = le(w), b = h(P);
5887
+ let _ = i.x - b - u;
5888
+ _ = Math.max(Math.min(_, l - b - u), u), w != 0 && this.drawText(P, _, y + f / 2, g), y += p, w = new R(m).mul(n.y).add(w).toNumber();
5607
5889
  }
5608
5890
  }
5609
5891
  }
5610
5892
  }
5611
- class ds {
5893
+ class vs {
5612
5894
  constructor(s) {
5613
5895
  /** 绑定的画布实例 */
5614
5896
  d(this, "canvas");
5615
- d(this, "layerGroup", new L.LayerGroup({ name: "创建覆盖物图层群组" }));
5897
+ d(this, "layerGroup", new T.LayerGroup({
5898
+ name: "创建覆盖物图层群组"
5899
+ }));
5616
5900
  /** 创建中覆盖物的绘制层(置顶以保证可见) */
5617
- d(this, "overlayLayer", new L.Layer({
5901
+ d(this, "overlayLayer", new T.Layer({
5618
5902
  name: "creator-layer",
5619
5903
  zIndex: 9999
5620
5904
  }));
5621
5905
  /** 该层内的覆盖物分组,便于统一增删 */
5622
- d(this, "overlayGroup", new L.OverlayGroup({ name: "creator-group" }));
5906
+ d(this, "overlayGroup", new T.OverlayGroup({
5907
+ name: "creator-group"
5908
+ }));
5623
5909
  /** 当前正在创建的覆盖物(多边形或线),其顶点通过 overlay.value 即坐标轴上的值表示 */
5624
5910
  d(this, "overlay");
5625
5911
  /** 已确定的顶点在坐标轴上的值列表 [x, y][],对应 overlay.value */
@@ -5657,7 +5943,7 @@ class ds {
5657
5943
  d(this, "handleContextmenu", (s, t) => {
5658
5944
  var i, n;
5659
5945
  if (!this.overlay) return;
5660
- (((i = this.axisValueList) == null ? void 0 : i.length) ?? 0) >= this.minPointCount ? (this.overlay.value = this.axisValueList, (n = this.finish) == null || n.call(this, this.overlay)) : this.overlayGroup.removeOverlays(this.overlay), this.overlay = void 0, this.axisValueList = void 0, this.restoreLayerGroupsInteractive();
5946
+ (((i = this.axisValueList) == null ? void 0 : i.length) ?? 0) >= this.minPointCount ? (this.overlay.value = this.axisValueList, (n = this.finish) == null || n.call(this, this.overlay)) : this.overlayGroup.removeOverlay(this.overlay), this.overlay = void 0, this.axisValueList = void 0, this.restoreLayerGroupsInteractive();
5661
5947
  });
5662
5948
  this.canvas = s, this.overlayLayer.addGroup(this.overlayGroup), this.layerGroup.addLayer(this.overlayLayer), s.setLayerGroup(this.layerGroup), s.addEventListener("click", this.handleClick), s.addEventListener("contextmenu", this.handleContextmenu), s.canvas.addEventListener("mousemove", this.handleMousemove);
5663
5949
  }
@@ -5682,18 +5968,18 @@ class ds {
5682
5968
  }), this.savedLayerGroupInteractive.clear();
5683
5969
  }
5684
5970
  createLine() {
5685
- return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlays(this.overlay), this.axisValueList = [], this.overlay = new L.Line({}), this.overlayGroup.addOverlays(this.overlay), this.overlay;
5971
+ return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new T.Line({}), this.overlayGroup.addOverlay(this.overlay), this.overlay;
5686
5972
  }
5687
5973
  createPolygon() {
5688
- return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlays(this.overlay), this.axisValueList = [], this.overlay = new L.Polygon({}), this.overlayGroup.addOverlays(this.overlay), this.overlay;
5974
+ return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new T.Polygon({}), this.overlayGroup.addOverlay(this.overlay), this.overlay;
5689
5975
  }
5690
5976
  /** 从创建层中移除指定覆盖物,不传则清空该层全部 */
5691
- removeOverlays(s) {
5692
- s ? this.overlayGroup.removeOverlays(s) : this.overlayGroup.clearOverlays();
5977
+ removeOverlay(s) {
5978
+ s ? this.overlayGroup.removeOverlay(s) : this.overlayGroup.clearOverlay();
5693
5979
  }
5694
5980
  /** 清空创建层并重置当前创建状态 */
5695
5981
  clear() {
5696
- this.restoreLayerGroupsInteractive(), this.overlayGroup.clearOverlays(), this.overlay = void 0, this.axisValueList = void 0;
5982
+ this.restoreLayerGroupsInteractive(), this.overlayGroup.clearOverlay(), this.overlay = void 0, this.axisValueList = void 0;
5697
5983
  }
5698
5984
  /** 销毁实例:清空覆盖物并移除所有事件监听 */
5699
5985
  destroy() {
@@ -5701,7 +5987,7 @@ class ds {
5701
5987
  }
5702
5988
  /** 当前类型完成绘制所需的最少顶点数(多边形 3,线 2) */
5703
5989
  get minPointCount() {
5704
- return this.overlay instanceof L.Polygon ? 3 : this.overlay instanceof L.Line ? 2 : 0;
5990
+ return this.overlay instanceof T.Polygon ? 3 : this.overlay instanceof T.Line ? 2 : 0;
5705
5991
  }
5706
5992
  /** 从鼠标事件得到坐标轴上的 [x, y],若设置了限位器则先限位再返回 */
5707
5993
  getAxisValueFromEvent(s) {
@@ -5713,7 +5999,7 @@ class ds {
5713
5999
  }
5714
6000
  }
5715
6001
  }
5716
- class fs {
6002
+ class ys {
5717
6003
  /**
5718
6004
  * 计算默认缩放比例,使图像适配视图容器
5719
6005
  * @param naturalWidth 图像原始宽度
@@ -5748,35 +6034,195 @@ class fs {
5748
6034
  };
5749
6035
  }
5750
6036
  }
5751
- function Lt(r) {
6037
+ class ws extends D {
6038
+ constructor() {
6039
+ super(...arguments);
6040
+ d(this, "_ready", !1);
6041
+ d(this, "image", new Image());
6042
+ d(this, "_url");
6043
+ d(this, "_objectFit", "fill");
6044
+ }
6045
+ get ready() {
6046
+ return this._ready;
6047
+ }
6048
+ set ready(t) {
6049
+ var e;
6050
+ this._ready != t && (this._ready = t, (e = this.notifyReload) == null || e.call(this));
6051
+ }
6052
+ get url() {
6053
+ return this._url;
6054
+ }
6055
+ set url(t) {
6056
+ this._url != t && (this._url = t, this.updateBaseData());
6057
+ }
6058
+ get objectFit() {
6059
+ return this._objectFit;
6060
+ }
6061
+ set objectFit(t) {
6062
+ var e;
6063
+ this._objectFit != t && (this._objectFit = t, (e = this.notifyReload) == null || e.call(this));
6064
+ }
6065
+ /** 当前广告牌绘制矩形(左上角坐标 + 宽高) */
6066
+ get drawRect() {
6067
+ const { mainCanvas: t, finalDynamicPosition: e, value: i, image: n, objectFit: o } = this, [a, l] = e[0];
6068
+ let c = n.naturalWidth, h = n.naturalHeight;
6069
+ if (t && i && i.length > 1) {
6070
+ const P = [
6071
+ i[1][0] - i[0][0],
6072
+ i[1][1] - i[0][1]
6073
+ ], b = t.getAxisPointByValue(
6074
+ P[0],
6075
+ P[1]
6076
+ );
6077
+ c = b.x, h = b.y;
6078
+ }
6079
+ const u = {
6080
+ x: a,
6081
+ y: l,
6082
+ w: c,
6083
+ h
6084
+ }, f = n.naturalWidth, m = n.naturalHeight;
6085
+ if (f <= 0 || m <= 0 || u.w <= 0 || u.h <= 0)
6086
+ return u;
6087
+ const p = u.w / u.h, g = f / m;
6088
+ if (o === "fill") return u;
6089
+ if (o === "contain" || o === "scale-down") {
6090
+ const P = Math.min(u.w / f, u.h / m), b = o === "scale-down" ? Math.min(1, P) : P, _ = f * b, A = m * b;
6091
+ return {
6092
+ x: u.x + (u.w - _) / 2,
6093
+ y: u.y + (u.h - A) / 2,
6094
+ w: _,
6095
+ h: A
6096
+ };
6097
+ }
6098
+ if (g > p) {
6099
+ const P = m * p, b = (f - P) / 2;
6100
+ return {
6101
+ ...u,
6102
+ sx: b,
6103
+ sy: 0,
6104
+ sw: P,
6105
+ sh: m
6106
+ };
6107
+ }
6108
+ const y = f / p, w = (m - y) / 2;
6109
+ return {
6110
+ ...u,
6111
+ sx: 0,
6112
+ sy: w,
6113
+ sw: f,
6114
+ sh: y
6115
+ };
6116
+ }
6117
+ loadImage() {
6118
+ this.ready = !1, this.url && (this.image.onload = () => {
6119
+ this.ready = !0;
6120
+ }, this.image.onerror = () => {
6121
+ this.ready = !1, console.error("图片加载失败");
6122
+ }, this.image.src = this.url);
6123
+ }
6124
+ updateBaseData() {
6125
+ this.mainCanvas && (this.loadImage(), this.handleValuePosition("array2D", 1));
6126
+ }
6127
+ }
6128
+ class ae extends ws {
6129
+ constructor(t) {
6130
+ super(t);
6131
+ d(this, "defaultDragg", (t, e) => {
6132
+ var l;
6133
+ const { offsetX: i, offsetY: n } = t.data, { x: o, y: a } = this.calculateOffset(i, n);
6134
+ this.value.forEach((c, h) => {
6135
+ this.value[h] = [
6136
+ k.add(this.value[h][0], o.value),
6137
+ k.add(this.value[h][1], a.value)
6138
+ ], this.position[h] = [
6139
+ k.add(this.position[h][0], o.position),
6140
+ k.add(this.position[h][1], a.position)
6141
+ ], this.dynamicPosition[h] = [
6142
+ k.add(this.dynamicPosition[h][0], o.dynamicPosition),
6143
+ k.add(this.dynamicPosition[h][1], a.dynamicPosition)
6144
+ ];
6145
+ }), (l = this.notifyReload) == null || l.call(this), this.updateValueScope();
6146
+ });
6147
+ const { url: e, objectFit: i } = t;
6148
+ Object.assign(this, { url: e, objectFit: i }), this.addEventListener("dragg", this.defaultDragg);
6149
+ }
6150
+ updateValueScope() {
6151
+ this.initValueScope();
6152
+ }
6153
+ isPointInPath(t, e) {
6154
+ return this.path ? D.ctx.isPointInPath(this.path, t, e) : !1;
6155
+ }
6156
+ isPointInStroke(t, e) {
6157
+ return !1;
6158
+ }
6159
+ /** 设置样式 */
6160
+ setOverlayStyles(t) {
6161
+ var o;
6162
+ const e = this.mainCanvas, i = e.style[e.theme].billboard;
6163
+ let n = {};
6164
+ return typeof this.style == "string" ? n = ((o = e.style[this.style]) == null ? void 0 : o.billboard) || i : typeof this.style == "object" ? n = ct(
6165
+ JSON.parse(JSON.stringify(i)),
6166
+ this.style
6167
+ ) : n = i, t && this.setBaseLineStyle(t, n.stroke), n;
6168
+ }
6169
+ get computedValueScopeStyles() {
6170
+ return {};
6171
+ }
6172
+ draw(t) {
6173
+ const { mainCanvas: e, ready: i, image: n, isHover: o } = this;
6174
+ if (!e || !i) return;
6175
+ this.setGlobalAlpha(t), this.setOverlayStyles(t);
6176
+ const { x: a, y: l, w: c, h, sx: u, sy: f, sw: m, sh: p } = this.drawRect;
6177
+ typeof u == "number" && typeof f == "number" && typeof m == "number" && typeof p == "number" ? t.drawImage(n, u, f, m, p, a, l, c, h) : t.drawImage(n, a, l, c, h), o && t.strokeRect(a, l, c, h), this.path = new Path2D(), this.path.rect(a, l, c, h);
6178
+ }
6179
+ getDraw() {
6180
+ if (this.isNeedRender) {
6181
+ if (this.isRecalculate) {
6182
+ const { position: t, mainCanvas: e } = this;
6183
+ this.internalUpdate({
6184
+ dynamicPosition: e.transformPosition(t)
6185
+ });
6186
+ }
6187
+ return [this.draw, this];
6188
+ }
6189
+ }
6190
+ }
6191
+ function Ht(r) {
5752
6192
  return [r].flat(1 / 0);
5753
6193
  }
5754
- class L extends hs {
6194
+ class T extends gs {
5755
6195
  constructor(t) {
5756
6196
  super(t);
5757
6197
  /** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
5758
6198
  d(this, "overlayCreator");
5759
- this.drawAxis = new us(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new ds(this), this.initLayerGroups(), this.updateCenter();
6199
+ this.drawAxis = new ps(this), "axisShow" in t && this.toggleAxis(t.axisShow), this.overlayCreator = new vs(this), this.initLayerGroups(), this.updateCenter();
5760
6200
  }
5761
6201
  initLayerGroups() {
5762
- const t = new it({ name: "多边形图层", zIndex: 1 });
5763
- t.addGroup(new et({ name: "多边形覆盖物群组" }));
5764
- const e = new it({ name: "线段图层", zIndex: 2 });
5765
- e.addGroup(new et({ name: "线段覆盖物群组" }));
5766
- const i = new it({ name: "点位图层", zIndex: 3 });
5767
- i.addGroup(new et({ name: "点位覆盖物群组" }));
5768
- const n = new it({ name: "文字图层", zIndex: 4 });
5769
- n.addGroup(new et({ name: "文字覆盖物群组" }));
5770
- const o = new it({ name: "自定义绘制图层", zIndex: 5 });
5771
- o.addGroup(new et({ name: "自定义绘制覆盖物群组" }));
5772
- const a = new Dt({ name: "默认图层群组" });
5773
- a.addLayer([
6202
+ const t = new j({ name: "其他图层", zIndex: 1 });
6203
+ t.addGroup(new Y({ name: "其他覆盖物群组" }));
6204
+ const e = new j({ name: "图片图层", zIndex: 2 });
6205
+ e.addGroup(new Y({ name: "图片覆盖物群组" }));
6206
+ const i = new j({ name: "多边形图层", zIndex: 3 });
6207
+ i.addGroup(new Y({ name: "多边形覆盖物群组" }));
6208
+ const n = new j({ name: "线段图层", zIndex: 4 });
6209
+ n.addGroup(new Y({ name: "线段覆盖物群组" }));
6210
+ const o = new j({ name: "点位图层", zIndex: 5 });
6211
+ o.addGroup(new Y({ name: "点位覆盖物群组" }));
6212
+ const a = new j({ name: "文字图层", zIndex: 6 });
6213
+ a.addGroup(new Y({ name: "文字覆盖物群组" }));
6214
+ const l = new j({ name: "自定义绘制图层", zIndex: 7 });
6215
+ l.addGroup(new Y({ name: "自定义绘制覆盖物群组" }));
6216
+ const c = new Rt({ name: "默认图层群组" });
6217
+ c.addLayer([
6218
+ a,
6219
+ o,
5774
6220
  n,
5775
6221
  i,
6222
+ l,
5776
6223
  e,
5777
- t,
5778
- o
5779
- ]), this.setLayerGroup(a);
6224
+ t
6225
+ ]), this.setLayerGroup(c);
5780
6226
  }
5781
6227
  /** 获取图层群组 集合 */
5782
6228
  gteLayerGroups(t = "默认图层群组") {
@@ -5784,21 +6230,21 @@ class L extends hs {
5784
6230
  }
5785
6231
  /** 设置图层群组 */
5786
6232
  setLayerGroup(t) {
5787
- t instanceof Dt && (this.layerGroups.set(t.name, t), t.setNotifyReload(() => this.redrawOnce()), t.setMainCanvas(this), t.parent = this);
6233
+ t instanceof Rt && (this.layerGroups.set(t.name, t), t.setNotifyReload(() => this.redrawOnce()), t.setMainCanvas(this), t.parent = this);
5788
6234
  }
5789
6235
  /** 移除图层群组 */
5790
6236
  removeLayerGroup(t) {
5791
- t instanceof Dt && (this.layerGroups.delete(t.name), t.setNotifyReload(), t.setMainCanvas(), t.parent = void 0, this.redrawOnce());
6237
+ t instanceof Rt && (this.layerGroups.delete(t.name), t.setNotifyReload(), t.setMainCanvas(), t.parent = void 0, this.redrawOnce());
5792
6238
  }
5793
6239
  /** 添加图层 */
5794
6240
  addLayer(t) {
5795
6241
  const e = this.layerGroups.get("默认图层群组");
5796
- e && e.addLayer(Lt(t));
6242
+ e && e.addLayer(Ht(t));
5797
6243
  }
5798
6244
  /** 移除图层 */
5799
6245
  removeLayer(t) {
5800
6246
  const e = this.layerGroups.get("默认图层群组");
5801
- e && e.removeLayer(Lt(t));
6247
+ e && e.removeLayer(Ht(t));
5802
6248
  }
5803
6249
  /** 添加覆盖物 */
5804
6250
  addOverlay(t) {
@@ -5807,10 +6253,12 @@ class L extends hs {
5807
6253
  overlays_point: i,
5808
6254
  overlays_line: n,
5809
6255
  overlays_polygon: o,
5810
- overlays_custom: a
6256
+ overlays_custom: a,
6257
+ overlays_billboard: l,
6258
+ overlays_other: c
5811
6259
  } = this.getDefaultOverlayGroup() || {};
5812
- Lt(t).forEach((l) => {
5813
- l instanceof Bt ? e == null || e.addOverlays(l) : l instanceof lt ? i == null || i.addOverlays(l) : l instanceof Xt || l instanceof de || l instanceof fe ? n == null || n.addOverlays(l) : l instanceof Gt ? o == null || o.addOverlays(l) : l instanceof Ft && (a == null || a.addOverlays(l));
6260
+ Ht(t).forEach((h) => {
6261
+ h instanceof Ut ? e == null || e.addOverlay(h) : h instanceof lt ? i == null || i.addOverlay(h) : h instanceof Xt || h instanceof Yt || h instanceof jt ? n == null || n.addOverlay(h) : h instanceof zt ? o == null || o.addOverlay(h) : h instanceof Gt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.addOverlay(h) : c == null || c.addOverlay(h);
5814
6262
  });
5815
6263
  }
5816
6264
  /** 移除覆盖物 */
@@ -5820,10 +6268,12 @@ class L extends hs {
5820
6268
  overlays_point: i,
5821
6269
  overlays_line: n,
5822
6270
  overlays_polygon: o,
5823
- overlays_custom: a
6271
+ overlays_custom: a,
6272
+ overlays_billboard: l,
6273
+ overlays_other: c
5824
6274
  } = this.getDefaultOverlayGroup() || {};
5825
- Lt(t).forEach((l) => {
5826
- l instanceof Bt ? e == null || e.removeOverlays(l) : l instanceof lt ? i == null || i.removeOverlays(l) : l instanceof Xt ? n == null || n.removeOverlays(l) : l instanceof Gt ? o == null || o.removeOverlays(l) : l instanceof Ft && (a == null || a.addOverlays(l));
6275
+ Ht(t).forEach((h) => {
6276
+ h instanceof Ut ? e == null || e.removeOverlay(h) : h instanceof lt ? i == null || i.removeOverlay(h) : h instanceof Xt || h instanceof Yt || h instanceof jt ? n == null || n.removeOverlay(h) : h instanceof zt ? o == null || o.removeOverlay(h) : h instanceof Gt ? a == null || a.addOverlay(h) : h instanceof ae ? l == null || l.removeOverlay(h) : c == null || c.removeOverlay(h);
5827
6277
  });
5828
6278
  }
5829
6279
  /** 销毁 */
@@ -5832,18 +6282,19 @@ class L extends hs {
5832
6282
  }
5833
6283
  }
5834
6284
  /** 视图适配工具:默认缩放、居中计算 */
5835
- d(L, "ViewFit", fs), /** 图层群组 */
5836
- d(L, "LayerGroup", Dt), /** 图层 */
5837
- d(L, "Layer", it), /** 覆盖物群组 */
5838
- d(L, "OverlayGroup", et), /** 文字 */
5839
- d(L, "Text", Bt), /** 点位 */
5840
- d(L, "Point", lt), /** 线段 */
5841
- d(L, "Line", Xt), /** 多边形 */
5842
- d(L, "Polygon", Gt), /** 自定义绘制 */
5843
- d(L, "Custom", Ft), /** 圆弧 */
5844
- d(L, "Arc", de), /** 圆角 */
5845
- d(L, "ArcTo", fe);
5846
- class ms {
6285
+ d(T, "ViewFit", ys), /** 图层群组 */
6286
+ d(T, "LayerGroup", Rt), /** 图层 */
6287
+ d(T, "Layer", j), /** 覆盖物群组 */
6288
+ d(T, "OverlayGroup", Y), /** 文字 */
6289
+ d(T, "Text", Ut), /** 点位 */
6290
+ d(T, "Point", lt), /** 线段 */
6291
+ d(T, "Line", Xt), /** 多边形 */
6292
+ d(T, "Polygon", zt), /** 自定义绘制 */
6293
+ d(T, "Custom", Gt), /** 圆弧 */
6294
+ d(T, "Arc", Yt), /** 圆角 */
6295
+ d(T, "ArcTo", jt), /** 图片 */
6296
+ d(T, "Billboard", ae);
6297
+ class xs {
5847
6298
  /** @param id canvas DOM id(通过 getElementById 定位) */
5848
6299
  constructor(s) {
5849
6300
  /** Canvas DOM id(用于 `document.getElementById` 定位) */
@@ -5897,7 +6348,7 @@ class ms {
5897
6348
  this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0);
5898
6349
  }
5899
6350
  }
5900
- class gs {
6351
+ class Ps {
5901
6352
  /**
5902
6353
  * @param canvas 绑定 mousedown 的 canvas
5903
6354
  * @param onOffsetDelta 拖拽时的 dx 回调(由外部映射到时间偏移)
@@ -5936,7 +6387,7 @@ class gs {
5936
6387
  this.canvas.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("mouseup", this.handleMouseUp);
5937
6388
  }
5938
6389
  }
5939
- class ps {
6390
+ class bs {
5940
6391
  /**
5941
6392
  * @param canvas 绑定 wheel 事件的 canvas
5942
6393
  * @param getTimeSpacing 读取当前 timeSpacing 的函数
@@ -5971,7 +6422,7 @@ class ps {
5971
6422
  this.canvas.removeEventListener("wheel", this.handleWheel);
5972
6423
  }
5973
6424
  }
5974
- class vs {
6425
+ class Cs {
5975
6426
  /**
5976
6427
  * 只负责计算鼠标所在 x/y 对应的时间,并把结果通知给 TimeAxis(不直接操作 DOM)。
5977
6428
  */
@@ -6008,10 +6459,10 @@ class vs {
6008
6459
  this.canvas.removeEventListener("mousemove", this.handleMouseMove), this.canvas.removeEventListener("mouseleave", this.handleMouseLeave);
6009
6460
  }
6010
6461
  }
6011
- const ys = {
6462
+ const Ss = {
6012
6463
  easeInOutQuad: (r) => r < 0.5 ? 2 * r * r : 1 - Math.pow(-2 * r + 2, 2) / 2
6013
6464
  };
6014
- class ws {
6465
+ class Es {
6015
6466
  /**
6016
6467
  * 创建时间轴引擎:会在构造后 `requestAnimationFrame` 初始化并开始渲染。
6017
6468
  * @param id canvas DOM id
@@ -6057,13 +6508,13 @@ class ws {
6057
6508
  * 可用于叠加额外图形(如指示线、事件点等)
6058
6509
  */
6059
6510
  d(this, "onDrawOverlay");
6060
- this.canvasManager = new ms(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
6511
+ this.canvasManager = new xs(s), this.onMouseTimeChange = t, requestAnimationFrame(() => this.init());
6061
6512
  }
6062
6513
  /** 初始化交互:拖拽平移、滚轮缩放、鼠标时间通知,并触发首次绘制 */
6063
6514
  init() {
6064
6515
  if (!this.canvasManager.init(() => this.render())) return;
6065
6516
  const t = this.canvasManager.getCanvas();
6066
- t && (this.offsetDrag = new gs(
6517
+ t && (this.offsetDrag = new Ps(
6067
6518
  t,
6068
6519
  (e) => {
6069
6520
  this.currentTime -= Math.round(
@@ -6073,14 +6524,14 @@ class ws {
6073
6524
  () => {
6074
6525
  this.stopCenterTimeAnimation();
6075
6526
  }
6076
- ), this.wheelZoom = new ps(
6527
+ ), this.wheelZoom = new bs(
6077
6528
  t,
6078
6529
  () => this.timeSpacing,
6079
6530
  (e, i) => {
6080
6531
  const n = this.getTimeAtCanvasX(i);
6081
6532
  this.timeSpacing = e, this.setTimeAtCanvasX(n, i), this.render();
6082
6533
  }
6083
- ), this.centerTime = Date.now(), this.mouseTimeReporter = new vs(
6534
+ ), this.centerTime = Date.now(), this.mouseTimeReporter = new Cs(
6084
6535
  t,
6085
6536
  (e) => this.getTimeAtCanvasX(e),
6086
6537
  (e) => {
@@ -6122,10 +6573,10 @@ class ws {
6122
6573
  const m = e / o;
6123
6574
  let p = h, g = 0, y = u;
6124
6575
  for (; y <= f; ) {
6125
- const w = g % o === 0, b = w ? a : l;
6126
- if (s.fillRect(y, 0, 1, b), w) {
6127
- const C = $e(p, "MM-DD hh:mm:ss");
6128
- s.fillText(C, y, c), p += t;
6576
+ const w = g % o === 0, P = w ? a : l;
6577
+ if (s.fillRect(y, 0, 1, P), w) {
6578
+ const b = ti(p, "MM-DD hh:mm:ss");
6579
+ s.fillText(b, y, c), p += t;
6129
6580
  }
6130
6581
  y += m, g++;
6131
6582
  }
@@ -6179,8 +6630,8 @@ class ws {
6179
6630
  Math.max(0.5, h)
6180
6631
  );
6181
6632
  return Math.max(1, Math.round(u * 60));
6182
- })(), a = (t == null ? void 0 : t.curve) ?? ys.easeInOutQuad;
6183
- qe(
6633
+ })(), a = (t == null ? void 0 : t.curve) ?? Ss.easeInOutQuad;
6634
+ Ke(
6184
6635
  0,
6185
6636
  1,
6186
6637
  o,
@@ -6201,7 +6652,27 @@ class ws {
6201
6652
  (s = this.offsetDrag) == null || s.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
6202
6653
  }
6203
6654
  }
6204
- class rn extends ws {
6655
+ class fn extends Es {
6656
+ /**
6657
+ * 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
6658
+ * @param rect 矩形区域,用于计算渐变起止点
6659
+ * @param fillStyle 纯色字符串或渐变配置
6660
+ */
6661
+ resolveFillStyle(s, t) {
6662
+ if (!t) return;
6663
+ const e = this.canvasManager.getContext();
6664
+ if (!e) return;
6665
+ if (typeof t == "string") return t;
6666
+ const i = e.createLinearGradient(
6667
+ s.x + s.width * t.x1,
6668
+ s.y + s.height * t.y1,
6669
+ s.x + s.width * t.x2,
6670
+ s.y + s.height * t.y2
6671
+ );
6672
+ return t.colorStops.forEach(
6673
+ ({ color: n, offset: o }) => i.addColorStop(o, n)
6674
+ ), i;
6675
+ }
6205
6676
  /**
6206
6677
  * 按时间范围绘制圆角矩形(常用于高亮某段时间区间)
6207
6678
  */
@@ -6218,11 +6689,112 @@ class rn extends ws {
6218
6689
  strokeStyle: h = "#2080f0",
6219
6690
  lineWidth: u = 1
6220
6691
  } = s, f = this.getCanvasXAtTime(i), p = this.getCanvasXAtTime(n) - f;
6221
- p && (c && (t.fillStyle = c), h && (t.strokeStyle = h), t.lineWidth = u, t.beginPath(), typeof t.roundRect == "function" ? t.roundRect(f, o, p, a - o, l) : t.rect(f, o, p, a - o), c && t.fill(), h && t.stroke());
6692
+ if (!p) return;
6693
+ const g = this.resolveFillStyle({ x: f, y: o, width: p, height: a }, c);
6694
+ g && (t.fillStyle = g), h && (t.strokeStyle = h), t.lineWidth = u, t.beginPath(), typeof t.roundRect == "function" ? t.roundRect(f, o, p, a + o, l) : t.rect(f, o, p, a + o), c && t.fill(), h && t.stroke();
6222
6695
  }
6223
6696
  }
6224
- function on(r) {
6225
- const s = Re(r, 100);
6697
+ function Ot(r) {
6698
+ if (typeof r == "string") {
6699
+ const s = document.querySelector(r);
6700
+ if (s)
6701
+ return s;
6702
+ console.error(`Element "${r}" not found`);
6703
+ } else
6704
+ return r || document.documentElement;
6705
+ }
6706
+ function We(r) {
6707
+ const s = Ot(r);
6708
+ return s ? s.requestFullscreen ? s.requestFullscreen() : s.mozRequestFullScreen ? s.mozRequestFullScreen() : s.webkitRequestFullscreen ? s.webkitRequestFullscreen() : s.msRequestFullscreen ? s.msRequestFullscreen() : Promise.reject("No Fullscreen API") : Promise.reject("No Element");
6709
+ }
6710
+ function qe() {
6711
+ const r = document;
6712
+ return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
6713
+ }
6714
+ function Jt(r) {
6715
+ const s = Ot(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
6716
+ return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
6717
+ }
6718
+ function mn(r) {
6719
+ if (r = Ot(r), !!r)
6720
+ return function() {
6721
+ Jt(r) ? qe() : We(r);
6722
+ };
6723
+ }
6724
+ function gn(r, s) {
6725
+ const t = Ot(s);
6726
+ if (!t) return;
6727
+ const e = () => {
6728
+ r(Jt(t));
6729
+ };
6730
+ return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
6731
+ document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
6732
+ };
6733
+ }
6734
+ class pn {
6735
+ constructor(s, t) {
6736
+ /** 要全屏展示的目标元素 */
6737
+ d(this, "targetElement");
6738
+ /**
6739
+ * 全屏状态变化回调。参数为 `true` 表示当前全屏元素为本实例的目标元素。
6740
+ */
6741
+ d(this, "onFullscreenChange");
6742
+ /** 解除 {@link attachFullscreenChangeListeners} 注册的 document 监听 */
6743
+ d(this, "detachFullscreenListeners");
6744
+ this.init(s), this.onFullscreenChange = t, this.attachFullscreenChangeListeners();
6745
+ }
6746
+ /**
6747
+ * 设置或更新目标元素(`HTMLElement` 或 CSS 选择器;未传时内部会回退到 `document.documentElement`)
6748
+ */
6749
+ init(s) {
6750
+ this.targetElement = Ot(s);
6751
+ }
6752
+ /** 使目标元素进入浏览器全屏 */
6753
+ enter() {
6754
+ this.targetElement && We(this.targetElement);
6755
+ }
6756
+ /** 退出浏览器全屏(不区分由哪个元素进入) */
6757
+ exit() {
6758
+ this.targetElement && qe();
6759
+ }
6760
+ /** 若当前已为该目标全屏则退出,否则进入全屏 */
6761
+ toggle() {
6762
+ this.targetElement && (Jt(this.targetElement) ? this.exit() : this.enter());
6763
+ }
6764
+ attachFullscreenChangeListeners() {
6765
+ const s = () => {
6766
+ !this.targetElement || !this.onFullscreenChange || this.onFullscreenChange(Jt(this.targetElement));
6767
+ };
6768
+ document.addEventListener("fullscreenchange", s), document.addEventListener(
6769
+ "webkitfullscreenchange",
6770
+ s
6771
+ ), document.addEventListener(
6772
+ "mozfullscreenchange",
6773
+ s
6774
+ ), document.addEventListener("MSFullscreenChange", s), s(), this.detachFullscreenListeners = () => {
6775
+ document.removeEventListener(
6776
+ "fullscreenchange",
6777
+ s
6778
+ ), document.removeEventListener(
6779
+ "webkitfullscreenchange",
6780
+ s
6781
+ ), document.removeEventListener(
6782
+ "mozfullscreenchange",
6783
+ s
6784
+ ), document.removeEventListener(
6785
+ "MSFullscreenChange",
6786
+ s
6787
+ );
6788
+ };
6789
+ }
6790
+ /** 移除全屏事件监听,实例不应再使用 */
6791
+ destroy() {
6792
+ var s;
6793
+ (s = this.detachFullscreenListeners) == null || s.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
6794
+ }
6795
+ }
6796
+ function vn(r) {
6797
+ const s = Le(r, 100);
6226
6798
  let t = 0, e = 0;
6227
6799
  return function(i) {
6228
6800
  const n = i.target;
@@ -6250,7 +6822,7 @@ function on(r) {
6250
6822
  f(), m();
6251
6823
  };
6252
6824
  }
6253
- function an(r, s, t) {
6825
+ function yn(r, s, t) {
6254
6826
  const { isClickAllowed: e, uiLibrary: i = ["naiveUI", "ElementPlus", "Element"] } = t || {}, n = function(l) {
6255
6827
  const c = [];
6256
6828
  for (const h in l)
@@ -6282,21 +6854,21 @@ function an(r, s, t) {
6282
6854
  () => document.addEventListener("mousedown", a)
6283
6855
  );
6284
6856
  }
6285
- var Y, dt, ft, wt, xt, Z, Q, st, Pt;
6286
- class ln {
6857
+ var W, ft, mt, xt, Pt, J, K, st, bt;
6858
+ class wn {
6287
6859
  constructor() {
6288
- N(this, Y);
6289
- N(this, dt, !1);
6290
- N(this, ft, {});
6291
- N(this, wt, 0);
6292
- N(this, xt, 0);
6293
- N(this, Z, 0);
6294
- N(this, Q, 0);
6295
- N(this, st);
6296
- N(this, Pt);
6860
+ L(this, W);
6861
+ L(this, ft, !1);
6862
+ L(this, mt, {});
6863
+ L(this, xt, 0);
6864
+ L(this, Pt, 0);
6865
+ L(this, J, 0);
6866
+ L(this, K, 0);
6867
+ L(this, st);
6868
+ L(this, bt);
6297
6869
  }
6298
6870
  init(s, t) {
6299
- E(this, Y, s), E(this, st, t == null ? void 0 : t.limit), E(this, Pt, t == null ? void 0 : t.dragDom), E(this, ft, {
6871
+ M(this, W, s), M(this, st, t == null ? void 0 : t.limit), M(this, bt, t == null ? void 0 : t.dragDom), M(this, mt, {
6300
6872
  mousedown: this.mousedown.bind(this),
6301
6873
  mousemove: this.mousemove.bind(this),
6302
6874
  mouseup: this.mouseup.bind(this)
@@ -6307,45 +6879,45 @@ class ln {
6307
6879
  }
6308
6880
  bindOrUnbindEvent(s) {
6309
6881
  const t = s === "bind" ? "addEventListener" : "removeEventListener";
6310
- if (!x(this, Y)) return console.error("No DOM");
6311
- x(this, Y)[t]("mousedown", x(this, ft).mousedown), document[t]("mousemove", x(this, ft).mousemove), document[t]("mouseup", x(this, ft).mouseup);
6882
+ if (!x(this, W)) return console.error("No DOM");
6883
+ x(this, W)[t]("mousedown", x(this, mt).mousedown), document[t]("mousemove", x(this, mt).mousemove), document[t]("mouseup", x(this, mt).mouseup);
6312
6884
  }
6313
6885
  alterLocation() {
6314
- if (!x(this, Y)) return console.error("No DOM");
6315
- x(this, st) && (E(this, Z, Math.min(x(this, Z), x(this, st).max.top)), E(this, Z, Math.max(x(this, Z), x(this, st).min.top)), E(this, Q, Math.min(x(this, Q), x(this, st).max.left)), E(this, Q, Math.max(x(this, Q), x(this, st).min.left))), x(this, Y).style.setProperty("--top", x(this, Z) + "px"), x(this, Y).style.setProperty("--left", x(this, Q) + "px");
6886
+ if (!x(this, W)) return console.error("No DOM");
6887
+ x(this, st) && (M(this, J, Math.min(x(this, J), x(this, st).max.top)), M(this, J, Math.max(x(this, J), x(this, st).min.top)), M(this, K, Math.min(x(this, K), x(this, st).max.left)), M(this, K, Math.max(x(this, K), x(this, st).min.left))), x(this, W).style.setProperty("--top", x(this, J) + "px"), x(this, W).style.setProperty("--left", x(this, K) + "px");
6316
6888
  }
6317
6889
  mousedown(s) {
6318
- if (!x(this, Y)) return console.error("No DOM");
6319
- if (x(this, Pt) && s.target != x(this, Pt)) return;
6320
- document.body.classList.add("no-select"), E(this, dt, !0);
6321
- const t = x(this, Y).getBoundingClientRect(), { pageX: e, pageY: i } = s;
6322
- E(this, wt, e), E(this, xt, i), E(this, Z, t.y), E(this, Q, t.x);
6890
+ if (!x(this, W)) return console.error("No DOM");
6891
+ if (x(this, bt) && s.target != x(this, bt)) return;
6892
+ document.body.classList.add("no-select"), M(this, ft, !0);
6893
+ const t = x(this, W).getBoundingClientRect(), { pageX: e, pageY: i } = s;
6894
+ M(this, xt, e), M(this, Pt, i), M(this, J, t.y), M(this, K, t.x);
6323
6895
  }
6324
6896
  mousemove(s) {
6325
6897
  const { pageX: t, pageY: e } = s;
6326
- x(this, dt) && (E(this, Z, x(this, Z) + (e - x(this, xt))), E(this, Q, x(this, Q) + (t - x(this, wt))), E(this, wt, t), E(this, xt, e), this.alterLocation());
6898
+ x(this, ft) && (M(this, J, x(this, J) + (e - x(this, Pt))), M(this, K, x(this, K) + (t - x(this, xt))), M(this, xt, t), M(this, Pt, e), this.alterLocation());
6327
6899
  }
6328
6900
  mouseup() {
6329
- x(this, dt) && (E(this, dt, !1), document.body.classList.remove("no-select"));
6901
+ x(this, ft) && (M(this, ft, !1), document.body.classList.remove("no-select"));
6330
6902
  }
6331
6903
  }
6332
- Y = new WeakMap(), dt = new WeakMap(), ft = new WeakMap(), wt = new WeakMap(), xt = new WeakMap(), Z = new WeakMap(), Q = new WeakMap(), st = new WeakMap(), Pt = new WeakMap();
6333
- var j, mt, gt, bt, Ct, W, q, X, St, _t;
6334
- class cn {
6904
+ W = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), xt = new WeakMap(), Pt = new WeakMap(), J = new WeakMap(), K = new WeakMap(), st = new WeakMap(), bt = new WeakMap();
6905
+ var q, gt, pt, Ct, St, $, Z, G, Et, _t;
6906
+ class xn {
6335
6907
  constructor() {
6336
- N(this, j);
6337
- N(this, mt, !1);
6338
- N(this, gt, {});
6339
- N(this, bt, 0);
6340
- N(this, Ct, 0);
6341
- N(this, W, 0);
6342
- N(this, q, 0);
6343
- N(this, X);
6344
- N(this, St);
6345
- N(this, _t);
6908
+ L(this, q);
6909
+ L(this, gt, !1);
6910
+ L(this, pt, {});
6911
+ L(this, Ct, 0);
6912
+ L(this, St, 0);
6913
+ L(this, $, 0);
6914
+ L(this, Z, 0);
6915
+ L(this, G);
6916
+ L(this, Et);
6917
+ L(this, _t);
6346
6918
  }
6347
6919
  init(s, t = {}) {
6348
- E(this, j, s), E(this, X, t.limit), E(this, St, t.update_move), E(this, _t, t.update_up), E(this, gt, {
6920
+ M(this, q, s), M(this, G, t.limit), M(this, Et, t.update_move), M(this, _t, t.update_up), M(this, pt, {
6349
6921
  mousedown: this.mousedown.bind(this),
6350
6922
  mousemove: this.mousemove.bind(this),
6351
6923
  mouseup: this.mouseup.bind(this)
@@ -6356,17 +6928,17 @@ class cn {
6356
6928
  }
6357
6929
  bindOrUnbindEvent(s) {
6358
6930
  const t = s === "bind" ? "addEventListener" : "removeEventListener";
6359
- if (!x(this, j)) return console.error("No DOM");
6360
- x(this, j)[t]("mousedown", x(this, gt).mousedown), document[t]("mousemove", x(this, gt).mousemove), document[t]("mouseup", x(this, gt).mouseup);
6931
+ if (!x(this, q)) return console.error("No DOM");
6932
+ x(this, q)[t]("mousedown", x(this, pt).mousedown), document[t]("mousemove", x(this, pt).mousemove), document[t]("mouseup", x(this, pt).mouseup);
6361
6933
  }
6362
6934
  updateValue() {
6363
6935
  const s = {
6364
- top: x(this, W),
6365
- left: x(this, q),
6936
+ top: x(this, $),
6937
+ left: x(this, Z),
6366
6938
  percentage: { top: 0, left: 0 }
6367
6939
  };
6368
- if (x(this, X)) {
6369
- const t = (e) => x(this, X) ? (s[e] - x(this, X).min[e]) / (x(this, X).max[e] - x(this, X).min[e]) : 0;
6940
+ if (x(this, G)) {
6941
+ const t = (e) => x(this, G) ? (s[e] - x(this, G).min[e]) / (x(this, G).max[e] - x(this, G).min[e]) : 0;
6370
6942
  s.percentage = {
6371
6943
  top: t("top") || 0,
6372
6944
  left: t("left") || 0
@@ -6375,64 +6947,27 @@ class cn {
6375
6947
  return s;
6376
6948
  }
6377
6949
  alterLocation() {
6378
- if (!x(this, j)) return console.error("No DOM");
6379
- x(this, X) && (E(this, W, Math.min(x(this, W), x(this, X).max.top)), E(this, W, Math.max(x(this, W), x(this, X).min.top)), E(this, q, Math.min(x(this, q), x(this, X).max.left)), E(this, q, Math.max(x(this, q), x(this, X).min.left))), x(this, St) && x(this, St).call(this, this.updateValue()), x(this, j).style.setProperty("--top", x(this, W) + "px"), x(this, j).style.setProperty("--left", x(this, q) + "px");
6950
+ if (!x(this, q)) return console.error("No DOM");
6951
+ x(this, G) && (M(this, $, Math.min(x(this, $), x(this, G).max.top)), M(this, $, Math.max(x(this, $), x(this, G).min.top)), M(this, Z, Math.min(x(this, Z), x(this, G).max.left)), M(this, Z, Math.max(x(this, Z), x(this, G).min.left))), x(this, Et) && x(this, Et).call(this, this.updateValue()), x(this, q).style.setProperty("--top", x(this, $) + "px"), x(this, q).style.setProperty("--left", x(this, Z) + "px");
6380
6952
  }
6381
6953
  mousedown(s) {
6382
- if (!x(this, j)) return console.error("No DOM");
6383
- document.body.classList.add("no-select"), E(this, mt, !0);
6384
- const t = x(this, j).getBoundingClientRect();
6385
- E(this, Ct, t.y), E(this, bt, t.x);
6954
+ if (!x(this, q)) return console.error("No DOM");
6955
+ document.body.classList.add("no-select"), M(this, gt, !0);
6956
+ const t = x(this, q).getBoundingClientRect();
6957
+ M(this, St, t.y), M(this, Ct, t.x);
6386
6958
  const { pageX: e, pageY: i } = s;
6387
- E(this, W, i - x(this, Ct)), E(this, q, e - x(this, bt)), this.alterLocation();
6959
+ M(this, $, i - x(this, St)), M(this, Z, e - x(this, Ct)), this.alterLocation();
6388
6960
  }
6389
6961
  mousemove(s) {
6390
6962
  const { pageX: t, pageY: e } = s;
6391
- x(this, mt) && (E(this, W, e - x(this, Ct)), E(this, q, t - x(this, bt)), this.alterLocation());
6963
+ x(this, gt) && (M(this, $, e - x(this, St)), M(this, Z, t - x(this, Ct)), this.alterLocation());
6392
6964
  }
6393
6965
  mouseup() {
6394
- x(this, mt) && (E(this, mt, !1), document.body.classList.remove("no-select"), x(this, _t) && x(this, _t).call(this, this.updateValue()));
6966
+ x(this, gt) && (M(this, gt, !1), document.body.classList.remove("no-select"), x(this, _t) && x(this, _t).call(this, this.updateValue()));
6395
6967
  }
6396
6968
  }
6397
- j = new WeakMap(), mt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), Ct = new WeakMap(), W = new WeakMap(), q = new WeakMap(), X = new WeakMap(), St = new WeakMap(), _t = new WeakMap();
6398
- function Kt(r) {
6399
- if (typeof r == "string") {
6400
- const s = document.querySelector(r);
6401
- if (s)
6402
- return s;
6403
- console.error(`Element "${r}" not found`);
6404
- } else
6405
- return r || document.documentElement;
6406
- }
6407
- function xs(r) {
6408
- const s = Kt(r);
6409
- return s ? s.requestFullscreen ? s.requestFullscreen() : s.mozRequestFullScreen ? s.mozRequestFullScreen() : s.webkitRequestFullscreen ? s.webkitRequestFullscreen() : s.msRequestFullscreen ? s.msRequestFullscreen() : Promise.reject("No Fullscreen API") : Promise.reject("No Element");
6410
- }
6411
- function Ps() {
6412
- const r = document;
6413
- return document.exitFullscreen ? document.exitFullscreen() : r.mozCancelFullScreen ? r.mozCancelFullScreen() : r.webkitExitFullscreen ? r.webkitExitFullscreen() : r.msExitFullscreen ? r.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
6414
- }
6415
- function Ue(r) {
6416
- const s = Kt(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
6417
- return s == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
6418
- }
6419
- function hn(r) {
6420
- if (r = Kt(r), !!r)
6421
- return function() {
6422
- Ue(r) ? Ps() : xs(r);
6423
- };
6424
- }
6425
- function un(r, s) {
6426
- const t = Kt(s);
6427
- if (!t) return;
6428
- const e = () => {
6429
- r(Ue(t));
6430
- };
6431
- return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), e(), () => {
6432
- document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
6433
- };
6434
- }
6435
- function dn(r, s) {
6969
+ q = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), $ = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Et = new WeakMap(), _t = new WeakMap();
6970
+ function Pn(r, s) {
6436
6971
  if (typeof r == "number") return r;
6437
6972
  if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
6438
6973
  const t = document.createElement("div");
@@ -6440,7 +6975,7 @@ function dn(r, s) {
6440
6975
  const e = t.getBoundingClientRect().width;
6441
6976
  return s.removeChild(t), e;
6442
6977
  }
6443
- function fn(r, s) {
6978
+ function bn(r, s) {
6444
6979
  if (!r) return;
6445
6980
  let t, e;
6446
6981
  if (typeof s == "string") {
@@ -6457,7 +6992,7 @@ function fn(r, s) {
6457
6992
  const i = t / e;
6458
6993
  return i > r ? [r * e, e] : i < r ? [t, t / r] : [t, e];
6459
6994
  }
6460
- function mn(r, s = 5e3) {
6995
+ function Cn(r, s = 5e3) {
6461
6996
  return new Promise((t, e) => {
6462
6997
  const i = new Image();
6463
6998
  i.src = r;
@@ -6473,7 +7008,7 @@ function mn(r, s = 5e3) {
6473
7008
  }, i.crossOrigin = "Anonymous";
6474
7009
  });
6475
7010
  }
6476
- function gn(r) {
7011
+ function Sn(r) {
6477
7012
  const t = document.getElementById(r).querySelectorAll("img"), e = t.length, i = [];
6478
7013
  let n = 0;
6479
7014
  return e === 0 ? Promise.resolve({
@@ -6515,14 +7050,14 @@ function gn(r) {
6515
7050
  });
6516
7051
  });
6517
7052
  }
6518
- function pn(r) {
7053
+ function En(r) {
6519
7054
  return new Promise((s, t) => {
6520
7055
  fetch(r).then((e) => s(e.text())).catch((e) => {
6521
7056
  console.error("Error fetching :", e), t(e);
6522
7057
  });
6523
7058
  });
6524
7059
  }
6525
- function bs(r) {
7060
+ function _s(r) {
6526
7061
  const {
6527
7062
  href: s,
6528
7063
  fileName: t,
@@ -6531,7 +7066,7 @@ function bs(r) {
6531
7066
  autoDownload: n = !0
6532
7067
  } = r;
6533
7068
  let o, a = !1, l = null, c;
6534
- const h = t || ne(s, "downloaded_file");
7069
+ const h = t || ce(s, "downloaded_file");
6535
7070
  c = decodeURIComponent(h);
6536
7071
  const u = () => {
6537
7072
  if (!l) return;
@@ -6544,8 +7079,8 @@ function bs(r) {
6544
7079
  a || y(new Error(`请求超时(已超过${i / 1e3}秒)`));
6545
7080
  }, o.addEventListener("progress", (w) => {
6546
7081
  if (w.lengthComputable && !a) {
6547
- const b = w.loaded / w.total * 100;
6548
- e == null || e(Number(b.toFixed(2)));
7082
+ const P = w.loaded / w.total * 100;
7083
+ e == null || e(Number(P.toFixed(2)));
6549
7084
  }
6550
7085
  }), o.addEventListener("load", () => {
6551
7086
  a || (o.status >= 200 && o.status < 300 ? (l = o.response, n && u(), g(o.response)) : y(new Error(`下载失败,状态码: ${o.status}`)));
@@ -6561,24 +7096,24 @@ function bs(r) {
6561
7096
  !a && l && u();
6562
7097
  } };
6563
7098
  }
6564
- function vn(r, s, t) {
7099
+ function _n(r, s, t) {
6565
7100
  if (!t) {
6566
7101
  let n = s.replace(/^[^.]+./, "");
6567
7102
  n = n == s ? "text/plain" : "application/" + n, t = { type: n };
6568
7103
  }
6569
7104
  const e = new Blob(r, t), i = URL.createObjectURL(e);
6570
- bs({ href: i, fileName: s });
7105
+ _s({ href: i, fileName: s });
6571
7106
  }
6572
- const Cs = Math.PI / 2, qt = Math.PI / 180, $t = 6378137, Ss = 85.05112878;
6573
- function yn(r, s) {
6574
- const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s, Ss), -85.05112878), i = t * qt * $t, n = e * qt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * $t;
7107
+ const Ms = Math.PI / 2, Kt = Math.PI / 180, te = 6378137, Ds = 85.05112878;
7108
+ function Mn(r, s) {
7109
+ const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(s, Ds), -85.05112878), i = t * Kt * te, n = e * Kt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * te;
6575
7110
  return [i, o];
6576
7111
  }
6577
- function wn(r, s) {
6578
- const t = r / $t / qt, e = (2 * Math.atan(Math.exp(s / $t)) - Cs) / qt;
7112
+ function Dn(r, s) {
7113
+ const t = r / te / Kt, e = (2 * Math.atan(Math.exp(s / te)) - Ms) / Kt;
6579
7114
  return [t, e];
6580
7115
  }
6581
- function _s(r, s, t) {
7116
+ function Rs(r, s, t) {
6582
7117
  const [e, i] = r, [n, o] = s, [a, l] = t, c = (a - n) ** 2 + (l - o) ** 2;
6583
7118
  if (c === 0) return Math.sqrt((e - n) ** 2 + (i - o) ** 2);
6584
7119
  let h = ((e - n) * (a - n) + (i - o) * (l - o)) / c;
@@ -6586,21 +7121,21 @@ function _s(r, s, t) {
6586
7121
  (e - (n + h * (a - n))) ** 2 + (i - (o + h * (l - o))) ** 2
6587
7122
  );
6588
7123
  }
6589
- function xn(r, s, t, e, i, n = 1, o = 1) {
7124
+ function Rn(r, s, t, e, i, n = 1, o = 1) {
6590
7125
  const a = r + t * Math.cos(e) * n, l = s + t * Math.sin(e) * o, c = r + t * Math.cos(i) * n, h = s + t * Math.sin(i) * o;
6591
7126
  return [
6592
7127
  [a, l],
6593
7128
  [c, h]
6594
7129
  ];
6595
7130
  }
6596
- function Se(r, s, t, e) {
7131
+ function De(r, s, t, e) {
6597
7132
  return Math.hypot(Math.abs(t - r), Math.abs(e - s));
6598
7133
  }
6599
- function ze(r, s, t, e) {
7134
+ function $e(r, s, t, e) {
6600
7135
  const i = (r + t) / 2, n = (s + e) / 2;
6601
7136
  return { x: i, y: n };
6602
7137
  }
6603
- function Pn(r, s, t, e) {
7138
+ function kn(r, s, t, e) {
6604
7139
  const [i, n] = r, [o, a] = s;
6605
7140
  let l = 1 / 0;
6606
7141
  if (o !== 0) {
@@ -6613,7 +7148,7 @@ function Pn(r, s, t, e) {
6613
7148
  }
6614
7149
  return l === 1 / 0 ? r : [i + o * l, n + a * l];
6615
7150
  }
6616
- const Ms = /* @__PURE__ */ new Set([
7151
+ const ks = /* @__PURE__ */ new Set([
6617
7152
  "sin",
6618
7153
  "cos",
6619
7154
  "tan",
@@ -6621,9 +7156,9 @@ const Ms = /* @__PURE__ */ new Set([
6621
7156
  "acos",
6622
7157
  "atan",
6623
7158
  "atan2"
6624
- ]), bn = new Proxy(Math, {
7159
+ ]), Vn = new Proxy(Math, {
6625
7160
  get(r, s) {
6626
- return Ms.has(s) ? function(...t) {
7161
+ return ks.has(s) ? function(...t) {
6627
7162
  const e = t.map((i) => i / 180 * Math.PI);
6628
7163
  return r[s](...e);
6629
7164
  } : r[s];
@@ -6637,7 +7172,7 @@ const Ms = /* @__PURE__ */ new Set([
6637
7172
  throw new Error("DegreeMath 是只读的,不能删除属性");
6638
7173
  }
6639
7174
  });
6640
- class yt {
7175
+ class wt {
6641
7176
  constructor(s, t) {
6642
7177
  d(this, "resolve");
6643
7178
  d(this, "reject");
@@ -6654,42 +7189,42 @@ class yt {
6654
7189
  }) : s ? (t = this.resolve) == null || t.call(this) : (e = this.reject) == null || e.call(this), s;
6655
7190
  }
6656
7191
  }
6657
- class Es extends yt {
7192
+ class Vs extends wt {
6658
7193
  constructor(s) {
6659
7194
  super(), this.resolve = s;
6660
7195
  }
6661
7196
  warning(...s) {
6662
7197
  const t = () => {
6663
7198
  var e, i;
6664
- return (i = (e = Et.tips).warning) == null ? void 0 : i.call(e, ...s);
7199
+ return (i = (e = Dt.tips).warning) == null ? void 0 : i.call(e, ...s);
6665
7200
  };
6666
- return new yt(this.resolve, t);
7201
+ return new wt(this.resolve, t);
6667
7202
  }
6668
7203
  error(...s) {
6669
7204
  const t = () => {
6670
7205
  var e, i;
6671
- return (i = (e = Et.tips).error) == null ? void 0 : i.call(e, ...s);
7206
+ return (i = (e = Dt.tips).error) == null ? void 0 : i.call(e, ...s);
6672
7207
  };
6673
- return new yt(this.resolve, t);
7208
+ return new wt(this.resolve, t);
6674
7209
  }
6675
7210
  }
6676
- class Ds extends yt {
7211
+ class Os extends wt {
6677
7212
  constructor(s) {
6678
7213
  super(), this.reject = s;
6679
7214
  }
6680
7215
  info(...s) {
6681
7216
  const t = () => {
6682
7217
  var e, i;
6683
- return (i = (e = Et.tips).info) == null ? void 0 : i.call(e, ...s);
7218
+ return (i = (e = Dt.tips).info) == null ? void 0 : i.call(e, ...s);
6684
7219
  };
6685
- return new yt(t, this.reject);
7220
+ return new wt(t, this.reject);
6686
7221
  }
6687
7222
  success(...s) {
6688
7223
  const t = () => {
6689
7224
  var e, i;
6690
- return (i = (e = Et.tips).success) == null ? void 0 : i.call(e, ...s);
7225
+ return (i = (e = Dt.tips).success) == null ? void 0 : i.call(e, ...s);
6691
7226
  };
6692
- return new yt(t, this.reject);
7227
+ return new wt(t, this.reject);
6693
7228
  }
6694
7229
  }
6695
7230
  const B = class B {
@@ -6712,7 +7247,7 @@ const B = class B {
6712
7247
  var i, n;
6713
7248
  return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
6714
7249
  };
6715
- return new Es(e);
7250
+ return new Vs(e);
6716
7251
  };
6717
7252
  }
6718
7253
  static rejectTip(s) {
@@ -6721,7 +7256,7 @@ const B = class B {
6721
7256
  var i, n;
6722
7257
  return (n = (i = B.tips)[s]) == null ? void 0 : n.call(i, ...t);
6723
7258
  };
6724
- return new Ds(e);
7259
+ return new Os(e);
6725
7260
  };
6726
7261
  }
6727
7262
  };
@@ -6731,80 +7266,85 @@ d(B, "tips", {
6731
7266
  warning: void 0,
6732
7267
  error: void 0
6733
7268
  }), d(B, "info", B.resolveTip("info")), d(B, "success", B.resolveTip("success")), d(B, "warning", B.rejectTip("warning")), d(B, "error", B.rejectTip("error"));
6734
- let Et = B;
7269
+ let Dt = B;
6735
7270
  export {
6736
- We as EXTENSION_TO_MIME,
6737
- ee as FILE_EXTENSIONS,
6738
- _e as PAPER_SIZE_DEFINITIONS,
6739
- ks as PAPER_SIZE_OPTIONS,
6740
- ye as UNIT_LABELS,
6741
- Rs as WINDOW_TARGET,
6742
- Os as _Animate_CreateOscillator,
6743
- qe as _Animate_NumericTransition,
6744
- Ut as _Animate_Schedule,
6745
- As as _Blob_ConvertDataToImageUrl,
6746
- sn as _Browser_CalculatePrintableArea,
6747
- en as _Browser_CopyToClipboard,
6748
- tn as _Browser_GetFrameRate,
6749
- It as _Browser_SameOriginTabManager,
6750
- L as _Canvas_Axis,
6751
- rn as _Canvas_TimeAxis,
6752
- fn as _Element_CalculateCanvasSize,
6753
- gn as _Element_CheckImagesLoaded,
6754
- an as _Element_CloseOnOutsideClick,
6755
- ln as _Element_Drag,
6756
- xs as _Element_EnterFullscreen,
6757
- Ps as _Element_ExitFullscreen,
6758
- hn as _Element_Fullscreen,
6759
- un as _Element_FullscreenObserver,
6760
- dn as _Element_GetOtherSizeInPixels,
6761
- Ue as _Element_IsFullscreen,
6762
- mn as _Element_LoadImage,
6763
- cn as _Element_LocalDrag,
6764
- on as _Element_ScrollEndListener,
6765
- vn as _File_CreateAndDownload,
6766
- bs as _File_Download,
6767
- pn as _File_Read,
6768
- Hs as _Format_CamelCase,
6769
- Ns as _Format_CapitalizeFirstLetter,
6770
- Gs as _Format_ChunkArray,
6771
- Fs as _Format_ExcludeSubstring,
6772
- Ts as _Format_FileSize,
6773
- ne as _Format_HrefName,
6774
- Xs as _Format_MillisecondToReadable,
6775
- se as _Format_NumberWithCommas,
6776
- Ls as _Format_NumberWithUnit,
6777
- Is as _Format_Percentage,
6778
- $e as _Format_Timestamp,
6779
- Bs as _Format_ToggleInvisibleChars,
6780
- Se as _Math_CalculateDistance2D,
6781
- bn as _Math_Degree,
6782
- xn as _Math_GetArcPoints,
6783
- Pn as _Math_GetBoundaryIntersection,
6784
- ze as _Math_GetMidpoint,
6785
- yn as _Math_LngLatToPlane,
6786
- wn as _Math_PlaneToLngLat,
6787
- _s as _Math_PointToLineDistance,
6788
- Et as _Tip,
6789
- Je as _Utility_Clone,
6790
- Re as _Utility_Debounce,
6791
- qs as _Utility_ExecuteWhenIdle,
6792
- oe as _Utility_GenerateUUID,
6793
- Zs as _Utility_GetTargetByPath,
6794
- pt as _Utility_MergeObjects,
6795
- Js as _Utility_RotateList,
6796
- Qs as _Utility_SetTargetByPath,
6797
- Ks as _Utility_Sleep,
6798
- $s as _Utility_Throttle,
6799
- Ke as _Utility_TimeConsumption,
6800
- Qe as _Utility_WaitForCondition,
6801
- Ws as _Valid_CheckConnectionWithXHR,
6802
- re as _Valid_DataType,
6803
- Ys as _Valid_DoesInfiniteLineIntersectRectangle,
6804
- we as _Valid_FileTypeChecker,
6805
- zt as _Valid_Is2DNumberArray,
6806
- Us as _Valid_IsInMargin,
6807
- me as _Valid_IsNumberArray,
6808
- zs as _Valid_IsPointInPolygon,
6809
- js as _Valid_IsSecureContext
7271
+ Je as EXTENSION_TO_MIME,
7272
+ re as FILE_EXTENSIONS,
7273
+ Re as PAPER_SIZE_DEFINITIONS,
7274
+ Ts as PAPER_SIZE_OPTIONS,
7275
+ Pe as UNIT_LABELS,
7276
+ Ls as WINDOW_TARGET,
7277
+ Is as _Animate_CreateOscillator,
7278
+ Ns as _Animate_CubicBezier,
7279
+ Ke as _Animate_NumericTransition,
7280
+ Wt as _Animate_Schedule,
7281
+ Hs as _Blob_ConvertDataToImageUrl,
7282
+ hn as _Browser_CalculatePrintableArea,
7283
+ cn as _Browser_CopyToClipboard,
7284
+ ln as _Browser_GetFrameRate,
7285
+ un as _Browser_IdleDetection,
7286
+ Nt as _Browser_SameOriginTabManager,
7287
+ on as _Browser_SoundEffects,
7288
+ an as _Browser_WebSocketClient,
7289
+ T as _Canvas_Axis,
7290
+ fn as _Canvas_TimeAxis,
7291
+ bn as _Element_CalculateCanvasSize,
7292
+ Sn as _Element_CheckImagesLoaded,
7293
+ yn as _Element_CloseOnOutsideClick,
7294
+ wn as _Element_Drag,
7295
+ We as _Element_EnterFullscreen,
7296
+ qe as _Element_ExitFullscreen,
7297
+ mn as _Element_Fullscreen,
7298
+ pn as _Element_FullscreenController,
7299
+ gn as _Element_FullscreenObserver,
7300
+ Pn as _Element_GetOtherSizeInPixels,
7301
+ Jt as _Element_IsFullscreen,
7302
+ Cn as _Element_LoadImage,
7303
+ xn as _Element_LocalDrag,
7304
+ vn as _Element_ScrollEndListener,
7305
+ _n as _File_CreateAndDownload,
7306
+ _s as _File_Download,
7307
+ En as _File_Read,
7308
+ Xs as _Format_CamelCase,
7309
+ Fs as _Format_CapitalizeFirstLetter,
7310
+ Ws as _Format_ChunkArray,
7311
+ zs as _Format_ExcludeSubstring,
7312
+ Us as _Format_FileSize,
7313
+ ce as _Format_HrefName,
7314
+ js as _Format_MillisecondToReadable,
7315
+ le as _Format_NumberWithCommas,
7316
+ Gs as _Format_NumberWithUnit,
7317
+ Bs as _Format_Percentage,
7318
+ ti as _Format_Timestamp,
7319
+ Ys as _Format_ToggleInvisibleChars,
7320
+ De as _Math_CalculateDistance2D,
7321
+ Vn as _Math_Degree,
7322
+ Rn as _Math_GetArcPoints,
7323
+ kn as _Math_GetBoundaryIntersection,
7324
+ $e as _Math_GetMidpoint,
7325
+ Mn as _Math_LngLatToPlane,
7326
+ Dn as _Math_PlaneToLngLat,
7327
+ Rs as _Math_PointToLineDistance,
7328
+ Dt as _Tip,
7329
+ si as _Utility_Clone,
7330
+ Le as _Utility_Debounce,
7331
+ Ks as _Utility_ExecuteWhenIdle,
7332
+ ue as _Utility_GenerateUUID,
7333
+ en as _Utility_GetTargetByPath,
7334
+ ct as _Utility_MergeObjects,
7335
+ nn as _Utility_RotateList,
7336
+ sn as _Utility_SetTargetByPath,
7337
+ rn as _Utility_Sleep,
7338
+ tn as _Utility_Throttle,
7339
+ ni as _Utility_TimeConsumption,
7340
+ ii as _Utility_WaitForCondition,
7341
+ Js as _Valid_CheckConnectionWithXHR,
7342
+ he as _Valid_DataType,
7343
+ Zs as _Valid_DoesInfiniteLineIntersectRectangle,
7344
+ be as _Valid_FileTypeChecker,
7345
+ qt as _Valid_Is2DNumberArray,
7346
+ qs as _Valid_IsInMargin,
7347
+ ve as _Valid_IsNumberArray,
7348
+ $s as _Valid_IsPointInPolygon,
7349
+ Qs as _Valid_IsSecureContext
6810
7350
  };