fuxi-topology 0.2.5 → 0.2.6
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/fuxi-topology.js +962 -925
- package/dist/fuxi-topology.umd.cjs +38 -38
- package/dist/scene/items/grid/grid.d.ts +21 -2
- package/package.json +1 -1
package/dist/fuxi-topology.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter as le, Graphics as L, Sprite as gn, Texture as ne, Rectangle as Lt, Container as R, Point as Vr, MeshRope as Xr, TilingSprite as mn, TextStyle as qr, Text as vn, Assets as gi, ColorMatrixFilter as mi, Filter as G, GlProgram as U, UniformGroup as H, BlurFilter as Jr, Application as Kr } from "pixi.js";
|
|
2
2
|
import dt from "pathfinding";
|
|
3
3
|
import { zoom as Zr, ZoomTransform as Ut, zoomTransform as Qr, zoomIdentity as es } from "d3-zoom";
|
|
4
|
-
import { ZoomTransform as
|
|
4
|
+
import { ZoomTransform as md } from "d3-zoom";
|
|
5
5
|
function xn(t) {
|
|
6
6
|
return typeof t > "u" || t === null;
|
|
7
7
|
}
|
|
@@ -12,10 +12,10 @@ function is(t) {
|
|
|
12
12
|
return Array.isArray(t) ? t : xn(t) ? [] : [t];
|
|
13
13
|
}
|
|
14
14
|
function ns(t, e) {
|
|
15
|
-
var i, n, r,
|
|
15
|
+
var i, n, r, s;
|
|
16
16
|
if (e)
|
|
17
|
-
for (
|
|
18
|
-
r =
|
|
17
|
+
for (s = Object.keys(e), i = 0, n = s.length; i < n; i += 1)
|
|
18
|
+
r = s[i], t[r] = e[r];
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
21
21
|
function rs(t, e) {
|
|
@@ -51,10 +51,10 @@ Xe.prototype.toString = function(e) {
|
|
|
51
51
|
};
|
|
52
52
|
var M = Xe;
|
|
53
53
|
function Ht(t, e, i, n, r) {
|
|
54
|
-
var
|
|
55
|
-
return n - e > a && (
|
|
56
|
-
str:
|
|
57
|
-
pos: n - e +
|
|
54
|
+
var s = "", o = "", a = Math.floor(r / 2) - 1;
|
|
55
|
+
return n - e > a && (s = " ... ", e = n - a + s.length), i - n > a && (o = " ...", i = n + a - o.length), {
|
|
56
|
+
str: s + t.slice(e, i).replace(/\t/g, "→") + o,
|
|
57
|
+
pos: n - e + s.length
|
|
58
58
|
// relative position
|
|
59
59
|
};
|
|
60
60
|
}
|
|
@@ -64,27 +64,27 @@ function Yt(t, e) {
|
|
|
64
64
|
function fs(t, e) {
|
|
65
65
|
if (e = Object.create(e || null), !t.buffer) return null;
|
|
66
66
|
e.maxLength || (e.maxLength = 79), typeof e.indent != "number" && (e.indent = 1), typeof e.linesBefore != "number" && (e.linesBefore = 3), typeof e.linesAfter != "number" && (e.linesAfter = 2);
|
|
67
|
-
for (var i = /\r?\n|\r|\0/g, n = [0], r = [],
|
|
68
|
-
r.push(
|
|
69
|
-
|
|
67
|
+
for (var i = /\r?\n|\r|\0/g, n = [0], r = [], s, o = -1; s = i.exec(t.buffer); )
|
|
68
|
+
r.push(s.index), n.push(s.index + s[0].length), t.position <= s.index && o < 0 && (o = n.length - 2);
|
|
69
|
+
o < 0 && (o = n.length - 1);
|
|
70
70
|
var a = "", c, l, h = Math.min(t.line + e.linesAfter, r.length).toString().length, u = e.maxLength - (e.indent + h + 3);
|
|
71
|
-
for (c = 1; c <= e.linesBefore && !(
|
|
71
|
+
for (c = 1; c <= e.linesBefore && !(o - c < 0); c++)
|
|
72
72
|
l = Ht(
|
|
73
73
|
t.buffer,
|
|
74
|
-
n[
|
|
75
|
-
r[
|
|
76
|
-
t.position - (n[
|
|
74
|
+
n[o - c],
|
|
75
|
+
r[o - c],
|
|
76
|
+
t.position - (n[o] - n[o - c]),
|
|
77
77
|
u
|
|
78
78
|
), a = A.repeat(" ", e.indent) + Yt((t.line - c + 1).toString(), h) + " | " + l.str + `
|
|
79
79
|
` + a;
|
|
80
|
-
for (l = Ht(t.buffer, n[
|
|
80
|
+
for (l = Ht(t.buffer, n[o], r[o], t.position, u), a += A.repeat(" ", e.indent) + Yt((t.line + 1).toString(), h) + " | " + l.str + `
|
|
81
81
|
`, a += A.repeat("-", e.indent + h + 3 + l.pos) + `^
|
|
82
|
-
`, c = 1; c <= e.linesAfter && !(
|
|
82
|
+
`, c = 1; c <= e.linesAfter && !(o + c >= r.length); c++)
|
|
83
83
|
l = Ht(
|
|
84
84
|
t.buffer,
|
|
85
|
-
n[
|
|
86
|
-
r[
|
|
87
|
-
t.position - (n[
|
|
85
|
+
n[o + c],
|
|
86
|
+
r[o + c],
|
|
87
|
+
t.position - (n[o] - n[o + c]),
|
|
88
88
|
u
|
|
89
89
|
), a += A.repeat(" ", e.indent) + Yt((t.line + c + 1).toString(), h) + " | " + l.str + `
|
|
90
90
|
`;
|
|
@@ -130,8 +130,8 @@ function Ri(t, e) {
|
|
|
130
130
|
var i = [];
|
|
131
131
|
return t[e].forEach(function(n) {
|
|
132
132
|
var r = i.length;
|
|
133
|
-
i.forEach(function(
|
|
134
|
-
|
|
133
|
+
i.forEach(function(s, o) {
|
|
134
|
+
s.tag === n.tag && s.kind === n.kind && s.multi === n.multi && (r = o);
|
|
135
135
|
}), i[r] = n;
|
|
136
136
|
}), i;
|
|
137
137
|
}
|
|
@@ -168,15 +168,15 @@ Kt.prototype.extend = function(e) {
|
|
|
168
168
|
e.implicit && (i = i.concat(e.implicit)), e.explicit && (n = n.concat(e.explicit));
|
|
169
169
|
else
|
|
170
170
|
throw new M("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
171
|
-
i.forEach(function(
|
|
172
|
-
if (!(
|
|
171
|
+
i.forEach(function(s) {
|
|
172
|
+
if (!(s instanceof T))
|
|
173
173
|
throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
174
|
-
if (
|
|
174
|
+
if (s.loadKind && s.loadKind !== "scalar")
|
|
175
175
|
throw new M("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
176
|
-
if (
|
|
176
|
+
if (s.multi)
|
|
177
177
|
throw new M("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
178
|
-
}), n.forEach(function(
|
|
179
|
-
if (!(
|
|
178
|
+
}), n.forEach(function(s) {
|
|
179
|
+
if (!(s instanceof T))
|
|
180
180
|
throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
181
181
|
});
|
|
182
182
|
var r = Object.create(Kt.prototype);
|
|
@@ -430,16 +430,16 @@ function zs(t) {
|
|
|
430
430
|
return t === null ? !1 : En.exec(t) !== null || Ln.exec(t) !== null;
|
|
431
431
|
}
|
|
432
432
|
function Ns(t) {
|
|
433
|
-
var e, i, n, r,
|
|
433
|
+
var e, i, n, r, s, o, a, c = 0, l = null, h, u, f;
|
|
434
434
|
if (e = En.exec(t), e === null && (e = Ln.exec(t)), e === null) throw new Error("Date resolve error");
|
|
435
435
|
if (i = +e[1], n = +e[2] - 1, r = +e[3], !e[4])
|
|
436
436
|
return new Date(Date.UTC(i, n, r));
|
|
437
|
-
if (
|
|
437
|
+
if (s = +e[4], o = +e[5], a = +e[6], e[7]) {
|
|
438
438
|
for (c = e[7].slice(0, 3); c.length < 3; )
|
|
439
439
|
c += "0";
|
|
440
440
|
c = +c;
|
|
441
441
|
}
|
|
442
|
-
return e[9] && (h = +e[10], u = +(e[11] || 0), l = (h * 60 + u) * 6e4, e[9] === "-" && (l = -l)), f = new Date(Date.UTC(i, n, r,
|
|
442
|
+
return e[9] && (h = +e[10], u = +(e[11] || 0), l = (h * 60 + u) * 6e4, e[9] === "-" && (l = -l)), f = new Date(Date.UTC(i, n, r, s, o, a, c)), l && f.setTime(f.getTime() - l), f;
|
|
443
443
|
}
|
|
444
444
|
function $s(t) {
|
|
445
445
|
return t.toISOString();
|
|
@@ -461,25 +461,25 @@ var Fn = new T("tag:yaml.org,2002:merge", {
|
|
|
461
461
|
\r`;
|
|
462
462
|
function Us(t) {
|
|
463
463
|
if (t === null) return !1;
|
|
464
|
-
var e, i, n = 0, r = t.length,
|
|
464
|
+
var e, i, n = 0, r = t.length, s = vi;
|
|
465
465
|
for (i = 0; i < r; i++)
|
|
466
|
-
if (e =
|
|
466
|
+
if (e = s.indexOf(t.charAt(i)), !(e > 64)) {
|
|
467
467
|
if (e < 0) return !1;
|
|
468
468
|
n += 6;
|
|
469
469
|
}
|
|
470
470
|
return n % 8 === 0;
|
|
471
471
|
}
|
|
472
472
|
function Hs(t) {
|
|
473
|
-
var e, i, n = t.replace(/[\r\n=]/g, ""), r = n.length,
|
|
473
|
+
var e, i, n = t.replace(/[\r\n=]/g, ""), r = n.length, s = vi, o = 0, a = [];
|
|
474
474
|
for (e = 0; e < r; e++)
|
|
475
|
-
e % 4 === 0 && e && (a.push(
|
|
476
|
-
return i = r % 4 * 6, i === 0 ? (a.push(
|
|
475
|
+
e % 4 === 0 && e && (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)), o = o << 6 | s.indexOf(n.charAt(e));
|
|
476
|
+
return i = r % 4 * 6, i === 0 ? (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)) : i === 18 ? (a.push(o >> 10 & 255), a.push(o >> 2 & 255)) : i === 12 && a.push(o >> 4 & 255), new Uint8Array(a);
|
|
477
477
|
}
|
|
478
478
|
function Ys(t) {
|
|
479
|
-
var e = "", i = 0, n, r,
|
|
480
|
-
for (n = 0; n <
|
|
481
|
-
n % 3 === 0 && n && (e +=
|
|
482
|
-
return r =
|
|
479
|
+
var e = "", i = 0, n, r, s = t.length, o = vi;
|
|
480
|
+
for (n = 0; n < s; n++)
|
|
481
|
+
n % 3 === 0 && n && (e += o[i >> 18 & 63], e += o[i >> 12 & 63], e += o[i >> 6 & 63], e += o[i & 63]), i = (i << 8) + t[n];
|
|
482
|
+
return r = s % 3, r === 0 ? (e += o[i >> 18 & 63], e += o[i >> 12 & 63], e += o[i >> 6 & 63], e += o[i & 63]) : r === 2 ? (e += o[i >> 10 & 63], e += o[i >> 4 & 63], e += o[i << 2 & 63], e += o[64]) : r === 1 && (e += o[i >> 2 & 63], e += o[i << 4 & 63], e += o[64], e += o[64]), e;
|
|
483
483
|
}
|
|
484
484
|
function Bs(t) {
|
|
485
485
|
return Object.prototype.toString.call(t) === "[object Uint8Array]";
|
|
@@ -493,15 +493,15 @@ var Rn = new T("tag:yaml.org,2002:binary", {
|
|
|
493
493
|
}), Ws = Object.prototype.hasOwnProperty, js = Object.prototype.toString;
|
|
494
494
|
function Vs(t) {
|
|
495
495
|
if (t === null) return !0;
|
|
496
|
-
var e = [], i, n, r,
|
|
496
|
+
var e = [], i, n, r, s, o, a = t;
|
|
497
497
|
for (i = 0, n = a.length; i < n; i += 1) {
|
|
498
|
-
if (r = a[i],
|
|
499
|
-
for (
|
|
500
|
-
if (Ws.call(r,
|
|
501
|
-
if (!
|
|
498
|
+
if (r = a[i], o = !1, js.call(r) !== "[object Object]") return !1;
|
|
499
|
+
for (s in r)
|
|
500
|
+
if (Ws.call(r, s))
|
|
501
|
+
if (!o) o = !0;
|
|
502
502
|
else return !1;
|
|
503
|
-
if (!
|
|
504
|
-
if (e.indexOf(
|
|
503
|
+
if (!o) return !1;
|
|
504
|
+
if (e.indexOf(s) === -1) e.push(s);
|
|
505
505
|
else return !1;
|
|
506
506
|
}
|
|
507
507
|
return !0;
|
|
@@ -516,19 +516,19 @@ var Dn = new T("tag:yaml.org,2002:omap", {
|
|
|
516
516
|
}), qs = Object.prototype.toString;
|
|
517
517
|
function Js(t) {
|
|
518
518
|
if (t === null) return !0;
|
|
519
|
-
var e, i, n, r,
|
|
520
|
-
for (
|
|
521
|
-
if (n =
|
|
522
|
-
|
|
519
|
+
var e, i, n, r, s, o = t;
|
|
520
|
+
for (s = new Array(o.length), e = 0, i = o.length; e < i; e += 1) {
|
|
521
|
+
if (n = o[e], qs.call(n) !== "[object Object]" || (r = Object.keys(n), r.length !== 1)) return !1;
|
|
522
|
+
s[e] = [r[0], n[r[0]]];
|
|
523
523
|
}
|
|
524
524
|
return !0;
|
|
525
525
|
}
|
|
526
526
|
function Ks(t) {
|
|
527
527
|
if (t === null) return [];
|
|
528
|
-
var e, i, n, r,
|
|
529
|
-
for (
|
|
530
|
-
n =
|
|
531
|
-
return
|
|
528
|
+
var e, i, n, r, s, o = t;
|
|
529
|
+
for (s = new Array(o.length), e = 0, i = o.length; e < i; e += 1)
|
|
530
|
+
n = o[e], r = Object.keys(n), s[e] = [r[0], n[r[0]]];
|
|
531
|
+
return s;
|
|
532
532
|
}
|
|
533
533
|
var zn = new T("tag:yaml.org,2002:pairs", {
|
|
534
534
|
kind: "sequence",
|
|
@@ -630,48 +630,48 @@ function yt(t, e) {
|
|
|
630
630
|
}
|
|
631
631
|
var $i = {
|
|
632
632
|
YAML: function(e, i, n) {
|
|
633
|
-
var r,
|
|
634
|
-
e.version !== null && y(e, "duplication of %YAML directive"), n.length !== 1 && y(e, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), r === null && y(e, "ill-formed argument of the YAML directive"),
|
|
633
|
+
var r, s, o;
|
|
634
|
+
e.version !== null && y(e, "duplication of %YAML directive"), n.length !== 1 && y(e, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), r === null && y(e, "ill-formed argument of the YAML directive"), s = parseInt(r[1], 10), o = parseInt(r[2], 10), s !== 1 && y(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = o < 2, o !== 1 && o !== 2 && yt(e, "unsupported YAML version of the document");
|
|
635
635
|
},
|
|
636
636
|
TAG: function(e, i, n) {
|
|
637
|
-
var r,
|
|
638
|
-
n.length !== 2 && y(e, "TAG directive accepts exactly two arguments"), r = n[0],
|
|
637
|
+
var r, s;
|
|
638
|
+
n.length !== 2 && y(e, "TAG directive accepts exactly two arguments"), r = n[0], s = n[1], Un.test(r) || y(e, "ill-formed tag handle (first argument) of the TAG directive"), ce.call(e.tagMap, r) && y(e, 'there is a previously declared suffix for "' + r + '" tag handle'), Hn.test(s) || y(e, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
639
639
|
try {
|
|
640
|
-
|
|
640
|
+
s = decodeURIComponent(s);
|
|
641
641
|
} catch {
|
|
642
|
-
y(e, "tag prefix is malformed: " +
|
|
642
|
+
y(e, "tag prefix is malformed: " + s);
|
|
643
643
|
}
|
|
644
|
-
e.tagMap[r] =
|
|
644
|
+
e.tagMap[r] = s;
|
|
645
645
|
}
|
|
646
646
|
};
|
|
647
647
|
function ae(t, e, i, n) {
|
|
648
|
-
var r,
|
|
648
|
+
var r, s, o, a;
|
|
649
649
|
if (e < i) {
|
|
650
650
|
if (a = t.input.slice(e, i), n)
|
|
651
|
-
for (r = 0,
|
|
652
|
-
|
|
651
|
+
for (r = 0, s = a.length; r < s; r += 1)
|
|
652
|
+
o = a.charCodeAt(r), o === 9 || 32 <= o && o <= 1114111 || y(t, "expected valid JSON character");
|
|
653
653
|
else io.test(a) && y(t, "the stream contains non-printable characters");
|
|
654
654
|
t.result += a;
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
function Gi(t, e, i, n) {
|
|
658
|
-
var r,
|
|
659
|
-
for (A.isObject(i) || y(t, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(i),
|
|
660
|
-
|
|
658
|
+
var r, s, o, a;
|
|
659
|
+
for (A.isObject(i) || y(t, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(i), o = 0, a = r.length; o < a; o += 1)
|
|
660
|
+
s = r[o], ce.call(e, s) || (Yn(e, s, i[s]), n[s] = !0);
|
|
661
661
|
}
|
|
662
|
-
function Fe(t, e, i, n, r,
|
|
662
|
+
function Fe(t, e, i, n, r, s, o, a, c) {
|
|
663
663
|
var l, h;
|
|
664
664
|
if (Array.isArray(r))
|
|
665
665
|
for (r = Array.prototype.slice.call(r), l = 0, h = r.length; l < h; l += 1)
|
|
666
666
|
Array.isArray(r[l]) && y(t, "nested arrays are not supported inside keys"), typeof r == "object" && zi(r[l]) === "[object Object]" && (r[l] = "[object Object]");
|
|
667
667
|
if (typeof r == "object" && zi(r) === "[object Object]" && (r = "[object Object]"), r = String(r), e === null && (e = {}), n === "tag:yaml.org,2002:merge")
|
|
668
|
-
if (Array.isArray(
|
|
669
|
-
for (l = 0, h =
|
|
670
|
-
Gi(t, e,
|
|
668
|
+
if (Array.isArray(s))
|
|
669
|
+
for (l = 0, h = s.length; l < h; l += 1)
|
|
670
|
+
Gi(t, e, s[l], i);
|
|
671
671
|
else
|
|
672
|
-
Gi(t, e,
|
|
672
|
+
Gi(t, e, s, i);
|
|
673
673
|
else
|
|
674
|
-
!t.json && !ce.call(i, r) && ce.call(e, r) && (t.line =
|
|
674
|
+
!t.json && !ce.call(i, r) && ce.call(e, r) && (t.line = o || t.line, t.lineStart = a || t.lineStart, t.position = c || t.position, y(t, "duplicated mapping key")), Yn(e, r, s), delete i[r];
|
|
675
675
|
return e;
|
|
676
676
|
}
|
|
677
677
|
function yi(t) {
|
|
@@ -703,10 +703,10 @@ function _i(t, e) {
|
|
|
703
703
|
`, e - 1));
|
|
704
704
|
}
|
|
705
705
|
function ho(t, e, i) {
|
|
706
|
-
var n, r,
|
|
706
|
+
var n, r, s, o, a, c, l, h, u = t.kind, f = t.result, d;
|
|
707
707
|
if (d = t.input.charCodeAt(t.position), k(d) || ke(d) || d === 35 || d === 38 || d === 42 || d === 33 || d === 124 || d === 62 || d === 39 || d === 34 || d === 37 || d === 64 || d === 96 || (d === 63 || d === 45) && (r = t.input.charCodeAt(t.position + 1), k(r) || i && ke(r)))
|
|
708
708
|
return !1;
|
|
709
|
-
for (t.kind = "scalar", t.result = "",
|
|
709
|
+
for (t.kind = "scalar", t.result = "", s = o = t.position, a = !1; d !== 0; ) {
|
|
710
710
|
if (d === 58) {
|
|
711
711
|
if (r = t.input.charCodeAt(t.position + 1), k(r) || i && ke(r))
|
|
712
712
|
break;
|
|
@@ -721,13 +721,13 @@ function ho(t, e, i) {
|
|
|
721
721
|
a = !0, d = t.input.charCodeAt(t.position);
|
|
722
722
|
continue;
|
|
723
723
|
} else {
|
|
724
|
-
t.position =
|
|
724
|
+
t.position = o, t.line = c, t.lineStart = l, t.lineIndent = h;
|
|
725
725
|
break;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
a && (ae(t,
|
|
728
|
+
a && (ae(t, s, o, !1), _i(t, t.line - c), s = o = t.position, a = !1), ye(d) || (o = t.position + 1), d = t.input.charCodeAt(++t.position);
|
|
729
729
|
}
|
|
730
|
-
return ae(t,
|
|
730
|
+
return ae(t, s, o, !1), t.result ? !0 : (t.kind = u, t.result = f, !1);
|
|
731
731
|
}
|
|
732
732
|
function uo(t, e) {
|
|
733
733
|
var i, n, r;
|
|
@@ -743,7 +743,7 @@ function uo(t, e) {
|
|
|
743
743
|
y(t, "unexpected end of the stream within a single quoted scalar");
|
|
744
744
|
}
|
|
745
745
|
function fo(t, e) {
|
|
746
|
-
var i, n, r,
|
|
746
|
+
var i, n, r, s, o, a;
|
|
747
747
|
if (a = t.input.charCodeAt(t.position), a !== 34)
|
|
748
748
|
return !1;
|
|
749
749
|
for (t.kind = "scalar", t.result = "", t.position++, i = n = t.position; (a = t.input.charCodeAt(t.position)) !== 0; ) {
|
|
@@ -754,10 +754,10 @@ function fo(t, e) {
|
|
|
754
754
|
C(t, !1, e);
|
|
755
755
|
else if (a < 256 && Bn[a])
|
|
756
756
|
t.result += Wn[a], t.position++;
|
|
757
|
-
else if ((
|
|
758
|
-
for (r =
|
|
759
|
-
a = t.input.charCodeAt(++t.position), (
|
|
760
|
-
t.result += co(
|
|
757
|
+
else if ((o = oo(a)) > 0) {
|
|
758
|
+
for (r = o, s = 0; r > 0; r--)
|
|
759
|
+
a = t.input.charCodeAt(++t.position), (o = so(a)) >= 0 ? s = (s << 4) + o : y(t, "expected hexadecimal character");
|
|
760
|
+
t.result += co(s), t.position++;
|
|
761
761
|
} else
|
|
762
762
|
y(t, "unknown escape sequence");
|
|
763
763
|
i = n = t.position;
|
|
@@ -766,7 +766,7 @@ function fo(t, e) {
|
|
|
766
766
|
y(t, "unexpected end of the stream within a double quoted scalar");
|
|
767
767
|
}
|
|
768
768
|
function po(t, e) {
|
|
769
|
-
var i = !0, n, r,
|
|
769
|
+
var i = !0, n, r, s, o = t.tag, a, c = t.anchor, l, h, u, f, d, p = /* @__PURE__ */ Object.create(null), m, v, _, x;
|
|
770
770
|
if (x = t.input.charCodeAt(t.position), x === 91)
|
|
771
771
|
h = 93, d = !1, a = [];
|
|
772
772
|
else if (x === 123)
|
|
@@ -775,13 +775,13 @@ function po(t, e) {
|
|
|
775
775
|
return !1;
|
|
776
776
|
for (t.anchor !== null && (t.anchorMap[t.anchor] = a), x = t.input.charCodeAt(++t.position); x !== 0; ) {
|
|
777
777
|
if (C(t, !0, e), x = t.input.charCodeAt(t.position), x === h)
|
|
778
|
-
return t.position++, t.tag =
|
|
779
|
-
i ? x === 44 && y(t, "expected the node content, but found ','") : y(t, "missed comma between flow collection entries"), v = m = _ = null, u = f = !1, x === 63 && (l = t.input.charCodeAt(t.position + 1), k(l) && (u = f = !0, t.position++, C(t, !0, e))), n = t.line, r = t.lineStart,
|
|
778
|
+
return t.position++, t.tag = o, t.anchor = c, t.kind = d ? "mapping" : "sequence", t.result = a, !0;
|
|
779
|
+
i ? x === 44 && y(t, "expected the node content, but found ','") : y(t, "missed comma between flow collection entries"), v = m = _ = null, u = f = !1, x === 63 && (l = t.input.charCodeAt(t.position + 1), k(l) && (u = f = !0, t.position++, C(t, !0, e))), n = t.line, r = t.lineStart, s = t.position, Ne(t, e, vt, !1, !0), v = t.tag, m = t.result, C(t, !0, e), x = t.input.charCodeAt(t.position), (f || t.line === n) && x === 58 && (u = !0, x = t.input.charCodeAt(++t.position), C(t, !0, e), Ne(t, e, vt, !1, !0), _ = t.result), d ? Fe(t, a, p, v, m, _, n, r, s) : u ? a.push(Fe(t, null, p, v, m, _, n, r, s)) : a.push(m), C(t, !0, e), x = t.input.charCodeAt(t.position), x === 44 ? (i = !0, x = t.input.charCodeAt(++t.position)) : i = !1;
|
|
780
780
|
}
|
|
781
781
|
y(t, "unexpected end of the stream within a flow collection");
|
|
782
782
|
}
|
|
783
783
|
function go(t, e) {
|
|
784
|
-
var i, n, r = Bt,
|
|
784
|
+
var i, n, r = Bt, s = !1, o = !1, a = e, c = 0, l = !1, h, u;
|
|
785
785
|
if (u = t.input.charCodeAt(t.position), u === 124)
|
|
786
786
|
n = !1;
|
|
787
787
|
else if (u === 62)
|
|
@@ -792,7 +792,7 @@ function go(t, e) {
|
|
|
792
792
|
if (u = t.input.charCodeAt(++t.position), u === 43 || u === 45)
|
|
793
793
|
Bt === r ? r = u === 43 ? Di : to : y(t, "repeat of a chomping mode identifier");
|
|
794
794
|
else if ((h = ao(u)) >= 0)
|
|
795
|
-
h === 0 ? y(t, "bad explicit indentation width of a block scalar; it cannot be less than one") :
|
|
795
|
+
h === 0 ? y(t, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? y(t, "repeat of an indentation width identifier") : (a = e + h - 1, o = !0);
|
|
796
796
|
else
|
|
797
797
|
break;
|
|
798
798
|
if (ye(u)) {
|
|
@@ -805,57 +805,57 @@ function go(t, e) {
|
|
|
805
805
|
while (!K(u) && u !== 0);
|
|
806
806
|
}
|
|
807
807
|
for (; u !== 0; ) {
|
|
808
|
-
for (yi(t), t.lineIndent = 0, u = t.input.charCodeAt(t.position); (!
|
|
808
|
+
for (yi(t), t.lineIndent = 0, u = t.input.charCodeAt(t.position); (!o || t.lineIndent < a) && u === 32; )
|
|
809
809
|
t.lineIndent++, u = t.input.charCodeAt(++t.position);
|
|
810
|
-
if (!
|
|
810
|
+
if (!o && t.lineIndent > a && (a = t.lineIndent), K(u)) {
|
|
811
811
|
c++;
|
|
812
812
|
continue;
|
|
813
813
|
}
|
|
814
814
|
if (t.lineIndent < a) {
|
|
815
815
|
r === Di ? t.result += A.repeat(`
|
|
816
|
-
`,
|
|
816
|
+
`, s ? 1 + c : c) : r === Bt && s && (t.result += `
|
|
817
817
|
`);
|
|
818
818
|
break;
|
|
819
819
|
}
|
|
820
820
|
for (n ? ye(u) ? (l = !0, t.result += A.repeat(`
|
|
821
|
-
`,
|
|
822
|
-
`, c + 1)) : c === 0 ?
|
|
821
|
+
`, s ? 1 + c : c)) : l ? (l = !1, t.result += A.repeat(`
|
|
822
|
+
`, c + 1)) : c === 0 ? s && (t.result += " ") : t.result += A.repeat(`
|
|
823
823
|
`, c) : t.result += A.repeat(`
|
|
824
|
-
`,
|
|
824
|
+
`, s ? 1 + c : c), s = !0, o = !0, c = 0, i = t.position; !K(u) && u !== 0; )
|
|
825
825
|
u = t.input.charCodeAt(++t.position);
|
|
826
826
|
ae(t, i, t.position, !1);
|
|
827
827
|
}
|
|
828
828
|
return !0;
|
|
829
829
|
}
|
|
830
830
|
function Ui(t, e) {
|
|
831
|
-
var i, n = t.tag, r = t.anchor,
|
|
831
|
+
var i, n = t.tag, r = t.anchor, s = [], o, a = !1, c;
|
|
832
832
|
if (t.firstTabInLine !== -1) return !1;
|
|
833
|
-
for (t.anchor !== null && (t.anchorMap[t.anchor] =
|
|
833
|
+
for (t.anchor !== null && (t.anchorMap[t.anchor] = s), c = t.input.charCodeAt(t.position); c !== 0 && (t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, y(t, "tab characters must not be used in indentation")), !(c !== 45 || (o = t.input.charCodeAt(t.position + 1), !k(o)))); ) {
|
|
834
834
|
if (a = !0, t.position++, C(t, !0, -1) && t.lineIndent <= e) {
|
|
835
|
-
|
|
835
|
+
s.push(null), c = t.input.charCodeAt(t.position);
|
|
836
836
|
continue;
|
|
837
837
|
}
|
|
838
|
-
if (i = t.line, Ne(t, e, Gn, !1, !0),
|
|
838
|
+
if (i = t.line, Ne(t, e, Gn, !1, !0), s.push(t.result), C(t, !0, -1), c = t.input.charCodeAt(t.position), (t.line === i || t.lineIndent > e) && c !== 0)
|
|
839
839
|
y(t, "bad indentation of a sequence entry");
|
|
840
840
|
else if (t.lineIndent < e)
|
|
841
841
|
break;
|
|
842
842
|
}
|
|
843
|
-
return a ? (t.tag = n, t.anchor = r, t.kind = "sequence", t.result =
|
|
843
|
+
return a ? (t.tag = n, t.anchor = r, t.kind = "sequence", t.result = s, !0) : !1;
|
|
844
844
|
}
|
|
845
845
|
function mo(t, e, i) {
|
|
846
|
-
var n, r,
|
|
846
|
+
var n, r, s, o, a, c, l = t.tag, h = t.anchor, u = {}, f = /* @__PURE__ */ Object.create(null), d = null, p = null, m = null, v = !1, _ = !1, x;
|
|
847
847
|
if (t.firstTabInLine !== -1) return !1;
|
|
848
848
|
for (t.anchor !== null && (t.anchorMap[t.anchor] = u), x = t.input.charCodeAt(t.position); x !== 0; ) {
|
|
849
|
-
if (!v && t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, y(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1),
|
|
850
|
-
x === 63 ? (v && (Fe(t, u, f, d, p, null,
|
|
849
|
+
if (!v && t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, y(t, "tab characters must not be used in indentation")), n = t.input.charCodeAt(t.position + 1), s = t.line, (x === 63 || x === 58) && k(n))
|
|
850
|
+
x === 63 ? (v && (Fe(t, u, f, d, p, null, o, a, c), d = p = m = null), _ = !0, v = !0, r = !0) : v ? (v = !1, r = !0) : y(t, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), t.position += 1, x = n;
|
|
851
851
|
else {
|
|
852
|
-
if (
|
|
852
|
+
if (o = t.line, a = t.lineStart, c = t.position, !Ne(t, i, $n, !1, !0))
|
|
853
853
|
break;
|
|
854
|
-
if (t.line ===
|
|
854
|
+
if (t.line === s) {
|
|
855
855
|
for (x = t.input.charCodeAt(t.position); ye(x); )
|
|
856
856
|
x = t.input.charCodeAt(++t.position);
|
|
857
857
|
if (x === 58)
|
|
858
|
-
x = t.input.charCodeAt(++t.position), k(x) || y(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (Fe(t, u, f, d, p, null,
|
|
858
|
+
x = t.input.charCodeAt(++t.position), k(x) || y(t, "a whitespace character is expected after the key-value separator within a block mapping"), v && (Fe(t, u, f, d, p, null, o, a, c), d = p = m = null), _ = !0, v = !1, r = !1, d = t.tag, p = t.result;
|
|
859
859
|
else if (_)
|
|
860
860
|
y(t, "can not read an implicit mapping pair; a colon is missed");
|
|
861
861
|
else
|
|
@@ -865,33 +865,33 @@ function mo(t, e, i) {
|
|
|
865
865
|
else
|
|
866
866
|
return t.tag = l, t.anchor = h, !0;
|
|
867
867
|
}
|
|
868
|
-
if ((t.line ===
|
|
868
|
+
if ((t.line === s || t.lineIndent > e) && (v && (o = t.line, a = t.lineStart, c = t.position), Ne(t, e, xt, !0, r) && (v ? p = t.result : m = t.result), v || (Fe(t, u, f, d, p, m, o, a, c), d = p = m = null), C(t, !0, -1), x = t.input.charCodeAt(t.position)), (t.line === s || t.lineIndent > e) && x !== 0)
|
|
869
869
|
y(t, "bad indentation of a mapping entry");
|
|
870
870
|
else if (t.lineIndent < e)
|
|
871
871
|
break;
|
|
872
872
|
}
|
|
873
|
-
return v && Fe(t, u, f, d, p, null,
|
|
873
|
+
return v && Fe(t, u, f, d, p, null, o, a, c), _ && (t.tag = l, t.anchor = h, t.kind = "mapping", t.result = u), _;
|
|
874
874
|
}
|
|
875
875
|
function vo(t) {
|
|
876
|
-
var e, i = !1, n = !1, r,
|
|
877
|
-
if (
|
|
878
|
-
if (t.tag !== null && y(t, "duplication of a tag property"),
|
|
876
|
+
var e, i = !1, n = !1, r, s, o;
|
|
877
|
+
if (o = t.input.charCodeAt(t.position), o !== 33) return !1;
|
|
878
|
+
if (t.tag !== null && y(t, "duplication of a tag property"), o = t.input.charCodeAt(++t.position), o === 60 ? (i = !0, o = t.input.charCodeAt(++t.position)) : o === 33 ? (n = !0, r = "!!", o = t.input.charCodeAt(++t.position)) : r = "!", e = t.position, i) {
|
|
879
879
|
do
|
|
880
|
-
|
|
881
|
-
while (
|
|
882
|
-
t.position < t.length ? (
|
|
880
|
+
o = t.input.charCodeAt(++t.position);
|
|
881
|
+
while (o !== 0 && o !== 62);
|
|
882
|
+
t.position < t.length ? (s = t.input.slice(e, t.position), o = t.input.charCodeAt(++t.position)) : y(t, "unexpected end of the stream within a verbatim tag");
|
|
883
883
|
} else {
|
|
884
|
-
for (;
|
|
885
|
-
|
|
886
|
-
|
|
884
|
+
for (; o !== 0 && !k(o); )
|
|
885
|
+
o === 33 && (n ? y(t, "tag suffix cannot contain exclamation marks") : (r = t.input.slice(e - 1, t.position + 1), Un.test(r) || y(t, "named tag handle cannot contain such characters"), n = !0, e = t.position + 1)), o = t.input.charCodeAt(++t.position);
|
|
886
|
+
s = t.input.slice(e, t.position), ro.test(s) && y(t, "tag suffix cannot contain flow indicator characters");
|
|
887
887
|
}
|
|
888
|
-
|
|
888
|
+
s && !Hn.test(s) && y(t, "tag name cannot contain such characters: " + s);
|
|
889
889
|
try {
|
|
890
|
-
|
|
890
|
+
s = decodeURIComponent(s);
|
|
891
891
|
} catch {
|
|
892
|
-
y(t, "tag name is malformed: " +
|
|
892
|
+
y(t, "tag name is malformed: " + s);
|
|
893
893
|
}
|
|
894
|
-
return i ? t.tag =
|
|
894
|
+
return i ? t.tag = s : ce.call(t.tagMap, r) ? t.tag = t.tagMap[r] + s : r === "!" ? t.tag = "!" + s : r === "!!" ? t.tag = "tag:yaml.org,2002:" + s : y(t, 'undeclared tag handle "' + r + '"'), !0;
|
|
895
895
|
}
|
|
896
896
|
function xo(t) {
|
|
897
897
|
var e, i;
|
|
@@ -908,11 +908,11 @@ function yo(t) {
|
|
|
908
908
|
return t.position === e && y(t, "name of an alias node must contain at least one character"), i = t.input.slice(e, t.position), ce.call(t.anchorMap, i) || y(t, 'unidentified alias "' + i + '"'), t.result = t.anchorMap[i], C(t, !0, -1), !0;
|
|
909
909
|
}
|
|
910
910
|
function Ne(t, e, i, n, r) {
|
|
911
|
-
var
|
|
912
|
-
if (t.listener !== null && t.listener("open", t), t.tag = null, t.anchor = null, t.kind = null, t.result = null,
|
|
911
|
+
var s, o, a, c = 1, l = !1, h = !1, u, f, d, p, m, v;
|
|
912
|
+
if (t.listener !== null && t.listener("open", t), t.tag = null, t.anchor = null, t.kind = null, t.result = null, s = o = a = xt === i || Gn === i, n && C(t, !0, -1) && (l = !0, t.lineIndent > e ? c = 1 : t.lineIndent === e ? c = 0 : t.lineIndent < e && (c = -1)), c === 1)
|
|
913
913
|
for (; vo(t) || xo(t); )
|
|
914
|
-
C(t, !0, -1) ? (l = !0, a =
|
|
915
|
-
if (a && (a = l || r), (c === 1 || xt === i) && (vt === i || $n === i ? m = e : m = e + 1, v = t.position - t.lineStart, c === 1 ? a && (Ui(t, v) || mo(t, v, m)) || po(t, m) ? h = !0 : (
|
|
914
|
+
C(t, !0, -1) ? (l = !0, a = s, t.lineIndent > e ? c = 1 : t.lineIndent === e ? c = 0 : t.lineIndent < e && (c = -1)) : a = !1;
|
|
915
|
+
if (a && (a = l || r), (c === 1 || xt === i) && (vt === i || $n === i ? m = e : m = e + 1, v = t.position - t.lineStart, c === 1 ? a && (Ui(t, v) || mo(t, v, m)) || po(t, m) ? h = !0 : (o && go(t, m) || uo(t, m) || fo(t, m) ? h = !0 : yo(t) ? (h = !0, (t.tag !== null || t.anchor !== null) && y(t, "alias node should not have any properties")) : ho(t, m, vt === i) && (h = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : c === 0 && (h = a && Ui(t, v))), t.tag === null)
|
|
916
916
|
t.anchor !== null && (t.anchorMap[t.anchor] = t.result);
|
|
917
917
|
else if (t.tag === "?") {
|
|
918
918
|
for (t.result !== null && t.kind !== "scalar" && y(t, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + t.kind + '"'), u = 0, f = t.implicitTypes.length; u < f; u += 1)
|
|
@@ -934,27 +934,27 @@ function Ne(t, e, i, n, r) {
|
|
|
934
934
|
return t.listener !== null && t.listener("close", t), t.tag !== null || t.anchor !== null || h;
|
|
935
935
|
}
|
|
936
936
|
function _o(t) {
|
|
937
|
-
var e = t.position, i, n, r,
|
|
938
|
-
for (t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = /* @__PURE__ */ Object.create(null), t.anchorMap = /* @__PURE__ */ Object.create(null); (
|
|
939
|
-
for (
|
|
940
|
-
|
|
941
|
-
for (n = t.input.slice(i, t.position), r = [], n.length < 1 && y(t, "directive name must not be less than one character in length");
|
|
942
|
-
for (; ye(
|
|
943
|
-
|
|
944
|
-
if (
|
|
937
|
+
var e = t.position, i, n, r, s = !1, o;
|
|
938
|
+
for (t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = /* @__PURE__ */ Object.create(null), t.anchorMap = /* @__PURE__ */ Object.create(null); (o = t.input.charCodeAt(t.position)) !== 0 && (C(t, !0, -1), o = t.input.charCodeAt(t.position), !(t.lineIndent > 0 || o !== 37)); ) {
|
|
939
|
+
for (s = !0, o = t.input.charCodeAt(++t.position), i = t.position; o !== 0 && !k(o); )
|
|
940
|
+
o = t.input.charCodeAt(++t.position);
|
|
941
|
+
for (n = t.input.slice(i, t.position), r = [], n.length < 1 && y(t, "directive name must not be less than one character in length"); o !== 0; ) {
|
|
942
|
+
for (; ye(o); )
|
|
943
|
+
o = t.input.charCodeAt(++t.position);
|
|
944
|
+
if (o === 35) {
|
|
945
945
|
do
|
|
946
|
-
|
|
947
|
-
while (
|
|
946
|
+
o = t.input.charCodeAt(++t.position);
|
|
947
|
+
while (o !== 0 && !K(o));
|
|
948
948
|
break;
|
|
949
949
|
}
|
|
950
|
-
if (K(
|
|
951
|
-
for (i = t.position;
|
|
952
|
-
|
|
950
|
+
if (K(o)) break;
|
|
951
|
+
for (i = t.position; o !== 0 && !k(o); )
|
|
952
|
+
o = t.input.charCodeAt(++t.position);
|
|
953
953
|
r.push(t.input.slice(i, t.position));
|
|
954
954
|
}
|
|
955
|
-
|
|
955
|
+
o !== 0 && yi(t), ce.call($i, n) ? $i[n](t, n, r) : yt(t, 'unknown document directive "' + n + '"');
|
|
956
956
|
}
|
|
957
|
-
if (C(t, !0, -1), t.lineIndent === 0 && t.input.charCodeAt(t.position) === 45 && t.input.charCodeAt(t.position + 1) === 45 && t.input.charCodeAt(t.position + 2) === 45 ? (t.position += 3, C(t, !0, -1)) :
|
|
957
|
+
if (C(t, !0, -1), t.lineIndent === 0 && t.input.charCodeAt(t.position) === 45 && t.input.charCodeAt(t.position + 1) === 45 && t.input.charCodeAt(t.position + 2) === 45 ? (t.position += 3, C(t, !0, -1)) : s && y(t, "directives end mark is expected"), Ne(t, t.lineIndent - 1, xt, !1, !0), C(t, !0, -1), t.checkLineBreaks && no.test(t.input.slice(e, t.position)) && yt(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && kt(t)) {
|
|
958
958
|
t.input.charCodeAt(t.position) === 46 && (t.position += 3, C(t, !0, -1));
|
|
959
959
|
return;
|
|
960
960
|
}
|
|
@@ -978,7 +978,7 @@ function wo(t, e, i) {
|
|
|
978
978
|
var n = Vn(t, i);
|
|
979
979
|
if (typeof e != "function")
|
|
980
980
|
return n;
|
|
981
|
-
for (var r = 0,
|
|
981
|
+
for (var r = 0, s = n.length; r < s; r += 1)
|
|
982
982
|
e(n[r]);
|
|
983
983
|
}
|
|
984
984
|
function So(t, e) {
|
|
@@ -1027,10 +1027,10 @@ var Uo = [
|
|
|
1027
1027
|
"OFF"
|
|
1028
1028
|
], Ho = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
1029
1029
|
function Yo(t, e) {
|
|
1030
|
-
var i, n, r,
|
|
1030
|
+
var i, n, r, s, o, a, c;
|
|
1031
1031
|
if (e === null) return {};
|
|
1032
|
-
for (i = {}, n = Object.keys(e), r = 0,
|
|
1033
|
-
|
|
1032
|
+
for (i = {}, n = Object.keys(e), r = 0, s = n.length; r < s; r += 1)
|
|
1033
|
+
o = n[r], a = String(e[o]), o.slice(0, 2) === "!!" && (o = "tag:yaml.org,2002:" + o.slice(2)), c = t.compiledTypeMap.fallback[o], c && Jn.call(c.styleAliases, a) && (a = c.styleAliases[a]), i[o] = a;
|
|
1034
1034
|
return i;
|
|
1035
1035
|
}
|
|
1036
1036
|
function Bo(t) {
|
|
@@ -1050,11 +1050,11 @@ function jo(t) {
|
|
|
1050
1050
|
this.schema = t.schema || xi, this.indent = Math.max(1, t.indent || 2), this.noArrayIndent = t.noArrayIndent || !1, this.skipInvalid = t.skipInvalid || !1, this.flowLevel = A.isNothing(t.flowLevel) ? -1 : t.flowLevel, this.styleMap = Yo(this.schema, t.styles || null), this.sortKeys = t.sortKeys || !1, this.lineWidth = t.lineWidth || 80, this.noRefs = t.noRefs || !1, this.noCompatMode = t.noCompatMode || !1, this.condenseFlow = t.condenseFlow || !1, this.quotingType = t.quotingType === '"' ? Je : Wo, this.forceQuotes = t.forceQuotes || !1, this.replacer = typeof t.replacer == "function" ? t.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
|
|
1051
1051
|
}
|
|
1052
1052
|
function Hi(t, e) {
|
|
1053
|
-
for (var i = A.repeat(" ", e), n = 0, r = -1,
|
|
1053
|
+
for (var i = A.repeat(" ", e), n = 0, r = -1, s = "", o, a = t.length; n < a; )
|
|
1054
1054
|
r = t.indexOf(`
|
|
1055
|
-
`, n), r === -1 ? (
|
|
1056
|
-
` && (
|
|
1057
|
-
return
|
|
1055
|
+
`, n), r === -1 ? (o = t.slice(n), n = a) : (o = t.slice(n, r + 1), n = r + 1), o.length && o !== `
|
|
1056
|
+
` && (s += i), s += o;
|
|
1057
|
+
return s;
|
|
1058
1058
|
}
|
|
1059
1059
|
function Qt(t, e) {
|
|
1060
1060
|
return `
|
|
@@ -1101,9 +1101,9 @@ function ir(t) {
|
|
|
1101
1101
|
return e.test(t);
|
|
1102
1102
|
}
|
|
1103
1103
|
var nr = 1, ei = 2, rr = 3, sr = 4, Le = 5;
|
|
1104
|
-
function Jo(t, e, i, n, r,
|
|
1104
|
+
function Jo(t, e, i, n, r, s, o, a) {
|
|
1105
1105
|
var c, l = 0, h = null, u = !1, f = !1, d = n !== -1, p = -1, m = Xo(Ye(t, 0)) && qo(Ye(t, t.length - 1));
|
|
1106
|
-
if (e ||
|
|
1106
|
+
if (e || o)
|
|
1107
1107
|
for (c = 0; c < t.length; l >= 65536 ? c += 2 : c++) {
|
|
1108
1108
|
if (l = Ye(t, c), !Ke(l))
|
|
1109
1109
|
return Le;
|
|
@@ -1120,7 +1120,7 @@ function Jo(t, e, i, n, r, o, s, a) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
f = f || d && c - p - 1 > n && t[p + 1] !== " ";
|
|
1122
1122
|
}
|
|
1123
|
-
return !u && !f ? m && !
|
|
1123
|
+
return !u && !f ? m && !o && !r(t) ? nr : s === Je ? Le : ei : i > 9 && ir(t) ? Le : o ? s === Je ? Le : ei : f ? sr : rr;
|
|
1124
1124
|
}
|
|
1125
1125
|
function Ko(t, e, i, n, r) {
|
|
1126
1126
|
t.dump = (function() {
|
|
@@ -1128,7 +1128,7 @@ function Ko(t, e, i, n, r) {
|
|
|
1128
1128
|
return t.quotingType === Je ? '""' : "''";
|
|
1129
1129
|
if (!t.noCompatMode && (Uo.indexOf(e) !== -1 || Ho.test(e)))
|
|
1130
1130
|
return t.quotingType === Je ? '"' + e + '"' : "'" + e + "'";
|
|
1131
|
-
var
|
|
1131
|
+
var s = t.indent * Math.max(1, i), o = t.lineWidth === -1 ? -1 : Math.max(Math.min(t.lineWidth, 40), t.lineWidth - s), a = n || t.flowLevel > -1 && i >= t.flowLevel;
|
|
1132
1132
|
function c(l) {
|
|
1133
1133
|
return Vo(t, l);
|
|
1134
1134
|
}
|
|
@@ -1136,7 +1136,7 @@ function Ko(t, e, i, n, r) {
|
|
|
1136
1136
|
e,
|
|
1137
1137
|
a,
|
|
1138
1138
|
t.indent,
|
|
1139
|
-
|
|
1139
|
+
o,
|
|
1140
1140
|
c,
|
|
1141
1141
|
t.quotingType,
|
|
1142
1142
|
t.forceQuotes && !n,
|
|
@@ -1147,9 +1147,9 @@ function Ko(t, e, i, n, r) {
|
|
|
1147
1147
|
case ei:
|
|
1148
1148
|
return "'" + e.replace(/'/g, "''") + "'";
|
|
1149
1149
|
case rr:
|
|
1150
|
-
return "|" + Wi(e, t.indent) + ji(Hi(e,
|
|
1150
|
+
return "|" + Wi(e, t.indent) + ji(Hi(e, s));
|
|
1151
1151
|
case sr:
|
|
1152
|
-
return ">" + Wi(e, t.indent) + ji(Hi(Zo(e,
|
|
1152
|
+
return ">" + Wi(e, t.indent) + ji(Hi(Zo(e, o), s));
|
|
1153
1153
|
case Le:
|
|
1154
1154
|
return '"' + Qo(e) + '"';
|
|
1155
1155
|
default:
|
|
@@ -1161,8 +1161,8 @@ function Wi(t, e) {
|
|
|
1161
1161
|
var i = ir(t) ? String(e) : "", n = t[t.length - 1] === `
|
|
1162
1162
|
`, r = n && (t[t.length - 2] === `
|
|
1163
1163
|
` || t === `
|
|
1164
|
-
`),
|
|
1165
|
-
return i +
|
|
1164
|
+
`), s = r ? "+" : n ? "" : "-";
|
|
1165
|
+
return i + s + `
|
|
1166
1166
|
`;
|
|
1167
1167
|
}
|
|
1168
1168
|
function ji(t) {
|
|
@@ -1175,21 +1175,21 @@ function Zo(t, e) {
|
|
|
1175
1175
|
`);
|
|
1176
1176
|
return l = l !== -1 ? l : t.length, i.lastIndex = l, Vi(t.slice(0, l), e);
|
|
1177
1177
|
})(), r = t[0] === `
|
|
1178
|
-
` || t[0] === " ",
|
|
1179
|
-
var a =
|
|
1180
|
-
|
|
1181
|
-
` : "") + Vi(c, e), r =
|
|
1178
|
+
` || t[0] === " ", s, o; o = i.exec(t); ) {
|
|
1179
|
+
var a = o[1], c = o[2];
|
|
1180
|
+
s = c[0] === " ", n += a + (!r && !s && c !== "" ? `
|
|
1181
|
+
` : "") + Vi(c, e), r = s;
|
|
1182
1182
|
}
|
|
1183
1183
|
return n;
|
|
1184
1184
|
}
|
|
1185
1185
|
function Vi(t, e) {
|
|
1186
1186
|
if (t === "" || t[0] === " ") return t;
|
|
1187
|
-
for (var i = / [^ ]/g, n, r = 0,
|
|
1188
|
-
a = n.index, a - r > e && (
|
|
1189
|
-
` + t.slice(r,
|
|
1187
|
+
for (var i = / [^ ]/g, n, r = 0, s, o = 0, a = 0, c = ""; n = i.exec(t); )
|
|
1188
|
+
a = n.index, a - r > e && (s = o > r ? o : a, c += `
|
|
1189
|
+
` + t.slice(r, s), r = s + 1), o = a;
|
|
1190
1190
|
return c += `
|
|
1191
|
-
`, t.length - r > e &&
|
|
1192
|
-
` + t.slice(
|
|
1191
|
+
`, t.length - r > e && o > r ? c += t.slice(r, o) + `
|
|
1192
|
+
` + t.slice(o + 1) : c += t.slice(r), c.slice(1);
|
|
1193
1193
|
}
|
|
1194
1194
|
function Qo(t) {
|
|
1195
1195
|
for (var e = "", i = 0, n, r = 0; r < t.length; i >= 65536 ? r += 2 : r++)
|
|
@@ -1197,39 +1197,39 @@ function Qo(t) {
|
|
|
1197
1197
|
return e;
|
|
1198
1198
|
}
|
|
1199
1199
|
function ea(t, e, i) {
|
|
1200
|
-
var n = "", r = t.tag,
|
|
1201
|
-
for (
|
|
1202
|
-
a = i[
|
|
1200
|
+
var n = "", r = t.tag, s, o, a;
|
|
1201
|
+
for (s = 0, o = i.length; s < o; s += 1)
|
|
1202
|
+
a = i[s], t.replacer && (a = t.replacer.call(i, String(s), a)), (re(t, e, a, !1, !1) || typeof a > "u" && re(t, e, null, !1, !1)) && (n !== "" && (n += "," + (t.condenseFlow ? "" : " ")), n += t.dump);
|
|
1203
1203
|
t.tag = r, t.dump = "[" + n + "]";
|
|
1204
1204
|
}
|
|
1205
1205
|
function Xi(t, e, i, n) {
|
|
1206
|
-
var r = "",
|
|
1207
|
-
for (
|
|
1208
|
-
c = i[
|
|
1209
|
-
t.tag =
|
|
1206
|
+
var r = "", s = t.tag, o, a, c;
|
|
1207
|
+
for (o = 0, a = i.length; o < a; o += 1)
|
|
1208
|
+
c = i[o], t.replacer && (c = t.replacer.call(i, String(o), c)), (re(t, e + 1, c, !0, !0, !1, !0) || typeof c > "u" && re(t, e + 1, null, !0, !0, !1, !0)) && ((!n || r !== "") && (r += Qt(t, e)), t.dump && qe === t.dump.charCodeAt(0) ? r += "-" : r += "- ", r += t.dump);
|
|
1209
|
+
t.tag = s, t.dump = r || "[]";
|
|
1210
1210
|
}
|
|
1211
1211
|
function ta(t, e, i) {
|
|
1212
|
-
var n = "", r = t.tag,
|
|
1213
|
-
for (
|
|
1214
|
-
h = "", n !== "" && (h += ", "), t.condenseFlow && (h += '"'), c = o
|
|
1212
|
+
var n = "", r = t.tag, s = Object.keys(i), o, a, c, l, h;
|
|
1213
|
+
for (o = 0, a = s.length; o < a; o += 1)
|
|
1214
|
+
h = "", n !== "" && (h += ", "), t.condenseFlow && (h += '"'), c = s[o], l = i[c], t.replacer && (l = t.replacer.call(i, c, l)), re(t, e, c, !1, !1) && (t.dump.length > 1024 && (h += "? "), h += t.dump + (t.condenseFlow ? '"' : "") + ":" + (t.condenseFlow ? "" : " "), re(t, e, l, !1, !1) && (h += t.dump, n += h));
|
|
1215
1215
|
t.tag = r, t.dump = "{" + n + "}";
|
|
1216
1216
|
}
|
|
1217
1217
|
function ia(t, e, i, n) {
|
|
1218
|
-
var r = "",
|
|
1218
|
+
var r = "", s = t.tag, o = Object.keys(i), a, c, l, h, u, f;
|
|
1219
1219
|
if (t.sortKeys === !0)
|
|
1220
|
-
|
|
1220
|
+
o.sort();
|
|
1221
1221
|
else if (typeof t.sortKeys == "function")
|
|
1222
|
-
|
|
1222
|
+
o.sort(t.sortKeys);
|
|
1223
1223
|
else if (t.sortKeys)
|
|
1224
1224
|
throw new M("sortKeys must be a boolean or a function");
|
|
1225
|
-
for (a = 0, c =
|
|
1226
|
-
f = "", (!n || r !== "") && (f += Qt(t, e)), l =
|
|
1227
|
-
t.tag =
|
|
1225
|
+
for (a = 0, c = o.length; a < c; a += 1)
|
|
1226
|
+
f = "", (!n || r !== "") && (f += Qt(t, e)), l = o[a], h = i[l], t.replacer && (h = t.replacer.call(i, l, h)), re(t, e + 1, l, !0, !0, !0) && (u = t.tag !== null && t.tag !== "?" || t.dump && t.dump.length > 1024, u && (t.dump && qe === t.dump.charCodeAt(0) ? f += "?" : f += "? "), f += t.dump, u && (f += Qt(t, e)), re(t, e + 1, h, !0, u) && (t.dump && qe === t.dump.charCodeAt(0) ? f += ":" : f += ": ", f += t.dump, r += f));
|
|
1227
|
+
t.tag = s, t.dump = r || "{}";
|
|
1228
1228
|
}
|
|
1229
1229
|
function qi(t, e, i) {
|
|
1230
|
-
var n, r,
|
|
1231
|
-
for (r = i ? t.explicitTypes : t.implicitTypes,
|
|
1232
|
-
if (a = r[
|
|
1230
|
+
var n, r, s, o, a, c;
|
|
1231
|
+
for (r = i ? t.explicitTypes : t.implicitTypes, s = 0, o = r.length; s < o; s += 1)
|
|
1232
|
+
if (a = r[s], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof e == "object" && e instanceof a.instanceOf) && (!a.predicate || a.predicate(e))) {
|
|
1233
1233
|
if (i ? a.multi && a.representName ? t.tag = a.representName(e) : t.tag = a.tag : t.tag = "?", a.represent) {
|
|
1234
1234
|
if (c = t.styleMap[a.tag] || a.defaultStyle, qn.call(a.represent) === "[object Function]")
|
|
1235
1235
|
n = a.represent(e, c);
|
|
@@ -1243,7 +1243,7 @@ function qi(t, e, i) {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
return !1;
|
|
1245
1245
|
}
|
|
1246
|
-
function re(t, e, i, n, r,
|
|
1246
|
+
function re(t, e, i, n, r, s, o) {
|
|
1247
1247
|
t.tag = null, t.dump = i, qi(t, i, !1) || qi(t, i, !0);
|
|
1248
1248
|
var a = qn.call(t.dump), c = n, l;
|
|
1249
1249
|
n && (n = t.flowLevel < 0 || t.flowLevel > e);
|
|
@@ -1254,9 +1254,9 @@ function re(t, e, i, n, r, o, s) {
|
|
|
1254
1254
|
if (h && f && !t.usedDuplicates[u] && (t.usedDuplicates[u] = !0), a === "[object Object]")
|
|
1255
1255
|
n && Object.keys(t.dump).length !== 0 ? (ia(t, e, t.dump, r), f && (t.dump = "&ref_" + u + t.dump)) : (ta(t, e, t.dump), f && (t.dump = "&ref_" + u + " " + t.dump));
|
|
1256
1256
|
else if (a === "[object Array]")
|
|
1257
|
-
n && t.dump.length !== 0 ? (t.noArrayIndent && !
|
|
1257
|
+
n && t.dump.length !== 0 ? (t.noArrayIndent && !o && e > 0 ? Xi(t, e - 1, t.dump, r) : Xi(t, e, t.dump, r), f && (t.dump = "&ref_" + u + t.dump)) : (ea(t, e, t.dump), f && (t.dump = "&ref_" + u + " " + t.dump));
|
|
1258
1258
|
else if (a === "[object String]")
|
|
1259
|
-
t.tag !== "?" && Ko(t, t.dump, e,
|
|
1259
|
+
t.tag !== "?" && Ko(t, t.dump, e, s, c);
|
|
1260
1260
|
else {
|
|
1261
1261
|
if (a === "[object Undefined]")
|
|
1262
1262
|
return !1;
|
|
@@ -1270,21 +1270,21 @@ function re(t, e, i, n, r, o, s) {
|
|
|
1270
1270
|
return !0;
|
|
1271
1271
|
}
|
|
1272
1272
|
function na(t, e) {
|
|
1273
|
-
var i = [], n = [], r,
|
|
1274
|
-
for (ti(t, i, n), r = 0,
|
|
1273
|
+
var i = [], n = [], r, s;
|
|
1274
|
+
for (ti(t, i, n), r = 0, s = n.length; r < s; r += 1)
|
|
1275
1275
|
e.duplicates.push(i[n[r]]);
|
|
1276
|
-
e.usedDuplicates = new Array(
|
|
1276
|
+
e.usedDuplicates = new Array(s);
|
|
1277
1277
|
}
|
|
1278
1278
|
function ti(t, e, i) {
|
|
1279
|
-
var n, r,
|
|
1279
|
+
var n, r, s;
|
|
1280
1280
|
if (t !== null && typeof t == "object")
|
|
1281
1281
|
if (r = e.indexOf(t), r !== -1)
|
|
1282
1282
|
i.indexOf(r) === -1 && i.push(r);
|
|
1283
1283
|
else if (e.push(t), Array.isArray(t))
|
|
1284
|
-
for (r = 0,
|
|
1284
|
+
for (r = 0, s = t.length; r < s; r += 1)
|
|
1285
1285
|
ti(t[r], e, i);
|
|
1286
1286
|
else
|
|
1287
|
-
for (n = Object.keys(t), r = 0,
|
|
1287
|
+
for (n = Object.keys(t), r = 0, s = n.length; r < s; r += 1)
|
|
1288
1288
|
ti(t[n[r]], e, i);
|
|
1289
1289
|
}
|
|
1290
1290
|
function ra(t, e) {
|
|
@@ -1399,13 +1399,13 @@ class he extends le {
|
|
|
1399
1399
|
_reapplyStates(e, i) {
|
|
1400
1400
|
const n = this._stateManager, r = this._elementType;
|
|
1401
1401
|
if (!n || !r) return;
|
|
1402
|
-
const o = n.sortByWeight(this._activeStates);
|
|
1403
|
-
for (const a of o)
|
|
1404
|
-
for (const c of n.getPlugins(a, r)) c.onLeave?.(this);
|
|
1405
|
-
e && this._activeStates.delete(e), i && this._activeStates.add(i);
|
|
1406
1402
|
const s = n.sortByWeight(this._activeStates);
|
|
1407
|
-
console.log(s);
|
|
1408
1403
|
for (const a of s)
|
|
1404
|
+
for (const c of n.getPlugins(a, r)) c.onLeave?.(this);
|
|
1405
|
+
e && this._activeStates.delete(e), i && this._activeStates.add(i);
|
|
1406
|
+
const o = n.sortByWeight(this._activeStates);
|
|
1407
|
+
console.log(o);
|
|
1408
|
+
for (const a of o)
|
|
1409
1409
|
for (const c of n.getPlugins(a, r)) c.onEnter?.(this);
|
|
1410
1410
|
}
|
|
1411
1411
|
/** 激活状态 */
|
|
@@ -1472,8 +1472,8 @@ class he extends le {
|
|
|
1472
1472
|
Object.assign(this._options, e);
|
|
1473
1473
|
} else {
|
|
1474
1474
|
const r = [.../* @__PURE__ */ new Set([...Object.keys(this._options), ...Object.keys(e)])];
|
|
1475
|
-
for (const
|
|
1476
|
-
this._options[
|
|
1475
|
+
for (const s of r)
|
|
1476
|
+
this._options[s] !== e[s] && n.push(s);
|
|
1477
1477
|
this._options = { ...e };
|
|
1478
1478
|
}
|
|
1479
1479
|
n.length > 0 && (this.onOptionsChanged(n), this._emit("options:changed", n));
|
|
@@ -1487,8 +1487,8 @@ class he extends le {
|
|
|
1487
1487
|
const n = i ? null : { ...this._options };
|
|
1488
1488
|
if (e(this._options), !i && n) {
|
|
1489
1489
|
const r = [];
|
|
1490
|
-
for (const
|
|
1491
|
-
this._options[
|
|
1490
|
+
for (const s of Object.keys(this._options))
|
|
1491
|
+
this._options[s] !== n[s] && r.push(s);
|
|
1492
1492
|
r.length > 0 && (this.onOptionsChanged(r), this._emit("options:changed", r));
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
@@ -1564,8 +1564,8 @@ class Ie extends le {
|
|
|
1564
1564
|
fromJSON(e) {
|
|
1565
1565
|
this.clear();
|
|
1566
1566
|
for (const i of e) {
|
|
1567
|
-
const { states: n, visible: r, locked:
|
|
1568
|
-
if (r === !1 && (a.visible = !1),
|
|
1567
|
+
const { states: n, visible: r, locked: s, ...o } = i, a = this.add(o);
|
|
1568
|
+
if (r === !1 && (a.visible = !1), s === !0 && (a.locked = !0), Array.isArray(n))
|
|
1569
1569
|
for (const c of n) a.addState(c);
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
@@ -1602,25 +1602,25 @@ function _f(t, e, i = 0) {
|
|
|
1602
1602
|
return { x: n, y: r };
|
|
1603
1603
|
}
|
|
1604
1604
|
function wf(t, e) {
|
|
1605
|
-
const i = Math.cos(Re), n = we, r = (t / i + e / n) / 2,
|
|
1606
|
-
return { x: r, y:
|
|
1605
|
+
const i = Math.cos(Re), n = we, r = (t / i + e / n) / 2, s = (e / n - t / i) / 2;
|
|
1606
|
+
return { x: r, y: s, z: 0 };
|
|
1607
1607
|
}
|
|
1608
1608
|
const J = (t) => Math.round(t / g) * g;
|
|
1609
1609
|
function wa(t, e, i) {
|
|
1610
|
-
const n = i.x - e.x, r = i.y - e.y,
|
|
1611
|
-
if (
|
|
1610
|
+
const n = i.x - e.x, r = i.y - e.y, s = n * n + r * r;
|
|
1611
|
+
if (s === 0) {
|
|
1612
1612
|
const u = t.x - e.x, f = t.y - e.y;
|
|
1613
1613
|
return Math.sqrt(u * u + f * f);
|
|
1614
1614
|
}
|
|
1615
|
-
const
|
|
1615
|
+
const o = Math.max(0, Math.min(1, ((t.x - e.x) * n + (t.y - e.y) * r) / s)), a = e.x + o * n, c = e.y + o * r, l = t.x - a, h = t.y - c;
|
|
1616
1616
|
return Math.sqrt(l * l + h * h);
|
|
1617
1617
|
}
|
|
1618
1618
|
const Sa = new dt.AStarFinder({
|
|
1619
1619
|
heuristic: dt.Heuristic.manhattan,
|
|
1620
1620
|
diagonalMovement: dt.DiagonalMovement.Always
|
|
1621
1621
|
}), ba = ({ tileSize: t, from: e, to: i }) => {
|
|
1622
|
-
const n = Math.max(1, Math.ceil(t.width)), r = Math.max(1, Math.ceil(t.height)),
|
|
1623
|
-
return Sa.findPath(
|
|
1622
|
+
const n = Math.max(1, Math.ceil(t.width)), r = Math.max(1, Math.ceil(t.height)), s = Math.max(0, Math.min(n - 1, Math.round(e.x))), o = Math.max(0, Math.min(r - 1, Math.round(e.y))), a = Math.max(0, Math.min(n - 1, Math.round(i.x))), c = Math.max(0, Math.min(r - 1, Math.round(i.y))), l = new dt.Grid(n, r);
|
|
1623
|
+
return Sa.findPath(s, o, a, c, l).map((f) => ({
|
|
1624
1624
|
x: f[0],
|
|
1625
1625
|
y: f[1]
|
|
1626
1626
|
}));
|
|
@@ -1630,25 +1630,25 @@ const Sa = new dt.AStarFinder({
|
|
|
1630
1630
|
const n = {
|
|
1631
1631
|
byX: e[e.length - 1],
|
|
1632
1632
|
byY: i[i.length - 1]
|
|
1633
|
-
}, r = { byX: e[0], byY: i[0] },
|
|
1633
|
+
}, r = { byX: e[0], byY: i[0] }, s = r.byX.x, o = n.byX.x, a = r.byY.y, c = n.byY.y;
|
|
1634
1634
|
return {
|
|
1635
1635
|
byX: e,
|
|
1636
1636
|
byY: i,
|
|
1637
1637
|
highest: n,
|
|
1638
1638
|
lowest: r,
|
|
1639
|
-
lowX:
|
|
1639
|
+
lowX: s,
|
|
1640
1640
|
lowY: a,
|
|
1641
|
-
highX:
|
|
1641
|
+
highX: o,
|
|
1642
1642
|
highY: c
|
|
1643
1643
|
};
|
|
1644
1644
|
};
|
|
1645
1645
|
function Ca(t, e = { x: 0, y: 0 }) {
|
|
1646
|
-
const { lowX: i, lowY: n, highX: r, highY:
|
|
1646
|
+
const { lowX: i, lowY: n, highX: r, highY: s } = vr(t);
|
|
1647
1647
|
return [
|
|
1648
1648
|
{ x: i - e.x, y: n - e.y },
|
|
1649
1649
|
{ x: r + e.x, y: n - e.y },
|
|
1650
|
-
{ x: r + e.x, y:
|
|
1651
|
-
{ x: i - e.x, y:
|
|
1650
|
+
{ x: r + e.x, y: s + e.y },
|
|
1651
|
+
{ x: i - e.x, y: s + e.y }
|
|
1652
1652
|
];
|
|
1653
1653
|
}
|
|
1654
1654
|
function Ia(t) {
|
|
@@ -1713,12 +1713,12 @@ class bt extends he {
|
|
|
1713
1713
|
this.drawNode();
|
|
1714
1714
|
}
|
|
1715
1715
|
drawNode() {
|
|
1716
|
-
const { x: e, y: i, icon: n, isFlat: r } = this.options,
|
|
1716
|
+
const { x: e, y: i, icon: n, isFlat: r } = this.options, s = this.options.scale, o = this.options.scaleY ?? 1;
|
|
1717
1717
|
this.graphics.clear(), this.graphics.label = `node:${this.options.id}`, this.graphics.zIndex = this.options.zIndex ?? 0, this.graphics.position.set(e * g, i * g), r ? (this.graphics.skew.set(0, 0), this.graphics.scale.set(1, 1)) : (this.graphics.skew.set(bi, Ci), this.graphics.scale.set(Ii, D));
|
|
1718
|
-
const a = r ? 1 :
|
|
1718
|
+
const a = r ? 1 : o;
|
|
1719
1719
|
this.graphics.scale.set(
|
|
1720
|
-
|
|
1721
|
-
|
|
1720
|
+
s * this.graphics.scale.x,
|
|
1721
|
+
s * a * this.graphics.scale.y
|
|
1722
1722
|
), this.loadIcon(n);
|
|
1723
1723
|
}
|
|
1724
1724
|
/**
|
|
@@ -1815,24 +1815,24 @@ function Ai(t, e, i) {
|
|
|
1815
1815
|
function Pa(t, e, i) {
|
|
1816
1816
|
const n = Ai(t, e, i), r = oi.get(n);
|
|
1817
1817
|
if (r) return r;
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
const
|
|
1818
|
+
const s = document.createElement("canvas");
|
|
1819
|
+
s.width = i, s.height = je;
|
|
1820
|
+
const o = s.getContext("2d"), a = t >> 16 & 255, c = t >> 8 & 255, l = t & 255;
|
|
1821
1821
|
if (e) {
|
|
1822
|
-
const h =
|
|
1823
|
-
h.addColorStop(0, `rgba(${a},${c},${l},0)`), h.addColorStop(0.2, `rgba(${a},${c},${l},0.8)`), h.addColorStop(0.25, `rgba(${a},${c},${l},1)`), h.addColorStop(0.5, `rgba(${a},${c},${l},1)`), h.addColorStop(0.5, `rgba(${a},${c},${l},0)`),
|
|
1822
|
+
const h = o.createLinearGradient(0, 0, i, 0);
|
|
1823
|
+
h.addColorStop(0, `rgba(${a},${c},${l},0)`), h.addColorStop(0.2, `rgba(${a},${c},${l},0.8)`), h.addColorStop(0.25, `rgba(${a},${c},${l},1)`), h.addColorStop(0.5, `rgba(${a},${c},${l},1)`), h.addColorStop(0.5, `rgba(${a},${c},${l},0)`), o.fillStyle = h;
|
|
1824
1824
|
} else
|
|
1825
|
-
|
|
1826
|
-
return
|
|
1825
|
+
o.fillStyle = `rgb(${a},${c},${l})`;
|
|
1826
|
+
return o.fillRect(0, 0, i, je), oi.set(n, s), s;
|
|
1827
1827
|
}
|
|
1828
1828
|
function Ma(t, e, i) {
|
|
1829
1829
|
const n = Ai(t, e, i), r = ai.get(n);
|
|
1830
1830
|
if (r) return r;
|
|
1831
|
-
const
|
|
1832
|
-
return ai.set(n,
|
|
1831
|
+
const s = Pa(t, e, i), o = ne.from({ resource: s, antialias: !0 });
|
|
1832
|
+
return ai.set(n, o.source), o.source;
|
|
1833
1833
|
}
|
|
1834
1834
|
function Ea(t) {
|
|
1835
|
-
const { color: e, width: i, dashPattern: n = [10, 5] } = t, r = n.reduce((v, _) => v + _, 0),
|
|
1835
|
+
const { color: e, width: i, dashPattern: n = [10, 5] } = t, r = n.reduce((v, _) => v + _, 0), s = Math.max(Math.round(i), 2), o = `dash_c${e}_d${n.join(",")}_w${s}`, a = Y.get(o);
|
|
1836
1836
|
if (a) return a;
|
|
1837
1837
|
const c = e >> 16 & 255, l = e >> 8 & 255, h = e & 255, u = document.createElement("canvas");
|
|
1838
1838
|
u.width = r, u.height = je;
|
|
@@ -1845,16 +1845,16 @@ function Ea(t) {
|
|
|
1845
1845
|
p.source.addressMode = "repeat";
|
|
1846
1846
|
const m = new ne({
|
|
1847
1847
|
source: p.source,
|
|
1848
|
-
frame: new Lt(0, 0, r,
|
|
1848
|
+
frame: new Lt(0, 0, r, s)
|
|
1849
1849
|
});
|
|
1850
|
-
return Y.set(
|
|
1850
|
+
return Y.set(o, m), yr(), m;
|
|
1851
1851
|
}
|
|
1852
1852
|
function La(t) {
|
|
1853
|
-
const { color: e, width: i, gradient: n = !0, length: r = 100 } = t,
|
|
1853
|
+
const { color: e, width: i, gradient: n = !0, length: r = 100 } = t, s = Math.max(Math.round(i), 2), a = `${Ai(e, n, r)}_w${s}`, c = Y.get(a);
|
|
1854
1854
|
if (c) return c;
|
|
1855
1855
|
const l = Ma(e, n, r), h = new ne({
|
|
1856
1856
|
source: l,
|
|
1857
|
-
frame: new Lt(0, 0, r,
|
|
1857
|
+
frame: new Lt(0, 0, r, s)
|
|
1858
1858
|
});
|
|
1859
1859
|
return Y.set(a, h), yr(), h;
|
|
1860
1860
|
}
|
|
@@ -1920,7 +1920,7 @@ class Fa extends he {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
if (i.length < 2)
|
|
1922
1922
|
return [];
|
|
1923
|
-
const n = Ca(i, this.SEARCH_OFFSET), r = n.map((d) => d.x),
|
|
1923
|
+
const n = Ca(i, this.SEARCH_OFFSET), r = n.map((d) => d.x), s = n.map((d) => d.y), o = Math.max(...r), a = Math.max(...s), c = Ia(n), l = { x: o, y: a }, h = i.map((d) => Aa(d, l));
|
|
1924
1924
|
return h.reduce(
|
|
1925
1925
|
(d, p, m) => {
|
|
1926
1926
|
if (m === 0) return d;
|
|
@@ -1944,9 +1944,9 @@ class Fa extends he {
|
|
|
1944
1944
|
let e;
|
|
1945
1945
|
if (this.options.isStraight) {
|
|
1946
1946
|
const i = [];
|
|
1947
|
-
for (const
|
|
1948
|
-
const
|
|
1949
|
-
|
|
1947
|
+
for (const s of this.options.anchor) {
|
|
1948
|
+
const o = this.resolveAnchorPosition(s);
|
|
1949
|
+
o && i.push(o);
|
|
1950
1950
|
}
|
|
1951
1951
|
if (i.length < 2) {
|
|
1952
1952
|
console.warn(`Line ${this.id} has less than 2 valid anchor points`);
|
|
@@ -1984,14 +1984,14 @@ class Fa extends he {
|
|
|
1984
1984
|
textureScale: i ? 1 : 0
|
|
1985
1985
|
}), this.rope.autoUpdate = !1, !i) {
|
|
1986
1986
|
const r = this.uvBuffer = this.rope.geometry.getBuffer("aUV");
|
|
1987
|
-
this._uvs = r.data, this.baseUvs = Array.from(this._uvs).map((
|
|
1987
|
+
this._uvs = r.data, this.baseUvs = Array.from(this._uvs).map((s, o) => o % 2 ? s : s * 0.5), this._uvs.set(this.baseUvs), r.update();
|
|
1988
1988
|
}
|
|
1989
1989
|
this.container.addChild(this.rope), this.emit("points:changed");
|
|
1990
1990
|
} else {
|
|
1991
1991
|
let i = !1;
|
|
1992
1992
|
for (let n = 0; n < e.length; n++) {
|
|
1993
|
-
const r = e[n].x * g,
|
|
1994
|
-
(this.points[n].x !== r || this.points[n].y !==
|
|
1993
|
+
const r = e[n].x * g, s = e[n].y * g;
|
|
1994
|
+
(this.points[n].x !== r || this.points[n].y !== s) && (i = !0, this.points[n].x = r, this.points[n].y = s);
|
|
1995
1995
|
}
|
|
1996
1996
|
this.rope.geometry.updateVertices(), i && this.emit("points:changed");
|
|
1997
1997
|
}
|
|
@@ -2005,12 +2005,12 @@ class Fa extends he {
|
|
|
2005
2005
|
return;
|
|
2006
2006
|
const i = e / 1e3, r = 1 / this.options.flowSpeed * i;
|
|
2007
2007
|
this.uvOffset += r, this.uvOffset > 1 && (this.uvOffset -= 1);
|
|
2008
|
-
const
|
|
2008
|
+
const s = this.baseUvs, o = this.uvBuffer;
|
|
2009
2009
|
if (this._uvs) {
|
|
2010
2010
|
const a = this._uvs;
|
|
2011
2011
|
for (let c = 0; c < a.length; c += 2)
|
|
2012
|
-
a[c] =
|
|
2013
|
-
|
|
2012
|
+
a[c] = s[c] + 0.5 - this.uvOffset * 1;
|
|
2013
|
+
o.update();
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
/**
|
|
@@ -2040,9 +2040,9 @@ class Fa extends he {
|
|
|
2040
2040
|
*/
|
|
2041
2041
|
updateAnchorPosition(e, i, n) {
|
|
2042
2042
|
const r = this.options.anchor[e];
|
|
2043
|
-
!r || this.isAnchorNode(r) || (this.mutateOptions((
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2043
|
+
!r || this.isAnchorNode(r) || (this.mutateOptions((s) => {
|
|
2044
|
+
const o = s.anchor[e];
|
|
2045
|
+
o.x = i, o.y = n;
|
|
2046
2046
|
}), this.draw());
|
|
2047
2047
|
}
|
|
2048
2048
|
/** 在指定位置插入锚点 */
|
|
@@ -2104,6 +2104,9 @@ class Ra extends Ie {
|
|
|
2104
2104
|
class Da extends he {
|
|
2105
2105
|
container;
|
|
2106
2106
|
tilingSprite = null;
|
|
2107
|
+
/** 缓存最近一次相机状态,用于图片异步加载完成后恢复位置 */
|
|
2108
|
+
lastViewRect = null;
|
|
2109
|
+
lastScale = 1;
|
|
2107
2110
|
constructor(e = {}) {
|
|
2108
2111
|
super(e, {
|
|
2109
2112
|
tileSize: 100,
|
|
@@ -2119,35 +2122,69 @@ class Da extends he {
|
|
|
2119
2122
|
*/
|
|
2120
2123
|
drawGrid() {
|
|
2121
2124
|
const e = this.options.tileSize, i = this.options.borderColor, n = this.options.bgColor, r = this.options.img;
|
|
2122
|
-
this.tilingSprite && (this.container.removeChild(this.tilingSprite), this.tilingSprite.destroy())
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
o = ne.from(r);
|
|
2126
|
-
else {
|
|
2127
|
-
const a = document.createElement("canvas");
|
|
2128
|
-
a.width = e, a.height = e;
|
|
2129
|
-
const c = a.getContext("2d"), l = n >> 16 & 255, h = n >> 8 & 255, u = n & 255;
|
|
2130
|
-
c.fillStyle = `rgb(${l}, ${h}, ${u})`, c.fillRect(0, 0, e, e);
|
|
2131
|
-
const f = i >> 16 & 255, d = i >> 8 & 255, p = i & 255;
|
|
2132
|
-
c.strokeStyle = `rgb(${f}, ${d}, ${p})`, c.lineWidth = 1, c.beginPath(), c.moveTo(e, 0), c.lineTo(e, e), c.lineTo(0, e), c.stroke(), o = ne.from(a);
|
|
2125
|
+
if (this.tilingSprite && (this.container.removeChild(this.tilingSprite), this.tilingSprite.destroy(), this.tilingSprite = null), r) {
|
|
2126
|
+
this.loadImageTexture(r, e);
|
|
2127
|
+
return;
|
|
2133
2128
|
}
|
|
2134
|
-
|
|
2129
|
+
this.buildFromCanvas(e, i, n);
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* 通过 HTMLImageElement 加载图片纹理(支持 base64 data URL 和普通 URL)
|
|
2133
|
+
*/
|
|
2134
|
+
loadImageTexture(e, i) {
|
|
2135
|
+
const n = new Image();
|
|
2136
|
+
n.src = e;
|
|
2137
|
+
const r = () => {
|
|
2138
|
+
const s = ne.from(n);
|
|
2139
|
+
this.createTilingSprite(s, i), this.lastViewRect && this.applyCameraState(this.lastViewRect, this.lastScale);
|
|
2140
|
+
};
|
|
2141
|
+
n.complete && n.naturalWidth > 0 ? r() : (n.onload = () => r(), n.onerror = () => {
|
|
2142
|
+
console.error(`[Grid] 图片加载失败,回退到 canvas 网格: ${e}`), this.buildFromCanvas(
|
|
2143
|
+
i,
|
|
2144
|
+
this.options.borderColor,
|
|
2145
|
+
this.options.bgColor
|
|
2146
|
+
);
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* 使用 Canvas 创建网格纹理(无 img 时的回退方案)
|
|
2151
|
+
*/
|
|
2152
|
+
buildFromCanvas(e, i, n) {
|
|
2153
|
+
const r = document.createElement("canvas");
|
|
2154
|
+
r.width = e, r.height = e;
|
|
2155
|
+
const s = r.getContext("2d"), o = n >> 16 & 255, a = n >> 8 & 255, c = n & 255;
|
|
2156
|
+
s.fillStyle = `rgb(${o}, ${a}, ${c})`, s.fillRect(0, 0, e, e);
|
|
2157
|
+
const l = i >> 16 & 255, h = i >> 8 & 255, u = i & 255;
|
|
2158
|
+
s.strokeStyle = `rgb(${l}, ${h}, ${u})`, s.lineWidth = 1, s.beginPath(), s.moveTo(e, 0), s.lineTo(e, e), s.lineTo(0, e), s.stroke();
|
|
2159
|
+
const f = ne.from(r);
|
|
2160
|
+
this.createTilingSprite(f, e), this.lastViewRect && this.applyCameraState(this.lastViewRect, this.lastScale);
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* 创建 TilingSprite
|
|
2164
|
+
*/
|
|
2165
|
+
createTilingSprite(e, i) {
|
|
2135
2166
|
this.tilingSprite = new mn({
|
|
2136
|
-
texture:
|
|
2137
|
-
width:
|
|
2138
|
-
height:
|
|
2139
|
-
}), this.tilingSprite.position.set(-
|
|
2140
|
-
|
|
2141
|
-
|
|
2167
|
+
texture: e,
|
|
2168
|
+
width: 1e4,
|
|
2169
|
+
height: 1e4
|
|
2170
|
+
}), this.tilingSprite.position.set(-1e4 / 2, -1e4 / 2), this.tilingSprite.tilePosition.set(
|
|
2171
|
+
1e4 / 2 - i / 2,
|
|
2172
|
+
1e4 / 2 - i / 2
|
|
2142
2173
|
), this.container.addChild(this.tilingSprite);
|
|
2143
2174
|
}
|
|
2175
|
+
/**
|
|
2176
|
+
* 应用相机状态到 TilingSprite
|
|
2177
|
+
*/
|
|
2178
|
+
applyCameraState(e, i) {
|
|
2179
|
+
if (!this.tilingSprite) return;
|
|
2180
|
+
const n = this.options.tileSize, r = n * 10, s = e.x - r, o = e.y - r;
|
|
2181
|
+
this.tilingSprite.width = e.width + r * 2, this.tilingSprite.height = e.height + r * 2, this.tilingSprite.position.set(s, o), this.tilingSprite.tilePosition.set(-s - n / 2, -o - n / 2);
|
|
2182
|
+
}
|
|
2144
2183
|
/**
|
|
2145
2184
|
* 响应相机变化,动态调整网格大小和位置
|
|
2146
2185
|
*/
|
|
2147
2186
|
onCameraChange(e, i) {
|
|
2148
|
-
|
|
2149
|
-
const n = this.options.tileSize, r = n * 10, o = e.x - r, s = e.y - r;
|
|
2150
|
-
this.tilingSprite.width = e.width + r * 2, this.tilingSprite.height = e.height + r * 2, this.tilingSprite.position.set(o, s), this.tilingSprite.tilePosition.set(-o - n / 2, -s - n / 2);
|
|
2187
|
+
this.lastViewRect = e, this.lastScale = i, this.applyCameraState(e, i);
|
|
2151
2188
|
}
|
|
2152
2189
|
getGraphics() {
|
|
2153
2190
|
return this.container;
|
|
@@ -2188,8 +2225,8 @@ class za extends he {
|
|
|
2188
2225
|
this.drawText();
|
|
2189
2226
|
}
|
|
2190
2227
|
drawText() {
|
|
2191
|
-
const { x: e, y: i, text: n, fontSize: r, color:
|
|
2192
|
-
this.container.label = `text:${this.options.id}`, this.container.zIndex = this.options.zIndex ?? 0, this.container.position.set(e * g, i * g), this.textStyle.fontSize = r, this.textStyle.fill =
|
|
2228
|
+
const { x: e, y: i, text: n, fontSize: r, color: s, fontWeight: o, fontFamily: a, verticalAlign: c, align: l, position: h } = this.options;
|
|
2229
|
+
this.container.label = `text:${this.options.id}`, this.container.zIndex = this.options.zIndex ?? 0, this.container.position.set(e * g, i * g), this.textStyle.fontSize = r, this.textStyle.fill = s, this.textStyle.fontWeight = o, this.textStyle.fontFamily = a, this.textSprite.text = n;
|
|
2193
2230
|
const u = l === "left" ? 0 : l === "right" ? 1 : 0.5, f = c === "top" ? 0 : c === "bottom" ? 1 : 0.5;
|
|
2194
2231
|
this.textSprite.anchor.set(u, f), this.applyPositionTransform(h ?? "x");
|
|
2195
2232
|
}
|
|
@@ -2279,8 +2316,8 @@ class $a extends he {
|
|
|
2279
2316
|
y: i,
|
|
2280
2317
|
width: n = 1,
|
|
2281
2318
|
height: r = 1,
|
|
2282
|
-
bgColor:
|
|
2283
|
-
bgOpacity:
|
|
2319
|
+
bgColor: s,
|
|
2320
|
+
bgOpacity: o,
|
|
2284
2321
|
borderColor: a,
|
|
2285
2322
|
borderWidth: c,
|
|
2286
2323
|
borderOpacity: l = 1,
|
|
@@ -2288,7 +2325,7 @@ class $a extends he {
|
|
|
2288
2325
|
} = this.options, u = this.graphics;
|
|
2289
2326
|
u.clear(), u.label = `rect:${this.options.id}`, u.zIndex = this.options.zIndex ?? 0, u.position.set(e * g - g / 2, i * g - g / 2);
|
|
2290
2327
|
const f = n * g, d = r * g, p = Math.min(h, f / 2, d / 2);
|
|
2291
|
-
p > 0 ? u.roundRect(0, 0, f, d, p) : u.rect(0, 0, f, d), u.fill({ color:
|
|
2328
|
+
p > 0 ? u.roundRect(0, 0, f, d, p) : u.rect(0, 0, f, d), u.fill({ color: s, alpha: o }), c && c > 0 && (p > 0 ? u.roundRect(0, 0, f, d, p) : u.rect(0, 0, f, d), u.stroke({ color: a, width: c, alpha: l }));
|
|
2292
2329
|
}
|
|
2293
2330
|
getGraphics() {
|
|
2294
2331
|
return this.graphics;
|
|
@@ -2333,8 +2370,8 @@ function Ua() {
|
|
|
2333
2370
|
i.width = t, i.height = e;
|
|
2334
2371
|
const n = i.getContext("2d"), r = n.createLinearGradient(0, 0, 0, e);
|
|
2335
2372
|
r.addColorStop(0, "rgba(255,255,255,0.05)"), r.addColorStop(0.4, "rgba(255,255,255,0.55)"), r.addColorStop(0.5, "rgba(255,255,255,0.7)"), r.addColorStop(0.6, "rgba(255,255,255,0.55)"), r.addColorStop(1, "rgba(255,255,255,0.05)"), n.fillStyle = r, n.fillRect(0, 0, t, e), n.fillStyle = "rgba(255,255,255,0.15)";
|
|
2336
|
-
for (let
|
|
2337
|
-
n.fillRect(0,
|
|
2373
|
+
for (let s = 0; s < e; s += 4)
|
|
2374
|
+
n.fillRect(0, s, t, 1);
|
|
2338
2375
|
return st = ne.from(i), st;
|
|
2339
2376
|
}
|
|
2340
2377
|
class Ha extends he {
|
|
@@ -2370,18 +2407,18 @@ class Ha extends he {
|
|
|
2370
2407
|
y: i,
|
|
2371
2408
|
length: n = 4,
|
|
2372
2409
|
height: r = 60,
|
|
2373
|
-
direction:
|
|
2374
|
-
color:
|
|
2410
|
+
direction: s = "+x",
|
|
2411
|
+
color: o = 65535,
|
|
2375
2412
|
alpha: a = 0.8,
|
|
2376
2413
|
zIndex: c
|
|
2377
2414
|
} = this.options;
|
|
2378
2415
|
this.container.label = `fence:${this.options.id}`, this.container.zIndex = c ?? 0, this.container.position.set(e * g - g / 2, i * g - g / 2);
|
|
2379
2416
|
const l = n * g, h = r;
|
|
2380
|
-
this.wallSprite.width = l, this.wallSprite.height = h, this.wallSprite.anchor.set(0, 1), this.wallSprite.tint =
|
|
2417
|
+
this.wallSprite.width = l, this.wallSprite.height = h, this.wallSprite.anchor.set(0, 1), this.wallSprite.tint = o, this.wallSprite.alpha = a, this.drawEdges(l, h, o, a), this.applyDirectionTransform(s);
|
|
2381
2418
|
}
|
|
2382
2419
|
drawEdges(e, i, n, r) {
|
|
2383
|
-
const
|
|
2384
|
-
|
|
2420
|
+
const s = this.edgeGfx;
|
|
2421
|
+
s.clear(), s.rect(0, -i, e, i), s.stroke({ color: n, width: 1.5, alpha: r * 0.6 });
|
|
2385
2422
|
}
|
|
2386
2423
|
applyDirectionTransform(e) {
|
|
2387
2424
|
switch (this.panel.rotation = 0, this.panel.skew.set(0, 0), this.panel.scale.set(1, 1), e) {
|
|
@@ -2479,8 +2516,8 @@ class Ba extends he {
|
|
|
2479
2516
|
}
|
|
2480
2517
|
/** 绘制不可见的交互命中区域(覆盖扩散波最大范围) */
|
|
2481
2518
|
drawHitArea() {
|
|
2482
|
-
const { width: e = 4, height: i = 4, borderRadius: n = 0 } = this.options, r = e * g,
|
|
2483
|
-
this.hitArea.clear(),
|
|
2519
|
+
const { width: e = 4, height: i = 4, borderRadius: n = 0 } = this.options, r = e * g, s = i * g, o = Math.min(n, r / 2, s / 2);
|
|
2520
|
+
this.hitArea.clear(), o > 0 ? this.hitArea.roundRect(-r / 2, -s / 2, r, s, o) : this.hitArea.rect(-r / 2, -s / 2, r, s), this.hitArea.fill({ color: 0, alpha: 1e-3 });
|
|
2484
2521
|
}
|
|
2485
2522
|
drawRings() {
|
|
2486
2523
|
const {
|
|
@@ -2488,15 +2525,15 @@ class Ba extends he {
|
|
|
2488
2525
|
height: i = 4,
|
|
2489
2526
|
color: n,
|
|
2490
2527
|
lineWidth: r,
|
|
2491
|
-
rings:
|
|
2492
|
-
duration:
|
|
2528
|
+
rings: s = 3,
|
|
2529
|
+
duration: o = 3e3,
|
|
2493
2530
|
borderRadius: a = 0
|
|
2494
2531
|
} = this.options, c = e * g, l = i * g;
|
|
2495
|
-
for (let h = 0; h <
|
|
2532
|
+
for (let h = 0; h < s; h++) {
|
|
2496
2533
|
const u = this.ringGraphics[h];
|
|
2497
2534
|
if (!u) continue;
|
|
2498
2535
|
u.clear();
|
|
2499
|
-
const f = (this.elapsed /
|
|
2536
|
+
const f = (this.elapsed / o + h / s) % 1, d = f, p = 1 - f;
|
|
2500
2537
|
if (p <= 0 || d <= 0) continue;
|
|
2501
2538
|
const m = c * d, v = l * d, _ = Math.min(a, m / 2, v / 2);
|
|
2502
2539
|
_ > 0 ? u.roundRect(-m / 2, -v / 2, m, v, _) : u.rect(-m / 2, -v / 2, m, v), u.stroke({ color: n, width: r, alpha: p });
|
|
@@ -2540,7 +2577,7 @@ class Wa extends Ie {
|
|
|
2540
2577
|
return new Ba(e);
|
|
2541
2578
|
}
|
|
2542
2579
|
}
|
|
2543
|
-
|
|
2580
|
+
let ja = class extends he {
|
|
2544
2581
|
container;
|
|
2545
2582
|
sprite;
|
|
2546
2583
|
currentSrc = "";
|
|
@@ -2573,8 +2610,8 @@ class ja extends he {
|
|
|
2573
2610
|
this.draw();
|
|
2574
2611
|
}
|
|
2575
2612
|
draw() {
|
|
2576
|
-
const { x: e, y: i, width: n, height: r, alpha:
|
|
2577
|
-
this.container.label = `image:${this.options.id}`, this.container.position.set(e * g + l, i * g + l), this.sprite.alpha =
|
|
2613
|
+
const { x: e, y: i, width: n, height: r, alpha: s, anchorX: o = 0.5, anchorY: a = 0.5, position: c, offsetY: l = 0 } = this.options;
|
|
2614
|
+
this.container.label = `image:${this.options.id}`, this.container.position.set(e * g + l, i * g + l), this.sprite.alpha = s ?? 1, this.sprite.anchor.set(o, a), n != null && (this.sprite.width = n), r != null && (this.sprite.height = r), this.applyPositionTransform(c ?? "x");
|
|
2578
2615
|
}
|
|
2579
2616
|
/**
|
|
2580
2617
|
* 根据 position 模式对容器施加不同的变换(与 Text 元素一致)
|
|
@@ -2615,7 +2652,7 @@ class ja extends he {
|
|
|
2615
2652
|
destroy() {
|
|
2616
2653
|
this.removeAllListeners(), this.container.destroy();
|
|
2617
2654
|
}
|
|
2618
|
-
}
|
|
2655
|
+
};
|
|
2619
2656
|
class Va extends Ie {
|
|
2620
2657
|
constructor(e) {
|
|
2621
2658
|
super(e, "image");
|
|
@@ -2634,8 +2671,8 @@ class Xa {
|
|
|
2634
2671
|
_graphics = /* @__PURE__ */ new Map();
|
|
2635
2672
|
/** 子分组 */
|
|
2636
2673
|
_childGroups = /* @__PURE__ */ new Map();
|
|
2637
|
-
constructor(e, i, n = !0, r = !1,
|
|
2638
|
-
this.id = e, this.name = i, this.userData =
|
|
2674
|
+
constructor(e, i, n = !0, r = !1, s) {
|
|
2675
|
+
this.id = e, this.name = i, this.userData = s, this.container = new R(), this.container.sortableChildren = !0, this.visible = n, this.locked = r;
|
|
2639
2676
|
}
|
|
2640
2677
|
get visible() {
|
|
2641
2678
|
return this.container.visible;
|
|
@@ -2744,9 +2781,9 @@ class Ja extends le {
|
|
|
2744
2781
|
}
|
|
2745
2782
|
addGroup(e, i, n) {
|
|
2746
2783
|
if (typeof e == "string") {
|
|
2747
|
-
const
|
|
2748
|
-
if (this._map.has(
|
|
2749
|
-
return this._createGroup(
|
|
2784
|
+
const s = e;
|
|
2785
|
+
if (this._map.has(s)) throw new Error(`Group "${s}" already exists`);
|
|
2786
|
+
return this._createGroup(s, i, n?.visible, n?.locked, n?.userData);
|
|
2750
2787
|
}
|
|
2751
2788
|
const r = e;
|
|
2752
2789
|
if (this._map.has(r.id)) throw new Error(`Group "${r.id}" already exists`);
|
|
@@ -2756,15 +2793,15 @@ class Ja extends le {
|
|
|
2756
2793
|
const i = this._map.get(e);
|
|
2757
2794
|
if (!i) return;
|
|
2758
2795
|
const n = this._rootOrder.indexOf(e), r = [];
|
|
2759
|
-
for (const
|
|
2760
|
-
const a = i._remove(
|
|
2761
|
-
a && r.push({ id:
|
|
2796
|
+
for (const o of [...i.elements]) {
|
|
2797
|
+
const a = i._remove(o);
|
|
2798
|
+
a && r.push({ id: o, graphics: a }), this._elem.delete(o);
|
|
2762
2799
|
}
|
|
2763
|
-
this._host.removeChild(i.container), i._destroy(), this._groups = this._groups.filter((
|
|
2764
|
-
const
|
|
2765
|
-
for (let
|
|
2766
|
-
const { id: a, graphics: c } = r[
|
|
2767
|
-
this._looseGraphics.set(a, c), this._rootOrder.splice(
|
|
2800
|
+
this._host.removeChild(i.container), i._destroy(), this._groups = this._groups.filter((o) => o.id !== e), this._map.delete(e), this._rootOrder = this._rootOrder.filter((o) => o !== e);
|
|
2801
|
+
const s = n >= 0 ? Math.min(n, this._rootOrder.length) : this._rootOrder.length;
|
|
2802
|
+
for (let o = 0; o < r.length; o++) {
|
|
2803
|
+
const { id: a, graphics: c } = r[o];
|
|
2804
|
+
this._looseGraphics.set(a, c), this._rootOrder.splice(s + o, 0, a), this._host.addChild(c);
|
|
2768
2805
|
}
|
|
2769
2806
|
this._syncRootZ(), this._emit("group:removed", { id: e });
|
|
2770
2807
|
}
|
|
@@ -2813,8 +2850,8 @@ class Ja extends le {
|
|
|
2813
2850
|
moveElement(e, i) {
|
|
2814
2851
|
const n = this._looseGraphics.has(e), r = this._elem.get(e);
|
|
2815
2852
|
if (!n && r === void 0 || !n && r === i || i !== void 0 && !this._map.has(i)) return;
|
|
2816
|
-
let
|
|
2817
|
-
n ? (
|
|
2853
|
+
let s;
|
|
2854
|
+
n ? (s = this._looseGraphics.get(e), this._looseGraphics.delete(e), this._rootOrder = this._rootOrder.filter((o) => o !== e), this._host.removeChild(s)) : (s = this._map.get(r)._remove(e), this._elem.delete(e)), s && (i !== void 0 ? (this._map.get(i)._add(e, s), this._elem.set(e, i)) : (this._looseGraphics.set(e, s), this._rootOrder.push(e), this._host.addChild(s)), this._syncRootZ(), this._emit("element:moved", { id: e, from: r, to: i }));
|
|
2818
2855
|
}
|
|
2819
2856
|
/** 获取元素所属分组 ID;松散元素返回 undefined */
|
|
2820
2857
|
getElementGroup(e) {
|
|
@@ -2883,15 +2920,15 @@ class Ja extends le {
|
|
|
2883
2920
|
_shift(e, i) {
|
|
2884
2921
|
const n = this._reorderCtx(e);
|
|
2885
2922
|
if (!n) return !1;
|
|
2886
|
-
const { arr: r, idx:
|
|
2887
|
-
return
|
|
2923
|
+
const { arr: r, idx: s } = n, o = s + i;
|
|
2924
|
+
return o < 0 || o >= r.length ? !1 : ([r[s], r[o]] = [r[o], r[s]], this._applyReorder(n, r));
|
|
2888
2925
|
}
|
|
2889
2926
|
/** @internal toEnd: dir=1 移到末尾(置顶), dir=-1 移到开头(置底) */
|
|
2890
2927
|
_toEnd(e, i) {
|
|
2891
2928
|
const n = this._reorderCtx(e);
|
|
2892
2929
|
if (!n) return !1;
|
|
2893
|
-
const { arr: r, idx:
|
|
2894
|
-
return r.splice(
|
|
2930
|
+
const { arr: r, idx: s } = n;
|
|
2931
|
+
return r.splice(s, 1), i > 0 ? r.push(e) : r.unshift(e), this._applyReorder(n, r);
|
|
2895
2932
|
}
|
|
2896
2933
|
/** @internal 解析元素所属上下文 */
|
|
2897
2934
|
_reorderCtx(e) {
|
|
@@ -2901,8 +2938,8 @@ class Ja extends le {
|
|
|
2901
2938
|
if (n) {
|
|
2902
2939
|
const r = this._map.get(n);
|
|
2903
2940
|
if (r) {
|
|
2904
|
-
const
|
|
2905
|
-
if (
|
|
2941
|
+
const s = [...r.elements], o = s.indexOf(e);
|
|
2942
|
+
if (o >= 0) return { scope: "group", groupId: n, arr: s, idx: o };
|
|
2906
2943
|
}
|
|
2907
2944
|
}
|
|
2908
2945
|
return null;
|
|
@@ -2912,9 +2949,9 @@ class Ja extends le {
|
|
|
2912
2949
|
return e.scope === "root" ? this.reorderRoot(i) : e.scope === "group" && e.groupId && this.reorderElements(e.groupId, i), !0;
|
|
2913
2950
|
}
|
|
2914
2951
|
// ======== internal ========
|
|
2915
|
-
_createGroup(e, i, n = !0, r = !1,
|
|
2916
|
-
const a = new Xa(e, i, n, r,
|
|
2917
|
-
return this._groups.push(a), this._map.set(e, a),
|
|
2952
|
+
_createGroup(e, i, n = !0, r = !1, s, o) {
|
|
2953
|
+
const a = new Xa(e, i, n, r, s);
|
|
2954
|
+
return this._groups.push(a), this._map.set(e, a), o ? (this._map.get(o)._addSubGroup(a), this._parentGroup.set(e, o)) : (this._host.addChild(a.container), this._rootOrder.push(e), this._syncRootZ()), this._emit("group:added", a), a;
|
|
2918
2955
|
}
|
|
2919
2956
|
/** 根级统一 zIndex 分配:每个根级项目(分组或松散元素)按顺序获得 i * Z_SPAN */
|
|
2920
2957
|
_syncRootZ() {
|
|
@@ -2923,8 +2960,8 @@ class Ja extends le {
|
|
|
2923
2960
|
if (r)
|
|
2924
2961
|
r.container.zIndex = n;
|
|
2925
2962
|
else {
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2963
|
+
const s = this._looseGraphics.get(i);
|
|
2964
|
+
s && (s.zIndex = n);
|
|
2928
2965
|
}
|
|
2929
2966
|
}
|
|
2930
2967
|
}
|
|
@@ -2945,31 +2982,31 @@ class Ja extends le {
|
|
|
2945
2982
|
*/
|
|
2946
2983
|
fromJSON(e) {
|
|
2947
2984
|
if (!e.length) return;
|
|
2948
|
-
const i = (
|
|
2949
|
-
if (!this._map.has(
|
|
2950
|
-
this._createGroup(
|
|
2985
|
+
const i = (o, a) => {
|
|
2986
|
+
if (!this._map.has(o.id))
|
|
2987
|
+
this._createGroup(o.id, o.name, o.visible, o.locked, o.userData, a);
|
|
2951
2988
|
else {
|
|
2952
|
-
const h = this._map.get(
|
|
2953
|
-
h.name =
|
|
2989
|
+
const h = this._map.get(o.id);
|
|
2990
|
+
h.name = o.name, h.visible = o.visible ?? !0, h.locked = o.locked ?? !1, o.userData !== void 0 && (h.userData = o.userData);
|
|
2954
2991
|
}
|
|
2955
|
-
if (!
|
|
2956
|
-
for (const h of
|
|
2957
|
-
typeof h != "string" && i(h,
|
|
2958
|
-
const c =
|
|
2992
|
+
if (!o.children?.length) return;
|
|
2993
|
+
for (const h of o.children)
|
|
2994
|
+
typeof h != "string" && i(h, o.id);
|
|
2995
|
+
const c = o.children.filter((h) => typeof h == "string");
|
|
2959
2996
|
for (const h of c)
|
|
2960
|
-
(this._looseGraphics.has(h) || this._elem.has(h)) && this.moveElement(h,
|
|
2961
|
-
const l = this._map.get(
|
|
2997
|
+
(this._looseGraphics.has(h) || this._elem.has(h)) && this.moveElement(h, o.id);
|
|
2998
|
+
const l = this._map.get(o.id);
|
|
2962
2999
|
if (l) {
|
|
2963
|
-
const h =
|
|
3000
|
+
const h = o.children.map((u) => typeof u == "string" ? u : u.id).filter((u) => l._has(u));
|
|
2964
3001
|
l._reorder(h);
|
|
2965
3002
|
}
|
|
2966
3003
|
}, n = [];
|
|
2967
|
-
for (const
|
|
2968
|
-
typeof
|
|
2969
|
-
const r = new Set(this._rootOrder),
|
|
2970
|
-
for (const
|
|
2971
|
-
|
|
2972
|
-
this._rootOrder =
|
|
3004
|
+
for (const o of e)
|
|
3005
|
+
typeof o == "string" ? n.push(o) : (i(o), n.push(o.id));
|
|
3006
|
+
const r = new Set(this._rootOrder), s = n.filter((o) => r.has(o));
|
|
3007
|
+
for (const o of this._rootOrder)
|
|
3008
|
+
s.includes(o) || s.push(o);
|
|
3009
|
+
this._rootOrder = s, this._groups = s.filter((o) => this._map.has(o)).map((o) => this._map.get(o)), this._syncRootZ();
|
|
2973
3010
|
}
|
|
2974
3011
|
clear() {
|
|
2975
3012
|
for (const e of this._groups) {
|
|
@@ -3012,10 +3049,10 @@ function It(t, e) {
|
|
|
3012
3049
|
n.href = i, n.download = e, document.body.appendChild(n), n.click(), document.body.removeChild(n), t instanceof Blob && URL.revokeObjectURL(i);
|
|
3013
3050
|
}
|
|
3014
3051
|
async function Qa(t, e) {
|
|
3015
|
-
const { pixelRatio: i = 2 } = e ?? {}, n = t.app, r = n.renderer.resolution,
|
|
3016
|
-
n.renderer.resolution = i, n.renderer.resize(
|
|
3052
|
+
const { pixelRatio: i = 2 } = e ?? {}, n = t.app, r = n.renderer.resolution, s = n.screen.width, o = n.screen.height;
|
|
3053
|
+
n.renderer.resolution = i, n.renderer.resize(s, o), n.render();
|
|
3017
3054
|
const a = Ka(n.canvas);
|
|
3018
|
-
return n.renderer.resolution = r, n.renderer.resize(
|
|
3055
|
+
return n.renderer.resolution = r, n.renderer.resize(s, o), n.render(), a;
|
|
3019
3056
|
}
|
|
3020
3057
|
async function ec(t, e) {
|
|
3021
3058
|
const i = t.app.renderer;
|
|
@@ -3036,8 +3073,8 @@ async function tc(t) {
|
|
|
3036
3073
|
const n = i.options.icon;
|
|
3037
3074
|
if (!e.has(n))
|
|
3038
3075
|
try {
|
|
3039
|
-
const r = await t.icons.loadTexture(n),
|
|
3040
|
-
e.set(n,
|
|
3076
|
+
const r = await t.icons.loadTexture(n), s = await ec(t, r);
|
|
3077
|
+
e.set(n, s);
|
|
3041
3078
|
} catch {
|
|
3042
3079
|
e.set(n, "");
|
|
3043
3080
|
}
|
|
@@ -3045,7 +3082,7 @@ async function tc(t) {
|
|
|
3045
3082
|
return e;
|
|
3046
3083
|
}
|
|
3047
3084
|
async function ic(t, e) {
|
|
3048
|
-
const { background: i = !0 } = e ?? {}, n = t.projectionContainer, r = n.skew.x,
|
|
3085
|
+
const { background: i = !0 } = e ?? {}, n = t.projectionContainer, r = n.skew.x, s = n.skew.y, o = n.scale.x, a = n.position.x, c = n.position.y, l = Math.ceil(t.app.screen.width), h = Math.ceil(t.app.screen.height), u = o * Math.cos(s), f = o * Math.sin(s), d = o * Math.sin(r), p = o * Math.cos(r), m = Math.cos(s), v = Math.sin(s), _ = Math.sin(r), x = Math.cos(r), w = m * x - v * _, S = x / w, b = -v / w, E = -_ / w, N = m / w, j = u * p - f * d, ee = [
|
|
3049
3086
|
{ x: 0, y: 0 },
|
|
3050
3087
|
{ x: l, y: 0 },
|
|
3051
3088
|
{ x: 0, y: h },
|
|
@@ -3095,7 +3132,7 @@ async function ic(t, e) {
|
|
|
3095
3132
|
async function nc(t, e) {
|
|
3096
3133
|
const n = t.grid.getGraphics().children[0];
|
|
3097
3134
|
if (!n) return "";
|
|
3098
|
-
const r = t.grid.options.tileSize ?? 100,
|
|
3135
|
+
const r = t.grid.options.tileSize ?? 100, s = n.x, o = n.y, a = n.width, c = n.height, l = n.tilePosition?.x ?? 0, h = n.tilePosition?.y ?? 0;
|
|
3099
3136
|
try {
|
|
3100
3137
|
n.x = 0, n.y = 0, n.width = e.width, n.height = e.height, n.tilePosition && n.tilePosition.set(
|
|
3101
3138
|
-e.x - r / 2,
|
|
@@ -3111,18 +3148,18 @@ async function nc(t, e) {
|
|
|
3111
3148
|
} catch {
|
|
3112
3149
|
return "";
|
|
3113
3150
|
} finally {
|
|
3114
|
-
n.x =
|
|
3151
|
+
n.x = s, n.y = o, n.width = a, n.height = c, n.tilePosition && n.tilePosition.set(l, h);
|
|
3115
3152
|
}
|
|
3116
3153
|
}
|
|
3117
3154
|
function rc(t) {
|
|
3118
|
-
const e = t.x * g - g / 2, i = t.y * g - g / 2, n = (t.width ?? 1) * g, r = (t.height ?? 1) * g,
|
|
3119
|
-
return ` <rect x="${e}" y="${i}" width="${n}" height="${r}"${u} fill="${
|
|
3155
|
+
const e = t.x * g - g / 2, i = t.y * g - g / 2, n = (t.width ?? 1) * g, r = (t.height ?? 1) * g, s = Ze(t.bgColor ?? 3447003), o = t.bgOpacity ?? 0.8, a = Ze(t.borderColor ?? 16777215), c = t.borderWidth ?? 2, l = t.borderOpacity ?? 1, h = t.borderRadius ?? 0, u = h > 0 ? ` rx="${h}" ry="${h}"` : "";
|
|
3156
|
+
return ` <rect x="${e}" y="${i}" width="${n}" height="${r}"${u} fill="${s}" fill-opacity="${o}" stroke="${a}" stroke-width="${c}" stroke-opacity="${l}" />`;
|
|
3120
3157
|
}
|
|
3121
3158
|
function sc(t) {
|
|
3122
3159
|
const e = t.options, i = Ze(e.color ?? 4473958), n = e.width ?? 6, r = t.getPoints();
|
|
3123
|
-
let
|
|
3160
|
+
let s;
|
|
3124
3161
|
if (r && r.length >= 2)
|
|
3125
|
-
|
|
3162
|
+
s = r.map((a) => `${a.x},${a.y}`).join(" ");
|
|
3126
3163
|
else {
|
|
3127
3164
|
const a = [];
|
|
3128
3165
|
for (const c of e.anchor) {
|
|
@@ -3130,23 +3167,23 @@ function sc(t) {
|
|
|
3130
3167
|
l && a.push({ x: l.x * g, y: l.y * g });
|
|
3131
3168
|
}
|
|
3132
3169
|
if (a.length < 2) return "";
|
|
3133
|
-
|
|
3170
|
+
s = a.map((c) => `${c.x},${c.y}`).join(" ");
|
|
3134
3171
|
}
|
|
3135
|
-
const
|
|
3136
|
-
return ` <polyline points="${
|
|
3172
|
+
const o = e.mode === "dashed" ? ` stroke-dasharray="${(e.dashPattern ?? [10, 5]).join(",")}"` : "";
|
|
3173
|
+
return ` <polyline points="${s}" fill="none" stroke="${i}" stroke-width="${n}" stroke-linecap="round" stroke-linejoin="round"${o} />`;
|
|
3137
3174
|
}
|
|
3138
|
-
function oc(t, e, i, n, r,
|
|
3139
|
-
const
|
|
3175
|
+
function oc(t, e, i, n, r, s) {
|
|
3176
|
+
const o = t.x * g, a = t.y * g, c = t.scale ?? 1, l = t.isFlat ?? !1, h = l ? 1 : t.scaleY ?? 1, u = t.offsetY ?? 0, f = t.icon;
|
|
3140
3177
|
if (!(e.has(f) && e.get(f) !== "")) return "";
|
|
3141
3178
|
const p = 100, m = -p / 2 * h + cr / 2 + u, v = [];
|
|
3142
3179
|
if (l) {
|
|
3143
|
-
const _ = p * c, x = p * c, w =
|
|
3180
|
+
const _ = p * c, x = p * c, w = o - _ / 2, S = a + c * (m - p / 2);
|
|
3144
3181
|
v.push(
|
|
3145
3182
|
` <use href="#icon-${Ct(f)}" x="${w}" y="${S}" width="${_}" height="${x}" />`
|
|
3146
3183
|
);
|
|
3147
3184
|
} else {
|
|
3148
|
-
const _ = p * c, x = p * c * h, w = -_ / 2, S = c * h * m - x / 2, b = `matrix(${i},${n},${r},${
|
|
3149
|
-
v.push(` <g transform="translate(${
|
|
3185
|
+
const _ = p * c, x = p * c * h, w = -_ / 2, S = c * h * m - x / 2, b = `matrix(${i},${n},${r},${s},0,0)`;
|
|
3186
|
+
v.push(` <g transform="translate(${o},${a})">`), v.push(` <g transform="${b}">`), v.push(
|
|
3150
3187
|
` <use href="#icon-${Ct(f)}" x="${w}" y="${S}" width="${_}" height="${x}" />`
|
|
3151
3188
|
), v.push(" </g>"), v.push(" </g>");
|
|
3152
3189
|
}
|
|
@@ -3154,16 +3191,16 @@ function oc(t, e, i, n, r, o) {
|
|
|
3154
3191
|
`);
|
|
3155
3192
|
}
|
|
3156
3193
|
function ac(t, e, i, n, r) {
|
|
3157
|
-
const
|
|
3194
|
+
const s = t.x * g, o = t.y * g, a = t.fontSize ?? 16, c = Ze(t.color ?? 16777215), l = t.fontWeight ?? "normal", h = t.fontFamily ?? "Arial", u = t.align ?? "center", f = t.position ?? "x", d = u === "left" ? "start" : u === "right" ? "end" : "middle", p = Ct(t.text), m = `text-anchor="${d}" fill="${c}" font-size="${a}" font-weight="${l}" font-family="${h}"`;
|
|
3158
3195
|
if (f === "screen") {
|
|
3159
3196
|
const v = `matrix(${e},${i},${n},${r},0,0)`;
|
|
3160
3197
|
return [
|
|
3161
|
-
` <g transform="translate(${
|
|
3198
|
+
` <g transform="translate(${s},${o})">`,
|
|
3162
3199
|
` <text transform="${v}" ${m}>${p}</text>`,
|
|
3163
3200
|
" </g>"
|
|
3164
3201
|
].join(`
|
|
3165
3202
|
`);
|
|
3166
|
-
} else return f === "y" ? ` <text x="${
|
|
3203
|
+
} else return f === "y" ? ` <text x="${s}" y="${o}" transform="rotate(-90,${s},${o})" ${m}>${p}</text>` : ` <text x="${s}" y="${o}" ${m}>${p}</text>`;
|
|
3167
3204
|
}
|
|
3168
3205
|
class De extends le {
|
|
3169
3206
|
/** 默认缩放级别 */
|
|
@@ -3188,10 +3225,10 @@ class De extends le {
|
|
|
3188
3225
|
lastCameraState = { x: 0, y: 0, scale: 0 };
|
|
3189
3226
|
_isActive = !1;
|
|
3190
3227
|
_cameraHandler;
|
|
3191
|
-
constructor(e, i, n, r,
|
|
3192
|
-
super(), this.id = e, this.app = i, this.icons = n, this.states = r, this.postprocess =
|
|
3193
|
-
const { skewX:
|
|
3194
|
-
this.projectionContainer.sortableChildren = !0, this.projectionContainer.skew.set(
|
|
3228
|
+
constructor(e, i, n, r, s) {
|
|
3229
|
+
super(), this.id = e, this.app = i, this.icons = n, this.states = r, this.postprocess = s, this.projectionContainer = new R(), this.layer = new Ja(this.projectionContainer), this.lines = new Ra(this), this.nodes = new Oa(this), this.texts = new Na(this), this.rects = new Ga(this), this.fences = new Ya(this), this.waves = new Wa(this), this.images = new Va(this), this.grid = new Da();
|
|
3230
|
+
const { skewX: o, skewY: a } = lr();
|
|
3231
|
+
this.projectionContainer.sortableChildren = !0, this.projectionContainer.skew.set(o, a), this.projectionContainer.scale.set(De.DEFAULT_ZOOM), this.projectionContainer.position.set(i.screen.width / 2, i.screen.height / 2), this.projectionContainer.addChild(this.grid.getGraphics()), this.grid.getGraphics().zIndex = -1, this.registerItem(this.grid);
|
|
3195
3232
|
}
|
|
3196
3233
|
// ========== 激活 / 停用 ==========
|
|
3197
3234
|
setActive(e) {
|
|
@@ -3302,8 +3339,8 @@ class De extends le {
|
|
|
3302
3339
|
* 也可被外部直接调用以跳过插件处理。
|
|
3303
3340
|
*/
|
|
3304
3341
|
applyCamera(e) {
|
|
3305
|
-
const i = this.projectionContainer, n = this.lastCameraState, r = e.x !== n.x || e.y !== n.y,
|
|
3306
|
-
i.scale.set(e.zoom), i.position.set(e.x, e.y), this._isActive && (this.lastCameraState = { x: i.x, y: i.y, scale: i.scale.x }, this.notifyCameraChange(r,
|
|
3342
|
+
const i = this.projectionContainer, n = this.lastCameraState, r = e.x !== n.x || e.y !== n.y, s = e.zoom !== n.scale;
|
|
3343
|
+
i.scale.set(e.zoom), i.position.set(e.x, e.y), this._isActive && (this.lastCameraState = { x: i.x, y: i.y, scale: i.scale.x }, this.notifyCameraChange(r, s));
|
|
3307
3344
|
}
|
|
3308
3345
|
/**
|
|
3309
3346
|
* 获取默认相机状态(居中 + 默认缩放)
|
|
@@ -3337,8 +3374,8 @@ class De extends le {
|
|
|
3337
3374
|
for (const a of this.sceneItems)
|
|
3338
3375
|
a.onRender(e), a.tickStates(e);
|
|
3339
3376
|
this.postprocess.update(e);
|
|
3340
|
-
const { x: i, y: n } = this.projectionContainer.position, r = this.projectionContainer.scale.x,
|
|
3341
|
-
(
|
|
3377
|
+
const { x: i, y: n } = this.projectionContainer.position, r = this.projectionContainer.scale.x, s = i !== this.lastCameraState.x || n !== this.lastCameraState.y, o = r !== this.lastCameraState.scale;
|
|
3378
|
+
(s || o) && (this.lastCameraState = { x: i, y: n, scale: r }, this.notifyCameraChange(s, o));
|
|
3342
3379
|
};
|
|
3343
3380
|
/**
|
|
3344
3381
|
* 通知所有 SceneItem 相机已变化,并向外发射相机事件。
|
|
@@ -3350,17 +3387,17 @@ class De extends le {
|
|
|
3350
3387
|
*/
|
|
3351
3388
|
notifyCameraChange(e = !0, i = !0) {
|
|
3352
3389
|
const n = this.getViewRect(), r = this.projectionContainer.scale.x;
|
|
3353
|
-
for (const
|
|
3390
|
+
for (const o of this.sceneItems) o.onCameraChange(n, r);
|
|
3354
3391
|
if (!e && !i) return;
|
|
3355
|
-
const
|
|
3392
|
+
const s = {
|
|
3356
3393
|
...this.getCamera(),
|
|
3357
3394
|
positionChanged: e,
|
|
3358
3395
|
zoomChanged: i
|
|
3359
3396
|
};
|
|
3360
|
-
this.emit("camera:change",
|
|
3397
|
+
this.emit("camera:change", s), e && this.emit("camera:move", s), i && this.emit("camera:zoom", s);
|
|
3361
3398
|
}
|
|
3362
3399
|
getViewRect() {
|
|
3363
|
-
const { width: e, height: i } = this.app.screen, n = this.projectionContainer, r = n.skew.x,
|
|
3400
|
+
const { width: e, height: i } = this.app.screen, n = this.projectionContainer, r = n.skew.x, s = n.skew.y, o = n.scale.x, a = n.scale.y, c = Math.cos(s) * o, l = Math.sin(s) * o, h = Math.sin(r) * a, u = Math.cos(r) * a, f = n.x, d = n.y, p = c * u - l * h, m = u / p, v = -l / p, _ = -h / p, x = c / p, w = (ue, fe) => {
|
|
3364
3401
|
const q = ue - f, de = fe - d;
|
|
3365
3402
|
return { x: m * q + _ * de, y: v * q + x * de };
|
|
3366
3403
|
}, S = w(0, 0), b = w(e, 0), E = w(0, i), N = w(e, i), j = Math.min(S.x, b.x, E.x, N.x), ee = Math.min(S.y, b.y, E.y, N.y), V = Math.max(S.x, b.x, E.x, N.x), X = Math.max(S.y, b.y, E.y, N.y);
|
|
@@ -3371,9 +3408,9 @@ class De extends le {
|
|
|
3371
3408
|
* @returns 包围盒,如果场景为空则返回 null
|
|
3372
3409
|
*/
|
|
3373
3410
|
getContentBounds() {
|
|
3374
|
-
let i = 1 / 0, n = 1 / 0, r = -1 / 0,
|
|
3411
|
+
let i = 1 / 0, n = 1 / 0, r = -1 / 0, s = -1 / 0, o = !1;
|
|
3375
3412
|
const a = (c, l) => {
|
|
3376
|
-
|
|
3413
|
+
o = !0, c < i && (i = c), l < n && (n = l), c > r && (r = c), l > s && (s = l);
|
|
3377
3414
|
};
|
|
3378
3415
|
for (const c of this.nodes.getAll())
|
|
3379
3416
|
a(c.options.x * 100, c.options.y * 100);
|
|
@@ -3413,7 +3450,7 @@ class De extends le {
|
|
|
3413
3450
|
}
|
|
3414
3451
|
for (const c of this.images.getAll())
|
|
3415
3452
|
a(c.options.x * 100, c.options.y * 100);
|
|
3416
|
-
return
|
|
3453
|
+
return o ? { x: i, y: n, width: r - i, height: s - n } : null;
|
|
3417
3454
|
}
|
|
3418
3455
|
}
|
|
3419
3456
|
class Oe {
|
|
@@ -3508,11 +3545,11 @@ class cc extends Ti {
|
|
|
3508
3545
|
l = l.parent;
|
|
3509
3546
|
}
|
|
3510
3547
|
return { itemType: null, itemId: null };
|
|
3511
|
-
},
|
|
3548
|
+
}, s = (c) => {
|
|
3512
3549
|
if (!this._enabled) return;
|
|
3513
3550
|
const { itemType: l, itemId: h } = r(c);
|
|
3514
3551
|
i.emit("item:pointerdown", { itemType: l, itemId: h, sceneId: e.id, event: c });
|
|
3515
|
-
},
|
|
3552
|
+
}, o = (c) => {
|
|
3516
3553
|
if (!this._enabled) return;
|
|
3517
3554
|
const { itemType: l, itemId: h } = r(c);
|
|
3518
3555
|
i.emit("item:pointerup", { itemType: l, itemId: h, sceneId: e.id, event: c });
|
|
@@ -3526,7 +3563,7 @@ class cc extends Ti {
|
|
|
3526
3563
|
event: c
|
|
3527
3564
|
}), h !== null && l !== null && i.emit("item:pointerover", { itemType: l, itemId: h, sceneId: e.id, event: c }), this._hoveredItemId = h, this._hoveredItemType = l);
|
|
3528
3565
|
};
|
|
3529
|
-
n.on("pointerdown",
|
|
3566
|
+
n.on("pointerdown", s), n.on("pointerup", o), n.on("pointermove", a), this._handlers = { onPointerDown: s, onPointerUp: o, onPointerMove: a };
|
|
3530
3567
|
}
|
|
3531
3568
|
onUnbindActiveScene() {
|
|
3532
3569
|
if (!this._handlers) return;
|
|
@@ -3575,8 +3612,8 @@ class lc extends le {
|
|
|
3575
3612
|
if (i) return i;
|
|
3576
3613
|
const n = this.loading.get(e);
|
|
3577
3614
|
if (n) return n;
|
|
3578
|
-
const r = this.icons.get(e)?.url ?? e,
|
|
3579
|
-
return this.loading.set(e,
|
|
3615
|
+
const r = this.icons.get(e)?.url ?? e, s = gi.load(r).then((o) => (this.textureCache.set(e, o), this.loading.delete(e), o));
|
|
3616
|
+
return this.loading.set(e, s), s;
|
|
3580
3617
|
}
|
|
3581
3618
|
/** 清空所有图标和缓存 */
|
|
3582
3619
|
clear() {
|
|
@@ -3603,46 +3640,46 @@ class lc extends le {
|
|
|
3603
3640
|
}
|
|
3604
3641
|
}
|
|
3605
3642
|
const Wt = /* @__PURE__ */ new WeakMap();
|
|
3606
|
-
function
|
|
3607
|
-
const n = i?.frequency ?? 2, r = i?.minAlpha ?? 0.2,
|
|
3643
|
+
function bf(t, e, i) {
|
|
3644
|
+
const n = i?.frequency ?? 2, r = i?.minAlpha ?? 0.2, s = i?.maxAlpha ?? 1;
|
|
3608
3645
|
return {
|
|
3609
3646
|
stateId: t,
|
|
3610
3647
|
type: e,
|
|
3611
|
-
onEnter(
|
|
3612
|
-
Wt.set(
|
|
3648
|
+
onEnter(o) {
|
|
3649
|
+
Wt.set(o, { elapsed: 0 });
|
|
3613
3650
|
},
|
|
3614
|
-
onLeave(
|
|
3615
|
-
Wt.delete(
|
|
3651
|
+
onLeave(o) {
|
|
3652
|
+
Wt.delete(o), o.getGraphics().alpha = 1;
|
|
3616
3653
|
},
|
|
3617
|
-
onUpdate(
|
|
3618
|
-
const c = Wt.get(
|
|
3654
|
+
onUpdate(o, a) {
|
|
3655
|
+
const c = Wt.get(o);
|
|
3619
3656
|
if (!c) return;
|
|
3620
3657
|
c.elapsed += a;
|
|
3621
3658
|
const l = (Math.sin(c.elapsed * n * Math.PI * 2 / 1e3) + 1) / 2;
|
|
3622
|
-
|
|
3659
|
+
o.getGraphics().alpha = r + l * (s - r);
|
|
3623
3660
|
}
|
|
3624
3661
|
};
|
|
3625
3662
|
}
|
|
3626
3663
|
const ot = /* @__PURE__ */ new WeakMap();
|
|
3627
|
-
function
|
|
3664
|
+
function Cf(t, e, i) {
|
|
3628
3665
|
const n = i?.frequency ?? 2, r = i?.height ?? 12;
|
|
3629
3666
|
return {
|
|
3630
3667
|
stateId: t,
|
|
3631
3668
|
type: e,
|
|
3632
|
-
onEnter(
|
|
3633
|
-
const
|
|
3634
|
-
ot.set(
|
|
3669
|
+
onEnter(s) {
|
|
3670
|
+
const o = s.getGraphics();
|
|
3671
|
+
ot.set(s, { elapsed: 0, origY: o.position.y, origX: o.position.x });
|
|
3635
3672
|
},
|
|
3636
|
-
onLeave(
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3673
|
+
onLeave(s) {
|
|
3674
|
+
const o = ot.get(s);
|
|
3675
|
+
o && (s.getGraphics().position.y = o.origY, s.getGraphics().position.x = o.origX, ot.delete(s));
|
|
3639
3676
|
},
|
|
3640
|
-
onUpdate(
|
|
3641
|
-
const a = ot.get(
|
|
3677
|
+
onUpdate(s, o) {
|
|
3678
|
+
const a = ot.get(s);
|
|
3642
3679
|
if (!a) return;
|
|
3643
|
-
a.elapsed +=
|
|
3680
|
+
a.elapsed += o;
|
|
3644
3681
|
const c = Math.abs(Math.sin(a.elapsed * n * Math.PI / 1e3));
|
|
3645
|
-
|
|
3682
|
+
s.getGraphics().position.y = a.origY - r * c, s.getGraphics().position.x = a.origX - r * c;
|
|
3646
3683
|
}
|
|
3647
3684
|
};
|
|
3648
3685
|
}
|
|
@@ -3650,47 +3687,47 @@ const Ve = /* @__PURE__ */ new WeakMap();
|
|
|
3650
3687
|
function Rt(t) {
|
|
3651
3688
|
const e = t.getGraphics(), i = (Ve.get(e) ?? 0) + 1;
|
|
3652
3689
|
if (Ve.set(e, i), i > 1) return;
|
|
3653
|
-
const n = e.getLocalBounds(), r = 100,
|
|
3654
|
-
e.filterArea = new Lt(
|
|
3690
|
+
const n = e.getLocalBounds(), r = 100, s = 80, o = Math.min(n.x, -r) - s, a = Math.min(n.y, -r) - s, c = Math.max(n.x + n.width, r) + s, l = Math.max(n.y + n.height, r) + s;
|
|
3691
|
+
e.filterArea = new Lt(o, a, c - o, l - a);
|
|
3655
3692
|
}
|
|
3656
3693
|
function Dt(t) {
|
|
3657
3694
|
const e = t.getGraphics(), i = (Ve.get(e) ?? 1) - 1;
|
|
3658
3695
|
i <= 0 ? (Ve.delete(e), e.filterArea = void 0) : Ve.set(e, i);
|
|
3659
3696
|
}
|
|
3660
3697
|
const jt = /* @__PURE__ */ new WeakMap();
|
|
3661
|
-
function
|
|
3698
|
+
function If(t, e, i) {
|
|
3662
3699
|
const n = i?.brightness ?? 1.5;
|
|
3663
3700
|
return {
|
|
3664
3701
|
stateId: t,
|
|
3665
3702
|
type: e,
|
|
3666
3703
|
onEnter(r) {
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3704
|
+
const s = r.getGraphics(), o = new mi();
|
|
3705
|
+
o.brightness(n, !1), jt.set(r, o), Rt(r), s.filters = [...s.filters ?? [], o];
|
|
3669
3706
|
},
|
|
3670
3707
|
onLeave(r) {
|
|
3671
|
-
const
|
|
3672
|
-
if (
|
|
3673
|
-
const
|
|
3674
|
-
|
|
3708
|
+
const s = jt.get(r);
|
|
3709
|
+
if (s) {
|
|
3710
|
+
const o = r.getGraphics();
|
|
3711
|
+
o.filters = (o.filters ?? []).filter((a) => a !== s), Dt(r), jt.delete(r);
|
|
3675
3712
|
}
|
|
3676
3713
|
}
|
|
3677
3714
|
};
|
|
3678
3715
|
}
|
|
3679
3716
|
const Vt = /* @__PURE__ */ new WeakMap();
|
|
3680
|
-
function
|
|
3717
|
+
function Af(t, e, i) {
|
|
3681
3718
|
const n = Math.max(0, Math.min(1, i?.brightness ?? 0.5));
|
|
3682
3719
|
return {
|
|
3683
3720
|
stateId: t,
|
|
3684
3721
|
type: e,
|
|
3685
3722
|
onEnter(r) {
|
|
3686
|
-
const
|
|
3687
|
-
|
|
3723
|
+
const s = r.getGraphics(), o = new mi();
|
|
3724
|
+
o.brightness(n, !1), Vt.set(r, o), Rt(r), s.filters = [...s.filters ?? [], o];
|
|
3688
3725
|
},
|
|
3689
3726
|
onLeave(r) {
|
|
3690
|
-
const
|
|
3691
|
-
if (
|
|
3692
|
-
const
|
|
3693
|
-
|
|
3727
|
+
const s = Vt.get(r);
|
|
3728
|
+
if (s) {
|
|
3729
|
+
const o = r.getGraphics();
|
|
3730
|
+
o.filters = (o.filters ?? []).filter((a) => a !== s), Dt(r), Vt.delete(r);
|
|
3694
3731
|
}
|
|
3695
3732
|
}
|
|
3696
3733
|
};
|
|
@@ -3778,17 +3815,17 @@ void main(void)
|
|
|
3778
3815
|
}
|
|
3779
3816
|
class fc extends G {
|
|
3780
3817
|
constructor(e = {}) {
|
|
3781
|
-
const i = e.quality ?? 4, n = e.distance ?? 10, r = e.color ?? [1, 1, 0],
|
|
3818
|
+
const i = e.quality ?? 4, n = e.distance ?? 10, r = e.color ?? [1, 1, 0], s = e.outerStrength ?? 4, o = U.from({
|
|
3782
3819
|
vertex: hc,
|
|
3783
3820
|
fragment: uc(i),
|
|
3784
3821
|
name: "glow-filter"
|
|
3785
3822
|
});
|
|
3786
3823
|
super({
|
|
3787
|
-
glProgram:
|
|
3824
|
+
glProgram: o,
|
|
3788
3825
|
resources: {
|
|
3789
3826
|
glowUniforms: new H({
|
|
3790
3827
|
uDistance: { value: n, type: "f32" },
|
|
3791
|
-
uOuterStrength: { value:
|
|
3828
|
+
uOuterStrength: { value: s, type: "f32" },
|
|
3792
3829
|
uColor: {
|
|
3793
3830
|
value: new Float32Array(r),
|
|
3794
3831
|
type: "vec3<f32>"
|
|
@@ -3827,8 +3864,8 @@ function dc(t) {
|
|
|
3827
3864
|
(t & 255) / 255
|
|
3828
3865
|
];
|
|
3829
3866
|
}
|
|
3830
|
-
function
|
|
3831
|
-
const n = i?.color ?? 16776960, r = i?.distance ?? 10, [
|
|
3867
|
+
function Tf(t, e, i) {
|
|
3868
|
+
const n = i?.color ?? 16776960, r = i?.distance ?? 10, [s, o] = i?.strength ?? [2, 6], a = i?.frequency ?? 1.5, c = i?.quality ?? 4, l = dc(n);
|
|
3832
3869
|
return {
|
|
3833
3870
|
stateId: t,
|
|
3834
3871
|
type: e,
|
|
@@ -3836,7 +3873,7 @@ function Af(t, e, i) {
|
|
|
3836
3873
|
const u = h.getGraphics(), f = new fc({
|
|
3837
3874
|
color: l,
|
|
3838
3875
|
distance: r,
|
|
3839
|
-
outerStrength:
|
|
3876
|
+
outerStrength: s,
|
|
3840
3877
|
quality: c
|
|
3841
3878
|
});
|
|
3842
3879
|
at.set(h, { elapsed: 0, filter: f }), Rt(h), u.filters = [...u.filters ?? [], f];
|
|
@@ -3853,30 +3890,30 @@ function Af(t, e, i) {
|
|
|
3853
3890
|
if (!f) return;
|
|
3854
3891
|
f.elapsed += u;
|
|
3855
3892
|
const d = (Math.sin(f.elapsed * a * Math.PI * 2 / 1e3) + 1) / 2;
|
|
3856
|
-
f.filter.outerStrength =
|
|
3893
|
+
f.filter.outerStrength = s + d * (o - s);
|
|
3857
3894
|
}
|
|
3858
3895
|
};
|
|
3859
3896
|
}
|
|
3860
3897
|
const ct = /* @__PURE__ */ new WeakMap();
|
|
3861
|
-
function
|
|
3862
|
-
const n = i?.frequency ?? 1.2, r = i?.minScale ?? 0.92,
|
|
3898
|
+
function Of(t, e, i) {
|
|
3899
|
+
const n = i?.frequency ?? 1.2, r = i?.minScale ?? 0.92, s = i?.maxScale ?? 1.08;
|
|
3863
3900
|
return {
|
|
3864
3901
|
stateId: t,
|
|
3865
3902
|
type: e,
|
|
3866
|
-
onEnter(
|
|
3867
|
-
const a =
|
|
3868
|
-
ct.set(
|
|
3903
|
+
onEnter(o) {
|
|
3904
|
+
const a = o.getGraphics();
|
|
3905
|
+
ct.set(o, { elapsed: 0, origScaleX: a.scale.x, origScaleY: a.scale.y });
|
|
3869
3906
|
},
|
|
3870
|
-
onLeave(
|
|
3871
|
-
const a = ct.get(
|
|
3872
|
-
a && (
|
|
3907
|
+
onLeave(o) {
|
|
3908
|
+
const a = ct.get(o);
|
|
3909
|
+
a && (o.getGraphics().scale.set(a.origScaleX, a.origScaleY), ct.delete(o));
|
|
3873
3910
|
},
|
|
3874
|
-
onUpdate(
|
|
3875
|
-
const c = ct.get(
|
|
3911
|
+
onUpdate(o, a) {
|
|
3912
|
+
const c = ct.get(o);
|
|
3876
3913
|
if (!c) return;
|
|
3877
3914
|
c.elapsed += a;
|
|
3878
|
-
const l = c.elapsed * n / 1e3 % 1, h = Math.pow(Math.abs(Math.sin(l * Math.PI)), 0.6), u = r + h * (
|
|
3879
|
-
|
|
3915
|
+
const l = c.elapsed * n / 1e3 % 1, h = Math.pow(Math.abs(Math.sin(l * Math.PI)), 0.6), u = r + h * (s - r);
|
|
3916
|
+
o.getGraphics().scale.set(c.origScaleX * u, c.origScaleY * u);
|
|
3880
3917
|
}
|
|
3881
3918
|
};
|
|
3882
3919
|
}
|
|
@@ -3947,13 +3984,13 @@ void main(void)
|
|
|
3947
3984
|
class mc extends G {
|
|
3948
3985
|
_angle;
|
|
3949
3986
|
constructor(e = {}) {
|
|
3950
|
-
const i = e.width ?? 0.35, n = e.intensity ?? 0.6, r = e.angle ?? Math.PI / 6,
|
|
3987
|
+
const i = e.width ?? 0.35, n = e.intensity ?? 0.6, r = e.angle ?? Math.PI / 6, s = U.from({
|
|
3951
3988
|
vertex: pc,
|
|
3952
3989
|
fragment: gc,
|
|
3953
3990
|
name: "shimmer-filter"
|
|
3954
3991
|
});
|
|
3955
3992
|
super({
|
|
3956
|
-
glProgram:
|
|
3993
|
+
glProgram: s,
|
|
3957
3994
|
resources: {
|
|
3958
3995
|
shimmerUniforms: new H({
|
|
3959
3996
|
uPhase: { value: 0, type: "f32" },
|
|
@@ -3992,15 +4029,15 @@ class mc extends G {
|
|
|
3992
4029
|
}
|
|
3993
4030
|
}
|
|
3994
4031
|
const lt = /* @__PURE__ */ new WeakMap();
|
|
3995
|
-
function
|
|
3996
|
-
const n = i?.frequency ?? 0.8, r = i?.width ?? 0.35,
|
|
4032
|
+
function Pf(t, e, i) {
|
|
4033
|
+
const n = i?.frequency ?? 0.8, r = i?.width ?? 0.35, s = i?.intensity ?? 0.6, o = i?.angle ?? Math.PI / 6;
|
|
3997
4034
|
return {
|
|
3998
4035
|
stateId: t,
|
|
3999
4036
|
type: e,
|
|
4000
4037
|
onEnter(a) {
|
|
4001
|
-
const c = new mc({ width: r, intensity:
|
|
4038
|
+
const c = new mc({ width: r, intensity: s, angle: o }), l = a.getGraphics();
|
|
4002
4039
|
Rt(a), l.filters = [...l.filters ?? [], c];
|
|
4003
|
-
const h = Math.abs(Math.cos(
|
|
4040
|
+
const h = Math.abs(Math.cos(o)) + Math.abs(Math.sin(o));
|
|
4004
4041
|
lt.set(a, { elapsed: 0, filter: c, maxProj: h });
|
|
4005
4042
|
},
|
|
4006
4043
|
onLeave(a) {
|
|
@@ -4020,18 +4057,18 @@ function Of(t, e, i) {
|
|
|
4020
4057
|
};
|
|
4021
4058
|
}
|
|
4022
4059
|
const Xt = /* @__PURE__ */ new WeakMap();
|
|
4023
|
-
function
|
|
4060
|
+
function Mf(t, e, i) {
|
|
4024
4061
|
const n = i?.color ?? 16711680;
|
|
4025
4062
|
return {
|
|
4026
4063
|
stateId: t,
|
|
4027
4064
|
type: e,
|
|
4028
4065
|
onEnter(r) {
|
|
4029
|
-
const
|
|
4030
|
-
Xt.set(r,
|
|
4066
|
+
const s = r.getGraphics();
|
|
4067
|
+
Xt.set(r, s.tint), s.tint = n;
|
|
4031
4068
|
},
|
|
4032
4069
|
onLeave(r) {
|
|
4033
|
-
const
|
|
4034
|
-
|
|
4070
|
+
const s = Xt.get(r);
|
|
4071
|
+
s !== void 0 && (r.getGraphics().tint = s, Xt.delete(r));
|
|
4035
4072
|
}
|
|
4036
4073
|
};
|
|
4037
4074
|
}
|
|
@@ -4072,7 +4109,7 @@ class vc extends le {
|
|
|
4072
4109
|
unregisterPlugin(e, i) {
|
|
4073
4110
|
const n = this.plugins.get(e);
|
|
4074
4111
|
if (n) {
|
|
4075
|
-
const r = n.filter((
|
|
4112
|
+
const r = n.filter((s) => s.type !== i);
|
|
4076
4113
|
r.length ? this.plugins.set(e, r) : this.plugins.delete(e);
|
|
4077
4114
|
}
|
|
4078
4115
|
return this;
|
|
@@ -4107,16 +4144,16 @@ class vc extends le {
|
|
|
4107
4144
|
this.clear(), this.removeAllListeners();
|
|
4108
4145
|
}
|
|
4109
4146
|
}
|
|
4110
|
-
function
|
|
4147
|
+
function Ef(t, e) {
|
|
4111
4148
|
const i = e?.strength ?? 4, n = e?.quality ?? 4;
|
|
4112
4149
|
return {
|
|
4113
4150
|
postProcessId: t,
|
|
4114
4151
|
createFilter() {
|
|
4115
4152
|
return new Jr({ strength: i, quality: n });
|
|
4116
4153
|
},
|
|
4117
|
-
setOptions(r,
|
|
4118
|
-
const
|
|
4119
|
-
|
|
4154
|
+
setOptions(r, s) {
|
|
4155
|
+
const o = r;
|
|
4156
|
+
s.strength !== void 0 && (o.strength = s.strength), s.quality !== void 0 && (o.quality = s.quality);
|
|
4120
4157
|
}
|
|
4121
4158
|
};
|
|
4122
4159
|
}
|
|
@@ -4206,13 +4243,13 @@ void main(void)
|
|
|
4206
4243
|
}
|
|
4207
4244
|
class _c extends G {
|
|
4208
4245
|
constructor(e = {}) {
|
|
4209
|
-
const i = e.threshold ?? 0.5, n = e.intensity ?? 1, r = e.radius ?? 2,
|
|
4246
|
+
const i = e.threshold ?? 0.5, n = e.intensity ?? 1, r = e.radius ?? 2, s = e.samples ?? 3, o = U.from({
|
|
4210
4247
|
vertex: xc,
|
|
4211
|
-
fragment: yc(
|
|
4248
|
+
fragment: yc(s),
|
|
4212
4249
|
name: "bloom-filter"
|
|
4213
4250
|
});
|
|
4214
4251
|
super({
|
|
4215
|
-
glProgram:
|
|
4252
|
+
glProgram: o,
|
|
4216
4253
|
resources: {
|
|
4217
4254
|
bloomUniforms: new H({
|
|
4218
4255
|
uThreshold: { value: i, type: "f32" },
|
|
@@ -4242,24 +4279,24 @@ class _c extends G {
|
|
|
4242
4279
|
this.resources.bloomUniforms.uniforms.uRadius = e;
|
|
4243
4280
|
}
|
|
4244
4281
|
}
|
|
4245
|
-
function
|
|
4246
|
-
const i = e?.threshold ?? 0.5, n = e?.intensity ?? 1, r = e?.radius ?? 2,
|
|
4282
|
+
function Lf(t, e) {
|
|
4283
|
+
const i = e?.threshold ?? 0.5, n = e?.intensity ?? 1, r = e?.radius ?? 2, s = e?.samples ?? 3;
|
|
4247
4284
|
return {
|
|
4248
4285
|
postProcessId: t,
|
|
4249
4286
|
createFilter() {
|
|
4250
|
-
return new _c({ threshold: i, intensity: n, radius: r, samples:
|
|
4287
|
+
return new _c({ threshold: i, intensity: n, radius: r, samples: s });
|
|
4251
4288
|
},
|
|
4252
|
-
setOptions(
|
|
4253
|
-
const c =
|
|
4289
|
+
setOptions(o, a) {
|
|
4290
|
+
const c = o;
|
|
4254
4291
|
a.threshold !== void 0 && (c.threshold = a.threshold), a.intensity !== void 0 && (c.intensity = a.intensity), a.radius !== void 0 && (c.radius = a.radius);
|
|
4255
4292
|
}
|
|
4256
4293
|
};
|
|
4257
4294
|
}
|
|
4258
4295
|
function Ki(t, e) {
|
|
4259
|
-
const i = e.brightness ?? 1, n = e.contrast ?? 0, r = e.saturate ?? 0,
|
|
4260
|
-
t.reset(), i !== 1 && t.brightness(i, !0), n !== 0 && t.contrast(n, !0), r !== 0 && t.saturate(r, !0),
|
|
4296
|
+
const i = e.brightness ?? 1, n = e.contrast ?? 0, r = e.saturate ?? 0, s = e.hue ?? 0;
|
|
4297
|
+
t.reset(), i !== 1 && t.brightness(i, !0), n !== 0 && t.contrast(n, !0), r !== 0 && t.saturate(r, !0), s !== 0 && t.hue(s, !0);
|
|
4261
4298
|
}
|
|
4262
|
-
function
|
|
4299
|
+
function kf(t, e) {
|
|
4263
4300
|
const i = {
|
|
4264
4301
|
brightness: e?.brightness ?? 1,
|
|
4265
4302
|
contrast: e?.contrast ?? 0,
|
|
@@ -4342,19 +4379,19 @@ void main(void)
|
|
|
4342
4379
|
);
|
|
4343
4380
|
class bc extends G {
|
|
4344
4381
|
constructor(e = {}) {
|
|
4345
|
-
const i = e.radius ?? 0.3, n = e.softness ?? 0.5, r = e.intensity ?? 0.8,
|
|
4382
|
+
const i = e.radius ?? 0.3, n = e.softness ?? 0.5, r = e.intensity ?? 0.8, s = e.color ?? [0, 0, 0], o = U.from({
|
|
4346
4383
|
vertex: wc,
|
|
4347
4384
|
fragment: Sc,
|
|
4348
4385
|
name: "vignette-filter"
|
|
4349
4386
|
});
|
|
4350
4387
|
super({
|
|
4351
|
-
glProgram:
|
|
4388
|
+
glProgram: o,
|
|
4352
4389
|
resources: {
|
|
4353
4390
|
vignetteUniforms: new H({
|
|
4354
4391
|
uRadius: { value: i, type: "f32" },
|
|
4355
4392
|
uSoftness: { value: n, type: "f32" },
|
|
4356
4393
|
uIntensity: { value: r, type: "f32" },
|
|
4357
|
-
uColor: { value: new Float32Array(
|
|
4394
|
+
uColor: { value: new Float32Array(s), type: "vec3<f32>" }
|
|
4358
4395
|
})
|
|
4359
4396
|
}
|
|
4360
4397
|
});
|
|
@@ -4387,15 +4424,15 @@ class bc extends G {
|
|
|
4387
4424
|
i[0] = e[0], i[1] = e[1], i[2] = e[2];
|
|
4388
4425
|
}
|
|
4389
4426
|
}
|
|
4390
|
-
function
|
|
4391
|
-
const i = e?.radius ?? 0.3, n = e?.softness ?? 0.5, r = e?.intensity ?? 0.8,
|
|
4427
|
+
function Ff(t, e) {
|
|
4428
|
+
const i = e?.radius ?? 0.3, n = e?.softness ?? 0.5, r = e?.intensity ?? 0.8, s = e?.color ?? [0, 0, 0];
|
|
4392
4429
|
return {
|
|
4393
4430
|
postProcessId: t,
|
|
4394
4431
|
createFilter() {
|
|
4395
|
-
return new bc({ radius: i, softness: n, intensity: r, color:
|
|
4432
|
+
return new bc({ radius: i, softness: n, intensity: r, color: s });
|
|
4396
4433
|
},
|
|
4397
|
-
setOptions(
|
|
4398
|
-
const c =
|
|
4434
|
+
setOptions(o, a) {
|
|
4435
|
+
const c = o;
|
|
4399
4436
|
a.radius !== void 0 && (c.radius = a.radius), a.softness !== void 0 && (c.softness = a.softness), a.intensity !== void 0 && (c.intensity = a.intensity), a.color !== void 0 && (c.color = a.color);
|
|
4400
4437
|
}
|
|
4401
4438
|
};
|
|
@@ -4476,7 +4513,7 @@ class Ac extends G {
|
|
|
4476
4513
|
this.resources.pixelateUniforms.uniforms.uPixelSize = e;
|
|
4477
4514
|
}
|
|
4478
4515
|
}
|
|
4479
|
-
function
|
|
4516
|
+
function Rf(t, e) {
|
|
4480
4517
|
const i = e?.pixelSize ?? 8;
|
|
4481
4518
|
return {
|
|
4482
4519
|
postProcessId: t,
|
|
@@ -4484,8 +4521,8 @@ function Ff(t, e) {
|
|
|
4484
4521
|
return new Ac({ pixelSize: i });
|
|
4485
4522
|
},
|
|
4486
4523
|
setOptions(n, r) {
|
|
4487
|
-
const
|
|
4488
|
-
r.pixelSize !== void 0 && (
|
|
4524
|
+
const s = n;
|
|
4525
|
+
r.pixelSize !== void 0 && (s.pixelSize = r.pixelSize);
|
|
4489
4526
|
}
|
|
4490
4527
|
};
|
|
4491
4528
|
}
|
|
@@ -4581,7 +4618,7 @@ class Pc extends G {
|
|
|
4581
4618
|
this.resources.noiseUniforms.uniforms.uSeed = e;
|
|
4582
4619
|
}
|
|
4583
4620
|
}
|
|
4584
|
-
function
|
|
4621
|
+
function Df(t, e) {
|
|
4585
4622
|
const i = e?.intensity ?? 0.15;
|
|
4586
4623
|
let n = e?.animated ?? !0;
|
|
4587
4624
|
return {
|
|
@@ -4589,12 +4626,12 @@ function Rf(t, e) {
|
|
|
4589
4626
|
createFilter() {
|
|
4590
4627
|
return new Pc({ intensity: i });
|
|
4591
4628
|
},
|
|
4592
|
-
onUpdate(r,
|
|
4629
|
+
onUpdate(r, s) {
|
|
4593
4630
|
n && (r.seed = Math.random());
|
|
4594
4631
|
},
|
|
4595
|
-
setOptions(r,
|
|
4596
|
-
const
|
|
4597
|
-
|
|
4632
|
+
setOptions(r, s) {
|
|
4633
|
+
const o = r;
|
|
4634
|
+
s.intensity !== void 0 && (o.intensity = s.intensity), s.animated !== void 0 && (n = s.animated);
|
|
4598
4635
|
}
|
|
4599
4636
|
};
|
|
4600
4637
|
}
|
|
@@ -4684,7 +4721,7 @@ class Lc extends G {
|
|
|
4684
4721
|
this.resources.chromaticUniforms.uniforms.uOffset = e;
|
|
4685
4722
|
}
|
|
4686
4723
|
}
|
|
4687
|
-
function
|
|
4724
|
+
function zf(t, e) {
|
|
4688
4725
|
const i = e?.offset ?? 3;
|
|
4689
4726
|
return {
|
|
4690
4727
|
postProcessId: t,
|
|
@@ -4692,8 +4729,8 @@ function Df(t, e) {
|
|
|
4692
4729
|
return new Lc({ offset: i });
|
|
4693
4730
|
},
|
|
4694
4731
|
setOptions(n, r) {
|
|
4695
|
-
const
|
|
4696
|
-
r.offset !== void 0 && (
|
|
4732
|
+
const s = n;
|
|
4733
|
+
r.offset !== void 0 && (s.offset = r.offset);
|
|
4697
4734
|
}
|
|
4698
4735
|
};
|
|
4699
4736
|
}
|
|
@@ -4757,13 +4794,13 @@ void main(void)
|
|
|
4757
4794
|
);
|
|
4758
4795
|
class Rc extends G {
|
|
4759
4796
|
constructor(e = {}) {
|
|
4760
|
-
const i = e.lineWidth ?? 2, n = e.intensity ?? 0.3, r = e.offset ?? 0,
|
|
4797
|
+
const i = e.lineWidth ?? 2, n = e.intensity ?? 0.3, r = e.offset ?? 0, s = U.from({
|
|
4761
4798
|
vertex: kc,
|
|
4762
4799
|
fragment: Fc,
|
|
4763
4800
|
name: "scanlines-filter"
|
|
4764
4801
|
});
|
|
4765
4802
|
super({
|
|
4766
|
-
glProgram:
|
|
4803
|
+
glProgram: s,
|
|
4767
4804
|
resources: {
|
|
4768
4805
|
scanlinesUniforms: new H({
|
|
4769
4806
|
uLineWidth: { value: i, type: "f32" },
|
|
@@ -4793,20 +4830,20 @@ class Rc extends G {
|
|
|
4793
4830
|
this.resources.scanlinesUniforms.uniforms.uOffset = e;
|
|
4794
4831
|
}
|
|
4795
4832
|
}
|
|
4796
|
-
function
|
|
4833
|
+
function Nf(t, e) {
|
|
4797
4834
|
const i = e?.lineWidth ?? 2, n = e?.intensity ?? 0.3;
|
|
4798
|
-
let r = e?.animated ?? !1,
|
|
4835
|
+
let r = e?.animated ?? !1, s = e?.speed ?? 0.5, o = 0;
|
|
4799
4836
|
return {
|
|
4800
4837
|
postProcessId: t,
|
|
4801
4838
|
createFilter() {
|
|
4802
4839
|
return new Rc({ lineWidth: i, intensity: n, offset: 0 });
|
|
4803
4840
|
},
|
|
4804
4841
|
onUpdate(a, c) {
|
|
4805
|
-
r && (
|
|
4842
|
+
r && (o += s * c, a.offset = o);
|
|
4806
4843
|
},
|
|
4807
4844
|
setOptions(a, c) {
|
|
4808
4845
|
const l = a;
|
|
4809
|
-
c.lineWidth !== void 0 && (l.lineWidth = c.lineWidth), c.intensity !== void 0 && (l.intensity = c.intensity), c.animated !== void 0 && (r = c.animated), c.speed !== void 0 && (
|
|
4846
|
+
c.lineWidth !== void 0 && (l.lineWidth = c.lineWidth), c.intensity !== void 0 && (l.intensity = c.intensity), c.animated !== void 0 && (r = c.animated), c.speed !== void 0 && (s = c.speed);
|
|
4810
4847
|
}
|
|
4811
4848
|
};
|
|
4812
4849
|
}
|
|
@@ -4883,7 +4920,7 @@ void main(void)
|
|
|
4883
4920
|
);
|
|
4884
4921
|
class Nc extends G {
|
|
4885
4922
|
constructor(e = {}) {
|
|
4886
|
-
const i = e.centerX ?? 0.5, n = e.centerY ?? 0.5, r = e.intensity ?? 0.3,
|
|
4923
|
+
const i = e.centerX ?? 0.5, n = e.centerY ?? 0.5, r = e.intensity ?? 0.3, s = e.decay ?? 0.96, o = e.density ?? 1, a = e.weight ?? 0.5, c = U.from({
|
|
4887
4924
|
vertex: Dc,
|
|
4888
4925
|
fragment: zc,
|
|
4889
4926
|
name: "god-rays-filter"
|
|
@@ -4894,8 +4931,8 @@ class Nc extends G {
|
|
|
4894
4931
|
godRaysUniforms: new H({
|
|
4895
4932
|
uCenter: { value: new Float32Array([i, n]), type: "vec2<f32>" },
|
|
4896
4933
|
uIntensity: { value: r, type: "f32" },
|
|
4897
|
-
uDecay: { value:
|
|
4898
|
-
uDensity: { value:
|
|
4934
|
+
uDecay: { value: s, type: "f32" },
|
|
4935
|
+
uDensity: { value: o, type: "f32" },
|
|
4899
4936
|
uWeight: { value: a, type: "f32" }
|
|
4900
4937
|
})
|
|
4901
4938
|
}
|
|
@@ -4939,12 +4976,12 @@ class Nc extends G {
|
|
|
4939
4976
|
this.resources.godRaysUniforms.uniforms.uWeight = e;
|
|
4940
4977
|
}
|
|
4941
4978
|
}
|
|
4942
|
-
function
|
|
4943
|
-
const i = e?.centerX ?? 0.5, n = e?.centerY ?? 0.5, r = e?.intensity ?? 0.3,
|
|
4979
|
+
function $f(t, e) {
|
|
4980
|
+
const i = e?.centerX ?? 0.5, n = e?.centerY ?? 0.5, r = e?.intensity ?? 0.3, s = e?.decay ?? 0.96, o = e?.density ?? 1, a = e?.weight ?? 0.5;
|
|
4944
4981
|
return {
|
|
4945
4982
|
postProcessId: t,
|
|
4946
4983
|
createFilter() {
|
|
4947
|
-
return new Nc({ centerX: i, centerY: n, intensity: r, decay:
|
|
4984
|
+
return new Nc({ centerX: i, centerY: n, intensity: r, decay: s, density: o, weight: a });
|
|
4948
4985
|
},
|
|
4949
4986
|
setOptions(c, l) {
|
|
4950
4987
|
const h = c;
|
|
@@ -5031,7 +5068,7 @@ class Uc extends G {
|
|
|
5031
5068
|
this.resources.grayscaleUniforms.uniforms.uAmount = e;
|
|
5032
5069
|
}
|
|
5033
5070
|
}
|
|
5034
|
-
function
|
|
5071
|
+
function Gf(t, e) {
|
|
5035
5072
|
const i = e?.amount ?? 1;
|
|
5036
5073
|
return {
|
|
5037
5074
|
postProcessId: t,
|
|
@@ -5039,8 +5076,8 @@ function $f(t, e) {
|
|
|
5039
5076
|
return new Uc({ amount: i });
|
|
5040
5077
|
},
|
|
5041
5078
|
setOptions(n, r) {
|
|
5042
|
-
const
|
|
5043
|
-
r.amount !== void 0 && (
|
|
5079
|
+
const s = n;
|
|
5080
|
+
r.amount !== void 0 && (s.amount = r.amount);
|
|
5044
5081
|
}
|
|
5045
5082
|
};
|
|
5046
5083
|
}
|
|
@@ -5131,7 +5168,7 @@ class Bc extends G {
|
|
|
5131
5168
|
this.resources.sharpenUniforms.uniforms.uStrength = e;
|
|
5132
5169
|
}
|
|
5133
5170
|
}
|
|
5134
|
-
function
|
|
5171
|
+
function Uf(t, e) {
|
|
5135
5172
|
const i = e?.strength ?? 0.5;
|
|
5136
5173
|
return {
|
|
5137
5174
|
postProcessId: t,
|
|
@@ -5139,8 +5176,8 @@ function Gf(t, e) {
|
|
|
5139
5176
|
return new Bc({ strength: i });
|
|
5140
5177
|
},
|
|
5141
5178
|
setOptions(n, r) {
|
|
5142
|
-
const
|
|
5143
|
-
r.strength !== void 0 && (
|
|
5179
|
+
const s = n;
|
|
5180
|
+
r.strength !== void 0 && (s.strength = r.strength);
|
|
5144
5181
|
}
|
|
5145
5182
|
};
|
|
5146
5183
|
}
|
|
@@ -5222,7 +5259,7 @@ class Vc extends G {
|
|
|
5222
5259
|
this.resources.invertUniforms.uniforms.uAmount = e;
|
|
5223
5260
|
}
|
|
5224
5261
|
}
|
|
5225
|
-
function
|
|
5262
|
+
function Hf(t, e) {
|
|
5226
5263
|
const i = e?.amount ?? 1;
|
|
5227
5264
|
return {
|
|
5228
5265
|
postProcessId: t,
|
|
@@ -5230,8 +5267,8 @@ function Uf(t, e) {
|
|
|
5230
5267
|
return new Vc({ amount: i });
|
|
5231
5268
|
},
|
|
5232
5269
|
setOptions(n, r) {
|
|
5233
|
-
const
|
|
5234
|
-
r.amount !== void 0 && (
|
|
5270
|
+
const s = n;
|
|
5271
|
+
r.amount !== void 0 && (s.amount = r.amount);
|
|
5235
5272
|
}
|
|
5236
5273
|
};
|
|
5237
5274
|
}
|
|
@@ -5323,8 +5360,8 @@ class Oi extends le {
|
|
|
5323
5360
|
if (!n.onUpdate) continue;
|
|
5324
5361
|
const r = this.items.get(i);
|
|
5325
5362
|
if (!r || r.enabled === !1) continue;
|
|
5326
|
-
const
|
|
5327
|
-
|
|
5363
|
+
const s = this.filters.get(i);
|
|
5364
|
+
s && n.onUpdate(s, e);
|
|
5328
5365
|
}
|
|
5329
5366
|
}
|
|
5330
5367
|
/** 序列化(仅元数据,插件为运行时代码不参与序列化) */
|
|
@@ -5359,7 +5396,7 @@ class Oi extends le {
|
|
|
5359
5396
|
* ```
|
|
5360
5397
|
*/
|
|
5361
5398
|
computeFilterArea() {
|
|
5362
|
-
const e = this._app.screen, i = this._target.worldTransform.clone().invert(), n = i.apply({ x: e.x, y: e.y }), r = i.apply({ x: e.x + e.width, y: e.y }),
|
|
5399
|
+
const e = this._app.screen, i = this._target.worldTransform.clone().invert(), n = i.apply({ x: e.x, y: e.y }), r = i.apply({ x: e.x + e.width, y: e.y }), s = i.apply({ x: e.x + e.width, y: e.y + e.height }), o = i.apply({ x: e.x, y: e.y + e.height }), a = Oi.FILTER_AREA_PAD, c = Math.min(n.x, r.x, s.x, o.x) - a, l = Math.min(n.y, r.y, s.y, o.y) - a, h = Math.max(n.x, r.x, s.x, o.x) + a, u = Math.max(n.y, r.y, s.y, o.y) + a;
|
|
5363
5400
|
return new Lt(c, l, h - c, u - l);
|
|
5364
5401
|
}
|
|
5365
5402
|
/** 按权重升序排列,返回有效(已注册 + 已启用)的 ID 列表 */
|
|
@@ -5472,7 +5509,7 @@ class _r extends le {
|
|
|
5472
5509
|
this.ensureReady();
|
|
5473
5510
|
let n, r;
|
|
5474
5511
|
Array.isArray(e) ? r = e : (n = e, r = i ?? [0]);
|
|
5475
|
-
const
|
|
5512
|
+
const s = r.length ? r : [0], o = s[0] ?? 0, a = s[1] ?? o, c = s[2] ?? o, l = s[3] ?? a, h = n ? this.scenes.get(n) : this.activeScene;
|
|
5476
5513
|
if (!h) throw new Error(n ? `Scene "${n}" not found` : "No active scene");
|
|
5477
5514
|
const u = h.getContentBounds();
|
|
5478
5515
|
if (!u) return;
|
|
@@ -5489,7 +5526,7 @@ class _r extends le {
|
|
|
5489
5526
|
const me = x * pe + S * ge, ve = w * pe + b * ge;
|
|
5490
5527
|
me < E && (E = me), ve < N && (N = ve), me > j && (j = me), ve > ee && (ee = ve);
|
|
5491
5528
|
}
|
|
5492
|
-
const V = j - E, X = ee - N, ue = (E + j) / 2, fe = (N + ee) / 2, q = f - l - a, de = d -
|
|
5529
|
+
const V = j - E, X = ee - N, ue = (E + j) / 2, fe = (N + ee) / 2, q = f - l - a, de = d - o - c;
|
|
5493
5530
|
let $;
|
|
5494
5531
|
if (V <= 0 && X <= 0)
|
|
5495
5532
|
$ = De.DEFAULT_ZOOM;
|
|
@@ -5500,7 +5537,7 @@ class _r extends le {
|
|
|
5500
5537
|
$ = Math.min(pe, ge);
|
|
5501
5538
|
}
|
|
5502
5539
|
$ = Math.max(0.05, Math.min($, 10));
|
|
5503
|
-
const O = l + (f - l - a) / 2, Gt =
|
|
5540
|
+
const O = l + (f - l - a) / 2, Gt = o + (d - o - c) / 2, I = O - $ * ue, te = Gt - $ * fe;
|
|
5504
5541
|
!Number.isFinite(I) || !Number.isFinite(te) || !Number.isFinite($) || await h.setCamera({ zoom: $, x: I, y: te });
|
|
5505
5542
|
}
|
|
5506
5543
|
get activeScene() {
|
|
@@ -5635,16 +5672,16 @@ class Pe extends Oe {
|
|
|
5635
5672
|
activeItems = /* @__PURE__ */ new Map();
|
|
5636
5673
|
hookScene(e) {
|
|
5637
5674
|
const i = this.getCollection(e);
|
|
5638
|
-
for (const
|
|
5639
|
-
this.enableInteraction(
|
|
5640
|
-
const n = (
|
|
5641
|
-
for (const [
|
|
5642
|
-
a.sceneId === e.id && this.disableInteraction(
|
|
5675
|
+
for (const o of i.getAll())
|
|
5676
|
+
this.enableInteraction(o, e);
|
|
5677
|
+
const n = (o) => this.enableInteraction(o, e), r = ({ id: o }) => this.disableInteraction(o), s = () => {
|
|
5678
|
+
for (const [o, a] of this.activeItems)
|
|
5679
|
+
a.sceneId === e.id && this.disableInteraction(o);
|
|
5643
5680
|
};
|
|
5644
|
-
return i.on(`${this.targetType}:added`, n), i.on(`${this.targetType}:removed`, r), i.on(`${this.targetType}s:cleared`,
|
|
5645
|
-
i.off(`${this.targetType}:added`, n), i.off(`${this.targetType}:removed`, r), i.off(`${this.targetType}s:cleared`,
|
|
5646
|
-
for (const
|
|
5647
|
-
this.disableInteraction(this.getItemId(
|
|
5681
|
+
return i.on(`${this.targetType}:added`, n), i.on(`${this.targetType}:removed`, r), i.on(`${this.targetType}s:cleared`, s), () => {
|
|
5682
|
+
i.off(`${this.targetType}:added`, n), i.off(`${this.targetType}:removed`, r), i.off(`${this.targetType}s:cleared`, s);
|
|
5683
|
+
for (const o of i.getAll())
|
|
5684
|
+
this.disableInteraction(this.getItemId(o));
|
|
5648
5685
|
};
|
|
5649
5686
|
}
|
|
5650
5687
|
enableInteraction(e, i) {
|
|
@@ -5671,8 +5708,8 @@ class qc {
|
|
|
5671
5708
|
graphics;
|
|
5672
5709
|
draw(e, i) {
|
|
5673
5710
|
this.destroy();
|
|
5674
|
-
const { padding: n, radius: r, color:
|
|
5675
|
-
l.roundRect(c.x - n, c.y - n, c.width + n * 2, c.height + n * 2, r), l.stroke({ color:
|
|
5711
|
+
const { padding: n, radius: r, color: s, lineWidth: o, alpha: a } = { ...Xc, ...i }, c = e.getLocalBounds(), l = new L();
|
|
5712
|
+
l.roundRect(c.x - n, c.y - n, c.width + n * 2, c.height + n * 2, r), l.stroke({ color: s, width: o, alpha: a }), l.position.copyFrom(e.position), l.skew.copyFrom(e.skew), l.scale.copyFrom(e.scale), e.parent?.addChild(l), this.graphics = l;
|
|
5676
5713
|
}
|
|
5677
5714
|
updatePosition(e) {
|
|
5678
5715
|
this.graphics && this.graphics.position.copyFrom(e.position);
|
|
@@ -5697,12 +5734,12 @@ class Ue extends Oe {
|
|
|
5697
5734
|
hookScene(e) {
|
|
5698
5735
|
const i = this.getCollection(e), { projectionContainer: n } = e;
|
|
5699
5736
|
for (const a of i.getAll()) this.attachBehavior(a, n, e);
|
|
5700
|
-
const r = (a) => this.attachBehavior(a, n, e),
|
|
5737
|
+
const r = (a) => this.attachBehavior(a, n, e), s = ({ id: a }) => this.detachBehavior(a), o = () => {
|
|
5701
5738
|
for (const [a, c] of this.dragStates)
|
|
5702
5739
|
c.sceneId === e.id && this.detachBehavior(a);
|
|
5703
5740
|
};
|
|
5704
|
-
return i.on(`${this.targetType}:added`, r), i.on(`${this.targetType}:removed`,
|
|
5705
|
-
i.off(`${this.targetType}:added`, r), i.off(`${this.targetType}:removed`,
|
|
5741
|
+
return i.on(`${this.targetType}:added`, r), i.on(`${this.targetType}:removed`, s), i.on(`${this.targetType}s:cleared`, o), () => {
|
|
5742
|
+
i.off(`${this.targetType}:added`, r), i.off(`${this.targetType}:removed`, s), i.off(`${this.targetType}s:cleared`, o);
|
|
5706
5743
|
for (const a of i.getAll()) this.detachBehavior(this.getItemId(a));
|
|
5707
5744
|
};
|
|
5708
5745
|
}
|
|
@@ -5722,9 +5759,9 @@ class Ue extends Oe {
|
|
|
5722
5759
|
attachBehavior(e, i, n) {
|
|
5723
5760
|
const r = this.getItemId(e);
|
|
5724
5761
|
if (this.dragStates.has(r)) return;
|
|
5725
|
-
const
|
|
5726
|
-
|
|
5727
|
-
const
|
|
5762
|
+
const s = e.getGraphics();
|
|
5763
|
+
s.eventMode = "static", s.cursor = "pointer";
|
|
5764
|
+
const o = {
|
|
5728
5765
|
item: e,
|
|
5729
5766
|
sceneId: n.id,
|
|
5730
5767
|
isDragging: !1,
|
|
@@ -5733,19 +5770,19 @@ class Ue extends Oe {
|
|
|
5733
5770
|
cleanup: () => {
|
|
5734
5771
|
}
|
|
5735
5772
|
}, a = (h) => {
|
|
5736
|
-
|
|
5773
|
+
o.isDragging = !0;
|
|
5737
5774
|
const u = i.toLocal(h.global);
|
|
5738
|
-
|
|
5775
|
+
o.startPointer = { x: u.x, y: u.y }, o.startTile = { ...this.getItemPosition(e) };
|
|
5739
5776
|
}, c = (h) => {
|
|
5740
|
-
if (!
|
|
5741
|
-
const u = i.toLocal(h.global), f = u.x -
|
|
5777
|
+
if (!o.isDragging) return;
|
|
5778
|
+
const u = i.toLocal(h.global), f = u.x - o.startPointer.x, d = u.y - o.startPointer.y, p = o.startTile.x + this.snapDelta(f), m = o.startTile.y + this.snapDelta(d);
|
|
5742
5779
|
this.applyDrag(e, p, m, n), this.updateHighlight(e);
|
|
5743
5780
|
}, l = () => {
|
|
5744
|
-
|
|
5781
|
+
o.isDragging && (o.isDragging = !1, this.onDragEnd(e, n));
|
|
5745
5782
|
};
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
}, this.dragStates.set(r,
|
|
5783
|
+
s.on("pointerdown", a), s.on("globalpointermove", c), s.on("pointerup", l), s.on("pointerupoutside", l), o.cleanup = () => {
|
|
5784
|
+
s.eventMode = "none", s.cursor = "default", s.off("pointerdown", a), s.off("globalpointermove", c), s.off("pointerup", l), s.off("pointerupoutside", l);
|
|
5785
|
+
}, this.dragStates.set(r, o), o.extraCleanup = this.onAttachItem(e, n) ?? void 0;
|
|
5749
5786
|
}
|
|
5750
5787
|
detachBehavior(e) {
|
|
5751
5788
|
const i = this.dragStates.get(e);
|
|
@@ -5821,8 +5858,8 @@ function Pi(t) {
|
|
|
5821
5858
|
function Qc(t) {
|
|
5822
5859
|
typeof t != "function" && (t = Pi(t));
|
|
5823
5860
|
for (var e = this._groups, i = e.length, n = new Array(i), r = 0; r < i; ++r)
|
|
5824
|
-
for (var
|
|
5825
|
-
(c =
|
|
5861
|
+
for (var s = e[r], o = s.length, a = n[r] = new Array(o), c, l, h = 0; h < o; ++h)
|
|
5862
|
+
(c = s[h]) && (l = t.call(c, c.__data__, h, s)) && ("__data__" in c && (l.__data__ = c.__data__), a[h] = l);
|
|
5826
5863
|
return new z(n, this._parents);
|
|
5827
5864
|
}
|
|
5828
5865
|
function el(t) {
|
|
@@ -5843,9 +5880,9 @@ function il(t) {
|
|
|
5843
5880
|
}
|
|
5844
5881
|
function nl(t) {
|
|
5845
5882
|
typeof t == "function" ? t = il(t) : t = Sr(t);
|
|
5846
|
-
for (var e = this._groups, i = e.length, n = [], r = [],
|
|
5847
|
-
for (var
|
|
5848
|
-
(c =
|
|
5883
|
+
for (var e = this._groups, i = e.length, n = [], r = [], s = 0; s < i; ++s)
|
|
5884
|
+
for (var o = e[s], a = o.length, c, l = 0; l < a; ++l)
|
|
5885
|
+
(c = o[l]) && (n.push(t.call(c, c.__data__, l, o)), r.push(c));
|
|
5849
5886
|
return new z(n, r);
|
|
5850
5887
|
}
|
|
5851
5888
|
function br(t) {
|
|
@@ -5885,8 +5922,8 @@ function ul(t) {
|
|
|
5885
5922
|
function fl(t) {
|
|
5886
5923
|
typeof t != "function" && (t = br(t));
|
|
5887
5924
|
for (var e = this._groups, i = e.length, n = new Array(i), r = 0; r < i; ++r)
|
|
5888
|
-
for (var
|
|
5889
|
-
(c =
|
|
5925
|
+
for (var s = e[r], o = s.length, a = n[r] = [], c, l = 0; l < o; ++l)
|
|
5926
|
+
(c = s[l]) && t.call(c, c.__data__, l, s) && a.push(c);
|
|
5890
5927
|
return new z(n, this._parents);
|
|
5891
5928
|
}
|
|
5892
5929
|
function Ir(t) {
|
|
@@ -5918,18 +5955,18 @@ function pl(t) {
|
|
|
5918
5955
|
return t;
|
|
5919
5956
|
};
|
|
5920
5957
|
}
|
|
5921
|
-
function gl(t, e, i, n, r,
|
|
5922
|
-
for (var
|
|
5923
|
-
(a = e[
|
|
5924
|
-
for (;
|
|
5925
|
-
(a = e[
|
|
5958
|
+
function gl(t, e, i, n, r, s) {
|
|
5959
|
+
for (var o = 0, a, c = e.length, l = s.length; o < l; ++o)
|
|
5960
|
+
(a = e[o]) ? (a.__data__ = s[o], n[o] = a) : i[o] = new At(t, s[o]);
|
|
5961
|
+
for (; o < c; ++o)
|
|
5962
|
+
(a = e[o]) && (r[o] = a);
|
|
5926
5963
|
}
|
|
5927
|
-
function ml(t, e, i, n, r,
|
|
5928
|
-
var a, c, l = /* @__PURE__ */ new Map(), h = e.length, u =
|
|
5964
|
+
function ml(t, e, i, n, r, s, o) {
|
|
5965
|
+
var a, c, l = /* @__PURE__ */ new Map(), h = e.length, u = s.length, f = new Array(h), d;
|
|
5929
5966
|
for (a = 0; a < h; ++a)
|
|
5930
|
-
(c = e[a]) && (f[a] = d =
|
|
5967
|
+
(c = e[a]) && (f[a] = d = o.call(c, c.__data__, a, e) + "", l.has(d) ? r[a] = c : l.set(d, c));
|
|
5931
5968
|
for (a = 0; a < u; ++a)
|
|
5932
|
-
d =
|
|
5969
|
+
d = o.call(t, s[a], a, s) + "", (c = l.get(d)) ? (n[a] = c, c.__data__ = s[a], l.delete(d)) : i[a] = new At(t, s[a]);
|
|
5933
5970
|
for (a = 0; a < h; ++a)
|
|
5934
5971
|
(c = e[a]) && l.get(f[a]) === c && (r[a] = c);
|
|
5935
5972
|
}
|
|
@@ -5940,8 +5977,8 @@ function xl(t, e) {
|
|
|
5940
5977
|
if (!arguments.length) return Array.from(this, vl);
|
|
5941
5978
|
var i = e ? ml : gl, n = this._parents, r = this._groups;
|
|
5942
5979
|
typeof t != "function" && (t = pl(t));
|
|
5943
|
-
for (var
|
|
5944
|
-
var h = n[l], u = r[l], f = u.length, d = yl(t.call(h, h && h.__data__, l, n)), p = d.length, m = a[l] = new Array(p), v =
|
|
5980
|
+
for (var s = r.length, o = new Array(s), a = new Array(s), c = new Array(s), l = 0; l < s; ++l) {
|
|
5981
|
+
var h = n[l], u = r[l], f = u.length, d = yl(t.call(h, h && h.__data__, l, n)), p = d.length, m = a[l] = new Array(p), v = o[l] = new Array(p), _ = c[l] = new Array(f);
|
|
5945
5982
|
i(h, u, m, v, _, d, e);
|
|
5946
5983
|
for (var x = 0, w = 0, S, b; x < p; ++x)
|
|
5947
5984
|
if (S = m[x]) {
|
|
@@ -5949,7 +5986,7 @@ function xl(t, e) {
|
|
|
5949
5986
|
S._next = b || null;
|
|
5950
5987
|
}
|
|
5951
5988
|
}
|
|
5952
|
-
return
|
|
5989
|
+
return o = new z(o, n), o._enter = a, o._exit = c, o;
|
|
5953
5990
|
}
|
|
5954
5991
|
function yl(t) {
|
|
5955
5992
|
return typeof t == "object" && "length" in t ? t : Array.from(t);
|
|
@@ -5958,11 +5995,11 @@ function _l() {
|
|
|
5958
5995
|
return new z(this._exit || this._groups.map(Ir), this._parents);
|
|
5959
5996
|
}
|
|
5960
5997
|
function wl(t, e, i) {
|
|
5961
|
-
var n = this.enter(), r = this,
|
|
5962
|
-
return typeof t == "function" ? (n = t(n), n && (n = n.selection())) : n = n.append(t + ""), e != null && (r = e(r), r && (r = r.selection())), i == null ?
|
|
5998
|
+
var n = this.enter(), r = this, s = this.exit();
|
|
5999
|
+
return typeof t == "function" ? (n = t(n), n && (n = n.selection())) : n = n.append(t + ""), e != null && (r = e(r), r && (r = r.selection())), i == null ? s.remove() : i(s), n && r ? n.merge(r).order() : r;
|
|
5963
6000
|
}
|
|
5964
6001
|
function Sl(t) {
|
|
5965
|
-
for (var e = t.selection ? t.selection() : t, i = this._groups, n = e._groups, r = i.length,
|
|
6002
|
+
for (var e = t.selection ? t.selection() : t, i = this._groups, n = e._groups, r = i.length, s = n.length, o = Math.min(r, s), a = new Array(r), c = 0; c < o; ++c)
|
|
5966
6003
|
for (var l = i[c], h = n[c], u = l.length, f = a[c] = new Array(u), d, p = 0; p < u; ++p)
|
|
5967
6004
|
(d = l[p] || h[p]) && (f[p] = d);
|
|
5968
6005
|
for (; c < r; ++c)
|
|
@@ -5971,8 +6008,8 @@ function Sl(t) {
|
|
|
5971
6008
|
}
|
|
5972
6009
|
function bl() {
|
|
5973
6010
|
for (var t = this._groups, e = -1, i = t.length; ++e < i; )
|
|
5974
|
-
for (var n = t[e], r = n.length - 1,
|
|
5975
|
-
(
|
|
6011
|
+
for (var n = t[e], r = n.length - 1, s = n[r], o; --r >= 0; )
|
|
6012
|
+
(o = n[r]) && (s && o.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(o, s), s = o);
|
|
5976
6013
|
return this;
|
|
5977
6014
|
}
|
|
5978
6015
|
function Cl(t) {
|
|
@@ -5980,9 +6017,9 @@ function Cl(t) {
|
|
|
5980
6017
|
function e(u, f) {
|
|
5981
6018
|
return u && f ? t(u.__data__, f.__data__) : !u - !f;
|
|
5982
6019
|
}
|
|
5983
|
-
for (var i = this._groups, n = i.length, r = new Array(n),
|
|
5984
|
-
for (var
|
|
5985
|
-
(l =
|
|
6020
|
+
for (var i = this._groups, n = i.length, r = new Array(n), s = 0; s < n; ++s) {
|
|
6021
|
+
for (var o = i[s], a = o.length, c = r[s] = new Array(a), l, h = 0; h < a; ++h)
|
|
6022
|
+
(l = o[h]) && (c[h] = l);
|
|
5986
6023
|
c.sort(e);
|
|
5987
6024
|
}
|
|
5988
6025
|
return new z(r, this._parents).order();
|
|
@@ -5999,9 +6036,9 @@ function Tl() {
|
|
|
5999
6036
|
}
|
|
6000
6037
|
function Ol() {
|
|
6001
6038
|
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
|
|
6002
|
-
for (var n = t[e], r = 0,
|
|
6003
|
-
var
|
|
6004
|
-
if (
|
|
6039
|
+
for (var n = t[e], r = 0, s = n.length; r < s; ++r) {
|
|
6040
|
+
var o = n[r];
|
|
6041
|
+
if (o) return o;
|
|
6005
6042
|
}
|
|
6006
6043
|
return null;
|
|
6007
6044
|
}
|
|
@@ -6015,8 +6052,8 @@ function Ml() {
|
|
|
6015
6052
|
}
|
|
6016
6053
|
function El(t) {
|
|
6017
6054
|
for (var e = this._groups, i = 0, n = e.length; i < n; ++i)
|
|
6018
|
-
for (var r = e[i],
|
|
6019
|
-
(a = r[
|
|
6055
|
+
for (var r = e[i], s = 0, o = r.length, a; s < o; ++s)
|
|
6056
|
+
(a = r[s]) && t.call(a, a.__data__, s, r);
|
|
6020
6057
|
return this;
|
|
6021
6058
|
}
|
|
6022
6059
|
function Ll(t) {
|
|
@@ -6149,7 +6186,7 @@ function ql(t, e) {
|
|
|
6149
6186
|
function Jl(t, e) {
|
|
6150
6187
|
var i = Tr(t + "");
|
|
6151
6188
|
if (arguments.length < 2) {
|
|
6152
|
-
for (var n = Mi(this.node()), r = -1,
|
|
6189
|
+
for (var n = Mi(this.node()), r = -1, s = i.length; ++r < s; ) if (!n.contains(i[r])) return !1;
|
|
6153
6190
|
return !0;
|
|
6154
6191
|
}
|
|
6155
6192
|
return this.each((typeof e == "function" ? ql : e ? Vl : Xl)(i, e));
|
|
@@ -6251,38 +6288,38 @@ function _h(t) {
|
|
|
6251
6288
|
return function() {
|
|
6252
6289
|
var e = this.__on;
|
|
6253
6290
|
if (e) {
|
|
6254
|
-
for (var i = 0, n = -1, r = e.length,
|
|
6255
|
-
|
|
6291
|
+
for (var i = 0, n = -1, r = e.length, s; i < r; ++i)
|
|
6292
|
+
s = e[i], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++n] = s;
|
|
6256
6293
|
++n ? e.length = n : delete this.__on;
|
|
6257
6294
|
}
|
|
6258
6295
|
};
|
|
6259
6296
|
}
|
|
6260
6297
|
function wh(t, e, i) {
|
|
6261
6298
|
return function() {
|
|
6262
|
-
var n = this.__on, r,
|
|
6299
|
+
var n = this.__on, r, s = xh(e);
|
|
6263
6300
|
if (n) {
|
|
6264
|
-
for (var
|
|
6265
|
-
if ((r = n[
|
|
6266
|
-
this.removeEventListener(r.type, r.listener, r.options), this.addEventListener(r.type, r.listener =
|
|
6301
|
+
for (var o = 0, a = n.length; o < a; ++o)
|
|
6302
|
+
if ((r = n[o]).type === t.type && r.name === t.name) {
|
|
6303
|
+
this.removeEventListener(r.type, r.listener, r.options), this.addEventListener(r.type, r.listener = s, r.options = i), r.value = e;
|
|
6267
6304
|
return;
|
|
6268
6305
|
}
|
|
6269
6306
|
}
|
|
6270
|
-
this.addEventListener(t.type,
|
|
6307
|
+
this.addEventListener(t.type, s, i), r = { type: t.type, name: t.name, value: e, listener: s, options: i }, n ? n.push(r) : this.__on = [r];
|
|
6271
6308
|
};
|
|
6272
6309
|
}
|
|
6273
6310
|
function Sh(t, e, i) {
|
|
6274
|
-
var n = yh(t + ""), r,
|
|
6311
|
+
var n = yh(t + ""), r, s = n.length, o;
|
|
6275
6312
|
if (arguments.length < 2) {
|
|
6276
6313
|
var a = this.node().__on;
|
|
6277
6314
|
if (a) {
|
|
6278
6315
|
for (var c = 0, l = a.length, h; c < l; ++c)
|
|
6279
|
-
for (r = 0, h = a[c]; r <
|
|
6280
|
-
if ((
|
|
6316
|
+
for (r = 0, h = a[c]; r < s; ++r)
|
|
6317
|
+
if ((o = n[r]).type === h.type && o.name === h.name)
|
|
6281
6318
|
return h.value;
|
|
6282
6319
|
}
|
|
6283
6320
|
return;
|
|
6284
6321
|
}
|
|
6285
|
-
for (a = e ? wh : _h, r = 0; r <
|
|
6322
|
+
for (a = e ? wh : _h, r = 0; r < s; ++r) this.each(a(n[r], e, i));
|
|
6286
6323
|
return this;
|
|
6287
6324
|
}
|
|
6288
6325
|
function Er(t, e, i) {
|
|
@@ -6304,8 +6341,8 @@ function Ih(t, e) {
|
|
|
6304
6341
|
}
|
|
6305
6342
|
function* Ah() {
|
|
6306
6343
|
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
|
|
6307
|
-
for (var n = t[e], r = 0,
|
|
6308
|
-
(
|
|
6344
|
+
for (var n = t[e], r = 0, s = n.length, o; r < s; ++r)
|
|
6345
|
+
(o = n[r]) && (yield o);
|
|
6309
6346
|
}
|
|
6310
6347
|
var Lr = [null];
|
|
6311
6348
|
function z(t, e) {
|
|
@@ -6380,14 +6417,14 @@ function Mh(t, e) {
|
|
|
6380
6417
|
pt.prototype = kr.prototype = {
|
|
6381
6418
|
constructor: pt,
|
|
6382
6419
|
on: function(t, e) {
|
|
6383
|
-
var i = this._, n = Mh(t + "", i), r,
|
|
6420
|
+
var i = this._, n = Mh(t + "", i), r, s = -1, o = n.length;
|
|
6384
6421
|
if (arguments.length < 2) {
|
|
6385
|
-
for (; ++
|
|
6422
|
+
for (; ++s < o; ) if ((r = (t = n[s]).type) && (r = Eh(i[r], t.name))) return r;
|
|
6386
6423
|
return;
|
|
6387
6424
|
}
|
|
6388
6425
|
if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
|
|
6389
|
-
for (; ++
|
|
6390
|
-
if (r = (t = n[
|
|
6426
|
+
for (; ++s < o; )
|
|
6427
|
+
if (r = (t = n[s]).type) i[r] = Qi(i[r], t.name, e);
|
|
6391
6428
|
else if (e == null) for (r in i) i[r] = Qi(i[r], t.name, null);
|
|
6392
6429
|
return this;
|
|
6393
6430
|
},
|
|
@@ -6397,13 +6434,13 @@ pt.prototype = kr.prototype = {
|
|
|
6397
6434
|
return new pt(t);
|
|
6398
6435
|
},
|
|
6399
6436
|
call: function(t, e) {
|
|
6400
|
-
if ((r = arguments.length - 2) > 0) for (var i = new Array(r), n = 0, r,
|
|
6437
|
+
if ((r = arguments.length - 2) > 0) for (var i = new Array(r), n = 0, r, s; n < r; ++n) i[n] = arguments[n + 2];
|
|
6401
6438
|
if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
|
6402
|
-
for (
|
|
6439
|
+
for (s = this._[t], n = 0, r = s.length; n < r; ++n) s[n].value.apply(e, i);
|
|
6403
6440
|
},
|
|
6404
6441
|
apply: function(t, e, i) {
|
|
6405
6442
|
if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
|
6406
|
-
for (var n = this._[t], r = 0,
|
|
6443
|
+
for (var n = this._[t], r = 0, s = n.length; r < s; ++r) n[r].value.apply(e, i);
|
|
6407
6444
|
}
|
|
6408
6445
|
};
|
|
6409
6446
|
function Eh(t, e) {
|
|
@@ -6482,10 +6519,10 @@ function tn(t, e, i) {
|
|
|
6482
6519
|
}, e, i), n;
|
|
6483
6520
|
}
|
|
6484
6521
|
var Dh = kr("start", "end", "cancel", "interrupt"), zh = [], zr = 0, nn = 1, hi = 2, gt = 3, rn = 4, ui = 5, mt = 6;
|
|
6485
|
-
function $t(t, e, i, n, r,
|
|
6486
|
-
var
|
|
6487
|
-
if (!
|
|
6488
|
-
else if (i in
|
|
6522
|
+
function $t(t, e, i, n, r, s) {
|
|
6523
|
+
var o = t.__transition;
|
|
6524
|
+
if (!o) t.__transition = {};
|
|
6525
|
+
else if (i in o) return;
|
|
6489
6526
|
Nh(t, i, {
|
|
6490
6527
|
name: e,
|
|
6491
6528
|
index: n,
|
|
@@ -6494,10 +6531,10 @@ function $t(t, e, i, n, r, o) {
|
|
|
6494
6531
|
// For context during callback.
|
|
6495
6532
|
on: Dh,
|
|
6496
6533
|
tween: zh,
|
|
6497
|
-
time:
|
|
6498
|
-
delay:
|
|
6499
|
-
duration:
|
|
6500
|
-
ease:
|
|
6534
|
+
time: s.time,
|
|
6535
|
+
delay: s.delay,
|
|
6536
|
+
duration: s.duration,
|
|
6537
|
+
ease: s.ease,
|
|
6501
6538
|
timer: null,
|
|
6502
6539
|
state: zr
|
|
6503
6540
|
});
|
|
@@ -6519,16 +6556,16 @@ function W(t, e) {
|
|
|
6519
6556
|
}
|
|
6520
6557
|
function Nh(t, e, i) {
|
|
6521
6558
|
var n = t.__transition, r;
|
|
6522
|
-
n[e] = i, i.timer = Dr(
|
|
6523
|
-
function o(l) {
|
|
6524
|
-
i.state = nn, i.timer.restart(s, i.delay, i.time), i.delay <= l && s(l - i.delay);
|
|
6525
|
-
}
|
|
6559
|
+
n[e] = i, i.timer = Dr(s, 0, i.time);
|
|
6526
6560
|
function s(l) {
|
|
6561
|
+
i.state = nn, i.timer.restart(o, i.delay, i.time), i.delay <= l && o(l - i.delay);
|
|
6562
|
+
}
|
|
6563
|
+
function o(l) {
|
|
6527
6564
|
var h, u, f, d;
|
|
6528
6565
|
if (i.state !== nn) return c();
|
|
6529
6566
|
for (h in n)
|
|
6530
6567
|
if (d = n[h], d.name === i.name) {
|
|
6531
|
-
if (d.state === gt) return tn(
|
|
6568
|
+
if (d.state === gt) return tn(o);
|
|
6532
6569
|
d.state === rn ? (d.state = mt, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete n[h]) : +h < e && (d.state = mt, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete n[h]);
|
|
6533
6570
|
}
|
|
6534
6571
|
if (tn(function() {
|
|
@@ -6551,17 +6588,17 @@ function Nh(t, e, i) {
|
|
|
6551
6588
|
}
|
|
6552
6589
|
}
|
|
6553
6590
|
function $h(t, e) {
|
|
6554
|
-
var i = t.__transition, n, r,
|
|
6591
|
+
var i = t.__transition, n, r, s = !0, o;
|
|
6555
6592
|
if (i) {
|
|
6556
6593
|
e = e == null ? null : e + "";
|
|
6557
|
-
for (
|
|
6558
|
-
if ((n = i[
|
|
6559
|
-
|
|
6594
|
+
for (o in i) {
|
|
6595
|
+
if ((n = i[o]).name !== e) {
|
|
6596
|
+
s = !1;
|
|
6560
6597
|
continue;
|
|
6561
6598
|
}
|
|
6562
|
-
r = n.state > hi && n.state < ui, n.state = mt, n.timer.stop(), n.on.call(r ? "interrupt" : "cancel", t, t.__data__, n.index, n.group), delete i[
|
|
6599
|
+
r = n.state > hi && n.state < ui, n.state = mt, n.timer.stop(), n.on.call(r ? "interrupt" : "cancel", t, t.__data__, n.index, n.group), delete i[o];
|
|
6563
6600
|
}
|
|
6564
|
-
|
|
6601
|
+
s && delete t.__transition;
|
|
6565
6602
|
}
|
|
6566
6603
|
}
|
|
6567
6604
|
function Gh(t) {
|
|
@@ -6825,8 +6862,8 @@ function $r(t) {
|
|
|
6825
6862
|
if (t instanceof rt || (t = it(t)), !t) return new B();
|
|
6826
6863
|
if (t instanceof B) return t;
|
|
6827
6864
|
t = t.rgb();
|
|
6828
|
-
var e = t.r / 255, i = t.g / 255, n = t.b / 255, r = Math.min(e, i, n),
|
|
6829
|
-
return a ? (e ===
|
|
6865
|
+
var e = t.r / 255, i = t.g / 255, n = t.b / 255, r = Math.min(e, i, n), s = Math.max(e, i, n), o = NaN, a = s - r, c = (s + r) / 2;
|
|
6866
|
+
return a ? (e === s ? o = (i - n) / a + (i < n) * 6 : i === s ? o = (n - e) / a + 2 : o = (e - i) / a + 4, a /= c < 0.5 ? s + r : 2 - s - r, o *= 60) : a = c > 0 && c < 1 ? 0 : o, new B(o, a, c, t.opacity);
|
|
6830
6867
|
}
|
|
6831
6868
|
function Zh(t, e, i, n) {
|
|
6832
6869
|
return arguments.length === 1 ? $r(t) : new B(t, e, i, n ?? 1);
|
|
@@ -6892,10 +6929,10 @@ function Ur(t, e) {
|
|
|
6892
6929
|
}
|
|
6893
6930
|
const dn = (function t(e) {
|
|
6894
6931
|
var i = tu(e);
|
|
6895
|
-
function n(r,
|
|
6896
|
-
var
|
|
6932
|
+
function n(r, s) {
|
|
6933
|
+
var o = i((r = fi(r)).r, (s = fi(s)).r), a = i(r.g, s.g), c = i(r.b, s.b), l = Ur(r.opacity, s.opacity);
|
|
6897
6934
|
return function(h) {
|
|
6898
|
-
return r.r =
|
|
6935
|
+
return r.r = o(h), r.g = a(h), r.b = c(h), r.opacity = l(h), r + "";
|
|
6899
6936
|
};
|
|
6900
6937
|
}
|
|
6901
6938
|
return n.gamma = t, n;
|
|
@@ -6917,10 +6954,10 @@ function nu(t) {
|
|
|
6917
6954
|
};
|
|
6918
6955
|
}
|
|
6919
6956
|
function ru(t, e) {
|
|
6920
|
-
var i = di.lastIndex = Jt.lastIndex = 0, n, r,
|
|
6957
|
+
var i = di.lastIndex = Jt.lastIndex = 0, n, r, s, o = -1, a = [], c = [];
|
|
6921
6958
|
for (t = t + "", e = e + ""; (n = di.exec(t)) && (r = Jt.exec(e)); )
|
|
6922
|
-
(
|
|
6923
|
-
return i < e.length && (
|
|
6959
|
+
(s = r.index) > i && (s = e.slice(i, s), a[o] ? a[o] += s : a[++o] = s), (n = n[0]) === (r = r[0]) ? a[o] ? a[o] += r : a[++o] = r : (a[++o] = null, c.push({ i: o, x: oe(n, r) })), i = Jt.lastIndex;
|
|
6960
|
+
return i < e.length && (s = e.slice(i), a[o] ? a[o] += s : a[++o] = s), a.length < 2 ? c[0] ? nu(c[0].x) : iu(e) : (e = c.length, function(l) {
|
|
6924
6961
|
for (var h = 0, u; h < e; ++h) a[(u = c[h]).i] = u.x(l);
|
|
6925
6962
|
return a.join("");
|
|
6926
6963
|
});
|
|
@@ -6933,14 +6970,14 @@ var pn = 180 / Math.PI, pi = {
|
|
|
6933
6970
|
scaleX: 1,
|
|
6934
6971
|
scaleY: 1
|
|
6935
6972
|
};
|
|
6936
|
-
function Hr(t, e, i, n, r,
|
|
6937
|
-
var
|
|
6938
|
-
return (
|
|
6973
|
+
function Hr(t, e, i, n, r, s) {
|
|
6974
|
+
var o, a, c;
|
|
6975
|
+
return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (c = t * i + e * n) && (i -= t * c, n -= e * c), (a = Math.sqrt(i * i + n * n)) && (i /= a, n /= a, c /= a), t * n < e * i && (t = -t, e = -e, c = -c, o = -o), {
|
|
6939
6976
|
translateX: r,
|
|
6940
|
-
translateY:
|
|
6977
|
+
translateY: s,
|
|
6941
6978
|
rotate: Math.atan2(e, t) * pn,
|
|
6942
6979
|
skewX: Math.atan(c) * pn,
|
|
6943
|
-
scaleX:
|
|
6980
|
+
scaleX: o,
|
|
6944
6981
|
scaleY: a
|
|
6945
6982
|
};
|
|
6946
6983
|
}
|
|
@@ -6956,13 +6993,13 @@ function Yr(t, e, i, n) {
|
|
|
6956
6993
|
function r(l) {
|
|
6957
6994
|
return l.length ? l.pop() + " " : "";
|
|
6958
6995
|
}
|
|
6959
|
-
function
|
|
6996
|
+
function s(l, h, u, f, d, p) {
|
|
6960
6997
|
if (l !== u || h !== f) {
|
|
6961
6998
|
var m = d.push("translate(", null, e, null, i);
|
|
6962
6999
|
p.push({ i: m - 4, x: oe(l, u) }, { i: m - 2, x: oe(h, f) });
|
|
6963
7000
|
} else (u || f) && d.push("translate(" + u + e + f + i);
|
|
6964
7001
|
}
|
|
6965
|
-
function
|
|
7002
|
+
function o(l, h, u, f) {
|
|
6966
7003
|
l !== h ? (l - h > 180 ? h += 360 : h - l > 180 && (l += 360), f.push({ i: u.push(r(u) + "rotate(", null, n) - 2, x: oe(l, h) })) : h && u.push(r(u) + "rotate(" + h + n);
|
|
6967
7004
|
}
|
|
6968
7005
|
function a(l, h, u, f) {
|
|
@@ -6976,7 +7013,7 @@ function Yr(t, e, i, n) {
|
|
|
6976
7013
|
}
|
|
6977
7014
|
return function(l, h) {
|
|
6978
7015
|
var u = [], f = [];
|
|
6979
|
-
return l = t(l), h = t(h),
|
|
7016
|
+
return l = t(l), h = t(h), s(l.translateX, l.translateY, h.translateX, h.translateY, u, f), o(l.rotate, h.rotate, u, f), a(l.skewX, h.skewX, u, f), c(l.scaleX, l.scaleY, h.scaleX, h.scaleY, u, f), l = h = null, function(d) {
|
|
6980
7017
|
for (var p = -1, m = f.length, v; ++p < m; ) u[(v = f[p]).i] = v.x(d);
|
|
6981
7018
|
return u.join("");
|
|
6982
7019
|
};
|
|
@@ -6986,12 +7023,12 @@ var au = Yr(su, "px, ", "px)", "deg)"), cu = Yr(ou, ", ", ")", ")");
|
|
|
6986
7023
|
function lu(t, e) {
|
|
6987
7024
|
var i, n;
|
|
6988
7025
|
return function() {
|
|
6989
|
-
var r = Q(this, t),
|
|
6990
|
-
if (
|
|
6991
|
-
n = i =
|
|
6992
|
-
for (var
|
|
6993
|
-
if (n[
|
|
6994
|
-
n = n.slice(), n.splice(
|
|
7026
|
+
var r = Q(this, t), s = r.tween;
|
|
7027
|
+
if (s !== i) {
|
|
7028
|
+
n = i = s;
|
|
7029
|
+
for (var o = 0, a = n.length; o < a; ++o)
|
|
7030
|
+
if (n[o].name === e) {
|
|
7031
|
+
n = n.slice(), n.splice(o, 1);
|
|
6995
7032
|
break;
|
|
6996
7033
|
}
|
|
6997
7034
|
}
|
|
@@ -7002,9 +7039,9 @@ function hu(t, e, i) {
|
|
|
7002
7039
|
var n, r;
|
|
7003
7040
|
if (typeof i != "function") throw new Error();
|
|
7004
7041
|
return function() {
|
|
7005
|
-
var
|
|
7006
|
-
if (
|
|
7007
|
-
r = (n =
|
|
7042
|
+
var s = Q(this, t), o = s.tween;
|
|
7043
|
+
if (o !== n) {
|
|
7044
|
+
r = (n = o).slice();
|
|
7008
7045
|
for (var a = { name: e, value: i }, c = 0, l = r.length; c < l; ++c)
|
|
7009
7046
|
if (r[c].name === e) {
|
|
7010
7047
|
r[c] = a;
|
|
@@ -7012,15 +7049,15 @@ function hu(t, e, i) {
|
|
|
7012
7049
|
}
|
|
7013
7050
|
c === l && r.push(a);
|
|
7014
7051
|
}
|
|
7015
|
-
|
|
7052
|
+
s.tween = r;
|
|
7016
7053
|
};
|
|
7017
7054
|
}
|
|
7018
7055
|
function uu(t, e) {
|
|
7019
7056
|
var i = this._id;
|
|
7020
7057
|
if (t += "", arguments.length < 2) {
|
|
7021
|
-
for (var n = W(this.node(), i).tween, r = 0,
|
|
7022
|
-
if ((
|
|
7023
|
-
return
|
|
7058
|
+
for (var n = W(this.node(), i).tween, r = 0, s = n.length, o; r < s; ++r)
|
|
7059
|
+
if ((o = n[r]).name === t)
|
|
7060
|
+
return o.value;
|
|
7024
7061
|
return null;
|
|
7025
7062
|
}
|
|
7026
7063
|
return this.each((e == null ? lu : hu)(i, t, e));
|
|
@@ -7049,31 +7086,31 @@ function du(t) {
|
|
|
7049
7086
|
};
|
|
7050
7087
|
}
|
|
7051
7088
|
function pu(t, e, i) {
|
|
7052
|
-
var n, r = i + "",
|
|
7089
|
+
var n, r = i + "", s;
|
|
7053
7090
|
return function() {
|
|
7054
|
-
var
|
|
7055
|
-
return
|
|
7091
|
+
var o = this.getAttribute(t);
|
|
7092
|
+
return o === r ? null : o === n ? s : s = e(n = o, i);
|
|
7056
7093
|
};
|
|
7057
7094
|
}
|
|
7058
7095
|
function gu(t, e, i) {
|
|
7059
|
-
var n, r = i + "",
|
|
7096
|
+
var n, r = i + "", s;
|
|
7060
7097
|
return function() {
|
|
7061
|
-
var
|
|
7062
|
-
return
|
|
7098
|
+
var o = this.getAttributeNS(t.space, t.local);
|
|
7099
|
+
return o === r ? null : o === n ? s : s = e(n = o, i);
|
|
7063
7100
|
};
|
|
7064
7101
|
}
|
|
7065
7102
|
function mu(t, e, i) {
|
|
7066
|
-
var n, r,
|
|
7103
|
+
var n, r, s;
|
|
7067
7104
|
return function() {
|
|
7068
|
-
var
|
|
7069
|
-
return a == null ? void this.removeAttribute(t) : (
|
|
7105
|
+
var o, a = i(this), c;
|
|
7106
|
+
return a == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), c = a + "", o === c ? null : o === n && c === r ? s : (r = c, s = e(n = o, a)));
|
|
7070
7107
|
};
|
|
7071
7108
|
}
|
|
7072
7109
|
function vu(t, e, i) {
|
|
7073
|
-
var n, r,
|
|
7110
|
+
var n, r, s;
|
|
7074
7111
|
return function() {
|
|
7075
|
-
var
|
|
7076
|
-
return a == null ? void this.removeAttributeNS(t.space, t.local) : (
|
|
7112
|
+
var o, a = i(this), c;
|
|
7113
|
+
return a == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), c = a + "", o === c ? null : o === n && c === r ? s : (r = c, s = e(n = o, a)));
|
|
7077
7114
|
};
|
|
7078
7115
|
}
|
|
7079
7116
|
function xu(t, e) {
|
|
@@ -7093,16 +7130,16 @@ function _u(t, e) {
|
|
|
7093
7130
|
function wu(t, e) {
|
|
7094
7131
|
var i, n;
|
|
7095
7132
|
function r() {
|
|
7096
|
-
var
|
|
7097
|
-
return
|
|
7133
|
+
var s = e.apply(this, arguments);
|
|
7134
|
+
return s !== n && (i = (n = s) && _u(t, s)), i;
|
|
7098
7135
|
}
|
|
7099
7136
|
return r._value = e, r;
|
|
7100
7137
|
}
|
|
7101
7138
|
function Su(t, e) {
|
|
7102
7139
|
var i, n;
|
|
7103
7140
|
function r() {
|
|
7104
|
-
var
|
|
7105
|
-
return
|
|
7141
|
+
var s = e.apply(this, arguments);
|
|
7142
|
+
return s !== n && (i = (n = s) && yu(t, s)), i;
|
|
7106
7143
|
}
|
|
7107
7144
|
return r._value = e, r;
|
|
7108
7145
|
}
|
|
@@ -7166,18 +7203,18 @@ function ku(t) {
|
|
|
7166
7203
|
function Fu(t) {
|
|
7167
7204
|
typeof t != "function" && (t = br(t));
|
|
7168
7205
|
for (var e = this._groups, i = e.length, n = new Array(i), r = 0; r < i; ++r)
|
|
7169
|
-
for (var
|
|
7170
|
-
(c =
|
|
7206
|
+
for (var s = e[r], o = s.length, a = n[r] = [], c, l = 0; l < o; ++l)
|
|
7207
|
+
(c = s[l]) && t.call(c, c.__data__, l, s) && a.push(c);
|
|
7171
7208
|
return new se(n, this._parents, this._name, this._id);
|
|
7172
7209
|
}
|
|
7173
7210
|
function Ru(t) {
|
|
7174
7211
|
if (t._id !== this._id) throw new Error();
|
|
7175
|
-
for (var e = this._groups, i = t._groups, n = e.length, r = i.length,
|
|
7176
|
-
for (var c = e[a], l = i[a], h = c.length, u =
|
|
7212
|
+
for (var e = this._groups, i = t._groups, n = e.length, r = i.length, s = Math.min(n, r), o = new Array(n), a = 0; a < s; ++a)
|
|
7213
|
+
for (var c = e[a], l = i[a], h = c.length, u = o[a] = new Array(h), f, d = 0; d < h; ++d)
|
|
7177
7214
|
(f = c[d] || l[d]) && (u[d] = f);
|
|
7178
7215
|
for (; a < n; ++a)
|
|
7179
|
-
|
|
7180
|
-
return new se(
|
|
7216
|
+
o[a] = e[a];
|
|
7217
|
+
return new se(o, this._parents, this._name, this._id);
|
|
7181
7218
|
}
|
|
7182
7219
|
function Du(t) {
|
|
7183
7220
|
return (t + "").trim().split(/^|\s+/).every(function(e) {
|
|
@@ -7186,10 +7223,10 @@ function Du(t) {
|
|
|
7186
7223
|
});
|
|
7187
7224
|
}
|
|
7188
7225
|
function zu(t, e, i) {
|
|
7189
|
-
var n, r,
|
|
7226
|
+
var n, r, s = Du(e) ? Li : Q;
|
|
7190
7227
|
return function() {
|
|
7191
|
-
var
|
|
7192
|
-
a !== n && (r = (n = a).copy()).on(e, i),
|
|
7228
|
+
var o = s(this, t), a = o.on;
|
|
7229
|
+
a !== n && (r = (n = a).copy()).on(e, i), o.on = r;
|
|
7193
7230
|
};
|
|
7194
7231
|
}
|
|
7195
7232
|
function Nu(t, e) {
|
|
@@ -7209,22 +7246,22 @@ function Gu() {
|
|
|
7209
7246
|
function Uu(t) {
|
|
7210
7247
|
var e = this._name, i = this._id;
|
|
7211
7248
|
typeof t != "function" && (t = Pi(t));
|
|
7212
|
-
for (var n = this._groups, r = n.length,
|
|
7213
|
-
for (var a = n[
|
|
7249
|
+
for (var n = this._groups, r = n.length, s = new Array(r), o = 0; o < r; ++o)
|
|
7250
|
+
for (var a = n[o], c = a.length, l = s[o] = new Array(c), h, u, f = 0; f < c; ++f)
|
|
7214
7251
|
(h = a[f]) && (u = t.call(h, h.__data__, f, a)) && ("__data__" in h && (u.__data__ = h.__data__), l[f] = u, $t(l[f], e, i, f, l, W(h, i)));
|
|
7215
|
-
return new se(
|
|
7252
|
+
return new se(s, this._parents, e, i);
|
|
7216
7253
|
}
|
|
7217
7254
|
function Hu(t) {
|
|
7218
7255
|
var e = this._name, i = this._id;
|
|
7219
7256
|
typeof t != "function" && (t = Sr(t));
|
|
7220
|
-
for (var n = this._groups, r = n.length,
|
|
7257
|
+
for (var n = this._groups, r = n.length, s = [], o = [], a = 0; a < r; ++a)
|
|
7221
7258
|
for (var c = n[a], l = c.length, h, u = 0; u < l; ++u)
|
|
7222
7259
|
if (h = c[u]) {
|
|
7223
7260
|
for (var f = t.call(h, h.__data__, u, c), d, p = W(h, i), m = 0, v = f.length; m < v; ++m)
|
|
7224
7261
|
(d = f[m]) && $t(d, e, i, m, f, p);
|
|
7225
|
-
|
|
7262
|
+
s.push(f), o.push(h);
|
|
7226
7263
|
}
|
|
7227
|
-
return new se(
|
|
7264
|
+
return new se(s, o, e, i);
|
|
7228
7265
|
}
|
|
7229
7266
|
var Yu = nt.prototype.constructor;
|
|
7230
7267
|
function Bu() {
|
|
@@ -7233,8 +7270,8 @@ function Bu() {
|
|
|
7233
7270
|
function Wu(t, e) {
|
|
7234
7271
|
var i, n, r;
|
|
7235
7272
|
return function() {
|
|
7236
|
-
var
|
|
7237
|
-
return
|
|
7273
|
+
var s = $e(this, t), o = (this.style.removeProperty(t), $e(this, t));
|
|
7274
|
+
return s === o ? null : s === i && o === n ? r : r = e(i = s, n = o);
|
|
7238
7275
|
};
|
|
7239
7276
|
}
|
|
7240
7277
|
function Wr(t) {
|
|
@@ -7243,24 +7280,24 @@ function Wr(t) {
|
|
|
7243
7280
|
};
|
|
7244
7281
|
}
|
|
7245
7282
|
function ju(t, e, i) {
|
|
7246
|
-
var n, r = i + "",
|
|
7283
|
+
var n, r = i + "", s;
|
|
7247
7284
|
return function() {
|
|
7248
|
-
var
|
|
7249
|
-
return
|
|
7285
|
+
var o = $e(this, t);
|
|
7286
|
+
return o === r ? null : o === n ? s : s = e(n = o, i);
|
|
7250
7287
|
};
|
|
7251
7288
|
}
|
|
7252
7289
|
function Vu(t, e, i) {
|
|
7253
|
-
var n, r,
|
|
7290
|
+
var n, r, s;
|
|
7254
7291
|
return function() {
|
|
7255
|
-
var
|
|
7256
|
-
return a == null && (c = a = (this.style.removeProperty(t), $e(this, t))),
|
|
7292
|
+
var o = $e(this, t), a = i(this), c = a + "";
|
|
7293
|
+
return a == null && (c = a = (this.style.removeProperty(t), $e(this, t))), o === c ? null : o === n && c === r ? s : (r = c, s = e(n = o, a));
|
|
7257
7294
|
};
|
|
7258
7295
|
}
|
|
7259
7296
|
function Xu(t, e) {
|
|
7260
|
-
var i, n, r,
|
|
7297
|
+
var i, n, r, s = "style." + e, o = "end." + s, a;
|
|
7261
7298
|
return function() {
|
|
7262
|
-
var c = Q(this, t), l = c.on, h = c.value[
|
|
7263
|
-
(l !== i || r !== h) && (n = (i = l).copy()).on(
|
|
7299
|
+
var c = Q(this, t), l = c.on, h = c.value[s] == null ? a || (a = Wr(e)) : void 0;
|
|
7300
|
+
(l !== i || r !== h) && (n = (i = l).copy()).on(o, r = h), c.on = n;
|
|
7264
7301
|
};
|
|
7265
7302
|
}
|
|
7266
7303
|
function qu(t, e, i) {
|
|
@@ -7274,11 +7311,11 @@ function Ju(t, e, i) {
|
|
|
7274
7311
|
}
|
|
7275
7312
|
function Ku(t, e, i) {
|
|
7276
7313
|
var n, r;
|
|
7277
|
-
function
|
|
7278
|
-
var
|
|
7279
|
-
return
|
|
7314
|
+
function s() {
|
|
7315
|
+
var o = e.apply(this, arguments);
|
|
7316
|
+
return o !== r && (n = (r = o) && Ju(t, o, i)), n;
|
|
7280
7317
|
}
|
|
7281
|
-
return
|
|
7318
|
+
return s._value = e, s;
|
|
7282
7319
|
}
|
|
7283
7320
|
function Zu(t, e, i) {
|
|
7284
7321
|
var n = "style." + (t += "");
|
|
@@ -7322,11 +7359,11 @@ function sf(t) {
|
|
|
7322
7359
|
return this.tween(e, rf(t));
|
|
7323
7360
|
}
|
|
7324
7361
|
function of() {
|
|
7325
|
-
for (var t = this._name, e = this._id, i = jr(), n = this._groups, r = n.length,
|
|
7326
|
-
for (var
|
|
7327
|
-
if (c =
|
|
7362
|
+
for (var t = this._name, e = this._id, i = jr(), n = this._groups, r = n.length, s = 0; s < r; ++s)
|
|
7363
|
+
for (var o = n[s], a = o.length, c, l = 0; l < a; ++l)
|
|
7364
|
+
if (c = o[l]) {
|
|
7328
7365
|
var h = W(c, e);
|
|
7329
|
-
$t(c, t, i, l,
|
|
7366
|
+
$t(c, t, i, l, o, {
|
|
7330
7367
|
time: h.time + h.delay + h.duration,
|
|
7331
7368
|
delay: 0,
|
|
7332
7369
|
duration: h.duration,
|
|
@@ -7337,14 +7374,14 @@ function of() {
|
|
|
7337
7374
|
}
|
|
7338
7375
|
function af() {
|
|
7339
7376
|
var t, e, i = this, n = i._id, r = i.size();
|
|
7340
|
-
return new Promise(function(
|
|
7341
|
-
var a = { value:
|
|
7342
|
-
--r === 0 &&
|
|
7377
|
+
return new Promise(function(s, o) {
|
|
7378
|
+
var a = { value: o }, c = { value: function() {
|
|
7379
|
+
--r === 0 && s();
|
|
7343
7380
|
} };
|
|
7344
7381
|
i.each(function() {
|
|
7345
7382
|
var l = Q(this, n), h = l.on;
|
|
7346
7383
|
h !== t && (e = (t = h).copy(), e._.cancel.push(a), e._.interrupt.push(a), e._.end.push(c)), l.on = e;
|
|
7347
|
-
}), r === 0 &&
|
|
7384
|
+
}), r === 0 && s();
|
|
7348
7385
|
});
|
|
7349
7386
|
}
|
|
7350
7387
|
var cf = 0;
|
|
@@ -7406,14 +7443,14 @@ function uf(t, e) {
|
|
|
7406
7443
|
function ff(t) {
|
|
7407
7444
|
var e, i;
|
|
7408
7445
|
t instanceof se ? (e = t._id, t = t._name) : (e = jr(), (i = hf).time = Ei(), t = t == null ? null : t + "");
|
|
7409
|
-
for (var n = this._groups, r = n.length,
|
|
7410
|
-
for (var
|
|
7411
|
-
(c =
|
|
7446
|
+
for (var n = this._groups, r = n.length, s = 0; s < r; ++s)
|
|
7447
|
+
for (var o = n[s], a = o.length, c, l = 0; l < a; ++l)
|
|
7448
|
+
(c = o[l]) && $t(c, t, e, l, o, i || uf(c, e));
|
|
7412
7449
|
return new se(n, this._parents, t, e);
|
|
7413
7450
|
}
|
|
7414
7451
|
nt.prototype.interrupt = Gh;
|
|
7415
7452
|
nt.prototype.transition = ff;
|
|
7416
|
-
class
|
|
7453
|
+
class Yf extends Ti {
|
|
7417
7454
|
name = "viewport";
|
|
7418
7455
|
minScale;
|
|
7419
7456
|
maxScale;
|
|
@@ -7439,15 +7476,15 @@ class Hf extends Ti {
|
|
|
7439
7476
|
onBindActiveScene(e) {
|
|
7440
7477
|
const i = this.topology;
|
|
7441
7478
|
if (!i || !this.canvas) return;
|
|
7442
|
-
const n = this.canvas, r = i.app.stage,
|
|
7479
|
+
const n = this.canvas, r = i.app.stage, s = e.projectionContainer;
|
|
7443
7480
|
this._stageDown = (a) => {
|
|
7444
7481
|
this._hitObject = a.target !== r;
|
|
7445
7482
|
}, r.on("pointerdown", this._stageDown), this.d3Zoom = Zr().scaleExtent([this.minScale, this.maxScale]).filter((a) => a.button || a.ctrlKey && a.type !== "wheel" ? !1 : a.type === "wheel" || a.type === "dblclick" ? !0 : this._dragEnabled && !this._hitObject).on("zoom", (a) => {
|
|
7446
7483
|
const { x: c, y: l, k: h } = a.transform;
|
|
7447
|
-
|
|
7484
|
+
s.scale.set(h), s.position.set(c, l);
|
|
7448
7485
|
}), this.d3Sel = Oh(n), this.d3Sel.call(this.d3Zoom);
|
|
7449
|
-
const
|
|
7450
|
-
this.d3Sel.call(this.d3Zoom.transform,
|
|
7486
|
+
const o = new Ut(s.scale.x, s.x, s.y);
|
|
7487
|
+
this.d3Sel.call(this.d3Zoom.transform, o), e.setCameraHandler((a) => {
|
|
7451
7488
|
if (!this.d3Sel || !this.d3Zoom) {
|
|
7452
7489
|
e.applyCamera(a);
|
|
7453
7490
|
return;
|
|
@@ -7477,8 +7514,8 @@ class Hf extends Ti {
|
|
|
7477
7514
|
}
|
|
7478
7515
|
zoomTo(e, i, n) {
|
|
7479
7516
|
if (!this.d3Sel || !this.d3Zoom || !this.canvas) return;
|
|
7480
|
-
const r = i ?? this.canvas.clientWidth / 2,
|
|
7481
|
-
this.d3Sel.call(this.d3Zoom.scaleTo, e, [r,
|
|
7517
|
+
const r = i ?? this.canvas.clientWidth / 2, s = n ?? this.canvas.clientHeight / 2;
|
|
7518
|
+
this.d3Sel.call(this.d3Zoom.scaleTo, e, [r, s]);
|
|
7482
7519
|
}
|
|
7483
7520
|
panTo(e, i) {
|
|
7484
7521
|
if (!this.d3Sel || !this.d3Zoom) return;
|
|
@@ -7486,7 +7523,7 @@ class Hf extends Ti {
|
|
|
7486
7523
|
this.d3Sel.call(this.d3Zoom.transform, new Ut(n, e, i));
|
|
7487
7524
|
}
|
|
7488
7525
|
}
|
|
7489
|
-
class
|
|
7526
|
+
class Bf extends Ue {
|
|
7490
7527
|
name = "node-editor";
|
|
7491
7528
|
targetType = "node";
|
|
7492
7529
|
get highlightOptions() {
|
|
@@ -7511,7 +7548,7 @@ class Yf extends Ue {
|
|
|
7511
7548
|
e.setOptions({ x: e.x, y: e.y }), i.lines?.redrawLinesForNode(e.id);
|
|
7512
7549
|
}
|
|
7513
7550
|
}
|
|
7514
|
-
class
|
|
7551
|
+
class Wf extends Oe {
|
|
7515
7552
|
name = "line-editor";
|
|
7516
7553
|
editStates = /* @__PURE__ */ new Map();
|
|
7517
7554
|
selectedLineId = null;
|
|
@@ -7523,11 +7560,11 @@ class Bf extends Oe {
|
|
|
7523
7560
|
TEXT_SIZE = 14;
|
|
7524
7561
|
hookScene(e) {
|
|
7525
7562
|
const i = e.lines;
|
|
7526
|
-
for (const
|
|
7527
|
-
const n = (
|
|
7563
|
+
for (const s of i.getAll()) this.attachLine(s, e);
|
|
7564
|
+
const n = (s) => this.attachLine(s, e), r = ({ id: s }) => this.detachLine(s);
|
|
7528
7565
|
return i.on("line:added", n), i.on("line:removed", r), () => {
|
|
7529
7566
|
i.off("line:added", n), i.off("line:removed", r);
|
|
7530
|
-
for (const
|
|
7567
|
+
for (const s of i.getAll()) this.detachLine(s.id);
|
|
7531
7568
|
};
|
|
7532
7569
|
}
|
|
7533
7570
|
onItemPointerDown({ itemType: e, itemId: i }) {
|
|
@@ -7542,12 +7579,12 @@ class Bf extends Oe {
|
|
|
7542
7579
|
n.eventMode = "static", n.cursor = "pointer";
|
|
7543
7580
|
const r = new R();
|
|
7544
7581
|
r.visible = !1, r.zIndex = 1e4, i.projectionContainer.addChild(r);
|
|
7545
|
-
const
|
|
7582
|
+
const s = (a) => {
|
|
7546
7583
|
this.selectedLineId === e.id && this.handlePathDrag(a, e, i);
|
|
7547
|
-
},
|
|
7584
|
+
}, o = () => {
|
|
7548
7585
|
this.selectedLineId === e.id && this.renderMarkers(this.editStates.get(e.id));
|
|
7549
7586
|
};
|
|
7550
|
-
n.on("pointerdown",
|
|
7587
|
+
n.on("pointerdown", s), e.on("points:changed", o), this.editStates.set(e.id, { line: e, scene: i, markersContainer: r, onLinePointerDown: s, onPointsChanged: o });
|
|
7551
7588
|
}
|
|
7552
7589
|
detachLine(e) {
|
|
7553
7590
|
const i = this.editStates.get(e);
|
|
@@ -7584,11 +7621,11 @@ class Bf extends Oe {
|
|
|
7584
7621
|
e && (this.savedZIndex !== null && (e.line.getContainer().zIndex = this.savedZIndex, this.savedZIndex = null), this.selectedLineId = null, this.cancelDrag(), e.markersContainer.visible = !1, e.markersContainer.removeChildren());
|
|
7585
7622
|
}
|
|
7586
7623
|
renderMarkers(e) {
|
|
7587
|
-
const { line: i, scene: n, markersContainer: r } = e,
|
|
7588
|
-
r.removeChildren(),
|
|
7589
|
-
const c = i.resolveAnchorPosition(
|
|
7624
|
+
const { line: i, scene: n, markersContainer: r } = e, s = i.options.anchor;
|
|
7625
|
+
r.removeChildren(), s.forEach((o, a) => {
|
|
7626
|
+
const c = i.resolveAnchorPosition(o);
|
|
7590
7627
|
if (!c) return;
|
|
7591
|
-
const l = i.isAnchorNode(
|
|
7628
|
+
const l = i.isAnchorNode(o), h = this.createMarker(a, l);
|
|
7592
7629
|
h.position.set(c.x * g, c.y * g), l || (h.eventMode = "static", h.cursor = "grab", h.on("pointerdown", (u) => {
|
|
7593
7630
|
u.stopPropagation(), this.startAnchorDrag(i.id, a, n, !1);
|
|
7594
7631
|
})), r.addChild(h);
|
|
@@ -7597,18 +7634,18 @@ class Bf extends Oe {
|
|
|
7597
7634
|
createMarker(e, i) {
|
|
7598
7635
|
const n = new R(), r = new L();
|
|
7599
7636
|
r.circle(0, 0, this.RADIUS), r.fill({ color: i ? this.COLOR_NODE : this.COLOR_POSITION, alpha: i ? 0.5 : 1 }), r.stroke({ color: 16777215, width: 2, alpha: i ? 0.4 : 0.8 });
|
|
7600
|
-
const
|
|
7601
|
-
return
|
|
7637
|
+
const s = new vn({ text: e.toString(), style: { fontSize: this.TEXT_SIZE, fill: this.TEXT_COLOR, fontWeight: "bold" } });
|
|
7638
|
+
return s.anchor.set(0.5), n.addChild(r, s), n;
|
|
7602
7639
|
}
|
|
7603
7640
|
startAnchorDrag(e, i, n, r) {
|
|
7604
7641
|
this.cancelDrag();
|
|
7605
|
-
const
|
|
7606
|
-
if (!
|
|
7607
|
-
const
|
|
7608
|
-
const u =
|
|
7609
|
-
|
|
7642
|
+
const s = this.editStates.get(e);
|
|
7643
|
+
if (!s) return;
|
|
7644
|
+
const o = n.projectionContainer, a = n.stage, c = (h) => {
|
|
7645
|
+
const u = o.toLocal(h.global), f = J(u.x) / g, d = J(u.y) / g;
|
|
7646
|
+
s.line.updateAnchorPosition(i, f, d), this.renderMarkers(s);
|
|
7610
7647
|
}, l = () => {
|
|
7611
|
-
a.off("globalpointermove", c), a.off("pointerup", l), a.off("pointerupoutside", l), this.dragCtx = null,
|
|
7648
|
+
a.off("globalpointermove", c), a.off("pointerup", l), a.off("pointerupoutside", l), this.dragCtx = null, s.line.draw(), this.renderMarkers(s);
|
|
7612
7649
|
};
|
|
7613
7650
|
a.on("globalpointermove", c), a.on("pointerup", l), a.on("pointerupoutside", l), this.dragCtx = { lineId: e, anchorIndex: i, isNewAnchor: r, onMove: c, onUp: l };
|
|
7614
7651
|
}
|
|
@@ -7622,14 +7659,14 @@ class Bf extends Oe {
|
|
|
7622
7659
|
this.dragCtx = null;
|
|
7623
7660
|
}
|
|
7624
7661
|
handlePathDrag(e, i, n) {
|
|
7625
|
-
const r = n.projectionContainer,
|
|
7662
|
+
const r = n.projectionContainer, s = r.toLocal(e.global), o = J(s.x) / g, a = J(s.y) / g, c = i.options.anchor;
|
|
7626
7663
|
for (const x of c) {
|
|
7627
7664
|
const w = i.resolveAnchorPosition(x);
|
|
7628
|
-
if (w && w.x ===
|
|
7665
|
+
if (w && w.x === o && w.y === a) return;
|
|
7629
7666
|
}
|
|
7630
7667
|
const l = i.getPoints();
|
|
7631
7668
|
if (l.length < 2) return;
|
|
7632
|
-
const h = { x:
|
|
7669
|
+
const h = { x: o * g, y: a * g };
|
|
7633
7670
|
let u = 1 / 0, f = 0;
|
|
7634
7671
|
for (let x = 0; x < l.length - 1; x++) {
|
|
7635
7672
|
const w = wa(h, l[x], l[x + 1]);
|
|
@@ -7649,29 +7686,29 @@ class Bf extends Oe {
|
|
|
7649
7686
|
p.on("globalpointermove", v), p.on("pointerup", _), p.on("pointerupoutside", _);
|
|
7650
7687
|
}
|
|
7651
7688
|
findAnchorInsertIndex(e, i, n) {
|
|
7652
|
-
const r = e.options.anchor,
|
|
7689
|
+
const r = e.options.anchor, s = e.getPoints();
|
|
7653
7690
|
if (r.length <= 2) return 1;
|
|
7654
|
-
const
|
|
7691
|
+
const o = [];
|
|
7655
7692
|
for (let c = 0; c < r.length; c++) {
|
|
7656
7693
|
const l = e.resolveAnchorPosition(r[c]);
|
|
7657
|
-
l &&
|
|
7694
|
+
l && o.push({ px: l.x * g, py: l.y * g, anchorIdx: c });
|
|
7658
7695
|
}
|
|
7659
7696
|
const a = [];
|
|
7660
|
-
for (const c of
|
|
7697
|
+
for (const c of o) {
|
|
7661
7698
|
let l = 0, h = 1 / 0;
|
|
7662
|
-
for (let u = 0; u <
|
|
7663
|
-
const f =
|
|
7699
|
+
for (let u = 0; u < s.length; u++) {
|
|
7700
|
+
const f = s[u].x - c.px, d = s[u].y - c.py, p = f * f + d * d;
|
|
7664
7701
|
p < h && (h = p, l = u);
|
|
7665
7702
|
}
|
|
7666
7703
|
a.push(l);
|
|
7667
7704
|
}
|
|
7668
7705
|
for (let c = 0; c < a.length - 1; c++)
|
|
7669
7706
|
if (n >= a[c] && n < a[c + 1])
|
|
7670
|
-
return
|
|
7707
|
+
return o[c].anchorIdx + 1;
|
|
7671
7708
|
return r.length - 1;
|
|
7672
7709
|
}
|
|
7673
7710
|
}
|
|
7674
|
-
class
|
|
7711
|
+
class jf extends Ue {
|
|
7675
7712
|
name = "text-editor";
|
|
7676
7713
|
targetType = "text";
|
|
7677
7714
|
step;
|
|
@@ -7698,7 +7735,7 @@ class Wf extends Ue {
|
|
|
7698
7735
|
e.setOptions({ x: i, y: n });
|
|
7699
7736
|
}
|
|
7700
7737
|
}
|
|
7701
|
-
class
|
|
7738
|
+
class Vf extends Ue {
|
|
7702
7739
|
name = "rect-drag";
|
|
7703
7740
|
targetType = "rect";
|
|
7704
7741
|
step;
|
|
@@ -7722,8 +7759,8 @@ class jf extends Ue {
|
|
|
7722
7759
|
e.setOptions({ x: i, y: n });
|
|
7723
7760
|
}
|
|
7724
7761
|
onAttachItem(e) {
|
|
7725
|
-
const i = (
|
|
7726
|
-
this.selected?.id ===
|
|
7762
|
+
const i = (s) => this.selectItem(s), n = (s) => {
|
|
7763
|
+
this.selected?.id === s.id && this.clearSelection();
|
|
7727
7764
|
}, r = () => {
|
|
7728
7765
|
this.selected?.id === e.id && this.highlight.draw(e.getGraphics());
|
|
7729
7766
|
};
|
|
@@ -7732,7 +7769,7 @@ class jf extends Ue {
|
|
|
7732
7769
|
};
|
|
7733
7770
|
}
|
|
7734
7771
|
}
|
|
7735
|
-
class
|
|
7772
|
+
class Xf extends Oe {
|
|
7736
7773
|
name = "rect-resize";
|
|
7737
7774
|
resizeHandles;
|
|
7738
7775
|
activeRect = null;
|
|
@@ -7750,13 +7787,13 @@ class Vf extends Oe {
|
|
|
7750
7787
|
}
|
|
7751
7788
|
hookScene(e) {
|
|
7752
7789
|
const { rects: i } = e;
|
|
7753
|
-
for (const
|
|
7754
|
-
const n = (
|
|
7755
|
-
for (const
|
|
7790
|
+
for (const o of i.getAll()) this.attachListeners(o);
|
|
7791
|
+
const n = (o) => this.attachListeners(o), r = ({ id: o }) => this.detachListeners(o), s = () => {
|
|
7792
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
7756
7793
|
};
|
|
7757
|
-
return i.on("rect:added", n), i.on("rect:removed", r), i.on("rects:cleared",
|
|
7758
|
-
i.off("rect:added", n), i.off("rect:removed", r), i.off("rects:cleared",
|
|
7759
|
-
for (const
|
|
7794
|
+
return i.on("rect:added", n), i.on("rect:removed", r), i.on("rects:cleared", s), () => {
|
|
7795
|
+
i.off("rect:added", n), i.off("rect:removed", r), i.off("rects:cleared", s);
|
|
7796
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
7760
7797
|
};
|
|
7761
7798
|
}
|
|
7762
7799
|
onSceneSwitched() {
|
|
@@ -7787,7 +7824,7 @@ class Vf extends Oe {
|
|
|
7787
7824
|
}
|
|
7788
7825
|
drawResizeHandles(e) {
|
|
7789
7826
|
this.cleanupResizeHandles();
|
|
7790
|
-
const i = e.getGraphics(), n = i.getLocalBounds(), r = 8,
|
|
7827
|
+
const i = e.getGraphics(), n = i.getLocalBounds(), r = 8, s = 4886754, o = 16777215, a = new R();
|
|
7791
7828
|
a.position.copyFrom(i.position);
|
|
7792
7829
|
const c = [
|
|
7793
7830
|
{ type: "nw", x: n.x, y: n.y, cursor: "nw-resize" },
|
|
@@ -7804,7 +7841,7 @@ class Vf extends Oe {
|
|
|
7804
7841
|
if (!h) return;
|
|
7805
7842
|
c.forEach(({ type: p, x: m, y: v, cursor: _ }) => {
|
|
7806
7843
|
const x = new L();
|
|
7807
|
-
x.rect(-r / 2, -r / 2, r, r), x.fill({ color:
|
|
7844
|
+
x.rect(-r / 2, -r / 2, r, r), x.fill({ color: s }), x.stroke({ color: o, width: 2 }), x.position.set(m, v), x.eventMode = "static", x.cursor = _, x.on("pointerdown", (w) => {
|
|
7808
7845
|
w.stopPropagation(), this.resizeState.isResizing = !0, this.resizeState.handle = p;
|
|
7809
7846
|
const S = h.projectionContainer.toLocal(w.global);
|
|
7810
7847
|
this.resizeState.startMouse = { x: S.x, y: S.y }, this.resizeState.startRect = { x: e.x, y: e.y, width: e.options.width, height: e.options.height };
|
|
@@ -7834,40 +7871,40 @@ class Vf extends Oe {
|
|
|
7834
7871
|
this.resizeHandles.position.copyFrom(i.position);
|
|
7835
7872
|
}
|
|
7836
7873
|
applyResize(e, i, n, r) {
|
|
7837
|
-
const { startRect:
|
|
7838
|
-
let
|
|
7874
|
+
const { startRect: s } = this.resizeState;
|
|
7875
|
+
let o = s.x, a = s.y, c = s.width, l = s.height;
|
|
7839
7876
|
switch (i) {
|
|
7840
7877
|
case "nw":
|
|
7841
|
-
|
|
7878
|
+
o = s.x + n, a = s.y + r, c = s.width - n, l = s.height - r;
|
|
7842
7879
|
break;
|
|
7843
7880
|
case "n":
|
|
7844
|
-
a =
|
|
7881
|
+
a = s.y + r, l = s.height - r;
|
|
7845
7882
|
break;
|
|
7846
7883
|
case "ne":
|
|
7847
|
-
a =
|
|
7884
|
+
a = s.y + r, c = s.width + n, l = s.height - r;
|
|
7848
7885
|
break;
|
|
7849
7886
|
case "e":
|
|
7850
|
-
c =
|
|
7887
|
+
c = s.width + n;
|
|
7851
7888
|
break;
|
|
7852
7889
|
case "se":
|
|
7853
|
-
c =
|
|
7890
|
+
c = s.width + n, l = s.height + r;
|
|
7854
7891
|
break;
|
|
7855
7892
|
case "s":
|
|
7856
|
-
l =
|
|
7893
|
+
l = s.height + r;
|
|
7857
7894
|
break;
|
|
7858
7895
|
case "sw":
|
|
7859
|
-
|
|
7896
|
+
o = s.x + n, c = s.width - n, l = s.height + r;
|
|
7860
7897
|
break;
|
|
7861
7898
|
case "w":
|
|
7862
|
-
|
|
7899
|
+
o = s.x + n, c = s.width - n;
|
|
7863
7900
|
break;
|
|
7864
7901
|
}
|
|
7865
|
-
c < 0 && (
|
|
7902
|
+
c < 0 && (o += c, c = -c), l < 0 && (a += l, l = -l), o = Math.round(o / this.step) * this.step, a = Math.round(a / this.step) * this.step, c = Math.round(c / this.step) * this.step, l = Math.round(l / this.step) * this.step;
|
|
7866
7903
|
const h = this.step;
|
|
7867
|
-
c < h && (c = h), l < h && (l = h), e.setOptions({ x:
|
|
7904
|
+
c < h && (c = h), l < h && (l = h), e.setOptions({ x: o, y: a, width: c, height: l }), this.drawResizeHandles(e);
|
|
7868
7905
|
}
|
|
7869
7906
|
}
|
|
7870
|
-
class
|
|
7907
|
+
class qf extends Ue {
|
|
7871
7908
|
name = "image-editor";
|
|
7872
7909
|
targetType = "image";
|
|
7873
7910
|
get highlightOptions() {
|
|
@@ -7889,8 +7926,8 @@ class Xf extends Ue {
|
|
|
7889
7926
|
e.setOptions({ x: i, y: n });
|
|
7890
7927
|
}
|
|
7891
7928
|
onAttachItem(e) {
|
|
7892
|
-
const i = (
|
|
7893
|
-
this.selected?.id ===
|
|
7929
|
+
const i = (s) => this.selectItem(s), n = (s) => {
|
|
7930
|
+
this.selected?.id === s.id && this.clearSelection();
|
|
7894
7931
|
}, r = () => {
|
|
7895
7932
|
this.selected?.id === e.id && this.highlight.draw(e.getGraphics());
|
|
7896
7933
|
};
|
|
@@ -7899,7 +7936,7 @@ class Xf extends Ue {
|
|
|
7899
7936
|
};
|
|
7900
7937
|
}
|
|
7901
7938
|
}
|
|
7902
|
-
class
|
|
7939
|
+
class Jf extends Ue {
|
|
7903
7940
|
name = "fence-editor";
|
|
7904
7941
|
targetType = "fence";
|
|
7905
7942
|
/** 围栏不显示选中高亮框(由 FenceEndpointPlugin 提供可视化) */
|
|
@@ -7922,10 +7959,10 @@ class qf extends Ue {
|
|
|
7922
7959
|
e.setOptions({ x: i, y: n });
|
|
7923
7960
|
}
|
|
7924
7961
|
onAttachItem(e) {
|
|
7925
|
-
const i = (
|
|
7926
|
-
this.selectItem(
|
|
7927
|
-
}, n = (
|
|
7928
|
-
this.selected?.id ===
|
|
7962
|
+
const i = (s) => {
|
|
7963
|
+
this.selectItem(s);
|
|
7964
|
+
}, n = (s) => {
|
|
7965
|
+
this.selected?.id === s.id && this.clearSelection();
|
|
7929
7966
|
}, r = () => {
|
|
7930
7967
|
};
|
|
7931
7968
|
return e.on("item:selected", i), e.on("item:deselected", n), e.on("options:changed", r), () => {
|
|
@@ -7933,7 +7970,7 @@ class qf extends Ue {
|
|
|
7933
7970
|
};
|
|
7934
7971
|
}
|
|
7935
7972
|
}
|
|
7936
|
-
class
|
|
7973
|
+
class Kf extends Oe {
|
|
7937
7974
|
name = "fence-endpoint";
|
|
7938
7975
|
handleContainer;
|
|
7939
7976
|
activeFence = null;
|
|
@@ -7947,13 +7984,13 @@ class Jf extends Oe {
|
|
|
7947
7984
|
fenceListeners = /* @__PURE__ */ new Map();
|
|
7948
7985
|
hookScene(e) {
|
|
7949
7986
|
const { fences: i } = e;
|
|
7950
|
-
for (const
|
|
7951
|
-
const n = (
|
|
7952
|
-
for (const
|
|
7987
|
+
for (const o of i.getAll()) this.attachListeners(o);
|
|
7988
|
+
const n = (o) => this.attachListeners(o), r = ({ id: o }) => this.detachListeners(o), s = () => {
|
|
7989
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
7953
7990
|
};
|
|
7954
|
-
return i.on("fence:added", n), i.on("fence:removed", r), i.on("fences:cleared",
|
|
7955
|
-
i.off("fence:added", n), i.off("fence:removed", r), i.off("fences:cleared",
|
|
7956
|
-
for (const
|
|
7991
|
+
return i.on("fence:added", n), i.on("fence:removed", r), i.on("fences:cleared", s), () => {
|
|
7992
|
+
i.off("fence:added", n), i.off("fence:removed", r), i.off("fences:cleared", s);
|
|
7993
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
7957
7994
|
};
|
|
7958
7995
|
}
|
|
7959
7996
|
onSceneSwitched() {
|
|
@@ -8007,11 +8044,11 @@ class Jf extends Oe {
|
|
|
8007
8044
|
* 根据起点和终点坐标推断最佳方向和长度。
|
|
8008
8045
|
* 选择偏移量较大的轴作为方向轴,保留竖立/平铺特征。
|
|
8009
8046
|
*/
|
|
8010
|
-
inferDirectionAndLength(e, i, n, r,
|
|
8011
|
-
const
|
|
8012
|
-
if (Math.abs(
|
|
8013
|
-
const l = Math.max(1, Math.abs(
|
|
8014
|
-
return
|
|
8047
|
+
inferDirectionAndLength(e, i, n, r, s) {
|
|
8048
|
+
const o = n - e, a = r - i, c = this.isVerticalWall(s);
|
|
8049
|
+
if (Math.abs(o) >= Math.abs(a)) {
|
|
8050
|
+
const l = Math.max(1, Math.abs(o));
|
|
8051
|
+
return o >= 0 ? { direction: c ? "+x" : "x", length: l, x: e, y: i } : { direction: c ? "-x" : "x", length: l, x: c ? e : e + o, y: i };
|
|
8015
8052
|
} else {
|
|
8016
8053
|
const l = Math.max(1, Math.abs(a));
|
|
8017
8054
|
return a >= 0 ? { direction: c ? "+y" : "y", length: l, x: e, y: i } : { direction: c ? "-y" : "y", length: l, x: e, y: c ? i : i + a };
|
|
@@ -8024,9 +8061,9 @@ class Jf extends Oe {
|
|
|
8024
8061
|
if (!i) return;
|
|
8025
8062
|
const n = i.activeScene;
|
|
8026
8063
|
if (!n) return;
|
|
8027
|
-
const { x: r, y:
|
|
8028
|
-
x: (r + l.dx *
|
|
8029
|
-
y: (
|
|
8064
|
+
const { x: r, y: s, length: o = 4, height: a = 60, direction: c = "+x" } = e.options, l = this.getDirectionVector(c), h = { x: r * g - g / 2, y: s * g - g / 2 }, u = {
|
|
8065
|
+
x: (r + l.dx * o) * g - g / 2,
|
|
8066
|
+
y: (s + l.dy * o) * g - g / 2
|
|
8030
8067
|
}, f = new R();
|
|
8031
8068
|
f.zIndex = 1e9;
|
|
8032
8069
|
const d = 10, p = new L();
|
|
@@ -8035,7 +8072,7 @@ class Jf extends Oe {
|
|
|
8035
8072
|
m.circle(0, 0, d / 2), m.fill({ color: 14830154 }), m.stroke({ color: 16777215, width: 2 }), m.position.set(u.x, u.y), m.eventMode = "static", m.cursor = "move", m.on("pointerdown", (b) => this.onHandleDown(b, "end", e, n)), f.addChild(m);
|
|
8036
8073
|
const v = new L();
|
|
8037
8074
|
if (v.moveTo(h.x, h.y), v.lineTo(u.x, u.y), v.stroke({ color: 4886754, width: 1.5, alpha: 0.4 }), v.eventMode = "none", f.addChild(v), this.isVerticalWall(c)) {
|
|
8038
|
-
const b = this.createHeightHandle(e, h, c,
|
|
8075
|
+
const b = this.createHeightHandle(e, h, c, o, a, n);
|
|
8039
8076
|
f.addChild(b);
|
|
8040
8077
|
}
|
|
8041
8078
|
const _ = (b) => {
|
|
@@ -8070,16 +8107,16 @@ class Jf extends Oe {
|
|
|
8070
8107
|
return { a: 1, b: 0 };
|
|
8071
8108
|
}
|
|
8072
8109
|
}
|
|
8073
|
-
createHeightHandle(e, i, n, r,
|
|
8074
|
-
const a = new L(), c = r * g, l = D, h = Math.sin(Math.PI / 4), u = -h * l *
|
|
8075
|
-
return a.moveTo(m, v), a.lineTo(_, x), a.stroke({ color: 16755200, width: 6, alpha: 0.8 }), a.eventMode = "static", a.cursor = "ns-resize", a.on("pointerdown", (w) => this.onHandleDown(w, "height", e,
|
|
8110
|
+
createHeightHandle(e, i, n, r, s, o) {
|
|
8111
|
+
const a = new L(), c = r * g, l = D, h = Math.sin(Math.PI / 4), u = -h * l * s, f = -h * l * s, { a: d, b: p } = this.getVisualAlongCoeffs(n), m = i.x + u, v = i.y + f, _ = i.x + d * c + u, x = i.y + p * c + f;
|
|
8112
|
+
return a.moveTo(m, v), a.lineTo(_, x), a.stroke({ color: 16755200, width: 6, alpha: 0.8 }), a.eventMode = "static", a.cursor = "ns-resize", a.on("pointerdown", (w) => this.onHandleDown(w, "height", e, o)), a;
|
|
8076
8113
|
}
|
|
8077
8114
|
onHandleDown(e, i, n, r) {
|
|
8078
8115
|
e.stopPropagation();
|
|
8079
|
-
const { x:
|
|
8116
|
+
const { x: s, y: o, length: a = 4, height: c = 60, direction: l = "+x" } = n.options;
|
|
8080
8117
|
this.dragState.isDragging = !0, this.dragState.handle = i;
|
|
8081
8118
|
const h = r.projectionContainer.toLocal(e.global);
|
|
8082
|
-
this.dragState.startMouse = { x: h.x, y: h.y }, this.dragState.startFence = { x:
|
|
8119
|
+
this.dragState.startMouse = { x: h.x, y: h.y }, this.dragState.startFence = { x: s, y: o, length: a, height: c, direction: l };
|
|
8083
8120
|
}
|
|
8084
8121
|
cleanupHandles() {
|
|
8085
8122
|
if (this.globalHandlers) {
|
|
@@ -8090,17 +8127,17 @@ class Jf extends Oe {
|
|
|
8090
8127
|
}
|
|
8091
8128
|
/* ── 端点拖拽(自由方向) ── */
|
|
8092
8129
|
applyEndpointDrag(e, i, n, r) {
|
|
8093
|
-
const
|
|
8094
|
-
|
|
8130
|
+
const s = r.projectionContainer.toLocal(n.global), { startFence: o } = this.dragState, a = this.getDirectionVector(o.direction), c = { x: o.x, y: o.y };
|
|
8131
|
+
o.x + a.dx * o.length, o.y + a.dy * o.length;
|
|
8095
8132
|
const l = {
|
|
8096
|
-
x: Math.round(
|
|
8097
|
-
y: Math.round(
|
|
8133
|
+
x: Math.round(s.x / g),
|
|
8134
|
+
y: Math.round(s.y / g)
|
|
8098
8135
|
};
|
|
8099
8136
|
if (i === "start") {
|
|
8100
8137
|
const h = l.x - c.x, u = l.y - c.y;
|
|
8101
8138
|
e.setOptions({
|
|
8102
|
-
x:
|
|
8103
|
-
y:
|
|
8139
|
+
x: o.x + h,
|
|
8140
|
+
y: o.y + u
|
|
8104
8141
|
});
|
|
8105
8142
|
} else {
|
|
8106
8143
|
const h = this.inferDirectionAndLength(
|
|
@@ -8108,7 +8145,7 @@ class Jf extends Oe {
|
|
|
8108
8145
|
c.y,
|
|
8109
8146
|
l.x,
|
|
8110
8147
|
l.y,
|
|
8111
|
-
|
|
8148
|
+
o.direction
|
|
8112
8149
|
);
|
|
8113
8150
|
if (h.length < 1) return;
|
|
8114
8151
|
e.setOptions({
|
|
@@ -8122,11 +8159,11 @@ class Jf extends Oe {
|
|
|
8122
8159
|
}
|
|
8123
8160
|
/* ── 高度拖拽 ── */
|
|
8124
8161
|
applyHeightDrag(e, i, n) {
|
|
8125
|
-
const r = n.projectionContainer.toLocal(i.global), { startFence:
|
|
8162
|
+
const r = n.projectionContainer.toLocal(i.global), { startFence: s, startMouse: o } = this.dragState, a = r.x - o.x, c = r.y - o.y, l = -(a + c) / Math.SQRT2, h = Math.max(20, Math.round(s.height + l / D));
|
|
8126
8163
|
e.setOptions({ height: h }), this.drawHandles(e);
|
|
8127
8164
|
}
|
|
8128
8165
|
}
|
|
8129
|
-
class
|
|
8166
|
+
class Zf extends Ue {
|
|
8130
8167
|
name = "wave-editor";
|
|
8131
8168
|
targetType = "wave";
|
|
8132
8169
|
get highlightOptions() {
|
|
@@ -8148,8 +8185,8 @@ class Kf extends Ue {
|
|
|
8148
8185
|
e.setOptions({ x: i, y: n });
|
|
8149
8186
|
}
|
|
8150
8187
|
onAttachItem(e) {
|
|
8151
|
-
const i = (
|
|
8152
|
-
this.selected?.id ===
|
|
8188
|
+
const i = (s) => this.selectItem(s), n = (s) => {
|
|
8189
|
+
this.selected?.id === s.id && this.clearSelection();
|
|
8153
8190
|
}, r = () => {
|
|
8154
8191
|
this.selected?.id === e.id && this.highlight.draw(e.getGraphics());
|
|
8155
8192
|
};
|
|
@@ -8158,7 +8195,7 @@ class Kf extends Ue {
|
|
|
8158
8195
|
};
|
|
8159
8196
|
}
|
|
8160
8197
|
}
|
|
8161
|
-
class
|
|
8198
|
+
class Qf extends Oe {
|
|
8162
8199
|
name = "wave-resize";
|
|
8163
8200
|
resizeHandles;
|
|
8164
8201
|
activeWave = null;
|
|
@@ -8176,13 +8213,13 @@ class Zf extends Oe {
|
|
|
8176
8213
|
}
|
|
8177
8214
|
hookScene(e) {
|
|
8178
8215
|
const { waves: i } = e;
|
|
8179
|
-
for (const
|
|
8180
|
-
const n = (
|
|
8181
|
-
for (const
|
|
8216
|
+
for (const o of i.getAll()) this.attachListeners(o);
|
|
8217
|
+
const n = (o) => this.attachListeners(o), r = ({ id: o }) => this.detachListeners(o), s = () => {
|
|
8218
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
8182
8219
|
};
|
|
8183
|
-
return i.on("wave:added", n), i.on("wave:removed", r), i.on("waves:cleared",
|
|
8184
|
-
i.off("wave:added", n), i.off("wave:removed", r), i.off("waves:cleared",
|
|
8185
|
-
for (const
|
|
8220
|
+
return i.on("wave:added", n), i.on("wave:removed", r), i.on("waves:cleared", s), () => {
|
|
8221
|
+
i.off("wave:added", n), i.off("wave:removed", r), i.off("waves:cleared", s);
|
|
8222
|
+
for (const o of i.getAll()) this.detachListeners(o.id);
|
|
8186
8223
|
};
|
|
8187
8224
|
}
|
|
8188
8225
|
onSceneSwitched() {
|
|
@@ -8213,7 +8250,7 @@ class Zf extends Oe {
|
|
|
8213
8250
|
}
|
|
8214
8251
|
drawResizeHandles(e) {
|
|
8215
8252
|
this.cleanupResizeHandles();
|
|
8216
|
-
const i = e.getGraphics(), n = i.getLocalBounds(), r = 8,
|
|
8253
|
+
const i = e.getGraphics(), n = i.getLocalBounds(), r = 8, s = 4886754, o = 16777215, a = new R();
|
|
8217
8254
|
a.position.copyFrom(i.position), a.zIndex = 1e9;
|
|
8218
8255
|
const c = [
|
|
8219
8256
|
{ type: "nw", x: n.x, y: n.y, cursor: "nw-resize" },
|
|
@@ -8230,7 +8267,7 @@ class Zf extends Oe {
|
|
|
8230
8267
|
if (!h) return;
|
|
8231
8268
|
c.forEach(({ type: p, x: m, y: v, cursor: _ }) => {
|
|
8232
8269
|
const x = new L();
|
|
8233
|
-
x.rect(-r / 2, -r / 2, r, r), x.fill({ color:
|
|
8270
|
+
x.rect(-r / 2, -r / 2, r, r), x.fill({ color: s }), x.stroke({ color: o, width: 2 }), x.position.set(m, v), x.eventMode = "static", x.cursor = _, x.on("pointerdown", (w) => {
|
|
8234
8271
|
w.stopPropagation(), this.resizeState.isResizing = !0, this.resizeState.handle = p;
|
|
8235
8272
|
const S = h.projectionContainer.toLocal(w.global);
|
|
8236
8273
|
this.resizeState.startMouse = { x: S.x, y: S.y }, this.resizeState.startRect = { x: e.x, y: e.y, width: e.width, height: e.height };
|
|
@@ -8267,41 +8304,41 @@ class Zf extends Oe {
|
|
|
8267
8304
|
* 例如拖拽 "e" 手柄向右 1 tile,width 增加 2(左右各扩展 1)。
|
|
8268
8305
|
*/
|
|
8269
8306
|
applyResize(e, i, n, r) {
|
|
8270
|
-
const { startRect:
|
|
8271
|
-
let
|
|
8307
|
+
const { startRect: s } = this.resizeState;
|
|
8308
|
+
let o = 0, a = 0;
|
|
8272
8309
|
switch (i) {
|
|
8273
8310
|
case "nw":
|
|
8274
|
-
|
|
8311
|
+
o = -n * 2, a = -r * 2;
|
|
8275
8312
|
break;
|
|
8276
8313
|
case "n":
|
|
8277
8314
|
a = -r * 2;
|
|
8278
8315
|
break;
|
|
8279
8316
|
case "ne":
|
|
8280
|
-
|
|
8317
|
+
o = n * 2, a = -r * 2;
|
|
8281
8318
|
break;
|
|
8282
8319
|
case "e":
|
|
8283
|
-
|
|
8320
|
+
o = n * 2;
|
|
8284
8321
|
break;
|
|
8285
8322
|
case "se":
|
|
8286
|
-
|
|
8323
|
+
o = n * 2, a = r * 2;
|
|
8287
8324
|
break;
|
|
8288
8325
|
case "s":
|
|
8289
8326
|
a = r * 2;
|
|
8290
8327
|
break;
|
|
8291
8328
|
case "sw":
|
|
8292
|
-
|
|
8329
|
+
o = -n * 2, a = r * 2;
|
|
8293
8330
|
break;
|
|
8294
8331
|
case "w":
|
|
8295
|
-
|
|
8332
|
+
o = -n * 2;
|
|
8296
8333
|
break;
|
|
8297
8334
|
}
|
|
8298
|
-
let c =
|
|
8335
|
+
let c = s.width + o, l = s.height + a;
|
|
8299
8336
|
c = Math.round(c / this.step) * this.step, l = Math.round(l / this.step) * this.step;
|
|
8300
8337
|
const h = this.step;
|
|
8301
8338
|
c < h && (c = h), l < h && (l = h), e.setOptions({ width: c, height: l }), this.drawResizeHandles(e);
|
|
8302
8339
|
}
|
|
8303
8340
|
}
|
|
8304
|
-
class
|
|
8341
|
+
class ed extends Pe {
|
|
8305
8342
|
name = "node-runtime";
|
|
8306
8343
|
targetType = "node";
|
|
8307
8344
|
getCollection(e) {
|
|
@@ -8311,7 +8348,7 @@ class Qf extends Pe {
|
|
|
8311
8348
|
return e.id;
|
|
8312
8349
|
}
|
|
8313
8350
|
}
|
|
8314
|
-
class
|
|
8351
|
+
class td extends Pe {
|
|
8315
8352
|
name = "line-runtime";
|
|
8316
8353
|
targetType = "line";
|
|
8317
8354
|
getCollection(e) {
|
|
@@ -8321,7 +8358,7 @@ class ed extends Pe {
|
|
|
8321
8358
|
return e.id;
|
|
8322
8359
|
}
|
|
8323
8360
|
}
|
|
8324
|
-
class
|
|
8361
|
+
class id extends Pe {
|
|
8325
8362
|
name = "text-runtime";
|
|
8326
8363
|
targetType = "text";
|
|
8327
8364
|
getCollection(e) {
|
|
@@ -8331,7 +8368,7 @@ class td extends Pe {
|
|
|
8331
8368
|
return e.id;
|
|
8332
8369
|
}
|
|
8333
8370
|
}
|
|
8334
|
-
class
|
|
8371
|
+
class nd extends Pe {
|
|
8335
8372
|
name = "rect-runtime";
|
|
8336
8373
|
targetType = "rect";
|
|
8337
8374
|
getCollection(e) {
|
|
@@ -8341,7 +8378,7 @@ class id extends Pe {
|
|
|
8341
8378
|
return e.id;
|
|
8342
8379
|
}
|
|
8343
8380
|
}
|
|
8344
|
-
class
|
|
8381
|
+
class rd extends Pe {
|
|
8345
8382
|
name = "image-runtime";
|
|
8346
8383
|
targetType = "image";
|
|
8347
8384
|
getCollection(e) {
|
|
@@ -8351,7 +8388,7 @@ class nd extends Pe {
|
|
|
8351
8388
|
return e.id;
|
|
8352
8389
|
}
|
|
8353
8390
|
}
|
|
8354
|
-
class
|
|
8391
|
+
class sd extends Pe {
|
|
8355
8392
|
name = "fence-runtime";
|
|
8356
8393
|
targetType = "fence";
|
|
8357
8394
|
getCollection(e) {
|
|
@@ -8361,7 +8398,7 @@ class rd extends Pe {
|
|
|
8361
8398
|
return e.id;
|
|
8362
8399
|
}
|
|
8363
8400
|
}
|
|
8364
|
-
class
|
|
8401
|
+
class od extends Pe {
|
|
8365
8402
|
name = "wave-runtime";
|
|
8366
8403
|
targetType = "wave";
|
|
8367
8404
|
getCollection(e) {
|
|
@@ -8448,13 +8485,13 @@ class Me extends Ti {
|
|
|
8448
8485
|
if (!e) return;
|
|
8449
8486
|
const { panningKey: i, rightClickToStop: n } = this._opts, r = (a) => {
|
|
8450
8487
|
i && a.code === i && !this._panning && (a.preventDefault(), this._beginPan());
|
|
8451
|
-
}, o = (a) => {
|
|
8452
|
-
i && a.code === i && this._panning && this._endPan();
|
|
8453
8488
|
}, s = (a) => {
|
|
8489
|
+
i && a.code === i && this._panning && this._endPan();
|
|
8490
|
+
}, o = (a) => {
|
|
8454
8491
|
n && (a.preventDefault(), this.stop());
|
|
8455
8492
|
};
|
|
8456
|
-
window.addEventListener("keydown", r), window.addEventListener("keyup",
|
|
8457
|
-
window.removeEventListener("keydown", r), window.removeEventListener("keyup",
|
|
8493
|
+
window.addEventListener("keydown", r), window.addEventListener("keyup", s), e.addEventListener("contextmenu", o), this._cleanupKeys = () => {
|
|
8494
|
+
window.removeEventListener("keydown", r), window.removeEventListener("keyup", s), e.removeEventListener("contextmenu", o);
|
|
8458
8495
|
};
|
|
8459
8496
|
}
|
|
8460
8497
|
_unbindKeys() {
|
|
@@ -8477,7 +8514,7 @@ class Me extends Ti {
|
|
|
8477
8514
|
return { x: Math.round(n.x / g), y: Math.round(n.y / g) };
|
|
8478
8515
|
}
|
|
8479
8516
|
}
|
|
8480
|
-
class
|
|
8517
|
+
class ad extends Me {
|
|
8481
8518
|
name = "text-creator";
|
|
8482
8519
|
_defaults = {};
|
|
8483
8520
|
_previewId = null;
|
|
@@ -8511,14 +8548,14 @@ class od extends Me {
|
|
|
8511
8548
|
_bindEvents(e) {
|
|
8512
8549
|
const i = this.topology.stage;
|
|
8513
8550
|
if (!i) return;
|
|
8514
|
-
const n = (
|
|
8551
|
+
const n = (s) => {
|
|
8515
8552
|
if (this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8516
|
-
const
|
|
8517
|
-
this.activeScene.texts.get(this._previewId)?.setOptions({ x:
|
|
8518
|
-
}, r = (
|
|
8519
|
-
if (
|
|
8520
|
-
const
|
|
8521
|
-
|
|
8553
|
+
const o = this.toTile(s, e);
|
|
8554
|
+
this.activeScene.texts.get(this._previewId)?.setOptions({ x: o.x, y: o.y });
|
|
8555
|
+
}, r = (s) => {
|
|
8556
|
+
if (s.button !== 0 || this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8557
|
+
const o = this.activeScene.texts.get(this._previewId);
|
|
8558
|
+
o && (o.getGraphics().alpha = 1);
|
|
8522
8559
|
const a = this._previewId;
|
|
8523
8560
|
this._previewId = null, this.complete(a);
|
|
8524
8561
|
};
|
|
@@ -8529,7 +8566,7 @@ class od extends Me {
|
|
|
8529
8566
|
!e || !this._handlers || (e.off("globalpointermove", this._handlers.onMove), e.off("pointerdown", this._handlers.onDown), e.cursor = "default", this._handlers = null);
|
|
8530
8567
|
}
|
|
8531
8568
|
}
|
|
8532
|
-
class
|
|
8569
|
+
class cd extends Me {
|
|
8533
8570
|
name = "rect-creator";
|
|
8534
8571
|
_defaults = {};
|
|
8535
8572
|
_previewId = null;
|
|
@@ -8558,20 +8595,20 @@ class ad extends Me {
|
|
|
8558
8595
|
_bindEvents(e) {
|
|
8559
8596
|
const i = this.topology.stage;
|
|
8560
8597
|
if (!i) return;
|
|
8561
|
-
const n = (
|
|
8562
|
-
if (
|
|
8598
|
+
const n = (o) => {
|
|
8599
|
+
if (o.button !== 0 || this.isPanning || this._isDragging) return;
|
|
8563
8600
|
this._isDragging = !0;
|
|
8564
|
-
const a = this.toTile(
|
|
8601
|
+
const a = this.toTile(o, e);
|
|
8565
8602
|
this._startTile = a;
|
|
8566
8603
|
const c = Ae();
|
|
8567
8604
|
this._previewId = c;
|
|
8568
8605
|
const l = e.rects.add({ id: c, x: a.x, y: a.y, width: 1, height: 1, ...this._defaults });
|
|
8569
8606
|
l.getGraphics().alpha = 0.5;
|
|
8570
|
-
}, r = (
|
|
8607
|
+
}, r = (o) => {
|
|
8571
8608
|
if (this.isPanning || !this._isDragging || !this._previewId || !this.activeScene) return;
|
|
8572
|
-
const a = this.toTile(
|
|
8609
|
+
const a = this.toTile(o, e), c = Math.min(this._startTile.x, a.x), l = Math.min(this._startTile.y, a.y), h = Math.max(1, Math.abs(a.x - this._startTile.x)), u = Math.max(1, Math.abs(a.y - this._startTile.y));
|
|
8573
8610
|
this.activeScene.rects.get(this._previewId)?.setOptions({ x: c, y: l, width: h, height: u });
|
|
8574
|
-
},
|
|
8611
|
+
}, s = (o) => {
|
|
8575
8612
|
if (this.isPanning || !this._isDragging) return;
|
|
8576
8613
|
this._isDragging = !1;
|
|
8577
8614
|
const a = this.activeScene?.rects.get(this._previewId);
|
|
@@ -8579,14 +8616,14 @@ class ad extends Me {
|
|
|
8579
8616
|
const c = this._previewId;
|
|
8580
8617
|
this._previewId = null, this.complete(c);
|
|
8581
8618
|
};
|
|
8582
|
-
i.on("pointerdown", n), i.on("globalpointermove", r), i.on("pointerup",
|
|
8619
|
+
i.on("pointerdown", n), i.on("globalpointermove", r), i.on("pointerup", s), i.on("pointerupoutside", s), this._handlers = { onDown: n, onMove: r, onUp: s }, i.cursor = "crosshair";
|
|
8583
8620
|
}
|
|
8584
8621
|
_unbindEvents() {
|
|
8585
8622
|
const e = this.topology?.stage;
|
|
8586
8623
|
!e || !this._handlers || (e.off("pointerdown", this._handlers.onDown), e.off("globalpointermove", this._handlers.onMove), e.off("pointerup", this._handlers.onUp), e.off("pointerupoutside", this._handlers.onUp), e.cursor = "default", this._handlers = null);
|
|
8587
8624
|
}
|
|
8588
8625
|
}
|
|
8589
|
-
class
|
|
8626
|
+
class ld extends Me {
|
|
8590
8627
|
name = "line-creator";
|
|
8591
8628
|
_defaults = {};
|
|
8592
8629
|
_previewId = null;
|
|
@@ -8614,10 +8651,10 @@ class cd extends Me {
|
|
|
8614
8651
|
_bindEvents(e) {
|
|
8615
8652
|
const i = this.topology.stage;
|
|
8616
8653
|
if (!i) return;
|
|
8617
|
-
const n = (
|
|
8618
|
-
if (
|
|
8654
|
+
const n = (o) => {
|
|
8655
|
+
if (o.button !== 0 || this.isPanning || this._isDragging) return;
|
|
8619
8656
|
this._isDragging = !0;
|
|
8620
|
-
const a = this.toTile(
|
|
8657
|
+
const a = this.toTile(o, e), c = Ae();
|
|
8621
8658
|
this._previewId = c;
|
|
8622
8659
|
const l = e.lines.add({
|
|
8623
8660
|
id: c,
|
|
@@ -8625,11 +8662,11 @@ class cd extends Me {
|
|
|
8625
8662
|
...this._defaults
|
|
8626
8663
|
});
|
|
8627
8664
|
l.getGraphics().alpha = 0.5, l.draw();
|
|
8628
|
-
}, r = (
|
|
8665
|
+
}, r = (o) => {
|
|
8629
8666
|
if (this.isPanning || !this._isDragging || !this._previewId || !this.activeScene) return;
|
|
8630
|
-
const a = this.toTile(
|
|
8667
|
+
const a = this.toTile(o, e);
|
|
8631
8668
|
this.activeScene.lines.get(this._previewId)?.updateAnchorPosition(1, a.x, a.y);
|
|
8632
|
-
},
|
|
8669
|
+
}, s = (o) => {
|
|
8633
8670
|
if (this.isPanning || !this._isDragging) return;
|
|
8634
8671
|
this._isDragging = !1;
|
|
8635
8672
|
const a = this.activeScene?.lines.get(this._previewId);
|
|
@@ -8637,14 +8674,14 @@ class cd extends Me {
|
|
|
8637
8674
|
const c = this._previewId;
|
|
8638
8675
|
this._previewId = null, this.complete(c);
|
|
8639
8676
|
};
|
|
8640
|
-
i.on("pointerdown", n), i.on("globalpointermove", r), i.on("pointerup",
|
|
8677
|
+
i.on("pointerdown", n), i.on("globalpointermove", r), i.on("pointerup", s), i.on("pointerupoutside", s), this._handlers = { onDown: n, onMove: r, onUp: s }, i.cursor = "crosshair";
|
|
8641
8678
|
}
|
|
8642
8679
|
_unbindEvents() {
|
|
8643
8680
|
const e = this.topology?.stage;
|
|
8644
8681
|
!e || !this._handlers || (e.off("pointerdown", this._handlers.onDown), e.off("globalpointermove", this._handlers.onMove), e.off("pointerup", this._handlers.onUp), e.off("pointerupoutside", this._handlers.onUp), e.cursor = "default", this._handlers = null);
|
|
8645
8682
|
}
|
|
8646
8683
|
}
|
|
8647
|
-
class
|
|
8684
|
+
class hd extends Me {
|
|
8648
8685
|
name = "node-creator";
|
|
8649
8686
|
_defaults = {};
|
|
8650
8687
|
_previewId = null;
|
|
@@ -8694,16 +8731,16 @@ class ld extends Me {
|
|
|
8694
8731
|
_bindEvents(e) {
|
|
8695
8732
|
const i = this.topology.stage;
|
|
8696
8733
|
if (!i) return;
|
|
8697
|
-
const n = (
|
|
8734
|
+
const n = (s) => {
|
|
8698
8735
|
if (this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8699
|
-
const
|
|
8700
|
-
this.activeScene.nodes.get(this._previewId)?.setOptions({ x:
|
|
8701
|
-
}, r = (
|
|
8702
|
-
if (
|
|
8703
|
-
const
|
|
8704
|
-
if (
|
|
8705
|
-
|
|
8706
|
-
const c =
|
|
8736
|
+
const o = this.toTile(s, e);
|
|
8737
|
+
this.activeScene.nodes.get(this._previewId)?.setOptions({ x: o.x, y: o.y });
|
|
8738
|
+
}, r = (s) => {
|
|
8739
|
+
if (s.button !== 0 || this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8740
|
+
const o = this.activeScene.nodes.get(this._previewId);
|
|
8741
|
+
if (o) {
|
|
8742
|
+
o.getGraphics().alpha = 1;
|
|
8743
|
+
const c = o.options.icon;
|
|
8707
8744
|
c && this._tempIconIds.has(c) && this._promotedIconIds.add(c);
|
|
8708
8745
|
}
|
|
8709
8746
|
const a = this._previewId;
|
|
@@ -8716,7 +8753,7 @@ class ld extends Me {
|
|
|
8716
8753
|
!e || !this._handlers || (e.off("globalpointermove", this._handlers.onMove), e.off("pointerdown", this._handlers.onDown), e.cursor = "default", this._handlers = null);
|
|
8717
8754
|
}
|
|
8718
8755
|
}
|
|
8719
|
-
class
|
|
8756
|
+
class ud extends Me {
|
|
8720
8757
|
name = "fence-creator";
|
|
8721
8758
|
_defaults = {};
|
|
8722
8759
|
_previewId = null;
|
|
@@ -8748,14 +8785,14 @@ class hd extends Me {
|
|
|
8748
8785
|
_bindEvents(e) {
|
|
8749
8786
|
const i = this.topology.stage;
|
|
8750
8787
|
if (!i) return;
|
|
8751
|
-
const n = (
|
|
8788
|
+
const n = (s) => {
|
|
8752
8789
|
if (this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8753
|
-
const
|
|
8754
|
-
this.activeScene.fences.get(this._previewId)?.setOptions({ x:
|
|
8755
|
-
}, r = (
|
|
8756
|
-
if (
|
|
8757
|
-
const
|
|
8758
|
-
|
|
8790
|
+
const o = this.toTile(s, e);
|
|
8791
|
+
this.activeScene.fences.get(this._previewId)?.setOptions({ x: o.x, y: o.y });
|
|
8792
|
+
}, r = (s) => {
|
|
8793
|
+
if (s.button !== 0 || this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8794
|
+
const o = this.activeScene.fences.get(this._previewId);
|
|
8795
|
+
o && (o.getGraphics().alpha = 1);
|
|
8759
8796
|
const a = this._previewId;
|
|
8760
8797
|
this._previewId = null, this.complete(a);
|
|
8761
8798
|
};
|
|
@@ -8766,7 +8803,7 @@ class hd extends Me {
|
|
|
8766
8803
|
!e || !this._handlers || (e.off("globalpointermove", this._handlers.onMove), e.off("pointerdown", this._handlers.onDown), e.cursor = "default", this._handlers = null);
|
|
8767
8804
|
}
|
|
8768
8805
|
}
|
|
8769
|
-
class
|
|
8806
|
+
class fd extends Me {
|
|
8770
8807
|
name = "wave-creator";
|
|
8771
8808
|
_defaults = {};
|
|
8772
8809
|
_previewId = null;
|
|
@@ -8798,14 +8835,14 @@ class ud extends Me {
|
|
|
8798
8835
|
_bindEvents(e) {
|
|
8799
8836
|
const i = this.topology.stage;
|
|
8800
8837
|
if (!i) return;
|
|
8801
|
-
const n = (
|
|
8838
|
+
const n = (s) => {
|
|
8802
8839
|
if (this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8803
|
-
const
|
|
8804
|
-
this.activeScene.waves.get(this._previewId)?.setOptions({ x:
|
|
8805
|
-
}, r = (
|
|
8806
|
-
if (
|
|
8807
|
-
const
|
|
8808
|
-
|
|
8840
|
+
const o = this.toTile(s, e);
|
|
8841
|
+
this.activeScene.waves.get(this._previewId)?.setOptions({ x: o.x, y: o.y });
|
|
8842
|
+
}, r = (s) => {
|
|
8843
|
+
if (s.button !== 0 || this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8844
|
+
const o = this.activeScene.waves.get(this._previewId);
|
|
8845
|
+
o && (o.getGraphics().alpha = 1);
|
|
8809
8846
|
const a = this._previewId;
|
|
8810
8847
|
this._previewId = null, this.complete(a);
|
|
8811
8848
|
};
|
|
@@ -8816,7 +8853,7 @@ class ud extends Me {
|
|
|
8816
8853
|
!e || !this._handlers || (e.off("globalpointermove", this._handlers.onMove), e.off("pointerdown", this._handlers.onDown), e.cursor = "default", this._handlers = null);
|
|
8817
8854
|
}
|
|
8818
8855
|
}
|
|
8819
|
-
class
|
|
8856
|
+
class dd extends Me {
|
|
8820
8857
|
name = "image-creator";
|
|
8821
8858
|
_defaults = {};
|
|
8822
8859
|
_previewId = null;
|
|
@@ -8848,14 +8885,14 @@ class fd extends Me {
|
|
|
8848
8885
|
_bindEvents(e) {
|
|
8849
8886
|
const i = this.topology.stage;
|
|
8850
8887
|
if (!i) return;
|
|
8851
|
-
const n = (
|
|
8888
|
+
const n = (s) => {
|
|
8852
8889
|
if (this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8853
|
-
const
|
|
8854
|
-
this.activeScene.images.get(this._previewId)?.setOptions({ x:
|
|
8855
|
-
}, r = (
|
|
8856
|
-
if (
|
|
8857
|
-
const
|
|
8858
|
-
|
|
8890
|
+
const o = this.toTile(s, e);
|
|
8891
|
+
this.activeScene.images.get(this._previewId)?.setOptions({ x: o.x, y: o.y });
|
|
8892
|
+
}, r = (s) => {
|
|
8893
|
+
if (s.button !== 0 || this.isPanning || !this._previewId || !this.activeScene) return;
|
|
8894
|
+
const o = this.activeScene.images.get(this._previewId);
|
|
8895
|
+
o && (o.getGraphics().alpha = 1);
|
|
8859
8896
|
const a = this._previewId;
|
|
8860
8897
|
this._previewId = null, this.complete(a);
|
|
8861
8898
|
};
|
|
@@ -8876,31 +8913,31 @@ export {
|
|
|
8876
8913
|
Me as BaseCreatorPlugin,
|
|
8877
8914
|
St as COS_ELEVATION,
|
|
8878
8915
|
ar as ELEVATION,
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8916
|
+
ud as FenceCreatorPlugin,
|
|
8917
|
+
Jf as FenceEditorPlugin,
|
|
8918
|
+
Kf as FenceEndpointPlugin,
|
|
8919
|
+
sd as FenceRuntimePlugin,
|
|
8883
8920
|
Xa as GroupElement,
|
|
8884
8921
|
cc as HitTestPlugin,
|
|
8885
8922
|
ur as ISOMETRIC_SKEW_X,
|
|
8886
8923
|
fr as ISOMETRIC_SKEW_Y,
|
|
8887
8924
|
lc as IconManager,
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8925
|
+
dd as ImageCreatorPlugin,
|
|
8926
|
+
qf as ImageEditorPlugin,
|
|
8927
|
+
rd as ImageRuntimePlugin,
|
|
8891
8928
|
Pe as InteractiveRuntimePlugin,
|
|
8892
8929
|
Ja as LayerManager,
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8930
|
+
ld as LineCreatorPlugin,
|
|
8931
|
+
Wf as LineEditorPlugin,
|
|
8932
|
+
td as LineRuntimePlugin,
|
|
8933
|
+
hd as NodeCreatorPlugin,
|
|
8934
|
+
Bf as NodeEditorPlugin,
|
|
8935
|
+
ed as NodeRuntimePlugin,
|
|
8899
8936
|
Oi as PostProcessManager,
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8937
|
+
cd as RectCreatorPlugin,
|
|
8938
|
+
Vf as RectDragPlugin,
|
|
8939
|
+
Xf as RectResizePlugin,
|
|
8940
|
+
nd as RectRuntimePlugin,
|
|
8904
8941
|
we as SIN_ELEVATION,
|
|
8905
8942
|
De as Scene,
|
|
8906
8943
|
Oe as SceneAwarePlugin,
|
|
@@ -8912,38 +8949,38 @@ export {
|
|
|
8912
8949
|
g as TILE_SIZE,
|
|
8913
8950
|
cr as TILE_VDIAGONAL,
|
|
8914
8951
|
mf as TILE_WIDTH,
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8952
|
+
ad as TextCreatorPlugin,
|
|
8953
|
+
jf as TextEditorPlugin,
|
|
8954
|
+
id as TextRuntimePlugin,
|
|
8918
8955
|
_r as Topology,
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8956
|
+
Yf as ViewportPlugin,
|
|
8957
|
+
fd as WaveCreatorPlugin,
|
|
8958
|
+
Zf as WaveEditorPlugin,
|
|
8959
|
+
Qf as WaveResizePlugin,
|
|
8960
|
+
od as WaveRuntimePlugin,
|
|
8961
|
+
md as ZoomTransform,
|
|
8925
8962
|
lr as calculateIsometricSkew,
|
|
8926
8963
|
yf as calculateIsometricTileDiagonals,
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8964
|
+
bf as createBlinkStatePlugin,
|
|
8965
|
+
Lf as createBloomPostProcess,
|
|
8966
|
+
Ef as createBlurPostProcess,
|
|
8967
|
+
Cf as createBounceStatePlugin,
|
|
8968
|
+
If as createBrightenStatePlugin,
|
|
8969
|
+
zf as createChromaticAberrationPostProcess,
|
|
8970
|
+
kf as createColorAdjustPostProcess,
|
|
8971
|
+
Af as createDarkenStatePlugin,
|
|
8972
|
+
Tf as createGlowStatePlugin,
|
|
8973
|
+
$f as createGodRaysPostProcess,
|
|
8974
|
+
Gf as createGrayscalePostProcess,
|
|
8975
|
+
Of as createHeartbeatStatePlugin,
|
|
8976
|
+
Hf as createInvertPostProcess,
|
|
8977
|
+
Df as createNoisePostProcess,
|
|
8978
|
+
Rf as createPixelatePostProcess,
|
|
8979
|
+
Nf as createScanlinesPostProcess,
|
|
8980
|
+
Uf as createSharpenPostProcess,
|
|
8981
|
+
Pf as createShimmerStatePlugin,
|
|
8982
|
+
Mf as createTintStatePlugin,
|
|
8983
|
+
Ff as createVignettePostProcess,
|
|
8947
8984
|
_r as default,
|
|
8948
8985
|
It as downloadFile,
|
|
8949
8986
|
ba as findPath,
|