From 8cb0cbc033905a8be5be8d0cd88861ef71faa049 Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 7 Apr 2026 19:59:26 -0700 Subject: [PATCH 01/10] Fix pie chart auto-play stopping on no-transfer rounds Add resumeFrom() to round player so the pie chart can advance the dropdown during auto-play without stopping playback. When the pie chart skips a round with no transfers, updateRound() now calls resumeFrom() instead of setStep() to keep the animation going. Co-Authored-By: Claude Opus 4.6 --- static/visualizer/round-player.js | 12 +++++++++++- templates/pie/pie-nonblocking.html | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/static/visualizer/round-player.js b/static/visualizer/round-player.js index 14914706..c10eb070 100644 --- a/static/visualizer/round-player.js +++ b/static/visualizer/round-player.js @@ -158,6 +158,16 @@ function RoundPlayer({ "Play Animation"; } + // Resume playback from a specific step without resetting to round 0. + // Used when the pie chart skips a no-transfer round during auto-play + // and needs the round player to catch up without interrupting playback. + function resumeFrom(step) { + changeStep(step); + if (!isPlaying) return; + window.clearTimeout(timer); + nextStep(stepTimeMs); + } + function playing() { return isPlaying; } @@ -168,5 +178,5 @@ function RoundPlayer({ init(); - return { play, stop, setStep, setTimeBetweenStepsMs, playing }; + return { play, stop, setStep, resumeFrom, setTimeBetweenStepsMs, playing }; } diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index e18da237..2b0f54e2 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -50,9 +50,17 @@ // When the pie chart is animating it knows it is advancing rounds, but to avoid reactive // loops it requests to be told the new currentRound rather than using 2-way binding. // And we also update the slider state while we're at it. + // + // During auto-play, use resumeFrom() to update the dropdown and reset + // the timer without stopping playback. This matters when the pie chart + // skips a no-transfer round and needs to advance immediately. function updateRound(roundNum) { pieChart.currentRound = roundNum; - pieRoundPlayer.setStep(roundNum - 1); + if (pieRoundPlayer.playing()) { + pieRoundPlayer.resumeFrom(roundNum - 1); + } else { + pieRoundPlayer.setStep(roundNum - 1); + } } From 5cfd2235e1e5e34ce0950d3d146db17ea617f62a Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 7 Apr 2026 21:21:48 -0700 Subject: [PATCH 02/10] Simplify auto-play fix: just skip setStep during playback Revert round-player.js changes. The simpler approach is to skip the setStep() call entirely during auto-play so it does not stop playback. The round player timer catches up on its next tick. Co-Authored-By: Claude Opus 4.6 --- static/visualizer/round-player.js | 12 +----------- templates/pie/pie-nonblocking.html | 9 +++------ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/static/visualizer/round-player.js b/static/visualizer/round-player.js index c10eb070..14914706 100644 --- a/static/visualizer/round-player.js +++ b/static/visualizer/round-player.js @@ -158,16 +158,6 @@ function RoundPlayer({ "Play Animation"; } - // Resume playback from a specific step without resetting to round 0. - // Used when the pie chart skips a no-transfer round during auto-play - // and needs the round player to catch up without interrupting playback. - function resumeFrom(step) { - changeStep(step); - if (!isPlaying) return; - window.clearTimeout(timer); - nextStep(stepTimeMs); - } - function playing() { return isPlaying; } @@ -178,5 +168,5 @@ function RoundPlayer({ init(); - return { play, stop, setStep, resumeFrom, setTimeBetweenStepsMs, playing }; + return { play, stop, setStep, setTimeBetweenStepsMs, playing }; } diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 2b0f54e2..3f7c7385 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -51,14 +51,11 @@ // loops it requests to be told the new currentRound rather than using 2-way binding. // And we also update the slider state while we're at it. // - // During auto-play, use resumeFrom() to update the dropdown and reset - // the timer without stopping playback. This matters when the pie chart - // skips a no-transfer round and needs to advance immediately. + // During auto-play, skip the setStep() call — it stops playback. + // The round player's timer will catch up on its next tick. function updateRound(roundNum) { pieChart.currentRound = roundNum; - if (pieRoundPlayer.playing()) { - pieRoundPlayer.resumeFrom(roundNum - 1); - } else { + if (!pieRoundPlayer.playing()) { pieRoundPlayer.setStep(roundNum - 1); } } From e96a5bde233de79bea6ff936b912b495637fbaf5 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 8 Apr 2026 16:29:51 -0700 Subject: [PATCH 03/10] Sync pie chart --- static/pie/pie-chart.es.js | 5198 ++++++++++++++++++------------------ 1 file changed, 2611 insertions(+), 2587 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 7d91865f..28ece1fb 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,300 +1,300 @@ -var ql = Object.defineProperty; -var oa = (e) => { - throw TypeError(e); +var Vl = Object.defineProperty; +var la = (t) => { + throw TypeError(t); }; -var Vl = (e, t, n) => t in e ? ql(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var ce = (e, t, n) => Vl(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || oa("Cannot " + n); -var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? oa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); -var za; -typeof window < "u" && ((za = window.__svelte ?? (window.__svelte = {})).v ?? (za.v = /* @__PURE__ */ new Set())).add("5"); -const zl = 1, Hl = 2, Xa = 4, Yl = 8, Bl = 16, Xl = 1, Wl = 4, Ul = 8, Gl = 16, Kl = 1, jl = 2, Ns = "[", Fi = "[!", ks = "]", fr = {}, Te = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; -var Ua = Array.isArray, Jl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, $i = Object.keys, Ai = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Zl = Object.getOwnPropertyDescriptors, Ql = Object.prototype, eu = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; -const tu = () => { +var zl = (t, e, n) => e in t ? Vl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var dt = (t, e, n) => zl(t, typeof e != "symbol" ? e + "" : e, n), ts = (t, e, n) => e.has(t) || la("Cannot " + n); +var v = (t, e, n) => (ts(t, e, "read from private field"), n ? n.call(t) : e.get(t)), B = (t, e, n) => e.has(t) ? la("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), z = (t, e, n, r) => (ts(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), $t = (t, e, n) => (ts(t, e, "access private method"), n); +var Ha; +typeof window < "u" && ((Ha = window.__svelte ?? (window.__svelte = {})).v ?? (Ha.v = /* @__PURE__ */ new Set())).add("5"); +const Hl = 1, Yl = 2, Wa = 4, Bl = 8, Xl = 16, Wl = 1, Ul = 4, Gl = 8, Kl = 16, jl = 1, Jl = 2, Ns = "[", Fi = "[!", ks = "]", fr = {}, Rt = Symbol(), Ua = "http://www.w3.org/1999/xhtml", os = !1; +var Ga = Array.isArray, Zl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, $i = Object.keys, Ai = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, Ql = Object.getOwnPropertyDescriptors, tu = Object.prototype, eu = Array.prototype, Ka = Object.getPrototypeOf, ua = Object.isExtensible; +const nu = () => { }; -function nu(e) { - for (var t = 0; t < e.length; t++) - e[t](); +function ru(t) { + for (var e = 0; e < t.length; e++) + t[e](); } -function Ka() { - var e, t, n = new Promise((r, i) => { - e = r, t = i; +function ja() { + var t, e, n = new Promise((r, i) => { + t = r, e = i; }); - return { promise: n, resolve: e, reject: t }; + return { promise: n, resolve: t, reject: e }; } -function ru(e, t) { - if (Array.isArray(e)) - return e; - if (!(Symbol.iterator in e)) - return Array.from(e); +function iu(t, e) { + if (Array.isArray(t)) + return t; + if (!(Symbol.iterator in t)) + return Array.from(t); const n = []; - for (const r of e) - if (n.push(r), n.length === t) break; + for (const r of t) + if (n.push(r), n.length === e) break; return n; } -const Re = 2, Fr = 4, Li = 8, ja = 1 << 24, hn = 16, Ct = 32, En = 64, Ja = 128, gt = 512, Ae = 1024, Se = 2048, Tt = 4096, at = 8192, ln = 16384, yr = 32768, hr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, iu = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), su = Symbol(""), kn = new class extends Error { +const St = 2, Fr = 4, Li = 8, Ja = 1 << 24, hn = 16, Re = 32, En = 64, Za = 128, ge = 512, Et = 1024, Nt = 2048, Te = 4096, se = 8192, ln = 16384, yr = 32768, hr = 65536, fa = 1 << 17, Qa = 1 << 18, Jn = 1 << 19, su = 1 << 20, an = 1 << 25, Un = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), to = Symbol("legacy props"), au = Symbol(""), Mn = new class extends Error { constructor() { super(...arguments); - ce(this, "name", "StaleReactionError"); - ce(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + dt(this, "name", "StaleReactionError"); + dt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var Ha; -const au = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; -function ou(e) { +var Ya; +const ou = ((Ya = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ya.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; +function lu(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function lu() { +function uu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function uu(e, t, n) { +function fu(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function fu(e) { +function cu(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function cu() { +function hu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function hu(e) { +function du(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function du() { +function pu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function pu() { +function vu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function vu(e) { +function gu(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function gu() { +function _u() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function _u() { +function mu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function mu() { +function yu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function yu() { +function wu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function qi(e) { +function qi(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function wu() { +function xu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; -function on(e) { - j = e; +function on(t) { + j = t; } let W; -function Ve(e) { - if (e === null) +function qt(t) { + if (t === null) throw qi(), fr; - return W = e; + return W = t; } function Vi() { - return Ve(/* @__PURE__ */ Yt(W)); + return qt(/* @__PURE__ */ Be(W)); } -function Le(e) { +function It(t) { if (j) { - if (/* @__PURE__ */ Yt(W) !== null) + if (/* @__PURE__ */ Be(W) !== null) throw qi(), fr; - W = e; + W = t; } } -function us(e = 1) { +function us(t = 1) { if (j) { - for (var t = e, n = W; t--; ) + for (var e = t, n = W; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(n); + /* @__PURE__ */ Be(n); W = n; } } -function Ei(e = !0) { - for (var t = 0, n = W; ; ) { +function Ei(t = !0) { + for (var e = 0, n = W; ; ) { if (n.nodeType === wr) { var r = ( /** @type {Comment} */ n.data ); if (r === ks) { - if (t === 0) return n; - t -= 1; + if (e === 0) return n; + e -= 1; } else (r === Ns || r === Fi || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(n) + /* @__PURE__ */ Be(n) ); - e && n.remove(), n = i; + t && n.remove(), n = i; } } -function eo(e) { - if (!e || e.nodeType !== wr) +function eo(t) { + if (!t || t.nodeType !== wr) throw qi(), fr; return ( /** @type {Comment} */ - e.data + t.data ); } -function to(e) { - return e === this.v; +function no(t) { + return t === this.v; } -function xu(e, t) { - return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; +function bu(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function no(e) { - return !xu(e, this.v); +function ro(t) { + return !bu(t, this.v); } -let bu = !1, lt = null; -function dr(e) { - lt = e; +let $u = !1, oe = null; +function dr(t) { + oe = t; } -function zi(e, t = !1, n) { - lt = { - p: lt, +function zi(t, e = !1, n) { + oe = { + p: oe, i: !1, c: null, e: null, - s: e, + s: t, x: null, l: null }; } -function Hi(e) { - var t = ( +function Hi(t) { + var e = ( /** @type {ComponentContext} */ - lt - ), n = t.e; + oe + ), n = e.e; if (n !== null) { - t.e = null; + e.e = null; for (var r of n) - Ro(r); + So(r); } - return e !== void 0 && (t.x = e), t.i = !0, lt = t.p, e ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, oe = e.p, t ?? /** @type {T} */ {}; } -function ro() { +function io() { return !0; } -let Mn = []; -function io() { - var e = Mn; - Mn = [], nu(e); +let Pn = []; +function so() { + var t = Pn; + Pn = [], ru(t); } -function xn(e) { - if (Mn.length === 0 && !Dr) { - var t = Mn; +function xn(t) { + if (Pn.length === 0 && !Dr) { + var e = Pn; queueMicrotask(() => { - t === Mn && io(); + e === Pn && so(); }); } - Mn.push(e); + Pn.push(t); } -function $u() { - for (; Mn.length > 0; ) - io(); +function Au() { + for (; Pn.length > 0; ) + so(); } -function so(e) { - var t = J; - if (t === null) - return X.f |= wn, e; - if ((t.f & yr) === 0 && (t.f & Fr) === 0) - throw e; - pr(e, t); +function ao(t) { + var e = J; + if (e === null) + return X.f |= wn, t; + if ((e.f & yr) === 0 && (e.f & Fr) === 0) + throw t; + pr(t, e); } -function pr(e, t) { - for (; t !== null; ) { - if ((t.f & Ja) !== 0) { - if ((t.f & yr) === 0) - throw e; +function pr(t, e) { + for (; e !== null; ) { + if ((e.f & Za) !== 0) { + if ((e.f & yr) === 0) + throw t; try { - t.b.error(e); + e.b.error(t); return; } catch (n) { - e = n; + t = n; } } - t = t.parent; + e = e.parent; } - throw e; + throw t; } -const Au = -7169; -function de(e, t) { - e.f = e.f & Au | t; +const Eu = -7169; +function vt(t, e) { + t.f = t.f & Eu | e; } -function Ps(e) { - (e.f & gt) !== 0 || e.deps === null ? de(e, Ae) : de(e, Tt); +function Ps(t) { + (t.f & ge) !== 0 || t.deps === null ? vt(t, Et) : vt(t, Te); } -function ao(e) { - if (e !== null) - for (const t of e) - (t.f & Re) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( +function oo(t) { + if (t !== null) + for (const e of t) + (e.f & St) === 0 || (e.f & Un) === 0 || (e.f ^= Un, oo( /** @type {Derived} */ - t.deps + e.deps )); } -function oo(e, t, n) { - (e.f & Se) !== 0 ? t.add(e) : (e.f & Tt) !== 0 && n.add(e), ao(e.deps), de(e, Ae); +function lo(t, e, n) { + (t.f & Nt) !== 0 ? e.add(t) : (t.f & Te) !== 0 && n.add(t), oo(t.deps), vt(t, Et); } const ri = /* @__PURE__ */ new Set(); -let K = null, Ce = null, Ge = [], Yi = null, fs = !1, Dr = !1; -var rr, ir, Fn, sr, Hr, Yr, In, en, ar, Ht, cs, hs, lo; +let K = null, Ct = null, Gt = [], Yi = null, fs = !1, Dr = !1; +var rr, ir, In, sr, Hr, Yr, Ln, tn, ar, Ye, cs, hs, uo; const Js = class Js { constructor() { - H(this, Ht); - ce(this, "committed", !1); + B(this, Ye); + dt(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - ce(this, "current", /* @__PURE__ */ new Map()); + dt(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - ce(this, "previous", /* @__PURE__ */ new Map()); + dt(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - H(this, rr, /* @__PURE__ */ new Set()); + B(this, rr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - H(this, ir, /* @__PURE__ */ new Set()); + B(this, ir, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - H(this, Fn, 0); + B(this, In, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - H(this, sr, 0); + B(this, sr, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - H(this, Hr, null); + B(this, Hr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - H(this, Yr, /* @__PURE__ */ new Set()); + B(this, Yr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - H(this, In, /* @__PURE__ */ new Set()); + B(this, Ln, /* @__PURE__ */ new Set()); /** * A map of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process`. @@ -302,9 +302,9 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, en, /* @__PURE__ */ new Map()); - ce(this, "is_fork", !1); - H(this, ar, !1); + B(this, tn, /* @__PURE__ */ new Map()); + dt(this, "is_fork", !1); + B(this, ar, !1); } is_deferred() { return this.is_fork || v(this, sr) > 0; @@ -313,43 +313,43 @@ const Js = class Js { * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(t) { - v(this, en).has(t) || v(this, en).set(t, { d: [], m: [] }); + skip_effect(e) { + v(this, tn).has(e) || v(this, tn).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(t) { - var n = v(this, en).get(t); + unskip_effect(e) { + var n = v(this, tn).get(e); if (n) { - v(this, en).delete(t); + v(this, tn).delete(e); for (var r of n.d) - de(r, Se), At(r); + vt(r, Nt), Ae(r); for (r of n.m) - de(r, Tt), At(r); + vt(r, Te), Ae(r); } } /** * * @param {Effect[]} root_effects */ - process(t) { + process(e) { var i; - Ge = [], this.apply(); + Gt = [], this.apply(); var n = [], r = []; - for (const s of t) - be(this, Ht, cs).call(this, s, n, r); + for (const s of e) + $t(this, Ye, cs).call(this, s, n, r); if (this.is_deferred()) { - be(this, Ht, hs).call(this, r), be(this, Ht, hs).call(this, n); - for (const [s, a] of v(this, en)) - ho(s, a); + $t(this, Ye, hs).call(this, r), $t(this, Ye, hs).call(this, n); + for (const [s, a] of v(this, tn)) + po(s, a); } else { for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Fn) === 0 && be(this, Ht, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); + v(this, rr).clear(), v(this, In) === 0 && $t(this, Ye, uo).call(this), K = null, ca(r), ca(n), (i = v(this, Hr)) == null || i.resolve(); } - Ce = null; + Ct = null; } /** * Associate a change to a given source with the current @@ -357,65 +357,65 @@ const Js = class Js { * @param {Source} source * @param {any} value */ - capture(t, n) { - n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Ce == null || Ce.set(t, t.v)); + capture(e, n) { + n !== Rt && !this.previous.has(e) && this.previous.set(e, n), (e.f & wn) === 0 && (this.current.set(e, e.v), Ct == null || Ct.set(e, e.v)); } activate() { K = this, this.apply(); } deactivate() { - K === this && (K = null, Ce = null); + K === this && (K = null, Ct = null); } flush() { - if (this.activate(), Ge.length > 0) { - if (uo(), K !== null && K !== this) + if (this.activate(), Gt.length > 0) { + if (fo(), K !== null && K !== this) return; - } else v(this, Fn) === 0 && this.process([]); + } else v(this, In) === 0 && this.process([]); this.deactivate(); } discard() { - for (const t of v(this, ir)) t(this); + for (const e of v(this, ir)) e(this); v(this, ir).clear(); } /** * * @param {boolean} blocking */ - increment(t) { - V(this, Fn, v(this, Fn) + 1), t && V(this, sr, v(this, sr) + 1); + increment(e) { + z(this, In, v(this, In) + 1), e && z(this, sr, v(this, sr) + 1); } /** * * @param {boolean} blocking */ - decrement(t) { - V(this, Fn, v(this, Fn) - 1), t && V(this, sr, v(this, sr) - 1), !v(this, ar) && (V(this, ar, !0), xn(() => { - V(this, ar, !1), this.is_deferred() ? Ge.length > 0 && this.flush() : this.revive(); + decrement(e) { + z(this, In, v(this, In) - 1), e && z(this, sr, v(this, sr) - 1), !v(this, ar) && (z(this, ar, !0), xn(() => { + z(this, ar, !1), this.is_deferred() ? Gt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, Yr)) - v(this, In).delete(t), de(t, Se), At(t); - for (const t of v(this, In)) - de(t, Tt), At(t); + for (const e of v(this, Yr)) + v(this, Ln).delete(e), vt(e, Nt), Ae(e); + for (const e of v(this, Ln)) + vt(e, Te), Ae(e); this.flush(); } /** @param {() => void} fn */ - oncommit(t) { - v(this, rr).add(t); + oncommit(e) { + v(this, rr).add(e); } /** @param {(batch: Batch) => void} fn */ - ondiscard(t) { - v(this, ir).add(t); + ondiscard(e) { + v(this, ir).add(e); } settled() { - return (v(this, Hr) ?? V(this, Hr, Ka())).promise; + return (v(this, Hr) ?? z(this, Hr, ja())).promise; } static ensure() { if (K === null) { - const t = K = new Js(); + const e = K = new Js(); ri.add(K), Dr || xn(() => { - K === t && t.flush(); + K === e && e.flush(); }); } return K; @@ -423,19 +423,19 @@ const Js = class Js { apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), Fn = new WeakMap(), sr = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), In = new WeakMap(), en = new WeakMap(), ar = new WeakMap(), Ht = new WeakSet(), /** +rr = new WeakMap(), ir = new WeakMap(), In = new WeakMap(), sr = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), Ln = new WeakMap(), tn = new WeakMap(), ar = new WeakMap(), Ye = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -cs = function(t, n, r) { - t.f ^= Ae; - for (var i = t.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Ct | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & at) !== 0 || v(this, en).has(i); +cs = function(e, n, r) { + e.f ^= Et; + for (var i = e.first, s = null; i !== null; ) { + var a = i.f, o = (a & (Re | En)) !== 0, l = o && (a & Et) !== 0, u = l || (a & se) !== 0 || v(this, tn).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Ae : s !== null && (a & (Fr | Li | ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, In).add(i), gr(i)); + o ? i.f ^= Et : s !== null && (a & (Fr | Li | Ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, Ln).add(i), gr(i)); var f = i.first; if (f !== null) { i = f; @@ -449,14 +449,14 @@ cs = function(t, n, r) { }, /** * @param {Effect[]} effects */ -hs = function(t) { - for (var n = 0; n < t.length; n += 1) - oo(t[n], v(this, Yr), v(this, In)); -}, lo = function() { +hs = function(e) { + for (var n = 0; n < e.length; n += 1) + lo(e[n], v(this, Yr), v(this, Ln)); +}, uo = function() { var i; if (ri.size > 1) { this.previous.clear(); - var t = Ce, n = !0; + var e = Ct, n = !0; for (const s of ri) { if (s === this) { n = !1; @@ -475,114 +475,114 @@ hs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ge; - Ge = []; + var r = Gt; + Gt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - fo(f, o, l, u); - if (Ge.length > 0) { + co(f, o, l, u); + if (Gt.length > 0) { K = s, s.apply(); - for (const f of Ge) - be(i = s, Ht, cs).call(i, f, [], []); + for (const f of Gt) + $t(i = s, Ye, cs).call(i, f, [], []); s.deactivate(); } - Ge = r; + Gt = r; } } - K = null, Ce = t; + K = null, Ct = e; } this.committed = !0, ri.delete(this); }; let un = Js; -function re(e) { - var t = Dr; +function rt(t) { + var e = Dr; Dr = !0; try { for (var n; ; ) { - if ($u(), Ge.length === 0 && (K == null || K.flush(), Ge.length === 0)) + if (Au(), Gt.length === 0 && (K == null || K.flush(), Gt.length === 0)) return Yi = null, /** @type {T} */ n; - uo(); + fo(); } } finally { - Dr = t; + Dr = e; } } -function uo() { +function fo() { fs = !0; - var e = null; + var t = null; try { - for (var t = 0; Ge.length > 0; ) { + for (var e = 0; Gt.length > 0; ) { var n = un.ensure(); - if (t++ > 1e3) { + if (e++ > 1e3) { var r, i; - Eu(); + Tu(); } - n.process(Ge), bn.clear(); + n.process(Gt), bn.clear(); } } finally { - Ge = [], fs = !1, Yi = null; + Gt = [], fs = !1, Yi = null; } } -function Eu() { +function Tu() { try { - du(); - } catch (e) { - pr(e, Yi); + pu(); + } catch (t) { + pr(t, Yi); } } -let xt = null; -function fa(e) { - var t = e.length; - if (t !== 0) { - for (var n = 0; n < t; ) { - var r = e[n++]; - if ((r.f & (ln | at)) === 0 && Gr(r) && (xt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (xt == null ? void 0 : xt.size) > 0)) { +let xe = null; +function ca(t) { + var e = t.length; + if (e !== 0) { + for (var n = 0; n < e; ) { + var r = t[n++]; + if ((r.f & (ln | se)) === 0 && Gr(r) && (xe = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Mo(r), (xe == null ? void 0 : xe.size) > 0)) { bn.clear(); - for (const i of xt) { - if ((i.f & (ln | at)) !== 0) continue; + for (const i of xe) { + if ((i.f & (ln | se)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - xt.has(a) && (xt.delete(a), s.push(a)), a = a.parent; + xe.has(a) && (xe.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (ln | at)) === 0 && gr(l); + (l.f & (ln | se)) === 0 && gr(l); } } - xt.clear(); + xe.clear(); } } - xt = null; + xe = null; } } -function fo(e, t, n, r) { - if (!n.has(e) && (n.add(e), e.reactions !== null)) - for (const i of e.reactions) { +function co(t, e, n, r) { + if (!n.has(t) && (n.add(t), t.reactions !== null)) + for (const i of t.reactions) { const s = i.f; - (s & Re) !== 0 ? fo( + (s & St) !== 0 ? co( /** @type {Derived} */ i, - t, + e, n, r - ) : (s & (Ms | hn)) !== 0 && (s & Se) === 0 && co(i, t, r) && (de(i, Se), At( + ) : (s & (Ms | hn)) !== 0 && (s & Nt) === 0 && ho(i, e, r) && (vt(i, Nt), Ae( /** @type {Effect} */ i )); } } -function co(e, t, n) { - const r = n.get(e); +function ho(t, e, n) { + const r = n.get(t); if (r !== void 0) return r; - if (e.deps !== null) - for (const i of e.deps) { - if (cr.call(t, i)) + if (t.deps !== null) + for (const i of t.deps) { + if (cr.call(e, i)) return !0; - if ((i.f & Re) !== 0 && co( + if ((i.f & St) !== 0 && ho( /** @type {Derived} */ i, - t, + e, n )) return n.set( @@ -591,82 +591,82 @@ function co(e, t, n) { !0 ), !0; } - return n.set(e, !1), !1; + return n.set(t, !1), !1; } -function At(e) { - for (var t = Yi = e; t.parent !== null; ) { - t = t.parent; - var n = t.f; - if (fs && t === J && (n & hn) !== 0 && (n & Za) === 0) +function Ae(t) { + for (var e = Yi = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (fs && e === J && (n & hn) !== 0 && (n & Qa) === 0) return; - if ((n & (En | Ct)) !== 0) { - if ((n & Ae) === 0) return; - t.f ^= Ae; + if ((n & (En | Re)) !== 0) { + if ((n & Et) === 0) return; + e.f ^= Et; } } - Ge.push(t); + Gt.push(e); } -function ho(e, t) { - if (!((e.f & Ct) !== 0 && (e.f & Ae) !== 0)) { - (e.f & Se) !== 0 ? t.d.push(e) : (e.f & Tt) !== 0 && t.m.push(e), de(e, Ae); - for (var n = e.first; n !== null; ) - ho(n, t), n = n.next; +function po(t, e) { + if (!((t.f & Re) !== 0 && (t.f & Et) !== 0)) { + (t.f & Nt) !== 0 ? e.d.push(t) : (t.f & Te) !== 0 && e.m.push(t), vt(t, Et); + for (var n = t.first; n !== null; ) + po(n, e), n = n.next; } } -function Tu(e) { - let t = 0, n = Un(0), r; +function Ru(t) { + let e = 0, n = Gn(0), r; return () => { - Fs() && (x(n), Ls(() => (t === 0 && (r = Wi(() => e(() => Or(n)))), t += 1, () => { + Fs() && (x(n), Ls(() => (e === 0 && (r = Wi(() => t(() => Or(n)))), e += 1, () => { xn(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); + e -= 1, e === 0 && (r == null || r(), r = void 0, Or(n)); }); }))); }; } -var Cu = hr | jn | Ja; -function Ru(e, t, n) { - new Su(e, t, n); +var Cu = hr | Jn | Za; +function Su(t, e, n) { + new Nu(t, e, n); } -var it, Br, Ot, Ln, Ft, dt, We, It, tn, yn, qn, nn, or, Vn, lr, ur, rn, Di, ve, po, vo, ds, ci, hi, ps; -class Su { +var re, Br, Fe, qn, Ie, de, Wt, Le, en, yn, Vn, nn, or, zn, lr, ur, rn, Di, gt, vo, go, ds, ci, hi, ps; +class Nu { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(t, n, r) { - H(this, ve); + constructor(e, n, r) { + B(this, gt); /** @type {Boundary | null} */ - ce(this, "parent"); - ce(this, "is_pending", !1); + dt(this, "parent"); + dt(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, it); + B(this, re); /** @type {TemplateNode | null} */ - H(this, Br, j ? W : null); + B(this, Br, j ? W : null); /** @type {BoundaryProps} */ - H(this, Ot); + B(this, Fe); /** @type {((anchor: Node) => void)} */ - H(this, Ln); + B(this, qn); /** @type {Effect} */ - H(this, Ft); + B(this, Ie); /** @type {Effect | null} */ - H(this, dt, null); + B(this, de, null); /** @type {Effect | null} */ - H(this, We, null); + B(this, Wt, null); /** @type {Effect | null} */ - H(this, It, null); + B(this, Le, null); /** @type {DocumentFragment | null} */ - H(this, tn, null); + B(this, en, null); /** @type {TemplateNode | null} */ - H(this, yn, null); - H(this, qn, 0); - H(this, nn, 0); - H(this, or, !1); - H(this, Vn, !1); + B(this, yn, null); + B(this, Vn, 0); + B(this, nn, 0); + B(this, or, !1); + B(this, zn, !1); /** @type {Set} */ - H(this, lr, /* @__PURE__ */ new Set()); + B(this, lr, /* @__PURE__ */ new Set()); /** @type {Set} */ - H(this, ur, /* @__PURE__ */ new Set()); + B(this, ur, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -674,38 +674,38 @@ class Su { * calls followed by no-op flushes * @type {Source | null} */ - H(this, rn, null); - H(this, Di, Tu(() => (V(this, rn, Un(v(this, qn))), () => { - V(this, rn, null); + B(this, rn, null); + B(this, Di, Ru(() => (z(this, rn, Gn(v(this, Vn))), () => { + z(this, rn, null); }))); - V(this, it, t), V(this, Ot, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Ot).pending, V(this, Ft, qs(() => { + z(this, re, e), z(this, Fe, n), z(this, qn, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Fe).pending, z(this, Ie, qs(() => { if (J.b = this, j) { const s = v(this, Br); Vi(), /** @type {Comment} */ s.nodeType === wr && /** @type {Comment} */ - s.data === Fi ? be(this, ve, vo).call(this) : (be(this, ve, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); + s.data === Fi ? $t(this, gt, go).call(this) : ($t(this, gt, vo).call(this), v(this, nn) === 0 && (this.is_pending = !1)); } else { - var i = be(this, ve, ds).call(this); + var i = $t(this, gt, ds).call(this); try { - V(this, dt, vt(() => r(i))); + z(this, de, ve(() => r(i))); } catch (s) { this.error(s); } - v(this, nn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + v(this, nn) > 0 ? $t(this, gt, hi).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, yn)) == null || s.remove(); }; - }, Cu)), j && V(this, it, W); + }, Cu)), j && z(this, re, W); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(t) { - oo(t, v(this, lr), v(this, ur)); + defer_effect(e) { + lo(e, v(this, lr), v(this, ur)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Su { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Ot).pending; + return !!v(this, Fe).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,9 +723,9 @@ class Su { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(t) { - be(this, ve, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, rn) || v(this, or)) && (V(this, or, !0), xn(() => { - V(this, or, !1), v(this, rn) && vr(v(this, rn), v(this, qn)); + update_pending_count(e) { + $t(this, gt, ps).call(this, e), z(this, Vn, v(this, Vn) + e), !(!v(this, rn) || v(this, or)) && (z(this, or, !0), xn(() => { + z(this, or, !1), v(this, rn) && vr(v(this, rn), v(this, Vn)); })); } get_effect_pending() { @@ -735,38 +735,38 @@ class Su { ); } /** @param {unknown} error */ - error(t) { - var n = v(this, Ot).onerror; - let r = v(this, Ot).failed; - if (v(this, Vn) || !n && !r) - throw t; - v(this, dt) && (ze(v(this, dt)), V(this, dt, null)), v(this, We) && (ze(v(this, We)), V(this, We, null)), v(this, It) && (ze(v(this, It)), V(this, It, null)), j && (Ve( + error(e) { + var n = v(this, Fe).onerror; + let r = v(this, Fe).failed; + if (v(this, zn) || !n && !r) + throw e; + v(this, de) && (Vt(v(this, de)), z(this, de, null)), v(this, Wt) && (Vt(v(this, Wt)), z(this, Wt, null)), v(this, Le) && (Vt(v(this, Le)), z(this, Le, null)), j && (qt( /** @type {TemplateNode} */ v(this, Br) - ), us(), Ve(Ei())); + ), us(), qt(Ei())); var i = !1, s = !1; const a = () => { if (i) { - wu(); + xu(); return; } - i = !0, s && yu(), un.ensure(), V(this, qn, 0), v(this, It) !== null && Yn(v(this, It), () => { - V(this, It, null); - }), this.is_pending = this.has_pending_snippet(), V(this, dt, be(this, ve, ci).call(this, () => (V(this, Vn, !1), vt(() => v(this, Ln).call(this, v(this, it)))))), v(this, nn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + i = !0, s && wu(), un.ensure(), z(this, Vn, 0), v(this, Le) !== null && Bn(v(this, Le), () => { + z(this, Le, null); + }), this.is_pending = this.has_pending_snippet(), z(this, de, $t(this, gt, ci).call(this, () => (z(this, zn, !1), ve(() => v(this, qn).call(this, v(this, re)))))), v(this, nn) > 0 ? $t(this, gt, hi).call(this) : this.is_pending = !1; }; xn(() => { try { - s = !0, n == null || n(t, a), s = !1; + s = !0, n == null || n(e, a), s = !1; } catch (o) { - pr(o, v(this, Ft) && v(this, Ft).parent); + pr(o, v(this, Ie) && v(this, Ie).parent); } - r && V(this, It, be(this, ve, ci).call(this, () => { - un.ensure(), V(this, Vn, !0); + r && z(this, Le, $t(this, gt, ci).call(this, () => { + un.ensure(), z(this, zn, !0); try { - return vt(() => { + return ve(() => { r( - v(this, it), - () => t, + v(this, re), + () => e, () => a ); }); @@ -774,91 +774,91 @@ class Su { return pr( o, /** @type {Effect} */ - v(this, Ft).parent + v(this, Ie).parent ), null; } finally { - V(this, Vn, !1); + z(this, zn, !1); } })); }); } } -it = new WeakMap(), Br = new WeakMap(), Ot = new WeakMap(), Ln = new WeakMap(), Ft = new WeakMap(), dt = new WeakMap(), We = new WeakMap(), It = new WeakMap(), tn = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), or = new WeakMap(), Vn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), rn = new WeakMap(), Di = new WeakMap(), ve = new WeakSet(), po = function() { +re = new WeakMap(), Br = new WeakMap(), Fe = new WeakMap(), qn = new WeakMap(), Ie = new WeakMap(), de = new WeakMap(), Wt = new WeakMap(), Le = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), Vn = new WeakMap(), nn = new WeakMap(), or = new WeakMap(), zn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), rn = new WeakMap(), Di = new WeakMap(), gt = new WeakSet(), vo = function() { try { - V(this, dt, vt(() => v(this, Ln).call(this, v(this, it)))); - } catch (t) { - this.error(t); + z(this, de, ve(() => v(this, qn).call(this, v(this, re)))); + } catch (e) { + this.error(e); } -}, vo = function() { - const t = v(this, Ot).pending; - t && (V(this, We, vt(() => t(v(this, it)))), xn(() => { - var n = be(this, ve, ds).call(this); - V(this, dt, be(this, ve, ci).call(this, () => (un.ensure(), vt(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? be(this, ve, hi).call(this) : (Yn( +}, go = function() { + const e = v(this, Fe).pending; + e && (z(this, Wt, ve(() => e(v(this, re)))), xn(() => { + var n = $t(this, gt, ds).call(this); + z(this, de, $t(this, gt, ci).call(this, () => (un.ensure(), ve(() => v(this, qn).call(this, n))))), v(this, nn) > 0 ? $t(this, gt, hi).call(this) : (Bn( /** @type {Effect} */ - v(this, We), + v(this, Wt), () => { - V(this, We, null); + z(this, Wt, null); } ), this.is_pending = !1); })); }, ds = function() { - var t = v(this, it); - return this.is_pending && (V(this, yn, ot()), v(this, it).before(v(this, yn)), t = v(this, yn)), t; + var e = v(this, re); + return this.is_pending && (z(this, yn, ae()), v(this, re).before(v(this, yn)), e = v(this, yn)), e; }, /** * @param {() => Effect | null} fn */ -ci = function(t) { - var n = J, r = X, i = lt; - zt(v(this, Ft)), mt(v(this, Ft)), dr(v(this, Ft).ctx); +ci = function(e) { + var n = J, r = X, i = oe; + He(v(this, Ie)), me(v(this, Ie)), dr(v(this, Ie).ctx); try { - return t(); + return e(); } catch (s) { - return so(s), null; + return ao(s), null; } finally { - zt(n), mt(r), dr(i); + He(n), me(r), dr(i); } }, hi = function() { - const t = ( + const e = ( /** @type {(anchor: Node) => void} */ - v(this, Ot).pending + v(this, Fe).pending ); - v(this, dt) !== null && (V(this, tn, document.createDocumentFragment()), v(this, tn).append( + v(this, de) !== null && (z(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ v(this, yn) - ), Do(v(this, dt), v(this, tn))), v(this, We) === null && V(this, We, vt(() => t(v(this, it)))); + ), Oo(v(this, de), v(this, en))), v(this, Wt) === null && z(this, Wt, ve(() => e(v(this, re)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ -ps = function(t) { +ps = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && be(n = this.parent, ve, ps).call(n, t); + this.parent && $t(n = this.parent, gt, ps).call(n, e); return; } - if (V(this, nn, v(this, nn) + t), v(this, nn) === 0) { + if (z(this, nn, v(this, nn) + e), v(this, nn) === 0) { this.is_pending = !1; for (const r of v(this, lr)) - de(r, Se), At(r); + vt(r, Nt), Ae(r); for (const r of v(this, ur)) - de(r, Tt), At(r); - v(this, lr).clear(), v(this, ur).clear(), v(this, We) && Yn(v(this, We), () => { - V(this, We, null); - }), v(this, tn) && (v(this, it).before(v(this, tn)), V(this, tn, null)); + vt(r, Te), Ae(r); + v(this, lr).clear(), v(this, ur).clear(), v(this, Wt) && Bn(v(this, Wt), () => { + z(this, Wt, null); + }), v(this, en) && (v(this, re).before(v(this, en)), z(this, en, null)); } }; -function Nu(e, t, n, r) { +function ku(t, e, n, r) { const i = Bi; - var s = e.filter((h) => !h.settled); + var s = t.filter((h) => !h.settled); if (n.length === 0 && s.length === 0) { - r(t.map(i)); + r(e.map(i)); return; } var a = K, o = ( /** @type {Effect} */ J - ), l = ku(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; + ), l = Mu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; function f(h) { l(); try { @@ -869,41 +869,41 @@ function Nu(e, t, n, r) { a == null || a.deactivate(), vs(); } if (n.length === 0) { - u.then(() => f(t.map(i))); + u.then(() => f(e.map(i))); return; } function p() { - l(), Promise.all(n.map((h) => /* @__PURE__ */ Mu(h))).then((h) => f([...t.map(i), ...h])).catch((h) => pr(h, o)); + l(), Promise.all(n.map((h) => /* @__PURE__ */ Pu(h))).then((h) => f([...e.map(i), ...h])).catch((h) => pr(h, o)); } u ? u.then(p) : p(); } -function ku() { - var e = J, t = X, n = lt, r = K; +function Mu() { + var t = J, e = X, n = oe, r = K; return function(s = !0) { - zt(e), mt(t), dr(n), s && (r == null || r.activate()); + He(t), me(e), dr(n), s && (r == null || r.activate()); }; } function vs() { - zt(null), mt(null), dr(null); + He(null), me(null), dr(null); } // @__NO_SIDE_EFFECTS__ -function Bi(e) { - var t = Re | Se, n = X !== null && (X.f & Re) !== 0 ? ( +function Bi(t) { + var e = St | Nt, n = X !== null && (X.f & St) !== 0 ? ( /** @type {Derived} */ X ) : null; - return J !== null && (J.f |= jn), { - ctx: lt, + return J !== null && (J.f |= Jn), { + ctx: oe, deps: null, effects: null, - equals: to, - f: t, - fn: e, + equals: no, + f: e, + fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - Te + Rt ), wv: 0, parent: n ?? J, @@ -911,12 +911,12 @@ function Bi(e) { }; } // @__NO_SIDE_EFFECTS__ -function Mu(e, t, n) { +function Pu(t, e, n) { let r = ( /** @type {Effect | null} */ J ); - r === null && lu(); + r === null && uu(); var i = ( /** @type {Boundary} */ r.b @@ -924,16 +924,16 @@ function Mu(e, t, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Un( + ), a = Gn( /** @type {V} */ - Te + Rt ), o = !X, l = /* @__PURE__ */ new Map(); - return Hu(() => { + return Yu(() => { var d; - var u = Ka(); + var u = ja(); s = u.promise; try { - Promise.resolve(e()).then(u.resolve, u.reject).then(() => { + Promise.resolve(t()).then(u.resolve, u.reject).then(() => { f === K && f.committed && f.deactivate(), vs(); }); } catch (y) { @@ -945,24 +945,24 @@ function Mu(e, t, n) { ); if (o) { var p = i.is_rendered(); - i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(kn), l.delete(f), l.set(f, u); + i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(Mn), l.delete(f), l.set(f, u); } const h = (y, b = void 0) => { if (f.activate(), b) - b !== kn && (a.f |= wn, vr(a, b)); + b !== Mn && (a.f |= wn, vr(a, b)); else { (a.f & wn) !== 0 && (a.f ^= wn), vr(a, y); for (const [m, $] of l) { if (l.delete(m), m === f) break; - $.reject(kn); + $.reject(Mn); } } o && (i.update_pending_count(-1), f.decrement(p)); }; u.promise.then(h, (y) => h(null, y || "unknown")); - }), qu(() => { + }), Vu(() => { for (const u of l.values()) - u.reject(kn); + u.reject(Mn); }), new Promise((u) => { function f(p) { function h() { @@ -974,194 +974,194 @@ function Mu(e, t, n) { }); } // @__NO_SIDE_EFFECTS__ -function vn(e) { - const t = /* @__PURE__ */ Bi(e); - return Oo(t), t; +function vn(t) { + const e = /* @__PURE__ */ Bi(t); + return Fo(e), e; } // @__NO_SIDE_EFFECTS__ -function go(e) { - const t = /* @__PURE__ */ Bi(e); - return t.equals = no, t; -} -function Pu(e) { - var t = e.effects; - if (t !== null) { - e.effects = null; - for (var n = 0; n < t.length; n += 1) - ze( +function _o(t) { + const e = /* @__PURE__ */ Bi(t); + return e.equals = ro, e; +} +function Du(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + Vt( /** @type {Effect} */ - t[n] + e[n] ); } } -function Du(e) { - for (var t = e.parent; t !== null; ) { - if ((t.f & Re) === 0) - return (t.f & ln) === 0 ? ( +function Ou(t) { + for (var e = t.parent; e !== null; ) { + if ((e.f & St) === 0) + return (e.f & ln) === 0 ? ( /** @type {Effect} */ - t + e ) : null; - t = t.parent; + e = e.parent; } return null; } -function Ds(e) { - var t, n = J; - zt(Du(e)); +function Ds(t) { + var e, n = J; + He(Ou(t)); try { - e.f &= ~Wn, Pu(e), t = qo(e); + t.f &= ~Un, Du(t), e = Vo(t); } finally { - zt(n); + He(n); } - return t; + return e; } -function _o(e) { - var t = Ds(e); - if (!e.equals(t) && (e.wv = Io(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - de(e, Ae); +function mo(t) { + var e = Ds(t); + if (!t.equals(e) && (t.wv = Lo(), (!(K != null && K.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + vt(t, Et); return; } - An || (Ce !== null ? (Fs() || K != null && K.is_fork) && Ce.set(e, t) : Ps(e)); + An || (Ct !== null ? (Fs() || K != null && K.is_fork) && Ct.set(t, e) : Ps(t)); } -function Ou(e) { - var t, n; - if (e.effects !== null) - for (const r of e.effects) - (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = tu, r.ac = null, Ir(r, 0), Vs(r)); +function Fu(t) { + var e, n; + if (t.effects !== null) + for (const r of t.effects) + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(Mn), r.teardown = nu, r.ac = null, Ir(r, 0), Vs(r)); } -function mo(e) { - if (e.effects !== null) - for (const t of e.effects) - t.teardown && gr(t); +function yo(t) { + if (t.effects !== null) + for (const e of t.effects) + e.teardown && gr(e); } let gs = /* @__PURE__ */ new Set(); const bn = /* @__PURE__ */ new Map(); -let yo = !1; -function Un(e, t) { +let wo = !1; +function Gn(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: e, + v: t, reactions: null, - equals: to, + equals: no, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function $e(e, t) { - const n = Un(e); - return Oo(n), n; +function At(t, e) { + const n = Gn(t); + return Fo(n), n; } // @__NO_SIDE_EFFECTS__ -function wo(e, t = !1, n = !0) { - const r = Un(e); - return t || (r.equals = no), r; +function xo(t, e = !1, n = !0) { + const r = Gn(t); + return e || (r.equals = ro), r; } -function he(e, t, n = !1) { +function pt(t, e, n = !1) { X !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!Et || (X.f & ua) !== 0) && ro() && (X.f & (Re | hn | Ms | ua)) !== 0 && (_t === null || !cr.call(_t, e)) && mu(); - let r = n ? Pn(t) : t; - return vr(e, r); -} -function vr(e, t) { - if (!e.equals(t)) { - var n = e.v; - An ? bn.set(e, t) : bn.set(e, n), e.v = t; + (!Ee || (X.f & fa) !== 0) && io() && (X.f & (St | hn | Ms | fa)) !== 0 && (_e === null || !cr.call(_e, t)) && yu(); + let r = n ? Dn(e) : e; + return vr(t, r); +} +function vr(t, e) { + if (!t.equals(e)) { + var n = t.v; + An ? bn.set(t, e) : bn.set(t, n), t.v = e; var r = un.ensure(); - if (r.capture(e, n), (e.f & Re) !== 0) { + if (r.capture(t, n), (t.f & St) !== 0) { const i = ( /** @type {Derived} */ - e + t ); - (e.f & Se) !== 0 && Ds(i), Ps(i); + (t.f & Nt) !== 0 && Ds(i), Ps(i); } - e.wv = Io(), xo(e, Se), J !== null && (J.f & Ae) !== 0 && (J.f & (Ct | En)) === 0 && (ht === null ? Xu([e]) : ht.push(e)), !r.is_fork && gs.size > 0 && !yo && Fu(); + t.wv = Lo(), bo(t, Nt), J !== null && (J.f & Et) !== 0 && (J.f & (Re | En)) === 0 && (he === null ? Wu([t]) : he.push(t)), !r.is_fork && gs.size > 0 && !wo && Iu(); } - return t; + return e; } -function Fu() { - yo = !1; - for (const e of gs) - (e.f & Ae) !== 0 && de(e, Tt), Gr(e) && gr(e); +function Iu() { + wo = !1; + for (const t of gs) + (t.f & Et) !== 0 && vt(t, Te), Gr(t) && gr(t); gs.clear(); } -function Or(e) { - he(e, e.v + 1); +function Or(t) { + pt(t, t.v + 1); } -function xo(e, t) { - var n = e.reactions; +function bo(t, e) { + var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Se) === 0; - if (o && de(s, t), (a & Re) !== 0) { + var s = n[i], a = s.f, o = (a & Nt) === 0; + if (o && vt(s, e), (a & St) !== 0) { var l = ( /** @type {Derived} */ s ); - Ce == null || Ce.delete(l), (a & Wn) === 0 && (a & gt && (s.f |= Wn), xo(l, Tt)); - } else o && ((a & hn) !== 0 && xt !== null && xt.add( + Ct == null || Ct.delete(l), (a & Un) === 0 && (a & ge && (s.f |= Un), bo(l, Te)); + } else o && ((a & hn) !== 0 && xe !== null && xe.add( /** @type {Effect} */ s - ), At( + ), Ae( /** @type {Effect} */ s )); } } -function Pn(e) { - if (typeof e != "object" || e === null || Pr in e) - return e; - const t = Ga(e); - if (t !== Ql && t !== eu) - return e; - var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { - if (Bn === s) +function Dn(t) { + if (typeof t != "object" || t === null || Pr in t) + return t; + const e = Ka(t); + if (e !== tu && e !== eu) + return t; + var n = /* @__PURE__ */ new Map(), r = Ga(t), i = /* @__PURE__ */ At(0), s = Xn, a = (o) => { + if (Xn === s) return o(); - var l = X, u = Bn; - mt(null), da(s); + var l = X, u = Xn; + me(null), pa(s); var f = o(); - return mt(l), da(u), f; + return me(l), pa(u), f; }; - return r && n.set("length", /* @__PURE__ */ $e( + return r && n.set("length", /* @__PURE__ */ At( /** @type {any[]} */ - e.length + t.length )), new Proxy( /** @type {any} */ - e, + t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && gu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && _u(); var f = n.get(l); return f === void 0 ? a(() => { - var p = /* @__PURE__ */ $e(u.value); + var p = /* @__PURE__ */ At(u.value); return n.set(l, p), p; - }) : he(f, u.value, !0), !0; + }) : pt(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ $e(Te)); + const f = a(() => /* @__PURE__ */ At(Rt)); n.set(l, f), Or(i); } } else - he(u, Te), Or(i); + pt(u, Rt), Or(i); return !0; }, get(o, l, u) { var d; if (l === Pr) - return e; + return t; var f = n.get(l), p = l in o; - if (f === void 0 && (!p || (d = Hn(o, l)) != null && d.writable) && (f = a(() => { - var y = Pn(p ? o[l] : Te), b = /* @__PURE__ */ $e(y); + if (f === void 0 && (!p || (d = Yn(o, l)) != null && d.writable) && (f = a(() => { + var y = Dn(p ? o[l] : Rt), b = /* @__PURE__ */ At(y); return b; }), n.set(l, f)), f !== void 0) { var h = x(f); - return h === Te ? void 0 : h; + return h === Rt ? void 0 : h; } return Reflect.get(o, l, u); }, @@ -1172,7 +1172,7 @@ function Pn(e) { f && (u.value = x(f)); } else if (u === void 0) { var p = n.get(l), h = p == null ? void 0 : p.v; - if (p !== void 0 && h !== Te) + if (p !== void 0 && h !== Rt) return { enumerable: !0, configurable: !0, @@ -1186,14 +1186,14 @@ function Pn(e) { var h; if (l === Pr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Te || Reflect.has(o, l); - if (u !== void 0 || J !== null && (!f || (h = Hn(o, l)) != null && h.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Rt || Reflect.has(o, l); + if (u !== void 0 || J !== null && (!f || (h = Yn(o, l)) != null && h.writable)) { u === void 0 && (u = a(() => { - var d = f ? Pn(o[l]) : Te, y = /* @__PURE__ */ $e(d); + var d = f ? Dn(o[l]) : Rt, y = /* @__PURE__ */ At(d); return y; }), n.set(l, u)); var p = x(u); - if (p === Te) + if (p === Rt) return !1; } return f; @@ -1205,14 +1205,14 @@ function Pn(e) { for (var d = u; d < /** @type {Source} */ p.v; d += 1) { var y = n.get(d + ""); - y !== void 0 ? he(y, Te) : d in o && (y = a(() => /* @__PURE__ */ $e(Te)), n.set(d + "", y)); + y !== void 0 ? pt(y, Rt) : d in o && (y = a(() => /* @__PURE__ */ At(Rt)), n.set(d + "", y)); } if (p === void 0) - (!h || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); + (!h || (M = Yn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ At(void 0)), pt(p, Dn(u)), n.set(l, p)); else { - h = p.v !== Te; - var b = a(() => Pn(u)); - he(p, b); + h = p.v !== Rt; + var b = a(() => Dn(u)); + pt(p, b); } var m = Reflect.getOwnPropertyDescriptor(o, l); if (m != null && m.set && m.set.call(f, u), !h) { @@ -1221,7 +1221,7 @@ function Pn(e) { /** @type {Source} */ n.get("length") ), D = Number(l); - Number.isInteger(D) && D >= $.v && he($, D + 1); + Number.isInteger(D) && D >= $.v && pt($, D + 1); } Or(i); } @@ -1231,67 +1231,67 @@ function Pn(e) { x(i); var l = Reflect.ownKeys(o).filter((p) => { var h = n.get(p); - return h === void 0 || h.v !== Te; + return h === void 0 || h.v !== Rt; }); for (var [u, f] of n) - f.v !== Te && !(u in o) && l.push(u); + f.v !== Rt && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - _u(); + mu(); } } ); } -var ca, bo, $o, Ao; +var ha, $o, Ao, Eo; function _s() { - if (ca === void 0) { - ca = window, bo = /Firefox/.test(navigator.userAgent); - var e = Element.prototype, t = Node.prototype, n = Text.prototype; - $o = Hn(t, "firstChild").get, Ao = Hn(t, "nextSibling").get, la(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), la(n) && (n.__t = void 0); + if (ha === void 0) { + ha = window, $o = /Firefox/.test(navigator.userAgent); + var t = Element.prototype, e = Node.prototype, n = Text.prototype; + Ao = Yn(e, "firstChild").get, Eo = Yn(e, "nextSibling").get, ua(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ua(n) && (n.__t = void 0); } } -function ot(e = "") { - return document.createTextNode(e); +function ae(t = "") { + return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function fn(e) { +function fn(t) { return ( /** @type {TemplateNode | null} */ - $o.call(e) + Ao.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Yt(e) { +function Be(t) { return ( /** @type {TemplateNode | null} */ - Ao.call(e) + Eo.call(t) ); } -function Xe(e, t) { +function Xt(t, e) { if (!j) - return /* @__PURE__ */ fn(e); + return /* @__PURE__ */ fn(t); var n = /* @__PURE__ */ fn(W); if (n === null) - n = W.appendChild(ot()); - else if (t && n.nodeType !== Ur) { - var r = ot(); - return n == null || n.before(r), Ve(r), r; + n = W.appendChild(ae()); + else if (e && n.nodeType !== Ur) { + var r = ae(); + return n == null || n.before(r), qt(r), r; } - return t && Xi( + return e && Xi( /** @type {Text} */ n - ), Ve(n), n; + ), qt(n), n; } -function _n(e, t = !1) { +function _n(t, e = !1) { if (!j) { - var n = /* @__PURE__ */ fn(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Yt(n) : n; + var n = /* @__PURE__ */ fn(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Be(n) : n; } - if (t) { + if (e) { if ((W == null ? void 0 : W.nodeType) !== Ur) { - var r = ot(); - return W == null || W.before(r), Ve(r), r; + var r = ae(); + return W == null || W.before(r), qt(r), r; } Xi( /** @type {Text} */ @@ -1300,74 +1300,74 @@ function _n(e, t = !1) { } return W; } -function nt(e, t = 1, n = !1) { - let r = j ? W : e; - for (var i; t--; ) +function ee(t, e = 1, n = !1) { + let r = j ? W : t; + for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(r); + /* @__PURE__ */ Be(r); if (!j) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = ot(); - return r === null ? i == null || i.after(s) : r.before(s), Ve(s), s; + var s = ae(); + return r === null ? i == null || i.after(s) : r.before(s), qt(s), s; } Xi( /** @type {Text} */ r ); } - return Ve(r), r; + return qt(r), r; } -function Eo(e) { - e.textContent = ""; +function To(t) { + t.textContent = ""; } -function To() { +function Ro() { return !1; } -function Os(e, t, n) { +function Os(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Wa, e, void 0) + document.createElementNS(Ua, t, void 0) ); } -function Xi(e) { +function Xi(t) { if ( /** @type {string} */ - e.nodeValue.length < 65536 + t.nodeValue.length < 65536 ) return; - let t = e.nextSibling; - for (; t !== null && t.nodeType === Ur; ) - t.remove(), e.nodeValue += /** @type {string} */ - t.nodeValue, t = e.nextSibling; -} -function Co(e) { - var t = X, n = J; - mt(null), zt(null); + let e = t.nextSibling; + for (; e !== null && e.nodeType === Ur; ) + e.remove(), t.nodeValue += /** @type {string} */ + e.nodeValue, e = t.nextSibling; +} +function Co(t) { + var e = X, n = J; + me(null), He(null); try { - return e(); + return t(); } finally { - mt(t), zt(n); + me(e), He(n); } } -function Iu(e) { - J === null && (X === null && hu(), cu()), An && fu(); +function Lu(t) { + J === null && (X === null && du(), hu()), An && cu(); } -function Lu(e, t) { - var n = t.last; - n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); +function qu(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Bt(e, t, n) { +function Xe(t, e, n) { var r = J; - r !== null && (r.f & at) !== 0 && (e |= at); + r !== null && (r.f & se) !== 0 && (t |= se); var i = { - ctx: lt, + ctx: oe, deps: null, nodes: null, - f: e | Se | gt, + f: t | Nt | ge, first: null, - fn: t, + fn: e, last: null, next: null, parent: r, @@ -1381,12 +1381,12 @@ function Bt(e, t, n) { try { gr(i); } catch (o) { - throw ze(i), o; + throw Vt(i), o; } - else t !== null && At(i); + else e !== null && Ae(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & jn) === 0 && (s = s.first, (e & hn) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Lu(s, r), X !== null && (X.f & Re) !== 0 && (e & En) === 0)) { + (s.f & Jn) === 0 && (s = s.first, (t & hn) !== 0 && (t & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && qu(s, r), X !== null && (X.f & St) !== 0 && (t & En) === 0)) { var a = ( /** @type {Derived} */ X @@ -1396,126 +1396,126 @@ function Bt(e, t, n) { return i; } function Fs() { - return X !== null && !Et; + return X !== null && !Ee; } -function qu(e) { - const t = Bt(Li, null, !1); - return de(t, Ae), t.teardown = e, t; +function Vu(t) { + const e = Xe(Li, null, !1); + return vt(e, Et), e.teardown = t, e; } -function Is(e) { - Iu(); - var t = ( +function Is(t) { + Lu(); + var e = ( /** @type {Effect} */ J.f - ), n = !X && (t & Ct) !== 0 && (t & yr) === 0; + ), n = !X && (e & Re) !== 0 && (e & yr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - lt + oe ); - (r.e ?? (r.e = [])).push(e); + (r.e ?? (r.e = [])).push(t); } else - return Ro(e); + return So(t); } -function Ro(e) { - return Bt(Fr | iu, e, !1); +function So(t) { + return Xe(Fr | su, t, !1); } -function Vu(e) { +function zu(t) { un.ensure(); - const t = Bt(En | jn, e, !0); + const e = Xe(En | Jn, t, !0); return () => { - ze(t); + Vt(e); }; } -function zu(e) { +function Hu(t) { un.ensure(); - const t = Bt(En | jn, e, !0); + const e = Xe(En | Jn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Yn(t, () => { - ze(t), r(void 0); - }) : (ze(t), r(void 0)); + n.outro ? Bn(e, () => { + Vt(e), r(void 0); + }) : (Vt(e), r(void 0)); }); } -function So(e) { - return Bt(Fr, e, !1); +function No(t) { + return Xe(Fr, t, !1); } -function Hu(e) { - return Bt(Ms | jn, e, !0); +function Yu(t) { + return Xe(Ms | Jn, t, !0); } -function Ls(e, t = 0) { - return Bt(Li | t, e, !0); +function Ls(t, e = 0) { + return Xe(Li | e, t, !0); } -function Qt(e, t = [], n = [], r = []) { - Nu(r, t, n, (i) => { - Bt(Li, () => e(...i.map(x)), !0); +function Qe(t, e = [], n = [], r = []) { + ku(r, e, n, (i) => { + Xe(Li, () => t(...i.map(x)), !0); }); } -function qs(e, t = 0) { - var n = Bt(hn | t, e, !0); +function qs(t, e = 0) { + var n = Xe(hn | e, t, !0); return n; } -function vt(e) { - return Bt(Ct | jn, e, !0); +function ve(t) { + return Xe(Re | Jn, t, !0); } -function No(e) { - var t = e.teardown; - if (t !== null) { +function ko(t) { + var e = t.teardown; + if (e !== null) { const n = An, r = X; - ha(!0), mt(null); + da(!0), me(null); try { - t.call(null); + e.call(null); } finally { - ha(n), mt(r); + da(n), me(r); } } } -function Vs(e, t = !1) { - var n = e.first; - for (e.first = e.last = null; n !== null; ) { +function Vs(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { const i = n.ac; i !== null && Co(() => { - i.abort(kn); + i.abort(Mn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : ze(n, t), n = r; + (n.f & En) !== 0 ? n.parent = null : Vt(n, e), n = r; } } -function Yu(e) { - for (var t = e.first; t !== null; ) { - var n = t.next; - (t.f & Ct) === 0 && ze(t), t = n; +function Bu(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + (e.f & Re) === 0 && Vt(e), e = n; } } -function ze(e, t = !0) { +function Vt(t, e = !0) { var n = !1; - (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Bu( - e.nodes.start, + (e || (t.f & Qa) !== 0) && t.nodes !== null && t.nodes.end !== null && (Xu( + t.nodes.start, /** @type {TemplateNode} */ - e.nodes.end - ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, ln); - var r = e.nodes && e.nodes.t; + t.nodes.end + ), n = !0), Vs(t, e && !n), Ir(t, 0), vt(t, ln); + var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - No(e); - var i = e.parent; - i !== null && i.first !== null && ko(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + ko(t); + var i = t.parent; + i !== null && i.first !== null && Mo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function Bu(e, t) { - for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ Yt(e); - e.remove(), e = n; +function Xu(t, e) { + for (; t !== null; ) { + var n = t === e ? null : /* @__PURE__ */ Be(t); + t.remove(), t = n; } } -function ko(e) { - var t = e.parent, n = e.prev, r = e.next; - n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); +function Mo(t) { + var e = t.parent, n = t.prev, r = t.next; + n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Yn(e, t, n = !0) { +function Bn(t, e, n = !0) { var r = []; - Mo(e, r, !0); + Po(t, r, !0); var i = () => { - n && ze(e), t && t(); + n && Vt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,313 +1524,313 @@ function Yn(e, t, n = !0) { } else i(); } -function Mo(e, t, n) { - if ((e.f & at) === 0) { - e.f ^= at; - var r = e.nodes && e.nodes.t; +function Po(t, e, n) { + if ((t.f & se) === 0) { + t.f ^= se; + var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && t.push(o); - for (var i = e.first; i !== null; ) { + (o.is_global || n) && e.push(o); + for (var i = t.first; i !== null; ) { var s = i.next, a = (i.f & hr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & Ct) !== 0 && (e.f & hn) !== 0; - Mo(i, t, a ? n : !1), i = s; + (i.f & Re) !== 0 && (t.f & hn) !== 0; + Po(i, e, a ? n : !1), i = s; } } } -function zs(e) { - Po(e, !0); +function zs(t) { + Do(t, !0); } -function Po(e, t) { - if ((e.f & at) !== 0) { - e.f ^= at, (e.f & Ae) === 0 && (de(e, Se), At(e)); - for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & Ct) !== 0; - Po(n, i ? t : !1), n = r; +function Do(t, e) { + if ((t.f & se) !== 0) { + t.f ^= se, (t.f & Et) === 0 && (vt(t, Nt), Ae(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & hr) !== 0 || (n.f & Re) !== 0; + Do(n, i ? e : !1), n = r; } - var s = e.nodes && e.nodes.t; + var s = t.nodes && t.nodes.t; if (s !== null) for (const a of s) - (a.is_global || t) && a.in(); + (a.is_global || e) && a.in(); } } -function Do(e, t) { - if (e.nodes) - for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Yt(n); - t.append(n), n = i; +function Oo(t, e) { + if (t.nodes) + for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ Be(n); + e.append(n), n = i; } } let di = !1, An = !1; -function ha(e) { - An = e; +function da(t) { + An = t; } -let X = null, Et = !1; -function mt(e) { - X = e; +let X = null, Ee = !1; +function me(t) { + X = t; } let J = null; -function zt(e) { - J = e; +function He(t) { + J = t; } -let _t = null; -function Oo(e) { - X !== null && (_t === null ? _t = [e] : _t.push(e)); +let _e = null; +function Fo(t) { + X !== null && (_e === null ? _e = [t] : _e.push(t)); } -let Ke = null, rt = 0, ht = null; -function Xu(e) { - ht = e; +let Kt = null, ne = 0, he = null; +function Wu(t) { + he = t; } -let Fo = 1, Dn = 0, Bn = Dn; -function da(e) { - Bn = e; +let Io = 1, On = 0, Xn = On; +function pa(t) { + Xn = t; } -function Io() { - return ++Fo; +function Lo() { + return ++Io; } -function Gr(e) { - var t = e.f; - if ((t & Se) !== 0) +function Gr(t) { + var e = t.f; + if ((e & Nt) !== 0) return !0; - if (t & Re && (e.f &= ~Wn), (t & Tt) !== 0) { + if (e & St && (t.f &= ~Un), (e & Te) !== 0) { for (var n = ( /** @type {Value[]} */ - e.deps + t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; if (Gr( /** @type {Derived} */ s - ) && _o( + ) && mo( /** @type {Derived} */ s - ), s.wv > e.wv) + ), s.wv > t.wv) return !0; } - (t & gt) !== 0 && // During time traveling we don't want to reset the status so that + (e & ge) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Ce === null && de(e, Ae); + Ct === null && vt(t, Et); } return !1; } -function Lo(e, t, n = !0) { - var r = e.reactions; - if (r !== null && !(_t !== null && cr.call(_t, e))) +function qo(t, e, n = !0) { + var r = t.reactions; + if (r !== null && !(_e !== null && cr.call(_e, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Re) !== 0 ? Lo( + (s.f & St) !== 0 ? qo( /** @type {Derived} */ s, - t, + e, !1 - ) : t === s && (n ? de(s, Se) : (s.f & Ae) !== 0 && de(s, Tt), At( + ) : e === s && (n ? vt(s, Nt) : (s.f & Et) !== 0 && vt(s, Te), Ae( /** @type {Effect} */ s )); } } -function qo(e) { +function Vo(t) { var b; - var t = Ke, n = rt, r = ht, i = X, s = _t, a = lt, o = Et, l = Bn, u = e.f; - Ke = /** @type {null | Value[]} */ - null, rt = 0, ht = null, X = (u & (Ct | En)) === 0 ? e : null, _t = null, dr(e.ctx), Et = !1, Bn = ++Dn, e.ac !== null && (Co(() => { - e.ac.abort(kn); - }), e.ac = null); + var e = Kt, n = ne, r = he, i = X, s = _e, a = oe, o = Ee, l = Xn, u = t.f; + Kt = /** @type {null | Value[]} */ + null, ne = 0, he = null, X = (u & (Re | En)) === 0 ? t : null, _e = null, dr(t.ctx), Ee = !1, Xn = ++On, t.ac !== null && (Co(() => { + t.ac.abort(Mn); + }), t.ac = null); try { - e.f |= ls; + t.f |= ls; var f = ( /** @type {Function} */ - e.fn + t.fn ), p = f(); - e.f |= yr; - var h = e.deps, d = K == null ? void 0 : K.is_fork; - if (Ke !== null) { + t.f |= yr; + var h = t.deps, d = K == null ? void 0 : K.is_fork; + if (Kt !== null) { var y; - if (d || Ir(e, rt), h !== null && rt > 0) - for (h.length = rt + Ke.length, y = 0; y < Ke.length; y++) - h[rt + y] = Ke[y]; + if (d || Ir(t, ne), h !== null && ne > 0) + for (h.length = ne + Kt.length, y = 0; y < Kt.length; y++) + h[ne + y] = Kt[y]; else - e.deps = h = Ke; - if (Fs() && (e.f & gt) !== 0) - for (y = rt; y < h.length; y++) - ((b = h[y]).reactions ?? (b.reactions = [])).push(e); - } else !d && h !== null && rt < h.length && (Ir(e, rt), h.length = rt); - if (ro() && ht !== null && !Et && h !== null && (e.f & (Re | Tt | Se)) === 0) + t.deps = h = Kt; + if (Fs() && (t.f & ge) !== 0) + for (y = ne; y < h.length; y++) + ((b = h[y]).reactions ?? (b.reactions = [])).push(t); + } else !d && h !== null && ne < h.length && (Ir(t, ne), h.length = ne); + if (io() && he !== null && !Ee && h !== null && (t.f & (St | Te | Nt)) === 0) for (y = 0; y < /** @type {Source[]} */ - ht.length; y++) - Lo( - ht[y], + he.length; y++) + qo( + he[y], /** @type {Effect} */ - e + t ); - if (i !== null && i !== e) { - if (Dn++, i.deps !== null) + if (i !== null && i !== t) { + if (On++, i.deps !== null) for (let m = 0; m < n; m += 1) - i.deps[m].rv = Dn; - if (t !== null) - for (const m of t) - m.rv = Dn; - ht !== null && (r === null ? r = ht : r.push(.../** @type {Source[]} */ - ht)); + i.deps[m].rv = On; + if (e !== null) + for (const m of e) + m.rv = On; + he !== null && (r === null ? r = he : r.push(.../** @type {Source[]} */ + he)); } - return (e.f & wn) !== 0 && (e.f ^= wn), p; + return (t.f & wn) !== 0 && (t.f ^= wn), p; } catch (m) { - return so(m); + return ao(m); } finally { - e.f ^= ls, Ke = t, rt = n, ht = r, X = i, _t = s, dr(a), Et = o, Bn = l; + t.f ^= ls, Kt = e, ne = n, he = r, X = i, _e = s, dr(a), Ee = o, Xn = l; } } -function Wu(e, t) { - let n = t.reactions; +function Uu(t, e) { + let n = e.reactions; if (n !== null) { - var r = Jl.call(n, e); + var r = Zl.call(n, t); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (t.f & Re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & St) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (Ke === null || !cr.call(Ke, t))) { + (Kt === null || !cr.call(Kt, e))) { var s = ( /** @type {Derived} */ - t + e ); - (s.f & gt) !== 0 && (s.f ^= gt, s.f &= ~Wn), Ps(s), Ou(s), Ir(s, 0); + (s.f & ge) !== 0 && (s.f ^= ge, s.f &= ~Un), Ps(s), Fu(s), Ir(s, 0); } } -function Ir(e, t) { - var n = e.deps; +function Ir(t, e) { + var n = t.deps; if (n !== null) - for (var r = t; r < n.length; r++) - Wu(e, n[r]); + for (var r = e; r < n.length; r++) + Uu(t, n[r]); } -function gr(e) { - var t = e.f; - if ((t & ln) === 0) { - de(e, Ae); +function gr(t) { + var e = t.f; + if ((e & ln) === 0) { + vt(t, Et); var n = J, r = di; - J = e, di = !0; + J = t, di = !0; try { - (t & (hn | ja)) !== 0 ? Yu(e) : Vs(e), No(e); - var i = qo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Fo; + (e & (hn | Ja)) !== 0 ? Bu(t) : Vs(t), ko(t); + var i = Vo(t); + t.teardown = typeof i == "function" ? i : null, t.wv = Io; var s; - os && bu && (e.f & Se) !== 0 && e.deps; + os && $u && (t.f & Nt) !== 0 && t.deps; } finally { di = r, J = n; } } } -function x(e) { - var t = e.f, n = (t & Re) !== 0; - if (X !== null && !Et) { +function x(t) { + var e = t.f, n = (e & St) !== 0; + if (X !== null && !Ee) { var r = J !== null && (J.f & ln) !== 0; - if (!r && (_t === null || !cr.call(_t, e))) { + if (!r && (_e === null || !cr.call(_e, t))) { var i = X.deps; if ((X.f & ls) !== 0) - e.rv < Dn && (e.rv = Dn, Ke === null && i !== null && i[rt] === e ? rt++ : Ke === null ? Ke = [e] : Ke.push(e)); + t.rv < On && (t.rv = On, Kt === null && i !== null && i[ne] === t ? ne++ : Kt === null ? Kt = [t] : Kt.push(t)); else { - (X.deps ?? (X.deps = [])).push(e); - var s = e.reactions; - s === null ? e.reactions = [X] : cr.call(s, X) || s.push(X); + (X.deps ?? (X.deps = [])).push(t); + var s = t.reactions; + s === null ? t.reactions = [X] : cr.call(s, X) || s.push(X); } } } - if (An && bn.has(e)) - return bn.get(e); + if (An && bn.has(t)) + return bn.get(t); if (n) { var a = ( /** @type {Derived} */ - e + t ); if (An) { var o = a.v; - return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; + return ((a.f & Et) === 0 && a.reactions !== null || Ho(a)) && (o = Ds(a)), bn.set(a, o), o; } - var l = (a.f & gt) === 0 && !Et && X !== null && (di || (X.f & gt) !== 0), u = (a.f & yr) === 0; - Gr(a) && (l && (a.f |= gt), _o(a)), l && !u && (mo(a), Vo(a)); - } - if (Ce != null && Ce.has(e)) - return Ce.get(e); - if ((e.f & wn) !== 0) - throw e.v; - return e.v; -} -function Vo(e) { - if (e.f |= gt, e.deps !== null) - for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Re) !== 0 && (t.f & gt) === 0 && (mo( + var l = (a.f & ge) === 0 && !Ee && X !== null && (di || (X.f & ge) !== 0), u = (a.f & yr) === 0; + Gr(a) && (l && (a.f |= ge), mo(a)), l && !u && (yo(a), zo(a)); + } + if (Ct != null && Ct.has(t)) + return Ct.get(t); + if ((t.f & wn) !== 0) + throw t.v; + return t.v; +} +function zo(t) { + if (t.f |= ge, t.deps !== null) + for (const e of t.deps) + (e.reactions ?? (e.reactions = [])).push(t), (e.f & St) !== 0 && (e.f & ge) === 0 && (yo( /** @type {Derived} */ - t - ), Vo( + e + ), zo( /** @type {Derived} */ - t + e )); } -function zo(e) { - if (e.v === Te) return !0; - if (e.deps === null) return !1; - for (const t of e.deps) - if (bn.has(t) || (t.f & Re) !== 0 && zo( +function Ho(t) { + if (t.v === Rt) return !0; + if (t.deps === null) return !1; + for (const e of t.deps) + if (bn.has(e) || (e.f & St) !== 0 && Ho( /** @type {Derived} */ - t + e )) return !0; return !1; } -function Wi(e) { - var t = Et; +function Wi(t) { + var e = Ee; try { - return Et = !0, e(); + return Ee = !0, t(); } finally { - Et = t; + Ee = e; } } -const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Uu(e) { - for (var t = 0; t < e.length; t++) - Ho.add(e[t]); +const Yo = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); +function Gu(t) { + for (var e = 0; e < t.length; e++) + Yo.add(t[e]); for (var n of ms) - n(e); + n(t); } -let pa = null; -function va(e) { +let va = null; +function ga(t) { var m; - var t = this, n = ( + var e = this, n = ( /** @type {Node} */ - t.ownerDocument - ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( + e.ownerDocument + ), r = t.type, i = ((m = t.composedPath) == null ? void 0 : m.call(t)) || [], s = ( /** @type {null | Element} */ - i[0] || e.target + i[0] || t.target ); - pa = e; - var a = 0, o = pa === e && e.__root; + va = t; + var a = 0, o = va === t && t.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (t === document || t === /** @type {any} */ + if (l !== -1 && (e === document || e === /** @type {any} */ window)) { - e.__root = t; + t.__root = e; return; } - var u = i.indexOf(t); + var u = i.indexOf(e); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || e.target, s !== t) { - Ai(e, "currentTarget", { + i[a] || t.target, s !== e) { + Ai(t, "currentTarget", { configurable: !0, get() { return s || n; } }); var f = X, p = J; - mt(null), zt(null); + me(null), He(null); try { for (var h, d = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1840,11 +1840,11 @@ function va(e) { b != null && (!/** @type {any} */ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place - e.target === s) && b.call(s, e); + t.target === s) && b.call(s, t); } catch ($) { h ? d.push($) : h = $; } - if (e.cancelBubble || y === t || y === null) + if (t.cancelBubble || y === e || y === null) break; s = y; } @@ -1856,46 +1856,46 @@ function va(e) { throw h; } } finally { - e.__root = t, delete e.currentTarget, mt(f), zt(p); + t.__root = e, delete t.currentTarget, me(f), He(p); } } } -var Ya, Ba; -const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( +var Ba, Xa; +const es = (Xa = (Ba = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ba.trustedTypes) == null ? void 0 : /* @__PURE__ */ Xa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (e) => e + createHTML: (t) => t } ); -function Gu(e) { +function Ku(t) { return ( /** @type {string} */ - (ts == null ? void 0 : ts.createHTML(e)) ?? e + (es == null ? void 0 : es.createHTML(t)) ?? t ); } -function Yo(e, t = !1) { +function Bo(t, e = !1) { var n = Os("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Gu(e) : e, n.content; + return t = t.replaceAll("", ""), n.innerHTML = e ? Ku(t) : t, n.content; } -function $n(e, t) { +function $n(t, e) { var n = ( /** @type {Effect} */ J ); - n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); + n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Xt(e, t) { - var n = (t & Kl) !== 0, r = (t & jl) !== 0, i, s = !e.startsWith(""); +function We(t, e) { + var n = (e & jl) !== 0, r = (e & Jl) !== 0, i, s = !t.startsWith(""); return () => { if (j) return $n(W, null), W; - i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + i === void 0 && (i = Bo(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ fn(i))); var a = ( /** @type {TemplateNode} */ - r || bo ? document.importNode(i, !0) : i.cloneNode(!0) + r || $o ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( @@ -1912,15 +1912,15 @@ function Xt(e, t) { }; } // @__NO_SIDE_EFFECTS__ -function Ku(e, t, n = "svg") { - var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; +function ju(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { if (j) return $n(W, null), W; if (!s) { var a = ( /** @type {DocumentFragment} */ - Yo(i, !0) + Bo(i, !0) ), o = ( /** @type {Element} */ /* @__PURE__ */ fn(a) @@ -1936,21 +1936,21 @@ function Ku(e, t, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function ju(e, t) { - return /* @__PURE__ */ Ku(e, t, "svg"); +function Ju(t, e) { + return /* @__PURE__ */ ju(t, e, "svg"); } -function ga(e = "") { +function _a(t = "") { if (!j) { - var t = ot(e + ""); - return $n(t, t), t; + var e = ae(t + ""); + return $n(e, e), e; } var n = W; - return n.nodeType !== Ur ? (n.before(n = ot()), Ve(n)) : Xi( + return n.nodeType !== Ur ? (n.before(n = ae()), qt(n)) : Xi( /** @type {Text} */ n ), $n(n, n), n; } -function Ue(e, t) { +function Ut(t, e) { if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ @@ -1959,69 +1959,69 @@ function Ue(e, t) { ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = W), Vi(); return; } - e !== null && e.before( + t !== null && t.before( /** @type {Node} */ - t + e ); } -const Ju = ["touchstart", "touchmove"]; -function Zu(e) { - return Ju.includes(e); +const Zu = ["touchstart", "touchmove"]; +function Qu(t) { + return Zu.includes(t); } -function mn(e, t) { - var n = t == null ? "" : typeof t == "object" ? t + "" : t; - n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); +function mn(t, e) { + var n = e == null ? "" : typeof e == "object" ? e + "" : e; + n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function Bo(e, t) { - return Xo(e, t); +function Xo(t, e) { + return Wo(t, e); } -function Qu(e, t) { - _s(), t.intro = t.intro ?? !1; - const n = t.target, r = j, i = W; +function tf(t, e) { + _s(), e.intro = e.intro ?? !1; + const n = e.target, r = j, i = W; try { for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== wr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ Yt(s); + s = /* @__PURE__ */ Be(s); if (!s) throw fr; - on(!0), Ve( + on(!0), qt( /** @type {Comment} */ s ); - const a = Xo(e, { ...t, anchor: s }); + const a = Wo(t, { ...e, anchor: s }); return on(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && pu(), _s(), Eo(n), on(!1), Bo(e, t); + return a !== fr && console.warn("Failed to hydrate: ", a), e.recover === !1 && vu(), _s(), To(n), on(!1), Xo(t, e); } finally { - on(r), Ve(i); + on(r), qt(i); } } const ii = /* @__PURE__ */ new Map(); -function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +function Wo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { _s(); var o = /* @__PURE__ */ new Set(), l = (p) => { for (var h = 0; h < p.length; h++) { var d = p[h]; if (!o.has(d)) { o.add(d); - var y = Zu(d); - for (const $ of [t, document]) { + var y = Qu(d); + for (const $ of [e, document]) { var b = ii.get($); b === void 0 && (b = /* @__PURE__ */ new Map(), ii.set($, b)); var m = b.get(d); - m === void 0 ? ($.addEventListener(d, va, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); + m === void 0 ? ($.addEventListener(d, ga, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); } } } }; - l(Ii(Ho)), ms.add(l); - var u = void 0, f = zu(() => { - var p = n ?? t.appendChild(ot()); - return Ru( + l(Ii(Yo)), ms.add(l); + var u = void 0, f = Hu(() => { + var p = n ?? e.appendChild(ae()); + return Su( /** @type {TemplateNode} */ p, { @@ -2032,13 +2032,13 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int zi({}); var d = ( /** @type {ComponentContext} */ - lt + oe ); if (s && (d.c = s), i && (r.$$events = i), j && $n( /** @type {TemplateNode} */ h, null - ), u = e(h, r) || {}, j && (J.nodes.end = W, W === null || W.nodeType !== wr || /** @type {Comment} */ + ), u = t(h, r) || {}, j && (J.nodes.end = W, W === null || W.nodeType !== wr || /** @type {Comment} */ W.data !== ks)) throw qi(), fr; Hi(); @@ -2046,7 +2046,7 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int ), () => { var b; for (var h of o) - for (const m of [t, document]) { + for (const m of [e, document]) { var d = ( /** @type {Map} */ ii.get(m) @@ -2054,7 +2054,7 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int /** @type {number} */ d.get(h) ); - --y == 0 ? (m.removeEventListener(h, va), d.delete(h), d.size === 0 && ii.delete(m)) : d.set(h, y); + --y == 0 ? (m.removeEventListener(h, ga), d.delete(h), d.size === 0 && ii.delete(m)) : d.set(h, y); } ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); }; @@ -2062,21 +2062,21 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int return ys.set(u, f), u; } let ys = /* @__PURE__ */ new WeakMap(); -function ef(e, t) { - const n = ys.get(e); - return n ? (ys.delete(e), n(t)) : Promise.resolve(); +function ef(t, e) { + const n = ys.get(t); + return n ? (ys.delete(t), n(e)) : Promise.resolve(); } -var bt, Lt, st, zn, Xr, Wr, Oi; -class tf { +var be, qe, ie, Hn, Xr, Wr, Oi; +class nf { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(t, n = !0) { + constructor(e, n = !0) { /** @type {TemplateNode} */ - ce(this, "anchor"); + dt(this, "anchor"); /** @type {Map} */ - H(this, bt, /* @__PURE__ */ new Map()); + B(this, be, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,122 +2091,122 @@ class tf { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Lt, /* @__PURE__ */ new Map()); + B(this, qe, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - H(this, st, /* @__PURE__ */ new Map()); + B(this, ie, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - H(this, zn, /* @__PURE__ */ new Set()); + B(this, Hn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - H(this, Xr, !0); - H(this, Wr, () => { - var t = ( + B(this, Xr, !0); + B(this, Wr, () => { + var e = ( /** @type {Batch} */ K ); - if (v(this, bt).has(t)) { + if (v(this, be).has(e)) { var n = ( /** @type {Key} */ - v(this, bt).get(t) - ), r = v(this, Lt).get(n); + v(this, be).get(e) + ), r = v(this, qe).get(n); if (r) - zs(r), v(this, zn).delete(n); + zs(r), v(this, Hn).delete(n); else { - var i = v(this, st).get(n); - i && (v(this, Lt).set(n, i.effect), v(this, st).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, ie).get(n); + i && (v(this, qe).set(n, i.effect), v(this, ie).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, bt)) { - if (v(this, bt).delete(s), s === t) + for (const [s, a] of v(this, be)) { + if (v(this, be).delete(s), s === e) break; - const o = v(this, st).get(a); - o && (ze(o.effect), v(this, st).delete(a)); + const o = v(this, ie).get(a); + o && (Vt(o.effect), v(this, ie).delete(a)); } - for (const [s, a] of v(this, Lt)) { - if (s === n || v(this, zn).has(s)) continue; + for (const [s, a] of v(this, qe)) { + if (s === n || v(this, Hn).has(s)) continue; const o = () => { - if (Array.from(v(this, bt).values()).includes(s)) { + if (Array.from(v(this, be).values()).includes(s)) { var u = document.createDocumentFragment(); - Do(a, u), u.append(ot()), v(this, st).set(s, { effect: a, fragment: u }); + Oo(a, u), u.append(ae()), v(this, ie).set(s, { effect: a, fragment: u }); } else - ze(a); - v(this, zn).delete(s), v(this, Lt).delete(s); + Vt(a); + v(this, Hn).delete(s), v(this, qe).delete(s); }; - v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); + v(this, Xr) || !r ? (v(this, Hn).add(s), Bn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - H(this, Oi, (t) => { - v(this, bt).delete(t); - const n = Array.from(v(this, bt).values()); - for (const [r, i] of v(this, st)) - n.includes(r) || (ze(i.effect), v(this, st).delete(r)); + B(this, Oi, (e) => { + v(this, be).delete(e); + const n = Array.from(v(this, be).values()); + for (const [r, i] of v(this, ie)) + n.includes(r) || (Vt(i.effect), v(this, ie).delete(r)); }); - this.anchor = t, V(this, Xr, n); + this.anchor = e, z(this, Xr, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(t, n) { + ensure(e, n) { var r = ( /** @type {Batch} */ K - ), i = To(); - if (n && !v(this, Lt).has(t) && !v(this, st).has(t)) + ), i = Ro(); + if (n && !v(this, qe).has(e) && !v(this, ie).has(e)) if (i) { - var s = document.createDocumentFragment(), a = ot(); - s.append(a), v(this, st).set(t, { - effect: vt(() => n(a)), + var s = document.createDocumentFragment(), a = ae(); + s.append(a), v(this, ie).set(e, { + effect: ve(() => n(a)), fragment: s }); } else - v(this, Lt).set( - t, - vt(() => n(this.anchor)) + v(this, qe).set( + e, + ve(() => n(this.anchor)) ); - if (v(this, bt).set(r, t), i) { - for (const [o, l] of v(this, Lt)) - o === t ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, st)) - o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + if (v(this, be).set(r, e), i) { + for (const [o, l] of v(this, qe)) + o === e ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, ie)) + o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); r.oncommit(v(this, Wr)), r.ondiscard(v(this, Oi)); } else j && (this.anchor = W), v(this, Wr).call(this); } } -bt = new WeakMap(), Lt = new WeakMap(), st = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Oi = new WeakMap(); -function nf(e) { - lt === null && ou(), Is(() => { - const t = Wi(e); - if (typeof t == "function") return ( +be = new WeakMap(), qe = new WeakMap(), ie = new WeakMap(), Hn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Oi = new WeakMap(); +function rf(t) { + oe === null && lu(), Is(() => { + const e = Wi(t); + if (typeof e == "function") return ( /** @type {() => void} */ - t + e ); }); } -function er(e, t, n = !1) { +function tr(t, e, n = !1) { j && Vi(); - var r = new tf(e), i = n ? hr : 0; + var r = new nf(t), i = n ? hr : 0; function s(a, o) { if (j) { - const f = eo(e); + const f = eo(t); var l; if (f === Ns ? l = 0 : f === Fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { var u = Ei(); - Ve(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); + qt(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); return; } } @@ -2214,27 +2214,27 @@ function er(e, t, n = !1) { } qs(() => { var a = !1; - t((o, l = 0) => { + e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function pi(e, t) { - return t; +function pi(t, e) { + return e; } -function rf(e, t, n) { - for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { - let p = t[o]; - Yn( +function sf(t, e, n) { + for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { + let p = e[o]; + Bn( p, () => { if (s) { if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { var h = ( /** @type {Set} */ - e.outrogroups + t.outrogroups ); - ws(Ii(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null); + ws(Ii(s.done)), h.delete(s), h.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2252,36 +2252,36 @@ function rf(e, t, n) { /** @type {Element} */ u.parentNode ); - Eo(f), f.append(u), e.items.clear(); + To(f), f.append(u), t.items.clear(); } - ws(t, !l); + ws(e, !l); } else s = { - pending: new Set(t), + pending: new Set(e), done: /* @__PURE__ */ new Set() - }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ws(e, t = !0) { - for (var n = 0; n < e.length; n++) - ze(e[n], t); +function ws(t, e = !0) { + for (var n = 0; n < t.length; n++) + Vt(t[n], e); } -var _a; -function vi(e, t, n, r, i, s = null) { - var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; +var ma; +function vi(t, e, n, r, i, s = null) { + var a = t, o = /* @__PURE__ */ new Map(), l = (e & Wa) !== 0; if (l) { var u = ( /** @type {Element} */ - e + t ); - a = j ? Ve(/* @__PURE__ */ fn(u)) : u.appendChild(ot()); + a = j ? qt(/* @__PURE__ */ fn(u)) : u.appendChild(ae()); } j && Vi(); - var f = null, p = /* @__PURE__ */ go(() => { + var f = null, p = /* @__PURE__ */ _o(() => { var $ = n(); - return Ua($) ? $ : $ == null ? [] : Ii($); + return Ga($) ? $ : $ == null ? [] : Ii($); }), h, d = !0; function y() { - m.fallback = f, sf(m, h, a, t, r), f !== null && (h.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Yn(f, () => { + m.fallback = f, af(m, h, a, e, r), f !== null && (h.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Bn(f, () => { f = null; })); } @@ -2292,31 +2292,31 @@ function vi(e, t, n, r, i, s = null) { let D = !1; if (j) { var M = eo(a) === Fi; - M !== ($ === 0) && (a = Ei(), Ve(a), on(!1), D = !0); + M !== ($ === 0) && (a = Ei(), qt(a), on(!1), D = !0); } for (var S = /* @__PURE__ */ new Set(), I = ( /** @type {Batch} */ K - ), L = To(), U = 0; U < $; U += 1) { + ), L = Ro(), U = 0; U < $; U += 1) { j && W.nodeType === wr && /** @type {Comment} */ W.data === ks && (a = /** @type {Comment} */ W, D = !0, on(!1)); - var ae = h[U], Q = r(ae, U), G = d ? null : o.get(Q); - G ? (G.v && vr(G.v, ae), G.i && vr(G.i, U), L && I.unskip_effect(G.e)) : (G = af( + var at = h[U], tt = r(at, U), G = d ? null : o.get(tt); + G ? (G.v && vr(G.v, at), G.i && vr(G.i, U), L && I.unskip_effect(G.e)) : (G = of( o, - d ? a : _a ?? (_a = ot()), - ae, - Q, + d ? a : ma ?? (ma = ae()), + at, + tt, U, i, - t, + e, n - ), d || (G.e.f |= an), o.set(Q, G)), S.add(Q); + ), d || (G.e.f |= an), o.set(tt, G)), S.add(tt); } - if ($ === 0 && s && !f && (d ? f = vt(() => s(a)) : (f = vt(() => s(_a ?? (_a = ot()))), f.f |= an)), $ > S.size && uu(), j && $ > 0 && Ve(Ei()), !d) + if ($ === 0 && s && !f && (d ? f = ve(() => s(a)) : (f = ve(() => s(ma ?? (ma = ae()))), f.f |= an)), $ > S.size && fu(), j && $ > 0 && qt(Ei()), !d) if (L) { - for (const [oe, ue] of o) - S.has(oe) || I.skip_effect(ue.e); + for (const [ot, ut] of o) + S.has(ot) || I.skip_effect(ut.e); I.oncommit(y), I.ondiscard(() => { }); } else @@ -2325,32 +2325,32 @@ function vi(e, t, n, r, i, s = null) { }), m = { effect: b, items: o, outrogroups: null, fallback: f }; d = !1, j && (a = W); } -function Cr(e) { - for (; e !== null && (e.f & Ct) === 0; ) - e = e.next; - return e; +function Rr(t) { + for (; t !== null && (t.f & Re) === 0; ) + t = t.next; + return t; } -function sf(e, t, n, r, i) { - var G, oe, ue, O, F, Ne, ft, me, ye; - var s = (r & Yl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, h = [], d = [], y, b, m, $; +function af(t, e, n, r, i) { + var G, ot, ut, O, F, kt, ue, yt, wt; + var s = (r & Bl) !== 0, a = e.length, o = t.items, l = Rr(t.effect.first), u, f = null, p, h = [], d = [], y, b, m, $; if (s) for ($ = 0; $ < a; $ += 1) - y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & an) === 0 && ((oe = (G = m.nodes) == null ? void 0 : G.a) == null || oe.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + y = e[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, (m.f & an) === 0 && ((ot = (G = m.nodes) == null ? void 0 : G.a) == null || ot.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); for ($ = 0; $ < a; $ += 1) { - if (y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, e.outrogroups !== null) - for (const te of e.outrogroups) - te.pending.delete(m), te.done.delete(m); + if (y = e[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, t.outrogroups !== null) + for (const et of t.outrogroups) + et.pending.delete(m), et.done.delete(m); if ((m.f & an) !== 0) if (m.f ^= an, m === l) Sr(m, null, n); else { var D = f ? f.next : l; - m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(e, f, m), gn(e, m, D), Sr(m, D, n), f = m, h = [], d = [], l = Cr(f.next); + m === t.effect.last && (t.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(t, f, m), gn(t, m, D), Sr(m, D, n), f = m, h = [], d = [], l = Rr(f.next); continue; } - if ((m.f & at) !== 0 && (zs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { + if ((m.f & se) !== 0 && (zs(m), s && ((O = (ut = m.nodes) == null ? void 0 : ut.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { if (u !== void 0 && u.has(m)) { if (h.length < d.length) { var M = d[0], S; @@ -2360,80 +2360,80 @@ function sf(e, t, n, r, i) { Sr(h[S], M, n); for (S = 0; S < d.length; S += 1) u.delete(d[S]); - gn(e, I.prev, L.next), gn(e, f, I), gn(e, L, M), l = M, f = L, $ -= 1, h = [], d = []; + gn(t, I.prev, L.next), gn(t, f, I), gn(t, L, M), l = M, f = L, $ -= 1, h = [], d = []; } else - u.delete(m), Sr(m, l, n), gn(e, m.prev, m.next), gn(e, m, f === null ? e.effect.first : f.next), gn(e, f, m), f = m; + u.delete(m), Sr(m, l, n), gn(t, m.prev, m.next), gn(t, m, f === null ? t.effect.first : f.next), gn(t, f, m), f = m; continue; } for (h = [], d = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); + (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Rr(l.next); if (l === null) continue; } - (m.f & an) === 0 && h.push(m), f = m, l = Cr(m.next); + (m.f & an) === 0 && h.push(m), f = m, l = Rr(m.next); } - if (e.outrogroups !== null) { - for (const te of e.outrogroups) - te.pending.size === 0 && (ws(Ii(te.done)), (F = e.outrogroups) == null || F.delete(te)); - e.outrogroups.size === 0 && (e.outrogroups = null); + if (t.outrogroups !== null) { + for (const et of t.outrogroups) + et.pending.size === 0 && (ws(Ii(et.done)), (F = t.outrogroups) == null || F.delete(et)); + t.outrogroups.size === 0 && (t.outrogroups = null); } if (l !== null || u !== void 0) { var U = []; if (u !== void 0) for (m of u) - (m.f & at) === 0 && U.push(m); + (m.f & se) === 0 && U.push(m); for (; l !== null; ) - (l.f & at) === 0 && l !== e.fallback && U.push(l), l = Cr(l.next); - var ae = U.length; - if (ae > 0) { - var Q = (r & Xa) !== 0 && a === 0 ? n : null; + (l.f & se) === 0 && l !== t.fallback && U.push(l), l = Rr(l.next); + var at = U.length; + if (at > 0) { + var tt = (r & Wa) !== 0 && a === 0 ? n : null; if (s) { - for ($ = 0; $ < ae; $ += 1) - (ft = (Ne = U[$].nodes) == null ? void 0 : Ne.a) == null || ft.measure(); - for ($ = 0; $ < ae; $ += 1) - (ye = (me = U[$].nodes) == null ? void 0 : me.a) == null || ye.fix(); + for ($ = 0; $ < at; $ += 1) + (ue = (kt = U[$].nodes) == null ? void 0 : kt.a) == null || ue.measure(); + for ($ = 0; $ < at; $ += 1) + (wt = (yt = U[$].nodes) == null ? void 0 : yt.a) == null || wt.fix(); } - rf(e, U, Q); + sf(t, U, tt); } } s && xn(() => { - var te, ke; + var et, Mt; if (p !== void 0) for (m of p) - (ke = (te = m.nodes) == null ? void 0 : te.a) == null || ke.apply(); + (Mt = (et = m.nodes) == null ? void 0 : et.a) == null || Mt.apply(); }); } -function af(e, t, n, r, i, s, a, o) { - var l = (a & zl) !== 0 ? (a & Bl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & Hl) !== 0 ? Un(i) : null; +function of(t, e, n, r, i, s, a, o) { + var l = (a & Hl) !== 0 ? (a & Xl) === 0 ? /* @__PURE__ */ xo(n, !1, !1) : Gn(n) : null, u = (a & Yl) !== 0 ? Gn(i) : null; return { v: l, i: u, - e: vt(() => (s(t, l ?? n, u ?? i, o), () => { - e.delete(r); + e: ve(() => (s(e, l ?? n, u ?? i, o), () => { + t.delete(r); })) }; } -function Sr(e, t, n) { - if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & an) === 0 ? ( +function Sr(t, e, n) { + if (t.nodes) + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & an) === 0 ? ( /** @type {EffectNodes} */ - t.nodes.start + e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Yt(r) + /* @__PURE__ */ Be(r) ); if (s.before(r), r === i) return; r = a; } } -function gn(e, t, n) { - t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; +function gn(t, e, n) { + e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function Hs(e, t) { - So(() => { - var n = e.getRootNode(), r = ( +function Hs(t, e) { + No(() => { + var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Hs(e, t) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + t.hash)) { + if (!r.querySelector("#" + e.hash)) { const i = Os("style"); - i.id = t.hash, i.textContent = t.code, r.appendChild(i); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -const ma = [...` +const ya = [...` \r\f \v\uFEFF`]; -function of(e, t, n) { - var r = e == null ? "" : "" + e; +function lf(t, e, n) { + var r = t == null ? "" : "" + t; if (n) { for (var i in n) if (n[i]) @@ -2461,109 +2461,109 @@ function of(e, t, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || ma.includes(r[a - 1])) && (o === r.length || ma.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (a === 0 || ya.includes(r[a - 1])) && (o === r.length || ya.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; } -function ya(e, t = !1) { - var n = t ? " !important;" : ";", r = ""; - for (var i in e) { - var s = e[i]; +function wa(t, e = !1) { + var n = e ? " !important;" : ";", r = ""; + for (var i in t) { + var s = t[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function lf(e, t) { - if (t) { +function uf(t, e) { + if (e) { var n = "", r, i; - return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += wa(r)), i && (n += wa(i, !0)), n = n.trim(), n === "" ? null : n; } - return String(e); + return String(t); } -function si(e, t, n, r, i, s) { - var a = e.__className; +function si(t, e, n, r, i, s) { + var a = t.__className; if (j || a !== n || a === void 0) { - var o = of(n, r, s); - (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; + var o = lf(n, r, s); + (!j || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; } else if (s && i !== s) for (var l in s) { var u = !!s[l]; - (i == null || u !== !!i[l]) && e.classList.toggle(l, u); + (i == null || u !== !!i[l]) && t.classList.toggle(l, u); } return s; } -function ns(e, t = {}, n, r) { +function ns(t, e = {}, n, r) { for (var i in n) { var s = n[i]; - t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); + e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function wa(e, t, n, r) { - var i = e.__style; - if (j || i !== t) { - var s = lf(t, r); - (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; - } else r && (Array.isArray(r) ? (ns(e, n == null ? void 0 : n[0], r[0]), ns(e, n == null ? void 0 : n[1], r[1], "important")) : ns(e, n, r)); +function xa(t, e, n, r) { + var i = t.__style; + if (j || i !== e) { + var s = uf(e, r); + (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (ns(t, n == null ? void 0 : n[0], r[0]), ns(t, n == null ? void 0 : n[1], r[1], "important")) : ns(t, n, r)); return r; } -const uf = Symbol("is custom element"), ff = Symbol("is html"), cf = au ? "link" : "LINK"; -function xa(e, t, n, r) { - var i = hf(e); - j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === cf) || i[t] !== (i[t] = n) && (t === "loading" && (e[su] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && df(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +const ff = Symbol("is custom element"), cf = Symbol("is html"), hf = ou ? "link" : "LINK"; +function ba(t, e, n, r) { + var i = df(t); + j && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === hf) || i[e] !== (i[e] = n) && (e === "loading" && (t[au] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && pf(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); } -function hf(e) { +function df(t) { return ( /** @type {Record} **/ // @ts-expect-error - e.__attributes ?? (e.__attributes = { - [uf]: e.nodeName.includes("-"), - [ff]: e.namespaceURI === Wa + t.__attributes ?? (t.__attributes = { + [ff]: t.nodeName.includes("-"), + [cf]: t.namespaceURI === Ua }) ); } -var ba = /* @__PURE__ */ new Map(); -function df(e) { - var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); +var $a = /* @__PURE__ */ new Map(); +function pf(t) { + var e = t.getAttribute("is") || t.nodeName, n = $a.get(e); if (n) return n; - ba.set(t, n = []); - for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Zl(i); + $a.set(e, n = []); + for (var r, i = t, s = Element.prototype; s !== i; ) { + r = Ql(i); for (var a in r) r[a].set && n.push(a); - i = Ga(i); + i = Ka(i); } return n; } -function $a(e, t) { - return e === t || (e == null ? void 0 : e[Pr]) === t; +function Aa(t, e) { + return t === e || (t == null ? void 0 : t[Pr]) === e; } -function gi(e = {}, t, n, r) { - return So(() => { +function gi(t = {}, e, n, r) { + return No(() => { var i, s; return Ls(() => { i = s, s = [], Wi(() => { - e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); + t !== n(...s) && (e(t, ...s), i && Aa(n(...i), t) && e(null, ...i)); }); }), () => { xn(() => { - s && $a(n(...s), e) && t(null, ...s); + s && Aa(n(...s), t) && e(null, ...s); }); }; - }), e; + }), t; } let ai = !1; -function pf(e) { - var t = ai; +function vf(t) { + var e = ai; try { - return ai = !1, [e(), ai]; + return ai = !1, [t(), ai]; } finally { - ai = t; + ai = e; } } -function se(e, t, n, r) { +function st(t, e, n, r) { var D; - var i = (n & Ul) !== 0, s = (n & Gl) !== 0, a = ( + var i = (n & Gl) !== 0, s = (n & Kl) !== 0, a = ( /** @type {V} */ r ), o = !0, l = () => (o && (o = !1, a = s ? Wi( @@ -2574,26 +2574,26 @@ function se(e, t, n, r) { r )), a), u; if (i) { - var f = Pr in e || Qa in e; - u = ((D = Hn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); + var f = Pr in t || to in t; + u = ((D = Yn(t, e)) == null ? void 0 : D.set) ?? (f && e in t ? (M) => t[e] = M : void 0); } var p, h = !1; - i ? [p, h] = pf(() => ( + i ? [p, h] = vf(() => ( /** @type {V} */ - e[t] + t[e] )) : p = /** @type {V} */ - e[t], p === void 0 && r !== void 0 && (p = l(), u && (vu(), u(p))); + t[e], p === void 0 && r !== void 0 && (p = l(), u && (gu(), u(p))); var d; if (d = () => { var M = ( /** @type {V} */ - e[t] + t[e] ); return M === void 0 ? l() : (o = !0, M); - }, (n & Wl) === 0) + }, (n & Ul) === 0) return d; if (u) { - var y = e.$$legacy; + var y = t.$$legacy; return ( /** @type {() => V} */ (function(M, S) { @@ -2601,7 +2601,7 @@ function se(e, t, n, r) { }) ); } - var b = !1, m = ((n & Xl) !== 0 ? Bi : go)(() => (b = !1, d())); + var b = !1, m = ((n & Wl) !== 0 ? Bi : _o)(() => (b = !1, d())); i && x(m); var $ = ( /** @type {Effect} */ @@ -2611,149 +2611,149 @@ function se(e, t, n, r) { /** @type {() => V} */ (function(M, S) { if (arguments.length > 0) { - const I = S ? x(m) : i ? Pn(M) : M; - return he(m, I), b = !0, a !== void 0 && (a = I), M; + const I = S ? x(m) : i ? Dn(M) : M; + return pt(m, I), b = !0, a !== void 0 && (a = I), M; } return An && b || ($.f & ln) !== 0 ? m.v : x(m); }) ); } -function vf(e) { - return new gf(e); +function gf(t) { + return new _f(t); } -var sn, pt; -class gf { +var sn, pe; +class _f { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(t) { + constructor(e) { /** @type {any} */ - H(this, sn); + B(this, sn); /** @type {Record} */ - H(this, pt); + B(this, pe); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ wo(o, !1, !1); + var l = /* @__PURE__ */ xo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...t.props || {}, $$events: {} }, + { ...e.props || {}, $$events: {} }, { get(a, o) { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === to ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return he(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return pt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - V(this, pt, (t.hydrate ? Qu : Bo)(t.component, { - target: t.target, - anchor: t.anchor, + z(this, pe, (e.hydrate ? tf : Xo)(e.component, { + target: e.target, + anchor: e.anchor, props: i, - context: t.context, - intro: t.intro ?? !1, - recover: t.recover - })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && re(), V(this, sn, i.$$events); - for (const a of Object.keys(v(this, pt))) + context: e.context, + intro: e.intro ?? !1, + recover: e.recover + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && rt(), z(this, sn, i.$$events); + for (const a of Object.keys(v(this, pe))) a === "$set" || a === "$destroy" || a === "$on" || Ai(this, a, { get() { - return v(this, pt)[a]; + return v(this, pe)[a]; }, /** @param {any} value */ set(o) { - v(this, pt)[a] = o; + v(this, pe)[a] = o; }, enumerable: !0 }); - v(this, pt).$set = /** @param {Record} next */ + v(this, pe).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, pt).$destroy = () => { - ef(v(this, pt)); + }, v(this, pe).$destroy = () => { + ef(v(this, pe)); }; } /** @param {Record} props */ - $set(t) { - v(this, pt).$set(t); + $set(e) { + v(this, pe).$set(e); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(t, n) { - v(this, sn)[t] = v(this, sn)[t] || []; + $on(e, n) { + v(this, sn)[e] = v(this, sn)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, sn)[t].push(r), () => { - v(this, sn)[t] = v(this, sn)[t].filter( + return v(this, sn)[e].push(r), () => { + v(this, sn)[e] = v(this, sn)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, pt).$destroy(); + v(this, pe).$destroy(); } } -sn = new WeakMap(), pt = new WeakMap(); -let Wo; -typeof HTMLElement == "function" && (Wo = class extends HTMLElement { +sn = new WeakMap(), pe = new WeakMap(); +let Uo; +typeof HTMLElement == "function" && (Uo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(t, n, r) { + constructor(e, n, r) { super(); /** The Svelte component constructor */ - ce(this, "$$ctor"); + dt(this, "$$ctor"); /** Slots */ - ce(this, "$$s"); + dt(this, "$$s"); /** @type {any} The Svelte component instance */ - ce(this, "$$c"); + dt(this, "$$c"); /** Whether or not the custom element is connected */ - ce(this, "$$cn", !1); + dt(this, "$$cn", !1); /** @type {Record} Component props data */ - ce(this, "$$d", {}); + dt(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ce(this, "$$r", !1); + dt(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ce(this, "$$p_d", {}); + dt(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ce(this, "$$l", {}); + dt(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ce(this, "$$l_u", /* @__PURE__ */ new Map()); + dt(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ce(this, "$$me"); + dt(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ce(this, "$$shadowRoot", null); - this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + dt(this, "$$shadowRoot", null); + this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(t, n, r) { - if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { - const i = this.$$c.$on(t, n); + addEventListener(e, n, r) { + if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { + const i = this.$$c.$on(e, n); this.$$l_u.set(n, i); } - super.addEventListener(t, n, r); + super.addEventListener(e, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(t, n, r) { - if (super.removeEventListener(t, n, r), this.$$c) { + removeEventListener(e, n, r) { + if (super.removeEventListener(e, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2763,13 +2763,13 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { let n = function(s) { return (a) => { const o = Os("slot"); - s !== "default" && (o.name = s), Ue(a, o); + s !== "default" && (o.name = s), Ut(a, o); }; }; - var t = n; + var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = _f(this); + const r = {}, i = mf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { @@ -2778,7 +2778,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = vf({ + this.$$c = gf({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,7 +2786,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = Vu(() => { + }), this.$$me = zu(() => { Ls(() => { var s; this.$$r = !0; @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(t, n, r) { + attributeChangedCallback(e, n, r) { var i; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = _i(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = _i(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,74 +2831,74 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(t) { + $$g_p(e) { return $i(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t - ) || t; + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; } }); -function _i(e, t, n, r) { +function _i(t, e, n, r) { var s; - const i = (s = n[e]) == null ? void 0 : s.type; - if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) - return t; + const i = (s = n[t]) == null ? void 0 : s.type; + if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) + return e; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return t == null ? null : JSON.stringify(t); + return e == null ? null : JSON.stringify(e); case "Boolean": - return t ? "" : null; + return e ? "" : null; case "Number": - return t ?? null; + return e ?? null; default: - return t; + return e; } else switch (i) { case "Object": case "Array": - return t && JSON.parse(t); + return e && JSON.parse(e); case "Boolean": - return t; + return e; // conversion already handled above case "Number": - return t != null ? +t : t; + return e != null ? +e : e; default: - return t; + return e; } } -function _f(e) { - const t = {}; - return e.childNodes.forEach((n) => { - t[ +function mf(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), t; + }), e; } -function Ys(e, t, n, r, i, s) { - let a = class extends Wo { +function Ys(t, e, n, r, i, s) { + let a = class extends Uo { constructor() { - super(e, n, i), this.$$p_d = t; + super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return $i(t).map( - (o) => (t[o].attribute || o).toLowerCase() + return $i(e).map( + (o) => (e[o].attribute || o).toLowerCase() ); } }; - return $i(t).forEach((o) => { + return $i(e).forEach((o) => { Ai(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var p; - l = _i(o, l, t), this.$$d[o] = l; + l = _i(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (p = Hn(u, o)) == null ? void 0 : p.get; + var f = (p = Yn(u, o)) == null ? void 0 : p.get; f ? u[o] = l : u.$set({ [o]: l }); } } @@ -2910,558 +2910,558 @@ function Ys(e, t, n, r, i, s) { return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), e.element = /** @type {any} */ + }), t.element = /** @type {any} */ a, a; } -var mf = { value: () => { +var yf = { value: () => { } }; -function Uo() { - for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { - if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); +function Go() { + 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 mi(n); } -function mi(e) { - this._ = e; +function mi(t) { + this._ = t; } -function yf(e, t) { - return e.trim().split(/^|\s+/).map(function(n) { +function wf(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 && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); + 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 }; }); } -mi.prototype = Uo.prototype = { +mi.prototype = Go.prototype = { constructor: mi, - on: function(e, t) { - var n = this._, r = yf(e + "", n), i, s = -1, a = r.length; + on: function(t, e) { + var n = this._, r = wf(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = wf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = xf(n[i], t.name))) return i; return; } - if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); + if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (e = r[s]).type) n[i] = Aa(n[i], e.name, t); - else if (t == null) for (i in n) n[i] = Aa(n[i], e.name, null); + if (i = (t = r[s]).type) n[i] = Ea(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = Ea(n[i], t.name, null); return this; }, copy: function() { - var e = {}, t = this._; - for (var n in t) e[n] = t[n].slice(); - return new mi(e); + var t = {}, e = this._; + for (var n in e) t[n] = e[n].slice(); + return new mi(t); }, - call: function(e, t) { + call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); }, - apply: function(e, t, n) { - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); + apply: function(t, e, n) { + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function wf(e, t) { - for (var n = 0, r = e.length, i; n < r; ++n) - if ((i = e[n]).name === t) +function xf(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) return i.value; } -function Aa(e, t, n) { - for (var r = 0, i = e.length; r < i; ++r) - if (e[r].name === t) { - e[r] = mf, e = e.slice(0, r).concat(e.slice(r + 1)); +function Ea(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = yf, t = t.slice(0, r).concat(t.slice(r + 1)); break; } - return n != null && e.push({ name: t, value: n }), e; + return n != null && t.push({ name: e, value: n }), t; } var xs = "http://www.w3.org/1999/xhtml"; -const Ea = { +const Ta = { svg: "http://www.w3.org/2000/svg", xhtml: xs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Ui(e) { - var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ea.hasOwnProperty(t) ? { space: Ea[t], local: e } : e; +function Ui(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ta.hasOwnProperty(e) ? { space: Ta[e], local: t } : t; } -function xf(e) { +function bf(t) { return function() { - var t = this.ownerDocument, n = this.namespaceURI; - return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); + var e = this.ownerDocument, n = this.namespaceURI; + return n === xs && e.documentElement.namespaceURI === xs ? e.createElement(t) : e.createElementNS(n, t); }; } -function bf(e) { +function $f(t) { return function() { - return this.ownerDocument.createElementNS(e.space, e.local); + return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Go(e) { - var t = Ui(e); - return (t.local ? bf : xf)(t); +function Ko(t) { + var e = Ui(t); + return (e.local ? $f : bf)(e); } -function $f() { +function Af() { } -function Bs(e) { - return e == null ? $f : function() { - return this.querySelector(e); +function Bs(t) { + return t == null ? Af : function() { + return this.querySelector(t); }; } -function Af(e) { - typeof e != "function" && (e = Bs(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ut(r, this._parents); +function Ef(t) { + typeof t != "function" && (t = Bs(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new le(r, this._parents); } -function Ef(e) { - return e == null ? [] : Array.isArray(e) ? e : Array.from(e); +function Tf(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Tf() { +function Rf() { return []; } -function Ko(e) { - return e == null ? Tf : function() { - return this.querySelectorAll(e); +function jo(t) { + return t == null ? Rf : function() { + return this.querySelectorAll(t); }; } -function Cf(e) { +function Cf(t) { return function() { - return Ef(e.apply(this, arguments)); + return Tf(t.apply(this, arguments)); }; } -function Rf(e) { - typeof e == "function" ? e = Cf(e) : e = Ko(e); - for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); - return new ut(r, i); +function Sf(t) { + typeof t == "function" ? t = Cf(t) : t = jo(t); + for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); + return new le(r, i); } -function jo(e) { +function Jo(t) { return function() { - return this.matches(e); + return this.matches(t); }; } -function Jo(e) { - return function(t) { - return t.matches(e); +function Zo(t) { + return function(e) { + return e.matches(t); }; } -var Sf = Array.prototype.find; -function Nf(e) { +var Nf = Array.prototype.find; +function kf(t) { return function() { - return Sf.call(this.children, e); + return Nf.call(this.children, t); }; } -function kf() { +function Mf() { return this.firstElementChild; } -function Mf(e) { - return this.select(e == null ? kf : Nf(typeof e == "function" ? e : Jo(e))); +function Pf(t) { + return this.select(t == null ? Mf : kf(typeof t == "function" ? t : Zo(t))); } -var Pf = Array.prototype.filter; -function Df() { +var Df = Array.prototype.filter; +function Of() { return Array.from(this.children); } -function Of(e) { +function Ff(t) { return function() { - return Pf.call(this.children, e); + return Df.call(this.children, t); }; } -function Ff(e) { - return this.selectAll(e == null ? Df : Of(typeof e == "function" ? e : Jo(e))); +function If(t) { + return this.selectAll(t == null ? Of : Ff(typeof t == "function" ? t : Zo(t))); } -function If(e) { - typeof e != "function" && (e = jo(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); - return new ut(r, this._parents); +function Lf(t) { + typeof t != "function" && (t = Jo(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); + return new le(r, this._parents); } -function Zo(e) { - return new Array(e.length); +function Qo(t) { + return new Array(t.length); } -function Lf() { - return new ut(this._enter || this._groups.map(Zo), this._parents); +function qf() { + return new le(this._enter || this._groups.map(Qo), this._parents); } -function Ti(e, t) { - this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; +function Ti(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ti.prototype = { constructor: Ti, - appendChild: function(e) { - return this._parent.insertBefore(e, this._next); + appendChild: function(t) { + return this._parent.insertBefore(t, this._next); }, - insertBefore: function(e, t) { - return this._parent.insertBefore(e, t); + insertBefore: function(t, e) { + return this._parent.insertBefore(t, e); }, - querySelector: function(e) { - return this._parent.querySelector(e); + querySelector: function(t) { + return this._parent.querySelector(t); }, - querySelectorAll: function(e) { - return this._parent.querySelectorAll(e); + querySelectorAll: function(t) { + return this._parent.querySelectorAll(t); } }; -function qf(e) { +function Vf(t) { return function() { - return e; + return t; }; } -function Vf(e, t, n, r, i, s) { - for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) - (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ti(e, s[a]); +function zf(t, e, n, r, i, s) { + for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ti(t, s[a]); for (; a < l; ++a) - (o = t[a]) && (i[a] = o); + (o = e[a]) && (i[a] = o); } -function zf(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, h = new Array(f), d; +function Hf(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, p = s.length, h = new Array(f), d; for (o = 0; o < f; ++o) - (l = t[o]) && (h[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); + (l = e[o]) && (h[o] = d = a.call(l, l.__data__, o, e) + "", u.has(d) ? i[o] = l : u.set(d, l)); for (o = 0; o < p; ++o) - d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ti(e, s[o]); + d = a.call(t, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ti(t, s[o]); for (o = 0; o < f; ++o) - (l = t[o]) && u.get(h[o]) === l && (i[o] = l); + (l = e[o]) && u.get(h[o]) === l && (i[o] = l); } -function Hf(e) { - return e.__data__; +function Yf(t) { + return t.__data__; } -function Yf(e, t) { - if (!arguments.length) return Array.from(this, Hf); - var n = t ? zf : Vf, r = this._parents, i = this._groups; - typeof e != "function" && (e = qf(e)); +function Bf(t, e) { + if (!arguments.length) return Array.from(this, Yf); + var n = e ? Hf : zf, r = this._parents, i = this._groups; + typeof t != "function" && (t = Vf(t)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], p = i[u], h = p.length, d = Bf(e.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(h); - n(f, p, b, m, $, d, t); + var f = r[u], p = i[u], h = p.length, d = Xf(t.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(h); + n(f, p, b, m, $, d, e); for (var D = 0, M = 0, S, I; D < y; ++D) if (S = b[D]) { for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; S._next = I || null; } } - return a = new ut(a, r), a._enter = o, a._exit = l, a; + return a = new le(a, r), a._enter = o, a._exit = l, a; } -function Bf(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Xf(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Xf() { - return new ut(this._exit || this._groups.map(Zo), this._parents); +function Wf() { + return new le(this._exit || this._groups.map(Qo), this._parents); } -function Wf(e, t, n) { +function Uf(t, e, n) { var r = this.enter(), i = this, s = this.exit(); - return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; + 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 ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Uf(e) { - for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) +function Gf(t) { + for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) for (var u = n[l], f = r[l], p = u.length, h = o[l] = new Array(p), d, y = 0; y < p; ++y) (d = u[y] || f[y]) && (h[y] = d); for (; l < i; ++l) o[l] = n[l]; - return new ut(o, this._parents); + return new le(o, this._parents); } -function Gf() { - for (var e = this._groups, t = -1, n = e.length; ++t < n; ) - for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) +function Kf() { + for (var t = this._groups, e = -1, n = t.length; ++e < n; ) + for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function Kf(e) { - e || (e = jf); - function t(p, h) { - return p && h ? e(p.__data__, h.__data__) : !p - !h; +function jf(t) { + t || (t = Jf); + function e(p, h) { + return p && h ? t(p.__data__, h.__data__) : !p - !h; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); - l.sort(t); + l.sort(e); } - return new ut(i, this._parents).order(); + return new le(i, this._parents).order(); } -function jf(e, t) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; -} -function Jf() { - var e = arguments[0]; - return arguments[0] = this, e.apply(null, arguments), this; +function Jf(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function Zf() { - return Array.from(this); + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; } function Qf() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], i = 0, s = r.length; i < s; ++i) { + return Array.from(this); +} +function tc() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; if (a) return a; } return null; } function ec() { - let e = 0; - for (const t of this) ++e; - return e; + let t = 0; + for (const e of this) ++t; + return t; } -function tc() { +function nc() { return !this.node(); } -function nc(e) { - for (var t = this._groups, n = 0, r = t.length; n < r; ++n) - for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && e.call(o, o.__data__, s, i); +function rc(t) { + for (var e = this._groups, n = 0, r = e.length; n < r; ++n) + for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function rc(e) { +function ic(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function ic(e) { +function sc(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function sc(e, t) { +function ac(t, e) { return function() { - this.setAttribute(e, t); + this.setAttribute(t, e); }; } -function ac(e, t) { +function oc(t, e) { return function() { - this.setAttributeNS(e.space, e.local, t); + this.setAttributeNS(t.space, t.local, e); }; } -function oc(e, t) { +function lc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttribute(e) : this.setAttribute(e, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function lc(e, t) { +function uc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function uc(e, t) { - var n = Ui(e); +function fc(t, e) { + var n = Ui(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((t == null ? n.local ? ic : rc : typeof t == "function" ? n.local ? lc : oc : n.local ? ac : sc)(n, t)); + return this.each((e == null ? n.local ? sc : ic : typeof e == "function" ? n.local ? uc : lc : n.local ? oc : ac)(n, e)); } -function Qo(e) { - return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; +function tl(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function fc(e) { +function cc(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function cc(e, t, n) { +function hc(t, e, n) { return function() { - this.style.setProperty(e, t, n); + this.style.setProperty(t, e, n); }; } -function hc(e, t, n) { +function dc(t, e, n) { return function() { - var r = t.apply(this, arguments); - r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function dc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? fc : typeof t == "function" ? hc : cc)(e, t, n ?? "")) : _r(this.node(), e); +function pc(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? cc : typeof e == "function" ? dc : hc)(t, e, n ?? "")) : _r(this.node(), t); } -function _r(e, t) { - return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); +function _r(t, e) { + return t.style.getPropertyValue(e) || tl(t).getComputedStyle(t, null).getPropertyValue(e); } -function pc(e) { +function vc(t) { return function() { - delete this[e]; + delete this[t]; }; } -function vc(e, t) { +function gc(t, e) { return function() { - this[e] = t; + this[t] = e; }; } -function gc(e, t) { +function _c(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? delete this[e] : this[e] = n; + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; }; } -function _c(e, t) { - return arguments.length > 1 ? this.each((t == null ? pc : typeof t == "function" ? gc : vc)(e, t)) : this.node()[e]; +function mc(t, e) { + return arguments.length > 1 ? this.each((e == null ? vc : typeof e == "function" ? _c : gc)(t, e)) : this.node()[t]; } -function el(e) { - return e.trim().split(/^|\s+/); +function el(t) { + return t.trim().split(/^|\s+/); } -function Xs(e) { - return e.classList || new tl(e); +function Xs(t) { + return t.classList || new nl(t); } -function tl(e) { - this._node = e, this._names = el(e.getAttribute("class") || ""); +function nl(t) { + this._node = t, this._names = el(t.getAttribute("class") || ""); } -tl.prototype = { - add: function(e) { - var t = this._names.indexOf(e); - t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); +nl.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(e) { - var t = this._names.indexOf(e); - t >= 0 && (this._names.splice(t, 1), 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(e) { - return this._names.indexOf(e) >= 0; + contains: function(t) { + return this._names.indexOf(t) >= 0; } }; -function nl(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); +function rl(t, e) { + for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function rl(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); +function il(t, e) { + for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function mc(e) { +function yc(t) { return function() { - nl(this, e); + rl(this, t); }; } -function yc(e) { +function wc(t) { return function() { - rl(this, e); + il(this, t); }; } -function wc(e, t) { +function xc(t, e) { return function() { - (t.apply(this, arguments) ? nl : rl)(this, e); + (e.apply(this, arguments) ? rl : il)(this, t); }; } -function xc(e, t) { - var n = el(e + ""); +function bc(t, e) { + var n = el(t + ""); if (arguments.length < 2) { for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof t == "function" ? wc : t ? mc : yc)(n, t)); + return this.each((typeof e == "function" ? xc : e ? yc : wc)(n, e)); } -function bc() { +function $c() { this.textContent = ""; } -function $c(e) { +function Ac(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function Ac(e) { +function Ec(t) { return function() { - var t = e.apply(this, arguments); - this.textContent = t ?? ""; + var e = t.apply(this, arguments); + this.textContent = e ?? ""; }; } -function Ec(e) { - return arguments.length ? this.each(e == null ? bc : (typeof e == "function" ? Ac : $c)(e)) : this.node().textContent; +function Tc(t) { + return arguments.length ? this.each(t == null ? $c : (typeof t == "function" ? Ec : Ac)(t)) : this.node().textContent; } -function Tc() { +function Rc() { this.innerHTML = ""; } -function Cc(e) { +function Cc(t) { return function() { - this.innerHTML = e; + this.innerHTML = t; }; } -function Rc(e) { +function Sc(t) { return function() { - var t = e.apply(this, arguments); - this.innerHTML = t ?? ""; + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; }; } -function Sc(e) { - return arguments.length ? this.each(e == null ? Tc : (typeof e == "function" ? Rc : Cc)(e)) : this.node().innerHTML; -} -function Nc() { - this.nextSibling && this.parentNode.appendChild(this); +function Nc(t) { + return arguments.length ? this.each(t == null ? Rc : (typeof t == "function" ? Sc : Cc)(t)) : this.node().innerHTML; } function kc() { - return this.each(Nc); + this.nextSibling && this.parentNode.appendChild(this); } function Mc() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); + return this.each(kc); } function Pc() { - return this.each(Mc); + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Dc(e) { - var t = typeof e == "function" ? e : Go(e); +function Dc() { + return this.each(Pc); +} +function Oc(t) { + var e = typeof t == "function" ? t : Ko(t); return this.select(function() { - return this.appendChild(t.apply(this, arguments)); + return this.appendChild(e.apply(this, arguments)); }); } -function Oc() { +function Fc() { return null; } -function Fc(e, t) { - var n = typeof e == "function" ? e : Go(e), r = t == null ? Oc : typeof t == "function" ? t : Bs(t); +function Ic(t, e) { + var n = typeof t == "function" ? t : Ko(t), r = e == null ? Fc : typeof e == "function" ? e : Bs(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Ic() { - var e = this.parentNode; - e && e.removeChild(this); -} function Lc() { - return this.each(Ic); + var t = this.parentNode; + t && t.removeChild(this); } function qc() { - var e = this.cloneNode(!1), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; + return this.each(Lc); } function Vc() { - var e = this.cloneNode(!0), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } -function zc(e) { - return this.select(e ? Vc : qc); +function zc() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } -function Hc(e) { - return arguments.length ? this.property("__data__", e) : this.node().__data__; +function Hc(t) { + return this.select(t ? zc : Vc); } -function Yc(e) { - return function(t) { - e.call(this, t, this.__data__); +function Yc(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function Bc(t) { + return function(e) { + t.call(this, e, this.__data__); }; } -function Bc(e) { - return e.trim().split(/^|\s+/).map(function(t) { - var n = "", r = t.indexOf("."); - return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; +function Xc(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 Xc(e) { +function Wc(t) { return function() { - var t = this.__on; - if (t) { - for (var n = 0, r = -1, i = t.length, s; n < i; ++n) - s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; - ++r ? t.length = r : delete this.__on; + var e = this.__on; + if (e) { + for (var n = 0, r = -1, i = e.length, s; n < i; ++n) + s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; + ++r ? e.length = r : delete this.__on; } }; } -function Wc(e, t, n) { +function Uc(t, e, n) { return function() { - var r = this.__on, i, s = Yc(t); + var r = this.__on, i, s = Bc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === e.type && i.name === e.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; + if ((i = r[a]).type === t.type && i.name === t.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; return; } } - this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Uc(e, t, n) { - var r = Bc(e + ""), i, s = r.length, a; +function Gc(t, e, n) { + var r = Xc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Uc(e, t, n) { } return; } - for (o = t ? Wc : Xc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = e ? Uc : Wc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function il(e, t, n) { - var r = Qo(e), i = r.CustomEvent; - typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); +function sl(t, e, n) { + var r = tl(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 Gc(e, t) { +function Kc(t, e) { return function() { - return il(this, e, t); + return sl(this, t, e); }; } -function Kc(e, t) { +function jc(t, e) { return function() { - return il(this, e, t.apply(this, arguments)); + return sl(this, t, e.apply(this, arguments)); }; } -function jc(e, t) { - return this.each((typeof t == "function" ? Kc : Gc)(e, t)); +function Jc(t, e) { + return this.each((typeof e == "function" ? jc : Kc)(t, e)); } -function* Jc() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) +function* Zc() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var sl = [null]; -function ut(e, t) { - this._groups = e, this._parents = t; +var al = [null]; +function le(t, e) { + this._groups = t, this._parents = e; } function xr() { - return new ut([[document.documentElement]], sl); + return new le([[document.documentElement]], al); } -function Zc() { +function Qc() { return this; } -ut.prototype = xr.prototype = { - constructor: ut, - select: Af, - selectAll: Rf, - selectChild: Mf, - selectChildren: Ff, - filter: If, - data: Yf, - enter: Lf, - exit: Xf, - join: Wf, - merge: Uf, - selection: Zc, - order: Gf, - sort: Kf, - call: Jf, - nodes: Zf, - node: Qf, +le.prototype = xr.prototype = { + constructor: le, + select: Ef, + selectAll: Sf, + selectChild: Pf, + selectChildren: If, + filter: Lf, + data: Bf, + enter: qf, + exit: Wf, + join: Uf, + merge: Gf, + selection: Qc, + order: Kf, + sort: jf, + call: Zf, + nodes: Qf, + node: tc, size: ec, - empty: tc, - each: nc, - attr: uc, - style: dc, - property: _c, - classed: xc, - text: Ec, - html: Sc, - raise: kc, - lower: Pc, - append: Dc, - insert: Fc, - remove: Lc, - clone: zc, - datum: Hc, - on: Uc, - dispatch: jc, - [Symbol.iterator]: Jc + empty: nc, + each: rc, + attr: fc, + style: pc, + property: mc, + classed: bc, + text: Tc, + html: Nc, + raise: Mc, + lower: Dc, + append: Oc, + insert: Ic, + remove: qc, + clone: Hc, + datum: Yc, + on: Gc, + dispatch: Jc, + [Symbol.iterator]: Zc }; -function fe(e) { - return typeof e == "string" ? new ut([[document.querySelector(e)]], [document.documentElement]) : new ut([[e]], sl); +function ct(t) { + return typeof t == "string" ? new le([[document.querySelector(t)]], [document.documentElement]) : new le([[t]], al); } -function Ws(e, t, n) { - e.prototype = t.prototype = n, n.constructor = e; +function Ws(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; } -function al(e, t) { - var n = Object.create(e.prototype); - for (var r in t) n[r] = t[r]; +function ol(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; return n; } function Kr() { } -var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Vt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Qc = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), th = new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`), nh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), rh = new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${qr}\\)$`), ih = new RegExp(`^hsl\\(${qr},${Vt},${Vt}\\)$`), sh = new RegExp(`^hsla\\(${qr},${Vt},${Vt},${qr}\\)$`), Ta = { +var Lr = 0.7, Ri = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", th = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), nh = new RegExp(`^rgb\\(${ze},${ze},${ze}\\)$`), rh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), ih = new RegExp(`^rgba\\(${ze},${ze},${ze},${qr}\\)$`), sh = new RegExp(`^hsl\\(${qr},${ze},${ze}\\)$`), ah = new RegExp(`^hsla\\(${qr},${ze},${ze},${qr}\\)$`), Ra = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,9 +3708,9 @@ var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ws(Kr, Gn, { - copy(e) { - return Object.assign(new this.constructor(), this, e); +Ws(Kr, Kn, { + copy(t) { + return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); @@ -3718,233 +3718,233 @@ Ws(Kr, Gn, { hex: Ca, // Deprecated! Use color.formatHex. formatHex: Ca, - formatHex8: ah, - formatHsl: oh, - formatRgb: Ra, - toString: Ra + formatHex8: oh, + formatHsl: lh, + formatRgb: Sa, + toString: Sa }); function Ca() { return this.rgb().formatHex(); } -function ah() { +function oh() { return this.rgb().formatHex8(); } -function oh() { - return ol(this).formatHsl(); +function lh() { + return ll(this).formatHsl(); } -function Ra() { +function Sa() { return this.rgb().formatRgb(); } -function Gn(e) { - var t, n; - return e = (e + "").trim().toLowerCase(), (t = Qc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Sa(t) : n === 3 ? new je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? oi(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? oi(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = eh.exec(e)) ? new je(t[1], t[2], t[3], 1) : (t = th.exec(e)) ? new je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = nh.exec(e)) ? oi(t[1], t[2], t[3], t[4]) : (t = rh.exec(e)) ? oi(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = ih.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = sh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, t[4]) : Ta.hasOwnProperty(e) ? Sa(Ta[e]) : e === "transparent" ? new je(NaN, NaN, NaN, 0) : null; +function Kn(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = th.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Na(e) : n === 3 ? new jt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? oi(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? oi(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 = eh.exec(t)) ? new jt(e[1], e[2], e[3], 1) : (e = nh.exec(t)) ? new jt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = rh.exec(t)) ? oi(e[1], e[2], e[3], e[4]) : (e = ih.exec(t)) ? oi(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = sh.exec(t)) ? Pa(e[1], e[2] / 100, e[3] / 100, 1) : (e = ah.exec(t)) ? Pa(e[1], e[2] / 100, e[3] / 100, e[4]) : Ra.hasOwnProperty(t) ? Na(Ra[t]) : t === "transparent" ? new jt(NaN, NaN, NaN, 0) : null; } -function Sa(e) { - return new je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); +function Na(t) { + return new jt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function oi(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new je(e, t, n, r); +function oi(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new jt(t, e, n, r); } -function lh(e) { - return e instanceof Kr || (e = Gn(e)), e ? (e = e.rgb(), new je(e.r, e.g, e.b, e.opacity)) : new je(); +function uh(t) { + return t instanceof Kr || (t = Kn(t)), t ? (t = t.rgb(), new jt(t.r, t.g, t.b, t.opacity)) : new jt(); } -function bs(e, t, n, r) { - return arguments.length === 1 ? lh(e) : new je(e, t, n, r ?? 1); +function bs(t, e, n, r) { + return arguments.length === 1 ? uh(t) : new jt(t, e, n, r ?? 1); } -function je(e, t, n, r) { - this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; +function jt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ws(je, bs, al(Kr, { - brighter(e) { - return e = e == null ? Ci : Math.pow(Ci, e), new je(this.r * e, this.g * e, this.b * e, this.opacity); +Ws(jt, bs, ol(Kr, { + brighter(t) { + return t = t == null ? Ri : Math.pow(Ri, t), new jt(this.r * t, this.g * t, this.b * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new je(this.r * e, this.g * e, this.b * e, this.opacity); + darker(t) { + return t = t == null ? Lr : Math.pow(Lr, t), new jt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new je(Xn(this.r), Xn(this.g), Xn(this.b), Ri(this.opacity)); + return new jt(Wn(this.r), Wn(this.g), Wn(this.b), Ci(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: Na, + hex: ka, // Deprecated! Use color.formatHex. - formatHex: Na, - formatHex8: uh, - formatRgb: ka, - toString: ka + formatHex: ka, + formatHex8: fh, + formatRgb: Ma, + toString: Ma })); -function Na() { - return `#${On(this.r)}${On(this.g)}${On(this.b)}`; +function ka() { + return `#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}`; } -function uh() { - return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function fh() { + return `#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}${Fn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ka() { - const e = Ri(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; +function Ma() { + const t = Ci(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Ri(e) { - return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); +function Ci(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Xn(e) { - return Math.max(0, Math.min(255, Math.round(e) || 0)); +function Wn(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function On(e) { - return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); +function Fn(t) { + return t = Wn(t), (t < 16 ? "0" : "") + t.toString(16); } -function Ma(e, t, n, r) { - return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new $t(e, t, n, r); +function Pa(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new $e(t, e, n, r); } -function ol(e) { - if (e instanceof $t) return new $t(e.h, e.s, e.l, e.opacity); - if (e instanceof Kr || (e = Gn(e)), !e) return new $t(); - if (e instanceof $t) return e; - e = e.rgb(); - var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new $t(a, o, l, e.opacity); +function ll(t) { + if (t instanceof $e) return new $e(t.h, t.s, t.l, t.opacity); + if (t instanceof Kr || (t = Kn(t)), !t) return new $e(); + if (t instanceof $e) return t; + t = t.rgb(); + var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new $e(a, o, l, t.opacity); } -function fh(e, t, n, r) { - return arguments.length === 1 ? ol(e) : new $t(e, t, n, r ?? 1); +function ch(t, e, n, r) { + return arguments.length === 1 ? ll(t) : new $e(t, e, n, r ?? 1); } -function $t(e, t, n, r) { - this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; +function $e(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ws($t, fh, al(Kr, { - brighter(e) { - return e = e == null ? Ci : Math.pow(Ci, e), new $t(this.h, this.s, this.l * e, this.opacity); +Ws($e, ch, ol(Kr, { + brighter(t) { + return t = t == null ? Ri : Math.pow(Ri, t), new $e(this.h, this.s, this.l * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new $t(this.h, this.s, this.l * e, this.opacity); + darker(t) { + return t = t == null ? Lr : Math.pow(Lr, t), new $e(this.h, this.s, this.l * t, this.opacity); }, rgb() { - var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; - return new je( - rs(e >= 240 ? e - 240 : e + 120, i, r), - rs(e, i, r), - rs(e < 120 ? e + 240 : e - 120, i, r), + 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 jt( + rs(t >= 240 ? t - 240 : t + 120, i, r), + rs(t, i, r), + rs(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new $t(Pa(this.h), li(this.s), li(this.l), Ri(this.opacity)); + return new $e(Da(this.h), li(this.s), li(this.l), Ci(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { - const e = Ri(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${li(this.s) * 100}%, ${li(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const t = Ci(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Da(this.h)}, ${li(this.s) * 100}%, ${li(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function Pa(e) { - return e = (e || 0) % 360, e < 0 ? e + 360 : e; +function Da(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function li(e) { - return Math.max(0, Math.min(1, e || 0)); +function li(t) { + return Math.max(0, Math.min(1, t || 0)); } -function rs(e, t, n) { - return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; +function rs(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 Us = (e) => () => e; -function ch(e, t) { +const Us = (t) => () => t; +function hh(t, e) { return function(n) { - return e + n * t; + return t + n * e; }; } -function hh(e, t, n) { - return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { - return Math.pow(e + r * t, n); +function dh(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 dh(e) { - return (e = +e) == 1 ? ll : function(t, n) { - return n - t ? hh(t, n, e) : Us(isNaN(t) ? n : t); +function ph(t) { + return (t = +t) == 1 ? ul : function(e, n) { + return n - e ? dh(e, n, t) : Us(isNaN(e) ? n : e); }; } -function ll(e, t) { - var n = t - e; - return n ? ch(e, n) : Us(isNaN(e) ? t : e); +function ul(t, e) { + var n = e - t; + return n ? hh(t, n) : Us(isNaN(t) ? e : t); } -const Si = (function e(t) { - var n = dh(t); +const Si = (function t(e) { + var n = ph(e); function r(i, s) { - var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ll(i.opacity, s.opacity); + var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ul(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } - return r.gamma = e, r; + return r.gamma = t, r; })(1); -function ph(e, t) { - t || (t = []); - var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; +function vh(t, e) { + e || (e = []); + var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; + for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; return r; }; } -function vh(e) { - return ArrayBuffer.isView(e) && !(e instanceof DataView); +function gh(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function gh(e, t) { - var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Zt(e[a], t[a]); - for (; a < n; ++a) s[a] = t[a]; +function _h(t, e) { + var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = Ze(t[a], e[a]); + for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function _h(e, t) { +function mh(t, e) { var n = /* @__PURE__ */ new Date(); - return e = +e, t = +t, function(r) { - return n.setTime(e * (1 - r) + t * r), n; + return t = +t, e = +e, function(r) { + return n.setTime(t * (1 - r) + e * r), n; }; } -function qt(e, t) { - return e = +e, t = +t, function(n) { - return e * (1 - n) + t * n; +function Ve(t, e) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; }; } -function mh(e, t) { +function yh(t, e) { var n = {}, r = {}, i; - (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); - for (i in t) - i in e ? n[i] = Zt(e[i], t[i]) : r[i] = t[i]; + (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); + for (i in e) + i in t ? n[i] = Ze(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function yh(e) { +function wh(t) { return function() { - return e; + return t; }; } -function wh(e) { - return function(t) { - return e(t) + ""; +function xh(t) { + return function(e) { + return t(e) + ""; }; } -function ul(e, t) { +function fl(t, e) { var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (e = e + "", t = t + ""; (r = $s.exec(e)) && (i = is.exec(t)); ) - (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: qt(r, i) })), n = is.lastIndex; - return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? wh(l[0].x) : yh(t) : (t = l.length, function(u) { - for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); + for (t = t + "", e = e + ""; (r = $s.exec(t)) && (i = is.exec(e)); ) + (s = i.index) > n && (s = e.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Ve(r, i) })), n = is.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? xh(l[0].x) : wh(e) : (e = l.length, function(u) { + for (var f = 0, p; f < e; ++f) o[(p = l[f]).i] = p.x(u); return o.join(""); }); } -function Zt(e, t) { - var n = typeof t, r; - return t == null || n === "boolean" ? Us(t) : (n === "number" ? qt : n === "string" ? (r = Gn(t)) ? (t = r, Si) : ul : t instanceof Gn ? Si : t instanceof Date ? _h : vh(t) ? ph : Array.isArray(t) ? gh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? mh : qt)(e, t); +function Ze(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? Us(e) : (n === "number" ? Ve : n === "string" ? (r = Kn(e)) ? (e = r, Si) : fl : e instanceof Kn ? Si : e instanceof Date ? mh : gh(e) ? vh : Array.isArray(e) ? _h : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yh : Ve)(t, e); } -var Da = 180 / Math.PI, As = { +var Oa = 180 / Math.PI, As = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,213 +3952,213 @@ var Da = 180 / Math.PI, As = { scaleX: 1, scaleY: 1 }; -function fl(e, t, n, r, i, s) { +function cl(t, e, n, r, i, s) { var a, o, l; - return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(t, e) * Da, - skewX: Math.atan(l) * Da, + rotate: Math.atan2(e, t) * Oa, + skewX: Math.atan(l) * Oa, scaleX: a, scaleY: o }; } var ui; -function xh(e) { - const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? As : fl(t.a, t.b, t.c, t.d, t.e, t.f); +function bh(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? As : cl(e.a, e.b, e.c, e.d, e.e, e.f); } -function bh(e) { - return e == null || (ui || (ui = document.createElementNS("http://www.w3.org/2000/svg", "g")), ui.setAttribute("transform", e), !(e = ui.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.f)); +function $h(t) { + return t == null || (ui || (ui = document.createElementNS("http://www.w3.org/2000/svg", "g")), ui.setAttribute("transform", t), !(t = ui.transform.baseVal.consolidate())) ? As : (t = t.matrix, cl(t.a, t.b, t.c, t.d, t.e, t.f)); } -function cl(e, t, n, r) { +function hl(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function s(u, f, p, h, d, y) { if (u !== p || f !== h) { - var b = d.push("translate(", null, t, null, n); - y.push({ i: b - 4, x: qt(u, p) }, { i: b - 2, x: qt(f, h) }); - } else (p || h) && d.push("translate(" + p + t + h + n); + var b = d.push("translate(", null, e, null, n); + y.push({ i: b - 4, x: Ve(u, p) }, { i: b - 2, x: Ve(f, h) }); + } else (p || h) && d.push("translate(" + p + e + h + n); } function a(u, f, p, h) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: qt(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: Ve(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); } function o(u, f, p, h) { - u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: qt(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: Ve(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); } function l(u, f, p, h, d, y) { if (u !== p || f !== h) { var b = d.push(i(d) + "scale(", null, ",", null, ")"); - y.push({ i: b - 4, x: qt(u, p) }, { i: b - 2, x: qt(f, h) }); + y.push({ i: b - 4, x: Ve(u, p) }, { i: b - 2, x: Ve(f, h) }); } else (p !== 1 || h !== 1) && d.push(i(d) + "scale(" + p + "," + h + ")"); } return function(u, f) { var p = [], h = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, h), a(u.rotate, f.rotate, p, h), o(u.skewX, f.skewX, p, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, h), u = f = null, function(d) { + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, h), a(u.rotate, f.rotate, p, h), o(u.skewX, f.skewX, p, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, h), u = f = null, function(d) { for (var y = -1, b = h.length, m; ++y < b; ) p[(m = h[y]).i] = m.x(d); return p.join(""); }; }; } -var $h = cl(xh, "px, ", "px)", "deg)"), Ah = cl(bh, ", ", ")", ")"), mr = 0, Nr = 0, Rr = 0, hl = 1e3, Ni, kr, ki = 0, Kn = 0, Gi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { - setTimeout(e, 17); +var Ah = hl(bh, "px, ", "px)", "deg)"), Eh = hl($h, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, dl = 1e3, Ni, kr, ki = 0, jn = 0, Gi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, pl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); }; function Gs() { - return Kn || (dl(Eh), Kn = Vr.now() + Gi); + return jn || (pl(Th), jn = Vr.now() + Gi); } -function Eh() { - Kn = 0; +function Th() { + jn = 0; } function Mi() { this._call = this._time = this._next = null; } -Mi.prototype = pl.prototype = { +Mi.prototype = vl.prototype = { constructor: Mi, - restart: function(e, t, n) { - if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Ni = this, kr = this), this._call = e, this._time = n, Es(); + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Gs() : +n) + (e == null ? 0 : +e), !this._next && kr !== this && (kr ? kr._next = this : Ni = this, kr = this), this._call = t, this._time = n, Es(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function pl(e, t, n) { +function vl(t, e, n) { var r = new Mi(); - return r.restart(e, t, n), r; + return r.restart(t, e, n), r; } -function Th() { +function Rh() { Gs(), ++mr; - for (var e = Ni, t; e; ) - (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + for (var t = Ni, e; t; ) + (e = jn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --mr; } -function Oa() { - Kn = (ki = Vr.now()) + Gi, mr = Nr = 0; +function Fa() { + jn = (ki = Vr.now()) + Gi, mr = Nr = 0; try { - Th(); + Rh(); } finally { - mr = 0, Rh(), Kn = 0; + mr = 0, Sh(), jn = 0; } } function Ch() { - var e = Vr.now(), t = e - ki; - t > hl && (Gi -= t, ki = e); + var t = Vr.now(), e = t - ki; + e > dl && (Gi -= e, ki = t); } -function Rh() { - for (var e, t = Ni, n, r = 1 / 0; t; ) - t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Ni = n); - kr = e, Es(r); +function Sh() { + for (var t, e = Ni, 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 : Ni = n); + kr = t, Es(r); } -function Es(e) { +function Es(t) { if (!mr) { Nr && (Nr = clearTimeout(Nr)); - var t = e - Kn; - t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Gi)), Rr && (Rr = clearInterval(Rr))) : (Rr || (ki = Vr.now(), Rr = setInterval(Ch, hl)), mr = 1, dl(Oa)); + var e = t - jn; + e > 24 ? (t < 1 / 0 && (Nr = setTimeout(Fa, t - Vr.now() - Gi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (ki = Vr.now(), Cr = setInterval(Ch, dl)), mr = 1, pl(Fa)); } } -function Fa(e, t, n) { +function Ia(t, e, n) { var r = new Mi(); - return t = t == null ? 0 : +t, r.restart((i) => { - r.stop(), e(i + t); - }, t, n), r; -} -var Sh = Uo("start", "end", "cancel", "interrupt"), Nh = [], vl = 0, Ia = 1, Ts = 2, yi = 3, La = 4, Cs = 5, wi = 6; -function Ki(e, t, n, r, i, s) { - var a = e.__transition; - if (!a) e.__transition = {}; + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; +} +var Nh = Go("start", "end", "cancel", "interrupt"), kh = [], gl = 0, La = 1, Ts = 2, yi = 3, qa = 4, Rs = 5, wi = 6; +function Ki(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; else if (n in a) return; - kh(e, n, { - name: t, + Mh(t, n, { + name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Sh, - tween: Nh, + on: Nh, + tween: kh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: vl + state: gl }); } -function Ks(e, t) { - var n = Rt(e, t); - if (n.state > vl) throw new Error("too late; already scheduled"); +function Ks(t, e) { + var n = Ce(t, e); + if (n.state > gl) throw new Error("too late; already scheduled"); return n; } -function Wt(e, t) { - var n = Rt(e, t); +function Ue(t, e) { + var n = Ce(t, e); if (n.state > yi) throw new Error("too late; already running"); return n; } -function Rt(e, t) { - var n = e.__transition; - if (!n || !(n = n[t])) throw new Error("transition not found"); +function Ce(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function kh(e, t, n) { - var r = e.__transition, i; - r[t] = n, n.timer = pl(s, 0, n.time); +function Mh(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = vl(s, 0, n.time); function s(u) { - n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = La, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { var f, p, h, d; - if (n.state !== Ia) return l(); + if (n.state !== La) return l(); for (f in r) if (d = r[f], d.name === n.name) { - if (d.state === yi) return Fa(a); - d.state === La ? (d.state = wi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = wi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); + if (d.state === yi) return Ia(a); + d.state === qa ? (d.state = wi, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[f]) : +f < e && (d.state = wi, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[f]); } - if (Fa(function() { - n.state === yi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Ts, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Ts) { + if (Ia(function() { + n.state === yi && (n.state = qa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ts) { for (n.state = yi, i = new Array(h = n.tween.length), f = 0, p = -1; f < h; ++f) - (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); + (d = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++p] = d); i.length = p + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), p = -1, h = i.length; ++p < h; ) - i[p].call(e, f); - n.state === Cs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Rs, 1), p = -1, h = i.length; ++p < h; ) + i[p].call(t, f); + n.state === Rs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = wi, n.timer.stop(), delete r[t]; + n.state = wi, n.timer.stop(), delete r[e]; for (var u in r) return; - delete e.__transition; + delete t.__transition; } } -function Mh(e, t) { - var n = e.__transition, r, i, s = !0, a; +function Ph(t, e) { + var n = t.__transition, r, i, s = !0, a; if (n) { - t = t == null ? null : t + ""; + e = e == null ? null : e + ""; for (a in n) { - if ((r = n[a]).name !== t) { + if ((r = n[a]).name !== e) { s = !1; continue; } - i = r.state > Ts && r.state < Cs, r.state = wi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Rs, r.state = wi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } - s && delete e.__transition; + s && delete t.__transition; } } -function Ph(e) { +function Dh(t) { return this.each(function() { - Mh(this, e); + Ph(this, t); }); } -function Dh(e, t) { +function Oh(t, e) { var n, r; return function() { - var i = Wt(this, e), s = i.tween; + var i = Ue(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === t) { + if (r[a].name === e) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Dh(e, t) { i.tween = r; }; } -function Oh(e, t, n) { +function Fh(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Wt(this, e), a = s.tween; + var s = Ue(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === t) { + for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === e) { i[l] = o; break; } @@ -4183,595 +4183,595 @@ function Oh(e, t, n) { s.tween = i; }; } -function Fh(e, t) { +function Ih(t, e) { var n = this._id; - if (e += "", arguments.length < 2) { - for (var r = Rt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === e) + if (t += "", arguments.length < 2) { + for (var r = Ce(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === t) return a.value; return null; } - return this.each((t == null ? Dh : Oh)(n, e, t)); + return this.each((e == null ? Oh : Fh)(n, t, e)); } -function js(e, t, n) { - var r = e._id; - return e.each(function() { - var i = Wt(this, r); - (i.value || (i.value = {}))[t] = n.apply(this, arguments); +function js(t, e, n) { + var r = t._id; + return t.each(function() { + var i = Ue(this, r); + (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Rt(i, r).value[t]; + return Ce(i, r).value[e]; }; } -function gl(e, t) { +function _l(t, e) { var n; - return (typeof t == "number" ? qt : t instanceof Gn ? Si : (n = Gn(t)) ? (t = n, Si) : ul)(e, t); + return (typeof e == "number" ? Ve : e instanceof Kn ? Si : (n = Kn(e)) ? (e = n, Si) : fl)(t, e); } -function Ih(e) { +function Lh(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function Lh(e) { +function qh(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function qh(e, t, n) { +function Vh(t, e, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(e); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = this.getAttribute(t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Vh(e, t, n) { +function zh(t, e, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(e.space, e.local); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = this.getAttributeNS(t.space, t.local); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function zh(e, t, n) { +function Hh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); + return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function Hh(e, t, n) { +function Yh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); + return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function Yh(e, t) { - var n = Ui(e), r = n === "transform" ? Ah : gl; - return this.attrTween(e, typeof t == "function" ? (n.local ? Hh : zh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Lh : Ih)(n) : (n.local ? Vh : qh)(n, r, t)); +function Bh(t, e) { + var n = Ui(t), r = n === "transform" ? Eh : _l; + return this.attrTween(t, typeof e == "function" ? (n.local ? Yh : Hh)(n, r, js(this, "attr." + t, e)) : e == null ? (n.local ? qh : Lh)(n) : (n.local ? zh : Vh)(n, r, e)); } -function Bh(e, t) { +function Xh(t, e) { return function(n) { - this.setAttribute(e, t.call(this, n)); + this.setAttribute(t, e.call(this, n)); }; } -function Xh(e, t) { +function Wh(t, e) { return function(n) { - this.setAttributeNS(e.space, e.local, t.call(this, n)); + this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Wh(e, t) { +function Uh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Xh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Wh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Uh(e, t) { +function Gh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Bh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Xh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Gh(e, t) { - var n = "attr." + e; +function Kh(t, e) { + var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; - if (t == null) return this.tween(n, null); - if (typeof t != "function") throw new Error(); - var r = Ui(e); - return this.tween(n, (r.local ? Wh : Uh)(r, t)); + if (e == null) return this.tween(n, null); + if (typeof e != "function") throw new Error(); + var r = Ui(t); + return this.tween(n, (r.local ? Uh : Gh)(r, e)); } -function Kh(e, t) { +function jh(t, e) { return function() { - Ks(this, e).delay = +t.apply(this, arguments); + Ks(this, t).delay = +e.apply(this, arguments); }; } -function jh(e, t) { - return t = +t, function() { - Ks(this, e).delay = t; +function Jh(t, e) { + return e = +e, function() { + Ks(this, t).delay = e; }; } -function Jh(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Kh : jh)(t, e)) : Rt(this.node(), t).delay; +function Zh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? jh : Jh)(e, t)) : Ce(this.node(), e).delay; } -function Zh(e, t) { +function Qh(t, e) { return function() { - Wt(this, e).duration = +t.apply(this, arguments); + Ue(this, t).duration = +e.apply(this, arguments); }; } -function Qh(e, t) { - return t = +t, function() { - Wt(this, e).duration = t; +function td(t, e) { + return e = +e, function() { + Ue(this, t).duration = e; }; } -function ed(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Zh : Qh)(t, e)) : Rt(this.node(), t).duration; +function ed(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Qh : td)(e, t)) : Ce(this.node(), e).duration; } -function td(e, t) { - if (typeof t != "function") throw new Error(); +function nd(t, e) { + if (typeof e != "function") throw new Error(); return function() { - Wt(this, e).ease = t; + Ue(this, t).ease = e; }; } -function nd(e) { - var t = this._id; - return arguments.length ? this.each(td(t, e)) : Rt(this.node(), t).ease; +function rd(t) { + var e = this._id; + return arguments.length ? this.each(nd(e, t)) : Ce(this.node(), e).ease; } -function rd(e, t) { +function id(t, e) { return function() { - var n = t.apply(this, arguments); + var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Wt(this, e).ease = n; + Ue(this, t).ease = n; }; } -function id(e) { - if (typeof e != "function") throw new Error(); - return this.each(rd(this._id, e)); +function sd(t) { + if (typeof t != "function") throw new Error(); + return this.each(id(this._id, t)); } -function sd(e) { - typeof e != "function" && (e = jo(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); +function ad(t) { + typeof t != "function" && (t = Jo(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); return new cn(r, this._parents, this._name, this._id); } -function ad(e) { - if (e._id !== this._id) throw new Error(); - for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), h, d = 0; d < f; ++d) +function od(t) { + if (t._id !== this._id) throw new Error(); + for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = e[o], u = n[o], f = l.length, p = a[o] = new Array(f), h, d = 0; d < f; ++d) (h = l[d] || u[d]) && (p[d] = h); for (; o < r; ++o) - a[o] = t[o]; + a[o] = e[o]; return new cn(a, this._parents, this._name, this._id); } -function od(e) { - return (e + "").trim().split(/^|\s+/).every(function(t) { - var n = t.indexOf("."); - return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; +function ld(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 ld(e, t, n) { - var r, i, s = od(t) ? Ks : Wt; +function ud(t, e, n) { + var r, i, s = ld(e) ? Ks : Ue; return function() { - var a = s(this, e), o = a.on; - o !== r && (i = (r = o).copy()).on(t, n), a.on = i; + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function ud(e, t) { +function fd(t, e) { var n = this._id; - return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(ld(n, e, t)); + return arguments.length < 2 ? Ce(this.node(), n).on.on(t) : this.each(ud(n, t, e)); } -function fd(e) { +function cd(t) { return function() { - var t = this.parentNode; - for (var n in this.__transition) if (+n !== e) return; - t && t.removeChild(this); + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); }; } -function cd() { - return this.on("end.remove", fd(this._id)); +function hd() { + return this.on("end.remove", cd(this._id)); } -function hd(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Bs(e)); +function dd(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Bs(t)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, h = 0; h < l; ++h) - (f = o[h]) && (p = e.call(f, f.__data__, h, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[h] = p, Ki(u[h], t, n, h, u, Rt(f, n))); - return new cn(s, this._parents, t, n); + (f = o[h]) && (p = t.call(f, f.__data__, h, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[h] = p, Ki(u[h], e, n, h, u, Ce(f, n))); + return new cn(s, this._parents, e, n); } -function dd(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Ko(e)); +function pd(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = jo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) if (f = l[p]) { - for (var h = e.call(f, f.__data__, p, l), d, y = Rt(f, n), b = 0, m = h.length; b < m; ++b) - (d = h[b]) && Ki(d, t, n, b, h, y); + for (var h = t.call(f, f.__data__, p, l), d, y = Ce(f, n), b = 0, m = h.length; b < m; ++b) + (d = h[b]) && Ki(d, e, n, b, h, y); s.push(h), a.push(f); } - return new cn(s, a, t, n); + return new cn(s, a, e, n); } -var pd = xr.prototype.constructor; -function vd() { - return new pd(this._groups, this._parents); +var vd = xr.prototype.constructor; +function gd() { + return new vd(this._groups, this._parents); } -function gd(e, t) { +function _d(t, e) { var n, r, i; return function() { - var s = _r(this, e), a = (this.style.removeProperty(e), _r(this, e)); - return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); + var s = _r(this, t), a = (this.style.removeProperty(t), _r(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function _l(e) { +function ml(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function _d(e, t, n) { +function md(t, e, n) { var r, i = n + "", s; return function() { - var a = _r(this, e); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = _r(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function md(e, t, n) { +function yd(t, e, n) { var r, i, s; return function() { - var a = _r(this, e), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(e), _r(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); + var a = _r(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), _r(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function yd(e, t) { - var n, r, i, s = "style." + t, a = "end." + s, o; +function wd(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Wt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; + var l = Ue(this, t), u = l.on, f = l.value[s] == null ? o || (o = ml(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function wd(e, t, n) { - var r = (e += "") == "transform" ? $h : gl; - return t == null ? this.styleTween(e, gd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, md(e, r, js(this, "style." + e, t))).each(yd(this._id, e)) : this.styleTween(e, _d(e, r, t), n).on("end.style." + e, null); +function xd(t, e, n) { + var r = (t += "") == "transform" ? Ah : _l; + return e == null ? this.styleTween(t, _d(t, r)).on("end.style." + t, ml(t)) : typeof e == "function" ? this.styleTween(t, yd(t, r, js(this, "style." + t, e))).each(wd(this._id, t)) : this.styleTween(t, md(t, r, e), n).on("end.style." + t, null); } -function xd(e, t, n) { +function bd(t, e, n) { return function(r) { - this.style.setProperty(e, t.call(this, r), n); + this.style.setProperty(t, e.call(this, r), n); }; } -function bd(e, t, n) { +function $d(t, e, n) { var r, i; function s() { - var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && xd(e, a, n)), r; + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && bd(t, a, n)), r; } - return s._value = t, s; + return s._value = e, s; } -function $d(e, t, n) { - var r = "style." + (e += ""); +function Ad(t, e, n) { + var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (t == null) return this.tween(r, null); - if (typeof t != "function") throw new Error(); - return this.tween(r, bd(e, t, n ?? "")); + if (e == null) return this.tween(r, null); + if (typeof e != "function") throw new Error(); + return this.tween(r, $d(t, e, n ?? "")); } -function Ad(e) { +function Ed(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function Ed(e) { +function Td(t) { return function() { - var t = e(this); - this.textContent = t ?? ""; + var e = t(this); + this.textContent = e ?? ""; }; } -function Td(e) { - return this.tween("text", typeof e == "function" ? Ed(js(this, "text", e)) : Ad(e == null ? "" : e + "")); +function Rd(t) { + return this.tween("text", typeof t == "function" ? Td(js(this, "text", t)) : Ed(t == null ? "" : t + "")); } -function Cd(e) { - return function(t) { - this.textContent = e.call(this, t); +function Cd(t) { + return function(e) { + this.textContent = t.call(this, e); }; } -function Rd(e) { - var t, n; +function Sd(t) { + var e, n; function r() { - var i = e.apply(this, arguments); - return i !== n && (t = (n = i) && Cd(i)), t; + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && Cd(i)), e; } - return r._value = e, r; + return r._value = t, r; } -function Sd(e) { - var t = "text"; - if (arguments.length < 1) return (t = this.tween(t)) && t._value; - if (e == null) return this.tween(t, null); - if (typeof e != "function") throw new Error(); - return this.tween(t, Rd(e)); +function Nd(t) { + var e = "text"; + if (arguments.length < 1) return (e = this.tween(e)) && e._value; + if (t == null) return this.tween(e, null); + if (typeof t != "function") throw new Error(); + return this.tween(e, Sd(t)); } -function Nd() { - for (var e = this._name, t = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function kd() { + for (var t = this._name, e = this._id, n = yl(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { - var f = Rt(l, t); - Ki(l, e, n, u, a, { + var f = Ce(l, e); + Ki(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new cn(r, this._parents, e, n); + return new cn(r, this._parents, t, n); } -function kd() { - var e, t, n = this, r = n._id, i = n.size(); +function Md() { + var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Wt(this, r), f = u.on; - f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; + var u = Ue(this, r), f = u.on; + f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var Md = 0; -function cn(e, t, n, r) { - this._groups = e, this._parents = t, this._name = n, this._id = r; +var Pd = 0; +function cn(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; } -function xi(e) { - return xr().transition(e); +function xi(t) { + return xr().transition(t); } -function ml() { - return ++Md; +function yl() { + return ++Pd; } -var Jt = xr.prototype; +var Je = xr.prototype; cn.prototype = xi.prototype = { constructor: cn, - select: hd, - selectAll: dd, - selectChild: Jt.selectChild, - selectChildren: Jt.selectChildren, - filter: sd, - merge: ad, - selection: vd, - transition: Nd, - call: Jt.call, - nodes: Jt.nodes, - node: Jt.node, - size: Jt.size, - empty: Jt.empty, - each: Jt.each, - on: ud, - attr: Yh, - attrTween: Gh, - style: wd, - styleTween: $d, - text: Td, - textTween: Sd, - remove: cd, - tween: Fh, - delay: Jh, + select: dd, + selectAll: pd, + selectChild: Je.selectChild, + selectChildren: Je.selectChildren, + filter: ad, + merge: od, + selection: gd, + transition: kd, + call: Je.call, + nodes: Je.nodes, + node: Je.node, + size: Je.size, + empty: Je.empty, + each: Je.each, + on: fd, + attr: Bh, + attrTween: Kh, + style: xd, + styleTween: Ad, + text: Rd, + textTween: Nd, + remove: hd, + tween: Ih, + delay: Zh, duration: ed, - ease: nd, - easeVarying: id, - end: kd, - [Symbol.iterator]: Jt[Symbol.iterator] + ease: rd, + easeVarying: sd, + end: Md, + [Symbol.iterator]: Je[Symbol.iterator] }; -function Pd(e) { - return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; +function Dd(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Dd = { +var Od = { time: null, // Set on use. delay: 0, duration: 250, - ease: Pd + ease: Dd }; -function Od(e, t) { - for (var n; !(n = e.__transition) || !(n = n[t]); ) - if (!(e = e.parentNode)) - throw new Error(`transition ${t} not found`); +function Fd(t, e) { + for (var n; !(n = t.__transition) || !(n = n[e]); ) + if (!(t = t.parentNode)) + throw new Error(`transition ${e} not found`); return n; } -function Fd(e) { - var t, n; - e instanceof cn ? (t = e._id, e = e._name) : (t = ml(), (n = Dd).time = Gs(), e = e == null ? null : e + ""); +function Id(t) { + var e, n; + t instanceof cn ? (e = t._id, t = t._name) : (e = yl(), (n = Od).time = Gs(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Ki(l, e, t, u, a, n || Od(l, t)); - return new cn(r, this._parents, e, t); -} -xr.prototype.interrupt = Ph; -xr.prototype.transition = Fd; -const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Id = Ss - Nn; -function yl(e) { - this._ += e[0]; - for (let t = 1, n = e.length; t < n; ++t) - this._ += arguments[t] + e[t]; -} -function Ld(e) { - let t = Math.floor(e); - if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return yl; - const n = 10 ** t; + (l = a[u]) && Ki(l, t, e, u, a, n || Fd(l, e)); + return new cn(r, this._parents, t, e); +} +xr.prototype.interrupt = Dh; +xr.prototype.transition = Id; +const Cs = Math.PI, Ss = 2 * Cs, kn = 1e-6, Ld = Ss - kn; +function wl(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function qd(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return wl; + const n = 10 ** e; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class qd { - constructor(t) { +class Vd { + constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Ld(t); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? wl : qd(e); } - moveTo(t, n) { - this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; + moveTo(e, n) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(t, n) { - this._append`L${this._x1 = +t},${this._y1 = +n}`; + lineTo(e, n) { + this._append`L${this._x1 = +e},${this._y1 = +n}`; } - quadraticCurveTo(t, n, r, i) { - this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(e, n, r, i) { + this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(t, n, r, i, s, a) { - this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(e, n, r, i, s, a) { + this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(t, n, r, i, s) { - if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, h = f * f + p * p; + arcTo(e, n, r, i, s) { + if (e = +e, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); + let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, p = o - n, h = f * f + p * p; if (this._x1 === null) - this._append`M${this._x1 = t},${this._y1 = n}`; - else if (h > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) - this._append`L${this._x1 = t},${this._y1 = n}`; + this._append`M${this._x1 = e},${this._y1 = n}`; + else if (h > kn) if (!(Math.abs(p * l - u * f) > kn) || !s) + this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(h), M = s * Math.tan((Rs - Math.acos((b + h - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; - Math.abs(S - 1) > Nn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; + let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(h), M = s * Math.tan((Cs - Math.acos((b + h - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; + Math.abs(S - 1) > kn && this._append`L${e + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = e + I * l},${this._y1 = n + I * u}`; } } - arc(t, n, r, i, s, a) { - if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, h = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Ss + Ss), h > Id ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : h > Nn && this._append`A${r},${r},0,${+(h >= Rs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + arc(e, n, r, i, s, a) { + if (e = +e, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, p = 1 ^ a, h = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > kn || Math.abs(this._y1 - f) > kn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Ss + Ss), h > Ld ? this._append`A${r},${r},0,1,${p},${e - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : h > kn && this._append`A${r},${r},0,${+(h >= Cs)},${p},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(t, n, r, i) { - this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + rect(e, n, r, i) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; } toString() { return this._; } } -function Vd(e) { - for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); +function zd(t) { + for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const zd = Vd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function qe(e) { +const Hd = zd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Lt(t) { return function() { - return e; + return t; }; } -const qa = Math.abs, De = Math.atan2, Sn = Math.cos, Hd = Math.max, ss = Math.min, Dt = Math.sin, tr = Math.sqrt, Be = 1e-12, zr = Math.PI, Pi = zr / 2, bi = 2 * zr; -function Yd(e) { - return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); +const Va = Math.abs, Dt = Math.atan2, Nn = Math.cos, Yd = Math.max, ss = Math.min, Oe = Math.sin, er = Math.sqrt, Bt = 1e-12, zr = Math.PI, Pi = zr / 2, bi = 2 * zr; +function Bd(t) { + return t > 1 ? 0 : t < -1 ? zr : Math.acos(t); } -function Va(e) { - return e >= 1 ? Pi : e <= -1 ? -Pi : Math.asin(e); +function za(t) { + return t >= 1 ? Pi : t <= -1 ? -Pi : Math.asin(t); } -function Bd(e) { - let t = 3; - return e.digits = function(n) { - if (!arguments.length) return t; +function Xd(t) { + let e = 3; + return t.digits = function(n) { + if (!arguments.length) return e; if (n == null) - t = null; + e = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - t = r; + e = r; } - return e; - }, () => new qd(t); + return t; + }, () => new Vd(e); } -function Xd(e) { - return e.innerRadius; +function Wd(t) { + return t.innerRadius; } -function Wd(e) { - return e.outerRadius; +function Ud(t) { + return t.outerRadius; } -function Ud(e) { - return e.startAngle; +function Gd(t) { + return t.startAngle; } -function Gd(e) { - return e.endAngle; +function Kd(t) { + return t.endAngle; } -function Kd(e) { - return e && e.padAngle; +function jd(t) { + return t && t.padAngle; } -function jd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, p = o - s, h = p * l - f * u; - if (!(h * h < Be)) - return h = (f * (t - s) - p * (e - i)) / h, [e + h * l, t + h * u]; +function Jd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, p = o - s, h = p * l - f * u; + if (!(h * h < Bt)) + return h = (f * (e - s) - p * (t - i)) / h, [t + h * l, e + h * u]; } -function fi(e, t, n, r, i, s, a) { - var o = e - n, l = t - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, p = -u * o, h = e + f, d = t + p, y = n + f, b = r + p, m = (h + y) / 2, $ = (d + b) / 2, D = y - h, M = b - d, S = D * D + M * M, I = i - s, L = h * b - y * d, U = (M < 0 ? -1 : 1) * tr(Hd(0, I * I * S - L * L)), ae = (L * M - D * U) / S, Q = (-L * D - M * U) / S, G = (L * M + D * U) / S, oe = (-L * D + M * U) / S, ue = ae - m, O = Q - $, F = G - m, Ne = oe - $; - return ue * ue + O * O > F * F + Ne * Ne && (ae = G, Q = oe), { - cx: ae, - cy: Q, +function fi(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, h = t + f, d = e + p, y = n + f, b = r + p, m = (h + y) / 2, $ = (d + b) / 2, D = y - h, M = b - d, S = D * D + M * M, I = i - s, L = h * b - y * d, U = (M < 0 ? -1 : 1) * er(Yd(0, I * I * S - L * L)), at = (L * M - D * U) / S, tt = (-L * D - M * U) / S, G = (L * M + D * U) / S, ot = (-L * D + M * U) / S, ut = at - m, O = tt - $, F = G - m, kt = ot - $; + return ut * ut + O * O > F * F + kt * kt && (at = G, tt = ot), { + cx: at, + cy: tt, x01: -f, y01: -p, - x11: ae * (i / I - 1), - y11: Q * (i / I - 1) + x11: at * (i / I - 1), + y11: tt * (i / I - 1) }; } -function wt() { - var e = Xd, t = Wd, n = qe(0), r = null, i = Ud, s = Gd, a = Kd, o = null, l = Bd(u); +function we() { + var t = Wd, e = Ud, n = Lt(0), r = null, i = Gd, s = Kd, a = jd, o = null, l = Xd(u); function u() { - var f, p, h = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Pi, b = s.apply(this, arguments) - Pi, m = qa(b - y), $ = b > y; - if (o || (o = f = l()), d < h && (p = d, d = h, h = p), !(d > Be)) o.moveTo(0, 0); - else if (m > bi - Be) - o.moveTo(d * Sn(y), d * Dt(y)), o.arc(0, 0, d, y, b, !$), h > Be && (o.moveTo(h * Sn(b), h * Dt(b)), o.arc(0, 0, h, b, y, $)); + var f, p, h = +t.apply(this, arguments), d = +e.apply(this, arguments), y = i.apply(this, arguments) - Pi, b = s.apply(this, arguments) - Pi, m = Va(b - y), $ = b > y; + if (o || (o = f = l()), d < h && (p = d, d = h, h = p), !(d > Bt)) o.moveTo(0, 0); + else if (m > bi - Bt) + o.moveTo(d * Nn(y), d * Oe(y)), o.arc(0, 0, d, y, b, !$), h > Bt && (o.moveTo(h * Nn(b), h * Oe(b)), o.arc(0, 0, h, b, y, $)); else { - var D = y, M = b, S = y, I = b, L = m, U = m, ae = a.apply(this, arguments) / 2, Q = ae > Be && (r ? +r.apply(this, arguments) : tr(h * h + d * d)), G = ss(qa(d - h) / 2, +n.apply(this, arguments)), oe = G, ue = G, O, F; - if (Q > Be) { - var Ne = Va(Q / h * Dt(ae)), ft = Va(Q / d * Dt(ae)); - (L -= Ne * 2) > Be ? (Ne *= $ ? 1 : -1, S += Ne, I -= Ne) : (L = 0, S = I = (y + b) / 2), (U -= ft * 2) > Be ? (ft *= $ ? 1 : -1, D += ft, M -= ft) : (U = 0, D = M = (y + b) / 2); + var D = y, M = b, S = y, I = b, L = m, U = m, at = a.apply(this, arguments) / 2, tt = at > Bt && (r ? +r.apply(this, arguments) : er(h * h + d * d)), G = ss(Va(d - h) / 2, +n.apply(this, arguments)), ot = G, ut = G, O, F; + if (tt > Bt) { + var kt = za(tt / h * Oe(at)), ue = za(tt / d * Oe(at)); + (L -= kt * 2) > Bt ? (kt *= $ ? 1 : -1, S += kt, I -= kt) : (L = 0, S = I = (y + b) / 2), (U -= ue * 2) > Bt ? (ue *= $ ? 1 : -1, D += ue, M -= ue) : (U = 0, D = M = (y + b) / 2); } - var me = d * Sn(D), ye = d * Dt(D), te = h * Sn(I), ke = h * Dt(I); - if (G > Be) { - var Y = d * Sn(M), Oe = d * Dt(M), St = h * Sn(S), ie = h * Dt(S), Je; + var yt = d * Nn(D), wt = d * Oe(D), et = h * Nn(I), Mt = h * Oe(I); + if (G > Bt) { + var q = d * Nn(M), Ot = d * Oe(M), Se = h * Nn(S), it = h * Oe(S), Jt; if (m < zr) - if (Je = jd(me, ye, St, ie, Y, Oe, te, ke)) { - var yt = me - Je[0], Ze = ye - Je[1], Tn = Y - Je[0], ge = Oe - Je[1], Nt = 1 / Dt(Yd((yt * Tn + Ze * ge) / (tr(yt * yt + Ze * Ze) * tr(Tn * Tn + ge * ge))) / 2), Ut = tr(Je[0] * Je[0] + Je[1] * Je[1]); - oe = ss(G, (h - Ut) / (Nt - 1)), ue = ss(G, (d - Ut) / (Nt + 1)); + if (Jt = Jd(yt, wt, Se, it, q, Ot, et, Mt)) { + var Zt = yt - Jt[0], Qt = wt - Jt[1], Tn = q - Jt[0], _t = Ot - Jt[1], Ne = 1 / Oe(Bd((Zt * Tn + Qt * _t) / (er(Zt * Zt + Qt * Qt) * er(Tn * Tn + _t * _t))) / 2), Ge = er(Jt[0] * Jt[0] + Jt[1] * Jt[1]); + ot = ss(G, (h - Ge) / (Ne - 1)), ut = ss(G, (d - Ge) / (Ne + 1)); } else - oe = ue = 0; + ot = ut = 0; } - U > Be ? ue > Be ? (O = fi(St, ie, me, ye, d, ue, $), F = fi(Y, Oe, te, ke, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < G ? o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(O.y11, O.x11), !$), o.arc(0, 0, d, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ue, De(F.y11, F.x11), De(F.y01, F.x01), !$))) : (o.moveTo(me, ye), o.arc(0, 0, d, D, M, !$)) : o.moveTo(me, ye), !(h > Be) || !(L > Be) ? o.lineTo(te, ke) : oe > Be ? (O = fi(te, ke, Y, Oe, h, -oe, $), F = fi(me, ye, St, ie, h, -oe, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), oe < G ? o.arc(O.cx, O.cy, oe, De(O.y01, O.x01), De(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, oe, De(O.y01, O.x01), De(O.y11, O.x11), !$), o.arc(0, 0, h, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, oe, De(F.y11, F.x11), De(F.y01, F.x01), !$))) : o.arc(0, 0, h, I, S, $); + U > Bt ? ut > Bt ? (O = fi(Se, it, yt, wt, d, ut, $), F = fi(q, Ot, et, Mt, d, ut, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ut < G ? o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, d, Dt(O.cy + O.y11, O.cx + O.x11), Dt(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ut, Dt(F.y11, F.x11), Dt(F.y01, F.x01), !$))) : (o.moveTo(yt, wt), o.arc(0, 0, d, D, M, !$)) : o.moveTo(yt, wt), !(h > Bt) || !(L > Bt) ? o.lineTo(et, Mt) : ot > Bt ? (O = fi(et, Mt, q, Ot, h, -ot, $), F = fi(yt, wt, Se, it, h, -ot, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), ot < G ? o.arc(O.cx, O.cy, ot, Dt(O.y01, O.x01), Dt(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ot, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, h, Dt(O.cy + O.y11, O.cx + O.x11), Dt(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, ot, Dt(F.y11, F.x11), Dt(F.y01, F.x01), !$))) : o.arc(0, 0, h, I, S, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [Sn(p) * f, Dt(p) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; + return [Nn(p) * f, Oe(p) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : qe(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Lt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : qe(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Lt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : qe(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Lt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : qe(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Lt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : qe(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Lt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : qe(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Lt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : qe(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Lt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Jd(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Zd(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Zd(e, t) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function Qd(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Qd(e) { - return e; +function tp(t) { + return t; } function as() { - var e = Qd, t = Zd, n = null, r = qe(0), i = qe(bi), s = qe(0); + var t = tp, e = Qd, n = null, r = Lt(0), i = Lt(bi), s = Lt(0); function a(o) { - var l, u = (o = Jd(o)).length, f, p, h = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(bi, Math.max(-bi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = Zd(o)).length, f, p, h = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(bi, Math.max(-bi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (h += S); - for (t != null ? d.sort(function(I, L) { - return t(y[I], y[L]); + (S = y[d[l] = l] = +t(o[l], l, o)) > 0 && (h += S); + for (e != null ? d.sort(function(I, L) { + return e(y[I], y[L]); }) : n != null && d.sort(function(I, L) { return n(o[I], o[L]); }), l = 0, p = h ? (m - u * M) / h : 0; l < u; ++l, b = $) @@ -4786,110 +4786,110 @@ function as() { return y; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : qe(+o), a) : e; + return arguments.length ? (t = typeof o == "function" ? o : Lt(+o), a) : t; }, a.sortValues = function(o) { - return arguments.length ? (t = o, n = null, a) : t; + return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { - return arguments.length ? (n = o, t = null, a) : n; + return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : qe(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Lt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : qe(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Lt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : qe(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Lt(+o), a) : s; }, a; } -function Mr(e, t, n) { - this.k = e, this.x = t, this.y = n; +function Mr(t, e, n) { + this.k = t, this.x = e, this.y = n; } Mr.prototype = { constructor: Mr, - scale: function(e) { - return e === 1 ? this : new Mr(this.k * e, this.x, this.y); + scale: function(t) { + return t === 1 ? this : new Mr(this.k * t, this.x, this.y); }, - translate: function(e, t) { - return e === 0 & t === 0 ? this : new Mr(this.k, this.x + this.k * e, this.y + this.k * t); + translate: function(t, e) { + return t === 0 & e === 0 ? this : new Mr(this.k, this.x + this.k * t, this.y + this.k * e); }, - apply: function(e) { - return [e[0] * this.k + this.x, e[1] * this.k + this.y]; + apply: function(t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; }, - applyX: function(e) { - return e * this.k + this.x; + applyX: function(t) { + return t * this.k + this.x; }, - applyY: function(e) { - return e * this.k + this.y; + applyY: function(t) { + return t * this.k + this.y; }, - invert: function(e) { - return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; + invert: function(t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; }, - invertX: function(e) { - return (e - this.x) / this.k; + invertX: function(t) { + return (t - this.x) / this.k; }, - invertY: function(e) { - return (e - this.y) / this.k; + invertY: function(t) { + return (t - this.y) / this.k; }, - rescaleX: function(e) { - return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); + rescaleX: function(t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); }, - rescaleY: function(e) { - return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); + rescaleY: function(t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; Mr.prototype; -var ep = /* @__PURE__ */ ju(''); -const tp = { +var ep = /* @__PURE__ */ Ju(''); +const np = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function wl(e, t) { - zi(t, !0), Hs(e, tp); - let n = se(t, "jsonData", 7), r = se(t, "currentRound", 7, 1), i = se(t, "mouseEventType", 15), s = se(t, "mouseData", 15), a = se(t, "mouseX", 15), o = se(t, "mouseY", 15), l = se(t, "requestRoundChange", 7, (c) => { - }), u = se(t, "candidateColors", 23, () => []), f = se(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = se(t, "firstRoundDeterminesPercentages", 7, !1), h = se(t, "randomizeOrder", 7, !1), d = se(t, "displayPhase", 15, 0); +function xl(t, e) { + zi(e, !0), Hs(t, np); + let n = st(e, "jsonData", 7), r = st(e, "currentRound", 7, 1), i = st(e, "mouseEventType", 15), s = st(e, "mouseData", 15), a = st(e, "mouseX", 15), o = st(e, "mouseY", 15), l = st(e, "requestRoundChange", 7, (c) => { + }), u = st(e, "candidateColors", 23, () => []), f = st(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = st(e, "firstRoundDeterminesPercentages", 7, !1), h = st(e, "randomizeOrder", 7, !1), d = st(e, "displayPhase", 15, 0); function y(c) { return c.isTransfer ? `${c.label}__transfer` : c.transferIndex != null ? `${c.label}__${c.transferIndex}` : c.label; } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", U = "TextLayer", ae = "url(#cross-hatch)", Q = 1.15, G = 750, oe = 800, ue = "white", O = 1, F = "#ff00ff", Ne = 3; - function ft(c) { + const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", U = "TextLayer", at = "url(#cross-hatch)", tt = 1.15, G = 750, ot = 800, ut = "white", O = 1, F = "#ff00ff", kt = 3; + function ue(c) { return "hatch-" + c.replace(/[^a-zA-Z0-9]/g, "-"); } - let me = [], ye = [], te = [], ke = 0, Y = 0; - const Oe = {}, St = "No Further Rankings"; - let ie = /* @__PURE__ */ $e(null); - function Je() { - const c = fe(x(ie)); + let yt = [], wt = [], et = [], Mt = 0, q = 0; + const Ot = {}, Se = "No Further Rankings"; + let it = /* @__PURE__ */ At(null); + function Jt() { + const c = ct(x(it)); c.select("#" + S).remove(), c.select("#" + I).remove(), c.select("#" + L).remove(), c.select("#" + U).remove(); } - function yt(c) { - l() && (_e = c, l()(c)); + function Zt(c) { + l() && (ft = c, l()(c)); } - function Ze(c) { - Je(), te = Tn(c), me = ea(c, S, te, D, M, 0, ge()), ea(c, I, te, D, M, 0, ge(), !1, !1, !0), Er(); + function Qt(c) { + Jt(), et = Tn(c), yt = ea(c, S, et, D, M, 0, _t()), ea(c, I, et, D, M, 0, _t(), !1, !1, !0), Er(); } - nf(() => { - pn(), setTimeout( + rf(() => { + Ht(), setTimeout( () => { - Ze(r()); + Qt(r()); }, 0 ); }); function Tn(c) { - const g = Gt(c); - return ke = Jn(c), g; + const g = Pe(c); + return Mt = Zn(c), g; } - function ge() { + function _t() { return $; } - function Nt() { - return ge() * 1.41; + function Ne() { + return _t() * 1.41; } - function Ut(c) { + function Ge(c) { let g = 0; for (let _ = 1; _ < c; _++) { const A = n().results[_ - 1].tallyResults; @@ -4904,7 +4904,7 @@ function wl(e, t) { return g; } function jr(c, g) { - if (c === "exhausted") return Ut(g); + if (c === "exhausted") return Ge(g); { const _ = n().results[g - 1].tally; return Number(_[c]); @@ -4914,24 +4914,24 @@ function wl(e, t) { return jr(c, g).toLocaleString("en-US"); } function Zr(c, g) { - const _ = p() ? ke : ji(g); + const _ = p() ? Mt : ji(g); return (jr(c, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Jn(c) { + function Zn(c) { const g = n().results[c - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) _ += Number(E); return _; } - function kt(c) { + function ke(c) { return c === "exhausted" || c === "Inactive Ballots"; } function ji(c) { const g = n().results[c - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) - kt(A) || (_ += Number(E)); + ke(A) || (_ += Number(E)); return _; } function Qr(c, g) { @@ -4961,20 +4961,26 @@ function wl(e, t) { if (E >= 0) { const T = _[E].transfers; if (T) - for (let [P, z] of Object.entries(T)) A += Number(z); + for (let [P, Y] of Object.entries(T)) A += Number(Y); } else return 0; return A; } - function B(c) { + function H(c) { if (c < 1 || c > n().results.length) return !1; const g = n().results[c - 1].tallyResults; return g.length > 0 && g.some((_) => Object.keys(_.transfers).length > 0); } - function ee(c, g) { - c.some((_) => kt(_.label)) || c.push({ label: "exhausted", value: Ut(g) }); + function Z(c) { + const g = n().results.length; + for (let _ = c; _ < g; _++) + if (H(_)) return _; + return g; } - function pe(c) { + function ht(c, g) { + c.some((_) => ke(_.label)) || c.push({ label: "exhausted", value: Ge(g) }); + } + function xt(c) { let g = c | 0; return () => { g = g + 1831565813 | 0; @@ -4982,39 +4988,39 @@ function wl(e, t) { return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; }; } - function we(c) { + function lt(c) { let g = 5381; for (let _ = 0; _ < c.length; _++) g = (g << 5) + g + c.charCodeAt(_) | 0; return g; } - function le(c) { + function zt(c) { var E; if (c.length <= 3) return c; - const g = we(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = pe(g), A = [...c]; + const g = lt(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = xt(g), A = [...c]; for (let T = A.length - 1; T > 0; T--) { const P = Math.floor(_() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function Fe() { - const c = Object.keys(n().results[0].tally), g = c.filter((E) => !kt(E)), _ = c.filter((E) => kt(E)); - return [...h() ? le(g) : g, ..._]; + function Me() { + const c = Object.keys(n().results[0].tally), g = c.filter((E) => !ke(E)), _ = c.filter((E) => ke(E)); + return [...h() ? zt(g) : g, ..._]; } - function Gt(c) { + function Pe(c) { const g = n().results[c - 1].tally, _ = []; - for (const A of Fe()) + for (const A of Me()) A in g && _.push({ label: A, value: Number(g[A]) }); - return ee(_, c), _; + return ht(_, c), _; } - function Mt(c) { + function Rn(c) { const g = n().results[c - 1].tally, _ = []; - for (const A of Fe()) + for (const A of Me()) _.push({ label: A, value: Number(g[A] ?? 0) }); - return ee(_, c), _; + return ht(_, c), _; } - function Cn(c, g) { + function pn(c, g) { const _ = []; for (const A of c) { if (A.label === "exhausted" || A.isTransfer) { @@ -5030,206 +5036,224 @@ function wl(e, t) { } return _; } - function pn() { - const c = fe(x(ie)).select("defs").select("#cross-hatch"); + function Ht() { + const c = ct(x(it)).select("defs").select("#cross-hatch"); let g = 0; for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Oe[_] = zd[g] : Oe[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Oe[_] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? Ot[_] = Hd[g] : Ot[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ot[_] = u()[g % u().length], g++; { const E = c.clone(!0); - E.attr("id", ft(_)).select("rect").attr("fill", Oe[_]), E.selectAll("circle").attr("fill", "#383838"); + E.attr("id", ue(_)).select("rect").attr("fill", Ot[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Oe.exhausted = ae, Oe["Inactive Ballots"] = ae; + Ot.exhausted = at, Ot["Inactive Ballots"] = at; } - function He() { - fe(x(ie)).select("#" + L).remove(); + function De() { + ct(x(it)).select("#" + L).remove(); } - function Qe(c, g) { - const _ = xi("global").duration(oe); + function Ft(c, g) { + const _ = xi("global").duration(ot); g && _.on("end", g); - const A = Cn(te, c), T = as().sort(null).value((P) => P.value)(A); - ia(c, S, T, 0, ge()), ia(c, I, T, 0, ge(), !0), te = A, me = T, He(), Al(c), kl(), Pl(0, ge()), Er(); - } - function Me(c, g) { - const _ = xi("global").duration(oe); - g && _.on("end", g), El(c); - } - function et(c, g) { - const _ = xi("global").duration(oe); - g && _.on("end", g), bl(c), $l(ge(), Nt()); - } - let xe = !1, tt = []; - function Ie() { - Er(), xe = !1, tt.length === 0 && r() < n().results.length && !B(r()) && yt(r() + 1), ct(); + const A = pn(et, c), T = as().sort(null).value((P) => P.value)(A); + sa(c, S, T, 0, _t()), sa(c, I, T, 0, _t(), !0), et = A, yt = T, De(), El(c), Ml(), Dl(0, _t()), Er(); + } + function fe(c, g) { + const _ = xi("global").duration(ot); + g && _.on("end", g), Tl(c); + } + function ye(c, g) { + const _ = xi("global").duration(ot); + g && _.on("end", g), $l(c), Al(_t(), Ne()); + } + let bt = !1, te = []; + function mt() { + if (Er(), bt = !1, te.length === 0 && r() < n().results.length && !H(r())) { + const c = Z(r()); + Zt(c); + } + ce(); } - function ct() { - if (tt.length === 0) { - _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), Pt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), Ze(r()))); + function ce() { + if (te.length === 0) { + ft !== r() && (r() === ft + 1 && ft > 0 && r() <= n().results.length ? (ft = r(), Cn(r())) : r() >= 1 && r() <= n().results.length && (ft = r(), d(0), Qt(r()))); return; } - const c = tt.shift(); + const c = te.shift(); switch (c.type) { case "round": { const g = c.round; - g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, Pt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), Ze(g)), ct()); + g === ft + 1 && ft > 0 && g <= n().results.length ? (ft = g, Cn(g)) : (g !== ft && g >= 1 && g <= n().results.length && (ft = g, d(0), Qt(g)), ce()); break; } case "step": - ei(); + Zs(); break; } } - function Pt(c) { + function Cn(c) { if (c <= 1 || c > n().results.length) { - ct(); + ce(); + return; + } + if (bt = !0, q = c, d(0), !H(q - 1)) { + const g = Z(q - 1); + g > q && (q = g, Zt(q)), mt(); return; } - xe = !0, Y = c, d(0), Qe(Y - 1, () => { - d(1), Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + Ft(q - 1, () => { + d(1), fe(q - 1, () => { + d(2), ye(q, () => { + d(0), mt(); }); }); }); } - function Zn() { - xe || (xe = !0, Y = r(), Rn()); + function $r() { + bt || (bt = !0, q = r(), Sn()); } - function Rn() { + function Sn() { if (d( 0 // if in the middle of "one small step" animation, reset to 0. - ), tt.length > 0) { - Ie(); + ), te.length > 0) { + mt(); return; } - if (!B(Y)) { - Y++, yt(Y), Ze(Y), Y < n().results.length ? Rn() : (d(0), Ie()); + if (!H(q)) { + q = Z(q), Zt(q), Qt(q), q < n().results.length ? Sn() : (d(0), mt()); return; } - const c = Y < n().results.length - 1 ? Rn : () => { - d(0), Ie(); + const c = q < n().results.length - 1 ? Sn : () => { + d(0), mt(); }; - Qe(Y, () => { - d(1), Me(Y, () => { - d(2), Y++, yt(Y), et(Y, c); + Ft(q, () => { + d(1), fe(q, () => { + d(2), q++, Zt(q), ye(q, c); }); }); } Is(() => { - $r(); + Ke(); }); - let _e = 0; - function $r() { - if (_e != r()) { - if (xe) { - tt.push({ type: "round", round: r() }); + let ft = 0; + function Ke() { + if (ft != r()) { + if (bt) { + te.push({ type: "round", round: r() }); return; } - _e == r() - 1 && _e > 0 ? jt() : Kt(r()), _e = r(); + if (ft == r() - 1 && ft > 0) { + if (!H(ft)) { + const c = Z(ft); + ft = c, r(c + 1), ti(), Zt(r()); + return; + } + ti(); + } else + je(r()); + ft = r(); } } - function Kt(c) { - if (xe) { - tt.push({ type: "round", round: c }); + function je(c) { + if (bt) { + te.push({ type: "round", round: c }); return; } - d(0), Ze(c); + d(0), Qt(c); } - function jt() { - if (xe) { - tt.push({ type: "round", round: r() }); + function ti() { + if (bt) { + te.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (Y = r(), Y > n().results.length) { - Er(), xe = !1; + if (q = r(), q > n().results.length) { + Er(), bt = !1; return; } - xe = !0, d() === 0 ? Qe(Y - 1, () => { - d(1), Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + bt = !0, d() === 0 ? Ft(q - 1, () => { + d(1), fe(q - 1, () => { + d(2), ye(q, () => { + d(0), mt(); }); }); - }) : d() === 1 ? Me(Y - 1, () => { - d(2), et(Y, () => { - d(0), Ie(); + }) : d() === 1 ? fe(q - 1, () => { + d(2), ye(q, () => { + d(0), mt(); }); - }) : d() === 2 && et(Y, () => { - d(0), Ie(); + }) : d() === 2 && ye(q, () => { + d(0), mt(); }); } - function ei() { + function Zs() { if (r() > n().results.length) { - Er(), xe = !1; + Er(), bt = !1; return; } - if (xe) { - tt.push({ type: "step" }); + if (bt) { + te.push({ type: "step" }); return; } - xe = !0, Y = r(), d() === 0 ? Qe(Y, () => { - d(1), Ie(); - }) : d() === 1 ? Me(Y, () => { - d(2), Ie(); - }) : d() === 2 ? (Y++, yt(Y), et(Y, () => { - d(0), Ie(); - })) : (xe = !1, console.warn("displayPhase out of range at ", d())); - } - function bl(c) { - te = Mt(c), me = na(c, S, te, 0, ge(), !0), na(c, I, te, 0, ge(), !1, !0); - } - function $l(c, g) { - const _ = fe(x(ie)).select("#" + L), E = fe(x(ie)).select("#" + S), T = {}; - for (const N of me) { + bt = !0, q = r(), d() === 0 ? Ft(q, () => { + d(1), mt(); + }) : d() === 1 ? fe(q, () => { + d(2), mt(); + }) : d() === 2 ? (q++, Zt(q), ye(q, () => { + d(0), mt(); + })) : (bt = !1, console.warn("displayPhase out of range at ", d())); + } + function $l(c) { + et = Rn(c), yt = ra(c, S, et, 0, _t(), !0), ra(c, I, et, 0, _t(), !1, !0); + } + function Al(c, g) { + const _ = ct(x(it)).select("#" + L), E = ct(x(it)).select("#" + S), T = {}; + for (const N of yt) { const k = N.data.label; if (N.data.isTransfer) continue; - const C = E.select("#" + CSS.escape(y(N.data))); - C.empty() || (T[k] = { - oldStart: Number(C.attr("prevStart")), - oldEnd: Number(C.attr("prevEnd")), + const R = E.select("#" + CSS.escape(y(N.data))); + R.empty() || (T[k] = { + oldStart: Number(R.attr("prevStart")), + oldEnd: Number(R.attr("prevEnd")), newStart: N.startAngle, newEnd: N.endAngle }); } const P = _.selectAll(".slice"); - let z = P.size(); - function q() { - z--, z === 0 && Ml(); + let Y = P.size(); + function V() { + Y--, Y === 0 && Pl(); } P.select("path").transition("global").duration(G).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, Pe = T[N.data.label]; - let Z, Ye; - if (Pe) { - const Qn = (Pe.oldStart + Pe.oldEnd) / 2, Il = (Pe.newStart + Pe.newEnd) / 2, Ll = k - Qn; - Z = Il + Ll, Ye = Z + R; + const k = N.startAngle, R = N.endAngle, C = R - k, Pt = T[N.data.label]; + let Q, Yt; + if (Pt) { + const Qn = (Pt.oldStart + Pt.oldEnd) / 2, Ll = (Pt.newStart + Pt.newEnd) / 2, ql = k - Qn; + Q = Ll + ql, Yt = Q + C; } else - Z = k, Ye = C; - const ne = Zt(k, Z), Ee = Zt(C, Ye), ni = Zt(g, c), Tr = wt(); + Q = k, Yt = R; + const nt = Ze(k, Q), Tt = Ze(R, Yt), ni = Ze(g, c), Tr = we(); return function(Qn) { - return Tr.innerRadius(Math.min(ni(Qn), c) - 1).outerRadius(ni(Qn)).startAngle(ne(Qn)).endAngle(Ee(Qn)), Tr(N); + return Tr.innerRadius(Math.min(ni(Qn), c) - 1).outerRadius(ni(Qn)).startAngle(nt(Qn)).endAngle(Tt(Qn)), Tr(N); }; - }).on("end", (N) => q()); + }).on("end", (N) => V()); } - function Al(c) { - const g = Cl(c, me); - ye = ta(c, L, g, D, M, ge(), Nt(), !1, !0); - const _ = fe(x(ie)); + function El(c) { + const g = Cl(c, yt); + wt = na(c, L, g, D, M, _t(), Ne(), !1, !0); + const _ = ct(x(it)); _.select("#" + S).raise(), _.select("#" + I).raise(); } - function El(c) { - const g = Sl(c, ye, me); - ye = sa(c, L, g, ge(), Nt(), !1); + function Tl(c) { + const g = Nl(c, wt, yt); + wt = aa(c, L, g, _t(), Ne(), !1); } function Ar(c) { - return Oe[c.data.label]; + return Ot[c.data.label]; } - function Tl(c) { + function Rl(c) { const g = {}, _ = n().results[c - 1].tallyResults; for (let A = 0; A < _.length; A++) { let E = _[A].eliminated; @@ -5242,40 +5266,40 @@ function wl(e, t) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [P, z] of Object.entries(T)) - g[P] === void 0 ? g[P] = Number(z) : g[P] += Number(z); + for (let [P, Y] of Object.entries(T)) + g[P] === void 0 ? g[P] = Number(Y) : g[P] += Number(Y); } return g; } function Cl(c, g) { - const _ = [], A = ke, E = n().results[c - 1].tallyResults; + const _ = [], A = Mt, E = n().results[c - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const z = E[T].transfers; - if (z === void 0) { + const Y = E[T].transfers; + if (Y === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = g.find((k) => k.data.label == P && k.data.isTransfer); - q === void 0 && (q = g.find((k) => k.data.label == P && !k.data.isTransfer)); + let V = g.find((k) => k.data.label == P && k.data.isTransfer); + V === void 0 && (V = g.find((k) => k.data.label == P && !k.data.isTransfer)); let N = 0; - if (q) N = q.startAngle; + if (V) N = V.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, C] of Object.entries(z)) { - let R; - const Pe = g.find((ne) => ne.data.label == k); - if (Pe) - R = structuredClone(Pe); + for (let [k, R] of Object.entries(Y)) { + let C; + const Pt = g.find((nt) => nt.data.label == k); + if (Pt) + C = structuredClone(Pt); else if (k == "exhausted") - R = { - data: { label: k, value: Number(C) }, + C = { + data: { label: k, value: Number(R) }, value: 0, index: 0, startAngle: 0, @@ -5288,13 +5312,13 @@ function wl(e, t) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Ye = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Ye, R.index = T, R.data.transferIndex = T, _.push(R); + const Yt = Number(R) / A * 2 * Math.PI; + C.startAngle = N, N = C.endAngle = N + Yt, C.index = T, C.data.transferIndex = T, _.push(C); } } return _; } - function Rl(c, g, _) { + function Sl(c, g, _) { const A = {}; for (let [E, T] of Object.entries(c)) { const P = _.find((N) => E == N.data.label); @@ -5302,152 +5326,152 @@ function wl(e, t) { E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const z = (P.startAngle + P.endAngle) / 2, q = c[P.data.label] / g * 2 * Math.PI; - A[P.data.label] = z - q / 2; + const Y = (P.startAngle + P.endAngle) / 2, V = c[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = Y - V / 2; } return A; } - function Sl(c, g, _) { - const A = [], E = ke, T = Tl(c), P = Rl(T, E, _); - for (let [z, q] of g.entries()) { - const N = structuredClone(q), k = q.endAngle - q.startAngle, C = _.find((R) => q.data.label === R.data.label && !R.data.isTransfer); - if (C) { - const R = C.data.label; - N.startAngle = P[R], P[R] += k, N.endAngle = N.startAngle + k; - } else if (q.data.label === "exhausted") - N.startAngle = q.startAngle, N.endAngle = q.endAngle; + function Nl(c, g, _) { + const A = [], E = Mt, T = Rl(c), P = Sl(T, E, _); + for (let [Y, V] of g.entries()) { + const N = structuredClone(V), k = V.endAngle - V.startAngle, R = _.find((C) => V.data.label === C.data.label && !C.data.isTransfer); + if (R) { + const C = R.data.label; + N.startAngle = P[C], P[C] += k, N.endAngle = N.startAngle + k; + } else if (V.data.label === "exhausted") + N.startAngle = V.startAngle, N.endAngle = V.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); continue; } - N.index = z, A.push(N); + N.index = Y, A.push(N); } return A; } - function Zs(c, g, _, A) { - const E = wt().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + function Qs(c, g, _, A) { + const E = we().innerRadius(_ * tt).outerRadius(_ * tt), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], Y = A.append("g").attr("opacity", 0); for (const k of T) { - const C = k.data.label === "exhausted" ? St : k.data.label, R = E.centroid(k), Pe = ti(k.startAngle, k.endAngle), Z = Jr(k.data.label, c); - let Ye; - !p() && kt(k.data.label) ? Ye = Z : Ye = Z + " (" + Zr(k.data.label, c) + ")"; - const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pe).text(C); - ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Ye); - const Ee = ne.node().getBBox(); + const R = k.data.label === "exhausted" ? Se : k.data.label, C = E.centroid(k), Pt = ei(k.startAngle, k.endAngle), Q = Jr(k.data.label, c); + let Yt; + !p() && ke(k.data.label) ? Yt = Q : Yt = Q + " (" + Zr(k.data.label, c) + ")"; + const nt = Y.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pt).text(R); + nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Yt); + const Tt = nt.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Ee.x + R[0], Ee.y + R[1], Ee.width, Ee.height) + bbox: new DOMRect(Tt.x + C[0], Tt.y + C[1], Tt.width, Tt.height) }); } - z.remove(), P.sort((k, C) => C.value - k.value); - const q = [], N = /* @__PURE__ */ new Set(); + Y.remove(), P.sort((k, R) => R.value - k.value); + const V = [], N = /* @__PURE__ */ new Set(); for (const k of P) - q.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), q.push(k.bbox)); + V.some((C) => k.bbox.left < C.right && k.bbox.right > C.left && k.bbox.top < C.bottom && k.bbox.bottom > C.top) || (N.add(k.label), V.push(k.bbox)); return N; } - function Qs(c, g, _, A, E, T) { - const z = fe(x(ie)).append("g").attr("id", U).attr("transform", `translate(${_}, ${A})`), q = wt().innerRadius(E * Q).outerRadius(E * Q), N = Zs(c, g, E, z); - z.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { - C.data.label === "exhausted" && fe(this).on("mouseenter", (Pe, Z) => Dl(Pe)).on("mouseleave", (Pe, Z) => Ol()); - }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ti(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? St : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = Jr(C.data.label, c); - return !p() && kt(C.data.label) ? R : R + " (" + Zr(C.data.label, c) + ")"; + function ta(c, g, _, A, E, T) { + const Y = ct(x(it)).append("g").attr("id", U).attr("transform", `translate(${_}, ${A})`), V = we().innerRadius(E * tt).outerRadius(E * tt), N = Qs(c, g, E, Y); + Y.selectAll("text").data(g).enter().each(function(k) { + !k.data.isTransfer && N.has(k.data.label) && ct(this).append("g").attr("id", (R) => y(R.data)).classed("eliminated", (R) => T.includes(R.data.label) || R.data.isTransfer === !0).each(function(R, C) { + R.data.label === "exhausted" && ct(this).on("mouseenter", (Pt, Q) => Ol(Pt)).on("mouseleave", (Pt, Q) => Fl()); + }).append("text").attr("transform", (R) => `translate(${V.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).text((R) => R.data.label === "exhausted" ? Se : R.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((R) => { + const C = Jr(R.data.label, c); + return !p() && ke(R.data.label) ? C : C + " (" + Zr(R.data.label, c) + ")"; }); }); } - function Nl(c, g, _, A) { - const T = fe(x(ie)).select("#" + U), P = Zs(c, g, _, T); - T.selectAll("g").each(function(R) { - R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); + function kl(c, g, _, A) { + const T = ct(x(it)).select("#" + U), P = Qs(c, g, _, T); + T.selectAll("g").each(function(C) { + C && C.data && !C.data.isTransfer && !P.has(C.data.label) && ct(this).remove(); }); - const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = wt().innerRadius(_ * Q).outerRadius(_ * Q + 1); - z.transition("global").duration(G).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(G).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)).on("end", (R) => C()); - let k = q.size(); - function C(R) { - k--, k === 0 && (T.remove(), Qs(c, g, D, M, _, A)); + const Y = T.selectAll("tspan"), V = T.selectAll("g").data(g, (C) => y(C.data)).classed("eliminated", (C) => A.includes(C.data.label) || C.data.isTransfer === !0), N = we().innerRadius(_ * tt).outerRadius(_ * tt + 1); + Y.transition("global").duration(G).attr("transform", (C) => `translate(${N.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)), V.select("text").transition("global").duration(G).attr("transform", (C) => `translate(${N.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).on("end", (C) => R()); + let k = V.size(); + function R(C) { + k--, k === 0 && (T.remove(), ta(c, g, D, M, _, A)); } } - function ea(c, g, _, A, E, T, P, z = !0, q = !1, N = !1) { - const C = as().sort(null).value((R) => R.value)(_); - return ta(c, g, C, A, E, T, P, z, q, N), C; + function ea(c, g, _, A, E, T, P, Y = !0, V = !1, N = !1) { + const R = as().sort(null).value((C) => C.value)(_); + return na(c, g, R, A, E, T, P, Y, V, N), R; } function Er() { - fe(x(ie)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Ne}px`); - } - function ta(c, g, _, A, E, T, P, z, q, N = !1) { - const k = dn(c), C = br(c), Z = fe(x(ie)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (ne) => k.includes(ne.data.label) || ne.data.isTransfer === !0).classed("elected", (ne) => C.includes(ne.data.label) && !ne.data.isTransfer).attr("id", (ne) => y(ne.data)); - N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (ne, Ee) => Zi(ne, Ee)).on("mouseleave", (ne, Ee) => Qi(ne, Ee)); - const Ye = wt().outerRadius(P).innerRadius(T); - if (q) { - const ne = wt().outerRadius(T + 1).innerRadius(T); - Z.append("path").attr("d", ne).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ee) => Ar(Ee)).transition("global").duration(G).attr("d", (Ee) => Ye(Ee)).on("end", (Ee) => { + ct(x(it)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${kt}px`); + } + function na(c, g, _, A, E, T, P, Y, V, N = !1) { + const k = dn(c), R = br(c), Q = ct(x(it)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => R.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => y(nt.data)); + N ? Q.style("pointer-events", "none") : Q.on("mouseenter", (nt, Tt) => Zi(nt, Tt)).on("mouseleave", (nt, Tt) => Qi(nt, Tt)); + const Yt = we().outerRadius(P).innerRadius(T); + if (V) { + const nt = we().outerRadius(T + 1).innerRadius(T); + Q.append("path").attr("d", nt).attr("stroke", N ? "none" : T === 0 ? ut : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Tt) => Ar(Tt)).transition("global").duration(G).attr("d", (Tt) => Yt(Tt)).on("end", (Tt) => { N || Ji(); }); } else - Z.append("path").attr("d", (ne) => Ye(ne)).attr("fill", N ? "none" : (ne) => Ar(ne)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || Ji(); - return z && !N && Qs(c, _, A, E, P, k), _; + Q.append("path").attr("d", (nt) => Yt(nt)).attr("fill", N ? "none" : (nt) => Ar(nt)).attr("stroke", N ? "none" : ut).attr("stroke-width", N ? 0 : O), N || Ji(); + return Y && !N && ta(c, _, A, E, P, k), _; } - function kl() { - const _ = fe(x(ie)).select("#" + U).selectAll(".eliminated"); + function Ml() { + const _ = ct(x(it)).select("#" + U).selectAll(".eliminated"); _.size() > 0 && _.classed("finished", !0); } - function Ml() { - const _ = fe(x(ie)).select("#" + U).selectAll(".finished"); + function Pl() { + const _ = ct(x(it)).select("#" + U).selectAll(".finished"); _.size() > 0 && _.remove(); } - function Pl(c, g) { - const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = wt().innerRadius(c), P = wt().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(G).attrTween("d", function(z) { - const q = Zt(g, c); + function Dl(c, g) { + const E = ct(x(it)).select("#" + S).selectAll(".eliminated"), T = we().innerRadius(c), P = we().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(G).attrTween("d", function(Y) { + const V = Ze(g, c); return function(N) { - return P.innerRadius(q(N)), P(z); + return P.innerRadius(V(N)), P(Y); }; - }).attr("fill", (z) => `url(#${ft(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(z) { - const q = Zt(g, c); + }).attr("fill", (Y) => `url(#${ue(Y.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(Y) { + const V = Ze(g, c); return function(N) { - return T.outerRadius(q(N)), T(z); + return T.outerRadius(V(N)), T(Y); }; - }).attr("fill", (z) => Ar(z)); + }).attr("fill", (Y) => Ar(Y)); } - function ti(c, g) { + function ei(c, g) { const _ = (c + g) / 2; return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; } function Ji() { - fe(x( - ie + ct(x( + it // force redisplay of text labels )).select("#" + U).raise().append("g").remove(); } - function na(c, g, _, A, E, T, P = !1) { - const q = as().sort(null).value((N) => N.value)(_); - return sa(c, g, q, A, E, T, P), q; + function ra(c, g, _, A, E, T, P = !1) { + const V = as().sort(null).value((N) => N.value)(_); + return aa(c, g, V, A, E, T, P), V; } - function ra(c, g, _, A, E = !1) { - const T = dn(c), P = br(c), N = fe(x(ie)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); + function ia(c, g, _, A, E = !1) { + const T = dn(c), P = br(c), N = ct(x(it)).select("#" + g).selectAll(".slice").data(_, (R) => y(R.data)); N.exit().remove(); - const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; - } - function ia(c, g, _, A, E, T = !1) { - const P = wt().outerRadius(E).innerRadius(A); - ra(c, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); - } - function sa(c, g, _, A, E, T, P = !1) { - const z = wt().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = wt().outerRadius(E).innerRadius(A); - fe(x(ie)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); - const C = ra(c, g, _, q, P); - let R = C.size(); - function Pe() { - R--, R <= 0 && (P || Ji()); + const k = N.enter().append("g").attr("class", "slice").attr("id", (R) => y(R.data)).classed("eliminated", !0); + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (R, C) => Zi(R, C)).on("mouseleave", (R, C) => Qi(R, C)), k.append("path").attr("d", (R) => A(R)).attr("fill", E ? "none" : (R) => Ar(R)).attr("stroke", E ? "none" : ut).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => P.includes(R.data.label)), E || N.on("mouseenter", (R, C) => Zi(R, C)).on("mouseleave", (R, C) => Qi(R, C)), N; + } + function sa(c, g, _, A, E, T = !1) { + const P = we().outerRadius(E).innerRadius(A); + ia(c, g, _, P, T).select("path").attr("d", (V) => P(V)).attr("fill", T ? "none" : (V) => Ar(V)); + } + function aa(c, g, _, A, E, T, P = !1) { + const Y = we().outerRadius(E).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), V = we().outerRadius(E).innerRadius(A); + ct(x(it)).select("#" + g).selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); + const R = ia(c, g, _, V, P); + let C = R.size(); + function Pt() { + C--, C <= 0 && (P || Ji()); } - return C.select("path").transition("global").duration(G).attrTween("d", function(Z) { - const Ye = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ee = Zt(Ye, Z.startAngle), ni = Zt(ne, Z.endAngle); - return (Tr) => (z.startAngle(Ee(Tr)).endAngle(ni(Tr)), z(Z)); - }).on("end", function(Z) { - Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), Pe(); - }), T && !P && Nl(c, _, E, dn(c)), _; + return R.select("path").transition("global").duration(G).attrTween("d", function(Q) { + const Yt = Number(ct(this.parentNode).attr("prevStart")), nt = Number(ct(this.parentNode).attr("prevEnd")), Tt = Ze(Yt, Q.startAngle), ni = Ze(nt, Q.endAngle); + return (Tr) => (Y.startAngle(Tt(Tr)).endAngle(ni(Tr)), Y(Q)); + }).on("end", function(Q) { + Q.startAngle === Q.endAngle && ct(this).attr("stroke", "none"), Pt(); + }), T && !P && kl(c, _, E, dn(c)), _; } function Zi(c, g) { s(g.data.label), i("enter"), a(c.clientX), o(c.clientY); @@ -5455,98 +5479,98 @@ function wl(e, t) { function Qi(c, g) { s(g.data.label), i("leave"); } - function Dl(c, g) { + function Ol(c, g) { i("show-exhausted"), a(c.clientX), o(c.clientY); } - function Ol(c, g) { + function Fl(c, g) { i("hide-exhausted"); } - var Fl = { - pieColors: Oe, - exhaustedLabel: St, - countExhaustedVotes: Ut, + var Il = { + pieColors: Ot, + exhaustedLabel: Se, + countExhaustedVotes: Ge, getEliminatedCandidates: dn, getElectedCandidates: br, - runFullAnimationFn: Zn, - animateOnePhaseFn: ei, + runFullAnimationFn: $r, + animateOnePhaseFn: Zs, get jsonData() { return n(); }, set jsonData(c) { - n(c), re(); + n(c), rt(); }, get currentRound() { return r(); }, set currentRound(c = 1) { - r(c), re(); + r(c), rt(); }, get mouseEventType() { return i(); }, set mouseEventType(c) { - i(c), re(); + i(c), rt(); }, get mouseData() { return s(); }, set mouseData(c) { - s(c), re(); + s(c), rt(); }, get mouseX() { return a(); }, set mouseX(c) { - a(c), re(); + a(c), rt(); }, get mouseY() { return o(); }, set mouseY(c) { - o(c), re(); + o(c), rt(); }, get requestRoundChange() { return l(); }, set requestRoundChange(c = (g) => { }) { - l(c), re(); + l(c), rt(); }, get candidateColors() { return u(); }, set candidateColors(c = []) { - u(c), re(); + u(c), rt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, set excludeFinalWinnerAndEliminatedCandidate(c = !1) { - f(c), re(); + f(c), rt(); }, get firstRoundDeterminesPercentages() { return p(); }, set firstRoundDeterminesPercentages(c = !1) { - p(c), re(); + p(c), rt(); }, get randomizeOrder() { return h(); }, set randomizeOrder(c = !1) { - h(c), re(); + h(c), rt(); }, get displayPhase() { return d(); }, set displayPhase(c = 0) { - d(c), re(); + d(c), rt(); } - }, aa = ep(); - return gi(aa, (c) => he(ie, c), () => x(ie)), Ue(e, aa), Hi(Fl); + }, oa = ep(); + return gi(oa, (c) => pt(it, c), () => x(it)), Ut(t, oa), Hi(Il); } Ys( - wl, + xl, { jsonData: {}, currentRound: {}, @@ -5573,14 +5597,14 @@ Ys( ], { mode: "open" } ); -var np = /* @__PURE__ */ Xt("
"), rp = /* @__PURE__ */ Xt('
', 1), ip = /* @__PURE__ */ Xt('
'); -const sp = { +var rp = /* @__PURE__ */ We("
"), ip = /* @__PURE__ */ We('
', 1), sp = /* @__PURE__ */ We('
'); +const ap = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function xl(e, t) { - zi(t, !0), Hs(e, sp); - let n = se(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = se(t, "currentStep", 7, 0), i = se(t, "disabled", 7, !1), s = se(t, "onAdvance", 7, () => { +function bl(t, e) { + zi(e, !0), Hs(t, ap); + let n = st(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = st(e, "currentStep", 7, 0), i = st(e, "disabled", 7, !1), s = st(e, "onAdvance", 7, () => { }); function a() { i() || s()(); @@ -5593,47 +5617,47 @@ function xl(e, t) { return n(); }, set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { - n(p), re(); + n(p), rt(); }, get currentStep() { return r(); }, set currentStep(p = 0) { - r(p), re(); + r(p), rt(); }, get disabled() { return i(); }, set disabled(p = !1) { - i(p), re(); + i(p), rt(); }, get onAdvance() { return s(); }, set onAdvance(p = () => { }) { - s(p), re(); + s(p), rt(); } - }, u = ip(); + }, u = sp(); let f; return u.__click = a, u.__keydown = o, vi(u, 21, n, pi, (p, h, d) => { - var y = rp(), b = _n(y); + var y = ip(), b = _n(y); { var m = (U) => { - var ae = np(); - let Q; - Qt(() => Q = si(ae, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ue(U, ae); + var at = rp(); + let tt; + Qe(() => tt = si(at, 1, "connector svelte-1l4eyw0", null, tt, { completed: !i() && d <= r() })), Ut(U, at); }; - er(b, (U) => { + tr(b, (U) => { d > 0 && U(m); }); } - var $ = nt(b, 2), D = Xe($); + var $ = ee(b, 2), D = Xt($); let M; - var S = nt(D, 2); + var S = ee(D, 2); let I; - var L = Xe(S, !0); - Le(S), Le($), Qt(() => { + var L = Xt(S, !0); + It(S), It($), Qe(() => { M = si(D, 1, "dot svelte-1l4eyw0", null, M, { active: !i() && d === r(), completed: !i() && d < r() @@ -5641,15 +5665,15 @@ function xl(e, t) { active: !i() && d === r(), completed: !i() && d < r() }), mn(L, x(h)); - }), Ue(p, y); - }), Le(u), Qt(() => { - f = si(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); - }), Ue(e, u), Hi(l); -} -Uu(["click", "keydown"]); -Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var ap = /* @__PURE__ */ Xt(" ", 1), op = /* @__PURE__ */ Xt("About to eliminate: ", 1), lp = /* @__PURE__ */ Xt(" ", 1), up = /* @__PURE__ */ Xt(" ", 1), fp = /* @__PURE__ */ Xt('

', 1), cp = /* @__PURE__ */ Xt("
", 1), hp = /* @__PURE__ */ Xt('


these ballots have already been eliminated.
', 1); -const dp = { + }), Ut(p, y); + }), It(u), Qe(() => { + f = si(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ba(u, "tabindex", i() ? -1 : 0), ba(u, "aria-disabled", i()); + }), Ut(t, u), Hi(l); +} +Gu(["click", "keydown"]); +Ys(bl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var op = /* @__PURE__ */ We(" ", 1), lp = /* @__PURE__ */ We("About to eliminate: ", 1), up = /* @__PURE__ */ We(" ", 1), fp = /* @__PURE__ */ We(" ", 1), cp = /* @__PURE__ */ We('

', 1), hp = /* @__PURE__ */ We("
", 1), dp = /* @__PURE__ */ We('


these ballots have already been eliminated.
', 1); +const pp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5664,11 +5688,11 @@ const dp = { }` }; -function pp(e, t) { - zi(t, !0), Hs(e, dp); +function vp(t, e) { + zi(e, !0), Hs(t, pp); const n = 0.85; - let r = se(t, "electionSummary", 7), i = se(t, "currentRound", 7, 1), s = se(t, "requestRoundChange", 7, (w) => { - }), a = se(t, "candidateColors", 23, () => []), o = se(t, "textForWinner", 7, "elected"), l = se(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = se(t, "firstRoundDeterminesPercentages", 7, !1), f = se(t, "randomizeOrder", 7, !1), p = se(t, "showCaptions", 7, !1); + let r = st(e, "electionSummary", 7), i = st(e, "currentRound", 7, 1), s = st(e, "requestRoundChange", 7, (w) => { + }), a = st(e, "candidateColors", 23, () => []), o = st(e, "textForWinner", 7, "elected"), l = st(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = st(e, "firstRoundDeterminesPercentages", 7, !1), f = st(e, "randomizeOrder", 7, !1), p = st(e, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5687,39 +5711,39 @@ function pp(e, t) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ vn(() => h[o()] ?? h.elected), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(""), $ = /* @__PURE__ */ $e(Pn([])), D = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), S = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => U(r())); + let d = /* @__PURE__ */ vn(() => h[o()] ?? h.elected), y = /* @__PURE__ */ At(null), b = /* @__PURE__ */ At(null), m = /* @__PURE__ */ At(""), $ = /* @__PURE__ */ At(Dn([])), D = /* @__PURE__ */ At(""), M = /* @__PURE__ */ At(""), S = /* @__PURE__ */ At(0), I = /* @__PURE__ */ At(0), L = /* @__PURE__ */ vn(() => U(r())); function U(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (B) { - return console.error("Failed to parse JSON string:", B), {}; + } catch (H) { + return console.error("Failed to parse JSON string:", H), {}; } return w || {}; } - function ae(w) { + function at(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, B, ee) { - w.style.left = B + "px", w.style.top = ee + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const le = w.getBoundingClientRect(); - let Fe = B, Gt = ee + 20; - Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Gt + le.height > window.innerHeight - 12 && (Gt = ee - le.height - 12), w.style.left = Fe + "px", w.style.top = Gt + "px"; + function tt(w, H, Z) { + w.style.left = H + "px", w.style.top = Z + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const lt = w.getBoundingClientRect(); + let zt = H, Me = Z + 20; + zt + lt.width > window.innerWidth - 12 && (zt = window.innerWidth - lt.width - 12), zt < 12 && (zt = 12), Me + lt.height > window.innerHeight - 12 && (Me = Z - lt.height - 12), w.style.left = zt + "px", w.style.top = Me + "px"; }); } function G() { switch (x(D)) { case "enter": ((w) => { - var B = ru(w, 2); - he($, B[0], !0), he(m, B[1], !0); - })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); + var H = iu(w, 2); + pt($, H[0], !0), pt(m, H[1], !0); + })(ut(x(M), i())), x(y) && (tt(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); break; case "leave": - x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); + x(y) && (x(y).style.opacity = "0"), pt($, [], !0), pt(m, ""); break; case "show-exhausted": - x(b) && (Q(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); + x(b) && (tt(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); break; case "hide-exhausted": x(b) && (x(b).style.opacity = "0"); @@ -5732,159 +5756,159 @@ function pp(e, t) { } } Is(() => G()); - function oe(w, B) { - return w === 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; - } - function ue(w, B) { - const ee = [], pe = w === "exhausted" ? St() : w; - let we; - w === "exhausted" ? we = Y(1) : we = x(L).results[0].tally[w], ee.push(`${pe} started with ${we} votes.`); - for (let le = 1; le <= B; le++) { - le === B && (w === "exhausted" ? we = Y(B) : we = x(L).results[B - 1].tally[w], ee.push(`${pe} has ${we} votes at round ${B}.`)); - const Fe = x(L).results[le - 1].tallyResults, Gt = ye(le); - for (let Mt = 0; Mt < Fe.length; Mt++) { - const Cn = Fe[Mt].transfers, pn = Fe[Mt].eliminated, He = Fe[Mt].elected; - if (!Gt) { + function ot(w, H) { + return w === 1 ? H ? "vote was" : "vote will be" : H ? "votes were" : "votes will be"; + } + function ut(w, H) { + const Z = [], ht = w === "exhausted" ? Se() : w; + let xt; + w === "exhausted" ? xt = q(1) : xt = x(L).results[0].tally[w], Z.push(`${ht} started with ${xt} votes.`); + for (let lt = 1; lt <= H; lt++) { + lt === H && (w === "exhausted" ? xt = q(H) : xt = x(L).results[H - 1].tally[w], Z.push(`${ht} has ${xt} votes at round ${H}.`)); + const zt = x(L).results[lt - 1].tallyResults, Me = wt(lt); + for (let Pe = 0; Pe < zt.length; Pe++) { + const Rn = zt[Pe].transfers, pn = zt[Pe].eliminated, Ht = zt[Pe].elected; + if (!Me) { if (pn) - pn === w && ee.push(`${pe} will be eliminated on round ${le}.`); - else if (w === He && (ee.push(`${pe} ${x(d).event} on round ${le}.`), Cn)) - for (let [Me, et] of Object.entries(Cn)) - ee.push(`${et} ${oe(Number(et), le < B)} transferred to ${Me} on round ${le}.`); + pn === w && Z.push(`${ht} will be eliminated on round ${lt}.`); + else if (w === Ht && (Z.push(`${ht} ${x(d).event} on round ${lt}.`), Rn)) + for (let [Ft, fe] of Object.entries(Rn)) + Z.push(`${fe} ${ot(Number(fe), lt < H)} transferred to ${Ft} on round ${lt}.`); } - const Qe = pn || He; - if (Qe) { - const Me = Number(Cn[w]); - Me && ee.push(`${Me} ${oe(Me, le < B)} transferred from ${Qe} on round ${le}.`); + const De = pn || Ht; + if (De) { + const Ft = Number(Rn[w]); + Ft && Z.push(`${Ft} ${ot(Ft, lt < H)} transferred from ${De} on round ${lt}.`); } } } - return [ee, pe]; + return [Z, ht]; } function O() { let w = 0; - for (let B = 1; B <= x(L).results.length; B++) { - if (ye(B)) continue; - const ee = x(L).results[B - 1].tallyResults; - for (let pe = 0; pe < ee.length; pe++) - ee[pe].elected && w++; + for (let H = 1; H <= x(L).results.length; H++) { + if (wt(H)) continue; + const Z = x(L).results[H - 1].tallyResults; + for (let ht = 0; ht < Z.length; ht++) + Z[ht].elected && w++; } return w; } - let F, Ne = /* @__PURE__ */ $e(0); - function ft(w) { - var we; - return !((we = x(L)) != null && we.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((le) => le.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let F, kt = /* @__PURE__ */ At(0); + function ue(w) { + var xt; + return !((xt = x(L)) != null && xt.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((lt) => lt.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function me(w) { - var ee; - if (!((ee = x(L)) != null && ee.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; - const B = x(L).results[w - 1].tallyResults; - return B.length === 0 || B.every((pe) => Object.keys(pe.transfers).length === 0); + function yt(w) { + var Z; + if (!((Z = x(L)) != null && Z.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; + const H = x(L).results[w - 1].tallyResults; + return H.length === 0 || H.every((ht) => Object.keys(ht.transfers).length === 0); } - function ye(w) { + function wt(w) { return l() && x(L).results && w === x(L).results.length; } - function te(w) { - return ye(w) ? [] : F ? F.getEliminatedCandidates(w) : []; + function et(w) { + return wt(w) ? [] : F ? F.getEliminatedCandidates(w) : []; } - function ke(w) { - return ye(w) ? [] : F ? F.getElectedCandidates(w) : []; + function Mt(w) { + return wt(w) ? [] : F ? F.getElectedCandidates(w) : []; } - function Y(w) { + function q(w) { return F ? F.countExhaustedVotes(w) : 0; } - function Oe() { + function Ot() { F && F.animateOnePhaseFn && F.animateOnePhaseFn(); } - function St() { + function Se() { return F ? F.exhaustedLabel : ""; } - function ie() { + function it() { return F ? F.pieColors : {}; } - var Je = { + var Jt = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), re(); + r(w), rt(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), re(); + i(w), rt(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (B) => { + set requestRoundChange(w = (H) => { }) { - s(w), re(); + s(w), rt(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), re(); + a(w), rt(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), re(); + o(w), rt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), re(); + l(w), rt(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), re(); + u(w), rt(); }, get randomizeOrder() { return f(); }, set randomizeOrder(w = !1) { - f(w), re(); + f(w), rt(); }, get showCaptions() { return p(); }, set showCaptions(w = !1) { - p(w), re(); + p(w), rt(); } - }, yt = hp(), Ze = _n(yt), Tn = Xe(Ze); + }, Zt = dp(), Qt = _n(Zt), Tn = Xt(Qt); { - let w = /* @__PURE__ */ vn(() => ft(i())), B = /* @__PURE__ */ vn(() => me(i())); - xl(Tn, { + let w = /* @__PURE__ */ vn(() => ue(i())), H = /* @__PURE__ */ vn(() => yt(i())); + bl(Tn, { get labels() { return x(w); }, get currentStep() { - return x(Ne); + return x(kt); }, get disabled() { - return x(B); + return x(H); }, - onAdvance: Oe + onAdvance: Ot }); } - Le(Ze); - var ge = nt(Ze, 4), Nt = Xe(ge), Ut = Xe(Nt), jr = Xe(Ut); + It(Qt); + var _t = ee(Qt, 4), Ne = Xt(_t), Ge = Xt(Ne), jr = Xt(Ge); gi( - wl(jr, { + xl(jr, { get jsonData() { return x(L); }, get currentRound() { return i(); }, - requestRoundChange: ae, + requestRoundChange: at, get candidateColors() { return a(); }, @@ -5901,127 +5925,127 @@ function pp(e, t) { return x(D); }, set mouseEventType(w) { - he(D, w, !0); + pt(D, w, !0); }, get mouseData() { return x(M); }, set mouseData(w) { - he(M, w, !0); + pt(M, w, !0); }, get mouseX() { return x(S); }, set mouseX(w) { - he(S, w, !0); + pt(S, w, !0); }, get mouseY() { return x(I); }, set mouseY(w) { - he(I, w, !0); + pt(I, w, !0); }, get displayPhase() { - return x(Ne); + return x(kt); }, set displayPhase(w) { - he(Ne, w, !0); + pt(kt, w, !0); } }), (w) => F = w, () => F - ), Le(Ut), Le(Nt); - var Jr = nt(Nt, 2); + ), It(Ge), It(Ne); + var Jr = ee(Ne, 2); { var Zr = (w) => { - var B = fp(), ee = _n(B), pe = Xe(ee); - Le(ee); - var we = nt(ee, 2), le = Xe(we); + var H = cp(), Z = _n(H), ht = Xt(Z); + It(Z); + var xt = ee(Z, 2), lt = Xt(xt); { - var Fe = (He) => { - var Qe = op(), Me = nt(_n(Qe)); - vi(Me, 17, () => te(i()), pi, (et, xe, tt) => { - var Ie = ap(), ct = _n(Ie); - let Pt; - var Zn = Xe(ct, !0); - Le(ct); - var Rn = nt(ct, 2); + var zt = (Ht) => { + var De = lp(), Ft = ee(_n(De)); + vi(Ft, 17, () => et(i()), pi, (fe, ye, bt) => { + var te = op(), mt = _n(te); + let ce; + var Cn = Xt(mt, !0); + It(mt); + var $r = ee(mt, 2); { - var _e = (Kt) => { - var jt = ga(", "); - Ue(Kt, jt); - }, $r = /* @__PURE__ */ vn(() => tt < te(i()).length - 1); - er(Rn, (Kt) => { - x($r) && Kt(_e); + var Sn = (Ke) => { + var je = _a(", "); + Ut(Ke, je); + }, ft = /* @__PURE__ */ vn(() => bt < et(i()).length - 1); + tr($r, (Ke) => { + x(ft) && Ke(Sn); }); } - Qt( - (Kt) => { - Pt = wa(ct, "", Pt, Kt), mn(Zn, x(xe)); + Qe( + (Ke) => { + ce = xa(mt, "", ce, Ke), mn(Cn, x(ye)); }, - [() => ({ color: ie()[x(xe)] })] - ), Ue(et, Ie); - }), Ue(He, Qe); - }, Gt = /* @__PURE__ */ vn(() => te(i()).length > 0); - er(le, (He) => { - x(Gt) && He(Fe); + [() => ({ color: it()[x(ye)] })] + ), Ut(fe, te); + }), Ut(Ht, De); + }, Me = /* @__PURE__ */ vn(() => et(i()).length > 0); + tr(lt, (Ht) => { + x(Me) && Ht(zt); }); } - var Mt = nt(le, 2); + var Pe = ee(lt, 2); { - var Cn = (He) => { - var Qe = up(), Me = _n(Qe), et = nt(Me); - vi(et, 17, () => ke(i()), pi, (xe, tt, Ie) => { - var ct = lp(), Pt = _n(ct); - let Zn; - var Rn = Xe(Pt, !0); - Le(Pt); - var _e = nt(Pt, 2); + var Rn = (Ht) => { + var De = fp(), Ft = _n(De), fe = ee(Ft); + vi(fe, 17, () => Mt(i()), pi, (ye, bt, te) => { + var mt = up(), ce = _n(mt); + let Cn; + var $r = Xt(ce, !0); + It(ce); + var Sn = ee(ce, 2); { - var $r = (jt) => { - var ei = ga(", "); - Ue(jt, ei); - }, Kt = /* @__PURE__ */ vn(() => Ie < ke(i()).length - 1); - er(_e, (jt) => { - x(Kt) && jt($r); + var ft = (je) => { + var ti = _a(", "); + Ut(je, ti); + }, Ke = /* @__PURE__ */ vn(() => te < Mt(i()).length - 1); + tr(Sn, (je) => { + x(Ke) && je(ft); }); } - Qt( - (jt) => { - Zn = wa(Pt, "", Zn, jt), mn(Rn, x(tt)); + Qe( + (je) => { + Cn = xa(ce, "", Cn, je), mn($r, x(bt)); }, - [() => ({ color: ie()[x(tt)] })] - ), Ue(xe, ct); - }), Qt(() => mn(Me, `${x(d).caption ?? ""}: `)), Ue(He, Qe); - }, pn = /* @__PURE__ */ vn(() => ke(i()).length > 0); - er(Mt, (He) => { - x(pn) && He(Cn); + [() => ({ color: it()[x(bt)] })] + ), Ut(ye, mt); + }), Qe(() => mn(Ft, `${x(d).caption ?? ""}: `)), Ut(Ht, De); + }, pn = /* @__PURE__ */ vn(() => Mt(i()).length > 0); + tr(Pe, (Ht) => { + x(pn) && Ht(Rn); }); } - Le(we), Qt((He) => mn(pe, `${x(L).config.contest ?? ""}, ${He ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ue(w, B); + It(xt), Qe((Ht) => mn(ht, `${x(L).config.contest ?? ""}, ${Ht ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ut(w, H); }; - er(Jr, (w) => { + tr(Jr, (w) => { p() && w(Zr); }); } - Le(ge); - var Jn = nt(ge, 2), kt = Xe(Jn), ji = Xe(kt, !0); - Le(kt); - var Qr = nt(kt, 2); - vi(Qr, 17, () => x($), pi, (w, B) => { - var ee = cp(), pe = _n(ee), we = Xe(pe, !0); - Le(pe), us(2), Qt(() => mn(we, x(B))), Ue(w, ee); - }), Le(Jn), gi(Jn, (w) => he(y, w), () => x(y)); - var dn = nt(Jn, 2), br = Xe(dn); - return us(2), Le(dn), gi(dn, (w) => he(b, w), () => x(b)), Qt( + It(_t); + var Zn = ee(_t, 2), ke = Xt(Zn), ji = Xt(ke, !0); + It(ke); + var Qr = ee(ke, 2); + vi(Qr, 17, () => x($), pi, (w, H) => { + var Z = hp(), ht = _n(Z), xt = Xt(ht, !0); + It(ht), us(2), Qe(() => mn(xt, x(H))), Ut(w, Z); + }), It(Zn), gi(Zn, (w) => pt(y, w), () => x(y)); + var dn = ee(Zn, 2), br = Xt(dn); + return us(2), It(dn), gi(dn, (w) => pt(b, w), () => x(b)), Qe( (w) => { mn(ji, x(m)), mn(br, `"${w ?? ""}" means all the candidates ranked on `); }, - [St] - ), Ue(e, yt), Hi(Je); + [Se] + ), Ut(t, Zt), Hi(Jt); } customElements.define("pie-chart", Ys( - pp, + vp, { electionSummary: {}, currentRound: {}, From 76fbdc18fe8fd67f241f54e2c2bcdcfc7999bdc6 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 8 Apr 2026 16:52:55 -0700 Subject: [PATCH 04/10] Sync pie chart --- static/pie/pie-chart.es.js | 5673 ++++++++++++++++++------------------ 1 file changed, 2820 insertions(+), 2853 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 28ece1fb..1f2c0863 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,300 +1,300 @@ -var Vl = Object.defineProperty; -var la = (t) => { - throw TypeError(t); +var Ll = Object.defineProperty; +var oa = (e) => { + throw TypeError(e); }; -var zl = (t, e, n) => e in t ? Vl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var dt = (t, e, n) => zl(t, typeof e != "symbol" ? e + "" : e, n), ts = (t, e, n) => e.has(t) || la("Cannot " + n); -var v = (t, e, n) => (ts(t, e, "read from private field"), n ? n.call(t) : e.get(t)), B = (t, e, n) => e.has(t) ? la("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), z = (t, e, n, r) => (ts(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), $t = (t, e, n) => (ts(t, e, "access private method"), n); -var Ha; -typeof window < "u" && ((Ha = window.__svelte ?? (window.__svelte = {})).v ?? (Ha.v = /* @__PURE__ */ new Set())).add("5"); -const Hl = 1, Yl = 2, Wa = 4, Bl = 8, Xl = 16, Wl = 1, Ul = 4, Gl = 8, Kl = 16, jl = 1, Jl = 2, Ns = "[", Fi = "[!", ks = "]", fr = {}, Rt = Symbol(), Ua = "http://www.w3.org/1999/xhtml", os = !1; -var Ga = Array.isArray, Zl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, $i = Object.keys, Ai = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, Ql = Object.getOwnPropertyDescriptors, tu = Object.prototype, eu = Array.prototype, Ka = Object.getPrototypeOf, ua = Object.isExtensible; -const nu = () => { +var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var ce = (e, t, n) => ql(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || oa("Cannot " + n); +var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? oa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); +var za; +typeof window < "u" && ((za = window.__svelte ?? (window.__svelte = {})).v ?? (za.v = /* @__PURE__ */ new Set())).add("5"); +const Vl = 1, zl = 2, Xa = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Re = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; +var Ua = Array.isArray, jl = Array.prototype.indexOf, fr = Array.prototype.includes, Fi = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; +const eu = () => { }; -function ru(t) { - for (var e = 0; e < t.length; e++) - t[e](); +function tu(e) { + for (var t = 0; t < e.length; t++) + e[t](); } -function ja() { - var t, e, n = new Promise((r, i) => { - t = r, e = i; +function Ka() { + var e, t, n = new Promise((r, i) => { + e = r, t = i; }); - return { promise: n, resolve: t, reject: e }; + return { promise: n, resolve: e, reject: t }; } -function iu(t, e) { - if (Array.isArray(t)) - return t; - if (!(Symbol.iterator in t)) - return Array.from(t); +function nu(e, t) { + if (Array.isArray(e)) + return e; + if (!(Symbol.iterator in e)) + return Array.from(e); const n = []; - for (const r of t) - if (n.push(r), n.length === e) break; + for (const r of e) + if (n.push(r), n.length === t) break; return n; } -const St = 2, Fr = 4, Li = 8, Ja = 1 << 24, hn = 16, Re = 32, En = 64, Za = 128, ge = 512, Et = 1024, Nt = 2048, Te = 4096, se = 8192, ln = 16384, yr = 32768, hr = 65536, fa = 1 << 17, Qa = 1 << 18, Jn = 1 << 19, su = 1 << 20, an = 1 << 25, Un = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), to = Symbol("legacy props"), au = Symbol(""), Mn = new class extends Error { +const Ne = 2, Fr = 4, Ii = 8, ja = 1 << 24, hn = 16, At = 32, En = 64, Ja = 128, pt = 512, Ae = 1024, ke = 2048, $t = 4096, rt = 8192, ln = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, ru = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), iu = Symbol(""), kn = new class extends Error { constructor() { super(...arguments); - dt(this, "name", "StaleReactionError"); - dt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + ce(this, "name", "StaleReactionError"); + ce(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var Ya; -const ou = ((Ya = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ya.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; -function lu(t) { +var Ha; +const su = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, yr = 8; +function au(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function uu() { +function ou() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function fu(t, e, n) { +function lu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function cu(t) { +function uu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function hu() { +function fu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function du(t) { +function cu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function pu() { +function hu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function vu() { +function du() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function gu(t) { +function pu(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function _u() { +function vu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function mu() { +function gu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function yu() { +function _u() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function wu() { +function mu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function qi(t) { +function Li(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function xu() { +function yu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; -function on(t) { - j = t; +function on(e) { + j = e; } -let W; -function qt(t) { - if (t === null) - throw qi(), fr; - return W = t; +let X; +function qe(e) { + if (e === null) + throw Li(), ur; + return X = e; } -function Vi() { - return qt(/* @__PURE__ */ Be(W)); +function qi() { + return qe(/* @__PURE__ */ zt(X)); } -function It(t) { +function Ie(e) { if (j) { - if (/* @__PURE__ */ Be(W) !== null) - throw qi(), fr; - W = t; + if (/* @__PURE__ */ zt(X) !== null) + throw Li(), ur; + X = e; } } -function us(t = 1) { +function us(e = 1) { if (j) { - for (var e = t, n = W; e--; ) + for (var t = e, n = X; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Be(n); - W = n; + /* @__PURE__ */ zt(n); + X = n; } } -function Ei(t = !0) { - for (var e = 0, n = W; ; ) { - if (n.nodeType === wr) { +function Ai(e = !0) { + for (var t = 0, n = X; ; ) { + if (n.nodeType === yr) { var r = ( /** @type {Comment} */ n.data ); if (r === ks) { - if (e === 0) return n; - e -= 1; - } else (r === Ns || r === Fi || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); + if (t === 0) return n; + t -= 1; + } else (r === Ns || r === Oi || // "[1", "[2", etc. for if blocks + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Be(n) + /* @__PURE__ */ zt(n) ); - t && n.remove(), n = i; + e && n.remove(), n = i; } } -function eo(t) { - if (!t || t.nodeType !== wr) - throw qi(), fr; +function eo(e) { + if (!e || e.nodeType !== yr) + throw Li(), ur; return ( /** @type {Comment} */ - t.data + e.data ); } -function no(t) { - return t === this.v; +function to(e) { + return e === this.v; } -function bu(t, e) { - return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +function wu(e, t) { + return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function ro(t) { - return !bu(t, this.v); +function no(e) { + return !wu(e, this.v); } -let $u = !1, oe = null; -function dr(t) { - oe = t; +let xu = !1, st = null; +function hr(e) { + st = e; } -function zi(t, e = !1, n) { - oe = { - p: oe, +function Vi(e, t = !1, n) { + st = { + p: st, i: !1, c: null, e: null, - s: t, + s: e, x: null, l: null }; } -function Hi(t) { - var e = ( +function zi(e) { + var t = ( /** @type {ComponentContext} */ - oe - ), n = e.e; + st + ), n = t.e; if (n !== null) { - e.e = null; + t.e = null; for (var r of n) - So(r); + Ro(r); } - return t !== void 0 && (e.x = t), e.i = !0, oe = e.p, t ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ {}; } -function io() { +function ro() { return !0; } -let Pn = []; -function so() { - var t = Pn; - Pn = [], ru(t); +let Mn = []; +function io() { + var e = Mn; + Mn = [], tu(e); } -function xn(t) { - if (Pn.length === 0 && !Dr) { - var e = Pn; +function xn(e) { + if (Mn.length === 0 && !Dr) { + var t = Mn; queueMicrotask(() => { - e === Pn && so(); + t === Mn && io(); }); } - Pn.push(t); + Mn.push(e); } -function Au() { - for (; Pn.length > 0; ) - so(); +function bu() { + for (; Mn.length > 0; ) + io(); } -function ao(t) { - var e = J; - if (e === null) - return X.f |= wn, t; - if ((e.f & yr) === 0 && (e.f & Fr) === 0) - throw t; - pr(t, e); +function so(e) { + var t = J; + if (t === null) + return B.f |= wn, e; + if ((t.f & mr) === 0 && (t.f & Fr) === 0) + throw e; + dr(e, t); } -function pr(t, e) { - for (; e !== null; ) { - if ((e.f & Za) !== 0) { - if ((e.f & yr) === 0) - throw t; +function dr(e, t) { + for (; t !== null; ) { + if ((t.f & Ja) !== 0) { + if ((t.f & mr) === 0) + throw e; try { - e.b.error(t); + t.b.error(e); return; } catch (n) { - t = n; + e = n; } } - e = e.parent; + t = t.parent; } - throw t; + throw e; } -const Eu = -7169; -function vt(t, e) { - t.f = t.f & Eu | e; +const $u = -7169; +function de(e, t) { + e.f = e.f & $u | t; } -function Ps(t) { - (t.f & ge) !== 0 || t.deps === null ? vt(t, Et) : vt(t, Te); +function Ps(e) { + (e.f & pt) !== 0 || e.deps === null ? de(e, Ae) : de(e, $t); } -function oo(t) { - if (t !== null) - for (const e of t) - (e.f & St) === 0 || (e.f & Un) === 0 || (e.f ^= Un, oo( +function ao(e) { + if (e !== null) + for (const t of e) + (t.f & Ne) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( /** @type {Derived} */ - e.deps + t.deps )); } -function lo(t, e, n) { - (t.f & Nt) !== 0 ? e.add(t) : (t.f & Te) !== 0 && n.add(t), oo(t.deps), vt(t, Et); +function oo(e, t, n) { + (e.f & ke) !== 0 ? t.add(e) : (e.f & $t) !== 0 && n.add(e), ao(e.deps), de(e, Ae); } -const ri = /* @__PURE__ */ new Set(); -let K = null, Ct = null, Gt = [], Yi = null, fs = !1, Dr = !1; -var rr, ir, In, sr, Hr, Yr, Ln, tn, ar, Ye, cs, hs, uo; +const ni = /* @__PURE__ */ new Set(); +let K = null, Se = null, Ke = [], Hi = null, fs = !1, Dr = !1; +var nr, rr, Fn, ir, Hr, Yr, In, en, sr, Vt, cs, hs, lo; const Js = class Js { constructor() { - B(this, Ye); - dt(this, "committed", !1); + H(this, Vt); + ce(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - dt(this, "current", /* @__PURE__ */ new Map()); + ce(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - dt(this, "previous", /* @__PURE__ */ new Map()); + ce(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - B(this, rr, /* @__PURE__ */ new Set()); + H(this, nr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - B(this, ir, /* @__PURE__ */ new Set()); + H(this, rr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - B(this, In, 0); + H(this, Fn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - B(this, sr, 0); + H(this, ir, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - B(this, Hr, null); + H(this, Hr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - B(this, Yr, /* @__PURE__ */ new Set()); + H(this, Yr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - B(this, Ln, /* @__PURE__ */ new Set()); + H(this, In, /* @__PURE__ */ new Set()); /** * A map of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process`. @@ -302,54 +302,54 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - B(this, tn, /* @__PURE__ */ new Map()); - dt(this, "is_fork", !1); - B(this, ar, !1); + H(this, en, /* @__PURE__ */ new Map()); + ce(this, "is_fork", !1); + H(this, sr, !1); } is_deferred() { - return this.is_fork || v(this, sr) > 0; + return this.is_fork || v(this, ir) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(e) { - v(this, tn).has(e) || v(this, tn).set(e, { d: [], m: [] }); + skip_effect(t) { + v(this, en).has(t) || v(this, en).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(e) { - var n = v(this, tn).get(e); + unskip_effect(t) { + var n = v(this, en).get(t); if (n) { - v(this, tn).delete(e); + v(this, en).delete(t); for (var r of n.d) - vt(r, Nt), Ae(r); + de(r, ke), xt(r); for (r of n.m) - vt(r, Te), Ae(r); + de(r, $t), xt(r); } } /** * * @param {Effect[]} root_effects */ - process(e) { + process(t) { var i; - Gt = [], this.apply(); + Ke = [], this.apply(); var n = [], r = []; - for (const s of e) - $t(this, Ye, cs).call(this, s, n, r); + for (const s of t) + be(this, Vt, cs).call(this, s, n, r); if (this.is_deferred()) { - $t(this, Ye, hs).call(this, r), $t(this, Ye, hs).call(this, n); - for (const [s, a] of v(this, tn)) - po(s, a); + be(this, Vt, hs).call(this, r), be(this, Vt, hs).call(this, n); + for (const [s, a] of v(this, en)) + ho(s, a); } else { - for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, In) === 0 && $t(this, Ye, uo).call(this), K = null, ca(r), ca(n), (i = v(this, Hr)) == null || i.resolve(); + for (const s of v(this, nr)) s(); + v(this, nr).clear(), v(this, Fn) === 0 && be(this, Vt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); } - Ct = null; + Se = null; } /** * Associate a change to a given source with the current @@ -357,65 +357,65 @@ const Js = class Js { * @param {Source} source * @param {any} value */ - capture(e, n) { - n !== Rt && !this.previous.has(e) && this.previous.set(e, n), (e.f & wn) === 0 && (this.current.set(e, e.v), Ct == null || Ct.set(e, e.v)); + capture(t, n) { + n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); } activate() { K = this, this.apply(); } deactivate() { - K === this && (K = null, Ct = null); + K === this && (K = null, Se = null); } flush() { - if (this.activate(), Gt.length > 0) { - if (fo(), K !== null && K !== this) + if (this.activate(), Ke.length > 0) { + if (uo(), K !== null && K !== this) return; - } else v(this, In) === 0 && this.process([]); + } else v(this, Fn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, ir)) e(this); - v(this, ir).clear(); + for (const t of v(this, rr)) t(this); + v(this, rr).clear(); } /** * * @param {boolean} blocking */ - increment(e) { - z(this, In, v(this, In) + 1), e && z(this, sr, v(this, sr) + 1); + increment(t) { + V(this, Fn, v(this, Fn) + 1), t && V(this, ir, v(this, ir) + 1); } /** * * @param {boolean} blocking */ - decrement(e) { - z(this, In, v(this, In) - 1), e && z(this, sr, v(this, sr) - 1), !v(this, ar) && (z(this, ar, !0), xn(() => { - z(this, ar, !1), this.is_deferred() ? Gt.length > 0 && this.flush() : this.revive(); + decrement(t) { + V(this, Fn, v(this, Fn) - 1), t && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { + V(this, sr, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Yr)) - v(this, Ln).delete(e), vt(e, Nt), Ae(e); - for (const e of v(this, Ln)) - vt(e, Te), Ae(e); + for (const t of v(this, Yr)) + v(this, In).delete(t), de(t, ke), xt(t); + for (const t of v(this, In)) + de(t, $t), xt(t); this.flush(); } /** @param {() => void} fn */ - oncommit(e) { - v(this, rr).add(e); + oncommit(t) { + v(this, nr).add(t); } /** @param {(batch: Batch) => void} fn */ - ondiscard(e) { - v(this, ir).add(e); + ondiscard(t) { + v(this, rr).add(t); } settled() { - return (v(this, Hr) ?? z(this, Hr, ja())).promise; + return (v(this, Hr) ?? V(this, Hr, Ka())).promise; } static ensure() { if (K === null) { - const e = K = new Js(); - ri.add(K), Dr || xn(() => { - K === e && e.flush(); + const t = K = new Js(); + ni.add(K), Dr || xn(() => { + K === t && t.flush(); }); } return K; @@ -423,19 +423,19 @@ const Js = class Js { apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), In = new WeakMap(), sr = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), Ln = new WeakMap(), tn = new WeakMap(), ar = new WeakMap(), Ye = new WeakSet(), /** +nr = new WeakMap(), rr = new WeakMap(), Fn = new WeakMap(), ir = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), In = new WeakMap(), en = new WeakMap(), sr = new WeakMap(), Vt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -cs = function(e, n, r) { - e.f ^= Et; - for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Re | En)) !== 0, l = o && (a & Et) !== 0, u = l || (a & se) !== 0 || v(this, tn).has(i); +cs = function(t, n, r) { + t.f ^= Ae; + for (var i = t.first, s = null; i !== null; ) { + var a = i.f, o = (a & (At | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & rt) !== 0 || v(this, en).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Et : s !== null && (a & (Fr | Li | Ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, Ln).add(i), gr(i)); + o ? i.f ^= Ae : s !== null && (a & (Fr | Ii | ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, In).add(i), vr(i)); var f = i.first; if (f !== null) { i = f; @@ -449,15 +449,15 @@ cs = function(e, n, r) { }, /** * @param {Effect[]} effects */ -hs = function(e) { - for (var n = 0; n < e.length; n += 1) - lo(e[n], v(this, Yr), v(this, Ln)); -}, uo = function() { +hs = function(t) { + for (var n = 0; n < t.length; n += 1) + oo(t[n], v(this, Yr), v(this, In)); +}, lo = function() { var i; - if (ri.size > 1) { + if (ni.size > 1) { this.previous.clear(); - var e = Ct, n = !0; - for (const s of ri) { + var t = Se, n = !0; + for (const s of ni) { if (s === this) { n = !1; continue; @@ -475,114 +475,114 @@ hs = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Gt; - Gt = []; + var r = Ke; + Ke = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - co(f, o, l, u); - if (Gt.length > 0) { + fo(f, o, l, u); + if (Ke.length > 0) { K = s, s.apply(); - for (const f of Gt) - $t(i = s, Ye, cs).call(i, f, [], []); + for (const f of Ke) + be(i = s, Vt, cs).call(i, f, [], []); s.deactivate(); } - Gt = r; + Ke = r; } } - K = null, Ct = e; + K = null, Se = t; } - this.committed = !0, ri.delete(this); + this.committed = !0, ni.delete(this); }; let un = Js; -function rt(t) { - var e = Dr; +function re(e) { + var t = Dr; Dr = !0; try { for (var n; ; ) { - if (Au(), Gt.length === 0 && (K == null || K.flush(), Gt.length === 0)) - return Yi = null, /** @type {T} */ + if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) + return Hi = null, /** @type {T} */ n; - fo(); + uo(); } } finally { - Dr = e; + Dr = t; } } -function fo() { +function uo() { fs = !0; - var t = null; + var e = null; try { - for (var e = 0; Gt.length > 0; ) { + for (var t = 0; Ke.length > 0; ) { var n = un.ensure(); - if (e++ > 1e3) { + if (t++ > 1e3) { var r, i; - Tu(); + Au(); } - n.process(Gt), bn.clear(); + n.process(Ke), bn.clear(); } } finally { - Gt = [], fs = !1, Yi = null; + Ke = [], fs = !1, Hi = null; } } -function Tu() { +function Au() { try { - pu(); - } catch (t) { - pr(t, Yi); + hu(); + } catch (e) { + dr(e, Hi); } } -let xe = null; -function ca(t) { - var e = t.length; - if (e !== 0) { - for (var n = 0; n < e; ) { - var r = t[n++]; - if ((r.f & (ln | se)) === 0 && Gr(r) && (xe = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Mo(r), (xe == null ? void 0 : xe.size) > 0)) { +let mt = null; +function fa(e) { + var t = e.length; + if (t !== 0) { + for (var n = 0; n < t; ) { + var r = e[n++]; + if ((r.f & (ln | rt)) === 0 && Gr(r) && (mt = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (mt == null ? void 0 : mt.size) > 0)) { bn.clear(); - for (const i of xe) { - if ((i.f & (ln | se)) !== 0) continue; + for (const i of mt) { + if ((i.f & (ln | rt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - xe.has(a) && (xe.delete(a), s.push(a)), a = a.parent; + mt.has(a) && (mt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (ln | se)) === 0 && gr(l); + (l.f & (ln | rt)) === 0 && vr(l); } } - xe.clear(); + mt.clear(); } } - xe = null; + mt = null; } } -function co(t, e, n, r) { - if (!n.has(t) && (n.add(t), t.reactions !== null)) - for (const i of t.reactions) { +function fo(e, t, n, r) { + if (!n.has(e) && (n.add(e), e.reactions !== null)) + for (const i of e.reactions) { const s = i.f; - (s & St) !== 0 ? co( + (s & Ne) !== 0 ? fo( /** @type {Derived} */ i, - e, + t, n, r - ) : (s & (Ms | hn)) !== 0 && (s & Nt) === 0 && ho(i, e, r) && (vt(i, Nt), Ae( + ) : (s & (Ms | hn)) !== 0 && (s & ke) === 0 && co(i, t, r) && (de(i, ke), xt( /** @type {Effect} */ i )); } } -function ho(t, e, n) { - const r = n.get(t); +function co(e, t, n) { + const r = n.get(e); if (r !== void 0) return r; - if (t.deps !== null) - for (const i of t.deps) { - if (cr.call(e, i)) + if (e.deps !== null) + for (const i of e.deps) { + if (fr.call(t, i)) return !0; - if ((i.f & St) !== 0 && ho( + if ((i.f & Ne) !== 0 && co( /** @type {Derived} */ i, - e, + t, n )) return n.set( @@ -591,82 +591,82 @@ function ho(t, e, n) { !0 ), !0; } - return n.set(t, !1), !1; + return n.set(e, !1), !1; } -function Ae(t) { - for (var e = Yi = t; e.parent !== null; ) { - e = e.parent; - var n = e.f; - if (fs && e === J && (n & hn) !== 0 && (n & Qa) === 0) +function xt(e) { + for (var t = Hi = e; t.parent !== null; ) { + t = t.parent; + var n = t.f; + if (fs && t === J && (n & hn) !== 0 && (n & Za) === 0) return; - if ((n & (En | Re)) !== 0) { - if ((n & Et) === 0) return; - e.f ^= Et; + if ((n & (En | At)) !== 0) { + if ((n & Ae) === 0) return; + t.f ^= Ae; } } - Gt.push(e); + Ke.push(t); } -function po(t, e) { - if (!((t.f & Re) !== 0 && (t.f & Et) !== 0)) { - (t.f & Nt) !== 0 ? e.d.push(t) : (t.f & Te) !== 0 && e.m.push(t), vt(t, Et); - for (var n = t.first; n !== null; ) - po(n, e), n = n.next; +function ho(e, t) { + if (!((e.f & At) !== 0 && (e.f & Ae) !== 0)) { + (e.f & ke) !== 0 ? t.d.push(e) : (e.f & $t) !== 0 && t.m.push(e), de(e, Ae); + for (var n = e.first; n !== null; ) + ho(n, t), n = n.next; } } -function Ru(t) { - let e = 0, n = Gn(0), r; +function Eu(e) { + let t = 0, n = Un(0), r; return () => { - Fs() && (x(n), Ls(() => (e === 0 && (r = Wi(() => t(() => Or(n)))), e += 1, () => { + Fs() && (x(n), Ls(() => (t === 0 && (r = Xi(() => e(() => Or(n)))), t += 1, () => { xn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Or(n)); + t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); }); }))); }; } -var Cu = hr | Jn | Za; -function Su(t, e, n) { - new Nu(t, e, n); +var Tu = cr | jn | Ja; +function Cu(e, t, n) { + new Ru(e, t, n); } -var re, Br, Fe, qn, Ie, de, Wt, Le, en, yn, Vn, nn, or, zn, lr, ur, rn, Di, gt, vo, go, ds, ci, hi, ps; -class Nu { +var tt, Br, Pt, Ln, Dt, ct, Ue, Ot, tn, yn, qn, nn, ar, Vn, or, lr, rn, Pi, ge, po, vo, ds, fi, ci, ps; +class Ru { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(e, n, r) { - B(this, gt); + constructor(t, n, r) { + H(this, ge); /** @type {Boundary | null} */ - dt(this, "parent"); - dt(this, "is_pending", !1); + ce(this, "parent"); + ce(this, "is_pending", !1); /** @type {TemplateNode} */ - B(this, re); + H(this, tt); /** @type {TemplateNode | null} */ - B(this, Br, j ? W : null); + H(this, Br, j ? X : null); /** @type {BoundaryProps} */ - B(this, Fe); + H(this, Pt); /** @type {((anchor: Node) => void)} */ - B(this, qn); + H(this, Ln); /** @type {Effect} */ - B(this, Ie); + H(this, Dt); /** @type {Effect | null} */ - B(this, de, null); + H(this, ct, null); /** @type {Effect | null} */ - B(this, Wt, null); + H(this, Ue, null); /** @type {Effect | null} */ - B(this, Le, null); + H(this, Ot, null); /** @type {DocumentFragment | null} */ - B(this, en, null); + H(this, tn, null); /** @type {TemplateNode | null} */ - B(this, yn, null); - B(this, Vn, 0); - B(this, nn, 0); - B(this, or, !1); - B(this, zn, !1); + H(this, yn, null); + H(this, qn, 0); + H(this, nn, 0); + H(this, ar, !1); + H(this, Vn, !1); /** @type {Set} */ - B(this, lr, /* @__PURE__ */ new Set()); + H(this, or, /* @__PURE__ */ new Set()); /** @type {Set} */ - B(this, ur, /* @__PURE__ */ new Set()); + H(this, lr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -674,38 +674,38 @@ class Nu { * calls followed by no-op flushes * @type {Source | null} */ - B(this, rn, null); - B(this, Di, Ru(() => (z(this, rn, Gn(v(this, Vn))), () => { - z(this, rn, null); + H(this, rn, null); + H(this, Pi, Eu(() => (V(this, rn, Un(v(this, qn))), () => { + V(this, rn, null); }))); - z(this, re, e), z(this, Fe, n), z(this, qn, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Fe).pending, z(this, Ie, qs(() => { + V(this, tt, t), V(this, Pt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Pt).pending, V(this, Dt, qs(() => { if (J.b = this, j) { const s = v(this, Br); - Vi(), /** @type {Comment} */ - s.nodeType === wr && /** @type {Comment} */ - s.data === Fi ? $t(this, gt, go).call(this) : ($t(this, gt, vo).call(this), v(this, nn) === 0 && (this.is_pending = !1)); + qi(), /** @type {Comment} */ + s.nodeType === yr && /** @type {Comment} */ + s.data === Oi ? be(this, ge, vo).call(this) : (be(this, ge, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); } else { - var i = $t(this, gt, ds).call(this); + var i = be(this, ge, ds).call(this); try { - z(this, de, ve(() => r(i))); + V(this, ct, dt(() => r(i))); } catch (s) { this.error(s); } - v(this, nn) > 0 ? $t(this, gt, hi).call(this) : this.is_pending = !1; + v(this, nn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, yn)) == null || s.remove(); }; - }, Cu)), j && z(this, re, W); + }, Tu)), j && V(this, tt, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(e) { - lo(e, v(this, lr), v(this, ur)); + defer_effect(t) { + oo(t, v(this, or), v(this, lr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Nu { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Fe).pending; + return !!v(this, Pt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,187 +723,187 @@ class Nu { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(e) { - $t(this, gt, ps).call(this, e), z(this, Vn, v(this, Vn) + e), !(!v(this, rn) || v(this, or)) && (z(this, or, !0), xn(() => { - z(this, or, !1), v(this, rn) && vr(v(this, rn), v(this, Vn)); + update_pending_count(t) { + be(this, ge, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, rn) || v(this, ar)) && (V(this, ar, !0), xn(() => { + V(this, ar, !1), v(this, rn) && pr(v(this, rn), v(this, qn)); })); } get_effect_pending() { - return v(this, Di).call(this), x( + return v(this, Pi).call(this), x( /** @type {Source} */ v(this, rn) ); } /** @param {unknown} error */ - error(e) { - var n = v(this, Fe).onerror; - let r = v(this, Fe).failed; - if (v(this, zn) || !n && !r) - throw e; - v(this, de) && (Vt(v(this, de)), z(this, de, null)), v(this, Wt) && (Vt(v(this, Wt)), z(this, Wt, null)), v(this, Le) && (Vt(v(this, Le)), z(this, Le, null)), j && (qt( + error(t) { + var n = v(this, Pt).onerror; + let r = v(this, Pt).failed; + if (v(this, Vn) || !n && !r) + throw t; + v(this, ct) && (Ve(v(this, ct)), V(this, ct, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Ot) && (Ve(v(this, Ot)), V(this, Ot, null)), j && (qe( /** @type {TemplateNode} */ v(this, Br) - ), us(), qt(Ei())); + ), us(), qe(Ai())); var i = !1, s = !1; const a = () => { if (i) { - xu(); + yu(); return; } - i = !0, s && wu(), un.ensure(), z(this, Vn, 0), v(this, Le) !== null && Bn(v(this, Le), () => { - z(this, Le, null); - }), this.is_pending = this.has_pending_snippet(), z(this, de, $t(this, gt, ci).call(this, () => (z(this, zn, !1), ve(() => v(this, qn).call(this, v(this, re)))))), v(this, nn) > 0 ? $t(this, gt, hi).call(this) : this.is_pending = !1; + i = !0, s && mu(), un.ensure(), V(this, qn, 0), v(this, Ot) !== null && Yn(v(this, Ot), () => { + V(this, Ot, null); + }), this.is_pending = this.has_pending_snippet(), V(this, ct, be(this, ge, fi).call(this, () => (V(this, Vn, !1), dt(() => v(this, Ln).call(this, v(this, tt)))))), v(this, nn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; }; xn(() => { try { - s = !0, n == null || n(e, a), s = !1; + s = !0, n == null || n(t, a), s = !1; } catch (o) { - pr(o, v(this, Ie) && v(this, Ie).parent); + dr(o, v(this, Dt) && v(this, Dt).parent); } - r && z(this, Le, $t(this, gt, ci).call(this, () => { - un.ensure(), z(this, zn, !0); + r && V(this, Ot, be(this, ge, fi).call(this, () => { + un.ensure(), V(this, Vn, !0); try { - return ve(() => { + return dt(() => { r( - v(this, re), - () => e, + v(this, tt), + () => t, () => a ); }); } catch (o) { - return pr( + return dr( o, /** @type {Effect} */ - v(this, Ie).parent + v(this, Dt).parent ), null; } finally { - z(this, zn, !1); + V(this, Vn, !1); } })); }); } } -re = new WeakMap(), Br = new WeakMap(), Fe = new WeakMap(), qn = new WeakMap(), Ie = new WeakMap(), de = new WeakMap(), Wt = new WeakMap(), Le = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), Vn = new WeakMap(), nn = new WeakMap(), or = new WeakMap(), zn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), rn = new WeakMap(), Di = new WeakMap(), gt = new WeakSet(), vo = function() { +tt = new WeakMap(), Br = new WeakMap(), Pt = new WeakMap(), Ln = new WeakMap(), Dt = new WeakMap(), ct = new WeakMap(), Ue = new WeakMap(), Ot = new WeakMap(), tn = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), rn = new WeakMap(), Pi = new WeakMap(), ge = new WeakSet(), po = function() { try { - z(this, de, ve(() => v(this, qn).call(this, v(this, re)))); - } catch (e) { - this.error(e); + V(this, ct, dt(() => v(this, Ln).call(this, v(this, tt)))); + } catch (t) { + this.error(t); } -}, go = function() { - const e = v(this, Fe).pending; - e && (z(this, Wt, ve(() => e(v(this, re)))), xn(() => { - var n = $t(this, gt, ds).call(this); - z(this, de, $t(this, gt, ci).call(this, () => (un.ensure(), ve(() => v(this, qn).call(this, n))))), v(this, nn) > 0 ? $t(this, gt, hi).call(this) : (Bn( +}, vo = function() { + const t = v(this, Pt).pending; + t && (V(this, Ue, dt(() => t(v(this, tt)))), xn(() => { + var n = be(this, ge, ds).call(this); + V(this, ct, be(this, ge, fi).call(this, () => (un.ensure(), dt(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? be(this, ge, ci).call(this) : (Yn( /** @type {Effect} */ - v(this, Wt), + v(this, Ue), () => { - z(this, Wt, null); + V(this, Ue, null); } ), this.is_pending = !1); })); }, ds = function() { - var e = v(this, re); - return this.is_pending && (z(this, yn, ae()), v(this, re).before(v(this, yn)), e = v(this, yn)), e; + var t = v(this, tt); + return this.is_pending && (V(this, yn, it()), v(this, tt).before(v(this, yn)), t = v(this, yn)), t; }, /** * @param {() => Effect | null} fn */ -ci = function(e) { - var n = J, r = X, i = oe; - He(v(this, Ie)), me(v(this, Ie)), dr(v(this, Ie).ctx); +fi = function(t) { + var n = J, r = B, i = st; + qt(v(this, Dt)), gt(v(this, Dt)), hr(v(this, Dt).ctx); try { - return e(); + return t(); } catch (s) { - return ao(s), null; + return so(s), null; } finally { - He(n), me(r), dr(i); + qt(n), gt(r), hr(i); } -}, hi = function() { - const e = ( +}, ci = function() { + const t = ( /** @type {(anchor: Node) => void} */ - v(this, Fe).pending + v(this, Pt).pending ); - v(this, de) !== null && (z(this, en, document.createDocumentFragment()), v(this, en).append( + v(this, ct) !== null && (V(this, tn, document.createDocumentFragment()), v(this, tn).append( /** @type {TemplateNode} */ v(this, yn) - ), Oo(v(this, de), v(this, en))), v(this, Wt) === null && z(this, Wt, ve(() => e(v(this, re)))); + ), Do(v(this, ct), v(this, tn))), v(this, Ue) === null && V(this, Ue, dt(() => t(v(this, tt)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ -ps = function(e) { +ps = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && $t(n = this.parent, gt, ps).call(n, e); + this.parent && be(n = this.parent, ge, ps).call(n, t); return; } - if (z(this, nn, v(this, nn) + e), v(this, nn) === 0) { + if (V(this, nn, v(this, nn) + t), v(this, nn) === 0) { this.is_pending = !1; + for (const r of v(this, or)) + de(r, ke), xt(r); for (const r of v(this, lr)) - vt(r, Nt), Ae(r); - for (const r of v(this, ur)) - vt(r, Te), Ae(r); - v(this, lr).clear(), v(this, ur).clear(), v(this, Wt) && Bn(v(this, Wt), () => { - z(this, Wt, null); - }), v(this, en) && (v(this, re).before(v(this, en)), z(this, en, null)); + de(r, $t), xt(r); + v(this, or).clear(), v(this, lr).clear(), v(this, Ue) && Yn(v(this, Ue), () => { + V(this, Ue, null); + }), v(this, tn) && (v(this, tt).before(v(this, tn)), V(this, tn, null)); } }; -function ku(t, e, n, r) { - const i = Bi; - var s = t.filter((h) => !h.settled); +function Su(e, t, n, r) { + const i = Yi; + var s = e.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(e.map(i)); + r(t.map(i)); return; } var a = K, o = ( /** @type {Effect} */ J - ), l = Mu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; - function f(h) { + ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + function f(c) { l(); try { - r(h); + r(c); } catch (d) { - (o.f & ln) === 0 && pr(d, o); + (o.f & ln) === 0 && dr(d, o); } a == null || a.deactivate(), vs(); } if (n.length === 0) { - u.then(() => f(e.map(i))); + u.then(() => f(t.map(i))); return; } function p() { - l(), Promise.all(n.map((h) => /* @__PURE__ */ Pu(h))).then((h) => f([...e.map(i), ...h])).catch((h) => pr(h, o)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => dr(c, o)); } u ? u.then(p) : p(); } -function Mu() { - var t = J, e = X, n = oe, r = K; +function Nu() { + var e = J, t = B, n = st, r = K; return function(s = !0) { - He(t), me(e), dr(n), s && (r == null || r.activate()); + qt(e), gt(t), hr(n), s && (r == null || r.activate()); }; } function vs() { - He(null), me(null), dr(null); + qt(null), gt(null), hr(null); } // @__NO_SIDE_EFFECTS__ -function Bi(t) { - var e = St | Nt, n = X !== null && (X.f & St) !== 0 ? ( +function Yi(e) { + var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( /** @type {Derived} */ - X + B ) : null; - return J !== null && (J.f |= Jn), { - ctx: oe, + return J !== null && (J.f |= jn), { + ctx: st, deps: null, effects: null, - equals: no, - f: e, - fn: t, + equals: to, + f: t, + fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - Rt + Re ), wv: 0, parent: n ?? J, @@ -911,12 +911,12 @@ function Bi(t) { }; } // @__NO_SIDE_EFFECTS__ -function Pu(t, e, n) { +function ku(e, t, n) { let r = ( /** @type {Effect | null} */ J ); - r === null && uu(); + r === null && ou(); var i = ( /** @type {Boundary} */ r.b @@ -924,16 +924,16 @@ function Pu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Gn( + ), a = Un( /** @type {V} */ - Rt - ), o = !X, l = /* @__PURE__ */ new Map(); - return Yu(() => { + Re + ), o = !B, l = /* @__PURE__ */ new Map(); + return zu(() => { var d; - var u = ja(); + var u = Ka(); s = u.promise; try { - Promise.resolve(t()).then(u.resolve, u.reject).then(() => { + Promise.resolve(e()).then(u.resolve, u.reject).then(() => { f === K && f.committed && f.deactivate(), vs(); }); } catch (y) { @@ -945,223 +945,223 @@ function Pu(t, e, n) { ); if (o) { var p = i.is_rendered(); - i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(Mn), l.delete(f), l.set(f, u); + i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(kn), l.delete(f), l.set(f, u); } - const h = (y, b = void 0) => { + const c = (y, b = void 0) => { if (f.activate(), b) - b !== Mn && (a.f |= wn, vr(a, b)); + b !== kn && (a.f |= wn, pr(a, b)); else { - (a.f & wn) !== 0 && (a.f ^= wn), vr(a, y); + (a.f & wn) !== 0 && (a.f ^= wn), pr(a, y); for (const [m, $] of l) { if (l.delete(m), m === f) break; - $.reject(Mn); + $.reject(kn); } } o && (i.update_pending_count(-1), f.decrement(p)); }; - u.promise.then(h, (y) => h(null, y || "unknown")); - }), Vu(() => { + u.promise.then(c, (y) => c(null, y || "unknown")); + }), Lu(() => { for (const u of l.values()) - u.reject(Mn); + u.reject(kn); }), new Promise((u) => { function f(p) { - function h() { + function c() { p === s ? u(a) : f(s); } - p.then(h, h); + p.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function vn(t) { - const e = /* @__PURE__ */ Bi(t); - return Fo(e), e; +function vn(e) { + const t = /* @__PURE__ */ Yi(e); + return Oo(t), t; } // @__NO_SIDE_EFFECTS__ -function _o(t) { - const e = /* @__PURE__ */ Bi(t); - return e.equals = ro, e; -} -function Du(t) { - var e = t.effects; - if (e !== null) { - t.effects = null; - for (var n = 0; n < e.length; n += 1) - Vt( +function go(e) { + const t = /* @__PURE__ */ Yi(e); + return t.equals = no, t; +} +function Mu(e) { + var t = e.effects; + if (t !== null) { + e.effects = null; + for (var n = 0; n < t.length; n += 1) + Ve( /** @type {Effect} */ - e[n] + t[n] ); } } -function Ou(t) { - for (var e = t.parent; e !== null; ) { - if ((e.f & St) === 0) - return (e.f & ln) === 0 ? ( +function Pu(e) { + for (var t = e.parent; t !== null; ) { + if ((t.f & Ne) === 0) + return (t.f & ln) === 0 ? ( /** @type {Effect} */ - e + t ) : null; - e = e.parent; + t = t.parent; } return null; } -function Ds(t) { - var e, n = J; - He(Ou(t)); +function Ds(e) { + var t, n = J; + qt(Pu(e)); try { - t.f &= ~Un, Du(t), e = Vo(t); + e.f &= ~Wn, Mu(e), t = qo(e); } finally { - He(n); + qt(n); } - return e; + return t; } -function mo(t) { - var e = Ds(t); - if (!t.equals(e) && (t.wv = Lo(), (!(K != null && K.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - vt(t, Et); +function _o(e) { + var t = Ds(e); + if (!e.equals(t) && (e.wv = Io(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + de(e, Ae); return; } - An || (Ct !== null ? (Fs() || K != null && K.is_fork) && Ct.set(t, e) : Ps(t)); + An || (Se !== null ? (Fs() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); } -function Fu(t) { - var e, n; - if (t.effects !== null) - for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(Mn), r.teardown = nu, r.ac = null, Ir(r, 0), Vs(r)); +function Du(e) { + var t, n; + if (e.effects !== null) + for (const r of e.effects) + (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = eu, r.ac = null, Ir(r, 0), Vs(r)); } -function yo(t) { - if (t.effects !== null) - for (const e of t.effects) - e.teardown && gr(e); +function mo(e) { + if (e.effects !== null) + for (const t of e.effects) + t.teardown && vr(t); } let gs = /* @__PURE__ */ new Set(); const bn = /* @__PURE__ */ new Map(); -let wo = !1; -function Gn(t, e) { +let yo = !1; +function Un(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: t, + v: e, reactions: null, - equals: no, + equals: to, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function At(t, e) { - const n = Gn(t); - return Fo(n), n; +function $e(e, t) { + const n = Un(e); + return Oo(n), n; } // @__NO_SIDE_EFFECTS__ -function xo(t, e = !1, n = !0) { - const r = Gn(t); - return e || (r.equals = ro), r; +function wo(e, t = !1, n = !0) { + const r = Un(e); + return t || (r.equals = no), r; } -function pt(t, e, n = !1) { - X !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function he(e, t, n = !1) { + B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!Ee || (X.f & fa) !== 0) && io() && (X.f & (St | hn | Ms | fa)) !== 0 && (_e === null || !cr.call(_e, t)) && yu(); - let r = n ? Dn(e) : e; - return vr(t, r); -} -function vr(t, e) { - if (!t.equals(e)) { - var n = t.v; - An ? bn.set(t, e) : bn.set(t, n), t.v = e; + (!bt || (B.f & ua) !== 0) && ro() && (B.f & (Ne | hn | Ms | ua)) !== 0 && (vt === null || !fr.call(vt, e)) && _u(); + let r = n ? Pn(t) : t; + return pr(e, r); +} +function pr(e, t) { + if (!e.equals(t)) { + var n = e.v; + An ? bn.set(e, t) : bn.set(e, n), e.v = t; var r = un.ensure(); - if (r.capture(t, n), (t.f & St) !== 0) { + if (r.capture(e, n), (e.f & Ne) !== 0) { const i = ( /** @type {Derived} */ - t + e ); - (t.f & Nt) !== 0 && Ds(i), Ps(i); + (e.f & ke) !== 0 && Ds(i), Ps(i); } - t.wv = Lo(), bo(t, Nt), J !== null && (J.f & Et) !== 0 && (J.f & (Re | En)) === 0 && (he === null ? Wu([t]) : he.push(t)), !r.is_fork && gs.size > 0 && !wo && Iu(); + e.wv = Io(), xo(e, ke), J !== null && (J.f & Ae) !== 0 && (J.f & (At | En)) === 0 && (ft === null ? Bu([e]) : ft.push(e)), !r.is_fork && gs.size > 0 && !yo && Ou(); } - return e; + return t; } -function Iu() { - wo = !1; - for (const t of gs) - (t.f & Et) !== 0 && vt(t, Te), Gr(t) && gr(t); +function Ou() { + yo = !1; + for (const e of gs) + (e.f & Ae) !== 0 && de(e, $t), Gr(e) && vr(e); gs.clear(); } -function Or(t) { - pt(t, t.v + 1); +function Or(e) { + he(e, e.v + 1); } -function bo(t, e) { - var n = t.reactions; +function xo(e, t) { + var n = e.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Nt) === 0; - if (o && vt(s, e), (a & St) !== 0) { + var s = n[i], a = s.f, o = (a & ke) === 0; + if (o && de(s, t), (a & Ne) !== 0) { var l = ( /** @type {Derived} */ s ); - Ct == null || Ct.delete(l), (a & Un) === 0 && (a & ge && (s.f |= Un), bo(l, Te)); - } else o && ((a & hn) !== 0 && xe !== null && xe.add( + Se == null || Se.delete(l), (a & Wn) === 0 && (a & pt && (s.f |= Wn), xo(l, $t)); + } else o && ((a & hn) !== 0 && mt !== null && mt.add( /** @type {Effect} */ s - ), Ae( + ), xt( /** @type {Effect} */ s )); } } -function Dn(t) { - if (typeof t != "object" || t === null || Pr in t) - return t; - const e = Ka(t); - if (e !== tu && e !== eu) - return t; - var n = /* @__PURE__ */ new Map(), r = Ga(t), i = /* @__PURE__ */ At(0), s = Xn, a = (o) => { - if (Xn === s) +function Pn(e) { + if (typeof e != "object" || e === null || Pr in e) + return e; + const t = Ga(e); + if (t !== Zl && t !== Ql) + return e; + var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { + if (Bn === s) return o(); - var l = X, u = Xn; - me(null), pa(s); + var l = B, u = Bn; + gt(null), da(s); var f = o(); - return me(l), pa(u), f; + return gt(l), da(u), f; }; - return r && n.set("length", /* @__PURE__ */ At( + return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ - t.length + e.length )), new Proxy( /** @type {any} */ - t, + e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && _u(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); var f = n.get(l); return f === void 0 ? a(() => { - var p = /* @__PURE__ */ At(u.value); + var p = /* @__PURE__ */ $e(u.value); return n.set(l, p), p; - }) : pt(f, u.value, !0), !0; + }) : he(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ At(Rt)); + const f = a(() => /* @__PURE__ */ $e(Re)); n.set(l, f), Or(i); } } else - pt(u, Rt), Or(i); + he(u, Re), Or(i); return !0; }, get(o, l, u) { var d; if (l === Pr) - return t; + return e; var f = n.get(l), p = l in o; - if (f === void 0 && (!p || (d = Yn(o, l)) != null && d.writable) && (f = a(() => { - var y = Dn(p ? o[l] : Rt), b = /* @__PURE__ */ At(y); + if (f === void 0 && (!p || (d = Hn(o, l)) != null && d.writable) && (f = a(() => { + var y = Pn(p ? o[l] : Re), b = /* @__PURE__ */ $e(y); return b; }), n.set(l, f)), f !== void 0) { - var h = x(f); - return h === Rt ? void 0 : h; + var c = x(f); + return c === Re ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1171,57 +1171,57 @@ function Dn(t) { var f = n.get(l); f && (u.value = x(f)); } else if (u === void 0) { - var p = n.get(l), h = p == null ? void 0 : p.v; - if (p !== void 0 && h !== Rt) + var p = n.get(l), c = p == null ? void 0 : p.v; + if (p !== void 0 && c !== Re) return { enumerable: !0, configurable: !0, - value: h, + value: c, writable: !0 }; } return u; }, has(o, l) { - var h; + var c; if (l === Pr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Rt || Reflect.has(o, l); - if (u !== void 0 || J !== null && (!f || (h = Yn(o, l)) != null && h.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); + if (u !== void 0 || J !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var d = f ? Dn(o[l]) : Rt, y = /* @__PURE__ */ At(d); + var d = f ? Pn(o[l]) : Re, y = /* @__PURE__ */ $e(d); return y; }), n.set(l, u)); var p = x(u); - if (p === Rt) + if (p === Re) return !1; } return f; }, set(o, l, u, f) { var M; - var p = n.get(l), h = l in o; + var p = n.get(l), c = l in o; if (r && l === "length") for (var d = u; d < /** @type {Source} */ p.v; d += 1) { var y = n.get(d + ""); - y !== void 0 ? pt(y, Rt) : d in o && (y = a(() => /* @__PURE__ */ At(Rt)), n.set(d + "", y)); + y !== void 0 ? he(y, Re) : d in o && (y = a(() => /* @__PURE__ */ $e(Re)), n.set(d + "", y)); } if (p === void 0) - (!h || (M = Yn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ At(void 0)), pt(p, Dn(u)), n.set(l, p)); + (!c || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); else { - h = p.v !== Rt; - var b = a(() => Dn(u)); - pt(p, b); + c = p.v !== Re; + var b = a(() => Pn(u)); + he(p, b); } var m = Reflect.getOwnPropertyDescriptor(o, l); - if (m != null && m.set && m.set.call(f, u), !h) { + if (m != null && m.set && m.set.call(f, u), !c) { if (r && typeof l == "string") { var $ = ( /** @type {Source} */ n.get("length") ), D = Number(l); - Number.isInteger(D) && D >= $.v && pt($, D + 1); + Number.isInteger(D) && D >= $.v && he($, D + 1); } Or(i); } @@ -1230,144 +1230,144 @@ function Dn(t) { ownKeys(o) { x(i); var l = Reflect.ownKeys(o).filter((p) => { - var h = n.get(p); - return h === void 0 || h.v !== Rt; + var c = n.get(p); + return c === void 0 || c.v !== Re; }); for (var [u, f] of n) - f.v !== Rt && !(u in o) && l.push(u); + f.v !== Re && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - mu(); + gu(); } } ); } -var ha, $o, Ao, Eo; +var ca, bo, $o, Ao; function _s() { - if (ha === void 0) { - ha = window, $o = /Firefox/.test(navigator.userAgent); - var t = Element.prototype, e = Node.prototype, n = Text.prototype; - Ao = Yn(e, "firstChild").get, Eo = Yn(e, "nextSibling").get, ua(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ua(n) && (n.__t = void 0); + if (ca === void 0) { + ca = window, bo = /Firefox/.test(navigator.userAgent); + var e = Element.prototype, t = Node.prototype, n = Text.prototype; + $o = Hn(t, "firstChild").get, Ao = Hn(t, "nextSibling").get, la(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), la(n) && (n.__t = void 0); } } -function ae(t = "") { - return document.createTextNode(t); +function it(e = "") { + return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function fn(t) { +function fn(e) { return ( /** @type {TemplateNode | null} */ - Ao.call(t) + $o.call(e) ); } // @__NO_SIDE_EFFECTS__ -function Be(t) { +function zt(e) { return ( /** @type {TemplateNode | null} */ - Eo.call(t) + Ao.call(e) ); } -function Xt(t, e) { +function We(e, t) { if (!j) - return /* @__PURE__ */ fn(t); - var n = /* @__PURE__ */ fn(W); + return /* @__PURE__ */ fn(e); + var n = /* @__PURE__ */ fn(X); if (n === null) - n = W.appendChild(ae()); - else if (e && n.nodeType !== Ur) { - var r = ae(); - return n == null || n.before(r), qt(r), r; + n = X.appendChild(it()); + else if (t && n.nodeType !== Ur) { + var r = it(); + return n == null || n.before(r), qe(r), r; } - return e && Xi( + return t && Bi( /** @type {Text} */ n - ), qt(n), n; + ), qe(n), n; } -function _n(t, e = !1) { +function _n(e, t = !1) { if (!j) { - var n = /* @__PURE__ */ fn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Be(n) : n; + var n = /* @__PURE__ */ fn(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ zt(n) : n; } - if (e) { - if ((W == null ? void 0 : W.nodeType) !== Ur) { - var r = ae(); - return W == null || W.before(r), qt(r), r; + if (t) { + if ((X == null ? void 0 : X.nodeType) !== Ur) { + var r = it(); + return X == null || X.before(r), qe(r), r; } - Xi( + Bi( /** @type {Text} */ - W + X ); } - return W; + return X; } -function ee(t, e = 1, n = !1) { - let r = j ? W : t; - for (var i; e--; ) +function Qe(e, t = 1, n = !1) { + let r = j ? X : e; + for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Be(r); + /* @__PURE__ */ zt(r); if (!j) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = ae(); - return r === null ? i == null || i.after(s) : r.before(s), qt(s), s; + var s = it(); + return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; } - Xi( + Bi( /** @type {Text} */ r ); } - return qt(r), r; + return qe(r), r; } -function To(t) { - t.textContent = ""; +function Eo(e) { + e.textContent = ""; } -function Ro() { +function To() { return !1; } -function Os(t, e, n) { +function Os(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Ua, t, void 0) + document.createElementNS(Wa, e, void 0) ); } -function Xi(t) { +function Bi(e) { if ( /** @type {string} */ - t.nodeValue.length < 65536 + e.nodeValue.length < 65536 ) return; - let e = t.nextSibling; - for (; e !== null && e.nodeType === Ur; ) - e.remove(), t.nodeValue += /** @type {string} */ - e.nodeValue, e = t.nextSibling; -} -function Co(t) { - var e = X, n = J; - me(null), He(null); + let t = e.nextSibling; + for (; t !== null && t.nodeType === Ur; ) + t.remove(), e.nodeValue += /** @type {string} */ + t.nodeValue, t = e.nextSibling; +} +function Co(e) { + var t = B, n = J; + gt(null), qt(null); try { - return t(); + return e(); } finally { - me(e), He(n); + gt(t), qt(n); } } -function Lu(t) { - J === null && (X === null && du(), hu()), An && cu(); +function Fu(e) { + J === null && (B === null && cu(), fu()), An && uu(); } -function qu(t, e) { - var n = e.last; - n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +function Iu(e, t) { + var n = t.last; + n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Xe(t, e, n) { +function Ht(e, t, n) { var r = J; - r !== null && (r.f & se) !== 0 && (t |= se); + r !== null && (r.f & rt) !== 0 && (e |= rt); var i = { - ctx: oe, + ctx: st, deps: null, nodes: null, - f: t | Nt | ge, + f: e | ke | pt, first: null, - fn: e, + fn: t, last: null, next: null, parent: r, @@ -1379,143 +1379,143 @@ function Xe(t, e, n) { }; if (n) try { - gr(i); + vr(i); } catch (o) { - throw Vt(i), o; + throw Ve(i), o; } - else e !== null && Ae(i); + else t !== null && xt(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & Jn) === 0 && (s = s.first, (t & hn) !== 0 && (t & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && qu(s, r), X !== null && (X.f & St) !== 0 && (t & En) === 0)) { + (s.f & jn) === 0 && (s = s.first, (e & hn) !== 0 && (e & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Iu(s, r), B !== null && (B.f & Ne) !== 0 && (e & En) === 0)) { var a = ( /** @type {Derived} */ - X + B ); (a.effects ?? (a.effects = [])).push(s); } return i; } function Fs() { - return X !== null && !Ee; + return B !== null && !bt; } -function Vu(t) { - const e = Xe(Li, null, !1); - return vt(e, Et), e.teardown = t, e; +function Lu(e) { + const t = Ht(Ii, null, !1); + return de(t, Ae), t.teardown = e, t; } -function Is(t) { - Lu(); - var e = ( +function Is(e) { + Fu(); + var t = ( /** @type {Effect} */ J.f - ), n = !X && (e & Re) !== 0 && (e & yr) === 0; + ), n = !B && (t & At) !== 0 && (t & mr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - oe + st ); - (r.e ?? (r.e = [])).push(t); + (r.e ?? (r.e = [])).push(e); } else - return So(t); + return Ro(e); } -function So(t) { - return Xe(Fr | su, t, !1); +function Ro(e) { + return Ht(Fr | ru, e, !1); } -function zu(t) { +function qu(e) { un.ensure(); - const e = Xe(En | Jn, t, !0); + const t = Ht(En | jn, e, !0); return () => { - Vt(e); + Ve(t); }; } -function Hu(t) { +function Vu(e) { un.ensure(); - const e = Xe(En | Jn, t, !0); + const t = Ht(En | jn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? Bn(e, () => { - Vt(e), r(void 0); - }) : (Vt(e), r(void 0)); + n.outro ? Yn(t, () => { + Ve(t), r(void 0); + }) : (Ve(t), r(void 0)); }); } -function No(t) { - return Xe(Fr, t, !1); +function So(e) { + return Ht(Fr, e, !1); } -function Yu(t) { - return Xe(Ms | Jn, t, !0); +function zu(e) { + return Ht(Ms | jn, e, !0); } -function Ls(t, e = 0) { - return Xe(Li | e, t, !0); +function Ls(e, t = 0) { + return Ht(Ii | t, e, !0); } -function Qe(t, e = [], n = [], r = []) { - ku(r, e, n, (i) => { - Xe(Li, () => t(...i.map(x)), !0); +function Qt(e, t = [], n = [], r = []) { + Su(r, t, n, (i) => { + Ht(Ii, () => e(...i.map(x)), !0); }); } -function qs(t, e = 0) { - var n = Xe(hn | e, t, !0); +function qs(e, t = 0) { + var n = Ht(hn | t, e, !0); return n; } -function ve(t) { - return Xe(Re | Jn, t, !0); +function dt(e) { + return Ht(At | jn, e, !0); } -function ko(t) { - var e = t.teardown; - if (e !== null) { - const n = An, r = X; - da(!0), me(null); +function No(e) { + var t = e.teardown; + if (t !== null) { + const n = An, r = B; + ha(!0), gt(null); try { - e.call(null); + t.call(null); } finally { - da(n), me(r); + ha(n), gt(r); } } } -function Vs(t, e = !1) { - var n = t.first; - for (t.first = t.last = null; n !== null; ) { +function Vs(e, t = !1) { + var n = e.first; + for (e.first = e.last = null; n !== null; ) { const i = n.ac; i !== null && Co(() => { - i.abort(Mn); + i.abort(kn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : Vt(n, e), n = r; + (n.f & En) !== 0 ? n.parent = null : Ve(n, t), n = r; } } -function Bu(t) { - for (var e = t.first; e !== null; ) { - var n = e.next; - (e.f & Re) === 0 && Vt(e), e = n; +function Hu(e) { + for (var t = e.first; t !== null; ) { + var n = t.next; + (t.f & At) === 0 && Ve(t), t = n; } } -function Vt(t, e = !0) { +function Ve(e, t = !0) { var n = !1; - (e || (t.f & Qa) !== 0) && t.nodes !== null && t.nodes.end !== null && (Xu( - t.nodes.start, + (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( + e.nodes.start, /** @type {TemplateNode} */ - t.nodes.end - ), n = !0), Vs(t, e && !n), Ir(t, 0), vt(t, ln); - var r = t.nodes && t.nodes.t; + e.nodes.end + ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, ln); + var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - ko(t); - var i = t.parent; - i !== null && i.first !== null && Mo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + No(e); + var i = e.parent; + i !== null && i.first !== null && ko(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } -function Xu(t, e) { - for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Be(t); - t.remove(), t = n; +function Yu(e, t) { + for (; e !== null; ) { + var n = e === t ? null : /* @__PURE__ */ zt(e); + e.remove(), e = n; } } -function Mo(t) { - var e = t.parent, n = t.prev, r = t.next; - n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); +function ko(e) { + var t = e.parent, n = e.prev, r = e.next; + n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); } -function Bn(t, e, n = !0) { +function Yn(e, t, n = !0) { var r = []; - Po(t, r, !0); + Mo(e, r, !0); var i = () => { - n && Vt(t), e && e(); + n && Ve(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,315 +1524,315 @@ function Bn(t, e, n = !0) { } else i(); } -function Po(t, e, n) { - if ((t.f & se) === 0) { - t.f ^= se; - var r = t.nodes && t.nodes.t; +function Mo(e, t, n) { + if ((e.f & rt) === 0) { + e.f ^= rt; + var r = e.nodes && e.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && e.push(o); - for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & hr) !== 0 || // If this is a branch effect without a block effect parent, + (o.is_global || n) && t.push(o); + for (var i = e.first; i !== null; ) { + var s = i.next, a = (i.f & cr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & Re) !== 0 && (t.f & hn) !== 0; - Po(i, e, a ? n : !1), i = s; + (i.f & At) !== 0 && (e.f & hn) !== 0; + Mo(i, t, a ? n : !1), i = s; } } } -function zs(t) { - Do(t, !0); +function zs(e) { + Po(e, !0); } -function Do(t, e) { - if ((t.f & se) !== 0) { - t.f ^= se, (t.f & Et) === 0 && (vt(t, Nt), Ae(t)); - for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & Re) !== 0; - Do(n, i ? e : !1), n = r; +function Po(e, t) { + if ((e.f & rt) !== 0) { + e.f ^= rt, (e.f & Ae) === 0 && (de(e, ke), xt(e)); + for (var n = e.first; n !== null; ) { + var r = n.next, i = (n.f & cr) !== 0 || (n.f & At) !== 0; + Po(n, i ? t : !1), n = r; } - var s = t.nodes && t.nodes.t; + var s = e.nodes && e.nodes.t; if (s !== null) for (const a of s) - (a.is_global || e) && a.in(); + (a.is_global || t) && a.in(); } } -function Oo(t, e) { - if (t.nodes) - for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Be(n); - e.append(n), n = i; +function Do(e, t) { + if (e.nodes) + for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ zt(n); + t.append(n), n = i; } } -let di = !1, An = !1; -function da(t) { - An = t; +let hi = !1, An = !1; +function ha(e) { + An = e; } -let X = null, Ee = !1; -function me(t) { - X = t; +let B = null, bt = !1; +function gt(e) { + B = e; } let J = null; -function He(t) { - J = t; +function qt(e) { + J = e; } -let _e = null; -function Fo(t) { - X !== null && (_e === null ? _e = [t] : _e.push(t)); +let vt = null; +function Oo(e) { + B !== null && (vt === null ? vt = [e] : vt.push(e)); } -let Kt = null, ne = 0, he = null; -function Wu(t) { - he = t; +let je = null, et = 0, ft = null; +function Bu(e) { + ft = e; } -let Io = 1, On = 0, Xn = On; -function pa(t) { - Xn = t; +let Fo = 1, Dn = 0, Bn = Dn; +function da(e) { + Bn = e; } -function Lo() { - return ++Io; +function Io() { + return ++Fo; } -function Gr(t) { - var e = t.f; - if ((e & Nt) !== 0) +function Gr(e) { + var t = e.f; + if ((t & ke) !== 0) return !0; - if (e & St && (t.f &= ~Un), (e & Te) !== 0) { + if (t & Ne && (e.f &= ~Wn), (t & $t) !== 0) { for (var n = ( /** @type {Value[]} */ - t.deps + e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; if (Gr( /** @type {Derived} */ s - ) && mo( + ) && _o( /** @type {Derived} */ s - ), s.wv > t.wv) + ), s.wv > e.wv) return !0; } - (e & ge) !== 0 && // During time traveling we don't want to reset the status so that + (t & pt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Ct === null && vt(t, Et); + Se === null && de(e, Ae); } return !1; } -function qo(t, e, n = !0) { - var r = t.reactions; - if (r !== null && !(_e !== null && cr.call(_e, t))) +function Lo(e, t, n = !0) { + var r = e.reactions; + if (r !== null && !(vt !== null && fr.call(vt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & St) !== 0 ? qo( + (s.f & Ne) !== 0 ? Lo( /** @type {Derived} */ s, - e, + t, !1 - ) : e === s && (n ? vt(s, Nt) : (s.f & Et) !== 0 && vt(s, Te), Ae( + ) : t === s && (n ? de(s, ke) : (s.f & Ae) !== 0 && de(s, $t), xt( /** @type {Effect} */ s )); } } -function Vo(t) { +function qo(e) { var b; - var e = Kt, n = ne, r = he, i = X, s = _e, a = oe, o = Ee, l = Xn, u = t.f; - Kt = /** @type {null | Value[]} */ - null, ne = 0, he = null, X = (u & (Re | En)) === 0 ? t : null, _e = null, dr(t.ctx), Ee = !1, Xn = ++On, t.ac !== null && (Co(() => { - t.ac.abort(Mn); - }), t.ac = null); + var t = je, n = et, r = ft, i = B, s = vt, a = st, o = bt, l = Bn, u = e.f; + je = /** @type {null | Value[]} */ + null, et = 0, ft = null, B = (u & (At | En)) === 0 ? e : null, vt = null, hr(e.ctx), bt = !1, Bn = ++Dn, e.ac !== null && (Co(() => { + e.ac.abort(kn); + }), e.ac = null); try { - t.f |= ls; + e.f |= ls; var f = ( /** @type {Function} */ - t.fn + e.fn ), p = f(); - t.f |= yr; - var h = t.deps, d = K == null ? void 0 : K.is_fork; - if (Kt !== null) { + e.f |= mr; + var c = e.deps, d = K == null ? void 0 : K.is_fork; + if (je !== null) { var y; - if (d || Ir(t, ne), h !== null && ne > 0) - for (h.length = ne + Kt.length, y = 0; y < Kt.length; y++) - h[ne + y] = Kt[y]; + if (d || Ir(e, et), c !== null && et > 0) + for (c.length = et + je.length, y = 0; y < je.length; y++) + c[et + y] = je[y]; else - t.deps = h = Kt; - if (Fs() && (t.f & ge) !== 0) - for (y = ne; y < h.length; y++) - ((b = h[y]).reactions ?? (b.reactions = [])).push(t); - } else !d && h !== null && ne < h.length && (Ir(t, ne), h.length = ne); - if (io() && he !== null && !Ee && h !== null && (t.f & (St | Te | Nt)) === 0) + e.deps = c = je; + if (Fs() && (e.f & pt) !== 0) + for (y = et; y < c.length; y++) + ((b = c[y]).reactions ?? (b.reactions = [])).push(e); + } else !d && c !== null && et < c.length && (Ir(e, et), c.length = et); + if (ro() && ft !== null && !bt && c !== null && (e.f & (Ne | $t | ke)) === 0) for (y = 0; y < /** @type {Source[]} */ - he.length; y++) - qo( - he[y], + ft.length; y++) + Lo( + ft[y], /** @type {Effect} */ - t + e ); - if (i !== null && i !== t) { - if (On++, i.deps !== null) + if (i !== null && i !== e) { + if (Dn++, i.deps !== null) for (let m = 0; m < n; m += 1) - i.deps[m].rv = On; - if (e !== null) - for (const m of e) - m.rv = On; - he !== null && (r === null ? r = he : r.push(.../** @type {Source[]} */ - he)); + i.deps[m].rv = Dn; + if (t !== null) + for (const m of t) + m.rv = Dn; + ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ + ft)); } - return (t.f & wn) !== 0 && (t.f ^= wn), p; + return (e.f & wn) !== 0 && (e.f ^= wn), p; } catch (m) { - return ao(m); + return so(m); } finally { - t.f ^= ls, Kt = e, ne = n, he = r, X = i, _e = s, dr(a), Ee = o, Xn = l; + e.f ^= ls, je = t, et = n, ft = r, B = i, vt = s, hr(a), bt = o, Bn = l; } } -function Uu(t, e) { - let n = e.reactions; +function Xu(e, t) { + let n = t.reactions; if (n !== null) { - var r = Zl.call(n, t); + var r = jl.call(n, e); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & St) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Ne) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (Kt === null || !cr.call(Kt, e))) { + (je === null || !fr.call(je, t))) { var s = ( /** @type {Derived} */ - e + t ); - (s.f & ge) !== 0 && (s.f ^= ge, s.f &= ~Un), Ps(s), Fu(s), Ir(s, 0); + (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Wn), Ps(s), Du(s), Ir(s, 0); } } -function Ir(t, e) { - var n = t.deps; +function Ir(e, t) { + var n = e.deps; if (n !== null) - for (var r = e; r < n.length; r++) - Uu(t, n[r]); -} -function gr(t) { - var e = t.f; - if ((e & ln) === 0) { - vt(t, Et); - var n = J, r = di; - J = t, di = !0; + for (var r = t; r < n.length; r++) + Xu(e, n[r]); +} +function vr(e) { + var t = e.f; + if ((t & ln) === 0) { + de(e, Ae); + var n = J, r = hi; + J = e, hi = !0; try { - (e & (hn | Ja)) !== 0 ? Bu(t) : Vs(t), ko(t); - var i = Vo(t); - t.teardown = typeof i == "function" ? i : null, t.wv = Io; + (t & (hn | ja)) !== 0 ? Hu(e) : Vs(e), No(e); + var i = qo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Fo; var s; - os && $u && (t.f & Nt) !== 0 && t.deps; + os && xu && (e.f & ke) !== 0 && e.deps; } finally { - di = r, J = n; + hi = r, J = n; } } } -function x(t) { - var e = t.f, n = (e & St) !== 0; - if (X !== null && !Ee) { +function x(e) { + var t = e.f, n = (t & Ne) !== 0; + if (B !== null && !bt) { var r = J !== null && (J.f & ln) !== 0; - if (!r && (_e === null || !cr.call(_e, t))) { - var i = X.deps; - if ((X.f & ls) !== 0) - t.rv < On && (t.rv = On, Kt === null && i !== null && i[ne] === t ? ne++ : Kt === null ? Kt = [t] : Kt.push(t)); + if (!r && (vt === null || !fr.call(vt, e))) { + var i = B.deps; + if ((B.f & ls) !== 0) + e.rv < Dn && (e.rv = Dn, je === null && i !== null && i[et] === e ? et++ : je === null ? je = [e] : je.push(e)); else { - (X.deps ?? (X.deps = [])).push(t); - var s = t.reactions; - s === null ? t.reactions = [X] : cr.call(s, X) || s.push(X); + (B.deps ?? (B.deps = [])).push(e); + var s = e.reactions; + s === null ? e.reactions = [B] : fr.call(s, B) || s.push(B); } } } - if (An && bn.has(t)) - return bn.get(t); + if (An && bn.has(e)) + return bn.get(e); if (n) { var a = ( /** @type {Derived} */ - t + e ); if (An) { var o = a.v; - return ((a.f & Et) === 0 && a.reactions !== null || Ho(a)) && (o = Ds(a)), bn.set(a, o), o; + return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; } - var l = (a.f & ge) === 0 && !Ee && X !== null && (di || (X.f & ge) !== 0), u = (a.f & yr) === 0; - Gr(a) && (l && (a.f |= ge), mo(a)), l && !u && (yo(a), zo(a)); - } - if (Ct != null && Ct.has(t)) - return Ct.get(t); - if ((t.f & wn) !== 0) - throw t.v; - return t.v; -} -function zo(t) { - if (t.f |= ge, t.deps !== null) - for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & St) !== 0 && (e.f & ge) === 0 && (yo( + var l = (a.f & pt) === 0 && !bt && B !== null && (hi || (B.f & pt) !== 0), u = (a.f & mr) === 0; + Gr(a) && (l && (a.f |= pt), _o(a)), l && !u && (mo(a), Vo(a)); + } + if (Se != null && Se.has(e)) + return Se.get(e); + if ((e.f & wn) !== 0) + throw e.v; + return e.v; +} +function Vo(e) { + if (e.f |= pt, e.deps !== null) + for (const t of e.deps) + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (mo( /** @type {Derived} */ - e - ), zo( + t + ), Vo( /** @type {Derived} */ - e + t )); } -function Ho(t) { - if (t.v === Rt) return !0; - if (t.deps === null) return !1; - for (const e of t.deps) - if (bn.has(e) || (e.f & St) !== 0 && Ho( +function zo(e) { + if (e.v === Re) return !0; + if (e.deps === null) return !1; + for (const t of e.deps) + if (bn.has(t) || (t.f & Ne) !== 0 && zo( /** @type {Derived} */ - e + t )) return !0; return !1; } -function Wi(t) { - var e = Ee; +function Xi(e) { + var t = bt; try { - return Ee = !0, t(); + return bt = !0, e(); } finally { - Ee = e; + bt = t; } } -const Yo = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Gu(t) { - for (var e = 0; e < t.length; e++) - Yo.add(t[e]); +const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); +function Wu(e) { + for (var t = 0; t < e.length; t++) + Ho.add(e[t]); for (var n of ms) - n(t); + n(e); } -let va = null; -function ga(t) { +let pa = null; +function va(e) { var m; - var e = this, n = ( + var t = this, n = ( /** @type {Node} */ - e.ownerDocument - ), r = t.type, i = ((m = t.composedPath) == null ? void 0 : m.call(t)) || [], s = ( + t.ownerDocument + ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( /** @type {null | Element} */ - i[0] || t.target + i[0] || e.target ); - va = t; - var a = 0, o = va === t && t.__root; + pa = e; + var a = 0, o = pa === e && e.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (e === document || e === /** @type {any} */ + if (l !== -1 && (t === document || t === /** @type {any} */ window)) { - t.__root = e; + e.__root = t; return; } - var u = i.indexOf(e); + var u = i.indexOf(t); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || t.target, s !== e) { - Ai(t, "currentTarget", { + i[a] || e.target, s !== t) { + $i(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = X, p = J; - me(null), He(null); + var f = B, p = J; + gt(null), qt(null); try { - for (var h, d = []; s !== null; ) { + for (var c, d = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { @@ -1840,62 +1840,62 @@ function ga(t) { b != null && (!/** @type {any} */ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place - t.target === s) && b.call(s, t); + e.target === s) && b.call(s, e); } catch ($) { - h ? d.push($) : h = $; + c ? d.push($) : c = $; } - if (t.cancelBubble || y === e || y === null) + if (e.cancelBubble || y === t || y === null) break; s = y; } - if (h) { + if (c) { for (let $ of d) queueMicrotask(() => { throw $; }); - throw h; + throw c; } } finally { - t.__root = e, delete t.currentTarget, me(f), He(p); + e.__root = t, delete e.currentTarget, gt(f), qt(p); } } } -var Ba, Xa; -const es = (Xa = (Ba = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ba.trustedTypes) == null ? void 0 : /* @__PURE__ */ Xa.createPolicy( +var Ya, Ba; +const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (t) => t + createHTML: (e) => e } ); -function Ku(t) { +function Uu(e) { return ( /** @type {string} */ - (es == null ? void 0 : es.createHTML(t)) ?? t + (ts == null ? void 0 : ts.createHTML(e)) ?? e ); } -function Bo(t, e = !1) { +function Yo(e, t = !1) { var n = Os("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Ku(t) : t, n.content; + return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; } -function $n(t, e) { +function $n(e, t) { var n = ( /** @type {Effect} */ J ); - n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); + n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function We(t, e) { - var n = (e & jl) !== 0, r = (e & Jl) !== 0, i, s = !t.startsWith(""); +function Yt(e, t) { + var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); return () => { if (j) - return $n(W, null), W; - i === void 0 && (i = Bo(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ + return $n(X, null), X; + i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ fn(i))); var a = ( /** @type {TemplateNode} */ - r || $o ? document.importNode(i, !0) : i.cloneNode(!0) + r || bo ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( @@ -1912,15 +1912,15 @@ function We(t, e) { }; } // @__NO_SIDE_EFFECTS__ -function ju(t, e, n = "svg") { - var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; +function Gu(e, t, n = "svg") { + var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { if (j) - return $n(W, null), W; + return $n(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - Bo(i, !0) + Yo(i, !0) ), o = ( /** @type {Element} */ /* @__PURE__ */ fn(a) @@ -1936,125 +1936,125 @@ function ju(t, e, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Ju(t, e) { - return /* @__PURE__ */ ju(t, e, "svg"); +function Ku(e, t) { + return /* @__PURE__ */ Gu(e, t, "svg"); } -function _a(t = "") { +function ga(e = "") { if (!j) { - var e = ae(t + ""); - return $n(e, e), e; + var t = it(e + ""); + return $n(t, t), t; } - var n = W; - return n.nodeType !== Ur ? (n.before(n = ae()), qt(n)) : Xi( + var n = X; + return n.nodeType !== Ur ? (n.before(n = it()), qe(n)) : Bi( /** @type {Text} */ n ), $n(n, n), n; } -function Ut(t, e) { +function Ge(e, t) { if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ J ); - ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = W), Vi(); + ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = X), qi(); return; } - t !== null && t.before( + e !== null && e.before( /** @type {Node} */ - e + t ); } -const Zu = ["touchstart", "touchmove"]; -function Qu(t) { - return Zu.includes(t); +const ju = ["touchstart", "touchmove"]; +function Ju(e) { + return ju.includes(e); } -function mn(t, e) { - var n = e == null ? "" : typeof e == "object" ? e + "" : e; - n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); +function mn(e, t) { + var n = t == null ? "" : typeof t == "object" ? t + "" : t; + n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); } -function Xo(t, e) { - return Wo(t, e); +function Bo(e, t) { + return Xo(e, t); } -function tf(t, e) { - _s(), e.intro = e.intro ?? !1; - const n = e.target, r = j, i = W; +function Zu(e, t) { + _s(), t.intro = t.intro ?? !1; + const n = t.target, r = j, i = X; try { - for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== wr || /** @type {Comment} */ + for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== yr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ Be(s); + s = /* @__PURE__ */ zt(s); if (!s) - throw fr; - on(!0), qt( + throw ur; + on(!0), qe( /** @type {Comment} */ s ); - const a = Wo(t, { ...e, anchor: s }); + const a = Xo(e, { ...t, anchor: s }); return on(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== fr && console.warn("Failed to hydrate: ", a), e.recover === !1 && vu(), _s(), To(n), on(!1), Xo(t, e); + return a !== ur && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), _s(), Eo(n), on(!1), Bo(e, t); } finally { - on(r), qt(i); + on(r), qe(i); } } -const ii = /* @__PURE__ */ new Map(); -function Wo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +const ri = /* @__PURE__ */ new Map(); +function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { _s(); var o = /* @__PURE__ */ new Set(), l = (p) => { - for (var h = 0; h < p.length; h++) { - var d = p[h]; + for (var c = 0; c < p.length; c++) { + var d = p[c]; if (!o.has(d)) { o.add(d); - var y = Qu(d); - for (const $ of [e, document]) { - var b = ii.get($); - b === void 0 && (b = /* @__PURE__ */ new Map(), ii.set($, b)); + var y = Ju(d); + for (const $ of [t, document]) { + var b = ri.get($); + b === void 0 && (b = /* @__PURE__ */ new Map(), ri.set($, b)); var m = b.get(d); - m === void 0 ? ($.addEventListener(d, ga, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); + m === void 0 ? ($.addEventListener(d, va, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); } } } }; - l(Ii(Yo)), ms.add(l); - var u = void 0, f = Hu(() => { - var p = n ?? e.appendChild(ae()); - return Su( + l(Fi(Ho)), ms.add(l); + var u = void 0, f = Vu(() => { + var p = n ?? t.appendChild(it()); + return Cu( /** @type {TemplateNode} */ p, { pending: () => { } }, - (h) => { - zi({}); + (c) => { + Vi({}); var d = ( /** @type {ComponentContext} */ - oe + st ); if (s && (d.c = s), i && (r.$$events = i), j && $n( /** @type {TemplateNode} */ - h, + c, null - ), u = t(h, r) || {}, j && (J.nodes.end = W, W === null || W.nodeType !== wr || /** @type {Comment} */ - W.data !== ks)) - throw qi(), fr; - Hi(); + ), u = e(c, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ + X.data !== ks)) + throw Li(), ur; + zi(); } ), () => { var b; - for (var h of o) - for (const m of [e, document]) { + for (var c of o) + for (const m of [t, document]) { var d = ( /** @type {Map} */ - ii.get(m) + ri.get(m) ), y = ( /** @type {number} */ - d.get(h) + d.get(c) ); - --y == 0 ? (m.removeEventListener(h, ga), d.delete(h), d.size === 0 && ii.delete(m)) : d.set(h, y); + --y == 0 ? (m.removeEventListener(c, va), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); } ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); }; @@ -2062,21 +2062,21 @@ function Wo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int return ys.set(u, f), u; } let ys = /* @__PURE__ */ new WeakMap(); -function ef(t, e) { - const n = ys.get(t); - return n ? (ys.delete(t), n(e)) : Promise.resolve(); +function Qu(e, t) { + const n = ys.get(e); + return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var be, qe, ie, Hn, Xr, Wr, Oi; -class nf { +var yt, Ft, nt, zn, Xr, Wr, Di; +class ef { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(e, n = !0) { + constructor(t, n = !0) { /** @type {TemplateNode} */ - dt(this, "anchor"); + ce(this, "anchor"); /** @type {Map} */ - B(this, be, /* @__PURE__ */ new Map()); + H(this, yt, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,122 +2091,122 @@ class nf { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - B(this, qe, /* @__PURE__ */ new Map()); + H(this, Ft, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - B(this, ie, /* @__PURE__ */ new Map()); + H(this, nt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - B(this, Hn, /* @__PURE__ */ new Set()); + H(this, zn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - B(this, Xr, !0); - B(this, Wr, () => { - var e = ( + H(this, Xr, !0); + H(this, Wr, () => { + var t = ( /** @type {Batch} */ K ); - if (v(this, be).has(e)) { + if (v(this, yt).has(t)) { var n = ( /** @type {Key} */ - v(this, be).get(e) - ), r = v(this, qe).get(n); + v(this, yt).get(t) + ), r = v(this, Ft).get(n); if (r) - zs(r), v(this, Hn).delete(n); + zs(r), v(this, zn).delete(n); else { - var i = v(this, ie).get(n); - i && (v(this, qe).set(n, i.effect), v(this, ie).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, nt).get(n); + i && (v(this, Ft).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, be)) { - if (v(this, be).delete(s), s === e) + for (const [s, a] of v(this, yt)) { + if (v(this, yt).delete(s), s === t) break; - const o = v(this, ie).get(a); - o && (Vt(o.effect), v(this, ie).delete(a)); + const o = v(this, nt).get(a); + o && (Ve(o.effect), v(this, nt).delete(a)); } - for (const [s, a] of v(this, qe)) { - if (s === n || v(this, Hn).has(s)) continue; + for (const [s, a] of v(this, Ft)) { + if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, be).values()).includes(s)) { + if (Array.from(v(this, yt).values()).includes(s)) { var u = document.createDocumentFragment(); - Oo(a, u), u.append(ae()), v(this, ie).set(s, { effect: a, fragment: u }); + Do(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); } else - Vt(a); - v(this, Hn).delete(s), v(this, qe).delete(s); + Ve(a); + v(this, zn).delete(s), v(this, Ft).delete(s); }; - v(this, Xr) || !r ? (v(this, Hn).add(s), Bn(a, o, !1)) : o(); + v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - B(this, Oi, (e) => { - v(this, be).delete(e); - const n = Array.from(v(this, be).values()); - for (const [r, i] of v(this, ie)) - n.includes(r) || (Vt(i.effect), v(this, ie).delete(r)); + H(this, Di, (t) => { + v(this, yt).delete(t); + const n = Array.from(v(this, yt).values()); + for (const [r, i] of v(this, nt)) + n.includes(r) || (Ve(i.effect), v(this, nt).delete(r)); }); - this.anchor = e, z(this, Xr, n); + this.anchor = t, V(this, Xr, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(e, n) { + ensure(t, n) { var r = ( /** @type {Batch} */ K - ), i = Ro(); - if (n && !v(this, qe).has(e) && !v(this, ie).has(e)) + ), i = To(); + if (n && !v(this, Ft).has(t) && !v(this, nt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = ae(); - s.append(a), v(this, ie).set(e, { - effect: ve(() => n(a)), + var s = document.createDocumentFragment(), a = it(); + s.append(a), v(this, nt).set(t, { + effect: dt(() => n(a)), fragment: s }); } else - v(this, qe).set( - e, - ve(() => n(this.anchor)) + v(this, Ft).set( + t, + dt(() => n(this.anchor)) ); - if (v(this, be).set(r, e), i) { - for (const [o, l] of v(this, qe)) - o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, ie)) - o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Wr)), r.ondiscard(v(this, Oi)); + if (v(this, yt).set(r, t), i) { + for (const [o, l] of v(this, Ft)) + o === t ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, nt)) + o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(v(this, Wr)), r.ondiscard(v(this, Di)); } else - j && (this.anchor = W), v(this, Wr).call(this); + j && (this.anchor = X), v(this, Wr).call(this); } } -be = new WeakMap(), qe = new WeakMap(), ie = new WeakMap(), Hn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Oi = new WeakMap(); -function rf(t) { - oe === null && lu(), Is(() => { - const e = Wi(t); - if (typeof e == "function") return ( +yt = new WeakMap(), Ft = new WeakMap(), nt = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Di = new WeakMap(); +function tf(e) { + st === null && au(), Is(() => { + const t = Xi(e); + if (typeof t == "function") return ( /** @type {() => void} */ - e + t ); }); } -function tr(t, e, n = !1) { - j && Vi(); - var r = new nf(t), i = n ? hr : 0; +function Qn(e, t, n = !1) { + j && qi(); + var r = new ef(e), i = n ? cr : 0; function s(a, o) { if (j) { - const f = eo(t); + const f = eo(e); var l; - if (f === Ns ? l = 0 : f === Fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = Ei(); - qt(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); + if (f === Ns ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = Ai(); + qe(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); return; } } @@ -2214,27 +2214,27 @@ function tr(t, e, n = !1) { } qs(() => { var a = !1; - e((o, l = 0) => { + t((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function pi(t, e) { - return e; +function di(e, t) { + return t; } -function sf(t, e, n) { - for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let p = e[o]; - Bn( +function nf(e, t, n) { + for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { + let p = t[o]; + Yn( p, () => { if (s) { if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { - var h = ( + var c = ( /** @type {Set} */ - t.outrogroups + e.outrogroups ); - ws(Ii(s.done)), h.delete(s), h.size === 0 && (t.outrogroups = null); + ws(Fi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2252,188 +2252,188 @@ function sf(t, e, n) { /** @type {Element} */ u.parentNode ); - To(f), f.append(u), t.items.clear(); + Eo(f), f.append(u), e.items.clear(); } - ws(e, !l); + ws(t, !l); } else s = { - pending: new Set(e), + pending: new Set(t), done: /* @__PURE__ */ new Set() - }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ws(t, e = !0) { - for (var n = 0; n < t.length; n++) - Vt(t[n], e); +function ws(e, t = !0) { + for (var n = 0; n < e.length; n++) + Ve(e[n], t); } -var ma; -function vi(t, e, n, r, i, s = null) { - var a = t, o = /* @__PURE__ */ new Map(), l = (e & Wa) !== 0; +var _a; +function pi(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; if (l) { var u = ( /** @type {Element} */ - t + e ); - a = j ? qt(/* @__PURE__ */ fn(u)) : u.appendChild(ae()); + a = j ? qe(/* @__PURE__ */ fn(u)) : u.appendChild(it()); } - j && Vi(); - var f = null, p = /* @__PURE__ */ _o(() => { + j && qi(); + var f = null, p = /* @__PURE__ */ go(() => { var $ = n(); - return Ga($) ? $ : $ == null ? [] : Ii($); - }), h, d = !0; + return Ua($) ? $ : $ == null ? [] : Fi($); + }), c, d = !0; function y() { - m.fallback = f, af(m, h, a, e, r), f !== null && (h.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Bn(f, () => { + m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Yn(f, () => { f = null; })); } var b = qs(() => { - h = /** @type {V[]} */ + c = /** @type {V[]} */ x(p); - var $ = h.length; + var $ = c.length; let D = !1; if (j) { - var M = eo(a) === Fi; - M !== ($ === 0) && (a = Ei(), qt(a), on(!1), D = !0); + var M = eo(a) === Oi; + M !== ($ === 0) && (a = Ai(), qe(a), on(!1), D = !0); } for (var S = /* @__PURE__ */ new Set(), I = ( /** @type {Batch} */ K - ), L = Ro(), U = 0; U < $; U += 1) { - j && W.nodeType === wr && /** @type {Comment} */ - W.data === ks && (a = /** @type {Comment} */ - W, D = !0, on(!1)); - var at = h[U], tt = r(at, U), G = d ? null : o.get(tt); - G ? (G.v && vr(G.v, at), G.i && vr(G.i, U), L && I.unskip_effect(G.e)) : (G = of( + ), L = To(), W = 0; W < $; W += 1) { + j && X.nodeType === yr && /** @type {Comment} */ + X.data === ks && (a = /** @type {Comment} */ + X, D = !0, on(!1)); + var oe = c[W], Q = r(oe, W), U = d ? null : o.get(Q); + U ? (U.v && pr(U.v, oe), U.i && pr(U.i, W), L && I.unskip_effect(U.e)) : (U = sf( o, - d ? a : ma ?? (ma = ae()), - at, - tt, - U, + d ? a : _a ?? (_a = it()), + oe, + Q, + W, i, - e, + t, n - ), d || (G.e.f |= an), o.set(tt, G)), S.add(tt); + ), d || (U.e.f |= an), o.set(Q, U)), S.add(Q); } - if ($ === 0 && s && !f && (d ? f = ve(() => s(a)) : (f = ve(() => s(ma ?? (ma = ae()))), f.f |= an)), $ > S.size && fu(), j && $ > 0 && qt(Ei()), !d) + if ($ === 0 && s && !f && (d ? f = dt(() => s(a)) : (f = dt(() => s(_a ?? (_a = it()))), f.f |= an)), $ > S.size && lu(), j && $ > 0 && qe(Ai()), !d) if (L) { - for (const [ot, ut] of o) - S.has(ot) || I.skip_effect(ut.e); + for (const [le, ue] of o) + S.has(le) || I.skip_effect(ue.e); I.oncommit(y), I.ondiscard(() => { }); } else y(); D && on(!0), x(p); }), m = { effect: b, items: o, outrogroups: null, fallback: f }; - d = !1, j && (a = W); + d = !1, j && (a = X); } -function Rr(t) { - for (; t !== null && (t.f & Re) === 0; ) - t = t.next; - return t; +function Cr(e) { + for (; e !== null && (e.f & At) === 0; ) + e = e.next; + return e; } -function af(t, e, n, r, i) { - var G, ot, ut, O, F, kt, ue, yt, wt; - var s = (r & Bl) !== 0, a = e.length, o = t.items, l = Rr(t.effect.first), u, f = null, p, h = [], d = [], y, b, m, $; +function rf(e, t, n, r, i) { + var U, le, ue, O, F, Me, ot, ye, we; + var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, c = [], d = [], y, b, m, $; if (s) for ($ = 0; $ < a; $ += 1) - y = e[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & an) === 0 && ((ot = (G = m.nodes) == null ? void 0 : G.a) == null || ot.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + y = t[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, (m.f & an) === 0 && ((le = (U = m.nodes) == null ? void 0 : U.a) == null || le.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); for ($ = 0; $ < a; $ += 1) { - if (y = e[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, t.outrogroups !== null) - for (const et of t.outrogroups) - et.pending.delete(m), et.done.delete(m); + if (y = t[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, e.outrogroups !== null) + for (const ee of e.outrogroups) + ee.pending.delete(m), ee.done.delete(m); if ((m.f & an) !== 0) if (m.f ^= an, m === l) Sr(m, null, n); else { var D = f ? f.next : l; - m === t.effect.last && (t.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(t, f, m), gn(t, m, D), Sr(m, D, n), f = m, h = [], d = [], l = Rr(f.next); + m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(e, f, m), gn(e, m, D), Sr(m, D, n), f = m, c = [], d = [], l = Cr(f.next); continue; } - if ((m.f & se) !== 0 && (zs(m), s && ((O = (ut = m.nodes) == null ? void 0 : ut.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { + if ((m.f & rt) !== 0 && (zs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { if (u !== void 0 && u.has(m)) { - if (h.length < d.length) { + if (c.length < d.length) { var M = d[0], S; f = M.prev; - var I = h[0], L = h[h.length - 1]; - for (S = 0; S < h.length; S += 1) - Sr(h[S], M, n); + var I = c[0], L = c[c.length - 1]; + for (S = 0; S < c.length; S += 1) + Sr(c[S], M, n); for (S = 0; S < d.length; S += 1) u.delete(d[S]); - gn(t, I.prev, L.next), gn(t, f, I), gn(t, L, M), l = M, f = L, $ -= 1, h = [], d = []; + gn(e, I.prev, L.next), gn(e, f, I), gn(e, L, M), l = M, f = L, $ -= 1, c = [], d = []; } else - u.delete(m), Sr(m, l, n), gn(t, m.prev, m.next), gn(t, m, f === null ? t.effect.first : f.next), gn(t, f, m), f = m; + u.delete(m), Sr(m, l, n), gn(e, m.prev, m.next), gn(e, m, f === null ? e.effect.first : f.next), gn(e, f, m), f = m; continue; } - for (h = [], d = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Rr(l.next); + for (c = [], d = []; l !== null && l !== m; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); if (l === null) continue; } - (m.f & an) === 0 && h.push(m), f = m, l = Rr(m.next); + (m.f & an) === 0 && c.push(m), f = m, l = Cr(m.next); } - if (t.outrogroups !== null) { - for (const et of t.outrogroups) - et.pending.size === 0 && (ws(Ii(et.done)), (F = t.outrogroups) == null || F.delete(et)); - t.outrogroups.size === 0 && (t.outrogroups = null); + if (e.outrogroups !== null) { + for (const ee of e.outrogroups) + ee.pending.size === 0 && (ws(Fi(ee.done)), (F = e.outrogroups) == null || F.delete(ee)); + e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var U = []; + var W = []; if (u !== void 0) for (m of u) - (m.f & se) === 0 && U.push(m); + (m.f & rt) === 0 && W.push(m); for (; l !== null; ) - (l.f & se) === 0 && l !== t.fallback && U.push(l), l = Rr(l.next); - var at = U.length; - if (at > 0) { - var tt = (r & Wa) !== 0 && a === 0 ? n : null; + (l.f & rt) === 0 && l !== e.fallback && W.push(l), l = Cr(l.next); + var oe = W.length; + if (oe > 0) { + var Q = (r & Xa) !== 0 && a === 0 ? n : null; if (s) { - for ($ = 0; $ < at; $ += 1) - (ue = (kt = U[$].nodes) == null ? void 0 : kt.a) == null || ue.measure(); - for ($ = 0; $ < at; $ += 1) - (wt = (yt = U[$].nodes) == null ? void 0 : yt.a) == null || wt.fix(); + for ($ = 0; $ < oe; $ += 1) + (ot = (Me = W[$].nodes) == null ? void 0 : Me.a) == null || ot.measure(); + for ($ = 0; $ < oe; $ += 1) + (we = (ye = W[$].nodes) == null ? void 0 : ye.a) == null || we.fix(); } - sf(t, U, tt); + nf(e, W, Q); } } s && xn(() => { - var et, Mt; + var ee, Pe; if (p !== void 0) for (m of p) - (Mt = (et = m.nodes) == null ? void 0 : et.a) == null || Mt.apply(); + (Pe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); }); } -function of(t, e, n, r, i, s, a, o) { - var l = (a & Hl) !== 0 ? (a & Xl) === 0 ? /* @__PURE__ */ xo(n, !1, !1) : Gn(n) : null, u = (a & Yl) !== 0 ? Gn(i) : null; +function sf(e, t, n, r, i, s, a, o) { + var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & zl) !== 0 ? Un(i) : null; return { v: l, i: u, - e: ve(() => (s(e, l ?? n, u ?? i, o), () => { - t.delete(r); + e: dt(() => (s(t, l ?? n, u ?? i, o), () => { + e.delete(r); })) }; } -function Sr(t, e, n) { - if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & an) === 0 ? ( +function Sr(e, t, n) { + if (e.nodes) + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & an) === 0 ? ( /** @type {EffectNodes} */ - e.nodes.start + t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Be(r) + /* @__PURE__ */ zt(r) ); if (s.before(r), r === i) return; r = a; } } -function gn(t, e, n) { - e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; +function gn(e, t, n) { + t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } -function Hs(t, e) { - No(() => { - var n = t.getRootNode(), r = ( +function Hs(e, t) { + So(() => { + var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Hs(t, e) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + e.hash)) { + if (!r.querySelector("#" + t.hash)) { const i = Os("style"); - i.id = e.hash, i.textContent = e.code, r.appendChild(i); + i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); } -const ya = [...` +const ma = [...` \r\f \v\uFEFF`]; -function lf(t, e, n) { - var r = t == null ? "" : "" + t; +function af(e, t, n) { + var r = e == null ? "" : "" + e; if (n) { for (var i in n) if (n[i]) @@ -2461,112 +2461,112 @@ function lf(t, e, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || ya.includes(r[a - 1])) && (o === r.length || ya.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (a === 0 || ma.includes(r[a - 1])) && (o === r.length || ma.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; } -function wa(t, e = !1) { - var n = e ? " !important;" : ";", r = ""; - for (var i in t) { - var s = t[i]; +function ya(e, t = !1) { + var n = t ? " !important;" : ";", r = ""; + for (var i in e) { + var s = e[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function uf(t, e) { - if (e) { +function of(e, t) { + if (t) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += wa(r)), i && (n += wa(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; } - return String(t); + return String(e); } -function si(t, e, n, r, i, s) { - var a = t.__className; +function ii(e, t, n, r, i, s) { + var a = e.__className; if (j || a !== n || a === void 0) { - var o = lf(n, r, s); - (!j || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; + var o = af(n, r, s); + (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; } else if (s && i !== s) for (var l in s) { var u = !!s[l]; - (i == null || u !== !!i[l]) && t.classList.toggle(l, u); + (i == null || u !== !!i[l]) && e.classList.toggle(l, u); } return s; } -function ns(t, e = {}, n, r) { +function ns(e, t = {}, n, r) { for (var i in n) { var s = n[i]; - e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); + t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function xa(t, e, n, r) { - var i = t.__style; - if (j || i !== e) { - var s = uf(e, r); - (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (ns(t, n == null ? void 0 : n[0], r[0]), ns(t, n == null ? void 0 : n[1], r[1], "important")) : ns(t, n, r)); +function wa(e, t, n, r) { + var i = e.__style; + if (j || i !== t) { + var s = of(t, r); + (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; + } else r && (Array.isArray(r) ? (ns(e, n == null ? void 0 : n[0], r[0]), ns(e, n == null ? void 0 : n[1], r[1], "important")) : ns(e, n, r)); return r; } -const ff = Symbol("is custom element"), cf = Symbol("is html"), hf = ou ? "link" : "LINK"; -function ba(t, e, n, r) { - var i = df(t); - j && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === hf) || i[e] !== (i[e] = n) && (e === "loading" && (t[au] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && pf(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); +const lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; +function xa(e, t, n, r) { + var i = cf(e); + j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } -function df(t) { +function cf(e) { return ( /** @type {Record} **/ // @ts-expect-error - t.__attributes ?? (t.__attributes = { - [ff]: t.nodeName.includes("-"), - [cf]: t.namespaceURI === Ua + e.__attributes ?? (e.__attributes = { + [lf]: e.nodeName.includes("-"), + [uf]: e.namespaceURI === Wa }) ); } -var $a = /* @__PURE__ */ new Map(); -function pf(t) { - var e = t.getAttribute("is") || t.nodeName, n = $a.get(e); +var ba = /* @__PURE__ */ new Map(); +function hf(e) { + var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); if (n) return n; - $a.set(e, n = []); - for (var r, i = t, s = Element.prototype; s !== i; ) { - r = Ql(i); + ba.set(t, n = []); + for (var r, i = e, s = Element.prototype; s !== i; ) { + r = Jl(i); for (var a in r) r[a].set && n.push(a); - i = Ka(i); + i = Ga(i); } return n; } -function Aa(t, e) { - return t === e || (t == null ? void 0 : t[Pr]) === e; +function $a(e, t) { + return e === t || (e == null ? void 0 : e[Pr]) === t; } -function gi(t = {}, e, n, r) { - return No(() => { +function vi(e = {}, t, n, r) { + return So(() => { var i, s; return Ls(() => { - i = s, s = [], Wi(() => { - t !== n(...s) && (e(t, ...s), i && Aa(n(...i), t) && e(null, ...i)); + i = s, s = [], Xi(() => { + e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); }); }), () => { xn(() => { - s && Aa(n(...s), t) && e(null, ...s); + s && $a(n(...s), e) && t(null, ...s); }); }; - }), t; + }), e; } -let ai = !1; -function vf(t) { - var e = ai; +let si = !1; +function df(e) { + var t = si; try { - return ai = !1, [t(), ai]; + return si = !1, [e(), si]; } finally { - ai = e; + si = t; } } -function st(t, e, n, r) { +function ae(e, t, n, r) { var D; - var i = (n & Gl) !== 0, s = (n & Kl) !== 0, a = ( + var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Wi( + ), o = !0, l = () => (o && (o = !1, a = s ? Xi( /** @type {() => V} */ r ) : ( @@ -2574,34 +2574,34 @@ function st(t, e, n, r) { r )), a), u; if (i) { - var f = Pr in t || to in t; - u = ((D = Yn(t, e)) == null ? void 0 : D.set) ?? (f && e in t ? (M) => t[e] = M : void 0); + var f = Pr in e || Qa in e; + u = ((D = Hn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); } - var p, h = !1; - i ? [p, h] = vf(() => ( + var p, c = !1; + i ? [p, c] = df(() => ( /** @type {V} */ - t[e] + e[t] )) : p = /** @type {V} */ - t[e], p === void 0 && r !== void 0 && (p = l(), u && (gu(), u(p))); + e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); var d; if (d = () => { var M = ( /** @type {V} */ - t[e] + e[t] ); return M === void 0 ? l() : (o = !0, M); - }, (n & Ul) === 0) + }, (n & Xl) === 0) return d; if (u) { - var y = t.$$legacy; + var y = e.$$legacy; return ( /** @type {() => V} */ (function(M, S) { - return arguments.length > 0 ? ((!S || y || h) && u(S ? d() : M), M) : d(); + return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); }) ); } - var b = !1, m = ((n & Wl) !== 0 ? Bi : _o)(() => (b = !1, d())); + var b = !1, m = ((n & Bl) !== 0 ? Yi : go)(() => (b = !1, d())); i && x(m); var $ = ( /** @type {Effect} */ @@ -2611,149 +2611,149 @@ function st(t, e, n, r) { /** @type {() => V} */ (function(M, S) { if (arguments.length > 0) { - const I = S ? x(m) : i ? Dn(M) : M; - return pt(m, I), b = !0, a !== void 0 && (a = I), M; + const I = S ? x(m) : i ? Pn(M) : M; + return he(m, I), b = !0, a !== void 0 && (a = I), M; } return An && b || ($.f & ln) !== 0 ? m.v : x(m); }) ); } -function gf(t) { - return new _f(t); +function pf(e) { + return new vf(e); } -var sn, pe; -class _f { +var sn, ht; +class vf { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(e) { + constructor(t) { /** @type {any} */ - B(this, sn); + H(this, sn); /** @type {Record} */ - B(this, pe); + H(this, ht); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ xo(o, !1, !1); + var l = /* @__PURE__ */ wo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...e.props || {}, $$events: {} }, + { ...t.props || {}, $$events: {} }, { get(a, o) { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === to ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return pt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return he(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - z(this, pe, (e.hydrate ? tf : Xo)(e.component, { - target: e.target, - anchor: e.anchor, + V(this, ht, (t.hydrate ? Zu : Bo)(t.component, { + target: t.target, + anchor: t.anchor, props: i, - context: e.context, - intro: e.intro ?? !1, - recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && rt(), z(this, sn, i.$$events); - for (const a of Object.keys(v(this, pe))) - a === "$set" || a === "$destroy" || a === "$on" || Ai(this, a, { + context: t.context, + intro: t.intro ?? !1, + recover: t.recover + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && re(), V(this, sn, i.$$events); + for (const a of Object.keys(v(this, ht))) + a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { get() { - return v(this, pe)[a]; + return v(this, ht)[a]; }, /** @param {any} value */ set(o) { - v(this, pe)[a] = o; + v(this, ht)[a] = o; }, enumerable: !0 }); - v(this, pe).$set = /** @param {Record} next */ + v(this, ht).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, pe).$destroy = () => { - ef(v(this, pe)); + }, v(this, ht).$destroy = () => { + Qu(v(this, ht)); }; } /** @param {Record} props */ - $set(e) { - v(this, pe).$set(e); + $set(t) { + v(this, ht).$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(e, n) { - v(this, sn)[e] = v(this, sn)[e] || []; + $on(t, n) { + v(this, sn)[t] = v(this, sn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, sn)[e].push(r), () => { - v(this, sn)[e] = v(this, sn)[e].filter( + return v(this, sn)[t].push(r), () => { + v(this, sn)[t] = v(this, sn)[t].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, pe).$destroy(); + v(this, ht).$destroy(); } } -sn = new WeakMap(), pe = new WeakMap(); -let Uo; -typeof HTMLElement == "function" && (Uo = class extends HTMLElement { +sn = new WeakMap(), ht = new WeakMap(); +let Wo; +typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(e, n, r) { + constructor(t, n, r) { super(); /** The Svelte component constructor */ - dt(this, "$$ctor"); + ce(this, "$$ctor"); /** Slots */ - dt(this, "$$s"); + ce(this, "$$s"); /** @type {any} The Svelte component instance */ - dt(this, "$$c"); + ce(this, "$$c"); /** Whether or not the custom element is connected */ - dt(this, "$$cn", !1); + ce(this, "$$cn", !1); /** @type {Record} Component props data */ - dt(this, "$$d", {}); + ce(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - dt(this, "$$r", !1); + ce(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - dt(this, "$$p_d", {}); + ce(this, "$$p_d", {}); /** @type {Record} Event listeners */ - dt(this, "$$l", {}); + ce(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - dt(this, "$$l_u", /* @__PURE__ */ new Map()); + ce(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - dt(this, "$$me"); + ce(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - dt(this, "$$shadowRoot", null); - this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + ce(this, "$$shadowRoot", null); + this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(e, n, r) { - if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { - const i = this.$$c.$on(e, n); + addEventListener(t, n, r) { + if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { + const i = this.$$c.$on(t, n); this.$$l_u.set(n, i); } - super.addEventListener(e, n, r); + super.addEventListener(t, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(e, n, r) { - if (super.removeEventListener(e, n, r), this.$$c) { + removeEventListener(t, n, r) { + if (super.removeEventListener(t, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2763,22 +2763,22 @@ typeof HTMLElement == "function" && (Uo = class extends HTMLElement { let n = function(s) { return (a) => { const o = Os("slot"); - s !== "default" && (o.name = s), Ut(a, o); + s !== "default" && (o.name = s), Ge(a, o); }; }; - var e = n; + var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = mf(this); + const r = {}, i = gf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { const a = this.$$g_p(s.name); - a in this.$$d || (this.$$d[a] = _i(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = gi(a, s.value, this.$$p_d, "toProp")); } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = gf({ + this.$$c = pf({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,14 +2786,14 @@ typeof HTMLElement == "function" && (Uo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = zu(() => { + }), this.$$me = qu(() => { Ls(() => { var s; this.$$r = !0; - for (const a of $i(this.$$c)) { + for (const a of bi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = _i( + const o = gi( a, this.$$d[a], this.$$p_d, @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Uo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(e, n, r) { + attributeChangedCallback(t, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = _i(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = gi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,637 +2831,637 @@ typeof HTMLElement == "function" && (Uo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(e) { - return $i(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e - ) || e; + $$g_p(t) { + return bi(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t + ) || t; } }); -function _i(t, e, n, r) { +function gi(e, t, n, r) { var s; - const i = (s = n[t]) == null ? void 0 : s.type; - if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) - return e; + const i = (s = n[e]) == null ? void 0 : s.type; + if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) + return t; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return e == null ? null : JSON.stringify(e); + return t == null ? null : JSON.stringify(t); case "Boolean": - return e ? "" : null; + return t ? "" : null; case "Number": - return e ?? null; + return t ?? null; default: - return e; + return t; } else switch (i) { case "Object": case "Array": - return e && JSON.parse(e); + return t && JSON.parse(t); case "Boolean": - return e; + return t; // conversion already handled above case "Number": - return e != null ? +e : e; + return t != null ? +t : t; default: - return e; + return t; } } -function mf(t) { - const e = {}; - return t.childNodes.forEach((n) => { - e[ +function gf(e) { + const t = {}; + return e.childNodes.forEach((n) => { + t[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), e; + }), t; } -function Ys(t, e, n, r, i, s) { - let a = class extends Uo { +function Ys(e, t, n, r, i, s) { + let a = class extends Wo { constructor() { - super(t, n, i), this.$$p_d = e; + super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return $i(e).map( - (o) => (e[o].attribute || o).toLowerCase() + return bi(t).map( + (o) => (t[o].attribute || o).toLowerCase() ); } }; - return $i(e).forEach((o) => { - Ai(a.prototype, o, { + return bi(t).forEach((o) => { + $i(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var p; - l = _i(o, l, e), this.$$d[o] = l; + l = gi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (p = Yn(u, o)) == null ? void 0 : p.get; + var f = (p = Hn(u, o)) == null ? void 0 : p.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - Ai(a.prototype, o, { + $i(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), t.element = /** @type {any} */ + }), e.element = /** @type {any} */ a, a; } -var yf = { value: () => { +var _f = { value: () => { } }; -function Go() { - 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); +function Uo() { + for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { + if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new mi(n); + return new _i(n); } -function mi(t) { - this._ = t; +function _i(e) { + this._ = e; } -function wf(t, e) { - return t.trim().split(/^|\s+/).map(function(n) { +function mf(e, t) { + return e.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); + if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -mi.prototype = Go.prototype = { - constructor: mi, - on: function(t, e) { - var n = this._, r = wf(t + "", n), i, s = -1, a = r.length; +_i.prototype = Uo.prototype = { + constructor: _i, + on: function(e, t) { + var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = xf(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; return; } - if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); + if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = Ea(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = Ea(n[i], t.name, null); + if (i = (e = r[s]).type) n[i] = Aa(n[i], e.name, t); + else if (t == null) for (i in n) n[i] = Aa(n[i], e.name, null); return this; }, copy: function() { - var t = {}, e = this._; - for (var n in e) t[n] = e[n].slice(); - return new mi(t); + var e = {}, t = this._; + for (var n in t) e[n] = t[n].slice(); + return new _i(e); }, - call: function(t, e) { + call: function(e, t) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); }, - apply: function(t, e, n) { - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); + apply: function(e, t, n) { + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function xf(t, e) { - for (var n = 0, r = t.length, i; n < r; ++n) - if ((i = t[n]).name === e) +function yf(e, t) { + for (var n = 0, r = e.length, i; n < r; ++n) + if ((i = e[n]).name === t) return i.value; } -function Ea(t, e, n) { - for (var r = 0, i = t.length; r < i; ++r) - if (t[r].name === e) { - t[r] = yf, t = t.slice(0, r).concat(t.slice(r + 1)); +function Aa(e, t, n) { + for (var r = 0, i = e.length; r < i; ++r) + if (e[r].name === t) { + e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); break; } - return n != null && t.push({ name: e, value: n }), t; + return n != null && e.push({ name: t, value: n }), e; } var xs = "http://www.w3.org/1999/xhtml"; -const Ta = { +const Ea = { svg: "http://www.w3.org/2000/svg", xhtml: xs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Ui(t) { - var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ta.hasOwnProperty(e) ? { space: Ta[e], local: t } : t; +function Wi(e) { + var t = e += "", n = t.indexOf(":"); + return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ea.hasOwnProperty(t) ? { space: Ea[t], local: e } : e; } -function bf(t) { +function wf(e) { return function() { - var e = this.ownerDocument, n = this.namespaceURI; - return n === xs && e.documentElement.namespaceURI === xs ? e.createElement(t) : e.createElementNS(n, t); + var t = this.ownerDocument, n = this.namespaceURI; + return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); }; } -function $f(t) { +function xf(e) { return function() { - return this.ownerDocument.createElementNS(t.space, t.local); + return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Ko(t) { - var e = Ui(t); - return (e.local ? $f : bf)(e); +function Go(e) { + var t = Wi(e); + return (t.local ? xf : wf)(t); } -function Af() { +function bf() { } -function Bs(t) { - return t == null ? Af : function() { - return this.querySelector(t); +function Bs(e) { + return e == null ? bf : function() { + return this.querySelector(e); }; } -function Ef(t) { - typeof t != "function" && (t = Bs(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new le(r, this._parents); +function $f(e) { + typeof e != "function" && (e = Bs(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new at(r, this._parents); } -function Tf(t) { - return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +function Af(e) { + return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function Rf() { +function Ef() { return []; } -function jo(t) { - return t == null ? Rf : function() { - return this.querySelectorAll(t); +function Ko(e) { + return e == null ? Ef : function() { + return this.querySelectorAll(e); }; } -function Cf(t) { +function Tf(e) { return function() { - return Tf(t.apply(this, arguments)); + return Af(e.apply(this, arguments)); }; } -function Sf(t) { - typeof t == "function" ? t = Cf(t) : t = jo(t); - for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new le(r, i); +function Cf(e) { + typeof e == "function" ? e = Tf(e) : e = Ko(e); + for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); + return new at(r, i); } -function Jo(t) { +function jo(e) { return function() { - return this.matches(t); + return this.matches(e); }; } -function Zo(t) { - return function(e) { - return e.matches(t); +function Jo(e) { + return function(t) { + return t.matches(e); }; } -var Nf = Array.prototype.find; -function kf(t) { +var Rf = Array.prototype.find; +function Sf(e) { return function() { - return Nf.call(this.children, t); + return Rf.call(this.children, e); }; } -function Mf() { +function Nf() { return this.firstElementChild; } -function Pf(t) { - return this.select(t == null ? Mf : kf(typeof t == "function" ? t : Zo(t))); +function kf(e) { + return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : Jo(e))); } -var Df = Array.prototype.filter; -function Of() { +var Mf = Array.prototype.filter; +function Pf() { return Array.from(this.children); } -function Ff(t) { +function Df(e) { return function() { - return Df.call(this.children, t); + return Mf.call(this.children, e); }; } -function If(t) { - return this.selectAll(t == null ? Of : Ff(typeof t == "function" ? t : Zo(t))); +function Of(e) { + return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : Jo(e))); } -function Lf(t) { - typeof t != "function" && (t = Jo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new le(r, this._parents); +function Ff(e) { + typeof e != "function" && (e = jo(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); + return new at(r, this._parents); } -function Qo(t) { - return new Array(t.length); +function Zo(e) { + return new Array(e.length); } -function qf() { - return new le(this._enter || this._groups.map(Qo), this._parents); +function If() { + return new at(this._enter || this._groups.map(Zo), this._parents); } -function Ti(t, e) { - this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +function Ei(e, t) { + this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -Ti.prototype = { - constructor: Ti, - appendChild: function(t) { - return this._parent.insertBefore(t, this._next); +Ei.prototype = { + constructor: Ei, + appendChild: function(e) { + return this._parent.insertBefore(e, this._next); }, - insertBefore: function(t, e) { - return this._parent.insertBefore(t, e); + insertBefore: function(e, t) { + return this._parent.insertBefore(e, t); }, - querySelector: function(t) { - return this._parent.querySelector(t); + querySelector: function(e) { + return this._parent.querySelector(e); }, - querySelectorAll: function(t) { - return this._parent.querySelectorAll(t); + querySelectorAll: function(e) { + return this._parent.querySelectorAll(e); } }; -function Vf(t) { +function Lf(e) { return function() { - return t; + return e; }; } -function zf(t, e, n, r, i, s) { - for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ti(t, s[a]); +function qf(e, t, n, r, i, s) { + for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) + (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(e, s[a]); for (; a < l; ++a) - (o = e[a]) && (i[a] = o); + (o = t[a]) && (i[a] = o); } -function Hf(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, p = s.length, h = new Array(f), d; +function Vf(e, t, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; for (o = 0; o < f; ++o) - (l = e[o]) && (h[o] = d = a.call(l, l.__data__, o, e) + "", u.has(d) ? i[o] = l : u.set(d, l)); + (l = t[o]) && (c[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); for (o = 0; o < p; ++o) - d = a.call(t, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ti(t, s[o]); + d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ei(e, s[o]); for (o = 0; o < f; ++o) - (l = e[o]) && u.get(h[o]) === l && (i[o] = l); + (l = t[o]) && u.get(c[o]) === l && (i[o] = l); } -function Yf(t) { - return t.__data__; +function zf(e) { + return e.__data__; } -function Bf(t, e) { - if (!arguments.length) return Array.from(this, Yf); - var n = e ? Hf : zf, r = this._parents, i = this._groups; - typeof t != "function" && (t = Vf(t)); +function Hf(e, t) { + if (!arguments.length) return Array.from(this, zf); + var n = t ? Vf : qf, r = this._parents, i = this._groups; + typeof e != "function" && (e = Lf(e)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], p = i[u], h = p.length, d = Xf(t.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(h); - n(f, p, b, m, $, d, e); + var f = r[u], p = i[u], c = p.length, d = Yf(e.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(c); + n(f, p, b, m, $, d, t); for (var D = 0, M = 0, S, I; D < y; ++D) if (S = b[D]) { for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; S._next = I || null; } } - return a = new le(a, r), a._enter = o, a._exit = l, a; + return a = new at(a, r), a._enter = o, a._exit = l, a; } -function Xf(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function Yf(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Wf() { - return new le(this._exit || this._groups.map(Qo), this._parents); +function Bf() { + return new at(this._exit || this._groups.map(Zo), this._parents); } -function Uf(t, e, n) { +function Xf(e, t, n) { var r = this.enter(), i = this, s = 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 ? s.remove() : n(s), r && i ? r.merge(i).order() : i; + return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Gf(t) { - for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) - for (var u = n[l], f = r[l], p = u.length, h = o[l] = new Array(p), d, y = 0; y < p; ++y) - (d = u[y] || f[y]) && (h[y] = d); +function Wf(e) { + for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) + for (var u = n[l], f = r[l], p = u.length, c = o[l] = new Array(p), d, y = 0; y < p; ++y) + (d = u[y] || f[y]) && (c[y] = d); for (; l < i; ++l) o[l] = n[l]; - return new le(o, this._parents); + return new at(o, this._parents); } -function Kf() { - for (var t = this._groups, e = -1, n = t.length; ++e < n; ) - for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) +function Uf() { + for (var e = this._groups, t = -1, n = e.length; ++t < n; ) + for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function jf(t) { - t || (t = Jf); - function e(p, h) { - return p && h ? t(p.__data__, h.__data__) : !p - !h; +function Gf(e) { + e || (e = Kf); + function t(p, c) { + return p && c ? e(p.__data__, c.__data__) : !p - !c; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); - l.sort(e); + l.sort(t); } - return new le(i, this._parents).order(); + return new at(i, this._parents).order(); } -function Jf(t, e) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function Kf(e, t) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Zf() { - var t = arguments[0]; - return arguments[0] = this, t.apply(null, arguments), this; +function jf() { + var e = arguments[0]; + return arguments[0] = this, e.apply(null, arguments), this; } -function Qf() { +function Jf() { return Array.from(this); } -function tc() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length; i < s; ++i) { +function Zf() { + for (var e = this._groups, t = 0, n = e.length; t < n; ++t) + for (var r = e[t], i = 0, s = r.length; i < s; ++i) { var a = r[i]; if (a) return a; } return null; } -function ec() { - let t = 0; - for (const e of this) ++t; - return t; +function Qf() { + let e = 0; + for (const t of this) ++e; + return e; } -function nc() { +function ec() { return !this.node(); } -function rc(t) { - for (var e = this._groups, n = 0, r = e.length; n < r; ++n) - for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && t.call(o, o.__data__, s, i); +function tc(e) { + for (var t = this._groups, n = 0, r = t.length; n < r; ++n) + for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && e.call(o, o.__data__, s, i); return this; } -function ic(t) { +function nc(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function sc(t) { +function rc(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function ac(t, e) { +function ic(e, t) { return function() { - this.setAttribute(t, e); + this.setAttribute(e, t); }; } -function oc(t, e) { +function sc(e, t) { return function() { - this.setAttributeNS(t.space, t.local, e); + this.setAttributeNS(e.space, e.local, t); }; } -function lc(t, e) { +function ac(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function uc(t, e) { +function oc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function fc(t, e) { - var n = Ui(t); +function lc(e, t) { + var n = Wi(e); 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 ? sc : ic : typeof e == "function" ? n.local ? uc : lc : n.local ? oc : ac)(n, e)); + return this.each((t == null ? n.local ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); } -function tl(t) { - return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +function Qo(e) { + return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function cc(t) { +function uc(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function hc(t, e, n) { +function fc(e, t, n) { return function() { - this.style.setProperty(t, e, n); + this.style.setProperty(e, t, n); }; } -function dc(t, e, n) { +function cc(e, t, n) { return function() { - var r = e.apply(this, arguments); - r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + var r = t.apply(this, arguments); + r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function pc(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? cc : typeof e == "function" ? dc : hc)(t, e, n ?? "")) : _r(this.node(), t); +function hc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : gr(this.node(), e); } -function _r(t, e) { - return t.style.getPropertyValue(e) || tl(t).getComputedStyle(t, null).getPropertyValue(e); +function gr(e, t) { + return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); } -function vc(t) { +function dc(e) { return function() { - delete this[t]; + delete this[e]; }; } -function gc(t, e) { +function pc(e, t) { return function() { - this[t] = e; + this[e] = t; }; } -function _c(t, e) { +function vc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? delete this[t] : this[t] = n; + var n = t.apply(this, arguments); + n == null ? delete this[e] : this[e] = n; }; } -function mc(t, e) { - return arguments.length > 1 ? this.each((e == null ? vc : typeof e == "function" ? _c : gc)(t, e)) : this.node()[t]; +function gc(e, t) { + return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; } -function el(t) { - return t.trim().split(/^|\s+/); +function el(e) { + return e.trim().split(/^|\s+/); } -function Xs(t) { - return t.classList || new nl(t); +function Xs(e) { + return e.classList || new tl(e); } -function nl(t) { - this._node = t, this._names = el(t.getAttribute("class") || ""); +function tl(e) { + this._node = e, this._names = el(e.getAttribute("class") || ""); } -nl.prototype = { - add: function(t) { - var e = this._names.indexOf(t); - e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); +tl.prototype = { + add: function(e) { + var t = this._names.indexOf(e); + t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); }, - remove: function(t) { - var e = this._names.indexOf(t); - e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); + remove: function(e) { + var t = this._names.indexOf(e); + t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); }, - contains: function(t) { - return this._names.indexOf(t) >= 0; + contains: function(e) { + return this._names.indexOf(e) >= 0; } }; -function rl(t, e) { - for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function nl(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function il(t, e) { - for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function rl(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function yc(t) { +function _c(e) { return function() { - rl(this, t); + nl(this, e); }; } -function wc(t) { +function mc(e) { return function() { - il(this, t); + rl(this, e); }; } -function xc(t, e) { +function yc(e, t) { return function() { - (e.apply(this, arguments) ? rl : il)(this, t); + (t.apply(this, arguments) ? nl : rl)(this, e); }; } -function bc(t, e) { - var n = el(t + ""); +function wc(e, t) { + var n = el(e + ""); if (arguments.length < 2) { for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? xc : e ? yc : wc)(n, e)); + return this.each((typeof t == "function" ? yc : t ? _c : mc)(n, t)); } -function $c() { +function xc() { this.textContent = ""; } -function Ac(t) { +function bc(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function Ec(t) { +function $c(e) { return function() { - var e = t.apply(this, arguments); - this.textContent = e ?? ""; + var t = e.apply(this, arguments); + this.textContent = t ?? ""; }; } -function Tc(t) { - return arguments.length ? this.each(t == null ? $c : (typeof t == "function" ? Ec : Ac)(t)) : this.node().textContent; +function Ac(e) { + return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; } -function Rc() { +function Ec() { this.innerHTML = ""; } -function Cc(t) { +function Tc(e) { return function() { - this.innerHTML = t; + this.innerHTML = e; }; } -function Sc(t) { +function Cc(e) { return function() { - var e = t.apply(this, arguments); - this.innerHTML = e ?? ""; + var t = e.apply(this, arguments); + this.innerHTML = t ?? ""; }; } -function Nc(t) { - return arguments.length ? this.each(t == null ? Rc : (typeof t == "function" ? Sc : Cc)(t)) : this.node().innerHTML; +function Rc(e) { + return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; } -function kc() { +function Sc() { this.nextSibling && this.parentNode.appendChild(this); } -function Mc() { - return this.each(kc); +function Nc() { + return this.each(Sc); } -function Pc() { +function kc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Dc() { - return this.each(Pc); +function Mc() { + return this.each(kc); } -function Oc(t) { - var e = typeof t == "function" ? t : Ko(t); +function Pc(e) { + var t = typeof e == "function" ? e : Go(e); return this.select(function() { - return this.appendChild(e.apply(this, arguments)); + return this.appendChild(t.apply(this, arguments)); }); } -function Fc() { +function Dc() { return null; } -function Ic(t, e) { - var n = typeof t == "function" ? t : Ko(t), r = e == null ? Fc : typeof e == "function" ? e : Bs(e); +function Oc(e, t) { + var n = typeof e == "function" ? e : Go(e), r = t == null ? Dc : typeof t == "function" ? t : Bs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Lc() { - var t = this.parentNode; - t && t.removeChild(this); +function Fc() { + var e = this.parentNode; + e && e.removeChild(this); } -function qc() { - return this.each(Lc); +function Ic() { + return this.each(Fc); } -function Vc() { - var t = this.cloneNode(!1), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function Lc() { + var e = this.cloneNode(!1), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function zc() { - var t = this.cloneNode(!0), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function qc() { + var e = this.cloneNode(!0), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function Hc(t) { - return this.select(t ? zc : Vc); +function Vc(e) { + return this.select(e ? qc : Lc); } -function Yc(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; +function zc(e) { + return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function Bc(t) { - return function(e) { - t.call(this, e, this.__data__); +function Hc(e) { + return function(t) { + e.call(this, t, this.__data__); }; } -function Xc(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 Yc(e) { + return e.trim().split(/^|\s+/).map(function(t) { + var n = "", r = t.indexOf("."); + return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; }); } -function Wc(t) { +function Bc(e) { return function() { - var e = this.__on; - if (e) { - for (var n = 0, r = -1, i = e.length, s; n < i; ++n) - s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; - ++r ? e.length = r : delete this.__on; + var t = this.__on; + if (t) { + for (var n = 0, r = -1, i = t.length, s; n < i; ++n) + s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; + ++r ? t.length = r : delete this.__on; } }; } -function Uc(t, e, n) { +function Xc(e, t, n) { return function() { - var r = this.__on, i, s = Bc(e); + var r = this.__on, i, s = Hc(t); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === t.type && i.name === t.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; + if ((i = r[a]).type === e.type && i.name === e.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; return; } } - this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Gc(t, e, n) { - var r = Xc(t + ""), i, s = r.length, a; +function Wc(e, t, n) { + var r = Yc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Gc(t, e, n) { } return; } - for (o = e ? Uc : Wc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function sl(t, e, n) { - var r = tl(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 il(e, t, n) { + var r = Qo(e), i = r.CustomEvent; + typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); } -function Kc(t, e) { +function Uc(e, t) { return function() { - return sl(this, t, e); + return il(this, e, t); }; } -function jc(t, e) { +function Gc(e, t) { return function() { - return sl(this, t, e.apply(this, arguments)); + return il(this, e, t.apply(this, arguments)); }; } -function Jc(t, e) { - return this.each((typeof e == "function" ? jc : Kc)(t, e)); +function Kc(e, t) { + return this.each((typeof t == "function" ? Gc : Uc)(e, t)); } -function* Zc() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) +function* jc() { + for (var e = this._groups, t = 0, n = e.length; t < n; ++t) + for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var al = [null]; -function le(t, e) { - this._groups = t, this._parents = e; +var sl = [null]; +function at(e, t) { + this._groups = e, this._parents = t; } -function xr() { - return new le([[document.documentElement]], al); +function wr() { + return new at([[document.documentElement]], sl); } -function Qc() { +function Jc() { return this; } -le.prototype = xr.prototype = { - constructor: le, - select: Ef, - selectAll: Sf, - selectChild: Pf, - selectChildren: If, - filter: Lf, - data: Bf, - enter: qf, - exit: Wf, - join: Uf, - merge: Gf, - selection: Qc, - order: Kf, - sort: jf, - call: Zf, - nodes: Qf, - node: tc, - size: ec, - empty: nc, - each: rc, - attr: fc, - style: pc, - property: mc, - classed: bc, - text: Tc, - html: Nc, - raise: Mc, - lower: Dc, - append: Oc, - insert: Ic, - remove: qc, - clone: Hc, - datum: Yc, - on: Gc, - dispatch: Jc, - [Symbol.iterator]: Zc +at.prototype = wr.prototype = { + constructor: at, + select: $f, + selectAll: Cf, + selectChild: kf, + selectChildren: Of, + filter: Ff, + data: Hf, + enter: If, + exit: Bf, + join: Xf, + merge: Wf, + selection: Jc, + order: Uf, + sort: Gf, + call: jf, + nodes: Jf, + node: Zf, + size: Qf, + empty: ec, + each: tc, + attr: lc, + style: hc, + property: gc, + classed: wc, + text: Ac, + html: Rc, + raise: Nc, + lower: Mc, + append: Pc, + insert: Oc, + remove: Ic, + clone: Vc, + datum: zc, + on: Wc, + dispatch: Kc, + [Symbol.iterator]: jc }; -function ct(t) { - return typeof t == "string" ? new le([[document.querySelector(t)]], [document.documentElement]) : new le([[t]], al); +function fe(e) { + return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], sl); } -function Ws(t, e, n) { - t.prototype = e.prototype = n, n.constructor = t; +function Ws(e, t, n) { + e.prototype = t.prototype = n, n.constructor = e; } -function ol(t, e) { - var n = Object.create(t.prototype); - for (var r in e) n[r] = e[r]; +function al(e, t) { + var n = Object.create(e.prototype); + for (var r in t) n[r] = t[r]; return n; } function Kr() { } -var Lr = 0.7, Ri = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", th = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), nh = new RegExp(`^rgb\\(${ze},${ze},${ze}\\)$`), rh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), ih = new RegExp(`^rgba\\(${ze},${ze},${ze},${qr}\\)$`), sh = new RegExp(`^hsl\\(${qr},${ze},${ze}\\)$`), ah = new RegExp(`^hsla\\(${qr},${ze},${ze},${qr}\\)$`), Ra = { +var Lr = 0.7, Ti = 1 / Lr, tr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Lt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`), eh = new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`), th = new RegExp(`^rgba\\(${tr},${tr},${tr},${qr}\\)$`), nh = new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${qr}\\)$`), rh = new RegExp(`^hsl\\(${qr},${Lt},${Lt}\\)$`), ih = new RegExp(`^hsla\\(${qr},${Lt},${Lt},${qr}\\)$`), Ta = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,9 +3708,9 @@ var Lr = 0.7, Ri = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ws(Kr, Kn, { - copy(t) { - return Object.assign(new this.constructor(), this, t); +Ws(Kr, Gn, { + copy(e) { + return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); @@ -3718,233 +3718,233 @@ Ws(Kr, Kn, { hex: Ca, // Deprecated! Use color.formatHex. formatHex: Ca, - formatHex8: oh, - formatHsl: lh, - formatRgb: Sa, - toString: Sa + formatHex8: sh, + formatHsl: ah, + formatRgb: Ra, + toString: Ra }); function Ca() { return this.rgb().formatHex(); } -function oh() { +function sh() { return this.rgb().formatHex8(); } -function lh() { - return ll(this).formatHsl(); +function ah() { + return ol(this).formatHsl(); } -function Sa() { +function Ra() { return this.rgb().formatRgb(); } -function Kn(t) { - var e, n; - return t = (t + "").trim().toLowerCase(), (e = th.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Na(e) : n === 3 ? new jt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? oi(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? oi(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 = eh.exec(t)) ? new jt(e[1], e[2], e[3], 1) : (e = nh.exec(t)) ? new jt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = rh.exec(t)) ? oi(e[1], e[2], e[3], e[4]) : (e = ih.exec(t)) ? oi(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = sh.exec(t)) ? Pa(e[1], e[2] / 100, e[3] / 100, 1) : (e = ah.exec(t)) ? Pa(e[1], e[2] / 100, e[3] / 100, e[4]) : Ra.hasOwnProperty(t) ? Na(Ra[t]) : t === "transparent" ? new jt(NaN, NaN, NaN, 0) : null; +function Gn(e) { + var t, n; + return e = (e + "").trim().toLowerCase(), (t = Zc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Sa(t) : n === 3 ? new Je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, t[4]) : Ta.hasOwnProperty(e) ? Sa(Ta[e]) : e === "transparent" ? new Je(NaN, NaN, NaN, 0) : null; } -function Na(t) { - return new jt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Sa(e) { + return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function oi(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new jt(t, e, n, r); +function ai(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); } -function uh(t) { - return t instanceof Kr || (t = Kn(t)), t ? (t = t.rgb(), new jt(t.r, t.g, t.b, t.opacity)) : new jt(); +function oh(e) { + return e instanceof Kr || (e = Gn(e)), e ? (e = e.rgb(), new Je(e.r, e.g, e.b, e.opacity)) : new Je(); } -function bs(t, e, n, r) { - return arguments.length === 1 ? uh(t) : new jt(t, e, n, r ?? 1); +function bs(e, t, n, r) { + return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); } -function jt(t, e, n, r) { - this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +function Je(e, t, n, r) { + this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Ws(jt, bs, ol(Kr, { - brighter(t) { - return t = t == null ? Ri : Math.pow(Ri, t), new jt(this.r * t, this.g * t, this.b * t, this.opacity); +Ws(Je, bs, al(Kr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); }, - darker(t) { - return t = t == null ? Lr : Math.pow(Lr, t), new jt(this.r * t, this.g * t, this.b * t, this.opacity); + darker(e) { + return e = e == null ? Lr : Math.pow(Lr, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new jt(Wn(this.r), Wn(this.g), Wn(this.b), Ci(this.opacity)); + return new Je(Xn(this.r), Xn(this.g), Xn(this.b), Ci(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: ka, + hex: Na, // Deprecated! Use color.formatHex. - formatHex: ka, - formatHex8: fh, - formatRgb: Ma, - toString: Ma + formatHex: Na, + formatHex8: lh, + formatRgb: ka, + toString: ka })); -function ka() { - return `#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}`; +function Na() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function fh() { - return `#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}${Fn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function lh() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Ma() { - const t = Ci(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function ka() { + const e = Ci(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ci(t) { - return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +function Ci(e) { + return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function Wn(t) { - return Math.max(0, Math.min(255, Math.round(t) || 0)); +function Xn(e) { + return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function Fn(t) { - return t = Wn(t), (t < 16 ? "0" : "") + t.toString(16); +function On(e) { + return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); } -function Pa(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new $e(t, e, n, r); +function Ma(e, t, n, r) { + return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new wt(e, t, n, r); } -function ll(t) { - if (t instanceof $e) return new $e(t.h, t.s, t.l, t.opacity); - if (t instanceof Kr || (t = Kn(t)), !t) return new $e(); - if (t instanceof $e) return t; - t = t.rgb(); - var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new $e(a, o, l, t.opacity); +function ol(e) { + if (e instanceof wt) return new wt(e.h, e.s, e.l, e.opacity); + if (e instanceof Kr || (e = Gn(e)), !e) return new wt(); + if (e instanceof wt) return e; + e = e.rgb(); + var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new wt(a, o, l, e.opacity); } -function ch(t, e, n, r) { - return arguments.length === 1 ? ll(t) : new $e(t, e, n, r ?? 1); +function uh(e, t, n, r) { + return arguments.length === 1 ? ol(e) : new wt(e, t, n, r ?? 1); } -function $e(t, e, n, r) { - this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +function wt(e, t, n, r) { + this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Ws($e, ch, ol(Kr, { - brighter(t) { - return t = t == null ? Ri : Math.pow(Ri, t), new $e(this.h, this.s, this.l * t, this.opacity); +Ws(wt, uh, al(Kr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new wt(this.h, this.s, this.l * e, this.opacity); }, - darker(t) { - return t = t == null ? Lr : Math.pow(Lr, t), new $e(this.h, this.s, this.l * t, this.opacity); + darker(e) { + return e = e == null ? Lr : Math.pow(Lr, e), new wt(this.h, this.s, this.l * e, 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 jt( - rs(t >= 240 ? t - 240 : t + 120, i, r), - rs(t, i, r), - rs(t < 120 ? t + 240 : t - 120, i, r), + var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; + return new Je( + rs(e >= 240 ? e - 240 : e + 120, i, r), + rs(e, i, r), + rs(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new $e(Da(this.h), li(this.s), li(this.l), Ci(this.opacity)); + return new wt(Pa(this.h), oi(this.s), oi(this.l), Ci(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 = Ci(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Da(this.h)}, ${li(this.s) * 100}%, ${li(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const e = Ci(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function Da(t) { - return t = (t || 0) % 360, t < 0 ? t + 360 : t; +function Pa(e) { + return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function li(t) { - return Math.max(0, Math.min(1, t || 0)); +function oi(e) { + return Math.max(0, Math.min(1, e || 0)); } -function rs(t, e, n) { - return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; +function rs(e, t, n) { + return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; } -const Us = (t) => () => t; -function hh(t, e) { +const Us = (e) => () => e; +function fh(e, t) { return function(n) { - return t + n * e; + return e + n * t; }; } -function dh(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 ch(e, t, n) { + return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { + return Math.pow(e + r * t, n); }; } -function ph(t) { - return (t = +t) == 1 ? ul : function(e, n) { - return n - e ? dh(e, n, t) : Us(isNaN(e) ? n : e); +function hh(e) { + return (e = +e) == 1 ? ll : function(t, n) { + return n - t ? ch(t, n, e) : Us(isNaN(t) ? n : t); }; } -function ul(t, e) { - var n = e - t; - return n ? hh(t, n) : Us(isNaN(t) ? e : t); +function ll(e, t) { + var n = t - e; + return n ? fh(e, n) : Us(isNaN(e) ? t : e); } -const Si = (function t(e) { - var n = ph(e); +const Ri = (function e(t) { + var n = hh(t); function r(i, s) { - var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ul(i.opacity, s.opacity); + var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ll(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } - return r.gamma = t, r; + return r.gamma = e, r; })(1); -function vh(t, e) { - e || (e = []); - var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; +function dh(e, t) { + t || (t = []); + var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; + for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; return r; }; } -function gh(t) { - return ArrayBuffer.isView(t) && !(t instanceof DataView); +function ph(e) { + return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function _h(t, e) { - var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Ze(t[a], e[a]); - for (; a < n; ++a) s[a] = e[a]; +function vh(e, t) { + var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = Zt(e[a], t[a]); + for (; a < n; ++a) s[a] = t[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function mh(t, e) { +function gh(e, t) { var n = /* @__PURE__ */ new Date(); - return t = +t, e = +e, function(r) { - return n.setTime(t * (1 - r) + e * r), n; + return e = +e, t = +t, function(r) { + return n.setTime(e * (1 - r) + t * r), n; }; } -function Ve(t, e) { - return t = +t, e = +e, function(n) { - return t * (1 - n) + e * n; +function It(e, t) { + return e = +e, t = +t, function(n) { + return e * (1 - n) + t * n; }; } -function yh(t, e) { +function _h(e, t) { 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] = Ze(t[i], e[i]) : r[i] = e[i]; + (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); + for (i in t) + i in e ? n[i] = Zt(e[i], t[i]) : r[i] = t[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function wh(t) { +function mh(e) { return function() { - return t; + return e; }; } -function xh(t) { - return function(e) { - return t(e) + ""; +function yh(e) { + return function(t) { + return e(t) + ""; }; } -function fl(t, e) { +function ul(e, t) { var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = $s.exec(t)) && (i = is.exec(e)); ) - (s = i.index) > n && (s = e.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Ve(r, i) })), n = is.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? xh(l[0].x) : wh(e) : (e = l.length, function(u) { - for (var f = 0, p; f < e; ++f) o[(p = l[f]).i] = p.x(u); + for (e = e + "", t = t + ""; (r = $s.exec(e)) && (i = is.exec(t)); ) + (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: It(r, i) })), n = is.lastIndex; + return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? yh(l[0].x) : mh(t) : (t = l.length, function(u) { + for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); return o.join(""); }); } -function Ze(t, e) { - var n = typeof e, r; - return e == null || n === "boolean" ? Us(e) : (n === "number" ? Ve : n === "string" ? (r = Kn(e)) ? (e = r, Si) : fl : e instanceof Kn ? Si : e instanceof Date ? mh : gh(e) ? vh : Array.isArray(e) ? _h : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yh : Ve)(t, e); +function Zt(e, t) { + var n = typeof t, r; + return t == null || n === "boolean" ? Us(t) : (n === "number" ? It : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : ul : t instanceof Gn ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); } -var Oa = 180 / Math.PI, As = { +var Da = 180 / Math.PI, As = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,213 +3952,213 @@ var Oa = 180 / Math.PI, As = { scaleX: 1, scaleY: 1 }; -function cl(t, e, n, r, i, s) { +function fl(e, t, n, r, i, s) { var a, o, l; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { + return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * Oa, - skewX: Math.atan(l) * Oa, + rotate: Math.atan2(t, e) * Da, + skewX: Math.atan(l) * Da, scaleX: a, scaleY: o }; } -var ui; -function bh(t) { - const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? As : cl(e.a, e.b, e.c, e.d, e.e, e.f); +var li; +function wh(e) { + const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); + return t.isIdentity ? As : fl(t.a, t.b, t.c, t.d, t.e, t.f); } -function $h(t) { - return t == null || (ui || (ui = document.createElementNS("http://www.w3.org/2000/svg", "g")), ui.setAttribute("transform", t), !(t = ui.transform.baseVal.consolidate())) ? As : (t = t.matrix, cl(t.a, t.b, t.c, t.d, t.e, t.f)); +function xh(e) { + return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.f)); } -function hl(t, e, n, r) { +function cl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, p, h, d, y) { - if (u !== p || f !== h) { - var b = d.push("translate(", null, e, null, n); - y.push({ i: b - 4, x: Ve(u, p) }, { i: b - 2, x: Ve(f, h) }); - } else (p || h) && d.push("translate(" + p + e + h + n); + function s(u, f, p, c, d, y) { + if (u !== p || f !== c) { + var b = d.push("translate(", null, t, null, n); + y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); + } else (p || c) && d.push("translate(" + p + t + c + n); } - function a(u, f, p, h) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: Ve(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + function a(u, f, p, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); } - function o(u, f, p, h) { - u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: Ve(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + function o(u, f, p, c) { + u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); } - function l(u, f, p, h, d, y) { - if (u !== p || f !== h) { + function l(u, f, p, c, d, y) { + if (u !== p || f !== c) { var b = d.push(i(d) + "scale(", null, ",", null, ")"); - y.push({ i: b - 4, x: Ve(u, p) }, { i: b - 2, x: Ve(f, h) }); - } else (p !== 1 || h !== 1) && d.push(i(d) + "scale(" + p + "," + h + ")"); + y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); + } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); } return function(u, f) { - var p = [], h = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, h), a(u.rotate, f.rotate, p, h), o(u.skewX, f.skewX, p, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, h), u = f = null, function(d) { - for (var y = -1, b = h.length, m; ++y < b; ) p[(m = h[y]).i] = m.x(d); + var p = [], c = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { + for (var y = -1, b = c.length, m; ++y < b; ) p[(m = c[y]).i] = m.x(d); return p.join(""); }; }; } -var Ah = hl(bh, "px, ", "px)", "deg)"), Eh = hl($h, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, dl = 1e3, Ni, kr, ki = 0, jn = 0, Gi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, pl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { - setTimeout(t, 17); +var bh = cl(wh, "px, ", "px)", "deg)"), $h = cl(xh, ", ", ")", ")"), _r = 0, Nr = 0, Rr = 0, hl = 1e3, Si, kr, Ni = 0, Kn = 0, Ui = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { + setTimeout(e, 17); }; function Gs() { - return jn || (pl(Th), jn = Vr.now() + Gi); + return Kn || (dl(Ah), Kn = Vr.now() + Ui); } -function Th() { - jn = 0; +function Ah() { + Kn = 0; } -function Mi() { +function ki() { this._call = this._time = this._next = null; } -Mi.prototype = vl.prototype = { - constructor: Mi, - restart: function(t, e, n) { - if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Gs() : +n) + (e == null ? 0 : +e), !this._next && kr !== this && (kr ? kr._next = this : Ni = this, kr = this), this._call = t, this._time = n, Es(); +ki.prototype = pl.prototype = { + constructor: ki, + restart: function(e, t, n) { + if (typeof e != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Si = this, kr = this), this._call = e, this._time = n, Es(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function vl(t, e, n) { - var r = new Mi(); - return r.restart(t, e, n), r; -} -function Rh() { - Gs(), ++mr; - for (var t = Ni, e; t; ) - (e = jn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --mr; -} -function Fa() { - jn = (ki = Vr.now()) + Gi, mr = Nr = 0; +function pl(e, t, n) { + var r = new ki(); + return r.restart(e, t, n), r; +} +function Eh() { + Gs(), ++_r; + for (var e = Si, t; e; ) + (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + --_r; +} +function Oa() { + Kn = (Ni = Vr.now()) + Ui, _r = Nr = 0; try { - Rh(); + Eh(); } finally { - mr = 0, Sh(), jn = 0; + _r = 0, Ch(), Kn = 0; } } -function Ch() { - var t = Vr.now(), e = t - ki; - e > dl && (Gi -= e, ki = t); +function Th() { + var e = Vr.now(), t = e - Ni; + t > hl && (Ui -= t, Ni = e); } -function Sh() { - for (var t, e = Ni, 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 : Ni = n); - kr = t, Es(r); +function Ch() { + for (var e, t = Si, n, r = 1 / 0; t; ) + t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Si = n); + kr = e, Es(r); } -function Es(t) { - if (!mr) { +function Es(e) { + if (!_r) { Nr && (Nr = clearTimeout(Nr)); - var e = t - jn; - e > 24 ? (t < 1 / 0 && (Nr = setTimeout(Fa, t - Vr.now() - Gi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (ki = Vr.now(), Cr = setInterval(Ch, dl)), mr = 1, pl(Fa)); + var t = e - Kn; + t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Ui)), Rr && (Rr = clearInterval(Rr))) : (Rr || (Ni = Vr.now(), Rr = setInterval(Th, hl)), _r = 1, dl(Oa)); } } -function Ia(t, e, n) { - var r = new Mi(); - return e = e == null ? 0 : +e, r.restart((i) => { - r.stop(), t(i + e); - }, e, n), r; +function Fa(e, t, n) { + var r = new ki(); + return t = t == null ? 0 : +t, r.restart((i) => { + r.stop(), e(i + t); + }, t, n), r; } -var Nh = Go("start", "end", "cancel", "interrupt"), kh = [], gl = 0, La = 1, Ts = 2, yi = 3, qa = 4, Rs = 5, wi = 6; -function Ki(t, e, n, r, i, s) { - var a = t.__transition; - if (!a) t.__transition = {}; +var Rh = Uo("start", "end", "cancel", "interrupt"), Sh = [], vl = 0, Ia = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; +function Gi(e, t, n, r, i, s) { + var a = e.__transition; + if (!a) e.__transition = {}; else if (n in a) return; - Mh(t, n, { - name: e, + Nh(e, n, { + name: t, index: r, // For context during callback. group: i, // For context during callback. - on: Nh, - tween: kh, + on: Rh, + tween: Sh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: gl + state: vl }); } -function Ks(t, e) { - var n = Ce(t, e); - if (n.state > gl) throw new Error("too late; already scheduled"); +function Ks(e, t) { + var n = Et(e, t); + if (n.state > vl) throw new Error("too late; already scheduled"); return n; } -function Ue(t, e) { - var n = Ce(t, e); - if (n.state > yi) throw new Error("too late; already running"); +function Bt(e, t) { + var n = Et(e, t); + if (n.state > mi) throw new Error("too late; already running"); return n; } -function Ce(t, e) { - var n = t.__transition; - if (!n || !(n = n[e])) throw new Error("transition not found"); +function Et(e, t) { + var n = e.__transition; + if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function Mh(t, e, n) { - var r = t.__transition, i; - r[e] = n, n.timer = vl(s, 0, n.time); +function Nh(e, t, n) { + var r = e.__transition, i; + r[t] = n, n.timer = pl(s, 0, n.time); function s(u) { - n.state = La, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, p, h, d; - if (n.state !== La) return l(); + var f, p, c, d; + if (n.state !== Ia) return l(); for (f in r) if (d = r[f], d.name === n.name) { - if (d.state === yi) return Ia(a); - d.state === qa ? (d.state = wi, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[f]) : +f < e && (d.state = wi, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[f]); + if (d.state === mi) return Fa(a); + d.state === La ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); } - if (Ia(function() { - n.state === yi && (n.state = qa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ts) { - for (n.state = yi, i = new Array(h = n.tween.length), f = 0, p = -1; f < h; ++f) - (d = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++p] = d); + if (Fa(function() { + n.state === mi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Ts, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Ts) { + for (n.state = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) + (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); i.length = p + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Rs, 1), p = -1, h = i.length; ++p < h; ) - i[p].call(t, f); - n.state === Rs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), p = -1, c = i.length; ++p < c; ) + i[p].call(e, f); + n.state === Cs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } function l() { - n.state = wi, n.timer.stop(), delete r[e]; + n.state = yi, n.timer.stop(), delete r[t]; for (var u in r) return; - delete t.__transition; + delete e.__transition; } } -function Ph(t, e) { - var n = t.__transition, r, i, s = !0, a; +function kh(e, t) { + var n = e.__transition, r, i, s = !0, a; if (n) { - e = e == null ? null : e + ""; + t = t == null ? null : t + ""; for (a in n) { - if ((r = n[a]).name !== e) { + if ((r = n[a]).name !== t) { s = !1; continue; } - i = r.state > Ts && r.state < Rs, r.state = wi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Cs, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } - s && delete t.__transition; + s && delete e.__transition; } } -function Dh(t) { +function Mh(e) { return this.each(function() { - Ph(this, t); + kh(this, e); }); } -function Oh(t, e) { +function Ph(e, t) { var n, r; return function() { - var i = Ue(this, t), s = i.tween; + var i = Bt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === e) { + if (r[a].name === t) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Oh(t, e) { i.tween = r; }; } -function Fh(t, e, n) { +function Dh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Ue(this, t), a = s.tween; + var s = Bt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === e) { + for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === t) { i[l] = o; break; } @@ -4183,598 +4183,598 @@ function Fh(t, e, n) { s.tween = i; }; } -function Ih(t, e) { +function Oh(e, t) { var n = this._id; - if (t += "", arguments.length < 2) { - for (var r = Ce(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === t) + if (e += "", arguments.length < 2) { + for (var r = Et(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === e) return a.value; return null; } - return this.each((e == null ? Oh : Fh)(n, t, e)); + return this.each((t == null ? Ph : Dh)(n, e, t)); } -function js(t, e, n) { - var r = t._id; - return t.each(function() { - var i = Ue(this, r); - (i.value || (i.value = {}))[e] = n.apply(this, arguments); +function js(e, t, n) { + var r = e._id; + return e.each(function() { + var i = Bt(this, r); + (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return Ce(i, r).value[e]; + return Et(i, r).value[t]; }; } -function _l(t, e) { +function gl(e, t) { var n; - return (typeof e == "number" ? Ve : e instanceof Kn ? Si : (n = Kn(e)) ? (e = n, Si) : fl)(t, e); + return (typeof t == "number" ? It : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : ul)(e, t); } -function Lh(t) { +function Fh(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function qh(t) { +function Ih(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function Vh(t, e, n) { +function Lh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttribute(e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function zh(t, e, n) { +function qh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(t.space, t.local); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttributeNS(e.space, e.local); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Hh(t, e, n) { +function Vh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Yh(t, e, n) { +function zh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Bh(t, e) { - var n = Ui(t), r = n === "transform" ? Eh : _l; - return this.attrTween(t, typeof e == "function" ? (n.local ? Yh : Hh)(n, r, js(this, "attr." + t, e)) : e == null ? (n.local ? qh : Lh)(n) : (n.local ? zh : Vh)(n, r, e)); +function Hh(e, t) { + var n = Wi(e), r = n === "transform" ? $h : gl; + return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Ih : Fh)(n) : (n.local ? qh : Lh)(n, r, t)); } -function Xh(t, e) { +function Yh(e, t) { return function(n) { - this.setAttribute(t, e.call(this, n)); + this.setAttribute(e, t.call(this, n)); }; } -function Wh(t, e) { +function Bh(e, t) { return function(n) { - this.setAttributeNS(t.space, t.local, e.call(this, n)); + this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Uh(t, e) { +function Xh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Wh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Bh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Gh(t, e) { +function Wh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Xh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Yh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Kh(t, e) { - var n = "attr." + t; +function Uh(e, t) { + var n = "attr." + e; 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 = Ui(t); - return this.tween(n, (r.local ? Uh : Gh)(r, e)); + if (t == null) return this.tween(n, null); + if (typeof t != "function") throw new Error(); + var r = Wi(e); + return this.tween(n, (r.local ? Xh : Wh)(r, t)); } -function jh(t, e) { +function Gh(e, t) { return function() { - Ks(this, t).delay = +e.apply(this, arguments); + Ks(this, e).delay = +t.apply(this, arguments); }; } -function Jh(t, e) { - return e = +e, function() { - Ks(this, t).delay = e; +function Kh(e, t) { + return t = +t, function() { + Ks(this, e).delay = t; }; } -function Zh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? jh : Jh)(e, t)) : Ce(this.node(), e).delay; +function jh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Et(this.node(), t).delay; } -function Qh(t, e) { +function Jh(e, t) { return function() { - Ue(this, t).duration = +e.apply(this, arguments); + Bt(this, e).duration = +t.apply(this, arguments); }; } -function td(t, e) { - return e = +e, function() { - Ue(this, t).duration = e; +function Zh(e, t) { + return t = +t, function() { + Bt(this, e).duration = t; }; } -function ed(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Qh : td)(e, t)) : Ce(this.node(), e).duration; +function Qh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Et(this.node(), t).duration; } -function nd(t, e) { - if (typeof e != "function") throw new Error(); +function ed(e, t) { + if (typeof t != "function") throw new Error(); return function() { - Ue(this, t).ease = e; + Bt(this, e).ease = t; }; } -function rd(t) { - var e = this._id; - return arguments.length ? this.each(nd(e, t)) : Ce(this.node(), e).ease; +function td(e) { + var t = this._id; + return arguments.length ? this.each(ed(t, e)) : Et(this.node(), t).ease; } -function id(t, e) { +function nd(e, t) { return function() { - var n = e.apply(this, arguments); + var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Ue(this, t).ease = n; + Bt(this, e).ease = n; }; } -function sd(t) { - if (typeof t != "function") throw new Error(); - return this.each(id(this._id, t)); +function rd(e) { + if (typeof e != "function") throw new Error(); + return this.each(nd(this._id, e)); } -function ad(t) { - typeof t != "function" && (t = Jo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); +function id(e) { + typeof e != "function" && (e = jo(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); return new cn(r, this._parents, this._name, this._id); } -function od(t) { - if (t._id !== this._id) throw new Error(); - for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, p = a[o] = new Array(f), h, d = 0; d < f; ++d) - (h = l[d] || u[d]) && (p[d] = h); +function sd(e) { + if (e._id !== this._id) throw new Error(); + for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), c, d = 0; d < f; ++d) + (c = l[d] || u[d]) && (p[d] = c); for (; o < r; ++o) - a[o] = e[o]; + a[o] = t[o]; return new cn(a, this._parents, this._name, this._id); } -function ld(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 ad(e) { + return (e + "").trim().split(/^|\s+/).every(function(t) { + var n = t.indexOf("."); + return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; }); } -function ud(t, e, n) { - var r, i, s = ld(e) ? Ks : Ue; +function od(e, t, n) { + var r, i, s = ad(t) ? Ks : Bt; return function() { - var a = s(this, t), o = a.on; - o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + var a = s(this, e), o = a.on; + o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } -function fd(t, e) { +function ld(e, t) { var n = this._id; - return arguments.length < 2 ? Ce(this.node(), n).on.on(t) : this.each(ud(n, t, e)); + return arguments.length < 2 ? Et(this.node(), n).on.on(e) : this.each(od(n, e, t)); } -function cd(t) { +function ud(e) { return function() { - var e = this.parentNode; - for (var n in this.__transition) if (+n !== t) return; - e && e.removeChild(this); + var t = this.parentNode; + for (var n in this.__transition) if (+n !== e) return; + t && t.removeChild(this); }; } -function hd() { - return this.on("end.remove", cd(this._id)); +function fd() { + return this.on("end.remove", ud(this._id)); } -function dd(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Bs(t)); +function cd(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Bs(e)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, h = 0; h < l; ++h) - (f = o[h]) && (p = t.call(f, f.__data__, h, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[h] = p, Ki(u[h], e, n, h, u, Ce(f, n))); - return new cn(s, this._parents, e, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, c = 0; c < l; ++c) + (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Et(f, n))); + return new cn(s, this._parents, t, n); } -function pd(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = jo(t)); +function hd(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Ko(e)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) if (f = l[p]) { - for (var h = t.call(f, f.__data__, p, l), d, y = Ce(f, n), b = 0, m = h.length; b < m; ++b) - (d = h[b]) && Ki(d, e, n, b, h, y); - s.push(h), a.push(f); + for (var c = e.call(f, f.__data__, p, l), d, y = Et(f, n), b = 0, m = c.length; b < m; ++b) + (d = c[b]) && Gi(d, t, n, b, c, y); + s.push(c), a.push(f); } - return new cn(s, a, e, n); + return new cn(s, a, t, n); } -var vd = xr.prototype.constructor; -function gd() { - return new vd(this._groups, this._parents); +var dd = wr.prototype.constructor; +function pd() { + return new dd(this._groups, this._parents); } -function _d(t, e) { +function vd(e, t) { var n, r, i; return function() { - var s = _r(this, t), a = (this.style.removeProperty(t), _r(this, t)); - return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + var s = gr(this, e), a = (this.style.removeProperty(e), gr(this, e)); + return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function ml(t) { +function _l(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function md(t, e, n) { +function gd(e, t, n) { var r, i = n + "", s; return function() { - var a = _r(this, t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = gr(this, e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function yd(t, e, n) { +function _d(e, t, n) { var r, i, s; return function() { - var a = _r(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), _r(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = gr(this, e), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(e), gr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); }; } -function wd(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; +function md(e, t) { + var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Ue(this, t), u = l.on, f = l.value[s] == null ? o || (o = ml(e)) : void 0; + var l = Bt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function xd(t, e, n) { - var r = (t += "") == "transform" ? Ah : _l; - return e == null ? this.styleTween(t, _d(t, r)).on("end.style." + t, ml(t)) : typeof e == "function" ? this.styleTween(t, yd(t, r, js(this, "style." + t, e))).each(wd(this._id, t)) : this.styleTween(t, md(t, r, e), n).on("end.style." + t, null); +function yd(e, t, n) { + var r = (e += "") == "transform" ? bh : gl; + return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, js(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); } -function bd(t, e, n) { +function wd(e, t, n) { return function(r) { - this.style.setProperty(t, e.call(this, r), n); + this.style.setProperty(e, t.call(this, r), n); }; } -function $d(t, e, n) { +function xd(e, t, n) { var r, i; function s() { - var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && bd(t, a, n)), r; + var a = t.apply(this, arguments); + return a !== i && (r = (i = a) && wd(e, a, n)), r; } - return s._value = e, s; + return s._value = t, s; } -function Ad(t, e, n) { - var r = "style." + (t += ""); +function bd(e, t, n) { + var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (e == null) return this.tween(r, null); - if (typeof e != "function") throw new Error(); - return this.tween(r, $d(t, e, n ?? "")); + if (t == null) return this.tween(r, null); + if (typeof t != "function") throw new Error(); + return this.tween(r, xd(e, t, n ?? "")); } -function Ed(t) { +function $d(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function Td(t) { +function Ad(e) { return function() { - var e = t(this); - this.textContent = e ?? ""; + var t = e(this); + this.textContent = t ?? ""; }; } -function Rd(t) { - return this.tween("text", typeof t == "function" ? Td(js(this, "text", t)) : Ed(t == null ? "" : t + "")); +function Ed(e) { + return this.tween("text", typeof e == "function" ? Ad(js(this, "text", e)) : $d(e == null ? "" : e + "")); } -function Cd(t) { - return function(e) { - this.textContent = t.call(this, e); +function Td(e) { + return function(t) { + this.textContent = e.call(this, t); }; } -function Sd(t) { - var e, n; +function Cd(e) { + var t, n; function r() { - var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Cd(i)), e; + var i = e.apply(this, arguments); + return i !== n && (t = (n = i) && Td(i)), t; } - return r._value = t, r; + return r._value = e, r; } -function Nd(t) { - var e = "text"; - if (arguments.length < 1) return (e = this.tween(e)) && e._value; - if (t == null) return this.tween(e, null); - if (typeof t != "function") throw new Error(); - return this.tween(e, Sd(t)); +function Rd(e) { + var t = "text"; + if (arguments.length < 1) return (t = this.tween(t)) && t._value; + if (e == null) return this.tween(t, null); + if (typeof e != "function") throw new Error(); + return this.tween(t, Cd(e)); } -function kd() { - for (var t = this._name, e = this._id, n = yl(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Sd() { + for (var e = this._name, t = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { - var f = Ce(l, e); - Ki(l, t, n, u, a, { + var f = Et(l, t); + Gi(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new cn(r, this._parents, t, n); + return new cn(r, this._parents, e, n); } -function Md() { - var t, e, n = this, r = n._id, i = n.size(); +function Nd() { + var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Ue(this, r), f = u.on; - f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; + var u = Bt(this, r), f = u.on; + f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; }), i === 0 && s(); }); } -var Pd = 0; -function cn(t, e, n, r) { - this._groups = t, this._parents = e, this._name = n, this._id = r; +var kd = 0; +function cn(e, t, n, r) { + this._groups = e, this._parents = t, this._name = n, this._id = r; } -function xi(t) { - return xr().transition(t); +function wi(e) { + return wr().transition(e); } -function yl() { - return ++Pd; +function ml() { + return ++kd; } -var Je = xr.prototype; -cn.prototype = xi.prototype = { +var Jt = wr.prototype; +cn.prototype = wi.prototype = { constructor: cn, - select: dd, - selectAll: pd, - selectChild: Je.selectChild, - selectChildren: Je.selectChildren, - filter: ad, - merge: od, - selection: gd, - transition: kd, - call: Je.call, - nodes: Je.nodes, - node: Je.node, - size: Je.size, - empty: Je.empty, - each: Je.each, - on: fd, - attr: Bh, - attrTween: Kh, - style: xd, - styleTween: Ad, - text: Rd, - textTween: Nd, - remove: hd, - tween: Ih, - delay: Zh, - duration: ed, - ease: rd, - easeVarying: sd, - end: Md, - [Symbol.iterator]: Je[Symbol.iterator] + select: cd, + selectAll: hd, + selectChild: Jt.selectChild, + selectChildren: Jt.selectChildren, + filter: id, + merge: sd, + selection: pd, + transition: Sd, + call: Jt.call, + nodes: Jt.nodes, + node: Jt.node, + size: Jt.size, + empty: Jt.empty, + each: Jt.each, + on: ld, + attr: Hh, + attrTween: Uh, + style: yd, + styleTween: bd, + text: Ed, + textTween: Rd, + remove: fd, + tween: Oh, + delay: jh, + duration: Qh, + ease: td, + easeVarying: rd, + end: Nd, + [Symbol.iterator]: Jt[Symbol.iterator] }; -function Dd(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +function Md(e) { + return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Od = { +var Pd = { time: null, // Set on use. delay: 0, duration: 250, - ease: Dd + ease: Md }; -function Fd(t, e) { - for (var n; !(n = t.__transition) || !(n = n[e]); ) - if (!(t = t.parentNode)) - throw new Error(`transition ${e} not found`); +function Dd(e, t) { + for (var n; !(n = e.__transition) || !(n = n[t]); ) + if (!(e = e.parentNode)) + throw new Error(`transition ${t} not found`); return n; } -function Id(t) { - var e, n; - t instanceof cn ? (e = t._id, t = t._name) : (e = yl(), (n = Od).time = Gs(), t = t == null ? null : t + ""); +function Od(e) { + var t, n; + e instanceof cn ? (t = e._id, e = e._name) : (t = ml(), (n = Pd).time = Gs(), e = e == null ? null : e + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Ki(l, t, e, u, a, n || Fd(l, e)); - return new cn(r, this._parents, t, e); -} -xr.prototype.interrupt = Dh; -xr.prototype.transition = Id; -const Cs = Math.PI, Ss = 2 * Cs, kn = 1e-6, Ld = Ss - kn; -function wl(t) { - this._ += t[0]; - for (let e = 1, n = t.length; e < n; ++e) - this._ += arguments[e] + t[e]; -} -function qd(t) { - let e = Math.floor(t); - if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return wl; - const n = 10 ** e; + (l = a[u]) && Gi(l, e, t, u, a, n || Dd(l, t)); + return new cn(r, this._parents, e, t); +} +wr.prototype.interrupt = Mh; +wr.prototype.transition = Od; +const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Fd = Ss - Nn; +function yl(e) { + this._ += e[0]; + for (let t = 1, n = e.length; t < n; ++t) + this._ += arguments[t] + e[t]; +} +function Id(e) { + let t = Math.floor(e); + if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); + if (t > 15) return yl; + const n = 10 ** t; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Vd { - constructor(e) { +class Ld { + constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? wl : qd(e); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Id(t); } - moveTo(e, n) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; + moveTo(t, n) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(e, n) { - this._append`L${this._x1 = +e},${this._y1 = +n}`; + lineTo(t, n) { + this._append`L${this._x1 = +t},${this._y1 = +n}`; } - quadraticCurveTo(e, n, r, i) { - this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(t, n, r, i) { + this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(e, n, r, i, s, a) { - this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(t, n, r, i, s, a) { + this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(e, n, r, i, s) { - if (e = +e, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, p = o - n, h = f * f + p * p; + arcTo(t, n, r, i, s) { + if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, c = f * f + p * p; if (this._x1 === null) - this._append`M${this._x1 = e},${this._y1 = n}`; - else if (h > kn) if (!(Math.abs(p * l - u * f) > kn) || !s) - this._append`L${this._x1 = e},${this._y1 = n}`; + this._append`M${this._x1 = t},${this._y1 = n}`; + else if (c > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) + this._append`L${this._x1 = t},${this._y1 = n}`; else { - let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(h), M = s * Math.tan((Cs - Math.acos((b + h - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; - Math.abs(S - 1) > kn && this._append`L${e + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = e + I * l},${this._y1 = n + I * u}`; + let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; + Math.abs(S - 1) > Nn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; } } - arc(e, n, r, i, s, a) { - if (e = +e, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, p = 1 ^ a, h = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > kn || Math.abs(this._y1 - f) > kn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Ss + Ss), h > Ld ? this._append`A${r},${r},0,1,${p},${e - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : h > kn && this._append`A${r},${r},0,${+(h >= Cs)},${p},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + arc(t, n, r, i, s, a) { + if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Ss + Ss), c > Fd ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : c > Nn && this._append`A${r},${r},0,${+(c >= Rs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(e, n, r, i) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + rect(t, n, r, i) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; } toString() { return this._; } } -function zd(t) { - for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); +function qd(e) { + for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); return n; } -const Hd = zd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Lt(t) { +const Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Le(e) { return function() { - return t; + return e; }; } -const Va = Math.abs, Dt = Math.atan2, Nn = Math.cos, Yd = Math.max, ss = Math.min, Oe = Math.sin, er = Math.sqrt, Bt = 1e-12, zr = Math.PI, Pi = zr / 2, bi = 2 * zr; -function Bd(t) { - return t > 1 ? 0 : t < -1 ? zr : Math.acos(t); +const qa = Math.abs, Oe = Math.atan2, Sn = Math.cos, zd = Math.max, ss = Math.min, Mt = Math.sin, er = Math.sqrt, Xe = 1e-12, zr = Math.PI, Mi = zr / 2, xi = 2 * zr; +function Hd(e) { + return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); } -function za(t) { - return t >= 1 ? Pi : t <= -1 ? -Pi : Math.asin(t); +function Va(e) { + return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); } -function Xd(t) { - let e = 3; - return t.digits = function(n) { - if (!arguments.length) return e; +function Yd(e) { + let t = 3; + return e.digits = function(n) { + if (!arguments.length) return t; if (n == null) - e = null; + t = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - e = r; + t = r; } - return t; - }, () => new Vd(e); + return e; + }, () => new Ld(t); } -function Wd(t) { - return t.innerRadius; +function Bd(e) { + return e.innerRadius; } -function Ud(t) { - return t.outerRadius; +function Xd(e) { + return e.outerRadius; } -function Gd(t) { - return t.startAngle; +function Wd(e) { + return e.startAngle; } -function Kd(t) { - return t.endAngle; +function Ud(e) { + return e.endAngle; } -function jd(t) { - return t && t.padAngle; +function Gd(e) { + return e && e.padAngle; } -function Jd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, p = o - s, h = p * l - f * u; - if (!(h * h < Bt)) - return h = (f * (e - s) - p * (t - i)) / h, [t + h * l, e + h * u]; +function Kd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; + if (!(c * c < Xe)) + return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; } -function fi(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, h = t + f, d = e + p, y = n + f, b = r + p, m = (h + y) / 2, $ = (d + b) / 2, D = y - h, M = b - d, S = D * D + M * M, I = i - s, L = h * b - y * d, U = (M < 0 ? -1 : 1) * er(Yd(0, I * I * S - L * L)), at = (L * M - D * U) / S, tt = (-L * D - M * U) / S, G = (L * M + D * U) / S, ot = (-L * D + M * U) / S, ut = at - m, O = tt - $, F = G - m, kt = ot - $; - return ut * ut + O * O > F * F + kt * kt && (at = G, tt = ot), { - cx: at, - cy: tt, +function ui(e, t, n, r, i, s, a) { + var o = e - n, l = t - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, b = r + p, m = (c + y) / 2, $ = (d + b) / 2, D = y - c, M = b - d, S = D * D + M * M, I = i - s, L = c * b - y * d, W = (M < 0 ? -1 : 1) * er(zd(0, I * I * S - L * L)), oe = (L * M - D * W) / S, Q = (-L * D - M * W) / S, U = (L * M + D * W) / S, le = (-L * D + M * W) / S, ue = oe - m, O = Q - $, F = U - m, Me = le - $; + return ue * ue + O * O > F * F + Me * Me && (oe = U, Q = le), { + cx: oe, + cy: Q, x01: -f, y01: -p, - x11: at * (i / I - 1), - y11: tt * (i / I - 1) + x11: oe * (i / I - 1), + y11: Q * (i / I - 1) }; } -function we() { - var t = Wd, e = Ud, n = Lt(0), r = null, i = Gd, s = Kd, a = jd, o = null, l = Xd(u); +function _t() { + var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); function u() { - var f, p, h = +t.apply(this, arguments), d = +e.apply(this, arguments), y = i.apply(this, arguments) - Pi, b = s.apply(this, arguments) - Pi, m = Va(b - y), $ = b > y; - if (o || (o = f = l()), d < h && (p = d, d = h, h = p), !(d > Bt)) o.moveTo(0, 0); - else if (m > bi - Bt) - o.moveTo(d * Nn(y), d * Oe(y)), o.arc(0, 0, d, y, b, !$), h > Bt && (o.moveTo(h * Nn(b), h * Oe(b)), o.arc(0, 0, h, b, y, $)); + var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; + if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); + else if (m > xi - Xe) + o.moveTo(d * Sn(y), d * Mt(y)), o.arc(0, 0, d, y, b, !$), c > Xe && (o.moveTo(c * Sn(b), c * Mt(b)), o.arc(0, 0, c, b, y, $)); else { - var D = y, M = b, S = y, I = b, L = m, U = m, at = a.apply(this, arguments) / 2, tt = at > Bt && (r ? +r.apply(this, arguments) : er(h * h + d * d)), G = ss(Va(d - h) / 2, +n.apply(this, arguments)), ot = G, ut = G, O, F; - if (tt > Bt) { - var kt = za(tt / h * Oe(at)), ue = za(tt / d * Oe(at)); - (L -= kt * 2) > Bt ? (kt *= $ ? 1 : -1, S += kt, I -= kt) : (L = 0, S = I = (y + b) / 2), (U -= ue * 2) > Bt ? (ue *= $ ? 1 : -1, D += ue, M -= ue) : (U = 0, D = M = (y + b) / 2); + var D = y, M = b, S = y, I = b, L = m, W = m, oe = a.apply(this, arguments) / 2, Q = oe > Xe && (r ? +r.apply(this, arguments) : er(c * c + d * d)), U = ss(qa(d - c) / 2, +n.apply(this, arguments)), le = U, ue = U, O, F; + if (Q > Xe) { + var Me = Va(Q / c * Mt(oe)), ot = Va(Q / d * Mt(oe)); + (L -= Me * 2) > Xe ? (Me *= $ ? 1 : -1, S += Me, I -= Me) : (L = 0, S = I = (y + b) / 2), (W -= ot * 2) > Xe ? (ot *= $ ? 1 : -1, D += ot, M -= ot) : (W = 0, D = M = (y + b) / 2); } - var yt = d * Nn(D), wt = d * Oe(D), et = h * Nn(I), Mt = h * Oe(I); - if (G > Bt) { - var q = d * Nn(M), Ot = d * Oe(M), Se = h * Nn(S), it = h * Oe(S), Jt; + var ye = d * Sn(D), we = d * Mt(D), ee = c * Sn(I), Pe = c * Mt(I); + if (U > Xe) { + var G = d * Sn(M), Fe = d * Mt(M), Tt = c * Sn(S), ie = c * Mt(S), Ze; if (m < zr) - if (Jt = Jd(yt, wt, Se, it, q, Ot, et, Mt)) { - var Zt = yt - Jt[0], Qt = wt - Jt[1], Tn = q - Jt[0], _t = Ot - Jt[1], Ne = 1 / Oe(Bd((Zt * Tn + Qt * _t) / (er(Zt * Zt + Qt * Qt) * er(Tn * Tn + _t * _t))) / 2), Ge = er(Jt[0] * Jt[0] + Jt[1] * Jt[1]); - ot = ss(G, (h - Ge) / (Ne - 1)), ut = ss(G, (d - Ge) / (Ne + 1)); + if (Ze = Kd(ye, we, Tt, ie, G, Fe, ee, Pe)) { + var Xt = ye - Ze[0], lt = we - Ze[1], Tn = G - Ze[0], _e = Fe - Ze[1], Ct = 1 / Mt(Hd((Xt * Tn + lt * _e) / (er(Xt * Xt + lt * lt) * er(Tn * Tn + _e * _e))) / 2), Wt = er(Ze[0] * Ze[0] + Ze[1] * Ze[1]); + le = ss(U, (c - Wt) / (Ct - 1)), ue = ss(U, (d - Wt) / (Ct + 1)); } else - ot = ut = 0; + le = ue = 0; } - U > Bt ? ut > Bt ? (O = fi(Se, it, yt, wt, d, ut, $), F = fi(q, Ot, et, Mt, d, ut, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ut < G ? o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, d, Dt(O.cy + O.y11, O.cx + O.x11), Dt(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ut, Dt(F.y11, F.x11), Dt(F.y01, F.x01), !$))) : (o.moveTo(yt, wt), o.arc(0, 0, d, D, M, !$)) : o.moveTo(yt, wt), !(h > Bt) || !(L > Bt) ? o.lineTo(et, Mt) : ot > Bt ? (O = fi(et, Mt, q, Ot, h, -ot, $), F = fi(yt, wt, Se, it, h, -ot, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), ot < G ? o.arc(O.cx, O.cy, ot, Dt(O.y01, O.x01), Dt(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ot, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, h, Dt(O.cy + O.y11, O.cx + O.x11), Dt(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, ot, Dt(F.y11, F.x11), Dt(F.y01, F.x01), !$))) : o.arc(0, 0, h, I, S, $); + W > Xe ? ue > Xe ? (O = ui(Tt, ie, ye, we, d, ue, $), F = ui(G, Fe, ee, Pe, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < U ? o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, d, Oe(O.cy + O.y11, O.cx + O.x11), Oe(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ue, Oe(F.y11, F.x11), Oe(F.y01, F.x01), !$))) : (o.moveTo(ye, we), o.arc(0, 0, d, D, M, !$)) : o.moveTo(ye, we), !(c > Xe) || !(L > Xe) ? o.lineTo(ee, Pe) : le > Xe ? (O = ui(ee, Pe, G, Fe, c, -le, $), F = ui(ye, we, Tt, ie, c, -le, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), le < U ? o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, c, Oe(O.cy + O.y11, O.cx + O.x11), Oe(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, le, Oe(F.y11, F.x11), Oe(F.y01, F.x01), !$))) : o.arc(0, 0, c, I, S, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [Nn(p) * f, Oe(p) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; + return [Sn(p) * f, Mt(p) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Lt(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Lt(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Lt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Lt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Lt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Lt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Lt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Zd(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function jd(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Qd(t, e) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Jd(e, t) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function tp(t) { - return t; +function Zd(e) { + return e; } function as() { - var t = tp, e = Qd, n = null, r = Lt(0), i = Lt(bi), s = Lt(0); + var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); function a(o) { - var l, u = (o = Zd(o)).length, f, p, h = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(bi, Math.max(-bi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +t(o[l], l, o)) > 0 && (h += S); - for (e != null ? d.sort(function(I, L) { - return e(y[I], y[L]); + (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); + for (t != null ? d.sort(function(I, L) { + return t(y[I], y[L]); }) : n != null && d.sort(function(I, L) { return n(o[I], o[L]); - }), l = 0, p = h ? (m - u * M) / h : 0; l < u; ++l, b = $) + }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, b = $) f = d[l], S = y[f], $ = b + (S > 0 ? S * p : 0) + M, y[f] = { data: o[f], index: l, @@ -4786,112 +4786,112 @@ function as() { return y; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Lt(+o), a) : t; + return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; }, a.sortValues = function(o) { - return arguments.length ? (e = o, n = null, a) : e; + return arguments.length ? (t = o, n = null, a) : t; }, a.sort = function(o) { - return arguments.length ? (n = o, e = null, a) : n; + return arguments.length ? (n = o, t = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Lt(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Le(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Lt(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Lt(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; }, a; } -function Mr(t, e, n) { - this.k = t, this.x = e, this.y = n; +function Mr(e, t, n) { + this.k = e, this.x = t, this.y = n; } Mr.prototype = { constructor: Mr, - scale: function(t) { - return t === 1 ? this : new Mr(this.k * t, this.x, this.y); + scale: function(e) { + return e === 1 ? this : new Mr(this.k * e, this.x, this.y); }, - translate: function(t, e) { - return t === 0 & e === 0 ? this : new Mr(this.k, this.x + this.k * t, this.y + this.k * e); + translate: function(e, t) { + return e === 0 & t === 0 ? this : new Mr(this.k, this.x + this.k * e, this.y + this.k * t); }, - apply: function(t) { - return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + apply: function(e) { + return [e[0] * this.k + this.x, e[1] * this.k + this.y]; }, - applyX: function(t) { - return t * this.k + this.x; + applyX: function(e) { + return e * this.k + this.x; }, - applyY: function(t) { - return t * this.k + this.y; + applyY: function(e) { + return e * this.k + this.y; }, - invert: function(t) { - return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + invert: function(e) { + return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; }, - invertX: function(t) { - return (t - this.x) / this.k; + invertX: function(e) { + return (e - this.x) / this.k; }, - invertY: function(t) { - return (t - this.y) / this.k; + invertY: function(e) { + return (e - this.y) / this.k; }, - rescaleX: function(t) { - return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + rescaleX: function(e) { + return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); }, - rescaleY: function(t) { - return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + rescaleY: function(e) { + return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; Mr.prototype; -var ep = /* @__PURE__ */ Ju(''); -const np = { +var Qd = /* @__PURE__ */ Ku(''); +const ep = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function xl(t, e) { - zi(e, !0), Hs(t, np); - let n = st(e, "jsonData", 7), r = st(e, "currentRound", 7, 1), i = st(e, "mouseEventType", 15), s = st(e, "mouseData", 15), a = st(e, "mouseX", 15), o = st(e, "mouseY", 15), l = st(e, "requestRoundChange", 7, (c) => { - }), u = st(e, "candidateColors", 23, () => []), f = st(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = st(e, "firstRoundDeterminesPercentages", 7, !1), h = st(e, "randomizeOrder", 7, !1), d = st(e, "displayPhase", 15, 0); - function y(c) { - return c.isTransfer ? `${c.label}__transfer` : c.transferIndex != null ? `${c.label}__${c.transferIndex}` : c.label; - } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", U = "TextLayer", at = "url(#cross-hatch)", tt = 1.15, G = 750, ot = 800, ut = "white", O = 1, F = "#ff00ff", kt = 3; - function ue(c) { - return "hatch-" + c.replace(/[^a-zA-Z0-9]/g, "-"); - } - let yt = [], wt = [], et = [], Mt = 0, q = 0; - const Ot = {}, Se = "No Further Rankings"; - let it = /* @__PURE__ */ At(null); - function Jt() { - const c = ct(x(it)); - c.select("#" + S).remove(), c.select("#" + I).remove(), c.select("#" + L).remove(), c.select("#" + U).remove(); - } - function Zt(c) { - l() && (ft = c, l()(c)); - } - function Qt(c) { - Jt(), et = Tn(c), yt = ea(c, S, et, D, M, 0, _t()), ea(c, I, et, D, M, 0, _t(), !1, !1, !0), Er(); - } - rf(() => { - Ht(), setTimeout( +function wl(e, t) { + Vi(t, !0), Hs(e, ep); + let n = ae(t, "jsonData", 7), r = ae(t, "currentRound", 7, 1), i = ae(t, "mouseEventType", 15), s = ae(t, "mouseData", 15), a = ae(t, "mouseX", 15), o = ae(t, "mouseY", 15), l = ae(t, "requestRoundChange", 7, (h) => { + }), u = ae(t, "candidateColors", 23, () => []), f = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ae(t, "firstRoundDeterminesPercentages", 7, !1), c = ae(t, "randomizeOrder", 7, !1), d = ae(t, "displayPhase", 15, 0); + function y(h) { + return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; + } + const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", W = "TextLayer", oe = "url(#cross-hatch)", Q = 1.15, U = 750, le = 800, ue = "white", O = 1, F = "#ff00ff", Me = 3; + function ot(h) { + return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); + } + let ye = [], we = [], ee = [], Pe = 0, G = 0; + const Fe = {}, Tt = "No Further Rankings"; + let ie = /* @__PURE__ */ $e(null); + function Ze() { + const h = fe(x(ie)); + h.select("#" + S).remove(), h.select("#" + I).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); + } + function Xt(h) { + l() && (me = h, l()(h)); + } + function lt(h) { + Ze(), ee = Tn(h), ye = ea(h, S, ee, D, M, 0, _e()), ea(h, I, ee, D, M, 0, _e(), !1, !1, !0), Er(); + } + tf(() => { + Cn(), setTimeout( () => { - Qt(r()); + lt(r()); }, 0 ); }); - function Tn(c) { - const g = Pe(c); - return Mt = Zn(c), g; + function Tn(h) { + const g = ze(h); + return Pe = Jn(h), g; } - function _t() { + function _e() { return $; } - function Ne() { - return _t() * 1.41; + function Ct() { + return _e() * 1.41; } - function Ge(c) { + function Wt(h) { let g = 0; - for (let _ = 1; _ < c; _++) { + for (let _ = 1; _ < h; _++) { const A = n().results[_ - 1].tallyResults; for (let E = 0; E < A.length; E++) { const T = A[E].transfers; @@ -4903,126 +4903,115 @@ function xl(t, e) { } return g; } - function jr(c, g) { - if (c === "exhausted") return Ge(g); + function jr(h, g) { + if (h === "exhausted") return Wt(g); { const _ = n().results[g - 1].tally; - return Number(_[c]); + return Number(_[h]); } } - function Jr(c, g) { - return jr(c, g).toLocaleString("en-US"); + function Jr(h, g) { + return jr(h, g).toLocaleString("en-US"); } - function Zr(c, g) { - const _ = p() ? Mt : ji(g); - return (jr(c, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Zr(h, g) { + const _ = p() ? Pe : Ki(g); + return (jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Zn(c) { - const g = n().results[c - 1].tally; + function Jn(h) { + const g = n().results[h - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) _ += Number(E); return _; } - function ke(c) { - return c === "exhausted" || c === "Inactive Ballots"; + function Rt(h) { + return h === "exhausted" || h === "Inactive Ballots"; } - function ji(c) { - const g = n().results[c - 1].tally; + function Ki(h) { + const g = n().results[h - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) - ke(A) || (_ += Number(E)); + Rt(A) || (_ += Number(E)); return _; } - function Qr(c, g) { - if (!c || c < 1 || c > n().results.length) + function Qr(h, g) { + if (!h || h < 1 || h > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && c === n().results.length) + if (f() && h === n().results.length) return []; - const _ = n().results[c - 1].tallyResults, A = []; + const _ = n().results[h - 1].tallyResults, A = []; for (let E = 0; E < _.length; E++) { const T = _[E][g]; T != null && A.push(T); } return A; } - function dn(c) { - return Qr(c, "eliminated"); + function dn(h) { + return Qr(h, "eliminated"); } - function br(c) { + function xr(h) { let g = []; - for (let _ = 1; _ <= c; _++) g = g.concat(Qr(_, "elected")); + for (let _ = 1; _ <= h; _++) g = g.concat(Qr(_, "elected")); return [...new Set(g)]; } - function w(c, g) { + function w(h, g) { const _ = n().results[g - 1].tallyResults; let A = 0; - const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && c == T.elected); + const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); if (E >= 0) { const T = _[E].transfers; if (T) - for (let [P, Y] of Object.entries(T)) A += Number(Y); + for (let [P, z] of Object.entries(T)) A += Number(z); } else return 0; return A; } - function H(c) { - if (c < 1 || c > n().results.length) return !1; - const g = n().results[c - 1].tallyResults; - return g.length > 0 && g.some((_) => Object.keys(_.transfers).length > 0); + function Y(h, g) { + h.some((_) => Rt(_.label)) || h.push({ label: "exhausted", value: Wt(g) }); } - function Z(c) { - const g = n().results.length; - for (let _ = c; _ < g; _++) - if (H(_)) return _; - return g; - } - function ht(c, g) { - c.some((_) => ke(_.label)) || c.push({ label: "exhausted", value: Ge(g) }); - } - function xt(c) { - let g = c | 0; + function te(h) { + let g = h | 0; return () => { g = g + 1831565813 | 0; let _ = Math.imul(g ^ g >>> 15, 1 | g); return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; }; } - function lt(c) { + function pe(h) { let g = 5381; - for (let _ = 0; _ < c.length; _++) - g = (g << 5) + g + c.charCodeAt(_) | 0; + for (let _ = 0; _ < h.length; _++) + g = (g << 5) + g + h.charCodeAt(_) | 0; return g; } - function zt(c) { + function xe(h) { var E; - if (c.length <= 3) return c; - const g = lt(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = xt(g), A = [...c]; + if (h.length <= 3) return h; + const g = pe(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = te(g), A = [...h]; for (let T = A.length - 1; T > 0; T--) { const P = Math.floor(_() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function Me() { - const c = Object.keys(n().results[0].tally), g = c.filter((E) => !ke(E)), _ = c.filter((E) => ke(E)); - return [...h() ? zt(g) : g, ..._]; + function se() { + const h = Object.keys(n().results[0].tally), g = h.filter((E) => !Rt(E)), _ = h.filter((E) => Rt(E)); + return [...c() ? xe(g) : g, ..._]; } - function Pe(c) { - const g = n().results[c - 1].tally, _ = []; - for (const A of Me()) + function ze(h) { + const g = n().results[h - 1].tally, _ = []; + for (const A of se()) A in g && _.push({ label: A, value: Number(g[A]) }); - return ht(_, c), _; + return Y(_, h), _; } - function Rn(c) { - const g = n().results[c - 1].tally, _ = []; - for (const A of Me()) + function Ut(h) { + const g = n().results[h - 1].tally, _ = []; + for (const A of se()) _.push({ label: A, value: Number(g[A] ?? 0) }); - return ht(_, c), _; + return Y(_, h), _; } - function pn(c, g) { + function St(h, g) { const _ = []; - for (const A of c) { + for (const A of h) { if (A.label === "exhausted" || A.isTransfer) { _.push(A); continue; @@ -5036,225 +5025,203 @@ function xl(t, e) { } return _; } - function Ht() { - const c = ct(x(it)).select("defs").select("#cross-hatch"); + function Cn() { + const h = fe(x(ie)).select("defs").select("#cross-hatch"); let g = 0; for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Ot[_] = Hd[g] : Ot[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ot[_] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? Fe[_] = Vd[g] : Fe[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Fe[_] = u()[g % u().length], g++; { - const E = c.clone(!0); - E.attr("id", ue(_)).select("rect").attr("fill", Ot[_]), E.selectAll("circle").attr("fill", "#383838"); + const E = h.clone(!0); + E.attr("id", ot(_)).select("rect").attr("fill", Fe[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Ot.exhausted = at, Ot["Inactive Ballots"] = at; + Fe.exhausted = oe, Fe["Inactive Ballots"] = oe; } - function De() { - ct(x(it)).select("#" + L).remove(); + function pn() { + fe(x(ie)).select("#" + L).remove(); } - function Ft(c, g) { - const _ = xi("global").duration(ot); + function Ee(h, g) { + const _ = wi("global").duration(le); g && _.on("end", g); - const A = pn(et, c), T = as().sort(null).value((P) => P.value)(A); - sa(c, S, T, 0, _t()), sa(c, I, T, 0, _t(), !0), et = A, yt = T, De(), El(c), Ml(), Dl(0, _t()), Er(); - } - function fe(c, g) { - const _ = xi("global").duration(ot); - g && _.on("end", g), Tl(c); - } - function ye(c, g) { - const _ = xi("global").duration(ot); - g && _.on("end", g), $l(c), Al(_t(), Ne()); - } - let bt = !1, te = []; - function mt() { - if (Er(), bt = !1, te.length === 0 && r() < n().results.length && !H(r())) { - const c = Z(r()); - Zt(c); - } - ce(); + const A = St(ee, h), T = as().sort(null).value((P) => P.value)(A); + ia(h, S, T, 0, _e()), ia(h, I, T, 0, _e(), !0), ee = A, ye = T, pn(), $l(h), Nl(), Ml(0, _e()), Er(); + } + function He(h, g) { + const _ = wi("global").duration(le); + g && _.on("end", g), Al(h); } - function ce() { - if (te.length === 0) { - ft !== r() && (r() === ft + 1 && ft > 0 && r() <= n().results.length ? (ft = r(), Cn(r())) : r() >= 1 && r() <= n().results.length && (ft = r(), d(0), Qt(r()))); + function Te(h, g) { + const _ = wi("global").duration(le); + g && _.on("end", g), ji(h), bl(_e(), Ct()); + } + let ve = !1, ut = []; + function Ye() { + Er(), ve = !1, Gt(); + } + function Gt() { + if (ut.length === 0) { + me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), Nt(r())) : r() >= 1 && r() <= n().results.length && (me = r(), d(0), lt(r()))); return; } - const c = te.shift(); - switch (c.type) { + const h = ut.shift(); + switch (h.type) { case "round": { - const g = c.round; - g === ft + 1 && ft > 0 && g <= n().results.length ? (ft = g, Cn(g)) : (g !== ft && g >= 1 && g <= n().results.length && (ft = g, d(0), Qt(g)), ce()); + const g = h.round; + g === me + 1 && me > 0 && g <= n().results.length ? (me = g, Nt(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, d(0), lt(g)), Gt()); break; } case "step": - Zs(); + kt(); break; } } - function Cn(c) { - if (c <= 1 || c > n().results.length) { - ce(); + function Nt(h) { + if (h <= 1 || h > n().results.length) { + Gt(); return; } - if (bt = !0, q = c, d(0), !H(q - 1)) { - const g = Z(q - 1); - g > q && (q = g, Zt(q)), mt(); - return; - } - Ft(q - 1, () => { - d(1), fe(q - 1, () => { - d(2), ye(q, () => { - d(0), mt(); + ve = !0, G = h, d(0), Ee(G - 1, () => { + d(1), He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); }); }); } - function $r() { - bt || (bt = !0, q = r(), Sn()); + function Kt() { + ve || (ve = !0, G = r(), Rn()); } - function Sn() { + function Rn() { if (d( 0 // if in the middle of "one small step" animation, reset to 0. - ), te.length > 0) { - mt(); + ), ut.length > 0) { + Ye(); return; } - if (!H(q)) { - q = Z(q), Zt(q), Qt(q), q < n().results.length ? Sn() : (d(0), mt()); - return; - } - const c = q < n().results.length - 1 ? Sn : () => { - d(0), mt(); + const h = G < n().results.length - 1 ? Rn : () => { + d(0), Ye(); }; - Ft(q, () => { - d(1), fe(q, () => { - d(2), q++, Zt(q), ye(q, c); + Ee(G, () => { + d(1), He(G, () => { + d(2), G++, Xt(G), Te(G, h); }); }); } Is(() => { - Ke(); + br(); }); - let ft = 0; - function Ke() { - if (ft != r()) { - if (bt) { - te.push({ type: "round", round: r() }); + let me = 0; + function br() { + if (me != r()) { + if (ve) { + ut.push({ type: "round", round: r() }); return; } - if (ft == r() - 1 && ft > 0) { - if (!H(ft)) { - const c = Z(ft); - ft = c, r(c + 1), ti(), Zt(r()); - return; - } - ti(); - } else - je(r()); - ft = r(); + me == r() - 1 && me > 0 ? jt() : $r(r()), me = r(); } } - function je(c) { - if (bt) { - te.push({ type: "round", round: c }); + function $r(h) { + if (ve) { + ut.push({ type: "round", round: h }); return; } - d(0), Qt(c); + d(0), lt(h); } - function ti() { - if (bt) { - te.push({ type: "round", round: r() }); + function jt() { + if (ve) { + ut.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (q = r(), q > n().results.length) { - Er(), bt = !1; + if (G = r(), G > n().results.length) { + Er(), ve = !1; return; } - bt = !0, d() === 0 ? Ft(q - 1, () => { - d(1), fe(q - 1, () => { - d(2), ye(q, () => { - d(0), mt(); + ve = !0, d() === 0 ? Ee(G - 1, () => { + d(1), He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); }); - }) : d() === 1 ? fe(q - 1, () => { - d(2), ye(q, () => { - d(0), mt(); + }) : d() === 1 ? He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); - }) : d() === 2 && ye(q, () => { - d(0), mt(); + }) : d() === 2 && Te(G, () => { + d(0), Ye(); }); } - function Zs() { + function kt() { if (r() > n().results.length) { - Er(), bt = !1; + Er(), ve = !1; return; } - if (bt) { - te.push({ type: "step" }); + if (ve) { + ut.push({ type: "step" }); return; } - bt = !0, q = r(), d() === 0 ? Ft(q, () => { - d(1), mt(); - }) : d() === 1 ? fe(q, () => { - d(2), mt(); - }) : d() === 2 ? (q++, Zt(q), ye(q, () => { - d(0), mt(); - })) : (bt = !1, console.warn("displayPhase out of range at ", d())); - } - function $l(c) { - et = Rn(c), yt = ra(c, S, et, 0, _t(), !0), ra(c, I, et, 0, _t(), !1, !0); - } - function Al(c, g) { - const _ = ct(x(it)).select("#" + L), E = ct(x(it)).select("#" + S), T = {}; - for (const N of yt) { + ve = !0, G = r(), d() === 0 ? Ee(G, () => { + d(1), Ye(); + }) : d() === 1 ? He(G, () => { + d(2), Ye(); + }) : d() === 2 ? (G++, Xt(G), Te(G, () => { + d(0), Ye(); + })) : (ve = !1, console.warn("displayPhase out of range at ", d())); + } + function ji(h) { + ee = Ut(h), ye = na(h, S, ee, 0, _e(), !0), na(h, I, ee, 0, _e(), !1, !0); + } + function bl(h, g) { + const _ = fe(x(ie)).select("#" + L), E = fe(x(ie)).select("#" + S), T = {}; + for (const N of ye) { const k = N.data.label; if (N.data.isTransfer) continue; - const R = E.select("#" + CSS.escape(y(N.data))); - R.empty() || (T[k] = { - oldStart: Number(R.attr("prevStart")), - oldEnd: Number(R.attr("prevEnd")), + const C = E.select("#" + CSS.escape(y(N.data))); + C.empty() || (T[k] = { + oldStart: Number(C.attr("prevStart")), + oldEnd: Number(C.attr("prevEnd")), newStart: N.startAngle, newEnd: N.endAngle }); } const P = _.selectAll(".slice"); - let Y = P.size(); - function V() { - Y--, Y === 0 && Pl(); + let z = P.size(); + function q() { + z--, z === 0 && kl(); } - P.select("path").transition("global").duration(G).attrTween("d", function(N) { - const k = N.startAngle, R = N.endAngle, C = R - k, Pt = T[N.data.label]; - let Q, Yt; - if (Pt) { - const Qn = (Pt.oldStart + Pt.oldEnd) / 2, Ll = (Pt.newStart + Pt.newEnd) / 2, ql = k - Qn; - Q = Ll + ql, Yt = Q + C; + P.select("path").transition("global").duration(U).attrTween("d", function(N) { + const k = N.startAngle, C = N.endAngle, R = C - k, De = T[N.data.label]; + let Z, Be; + if (De) { + const Zn = (De.oldStart + De.oldEnd) / 2, Fl = (De.newStart + De.newEnd) / 2, Il = k - Zn; + Z = Fl + Il, Be = Z + R; } else - Q = k, Yt = R; - const nt = Ze(k, Q), Tt = Ze(R, Yt), ni = Ze(g, c), Tr = we(); - return function(Qn) { - return Tr.innerRadius(Math.min(ni(Qn), c) - 1).outerRadius(ni(Qn)).startAngle(nt(Qn)).endAngle(Tt(Qn)), Tr(N); + Z = k, Be = C; + const ne = Zt(k, Z), Ce = Zt(C, Be), ti = Zt(g, h), Tr = _t(); + return function(Zn) { + return Tr.innerRadius(Math.min(ti(Zn), h) - 1).outerRadius(ti(Zn)).startAngle(ne(Zn)).endAngle(Ce(Zn)), Tr(N); }; - }).on("end", (N) => V()); + }).on("end", (N) => q()); } - function El(c) { - const g = Cl(c, yt); - wt = na(c, L, g, D, M, _t(), Ne(), !1, !0); - const _ = ct(x(it)); + function $l(h) { + const g = Tl(h, ye); + we = ta(h, L, g, D, M, _e(), Ct(), !1, !0); + const _ = fe(x(ie)); _.select("#" + S).raise(), _.select("#" + I).raise(); } - function Tl(c) { - const g = Nl(c, wt, yt); - wt = aa(c, L, g, _t(), Ne(), !1); + function Al(h) { + const g = Rl(h, we, ye); + we = sa(h, L, g, _e(), Ct(), !1); } - function Ar(c) { - return Ot[c.data.label]; + function Ar(h) { + return Fe[h.data.label]; } - function Rl(c) { - const g = {}, _ = n().results[c - 1].tallyResults; + function El(h) { + const g = {}, _ = n().results[h - 1].tallyResults; for (let A = 0; A < _.length; A++) { let E = _[A].eliminated; if (E === void 0 && (E = _[A].elected), E === void 0) { @@ -5266,40 +5233,40 @@ function xl(t, e) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [P, Y] of Object.entries(T)) - g[P] === void 0 ? g[P] = Number(Y) : g[P] += Number(Y); + for (let [P, z] of Object.entries(T)) + g[P] === void 0 ? g[P] = Number(z) : g[P] += Number(z); } return g; } - function Cl(c, g) { - const _ = [], A = Mt, E = n().results[c - 1].tallyResults; + function Tl(h, g) { + const _ = [], A = Pe, E = n().results[h - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const Y = E[T].transfers; - if (Y === void 0) { + const z = E[T].transfers; + if (z === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let V = g.find((k) => k.data.label == P && k.data.isTransfer); - V === void 0 && (V = g.find((k) => k.data.label == P && !k.data.isTransfer)); + let q = g.find((k) => k.data.label == P && k.data.isTransfer); + q === void 0 && (q = g.find((k) => k.data.label == P && !k.data.isTransfer)); let N = 0; - if (V) N = V.startAngle; + if (q) N = q.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, R] of Object.entries(Y)) { - let C; - const Pt = g.find((nt) => nt.data.label == k); - if (Pt) - C = structuredClone(Pt); + for (let [k, C] of Object.entries(z)) { + let R; + const De = g.find((ne) => ne.data.label == k); + if (De) + R = structuredClone(De); else if (k == "exhausted") - C = { - data: { label: k, value: Number(R) }, + R = { + data: { label: k, value: Number(C) }, value: 0, index: 0, startAngle: 0, @@ -5312,265 +5279,265 @@ function xl(t, e) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Yt = Number(R) / A * 2 * Math.PI; - C.startAngle = N, N = C.endAngle = N + Yt, C.index = T, C.data.transferIndex = T, _.push(C); + const Be = Number(C) / A * 2 * Math.PI; + R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); } } return _; } - function Sl(c, g, _) { + function Cl(h, g, _) { const A = {}; - for (let [E, T] of Object.entries(c)) { + for (let [E, T] of Object.entries(h)) { const P = _.find((N) => E == N.data.label); if (P === void 0) { E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const Y = (P.startAngle + P.endAngle) / 2, V = c[P.data.label] / g * 2 * Math.PI; - A[P.data.label] = Y - V / 2; + const z = (P.startAngle + P.endAngle) / 2, q = h[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = z - q / 2; } return A; } - function Nl(c, g, _) { - const A = [], E = Mt, T = Rl(c), P = Sl(T, E, _); - for (let [Y, V] of g.entries()) { - const N = structuredClone(V), k = V.endAngle - V.startAngle, R = _.find((C) => V.data.label === C.data.label && !C.data.isTransfer); - if (R) { - const C = R.data.label; - N.startAngle = P[C], P[C] += k, N.endAngle = N.startAngle + k; - } else if (V.data.label === "exhausted") - N.startAngle = V.startAngle, N.endAngle = V.endAngle; + function Rl(h, g, _) { + const A = [], E = Pe, T = El(h), P = Cl(T, E, _); + for (let [z, q] of g.entries()) { + const N = structuredClone(q), k = q.endAngle - q.startAngle, C = _.find((R) => q.data.label === R.data.label && !R.data.isTransfer); + if (C) { + const R = C.data.label; + N.startAngle = P[R], P[R] += k, N.endAngle = N.startAngle + k; + } else if (q.data.label === "exhausted") + N.startAngle = q.startAngle, N.endAngle = q.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); continue; } - N.index = Y, A.push(N); + N.index = z, A.push(N); } return A; } - function Qs(c, g, _, A) { - const E = we().innerRadius(_ * tt).outerRadius(_ * tt), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], Y = A.append("g").attr("opacity", 0); + function Zs(h, g, _, A) { + const E = _t().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); for (const k of T) { - const R = k.data.label === "exhausted" ? Se : k.data.label, C = E.centroid(k), Pt = ei(k.startAngle, k.endAngle), Q = Jr(k.data.label, c); - let Yt; - !p() && ke(k.data.label) ? Yt = Q : Yt = Q + " (" + Zr(k.data.label, c) + ")"; - const nt = Y.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pt).text(R); - nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Yt); - const Tt = nt.node().getBBox(); + const C = k.data.label === "exhausted" ? Tt : k.data.label, R = E.centroid(k), De = ei(k.startAngle, k.endAngle), Z = Jr(k.data.label, h); + let Be; + !p() && Rt(k.data.label) ? Be = Z : Be = Z + " (" + Zr(k.data.label, h) + ")"; + const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", De).text(C); + ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); + const Ce = ne.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Tt.x + C[0], Tt.y + C[1], Tt.width, Tt.height) + bbox: new DOMRect(Ce.x + R[0], Ce.y + R[1], Ce.width, Ce.height) }); } - Y.remove(), P.sort((k, R) => R.value - k.value); - const V = [], N = /* @__PURE__ */ new Set(); + z.remove(), P.sort((k, C) => C.value - k.value); + const q = [], N = /* @__PURE__ */ new Set(); for (const k of P) - V.some((C) => k.bbox.left < C.right && k.bbox.right > C.left && k.bbox.top < C.bottom && k.bbox.bottom > C.top) || (N.add(k.label), V.push(k.bbox)); + q.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), q.push(k.bbox)); return N; } - function ta(c, g, _, A, E, T) { - const Y = ct(x(it)).append("g").attr("id", U).attr("transform", `translate(${_}, ${A})`), V = we().innerRadius(E * tt).outerRadius(E * tt), N = Qs(c, g, E, Y); - Y.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && ct(this).append("g").attr("id", (R) => y(R.data)).classed("eliminated", (R) => T.includes(R.data.label) || R.data.isTransfer === !0).each(function(R, C) { - R.data.label === "exhausted" && ct(this).on("mouseenter", (Pt, Q) => Ol(Pt)).on("mouseleave", (Pt, Q) => Fl()); - }).append("text").attr("transform", (R) => `translate(${V.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).text((R) => R.data.label === "exhausted" ? Se : R.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((R) => { - const C = Jr(R.data.label, c); - return !p() && ke(R.data.label) ? C : C + " (" + Zr(R.data.label, c) + ")"; + function Qs(h, g, _, A, E, T) { + const z = fe(x(ie)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = _t().innerRadius(E * Q).outerRadius(E * Q), N = Zs(h, g, E, z); + z.selectAll("text").data(g).enter().each(function(k) { + !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { + C.data.label === "exhausted" && fe(this).on("mouseenter", (De, Z) => Pl(De)).on("mouseleave", (De, Z) => Dl()); + }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Tt : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { + const R = Jr(C.data.label, h); + return !p() && Rt(C.data.label) ? R : R + " (" + Zr(C.data.label, h) + ")"; }); }); } - function kl(c, g, _, A) { - const T = ct(x(it)).select("#" + U), P = Qs(c, g, _, T); - T.selectAll("g").each(function(C) { - C && C.data && !C.data.isTransfer && !P.has(C.data.label) && ct(this).remove(); + function Sl(h, g, _, A) { + const T = fe(x(ie)).select("#" + W), P = Zs(h, g, _, T); + T.selectAll("g").each(function(R) { + R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); }); - const Y = T.selectAll("tspan"), V = T.selectAll("g").data(g, (C) => y(C.data)).classed("eliminated", (C) => A.includes(C.data.label) || C.data.isTransfer === !0), N = we().innerRadius(_ * tt).outerRadius(_ * tt + 1); - Y.transition("global").duration(G).attr("transform", (C) => `translate(${N.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)), V.select("text").transition("global").duration(G).attr("transform", (C) => `translate(${N.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).on("end", (C) => R()); - let k = V.size(); - function R(C) { - k--, k === 0 && (T.remove(), ta(c, g, D, M, _, A)); + const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = _t().innerRadius(_ * Q).outerRadius(_ * Q + 1); + z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + let k = q.size(); + function C(R) { + k--, k === 0 && (T.remove(), Qs(h, g, D, M, _, A)); } } - function ea(c, g, _, A, E, T, P, Y = !0, V = !1, N = !1) { - const R = as().sort(null).value((C) => C.value)(_); - return na(c, g, R, A, E, T, P, Y, V, N), R; + function ea(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { + const C = as().sort(null).value((R) => R.value)(_); + return ta(h, g, C, A, E, T, P, z, q, N), C; } function Er() { - ct(x(it)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${kt}px`); - } - function na(c, g, _, A, E, T, P, Y, V, N = !1) { - const k = dn(c), R = br(c), Q = ct(x(it)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => R.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => y(nt.data)); - N ? Q.style("pointer-events", "none") : Q.on("mouseenter", (nt, Tt) => Zi(nt, Tt)).on("mouseleave", (nt, Tt) => Qi(nt, Tt)); - const Yt = we().outerRadius(P).innerRadius(T); - if (V) { - const nt = we().outerRadius(T + 1).innerRadius(T); - Q.append("path").attr("d", nt).attr("stroke", N ? "none" : T === 0 ? ut : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Tt) => Ar(Tt)).transition("global").duration(G).attr("d", (Tt) => Yt(Tt)).on("end", (Tt) => { + fe(x(ie)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Me}px`); + } + function ta(h, g, _, A, E, T, P, z, q, N = !1) { + const k = dn(h), C = xr(h), Z = fe(x(ie)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (ne) => k.includes(ne.data.label) || ne.data.isTransfer === !0).classed("elected", (ne) => C.includes(ne.data.label) && !ne.data.isTransfer).attr("id", (ne) => y(ne.data)); + N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (ne, Ce) => Zi(ne, Ce)).on("mouseleave", (ne, Ce) => Qi(ne, Ce)); + const Be = _t().outerRadius(P).innerRadius(T); + if (q) { + const ne = _t().outerRadius(T + 1).innerRadius(T); + Z.append("path").attr("d", ne).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ce) => Ar(Ce)).transition("global").duration(U).attr("d", (Ce) => Be(Ce)).on("end", (Ce) => { N || Ji(); }); } else - Q.append("path").attr("d", (nt) => Yt(nt)).attr("fill", N ? "none" : (nt) => Ar(nt)).attr("stroke", N ? "none" : ut).attr("stroke-width", N ? 0 : O), N || Ji(); - return Y && !N && ta(c, _, A, E, P, k), _; + Z.append("path").attr("d", (ne) => Be(ne)).attr("fill", N ? "none" : (ne) => Ar(ne)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || Ji(); + return z && !N && Qs(h, _, A, E, P, k), _; } - function Ml() { - const _ = ct(x(it)).select("#" + U).selectAll(".eliminated"); + function Nl() { + const _ = fe(x(ie)).select("#" + W).selectAll(".eliminated"); _.size() > 0 && _.classed("finished", !0); } - function Pl() { - const _ = ct(x(it)).select("#" + U).selectAll(".finished"); + function kl() { + const _ = fe(x(ie)).select("#" + W).selectAll(".finished"); _.size() > 0 && _.remove(); } - function Dl(c, g) { - const E = ct(x(it)).select("#" + S).selectAll(".eliminated"), T = we().innerRadius(c), P = we().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(G).attrTween("d", function(Y) { - const V = Ze(g, c); + function Ml(h, g) { + const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = _t().innerRadius(h), P = _t().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(U).attrTween("d", function(z) { + const q = Zt(g, h); return function(N) { - return P.innerRadius(V(N)), P(Y); + return P.innerRadius(q(N)), P(z); }; - }).attr("fill", (Y) => `url(#${ue(Y.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(Y) { - const V = Ze(g, c); + }).attr("fill", (z) => `url(#${ot(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { + const q = Zt(g, h); return function(N) { - return T.outerRadius(V(N)), T(Y); + return T.outerRadius(q(N)), T(z); }; - }).attr("fill", (Y) => Ar(Y)); + }).attr("fill", (z) => Ar(z)); } - function ei(c, g) { - const _ = (c + g) / 2; + function ei(h, g) { + const _ = (h + g) / 2; return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; } function Ji() { - ct(x( - it + fe(x( + ie // force redisplay of text labels - )).select("#" + U).raise().append("g").remove(); + )).select("#" + W).raise().append("g").remove(); } - function ra(c, g, _, A, E, T, P = !1) { - const V = as().sort(null).value((N) => N.value)(_); - return aa(c, g, V, A, E, T, P), V; + function na(h, g, _, A, E, T, P = !1) { + const q = as().sort(null).value((N) => N.value)(_); + return sa(h, g, q, A, E, T, P), q; } - function ia(c, g, _, A, E = !1) { - const T = dn(c), P = br(c), N = ct(x(it)).select("#" + g).selectAll(".slice").data(_, (R) => y(R.data)); + function ra(h, g, _, A, E = !1) { + const T = dn(h), P = xr(h), N = fe(x(ie)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); N.exit().remove(); - const k = N.enter().append("g").attr("class", "slice").attr("id", (R) => y(R.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (R, C) => Zi(R, C)).on("mouseleave", (R, C) => Qi(R, C)), k.append("path").attr("d", (R) => A(R)).attr("fill", E ? "none" : (R) => Ar(R)).attr("stroke", E ? "none" : ut).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => P.includes(R.data.label)), E || N.on("mouseenter", (R, C) => Zi(R, C)).on("mouseleave", (R, C) => Qi(R, C)), N; - } - function sa(c, g, _, A, E, T = !1) { - const P = we().outerRadius(E).innerRadius(A); - ia(c, g, _, P, T).select("path").attr("d", (V) => P(V)).attr("fill", T ? "none" : (V) => Ar(V)); - } - function aa(c, g, _, A, E, T, P = !1) { - const Y = we().outerRadius(E).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), V = we().outerRadius(E).innerRadius(A); - ct(x(it)).select("#" + g).selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); - const R = ia(c, g, _, V, P); - let C = R.size(); - function Pt() { - C--, C <= 0 && (P || Ji()); + const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; + } + function ia(h, g, _, A, E, T = !1) { + const P = _t().outerRadius(E).innerRadius(A); + ra(h, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); + } + function sa(h, g, _, A, E, T, P = !1) { + const z = _t().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = _t().outerRadius(E).innerRadius(A); + fe(x(ie)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const C = ra(h, g, _, q, P); + let R = C.size(); + function De() { + R--, R <= 0 && (P || Ji()); } - return R.select("path").transition("global").duration(G).attrTween("d", function(Q) { - const Yt = Number(ct(this.parentNode).attr("prevStart")), nt = Number(ct(this.parentNode).attr("prevEnd")), Tt = Ze(Yt, Q.startAngle), ni = Ze(nt, Q.endAngle); - return (Tr) => (Y.startAngle(Tt(Tr)).endAngle(ni(Tr)), Y(Q)); - }).on("end", function(Q) { - Q.startAngle === Q.endAngle && ct(this).attr("stroke", "none"), Pt(); - }), T && !P && kl(c, _, E, dn(c)), _; + return C.select("path").transition("global").duration(U).attrTween("d", function(Z) { + const Be = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ce = Zt(Be, Z.startAngle), ti = Zt(ne, Z.endAngle); + return (Tr) => (z.startAngle(Ce(Tr)).endAngle(ti(Tr)), z(Z)); + }).on("end", function(Z) { + Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), De(); + }), T && !P && Sl(h, _, E, dn(h)), _; } - function Zi(c, g) { - s(g.data.label), i("enter"), a(c.clientX), o(c.clientY); + function Zi(h, g) { + s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); } - function Qi(c, g) { + function Qi(h, g) { s(g.data.label), i("leave"); } - function Ol(c, g) { - i("show-exhausted"), a(c.clientX), o(c.clientY); + function Pl(h, g) { + i("show-exhausted"), a(h.clientX), o(h.clientY); } - function Fl(c, g) { + function Dl(h, g) { i("hide-exhausted"); } - var Il = { - pieColors: Ot, - exhaustedLabel: Se, - countExhaustedVotes: Ge, + var Ol = { + pieColors: Fe, + exhaustedLabel: Tt, + countExhaustedVotes: Wt, getEliminatedCandidates: dn, - getElectedCandidates: br, - runFullAnimationFn: $r, - animateOnePhaseFn: Zs, + getElectedCandidates: xr, + runFullAnimationFn: Kt, + animateOnePhaseFn: kt, get jsonData() { return n(); }, - set jsonData(c) { - n(c), rt(); + set jsonData(h) { + n(h), re(); }, get currentRound() { return r(); }, - set currentRound(c = 1) { - r(c), rt(); + set currentRound(h = 1) { + r(h), re(); }, get mouseEventType() { return i(); }, - set mouseEventType(c) { - i(c), rt(); + set mouseEventType(h) { + i(h), re(); }, get mouseData() { return s(); }, - set mouseData(c) { - s(c), rt(); + set mouseData(h) { + s(h), re(); }, get mouseX() { return a(); }, - set mouseX(c) { - a(c), rt(); + set mouseX(h) { + a(h), re(); }, get mouseY() { return o(); }, - set mouseY(c) { - o(c), rt(); + set mouseY(h) { + o(h), re(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(c = (g) => { + set requestRoundChange(h = (g) => { }) { - l(c), rt(); + l(h), re(); }, get candidateColors() { return u(); }, - set candidateColors(c = []) { - u(c), rt(); + set candidateColors(h = []) { + u(h), re(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(c = !1) { - f(c), rt(); + set excludeFinalWinnerAndEliminatedCandidate(h = !1) { + f(h), re(); }, get firstRoundDeterminesPercentages() { return p(); }, - set firstRoundDeterminesPercentages(c = !1) { - p(c), rt(); + set firstRoundDeterminesPercentages(h = !1) { + p(h), re(); }, get randomizeOrder() { - return h(); + return c(); }, - set randomizeOrder(c = !1) { - h(c), rt(); + set randomizeOrder(h = !1) { + c(h), re(); }, get displayPhase() { return d(); }, - set displayPhase(c = 0) { - d(c), rt(); + set displayPhase(h = 0) { + d(h), re(); } - }, oa = ep(); - return gi(oa, (c) => pt(it, c), () => x(it)), Ut(t, oa), Hi(Il); + }, aa = Qd(); + return vi(aa, (h) => he(ie, h), () => x(ie)), Ge(e, aa), zi(Ol); } Ys( - xl, + wl, { jsonData: {}, currentRound: {}, @@ -5597,14 +5564,14 @@ Ys( ], { mode: "open" } ); -var rp = /* @__PURE__ */ We("
"), ip = /* @__PURE__ */ We('
', 1), sp = /* @__PURE__ */ We('
'); -const ap = { +var tp = /* @__PURE__ */ Yt("
"), np = /* @__PURE__ */ Yt('
', 1), rp = /* @__PURE__ */ Yt('
'); +const ip = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function bl(t, e) { - zi(e, !0), Hs(t, ap); - let n = st(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = st(e, "currentStep", 7, 0), i = st(e, "disabled", 7, !1), s = st(e, "onAdvance", 7, () => { +function xl(e, t) { + Vi(t, !0), Hs(e, ip); + let n = ae(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ae(t, "currentStep", 7, 0), i = ae(t, "disabled", 7, !1), s = ae(t, "onAdvance", 7, () => { }); function a() { i() || s()(); @@ -5617,63 +5584,63 @@ function bl(t, e) { return n(); }, set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { - n(p), rt(); + n(p), re(); }, get currentStep() { return r(); }, set currentStep(p = 0) { - r(p), rt(); + r(p), re(); }, get disabled() { return i(); }, set disabled(p = !1) { - i(p), rt(); + i(p), re(); }, get onAdvance() { return s(); }, set onAdvance(p = () => { }) { - s(p), rt(); + s(p), re(); } - }, u = sp(); + }, u = rp(); let f; - return u.__click = a, u.__keydown = o, vi(u, 21, n, pi, (p, h, d) => { - var y = ip(), b = _n(y); + return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { + var y = np(), b = _n(y); { - var m = (U) => { - var at = rp(); - let tt; - Qe(() => tt = si(at, 1, "connector svelte-1l4eyw0", null, tt, { completed: !i() && d <= r() })), Ut(U, at); + var m = (W) => { + var oe = tp(); + let Q; + Qt(() => Q = ii(oe, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(W, oe); }; - tr(b, (U) => { - d > 0 && U(m); + Qn(b, (W) => { + d > 0 && W(m); }); } - var $ = ee(b, 2), D = Xt($); + var $ = Qe(b, 2), D = We($); let M; - var S = ee(D, 2); + var S = Qe(D, 2); let I; - var L = Xt(S, !0); - It(S), It($), Qe(() => { - M = si(D, 1, "dot svelte-1l4eyw0", null, M, { + var L = We(S, !0); + Ie(S), Ie($), Qt(() => { + M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { active: !i() && d === r(), completed: !i() && d < r() - }), I = si(S, 1, "label svelte-1l4eyw0", null, I, { + }), I = ii(S, 1, "label svelte-1l4eyw0", null, I, { active: !i() && d === r(), completed: !i() && d < r() - }), mn(L, x(h)); - }), Ut(p, y); - }), It(u), Qe(() => { - f = si(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ba(u, "tabindex", i() ? -1 : 0), ba(u, "aria-disabled", i()); - }), Ut(t, u), Hi(l); -} -Gu(["click", "keydown"]); -Ys(bl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var op = /* @__PURE__ */ We(" ", 1), lp = /* @__PURE__ */ We("About to eliminate: ", 1), up = /* @__PURE__ */ We(" ", 1), fp = /* @__PURE__ */ We(" ", 1), cp = /* @__PURE__ */ We('

', 1), hp = /* @__PURE__ */ We("
", 1), dp = /* @__PURE__ */ We('


these ballots have already been eliminated.
', 1); -const pp = { + }), mn(L, x(c)); + }), Ge(p, y); + }), Ie(u), Qt(() => { + f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); + }), Ge(e, u), zi(l); +} +Wu(["click", "keydown"]); +Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var sp = /* @__PURE__ */ Yt(" ", 1), ap = /* @__PURE__ */ Yt("About to eliminate: ", 1), op = /* @__PURE__ */ Yt(" ", 1), lp = /* @__PURE__ */ Yt(" ", 1), up = /* @__PURE__ */ Yt('

', 1), fp = /* @__PURE__ */ Yt("
", 1), cp = /* @__PURE__ */ Yt('


these ballots have already been eliminated.
', 1); +const hp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5688,12 +5655,12 @@ const pp = { }` }; -function vp(t, e) { - zi(e, !0), Hs(t, pp); +function dp(e, t) { + Vi(t, !0), Hs(e, hp); const n = 0.85; - let r = st(e, "electionSummary", 7), i = st(e, "currentRound", 7, 1), s = st(e, "requestRoundChange", 7, (w) => { - }), a = st(e, "candidateColors", 23, () => []), o = st(e, "textForWinner", 7, "elected"), l = st(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = st(e, "firstRoundDeterminesPercentages", 7, !1), f = st(e, "randomizeOrder", 7, !1), p = st(e, "showCaptions", 7, !1); - const h = { + let r = ae(t, "electionSummary", 7), i = ae(t, "currentRound", 7, 1), s = ae(t, "requestRoundChange", 7, (w) => { + }), a = ae(t, "candidateColors", 23, () => []), o = ae(t, "textForWinner", 7, "elected"), l = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ae(t, "firstRoundDeterminesPercentages", 7, !1), f = ae(t, "randomizeOrder", 7, !1), p = ae(t, "showCaptions", 7, !1); + const c = { elected: { caption: "Elected", event: "was elected", @@ -5711,39 +5678,39 @@ function vp(t, e) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ vn(() => h[o()] ?? h.elected), y = /* @__PURE__ */ At(null), b = /* @__PURE__ */ At(null), m = /* @__PURE__ */ At(""), $ = /* @__PURE__ */ At(Dn([])), D = /* @__PURE__ */ At(""), M = /* @__PURE__ */ At(""), S = /* @__PURE__ */ At(0), I = /* @__PURE__ */ At(0), L = /* @__PURE__ */ vn(() => U(r())); - function U(w) { + let d = /* @__PURE__ */ vn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(""), $ = /* @__PURE__ */ $e(Pn([])), D = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), S = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => W(r())); + function W(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (H) { - return console.error("Failed to parse JSON string:", H), {}; + } catch (Y) { + return console.error("Failed to parse JSON string:", Y), {}; } return w || {}; } - function at(w) { + function oe(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function tt(w, H, Z) { - w.style.left = H + "px", w.style.top = Z + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const lt = w.getBoundingClientRect(); - let zt = H, Me = Z + 20; - zt + lt.width > window.innerWidth - 12 && (zt = window.innerWidth - lt.width - 12), zt < 12 && (zt = 12), Me + lt.height > window.innerHeight - 12 && (Me = Z - lt.height - 12), w.style.left = zt + "px", w.style.top = Me + "px"; + function Q(w, Y, te) { + w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const se = w.getBoundingClientRect(); + let ze = Y, Ut = te + 20; + ze + se.width > window.innerWidth - 12 && (ze = window.innerWidth - se.width - 12), ze < 12 && (ze = 12), Ut + se.height > window.innerHeight - 12 && (Ut = te - se.height - 12), w.style.left = ze + "px", w.style.top = Ut + "px"; }); } - function G() { + function U() { switch (x(D)) { case "enter": ((w) => { - var H = iu(w, 2); - pt($, H[0], !0), pt(m, H[1], !0); - })(ut(x(M), i())), x(y) && (tt(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); + var Y = nu(w, 2); + he($, Y[0], !0), he(m, Y[1], !0); + })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); break; case "leave": - x(y) && (x(y).style.opacity = "0"), pt($, [], !0), pt(m, ""); + x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); break; case "show-exhausted": - x(b) && (tt(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); + x(b) && (Q(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); break; case "hide-exhausted": x(b) && (x(b).style.opacity = "0"); @@ -5755,160 +5722,160 @@ function vp(t, e) { break; } } - Is(() => G()); - function ot(w, H) { - return w === 1 ? H ? "vote was" : "vote will be" : H ? "votes were" : "votes will be"; - } - function ut(w, H) { - const Z = [], ht = w === "exhausted" ? Se() : w; - let xt; - w === "exhausted" ? xt = q(1) : xt = x(L).results[0].tally[w], Z.push(`${ht} started with ${xt} votes.`); - for (let lt = 1; lt <= H; lt++) { - lt === H && (w === "exhausted" ? xt = q(H) : xt = x(L).results[H - 1].tally[w], Z.push(`${ht} has ${xt} votes at round ${H}.`)); - const zt = x(L).results[lt - 1].tallyResults, Me = wt(lt); - for (let Pe = 0; Pe < zt.length; Pe++) { - const Rn = zt[Pe].transfers, pn = zt[Pe].eliminated, Ht = zt[Pe].elected; - if (!Me) { + Is(() => U()); + function le(w, Y) { + return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; + } + function ue(w, Y) { + const te = [], pe = w === "exhausted" ? Tt() : w; + let xe; + w === "exhausted" ? xe = G(1) : xe = x(L).results[0].tally[w], te.push(`${pe} started with ${xe} votes.`); + for (let se = 1; se <= Y; se++) { + se === Y && (w === "exhausted" ? xe = G(Y) : xe = x(L).results[Y - 1].tally[w], te.push(`${pe} has ${xe} votes at round ${Y}.`)); + const ze = x(L).results[se - 1].tallyResults, Ut = we(se); + for (let St = 0; St < ze.length; St++) { + const Cn = ze[St].transfers, pn = ze[St].eliminated, Ee = ze[St].elected; + if (!Ut) { if (pn) - pn === w && Z.push(`${ht} will be eliminated on round ${lt}.`); - else if (w === Ht && (Z.push(`${ht} ${x(d).event} on round ${lt}.`), Rn)) - for (let [Ft, fe] of Object.entries(Rn)) - Z.push(`${fe} ${ot(Number(fe), lt < H)} transferred to ${Ft} on round ${lt}.`); + pn === w && te.push(`${pe} will be eliminated on round ${se}.`); + else if (w === Ee && (te.push(`${pe} ${x(d).event} on round ${se}.`), Cn)) + for (let [Te, ve] of Object.entries(Cn)) + te.push(`${ve} ${le(Number(ve), se < Y)} transferred to ${Te} on round ${se}.`); } - const De = pn || Ht; - if (De) { - const Ft = Number(Rn[w]); - Ft && Z.push(`${Ft} ${ot(Ft, lt < H)} transferred from ${De} on round ${lt}.`); + const He = pn || Ee; + if (He) { + const Te = Number(Cn[w]); + Te && te.push(`${Te} ${le(Te, se < Y)} transferred from ${He} on round ${se}.`); } } } - return [Z, ht]; + return [te, pe]; } function O() { let w = 0; - for (let H = 1; H <= x(L).results.length; H++) { - if (wt(H)) continue; - const Z = x(L).results[H - 1].tallyResults; - for (let ht = 0; ht < Z.length; ht++) - Z[ht].elected && w++; + for (let Y = 1; Y <= x(L).results.length; Y++) { + if (we(Y)) continue; + const te = x(L).results[Y - 1].tallyResults; + for (let pe = 0; pe < te.length; pe++) + te[pe].elected && w++; } return w; } - let F, kt = /* @__PURE__ */ At(0); - function ue(w) { - var xt; - return !((xt = x(L)) != null && xt.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((lt) => lt.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let F, Me = /* @__PURE__ */ $e(0); + function ot(w) { + var xe; + return !((xe = x(L)) != null && xe.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((se) => se.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function yt(w) { - var Z; - if (!((Z = x(L)) != null && Z.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; - const H = x(L).results[w - 1].tallyResults; - return H.length === 0 || H.every((ht) => Object.keys(ht.transfers).length === 0); + function ye(w) { + var te; + if (!((te = x(L)) != null && te.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; + const Y = x(L).results[w - 1].tallyResults; + return Y.length === 0 || Y.every((pe) => Object.keys(pe.transfers).length === 0); } - function wt(w) { + function we(w) { return l() && x(L).results && w === x(L).results.length; } - function et(w) { - return wt(w) ? [] : F ? F.getEliminatedCandidates(w) : []; + function ee(w) { + return we(w) ? [] : F ? F.getEliminatedCandidates(w) : []; } - function Mt(w) { - return wt(w) ? [] : F ? F.getElectedCandidates(w) : []; + function Pe(w) { + return we(w) ? [] : F ? F.getElectedCandidates(w) : []; } - function q(w) { + function G(w) { return F ? F.countExhaustedVotes(w) : 0; } - function Ot() { + function Fe() { F && F.animateOnePhaseFn && F.animateOnePhaseFn(); } - function Se() { + function Tt() { return F ? F.exhaustedLabel : ""; } - function it() { + function ie() { return F ? F.pieColors : {}; } - var Jt = { + var Ze = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), rt(); + r(w), re(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), rt(); + i(w), re(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (H) => { + set requestRoundChange(w = (Y) => { }) { - s(w), rt(); + s(w), re(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), rt(); + a(w), re(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), rt(); + o(w), re(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), rt(); + l(w), re(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), rt(); + u(w), re(); }, get randomizeOrder() { return f(); }, set randomizeOrder(w = !1) { - f(w), rt(); + f(w), re(); }, get showCaptions() { return p(); }, set showCaptions(w = !1) { - p(w), rt(); + p(w), re(); } - }, Zt = dp(), Qt = _n(Zt), Tn = Xt(Qt); + }, Xt = cp(), lt = _n(Xt), Tn = We(lt); { - let w = /* @__PURE__ */ vn(() => ue(i())), H = /* @__PURE__ */ vn(() => yt(i())); - bl(Tn, { + let w = /* @__PURE__ */ vn(() => ot(i())), Y = /* @__PURE__ */ vn(() => ye(i())); + xl(Tn, { get labels() { return x(w); }, get currentStep() { - return x(kt); + return x(Me); }, get disabled() { - return x(H); + return x(Y); }, - onAdvance: Ot + onAdvance: Fe }); } - It(Qt); - var _t = ee(Qt, 4), Ne = Xt(_t), Ge = Xt(Ne), jr = Xt(Ge); - gi( - xl(jr, { + Ie(lt); + var _e = Qe(lt, 4), Ct = We(_e), Wt = We(Ct), jr = We(Wt); + vi( + wl(jr, { get jsonData() { return x(L); }, get currentRound() { return i(); }, - requestRoundChange: at, + requestRoundChange: oe, get candidateColors() { return a(); }, @@ -5925,127 +5892,127 @@ function vp(t, e) { return x(D); }, set mouseEventType(w) { - pt(D, w, !0); + he(D, w, !0); }, get mouseData() { return x(M); }, set mouseData(w) { - pt(M, w, !0); + he(M, w, !0); }, get mouseX() { return x(S); }, set mouseX(w) { - pt(S, w, !0); + he(S, w, !0); }, get mouseY() { return x(I); }, set mouseY(w) { - pt(I, w, !0); + he(I, w, !0); }, get displayPhase() { - return x(kt); + return x(Me); }, set displayPhase(w) { - pt(kt, w, !0); + he(Me, w, !0); } }), (w) => F = w, () => F - ), It(Ge), It(Ne); - var Jr = ee(Ne, 2); + ), Ie(Wt), Ie(Ct); + var Jr = Qe(Ct, 2); { var Zr = (w) => { - var H = cp(), Z = _n(H), ht = Xt(Z); - It(Z); - var xt = ee(Z, 2), lt = Xt(xt); + var Y = up(), te = _n(Y), pe = We(te); + Ie(te); + var xe = Qe(te, 2), se = We(xe); { - var zt = (Ht) => { - var De = lp(), Ft = ee(_n(De)); - vi(Ft, 17, () => et(i()), pi, (fe, ye, bt) => { - var te = op(), mt = _n(te); - let ce; - var Cn = Xt(mt, !0); - It(mt); - var $r = ee(mt, 2); + var ze = (Ee) => { + var He = ap(), Te = Qe(_n(He)); + pi(Te, 17, () => ee(i()), di, (ve, ut, Ye) => { + var Gt = sp(), Nt = _n(Gt); + let Kt; + var Rn = We(Nt, !0); + Ie(Nt); + var me = Qe(Nt, 2); { - var Sn = (Ke) => { - var je = _a(", "); - Ut(Ke, je); - }, ft = /* @__PURE__ */ vn(() => bt < et(i()).length - 1); - tr($r, (Ke) => { - x(ft) && Ke(Sn); + var br = (jt) => { + var kt = ga(", "); + Ge(jt, kt); + }, $r = /* @__PURE__ */ vn(() => Ye < ee(i()).length - 1); + Qn(me, (jt) => { + x($r) && jt(br); }); } - Qe( - (Ke) => { - ce = xa(mt, "", ce, Ke), mn(Cn, x(ye)); + Qt( + (jt) => { + Kt = wa(Nt, "", Kt, jt), mn(Rn, x(ut)); }, - [() => ({ color: it()[x(ye)] })] - ), Ut(fe, te); - }), Ut(Ht, De); - }, Me = /* @__PURE__ */ vn(() => et(i()).length > 0); - tr(lt, (Ht) => { - x(Me) && Ht(zt); + [() => ({ color: ie()[x(ut)] })] + ), Ge(ve, Gt); + }), Ge(Ee, He); + }, Ut = /* @__PURE__ */ vn(() => ee(i()).length > 0); + Qn(se, (Ee) => { + x(Ut) && Ee(ze); }); } - var Pe = ee(lt, 2); + var St = Qe(se, 2); { - var Rn = (Ht) => { - var De = fp(), Ft = _n(De), fe = ee(Ft); - vi(fe, 17, () => Mt(i()), pi, (ye, bt, te) => { - var mt = up(), ce = _n(mt); - let Cn; - var $r = Xt(ce, !0); - It(ce); - var Sn = ee(ce, 2); + var Cn = (Ee) => { + var He = lp(), Te = _n(He), ve = Qe(Te); + pi(ve, 17, () => Pe(i()), di, (ut, Ye, Gt) => { + var Nt = op(), Kt = _n(Nt); + let Rn; + var me = We(Kt, !0); + Ie(Kt); + var br = Qe(Kt, 2); { - var ft = (je) => { - var ti = _a(", "); - Ut(je, ti); - }, Ke = /* @__PURE__ */ vn(() => te < Mt(i()).length - 1); - tr(Sn, (je) => { - x(Ke) && je(ft); + var $r = (kt) => { + var ji = ga(", "); + Ge(kt, ji); + }, jt = /* @__PURE__ */ vn(() => Gt < Pe(i()).length - 1); + Qn(br, (kt) => { + x(jt) && kt($r); }); } - Qe( - (je) => { - Cn = xa(ce, "", Cn, je), mn($r, x(bt)); + Qt( + (kt) => { + Rn = wa(Kt, "", Rn, kt), mn(me, x(Ye)); }, - [() => ({ color: it()[x(bt)] })] - ), Ut(ye, mt); - }), Qe(() => mn(Ft, `${x(d).caption ?? ""}: `)), Ut(Ht, De); - }, pn = /* @__PURE__ */ vn(() => Mt(i()).length > 0); - tr(Pe, (Ht) => { - x(pn) && Ht(Rn); + [() => ({ color: ie()[x(Ye)] })] + ), Ge(ut, Nt); + }), Qt(() => mn(Te, `${x(d).caption ?? ""}: `)), Ge(Ee, He); + }, pn = /* @__PURE__ */ vn(() => Pe(i()).length > 0); + Qn(St, (Ee) => { + x(pn) && Ee(Cn); }); } - It(xt), Qe((Ht) => mn(ht, `${x(L).config.contest ?? ""}, ${Ht ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ut(w, H); + Ie(xe), Qt((Ee) => mn(pe, `${x(L).config.contest ?? ""}, ${Ee ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, Y); }; - tr(Jr, (w) => { + Qn(Jr, (w) => { p() && w(Zr); }); } - It(_t); - var Zn = ee(_t, 2), ke = Xt(Zn), ji = Xt(ke, !0); - It(ke); - var Qr = ee(ke, 2); - vi(Qr, 17, () => x($), pi, (w, H) => { - var Z = hp(), ht = _n(Z), xt = Xt(ht, !0); - It(ht), us(2), Qe(() => mn(xt, x(H))), Ut(w, Z); - }), It(Zn), gi(Zn, (w) => pt(y, w), () => x(y)); - var dn = ee(Zn, 2), br = Xt(dn); - return us(2), It(dn), gi(dn, (w) => pt(b, w), () => x(b)), Qe( + Ie(_e); + var Jn = Qe(_e, 2), Rt = We(Jn), Ki = We(Rt, !0); + Ie(Rt); + var Qr = Qe(Rt, 2); + pi(Qr, 17, () => x($), di, (w, Y) => { + var te = fp(), pe = _n(te), xe = We(pe, !0); + Ie(pe), us(2), Qt(() => mn(xe, x(Y))), Ge(w, te); + }), Ie(Jn), vi(Jn, (w) => he(y, w), () => x(y)); + var dn = Qe(Jn, 2), xr = We(dn); + return us(2), Ie(dn), vi(dn, (w) => he(b, w), () => x(b)), Qt( (w) => { - mn(ji, x(m)), mn(br, `"${w ?? ""}" means all the candidates ranked on `); + mn(Ki, x(m)), mn(xr, `"${w ?? ""}" means all the candidates ranked on `); }, - [Se] - ), Ut(t, Zt), Hi(Jt); + [Tt] + ), Ge(e, Xt), zi(Ze); } customElements.define("pie-chart", Ys( - vp, + dp, { electionSummary: {}, currentRound: {}, From 8164a377be6cb886e11879a9317bb44c2c19ffe1 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 8 Apr 2026 16:58:06 -0700 Subject: [PATCH 05/10] Revert auto-play workaround; update pie chart component The no-transfer round skipping has been reverted from the pie chart component, so the workaround in updateRound is no longer needed. Co-Authored-By: Claude Opus 4.6 --- templates/pie/pie-nonblocking.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 3f7c7385..e18da237 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -50,14 +50,9 @@ // When the pie chart is animating it knows it is advancing rounds, but to avoid reactive // loops it requests to be told the new currentRound rather than using 2-way binding. // And we also update the slider state while we're at it. - // - // During auto-play, skip the setStep() call — it stops playback. - // The round player's timer will catch up on its next tick. function updateRound(roundNum) { pieChart.currentRound = roundNum; - if (!pieRoundPlayer.playing()) { - pieRoundPlayer.setStep(roundNum - 1); - } + pieRoundPlayer.setStep(roundNum - 1); } From 3727d1a84903bf8ab750c5d9d1fabc659c8bce91 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 8 Apr 2026 18:25:06 -0700 Subject: [PATCH 06/10] Sync pie chart --- static/pie/pie-chart.es.js | 5169 ++++++++++++++++++------------------ 1 file changed, 2573 insertions(+), 2596 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 1f2c0863..1df9f35d 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,181 +1,181 @@ -var Ll = Object.defineProperty; -var oa = (e) => { - throw TypeError(e); +var Fl = Object.defineProperty; +var oa = (t) => { + throw TypeError(t); }; -var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var ce = (e, t, n) => ql(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || oa("Cannot " + n); -var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? oa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); +var Ll = (t, e, n) => e in t ? Fl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var ct = (t, e, n) => Ll(t, typeof e != "symbol" ? e + "" : e, n), ts = (t, e, n) => e.has(t) || oa("Cannot " + n); +var v = (t, e, n) => (ts(t, e, "read from private field"), n ? n.call(t) : e.get(t)), H = (t, e, n) => e.has(t) ? oa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), V = (t, e, n, r) => (ts(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), xt = (t, e, n) => (ts(t, e, "access private method"), n); var za; typeof window < "u" && ((za = window.__svelte ?? (window.__svelte = {})).v ?? (za.v = /* @__PURE__ */ new Set())).add("5"); -const Vl = 1, zl = 2, Xa = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Re = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; -var Ua = Array.isArray, jl = Array.prototype.indexOf, fr = Array.prototype.includes, Fi = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; -const eu = () => { +const ql = 1, Vl = 2, Xa = 4, zl = 8, Hl = 16, Yl = 1, Bl = 4, Xl = 8, Wl = 16, Ul = 1, Gl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Tt = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; +var Ua = Array.isArray, Kl = Array.prototype.indexOf, fr = Array.prototype.includes, Ii = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, jl = Object.getOwnPropertyDescriptors, Jl = Object.prototype, Zl = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; +const Ql = () => { }; -function tu(e) { - for (var t = 0; t < e.length; t++) - e[t](); +function tu(t) { + for (var e = 0; e < t.length; e++) + t[e](); } function Ka() { - var e, t, n = new Promise((r, i) => { - e = r, t = i; + var t, e, n = new Promise((r, i) => { + t = r, e = i; }); - return { promise: n, resolve: e, reject: t }; + return { promise: n, resolve: t, reject: e }; } -function nu(e, t) { - if (Array.isArray(e)) - return e; - if (!(Symbol.iterator in e)) - return Array.from(e); +function eu(t, e) { + if (Array.isArray(t)) + return t; + if (!(Symbol.iterator in t)) + return Array.from(t); const n = []; - for (const r of e) - if (n.push(r), n.length === t) break; + for (const r of t) + if (n.push(r), n.length === e) break; return n; } -const Ne = 2, Fr = 4, Ii = 8, ja = 1 << 24, hn = 16, At = 32, En = 64, Ja = 128, pt = 512, Ae = 1024, ke = 2048, $t = 4096, rt = 8192, ln = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, ru = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), iu = Symbol(""), kn = new class extends Error { +const Rt = 2, Or = 4, Fi = 8, ja = 1 << 24, hn = 16, Te = 32, En = 64, Ja = 128, he = 512, $t = 1024, St = 2048, Ee = 4096, ee = 8192, ln = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, nu = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Mr = Symbol("$state"), Qa = Symbol("legacy props"), ru = Symbol(""), kn = new class extends Error { constructor() { super(...arguments); - ce(this, "name", "StaleReactionError"); - ce(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + ct(this, "name", "StaleReactionError"); + ct(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); var Ha; -const su = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, yr = 8; -function au(e) { +const iu = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Wr = 3, yr = 8; +function su(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function ou() { +function au() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function lu(e, t, n) { +function ou(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function uu(e) { +function lu(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function fu() { +function uu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function cu(e) { +function fu(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function hu() { +function cu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function du() { +function hu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function pu(e) { +function du(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function vu() { +function pu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function gu() { +function vu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function _u() { +function gu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function mu() { +function _u() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Li(e) { +function Li(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function yu() { +function mu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let j = !1; -function on(e) { - j = e; +let K = !1; +function on(t) { + K = t; } let X; -function qe(e) { - if (e === null) +function Lt(t) { + if (t === null) throw Li(), ur; - return X = e; + return X = t; } function qi() { - return qe(/* @__PURE__ */ zt(X)); + return Lt(/* @__PURE__ */ He(X)); } -function Ie(e) { - if (j) { - if (/* @__PURE__ */ zt(X) !== null) +function It(t) { + if (K) { + if (/* @__PURE__ */ He(X) !== null) throw Li(), ur; - X = e; + X = t; } } -function us(e = 1) { - if (j) { - for (var t = e, n = X; t--; ) +function us(t = 1) { + if (K) { + for (var e = t, n = X; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ zt(n); + /* @__PURE__ */ He(n); X = n; } } -function Ai(e = !0) { - for (var t = 0, n = X; ; ) { +function Ai(t = !0) { + for (var e = 0, n = X; ; ) { if (n.nodeType === yr) { var r = ( /** @type {Comment} */ n.data ); if (r === ks) { - if (t === 0) return n; - t -= 1; + if (e === 0) return n; + e -= 1; } else (r === Ns || r === Oi || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ zt(n) + /* @__PURE__ */ He(n) ); - e && n.remove(), n = i; + t && n.remove(), n = i; } } -function eo(e) { - if (!e || e.nodeType !== yr) +function to(t) { + if (!t || t.nodeType !== yr) throw Li(), ur; return ( /** @type {Comment} */ - e.data + t.data ); } -function to(e) { - return e === this.v; +function eo(t) { + return t === this.v; } -function wu(e, t) { - return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; +function yu(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function no(e) { - return !wu(e, this.v); +function no(t) { + return !yu(t, this.v); } -let xu = !1, st = null; -function hr(e) { - st = e; +let wu = !1, re = null; +function hr(t) { + re = t; } -function Vi(e, t = !1, n) { - st = { - p: st, +function Vi(t, e = !1, n) { + re = { + p: re, i: !1, c: null, e: null, - s: e, + s: t, x: null, l: null }; } -function zi(e) { - var t = ( +function zi(t) { + var e = ( /** @type {ComponentContext} */ - st - ), n = t.e; + re + ), n = e.e; if (n !== null) { - t.e = null; + e.e = null; for (var r of n) Ro(r); } - return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, re = e.p, t ?? /** @type {T} */ {}; } function ro() { @@ -183,83 +183,83 @@ function ro() { } let Mn = []; function io() { - var e = Mn; - Mn = [], tu(e); + var t = Mn; + Mn = [], tu(t); } -function xn(e) { - if (Mn.length === 0 && !Dr) { - var t = Mn; +function xn(t) { + if (Mn.length === 0 && !Pr) { + var e = Mn; queueMicrotask(() => { - t === Mn && io(); + e === Mn && io(); }); } - Mn.push(e); + Mn.push(t); } -function bu() { +function xu() { for (; Mn.length > 0; ) io(); } -function so(e) { - var t = J; - if (t === null) - return B.f |= wn, e; - if ((t.f & mr) === 0 && (t.f & Fr) === 0) - throw e; - dr(e, t); +function so(t) { + var e = j; + if (e === null) + return B.f |= wn, t; + if ((e.f & mr) === 0 && (e.f & Or) === 0) + throw t; + dr(t, e); } -function dr(e, t) { - for (; t !== null; ) { - if ((t.f & Ja) !== 0) { - if ((t.f & mr) === 0) - throw e; +function dr(t, e) { + for (; e !== null; ) { + if ((e.f & Ja) !== 0) { + if ((e.f & mr) === 0) + throw t; try { - t.b.error(e); + e.b.error(t); return; } catch (n) { - e = n; + t = n; } } - t = t.parent; + e = e.parent; } - throw e; + throw t; } -const $u = -7169; -function de(e, t) { - e.f = e.f & $u | t; +const bu = -7169; +function dt(t, e) { + t.f = t.f & bu | e; } -function Ps(e) { - (e.f & pt) !== 0 || e.deps === null ? de(e, Ae) : de(e, $t); +function Ps(t) { + (t.f & he) !== 0 || t.deps === null ? dt(t, $t) : dt(t, Ee); } -function ao(e) { - if (e !== null) - for (const t of e) - (t.f & Ne) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( +function ao(t) { + if (t !== null) + for (const e of t) + (e.f & Rt) === 0 || (e.f & Wn) === 0 || (e.f ^= Wn, ao( /** @type {Derived} */ - t.deps + e.deps )); } -function oo(e, t, n) { - (e.f & ke) !== 0 ? t.add(e) : (e.f & $t) !== 0 && n.add(e), ao(e.deps), de(e, Ae); +function oo(t, e, n) { + (t.f & St) !== 0 ? e.add(t) : (t.f & Ee) !== 0 && n.add(t), ao(t.deps), dt(t, $t); } const ni = /* @__PURE__ */ new Set(); -let K = null, Se = null, Ke = [], Hi = null, fs = !1, Dr = !1; -var nr, rr, Fn, ir, Hr, Yr, In, en, sr, Vt, cs, hs, lo; +let G = null, Ct = null, Ut = [], Hi = null, fs = !1, Pr = !1; +var nr, rr, In, ir, zr, Hr, Fn, tn, sr, ze, cs, hs, lo; const Js = class Js { constructor() { - H(this, Vt); - ce(this, "committed", !1); + H(this, ze); + ct(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - ce(this, "current", /* @__PURE__ */ new Map()); + ct(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - ce(this, "previous", /* @__PURE__ */ new Map()); + ct(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks @@ -274,7 +274,7 @@ const Js = class Js { /** * The number of async effects that are currently in flight */ - H(this, Fn, 0); + H(this, In, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ @@ -284,17 +284,17 @@ const Js = class Js { * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - H(this, Hr, null); + H(this, zr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - H(this, Yr, /* @__PURE__ */ new Set()); + H(this, Hr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - H(this, In, /* @__PURE__ */ new Set()); + H(this, Fn, /* @__PURE__ */ new Set()); /** * A map of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process`. @@ -302,8 +302,8 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, en, /* @__PURE__ */ new Map()); - ce(this, "is_fork", !1); + H(this, tn, /* @__PURE__ */ new Map()); + ct(this, "is_fork", !1); H(this, sr, !1); } is_deferred() { @@ -313,43 +313,43 @@ const Js = class Js { * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(t) { - v(this, en).has(t) || v(this, en).set(t, { d: [], m: [] }); + skip_effect(e) { + v(this, tn).has(e) || v(this, tn).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(t) { - var n = v(this, en).get(t); + unskip_effect(e) { + var n = v(this, tn).get(e); if (n) { - v(this, en).delete(t); + v(this, tn).delete(e); for (var r of n.d) - de(r, ke), xt(r); + dt(r, St), $e(r); for (r of n.m) - de(r, $t), xt(r); + dt(r, Ee), $e(r); } } /** * * @param {Effect[]} root_effects */ - process(t) { + process(e) { var i; - Ke = [], this.apply(); + Ut = [], this.apply(); var n = [], r = []; - for (const s of t) - be(this, Vt, cs).call(this, s, n, r); + for (const s of e) + xt(this, ze, cs).call(this, s, n, r); if (this.is_deferred()) { - be(this, Vt, hs).call(this, r), be(this, Vt, hs).call(this, n); - for (const [s, a] of v(this, en)) + xt(this, ze, hs).call(this, r), xt(this, ze, hs).call(this, n); + for (const [s, a] of v(this, tn)) ho(s, a); } else { for (const s of v(this, nr)) s(); - v(this, nr).clear(), v(this, Fn) === 0 && be(this, Vt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); + v(this, nr).clear(), v(this, In) === 0 && xt(this, ze, lo).call(this), G = null, fa(r), fa(n), (i = v(this, zr)) == null || i.resolve(); } - Se = null; + Ct = null; } /** * Associate a change to a given source with the current @@ -357,106 +357,106 @@ const Js = class Js { * @param {Source} source * @param {any} value */ - capture(t, n) { - n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); + capture(e, n) { + n !== Tt && !this.previous.has(e) && this.previous.set(e, n), (e.f & wn) === 0 && (this.current.set(e, e.v), Ct == null || Ct.set(e, e.v)); } activate() { - K = this, this.apply(); + G = this, this.apply(); } deactivate() { - K === this && (K = null, Se = null); + G === this && (G = null, Ct = null); } flush() { - if (this.activate(), Ke.length > 0) { - if (uo(), K !== null && K !== this) + if (this.activate(), Ut.length > 0) { + if (uo(), G !== null && G !== this) return; - } else v(this, Fn) === 0 && this.process([]); + } else v(this, In) === 0 && this.process([]); this.deactivate(); } discard() { - for (const t of v(this, rr)) t(this); + for (const e of v(this, rr)) e(this); v(this, rr).clear(); } /** * * @param {boolean} blocking */ - increment(t) { - V(this, Fn, v(this, Fn) + 1), t && V(this, ir, v(this, ir) + 1); + increment(e) { + V(this, In, v(this, In) + 1), e && V(this, ir, v(this, ir) + 1); } /** * * @param {boolean} blocking */ - decrement(t) { - V(this, Fn, v(this, Fn) - 1), t && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { - V(this, sr, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); + decrement(e) { + V(this, In, v(this, In) - 1), e && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { + V(this, sr, !1), this.is_deferred() ? Ut.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, Yr)) - v(this, In).delete(t), de(t, ke), xt(t); - for (const t of v(this, In)) - de(t, $t), xt(t); + for (const e of v(this, Hr)) + v(this, Fn).delete(e), dt(e, St), $e(e); + for (const e of v(this, Fn)) + dt(e, Ee), $e(e); this.flush(); } /** @param {() => void} fn */ - oncommit(t) { - v(this, nr).add(t); + oncommit(e) { + v(this, nr).add(e); } /** @param {(batch: Batch) => void} fn */ - ondiscard(t) { - v(this, rr).add(t); + ondiscard(e) { + v(this, rr).add(e); } settled() { - return (v(this, Hr) ?? V(this, Hr, Ka())).promise; + return (v(this, zr) ?? V(this, zr, Ka())).promise; } static ensure() { - if (K === null) { - const t = K = new Js(); - ni.add(K), Dr || xn(() => { - K === t && t.flush(); + if (G === null) { + const e = G = new Js(); + ni.add(G), Pr || xn(() => { + G === e && e.flush(); }); } - return K; + return G; } apply() { } }; -nr = new WeakMap(), rr = new WeakMap(), Fn = new WeakMap(), ir = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), In = new WeakMap(), en = new WeakMap(), sr = new WeakMap(), Vt = new WeakSet(), /** +nr = new WeakMap(), rr = new WeakMap(), In = new WeakMap(), ir = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(), Fn = new WeakMap(), tn = new WeakMap(), sr = new WeakMap(), ze = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -cs = function(t, n, r) { - t.f ^= Ae; - for (var i = t.first, s = null; i !== null; ) { - var a = i.f, o = (a & (At | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & rt) !== 0 || v(this, en).has(i); +cs = function(e, n, r) { + e.f ^= $t; + for (var i = e.first, s = null; i !== null; ) { + var a = i.f, o = (a & (Te | En)) !== 0, l = o && (a & $t) !== 0, u = l || (a & ee) !== 0 || v(this, tn).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Ae : s !== null && (a & (Fr | Ii | ja)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & hn) !== 0 && v(this, In).add(i), vr(i)); + o ? i.f ^= $t : s !== null && (a & (Or | Fi | ja)) !== 0 ? s.b.defer_effect(i) : (a & Or) !== 0 ? n.push(i) : Ur(i) && ((a & hn) !== 0 && v(this, Fn).add(i), vr(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var p = i.parent; - for (i = i.next; i === null && p !== null; ) - p === s && (s = null), i = p.next, p = p.parent; + var d = i.parent; + for (i = i.next; i === null && d !== null; ) + d === s && (s = null), i = d.next, d = d.parent; } }, /** * @param {Effect[]} effects */ -hs = function(t) { - for (var n = 0; n < t.length; n += 1) - oo(t[n], v(this, Yr), v(this, In)); +hs = function(e) { + for (var n = 0; n < e.length; n += 1) + oo(e[n], v(this, Hr), v(this, Fn)); }, lo = function() { var i; if (ni.size > 1) { this.previous.clear(); - var t = Se, n = !0; + var e = Ct, n = !0; for (const s of ni) { if (s === this) { n = !1; @@ -475,114 +475,114 @@ hs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ke; - Ke = []; + var r = Ut; + Ut = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) fo(f, o, l, u); - if (Ke.length > 0) { - K = s, s.apply(); - for (const f of Ke) - be(i = s, Vt, cs).call(i, f, [], []); + if (Ut.length > 0) { + G = s, s.apply(); + for (const f of Ut) + xt(i = s, ze, cs).call(i, f, [], []); s.deactivate(); } - Ke = r; + Ut = r; } } - K = null, Se = t; + G = null, Ct = e; } this.committed = !0, ni.delete(this); }; let un = Js; -function re(e) { - var t = Dr; - Dr = !0; +function rt(t) { + var e = Pr; + Pr = !0; try { for (var n; ; ) { - if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) + if (xu(), Ut.length === 0 && (G == null || G.flush(), Ut.length === 0)) return Hi = null, /** @type {T} */ n; uo(); } } finally { - Dr = t; + Pr = e; } } function uo() { fs = !0; - var e = null; + var t = null; try { - for (var t = 0; Ke.length > 0; ) { + for (var e = 0; Ut.length > 0; ) { var n = un.ensure(); - if (t++ > 1e3) { + if (e++ > 1e3) { var r, i; - Au(); + $u(); } - n.process(Ke), bn.clear(); + n.process(Ut), bn.clear(); } } finally { - Ke = [], fs = !1, Hi = null; + Ut = [], fs = !1, Hi = null; } } -function Au() { +function $u() { try { - hu(); - } catch (e) { - dr(e, Hi); + cu(); + } catch (t) { + dr(t, Hi); } } -let mt = null; -function fa(e) { - var t = e.length; - if (t !== 0) { - for (var n = 0; n < t; ) { - var r = e[n++]; - if ((r.f & (ln | rt)) === 0 && Gr(r) && (mt = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (mt == null ? void 0 : mt.size) > 0)) { +let we = null; +function fa(t) { + var e = t.length; + if (e !== 0) { + for (var n = 0; n < e; ) { + var r = t[n++]; + if ((r.f & (ln | ee)) === 0 && Ur(r) && (we = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (we == null ? void 0 : we.size) > 0)) { bn.clear(); - for (const i of mt) { - if ((i.f & (ln | rt)) !== 0) continue; + for (const i of we) { + if ((i.f & (ln | ee)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - mt.has(a) && (mt.delete(a), s.push(a)), a = a.parent; + we.has(a) && (we.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (ln | rt)) === 0 && vr(l); + (l.f & (ln | ee)) === 0 && vr(l); } } - mt.clear(); + we.clear(); } } - mt = null; + we = null; } } -function fo(e, t, n, r) { - if (!n.has(e) && (n.add(e), e.reactions !== null)) - for (const i of e.reactions) { +function fo(t, e, n, r) { + if (!n.has(t) && (n.add(t), t.reactions !== null)) + for (const i of t.reactions) { const s = i.f; - (s & Ne) !== 0 ? fo( + (s & Rt) !== 0 ? fo( /** @type {Derived} */ i, - t, + e, n, r - ) : (s & (Ms | hn)) !== 0 && (s & ke) === 0 && co(i, t, r) && (de(i, ke), xt( + ) : (s & (Ms | hn)) !== 0 && (s & St) === 0 && co(i, e, r) && (dt(i, St), $e( /** @type {Effect} */ i )); } } -function co(e, t, n) { - const r = n.get(e); +function co(t, e, n) { + const r = n.get(t); if (r !== void 0) return r; - if (e.deps !== null) - for (const i of e.deps) { - if (fr.call(t, i)) + if (t.deps !== null) + for (const i of t.deps) { + if (fr.call(e, i)) return !0; - if ((i.f & Ne) !== 0 && co( + if ((i.f & Rt) !== 0 && co( /** @type {Derived} */ i, - t, + e, n )) return n.set( @@ -591,72 +591,72 @@ function co(e, t, n) { !0 ), !0; } - return n.set(e, !1), !1; + return n.set(t, !1), !1; } -function xt(e) { - for (var t = Hi = e; t.parent !== null; ) { - t = t.parent; - var n = t.f; - if (fs && t === J && (n & hn) !== 0 && (n & Za) === 0) +function $e(t) { + for (var e = Hi = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (fs && e === j && (n & hn) !== 0 && (n & Za) === 0) return; - if ((n & (En | At)) !== 0) { - if ((n & Ae) === 0) return; - t.f ^= Ae; + if ((n & (En | Te)) !== 0) { + if ((n & $t) === 0) return; + e.f ^= $t; } } - Ke.push(t); + Ut.push(e); } -function ho(e, t) { - if (!((e.f & At) !== 0 && (e.f & Ae) !== 0)) { - (e.f & ke) !== 0 ? t.d.push(e) : (e.f & $t) !== 0 && t.m.push(e), de(e, Ae); - for (var n = e.first; n !== null; ) - ho(n, t), n = n.next; +function ho(t, e) { + if (!((t.f & Te) !== 0 && (t.f & $t) !== 0)) { + (t.f & St) !== 0 ? e.d.push(t) : (t.f & Ee) !== 0 && e.m.push(t), dt(t, $t); + for (var n = t.first; n !== null; ) + ho(n, e), n = n.next; } } -function Eu(e) { - let t = 0, n = Un(0), r; +function Au(t) { + let e = 0, n = Un(0), r; return () => { - Fs() && (x(n), Ls(() => (t === 0 && (r = Xi(() => e(() => Or(n)))), t += 1, () => { + Is() && (x(n), Ls(() => (e === 0 && (r = Xi(() => t(() => Dr(n)))), e += 1, () => { xn(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); + e -= 1, e === 0 && (r == null || r(), r = void 0, Dr(n)); }); }))); }; } -var Tu = cr | jn | Ja; -function Cu(e, t, n) { - new Ru(e, t, n); +var Eu = cr | jn | Ja; +function Tu(t, e, n) { + new Cu(t, e, n); } -var tt, Br, Pt, Ln, Dt, ct, Ue, Ot, tn, yn, qn, nn, ar, Vn, or, lr, rn, Pi, ge, po, vo, ds, fi, ci, ps; -class Ru { +var Qt, Yr, De, Ln, Oe, ue, Xt, Ie, en, yn, qn, nn, ar, Vn, or, lr, rn, Pi, gt, po, vo, ds, fi, ci, ps; +class Cu { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(t, n, r) { - H(this, ge); + constructor(e, n, r) { + H(this, gt); /** @type {Boundary | null} */ - ce(this, "parent"); - ce(this, "is_pending", !1); + ct(this, "parent"); + ct(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, tt); + H(this, Qt); /** @type {TemplateNode | null} */ - H(this, Br, j ? X : null); + H(this, Yr, K ? X : null); /** @type {BoundaryProps} */ - H(this, Pt); + H(this, De); /** @type {((anchor: Node) => void)} */ H(this, Ln); /** @type {Effect} */ - H(this, Dt); + H(this, Oe); /** @type {Effect | null} */ - H(this, ct, null); + H(this, ue, null); /** @type {Effect | null} */ - H(this, Ue, null); + H(this, Xt, null); /** @type {Effect | null} */ - H(this, Ot, null); + H(this, Ie, null); /** @type {DocumentFragment | null} */ - H(this, tn, null); + H(this, en, null); /** @type {TemplateNode | null} */ H(this, yn, null); H(this, qn, 0); @@ -675,37 +675,37 @@ class Ru { * @type {Source | null} */ H(this, rn, null); - H(this, Pi, Eu(() => (V(this, rn, Un(v(this, qn))), () => { + H(this, Pi, Au(() => (V(this, rn, Un(v(this, qn))), () => { V(this, rn, null); }))); - V(this, tt, t), V(this, Pt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Pt).pending, V(this, Dt, qs(() => { - if (J.b = this, j) { - const s = v(this, Br); + V(this, Qt, e), V(this, De, n), V(this, Ln, r), this.parent = /** @type {Effect} */ + j.b, this.is_pending = !!v(this, De).pending, V(this, Oe, qs(() => { + if (j.b = this, K) { + const s = v(this, Yr); qi(), /** @type {Comment} */ s.nodeType === yr && /** @type {Comment} */ - s.data === Oi ? be(this, ge, vo).call(this) : (be(this, ge, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); + s.data === Oi ? xt(this, gt, vo).call(this) : (xt(this, gt, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); } else { - var i = be(this, ge, ds).call(this); + var i = xt(this, gt, ds).call(this); try { - V(this, ct, dt(() => r(i))); + V(this, ue, ce(() => r(i))); } catch (s) { this.error(s); } - v(this, nn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; + v(this, nn) > 0 ? xt(this, gt, ci).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, yn)) == null || s.remove(); }; - }, Tu)), j && V(this, tt, X); + }, Eu)), K && V(this, Qt, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(t) { - oo(t, v(this, or), v(this, lr)); + defer_effect(e) { + oo(e, v(this, or), v(this, lr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Ru { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Pt).pending; + return !!v(this, De).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,8 +723,8 @@ class Ru { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(t) { - be(this, ge, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, rn) || v(this, ar)) && (V(this, ar, !0), xn(() => { + update_pending_count(e) { + xt(this, gt, ps).call(this, e), V(this, qn, v(this, qn) + e), !(!v(this, rn) || v(this, ar)) && (V(this, ar, !0), xn(() => { V(this, ar, !1), v(this, rn) && pr(v(this, rn), v(this, qn)); })); } @@ -735,38 +735,38 @@ class Ru { ); } /** @param {unknown} error */ - error(t) { - var n = v(this, Pt).onerror; - let r = v(this, Pt).failed; + error(e) { + var n = v(this, De).onerror; + let r = v(this, De).failed; if (v(this, Vn) || !n && !r) - throw t; - v(this, ct) && (Ve(v(this, ct)), V(this, ct, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Ot) && (Ve(v(this, Ot)), V(this, Ot, null)), j && (qe( + throw e; + v(this, ue) && (qt(v(this, ue)), V(this, ue, null)), v(this, Xt) && (qt(v(this, Xt)), V(this, Xt, null)), v(this, Ie) && (qt(v(this, Ie)), V(this, Ie, null)), K && (Lt( /** @type {TemplateNode} */ - v(this, Br) - ), us(), qe(Ai())); + v(this, Yr) + ), us(), Lt(Ai())); var i = !1, s = !1; const a = () => { if (i) { - yu(); + mu(); return; } - i = !0, s && mu(), un.ensure(), V(this, qn, 0), v(this, Ot) !== null && Yn(v(this, Ot), () => { - V(this, Ot, null); - }), this.is_pending = this.has_pending_snippet(), V(this, ct, be(this, ge, fi).call(this, () => (V(this, Vn, !1), dt(() => v(this, Ln).call(this, v(this, tt)))))), v(this, nn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; + i = !0, s && _u(), un.ensure(), V(this, qn, 0), v(this, Ie) !== null && Yn(v(this, Ie), () => { + V(this, Ie, null); + }), this.is_pending = this.has_pending_snippet(), V(this, ue, xt(this, gt, fi).call(this, () => (V(this, Vn, !1), ce(() => v(this, Ln).call(this, v(this, Qt)))))), v(this, nn) > 0 ? xt(this, gt, ci).call(this) : this.is_pending = !1; }; xn(() => { try { - s = !0, n == null || n(t, a), s = !1; + s = !0, n == null || n(e, a), s = !1; } catch (o) { - dr(o, v(this, Dt) && v(this, Dt).parent); + dr(o, v(this, Oe) && v(this, Oe).parent); } - r && V(this, Ot, be(this, ge, fi).call(this, () => { + r && V(this, Ie, xt(this, gt, fi).call(this, () => { un.ensure(), V(this, Vn, !0); try { - return dt(() => { + return ce(() => { r( - v(this, tt), - () => t, + v(this, Qt), + () => e, () => a ); }); @@ -774,7 +774,7 @@ class Ru { return dr( o, /** @type {Effect} */ - v(this, Dt).parent + v(this, Oe).parent ), null; } finally { V(this, Vn, !1); @@ -783,140 +783,140 @@ class Ru { }); } } -tt = new WeakMap(), Br = new WeakMap(), Pt = new WeakMap(), Ln = new WeakMap(), Dt = new WeakMap(), ct = new WeakMap(), Ue = new WeakMap(), Ot = new WeakMap(), tn = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), rn = new WeakMap(), Pi = new WeakMap(), ge = new WeakSet(), po = function() { +Qt = new WeakMap(), Yr = new WeakMap(), De = new WeakMap(), Ln = new WeakMap(), Oe = new WeakMap(), ue = new WeakMap(), Xt = new WeakMap(), Ie = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), rn = new WeakMap(), Pi = new WeakMap(), gt = new WeakSet(), po = function() { try { - V(this, ct, dt(() => v(this, Ln).call(this, v(this, tt)))); - } catch (t) { - this.error(t); + V(this, ue, ce(() => v(this, Ln).call(this, v(this, Qt)))); + } catch (e) { + this.error(e); } }, vo = function() { - const t = v(this, Pt).pending; - t && (V(this, Ue, dt(() => t(v(this, tt)))), xn(() => { - var n = be(this, ge, ds).call(this); - V(this, ct, be(this, ge, fi).call(this, () => (un.ensure(), dt(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? be(this, ge, ci).call(this) : (Yn( + const e = v(this, De).pending; + e && (V(this, Xt, ce(() => e(v(this, Qt)))), xn(() => { + var n = xt(this, gt, ds).call(this); + V(this, ue, xt(this, gt, fi).call(this, () => (un.ensure(), ce(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? xt(this, gt, ci).call(this) : (Yn( /** @type {Effect} */ - v(this, Ue), + v(this, Xt), () => { - V(this, Ue, null); + V(this, Xt, null); } ), this.is_pending = !1); })); }, ds = function() { - var t = v(this, tt); - return this.is_pending && (V(this, yn, it()), v(this, tt).before(v(this, yn)), t = v(this, yn)), t; + var e = v(this, Qt); + return this.is_pending && (V(this, yn, ne()), v(this, Qt).before(v(this, yn)), e = v(this, yn)), e; }, /** * @param {() => Effect | null} fn */ -fi = function(t) { - var n = J, r = B, i = st; - qt(v(this, Dt)), gt(v(this, Dt)), hr(v(this, Dt).ctx); +fi = function(e) { + var n = j, r = B, i = re; + Ve(v(this, Oe)), pe(v(this, Oe)), hr(v(this, Oe).ctx); try { - return t(); + return e(); } catch (s) { return so(s), null; } finally { - qt(n), gt(r), hr(i); + Ve(n), pe(r), hr(i); } }, ci = function() { - const t = ( + const e = ( /** @type {(anchor: Node) => void} */ - v(this, Pt).pending + v(this, De).pending ); - v(this, ct) !== null && (V(this, tn, document.createDocumentFragment()), v(this, tn).append( + v(this, ue) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ v(this, yn) - ), Do(v(this, ct), v(this, tn))), v(this, Ue) === null && V(this, Ue, dt(() => t(v(this, tt)))); + ), Do(v(this, ue), v(this, en))), v(this, Xt) === null && V(this, Xt, ce(() => e(v(this, Qt)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ -ps = function(t) { +ps = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && be(n = this.parent, ge, ps).call(n, t); + this.parent && xt(n = this.parent, gt, ps).call(n, e); return; } - if (V(this, nn, v(this, nn) + t), v(this, nn) === 0) { + if (V(this, nn, v(this, nn) + e), v(this, nn) === 0) { this.is_pending = !1; for (const r of v(this, or)) - de(r, ke), xt(r); + dt(r, St), $e(r); for (const r of v(this, lr)) - de(r, $t), xt(r); - v(this, or).clear(), v(this, lr).clear(), v(this, Ue) && Yn(v(this, Ue), () => { - V(this, Ue, null); - }), v(this, tn) && (v(this, tt).before(v(this, tn)), V(this, tn, null)); + dt(r, Ee), $e(r); + v(this, or).clear(), v(this, lr).clear(), v(this, Xt) && Yn(v(this, Xt), () => { + V(this, Xt, null); + }), v(this, en) && (v(this, Qt).before(v(this, en)), V(this, en, null)); } }; -function Su(e, t, n, r) { +function Ru(t, e, n, r) { const i = Yi; - var s = e.filter((c) => !c.settled); + var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(t.map(i)); + r(e.map(i)); return; } - var a = K, o = ( + var a = G, o = ( /** @type {Effect} */ - J - ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + j + ), l = Su(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); - } catch (d) { - (o.f & ln) === 0 && dr(d, o); + } catch (p) { + (o.f & ln) === 0 && dr(p, o); } a == null || a.deactivate(), vs(); } if (n.length === 0) { - u.then(() => f(t.map(i))); + u.then(() => f(e.map(i))); return; } - function p() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => dr(c, o)); + function d() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ Nu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => dr(c, o)); } - u ? u.then(p) : p(); + u ? u.then(d) : d(); } -function Nu() { - var e = J, t = B, n = st, r = K; +function Su() { + var t = j, e = B, n = re, r = G; return function(s = !0) { - qt(e), gt(t), hr(n), s && (r == null || r.activate()); + Ve(t), pe(e), hr(n), s && (r == null || r.activate()); }; } function vs() { - qt(null), gt(null), hr(null); + Ve(null), pe(null), hr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(e) { - var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( +function Yi(t) { + var e = Rt | St, n = B !== null && (B.f & Rt) !== 0 ? ( /** @type {Derived} */ B ) : null; - return J !== null && (J.f |= jn), { - ctx: st, + return j !== null && (j.f |= jn), { + ctx: re, deps: null, effects: null, - equals: to, - f: t, - fn: e, + equals: eo, + f: e, + fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - Re + Tt ), wv: 0, - parent: n ?? J, + parent: n ?? j, ac: null }; } // @__NO_SIDE_EFFECTS__ -function ku(e, t, n) { +function Nu(t, e, n) { let r = ( /** @type {Effect | null} */ - J + j ); - r === null && ou(); + r === null && au(); var i = ( /** @type {Boundary} */ r.b @@ -926,26 +926,26 @@ function ku(e, t, n) { void 0 ), a = Un( /** @type {V} */ - Re + Tt ), o = !B, l = /* @__PURE__ */ new Map(); - return zu(() => { - var d; + return Vu(() => { + var p; var u = Ka(); s = u.promise; try { - Promise.resolve(e()).then(u.resolve, u.reject).then(() => { - f === K && f.committed && f.deactivate(), vs(); + Promise.resolve(t()).then(u.resolve, u.reject).then(() => { + f === G && f.committed && f.deactivate(), vs(); }); } catch (y) { u.reject(y), vs(); } var f = ( /** @type {Batch} */ - K + G ); if (o) { - var p = i.is_rendered(); - i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(kn), l.delete(f), l.set(f, u); + var d = i.is_rendered(); + i.update_pending_count(1), f.increment(d), (p = l.get(f)) == null || p.reject(kn), l.delete(f), l.set(f, u); } const c = (y, b = void 0) => { if (f.activate(), b) @@ -957,211 +957,211 @@ function ku(e, t, n) { $.reject(kn); } } - o && (i.update_pending_count(-1), f.decrement(p)); + o && (i.update_pending_count(-1), f.decrement(d)); }; u.promise.then(c, (y) => c(null, y || "unknown")); - }), Lu(() => { + }), Fu(() => { for (const u of l.values()) u.reject(kn); }), new Promise((u) => { - function f(p) { + function f(d) { function c() { - p === s ? u(a) : f(s); + d === s ? u(a) : f(s); } - p.then(c, c); + d.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function vn(e) { - const t = /* @__PURE__ */ Yi(e); - return Oo(t), t; +function vn(t) { + const e = /* @__PURE__ */ Yi(t); + return Oo(e), e; } // @__NO_SIDE_EFFECTS__ -function go(e) { - const t = /* @__PURE__ */ Yi(e); - return t.equals = no, t; -} -function Mu(e) { - var t = e.effects; - if (t !== null) { - e.effects = null; - for (var n = 0; n < t.length; n += 1) - Ve( +function go(t) { + const e = /* @__PURE__ */ Yi(t); + return e.equals = no, e; +} +function ku(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + qt( /** @type {Effect} */ - t[n] + e[n] ); } } -function Pu(e) { - for (var t = e.parent; t !== null; ) { - if ((t.f & Ne) === 0) - return (t.f & ln) === 0 ? ( +function Mu(t) { + for (var e = t.parent; e !== null; ) { + if ((e.f & Rt) === 0) + return (e.f & ln) === 0 ? ( /** @type {Effect} */ - t + e ) : null; - t = t.parent; + e = e.parent; } return null; } -function Ds(e) { - var t, n = J; - qt(Pu(e)); +function Ds(t) { + var e, n = j; + Ve(Mu(t)); try { - e.f &= ~Wn, Mu(e), t = qo(e); + t.f &= ~Wn, ku(t), e = qo(t); } finally { - qt(n); + Ve(n); } - return t; + return e; } -function _o(e) { - var t = Ds(e); - if (!e.equals(t) && (e.wv = Io(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - de(e, Ae); +function _o(t) { + var e = Ds(t); + if (!t.equals(e) && (t.wv = Fo(), (!(G != null && G.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + dt(t, $t); return; } - An || (Se !== null ? (Fs() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); + An || (Ct !== null ? (Is() || G != null && G.is_fork) && Ct.set(t, e) : Ps(t)); } -function Du(e) { - var t, n; - if (e.effects !== null) - for (const r of e.effects) - (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = eu, r.ac = null, Ir(r, 0), Vs(r)); +function Pu(t) { + var e, n; + if (t.effects !== null) + for (const r of t.effects) + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = Ql, r.ac = null, Ir(r, 0), Vs(r)); } -function mo(e) { - if (e.effects !== null) - for (const t of e.effects) - t.teardown && vr(t); +function mo(t) { + if (t.effects !== null) + for (const e of t.effects) + e.teardown && vr(e); } let gs = /* @__PURE__ */ new Set(); const bn = /* @__PURE__ */ new Map(); let yo = !1; -function Un(e, t) { +function Un(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: e, + v: t, reactions: null, - equals: to, + equals: eo, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function $e(e, t) { - const n = Un(e); +function bt(t, e) { + const n = Un(t); return Oo(n), n; } // @__NO_SIDE_EFFECTS__ -function wo(e, t = !1, n = !0) { - const r = Un(e); - return t || (r.equals = no), r; +function wo(t, e = !1, n = !0) { + const r = Un(t); + return e || (r.equals = no), r; } -function he(e, t, n = !1) { +function ht(t, e, n = !1) { B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!bt || (B.f & ua) !== 0) && ro() && (B.f & (Ne | hn | Ms | ua)) !== 0 && (vt === null || !fr.call(vt, e)) && _u(); - let r = n ? Pn(t) : t; - return pr(e, r); -} -function pr(e, t) { - if (!e.equals(t)) { - var n = e.v; - An ? bn.set(e, t) : bn.set(e, n), e.v = t; + (!Ae || (B.f & ua) !== 0) && ro() && (B.f & (Rt | hn | Ms | ua)) !== 0 && (de === null || !fr.call(de, t)) && gu(); + let r = n ? Pn(e) : e; + return pr(t, r); +} +function pr(t, e) { + if (!t.equals(e)) { + var n = t.v; + An ? bn.set(t, e) : bn.set(t, n), t.v = e; var r = un.ensure(); - if (r.capture(e, n), (e.f & Ne) !== 0) { + if (r.capture(t, n), (t.f & Rt) !== 0) { const i = ( /** @type {Derived} */ - e + t ); - (e.f & ke) !== 0 && Ds(i), Ps(i); + (t.f & St) !== 0 && Ds(i), Ps(i); } - e.wv = Io(), xo(e, ke), J !== null && (J.f & Ae) !== 0 && (J.f & (At | En)) === 0 && (ft === null ? Bu([e]) : ft.push(e)), !r.is_fork && gs.size > 0 && !yo && Ou(); + t.wv = Fo(), xo(t, St), j !== null && (j.f & $t) !== 0 && (j.f & (Te | En)) === 0 && (le === null ? Yu([t]) : le.push(t)), !r.is_fork && gs.size > 0 && !yo && Du(); } - return t; + return e; } -function Ou() { +function Du() { yo = !1; - for (const e of gs) - (e.f & Ae) !== 0 && de(e, $t), Gr(e) && vr(e); + for (const t of gs) + (t.f & $t) !== 0 && dt(t, Ee), Ur(t) && vr(t); gs.clear(); } -function Or(e) { - he(e, e.v + 1); +function Dr(t) { + ht(t, t.v + 1); } -function xo(e, t) { - var n = e.reactions; +function xo(t, e) { + var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & ke) === 0; - if (o && de(s, t), (a & Ne) !== 0) { + var s = n[i], a = s.f, o = (a & St) === 0; + if (o && dt(s, e), (a & Rt) !== 0) { var l = ( /** @type {Derived} */ s ); - Se == null || Se.delete(l), (a & Wn) === 0 && (a & pt && (s.f |= Wn), xo(l, $t)); - } else o && ((a & hn) !== 0 && mt !== null && mt.add( + Ct == null || Ct.delete(l), (a & Wn) === 0 && (a & he && (s.f |= Wn), xo(l, Ee)); + } else o && ((a & hn) !== 0 && we !== null && we.add( /** @type {Effect} */ s - ), xt( + ), $e( /** @type {Effect} */ s )); } } -function Pn(e) { - if (typeof e != "object" || e === null || Pr in e) - return e; - const t = Ga(e); - if (t !== Zl && t !== Ql) - return e; - var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { +function Pn(t) { + if (typeof t != "object" || t === null || Mr in t) + return t; + const e = Ga(t); + if (e !== Jl && e !== Zl) + return t; + var n = /* @__PURE__ */ new Map(), r = Ua(t), i = /* @__PURE__ */ bt(0), s = Bn, a = (o) => { if (Bn === s) return o(); var l = B, u = Bn; - gt(null), da(s); + pe(null), da(s); var f = o(); - return gt(l), da(u), f; + return pe(l), da(u), f; }; - return r && n.set("length", /* @__PURE__ */ $e( + return r && n.set("length", /* @__PURE__ */ bt( /** @type {any[]} */ - e.length + t.length )), new Proxy( /** @type {any} */ - e, + t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && pu(); var f = n.get(l); return f === void 0 ? a(() => { - var p = /* @__PURE__ */ $e(u.value); - return n.set(l, p), p; - }) : he(f, u.value, !0), !0; + var d = /* @__PURE__ */ bt(u.value); + return n.set(l, d), d; + }) : ht(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ $e(Re)); - n.set(l, f), Or(i); + const f = a(() => /* @__PURE__ */ bt(Tt)); + n.set(l, f), Dr(i); } } else - he(u, Re), Or(i); + ht(u, Tt), Dr(i); return !0; }, get(o, l, u) { - var d; - if (l === Pr) - return e; - var f = n.get(l), p = l in o; - if (f === void 0 && (!p || (d = Hn(o, l)) != null && d.writable) && (f = a(() => { - var y = Pn(p ? o[l] : Re), b = /* @__PURE__ */ $e(y); + var p; + if (l === Mr) + return t; + var f = n.get(l), d = l in o; + if (f === void 0 && (!d || (p = Hn(o, l)) != null && p.writable) && (f = a(() => { + var y = Pn(d ? o[l] : Tt), b = /* @__PURE__ */ bt(y); return b; }), n.set(l, f)), f !== void 0) { var c = x(f); - return c === Re ? void 0 : c; + return c === Tt ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1171,8 +1171,8 @@ function Pn(e) { var f = n.get(l); f && (u.value = x(f)); } else if (u === void 0) { - var p = n.get(l), c = p == null ? void 0 : p.v; - if (p !== void 0 && c !== Re) + var d = n.get(l), c = d == null ? void 0 : d.v; + if (d !== void 0 && c !== Tt) return { enumerable: !0, configurable: !0, @@ -1184,35 +1184,35 @@ function Pn(e) { }, has(o, l) { var c; - if (l === Pr) + if (l === Mr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); - if (u !== void 0 || J !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Tt || Reflect.has(o, l); + if (u !== void 0 || j !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var d = f ? Pn(o[l]) : Re, y = /* @__PURE__ */ $e(d); + var p = f ? Pn(o[l]) : Tt, y = /* @__PURE__ */ bt(p); return y; }), n.set(l, u)); - var p = x(u); - if (p === Re) + var d = x(u); + if (d === Tt) return !1; } return f; }, set(o, l, u, f) { var M; - var p = n.get(l), c = l in o; + var d = n.get(l), c = l in o; if (r && l === "length") - for (var d = u; d < /** @type {Source} */ - p.v; d += 1) { - var y = n.get(d + ""); - y !== void 0 ? he(y, Re) : d in o && (y = a(() => /* @__PURE__ */ $e(Re)), n.set(d + "", y)); + for (var p = u; p < /** @type {Source} */ + d.v; p += 1) { + var y = n.get(p + ""); + y !== void 0 ? ht(y, Tt) : p in o && (y = a(() => /* @__PURE__ */ bt(Tt)), n.set(p + "", y)); } - if (p === void 0) - (!c || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); + if (d === void 0) + (!c || (M = Hn(o, l)) != null && M.writable) && (d = a(() => /* @__PURE__ */ bt(void 0)), ht(d, Pn(u)), n.set(l, d)); else { - c = p.v !== Re; + c = d.v !== Tt; var b = a(() => Pn(u)); - he(p, b); + ht(d, b); } var m = Reflect.getOwnPropertyDescriptor(o, l); if (m != null && m.set && m.set.call(f, u), !c) { @@ -1221,24 +1221,24 @@ function Pn(e) { /** @type {Source} */ n.get("length") ), D = Number(l); - Number.isInteger(D) && D >= $.v && he($, D + 1); + Number.isInteger(D) && D >= $.v && ht($, D + 1); } - Or(i); + Dr(i); } return !0; }, ownKeys(o) { x(i); - var l = Reflect.ownKeys(o).filter((p) => { - var c = n.get(p); - return c === void 0 || c.v !== Re; + var l = Reflect.ownKeys(o).filter((d) => { + var c = n.get(d); + return c === void 0 || c.v !== Tt; }); for (var [u, f] of n) - f.v !== Re && !(u in o) && l.push(u); + f.v !== Tt && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - gu(); + vu(); } } ); @@ -1247,51 +1247,51 @@ var ca, bo, $o, Ao; function _s() { if (ca === void 0) { ca = window, bo = /Firefox/.test(navigator.userAgent); - var e = Element.prototype, t = Node.prototype, n = Text.prototype; - $o = Hn(t, "firstChild").get, Ao = Hn(t, "nextSibling").get, la(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), la(n) && (n.__t = void 0); + var t = Element.prototype, e = Node.prototype, n = Text.prototype; + $o = Hn(e, "firstChild").get, Ao = Hn(e, "nextSibling").get, la(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), la(n) && (n.__t = void 0); } } -function it(e = "") { - return document.createTextNode(e); +function ne(t = "") { + return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function fn(e) { +function fn(t) { return ( /** @type {TemplateNode | null} */ - $o.call(e) + $o.call(t) ); } // @__NO_SIDE_EFFECTS__ -function zt(e) { +function He(t) { return ( /** @type {TemplateNode | null} */ - Ao.call(e) + Ao.call(t) ); } -function We(e, t) { - if (!j) - return /* @__PURE__ */ fn(e); +function Bt(t, e) { + if (!K) + return /* @__PURE__ */ fn(t); var n = /* @__PURE__ */ fn(X); if (n === null) - n = X.appendChild(it()); - else if (t && n.nodeType !== Ur) { - var r = it(); - return n == null || n.before(r), qe(r), r; + n = X.appendChild(ne()); + else if (e && n.nodeType !== Wr) { + var r = ne(); + return n == null || n.before(r), Lt(r), r; } - return t && Bi( + return e && Bi( /** @type {Text} */ n - ), qe(n), n; + ), Lt(n), n; } -function _n(e, t = !1) { - if (!j) { - var n = /* @__PURE__ */ fn(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ zt(n) : n; +function _n(t, e = !1) { + if (!K) { + var n = /* @__PURE__ */ fn(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ He(n) : n; } - if (t) { - if ((X == null ? void 0 : X.nodeType) !== Ur) { - var r = it(); - return X == null || X.before(r), qe(r), r; + if (e) { + if ((X == null ? void 0 : X.nodeType) !== Wr) { + var r = ne(); + return X == null || X.before(r), Lt(r), r; } Bi( /** @type {Text} */ @@ -1300,74 +1300,74 @@ function _n(e, t = !1) { } return X; } -function Qe(e, t = 1, n = !1) { - let r = j ? X : e; - for (var i; t--; ) +function Jt(t, e = 1, n = !1) { + let r = K ? X : t; + for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ zt(r); - if (!j) + /* @__PURE__ */ He(r); + if (!K) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = it(); - return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; + if ((r == null ? void 0 : r.nodeType) !== Wr) { + var s = ne(); + return r === null ? i == null || i.after(s) : r.before(s), Lt(s), s; } Bi( /** @type {Text} */ r ); } - return qe(r), r; + return Lt(r), r; } -function Eo(e) { - e.textContent = ""; +function Eo(t) { + t.textContent = ""; } function To() { return !1; } -function Os(e, t, n) { +function Os(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Wa, e, void 0) + document.createElementNS(Wa, t, void 0) ); } -function Bi(e) { +function Bi(t) { if ( /** @type {string} */ - e.nodeValue.length < 65536 + t.nodeValue.length < 65536 ) return; - let t = e.nextSibling; - for (; t !== null && t.nodeType === Ur; ) - t.remove(), e.nodeValue += /** @type {string} */ - t.nodeValue, t = e.nextSibling; -} -function Co(e) { - var t = B, n = J; - gt(null), qt(null); + let e = t.nextSibling; + for (; e !== null && e.nodeType === Wr; ) + e.remove(), t.nodeValue += /** @type {string} */ + e.nodeValue, e = t.nextSibling; +} +function Co(t) { + var e = B, n = j; + pe(null), Ve(null); try { - return e(); + return t(); } finally { - gt(t), qt(n); + pe(e), Ve(n); } } -function Fu(e) { - J === null && (B === null && cu(), fu()), An && uu(); +function Ou(t) { + j === null && (B === null && fu(), uu()), An && lu(); } -function Iu(e, t) { - var n = t.last; - n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); +function Iu(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Ht(e, t, n) { - var r = J; - r !== null && (r.f & rt) !== 0 && (e |= rt); +function Ye(t, e, n) { + var r = j; + r !== null && (r.f & ee) !== 0 && (t |= ee); var i = { - ctx: st, + ctx: re, deps: null, nodes: null, - f: e | ke | pt, + f: t | St | he, first: null, - fn: t, + fn: e, last: null, next: null, parent: r, @@ -1381,12 +1381,12 @@ function Ht(e, t, n) { try { vr(i); } catch (o) { - throw Ve(i), o; + throw qt(i), o; } - else t !== null && xt(i); + else e !== null && $e(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & jn) === 0 && (s = s.first, (e & hn) !== 0 && (e & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Iu(s, r), B !== null && (B.f & Ne) !== 0 && (e & En) === 0)) { + (s.f & jn) === 0 && (s = s.first, (t & hn) !== 0 && (t & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Iu(s, r), B !== null && (B.f & Rt) !== 0 && (t & En) === 0)) { var a = ( /** @type {Derived} */ B @@ -1395,127 +1395,127 @@ function Ht(e, t, n) { } return i; } -function Fs() { - return B !== null && !bt; +function Is() { + return B !== null && !Ae; } -function Lu(e) { - const t = Ht(Ii, null, !1); - return de(t, Ae), t.teardown = e, t; +function Fu(t) { + const e = Ye(Fi, null, !1); + return dt(e, $t), e.teardown = t, e; } -function Is(e) { - Fu(); - var t = ( +function Fs(t) { + Ou(); + var e = ( /** @type {Effect} */ - J.f - ), n = !B && (t & At) !== 0 && (t & mr) === 0; + j.f + ), n = !B && (e & Te) !== 0 && (e & mr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - st + re ); - (r.e ?? (r.e = [])).push(e); + (r.e ?? (r.e = [])).push(t); } else - return Ro(e); + return Ro(t); } -function Ro(e) { - return Ht(Fr | ru, e, !1); +function Ro(t) { + return Ye(Or | nu, t, !1); } -function qu(e) { +function Lu(t) { un.ensure(); - const t = Ht(En | jn, e, !0); + const e = Ye(En | jn, t, !0); return () => { - Ve(t); + qt(e); }; } -function Vu(e) { +function qu(t) { un.ensure(); - const t = Ht(En | jn, e, !0); + const e = Ye(En | jn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Yn(t, () => { - Ve(t), r(void 0); - }) : (Ve(t), r(void 0)); + n.outro ? Yn(e, () => { + qt(e), r(void 0); + }) : (qt(e), r(void 0)); }); } -function So(e) { - return Ht(Fr, e, !1); +function So(t) { + return Ye(Or, t, !1); } -function zu(e) { - return Ht(Ms | jn, e, !0); +function Vu(t) { + return Ye(Ms | jn, t, !0); } -function Ls(e, t = 0) { - return Ht(Ii | t, e, !0); +function Ls(t, e = 0) { + return Ye(Fi | e, t, !0); } -function Qt(e, t = [], n = [], r = []) { - Su(r, t, n, (i) => { - Ht(Ii, () => e(...i.map(x)), !0); +function Qe(t, e = [], n = [], r = []) { + Ru(r, e, n, (i) => { + Ye(Fi, () => t(...i.map(x)), !0); }); } -function qs(e, t = 0) { - var n = Ht(hn | t, e, !0); +function qs(t, e = 0) { + var n = Ye(hn | e, t, !0); return n; } -function dt(e) { - return Ht(At | jn, e, !0); +function ce(t) { + return Ye(Te | jn, t, !0); } -function No(e) { - var t = e.teardown; - if (t !== null) { +function No(t) { + var e = t.teardown; + if (e !== null) { const n = An, r = B; - ha(!0), gt(null); + ha(!0), pe(null); try { - t.call(null); + e.call(null); } finally { - ha(n), gt(r); + ha(n), pe(r); } } } -function Vs(e, t = !1) { - var n = e.first; - for (e.first = e.last = null; n !== null; ) { +function Vs(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { const i = n.ac; i !== null && Co(() => { i.abort(kn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : Ve(n, t), n = r; + (n.f & En) !== 0 ? n.parent = null : qt(n, e), n = r; } } -function Hu(e) { - for (var t = e.first; t !== null; ) { - var n = t.next; - (t.f & At) === 0 && Ve(t), t = n; +function zu(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + (e.f & Te) === 0 && qt(e), e = n; } } -function Ve(e, t = !0) { +function qt(t, e = !0) { var n = !1; - (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( - e.nodes.start, + (e || (t.f & Za) !== 0) && t.nodes !== null && t.nodes.end !== null && (Hu( + t.nodes.start, /** @type {TemplateNode} */ - e.nodes.end - ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, ln); - var r = e.nodes && e.nodes.t; + t.nodes.end + ), n = !0), Vs(t, e && !n), Ir(t, 0), dt(t, ln); + var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - No(e); - var i = e.parent; - i !== null && i.first !== null && ko(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + No(t); + var i = t.parent; + i !== null && i.first !== null && ko(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function Yu(e, t) { - for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ zt(e); - e.remove(), e = n; +function Hu(t, e) { + for (; t !== null; ) { + var n = t === e ? null : /* @__PURE__ */ He(t); + t.remove(), t = n; } } -function ko(e) { - var t = e.parent, n = e.prev, r = e.next; - n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); +function ko(t) { + var e = t.parent, n = t.prev, r = t.next; + n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Yn(e, t, n = !0) { +function Yn(t, e, n = !0) { var r = []; - Mo(e, r, !0); + Mo(t, r, !0); var i = () => { - n && Ve(e), t && t(); + n && qt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,315 +1524,315 @@ function Yn(e, t, n = !0) { } else i(); } -function Mo(e, t, n) { - if ((e.f & rt) === 0) { - e.f ^= rt; - var r = e.nodes && e.nodes.t; +function Mo(t, e, n) { + if ((t.f & ee) === 0) { + t.f ^= ee; + var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && t.push(o); - for (var i = e.first; i !== null; ) { + (o.is_global || n) && e.push(o); + for (var i = t.first; i !== null; ) { var s = i.next, a = (i.f & cr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & At) !== 0 && (e.f & hn) !== 0; - Mo(i, t, a ? n : !1), i = s; + (i.f & Te) !== 0 && (t.f & hn) !== 0; + Mo(i, e, a ? n : !1), i = s; } } } -function zs(e) { - Po(e, !0); +function zs(t) { + Po(t, !0); } -function Po(e, t) { - if ((e.f & rt) !== 0) { - e.f ^= rt, (e.f & Ae) === 0 && (de(e, ke), xt(e)); - for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & cr) !== 0 || (n.f & At) !== 0; - Po(n, i ? t : !1), n = r; +function Po(t, e) { + if ((t.f & ee) !== 0) { + t.f ^= ee, (t.f & $t) === 0 && (dt(t, St), $e(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & cr) !== 0 || (n.f & Te) !== 0; + Po(n, i ? e : !1), n = r; } - var s = e.nodes && e.nodes.t; + var s = t.nodes && t.nodes.t; if (s !== null) for (const a of s) - (a.is_global || t) && a.in(); + (a.is_global || e) && a.in(); } } -function Do(e, t) { - if (e.nodes) - for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ zt(n); - t.append(n), n = i; +function Do(t, e) { + if (t.nodes) + for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ He(n); + e.append(n), n = i; } } let hi = !1, An = !1; -function ha(e) { - An = e; +function ha(t) { + An = t; } -let B = null, bt = !1; -function gt(e) { - B = e; +let B = null, Ae = !1; +function pe(t) { + B = t; } -let J = null; -function qt(e) { - J = e; +let j = null; +function Ve(t) { + j = t; } -let vt = null; -function Oo(e) { - B !== null && (vt === null ? vt = [e] : vt.push(e)); +let de = null; +function Oo(t) { + B !== null && (de === null ? de = [t] : de.push(t)); } -let je = null, et = 0, ft = null; -function Bu(e) { - ft = e; +let Gt = null, Zt = 0, le = null; +function Yu(t) { + le = t; } -let Fo = 1, Dn = 0, Bn = Dn; -function da(e) { - Bn = e; +let Io = 1, Dn = 0, Bn = Dn; +function da(t) { + Bn = t; } -function Io() { - return ++Fo; +function Fo() { + return ++Io; } -function Gr(e) { - var t = e.f; - if ((t & ke) !== 0) +function Ur(t) { + var e = t.f; + if ((e & St) !== 0) return !0; - if (t & Ne && (e.f &= ~Wn), (t & $t) !== 0) { + if (e & Rt && (t.f &= ~Wn), (e & Ee) !== 0) { for (var n = ( /** @type {Value[]} */ - e.deps + t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Gr( + if (Ur( /** @type {Derived} */ s ) && _o( /** @type {Derived} */ s - ), s.wv > e.wv) + ), s.wv > t.wv) return !0; } - (t & pt) !== 0 && // During time traveling we don't want to reset the status so that + (e & he) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Se === null && de(e, Ae); + Ct === null && dt(t, $t); } return !1; } -function Lo(e, t, n = !0) { - var r = e.reactions; - if (r !== null && !(vt !== null && fr.call(vt, e))) +function Lo(t, e, n = !0) { + var r = t.reactions; + if (r !== null && !(de !== null && fr.call(de, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Ne) !== 0 ? Lo( + (s.f & Rt) !== 0 ? Lo( /** @type {Derived} */ s, - t, + e, !1 - ) : t === s && (n ? de(s, ke) : (s.f & Ae) !== 0 && de(s, $t), xt( + ) : e === s && (n ? dt(s, St) : (s.f & $t) !== 0 && dt(s, Ee), $e( /** @type {Effect} */ s )); } } -function qo(e) { +function qo(t) { var b; - var t = je, n = et, r = ft, i = B, s = vt, a = st, o = bt, l = Bn, u = e.f; - je = /** @type {null | Value[]} */ - null, et = 0, ft = null, B = (u & (At | En)) === 0 ? e : null, vt = null, hr(e.ctx), bt = !1, Bn = ++Dn, e.ac !== null && (Co(() => { - e.ac.abort(kn); - }), e.ac = null); + var e = Gt, n = Zt, r = le, i = B, s = de, a = re, o = Ae, l = Bn, u = t.f; + Gt = /** @type {null | Value[]} */ + null, Zt = 0, le = null, B = (u & (Te | En)) === 0 ? t : null, de = null, hr(t.ctx), Ae = !1, Bn = ++Dn, t.ac !== null && (Co(() => { + t.ac.abort(kn); + }), t.ac = null); try { - e.f |= ls; + t.f |= ls; var f = ( /** @type {Function} */ - e.fn - ), p = f(); - e.f |= mr; - var c = e.deps, d = K == null ? void 0 : K.is_fork; - if (je !== null) { + t.fn + ), d = f(); + t.f |= mr; + var c = t.deps, p = G == null ? void 0 : G.is_fork; + if (Gt !== null) { var y; - if (d || Ir(e, et), c !== null && et > 0) - for (c.length = et + je.length, y = 0; y < je.length; y++) - c[et + y] = je[y]; + if (p || Ir(t, Zt), c !== null && Zt > 0) + for (c.length = Zt + Gt.length, y = 0; y < Gt.length; y++) + c[Zt + y] = Gt[y]; else - e.deps = c = je; - if (Fs() && (e.f & pt) !== 0) - for (y = et; y < c.length; y++) - ((b = c[y]).reactions ?? (b.reactions = [])).push(e); - } else !d && c !== null && et < c.length && (Ir(e, et), c.length = et); - if (ro() && ft !== null && !bt && c !== null && (e.f & (Ne | $t | ke)) === 0) + t.deps = c = Gt; + if (Is() && (t.f & he) !== 0) + for (y = Zt; y < c.length; y++) + ((b = c[y]).reactions ?? (b.reactions = [])).push(t); + } else !p && c !== null && Zt < c.length && (Ir(t, Zt), c.length = Zt); + if (ro() && le !== null && !Ae && c !== null && (t.f & (Rt | Ee | St)) === 0) for (y = 0; y < /** @type {Source[]} */ - ft.length; y++) + le.length; y++) Lo( - ft[y], + le[y], /** @type {Effect} */ - e + t ); - if (i !== null && i !== e) { + if (i !== null && i !== t) { if (Dn++, i.deps !== null) for (let m = 0; m < n; m += 1) i.deps[m].rv = Dn; - if (t !== null) - for (const m of t) + if (e !== null) + for (const m of e) m.rv = Dn; - ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ - ft)); + le !== null && (r === null ? r = le : r.push(.../** @type {Source[]} */ + le)); } - return (e.f & wn) !== 0 && (e.f ^= wn), p; + return (t.f & wn) !== 0 && (t.f ^= wn), d; } catch (m) { return so(m); } finally { - e.f ^= ls, je = t, et = n, ft = r, B = i, vt = s, hr(a), bt = o, Bn = l; + t.f ^= ls, Gt = e, Zt = n, le = r, B = i, de = s, hr(a), Ae = o, Bn = l; } } -function Xu(e, t) { - let n = t.reactions; +function Bu(t, e) { + let n = e.reactions; if (n !== null) { - var r = jl.call(n, e); + var r = Kl.call(n, t); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (t.f & Ne) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & Rt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (je === null || !fr.call(je, t))) { + (Gt === null || !fr.call(Gt, e))) { var s = ( /** @type {Derived} */ - t + e ); - (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Wn), Ps(s), Du(s), Ir(s, 0); + (s.f & he) !== 0 && (s.f ^= he, s.f &= ~Wn), Ps(s), Pu(s), Ir(s, 0); } } -function Ir(e, t) { - var n = e.deps; +function Ir(t, e) { + var n = t.deps; if (n !== null) - for (var r = t; r < n.length; r++) - Xu(e, n[r]); -} -function vr(e) { - var t = e.f; - if ((t & ln) === 0) { - de(e, Ae); - var n = J, r = hi; - J = e, hi = !0; + for (var r = e; r < n.length; r++) + Bu(t, n[r]); +} +function vr(t) { + var e = t.f; + if ((e & ln) === 0) { + dt(t, $t); + var n = j, r = hi; + j = t, hi = !0; try { - (t & (hn | ja)) !== 0 ? Hu(e) : Vs(e), No(e); - var i = qo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Fo; + (e & (hn | ja)) !== 0 ? zu(t) : Vs(t), No(t); + var i = qo(t); + t.teardown = typeof i == "function" ? i : null, t.wv = Io; var s; - os && xu && (e.f & ke) !== 0 && e.deps; + os && wu && (t.f & St) !== 0 && t.deps; } finally { - hi = r, J = n; + hi = r, j = n; } } } -function x(e) { - var t = e.f, n = (t & Ne) !== 0; - if (B !== null && !bt) { - var r = J !== null && (J.f & ln) !== 0; - if (!r && (vt === null || !fr.call(vt, e))) { +function x(t) { + var e = t.f, n = (e & Rt) !== 0; + if (B !== null && !Ae) { + var r = j !== null && (j.f & ln) !== 0; + if (!r && (de === null || !fr.call(de, t))) { var i = B.deps; if ((B.f & ls) !== 0) - e.rv < Dn && (e.rv = Dn, je === null && i !== null && i[et] === e ? et++ : je === null ? je = [e] : je.push(e)); + t.rv < Dn && (t.rv = Dn, Gt === null && i !== null && i[Zt] === t ? Zt++ : Gt === null ? Gt = [t] : Gt.push(t)); else { - (B.deps ?? (B.deps = [])).push(e); - var s = e.reactions; - s === null ? e.reactions = [B] : fr.call(s, B) || s.push(B); + (B.deps ?? (B.deps = [])).push(t); + var s = t.reactions; + s === null ? t.reactions = [B] : fr.call(s, B) || s.push(B); } } } - if (An && bn.has(e)) - return bn.get(e); + if (An && bn.has(t)) + return bn.get(t); if (n) { var a = ( /** @type {Derived} */ - e + t ); if (An) { var o = a.v; - return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; + return ((a.f & $t) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; } - var l = (a.f & pt) === 0 && !bt && B !== null && (hi || (B.f & pt) !== 0), u = (a.f & mr) === 0; - Gr(a) && (l && (a.f |= pt), _o(a)), l && !u && (mo(a), Vo(a)); - } - if (Se != null && Se.has(e)) - return Se.get(e); - if ((e.f & wn) !== 0) - throw e.v; - return e.v; -} -function Vo(e) { - if (e.f |= pt, e.deps !== null) - for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (mo( + var l = (a.f & he) === 0 && !Ae && B !== null && (hi || (B.f & he) !== 0), u = (a.f & mr) === 0; + Ur(a) && (l && (a.f |= he), _o(a)), l && !u && (mo(a), Vo(a)); + } + if (Ct != null && Ct.has(t)) + return Ct.get(t); + if ((t.f & wn) !== 0) + throw t.v; + return t.v; +} +function Vo(t) { + if (t.f |= he, t.deps !== null) + for (const e of t.deps) + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Rt) !== 0 && (e.f & he) === 0 && (mo( /** @type {Derived} */ - t + e ), Vo( /** @type {Derived} */ - t + e )); } -function zo(e) { - if (e.v === Re) return !0; - if (e.deps === null) return !1; - for (const t of e.deps) - if (bn.has(t) || (t.f & Ne) !== 0 && zo( +function zo(t) { + if (t.v === Tt) return !0; + if (t.deps === null) return !1; + for (const e of t.deps) + if (bn.has(e) || (e.f & Rt) !== 0 && zo( /** @type {Derived} */ - t + e )) return !0; return !1; } -function Xi(e) { - var t = bt; +function Xi(t) { + var e = Ae; try { - return bt = !0, e(); + return Ae = !0, t(); } finally { - bt = t; + Ae = e; } } const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Wu(e) { - for (var t = 0; t < e.length; t++) - Ho.add(e[t]); +function Xu(t) { + for (var e = 0; e < t.length; e++) + Ho.add(t[e]); for (var n of ms) - n(e); + n(t); } let pa = null; -function va(e) { +function va(t) { var m; - var t = this, n = ( + var e = this, n = ( /** @type {Node} */ - t.ownerDocument - ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( + e.ownerDocument + ), r = t.type, i = ((m = t.composedPath) == null ? void 0 : m.call(t)) || [], s = ( /** @type {null | Element} */ - i[0] || e.target + i[0] || t.target ); - pa = e; - var a = 0, o = pa === e && e.__root; + pa = t; + var a = 0, o = pa === t && t.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (t === document || t === /** @type {any} */ + if (l !== -1 && (e === document || e === /** @type {any} */ window)) { - e.__root = t; + t.__root = e; return; } - var u = i.indexOf(t); + var u = i.indexOf(e); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || e.target, s !== t) { - $i(e, "currentTarget", { + i[a] || t.target, s !== e) { + $i(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = B, p = J; - gt(null), qt(null); + var f = B, d = j; + pe(null), Ve(null); try { - for (var c, d = []; s !== null; ) { + for (var c, p = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { @@ -1840,58 +1840,58 @@ function va(e) { b != null && (!/** @type {any} */ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place - e.target === s) && b.call(s, e); + t.target === s) && b.call(s, t); } catch ($) { - c ? d.push($) : c = $; + c ? p.push($) : c = $; } - if (e.cancelBubble || y === t || y === null) + if (t.cancelBubble || y === e || y === null) break; s = y; } if (c) { - for (let $ of d) + for (let $ of p) queueMicrotask(() => { throw $; }); throw c; } } finally { - e.__root = t, delete e.currentTarget, gt(f), qt(p); + t.__root = e, delete t.currentTarget, pe(f), Ve(d); } } } var Ya, Ba; -const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( +const es = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (e) => e + createHTML: (t) => t } ); -function Uu(e) { +function Wu(t) { return ( /** @type {string} */ - (ts == null ? void 0 : ts.createHTML(e)) ?? e + (es == null ? void 0 : es.createHTML(t)) ?? t ); } -function Yo(e, t = !1) { +function Yo(t, e = !1) { var n = Os("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; + return t = t.replaceAll("", ""), n.innerHTML = e ? Wu(t) : t, n.content; } -function $n(e, t) { +function $n(t, e) { var n = ( /** @type {Effect} */ - J + j ); - n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); + n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Yt(e, t) { - var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); +function Be(t, e) { + var n = (e & Ul) !== 0, r = (e & Gl) !== 0, i, s = !t.startsWith(""); return () => { - if (j) + if (K) return $n(X, null), X; - i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + i === void 0 && (i = Yo(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ fn(i))); var a = ( /** @type {TemplateNode} */ @@ -1912,10 +1912,10 @@ function Yt(e, t) { }; } // @__NO_SIDE_EFFECTS__ -function Gu(e, t, n = "svg") { - var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; +function Uu(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (j) + if (K) return $n(X, null), X; if (!s) { var a = ( @@ -1936,109 +1936,109 @@ function Gu(e, t, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Ku(e, t) { - return /* @__PURE__ */ Gu(e, t, "svg"); +function Gu(t, e) { + return /* @__PURE__ */ Uu(t, e, "svg"); } -function ga(e = "") { - if (!j) { - var t = it(e + ""); - return $n(t, t), t; +function ga(t = "") { + if (!K) { + var e = ne(t + ""); + return $n(e, e), e; } var n = X; - return n.nodeType !== Ur ? (n.before(n = it()), qe(n)) : Bi( + return n.nodeType !== Wr ? (n.before(n = ne()), Lt(n)) : Bi( /** @type {Text} */ n ), $n(n, n), n; } -function Ge(e, t) { - if (j) { +function Wt(t, e) { + if (K) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - J + j ); ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = X), qi(); return; } - e !== null && e.before( + t !== null && t.before( /** @type {Node} */ - t + e ); } -const ju = ["touchstart", "touchmove"]; -function Ju(e) { - return ju.includes(e); +const Ku = ["touchstart", "touchmove"]; +function ju(t) { + return Ku.includes(t); } -function mn(e, t) { - var n = t == null ? "" : typeof t == "object" ? t + "" : t; - n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); +function mn(t, e) { + var n = e == null ? "" : typeof e == "object" ? e + "" : e; + n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function Bo(e, t) { - return Xo(e, t); +function Bo(t, e) { + return Xo(t, e); } -function Zu(e, t) { - _s(), t.intro = t.intro ?? !1; - const n = t.target, r = j, i = X; +function Ju(t, e) { + _s(), e.intro = e.intro ?? !1; + const n = e.target, r = K, i = X; try { for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== yr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ zt(s); + s = /* @__PURE__ */ He(s); if (!s) throw ur; - on(!0), qe( + on(!0), Lt( /** @type {Comment} */ s ); - const a = Xo(e, { ...t, anchor: s }); + const a = Xo(t, { ...e, anchor: s }); return on(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== ur && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), _s(), Eo(n), on(!1), Bo(e, t); + return a !== ur && console.warn("Failed to hydrate: ", a), e.recover === !1 && hu(), _s(), Eo(n), on(!1), Bo(t, e); } finally { - on(r), qe(i); + on(r), Lt(i); } } const ri = /* @__PURE__ */ new Map(); -function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +function Xo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { _s(); - var o = /* @__PURE__ */ new Set(), l = (p) => { - for (var c = 0; c < p.length; c++) { - var d = p[c]; - if (!o.has(d)) { - o.add(d); - var y = Ju(d); - for (const $ of [t, document]) { + var o = /* @__PURE__ */ new Set(), l = (d) => { + for (var c = 0; c < d.length; c++) { + var p = d[c]; + if (!o.has(p)) { + o.add(p); + var y = ju(p); + for (const $ of [e, document]) { var b = ri.get($); b === void 0 && (b = /* @__PURE__ */ new Map(), ri.set($, b)); - var m = b.get(d); - m === void 0 ? ($.addEventListener(d, va, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); + var m = b.get(p); + m === void 0 ? ($.addEventListener(p, va, { passive: y }), b.set(p, 1)) : b.set(p, m + 1); } } } }; - l(Fi(Ho)), ms.add(l); - var u = void 0, f = Vu(() => { - var p = n ?? t.appendChild(it()); - return Cu( + l(Ii(Ho)), ms.add(l); + var u = void 0, f = qu(() => { + var d = n ?? e.appendChild(ne()); + return Tu( /** @type {TemplateNode} */ - p, + d, { pending: () => { } }, (c) => { Vi({}); - var d = ( + var p = ( /** @type {ComponentContext} */ - st + re ); - if (s && (d.c = s), i && (r.$$events = i), j && $n( + if (s && (p.c = s), i && (r.$$events = i), K && $n( /** @type {TemplateNode} */ c, null - ), u = e(c, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ + ), u = t(c, r) || {}, K && (j.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ X.data !== ks)) throw Li(), ur; zi(); @@ -2046,37 +2046,37 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int ), () => { var b; for (var c of o) - for (const m of [t, document]) { - var d = ( + for (const m of [e, document]) { + var p = ( /** @type {Map} */ ri.get(m) ), y = ( /** @type {number} */ - d.get(c) + p.get(c) ); - --y == 0 ? (m.removeEventListener(c, va), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); + --y == 0 ? (m.removeEventListener(c, va), p.delete(c), p.size === 0 && ri.delete(m)) : p.set(c, y); } - ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); + ms.delete(l), d !== n && ((b = d.parentNode) == null || b.removeChild(d)); }; }); return ys.set(u, f), u; } let ys = /* @__PURE__ */ new WeakMap(); -function Qu(e, t) { - const n = ys.get(e); - return n ? (ys.delete(e), n(t)) : Promise.resolve(); +function Zu(t, e) { + const n = ys.get(t); + return n ? (ys.delete(t), n(e)) : Promise.resolve(); } -var yt, Ft, nt, zn, Xr, Wr, Di; -class ef { +var xe, Fe, te, zn, Br, Xr, Di; +class Qu { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(t, n = !0) { + constructor(e, n = !0) { /** @type {TemplateNode} */ - ce(this, "anchor"); + ct(this, "anchor"); /** @type {Map} */ - H(this, yt, /* @__PURE__ */ new Map()); + H(this, xe, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,13 +2091,13 @@ class ef { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Ft, /* @__PURE__ */ new Map()); + H(this, Fe, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - H(this, nt, /* @__PURE__ */ new Map()); + H(this, te, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} @@ -2107,106 +2107,106 @@ class ef { * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - H(this, Xr, !0); - H(this, Wr, () => { - var t = ( + H(this, Br, !0); + H(this, Xr, () => { + var e = ( /** @type {Batch} */ - K + G ); - if (v(this, yt).has(t)) { + if (v(this, xe).has(e)) { var n = ( /** @type {Key} */ - v(this, yt).get(t) - ), r = v(this, Ft).get(n); + v(this, xe).get(e) + ), r = v(this, Fe).get(n); if (r) zs(r), v(this, zn).delete(n); else { - var i = v(this, nt).get(n); - i && (v(this, Ft).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, te).get(n); + i && (v(this, Fe).set(n, i.effect), v(this, te).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, yt)) { - if (v(this, yt).delete(s), s === t) + for (const [s, a] of v(this, xe)) { + if (v(this, xe).delete(s), s === e) break; - const o = v(this, nt).get(a); - o && (Ve(o.effect), v(this, nt).delete(a)); + const o = v(this, te).get(a); + o && (qt(o.effect), v(this, te).delete(a)); } - for (const [s, a] of v(this, Ft)) { + for (const [s, a] of v(this, Fe)) { if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, yt).values()).includes(s)) { + if (Array.from(v(this, xe).values()).includes(s)) { var u = document.createDocumentFragment(); - Do(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); + Do(a, u), u.append(ne()), v(this, te).set(s, { effect: a, fragment: u }); } else - Ve(a); - v(this, zn).delete(s), v(this, Ft).delete(s); + qt(a); + v(this, zn).delete(s), v(this, Fe).delete(s); }; - v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); + v(this, Br) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - H(this, Di, (t) => { - v(this, yt).delete(t); - const n = Array.from(v(this, yt).values()); - for (const [r, i] of v(this, nt)) - n.includes(r) || (Ve(i.effect), v(this, nt).delete(r)); + H(this, Di, (e) => { + v(this, xe).delete(e); + const n = Array.from(v(this, xe).values()); + for (const [r, i] of v(this, te)) + n.includes(r) || (qt(i.effect), v(this, te).delete(r)); }); - this.anchor = t, V(this, Xr, n); + this.anchor = e, V(this, Br, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(t, n) { + ensure(e, n) { var r = ( /** @type {Batch} */ - K + G ), i = To(); - if (n && !v(this, Ft).has(t) && !v(this, nt).has(t)) + if (n && !v(this, Fe).has(e) && !v(this, te).has(e)) if (i) { - var s = document.createDocumentFragment(), a = it(); - s.append(a), v(this, nt).set(t, { - effect: dt(() => n(a)), + var s = document.createDocumentFragment(), a = ne(); + s.append(a), v(this, te).set(e, { + effect: ce(() => n(a)), fragment: s }); } else - v(this, Ft).set( - t, - dt(() => n(this.anchor)) + v(this, Fe).set( + e, + ce(() => n(this.anchor)) ); - if (v(this, yt).set(r, t), i) { - for (const [o, l] of v(this, Ft)) - o === t ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, nt)) - o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Wr)), r.ondiscard(v(this, Di)); + if (v(this, xe).set(r, e), i) { + for (const [o, l] of v(this, Fe)) + o === e ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, te)) + o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(v(this, Xr)), r.ondiscard(v(this, Di)); } else - j && (this.anchor = X), v(this, Wr).call(this); + K && (this.anchor = X), v(this, Xr).call(this); } } -yt = new WeakMap(), Ft = new WeakMap(), nt = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Di = new WeakMap(); -function tf(e) { - st === null && au(), Is(() => { - const t = Xi(e); - if (typeof t == "function") return ( +xe = new WeakMap(), Fe = new WeakMap(), te = new WeakMap(), zn = new WeakMap(), Br = new WeakMap(), Xr = new WeakMap(), Di = new WeakMap(); +function tf(t) { + re === null && su(), Fs(() => { + const e = Xi(t); + if (typeof e == "function") return ( /** @type {() => void} */ - t + e ); }); } -function Qn(e, t, n = !1) { - j && qi(); - var r = new ef(e), i = n ? cr : 0; +function Qn(t, e, n = !1) { + K && qi(); + var r = new Qu(t), i = n ? cr : 0; function s(a, o) { - if (j) { - const f = eo(e); + if (K) { + const f = to(t); var l; if (f === Ns ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { var u = Ai(); - qe(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); + Lt(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); return; } } @@ -2214,27 +2214,27 @@ function Qn(e, t, n = !1) { } qs(() => { var a = !1; - t((o, l = 0) => { + e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function di(e, t) { - return t; +function di(t, e) { + return e; } -function nf(e, t, n) { - for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { - let p = t[o]; +function ef(t, e, n) { + for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { + let d = e[o]; Yn( - p, + d, () => { if (s) { - if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { + if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { var c = ( /** @type {Set} */ - e.outrogroups + t.outrogroups ); - ws(Fi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); + ws(Ii(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2252,188 +2252,188 @@ function nf(e, t, n) { /** @type {Element} */ u.parentNode ); - Eo(f), f.append(u), e.items.clear(); + Eo(f), f.append(u), t.items.clear(); } - ws(t, !l); + ws(e, !l); } else s = { - pending: new Set(t), + pending: new Set(e), done: /* @__PURE__ */ new Set() - }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ws(e, t = !0) { - for (var n = 0; n < e.length; n++) - Ve(e[n], t); +function ws(t, e = !0) { + for (var n = 0; n < t.length; n++) + qt(t[n], e); } var _a; -function pi(e, t, n, r, i, s = null) { - var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; +function pi(t, e, n, r, i, s = null) { + var a = t, o = /* @__PURE__ */ new Map(), l = (e & Xa) !== 0; if (l) { var u = ( /** @type {Element} */ - e + t ); - a = j ? qe(/* @__PURE__ */ fn(u)) : u.appendChild(it()); + a = K ? Lt(/* @__PURE__ */ fn(u)) : u.appendChild(ne()); } - j && qi(); - var f = null, p = /* @__PURE__ */ go(() => { + K && qi(); + var f = null, d = /* @__PURE__ */ go(() => { var $ = n(); - return Ua($) ? $ : $ == null ? [] : Fi($); - }), c, d = !0; + return Ua($) ? $ : $ == null ? [] : Ii($); + }), c, p = !0; function y() { - m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Sr(f, null, a)) : Yn(f, () => { + m.fallback = f, nf(m, c, a, e, r), f !== null && (c.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Rr(f, null, a)) : Yn(f, () => { f = null; })); } var b = qs(() => { c = /** @type {V[]} */ - x(p); + x(d); var $ = c.length; let D = !1; - if (j) { - var M = eo(a) === Oi; - M !== ($ === 0) && (a = Ai(), qe(a), on(!1), D = !0); + if (K) { + var M = to(a) === Oi; + M !== ($ === 0) && (a = Ai(), Lt(a), on(!1), D = !0); } - for (var S = /* @__PURE__ */ new Set(), I = ( + for (var S = /* @__PURE__ */ new Set(), F = ( /** @type {Batch} */ - K + G ), L = To(), W = 0; W < $; W += 1) { - j && X.nodeType === yr && /** @type {Comment} */ + K && X.nodeType === yr && /** @type {Comment} */ X.data === ks && (a = /** @type {Comment} */ X, D = !0, on(!1)); - var oe = c[W], Q = r(oe, W), U = d ? null : o.get(Q); - U ? (U.v && pr(U.v, oe), U.i && pr(U.i, W), L && I.unskip_effect(U.e)) : (U = sf( + var ot = c[W], Z = r(ot, W), U = p ? null : o.get(Z); + U ? (U.v && pr(U.v, ot), U.i && pr(U.i, W), L && F.unskip_effect(U.e)) : (U = rf( o, - d ? a : _a ?? (_a = it()), - oe, - Q, + p ? a : _a ?? (_a = ne()), + ot, + Z, W, i, - t, + e, n - ), d || (U.e.f |= an), o.set(Q, U)), S.add(Q); + ), p || (U.e.f |= an), o.set(Z, U)), S.add(Z); } - if ($ === 0 && s && !f && (d ? f = dt(() => s(a)) : (f = dt(() => s(_a ?? (_a = it()))), f.f |= an)), $ > S.size && lu(), j && $ > 0 && qe(Ai()), !d) + if ($ === 0 && s && !f && (p ? f = ce(() => s(a)) : (f = ce(() => s(_a ?? (_a = ne()))), f.f |= an)), $ > S.size && ou(), K && $ > 0 && Lt(Ai()), !p) if (L) { - for (const [le, ue] of o) - S.has(le) || I.skip_effect(ue.e); - I.oncommit(y), I.ondiscard(() => { + for (const [lt, ut] of o) + S.has(lt) || F.skip_effect(ut.e); + F.oncommit(y), F.ondiscard(() => { }); } else y(); - D && on(!0), x(p); + D && on(!0), x(d); }), m = { effect: b, items: o, outrogroups: null, fallback: f }; - d = !1, j && (a = X); + p = !1, K && (a = X); } -function Cr(e) { - for (; e !== null && (e.f & At) === 0; ) - e = e.next; - return e; +function Tr(t) { + for (; t !== null && (t.f & Te) === 0; ) + t = t.next; + return t; } -function rf(e, t, n, r, i) { - var U, le, ue, O, F, Me, ot, ye, we; - var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, c = [], d = [], y, b, m, $; +function nf(t, e, n, r, i) { + var U, lt, ut, O, I, Nt, se, mt, yt; + var s = (r & zl) !== 0, a = e.length, o = t.items, l = Tr(t.effect.first), u, f = null, d, c = [], p = [], y, b, m, $; if (s) for ($ = 0; $ < a; $ += 1) - y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & an) === 0 && ((le = (U = m.nodes) == null ? void 0 : U.a) == null || le.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + y = e[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, (m.f & an) === 0 && ((lt = (U = m.nodes) == null ? void 0 : U.a) == null || lt.measure(), (d ?? (d = /* @__PURE__ */ new Set())).add(m)); for ($ = 0; $ < a; $ += 1) { - if (y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, e.outrogroups !== null) - for (const ee of e.outrogroups) - ee.pending.delete(m), ee.done.delete(m); + if (y = e[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, t.outrogroups !== null) + for (const Q of t.outrogroups) + Q.pending.delete(m), Q.done.delete(m); if ((m.f & an) !== 0) if (m.f ^= an, m === l) - Sr(m, null, n); + Rr(m, null, n); else { var D = f ? f.next : l; - m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(e, f, m), gn(e, m, D), Sr(m, D, n), f = m, c = [], d = [], l = Cr(f.next); + m === t.effect.last && (t.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(t, f, m), gn(t, m, D), Rr(m, D, n), f = m, c = [], p = [], l = Tr(f.next); continue; } - if ((m.f & rt) !== 0 && (zs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { + if ((m.f & ee) !== 0 && (zs(m), s && ((O = (ut = m.nodes) == null ? void 0 : ut.a) == null || O.unfix(), (d ?? (d = /* @__PURE__ */ new Set())).delete(m))), m !== l) { if (u !== void 0 && u.has(m)) { - if (c.length < d.length) { - var M = d[0], S; + if (c.length < p.length) { + var M = p[0], S; f = M.prev; - var I = c[0], L = c[c.length - 1]; + var F = c[0], L = c[c.length - 1]; for (S = 0; S < c.length; S += 1) - Sr(c[S], M, n); - for (S = 0; S < d.length; S += 1) - u.delete(d[S]); - gn(e, I.prev, L.next), gn(e, f, I), gn(e, L, M), l = M, f = L, $ -= 1, c = [], d = []; + Rr(c[S], M, n); + for (S = 0; S < p.length; S += 1) + u.delete(p[S]); + gn(t, F.prev, L.next), gn(t, f, F), gn(t, L, M), l = M, f = L, $ -= 1, c = [], p = []; } else - u.delete(m), Sr(m, l, n), gn(e, m.prev, m.next), gn(e, m, f === null ? e.effect.first : f.next), gn(e, f, m), f = m; + u.delete(m), Rr(m, l, n), gn(t, m.prev, m.next), gn(t, m, f === null ? t.effect.first : f.next), gn(t, f, m), f = m; continue; } - for (c = [], d = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); + for (c = [], p = []; l !== null && l !== m; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Tr(l.next); if (l === null) continue; } - (m.f & an) === 0 && c.push(m), f = m, l = Cr(m.next); + (m.f & an) === 0 && c.push(m), f = m, l = Tr(m.next); } - if (e.outrogroups !== null) { - for (const ee of e.outrogroups) - ee.pending.size === 0 && (ws(Fi(ee.done)), (F = e.outrogroups) == null || F.delete(ee)); - e.outrogroups.size === 0 && (e.outrogroups = null); + if (t.outrogroups !== null) { + for (const Q of t.outrogroups) + Q.pending.size === 0 && (ws(Ii(Q.done)), (I = t.outrogroups) == null || I.delete(Q)); + t.outrogroups.size === 0 && (t.outrogroups = null); } if (l !== null || u !== void 0) { var W = []; if (u !== void 0) for (m of u) - (m.f & rt) === 0 && W.push(m); + (m.f & ee) === 0 && W.push(m); for (; l !== null; ) - (l.f & rt) === 0 && l !== e.fallback && W.push(l), l = Cr(l.next); - var oe = W.length; - if (oe > 0) { - var Q = (r & Xa) !== 0 && a === 0 ? n : null; + (l.f & ee) === 0 && l !== t.fallback && W.push(l), l = Tr(l.next); + var ot = W.length; + if (ot > 0) { + var Z = (r & Xa) !== 0 && a === 0 ? n : null; if (s) { - for ($ = 0; $ < oe; $ += 1) - (ot = (Me = W[$].nodes) == null ? void 0 : Me.a) == null || ot.measure(); - for ($ = 0; $ < oe; $ += 1) - (we = (ye = W[$].nodes) == null ? void 0 : ye.a) == null || we.fix(); + for ($ = 0; $ < ot; $ += 1) + (se = (Nt = W[$].nodes) == null ? void 0 : Nt.a) == null || se.measure(); + for ($ = 0; $ < ot; $ += 1) + (yt = (mt = W[$].nodes) == null ? void 0 : mt.a) == null || yt.fix(); } - nf(e, W, Q); + ef(t, W, Z); } } s && xn(() => { - var ee, Pe; - if (p !== void 0) - for (m of p) - (Pe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); + var Q, kt; + if (d !== void 0) + for (m of d) + (kt = (Q = m.nodes) == null ? void 0 : Q.a) == null || kt.apply(); }); } -function sf(e, t, n, r, i, s, a, o) { - var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & zl) !== 0 ? Un(i) : null; +function rf(t, e, n, r, i, s, a, o) { + var l = (a & ql) !== 0 ? (a & Hl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & Vl) !== 0 ? Un(i) : null; return { v: l, i: u, - e: dt(() => (s(t, l ?? n, u ?? i, o), () => { - e.delete(r); + e: ce(() => (s(e, l ?? n, u ?? i, o), () => { + t.delete(r); })) }; } -function Sr(e, t, n) { - if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & an) === 0 ? ( +function Rr(t, e, n) { + if (t.nodes) + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & an) === 0 ? ( /** @type {EffectNodes} */ - t.nodes.start + e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ zt(r) + /* @__PURE__ */ He(r) ); if (s.before(r), r === i) return; r = a; } } -function gn(e, t, n) { - t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; +function gn(t, e, n) { + e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function Hs(e, t) { +function Hs(t, e) { So(() => { - var n = e.getRootNode(), r = ( + var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Hs(e, t) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + t.hash)) { + if (!r.querySelector("#" + e.hash)) { const i = Os("style"); - i.id = t.hash, i.textContent = t.code, r.appendChild(i); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } const ma = [...` \r\f \v\uFEFF`]; -function af(e, t, n) { - var r = e == null ? "" : "" + e; +function sf(t, e, n) { + var r = t == null ? "" : "" + t; if (n) { for (var i in n) if (n[i]) @@ -2466,104 +2466,104 @@ function af(e, t, n) { } return r === "" ? null : r; } -function ya(e, t = !1) { - var n = t ? " !important;" : ";", r = ""; - for (var i in e) { - var s = e[i]; +function ya(t, e = !1) { + var n = e ? " !important;" : ";", r = ""; + for (var i in t) { + var s = t[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function of(e, t) { - if (t) { +function af(t, e) { + if (e) { var n = "", r, i; - return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; } - return String(e); + return String(t); } -function ii(e, t, n, r, i, s) { - var a = e.__className; - if (j || a !== n || a === void 0) { - var o = af(n, r, s); - (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; +function ii(t, e, n, r, i, s) { + var a = t.__className; + if (K || a !== n || a === void 0) { + var o = sf(n, r, s); + (!K || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; } else if (s && i !== s) for (var l in s) { var u = !!s[l]; - (i == null || u !== !!i[l]) && e.classList.toggle(l, u); + (i == null || u !== !!i[l]) && t.classList.toggle(l, u); } return s; } -function ns(e, t = {}, n, r) { +function ns(t, e = {}, n, r) { for (var i in n) { var s = n[i]; - t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); + e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function wa(e, t, n, r) { - var i = e.__style; - if (j || i !== t) { - var s = of(t, r); - (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; - } else r && (Array.isArray(r) ? (ns(e, n == null ? void 0 : n[0], r[0]), ns(e, n == null ? void 0 : n[1], r[1], "important")) : ns(e, n, r)); +function wa(t, e, n, r) { + var i = t.__style; + if (K || i !== e) { + var s = af(e, r); + (!K || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (ns(t, n == null ? void 0 : n[0], r[0]), ns(t, n == null ? void 0 : n[1], r[1], "important")) : ns(t, n, r)); return r; } -const lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; -function xa(e, t, n, r) { - var i = cf(e); - j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +const of = Symbol("is custom element"), lf = Symbol("is html"), uf = iu ? "link" : "LINK"; +function xa(t, e, n, r) { + var i = ff(t); + K && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === uf) || i[e] !== (i[e] = n) && (e === "loading" && (t[ru] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && cf(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); } -function cf(e) { +function ff(t) { return ( /** @type {Record} **/ // @ts-expect-error - e.__attributes ?? (e.__attributes = { - [lf]: e.nodeName.includes("-"), - [uf]: e.namespaceURI === Wa + t.__attributes ?? (t.__attributes = { + [of]: t.nodeName.includes("-"), + [lf]: t.namespaceURI === Wa }) ); } var ba = /* @__PURE__ */ new Map(); -function hf(e) { - var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); +function cf(t) { + var e = t.getAttribute("is") || t.nodeName, n = ba.get(e); if (n) return n; - ba.set(t, n = []); - for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Jl(i); + ba.set(e, n = []); + for (var r, i = t, s = Element.prototype; s !== i; ) { + r = jl(i); for (var a in r) r[a].set && n.push(a); i = Ga(i); } return n; } -function $a(e, t) { - return e === t || (e == null ? void 0 : e[Pr]) === t; +function $a(t, e) { + return t === e || (t == null ? void 0 : t[Mr]) === e; } -function vi(e = {}, t, n, r) { +function vi(t = {}, e, n, r) { return So(() => { var i, s; return Ls(() => { i = s, s = [], Xi(() => { - e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); + t !== n(...s) && (e(t, ...s), i && $a(n(...i), t) && e(null, ...i)); }); }), () => { xn(() => { - s && $a(n(...s), e) && t(null, ...s); + s && $a(n(...s), t) && e(null, ...s); }); }; - }), e; + }), t; } let si = !1; -function df(e) { - var t = si; +function hf(t) { + var e = si; try { - return si = !1, [e(), si]; + return si = !1, [t(), si]; } finally { - si = t; + si = e; } } -function ae(e, t, n, r) { +function at(t, e, n, r) { var D; - var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( + var i = (n & Xl) !== 0, s = (n & Wl) !== 0, a = ( /** @type {V} */ r ), o = !0, l = () => (o && (o = !1, a = s ? Xi( @@ -2574,72 +2574,72 @@ function ae(e, t, n, r) { r )), a), u; if (i) { - var f = Pr in e || Qa in e; - u = ((D = Hn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); + var f = Mr in t || Qa in t; + u = ((D = Hn(t, e)) == null ? void 0 : D.set) ?? (f && e in t ? (M) => t[e] = M : void 0); } - var p, c = !1; - i ? [p, c] = df(() => ( + var d, c = !1; + i ? [d, c] = hf(() => ( /** @type {V} */ - e[t] - )) : p = /** @type {V} */ - e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); - var d; - if (d = () => { + t[e] + )) : d = /** @type {V} */ + t[e], d === void 0 && r !== void 0 && (d = l(), u && (du(), u(d))); + var p; + if (p = () => { var M = ( /** @type {V} */ - e[t] + t[e] ); return M === void 0 ? l() : (o = !0, M); - }, (n & Xl) === 0) - return d; + }, (n & Bl) === 0) + return p; if (u) { - var y = e.$$legacy; + var y = t.$$legacy; return ( /** @type {() => V} */ (function(M, S) { - return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); + return arguments.length > 0 ? ((!S || y || c) && u(S ? p() : M), M) : p(); }) ); } - var b = !1, m = ((n & Bl) !== 0 ? Yi : go)(() => (b = !1, d())); + var b = !1, m = ((n & Yl) !== 0 ? Yi : go)(() => (b = !1, p())); i && x(m); var $ = ( /** @type {Effect} */ - J + j ); return ( /** @type {() => V} */ (function(M, S) { if (arguments.length > 0) { - const I = S ? x(m) : i ? Pn(M) : M; - return he(m, I), b = !0, a !== void 0 && (a = I), M; + const F = S ? x(m) : i ? Pn(M) : M; + return ht(m, F), b = !0, a !== void 0 && (a = F), M; } return An && b || ($.f & ln) !== 0 ? m.v : x(m); }) ); } -function pf(e) { - return new vf(e); +function df(t) { + return new pf(t); } -var sn, ht; -class vf { +var sn, fe; +class pf { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(t) { + constructor(e) { /** @type {any} */ H(this, sn); /** @type {Record} */ - H(this, ht); + H(this, fe); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { var l = /* @__PURE__ */ wo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...t.props || {}, $$events: {} }, + { ...e.props || {}, $$events: {} }, { get(a, o) { return x(n.get(o) ?? r(o, Reflect.get(a, o))); @@ -2648,60 +2648,60 @@ class vf { return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return he(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ht(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - V(this, ht, (t.hydrate ? Zu : Bo)(t.component, { - target: t.target, - anchor: t.anchor, + V(this, fe, (e.hydrate ? Ju : Bo)(e.component, { + target: e.target, + anchor: e.anchor, props: i, - context: t.context, - intro: t.intro ?? !1, - recover: t.recover - })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && re(), V(this, sn, i.$$events); - for (const a of Object.keys(v(this, ht))) + context: e.context, + intro: e.intro ?? !1, + recover: e.recover + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && rt(), V(this, sn, i.$$events); + for (const a of Object.keys(v(this, fe))) a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { get() { - return v(this, ht)[a]; + return v(this, fe)[a]; }, /** @param {any} value */ set(o) { - v(this, ht)[a] = o; + v(this, fe)[a] = o; }, enumerable: !0 }); - v(this, ht).$set = /** @param {Record} next */ + v(this, fe).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ht).$destroy = () => { - Qu(v(this, ht)); + }, v(this, fe).$destroy = () => { + Zu(v(this, fe)); }; } /** @param {Record} props */ - $set(t) { - v(this, ht).$set(t); + $set(e) { + v(this, fe).$set(e); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(t, n) { - v(this, sn)[t] = v(this, sn)[t] || []; + $on(e, n) { + v(this, sn)[e] = v(this, sn)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, sn)[t].push(r), () => { - v(this, sn)[t] = v(this, sn)[t].filter( + return v(this, sn)[e].push(r), () => { + v(this, sn)[e] = v(this, sn)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, ht).$destroy(); + v(this, fe).$destroy(); } } -sn = new WeakMap(), ht = new WeakMap(); +sn = new WeakMap(), fe = new WeakMap(); let Wo; typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** @@ -2709,51 +2709,51 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(t, n, r) { + constructor(e, n, r) { super(); /** The Svelte component constructor */ - ce(this, "$$ctor"); + ct(this, "$$ctor"); /** Slots */ - ce(this, "$$s"); + ct(this, "$$s"); /** @type {any} The Svelte component instance */ - ce(this, "$$c"); + ct(this, "$$c"); /** Whether or not the custom element is connected */ - ce(this, "$$cn", !1); + ct(this, "$$cn", !1); /** @type {Record} Component props data */ - ce(this, "$$d", {}); + ct(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ce(this, "$$r", !1); + ct(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ce(this, "$$p_d", {}); + ct(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ce(this, "$$l", {}); + ct(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ce(this, "$$l_u", /* @__PURE__ */ new Map()); + ct(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ce(this, "$$me"); + ct(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ce(this, "$$shadowRoot", null); - this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + ct(this, "$$shadowRoot", null); + this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(t, n, r) { - if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { - const i = this.$$c.$on(t, n); + addEventListener(e, n, r) { + if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { + const i = this.$$c.$on(e, n); this.$$l_u.set(n, i); } - super.addEventListener(t, n, r); + super.addEventListener(e, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(t, n, r) { - if (super.removeEventListener(t, n, r), this.$$c) { + removeEventListener(e, n, r) { + if (super.removeEventListener(e, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2763,13 +2763,13 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { let n = function(s) { return (a) => { const o = Os("slot"); - s !== "default" && (o.name = s), Ge(a, o); + s !== "default" && (o.name = s), Wt(a, o); }; }; - var t = n; + var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = gf(this); + const r = {}, i = vf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { @@ -2778,7 +2778,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = pf({ + this.$$c = df({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,7 +2786,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = qu(() => { + }), this.$$me = Lu(() => { Ls(() => { var s; this.$$r = !0; @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(t, n, r) { + attributeChangedCallback(e, n, r) { var i; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = gi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = gi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,74 +2831,74 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(t) { + $$g_p(e) { return bi(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t - ) || t; + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; } }); -function gi(e, t, n, r) { +function gi(t, e, n, r) { var s; - const i = (s = n[e]) == null ? void 0 : s.type; - if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) - return t; + const i = (s = n[t]) == null ? void 0 : s.type; + if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) + return e; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return t == null ? null : JSON.stringify(t); + return e == null ? null : JSON.stringify(e); case "Boolean": - return t ? "" : null; + return e ? "" : null; case "Number": - return t ?? null; + return e ?? null; default: - return t; + return e; } else switch (i) { case "Object": case "Array": - return t && JSON.parse(t); + return e && JSON.parse(e); case "Boolean": - return t; + return e; // conversion already handled above case "Number": - return t != null ? +t : t; + return e != null ? +e : e; default: - return t; + return e; } } -function gf(e) { - const t = {}; - return e.childNodes.forEach((n) => { - t[ +function vf(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), t; + }), e; } -function Ys(e, t, n, r, i, s) { +function Ys(t, e, n, r, i, s) { let a = class extends Wo { constructor() { - super(e, n, i), this.$$p_d = t; + super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return bi(t).map( - (o) => (t[o].attribute || o).toLowerCase() + return bi(e).map( + (o) => (e[o].attribute || o).toLowerCase() ); } }; - return bi(t).forEach((o) => { + return bi(e).forEach((o) => { $i(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var p; - l = gi(o, l, t), this.$$d[o] = l; + var d; + l = gi(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (p = Hn(u, o)) == null ? void 0 : p.get; + var f = (d = Hn(u, o)) == null ? void 0 : d.get; f ? u[o] = l : u.$set({ [o]: l }); } } @@ -2910,69 +2910,69 @@ function Ys(e, t, n, r, i, s) { return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), e.element = /** @type {any} */ + }), t.element = /** @type {any} */ a, a; } -var _f = { value: () => { +var gf = { value: () => { } }; function Uo() { - for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { - if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); + 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 _i(n); } -function _i(e) { - this._ = e; +function _i(t) { + this._ = t; } -function mf(e, t) { - return e.trim().split(/^|\s+/).map(function(n) { +function _f(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 && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); + 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 }; }); } _i.prototype = Uo.prototype = { constructor: _i, - on: function(e, t) { - var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; + on: function(t, e) { + var n = this._, r = _f(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = mf(n[i], t.name))) return i; return; } - if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); + if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (e = r[s]).type) n[i] = Aa(n[i], e.name, t); - else if (t == null) for (i in n) n[i] = Aa(n[i], e.name, null); + if (i = (t = r[s]).type) n[i] = Aa(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = Aa(n[i], t.name, null); return this; }, copy: function() { - var e = {}, t = this._; - for (var n in t) e[n] = t[n].slice(); - return new _i(e); + var t = {}, e = this._; + for (var n in e) t[n] = e[n].slice(); + return new _i(t); }, - call: function(e, t) { + call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); }, - apply: function(e, t, n) { - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); + apply: function(t, e, n) { + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function yf(e, t) { - for (var n = 0, r = e.length, i; n < r; ++n) - if ((i = e[n]).name === t) +function mf(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) return i.value; } -function Aa(e, t, n) { - for (var r = 0, i = e.length; r < i; ++r) - if (e[r].name === t) { - e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); +function Aa(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = gf, t = t.slice(0, r).concat(t.slice(r + 1)); break; } - return n != null && e.push({ name: t, value: n }), e; + return n != null && t.push({ name: e, value: n }), t; } var xs = "http://www.w3.org/1999/xhtml"; const Ea = { @@ -2982,486 +2982,486 @@ const Ea = { xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Wi(e) { - var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ea.hasOwnProperty(t) ? { space: Ea[t], local: e } : e; +function Wi(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ea.hasOwnProperty(e) ? { space: Ea[e], local: t } : t; } -function wf(e) { +function yf(t) { return function() { - var t = this.ownerDocument, n = this.namespaceURI; - return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); + var e = this.ownerDocument, n = this.namespaceURI; + return n === xs && e.documentElement.namespaceURI === xs ? e.createElement(t) : e.createElementNS(n, t); }; } -function xf(e) { +function wf(t) { return function() { - return this.ownerDocument.createElementNS(e.space, e.local); + return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Go(e) { - var t = Wi(e); - return (t.local ? xf : wf)(t); +function Go(t) { + var e = Wi(t); + return (e.local ? wf : yf)(e); } -function bf() { +function xf() { } -function Bs(e) { - return e == null ? bf : function() { - return this.querySelector(e); +function Bs(t) { + return t == null ? xf : function() { + return this.querySelector(t); }; } -function $f(e) { - typeof e != "function" && (e = Bs(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new at(r, this._parents); +function bf(t) { + typeof t != "function" && (t = Bs(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new ie(r, this._parents); } -function Af(e) { - return e == null ? [] : Array.isArray(e) ? e : Array.from(e); +function $f(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Ef() { +function Af() { return []; } -function Ko(e) { - return e == null ? Ef : function() { - return this.querySelectorAll(e); +function Ko(t) { + return t == null ? Af : function() { + return this.querySelectorAll(t); }; } -function Tf(e) { +function Ef(t) { return function() { - return Af(e.apply(this, arguments)); + return $f(t.apply(this, arguments)); }; } -function Cf(e) { - typeof e == "function" ? e = Tf(e) : e = Ko(e); - for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); - return new at(r, i); +function Tf(t) { + typeof t == "function" ? t = Ef(t) : t = Ko(t); + for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); + return new ie(r, i); } -function jo(e) { +function jo(t) { return function() { - return this.matches(e); + return this.matches(t); }; } -function Jo(e) { - return function(t) { - return t.matches(e); +function Jo(t) { + return function(e) { + return e.matches(t); }; } -var Rf = Array.prototype.find; -function Sf(e) { +var Cf = Array.prototype.find; +function Rf(t) { return function() { - return Rf.call(this.children, e); + return Cf.call(this.children, t); }; } -function Nf() { +function Sf() { return this.firstElementChild; } -function kf(e) { - return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : Jo(e))); +function Nf(t) { + return this.select(t == null ? Sf : Rf(typeof t == "function" ? t : Jo(t))); } -var Mf = Array.prototype.filter; -function Pf() { +var kf = Array.prototype.filter; +function Mf() { return Array.from(this.children); } -function Df(e) { +function Pf(t) { return function() { - return Mf.call(this.children, e); + return kf.call(this.children, t); }; } -function Of(e) { - return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : Jo(e))); +function Df(t) { + return this.selectAll(t == null ? Mf : Pf(typeof t == "function" ? t : Jo(t))); } -function Ff(e) { - typeof e != "function" && (e = jo(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); - return new at(r, this._parents); +function Of(t) { + typeof t != "function" && (t = jo(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); + return new ie(r, this._parents); } -function Zo(e) { - return new Array(e.length); +function Zo(t) { + return new Array(t.length); } function If() { - return new at(this._enter || this._groups.map(Zo), this._parents); + return new ie(this._enter || this._groups.map(Zo), this._parents); } -function Ei(e, t) { - this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; +function Ei(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ei.prototype = { constructor: Ei, - appendChild: function(e) { - return this._parent.insertBefore(e, this._next); + appendChild: function(t) { + return this._parent.insertBefore(t, this._next); }, - insertBefore: function(e, t) { - return this._parent.insertBefore(e, t); + insertBefore: function(t, e) { + return this._parent.insertBefore(t, e); }, - querySelector: function(e) { - return this._parent.querySelector(e); + querySelector: function(t) { + return this._parent.querySelector(t); }, - querySelectorAll: function(e) { - return this._parent.querySelectorAll(e); + querySelectorAll: function(t) { + return this._parent.querySelectorAll(t); } }; -function Lf(e) { +function Ff(t) { return function() { - return e; + return t; }; } -function qf(e, t, n, r, i, s) { - for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) - (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(e, s[a]); +function Lf(t, e, n, r, i, s) { + for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(t, s[a]); for (; a < l; ++a) - (o = t[a]) && (i[a] = o); + (o = e[a]) && (i[a] = o); } -function Vf(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; +function qf(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) - (l = t[o]) && (c[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); - for (o = 0; o < p; ++o) - d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ei(e, s[o]); + (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); + for (o = 0; o < d; ++o) + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ei(t, s[o]); for (o = 0; o < f; ++o) - (l = t[o]) && u.get(c[o]) === l && (i[o] = l); + (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function zf(e) { - return e.__data__; +function Vf(t) { + return t.__data__; } -function Hf(e, t) { - if (!arguments.length) return Array.from(this, zf); - var n = t ? Vf : qf, r = this._parents, i = this._groups; - typeof e != "function" && (e = Lf(e)); +function zf(t, e) { + if (!arguments.length) return Array.from(this, Vf); + var n = e ? qf : Lf, r = this._parents, i = this._groups; + typeof t != "function" && (t = Ff(t)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], p = i[u], c = p.length, d = Yf(e.call(f, f && f.__data__, u, r)), y = d.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(c); - n(f, p, b, m, $, d, t); - for (var D = 0, M = 0, S, I; D < y; ++D) + var f = r[u], d = i[u], c = d.length, p = Hf(t.call(f, f && f.__data__, u, r)), y = p.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(c); + n(f, d, b, m, $, p, e); + for (var D = 0, M = 0, S, F; D < y; ++D) if (S = b[D]) { - for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; - S._next = I || null; + for (D >= M && (M = D + 1); !(F = m[M]) && ++M < y; ) ; + S._next = F || null; } } - return a = new at(a, r), a._enter = o, a._exit = l, a; + return a = new ie(a, r), a._enter = o, a._exit = l, a; } -function Yf(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Hf(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Bf() { - return new at(this._exit || this._groups.map(Zo), this._parents); +function Yf() { + return new ie(this._exit || this._groups.map(Zo), this._parents); } -function Xf(e, t, n) { +function Bf(t, e, n) { var r = this.enter(), i = this, s = this.exit(); - return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; + 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 ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Wf(e) { - for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) - for (var u = n[l], f = r[l], p = u.length, c = o[l] = new Array(p), d, y = 0; y < p; ++y) - (d = u[y] || f[y]) && (c[y] = d); +function Xf(t) { + for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) + for (var u = n[l], f = r[l], d = u.length, c = o[l] = new Array(d), p, y = 0; y < d; ++y) + (p = u[y] || f[y]) && (c[y] = p); for (; l < i; ++l) o[l] = n[l]; - return new at(o, this._parents); + return new ie(o, this._parents); } -function Uf() { - for (var e = this._groups, t = -1, n = e.length; ++t < n; ) - for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) +function Wf() { + for (var t = this._groups, e = -1, n = t.length; ++e < n; ) + for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function Gf(e) { - e || (e = Kf); - function t(p, c) { - return p && c ? e(p.__data__, c.__data__) : !p - !c; +function Uf(t) { + t || (t = Gf); + function e(d, c) { + return d && c ? t(d.__data__, c.__data__) : !d - !c; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); - l.sort(t); + l.sort(e); } - return new at(i, this._parents).order(); + return new ie(i, this._parents).order(); } -function Kf(e, t) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Gf(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function jf() { - var e = arguments[0]; - return arguments[0] = this, e.apply(null, arguments), this; +function Kf() { + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; } -function Jf() { +function jf() { return Array.from(this); } -function Zf() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], i = 0, s = r.length; i < s; ++i) { +function Jf() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; if (a) return a; } return null; } -function Qf() { - let e = 0; - for (const t of this) ++e; - return e; +function Zf() { + let t = 0; + for (const e of this) ++t; + return t; } -function ec() { +function Qf() { return !this.node(); } -function tc(e) { - for (var t = this._groups, n = 0, r = t.length; n < r; ++n) - for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && e.call(o, o.__data__, s, i); +function tc(t) { + for (var e = this._groups, n = 0, r = e.length; n < r; ++n) + for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function nc(e) { +function ec(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function rc(e) { +function nc(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function ic(e, t) { +function rc(t, e) { return function() { - this.setAttribute(e, t); + this.setAttribute(t, e); }; } -function sc(e, t) { +function ic(t, e) { return function() { - this.setAttributeNS(e.space, e.local, t); + this.setAttributeNS(t.space, t.local, e); }; } -function ac(e, t) { +function sc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttribute(e) : this.setAttribute(e, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function oc(e, t) { +function ac(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function lc(e, t) { - var n = Wi(e); +function oc(t, e) { + var n = Wi(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((t == null ? n.local ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); + return this.each((e == null ? n.local ? nc : ec : typeof e == "function" ? n.local ? ac : sc : n.local ? ic : rc)(n, e)); } -function Qo(e) { - return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; +function Qo(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function uc(e) { +function lc(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function fc(e, t, n) { +function uc(t, e, n) { return function() { - this.style.setProperty(e, t, n); + this.style.setProperty(t, e, n); }; } -function cc(e, t, n) { +function fc(t, e, n) { return function() { - var r = t.apply(this, arguments); - r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function hc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : gr(this.node(), e); +function cc(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? lc : typeof e == "function" ? fc : uc)(t, e, n ?? "")) : gr(this.node(), t); } -function gr(e, t) { - return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); +function gr(t, e) { + return t.style.getPropertyValue(e) || Qo(t).getComputedStyle(t, null).getPropertyValue(e); } -function dc(e) { +function hc(t) { return function() { - delete this[e]; + delete this[t]; }; } -function pc(e, t) { +function dc(t, e) { return function() { - this[e] = t; + this[t] = e; }; } -function vc(e, t) { +function pc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? delete this[e] : this[e] = n; + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; }; } -function gc(e, t) { - return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; +function vc(t, e) { + return arguments.length > 1 ? this.each((e == null ? hc : typeof e == "function" ? pc : dc)(t, e)) : this.node()[t]; } -function el(e) { - return e.trim().split(/^|\s+/); +function tl(t) { + return t.trim().split(/^|\s+/); } -function Xs(e) { - return e.classList || new tl(e); +function Xs(t) { + return t.classList || new el(t); } -function tl(e) { - this._node = e, this._names = el(e.getAttribute("class") || ""); +function el(t) { + this._node = t, this._names = tl(t.getAttribute("class") || ""); } -tl.prototype = { - add: function(e) { - var t = this._names.indexOf(e); - t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); +el.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(e) { - var t = this._names.indexOf(e); - t >= 0 && (this._names.splice(t, 1), 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(e) { - return this._names.indexOf(e) >= 0; + contains: function(t) { + return this._names.indexOf(t) >= 0; } }; -function nl(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); +function nl(t, e) { + for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function rl(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); +function rl(t, e) { + for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function _c(e) { +function gc(t) { return function() { - nl(this, e); + nl(this, t); }; } -function mc(e) { +function _c(t) { return function() { - rl(this, e); + rl(this, t); }; } -function yc(e, t) { +function mc(t, e) { return function() { - (t.apply(this, arguments) ? nl : rl)(this, e); + (e.apply(this, arguments) ? nl : rl)(this, t); }; } -function wc(e, t) { - var n = el(e + ""); +function yc(t, e) { + var n = tl(t + ""); if (arguments.length < 2) { for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof t == "function" ? yc : t ? _c : mc)(n, t)); + return this.each((typeof e == "function" ? mc : e ? gc : _c)(n, e)); } -function xc() { +function wc() { this.textContent = ""; } -function bc(e) { +function xc(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function $c(e) { +function bc(t) { return function() { - var t = e.apply(this, arguments); - this.textContent = t ?? ""; + var e = t.apply(this, arguments); + this.textContent = e ?? ""; }; } -function Ac(e) { - return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; +function $c(t) { + return arguments.length ? this.each(t == null ? wc : (typeof t == "function" ? bc : xc)(t)) : this.node().textContent; } -function Ec() { +function Ac() { this.innerHTML = ""; } -function Tc(e) { +function Ec(t) { return function() { - this.innerHTML = e; + this.innerHTML = t; }; } -function Cc(e) { +function Tc(t) { return function() { - var t = e.apply(this, arguments); - this.innerHTML = t ?? ""; + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; }; } -function Rc(e) { - return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; +function Cc(t) { + return arguments.length ? this.each(t == null ? Ac : (typeof t == "function" ? Tc : Ec)(t)) : this.node().innerHTML; } -function Sc() { +function Rc() { this.nextSibling && this.parentNode.appendChild(this); } -function Nc() { - return this.each(Sc); +function Sc() { + return this.each(Rc); } -function kc() { +function Nc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Mc() { - return this.each(kc); +function kc() { + return this.each(Nc); } -function Pc(e) { - var t = typeof e == "function" ? e : Go(e); +function Mc(t) { + var e = typeof t == "function" ? t : Go(t); return this.select(function() { - return this.appendChild(t.apply(this, arguments)); + return this.appendChild(e.apply(this, arguments)); }); } -function Dc() { +function Pc() { return null; } -function Oc(e, t) { - var n = typeof e == "function" ? e : Go(e), r = t == null ? Dc : typeof t == "function" ? t : Bs(t); +function Dc(t, e) { + var n = typeof t == "function" ? t : Go(t), r = e == null ? Pc : typeof e == "function" ? e : Bs(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Fc() { - var e = this.parentNode; - e && e.removeChild(this); +function Oc() { + var t = this.parentNode; + t && t.removeChild(this); } function Ic() { - return this.each(Fc); + return this.each(Oc); } -function Lc() { - var e = this.cloneNode(!1), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; +function Fc() { + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } -function qc() { - var e = this.cloneNode(!0), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; +function Lc() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } -function Vc(e) { - return this.select(e ? qc : Lc); +function qc(t) { + return this.select(t ? Lc : Fc); } -function zc(e) { - return arguments.length ? this.property("__data__", e) : this.node().__data__; +function Vc(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function Hc(e) { - return function(t) { - e.call(this, t, this.__data__); +function zc(t) { + return function(e) { + t.call(this, e, this.__data__); }; } -function Yc(e) { - return e.trim().split(/^|\s+/).map(function(t) { - var n = "", r = t.indexOf("."); - return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; +function Hc(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 Bc(e) { +function Yc(t) { return function() { - var t = this.__on; - if (t) { - for (var n = 0, r = -1, i = t.length, s; n < i; ++n) - s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; - ++r ? t.length = r : delete this.__on; + var e = this.__on; + if (e) { + for (var n = 0, r = -1, i = e.length, s; n < i; ++n) + s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; + ++r ? e.length = r : delete this.__on; } }; } -function Xc(e, t, n) { +function Bc(t, e, n) { return function() { - var r = this.__on, i, s = Hc(t); + var r = this.__on, i, s = zc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === e.type && i.name === e.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; + if ((i = r[a]).type === t.type && i.name === t.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; return; } } - this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Wc(e, t, n) { - var r = Yc(e + ""), i, s = r.length, a; +function Xc(t, e, n) { + var r = Hc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Wc(e, t, n) { } return; } - for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = e ? Bc : Yc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function il(e, t, n) { - var r = Qo(e), i = r.CustomEvent; - typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); +function il(t, e, n) { + var r = Qo(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 Uc(e, t) { +function Wc(t, e) { return function() { - return il(this, e, t); + return il(this, t, e); }; } -function Gc(e, t) { +function Uc(t, e) { return function() { - return il(this, e, t.apply(this, arguments)); + return il(this, t, e.apply(this, arguments)); }; } -function Kc(e, t) { - return this.each((typeof t == "function" ? Gc : Uc)(e, t)); +function Gc(t, e) { + return this.each((typeof e == "function" ? Uc : Wc)(t, e)); } -function* jc() { - for (var e = this._groups, t = 0, n = e.length; t < n; ++t) - for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) +function* Kc() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } var sl = [null]; -function at(e, t) { - this._groups = e, this._parents = t; +function ie(t, e) { + this._groups = t, this._parents = e; } function wr() { - return new at([[document.documentElement]], sl); + return new ie([[document.documentElement]], sl); } -function Jc() { +function jc() { return this; } -at.prototype = wr.prototype = { - constructor: at, - select: $f, - selectAll: Cf, - selectChild: kf, - selectChildren: Of, - filter: Ff, - data: Hf, +ie.prototype = wr.prototype = { + constructor: ie, + select: bf, + selectAll: Tf, + selectChild: Nf, + selectChildren: Df, + filter: Of, + data: zf, enter: If, - exit: Bf, - join: Xf, - merge: Wf, - selection: Jc, - order: Uf, - sort: Gf, - call: jf, - nodes: Jf, - node: Zf, - size: Qf, - empty: ec, + exit: Yf, + join: Bf, + merge: Xf, + selection: jc, + order: Wf, + sort: Uf, + call: Kf, + nodes: jf, + node: Jf, + size: Zf, + empty: Qf, each: tc, - attr: lc, - style: hc, - property: gc, - classed: wc, - text: Ac, - html: Rc, - raise: Nc, - lower: Mc, - append: Pc, - insert: Oc, + attr: oc, + style: cc, + property: vc, + classed: yc, + text: $c, + html: Cc, + raise: Sc, + lower: kc, + append: Mc, + insert: Dc, remove: Ic, - clone: Vc, - datum: zc, - on: Wc, - dispatch: Kc, - [Symbol.iterator]: jc + clone: qc, + datum: Vc, + on: Xc, + dispatch: Gc, + [Symbol.iterator]: Kc }; -function fe(e) { - return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], sl); +function ft(t) { + return typeof t == "string" ? new ie([[document.querySelector(t)]], [document.documentElement]) : new ie([[t]], sl); } -function Ws(e, t, n) { - e.prototype = t.prototype = n, n.constructor = e; +function Ws(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; } -function al(e, t) { - var n = Object.create(e.prototype); - for (var r in t) n[r] = t[r]; +function al(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; return n; } -function Kr() { +function Gr() { } -var Lr = 0.7, Ti = 1 / Lr, tr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Lt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`), eh = new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`), th = new RegExp(`^rgba\\(${tr},${tr},${tr},${qr}\\)$`), nh = new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${qr}\\)$`), rh = new RegExp(`^hsl\\(${qr},${Lt},${Lt}\\)$`), ih = new RegExp(`^hsla\\(${qr},${Lt},${Lt},${qr}\\)$`), Ta = { +var Fr = 0.7, Ti = 1 / Fr, er = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Jc = /^#([0-9a-f]{3,8})$/, Zc = new RegExp(`^rgb\\(${er},${er},${er}\\)$`), Qc = new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`), th = new RegExp(`^rgba\\(${er},${er},${er},${Lr}\\)$`), eh = new RegExp(`^rgba\\(${qe},${qe},${qe},${Lr}\\)$`), nh = new RegExp(`^hsl\\(${Lr},${qe},${qe}\\)$`), rh = new RegExp(`^hsla\\(${Lr},${qe},${qe},${Lr}\\)$`), Ta = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,9 +3708,9 @@ var Lr = 0.7, Ti = 1 / Lr, tr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ws(Kr, Gn, { - copy(e) { - return Object.assign(new this.constructor(), this, e); +Ws(Gr, Gn, { + copy(t) { + return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); @@ -3718,54 +3718,54 @@ Ws(Kr, Gn, { hex: Ca, // Deprecated! Use color.formatHex. formatHex: Ca, - formatHex8: sh, - formatHsl: ah, + formatHex8: ih, + formatHsl: sh, formatRgb: Ra, toString: Ra }); function Ca() { return this.rgb().formatHex(); } -function sh() { +function ih() { return this.rgb().formatHex8(); } -function ah() { +function sh() { return ol(this).formatHsl(); } function Ra() { return this.rgb().formatRgb(); } -function Gn(e) { - var t, n; - return e = (e + "").trim().toLowerCase(), (t = Zc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Sa(t) : n === 3 ? new Je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, t[4]) : Ta.hasOwnProperty(e) ? Sa(Ta[e]) : e === "transparent" ? new Je(NaN, NaN, NaN, 0) : null; +function Gn(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = Jc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sa(e) : n === 3 ? new Kt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ai(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ai(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 = Zc.exec(t)) ? new Kt(e[1], e[2], e[3], 1) : (e = Qc.exec(t)) ? new Kt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = th.exec(t)) ? ai(e[1], e[2], e[3], e[4]) : (e = eh.exec(t)) ? ai(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = nh.exec(t)) ? Ma(e[1], e[2] / 100, e[3] / 100, 1) : (e = rh.exec(t)) ? Ma(e[1], e[2] / 100, e[3] / 100, e[4]) : Ta.hasOwnProperty(t) ? Sa(Ta[t]) : t === "transparent" ? new Kt(NaN, NaN, NaN, 0) : null; } -function Sa(e) { - return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); +function Sa(t) { + return new Kt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function ai(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); +function ai(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Kt(t, e, n, r); } -function oh(e) { - return e instanceof Kr || (e = Gn(e)), e ? (e = e.rgb(), new Je(e.r, e.g, e.b, e.opacity)) : new Je(); +function ah(t) { + return t instanceof Gr || (t = Gn(t)), t ? (t = t.rgb(), new Kt(t.r, t.g, t.b, t.opacity)) : new Kt(); } -function bs(e, t, n, r) { - return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); +function bs(t, e, n, r) { + return arguments.length === 1 ? ah(t) : new Kt(t, e, n, r ?? 1); } -function Je(e, t, n, r) { - this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; +function Kt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ws(Je, bs, al(Kr, { - brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); +Ws(Kt, bs, al(Gr, { + brighter(t) { + return t = t == null ? Ti : Math.pow(Ti, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); + darker(t) { + return t = t == null ? Fr : Math.pow(Fr, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Je(Xn(this.r), Xn(this.g), Xn(this.b), Ci(this.opacity)); + return new Kt(Xn(this.r), Xn(this.g), Xn(this.b), Ci(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; @@ -3773,176 +3773,176 @@ Ws(Je, bs, al(Kr, { hex: Na, // Deprecated! Use color.formatHex. formatHex: Na, - formatHex8: lh, + formatHex8: oh, formatRgb: ka, toString: ka })); function Na() { return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function lh() { +function oh() { return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function ka() { - const e = Ci(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; + const t = Ci(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Ci(e) { - return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); +function Ci(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Xn(e) { - return Math.max(0, Math.min(255, Math.round(e) || 0)); +function Xn(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function On(e) { - return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); +function On(t) { + return t = Xn(t), (t < 16 ? "0" : "") + t.toString(16); } -function Ma(e, t, n, r) { - return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new wt(e, t, n, r); +function Ma(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new be(t, e, n, r); } -function ol(e) { - if (e instanceof wt) return new wt(e.h, e.s, e.l, e.opacity); - if (e instanceof Kr || (e = Gn(e)), !e) return new wt(); - if (e instanceof wt) return e; - e = e.rgb(); - var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new wt(a, o, l, e.opacity); +function ol(t) { + if (t instanceof be) return new be(t.h, t.s, t.l, t.opacity); + if (t instanceof Gr || (t = Gn(t)), !t) return new be(); + if (t instanceof be) return t; + t = t.rgb(); + var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new be(a, o, l, t.opacity); } -function uh(e, t, n, r) { - return arguments.length === 1 ? ol(e) : new wt(e, t, n, r ?? 1); +function lh(t, e, n, r) { + return arguments.length === 1 ? ol(t) : new be(t, e, n, r ?? 1); } -function wt(e, t, n, r) { - this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; +function be(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ws(wt, uh, al(Kr, { - brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new wt(this.h, this.s, this.l * e, this.opacity); +Ws(be, lh, al(Gr, { + brighter(t) { + return t = t == null ? Ti : Math.pow(Ti, t), new be(this.h, this.s, this.l * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new wt(this.h, this.s, this.l * e, this.opacity); + darker(t) { + return t = t == null ? Fr : Math.pow(Fr, t), new be(this.h, this.s, this.l * t, this.opacity); }, rgb() { - var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; - return new Je( - rs(e >= 240 ? e - 240 : e + 120, i, r), - rs(e, i, r), - rs(e < 120 ? e + 240 : e - 120, i, r), + 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 Kt( + rs(t >= 240 ? t - 240 : t + 120, i, r), + rs(t, i, r), + rs(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new wt(Pa(this.h), oi(this.s), oi(this.l), Ci(this.opacity)); + return new be(Pa(this.h), oi(this.s), oi(this.l), Ci(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { - const e = Ci(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const t = Ci(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function Pa(e) { - return e = (e || 0) % 360, e < 0 ? e + 360 : e; +function Pa(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function oi(e) { - return Math.max(0, Math.min(1, e || 0)); +function oi(t) { + return Math.max(0, Math.min(1, t || 0)); } -function rs(e, t, n) { - return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; +function rs(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 Us = (e) => () => e; -function fh(e, t) { +const Us = (t) => () => t; +function uh(t, e) { return function(n) { - return e + n * t; + return t + n * e; }; } -function ch(e, t, n) { - return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { - return Math.pow(e + r * t, n); +function fh(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 hh(e) { - return (e = +e) == 1 ? ll : function(t, n) { - return n - t ? ch(t, n, e) : Us(isNaN(t) ? n : t); +function ch(t) { + return (t = +t) == 1 ? ll : function(e, n) { + return n - e ? fh(e, n, t) : Us(isNaN(e) ? n : e); }; } -function ll(e, t) { - var n = t - e; - return n ? fh(e, n) : Us(isNaN(e) ? t : e); +function ll(t, e) { + var n = e - t; + return n ? uh(t, n) : Us(isNaN(t) ? e : t); } -const Ri = (function e(t) { - var n = hh(t); +const Ri = (function t(e) { + var n = ch(e); function r(i, s) { var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ll(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } - return r.gamma = e, r; + return r.gamma = t, r; })(1); -function dh(e, t) { - t || (t = []); - var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; +function hh(t, e) { + e || (e = []); + var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; + for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; return r; }; } -function ph(e) { - return ArrayBuffer.isView(e) && !(e instanceof DataView); +function dh(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function vh(e, t) { - var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Zt(e[a], t[a]); - for (; a < n; ++a) s[a] = t[a]; +function ph(t, e) { + var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = Ze(t[a], e[a]); + for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function gh(e, t) { +function vh(t, e) { var n = /* @__PURE__ */ new Date(); - return e = +e, t = +t, function(r) { - return n.setTime(e * (1 - r) + t * r), n; + return t = +t, e = +e, function(r) { + return n.setTime(t * (1 - r) + e * r), n; }; } -function It(e, t) { - return e = +e, t = +t, function(n) { - return e * (1 - n) + t * n; +function Le(t, e) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; }; } -function _h(e, t) { +function gh(t, e) { var n = {}, r = {}, i; - (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); - for (i in t) - i in e ? n[i] = Zt(e[i], t[i]) : r[i] = t[i]; + (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); + for (i in e) + i in t ? n[i] = Ze(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function mh(e) { +function _h(t) { return function() { - return e; + return t; }; } -function yh(e) { - return function(t) { - return e(t) + ""; +function mh(t) { + return function(e) { + return t(e) + ""; }; } -function ul(e, t) { +function ul(t, e) { var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (e = e + "", t = t + ""; (r = $s.exec(e)) && (i = is.exec(t)); ) - (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: It(r, i) })), n = is.lastIndex; - return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? yh(l[0].x) : mh(t) : (t = l.length, function(u) { - for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); + for (t = t + "", e = e + ""; (r = $s.exec(t)) && (i = is.exec(e)); ) + (s = i.index) > n && (s = e.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Le(r, i) })), n = is.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? mh(l[0].x) : _h(e) : (e = l.length, function(u) { + for (var f = 0, d; f < e; ++f) o[(d = l[f]).i] = d.x(u); return o.join(""); }); } -function Zt(e, t) { - var n = typeof t, r; - return t == null || n === "boolean" ? Us(t) : (n === "number" ? It : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : ul : t instanceof Gn ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); +function Ze(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? Us(e) : (n === "number" ? Le : n === "string" ? (r = Gn(e)) ? (e = r, Ri) : ul : e instanceof Gn ? Ri : e instanceof Date ? vh : dh(e) ? hh : Array.isArray(e) ? ph : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? gh : Le)(t, e); } var Da = 180 / Math.PI, As = { translateX: 0, @@ -3952,62 +3952,62 @@ var Da = 180 / Math.PI, As = { scaleX: 1, scaleY: 1 }; -function fl(e, t, n, r, i, s) { +function fl(t, e, n, r, i, s) { var a, o, l; - return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(t, e) * Da, + rotate: Math.atan2(e, t) * Da, skewX: Math.atan(l) * Da, scaleX: a, scaleY: o }; } var li; -function wh(e) { - const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? As : fl(t.a, t.b, t.c, t.d, t.e, t.f); +function yh(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? As : fl(e.a, e.b, e.c, e.d, e.e, e.f); } -function xh(e) { - return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.f)); +function wh(t) { + return t == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", t), !(t = li.transform.baseVal.consolidate())) ? As : (t = t.matrix, fl(t.a, t.b, t.c, t.d, t.e, t.f)); } -function cl(e, t, n, r) { +function cl(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, p, c, d, y) { - if (u !== p || f !== c) { - var b = d.push("translate(", null, t, null, n); - y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); - } else (p || c) && d.push("translate(" + p + t + c + n); + function s(u, f, d, c, p, y) { + if (u !== d || f !== c) { + var b = p.push("translate(", null, e, null, n); + y.push({ i: b - 4, x: Le(u, d) }, { i: b - 2, x: Le(f, c) }); + } else (d || c) && p.push("translate(" + d + e + c + n); } - function a(u, f, p, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + function a(u, f, d, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Le(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); } - function o(u, f, p, c) { - u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + function o(u, f, d, c) { + u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Le(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); } - function l(u, f, p, c, d, y) { - if (u !== p || f !== c) { - var b = d.push(i(d) + "scale(", null, ",", null, ")"); - y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); - } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); + function l(u, f, d, c, p, y) { + if (u !== d || f !== c) { + var b = p.push(i(p) + "scale(", null, ",", null, ")"); + y.push({ i: b - 4, x: Le(u, d) }, { i: b - 2, x: Le(f, c) }); + } else (d !== 1 || c !== 1) && p.push(i(p) + "scale(" + d + "," + c + ")"); } return function(u, f) { - var p = [], c = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { - for (var y = -1, b = c.length, m; ++y < b; ) p[(m = c[y]).i] = m.x(d); - return p.join(""); + var d = [], c = []; + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, c), a(u.rotate, f.rotate, d, c), o(u.skewX, f.skewX, d, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, c), u = f = null, function(p) { + for (var y = -1, b = c.length, m; ++y < b; ) d[(m = c[y]).i] = m.x(p); + return d.join(""); }; }; } -var bh = cl(wh, "px, ", "px)", "deg)"), $h = cl(xh, ", ", ")", ")"), _r = 0, Nr = 0, Rr = 0, hl = 1e3, Si, kr, Ni = 0, Kn = 0, Ui = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { - setTimeout(e, 17); +var xh = cl(yh, "px, ", "px)", "deg)"), bh = cl(wh, ", ", ")", ")"), _r = 0, Sr = 0, Cr = 0, hl = 1e3, Si, Nr, Ni = 0, Kn = 0, Ui = 0, qr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); }; function Gs() { - return Kn || (dl(Ah), Kn = Vr.now() + Ui); + return Kn || (dl($h), Kn = qr.now() + Ui); } -function Ah() { +function $h() { Kn = 0; } function ki() { @@ -4015,67 +4015,67 @@ function ki() { } ki.prototype = pl.prototype = { constructor: ki, - restart: function(e, t, n) { - if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Si = this, kr = this), this._call = e, this._time = n, Es(); + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Gs() : +n) + (e == null ? 0 : +e), !this._next && Nr !== this && (Nr ? Nr._next = this : Si = this, Nr = this), this._call = t, this._time = n, Es(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function pl(e, t, n) { +function pl(t, e, n) { var r = new ki(); - return r.restart(e, t, n), r; + return r.restart(t, e, n), r; } -function Eh() { +function Ah() { Gs(), ++_r; - for (var e = Si, t; e; ) - (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + for (var t = Si, e; t; ) + (e = Kn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --_r; } function Oa() { - Kn = (Ni = Vr.now()) + Ui, _r = Nr = 0; + Kn = (Ni = qr.now()) + Ui, _r = Sr = 0; try { - Eh(); + Ah(); } finally { - _r = 0, Ch(), Kn = 0; + _r = 0, Th(), Kn = 0; } } -function Th() { - var e = Vr.now(), t = e - Ni; - t > hl && (Ui -= t, Ni = e); +function Eh() { + var t = qr.now(), e = t - Ni; + e > hl && (Ui -= e, Ni = t); } -function Ch() { - for (var e, t = Si, n, r = 1 / 0; t; ) - t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Si = n); - kr = e, Es(r); +function Th() { + for (var t, e = Si, 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 : Si = n); + Nr = t, Es(r); } -function Es(e) { +function Es(t) { if (!_r) { - Nr && (Nr = clearTimeout(Nr)); - var t = e - Kn; - t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Ui)), Rr && (Rr = clearInterval(Rr))) : (Rr || (Ni = Vr.now(), Rr = setInterval(Th, hl)), _r = 1, dl(Oa)); + Sr && (Sr = clearTimeout(Sr)); + var e = t - Kn; + e > 24 ? (t < 1 / 0 && (Sr = setTimeout(Oa, t - qr.now() - Ui)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Ni = qr.now(), Cr = setInterval(Eh, hl)), _r = 1, dl(Oa)); } } -function Fa(e, t, n) { +function Ia(t, e, n) { var r = new ki(); - return t = t == null ? 0 : +t, r.restart((i) => { - r.stop(), e(i + t); - }, t, n), r; -} -var Rh = Uo("start", "end", "cancel", "interrupt"), Sh = [], vl = 0, Ia = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; -function Gi(e, t, n, r, i, s) { - var a = e.__transition; - if (!a) e.__transition = {}; + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; +} +var Ch = Uo("start", "end", "cancel", "interrupt"), Rh = [], vl = 0, Fa = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; +function Gi(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; else if (n in a) return; - Nh(e, n, { - name: t, + Sh(t, n, { + name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Rh, - tween: Sh, + on: Ch, + tween: Rh, time: s.time, delay: s.delay, duration: s.duration, @@ -4084,81 +4084,81 @@ function Gi(e, t, n, r, i, s) { state: vl }); } -function Ks(e, t) { - var n = Et(e, t); +function Ks(t, e) { + var n = Ce(t, e); if (n.state > vl) throw new Error("too late; already scheduled"); return n; } -function Bt(e, t) { - var n = Et(e, t); +function Xe(t, e) { + var n = Ce(t, e); if (n.state > mi) throw new Error("too late; already running"); return n; } -function Et(e, t) { - var n = e.__transition; - if (!n || !(n = n[t])) throw new Error("transition not found"); +function Ce(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Nh(e, t, n) { - var r = e.__transition, i; - r[t] = n, n.timer = pl(s, 0, n.time); +function Sh(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = pl(s, 0, n.time); function s(u) { - n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Fa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, p, c, d; - if (n.state !== Ia) return l(); + var f, d, c, p; + if (n.state !== Fa) return l(); for (f in r) - if (d = r[f], d.name === n.name) { - if (d.state === mi) return Fa(a); - d.state === La ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); + if (p = r[f], p.name === n.name) { + if (p.state === mi) return Ia(a); + p.state === La ? (p.state = yi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = yi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if (Fa(function() { + if (Ia(function() { n.state === mi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Ts, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Ts) { - for (n.state = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) - (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); - i.length = p + 1; + }), n.state = Ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ts) { + for (n.state = mi, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) + (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = p); + i.length = d + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), p = -1, c = i.length; ++p < c; ) - i[p].call(e, f); - n.state === Cs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), d = -1, c = i.length; ++d < c; ) + i[d].call(t, f); + n.state === Cs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = yi, n.timer.stop(), delete r[t]; + n.state = yi, n.timer.stop(), delete r[e]; for (var u in r) return; - delete e.__transition; + delete t.__transition; } } -function kh(e, t) { - var n = e.__transition, r, i, s = !0, a; +function Nh(t, e) { + var n = t.__transition, r, i, s = !0, a; if (n) { - t = t == null ? null : t + ""; + e = e == null ? null : e + ""; for (a in n) { - if ((r = n[a]).name !== t) { + if ((r = n[a]).name !== e) { s = !1; continue; } - i = r.state > Ts && r.state < Cs, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Cs, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } - s && delete e.__transition; + s && delete t.__transition; } } -function Mh(e) { +function kh(t) { return this.each(function() { - kh(this, e); + Nh(this, t); }); } -function Ph(e, t) { +function Mh(t, e) { var n, r; return function() { - var i = Bt(this, e), s = i.tween; + var i = Xe(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === t) { + if (r[a].name === e) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Ph(e, t) { i.tween = r; }; } -function Dh(e, t, n) { +function Ph(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Bt(this, e), a = s.tween; + var s = Xe(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === t) { + for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === e) { i[l] = o; break; } @@ -4183,599 +4183,599 @@ function Dh(e, t, n) { s.tween = i; }; } -function Oh(e, t) { +function Dh(t, e) { var n = this._id; - if (e += "", arguments.length < 2) { - for (var r = Et(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === e) + if (t += "", arguments.length < 2) { + for (var r = Ce(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === t) return a.value; return null; } - return this.each((t == null ? Ph : Dh)(n, e, t)); + return this.each((e == null ? Mh : Ph)(n, t, e)); } -function js(e, t, n) { - var r = e._id; - return e.each(function() { - var i = Bt(this, r); - (i.value || (i.value = {}))[t] = n.apply(this, arguments); +function js(t, e, n) { + var r = t._id; + return t.each(function() { + var i = Xe(this, r); + (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Et(i, r).value[t]; + return Ce(i, r).value[e]; }; } -function gl(e, t) { +function gl(t, e) { var n; - return (typeof t == "number" ? It : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : ul)(e, t); + return (typeof e == "number" ? Le : e instanceof Gn ? Ri : (n = Gn(e)) ? (e = n, Ri) : ul)(t, e); } -function Fh(e) { +function Oh(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function Ih(e) { +function Ih(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function Lh(e, t, n) { +function Fh(t, e, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(e); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = this.getAttribute(t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function qh(e, t, n) { +function Lh(t, e, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(e.space, e.local); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = this.getAttributeNS(t.space, t.local); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Vh(e, t, n) { +function qh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); + return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function zh(e, t, n) { +function Vh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); + return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function Hh(e, t) { - var n = Wi(e), r = n === "transform" ? $h : gl; - return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Ih : Fh)(n) : (n.local ? qh : Lh)(n, r, t)); +function zh(t, e) { + var n = Wi(t), r = n === "transform" ? bh : gl; + return this.attrTween(t, typeof e == "function" ? (n.local ? Vh : qh)(n, r, js(this, "attr." + t, e)) : e == null ? (n.local ? Ih : Oh)(n) : (n.local ? Lh : Fh)(n, r, e)); } -function Yh(e, t) { +function Hh(t, e) { return function(n) { - this.setAttribute(e, t.call(this, n)); + this.setAttribute(t, e.call(this, n)); }; } -function Bh(e, t) { +function Yh(t, e) { return function(n) { - this.setAttributeNS(e.space, e.local, t.call(this, n)); + this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Xh(e, t) { +function Bh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Bh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Yh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Wh(e, t) { +function Xh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Yh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Hh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Uh(e, t) { - var n = "attr." + e; +function Wh(t, e) { + var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; - if (t == null) return this.tween(n, null); - if (typeof t != "function") throw new Error(); - var r = Wi(e); - return this.tween(n, (r.local ? Xh : Wh)(r, t)); + if (e == null) return this.tween(n, null); + if (typeof e != "function") throw new Error(); + var r = Wi(t); + return this.tween(n, (r.local ? Bh : Xh)(r, e)); } -function Gh(e, t) { +function Uh(t, e) { return function() { - Ks(this, e).delay = +t.apply(this, arguments); + Ks(this, t).delay = +e.apply(this, arguments); }; } -function Kh(e, t) { - return t = +t, function() { - Ks(this, e).delay = t; +function Gh(t, e) { + return e = +e, function() { + Ks(this, t).delay = e; }; } -function jh(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Et(this.node(), t).delay; +function Kh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Uh : Gh)(e, t)) : Ce(this.node(), e).delay; } -function Jh(e, t) { +function jh(t, e) { return function() { - Bt(this, e).duration = +t.apply(this, arguments); + Xe(this, t).duration = +e.apply(this, arguments); }; } -function Zh(e, t) { - return t = +t, function() { - Bt(this, e).duration = t; +function Jh(t, e) { + return e = +e, function() { + Xe(this, t).duration = e; }; } -function Qh(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Et(this.node(), t).duration; +function Zh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? jh : Jh)(e, t)) : Ce(this.node(), e).duration; } -function ed(e, t) { - if (typeof t != "function") throw new Error(); +function Qh(t, e) { + if (typeof e != "function") throw new Error(); return function() { - Bt(this, e).ease = t; + Xe(this, t).ease = e; }; } -function td(e) { - var t = this._id; - return arguments.length ? this.each(ed(t, e)) : Et(this.node(), t).ease; +function td(t) { + var e = this._id; + return arguments.length ? this.each(Qh(e, t)) : Ce(this.node(), e).ease; } -function nd(e, t) { +function ed(t, e) { return function() { - var n = t.apply(this, arguments); + var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Bt(this, e).ease = n; + Xe(this, t).ease = n; }; } -function rd(e) { - if (typeof e != "function") throw new Error(); - return this.each(nd(this._id, e)); +function nd(t) { + if (typeof t != "function") throw new Error(); + return this.each(ed(this._id, t)); } -function id(e) { - typeof e != "function" && (e = jo(e)); - for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); +function rd(t) { + typeof t != "function" && (t = jo(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); return new cn(r, this._parents, this._name, this._id); } -function sd(e) { - if (e._id !== this._id) throw new Error(); - for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), c, d = 0; d < f; ++d) - (c = l[d] || u[d]) && (p[d] = c); +function id(t) { + if (t._id !== this._id) throw new Error(); + for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = e[o], u = n[o], f = l.length, d = a[o] = new Array(f), c, p = 0; p < f; ++p) + (c = l[p] || u[p]) && (d[p] = c); for (; o < r; ++o) - a[o] = t[o]; + a[o] = e[o]; return new cn(a, this._parents, this._name, this._id); } -function ad(e) { - return (e + "").trim().split(/^|\s+/).every(function(t) { - var n = t.indexOf("."); - return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; +function sd(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 od(e, t, n) { - var r, i, s = ad(t) ? Ks : Bt; +function ad(t, e, n) { + var r, i, s = sd(e) ? Ks : Xe; return function() { - var a = s(this, e), o = a.on; - o !== r && (i = (r = o).copy()).on(t, n), a.on = i; + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function ld(e, t) { +function od(t, e) { var n = this._id; - return arguments.length < 2 ? Et(this.node(), n).on.on(e) : this.each(od(n, e, t)); + return arguments.length < 2 ? Ce(this.node(), n).on.on(t) : this.each(ad(n, t, e)); } -function ud(e) { +function ld(t) { return function() { - var t = this.parentNode; - for (var n in this.__transition) if (+n !== e) return; - t && t.removeChild(this); + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); }; } -function fd() { - return this.on("end.remove", ud(this._id)); +function ud() { + return this.on("end.remove", ld(this._id)); } -function cd(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Bs(e)); +function fd(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Bs(t)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, c = 0; c < l; ++c) - (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Et(f, n))); - return new cn(s, this._parents, t, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, d, c = 0; c < l; ++c) + (f = o[c]) && (d = t.call(f, f.__data__, c, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[c] = d, Gi(u[c], e, n, c, u, Ce(f, n))); + return new cn(s, this._parents, e, n); } -function hd(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Ko(e)); +function cd(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Ko(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) - if (f = l[p]) { - for (var c = e.call(f, f.__data__, p, l), d, y = Et(f, n), b = 0, m = c.length; b < m; ++b) - (d = c[b]) && Gi(d, t, n, b, c, y); + for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) + if (f = l[d]) { + for (var c = t.call(f, f.__data__, d, l), p, y = Ce(f, n), b = 0, m = c.length; b < m; ++b) + (p = c[b]) && Gi(p, e, n, b, c, y); s.push(c), a.push(f); } - return new cn(s, a, t, n); + return new cn(s, a, e, n); } -var dd = wr.prototype.constructor; -function pd() { - return new dd(this._groups, this._parents); +var hd = wr.prototype.constructor; +function dd() { + return new hd(this._groups, this._parents); } -function vd(e, t) { +function pd(t, e) { var n, r, i; return function() { - var s = gr(this, e), a = (this.style.removeProperty(e), gr(this, e)); - return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); + var s = gr(this, t), a = (this.style.removeProperty(t), gr(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function _l(e) { +function _l(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function gd(e, t, n) { +function vd(t, e, n) { var r, i = n + "", s; return function() { - var a = gr(this, e); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = gr(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function _d(e, t, n) { +function gd(t, e, n) { var r, i, s; return function() { - var a = gr(this, e), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(e), gr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); + var a = gr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), gr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function md(e, t) { - var n, r, i, s = "style." + t, a = "end." + s, o; +function _d(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Bt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; + var l = Xe(this, t), u = l.on, f = l.value[s] == null ? o || (o = _l(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function yd(e, t, n) { - var r = (e += "") == "transform" ? bh : gl; - return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, js(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); +function md(t, e, n) { + var r = (t += "") == "transform" ? xh : gl; + return e == null ? this.styleTween(t, pd(t, r)).on("end.style." + t, _l(t)) : typeof e == "function" ? this.styleTween(t, gd(t, r, js(this, "style." + t, e))).each(_d(this._id, t)) : this.styleTween(t, vd(t, r, e), n).on("end.style." + t, null); } -function wd(e, t, n) { +function yd(t, e, n) { return function(r) { - this.style.setProperty(e, t.call(this, r), n); + this.style.setProperty(t, e.call(this, r), n); }; } -function xd(e, t, n) { +function wd(t, e, n) { var r, i; function s() { - var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && wd(e, a, n)), r; + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && yd(t, a, n)), r; } - return s._value = t, s; + return s._value = e, s; } -function bd(e, t, n) { - var r = "style." + (e += ""); +function xd(t, e, n) { + var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (t == null) return this.tween(r, null); - if (typeof t != "function") throw new Error(); - return this.tween(r, xd(e, t, n ?? "")); + if (e == null) return this.tween(r, null); + if (typeof e != "function") throw new Error(); + return this.tween(r, wd(t, e, n ?? "")); } -function $d(e) { +function bd(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function Ad(e) { +function $d(t) { return function() { - var t = e(this); - this.textContent = t ?? ""; + var e = t(this); + this.textContent = e ?? ""; }; } -function Ed(e) { - return this.tween("text", typeof e == "function" ? Ad(js(this, "text", e)) : $d(e == null ? "" : e + "")); +function Ad(t) { + return this.tween("text", typeof t == "function" ? $d(js(this, "text", t)) : bd(t == null ? "" : t + "")); } -function Td(e) { - return function(t) { - this.textContent = e.call(this, t); +function Ed(t) { + return function(e) { + this.textContent = t.call(this, e); }; } -function Cd(e) { - var t, n; +function Td(t) { + var e, n; function r() { - var i = e.apply(this, arguments); - return i !== n && (t = (n = i) && Td(i)), t; + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && Ed(i)), e; } - return r._value = e, r; + return r._value = t, r; } -function Rd(e) { - var t = "text"; - if (arguments.length < 1) return (t = this.tween(t)) && t._value; - if (e == null) return this.tween(t, null); - if (typeof e != "function") throw new Error(); - return this.tween(t, Cd(e)); +function Cd(t) { + var e = "text"; + if (arguments.length < 1) return (e = this.tween(e)) && e._value; + if (t == null) return this.tween(e, null); + if (typeof t != "function") throw new Error(); + return this.tween(e, Td(t)); } -function Sd() { - for (var e = this._name, t = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Rd() { + for (var t = this._name, e = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { - var f = Et(l, t); - Gi(l, e, n, u, a, { + var f = Ce(l, e); + Gi(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new cn(r, this._parents, e, n); + return new cn(r, this._parents, t, n); } -function Nd() { - var e, t, n = this, r = n._id, i = n.size(); +function Sd() { + var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Bt(this, r), f = u.on; - f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; + var u = Xe(this, r), f = u.on; + f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var kd = 0; -function cn(e, t, n, r) { - this._groups = e, this._parents = t, this._name = n, this._id = r; +var Nd = 0; +function cn(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; } -function wi(e) { - return wr().transition(e); +function wi(t) { + return wr().transition(t); } function ml() { - return ++kd; + return ++Nd; } -var Jt = wr.prototype; +var Je = wr.prototype; cn.prototype = wi.prototype = { constructor: cn, - select: cd, - selectAll: hd, - selectChild: Jt.selectChild, - selectChildren: Jt.selectChildren, - filter: id, - merge: sd, - selection: pd, - transition: Sd, - call: Jt.call, - nodes: Jt.nodes, - node: Jt.node, - size: Jt.size, - empty: Jt.empty, - each: Jt.each, - on: ld, - attr: Hh, - attrTween: Uh, - style: yd, - styleTween: bd, - text: Ed, - textTween: Rd, - remove: fd, - tween: Oh, - delay: jh, - duration: Qh, + select: fd, + selectAll: cd, + selectChild: Je.selectChild, + selectChildren: Je.selectChildren, + filter: rd, + merge: id, + selection: dd, + transition: Rd, + call: Je.call, + nodes: Je.nodes, + node: Je.node, + size: Je.size, + empty: Je.empty, + each: Je.each, + on: od, + attr: zh, + attrTween: Wh, + style: md, + styleTween: xd, + text: Ad, + textTween: Cd, + remove: ud, + tween: Dh, + delay: Kh, + duration: Zh, ease: td, - easeVarying: rd, - end: Nd, - [Symbol.iterator]: Jt[Symbol.iterator] + easeVarying: nd, + end: Sd, + [Symbol.iterator]: Je[Symbol.iterator] }; -function Md(e) { - return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; +function kd(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Pd = { +var Md = { time: null, // Set on use. delay: 0, duration: 250, - ease: Md + ease: kd }; -function Dd(e, t) { - for (var n; !(n = e.__transition) || !(n = n[t]); ) - if (!(e = e.parentNode)) - throw new Error(`transition ${t} not found`); +function Pd(t, e) { + for (var n; !(n = t.__transition) || !(n = n[e]); ) + if (!(t = t.parentNode)) + throw new Error(`transition ${e} not found`); return n; } -function Od(e) { - var t, n; - e instanceof cn ? (t = e._id, e = e._name) : (t = ml(), (n = Pd).time = Gs(), e = e == null ? null : e + ""); +function Dd(t) { + var e, n; + t instanceof cn ? (e = t._id, t = t._name) : (e = ml(), (n = Md).time = Gs(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Gi(l, e, t, u, a, n || Dd(l, t)); - return new cn(r, this._parents, e, t); -} -wr.prototype.interrupt = Mh; -wr.prototype.transition = Od; -const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Fd = Ss - Nn; -function yl(e) { - this._ += e[0]; - for (let t = 1, n = e.length; t < n; ++t) - this._ += arguments[t] + e[t]; -} -function Id(e) { - let t = Math.floor(e); - if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return yl; - const n = 10 ** t; + (l = a[u]) && Gi(l, t, e, u, a, n || Pd(l, e)); + return new cn(r, this._parents, t, e); +} +wr.prototype.interrupt = kh; +wr.prototype.transition = Dd; +const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Od = Ss - Nn; +function yl(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function Id(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return yl; + const n = 10 ** e; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Ld { - constructor(t) { +class Fd { + constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Id(t); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? yl : Id(e); } - moveTo(t, n) { - this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; + moveTo(e, n) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(t, n) { - this._append`L${this._x1 = +t},${this._y1 = +n}`; + lineTo(e, n) { + this._append`L${this._x1 = +e},${this._y1 = +n}`; } - quadraticCurveTo(t, n, r, i) { - this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(e, n, r, i) { + this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(t, n, r, i, s, a) { - this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(e, n, r, i, s, a) { + this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(t, n, r, i, s) { - if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, c = f * f + p * p; + arcTo(e, n, r, i, s) { + if (e = +e, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); + let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, d = o - n, c = f * f + d * d; if (this._x1 === null) - this._append`M${this._x1 = t},${this._y1 = n}`; - else if (c > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) - this._append`L${this._x1 = t},${this._y1 = n}`; + this._append`M${this._x1 = e},${this._y1 = n}`; + else if (c > Nn) if (!(Math.abs(d * l - u * f) > Nn) || !s) + this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, I = M / $; - Math.abs(S - 1) > Nn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; + let p = r - a, y = i - o, b = l * l + u * u, m = p * p + y * y, $ = Math.sqrt(b), D = Math.sqrt(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, F = M / $; + Math.abs(S - 1) > Nn && this._append`L${e + S * f},${n + S * d}`, this._append`A${s},${s},0,0,${+(d * p > f * y)},${this._x1 = e + F * l},${this._y1 = n + F * u}`; } } - arc(t, n, r, i, s, a) { - if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Ss + Ss), c > Fd ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : c > Nn && this._append`A${r},${r},0,${+(c >= Rs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + arc(e, n, r, i, s, a) { + if (e = +e, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, d = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Ss + Ss), c > Od ? this._append`A${r},${r},0,1,${d},${e - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : c > Nn && this._append`A${r},${r},0,${+(c >= Rs)},${d},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(t, n, r, i) { - this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + rect(e, n, r, i) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; } toString() { return this._; } } -function qd(e) { - for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); +function Ld(t) { + for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Le(e) { +const qd = Ld("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Ft(t) { return function() { - return e; + return t; }; } -const qa = Math.abs, Oe = Math.atan2, Sn = Math.cos, zd = Math.max, ss = Math.min, Mt = Math.sin, er = Math.sqrt, Xe = 1e-12, zr = Math.PI, Mi = zr / 2, xi = 2 * zr; -function Hd(e) { - return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); +const qa = Math.abs, Dt = Math.atan2, Sn = Math.cos, Vd = Math.max, ss = Math.min, Pe = Math.sin, tr = Math.sqrt, Yt = 1e-12, Vr = Math.PI, Mi = Vr / 2, xi = 2 * Vr; +function zd(t) { + return t > 1 ? 0 : t < -1 ? Vr : Math.acos(t); } -function Va(e) { - return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); +function Va(t) { + return t >= 1 ? Mi : t <= -1 ? -Mi : Math.asin(t); } -function Yd(e) { - let t = 3; - return e.digits = function(n) { - if (!arguments.length) return t; +function Hd(t) { + let e = 3; + return t.digits = function(n) { + if (!arguments.length) return e; if (n == null) - t = null; + e = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - t = r; + e = r; } - return e; - }, () => new Ld(t); + return t; + }, () => new Fd(e); } -function Bd(e) { - return e.innerRadius; +function Yd(t) { + return t.innerRadius; } -function Xd(e) { - return e.outerRadius; +function Bd(t) { + return t.outerRadius; } -function Wd(e) { - return e.startAngle; +function Xd(t) { + return t.startAngle; } -function Ud(e) { - return e.endAngle; +function Wd(t) { + return t.endAngle; } -function Gd(e) { - return e && e.padAngle; +function Ud(t) { + return t && t.padAngle; } -function Kd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; - if (!(c * c < Xe)) - return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; +function Gd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, d = o - s, c = d * l - f * u; + if (!(c * c < Yt)) + return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; } -function ui(e, t, n, r, i, s, a) { - var o = e - n, l = t - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, b = r + p, m = (c + y) / 2, $ = (d + b) / 2, D = y - c, M = b - d, S = D * D + M * M, I = i - s, L = c * b - y * d, W = (M < 0 ? -1 : 1) * er(zd(0, I * I * S - L * L)), oe = (L * M - D * W) / S, Q = (-L * D - M * W) / S, U = (L * M + D * W) / S, le = (-L * D + M * W) / S, ue = oe - m, O = Q - $, F = U - m, Me = le - $; - return ue * ue + O * O > F * F + Me * Me && (oe = U, Q = le), { - cx: oe, - cy: Q, +function ui(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, y = n + f, b = r + d, m = (c + y) / 2, $ = (p + b) / 2, D = y - c, M = b - p, S = D * D + M * M, F = i - s, L = c * b - y * p, W = (M < 0 ? -1 : 1) * tr(Vd(0, F * F * S - L * L)), ot = (L * M - D * W) / S, Z = (-L * D - M * W) / S, U = (L * M + D * W) / S, lt = (-L * D + M * W) / S, ut = ot - m, O = Z - $, I = U - m, Nt = lt - $; + return ut * ut + O * O > I * I + Nt * Nt && (ot = U, Z = lt), { + cx: ot, + cy: Z, x01: -f, - y01: -p, - x11: oe * (i / I - 1), - y11: Q * (i / I - 1) + y01: -d, + x11: ot * (i / F - 1), + y11: Z * (i / F - 1) }; } -function _t() { - var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); +function ye() { + var t = Yd, e = Bd, n = Ft(0), r = null, i = Xd, s = Wd, a = Ud, o = null, l = Hd(u); function u() { - var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; - if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); - else if (m > xi - Xe) - o.moveTo(d * Sn(y), d * Mt(y)), o.arc(0, 0, d, y, b, !$), c > Xe && (o.moveTo(c * Sn(b), c * Mt(b)), o.arc(0, 0, c, b, y, $)); + var f, d, c = +t.apply(this, arguments), p = +e.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; + if (o || (o = f = l()), p < c && (d = p, p = c, c = d), !(p > Yt)) o.moveTo(0, 0); + else if (m > xi - Yt) + o.moveTo(p * Sn(y), p * Pe(y)), o.arc(0, 0, p, y, b, !$), c > Yt && (o.moveTo(c * Sn(b), c * Pe(b)), o.arc(0, 0, c, b, y, $)); else { - var D = y, M = b, S = y, I = b, L = m, W = m, oe = a.apply(this, arguments) / 2, Q = oe > Xe && (r ? +r.apply(this, arguments) : er(c * c + d * d)), U = ss(qa(d - c) / 2, +n.apply(this, arguments)), le = U, ue = U, O, F; - if (Q > Xe) { - var Me = Va(Q / c * Mt(oe)), ot = Va(Q / d * Mt(oe)); - (L -= Me * 2) > Xe ? (Me *= $ ? 1 : -1, S += Me, I -= Me) : (L = 0, S = I = (y + b) / 2), (W -= ot * 2) > Xe ? (ot *= $ ? 1 : -1, D += ot, M -= ot) : (W = 0, D = M = (y + b) / 2); + var D = y, M = b, S = y, F = b, L = m, W = m, ot = a.apply(this, arguments) / 2, Z = ot > Yt && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), U = ss(qa(p - c) / 2, +n.apply(this, arguments)), lt = U, ut = U, O, I; + if (Z > Yt) { + var Nt = Va(Z / c * Pe(ot)), se = Va(Z / p * Pe(ot)); + (L -= Nt * 2) > Yt ? (Nt *= $ ? 1 : -1, S += Nt, F -= Nt) : (L = 0, S = F = (y + b) / 2), (W -= se * 2) > Yt ? (se *= $ ? 1 : -1, D += se, M -= se) : (W = 0, D = M = (y + b) / 2); } - var ye = d * Sn(D), we = d * Mt(D), ee = c * Sn(I), Pe = c * Mt(I); - if (U > Xe) { - var G = d * Sn(M), Fe = d * Mt(M), Tt = c * Sn(S), ie = c * Mt(S), Ze; - if (m < zr) - if (Ze = Kd(ye, we, Tt, ie, G, Fe, ee, Pe)) { - var Xt = ye - Ze[0], lt = we - Ze[1], Tn = G - Ze[0], _e = Fe - Ze[1], Ct = 1 / Mt(Hd((Xt * Tn + lt * _e) / (er(Xt * Xt + lt * lt) * er(Tn * Tn + _e * _e))) / 2), Wt = er(Ze[0] * Ze[0] + Ze[1] * Ze[1]); - le = ss(U, (c - Wt) / (Ct - 1)), ue = ss(U, (d - Wt) / (Ct + 1)); + var mt = p * Sn(D), yt = p * Pe(D), Q = c * Sn(F), kt = c * Pe(F); + if (U > Yt) { + var et = p * Sn(M), Ot = p * Pe(M), Re = c * Sn(S), it = c * Pe(S), jt; + if (m < Vr) + if (jt = Gd(mt, yt, Re, it, et, Ot, Q, kt)) { + var ve = mt - jt[0], ae = yt - jt[1], Tn = et - jt[0], _t = Ot - jt[1], Se = 1 / Pe(zd((ve * Tn + ae * _t) / (tr(ve * ve + ae * ae) * tr(Tn * Tn + _t * _t))) / 2), We = tr(jt[0] * jt[0] + jt[1] * jt[1]); + lt = ss(U, (c - We) / (Se - 1)), ut = ss(U, (p - We) / (Se + 1)); } else - le = ue = 0; + lt = ut = 0; } - W > Xe ? ue > Xe ? (O = ui(Tt, ie, ye, we, d, ue, $), F = ui(G, Fe, ee, Pe, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < U ? o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, d, Oe(O.cy + O.y11, O.cx + O.x11), Oe(F.cy + F.y11, F.cx + F.x11), !$), o.arc(F.cx, F.cy, ue, Oe(F.y11, F.x11), Oe(F.y01, F.x01), !$))) : (o.moveTo(ye, we), o.arc(0, 0, d, D, M, !$)) : o.moveTo(ye, we), !(c > Xe) || !(L > Xe) ? o.lineTo(ee, Pe) : le > Xe ? (O = ui(ee, Pe, G, Fe, c, -le, $), F = ui(ye, we, Tt, ie, c, -le, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), le < U ? o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(F.y01, F.x01), !$) : (o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, c, Oe(O.cy + O.y11, O.cx + O.x11), Oe(F.cy + F.y11, F.cx + F.x11), $), o.arc(F.cx, F.cy, le, Oe(F.y11, F.x11), Oe(F.y01, F.x01), !$))) : o.arc(0, 0, c, I, S, $); + W > Yt ? ut > Yt ? (O = ui(Re, it, mt, yt, p, ut, $), I = ui(et, Ot, Q, kt, p, ut, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ut < U ? o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, p, Dt(O.cy + O.y11, O.cx + O.x11), Dt(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, ut, Dt(I.y11, I.x11), Dt(I.y01, I.x01), !$))) : (o.moveTo(mt, yt), o.arc(0, 0, p, D, M, !$)) : o.moveTo(mt, yt), !(c > Yt) || !(L > Yt) ? o.lineTo(Q, kt) : lt > Yt ? (O = ui(Q, kt, et, Ot, c, -lt, $), I = ui(mt, yt, Re, it, c, -lt, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), lt < U ? o.arc(O.cx, O.cy, lt, Dt(O.y01, O.x01), Dt(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, lt, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, c, Dt(O.cy + O.y11, O.cx + O.x11), Dt(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, lt, Dt(I.y11, I.x11), Dt(I.y01, I.x01), !$))) : o.arc(0, 0, c, F, S, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [Sn(p) * f, Mt(p) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Vr / 2; + return [Sn(d) * f, Pe(d) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Ft(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Ft(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Ft(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ft(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Ft(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Ft(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Ft(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function jd(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Kd(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Jd(e, t) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function jd(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Zd(e) { - return e; +function Jd(t) { + return t; } function as() { - var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); + var t = Jd, e = jd, n = null, r = Ft(0), i = Ft(xi), s = Ft(0); function a(o) { - var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = Kd(o)).length, f, d, c = 0, p = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); - for (t != null ? d.sort(function(I, L) { - return t(y[I], y[L]); - }) : n != null && d.sort(function(I, L) { - return n(o[I], o[L]); - }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, b = $) - f = d[l], S = y[f], $ = b + (S > 0 ? S * p : 0) + M, y[f] = { + (S = y[p[l] = l] = +t(o[l], l, o)) > 0 && (c += S); + for (e != null ? p.sort(function(F, L) { + return e(y[F], y[L]); + }) : n != null && p.sort(function(F, L) { + return n(o[F], o[L]); + }), l = 0, d = c ? (m - u * M) / c : 0; l < u; ++l, b = $) + f = p[l], S = y[f], $ = b + (S > 0 ? S * d : 0) + M, y[f] = { data: o[f], index: l, value: S, @@ -4786,110 +4786,110 @@ function as() { return y; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; + return arguments.length ? (t = typeof o == "function" ? o : Ft(+o), a) : t; }, a.sortValues = function(o) { - return arguments.length ? (t = o, n = null, a) : t; + return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { - return arguments.length ? (n = o, t = null, a) : n; + return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Le(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Ft(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Ft(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Ft(+o), a) : s; }, a; } -function Mr(e, t, n) { - this.k = e, this.x = t, this.y = n; +function kr(t, e, n) { + this.k = t, this.x = e, this.y = n; } -Mr.prototype = { - constructor: Mr, - scale: function(e) { - return e === 1 ? this : new Mr(this.k * e, this.x, this.y); +kr.prototype = { + constructor: kr, + scale: function(t) { + return t === 1 ? this : new kr(this.k * t, this.x, this.y); }, - translate: function(e, t) { - return e === 0 & t === 0 ? this : new Mr(this.k, this.x + this.k * e, this.y + this.k * t); + translate: function(t, e) { + return t === 0 & e === 0 ? this : new kr(this.k, this.x + this.k * t, this.y + this.k * e); }, - apply: function(e) { - return [e[0] * this.k + this.x, e[1] * this.k + this.y]; + apply: function(t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; }, - applyX: function(e) { - return e * this.k + this.x; + applyX: function(t) { + return t * this.k + this.x; }, - applyY: function(e) { - return e * this.k + this.y; + applyY: function(t) { + return t * this.k + this.y; }, - invert: function(e) { - return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; + invert: function(t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; }, - invertX: function(e) { - return (e - this.x) / this.k; + invertX: function(t) { + return (t - this.x) / this.k; }, - invertY: function(e) { - return (e - this.y) / this.k; + invertY: function(t) { + return (t - this.y) / this.k; }, - rescaleX: function(e) { - return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); + rescaleX: function(t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); }, - rescaleY: function(e) { - return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); + rescaleY: function(t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Mr.prototype; -var Qd = /* @__PURE__ */ Ku(''); -const ep = { +kr.prototype; +var Zd = /* @__PURE__ */ Gu(''); +const Qd = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function wl(e, t) { - Vi(t, !0), Hs(e, ep); - let n = ae(t, "jsonData", 7), r = ae(t, "currentRound", 7, 1), i = ae(t, "mouseEventType", 15), s = ae(t, "mouseData", 15), a = ae(t, "mouseX", 15), o = ae(t, "mouseY", 15), l = ae(t, "requestRoundChange", 7, (h) => { - }), u = ae(t, "candidateColors", 23, () => []), f = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ae(t, "firstRoundDeterminesPercentages", 7, !1), c = ae(t, "randomizeOrder", 7, !1), d = ae(t, "displayPhase", 15, 0); +function wl(t, e) { + Vi(e, !0), Hs(t, Qd); + let n = at(e, "jsonData", 7), r = at(e, "currentRound", 7, 1), i = at(e, "mouseEventType", 15), s = at(e, "mouseData", 15), a = at(e, "mouseX", 15), o = at(e, "mouseY", 15), l = at(e, "requestRoundChange", 7, (h) => { + }), u = at(e, "candidateColors", 23, () => []), f = at(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), d = at(e, "firstRoundDeterminesPercentages", 7, !1), c = at(e, "randomizeOrder", 7, !1), p = at(e, "displayPhase", 15, 0); function y(h) { return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", I = "PieOutline", L = "Donut", W = "TextLayer", oe = "url(#cross-hatch)", Q = 1.15, U = 750, le = 800, ue = "white", O = 1, F = "#ff00ff", Me = 3; - function ot(h) { + const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", F = "PieOutline", L = "Donut", W = "TextLayer", ot = "url(#cross-hatch)", Z = 1.15, U = 750, lt = 800, ut = "white", O = 1, I = "#ff00ff", Nt = 3; + function se(h) { return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); } - let ye = [], we = [], ee = [], Pe = 0, G = 0; - const Fe = {}, Tt = "No Further Rankings"; - let ie = /* @__PURE__ */ $e(null); - function Ze() { - const h = fe(x(ie)); - h.select("#" + S).remove(), h.select("#" + I).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); + let mt = [], yt = [], Q = [], kt = 0, et = 0; + const Ot = {}, Re = "No Further Rankings"; + let it = /* @__PURE__ */ bt(null); + function jt() { + const h = ft(x(it)); + h.select("#" + S).remove(), h.select("#" + F).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); } - function Xt(h) { - l() && (me = h, l()(h)); + function ve(h) { + l() && (vt = h, l()(h)); } - function lt(h) { - Ze(), ee = Tn(h), ye = ea(h, S, ee, D, M, 0, _e()), ea(h, I, ee, D, M, 0, _e(), !1, !1, !0), Er(); + function ae(h) { + jt(), Q = Tn(h), mt = ta(h, S, Q, D, M, 0, _t()), ta(h, F, Q, D, M, 0, _t(), !1, !1, !0), Qr(); } tf(() => { Cn(), setTimeout( () => { - lt(r()); + ae(r()); }, 0 ); }); function Tn(h) { - const g = ze(h); - return Pe = Jn(h), g; + const g = Vt(h); + return kt = Jn(h), g; } - function _e() { + function _t() { return $; } - function Ct() { - return _e() * 1.41; + function Se() { + return _t() * 1.41; } - function Wt(h) { + function We(h) { let g = 0; for (let _ = 1; _ < h; _++) { const A = n().results[_ - 1].tallyResults; @@ -4903,19 +4903,19 @@ function wl(e, t) { } return g; } - function jr(h, g) { - if (h === "exhausted") return Wt(g); + function Kr(h, g) { + if (h === "exhausted") return We(g); { const _ = n().results[g - 1].tally; return Number(_[h]); } } - function Jr(h, g) { - return jr(h, g).toLocaleString("en-US"); + function jr(h, g) { + return Kr(h, g).toLocaleString("en-US"); } - function Zr(h, g) { - const _ = p() ? Pe : Ki(g); - return (jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Jr(h, g) { + const _ = d() ? kt : Ki(g); + return (Kr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } function Jn(h) { const g = n().results[h - 1].tally; @@ -4924,17 +4924,17 @@ function wl(e, t) { _ += Number(E); return _; } - function Rt(h) { + function Ne(h) { return h === "exhausted" || h === "Inactive Ballots"; } function Ki(h) { const g = n().results[h - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) - Rt(A) || (_ += Number(E)); + Ne(A) || (_ += Number(E)); return _; } - function Qr(h, g) { + function Zr(h, g) { if (!h || h < 1 || h > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; if (f() && h === n().results.length) @@ -4947,11 +4947,11 @@ function wl(e, t) { return A; } function dn(h) { - return Qr(h, "eliminated"); + return Zr(h, "eliminated"); } function xr(h) { let g = []; - for (let _ = 1; _ <= h; _++) g = g.concat(Qr(_, "elected")); + for (let _ = 1; _ <= h; _++) g = g.concat(Zr(_, "elected")); return [...new Set(g)]; } function w(h, g) { @@ -4967,9 +4967,9 @@ function wl(e, t) { return A; } function Y(h, g) { - h.some((_) => Rt(_.label)) || h.push({ label: "exhausted", value: Wt(g) }); + h.some((_) => Ne(_.label)) || h.push({ label: "exhausted", value: We(g) }); } - function te(h) { + function tt(h) { let g = h | 0; return () => { g = g + 1831565813 | 0; @@ -4977,39 +4977,39 @@ function wl(e, t) { return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; }; } - function pe(h) { + function pt(h) { let g = 5381; for (let _ = 0; _ < h.length; _++) g = (g << 5) + g + h.charCodeAt(_) | 0; return g; } - function xe(h) { + function wt(h) { var E; if (h.length <= 3) return h; - const g = pe(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = te(g), A = [...h]; + const g = pt(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = tt(g), A = [...h]; for (let T = A.length - 1; T > 0; T--) { const P = Math.floor(_() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function se() { - const h = Object.keys(n().results[0].tally), g = h.filter((E) => !Rt(E)), _ = h.filter((E) => Rt(E)); - return [...c() ? xe(g) : g, ..._]; + function st() { + const h = Object.keys(n().results[0].tally), g = h.filter((E) => !Ne(E)), _ = h.filter((E) => Ne(E)); + return [...c() ? wt(g) : g, ..._]; } - function ze(h) { + function Vt(h) { const g = n().results[h - 1].tally, _ = []; - for (const A of se()) + for (const A of st()) A in g && _.push({ label: A, value: Number(g[A]) }); return Y(_, h), _; } - function Ut(h) { + function Ue(h) { const g = n().results[h - 1].tally, _ = []; - for (const A of se()) + for (const A of st()) _.push({ label: A, value: Number(g[A] ?? 0) }); return Y(_, h), _; } - function St(h, g) { + function ke(h, g) { const _ = []; for (const A of h) { if (A.label === "exhausted" || A.isTransfer) { @@ -5026,158 +5026,135 @@ function wl(e, t) { return _; } function Cn() { - const h = fe(x(ie)).select("defs").select("#cross-hatch"); + const h = ft(x(it)).select("defs").select("#cross-hatch"); let g = 0; for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Fe[_] = Vd[g] : Fe[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Fe[_] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? Ot[_] = qd[g] : Ot[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ot[_] = u()[g % u().length], g++; { const E = h.clone(!0); - E.attr("id", ot(_)).select("rect").attr("fill", Fe[_]), E.selectAll("circle").attr("fill", "#383838"); + E.attr("id", se(_)).select("rect").attr("fill", Ot[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Fe.exhausted = oe, Fe["Inactive Ballots"] = oe; + Ot.exhausted = ot, Ot["Inactive Ballots"] = ot; } function pn() { - fe(x(ie)).select("#" + L).remove(); + ft(x(it)).select("#" + L).remove(); } - function Ee(h, g) { - const _ = wi("global").duration(le); + function Mt(h, g) { + const _ = wi("global").duration(lt); g && _.on("end", g); - const A = St(ee, h), T = as().sort(null).value((P) => P.value)(A); - ia(h, S, T, 0, _e()), ia(h, I, T, 0, _e(), !0), ee = A, ye = T, pn(), $l(h), Nl(), Ml(0, _e()), Er(); + const A = ke(Q, h), T = as().sort(null).value((P) => P.value)(A); + ia(h, S, T, 0, _t()), ia(h, F, T, 0, _t(), !0), Q = A, mt = T, pn(), bl(h), Sl(), kl(0, _t()), Qr(); } - function He(h, g) { - const _ = wi("global").duration(le); - g && _.on("end", g), Al(h); + function oe(h, g) { + const _ = wi("global").duration(lt); + g && _.on("end", g), $l(h); } - function Te(h, g) { - const _ = wi("global").duration(le); - g && _.on("end", g), ji(h), bl(_e(), Ct()); + function zt(h, g) { + const _ = wi("global").duration(lt); + g && _.on("end", g), je(h), ji(_t(), Se()); } - let ve = !1, ut = []; - function Ye() { - Er(), ve = !1, Gt(); + let At = !1, ge = []; + function _e() { + Qr(), At = !1, Ge(); } - function Gt() { - if (ut.length === 0) { - me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), Nt(r())) : r() >= 1 && r() <= n().results.length && (me = r(), d(0), lt(r()))); + function Ge() { + if (ge.length === 0) { + vt !== r() && (r() === vt + 1 && vt > 0 && r() <= n().results.length ? (vt = r(), me(r())) : r() >= 1 && r() <= n().results.length && (vt = r(), p(0), ae(r()))); return; } - const h = ut.shift(); + const h = ge.shift(); switch (h.type) { case "round": { const g = h.round; - g === me + 1 && me > 0 && g <= n().results.length ? (me = g, Nt(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, d(0), lt(g)), Gt()); + g === vt + 1 && vt > 0 && g <= n().results.length ? (vt = g, me(g)) : (g !== vt && g >= 1 && g <= n().results.length && (vt = g, p(0), ae(g)), Ge()); break; } case "step": - kt(); + Me(); break; } } - function Nt(h) { + function me(h) { if (h <= 1 || h > n().results.length) { - Gt(); + Ge(); return; } - ve = !0, G = h, d(0), Ee(G - 1, () => { - d(1), He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); + At = !0, et = h, p(0), Mt(et - 1, () => { + p(1), oe(et - 1, () => { + p(2), zt(et, () => { + p(0), ve(et), _e(); }); }); }); } - function Kt() { - ve || (ve = !0, G = r(), Rn()); + function Ke() { + At || (At = !0, et = r(), Rn()); } function Rn() { - if (d( + if (p( 0 // if in the middle of "one small step" animation, reset to 0. - ), ut.length > 0) { - Ye(); + ), ge.length > 0) { + _e(); return; } - const h = G < n().results.length - 1 ? Rn : () => { - d(0), Ye(); + const h = et < n().results.length - 1 ? Rn : () => { + p(0), _e(); }; - Ee(G, () => { - d(1), He(G, () => { - d(2), G++, Xt(G), Te(G, h); + Mt(et, () => { + p(1), oe(et, () => { + p(2), et++, ve(et), zt(et, h); }); }); } - Is(() => { + Fs(() => { br(); }); - let me = 0; + let vt = 0; function br() { - if (me != r()) { - if (ve) { - ut.push({ type: "round", round: r() }); + if (vt != r()) { + if (At) { + ge.push({ type: "round", round: r() }); return; } - me == r() - 1 && me > 0 ? jt() : $r(r()), me = r(); + if (vt == r() - 1 && vt > 0) { + const h = r(); + ve(vt), me(h); + } else + $r(r()), vt = r(); } } function $r(h) { - if (ve) { - ut.push({ type: "round", round: h }); + if (At) { + ge.push({ type: "round", round: h }); return; } - d(0), lt(h); - } - function jt() { - if (ve) { - ut.push({ type: "round", round: r() }); - return; - } - if (r() <= 1) { - console.warn(`animateOneRoundFn: can't animate to round ${r()}`); - return; - } - if (G = r(), G > n().results.length) { - Er(), ve = !1; - return; - } - ve = !0, d() === 0 ? Ee(G - 1, () => { - d(1), He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); - }); - }); - }) : d() === 1 ? He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); - }); - }) : d() === 2 && Te(G, () => { - d(0), Ye(); - }); + p(0), ae(h); } - function kt() { + function Me() { if (r() > n().results.length) { - Er(), ve = !1; + Qr(), At = !1; return; } - if (ve) { - ut.push({ type: "step" }); + if (At) { + ge.push({ type: "step" }); return; } - ve = !0, G = r(), d() === 0 ? Ee(G, () => { - d(1), Ye(); - }) : d() === 1 ? He(G, () => { - d(2), Ye(); - }) : d() === 2 ? (G++, Xt(G), Te(G, () => { - d(0), Ye(); - })) : (ve = !1, console.warn("displayPhase out of range at ", d())); - } - function ji(h) { - ee = Ut(h), ye = na(h, S, ee, 0, _e(), !0), na(h, I, ee, 0, _e(), !1, !0); - } - function bl(h, g) { - const _ = fe(x(ie)).select("#" + L), E = fe(x(ie)).select("#" + S), T = {}; - for (const N of ye) { + At = !0, et = r(), p() === 0 ? Mt(et, () => { + p(1), _e(); + }) : p() === 1 ? oe(et, () => { + p(2), _e(); + }) : p() === 2 ? (et++, ve(et), zt(et, () => { + p(0), _e(); + })) : (At = !1, console.warn("displayPhase out of range at ", p())); + } + function je(h) { + Q = Ue(h), mt = na(h, S, Q, 0, _t(), !0), na(h, F, Q, 0, _t(), !1, !0); + } + function ji(h, g) { + const _ = ft(x(it)).select("#" + L), E = ft(x(it)).select("#" + S), T = {}; + for (const N of mt) { const k = N.data.label; if (N.data.isTransfer) continue; const C = E.select("#" + CSS.escape(y(N.data))); @@ -5191,36 +5168,36 @@ function wl(e, t) { const P = _.selectAll(".slice"); let z = P.size(); function q() { - z--, z === 0 && kl(); + z--, z === 0 && Nl(); } P.select("path").transition("global").duration(U).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, De = T[N.data.label]; - let Z, Be; - if (De) { - const Zn = (De.oldStart + De.oldEnd) / 2, Fl = (De.newStart + De.newEnd) / 2, Il = k - Zn; - Z = Fl + Il, Be = Z + R; + const k = N.startAngle, C = N.endAngle, R = C - k, Pt = T[N.data.label]; + let J, Ht; + if (Pt) { + const Zn = (Pt.oldStart + Pt.oldEnd) / 2, Ol = (Pt.newStart + Pt.newEnd) / 2, Il = k - Zn; + J = Ol + Il, Ht = J + R; } else - Z = k, Be = C; - const ne = Zt(k, Z), Ce = Zt(C, Be), ti = Zt(g, h), Tr = _t(); + J = k, Ht = C; + const nt = Ze(k, J), Et = Ze(C, Ht), ei = Ze(g, h), Er = ye(); return function(Zn) { - return Tr.innerRadius(Math.min(ti(Zn), h) - 1).outerRadius(ti(Zn)).startAngle(ne(Zn)).endAngle(Ce(Zn)), Tr(N); + return Er.innerRadius(Math.min(ei(Zn), h) - 1).outerRadius(ei(Zn)).startAngle(nt(Zn)).endAngle(Et(Zn)), Er(N); }; }).on("end", (N) => q()); } - function $l(h) { - const g = Tl(h, ye); - we = ta(h, L, g, D, M, _e(), Ct(), !1, !0); - const _ = fe(x(ie)); - _.select("#" + S).raise(), _.select("#" + I).raise(); + function bl(h) { + const g = El(h, mt); + yt = ea(h, L, g, D, M, _t(), Se(), !1, !0); + const _ = ft(x(it)); + _.select("#" + S).raise(), _.select("#" + F).raise(); } - function Al(h) { - const g = Rl(h, we, ye); - we = sa(h, L, g, _e(), Ct(), !1); + function $l(h) { + const g = Cl(h, yt, mt); + yt = sa(h, L, g, _t(), Se(), !1); } function Ar(h) { - return Fe[h.data.label]; + return Ot[h.data.label]; } - function El(h) { + function Al(h) { const g = {}, _ = n().results[h - 1].tallyResults; for (let A = 0; A < _.length; A++) { let E = _[A].eliminated; @@ -5238,8 +5215,8 @@ function wl(e, t) { } return g; } - function Tl(h, g) { - const _ = [], A = Pe, E = n().results[h - 1].tallyResults; + function El(h, g) { + const _ = [], A = kt, E = n().results[h - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { @@ -5261,9 +5238,9 @@ function wl(e, t) { } for (let [k, C] of Object.entries(z)) { let R; - const De = g.find((ne) => ne.data.label == k); - if (De) - R = structuredClone(De); + const Pt = g.find((nt) => nt.data.label == k); + if (Pt) + R = structuredClone(Pt); else if (k == "exhausted") R = { data: { label: k, value: Number(C) }, @@ -5279,13 +5256,13 @@ function wl(e, t) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Be = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); + const Ht = Number(C) / A * 2 * Math.PI; + R.startAngle = N, N = R.endAngle = N + Ht, R.index = T, R.data.transferIndex = T, _.push(R); } } return _; } - function Cl(h, g, _) { + function Tl(h, g, _) { const A = {}; for (let [E, T] of Object.entries(h)) { const P = _.find((N) => E == N.data.label); @@ -5298,8 +5275,8 @@ function wl(e, t) { } return A; } - function Rl(h, g, _) { - const A = [], E = Pe, T = El(h), P = Cl(T, E, _); + function Cl(h, g, _) { + const A = [], E = kt, T = Al(h), P = Tl(T, E, _); for (let [z, q] of g.entries()) { const N = structuredClone(q), k = q.endAngle - q.startAngle, C = _.find((R) => q.data.label === R.data.label && !R.data.isTransfer); if (C) { @@ -5316,18 +5293,18 @@ function wl(e, t) { return A; } function Zs(h, g, _, A) { - const E = _t().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + const E = ye().innerRadius(_ * Z).outerRadius(_ * Z), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); for (const k of T) { - const C = k.data.label === "exhausted" ? Tt : k.data.label, R = E.centroid(k), De = ei(k.startAngle, k.endAngle), Z = Jr(k.data.label, h); - let Be; - !p() && Rt(k.data.label) ? Be = Z : Be = Z + " (" + Zr(k.data.label, h) + ")"; - const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", De).text(C); - ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); - const Ce = ne.node().getBBox(); + const C = k.data.label === "exhausted" ? Re : k.data.label, R = E.centroid(k), Pt = ti(k.startAngle, k.endAngle), J = jr(k.data.label, h); + let Ht; + !d() && Ne(k.data.label) ? Ht = J : Ht = J + " (" + Jr(k.data.label, h) + ")"; + const nt = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pt).text(C); + nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Ht); + const Et = nt.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Ce.x + R[0], Ce.y + R[1], Ce.width, Ce.height) + bbox: new DOMRect(Et.x + R[0], Et.y + R[1], Et.width, Et.height) }); } z.remove(), P.sort((k, C) => C.value - k.value); @@ -5337,77 +5314,77 @@ function wl(e, t) { return N; } function Qs(h, g, _, A, E, T) { - const z = fe(x(ie)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = _t().innerRadius(E * Q).outerRadius(E * Q), N = Zs(h, g, E, z); + const z = ft(x(it)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = ye().innerRadius(E * Z).outerRadius(E * Z), N = Zs(h, g, E, z); z.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { - C.data.label === "exhausted" && fe(this).on("mouseenter", (De, Z) => Pl(De)).on("mouseleave", (De, Z) => Dl()); - }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Tt : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = Jr(C.data.label, h); - return !p() && Rt(C.data.label) ? R : R + " (" + Zr(C.data.label, h) + ")"; + !k.data.isTransfer && N.has(k.data.label) && ft(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { + C.data.label === "exhausted" && ft(this).on("mouseenter", (Pt, J) => Ml(Pt)).on("mouseleave", (Pt, J) => Pl()); + }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ti(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Re : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { + const R = jr(C.data.label, h); + return !d() && Ne(C.data.label) ? R : R + " (" + Jr(C.data.label, h) + ")"; }); }); } - function Sl(h, g, _, A) { - const T = fe(x(ie)).select("#" + W), P = Zs(h, g, _, T); + function Rl(h, g, _, A) { + const T = ft(x(it)).select("#" + W), P = Zs(h, g, _, T); T.selectAll("g").each(function(R) { - R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); + R && R.data && !R.data.isTransfer && !P.has(R.data.label) && ft(this).remove(); }); - const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = _t().innerRadius(_ * Q).outerRadius(_ * Q + 1); - z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = ye().innerRadius(_ * Z).outerRadius(_ * Z + 1); + z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)).on("end", (R) => C()); let k = q.size(); function C(R) { k--, k === 0 && (T.remove(), Qs(h, g, D, M, _, A)); } } - function ea(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { + function ta(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { const C = as().sort(null).value((R) => R.value)(_); - return ta(h, g, C, A, E, T, P, z, q, N), C; + return ea(h, g, C, A, E, T, P, z, q, N), C; } - function Er() { - fe(x(ie)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Me}px`); + function Qr() { + ft(x(it)).select("#" + F).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Nt}px`); } - function ta(h, g, _, A, E, T, P, z, q, N = !1) { - const k = dn(h), C = xr(h), Z = fe(x(ie)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (ne) => k.includes(ne.data.label) || ne.data.isTransfer === !0).classed("elected", (ne) => C.includes(ne.data.label) && !ne.data.isTransfer).attr("id", (ne) => y(ne.data)); - N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (ne, Ce) => Zi(ne, Ce)).on("mouseleave", (ne, Ce) => Qi(ne, Ce)); - const Be = _t().outerRadius(P).innerRadius(T); + function ea(h, g, _, A, E, T, P, z, q, N = !1) { + const k = dn(h), C = xr(h), J = ft(x(it)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => C.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => y(nt.data)); + N ? J.style("pointer-events", "none") : J.on("mouseenter", (nt, Et) => Zi(nt, Et)).on("mouseleave", (nt, Et) => Qi(nt, Et)); + const Ht = ye().outerRadius(P).innerRadius(T); if (q) { - const ne = _t().outerRadius(T + 1).innerRadius(T); - Z.append("path").attr("d", ne).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ce) => Ar(Ce)).transition("global").duration(U).attr("d", (Ce) => Be(Ce)).on("end", (Ce) => { + const nt = ye().outerRadius(T + 1).innerRadius(T); + J.append("path").attr("d", nt).attr("stroke", N ? "none" : T === 0 ? ut : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Et) => Ar(Et)).transition("global").duration(U).attr("d", (Et) => Ht(Et)).on("end", (Et) => { N || Ji(); }); } else - Z.append("path").attr("d", (ne) => Be(ne)).attr("fill", N ? "none" : (ne) => Ar(ne)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || Ji(); + J.append("path").attr("d", (nt) => Ht(nt)).attr("fill", N ? "none" : (nt) => Ar(nt)).attr("stroke", N ? "none" : ut).attr("stroke-width", N ? 0 : O), N || Ji(); return z && !N && Qs(h, _, A, E, P, k), _; } - function Nl() { - const _ = fe(x(ie)).select("#" + W).selectAll(".eliminated"); + function Sl() { + const _ = ft(x(it)).select("#" + W).selectAll(".eliminated"); _.size() > 0 && _.classed("finished", !0); } - function kl() { - const _ = fe(x(ie)).select("#" + W).selectAll(".finished"); + function Nl() { + const _ = ft(x(it)).select("#" + W).selectAll(".finished"); _.size() > 0 && _.remove(); } - function Ml(h, g) { - const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = _t().innerRadius(h), P = _t().outerRadius(g); + function kl(h, g) { + const E = ft(x(it)).select("#" + S).selectAll(".eliminated"), T = ye().innerRadius(h), P = ye().outerRadius(g); E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(U).attrTween("d", function(z) { - const q = Zt(g, h); + const q = Ze(g, h); return function(N) { return P.innerRadius(q(N)), P(z); }; - }).attr("fill", (z) => `url(#${ot(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { - const q = Zt(g, h); + }).attr("fill", (z) => `url(#${se(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { + const q = Ze(g, h); return function(N) { return T.outerRadius(q(N)), T(z); }; }).attr("fill", (z) => Ar(z)); } - function ei(h, g) { + function ti(h, g) { const _ = (h + g) / 2; return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; } function Ji() { - fe(x( - ie + ft(x( + it // force redisplay of text labels )).select("#" + W).raise().append("g").remove(); } @@ -5416,29 +5393,29 @@ function wl(e, t) { return sa(h, g, q, A, E, T, P), q; } function ra(h, g, _, A, E = !1) { - const T = dn(h), P = xr(h), N = fe(x(ie)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); + const T = dn(h), P = xr(h), N = ft(x(it)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); N.exit().remove(); const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ut).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; } function ia(h, g, _, A, E, T = !1) { - const P = _t().outerRadius(E).innerRadius(A); + const P = ye().outerRadius(E).innerRadius(A); ra(h, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); } function sa(h, g, _, A, E, T, P = !1) { - const z = _t().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = _t().outerRadius(E).innerRadius(A); - fe(x(ie)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const z = ye().outerRadius(E).innerRadius(A).startAngle((J) => J.startAngle).endAngle((J) => J.endAngle), q = ye().outerRadius(E).innerRadius(A); + ft(x(it)).select("#" + g).selectAll(".slice").attr("prevStart", (J) => J.startAngle).attr("prevEnd", (J) => J.endAngle); const C = ra(h, g, _, q, P); let R = C.size(); - function De() { + function Pt() { R--, R <= 0 && (P || Ji()); } - return C.select("path").transition("global").duration(U).attrTween("d", function(Z) { - const Be = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ce = Zt(Be, Z.startAngle), ti = Zt(ne, Z.endAngle); - return (Tr) => (z.startAngle(Ce(Tr)).endAngle(ti(Tr)), z(Z)); - }).on("end", function(Z) { - Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), De(); - }), T && !P && Sl(h, _, E, dn(h)), _; + return C.select("path").transition("global").duration(U).attrTween("d", function(J) { + const Ht = Number(ft(this.parentNode).attr("prevStart")), nt = Number(ft(this.parentNode).attr("prevEnd")), Et = Ze(Ht, J.startAngle), ei = Ze(nt, J.endAngle); + return (Er) => (z.startAngle(Et(Er)).endAngle(ei(Er)), z(J)); + }).on("end", function(J) { + J.startAngle === J.endAngle && ft(this).attr("stroke", "none"), Pt(); + }), T && !P && Rl(h, _, E, dn(h)), _; } function Zi(h, g) { s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); @@ -5446,95 +5423,95 @@ function wl(e, t) { function Qi(h, g) { s(g.data.label), i("leave"); } - function Pl(h, g) { + function Ml(h, g) { i("show-exhausted"), a(h.clientX), o(h.clientY); } - function Dl(h, g) { + function Pl(h, g) { i("hide-exhausted"); } - var Ol = { - pieColors: Fe, - exhaustedLabel: Tt, - countExhaustedVotes: Wt, + var Dl = { + pieColors: Ot, + exhaustedLabel: Re, + countExhaustedVotes: We, getEliminatedCandidates: dn, getElectedCandidates: xr, - runFullAnimationFn: Kt, - animateOnePhaseFn: kt, + runFullAnimationFn: Ke, + animateOnePhaseFn: Me, get jsonData() { return n(); }, set jsonData(h) { - n(h), re(); + n(h), rt(); }, get currentRound() { return r(); }, set currentRound(h = 1) { - r(h), re(); + r(h), rt(); }, get mouseEventType() { return i(); }, set mouseEventType(h) { - i(h), re(); + i(h), rt(); }, get mouseData() { return s(); }, set mouseData(h) { - s(h), re(); + s(h), rt(); }, get mouseX() { return a(); }, set mouseX(h) { - a(h), re(); + a(h), rt(); }, get mouseY() { return o(); }, set mouseY(h) { - o(h), re(); + o(h), rt(); }, get requestRoundChange() { return l(); }, set requestRoundChange(h = (g) => { }) { - l(h), re(); + l(h), rt(); }, get candidateColors() { return u(); }, set candidateColors(h = []) { - u(h), re(); + u(h), rt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, set excludeFinalWinnerAndEliminatedCandidate(h = !1) { - f(h), re(); + f(h), rt(); }, get firstRoundDeterminesPercentages() { - return p(); + return d(); }, set firstRoundDeterminesPercentages(h = !1) { - p(h), re(); + d(h), rt(); }, get randomizeOrder() { return c(); }, set randomizeOrder(h = !1) { - c(h), re(); + c(h), rt(); }, get displayPhase() { - return d(); + return p(); }, set displayPhase(h = 0) { - d(h), re(); + p(h), rt(); } - }, aa = Qd(); - return vi(aa, (h) => he(ie, h), () => x(ie)), Ge(e, aa), zi(Ol); + }, aa = Zd(); + return vi(aa, (h) => ht(it, h), () => x(it)), Wt(t, aa), zi(Dl); } Ys( wl, @@ -5564,83 +5541,83 @@ Ys( ], { mode: "open" } ); -var tp = /* @__PURE__ */ Yt("
"), np = /* @__PURE__ */ Yt('
', 1), rp = /* @__PURE__ */ Yt('
'); -const ip = { +var tp = /* @__PURE__ */ Be("
"), ep = /* @__PURE__ */ Be('
', 1), np = /* @__PURE__ */ Be('
'); +const rp = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function xl(e, t) { - Vi(t, !0), Hs(e, ip); - let n = ae(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ae(t, "currentStep", 7, 0), i = ae(t, "disabled", 7, !1), s = ae(t, "onAdvance", 7, () => { +function xl(t, e) { + Vi(e, !0), Hs(t, rp); + let n = at(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = at(e, "currentStep", 7, 0), i = at(e, "disabled", 7, !1), s = at(e, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function o(p) { - (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a()); + function o(d) { + (d.key === "Enter" || d.key === " ") && (d.preventDefault(), a()); } var l = { get labels() { return n(); }, - set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { - n(p), re(); + set labels(d = ["Eliminate", "Transfer", "Consolidate"]) { + n(d), rt(); }, get currentStep() { return r(); }, - set currentStep(p = 0) { - r(p), re(); + set currentStep(d = 0) { + r(d), rt(); }, get disabled() { return i(); }, - set disabled(p = !1) { - i(p), re(); + set disabled(d = !1) { + i(d), rt(); }, get onAdvance() { return s(); }, - set onAdvance(p = () => { + set onAdvance(d = () => { }) { - s(p), re(); + s(d), rt(); } - }, u = rp(); + }, u = np(); let f; - return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { - var y = np(), b = _n(y); + return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (d, c, p) => { + var y = ep(), b = _n(y); { var m = (W) => { - var oe = tp(); - let Q; - Qt(() => Q = ii(oe, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(W, oe); + var ot = tp(); + let Z; + Qe(() => Z = ii(ot, 1, "connector svelte-1l4eyw0", null, Z, { completed: !i() && p <= r() })), Wt(W, ot); }; Qn(b, (W) => { - d > 0 && W(m); + p > 0 && W(m); }); } - var $ = Qe(b, 2), D = We($); + var $ = Jt(b, 2), D = Bt($); let M; - var S = Qe(D, 2); - let I; - var L = We(S, !0); - Ie(S), Ie($), Qt(() => { + var S = Jt(D, 2); + let F; + var L = Bt(S, !0); + It(S), It($), Qe(() => { M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { - active: !i() && d === r(), - completed: !i() && d < r() - }), I = ii(S, 1, "label svelte-1l4eyw0", null, I, { - active: !i() && d === r(), - completed: !i() && d < r() + active: !i() && p === r(), + completed: !i() && p < r() + }), F = ii(S, 1, "label svelte-1l4eyw0", null, F, { + active: !i() && p === r(), + completed: !i() && p < r() }), mn(L, x(c)); - }), Ge(p, y); - }), Ie(u), Qt(() => { + }), Wt(d, y); + }), It(u), Qe(() => { f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); - }), Ge(e, u), zi(l); + }), Wt(t, u), zi(l); } -Wu(["click", "keydown"]); +Xu(["click", "keydown"]); Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var sp = /* @__PURE__ */ Yt(" ", 1), ap = /* @__PURE__ */ Yt("About to eliminate: ", 1), op = /* @__PURE__ */ Yt(" ", 1), lp = /* @__PURE__ */ Yt(" ", 1), up = /* @__PURE__ */ Yt('

', 1), fp = /* @__PURE__ */ Yt("
", 1), cp = /* @__PURE__ */ Yt('


these ballots have already been eliminated.
', 1); -const hp = { +var ip = /* @__PURE__ */ Be(" ", 1), sp = /* @__PURE__ */ Be("About to eliminate: ", 1), ap = /* @__PURE__ */ Be(" ", 1), op = /* @__PURE__ */ Be(" ", 1), lp = /* @__PURE__ */ Be('

', 1), up = /* @__PURE__ */ Be("
", 1), fp = /* @__PURE__ */ Be('


these ballots have already been eliminated.
', 1); +const cp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5655,11 +5632,11 @@ const hp = { }` }; -function dp(e, t) { - Vi(t, !0), Hs(e, hp); +function hp(t, e) { + Vi(e, !0), Hs(t, cp); const n = 0.85; - let r = ae(t, "electionSummary", 7), i = ae(t, "currentRound", 7, 1), s = ae(t, "requestRoundChange", 7, (w) => { - }), a = ae(t, "candidateColors", 23, () => []), o = ae(t, "textForWinner", 7, "elected"), l = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ae(t, "firstRoundDeterminesPercentages", 7, !1), f = ae(t, "randomizeOrder", 7, !1), p = ae(t, "showCaptions", 7, !1); + let r = at(e, "electionSummary", 7), i = at(e, "currentRound", 7, 1), s = at(e, "requestRoundChange", 7, (w) => { + }), a = at(e, "candidateColors", 23, () => []), o = at(e, "textForWinner", 7, "elected"), l = at(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = at(e, "firstRoundDeterminesPercentages", 7, !1), f = at(e, "randomizeOrder", 7, !1), d = at(e, "showCaptions", 7, !1); const c = { elected: { caption: "Elected", @@ -5678,7 +5655,7 @@ function dp(e, t) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ vn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(""), $ = /* @__PURE__ */ $e(Pn([])), D = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), S = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => W(r())); + let p = /* @__PURE__ */ vn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ bt(null), b = /* @__PURE__ */ bt(null), m = /* @__PURE__ */ bt(""), $ = /* @__PURE__ */ bt(Pn([])), D = /* @__PURE__ */ bt(""), M = /* @__PURE__ */ bt(""), S = /* @__PURE__ */ bt(0), F = /* @__PURE__ */ bt(0), L = /* @__PURE__ */ vn(() => W(r())); function W(w) { if (typeof w == "string") try { @@ -5688,29 +5665,29 @@ function dp(e, t) { } return w || {}; } - function oe(w) { + function ot(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, Y, te) { - w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const se = w.getBoundingClientRect(); - let ze = Y, Ut = te + 20; - ze + se.width > window.innerWidth - 12 && (ze = window.innerWidth - se.width - 12), ze < 12 && (ze = 12), Ut + se.height > window.innerHeight - 12 && (Ut = te - se.height - 12), w.style.left = ze + "px", w.style.top = Ut + "px"; + function Z(w, Y, tt) { + w.style.left = Y + "px", w.style.top = tt + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const st = w.getBoundingClientRect(); + let Vt = Y, Ue = tt + 20; + Vt + st.width > window.innerWidth - 12 && (Vt = window.innerWidth - st.width - 12), Vt < 12 && (Vt = 12), Ue + st.height > window.innerHeight - 12 && (Ue = tt - st.height - 12), w.style.left = Vt + "px", w.style.top = Ue + "px"; }); } function U() { switch (x(D)) { case "enter": ((w) => { - var Y = nu(w, 2); - he($, Y[0], !0), he(m, Y[1], !0); - })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(I) || 0), x(y).style.opacity = String(n)); + var Y = eu(w, 2); + ht($, Y[0], !0), ht(m, Y[1], !0); + })(ut(x(M), i())), x(y) && (Z(x(y), x(S) || 0, x(F) || 0), x(y).style.opacity = String(n)); break; case "leave": - x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); + x(y) && (x(y).style.opacity = "0"), ht($, [], !0), ht(m, ""); break; case "show-exhausted": - x(b) && (Q(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); + x(b) && (Z(x(b), x(S) || 0, x(F) || 0), x(b).style.opacity = String(n)); break; case "hide-exhausted": x(b) && (x(b).style.opacity = "0"); @@ -5722,160 +5699,160 @@ function dp(e, t) { break; } } - Is(() => U()); - function le(w, Y) { + Fs(() => U()); + function lt(w, Y) { return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; } - function ue(w, Y) { - const te = [], pe = w === "exhausted" ? Tt() : w; - let xe; - w === "exhausted" ? xe = G(1) : xe = x(L).results[0].tally[w], te.push(`${pe} started with ${xe} votes.`); - for (let se = 1; se <= Y; se++) { - se === Y && (w === "exhausted" ? xe = G(Y) : xe = x(L).results[Y - 1].tally[w], te.push(`${pe} has ${xe} votes at round ${Y}.`)); - const ze = x(L).results[se - 1].tallyResults, Ut = we(se); - for (let St = 0; St < ze.length; St++) { - const Cn = ze[St].transfers, pn = ze[St].eliminated, Ee = ze[St].elected; - if (!Ut) { + function ut(w, Y) { + const tt = [], pt = w === "exhausted" ? Re() : w; + let wt; + w === "exhausted" ? wt = et(1) : wt = x(L).results[0].tally[w], tt.push(`${pt} started with ${wt} votes.`); + for (let st = 1; st <= Y; st++) { + st === Y && (w === "exhausted" ? wt = et(Y) : wt = x(L).results[Y - 1].tally[w], tt.push(`${pt} has ${wt} votes at round ${Y}.`)); + const Vt = x(L).results[st - 1].tallyResults, Ue = yt(st); + for (let ke = 0; ke < Vt.length; ke++) { + const Cn = Vt[ke].transfers, pn = Vt[ke].eliminated, Mt = Vt[ke].elected; + if (!Ue) { if (pn) - pn === w && te.push(`${pe} will be eliminated on round ${se}.`); - else if (w === Ee && (te.push(`${pe} ${x(d).event} on round ${se}.`), Cn)) - for (let [Te, ve] of Object.entries(Cn)) - te.push(`${ve} ${le(Number(ve), se < Y)} transferred to ${Te} on round ${se}.`); + pn === w && tt.push(`${pt} will be eliminated on round ${st}.`); + else if (w === Mt && (tt.push(`${pt} ${x(p).event} on round ${st}.`), Cn)) + for (let [zt, At] of Object.entries(Cn)) + tt.push(`${At} ${lt(Number(At), st < Y)} transferred to ${zt} on round ${st}.`); } - const He = pn || Ee; - if (He) { - const Te = Number(Cn[w]); - Te && te.push(`${Te} ${le(Te, se < Y)} transferred from ${He} on round ${se}.`); + const oe = pn || Mt; + if (oe) { + const zt = Number(Cn[w]); + zt && tt.push(`${zt} ${lt(zt, st < Y)} transferred from ${oe} on round ${st}.`); } } } - return [te, pe]; + return [tt, pt]; } function O() { let w = 0; for (let Y = 1; Y <= x(L).results.length; Y++) { - if (we(Y)) continue; - const te = x(L).results[Y - 1].tallyResults; - for (let pe = 0; pe < te.length; pe++) - te[pe].elected && w++; + if (yt(Y)) continue; + const tt = x(L).results[Y - 1].tallyResults; + for (let pt = 0; pt < tt.length; pt++) + tt[pt].elected && w++; } return w; } - let F, Me = /* @__PURE__ */ $e(0); - function ot(w) { - var xe; - return !((xe = x(L)) != null && xe.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((se) => se.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let I, Nt = /* @__PURE__ */ bt(0); + function se(w) { + var wt; + return !((wt = x(L)) != null && wt.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((st) => st.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function ye(w) { - var te; - if (!((te = x(L)) != null && te.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; + function mt(w) { + var tt; + if (!((tt = x(L)) != null && tt.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; const Y = x(L).results[w - 1].tallyResults; - return Y.length === 0 || Y.every((pe) => Object.keys(pe.transfers).length === 0); + return Y.length === 0 || Y.every((pt) => Object.keys(pt.transfers).length === 0); } - function we(w) { + function yt(w) { return l() && x(L).results && w === x(L).results.length; } - function ee(w) { - return we(w) ? [] : F ? F.getEliminatedCandidates(w) : []; + function Q(w) { + return yt(w) ? [] : I ? I.getEliminatedCandidates(w) : []; } - function Pe(w) { - return we(w) ? [] : F ? F.getElectedCandidates(w) : []; + function kt(w) { + return yt(w) ? [] : I ? I.getElectedCandidates(w) : []; } - function G(w) { - return F ? F.countExhaustedVotes(w) : 0; + function et(w) { + return I ? I.countExhaustedVotes(w) : 0; } - function Fe() { - F && F.animateOnePhaseFn && F.animateOnePhaseFn(); + function Ot() { + I && I.animateOnePhaseFn && I.animateOnePhaseFn(); } - function Tt() { - return F ? F.exhaustedLabel : ""; + function Re() { + return I ? I.exhaustedLabel : ""; } - function ie() { - return F ? F.pieColors : {}; + function it() { + return I ? I.pieColors : {}; } - var Ze = { + var jt = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), re(); + r(w), rt(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), re(); + i(w), rt(); }, get requestRoundChange() { return s(); }, set requestRoundChange(w = (Y) => { }) { - s(w), re(); + s(w), rt(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), re(); + a(w), rt(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), re(); + o(w), rt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), re(); + l(w), rt(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), re(); + u(w), rt(); }, get randomizeOrder() { return f(); }, set randomizeOrder(w = !1) { - f(w), re(); + f(w), rt(); }, get showCaptions() { - return p(); + return d(); }, set showCaptions(w = !1) { - p(w), re(); + d(w), rt(); } - }, Xt = cp(), lt = _n(Xt), Tn = We(lt); + }, ve = fp(), ae = _n(ve), Tn = Bt(ae); { - let w = /* @__PURE__ */ vn(() => ot(i())), Y = /* @__PURE__ */ vn(() => ye(i())); + let w = /* @__PURE__ */ vn(() => se(i())), Y = /* @__PURE__ */ vn(() => mt(i())); xl(Tn, { get labels() { return x(w); }, get currentStep() { - return x(Me); + return x(Nt); }, get disabled() { return x(Y); }, - onAdvance: Fe + onAdvance: Ot }); } - Ie(lt); - var _e = Qe(lt, 4), Ct = We(_e), Wt = We(Ct), jr = We(Wt); + It(ae); + var _t = Jt(ae, 4), Se = Bt(_t), We = Bt(Se), Kr = Bt(We); vi( - wl(jr, { + wl(Kr, { get jsonData() { return x(L); }, get currentRound() { return i(); }, - requestRoundChange: oe, + requestRoundChange: ot, get candidateColors() { return a(); }, @@ -5892,127 +5869,127 @@ function dp(e, t) { return x(D); }, set mouseEventType(w) { - he(D, w, !0); + ht(D, w, !0); }, get mouseData() { return x(M); }, set mouseData(w) { - he(M, w, !0); + ht(M, w, !0); }, get mouseX() { return x(S); }, set mouseX(w) { - he(S, w, !0); + ht(S, w, !0); }, get mouseY() { - return x(I); + return x(F); }, set mouseY(w) { - he(I, w, !0); + ht(F, w, !0); }, get displayPhase() { - return x(Me); + return x(Nt); }, set displayPhase(w) { - he(Me, w, !0); + ht(Nt, w, !0); } }), - (w) => F = w, - () => F - ), Ie(Wt), Ie(Ct); - var Jr = Qe(Ct, 2); + (w) => I = w, + () => I + ), It(We), It(Se); + var jr = Jt(Se, 2); { - var Zr = (w) => { - var Y = up(), te = _n(Y), pe = We(te); - Ie(te); - var xe = Qe(te, 2), se = We(xe); + var Jr = (w) => { + var Y = lp(), tt = _n(Y), pt = Bt(tt); + It(tt); + var wt = Jt(tt, 2), st = Bt(wt); { - var ze = (Ee) => { - var He = ap(), Te = Qe(_n(He)); - pi(Te, 17, () => ee(i()), di, (ve, ut, Ye) => { - var Gt = sp(), Nt = _n(Gt); - let Kt; - var Rn = We(Nt, !0); - Ie(Nt); - var me = Qe(Nt, 2); + var Vt = (Mt) => { + var oe = sp(), zt = Jt(_n(oe)); + pi(zt, 17, () => Q(i()), di, (At, ge, _e) => { + var Ge = ip(), me = _n(Ge); + let Ke; + var Rn = Bt(me, !0); + It(me); + var vt = Jt(me, 2); { - var br = (jt) => { - var kt = ga(", "); - Ge(jt, kt); - }, $r = /* @__PURE__ */ vn(() => Ye < ee(i()).length - 1); - Qn(me, (jt) => { - x($r) && jt(br); + var br = (Me) => { + var je = ga(", "); + Wt(Me, je); + }, $r = /* @__PURE__ */ vn(() => _e < Q(i()).length - 1); + Qn(vt, (Me) => { + x($r) && Me(br); }); } - Qt( - (jt) => { - Kt = wa(Nt, "", Kt, jt), mn(Rn, x(ut)); + Qe( + (Me) => { + Ke = wa(me, "", Ke, Me), mn(Rn, x(ge)); }, - [() => ({ color: ie()[x(ut)] })] - ), Ge(ve, Gt); - }), Ge(Ee, He); - }, Ut = /* @__PURE__ */ vn(() => ee(i()).length > 0); - Qn(se, (Ee) => { - x(Ut) && Ee(ze); + [() => ({ color: it()[x(ge)] })] + ), Wt(At, Ge); + }), Wt(Mt, oe); + }, Ue = /* @__PURE__ */ vn(() => Q(i()).length > 0); + Qn(st, (Mt) => { + x(Ue) && Mt(Vt); }); } - var St = Qe(se, 2); + var ke = Jt(st, 2); { - var Cn = (Ee) => { - var He = lp(), Te = _n(He), ve = Qe(Te); - pi(ve, 17, () => Pe(i()), di, (ut, Ye, Gt) => { - var Nt = op(), Kt = _n(Nt); + var Cn = (Mt) => { + var oe = op(), zt = _n(oe), At = Jt(zt); + pi(At, 17, () => kt(i()), di, (ge, _e, Ge) => { + var me = ap(), Ke = _n(me); let Rn; - var me = We(Kt, !0); - Ie(Kt); - var br = Qe(Kt, 2); + var vt = Bt(Ke, !0); + It(Ke); + var br = Jt(Ke, 2); { - var $r = (kt) => { + var $r = (je) => { var ji = ga(", "); - Ge(kt, ji); - }, jt = /* @__PURE__ */ vn(() => Gt < Pe(i()).length - 1); - Qn(br, (kt) => { - x(jt) && kt($r); + Wt(je, ji); + }, Me = /* @__PURE__ */ vn(() => Ge < kt(i()).length - 1); + Qn(br, (je) => { + x(Me) && je($r); }); } - Qt( - (kt) => { - Rn = wa(Kt, "", Rn, kt), mn(me, x(Ye)); + Qe( + (je) => { + Rn = wa(Ke, "", Rn, je), mn(vt, x(_e)); }, - [() => ({ color: ie()[x(Ye)] })] - ), Ge(ut, Nt); - }), Qt(() => mn(Te, `${x(d).caption ?? ""}: `)), Ge(Ee, He); - }, pn = /* @__PURE__ */ vn(() => Pe(i()).length > 0); - Qn(St, (Ee) => { - x(pn) && Ee(Cn); + [() => ({ color: it()[x(_e)] })] + ), Wt(ge, me); + }), Qe(() => mn(zt, `${x(p).caption ?? ""}: `)), Wt(Mt, oe); + }, pn = /* @__PURE__ */ vn(() => kt(i()).length > 0); + Qn(ke, (Mt) => { + x(pn) && Mt(Cn); }); } - Ie(xe), Qt((Ee) => mn(pe, `${x(L).config.contest ?? ""}, ${Ee ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, Y); + It(wt), Qe((Mt) => mn(pt, `${x(L).config.contest ?? ""}, ${Mt ?? ""} ${x(p).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Wt(w, Y); }; - Qn(Jr, (w) => { - p() && w(Zr); + Qn(jr, (w) => { + d() && w(Jr); }); } - Ie(_e); - var Jn = Qe(_e, 2), Rt = We(Jn), Ki = We(Rt, !0); - Ie(Rt); - var Qr = Qe(Rt, 2); - pi(Qr, 17, () => x($), di, (w, Y) => { - var te = fp(), pe = _n(te), xe = We(pe, !0); - Ie(pe), us(2), Qt(() => mn(xe, x(Y))), Ge(w, te); - }), Ie(Jn), vi(Jn, (w) => he(y, w), () => x(y)); - var dn = Qe(Jn, 2), xr = We(dn); - return us(2), Ie(dn), vi(dn, (w) => he(b, w), () => x(b)), Qt( + It(_t); + var Jn = Jt(_t, 2), Ne = Bt(Jn), Ki = Bt(Ne, !0); + It(Ne); + var Zr = Jt(Ne, 2); + pi(Zr, 17, () => x($), di, (w, Y) => { + var tt = up(), pt = _n(tt), wt = Bt(pt, !0); + It(pt), us(2), Qe(() => mn(wt, x(Y))), Wt(w, tt); + }), It(Jn), vi(Jn, (w) => ht(y, w), () => x(y)); + var dn = Jt(Jn, 2), xr = Bt(dn); + return us(2), It(dn), vi(dn, (w) => ht(b, w), () => x(b)), Qe( (w) => { mn(Ki, x(m)), mn(xr, `"${w ?? ""}" means all the candidates ranked on `); }, - [Tt] - ), Ge(e, Xt), zi(Ze); + [Re] + ), Wt(t, ve), zi(jt); } customElements.define("pie-chart", Ys( - dp, + hp, { electionSummary: {}, currentRound: {}, From 1214e3f4d60946f3c8c515f84dffd783ce0cc9ab Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 8 Apr 2026 18:42:41 -0700 Subject: [PATCH 07/10] Sync pie chart --- static/pie/pie-chart.es.js | 5849 ++++++++++++++++++------------------ 1 file changed, 2932 insertions(+), 2917 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 1df9f35d..5de3edb3 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,295 +1,295 @@ -var Fl = Object.defineProperty; -var oa = (t) => { - throw TypeError(t); +var Ll = Object.defineProperty; +var aa = (e) => { + throw TypeError(e); }; -var Ll = (t, e, n) => e in t ? Fl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var ct = (t, e, n) => Ll(t, typeof e != "symbol" ? e + "" : e, n), ts = (t, e, n) => e.has(t) || oa("Cannot " + n); -var v = (t, e, n) => (ts(t, e, "read from private field"), n ? n.call(t) : e.get(t)), H = (t, e, n) => e.has(t) ? oa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), V = (t, e, n, r) => (ts(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), xt = (t, e, n) => (ts(t, e, "access private method"), n); -var za; -typeof window < "u" && ((za = window.__svelte ?? (window.__svelte = {})).v ?? (za.v = /* @__PURE__ */ new Set())).add("5"); -const ql = 1, Vl = 2, Xa = 4, zl = 8, Hl = 16, Yl = 1, Bl = 4, Xl = 8, Wl = 16, Ul = 1, Gl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Tt = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; -var Ua = Array.isArray, Kl = Array.prototype.indexOf, fr = Array.prototype.includes, Ii = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, jl = Object.getOwnPropertyDescriptors, Jl = Object.prototype, Zl = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; -const Ql = () => { +var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var he = (e, t, n) => ql(e, typeof t != "symbol" ? t + "" : t, n), Qi = (e, t, n) => t.has(e) || aa("Cannot " + n); +var v = (e, t, n) => (Qi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? aa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (Qi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xe = (e, t, n) => (Qi(e, t, "access private method"), n); +var Va; +typeof window < "u" && ((Va = window.__svelte ?? (window.__svelte = {})).v ?? (Va.v = /* @__PURE__ */ new Set())).add("5"); +const Vl = 1, zl = 2, Ba = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ss = "[", Oi = "[!", Ns = "]", cr = {}, Te = Symbol(), Xa = "http://www.w3.org/1999/xhtml", as = !1; +var Wa = Array.isArray, jl = Array.prototype.indexOf, hr = Array.prototype.includes, Fi = Array.from, bi = Object.keys, $i = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ua = Object.getPrototypeOf, oa = Object.isExtensible; +const eu = () => { }; -function tu(t) { - for (var e = 0; e < t.length; e++) - t[e](); +function tu(e) { + for (var t = 0; t < e.length; t++) + e[t](); } -function Ka() { - var t, e, n = new Promise((r, i) => { - t = r, e = i; +function Ga() { + var e, t, n = new Promise((r, i) => { + e = r, t = i; }); - return { promise: n, resolve: t, reject: e }; + return { promise: n, resolve: e, reject: t }; } -function eu(t, e) { - if (Array.isArray(t)) - return t; - if (!(Symbol.iterator in t)) - return Array.from(t); +function nu(e, t) { + if (Array.isArray(e)) + return e; + if (!(Symbol.iterator in e)) + return Array.from(e); const n = []; - for (const r of t) - if (n.push(r), n.length === e) break; + for (const r of e) + if (n.push(r), n.length === t) break; return n; } -const Rt = 2, Or = 4, Fi = 8, ja = 1 << 24, hn = 16, Te = 32, En = 64, Ja = 128, he = 512, $t = 1024, St = 2048, Ee = 4096, ee = 8192, ln = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, nu = 1 << 20, an = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Mr = Symbol("$state"), Qa = Symbol("legacy props"), ru = Symbol(""), kn = new class extends Error { +const Re = 2, Ir = 4, Ii = 8, Ka = 1 << 24, cn = 16, Et = 32, An = 64, ja = 128, vt = 512, $e = 1024, Se = 2048, At = 4096, it = 8192, on = 16384, wr = 32768, dr = 65536, la = 1 << 17, Ja = 1 << 18, Kn = 1 << 19, ru = 1 << 20, sn = 1 << 25, Xn = 65536, os = 1 << 21, ks = 1 << 22, yn = 1 << 23, Dr = Symbol("$state"), Za = Symbol("legacy props"), iu = Symbol(""), Nn = new class extends Error { constructor() { super(...arguments); - ct(this, "name", "StaleReactionError"); - ct(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + he(this, "name", "StaleReactionError"); + he(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var Ha; -const iu = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Wr = 3, yr = 8; -function su(t) { +var za; +const su = ((za = globalThis.document) == null ? void 0 : /* @__PURE__ */ za.contentType.includes("xml")) ?? !1, Gr = 3, xr = 8; +function au(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function au() { +function ou() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function ou(t, e, n) { +function lu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function lu(t) { +function uu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function uu() { +function fu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function fu(t) { +function cu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function cu() { +function hu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function hu() { +function du() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function du(t) { +function pu(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function pu() { +function vu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function vu() { +function gu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function gu() { +function _u() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function _u() { +function mu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Li(t) { +function Li(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function mu() { +function yu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let K = !1; -function on(t) { - K = t; +let j = !1; +function an(e) { + j = e; } -let X; -function Lt(t) { - if (t === null) - throw Li(), ur; - return X = t; +let B; +function qe(e) { + if (e === null) + throw Li(), cr; + return B = e; } function qi() { - return Lt(/* @__PURE__ */ He(X)); + return qe(/* @__PURE__ */ zt(B)); } -function It(t) { - if (K) { - if (/* @__PURE__ */ He(X) !== null) - throw Li(), ur; - X = t; +function Ie(e) { + if (j) { + if (/* @__PURE__ */ zt(B) !== null) + throw Li(), cr; + B = e; } } -function us(t = 1) { - if (K) { - for (var e = t, n = X; e--; ) +function ls(e = 1) { + if (j) { + for (var t = e, n = B; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ He(n); - X = n; + /* @__PURE__ */ zt(n); + B = n; } } -function Ai(t = !0) { - for (var e = 0, n = X; ; ) { - if (n.nodeType === yr) { +function Ai(e = !0) { + for (var t = 0, n = B; ; ) { + if (n.nodeType === xr) { var r = ( /** @type {Comment} */ n.data ); - if (r === ks) { - if (e === 0) return n; - e -= 1; - } else (r === Ns || r === Oi || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); + if (r === Ns) { + if (t === 0) return n; + t -= 1; + } else (r === Ss || r === Oi || // "[1", "[2", etc. for if blocks + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ He(n) + /* @__PURE__ */ zt(n) ); - t && n.remove(), n = i; + e && n.remove(), n = i; } } -function to(t) { - if (!t || t.nodeType !== yr) - throw Li(), ur; +function Qa(e) { + if (!e || e.nodeType !== xr) + throw Li(), cr; return ( /** @type {Comment} */ - t.data + e.data ); } -function eo(t) { - return t === this.v; +function eo(e) { + return e === this.v; } -function yu(t, e) { - return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +function wu(e, t) { + return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function no(t) { - return !yu(t, this.v); +function to(e) { + return !wu(e, this.v); } -let wu = !1, re = null; -function hr(t) { - re = t; +let xu = !1, at = null; +function pr(e) { + at = e; } -function Vi(t, e = !1, n) { - re = { - p: re, +function Vi(e, t = !1, n) { + at = { + p: at, i: !1, c: null, e: null, - s: t, + s: e, x: null, l: null }; } -function zi(t) { - var e = ( +function zi(e) { + var t = ( /** @type {ComponentContext} */ - re - ), n = e.e; + at + ), n = t.e; if (n !== null) { - e.e = null; + t.e = null; for (var r of n) - Ro(r); + Co(r); } - return t !== void 0 && (e.x = t), e.i = !0, re = e.p, t ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, at = t.p, e ?? /** @type {T} */ {}; } -function ro() { +function no() { return !0; } -let Mn = []; -function io() { - var t = Mn; - Mn = [], tu(t); +let kn = []; +function ro() { + var e = kn; + kn = [], tu(e); } -function xn(t) { - if (Mn.length === 0 && !Pr) { - var e = Mn; +function wn(e) { + if (kn.length === 0 && !Or) { + var t = kn; queueMicrotask(() => { - e === Mn && io(); + t === kn && ro(); }); } - Mn.push(t); + kn.push(e); } -function xu() { - for (; Mn.length > 0; ) - io(); +function bu() { + for (; kn.length > 0; ) + ro(); } -function so(t) { - var e = j; - if (e === null) - return B.f |= wn, t; - if ((e.f & mr) === 0 && (e.f & Or) === 0) - throw t; - dr(t, e); +function io(e) { + var t = J; + if (t === null) + return Y.f |= yn, e; + if ((t.f & wr) === 0 && (t.f & Ir) === 0) + throw e; + vr(e, t); } -function dr(t, e) { - for (; e !== null; ) { - if ((e.f & Ja) !== 0) { - if ((e.f & mr) === 0) - throw t; +function vr(e, t) { + for (; t !== null; ) { + if ((t.f & ja) !== 0) { + if ((t.f & wr) === 0) + throw e; try { - e.b.error(t); + t.b.error(e); return; } catch (n) { - t = n; + e = n; } } - e = e.parent; + t = t.parent; } - throw t; + throw e; } -const bu = -7169; -function dt(t, e) { - t.f = t.f & bu | e; +const $u = -7169; +function pe(e, t) { + e.f = e.f & $u | t; } -function Ps(t) { - (t.f & he) !== 0 || t.deps === null ? dt(t, $t) : dt(t, Ee); +function Ms(e) { + (e.f & vt) !== 0 || e.deps === null ? pe(e, $e) : pe(e, At); } -function ao(t) { - if (t !== null) - for (const e of t) - (e.f & Rt) === 0 || (e.f & Wn) === 0 || (e.f ^= Wn, ao( +function so(e) { + if (e !== null) + for (const t of e) + (t.f & Re) === 0 || (t.f & Xn) === 0 || (t.f ^= Xn, so( /** @type {Derived} */ - e.deps + t.deps )); } -function oo(t, e, n) { - (t.f & St) !== 0 ? e.add(t) : (t.f & Ee) !== 0 && n.add(t), ao(t.deps), dt(t, $t); +function ao(e, t, n) { + (e.f & Se) !== 0 ? t.add(e) : (e.f & At) !== 0 && n.add(e), so(e.deps), pe(e, $e); } const ni = /* @__PURE__ */ new Set(); -let G = null, Ct = null, Ut = [], Hi = null, fs = !1, Pr = !1; -var nr, rr, In, ir, zr, Hr, Fn, tn, sr, ze, cs, hs, lo; -const Js = class Js { +let K = null, Ce = null, Ke = [], Hi = null, us = !1, Or = !1; +var ir, sr, On, ar, Yr, Br, Fn, Qt, or, Vt, fs, cs, oo; +const js = class js { constructor() { - H(this, ze); - ct(this, "committed", !1); + H(this, Vt); + he(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - ct(this, "current", /* @__PURE__ */ new Map()); + he(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - ct(this, "previous", /* @__PURE__ */ new Map()); + he(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - H(this, nr, /* @__PURE__ */ new Set()); + H(this, ir, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - H(this, rr, /* @__PURE__ */ new Set()); + H(this, sr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - H(this, In, 0); + H(this, On, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - H(this, ir, 0); + H(this, ar, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - H(this, zr, null); + H(this, Yr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - H(this, Hr, /* @__PURE__ */ new Set()); + H(this, Br, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} @@ -302,54 +302,54 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, tn, /* @__PURE__ */ new Map()); - ct(this, "is_fork", !1); - H(this, sr, !1); + H(this, Qt, /* @__PURE__ */ new Map()); + he(this, "is_fork", !1); + H(this, or, !1); } is_deferred() { - return this.is_fork || v(this, ir) > 0; + return this.is_fork || v(this, ar) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(e) { - v(this, tn).has(e) || v(this, tn).set(e, { d: [], m: [] }); + skip_effect(t) { + v(this, Qt).has(t) || v(this, Qt).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(e) { - var n = v(this, tn).get(e); + unskip_effect(t) { + var n = v(this, Qt).get(t); if (n) { - v(this, tn).delete(e); + v(this, Qt).delete(t); for (var r of n.d) - dt(r, St), $e(r); + pe(r, Se), bt(r); for (r of n.m) - dt(r, Ee), $e(r); + pe(r, At), bt(r); } } /** * * @param {Effect[]} root_effects */ - process(e) { + process(t) { var i; - Ut = [], this.apply(); + Ke = [], this.apply(); var n = [], r = []; - for (const s of e) - xt(this, ze, cs).call(this, s, n, r); + for (const s of t) + xe(this, Vt, fs).call(this, s, n, r); if (this.is_deferred()) { - xt(this, ze, hs).call(this, r), xt(this, ze, hs).call(this, n); - for (const [s, a] of v(this, tn)) - ho(s, a); + xe(this, Vt, cs).call(this, r), xe(this, Vt, cs).call(this, n); + for (const [s, a] of v(this, Qt)) + co(s, a); } else { - for (const s of v(this, nr)) s(); - v(this, nr).clear(), v(this, In) === 0 && xt(this, ze, lo).call(this), G = null, fa(r), fa(n), (i = v(this, zr)) == null || i.resolve(); + for (const s of v(this, ir)) s(); + v(this, ir).clear(), v(this, On) === 0 && xe(this, Vt, oo).call(this), K = null, ua(r), ua(n), (i = v(this, Yr)) == null || i.resolve(); } - Ct = null; + Ce = null; } /** * Associate a change to a given source with the current @@ -357,106 +357,106 @@ const Js = class Js { * @param {Source} source * @param {any} value */ - capture(e, n) { - n !== Tt && !this.previous.has(e) && this.previous.set(e, n), (e.f & wn) === 0 && (this.current.set(e, e.v), Ct == null || Ct.set(e, e.v)); + capture(t, n) { + n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & yn) === 0 && (this.current.set(t, t.v), Ce == null || Ce.set(t, t.v)); } activate() { - G = this, this.apply(); + K = this, this.apply(); } deactivate() { - G === this && (G = null, Ct = null); + K === this && (K = null, Ce = null); } flush() { - if (this.activate(), Ut.length > 0) { - if (uo(), G !== null && G !== this) + if (this.activate(), Ke.length > 0) { + if (lo(), K !== null && K !== this) return; - } else v(this, In) === 0 && this.process([]); + } else v(this, On) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, rr)) e(this); - v(this, rr).clear(); + for (const t of v(this, sr)) t(this); + v(this, sr).clear(); } /** * * @param {boolean} blocking */ - increment(e) { - V(this, In, v(this, In) + 1), e && V(this, ir, v(this, ir) + 1); + increment(t) { + V(this, On, v(this, On) + 1), t && V(this, ar, v(this, ar) + 1); } /** * * @param {boolean} blocking */ - decrement(e) { - V(this, In, v(this, In) - 1), e && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { - V(this, sr, !1), this.is_deferred() ? Ut.length > 0 && this.flush() : this.revive(); + decrement(t) { + V(this, On, v(this, On) - 1), t && V(this, ar, v(this, ar) - 1), !v(this, or) && (V(this, or, !0), wn(() => { + V(this, or, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Hr)) - v(this, Fn).delete(e), dt(e, St), $e(e); - for (const e of v(this, Fn)) - dt(e, Ee), $e(e); + for (const t of v(this, Br)) + v(this, Fn).delete(t), pe(t, Se), bt(t); + for (const t of v(this, Fn)) + pe(t, At), bt(t); this.flush(); } /** @param {() => void} fn */ - oncommit(e) { - v(this, nr).add(e); + oncommit(t) { + v(this, ir).add(t); } /** @param {(batch: Batch) => void} fn */ - ondiscard(e) { - v(this, rr).add(e); + ondiscard(t) { + v(this, sr).add(t); } settled() { - return (v(this, zr) ?? V(this, zr, Ka())).promise; + return (v(this, Yr) ?? V(this, Yr, Ga())).promise; } static ensure() { - if (G === null) { - const e = G = new Js(); - ni.add(G), Pr || xn(() => { - G === e && e.flush(); + if (K === null) { + const t = K = new js(); + ni.add(K), Or || wn(() => { + K === t && t.flush(); }); } - return G; + return K; } apply() { } }; -nr = new WeakMap(), rr = new WeakMap(), In = new WeakMap(), ir = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(), Fn = new WeakMap(), tn = new WeakMap(), sr = new WeakMap(), ze = new WeakSet(), /** +ir = new WeakMap(), sr = new WeakMap(), On = new WeakMap(), ar = new WeakMap(), Yr = new WeakMap(), Br = new WeakMap(), Fn = new WeakMap(), Qt = new WeakMap(), or = new WeakMap(), Vt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -cs = function(e, n, r) { - e.f ^= $t; - for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Te | En)) !== 0, l = o && (a & $t) !== 0, u = l || (a & ee) !== 0 || v(this, tn).has(i); +fs = function(t, n, r) { + t.f ^= $e; + for (var i = t.first, s = null; i !== null; ) { + var a = i.f, o = (a & (Et | An)) !== 0, l = o && (a & $e) !== 0, u = l || (a & it) !== 0 || v(this, Qt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= $t : s !== null && (a & (Or | Fi | ja)) !== 0 ? s.b.defer_effect(i) : (a & Or) !== 0 ? n.push(i) : Ur(i) && ((a & hn) !== 0 && v(this, Fn).add(i), vr(i)); + o ? i.f ^= $e : s !== null && (a & (Ir | Ii | Ka)) !== 0 ? s.b.defer_effect(i) : (a & Ir) !== 0 ? n.push(i) : Kr(i) && ((a & cn) !== 0 && v(this, Fn).add(i), _r(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var d = i.parent; - for (i = i.next; i === null && d !== null; ) - d === s && (s = null), i = d.next, d = d.parent; + var p = i.parent; + for (i = i.next; i === null && p !== null; ) + p === s && (s = null), i = p.next, p = p.parent; } }, /** * @param {Effect[]} effects */ -hs = function(e) { - for (var n = 0; n < e.length; n += 1) - oo(e[n], v(this, Hr), v(this, Fn)); -}, lo = function() { +cs = function(t) { + for (var n = 0; n < t.length; n += 1) + ao(t[n], v(this, Br), v(this, Fn)); +}, oo = function() { var i; if (ni.size > 1) { this.previous.clear(); - var e = Ct, n = !0; + var t = Ce, n = !0; for (const s of ni) { if (s === this) { n = !1; @@ -475,114 +475,114 @@ hs = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ut; - Ut = []; + var r = Ke; + Ke = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - fo(f, o, l, u); - if (Ut.length > 0) { - G = s, s.apply(); - for (const f of Ut) - xt(i = s, ze, cs).call(i, f, [], []); + uo(f, o, l, u); + if (Ke.length > 0) { + K = s, s.apply(); + for (const f of Ke) + xe(i = s, Vt, fs).call(i, f, [], []); s.deactivate(); } - Ut = r; + Ke = r; } } - G = null, Ct = e; + K = null, Ce = t; } this.committed = !0, ni.delete(this); }; -let un = Js; -function rt(t) { - var e = Pr; - Pr = !0; +let ln = js; +function ne(e) { + var t = Or; + Or = !0; try { for (var n; ; ) { - if (xu(), Ut.length === 0 && (G == null || G.flush(), Ut.length === 0)) + if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) return Hi = null, /** @type {T} */ n; - uo(); + lo(); } } finally { - Pr = e; + Or = t; } } -function uo() { - fs = !0; - var t = null; +function lo() { + us = !0; + var e = null; try { - for (var e = 0; Ut.length > 0; ) { - var n = un.ensure(); - if (e++ > 1e3) { + for (var t = 0; Ke.length > 0; ) { + var n = ln.ensure(); + if (t++ > 1e3) { var r, i; - $u(); + Au(); } - n.process(Ut), bn.clear(); + n.process(Ke), xn.clear(); } } finally { - Ut = [], fs = !1, Hi = null; + Ke = [], us = !1, Hi = null; } } -function $u() { +function Au() { try { - cu(); - } catch (t) { - dr(t, Hi); - } -} -let we = null; -function fa(t) { - var e = t.length; - if (e !== 0) { - for (var n = 0; n < e; ) { - var r = t[n++]; - if ((r.f & (ln | ee)) === 0 && Ur(r) && (we = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (we == null ? void 0 : we.size) > 0)) { - bn.clear(); - for (const i of we) { - if ((i.f & (ln | ee)) !== 0) continue; + hu(); + } catch (e) { + vr(e, Hi); + } +} +let yt = null; +function ua(e) { + var t = e.length; + if (t !== 0) { + for (var n = 0; n < t; ) { + var r = e[n++]; + if ((r.f & (on | it)) === 0 && Kr(r) && (yt = /* @__PURE__ */ new Set(), _r(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && No(r), (yt == null ? void 0 : yt.size) > 0)) { + xn.clear(); + for (const i of yt) { + if ((i.f & (on | it)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - we.has(a) && (we.delete(a), s.push(a)), a = a.parent; + yt.has(a) && (yt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (ln | ee)) === 0 && vr(l); + (l.f & (on | it)) === 0 && _r(l); } } - we.clear(); + yt.clear(); } } - we = null; + yt = null; } } -function fo(t, e, n, r) { - if (!n.has(t) && (n.add(t), t.reactions !== null)) - for (const i of t.reactions) { +function uo(e, t, n, r) { + if (!n.has(e) && (n.add(e), e.reactions !== null)) + for (const i of e.reactions) { const s = i.f; - (s & Rt) !== 0 ? fo( + (s & Re) !== 0 ? uo( /** @type {Derived} */ i, - e, + t, n, r - ) : (s & (Ms | hn)) !== 0 && (s & St) === 0 && co(i, e, r) && (dt(i, St), $e( + ) : (s & (ks | cn)) !== 0 && (s & Se) === 0 && fo(i, t, r) && (pe(i, Se), bt( /** @type {Effect} */ i )); } } -function co(t, e, n) { - const r = n.get(t); +function fo(e, t, n) { + const r = n.get(e); if (r !== void 0) return r; - if (t.deps !== null) - for (const i of t.deps) { - if (fr.call(e, i)) + if (e.deps !== null) + for (const i of e.deps) { + if (hr.call(t, i)) return !0; - if ((i.f & Rt) !== 0 && co( + if ((i.f & Re) !== 0 && fo( /** @type {Derived} */ i, - e, + t, n )) return n.set( @@ -591,82 +591,82 @@ function co(t, e, n) { !0 ), !0; } - return n.set(t, !1), !1; + return n.set(e, !1), !1; } -function $e(t) { - for (var e = Hi = t; e.parent !== null; ) { - e = e.parent; - var n = e.f; - if (fs && e === j && (n & hn) !== 0 && (n & Za) === 0) +function bt(e) { + for (var t = Hi = e; t.parent !== null; ) { + t = t.parent; + var n = t.f; + if (us && t === J && (n & cn) !== 0 && (n & Ja) === 0) return; - if ((n & (En | Te)) !== 0) { - if ((n & $t) === 0) return; - e.f ^= $t; + if ((n & (An | Et)) !== 0) { + if ((n & $e) === 0) return; + t.f ^= $e; } } - Ut.push(e); + Ke.push(t); } -function ho(t, e) { - if (!((t.f & Te) !== 0 && (t.f & $t) !== 0)) { - (t.f & St) !== 0 ? e.d.push(t) : (t.f & Ee) !== 0 && e.m.push(t), dt(t, $t); - for (var n = t.first; n !== null; ) - ho(n, e), n = n.next; +function co(e, t) { + if (!((e.f & Et) !== 0 && (e.f & $e) !== 0)) { + (e.f & Se) !== 0 ? t.d.push(e) : (e.f & At) !== 0 && t.m.push(e), pe(e, $e); + for (var n = e.first; n !== null; ) + co(n, t), n = n.next; } } -function Au(t) { - let e = 0, n = Un(0), r; +function Eu(e) { + let t = 0, n = Wn(0), r; return () => { - Is() && (x(n), Ls(() => (e === 0 && (r = Xi(() => t(() => Dr(n)))), e += 1, () => { - xn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Dr(n)); + Os() && ($(n), Is(() => (t === 0 && (r = Xi(() => e(() => Fr(n)))), t += 1, () => { + wn(() => { + t -= 1, t === 0 && (r == null || r(), r = void 0, Fr(n)); }); }))); }; } -var Eu = cr | jn | Ja; -function Tu(t, e, n) { - new Cu(t, e, n); +var Tu = dr | Kn | ja; +function Cu(e, t, n) { + new Ru(e, t, n); } -var Qt, Yr, De, Ln, Oe, ue, Xt, Ie, en, yn, qn, nn, ar, Vn, or, lr, rn, Pi, gt, po, vo, ds, fi, ci, ps; -class Cu { +var nt, Xr, Pt, In, Dt, ht, Ue, Ot, en, mn, Ln, tn, lr, qn, ur, fr, nn, Pi, ve, ho, po, hs, fi, ci, ds; +class Ru { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(e, n, r) { - H(this, gt); + constructor(t, n, r) { + H(this, ve); /** @type {Boundary | null} */ - ct(this, "parent"); - ct(this, "is_pending", !1); + he(this, "parent"); + he(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, Qt); + H(this, nt); /** @type {TemplateNode | null} */ - H(this, Yr, K ? X : null); + H(this, Xr, j ? B : null); /** @type {BoundaryProps} */ - H(this, De); + H(this, Pt); /** @type {((anchor: Node) => void)} */ - H(this, Ln); + H(this, In); /** @type {Effect} */ - H(this, Oe); + H(this, Dt); /** @type {Effect | null} */ - H(this, ue, null); + H(this, ht, null); /** @type {Effect | null} */ - H(this, Xt, null); + H(this, Ue, null); /** @type {Effect | null} */ - H(this, Ie, null); + H(this, Ot, null); /** @type {DocumentFragment | null} */ H(this, en, null); /** @type {TemplateNode | null} */ - H(this, yn, null); - H(this, qn, 0); - H(this, nn, 0); - H(this, ar, !1); - H(this, Vn, !1); + H(this, mn, null); + H(this, Ln, 0); + H(this, tn, 0); + H(this, lr, !1); + H(this, qn, !1); /** @type {Set} */ - H(this, or, /* @__PURE__ */ new Set()); + H(this, ur, /* @__PURE__ */ new Set()); /** @type {Set} */ - H(this, lr, /* @__PURE__ */ new Set()); + H(this, fr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -674,38 +674,38 @@ class Cu { * calls followed by no-op flushes * @type {Source | null} */ - H(this, rn, null); - H(this, Pi, Au(() => (V(this, rn, Un(v(this, qn))), () => { - V(this, rn, null); + H(this, nn, null); + H(this, Pi, Eu(() => (V(this, nn, Wn(v(this, Ln))), () => { + V(this, nn, null); }))); - V(this, Qt, e), V(this, De, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - j.b, this.is_pending = !!v(this, De).pending, V(this, Oe, qs(() => { - if (j.b = this, K) { - const s = v(this, Yr); + V(this, nt, t), V(this, Pt, n), V(this, In, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Pt).pending, V(this, Dt, Ls(() => { + if (J.b = this, j) { + const s = v(this, Xr); qi(), /** @type {Comment} */ - s.nodeType === yr && /** @type {Comment} */ - s.data === Oi ? xt(this, gt, vo).call(this) : (xt(this, gt, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); + s.nodeType === xr && /** @type {Comment} */ + s.data === Oi ? xe(this, ve, po).call(this) : (xe(this, ve, ho).call(this), v(this, tn) === 0 && (this.is_pending = !1)); } else { - var i = xt(this, gt, ds).call(this); + var i = xe(this, ve, hs).call(this); try { - V(this, ue, ce(() => r(i))); + V(this, ht, pt(() => r(i))); } catch (s) { this.error(s); } - v(this, nn) > 0 ? xt(this, gt, ci).call(this) : this.is_pending = !1; + v(this, tn) > 0 ? xe(this, ve, ci).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, yn)) == null || s.remove(); + (s = v(this, mn)) == null || s.remove(); }; - }, Eu)), K && V(this, Qt, X); + }, Tu)), j && V(this, nt, B); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(e) { - oo(e, v(this, or), v(this, lr)); + defer_effect(t) { + ao(t, v(this, ur), v(this, fr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Cu { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, De).pending; + return !!v(this, Pt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,200 +723,200 @@ class Cu { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(e) { - xt(this, gt, ps).call(this, e), V(this, qn, v(this, qn) + e), !(!v(this, rn) || v(this, ar)) && (V(this, ar, !0), xn(() => { - V(this, ar, !1), v(this, rn) && pr(v(this, rn), v(this, qn)); + update_pending_count(t) { + xe(this, ve, ds).call(this, t), V(this, Ln, v(this, Ln) + t), !(!v(this, nn) || v(this, lr)) && (V(this, lr, !0), wn(() => { + V(this, lr, !1), v(this, nn) && gr(v(this, nn), v(this, Ln)); })); } get_effect_pending() { - return v(this, Pi).call(this), x( + return v(this, Pi).call(this), $( /** @type {Source} */ - v(this, rn) + v(this, nn) ); } /** @param {unknown} error */ - error(e) { - var n = v(this, De).onerror; - let r = v(this, De).failed; - if (v(this, Vn) || !n && !r) - throw e; - v(this, ue) && (qt(v(this, ue)), V(this, ue, null)), v(this, Xt) && (qt(v(this, Xt)), V(this, Xt, null)), v(this, Ie) && (qt(v(this, Ie)), V(this, Ie, null)), K && (Lt( + error(t) { + var n = v(this, Pt).onerror; + let r = v(this, Pt).failed; + if (v(this, qn) || !n && !r) + throw t; + v(this, ht) && (Ve(v(this, ht)), V(this, ht, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Ot) && (Ve(v(this, Ot)), V(this, Ot, null)), j && (qe( /** @type {TemplateNode} */ - v(this, Yr) - ), us(), Lt(Ai())); + v(this, Xr) + ), ls(), qe(Ai())); var i = !1, s = !1; const a = () => { if (i) { - mu(); + yu(); return; } - i = !0, s && _u(), un.ensure(), V(this, qn, 0), v(this, Ie) !== null && Yn(v(this, Ie), () => { - V(this, Ie, null); - }), this.is_pending = this.has_pending_snippet(), V(this, ue, xt(this, gt, fi).call(this, () => (V(this, Vn, !1), ce(() => v(this, Ln).call(this, v(this, Qt)))))), v(this, nn) > 0 ? xt(this, gt, ci).call(this) : this.is_pending = !1; + i = !0, s && mu(), ln.ensure(), V(this, Ln, 0), v(this, Ot) !== null && Hn(v(this, Ot), () => { + V(this, Ot, null); + }), this.is_pending = this.has_pending_snippet(), V(this, ht, xe(this, ve, fi).call(this, () => (V(this, qn, !1), pt(() => v(this, In).call(this, v(this, nt)))))), v(this, tn) > 0 ? xe(this, ve, ci).call(this) : this.is_pending = !1; }; - xn(() => { + wn(() => { try { - s = !0, n == null || n(e, a), s = !1; + s = !0, n == null || n(t, a), s = !1; } catch (o) { - dr(o, v(this, Oe) && v(this, Oe).parent); + vr(o, v(this, Dt) && v(this, Dt).parent); } - r && V(this, Ie, xt(this, gt, fi).call(this, () => { - un.ensure(), V(this, Vn, !0); + r && V(this, Ot, xe(this, ve, fi).call(this, () => { + ln.ensure(), V(this, qn, !0); try { - return ce(() => { + return pt(() => { r( - v(this, Qt), - () => e, + v(this, nt), + () => t, () => a ); }); } catch (o) { - return dr( + return vr( o, /** @type {Effect} */ - v(this, Oe).parent + v(this, Dt).parent ), null; } finally { - V(this, Vn, !1); + V(this, qn, !1); } })); }); } } -Qt = new WeakMap(), Yr = new WeakMap(), De = new WeakMap(), Ln = new WeakMap(), Oe = new WeakMap(), ue = new WeakMap(), Xt = new WeakMap(), Ie = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), nn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), rn = new WeakMap(), Pi = new WeakMap(), gt = new WeakSet(), po = function() { +nt = new WeakMap(), Xr = new WeakMap(), Pt = new WeakMap(), In = new WeakMap(), Dt = new WeakMap(), ht = new WeakMap(), Ue = new WeakMap(), Ot = new WeakMap(), en = new WeakMap(), mn = new WeakMap(), Ln = new WeakMap(), tn = new WeakMap(), lr = new WeakMap(), qn = new WeakMap(), ur = new WeakMap(), fr = new WeakMap(), nn = new WeakMap(), Pi = new WeakMap(), ve = new WeakSet(), ho = function() { try { - V(this, ue, ce(() => v(this, Ln).call(this, v(this, Qt)))); - } catch (e) { - this.error(e); + V(this, ht, pt(() => v(this, In).call(this, v(this, nt)))); + } catch (t) { + this.error(t); } -}, vo = function() { - const e = v(this, De).pending; - e && (V(this, Xt, ce(() => e(v(this, Qt)))), xn(() => { - var n = xt(this, gt, ds).call(this); - V(this, ue, xt(this, gt, fi).call(this, () => (un.ensure(), ce(() => v(this, Ln).call(this, n))))), v(this, nn) > 0 ? xt(this, gt, ci).call(this) : (Yn( +}, po = function() { + const t = v(this, Pt).pending; + t && (V(this, Ue, pt(() => t(v(this, nt)))), wn(() => { + var n = xe(this, ve, hs).call(this); + V(this, ht, xe(this, ve, fi).call(this, () => (ln.ensure(), pt(() => v(this, In).call(this, n))))), v(this, tn) > 0 ? xe(this, ve, ci).call(this) : (Hn( /** @type {Effect} */ - v(this, Xt), + v(this, Ue), () => { - V(this, Xt, null); + V(this, Ue, null); } ), this.is_pending = !1); })); -}, ds = function() { - var e = v(this, Qt); - return this.is_pending && (V(this, yn, ne()), v(this, Qt).before(v(this, yn)), e = v(this, yn)), e; +}, hs = function() { + var t = v(this, nt); + return this.is_pending && (V(this, mn, st()), v(this, nt).before(v(this, mn)), t = v(this, mn)), t; }, /** * @param {() => Effect | null} fn */ -fi = function(e) { - var n = j, r = B, i = re; - Ve(v(this, Oe)), pe(v(this, Oe)), hr(v(this, Oe).ctx); +fi = function(t) { + var n = J, r = Y, i = at; + qt(v(this, Dt)), _t(v(this, Dt)), pr(v(this, Dt).ctx); try { - return e(); + return t(); } catch (s) { - return so(s), null; + return io(s), null; } finally { - Ve(n), pe(r), hr(i); + qt(n), _t(r), pr(i); } }, ci = function() { - const e = ( + const t = ( /** @type {(anchor: Node) => void} */ - v(this, De).pending + v(this, Pt).pending ); - v(this, ue) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( + v(this, ht) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ - v(this, yn) - ), Do(v(this, ue), v(this, en))), v(this, Xt) === null && V(this, Xt, ce(() => e(v(this, Qt)))); + v(this, mn) + ), Po(v(this, ht), v(this, en))), v(this, Ue) === null && V(this, Ue, pt(() => t(v(this, nt)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ -ps = function(e) { +ds = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && xt(n = this.parent, gt, ps).call(n, e); + this.parent && xe(n = this.parent, ve, ds).call(n, t); return; } - if (V(this, nn, v(this, nn) + e), v(this, nn) === 0) { + if (V(this, tn, v(this, tn) + t), v(this, tn) === 0) { this.is_pending = !1; - for (const r of v(this, or)) - dt(r, St), $e(r); - for (const r of v(this, lr)) - dt(r, Ee), $e(r); - v(this, or).clear(), v(this, lr).clear(), v(this, Xt) && Yn(v(this, Xt), () => { - V(this, Xt, null); - }), v(this, en) && (v(this, Qt).before(v(this, en)), V(this, en, null)); + for (const r of v(this, ur)) + pe(r, Se), bt(r); + for (const r of v(this, fr)) + pe(r, At), bt(r); + v(this, ur).clear(), v(this, fr).clear(), v(this, Ue) && Hn(v(this, Ue), () => { + V(this, Ue, null); + }), v(this, en) && (v(this, nt).before(v(this, en)), V(this, en, null)); } }; -function Ru(t, e, n, r) { +function Su(e, t, n, r) { const i = Yi; - var s = t.filter((c) => !c.settled); + var s = e.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(e.map(i)); + r(t.map(i)); return; } - var a = G, o = ( + var a = K, o = ( /** @type {Effect} */ - j - ), l = Su(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + J + ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); - } catch (p) { - (o.f & ln) === 0 && dr(p, o); + } catch (d) { + (o.f & on) === 0 && vr(d, o); } - a == null || a.deactivate(), vs(); + a == null || a.deactivate(), ps(); } if (n.length === 0) { - u.then(() => f(e.map(i))); + u.then(() => f(t.map(i))); return; } - function d() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ Nu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => dr(c, o)); + function p() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => vr(c, o)); } - u ? u.then(d) : d(); + u ? u.then(p) : p(); } -function Su() { - var t = j, e = B, n = re, r = G; +function Nu() { + var e = J, t = Y, n = at, r = K; return function(s = !0) { - Ve(t), pe(e), hr(n), s && (r == null || r.activate()); + qt(e), _t(t), pr(n), s && (r == null || r.activate()); }; } -function vs() { - Ve(null), pe(null), hr(null); +function ps() { + qt(null), _t(null), pr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(t) { - var e = Rt | St, n = B !== null && (B.f & Rt) !== 0 ? ( +function Yi(e) { + var t = Re | Se, n = Y !== null && (Y.f & Re) !== 0 ? ( /** @type {Derived} */ - B + Y ) : null; - return j !== null && (j.f |= jn), { - ctx: re, + return J !== null && (J.f |= Kn), { + ctx: at, deps: null, effects: null, equals: eo, - f: e, - fn: t, + f: t, + fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - Tt + Te ), wv: 0, - parent: n ?? j, + parent: n ?? J, ac: null }; } // @__NO_SIDE_EFFECTS__ -function Nu(t, e, n) { +function ku(e, t, n) { let r = ( /** @type {Effect | null} */ - j + J ); - r === null && au(); + r === null && ou(); var i = ( /** @type {Boundary} */ r.b @@ -924,124 +924,124 @@ function Nu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Un( + ), a = Wn( /** @type {V} */ - Tt - ), o = !B, l = /* @__PURE__ */ new Map(); - return Vu(() => { - var p; - var u = Ka(); + Te + ), o = !Y, l = /* @__PURE__ */ new Map(); + return zu(() => { + var d; + var u = Ga(); s = u.promise; try { - Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === G && f.committed && f.deactivate(), vs(); + Promise.resolve(e()).then(u.resolve, u.reject).then(() => { + f === K && f.committed && f.deactivate(), ps(); }); } catch (y) { - u.reject(y), vs(); + u.reject(y), ps(); } var f = ( /** @type {Batch} */ - G + K ); if (o) { - var d = i.is_rendered(); - i.update_pending_count(1), f.increment(d), (p = l.get(f)) == null || p.reject(kn), l.delete(f), l.set(f, u); + var p = i.is_rendered(); + i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(Nn), l.delete(f), l.set(f, u); } - const c = (y, b = void 0) => { - if (f.activate(), b) - b !== kn && (a.f |= wn, pr(a, b)); + const c = (y, x = void 0) => { + if (f.activate(), x) + x !== Nn && (a.f |= yn, gr(a, x)); else { - (a.f & wn) !== 0 && (a.f ^= wn), pr(a, y); - for (const [m, $] of l) { + (a.f & yn) !== 0 && (a.f ^= yn), gr(a, y); + for (const [m, b] of l) { if (l.delete(m), m === f) break; - $.reject(kn); + b.reject(Nn); } } - o && (i.update_pending_count(-1), f.decrement(d)); + o && (i.update_pending_count(-1), f.decrement(p)); }; u.promise.then(c, (y) => c(null, y || "unknown")); - }), Fu(() => { + }), Lu(() => { for (const u of l.values()) - u.reject(kn); + u.reject(Nn); }), new Promise((u) => { - function f(d) { + function f(p) { function c() { - d === s ? u(a) : f(s); + p === s ? u(a) : f(s); } - d.then(c, c); + p.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function vn(t) { - const e = /* @__PURE__ */ Yi(t); - return Oo(e), e; +function Cn(e) { + const t = /* @__PURE__ */ Yi(e); + return Do(t), t; } // @__NO_SIDE_EFFECTS__ -function go(t) { - const e = /* @__PURE__ */ Yi(t); - return e.equals = no, e; -} -function ku(t) { - var e = t.effects; - if (e !== null) { - t.effects = null; - for (var n = 0; n < e.length; n += 1) - qt( +function vo(e) { + const t = /* @__PURE__ */ Yi(e); + return t.equals = to, t; +} +function Mu(e) { + var t = e.effects; + if (t !== null) { + e.effects = null; + for (var n = 0; n < t.length; n += 1) + Ve( /** @type {Effect} */ - e[n] + t[n] ); } } -function Mu(t) { - for (var e = t.parent; e !== null; ) { - if ((e.f & Rt) === 0) - return (e.f & ln) === 0 ? ( +function Pu(e) { + for (var t = e.parent; t !== null; ) { + if ((t.f & Re) === 0) + return (t.f & on) === 0 ? ( /** @type {Effect} */ - e + t ) : null; - e = e.parent; + t = t.parent; } return null; } -function Ds(t) { - var e, n = j; - Ve(Mu(t)); +function Ps(e) { + var t, n = J; + qt(Pu(e)); try { - t.f &= ~Wn, ku(t), e = qo(t); + e.f &= ~Xn, Mu(e), t = Lo(e); } finally { - Ve(n); + qt(n); } - return e; + return t; } -function _o(t) { - var e = Ds(t); - if (!t.equals(e) && (t.wv = Fo(), (!(G != null && G.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - dt(t, $t); +function go(e) { + var t = Ps(e); + if (!e.equals(t) && (e.wv = Fo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + pe(e, $e); return; } - An || (Ct !== null ? (Is() || G != null && G.is_fork) && Ct.set(t, e) : Ps(t)); + $n || (Ce !== null ? (Os() || K != null && K.is_fork) && Ce.set(e, t) : Ms(e)); } -function Pu(t) { - var e, n; - if (t.effects !== null) - for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = Ql, r.ac = null, Ir(r, 0), Vs(r)); +function Du(e) { + var t, n; + if (e.effects !== null) + for (const r of e.effects) + (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(Nn), r.teardown = eu, r.ac = null, Lr(r, 0), qs(r)); } -function mo(t) { - if (t.effects !== null) - for (const e of t.effects) - e.teardown && vr(e); +function _o(e) { + if (e.effects !== null) + for (const t of e.effects) + t.teardown && _r(t); } -let gs = /* @__PURE__ */ new Set(); -const bn = /* @__PURE__ */ new Map(); -let yo = !1; -function Un(t, e) { +let vs = /* @__PURE__ */ new Set(); +const xn = /* @__PURE__ */ new Map(); +let mo = !1; +function Wn(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: t, + v: e, reactions: null, equals: eo, rv: 0, @@ -1050,118 +1050,118 @@ function Un(t, e) { return n; } // @__NO_SIDE_EFFECTS__ -function bt(t, e) { - const n = Un(t); - return Oo(n), n; +function be(e, t) { + const n = Wn(e); + return Do(n), n; } // @__NO_SIDE_EFFECTS__ -function wo(t, e = !1, n = !0) { - const r = Un(t); - return e || (r.equals = no), r; +function yo(e, t = !1, n = !0) { + const r = Wn(e); + return t || (r.equals = to), r; } -function ht(t, e, n = !1) { - B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function de(e, t, n = !1) { + Y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!Ae || (B.f & ua) !== 0) && ro() && (B.f & (Rt | hn | Ms | ua)) !== 0 && (de === null || !fr.call(de, t)) && gu(); - let r = n ? Pn(e) : e; - return pr(t, r); -} -function pr(t, e) { - if (!t.equals(e)) { - var n = t.v; - An ? bn.set(t, e) : bn.set(t, n), t.v = e; - var r = un.ensure(); - if (r.capture(t, n), (t.f & Rt) !== 0) { + (!$t || (Y.f & la) !== 0) && no() && (Y.f & (Re | cn | ks | la)) !== 0 && (gt === null || !hr.call(gt, e)) && _u(); + let r = n ? Mn(t) : t; + return gr(e, r); +} +function gr(e, t) { + if (!e.equals(t)) { + var n = e.v; + $n ? xn.set(e, t) : xn.set(e, n), e.v = t; + var r = ln.ensure(); + if (r.capture(e, n), (e.f & Re) !== 0) { const i = ( /** @type {Derived} */ - t + e ); - (t.f & St) !== 0 && Ds(i), Ps(i); + (e.f & Se) !== 0 && Ps(i), Ms(i); } - t.wv = Fo(), xo(t, St), j !== null && (j.f & $t) !== 0 && (j.f & (Te | En)) === 0 && (le === null ? Yu([t]) : le.push(t)), !r.is_fork && gs.size > 0 && !yo && Du(); + e.wv = Fo(), wo(e, Se), J !== null && (J.f & $e) !== 0 && (J.f & (Et | An)) === 0 && (ct === null ? Bu([e]) : ct.push(e)), !r.is_fork && vs.size > 0 && !mo && Ou(); } - return e; + return t; } -function Du() { - yo = !1; - for (const t of gs) - (t.f & $t) !== 0 && dt(t, Ee), Ur(t) && vr(t); - gs.clear(); +function Ou() { + mo = !1; + for (const e of vs) + (e.f & $e) !== 0 && pe(e, At), Kr(e) && _r(e); + vs.clear(); } -function Dr(t) { - ht(t, t.v + 1); +function Fr(e) { + de(e, e.v + 1); } -function xo(t, e) { - var n = t.reactions; +function wo(e, t) { + var n = e.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & St) === 0; - if (o && dt(s, e), (a & Rt) !== 0) { + var s = n[i], a = s.f, o = (a & Se) === 0; + if (o && pe(s, t), (a & Re) !== 0) { var l = ( /** @type {Derived} */ s ); - Ct == null || Ct.delete(l), (a & Wn) === 0 && (a & he && (s.f |= Wn), xo(l, Ee)); - } else o && ((a & hn) !== 0 && we !== null && we.add( + Ce == null || Ce.delete(l), (a & Xn) === 0 && (a & vt && (s.f |= Xn), wo(l, At)); + } else o && ((a & cn) !== 0 && yt !== null && yt.add( /** @type {Effect} */ s - ), $e( + ), bt( /** @type {Effect} */ s )); } } -function Pn(t) { - if (typeof t != "object" || t === null || Mr in t) - return t; - const e = Ga(t); - if (e !== Jl && e !== Zl) - return t; - var n = /* @__PURE__ */ new Map(), r = Ua(t), i = /* @__PURE__ */ bt(0), s = Bn, a = (o) => { - if (Bn === s) +function Mn(e) { + if (typeof e != "object" || e === null || Dr in e) + return e; + const t = Ua(e); + if (t !== Zl && t !== Ql) + return e; + var n = /* @__PURE__ */ new Map(), r = Wa(e), i = /* @__PURE__ */ be(0), s = Yn, a = (o) => { + if (Yn === s) return o(); - var l = B, u = Bn; - pe(null), da(s); + var l = Y, u = Yn; + _t(null), ha(s); var f = o(); - return pe(l), da(u), f; + return _t(l), ha(u), f; }; - return r && n.set("length", /* @__PURE__ */ bt( + return r && n.set("length", /* @__PURE__ */ be( /** @type {any[]} */ - t.length + e.length )), new Proxy( /** @type {any} */ - t, + e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && pu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); var f = n.get(l); return f === void 0 ? a(() => { - var d = /* @__PURE__ */ bt(u.value); - return n.set(l, d), d; - }) : ht(f, u.value, !0), !0; + var p = /* @__PURE__ */ be(u.value); + return n.set(l, p), p; + }) : de(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ bt(Tt)); - n.set(l, f), Dr(i); + const f = a(() => /* @__PURE__ */ be(Te)); + n.set(l, f), Fr(i); } } else - ht(u, Tt), Dr(i); + de(u, Te), Fr(i); return !0; }, get(o, l, u) { - var p; - if (l === Mr) - return t; - var f = n.get(l), d = l in o; - if (f === void 0 && (!d || (p = Hn(o, l)) != null && p.writable) && (f = a(() => { - var y = Pn(d ? o[l] : Tt), b = /* @__PURE__ */ bt(y); - return b; + var d; + if (l === Dr) + return e; + var f = n.get(l), p = l in o; + if (f === void 0 && (!p || (d = zn(o, l)) != null && d.writable) && (f = a(() => { + var y = Mn(p ? o[l] : Te), x = /* @__PURE__ */ be(y); + return x; }), n.set(l, f)), f !== void 0) { - var c = x(f); - return c === Tt ? void 0 : c; + var c = $(f); + return c === Te ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1169,10 +1169,10 @@ function Pn(t) { var u = Reflect.getOwnPropertyDescriptor(o, l); if (u && "value" in u) { var f = n.get(l); - f && (u.value = x(f)); + f && (u.value = $(f)); } else if (u === void 0) { - var d = n.get(l), c = d == null ? void 0 : d.v; - if (d !== void 0 && c !== Tt) + var p = n.get(l), c = p == null ? void 0 : p.v; + if (p !== void 0 && c !== Te) return { enumerable: !0, configurable: !0, @@ -1184,190 +1184,190 @@ function Pn(t) { }, has(o, l) { var c; - if (l === Mr) + if (l === Dr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Tt || Reflect.has(o, l); - if (u !== void 0 || j !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Te || Reflect.has(o, l); + if (u !== void 0 || J !== null && (!f || (c = zn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? Pn(o[l]) : Tt, y = /* @__PURE__ */ bt(p); + var d = f ? Mn(o[l]) : Te, y = /* @__PURE__ */ be(d); return y; }), n.set(l, u)); - var d = x(u); - if (d === Tt) + var p = $(u); + if (p === Te) return !1; } return f; }, set(o, l, u, f) { var M; - var d = n.get(l), c = l in o; + var p = n.get(l), c = l in o; if (r && l === "length") - for (var p = u; p < /** @type {Source} */ - d.v; p += 1) { - var y = n.get(p + ""); - y !== void 0 ? ht(y, Tt) : p in o && (y = a(() => /* @__PURE__ */ bt(Tt)), n.set(p + "", y)); + for (var d = u; d < /** @type {Source} */ + p.v; d += 1) { + var y = n.get(d + ""); + y !== void 0 ? de(y, Te) : d in o && (y = a(() => /* @__PURE__ */ be(Te)), n.set(d + "", y)); } - if (d === void 0) - (!c || (M = Hn(o, l)) != null && M.writable) && (d = a(() => /* @__PURE__ */ bt(void 0)), ht(d, Pn(u)), n.set(l, d)); + if (p === void 0) + (!c || (M = zn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ be(void 0)), de(p, Mn(u)), n.set(l, p)); else { - c = d.v !== Tt; - var b = a(() => Pn(u)); - ht(d, b); + c = p.v !== Te; + var x = a(() => Mn(u)); + de(p, x); } var m = Reflect.getOwnPropertyDescriptor(o, l); if (m != null && m.set && m.set.call(f, u), !c) { if (r && typeof l == "string") { - var $ = ( + var b = ( /** @type {Source} */ n.get("length") ), D = Number(l); - Number.isInteger(D) && D >= $.v && ht($, D + 1); + Number.isInteger(D) && D >= b.v && de(b, D + 1); } - Dr(i); + Fr(i); } return !0; }, ownKeys(o) { - x(i); - var l = Reflect.ownKeys(o).filter((d) => { - var c = n.get(d); - return c === void 0 || c.v !== Tt; + $(i); + var l = Reflect.ownKeys(o).filter((p) => { + var c = n.get(p); + return c === void 0 || c.v !== Te; }); for (var [u, f] of n) - f.v !== Tt && !(u in o) && l.push(u); + f.v !== Te && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - vu(); + gu(); } } ); } -var ca, bo, $o, Ao; -function _s() { - if (ca === void 0) { - ca = window, bo = /Firefox/.test(navigator.userAgent); - var t = Element.prototype, e = Node.prototype, n = Text.prototype; - $o = Hn(e, "firstChild").get, Ao = Hn(e, "nextSibling").get, la(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), la(n) && (n.__t = void 0); +var fa, xo, bo, $o; +function gs() { + if (fa === void 0) { + fa = window, xo = /Firefox/.test(navigator.userAgent); + var e = Element.prototype, t = Node.prototype, n = Text.prototype; + bo = zn(t, "firstChild").get, $o = zn(t, "nextSibling").get, oa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), oa(n) && (n.__t = void 0); } } -function ne(t = "") { - return document.createTextNode(t); +function st(e = "") { + return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function fn(t) { +function un(e) { return ( /** @type {TemplateNode | null} */ - $o.call(t) + bo.call(e) ); } // @__NO_SIDE_EFFECTS__ -function He(t) { +function zt(e) { return ( /** @type {TemplateNode | null} */ - Ao.call(t) + $o.call(e) ); } -function Bt(t, e) { - if (!K) - return /* @__PURE__ */ fn(t); - var n = /* @__PURE__ */ fn(X); +function We(e, t) { + if (!j) + return /* @__PURE__ */ un(e); + var n = /* @__PURE__ */ un(B); if (n === null) - n = X.appendChild(ne()); - else if (e && n.nodeType !== Wr) { - var r = ne(); - return n == null || n.before(r), Lt(r), r; + n = B.appendChild(st()); + else if (t && n.nodeType !== Gr) { + var r = st(); + return n == null || n.before(r), qe(r), r; } - return e && Bi( + return t && Bi( /** @type {Text} */ n - ), Lt(n), n; + ), qe(n), n; } -function _n(t, e = !1) { - if (!K) { - var n = /* @__PURE__ */ fn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ He(n) : n; +function gn(e, t = !1) { + if (!j) { + var n = /* @__PURE__ */ un(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ zt(n) : n; } - if (e) { - if ((X == null ? void 0 : X.nodeType) !== Wr) { - var r = ne(); - return X == null || X.before(r), Lt(r), r; + if (t) { + if ((B == null ? void 0 : B.nodeType) !== Gr) { + var r = st(); + return B == null || B.before(r), qe(r), r; } Bi( /** @type {Text} */ - X + B ); } - return X; + return B; } -function Jt(t, e = 1, n = !1) { - let r = K ? X : t; - for (var i; e--; ) +function et(e, t = 1, n = !1) { + let r = j ? B : e; + for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ He(r); - if (!K) + /* @__PURE__ */ zt(r); + if (!j) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Wr) { - var s = ne(); - return r === null ? i == null || i.after(s) : r.before(s), Lt(s), s; + if ((r == null ? void 0 : r.nodeType) !== Gr) { + var s = st(); + return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; } Bi( /** @type {Text} */ r ); } - return Lt(r), r; + return qe(r), r; } -function Eo(t) { - t.textContent = ""; +function Ao(e) { + e.textContent = ""; } -function To() { +function Eo() { return !1; } -function Os(t, e, n) { +function Ds(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Wa, t, void 0) + document.createElementNS(Xa, e, void 0) ); } -function Bi(t) { +function Bi(e) { if ( /** @type {string} */ - t.nodeValue.length < 65536 + e.nodeValue.length < 65536 ) return; - let e = t.nextSibling; - for (; e !== null && e.nodeType === Wr; ) - e.remove(), t.nodeValue += /** @type {string} */ - e.nodeValue, e = t.nextSibling; -} -function Co(t) { - var e = B, n = j; - pe(null), Ve(null); + let t = e.nextSibling; + for (; t !== null && t.nodeType === Gr; ) + t.remove(), e.nodeValue += /** @type {string} */ + t.nodeValue, t = e.nextSibling; +} +function To(e) { + var t = Y, n = J; + _t(null), qt(null); try { - return t(); + return e(); } finally { - pe(e), Ve(n); + _t(t), qt(n); } } -function Ou(t) { - j === null && (B === null && fu(), uu()), An && lu(); +function Fu(e) { + J === null && (Y === null && cu(), fu()), $n && uu(); } -function Iu(t, e) { - var n = e.last; - n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +function Iu(e, t) { + var n = t.last; + n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Ye(t, e, n) { - var r = j; - r !== null && (r.f & ee) !== 0 && (t |= ee); +function Ht(e, t, n) { + var r = J; + r !== null && (r.f & it) !== 0 && (e |= it); var i = { - ctx: re, + ctx: at, deps: null, nodes: null, - f: t | St | he, + f: e | Se | vt, first: null, - fn: e, + fn: t, last: null, next: null, parent: r, @@ -1379,143 +1379,143 @@ function Ye(t, e, n) { }; if (n) try { - vr(i); + _r(i); } catch (o) { - throw qt(i), o; + throw Ve(i), o; } - else e !== null && $e(i); + else t !== null && bt(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & jn) === 0 && (s = s.first, (t & hn) !== 0 && (t & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Iu(s, r), B !== null && (B.f & Rt) !== 0 && (t & En) === 0)) { + (s.f & Kn) === 0 && (s = s.first, (e & cn) !== 0 && (e & dr) !== 0 && s !== null && (s.f |= dr)), s !== null && (s.parent = r, r !== null && Iu(s, r), Y !== null && (Y.f & Re) !== 0 && (e & An) === 0)) { var a = ( /** @type {Derived} */ - B + Y ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Is() { - return B !== null && !Ae; +function Os() { + return Y !== null && !$t; } -function Fu(t) { - const e = Ye(Fi, null, !1); - return dt(e, $t), e.teardown = t, e; +function Lu(e) { + const t = Ht(Ii, null, !1); + return pe(t, $e), t.teardown = e, t; } -function Fs(t) { - Ou(); - var e = ( +function Fs(e) { + Fu(); + var t = ( /** @type {Effect} */ - j.f - ), n = !B && (e & Te) !== 0 && (e & mr) === 0; + J.f + ), n = !Y && (t & Et) !== 0 && (t & wr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - re + at ); - (r.e ?? (r.e = [])).push(t); + (r.e ?? (r.e = [])).push(e); } else - return Ro(t); + return Co(e); } -function Ro(t) { - return Ye(Or | nu, t, !1); +function Co(e) { + return Ht(Ir | ru, e, !1); } -function Lu(t) { - un.ensure(); - const e = Ye(En | jn, t, !0); +function qu(e) { + ln.ensure(); + const t = Ht(An | Kn, e, !0); return () => { - qt(e); + Ve(t); }; } -function qu(t) { - un.ensure(); - const e = Ye(En | jn, t, !0); +function Vu(e) { + ln.ensure(); + const t = Ht(An | Kn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? Yn(e, () => { - qt(e), r(void 0); - }) : (qt(e), r(void 0)); + n.outro ? Hn(t, () => { + Ve(t), r(void 0); + }) : (Ve(t), r(void 0)); }); } -function So(t) { - return Ye(Or, t, !1); +function Ro(e) { + return Ht(Ir, e, !1); } -function Vu(t) { - return Ye(Ms | jn, t, !0); +function zu(e) { + return Ht(ks | Kn, e, !0); } -function Ls(t, e = 0) { - return Ye(Fi | e, t, !0); +function Is(e, t = 0) { + return Ht(Ii | t, e, !0); } -function Qe(t, e = [], n = [], r = []) { - Ru(r, e, n, (i) => { - Ye(Fi, () => t(...i.map(x)), !0); +function Zt(e, t = [], n = [], r = []) { + Su(r, t, n, (i) => { + Ht(Ii, () => e(...i.map($)), !0); }); } -function qs(t, e = 0) { - var n = Ye(hn | e, t, !0); +function Ls(e, t = 0) { + var n = Ht(cn | t, e, !0); return n; } -function ce(t) { - return Ye(Te | jn, t, !0); +function pt(e) { + return Ht(Et | Kn, e, !0); } -function No(t) { - var e = t.teardown; - if (e !== null) { - const n = An, r = B; - ha(!0), pe(null); +function So(e) { + var t = e.teardown; + if (t !== null) { + const n = $n, r = Y; + ca(!0), _t(null); try { - e.call(null); + t.call(null); } finally { - ha(n), pe(r); + ca(n), _t(r); } } } -function Vs(t, e = !1) { - var n = t.first; - for (t.first = t.last = null; n !== null; ) { +function qs(e, t = !1) { + var n = e.first; + for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && Co(() => { - i.abort(kn); + i !== null && To(() => { + i.abort(Nn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : qt(n, e), n = r; + (n.f & An) !== 0 ? n.parent = null : Ve(n, t), n = r; } } -function zu(t) { - for (var e = t.first; e !== null; ) { - var n = e.next; - (e.f & Te) === 0 && qt(e), e = n; +function Hu(e) { + for (var t = e.first; t !== null; ) { + var n = t.next; + (t.f & Et) === 0 && Ve(t), t = n; } } -function qt(t, e = !0) { +function Ve(e, t = !0) { var n = !1; - (e || (t.f & Za) !== 0) && t.nodes !== null && t.nodes.end !== null && (Hu( - t.nodes.start, + (t || (e.f & Ja) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( + e.nodes.start, /** @type {TemplateNode} */ - t.nodes.end - ), n = !0), Vs(t, e && !n), Ir(t, 0), dt(t, ln); - var r = t.nodes && t.nodes.t; + e.nodes.end + ), n = !0), qs(e, t && !n), Lr(e, 0), pe(e, on); + var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - No(t); - var i = t.parent; - i !== null && i.first !== null && ko(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + So(e); + var i = e.parent; + i !== null && i.first !== null && No(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } -function Hu(t, e) { - for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ He(t); - t.remove(), t = n; +function Yu(e, t) { + for (; e !== null; ) { + var n = e === t ? null : /* @__PURE__ */ zt(e); + e.remove(), e = n; } } -function ko(t) { - var e = t.parent, n = t.prev, r = t.next; - n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); +function No(e) { + var t = e.parent, n = e.prev, r = e.next; + n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); } -function Yn(t, e, n = !0) { +function Hn(e, t, n = !0) { var r = []; - Mo(t, r, !0); + ko(e, r, !0); var i = () => { - n && qt(t), e && e(); + n && Ve(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,559 +1524,559 @@ function Yn(t, e, n = !0) { } else i(); } -function Mo(t, e, n) { - if ((t.f & ee) === 0) { - t.f ^= ee; - var r = t.nodes && t.nodes.t; +function ko(e, t, n) { + if ((e.f & it) === 0) { + e.f ^= it; + var r = e.nodes && e.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && e.push(o); - for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & cr) !== 0 || // If this is a branch effect without a block effect parent, + (o.is_global || n) && t.push(o); + for (var i = e.first; i !== null; ) { + var s = i.next, a = (i.f & dr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & Te) !== 0 && (t.f & hn) !== 0; - Mo(i, e, a ? n : !1), i = s; + (i.f & Et) !== 0 && (e.f & cn) !== 0; + ko(i, t, a ? n : !1), i = s; } } } -function zs(t) { - Po(t, !0); +function Vs(e) { + Mo(e, !0); } -function Po(t, e) { - if ((t.f & ee) !== 0) { - t.f ^= ee, (t.f & $t) === 0 && (dt(t, St), $e(t)); - for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & cr) !== 0 || (n.f & Te) !== 0; - Po(n, i ? e : !1), n = r; +function Mo(e, t) { + if ((e.f & it) !== 0) { + e.f ^= it, (e.f & $e) === 0 && (pe(e, Se), bt(e)); + for (var n = e.first; n !== null; ) { + var r = n.next, i = (n.f & dr) !== 0 || (n.f & Et) !== 0; + Mo(n, i ? t : !1), n = r; } - var s = t.nodes && t.nodes.t; + var s = e.nodes && e.nodes.t; if (s !== null) for (const a of s) - (a.is_global || e) && a.in(); + (a.is_global || t) && a.in(); } } -function Do(t, e) { - if (t.nodes) - for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ He(n); - e.append(n), n = i; +function Po(e, t) { + if (e.nodes) + for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ zt(n); + t.append(n), n = i; } } -let hi = !1, An = !1; -function ha(t) { - An = t; +let hi = !1, $n = !1; +function ca(e) { + $n = e; } -let B = null, Ae = !1; -function pe(t) { - B = t; +let Y = null, $t = !1; +function _t(e) { + Y = e; } -let j = null; -function Ve(t) { - j = t; +let J = null; +function qt(e) { + J = e; } -let de = null; -function Oo(t) { - B !== null && (de === null ? de = [t] : de.push(t)); +let gt = null; +function Do(e) { + Y !== null && (gt === null ? gt = [e] : gt.push(e)); } -let Gt = null, Zt = 0, le = null; -function Yu(t) { - le = t; +let je = null, tt = 0, ct = null; +function Bu(e) { + ct = e; } -let Io = 1, Dn = 0, Bn = Dn; -function da(t) { - Bn = t; +let Oo = 1, Pn = 0, Yn = Pn; +function ha(e) { + Yn = e; } function Fo() { - return ++Io; + return ++Oo; } -function Ur(t) { - var e = t.f; - if ((e & St) !== 0) +function Kr(e) { + var t = e.f; + if ((t & Se) !== 0) return !0; - if (e & Rt && (t.f &= ~Wn), (e & Ee) !== 0) { + if (t & Re && (e.f &= ~Xn), (t & At) !== 0) { for (var n = ( /** @type {Value[]} */ - t.deps + e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Ur( + if (Kr( /** @type {Derived} */ s - ) && _o( + ) && go( /** @type {Derived} */ s - ), s.wv > t.wv) + ), s.wv > e.wv) return !0; } - (e & he) !== 0 && // During time traveling we don't want to reset the status so that + (t & vt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Ct === null && dt(t, $t); + Ce === null && pe(e, $e); } return !1; } -function Lo(t, e, n = !0) { - var r = t.reactions; - if (r !== null && !(de !== null && fr.call(de, t))) +function Io(e, t, n = !0) { + var r = e.reactions; + if (r !== null && !(gt !== null && hr.call(gt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Rt) !== 0 ? Lo( + (s.f & Re) !== 0 ? Io( /** @type {Derived} */ s, - e, + t, !1 - ) : e === s && (n ? dt(s, St) : (s.f & $t) !== 0 && dt(s, Ee), $e( + ) : t === s && (n ? pe(s, Se) : (s.f & $e) !== 0 && pe(s, At), bt( /** @type {Effect} */ s )); } } -function qo(t) { - var b; - var e = Gt, n = Zt, r = le, i = B, s = de, a = re, o = Ae, l = Bn, u = t.f; - Gt = /** @type {null | Value[]} */ - null, Zt = 0, le = null, B = (u & (Te | En)) === 0 ? t : null, de = null, hr(t.ctx), Ae = !1, Bn = ++Dn, t.ac !== null && (Co(() => { - t.ac.abort(kn); - }), t.ac = null); +function Lo(e) { + var x; + var t = je, n = tt, r = ct, i = Y, s = gt, a = at, o = $t, l = Yn, u = e.f; + je = /** @type {null | Value[]} */ + null, tt = 0, ct = null, Y = (u & (Et | An)) === 0 ? e : null, gt = null, pr(e.ctx), $t = !1, Yn = ++Pn, e.ac !== null && (To(() => { + e.ac.abort(Nn); + }), e.ac = null); try { - t.f |= ls; + e.f |= os; var f = ( /** @type {Function} */ - t.fn - ), d = f(); - t.f |= mr; - var c = t.deps, p = G == null ? void 0 : G.is_fork; - if (Gt !== null) { + e.fn + ), p = f(); + e.f |= wr; + var c = e.deps, d = K == null ? void 0 : K.is_fork; + if (je !== null) { var y; - if (p || Ir(t, Zt), c !== null && Zt > 0) - for (c.length = Zt + Gt.length, y = 0; y < Gt.length; y++) - c[Zt + y] = Gt[y]; + if (d || Lr(e, tt), c !== null && tt > 0) + for (c.length = tt + je.length, y = 0; y < je.length; y++) + c[tt + y] = je[y]; else - t.deps = c = Gt; - if (Is() && (t.f & he) !== 0) - for (y = Zt; y < c.length; y++) - ((b = c[y]).reactions ?? (b.reactions = [])).push(t); - } else !p && c !== null && Zt < c.length && (Ir(t, Zt), c.length = Zt); - if (ro() && le !== null && !Ae && c !== null && (t.f & (Rt | Ee | St)) === 0) + e.deps = c = je; + if (Os() && (e.f & vt) !== 0) + for (y = tt; y < c.length; y++) + ((x = c[y]).reactions ?? (x.reactions = [])).push(e); + } else !d && c !== null && tt < c.length && (Lr(e, tt), c.length = tt); + if (no() && ct !== null && !$t && c !== null && (e.f & (Re | At | Se)) === 0) for (y = 0; y < /** @type {Source[]} */ - le.length; y++) - Lo( - le[y], + ct.length; y++) + Io( + ct[y], /** @type {Effect} */ - t + e ); - if (i !== null && i !== t) { - if (Dn++, i.deps !== null) + if (i !== null && i !== e) { + if (Pn++, i.deps !== null) for (let m = 0; m < n; m += 1) - i.deps[m].rv = Dn; - if (e !== null) - for (const m of e) - m.rv = Dn; - le !== null && (r === null ? r = le : r.push(.../** @type {Source[]} */ - le)); + i.deps[m].rv = Pn; + if (t !== null) + for (const m of t) + m.rv = Pn; + ct !== null && (r === null ? r = ct : r.push(.../** @type {Source[]} */ + ct)); } - return (t.f & wn) !== 0 && (t.f ^= wn), d; + return (e.f & yn) !== 0 && (e.f ^= yn), p; } catch (m) { - return so(m); + return io(m); } finally { - t.f ^= ls, Gt = e, Zt = n, le = r, B = i, de = s, hr(a), Ae = o, Bn = l; + e.f ^= os, je = t, tt = n, ct = r, Y = i, gt = s, pr(a), $t = o, Yn = l; } } -function Bu(t, e) { - let n = e.reactions; +function Xu(e, t) { + let n = t.reactions; if (n !== null) { - var r = Kl.call(n, t); + var r = jl.call(n, e); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & Rt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (Gt === null || !fr.call(Gt, e))) { + (je === null || !hr.call(je, t))) { var s = ( /** @type {Derived} */ - e + t ); - (s.f & he) !== 0 && (s.f ^= he, s.f &= ~Wn), Ps(s), Pu(s), Ir(s, 0); + (s.f & vt) !== 0 && (s.f ^= vt, s.f &= ~Xn), Ms(s), Du(s), Lr(s, 0); } } -function Ir(t, e) { - var n = t.deps; +function Lr(e, t) { + var n = e.deps; if (n !== null) - for (var r = e; r < n.length; r++) - Bu(t, n[r]); -} -function vr(t) { - var e = t.f; - if ((e & ln) === 0) { - dt(t, $t); - var n = j, r = hi; - j = t, hi = !0; + for (var r = t; r < n.length; r++) + Xu(e, n[r]); +} +function _r(e) { + var t = e.f; + if ((t & on) === 0) { + pe(e, $e); + var n = J, r = hi; + J = e, hi = !0; try { - (e & (hn | ja)) !== 0 ? zu(t) : Vs(t), No(t); - var i = qo(t); - t.teardown = typeof i == "function" ? i : null, t.wv = Io; + (t & (cn | Ka)) !== 0 ? Hu(e) : qs(e), So(e); + var i = Lo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Oo; var s; - os && wu && (t.f & St) !== 0 && t.deps; + as && xu && (e.f & Se) !== 0 && e.deps; } finally { - hi = r, j = n; + hi = r, J = n; } } } -function x(t) { - var e = t.f, n = (e & Rt) !== 0; - if (B !== null && !Ae) { - var r = j !== null && (j.f & ln) !== 0; - if (!r && (de === null || !fr.call(de, t))) { - var i = B.deps; - if ((B.f & ls) !== 0) - t.rv < Dn && (t.rv = Dn, Gt === null && i !== null && i[Zt] === t ? Zt++ : Gt === null ? Gt = [t] : Gt.push(t)); +function $(e) { + var t = e.f, n = (t & Re) !== 0; + if (Y !== null && !$t) { + var r = J !== null && (J.f & on) !== 0; + if (!r && (gt === null || !hr.call(gt, e))) { + var i = Y.deps; + if ((Y.f & os) !== 0) + e.rv < Pn && (e.rv = Pn, je === null && i !== null && i[tt] === e ? tt++ : je === null ? je = [e] : je.push(e)); else { - (B.deps ?? (B.deps = [])).push(t); - var s = t.reactions; - s === null ? t.reactions = [B] : fr.call(s, B) || s.push(B); + (Y.deps ?? (Y.deps = [])).push(e); + var s = e.reactions; + s === null ? e.reactions = [Y] : hr.call(s, Y) || s.push(Y); } } } - if (An && bn.has(t)) - return bn.get(t); + if ($n && xn.has(e)) + return xn.get(e); if (n) { var a = ( /** @type {Derived} */ - t + e ); - if (An) { + if ($n) { var o = a.v; - return ((a.f & $t) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; + return ((a.f & $e) === 0 && a.reactions !== null || Vo(a)) && (o = Ps(a)), xn.set(a, o), o; } - var l = (a.f & he) === 0 && !Ae && B !== null && (hi || (B.f & he) !== 0), u = (a.f & mr) === 0; - Ur(a) && (l && (a.f |= he), _o(a)), l && !u && (mo(a), Vo(a)); - } - if (Ct != null && Ct.has(t)) - return Ct.get(t); - if ((t.f & wn) !== 0) - throw t.v; - return t.v; -} -function Vo(t) { - if (t.f |= he, t.deps !== null) - for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Rt) !== 0 && (e.f & he) === 0 && (mo( + var l = (a.f & vt) === 0 && !$t && Y !== null && (hi || (Y.f & vt) !== 0), u = (a.f & wr) === 0; + Kr(a) && (l && (a.f |= vt), go(a)), l && !u && (_o(a), qo(a)); + } + if (Ce != null && Ce.has(e)) + return Ce.get(e); + if ((e.f & yn) !== 0) + throw e.v; + return e.v; +} +function qo(e) { + if (e.f |= vt, e.deps !== null) + for (const t of e.deps) + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Re) !== 0 && (t.f & vt) === 0 && (_o( /** @type {Derived} */ - e - ), Vo( + t + ), qo( /** @type {Derived} */ - e + t )); } -function zo(t) { - if (t.v === Tt) return !0; - if (t.deps === null) return !1; - for (const e of t.deps) - if (bn.has(e) || (e.f & Rt) !== 0 && zo( +function Vo(e) { + if (e.v === Te) return !0; + if (e.deps === null) return !1; + for (const t of e.deps) + if (xn.has(t) || (t.f & Re) !== 0 && Vo( /** @type {Derived} */ - e + t )) return !0; return !1; } -function Xi(t) { - var e = Ae; +function Xi(e) { + var t = $t; try { - return Ae = !0, t(); + return $t = !0, e(); } finally { - Ae = e; + $t = t; } } -const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Xu(t) { - for (var e = 0; e < t.length; e++) - Ho.add(t[e]); - for (var n of ms) - n(t); +const zo = /* @__PURE__ */ new Set(), _s = /* @__PURE__ */ new Set(); +function Wu(e) { + for (var t = 0; t < e.length; t++) + zo.add(e[t]); + for (var n of _s) + n(e); } -let pa = null; -function va(t) { +let da = null; +function pa(e) { var m; - var e = this, n = ( + var t = this, n = ( /** @type {Node} */ - e.ownerDocument - ), r = t.type, i = ((m = t.composedPath) == null ? void 0 : m.call(t)) || [], s = ( + t.ownerDocument + ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( /** @type {null | Element} */ - i[0] || t.target + i[0] || e.target ); - pa = t; - var a = 0, o = pa === t && t.__root; + da = e; + var a = 0, o = da === e && e.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (e === document || e === /** @type {any} */ + if (l !== -1 && (t === document || t === /** @type {any} */ window)) { - t.__root = e; + e.__root = t; return; } - var u = i.indexOf(e); + var u = i.indexOf(t); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || t.target, s !== e) { - $i(t, "currentTarget", { + i[a] || e.target, s !== t) { + $i(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = B, d = j; - pe(null), Ve(null); + var f = Y, p = J; + _t(null), qt(null); try { - for (var c, p = []; s !== null; ) { + for (var c, d = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var b = s["__" + r]; - b != null && (!/** @type {any} */ + var x = s["__" + r]; + x != null && (!/** @type {any} */ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well // -> the target could not have been disabled because it emits the event in the first place - t.target === s) && b.call(s, t); - } catch ($) { - c ? p.push($) : c = $; + e.target === s) && x.call(s, e); + } catch (b) { + c ? d.push(b) : c = b; } - if (t.cancelBubble || y === e || y === null) + if (e.cancelBubble || y === t || y === null) break; s = y; } if (c) { - for (let $ of p) + for (let b of d) queueMicrotask(() => { - throw $; + throw b; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, pe(f), Ve(d); + e.__root = t, delete e.currentTarget, _t(f), qt(p); } } } -var Ya, Ba; -const es = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( +var Ha, Ya; +const es = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (t) => t + createHTML: (e) => e } ); -function Wu(t) { +function Uu(e) { return ( /** @type {string} */ - (es == null ? void 0 : es.createHTML(t)) ?? t + (es == null ? void 0 : es.createHTML(e)) ?? e ); } -function Yo(t, e = !1) { - var n = Os("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Wu(t) : t, n.content; +function Ho(e, t = !1) { + var n = Ds("template"); + return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; } -function $n(t, e) { +function bn(e, t) { var n = ( /** @type {Effect} */ - j + J ); - n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); + n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Be(t, e) { - var n = (e & Ul) !== 0, r = (e & Gl) !== 0, i, s = !t.startsWith(""); +function Yt(e, t) { + var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); return () => { - if (K) - return $n(X, null), X; - i === void 0 && (i = Yo(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ - /* @__PURE__ */ fn(i))); + if (j) + return bn(B, null), B; + i === void 0 && (i = Ho(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + /* @__PURE__ */ un(i))); var a = ( /** @type {TemplateNode} */ - r || bo ? document.importNode(i, !0) : i.cloneNode(!0) + r || xo ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( /** @type {TemplateNode} */ - /* @__PURE__ */ fn(a) + /* @__PURE__ */ un(a) ), l = ( /** @type {TemplateNode} */ a.lastChild ); - $n(o, l); + bn(o, l); } else - $n(a, a); + bn(a, a); return a; }; } // @__NO_SIDE_EFFECTS__ -function Uu(t, e, n = "svg") { - var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; +function Gu(e, t, n = "svg") { + var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { - if (K) - return $n(X, null), X; + if (j) + return bn(B, null), B; if (!s) { var a = ( /** @type {DocumentFragment} */ - Yo(i, !0) + Ho(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ fn(a) + /* @__PURE__ */ un(a) ); s = /** @type {Element} */ - /* @__PURE__ */ fn(o); + /* @__PURE__ */ un(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return $n(l, l), l; + return bn(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function Gu(t, e) { - return /* @__PURE__ */ Uu(t, e, "svg"); +function Ku(e, t) { + return /* @__PURE__ */ Gu(e, t, "svg"); } -function ga(t = "") { - if (!K) { - var e = ne(t + ""); - return $n(e, e), e; +function va(e = "") { + if (!j) { + var t = st(e + ""); + return bn(t, t), t; } - var n = X; - return n.nodeType !== Wr ? (n.before(n = ne()), Lt(n)) : Bi( + var n = B; + return n.nodeType !== Gr ? (n.before(n = st()), qe(n)) : Bi( /** @type {Text} */ n - ), $n(n, n), n; + ), bn(n, n), n; } -function Wt(t, e) { - if (K) { +function Ge(e, t) { + if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - j + J ); - ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = X), qi(); + ((n.f & wr) === 0 || n.nodes.end === null) && (n.nodes.end = B), qi(); return; } - t !== null && t.before( + e !== null && e.before( /** @type {Node} */ - e + t ); } -const Ku = ["touchstart", "touchmove"]; -function ju(t) { - return Ku.includes(t); +const ju = ["touchstart", "touchmove"]; +function Ju(e) { + return ju.includes(e); } -function mn(t, e) { - var n = e == null ? "" : typeof e == "object" ? e + "" : e; - n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); +function _n(e, t) { + var n = t == null ? "" : typeof t == "object" ? t + "" : t; + n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); } -function Bo(t, e) { - return Xo(t, e); +function Yo(e, t) { + return Bo(e, t); } -function Ju(t, e) { - _s(), e.intro = e.intro ?? !1; - const n = e.target, r = K, i = X; +function Zu(e, t) { + gs(), t.intro = t.intro ?? !1; + const n = t.target, r = j, i = B; try { - for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== yr || /** @type {Comment} */ - s.data !== Ns); ) - s = /* @__PURE__ */ He(s); + for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== xr || /** @type {Comment} */ + s.data !== Ss); ) + s = /* @__PURE__ */ zt(s); if (!s) - throw ur; - on(!0), Lt( + throw cr; + an(!0), qe( /** @type {Comment} */ s ); - const a = Xo(t, { ...e, anchor: s }); - return on(!1), /** @type {Exports} */ + const a = Bo(e, { ...t, anchor: s }); + return an(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== ur && console.warn("Failed to hydrate: ", a), e.recover === !1 && hu(), _s(), Eo(n), on(!1), Bo(t, e); + return a !== cr && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), gs(), Ao(n), an(!1), Yo(e, t); } finally { - on(r), Lt(i); + an(r), qe(i); } } const ri = /* @__PURE__ */ new Map(); -function Xo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - _s(); - var o = /* @__PURE__ */ new Set(), l = (d) => { - for (var c = 0; c < d.length; c++) { - var p = d[c]; - if (!o.has(p)) { - o.add(p); - var y = ju(p); - for (const $ of [e, document]) { - var b = ri.get($); - b === void 0 && (b = /* @__PURE__ */ new Map(), ri.set($, b)); - var m = b.get(p); - m === void 0 ? ($.addEventListener(p, va, { passive: y }), b.set(p, 1)) : b.set(p, m + 1); +function Bo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + gs(); + var o = /* @__PURE__ */ new Set(), l = (p) => { + for (var c = 0; c < p.length; c++) { + var d = p[c]; + if (!o.has(d)) { + o.add(d); + var y = Ju(d); + for (const b of [t, document]) { + var x = ri.get(b); + x === void 0 && (x = /* @__PURE__ */ new Map(), ri.set(b, x)); + var m = x.get(d); + m === void 0 ? (b.addEventListener(d, pa, { passive: y }), x.set(d, 1)) : x.set(d, m + 1); } } } }; - l(Ii(Ho)), ms.add(l); - var u = void 0, f = qu(() => { - var d = n ?? e.appendChild(ne()); - return Tu( + l(Fi(zo)), _s.add(l); + var u = void 0, f = Vu(() => { + var p = n ?? t.appendChild(st()); + return Cu( /** @type {TemplateNode} */ - d, + p, { pending: () => { } }, (c) => { Vi({}); - var p = ( + var d = ( /** @type {ComponentContext} */ - re + at ); - if (s && (p.c = s), i && (r.$$events = i), K && $n( + if (s && (d.c = s), i && (r.$$events = i), j && bn( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, K && (j.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ - X.data !== ks)) - throw Li(), ur; + ), u = e(c, r) || {}, j && (J.nodes.end = B, B === null || B.nodeType !== xr || /** @type {Comment} */ + B.data !== Ns)) + throw Li(), cr; zi(); } ), () => { - var b; + var x; for (var c of o) - for (const m of [e, document]) { - var p = ( + for (const m of [t, document]) { + var d = ( /** @type {Map} */ ri.get(m) ), y = ( /** @type {number} */ - p.get(c) + d.get(c) ); - --y == 0 ? (m.removeEventListener(c, va), p.delete(c), p.size === 0 && ri.delete(m)) : p.set(c, y); + --y == 0 ? (m.removeEventListener(c, pa), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); } - ms.delete(l), d !== n && ((b = d.parentNode) == null || b.removeChild(d)); + _s.delete(l), p !== n && ((x = p.parentNode) == null || x.removeChild(p)); }; }); - return ys.set(u, f), u; + return ms.set(u, f), u; } -let ys = /* @__PURE__ */ new WeakMap(); -function Zu(t, e) { - const n = ys.get(t); - return n ? (ys.delete(t), n(e)) : Promise.resolve(); +let ms = /* @__PURE__ */ new WeakMap(); +function Qu(e, t) { + const n = ms.get(e); + return n ? (ms.delete(e), n(t)) : Promise.resolve(); } -var xe, Fe, te, zn, Br, Xr, Di; -class Qu { +var wt, Ft, rt, Vn, Wr, Ur, Di; +class ef { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(e, n = !0) { + constructor(t, n = !0) { /** @type {TemplateNode} */ - ct(this, "anchor"); + he(this, "anchor"); /** @type {Map} */ - H(this, xe, /* @__PURE__ */ new Map()); + H(this, wt, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,150 +2091,150 @@ class Qu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Fe, /* @__PURE__ */ new Map()); + H(this, Ft, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - H(this, te, /* @__PURE__ */ new Map()); + H(this, rt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - H(this, zn, /* @__PURE__ */ new Set()); + H(this, Vn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - H(this, Br, !0); - H(this, Xr, () => { - var e = ( + H(this, Wr, !0); + H(this, Ur, () => { + var t = ( /** @type {Batch} */ - G + K ); - if (v(this, xe).has(e)) { + if (v(this, wt).has(t)) { var n = ( /** @type {Key} */ - v(this, xe).get(e) - ), r = v(this, Fe).get(n); + v(this, wt).get(t) + ), r = v(this, Ft).get(n); if (r) - zs(r), v(this, zn).delete(n); + Vs(r), v(this, Vn).delete(n); else { - var i = v(this, te).get(n); - i && (v(this, Fe).set(n, i.effect), v(this, te).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, rt).get(n); + i && (v(this, Ft).set(n, i.effect), v(this, rt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, xe)) { - if (v(this, xe).delete(s), s === e) + for (const [s, a] of v(this, wt)) { + if (v(this, wt).delete(s), s === t) break; - const o = v(this, te).get(a); - o && (qt(o.effect), v(this, te).delete(a)); + const o = v(this, rt).get(a); + o && (Ve(o.effect), v(this, rt).delete(a)); } - for (const [s, a] of v(this, Fe)) { - if (s === n || v(this, zn).has(s)) continue; + for (const [s, a] of v(this, Ft)) { + if (s === n || v(this, Vn).has(s)) continue; const o = () => { - if (Array.from(v(this, xe).values()).includes(s)) { + if (Array.from(v(this, wt).values()).includes(s)) { var u = document.createDocumentFragment(); - Do(a, u), u.append(ne()), v(this, te).set(s, { effect: a, fragment: u }); + Po(a, u), u.append(st()), v(this, rt).set(s, { effect: a, fragment: u }); } else - qt(a); - v(this, zn).delete(s), v(this, Fe).delete(s); + Ve(a); + v(this, Vn).delete(s), v(this, Ft).delete(s); }; - v(this, Br) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); + v(this, Wr) || !r ? (v(this, Vn).add(s), Hn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - H(this, Di, (e) => { - v(this, xe).delete(e); - const n = Array.from(v(this, xe).values()); - for (const [r, i] of v(this, te)) - n.includes(r) || (qt(i.effect), v(this, te).delete(r)); + H(this, Di, (t) => { + v(this, wt).delete(t); + const n = Array.from(v(this, wt).values()); + for (const [r, i] of v(this, rt)) + n.includes(r) || (Ve(i.effect), v(this, rt).delete(r)); }); - this.anchor = e, V(this, Br, n); + this.anchor = t, V(this, Wr, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(e, n) { + ensure(t, n) { var r = ( /** @type {Batch} */ - G - ), i = To(); - if (n && !v(this, Fe).has(e) && !v(this, te).has(e)) + K + ), i = Eo(); + if (n && !v(this, Ft).has(t) && !v(this, rt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = ne(); - s.append(a), v(this, te).set(e, { - effect: ce(() => n(a)), + var s = document.createDocumentFragment(), a = st(); + s.append(a), v(this, rt).set(t, { + effect: pt(() => n(a)), fragment: s }); } else - v(this, Fe).set( - e, - ce(() => n(this.anchor)) + v(this, Ft).set( + t, + pt(() => n(this.anchor)) ); - if (v(this, xe).set(r, e), i) { - for (const [o, l] of v(this, Fe)) - o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, te)) - o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Xr)), r.ondiscard(v(this, Di)); + if (v(this, wt).set(r, t), i) { + for (const [o, l] of v(this, Ft)) + o === t ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, rt)) + o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(v(this, Ur)), r.ondiscard(v(this, Di)); } else - K && (this.anchor = X), v(this, Xr).call(this); + j && (this.anchor = B), v(this, Ur).call(this); } } -xe = new WeakMap(), Fe = new WeakMap(), te = new WeakMap(), zn = new WeakMap(), Br = new WeakMap(), Xr = new WeakMap(), Di = new WeakMap(); -function tf(t) { - re === null && su(), Fs(() => { - const e = Xi(t); - if (typeof e == "function") return ( +wt = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), Vn = new WeakMap(), Wr = new WeakMap(), Ur = new WeakMap(), Di = new WeakMap(); +function tf(e) { + at === null && au(), Fs(() => { + const t = Xi(e); + if (typeof t == "function") return ( /** @type {() => void} */ - e + t ); }); } -function Qn(t, e, n = !1) { - K && qi(); - var r = new Qu(t), i = n ? cr : 0; +function tr(e, t, n = !1) { + j && qi(); + var r = new ef(e), i = n ? dr : 0; function s(a, o) { - if (K) { - const f = to(t); + if (j) { + const f = Qa(e); var l; - if (f === Ns ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + if (f === Ss ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { var u = Ai(); - Lt(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); + qe(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); return; } } r.ensure(a, o); } - qs(() => { + Ls(() => { var a = !1; - e((o, l = 0) => { + t((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function di(t, e) { - return e; +function di(e, t) { + return t; } -function ef(t, e, n) { - for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let d = e[o]; - Yn( - d, +function nf(e, t, n) { + for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { + let p = t[o]; + Hn( + p, () => { if (s) { - if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { + if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { var c = ( /** @type {Set} */ - t.outrogroups + e.outrogroups ); - ws(Ii(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + ys(Fi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2252,188 +2252,188 @@ function ef(t, e, n) { /** @type {Element} */ u.parentNode ); - Eo(f), f.append(u), t.items.clear(); + Ao(f), f.append(u), e.items.clear(); } - ws(e, !l); + ys(t, !l); } else s = { - pending: new Set(e), + pending: new Set(t), done: /* @__PURE__ */ new Set() - }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ws(t, e = !0) { - for (var n = 0; n < t.length; n++) - qt(t[n], e); +function ys(e, t = !0) { + for (var n = 0; n < e.length; n++) + Ve(e[n], t); } -var _a; -function pi(t, e, n, r, i, s = null) { - var a = t, o = /* @__PURE__ */ new Map(), l = (e & Xa) !== 0; +var ga; +function pi(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & Ba) !== 0; if (l) { var u = ( /** @type {Element} */ - t + e ); - a = K ? Lt(/* @__PURE__ */ fn(u)) : u.appendChild(ne()); + a = j ? qe(/* @__PURE__ */ un(u)) : u.appendChild(st()); } - K && qi(); - var f = null, d = /* @__PURE__ */ go(() => { - var $ = n(); - return Ua($) ? $ : $ == null ? [] : Ii($); - }), c, p = !0; + j && qi(); + var f = null, p = /* @__PURE__ */ vo(() => { + var b = n(); + return Wa(b) ? b : b == null ? [] : Fi(b); + }), c, d = !0; function y() { - m.fallback = f, nf(m, c, a, e, r), f !== null && (c.length === 0 ? (f.f & an) === 0 ? zs(f) : (f.f ^= an, Rr(f, null, a)) : Yn(f, () => { + m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & sn) === 0 ? Vs(f) : (f.f ^= sn, Nr(f, null, a)) : Hn(f, () => { f = null; })); } - var b = qs(() => { + var x = Ls(() => { c = /** @type {V[]} */ - x(d); - var $ = c.length; + $(p); + var b = c.length; let D = !1; - if (K) { - var M = to(a) === Oi; - M !== ($ === 0) && (a = Ai(), Lt(a), on(!1), D = !0); + if (j) { + var M = Qa(a) === Oi; + M !== (b === 0) && (a = Ai(), qe(a), an(!1), D = !0); } - for (var S = /* @__PURE__ */ new Set(), F = ( + for (var S = /* @__PURE__ */ new Set(), I = ( /** @type {Batch} */ - G - ), L = To(), W = 0; W < $; W += 1) { - K && X.nodeType === yr && /** @type {Comment} */ - X.data === ks && (a = /** @type {Comment} */ - X, D = !0, on(!1)); - var ot = c[W], Z = r(ot, W), U = p ? null : o.get(Z); - U ? (U.v && pr(U.v, ot), U.i && pr(U.i, W), L && F.unskip_effect(U.e)) : (U = rf( + K + ), q = Eo(), X = 0; X < b; X += 1) { + j && B.nodeType === xr && /** @type {Comment} */ + B.data === Ns && (a = /** @type {Comment} */ + B, D = !0, an(!1)); + var se = c[X], Q = r(se, X), W = d ? null : o.get(Q); + W ? (W.v && gr(W.v, se), W.i && gr(W.i, X), q && I.unskip_effect(W.e)) : (W = sf( o, - p ? a : _a ?? (_a = ne()), - ot, - Z, - W, + d ? a : ga ?? (ga = st()), + se, + Q, + X, i, - e, + t, n - ), p || (U.e.f |= an), o.set(Z, U)), S.add(Z); + ), d || (W.e.f |= sn), o.set(Q, W)), S.add(Q); } - if ($ === 0 && s && !f && (p ? f = ce(() => s(a)) : (f = ce(() => s(_a ?? (_a = ne()))), f.f |= an)), $ > S.size && ou(), K && $ > 0 && Lt(Ai()), !p) - if (L) { - for (const [lt, ut] of o) - S.has(lt) || F.skip_effect(ut.e); - F.oncommit(y), F.ondiscard(() => { + if (b === 0 && s && !f && (d ? f = pt(() => s(a)) : (f = pt(() => s(ga ?? (ga = st()))), f.f |= sn)), b > S.size && lu(), j && b > 0 && qe(Ai()), !d) + if (q) { + for (const [ae, ue] of o) + S.has(ae) || I.skip_effect(ue.e); + I.oncommit(y), I.ondiscard(() => { }); } else y(); - D && on(!0), x(d); - }), m = { effect: b, items: o, outrogroups: null, fallback: f }; - p = !1, K && (a = X); + D && an(!0), $(p); + }), m = { effect: x, items: o, outrogroups: null, fallback: f }; + d = !1, j && (a = B); } -function Tr(t) { - for (; t !== null && (t.f & Te) === 0; ) - t = t.next; - return t; +function Rr(e) { + for (; e !== null && (e.f & Et) === 0; ) + e = e.next; + return e; } -function nf(t, e, n, r, i) { - var U, lt, ut, O, I, Nt, se, mt, yt; - var s = (r & zl) !== 0, a = e.length, o = t.items, l = Tr(t.effect.first), u, f = null, d, c = [], p = [], y, b, m, $; +function rf(e, t, n, r, i) { + var W, ae, ue, O, F, Ne, lt, ce, Ae; + var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Rr(e.effect.first), u, f = null, p, c = [], d = [], y, x, m, b; if (s) - for ($ = 0; $ < a; $ += 1) - y = e[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & an) === 0 && ((lt = (U = m.nodes) == null ? void 0 : U.a) == null || lt.measure(), (d ?? (d = /* @__PURE__ */ new Set())).add(m)); - for ($ = 0; $ < a; $ += 1) { - if (y = e[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, t.outrogroups !== null) - for (const Q of t.outrogroups) - Q.pending.delete(m), Q.done.delete(m); - if ((m.f & an) !== 0) - if (m.f ^= an, m === l) - Rr(m, null, n); + for (b = 0; b < a; b += 1) + y = t[b], x = i(y, b), m = /** @type {EachItem} */ + o.get(x).e, (m.f & sn) === 0 && ((ae = (W = m.nodes) == null ? void 0 : W.a) == null || ae.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + for (b = 0; b < a; b += 1) { + if (y = t[b], x = i(y, b), m = /** @type {EachItem} */ + o.get(x).e, e.outrogroups !== null) + for (const ee of e.outrogroups) + ee.pending.delete(m), ee.done.delete(m); + if ((m.f & sn) !== 0) + if (m.f ^= sn, m === l) + Nr(m, null, n); else { var D = f ? f.next : l; - m === t.effect.last && (t.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), gn(t, f, m), gn(t, m, D), Rr(m, D, n), f = m, c = [], p = [], l = Tr(f.next); + m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), vn(e, f, m), vn(e, m, D), Nr(m, D, n), f = m, c = [], d = [], l = Rr(f.next); continue; } - if ((m.f & ee) !== 0 && (zs(m), s && ((O = (ut = m.nodes) == null ? void 0 : ut.a) == null || O.unfix(), (d ?? (d = /* @__PURE__ */ new Set())).delete(m))), m !== l) { + if ((m.f & it) !== 0 && (Vs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { if (u !== void 0 && u.has(m)) { - if (c.length < p.length) { - var M = p[0], S; + if (c.length < d.length) { + var M = d[0], S; f = M.prev; - var F = c[0], L = c[c.length - 1]; + var I = c[0], q = c[c.length - 1]; for (S = 0; S < c.length; S += 1) - Rr(c[S], M, n); - for (S = 0; S < p.length; S += 1) - u.delete(p[S]); - gn(t, F.prev, L.next), gn(t, f, F), gn(t, L, M), l = M, f = L, $ -= 1, c = [], p = []; + Nr(c[S], M, n); + for (S = 0; S < d.length; S += 1) + u.delete(d[S]); + vn(e, I.prev, q.next), vn(e, f, I), vn(e, q, M), l = M, f = q, b -= 1, c = [], d = []; } else - u.delete(m), Rr(m, l, n), gn(t, m.prev, m.next), gn(t, m, f === null ? t.effect.first : f.next), gn(t, f, m), f = m; + u.delete(m), Nr(m, l, n), vn(e, m.prev, m.next), vn(e, m, f === null ? e.effect.first : f.next), vn(e, f, m), f = m; continue; } - for (c = [], p = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Tr(l.next); + for (c = [], d = []; l !== null && l !== m; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Rr(l.next); if (l === null) continue; } - (m.f & an) === 0 && c.push(m), f = m, l = Tr(m.next); + (m.f & sn) === 0 && c.push(m), f = m, l = Rr(m.next); } - if (t.outrogroups !== null) { - for (const Q of t.outrogroups) - Q.pending.size === 0 && (ws(Ii(Q.done)), (I = t.outrogroups) == null || I.delete(Q)); - t.outrogroups.size === 0 && (t.outrogroups = null); + if (e.outrogroups !== null) { + for (const ee of e.outrogroups) + ee.pending.size === 0 && (ys(Fi(ee.done)), (F = e.outrogroups) == null || F.delete(ee)); + e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var W = []; + var X = []; if (u !== void 0) for (m of u) - (m.f & ee) === 0 && W.push(m); + (m.f & it) === 0 && X.push(m); for (; l !== null; ) - (l.f & ee) === 0 && l !== t.fallback && W.push(l), l = Tr(l.next); - var ot = W.length; - if (ot > 0) { - var Z = (r & Xa) !== 0 && a === 0 ? n : null; + (l.f & it) === 0 && l !== e.fallback && X.push(l), l = Rr(l.next); + var se = X.length; + if (se > 0) { + var Q = (r & Ba) !== 0 && a === 0 ? n : null; if (s) { - for ($ = 0; $ < ot; $ += 1) - (se = (Nt = W[$].nodes) == null ? void 0 : Nt.a) == null || se.measure(); - for ($ = 0; $ < ot; $ += 1) - (yt = (mt = W[$].nodes) == null ? void 0 : mt.a) == null || yt.fix(); + for (b = 0; b < se; b += 1) + (lt = (Ne = X[b].nodes) == null ? void 0 : Ne.a) == null || lt.measure(); + for (b = 0; b < se; b += 1) + (Ae = (ce = X[b].nodes) == null ? void 0 : ce.a) == null || Ae.fix(); } - ef(t, W, Z); + nf(e, X, Q); } } - s && xn(() => { - var Q, kt; - if (d !== void 0) - for (m of d) - (kt = (Q = m.nodes) == null ? void 0 : Q.a) == null || kt.apply(); + s && wn(() => { + var ee, Oe; + if (p !== void 0) + for (m of p) + (Oe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Oe.apply(); }); } -function rf(t, e, n, r, i, s, a, o) { - var l = (a & ql) !== 0 ? (a & Hl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & Vl) !== 0 ? Un(i) : null; +function sf(e, t, n, r, i, s, a, o) { + var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ yo(n, !1, !1) : Wn(n) : null, u = (a & zl) !== 0 ? Wn(i) : null; return { v: l, i: u, - e: ce(() => (s(e, l ?? n, u ?? i, o), () => { - t.delete(r); + e: pt(() => (s(t, l ?? n, u ?? i, o), () => { + e.delete(r); })) }; } -function Rr(t, e, n) { - if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & an) === 0 ? ( +function Nr(e, t, n) { + if (e.nodes) + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & sn) === 0 ? ( /** @type {EffectNodes} */ - e.nodes.start + t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ He(r) + /* @__PURE__ */ zt(r) ); if (s.before(r), r === i) return; r = a; } } -function gn(t, e, n) { - e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; +function vn(e, t, n) { + t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } -function Hs(t, e) { - So(() => { - var n = t.getRootNode(), r = ( +function zs(e, t) { + Ro(() => { + var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Hs(t, e) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + e.hash)) { - const i = Os("style"); - i.id = e.hash, i.textContent = e.code, r.appendChild(i); + if (!r.querySelector("#" + t.hash)) { + const i = Ds("style"); + i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); } -const ma = [...` +const _a = [...` \r\f \v\uFEFF`]; -function sf(t, e, n) { - var r = t == null ? "" : "" + t; +function af(e, t, n) { + var r = e == null ? "" : "" + e; if (n) { for (var i in n) if (n[i]) @@ -2461,109 +2461,109 @@ function sf(t, e, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || ma.includes(r[a - 1])) && (o === r.length || ma.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (a === 0 || _a.includes(r[a - 1])) && (o === r.length || _a.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; } -function ya(t, e = !1) { - var n = e ? " !important;" : ";", r = ""; - for (var i in t) { - var s = t[i]; +function ma(e, t = !1) { + var n = t ? " !important;" : ";", r = ""; + for (var i in e) { + var s = e[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function af(t, e) { - if (e) { +function of(e, t) { + if (t) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ya(r)), i && (n += ya(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ma(r)), i && (n += ma(i, !0)), n = n.trim(), n === "" ? null : n; } - return String(t); + return String(e); } -function ii(t, e, n, r, i, s) { - var a = t.__className; - if (K || a !== n || a === void 0) { - var o = sf(n, r, s); - (!K || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; +function ii(e, t, n, r, i, s) { + var a = e.__className; + if (j || a !== n || a === void 0) { + var o = af(n, r, s); + (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; } else if (s && i !== s) for (var l in s) { var u = !!s[l]; - (i == null || u !== !!i[l]) && t.classList.toggle(l, u); + (i == null || u !== !!i[l]) && e.classList.toggle(l, u); } return s; } -function ns(t, e = {}, n, r) { +function ts(e, t = {}, n, r) { for (var i in n) { var s = n[i]; - e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); + t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function wa(t, e, n, r) { - var i = t.__style; - if (K || i !== e) { - var s = af(e, r); - (!K || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (ns(t, n == null ? void 0 : n[0], r[0]), ns(t, n == null ? void 0 : n[1], r[1], "important")) : ns(t, n, r)); +function ya(e, t, n, r) { + var i = e.__style; + if (j || i !== t) { + var s = of(t, r); + (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; + } else r && (Array.isArray(r) ? (ts(e, n == null ? void 0 : n[0], r[0]), ts(e, n == null ? void 0 : n[1], r[1], "important")) : ts(e, n, r)); return r; } -const of = Symbol("is custom element"), lf = Symbol("is html"), uf = iu ? "link" : "LINK"; -function xa(t, e, n, r) { - var i = ff(t); - K && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === uf) || i[e] !== (i[e] = n) && (e === "loading" && (t[ru] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && cf(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); +const lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; +function wa(e, t, n, r) { + var i = cf(e); + j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } -function ff(t) { +function cf(e) { return ( /** @type {Record} **/ // @ts-expect-error - t.__attributes ?? (t.__attributes = { - [of]: t.nodeName.includes("-"), - [lf]: t.namespaceURI === Wa + e.__attributes ?? (e.__attributes = { + [lf]: e.nodeName.includes("-"), + [uf]: e.namespaceURI === Xa }) ); } -var ba = /* @__PURE__ */ new Map(); -function cf(t) { - var e = t.getAttribute("is") || t.nodeName, n = ba.get(e); +var xa = /* @__PURE__ */ new Map(); +function hf(e) { + var t = e.getAttribute("is") || e.nodeName, n = xa.get(t); if (n) return n; - ba.set(e, n = []); - for (var r, i = t, s = Element.prototype; s !== i; ) { - r = jl(i); + xa.set(t, n = []); + for (var r, i = e, s = Element.prototype; s !== i; ) { + r = Jl(i); for (var a in r) r[a].set && n.push(a); - i = Ga(i); + i = Ua(i); } return n; } -function $a(t, e) { - return t === e || (t == null ? void 0 : t[Mr]) === e; +function ba(e, t) { + return e === t || (e == null ? void 0 : e[Dr]) === t; } -function vi(t = {}, e, n, r) { - return So(() => { +function vi(e = {}, t, n, r) { + return Ro(() => { var i, s; - return Ls(() => { + return Is(() => { i = s, s = [], Xi(() => { - t !== n(...s) && (e(t, ...s), i && $a(n(...i), t) && e(null, ...i)); + e !== n(...s) && (t(e, ...s), i && ba(n(...i), e) && t(null, ...i)); }); }), () => { - xn(() => { - s && $a(n(...s), t) && e(null, ...s); + wn(() => { + s && ba(n(...s), e) && t(null, ...s); }); }; - }), t; + }), e; } let si = !1; -function hf(t) { - var e = si; +function df(e) { + var t = si; try { - return si = !1, [t(), si]; + return si = !1, [e(), si]; } finally { - si = e; + si = t; } } -function at(t, e, n, r) { +function ie(e, t, n, r) { var D; - var i = (n & Xl) !== 0, s = (n & Wl) !== 0, a = ( + var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( /** @type {V} */ r ), o = !0, l = () => (o && (o = !1, a = s ? Xi( @@ -2574,186 +2574,186 @@ function at(t, e, n, r) { r )), a), u; if (i) { - var f = Mr in t || Qa in t; - u = ((D = Hn(t, e)) == null ? void 0 : D.set) ?? (f && e in t ? (M) => t[e] = M : void 0); + var f = Dr in e || Za in e; + u = ((D = zn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); } - var d, c = !1; - i ? [d, c] = hf(() => ( + var p, c = !1; + i ? [p, c] = df(() => ( /** @type {V} */ - t[e] - )) : d = /** @type {V} */ - t[e], d === void 0 && r !== void 0 && (d = l(), u && (du(), u(d))); - var p; - if (p = () => { + e[t] + )) : p = /** @type {V} */ + e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); + var d; + if (d = () => { var M = ( /** @type {V} */ - t[e] + e[t] ); return M === void 0 ? l() : (o = !0, M); - }, (n & Bl) === 0) - return p; + }, (n & Xl) === 0) + return d; if (u) { - var y = t.$$legacy; + var y = e.$$legacy; return ( /** @type {() => V} */ (function(M, S) { - return arguments.length > 0 ? ((!S || y || c) && u(S ? p() : M), M) : p(); + return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); }) ); } - var b = !1, m = ((n & Yl) !== 0 ? Yi : go)(() => (b = !1, p())); - i && x(m); - var $ = ( + var x = !1, m = ((n & Bl) !== 0 ? Yi : vo)(() => (x = !1, d())); + i && $(m); + var b = ( /** @type {Effect} */ - j + J ); return ( /** @type {() => V} */ (function(M, S) { if (arguments.length > 0) { - const F = S ? x(m) : i ? Pn(M) : M; - return ht(m, F), b = !0, a !== void 0 && (a = F), M; + const I = S ? $(m) : i ? Mn(M) : M; + return de(m, I), x = !0, a !== void 0 && (a = I), M; } - return An && b || ($.f & ln) !== 0 ? m.v : x(m); + return $n && x || (b.f & on) !== 0 ? m.v : $(m); }) ); } -function df(t) { - return new pf(t); +function pf(e) { + return new vf(e); } -var sn, fe; -class pf { +var rn, dt; +class vf { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(e) { + constructor(t) { /** @type {any} */ - H(this, sn); + H(this, rn); /** @type {Record} */ - H(this, fe); + H(this, dt); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ wo(o, !1, !1); + var l = /* @__PURE__ */ yo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...e.props || {}, $$events: {} }, + { ...t.props || {}, $$events: {} }, { get(a, o) { - return x(n.get(o) ?? r(o, Reflect.get(a, o))); + return $(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Za ? !0 : ($(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return ht(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return de(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - V(this, fe, (e.hydrate ? Ju : Bo)(e.component, { - target: e.target, - anchor: e.anchor, + V(this, dt, (t.hydrate ? Zu : Yo)(t.component, { + target: t.target, + anchor: t.anchor, props: i, - context: e.context, - intro: e.intro ?? !1, - recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && rt(), V(this, sn, i.$$events); - for (const a of Object.keys(v(this, fe))) + context: t.context, + intro: t.intro ?? !1, + recover: t.recover + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && ne(), V(this, rn, i.$$events); + for (const a of Object.keys(v(this, dt))) a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { get() { - return v(this, fe)[a]; + return v(this, dt)[a]; }, /** @param {any} value */ set(o) { - v(this, fe)[a] = o; + v(this, dt)[a] = o; }, enumerable: !0 }); - v(this, fe).$set = /** @param {Record} next */ + v(this, dt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, fe).$destroy = () => { - Zu(v(this, fe)); + }, v(this, dt).$destroy = () => { + Qu(v(this, dt)); }; } /** @param {Record} props */ - $set(e) { - v(this, fe).$set(e); + $set(t) { + v(this, dt).$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(e, n) { - v(this, sn)[e] = v(this, sn)[e] || []; + $on(t, n) { + v(this, rn)[t] = v(this, rn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, sn)[e].push(r), () => { - v(this, sn)[e] = v(this, sn)[e].filter( + return v(this, rn)[t].push(r), () => { + v(this, rn)[t] = v(this, rn)[t].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, fe).$destroy(); + v(this, dt).$destroy(); } } -sn = new WeakMap(), fe = new WeakMap(); -let Wo; -typeof HTMLElement == "function" && (Wo = class extends HTMLElement { +rn = new WeakMap(), dt = new WeakMap(); +let Xo; +typeof HTMLElement == "function" && (Xo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(e, n, r) { + constructor(t, n, r) { super(); /** The Svelte component constructor */ - ct(this, "$$ctor"); + he(this, "$$ctor"); /** Slots */ - ct(this, "$$s"); + he(this, "$$s"); /** @type {any} The Svelte component instance */ - ct(this, "$$c"); + he(this, "$$c"); /** Whether or not the custom element is connected */ - ct(this, "$$cn", !1); + he(this, "$$cn", !1); /** @type {Record} Component props data */ - ct(this, "$$d", {}); + he(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ct(this, "$$r", !1); + he(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ct(this, "$$p_d", {}); + he(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ct(this, "$$l", {}); + he(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ct(this, "$$l_u", /* @__PURE__ */ new Map()); + he(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ct(this, "$$me"); + he(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ct(this, "$$shadowRoot", null); - this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + he(this, "$$shadowRoot", null); + this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(e, n, r) { - if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { - const i = this.$$c.$on(e, n); + addEventListener(t, n, r) { + if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { + const i = this.$$c.$on(t, n); this.$$l_u.set(n, i); } - super.addEventListener(e, n, r); + super.addEventListener(t, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(e, n, r) { - if (super.removeEventListener(e, n, r), this.$$c) { + removeEventListener(t, n, r) { + if (super.removeEventListener(t, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2762,14 +2762,14 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Os("slot"); - s !== "default" && (o.name = s), Wt(a, o); + const o = Ds("slot"); + s !== "default" && (o.name = s), Ge(a, o); }; }; - var e = n; + var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = vf(this); + const r = {}, i = gf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { @@ -2778,7 +2778,7 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = df({ + this.$$c = pf({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,8 +2786,8 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = Lu(() => { - Ls(() => { + }), this.$$me = qu(() => { + Is(() => { var s; this.$$r = !0; for (const a of bi(this.$$c)) { @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(e, n, r) { + attributeChangedCallback(t, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = gi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = gi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,74 +2831,74 @@ typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(e) { + $$g_p(t) { return bi(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e - ) || e; + (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t + ) || t; } }); -function gi(t, e, n, r) { +function gi(e, t, n, r) { var s; - const i = (s = n[t]) == null ? void 0 : s.type; - if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) - return e; + const i = (s = n[e]) == null ? void 0 : s.type; + if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) + return t; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return e == null ? null : JSON.stringify(e); + return t == null ? null : JSON.stringify(t); case "Boolean": - return e ? "" : null; + return t ? "" : null; case "Number": - return e ?? null; + return t ?? null; default: - return e; + return t; } else switch (i) { case "Object": case "Array": - return e && JSON.parse(e); + return t && JSON.parse(t); case "Boolean": - return e; + return t; // conversion already handled above case "Number": - return e != null ? +e : e; + return t != null ? +t : t; default: - return e; + return t; } } -function vf(t) { - const e = {}; - return t.childNodes.forEach((n) => { - e[ +function gf(e) { + const t = {}; + return e.childNodes.forEach((n) => { + t[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), e; + }), t; } -function Ys(t, e, n, r, i, s) { - let a = class extends Wo { +function Hs(e, t, n, r, i, s) { + let a = class extends Xo { constructor() { - super(t, n, i), this.$$p_d = e; + super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return bi(e).map( - (o) => (e[o].attribute || o).toLowerCase() + return bi(t).map( + (o) => (t[o].attribute || o).toLowerCase() ); } }; - return bi(e).forEach((o) => { + return bi(t).forEach((o) => { $i(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var d; - l = gi(o, l, e), this.$$d[o] = l; + var p; + l = gi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (d = Hn(u, o)) == null ? void 0 : d.get; + var f = (p = zn(u, o)) == null ? void 0 : p.get; f ? u[o] = l : u.$set({ [o]: l }); } } @@ -2910,558 +2910,558 @@ function Ys(t, e, n, r, i, s) { return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), t.element = /** @type {any} */ + }), e.element = /** @type {any} */ a, a; } -var gf = { value: () => { +var _f = { value: () => { } }; -function Uo() { - 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); +function Wo() { + for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { + if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } return new _i(n); } -function _i(t) { - this._ = t; +function _i(e) { + this._ = e; } -function _f(t, e) { - return t.trim().split(/^|\s+/).map(function(n) { +function mf(e, t) { + return e.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); + if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -_i.prototype = Uo.prototype = { +_i.prototype = Wo.prototype = { constructor: _i, - on: function(t, e) { - var n = this._, r = _f(t + "", n), i, s = -1, a = r.length; + on: function(e, t) { + var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = mf(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; return; } - if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); + if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = Aa(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = Aa(n[i], t.name, null); + if (i = (e = r[s]).type) n[i] = $a(n[i], e.name, t); + else if (t == null) for (i in n) n[i] = $a(n[i], e.name, null); return this; }, copy: function() { - var t = {}, e = this._; - for (var n in e) t[n] = e[n].slice(); - return new _i(t); + var e = {}, t = this._; + for (var n in t) e[n] = t[n].slice(); + return new _i(e); }, - call: function(t, e) { + call: function(e, t) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); }, - apply: function(t, e, n) { - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); + apply: function(e, t, n) { + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function mf(t, e) { - for (var n = 0, r = t.length, i; n < r; ++n) - if ((i = t[n]).name === e) +function yf(e, t) { + for (var n = 0, r = e.length, i; n < r; ++n) + if ((i = e[n]).name === t) return i.value; } -function Aa(t, e, n) { - for (var r = 0, i = t.length; r < i; ++r) - if (t[r].name === e) { - t[r] = gf, t = t.slice(0, r).concat(t.slice(r + 1)); +function $a(e, t, n) { + for (var r = 0, i = e.length; r < i; ++r) + if (e[r].name === t) { + e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); break; } - return n != null && t.push({ name: e, value: n }), t; + return n != null && e.push({ name: t, value: n }), e; } -var xs = "http://www.w3.org/1999/xhtml"; -const Ea = { +var ws = "http://www.w3.org/1999/xhtml"; +const Aa = { svg: "http://www.w3.org/2000/svg", - xhtml: xs, + xhtml: ws, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Wi(t) { - var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ea.hasOwnProperty(e) ? { space: Ea[e], local: t } : t; +function Wi(e) { + var t = e += "", n = t.indexOf(":"); + return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Aa.hasOwnProperty(t) ? { space: Aa[t], local: e } : e; } -function yf(t) { +function wf(e) { return function() { - var e = this.ownerDocument, n = this.namespaceURI; - return n === xs && e.documentElement.namespaceURI === xs ? e.createElement(t) : e.createElementNS(n, t); + var t = this.ownerDocument, n = this.namespaceURI; + return n === ws && t.documentElement.namespaceURI === ws ? t.createElement(e) : t.createElementNS(n, e); }; } -function wf(t) { +function xf(e) { return function() { - return this.ownerDocument.createElementNS(t.space, t.local); + return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Go(t) { - var e = Wi(t); - return (e.local ? wf : yf)(e); +function Uo(e) { + var t = Wi(e); + return (t.local ? xf : wf)(t); } -function xf() { +function bf() { } -function Bs(t) { - return t == null ? xf : function() { - return this.querySelector(t); +function Ys(e) { + return e == null ? bf : function() { + return this.querySelector(e); }; } -function bf(t) { - typeof t != "function" && (t = Bs(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ie(r, this._parents); +function $f(e) { + typeof e != "function" && (e = Ys(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new ot(r, this._parents); } -function $f(t) { - return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +function Af(e) { + return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function Af() { +function Ef() { return []; } -function Ko(t) { - return t == null ? Af : function() { - return this.querySelectorAll(t); +function Go(e) { + return e == null ? Ef : function() { + return this.querySelectorAll(e); }; } -function Ef(t) { +function Tf(e) { return function() { - return $f(t.apply(this, arguments)); + return Af(e.apply(this, arguments)); }; } -function Tf(t) { - typeof t == "function" ? t = Ef(t) : t = Ko(t); - for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new ie(r, i); +function Cf(e) { + typeof e == "function" ? e = Tf(e) : e = Go(e); + for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); + return new ot(r, i); } -function jo(t) { +function Ko(e) { return function() { - return this.matches(t); + return this.matches(e); }; } -function Jo(t) { - return function(e) { - return e.matches(t); +function jo(e) { + return function(t) { + return t.matches(e); }; } -var Cf = Array.prototype.find; -function Rf(t) { +var Rf = Array.prototype.find; +function Sf(e) { return function() { - return Cf.call(this.children, t); + return Rf.call(this.children, e); }; } -function Sf() { +function Nf() { return this.firstElementChild; } -function Nf(t) { - return this.select(t == null ? Sf : Rf(typeof t == "function" ? t : Jo(t))); +function kf(e) { + return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : jo(e))); } -var kf = Array.prototype.filter; -function Mf() { +var Mf = Array.prototype.filter; +function Pf() { return Array.from(this.children); } -function Pf(t) { +function Df(e) { return function() { - return kf.call(this.children, t); + return Mf.call(this.children, e); }; } -function Df(t) { - return this.selectAll(t == null ? Mf : Pf(typeof t == "function" ? t : Jo(t))); +function Of(e) { + return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : jo(e))); } -function Of(t) { - typeof t != "function" && (t = jo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new ie(r, this._parents); +function Ff(e) { + typeof e != "function" && (e = Ko(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); + return new ot(r, this._parents); } -function Zo(t) { - return new Array(t.length); +function Jo(e) { + return new Array(e.length); } function If() { - return new ie(this._enter || this._groups.map(Zo), this._parents); + return new ot(this._enter || this._groups.map(Jo), this._parents); } -function Ei(t, e) { - this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +function Ei(e, t) { + this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } Ei.prototype = { constructor: Ei, - appendChild: function(t) { - return this._parent.insertBefore(t, this._next); + appendChild: function(e) { + return this._parent.insertBefore(e, this._next); }, - insertBefore: function(t, e) { - return this._parent.insertBefore(t, e); + insertBefore: function(e, t) { + return this._parent.insertBefore(e, t); }, - querySelector: function(t) { - return this._parent.querySelector(t); + querySelector: function(e) { + return this._parent.querySelector(e); }, - querySelectorAll: function(t) { - return this._parent.querySelectorAll(t); + querySelectorAll: function(e) { + return this._parent.querySelectorAll(e); } }; -function Ff(t) { +function Lf(e) { return function() { - return t; + return e; }; } -function Lf(t, e, n, r, i, s) { - for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(t, s[a]); +function qf(e, t, n, r, i, s) { + for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) + (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(e, s[a]); for (; a < l; ++a) - (o = e[a]) && (i[a] = o); + (o = t[a]) && (i[a] = o); } -function qf(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = s.length, c = new Array(f), p; +function Vf(e, t, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; for (o = 0; o < f; ++o) - (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); - for (o = 0; o < d; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ei(t, s[o]); + (l = t[o]) && (c[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); + for (o = 0; o < p; ++o) + d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ei(e, s[o]); for (o = 0; o < f; ++o) - (l = e[o]) && u.get(c[o]) === l && (i[o] = l); + (l = t[o]) && u.get(c[o]) === l && (i[o] = l); } -function Vf(t) { - return t.__data__; +function zf(e) { + return e.__data__; } -function zf(t, e) { - if (!arguments.length) return Array.from(this, Vf); - var n = e ? qf : Lf, r = this._parents, i = this._groups; - typeof t != "function" && (t = Ff(t)); +function Hf(e, t) { + if (!arguments.length) return Array.from(this, zf); + var n = t ? Vf : qf, r = this._parents, i = this._groups; + typeof e != "function" && (e = Lf(e)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], d = i[u], c = d.length, p = Hf(t.call(f, f && f.__data__, u, r)), y = p.length, b = o[u] = new Array(y), m = a[u] = new Array(y), $ = l[u] = new Array(c); - n(f, d, b, m, $, p, e); - for (var D = 0, M = 0, S, F; D < y; ++D) - if (S = b[D]) { - for (D >= M && (M = D + 1); !(F = m[M]) && ++M < y; ) ; - S._next = F || null; + var f = r[u], p = i[u], c = p.length, d = Yf(e.call(f, f && f.__data__, u, r)), y = d.length, x = o[u] = new Array(y), m = a[u] = new Array(y), b = l[u] = new Array(c); + n(f, p, x, m, b, d, t); + for (var D = 0, M = 0, S, I; D < y; ++D) + if (S = x[D]) { + for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; + S._next = I || null; } } - return a = new ie(a, r), a._enter = o, a._exit = l, a; + return a = new ot(a, r), a._enter = o, a._exit = l, a; } -function Hf(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function Yf(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Yf() { - return new ie(this._exit || this._groups.map(Zo), this._parents); +function Bf() { + return new ot(this._exit || this._groups.map(Jo), this._parents); } -function Bf(t, e, n) { +function Xf(e, t, n) { var r = this.enter(), i = this, s = 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 ? s.remove() : n(s), r && i ? r.merge(i).order() : i; + return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Xf(t) { - for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) - for (var u = n[l], f = r[l], d = u.length, c = o[l] = new Array(d), p, y = 0; y < d; ++y) - (p = u[y] || f[y]) && (c[y] = p); +function Wf(e) { + for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) + for (var u = n[l], f = r[l], p = u.length, c = o[l] = new Array(p), d, y = 0; y < p; ++y) + (d = u[y] || f[y]) && (c[y] = d); for (; l < i; ++l) o[l] = n[l]; - return new ie(o, this._parents); + return new ot(o, this._parents); } -function Wf() { - for (var t = this._groups, e = -1, n = t.length; ++e < n; ) - for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) +function Uf() { + for (var e = this._groups, t = -1, n = e.length; ++t < n; ) + for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function Uf(t) { - t || (t = Gf); - function e(d, c) { - return d && c ? t(d.__data__, c.__data__) : !d - !c; +function Gf(e) { + e || (e = Kf); + function t(p, c) { + return p && c ? e(p.__data__, c.__data__) : !p - !c; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); - l.sort(e); + l.sort(t); } - return new ie(i, this._parents).order(); -} -function Gf(t, e) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; + return new ot(i, this._parents).order(); } -function Kf() { - var t = arguments[0]; - return arguments[0] = this, t.apply(null, arguments), this; +function Kf(e, t) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } function jf() { - return Array.from(this); + var e = arguments[0]; + return arguments[0] = this, e.apply(null, arguments), this; } function Jf() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length; i < s; ++i) { + return Array.from(this); +} +function Zf() { + for (var e = this._groups, t = 0, n = e.length; t < n; ++t) + for (var r = e[t], i = 0, s = r.length; i < s; ++i) { var a = r[i]; if (a) return a; } return null; } -function Zf() { - let t = 0; - for (const e of this) ++t; - return t; -} function Qf() { + let e = 0; + for (const t of this) ++e; + return e; +} +function ec() { return !this.node(); } -function tc(t) { - for (var e = this._groups, n = 0, r = e.length; n < r; ++n) - for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && t.call(o, o.__data__, s, i); +function tc(e) { + for (var t = this._groups, n = 0, r = t.length; n < r; ++n) + for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && e.call(o, o.__data__, s, i); return this; } -function ec(t) { +function nc(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function nc(t) { +function rc(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function rc(t, e) { +function ic(e, t) { return function() { - this.setAttribute(t, e); + this.setAttribute(e, t); }; } -function ic(t, e) { +function sc(e, t) { return function() { - this.setAttributeNS(t.space, t.local, e); + this.setAttributeNS(e.space, e.local, t); }; } -function sc(t, e) { +function ac(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function ac(t, e) { +function oc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function oc(t, e) { - var n = Wi(t); +function lc(e, t) { + var n = Wi(e); 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 ? nc : ec : typeof e == "function" ? n.local ? ac : sc : n.local ? ic : rc)(n, e)); + return this.each((t == null ? n.local ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); } -function Qo(t) { - return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +function Zo(e) { + return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function lc(t) { +function uc(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function uc(t, e, n) { +function fc(e, t, n) { return function() { - this.style.setProperty(t, e, n); + this.style.setProperty(e, t, n); }; } -function fc(t, e, n) { +function cc(e, t, n) { return function() { - var r = e.apply(this, arguments); - r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + var r = t.apply(this, arguments); + r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function cc(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? lc : typeof e == "function" ? fc : uc)(t, e, n ?? "")) : gr(this.node(), t); +function hc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : mr(this.node(), e); } -function gr(t, e) { - return t.style.getPropertyValue(e) || Qo(t).getComputedStyle(t, null).getPropertyValue(e); +function mr(e, t) { + return e.style.getPropertyValue(t) || Zo(e).getComputedStyle(e, null).getPropertyValue(t); } -function hc(t) { +function dc(e) { return function() { - delete this[t]; + delete this[e]; }; } -function dc(t, e) { +function pc(e, t) { return function() { - this[t] = e; + this[e] = t; }; } -function pc(t, e) { +function vc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? delete this[t] : this[t] = n; + var n = t.apply(this, arguments); + n == null ? delete this[e] : this[e] = n; }; } -function vc(t, e) { - return arguments.length > 1 ? this.each((e == null ? hc : typeof e == "function" ? pc : dc)(t, e)) : this.node()[t]; +function gc(e, t) { + return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; } -function tl(t) { - return t.trim().split(/^|\s+/); +function Qo(e) { + return e.trim().split(/^|\s+/); } -function Xs(t) { - return t.classList || new el(t); +function Bs(e) { + return e.classList || new el(e); } -function el(t) { - this._node = t, this._names = tl(t.getAttribute("class") || ""); +function el(e) { + this._node = e, this._names = Qo(e.getAttribute("class") || ""); } el.prototype = { - add: function(t) { - var e = this._names.indexOf(t); - e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); + add: function(e) { + var t = this._names.indexOf(e); + t < 0 && (this._names.push(e), 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(" "))); + remove: function(e) { + var t = this._names.indexOf(e); + t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); }, - contains: function(t) { - return this._names.indexOf(t) >= 0; + contains: function(e) { + return this._names.indexOf(e) >= 0; } }; -function nl(t, e) { - for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function tl(e, t) { + for (var n = Bs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function rl(t, e) { - for (var n = Xs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function nl(e, t) { + for (var n = Bs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function gc(t) { +function _c(e) { return function() { - nl(this, t); + tl(this, e); }; } -function _c(t) { +function mc(e) { return function() { - rl(this, t); + nl(this, e); }; } -function mc(t, e) { +function yc(e, t) { return function() { - (e.apply(this, arguments) ? nl : rl)(this, t); + (t.apply(this, arguments) ? tl : nl)(this, e); }; } -function yc(t, e) { - var n = tl(t + ""); +function wc(e, t) { + var n = Qo(e + ""); if (arguments.length < 2) { - for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Bs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? mc : e ? gc : _c)(n, e)); + return this.each((typeof t == "function" ? yc : t ? _c : mc)(n, t)); } -function wc() { +function xc() { this.textContent = ""; } -function xc(t) { +function bc(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function bc(t) { +function $c(e) { return function() { - var e = t.apply(this, arguments); - this.textContent = e ?? ""; + var t = e.apply(this, arguments); + this.textContent = t ?? ""; }; } -function $c(t) { - return arguments.length ? this.each(t == null ? wc : (typeof t == "function" ? bc : xc)(t)) : this.node().textContent; +function Ac(e) { + return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; } -function Ac() { +function Ec() { this.innerHTML = ""; } -function Ec(t) { +function Tc(e) { return function() { - this.innerHTML = t; + this.innerHTML = e; }; } -function Tc(t) { +function Cc(e) { return function() { - var e = t.apply(this, arguments); - this.innerHTML = e ?? ""; + var t = e.apply(this, arguments); + this.innerHTML = t ?? ""; }; } -function Cc(t) { - return arguments.length ? this.each(t == null ? Ac : (typeof t == "function" ? Tc : Ec)(t)) : this.node().innerHTML; -} -function Rc() { - this.nextSibling && this.parentNode.appendChild(this); +function Rc(e) { + return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; } function Sc() { - return this.each(Rc); + this.nextSibling && this.parentNode.appendChild(this); } function Nc() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); + return this.each(Sc); } function kc() { - return this.each(Nc); + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} +function Mc() { + return this.each(kc); } -function Mc(t) { - var e = typeof t == "function" ? t : Go(t); +function Pc(e) { + var t = typeof e == "function" ? e : Uo(e); return this.select(function() { - return this.appendChild(e.apply(this, arguments)); + return this.appendChild(t.apply(this, arguments)); }); } -function Pc() { +function Dc() { return null; } -function Dc(t, e) { - var n = typeof t == "function" ? t : Go(t), r = e == null ? Pc : typeof e == "function" ? e : Bs(e); +function Oc(e, t) { + var n = typeof e == "function" ? e : Uo(e), r = t == null ? Dc : typeof t == "function" ? t : Ys(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Oc() { - var t = this.parentNode; - t && t.removeChild(this); +function Fc() { + var e = this.parentNode; + e && e.removeChild(this); } function Ic() { - return this.each(Oc); -} -function Fc() { - var t = this.cloneNode(!1), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; + return this.each(Fc); } function Lc() { - var t = this.cloneNode(!0), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; + var e = this.cloneNode(!1), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; +} +function qc() { + var e = this.cloneNode(!0), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function qc(t) { - return this.select(t ? Lc : Fc); +function Vc(e) { + return this.select(e ? qc : Lc); } -function Vc(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; +function zc(e) { + return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function zc(t) { - return function(e) { - t.call(this, e, this.__data__); +function Hc(e) { + return function(t) { + e.call(this, t, this.__data__); }; } -function Hc(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 Yc(e) { + return e.trim().split(/^|\s+/).map(function(t) { + var n = "", r = t.indexOf("."); + return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; }); } -function Yc(t) { +function Bc(e) { return function() { - var e = this.__on; - if (e) { - for (var n = 0, r = -1, i = e.length, s; n < i; ++n) - s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; - ++r ? e.length = r : delete this.__on; + var t = this.__on; + if (t) { + for (var n = 0, r = -1, i = t.length, s; n < i; ++n) + s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; + ++r ? t.length = r : delete this.__on; } }; } -function Bc(t, e, n) { +function Xc(e, t, n) { return function() { - var r = this.__on, i, s = zc(e); + var r = this.__on, i, s = Hc(t); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === t.type && i.name === t.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; + if ((i = r[a]).type === e.type && i.name === e.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; return; } } - this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Xc(t, e, n) { - var r = Hc(t + ""), i, s = r.length, a; +function Wc(e, t, n) { + var r = Yc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Xc(t, e, n) { } return; } - for (o = e ? Bc : Yc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function il(t, e, n) { - var r = Qo(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 rl(e, t, n) { + var r = Zo(e), i = r.CustomEvent; + typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); } -function Wc(t, e) { +function Uc(e, t) { return function() { - return il(this, t, e); + return rl(this, e, t); }; } -function Uc(t, e) { +function Gc(e, t) { return function() { - return il(this, t, e.apply(this, arguments)); + return rl(this, e, t.apply(this, arguments)); }; } -function Gc(t, e) { - return this.each((typeof e == "function" ? Uc : Wc)(t, e)); +function Kc(e, t) { + return this.each((typeof t == "function" ? Gc : Uc)(e, t)); } -function* Kc() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) +function* jc() { + for (var e = this._groups, t = 0, n = e.length; t < n; ++t) + for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var sl = [null]; -function ie(t, e) { - this._groups = t, this._parents = e; +var il = [null]; +function ot(e, t) { + this._groups = e, this._parents = t; } -function wr() { - return new ie([[document.documentElement]], sl); +function br() { + return new ot([[document.documentElement]], il); } -function jc() { +function Jc() { return this; } -ie.prototype = wr.prototype = { - constructor: ie, - select: bf, - selectAll: Tf, - selectChild: Nf, - selectChildren: Df, - filter: Of, - data: zf, +ot.prototype = br.prototype = { + constructor: ot, + select: $f, + selectAll: Cf, + selectChild: kf, + selectChildren: Of, + filter: Ff, + data: Hf, enter: If, - exit: Yf, - join: Bf, - merge: Xf, - selection: jc, - order: Wf, - sort: Uf, - call: Kf, - nodes: jf, - node: Jf, - size: Zf, - empty: Qf, + exit: Bf, + join: Xf, + merge: Wf, + selection: Jc, + order: Uf, + sort: Gf, + call: jf, + nodes: Jf, + node: Zf, + size: Qf, + empty: ec, each: tc, - attr: oc, - style: cc, - property: vc, - classed: yc, - text: $c, - html: Cc, - raise: Sc, - lower: kc, - append: Mc, - insert: Dc, + attr: lc, + style: hc, + property: gc, + classed: wc, + text: Ac, + html: Rc, + raise: Nc, + lower: Mc, + append: Pc, + insert: Oc, remove: Ic, - clone: qc, - datum: Vc, - on: Xc, - dispatch: Gc, - [Symbol.iterator]: Kc + clone: Vc, + datum: zc, + on: Wc, + dispatch: Kc, + [Symbol.iterator]: jc }; -function ft(t) { - return typeof t == "string" ? new ie([[document.querySelector(t)]], [document.documentElement]) : new ie([[t]], sl); +function fe(e) { + return typeof e == "string" ? new ot([[document.querySelector(e)]], [document.documentElement]) : new ot([[e]], il); } -function Ws(t, e, n) { - t.prototype = e.prototype = n, n.constructor = t; +function Xs(e, t, n) { + e.prototype = t.prototype = n, n.constructor = e; } -function al(t, e) { - var n = Object.create(t.prototype); - for (var r in e) n[r] = e[r]; +function sl(e, t) { + var n = Object.create(e.prototype); + for (var r in t) n[r] = t[r]; return n; } -function Gr() { +function jr() { } -var Fr = 0.7, Ti = 1 / Fr, er = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Jc = /^#([0-9a-f]{3,8})$/, Zc = new RegExp(`^rgb\\(${er},${er},${er}\\)$`), Qc = new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`), th = new RegExp(`^rgba\\(${er},${er},${er},${Lr}\\)$`), eh = new RegExp(`^rgba\\(${qe},${qe},${qe},${Lr}\\)$`), nh = new RegExp(`^hsl\\(${Lr},${qe},${qe}\\)$`), rh = new RegExp(`^hsla\\(${Lr},${qe},${qe},${Lr}\\)$`), Ta = { +var qr = 0.7, Ti = 1 / qr, rr = "\\s*([+-]?\\d+)\\s*", Vr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Lt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${rr},${rr},${rr}\\)$`), eh = new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`), th = new RegExp(`^rgba\\(${rr},${rr},${rr},${Vr}\\)$`), nh = new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${Vr}\\)$`), rh = new RegExp(`^hsl\\(${Vr},${Lt},${Lt}\\)$`), ih = new RegExp(`^hsla\\(${Vr},${Lt},${Lt},${Vr}\\)$`), Ea = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,243 +3708,243 @@ var Fr = 0.7, Ti = 1 / Fr, er = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ws(Gr, Gn, { - copy(t) { - return Object.assign(new this.constructor(), this, t); +Xs(jr, Un, { + copy(e) { + return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); }, - hex: Ca, + hex: Ta, // Deprecated! Use color.formatHex. - formatHex: Ca, - formatHex8: ih, - formatHsl: sh, - formatRgb: Ra, - toString: Ra + formatHex: Ta, + formatHex8: sh, + formatHsl: ah, + formatRgb: Ca, + toString: Ca }); -function Ca() { +function Ta() { return this.rgb().formatHex(); } -function ih() { +function sh() { return this.rgb().formatHex8(); } -function sh() { - return ol(this).formatHsl(); +function ah() { + return al(this).formatHsl(); } -function Ra() { +function Ca() { return this.rgb().formatRgb(); } -function Gn(t) { - var e, n; - return t = (t + "").trim().toLowerCase(), (e = Jc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sa(e) : n === 3 ? new Kt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ai(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ai(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 = Zc.exec(t)) ? new Kt(e[1], e[2], e[3], 1) : (e = Qc.exec(t)) ? new Kt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = th.exec(t)) ? ai(e[1], e[2], e[3], e[4]) : (e = eh.exec(t)) ? ai(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = nh.exec(t)) ? Ma(e[1], e[2] / 100, e[3] / 100, 1) : (e = rh.exec(t)) ? Ma(e[1], e[2] / 100, e[3] / 100, e[4]) : Ta.hasOwnProperty(t) ? Sa(Ta[t]) : t === "transparent" ? new Kt(NaN, NaN, NaN, 0) : null; +function Un(e) { + var t, n; + return e = (e + "").trim().toLowerCase(), (t = Zc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, t[4]) : Ea.hasOwnProperty(e) ? Ra(Ea[e]) : e === "transparent" ? new Je(NaN, NaN, NaN, 0) : null; } -function Sa(t) { - return new Kt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Ra(e) { + return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function ai(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Kt(t, e, n, r); +function ai(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); } -function ah(t) { - return t instanceof Gr || (t = Gn(t)), t ? (t = t.rgb(), new Kt(t.r, t.g, t.b, t.opacity)) : new Kt(); +function oh(e) { + return e instanceof jr || (e = Un(e)), e ? (e = e.rgb(), new Je(e.r, e.g, e.b, e.opacity)) : new Je(); } -function bs(t, e, n, r) { - return arguments.length === 1 ? ah(t) : new Kt(t, e, n, r ?? 1); +function xs(e, t, n, r) { + return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); } -function Kt(t, e, n, r) { - this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +function Je(e, t, n, r) { + this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Ws(Kt, bs, al(Gr, { - brighter(t) { - return t = t == null ? Ti : Math.pow(Ti, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); +Xs(Je, xs, sl(jr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); }, - darker(t) { - return t = t == null ? Fr : Math.pow(Fr, t), new Kt(this.r * t, this.g * t, this.b * t, this.opacity); + darker(e) { + return e = e == null ? qr : Math.pow(qr, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new Kt(Xn(this.r), Xn(this.g), Xn(this.b), Ci(this.opacity)); + return new Je(Bn(this.r), Bn(this.g), Bn(this.b), Ci(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: Na, + hex: Sa, // Deprecated! Use color.formatHex. - formatHex: Na, - formatHex8: oh, - formatRgb: ka, - toString: ka + formatHex: Sa, + formatHex8: lh, + formatRgb: Na, + toString: Na })); -function Na() { - return `#${On(this.r)}${On(this.g)}${On(this.b)}`; +function Sa() { + return `#${Dn(this.r)}${Dn(this.g)}${Dn(this.b)}`; } -function oh() { - return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function lh() { + return `#${Dn(this.r)}${Dn(this.g)}${Dn(this.b)}${Dn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ka() { - const t = Ci(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function Na() { + const e = Ci(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${Bn(this.r)}, ${Bn(this.g)}, ${Bn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ci(t) { - return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +function Ci(e) { + return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function Xn(t) { - return Math.max(0, Math.min(255, Math.round(t) || 0)); +function Bn(e) { + return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function On(t) { - return t = Xn(t), (t < 16 ? "0" : "") + t.toString(16); +function Dn(e) { + return e = Bn(e), (e < 16 ? "0" : "") + e.toString(16); } -function Ma(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new be(t, e, n, r); +function ka(e, t, n, r) { + return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new xt(e, t, n, r); } -function ol(t) { - if (t instanceof be) return new be(t.h, t.s, t.l, t.opacity); - if (t instanceof Gr || (t = Gn(t)), !t) return new be(); - if (t instanceof be) return t; - t = t.rgb(); - var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new be(a, o, l, t.opacity); +function al(e) { + if (e instanceof xt) return new xt(e.h, e.s, e.l, e.opacity); + if (e instanceof jr || (e = Un(e)), !e) return new xt(); + if (e instanceof xt) return e; + e = e.rgb(); + var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new xt(a, o, l, e.opacity); } -function lh(t, e, n, r) { - return arguments.length === 1 ? ol(t) : new be(t, e, n, r ?? 1); +function uh(e, t, n, r) { + return arguments.length === 1 ? al(e) : new xt(e, t, n, r ?? 1); } -function be(t, e, n, r) { - this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +function xt(e, t, n, r) { + this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Ws(be, lh, al(Gr, { - brighter(t) { - return t = t == null ? Ti : Math.pow(Ti, t), new be(this.h, this.s, this.l * t, this.opacity); +Xs(xt, uh, sl(jr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new xt(this.h, this.s, this.l * e, this.opacity); }, - darker(t) { - return t = t == null ? Fr : Math.pow(Fr, t), new be(this.h, this.s, this.l * t, this.opacity); + darker(e) { + return e = e == null ? qr : Math.pow(qr, e), new xt(this.h, this.s, this.l * e, 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 Kt( - rs(t >= 240 ? t - 240 : t + 120, i, r), - rs(t, i, r), - rs(t < 120 ? t + 240 : t - 120, i, r), + var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; + return new Je( + ns(e >= 240 ? e - 240 : e + 120, i, r), + ns(e, i, r), + ns(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new be(Pa(this.h), oi(this.s), oi(this.l), Ci(this.opacity)); + return new xt(Ma(this.h), oi(this.s), oi(this.l), Ci(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 = Ci(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const e = Ci(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Ma(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function Pa(t) { - return t = (t || 0) % 360, t < 0 ? t + 360 : t; +function Ma(e) { + return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function oi(t) { - return Math.max(0, Math.min(1, t || 0)); +function oi(e) { + return Math.max(0, Math.min(1, e || 0)); } -function rs(t, e, n) { - return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; +function ns(e, t, n) { + return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; } -const Us = (t) => () => t; -function uh(t, e) { +const Ws = (e) => () => e; +function fh(e, t) { return function(n) { - return t + n * e; + return e + n * t; }; } -function fh(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 ch(e, t, n) { + return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { + return Math.pow(e + r * t, n); }; } -function ch(t) { - return (t = +t) == 1 ? ll : function(e, n) { - return n - e ? fh(e, n, t) : Us(isNaN(e) ? n : e); +function hh(e) { + return (e = +e) == 1 ? ol : function(t, n) { + return n - t ? ch(t, n, e) : Ws(isNaN(t) ? n : t); }; } -function ll(t, e) { - var n = e - t; - return n ? uh(t, n) : Us(isNaN(t) ? e : t); +function ol(e, t) { + var n = t - e; + return n ? fh(e, n) : Ws(isNaN(e) ? t : e); } -const Ri = (function t(e) { - var n = ch(e); +const Ri = (function e(t) { + var n = hh(t); function r(i, s) { - var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ll(i.opacity, s.opacity); + var a = n((i = xs(i)).r, (s = xs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ol(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } - return r.gamma = t, r; + return r.gamma = e, r; })(1); -function hh(t, e) { - e || (e = []); - var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; +function dh(e, t) { + t || (t = []); + var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; + for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; return r; }; } -function dh(t) { - return ArrayBuffer.isView(t) && !(t instanceof DataView); +function ph(e) { + return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function ph(t, e) { - var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Ze(t[a], e[a]); - for (; a < n; ++a) s[a] = e[a]; +function vh(e, t) { + var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = Jt(e[a], t[a]); + for (; a < n; ++a) s[a] = t[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function vh(t, e) { +function gh(e, t) { var n = /* @__PURE__ */ new Date(); - return t = +t, e = +e, function(r) { - return n.setTime(t * (1 - r) + e * r), n; + return e = +e, t = +t, function(r) { + return n.setTime(e * (1 - r) + t * r), n; }; } -function Le(t, e) { - return t = +t, e = +e, function(n) { - return t * (1 - n) + e * n; +function It(e, t) { + return e = +e, t = +t, function(n) { + return e * (1 - n) + t * n; }; } -function gh(t, e) { +function _h(e, t) { 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] = Ze(t[i], e[i]) : r[i] = e[i]; + (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); + for (i in t) + i in e ? n[i] = Jt(e[i], t[i]) : r[i] = t[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function _h(t) { +var bs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, rs = new RegExp(bs.source, "g"); +function mh(e) { return function() { - return t; + return e; }; } -function mh(t) { - return function(e) { - return t(e) + ""; +function yh(e) { + return function(t) { + return e(t) + ""; }; } -function ul(t, e) { - var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = $s.exec(t)) && (i = is.exec(e)); ) - (s = i.index) > n && (s = e.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Le(r, i) })), n = is.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? mh(l[0].x) : _h(e) : (e = l.length, function(u) { - for (var f = 0, d; f < e; ++f) o[(d = l[f]).i] = d.x(u); +function ll(e, t) { + var n = bs.lastIndex = rs.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (e = e + "", t = t + ""; (r = bs.exec(e)) && (i = rs.exec(t)); ) + (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: It(r, i) })), n = rs.lastIndex; + return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? yh(l[0].x) : mh(t) : (t = l.length, function(u) { + for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); return o.join(""); }); } -function Ze(t, e) { - var n = typeof e, r; - return e == null || n === "boolean" ? Us(e) : (n === "number" ? Le : n === "string" ? (r = Gn(e)) ? (e = r, Ri) : ul : e instanceof Gn ? Ri : e instanceof Date ? vh : dh(e) ? hh : Array.isArray(e) ? ph : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? gh : Le)(t, e); +function Jt(e, t) { + var n = typeof t, r; + return t == null || n === "boolean" ? Ws(t) : (n === "number" ? It : n === "string" ? (r = Un(t)) ? (t = r, Ri) : ll : t instanceof Un ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); } -var Da = 180 / Math.PI, As = { +var Pa = 180 / Math.PI, $s = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,213 +3952,213 @@ var Da = 180 / Math.PI, As = { scaleX: 1, scaleY: 1 }; -function fl(t, e, n, r, i, s) { +function ul(e, t, n, r, i, s) { var a, o, l; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { + return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * Da, - skewX: Math.atan(l) * Da, + rotate: Math.atan2(t, e) * Pa, + skewX: Math.atan(l) * Pa, scaleX: a, scaleY: o }; } var li; -function yh(t) { - const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? As : fl(e.a, e.b, e.c, e.d, e.e, e.f); +function wh(e) { + const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); + return t.isIdentity ? $s : ul(t.a, t.b, t.c, t.d, t.e, t.f); } -function wh(t) { - return t == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", t), !(t = li.transform.baseVal.consolidate())) ? As : (t = t.matrix, fl(t.a, t.b, t.c, t.d, t.e, t.f)); +function xh(e) { + return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? $s : (e = e.matrix, ul(e.a, e.b, e.c, e.d, e.e, e.f)); } -function cl(t, e, n, r) { +function fl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, d, c, p, y) { - if (u !== d || f !== c) { - var b = p.push("translate(", null, e, null, n); - y.push({ i: b - 4, x: Le(u, d) }, { i: b - 2, x: Le(f, c) }); - } else (d || c) && p.push("translate(" + d + e + c + n); + function s(u, f, p, c, d, y) { + if (u !== p || f !== c) { + var x = d.push("translate(", null, t, null, n); + y.push({ i: x - 4, x: It(u, p) }, { i: x - 2, x: It(f, c) }); + } else (p || c) && d.push("translate(" + p + t + c + n); } - function a(u, f, d, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Le(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); + function a(u, f, p, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); } - function o(u, f, d, c) { - u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Le(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); + function o(u, f, p, c) { + u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); } - function l(u, f, d, c, p, y) { - if (u !== d || f !== c) { - var b = p.push(i(p) + "scale(", null, ",", null, ")"); - y.push({ i: b - 4, x: Le(u, d) }, { i: b - 2, x: Le(f, c) }); - } else (d !== 1 || c !== 1) && p.push(i(p) + "scale(" + d + "," + c + ")"); + function l(u, f, p, c, d, y) { + if (u !== p || f !== c) { + var x = d.push(i(d) + "scale(", null, ",", null, ")"); + y.push({ i: x - 4, x: It(u, p) }, { i: x - 2, x: It(f, c) }); + } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); } return function(u, f) { - var d = [], c = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, c), a(u.rotate, f.rotate, d, c), o(u.skewX, f.skewX, d, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, c), u = f = null, function(p) { - for (var y = -1, b = c.length, m; ++y < b; ) d[(m = c[y]).i] = m.x(p); - return d.join(""); + var p = [], c = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { + for (var y = -1, x = c.length, m; ++y < x; ) p[(m = c[y]).i] = m.x(d); + return p.join(""); }; }; } -var xh = cl(yh, "px, ", "px)", "deg)"), bh = cl(wh, ", ", ")", ")"), _r = 0, Sr = 0, Cr = 0, hl = 1e3, Si, Nr, Ni = 0, Kn = 0, Ui = 0, qr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { - setTimeout(t, 17); +var bh = fl(wh, "px, ", "px)", "deg)"), $h = fl(xh, ", ", ")", ")"), yr = 0, kr = 0, Sr = 0, cl = 1e3, Si, Mr, Ni = 0, Gn = 0, Ui = 0, zr = typeof performance == "object" && performance.now ? performance : Date, hl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { + setTimeout(e, 17); }; -function Gs() { - return Kn || (dl($h), Kn = qr.now() + Ui); +function Us() { + return Gn || (hl(Ah), Gn = zr.now() + Ui); } -function $h() { - Kn = 0; +function Ah() { + Gn = 0; } function ki() { this._call = this._time = this._next = null; } -ki.prototype = pl.prototype = { +ki.prototype = dl.prototype = { constructor: ki, - restart: function(t, e, n) { - if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Gs() : +n) + (e == null ? 0 : +e), !this._next && Nr !== this && (Nr ? Nr._next = this : Si = this, Nr = this), this._call = t, this._time = n, Es(); + restart: function(e, t, n) { + if (typeof e != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Us() : +n) + (t == null ? 0 : +t), !this._next && Mr !== this && (Mr ? Mr._next = this : Si = this, Mr = this), this._call = e, this._time = n, As(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Es()); + this._call && (this._call = null, this._time = 1 / 0, As()); } }; -function pl(t, e, n) { +function dl(e, t, n) { var r = new ki(); - return r.restart(t, e, n), r; + return r.restart(e, t, n), r; } -function Ah() { - Gs(), ++_r; - for (var t = Si, e; t; ) - (e = Kn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --_r; +function Eh() { + Us(), ++yr; + for (var e = Si, t; e; ) + (t = Gn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + --yr; } -function Oa() { - Kn = (Ni = qr.now()) + Ui, _r = Sr = 0; +function Da() { + Gn = (Ni = zr.now()) + Ui, yr = kr = 0; try { - Ah(); + Eh(); } finally { - _r = 0, Th(), Kn = 0; + yr = 0, Ch(), Gn = 0; } } -function Eh() { - var t = qr.now(), e = t - Ni; - e > hl && (Ui -= e, Ni = t); -} function Th() { - for (var t, e = Si, 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 : Si = n); - Nr = t, Es(r); + var e = zr.now(), t = e - Ni; + t > cl && (Ui -= t, Ni = e); +} +function Ch() { + for (var e, t = Si, n, r = 1 / 0; t; ) + t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Si = n); + Mr = e, As(r); } -function Es(t) { - if (!_r) { - Sr && (Sr = clearTimeout(Sr)); - var e = t - Kn; - e > 24 ? (t < 1 / 0 && (Sr = setTimeout(Oa, t - qr.now() - Ui)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Ni = qr.now(), Cr = setInterval(Eh, hl)), _r = 1, dl(Oa)); +function As(e) { + if (!yr) { + kr && (kr = clearTimeout(kr)); + var t = e - Gn; + t > 24 ? (e < 1 / 0 && (kr = setTimeout(Da, e - zr.now() - Ui)), Sr && (Sr = clearInterval(Sr))) : (Sr || (Ni = zr.now(), Sr = setInterval(Th, cl)), yr = 1, hl(Da)); } } -function Ia(t, e, n) { +function Oa(e, t, n) { var r = new ki(); - return e = e == null ? 0 : +e, r.restart((i) => { - r.stop(), t(i + e); - }, e, n), r; -} -var Ch = Uo("start", "end", "cancel", "interrupt"), Rh = [], vl = 0, Fa = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; -function Gi(t, e, n, r, i, s) { - var a = t.__transition; - if (!a) t.__transition = {}; + return t = t == null ? 0 : +t, r.restart((i) => { + r.stop(), e(i + t); + }, t, n), r; +} +var Rh = Wo("start", "end", "cancel", "interrupt"), Sh = [], pl = 0, Fa = 1, Es = 2, mi = 3, Ia = 4, Ts = 5, yi = 6; +function Gi(e, t, n, r, i, s) { + var a = e.__transition; + if (!a) e.__transition = {}; else if (n in a) return; - Sh(t, n, { - name: e, + Nh(e, n, { + name: t, index: r, // For context during callback. group: i, // For context during callback. - on: Ch, - tween: Rh, + on: Rh, + tween: Sh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: vl + state: pl }); } -function Ks(t, e) { - var n = Ce(t, e); - if (n.state > vl) throw new Error("too late; already scheduled"); +function Gs(e, t) { + var n = Tt(e, t); + if (n.state > pl) throw new Error("too late; already scheduled"); return n; } -function Xe(t, e) { - var n = Ce(t, e); +function Bt(e, t) { + var n = Tt(e, t); if (n.state > mi) throw new Error("too late; already running"); return n; } -function Ce(t, e) { - var n = t.__transition; - if (!n || !(n = n[e])) throw new Error("transition not found"); +function Tt(e, t) { + var n = e.__transition; + if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function Sh(t, e, n) { - var r = t.__transition, i; - r[e] = n, n.timer = pl(s, 0, n.time); +function Nh(e, t, n) { + var r = e.__transition, i; + r[t] = n, n.timer = dl(s, 0, n.time); function s(u) { n.state = Fa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, d, c, p; + var f, p, c, d; if (n.state !== Fa) return l(); for (f in r) - if (p = r[f], p.name === n.name) { - if (p.state === mi) return Ia(a); - p.state === La ? (p.state = yi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = yi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (d = r[f], d.name === n.name) { + if (d.state === mi) return Oa(a); + d.state === Ia ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); } - if (Ia(function() { - n.state === mi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ts) { - for (n.state = mi, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) - (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = p); - i.length = d + 1; + if (Oa(function() { + n.state === mi && (n.state = Ia, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Es, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Es) { + for (n.state = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) + (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); + i.length = p + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Cs, 1), d = -1, c = i.length; ++d < c; ) - i[d].call(t, f); - n.state === Cs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Ts, 1), p = -1, c = i.length; ++p < c; ) + i[p].call(e, f); + n.state === Ts && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } function l() { - n.state = yi, n.timer.stop(), delete r[e]; + n.state = yi, n.timer.stop(), delete r[t]; for (var u in r) return; - delete t.__transition; + delete e.__transition; } } -function Nh(t, e) { - var n = t.__transition, r, i, s = !0, a; +function kh(e, t) { + var n = e.__transition, r, i, s = !0, a; if (n) { - e = e == null ? null : e + ""; + t = t == null ? null : t + ""; for (a in n) { - if ((r = n[a]).name !== e) { + if ((r = n[a]).name !== t) { s = !1; continue; } - i = r.state > Ts && r.state < Cs, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Es && r.state < Ts, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } - s && delete t.__transition; + s && delete e.__transition; } } -function kh(t) { +function Mh(e) { return this.each(function() { - Nh(this, t); + kh(this, e); }); } -function Mh(t, e) { +function Ph(e, t) { var n, r; return function() { - var i = Xe(this, t), s = i.tween; + var i = Bt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === e) { + if (r[a].name === t) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Mh(t, e) { i.tween = r; }; } -function Ph(t, e, n) { +function Dh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Xe(this, t), a = s.tween; + var s = Bt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === e) { + for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === t) { i[l] = o; break; } @@ -4183,713 +4183,713 @@ function Ph(t, e, n) { s.tween = i; }; } -function Dh(t, e) { +function Oh(e, t) { var n = this._id; - if (t += "", arguments.length < 2) { - for (var r = Ce(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === t) + if (e += "", arguments.length < 2) { + for (var r = Tt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === e) return a.value; return null; } - return this.each((e == null ? Mh : Ph)(n, t, e)); + return this.each((t == null ? Ph : Dh)(n, e, t)); } -function js(t, e, n) { - var r = t._id; - return t.each(function() { - var i = Xe(this, r); - (i.value || (i.value = {}))[e] = n.apply(this, arguments); +function Ks(e, t, n) { + var r = e._id; + return e.each(function() { + var i = Bt(this, r); + (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return Ce(i, r).value[e]; + return Tt(i, r).value[t]; }; } -function gl(t, e) { +function vl(e, t) { var n; - return (typeof e == "number" ? Le : e instanceof Gn ? Ri : (n = Gn(e)) ? (e = n, Ri) : ul)(t, e); + return (typeof t == "number" ? It : t instanceof Un ? Ri : (n = Un(t)) ? (t = n, Ri) : ll)(e, t); } -function Oh(t) { +function Fh(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function Ih(t) { +function Ih(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function Fh(t, e, n) { +function Lh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttribute(e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Lh(t, e, n) { +function qh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(t.space, t.local); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttributeNS(e.space, e.local); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function qh(t, e, n) { +function Vh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Vh(t, e, n) { +function zh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function zh(t, e) { - var n = Wi(t), r = n === "transform" ? bh : gl; - return this.attrTween(t, typeof e == "function" ? (n.local ? Vh : qh)(n, r, js(this, "attr." + t, e)) : e == null ? (n.local ? Ih : Oh)(n) : (n.local ? Lh : Fh)(n, r, e)); +function Hh(e, t) { + var n = Wi(e), r = n === "transform" ? $h : vl; + return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, Ks(this, "attr." + e, t)) : t == null ? (n.local ? Ih : Fh)(n) : (n.local ? qh : Lh)(n, r, t)); } -function Hh(t, e) { +function Yh(e, t) { return function(n) { - this.setAttribute(t, e.call(this, n)); + this.setAttribute(e, t.call(this, n)); }; } -function Yh(t, e) { +function Bh(e, t) { return function(n) { - this.setAttributeNS(t.space, t.local, e.call(this, n)); + this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Bh(t, e) { +function Xh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Yh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Bh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Xh(t, e) { +function Wh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Hh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Yh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Wh(t, e) { - var n = "attr." + t; +function Uh(e, t) { + var n = "attr." + e; 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 = Wi(t); - return this.tween(n, (r.local ? Bh : Xh)(r, e)); + if (t == null) return this.tween(n, null); + if (typeof t != "function") throw new Error(); + var r = Wi(e); + return this.tween(n, (r.local ? Xh : Wh)(r, t)); } -function Uh(t, e) { +function Gh(e, t) { return function() { - Ks(this, t).delay = +e.apply(this, arguments); + Gs(this, e).delay = +t.apply(this, arguments); }; } -function Gh(t, e) { - return e = +e, function() { - Ks(this, t).delay = e; +function Kh(e, t) { + return t = +t, function() { + Gs(this, e).delay = t; }; } -function Kh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Uh : Gh)(e, t)) : Ce(this.node(), e).delay; +function jh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Tt(this.node(), t).delay; } -function jh(t, e) { +function Jh(e, t) { return function() { - Xe(this, t).duration = +e.apply(this, arguments); + Bt(this, e).duration = +t.apply(this, arguments); }; } -function Jh(t, e) { - return e = +e, function() { - Xe(this, t).duration = e; +function Zh(e, t) { + return t = +t, function() { + Bt(this, e).duration = t; }; } -function Zh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? jh : Jh)(e, t)) : Ce(this.node(), e).duration; +function Qh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Tt(this.node(), t).duration; } -function Qh(t, e) { - if (typeof e != "function") throw new Error(); +function ed(e, t) { + if (typeof t != "function") throw new Error(); return function() { - Xe(this, t).ease = e; + Bt(this, e).ease = t; }; } -function td(t) { - var e = this._id; - return arguments.length ? this.each(Qh(e, t)) : Ce(this.node(), e).ease; +function td(e) { + var t = this._id; + return arguments.length ? this.each(ed(t, e)) : Tt(this.node(), t).ease; } -function ed(t, e) { +function nd(e, t) { return function() { - var n = e.apply(this, arguments); + var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Xe(this, t).ease = n; + Bt(this, e).ease = n; }; } -function nd(t) { - if (typeof t != "function") throw new Error(); - return this.each(ed(this._id, t)); -} -function rd(t) { - typeof t != "function" && (t = jo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new cn(r, this._parents, this._name, this._id); -} -function id(t) { - if (t._id !== this._id) throw new Error(); - for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, d = a[o] = new Array(f), c, p = 0; p < f; ++p) - (c = l[p] || u[p]) && (d[p] = c); +function rd(e) { + if (typeof e != "function") throw new Error(); + return this.each(nd(this._id, e)); +} +function id(e) { + typeof e != "function" && (e = Ko(e)); + for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); + return new fn(r, this._parents, this._name, this._id); +} +function sd(e) { + if (e._id !== this._id) throw new Error(); + for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), c, d = 0; d < f; ++d) + (c = l[d] || u[d]) && (p[d] = c); for (; o < r; ++o) - a[o] = e[o]; - return new cn(a, this._parents, this._name, this._id); + a[o] = t[o]; + return new fn(a, this._parents, this._name, this._id); } -function sd(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 ad(e) { + return (e + "").trim().split(/^|\s+/).every(function(t) { + var n = t.indexOf("."); + return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; }); } -function ad(t, e, n) { - var r, i, s = sd(e) ? Ks : Xe; +function od(e, t, n) { + var r, i, s = ad(t) ? Gs : Bt; return function() { - var a = s(this, t), o = a.on; - o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + var a = s(this, e), o = a.on; + o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } -function od(t, e) { +function ld(e, t) { var n = this._id; - return arguments.length < 2 ? Ce(this.node(), n).on.on(t) : this.each(ad(n, t, e)); + return arguments.length < 2 ? Tt(this.node(), n).on.on(e) : this.each(od(n, e, t)); } -function ld(t) { +function ud(e) { return function() { - var e = this.parentNode; - for (var n in this.__transition) if (+n !== t) return; - e && e.removeChild(this); + var t = this.parentNode; + for (var n in this.__transition) if (+n !== e) return; + t && t.removeChild(this); }; } -function ud() { - return this.on("end.remove", ld(this._id)); +function fd() { + return this.on("end.remove", ud(this._id)); } -function fd(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Bs(t)); +function cd(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Ys(e)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, d, c = 0; c < l; ++c) - (f = o[c]) && (d = t.call(f, f.__data__, c, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[c] = d, Gi(u[c], e, n, c, u, Ce(f, n))); - return new cn(s, this._parents, e, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, c = 0; c < l; ++c) + (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Tt(f, n))); + return new fn(s, this._parents, t, n); } -function cd(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Ko(t)); +function hd(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Go(e)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) - if (f = l[d]) { - for (var c = t.call(f, f.__data__, d, l), p, y = Ce(f, n), b = 0, m = c.length; b < m; ++b) - (p = c[b]) && Gi(p, e, n, b, c, y); + for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) + if (f = l[p]) { + for (var c = e.call(f, f.__data__, p, l), d, y = Tt(f, n), x = 0, m = c.length; x < m; ++x) + (d = c[x]) && Gi(d, t, n, x, c, y); s.push(c), a.push(f); } - return new cn(s, a, e, n); + return new fn(s, a, t, n); } -var hd = wr.prototype.constructor; -function dd() { - return new hd(this._groups, this._parents); +var dd = br.prototype.constructor; +function pd() { + return new dd(this._groups, this._parents); } -function pd(t, e) { +function vd(e, t) { var n, r, i; return function() { - var s = gr(this, t), a = (this.style.removeProperty(t), gr(this, t)); - return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + var s = mr(this, e), a = (this.style.removeProperty(e), mr(this, e)); + return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function _l(t) { +function gl(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function vd(t, e, n) { +function gd(e, t, n) { var r, i = n + "", s; return function() { - var a = gr(this, t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = mr(this, e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function gd(t, e, n) { +function _d(e, t, n) { var r, i, s; return function() { - var a = gr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), gr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = mr(this, e), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(e), mr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); }; } -function _d(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; +function md(e, t) { + var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Xe(this, t), u = l.on, f = l.value[s] == null ? o || (o = _l(e)) : void 0; + var l = Bt(this, e), u = l.on, f = l.value[s] == null ? o || (o = gl(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function md(t, e, n) { - var r = (t += "") == "transform" ? xh : gl; - return e == null ? this.styleTween(t, pd(t, r)).on("end.style." + t, _l(t)) : typeof e == "function" ? this.styleTween(t, gd(t, r, js(this, "style." + t, e))).each(_d(this._id, t)) : this.styleTween(t, vd(t, r, e), n).on("end.style." + t, null); +function yd(e, t, n) { + var r = (e += "") == "transform" ? bh : vl; + return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, gl(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, Ks(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); } -function yd(t, e, n) { +function wd(e, t, n) { return function(r) { - this.style.setProperty(t, e.call(this, r), n); + this.style.setProperty(e, t.call(this, r), n); }; } -function wd(t, e, n) { +function xd(e, t, n) { var r, i; function s() { - var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && yd(t, a, n)), r; + var a = t.apply(this, arguments); + return a !== i && (r = (i = a) && wd(e, a, n)), r; } - return s._value = e, s; + return s._value = t, s; } -function xd(t, e, n) { - var r = "style." + (t += ""); +function bd(e, t, n) { + var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (e == null) return this.tween(r, null); - if (typeof e != "function") throw new Error(); - return this.tween(r, wd(t, e, n ?? "")); + if (t == null) return this.tween(r, null); + if (typeof t != "function") throw new Error(); + return this.tween(r, xd(e, t, n ?? "")); } -function bd(t) { +function $d(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function $d(t) { +function Ad(e) { return function() { - var e = t(this); - this.textContent = e ?? ""; + var t = e(this); + this.textContent = t ?? ""; }; } -function Ad(t) { - return this.tween("text", typeof t == "function" ? $d(js(this, "text", t)) : bd(t == null ? "" : t + "")); +function Ed(e) { + return this.tween("text", typeof e == "function" ? Ad(Ks(this, "text", e)) : $d(e == null ? "" : e + "")); } -function Ed(t) { - return function(e) { - this.textContent = t.call(this, e); +function Td(e) { + return function(t) { + this.textContent = e.call(this, t); }; } -function Td(t) { - var e, n; +function Cd(e) { + var t, n; function r() { - var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Ed(i)), e; + var i = e.apply(this, arguments); + return i !== n && (t = (n = i) && Td(i)), t; } - return r._value = t, r; + return r._value = e, r; } -function Cd(t) { - var e = "text"; - if (arguments.length < 1) return (e = this.tween(e)) && e._value; - if (t == null) return this.tween(e, null); - if (typeof t != "function") throw new Error(); - return this.tween(e, Td(t)); +function Rd(e) { + var t = "text"; + if (arguments.length < 1) return (t = this.tween(t)) && t._value; + if (e == null) return this.tween(t, null); + if (typeof e != "function") throw new Error(); + return this.tween(t, Cd(e)); } -function Rd() { - for (var t = this._name, e = this._id, n = ml(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Sd() { + for (var e = this._name, t = this._id, n = _l(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { - var f = Ce(l, e); - Gi(l, t, n, u, a, { + var f = Tt(l, t); + Gi(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new cn(r, this._parents, t, n); + return new fn(r, this._parents, e, n); } -function Sd() { - var t, e, n = this, r = n._id, i = n.size(); +function Nd() { + var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Xe(this, r), f = u.on; - f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; + var u = Bt(this, r), f = u.on; + f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; }), i === 0 && s(); }); } -var Nd = 0; -function cn(t, e, n, r) { - this._groups = t, this._parents = e, this._name = n, this._id = r; -} -function wi(t) { - return wr().transition(t); -} -function ml() { - return ++Nd; -} -var Je = wr.prototype; -cn.prototype = wi.prototype = { - constructor: cn, - select: fd, - selectAll: cd, - selectChild: Je.selectChild, - selectChildren: Je.selectChildren, - filter: rd, - merge: id, - selection: dd, - transition: Rd, - call: Je.call, - nodes: Je.nodes, - node: Je.node, - size: Je.size, - empty: Je.empty, - each: Je.each, - on: od, - attr: zh, - attrTween: Wh, - style: md, - styleTween: xd, - text: Ad, - textTween: Cd, - remove: ud, - tween: Dh, - delay: Kh, - duration: Zh, +var kd = 0; +function fn(e, t, n, r) { + this._groups = e, this._parents = t, this._name = n, this._id = r; +} +function wi(e) { + return br().transition(e); +} +function _l() { + return ++kd; +} +var jt = br.prototype; +fn.prototype = wi.prototype = { + constructor: fn, + select: cd, + selectAll: hd, + selectChild: jt.selectChild, + selectChildren: jt.selectChildren, + filter: id, + merge: sd, + selection: pd, + transition: Sd, + call: jt.call, + nodes: jt.nodes, + node: jt.node, + size: jt.size, + empty: jt.empty, + each: jt.each, + on: ld, + attr: Hh, + attrTween: Uh, + style: yd, + styleTween: bd, + text: Ed, + textTween: Rd, + remove: fd, + tween: Oh, + delay: jh, + duration: Qh, ease: td, - easeVarying: nd, - end: Sd, - [Symbol.iterator]: Je[Symbol.iterator] + easeVarying: rd, + end: Nd, + [Symbol.iterator]: jt[Symbol.iterator] }; -function kd(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +function Md(e) { + return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Md = { +var Pd = { time: null, // Set on use. delay: 0, duration: 250, - ease: kd + ease: Md }; -function Pd(t, e) { - for (var n; !(n = t.__transition) || !(n = n[e]); ) - if (!(t = t.parentNode)) - throw new Error(`transition ${e} not found`); +function Dd(e, t) { + for (var n; !(n = e.__transition) || !(n = n[t]); ) + if (!(e = e.parentNode)) + throw new Error(`transition ${t} not found`); return n; } -function Dd(t) { - var e, n; - t instanceof cn ? (e = t._id, t = t._name) : (e = ml(), (n = Md).time = Gs(), t = t == null ? null : t + ""); +function Od(e) { + var t, n; + e instanceof fn ? (t = e._id, e = e._name) : (t = _l(), (n = Pd).time = Us(), e = e == null ? null : e + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Gi(l, t, e, u, a, n || Pd(l, e)); - return new cn(r, this._parents, t, e); -} -wr.prototype.interrupt = kh; -wr.prototype.transition = Dd; -const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Od = Ss - Nn; -function yl(t) { - this._ += t[0]; - for (let e = 1, n = t.length; e < n; ++e) - this._ += arguments[e] + t[e]; -} -function Id(t) { - let e = Math.floor(t); - if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return yl; - const n = 10 ** e; + (l = a[u]) && Gi(l, e, t, u, a, n || Dd(l, t)); + return new fn(r, this._parents, e, t); +} +br.prototype.interrupt = Mh; +br.prototype.transition = Od; +const Cs = Math.PI, Rs = 2 * Cs, Sn = 1e-6, Fd = Rs - Sn; +function ml(e) { + this._ += e[0]; + for (let t = 1, n = e.length; t < n; ++t) + this._ += arguments[t] + e[t]; +} +function Id(e) { + let t = Math.floor(e); + if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); + if (t > 15) return ml; + const n = 10 ** t; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Fd { - constructor(e) { +class Ld { + constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? yl : Id(e); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? ml : Id(t); } - moveTo(e, n) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; + moveTo(t, n) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(e, n) { - this._append`L${this._x1 = +e},${this._y1 = +n}`; + lineTo(t, n) { + this._append`L${this._x1 = +t},${this._y1 = +n}`; } - quadraticCurveTo(e, n, r, i) { - this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(t, n, r, i) { + this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(e, n, r, i, s, a) { - this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(t, n, r, i, s, a) { + this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(e, n, r, i, s) { - if (e = +e, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, d = o - n, c = f * f + d * d; + arcTo(t, n, r, i, s) { + if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, c = f * f + p * p; if (this._x1 === null) - this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > Nn) if (!(Math.abs(d * l - u * f) > Nn) || !s) - this._append`L${this._x1 = e},${this._y1 = n}`; + this._append`M${this._x1 = t},${this._y1 = n}`; + else if (c > Sn) if (!(Math.abs(p * l - u * f) > Sn) || !s) + this._append`L${this._x1 = t},${this._y1 = n}`; else { - let p = r - a, y = i - o, b = l * l + u * u, m = p * p + y * y, $ = Math.sqrt(b), D = Math.sqrt(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, F = M / $; - Math.abs(S - 1) > Nn && this._append`L${e + S * f},${n + S * d}`, this._append`A${s},${s},0,0,${+(d * p > f * y)},${this._x1 = e + F * l},${this._y1 = n + F * u}`; + let d = r - a, y = i - o, x = l * l + u * u, m = d * d + y * y, b = Math.sqrt(x), D = Math.sqrt(c), M = s * Math.tan((Cs - Math.acos((x + c - m) / (2 * b * D))) / 2), S = M / D, I = M / b; + Math.abs(S - 1) > Sn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; } } - arc(e, n, r, i, s, a) { - if (e = +e, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, d = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Ss + Ss), c > Od ? this._append`A${r},${r},0,1,${d},${e - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : c > Nn && this._append`A${r},${r},0,${+(c >= Rs)},${d},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + arc(t, n, r, i, s, a) { + if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Sn || Math.abs(this._y1 - f) > Sn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > Fd ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : c > Sn && this._append`A${r},${r},0,${+(c >= Cs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(e, n, r, i) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + rect(t, n, r, i) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; } toString() { return this._; } } -function Ld(t) { - for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); +function qd(e) { + for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); return n; } -const qd = Ld("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Ft(t) { +const Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Le(e) { return function() { - return t; + return e; }; } -const qa = Math.abs, Dt = Math.atan2, Sn = Math.cos, Vd = Math.max, ss = Math.min, Pe = Math.sin, tr = Math.sqrt, Yt = 1e-12, Vr = Math.PI, Mi = Vr / 2, xi = 2 * Vr; -function zd(t) { - return t > 1 ? 0 : t < -1 ? Vr : Math.acos(t); +const La = Math.abs, De = Math.atan2, Rn = Math.cos, zd = Math.max, is = Math.min, Mt = Math.sin, nr = Math.sqrt, Xe = 1e-12, Hr = Math.PI, Mi = Hr / 2, xi = 2 * Hr; +function Hd(e) { + return e > 1 ? 0 : e < -1 ? Hr : Math.acos(e); } -function Va(t) { - return t >= 1 ? Mi : t <= -1 ? -Mi : Math.asin(t); +function qa(e) { + return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); } -function Hd(t) { - let e = 3; - return t.digits = function(n) { - if (!arguments.length) return e; +function Yd(e) { + let t = 3; + return e.digits = function(n) { + if (!arguments.length) return t; if (n == null) - e = null; + t = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - e = r; + t = r; } - return t; - }, () => new Fd(e); + return e; + }, () => new Ld(t); } -function Yd(t) { - return t.innerRadius; +function Bd(e) { + return e.innerRadius; } -function Bd(t) { - return t.outerRadius; +function Xd(e) { + return e.outerRadius; } -function Xd(t) { - return t.startAngle; +function Wd(e) { + return e.startAngle; } -function Wd(t) { - return t.endAngle; +function Ud(e) { + return e.endAngle; } -function Ud(t) { - return t && t.padAngle; +function Gd(e) { + return e && e.padAngle; } -function Gd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, d = o - s, c = d * l - f * u; - if (!(c * c < Yt)) - return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; +function Kd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; + if (!(c * c < Xe)) + return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; } -function ui(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, y = n + f, b = r + d, m = (c + y) / 2, $ = (p + b) / 2, D = y - c, M = b - p, S = D * D + M * M, F = i - s, L = c * b - y * p, W = (M < 0 ? -1 : 1) * tr(Vd(0, F * F * S - L * L)), ot = (L * M - D * W) / S, Z = (-L * D - M * W) / S, U = (L * M + D * W) / S, lt = (-L * D + M * W) / S, ut = ot - m, O = Z - $, I = U - m, Nt = lt - $; - return ut * ut + O * O > I * I + Nt * Nt && (ot = U, Z = lt), { - cx: ot, - cy: Z, +function ui(e, t, n, r, i, s, a) { + var o = e - n, l = t - r, u = (a ? s : -s) / nr(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, x = r + p, m = (c + y) / 2, b = (d + x) / 2, D = y - c, M = x - d, S = D * D + M * M, I = i - s, q = c * x - y * d, X = (M < 0 ? -1 : 1) * nr(zd(0, I * I * S - q * q)), se = (q * M - D * X) / S, Q = (-q * D - M * X) / S, W = (q * M + D * X) / S, ae = (-q * D + M * X) / S, ue = se - m, O = Q - b, F = W - m, Ne = ae - b; + return ue * ue + O * O > F * F + Ne * Ne && (se = W, Q = ae), { + cx: se, + cy: Q, x01: -f, - y01: -d, - x11: ot * (i / F - 1), - y11: Z * (i / F - 1) + y01: -p, + x11: se * (i / I - 1), + y11: Q * (i / I - 1) }; } -function ye() { - var t = Yd, e = Bd, n = Ft(0), r = null, i = Xd, s = Wd, a = Ud, o = null, l = Hd(u); +function mt() { + var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); function u() { - var f, d, c = +t.apply(this, arguments), p = +e.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; - if (o || (o = f = l()), p < c && (d = p, p = c, c = d), !(p > Yt)) o.moveTo(0, 0); - else if (m > xi - Yt) - o.moveTo(p * Sn(y), p * Pe(y)), o.arc(0, 0, p, y, b, !$), c > Yt && (o.moveTo(c * Sn(b), c * Pe(b)), o.arc(0, 0, c, b, y, $)); + var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, x = s.apply(this, arguments) - Mi, m = La(x - y), b = x > y; + if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); + else if (m > xi - Xe) + o.moveTo(d * Rn(y), d * Mt(y)), o.arc(0, 0, d, y, x, !b), c > Xe && (o.moveTo(c * Rn(x), c * Mt(x)), o.arc(0, 0, c, x, y, b)); else { - var D = y, M = b, S = y, F = b, L = m, W = m, ot = a.apply(this, arguments) / 2, Z = ot > Yt && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), U = ss(qa(p - c) / 2, +n.apply(this, arguments)), lt = U, ut = U, O, I; - if (Z > Yt) { - var Nt = Va(Z / c * Pe(ot)), se = Va(Z / p * Pe(ot)); - (L -= Nt * 2) > Yt ? (Nt *= $ ? 1 : -1, S += Nt, F -= Nt) : (L = 0, S = F = (y + b) / 2), (W -= se * 2) > Yt ? (se *= $ ? 1 : -1, D += se, M -= se) : (W = 0, D = M = (y + b) / 2); + var D = y, M = x, S = y, I = x, q = m, X = m, se = a.apply(this, arguments) / 2, Q = se > Xe && (r ? +r.apply(this, arguments) : nr(c * c + d * d)), W = is(La(d - c) / 2, +n.apply(this, arguments)), ae = W, ue = W, O, F; + if (Q > Xe) { + var Ne = qa(Q / c * Mt(se)), lt = qa(Q / d * Mt(se)); + (q -= Ne * 2) > Xe ? (Ne *= b ? 1 : -1, S += Ne, I -= Ne) : (q = 0, S = I = (y + x) / 2), (X -= lt * 2) > Xe ? (lt *= b ? 1 : -1, D += lt, M -= lt) : (X = 0, D = M = (y + x) / 2); } - var mt = p * Sn(D), yt = p * Pe(D), Q = c * Sn(F), kt = c * Pe(F); - if (U > Yt) { - var et = p * Sn(M), Ot = p * Pe(M), Re = c * Sn(S), it = c * Pe(S), jt; - if (m < Vr) - if (jt = Gd(mt, yt, Re, it, et, Ot, Q, kt)) { - var ve = mt - jt[0], ae = yt - jt[1], Tn = et - jt[0], _t = Ot - jt[1], Se = 1 / Pe(zd((ve * Tn + ae * _t) / (tr(ve * ve + ae * ae) * tr(Tn * Tn + _t * _t))) / 2), We = tr(jt[0] * jt[0] + jt[1] * jt[1]); - lt = ss(U, (c - We) / (Se - 1)), ut = ss(U, (p - We) / (Se + 1)); + var ce = d * Rn(D), Ae = d * Mt(D), ee = c * Rn(I), Oe = c * Mt(I); + if (W > Xe) { + var U = d * Rn(M), ke = d * Mt(M), Ct = c * Rn(S), oe = c * Mt(S), ze; + if (m < Hr) + if (ze = Kd(ce, Ae, Ct, oe, U, ke, ee, Oe)) { + var Rt = ce - ze[0], St = Ae - ze[1], Xt = U - ze[0], ge = ke - ze[1], Wt = 1 / Mt(Hd((Rt * Xt + St * ge) / (nr(Rt * Rt + St * St) * nr(Xt * Xt + ge * ge))) / 2), hn = nr(ze[0] * ze[0] + ze[1] * ze[1]); + ae = is(W, (c - hn) / (Wt - 1)), ue = is(W, (d - hn) / (Wt + 1)); } else - lt = ut = 0; + ae = ue = 0; } - W > Yt ? ut > Yt ? (O = ui(Re, it, mt, yt, p, ut, $), I = ui(et, Ot, Q, kt, p, ut, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ut < U ? o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, ut, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, p, Dt(O.cy + O.y11, O.cx + O.x11), Dt(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, ut, Dt(I.y11, I.x11), Dt(I.y01, I.x01), !$))) : (o.moveTo(mt, yt), o.arc(0, 0, p, D, M, !$)) : o.moveTo(mt, yt), !(c > Yt) || !(L > Yt) ? o.lineTo(Q, kt) : lt > Yt ? (O = ui(Q, kt, et, Ot, c, -lt, $), I = ui(mt, yt, Re, it, c, -lt, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), lt < U ? o.arc(O.cx, O.cy, lt, Dt(O.y01, O.x01), Dt(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, lt, Dt(O.y01, O.x01), Dt(O.y11, O.x11), !$), o.arc(0, 0, c, Dt(O.cy + O.y11, O.cx + O.x11), Dt(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, lt, Dt(I.y11, I.x11), Dt(I.y01, I.x01), !$))) : o.arc(0, 0, c, F, S, $); + X > Xe ? ue > Xe ? (O = ui(Ct, oe, ce, Ae, d, ue, b), F = ui(U, ke, ee, Oe, d, ue, b), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < W ? o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(F.y01, F.x01), !b) : (o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(O.y11, O.x11), !b), o.arc(0, 0, d, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), !b), o.arc(F.cx, F.cy, ue, De(F.y11, F.x11), De(F.y01, F.x01), !b))) : (o.moveTo(ce, Ae), o.arc(0, 0, d, D, M, !b)) : o.moveTo(ce, Ae), !(c > Xe) || !(q > Xe) ? o.lineTo(ee, Oe) : ae > Xe ? (O = ui(ee, Oe, U, ke, c, -ae, b), F = ui(ce, Ae, Ct, oe, c, -ae, b), o.lineTo(O.cx + O.x01, O.cy + O.y01), ae < W ? o.arc(O.cx, O.cy, ae, De(O.y01, O.x01), De(F.y01, F.x01), !b) : (o.arc(O.cx, O.cy, ae, De(O.y01, O.x01), De(O.y11, O.x11), !b), o.arc(0, 0, c, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), b), o.arc(F.cx, F.cy, ae, De(F.y11, F.x11), De(F.y01, F.x01), !b))) : o.arc(0, 0, c, I, S, b); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Vr / 2; - return [Sn(d) * f, Pe(d) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; + return [Rn(p) * f, Mt(p) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Ft(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Ft(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Ft(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ft(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Ft(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Ft(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Ft(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Kd(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function jd(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function jd(t, e) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Jd(e, t) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Jd(t) { - return t; +function Zd(e) { + return e; } -function as() { - var t = Jd, e = jd, n = null, r = Ft(0), i = Ft(xi), s = Ft(0); +function ss() { + var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); function a(o) { - var l, u = (o = Kd(o)).length, f, d, c = 0, p = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), x = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - x)), b, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (S = y[p[l] = l] = +t(o[l], l, o)) > 0 && (c += S); - for (e != null ? p.sort(function(F, L) { - return e(y[F], y[L]); - }) : n != null && p.sort(function(F, L) { - return n(o[F], o[L]); - }), l = 0, d = c ? (m - u * M) / c : 0; l < u; ++l, b = $) - f = p[l], S = y[f], $ = b + (S > 0 ? S * d : 0) + M, y[f] = { + (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); + for (t != null ? d.sort(function(I, q) { + return t(y[I], y[q]); + }) : n != null && d.sort(function(I, q) { + return n(o[I], o[q]); + }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, x = b) + f = d[l], S = y[f], b = x + (S > 0 ? S * p : 0) + M, y[f] = { data: o[f], index: l, value: S, - startAngle: b, - endAngle: $, + startAngle: x, + endAngle: b, padAngle: D }; return y; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Ft(+o), a) : t; + return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; }, a.sortValues = function(o) { - return arguments.length ? (e = o, n = null, a) : e; + return arguments.length ? (t = o, n = null, a) : t; }, a.sort = function(o) { - return arguments.length ? (n = o, e = null, a) : n; + return arguments.length ? (n = o, t = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Ft(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Le(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Ft(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Ft(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; }, a; } -function kr(t, e, n) { - this.k = t, this.x = e, this.y = n; +function Pr(e, t, n) { + this.k = e, this.x = t, this.y = n; } -kr.prototype = { - constructor: kr, - scale: function(t) { - return t === 1 ? this : new kr(this.k * t, this.x, this.y); +Pr.prototype = { + constructor: Pr, + scale: function(e) { + return e === 1 ? this : new Pr(this.k * e, this.x, this.y); }, - translate: function(t, e) { - return t === 0 & e === 0 ? this : new kr(this.k, this.x + this.k * t, this.y + this.k * e); + translate: function(e, t) { + return e === 0 & t === 0 ? this : new Pr(this.k, this.x + this.k * e, this.y + this.k * t); }, - apply: function(t) { - return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + apply: function(e) { + return [e[0] * this.k + this.x, e[1] * this.k + this.y]; }, - applyX: function(t) { - return t * this.k + this.x; + applyX: function(e) { + return e * this.k + this.x; }, - applyY: function(t) { - return t * this.k + this.y; + applyY: function(e) { + return e * this.k + this.y; }, - invert: function(t) { - return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + invert: function(e) { + return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; }, - invertX: function(t) { - return (t - this.x) / this.k; + invertX: function(e) { + return (e - this.x) / this.k; }, - invertY: function(t) { - return (t - this.y) / this.k; + invertY: function(e) { + return (e - this.y) / this.k; }, - rescaleX: function(t) { - return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + rescaleX: function(e) { + return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); }, - rescaleY: function(t) { - return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + rescaleY: function(e) { + return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -kr.prototype; -var Zd = /* @__PURE__ */ Gu(''); -const Qd = { +Pr.prototype; +var Qd = /* @__PURE__ */ Ku(''); +const ep = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function wl(t, e) { - Vi(e, !0), Hs(t, Qd); - let n = at(e, "jsonData", 7), r = at(e, "currentRound", 7, 1), i = at(e, "mouseEventType", 15), s = at(e, "mouseData", 15), a = at(e, "mouseX", 15), o = at(e, "mouseY", 15), l = at(e, "requestRoundChange", 7, (h) => { - }), u = at(e, "candidateColors", 23, () => []), f = at(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), d = at(e, "firstRoundDeterminesPercentages", 7, !1), c = at(e, "randomizeOrder", 7, !1), p = at(e, "displayPhase", 15, 0); +function yl(e, t) { + Vi(t, !0), zs(e, ep); + let n = ie(t, "jsonData", 7), r = ie(t, "currentRound", 7, 1), i = ie(t, "mouseEventType", 15), s = ie(t, "mouseData", 15), a = ie(t, "mouseX", 15), o = ie(t, "mouseY", 15), l = ie(t, "requestRoundChange", 7, (h) => { + }), u = ie(t, "candidateColors", 23, () => []), f = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ie(t, "firstRoundDeterminesPercentages", 7, !1), c = ie(t, "randomizeOrder", 7, !1), d = ie(t, "displayPhase", 15, 0); function y(h) { return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", F = "PieOutline", L = "Donut", W = "TextLayer", ot = "url(#cross-hatch)", Z = 1.15, U = 750, lt = 800, ut = "white", O = 1, I = "#ff00ff", Nt = 3; - function se(h) { + const x = 800, m = 800, b = Math.min(x, m) * 0.3, D = x / 2, M = m / 2, S = "Pie", I = "PieOutline", q = "Donut", X = "TextLayer", se = "url(#cross-hatch)", Q = 1.15, W = 750, ae = 800, ue = "white", O = 1, F = "#ff00ff", Ne = 3; + function lt(h) { return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); } - let mt = [], yt = [], Q = [], kt = 0, et = 0; - const Ot = {}, Re = "No Further Rankings"; - let it = /* @__PURE__ */ bt(null); - function jt() { - const h = ft(x(it)); - h.select("#" + S).remove(), h.select("#" + F).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); + let ce = [], Ae = [], ee = [], Oe = 0, U = 0; + const ke = {}, Ct = "No Further Rankings"; + let oe = /* @__PURE__ */ be(null); + function ze() { + const h = fe($(oe)); + h.select("#" + S).remove(), h.select("#" + I).remove(), h.select("#" + q).remove(), h.select("#" + X).remove(); } - function ve(h) { - l() && (vt = h, l()(h)); + function Rt(h) { + l() && (_e = h, l()(h)); } - function ae(h) { - jt(), Q = Tn(h), mt = ta(h, S, Q, D, M, 0, _t()), ta(h, F, Q, D, M, 0, _t(), !1, !1, !0), Qr(); + function St(h) { + ze(), ee = Xt(h), ce = Qs(h, S, ee, D, M, 0, ge()), Qs(h, I, ee, D, M, 0, ge(), !1, !1, !0), Tr(); } tf(() => { - Cn(), setTimeout( + pn(), setTimeout( () => { - ae(r()); + St(r()); }, 0 ); }); - function Tn(h) { - const g = Vt(h); - return kt = Jn(h), g; + function Xt(h) { + const g = Ut(h); + return Oe = $r(h), g; } - function _t() { - return $; + function ge() { + return b; } - function Se() { - return _t() * 1.41; + function Wt() { + return ge() * 1.41; } - function We(h) { + function hn(h) { let g = 0; for (let _ = 1; _ < h; _++) { const A = n().results[_ - 1].tallyResults; @@ -4903,38 +4903,38 @@ function wl(t, e) { } return g; } - function Kr(h, g) { - if (h === "exhausted") return We(g); + function Jr(h, g) { + if (h === "exhausted") return hn(g); { const _ = n().results[g - 1].tally; return Number(_[h]); } } - function jr(h, g) { - return Kr(h, g).toLocaleString("en-US"); + function Zr(h, g) { + return Jr(h, g).toLocaleString("en-US"); } - function Jr(h, g) { - const _ = d() ? kt : Ki(g); - return (Kr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function En(h, g) { + const _ = p() ? Oe : Ki(g); + return (Jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Jn(h) { + function $r(h) { const g = n().results[h - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) _ += Number(E); return _; } - function Ne(h) { + function dn(h) { return h === "exhausted" || h === "Inactive Ballots"; } function Ki(h) { const g = n().results[h - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) - Ne(A) || (_ += Number(E)); + dn(A) || (_ += Number(E)); return _; } - function Zr(h, g) { + function jn(h, g) { if (!h || h < 1 || h > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; if (f() && h === n().results.length) @@ -4946,15 +4946,15 @@ function wl(t, e) { } return A; } - function dn(h) { - return Zr(h, "eliminated"); + function Jn(h) { + return jn(h, "eliminated"); } - function xr(h) { + function w(h) { let g = []; - for (let _ = 1; _ <= h; _++) g = g.concat(Zr(_, "elected")); + for (let _ = 1; _ <= h; _++) g = g.concat(jn(_, "elected")); return [...new Set(g)]; } - function w(h, g) { + function G(h, g) { const _ = n().results[g - 1].tallyResults; let A = 0; const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); @@ -4966,10 +4966,10 @@ function wl(t, e) { return 0; return A; } - function Y(h, g) { - h.some((_) => Ne(_.label)) || h.push({ label: "exhausted", value: We(g) }); + function re(h, g) { + h.some((_) => dn(_.label)) || h.push({ label: "exhausted", value: hn(g) }); } - function tt(h) { + function me(h) { let g = h | 0; return () => { g = g + 1831565813 | 0; @@ -4977,46 +4977,46 @@ function wl(t, e) { return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; }; } - function pt(h) { + function ye(h) { let g = 5381; for (let _ = 0; _ < h.length; _++) g = (g << 5) + g + h.charCodeAt(_) | 0; return g; } - function wt(h) { + function le(h) { var E; if (h.length <= 3) return h; - const g = pt(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = tt(g), A = [...h]; + const g = ye(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = me(g), A = [...h]; for (let T = A.length - 1; T > 0; T--) { const P = Math.floor(_() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function st() { - const h = Object.keys(n().results[0].tally), g = h.filter((E) => !Ne(E)), _ = h.filter((E) => Ne(E)); - return [...c() ? wt(g) : g, ..._]; + function Fe() { + const h = Object.keys(n().results[0].tally), g = h.filter((E) => !dn(E)), _ = h.filter((E) => dn(E)); + return [...c() ? le(g) : g, ..._]; } - function Vt(h) { + function Ut(h) { const g = n().results[h - 1].tally, _ = []; - for (const A of st()) + for (const A of Fe()) A in g && _.push({ label: A, value: Number(g[A]) }); - return Y(_, h), _; + return re(_, h), _; } - function Ue(h) { + function Nt(h) { const g = n().results[h - 1].tally, _ = []; - for (const A of st()) + for (const A of Fe()) _.push({ label: A, value: Number(g[A] ?? 0) }); - return Y(_, h), _; + return re(_, h), _; } - function ke(h, g) { + function Tn(h, g) { const _ = []; for (const A of h) { if (A.label === "exhausted" || A.isTransfer) { _.push(A); continue; } - const E = w(A.label, g); + const E = G(A.label, g); E > 0 ? (_.push({ label: A.label, value: E, @@ -5025,136 +5025,159 @@ function wl(t, e) { } return _; } - function Cn() { - const h = ft(x(it)).select("defs").select("#cross-hatch"); + function pn() { + const h = fe($(oe)).select("defs").select("#cross-hatch"); let g = 0; for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Ot[_] = qd[g] : Ot[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ot[_] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? ke[_] = Vd[g] : ke[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : ke[_] = u()[g % u().length], g++; { const E = h.clone(!0); - E.attr("id", se(_)).select("rect").attr("fill", Ot[_]), E.selectAll("circle").attr("fill", "#383838"); + E.attr("id", lt(_)).select("rect").attr("fill", ke[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Ot.exhausted = ot, Ot["Inactive Ballots"] = ot; + ke.exhausted = se, ke["Inactive Ballots"] = se; } - function pn() { - ft(x(it)).select("#" + L).remove(); + function He() { + fe($(oe)).select("#" + q).remove(); } - function Mt(h, g) { - const _ = wi("global").duration(lt); + function Ze(h, g) { + const _ = wi("global").duration(ae); g && _.on("end", g); - const A = ke(Q, h), T = as().sort(null).value((P) => P.value)(A); - ia(h, S, T, 0, _t()), ia(h, F, T, 0, _t(), !0), Q = A, mt = T, pn(), bl(h), Sl(), kl(0, _t()), Qr(); + const A = Tn(ee, h), T = ss().sort(null).value((P) => P.value)(A); + ra(h, S, T, 0, ge()), ra(h, I, T, 0, ge(), !0), ee = A, ce = T, He(), $l(h), Nl(), Ml(0, ge()), Tr(); } - function oe(h, g) { - const _ = wi("global").duration(lt); - g && _.on("end", g), $l(h); + function Me(h, g) { + const _ = wi("global").duration(ae); + g && _.on("end", g), Al(h); } - function zt(h, g) { - const _ = wi("global").duration(lt); - g && _.on("end", g), je(h), ji(_t(), Se()); + function Qe(h, g) { + const _ = wi("global").duration(ae); + g && _.on("end", g), xl(h), bl(ge(), Wt()); } - let At = !1, ge = []; - function _e() { - Qr(), At = !1, Ge(); + let we = !1, ut = []; + function Ye() { + Tr(), we = !1, ft(); } - function Ge() { - if (ge.length === 0) { - vt !== r() && (r() === vt + 1 && vt > 0 && r() <= n().results.length ? (vt = r(), me(r())) : r() >= 1 && r() <= n().results.length && (vt = r(), p(0), ae(r()))); + function ft() { + if (ut.length === 0) { + _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), kt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), St(r()))); return; } - const h = ge.shift(); + const h = ut.shift(); switch (h.type) { case "round": { const g = h.round; - g === vt + 1 && vt > 0 && g <= n().results.length ? (vt = g, me(g)) : (g !== vt && g >= 1 && g <= n().results.length && (vt = g, p(0), ae(g)), Ge()); + g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, kt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), St(g)), ft()); break; } case "step": - Me(); + Qr(); break; } } - function me(h) { + function kt(h) { if (h <= 1 || h > n().results.length) { - Ge(); + ft(); return; } - At = !0, et = h, p(0), Mt(et - 1, () => { - p(1), oe(et - 1, () => { - p(2), zt(et, () => { - p(0), ve(et), _e(); + we = !0, U = h, d(0), Ze(U - 1, () => { + d(1), Me(U - 1, () => { + d(2), Qe(U, () => { + d(0), Ye(); }); }); }); } - function Ke() { - At || (At = !0, et = r(), Rn()); + function Zn() { + we || (we = !0, U = r(), Qn()); } - function Rn() { - if (p( + function Qn() { + if (d( 0 // if in the middle of "one small step" animation, reset to 0. - ), ge.length > 0) { - _e(); + ), ut.length > 0) { + Ye(); return; } - const h = et < n().results.length - 1 ? Rn : () => { - p(0), _e(); + const h = U < n().results.length - 1 ? Qn : () => { + d(0), Ye(); }; - Mt(et, () => { - p(1), oe(et, () => { - p(2), et++, ve(et), zt(et, h); + Ze(U, () => { + d(1), Me(U, () => { + d(2), U++, Rt(U), Qe(U, h); }); }); } Fs(() => { - br(); + Ar(); }); - let vt = 0; - function br() { - if (vt != r()) { - if (At) { - ge.push({ type: "round", round: r() }); + let _e = 0; + function Ar() { + if (_e != r()) { + if (we) { + ut.push({ type: "round", round: r() }); return; } - if (vt == r() - 1 && vt > 0) { - const h = r(); - ve(vt), me(h); - } else - $r(r()), vt = r(); + _e == r() - 1 && _e > 0 ? Kt() : Gt(r()), _e = r(); } } - function $r(h) { - if (At) { - ge.push({ type: "round", round: h }); + function Gt(h) { + if (we) { + ut.push({ type: "round", round: h }); + return; + } + d(0), St(h); + } + function Kt() { + if (we) { + ut.push({ type: "round", round: r() }); + return; + } + if (r() <= 1) { + console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - p(0), ae(h); + if (U = r(), U > n().results.length) { + Tr(), we = !1; + return; + } + we = !0, d() === 0 ? Ze(U - 1, () => { + d(1), Me(U - 1, () => { + d(2), Qe(U, () => { + d(0), Ye(); + }); + }); + }) : d() === 1 ? Me(U - 1, () => { + d(2), Qe(U, () => { + d(0), Ye(); + }); + }) : d() === 2 && Qe(U, () => { + d(0), Ye(); + }); } - function Me() { + function Qr() { if (r() > n().results.length) { - Qr(), At = !1; + Tr(), we = !1; return; } - if (At) { - ge.push({ type: "step" }); + if (we) { + ut.push({ type: "step" }); return; } - At = !0, et = r(), p() === 0 ? Mt(et, () => { - p(1), _e(); - }) : p() === 1 ? oe(et, () => { - p(2), _e(); - }) : p() === 2 ? (et++, ve(et), zt(et, () => { - p(0), _e(); - })) : (At = !1, console.warn("displayPhase out of range at ", p())); - } - function je(h) { - Q = Ue(h), mt = na(h, S, Q, 0, _t(), !0), na(h, F, Q, 0, _t(), !1, !0); - } - function ji(h, g) { - const _ = ft(x(it)).select("#" + L), E = ft(x(it)).select("#" + S), T = {}; - for (const N of mt) { + we = !0, U = r(), d() === 0 ? Ze(U, () => { + d(1), Ye(); + }) : d() === 1 ? Me(U, () => { + d(2), Ye(); + }) : d() === 2 ? (U++, Rt(U), Qe(U, () => { + d(0), Ye(); + })) : (we = !1, console.warn("displayPhase out of range at ", d())); + } + function xl(h) { + ee = Nt(h), ce = ta(h, S, ee, 0, ge(), !0), ta(h, I, ee, 0, ge(), !1, !0); + } + function bl(h, g) { + const _ = fe($(oe)).select("#" + q), E = fe($(oe)).select("#" + S), T = {}; + for (const N of ce) { const k = N.data.label; if (N.data.isTransfer) continue; const C = E.select("#" + CSS.escape(y(N.data))); @@ -5167,37 +5190,37 @@ function wl(t, e) { } const P = _.selectAll(".slice"); let z = P.size(); - function q() { - z--, z === 0 && Nl(); + function L() { + z--, z === 0 && kl(); } - P.select("path").transition("global").duration(U).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, Pt = T[N.data.label]; - let J, Ht; - if (Pt) { - const Zn = (Pt.oldStart + Pt.oldEnd) / 2, Ol = (Pt.newStart + Pt.newEnd) / 2, Il = k - Zn; - J = Ol + Il, Ht = J + R; + P.select("path").transition("global").duration(W).attrTween("d", function(N) { + const k = N.startAngle, C = N.endAngle, R = C - k, Pe = T[N.data.label]; + let Z, Be; + if (Pe) { + const er = (Pe.oldStart + Pe.oldEnd) / 2, Fl = (Pe.newStart + Pe.newEnd) / 2, Il = k - er; + Z = Fl + Il, Be = Z + R; } else - J = k, Ht = C; - const nt = Ze(k, J), Et = Ze(C, Ht), ei = Ze(g, h), Er = ye(); - return function(Zn) { - return Er.innerRadius(Math.min(ei(Zn), h) - 1).outerRadius(ei(Zn)).startAngle(nt(Zn)).endAngle(Et(Zn)), Er(N); + Z = k, Be = C; + const te = Jt(k, Z), Ee = Jt(C, Be), ti = Jt(g, h), Cr = mt(); + return function(er) { + return Cr.innerRadius(Math.min(ti(er), h) - 1).outerRadius(ti(er)).startAngle(te(er)).endAngle(Ee(er)), Cr(N); }; - }).on("end", (N) => q()); - } - function bl(h) { - const g = El(h, mt); - yt = ea(h, L, g, D, M, _t(), Se(), !1, !0); - const _ = ft(x(it)); - _.select("#" + S).raise(), _.select("#" + F).raise(); + }).on("end", (N) => L()); } function $l(h) { - const g = Cl(h, yt, mt); - yt = sa(h, L, g, _t(), Se(), !1); - } - function Ar(h) { - return Ot[h.data.label]; + const g = Tl(h, ce); + Ae = ea(h, q, g, D, M, ge(), Wt(), !1, !0); + const _ = fe($(oe)); + _.select("#" + S).raise(), _.select("#" + I).raise(); } function Al(h) { + const g = Rl(h, Ae, ce); + Ae = ia(h, q, g, ge(), Wt(), !1); + } + function Er(h) { + return ke[h.data.label]; + } + function El(h) { const g = {}, _ = n().results[h - 1].tallyResults; for (let A = 0; A < _.length; A++) { let E = _[A].eliminated; @@ -5215,8 +5238,8 @@ function wl(t, e) { } return g; } - function El(h, g) { - const _ = [], A = kt, E = n().results[h - 1].tallyResults; + function Tl(h, g) { + const _ = [], A = Oe, E = n().results[h - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { @@ -5228,19 +5251,19 @@ function wl(t, e) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = g.find((k) => k.data.label == P && k.data.isTransfer); - q === void 0 && (q = g.find((k) => k.data.label == P && !k.data.isTransfer)); + let L = g.find((k) => k.data.label == P && k.data.isTransfer); + L === void 0 && (L = g.find((k) => k.data.label == P && !k.data.isTransfer)); let N = 0; - if (q) N = q.startAngle; + if (L) N = L.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } for (let [k, C] of Object.entries(z)) { let R; - const Pt = g.find((nt) => nt.data.label == k); - if (Pt) - R = structuredClone(Pt); + const Pe = g.find((te) => te.data.label == k); + if (Pe) + R = structuredClone(Pe); else if (k == "exhausted") R = { data: { label: k, value: Number(C) }, @@ -5256,13 +5279,13 @@ function wl(t, e) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Ht = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Ht, R.index = T, R.data.transferIndex = T, _.push(R); + const Be = Number(C) / A * 2 * Math.PI; + R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); } } return _; } - function Tl(h, g, _) { + function Cl(h, g, _) { const A = {}; for (let [E, T] of Object.entries(h)) { const P = _.find((N) => E == N.data.label); @@ -5270,251 +5293,251 @@ function wl(t, e) { E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const z = (P.startAngle + P.endAngle) / 2, q = h[P.data.label] / g * 2 * Math.PI; - A[P.data.label] = z - q / 2; + const z = (P.startAngle + P.endAngle) / 2, L = h[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = z - L / 2; } return A; } - function Cl(h, g, _) { - const A = [], E = kt, T = Al(h), P = Tl(T, E, _); - for (let [z, q] of g.entries()) { - const N = structuredClone(q), k = q.endAngle - q.startAngle, C = _.find((R) => q.data.label === R.data.label && !R.data.isTransfer); + function Rl(h, g, _) { + const A = [], E = Oe, T = El(h), P = Cl(T, E, _); + for (let [z, L] of g.entries()) { + const N = structuredClone(L), k = L.endAngle - L.startAngle, C = _.find((R) => L.data.label === R.data.label && !R.data.isTransfer); if (C) { const R = C.data.label; N.startAngle = P[R], P[R] += k, N.endAngle = N.startAngle + k; - } else if (q.data.label === "exhausted") - N.startAngle = q.startAngle, N.endAngle = q.endAngle; + } else if (L.data.label === "exhausted") + N.startAngle = L.startAngle, N.endAngle = L.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); continue; } N.index = z, A.push(N); } return A; } - function Zs(h, g, _, A) { - const E = ye().innerRadius(_ * Z).outerRadius(_ * Z), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + function Js(h, g, _, A) { + const E = mt().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); for (const k of T) { - const C = k.data.label === "exhausted" ? Re : k.data.label, R = E.centroid(k), Pt = ti(k.startAngle, k.endAngle), J = jr(k.data.label, h); - let Ht; - !d() && Ne(k.data.label) ? Ht = J : Ht = J + " (" + Jr(k.data.label, h) + ")"; - const nt = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pt).text(C); - nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Ht); - const Et = nt.node().getBBox(); + const C = k.data.label === "exhausted" ? Ct : k.data.label, R = E.centroid(k), Pe = ei(k.startAngle, k.endAngle), Z = Zr(k.data.label, h); + let Be; + !p() && dn(k.data.label) ? Be = Z : Be = Z + " (" + En(k.data.label, h) + ")"; + const te = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pe).text(C); + te.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); + const Ee = te.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Et.x + R[0], Et.y + R[1], Et.width, Et.height) + bbox: new DOMRect(Ee.x + R[0], Ee.y + R[1], Ee.width, Ee.height) }); } z.remove(), P.sort((k, C) => C.value - k.value); - const q = [], N = /* @__PURE__ */ new Set(); + const L = [], N = /* @__PURE__ */ new Set(); for (const k of P) - q.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), q.push(k.bbox)); + L.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), L.push(k.bbox)); return N; } - function Qs(h, g, _, A, E, T) { - const z = ft(x(it)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = ye().innerRadius(E * Z).outerRadius(E * Z), N = Zs(h, g, E, z); + function Zs(h, g, _, A, E, T) { + const z = fe($(oe)).append("g").attr("id", X).attr("transform", `translate(${_}, ${A})`), L = mt().innerRadius(E * Q).outerRadius(E * Q), N = Js(h, g, E, z); z.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && ft(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { - C.data.label === "exhausted" && ft(this).on("mouseenter", (Pt, J) => Ml(Pt)).on("mouseleave", (Pt, J) => Pl()); - }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ti(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Re : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = jr(C.data.label, h); - return !d() && Ne(C.data.label) ? R : R + " (" + Jr(C.data.label, h) + ")"; + !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { + C.data.label === "exhausted" && fe(this).on("mouseenter", (Pe, Z) => Pl(Pe)).on("mouseleave", (Pe, Z) => Dl()); + }).append("text").attr("transform", (C) => `translate(${L.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Ct : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { + const R = Zr(C.data.label, h); + return !p() && dn(C.data.label) ? R : R + " (" + En(C.data.label, h) + ")"; }); }); } - function Rl(h, g, _, A) { - const T = ft(x(it)).select("#" + W), P = Zs(h, g, _, T); + function Sl(h, g, _, A) { + const T = fe($(oe)).select("#" + X), P = Js(h, g, _, T); T.selectAll("g").each(function(R) { - R && R.data && !R.data.isTransfer && !P.has(R.data.label) && ft(this).remove(); + R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); }); - const z = T.selectAll("tspan"), q = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = ye().innerRadius(_ * Z).outerRadius(_ * Z + 1); - z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ti(R.startAngle, R.endAngle)).on("end", (R) => C()); - let k = q.size(); + const z = T.selectAll("tspan"), L = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = mt().innerRadius(_ * Q).outerRadius(_ * Q + 1); + z.transition("global").duration(W).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), L.select("text").transition("global").duration(W).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + let k = L.size(); function C(R) { - k--, k === 0 && (T.remove(), Qs(h, g, D, M, _, A)); + k--, k === 0 && (T.remove(), Zs(h, g, D, M, _, A)); } } - function ta(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { - const C = as().sort(null).value((R) => R.value)(_); - return ea(h, g, C, A, E, T, P, z, q, N), C; - } - function Qr() { - ft(x(it)).select("#" + F).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Nt}px`); - } - function ea(h, g, _, A, E, T, P, z, q, N = !1) { - const k = dn(h), C = xr(h), J = ft(x(it)).attr("viewBox", `0 0 ${b} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => C.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => y(nt.data)); - N ? J.style("pointer-events", "none") : J.on("mouseenter", (nt, Et) => Zi(nt, Et)).on("mouseleave", (nt, Et) => Qi(nt, Et)); - const Ht = ye().outerRadius(P).innerRadius(T); - if (q) { - const nt = ye().outerRadius(T + 1).innerRadius(T); - J.append("path").attr("d", nt).attr("stroke", N ? "none" : T === 0 ? ut : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Et) => Ar(Et)).transition("global").duration(U).attr("d", (Et) => Ht(Et)).on("end", (Et) => { - N || Ji(); + function Qs(h, g, _, A, E, T, P, z = !0, L = !1, N = !1) { + const C = ss().sort(null).value((R) => R.value)(_); + return ea(h, g, C, A, E, T, P, z, L, N), C; + } + function Tr() { + fe($(oe)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Ne}px`); + } + function ea(h, g, _, A, E, T, P, z, L, N = !1) { + const k = Jn(h), C = w(h), Z = fe($(oe)).attr("viewBox", `0 0 ${x} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (te) => k.includes(te.data.label) || te.data.isTransfer === !0).classed("elected", (te) => C.includes(te.data.label) && !te.data.isTransfer).attr("id", (te) => y(te.data)); + N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (te, Ee) => Ji(te, Ee)).on("mouseleave", (te, Ee) => Zi(te, Ee)); + const Be = mt().outerRadius(P).innerRadius(T); + if (L) { + const te = mt().outerRadius(T + 1).innerRadius(T); + Z.append("path").attr("d", te).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ee) => Er(Ee)).transition("global").duration(W).attr("d", (Ee) => Be(Ee)).on("end", (Ee) => { + N || ji(); }); } else - J.append("path").attr("d", (nt) => Ht(nt)).attr("fill", N ? "none" : (nt) => Ar(nt)).attr("stroke", N ? "none" : ut).attr("stroke-width", N ? 0 : O), N || Ji(); - return z && !N && Qs(h, _, A, E, P, k), _; + Z.append("path").attr("d", (te) => Be(te)).attr("fill", N ? "none" : (te) => Er(te)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || ji(); + return z && !N && Zs(h, _, A, E, P, k), _; } - function Sl() { - const _ = ft(x(it)).select("#" + W).selectAll(".eliminated"); + function Nl() { + const _ = fe($(oe)).select("#" + X).selectAll(".eliminated"); _.size() > 0 && _.classed("finished", !0); } - function Nl() { - const _ = ft(x(it)).select("#" + W).selectAll(".finished"); + function kl() { + const _ = fe($(oe)).select("#" + X).selectAll(".finished"); _.size() > 0 && _.remove(); } - function kl(h, g) { - const E = ft(x(it)).select("#" + S).selectAll(".eliminated"), T = ye().innerRadius(h), P = ye().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(U).attrTween("d", function(z) { - const q = Ze(g, h); + function Ml(h, g) { + const E = fe($(oe)).select("#" + S).selectAll(".eliminated"), T = mt().innerRadius(h), P = mt().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(W).attrTween("d", function(z) { + const L = Jt(g, h); return function(N) { - return P.innerRadius(q(N)), P(z); + return P.innerRadius(L(N)), P(z); }; - }).attr("fill", (z) => `url(#${se(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { - const q = Ze(g, h); + }).attr("fill", (z) => `url(#${lt(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(W).attrTween("d", function(z) { + const L = Jt(g, h); return function(N) { - return T.outerRadius(q(N)), T(z); + return T.outerRadius(L(N)), T(z); }; - }).attr("fill", (z) => Ar(z)); + }).attr("fill", (z) => Er(z)); } - function ti(h, g) { + function ei(h, g) { const _ = (h + g) / 2; return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; } - function Ji() { - ft(x( - it + function ji() { + fe($( + oe // force redisplay of text labels - )).select("#" + W).raise().append("g").remove(); + )).select("#" + X).raise().append("g").remove(); } - function na(h, g, _, A, E, T, P = !1) { - const q = as().sort(null).value((N) => N.value)(_); - return sa(h, g, q, A, E, T, P), q; + function ta(h, g, _, A, E, T, P = !1) { + const L = ss().sort(null).value((N) => N.value)(_); + return ia(h, g, L, A, E, T, P), L; } - function ra(h, g, _, A, E = !1) { - const T = dn(h), P = xr(h), N = ft(x(it)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); + function na(h, g, _, A, E = !1) { + const T = Jn(h), P = w(h), N = fe($(oe)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); N.exit().remove(); const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Ar(C)).attr("stroke", E ? "none" : ut).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Zi(C, R)).on("mouseleave", (C, R) => Qi(C, R)), N; + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Ji(C, R)).on("mouseleave", (C, R) => Zi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Er(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Ji(C, R)).on("mouseleave", (C, R) => Zi(C, R)), N; } - function ia(h, g, _, A, E, T = !1) { - const P = ye().outerRadius(E).innerRadius(A); - ra(h, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); + function ra(h, g, _, A, E, T = !1) { + const P = mt().outerRadius(E).innerRadius(A); + na(h, g, _, P, T).select("path").attr("d", (L) => P(L)).attr("fill", T ? "none" : (L) => Er(L)); } - function sa(h, g, _, A, E, T, P = !1) { - const z = ye().outerRadius(E).innerRadius(A).startAngle((J) => J.startAngle).endAngle((J) => J.endAngle), q = ye().outerRadius(E).innerRadius(A); - ft(x(it)).select("#" + g).selectAll(".slice").attr("prevStart", (J) => J.startAngle).attr("prevEnd", (J) => J.endAngle); - const C = ra(h, g, _, q, P); + function ia(h, g, _, A, E, T, P = !1) { + const z = mt().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), L = mt().outerRadius(E).innerRadius(A); + fe($(oe)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const C = na(h, g, _, L, P); let R = C.size(); - function Pt() { - R--, R <= 0 && (P || Ji()); + function Pe() { + R--, R <= 0 && (P || ji()); } - return C.select("path").transition("global").duration(U).attrTween("d", function(J) { - const Ht = Number(ft(this.parentNode).attr("prevStart")), nt = Number(ft(this.parentNode).attr("prevEnd")), Et = Ze(Ht, J.startAngle), ei = Ze(nt, J.endAngle); - return (Er) => (z.startAngle(Et(Er)).endAngle(ei(Er)), z(J)); - }).on("end", function(J) { - J.startAngle === J.endAngle && ft(this).attr("stroke", "none"), Pt(); - }), T && !P && Rl(h, _, E, dn(h)), _; - } - function Zi(h, g) { + return C.select("path").transition("global").duration(W).attrTween("d", function(Z) { + const Be = Number(fe(this.parentNode).attr("prevStart")), te = Number(fe(this.parentNode).attr("prevEnd")), Ee = Jt(Be, Z.startAngle), ti = Jt(te, Z.endAngle); + return (Cr) => (z.startAngle(Ee(Cr)).endAngle(ti(Cr)), z(Z)); + }).on("end", function(Z) { + Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), Pe(); + }), T && !P && Sl(h, _, E, Jn(h)), _; + } + function Ji(h, g) { s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); } - function Qi(h, g) { + function Zi(h, g) { s(g.data.label), i("leave"); } - function Ml(h, g) { + function Pl(h, g) { i("show-exhausted"), a(h.clientX), o(h.clientY); } - function Pl(h, g) { + function Dl(h, g) { i("hide-exhausted"); } - var Dl = { - pieColors: Ot, - exhaustedLabel: Re, - countExhaustedVotes: We, - getEliminatedCandidates: dn, - getElectedCandidates: xr, - runFullAnimationFn: Ke, - animateOnePhaseFn: Me, + var Ol = { + pieColors: ke, + exhaustedLabel: Ct, + countExhaustedVotes: hn, + getEliminatedCandidates: Jn, + getElectedCandidates: w, + runFullAnimationFn: Zn, + animateOnePhaseFn: Qr, get jsonData() { return n(); }, set jsonData(h) { - n(h), rt(); + n(h), ne(); }, get currentRound() { return r(); }, set currentRound(h = 1) { - r(h), rt(); + r(h), ne(); }, get mouseEventType() { return i(); }, set mouseEventType(h) { - i(h), rt(); + i(h), ne(); }, get mouseData() { return s(); }, set mouseData(h) { - s(h), rt(); + s(h), ne(); }, get mouseX() { return a(); }, set mouseX(h) { - a(h), rt(); + a(h), ne(); }, get mouseY() { return o(); }, set mouseY(h) { - o(h), rt(); + o(h), ne(); }, get requestRoundChange() { return l(); }, set requestRoundChange(h = (g) => { }) { - l(h), rt(); + l(h), ne(); }, get candidateColors() { return u(); }, set candidateColors(h = []) { - u(h), rt(); + u(h), ne(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, set excludeFinalWinnerAndEliminatedCandidate(h = !1) { - f(h), rt(); + f(h), ne(); }, get firstRoundDeterminesPercentages() { - return d(); + return p(); }, set firstRoundDeterminesPercentages(h = !1) { - d(h), rt(); + p(h), ne(); }, get randomizeOrder() { return c(); }, set randomizeOrder(h = !1) { - c(h), rt(); + c(h), ne(); }, get displayPhase() { - return p(); + return d(); }, set displayPhase(h = 0) { - p(h), rt(); + d(h), ne(); } - }, aa = Zd(); - return vi(aa, (h) => ht(it, h), () => x(it)), Wt(t, aa), zi(Dl); + }, sa = Qd(); + return vi(sa, (h) => de(oe, h), () => $(oe)), Ge(e, sa), zi(Ol); } -Ys( - wl, +Hs( + yl, { jsonData: {}, currentRound: {}, @@ -5541,83 +5564,83 @@ Ys( ], { mode: "open" } ); -var tp = /* @__PURE__ */ Be("
"), ep = /* @__PURE__ */ Be('
', 1), np = /* @__PURE__ */ Be('
'); -const rp = { +var tp = /* @__PURE__ */ Yt("
"), np = /* @__PURE__ */ Yt('
', 1), rp = /* @__PURE__ */ Yt('
'); +const ip = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function xl(t, e) { - Vi(e, !0), Hs(t, rp); - let n = at(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = at(e, "currentStep", 7, 0), i = at(e, "disabled", 7, !1), s = at(e, "onAdvance", 7, () => { +function wl(e, t) { + Vi(t, !0), zs(e, ip); + let n = ie(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ie(t, "currentStep", 7, 0), i = ie(t, "disabled", 7, !1), s = ie(t, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function o(d) { - (d.key === "Enter" || d.key === " ") && (d.preventDefault(), a()); + function o(p) { + (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a()); } var l = { get labels() { return n(); }, - set labels(d = ["Eliminate", "Transfer", "Consolidate"]) { - n(d), rt(); + set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { + n(p), ne(); }, get currentStep() { return r(); }, - set currentStep(d = 0) { - r(d), rt(); + set currentStep(p = 0) { + r(p), ne(); }, get disabled() { return i(); }, - set disabled(d = !1) { - i(d), rt(); + set disabled(p = !1) { + i(p), ne(); }, get onAdvance() { return s(); }, - set onAdvance(d = () => { + set onAdvance(p = () => { }) { - s(d), rt(); + s(p), ne(); } - }, u = np(); + }, u = rp(); let f; - return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (d, c, p) => { - var y = ep(), b = _n(y); + return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { + var y = np(), x = gn(y); { - var m = (W) => { - var ot = tp(); - let Z; - Qe(() => Z = ii(ot, 1, "connector svelte-1l4eyw0", null, Z, { completed: !i() && p <= r() })), Wt(W, ot); + var m = (X) => { + var se = tp(); + let Q; + Zt(() => Q = ii(se, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(X, se); }; - Qn(b, (W) => { - p > 0 && W(m); + tr(x, (X) => { + d > 0 && X(m); }); } - var $ = Jt(b, 2), D = Bt($); + var b = et(x, 2), D = We(b); let M; - var S = Jt(D, 2); - let F; - var L = Bt(S, !0); - It(S), It($), Qe(() => { + var S = et(D, 2); + let I; + var q = We(S, !0); + Ie(S), Ie(b), Zt(() => { M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { - active: !i() && p === r(), - completed: !i() && p < r() - }), F = ii(S, 1, "label svelte-1l4eyw0", null, F, { - active: !i() && p === r(), - completed: !i() && p < r() - }), mn(L, x(c)); - }), Wt(d, y); - }), It(u), Qe(() => { - f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); - }), Wt(t, u), zi(l); -} -Xu(["click", "keydown"]); -Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var ip = /* @__PURE__ */ Be(" ", 1), sp = /* @__PURE__ */ Be("About to eliminate: ", 1), ap = /* @__PURE__ */ Be(" ", 1), op = /* @__PURE__ */ Be(" ", 1), lp = /* @__PURE__ */ Be('

', 1), up = /* @__PURE__ */ Be("
", 1), fp = /* @__PURE__ */ Be('


these ballots have already been eliminated.
', 1); -const cp = { + active: !i() && d === r(), + completed: !i() && d < r() + }), I = ii(S, 1, "label svelte-1l4eyw0", null, I, { + active: !i() && d === r(), + completed: !i() && d < r() + }), _n(q, $(c)); + }), Ge(p, y); + }), Ie(u), Zt(() => { + f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), wa(u, "tabindex", i() ? -1 : 0), wa(u, "aria-disabled", i()); + }), Ge(e, u), zi(l); +} +Wu(["click", "keydown"]); +Hs(wl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var sp = /* @__PURE__ */ Yt(" ", 1), ap = /* @__PURE__ */ Yt("About to eliminate: ", 1), op = /* @__PURE__ */ Yt(" ", 1), lp = /* @__PURE__ */ Yt(" ", 1), up = /* @__PURE__ */ Yt('

', 1), fp = /* @__PURE__ */ Yt("
", 1), cp = /* @__PURE__ */ Yt('


these ballots have already been eliminated.
', 1); +const hp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5632,11 +5655,11 @@ const cp = { }` }; -function hp(t, e) { - Vi(e, !0), Hs(t, cp); +function dp(e, t) { + Vi(t, !0), zs(e, hp); const n = 0.85; - let r = at(e, "electionSummary", 7), i = at(e, "currentRound", 7, 1), s = at(e, "requestRoundChange", 7, (w) => { - }), a = at(e, "candidateColors", 23, () => []), o = at(e, "textForWinner", 7, "elected"), l = at(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = at(e, "firstRoundDeterminesPercentages", 7, !1), f = at(e, "randomizeOrder", 7, !1), d = at(e, "showCaptions", 7, !1); + let r = ie(t, "electionSummary", 7), i = ie(t, "currentRound", 7, 1), s = ie(t, "requestRoundChange", 7, (w) => { + }), a = ie(t, "candidateColors", 23, () => []), o = ie(t, "textForWinner", 7, "elected"), l = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ie(t, "firstRoundDeterminesPercentages", 7, !1), f = ie(t, "randomizeOrder", 7, !1), p = ie(t, "showCaptions", 7, !1); const c = { elected: { caption: "Elected", @@ -5655,204 +5678,196 @@ function hp(t, e) { infinitive: "to take the lead" } }; - let p = /* @__PURE__ */ vn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ bt(null), b = /* @__PURE__ */ bt(null), m = /* @__PURE__ */ bt(""), $ = /* @__PURE__ */ bt(Pn([])), D = /* @__PURE__ */ bt(""), M = /* @__PURE__ */ bt(""), S = /* @__PURE__ */ bt(0), F = /* @__PURE__ */ bt(0), L = /* @__PURE__ */ vn(() => W(r())); - function W(w) { + let d = /* @__PURE__ */ Cn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ be(null), x = /* @__PURE__ */ be(null), m = /* @__PURE__ */ be(""), b = /* @__PURE__ */ be(Mn([])), D = /* @__PURE__ */ be(""), M = /* @__PURE__ */ be(""), S = /* @__PURE__ */ be(0), I = /* @__PURE__ */ be(0), q = /* @__PURE__ */ Cn(() => X(r())); + function X(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (Y) { - return console.error("Failed to parse JSON string:", Y), {}; + } catch (G) { + return console.error("Failed to parse JSON string:", G), {}; } return w || {}; } - function ot(w) { + function se(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Z(w, Y, tt) { - w.style.left = Y + "px", w.style.top = tt + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const st = w.getBoundingClientRect(); - let Vt = Y, Ue = tt + 20; - Vt + st.width > window.innerWidth - 12 && (Vt = window.innerWidth - st.width - 12), Vt < 12 && (Vt = 12), Ue + st.height > window.innerHeight - 12 && (Ue = tt - st.height - 12), w.style.left = Vt + "px", w.style.top = Ue + "px"; + function Q(w, G, re) { + w.style.left = G + "px", w.style.top = re + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const le = w.getBoundingClientRect(); + let Fe = G, Ut = re + 20; + Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Ut + le.height > window.innerHeight - 12 && (Ut = re - le.height - 12), w.style.left = Fe + "px", w.style.top = Ut + "px"; }); } - function U() { - switch (x(D)) { + function W() { + switch ($(D)) { case "enter": ((w) => { - var Y = eu(w, 2); - ht($, Y[0], !0), ht(m, Y[1], !0); - })(ut(x(M), i())), x(y) && (Z(x(y), x(S) || 0, x(F) || 0), x(y).style.opacity = String(n)); + var G = nu(w, 2); + de(b, G[0], !0), de(m, G[1], !0); + })(ue($(M), i())), $(y) && (Q($(y), $(S) || 0, $(I) || 0), $(y).style.opacity = String(n)); break; case "leave": - x(y) && (x(y).style.opacity = "0"), ht($, [], !0), ht(m, ""); + $(y) && ($(y).style.opacity = "0"), de(b, [], !0), de(m, ""); break; case "show-exhausted": - x(b) && (Z(x(b), x(S) || 0, x(F) || 0), x(b).style.opacity = String(n)); + $(x) && (Q($(x), $(S) || 0, $(I) || 0), $(x).style.opacity = String(n)); break; case "hide-exhausted": - x(b) && (x(b).style.opacity = "0"); + $(x) && ($(x).style.opacity = "0"); break; case "": break; default: - console.log("Unknown mouse event: ", x(D)); + console.log("Unknown mouse event: ", $(D)); break; } } - Fs(() => U()); - function lt(w, Y) { - return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; - } - function ut(w, Y) { - const tt = [], pt = w === "exhausted" ? Re() : w; - let wt; - w === "exhausted" ? wt = et(1) : wt = x(L).results[0].tally[w], tt.push(`${pt} started with ${wt} votes.`); - for (let st = 1; st <= Y; st++) { - st === Y && (w === "exhausted" ? wt = et(Y) : wt = x(L).results[Y - 1].tally[w], tt.push(`${pt} has ${wt} votes at round ${Y}.`)); - const Vt = x(L).results[st - 1].tallyResults, Ue = yt(st); - for (let ke = 0; ke < Vt.length; ke++) { - const Cn = Vt[ke].transfers, pn = Vt[ke].eliminated, Mt = Vt[ke].elected; - if (!Ue) { + Fs(() => W()); + function ae(w, G) { + return w === 1 ? G ? "vote was" : "vote will be" : G ? "votes were" : "votes will be"; + } + function ue(w, G) { + const re = [], me = w === "exhausted" ? ke() : w; + let ye; + w === "exhausted" ? ye = Oe(1) : ye = $(q).results[0].tally[w], re.push(`${me} started with ${ye} votes.`); + for (let le = 1; le <= G; le++) { + le === G && (w === "exhausted" ? ye = Oe(G) : ye = $(q).results[G - 1].tally[w], re.push(`${me} has ${ye} votes at round ${G}.`)); + const Fe = $(q).results[le - 1].tallyResults, Ut = ce(le); + for (let Nt = 0; Nt < Fe.length; Nt++) { + const Tn = Fe[Nt].transfers, pn = Fe[Nt].eliminated, He = Fe[Nt].elected; + if (!Ut) { if (pn) - pn === w && tt.push(`${pt} will be eliminated on round ${st}.`); - else if (w === Mt && (tt.push(`${pt} ${x(p).event} on round ${st}.`), Cn)) - for (let [zt, At] of Object.entries(Cn)) - tt.push(`${At} ${lt(Number(At), st < Y)} transferred to ${zt} on round ${st}.`); + pn === w && re.push(`${me} will be eliminated on round ${le}.`); + else if (w === He && (re.push(`${me} ${$(d).event} on round ${le}.`), Tn)) + for (let [Me, Qe] of Object.entries(Tn)) + re.push(`${Qe} ${ae(Number(Qe), le < G)} transferred to ${Me} on round ${le}.`); } - const oe = pn || Mt; - if (oe) { - const zt = Number(Cn[w]); - zt && tt.push(`${zt} ${lt(zt, st < Y)} transferred from ${oe} on round ${st}.`); + const Ze = pn || He; + if (Ze) { + const Me = Number(Tn[w]); + Me && re.push(`${Me} ${ae(Me, le < G)} transferred from ${Ze} on round ${le}.`); } } } - return [tt, pt]; + return [re, me]; } function O() { let w = 0; - for (let Y = 1; Y <= x(L).results.length; Y++) { - if (yt(Y)) continue; - const tt = x(L).results[Y - 1].tallyResults; - for (let pt = 0; pt < tt.length; pt++) - tt[pt].elected && w++; + for (let G = 1; G <= $(q).results.length; G++) { + if (ce(G)) continue; + const re = $(q).results[G - 1].tallyResults; + for (let me = 0; me < re.length; me++) + re[me].elected && w++; } return w; } - let I, Nt = /* @__PURE__ */ bt(0); - function se(w) { - var wt; - return !((wt = x(L)) != null && wt.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((st) => st.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; - } - function mt(w) { - var tt; - if (!((tt = x(L)) != null && tt.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; - const Y = x(L).results[w - 1].tallyResults; - return Y.length === 0 || Y.every((pt) => Object.keys(pt.transfers).length === 0); + let F, Ne = /* @__PURE__ */ be(0); + function lt(w) { + var ye; + return !((ye = $(q)) != null && ye.results) || w < 1 || w > $(q).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [$(q).results[w - 1].tallyResults.some((le) => le.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function yt(w) { - return l() && x(L).results && w === x(L).results.length; + function ce(w) { + return l() && $(q).results && w === $(q).results.length; } - function Q(w) { - return yt(w) ? [] : I ? I.getEliminatedCandidates(w) : []; + function Ae(w) { + return ce(w) ? [] : F ? F.getEliminatedCandidates(w) : []; } - function kt(w) { - return yt(w) ? [] : I ? I.getElectedCandidates(w) : []; + function ee(w) { + return ce(w) ? [] : F ? F.getElectedCandidates(w) : []; } - function et(w) { - return I ? I.countExhaustedVotes(w) : 0; + function Oe(w) { + return F ? F.countExhaustedVotes(w) : 0; } - function Ot() { - I && I.animateOnePhaseFn && I.animateOnePhaseFn(); + function U() { + F && F.animateOnePhaseFn && F.animateOnePhaseFn(); } - function Re() { - return I ? I.exhaustedLabel : ""; + function ke() { + return F ? F.exhaustedLabel : ""; } - function it() { - return I ? I.pieColors : {}; + function Ct() { + return F ? F.pieColors : {}; } - var jt = { + var oe = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), rt(); + r(w), ne(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), rt(); + i(w), ne(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (Y) => { + set requestRoundChange(w = (G) => { }) { - s(w), rt(); + s(w), ne(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), rt(); + a(w), ne(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), rt(); + o(w), ne(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), rt(); + l(w), ne(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), rt(); + u(w), ne(); }, get randomizeOrder() { return f(); }, set randomizeOrder(w = !1) { - f(w), rt(); + f(w), ne(); }, get showCaptions() { - return d(); + return p(); }, set showCaptions(w = !1) { - d(w), rt(); + p(w), ne(); } - }, ve = fp(), ae = _n(ve), Tn = Bt(ae); + }, ze = cp(), Rt = gn(ze), St = We(Rt); { - let w = /* @__PURE__ */ vn(() => se(i())), Y = /* @__PURE__ */ vn(() => mt(i())); - xl(Tn, { + let w = /* @__PURE__ */ Cn(() => lt(i())); + wl(St, { get labels() { - return x(w); + return $(w); }, get currentStep() { - return x(Nt); - }, - get disabled() { - return x(Y); + return $(Ne); }, - onAdvance: Ot + disabled: !1, + onAdvance: U }); } - It(ae); - var _t = Jt(ae, 4), Se = Bt(_t), We = Bt(Se), Kr = Bt(We); + Ie(Rt); + var Xt = et(Rt, 4), ge = We(Xt), Wt = We(ge), hn = We(Wt); vi( - wl(Kr, { + yl(hn, { get jsonData() { - return x(L); + return $(q); }, get currentRound() { return i(); }, - requestRoundChange: ot, + requestRoundChange: se, get candidateColors() { return a(); }, @@ -5866,130 +5881,130 @@ function hp(t, e) { return f(); }, get mouseEventType() { - return x(D); + return $(D); }, set mouseEventType(w) { - ht(D, w, !0); + de(D, w, !0); }, get mouseData() { - return x(M); + return $(M); }, set mouseData(w) { - ht(M, w, !0); + de(M, w, !0); }, get mouseX() { - return x(S); + return $(S); }, set mouseX(w) { - ht(S, w, !0); + de(S, w, !0); }, get mouseY() { - return x(F); + return $(I); }, set mouseY(w) { - ht(F, w, !0); + de(I, w, !0); }, get displayPhase() { - return x(Nt); + return $(Ne); }, set displayPhase(w) { - ht(Nt, w, !0); + de(Ne, w, !0); } }), - (w) => I = w, - () => I - ), It(We), It(Se); - var jr = Jt(Se, 2); + (w) => F = w, + () => F + ), Ie(Wt), Ie(ge); + var Jr = et(ge, 2); { - var Jr = (w) => { - var Y = lp(), tt = _n(Y), pt = Bt(tt); - It(tt); - var wt = Jt(tt, 2), st = Bt(wt); + var Zr = (w) => { + var G = up(), re = gn(G), me = We(re); + Ie(re); + var ye = et(re, 2), le = We(ye); { - var Vt = (Mt) => { - var oe = sp(), zt = Jt(_n(oe)); - pi(zt, 17, () => Q(i()), di, (At, ge, _e) => { - var Ge = ip(), me = _n(Ge); - let Ke; - var Rn = Bt(me, !0); - It(me); - var vt = Jt(me, 2); + var Fe = (He) => { + var Ze = ap(), Me = et(gn(Ze)); + pi(Me, 17, () => Ae(i()), di, (Qe, we, ut) => { + var Ye = sp(), ft = gn(Ye); + let kt; + var Zn = We(ft, !0); + Ie(ft); + var Qn = et(ft, 2); { - var br = (Me) => { - var je = ga(", "); - Wt(Me, je); - }, $r = /* @__PURE__ */ vn(() => _e < Q(i()).length - 1); - Qn(vt, (Me) => { - x($r) && Me(br); + var _e = (Gt) => { + var Kt = va(", "); + Ge(Gt, Kt); + }, Ar = /* @__PURE__ */ Cn(() => ut < Ae(i()).length - 1); + tr(Qn, (Gt) => { + $(Ar) && Gt(_e); }); } - Qe( - (Me) => { - Ke = wa(me, "", Ke, Me), mn(Rn, x(ge)); + Zt( + (Gt) => { + kt = ya(ft, "", kt, Gt), _n(Zn, $(we)); }, - [() => ({ color: it()[x(ge)] })] - ), Wt(At, Ge); - }), Wt(Mt, oe); - }, Ue = /* @__PURE__ */ vn(() => Q(i()).length > 0); - Qn(st, (Mt) => { - x(Ue) && Mt(Vt); + [() => ({ color: Ct()[$(we)] })] + ), Ge(Qe, Ye); + }), Ge(He, Ze); + }, Ut = /* @__PURE__ */ Cn(() => Ae(i()).length > 0); + tr(le, (He) => { + $(Ut) && He(Fe); }); } - var ke = Jt(st, 2); + var Nt = et(le, 2); { - var Cn = (Mt) => { - var oe = op(), zt = _n(oe), At = Jt(zt); - pi(At, 17, () => kt(i()), di, (ge, _e, Ge) => { - var me = ap(), Ke = _n(me); - let Rn; - var vt = Bt(Ke, !0); - It(Ke); - var br = Jt(Ke, 2); + var Tn = (He) => { + var Ze = lp(), Me = gn(Ze), Qe = et(Me); + pi(Qe, 17, () => ee(i()), di, (we, ut, Ye) => { + var ft = op(), kt = gn(ft); + let Zn; + var Qn = We(kt, !0); + Ie(kt); + var _e = et(kt, 2); { - var $r = (je) => { - var ji = ga(", "); - Wt(je, ji); - }, Me = /* @__PURE__ */ vn(() => Ge < kt(i()).length - 1); - Qn(br, (je) => { - x(Me) && je($r); + var Ar = (Kt) => { + var Qr = va(", "); + Ge(Kt, Qr); + }, Gt = /* @__PURE__ */ Cn(() => Ye < ee(i()).length - 1); + tr(_e, (Kt) => { + $(Gt) && Kt(Ar); }); } - Qe( - (je) => { - Rn = wa(Ke, "", Rn, je), mn(vt, x(_e)); + Zt( + (Kt) => { + Zn = ya(kt, "", Zn, Kt), _n(Qn, $(ut)); }, - [() => ({ color: it()[x(_e)] })] - ), Wt(ge, me); - }), Qe(() => mn(zt, `${x(p).caption ?? ""}: `)), Wt(Mt, oe); - }, pn = /* @__PURE__ */ vn(() => kt(i()).length > 0); - Qn(ke, (Mt) => { - x(pn) && Mt(Cn); + [() => ({ color: Ct()[$(ut)] })] + ), Ge(we, ft); + }), Zt(() => _n(Me, `${$(d).caption ?? ""}: `)), Ge(He, Ze); + }, pn = /* @__PURE__ */ Cn(() => ee(i()).length > 0); + tr(Nt, (He) => { + $(pn) && He(Tn); }); } - It(wt), Qe((Mt) => mn(pt, `${x(L).config.contest ?? ""}, ${Mt ?? ""} ${x(p).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Wt(w, Y); + Ie(ye), Zt((He) => _n(me, `${$(q).config.contest ?? ""}, ${He ?? ""} ${$(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, G); }; - Qn(jr, (w) => { - d() && w(Jr); + tr(Jr, (w) => { + p() && w(Zr); }); } - It(_t); - var Jn = Jt(_t, 2), Ne = Bt(Jn), Ki = Bt(Ne, !0); - It(Ne); - var Zr = Jt(Ne, 2); - pi(Zr, 17, () => x($), di, (w, Y) => { - var tt = up(), pt = _n(tt), wt = Bt(pt, !0); - It(pt), us(2), Qe(() => mn(wt, x(Y))), Wt(w, tt); - }), It(Jn), vi(Jn, (w) => ht(y, w), () => x(y)); - var dn = Jt(Jn, 2), xr = Bt(dn); - return us(2), It(dn), vi(dn, (w) => ht(b, w), () => x(b)), Qe( + Ie(Xt); + var En = et(Xt, 2), $r = We(En), dn = We($r, !0); + Ie($r); + var Ki = et($r, 2); + pi(Ki, 17, () => $(b), di, (w, G) => { + var re = fp(), me = gn(re), ye = We(me, !0); + Ie(me), ls(2), Zt(() => _n(ye, $(G))), Ge(w, re); + }), Ie(En), vi(En, (w) => de(y, w), () => $(y)); + var jn = et(En, 2), Jn = We(jn); + return ls(2), Ie(jn), vi(jn, (w) => de(x, w), () => $(x)), Zt( (w) => { - mn(Ki, x(m)), mn(xr, `"${w ?? ""}" means all the candidates ranked on `); + _n(dn, $(m)), _n(Jn, `"${w ?? ""}" means all the candidates ranked on `); }, - [Re] - ), Wt(t, ve), zi(jt); + [ke] + ), Ge(e, ze), zi(oe); } -customElements.define("pie-chart", Ys( - hp, +customElements.define("pie-chart", Hs( + dp, { electionSummary: {}, currentRound: {}, From 0a73ed69c4b1911475b91deebfd21e22a6c43354 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 9 Apr 2026 10:41:12 -0700 Subject: [PATCH 08/10] Sync pie chart --- static/pie/pie-chart.es.js | 4730 ++++++++++++++++++------------------ 1 file changed, 2387 insertions(+), 2343 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 5de3edb3..67835f4c 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var Ll = Object.defineProperty; -var aa = (e) => { +var zl = Object.defineProperty; +var la = (e) => { throw TypeError(e); }; -var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var he = (e, t, n) => ql(e, typeof t != "symbol" ? t + "" : t, n), Qi = (e, t, n) => t.has(e) || aa("Cannot " + n); -var v = (e, t, n) => (Qi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), H = (e, t, n) => t.has(e) ? aa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), V = (e, t, n, r) => (Qi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xe = (e, t, n) => (Qi(e, t, "access private method"), n); -var Va; -typeof window < "u" && ((Va = window.__svelte ?? (window.__svelte = {})).v ?? (Va.v = /* @__PURE__ */ new Set())).add("5"); -const Vl = 1, zl = 2, Ba = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ss = "[", Oi = "[!", Ns = "]", cr = {}, Te = Symbol(), Xa = "http://www.w3.org/1999/xhtml", as = !1; -var Wa = Array.isArray, jl = Array.prototype.indexOf, hr = Array.prototype.includes, Fi = Array.from, bi = Object.keys, $i = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ua = Object.getPrototypeOf, oa = Object.isExtensible; -const eu = () => { +var Hl = (e, t, n) => t in e ? zl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var pe = (e, t, n) => Hl(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || la("Cannot " + n); +var v = (e, t, n) => (es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), z = (e, t, n) => t.has(e) ? la("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), q = (e, t, n, r) => (es(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (es(e, t, "access private method"), n); +var Ha; +typeof window < "u" && ((Ha = window.__svelte ?? (window.__svelte = {})).v ?? (Ha.v = /* @__PURE__ */ new Set())).add("5"); +const Yl = 1, Bl = 2, Wa = 4, Xl = 8, Wl = 16, Ul = 1, Gl = 4, Kl = 8, jl = 16, Jl = 1, Zl = 2, Ns = "[", Di = "[!", ks = "]", cr = {}, Re = Symbol(), Ua = "http://www.w3.org/1999/xhtml", os = !1; +var Ga = Array.isArray, Ql = Array.prototype.indexOf, hr = Array.prototype.includes, Oi = Array.from, xi = Object.keys, bi = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, eu = Object.getOwnPropertyDescriptors, tu = Object.prototype, nu = Array.prototype, Ka = Object.getPrototypeOf, ua = Object.isExtensible; +const ru = () => { }; -function tu(e) { +function iu(e) { for (var t = 0; t < e.length; t++) e[t](); } -function Ga() { +function ja() { var e, t, n = new Promise((r, i) => { e = r, t = i; }); return { promise: n, resolve: e, reject: t }; } -function nu(e, t) { +function su(e, t) { if (Array.isArray(e)) return e; if (!(Symbol.iterator in e)) @@ -31,132 +31,132 @@ function nu(e, t) { if (n.push(r), n.length === t) break; return n; } -const Re = 2, Ir = 4, Ii = 8, Ka = 1 << 24, cn = 16, Et = 32, An = 64, ja = 128, vt = 512, $e = 1024, Se = 2048, At = 4096, it = 8192, on = 16384, wr = 32768, dr = 65536, la = 1 << 17, Ja = 1 << 18, Kn = 1 << 19, ru = 1 << 20, sn = 1 << 25, Xn = 65536, os = 1 << 21, ks = 1 << 22, yn = 1 << 23, Dr = Symbol("$state"), Za = Symbol("legacy props"), iu = Symbol(""), Nn = new class extends Error { +const Ce = 2, Lr = 4, Fi = 8, Ja = 1 << 24, cn = 16, Tt = 32, An = 64, Za = 128, ht = 512, Ae = 1024, Ne = 2048, Et = 4096, nt = 8192, on = 16384, wr = 32768, dr = 65536, fa = 1 << 17, Qa = 1 << 18, jn = 1 << 19, au = 1 << 20, sn = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, yn = 1 << 23, Or = Symbol("$state"), eo = Symbol("legacy props"), ou = Symbol(""), kn = new class extends Error { constructor() { super(...arguments); - he(this, "name", "StaleReactionError"); - he(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + pe(this, "name", "StaleReactionError"); + pe(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var za; -const su = ((za = globalThis.document) == null ? void 0 : /* @__PURE__ */ za.contentType.includes("xml")) ?? !1, Gr = 3, xr = 8; -function au(e) { +var Ya; +const lu = ((Ya = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ya.contentType.includes("xml")) ?? !1, Kr = 3, xr = 8; +function uu(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function ou() { +function fu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function lu(e, t, n) { +function cu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function uu(e) { +function hu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function fu() { +function du() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function cu(e) { +function pu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function hu() { +function vu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function du() { +function gu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function pu(e) { +function _u(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function vu() { +function mu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function gu() { +function yu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function _u() { +function wu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function mu() { +function xu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Li(e) { +function Ii(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function yu() { +function bu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; function an(e) { j = e; } -let B; -function qe(e) { +let X; +function Ie(e) { if (e === null) - throw Li(), cr; - return B = e; + throw Ii(), cr; + return X = e; } -function qi() { - return qe(/* @__PURE__ */ zt(B)); +function Li() { + return Ie(/* @__PURE__ */ Ht(X)); } -function Ie(e) { +function Oe(e) { if (j) { - if (/* @__PURE__ */ zt(B) !== null) - throw Li(), cr; - B = e; + if (/* @__PURE__ */ Ht(X) !== null) + throw Ii(), cr; + X = e; } } -function ls(e = 1) { +function us(e = 1) { if (j) { - for (var t = e, n = B; t--; ) + for (var t = e, n = X; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ zt(n); - B = n; + /* @__PURE__ */ Ht(n); + X = n; } } -function Ai(e = !0) { - for (var t = 0, n = B; ; ) { +function $i(e = !0) { + for (var t = 0, n = X; ; ) { if (n.nodeType === xr) { var r = ( /** @type {Comment} */ n.data ); - if (r === Ns) { + if (r === ks) { if (t === 0) return n; t -= 1; - } else (r === Ss || r === Oi || // "[1", "[2", etc. for if blocks + } else (r === Ns || r === Di || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ zt(n) + /* @__PURE__ */ Ht(n) ); e && n.remove(), n = i; } } -function Qa(e) { +function to(e) { if (!e || e.nodeType !== xr) - throw Li(), cr; + throw Ii(), cr; return ( /** @type {Comment} */ e.data ); } -function eo(e) { +function no(e) { return e === this.v; } -function wu(e, t) { +function $u(e, t) { return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function to(e) { - return !wu(e, this.v); +function ro(e) { + return !$u(e, this.v); } -let xu = !1, at = null; +let Au = !1, it = null; function pr(e) { - at = e; + it = e; } -function Vi(e, t = !1, n) { - at = { - p: at, +function qi(e, t = !1, n) { + it = { + p: it, i: !1, c: null, e: null, @@ -165,51 +165,51 @@ function Vi(e, t = !1, n) { l: null }; } -function zi(e) { +function Vi(e) { var t = ( /** @type {ComponentContext} */ - at + it ), n = t.e; if (n !== null) { t.e = null; for (var r of n) Co(r); } - return e !== void 0 && (t.x = e), t.i = !0, at = t.p, e ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, it = t.p, e ?? /** @type {T} */ {}; } -function no() { +function io() { return !0; } -let kn = []; -function ro() { - var e = kn; - kn = [], tu(e); +let Mn = []; +function so() { + var e = Mn; + Mn = [], iu(e); } function wn(e) { - if (kn.length === 0 && !Or) { - var t = kn; + if (Mn.length === 0 && !Fr) { + var t = Mn; queueMicrotask(() => { - t === kn && ro(); + t === Mn && so(); }); } - kn.push(e); + Mn.push(e); } -function bu() { - for (; kn.length > 0; ) - ro(); +function Eu() { + for (; Mn.length > 0; ) + so(); } -function io(e) { +function ao(e) { var t = J; if (t === null) - return Y.f |= yn, e; - if ((t.f & wr) === 0 && (t.f & Ir) === 0) + return B.f |= yn, e; + if ((t.f & wr) === 0 && (t.f & Lr) === 0) throw e; vr(e, t); } function vr(e, t) { for (; t !== null; ) { - if ((t.f & ja) !== 0) { + if ((t.f & Za) !== 0) { if ((t.f & wr) === 0) throw e; try { @@ -223,78 +223,78 @@ function vr(e, t) { } throw e; } -const $u = -7169; -function pe(e, t) { - e.f = e.f & $u | t; +const Tu = -7169; +function ge(e, t) { + e.f = e.f & Tu | t; } -function Ms(e) { - (e.f & vt) !== 0 || e.deps === null ? pe(e, $e) : pe(e, At); +function Ps(e) { + (e.f & ht) !== 0 || e.deps === null ? ge(e, Ae) : ge(e, Et); } -function so(e) { +function oo(e) { if (e !== null) for (const t of e) - (t.f & Re) === 0 || (t.f & Xn) === 0 || (t.f ^= Xn, so( + (t.f & Ce) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, oo( /** @type {Derived} */ t.deps )); } -function ao(e, t, n) { - (e.f & Se) !== 0 ? t.add(e) : (e.f & At) !== 0 && n.add(e), so(e.deps), pe(e, $e); +function lo(e, t, n) { + (e.f & Ne) !== 0 ? t.add(e) : (e.f & Et) !== 0 && n.add(e), oo(e.deps), ge(e, Ae); } -const ni = /* @__PURE__ */ new Set(); -let K = null, Ce = null, Ke = [], Hi = null, us = !1, Or = !1; -var ir, sr, On, ar, Yr, Br, Fn, Qt, or, Vt, fs, cs, oo; -const js = class js { +const ti = /* @__PURE__ */ new Set(); +let K = null, Se = null, Ue = [], zi = null, fs = !1, Fr = !1; +var ir, sr, Fn, ar, Br, Xr, In, Qt, or, zt, cs, hs, uo; +const Js = class Js { constructor() { - H(this, Vt); - he(this, "committed", !1); + z(this, zt); + pe(this, "committed", !1); /** * The current values of any sources that are updated in this batch * They keys of this map are identical to `this.#previous` * @type {Map} */ - he(this, "current", /* @__PURE__ */ new Map()); + pe(this, "current", /* @__PURE__ */ new Map()); /** * The values of any sources that are updated in this batch _before_ those updates took place. * They keys of this map are identical to `this.#current` * @type {Map} */ - he(this, "previous", /* @__PURE__ */ new Map()); + pe(this, "previous", /* @__PURE__ */ new Map()); /** * When the batch is committed (and the DOM is updated), we need to remove old branches * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - H(this, ir, /* @__PURE__ */ new Set()); + z(this, ir, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - H(this, sr, /* @__PURE__ */ new Set()); + z(this, sr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - H(this, On, 0); + z(this, Fn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - H(this, ar, 0); + z(this, ar, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} */ - H(this, Yr, null); + z(this, Br, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - H(this, Br, /* @__PURE__ */ new Set()); + z(this, Xr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - H(this, Fn, /* @__PURE__ */ new Set()); + z(this, In, /* @__PURE__ */ new Set()); /** * A map of branches that still exist, but will be destroyed when this batch * is committed — we skip over these during `process`. @@ -302,9 +302,9 @@ const js = class js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, Qt, /* @__PURE__ */ new Map()); - he(this, "is_fork", !1); - H(this, or, !1); + z(this, Qt, /* @__PURE__ */ new Map()); + pe(this, "is_fork", !1); + z(this, or, !1); } is_deferred() { return this.is_fork || v(this, ar) > 0; @@ -326,9 +326,9 @@ const js = class js { if (n) { v(this, Qt).delete(t); for (var r of n.d) - pe(r, Se), bt(r); + ge(r, Ne), $t(r); for (r of n.m) - pe(r, At), bt(r); + ge(r, Et), $t(r); } } /** @@ -337,19 +337,19 @@ const js = class js { */ process(t) { var i; - Ke = [], this.apply(); + Ue = [], this.apply(); var n = [], r = []; for (const s of t) - xe(this, Vt, fs).call(this, s, n, r); + be(this, zt, cs).call(this, s, n, r); if (this.is_deferred()) { - xe(this, Vt, cs).call(this, r), xe(this, Vt, cs).call(this, n); + be(this, zt, hs).call(this, r), be(this, zt, hs).call(this, n); for (const [s, a] of v(this, Qt)) - co(s, a); + po(s, a); } else { for (const s of v(this, ir)) s(); - v(this, ir).clear(), v(this, On) === 0 && xe(this, Vt, oo).call(this), K = null, ua(r), ua(n), (i = v(this, Yr)) == null || i.resolve(); + v(this, ir).clear(), v(this, Fn) === 0 && be(this, zt, uo).call(this), K = null, ca(r), ca(n), (i = v(this, Br)) == null || i.resolve(); } - Ce = null; + Se = null; } /** * Associate a change to a given source with the current @@ -358,19 +358,19 @@ const js = class js { * @param {any} value */ capture(t, n) { - n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & yn) === 0 && (this.current.set(t, t.v), Ce == null || Ce.set(t, t.v)); + n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & yn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); } activate() { K = this, this.apply(); } deactivate() { - K === this && (K = null, Ce = null); + K === this && (K = null, Se = null); } flush() { - if (this.activate(), Ke.length > 0) { - if (lo(), K !== null && K !== this) + if (this.activate(), Ue.length > 0) { + if (fo(), K !== null && K !== this) return; - } else v(this, On) === 0 && this.process([]); + } else v(this, Fn) === 0 && this.process([]); this.deactivate(); } discard() { @@ -382,22 +382,22 @@ const js = class js { * @param {boolean} blocking */ increment(t) { - V(this, On, v(this, On) + 1), t && V(this, ar, v(this, ar) + 1); + q(this, Fn, v(this, Fn) + 1), t && q(this, ar, v(this, ar) + 1); } /** * * @param {boolean} blocking */ decrement(t) { - V(this, On, v(this, On) - 1), t && V(this, ar, v(this, ar) - 1), !v(this, or) && (V(this, or, !0), wn(() => { - V(this, or, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); + q(this, Fn, v(this, Fn) - 1), t && q(this, ar, v(this, ar) - 1), !v(this, or) && (q(this, or, !0), wn(() => { + q(this, or, !1), this.is_deferred() ? Ue.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, Br)) - v(this, Fn).delete(t), pe(t, Se), bt(t); - for (const t of v(this, Fn)) - pe(t, At), bt(t); + for (const t of v(this, Xr)) + v(this, In).delete(t), ge(t, Ne), $t(t); + for (const t of v(this, In)) + ge(t, Et), $t(t); this.flush(); } /** @param {() => void} fn */ @@ -409,12 +409,12 @@ const js = class js { v(this, sr).add(t); } settled() { - return (v(this, Yr) ?? V(this, Yr, Ga())).promise; + return (v(this, Br) ?? q(this, Br, ja())).promise; } static ensure() { if (K === null) { - const t = K = new js(); - ni.add(K), Or || wn(() => { + const t = K = new Js(); + ti.add(K), Fr || wn(() => { K === t && t.flush(); }); } @@ -423,41 +423,41 @@ const js = class js { apply() { } }; -ir = new WeakMap(), sr = new WeakMap(), On = new WeakMap(), ar = new WeakMap(), Yr = new WeakMap(), Br = new WeakMap(), Fn = new WeakMap(), Qt = new WeakMap(), or = new WeakMap(), Vt = new WeakSet(), /** +ir = new WeakMap(), sr = new WeakMap(), Fn = new WeakMap(), ar = new WeakMap(), Br = new WeakMap(), Xr = new WeakMap(), In = new WeakMap(), Qt = new WeakMap(), or = new WeakMap(), zt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -fs = function(t, n, r) { - t.f ^= $e; +cs = function(t, n, r) { + t.f ^= Ae; for (var i = t.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Et | An)) !== 0, l = o && (a & $e) !== 0, u = l || (a & it) !== 0 || v(this, Qt).has(i); + var a = i.f, o = (a & (Tt | An)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & nt) !== 0 || v(this, Qt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= $e : s !== null && (a & (Ir | Ii | Ka)) !== 0 ? s.b.defer_effect(i) : (a & Ir) !== 0 ? n.push(i) : Kr(i) && ((a & cn) !== 0 && v(this, Fn).add(i), _r(i)); + o ? i.f ^= Ae : s !== null && (a & (Lr | Fi | Ja)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : jr(i) && ((a & cn) !== 0 && v(this, In).add(i), _r(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var p = i.parent; - for (i = i.next; i === null && p !== null; ) - p === s && (s = null), i = p.next, p = p.parent; + var d = i.parent; + for (i = i.next; i === null && d !== null; ) + d === s && (s = null), i = d.next, d = d.parent; } }, /** * @param {Effect[]} effects */ -cs = function(t) { +hs = function(t) { for (var n = 0; n < t.length; n += 1) - ao(t[n], v(this, Br), v(this, Fn)); -}, oo = function() { + lo(t[n], v(this, Xr), v(this, In)); +}, uo = function() { var i; - if (ni.size > 1) { + if (ti.size > 1) { this.previous.clear(); - var t = Ce, n = !0; - for (const s of ni) { + var t = Se, n = !0; + for (const s of ti) { if (s === this) { n = !1; continue; @@ -475,111 +475,111 @@ cs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ke; - Ke = []; + var r = Ue; + Ue = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - uo(f, o, l, u); - if (Ke.length > 0) { + co(f, o, l, u); + if (Ue.length > 0) { K = s, s.apply(); - for (const f of Ke) - xe(i = s, Vt, fs).call(i, f, [], []); + for (const f of Ue) + be(i = s, zt, cs).call(i, f, [], []); s.deactivate(); } - Ke = r; + Ue = r; } } - K = null, Ce = t; + K = null, Se = t; } - this.committed = !0, ni.delete(this); + this.committed = !0, ti.delete(this); }; -let ln = js; +let ln = Js; function ne(e) { - var t = Or; - Or = !0; + var t = Fr; + Fr = !0; try { for (var n; ; ) { - if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) - return Hi = null, /** @type {T} */ + if (Eu(), Ue.length === 0 && (K == null || K.flush(), Ue.length === 0)) + return zi = null, /** @type {T} */ n; - lo(); + fo(); } } finally { - Or = t; + Fr = t; } } -function lo() { - us = !0; +function fo() { + fs = !0; var e = null; try { - for (var t = 0; Ke.length > 0; ) { + for (var t = 0; Ue.length > 0; ) { var n = ln.ensure(); if (t++ > 1e3) { var r, i; - Au(); + Ru(); } - n.process(Ke), xn.clear(); + n.process(Ue), xn.clear(); } } finally { - Ke = [], us = !1, Hi = null; + Ue = [], fs = !1, zi = null; } } -function Au() { +function Ru() { try { - hu(); + vu(); } catch (e) { - vr(e, Hi); + vr(e, zi); } } -let yt = null; -function ua(e) { +let wt = null; +function ca(e) { var t = e.length; if (t !== 0) { for (var n = 0; n < t; ) { var r = e[n++]; - if ((r.f & (on | it)) === 0 && Kr(r) && (yt = /* @__PURE__ */ new Set(), _r(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && No(r), (yt == null ? void 0 : yt.size) > 0)) { + if ((r.f & (on | nt)) === 0 && jr(r) && (wt = /* @__PURE__ */ new Set(), _r(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Mo(r), (wt == null ? void 0 : wt.size) > 0)) { xn.clear(); - for (const i of yt) { - if ((i.f & (on | it)) !== 0) continue; + for (const i of wt) { + if ((i.f & (on | nt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - yt.has(a) && (yt.delete(a), s.push(a)), a = a.parent; + wt.has(a) && (wt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (on | it)) === 0 && _r(l); + (l.f & (on | nt)) === 0 && _r(l); } } - yt.clear(); + wt.clear(); } } - yt = null; + wt = null; } } -function uo(e, t, n, r) { +function co(e, t, n, r) { if (!n.has(e) && (n.add(e), e.reactions !== null)) for (const i of e.reactions) { const s = i.f; - (s & Re) !== 0 ? uo( + (s & Ce) !== 0 ? co( /** @type {Derived} */ i, t, n, r - ) : (s & (ks | cn)) !== 0 && (s & Se) === 0 && fo(i, t, r) && (pe(i, Se), bt( + ) : (s & (Ms | cn)) !== 0 && (s & Ne) === 0 && ho(i, t, r) && (ge(i, Ne), $t( /** @type {Effect} */ i )); } } -function fo(e, t, n) { +function ho(e, t, n) { const r = n.get(e); if (r !== void 0) return r; if (e.deps !== null) for (const i of e.deps) { if (hr.call(t, i)) return !0; - if ((i.f & Re) !== 0 && fo( + if ((i.f & Ce) !== 0 && ho( /** @type {Derived} */ i, t, @@ -593,80 +593,80 @@ function fo(e, t, n) { } return n.set(e, !1), !1; } -function bt(e) { - for (var t = Hi = e; t.parent !== null; ) { +function $t(e) { + for (var t = zi = e; t.parent !== null; ) { t = t.parent; var n = t.f; - if (us && t === J && (n & cn) !== 0 && (n & Ja) === 0) + if (fs && t === J && (n & cn) !== 0 && (n & Qa) === 0) return; - if ((n & (An | Et)) !== 0) { - if ((n & $e) === 0) return; - t.f ^= $e; + if ((n & (An | Tt)) !== 0) { + if ((n & Ae) === 0) return; + t.f ^= Ae; } } - Ke.push(t); + Ue.push(t); } -function co(e, t) { - if (!((e.f & Et) !== 0 && (e.f & $e) !== 0)) { - (e.f & Se) !== 0 ? t.d.push(e) : (e.f & At) !== 0 && t.m.push(e), pe(e, $e); +function po(e, t) { + if (!((e.f & Tt) !== 0 && (e.f & Ae) !== 0)) { + (e.f & Ne) !== 0 ? t.d.push(e) : (e.f & Et) !== 0 && t.m.push(e), ge(e, Ae); for (var n = e.first; n !== null; ) - co(n, t), n = n.next; + po(n, t), n = n.next; } } -function Eu(e) { - let t = 0, n = Wn(0), r; +function Su(e) { + let t = 0, n = Un(0), r; return () => { - Os() && ($(n), Is(() => (t === 0 && (r = Xi(() => e(() => Fr(n)))), t += 1, () => { + Fs() && ($(n), Ls(() => (t === 0 && (r = Bi(() => e(() => Ir(n)))), t += 1, () => { wn(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Fr(n)); + t -= 1, t === 0 && (r == null || r(), r = void 0, Ir(n)); }); }))); }; } -var Tu = dr | Kn | ja; -function Cu(e, t, n) { - new Ru(e, t, n); +var Cu = dr | jn | Za; +function Nu(e, t, n) { + new ku(e, t, n); } -var nt, Xr, Pt, In, Dt, ht, Ue, Ot, en, mn, Ln, tn, lr, qn, ur, fr, nn, Pi, ve, ho, po, hs, fi, ci, ds; -class Ru { +var et, Wr, Dt, Ln, Ot, ut, Xe, Ft, en, mn, qn, tn, lr, Vn, ur, fr, nn, Mi, me, vo, go, ds, ui, fi, ps; +class ku { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(t, n, r) { - H(this, ve); + z(this, me); /** @type {Boundary | null} */ - he(this, "parent"); - he(this, "is_pending", !1); + pe(this, "parent"); + pe(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, nt); + z(this, et); /** @type {TemplateNode | null} */ - H(this, Xr, j ? B : null); + z(this, Wr, j ? X : null); /** @type {BoundaryProps} */ - H(this, Pt); + z(this, Dt); /** @type {((anchor: Node) => void)} */ - H(this, In); + z(this, Ln); /** @type {Effect} */ - H(this, Dt); + z(this, Ot); /** @type {Effect | null} */ - H(this, ht, null); + z(this, ut, null); /** @type {Effect | null} */ - H(this, Ue, null); + z(this, Xe, null); /** @type {Effect | null} */ - H(this, Ot, null); + z(this, Ft, null); /** @type {DocumentFragment | null} */ - H(this, en, null); + z(this, en, null); /** @type {TemplateNode | null} */ - H(this, mn, null); - H(this, Ln, 0); - H(this, tn, 0); - H(this, lr, !1); - H(this, qn, !1); + z(this, mn, null); + z(this, qn, 0); + z(this, tn, 0); + z(this, lr, !1); + z(this, Vn, !1); /** @type {Set} */ - H(this, ur, /* @__PURE__ */ new Set()); + z(this, ur, /* @__PURE__ */ new Set()); /** @type {Set} */ - H(this, fr, /* @__PURE__ */ new Set()); + z(this, fr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -674,38 +674,38 @@ class Ru { * calls followed by no-op flushes * @type {Source | null} */ - H(this, nn, null); - H(this, Pi, Eu(() => (V(this, nn, Wn(v(this, Ln))), () => { - V(this, nn, null); + z(this, nn, null); + z(this, Mi, Su(() => (q(this, nn, Un(v(this, qn))), () => { + q(this, nn, null); }))); - V(this, nt, t), V(this, Pt, n), V(this, In, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Pt).pending, V(this, Dt, Ls(() => { + q(this, et, t), q(this, Dt, n), q(this, Ln, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Dt).pending, q(this, Ot, qs(() => { if (J.b = this, j) { - const s = v(this, Xr); - qi(), /** @type {Comment} */ + const s = v(this, Wr); + Li(), /** @type {Comment} */ s.nodeType === xr && /** @type {Comment} */ - s.data === Oi ? xe(this, ve, po).call(this) : (xe(this, ve, ho).call(this), v(this, tn) === 0 && (this.is_pending = !1)); + s.data === Di ? be(this, me, go).call(this) : (be(this, me, vo).call(this), v(this, tn) === 0 && (this.is_pending = !1)); } else { - var i = xe(this, ve, hs).call(this); + var i = be(this, me, ds).call(this); try { - V(this, ht, pt(() => r(i))); + q(this, ut, ct(() => r(i))); } catch (s) { this.error(s); } - v(this, tn) > 0 ? xe(this, ve, ci).call(this) : this.is_pending = !1; + v(this, tn) > 0 ? be(this, me, fi).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, mn)) == null || s.remove(); }; - }, Tu)), j && V(this, nt, B); + }, Cu)), j && q(this, et, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(t) { - ao(t, v(this, ur), v(this, fr)); + lo(t, v(this, ur), v(this, fr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Ru { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Pt).pending; + return !!v(this, Dt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -724,48 +724,48 @@ class Ru { * @param {1 | -1} d */ update_pending_count(t) { - xe(this, ve, ds).call(this, t), V(this, Ln, v(this, Ln) + t), !(!v(this, nn) || v(this, lr)) && (V(this, lr, !0), wn(() => { - V(this, lr, !1), v(this, nn) && gr(v(this, nn), v(this, Ln)); + be(this, me, ps).call(this, t), q(this, qn, v(this, qn) + t), !(!v(this, nn) || v(this, lr)) && (q(this, lr, !0), wn(() => { + q(this, lr, !1), v(this, nn) && gr(v(this, nn), v(this, qn)); })); } get_effect_pending() { - return v(this, Pi).call(this), $( + return v(this, Mi).call(this), $( /** @type {Source} */ v(this, nn) ); } /** @param {unknown} error */ error(t) { - var n = v(this, Pt).onerror; - let r = v(this, Pt).failed; - if (v(this, qn) || !n && !r) + var n = v(this, Dt).onerror; + let r = v(this, Dt).failed; + if (v(this, Vn) || !n && !r) throw t; - v(this, ht) && (Ve(v(this, ht)), V(this, ht, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Ot) && (Ve(v(this, Ot)), V(this, Ot, null)), j && (qe( + v(this, ut) && (Le(v(this, ut)), q(this, ut, null)), v(this, Xe) && (Le(v(this, Xe)), q(this, Xe, null)), v(this, Ft) && (Le(v(this, Ft)), q(this, Ft, null)), j && (Ie( /** @type {TemplateNode} */ - v(this, Xr) - ), ls(), qe(Ai())); + v(this, Wr) + ), us(), Ie($i())); var i = !1, s = !1; const a = () => { if (i) { - yu(); + bu(); return; } - i = !0, s && mu(), ln.ensure(), V(this, Ln, 0), v(this, Ot) !== null && Hn(v(this, Ot), () => { - V(this, Ot, null); - }), this.is_pending = this.has_pending_snippet(), V(this, ht, xe(this, ve, fi).call(this, () => (V(this, qn, !1), pt(() => v(this, In).call(this, v(this, nt)))))), v(this, tn) > 0 ? xe(this, ve, ci).call(this) : this.is_pending = !1; + i = !0, s && xu(), ln.ensure(), q(this, qn, 0), v(this, Ft) !== null && Yn(v(this, Ft), () => { + q(this, Ft, null); + }), this.is_pending = this.has_pending_snippet(), q(this, ut, be(this, me, ui).call(this, () => (q(this, Vn, !1), ct(() => v(this, Ln).call(this, v(this, et)))))), v(this, tn) > 0 ? be(this, me, fi).call(this) : this.is_pending = !1; }; wn(() => { try { s = !0, n == null || n(t, a), s = !1; } catch (o) { - vr(o, v(this, Dt) && v(this, Dt).parent); + vr(o, v(this, Ot) && v(this, Ot).parent); } - r && V(this, Ot, xe(this, ve, fi).call(this, () => { - ln.ensure(), V(this, qn, !0); + r && q(this, Ft, be(this, me, ui).call(this, () => { + ln.ensure(), q(this, Vn, !0); try { - return pt(() => { + return ct(() => { r( - v(this, nt), + v(this, et), () => t, () => a ); @@ -774,83 +774,83 @@ class Ru { return vr( o, /** @type {Effect} */ - v(this, Dt).parent + v(this, Ot).parent ), null; } finally { - V(this, qn, !1); + q(this, Vn, !1); } })); }); } } -nt = new WeakMap(), Xr = new WeakMap(), Pt = new WeakMap(), In = new WeakMap(), Dt = new WeakMap(), ht = new WeakMap(), Ue = new WeakMap(), Ot = new WeakMap(), en = new WeakMap(), mn = new WeakMap(), Ln = new WeakMap(), tn = new WeakMap(), lr = new WeakMap(), qn = new WeakMap(), ur = new WeakMap(), fr = new WeakMap(), nn = new WeakMap(), Pi = new WeakMap(), ve = new WeakSet(), ho = function() { +et = new WeakMap(), Wr = new WeakMap(), Dt = new WeakMap(), Ln = new WeakMap(), Ot = new WeakMap(), ut = new WeakMap(), Xe = new WeakMap(), Ft = new WeakMap(), en = new WeakMap(), mn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), lr = new WeakMap(), Vn = new WeakMap(), ur = new WeakMap(), fr = new WeakMap(), nn = new WeakMap(), Mi = new WeakMap(), me = new WeakSet(), vo = function() { try { - V(this, ht, pt(() => v(this, In).call(this, v(this, nt)))); + q(this, ut, ct(() => v(this, Ln).call(this, v(this, et)))); } catch (t) { this.error(t); } -}, po = function() { - const t = v(this, Pt).pending; - t && (V(this, Ue, pt(() => t(v(this, nt)))), wn(() => { - var n = xe(this, ve, hs).call(this); - V(this, ht, xe(this, ve, fi).call(this, () => (ln.ensure(), pt(() => v(this, In).call(this, n))))), v(this, tn) > 0 ? xe(this, ve, ci).call(this) : (Hn( +}, go = function() { + const t = v(this, Dt).pending; + t && (q(this, Xe, ct(() => t(v(this, et)))), wn(() => { + var n = be(this, me, ds).call(this); + q(this, ut, be(this, me, ui).call(this, () => (ln.ensure(), ct(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, me, fi).call(this) : (Yn( /** @type {Effect} */ - v(this, Ue), + v(this, Xe), () => { - V(this, Ue, null); + q(this, Xe, null); } ), this.is_pending = !1); })); -}, hs = function() { - var t = v(this, nt); - return this.is_pending && (V(this, mn, st()), v(this, nt).before(v(this, mn)), t = v(this, mn)), t; +}, ds = function() { + var t = v(this, et); + return this.is_pending && (q(this, mn, rt()), v(this, et).before(v(this, mn)), t = v(this, mn)), t; }, /** * @param {() => Effect | null} fn */ -fi = function(t) { - var n = J, r = Y, i = at; - qt(v(this, Dt)), _t(v(this, Dt)), pr(v(this, Dt).ctx); +ui = function(t) { + var n = J, r = B, i = it; + Vt(v(this, Ot)), pt(v(this, Ot)), pr(v(this, Ot).ctx); try { return t(); } catch (s) { - return io(s), null; + return ao(s), null; } finally { - qt(n), _t(r), pr(i); + Vt(n), pt(r), pr(i); } -}, ci = function() { +}, fi = function() { const t = ( /** @type {(anchor: Node) => void} */ - v(this, Pt).pending + v(this, Dt).pending ); - v(this, ht) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( + v(this, ut) !== null && (q(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ v(this, mn) - ), Po(v(this, ht), v(this, en))), v(this, Ue) === null && V(this, Ue, pt(() => t(v(this, nt)))); + ), Oo(v(this, ut), v(this, en))), v(this, Xe) === null && q(this, Xe, ct(() => t(v(this, et)))); }, /** * Updates the pending count associated with the currently visible pending snippet, * if any, such that we can replace the snippet with content once work is done * @param {1 | -1} d */ -ds = function(t) { +ps = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && xe(n = this.parent, ve, ds).call(n, t); + this.parent && be(n = this.parent, me, ps).call(n, t); return; } - if (V(this, tn, v(this, tn) + t), v(this, tn) === 0) { + if (q(this, tn, v(this, tn) + t), v(this, tn) === 0) { this.is_pending = !1; for (const r of v(this, ur)) - pe(r, Se), bt(r); + ge(r, Ne), $t(r); for (const r of v(this, fr)) - pe(r, At), bt(r); - v(this, ur).clear(), v(this, fr).clear(), v(this, Ue) && Hn(v(this, Ue), () => { - V(this, Ue, null); - }), v(this, en) && (v(this, nt).before(v(this, en)), V(this, en, null)); + ge(r, Et), $t(r); + v(this, ur).clear(), v(this, fr).clear(), v(this, Xe) && Yn(v(this, Xe), () => { + q(this, Xe, null); + }), v(this, en) && (v(this, et).before(v(this, en)), q(this, en, null)); } }; -function Su(e, t, n, r) { - const i = Yi; - var s = e.filter((c) => !c.settled); +function Mu(e, t, n, r) { + const i = Hi; + var s = e.filter((h) => !h.settled); if (n.length === 0 && s.length === 0) { r(t.map(i)); return; @@ -858,52 +858,52 @@ function Su(e, t, n, r) { var a = K, o = ( /** @type {Effect} */ J - ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; - function f(c) { + ), l = Pu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; + function f(h) { l(); try { - r(c); - } catch (d) { - (o.f & on) === 0 && vr(d, o); + r(h); + } catch (p) { + (o.f & on) === 0 && vr(p, o); } - a == null || a.deactivate(), ps(); + a == null || a.deactivate(), vs(); } if (n.length === 0) { u.then(() => f(t.map(i))); return; } - function p() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => vr(c, o)); + function d() { + l(), Promise.all(n.map((h) => /* @__PURE__ */ Du(h))).then((h) => f([...t.map(i), ...h])).catch((h) => vr(h, o)); } - u ? u.then(p) : p(); + u ? u.then(d) : d(); } -function Nu() { - var e = J, t = Y, n = at, r = K; +function Pu() { + var e = J, t = B, n = it, r = K; return function(s = !0) { - qt(e), _t(t), pr(n), s && (r == null || r.activate()); + Vt(e), pt(t), pr(n), s && (r == null || r.activate()); }; } -function ps() { - qt(null), _t(null), pr(null); +function vs() { + Vt(null), pt(null), pr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(e) { - var t = Re | Se, n = Y !== null && (Y.f & Re) !== 0 ? ( +function Hi(e) { + var t = Ce | Ne, n = B !== null && (B.f & Ce) !== 0 ? ( /** @type {Derived} */ - Y + B ) : null; - return J !== null && (J.f |= Kn), { - ctx: at, + return J !== null && (J.f |= jn), { + ctx: it, deps: null, effects: null, - equals: eo, + equals: no, f: t, fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - Te + Re ), wv: 0, parent: n ?? J, @@ -911,12 +911,12 @@ function Yi(e) { }; } // @__NO_SIDE_EFFECTS__ -function ku(e, t, n) { +function Du(e, t, n) { let r = ( /** @type {Effect | null} */ J ); - r === null && ou(); + r === null && fu(); var i = ( /** @type {Boundary} */ r.b @@ -924,79 +924,79 @@ function ku(e, t, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Wn( + ), a = Un( /** @type {V} */ - Te - ), o = !Y, l = /* @__PURE__ */ new Map(); - return zu(() => { - var d; - var u = Ga(); + Re + ), o = !B, l = /* @__PURE__ */ new Map(); + return Bu(() => { + var p; + var u = ja(); s = u.promise; try { Promise.resolve(e()).then(u.resolve, u.reject).then(() => { - f === K && f.committed && f.deactivate(), ps(); + f === K && f.committed && f.deactivate(), vs(); }); - } catch (y) { - u.reject(y), ps(); + } catch (_) { + u.reject(_), vs(); } var f = ( /** @type {Batch} */ K ); if (o) { - var p = i.is_rendered(); - i.update_pending_count(1), f.increment(p), (d = l.get(f)) == null || d.reject(Nn), l.delete(f), l.set(f, u); + var d = i.is_rendered(); + i.update_pending_count(1), f.increment(d), (p = l.get(f)) == null || p.reject(kn), l.delete(f), l.set(f, u); } - const c = (y, x = void 0) => { + const h = (_, x = void 0) => { if (f.activate(), x) - x !== Nn && (a.f |= yn, gr(a, x)); + x !== kn && (a.f |= yn, gr(a, x)); else { - (a.f & yn) !== 0 && (a.f ^= yn), gr(a, y); - for (const [m, b] of l) { - if (l.delete(m), m === f) break; - b.reject(Nn); + (a.f & yn) !== 0 && (a.f ^= yn), gr(a, _); + for (const [y, b] of l) { + if (l.delete(y), y === f) break; + b.reject(kn); } } - o && (i.update_pending_count(-1), f.decrement(p)); + o && (i.update_pending_count(-1), f.decrement(d)); }; - u.promise.then(c, (y) => c(null, y || "unknown")); - }), Lu(() => { + u.promise.then(h, (_) => h(null, _ || "unknown")); + }), zu(() => { for (const u of l.values()) - u.reject(Nn); + u.reject(kn); }), new Promise((u) => { - function f(p) { - function c() { - p === s ? u(a) : f(s); + function f(d) { + function h() { + d === s ? u(a) : f(s); } - p.then(c, c); + d.then(h, h); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function Cn(e) { - const t = /* @__PURE__ */ Yi(e); - return Do(t), t; +function Sn(e) { + const t = /* @__PURE__ */ Hi(e); + return Fo(t), t; } // @__NO_SIDE_EFFECTS__ -function vo(e) { - const t = /* @__PURE__ */ Yi(e); - return t.equals = to, t; +function _o(e) { + const t = /* @__PURE__ */ Hi(e); + return t.equals = ro, t; } -function Mu(e) { +function Ou(e) { var t = e.effects; if (t !== null) { e.effects = null; for (var n = 0; n < t.length; n += 1) - Ve( + Le( /** @type {Effect} */ t[n] ); } } -function Pu(e) { +function Fu(e) { for (var t = e.parent; t !== null; ) { - if ((t.f & Re) === 0) + if ((t.f & Ce) === 0) return (t.f & on) === 0 ? ( /** @type {Effect} */ t @@ -1005,65 +1005,65 @@ function Pu(e) { } return null; } -function Ps(e) { +function Ds(e) { var t, n = J; - qt(Pu(e)); + Vt(Fu(e)); try { - e.f &= ~Xn, Mu(e), t = Lo(e); + e.f &= ~Wn, Ou(e), t = Vo(e); } finally { - qt(n); + Vt(n); } return t; } -function go(e) { - var t = Ps(e); - if (!e.equals(t) && (e.wv = Fo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - pe(e, $e); +function mo(e) { + var t = Ds(e); + if (!e.equals(t) && (e.wv = Lo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + ge(e, Ae); return; } - $n || (Ce !== null ? (Os() || K != null && K.is_fork) && Ce.set(e, t) : Ms(e)); + $n || (Se !== null ? (Fs() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); } -function Du(e) { +function Iu(e) { var t, n; if (e.effects !== null) for (const r of e.effects) - (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(Nn), r.teardown = eu, r.ac = null, Lr(r, 0), qs(r)); + (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(kn), r.teardown = ru, r.ac = null, qr(r, 0), Vs(r)); } -function _o(e) { +function yo(e) { if (e.effects !== null) for (const t of e.effects) t.teardown && _r(t); } -let vs = /* @__PURE__ */ new Set(); +let gs = /* @__PURE__ */ new Set(); const xn = /* @__PURE__ */ new Map(); -let mo = !1; -function Wn(e, t) { +let wo = !1; +function Un(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: e, reactions: null, - equals: eo, + equals: no, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function be(e, t) { - const n = Wn(e); - return Do(n), n; +function $e(e, t) { + const n = Un(e); + return Fo(n), n; } // @__NO_SIDE_EFFECTS__ -function yo(e, t = !1, n = !0) { - const r = Wn(e); - return t || (r.equals = to), r; +function xo(e, t = !1, n = !0) { + const r = Un(e); + return t || (r.equals = ro), r; } -function de(e, t, n = !1) { - Y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function ve(e, t, n = !1) { + B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check // to ensure we error if state is set inside an inspect effect - (!$t || (Y.f & la) !== 0) && no() && (Y.f & (Re | cn | ks | la)) !== 0 && (gt === null || !hr.call(gt, e)) && _u(); - let r = n ? Mn(t) : t; + (!At || (B.f & fa) !== 0) && io() && (B.f & (Ce | cn | Ms | fa)) !== 0 && (dt === null || !hr.call(dt, e)) && wu(); + let r = n ? Pn(t) : t; return gr(e, r); } function gr(e, t) { @@ -1071,61 +1071,61 @@ function gr(e, t) { var n = e.v; $n ? xn.set(e, t) : xn.set(e, n), e.v = t; var r = ln.ensure(); - if (r.capture(e, n), (e.f & Re) !== 0) { + if (r.capture(e, n), (e.f & Ce) !== 0) { const i = ( /** @type {Derived} */ e ); - (e.f & Se) !== 0 && Ps(i), Ms(i); + (e.f & Ne) !== 0 && Ds(i), Ps(i); } - e.wv = Fo(), wo(e, Se), J !== null && (J.f & $e) !== 0 && (J.f & (Et | An)) === 0 && (ct === null ? Bu([e]) : ct.push(e)), !r.is_fork && vs.size > 0 && !mo && Ou(); + e.wv = Lo(), bo(e, Ne), J !== null && (J.f & Ae) !== 0 && (J.f & (Tt | An)) === 0 && (lt === null ? Uu([e]) : lt.push(e)), !r.is_fork && gs.size > 0 && !wo && Lu(); } return t; } -function Ou() { - mo = !1; - for (const e of vs) - (e.f & $e) !== 0 && pe(e, At), Kr(e) && _r(e); - vs.clear(); +function Lu() { + wo = !1; + for (const e of gs) + (e.f & Ae) !== 0 && ge(e, Et), jr(e) && _r(e); + gs.clear(); } -function Fr(e) { - de(e, e.v + 1); +function Ir(e) { + ve(e, e.v + 1); } -function wo(e, t) { +function bo(e, t) { var n = e.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Se) === 0; - if (o && pe(s, t), (a & Re) !== 0) { + var s = n[i], a = s.f, o = (a & Ne) === 0; + if (o && ge(s, t), (a & Ce) !== 0) { var l = ( /** @type {Derived} */ s ); - Ce == null || Ce.delete(l), (a & Xn) === 0 && (a & vt && (s.f |= Xn), wo(l, At)); - } else o && ((a & cn) !== 0 && yt !== null && yt.add( + Se == null || Se.delete(l), (a & Wn) === 0 && (a & ht && (s.f |= Wn), bo(l, Et)); + } else o && ((a & cn) !== 0 && wt !== null && wt.add( /** @type {Effect} */ s - ), bt( + ), $t( /** @type {Effect} */ s )); } } -function Mn(e) { - if (typeof e != "object" || e === null || Dr in e) +function Pn(e) { + if (typeof e != "object" || e === null || Or in e) return e; - const t = Ua(e); - if (t !== Zl && t !== Ql) + const t = Ka(e); + if (t !== tu && t !== nu) return e; - var n = /* @__PURE__ */ new Map(), r = Wa(e), i = /* @__PURE__ */ be(0), s = Yn, a = (o) => { - if (Yn === s) + var n = /* @__PURE__ */ new Map(), r = Ga(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { + if (Bn === s) return o(); - var l = Y, u = Yn; - _t(null), ha(s); + var l = B, u = Bn; + pt(null), pa(s); var f = o(); - return _t(l), ha(u), f; + return pt(l), pa(u), f; }; - return r && n.set("length", /* @__PURE__ */ be( + return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ e.length )), new Proxy( @@ -1133,35 +1133,35 @@ function Mn(e) { e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && mu(); var f = n.get(l); return f === void 0 ? a(() => { - var p = /* @__PURE__ */ be(u.value); - return n.set(l, p), p; - }) : de(f, u.value, !0), !0; + var d = /* @__PURE__ */ $e(u.value); + return n.set(l, d), d; + }) : ve(f, u.value, !0), !0; }, deleteProperty(o, l) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ be(Te)); - n.set(l, f), Fr(i); + const f = a(() => /* @__PURE__ */ $e(Re)); + n.set(l, f), Ir(i); } } else - de(u, Te), Fr(i); + ve(u, Re), Ir(i); return !0; }, get(o, l, u) { - var d; - if (l === Dr) + var p; + if (l === Or) return e; - var f = n.get(l), p = l in o; - if (f === void 0 && (!p || (d = zn(o, l)) != null && d.writable) && (f = a(() => { - var y = Mn(p ? o[l] : Te), x = /* @__PURE__ */ be(y); + var f = n.get(l), d = l in o; + if (f === void 0 && (!d || (p = Hn(o, l)) != null && p.writable) && (f = a(() => { + var _ = Pn(d ? o[l] : Re), x = /* @__PURE__ */ $e(_); return x; }), n.set(l, f)), f !== void 0) { - var c = $(f); - return c === Te ? void 0 : c; + var h = $(f); + return h === Re ? void 0 : h; } return Reflect.get(o, l, u); }, @@ -1171,201 +1171,201 @@ function Mn(e) { var f = n.get(l); f && (u.value = $(f)); } else if (u === void 0) { - var p = n.get(l), c = p == null ? void 0 : p.v; - if (p !== void 0 && c !== Te) + var d = n.get(l), h = d == null ? void 0 : d.v; + if (d !== void 0 && h !== Re) return { enumerable: !0, configurable: !0, - value: c, + value: h, writable: !0 }; } return u; }, has(o, l) { - var c; - if (l === Dr) + var h; + if (l === Or) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Te || Reflect.has(o, l); - if (u !== void 0 || J !== null && (!f || (c = zn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); + if (u !== void 0 || J !== null && (!f || (h = Hn(o, l)) != null && h.writable)) { u === void 0 && (u = a(() => { - var d = f ? Mn(o[l]) : Te, y = /* @__PURE__ */ be(d); - return y; + var p = f ? Pn(o[l]) : Re, _ = /* @__PURE__ */ $e(p); + return _; }), n.set(l, u)); - var p = $(u); - if (p === Te) + var d = $(u); + if (d === Re) return !1; } return f; }, set(o, l, u, f) { - var M; - var p = n.get(l), c = l in o; + var N; + var d = n.get(l), h = l in o; if (r && l === "length") - for (var d = u; d < /** @type {Source} */ - p.v; d += 1) { - var y = n.get(d + ""); - y !== void 0 ? de(y, Te) : d in o && (y = a(() => /* @__PURE__ */ be(Te)), n.set(d + "", y)); + for (var p = u; p < /** @type {Source} */ + d.v; p += 1) { + var _ = n.get(p + ""); + _ !== void 0 ? ve(_, Re) : p in o && (_ = a(() => /* @__PURE__ */ $e(Re)), n.set(p + "", _)); } - if (p === void 0) - (!c || (M = zn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ be(void 0)), de(p, Mn(u)), n.set(l, p)); + if (d === void 0) + (!h || (N = Hn(o, l)) != null && N.writable) && (d = a(() => /* @__PURE__ */ $e(void 0)), ve(d, Pn(u)), n.set(l, d)); else { - c = p.v !== Te; - var x = a(() => Mn(u)); - de(p, x); + h = d.v !== Re; + var x = a(() => Pn(u)); + ve(d, x); } - var m = Reflect.getOwnPropertyDescriptor(o, l); - if (m != null && m.set && m.set.call(f, u), !c) { + var y = Reflect.getOwnPropertyDescriptor(o, l); + if (y != null && y.set && y.set.call(f, u), !h) { if (r && typeof l == "string") { var b = ( /** @type {Source} */ n.get("length") - ), D = Number(l); - Number.isInteger(D) && D >= b.v && de(b, D + 1); + ), O = Number(l); + Number.isInteger(O) && O >= b.v && ve(b, O + 1); } - Fr(i); + Ir(i); } return !0; }, ownKeys(o) { $(i); - var l = Reflect.ownKeys(o).filter((p) => { - var c = n.get(p); - return c === void 0 || c.v !== Te; + var l = Reflect.ownKeys(o).filter((d) => { + var h = n.get(d); + return h === void 0 || h.v !== Re; }); for (var [u, f] of n) - f.v !== Te && !(u in o) && l.push(u); + f.v !== Re && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - gu(); + yu(); } } ); } -var fa, xo, bo, $o; -function gs() { - if (fa === void 0) { - fa = window, xo = /Firefox/.test(navigator.userAgent); +var ha, $o, Ao, Eo; +function _s() { + if (ha === void 0) { + ha = window, $o = /Firefox/.test(navigator.userAgent); var e = Element.prototype, t = Node.prototype, n = Text.prototype; - bo = zn(t, "firstChild").get, $o = zn(t, "nextSibling").get, oa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), oa(n) && (n.__t = void 0); + Ao = Hn(t, "firstChild").get, Eo = Hn(t, "nextSibling").get, ua(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), ua(n) && (n.__t = void 0); } } -function st(e = "") { +function rt(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ function un(e) { return ( /** @type {TemplateNode | null} */ - bo.call(e) + Ao.call(e) ); } // @__NO_SIDE_EFFECTS__ -function zt(e) { +function Ht(e) { return ( /** @type {TemplateNode | null} */ - $o.call(e) + Eo.call(e) ); } -function We(e, t) { +function Be(e, t) { if (!j) return /* @__PURE__ */ un(e); - var n = /* @__PURE__ */ un(B); + var n = /* @__PURE__ */ un(X); if (n === null) - n = B.appendChild(st()); - else if (t && n.nodeType !== Gr) { - var r = st(); - return n == null || n.before(r), qe(r), r; + n = X.appendChild(rt()); + else if (t && n.nodeType !== Kr) { + var r = rt(); + return n == null || n.before(r), Ie(r), r; } - return t && Bi( + return t && Yi( /** @type {Text} */ n - ), qe(n), n; + ), Ie(n), n; } function gn(e, t = !1) { if (!j) { var n = /* @__PURE__ */ un(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ zt(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ht(n) : n; } if (t) { - if ((B == null ? void 0 : B.nodeType) !== Gr) { - var r = st(); - return B == null || B.before(r), qe(r), r; + if ((X == null ? void 0 : X.nodeType) !== Kr) { + var r = rt(); + return X == null || X.before(r), Ie(r), r; } - Bi( + Yi( /** @type {Text} */ - B + X ); } - return B; + return X; } -function et(e, t = 1, n = !1) { - let r = j ? B : e; +function Ze(e, t = 1, n = !1) { + let r = j ? X : e; for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ zt(r); + /* @__PURE__ */ Ht(r); if (!j) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Gr) { - var s = st(); - return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; + if ((r == null ? void 0 : r.nodeType) !== Kr) { + var s = rt(); + return r === null ? i == null || i.after(s) : r.before(s), Ie(s), s; } - Bi( + Yi( /** @type {Text} */ r ); } - return qe(r), r; + return Ie(r), r; } -function Ao(e) { +function To(e) { e.textContent = ""; } -function Eo() { +function Ro() { return !1; } -function Ds(e, t, n) { +function Os(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Xa, e, void 0) + document.createElementNS(Ua, e, void 0) ); } -function Bi(e) { +function Yi(e) { if ( /** @type {string} */ e.nodeValue.length < 65536 ) return; let t = e.nextSibling; - for (; t !== null && t.nodeType === Gr; ) + for (; t !== null && t.nodeType === Kr; ) t.remove(), e.nodeValue += /** @type {string} */ t.nodeValue, t = e.nextSibling; } -function To(e) { - var t = Y, n = J; - _t(null), qt(null); +function So(e) { + var t = B, n = J; + pt(null), Vt(null); try { return e(); } finally { - _t(t), qt(n); + pt(t), Vt(n); } } -function Fu(e) { - J === null && (Y === null && cu(), fu()), $n && uu(); +function qu(e) { + J === null && (B === null && pu(), du()), $n && hu(); } -function Iu(e, t) { +function Vu(e, t) { var n = t.last; n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Ht(e, t, n) { +function Yt(e, t, n) { var r = J; - r !== null && (r.f & it) !== 0 && (e |= it); + r !== null && (r.f & nt) !== 0 && (e |= nt); var i = { - ctx: at, + ctx: it, deps: null, nodes: null, - f: e | Se | vt, + f: e | Ne | ht, first: null, fn: t, last: null, @@ -1381,141 +1381,141 @@ function Ht(e, t, n) { try { _r(i); } catch (o) { - throw Ve(i), o; + throw Le(i), o; } - else t !== null && bt(i); + else t !== null && $t(i); var s = i; if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child - (s.f & Kn) === 0 && (s = s.first, (e & cn) !== 0 && (e & dr) !== 0 && s !== null && (s.f |= dr)), s !== null && (s.parent = r, r !== null && Iu(s, r), Y !== null && (Y.f & Re) !== 0 && (e & An) === 0)) { + (s.f & jn) === 0 && (s = s.first, (e & cn) !== 0 && (e & dr) !== 0 && s !== null && (s.f |= dr)), s !== null && (s.parent = r, r !== null && Vu(s, r), B !== null && (B.f & Ce) !== 0 && (e & An) === 0)) { var a = ( /** @type {Derived} */ - Y + B ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Os() { - return Y !== null && !$t; +function Fs() { + return B !== null && !At; } -function Lu(e) { - const t = Ht(Ii, null, !1); - return pe(t, $e), t.teardown = e, t; +function zu(e) { + const t = Yt(Fi, null, !1); + return ge(t, Ae), t.teardown = e, t; } -function Fs(e) { - Fu(); +function Is(e) { + qu(); var t = ( /** @type {Effect} */ J.f - ), n = !Y && (t & Et) !== 0 && (t & wr) === 0; + ), n = !B && (t & Tt) !== 0 && (t & wr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - at + it ); (r.e ?? (r.e = [])).push(e); } else return Co(e); } function Co(e) { - return Ht(Ir | ru, e, !1); + return Yt(Lr | au, e, !1); } -function qu(e) { +function Hu(e) { ln.ensure(); - const t = Ht(An | Kn, e, !0); + const t = Yt(An | jn, e, !0); return () => { - Ve(t); + Le(t); }; } -function Vu(e) { +function Yu(e) { ln.ensure(); - const t = Ht(An | Kn, e, !0); + const t = Yt(An | jn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? Hn(t, () => { - Ve(t), r(void 0); - }) : (Ve(t), r(void 0)); + n.outro ? Yn(t, () => { + Le(t), r(void 0); + }) : (Le(t), r(void 0)); }); } -function Ro(e) { - return Ht(Ir, e, !1); +function No(e) { + return Yt(Lr, e, !1); } -function zu(e) { - return Ht(ks | Kn, e, !0); +function Bu(e) { + return Yt(Ms | jn, e, !0); } -function Is(e, t = 0) { - return Ht(Ii | t, e, !0); +function Ls(e, t = 0) { + return Yt(Fi | t, e, !0); } function Zt(e, t = [], n = [], r = []) { - Su(r, t, n, (i) => { - Ht(Ii, () => e(...i.map($)), !0); + Mu(r, t, n, (i) => { + Yt(Fi, () => e(...i.map($)), !0); }); } -function Ls(e, t = 0) { - var n = Ht(cn | t, e, !0); +function qs(e, t = 0) { + var n = Yt(cn | t, e, !0); return n; } -function pt(e) { - return Ht(Et | Kn, e, !0); +function ct(e) { + return Yt(Tt | jn, e, !0); } -function So(e) { +function ko(e) { var t = e.teardown; if (t !== null) { - const n = $n, r = Y; - ca(!0), _t(null); + const n = $n, r = B; + da(!0), pt(null); try { t.call(null); } finally { - ca(n), _t(r); + da(n), pt(r); } } } -function qs(e, t = !1) { +function Vs(e, t = !1) { var n = e.first; for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && To(() => { - i.abort(Nn); + i !== null && So(() => { + i.abort(kn); }); var r = n.next; - (n.f & An) !== 0 ? n.parent = null : Ve(n, t), n = r; + (n.f & An) !== 0 ? n.parent = null : Le(n, t), n = r; } } -function Hu(e) { +function Xu(e) { for (var t = e.first; t !== null; ) { var n = t.next; - (t.f & Et) === 0 && Ve(t), t = n; + (t.f & Tt) === 0 && Le(t), t = n; } } -function Ve(e, t = !0) { +function Le(e, t = !0) { var n = !1; - (t || (e.f & Ja) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( + (t || (e.f & Qa) !== 0) && e.nodes !== null && e.nodes.end !== null && (Wu( e.nodes.start, /** @type {TemplateNode} */ e.nodes.end - ), n = !0), qs(e, t && !n), Lr(e, 0), pe(e, on); + ), n = !0), Vs(e, t && !n), qr(e, 0), ge(e, on); var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - So(e); + ko(e); var i = e.parent; - i !== null && i.first !== null && No(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + i !== null && i.first !== null && Mo(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } -function Yu(e, t) { +function Wu(e, t) { for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ zt(e); + var n = e === t ? null : /* @__PURE__ */ Ht(e); e.remove(), e = n; } } -function No(e) { +function Mo(e) { var t = e.parent, n = e.prev, r = e.next; n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n)); } -function Hn(e, t, n = !0) { +function Yn(e, t, n = !0) { var r = []; - ko(e, r, !0); + Po(e, r, !0); var i = () => { - n && Ve(e), t && t(); + n && Le(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,9 +1524,9 @@ function Hn(e, t, n = !0) { } else i(); } -function ko(e, t, n) { - if ((e.f & it) === 0) { - e.f ^= it; +function Po(e, t, n) { + if ((e.f & nt) === 0) { + e.f ^= nt; var r = e.nodes && e.nodes.t; if (r !== null) for (const o of r) @@ -1535,20 +1535,20 @@ function ko(e, t, n) { var s = i.next, a = (i.f & dr) !== 0 || // If this is a branch effect without a block effect parent, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & Et) !== 0 && (e.f & cn) !== 0; - ko(i, t, a ? n : !1), i = s; + (i.f & Tt) !== 0 && (e.f & cn) !== 0; + Po(i, t, a ? n : !1), i = s; } } } -function Vs(e) { - Mo(e, !0); +function zs(e) { + Do(e, !0); } -function Mo(e, t) { - if ((e.f & it) !== 0) { - e.f ^= it, (e.f & $e) === 0 && (pe(e, Se), bt(e)); +function Do(e, t) { + if ((e.f & nt) !== 0) { + e.f ^= nt, (e.f & Ae) === 0 && (ge(e, Ne), $t(e)); for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & dr) !== 0 || (n.f & Et) !== 0; - Mo(n, i ? t : !1), n = r; + var r = n.next, i = (n.f & dr) !== 0 || (n.f & Tt) !== 0; + Do(n, i ? t : !1), n = r; } var s = e.nodes && e.nodes.t; if (s !== null) @@ -1556,187 +1556,187 @@ function Mo(e, t) { (a.is_global || t) && a.in(); } } -function Po(e, t) { +function Oo(e, t) { if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ zt(n); + var i = n === r ? null : /* @__PURE__ */ Ht(n); t.append(n), n = i; } } -let hi = !1, $n = !1; -function ca(e) { +let ci = !1, $n = !1; +function da(e) { $n = e; } -let Y = null, $t = !1; -function _t(e) { - Y = e; +let B = null, At = !1; +function pt(e) { + B = e; } let J = null; -function qt(e) { +function Vt(e) { J = e; } -let gt = null; -function Do(e) { - Y !== null && (gt === null ? gt = [e] : gt.push(e)); +let dt = null; +function Fo(e) { + B !== null && (dt === null ? dt = [e] : dt.push(e)); } -let je = null, tt = 0, ct = null; -function Bu(e) { - ct = e; +let Ge = null, Qe = 0, lt = null; +function Uu(e) { + lt = e; } -let Oo = 1, Pn = 0, Yn = Pn; -function ha(e) { - Yn = e; +let Io = 1, Dn = 0, Bn = Dn; +function pa(e) { + Bn = e; } -function Fo() { - return ++Oo; +function Lo() { + return ++Io; } -function Kr(e) { +function jr(e) { var t = e.f; - if ((t & Se) !== 0) + if ((t & Ne) !== 0) return !0; - if (t & Re && (e.f &= ~Xn), (t & At) !== 0) { + if (t & Ce && (e.f &= ~Wn), (t & Et) !== 0) { for (var n = ( /** @type {Value[]} */ e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Kr( + if (jr( /** @type {Derived} */ s - ) && go( + ) && mo( /** @type {Derived} */ s ), s.wv > e.wv) return !0; } - (t & vt) !== 0 && // During time traveling we don't want to reset the status so that + (t & ht) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Ce === null && pe(e, $e); + Se === null && ge(e, Ae); } return !1; } -function Io(e, t, n = !0) { +function qo(e, t, n = !0) { var r = e.reactions; - if (r !== null && !(gt !== null && hr.call(gt, e))) + if (r !== null && !(dt !== null && hr.call(dt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Re) !== 0 ? Io( + (s.f & Ce) !== 0 ? qo( /** @type {Derived} */ s, t, !1 - ) : t === s && (n ? pe(s, Se) : (s.f & $e) !== 0 && pe(s, At), bt( + ) : t === s && (n ? ge(s, Ne) : (s.f & Ae) !== 0 && ge(s, Et), $t( /** @type {Effect} */ s )); } } -function Lo(e) { +function Vo(e) { var x; - var t = je, n = tt, r = ct, i = Y, s = gt, a = at, o = $t, l = Yn, u = e.f; - je = /** @type {null | Value[]} */ - null, tt = 0, ct = null, Y = (u & (Et | An)) === 0 ? e : null, gt = null, pr(e.ctx), $t = !1, Yn = ++Pn, e.ac !== null && (To(() => { - e.ac.abort(Nn); + var t = Ge, n = Qe, r = lt, i = B, s = dt, a = it, o = At, l = Bn, u = e.f; + Ge = /** @type {null | Value[]} */ + null, Qe = 0, lt = null, B = (u & (Tt | An)) === 0 ? e : null, dt = null, pr(e.ctx), At = !1, Bn = ++Dn, e.ac !== null && (So(() => { + e.ac.abort(kn); }), e.ac = null); try { - e.f |= os; + e.f |= ls; var f = ( /** @type {Function} */ e.fn - ), p = f(); + ), d = f(); e.f |= wr; - var c = e.deps, d = K == null ? void 0 : K.is_fork; - if (je !== null) { - var y; - if (d || Lr(e, tt), c !== null && tt > 0) - for (c.length = tt + je.length, y = 0; y < je.length; y++) - c[tt + y] = je[y]; + var h = e.deps, p = K == null ? void 0 : K.is_fork; + if (Ge !== null) { + var _; + if (p || qr(e, Qe), h !== null && Qe > 0) + for (h.length = Qe + Ge.length, _ = 0; _ < Ge.length; _++) + h[Qe + _] = Ge[_]; else - e.deps = c = je; - if (Os() && (e.f & vt) !== 0) - for (y = tt; y < c.length; y++) - ((x = c[y]).reactions ?? (x.reactions = [])).push(e); - } else !d && c !== null && tt < c.length && (Lr(e, tt), c.length = tt); - if (no() && ct !== null && !$t && c !== null && (e.f & (Re | At | Se)) === 0) - for (y = 0; y < /** @type {Source[]} */ - ct.length; y++) - Io( - ct[y], + e.deps = h = Ge; + if (Fs() && (e.f & ht) !== 0) + for (_ = Qe; _ < h.length; _++) + ((x = h[_]).reactions ?? (x.reactions = [])).push(e); + } else !p && h !== null && Qe < h.length && (qr(e, Qe), h.length = Qe); + if (io() && lt !== null && !At && h !== null && (e.f & (Ce | Et | Ne)) === 0) + for (_ = 0; _ < /** @type {Source[]} */ + lt.length; _++) + qo( + lt[_], /** @type {Effect} */ e ); if (i !== null && i !== e) { - if (Pn++, i.deps !== null) - for (let m = 0; m < n; m += 1) - i.deps[m].rv = Pn; + if (Dn++, i.deps !== null) + for (let y = 0; y < n; y += 1) + i.deps[y].rv = Dn; if (t !== null) - for (const m of t) - m.rv = Pn; - ct !== null && (r === null ? r = ct : r.push(.../** @type {Source[]} */ - ct)); + for (const y of t) + y.rv = Dn; + lt !== null && (r === null ? r = lt : r.push(.../** @type {Source[]} */ + lt)); } - return (e.f & yn) !== 0 && (e.f ^= yn), p; - } catch (m) { - return io(m); + return (e.f & yn) !== 0 && (e.f ^= yn), d; + } catch (y) { + return ao(y); } finally { - e.f ^= os, je = t, tt = n, ct = r, Y = i, gt = s, pr(a), $t = o, Yn = l; + e.f ^= ls, Ge = t, Qe = n, lt = r, B = i, dt = s, pr(a), At = o, Bn = l; } } -function Xu(e, t) { +function Gu(e, t) { let n = t.reactions; if (n !== null) { - var r = jl.call(n, e); + var r = Ql.call(n, e); if (r !== -1) { var i = n.length - 1; i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (t.f & Re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Ce) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it - (je === null || !hr.call(je, t))) { + (Ge === null || !hr.call(Ge, t))) { var s = ( /** @type {Derived} */ t ); - (s.f & vt) !== 0 && (s.f ^= vt, s.f &= ~Xn), Ms(s), Du(s), Lr(s, 0); + (s.f & ht) !== 0 && (s.f ^= ht, s.f &= ~Wn), Ps(s), Iu(s), qr(s, 0); } } -function Lr(e, t) { +function qr(e, t) { var n = e.deps; if (n !== null) for (var r = t; r < n.length; r++) - Xu(e, n[r]); + Gu(e, n[r]); } function _r(e) { var t = e.f; if ((t & on) === 0) { - pe(e, $e); - var n = J, r = hi; - J = e, hi = !0; + ge(e, Ae); + var n = J, r = ci; + J = e, ci = !0; try { - (t & (cn | Ka)) !== 0 ? Hu(e) : qs(e), So(e); - var i = Lo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Oo; + (t & (cn | Ja)) !== 0 ? Xu(e) : Vs(e), ko(e); + var i = Vo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Io; var s; - as && xu && (e.f & Se) !== 0 && e.deps; + os && Au && (e.f & Ne) !== 0 && e.deps; } finally { - hi = r, J = n; + ci = r, J = n; } } } function $(e) { - var t = e.f, n = (t & Re) !== 0; - if (Y !== null && !$t) { + var t = e.f, n = (t & Ce) !== 0; + if (B !== null && !At) { var r = J !== null && (J.f & on) !== 0; - if (!r && (gt === null || !hr.call(gt, e))) { - var i = Y.deps; - if ((Y.f & os) !== 0) - e.rv < Pn && (e.rv = Pn, je === null && i !== null && i[tt] === e ? tt++ : je === null ? je = [e] : je.push(e)); + if (!r && (dt === null || !hr.call(dt, e))) { + var i = B.deps; + if ((B.f & ls) !== 0) + e.rv < Dn && (e.rv = Dn, Ge === null && i !== null && i[Qe] === e ? Qe++ : Ge === null ? Ge = [e] : Ge.push(e)); else { - (Y.deps ?? (Y.deps = [])).push(e); + (B.deps ?? (B.deps = [])).push(e); var s = e.reactions; - s === null ? e.reactions = [Y] : hr.call(s, Y) || s.push(Y); + s === null ? e.reactions = [B] : hr.call(s, B) || s.push(B); } } } @@ -1749,66 +1749,66 @@ function $(e) { ); if ($n) { var o = a.v; - return ((a.f & $e) === 0 && a.reactions !== null || Vo(a)) && (o = Ps(a)), xn.set(a, o), o; + return ((a.f & Ae) === 0 && a.reactions !== null || Ho(a)) && (o = Ds(a)), xn.set(a, o), o; } - var l = (a.f & vt) === 0 && !$t && Y !== null && (hi || (Y.f & vt) !== 0), u = (a.f & wr) === 0; - Kr(a) && (l && (a.f |= vt), go(a)), l && !u && (_o(a), qo(a)); + var l = (a.f & ht) === 0 && !At && B !== null && (ci || (B.f & ht) !== 0), u = (a.f & wr) === 0; + jr(a) && (l && (a.f |= ht), mo(a)), l && !u && (yo(a), zo(a)); } - if (Ce != null && Ce.has(e)) - return Ce.get(e); + if (Se != null && Se.has(e)) + return Se.get(e); if ((e.f & yn) !== 0) throw e.v; return e.v; } -function qo(e) { - if (e.f |= vt, e.deps !== null) +function zo(e) { + if (e.f |= ht, e.deps !== null) for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Re) !== 0 && (t.f & vt) === 0 && (_o( + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ce) !== 0 && (t.f & ht) === 0 && (yo( /** @type {Derived} */ t - ), qo( + ), zo( /** @type {Derived} */ t )); } -function Vo(e) { - if (e.v === Te) return !0; +function Ho(e) { + if (e.v === Re) return !0; if (e.deps === null) return !1; for (const t of e.deps) - if (xn.has(t) || (t.f & Re) !== 0 && Vo( + if (xn.has(t) || (t.f & Ce) !== 0 && Ho( /** @type {Derived} */ t )) return !0; return !1; } -function Xi(e) { - var t = $t; +function Bi(e) { + var t = At; try { - return $t = !0, e(); + return At = !0, e(); } finally { - $t = t; + At = t; } } -const zo = /* @__PURE__ */ new Set(), _s = /* @__PURE__ */ new Set(); -function Wu(e) { +const Yo = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); +function Ku(e) { for (var t = 0; t < e.length; t++) - zo.add(e[t]); - for (var n of _s) + Yo.add(e[t]); + for (var n of ms) n(e); } -let da = null; -function pa(e) { - var m; +let va = null; +function ga(e) { + var y; var t = this, n = ( /** @type {Node} */ t.ownerDocument - ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( + ), r = e.type, i = ((y = e.composedPath) == null ? void 0 : y.call(e)) || [], s = ( /** @type {null | Element} */ i[0] || e.target ); - da = e; - var a = 0, o = da === e && e.__root; + va = e; + var a = 0, o = va === e && e.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (t === document || t === /** @type {any} */ @@ -1823,17 +1823,17 @@ function pa(e) { } if (s = /** @type {Element} */ i[a] || e.target, s !== t) { - $i(e, "currentTarget", { + bi(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, p = J; - _t(null), qt(null); + var f = B, d = J; + pt(null), Vt(null); try { - for (var c, d = []; s !== null; ) { - var y = s.assignedSlot || s.parentNode || /** @type {any} */ + for (var h, p = []; s !== null; ) { + var _ = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { var x = s["__" + r]; @@ -1842,41 +1842,41 @@ function pa(e) { // -> the target could not have been disabled because it emits the event in the first place e.target === s) && x.call(s, e); } catch (b) { - c ? d.push(b) : c = b; + h ? p.push(b) : h = b; } - if (e.cancelBubble || y === t || y === null) + if (e.cancelBubble || _ === t || _ === null) break; - s = y; + s = _; } - if (c) { - for (let b of d) + if (h) { + for (let b of p) queueMicrotask(() => { throw b; }); - throw c; + throw h; } } finally { - e.__root = t, delete e.currentTarget, _t(f), qt(p); + e.__root = t, delete e.currentTarget, pt(f), Vt(d); } } } -var Ha, Ya; -const es = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( +var Ba, Xa; +const ts = (Xa = (Ba = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ba.trustedTypes) == null ? void 0 : /* @__PURE__ */ Xa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (e) => e } ); -function Uu(e) { +function ju(e) { return ( /** @type {string} */ - (es == null ? void 0 : es.createHTML(e)) ?? e + (ts == null ? void 0 : ts.createHTML(e)) ?? e ); } -function Ho(e, t = !1) { - var n = Ds("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; +function Bo(e, t = !1) { + var n = Os("template"); + return e = e.replaceAll("", ""), n.innerHTML = t ? ju(e) : e, n.content; } function bn(e, t) { var n = ( @@ -1886,16 +1886,16 @@ function bn(e, t) { n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Yt(e, t) { - var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); +function Bt(e, t) { + var n = (t & Jl) !== 0, r = (t & Zl) !== 0, i, s = !e.startsWith(""); return () => { if (j) - return bn(B, null), B; - i === void 0 && (i = Ho(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + return bn(X, null), X; + i === void 0 && (i = Bo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ un(i))); var a = ( /** @type {TemplateNode} */ - r || xo ? document.importNode(i, !0) : i.cloneNode(!0) + r || $o ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( @@ -1912,15 +1912,15 @@ function Yt(e, t) { }; } // @__NO_SIDE_EFFECTS__ -function Gu(e, t, n = "svg") { +function Ju(e, t, n = "svg") { var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { if (j) - return bn(B, null), B; + return bn(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - Ho(i, !0) + Bo(i, !0) ), o = ( /** @type {Element} */ /* @__PURE__ */ un(a) @@ -1936,27 +1936,27 @@ function Gu(e, t, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Ku(e, t) { - return /* @__PURE__ */ Gu(e, t, "svg"); +function Zu(e, t) { + return /* @__PURE__ */ Ju(e, t, "svg"); } -function va(e = "") { +function _a(e = "") { if (!j) { - var t = st(e + ""); + var t = rt(e + ""); return bn(t, t), t; } - var n = B; - return n.nodeType !== Gr ? (n.before(n = st()), qe(n)) : Bi( + var n = X; + return n.nodeType !== Kr ? (n.before(n = rt()), Ie(n)) : Yi( /** @type {Text} */ n ), bn(n, n), n; } -function Ge(e, t) { +function We(e, t) { if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ J ); - ((n.f & wr) === 0 || n.nodes.end === null) && (n.nodes.end = B), qi(); + ((n.f & wr) === 0 || n.nodes.end === null) && (n.nodes.end = X), Li(); return; } e !== null && e.before( @@ -1964,119 +1964,119 @@ function Ge(e, t) { t ); } -const ju = ["touchstart", "touchmove"]; -function Ju(e) { - return ju.includes(e); +const Qu = ["touchstart", "touchmove"]; +function ef(e) { + return Qu.includes(e); } function _n(e, t) { var n = t == null ? "" : typeof t == "object" ? t + "" : t; n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + ""); } -function Yo(e, t) { - return Bo(e, t); +function Xo(e, t) { + return Wo(e, t); } -function Zu(e, t) { - gs(), t.intro = t.intro ?? !1; - const n = t.target, r = j, i = B; +function tf(e, t) { + _s(), t.intro = t.intro ?? !1; + const n = t.target, r = j, i = X; try { for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== xr || /** @type {Comment} */ - s.data !== Ss); ) - s = /* @__PURE__ */ zt(s); + s.data !== Ns); ) + s = /* @__PURE__ */ Ht(s); if (!s) throw cr; - an(!0), qe( + an(!0), Ie( /** @type {Comment} */ s ); - const a = Bo(e, { ...t, anchor: s }); + const a = Wo(e, { ...t, anchor: s }); return an(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== cr && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), gs(), Ao(n), an(!1), Yo(e, t); + return a !== cr && console.warn("Failed to hydrate: ", a), t.recover === !1 && gu(), _s(), To(n), an(!1), Xo(e, t); } finally { - an(r), qe(i); - } -} -const ri = /* @__PURE__ */ new Map(); -function Bo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - gs(); - var o = /* @__PURE__ */ new Set(), l = (p) => { - for (var c = 0; c < p.length; c++) { - var d = p[c]; - if (!o.has(d)) { - o.add(d); - var y = Ju(d); + an(r), Ie(i); + } +} +const ni = /* @__PURE__ */ new Map(); +function Wo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + _s(); + var o = /* @__PURE__ */ new Set(), l = (d) => { + for (var h = 0; h < d.length; h++) { + var p = d[h]; + if (!o.has(p)) { + o.add(p); + var _ = ef(p); for (const b of [t, document]) { - var x = ri.get(b); - x === void 0 && (x = /* @__PURE__ */ new Map(), ri.set(b, x)); - var m = x.get(d); - m === void 0 ? (b.addEventListener(d, pa, { passive: y }), x.set(d, 1)) : x.set(d, m + 1); + var x = ni.get(b); + x === void 0 && (x = /* @__PURE__ */ new Map(), ni.set(b, x)); + var y = x.get(p); + y === void 0 ? (b.addEventListener(p, ga, { passive: _ }), x.set(p, 1)) : x.set(p, y + 1); } } } }; - l(Fi(zo)), _s.add(l); - var u = void 0, f = Vu(() => { - var p = n ?? t.appendChild(st()); - return Cu( + l(Oi(Yo)), ms.add(l); + var u = void 0, f = Yu(() => { + var d = n ?? t.appendChild(rt()); + return Nu( /** @type {TemplateNode} */ - p, + d, { pending: () => { } }, - (c) => { - Vi({}); - var d = ( + (h) => { + qi({}); + var p = ( /** @type {ComponentContext} */ - at + it ); - if (s && (d.c = s), i && (r.$$events = i), j && bn( + if (s && (p.c = s), i && (r.$$events = i), j && bn( /** @type {TemplateNode} */ - c, + h, null - ), u = e(c, r) || {}, j && (J.nodes.end = B, B === null || B.nodeType !== xr || /** @type {Comment} */ - B.data !== Ns)) - throw Li(), cr; - zi(); + ), u = e(h, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== xr || /** @type {Comment} */ + X.data !== ks)) + throw Ii(), cr; + Vi(); } ), () => { var x; - for (var c of o) - for (const m of [t, document]) { - var d = ( + for (var h of o) + for (const y of [t, document]) { + var p = ( /** @type {Map} */ - ri.get(m) - ), y = ( + ni.get(y) + ), _ = ( /** @type {number} */ - d.get(c) + p.get(h) ); - --y == 0 ? (m.removeEventListener(c, pa), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); + --_ == 0 ? (y.removeEventListener(h, ga), p.delete(h), p.size === 0 && ni.delete(y)) : p.set(h, _); } - _s.delete(l), p !== n && ((x = p.parentNode) == null || x.removeChild(p)); + ms.delete(l), d !== n && ((x = d.parentNode) == null || x.removeChild(d)); }; }); - return ms.set(u, f), u; + return ys.set(u, f), u; } -let ms = /* @__PURE__ */ new WeakMap(); -function Qu(e, t) { - const n = ms.get(e); - return n ? (ms.delete(e), n(t)) : Promise.resolve(); +let ys = /* @__PURE__ */ new WeakMap(); +function nf(e, t) { + const n = ys.get(e); + return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var wt, Ft, rt, Vn, Wr, Ur, Di; -class ef { +var xt, It, tt, zn, Ur, Gr, Pi; +class rf { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(t, n = !0) { /** @type {TemplateNode} */ - he(this, "anchor"); + pe(this, "anchor"); /** @type {Map} */ - H(this, wt, /* @__PURE__ */ new Map()); + z(this, xt, /* @__PURE__ */ new Map()); /** * Map of keys to effects that are currently rendered in the DOM. * These effects are visible and actively part of the document tree. @@ -2091,69 +2091,69 @@ class ef { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Ft, /* @__PURE__ */ new Map()); + z(this, It, /* @__PURE__ */ new Map()); /** * Similar to #onscreen with respect to the keys, but contains branches that are not yet * in the DOM, because their insertion is deferred. * @type {Map} */ - H(this, rt, /* @__PURE__ */ new Map()); + z(this, tt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - H(this, Vn, /* @__PURE__ */ new Set()); + z(this, zn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - H(this, Wr, !0); - H(this, Ur, () => { + z(this, Ur, !0); + z(this, Gr, () => { var t = ( /** @type {Batch} */ K ); - if (v(this, wt).has(t)) { + if (v(this, xt).has(t)) { var n = ( /** @type {Key} */ - v(this, wt).get(t) - ), r = v(this, Ft).get(n); + v(this, xt).get(t) + ), r = v(this, It).get(n); if (r) - Vs(r), v(this, Vn).delete(n); + zs(r), v(this, zn).delete(n); else { - var i = v(this, rt).get(n); - i && (v(this, Ft).set(n, i.effect), v(this, rt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, tt).get(n); + i && (v(this, It).set(n, i.effect), v(this, tt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, wt)) { - if (v(this, wt).delete(s), s === t) + for (const [s, a] of v(this, xt)) { + if (v(this, xt).delete(s), s === t) break; - const o = v(this, rt).get(a); - o && (Ve(o.effect), v(this, rt).delete(a)); + const o = v(this, tt).get(a); + o && (Le(o.effect), v(this, tt).delete(a)); } - for (const [s, a] of v(this, Ft)) { - if (s === n || v(this, Vn).has(s)) continue; + for (const [s, a] of v(this, It)) { + if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, wt).values()).includes(s)) { + if (Array.from(v(this, xt).values()).includes(s)) { var u = document.createDocumentFragment(); - Po(a, u), u.append(st()), v(this, rt).set(s, { effect: a, fragment: u }); + Oo(a, u), u.append(rt()), v(this, tt).set(s, { effect: a, fragment: u }); } else - Ve(a); - v(this, Vn).delete(s), v(this, Ft).delete(s); + Le(a); + v(this, zn).delete(s), v(this, It).delete(s); }; - v(this, Wr) || !r ? (v(this, Vn).add(s), Hn(a, o, !1)) : o(); + v(this, Ur) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - H(this, Di, (t) => { - v(this, wt).delete(t); - const n = Array.from(v(this, wt).values()); - for (const [r, i] of v(this, rt)) - n.includes(r) || (Ve(i.effect), v(this, rt).delete(r)); + z(this, Pi, (t) => { + v(this, xt).delete(t); + const n = Array.from(v(this, xt).values()); + for (const [r, i] of v(this, tt)) + n.includes(r) || (Le(i.effect), v(this, tt).delete(r)); }); - this.anchor = t, V(this, Wr, n); + this.anchor = t, q(this, Ur, n); } /** * @@ -2164,33 +2164,33 @@ class ef { var r = ( /** @type {Batch} */ K - ), i = Eo(); - if (n && !v(this, Ft).has(t) && !v(this, rt).has(t)) + ), i = Ro(); + if (n && !v(this, It).has(t) && !v(this, tt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = st(); - s.append(a), v(this, rt).set(t, { - effect: pt(() => n(a)), + var s = document.createDocumentFragment(), a = rt(); + s.append(a), v(this, tt).set(t, { + effect: ct(() => n(a)), fragment: s }); } else - v(this, Ft).set( + v(this, It).set( t, - pt(() => n(this.anchor)) + ct(() => n(this.anchor)) ); - if (v(this, wt).set(r, t), i) { - for (const [o, l] of v(this, Ft)) + if (v(this, xt).set(r, t), i) { + for (const [o, l] of v(this, It)) o === t ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, rt)) + for (const [o, l] of v(this, tt)) o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Ur)), r.ondiscard(v(this, Di)); + r.oncommit(v(this, Gr)), r.ondiscard(v(this, Pi)); } else - j && (this.anchor = B), v(this, Ur).call(this); + j && (this.anchor = X), v(this, Gr).call(this); } } -wt = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), Vn = new WeakMap(), Wr = new WeakMap(), Ur = new WeakMap(), Di = new WeakMap(); -function tf(e) { - at === null && au(), Fs(() => { - const t = Xi(e); +xt = new WeakMap(), It = new WeakMap(), tt = new WeakMap(), zn = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), Pi = new WeakMap(); +function sf(e) { + it === null && uu(), Is(() => { + const t = Bi(e); if (typeof t == "function") return ( /** @type {() => void} */ t @@ -2198,43 +2198,43 @@ function tf(e) { }); } function tr(e, t, n = !1) { - j && qi(); - var r = new ef(e), i = n ? dr : 0; + j && Li(); + var r = new rf(e), i = n ? dr : 0; function s(a, o) { if (j) { - const f = Qa(e); + const f = to(e); var l; - if (f === Ss ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = Ai(); - qe(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); + if (f === Ns ? l = 0 : f === Di ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = $i(); + Ie(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); return; } } r.ensure(a, o); } - Ls(() => { + qs(() => { var a = !1; t((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function di(e, t) { +function hi(e, t) { return t; } -function nf(e, t, n) { +function af(e, t, n) { for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { - let p = t[o]; - Hn( - p, + let d = t[o]; + Yn( + d, () => { if (s) { - if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { - var c = ( + if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { + var h = ( /** @type {Set} */ e.outrogroups ); - ys(Fi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); + ws(Oi(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2252,168 +2252,168 @@ function nf(e, t, n) { /** @type {Element} */ u.parentNode ); - Ao(f), f.append(u), e.items.clear(); + To(f), f.append(u), e.items.clear(); } - ys(t, !l); + ws(t, !l); } else s = { pending: new Set(t), done: /* @__PURE__ */ new Set() }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ys(e, t = !0) { +function ws(e, t = !0) { for (var n = 0; n < e.length; n++) - Ve(e[n], t); + Le(e[n], t); } -var ga; -function pi(e, t, n, r, i, s = null) { - var a = e, o = /* @__PURE__ */ new Map(), l = (t & Ba) !== 0; +var ma; +function di(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & Wa) !== 0; if (l) { var u = ( /** @type {Element} */ e ); - a = j ? qe(/* @__PURE__ */ un(u)) : u.appendChild(st()); + a = j ? Ie(/* @__PURE__ */ un(u)) : u.appendChild(rt()); } - j && qi(); - var f = null, p = /* @__PURE__ */ vo(() => { + j && Li(); + var f = null, d = /* @__PURE__ */ _o(() => { var b = n(); - return Wa(b) ? b : b == null ? [] : Fi(b); - }), c, d = !0; - function y() { - m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & sn) === 0 ? Vs(f) : (f.f ^= sn, Nr(f, null, a)) : Hn(f, () => { + return Ga(b) ? b : b == null ? [] : Oi(b); + }), h, p = !0; + function _() { + y.fallback = f, of(y, h, a, t, r), f !== null && (h.length === 0 ? (f.f & sn) === 0 ? zs(f) : (f.f ^= sn, kr(f, null, a)) : Yn(f, () => { f = null; })); } - var x = Ls(() => { - c = /** @type {V[]} */ - $(p); - var b = c.length; - let D = !1; + var x = qs(() => { + h = /** @type {V[]} */ + $(d); + var b = h.length; + let O = !1; if (j) { - var M = Qa(a) === Oi; - M !== (b === 0) && (a = Ai(), qe(a), an(!1), D = !0); + var N = to(a) === Di; + N !== (b === 0) && (a = $i(), Ie(a), an(!1), O = !0); } - for (var S = /* @__PURE__ */ new Set(), I = ( + for (var M = /* @__PURE__ */ new Set(), F = ( /** @type {Batch} */ K - ), q = Eo(), X = 0; X < b; X += 1) { - j && B.nodeType === xr && /** @type {Comment} */ - B.data === Ns && (a = /** @type {Comment} */ - B, D = !0, an(!1)); - var se = c[X], Q = r(se, X), W = d ? null : o.get(Q); - W ? (W.v && gr(W.v, se), W.i && gr(W.i, X), q && I.unskip_effect(W.e)) : (W = sf( + ), W = Ro(), I = 0; I < b; I += 1) { + j && X.nodeType === xr && /** @type {Comment} */ + X.data === ks && (a = /** @type {Comment} */ + X, O = !0, an(!1)); + var ee = h[I], fe = r(ee, I), U = p ? null : o.get(fe); + U ? (U.v && gr(U.v, ee), U.i && gr(U.i, I), W && F.unskip_effect(U.e)) : (U = lf( o, - d ? a : ga ?? (ga = st()), - se, - Q, - X, + p ? a : ma ?? (ma = rt()), + ee, + fe, + I, i, t, n - ), d || (W.e.f |= sn), o.set(Q, W)), S.add(Q); + ), p || (U.e.f |= sn), o.set(fe, U)), M.add(fe); } - if (b === 0 && s && !f && (d ? f = pt(() => s(a)) : (f = pt(() => s(ga ?? (ga = st()))), f.f |= sn)), b > S.size && lu(), j && b > 0 && qe(Ai()), !d) - if (q) { - for (const [ae, ue] of o) - S.has(ae) || I.skip_effect(ue.e); - I.oncommit(y), I.ondiscard(() => { + if (b === 0 && s && !f && (p ? f = ct(() => s(a)) : (f = ct(() => s(ma ?? (ma = rt()))), f.f |= sn)), b > M.size && cu(), j && b > 0 && Ie($i()), !p) + if (W) { + for (const [re, le] of o) + M.has(re) || F.skip_effect(le.e); + F.oncommit(_), F.ondiscard(() => { }); } else - y(); - D && an(!0), $(p); - }), m = { effect: x, items: o, outrogroups: null, fallback: f }; - d = !1, j && (a = B); + _(); + O && an(!0), $(d); + }), y = { effect: x, items: o, outrogroups: null, fallback: f }; + p = !1, j && (a = X); } -function Rr(e) { - for (; e !== null && (e.f & Et) === 0; ) +function Cr(e) { + for (; e !== null && (e.f & Tt) === 0; ) e = e.next; return e; } -function rf(e, t, n, r, i) { - var W, ae, ue, O, F, Ne, lt, ce, Ae; - var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Rr(e.effect.first), u, f = null, p, c = [], d = [], y, x, m, b; +function of(e, t, n, r, i) { + var U, re, le, D, H, te, je, qe, de; + var s = (r & Xl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, d, h = [], p = [], _, x, y, b; if (s) for (b = 0; b < a; b += 1) - y = t[b], x = i(y, b), m = /** @type {EachItem} */ - o.get(x).e, (m.f & sn) === 0 && ((ae = (W = m.nodes) == null ? void 0 : W.a) == null || ae.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + _ = t[b], x = i(_, b), y = /** @type {EachItem} */ + o.get(x).e, (y.f & sn) === 0 && ((re = (U = y.nodes) == null ? void 0 : U.a) == null || re.measure(), (d ?? (d = /* @__PURE__ */ new Set())).add(y)); for (b = 0; b < a; b += 1) { - if (y = t[b], x = i(y, b), m = /** @type {EachItem} */ + if (_ = t[b], x = i(_, b), y = /** @type {EachItem} */ o.get(x).e, e.outrogroups !== null) - for (const ee of e.outrogroups) - ee.pending.delete(m), ee.done.delete(m); - if ((m.f & sn) !== 0) - if (m.f ^= sn, m === l) - Nr(m, null, n); + for (const ce of e.outrogroups) + ce.pending.delete(y), ce.done.delete(y); + if ((y.f & sn) !== 0) + if (y.f ^= sn, y === l) + kr(y, null, n); else { - var D = f ? f.next : l; - m === e.effect.last && (e.effect.last = m.prev), m.prev && (m.prev.next = m.next), m.next && (m.next.prev = m.prev), vn(e, f, m), vn(e, m, D), Nr(m, D, n), f = m, c = [], d = [], l = Rr(f.next); + var O = f ? f.next : l; + y === e.effect.last && (e.effect.last = y.prev), y.prev && (y.prev.next = y.next), y.next && (y.next.prev = y.prev), vn(e, f, y), vn(e, y, O), kr(y, O, n), f = y, h = [], p = [], l = Cr(f.next); continue; } - if ((m.f & it) !== 0 && (Vs(m), s && ((O = (ue = m.nodes) == null ? void 0 : ue.a) == null || O.unfix(), (p ?? (p = /* @__PURE__ */ new Set())).delete(m))), m !== l) { - if (u !== void 0 && u.has(m)) { - if (c.length < d.length) { - var M = d[0], S; - f = M.prev; - var I = c[0], q = c[c.length - 1]; - for (S = 0; S < c.length; S += 1) - Nr(c[S], M, n); - for (S = 0; S < d.length; S += 1) - u.delete(d[S]); - vn(e, I.prev, q.next), vn(e, f, I), vn(e, q, M), l = M, f = q, b -= 1, c = [], d = []; + if ((y.f & nt) !== 0 && (zs(y), s && ((D = (le = y.nodes) == null ? void 0 : le.a) == null || D.unfix(), (d ?? (d = /* @__PURE__ */ new Set())).delete(y))), y !== l) { + if (u !== void 0 && u.has(y)) { + if (h.length < p.length) { + var N = p[0], M; + f = N.prev; + var F = h[0], W = h[h.length - 1]; + for (M = 0; M < h.length; M += 1) + kr(h[M], N, n); + for (M = 0; M < p.length; M += 1) + u.delete(p[M]); + vn(e, F.prev, W.next), vn(e, f, F), vn(e, W, N), l = N, f = W, b -= 1, h = [], p = []; } else - u.delete(m), Nr(m, l, n), vn(e, m.prev, m.next), vn(e, m, f === null ? e.effect.first : f.next), vn(e, f, m), f = m; + u.delete(y), kr(y, l, n), vn(e, y.prev, y.next), vn(e, y, f === null ? e.effect.first : f.next), vn(e, f, y), f = y; continue; } - for (c = [], d = []; l !== null && l !== m; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Rr(l.next); + for (h = [], p = []; l !== null && l !== y; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Cr(l.next); if (l === null) continue; } - (m.f & sn) === 0 && c.push(m), f = m, l = Rr(m.next); + (y.f & sn) === 0 && h.push(y), f = y, l = Cr(y.next); } if (e.outrogroups !== null) { - for (const ee of e.outrogroups) - ee.pending.size === 0 && (ys(Fi(ee.done)), (F = e.outrogroups) == null || F.delete(ee)); + for (const ce of e.outrogroups) + ce.pending.size === 0 && (ws(Oi(ce.done)), (H = e.outrogroups) == null || H.delete(ce)); e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var X = []; + var I = []; if (u !== void 0) - for (m of u) - (m.f & it) === 0 && X.push(m); + for (y of u) + (y.f & nt) === 0 && I.push(y); for (; l !== null; ) - (l.f & it) === 0 && l !== e.fallback && X.push(l), l = Rr(l.next); - var se = X.length; - if (se > 0) { - var Q = (r & Ba) !== 0 && a === 0 ? n : null; + (l.f & nt) === 0 && l !== e.fallback && I.push(l), l = Cr(l.next); + var ee = I.length; + if (ee > 0) { + var fe = (r & Wa) !== 0 && a === 0 ? n : null; if (s) { - for (b = 0; b < se; b += 1) - (lt = (Ne = X[b].nodes) == null ? void 0 : Ne.a) == null || lt.measure(); - for (b = 0; b < se; b += 1) - (Ae = (ce = X[b].nodes) == null ? void 0 : ce.a) == null || Ae.fix(); + for (b = 0; b < ee; b += 1) + (je = (te = I[b].nodes) == null ? void 0 : te.a) == null || je.measure(); + for (b = 0; b < ee; b += 1) + (de = (qe = I[b].nodes) == null ? void 0 : qe.a) == null || de.fix(); } - nf(e, X, Q); + af(e, I, fe); } } s && wn(() => { - var ee, Oe; - if (p !== void 0) - for (m of p) - (Oe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Oe.apply(); + var ce, _e; + if (d !== void 0) + for (y of d) + (_e = (ce = y.nodes) == null ? void 0 : ce.a) == null || _e.apply(); }); } -function sf(e, t, n, r, i, s, a, o) { - var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ yo(n, !1, !1) : Wn(n) : null, u = (a & zl) !== 0 ? Wn(i) : null; +function lf(e, t, n, r, i, s, a, o) { + var l = (a & Yl) !== 0 ? (a & Wl) === 0 ? /* @__PURE__ */ xo(n, !1, !1) : Un(n) : null, u = (a & Bl) !== 0 ? Un(i) : null; return { v: l, i: u, - e: pt(() => (s(t, l ?? n, u ?? i, o), () => { + e: ct(() => (s(t, l ?? n, u ?? i, o), () => { e.delete(r); })) }; } -function Nr(e, t, n) { +function kr(e, t, n) { if (e.nodes) for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & sn) === 0 ? ( /** @type {EffectNodes} */ @@ -2421,7 +2421,7 @@ function Nr(e, t, n) { ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ zt(r) + /* @__PURE__ */ Ht(r) ); if (s.before(r), r === i) return; @@ -2431,8 +2431,8 @@ function Nr(e, t, n) { function vn(e, t, n) { t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } -function zs(e, t) { - Ro(() => { +function Hs(e, t) { + No(() => { var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2445,14 +2445,14 @@ function zs(e, t) { ) ); if (!r.querySelector("#" + t.hash)) { - const i = Ds("style"); + const i = Os("style"); i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); } -const _a = [...` +const ya = [...` \r\f \v\uFEFF`]; -function af(e, t, n) { +function uf(e, t, n) { var r = e == null ? "" : "" + e; if (n) { for (var i in n) @@ -2461,12 +2461,12 @@ function af(e, t, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || _a.includes(r[a - 1])) && (o === r.length || _a.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (a === 0 || ya.includes(r[a - 1])) && (o === r.length || ya.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; } -function ma(e, t = !1) { +function wa(e, t = !1) { var n = t ? " !important;" : ";", r = ""; for (var i in e) { var s = e[i]; @@ -2474,17 +2474,17 @@ function ma(e, t = !1) { } return r; } -function of(e, t) { +function ff(e, t) { if (t) { var n = "", r, i; - return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += ma(r)), i && (n += ma(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += wa(r)), i && (n += wa(i, !0)), n = n.trim(), n === "" ? null : n; } return String(e); } -function ii(e, t, n, r, i, s) { +function ri(e, t, n, r, i, s) { var a = e.__className; if (j || a !== n || a === void 0) { - var o = af(n, r, s); + var o = uf(n, r, s); (!j || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; } else if (s && i !== s) for (var l in s) { @@ -2493,80 +2493,80 @@ function ii(e, t, n, r, i, s) { } return s; } -function ts(e, t = {}, n, r) { +function ns(e, t = {}, n, r) { for (var i in n) { var s = n[i]; t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function ya(e, t, n, r) { +function xa(e, t, n, r) { var i = e.__style; if (j || i !== t) { - var s = of(t, r); + var s = ff(t, r); (!j || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; - } else r && (Array.isArray(r) ? (ts(e, n == null ? void 0 : n[0], r[0]), ts(e, n == null ? void 0 : n[1], r[1], "important")) : ts(e, n, r)); + } else r && (Array.isArray(r) ? (ns(e, n == null ? void 0 : n[0], r[0]), ns(e, n == null ? void 0 : n[1], r[1], "important")) : ns(e, n, r)); return r; } -const lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; -function wa(e, t, n, r) { - var i = cf(e); - j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +const cf = Symbol("is custom element"), hf = Symbol("is html"), df = lu ? "link" : "LINK"; +function ba(e, t, n, r) { + var i = pf(e); + j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === df) || i[t] !== (i[t] = n) && (t === "loading" && (e[ou] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && vf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } -function cf(e) { +function pf(e) { return ( /** @type {Record} **/ // @ts-expect-error e.__attributes ?? (e.__attributes = { - [lf]: e.nodeName.includes("-"), - [uf]: e.namespaceURI === Xa + [cf]: e.nodeName.includes("-"), + [hf]: e.namespaceURI === Ua }) ); } -var xa = /* @__PURE__ */ new Map(); -function hf(e) { - var t = e.getAttribute("is") || e.nodeName, n = xa.get(t); +var $a = /* @__PURE__ */ new Map(); +function vf(e) { + var t = e.getAttribute("is") || e.nodeName, n = $a.get(t); if (n) return n; - xa.set(t, n = []); + $a.set(t, n = []); for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Jl(i); + r = eu(i); for (var a in r) r[a].set && n.push(a); - i = Ua(i); + i = Ka(i); } return n; } -function ba(e, t) { - return e === t || (e == null ? void 0 : e[Dr]) === t; +function Aa(e, t) { + return e === t || (e == null ? void 0 : e[Or]) === t; } -function vi(e = {}, t, n, r) { - return Ro(() => { +function pi(e = {}, t, n, r) { + return No(() => { var i, s; - return Is(() => { - i = s, s = [], Xi(() => { - e !== n(...s) && (t(e, ...s), i && ba(n(...i), e) && t(null, ...i)); + return Ls(() => { + i = s, s = [], Bi(() => { + e !== n(...s) && (t(e, ...s), i && Aa(n(...i), e) && t(null, ...i)); }); }), () => { wn(() => { - s && ba(n(...s), e) && t(null, ...s); + s && Aa(n(...s), e) && t(null, ...s); }); }; }), e; } -let si = !1; -function df(e) { - var t = si; +let ii = !1; +function gf(e) { + var t = ii; try { - return si = !1, [e(), si]; + return ii = !1, [e(), ii]; } finally { - si = t; + ii = t; } } function ie(e, t, n, r) { - var D; - var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( + var O; + var i = (n & Kl) !== 0, s = (n & jl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Xi( + ), o = !0, l = () => (o && (o = !1, a = s ? Bi( /** @type {() => V} */ r ) : ( @@ -2574,55 +2574,55 @@ function ie(e, t, n, r) { r )), a), u; if (i) { - var f = Dr in e || Za in e; - u = ((D = zn(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (M) => e[t] = M : void 0); + var f = Or in e || eo in e; + u = ((O = Hn(e, t)) == null ? void 0 : O.set) ?? (f && t in e ? (N) => e[t] = N : void 0); } - var p, c = !1; - i ? [p, c] = df(() => ( + var d, h = !1; + i ? [d, h] = gf(() => ( /** @type {V} */ e[t] - )) : p = /** @type {V} */ - e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); - var d; - if (d = () => { - var M = ( + )) : d = /** @type {V} */ + e[t], d === void 0 && r !== void 0 && (d = l(), u && (_u(), u(d))); + var p; + if (p = () => { + var N = ( /** @type {V} */ e[t] ); - return M === void 0 ? l() : (o = !0, M); - }, (n & Xl) === 0) - return d; + return N === void 0 ? l() : (o = !0, N); + }, (n & Gl) === 0) + return p; if (u) { - var y = e.$$legacy; + var _ = e.$$legacy; return ( /** @type {() => V} */ - (function(M, S) { - return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); + (function(N, M) { + return arguments.length > 0 ? ((!M || _ || h) && u(M ? p() : N), N) : p(); }) ); } - var x = !1, m = ((n & Bl) !== 0 ? Yi : vo)(() => (x = !1, d())); - i && $(m); + var x = !1, y = ((n & Ul) !== 0 ? Hi : _o)(() => (x = !1, p())); + i && $(y); var b = ( /** @type {Effect} */ J ); return ( /** @type {() => V} */ - (function(M, S) { + (function(N, M) { if (arguments.length > 0) { - const I = S ? $(m) : i ? Mn(M) : M; - return de(m, I), x = !0, a !== void 0 && (a = I), M; + const F = M ? $(y) : i ? Pn(N) : N; + return ve(y, F), x = !0, a !== void 0 && (a = F), N; } - return $n && x || (b.f & on) !== 0 ? m.v : $(m); + return $n && x || (b.f & on) !== 0 ? y.v : $(y); }) ); } -function pf(e) { - return new vf(e); +function _f(e) { + return new mf(e); } -var rn, dt; -class vf { +var rn, ft; +class mf { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2630,12 +2630,12 @@ class vf { */ constructor(t) { /** @type {any} */ - H(this, rn); + z(this, rn); /** @type {Record} */ - H(this, dt); + z(this, ft); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ yo(o, !1, !1); + var l = /* @__PURE__ */ xo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2645,42 +2645,42 @@ class vf { return $(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Za ? !0 : ($(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === eo ? !0 : ($(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return de(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ve(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - V(this, dt, (t.hydrate ? Zu : Yo)(t.component, { + q(this, ft, (t.hydrate ? tf : Xo)(t.component, { target: t.target, anchor: t.anchor, props: i, context: t.context, intro: t.intro ?? !1, recover: t.recover - })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && ne(), V(this, rn, i.$$events); - for (const a of Object.keys(v(this, dt))) - a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && ne(), q(this, rn, i.$$events); + for (const a of Object.keys(v(this, ft))) + a === "$set" || a === "$destroy" || a === "$on" || bi(this, a, { get() { - return v(this, dt)[a]; + return v(this, ft)[a]; }, /** @param {any} value */ set(o) { - v(this, dt)[a] = o; + v(this, ft)[a] = o; }, enumerable: !0 }); - v(this, dt).$set = /** @param {Record} next */ + v(this, ft).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, dt).$destroy = () => { - Qu(v(this, dt)); + }, v(this, ft).$destroy = () => { + nf(v(this, ft)); }; } /** @param {Record} props */ $set(t) { - v(this, dt).$set(t); + v(this, ft).$set(t); } /** * @param {string} event @@ -2698,12 +2698,12 @@ class vf { }; } $destroy() { - v(this, dt).$destroy(); + v(this, ft).$destroy(); } } -rn = new WeakMap(), dt = new WeakMap(); -let Xo; -typeof HTMLElement == "function" && (Xo = class extends HTMLElement { +rn = new WeakMap(), ft = new WeakMap(); +let Uo; +typeof HTMLElement == "function" && (Uo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2712,27 +2712,27 @@ typeof HTMLElement == "function" && (Xo = class extends HTMLElement { constructor(t, n, r) { super(); /** The Svelte component constructor */ - he(this, "$$ctor"); + pe(this, "$$ctor"); /** Slots */ - he(this, "$$s"); + pe(this, "$$s"); /** @type {any} The Svelte component instance */ - he(this, "$$c"); + pe(this, "$$c"); /** Whether or not the custom element is connected */ - he(this, "$$cn", !1); + pe(this, "$$cn", !1); /** @type {Record} Component props data */ - he(this, "$$d", {}); + pe(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - he(this, "$$r", !1); + pe(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - he(this, "$$p_d", {}); + pe(this, "$$p_d", {}); /** @type {Record} Event listeners */ - he(this, "$$l", {}); + pe(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - he(this, "$$l_u", /* @__PURE__ */ new Map()); + pe(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - he(this, "$$me"); + pe(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - he(this, "$$shadowRoot", null); + pe(this, "$$shadowRoot", null); this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2762,23 +2762,23 @@ typeof HTMLElement == "function" && (Xo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Ds("slot"); - s !== "default" && (o.name = s), Ge(a, o); + const o = Os("slot"); + s !== "default" && (o.name = s), We(a, o); }; }; var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = gf(this); + const r = {}, i = yf(this); for (const s of this.$$s) s in i && (s === "default" && !this.$$d.children ? (this.$$d.children = n(s), r.default = !0) : r[s] = n(s)); for (const s of this.attributes) { const a = this.$$g_p(s.name); - a in this.$$d || (this.$$d[a] = gi(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = vi(a, s.value, this.$$p_d, "toProp")); } for (const s in this.$$p_d) !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]); - this.$$c = pf({ + this.$$c = _f({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,14 +2786,14 @@ typeof HTMLElement == "function" && (Xo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = qu(() => { - Is(() => { + }), this.$$me = Hu(() => { + Ls(() => { var s; this.$$r = !0; - for (const a of bi(this.$$c)) { + for (const a of xi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = gi( + const o = vi( a, this.$$d[a], this.$$p_d, @@ -2821,7 +2821,7 @@ typeof HTMLElement == "function" && (Xo = class extends HTMLElement { */ attributeChangedCallback(t, n, r) { var i; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = gi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = vi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2832,12 +2832,12 @@ typeof HTMLElement == "function" && (Xo = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(t) { - return bi(this.$$p_d).find( + return xi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t ) || t; } }); -function gi(e, t, n, r) { +function vi(e, t, n, r) { var s; const i = (s = n[e]) == null ? void 0 : s.type; if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) @@ -2868,7 +2868,7 @@ function gi(e, t, n, r) { return t; } } -function gf(e) { +function yf(e) { const t = {}; return e.childNodes.forEach((n) => { t[ @@ -2877,34 +2877,34 @@ function gf(e) { ] = !0; }), t; } -function Hs(e, t, n, r, i, s) { - let a = class extends Xo { +function Ys(e, t, n, r, i, s) { + let a = class extends Uo { constructor() { super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return bi(t).map( + return xi(t).map( (o) => (t[o].attribute || o).toLowerCase() ); } }; - return bi(t).forEach((o) => { - $i(a.prototype, o, { + return xi(t).forEach((o) => { + bi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var p; - l = gi(o, l, t), this.$$d[o] = l; + var d; + l = vi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (p = zn(u, o)) == null ? void 0 : p.get; + var f = (d = Hn(u, o)) == null ? void 0 : d.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - $i(a.prototype, o, { + bi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2913,43 +2913,43 @@ function Hs(e, t, n, r, i, s) { }), e.element = /** @type {any} */ a, a; } -var _f = { value: () => { +var wf = { value: () => { } }; -function Wo() { +function Go() { for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) { if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new _i(n); + return new gi(n); } -function _i(e) { +function gi(e) { this._ = e; } -function mf(e, t) { +function xf(e, t) { return e.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 && !t.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -_i.prototype = Wo.prototype = { - constructor: _i, +gi.prototype = Go.prototype = { + constructor: gi, on: function(e, t) { - var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; + var n = this._, r = xf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = bf(n[i], e.name))) return i; return; } if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (e = r[s]).type) n[i] = $a(n[i], e.name, t); - else if (t == null) for (i in n) n[i] = $a(n[i], e.name, null); + if (i = (e = r[s]).type) n[i] = Ea(n[i], e.name, t); + else if (t == null) for (i in n) n[i] = Ea(n[i], e.name, null); return this; }, copy: function() { var e = {}, t = this._; for (var n in t) e[n] = t[n].slice(); - return new _i(e); + return new gi(e); }, call: function(e, t) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2961,135 +2961,135 @@ _i.prototype = Wo.prototype = { for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function yf(e, t) { +function bf(e, t) { for (var n = 0, r = e.length, i; n < r; ++n) if ((i = e[n]).name === t) return i.value; } -function $a(e, t, n) { +function Ea(e, t, n) { for (var r = 0, i = e.length; r < i; ++r) if (e[r].name === t) { - e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); + e[r] = wf, e = e.slice(0, r).concat(e.slice(r + 1)); break; } return n != null && e.push({ name: t, value: n }), e; } -var ws = "http://www.w3.org/1999/xhtml"; -const Aa = { +var xs = "http://www.w3.org/1999/xhtml"; +const Ta = { svg: "http://www.w3.org/2000/svg", - xhtml: ws, + xhtml: xs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Wi(e) { +function Xi(e) { var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Aa.hasOwnProperty(t) ? { space: Aa[t], local: e } : e; + return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), Ta.hasOwnProperty(t) ? { space: Ta[t], local: e } : e; } -function wf(e) { +function $f(e) { return function() { var t = this.ownerDocument, n = this.namespaceURI; - return n === ws && t.documentElement.namespaceURI === ws ? t.createElement(e) : t.createElementNS(n, e); + return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); }; } -function xf(e) { +function Af(e) { return function() { return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Uo(e) { - var t = Wi(e); - return (t.local ? xf : wf)(t); +function Ko(e) { + var t = Xi(e); + return (t.local ? Af : $f)(t); } -function bf() { +function Ef() { } -function Ys(e) { - return e == null ? bf : function() { +function Bs(e) { + return e == null ? Ef : function() { return this.querySelector(e); }; } -function $f(e) { - typeof e != "function" && (e = Ys(e)); +function Tf(e) { + typeof e != "function" && (e = Bs(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = e.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ot(r, this._parents); + return new st(r, this._parents); } -function Af(e) { +function Rf(e) { return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function Ef() { +function Sf() { return []; } -function Go(e) { - return e == null ? Ef : function() { +function jo(e) { + return e == null ? Sf : function() { return this.querySelectorAll(e); }; } -function Tf(e) { +function Cf(e) { return function() { - return Af(e.apply(this, arguments)); + return Rf(e.apply(this, arguments)); }; } -function Cf(e) { - typeof e == "function" ? e = Tf(e) : e = Go(e); +function Nf(e) { + typeof e == "function" ? e = Cf(e) : e = jo(e); for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) for (var a = t[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(e.call(l, l.__data__, u, a)), i.push(l)); - return new ot(r, i); + return new st(r, i); } -function Ko(e) { +function Jo(e) { return function() { return this.matches(e); }; } -function jo(e) { +function Zo(e) { return function(t) { return t.matches(e); }; } -var Rf = Array.prototype.find; -function Sf(e) { +var kf = Array.prototype.find; +function Mf(e) { return function() { - return Rf.call(this.children, e); + return kf.call(this.children, e); }; } -function Nf() { +function Pf() { return this.firstElementChild; } -function kf(e) { - return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : jo(e))); +function Df(e) { + return this.select(e == null ? Pf : Mf(typeof e == "function" ? e : Zo(e))); } -var Mf = Array.prototype.filter; -function Pf() { +var Of = Array.prototype.filter; +function Ff() { return Array.from(this.children); } -function Df(e) { +function If(e) { return function() { - return Mf.call(this.children, e); + return Of.call(this.children, e); }; } -function Of(e) { - return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : jo(e))); +function Lf(e) { + return this.selectAll(e == null ? Ff : If(typeof e == "function" ? e : Zo(e))); } -function Ff(e) { - typeof e != "function" && (e = Ko(e)); +function qf(e) { + typeof e != "function" && (e = Jo(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); - return new ot(r, this._parents); + return new st(r, this._parents); } -function Jo(e) { +function Qo(e) { return new Array(e.length); } -function If() { - return new ot(this._enter || this._groups.map(Jo), this._parents); +function Vf() { + return new st(this._enter || this._groups.map(Qo), this._parents); } -function Ei(e, t) { +function Ai(e, t) { this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -Ei.prototype = { - constructor: Ei, +Ai.prototype = { + constructor: Ai, appendChild: function(e) { return this._parent.insertBefore(e, this._next); }, @@ -3103,91 +3103,91 @@ Ei.prototype = { return this._parent.querySelectorAll(e); } }; -function Lf(e) { +function zf(e) { return function() { return e; }; } -function qf(e, t, n, r, i, s) { +function Hf(e, t, n, r, i, s) { for (var a = 0, o, l = t.length, u = s.length; a < u; ++a) - (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ei(e, s[a]); + (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ai(e, s[a]); for (; a < l; ++a) (o = t[a]) && (i[a] = o); } -function Vf(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; +function Yf(e, t, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, d = s.length, h = new Array(f), p; for (o = 0; o < f; ++o) - (l = t[o]) && (c[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); - for (o = 0; o < p; ++o) - d = a.call(e, s[o], o, s) + "", (l = u.get(d)) ? (r[o] = l, l.__data__ = s[o], u.delete(d)) : n[o] = new Ei(e, s[o]); + (l = t[o]) && (h[o] = p = a.call(l, l.__data__, o, t) + "", u.has(p) ? i[o] = l : u.set(p, l)); + for (o = 0; o < d; ++o) + p = a.call(e, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ai(e, s[o]); for (o = 0; o < f; ++o) - (l = t[o]) && u.get(c[o]) === l && (i[o] = l); + (l = t[o]) && u.get(h[o]) === l && (i[o] = l); } -function zf(e) { +function Bf(e) { return e.__data__; } -function Hf(e, t) { - if (!arguments.length) return Array.from(this, zf); - var n = t ? Vf : qf, r = this._parents, i = this._groups; - typeof e != "function" && (e = Lf(e)); +function Xf(e, t) { + if (!arguments.length) return Array.from(this, Bf); + var n = t ? Yf : Hf, r = this._parents, i = this._groups; + typeof e != "function" && (e = zf(e)); for (var s = i.length, a = new Array(s), o = new Array(s), l = new Array(s), u = 0; u < s; ++u) { - var f = r[u], p = i[u], c = p.length, d = Yf(e.call(f, f && f.__data__, u, r)), y = d.length, x = o[u] = new Array(y), m = a[u] = new Array(y), b = l[u] = new Array(c); - n(f, p, x, m, b, d, t); - for (var D = 0, M = 0, S, I; D < y; ++D) - if (S = x[D]) { - for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; - S._next = I || null; + var f = r[u], d = i[u], h = d.length, p = Wf(e.call(f, f && f.__data__, u, r)), _ = p.length, x = o[u] = new Array(_), y = a[u] = new Array(_), b = l[u] = new Array(h); + n(f, d, x, y, b, p, t); + for (var O = 0, N = 0, M, F; O < _; ++O) + if (M = x[O]) { + for (O >= N && (N = O + 1); !(F = y[N]) && ++N < _; ) ; + M._next = F || null; } } - return a = new ot(a, r), a._enter = o, a._exit = l, a; + return a = new st(a, r), a._enter = o, a._exit = l, a; } -function Yf(e) { +function Wf(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Bf() { - return new ot(this._exit || this._groups.map(Jo), this._parents); +function Uf() { + return new st(this._exit || this._groups.map(Qo), this._parents); } -function Xf(e, t, n) { +function Gf(e, t, n) { var r = this.enter(), i = this, s = this.exit(); return typeof e == "function" ? (r = e(r), r && (r = r.selection())) : r = r.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Wf(e) { +function Kf(e) { for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, s = r.length, a = Math.min(i, s), o = new Array(i), l = 0; l < a; ++l) - for (var u = n[l], f = r[l], p = u.length, c = o[l] = new Array(p), d, y = 0; y < p; ++y) - (d = u[y] || f[y]) && (c[y] = d); + for (var u = n[l], f = r[l], d = u.length, h = o[l] = new Array(d), p, _ = 0; _ < d; ++_) + (p = u[_] || f[_]) && (h[_] = p); for (; l < i; ++l) o[l] = n[l]; - return new ot(o, this._parents); + return new st(o, this._parents); } -function Uf() { +function jf() { for (var e = this._groups, t = -1, n = e.length; ++t < n; ) for (var r = e[t], i = r.length - 1, s = r[i], a; --i >= 0; ) (a = r[i]) && (s && a.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(a, s), s = a); return this; } -function Gf(e) { - e || (e = Kf); - function t(p, c) { - return p && c ? e(p.__data__, c.__data__) : !p - !c; +function Jf(e) { + e || (e = Zf); + function t(d, h) { + return d && h ? e(d.__data__, h.__data__) : !d - !h; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { for (var a = n[s], o = a.length, l = i[s] = new Array(o), u, f = 0; f < o; ++f) (u = a[f]) && (l[f] = u); l.sort(t); } - return new ot(i, this._parents).order(); + return new st(i, this._parents).order(); } -function Kf(e, t) { +function Zf(e, t) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function jf() { +function Qf() { var e = arguments[0]; return arguments[0] = this, e.apply(null, arguments), this; } -function Jf() { +function ec() { return Array.from(this); } -function Zf() { +function tc() { for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3195,114 +3195,114 @@ function Zf() { } return null; } -function Qf() { +function nc() { let e = 0; for (const t of this) ++e; return e; } -function ec() { +function rc() { return !this.node(); } -function tc(e) { +function ic(e) { for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && e.call(o, o.__data__, s, i); return this; } -function nc(e) { +function sc(e) { return function() { this.removeAttribute(e); }; } -function rc(e) { +function ac(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function ic(e, t) { +function oc(e, t) { return function() { this.setAttribute(e, t); }; } -function sc(e, t) { +function lc(e, t) { return function() { this.setAttributeNS(e.space, e.local, t); }; } -function ac(e, t) { +function uc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function oc(e, t) { +function fc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function lc(e, t) { - var n = Wi(e); +function cc(e, t) { + var n = Xi(e); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((t == null ? n.local ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); + return this.each((t == null ? n.local ? ac : sc : typeof t == "function" ? n.local ? fc : uc : n.local ? lc : oc)(n, t)); } -function Zo(e) { +function el(e) { return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function uc(e) { +function hc(e) { return function() { this.style.removeProperty(e); }; } -function fc(e, t, n) { +function dc(e, t, n) { return function() { this.style.setProperty(e, t, n); }; } -function cc(e, t, n) { +function pc(e, t, n) { return function() { var r = t.apply(this, arguments); r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function hc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : mr(this.node(), e); +function vc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? hc : typeof t == "function" ? pc : dc)(e, t, n ?? "")) : mr(this.node(), e); } function mr(e, t) { - return e.style.getPropertyValue(t) || Zo(e).getComputedStyle(e, null).getPropertyValue(t); + return e.style.getPropertyValue(t) || el(e).getComputedStyle(e, null).getPropertyValue(t); } -function dc(e) { +function gc(e) { return function() { delete this[e]; }; } -function pc(e, t) { +function _c(e, t) { return function() { this[e] = t; }; } -function vc(e, t) { +function mc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? delete this[e] : this[e] = n; }; } -function gc(e, t) { - return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; +function yc(e, t) { + return arguments.length > 1 ? this.each((t == null ? gc : typeof t == "function" ? mc : _c)(e, t)) : this.node()[e]; } -function Qo(e) { +function tl(e) { return e.trim().split(/^|\s+/); } -function Bs(e) { - return e.classList || new el(e); +function Xs(e) { + return e.classList || new nl(e); } -function el(e) { - this._node = e, this._names = Qo(e.getAttribute("class") || ""); +function nl(e) { + this._node = e, this._names = tl(e.getAttribute("class") || ""); } -el.prototype = { +nl.prototype = { add: function(e) { var t = this._names.indexOf(e); t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); @@ -3315,129 +3315,129 @@ el.prototype = { return this._names.indexOf(e) >= 0; } }; -function tl(e, t) { - for (var n = Bs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); +function rl(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function nl(e, t) { - for (var n = Bs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); +function il(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function _c(e) { +function wc(e) { return function() { - tl(this, e); + rl(this, e); }; } -function mc(e) { +function xc(e) { return function() { - nl(this, e); + il(this, e); }; } -function yc(e, t) { +function bc(e, t) { return function() { - (t.apply(this, arguments) ? tl : nl)(this, e); + (t.apply(this, arguments) ? rl : il)(this, e); }; } -function wc(e, t) { - var n = Qo(e + ""); +function $c(e, t) { + var n = tl(e + ""); if (arguments.length < 2) { - for (var r = Bs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Xs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof t == "function" ? yc : t ? _c : mc)(n, t)); + return this.each((typeof t == "function" ? bc : t ? wc : xc)(n, t)); } -function xc() { +function Ac() { this.textContent = ""; } -function bc(e) { +function Ec(e) { return function() { this.textContent = e; }; } -function $c(e) { +function Tc(e) { return function() { var t = e.apply(this, arguments); this.textContent = t ?? ""; }; } -function Ac(e) { - return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; +function Rc(e) { + return arguments.length ? this.each(e == null ? Ac : (typeof e == "function" ? Tc : Ec)(e)) : this.node().textContent; } -function Ec() { +function Sc() { this.innerHTML = ""; } -function Tc(e) { +function Cc(e) { return function() { this.innerHTML = e; }; } -function Cc(e) { +function Nc(e) { return function() { var t = e.apply(this, arguments); this.innerHTML = t ?? ""; }; } -function Rc(e) { - return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; +function kc(e) { + return arguments.length ? this.each(e == null ? Sc : (typeof e == "function" ? Nc : Cc)(e)) : this.node().innerHTML; } -function Sc() { +function Mc() { this.nextSibling && this.parentNode.appendChild(this); } -function Nc() { - return this.each(Sc); +function Pc() { + return this.each(Mc); } -function kc() { +function Dc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Mc() { - return this.each(kc); +function Oc() { + return this.each(Dc); } -function Pc(e) { - var t = typeof e == "function" ? e : Uo(e); +function Fc(e) { + var t = typeof e == "function" ? e : Ko(e); return this.select(function() { return this.appendChild(t.apply(this, arguments)); }); } -function Dc() { +function Ic() { return null; } -function Oc(e, t) { - var n = typeof e == "function" ? e : Uo(e), r = t == null ? Dc : typeof t == "function" ? t : Ys(t); +function Lc(e, t) { + var n = typeof e == "function" ? e : Ko(e), r = t == null ? Ic : typeof t == "function" ? t : Bs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Fc() { +function qc() { var e = this.parentNode; e && e.removeChild(this); } -function Ic() { - return this.each(Fc); +function Vc() { + return this.each(qc); } -function Lc() { +function zc() { var e = this.cloneNode(!1), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function qc() { +function Hc() { var e = this.cloneNode(!0), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function Vc(e) { - return this.select(e ? qc : Lc); +function Yc(e) { + return this.select(e ? Hc : zc); } -function zc(e) { +function Bc(e) { return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function Hc(e) { +function Xc(e) { return function(t) { e.call(this, t, this.__data__); }; } -function Yc(e) { +function Wc(e) { return e.trim().split(/^|\s+/).map(function(t) { var n = "", r = t.indexOf("."); return r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), { type: t, name: n }; }); } -function Bc(e) { +function Uc(e) { return function() { var t = this.__on; if (t) { @@ -3447,9 +3447,9 @@ function Bc(e) { } }; } -function Xc(e, t, n) { +function Gc(e, t, n) { return function() { - var r = this.__on, i, s = Hc(t); + var r = this.__on, i, s = Xc(t); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === e.type && i.name === e.name) { @@ -3460,8 +3460,8 @@ function Xc(e, t, n) { this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Wc(e, t, n) { - var r = Yc(e + ""), i, s = r.length, a; +function Kc(e, t, n) { + var r = Wc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Wc(e, t, n) { } return; } - for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = t ? Gc : Uc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function rl(e, t, n) { - var r = Zo(e), i = r.CustomEvent; +function sl(e, t, n) { + var r = el(e), i = r.CustomEvent; typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i); } -function Uc(e, t) { +function jc(e, t) { return function() { - return rl(this, e, t); + return sl(this, e, t); }; } -function Gc(e, t) { +function Jc(e, t) { return function() { - return rl(this, e, t.apply(this, arguments)); + return sl(this, e, t.apply(this, arguments)); }; } -function Kc(e, t) { - return this.each((typeof t == "function" ? Gc : Uc)(e, t)); +function Zc(e, t) { + return this.each((typeof t == "function" ? Jc : jc)(e, t)); } -function* jc() { +function* Qc() { for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var il = [null]; -function ot(e, t) { +var al = [null]; +function st(e, t) { this._groups = e, this._parents = t; } function br() { - return new ot([[document.documentElement]], il); + return new st([[document.documentElement]], al); } -function Jc() { +function eh() { return this; } -ot.prototype = br.prototype = { - constructor: ot, - select: $f, - selectAll: Cf, - selectChild: kf, - selectChildren: Of, - filter: Ff, - data: Hf, - enter: If, - exit: Bf, - join: Xf, - merge: Wf, - selection: Jc, - order: Uf, - sort: Gf, - call: jf, - nodes: Jf, - node: Zf, - size: Qf, - empty: ec, - each: tc, - attr: lc, - style: hc, - property: gc, - classed: wc, - text: Ac, - html: Rc, - raise: Nc, - lower: Mc, - append: Pc, - insert: Oc, - remove: Ic, - clone: Vc, - datum: zc, - on: Wc, - dispatch: Kc, - [Symbol.iterator]: jc +st.prototype = br.prototype = { + constructor: st, + select: Tf, + selectAll: Nf, + selectChild: Df, + selectChildren: Lf, + filter: qf, + data: Xf, + enter: Vf, + exit: Uf, + join: Gf, + merge: Kf, + selection: eh, + order: jf, + sort: Jf, + call: Qf, + nodes: ec, + node: tc, + size: nc, + empty: rc, + each: ic, + attr: cc, + style: vc, + property: yc, + classed: $c, + text: Rc, + html: kc, + raise: Pc, + lower: Oc, + append: Fc, + insert: Lc, + remove: Vc, + clone: Yc, + datum: Bc, + on: Kc, + dispatch: Zc, + [Symbol.iterator]: Qc }; -function fe(e) { - return typeof e == "string" ? new ot([[document.querySelector(e)]], [document.documentElement]) : new ot([[e]], il); +function he(e) { + return typeof e == "string" ? new st([[document.querySelector(e)]], [document.documentElement]) : new st([[e]], al); } -function Xs(e, t, n) { +function Ws(e, t, n) { e.prototype = t.prototype = n, n.constructor = e; } -function sl(e, t) { +function ol(e, t) { var n = Object.create(e.prototype); for (var r in t) n[r] = t[r]; return n; } -function jr() { +function Jr() { } -var qr = 0.7, Ti = 1 / qr, rr = "\\s*([+-]?\\d+)\\s*", Vr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Lt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${rr},${rr},${rr}\\)$`), eh = new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`), th = new RegExp(`^rgba\\(${rr},${rr},${rr},${Vr}\\)$`), nh = new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${Vr}\\)$`), rh = new RegExp(`^hsl\\(${Vr},${Lt},${Lt}\\)$`), ih = new RegExp(`^hsla\\(${Vr},${Lt},${Lt},${Vr}\\)$`), Ea = { +var Vr = 0.7, Ei = 1 / Vr, rr = "\\s*([+-]?\\d+)\\s*", zr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", th = /^#([0-9a-f]{3,8})$/, nh = new RegExp(`^rgb\\(${rr},${rr},${rr}\\)$`), rh = new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`), ih = new RegExp(`^rgba\\(${rr},${rr},${rr},${zr}\\)$`), sh = new RegExp(`^rgba\\(${qt},${qt},${qt},${zr}\\)$`), ah = new RegExp(`^hsl\\(${zr},${qt},${qt}\\)$`), oh = new RegExp(`^hsla\\(${zr},${qt},${qt},${zr}\\)$`), Ra = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,178 +3708,178 @@ var qr = 0.7, Ti = 1 / qr, rr = "\\s*([+-]?\\d+)\\s*", Vr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Xs(jr, Un, { +Ws(Jr, Gn, { copy(e) { return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); }, - hex: Ta, + hex: Sa, // Deprecated! Use color.formatHex. - formatHex: Ta, - formatHex8: sh, - formatHsl: ah, + formatHex: Sa, + formatHex8: lh, + formatHsl: uh, formatRgb: Ca, toString: Ca }); -function Ta() { +function Sa() { return this.rgb().formatHex(); } -function sh() { +function lh() { return this.rgb().formatHex8(); } -function ah() { - return al(this).formatHsl(); +function uh() { + return ll(this).formatHsl(); } function Ca() { return this.rgb().formatRgb(); } -function Un(e) { +function Gn(e) { var t, n; - return e = (e + "").trim().toLowerCase(), (t = Zc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Je(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, t[4]) : Ea.hasOwnProperty(e) ? Ra(Ea[e]) : e === "transparent" ? new Je(NaN, NaN, NaN, 0) : null; + return e = (e + "").trim().toLowerCase(), (t = th.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Na(t) : n === 3 ? new Ke(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? si(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? si(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = nh.exec(e)) ? new Ke(t[1], t[2], t[3], 1) : (t = rh.exec(e)) ? new Ke(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = ih.exec(e)) ? si(t[1], t[2], t[3], t[4]) : (t = sh.exec(e)) ? si(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = ah.exec(e)) ? Pa(t[1], t[2] / 100, t[3] / 100, 1) : (t = oh.exec(e)) ? Pa(t[1], t[2] / 100, t[3] / 100, t[4]) : Ra.hasOwnProperty(e) ? Na(Ra[e]) : e === "transparent" ? new Ke(NaN, NaN, NaN, 0) : null; } -function Ra(e) { - return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); +function Na(e) { + return new Ke(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function ai(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); +function si(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Ke(e, t, n, r); } -function oh(e) { - return e instanceof jr || (e = Un(e)), e ? (e = e.rgb(), new Je(e.r, e.g, e.b, e.opacity)) : new Je(); +function fh(e) { + return e instanceof Jr || (e = Gn(e)), e ? (e = e.rgb(), new Ke(e.r, e.g, e.b, e.opacity)) : new Ke(); } -function xs(e, t, n, r) { - return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); +function bs(e, t, n, r) { + return arguments.length === 1 ? fh(e) : new Ke(e, t, n, r ?? 1); } -function Je(e, t, n, r) { +function Ke(e, t, n, r) { this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Xs(Je, xs, sl(jr, { +Ws(Ke, bs, ol(Jr, { brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Ei : Math.pow(Ei, e), new Ke(this.r * e, this.g * e, this.b * e, this.opacity); }, darker(e) { - return e = e == null ? qr : Math.pow(qr, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Vr : Math.pow(Vr, e), new Ke(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new Je(Bn(this.r), Bn(this.g), Bn(this.b), Ci(this.opacity)); + return new Ke(Xn(this.r), Xn(this.g), Xn(this.b), Ti(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: Sa, + hex: ka, // Deprecated! Use color.formatHex. - formatHex: Sa, - formatHex8: lh, - formatRgb: Na, - toString: Na + formatHex: ka, + formatHex8: ch, + formatRgb: Ma, + toString: Ma })); -function Sa() { - return `#${Dn(this.r)}${Dn(this.g)}${Dn(this.b)}`; +function ka() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function lh() { - return `#${Dn(this.r)}${Dn(this.g)}${Dn(this.b)}${Dn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function ch() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Na() { - const e = Ci(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${Bn(this.r)}, ${Bn(this.g)}, ${Bn(this.b)}${e === 1 ? ")" : `, ${e})`}`; +function Ma() { + const e = Ti(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ci(e) { +function Ti(e) { return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function Bn(e) { +function Xn(e) { return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function Dn(e) { - return e = Bn(e), (e < 16 ? "0" : "") + e.toString(16); +function On(e) { + return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); } -function ka(e, t, n, r) { - return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new xt(e, t, n, r); +function Pa(e, t, n, r) { + return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new bt(e, t, n, r); } -function al(e) { - if (e instanceof xt) return new xt(e.h, e.s, e.l, e.opacity); - if (e instanceof jr || (e = Un(e)), !e) return new xt(); - if (e instanceof xt) return e; +function ll(e) { + if (e instanceof bt) return new bt(e.h, e.s, e.l, e.opacity); + if (e instanceof Jr || (e = Gn(e)), !e) return new bt(); + if (e instanceof bt) return e; e = e.rgb(); var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), s = Math.max(t, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new xt(a, o, l, e.opacity); + return o ? (t === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - t) / o + 2 : a = (t - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new bt(a, o, l, e.opacity); } -function uh(e, t, n, r) { - return arguments.length === 1 ? al(e) : new xt(e, t, n, r ?? 1); +function hh(e, t, n, r) { + return arguments.length === 1 ? ll(e) : new bt(e, t, n, r ?? 1); } -function xt(e, t, n, r) { +function bt(e, t, n, r) { this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Xs(xt, uh, sl(jr, { +Ws(bt, hh, ol(Jr, { brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new xt(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Ei : Math.pow(Ei, e), new bt(this.h, this.s, this.l * e, this.opacity); }, darker(e) { - return e = e == null ? qr : Math.pow(qr, e), new xt(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Vr : Math.pow(Vr, e), new bt(this.h, this.s, this.l * e, this.opacity); }, rgb() { var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r; - return new Je( - ns(e >= 240 ? e - 240 : e + 120, i, r), - ns(e, i, r), - ns(e < 120 ? e + 240 : e - 120, i, r), + return new Ke( + rs(e >= 240 ? e - 240 : e + 120, i, r), + rs(e, i, r), + rs(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new xt(Ma(this.h), oi(this.s), oi(this.l), Ci(this.opacity)); + return new bt(Da(this.h), ai(this.s), ai(this.l), Ti(this.opacity)); }, displayable() { return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; }, formatHsl() { - const e = Ci(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Ma(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const e = Ti(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Da(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function Ma(e) { +function Da(e) { return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function oi(e) { +function ai(e) { return Math.max(0, Math.min(1, e || 0)); } -function ns(e, t, n) { +function rs(e, t, n) { return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; } -const Ws = (e) => () => e; -function fh(e, t) { +const Us = (e) => () => e; +function dh(e, t) { return function(n) { return e + n * t; }; } -function ch(e, t, n) { +function ph(e, t, n) { return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) { return Math.pow(e + r * t, n); }; } -function hh(e) { - return (e = +e) == 1 ? ol : function(t, n) { - return n - t ? ch(t, n, e) : Ws(isNaN(t) ? n : t); +function vh(e) { + return (e = +e) == 1 ? ul : function(t, n) { + return n - t ? ph(t, n, e) : Us(isNaN(t) ? n : t); }; } -function ol(e, t) { +function ul(e, t) { var n = t - e; - return n ? fh(e, n) : Ws(isNaN(e) ? t : e); + return n ? dh(e, n) : Us(isNaN(e) ? t : e); } const Ri = (function e(t) { - var n = hh(t); + var n = vh(t); function r(i, s) { - var a = n((i = xs(i)).r, (s = xs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ol(i.opacity, s.opacity); + var a = n((i = bs(i)).r, (s = bs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = ul(i.opacity, s.opacity); return function(f) { return i.r = a(f), i.g = o(f), i.b = l(f), i.opacity = u(f), i + ""; }; } return r.gamma = e, r; })(1); -function dh(e, t) { +function gh(e, t) { t || (t = []); var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { @@ -3887,10 +3887,10 @@ function dh(e, t) { return r; }; } -function ph(e) { +function _h(e) { return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function vh(e, t) { +function mh(e, t) { var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), s = new Array(n), a; for (a = 0; a < r; ++a) i[a] = Jt(e[a], t[a]); for (; a < n; ++a) s[a] = t[a]; @@ -3899,18 +3899,18 @@ function vh(e, t) { return s; }; } -function gh(e, t) { +function yh(e, t) { var n = /* @__PURE__ */ new Date(); return e = +e, t = +t, function(r) { return n.setTime(e * (1 - r) + t * r), n; }; } -function It(e, t) { +function Lt(e, t) { return e = +e, t = +t, function(n) { return e * (1 - n) + t * n; }; } -function _h(e, t) { +function wh(e, t) { var n = {}, r = {}, i; (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); for (i in t) @@ -3920,31 +3920,31 @@ function _h(e, t) { return r; }; } -var bs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, rs = new RegExp(bs.source, "g"); -function mh(e) { +var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); +function xh(e) { return function() { return e; }; } -function yh(e) { +function bh(e) { return function(t) { return e(t) + ""; }; } -function ll(e, t) { - var n = bs.lastIndex = rs.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (e = e + "", t = t + ""; (r = bs.exec(e)) && (i = rs.exec(t)); ) - (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: It(r, i) })), n = rs.lastIndex; - return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? yh(l[0].x) : mh(t) : (t = l.length, function(u) { - for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); +function fl(e, t) { + var n = $s.lastIndex = is.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (e = e + "", t = t + ""; (r = $s.exec(e)) && (i = is.exec(t)); ) + (s = i.index) > n && (s = t.slice(n, s), o[a] ? o[a] += s : o[++a] = s), (r = r[0]) === (i = i[0]) ? o[a] ? o[a] += i : o[++a] = i : (o[++a] = null, l.push({ i: a, x: Lt(r, i) })), n = is.lastIndex; + return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? bh(l[0].x) : xh(t) : (t = l.length, function(u) { + for (var f = 0, d; f < t; ++f) o[(d = l[f]).i] = d.x(u); return o.join(""); }); } function Jt(e, t) { var n = typeof t, r; - return t == null || n === "boolean" ? Ws(t) : (n === "number" ? It : n === "string" ? (r = Un(t)) ? (t = r, Ri) : ll : t instanceof Un ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); + return t == null || n === "boolean" ? Us(t) : (n === "number" ? Lt : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : fl : t instanceof Gn ? Ri : t instanceof Date ? yh : _h(t) ? gh : Array.isArray(t) ? mh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? wh : Lt)(e, t); } -var Pa = 180 / Math.PI, $s = { +var Oa = 180 / Math.PI, As = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,187 +3952,187 @@ var Pa = 180 / Math.PI, $s = { scaleX: 1, scaleY: 1 }; -function ul(e, t, n, r, i, s) { +function cl(e, t, n, r, i, s) { var a, o, l; return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (l = e * n + t * r) && (n -= e * l, r -= t * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), e * r < t * n && (e = -e, t = -t, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(t, e) * Pa, - skewX: Math.atan(l) * Pa, + rotate: Math.atan2(t, e) * Oa, + skewX: Math.atan(l) * Oa, scaleX: a, scaleY: o }; } -var li; -function wh(e) { +var oi; +function $h(e) { const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? $s : ul(t.a, t.b, t.c, t.d, t.e, t.f); + return t.isIdentity ? As : cl(t.a, t.b, t.c, t.d, t.e, t.f); } -function xh(e) { - return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? $s : (e = e.matrix, ul(e.a, e.b, e.c, e.d, e.e, e.f)); +function Ah(e) { + return e == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", e), !(e = oi.transform.baseVal.consolidate())) ? As : (e = e.matrix, cl(e.a, e.b, e.c, e.d, e.e, e.f)); } -function fl(e, t, n, r) { +function hl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, p, c, d, y) { - if (u !== p || f !== c) { - var x = d.push("translate(", null, t, null, n); - y.push({ i: x - 4, x: It(u, p) }, { i: x - 2, x: It(f, c) }); - } else (p || c) && d.push("translate(" + p + t + c + n); + function s(u, f, d, h, p, _) { + if (u !== d || f !== h) { + var x = p.push("translate(", null, t, null, n); + _.push({ i: x - 4, x: Lt(u, d) }, { i: x - 2, x: Lt(f, h) }); + } else (d || h) && p.push("translate(" + d + t + h + n); } - function a(u, f, p, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + function a(u, f, d, h) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Lt(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); } - function o(u, f, p, c) { - u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + function o(u, f, d, h) { + u !== f ? h.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Lt(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); } - function l(u, f, p, c, d, y) { - if (u !== p || f !== c) { - var x = d.push(i(d) + "scale(", null, ",", null, ")"); - y.push({ i: x - 4, x: It(u, p) }, { i: x - 2, x: It(f, c) }); - } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); + function l(u, f, d, h, p, _) { + if (u !== d || f !== h) { + var x = p.push(i(p) + "scale(", null, ",", null, ")"); + _.push({ i: x - 4, x: Lt(u, d) }, { i: x - 2, x: Lt(f, h) }); + } else (d !== 1 || h !== 1) && p.push(i(p) + "scale(" + d + "," + h + ")"); } return function(u, f) { - var p = [], c = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { - for (var y = -1, x = c.length, m; ++y < x; ) p[(m = c[y]).i] = m.x(d); - return p.join(""); + var d = [], h = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, h), a(u.rotate, f.rotate, d, h), o(u.skewX, f.skewX, d, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, h), u = f = null, function(p) { + for (var _ = -1, x = h.length, y; ++_ < x; ) d[(y = h[_]).i] = y.x(p); + return d.join(""); }; }; } -var bh = fl(wh, "px, ", "px)", "deg)"), $h = fl(xh, ", ", ")", ")"), yr = 0, kr = 0, Sr = 0, cl = 1e3, Si, Mr, Ni = 0, Gn = 0, Ui = 0, zr = typeof performance == "object" && performance.now ? performance : Date, hl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { +var Eh = hl($h, "px, ", "px)", "deg)"), Th = hl(Ah, ", ", ")", ")"), yr = 0, Mr = 0, Nr = 0, dl = 1e3, Si, Pr, Ci = 0, Kn = 0, Wi = 0, Hr = typeof performance == "object" && performance.now ? performance : Date, pl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { setTimeout(e, 17); }; -function Us() { - return Gn || (hl(Ah), Gn = zr.now() + Ui); +function Gs() { + return Kn || (pl(Rh), Kn = Hr.now() + Wi); } -function Ah() { - Gn = 0; +function Rh() { + Kn = 0; } -function ki() { +function Ni() { this._call = this._time = this._next = null; } -ki.prototype = dl.prototype = { - constructor: ki, +Ni.prototype = vl.prototype = { + constructor: Ni, restart: function(e, t, n) { if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Us() : +n) + (t == null ? 0 : +t), !this._next && Mr !== this && (Mr ? Mr._next = this : Si = this, Mr = this), this._call = e, this._time = n, As(); + n = (n == null ? Gs() : +n) + (t == null ? 0 : +t), !this._next && Pr !== this && (Pr ? Pr._next = this : Si = this, Pr = this), this._call = e, this._time = n, Es(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, As()); + this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function dl(e, t, n) { - var r = new ki(); +function vl(e, t, n) { + var r = new Ni(); return r.restart(e, t, n), r; } -function Eh() { - Us(), ++yr; +function Sh() { + Gs(), ++yr; for (var e = Si, t; e; ) - (t = Gn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; --yr; } -function Da() { - Gn = (Ni = zr.now()) + Ui, yr = kr = 0; +function Fa() { + Kn = (Ci = Hr.now()) + Wi, yr = Mr = 0; try { - Eh(); + Sh(); } finally { - yr = 0, Ch(), Gn = 0; + yr = 0, Nh(), Kn = 0; } } -function Th() { - var e = zr.now(), t = e - Ni; - t > cl && (Ui -= t, Ni = e); -} function Ch() { + var e = Hr.now(), t = e - Ci; + t > dl && (Wi -= t, Ci = e); +} +function Nh() { for (var e, t = Si, n, r = 1 / 0; t; ) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Si = n); - Mr = e, As(r); + Pr = e, Es(r); } -function As(e) { +function Es(e) { if (!yr) { - kr && (kr = clearTimeout(kr)); - var t = e - Gn; - t > 24 ? (e < 1 / 0 && (kr = setTimeout(Da, e - zr.now() - Ui)), Sr && (Sr = clearInterval(Sr))) : (Sr || (Ni = zr.now(), Sr = setInterval(Th, cl)), yr = 1, hl(Da)); + Mr && (Mr = clearTimeout(Mr)); + var t = e - Kn; + t > 24 ? (e < 1 / 0 && (Mr = setTimeout(Fa, e - Hr.now() - Wi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ci = Hr.now(), Nr = setInterval(Ch, dl)), yr = 1, pl(Fa)); } } -function Oa(e, t, n) { - var r = new ki(); +function Ia(e, t, n) { + var r = new Ni(); return t = t == null ? 0 : +t, r.restart((i) => { r.stop(), e(i + t); }, t, n), r; } -var Rh = Wo("start", "end", "cancel", "interrupt"), Sh = [], pl = 0, Fa = 1, Es = 2, mi = 3, Ia = 4, Ts = 5, yi = 6; -function Gi(e, t, n, r, i, s) { +var kh = Go("start", "end", "cancel", "interrupt"), Mh = [], gl = 0, La = 1, Ts = 2, _i = 3, qa = 4, Rs = 5, mi = 6; +function Ui(e, t, n, r, i, s) { var a = e.__transition; if (!a) e.__transition = {}; else if (n in a) return; - Nh(e, n, { + Ph(e, n, { name: t, index: r, // For context during callback. group: i, // For context during callback. - on: Rh, - tween: Sh, + on: kh, + tween: Mh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: pl + state: gl }); } -function Gs(e, t) { - var n = Tt(e, t); - if (n.state > pl) throw new Error("too late; already scheduled"); +function Ks(e, t) { + var n = Rt(e, t); + if (n.state > gl) throw new Error("too late; already scheduled"); return n; } -function Bt(e, t) { - var n = Tt(e, t); - if (n.state > mi) throw new Error("too late; already running"); +function Xt(e, t) { + var n = Rt(e, t); + if (n.state > _i) throw new Error("too late; already running"); return n; } -function Tt(e, t) { +function Rt(e, t) { var n = e.__transition; if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function Nh(e, t, n) { +function Ph(e, t, n) { var r = e.__transition, i; - r[t] = n, n.timer = dl(s, 0, n.time); + r[t] = n, n.timer = vl(s, 0, n.time); function s(u) { - n.state = Fa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = La, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, p, c, d; - if (n.state !== Fa) return l(); + var f, d, h, p; + if (n.state !== La) return l(); for (f in r) - if (d = r[f], d.name === n.name) { - if (d.state === mi) return Oa(a); - d.state === Ia ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); + if (p = r[f], p.name === n.name) { + if (p.state === _i) return Ia(a); + p.state === qa ? (p.state = mi, p.timer.stop(), p.on.call("interrupt", e, e.__data__, p.index, p.group), delete r[f]) : +f < t && (p.state = mi, p.timer.stop(), p.on.call("cancel", e, e.__data__, p.index, p.group), delete r[f]); } - if (Oa(function() { - n.state === mi && (n.state = Ia, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Es, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Es) { - for (n.state = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) - (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); - i.length = p + 1; + if (Ia(function() { + n.state === _i && (n.state = qa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Ts, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Ts) { + for (n.state = _i, i = new Array(h = n.tween.length), f = 0, d = -1; f < h; ++f) + (p = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++d] = p); + i.length = d + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Ts, 1), p = -1, c = i.length; ++p < c; ) - i[p].call(e, f); - n.state === Ts && (n.on.call("end", e, e.__data__, n.index, n.group), l()); + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Rs, 1), d = -1, h = i.length; ++d < h; ) + i[d].call(e, f); + n.state === Rs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } function l() { - n.state = yi, n.timer.stop(), delete r[t]; + n.state = mi, n.timer.stop(), delete r[t]; for (var u in r) return; delete e.__transition; } } -function kh(e, t) { +function Dh(e, t) { var n = e.__transition, r, i, s = !0, a; if (n) { t = t == null ? null : t + ""; @@ -4141,20 +4141,20 @@ function kh(e, t) { s = !1; continue; } - i = r.state > Es && r.state < Ts, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Rs, r.state = mi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } s && delete e.__transition; } } -function Mh(e) { +function Oh(e) { return this.each(function() { - kh(this, e); + Dh(this, e); }); } -function Ph(e, t) { +function Fh(e, t) { var n, r; return function() { - var i = Bt(this, e), s = i.tween; + var i = Xt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4166,11 +4166,11 @@ function Ph(e, t) { i.tween = r; }; } -function Dh(e, t, n) { +function Ih(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Bt(this, e), a = s.tween; + var s = Xt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4183,318 +4183,318 @@ function Dh(e, t, n) { s.tween = i; }; } -function Oh(e, t) { +function Lh(e, t) { var n = this._id; if (e += "", arguments.length < 2) { - for (var r = Tt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Rt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === e) return a.value; return null; } - return this.each((t == null ? Ph : Dh)(n, e, t)); + return this.each((t == null ? Fh : Ih)(n, e, t)); } -function Ks(e, t, n) { +function js(e, t, n) { var r = e._id; return e.each(function() { - var i = Bt(this, r); + var i = Xt(this, r); (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return Tt(i, r).value[t]; + return Rt(i, r).value[t]; }; } -function vl(e, t) { +function _l(e, t) { var n; - return (typeof t == "number" ? It : t instanceof Un ? Ri : (n = Un(t)) ? (t = n, Ri) : ll)(e, t); + return (typeof t == "number" ? Lt : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : fl)(e, t); } -function Fh(e) { +function qh(e) { return function() { this.removeAttribute(e); }; } -function Ih(e) { +function Vh(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function Lh(e, t, n) { +function zh(e, t, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(e); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function qh(e, t, n) { +function Hh(e, t, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(e.space, e.local); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Vh(e, t, n) { +function Yh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function zh(e, t, n) { +function Bh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o))); }; } -function Hh(e, t) { - var n = Wi(e), r = n === "transform" ? $h : vl; - return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, Ks(this, "attr." + e, t)) : t == null ? (n.local ? Ih : Fh)(n) : (n.local ? qh : Lh)(n, r, t)); +function Xh(e, t) { + var n = Xi(e), r = n === "transform" ? Th : _l; + return this.attrTween(e, typeof t == "function" ? (n.local ? Bh : Yh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Vh : qh)(n) : (n.local ? Hh : zh)(n, r, t)); } -function Yh(e, t) { +function Wh(e, t) { return function(n) { this.setAttribute(e, t.call(this, n)); }; } -function Bh(e, t) { +function Uh(e, t) { return function(n) { this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Xh(e, t) { +function Gh(e, t) { var n, r; function i() { var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Bh(e, s)), n; + return s !== r && (n = (r = s) && Uh(e, s)), n; } return i._value = t, i; } -function Wh(e, t) { +function Kh(e, t) { var n, r; function i() { var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Yh(e, s)), n; + return s !== r && (n = (r = s) && Wh(e, s)), n; } return i._value = t, i; } -function Uh(e, t) { +function jh(e, t) { var n = "attr." + e; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (t == null) return this.tween(n, null); if (typeof t != "function") throw new Error(); - var r = Wi(e); - return this.tween(n, (r.local ? Xh : Wh)(r, t)); + var r = Xi(e); + return this.tween(n, (r.local ? Gh : Kh)(r, t)); } -function Gh(e, t) { +function Jh(e, t) { return function() { - Gs(this, e).delay = +t.apply(this, arguments); + Ks(this, e).delay = +t.apply(this, arguments); }; } -function Kh(e, t) { +function Zh(e, t) { return t = +t, function() { - Gs(this, e).delay = t; + Ks(this, e).delay = t; }; } -function jh(e) { +function Qh(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Tt(this.node(), t).delay; + return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Rt(this.node(), t).delay; } -function Jh(e, t) { +function ed(e, t) { return function() { - Bt(this, e).duration = +t.apply(this, arguments); + Xt(this, e).duration = +t.apply(this, arguments); }; } -function Zh(e, t) { +function td(e, t) { return t = +t, function() { - Bt(this, e).duration = t; + Xt(this, e).duration = t; }; } -function Qh(e) { +function nd(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Tt(this.node(), t).duration; + return arguments.length ? this.each((typeof e == "function" ? ed : td)(t, e)) : Rt(this.node(), t).duration; } -function ed(e, t) { +function rd(e, t) { if (typeof t != "function") throw new Error(); return function() { - Bt(this, e).ease = t; + Xt(this, e).ease = t; }; } -function td(e) { +function id(e) { var t = this._id; - return arguments.length ? this.each(ed(t, e)) : Tt(this.node(), t).ease; + return arguments.length ? this.each(rd(t, e)) : Rt(this.node(), t).ease; } -function nd(e, t) { +function sd(e, t) { return function() { var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Bt(this, e).ease = n; + Xt(this, e).ease = n; }; } -function rd(e) { +function ad(e) { if (typeof e != "function") throw new Error(); - return this.each(nd(this._id, e)); + return this.each(sd(this._id, e)); } -function id(e) { - typeof e != "function" && (e = Ko(e)); +function od(e) { + typeof e != "function" && (e = Jo(e)); for (var t = this._groups, n = t.length, r = new Array(n), i = 0; i < n; ++i) for (var s = t[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && e.call(l, l.__data__, u, s) && o.push(l); return new fn(r, this._parents, this._name, this._id); } -function sd(e) { +function ld(e) { if (e._id !== this._id) throw new Error(); for (var t = this._groups, n = e._groups, r = t.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = t[o], u = n[o], f = l.length, p = a[o] = new Array(f), c, d = 0; d < f; ++d) - (c = l[d] || u[d]) && (p[d] = c); + for (var l = t[o], u = n[o], f = l.length, d = a[o] = new Array(f), h, p = 0; p < f; ++p) + (h = l[p] || u[p]) && (d[p] = h); for (; o < r; ++o) a[o] = t[o]; return new fn(a, this._parents, this._name, this._id); } -function ad(e) { +function ud(e) { return (e + "").trim().split(/^|\s+/).every(function(t) { var n = t.indexOf("."); return n >= 0 && (t = t.slice(0, n)), !t || t === "start"; }); } -function od(e, t, n) { - var r, i, s = ad(t) ? Gs : Bt; +function fd(e, t, n) { + var r, i, s = ud(t) ? Ks : Xt; return function() { var a = s(this, e), o = a.on; o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } -function ld(e, t) { +function cd(e, t) { var n = this._id; - return arguments.length < 2 ? Tt(this.node(), n).on.on(e) : this.each(od(n, e, t)); + return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(fd(n, e, t)); } -function ud(e) { +function hd(e) { return function() { var t = this.parentNode; for (var n in this.__transition) if (+n !== e) return; t && t.removeChild(this); }; } -function fd() { - return this.on("end.remove", ud(this._id)); +function dd() { + return this.on("end.remove", hd(this._id)); } -function cd(e) { +function pd(e) { var t = this._name, n = this._id; - typeof e != "function" && (e = Ys(e)); + typeof e != "function" && (e = Bs(e)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, c = 0; c < l; ++c) - (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Tt(f, n))); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, d, h = 0; h < l; ++h) + (f = o[h]) && (d = e.call(f, f.__data__, h, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[h] = d, Ui(u[h], t, n, h, u, Rt(f, n))); return new fn(s, this._parents, t, n); } -function hd(e) { +function vd(e) { var t = this._name, n = this._id; - typeof e != "function" && (e = Go(e)); + typeof e != "function" && (e = jo(e)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) - if (f = l[p]) { - for (var c = e.call(f, f.__data__, p, l), d, y = Tt(f, n), x = 0, m = c.length; x < m; ++x) - (d = c[x]) && Gi(d, t, n, x, c, y); - s.push(c), a.push(f); + for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) + if (f = l[d]) { + for (var h = e.call(f, f.__data__, d, l), p, _ = Rt(f, n), x = 0, y = h.length; x < y; ++x) + (p = h[x]) && Ui(p, t, n, x, h, _); + s.push(h), a.push(f); } return new fn(s, a, t, n); } -var dd = br.prototype.constructor; -function pd() { - return new dd(this._groups, this._parents); +var gd = br.prototype.constructor; +function _d() { + return new gd(this._groups, this._parents); } -function vd(e, t) { +function md(e, t) { var n, r, i; return function() { var s = mr(this, e), a = (this.style.removeProperty(e), mr(this, e)); return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function gl(e) { +function ml(e) { return function() { this.style.removeProperty(e); }; } -function gd(e, t, n) { +function yd(e, t, n) { var r, i = n + "", s; return function() { var a = mr(this, e); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function _d(e, t, n) { +function wd(e, t, n) { var r, i, s; return function() { var a = mr(this, e), o = n(this), l = o + ""; return o == null && (l = o = (this.style.removeProperty(e), mr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); }; } -function md(e, t) { +function xd(e, t) { var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Bt(this, e), u = l.on, f = l.value[s] == null ? o || (o = gl(t)) : void 0; + var l = Xt(this, e), u = l.on, f = l.value[s] == null ? o || (o = ml(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function yd(e, t, n) { - var r = (e += "") == "transform" ? bh : vl; - return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, gl(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, Ks(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); +function bd(e, t, n) { + var r = (e += "") == "transform" ? Eh : _l; + return t == null ? this.styleTween(e, md(e, r)).on("end.style." + e, ml(e)) : typeof t == "function" ? this.styleTween(e, wd(e, r, js(this, "style." + e, t))).each(xd(this._id, e)) : this.styleTween(e, yd(e, r, t), n).on("end.style." + e, null); } -function wd(e, t, n) { +function $d(e, t, n) { return function(r) { this.style.setProperty(e, t.call(this, r), n); }; } -function xd(e, t, n) { +function Ad(e, t, n) { var r, i; function s() { var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && wd(e, a, n)), r; + return a !== i && (r = (i = a) && $d(e, a, n)), r; } return s._value = t, s; } -function bd(e, t, n) { +function Ed(e, t, n) { var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (t == null) return this.tween(r, null); if (typeof t != "function") throw new Error(); - return this.tween(r, xd(e, t, n ?? "")); + return this.tween(r, Ad(e, t, n ?? "")); } -function $d(e) { +function Td(e) { return function() { this.textContent = e; }; } -function Ad(e) { +function Rd(e) { return function() { var t = e(this); this.textContent = t ?? ""; }; } -function Ed(e) { - return this.tween("text", typeof e == "function" ? Ad(Ks(this, "text", e)) : $d(e == null ? "" : e + "")); +function Sd(e) { + return this.tween("text", typeof e == "function" ? Rd(js(this, "text", e)) : Td(e == null ? "" : e + "")); } -function Td(e) { +function Cd(e) { return function(t) { this.textContent = e.call(this, t); }; } -function Cd(e) { +function Nd(e) { var t, n; function r() { var i = e.apply(this, arguments); - return i !== n && (t = (n = i) && Td(i)), t; + return i !== n && (t = (n = i) && Cd(i)), t; } return r._value = e, r; } -function Rd(e) { +function kd(e) { var t = "text"; if (arguments.length < 1) return (t = this.tween(t)) && t._value; if (e == null) return this.tween(t, null); if (typeof e != "function") throw new Error(); - return this.tween(t, Cd(e)); + return this.tween(t, Nd(e)); } -function Sd() { - for (var e = this._name, t = this._id, n = _l(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Md() { + for (var e = this._name, t = this._id, n = yl(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) if (l = a[u]) { - var f = Tt(l, t); - Gi(l, e, n, u, a, { + var f = Rt(l, t); + Ui(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, @@ -4503,97 +4503,97 @@ function Sd() { } return new fn(r, this._parents, e, n); } -function Nd() { +function Pd() { var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = Bt(this, r), f = u.on; + var u = Xt(this, r), f = u.on; f !== e && (t = (e = f).copy(), t._.cancel.push(o), t._.interrupt.push(o), t._.end.push(l)), u.on = t; }), i === 0 && s(); }); } -var kd = 0; +var Dd = 0; function fn(e, t, n, r) { this._groups = e, this._parents = t, this._name = n, this._id = r; } -function wi(e) { +function yi(e) { return br().transition(e); } -function _l() { - return ++kd; +function yl() { + return ++Dd; } var jt = br.prototype; -fn.prototype = wi.prototype = { +fn.prototype = yi.prototype = { constructor: fn, - select: cd, - selectAll: hd, + select: pd, + selectAll: vd, selectChild: jt.selectChild, selectChildren: jt.selectChildren, - filter: id, - merge: sd, - selection: pd, - transition: Sd, + filter: od, + merge: ld, + selection: _d, + transition: Md, call: jt.call, nodes: jt.nodes, node: jt.node, size: jt.size, empty: jt.empty, each: jt.each, - on: ld, - attr: Hh, - attrTween: Uh, - style: yd, - styleTween: bd, - text: Ed, - textTween: Rd, - remove: fd, - tween: Oh, - delay: jh, - duration: Qh, - ease: td, - easeVarying: rd, - end: Nd, + on: cd, + attr: Xh, + attrTween: jh, + style: bd, + styleTween: Ed, + text: Sd, + textTween: kd, + remove: dd, + tween: Lh, + delay: Qh, + duration: nd, + ease: id, + easeVarying: ad, + end: Pd, [Symbol.iterator]: jt[Symbol.iterator] }; -function Md(e) { +function Od(e) { return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Pd = { +var Fd = { time: null, // Set on use. delay: 0, duration: 250, - ease: Md + ease: Od }; -function Dd(e, t) { +function Id(e, t) { for (var n; !(n = e.__transition) || !(n = n[t]); ) if (!(e = e.parentNode)) throw new Error(`transition ${t} not found`); return n; } -function Od(e) { +function Ld(e) { var t, n; - e instanceof fn ? (t = e._id, e = e._name) : (t = _l(), (n = Pd).time = Us(), e = e == null ? null : e + ""); + e instanceof fn ? (t = e._id, e = e._name) : (t = yl(), (n = Fd).time = Gs(), e = e == null ? null : e + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && Gi(l, e, t, u, a, n || Dd(l, t)); + (l = a[u]) && Ui(l, e, t, u, a, n || Id(l, t)); return new fn(r, this._parents, e, t); } -br.prototype.interrupt = Mh; -br.prototype.transition = Od; -const Cs = Math.PI, Rs = 2 * Cs, Sn = 1e-6, Fd = Rs - Sn; -function ml(e) { +br.prototype.interrupt = Oh; +br.prototype.transition = Ld; +const Ss = Math.PI, Cs = 2 * Ss, Nn = 1e-6, qd = Cs - Nn; +function wl(e) { this._ += e[0]; for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t]; } -function Id(e) { +function Vd(e) { let t = Math.floor(e); if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return ml; + if (t > 15) return wl; const n = 10 ** t; return function(r) { this._ += r[0]; @@ -4601,10 +4601,10 @@ function Id(e) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Ld { +class zd { constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? ml : Id(t); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? wl : Vd(t); } moveTo(t, n) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; @@ -4623,20 +4623,20 @@ class Ld { } arcTo(t, n, r, i, s) { if (t = +t, n = +n, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`); - let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, c = f * f + p * p; + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, d = o - n, h = f * f + d * d; if (this._x1 === null) this._append`M${this._x1 = t},${this._y1 = n}`; - else if (c > Sn) if (!(Math.abs(p * l - u * f) > Sn) || !s) + else if (h > Nn) if (!(Math.abs(d * l - u * f) > Nn) || !s) this._append`L${this._x1 = t},${this._y1 = n}`; else { - let d = r - a, y = i - o, x = l * l + u * u, m = d * d + y * y, b = Math.sqrt(x), D = Math.sqrt(c), M = s * Math.tan((Cs - Math.acos((x + c - m) / (2 * b * D))) / 2), S = M / D, I = M / b; - Math.abs(S - 1) > Sn && this._append`L${t + S * f},${n + S * p}`, this._append`A${s},${s},0,0,${+(p * d > f * y)},${this._x1 = t + I * l},${this._y1 = n + I * u}`; + let p = r - a, _ = i - o, x = l * l + u * u, y = p * p + _ * _, b = Math.sqrt(x), O = Math.sqrt(h), N = s * Math.tan((Ss - Math.acos((x + h - y) / (2 * b * O))) / 2), M = N / O, F = N / b; + Math.abs(M - 1) > Nn && this._append`L${t + M * f},${n + M * d}`, this._append`A${s},${s},0,0,${+(d * p > f * _)},${this._x1 = t + F * l},${this._y1 = n + F * u}`; } } arc(t, n, r, i, s, a) { if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`); - let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, p = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Sn || Math.abs(this._y1 - f) > Sn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > Fd ? this._append`A${r},${r},0,1,${p},${t - o},${n - l}A${r},${r},0,1,${p},${this._x1 = u},${this._y1 = f}` : c > Sn && this._append`A${r},${r},0,${+(c >= Cs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = t + o, f = n + l, d = 1 ^ a, h = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Nn || Math.abs(this._y1 - f) > Nn) && this._append`L${u},${f}`, r && (h < 0 && (h = h % Cs + Cs), h > qd ? this._append`A${r},${r},0,1,${d},${t - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : h > Nn && this._append`A${r},${r},0,${+(h >= Ss)},${d},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(t, n, r, i) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4645,24 +4645,24 @@ class Ld { return this._; } } -function qd(e) { +function Hd(e) { for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); return n; } -const Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Le(e) { +const Yd = Hd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Fe(e) { return function() { return e; }; } -const La = Math.abs, De = Math.atan2, Rn = Math.cos, zd = Math.max, is = Math.min, Mt = Math.sin, nr = Math.sqrt, Xe = 1e-12, Hr = Math.PI, Mi = Hr / 2, xi = 2 * Hr; -function Hd(e) { - return e > 1 ? 0 : e < -1 ? Hr : Math.acos(e); +const Va = Math.abs, Me = Math.atan2, Cn = Math.cos, Bd = Math.max, ss = Math.min, Pt = Math.sin, nr = Math.sqrt, Ye = 1e-12, Yr = Math.PI, ki = Yr / 2, wi = 2 * Yr; +function Xd(e) { + return e > 1 ? 0 : e < -1 ? Yr : Math.acos(e); } -function qa(e) { - return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); +function za(e) { + return e >= 1 ? ki : e <= -1 ? -ki : Math.asin(e); } -function Yd(e) { +function Wd(e) { let t = 3; return e.digits = function(n) { if (!arguments.length) return t; @@ -4674,141 +4674,141 @@ function Yd(e) { t = r; } return e; - }, () => new Ld(t); + }, () => new zd(t); } -function Bd(e) { +function Ud(e) { return e.innerRadius; } -function Xd(e) { +function Gd(e) { return e.outerRadius; } -function Wd(e) { +function Kd(e) { return e.startAngle; } -function Ud(e) { +function jd(e) { return e.endAngle; } -function Gd(e) { +function Jd(e) { return e && e.padAngle; } -function Kd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; - if (!(c * c < Xe)) - return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; +function Zd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, d = o - s, h = d * l - f * u; + if (!(h * h < Ye)) + return h = (f * (t - s) - d * (e - i)) / h, [e + h * l, t + h * u]; } -function ui(e, t, n, r, i, s, a) { - var o = e - n, l = t - r, u = (a ? s : -s) / nr(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, x = r + p, m = (c + y) / 2, b = (d + x) / 2, D = y - c, M = x - d, S = D * D + M * M, I = i - s, q = c * x - y * d, X = (M < 0 ? -1 : 1) * nr(zd(0, I * I * S - q * q)), se = (q * M - D * X) / S, Q = (-q * D - M * X) / S, W = (q * M + D * X) / S, ae = (-q * D + M * X) / S, ue = se - m, O = Q - b, F = W - m, Ne = ae - b; - return ue * ue + O * O > F * F + Ne * Ne && (se = W, Q = ae), { - cx: se, - cy: Q, +function li(e, t, n, r, i, s, a) { + var o = e - n, l = t - r, u = (a ? s : -s) / nr(o * o + l * l), f = u * l, d = -u * o, h = e + f, p = t + d, _ = n + f, x = r + d, y = (h + _) / 2, b = (p + x) / 2, O = _ - h, N = x - p, M = O * O + N * N, F = i - s, W = h * x - _ * p, I = (N < 0 ? -1 : 1) * nr(Bd(0, F * F * M - W * W)), ee = (W * N - O * I) / M, fe = (-W * O - N * I) / M, U = (W * N + O * I) / M, re = (-W * O + N * I) / M, le = ee - y, D = fe - b, H = U - y, te = re - b; + return le * le + D * D > H * H + te * te && (ee = U, fe = re), { + cx: ee, + cy: fe, x01: -f, - y01: -p, - x11: se * (i / I - 1), - y11: Q * (i / I - 1) + y01: -d, + x11: ee * (i / F - 1), + y11: fe * (i / F - 1) }; } -function mt() { - var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); +function yt() { + var e = Ud, t = Gd, n = Fe(0), r = null, i = Kd, s = jd, a = Jd, o = null, l = Wd(u); function u() { - var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, x = s.apply(this, arguments) - Mi, m = La(x - y), b = x > y; - if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); - else if (m > xi - Xe) - o.moveTo(d * Rn(y), d * Mt(y)), o.arc(0, 0, d, y, x, !b), c > Xe && (o.moveTo(c * Rn(x), c * Mt(x)), o.arc(0, 0, c, x, y, b)); + var f, d, h = +e.apply(this, arguments), p = +t.apply(this, arguments), _ = i.apply(this, arguments) - ki, x = s.apply(this, arguments) - ki, y = Va(x - _), b = x > _; + if (o || (o = f = l()), p < h && (d = p, p = h, h = d), !(p > Ye)) o.moveTo(0, 0); + else if (y > wi - Ye) + o.moveTo(p * Cn(_), p * Pt(_)), o.arc(0, 0, p, _, x, !b), h > Ye && (o.moveTo(h * Cn(x), h * Pt(x)), o.arc(0, 0, h, x, _, b)); else { - var D = y, M = x, S = y, I = x, q = m, X = m, se = a.apply(this, arguments) / 2, Q = se > Xe && (r ? +r.apply(this, arguments) : nr(c * c + d * d)), W = is(La(d - c) / 2, +n.apply(this, arguments)), ae = W, ue = W, O, F; - if (Q > Xe) { - var Ne = qa(Q / c * Mt(se)), lt = qa(Q / d * Mt(se)); - (q -= Ne * 2) > Xe ? (Ne *= b ? 1 : -1, S += Ne, I -= Ne) : (q = 0, S = I = (y + x) / 2), (X -= lt * 2) > Xe ? (lt *= b ? 1 : -1, D += lt, M -= lt) : (X = 0, D = M = (y + x) / 2); + var O = _, N = x, M = _, F = x, W = y, I = y, ee = a.apply(this, arguments) / 2, fe = ee > Ye && (r ? +r.apply(this, arguments) : nr(h * h + p * p)), U = ss(Va(p - h) / 2, +n.apply(this, arguments)), re = U, le = U, D, H; + if (fe > Ye) { + var te = za(fe / h * Pt(ee)), je = za(fe / p * Pt(ee)); + (W -= te * 2) > Ye ? (te *= b ? 1 : -1, M += te, F -= te) : (W = 0, M = F = (_ + x) / 2), (I -= je * 2) > Ye ? (je *= b ? 1 : -1, O += je, N -= je) : (I = 0, O = N = (_ + x) / 2); } - var ce = d * Rn(D), Ae = d * Mt(D), ee = c * Rn(I), Oe = c * Mt(I); - if (W > Xe) { - var U = d * Rn(M), ke = d * Mt(M), Ct = c * Rn(S), oe = c * Mt(S), ze; - if (m < Hr) - if (ze = Kd(ce, Ae, Ct, oe, U, ke, ee, Oe)) { - var Rt = ce - ze[0], St = Ae - ze[1], Xt = U - ze[0], ge = ke - ze[1], Wt = 1 / Mt(Hd((Rt * Xt + St * ge) / (nr(Rt * Rt + St * St) * nr(Xt * Xt + ge * ge))) / 2), hn = nr(ze[0] * ze[0] + ze[1] * ze[1]); - ae = is(W, (c - hn) / (Wt - 1)), ue = is(W, (d - hn) / (Wt + 1)); + var qe = p * Cn(O), de = p * Pt(O), ce = h * Cn(F), _e = h * Pt(F); + if (U > Ye) { + var at = p * Cn(N), G = p * Pt(N), Pe = h * Cn(M), St = h * Pt(M), Z; + if (y < Yr) + if (Z = Zd(qe, de, Pe, St, at, G, ce, _e)) { + var hn = qe - Z[0], Ct = de - Z[1], dn = at - Z[0], Wt = G - Z[1], vt = 1 / Pt(Xd((hn * dn + Ct * Wt) / (nr(hn * hn + Ct * Ct) * nr(dn * dn + Wt * Wt))) / 2), En = nr(Z[0] * Z[0] + Z[1] * Z[1]); + re = ss(U, (h - En) / (vt - 1)), le = ss(U, (p - En) / (vt + 1)); } else - ae = ue = 0; + re = le = 0; } - X > Xe ? ue > Xe ? (O = ui(Ct, oe, ce, Ae, d, ue, b), F = ui(U, ke, ee, Oe, d, ue, b), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < W ? o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(F.y01, F.x01), !b) : (o.arc(O.cx, O.cy, ue, De(O.y01, O.x01), De(O.y11, O.x11), !b), o.arc(0, 0, d, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), !b), o.arc(F.cx, F.cy, ue, De(F.y11, F.x11), De(F.y01, F.x01), !b))) : (o.moveTo(ce, Ae), o.arc(0, 0, d, D, M, !b)) : o.moveTo(ce, Ae), !(c > Xe) || !(q > Xe) ? o.lineTo(ee, Oe) : ae > Xe ? (O = ui(ee, Oe, U, ke, c, -ae, b), F = ui(ce, Ae, Ct, oe, c, -ae, b), o.lineTo(O.cx + O.x01, O.cy + O.y01), ae < W ? o.arc(O.cx, O.cy, ae, De(O.y01, O.x01), De(F.y01, F.x01), !b) : (o.arc(O.cx, O.cy, ae, De(O.y01, O.x01), De(O.y11, O.x11), !b), o.arc(0, 0, c, De(O.cy + O.y11, O.cx + O.x11), De(F.cy + F.y11, F.cx + F.x11), b), o.arc(F.cx, F.cy, ae, De(F.y11, F.x11), De(F.y01, F.x01), !b))) : o.arc(0, 0, c, I, S, b); + I > Ye ? le > Ye ? (D = li(Pe, St, qe, de, p, le, b), H = li(at, G, ce, _e, p, le, b), o.moveTo(D.cx + D.x01, D.cy + D.y01), le < U ? o.arc(D.cx, D.cy, le, Me(D.y01, D.x01), Me(H.y01, H.x01), !b) : (o.arc(D.cx, D.cy, le, Me(D.y01, D.x01), Me(D.y11, D.x11), !b), o.arc(0, 0, p, Me(D.cy + D.y11, D.cx + D.x11), Me(H.cy + H.y11, H.cx + H.x11), !b), o.arc(H.cx, H.cy, le, Me(H.y11, H.x11), Me(H.y01, H.x01), !b))) : (o.moveTo(qe, de), o.arc(0, 0, p, O, N, !b)) : o.moveTo(qe, de), !(h > Ye) || !(W > Ye) ? o.lineTo(ce, _e) : re > Ye ? (D = li(ce, _e, at, G, h, -re, b), H = li(qe, de, Pe, St, h, -re, b), o.lineTo(D.cx + D.x01, D.cy + D.y01), re < U ? o.arc(D.cx, D.cy, re, Me(D.y01, D.x01), Me(H.y01, H.x01), !b) : (o.arc(D.cx, D.cy, re, Me(D.y01, D.x01), Me(D.y11, D.x11), !b), o.arc(0, 0, h, Me(D.cy + D.y11, D.cx + D.x11), Me(H.cy + H.y11, H.cx + H.x11), b), o.arc(H.cx, H.cy, re, Me(H.y11, H.x11), Me(H.y01, H.x01), !b))) : o.arc(0, 0, h, F, M, b); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, p = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; - return [Rn(p) * f, Mt(p) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Yr / 2; + return [Cn(d) * f, Pt(d) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Fe(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Fe(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Fe(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Fe(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Fe(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Fe(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Fe(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function jd(e) { +function Qd(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Jd(e, t) { +function ep(e, t) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Zd(e) { +function tp(e) { return e; } -function ss() { - var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); +function as() { + var e = tp, t = ep, n = null, r = Fe(0), i = Fe(wi), s = Fe(0); function a(o) { - var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), x = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - x)), b, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; + var l, u = (o = Qd(o)).length, f, d, h = 0, p = new Array(u), _ = new Array(u), x = +r.apply(this, arguments), y = Math.min(wi, Math.max(-wi, i.apply(this, arguments) - x)), b, O = Math.min(Math.abs(y) / u, s.apply(this, arguments)), N = O * (y < 0 ? -1 : 1), M; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); - for (t != null ? d.sort(function(I, q) { - return t(y[I], y[q]); - }) : n != null && d.sort(function(I, q) { - return n(o[I], o[q]); - }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, x = b) - f = d[l], S = y[f], b = x + (S > 0 ? S * p : 0) + M, y[f] = { + (M = _[p[l] = l] = +e(o[l], l, o)) > 0 && (h += M); + for (t != null ? p.sort(function(F, W) { + return t(_[F], _[W]); + }) : n != null && p.sort(function(F, W) { + return n(o[F], o[W]); + }), l = 0, d = h ? (y - u * N) / h : 0; l < u; ++l, x = b) + f = p[l], M = _[f], b = x + (M > 0 ? M * d : 0) + N, _[f] = { data: o[f], index: l, - value: S, + value: M, startAngle: x, endAngle: b, - padAngle: D + padAngle: O }; - return y; + return _; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; + return arguments.length ? (e = typeof o == "function" ? o : Fe(+o), a) : e; }, a.sortValues = function(o) { return arguments.length ? (t = o, n = null, a) : t; }, a.sort = function(o) { return arguments.length ? (n = o, t = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Le(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Fe(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Fe(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Fe(+o), a) : s; }, a; } -function Pr(e, t, n) { +function Dr(e, t, n) { this.k = e, this.x = t, this.y = n; } -Pr.prototype = { - constructor: Pr, +Dr.prototype = { + constructor: Dr, scale: function(e) { - return e === 1 ? this : new Pr(this.k * e, this.x, this.y); + return e === 1 ? this : new Dr(this.k * e, this.x, this.y); }, translate: function(e, t) { - return e === 0 & t === 0 ? this : new Pr(this.k, this.x + this.k * e, this.y + this.k * t); + return e === 0 & t === 0 ? this : new Dr(this.k, this.x + this.k * e, this.y + this.k * t); }, apply: function(e) { return [e[0] * this.k + this.x, e[1] * this.k + this.y]; @@ -4838,61 +4838,73 @@ Pr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Pr.prototype; -var Qd = /* @__PURE__ */ Ku(''); -const ep = { +Dr.prototype; +var np = /* @__PURE__ */ Zu(''); +const rp = { hash: "svelte-80ulj4", code: `.pie-chart-svg.svelte-80ulj4 {width:100%;height:100%;max-width:700px;max-height:60vh;aspect-ratio:1 / 1; /* For a perfect circle, use 1:1 ratio */margin:0 auto;display:block;} @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function yl(e, t) { - Vi(t, !0), zs(e, ep); - let n = ie(t, "jsonData", 7), r = ie(t, "currentRound", 7, 1), i = ie(t, "mouseEventType", 15), s = ie(t, "mouseData", 15), a = ie(t, "mouseX", 15), o = ie(t, "mouseY", 15), l = ie(t, "requestRoundChange", 7, (h) => { - }), u = ie(t, "candidateColors", 23, () => []), f = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ie(t, "firstRoundDeterminesPercentages", 7, !1), c = ie(t, "randomizeOrder", 7, !1), d = ie(t, "displayPhase", 15, 0); - function y(h) { - return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; - } - const x = 800, m = 800, b = Math.min(x, m) * 0.3, D = x / 2, M = m / 2, S = "Pie", I = "PieOutline", q = "Donut", X = "TextLayer", se = "url(#cross-hatch)", Q = 1.15, W = 750, ae = 800, ue = "white", O = 1, F = "#ff00ff", Ne = 3; - function lt(h) { - return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); - } - let ce = [], Ae = [], ee = [], Oe = 0, U = 0; - const ke = {}, Ct = "No Further Rankings"; - let oe = /* @__PURE__ */ be(null); - function ze() { - const h = fe($(oe)); - h.select("#" + S).remove(), h.select("#" + I).remove(), h.select("#" + q).remove(), h.select("#" + X).remove(); - } - function Rt(h) { - l() && (_e = h, l()(h)); - } - function St(h) { - ze(), ee = Xt(h), ce = Qs(h, S, ee, D, M, 0, ge()), Qs(h, I, ee, D, M, 0, ge(), !1, !1, !0), Tr(); - } - tf(() => { - pn(), setTimeout( +function xl(e, t) { + qi(t, !0), Hs(e, rp); + let n = ie(t, "jsonData", 7), r = ie(t, "currentRound", 7, 1), i = ie(t, "mouseEventType", 15), s = ie(t, "mouseData", 15), a = ie(t, "mouseX", 15), o = ie(t, "mouseY", 15), l = ie(t, "requestRoundChange", 7, (c) => { + }), u = ie(t, "requestSkipToRound", 7, (c) => { + }), f = ie(t, "candidateColors", 23, () => []), d = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ie(t, "firstRoundDeterminesPercentages", 7, !1), p = ie(t, "randomizeOrder", 7, !1), _ = ie(t, "displayPhase", 15, 0); + function x(c) { + return c.isTransfer ? `${c.label}__transfer` : c.transferIndex != null ? `${c.label}__${c.transferIndex}` : c.label; + } + const y = 800, b = 800, O = Math.min(y, b) * 0.3, N = y / 2, M = b / 2, F = "Pie", W = "PieOutline", I = "Donut", ee = "TextLayer", fe = "url(#cross-hatch)", U = 1.15, re = 750, le = 800, D = "white", H = 1, te = "#ff00ff", je = 3; + function qe(c) { + return "hatch-" + c.replace(/[^a-zA-Z0-9]/g, "-"); + } + let de = [], ce = [], _e = [], at = 0, G = 0; + const Pe = {}, St = "No Further Rankings"; + let Z = /* @__PURE__ */ $e(null); + function hn() { + const c = he($(Z)); + c.select("#" + F).remove(), c.select("#" + W).remove(), c.select("#" + I).remove(), c.select("#" + ee).remove(); + } + function Ct(c) { + l() && (oe = c, l()(c)); + } + function dn(c) { + var m; + if (!((m = n()) != null && m.results) || c < 1 || c > n().results.length) return !1; + const g = n().results[c - 1].tallyResults; + return g.length > 0 && g.some((A) => Object.keys(A.transfers).length > 0); + } + function Wt(c) { + for (let g = c; g < n().results.length; g++) + if (dn(g)) return g; + return n().results.length; + } + function vt(c) { + hn(), _e = En(c), de = ta(c, F, _e, N, M, 0, Je()), ta(c, W, _e, N, M, 0, Je(), !1, !1, !0), Rr(); + } + sf(() => { + kt(), setTimeout( () => { - St(r()); + vt(r()); }, 0 ); }); - function Xt(h) { - const g = Ut(h); - return Oe = $r(h), g; + function En(c) { + const g = Rn(c); + return at = Gi(c), g; } - function ge() { - return b; + function Je() { + return O; } - function Wt() { - return ge() * 1.41; + function $r() { + return Je() * 1.41; } - function hn(h) { + function Ar(c) { let g = 0; - for (let _ = 1; _ < h; _++) { - const A = n().results[_ - 1].tallyResults; + for (let m = 1; m < c; m++) { + const A = n().results[m - 1].tallyResults; for (let E = 0; E < A.length; E++) { const T = A[E].transfers; if (T) { @@ -4903,370 +4915,382 @@ function yl(e, t) { } return g; } - function Jr(h, g) { - if (h === "exhausted") return hn(g); + function Tn(c, g) { + if (c === "exhausted") return Ar(g); { - const _ = n().results[g - 1].tally; - return Number(_[h]); + const m = n().results[g - 1].tally; + return Number(m[c]); } } - function Zr(h, g) { - return Jr(h, g).toLocaleString("en-US"); + function Jn(c, g) { + return Tn(c, g).toLocaleString("en-US"); } - function En(h, g) { - const _ = p() ? Oe : Ki(g); - return (Jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Zr(c, g) { + const m = h() ? at : Ki(g); + return (Tn(c, g) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function $r(h) { - const g = n().results[h - 1].tally; - let _ = 0; + function Gi(c) { + const g = n().results[c - 1].tally; + let m = 0; for (let [A, E] of Object.entries(g)) - _ += Number(E); - return _; + m += Number(E); + return m; } - function dn(h) { - return h === "exhausted" || h === "Inactive Ballots"; + function Nt(c) { + return c === "exhausted" || c === "Inactive Ballots"; } - function Ki(h) { - const g = n().results[h - 1].tally; - let _ = 0; + function Ki(c) { + const g = n().results[c - 1].tally; + let m = 0; for (let [A, E] of Object.entries(g)) - dn(A) || (_ += Number(E)); - return _; + Nt(A) || (m += Number(E)); + return m; } - function jn(h, g) { - if (!h || h < 1 || h > n().results.length) + function w(c, g) { + if (!c || c < 1 || c > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && h === n().results.length) + if (d() && c === n().results.length) return []; - const _ = n().results[h - 1].tallyResults, A = []; - for (let E = 0; E < _.length; E++) { - const T = _[E][g]; + const m = n().results[c - 1].tallyResults, A = []; + for (let E = 0; E < m.length; E++) { + const T = m[E][g]; T != null && A.push(T); } return A; } - function Jn(h) { - return jn(h, "eliminated"); + function Y(c) { + return w(c, "eliminated"); } - function w(h) { + function se(c) { let g = []; - for (let _ = 1; _ <= h; _++) g = g.concat(jn(_, "elected")); + for (let m = 1; m <= c; m++) g = g.concat(w(m, "elected")); return [...new Set(g)]; } - function G(h, g) { - const _ = n().results[g - 1].tallyResults; + function we(c, g) { + const m = n().results[g - 1].tallyResults; let A = 0; - const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); + const E = m.findIndex((T) => (T == null ? void 0 : T.elected) && c == T.elected); if (E >= 0) { - const T = _[E].transfers; + const T = m[E].transfers; if (T) - for (let [P, z] of Object.entries(T)) A += Number(z); + for (let [P, V] of Object.entries(T)) A += Number(V); } else return 0; return A; } - function re(h, g) { - h.some((_) => dn(_.label)) || h.push({ label: "exhausted", value: hn(g) }); + function ye(c, g) { + c.some((m) => Nt(m.label)) || c.push({ label: "exhausted", value: Ar(g) }); } - function me(h) { - let g = h | 0; + function ue(c) { + let g = c | 0; return () => { g = g + 1831565813 | 0; - let _ = Math.imul(g ^ g >>> 15, 1 | g); - return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; + let m = Math.imul(g ^ g >>> 15, 1 | g); + return m = m + Math.imul(m ^ m >>> 7, 61 | m) ^ m, ((m ^ m >>> 14) >>> 0) / 4294967296; }; } - function ye(h) { + function Ve(c) { let g = 5381; - for (let _ = 0; _ < h.length; _++) - g = (g << 5) + g + h.charCodeAt(_) | 0; + for (let m = 0; m < c.length; m++) + g = (g << 5) + g + c.charCodeAt(m) | 0; return g; } - function le(h) { + function Ut(c) { var E; - if (h.length <= 3) return h; - const g = ye(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = me(g), A = [...h]; + if (c.length <= 3) return c; + const g = Ve(((E = n().config) == null ? void 0 : E.contest) ?? ""), m = ue(g), A = [...c]; for (let T = A.length - 1; T > 0; T--) { - const P = Math.floor(_() * (T + 1)); + const P = Math.floor(m() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function Fe() { - const h = Object.keys(n().results[0].tally), g = h.filter((E) => !dn(E)), _ = h.filter((E) => dn(E)); - return [...c() ? le(g) : g, ..._]; - } - function Ut(h) { - const g = n().results[h - 1].tally, _ = []; - for (const A of Fe()) - A in g && _.push({ label: A, value: Number(g[A]) }); - return re(_, h), _; - } - function Nt(h) { - const g = n().results[h - 1].tally, _ = []; - for (const A of Fe()) - _.push({ label: A, value: Number(g[A] ?? 0) }); - return re(_, h), _; - } - function Tn(h, g) { - const _ = []; - for (const A of h) { + function gt() { + const c = Object.keys(n().results[0].tally), g = c.filter((E) => !Nt(E)), m = c.filter((E) => Nt(E)); + return [...p() ? Ut(g) : g, ...m]; + } + function Rn(c) { + const g = n().results[c - 1].tally, m = []; + for (const A of gt()) + A in g && m.push({ label: A, value: Number(g[A]) }); + return ye(m, c), m; + } + function pn(c) { + const g = n().results[c - 1].tally, m = []; + for (const A of gt()) + m.push({ label: A, value: Number(g[A] ?? 0) }); + return ye(m, c), m; + } + function ze(c, g) { + const m = []; + for (const A of c) { if (A.label === "exhausted" || A.isTransfer) { - _.push(A); + m.push(A); continue; } - const E = G(A.label, g); - E > 0 ? (_.push({ + const E = we(A.label, g); + E > 0 ? (m.push({ label: A.label, value: E, isTransfer: !0 - }), _.push({ ...A, value: A.value - E })) : _.push(A); + }), m.push({ ...A, value: A.value - E })) : m.push(A); } - return _; + return m; } - function pn() { - const h = fe($(oe)).select("defs").select("#cross-hatch"); + function kt() { + const c = he($(Z)).select("defs").select("#cross-hatch"); let g = 0; - for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? ke[_] = Vd[g] : ke[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : ke[_] = u()[g % u().length], g++; + for (let [m, A] of Object.entries(n().results[0].tally)) { + !f() || f().length === 0 ? g < 10 ? Pe[m] = Yd[g] : Pe[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Pe[m] = f()[g % f().length], g++; { - const E = h.clone(!0); - E.attr("id", lt(_)).select("rect").attr("fill", ke[_]), E.selectAll("circle").attr("fill", "#383838"); + const E = c.clone(!0); + E.attr("id", qe(m)).select("rect").attr("fill", Pe[m]), E.selectAll("circle").attr("fill", "#383838"); } } - ke.exhausted = se, ke["Inactive Ballots"] = se; + Pe.exhausted = fe, Pe["Inactive Ballots"] = fe; } - function He() { - fe($(oe)).select("#" + q).remove(); + function ot() { + he($(Z)).select("#" + I).remove(); } - function Ze(h, g) { - const _ = wi("global").duration(ae); - g && _.on("end", g); - const A = Tn(ee, h), T = ss().sort(null).value((P) => P.value)(A); - ra(h, S, T, 0, ge()), ra(h, I, T, 0, ge(), !0), ee = A, ce = T, He(), $l(h), Nl(), Ml(0, ge()), Tr(); + function _t(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g); + const A = ze(_e, c), T = as().sort(null).value((P) => P.value)(A); + sa(c, F, T, 0, Je()), sa(c, W, T, 0, Je(), !0), _e = A, de = T, ot(), Tl(c), Pl(), Ol(0, Je()), Rr(); } - function Me(h, g) { - const _ = wi("global").duration(ae); - g && _.on("end", g), Al(h); + function Mt(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g), Rl(c); } - function Qe(h, g) { - const _ = wi("global").duration(ae); - g && _.on("end", g), xl(h), bl(ge(), Wt()); + function mt(c, g) { + const m = yi("global").duration(le); + g && m.on("end", g), Al(c), El(Je(), $r()); } - let we = !1, ut = []; - function Ye() { - Tr(), we = !1, ft(); + let xe = !1, De = []; + function Ee() { + Rr(), xe = !1, Gt(); } - function ft() { - if (ut.length === 0) { - _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), kt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), St(r()))); + function Gt() { + if (De.length === 0) { + oe !== r() && (r() === oe + 1 && oe > 0 && r() <= n().results.length ? (oe = r(), Zn(r())) : r() >= 1 && r() <= n().results.length && (oe = r(), _(0), vt(r()))); return; } - const h = ut.shift(); - switch (h.type) { + const c = De.shift(); + switch (c.type) { case "round": { - const g = h.round; - g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, kt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), St(g)), ft()); + const g = c.round; + g === oe + 1 && oe > 0 && g <= n().results.length ? (oe = g, Zn(g)) : (g !== oe && g >= 1 && g <= n().results.length && (oe = g, _(0), vt(g)), Gt()); break; } case "step": - Qr(); + Zs(); break; } } - function kt(h) { - if (h <= 1 || h > n().results.length) { - ft(); + function Zn(c) { + if (c <= 1 || c > n().results.length) { + Gt(); return; } - we = !0, U = h, d(0), Ze(U - 1, () => { - d(1), Me(U - 1, () => { - d(2), Qe(U, () => { - d(0), Ye(); + xe = !0, G = c, _(0), _t(G - 1, () => { + _(1), Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); }); }); } - function Zn() { - we || (we = !0, U = r(), Qn()); + function Er() { + xe || (xe = !0, G = r(), Qn()); } function Qn() { - if (d( + if (_( 0 // if in the middle of "one small step" animation, reset to 0. - ), ut.length > 0) { - Ye(); + ), De.length > 0) { + Ee(); return; } - const h = U < n().results.length - 1 ? Qn : () => { - d(0), Ye(); + const c = G < n().results.length - 1 ? Qn : () => { + _(0), Ee(); }; - Ze(U, () => { - d(1), Me(U, () => { - d(2), U++, Rt(U), Qe(U, h); + _t(G, () => { + _(1), Mt(G, () => { + _(2), G++, Ct(G), mt(G, c); }); }); } - Fs(() => { - Ar(); + Is(() => { + Kt(); }); - let _e = 0; - function Ar() { - if (_e != r()) { - if (we) { - ut.push({ type: "round", round: r() }); + let oe = 0; + function Kt() { + if (oe != r()) { + if (xe) { + De.push({ type: "round", round: r() }); return; } - _e == r() - 1 && _e > 0 ? Kt() : Gt(r()), _e = r(); + if (oe == r() - 1 && oe > 0) + if (dn(oe)) + $l(); + else { + const c = Wt(r()); + if (u()) { + oe = c, c < n().results.length ? u()(c + 1) : u()(c); + return; + } + } + else + ji(r()); + oe = r(); } } - function Gt(h) { - if (we) { - ut.push({ type: "round", round: h }); + function ji(c) { + if (xe) { + De.push({ type: "round", round: c }); return; } - d(0), St(h); + _(0), vt(c); } - function Kt() { - if (we) { - ut.push({ type: "round", round: r() }); + function $l() { + if (xe) { + De.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (U = r(), U > n().results.length) { - Tr(), we = !1; + if (G = r(), G > n().results.length) { + Rr(), xe = !1; return; } - we = !0, d() === 0 ? Ze(U - 1, () => { - d(1), Me(U - 1, () => { - d(2), Qe(U, () => { - d(0), Ye(); + xe = !0, _() === 0 ? _t(G - 1, () => { + _(1), Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); }); - }) : d() === 1 ? Me(U - 1, () => { - d(2), Qe(U, () => { - d(0), Ye(); + }) : _() === 1 ? Mt(G - 1, () => { + _(2), mt(G, () => { + _(0), Ee(); }); - }) : d() === 2 && Qe(U, () => { - d(0), Ye(); + }) : _() === 2 && mt(G, () => { + _(0), Ee(); }); } - function Qr() { + function Zs() { if (r() > n().results.length) { - Tr(), we = !1; + Rr(), xe = !1; return; } - if (we) { - ut.push({ type: "step" }); + if (xe) { + De.push({ type: "step" }); return; } - we = !0, U = r(), d() === 0 ? Ze(U, () => { - d(1), Ye(); - }) : d() === 1 ? Me(U, () => { - d(2), Ye(); - }) : d() === 2 ? (U++, Rt(U), Qe(U, () => { - d(0), Ye(); - })) : (we = !1, console.warn("displayPhase out of range at ", d())); - } - function xl(h) { - ee = Nt(h), ce = ta(h, S, ee, 0, ge(), !0), ta(h, I, ee, 0, ge(), !1, !0); - } - function bl(h, g) { - const _ = fe($(oe)).select("#" + q), E = fe($(oe)).select("#" + S), T = {}; - for (const N of ce) { - const k = N.data.label; - if (N.data.isTransfer) continue; - const C = E.select("#" + CSS.escape(y(N.data))); - C.empty() || (T[k] = { - oldStart: Number(C.attr("prevStart")), - oldEnd: Number(C.attr("prevEnd")), - newStart: N.startAngle, - newEnd: N.endAngle + xe = !0, G = r(), _() === 0 ? _t(G, () => { + _(1), Ee(); + }) : _() === 1 ? Mt(G, () => { + _(2), Ee(); + }) : _() === 2 ? (G++, Ct(G), mt(G, () => { + _(0), Ee(); + })) : (xe = !1, console.warn("displayPhase out of range at ", _())); + } + function Al(c) { + _e = pn(c), de = ra(c, F, _e, 0, Je(), !0), ra(c, W, _e, 0, Je(), !1, !0); + } + function El(c, g) { + const m = he($(Z)).select("#" + I), E = he($(Z)).select("#" + F), T = {}; + for (const C of de) { + const k = C.data.label; + if (C.data.isTransfer) continue; + const R = E.select("#" + CSS.escape(x(C.data))); + R.empty() || (T[k] = { + oldStart: Number(R.attr("prevStart")), + oldEnd: Number(R.attr("prevEnd")), + newStart: C.startAngle, + newEnd: C.endAngle }); } - const P = _.selectAll(".slice"); - let z = P.size(); + const P = m.selectAll(".slice"); + let V = P.size(); function L() { - z--, z === 0 && kl(); + V--, V === 0 && Dl(); } - P.select("path").transition("global").duration(W).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, Pe = T[N.data.label]; - let Z, Be; - if (Pe) { - const er = (Pe.oldStart + Pe.oldEnd) / 2, Fl = (Pe.newStart + Pe.newEnd) / 2, Il = k - er; - Z = Fl + Il, Be = Z + R; + P.select("path").transition("global").duration(re).attrTween("d", function(C) { + const k = C.startAngle, R = C.endAngle, S = R - k, ke = T[C.data.label]; + let Q, He; + if (ke) { + const er = (ke.oldStart + ke.oldEnd) / 2, ql = (ke.newStart + ke.newEnd) / 2, Vl = k - er; + Q = ql + Vl, He = Q + S; } else - Z = k, Be = C; - const te = Jt(k, Z), Ee = Jt(C, Be), ti = Jt(g, h), Cr = mt(); + Q = k, He = R; + const ae = Jt(k, Q), Te = Jt(R, He), ei = Jt(g, c), Sr = yt(); return function(er) { - return Cr.innerRadius(Math.min(ti(er), h) - 1).outerRadius(ti(er)).startAngle(te(er)).endAngle(Ee(er)), Cr(N); + return Sr.innerRadius(Math.min(ei(er), c) - 1).outerRadius(ei(er)).startAngle(ae(er)).endAngle(Te(er)), Sr(C); }; - }).on("end", (N) => L()); - } - function $l(h) { - const g = Tl(h, ce); - Ae = ea(h, q, g, D, M, ge(), Wt(), !1, !0); - const _ = fe($(oe)); - _.select("#" + S).raise(), _.select("#" + I).raise(); - } - function Al(h) { - const g = Rl(h, Ae, ce); - Ae = ia(h, q, g, ge(), Wt(), !1); - } - function Er(h) { - return ke[h.data.label]; - } - function El(h) { - const g = {}, _ = n().results[h - 1].tallyResults; - for (let A = 0; A < _.length; A++) { - let E = _[A].eliminated; - if (E === void 0 && (E = _[A].elected), E === void 0) { + }).on("end", (C) => L()); + } + function Tl(c) { + const g = Cl(c, de); + ce = na(c, I, g, N, M, Je(), $r(), !1, !0); + const m = he($(Z)); + m.select("#" + F).raise(), m.select("#" + W).raise(); + } + function Rl(c) { + const g = kl(c, ce, de); + ce = aa(c, I, g, Je(), $r(), !1); + } + function Tr(c) { + return Pe[c.data.label]; + } + function Sl(c) { + const g = {}, m = n().results[c - 1].tallyResults; + for (let A = 0; A < m.length; A++) { + let E = m[A].eliminated; + if (E === void 0 && (E = m[A].elected), E === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = _[A].transfers; + const T = m[A].transfers; if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [P, z] of Object.entries(T)) - g[P] === void 0 ? g[P] = Number(z) : g[P] += Number(z); + for (let [P, V] of Object.entries(T)) + g[P] === void 0 ? g[P] = Number(V) : g[P] += Number(V); } return g; } - function Tl(h, g) { - const _ = [], A = Oe, E = n().results[h - 1].tallyResults; + function Cl(c, g) { + const m = [], A = at, E = n().results[c - 1].tallyResults; for (let T = 0; T < E.length; T++) { let P = E[T].eliminated; if (P === void 0 && (P = E[T].elected), P === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const z = E[T].transfers; - if (z === void 0) { + const V = E[T].transfers; + if (V === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } let L = g.find((k) => k.data.label == P && k.data.isTransfer); L === void 0 && (L = g.find((k) => k.data.label == P && !k.data.isTransfer)); - let N = 0; - if (L) N = L.startAngle; + let C = 0; + if (L) C = L.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, C] of Object.entries(z)) { - let R; - const Pe = g.find((te) => te.data.label == k); - if (Pe) - R = structuredClone(Pe); + for (let [k, R] of Object.entries(V)) { + let S; + const ke = g.find((ae) => ae.data.label == k); + if (ke) + S = structuredClone(ke); else if (k == "exhausted") - R = { - data: { label: k, value: Number(C) }, + S = { + data: { label: k, value: Number(R) }, value: 0, index: 0, startAngle: 0, @@ -5279,265 +5303,272 @@ function yl(e, t) { console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Be = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); + const He = Number(R) / A * 2 * Math.PI; + S.startAngle = C, C = S.endAngle = C + He, S.index = T, S.data.transferIndex = T, m.push(S); } } - return _; + return m; } - function Cl(h, g, _) { + function Nl(c, g, m) { const A = {}; - for (let [E, T] of Object.entries(h)) { - const P = _.find((N) => E == N.data.label); + for (let [E, T] of Object.entries(c)) { + const P = m.find((C) => E == C.data.label); if (P === void 0) { E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const z = (P.startAngle + P.endAngle) / 2, L = h[P.data.label] / g * 2 * Math.PI; - A[P.data.label] = z - L / 2; + const V = (P.startAngle + P.endAngle) / 2, L = c[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = V - L / 2; } return A; } - function Rl(h, g, _) { - const A = [], E = Oe, T = El(h), P = Cl(T, E, _); - for (let [z, L] of g.entries()) { - const N = structuredClone(L), k = L.endAngle - L.startAngle, C = _.find((R) => L.data.label === R.data.label && !R.data.isTransfer); - if (C) { - const R = C.data.label; - N.startAngle = P[R], P[R] += k, N.endAngle = N.startAngle + k; + function kl(c, g, m) { + const A = [], E = at, T = Sl(c), P = Nl(T, E, m); + for (let [V, L] of g.entries()) { + const C = structuredClone(L), k = L.endAngle - L.startAngle, R = m.find((S) => L.data.label === S.data.label && !S.data.isTransfer); + if (R) { + const S = R.data.label; + C.startAngle = P[S], P[S] += k, C.endAngle = C.startAngle + k; } else if (L.data.label === "exhausted") - N.startAngle = L.startAngle, N.endAngle = L.endAngle; + C.startAngle = L.startAngle, C.endAngle = L.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); continue; } - N.index = z, A.push(N); + C.index = V, A.push(C); } return A; } - function Js(h, g, _, A) { - const E = mt().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + function Qs(c, g, m, A) { + const E = yt().innerRadius(m * U).outerRadius(m * U), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], V = A.append("g").attr("opacity", 0); for (const k of T) { - const C = k.data.label === "exhausted" ? Ct : k.data.label, R = E.centroid(k), Pe = ei(k.startAngle, k.endAngle), Z = Zr(k.data.label, h); - let Be; - !p() && dn(k.data.label) ? Be = Z : Be = Z + " (" + En(k.data.label, h) + ")"; - const te = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", Pe).text(C); - te.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); - const Ee = te.node().getBBox(); + const R = k.data.label === "exhausted" ? St : k.data.label, S = E.centroid(k), ke = Qr(k.startAngle, k.endAngle), Q = Jn(k.data.label, c); + let He; + !h() && Nt(k.data.label) ? He = Q : He = Q + " (" + Zr(k.data.label, c) + ")"; + const ae = V.append("text").attr("transform", `translate(${S})`).attr("text-anchor", ke).text(R); + ae.append("tspan").attr("x", 0).attr("dy", "1.2em").text(He); + const Te = ae.node().getBBox(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Ee.x + R[0], Ee.y + R[1], Ee.width, Ee.height) + bbox: new DOMRect(Te.x + S[0], Te.y + S[1], Te.width, Te.height) }); } - z.remove(), P.sort((k, C) => C.value - k.value); - const L = [], N = /* @__PURE__ */ new Set(); + V.remove(), P.sort((k, R) => R.value - k.value); + const L = [], C = /* @__PURE__ */ new Set(); for (const k of P) - L.some((R) => k.bbox.left < R.right && k.bbox.right > R.left && k.bbox.top < R.bottom && k.bbox.bottom > R.top) || (N.add(k.label), L.push(k.bbox)); - return N; - } - function Zs(h, g, _, A, E, T) { - const z = fe($(oe)).append("g").attr("id", X).attr("transform", `translate(${_}, ${A})`), L = mt().innerRadius(E * Q).outerRadius(E * Q), N = Js(h, g, E, z); - z.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && N.has(k.data.label) && fe(this).append("g").attr("id", (C) => y(C.data)).classed("eliminated", (C) => T.includes(C.data.label) || C.data.isTransfer === !0).each(function(C, R) { - C.data.label === "exhausted" && fe(this).on("mouseenter", (Pe, Z) => Pl(Pe)).on("mouseleave", (Pe, Z) => Dl()); - }).append("text").attr("transform", (C) => `translate(${L.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Ct : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = Zr(C.data.label, h); - return !p() && dn(C.data.label) ? R : R + " (" + En(C.data.label, h) + ")"; + L.some((S) => k.bbox.left < S.right && k.bbox.right > S.left && k.bbox.top < S.bottom && k.bbox.bottom > S.top) || (C.add(k.label), L.push(k.bbox)); + return C; + } + function ea(c, g, m, A, E, T) { + const V = he($(Z)).append("g").attr("id", ee).attr("transform", `translate(${m}, ${A})`), L = yt().innerRadius(E * U).outerRadius(E * U), C = Qs(c, g, E, V); + V.selectAll("text").data(g).enter().each(function(k) { + !k.data.isTransfer && C.has(k.data.label) && he(this).append("g").attr("id", (R) => x(R.data)).classed("eliminated", (R) => T.includes(R.data.label) || R.data.isTransfer === !0).each(function(R, S) { + R.data.label === "exhausted" && he(this).on("mouseenter", (ke, Q) => Fl(ke)).on("mouseleave", (ke, Q) => Il()); + }).append("text").attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Qr(R.startAngle, R.endAngle)).text((R) => R.data.label === "exhausted" ? St : R.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((R) => { + const S = Jn(R.data.label, c); + return !h() && Nt(R.data.label) ? S : S + " (" + Zr(R.data.label, c) + ")"; }); }); } - function Sl(h, g, _, A) { - const T = fe($(oe)).select("#" + X), P = Js(h, g, _, T); - T.selectAll("g").each(function(R) { - R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); + function Ml(c, g, m, A) { + const T = he($(Z)).select("#" + ee), P = Qs(c, g, m, T); + T.selectAll("g").each(function(S) { + S && S.data && !S.data.isTransfer && !P.has(S.data.label) && he(this).remove(); }); - const z = T.selectAll("tspan"), L = T.selectAll("g").data(g, (R) => y(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), N = mt().innerRadius(_ * Q).outerRadius(_ * Q + 1); - z.transition("global").duration(W).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), L.select("text").transition("global").duration(W).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + const V = T.selectAll("tspan"), L = T.selectAll("g").data(g, (S) => x(S.data)).classed("eliminated", (S) => A.includes(S.data.label) || S.data.isTransfer === !0), C = yt().innerRadius(m * U).outerRadius(m * U + 1); + V.transition("global").duration(re).attr("transform", (S) => `translate(${C.centroid(S)})`).attr("text-anchor", (S) => Qr(S.startAngle, S.endAngle)), L.select("text").transition("global").duration(re).attr("transform", (S) => `translate(${C.centroid(S)})`).attr("text-anchor", (S) => Qr(S.startAngle, S.endAngle)).on("end", (S) => R()); let k = L.size(); - function C(R) { - k--, k === 0 && (T.remove(), Zs(h, g, D, M, _, A)); + function R(S) { + k--, k === 0 && (T.remove(), ea(c, g, N, M, m, A)); } } - function Qs(h, g, _, A, E, T, P, z = !0, L = !1, N = !1) { - const C = ss().sort(null).value((R) => R.value)(_); - return ea(h, g, C, A, E, T, P, z, L, N), C; + function ta(c, g, m, A, E, T, P, V = !0, L = !1, C = !1) { + const R = as().sort(null).value((S) => S.value)(m); + return na(c, g, R, A, E, T, P, V, L, C), R; } - function Tr() { - fe($(oe)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Ne}px`); + function Rr() { + he($(Z)).select("#" + W).selectAll(".elected").select("path").style("stroke", te).style("stroke-width", `${je}px`); } - function ea(h, g, _, A, E, T, P, z, L, N = !1) { - const k = Jn(h), C = w(h), Z = fe($(oe)).attr("viewBox", `0 0 ${x} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(_).enter().append("g").attr("class", "slice").classed("eliminated", (te) => k.includes(te.data.label) || te.data.isTransfer === !0).classed("elected", (te) => C.includes(te.data.label) && !te.data.isTransfer).attr("id", (te) => y(te.data)); - N ? Z.style("pointer-events", "none") : Z.on("mouseenter", (te, Ee) => Ji(te, Ee)).on("mouseleave", (te, Ee) => Zi(te, Ee)); - const Be = mt().outerRadius(P).innerRadius(T); + function na(c, g, m, A, E, T, P, V, L, C = !1) { + const k = Y(c), R = se(c), Q = he($(Z)).attr("viewBox", `0 0 ${y} ${b}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${A}, ${E})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (ae) => k.includes(ae.data.label) || ae.data.isTransfer === !0).classed("elected", (ae) => R.includes(ae.data.label) && !ae.data.isTransfer).attr("id", (ae) => x(ae.data)); + C ? Q.style("pointer-events", "none") : Q.on("mouseenter", (ae, Te) => Zi(ae, Te)).on("mouseleave", (ae, Te) => Qi(ae, Te)); + const He = yt().outerRadius(P).innerRadius(T); if (L) { - const te = mt().outerRadius(T + 1).innerRadius(T); - Z.append("path").attr("d", te).attr("stroke", N ? "none" : T === 0 ? ue : "none").attr("stroke-width", N ? 0 : T === 0 ? O : 0).attr("fill", N ? "none" : (Ee) => Er(Ee)).transition("global").duration(W).attr("d", (Ee) => Be(Ee)).on("end", (Ee) => { - N || ji(); + const ae = yt().outerRadius(T + 1).innerRadius(T); + Q.append("path").attr("d", ae).attr("stroke", C ? "none" : T === 0 ? D : "none").attr("stroke-width", C ? 0 : T === 0 ? H : 0).attr("fill", C ? "none" : (Te) => Tr(Te)).transition("global").duration(re).attr("d", (Te) => He(Te)).on("end", (Te) => { + C || Ji(); }); } else - Z.append("path").attr("d", (te) => Be(te)).attr("fill", N ? "none" : (te) => Er(te)).attr("stroke", N ? "none" : ue).attr("stroke-width", N ? 0 : O), N || ji(); - return z && !N && Zs(h, _, A, E, P, k), _; - } - function Nl() { - const _ = fe($(oe)).select("#" + X).selectAll(".eliminated"); - _.size() > 0 && _.classed("finished", !0); - } - function kl() { - const _ = fe($(oe)).select("#" + X).selectAll(".finished"); - _.size() > 0 && _.remove(); - } - function Ml(h, g) { - const E = fe($(oe)).select("#" + S).selectAll(".eliminated"), T = mt().innerRadius(h), P = mt().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(W).attrTween("d", function(z) { - const L = Jt(g, h); - return function(N) { - return P.innerRadius(L(N)), P(z); + Q.append("path").attr("d", (ae) => He(ae)).attr("fill", C ? "none" : (ae) => Tr(ae)).attr("stroke", C ? "none" : D).attr("stroke-width", C ? 0 : H), C || Ji(); + return V && !C && ea(c, m, A, E, P, k), m; + } + function Pl() { + const m = he($(Z)).select("#" + ee).selectAll(".eliminated"); + m.size() > 0 && m.classed("finished", !0); + } + function Dl() { + const m = he($(Z)).select("#" + ee).selectAll(".finished"); + m.size() > 0 && m.remove(); + } + function Ol(c, g) { + const E = he($(Z)).select("#" + F).selectAll(".eliminated"), T = yt().innerRadius(c), P = yt().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(re).attrTween("d", function(V) { + const L = Jt(g, c); + return function(C) { + return P.innerRadius(L(C)), P(V); }; - }).attr("fill", (z) => `url(#${lt(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(W).attrTween("d", function(z) { - const L = Jt(g, h); - return function(N) { - return T.outerRadius(L(N)), T(z); + }).attr("fill", (V) => `url(#${qe(V.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(re).attrTween("d", function(V) { + const L = Jt(g, c); + return function(C) { + return T.outerRadius(L(C)), T(V); }; - }).attr("fill", (z) => Er(z)); + }).attr("fill", (V) => Tr(V)); } - function ei(h, g) { - const _ = (h + g) / 2; - return _ > Math.PI * 11 / 6 || _ < Math.PI * 1 / 6 || _ > Math.PI * 5 / 6 && _ < Math.PI * 7 / 6 ? "middle" : _ < Math.PI ? "start" : "end"; + function Qr(c, g) { + const m = (c + g) / 2; + return m > Math.PI * 11 / 6 || m < Math.PI * 1 / 6 || m > Math.PI * 5 / 6 && m < Math.PI * 7 / 6 ? "middle" : m < Math.PI ? "start" : "end"; } - function ji() { - fe($( - oe + function Ji() { + he($( + Z // force redisplay of text labels - )).select("#" + X).raise().append("g").remove(); - } - function ta(h, g, _, A, E, T, P = !1) { - const L = ss().sort(null).value((N) => N.value)(_); - return ia(h, g, L, A, E, T, P), L; - } - function na(h, g, _, A, E = !1) { - const T = Jn(h), P = w(h), N = fe($(oe)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); - N.exit().remove(); - const k = N.enter().append("g").attr("class", "slice").attr("id", (C) => y(C.data)).classed("eliminated", !0); - return E ? k.style("pointer-events", "none") : k.on("mouseenter", (C, R) => Ji(C, R)).on("mouseleave", (C, R) => Zi(C, R)), k.append("path").attr("d", (C) => A(C)).attr("fill", E ? "none" : (C) => Er(C)).attr("stroke", E ? "none" : ue).attr("stroke-width", E ? 0 : O), N.classed("eliminated", (C) => T.includes(C.data.label)).classed("elected", (C) => P.includes(C.data.label)), E || N.on("mouseenter", (C, R) => Ji(C, R)).on("mouseleave", (C, R) => Zi(C, R)), N; - } - function ra(h, g, _, A, E, T = !1) { - const P = mt().outerRadius(E).innerRadius(A); - na(h, g, _, P, T).select("path").attr("d", (L) => P(L)).attr("fill", T ? "none" : (L) => Er(L)); - } - function ia(h, g, _, A, E, T, P = !1) { - const z = mt().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), L = mt().outerRadius(E).innerRadius(A); - fe($(oe)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); - const C = na(h, g, _, L, P); - let R = C.size(); - function Pe() { - R--, R <= 0 && (P || ji()); + )).select("#" + ee).raise().append("g").remove(); + } + function ra(c, g, m, A, E, T, P = !1) { + const L = as().sort(null).value((C) => C.value)(m); + return aa(c, g, L, A, E, T, P), L; + } + function ia(c, g, m, A, E = !1) { + const T = Y(c), P = se(c), C = he($(Z)).select("#" + g).selectAll(".slice").data(m, (R) => x(R.data)); + C.exit().remove(); + const k = C.enter().append("g").attr("class", "slice").attr("id", (R) => x(R.data)).classed("eliminated", !0); + return E ? k.style("pointer-events", "none") : k.on("mouseenter", (R, S) => Zi(R, S)).on("mouseleave", (R, S) => Qi(R, S)), k.append("path").attr("d", (R) => A(R)).attr("fill", E ? "none" : (R) => Tr(R)).attr("stroke", E ? "none" : D).attr("stroke-width", E ? 0 : H), C.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => P.includes(R.data.label)), E || C.on("mouseenter", (R, S) => Zi(R, S)).on("mouseleave", (R, S) => Qi(R, S)), C; + } + function sa(c, g, m, A, E, T = !1) { + const P = yt().outerRadius(E).innerRadius(A); + ia(c, g, m, P, T).select("path").attr("d", (L) => P(L)).attr("fill", T ? "none" : (L) => Tr(L)); + } + function aa(c, g, m, A, E, T, P = !1) { + const V = yt().outerRadius(E).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), L = yt().outerRadius(E).innerRadius(A); + he($(Z)).select("#" + g).selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); + const R = ia(c, g, m, L, P); + let S = R.size(); + function ke() { + S--, S <= 0 && (P || Ji()); } - return C.select("path").transition("global").duration(W).attrTween("d", function(Z) { - const Be = Number(fe(this.parentNode).attr("prevStart")), te = Number(fe(this.parentNode).attr("prevEnd")), Ee = Jt(Be, Z.startAngle), ti = Jt(te, Z.endAngle); - return (Cr) => (z.startAngle(Ee(Cr)).endAngle(ti(Cr)), z(Z)); - }).on("end", function(Z) { - Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), Pe(); - }), T && !P && Sl(h, _, E, Jn(h)), _; + return R.select("path").transition("global").duration(re).attrTween("d", function(Q) { + const He = Number(he(this.parentNode).attr("prevStart")), ae = Number(he(this.parentNode).attr("prevEnd")), Te = Jt(He, Q.startAngle), ei = Jt(ae, Q.endAngle); + return (Sr) => (V.startAngle(Te(Sr)).endAngle(ei(Sr)), V(Q)); + }).on("end", function(Q) { + Q.startAngle === Q.endAngle && he(this).attr("stroke", "none"), ke(); + }), T && !P && Ml(c, m, E, Y(c)), m; } - function Ji(h, g) { - s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); + function Zi(c, g) { + s(g.data.label), i("enter"), a(c.clientX), o(c.clientY); } - function Zi(h, g) { + function Qi(c, g) { s(g.data.label), i("leave"); } - function Pl(h, g) { - i("show-exhausted"), a(h.clientX), o(h.clientY); + function Fl(c, g) { + i("show-exhausted"), a(c.clientX), o(c.clientY); } - function Dl(h, g) { + function Il(c, g) { i("hide-exhausted"); } - var Ol = { - pieColors: ke, - exhaustedLabel: Ct, - countExhaustedVotes: hn, - getEliminatedCandidates: Jn, - getElectedCandidates: w, - runFullAnimationFn: Zn, - animateOnePhaseFn: Qr, + var Ll = { + pieColors: Pe, + exhaustedLabel: St, + countExhaustedVotes: Ar, + getEliminatedCandidates: Y, + getElectedCandidates: se, + runFullAnimationFn: Er, + animateOnePhaseFn: Zs, get jsonData() { return n(); }, - set jsonData(h) { - n(h), ne(); + set jsonData(c) { + n(c), ne(); }, get currentRound() { return r(); }, - set currentRound(h = 1) { - r(h), ne(); + set currentRound(c = 1) { + r(c), ne(); }, get mouseEventType() { return i(); }, - set mouseEventType(h) { - i(h), ne(); + set mouseEventType(c) { + i(c), ne(); }, get mouseData() { return s(); }, - set mouseData(h) { - s(h), ne(); + set mouseData(c) { + s(c), ne(); }, get mouseX() { return a(); }, - set mouseX(h) { - a(h), ne(); + set mouseX(c) { + a(c), ne(); }, get mouseY() { return o(); }, - set mouseY(h) { - o(h), ne(); + set mouseY(c) { + o(c), ne(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(h = (g) => { + set requestRoundChange(c = (g) => { }) { - l(h), ne(); + l(c), ne(); }, - get candidateColors() { + get requestSkipToRound() { return u(); }, - set candidateColors(h = []) { - u(h), ne(); + set requestSkipToRound(c = (g) => { + }) { + u(c), ne(); }, - get excludeFinalWinnerAndEliminatedCandidate() { + get candidateColors() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(h = !1) { - f(h), ne(); + set candidateColors(c = []) { + f(c), ne(); + }, + get excludeFinalWinnerAndEliminatedCandidate() { + return d(); + }, + set excludeFinalWinnerAndEliminatedCandidate(c = !1) { + d(c), ne(); }, get firstRoundDeterminesPercentages() { - return p(); + return h(); }, - set firstRoundDeterminesPercentages(h = !1) { - p(h), ne(); + set firstRoundDeterminesPercentages(c = !1) { + h(c), ne(); }, get randomizeOrder() { - return c(); + return p(); }, - set randomizeOrder(h = !1) { - c(h), ne(); + set randomizeOrder(c = !1) { + p(c), ne(); }, get displayPhase() { - return d(); + return _(); }, - set displayPhase(h = 0) { - d(h), ne(); + set displayPhase(c = 0) { + _(c), ne(); } - }, sa = Qd(); - return vi(sa, (h) => de(oe, h), () => $(oe)), Ge(e, sa), zi(Ol); + }, oa = np(); + return pi(oa, (c) => ve(Z, c), () => $(Z)), We(e, oa), Vi(Ll); } -Hs( - yl, +Ys( + xl, { jsonData: {}, currentRound: {}, @@ -5546,6 +5577,7 @@ Hs( mouseX: {}, mouseY: {}, requestRoundChange: {}, + requestSkipToRound: {}, candidateColors: {}, excludeFinalWinnerAndEliminatedCandidate: {}, firstRoundDeterminesPercentages: {}, @@ -5564,83 +5596,83 @@ Hs( ], { mode: "open" } ); -var tp = /* @__PURE__ */ Yt("
"), np = /* @__PURE__ */ Yt('
', 1), rp = /* @__PURE__ */ Yt('
'); -const ip = { +var ip = /* @__PURE__ */ Bt("
"), sp = /* @__PURE__ */ Bt('
', 1), ap = /* @__PURE__ */ Bt('
'); +const op = { hash: "svelte-1l4eyw0", code: ".stepper.svelte-1l4eyw0 {display:inline-flex;align-items:center;cursor:pointer;user-select:none;padding:4px 8px;border-radius:4px;}.stepper.svelte-1l4eyw0:hover:not(.disabled) {background-color:#f0f0f0;}.stepper.disabled.svelte-1l4eyw0 {cursor:default;opacity:0.4;}.step.svelte-1l4eyw0 {display:flex;align-items:center;gap:4px;}.dot.svelte-1l4eyw0 {width:10px;height:10px;border-radius:50%;border:2px solid #ccc;background:white;transition:background-color 0.3s, border-color 0.3s;}.dot.active.svelte-1l4eyw0 {background:#4747ff;border-color:#4747ff;}.dot.completed.svelte-1l4eyw0 {background:#8888ff;border-color:#8888ff;}.label.svelte-1l4eyw0 {font-size:0.75rem;color:#888;transition:color 0.3s, font-weight 0.3s;}.label.active.svelte-1l4eyw0 {color:#4747ff;font-weight:bold;}.label.completed.svelte-1l4eyw0 {color:#8888ff;}.connector.svelte-1l4eyw0 {width:20px;height:2px;background:#ccc;margin:0 4px;transition:background-color 0.3s;}.connector.completed.svelte-1l4eyw0 {background:#8888ff;}" }; -function wl(e, t) { - Vi(t, !0), zs(e, ip); +function bl(e, t) { + qi(t, !0), Hs(e, op); let n = ie(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ie(t, "currentStep", 7, 0), i = ie(t, "disabled", 7, !1), s = ie(t, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function o(p) { - (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a()); + function o(d) { + (d.key === "Enter" || d.key === " ") && (d.preventDefault(), a()); } var l = { get labels() { return n(); }, - set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { - n(p), ne(); + set labels(d = ["Eliminate", "Transfer", "Consolidate"]) { + n(d), ne(); }, get currentStep() { return r(); }, - set currentStep(p = 0) { - r(p), ne(); + set currentStep(d = 0) { + r(d), ne(); }, get disabled() { return i(); }, - set disabled(p = !1) { - i(p), ne(); + set disabled(d = !1) { + i(d), ne(); }, get onAdvance() { return s(); }, - set onAdvance(p = () => { + set onAdvance(d = () => { }) { - s(p), ne(); + s(d), ne(); } - }, u = rp(); + }, u = ap(); let f; - return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { - var y = np(), x = gn(y); + return u.__click = a, u.__keydown = o, di(u, 21, n, hi, (d, h, p) => { + var _ = sp(), x = gn(_); { - var m = (X) => { - var se = tp(); - let Q; - Zt(() => Q = ii(se, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(X, se); + var y = (I) => { + var ee = ip(); + let fe; + Zt(() => fe = ri(ee, 1, "connector svelte-1l4eyw0", null, fe, { completed: !i() && p <= r() })), We(I, ee); }; - tr(x, (X) => { - d > 0 && X(m); + tr(x, (I) => { + p > 0 && I(y); }); } - var b = et(x, 2), D = We(b); - let M; - var S = et(D, 2); - let I; - var q = We(S, !0); - Ie(S), Ie(b), Zt(() => { - M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { - active: !i() && d === r(), - completed: !i() && d < r() - }), I = ii(S, 1, "label svelte-1l4eyw0", null, I, { - active: !i() && d === r(), - completed: !i() && d < r() - }), _n(q, $(c)); - }), Ge(p, y); - }), Ie(u), Zt(() => { - f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), wa(u, "tabindex", i() ? -1 : 0), wa(u, "aria-disabled", i()); - }), Ge(e, u), zi(l); -} -Wu(["click", "keydown"]); -Hs(wl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var sp = /* @__PURE__ */ Yt(" ", 1), ap = /* @__PURE__ */ Yt("About to eliminate: ", 1), op = /* @__PURE__ */ Yt(" ", 1), lp = /* @__PURE__ */ Yt(" ", 1), up = /* @__PURE__ */ Yt('

', 1), fp = /* @__PURE__ */ Yt("
", 1), cp = /* @__PURE__ */ Yt('


these ballots have already been eliminated.
', 1); -const hp = { + var b = Ze(x, 2), O = Be(b); + let N; + var M = Ze(O, 2); + let F; + var W = Be(M, !0); + Oe(M), Oe(b), Zt(() => { + N = ri(O, 1, "dot svelte-1l4eyw0", null, N, { + active: !i() && p === r(), + completed: !i() && p < r() + }), F = ri(M, 1, "label svelte-1l4eyw0", null, F, { + active: !i() && p === r(), + completed: !i() && p < r() + }), _n(W, $(h)); + }), We(d, _); + }), Oe(u), Zt(() => { + f = ri(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ba(u, "tabindex", i() ? -1 : 0), ba(u, "aria-disabled", i()); + }), We(e, u), Vi(l); +} +Ku(["click", "keydown"]); +Ys(bl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var lp = /* @__PURE__ */ Bt(" ", 1), up = /* @__PURE__ */ Bt("About to eliminate: ", 1), fp = /* @__PURE__ */ Bt(" ", 1), cp = /* @__PURE__ */ Bt(" ", 1), hp = /* @__PURE__ */ Bt('

', 1), dp = /* @__PURE__ */ Bt("
", 1), pp = /* @__PURE__ */ Bt('


these ballots have already been eliminated.
', 1); +const vp = { hash: "svelte-1r6y5gl", code: `.page-container.svelte-1r6y5gl {width:95%;max-width:1800px;margin:0 auto;padding:0 20px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;}.common-header.svelte-1r6y5gl {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1r6y5gl {position:fixed;width:max-content;max-width:calc(100vw - 24px);text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;font-weight:normal;opacity:0;z-index:100;}.tooltip.svelte-1r6y5gl h3:where(.svelte-1r6y5gl) {text-align:center;}.animation-button-container.svelte-1r6y5gl {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-1r6y5gl {width:100%;min-width:auto;flex-grow:0;margin:0 auto;margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:20px;} @@ -5655,12 +5687,13 @@ const hp = { }` }; -function dp(e, t) { - Vi(t, !0), zs(e, hp); +function gp(e, t) { + qi(t, !0), Hs(e, vp); const n = 0.85; let r = ie(t, "electionSummary", 7), i = ie(t, "currentRound", 7, 1), s = ie(t, "requestRoundChange", 7, (w) => { - }), a = ie(t, "candidateColors", 23, () => []), o = ie(t, "textForWinner", 7, "elected"), l = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ie(t, "firstRoundDeterminesPercentages", 7, !1), f = ie(t, "randomizeOrder", 7, !1), p = ie(t, "showCaptions", 7, !1); - const c = { + }), a = ie(t, "requestSkipToRound", 7, (w) => { + }), o = ie(t, "candidateColors", 23, () => []), l = ie(t, "textForWinner", 7, "elected"), u = ie(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), f = ie(t, "firstRoundDeterminesPercentages", 7, !1), d = ie(t, "randomizeOrder", 7, !1), h = ie(t, "showCaptions", 7, !1); + const p = { elected: { caption: "Elected", event: "was elected", @@ -5678,116 +5711,116 @@ function dp(e, t) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ Cn(() => c[o()] ?? c.elected), y = /* @__PURE__ */ be(null), x = /* @__PURE__ */ be(null), m = /* @__PURE__ */ be(""), b = /* @__PURE__ */ be(Mn([])), D = /* @__PURE__ */ be(""), M = /* @__PURE__ */ be(""), S = /* @__PURE__ */ be(0), I = /* @__PURE__ */ be(0), q = /* @__PURE__ */ Cn(() => X(r())); - function X(w) { + let _ = /* @__PURE__ */ Sn(() => p[l()] ?? p.elected), x = /* @__PURE__ */ $e(null), y = /* @__PURE__ */ $e(null), b = /* @__PURE__ */ $e(""), O = /* @__PURE__ */ $e(Pn([])), N = /* @__PURE__ */ $e(""), M = /* @__PURE__ */ $e(""), F = /* @__PURE__ */ $e(0), W = /* @__PURE__ */ $e(0), I = /* @__PURE__ */ Sn(() => ee(r())); + function ee(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (G) { - return console.error("Failed to parse JSON string:", G), {}; + } catch (Y) { + return console.error("Failed to parse JSON string:", Y), {}; } return w || {}; } - function se(w) { + function fe(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, G, re) { - w.style.left = G + "px", w.style.top = re + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const le = w.getBoundingClientRect(); - let Fe = G, Ut = re + 20; - Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Ut + le.height > window.innerHeight - 12 && (Ut = re - le.height - 12), w.style.left = Fe + "px", w.style.top = Ut + "px"; + function U(w, Y, se) { + w.style.left = Y + "px", w.style.top = se + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const ue = w.getBoundingClientRect(); + let Ve = Y, Ut = se + 20; + Ve + ue.width > window.innerWidth - 12 && (Ve = window.innerWidth - ue.width - 12), Ve < 12 && (Ve = 12), Ut + ue.height > window.innerHeight - 12 && (Ut = se - ue.height - 12), w.style.left = Ve + "px", w.style.top = Ut + "px"; }); } - function W() { - switch ($(D)) { + function re() { + switch ($(N)) { case "enter": ((w) => { - var G = nu(w, 2); - de(b, G[0], !0), de(m, G[1], !0); - })(ue($(M), i())), $(y) && (Q($(y), $(S) || 0, $(I) || 0), $(y).style.opacity = String(n)); + var Y = su(w, 2); + ve(O, Y[0], !0), ve(b, Y[1], !0); + })(D($(M), i())), $(x) && (U($(x), $(F) || 0, $(W) || 0), $(x).style.opacity = String(n)); break; case "leave": - $(y) && ($(y).style.opacity = "0"), de(b, [], !0), de(m, ""); + $(x) && ($(x).style.opacity = "0"), ve(O, [], !0), ve(b, ""); break; case "show-exhausted": - $(x) && (Q($(x), $(S) || 0, $(I) || 0), $(x).style.opacity = String(n)); + $(y) && (U($(y), $(F) || 0, $(W) || 0), $(y).style.opacity = String(n)); break; case "hide-exhausted": - $(x) && ($(x).style.opacity = "0"); + $(y) && ($(y).style.opacity = "0"); break; case "": break; default: - console.log("Unknown mouse event: ", $(D)); + console.log("Unknown mouse event: ", $(N)); break; } } - Fs(() => W()); - function ae(w, G) { - return w === 1 ? G ? "vote was" : "vote will be" : G ? "votes were" : "votes will be"; + Is(() => re()); + function le(w, Y) { + return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; } - function ue(w, G) { - const re = [], me = w === "exhausted" ? ke() : w; + function D(w, Y) { + const se = [], we = w === "exhausted" ? Pe() : w; let ye; - w === "exhausted" ? ye = Oe(1) : ye = $(q).results[0].tally[w], re.push(`${me} started with ${ye} votes.`); - for (let le = 1; le <= G; le++) { - le === G && (w === "exhausted" ? ye = Oe(G) : ye = $(q).results[G - 1].tally[w], re.push(`${me} has ${ye} votes at round ${G}.`)); - const Fe = $(q).results[le - 1].tallyResults, Ut = ce(le); - for (let Nt = 0; Nt < Fe.length; Nt++) { - const Tn = Fe[Nt].transfers, pn = Fe[Nt].eliminated, He = Fe[Nt].elected; + w === "exhausted" ? ye = at(1) : ye = $(I).results[0].tally[w], se.push(`${we} started with ${ye} votes.`); + for (let ue = 1; ue <= Y; ue++) { + ue === Y && (w === "exhausted" ? ye = at(Y) : ye = $(I).results[Y - 1].tally[w], se.push(`${we} has ${ye} votes at round ${Y}.`)); + const Ve = $(I).results[ue - 1].tallyResults, Ut = de(ue); + for (let gt = 0; gt < Ve.length; gt++) { + const Rn = Ve[gt].transfers, pn = Ve[gt].eliminated, ze = Ve[gt].elected; if (!Ut) { if (pn) - pn === w && re.push(`${me} will be eliminated on round ${le}.`); - else if (w === He && (re.push(`${me} ${$(d).event} on round ${le}.`), Tn)) - for (let [Me, Qe] of Object.entries(Tn)) - re.push(`${Qe} ${ae(Number(Qe), le < G)} transferred to ${Me} on round ${le}.`); + pn === w && se.push(`${we} will be eliminated on round ${ue}.`); + else if (w === ze && (se.push(`${we} ${$(_).event} on round ${ue}.`), Rn)) + for (let [ot, _t] of Object.entries(Rn)) + se.push(`${_t} ${le(Number(_t), ue < Y)} transferred to ${ot} on round ${ue}.`); } - const Ze = pn || He; - if (Ze) { - const Me = Number(Tn[w]); - Me && re.push(`${Me} ${ae(Me, le < G)} transferred from ${Ze} on round ${le}.`); + const kt = pn || ze; + if (kt) { + const ot = Number(Rn[w]); + ot && se.push(`${ot} ${le(ot, ue < Y)} transferred from ${kt} on round ${ue}.`); } } } - return [re, me]; + return [se, we]; } - function O() { + function H() { let w = 0; - for (let G = 1; G <= $(q).results.length; G++) { - if (ce(G)) continue; - const re = $(q).results[G - 1].tallyResults; - for (let me = 0; me < re.length; me++) - re[me].elected && w++; + for (let Y = 1; Y <= $(I).results.length; Y++) { + if (de(Y)) continue; + const se = $(I).results[Y - 1].tallyResults; + for (let we = 0; we < se.length; we++) + se[we].elected && w++; } return w; } - let F, Ne = /* @__PURE__ */ be(0); - function lt(w) { + let te, je = /* @__PURE__ */ $e(0); + function qe(w) { var ye; - return !((ye = $(q)) != null && ye.results) || w < 1 || w > $(q).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [$(q).results[w - 1].tallyResults.some((le) => le.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + return !((ye = $(I)) != null && ye.results) || w < 1 || w > $(I).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [$(I).results[w - 1].tallyResults.some((ue) => ue.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function ce(w) { - return l() && $(q).results && w === $(q).results.length; + function de(w) { + return u() && $(I).results && w === $(I).results.length; } - function Ae(w) { - return ce(w) ? [] : F ? F.getEliminatedCandidates(w) : []; + function ce(w) { + return de(w) ? [] : te ? te.getEliminatedCandidates(w) : []; } - function ee(w) { - return ce(w) ? [] : F ? F.getElectedCandidates(w) : []; + function _e(w) { + return de(w) ? [] : te ? te.getElectedCandidates(w) : []; } - function Oe(w) { - return F ? F.countExhaustedVotes(w) : 0; + function at(w) { + return te ? te.countExhaustedVotes(w) : 0; } - function U() { - F && F.animateOnePhaseFn && F.animateOnePhaseFn(); + function G() { + te && te.animateOnePhaseFn && te.animateOnePhaseFn(); } - function ke() { - return F ? F.exhaustedLabel : ""; + function Pe() { + return te ? te.exhaustedLabel : ""; } - function Ct() { - return F ? F.pieColors : {}; + function St() { + return te ? te.pieColors : {}; } - var oe = { + var Z = { get electionSummary() { return r(); }, @@ -5803,212 +5836,223 @@ function dp(e, t) { get requestRoundChange() { return s(); }, - set requestRoundChange(w = (G) => { + set requestRoundChange(w = (Y) => { }) { s(w), ne(); }, - get candidateColors() { + get requestSkipToRound() { return a(); }, - set candidateColors(w = []) { + set requestSkipToRound(w = (Y) => { + }) { a(w), ne(); }, - get textForWinner() { + get candidateColors() { return o(); }, - set textForWinner(w = "elected") { + set candidateColors(w = []) { o(w), ne(); }, - get excludeFinalWinnerAndEliminatedCandidate() { + get textForWinner() { return l(); }, - set excludeFinalWinnerAndEliminatedCandidate(w = !1) { + set textForWinner(w = "elected") { l(w), ne(); }, - get firstRoundDeterminesPercentages() { + get excludeFinalWinnerAndEliminatedCandidate() { return u(); }, - set firstRoundDeterminesPercentages(w = !1) { + set excludeFinalWinnerAndEliminatedCandidate(w = !1) { u(w), ne(); }, - get randomizeOrder() { + get firstRoundDeterminesPercentages() { return f(); }, - set randomizeOrder(w = !1) { + set firstRoundDeterminesPercentages(w = !1) { f(w), ne(); }, + get randomizeOrder() { + return d(); + }, + set randomizeOrder(w = !1) { + d(w), ne(); + }, get showCaptions() { - return p(); + return h(); }, set showCaptions(w = !1) { - p(w), ne(); + h(w), ne(); } - }, ze = cp(), Rt = gn(ze), St = We(Rt); + }, hn = pp(), Ct = gn(hn), dn = Be(Ct); { - let w = /* @__PURE__ */ Cn(() => lt(i())); - wl(St, { + let w = /* @__PURE__ */ Sn(() => qe(i())); + bl(dn, { get labels() { return $(w); }, get currentStep() { - return $(Ne); + return $(je); }, disabled: !1, - onAdvance: U + onAdvance: G }); } - Ie(Rt); - var Xt = et(Rt, 4), ge = We(Xt), Wt = We(ge), hn = We(Wt); - vi( - yl(hn, { + Oe(Ct); + var Wt = Ze(Ct, 4), vt = Be(Wt), En = Be(vt), Je = Be(En); + pi( + xl(Je, { get jsonData() { - return $(q); + return $(I); }, get currentRound() { return i(); }, - requestRoundChange: se, - get candidateColors() { + requestRoundChange: fe, + get requestSkipToRound() { return a(); }, + get candidateColors() { + return o(); + }, get excludeFinalWinnerAndEliminatedCandidate() { - return l(); + return u(); }, get firstRoundDeterminesPercentages() { - return u(); + return f(); }, get randomizeOrder() { - return f(); + return d(); }, get mouseEventType() { - return $(D); + return $(N); }, set mouseEventType(w) { - de(D, w, !0); + ve(N, w, !0); }, get mouseData() { return $(M); }, set mouseData(w) { - de(M, w, !0); + ve(M, w, !0); }, get mouseX() { - return $(S); + return $(F); }, set mouseX(w) { - de(S, w, !0); + ve(F, w, !0); }, get mouseY() { - return $(I); + return $(W); }, set mouseY(w) { - de(I, w, !0); + ve(W, w, !0); }, get displayPhase() { - return $(Ne); + return $(je); }, set displayPhase(w) { - de(Ne, w, !0); + ve(je, w, !0); } }), - (w) => F = w, - () => F - ), Ie(Wt), Ie(ge); - var Jr = et(ge, 2); + (w) => te = w, + () => te + ), Oe(En), Oe(vt); + var $r = Ze(vt, 2); { - var Zr = (w) => { - var G = up(), re = gn(G), me = We(re); - Ie(re); - var ye = et(re, 2), le = We(ye); + var Ar = (w) => { + var Y = hp(), se = gn(Y), we = Be(se); + Oe(se); + var ye = Ze(se, 2), ue = Be(ye); { - var Fe = (He) => { - var Ze = ap(), Me = et(gn(Ze)); - pi(Me, 17, () => Ae(i()), di, (Qe, we, ut) => { - var Ye = sp(), ft = gn(Ye); - let kt; - var Zn = We(ft, !0); - Ie(ft); - var Qn = et(ft, 2); + var Ve = (ze) => { + var kt = up(), ot = Ze(gn(kt)); + di(ot, 17, () => ce(i()), hi, (_t, Mt, mt) => { + var xe = lp(), De = gn(xe); + let Ee; + var Gt = Be(De, !0); + Oe(De); + var Zn = Ze(De, 2); { - var _e = (Gt) => { - var Kt = va(", "); - Ge(Gt, Kt); - }, Ar = /* @__PURE__ */ Cn(() => ut < Ae(i()).length - 1); - tr(Qn, (Gt) => { - $(Ar) && Gt(_e); + var Er = (oe) => { + var Kt = _a(", "); + We(oe, Kt); + }, Qn = /* @__PURE__ */ Sn(() => mt < ce(i()).length - 1); + tr(Zn, (oe) => { + $(Qn) && oe(Er); }); } Zt( - (Gt) => { - kt = ya(ft, "", kt, Gt), _n(Zn, $(we)); + (oe) => { + Ee = xa(De, "", Ee, oe), _n(Gt, $(Mt)); }, - [() => ({ color: Ct()[$(we)] })] - ), Ge(Qe, Ye); - }), Ge(He, Ze); - }, Ut = /* @__PURE__ */ Cn(() => Ae(i()).length > 0); - tr(le, (He) => { - $(Ut) && He(Fe); + [() => ({ color: St()[$(Mt)] })] + ), We(_t, xe); + }), We(ze, kt); + }, Ut = /* @__PURE__ */ Sn(() => ce(i()).length > 0); + tr(ue, (ze) => { + $(Ut) && ze(Ve); }); } - var Nt = et(le, 2); + var gt = Ze(ue, 2); { - var Tn = (He) => { - var Ze = lp(), Me = gn(Ze), Qe = et(Me); - pi(Qe, 17, () => ee(i()), di, (we, ut, Ye) => { - var ft = op(), kt = gn(ft); - let Zn; - var Qn = We(kt, !0); - Ie(kt); - var _e = et(kt, 2); + var Rn = (ze) => { + var kt = cp(), ot = gn(kt), _t = Ze(ot); + di(_t, 17, () => _e(i()), hi, (Mt, mt, xe) => { + var De = fp(), Ee = gn(De); + let Gt; + var Zn = Be(Ee, !0); + Oe(Ee); + var Er = Ze(Ee, 2); { - var Ar = (Kt) => { - var Qr = va(", "); - Ge(Kt, Qr); - }, Gt = /* @__PURE__ */ Cn(() => Ye < ee(i()).length - 1); - tr(_e, (Kt) => { - $(Gt) && Kt(Ar); + var Qn = (Kt) => { + var ji = _a(", "); + We(Kt, ji); + }, oe = /* @__PURE__ */ Sn(() => xe < _e(i()).length - 1); + tr(Er, (Kt) => { + $(oe) && Kt(Qn); }); } Zt( (Kt) => { - Zn = ya(kt, "", Zn, Kt), _n(Qn, $(ut)); + Gt = xa(Ee, "", Gt, Kt), _n(Zn, $(mt)); }, - [() => ({ color: Ct()[$(ut)] })] - ), Ge(we, ft); - }), Zt(() => _n(Me, `${$(d).caption ?? ""}: `)), Ge(He, Ze); - }, pn = /* @__PURE__ */ Cn(() => ee(i()).length > 0); - tr(Nt, (He) => { - $(pn) && He(Tn); + [() => ({ color: St()[$(mt)] })] + ), We(Mt, De); + }), Zt(() => _n(ot, `${$(_).caption ?? ""}: `)), We(ze, kt); + }, pn = /* @__PURE__ */ Sn(() => _e(i()).length > 0); + tr(gt, (ze) => { + $(pn) && ze(Rn); }); } - Ie(ye), Zt((He) => _n(me, `${$(q).config.contest ?? ""}, ${He ?? ""} ${$(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, G); + Oe(ye), Zt((ze) => _n(we, `${$(I).config.contest ?? ""}, ${ze ?? ""} ${$(_).infinitive ?? ""}, Round ${i() ?? ""}.`), [H]), We(w, Y); }; - tr(Jr, (w) => { - p() && w(Zr); + tr($r, (w) => { + h() && w(Ar); }); } - Ie(Xt); - var En = et(Xt, 2), $r = We(En), dn = We($r, !0); - Ie($r); - var Ki = et($r, 2); - pi(Ki, 17, () => $(b), di, (w, G) => { - var re = fp(), me = gn(re), ye = We(me, !0); - Ie(me), ls(2), Zt(() => _n(ye, $(G))), Ge(w, re); - }), Ie(En), vi(En, (w) => de(y, w), () => $(y)); - var jn = et(En, 2), Jn = We(jn); - return ls(2), Ie(jn), vi(jn, (w) => de(x, w), () => $(x)), Zt( + Oe(Wt); + var Tn = Ze(Wt, 2), Jn = Be(Tn), Zr = Be(Jn, !0); + Oe(Jn); + var Gi = Ze(Jn, 2); + di(Gi, 17, () => $(O), hi, (w, Y) => { + var se = dp(), we = gn(se), ye = Be(we, !0); + Oe(we), us(2), Zt(() => _n(ye, $(Y))), We(w, se); + }), Oe(Tn), pi(Tn, (w) => ve(x, w), () => $(x)); + var Nt = Ze(Tn, 2), Ki = Be(Nt); + return us(2), Oe(Nt), pi(Nt, (w) => ve(y, w), () => $(y)), Zt( (w) => { - _n(dn, $(m)), _n(Jn, `"${w ?? ""}" means all the candidates ranked on `); + _n(Zr, $(b)), _n(Ki, `"${w ?? ""}" means all the candidates ranked on `); }, - [ke] - ), Ge(e, ze), zi(oe); + [Pe] + ), We(e, hn), Vi(Z); } -customElements.define("pie-chart", Hs( - dp, +customElements.define("pie-chart", Ys( + gp, { electionSummary: {}, currentRound: {}, requestRoundChange: {}, + requestSkipToRound: {}, candidateColors: {}, textForWinner: {}, excludeFinalWinnerAndEliminatedCandidate: {}, From db97b29773f4f7f9b644cd0a3be505f5435c0a3d Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 9 Apr 2026 10:47:55 -0700 Subject: [PATCH 09/10] Add skipToStep to RoundPlayer and wire up pie chart round skipping Skip no-transfer rounds during pie chart animation by requesting the controller to advance immediately. Remove firstStepHoldTimeMs workaround since the first step now fires immediately. Co-Authored-By: Claude Opus 4.6 --- static/visualizer/round-player.js | 10 +++++++++- templates/pie/pie-nonblocking.html | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/static/visualizer/round-player.js b/static/visualizer/round-player.js index 14914706..6461c3af 100644 --- a/static/visualizer/round-player.js +++ b/static/visualizer/round-player.js @@ -134,6 +134,14 @@ function RoundPlayer({ changeStep(step); } + // Jump to a step immediately without stopping playback. + // Used to skip no-transfer rounds during animation. + function skipToStep(step) { + window.clearTimeout(timer); + changeStep(step); + if (isPlaying) nextStep(stepTimeMs); + } + function nextStep(currStepTimeMs) { if (!isPlaying) return; @@ -168,5 +176,5 @@ function RoundPlayer({ init(); - return { play, stop, setStep, setTimeBetweenStepsMs, playing }; + return { play, stop, setStep, skipToStep, setTimeBetweenStepsMs, playing }; } diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index e18da237..bcc667c1 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -24,6 +24,7 @@ // So we don't have to re-stringify the JSON object, which will be immediately parsed again, // we can just bind it in object form here. pieChart.requestRoundChange = updateRound; + pieChart.requestSkipToRound = skipToRound; pieChart.electionSummary = electionSummary; pieChart.candidateColors = candidateColors; pieChart.textForWinner = "{{ textForWinner }}"; @@ -40,7 +41,6 @@ totalRounds: {{ config.numRounds }}, onChange: updatePieChartRound, timeBetweenStepsMs: 3000, - firstStepHoldTimeMs: 500, }); function updatePieChartRound(sliderIndex) { @@ -55,4 +55,11 @@ pieRoundPlayer.setStep(roundNum - 1); } + // Skip to a round immediately without stopping playback. + // Used to skip no-transfer rounds during animation. + function skipToRound(roundNum) { + pieChart.currentRound = roundNum; + pieRoundPlayer.skipToStep(roundNum - 1); + } + From c6f7d556cc0fa2fc51d58e9eb587137af67f89c6 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 9 Apr 2026 10:52:38 -0700 Subject: [PATCH 10/10] Fire first animation step immediately in RoundPlayer The timer delay is for between steps, not before the first one. Removes the need for the firstStepHoldTimeMs workaround. Co-Authored-By: Claude Opus 4.6 --- static/visualizer/round-player.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/visualizer/round-player.js b/static/visualizer/round-player.js index 6461c3af..e705b7de 100644 --- a/static/visualizer/round-player.js +++ b/static/visualizer/round-player.js @@ -156,7 +156,8 @@ function RoundPlayer({ isPlaying = true; container.querySelector(".round-player-play-btn").innerText = "Stop"; changeStep(0); - nextStep(firstStepTimeMs); + // First step fires immediately — the timer delay is for between steps + nextStep(0); } function stop() {