652 lines
22 KiB
JavaScript
652 lines
22 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 080d73f6a8a7055f.15232f16bf.js
|
|
* Module id: 953752
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (t) => {
|
|
"use strict";
|
|
var e = t.i(8164),
|
|
n = t.i(542550),
|
|
r = t.i(145850),
|
|
i = t.i(274017),
|
|
o = t.i(692423),
|
|
a = t.i(954542);
|
|
t.i(183502);
|
|
var u = t.i(603760);
|
|
let s = (t) => () => t;
|
|
function l(t, { sourceEvent: e, target: n, transform: r, dispatch: i }) {
|
|
Object.defineProperties(this, {
|
|
type: { value: t, enumerable: !0, configurable: !0 },
|
|
sourceEvent: { value: e, enumerable: !0, configurable: !0 },
|
|
target: { value: n, enumerable: !0, configurable: !0 },
|
|
transform: { value: r, enumerable: !0, configurable: !0 },
|
|
_: { value: i },
|
|
});
|
|
}
|
|
function c(t, e, n) {
|
|
(this.k = t), (this.x = e), (this.y = n);
|
|
}
|
|
c.prototype = {
|
|
constructor: c,
|
|
scale: function (t) {
|
|
return 1 === t ? this : new c(this.k * t, this.x, this.y);
|
|
},
|
|
translate: function (t, e) {
|
|
return (0 === t) & (0 === e)
|
|
? this
|
|
: new c(this.k, this.x + this.k * t, this.y + this.k * e);
|
|
},
|
|
apply: function (t) {
|
|
return [t[0] * this.k + this.x, t[1] * this.k + this.y];
|
|
},
|
|
applyX: function (t) {
|
|
return t * this.k + this.x;
|
|
},
|
|
applyY: function (t) {
|
|
return t * this.k + this.y;
|
|
},
|
|
invert: function (t) {
|
|
return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
|
|
},
|
|
invertX: function (t) {
|
|
return (t - this.x) / this.k;
|
|
},
|
|
invertY: function (t) {
|
|
return (t - this.y) / this.k;
|
|
},
|
|
rescaleX: function (t) {
|
|
return t
|
|
.copy()
|
|
.domain(t.range().map(this.invertX, this).map(t.invert, t));
|
|
},
|
|
rescaleY: function (t) {
|
|
return t
|
|
.copy()
|
|
.domain(t.range().map(this.invertY, this).map(t.invert, t));
|
|
},
|
|
toString: function () {
|
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
},
|
|
};
|
|
var f = new c(1, 0, 0);
|
|
function h(t) {
|
|
for (; !t.__zoom; ) if (!(t = t.parentNode)) return f;
|
|
return t.__zoom;
|
|
}
|
|
function p(t) {
|
|
t.stopImmediatePropagation();
|
|
}
|
|
function d(t) {
|
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
}
|
|
function v(t) {
|
|
return (!t.ctrlKey || "wheel" === t.type) && !t.button;
|
|
}
|
|
function m() {
|
|
var t = this;
|
|
return t instanceof SVGElement
|
|
? (t = t.ownerSVGElement || t).hasAttribute("viewBox")
|
|
? [
|
|
[(t = t.viewBox.baseVal).x, t.y],
|
|
[t.x + t.width, t.y + t.height],
|
|
]
|
|
: [
|
|
[0, 0],
|
|
[t.width.baseVal.value, t.height.baseVal.value],
|
|
]
|
|
: [
|
|
[0, 0],
|
|
[t.clientWidth, t.clientHeight],
|
|
];
|
|
}
|
|
function y() {
|
|
return this.__zoom || f;
|
|
}
|
|
function g(t) {
|
|
return (
|
|
-t.deltaY *
|
|
(1 === t.deltaMode ? 0.05 : t.deltaMode ? 1 : 0.002) *
|
|
(t.ctrlKey ? 10 : 1)
|
|
);
|
|
}
|
|
function _() {
|
|
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
}
|
|
function w(t, e, n) {
|
|
var r = t.invertX(e[0][0]) - n[0][0],
|
|
i = t.invertX(e[1][0]) - n[1][0],
|
|
o = t.invertY(e[0][1]) - n[0][1],
|
|
a = t.invertY(e[1][1]) - n[1][1];
|
|
return t.translate(
|
|
i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i),
|
|
a > o ? (o + a) / 2 : Math.min(0, o) || Math.max(0, a),
|
|
);
|
|
}
|
|
(h.prototype = c.prototype),
|
|
t.s(
|
|
["Transform", () => c, "default", () => h, "identity", () => f],
|
|
644200,
|
|
),
|
|
t.s(
|
|
[
|
|
"default",
|
|
0,
|
|
function () {
|
|
var t,
|
|
h,
|
|
x,
|
|
b = v,
|
|
k = m,
|
|
A = w,
|
|
M = g,
|
|
N = _,
|
|
E = [0, 1 / 0],
|
|
z = [
|
|
[-1 / 0, -1 / 0],
|
|
[1 / 0, 1 / 0],
|
|
],
|
|
S = 250,
|
|
T = i.interpolateZoom,
|
|
$ = (0, e.dispatch)("start", "zoom", "end"),
|
|
C = 0,
|
|
P = 10;
|
|
function V(t) {
|
|
t.property("__zoom", y)
|
|
.on("wheel.zoom", I, { passive: !1 })
|
|
.on("mousedown.zoom", B)
|
|
.on("dblclick.zoom", j)
|
|
.filter(N)
|
|
.on("touchstart.zoom", H)
|
|
.on("touchmove.zoom", L)
|
|
.on("touchend.zoom touchcancel.zoom", U)
|
|
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
}
|
|
function X(t, e) {
|
|
return (e = Math.max(E[0], Math.min(E[1], e))) === t.k
|
|
? t
|
|
: new c(e, t.x, t.y);
|
|
}
|
|
function q(t, e, n) {
|
|
var r = e[0] - n[0] * t.k,
|
|
i = e[1] - n[1] * t.k;
|
|
return r === t.x && i === t.y ? t : new c(t.k, r, i);
|
|
}
|
|
function R(t) {
|
|
return [(+t[0][0] + +t[1][0]) / 2, (+t[0][1] + +t[1][1]) / 2];
|
|
}
|
|
function D(t, e, n, r) {
|
|
t.on("start.zoom", function () {
|
|
O(this, arguments).event(r).start();
|
|
})
|
|
.on("interrupt.zoom end.zoom", function () {
|
|
O(this, arguments).event(r).end();
|
|
})
|
|
.tween("zoom", function () {
|
|
var t = arguments,
|
|
i = O(this, t).event(r),
|
|
o = k.apply(this, t),
|
|
a =
|
|
null == n
|
|
? R(o)
|
|
: "function" == typeof n
|
|
? n.apply(this, t)
|
|
: n,
|
|
u = Math.max(o[1][0] - o[0][0], o[1][1] - o[0][1]),
|
|
s = this.__zoom,
|
|
l = "function" == typeof e ? e.apply(this, t) : e,
|
|
f = T(
|
|
s.invert(a).concat(u / s.k),
|
|
l.invert(a).concat(u / l.k),
|
|
);
|
|
return function (t) {
|
|
if (1 === t) t = l;
|
|
else {
|
|
var e = f(t),
|
|
n = u / e[2];
|
|
t = new c(n, a[0] - e[0] * n, a[1] - e[1] * n);
|
|
}
|
|
i.zoom(null, t);
|
|
};
|
|
});
|
|
}
|
|
function O(t, e, n) {
|
|
return (!n && t.__zooming) || new Y(t, e);
|
|
}
|
|
function Y(t, e) {
|
|
(this.that = t),
|
|
(this.args = e),
|
|
(this.active = 0),
|
|
(this.sourceEvent = null),
|
|
(this.extent = k.apply(t, e)),
|
|
(this.taps = 0);
|
|
}
|
|
function I(t, ...e) {
|
|
if (b.apply(this, arguments)) {
|
|
var n = O(this, e).event(t),
|
|
r = this.__zoom,
|
|
i = Math.max(
|
|
E[0],
|
|
Math.min(E[1], r.k * Math.pow(2, M.apply(this, arguments))),
|
|
),
|
|
o = (0, a.pointer)(t);
|
|
if (n.wheel)
|
|
(n.mouse[0][0] !== o[0] || n.mouse[0][1] !== o[1]) &&
|
|
(n.mouse[1] = r.invert((n.mouse[0] = o))),
|
|
clearTimeout(n.wheel);
|
|
else {
|
|
if (r.k === i) return;
|
|
(n.mouse = [o, r.invert(o)]),
|
|
(0, u.interrupt)(this),
|
|
n.start();
|
|
}
|
|
d(t),
|
|
(n.wheel = setTimeout(function () {
|
|
(n.wheel = null), n.end();
|
|
}, 150)),
|
|
n.zoom(
|
|
"mouse",
|
|
A(q(X(r, i), n.mouse[0], n.mouse[1]), n.extent, z),
|
|
);
|
|
}
|
|
}
|
|
function B(t, ...e) {
|
|
if (!x && b.apply(this, arguments)) {
|
|
var i = t.currentTarget,
|
|
s = O(this, e, !0).event(t),
|
|
l = (0, o.select)(t.view)
|
|
.on(
|
|
"mousemove.zoom",
|
|
function (t) {
|
|
if ((d(t), !s.moved)) {
|
|
var e = t.clientX - f,
|
|
n = t.clientY - h;
|
|
s.moved = e * e + n * n > C;
|
|
}
|
|
s.event(t).zoom(
|
|
"mouse",
|
|
A(
|
|
q(
|
|
s.that.__zoom,
|
|
(s.mouse[0] = (0, a.pointer)(t, i)),
|
|
s.mouse[1],
|
|
),
|
|
s.extent,
|
|
z,
|
|
),
|
|
);
|
|
},
|
|
!0,
|
|
)
|
|
.on(
|
|
"mouseup.zoom",
|
|
function (t) {
|
|
l.on("mousemove.zoom mouseup.zoom", null),
|
|
(0, r.dragEnable)(t.view, s.moved),
|
|
d(t),
|
|
s.event(t).end();
|
|
},
|
|
!0,
|
|
),
|
|
c = (0, a.pointer)(t, i),
|
|
f = t.clientX,
|
|
h = t.clientY;
|
|
(0, n.dragDisable)(t.view),
|
|
p(t),
|
|
(s.mouse = [c, this.__zoom.invert(c)]),
|
|
(0, u.interrupt)(this),
|
|
s.start();
|
|
}
|
|
}
|
|
function j(t, ...e) {
|
|
if (b.apply(this, arguments)) {
|
|
var n = this.__zoom,
|
|
r = (0, a.pointer)(
|
|
t.changedTouches ? t.changedTouches[0] : t,
|
|
this,
|
|
),
|
|
i = n.invert(r),
|
|
u = n.k * (t.shiftKey ? 0.5 : 2),
|
|
s = A(q(X(n, u), r, i), k.apply(this, e), z);
|
|
d(t),
|
|
S > 0
|
|
? (0, o.select)(this)
|
|
.transition()
|
|
.duration(S)
|
|
.call(D, s, r, t)
|
|
: (0, o.select)(this).call(V.transform, s, r, t);
|
|
}
|
|
}
|
|
function H(e, ...n) {
|
|
if (b.apply(this, arguments)) {
|
|
var r,
|
|
i,
|
|
o,
|
|
s,
|
|
l = e.touches,
|
|
c = l.length,
|
|
f = O(this, n, e.changedTouches.length === c).event(e);
|
|
for (p(e), i = 0; i < c; ++i)
|
|
(o = l[i]),
|
|
(s = [
|
|
(s = (0, a.pointer)(o, this)),
|
|
this.__zoom.invert(s),
|
|
o.identifier,
|
|
]),
|
|
f.touch0
|
|
? f.touch1 ||
|
|
f.touch0[2] === s[2] ||
|
|
((f.touch1 = s), (f.taps = 0))
|
|
: ((f.touch0 = s), (r = !0), (f.taps = 1 + !!t));
|
|
t && (t = clearTimeout(t)),
|
|
r &&
|
|
(f.taps < 2 &&
|
|
((h = s[0]),
|
|
(t = setTimeout(function () {
|
|
t = null;
|
|
}, 500))),
|
|
(0, u.interrupt)(this),
|
|
f.start());
|
|
}
|
|
}
|
|
function L(t, ...e) {
|
|
if (this.__zooming) {
|
|
var n,
|
|
r,
|
|
i,
|
|
o,
|
|
u = O(this, e).event(t),
|
|
s = t.changedTouches,
|
|
l = s.length;
|
|
for (d(t), n = 0; n < l; ++n)
|
|
(r = s[n]),
|
|
(i = (0, a.pointer)(r, this)),
|
|
u.touch0 && u.touch0[2] === r.identifier
|
|
? (u.touch0[0] = i)
|
|
: u.touch1 &&
|
|
u.touch1[2] === r.identifier &&
|
|
(u.touch1[0] = i);
|
|
if (((r = u.that.__zoom), u.touch1)) {
|
|
var c = u.touch0[0],
|
|
f = u.touch0[1],
|
|
h = u.touch1[0],
|
|
p = u.touch1[1],
|
|
v = (v = h[0] - c[0]) * v + (v = h[1] - c[1]) * v,
|
|
m = (m = p[0] - f[0]) * m + (m = p[1] - f[1]) * m;
|
|
(r = X(r, Math.sqrt(v / m))),
|
|
(i = [(c[0] + h[0]) / 2, (c[1] + h[1]) / 2]),
|
|
(o = [(f[0] + p[0]) / 2, (f[1] + p[1]) / 2]);
|
|
} else {
|
|
if (!u.touch0) return;
|
|
(i = u.touch0[0]), (o = u.touch0[1]);
|
|
}
|
|
u.zoom("touch", A(q(r, i, o), u.extent, z));
|
|
}
|
|
}
|
|
function U(t, ...e) {
|
|
if (this.__zooming) {
|
|
var n,
|
|
r,
|
|
i = O(this, e).event(t),
|
|
u = t.changedTouches,
|
|
s = u.length;
|
|
for (
|
|
p(t),
|
|
x && clearTimeout(x),
|
|
x = setTimeout(function () {
|
|
x = null;
|
|
}, 500),
|
|
n = 0;
|
|
n < s;
|
|
++n
|
|
)
|
|
(r = u[n]),
|
|
i.touch0 && i.touch0[2] === r.identifier
|
|
? delete i.touch0
|
|
: i.touch1 &&
|
|
i.touch1[2] === r.identifier &&
|
|
delete i.touch1;
|
|
if (
|
|
(i.touch1 &&
|
|
!i.touch0 &&
|
|
((i.touch0 = i.touch1), delete i.touch1),
|
|
i.touch0)
|
|
)
|
|
i.touch0[1] = this.__zoom.invert(i.touch0[0]);
|
|
else if (
|
|
(i.end(),
|
|
2 === i.taps &&
|
|
((r = (0, a.pointer)(r, this)),
|
|
Math.hypot(h[0] - r[0], h[1] - r[1]) < P))
|
|
) {
|
|
var l = (0, o.select)(this).on("dblclick.zoom");
|
|
l && l.apply(this, arguments);
|
|
}
|
|
}
|
|
}
|
|
return (
|
|
(V.transform = function (t, e, n, r) {
|
|
var i = t.selection ? t.selection() : t;
|
|
i.property("__zoom", y),
|
|
t !== i
|
|
? D(t, e, n, r)
|
|
: i.interrupt().each(function () {
|
|
O(this, arguments)
|
|
.event(r)
|
|
.start()
|
|
.zoom(
|
|
null,
|
|
"function" == typeof e
|
|
? e.apply(this, arguments)
|
|
: e,
|
|
)
|
|
.end();
|
|
});
|
|
}),
|
|
(V.scaleBy = function (t, e, n, r) {
|
|
V.scaleTo(
|
|
t,
|
|
function () {
|
|
var t = this.__zoom.k,
|
|
n = "function" == typeof e ? e.apply(this, arguments) : e;
|
|
return t * n;
|
|
},
|
|
n,
|
|
r,
|
|
);
|
|
}),
|
|
(V.scaleTo = function (t, e, n, r) {
|
|
V.transform(
|
|
t,
|
|
function () {
|
|
var t = k.apply(this, arguments),
|
|
r = this.__zoom,
|
|
i =
|
|
null == n
|
|
? R(t)
|
|
: "function" == typeof n
|
|
? n.apply(this, arguments)
|
|
: n,
|
|
o = r.invert(i),
|
|
a = "function" == typeof e ? e.apply(this, arguments) : e;
|
|
return A(q(X(r, a), i, o), t, z);
|
|
},
|
|
n,
|
|
r,
|
|
);
|
|
}),
|
|
(V.translateBy = function (t, e, n, r) {
|
|
V.transform(
|
|
t,
|
|
function () {
|
|
return A(
|
|
this.__zoom.translate(
|
|
"function" == typeof e ? e.apply(this, arguments) : e,
|
|
"function" == typeof n ? n.apply(this, arguments) : n,
|
|
),
|
|
k.apply(this, arguments),
|
|
z,
|
|
);
|
|
},
|
|
null,
|
|
r,
|
|
);
|
|
}),
|
|
(V.translateTo = function (t, e, n, r, i) {
|
|
V.transform(
|
|
t,
|
|
function () {
|
|
var t = k.apply(this, arguments),
|
|
i = this.__zoom,
|
|
o =
|
|
null == r
|
|
? R(t)
|
|
: "function" == typeof r
|
|
? r.apply(this, arguments)
|
|
: r;
|
|
return A(
|
|
f
|
|
.translate(o[0], o[1])
|
|
.scale(i.k)
|
|
.translate(
|
|
"function" == typeof e
|
|
? -e.apply(this, arguments)
|
|
: -e,
|
|
"function" == typeof n
|
|
? -n.apply(this, arguments)
|
|
: -n,
|
|
),
|
|
t,
|
|
z,
|
|
);
|
|
},
|
|
r,
|
|
i,
|
|
);
|
|
}),
|
|
(Y.prototype = {
|
|
event: function (t) {
|
|
return t && (this.sourceEvent = t), this;
|
|
},
|
|
start: function () {
|
|
return (
|
|
1 == ++this.active &&
|
|
((this.that.__zooming = this), this.emit("start")),
|
|
this
|
|
);
|
|
},
|
|
zoom: function (t, e) {
|
|
return (
|
|
this.mouse &&
|
|
"mouse" !== t &&
|
|
(this.mouse[1] = e.invert(this.mouse[0])),
|
|
this.touch0 &&
|
|
"touch" !== t &&
|
|
(this.touch0[1] = e.invert(this.touch0[0])),
|
|
this.touch1 &&
|
|
"touch" !== t &&
|
|
(this.touch1[1] = e.invert(this.touch1[0])),
|
|
(this.that.__zoom = e),
|
|
this.emit("zoom"),
|
|
this
|
|
);
|
|
},
|
|
end: function () {
|
|
return (
|
|
0 == --this.active &&
|
|
(delete this.that.__zooming, this.emit("end")),
|
|
this
|
|
);
|
|
},
|
|
emit: function (t) {
|
|
var e = (0, o.select)(this.that).datum();
|
|
$.call(
|
|
t,
|
|
this.that,
|
|
new l(t, {
|
|
sourceEvent: this.sourceEvent,
|
|
target: V,
|
|
type: t,
|
|
transform: this.that.__zoom,
|
|
dispatch: $,
|
|
}),
|
|
e,
|
|
);
|
|
},
|
|
}),
|
|
(V.wheelDelta = function (t) {
|
|
return arguments.length
|
|
? ((M = "function" == typeof t ? t : s(+t)), V)
|
|
: M;
|
|
}),
|
|
(V.filter = function (t) {
|
|
return arguments.length
|
|
? ((b = "function" == typeof t ? t : s(!!t)), V)
|
|
: b;
|
|
}),
|
|
(V.touchable = function (t) {
|
|
return arguments.length
|
|
? ((N = "function" == typeof t ? t : s(!!t)), V)
|
|
: N;
|
|
}),
|
|
(V.extent = function (t) {
|
|
return arguments.length
|
|
? ((k =
|
|
"function" == typeof t
|
|
? t
|
|
: s([
|
|
[+t[0][0], +t[0][1]],
|
|
[+t[1][0], +t[1][1]],
|
|
])),
|
|
V)
|
|
: k;
|
|
}),
|
|
(V.scaleExtent = function (t) {
|
|
return arguments.length
|
|
? ((E[0] = +t[0]), (E[1] = +t[1]), V)
|
|
: [E[0], E[1]];
|
|
}),
|
|
(V.translateExtent = function (t) {
|
|
return arguments.length
|
|
? ((z[0][0] = +t[0][0]),
|
|
(z[1][0] = +t[1][0]),
|
|
(z[0][1] = +t[0][1]),
|
|
(z[1][1] = +t[1][1]),
|
|
V)
|
|
: [
|
|
[z[0][0], z[0][1]],
|
|
[z[1][0], z[1][1]],
|
|
];
|
|
}),
|
|
(V.constrain = function (t) {
|
|
return arguments.length ? ((A = t), V) : A;
|
|
}),
|
|
(V.duration = function (t) {
|
|
return arguments.length ? ((S = +t), V) : S;
|
|
}),
|
|
(V.interpolate = function (t) {
|
|
return arguments.length ? ((T = t), V) : T;
|
|
}),
|
|
(V.on = function () {
|
|
var t = $.on.apply($, arguments);
|
|
return t === $ ? V : t;
|
|
}),
|
|
(V.clickDistance = function (t) {
|
|
return arguments.length
|
|
? ((C = (t *= 1) * t), V)
|
|
: Math.sqrt(C);
|
|
}),
|
|
(V.tapDistance = function (t) {
|
|
return arguments.length ? ((P = +t), V) : P;
|
|
}),
|
|
V
|
|
);
|
|
},
|
|
],
|
|
953752,
|
|
),
|
|
t.s([], 250149);
|
|
};
|
|
|
|
export default moduleFactory;
|