@query-key-gen/used-viewer
Version:
A visual debug tool for inspecting where your `globalQueryKeys` are used in the app. Works alongside [`@query-key-gen/used-generator`](https://www.npmjs.com/package/@query-key-gen/used-generator).
1,660 lines • 240 kB
JavaScript
import { jsx as P, jsxs as ne, Fragment as ve } from "react/jsx-runtime";
import xt, { useState as ce, createContext as Gn, memo as se, useCallback as de, useMemo as ge, forwardRef as kr, useContext as vt, useLayoutEffect as Ir, useEffect as J, useRef as Q } from "react";
import { createPortal as xa } from "react-dom";
function ie(e) {
if (typeof e == "string" || typeof e == "number") return "" + e;
let t = "";
if (Array.isArray(e))
for (let n = 0, o; n < e.length; n++)
(o = ie(e[n])) !== "" && (t += (t && " ") + o);
else
for (let n in e)
e[n] && (t += (t && " ") + n);
return t;
}
var va = { value: () => {
} };
function jt() {
for (var e = 0, t = arguments.length, n = {}, o; e < t; ++e) {
if (!(o = arguments[e] + "") || o in n || /[\s.]/.test(o)) throw new Error("illegal type: " + o);
n[o] = [];
}
return new Ht(n);
}
function Ht(e) {
this._ = e;
}
function ba(e, t) {
return e.trim().split(/^|\s+/).map(function(n) {
var o = "", r = n.indexOf(".");
if (r >= 0 && (o = n.slice(r + 1), n = n.slice(0, r)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n);
return { type: n, name: o };
});
}
Ht.prototype = jt.prototype = {
constructor: Ht,
on: function(e, t) {
var n = this._, o = ba(e + "", n), r, i = -1, s = o.length;
if (arguments.length < 2) {
for (; ++i < s; ) if ((r = (e = o[i]).type) && (r = _a(n[r], e.name))) return r;
return;
}
if (t != null && typeof t != "function") throw new Error("invalid callback: " + t);
for (; ++i < s; )
if (r = (e = o[i]).type) n[r] = xo(n[r], e.name, t);
else if (t == null) for (r in n) n[r] = xo(n[r], e.name, null);
return this;
},
copy: function() {
var e = {}, t = this._;
for (var n in t) e[n] = t[n].slice();
return new Ht(e);
},
call: function(e, t) {
if ((r = arguments.length - 2) > 0) for (var n = new Array(r), o = 0, r, i; o < r; ++o) n[o] = arguments[o + 2];
if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e);
for (i = this._[e], o = 0, r = i.length; o < r; ++o) i[o].value.apply(t, n);
},
apply: function(e, t, n) {
if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e);
for (var o = this._[e], r = 0, i = o.length; r < i; ++r) o[r].value.apply(t, n);
}
};
function _a(e, t) {
for (var n = 0, o = e.length, r; n < o; ++n)
if ((r = e[n]).name === t)
return r.value;
}
function xo(e, t, n) {
for (var o = 0, r = e.length; o < r; ++o)
if (e[o].name === t) {
e[o] = va, e = e.slice(0, o).concat(e.slice(o + 1));
break;
}
return n != null && e.push({ name: t, value: n }), e;
}
var Tn = "http://www.w3.org/1999/xhtml";
const vo = {
svg: "http://www.w3.org/2000/svg",
xhtml: Tn,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function en(e) {
var t = e += "", n = t.indexOf(":");
return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), vo.hasOwnProperty(t) ? { space: vo[t], local: e } : e;
}
function Sa(e) {
return function() {
var t = this.ownerDocument, n = this.namespaceURI;
return n === Tn && t.documentElement.namespaceURI === Tn ? t.createElement(e) : t.createElementNS(n, e);
};
}
function Ea(e) {
return function() {
return this.ownerDocument.createElementNS(e.space, e.local);
};
}
function Pr(e) {
var t = en(e);
return (t.local ? Ea : Sa)(t);
}
function Na() {
}
function Un(e) {
return e == null ? Na : function() {
return this.querySelector(e);
};
}
function Ca(e) {
typeof e != "function" && (e = Un(e));
for (var t = this._groups, n = t.length, o = new Array(n), r = 0; r < n; ++r)
for (var i = t[r], s = i.length, a = o[r] = new Array(s), c, l, d = 0; d < s; ++d)
(c = i[d]) && (l = e.call(c, c.__data__, d, i)) && ("__data__" in c && (l.__data__ = c.__data__), a[d] = l);
return new fe(o, this._parents);
}
function Ma(e) {
return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
}
function ka() {
return [];
}
function Ar(e) {
return e == null ? ka : function() {
return this.querySelectorAll(e);
};
}
function Ia(e) {
return function() {
return Ma(e.apply(this, arguments));
};
}
function Pa(e) {
typeof e == "function" ? e = Ia(e) : e = Ar(e);
for (var t = this._groups, n = t.length, o = [], r = [], i = 0; i < n; ++i)
for (var s = t[i], a = s.length, c, l = 0; l < a; ++l)
(c = s[l]) && (o.push(e.call(c, c.__data__, l, s)), r.push(c));
return new fe(o, r);
}
function $r(e) {
return function() {
return this.matches(e);
};
}
function Dr(e) {
return function(t) {
return t.matches(e);
};
}
var Aa = Array.prototype.find;
function $a(e) {
return function() {
return Aa.call(this.children, e);
};
}
function Da() {
return this.firstElementChild;
}
function Oa(e) {
return this.select(e == null ? Da : $a(typeof e == "function" ? e : Dr(e)));
}
var Ta = Array.prototype.filter;
function Ra() {
return Array.from(this.children);
}
function za(e) {
return function() {
return Ta.call(this.children, e);
};
}
function Ha(e) {
return this.selectAll(e == null ? Ra : za(typeof e == "function" ? e : Dr(e)));
}
function La(e) {
typeof e != "function" && (e = $r(e));
for (var t = this._groups, n = t.length, o = new Array(n), r = 0; r < n; ++r)
for (var i = t[r], s = i.length, a = o[r] = [], c, l = 0; l < s; ++l)
(c = i[l]) && e.call(c, c.__data__, l, i) && a.push(c);
return new fe(o, this._parents);
}
function Or(e) {
return new Array(e.length);
}
function Ba() {
return new fe(this._enter || this._groups.map(Or), this._parents);
}
function Ft(e, t) {
this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
}
Ft.prototype = {
constructor: Ft,
appendChild: function(e) {
return this._parent.insertBefore(e, this._next);
},
insertBefore: function(e, t) {
return this._parent.insertBefore(e, t);
},
querySelector: function(e) {
return this._parent.querySelector(e);
},
querySelectorAll: function(e) {
return this._parent.querySelectorAll(e);
}
};
function Va(e) {
return function() {
return e;
};
}
function Fa(e, t, n, o, r, i) {
for (var s = 0, a, c = t.length, l = i.length; s < l; ++s)
(a = t[s]) ? (a.__data__ = i[s], o[s] = a) : n[s] = new Ft(e, i[s]);
for (; s < c; ++s)
(a = t[s]) && (r[s] = a);
}
function Ya(e, t, n, o, r, i, s) {
var a, c, l = /* @__PURE__ */ new Map(), d = t.length, h = i.length, u = new Array(d), f;
for (a = 0; a < d; ++a)
(c = t[a]) && (u[a] = f = s.call(c, c.__data__, a, t) + "", l.has(f) ? r[a] = c : l.set(f, c));
for (a = 0; a < h; ++a)
f = s.call(e, i[a], a, i) + "", (c = l.get(f)) ? (o[a] = c, c.__data__ = i[a], l.delete(f)) : n[a] = new Ft(e, i[a]);
for (a = 0; a < d; ++a)
(c = t[a]) && l.get(u[a]) === c && (r[a] = c);
}
function Xa(e) {
return e.__data__;
}
function Wa(e, t) {
if (!arguments.length) return Array.from(this, Xa);
var n = t ? Ya : Fa, o = this._parents, r = this._groups;
typeof e != "function" && (e = Va(e));
for (var i = r.length, s = new Array(i), a = new Array(i), c = new Array(i), l = 0; l < i; ++l) {
var d = o[l], h = r[l], u = h.length, f = Ka(e.call(d, d && d.__data__, l, o)), g = f.length, m = a[l] = new Array(g), v = s[l] = new Array(g), x = c[l] = new Array(u);
n(d, h, m, v, x, f, t);
for (var b = 0, p = 0, w, C; b < g; ++b)
if (w = m[b]) {
for (b >= p && (p = b + 1); !(C = v[p]) && ++p < g; ) ;
w._next = C || null;
}
}
return s = new fe(s, o), s._enter = a, s._exit = c, s;
}
function Ka(e) {
return typeof e == "object" && "length" in e ? e : Array.from(e);
}
function Za() {
return new fe(this._exit || this._groups.map(Or), this._parents);
}
function qa(e, t, n) {
var o = this.enter(), r = this, i = this.exit();
return typeof e == "function" ? (o = e(o), o && (o = o.selection())) : o = o.append(e + ""), t != null && (r = t(r), r && (r = r.selection())), n == null ? i.remove() : n(i), o && r ? o.merge(r).order() : r;
}
function Ga(e) {
for (var t = e.selection ? e.selection() : e, n = this._groups, o = t._groups, r = n.length, i = o.length, s = Math.min(r, i), a = new Array(r), c = 0; c < s; ++c)
for (var l = n[c], d = o[c], h = l.length, u = a[c] = new Array(h), f, g = 0; g < h; ++g)
(f = l[g] || d[g]) && (u[g] = f);
for (; c < r; ++c)
a[c] = n[c];
return new fe(a, this._parents);
}
function Ua() {
for (var e = this._groups, t = -1, n = e.length; ++t < n; )
for (var o = e[t], r = o.length - 1, i = o[r], s; --r >= 0; )
(s = o[r]) && (i && s.compareDocumentPosition(i) ^ 4 && i.parentNode.insertBefore(s, i), i = s);
return this;
}
function Qa(e) {
e || (e = Ja);
function t(h, u) {
return h && u ? e(h.__data__, u.__data__) : !h - !u;
}
for (var n = this._groups, o = n.length, r = new Array(o), i = 0; i < o; ++i) {
for (var s = n[i], a = s.length, c = r[i] = new Array(a), l, d = 0; d < a; ++d)
(l = s[d]) && (c[d] = l);
c.sort(t);
}
return new fe(r, this._parents).order();
}
function Ja(e, t) {
return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
function ja() {
var e = arguments[0];
return arguments[0] = this, e.apply(null, arguments), this;
}
function ec() {
return Array.from(this);
}
function tc() {
for (var e = this._groups, t = 0, n = e.length; t < n; ++t)
for (var o = e[t], r = 0, i = o.length; r < i; ++r) {
var s = o[r];
if (s) return s;
}
return null;
}
function nc() {
let e = 0;
for (const t of this) ++e;
return e;
}
function oc() {
return !this.node();
}
function rc(e) {
for (var t = this._groups, n = 0, o = t.length; n < o; ++n)
for (var r = t[n], i = 0, s = r.length, a; i < s; ++i)
(a = r[i]) && e.call(a, a.__data__, i, r);
return this;
}
function ic(e) {
return function() {
this.removeAttribute(e);
};
}
function sc(e) {
return function() {
this.removeAttributeNS(e.space, e.local);
};
}
function ac(e, t) {
return function() {
this.setAttribute(e, t);
};
}
function cc(e, t) {
return function() {
this.setAttributeNS(e.space, e.local, t);
};
}
function lc(e, t) {
return function() {
var n = t.apply(this, arguments);
n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
};
}
function uc(e, t) {
return function() {
var n = t.apply(this, arguments);
n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
};
}
function dc(e, t) {
var n = en(e);
if (arguments.length < 2) {
var o = this.node();
return n.local ? o.getAttributeNS(n.space, n.local) : o.getAttribute(n);
}
return this.each((t == null ? n.local ? sc : ic : typeof t == "function" ? n.local ? uc : lc : n.local ? cc : ac)(n, t));
}
function Tr(e) {
return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
}
function fc(e) {
return function() {
this.style.removeProperty(e);
};
}
function hc(e, t, n) {
return function() {
this.style.setProperty(e, t, n);
};
}
function gc(e, t, n) {
return function() {
var o = t.apply(this, arguments);
o == null ? this.style.removeProperty(e) : this.style.setProperty(e, o, n);
};
}
function pc(e, t, n) {
return arguments.length > 1 ? this.each((t == null ? fc : typeof t == "function" ? gc : hc)(e, t, n ?? "")) : Ke(this.node(), e);
}
function Ke(e, t) {
return e.style.getPropertyValue(t) || Tr(e).getComputedStyle(e, null).getPropertyValue(t);
}
function mc(e) {
return function() {
delete this[e];
};
}
function yc(e, t) {
return function() {
this[e] = t;
};
}
function wc(e, t) {
return function() {
var n = t.apply(this, arguments);
n == null ? delete this[e] : this[e] = n;
};
}
function xc(e, t) {
return arguments.length > 1 ? this.each((t == null ? mc : typeof t == "function" ? wc : yc)(e, t)) : this.node()[e];
}
function Rr(e) {
return e.trim().split(/^|\s+/);
}
function Qn(e) {
return e.classList || new zr(e);
}
function zr(e) {
this._node = e, this._names = Rr(e.getAttribute("class") || "");
}
zr.prototype = {
add: function(e) {
var t = this._names.indexOf(e);
t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
},
remove: function(e) {
var t = this._names.indexOf(e);
t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" ")));
},
contains: function(e) {
return this._names.indexOf(e) >= 0;
}
};
function Hr(e, t) {
for (var n = Qn(e), o = -1, r = t.length; ++o < r; ) n.add(t[o]);
}
function Lr(e, t) {
for (var n = Qn(e), o = -1, r = t.length; ++o < r; ) n.remove(t[o]);
}
function vc(e) {
return function() {
Hr(this, e);
};
}
function bc(e) {
return function() {
Lr(this, e);
};
}
function _c(e, t) {
return function() {
(t.apply(this, arguments) ? Hr : Lr)(this, e);
};
}
function Sc(e, t) {
var n = Rr(e + "");
if (arguments.length < 2) {
for (var o = Qn(this.node()), r = -1, i = n.length; ++r < i; ) if (!o.contains(n[r])) return !1;
return !0;
}
return this.each((typeof t == "function" ? _c : t ? vc : bc)(n, t));
}
function Ec() {
this.textContent = "";
}
function Nc(e) {
return function() {
this.textContent = e;
};
}
function Cc(e) {
return function() {
var t = e.apply(this, arguments);
this.textContent = t ?? "";
};
}
function Mc(e) {
return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Nc)(e)) : this.node().textContent;
}
function kc() {
this.innerHTML = "";
}
function Ic(e) {
return function() {
this.innerHTML = e;
};
}
function Pc(e) {
return function() {
var t = e.apply(this, arguments);
this.innerHTML = t ?? "";
};
}
function Ac(e) {
return arguments.length ? this.each(e == null ? kc : (typeof e == "function" ? Pc : Ic)(e)) : this.node().innerHTML;
}
function $c() {
this.nextSibling && this.parentNode.appendChild(this);
}
function Dc() {
return this.each($c);
}
function Oc() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Tc() {
return this.each(Oc);
}
function Rc(e) {
var t = typeof e == "function" ? e : Pr(e);
return this.select(function() {
return this.appendChild(t.apply(this, arguments));
});
}
function zc() {
return null;
}
function Hc(e, t) {
var n = typeof e == "function" ? e : Pr(e), o = t == null ? zc : typeof t == "function" ? t : Un(t);
return this.select(function() {
return this.insertBefore(n.apply(this, arguments), o.apply(this, arguments) || null);
});
}
function Lc() {
var e = this.parentNode;
e && e.removeChild(this);
}
function Bc() {
return this.each(Lc);
}
function Vc() {
var e = this.cloneNode(!1), t = this.parentNode;
return t ? t.insertBefore(e, this.nextSibling) : e;
}
function Fc() {
var e = this.cloneNode(!0), t = this.parentNode;
return t ? t.insertBefore(e, this.nextSibling) : e;
}
function Yc(e) {
return this.select(e ? Fc : Vc);
}
function Xc(e) {
return arguments.length ? this.property("__data__", e) : this.node().__data__;
}
function Wc(e) {
return function(t) {
e.call(this, t, this.__data__);
};
}
function Kc(e) {
return e.trim().split(/^|\s+/).map(function(t) {
var n = "", o = t.indexOf(".");
return o >= 0 && (n = t.slice(o + 1), t = t.slice(0, o)), { type: t, name: n };
});
}
function Zc(e) {
return function() {
var t = this.__on;
if (t) {
for (var n = 0, o = -1, r = t.length, i; n < r; ++n)
i = t[n], (!e.type || i.type === e.type) && i.name === e.name ? this.removeEventListener(i.type, i.listener, i.options) : t[++o] = i;
++o ? t.length = o : delete this.__on;
}
};
}
function qc(e, t, n) {
return function() {
var o = this.__on, r, i = Wc(t);
if (o) {
for (var s = 0, a = o.length; s < a; ++s)
if ((r = o[s]).type === e.type && r.name === e.name) {
this.removeEventListener(r.type, r.listener, r.options), this.addEventListener(r.type, r.listener = i, r.options = n), r.value = t;
return;
}
}
this.addEventListener(e.type, i, n), r = { type: e.type, name: e.name, value: t, listener: i, options: n }, o ? o.push(r) : this.__on = [r];
};
}
function Gc(e, t, n) {
var o = Kc(e + ""), r, i = o.length, s;
if (arguments.length < 2) {
var a = this.node().__on;
if (a) {
for (var c = 0, l = a.length, d; c < l; ++c)
for (r = 0, d = a[c]; r < i; ++r)
if ((s = o[r]).type === d.type && s.name === d.name)
return d.value;
}
return;
}
for (a = t ? qc : Zc, r = 0; r < i; ++r) this.each(a(o[r], t, n));
return this;
}
function Br(e, t, n) {
var o = Tr(e), r = o.CustomEvent;
typeof r == "function" ? r = new r(t, n) : (r = o.document.createEvent("Event"), n ? (r.initEvent(t, n.bubbles, n.cancelable), r.detail = n.detail) : r.initEvent(t, !1, !1)), e.dispatchEvent(r);
}
function Uc(e, t) {
return function() {
return Br(this, e, t);
};
}
function Qc(e, t) {
return function() {
return Br(this, e, t.apply(this, arguments));
};
}
function Jc(e, t) {
return this.each((typeof t == "function" ? Qc : Uc)(e, t));
}
function* jc() {
for (var e = this._groups, t = 0, n = e.length; t < n; ++t)
for (var o = e[t], r = 0, i = o.length, s; r < i; ++r)
(s = o[r]) && (yield s);
}
var Vr = [null];
function fe(e, t) {
this._groups = e, this._parents = t;
}
function bt() {
return new fe([[document.documentElement]], Vr);
}
function el() {
return this;
}
fe.prototype = bt.prototype = {
constructor: fe,
select: Ca,
selectAll: Pa,
selectChild: Oa,
selectChildren: Ha,
filter: La,
data: Wa,
enter: Ba,
exit: Za,
join: qa,
merge: Ga,
selection: el,
order: Ua,
sort: Qa,
call: ja,
nodes: ec,
node: tc,
size: nc,
empty: oc,
each: rc,
attr: dc,
style: pc,
property: xc,
classed: Sc,
text: Mc,
html: Ac,
raise: Dc,
lower: Tc,
append: Rc,
insert: Hc,
remove: Bc,
clone: Yc,
datum: Xc,
on: Gc,
dispatch: Jc,
[Symbol.iterator]: jc
};
function ue(e) {
return typeof e == "string" ? new fe([[document.querySelector(e)]], [document.documentElement]) : new fe([[e]], Vr);
}
function tl(e) {
let t;
for (; t = e.sourceEvent; ) e = t;
return e;
}
function pe(e, t) {
if (e = tl(e), t === void 0 && (t = e.currentTarget), t) {
var n = t.ownerSVGElement || t;
if (n.createSVGPoint) {
var o = n.createSVGPoint();
return o.x = e.clientX, o.y = e.clientY, o = o.matrixTransform(t.getScreenCTM().inverse()), [o.x, o.y];
}
if (t.getBoundingClientRect) {
var r = t.getBoundingClientRect();
return [e.clientX - r.left - t.clientLeft, e.clientY - r.top - t.clientTop];
}
}
return [e.pageX, e.pageY];
}
const nl = { passive: !1 }, lt = { capture: !0, passive: !1 };
function vn(e) {
e.stopImmediatePropagation();
}
function Xe(e) {
e.preventDefault(), e.stopImmediatePropagation();
}
function Fr(e) {
var t = e.document.documentElement, n = ue(e).on("dragstart.drag", Xe, lt);
"onselectstart" in t ? n.on("selectstart.drag", Xe, lt) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
}
function Yr(e, t) {
var n = e.document.documentElement, o = ue(e).on("dragstart.drag", null);
t && (o.on("click.drag", Xe, lt), setTimeout(function() {
o.on("click.drag", null);
}, 0)), "onselectstart" in n ? o.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
}
const Mt = (e) => () => e;
function Rn(e, {
sourceEvent: t,
subject: n,
target: o,
identifier: r,
active: i,
x: s,
y: a,
dx: c,
dy: l,
dispatch: d
}) {
Object.defineProperties(this, {
type: { value: e, enumerable: !0, configurable: !0 },
sourceEvent: { value: t, enumerable: !0, configurable: !0 },
subject: { value: n, enumerable: !0, configurable: !0 },
target: { value: o, enumerable: !0, configurable: !0 },
identifier: { value: r, enumerable: !0, configurable: !0 },
active: { value: i, enumerable: !0, configurable: !0 },
x: { value: s, enumerable: !0, configurable: !0 },
y: { value: a, enumerable: !0, configurable: !0 },
dx: { value: c, enumerable: !0, configurable: !0 },
dy: { value: l, enumerable: !0, configurable: !0 },
_: { value: d }
});
}
Rn.prototype.on = function() {
var e = this._.on.apply(this._, arguments);
return e === this._ ? this : e;
};
function ol(e) {
return !e.ctrlKey && !e.button;
}
function rl() {
return this.parentNode;
}
function il(e, t) {
return t ?? { x: e.x, y: e.y };
}
function sl() {
return navigator.maxTouchPoints || "ontouchstart" in this;
}
function Xr() {
var e = ol, t = rl, n = il, o = sl, r = {}, i = jt("start", "drag", "end"), s = 0, a, c, l, d, h = 0;
function u(w) {
w.on("mousedown.drag", f).filter(o).on("touchstart.drag", v).on("touchmove.drag", x, nl).on("touchend.drag touchcancel.drag", b).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
}
function f(w, C) {
if (!(d || !e.call(this, w, C))) {
var M = p(this, t.call(this, w, C), w, C, "mouse");
M && (ue(w.view).on("mousemove.drag", g, lt).on("mouseup.drag", m, lt), Fr(w.view), vn(w), l = !1, a = w.clientX, c = w.clientY, M("start", w));
}
}
function g(w) {
if (Xe(w), !l) {
var C = w.clientX - a, M = w.clientY - c;
l = C * C + M * M > h;
}
r.mouse("drag", w);
}
function m(w) {
ue(w.view).on("mousemove.drag mouseup.drag", null), Yr(w.view, l), Xe(w), r.mouse("end", w);
}
function v(w, C) {
if (e.call(this, w, C)) {
var M = w.changedTouches, N = t.call(this, w, C), A = M.length, $, D;
for ($ = 0; $ < A; ++$)
(D = p(this, N, w, C, M[$].identifier, M[$])) && (vn(w), D("start", w, M[$]));
}
}
function x(w) {
var C = w.changedTouches, M = C.length, N, A;
for (N = 0; N < M; ++N)
(A = r[C[N].identifier]) && (Xe(w), A("drag", w, C[N]));
}
function b(w) {
var C = w.changedTouches, M = C.length, N, A;
for (d && clearTimeout(d), d = setTimeout(function() {
d = null;
}, 500), N = 0; N < M; ++N)
(A = r[C[N].identifier]) && (vn(w), A("end", w, C[N]));
}
function p(w, C, M, N, A, $) {
var D = i.copy(), z = pe($ || M, C), T, R, y;
if ((y = n.call(w, new Rn("beforestart", {
sourceEvent: M,
target: u,
identifier: A,
active: s,
x: z[0],
y: z[1],
dx: 0,
dy: 0,
dispatch: D
}), N)) != null)
return T = y.x - z[0] || 0, R = y.y - z[1] || 0, function S(_, E, I) {
var k = z, O;
switch (_) {
case "start":
r[A] = S, O = s++;
break;
case "end":
delete r[A], --s;
// falls through
case "drag":
z = pe(I || E, C), O = s;
break;
}
D.call(
_,
w,
new Rn(_, {
sourceEvent: E,
subject: y,
target: u,
identifier: A,
active: O,
x: z[0] + T,
y: z[1] + R,
dx: z[0] - k[0],
dy: z[1] - k[1],
dispatch: D
}),
N
);
};
}
return u.filter = function(w) {
return arguments.length ? (e = typeof w == "function" ? w : Mt(!!w), u) : e;
}, u.container = function(w) {
return arguments.length ? (t = typeof w == "function" ? w : Mt(w), u) : t;
}, u.subject = function(w) {
return arguments.length ? (n = typeof w == "function" ? w : Mt(w), u) : n;
}, u.touchable = function(w) {
return arguments.length ? (o = typeof w == "function" ? w : Mt(!!w), u) : o;
}, u.on = function() {
var w = i.on.apply(i, arguments);
return w === i ? u : w;
}, u.clickDistance = function(w) {
return arguments.length ? (h = (w = +w) * w, u) : Math.sqrt(h);
}, u;
}
function Jn(e, t, n) {
e.prototype = t.prototype = n, n.constructor = e;
}
function Wr(e, t) {
var n = Object.create(e.prototype);
for (var o in t) n[o] = t[o];
return n;
}
function _t() {
}
var ut = 0.7, Yt = 1 / ut, We = "\\s*([+-]?\\d+)\\s*", dt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", xe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", al = /^#([0-9a-f]{3,8})$/, cl = new RegExp(`^rgb\\(${We},${We},${We}\\)$`), ll = new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`), ul = new RegExp(`^rgba\\(${We},${We},${We},${dt}\\)$`), dl = new RegExp(`^rgba\\(${xe},${xe},${xe},${dt}\\)$`), fl = new RegExp(`^hsl\\(${dt},${xe},${xe}\\)$`), hl = new RegExp(`^hsla\\(${dt},${xe},${xe},${dt}\\)$`), bo = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
};
Jn(_t, ft, {
copy(e) {
return Object.assign(new this.constructor(), this, e);
},
displayable() {
return this.rgb().displayable();
},
hex: _o,
// Deprecated! Use color.formatHex.
formatHex: _o,
formatHex8: gl,
formatHsl: pl,
formatRgb: So,
toString: So
});
function _o() {
return this.rgb().formatHex();
}
function gl() {
return this.rgb().formatHex8();
}
function pl() {
return Kr(this).formatHsl();
}
function So() {
return this.rgb().formatRgb();
}
function ft(e) {
var t, n;
return e = (e + "").trim().toLowerCase(), (t = al.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Eo(t) : n === 3 ? new le(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? kt(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? kt(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = cl.exec(e)) ? new le(t[1], t[2], t[3], 1) : (t = ll.exec(e)) ? new le(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = ul.exec(e)) ? kt(t[1], t[2], t[3], t[4]) : (t = dl.exec(e)) ? kt(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = fl.exec(e)) ? Mo(t[1], t[2] / 100, t[3] / 100, 1) : (t = hl.exec(e)) ? Mo(t[1], t[2] / 100, t[3] / 100, t[4]) : bo.hasOwnProperty(e) ? Eo(bo[e]) : e === "transparent" ? new le(NaN, NaN, NaN, 0) : null;
}
function Eo(e) {
return new le(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
}
function kt(e, t, n, o) {
return o <= 0 && (e = t = n = NaN), new le(e, t, n, o);
}
function ml(e) {
return e instanceof _t || (e = ft(e)), e ? (e = e.rgb(), new le(e.r, e.g, e.b, e.opacity)) : new le();
}
function zn(e, t, n, o) {
return arguments.length === 1 ? ml(e) : new le(e, t, n, o ?? 1);
}
function le(e, t, n, o) {
this.r = +e, this.g = +t, this.b = +n, this.opacity = +o;
}
Jn(le, zn, Wr(_t, {
brighter(e) {
return e = e == null ? Yt : Math.pow(Yt, e), new le(this.r * e, this.g * e, this.b * e, this.opacity);
},
darker(e) {
return e = e == null ? ut : Math.pow(ut, e), new le(this.r * e, this.g * e, this.b * e, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new le(Re(this.r), Re(this.g), Re(this.b), Xt(this.opacity));
},
displayable() {
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
},
hex: No,
// Deprecated! Use color.formatHex.
formatHex: No,
formatHex8: yl,
formatRgb: Co,
toString: Co
}));
function No() {
return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}`;
}
function yl() {
return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}${Te((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function Co() {
const e = Xt(this.opacity);
return `${e === 1 ? "rgb(" : "rgba("}${Re(this.r)}, ${Re(this.g)}, ${Re(this.b)}${e === 1 ? ")" : `, ${e})`}`;
}
function Xt(e) {
return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
}
function Re(e) {
return Math.max(0, Math.min(255, Math.round(e) || 0));
}
function Te(e) {
return e = Re(e), (e < 16 ? "0" : "") + e.toString(16);
}
function Mo(e, t, n, o) {
return o <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new me(e, t, n, o);
}
function Kr(e) {
if (e instanceof me) return new me(e.h, e.s, e.l, e.opacity);
if (e instanceof _t || (e = ft(e)), !e) return new me();
if (e instanceof me) return e;
e = e.rgb();
var t = e.r / 255, n = e.g / 255, o = e.b / 255, r = Math.min(t, n, o), i = Math.max(t, n, o), s = NaN, a = i - r, c = (i + r) / 2;
return a ? (t === i ? s = (n - o) / a + (n < o) * 6 : n === i ? s = (o - t) / a + 2 : s = (t - n) / a + 4, a /= c < 0.5 ? i + r : 2 - i - r, s *= 60) : a = c > 0 && c < 1 ? 0 : s, new me(s, a, c, e.opacity);
}
function wl(e, t, n, o) {
return arguments.length === 1 ? Kr(e) : new me(e, t, n, o ?? 1);
}
function me(e, t, n, o) {
this.h = +e, this.s = +t, this.l = +n, this.opacity = +o;
}
Jn(me, wl, Wr(_t, {
brighter(e) {
return e = e == null ? Yt : Math.pow(Yt, e), new me(this.h, this.s, this.l * e, this.opacity);
},
darker(e) {
return e = e == null ? ut : Math.pow(ut, e), new me(this.h, this.s, this.l * e, this.opacity);
},
rgb() {
var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, o = n + (n < 0.5 ? n : 1 - n) * t, r = 2 * n - o;
return new le(
bn(e >= 240 ? e - 240 : e + 120, r, o),
bn(e, r, o),
bn(e < 120 ? e + 240 : e - 120, r, o),
this.opacity
);
},
clamp() {
return new me(ko(this.h), It(this.s), It(this.l), Xt(this.opacity));
},
displayable() {
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
},
formatHsl() {
const e = Xt(this.opacity);
return `${e === 1 ? "hsl(" : "hsla("}${ko(this.h)}, ${It(this.s) * 100}%, ${It(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
}
}));
function ko(e) {
return e = (e || 0) % 360, e < 0 ? e + 360 : e;
}
function It(e) {
return Math.max(0, Math.min(1, e || 0));
}
function bn(e, t, n) {
return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
}
const Zr = (e) => () => e;
function xl(e, t) {
return function(n) {
return e + n * t;
};
}
function vl(e, t, n) {
return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(o) {
return Math.pow(e + o * t, n);
};
}
function bl(e) {
return (e = +e) == 1 ? qr : function(t, n) {
return n - t ? vl(t, n, e) : Zr(isNaN(t) ? n : t);
};
}
function qr(e, t) {
var n = t - e;
return n ? xl(e, n) : Zr(isNaN(e) ? t : e);
}
const Io = function e(t) {
var n = bl(t);
function o(r, i) {
var s = n((r = zn(r)).r, (i = zn(i)).r), a = n(r.g, i.g), c = n(r.b, i.b), l = qr(r.opacity, i.opacity);
return function(d) {
return r.r = s(d), r.g = a(d), r.b = c(d), r.opacity = l(d), r + "";
};
}
return o.gamma = e, o;
}(1);
function Ie(e, t) {
return e = +e, t = +t, function(n) {
return e * (1 - n) + t * n;
};
}
var Hn = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _n = new RegExp(Hn.source, "g");
function _l(e) {
return function() {
return e;
};
}
function Sl(e) {
return function(t) {
return e(t) + "";
};
}
function El(e, t) {
var n = Hn.lastIndex = _n.lastIndex = 0, o, r, i, s = -1, a = [], c = [];
for (e = e + "", t = t + ""; (o = Hn.exec(e)) && (r = _n.exec(t)); )
(i = r.index) > n && (i = t.slice(n, i), a[s] ? a[s] += i : a[++s] = i), (o = o[0]) === (r = r[0]) ? a[s] ? a[s] += r : a[++s] = r : (a[++s] = null, c.push({ i: s, x: Ie(o, r) })), n = _n.lastIndex;
return n < t.length && (i = t.slice(n), a[s] ? a[s] += i : a[++s] = i), a.length < 2 ? c[0] ? Sl(c[0].x) : _l(t) : (t = c.length, function(l) {
for (var d = 0, h; d < t; ++d) a[(h = c[d]).i] = h.x(l);
return a.join("");
});
}
var Po = 180 / Math.PI, Ln = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function Gr(e, t, n, o, r, i) {
var s, a, c;
return (s = Math.sqrt(e * e + t * t)) && (e /= s, t /= s), (c = e * n + t * o) && (n -= e * c, o -= t * c), (a = Math.sqrt(n * n + o * o)) && (n /= a, o /= a, c /= a), e * o < t * n && (e = -e, t = -t, c = -c, s = -s), {
translateX: r,
translateY: i,
rotate: Math.atan2(t, e) * Po,
skewX: Math.atan(c) * Po,
scaleX: s,
scaleY: a
};
}
var Pt;
function Nl(e) {
const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + "");
return t.isIdentity ? Ln : Gr(t.a, t.b, t.c, t.d, t.e, t.f);
}
function Cl(e) {
return e == null || (Pt || (Pt = document.createElementNS("http://www.w3.org/2000/svg", "g")), Pt.setAttribute("transform", e), !(e = Pt.transform.baseVal.consolidate())) ? Ln : (e = e.matrix, Gr(e.a, e.b, e.c, e.d, e.e, e.f));
}
function Ur(e, t, n, o) {
function r(l) {
return l.length ? l.pop() + " " : "";
}
function i(l, d, h, u, f, g) {
if (l !== h || d !== u) {
var m = f.push("translate(", null, t, null, n);
g.push({ i: m - 4, x: Ie(l, h) }, { i: m - 2, x: Ie(d, u) });
} else (h || u) && f.push("translate(" + h + t + u + n);
}
function s(l, d, h, u) {
l !== d ? (l - d > 180 ? d += 360 : d - l > 180 && (l += 360), u.push({ i: h.push(r(h) + "rotate(", null, o) - 2, x: Ie(l, d) })) : d && h.push(r(h) + "rotate(" + d + o);
}
function a(l, d, h, u) {
l !== d ? u.push({ i: h.push(r(h) + "skewX(", null, o) - 2, x: Ie(l, d) }) : d && h.push(r(h) + "skewX(" + d + o);
}
function c(l, d, h, u, f, g) {
if (l !== h || d !== u) {
var m = f.push(r(f) + "scale(", null, ",", null, ")");
g.push({ i: m - 4, x: Ie(l, h) }, { i: m - 2, x: Ie(d, u) });
} else (h !== 1 || u !== 1) && f.push(r(f) + "scale(" + h + "," + u + ")");
}
return function(l, d) {
var h = [], u = [];
return l = e(l), d = e(d), i(l.translateX, l.translateY, d.translateX, d.translateY, h, u), s(l.rotate, d.rotate, h, u), a(l.skewX, d.skewX, h, u), c(l.scaleX, l.scaleY, d.scaleX, d.scaleY, h, u), l = d = null, function(f) {
for (var g = -1, m = u.length, v; ++g < m; ) h[(v = u[g]).i] = v.x(f);
return h.join("");
};
};
}
var Ml = Ur(Nl, "px, ", "px)", "deg)"), kl = Ur(Cl, ", ", ")", ")"), Il = 1e-12;
function Ao(e) {
return ((e = Math.exp(e)) + 1 / e) / 2;
}
function Pl(e) {
return ((e = Math.exp(e)) - 1 / e) / 2;
}
function Al(e) {
return ((e = Math.exp(2 * e)) - 1) / (e + 1);
}
const $l = function e(t, n, o) {
function r(i, s) {
var a = i[0], c = i[1], l = i[2], d = s[0], h = s[1], u = s[2], f = d - a, g = h - c, m = f * f + g * g, v, x;
if (m < Il)
x = Math.log(u / l) / t, v = function(N) {
return [
a + N * f,
c + N * g,
l * Math.exp(t * N * x)
];
};
else {
var b = Math.sqrt(m), p = (u * u - l * l + o * m) / (2 * l * n * b), w = (u * u - l * l - o * m) / (2 * u * n * b), C = Math.log(Math.sqrt(p * p + 1) - p), M = Math.log(Math.sqrt(w * w + 1) - w);
x = (M - C) / t, v = function(N) {
var A = N * x, $ = Ao(C), D = l / (n * b) * ($ * Al(t * A + C) - Pl(C));
return [
a + D * f,
c + D * g,
l * $ / Ao(t * A + C)
];
};
}
return v.duration = x * 1e3 * t / Math.SQRT2, v;
}
return r.rho = function(i) {
var s = Math.max(1e-3, +i), a = s * s, c = a * a;
return e(s, a, c);
}, r;
}(Math.SQRT2, 2, 4);
var Ze = 0, it = 0, ot = 0, Qr = 1e3, Wt, st, Kt = 0, He = 0, tn = 0, ht = typeof performance == "object" && performance.now ? performance : Date, Jr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
setTimeout(e, 17);
};
function jn() {
return He || (Jr(Dl), He = ht.now() + tn);
}
function Dl() {
He = 0;
}
function Zt() {
this._call = this._time = this._next = null;
}
Zt.prototype = jr.prototype = {
constructor: Zt,
restart: function(e, t, n) {
if (typeof e != "function") throw new TypeError("callback is not a function");
n = (n == null ? jn() : +n) + (t == null ? 0 : +t), !this._next && st !== this && (st ? st._next = this : Wt = this, st = this), this._call = e, this._time = n, Bn();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, Bn());
}
};
function jr(e, t, n) {
var o = new Zt();
return o.restart(e, t, n), o;
}
function Ol() {
jn(), ++Ze;
for (var e = Wt, t; e; )
(t = He - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
--Ze;
}
function $o() {
He = (Kt = ht.now()) + tn, Ze = it = 0;
try {
Ol();
} finally {
Ze = 0, Rl(), He = 0;
}
}
function Tl() {
var e = ht.now(), t = e - Kt;
t > Qr && (tn -= t, Kt = e);
}
function Rl() {
for (var e, t = Wt, n, o = 1 / 0; t; )
t._call ? (o > t._time && (o = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Wt = n);
st = e, Bn(o);
}
function Bn(e) {
if (!Ze) {
it && (it = clearTimeout(it));
var t = e - He;
t > 24 ? (e < 1 / 0 && (it = setTimeout($o, e - ht.now() - tn)), ot && (ot = clearInterval(ot))) : (ot || (Kt = ht.now(), ot = setInterval(Tl, Qr)), Ze = 1, Jr($o));
}
}
function Do(e, t, n) {
var o = new Zt();
return t = t == null ? 0 : +t, o.restart((r) => {
o.stop(), e(r + t);
}, t, n), o;
}
var zl = jt("start", "end", "cancel", "interrupt"), Hl = [], ei = 0, Oo = 1, Vn = 2, Lt = 3, To = 4, Fn = 5, Bt = 6;
function nn(e, t, n, o, r, i) {
var s = e.__transition;
if (!s) e.__transition = {};
else if (n in s) return;
Ll(e, n, {
name: t,
index: o,
// For context during callback.
group: r,
// For context during callback.
on: zl,
tween: Hl,
time: i.time,
delay: i.delay,
duration: i.duration,
ease: i.ease,
timer: null,
state: ei
});
}
function eo(e, t) {
var n = we(e, t);
if (n.state > ei) throw new Error("too late; already scheduled");
return n;
}
function be(e, t) {
var n = we(e, t);
if (n.state > Lt) throw new Error("too late; already running");
return n;
}
function we(e, t) {
var n = e.__transition;
if (!n || !(n = n[t])) throw new Error("transition not found");
return n;
}
function Ll(e, t, n) {
var o = e.__transition, r;
o[t] = n, n.timer = jr(i, 0, n.time);
function i(l) {
n.state = Oo, n.timer.restart(s, n.delay, n.time), n.delay <= l && s(l - n.delay);
}
function s(l) {
var d, h, u, f;
if (n.state !== Oo) return c();
for (d in o)
if (f = o[d], f.name === n.name) {
if (f.state === Lt) return Do(s);
f.state === To ? (f.state = Bt, f.timer.stop(), f.on.call("interrupt", e, e.__data__, f.index, f.group), delete o[d]) : +d < t && (f.state = Bt, f.timer.stop(), f.on.call("cancel", e, e.__data__, f.index, f.group), delete o[d]);
}
if (Do(function() {
n.state === Lt && (n.state = To, n.timer.restart(a, n.delay, n.time), a(l));
}), n.state = Vn, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Vn) {
for (n.state = Lt, r = new Array(u = n.tween.length), d = 0, h = -1; d < u; ++d)
(f = n.tween[d].value.call(e, e.__data__, n.index, n.group)) && (r[++h] = f);
r.length = h + 1;
}
}
function a(l) {
for (var d = l < n.duration ? n.ease.call(null, l / n.duration) : (n.timer.restart(c), n.state = Fn, 1), h = -1, u = r.length; ++h < u; )
r[h].call(e, d);
n.state === Fn && (n.on.call("end", e, e.__data__, n.index, n.group), c());
}
function c() {
n.state = Bt, n.timer.stop(), delete o[t];
for (var l in o) return;
delete e.__transition;
}
}
function Vt(e, t) {
var n = e.__transition, o, r, i = !0, s;
if (n) {
t = t == null ? null : t + "";
for (s in n) {
if ((o = n[s]).name !== t) {
i = !1;
continue;
}
r = o.state > Vn && o.state < Fn, o.state = Bt, o.timer.stop(), o.on.call(r ? "interrupt" : "cancel", e, e.__data__, o.index, o.group), delete n[s];
}
i && delete e.__transition;
}
}
function Bl(e) {
return this.each(function() {
Vt(this, e);
});
}
function Vl(e, t) {
var n, o;
return function() {
var r = be(this, e), i = r.tween;
if (i !== n) {
o = n = i;
for (var s = 0, a = o.length; s < a; ++s)
if (o[s].name === t) {
o = o.slice(), o.splice(s, 1);
break;
}
}
r.tween = o;
};
}
function Fl(e, t, n) {
var o, r;
if (typeof n != "function") throw new Error();
return function() {
var i = be(this, e), s = i.tween;
if (s !== o) {
r = (o = s).slice();
for (var a = { name: t, value: n }, c = 0, l = r.length; c < l; ++c)
if (r[c].name === t) {
r[c] = a;
break;
}
c === l && r.push(a);
}
i.tween = r;
};
}
function Yl(e, t) {
var n = this._id;
if (e += "", arguments.length < 2) {
for (var o = we(this.node(), n).tween, r = 0, i = o.length, s; r < i; ++r)
if ((s = o[r]).name === e)
return s.value;
return null;
}
return this.each((t == null ? Vl : Fl)(n, e, t));
}
function to(e, t, n) {
var o = e._id;
return e.each(function() {
var r = be(this, o);
(r.value || (r.value = {}))[t] = n.apply(this, arguments);
}), function(r) {
return we(r, o).value[t];
};
}
function ti(e, t) {
var n;
return (typeof t == "number" ? Ie : t instanceof ft ? Io : (n = ft(t)) ? (t = n, Io) : El)(e, t);
}
function Xl(e) {
return function() {
this.removeAttribute(e);
};
}
function Wl(e) {
return function() {
this.removeAttributeNS(e.space, e.local);
};
}
function Kl(e, t, n) {
var o, r = n + "", i;
return function() {
var s = this.getAttribute(e);
return s === r ? null : s === o ? i : i = t(o = s, n);
};
}
function Zl(e, t, n) {
var o, r = n + "", i;
return function() {
var s = this.getAttributeNS(e.space, e.local);
return s === r ? null : s === o ? i : i = t(o = s, n);
};
}
function ql(e, t, n) {
var o, r, i;
return function() {
var s, a = n(this), c;
return a == null ? void this.removeAttribute(e) : (s = this.getAttribute(e), c = a + "", s === c ? null : s === o && c === r ? i : (r = c, i = t(o = s, a)));
};
}
function Gl(e, t, n) {
var o, r, i;
return function() {
var s, a = n(this), c;
return a == null ? void this.removeAttributeNS(e.space, e.local) : (s = this.getAttributeNS(e.space, e.local), c = a + "", s === c ? null : s === o && c === r ? i : (r = c, i = t(o = s, a)));
};
}
function Ul(e, t) {
var n = en(e), o = n === "transform" ? kl : ti;
return this.attrTween(e, typeof t == "function" ? (n.local ? Gl : ql)(n, o, to(this, "attr." + e, t)) : t == null ? (n.local ? Wl : Xl)(n) : (n.local ? Zl : Kl)(n, o, t));
}
function Ql(e, t) {
return function(n) {
this.setAttribute(e, t.call(this, n));
};
}
function Jl(e, t) {
return function(n) {
this.setAttributeNS(e.space, e.local, t.call(this, n));
};
}
function jl(e, t) {
var n, o;
function r() {
var i = t.apply(this, arguments);
return i !== o && (n = (o = i) && Jl(e, i)), n;
}
return r._value = t, r;
}
function eu(e, t) {
var n, o;
function r() {
var i = t.apply(this, arguments);
return i !== o && (n = (o = i) && Ql(e, i)), n;
}
return r._value = t, r;
}
function tu(e, t) {
var n = "attr." + e;
if (arguments.length < 2) return (n = this.tween(n)) && n._value;
if (t == null) return this.tween(n, null);
if (typeof t != "function") throw new Error();
var o = en(e);
return this.tween(n, (o.local ? jl : eu)(o, t));
}
function nu(e, t) {
return function() {
eo(this, e).delay = +t.apply(this, arguments);
};
}
function ou(e, t) {
return t = +t, function() {
eo(this, e).delay = t;
};
}
function ru(e) {
var t = this._id;
return arguments.length ? this.each((typeof e == "function" ? nu : ou)(t, e)) : we(this.node(), t).delay;
}
function iu(e, t) {
return function() {
be(this, e).duration = +t.apply(this, arguments);
};
}
function su(e, t) {
return t = +t, function() {
be(this, e).duration = t;
};
}
function au(e) {
var t = this._id;
return arguments.length ? this.each((typeof e == "function" ? iu : su)(t, e)) : we(this.node(), t).duration;
}
function cu(e, t) {
if (typeof t != "function") throw new Error();
return function() {
be(this, e).ease = t;
};
}
function lu(e) {
var t = this._id;
return arguments.length ? this.each(cu(t, e)) : we(this.node(), t).ease;
}
function uu(e, t) {
return function() {
var n = t.apply(this, arguments);
if (typeof n != "function") throw new Error();
be(this, e).ease = n;
};
}
function du(e) {
if (typeof e != "function") throw new Error();
return this.each(uu(this._id, e));
}
function fu(e) {
typeof e != "function" && (e = $r(e));
for (var t = this._groups, n = t.length, o = new Array(n), r = 0; r < n; ++r)
for (var i = t[r], s = i.length, a = o[r] = [], c, l = 0; l < s; ++l)
(c = i[l]) && e.call(c, c.__data__, l, i) && a.push(c);
return new Ne(o, this._parents, this._name, this._id);
}
function hu(e) {
if (e._id !== this._id) throw new Error();
for (var t = this._groups, n = e._groups, o = t.length, r = n.length, i = Math.min(o, r), s = new Array(o), a = 0; a < i; ++a)
for (var c = t[a], l = n[a], d = c.length, h = s[a] = new Array(d), u, f = 0; f < d; ++f)
(u = c[f] || l[f]) && (h[f] = u);
for (; a < o; ++a)
s[a] = t[a];
return new Ne(s, this._parents, this._name, this._id);
}
function gu(e) {
return (e + "").trim().split(/^|\s+/).every(function(t) {
var n = t.indexOf(".");
return n >= 0 && (t = t.slice(0, n)), !t || t === "start";
});
}
function pu(e, t, n) {
var o, r, i = gu(t) ? eo : be;
return function() {
var s = i(this, e), a = s.on;
a !== o && (r = (o = a).copy()).on(t, n), s.on = r;
};
}
function mu(e, t) {
var n = this._id;
return arguments.length < 2 ? we(this.node(), n).on.on(e) : this.each(pu(n, e, t));
}
function yu(e) {
return function() {
var t = this.parentNode;
for (var n in this.__transition) if (+n !== e) return;
t && t.removeChild(this);
};
}
function wu() {
return this.on("end.remove", yu(this._id));
}
function xu(e) {
var t = this._name, n = this._id;
typeof e != "function" && (e = Un(e));
for (var o = this._groups, r = o.length, i = new Array(r), s = 0; s < r; ++s)
for (var a = o[s], c = a.length, l = i[s] = new Array(c), d, h, u = 0; u < c; ++u)
(d = a[u]) && (h = e.call(d, d.__data__, u, a)) && ("__data__" in d && (h.__data__ = d.__data__), l[u] = h, nn(l[u], t, n, u, l, we(d, n)));
return new Ne(i, this._p