UNPKG

@explorables/particularly_stuck

Version:

This explorable illustrates a model for fractal growth patterns in natural systems based on the aggregation of randomly moving particles.

1,568 lines 229 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-text-2xl:1.5rem;--tw-text-2xl--line-height:calc(2/1.5);--tw-text-3xl:1.875rem;--tw-text-3xl--line-height: 1.2 ;--tw-text-5xl:3rem;--tw-text-5xl--line-height:1;--tw-font-weight-light:300}}@layer base,components;@layer utilities{.tw\\:m-8{margin:calc(var(--tw-spacing)*8)}.tw\\:grid{display:grid}.tw\\:max-w-5xl{max-width:var(--tw-container-5xl)}.tw\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.tw\\:border-1{border-style:var(--tw-border-style);border-width:1px}.tw\\:bg-white{background-color:var(--tw-color-white)}.tw\\:p-0{padding:calc(var(--tw-spacing)*0)}.tw\\:px-1{padding-inline:calc(var(--tw-spacing)*1)}.tw\\:px-10{padding-inline:calc(var(--tw-spacing)*10)}.tw\\:font-sans{font-family:var(--tw-font-sans)}.tw\\:text-2xl{font-size:var(--tw-text-2xl);line-height:var(--tw-leading,var(--tw-text-2xl--line-height))}.tw\\:text-3xl{font-size:var(--tw-text-3xl);line-height:var(--tw-leading,var(--tw-text-3xl--line-height))}.tw\\:text-5xl{font-size:var(--tw-text-5xl);line-height:var(--tw-leading,var(--tw-text-5xl--line-height))}.tw\\:font-light{--tw-font-weight:var(--tw-font-weight-light);font-weight:var(--tw-font-weight-light)}.tw\\:text-black{color:var(--tw-color-black)}@media (min-width:40rem){.tw\\:sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.tw\\:sm\\:gap-8{gap:calc(var(--tw-spacing)*8)}.tw\\:sm\\:p-0{padding:calc(var(--tw-spacing)*0)}}@media (prefers-color-scheme:dark){.tw\\:dark\\:border-white{border-color:var(--tw-color-white)}.tw\\:dark\\:bg-black{background-color:var(--tw-color-black)}.tw\\:dark\\:text-white{color:var(--tw-color-white)}}.debug-grid-16{background-image:linear-gradient(90deg,#0000ff1a 1px,#0000 1px),linear-gradient(#0000ff1a 1px,#0000 1px);background-repeat:repeat;background-size:6.25% 6.25%,6.25% 6.25%}}.explorable *,.explorable :before,.explorable :after{box-sizing:border-box}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}._displayPanel_19jk0_1,._controlPanel_19jk0_8{display:block;line-height:0;box-sizing:border-box}._displayPanel_19jk0_1>canvas,._displayPanel_19jk0_1>svg,._controlPanel_19jk0_8>svg,._controlPanel_19jk0_8>canvas{display:block;box-sizing:border-box}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); const Du = { display_type: "canvas", // either svg or canvas depending on explorable debug: !1, // if set to true, draws dots on the control panel to help widget placement controls_border: "", display_border: "", debug_lattice: "debug-grid-16", controls_grid: { nx: 12, ny: 12 }, display_size: { width: 500, height: 500 }, controls_size: { width: 480, height: 480 }, display_class: "tw:border-1 tw-border-black tw:dark:border-white tw:p-0", controls_class: "tw:p-0", container_class: "tw:font-sans tw:font-light tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:sm:gap-8 tw:px-1 tw:sm:p-0 tw:m-8" }; function Qe(t, e) { return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function Lu(t, e) { return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } function Eo(t) { let e, n, r; t.length !== 2 ? (e = Qe, n = (s, c) => Qe(t(s), c), r = (s, c) => t(s) - c) : (e = t === Qe || t === Lu ? t : qu, n = t, r = t); function i(s, c, u = 0, l = s.length) { if (u < l) { if (e(c, c) !== 0) return l; do { const h = u + l >>> 1; n(s[h], c) < 0 ? u = h + 1 : l = h; } while (u < l); } return u; } function a(s, c, u = 0, l = s.length) { if (u < l) { if (e(c, c) !== 0) return l; do { const h = u + l >>> 1; n(s[h], c) <= 0 ? u = h + 1 : l = h; } while (u < l); } return u; } function o(s, c, u = 0, l = s.length) { const h = i(s, c, u, l - 1); return h > u && r(s[h - 1], c) > -r(s[h], c) ? h - 1 : h; } return { left: i, center: o, right: a }; } function qu() { return 0; } function Xu(t) { return t === null ? NaN : +t; } const Bu = Eo(Qe), Hu = Bu.right; Eo(Xu).center; const Uu = Math.sqrt(50), Yu = Math.sqrt(10), Gu = Math.sqrt(2); function fn(t, e, n) { const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), o = a >= Uu ? 10 : a >= Yu ? 5 : a >= Gu ? 2 : 1; let s, c, u; return i < 0 ? (u = Math.pow(10, -i) / o, s = Math.round(t * u), c = Math.round(e * u), s / u < t && ++s, c / u > e && --c, u = -u) : (u = Math.pow(10, i) * o, s = Math.round(t / u), c = Math.round(e / u), s * u < t && ++s, c * u > e && --c), c < s && 0.5 <= n && n < 2 ? fn(t, e, n * 2) : [s, c, u]; } function Vu(t, e, n) { if (e = +e, t = +t, n = +n, !(n > 0)) return []; if (t === e) return [t]; const r = e < t, [i, a, o] = r ? fn(e, t, n) : fn(t, e, n); if (!(a >= i)) return []; const s = a - i + 1, c = new Array(s); if (r) if (o < 0) for (let u = 0; u < s; ++u) c[u] = (a - u) / -o; else for (let u = 0; u < s; ++u) c[u] = (a - u) * o; else if (o < 0) for (let u = 0; u < s; ++u) c[u] = (i + u) / -o; else for (let u = 0; u < s; ++u) c[u] = (i + u) * o; return c; } function wr(t, e, n) { return e = +e, t = +t, n = +n, fn(t, e, n)[2]; } function Ku(t, e, n) { e = +e, t = +t, n = +n; const r = e < t, i = r ? wr(e, t, n) : wr(t, e, n); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i); } var Wu = { value: () => { } }; function Oo() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } return new tn(n); } function tn(t) { this._ = t; } function Zu(t, e) { return t.trim().split(/^|\s+/).map(function(n) { var r = "", i = n.indexOf("."); if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } tn.prototype = Oo.prototype = { constructor: tn, on: function(t, e) { var n = this._, r = Zu(t + "", n), i, a = -1, o = r.length; if (arguments.length < 2) { for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = Ju(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++a < o; ) if (i = (t = r[a]).type) n[i] = Bi(n[i], t.name, e); else if (e == null) for (i in n) n[i] = Bi(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); return new tn(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, a; r < i; ++r) n[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (a = this._[t], r = 0, i = a.length; r < i; ++r) a[r].value.apply(e, n); }, apply: function(t, e, n) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], i = 0, a = r.length; i < a; ++i) r[i].value.apply(e, n); } }; function Ju(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } function Bi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { t[r] = Wu, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } var xr = "http://www.w3.org/1999/xhtml"; const Hi = { svg: "http://www.w3.org/2000/svg", xhtml: xr, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function zn(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Hi.hasOwnProperty(e) ? { space: Hi[e], local: t } : t; } function Qu(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; return n === xr && e.documentElement.namespaceURI === xr ? e.createElement(t) : e.createElementNS(n, t); }; } function tc(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function zo(t) { var e = zn(t); return (e.local ? tc : Qu)(e); } function ec() { } function ai(t) { return t == null ? ec : function() { return this.querySelector(t); }; } function nc(t) { typeof t != "function" && (t = ai(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = new Array(o), c, u, l = 0; l < o; ++l) (c = a[l]) && (u = t.call(c, c.__data__, l, a)) && ("__data__" in c && (u.__data__ = c.__data__), s[l] = u); return new D(r, this._parents); } function rc(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function ic() { return []; } function Co(t) { return t == null ? ic : function() { return this.querySelectorAll(t); }; } function ac(t) { return function() { return rc(t.apply(this, arguments)); }; } function oc(t) { typeof t == "function" ? t = ac(t) : t = Co(t); for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a) for (var o = e[a], s = o.length, c, u = 0; u < s; ++u) (c = o[u]) && (r.push(t.call(c, c.__data__, u, o)), i.push(c)); return new D(r, i); } function Io(t) { return function() { return this.matches(t); }; } function Ro(t) { return function(e) { return e.matches(t); }; } var sc = Array.prototype.find; function uc(t) { return function() { return sc.call(this.children, t); }; } function cc() { return this.firstElementChild; } function lc(t) { return this.select(t == null ? cc : uc(typeof t == "function" ? t : Ro(t))); } var fc = Array.prototype.filter; function hc() { return Array.from(this.children); } function dc(t) { return function() { return fc.call(this.children, t); }; } function pc(t) { return this.selectAll(t == null ? hc : dc(typeof t == "function" ? t : Ro(t))); } function gc(t) { typeof t != "function" && (t = Io(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], c, u = 0; u < o; ++u) (c = a[u]) && t.call(c, c.__data__, u, a) && s.push(c); return new D(r, this._parents); } function jo(t) { return new Array(t.length); } function yc() { return new D(this._enter || this._groups.map(jo), this._parents); } function hn(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } hn.prototype = { constructor: hn, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, insertBefore: function(t, e) { return this._parent.insertBefore(t, e); }, querySelector: function(t) { return this._parent.querySelector(t); }, querySelectorAll: function(t) { return this._parent.querySelectorAll(t); } }; function bc(t) { return function() { return t; }; } function _c(t, e, n, r, i, a) { for (var o = 0, s, c = e.length, u = a.length; o < u; ++o) (s = e[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new hn(t, a[o]); for (; o < c; ++o) (s = e[o]) && (i[o] = s); } function vc(t, e, n, r, i, a, o) { var s, c, u = /* @__PURE__ */ new Map(), l = e.length, h = a.length, f = new Array(l), d; for (s = 0; s < l; ++s) (c = e[s]) && (f[s] = d = o.call(c, c.__data__, s, e) + "", u.has(d) ? i[s] = c : u.set(d, c)); for (s = 0; s < h; ++s) d = o.call(t, a[s], s, a) + "", (c = u.get(d)) ? (r[s] = c, c.__data__ = a[s], u.delete(d)) : n[s] = new hn(t, a[s]); for (s = 0; s < l; ++s) (c = e[s]) && u.get(f[s]) === c && (i[s] = c); } function mc(t) { return t.__data__; } function wc(t, e) { if (!arguments.length) return Array.from(this, mc); var n = e ? vc : _c, r = this._parents, i = this._groups; typeof t != "function" && (t = bc(t)); for (var a = i.length, o = new Array(a), s = new Array(a), c = new Array(a), u = 0; u < a; ++u) { var l = r[u], h = i[u], f = h.length, d = xc(t.call(l, l && l.__data__, u, r)), g = d.length, b = s[u] = new Array(g), m = o[u] = new Array(g), w = c[u] = new Array(f); n(l, h, b, m, w, d, e); for (var p = 0, M = 0, y, v; p < g; ++p) if (y = b[p]) { for (p >= M && (M = p + 1); !(v = m[M]) && ++M < g; ) ; y._next = v || null; } } return o = new D(o, r), o._enter = s, o._exit = c, o; } function xc(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Mc() { return new D(this._exit || this._groups.map(jo), this._parents); } function Ac(t, e, n) { var r = this.enter(), i = this, a = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i; } function $c(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, o = Math.min(i, a), s = new Array(i), c = 0; c < o; ++c) for (var u = n[c], l = r[c], h = u.length, f = s[c] = new Array(h), d, g = 0; g < h; ++g) (d = u[g] || l[g]) && (f[g] = d); for (; c < i; ++c) s[c] = n[c]; return new D(s, this._parents); } function Nc() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], i = r.length - 1, a = r[i], o; --i >= 0; ) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o); return this; } function Tc(t) { t || (t = Sc); function e(h, f) { return h && f ? t(h.__data__, f.__data__) : !h - !f; } for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) { for (var o = n[a], s = o.length, c = i[a] = new Array(s), u, l = 0; l < s; ++l) (u = o[l]) && (c[l] = u); c.sort(e); } return new D(i, this._parents).order(); } function Sc(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function kc() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function Pc() { return Array.from(this); } function Ec() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length; i < a; ++i) { var o = r[i]; if (o) return o; } return null; } function Oc() { let t = 0; for (const e of this) ++t; return t; } function zc() { return !this.node(); } function Cc(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && t.call(s, s.__data__, a, i); return this; } function Ic(t) { return function() { this.removeAttribute(t); }; } function Rc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function jc(t, e) { return function() { this.setAttribute(t, e); }; } function Fc(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function Dc(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } function Lc(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } function qc(t, e) { var n = zn(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } return this.each((e == null ? n.local ? Rc : Ic : typeof e == "function" ? n.local ? Lc : Dc : n.local ? Fc : jc)(n, e)); } function Fo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function Xc(t) { return function() { this.style.removeProperty(t); }; } function Bc(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } function Hc(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } function Uc(t, e, n) { return arguments.length > 1 ? this.each((e == null ? Xc : typeof e == "function" ? Hc : Bc)(t, e, n ?? "")) : Wt(this.node(), t); } function Wt(t, e) { return t.style.getPropertyValue(e) || Fo(t).getComputedStyle(t, null).getPropertyValue(e); } function Yc(t) { return function() { delete this[t]; }; } function Gc(t, e) { return function() { this[t] = e; }; } function Vc(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } function Kc(t, e) { return arguments.length > 1 ? this.each((e == null ? Yc : typeof e == "function" ? Vc : Gc)(t, e)) : this.node()[t]; } function Do(t) { return t.trim().split(/^|\s+/); } function oi(t) { return t.classList || new Lo(t); } function Lo(t) { this._node = t, this._names = Do(t.getAttribute("class") || ""); } Lo.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); }, remove: function(t) { var e = this._names.indexOf(t); e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); }, contains: function(t) { return this._names.indexOf(t) >= 0; } }; function qo(t, e) { for (var n = oi(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } function Xo(t, e) { for (var n = oi(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } function Wc(t) { return function() { qo(this, t); }; } function Zc(t) { return function() { Xo(this, t); }; } function Jc(t, e) { return function() { (e.apply(this, arguments) ? qo : Xo)(this, t); }; } function Qc(t, e) { var n = Do(t + ""); if (arguments.length < 2) { for (var r = oi(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1; return !0; } return this.each((typeof e == "function" ? Jc : e ? Wc : Zc)(n, e)); } function tl() { this.textContent = ""; } function el(t) { return function() { this.textContent = t; }; } function nl(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function rl(t) { return arguments.length ? this.each(t == null ? tl : (typeof t == "function" ? nl : el)(t)) : this.node().textContent; } function il() { this.innerHTML = ""; } function al(t) { return function() { this.innerHTML = t; }; } function ol(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function sl(t) { return arguments.length ? this.each(t == null ? il : (typeof t == "function" ? ol : al)(t)) : this.node().innerHTML; } function ul() { this.nextSibling && this.parentNode.appendChild(this); } function cl() { return this.each(ul); } function ll() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function fl() { return this.each(ll); } function hl(t) { var e = typeof t == "function" ? t : zo(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function dl() { return null; } function pl(t, e) { var n = typeof t == "function" ? t : zo(t), r = e == null ? dl : typeof e == "function" ? e : ai(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function gl() { var t = this.parentNode; t && t.removeChild(this); } function yl() { return this.each(gl); } function bl() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function _l() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function vl(t) { return this.select(t ? _l : bl); } function ml(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function wl(t) { return function(e) { t.call(this, e, this.__data__); }; } function xl(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } function Ml(t) { return function() { var e = this.__on; if (e) { for (var n = 0, r = -1, i = e.length, a; n < i; ++n) a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a; ++r ? e.length = r : delete this.__on; } }; } function Al(t, e, n) { return function() { var r = this.__on, i, a = wl(e); if (r) { for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = e; return; } } this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i]; }; } function $l(t, e, n) { var r = xl(t + ""), i, a = r.length, o; if (arguments.length < 2) { var s = this.node().__on; if (s) { for (var c = 0, u = s.length, l; c < u; ++c) for (i = 0, l = s[c]; i < a; ++i) if ((o = r[i]).type === l.type && o.name === l.name) return l.value; } return; } for (s = e ? Al : Ml, i = 0; i < a; ++i) this.each(s(r[i], e, n)); return this; } function Bo(t, e, n) { var r = Fo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } function Nl(t, e) { return function() { return Bo(this, t, e); }; } function Tl(t, e) { return function() { return Bo(this, t, e.apply(this, arguments)); }; } function Sl(t, e) { return this.each((typeof e == "function" ? Tl : Nl)(t, e)); } function* kl() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o); } var Ho = [null]; function D(t, e) { this._groups = t, this._parents = e; } function Ee() { return new D([[document.documentElement]], Ho); } function Pl() { return this; } D.prototype = Ee.prototype = { constructor: D, select: nc, selectAll: oc, selectChild: lc, selectChildren: pc, filter: gc, data: wc, enter: yc, exit: Mc, join: Ac, merge: $c, selection: Pl, order: Nc, sort: Tc, call: kc, nodes: Pc, node: Ec, size: Oc, empty: zc, each: Cc, attr: qc, style: Uc, property: Kc, classed: Qc, text: rl, html: sl, raise: cl, lower: fl, append: hl, insert: pl, remove: yl, clone: vl, datum: ml, on: $l, dispatch: Sl, [Symbol.iterator]: kl }; function El(t) { return typeof t == "string" ? new D([[document.querySelector(t)]], [document.documentElement]) : new D([[t]], Ho); } function si(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } function Uo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function Oe() { } var ve = 0.7, dn = 1 / ve, Gt = "\\s*([+-]?\\d+)\\s*", me = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ol = /^#([0-9a-f]{3,8})$/, zl = new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`), Cl = new RegExp(`^rgb\\(${et},${et},${et}\\)$`), Il = new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${me}\\)$`), Rl = new RegExp(`^rgba\\(${et},${et},${et},${me}\\)$`), jl = new RegExp(`^hsl\\(${me},${et},${et}\\)$`), Fl = new RegExp(`^hsla\\(${me},${et},${et},${me}\\)$`), Ui = { 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 }; si(Oe, Et, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: Yi, // Deprecated! Use color.formatHex. formatHex: Yi, formatHex8: Dl, formatHsl: Ll, formatRgb: Gi, toString: Gi }); function Yi() { return this.rgb().formatHex(); } function Dl() { return this.rgb().formatHex8(); } function Ll() { return Yo(this).formatHsl(); } function Gi() { return this.rgb().formatRgb(); } function Et(t) { var e, n; return t = (t + "").trim().toLowerCase(), (e = Ol.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Vi(e) : n === 3 ? new R(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Fe(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Fe(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = zl.exec(t)) ? new R(e[1], e[2], e[3], 1) : (e = Cl.exec(t)) ? new R(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Il.exec(t)) ? Fe(e[1], e[2], e[3], e[4]) : (e = Rl.exec(t)) ? Fe(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = jl.exec(t)) ? Zi(e[1], e[2] / 100, e[3] / 100, 1) : (e = Fl.exec(t)) ? Zi(e[1], e[2] / 100, e[3] / 100, e[4]) : Ui.hasOwnProperty(t) ? Vi(Ui[t]) : t === "transparent" ? new R(NaN, NaN, NaN, 0) : null; } function Vi(t) { return new R(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function Fe(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new R(t, e, n, r); } function ql(t) { return t instanceof Oe || (t = Et(t)), t ? (t = t.rgb(), new R(t.r, t.g, t.b, t.opacity)) : new R(); } function pn(t, e, n, r) { return arguments.length === 1 ? ql(t) : new R(t, e, n, r ?? 1); } function R(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } si(R, pn, Uo(Oe, { brighter(t) { return t = t == null ? dn : Math.pow(dn, t), new R(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? ve : Math.pow(ve, t), new R(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new R(kt(this.r), kt(this.g), kt(this.b), gn(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: Ki, // Deprecated! Use color.formatHex. formatHex: Ki, formatHex8: Xl, formatRgb: Wi, toString: Wi })); function Ki() { return `#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}`; } function Xl() { return `#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}${Tt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Wi() { const t = gn(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${kt(this.r)}, ${kt(this.g)}, ${kt(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function gn(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function kt(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function Tt(t) { return t = kt(t), (t < 16 ? "0" : "") + t.toString(16); } function Zi(t, e, n, r) { return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new V(t, e, n, r); } function Yo(t) { if (t instanceof V) return new V(t.h, t.s, t.l, t.opacity); if (t instanceof Oe || (t = Et(t)), !t) return new V(); if (t instanceof V) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), o = NaN, s = a - i, c = (a + i) / 2; return s ? (e === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - e) / s + 2 : o = (e - n) / s + 4, s /= c < 0.5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new V(o, s, c, t.opacity); } function Bl(t, e, n, r) { return arguments.length === 1 ? Yo(t) : new V(t, e, n, r ?? 1); } function V(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } si(V, Bl, Uo(Oe, { brighter(t) { return t = t == null ? dn : Math.pow(dn, t), new V(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? ve : Math.pow(ve, t), new V(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new R( or(t >= 240 ? t - 240 : t + 120, i, r), or(t, i, r), or(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new V(Ji(this.h), De(this.s), De(this.l), gn(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 t = gn(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Ji(this.h)}, ${De(this.s) * 100}%, ${De(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Ji(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function De(t) { return Math.max(0, Math.min(1, t || 0)); } function or(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } const ui = (t) => () => t; function Hl(t, e) { return function(n) { return t + n * e; }; } function Ul(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } function Yl(t) { return (t = +t) == 1 ? Go : function(e, n) { return n - e ? Ul(e, n, t) : ui(isNaN(e) ? n : e); }; } function Go(t, e) { var n = e - t; return n ? Hl(t, n) : ui(isNaN(t) ? e : t); } const Mt = function t(e) { var n = Yl(e); function r(i, a) { var o = n((i = pn(i)).r, (a = pn(a)).r), s = n(i.g, a.g), c = n(i.b, a.b), u = Go(i.opacity, a.opacity); return function(l) { return i.r = o(l), i.g = s(l), i.b = c(l), i.opacity = u(l), i + ""; }; } return r.gamma = t, r; }(1); function Gl(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(a) { for (i = 0; i < n; ++i) r[i] = t[i] * (1 - a) + e[i] * a; return r; }; } function Vl(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Kl(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), a = new Array(n), o; for (o = 0; o < r; ++o) i[o] = Cn(t[o], e[o]); for (; o < n; ++o) a[o] = e[o]; return function(s) { for (o = 0; o < r; ++o) a[o] = i[o](s); return a; }; } function Wl(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } function Y(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } function Zl(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) i in t ? n[i] = Cn(t[i], e[i]) : r[i] = e[i]; return function(a) { for (i in n) r[i] = n[i](a); return r; }; } var Mr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, sr = new RegExp(Mr.source, "g"); function Jl(t) { return function() { return t; }; } function Ql(t) { return function(e) { return t(e) + ""; }; } function Vo(t, e) { var n = Mr.lastIndex = sr.lastIndex = 0, r, i, a, o = -1, s = [], c = []; for (t = t + "", e = e + ""; (r = Mr.exec(t)) && (i = sr.exec(e)); ) (a = i.index) > n && (a = e.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, c.push({ i: o, x: Y(r, i) })), n = sr.lastIndex; return n < e.length && (a = e.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? c[0] ? Ql(c[0].x) : Jl(e) : (e = c.length, function(u) { for (var l = 0, h; l < e; ++l) s[(h = c[l]).i] = h.x(u); return s.join(""); }); } function Cn(t, e) { var n = typeof e, r; return e == null || n === "boolean" ? ui(e) : (n === "number" ? Y : n === "string" ? (r = Et(e)) ? (e = r, Mt) : Vo : e instanceof Et ? Mt : e instanceof Date ? Wl : Vl(e) ? Gl : Array.isArray(e) ? Kl : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Zl : Y)(t, e); } function tf(t, e) { return t = +t, e = +e, function(n) { return Math.round(t * (1 - n) + e * n); }; } var Qi = 180 / Math.PI, Ar = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function Ko(t, e, n, r, i, a) { var o, s, c; return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (c = t * n + e * r) && (n -= t * c, r -= e * c), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, c /= s), t * r < e * n && (t = -t, e = -e, c = -c, o = -o), { translateX: i, translateY: a, rotate: Math.atan2(e, t) * Qi, skewX: Math.atan(c) * Qi, scaleX: o, scaleY: s }; } var Le; function ef(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? Ar : Ko(e.a, e.b, e.c, e.d, e.e, e.f); } function nf(t) { return t == null || (Le || (Le = document.createElementNS("http://www.w3.org/2000/svg", "g")), Le.setAttribute("transform", t), !(t = Le.transform.baseVal.consolidate())) ? Ar : (t = t.matrix, Ko(t.a, t.b, t.c, t.d, t.e, t.f)); } function Wo(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function a(u, l, h, f, d, g) { if (u !== h || l !== f) { var b = d.push("translate(", null, e, null, n); g.push({ i: b - 4, x: Y(u, h) }, { i: b - 2, x: Y(l, f) }); } else (h || f) && d.push("translate(" + h + e + f + n); } function o(u, l, h, f) { u !== l ? (u - l > 180 ? l += 360 : l - u > 180 && (u += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Y(u, l) })) : l && h.push(i(h) + "rotate(" + l + r); } function s(u, l, h, f) { u !== l ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Y(u, l) }) : l && h.push(i(h) + "skewX(" + l + r); } function c(u, l, h, f, d, g) { if (u !== h || l !== f) { var b = d.push(i(d) + "scale(", null, ",", null, ")"); g.push({ i: b - 4, x: Y(u, h) }, { i: b - 2, x: Y(l, f) }); } else (h !== 1 || f !== 1) && d.push(i(d) + "scale(" + h + "," + f + ")"); } return function(u, l) { var h = [], f = []; return u = t(u), l = t(l), a(u.translateX, u.translateY, l.translateX, l.translateY, h, f), o(u.rotate, l.rotate, h, f), s(u.skewX, l.skewX, h, f), c(u.scaleX, u.scaleY, l.scaleX, l.scaleY, h, f), u = l = null, function(d) { for (var g = -1, b = f.length, m; ++g < b; ) h[(m = f[g]).i] = m.x(d); return h.join(""); }; }; } var rf = Wo(ef, "px, ", "px)", "deg)"), af = Wo(nf, ", ", ")", ")"); function qe(t, e) { e === void 0 && (e = t, t = Cn); for (var n = 0, r = e.length - 1, i = e[0], a = new Array(r < 0 ? 0 : r); n < r; ) a[n] = t(i, i = e[++n]); return function(o) { var s = Math.max(0, Math.min(r - 1, Math.floor(o *= r))); return a[s](o - s); }; } var Zt = 0, fe = 0, se = 0, Zo = 1e3, yn, he, bn = 0, Ot = 0, In = 0, we = typeof performance == "object" && performance.now ? performance : Date, Jo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Rn() { return Ot || (Jo(of), Ot = we.now() + In); } function of() { Ot = 0; } function xe() { this._call = this._time = this._next = null; } xe.prototype = Qo.prototype = { constructor: xe, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); n = (n == null ? Rn() : +n) + (e == null ? 0 : +e), !this._next && he !== this && (he ? he._next = this : yn = this, he = this), this._call = t, this._time = n, $r(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, $r()); } }; function Qo(t, e, n) { var r = new xe(); return r.restart(t, e, n), r; } function sf() { Rn(), ++Zt; for (var t = yn, e; t; ) (e = Ot - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --Zt; } function ta() { Ot = (bn = we.now()) + In, Zt = fe = 0; try { sf(); } finally { Zt = 0, cf(), Ot = 0; } } function uf() { var t = we.now(), e = t - bn; e > Zo && (In -= e, bn = t); } function cf() { for (var t, e = yn, n, r = 1 / 0; e; ) e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : yn = n); he = t, $r(r); } function $r(t) { if (!Zt) { fe && (fe = clearTimeout(fe)); var e = t - Ot; e > 24 ? (t < 1 / 0 && (fe = setTimeout(ta, t - we.now() - In)), se && (se = clearInterval(se))) : (se || (bn = we.now(), se = setInterval(uf, Zo)), Zt = 1, Jo(ta)); } } function ea(t, e, n) { var r = new xe(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } function lf(t, e, n) { var r = new xe(), i = e; return r._restart = r.restart, r.restart = function(a, o, s) { o = +o, s = s == null ? Rn() : +s, r._restart(function c(u) { u += i, r._restart(c, i += o, s), a(u); }, o, s); }, r.restart(t, e, n), r; } var ff = Oo("start", "end", "cancel", "interrupt"), hf = [], ts = 0, na = 1, Nr = 2, en = 3, ra = 4, Tr = 5, nn = 6; function jn(t, e, n, r, i, a) { var o = t.__transition; if (!o) t.__transition = {}; else if (n in o) return; df(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. on: ff, tween: hf, time: a.time, delay: a.delay, duration: a.duration, ease: a.ease, timer: null, state: ts }); } function ci(t, e) { var n = Z(t, e); if (n.state > ts) throw new Error("too late; already scheduled"); return n; } function it(t, e) { var n = Z(t, e); if (n.state > en) throw new Error("too late; already running"); return n; } function Z(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } function df(t, e, n) { var r = t.__transition, i; r[e] = n, n.timer = Qo(a, 0, n.time); function a(u) { n.state = na, n.timer.restart(o, n.delay, n.time), n.delay <= u && o(u - n.delay); } function o(u) { var l, h, f, d; if (n.state !== na) return c(); for (l in r) if (d = r[l], d.name === n.name) { if (d.state === en) return ea(o); d.state === ra ? (d.state = nn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[l]) : +l < e && (d.state = nn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[l]); } if (ea(function() { n.state === en && (n.state = ra, n.timer.restart(s, n.delay, n.time), s(u)); }), n.state = Nr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Nr) { for (n.state = en, i = new Array(f = n.tween.length), l = 0, h = -1; l < f; ++l) (d = n.tween[l].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function s(u) { for (var l = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(c), n.state = Tr, 1), h = -1, f = i.length; ++h < f; ) i[h].call(t, l); n.state === Tr && (n.on.call("end", t, t.__data__, n.index, n.group), c()); } function c() { n.state = nn, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } function pf(t, e) { var n = t.__transition, r, i, a = !0, o; if (n) { e = e == null ? null : e + ""; for (o in n) { if ((r = n[o]).name !== e) { a = !1; continue; } i = r.state > Nr && r.state < Tr, r.state = nn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[o]; } a && delete t.__transition; } } function gf(t) { return this.each(function() { pf(this, t); }); } function yf(t, e) { var n, r; return function() { var i = it(this, t), a = i.tween; if (a !== n) { r = n = a; for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === e) { r = r.slice(), r.splice(o, 1); break; } } i.tween = r; }; } function bf(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { var a = it(this, t), o = a.tween; if (o !== r) { i = (r = o).slice(); for (var s = { name: e, value: n }, c = 0, u = i.length; c < u; ++c) if (i[c].name === e) { i[c] = s; break; } c === u && i.push(s); } a.tween = i; }; } function _f(t, e) { var n = this._id; if (t += "", arguments.length < 2) { for (var r = Z(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === t) return o.value; return null; } return this.each((e == null ? yf : bf)(n, t, e)); } function li(t, e, n) { var r = t._id; return t.each(function() { var i = it(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { return Z(i, r).value[e]; }; } function es(t, e) { var n; return (typeof e == "number" ? Y : e instanceof Et ? Mt : (n = Et(e)) ? (e = n, Mt) : Vo)(t, e); } function vf(t) { return function() { this.removeAttribute(t); }; } function mf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function wf(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttribute(t); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function xf(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttributeNS(t.space, t.local); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Mf(t, e, n) { var r, i, a; return function() { var o, s = n(this), c; return s == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = e(r = o, s))); }; } function Af(t, e, n) { var r, i, a; return function() { var o, s = n(this), c; return s == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = e(r = o, s))); }; } function $f(t, e) { var n = zn(t), r = n === "transform" ? af : es; return this.attrTween(t, typeof e == "function" ? (n.local ? Af : Mf)(n, r, li(this, "attr." + t, e)) : e == null ? (n.local ? mf : vf)(n) : (n.local ? xf : wf)(n, r, e)); } function Nf(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } function Tf(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } function Sf(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && Tf(t, a)), n; } return i._value = e, i; } function kf(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && Nf(t, a)), n; } return i._value = e, i; } function Pf(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); var r = zn(t); return this.tween(n, (r.local ? Sf : kf)(r, e)); } function Ef(t, e) { return function() { ci(this, t).delay = +e.apply(this, arguments); }; } function Of(t, e) { return e = +e, function() { ci(this, t).delay = e; }; } function zf(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? Ef : Of)(e, t)) : Z(this.node(), e).delay; } function Cf(t, e) { return function() { it(this, t).duration = +e.apply(this, arguments); }; } function If(t, e) { return e = +e, function() { it(this, t).duration = e; }; } function Rf(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? Cf : If)(e, t)) : Z(this.node(), e).duration; } function jf(t, e) { if (typeof e != "function") throw new Error(); return function() { it(this, t).ease = e; }; } function Ff(t) { var e = this._id; return arguments.length ? this.each(jf(e, t)) : Z(this.node(), e).ease; } function Df(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); it(this, t).ease = n; }; } function Lf(t) { if (typeof t != "function") throw new Error(); return this.each(Df(this._id, t)); } function qf(t) { typeof t != "function" && (t = Io(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], c, u = 0; u < o; ++u) (c = a[u]) && t.call(c, c.__data__, u, a) && s.push(c); return new dt(r, this._parents, this._name, this._id); } function Xf(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), o = new Array(r), s = 0; s < a; ++s) for (var c = e[s], u = n[s], l = c.length, h = o[s] = new Array(l), f, d = 0; d < l; ++d) (f = c[d] || u[d]) && (h[d] = f); for (; s < r; ++s) o[s] = e[s]; return new dt(o, this._parents, this._name, this._id); } function Bf(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } function Hf(t, e, n) { var r, i, a = Bf(e) ? ci : it; return function() { var o = a(this, t), s = o.on; s !== r && (i = (r = s).copy()).on(e, n), o.on = i; }; } function Uf(t, e) { var n = this._id; return arguments.length < 2 ? Z(this.node(), n).on.on(t) : this.each(Hf(n, t, e)); } function Yf(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } function Gf() { return this.on("end.