UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

1,653 lines 375 kB
function ch(t) { for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i]; var r = Array.from(typeof t == "string" ? [t] : t); r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, ""); var n = r.reduce(function(a, l) { var h = l.match(/\n([\t ]+|(?!\s).)/g); return h ? a.concat(h.map(function(c) { var u, g; return (g = (u = c.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && g !== void 0 ? g : 0; })) : a; }, []); if (n.length) { var o = new RegExp(` [ ]{` + Math.min.apply(Math, n) + "}", "g"); r = r.map(function(a) { return a.replace(o, ` `); }); } r[0] = r[0].replace(/^\r?\n/, ""); var s = r[0]; return e.forEach(function(a, l) { var h = s.match(/(?:^|\n)( *)$/), c = h ? h[1] : "", u = a; typeof a == "string" && a.includes(` `) && (u = String(a).split(` `).map(function(g, p) { return p === 0 ? g : "" + c + g; }).join(` `)), s += u + r[l + 1]; }), s; } var Es = 60, Ms = Es * 60, Os = Ms * 24, uh = Os * 7, xe = 1e3, Pr = Es * xe, vo = Ms * xe, fh = Os * xe, dh = uh * xe, kn = "millisecond", de = "second", pe = "minute", ge = "hour", Ot = "day", wi = "week", dt = "month", $s = "quarter", $t = "year", me = "date", ph = "YYYY-MM-DDTHH:mm:ssZ", ko = "Invalid Date", gh = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, mh = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g; const _h = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(e) { var i = ["th", "st", "nd", "rd"], r = e % 100; return "[" + e + (i[(r - 20) % 10] || i[r] || i[0]) + "]"; } }; var nn = function(e, i, r) { var n = String(e); return !n || n.length >= i ? e : "" + Array(i + 1 - n.length).join(r) + e; }, yh = function(e) { var i = -e.utcOffset(), r = Math.abs(i), n = Math.floor(r / 60), o = r % 60; return (i <= 0 ? "+" : "-") + nn(n, 2, "0") + ":" + nn(o, 2, "0"); }, Ch = function t(e, i) { if (e.date() < i.date()) return -t(i, e); var r = (i.year() - e.year()) * 12 + (i.month() - e.month()), n = e.clone().add(r, dt), o = i - n < 0, s = e.clone().add(r + (o ? -1 : 1), dt); return +(-(r + (i - n) / (o ? n - s : s - n)) || 0); }, xh = function(e) { return e < 0 ? Math.ceil(e) || 0 : Math.floor(e); }, bh = function(e) { var i = { M: dt, y: $t, w: wi, d: Ot, D: me, h: ge, m: pe, s: de, ms: kn, Q: $s }; return i[e] || String(e || "").toLowerCase().replace(/s$/, ""); }, Th = function(e) { return e === void 0; }; const Sh = { s: nn, z: yh, m: Ch, a: xh, p: bh, u: Th }; var Pe = "en", Xt = {}; Xt[Pe] = _h; var wn = function(e) { return e instanceof lr; }, Pi = function t(e, i, r) { var n; if (!e) return Pe; if (typeof e == "string") { var o = e.toLowerCase(); Xt[o] && (n = o), i && (Xt[o] = i, n = o); var s = e.split("-"); if (!n && s.length > 1) return t(s[0]); } else { var a = e.name; Xt[a] = e, n = a; } return !r && n && (Pe = n), n || !r && Pe; }, G = function(e, i) { if (wn(e)) return e.clone(); var r = typeof i == "object" ? i : {}; return r.date = e, r.args = arguments, new lr(r); }, vh = function(e, i) { return G(e, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset // todo: refactor; do not use this.$offset in you code }); }, $ = Sh; $.l = Pi; $.i = wn; $.w = vh; var kh = function(e) { var i = e.date, r = e.utc; if (i === null) return /* @__PURE__ */ new Date(NaN); if ($.u(i)) return /* @__PURE__ */ new Date(); if (i instanceof Date) return new Date(i); if (typeof i == "string" && !/Z$/i.test(i)) { var n = i.match(gh); if (n) { var o = n[2] - 1 || 0, s = (n[7] || "0").substring(0, 3); return r ? new Date(Date.UTC(n[1], o, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, s)) : new Date(n[1], o, n[3] || 1, n[4] || 0, n[5] || 0, n[6] || 0, s); } } return new Date(i); }, lr = /* @__PURE__ */ function() { function t(i) { this.$L = Pi(i.locale, null, !0), this.parse(i); } var e = t.prototype; return e.parse = function(r) { this.$d = kh(r), this.$x = r.x || {}, this.init(); }, e.init = function() { var r = this.$d; this.$y = r.getFullYear(), this.$M = r.getMonth(), this.$D = r.getDate(), this.$W = r.getDay(), this.$H = r.getHours(), this.$m = r.getMinutes(), this.$s = r.getSeconds(), this.$ms = r.getMilliseconds(); }, e.$utils = function() { return $; }, e.isValid = function() { return this.$d.toString() !== ko; }, e.isSame = function(r, n) { var o = G(r); return this.startOf(n) <= o && o <= this.endOf(n); }, e.isAfter = function(r, n) { return G(r) < this.startOf(n); }, e.isBefore = function(r, n) { return this.endOf(n) < G(r); }, e.$g = function(r, n, o) { return $.u(r) ? this[n] : this.set(o, r); }, e.unix = function() { return Math.floor(this.valueOf() / 1e3); }, e.valueOf = function() { return this.$d.getTime(); }, e.startOf = function(r, n) { var o = this, s = $.u(n) ? !0 : n, a = $.p(r), l = function(A, C) { var F = $.w(o.$u ? Date.UTC(o.$y, C, A) : new Date(o.$y, C, A), o); return s ? F : F.endOf(Ot); }, h = function(A, C) { var F = [0, 0, 0, 0], D = [23, 59, 59, 999]; return $.w(o.toDate()[A].apply( // eslint-disable-line prefer-spread o.toDate("s"), (s ? F : D).slice(C) ), o); }, c = this.$W, u = this.$M, g = this.$D, p = "set" + (this.$u ? "UTC" : ""); switch (a) { case $t: return s ? l(1, 0) : l(31, 11); case dt: return s ? l(1, u) : l(0, u + 1); case wi: { var _ = this.$locale().weekStart || 0, T = (c < _ ? c + 7 : c) - _; return l(s ? g - T : g + (6 - T), u); } case Ot: case me: return h(p + "Hours", 0); case ge: return h(p + "Minutes", 1); case pe: return h(p + "Seconds", 2); case de: return h(p + "Milliseconds", 3); default: return this.clone(); } }, e.endOf = function(r) { return this.startOf(r, !1); }, e.$set = function(r, n) { var o, s = $.p(r), a = "set" + (this.$u ? "UTC" : ""), l = (o = {}, o[Ot] = a + "Date", o[me] = a + "Date", o[dt] = a + "Month", o[$t] = a + "FullYear", o[ge] = a + "Hours", o[pe] = a + "Minutes", o[de] = a + "Seconds", o[kn] = a + "Milliseconds", o)[s], h = s === Ot ? this.$D + (n - this.$W) : n; if (s === dt || s === $t) { var c = this.clone().set(me, 1); c.$d[l](h), c.init(), this.$d = c.set(me, Math.min(this.$D, c.daysInMonth())).$d; } else l && this.$d[l](h); return this.init(), this; }, e.set = function(r, n) { return this.clone().$set(r, n); }, e.get = function(r) { return this[$.p(r)](); }, e.add = function(r, n) { var o = this, s; r = Number(r); var a = $.p(n), l = function(g) { var p = G(o); return $.w(p.date(p.date() + Math.round(g * r)), o); }; if (a === dt) return this.set(dt, this.$M + r); if (a === $t) return this.set($t, this.$y + r); if (a === Ot) return l(1); if (a === wi) return l(7); var h = (s = {}, s[pe] = Pr, s[ge] = vo, s[de] = xe, s)[a] || 1, c = this.$d.getTime() + r * h; return $.w(c, this); }, e.subtract = function(r, n) { return this.add(r * -1, n); }, e.format = function(r) { var n = this, o = this.$locale(); if (!this.isValid()) return o.invalidDate || ko; var s = r || ph, a = $.z(this), l = this.$H, h = this.$m, c = this.$M, u = o.weekdays, g = o.months, p = o.meridiem, _ = function(F, D, R, V) { return F && (F[D] || F(n, s)) || R[D].slice(0, V); }, T = function(F) { return $.s(l % 12 || 12, F, "0"); }, B = p || function(C, F, D) { var R = C < 12 ? "AM" : "PM"; return D ? R.toLowerCase() : R; }, A = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: c + 1, MM: $.s(c + 1, 2, "0"), MMM: _(o.monthsShort, c, g, 3), MMMM: _(g, c), D: this.$D, DD: $.s(this.$D, 2, "0"), d: String(this.$W), dd: _(o.weekdaysMin, this.$W, u, 2), ddd: _(o.weekdaysShort, this.$W, u, 3), dddd: u[this.$W], H: String(l), HH: $.s(l, 2, "0"), h: T(1), hh: T(2), a: B(l, h, !0), A: B(l, h, !1), m: String(h), mm: $.s(h, 2, "0"), s: String(this.$s), ss: $.s(this.$s, 2, "0"), SSS: $.s(this.$ms, 3, "0"), Z: a // 'ZZ' logic below }; return s.replace(mh, function(C, F) { return F || A[C] || a.replace(":", ""); }); }, e.utcOffset = function() { return -Math.round(this.$d.getTimezoneOffset() / 15) * 15; }, e.diff = function(r, n, o) { var s, a = $.p(n), l = G(r), h = (l.utcOffset() - this.utcOffset()) * Pr, c = this - l, u = $.m(this, l); return u = (s = {}, s[$t] = u / 12, s[dt] = u, s[$s] = u / 3, s[wi] = (c - h) / dh, s[Ot] = (c - h) / fh, s[ge] = c / vo, s[pe] = c / Pr, s[de] = c / xe, s)[a] || c, o ? u : $.a(u); }, e.daysInMonth = function() { return this.endOf(dt).$D; }, e.$locale = function() { return Xt[this.$L]; }, e.locale = function(r, n) { if (!r) return this.$L; var o = this.clone(), s = Pi(r, n, !0); return s && (o.$L = s), o; }, e.clone = function() { return $.w(this.$d, this); }, e.toDate = function() { return new Date(this.valueOf()); }, e.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, e.toISOString = function() { return this.$d.toISOString(); }, e.toString = function() { return this.$d.toUTCString(); }, t; }(), Is = lr.prototype; G.prototype = Is; [["$ms", kn], ["$s", de], ["$m", pe], ["$H", ge], ["$W", Ot], ["$M", dt], ["$y", $t], ["$D", me]].forEach(function(t) { Is[t[1]] = function(e) { return this.$g(e, t[0], t[1]); }; }); G.extend = function(t, e) { return t.$i || (t(e, lr, G), t.$i = !0), G; }; G.locale = Pi; G.isDayjs = wn; G.unix = function(t) { return G(t * 1e3); }; G.en = Xt[Pe]; G.Ls = Xt; G.p = {}; const wt = { trace: 0, debug: 1, info: 2, warn: 3, error: 4, fatal: 5 }, b = { trace: (...t) => { }, debug: (...t) => { }, info: (...t) => { }, warn: (...t) => { }, error: (...t) => { }, fatal: (...t) => { } }, Bn = function(t = "fatal") { let e = wt.fatal; typeof t == "string" ? (t = t.toLowerCase(), t in wt && (e = wt[t])) : typeof t == "number" && (e = t), b.trace = () => { }, b.debug = () => { }, b.info = () => { }, b.warn = () => { }, b.error = () => { }, b.fatal = () => { }, e <= wt.fatal && (b.fatal = console.error ? console.error.bind(console, lt("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", lt("FATAL"))), e <= wt.error && (b.error = console.error ? console.error.bind(console, lt("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", lt("ERROR"))), e <= wt.warn && (b.warn = console.warn ? console.warn.bind(console, lt("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", lt("WARN"))), e <= wt.info && (b.info = console.info ? console.info.bind(console, lt("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", lt("INFO"))), e <= wt.debug && (b.debug = console.debug ? console.debug.bind(console, lt("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", lt("DEBUG"))), e <= wt.trace && (b.trace = console.debug ? console.debug.bind(console, lt("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", lt("TRACE"))); }, lt = (t) => `%c${G().format("ss.SSS")} : ${t} : `; var Fn = {}; Object.defineProperty(Fn, "__esModule", { value: !0 }); var Ds = Fn.sanitizeUrl = void 0, wh = /^([^\w]*)(javascript|data|vbscript)/im, Bh = /&#(\w+)(^\w|;)?/g, Fh = /&(newline|tab);/gi, Lh = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, Ah = /^.+(:|&colon;)/gim, Eh = [".", "/"]; function Mh(t) { return Eh.indexOf(t[0]) > -1; } function Oh(t) { return t.replace(Bh, function(e, i) { return String.fromCharCode(i); }); } function $h(t) { var e = Oh(t || "").replace(Fh, "").replace(Lh, "").trim(); if (!e) return "about:blank"; if (Mh(e)) return e; var i = e.match(Ah); if (!i) return e; var r = i[0]; return wh.test(r) ? "about:blank" : e; } Ds = Fn.sanitizeUrl = $h; var Ih = { value: () => { } }; function Ns() { for (var t = 0, e = arguments.length, i = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in i || /[\s.]/.test(r)) throw new Error("illegal type: " + r); i[r] = []; } return new Bi(i); } function Bi(t) { this._ = t; } function Dh(t, e) { return t.trim().split(/^|\s+/).map(function(i) { var r = "", n = i.indexOf("."); if (n >= 0 && (r = i.slice(n + 1), i = i.slice(0, n)), i && !e.hasOwnProperty(i)) throw new Error("unknown type: " + i); return { type: i, name: r }; }); } Bi.prototype = Ns.prototype = { constructor: Bi, on: function(t, e) { var i = this._, r = Dh(t + "", i), n, o = -1, s = r.length; if (arguments.length < 2) { for (; ++o < s; ) if ((n = (t = r[o]).type) && (n = Nh(i[n], t.name))) return n; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++o < s; ) if (n = (t = r[o]).type) i[n] = wo(i[n], t.name, e); else if (e == null) for (n in i) i[n] = wo(i[n], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var i in e) t[i] = e[i].slice(); return new Bi(t); }, call: function(t, e) { if ((n = arguments.length - 2) > 0) for (var i = new Array(n), r = 0, n, o; r < n; ++r) i[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (o = this._[t], r = 0, n = o.length; r < n; ++r) o[r].value.apply(e, i); }, apply: function(t, e, i) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], n = 0, o = r.length; n < o; ++n) r[n].value.apply(e, i); } }; function Nh(t, e) { for (var i = 0, r = t.length, n; i < r; ++i) if ((n = t[i]).name === e) return n.value; } function wo(t, e, i) { for (var r = 0, n = t.length; r < n; ++r) if (t[r].name === e) { t[r] = Ih, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return i != null && t.push({ name: e, value: i }), t; } var on = "http://www.w3.org/1999/xhtml"; const Bo = { svg: "http://www.w3.org/2000/svg", xhtml: on, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function hr(t) { var e = t += "", i = e.indexOf(":"); return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), Bo.hasOwnProperty(e) ? { space: Bo[e], local: t } : t; } function Rh(t) { return function() { var e = this.ownerDocument, i = this.namespaceURI; return i === on && e.documentElement.namespaceURI === on ? e.createElement(t) : e.createElementNS(i, t); }; } function qh(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Rs(t) { var e = hr(t); return (e.local ? qh : Rh)(e); } function Ph() { } function Ln(t) { return t == null ? Ph : function() { return this.querySelector(t); }; } function zh(t) { typeof t != "function" && (t = Ln(t)); for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n) for (var o = e[n], s = o.length, a = r[n] = new Array(s), l, h, c = 0; c < s; ++c) (l = o[c]) && (h = t.call(l, l.__data__, c, o)) && ("__data__" in l && (h.__data__ = l.__data__), a[c] = h); return new st(r, this._parents); } function Wh(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function Hh() { return []; } function qs(t) { return t == null ? Hh : function() { return this.querySelectorAll(t); }; } function jh(t) { return function() { return Wh(t.apply(this, arguments)); }; } function Uh(t) { typeof t == "function" ? t = jh(t) : t = qs(t); for (var e = this._groups, i = e.length, r = [], n = [], o = 0; o < i; ++o) for (var s = e[o], a = s.length, l, h = 0; h < a; ++h) (l = s[h]) && (r.push(t.call(l, l.__data__, h, s)), n.push(l)); return new st(r, n); } function Ps(t) { return function() { return this.matches(t); }; } function zs(t) { return function(e) { return e.matches(t); }; } var Yh = Array.prototype.find; function Gh(t) { return function() { return Yh.call(this.children, t); }; } function Vh() { return this.firstElementChild; } function Xh(t) { return this.select(t == null ? Vh : Gh(typeof t == "function" ? t : zs(t))); } var Kh = Array.prototype.filter; function Zh() { return Array.from(this.children); } function Jh(t) { return function() { return Kh.call(this.children, t); }; } function Qh(t) { return this.selectAll(t == null ? Zh : Jh(typeof t == "function" ? t : zs(t))); } function tc(t) { typeof t != "function" && (t = Ps(t)); for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n) for (var o = e[n], s = o.length, a = r[n] = [], l, h = 0; h < s; ++h) (l = o[h]) && t.call(l, l.__data__, h, o) && a.push(l); return new st(r, this._parents); } function Ws(t) { return new Array(t.length); } function ec() { return new st(this._enter || this._groups.map(Ws), this._parents); } function zi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } zi.prototype = { constructor: zi, 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 ic(t) { return function() { return t; }; } function rc(t, e, i, r, n, o) { for (var s = 0, a, l = e.length, h = o.length; s < h; ++s) (a = e[s]) ? (a.__data__ = o[s], r[s] = a) : i[s] = new zi(t, o[s]); for (; s < l; ++s) (a = e[s]) && (n[s] = a); } function nc(t, e, i, r, n, o, s) { var a, l, h = /* @__PURE__ */ new Map(), c = e.length, u = o.length, g = new Array(c), p; for (a = 0; a < c; ++a) (l = e[a]) && (g[a] = p = s.call(l, l.__data__, a, e) + "", h.has(p) ? n[a] = l : h.set(p, l)); for (a = 0; a < u; ++a) p = s.call(t, o[a], a, o) + "", (l = h.get(p)) ? (r[a] = l, l.__data__ = o[a], h.delete(p)) : i[a] = new zi(t, o[a]); for (a = 0; a < c; ++a) (l = e[a]) && h.get(g[a]) === l && (n[a] = l); } function oc(t) { return t.__data__; } function sc(t, e) { if (!arguments.length) return Array.from(this, oc); var i = e ? nc : rc, r = this._parents, n = this._groups; typeof t != "function" && (t = ic(t)); for (var o = n.length, s = new Array(o), a = new Array(o), l = new Array(o), h = 0; h < o; ++h) { var c = r[h], u = n[h], g = u.length, p = ac(t.call(c, c && c.__data__, h, r)), _ = p.length, T = a[h] = new Array(_), B = s[h] = new Array(_), A = l[h] = new Array(g); i(c, u, T, B, A, p, e); for (var C = 0, F = 0, D, R; C < _; ++C) if (D = T[C]) { for (C >= F && (F = C + 1); !(R = B[F]) && ++F < _; ) ; D._next = R || null; } } return s = new st(s, r), s._enter = a, s._exit = l, s; } function ac(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function lc() { return new st(this._exit || this._groups.map(Ws), this._parents); } function hc(t, e, i) { var r = this.enter(), n = this, o = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (n = e(n), n && (n = n.selection())), i == null ? o.remove() : i(o), r && n ? r.merge(n).order() : n; } function cc(t) { for (var e = t.selection ? t.selection() : t, i = this._groups, r = e._groups, n = i.length, o = r.length, s = Math.min(n, o), a = new Array(n), l = 0; l < s; ++l) for (var h = i[l], c = r[l], u = h.length, g = a[l] = new Array(u), p, _ = 0; _ < u; ++_) (p = h[_] || c[_]) && (g[_] = p); for (; l < n; ++l) a[l] = i[l]; return new st(a, this._parents); } function uc() { for (var t = this._groups, e = -1, i = t.length; ++e < i; ) for (var r = t[e], n = r.length - 1, o = r[n], s; --n >= 0; ) (s = r[n]) && (o && s.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(s, o), o = s); return this; } function fc(t) { t || (t = dc); function e(u, g) { return u && g ? t(u.__data__, g.__data__) : !u - !g; } for (var i = this._groups, r = i.length, n = new Array(r), o = 0; o < r; ++o) { for (var s = i[o], a = s.length, l = n[o] = new Array(a), h, c = 0; c < a; ++c) (h = s[c]) && (l[c] = h); l.sort(e); } return new st(n, this._parents).order(); } function dc(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function pc() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function gc() { return Array.from(this); } function mc() { for (var t = this._groups, e = 0, i = t.length; e < i; ++e) for (var r = t[e], n = 0, o = r.length; n < o; ++n) { var s = r[n]; if (s) return s; } return null; } function _c() { let t = 0; for (const e of this) ++t; return t; } function yc() { return !this.node(); } function Cc(t) { for (var e = this._groups, i = 0, r = e.length; i < r; ++i) for (var n = e[i], o = 0, s = n.length, a; o < s; ++o) (a = n[o]) && t.call(a, a.__data__, o, n); return this; } function xc(t) { return function() { this.removeAttribute(t); }; } function bc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Tc(t, e) { return function() { this.setAttribute(t, e); }; } function Sc(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function vc(t, e) { return function() { var i = e.apply(this, arguments); i == null ? this.removeAttribute(t) : this.setAttribute(t, i); }; } function kc(t, e) { return function() { var i = e.apply(this, arguments); i == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, i); }; } function wc(t, e) { var i = hr(t); if (arguments.length < 2) { var r = this.node(); return i.local ? r.getAttributeNS(i.space, i.local) : r.getAttribute(i); } return this.each((e == null ? i.local ? bc : xc : typeof e == "function" ? i.local ? kc : vc : i.local ? Sc : Tc)(i, e)); } function Hs(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function Bc(t) { return function() { this.style.removeProperty(t); }; } function Fc(t, e, i) { return function() { this.style.setProperty(t, e, i); }; } function Lc(t, e, i) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i); }; } function Ac(t, e, i) { return arguments.length > 1 ? this.each((e == null ? Bc : typeof e == "function" ? Lc : Fc)(t, e, i ?? "")) : be(this.node(), t); } function be(t, e) { return t.style.getPropertyValue(e) || Hs(t).getComputedStyle(t, null).getPropertyValue(e); } function Ec(t) { return function() { delete this[t]; }; } function Mc(t, e) { return function() { this[t] = e; }; } function Oc(t, e) { return function() { var i = e.apply(this, arguments); i == null ? delete this[t] : this[t] = i; }; } function $c(t, e) { return arguments.length > 1 ? this.each((e == null ? Ec : typeof e == "function" ? Oc : Mc)(t, e)) : this.node()[t]; } function js(t) { return t.trim().split(/^|\s+/); } function An(t) { return t.classList || new Us(t); } function Us(t) { this._node = t, this._names = js(t.getAttribute("class") || ""); } Us.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 Ys(t, e) { for (var i = An(t), r = -1, n = e.length; ++r < n; ) i.add(e[r]); } function Gs(t, e) { for (var i = An(t), r = -1, n = e.length; ++r < n; ) i.remove(e[r]); } function Ic(t) { return function() { Ys(this, t); }; } function Dc(t) { return function() { Gs(this, t); }; } function Nc(t, e) { return function() { (e.apply(this, arguments) ? Ys : Gs)(this, t); }; } function Rc(t, e) { var i = js(t + ""); if (arguments.length < 2) { for (var r = An(this.node()), n = -1, o = i.length; ++n < o; ) if (!r.contains(i[n])) return !1; return !0; } return this.each((typeof e == "function" ? Nc : e ? Ic : Dc)(i, e)); } function qc() { this.textContent = ""; } function Pc(t) { return function() { this.textContent = t; }; } function zc(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function Wc(t) { return arguments.length ? this.each(t == null ? qc : (typeof t == "function" ? zc : Pc)(t)) : this.node().textContent; } function Hc() { this.innerHTML = ""; } function jc(t) { return function() { this.innerHTML = t; }; } function Uc(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function Yc(t) { return arguments.length ? this.each(t == null ? Hc : (typeof t == "function" ? Uc : jc)(t)) : this.node().innerHTML; } function Gc() { this.nextSibling && this.parentNode.appendChild(this); } function Vc() { return this.each(Gc); } function Xc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Kc() { return this.each(Xc); } function Zc(t) { var e = typeof t == "function" ? t : Rs(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function Jc() { return null; } function Qc(t, e) { var i = typeof t == "function" ? t : Rs(t), r = e == null ? Jc : typeof e == "function" ? e : Ln(e); return this.select(function() { return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null); }); } function tu() { var t = this.parentNode; t && t.removeChild(this); } function eu() { return this.each(tu); } function iu() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function ru() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function nu(t) { return this.select(t ? ru : iu); } function ou(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function su(t) { return function(e) { t.call(this, e, this.__data__); }; } function au(t) { return t.trim().split(/^|\s+/).map(function(e) { var i = "", r = e.indexOf("."); return r >= 0 && (i = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: i }; }); } function lu(t) { return function() { var e = this.__on; if (e) { for (var i = 0, r = -1, n = e.length, o; i < n; ++i) o = e[i], (!t.type || o.type === t.type) && o.name === t.name ? this.removeEventListener(o.type, o.listener, o.options) : e[++r] = o; ++r ? e.length = r : delete this.__on; } }; } function hu(t, e, i) { return function() { var r = this.__on, n, o = su(e); if (r) { for (var s = 0, a = r.length; s < a; ++s) if ((n = r[s]).type === t.type && n.name === t.name) { this.removeEventListener(n.type, n.listener, n.options), this.addEventListener(n.type, n.listener = o, n.options = i), n.value = e; return; } } this.addEventListener(t.type, o, i), n = { type: t.type, name: t.name, value: e, listener: o, options: i }, r ? r.push(n) : this.__on = [n]; }; } function cu(t, e, i) { var r = au(t + ""), n, o = r.length, s; if (arguments.length < 2) { var a = this.node().__on; if (a) { for (var l = 0, h = a.length, c; l < h; ++l) for (n = 0, c = a[l]; n < o; ++n) if ((s = r[n]).type === c.type && s.name === c.name) return c.value; } return; } for (a = e ? hu : lu, n = 0; n < o; ++n) this.each(a(r[n], e, i)); return this; } function Vs(t, e, i) { var r = Hs(t), n = r.CustomEvent; typeof n == "function" ? n = new n(e, i) : (n = r.document.createEvent("Event"), i ? (n.initEvent(e, i.bubbles, i.cancelable), n.detail = i.detail) : n.initEvent(e, !1, !1)), t.dispatchEvent(n); } function uu(t, e) { return function() { return Vs(this, t, e); }; } function fu(t, e) { return function() { return Vs(this, t, e.apply(this, arguments)); }; } function du(t, e) { return this.each((typeof e == "function" ? fu : uu)(t, e)); } function* pu() { for (var t = this._groups, e = 0, i = t.length; e < i; ++e) for (var r = t[e], n = 0, o = r.length, s; n < o; ++n) (s = r[n]) && (yield s); } var Xs = [null]; function st(t, e) { this._groups = t, this._parents = e; } function ei() { return new st([[document.documentElement]], Xs); } function gu() { return this; } st.prototype = ei.prototype = { constructor: st, select: zh, selectAll: Uh, selectChild: Xh, selectChildren: Qh, filter: tc, data: sc, enter: ec, exit: lc, join: hc, merge: cc, selection: gu, order: uc, sort: fc, call: pc, nodes: gc, node: mc, size: _c, empty: yc, each: Cc, attr: wc, style: Ac, property: $c, classed: Rc, text: Wc, html: Yc, raise: Vc, lower: Kc, append: Zc, insert: Qc, remove: eu, clone: nu, datum: ou, on: cu, dispatch: du, [Symbol.iterator]: pu }; function Ct(t) { return typeof t == "string" ? new st([[document.querySelector(t)]], [document.documentElement]) : new st([[t]], Xs); } function En(t, e, i) { t.prototype = e.prototype = i, i.constructor = t; } function Ks(t, e) { var i = Object.create(t.prototype); for (var r in e) i[r] = e[r]; return i; } function ii() { } var Ue = 0.7, Wi = 1 / Ue, Ce = "\\s*([+-]?\\d+)\\s*", Ye = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", xt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", mu = /^#([0-9a-f]{3,8})$/, _u = new RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`), yu = new RegExp(`^rgb\\(${xt},${xt},${xt}\\)$`), Cu = new RegExp(`^rgba\\(${Ce},${Ce},${Ce},${Ye}\\)$`), xu = new RegExp(`^rgba\\(${xt},${xt},${xt},${Ye}\\)$`), bu = new RegExp(`^hsl\\(${Ye},${xt},${xt}\\)$`), Tu = new RegExp(`^hsla\\(${Ye},${xt},${xt},${Ye}\\)$`), Fo = { 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 }; En(ii, Ge, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: Lo, // Deprecated! Use color.formatHex. formatHex: Lo, formatHex8: Su, formatHsl: vu, formatRgb: Ao, toString: Ao }); function Lo() { return this.rgb().formatHex(); } function Su() { return this.rgb().formatHex8(); } function vu() { return Zs(this).formatHsl(); } function Ao() { return this.rgb().formatRgb(); } function Ge(t) { var e, i; return t = (t + "").trim().toLowerCase(), (e = mu.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? Eo(e) : i === 3 ? new it(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? _i(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? _i(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 = _u.exec(t)) ? new it(e[1], e[2], e[3], 1) : (e = yu.exec(t)) ? new it(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Cu.exec(t)) ? _i(e[1], e[2], e[3], e[4]) : (e = xu.exec(t)) ? _i(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = bu.exec(t)) ? $o(e[1], e[2] / 100, e[3] / 100, 1) : (e = Tu.exec(t)) ? $o(e[1], e[2] / 100, e[3] / 100, e[4]) : Fo.hasOwnProperty(t) ? Eo(Fo[t]) : t === "transparent" ? new it(NaN, NaN, NaN, 0) : null; } function Eo(t) { return new it(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function _i(t, e, i, r) { return r <= 0 && (t = e = i = NaN), new it(t, e, i, r); } function ku(t) { return t instanceof ii || (t = Ge(t)), t ? (t = t.rgb(), new it(t.r, t.g, t.b, t.opacity)) : new it(); } function sn(t, e, i, r) { return arguments.length === 1 ? ku(t) : new it(t, e, i, r ?? 1); } function it(t, e, i, r) { this.r = +t, this.g = +e, this.b = +i, this.opacity = +r; } En(it, sn, Ks(ii, { brighter(t) { return t = t == null ? Wi : Math.pow(Wi, t), new it(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Ue : Math.pow(Ue, t), new it(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new it(Kt(this.r), Kt(this.g), Kt(this.b), Hi(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: Mo, // Deprecated! Use color.formatHex. formatHex: Mo, formatHex8: wu, formatRgb: Oo, toString: Oo })); function Mo() { return `#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}`; } function wu() { return `#${Vt(this.r)}${Vt(this.g)}${Vt(this.b)}${Vt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Oo() { const t = Hi(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${Kt(this.r)}, ${Kt(this.g)}, ${Kt(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function Hi(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 Vt(t) { return t = Kt(t), (t < 16 ? "0" : "") + t.toString(16); } function $o(t, e, i, r) { return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new pt(t, e, i, r); } function Zs(t) { if (t instanceof pt) return new pt(t.h, t.s, t.l, t.opacity); if (t instanceof ii || (t = Ge(t)), !t) return new pt(); if (t instanceof pt) return t; t = t.rgb(); var e = t.r / 255, i = t.g / 255, r = t.b / 255, n = Math.min(e, i, r), o = Math.max(e, i, r), s = NaN, a = o - n, l = (o + n) / 2; return a ? (e === o ? s = (i - r) / a + (i < r) * 6 : i === o ? s = (r - e) / a + 2 : s = (e - i) / a + 4, a /= l < 0.5 ? o + n : 2 - o - n, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new pt(s, a, l, t.opacity); } function Bu(t, e, i, r) { return arguments.length === 1 ? Zs(t) : new pt(t, e, i, r ?? 1); } function pt(t, e, i, r) { this.h = +t, this.s = +e, this.l = +i, this.opacity = +r; } En(pt, Bu, Ks(ii, { brighter(t) { return t = t == null ? Wi : Math.pow(Wi, t), new pt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Ue : Math.pow(Ue, t), new pt(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, i = this.l, r = i + (i < 0.5 ? i : 1 - i) * e, n = 2 * i - r; return new it( zr(t >= 240 ? t - 240 : t + 120, n, r), zr(t, n, r), zr(t < 120 ? t + 240 : t - 120, n, r), this.opacity ); }, clamp() { return new pt(Io(this.h), yi(this.s), yi(this.l), Hi(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 = Hi(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Io(this.h)}, ${yi(this.s) * 100}%, ${yi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Io(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function yi(t) { return Math.max(0, Math.min(1, t || 0)); } function zr(t, e, i) { return (t < 60 ? e + (i - e) * t / 60 : t < 180 ? i : t < 240 ? e + (i - e) * (240 - t) / 60 : e) * 255; } const Mn = (t) => () => t; function Js(t, e) { return function(i) { return t + i * e; }; } function Fu(t, e, i) { return t = Math.pow(t, i), e = Math.pow(e, i) - t, i = 1 / i, function(r) { return Math.pow(t + r * e, i); }; } function ib(t, e) { var i = e - t; return i ? Js(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : Mn(isNaN(t) ? e : t); } function Lu(t) { return (t = +t) == 1 ? Qs : function(e, i) { return i - e ? Fu(e, i, t) : Mn(isNaN(e) ? i : e); }; } function Qs(t, e) { var i = e - t; return i ? Js(t, i) : Mn(isNaN(t) ? e : t); } const Do = function t(e) { var i = Lu(e); function r(n, o) { var s = i((n = sn(n)).r, (o = sn(o)).r), a = i(n.g, o.g), l = i(n.b, o.b), h = Qs(n.opacity, o.opacity); return function(c) { return n.r = s(c), n.g = a(c), n.b = l(c), n.opacity = h(c), n + ""; }; } return r.gamma = t, r; }(1); function It(t, e) { return t = +t, e = +e, function(i) { return t * (1 - i) + e * i; }; } var an = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Wr = new RegExp(an.source, "g"); function Au(t) { return function() { return t; }; } function Eu(t) { return function(e) { return t(e) + ""; }; } function Mu(t, e) { var i = an.lastIndex = Wr.lastIndex = 0, r, n, o, s = -1, a = [], l = []; for (t = t + "", e = e + ""; (r = an.exec(t)) && (n = Wr.exec(e)); ) (o = n.index) > i && (o = e.slice(i, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (n = n[0]) ? a[s] ? a[s] += n : a[++s] = n : (a[++s] = null, l.push({ i: s, x: It(r, n) })), i = Wr.lastIndex; return i < e.length && (o = e.slice(i), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? Eu(l[0].x) : Au(e) : (e = l.length, function(h) { for (var c = 0, u; c < e; ++c) a[(u = l[c]).i] = u.x(h); return a.join(""); }); } var No = 180 / Math.PI, ln = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function ta(t, e, i, r, n, o) { var s, a, l; return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (l = t * i + e * r) && (i -= t * l, r -= e * l), (a = Math.sqrt(i * i + r * r)) && (i /= a, r /= a, l /= a), t * r < e * i && (t = -t, e = -e, l = -l, s = -s), { translateX: n, translateY: o, rotate: Math.atan2(e, t) * No, skewX: Math.atan(l) * No, scaleX: s, scaleY: a }; } var Ci; function Ou(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? ln : ta(e.a, e.b, e.c, e.d, e.e, e.f); } function $u(t) { return t == null || (Ci || (Ci = document.createElementNS("http://www.w3.org/2000/svg", "g")), Ci.setAttribute("transform", t), !(t = Ci.transform.baseVal.consolidate())) ? ln : (t = t.matrix, ta(t.a, t.b, t.c, t.d, t.e, t.f)); } function ea(t, e, i, r) { function n(h) { return h.length ? h.pop() + " " : ""; } function o(h, c, u, g, p, _) { if (h !== u || c !== g) { var T = p.push("translate(", null, e, null, i); _.push({ i: T - 4, x: It(h, u) }, { i: T - 2, x: It(c, g) }); } else (u || g) && p.push("translate(" + u + e + g + i); } function s(h, c, u, g) { h !== c ? (h - c > 180 ? c += 360 : c - h > 180 && (h += 360), g.push({ i: u.push(n(u) + "rotate(", null, r) - 2, x: It(h, c) })) : c && u.push(n(u) + "rotate(" + c + r); } function a(h, c, u, g) { h !== c ? g.push({ i: u.push(n(u) + "skewX(", null, r) - 2, x: It(h, c) }) : c && u.push(n(u) + "skewX(" + c + r); } function l(h, c, u, g, p, _) { if (h !== u || c !== g) { var T = p.push(n(p) + "scale(", null, ",", null, ")"); _.push({ i: T - 4, x: It(h, u) }, { i: T - 2, x: It(c, g) }); } else (u !== 1 || g !== 1) && p.push(n(p) + "scale(" + u + "," + g + ")"); } return function(h, c) { var u = [], g = []; return h = t(h), c = t(c), o(h.translateX, h.translateY, c.translateX, c.translateY, u, g), s(h.rotate, c.rotate, u, g), a(h.skewX, c.skewX, u, g), l(h.scaleX, h.scaleY, c.scaleX, c.scaleY, u, g), h = c = null, function(p) { for (var _ = -1, T = g.length, B; ++_ < T; ) u[(B = g[_]).i] = B.x(p); return u.join(""); }; }; } var Iu = ea(Ou, "px, ", "px)", "deg)"), Du = ea($u, ", ", ")", ")"), Te = 0, Ne = 0, Oe = 0, ia = 1e3, ji, Re, Ui = 0, Qt = 0, cr = 0, Ve = typeof performance == "object" && performance.now ? performance : Date, ra = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function On() { return Qt || (ra(Nu), Qt = Ve.now() + cr); } function Nu() { Qt = 0; } function Yi() { this._call = this._time = this._next = null; } Yi.prototype = na.prototype = { constructor: Yi, restart: function(t, e, i) { if (typeof t != "function") throw new TypeError("callback is not a function"); i = (i == null ? On() : +i) + (e == null ? 0 : +e), !this._next && Re !== this && (Re ? Re._next = this : ji = this, Re = this), this._call = t, this._time = i, hn(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, hn()); } }; function na(t, e, i) { var r = new Yi(); return r.restart(t, e, i), r; } function Ru() { On(), ++Te; for (var t = ji, e; t; ) (e = Qt - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --Te; } function Ro() { Qt = (Ui = Ve.now()) + cr, Te = Ne = 0; try { Ru(); } finally { Te = 0, Pu(), Qt = 0; } } function qu() { var t = Ve.now(), e = t - Ui; e > ia && (cr -= e, Ui = t); } function Pu() { for (var t, e = ji, i, r = 1 / 0; e; ) e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (i = e._next, e._next = null, e = t ? t._next = i : ji = i); Re = t, hn(r); } function hn(t) { if (!Te) { Ne && (Ne = clearTimeout(Ne)); var e = t - Qt; e > 24 ? (t < 1 / 0 && (Ne = setTimeout(Ro, t - Ve.now() - cr)), Oe && (Oe = clearInterval(Oe))) : (Oe || (Ui = Ve.now(), Oe = setInterval(qu, ia)), Te = 1, ra(Ro)); } } function qo(t, e, i) { var r = new Yi(); return e = e == null ? 0 : +e, r.restart((n) => { r.stop(), t(n + e); }, e, i), r; } var zu = Ns("start", "end", "cancel", "interrupt"), Wu = [], oa = 0, Po = 1, cn = 2, Fi = 3, zo = 4, un = 5, Li = 6; function ur(t, e, i, r, n, o) { var s = t.__transition; if (!s) t.__transition = {}; else if (i in s) return; Hu(t, i, { name: e, index: r, // For context during callback. group: n, // For context during callback. on: zu, tween: Wu, time: o.time, delay: o.delay, duration: o.duration, ease: o.ease, timer: null, state: oa }); } function $n(t, e) { var i = _t(t, e); if (i.state > oa) throw new Error("too late; already scheduled"); return i; } function St(t, e) { var i = _t(t, e); if (i.state > Fi) throw new Error("too late; already running"); return i; } function _t(t, e) { var i = t.__transition; if (!i || !(i = i[e])) throw new Error("transition not found"); return i; } function Hu(t, e, i) { var r = t.__transition, n; r[e] = i, i.timer = na(o, 0, i.time); function o(h) { i.state = Po, i.timer.restart(s, i.delay, i.time), i.delay <= h && s(h - i.delay); } function s(h) { var c, u, g, p; if (i.state !== Po) return l(); for (c in r) if (p = r[c], p.name === i.name) { if (p.state === Fi) return qo(s); p.state === zo ? (p.state = Li, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < e && (p.state = Li, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]); } if (qo(function() { i.state === Fi && (i.state = zo, i.timer.restart(a, i.delay, i.time), a(h)); }), i.state = cn, i.on.call("start", t, t.__data__, i.index, i.group), i.state === cn) { for (i.state = Fi, n = new Array(g = i.tween.length), c = 0, u = -1; c < g; ++c) (p = i.tween[c].value.call(t, t.__data__, i.index, i.group)) && (n[++u] = p); n.length = u + 1; } } function a(h) { for (var c = h < i.duration ? i.ease.call(null, h / i.duration) : (i.timer.restart(l), i.state = un, 1), u = -1, g = n.length; ++u < g; ) n[u].call(t, c); i.state === un && (i.on.call("end", t, t.__data__, i.index, i.group), l()); } function l() { i.state = Li, i.timer.stop(), delete r[e]; for (var h in r) return; delete t.__transition; } } function ju(t, e) { var i = t.__transition, r, n, o = !0, s; if (i) { e = e == null ? null : e + ""; for (s in i) { if ((r = i[s]).name !== e) { o = !1; continue; } n = r.state > cn && r.state < un, r.state = Li, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s]; } o && delete t.__transition; } } function Uu(t) { return this.each(function() { ju(this, t); }); } function Yu(t, e) { var i, r; return function() { var n = St(this, t), o = n.tween; if (o !== i) { r = i = o; for (var s = 0, a = r.length; s < a; ++s) if (r[s].name === e) { r = r.slice(), r.splice(s, 1); break; } } n.tween = r; }; } function Gu(t, e, i) { var r, n; if (typeof i != "function") throw new Error(); return function() { var o = St(this, t), s = o.tween; if (s !== r) { n = (r = s).slice(); for (var a = { name: e, value: i }, l = 0, h = n.length; l < h; ++l) if (n[l].name === e) { n[l] = a; break; } l === h && n.push(a); } o.tween = n; }; } function Vu(t, e) { var i = this._id; if (t += "", arguments.length < 2) { for (var r = _t(this.node(), i).tween, n = 0, o = r.length, s; n < o; ++n) if ((s = r[n]).name === t) return s.value; return null; } return this.each((e == null ? Yu : Gu)(i, t, e)); } function In(t, e, i) { var r = t._id; return t.each(function() { var n