import { ref as It, defineComponent as en, computed as at, openBlock as Tt, createElementBlock as Kt, mergeProps as cs, unref as Ee, renderSlot as un, watch as wn, nextTick as Va, provide as wa, reactive as es, onActivated as L7, onMounted as Yr, onUpdated as O7, normalizeClass as Gt, createElementVNode as fn, normalizeStyle as Bi, createBlock as An, resolveDynamicComponent as yo, withCtx as on, createCommentVNode as In, inject as zn, onBeforeUnmount as vi, withDirectives as xo, cloneVNode as D7, Fragment as _o, Text as f3, Comment as F7, createVNode as Mn, toRef as Pi, Transition as Np, vShow as Hc, readonly as I7, onDeactivated as z7, toDisplayString as ma, withModifiers as ga, toHandlers as E7, withKeys as Xs, createTextVNode as ts, toRefs as r1, getCurrentInstance as _a, warn as j7, onBeforeMount as P7, useSlots as R7, toRaw as a1, watchEffect as N7, getCurrentScope as B7, onScopeDispose as H7, shallowRef as h3, onUnmounted as V7, isRef as q7, Teleport as U7, resolveComponent as co, resolveDirective as G7, toHandlerKey as W7, renderList as bc, vModelText as Z7, markRaw as fo } from "vue"; function Y7(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var p3 = { exports: {} }, dr = p3.exports = {}, Ii, zi; function Em() { throw new Error("setTimeout has not been defined"); } function jm() { throw new Error("clearTimeout has not been defined"); } (function() { try { typeof setTimeout == "function" ? Ii = setTimeout : Ii = Em; } catch { Ii = Em; } try { typeof clearTimeout == "function" ? zi = clearTimeout : zi = jm; } catch { zi = jm; } })(); function g3(e) { if (Ii === setTimeout) return setTimeout(e, 0); if ((Ii === Em || !Ii) && setTimeout) return Ii = setTimeout, setTimeout(e, 0); try { return Ii(e, 0); } catch { try { return Ii.call(null, e, 0); } catch { return Ii.call(this, e, 0); } } } function $7(e) { if (zi === clearTimeout) return clearTimeout(e); if ((zi === jm || !zi) && clearTimeout) return zi = clearTimeout, clearTimeout(e); try { return zi(e); } catch { try { return zi.call(null, e); } catch { return zi.call(this, e); } } } var go = [], gc = !1, Nl, Oh = -1; function K7() { !gc || !Nl || (gc = !1, Nl.length ? go = Nl.concat(go) : Oh = -1, go.length && v3()); } function v3() { if (!gc) { var e = g3(K7); gc = !0; for (var t = go.length; t; ) { for (Nl = go, go = []; ++Oh < t; ) Nl && Nl[Oh].run(); Oh = -1, t = go.length; } Nl = null, gc = !1, $7(e); } } dr.nextTick = function(e) { var t = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]; go.push(new m3(e, t)), go.length === 1 && !gc && g3(v3); }; function m3(e, t) { this.fun = e, this.array = t; } m3.prototype.run = function() { this.fun.apply(null, this.array); }; dr.title = "browser"; dr.browser = !0; dr.env = {}; dr.argv = []; dr.version = ""; dr.versions = {}; function Mo() { } dr.on = Mo; dr.addListener = Mo; dr.once = Mo; dr.off = Mo; dr.removeListener = Mo; dr.removeAllListeners = Mo; dr.emit = Mo; dr.prependListener = Mo; dr.prependOnceListener = Mo; dr.listeners = function(e) { return []; }; dr.binding = function(e) { throw new Error("process.binding is not supported"); }; dr.cwd = function() { return "/"; }; dr.chdir = function(e) { throw new Error("process.chdir is not supported"); }; dr.umask = function() { return 0; }; var J7 = p3.exports; const us = /* @__PURE__ */ Y7(J7), uo = (e, t, { checkForDefaultPrevented: n = !0 } = {}) => (r) => { const a = e == null ? void 0 : e(r); if (n === !1 || !a) return t == null ? void 0 : t(r); }, oc = globalThis || void 0 || self; var E2; const Wr = typeof window < "u", Q7 = (e) => typeof e == "string", y3 = () => { }, Pm = Wr && ((E2 = window == null ? void 0 : window.navigator) == null ? void 0 : E2.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function x3(e) { return typeof e == "function" ? e() : Ee(e); } function X7(e) { return e; } function Bp(e) { return B7() ? (H7(e), !0) : !1; } function eI(e, t = !0) { _a() ? Yr(e) : t ? e() : Va(e); } function vo(e) { var t; const n = x3(e); return (t = n == null ? void 0 : n.$el) != null ? t : n; } const Hp = Wr ? window : void 0; function ci(...e) { let t, n, r, a; if (Q7(e[0]) || Array.isArray(e[0]) ? ([n, r, a] = e, t = Hp) : [t, n, r, a] = e, !t) return y3; Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]); const i = [], o = () => { i.forEach((u) => u()), i.length = 0; }, l = (u, f, h, g) => (u.addEventListener(f, h, g), () => u.removeEventListener(f, h, g)), s = wn(() => [vo(t), x3(a)], ([u, f]) => { o(), u && i.push(...n.flatMap((h) => r.map((g) => l(u, h, g, f)))); }, { immediate: !0, flush: "post" }), c = () => { s(), o(); }; return Bp(c), c; } let j2 = !1; function tI(e, t, n = {}) { const { window: r = Hp, ignore: a = [], capture: i = !0, detectIframe: o = !1 } = n; if (!r) return; Pm && !j2 && (j2 = !0, Array.from(r.document.body.children).forEach((u) => u.addEventListener("click", y3))); let l = !0; const s = (u) => a.some((f) => { if (typeof f == "string") return Array.from(r.document.querySelectorAll(f)).some((h) => h === u.target || u.composedPath().includes(h)); { const h = vo(f); return h && (u.target === h || u.composedPath().includes(h)); } }), c = [ ci(r, "click", (u) => { const f = vo(e); if (!(!f || f === u.target || u.composedPath().includes(f))) { if (u.detail === 0 && (l = !s(u)), !l) { l = !0; return; } t(u); } }, { passive: !0, capture: i }), ci(r, "pointerdown", (u) => { const f = vo(e); f && (l = !u.composedPath().includes(f) && !s(u)); }, { passive: !0 }), o && ci(r, "blur", (u) => { var f; const h = vo(e); ((f = r.document.activeElement) == null ? void 0 : f.tagName) === "IFRAME" && !(h != null && h.contains(r.document.activeElement)) && t(u); }) ].filter(Boolean); return () => c.forEach((u) => u()); } function b3(e, t = !1) { const n = It(), r = () => n.value = !!e(); return r(), eI(r, t), n; } const Rm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof oc < "u" ? oc : typeof self < "u" ? self : {}, Nm = "__vueuse_ssr_handlers__"; Rm[Nm] = Rm[Nm] || {}; Rm[Nm]; var P2 = Object.getOwnPropertySymbols, nI = Object.prototype.hasOwnProperty, rI = Object.prototype.propertyIsEnumerable, aI = (e, t) => { var n = {}; for (var r in e) nI.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && P2) for (var r of P2(e)) t.indexOf(r) < 0 && rI.call(e, r) && (n[r] = e[r]); return n; }; function Zo(e, t, n = {}) { const r = n, { window: a = Hp } = r, i = aI(r, ["window"]); let o; const l = b3(() => a && "ResizeObserver" in a), s = () => { o && (o.disconnect(), o = void 0); }, c = wn(() => vo(e), (f) => { s(), l.value && a && f && (o = new ResizeObserver(t), o.observe(f, i)); }, { immediate: !0, flush: "post" }), u = () => { s(), c(); }; return Bp(u), { isSupported: l, stop: u }; } var R2 = Object.getOwnPropertySymbols, iI = Object.prototype.hasOwnProperty, oI = Object.prototype.propertyIsEnumerable, lI = (e, t) => { var n = {}; for (var r in e) iI.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (e != null && R2) for (var r of R2(e)) t.indexOf(r) < 0 && oI.call(e, r) && (n[r] = e[r]); return n; }; function sI(e, t, n = {}) { const r = n, { window: a = Hp } = r, i = lI(r, ["window"]); let o; const l = b3(() => a && "MutationObserver" in a), s = () => { o && (o.disconnect(), o = void 0); }, c = wn(() => vo(e), (f) => { s(), l.value && a && f && (o = new MutationObserver(t), o.observe(f, i)); }, { immediate: !0 }), u = () => { s(), c(); }; return Bp(u), { isSupported: l, stop: u }; } var N2; (function(e) { e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE"; })(N2 || (N2 = {})); var cI = Object.defineProperty, B2 = Object.getOwnPropertySymbols, uI = Object.prototype.hasOwnProperty, dI = Object.prototype.propertyIsEnumerable, H2 = (e, t, n) => t in e ? cI(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, fI = (e, t) => { for (var n in t || (t = {})) uI.call(t, n) && H2(e, n, t[n]); if (B2) for (var n of B2(t)) dI.call(t, n) && H2(e, n, t[n]); return e; }; const hI = { easeInSine: [0.12, 0, 0.39, 0], easeOutSine: [0.61, 1, 0.88, 1], easeInOutSine: [0.37, 0, 0.63, 1], easeInQuad: [0.11, 0, 0.5, 0], easeOutQuad: [0.5, 1, 0.89, 1], easeInOutQuad: [0.45, 0, 0.55, 1], easeInCubic: [0.32, 0, 0.67, 0], easeOutCubic: [0.33, 1, 0.68, 1], easeInOutCubic: [0.65, 0, 0.35, 1], easeInQuart: [0.5, 0, 0.75, 0], easeOutQuart: [0.25, 1, 0.5, 1], easeInOutQuart: [0.76, 0, 0.24, 1], easeInQuint: [0.64, 0, 0.78, 0], easeOutQuint: [0.22, 1, 0.36, 1], easeInOutQuint: [0.83, 0, 0.17, 1], easeInExpo: [0.7, 0, 0.84, 0], easeOutExpo: [0.16, 1, 0.3, 1], easeInOutExpo: [0.87, 0, 0.13, 1], easeInCirc: [0.55, 0, 1, 0.45], easeOutCirc: [0, 0.55, 0.45, 1], easeInOutCirc: [0.85, 0, 0.15, 1], easeInBack: [0.36, 0, 0.66, -0.56], easeOutBack: [0.34, 1.56, 0.64, 1], easeInOutBack: [0.68, -0.6, 0.32, 1.6] }; fI({ linear: X7 }, hI); us.env.NODE_ENV !== "production" && Object.freeze({}); us.env.NODE_ENV !== "production" && Object.freeze([]); const Jh = () => { }, pI = Object.prototype.hasOwnProperty, V2 = (e, t) => pI.call(e, t), Ri = Array.isArray, ca = (e) => typeof e == "function", Vc = (e) => typeof e == "string", Ni = (e) => e !== null && typeof e == "object", gI = Object.prototype.toString, vI = (e) => gI.call(e), Sg = (e) => vI(e).slice(8, -1); var w3 = typeof oc == "object" && oc && oc.Object === Object && oc, mI = typeof self == "object" && self && self.Object === Object && self, Wi = w3 || mI || Function("return this")(), qi = Wi.Symbol, _3 = Object.prototype, yI = _3.hasOwnProperty, xI = _3.toString, hu = qi ? qi.toStringTag : void 0; function bI(e) { var t = yI.call(e, hu), n = e[hu]; try { e[hu] = void 0; var r = !0; } catch { } var a = xI.call(e); return r && (t ? e[hu] = n : delete e[hu]), a; } var wI = Object.prototype, _I = wI.toString; function kI(e) { return _I.call(e); } var TI = "[object Null]", AI = "[object Undefined]", q2 = qi ? qi.toStringTag : void 0; function qc(e) { return e == null ? e === void 0 ? AI : TI : q2 && q2 in Object(e) ? bI(e) : kI(e); } function wc(e) { return e != null && typeof e == "object"; } var MI = "[object Symbol]"; function Vp(e) { return typeof e == "symbol" || wc(e) && qc(e) == MI; } function SI(e, t) { for (var n = -1, r = e == null ? 0 : e.length, a = Array(r); ++n < r; ) a[n] = t(e[n], n, e); return a; } var gi = Array.isArray, CI = 1 / 0, U2 = qi ? qi.prototype : void 0, G2 = U2 ? U2.toString : void 0; function k3(e) { if (typeof e == "string") return e; if (gi(e)) return SI(e, k3) + ""; if (Vp(e)) return G2 ? G2.call(e) : ""; var t = e + ""; return t == "0" && 1 / e == -CI ? "-0" : t; } var LI = /\s/; function OI(e) { for (var t = e.length; t-- && LI.test(e.charAt(t)); ) ; return t; } var DI = /^\s+/; function FI(e) { return e && e.slice(0, OI(e) + 1).replace(DI, ""); } function ll(e) { var t = typeof e; return e != null && (t == "object" || t == "function"); } var W2 = NaN, II = /^[-+]0x[0-9a-f]+$/i, zI = /^0b[01]+$/i, EI = /^0o[0-7]+$/i, jI = parseInt; function Z2(e) { if (typeof e == "number") return e; if (Vp(e)) return W2; if (ll(e)) { var t = typeof e.valueOf == "function" ? e.valueOf() : e; e = ll(t) ? t + "" : t; } if (typeof e != "string") return e === 0 ? e : +e; e = FI(e); var n = zI.test(e); return n || EI.test(e) ? jI(e.slice(2), n ? 2 : 8) : II.test(e) ? W2 : +e; } function T3(e) { return e; } var PI = "[object AsyncFunction]", RI = "[object Function]", NI = "[object GeneratorFunction]", BI = "[object Proxy]"; function A3(e) { if (!ll(e)) return !1; var t = qc(e); return t == RI || t == NI || t == PI || t == BI; } var Cg = Wi["__core-js_shared__"], Y2 = function() { var e = /[^.]+$/.exec(Cg && Cg.keys && Cg.keys.IE_PROTO || ""); return e ? "Symbol(src)_1." + e : ""; }(); function HI(e) { return !!Y2 && Y2 in e; } var VI = Function.prototype, qI = VI.toString; function ds(e) { if (e != null) { try { return qI.call(e); } catch { } try { return e + ""; } catch { } } return ""; } var UI = /[\\^$.*+?()[\]{}|]/g, GI = /^\[object .+?Constructor\]$/, WI = Function.prototype, ZI = Object.prototype, YI = WI.toString, $I = ZI.hasOwnProperty, KI = RegExp( "^" + YI.call($I).replace(UI, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function JI(e) { if (!ll(e) || HI(e)) return !1; var t = A3(e) ? KI : GI; return t.test(ds(e)); } function QI(e, t) { return e == null ? void 0 : e[t]; } function fs(e, t) { var n = QI(e, t); return JI(n) ? n : void 0; } var Bm = fs(Wi, "WeakMap"); function XI(e, t, n) { switch (n.length) { case 0: return e.call(t); case 1: return e.call(t, n[0]); case 2: return e.call(t, n[0], n[1]); case 3: return e.call(t, n[0], n[1], n[2]); } return e.apply(t, n); } var ez = 800, tz = 16, nz = Date.now; function rz(e) { var t = 0, n = 0; return function() { var r = nz(), a = tz - (r - n); if (n = r, a > 0) { if (++t >= ez) return arguments[0]; } else t = 0; return e.apply(void 0, arguments); }; } function az(e) { return function() { return e; }; } var Qh = function() { try { var e = fs(Object, "defineProperty"); return e({}, "", {}), e; } catch { } }(), iz = Qh ? function(e, t) { return Qh(e, "toString", { configurable: !0, enumerable: !1, value: az(t), writable: !0 }); } : T3, oz = rz(iz); function lz(e, t, n, r) { e.length; for (var a = n + 1; a--; ) if (t(e[a], a, e)) return a; return -1; } var sz = 9007199254740991, cz = /^(?:0|[1-9]\d*)$/; function i1(e, t) { var n = typeof e; return t = t ?? sz, !!t && (n == "number" || n != "symbol" && cz.test(e)) && e > -1 && e % 1 == 0 && e < t; } function uz(e, t, n) { t == "__proto__" && Qh ? Qh(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 }) : e[t] = n; } function o1(e, t) { return e === t || e !== e && t !== t; } var dz = Object.prototype, fz = dz.hasOwnProperty; function hz(e, t, n) { var r = e[t]; (!(fz.call(e, t) && o1(r, n)) || n === void 0 && !(t in e)) && uz(e, t, n); } var $2 = Math.max; function pz(e, t, n) { return t = $2(t === void 0 ? e.length - 1 : t, 0), function() { for (var r = arguments, a = -1, i = $2(r.length - t, 0), o = Array(i); ++a < i; ) o[a] = r[t + a]; a = -1; for (var l = Array(t + 1); ++a < t; ) l[a] = r[a]; return l[t] = n(o), XI(e, this, l); }; } var gz = 9007199254740991; function l1(e) { return typeof e == "number" && e > -1 && e % 1 == 0 && e <= gz; } function vz(e) { return e != null && l1(e.length) && !A3(e); } var mz = Object.prototype; function yz(e) { var t = e && e.constructor, n = typeof t == "function" && t.prototype || mz; return e === n; } function xz(e, t) { for (var n = -1, r = Array(e); ++n < e; ) r[n] = t(n); return r; } var bz = "[object Arguments]"; function K2(e) { return wc(e) && qc(e) == bz; } var M3 = Object.prototype, wz = M3.hasOwnProperty, _z = M3.propertyIsEnumerable, s1 = K2(/* @__PURE__ */ function() { return arguments; }()) ? K2 : function(e) { return wc(e) && wz.call(e, "callee") && !_z.call(e, "callee"); }; function kz() { return !1; } var S3 = typeof exports == "object" && exports && !exports.nodeType && exports, J2 = S3 && typeof module == "object" && module && !module.nodeType && module, Tz = J2 && J2.exports === S3, Q2 = Tz ? Wi.Buffer : void 0, Az = Q2 ? Q2.isBuffer : void 0, Hm = Az || kz, Mz = "[object Arguments]", Sz = "[object Array]", Cz = "[object Boolean]", Lz = "[object Date]", Oz = "[object Error]", Dz = "[object Function]", Fz = "[object Map]", Iz = "[object Number]", zz = "[object Object]", Ez = "[object RegExp]", jz = "[object Set]", Pz = "[object String]", Rz = "[object WeakMap]", Nz = "[object ArrayBuffer]", Bz = "[object DataView]", Hz = "[object Float32Array]", Vz = "[object Float64Array]", qz = "[object Int8Array]", Uz = "[object Int16Array]", Gz = "[object Int32Array]", Wz = "[object Uint8Array]", Zz = "[object Uint8ClampedArray]", Yz = "[object Uint16Array]", $z = "[object Uint32Array]", Wn = {}; Wn[Hz] = Wn[Vz] = Wn[qz] = Wn[Uz] = Wn[Gz] = Wn[Wz] = Wn[Zz] = Wn[Yz] = Wn[$z] = !0; Wn[Mz] = Wn[Sz] = Wn[Nz] = Wn[Cz] = Wn[Bz] = Wn[Lz] = Wn[Oz] = Wn[Dz] = Wn[Fz] = Wn[Iz] = Wn[zz] = Wn[Ez] = Wn[jz] = Wn[Pz] = Wn[Rz] = !1; function Kz(e) { return wc(e) && l1(e.length) && !!Wn[qc(e)]; } function Jz(e) { return function(t) { return e(t); }; } var C3 = typeof exports == "object" && exports && !exports.nodeType && exports, Ku = C3 && typeof module == "object" && module && !module.nodeType && module, Qz = Ku && Ku.exports === C3, Lg = Qz && w3.process, X2 = function() { try { var e = Ku && Ku.require && Ku.require("util").types; return e || Lg && Lg.binding && Lg.binding("util"); } catch { } }(), ew = X2 && X2.isTypedArray, L3 = ew ? Jz(ew) : Kz, Xz = Object.prototype, e9 = Xz.hasOwnProperty; function t9(e, t) { var n = gi(e), r = !n && s1(e), a = !n && !r && Hm(e), i = !n && !r && !a && L3(e), o = n || r || a || i, l = o ? xz(e.length, String) : [], s = l.length; for (var c in e) e9.call(e, c) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. a && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. i && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties. i1(c, s))) && l.push(c); return l; } function n9(e, t) { return function(n) { return e(t(n)); }; } var r9 = n9(Object.keys, Object), a9 = Object.prototype, i9 = a9.hasOwnProperty; function o9(e) { if (!yz(e)) return r9(e); var t = []; for (var n in Object(e)) i9.call(e, n) && n != "constructor" && t.push(n); return t; } function O3(e) { return vz(e) ? t9(e) : o9(e); } var l9 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, s9 = /^\w*$/; function c1(e, t) { if (gi(e)) return !1; var n = typeof e; return n == "number" || n == "symbol" || n == "boolean" || e == null || Vp(e) ? !0 : s9.test(e) || !l9.test(e) || t != null && e in Object(t); } var cd = fs(Object, "create"); function c9() { this.__data__ = cd ? cd(null) : {}, this.size = 0; } function u9(e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t; } var d9 = "__lodash_hash_undefined__", f9 = Object.prototype, h9 = f9.hasOwnProperty; function p9(e) { var t = this.__data__; if (cd) { var n = t[e]; return n === d9 ? void 0 : n; } return h9.call(t, e) ? t[e] : void 0; } var g9 = Object.prototype, v9 = g9.hasOwnProperty; function m9(e) { var t = this.__data__; return cd ? t[e] !== void 0 : v9.call(t, e); } var y9 = "__lodash_hash_undefined__"; function x9(e, t) { var n = this.__data__; return this.size += this.has(e) ? 0 : 1, n[e] = cd && t === void 0 ? y9 : t, this; } function ns(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } ns.prototype.clear = c9; ns.prototype.delete = u9; ns.prototype.get = p9; ns.prototype.has = m9; ns.prototype.set = x9; function b9() { this.__data__ = [], this.size = 0; } function qp(e, t) { for (var n = e.length; n--; ) if (o1(e[n][0], t)) return n; return -1; } var w9 = Array.prototype, _9 = w9.splice; function k9(e) { var t = this.__data__, n = qp(t, e); if (n < 0) return !1; var r = t.length - 1; return n == r ? t.pop() : _9.call(t, n, 1), --this.size, !0; } function T9(e) { var t = this.__data__, n = qp(t, e); return n < 0 ? void 0 : t[n][1]; } function A9(e) { return qp(this.__data__, e) > -1; } function M9(e, t) { var n = this.__data__, r = qp(n, e); return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this; } function So(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } So.prototype.clear = b9; So.prototype.delete = k9; So.prototype.get = T9; So.prototype.has = A9; So.prototype.set = M9; var ud = fs(Wi, "Map"); function S9() { this.size = 0, this.__data__ = { hash: new ns(), map: new (ud || So)(), string: new ns() }; } function C9(e) { var t = typeof e; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; } function Up(e, t) { var n = e.__data__; return C9(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map; } function L9(e) { var t = Up(this, e).delete(e); return this.size -= t ? 1 : 0, t; } function O9(e) { return Up(this, e).get(e); } function D9(e) { return Up(this, e).has(e); } function F9(e, t) { var n = Up(this, e), r = n.size; return n.set(e, t), this.size += n.size == r ? 0 : 1, this; } function Co(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } Co.prototype.clear = S9; Co.prototype.delete = L9; Co.prototype.get = O9; Co.prototype.has = D9; Co.prototype.set = F9; var I9 = "Expected a function"; function u1(e, t) { if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(I9); var n = function() { var r = arguments, a = t ? t.apply(this, r) : r[0], i = n.cache; if (i.has(a)) return i.get(a); var o = e.apply(this, r); return n.cache = i.set(a, o) || i, o; }; return n.cache = new (u1.Cache || Co)(), n; } u1.Cache = Co; var z9 = 500; function E9(e) { var t = u1(e, function(r) { return n.size === z9 && n.clear(), r; }), n = t.cache; return t; } var j9 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, P9 = /\\(\\)?/g, R9 = E9(function(e) { var t = []; return e.charCodeAt(0) === 46 && t.push(""), e.replace(j9, function(n, r, a, i) { t.push(a ? i.replace(P9, "$1") : r || n); }), t; }); function N9(e) { return e == null ? "" : k3(e); } function Gp(e, t) { return gi(e) ? e : c1(e, t) ? [e] : R9(N9(e)); } var B9 = 1 / 0; function Bd(e) { if (typeof e == "string" || Vp(e)) return e; var t = e + ""; return t == "0" && 1 / e == -B9 ? "-0" : t; } function d1(e, t) { t = Gp(t, e); for (var n = 0, r = t.length; e != null && n < r; ) e = e[Bd(t[n++])]; return n && n == r ? e : void 0; } function ho(e, t, n) { var r = e == null ? void 0 : d1(e, t); return r === void 0 ? n : r; } function D3(e, t) { for (var n = -1, r = t.length, a = e.length; ++n < r; ) e[a + n] = t[n]; return e; } var tw = qi ? qi.isConcatSpreadable : void 0; function H9(e) { return gi(e) || s1(e) || !!(tw && e && e[tw]); } function V9(e, t, n, r, a) { var i = -1, o = e.length; for (n || (n = H9), a || (a = []); ++i < o; ) { var l = e[i]; n(l) ? D3(a, l) : a[a.length] = l; } return a; } function q9(e) { var t = e == null ? 0 : e.length; return t ? V9(e) : []; } function U9(e) { return oz(pz(e, void 0, q9), e + ""); } function ji() { if (!arguments.length) return []; var e = arguments[0]; return gi(e) ? e : [e]; } function G9() { this.__data__ = new So(), this.size = 0; } function W9(e) { var t = this.__data__, n = t.delete(e); return this.size = t.size, n; } function Z9(e) { return this.__data__.get(e); } function Y9(e) { return this.__data__.has(e); } var $9 = 200; function K9(e, t) { var n = this.__data__; if (n instanceof So) { var r = n.__data__; if (!ud || r.length < $9 - 1) return r.push([e, t]), this.size = ++n.size, this; n = this.__data__ = new Co(r); } return n.set(e, t), this.size = n.size, this; } function bo(e) { var t = this.__data__ = new So(e); this.size = t.size; } bo.prototype.clear = G9; bo.prototype.delete = W9; bo.prototype.get = Z9; bo.prototype.has = Y9; bo.prototype.set = K9; function J9(e, t) { for (var n = -1, r = e == null ? 0 : e.length, a = 0, i = []; ++n < r; ) { var o = e[n]; t(o, n, e) && (i[a++] = o); } return i; } function Q9() { return []; } var X9 = Object.prototype, eE = X9.propertyIsEnumerable, nw = Object.getOwnPropertySymbols, tE = nw ? function(e) { return e == null ? [] : (e = Object(e), J9(nw(e), function(t) { return eE.call(e, t); })); } : Q9; function nE(e, t, n) { var r = t(e); return gi(e) ? r : D3(r, n(e)); } function rw(e) { return nE(e, O3, tE); } var Vm = fs(Wi, "DataView"), qm = fs(Wi, "Promise"), Um = fs(Wi, "Set"), aw = "[object Map]", rE = "[object Object]", iw = "[object Promise]", ow = "[object Set]", lw = "[object WeakMap]", sw = "[object DataView]", aE = ds(Vm), iE = ds(ud), oE = ds(qm), lE = ds(Um), sE = ds(Bm), Yo = qc; (Vm && Yo(new Vm(new ArrayBuffer(1))) != sw || ud && Yo(new ud()) != aw || qm && Yo(qm.resolve()) != iw || Um && Yo(new Um()) != ow || Bm && Yo(new Bm()) != lw) && (Yo = function(e) { var t = qc(e), n = t == rE ? e.constructor : void 0, r = n ? ds(n) : ""; if (r) switch (r) { case aE: return sw; case iE: return aw; case oE: return iw; case lE: return ow; case sE: return lw; } return t; }); var cw = Wi.Uint8Array, cE = "__lodash_hash_undefined__"; function uE(e) { return this.__data__.set(e, cE), this; } function dE(e) { return this.__data__.has(e); } function Xh(e) { var t = -1, n = e == null ? 0 : e.length; for (this.__data__ = new Co(); ++t < n; ) this.add(e[t]); } Xh.prototype.add = Xh.prototype.push = uE; Xh.prototype.has = dE; function fE(e, t) { for (var n = -1, r = e == null ? 0 : e.length; ++n < r; ) if (t(e[n], n, e)) return !0; return !1; } function hE(e, t) { return e.has(t); } var pE = 1, gE = 2; function F3(e, t, n, r, a, i) { var o = n & pE, l = e.length, s = t.length; if (l != s && !(o && s > l)) return !1; var c = i.get(e), u = i.get(t); if (c && u) return c == t && u == e; var f = -1, h = !0, g = n & gE ? new Xh() : void 0; for (i.set(e, t), i.set(t, e); ++f < l; ) { var p = e[f], v = t[f]; if (r) var y = o ? r(v, p, f, t, e, i) : r(p, v, f, e, t, i); if (y !== void 0) { if (y) continue; h = !1; break; } if (g) { if (!fE(t, function(m, b) { if (!hE(g, b) && (p === m || a(p, m, n, r, i))) return g.push(b); })) { h = !1; break; } } else if (!(p === v || a(p, v, n, r, i))) { h = !1; break; } } return i.delete(e), i.delete(t), h; } function vE(e) { var t = -1, n = Array(e.size); return e.forEach(function(r, a) { n[++t] = [a, r]; }), n; } function mE(e) { var t = -1, n = Array(e.size); return e.forEach(function(r) { n[++t] = r; }), n; } var yE = 1, xE = 2, bE = "[object Boolean]", wE = "[object Date]", _E = "[object Error]", kE = "[object Map]", TE = "[object Number]", AE = "[object RegExp]", ME = "[object Set]", SE = "[object String]", CE = "[object Symbol]", LE = "[object ArrayBuffer]", OE = "[object DataView]", uw = qi ? qi.prototype : void 0, Og = uw ? uw.valueOf : void 0; function DE(e, t, n, r, a, i, o) { switch (n) { case OE: if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1; e = e.buffer, t = t.buffer; case LE: return !(e.byteLength != t.byteLength || !i(new cw(e), new cw(t))); case bE: case wE: case TE: return o1(+e, +t); case _E: return e.name == t.name && e.message == t.message; case AE: case SE: return e == t + ""; case kE: var l = vE; case ME: var s = r & yE; if (l || (l = mE), e.size != t.size && !s) return !1; var c = o.get(e); if (c) return c == t; r |= xE, o.set(e, t); var u = F3(l(e), l(t), r, a, i, o); return o.delete(e), u; case CE: if (Og) return Og.call(e) == Og.call(t); } return !1; } var FE = 1, IE = Object.prototype, zE = IE.hasOwnProperty; function EE(e, t, n, r, a, i) { var o = n & FE, l = rw(e), s = l.length, c = rw(t), u = c.length; if (s != u && !o) return !1; for (var f = s; f--; ) { var h = l[f]; if (!(o ? h in t : zE.call(t, h))) return !1; } var g = i.get(e), p = i.get(t); if (g && p) return g == t && p == e; var v = !0; i.set(e, t), i.set(t, e); for (var y = o; ++f < s; ) { h = l[f]; var m = e[h], b = t[h]; if (r) var w = o ? r(b, m, h, t, e, i) : r(m, b, h, e, t, i); if (!(w === void 0 ? m === b || a(m, b, n, r, i) : w)) { v = !1; break; } y || (y = h == "constructor"); } if (v && !y) { var _ = e.constructor, k = t.constructor; _ != k && "constructor" in e && "constructor" in t && !(typeof _ == "function" && _ instanceof _ && typeof k == "function" && k instanceof k) && (v = !1); } return i.delete(e), i.delete(t), v; } var jE = 1, dw = "[object Arguments]", fw = "[object Array]", Af = "[object Object]", PE = Object.prototype, hw = PE.hasOwnProperty; function RE(e, t, n, r, a, i) { var o = gi(e), l = gi(t), s = o ? fw : Yo(e), c = l ? fw : Yo(t); s = s == dw ? Af : s, c = c == dw ? Af : c; var u = s == Af, f = c == Af, h = s == c; if (h && Hm(e)) { if (!Hm(t)) return !1; o = !0, u = !1; } if (h && !u) return i || (i = new bo()), o || L3(e) ? F3(e, t, n, r, a, i) : DE(e, t, s, n, r, a, i); if (!(n & jE)) { var g = u && hw.call(e, "__wrapped__"), p = f && hw.call(t, "__wrapped__"); if (g || p) { var v = g ? e.value() : e, y = p ? t.value() : t; return i || (i = new bo()), a(v, y, n, r, i); } } return h ? (i || (i = new bo()), EE(e, t, n, r, a, i)) : !1; } function Wp(e, t, n, r, a) { return e === t ? !0 : e == null || t == null || !wc(e) && !wc(t) ? e !== e && t !== t : RE(e, t, n, r, Wp, a); } var NE = 1, BE = 2; function HE(e, t, n, r) { var a = n.length, i = a; if (e == null) return !i; for (e = Object(e); a--; ) { var o = n[a]; if (o[2] ? o[1] !== e[o[0]] : !(o[0] in e)) return !1; } for (; ++a < i; ) { o = n[a]; var l = o[0], s = e[l], c = o[1]; if (o[2]) { if (s === void 0 && !(l in e)) return !1; } else { var u = new bo(), f; if (!(f === void 0 ? Wp(c, s, NE | BE, r, u) : f)) return !1; } } return !0; } function I3(e) { return e === e && !ll(e); } function VE(e) { for (var t = O3(e), n = t.length; n--; ) { var r = t[n], a = e[r]; t[n] = [r, a, I3(a)]; } return t; } function z3(e, t) { return function(n) { return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n)); }; } function qE(e) { var t = VE(e); return t.length == 1 && t[0][2] ? z3(t[0][0], t[0][1]) : function(n) { return n === e || HE(n, e, t); }; } function UE(e, t) { return e != null && t in Object(e); } function GE(e, t, n) { t = Gp(t, e); for (var r = -1, a = t.length, i = !1; ++r < a; ) { var o = Bd(t[r]); if (!(i = e != null && n(e, o))) break; e = e[o]; } return i || ++r != a ? i : (a = e == null ? 0 : e.length, !!a && l1(a) && i1(o, a) && (gi(e) || s1(e))); } function E3(e, t) { return e != null && GE(e, t, UE); } var WE = 1, ZE = 2; function YE(e, t) { return c1(e) && I3(t) ? z3(Bd(e), t) : function(n) { var r = ho(n, e); return r === void 0 && r === t ? E3(n, e) : Wp(t, r, WE | ZE); }; } function $E(e) { return function(t) { return t == null ? void 0 : t[e]; }; } function KE(e) { return function(t) { return d1(t, e); }; } function JE(e) { return c1(e) ? $E(Bd(e)) : KE(e); } function QE(e) { return typeof e == "function" ? e : e == null ? T3 : typeof e == "object" ? gi(e) ? YE(e[0], e[1]) : qE(e) : JE(e); } var Dg = function() { return Wi.Date.now(); }, XE = "Expected a function", ej = Math.max, tj = Math.min; function nj(e, t, n) { var r, a, i, o, l, s, c = 0, u = !1, f = !1, h = !0; if (typeof e != "function") throw new TypeError(XE); t = Z2(t) || 0, ll(n) && (u = !!n.leading, f = "maxWait" in n, i = f ? ej(Z2(n.maxWait) || 0, t) : i, h = "trailing" in n ? !!n.trailing : h); function g(T) { var O = r, M = a; return r = a = void 0, c = T, o = e.apply(M, O), o; } function p(T) { return c = T, l = setTimeout(m, t), u ? g(T) : o; } function v(T) { var O = T - s, M = T - c, C = t - O; return f ? tj(C, i - M) : C; } function y(T) { var O = T - s, M = T - c; return s === void 0 || O >= t || O < 0 || f && M >= i; } function m() { var T = Dg(); if (y(T)) return b(T); l = setTimeout(m, v(T)); } function b(T) { return l = void 0, h && r ? g(T) : (r = a = void 0, o); } function w() { l !== void 0 && clearTimeout(l), c = 0, r = s = a = l = void 0; } function _() { return l === void 0 ? o : b(Dg()); } function k() { var T = Dg(), O = y(T); if (r = arguments, a = this, s = T, O) { if (l === void 0) return p(s); if (f) return clearTimeout(l), l = setTimeout(m, t), g(s); } return l === void 0 && (l = setTimeout(m, t)), o; } return k.cancel = w, k.flush = _, k; } function rj(e, t, n) { var r = e == null ? 0 : e.length; if (!r) return -1; var a = r - 1; return lz(e, QE(t), a); } function Gm(e) { for (var t = -1, n = e == null ? 0 : e.length, r = {}; ++t < n; ) { var a = e[t]; r[a[0]] = a[1]; } return r; } function Wm(e, t) { return Wp(e, t); } function f1(e) { return e == null; } function aj(e) { return e === void 0; } function ij(e, t, n, r) { if (!ll(e)) return e; t = Gp(t, e); for (var a = -1, i = t.length, o = i - 1, l = e; l != null && ++a < i; ) { var s = Bd(t[a]), c = n; if (s === "__proto__" || s === "constructor" || s === "prototype") return e; if (a != o) { var u = l[s]; c = void 0, c === void 0 && (c = ll(u) ? u : i1(t[a + 1]) ? [] : {}); } hz(l, s, c), l = l[s]; } return e; } function oj(e, t, n) { for (var r = -1, a = t.length, i = {}; ++r < a; ) { var o = t[r], l = d1(e, o); n(l, o) && ij(i, Gp(o, e), l); } return i; } function lj(e, t) { return oj(e, t, function(n, r) { return E3(e, r); }); } var sj = U9(function(e, t) { return e == null ? {} : lj(e, t); }); const Uu = (e) => e === void 0, h1 = (e) => typeof e == "boolean", Ua = (e) => typeof e == "number", Gl = (e) => typeof Element > "u" ? !1 : e instanceof Element, cj = (e) => Vc(e) ? !Number.isNaN(Number(e)) : !1, uj = (e = "") => e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); class j3 extends Error { constructor(t) { super(t), this.name = "ElementPlusError"; } } function dj(e, t) { throw new j3(`[${e}] ${t}`); } function Ui(e, t) { if (us.env.NODE_ENV !== "production") { const n = Vc(e) ? new j3(`[${e}] ${t}`) : e; console.warn(n); } } const fj = "utils/dom/style"; function ep(e, t = "px") { if (!e) return ""; if (Ua(e) || cj(e)) return `${e}${t}`; if (Vc(e)) return e; Ui(fj, "binding value must be a string or number"); } function hj(e, t) { if (!Wr) return; if (!t) { e.scrollTop = 0; return; } const n = []; let r = t.offsetParent; for (; r !== null && e !== r && e.contains(r); ) n.push(r), r = r.offsetParent; const a = t.offsetTop + n.reduce((s, c) => s + c.offsetTop, 0), i = a + t.offsetHeight, o = e.scrollTop, l = o + e.clientHeight; a < o ? e.scrollTop = a : i > l && (e.scrollTop = i - e.clientHeight); } /*! Element Plus Icons Vue v2.3.1 */ var pj = /* @__PURE__ */ en({ name: "ArrowDown", __name: "arrow-down", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }), gj = pj, vj = /* @__PURE__ */ en({ name: "ArrowRight", __name: "arrow-right", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }), mj = vj, yj = /* @__PURE__ */ en({ name: "CircleCheck", __name: "circle-check", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), fn("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }), xj = yj, bj = /* @__PURE__ */ en({ name: "CircleClose", __name: "circle-close", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), fn("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }), P3 = bj, wj = /* @__PURE__ */ en({ name: "Close", __name: "close", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }), pw = wj, _j = /* @__PURE__ */ en({ name: "Loading", __name: "loading", setup(e) { return (t, n) => (Tt(), Kt("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ fn("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }), R3 = _j; const N3 = "__epPropKey", hn = (e) => e, kj = (e) => Ni(e) && !!e[N3], Zp = (e, t) => { if (!Ni(e) || kj(e)) return e; const { values: n, required: r, default: a, type: i, validator: o } = e, l = { type: i, required: !!r, validator: n || o ? (s) => { let c = !1, u = []; if (n && (u = Array.from(n), V2(e, "default") && u.push(a), c || (c = u.includes(s))), o && (c || (c = o(s))), !c && u.length > 0) { const f = [...new Set(u)].map((h) => JSON.stringify(h)).join(", "); j7(`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${f}], got value ${JSON.stringify(s)}.`); } return c; } : void 0, [N3]: !0 }; return V2(e, "default") && (l.default = a), l; }, Zn = (e) => Gm(Object.entries(e).map(([t, n]) => [ t, Zp(n, t) ])), _c = hn([ String, Object, Function ]), Tj = { validating: R3, success: xj, error: P3 }, mi = (e, t) => { if (e.install = (n) => { for (const r of [e, ...Object.values(t ?? {})]) n.component(r.name, r); }, t) for (const [n, r] of Object.entries(t)) e[n] = r; return e; }, Aj = (e, t) => (e.install = (n) => { n.directive(t, e); }, e), Yp = (e) => (e.install = Jh, e), dd = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }, Jo = "update:modelValue", $p = "change", B3 = ["", "default", "small", "large"], Mj = (e) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e), Sj = (e) => e, Cj = ({ from: e, replacement: t, scope: n, version: r, ref: a, type: i = "API" }, o) => { wn(() => Ee(o), (l) => { l && Ui(n, `[${i}] ${e} is about to be deprecated in version ${r}, please use ${t} instead. For more detail, please visit: ${a} `); }, { immediate: !0 }); }; var Lj = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const Oj = (e) => (t, n) => Dj(t, n, Ee(e)), Dj = (e, t, n) => ho(n, e, e).replace(/\{(\w+)\}/g, (r, a) => { var i; return `${(i = t == null ? void 0 : t[a]) != null ? i : `{${a}}`}`; }), Fj = (e) => { const t = at(() => Ee(e).name), n = q7(e) ? e : It(e); return { lang: t, locale: n, t: Oj(e) }; }, Ij = Symbol("localeContextKey"), zj = (e) => { const t = zn(Ij, It()); return Fj(at(() => t.value || Lj)); }, Fg = "el", Ej = "is-", Cl = (e, t, n, r, a) => { let i = `${e}-${t}`; return n && (i += `-${n}`), r && (i += `__${r}`), a && (i += `--${a}`), i; }, jj = Symbol("namespaceContextKey"), p1 = (e) => { const t = _a() ? zn(jj, It(Fg)) : It(Fg); return at(() => Ee(t) || Fg); }, or = (e, t) => { const n = p1(); return { namespace: n, b: (r = "") => Cl(n.value, e, r, "", ""), e: (r) => r ? Cl(n.value, e, "", r, "") : "", m: (r) => r ? Cl(n.value, e, "", "", r) : "", be: (r, a) => r && a ? Cl(n.value, e, r, a, "") : "", em: (r, a) => r && a ? Cl(n.value, e, "", r, a) : "", bm: (r, a) => r && a ? Cl(n.value, e, r, "", a) : "", bem: (r, a, i) => r && a && i ? Cl(n.value, e, r, a, i) : "", is: (r, ...a) => { const i = a.length >= 1 ? a[0] : !0; return r && i ? `${Ej}${r}` : ""; }, cssVar: (r) => { const a = {}; for (const i in r) r[i] && (a[`--${n.value}-${i}`] = r[i]); return a; }, cssVarName: (r) => `--${n.value}-${r}`, cssVarBlock: (r) => { const a = {}; for (const i in r) r[i] && (a[`--${n.value}-${e}-${i}`] = r[i]); return a; }, cssVarBlockName: (r) => `--${n.value}-${e}-${r}` }; }, Pj = Zp({ type: hn(Boolean), default: null }), Rj = Zp({ type: hn(Function) }), Nj = (e) => { const t = `update:${e}`, n = `onUpdate:${e}`, r = [t], a = { [e]: Pj, [n]: Rj }; return { useModelToggle: ({ indicator: i, toggleReason: o, shouldHideWhenRouteChanges: l, shouldProceed: s, onShow: c, onHide: u }) => { const f = _a(), { emit: h } = f, g = f.props, p = at(() => ca(g[n])), v = at(() => g[e] === null), y = (T) => { i.value !== !0 && (i.value = !0, o && (o.value = T), ca(c) && c(T)); }, m = (T) => { i.value !== !1 && (i.value = !1, o && (o.value = T), ca(u) && u(T)); }, b = (T) => { if (g.disabled === !0 || ca(s) && !s()) return; const O = p.value && Wr; O && h(t, !0), (v.value || !O) && y(T); }, w = (T) => { if (g.disabled === !0 || !Wr) return; const O = p.value && Wr; O && h(t, !1), (v.value || !O) && m(T); }, _ = (T) => { h1(T) && (g.disabled && T ? p.value && h(t, !1) : i.value !== T && (T ? y() : m())); }, k = () => { i.value ? w() : b(); }; return wn(() => g[e], _), l && f.appContext.config.globalProperties.$route !== void 0 && wn(() => ({ ...f.proxy.$route }), () => { l.value && i.value && w(); }), Yr(() => { _(g[e]); }), { hide: w, show: b, toggle: k, hasUpdateHandler: p }; }, useModelToggleProps: a, useModelToggleEmits: r }; }, H3 = (e) => { const t = _a(); return at(() => { var n, r; return (r = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$props) == null ? void 0 : r[e]; }); }; var ua = "top", Za = "bottom", Ya = "right", da = "left", g1 = "auto", Hd = [ua, Za, Ya, da], kc = "start", fd = "end", Bj = "clippingParents", V3 = "viewport", pu = "popper", Hj = "reference", gw = Hd.reduce(function(e, t) { return e.concat([t + "-" + kc, t + "-" + fd]); }, []), Kp = [].concat(Hd, [g1]).reduce(function(e, t) { return e.concat([t, t + "-" + kc, t + "-" + fd]); }, []), Vj = "beforeRead", qj = "read", Uj = "afterRead", Gj = "beforeMain", Wj = "main", Zj = "afterMain", Yj = "beforeWrite", $j = "write", Kj = "afterWrite", Jj = [Vj, qj, Uj, Gj, Wj, Zj, Yj, $j, Kj]; function Gi(e) { return e ? (e.nodeName || "").toLowerCase() : null; } function yi(e) { if (e == null) return window; if (e.toString() !== "[object Window]") { var t = e.ownerDocument; return t && t.defaultView || window; } return e; } function Tc(e) { var t = yi(e).Element; return e instanceof t || e instanceof Element; } function Ga(e) { var t = yi(e).HTMLElement; return e instanceof t || e instanceof HTMLElement; } function v1(e) { if (typeof ShadowRoot > "u") return !1; var t = yi(e).ShadowRoot; return e instanceof t || e instanceof ShadowRoot; } function Qj(e) { var t = e.state; Object.keys(t.elements).forEach(function(n) { var r = t.styles[n] || {}, a = t.attributes[n] || {}, i = t.elements[n]; !Ga(i) || !Gi(i) || (Object.assign(i.style, r), Object.keys(a).forEach(function(o) { var l = a[o]; l === !1 ? i.removeAttribute(o) : i.setAttribute(o, l === !0 ? "" : l); })); }); } function Xj(e) { var t = e.state, n = { popper: { position: t.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() { Object.keys(t.elements).forEach(function(r) { var a = t.elements[r], i = t.attributes[r] || {}, o = Object.keys(t.styles.hasOwnProperty(r) ? t.styles[r] : n[r]), l = o.reduce(function(s, c) { return s[c] = "", s; }, {}); !Ga(a) || !Gi(a) || (Object.assign(a.style, l), Object.keys(i).forEach(function(s) { a.removeAttribute(s); })); }); }; } var q3 = { name: "applyStyles", enabled: !0, phase: "write", fn: Qj, effect: Xj, requires: ["computeStyles"] }; function Hi(e) { return e.split("-")[0]; } var Wl = Math.max, tp = Math.min, Ac = Math.round; function Mc(e, t) { t === void 0 && (t = !1); var n = e.getBoundingClientRect(), r = 1, a = 1; if (Ga(e) && t) { var i = e.offsetHeight, o = e.offsetWidth; o > 0 && (r = Ac(n.width) / o || 1), i > 0 && (a = Ac(n.height) / i || 1); } return { width: n.width / r, height: n.height / a, top: n.top / a, right: n.right / r, bottom: n.bottom / a, left: n.left / r, x: n.left / r, y: n.top / a }; } function m1(e) { var t = Mc(e), n = e.offsetWidth, r = e.offsetHeight; return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - r) <= 1 && (r = t.height), { x: e.offsetLeft, y: e.offsetTop, width: n, height: r }; } function U3(e, t) { var n = t.getRootNode && t.getRootNode(); if (e.contains(t)) return !0; if (n && v1(n)) { var r = t; do { if (r && e.isSameNode(r)) return !0; r = r.parentNode || r.host; } while (r); } return !1; } function ko(e) { return yi(e).getComputedStyle(e); } function eP(e) { return ["table", "td", "th"].indexOf(Gi(e)) >= 0; } function pl(e) { return ((Tc(e) ? e.ownerDocument : e.document) || window.document).documentElement; } function Jp(e) { return Gi(e) === "html" ? e : e.assignedSlot || e.parentNode || (v1(e) ? e.host : null) || pl(e); } function vw(e) { return !Ga(e) || ko(e).position === "fixed" ? null : e.offsetParent; } function tP(e) { var t = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1; if (n && Ga(e)) { var r = ko(e); if (r.position === "fixed") return null; } var a = Jp(e); for (v1(a) && (a = a.host); Ga(a) && ["html", "body"].indexOf(Gi(a)) < 0; ) { var i = ko(a); if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || t && i.willChange === "filter" || t && i.filter && i.filter !== "none") return a; a = a.parentNode; } return null; } function Vd(e) { for (var t = yi(e), n = vw(e); n && eP(n) && ko(n).position === "static"; ) n = vw(n); return n && (Gi(n) === "html" || Gi(n) === "body" && ko(n).position === "static") ? t : n || tP(e) || t; } function y1(e) { return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y"; } function Ju(e, t, n) { return Wl(e, tp(t, n)); } function nP(e, t, n) { var r = Ju(e, t, n); return r > n ? n : r; } function G3() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function W3(e) { return Object.assign({}, G3(), e); } function Z3(e, t) { return t.reduce(function(n, r) { return n[r] = e, n; }, {}); } var rP = function(e, t) { return e = typeof e == "function" ? e(Object.assign({}, t.rects, { placement: t.placement })) : e, W3(typeof e != "number" ? e : Z3(e, Hd)); }; function aP(e) { var t, n = e.state, r = e.name, a = e.options, i = n.elements.arrow, o = n.modifiersData.popperOffsets, l = Hi(n.placement), s = y1(l), c = [da, Ya].indexOf(l) >= 0, u = c ? "height" : "width"; if (!(!i || !o)) { var f = rP(a.padding, n), h = m1(i), g = s === "y" ? ua : da, p = s === "y" ? Za : Ya, v = n.rects.reference[u] + n.rects.reference[s] - o[s] - n.rects.popper[u], y = o[s] - n.rects.reference[s], m = Vd(i), b = m ? s === "y" ? m.clientHeight || 0 : m.clientWidth || 0 : 0, w = v / 2 - y / 2, _ = f[g], k = b - h[u] - f[p], T = b / 2 - h[u] / 2 + w, O = Ju(_, T, k), M = s; n.modifiersData[r] = (t = {}, t[M] = O, t.centerOffset = O - T, t); } } function iP(e) { var t = e.state, n = e.options, r = n.element, a = r === void 0 ? "[data-popper-arrow]" : r; a != null && (typeof a == "string" && (a = t.elements.popper.querySelector(a), !a) || !U3(t.elements.popper, a) || (t.elements.arrow = a)); } var oP = { name: "arrow", enabled: !0, phase: "main", fn: aP, effect: iP, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function Sc(e) { return e.split("-")[1]; } var lP = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function sP(e) { var t = e.x, n = e.y, r = window, a = r.devicePixelRatio || 1; return { x: Ac(t * a) / a || 0, y: Ac(n * a) / a || 0 }; } function mw(e) { var t, n = e.popper, r = e.popperRect, a = e.placement, i = e.variation, o = e.offsets, l = e.position, s = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, f = e.isFixed, h = o.x, g = h === void 0 ? 0 : h, p = o.y, v = p === void 0 ? 0 : p, y = typeof u == "function" ? u({ x: g, y: v }) : { x: g, y: v }; g = y.x, v = y.y; var m = o.hasOwnProperty("x"), b = o.hasOwnProperty("y"), w = da, _ = ua, k = window; if (c) { var T = Vd(n), O = "clientHeight", M = "clientWidth"; if (T === yi(n) && (T = pl(n), ko(T).position !== "static" && l === "absolute" && (O = "scrollHeight", M = "scrollWidth")), T = T, a === ua || (a === da || a === Ya) && i === fd) { _ = Za; var C = f && T === k && k.visualViewport ? k.visualViewport.height : T[O]; v -= C - r.height, v *= s ? 1 : -1; } if (a === da || (a === ua || a === Za) && i === fd) { w = Ya; var I = f && T === k && k.visualViewport ? k.visualViewport.width : T[M]; g -= I - r.width, g *= s ? 1 : -1; } } var j = Object.assign({ position: l }, c && lP), P = u === !0 ? sP({ x: g, y: v }) : { x: g, y: v }; if (g = P.x, v = P.y, s) { var N; return Object.assign({}, j, (N = {}, N[_] = b ? "0" : "", N[w] = m ? "0" : "", N.transform = (k.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + v + "px)" : "translate3d(" + g + "px, " + v + "px, 0)", N)); } return Object.assign({}, j, (t = {}, t[_] = b ? v + "px" : "", t[w] = m ? g + "px" : "", t.transform = "", t)); } function cP(e) { var t = e.state, n = e.options, r = n.gpuAcceleration, a = r === void 0 ? !0 : r, i = n.adaptive, o = i === void 0 ? !0 : i, l = n.roundOffsets, s = l === void 0 ? !0 : l, c = { placement: Hi(t.placement), variation: Sc(t.placement), popper: t.elements.popper, popperRect: t.rects.popper, gpuAcceleration: a, isFixed: t.options.strategy === "fixed" }; t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, mw(Object.assign({}, c, { offsets: t.modifiersData.popperOffsets, position: t.options.strategy, adaptive: o, roundOffsets: s })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, mw(Object.assign({}, c, { offsets: t.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: s })))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement }); } var Y3 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: cP, data: {} }, Mf = { passive: !0 }; function uP(e) { var t = e.state, n = e.instance, r = e.options, a = r.scroll, i = a === void 0 ? !0 : a, o = r.resize, l = o === void 0 ? !0 : o, s = yi(t.elements.popper), c = [].concat(t.scrollParents.reference, t.scrollParents.popper); return i && c.forEach(function(u) { u.addEventListener("scroll", n.update, Mf); }), l && s.addEventListener("resize", n.update, Mf), function() { i && c.forEach(function(u) { u.removeEventListener("scroll", n.update, Mf); }), l && s.removeEventListener("resize", n.update, Mf); }; } var $3 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: uP, data: {} }, dP = { left: "right", right: "left", bottom: "top", top: "bottom" }; function Dh(e) { return e.replace(/left|right|bottom|top/g, function(t) { return dP[t]; }); } var fP = { start: "end", end: "start" }; function yw(e) { return e.replace(/start|end/g, function(t) { return fP[t]; }); } function x1(e) { var t = yi(e), n = t.pageXOffset, r = t.pageYOffset; return { scrollLeft: n, scrollTop: r }; } function b1(e) { return Mc(pl(e)).left + x1(e).scrollLeft; } function hP(e) { var t = yi(e), n = pl(e), r = t.visualViewport, a = n.clientWidth, i = n.clientHeight, o = 0, l = 0; return r && (a = r.width, i = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = r.offsetLeft, l = r.offsetTop)), { width: a, height: i, x: o + b1(e), y: l }; } function pP(e) { var t, n = pl(e), r = x1(e), a = (t = e.ownerDocument) == null ? void 0 : t.body, i = Wl(n.scrollWidth, n.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = Wl(n.scrollHeight, n.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), l = -r.scrollLeft + b1(e), s = -r.scrollTop; return ko(a || n).direction === "rtl" && (l += Wl(n.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: l, y: s }; } function w1(e) { var t = ko(e), n = t.overflow, r = t.overflowX, a = t.overflowY; return /auto|scroll|overlay|hidden/.test(n + a + r); } function K3(e) { return ["html", "body", "#document"].indexOf(Gi(e)) >= 0 ? e.ownerDocument.body : Ga(e) && w1(e) ? e : K3(Jp(e)); } function Qu(e, t) { var n; t === void 0 && (t = []); var r = K3(e), a = r === ((n = e.ownerDocument) == null ? void 0 : n.body), i = yi(r), o = a ? [i].concat(i.visualViewport || [], w1(r) ? r : []) : r, l = t.concat(o); return a ? l : l.concat(Qu(Jp(o))); } function Zm(e) { return Object.assign({}, e, { left: e.x, top: e.y, right: e.x + e.width, bottom: e.y + e.height }); } function gP(e) { var t = Mc(e); return t.top = t.top + e.clientTop, t.left = t.left + e.clientLeft, t.bottom = t.top + e.clientHeight, t.right = t.left + e.clientWidth, t.width = e.clientWidth, t.height = e.clientHeight, t.x = t.left, t.y = t.top, t; } function xw(e, t) { return t === V3 ? Zm(hP(e)) : Tc(t) ? gP(t) : Zm(pP(pl(e))); } function vP(e) { var t = Qu(Jp(e)), n = ["absolute", "fixed"].indexOf(ko(e).position) >= 0, r = n && Ga(e) ? Vd(e) : e; return Tc(r) ? t.filter(function(a) { return Tc(a) && U3(a, r) && Gi(a) !== "body"; }) : []; } function mP(e, t, n) { var r = t === "clippingParents" ? vP(e) : [].concat(t), a = [].concat(r, [n]), i = a[0], o = a.reduce(function(l, s) { var c = xw(e, s); return l.top = Wl(c.top, l.top), l.right = tp(c.right, l.right), l.bottom = tp(c.bottom, l.bottom), l.left = Wl(c.left, l.left), l; }, xw(e, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function J3(e) { var t = e.reference, n = e.element, r = e.placement, a = r ? Hi(r) : null, i = r ? Sc(r) : null, o = t.x + t.width / 2 - n.width / 2, l = t.y + t.height / 2 - n.height / 2, s; switch (a) { case ua: s = { x: o, y: t.y - n.height }; break; case Za: s = { x: o, y: t.y + t.height }; break; case Ya: s = { x: t.x + t.width, y: l }; break; case da: s = { x: t.x - n.width, y: l }; break; default: s = { x: t.x, y: t.y }; } var c = a ? y1(a) : null; if (c != null) { var u = c === "y" ? "height" : "width"; switch (i) { case kc: s[c] = s[c] - (t[u] / 2 - n[u] / 2); break; case fd: s[c] = s[c] + (t[u] / 2 - n[u] / 2); break; } } return s; } function hd(e, t) { t === void 0 && (t = {}); var n = t, r = n.placement, a = r === void 0 ? e.placement : r, i = n.boundary, o = i === void 0 ? Bj : i, l = n.rootBoundary, s = l === void 0 ? V3 : l, c = n.elementContext, u = c === void 0 ? pu : c, f = n.altBoundary, h = f === void 0 ? !1 : f, g = n.padding, p = g === void 0 ? 0 : g, v = W3(typeof p != "number" ? p : Z3(p, Hd)), y = u === pu ? Hj : pu, m = e.rects.popper, b = e.elements[h ? y : u], w = mP(Tc(b) ? b : b.contextElement || pl(e.elements.popper), o, s), _ = Mc(e.elements.reference), k = J3({ reference: _, element: m, strategy: "absolute", placement: a }), T = Zm(Object.assign({}, m, k)), O = u === pu ? T : _, M = { top: w.top - O.top + v.top, bottom: O.bottom - w.bottom + v.bottom, left: w.left - O.left + v.left, right: O.right - w.right + v.right }, C = e.modifiersData.offset; if (u === pu && C) { var I = C[a]; Object.keys(M).forEach(function(j) { var P = [Ya, Za].indexOf(j) >= 0 ? 1 : -1, N = [ua, Za].indexOf(j) >= 0 ? "y" : "x"; M[j] += I[N] * P; }); } return M; } function yP(e, t) { t === void 0 && (t = {}); var n = t, r = n.placement, a = n.boundary, i = n.rootBoundary, o = n.padding, l = n.flipVariations, s = n.allowedAutoPlacements, c = s === void 0 ? Kp : s, u = Sc(r), f = u ? l ? gw : gw.filter(function(p) { return Sc(p) === u; }) : Hd, h = f.filter(function(p) { return c.indexOf(p) >= 0; }); h.length === 0 && (h = f); var g = h.reduce(function(p, v) { return p[v] = hd(e, { placement: v, boundary: a, rootBoundary: i, padding: o })[Hi(v)], p; }, {}); return Object.keys(g).sort(function(p, v) { return g[p] - g[v]; }); } function xP(e) { if (Hi(e) === g1) return []; var t = Dh(e); return [yw(e), t, yw(t)]; } function bP(e) { var t = e.state, n = e.options, r = e.name; if (!t.modifiersData[r]._skip) { for (var a = n.mainAxis, i = a === void 0 ? !0 : a, o = n.altAxis, l = o === void 0 ? !0 : o, s = n.fallbackPlacements, c = n.padding, u = n.boundary, f = n.rootBoundary, h = n.altBoundary, g = n.flipVariations, p = g === void 0 ? !0 : g, v = n.allowedAutoPlacements, y = t.options.placement, m = Hi(y), b = m === y, w = s || (b || !p ? [Dh(y)] : xP(y)), _ = [y].concat(w).reduce(function(re, te) { return re.concat(Hi(te) === g1 ? yP(t, { placement: te, boundary: u, rootBoundary: f, padding: c, flipVariations: p, allowedAutoPlacements: v }) : te); }, []), k = t.rects.reference, T = t.rects.popper, O = /* @__PURE__ */ new Map(), M = !0, C = _[0], I = 0; I < _.length; I++) { var j = _[I], P = Hi(j), N = Sc(j) === kc, W = [ua, Za].indexOf(P) >= 0, J = W ? "width" : "height", U = hd(t, { placement: j, boundary: u, rootBoundary: f, altBoundary: h, padding: c }), E = W ? N ? Ya : da : N ? Za : ua; k[J] > T[J] && (E = Dh(E)); var z = Dh(E), F = []; if (i && F.push(U[P] <= 0), l && F.push(U[E] <= 0, U[z] <= 0), F.every(function(re) { return re; })) { C = j, M = !1; break; } O.set(j, F); } if (M) for (var q = p ? 3 : 1, H = function(re) { var te = _.find(function(X) { var ce = O.get(X); if (ce) return ce.slice(0, re).every(function(B) { return B; }); }); if (te) return C = te, "break"; }, K = q; K > 0; K--) { var Q = H(K); if (Q === "break") break; } t.placement !== C && (t.modifiersData[r]._skip = !0, t.placement = C, t.reset = !0); } } var wP = { name: "flip", enabled: !0, phase: "main", fn: bP, requiresIfExists: ["offset"], data: { _skip: !1 } }; function bw(e, t, n) { return n === void 0 && (n = { x: 0, y: 0 }), { top: e.top - t.height - n.y, right: e.right - t.width + n.x, bottom: e.bottom - t.height + n.y, left: e.left - t.width - n.x }; } function ww(e) { return [ua, Ya, Za, da].some(function(t) { return e[t] >= 0; }); } function _P(e) { var t = e.state, n = e.name, r = t.rects.reference, a = t.rects.popper, i = t.modifiersData.preventOverflow, o = hd(t, { elementContext: "reference" }), l = hd(t, { altBoundary: !0 }), s = bw(o, r), c = bw(l, a, i), u = ww(s), f = ww(c); t.modifiersData[n] = { referenceClippingOffsets: s, popperEscapeOffsets: c, isReferenceHidden: u, hasPopperEscaped: f }, t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": f }); } var kP = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: _P }; function TP(e, t, n) { var r = Hi(e), a = [da, ua].indexOf(r) >= 0 ? -1 : 1, i = typeof n == "function" ? n(Object.assign({}, t, { placement: e })) : n, o = i[0], l = i[1]; return o = o || 0, l = (l || 0) * a, [da, Ya].indexOf(r) >= 0 ? { x: l, y: o } : { x: o, y: l }; } function AP(e) { var t = e.state, n = e.options, r = e.name, a = n.offset, i = a === void 0 ? [0, 0] : a, o = Kp.reduce(function(u, f) { return u[f] = TP(f, t.rects, i), u; }, {}), l = o[t.placement], s = l.x, c = l.y; t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += s, t.modifiersData.popperOffsets.y += c), t.modifiersData[r] = o; } var MP = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: AP }; function SP(e) { var t = e.state, n = e.name; t.modifiersData[n] = J3({ reference: t.rects.reference, element: t.rects.popper, strategy: "absolute", placement: t.placement }); } var Q3 = { name: "popperOffsets", enabled: !0, phase: "read", fn: SP, data: {} }; function CP(e) { return e === "x" ? "y" : "x"; } function LP(e) { var t = e.state, n = e.options, r = e.name, a = n.mainAxis, i = a === void 0 ? !0 : a, o = n.altAxis, l = o === void 0 ? !1 : o, s = n.boundary, c = n.rootBoundary, u = n.altBoundary, f = n.padding, h = n.tether, g = h === void 0 ? !0 : h, p = n.tetherOffset, v = p === void 0 ? 0 : p, y = hd(t, { boundary: s, rootBoundary: c, padding: f, altBoundary: u }), m = Hi(t.placement), b = Sc(t.placement), w = !b, _ = y1(m), k = CP(_), T = t.modifiersData.popperOffsets, O = t.rects.reference, M = t.rects.popper, C = typeof v == "function" ? v(Object.assign({}, t.rects, { placement: t.placement })) : v, I = typeof C == "number" ? { mainAxis: C, altAxis: C } : Object.assign({ mainAxis: 0, altAxis: 0 }, C), j = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, P = { x: 0, y: 0 }; if (T) { if (i) { var N, W = _ === "y" ? ua : da, J = _ === "y" ? Za : Ya, U = _ === "y" ? "height" : "width", E = T[_], z = E + y[W], F = E - y[J], q = g ? -M[U] / 2 : 0, H = b === kc ? O[U] : M[U], K = b === kc ? -M[U] : -O[U], Q = t.elements.arrow, re = g && Q ? m1(Q) : { width: 0, height: 0 }, te = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : G3(), X = te[W], ce = te[J], B = Ju(0, O[U], re[U]), G = w ? O[U] / 2 - q - B - X - I.mainAxis : H - B - X - I.mainAxis, Z = w ? -O[U] / 2 + q + B + ce + I.mainAxis : K + B + ce + I.mainAxis, oe = t.elements.arrow && Vd(t.elements.arrow), ae = oe ? _ === "y" ? oe.clientTop || 0 : oe.clientLeft || 0 : 0, ge = (N = j == null ? void 0 : j[_]) != null ? N : 0, ve = E + G - ge - ae, pe = E + Z - ge, ye = Ju(g ? tp(z, ve) : z, E, g ? Wl(F, pe) : F); T[_] = ye, P[_] = ye - E; } if (l) { var Oe, Be = _ === "x" ? ua : da, Ie = _ === "x" ? Za : Ya, Fe = T[k], Re = k === "y" ? "height" : "width", We = Fe + y[Be], Ce = Fe - y[Ie], Ve = [ua, da].indexOf(m) !== -1, Ke = (Oe = j == null ? void 0 : j[k]) != null ? Oe : 0, Xe = Ve ? We : Fe - O[Re] - M[Re] - Ke + I.altAxis, ct = Ve ? Fe + O[Re] + M[Re] - Ke - I.altAxis : Ce, vt = g && Ve ? nP(Xe, Fe, ct) : Ju(g ? Xe : We, Fe, g ? ct : Ce); T[k] = vt, P[k] = vt - Fe; } t.modifiersData[r] = P; } } var OP = { name: "preventOverflow", enabled: !0, phase: "main", fn: LP, requiresIfExists: ["offset"] }; function DP(e) { return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop }; } function FP(e) { return e === yi(e) || !Ga(e) ? x1(e) : DP(e); } function IP(e) { var t = e.getBoundingClientRect(), n = Ac(t.width) / e.offsetWidth || 1, r = Ac(t.height) / e.offsetHeight || 1; return n !== 1 || r !== 1; } function zP(e, t, n) { n === void 0 && (n = !1); var r = Ga(t), a = Ga(t) && IP(t), i = pl(t), o = Mc(e, a), l = { scrollLeft: 0, scrollTop: 0 }, s = { x: 0, y: 0 }; return (r || !r && !n) && ((Gi(t) !== "body" || w1(i)) && (l = FP(t)), Ga(t) ? (s = Mc(t, !0), s.x += t.clientLeft, s.y += t.clientTop) : i && (s.x = b1(i))), { x: o.left + l.scrollLeft - s.x, y: o.top + l.scrollTop - s.y, width: o.width, height: o.height }; } function EP(e) { var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = []; e.forEach(function(i) { t.set(i.name, i); }); function a(i) { n.add(i.name); var o = [].concat(i.requires || [], i.requiresIfExists || []); o.forEach(function(l) { if (!n.has(l)) { var s = t.get(l); s && a(s); } }), r.push(i); } return e.forEach(function(i) { n.has(i.name) || a(i); }), r; } function jP(e) { var t = EP(e); return Jj.reduce(function(n, r) { return n.concat(t.filter(function(a) { return a.phase === r; })); }, []); } function PP(e) { var t; return function() { return t || (t = new Promise(function(n) { Promise.resolve().then(function() { t = void 0, n(e()); }); })), t; }; } function RP(e) { var t = e.reduce(function(n, r) { var a = n[r.name]; return n[r.name] = a ? Object.assign({}, a, r, { options: Object.assign({}, a.options, r.options), data: Object.assign({}, a.data, r.data) }) : r, n; }, {}); return Object.keys(t).map(function(n) { return t[n]; }); } var _w = { placement: "bottom", modifiers: [], strategy: "absolute" }; function kw() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]; return !t.some(function(r) { return !(r && typeof r.getBoundingClientRect == "function"); }); } function _1(e) { e === void 0 && (e = {}); var t = e, n = t.defaultModifiers, r = n === void 0 ? [] : n, a = t.defaultOptions, i = a === void 0 ? _w : a; return function(o, l, s) { s === void 0 && (s = i); var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, _w, i), modifiersData: {}, elements: { reference: o, popper: l }, attributes: {}, styles: {} }, u = [], f = !1, h = { state: c, setOptions: function(v) { var y = typeof v == "function" ? v(c.options) : v; p(), c.options = Object.assign({}, i, c.options, y), c.scrollParents = { reference: Tc(o) ? Qu(o) : o.contextElement ? Qu(o.contextElement) : [], popper: Qu(l) }; var m = jP(RP([].concat(r, c.options.modifiers))); return c.orderedModifiers = m.filter(function(b) { return b.enabled; }), g(), h.update(); }, forceUpdate: function() { if (!f) { var v = c.elements, y = v.reference, m = v.popper; if (kw(y, m)) { c.rects = { reference: zP(y, Vd(m), c.options.strategy === "fixed"), popper: m1(m) }, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(M) { return c.modifiersData[M.name] = Object.assign({}, M.data); }); for (var b = 0; b < c.orderedModifiers.length; b++) { if (c.reset === !0) { c.reset = !1, b = -1; continue; } var w = c.orderedModifiers[b], _ = w.fn, k = w.options, T = k === void 0 ? {} : k, O = w.name; typeof _ == "function" && (c = _({ state: c, options: T, name: O, instance: h }) || c); } } } }, update: PP(function() { return new Promise(function(v) { h.forceUpdate(), v(c); }); }), destroy: function() { p(), f = !0; } }; if (!kw(o, l)) return h; h.setOptions(s).then(function(v) { !f && s.onFirstUpdate && s.onFirstUpdate(v); }); function g() { c.orderedModifiers.forEach(function(v) { var y = v.name, m = v.options, b = m === void 0 ? {} : m, w = v.effect; if (typeof w == "function") { var _ = w({ state: c, name: y, instance: h, options: b }), k = function() { }; u.push(_ || k); } }); } function p() { u.forEach(function(v) { return v(); }), u = []; } return h; }; } _1(); var NP = [$3, Q3, Y3, q3]; _1({ defaultModifiers: NP }); var BP = [$3, Q3, Y3, q3, MP, wP, OP, oP, kP], HP = _1({ defaultModifiers: BP }); const VP = (e, t, n = {}) => { const r = { name: "updateState", enabled: !0, phase: "write", fn: ({ state: s }) => { const c = qP(s); Object.assign(o.value, c); }, requires: ["computeStyles"] }, a = at(() => { const { onFirstUpdate: s, placement: c, strategy: u, modifiers: f } = Ee(n); return { onFirstUpdate: s, placement: c || "bottom", strategy: u || "absolute", modifiers: [ ...f || [], r, { name: "applyStyles", enabled: !1 } ] }; }), i = h3(), o = It({ styles: { popper: { position: Ee(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), l = () => { i.value && (i.value.destroy(), i.value = void 0); }; return wn(a, (s) => { const c = Ee(i); c && c.setOptions(s); }, { deep: !0 }), wn([e, t], ([s, c]) => { l(), !(!s || !c) && (i.value = HP(s, c, Ee(a))); }), vi(() => { l(); }), { state: at(() => { var s; return { ...((s = Ee(i)) == null ? void 0 : s.state) || {} }; }), styles: at(() => Ee(o).styles), attributes: at(() => Ee(o).attributes), update: () => { var s; return (s = Ee(i)) == null ? void 0 : s.update(); }, forceUpdate: () => { var s; return (s = Ee(i)) == null ? void 0 : s.forceUpdate(); }, instanceRef: at(() => Ee(i)) }; }; function qP(e) { const t = Object.keys(e.elements), n = Gm(t.map((a) => [a, e.styles[a] || {}])), r = Gm(t.map((a) => [a, e.attributes[a]])); return { styles: n, attributes: r }; } function Tw() { let e; const t = (r, a) => { n(), e = window.setTimeout(r, a); }, n = () => window.clearTimeout(e); return Bp(() => n()), { registerTimeout: t, cancelTimeout: n }; } const Ym = { prefix: Math.floor(Math.random() * 1e4), current: 0 }, UP = Symbol("elIdInjection"), k1 = () => _a() ? zn(UP, Ym) : Ym, Qp = (e) => { const t = k1(); !Wr && t === Ym && Ui("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const n = p1(); return at(() => Ee(e) || `${n.value}-id-${t.prefix}-${t.current++}`); }; let ec = []; const Aw = (e) => { const t = e; t.key === dd.esc && ec.forEach((n) => n(t)); }, GP = (e) => { Yr(() => { ec.length === 0 && document.addEventListener("keydown", Aw), Wr && ec.push(e); }), vi(() => { ec = ec.filter((t) => t !== e), ec.length === 0 && Wr && document.removeEventListener("keydown", Aw); }); }; let Mw; const X3 = () => { const e = p1(), t = k1(), n = at(() => `${e.value}-popper-container-${t.prefix}`), r = at(() => `#${n.value}`); return { id: n, selector: r }; }, WP = (e) => { const t = document.createElement("div"); return t.id = e, document.body.appendChild(t), t; }, ZP = () => { const { id: e, selector: t } = X3(); return P7(() => { Wr && (us.env.NODE_ENV === "test" || !Mw || !document.body.querySelector(t.value)) && (Mw = WP(e.value)); }), { id: e, selector: t }; }, YP = Zn({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }), $P = ({ showAfter: e, hideAfter: t, autoClose: n, open: r, close: a }) => { const { registerTimeout: i } = Tw(), { registerTimeout: o, cancelTimeout: l } = Tw(); return { onOpen: (s) => { i(() => { r(s); const c = Ee(n); Ua(c) && c > 0 && o(() => { a(s); }, c); }, Ee(e)); }, onClose: (s) => { l(), i(() => { a(s); }, Ee(t)); } }; }, eS = Symbol("elForwardRef"), KP = (e) => { wa(eS, { setForwardRef: (t) => { e.value = t; } }); }, JP = (e) => ({ mounted(t) { e(t); }, updated(t) { e(t); }, unmounted() { e(null); } }), Sw = { current: 0 }, Cw = It(0), QP = 2e3, Lw = Symbol("elZIndexContextKey"), XP = Symbol("zIndexContextKey"), eR = (e) => { const t = _a() ? zn(Lw, Sw) : Sw, n = _a() ? zn(XP, void 0) : void 0, r = at(() => { const o = Ee(n); return Ua(o) ? o : QP; }), a = at(() => r.value + Cw.value), i = () => (t.current++, Cw.value = t.current, a.value); return !Wr && !zn(Lw) && Ui("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: r, currentZIndex: a, nextZIndex: i }; }, tS = Zp({ type: String, values: B3, required: !1 }), tR = Symbol("size"), nR = () => { const e = zn(tR, {}); return at(() => Ee(e.size) || ""); }; function rR(e, { beforeFocus: t, afterFocus: n, beforeBlur: r, afterBlur: a } = {}) { const i = _a(), { emit: o } = i, l = h3(), s = It(!1), c = (h) => { ca(t) && t(h) || s.value || (s.value = !0, o("focus", h), n == null || n()); }, u = (h) => { var g; ca(r) && r(h) || h.relatedTarget && (g = l.value) != null && g.contains(h.relatedTarget) || (s.value = !1, o("blur", h), a == null || a()); }, f = () => { var h, g; (h = l.value) != null && h.contains(document.activeElement) && l.value !== document.activeElement || (g = e.value) == null || g.focus(); }; return wn(l, (h) => { h && h.setAttribute("tabindex", "-1"); }), ci(l, "focus", c, !0), ci(l, "blur", u, !0), ci(l, "click", f, !0), us.env.NODE_ENV === "test" && Yr(() => { const h = Gl(e.value) ? e.value : document.querySelector("input,textarea"); h && (ci(h, "focus", c, !0), ci(h, "blur", u, !0)); }), { isFocused: s, wrapperRef: l, handleFocus: c, handleBlur: u }; } function aR({ afterComposition: e, emit: t }) { const n = It(!1), r = (o) => { t == null || t("compositionstart", o), n.value = !0; }, a = (o) => { var l; t == null || t("compositionupdate", o); const s = (l = o.target) == null ? void 0 : l.value, c = s[s.length - 1] || ""; n.value = !Mj(c); }, i = (o) => { t == null || t("compositionend", o), n.value && (n.value = !1, Va(() => e(o))); }; return { isComposing: n, handleComposition: (o) => { o.type === "compositionend" ? i(o) : a(o); }, handleCompositionStart: r, handleCompositionUpdate: a, handleCompositionEnd: i }; } const iR = Symbol("emptyValuesContextKey"), oR = "use-empty-values", lR = ["", void 0, null], sR = void 0, cR = Zn({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (e) => ca(e) ? !e() : !e } }), uR = (e, t) => { const n = _a() ? zn(iR, It({})) : It({}), r = at(() => e.emptyValues || n.value.emptyValues || lR), a = at(() => ca(e.valueOnClear) ? e.valueOnClear() : e.valueOnClear !== void 0 ? e.valueOnClear : ca(n.value.valueOnClear) ? n.value.valueOnClear() : n.value.valueOnClear !== void 0 ? n.value.valueOnClear : sR), i = (o) => r.value.includes(o); return r.value.includes(a.value) || Ui(oR, "value-on-clear should be a value of empty-values"), { emptyValues: r, valueOnClear: a, isEmptyValue: i }; }, dR = Zn({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }), Xp = (e) => sj(dR, e), fR = Symbol(), Ow = It(); function hR(e, t = void 0) { const n = _a() ? zn(fR, Ow) : Ow; return at(() => { var r, a; return (a = (r = n.value) == null ? void 0 : r[e]) != null ? a : t; }); } var qn = (e, t) => { const n = e.__vccOpts || e; for (const [r, a] of t) n[r] = a; return n; }; const pR = Zn({ size: { type: hn([Number, String]) }, color: { type: String } }), gR = en({ name: "ElIcon", inheritAttrs: !1 }), vR = /* @__PURE__ */ en({ ...gR, props: pR, setup(e) { const t = e, n = or("icon"), r = at(() => { const { size: a, color: i } = t; return !a && !i ? {} : { fontSize: Uu(a) ? void 0 : ep(a), "--color": i }; }); return (a, i) => (Tt(), Kt("i", cs({ class: Ee(n).b(), style: Ee(r) }, a.$attrs), [ un(a.$slots, "default") ], 16)); } }); var mR = /* @__PURE__ */ qn(vR, [["__file", "icon.vue"]]); const Cc = mi(mR), T1 = Symbol("formContextKey"), np = Symbol("formItemContextKey"), A1 = (e, t = {}) => { const n = It(void 0), r = t.prop ? n : H3("size"), a = t.global ? n : nR(), i = t.form ? { size: void 0 } : zn(T1, void 0), o = t.formItem ? { size: void 0 } : zn(np, void 0); return at(() => r.value || Ee(e) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }, nS = (e) => { const t = H3("disabled"), n = zn(T1, void 0); return at(() => t.value || Ee(e) || (n == null ? void 0 : n.disabled) || !1); }, rS = () => { const e = zn(T1, void 0), t = zn(np, void 0); return { form: e, formItem: t }; }, yR = (e, { formItemContext: t, disableIdGeneration: n, disableIdManagement: r }) => { n || (n = It(!1)), r || (r = It(!1)); const a = It(); let i; const o = at(() => { var l; return !!(!(e.label || e.ariaLabel) && t && t.inputIds && ((l = t.inputIds) == null ? void 0 : l.length) <= 1); }); return Yr(() => { i = wn([Pi(e, "id"), n], ([l, s]) => { const c = l ?? (s ? void 0 : Qp().value); c !== a.value && (t != null && t.removeInputId && (a.value && t.removeInputId(a.value), !(r != null && r.value) && !s && c && t.addInputId(c)), a.value = c); }, { immediate: !0 }); }), V7(() => { i && i(), t != null && t.removeInputId && a.value && t.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }, Os = 4, xR = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }, bR = ({ move: e, size: t, bar: n }) => ({ [n.size]: t, transform: `translate${n.axis}(${e}%)` }), M1 = Symbol("scrollbarContextKey"), wR = Zn({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: !0 }, always: Boolean }), _R = "Thumb", kR = /* @__PURE__ */ en({ __name: "thumb", props: wR, setup(e) { const t = e, n = zn(M1), r = or("scrollbar"); n || dj(_R, "can not inject scrollbar context"); const a = It(), i = It(), o = It({}), l = It(!1); let s = !1, c = !1, u = Wr ? document.onselectstart : null; const f = at(() => xR[t.vertical ? "vertical" : "horizontal"]), h = at(() => bR({ size: t.size, move: t.move, bar: f.value })), g = at(() => a.value[f.value.offset] ** 2 / n.wrapElement[f.value.scrollSize] / t.ratio / i.value[f.value.offset]), p = (T) => { var O; if (T.stopPropagation(), T.ctrlKey || [1, 2].includes(T.button)) return; (O = window.getSelection()) == null || O.removeAllRanges(), y(T); const M = T.currentTarget; M && (o.value[f.value.axis] = M[f.value.offset] - (T[f.value.client] - M.getBoundingClientRect()[f.value.direction])); }, v = (T) => { if (!i.value || !a.value || !n.wrapElement) return; const O = Math.abs(T.target.getBoundingClientRect()[f.value.direction] - T[f.value.client]), M = i.value[f.value.offset] / 2, C = (O - M) * 100 * g.value / a.value[f.value.offset]; n.wrapElement[f.value.scroll] = C * n.wrapElement[f.value.scrollSize] / 100; }, y = (T) => { T.stopImmediatePropagation(), s = !0, document.addEventListener("mousemove", m), document.addEventListener("mouseup", b), u = document.onselectstart, document.onselectstart = () => !1; }, m = (T) => { if (!a.value || !i.value || s === !1) return; const O = o.value[f.value.axis]; if (!O) return; const M = (a.value.getBoundingClientRect()[f.value.direction] - T[f.value.client]) * -1, C = i.value[f.value.offset] - O, I = (M - C) * 100 * g.value / a.value[f.value.offset]; n.wrapElement[f.value.scroll] = I * n.wrapElement[f.value.scrollSize] / 100; }, b = () => { s = !1, o.value[f.value.axis] = 0, document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", b), k(), c && (l.value = !1); }, w = () => { c = !1, l.value = !!t.size; }, _ = () => { c = !0, l.value = s; }; vi(() => { k(), document.removeEventListener("mouseup", b); }); const k = () => { document.onselectstart !== u && (document.onselectstart = u); }; return ci(Pi(n, "scrollbarElement"), "mousemove", w), ci(Pi(n, "scrollbarElement"), "mouseleave", _), (T, O) => (Tt(), An(Np, { name: Ee(r).b("fade"), persisted: "" }, { default: on(() => [ xo(fn("div", { ref_key: "instance", ref: a, class: Gt([Ee(r).e("bar"), Ee(r).is(Ee(f).key)]), onMousedown: v }, [ fn("div", { ref_key: "thumb", ref: i, class: Gt(Ee(r).e("thumb")), style: Bi(Ee(h)), onMousedown: p }, null, 38) ], 34), [ [Hc, T.always || l.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Dw = /* @__PURE__ */ qn(kR, [["__file", "thumb.vue"]]); const TR = Zn({ always: { type: Boolean, default: !0 }, minSize: { type: Number, required: !0 } }), AR = /* @__PURE__ */ en({ __name: "bar", props: TR, setup(e, { expose: t }) { const n = e, r = zn(M1), a = It(0), i = It(0), o = It(""), l = It(""), s = It(1), c = It(1); return t({ handleScroll: (u) => { if (u) { const f = u.offsetHeight - Os, h = u.offsetWidth - Os; i.value = u.scrollTop * 100 / f * s.value, a.value = u.scrollLeft * 100 / h * c.value; } }, update: () => { const u = r == null ? void 0 : r.wrapElement; if (!u) return; const f = u.offsetHeight - Os, h = u.offsetWidth - Os, g = f ** 2 / u.scrollHeight, p = h ** 2 / u.scrollWidth, v = Math.max(g, n.minSize), y = Math.max(p, n.minSize); s.value = g / (f - g) / (v / (f - v)), c.value = p / (h - p) / (y / (h - y)), l.value = v + Os < f ? `${v}px` : "", o.value = y + Os < h ? `${y}px` : ""; } }), (u, f) => (Tt(), Kt(_o, null, [ Mn(Dw, { move: a.value, ratio: c.value, size: o.value, always: u.always }, null, 8, ["move", "ratio", "size", "always"]), Mn(Dw, { move: i.value, ratio: s.value, size: l.value, vertical: "", always: u.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var MR = /* @__PURE__ */ qn(AR, [["__file", "bar.vue"]]); const SR = Zn({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: !1 }, wrapStyle: { type: hn([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Xp(["ariaLabel", "ariaOrientation"]) }), CR = { scroll: ({ scrollTop: e, scrollLeft: t }) => [e, t].every(Ua) }, $m = "ElScrollbar", LR = en({ name: $m }), OR = /* @__PURE__ */ en({ ...LR, props: SR, emits: CR, setup(e, { expose: t, emit: n }) { const r = e, a = or("scrollbar"); let i, o, l = 0, s = 0; const c = It(), u = It(), f = It(), h = It(), g = at(() => { const k = {}; return r.height && (k.height = ep(r.height)), r.maxHeight && (k.maxHeight = ep(r.maxHeight)), [r.wrapStyle, k]; }), p = at(() => [ r.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !r.native } ]), v = at(() => [a.e("view"), r.viewClass]), y = () => { var k; u.value && ((k = h.value) == null || k.handleScroll(u.value), l = u.value.scrollTop, s = u.value.scrollLeft, n("scroll", { scrollTop: u.value.scrollTop, scrollLeft: u.value.scrollLeft })); }; function m(k, T) { Ni(k) ? u.value.scrollTo(k) : Ua(k) && Ua(T) && u.value.scrollTo(k, T); } const b = (k) => { if (!Ua(k)) { Ui($m, "value must be a number"); return; } u.value.scrollTop = k; }, w = (k) => { if (!Ua(k)) { Ui($m, "value must be a number"); return; } u.value.scrollLeft = k; }, _ = () => { var k; (k = h.value) == null || k.update(); }; return wn(() => r.noresize, (k) => { k ? (i == null || i(), o == null || o()) : ({ stop: i } = Zo(f, _), o = ci("resize", _)); }, { immediate: !0 }), wn(() => [r.maxHeight, r.height], () => { r.native || Va(() => { var k; _(), u.value && ((k = h.value) == null || k.handleScroll(u.value)); }); }), wa(M1, es({ scrollbarElement: c, wrapElement: u })), L7(() => { u.value && (u.value.scrollTop = l, u.value.scrollLeft = s); }), Yr(() => { r.native || Va(() => { _(); }); }), O7(() => _()), t({ wrapRef: u, update: _, scrollTo: m, setScrollTop: b, setScrollLeft: w, handleScroll: y }), (k, T) => (Tt(), Kt("div", { ref_key: "scrollbarRef", ref: c, class: Gt(Ee(a).b()) }, [ fn("div", { ref_key: "wrapRef", ref: u, class: Gt(Ee(p)), style: Bi(Ee(g)), tabindex: k.tabindex, onScroll: y }, [ (Tt(), An(yo(k.tag), { id: k.id, ref_key: "resizeRef", ref: f, class: Gt(Ee(v)), style: Bi(k.viewStyle), role: k.role, "aria-label": k.ariaLabel, "aria-orientation": k.ariaOrientation }, { default: on(() => [ un(k.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), k.native ? In("v-if", !0) : (Tt(), An(MR, { key: 0, ref_key: "barRef", ref: h, always: k.always, "min-size": k.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var DR = /* @__PURE__ */ qn(OR, [["__file", "scrollbar.vue"]]); const FR = mi(DR), S1 = Symbol("popper"), aS = Symbol("popperContent"), IR = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ], iS = Zn({ role: { type: String, values: IR, default: "tooltip" } }), zR = en({ name: "ElPopper", inheritAttrs: !1 }), ER = /* @__PURE__ */ en({ ...zR, props: iS, setup(e, { expose: t }) { const n = e, r = It(), a = It(), i = It(), o = It(), l = at(() => n.role), s = { triggerRef: r, popperInstanceRef: a, contentRef: i, referenceRef: o, role: l }; return t(s), wa(S1, s), (c, u) => un(c.$slots, "default"); } }); var jR = /* @__PURE__ */ qn(ER, [["__file", "popper.vue"]]); const oS = Zn({ arrowOffset: { type: Number, default: 5 } }), PR = en({ name: "ElPopperArrow", inheritAttrs: !1 }), RR = /* @__PURE__ */ en({ ...PR, props: oS, setup(e, { expose: t }) { const n = e, r = or("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = zn(aS, void 0); return wn(() => n.arrowOffset, (l) => { a.value = l; }), vi(() => { i.value = void 0; }), t({ arrowRef: i }), (l, s) => (Tt(), Kt("span", { ref_key: "arrowRef", ref: i, class: Gt(Ee(r).e("arrow")), style: Bi(Ee(o)), "data-popper-arrow": "" }, null, 6)); } }); var NR = /* @__PURE__ */ qn(RR, [["__file", "arrow.vue"]]); const Ig = "ElOnlyChild", BR = en({ name: Ig, setup(e, { slots: t, attrs: n }) { var r; const a = zn(eS), i = JP((r = a == null ? void 0 : a.setForwardRef) != null ? r : Jh); return () => { var o; const l = (o = t.default) == null ? void 0 : o.call(t, n); if (!l) return null; if (l.length > 1) return Ui(Ig, "requires exact only one valid child."), null; const s = lS(l); return s ? xo(D7(s, n), [[i]]) : (Ui(Ig, "no valid child node found"), null); }; } }); function lS(e) { if (!e) return null; const t = e; for (const n of t) { if (Ni(n)) switch (n.type) { case F7: continue; case f3: case "svg": return Fw(n); case _o: return lS(n.children); default: return n; } return Fw(n); } return null; } function Fw(e) { const t = or("only-child"); return Mn("span", { class: t.e("content") }, [e]); } const sS = Zn({ virtualRef: { type: hn(Object) }, virtualTriggering: Boolean, onMouseenter: { type: hn(Function) }, onMouseleave: { type: hn(Function) }, onClick: { type: hn(Function) }, onKeydown: { type: hn(Function) }, onFocus: { type: hn(Function) }, onBlur: { type: hn(Function) }, onContextmenu: { type: hn(Function) }, id: String, open: Boolean }), HR = en({ name: "ElPopperTrigger", inheritAttrs: !1 }), VR = /* @__PURE__ */ en({ ...HR, props: sS, setup(e, { expose: t }) { const n = e, { role: r, triggerRef: a } = zn(S1, void 0); KP(a); const i = at(() => l.value ? n.id : void 0), o = at(() => { if (r && r.value === "tooltip") return n.open && n.id ? n.id : void 0; }), l = at(() => { if (r && r.value !== "tooltip") return r.value; }), s = at(() => l.value ? `${n.open}` : void 0); let c; const u = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return Yr(() => { wn(() => n.virtualRef, (f) => { f && (a.value = vo(f)); }, { immediate: !0 }), wn(a, (f, h) => { c == null || c(), c = void 0, Gl(f) && (u.forEach((g) => { var p; const v = n[g]; v && (f.addEventListener(g.slice(2).toLowerCase(), v), (p = h == null ? void 0 : h.removeEventListener) == null || p.call(h, g.slice(2).toLowerCase(), v)); }), c = wn([i, o, l, s], (g) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((p, v) => { f1(g[v]) ? f.removeAttribute(p) : f.setAttribute(p, g[v]); }); }, { immediate: !0 })), Gl(h) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((g) => h.removeAttribute(g)); }, { immediate: !0 }); }), vi(() => { if (c == null || c(), c = void 0, a.value && Gl(a.value)) { const f = a.value; u.forEach((h) => { const g = n[h]; g && f.removeEventListener(h.slice(2).toLowerCase(), g); }), a.value = void 0; } }), t({ triggerRef: a }), (f, h) => f.virtualTriggering ? In("v-if", !0) : (Tt(), An(Ee(BR), cs({ key: 0 }, f.$attrs, { "aria-controls": Ee(i), "aria-describedby": Ee(o), "aria-expanded": Ee(s), "aria-haspopup": Ee(l) }), { default: on(() => [ un(f.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var qR = /* @__PURE__ */ qn(VR, [["__file", "trigger.vue"]]); const zg = "focus-trap.focus-after-trapped", Eg = "focus-trap.focus-after-released", UR = "focus-trap.focusout-prevented", Iw = { cancelable: !0, bubbles: !1 }, GR = { cancelable: !0, bubbles: !1 }, zw = "focusAfterTrapped", Ew = "focusAfterReleased", WR = Symbol("elFocusTrap"), C1 = It(), e0 = It(0), L1 = It(0); let Sf = 0; const cS = (e) => { const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (r) => { const a = r.tagName === "INPUT" && r.type === "hidden"; return r.disabled || r.hidden || a ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 || r === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; n.nextNode(); ) t.push(n.currentNode); return t; }, jw = (e, t) => { for (const n of e) if (!ZR(n, t)) return n; }, ZR = (e, t) => { if (us.env.NODE_ENV === "test") return !1; if (getComputedStyle(e).visibility === "hidden") return !0; for (; e; ) { if (t && e === t) return !1; if (getComputedStyle(e).display === "none") return !0; e = e.parentElement; } return !1; }, YR = (e) => { const t = cS(e), n = jw(t, e), r = jw(t.reverse(), e); return [n, r]; }, $R = (e) => e instanceof HTMLInputElement && "select" in e, Vo = (e, t) => { if (e && e.focus) { const n = document.activeElement; e.focus({ preventScroll: !0 }), L1.value = window.performance.now(), e !== n && $R(e) && t && e.select(); } }; function Pw(e, t) { const n = [...e], r = e.indexOf(t); return r !== -1 && n.splice(r, 1), n; } const KR = () => { let e = []; return { push: (t) => { const n = e[0]; n && t !== n && n.pause(), e = Pw(e, t), e.unshift(t); }, remove: (t) => { var n, r; e = Pw(e, t), (r = (n = e[0]) == null ? void 0 : n.resume) == null || r.call(n); } }; }, JR = (e, t = !1) => { const n = document.activeElement; for (const r of e) if (Vo(r, t), document.activeElement !== n) return; }, Rw = KR(), QR = () => e0.value > L1.value, Cf = () => { C1.value = "pointer", e0.value = window.performance.now(); }, Nw = () => { C1.value = "keyboard", e0.value = window.performance.now(); }, XR = () => (Yr(() => { Sf === 0 && (document.addEventListener("mousedown", Cf), document.addEventListener("touchstart", Cf), document.addEventListener("keydown", Nw)), Sf++; }), vi(() => { Sf--, Sf <= 0 && (document.removeEventListener("mousedown", Cf), document.removeEventListener("touchstart", Cf), document.removeEventListener("keydown", Nw)); }), { focusReason: C1, lastUserFocusTimestamp: e0, lastAutomatedFocusTimestamp: L1 }), Lf = (e) => new CustomEvent(UR, { ...GR, detail: e }), eN = en({ name: "ElFocusTrap", inheritAttrs: !1, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ zw, Ew, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(e, { emit: t }) { const n = It(); let r, a; const { focusReason: i } = XR(); GP((p) => { e.trapped && !o.paused && t("release-requested", p); }); const o = { paused: !1, pause() { this.paused = !0; }, resume() { this.paused = !1; } }, l = (p) => { if (!e.loop && !e.trapped || o.paused) return; const { key: v, altKey: y, ctrlKey: m, metaKey: b, currentTarget: w, shiftKey: _ } = p, { loop: k } = e, T = v === dd.tab && !y && !m && !b, O = document.activeElement; if (T && O) { const M = w, [C, I] = YR(M); if (C && I) { if (!_ && O === I) { const j = Lf({ focusReason: i.value }); t("focusout-prevented", j), j.defaultPrevented || (p.preventDefault(), k && Vo(C, !0)); } else if (_ && [C, M].includes(O)) { const j = Lf({ focusReason: i.value }); t("focusout-prevented", j), j.defaultPrevented || (p.preventDefault(), k && Vo(I, !0)); } } else if (O === M) { const j = Lf({ focusReason: i.value }); t("focusout-prevented", j), j.defaultPrevented || p.preventDefault(); } } }; wa(WR, { focusTrapRef: n, onKeydown: l }), wn(() => e.focusTrapEl, (p) => { p && (n.value = p); }, { immediate: !0 }), wn([n], ([p], [v]) => { p && (p.addEventListener("keydown", l), p.addEventListener("focusin", u), p.addEventListener("focusout", f)), v && (v.removeEventListener("keydown", l), v.removeEventListener("focusin", u), v.removeEventListener("focusout", f)); }); const s = (p) => { t(zw, p); }, c = (p) => t(Ew, p), u = (p) => { const v = Ee(n); if (!v) return; const y = p.target, m = p.relatedTarget, b = y && v.contains(y); e.trapped || m && v.contains(m) || (r = m), b && t("focusin", p), !o.paused && e.trapped && (b ? a = y : Vo(a, !0)); }, f = (p) => { const v = Ee(n); if (!(o.paused || !v)) if (e.trapped) { const y = p.relatedTarget; !f1(y) && !v.contains(y) && setTimeout(() => { if (!o.paused && e.trapped) { const m = Lf({ focusReason: i.value }); t("focusout-prevented", m), m.defaultPrevented || Vo(a, !0); } }, 0); } else { const y = p.target; y && v.contains(y) || t("focusout", p); } }; async function h() { await Va(); const p = Ee(n); if (p) { Rw.push(o); const v = p.contains(document.activeElement) ? r : document.activeElement; if (r = v, !p.contains(v)) { const y = new Event(zg, Iw); p.addEventListener(zg, s), p.dispatchEvent(y), y.defaultPrevented || Va(() => { let m = e.focusStartEl; Vc(m) || (Vo(m), document.activeElement !== m && (m = "first")), m === "first" && JR(cS(p), !0), (document.activeElement === v || m === "container") && Vo(p); }); } } } function g() { const p = Ee(n); if (p) { p.removeEventListener(zg, s); const v = new CustomEvent(Eg, { ...Iw, detail: { focusReason: i.value } }); p.addEventListener(Eg, c), p.dispatchEvent(v), !v.defaultPrevented && (i.value == "keyboard" || !QR() || p.contains(document.activeElement)) && Vo(r ?? document.body), p.removeEventListener(Eg, c), Rw.remove(o); } } return Yr(() => { e.trapped && h(), wn(() => e.trapped, (p) => { p ? h() : g(); }); }), vi(() => { e.trapped && g(), n.value && (n.value.removeEventListener("keydown", l), n.value.removeEventListener("focusin", u), n.value.removeEventListener("focusout", f), n.value = void 0); }), { onKeydown: l }; } }); function tN(e, t, n, r, a, i) { return un(e.$slots, "default", { handleKeydown: e.onKeydown }); } var nN = /* @__PURE__ */ qn(eN, [["render", tN], ["__file", "focus-trap.vue"]]); const rN = ["fixed", "absolute"], aN = Zn({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: hn(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: !0 }, offset: { type: Number, default: 12 }, placement: { type: String, values: Kp, default: "bottom" }, popperOptions: { type: hn(Object), default: () => ({}) }, strategy: { type: String, values: rN, default: "absolute" } }), uS = Zn({ ...aN, id: String, style: { type: hn([String, Array, Object]) }, className: { type: hn([String, Array, Object]) }, effect: { type: hn(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: !0 }, pure: Boolean, focusOnShow: { type: Boolean, default: !1 }, trapping: { type: Boolean, default: !1 }, popperClass: { type: hn([String, Array, Object]) }, popperStyle: { type: hn([String, Array, Object]) }, referenceEl: { type: hn(Object) }, triggerTargetEl: { type: hn(Object) }, stopPopperMouseEvent: { type: Boolean, default: !0 }, virtualTriggering: Boolean, zIndex: Number, ...Xp(["ariaLabel"]) }), iN = { mouseenter: (e) => e instanceof MouseEvent, mouseleave: (e) => e instanceof MouseEvent, focus: () => !0, blur: () => !0, close: () => !0 }, oN = (e, t = []) => { const { placement: n, strategy: r, popperOptions: a } = e, i = { placement: n, strategy: r, ...a, modifiers: [...sN(e), ...t] }; return cN(i, a == null ? void 0 : a.modifiers), i; }, lN = (e) => { if (Wr) return vo(e); }; function sN(e) { const { offset: t, gpuAcceleration: n, fallbackPlacements: r } = e; return [ { name: "offset", options: { offset: [0, t ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: r } }, { name: "computeStyles", options: { gpuAcceleration: n } } ]; } function cN(e, t) { t && (e.modifiers = [...e.modifiers, ...t ?? []]); } const uN = 0, dN = (e) => { const { popperInstanceRef: t, contentRef: n, triggerRef: r, role: a } = zn(S1, void 0), i = It(), o = It(), l = at(() => ({ name: "eventListeners", enabled: !!e.visible })), s = at(() => { var m; const b = Ee(i), w = (m = Ee(o)) != null ? m : uN; return { name: "arrow", enabled: !aj(b), options: { element: b, padding: w } }; }), c = at(() => ({ onFirstUpdate: () => { p(); }, ...oN(e, [ Ee(s), Ee(l) ]) })), u = at(() => lN(e.referenceEl) || Ee(r)), { attributes: f, state: h, styles: g, update: p, forceUpdate: v, instanceRef: y } = VP(u, n, c); return wn(y, (m) => t.value = m), Yr(() => { wn(() => { var m; return (m = Ee(u)) == null ? void 0 : m.getBoundingClientRect(); }, () => { p(); }); }), { attributes: f, arrowRef: i, contentRef: n, instanceRef: y, state: h, styles: g, role: a, forceUpdate: v, update: p }; }, fN = (e, { attributes: t, styles: n, role: r }) => { const { nextZIndex: a } = eR(), i = or("popper"), o = at(() => Ee(t).popper), l = It(Ua(e.zIndex) ? e.zIndex : a()), s = at(() => [ i.b(), i.is("pure", e.pure), i.is(e.effect), e.popperClass ]), c = at(() => [ { zIndex: Ee(l) }, Ee(n).popper, e.popperStyle || {} ]), u = at(() => r.value === "dialog" ? "false" : void 0), f = at(() => Ee(n).arrow || {}); return { ariaModal: u, arrowStyle: f, contentAttrs: o, contentClass: s, contentStyle: c, contentZIndex: l, updateZIndex: () => { l.value = Ua(e.zIndex) ? e.zIndex : a(); } }; }, hN = (e, t) => { const n = It(!1), r = It(); return { focusStartRef: r, trapped: n, onFocusAfterReleased: (a) => { var i; ((i = a.detail) == null ? void 0 : i.focusReason) !== "pointer" && (r.value = "first", t("blur")); }, onFocusAfterTrapped: () => { t("focus"); }, onFocusInTrap: (a) => { e.visible && !n.value && (a.target && (r.value = a.target), n.value = !0); }, onFocusoutPrevented: (a) => { e.trapping || (a.detail.focusReason === "pointer" && a.preventDefault(), n.value = !1); }, onReleaseRequested: () => { n.value = !1, t("close"); } }; }, pN = en({ name: "ElPopperContent" }), gN = /* @__PURE__ */ en({ ...pN, props: uS, emits: iN, setup(e, { expose: t, emit: n }) { const r = e, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: l, onFocusInTrap: s, onFocusoutPrevented: c, onReleaseRequested: u } = hN(r, n), { attributes: f, arrowRef: h, contentRef: g, styles: p, instanceRef: v, role: y, update: m } = dN(r), { ariaModal: b, arrowStyle: w, contentAttrs: _, contentClass: k, contentStyle: T, updateZIndex: O } = fN(r, { styles: p, attributes: f, role: y }), M = zn(np, void 0), C = It(); wa(aS, { arrowStyle: w, arrowRef: h, arrowOffset: C }), M && wa(np, { ...M, addInputId: Jh, removeInputId: Jh }); let I; const j = (N = !0) => { m(), N && O(); }, P = () => { j(!1), r.visible && r.focusOnShow ? i.value = !0 : r.visible === !1 && (i.value = !1); }; return Yr(() => { wn(() => r.triggerTargetEl, (N, W) => { I == null || I(), I = void 0; const J = Ee(N || g.value), U = Ee(W || g.value); Gl(J) && (I = wn([y, () => r.ariaLabel, b, () => r.id], (E) => { ["role", "aria-label", "aria-modal", "id"].forEach((z, F) => { f1(E[F]) ? J.removeAttribute(z) : J.setAttribute(z, E[F]); }); }, { immediate: !0 })), U !== J && Gl(U) && ["role", "aria-label", "aria-modal", "id"].forEach((E) => { U.removeAttribute(E); }); }, { immediate: !0 }), wn(() => r.visible, P, { immediate: !0 }); }), vi(() => { I == null || I(), I = void 0; }), t({ popperContentRef: g, popperInstanceRef: v, updatePopper: j, contentStyle: T }), (N, W) => (Tt(), Kt("div", cs({ ref_key: "contentRef", ref: g }, Ee(_), { style: Ee(T), class: Ee(k), tabindex: "-1", onMouseenter: (J) => N.$emit("mouseenter", J), onMouseleave: (J) => N.$emit("mouseleave", J) }), [ Mn(Ee(nN), { trapped: Ee(i), "trap-on-focus-in": !0, "focus-trap-el": Ee(g), "focus-start-el": Ee(a), onFocusAfterTrapped: Ee(l), onFocusAfterReleased: Ee(o), onFocusin: Ee(s), onFocusoutPrevented: Ee(c), onReleaseRequested: Ee(u) }, { default: on(() => [ un(N.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var vN = /* @__PURE__ */ qn(gN, [["__file", "content.vue"]]); const mN = mi(jR), O1 = Symbol("elTooltip"), va = Zn({ ...YP, ...uS, appendTo: { type: hn([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: hn(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: !0 }, disabled: Boolean, ...Xp(["ariaLabel"]) }), pd = Zn({ ...sS, disabled: Boolean, trigger: { type: hn([String, Array]), default: "hover" }, triggerKeys: { type: hn(Array), default: () => [dd.enter, dd.space] } }), { useModelToggleProps: yN, useModelToggleEmits: xN, useModelToggle: bN } = Nj("visible"), wN = Zn({ ...iS, ...yN, ...va, ...pd, ...oS, showArrow: { type: Boolean, default: !0 } }), _N = [ ...xN, "before-show", "before-hide", "show", "hide", "open", "close" ], kN = (e, t) => Ri(e) ? e.includes(t) : e === t, Ds = (e, t, n) => (r) => { kN(Ee(e), t) && n(r); }, TN = en({ name: "ElTooltipTrigger" }), AN = /* @__PURE__ */ en({ ...TN, props: pd, setup(e, { expose: t }) { const n = e, r = or("tooltip"), { controlled: a, id: i, open: o, onOpen: l, onClose: s, onToggle: c } = zn(O1, void 0), u = It(null), f = () => { if (Ee(a) || n.disabled) return !0; }, h = Pi(n, "trigger"), g = uo(f, Ds(h, "hover", l)), p = uo(f, Ds(h, "hover", s)), v = uo(f, Ds(h, "click", (_) => { _.button === 0 && c(_); })), y = uo(f, Ds(h, "focus", l)), m = uo(f, Ds(h, "focus", s)), b = uo(f, Ds(h, "contextmenu", (_) => { _.preventDefault(), c(_); })), w = uo(f, (_) => { const { code: k } = _; n.triggerKeys.includes(k) && (_.preventDefault(), c(_)); }); return t({ triggerRef: u }), (_, k) => (Tt(), An(Ee(qR), { id: Ee(i), "virtual-ref": _.virtualRef, open: Ee(o), "virtual-triggering": _.virtualTriggering, class: Gt(Ee(r).e("trigger")), onBlur: Ee(m), onClick: Ee(v), onContextmenu: Ee(b), onFocus: Ee(y), onMouseenter: Ee(g), onMouseleave: Ee(p), onKeydown: Ee(w) }, { default: on(() => [ un(_.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var MN = /* @__PURE__ */ qn(AN, [["__file", "trigger.vue"]]); const SN = Zn({ to: { type: hn([String, Object]), required: !0 }, disabled: Boolean }), CN = /* @__PURE__ */ en({ __name: "teleport", props: SN, setup(e) { return (t, n) => t.disabled ? un(t.$slots, "default", { key: 0 }) : (Tt(), An(U7, { key: 1, to: t.to }, [ un(t.$slots, "default") ], 8, ["to"])); } }); var LN = /* @__PURE__ */ qn(CN, [["__file", "teleport.vue"]]); const ON = mi(LN), DN = en({ name: "ElTooltipContent", inheritAttrs: !1 }), FN = /* @__PURE__ */ en({ ...DN, props: va, setup(e, { expose: t }) { const n = e, { selector: r } = X3(), a = or("tooltip"), i = It(null); let o; const { controlled: l, id: s, open: c, trigger: u, onClose: f, onOpen: h, onShow: g, onHide: p, onBeforeShow: v, onBeforeHide: y } = zn(O1, void 0), m = at(() => n.transition || `${a.namespace.value}-fade-in-linear`), b = at(() => us.env.NODE_ENV === "test" ? !0 : n.persistent); vi(() => { o == null || o(); }); const w = at(() => Ee(b) ? !0 : Ee(c)), _ = at(() => n.disabled ? !1 : Ee(c)), k = at(() => n.appendTo || r.value), T = at(() => { var U; return (U = n.style) != null ? U : {}; }), O = It(!0), M = () => { p(), O.value = !0; }, C = () => { if (Ee(l)) return !0; }, I = uo(C, () => { n.enterable && Ee(u) === "hover" && h(); }), j = uo(C, () => { Ee(u) === "hover" && f(); }), P = () => { var U, E; (E = (U = i.value) == null ? void 0 : U.updatePopper) == null || E.call(U), v == null || v(); }, N = () => { y == null || y(); }, W = () => { g(), o = tI(at(() => { var U; return (U = i.value) == null ? void 0 : U.popperContentRef; }), () => { Ee(l) || Ee(u) !== "hover" && f(); }); }, J = () => { n.virtualTriggering || f(); }; return wn(() => Ee(c), (U) => { U ? O.value = !1 : o == null || o(); }, { flush: "post" }), wn(() => n.content, () => { var U, E; (E = (U = i.value) == null ? void 0 : U.updatePopper) == null || E.call(U); }), t({ contentRef: i }), (U, E) => (Tt(), An(Ee(ON), { disabled: !U.teleported, to: Ee(k) }, { default: on(() => [ Mn(Np, { name: Ee(m), onAfterLeave: M, onBeforeEnter: P, onAfterEnter: W, onBeforeLeave: N }, { default: on(() => [ Ee(w) ? xo((Tt(), An(Ee(vN), cs({ key: 0, id: Ee(s), ref_key: "contentRef", ref: i }, U.$attrs, { "aria-label": U.ariaLabel, "aria-hidden": O.value, "boundaries-padding": U.boundariesPadding, "fallback-placements": U.fallbackPlacements, "gpu-acceleration": U.gpuAcceleration, offset: U.offset, placement: U.placement, "popper-options": U.popperOptions, strategy: U.strategy, effect: U.effect, enterable: U.enterable, pure: U.pure, "popper-class": U.popperClass, "popper-style": [U.popperStyle, Ee(T)], "reference-el": U.referenceEl, "trigger-target-el": U.triggerTargetEl, visible: Ee(_), "z-index": U.zIndex, onMouseenter: Ee(I), onMouseleave: Ee(j), onBlur: J, onClose: Ee(f) }), { default: on(() => [ un(U.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [Hc, Ee(_)] ]) : In("v-if", !0) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var IN = /* @__PURE__ */ qn(FN, [["__file", "content.vue"]]); const zN = en({ name: "ElTooltip" }), EN = /* @__PURE__ */ en({ ...zN, props: wN, emits: _N, setup(e, { expose: t, emit: n }) { const r = e; ZP(); const a = Qp(), i = It(), o = It(), l = () => { var m; const b = Ee(i); b && ((m = b.popperInstanceRef) == null || m.update()); }, s = It(!1), c = It(), { show: u, hide: f, hasUpdateHandler: h } = bN({ indicator: s, toggleReason: c }), { onOpen: g, onClose: p } = $P({ showAfter: Pi(r, "showAfter"), hideAfter: Pi(r, "hideAfter"), autoClose: Pi(r, "autoClose"), open: u, close: f }), v = at(() => h1(r.visible) && !h.value); wa(O1, { controlled: v, id: a, open: I7(s), trigger: Pi(r, "trigger"), onOpen: (m) => { g(m); }, onClose: (m) => { p(m); }, onToggle: (m) => { Ee(s) ? p(m) : g(m); }, onShow: () => { n("show", c.value); }, onHide: () => { n("hide", c.value); }, onBeforeShow: () => { n("before-show", c.value); }, onBeforeHide: () => { n("before-hide", c.value); }, updatePopper: l }), wn(() => r.disabled, (m) => { m && s.value && (s.value = !1); }); const y = (m) => { var b, w; const _ = (w = (b = o.value) == null ? void 0 : b.contentRef) == null ? void 0 : w.popperContentRef, k = (m == null ? void 0 : m.relatedTarget) || document.activeElement; return _ && _.contains(k); }; return z7(() => s.value && f()), t({ popperRef: i, contentRef: o, isFocusInsideContent: y, updatePopper: l, onOpen: g, onClose: p, hide: f }), (m, b) => (Tt(), An(Ee(mN), { ref_key: "popperRef", ref: i, role: m.role }, { default: on(() => [ Mn(MN, { disabled: m.disabled, trigger: m.trigger, "trigger-keys": m.triggerKeys, "virtual-ref": m.virtualRef, "virtual-triggering": m.virtualTriggering }, { default: on(() => [ m.$slots.default ? un(m.$slots, "default", { key: 0 }) : In("v-if", !0) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), Mn(IN, { ref_key: "contentRef", ref: o, "aria-label": m.ariaLabel, "boundaries-padding": m.boundariesPadding, content: m.content, disabled: m.disabled, effect: m.effect, enterable: m.enterable, "fallback-placements": m.fallbackPlacements, "hide-after": m.hideAfter, "gpu-acceleration": m.gpuAcceleration, offset: m.offset, persistent: m.persistent, "popper-class": m.popperClass, "popper-style": m.popperStyle, placement: m.placement, "popper-options": m.popperOptions, pure: m.pure, "raw-content": m.rawContent, "reference-el": m.referenceEl, "trigger-target-el": m.triggerTargetEl, "show-after": m.showAfter, strategy: m.strategy, teleported: m.teleported, transition: m.transition, "virtual-triggering": m.virtualTriggering, "z-index": m.zIndex, "append-to": m.appendTo }, { default: on(() => [ un(m.$slots, "content", {}, () => [ m.rawContent ? (Tt(), Kt("span", { key: 0, innerHTML: m.content }, null, 8, ["innerHTML"])) : (Tt(), Kt("span", { key: 1 }, ma(m.content), 1)) ]), m.showArrow ? (Tt(), An(Ee(NR), { key: 0, "arrow-offset": m.arrowOffset }, null, 8, ["arrow-offset"])) : In("v-if", !0) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var jN = /* @__PURE__ */ qn(EN, [["__file", "tooltip.vue"]]); const dS = mi(jN), fS = Symbol("buttonGroupContextKey"), PN = (e, t) => { Cj({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, at(() => e.type === "text")); const n = zn(fS, void 0), r = hR("button"), { form: a } = rS(), i = A1(at(() => n == null ? void 0 : n.size)), o = nS(), l = It(), s = R7(), c = at(() => e.type || (n == null ? void 0 : n.type) || ""), u = at(() => { var g, p, v; return (v = (p = e.autoInsertSpace) != null ? p : (g = r.value) == null ? void 0 : g.autoInsertSpace) != null ? v : !1; }), f = at(() => e.tag === "button" ? { ariaDisabled: o.value || e.loading, disabled: o.value || e.loading, autofocus: e.autofocus, type: e.nativeType } : {}), h = at(() => { var g; const p = (g = s.default) == null ? void 0 : g.call(s); if (u.value && (p == null ? void 0 : p.length) === 1) { const v = p[0]; if ((v == null ? void 0 : v.type) === f3) { const y = v.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return !1; }); return { _disabled: o, _size: i, _type: c, _ref: l, _props: f, shouldAddSpace: h, handleClick: (g) => { if (o.value || e.loading) { g.stopPropagation(); return; } e.nativeType === "reset" && (a == null || a.resetFields()), t("click", g); } }; }, RN = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ], NN = ["button", "submit", "reset"], Km = Zn({ size: tS, disabled: Boolean, type: { type: String, values: RN, default: "" }, icon: { type: _c }, nativeType: { type: String, values: NN, default: "button" }, loading: Boolean, loadingIcon: { type: _c, default: () => R3 }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: hn([String, Object]), default: "button" } }), BN = { click: (e) => e instanceof MouseEvent }; function Dr(e, t) { HN(e) && (e = "100%"); var n = VN(e); return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e); } function Of(e) { return Math.min(1, Math.max(0, e)); } function HN(e) { return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1; } function VN(e) { return typeof e == "string" && e.indexOf("%") !== -1; } function hS(e) { return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e; } function Df(e) { return e <= 1 ? "".concat(Number(e) * 100, "%") : e; } function Bl(e) { return e.length === 1 ? "0" + e : String(e); } function qN(e, t, n) { return { r: Dr(e, 255) * 255, g: Dr(t, 255) * 255, b: Dr(n, 255) * 255 }; } function Bw(e, t, n) { e = Dr(e, 255), t = Dr(t, 255), n = Dr(n, 255); var r = Math.max(e, t, n), a = Math.min(e, t, n), i = 0, o = 0, l = (r + a) / 2; if (r === a) o = 0, i = 0; else { var s = r - a; switch (o = l > 0.5 ? s / (2 - r - a) : s / (r + a), r) { case e: i = (t - n) / s + (t < n ? 6 : 0); break; case t: i = (n - e) / s + 2; break; case n: i = (e - t) / s + 4; break; } i /= 6; } return { h: i, s: o, l }; } function jg(e, t, n) { return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e; } function UN(e, t, n) { var r, a, i; if (e = Dr(e, 360), t = Dr(t, 100), n = Dr(n, 100), t === 0) a = n, i = n, r = n; else { var o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o; r = jg(l, o, e + 1 / 3), a = jg(l, o, e), i = jg(l, o, e - 1 / 3); } return { r: r * 255, g: a * 255, b: i * 255 }; } function Hw(e, t, n) { e = Dr(e, 255), t = Dr(t, 255), n = Dr(n, 255); var r = Math.max(e, t, n), a = Math.min(e, t, n), i = 0, o = r, l = r - a, s = r === 0 ? 0 : l / r; if (r === a) i = 0; else { switch (r) { case e: i = (t - n) / l + (t < n ? 6 : 0); break; case t: i = (n - e) / l + 2; break; case n: i = (e - t) / l + 4; break; } i /= 6; } return { h: i, s, v: o }; } function GN(e, t, n) { e = Dr(e, 360) * 6, t = Dr(t, 100), n = Dr(n, 100); var r = Math.floor(e), a = e - r, i = n * (1 - t), o = n * (1 - a * t), l = n * (1 - (1 - a) * t), s = r % 6, c = [n, o, i, i, l, n][s], u = [l, n, n, o, i, i][s], f = [i, i, l, n, n, o][s]; return { r: c * 255, g: u * 255, b: f * 255 }; } function Vw(e, t, n, r) { var a = [ Bl(Math.round(e).toString(16)), Bl(Math.round(t).toString(16)), Bl(Math.round(n).toString(16)) ]; return r && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join(""); } function WN(e, t, n, r, a) { var i = [ Bl(Math.round(e).toString(16)), Bl(Math.round(t).toString(16)), Bl(Math.round(n).toString(16)), Bl(ZN(r)) ]; return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join(""); } function ZN(e) { return Math.round(parseFloat(e) * 255).toString(16); } function qw(e) { return pa(e) / 255; } function pa(e) { return parseInt(e, 16); } function YN(e) { return { r: e >> 16, g: (e & 65280) >> 8, b: e & 255 }; } var Jm = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function $N(e) { var t = { r: 0, g: 0, b: 0 }, n = 1, r = null, a = null, i = null, o = !1, l = !1; return typeof e == "string" && (e = QN(e)), typeof e == "object" && (io(e.r) && io(e.g) && io(e.b) ? (t = qN(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : io(e.h) && io(e.s) && io(e.v) ? (r = Df(e.s), a = Df(e.v), t = GN(e.h, r, a), o = !0, l = "hsv") : io(e.h) && io(e.s) && io(e.l) && (r = Df(e.s), i = Df(e.l), t = UN(e.h, r, i), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = hS(n), { ok: o, format: e.format || l, r: Math.min(255, Math.max(t.r, 0)), g: Math.min(255, Math.max(t.g, 0)), b: Math.min(255, Math.max(t.b, 0)), a: n }; } var KN = "[-\\+]?\\d+%?", JN = "[-\\+]?\\d*\\.\\d+%?", tl = "(?:".concat(JN, ")|(?:").concat(KN, ")"), Pg = "[\\s|\\(]+(".concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")\\s*\\)?"), Rg = "[\\s|\\(]+(".concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")[,|\\s]+(").concat(tl, ")\\s*\\)?"), ai = { CSS_UNIT: new RegExp(tl), rgb: new RegExp("rgb" + Pg), rgba: new RegExp("rgba" + Rg), hsl: new RegExp("hsl" + Pg), hsla: new RegExp("hsla" + Rg), hsv: new RegExp("hsv" + Pg), hsva: new RegExp("hsva" + Rg), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function QN(e) { if (e = e.trim().toLowerCase(), e.length === 0) return !1; var t = !1; if (Jm[e]) e = Jm[e], t = !0; else if (e === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var n = ai.rgb.exec(e); return n ? { r: n[1], g: n[2], b: n[3] } : (n = ai.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = ai.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = ai.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = ai.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = ai.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = ai.hex8.exec(e), n ? { r: pa(n[1]), g: pa(n[2]), b: pa(n[3]), a: qw(n[4]), format: t ? "name" : "hex8" } : (n = ai.hex6.exec(e), n ? { r: pa(n[1]), g: pa(n[2]), b: pa(n[3]), format: t ? "name" : "hex" } : (n = ai.hex4.exec(e), n ? { r: pa(n[1] + n[1]), g: pa(n[2] + n[2]), b: pa(n[3] + n[3]), a: qw(n[4] + n[4]), format: t ? "name" : "hex8" } : (n = ai.hex3.exec(e), n ? { r: pa(n[1] + n[1]), g: pa(n[2] + n[2]), b: pa(n[3] + n[3]), format: t ? "name" : "hex" } : !1))))))))); } function io(e) { return !!ai.CSS_UNIT.exec(String(e)); } var XN = ( /** @class */ function() { function e(t, n) { t === void 0 && (t = ""), n === void 0 && (n = {}); var r; if (t instanceof e) return t; typeof t == "number" && (t = YN(t)), this.originalInput = t; var a = $N(t); this.originalInput = t, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = n.format) !== null && r !== void 0 ? r : a.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok; } return e.prototype.isDark = function() { return this.getBrightness() < 128; }, e.prototype.isLight = function() { return !this.isDark(); }, e.prototype.getBrightness = function() { var t = this.toRgb(); return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3; }, e.prototype.getLuminance = function() { var t = this.toRgb(), n, r, a, i = t.r / 255, o = t.g / 255, l = t.b / 255; return i <= 0.03928 ? n = i / 12.92 : n = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? r = o / 12.92 : r = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? a = l / 12.92 : a = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * r + 0.0722 * a; }, e.prototype.getAlpha = function() { return this.a; }, e.prototype.setAlpha = function(t) { return this.a = hS(t), this.roundA = Math.round(100 * this.a) / 100, this; }, e.prototype.isMonochrome = function() { var t = this.toHsl().s; return t === 0; }, e.prototype.toHsv = function() { var t = Hw(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, v: t.v, a: this.a }; }, e.prototype.toHsvString = function() { var t = Hw(this.r, this.g, this.b), n = Math.round(t.h * 360), r = Math.round(t.s * 100), a = Math.round(t.v * 100); return this.a === 1 ? "hsv(".concat(n, ", ").concat(r, "%, ").concat(a, "%)") : "hsva(".concat(n, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, e.prototype.toHsl = function() { var t = Bw(this.r, this.g, this.b); return { h: t.h * 360, s: t.s, l: t.l, a: this.a }; }, e.prototype.toHslString = function() { var t = Bw(this.r, this.g, this.b), n = Math.round(t.h * 360), r = Math.round(t.s * 100), a = Math.round(t.l * 100); return this.a === 1 ? "hsl(".concat(n, ", ").concat(r, "%, ").concat(a, "%)") : "hsla(".concat(n, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, e.prototype.toHex = function(t) { return t === void 0 && (t = !1), Vw(this.r, this.g, this.b, t); }, e.prototype.toHexString = function(t) { return t === void 0 && (t = !1), "#" + this.toHex(t); }, e.prototype.toHex8 = function(t) { return t === void 0 && (t = !1), WN(this.r, this.g, this.b, this.a, t); }, e.prototype.toHex8String = function(t) { return t === void 0 && (t = !1), "#" + this.toHex8(t); }, e.prototype.toHexShortString = function(t) { return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t); }, e.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, e.prototype.toRgbString = function() { var t = Math.round(this.r), n = Math.round(this.g), r = Math.round(this.b); return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(r, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(r, ", ").concat(this.roundA, ")"); }, e.prototype.toPercentageRgb = function() { var t = function(n) { return "".concat(Math.round(Dr(n, 255) * 100), "%"); }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a }; }, e.prototype.toPercentageRgbString = function() { var t = function(n) { return Math.round(Dr(n, 255) * 100); }; return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")"); }, e.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var t = "#" + Vw(this.r, this.g, this.b, !1), n = 0, r = Object.entries(Jm); n < r.length; n++) { var a = r[n], i = a[0], o = a[1]; if (t === o) return i; } return !1; }, e.prototype.toString = function(t) { var n = !!t; t = t ?? this.format; var r = !1, a = this.a < 1 && this.a >= 0, i = !n && a && (t.startsWith("hex") || t === "name"); return i ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (r = this.toRgbString()), t === "prgb" && (r = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (r = this.toHexString()), t === "hex3" && (r = this.toHexString(!0)), t === "hex4" && (r = this.toHex8String(!0)), t === "hex8" && (r = this.toHex8String()), t === "name" && (r = this.toName()), t === "hsl" && (r = this.toHslString()), t === "hsv" && (r = this.toHsvString()), r || this.toHexString()); }, e.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, e.prototype.clone = function() { return new e(this.toString()); }, e.prototype.lighten = function(t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.l += t / 100, n.l = Of(n.l), new e(n); }, e.prototype.brighten = function(t) { t === void 0 && (t = 10); var n = this.toRgb(); return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), new e(n); }, e.prototype.darken = function(t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.l -= t / 100, n.l = Of(n.l), new e(n); }, e.prototype.tint = function(t) { return t === void 0 && (t = 10), this.mix("white", t); }, e.prototype.shade = function(t) { return t === void 0 && (t = 10), this.mix("black", t); }, e.prototype.desaturate = function(t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.s -= t / 100, n.s = Of(n.s), new e(n); }, e.prototype.saturate = function(t) { t === void 0 && (t = 10); var n = this.toHsl(); return n.s += t / 100, n.s = Of(n.s), new e(n); }, e.prototype.greyscale = function() { return this.desaturate(100); }, e.prototype.spin = function(t) { var n = this.toHsl(), r = (n.h + t) % 360; return n.h = r < 0 ? 360 + r : r, new e(n); }, e.prototype.mix = function(t, n) { n === void 0 && (n = 50); var r = this.toRgb(), a = new e(t).toRgb(), i = n / 100, o = { r: (a.r - r.r) * i + r.r, g: (a.g - r.g) * i + r.g, b: (a.b - r.b) * i + r.b, a: (a.a - r.a) * i + r.a }; return new e(o); }, e.prototype.analogous = function(t, n) { t === void 0 && (t = 6), n === void 0 && (n = 30); var r = this.toHsl(), a = 360 / n, i = [this]; for (r.h = (r.h - (a * t >> 1) + 720) % 360; --t; ) r.h = (r.h + a) % 360, i.push(new e(r)); return i; }, e.prototype.complement = function() { var t = this.toHsl(); return t.h = (t.h + 180) % 360, new e(t); }, e.prototype.monochromatic = function(t) { t === void 0 && (t = 6); for (var n = this.toHsv(), r = n.h, a = n.s, i = n.v, o = [], l = 1 / t; t--; ) o.push(new e({ h: r, s: a, v: i })), i = (i + l) % 1; return o; }, e.prototype.splitcomplement = function() { var t = this.toHsl(), n = t.h; return [ this, new e({ h: (n + 72) % 360, s: t.s, l: t.l }), new e({ h: (n + 216) % 360, s: t.s, l: t.l }) ]; }, e.prototype.onBackground = function(t) { var n = this.toRgb(), r = new e(t).toRgb(), a = n.a + r.a * (1 - n.a); return new e({ r: (n.r * n.a + r.r * r.a * (1 - n.a)) / a, g: (n.g * n.a + r.g * r.a * (1 - n.a)) / a, b: (n.b * n.a + r.b * r.a * (1 - n.a)) / a, a }); }, e.prototype.triad = function() { return this.polyad(3); }, e.prototype.tetrad = function() { return this.polyad(4); }, e.prototype.polyad = function(t) { for (var n = this.toHsl(), r = n.h, a = [this], i = 360 / t, o = 1; o < t; o++) a.push(new e({ h: (r + o * i) % 360, s: n.s, l: n.l })); return a; }, e.prototype.equals = function(t) { return this.toRgbString() === new e(t).toRgbString(); }, e; }() ); function Eo(e, t = 20) { return e.mix("#141414", t).toString(); } function eB(e) { const t = nS(), n = or("button"); return at(() => { let r = {}, a = e.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new XN(a), l = e.dark ? o.tint(20).toString() : Eo(o, 20); if (e.plain) r = n.cssVarBlock({ "bg-color": e.dark ? Eo(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": e.dark ? Eo(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${n.cssVarName("color-white")})`, "hover-bg-color": a, "hover-border-color": a, "active-bg-color": l, "active-text-color": `var(${n.cssVarName("color-white")})`, "active-border-color": l }), t.value && (r[n.cssVarBlockName("disabled-bg-color")] = e.dark ? Eo(o, 90) : o.tint(90).toString(), r[n.cssVarBlockName("disabled-text-color")] = e.dark ? Eo(o, 50) : o.tint(50).toString(), r[n.cssVarBlockName("disabled-border-color")] = e.dark ? Eo(o, 80) : o.tint(80).toString()); else { const s = e.dark ? Eo(o, 30) : o.tint(30).toString(), c = o.isDark() ? `var(${n.cssVarName("color-white")})` : `var(${n.cssVarName("color-black")})`; if (r = n.cssVarBlock({ "bg-color": a, "text-color": c, "border-color": a, "hover-bg-color": s, "hover-text-color": c, "hover-border-color": s, "active-bg-color": l, "active-border-color": l }), t.value) { const u = e.dark ? Eo(o, 50) : o.tint(50).toString(); r[n.cssVarBlockName("disabled-bg-color")] = u, r[n.cssVarBlockName("disabled-text-color")] = e.dark ? "rgba(255, 255, 255, 0.5)" : `var(${n.cssVarName("color-white")})`, r[n.cssVarBlockName("disabled-border-color")] = u; } } } return r; }); } const tB = en({ name: "ElButton" }), nB = /* @__PURE__ */ en({ ...tB, props: Km, emits: BN, setup(e, { expose: t, emit: n }) { const r = e, a = eB(r), i = or("button"), { _ref: o, _size: l, _type: s, _disabled: c, _props: u, shouldAddSpace: f, handleClick: h } = PN(r, n), g = at(() => [ i.b(), i.m(s.value), i.m(l.value), i.is("disabled", c.value), i.is("loading", r.loading), i.is("plain", r.plain), i.is("round", r.round), i.is("circle", r.circle), i.is("text", r.text), i.is("link", r.link), i.is("has-bg", r.bg) ]); return t({ ref: o, size: l, type: s, disabled: c, shouldAddSpace: f }), (p, v) => (Tt(), An(yo(p.tag), cs({ ref_key: "_ref", ref: o }, Ee(u), { class: Ee(g), style: Ee(a), onClick: Ee(h) }), { default: on(() => [ p.loading ? (Tt(), Kt(_o, { key: 0 }, [ p.$slots.loading ? un(p.$slots, "loading", { key: 0 }) : (Tt(), An(Ee(Cc), { key: 1, class: Gt(Ee(i).is("loading")) }, { default: on(() => [ (Tt(), An(yo(p.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : p.icon || p.$slots.icon ? (Tt(), An(Ee(Cc), { key: 1 }, { default: on(() => [ p.icon ? (Tt(), An(yo(p.icon), { key: 0 })) : un(p.$slots, "icon", { key: 1 }) ]), _: 3 })) : In("v-if", !0), p.$slots.default ? (Tt(), Kt("span", { key: 2, class: Gt({ [Ee(i).em("text", "expand")]: Ee(f) }) }, [ un(p.$slots, "default") ], 2)) : In("v-if", !0) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var rB = /* @__PURE__ */ qn(nB, [["__file", "button.vue"]]); const aB = { size: Km.size, type: Km.type }, iB = en({ name: "ElButtonGroup" }), oB = /* @__PURE__ */ en({ ...iB, props: aB, setup(e) { const t = e; wa(fS, es({ size: Pi(t, "size"), type: Pi(t, "type") })); const n = or("button"); return (r, a) => (Tt(), Kt("div", { class: Gt(Ee(n).b("group")) }, [ un(r.$slots, "default") ], 2)); } }); var pS = /* @__PURE__ */ qn(oB, [["__file", "button-group.vue"]]); const qd = mi(rB, { ButtonGroup: pS }); Yp(pS); var gd = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Ud(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function t0(e) { if (e.__esModule) return e; var t = e.default; if (typeof t == "function") { var n = function r() { return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments); }; n.prototype = t.prototype; } else n = {}; return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) { var a = Object.getOwnPropertyDescriptor(e, r); Object.defineProperty(n, r, a.get ? a : { enumerable: !0, get: function() { return e[r]; } }); }), n; } const qo = /* @__PURE__ */ new Map(); if (Wr) { let e; document.addEventListener("mousedown", (t) => e = t), document.addEventListener("mouseup", (t) => { if (e) { for (const n of qo.values()) for (const { documentHandler: r } of n) r(t, e); e = void 0; } }); } function Uw(e, t) { let n = []; return Array.isArray(t.arg) ? n = t.arg : Gl(t.arg) && n.push(t.arg), function(r, a) { const i = t.instance.popperRef, o = r.target, l = a == null ? void 0 : a.target, s = !t || !t.instance, c = !o || !l, u = e.contains(o) || e.contains(l), f = e === o, h = n.length && n.some((p) => p == null ? void 0 : p.contains(o)) || n.length && n.includes(l), g = i && (i.contains(o) || i.contains(l)); s || c || u || f || h || g || t.value(r, a); }; } const lB = { beforeMount(e, t) { qo.has(e) || qo.set(e, []), qo.get(e).push({ documentHandler: Uw(e, t), bindingFn: t.value }); }, updated(e, t) { qo.has(e) || qo.set(e, []); const n = qo.get(e), r = n.findIndex((i) => i.bindingFn === t.oldValue), a = { documentHandler: Uw(e, t), bindingFn: t.value }; r >= 0 ? n.splice(r, 1, a) : n.push(a); }, unmounted(e) { qo.delete(e); } }, Qm = Zn({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: B3 }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }), sB = { close: (e) => e instanceof MouseEvent, click: (e) => e instanceof MouseEvent }, cB = en({ name: "ElTag" }), uB = /* @__PURE__ */ en({ ...cB, props: Qm, emits: sB, setup(e, { emit: t }) { const n = e, r = A1(), a = or("tag"), i = at(() => { const { type: c, hit: u, effect: f, closable: h, round: g } = n; return [ a.b(), a.is("closable", h), a.m(c || "primary"), a.m(r.value), a.m(f), a.is("hit", u), a.is("round", g) ]; }), o = (c) => { t("close", c); }, l = (c) => { t("click", c); }, s = (c) => { c.component.subTree.component.bum = null; }; return (c, u) => c.disableTransitions ? (Tt(), Kt("span", { key: 0, class: Gt(Ee(i)), style: Bi({ backgroundColor: c.color }), onClick: l }, [ fn("span", { class: Gt(Ee(a).e("content")) }, [ un(c.$slots, "default") ], 2), c.closable ? (Tt(), An(Ee(Cc), { key: 0, class: Gt(Ee(a).e("close")), onClick: ga(o, ["stop"]) }, { default: on(() => [ Mn(Ee(pw)) ]), _: 1 }, 8, ["class", "onClick"])) : In("v-if", !0) ], 6)) : (Tt(), An(Np, { key: 1, name: `${Ee(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: s }, { default: on(() => [ fn("span", { class: Gt(Ee(i)), style: Bi({ backgroundColor: c.color }), onClick: l }, [ fn("span", { class: Gt(Ee(a).e("content")) }, [ un(c.$slots, "default") ], 2), c.closable ? (Tt(), An(Ee(Cc), { key: 0, class: Gt(Ee(a).e("close")), onClick: ga(o, ["stop"]) }, { default: on(() => [ Mn(Ee(pw)) ]), _: 1 }, 8, ["class", "onClick"])) : In("v-if", !0) ], 6) ]), _: 3 }, 8, ["name"])); } }); var dB = /* @__PURE__ */ qn(uB, [["__file", "tag.vue"]]); const fB = mi(dB), Gw = (e) => Ua(e) || Vc(e) || Ri(e), hB = Zn({ accordion: Boolean, modelValue: { type: hn([Array, String, Number]), default: () => Sj([]) } }), pB = { [Jo]: Gw, [$p]: Gw }, gS = Symbol("collapseContextKey"), gB = (e, t) => { const n = It(ji(e.modelValue)), r = (i) => { n.value = i; const o = e.accordion ? n.value[0] : n.value; t(Jo, o), t($p, o); }, a = (i) => { if (e.accordion) r([n.value[0] === i ? "" : i]); else { const o = [...n.value], l = o.indexOf(i); l > -1 ? o.splice(l, 1) : o.push(i), r(o); } }; return wn(() => e.modelValue, () => n.value = ji(e.modelValue), { deep: !0 }), wa(gS, { activeNames: n, handleItemClick: a }), { activeNames: n, setActiveNames: r }; }, vB = () => { const e = or("collapse"); return { rootKls: at(() => e.b()) }; }, mB = en({ name: "ElCollapse" }), yB = /* @__PURE__ */ en({ ...mB, props: hB, emits: pB, setup(e, { expose: t, emit: n }) { const r = e, { activeNames: a, setActiveNames: i } = gB(r, n), { rootKls: o } = vB(); return t({ activeNames: a, setActiveNames: i }), (l, s) => (Tt(), Kt("div", { class: Gt(Ee(o)) }, [ un(l.$slots, "default") ], 2)); } }); var xB = /* @__PURE__ */ qn(yB, [["__file", "collapse.vue"]]); const bB = en({ name: "ElCollapseTransition" }), wB = /* @__PURE__ */ en({ ...bB, setup(e) { const t = or("collapse-transition"), n = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, r = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { n(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { n(a); }, leaveCancelled(a) { n(a); } }; return (a, i) => (Tt(), An(Np, cs({ name: Ee(t).b() }, E7(r)), { default: on(() => [ un(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var _B = /* @__PURE__ */ qn(wB, [["__file", "collapse-transition.vue"]]); const kB = mi(_B), TB = Zn({ title: { type: String, default: "" }, name: { type: hn([String, Number]), default: void 0 }, icon: { type: _c, default: mj }, disabled: Boolean }), AB = (e) => { const t = zn(gS), { namespace: n } = or("collapse"), r = It(!1), a = It(!1), i = k1(), o = at(() => i.current++), l = at(() => { var c; return (c = e.name) != null ? c : `${n.value}-id-${i.prefix}-${Ee(o)}`; }), s = at(() => t == null ? void 0 : t.activeNames.value.includes(Ee(l))); return { focusing: r, id: o, isActive: s, handleFocus: () => { setTimeout(() => { a.value ? a.value = !1 : r.value = !0; }, 50); }, handleHeaderClick: () => { e.disabled || (t == null || t.handleItemClick(Ee(l)), r.value = !1, a.value = !0); }, handleEnterClick: () => { t == null || t.handleItemClick(Ee(l)); } }; }, MB = (e, { focusing: t, isActive: n, id: r }) => { const a = or("collapse"), i = at(() => [ a.b("item"), a.is("active", Ee(n)), a.is("disabled", e.disabled) ]), o = at(() => [ a.be("item", "header"), a.is("active", Ee(n)), { focusing: Ee(t) && !e.disabled } ]), l = at(() => [ a.be("item", "arrow"), a.is("active", Ee(n)) ]), s = at(() => a.be("item", "wrap")), c = at(() => a.be("item", "content")), u = at(() => a.b(`content-${Ee(r)}`)), f = at(() => a.b(`head-${Ee(r)}`)); return { arrowKls: l, headKls: o, rootKls: i, itemWrapperKls: s, itemContentKls: c, scopedContentId: u, scopedHeadId: f }; }, SB = en({ name: "ElCollapseItem" }), CB = /* @__PURE__ */ en({ ...SB, props: TB, setup(e, { expose: t }) { const n = e, { focusing: r, id: a, isActive: i, handleFocus: o, handleHeaderClick: l, handleEnterClick: s } = AB(n), { arrowKls: c, headKls: u, rootKls: f, itemWrapperKls: h, itemContentKls: g, scopedContentId: p, scopedHeadId: v } = MB(n, { focusing: r, isActive: i, id: a }); return t({ isActive: i }), (y, m) => (Tt(), Kt("div", { class: Gt(Ee(f)) }, [ fn("button", { id: Ee(v), class: Gt(Ee(u)), "aria-expanded": Ee(i), "aria-controls": Ee(p), "aria-describedby": Ee(p), tabindex: y.disabled ? -1 : 0, type: "button", onClick: Ee(l), onKeydown: Xs(ga(Ee(s), ["stop", "prevent"]), ["space", "enter"]), onFocus: Ee(o), onBlur: (b) => r.value = !1 }, [ un(y.$slots, "title", {}, () => [ ts(ma(y.title), 1) ]), un(y.$slots, "icon", { isActive: Ee(i) }, () => [ Mn(Ee(Cc), { class: Gt(Ee(c)) }, { default: on(() => [ (Tt(), An(yo(y.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), Mn(Ee(kB), null, { default: on(() => [ xo(fn("div", { id: Ee(p), role: "region", class: Gt(Ee(h)), "aria-hidden": !Ee(i), "aria-labelledby": Ee(v) }, [ fn("div", { class: Gt(Ee(g)) }, [ un(y.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [Hc, Ee(i)] ]) ]), _: 3 }) ], 2)); } }); var vS = /* @__PURE__ */ qn(CB, [["__file", "collapse-item.vue"]]); const mS = mi(xB, { CollapseItem: vS }), yS = Yp(vS), LB = /* @__PURE__ */ en({ inheritAttrs: !1 }); function OB(e, t, n, r, a, i) { return un(e.$slots, "default"); } var DB = /* @__PURE__ */ qn(LB, [["render", OB], ["__file", "collection.vue"]]); const FB = /* @__PURE__ */ en({ name: "ElCollectionItem", inheritAttrs: !1 }); function IB(e, t, n, r, a, i) { return un(e.$slots, "default"); } var zB = /* @__PURE__ */ qn(FB, [["render", IB], ["__file", "collection-item.vue"]]); const EB = "data-el-collection-item", jB = (e) => { const t = `El${e}Collection`, n = `${t}Item`, r = Symbol(t), a = Symbol(n), i = { ...DB, name: t, setup() { const l = It(null), s = /* @__PURE__ */ new Map(); wa(r, { itemMap: s, getItems: () => { const c = Ee(l); if (!c) return []; const u = Array.from(c.querySelectorAll(`[${EB}]`)); return [...s.values()].sort((f, h) => u.indexOf(f.ref) - u.indexOf(h.ref)); }, collectionRef: l }); } }, o = { ...zB, name: n, setup(l, { attrs: s }) { const c = It(null), u = zn(r, void 0); wa(a, { collectionItemRef: c }), Yr(() => { const f = Ee(c); f && u.itemMap.set(f, { ref: f, ...s }); }), vi(() => { const f = Ee(c); u.itemMap.delete(f); }); } }; return { COLLECTION_INJECTION_KEY: r, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }, Ng = Zn({ trigger: pd.trigger, effect: { ...va.effect, default: "light" }, type: { type: hn(String) }, placement: { type: hn(String), default: "bottom" }, popperOptions: { type: hn(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: !0 }, loop: { type: Boolean, default: !0 }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: hn([Number, String]), default: 0 }, maxHeight: { type: hn([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: hn(Object) }, teleported: va.teleported }); Zn({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: _c } }); Zn({ onKeydown: { type: hn(Function) } }); jB("Dropdown"); const xS = Symbol("ElSelectGroup"), n0 = Symbol("ElSelect"); function PB(e, t) { const n = zn(n0), r = zn(xS, { disabled: !1 }), a = at(() => u(ji(n.props.modelValue), e.value)), i = at(() => { var g; if (n.props.multiple) { const p = ji((g = n.props.modelValue) != null ? g : []); return !a.value && p.length >= n.props.multipleLimit && n.props.multipleLimit > 0; } else return !1; }), o = at(() => e.label || (Ni(e.value) ? "" : e.value)), l = at(() => e.value || e.label || ""), s = at(() => e.disabled || t.groupDisabled || i.value), c = _a(), u = (g = [], p) => { if (Ni(e.value)) { const v = n.props.valueKey; return g && g.some((y) => a1(ho(y, v)) === ho(p, v)); } else return g && g.includes(p); }, f = () => { !e.disabled && !r.disabled && (n.states.hoveringIndex = n.optionsArray.indexOf(c.proxy)); }, h = (g) => { const p = new RegExp(uj(g), "i"); t.visible = p.test(o.value) || e.created; }; return wn(() => o.value, () => { !e.created && !n.props.remote && n.setSelected(); }), wn(() => e.value, (g, p) => { const { remote: v, valueKey: y } = n.props; if (g !== p && (n.onOptionDestroy(p, c.proxy), n.onOptionCreate(c.proxy)), !e.created && !v) { if (y && Ni(g) && Ni(p) && g[y] === p[y]) return; n.setSelected(); } }), wn(() => r.disabled, () => { t.groupDisabled = r.disabled; }, { immediate: !0 }), { select: n, currentLabel: o, currentValue: l, itemSelected: a, isDisabled: s, hoverItem: f, updateOption: h }; } const RB = en({ name: "ElOption", componentName: "ElOption", props: { value: { required: !0, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(e) { const t = or("select"), n = Qp(), r = at(() => [ t.be("dropdown", "item"), t.is("disabled", Ee(l)), t.is("selected", Ee(o)), t.is("hovering", Ee(h)) ]), a = es({ index: -1, groupDisabled: !1, visible: !0, hover: !1 }), { currentLabel: i, itemSelected: o, isDisabled: l, select: s, hoverItem: c, updateOption: u } = PB(e, a), { visible: f, hover: h } = r1(a), g = _a().proxy; s.onOptionCreate(g), vi(() => { const v = g.value, { selected: y } = s.states, m = (s.props.multiple ? y : [y]).some((b) => b.value === g.value); Va(() => { s.states.cachedOptions.get(v) === g && !m && s.states.cachedOptions.delete(v); }), s.onOptionDestroy(v, g); }); function p() { l.value || s.handleOptionSelect(g); } return { ns: t, id: n, containerKls: r, currentLabel: i, itemSelected: o, isDisabled: l, select: s, hoverItem: c, updateOption: u, visible: f, hover: h, selectOptionClick: p, states: a }; } }); function NB(e, t, n, r, a, i) { return xo((Tt(), Kt("li", { id: e.id, class: Gt(e.containerKls), role: "option", "aria-disabled": e.isDisabled || void 0, "aria-selected": e.itemSelected, onMouseenter: e.hoverItem, onClick: ga(e.selectOptionClick, ["stop"]) }, [ un(e.$slots, "default", {}, () => [ fn("span", null, ma(e.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [Hc, e.visible] ]); } var D1 = /* @__PURE__ */ qn(RB, [["render", NB], ["__file", "option.vue"]]); const BB = en({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const e = zn(n0), t = or("select"), n = at(() => e.props.popperClass), r = at(() => e.props.multiple), a = at(() => e.props.fitInputWidth), i = It(""); function o() { var l; i.value = `${(l = e.selectRef) == null ? void 0 : l.offsetWidth}px`; } return Yr(() => { o(), Zo(e.selectRef, o); }), { ns: t, minWidth: i, popperClass: n, isMultiple: r, isFitInputWidth: a }; } }); function HB(e, t, n, r, a, i) { return Tt(), Kt("div", { class: Gt([e.ns.b("dropdown"), e.ns.is("multiple", e.isMultiple), e.popperClass]), style: Bi({ [e.isFitInputWidth ? "width" : "minWidth"]: e.minWidth }) }, [ e.$slots.header ? (Tt(), Kt("div", { key: 0, class: Gt(e.ns.be("dropdown", "header")) }, [ un(e.$slots, "header") ], 2)) : In("v-if", !0), un(e.$slots, "default"), e.$slots.footer ? (Tt(), Kt("div", { key: 1, class: Gt(e.ns.be("dropdown", "footer")) }, [ un(e.$slots, "footer") ], 2)) : In("v-if", !0) ], 6); } var VB = /* @__PURE__ */ qn(BB, [["render", HB], ["__file", "select-dropdown.vue"]]); const qB = 11, UB = (e, t) => { const { t: n } = zj(), r = Qp(), a = or("select"), i = or("input"), o = es({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: !1, menuVisibleOnFocus: !1, isBeforeHide: !1 }), l = It(null), s = It(null), c = It(null), u = It(null), f = It(null), h = It(null), g = It(null), p = It(null), v = It(null), y = It(null), m = It(null), b = It(null), { isComposing: w, handleCompositionStart: _, handleCompositionUpdate: k, handleCompositionEnd: T } = aR({ afterComposition: (le) => ct(le) }), { wrapperRef: O, isFocused: M } = rR(f, { beforeFocus() { return U.value; }, afterFocus() { e.automaticDropdown && !C.value && (C.value = !0, o.menuVisibleOnFocus = !0); }, beforeBlur(le) { var Se, He; return ((Se = c.value) == null ? void 0 : Se.isFocusInsideContent(le)) || ((He = u.value) == null ? void 0 : He.isFocusInsideContent(le)); }, afterBlur() { C.value = !1, o.menuVisibleOnFocus = !1; } }), C = It(!1), I = It(), { form: j, formItem: P } = rS(), { inputId: N } = yR(e, { formItemContext: P }), { valueOnClear: W, isEmptyValue: J } = uR(e), U = at(() => e.disabled || (j == null ? void 0 : j.disabled)), E = at(() => Ri(e.modelValue) ? e.modelValue.length > 0 : !J(e.modelValue)), z = at(() => e.clearable && !U.value && o.inputHovering && E.value), F = at(() => e.remote && e.filterable && !e.remoteShowSuffix ? "" : e.suffixIcon), q = at(() => a.is("reverse", F.value && C.value)), H = at(() => (P == null ? void 0 : P.validateState) || ""), K = at(() => Tj[H.value]), Q = at(() => e.remote ? 300 : 0), re = at(() => e.loading ? e.loadingText || n("el.select.loading") : e.remote && !o.inputValue && o.options.size === 0 ? !1 : e.filterable && o.inputValue && o.options.size > 0 && te.value === 0 ? e.noMatchText || n("el.select.noMatch") : o.options.size === 0 ? e.noDataText || n("el.select.noData") : null), te = at(() => X.value.filter((le) => le.visible).length), X = at(() => { const le = Array.from(o.options.values()), Se = []; return o.optionValues.forEach((He) => { const Je = le.findIndex((Dt) => Dt.value === He); Je > -1 && Se.push(le[Je]); }), Se.length >= le.length ? Se : le; }), ce = at(() => Array.from(o.cachedOptions.values())), B = at(() => { const le = X.value.filter((Se) => !Se.created).some((Se) => Se.currentLabel === o.inputValue); return e.filterable && e.allowCreate && o.inputValue !== "" && !le; }), G = () => { e.filterable && ca(e.filterMethod) || e.filterable && e.remote && ca(e.remoteMethod) || X.value.forEach((le) => { var Se; (Se = le.updateOption) == null || Se.call(le, o.inputValue); }); }, Z = A1(), oe = at(() => ["small"].includes(Z.value) ? "small" : "default"), ae = at({ get() { return C.value && re.value !== !1; }, set(le) { C.value = le; } }), ge = at(() => { if (e.multiple && !Uu(e.modelValue)) return ji(e.modelValue).length === 0 && !o.inputValue; const le = Ri(e.modelValue) ? e.modelValue[0] : e.modelValue; return e.filterable || Uu(le) ? !o.inputValue : !0; }), ve = at(() => { var le; const Se = (le = e.placeholder) != null ? le : n("el.select.placeholder"); return e.multiple || !E.value ? Se : o.selectedLabel; }), pe = at(() => Pm ? null : "mouseenter"); wn(() => e.modelValue, (le, Se) => { e.multiple && e.filterable && !e.reserveKeyword && (o.inputValue = "", ye("")), Be(), !Wm(le, Se) && e.validateEvent && (P == null || P.validate("change").catch((He) => Ui(He))); }, { flush: "post", deep: !0 }), wn(() => C.value, (le) => { le ? ye(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), t("visible-change", le); }), wn(() => o.options.entries(), () => { var le; if (!Wr) return; const Se = ((le = l.value) == null ? void 0 : le.querySelectorAll("input")) || []; (!e.filterable && !e.defaultFirstOption && !Uu(e.modelValue) || !Array.from(Se).includes(document.activeElement)) && Be(), e.defaultFirstOption && (e.filterable || e.remote) && te.value && Oe(); }, { flush: "post" }), wn(() => o.hoveringIndex, (le) => { Ua(le) && le > -1 ? I.value = X.value[le] || {} : I.value = {}, X.value.forEach((Se) => { Se.hover = I.value === Se; }); }), N7(() => { o.isBeforeHide || G(); }); const ye = (le) => { o.previousQuery === le || w.value || (o.previousQuery = le, e.filterable && ca(e.filterMethod) ? e.filterMethod(le) : e.filterable && e.remote && ca(e.remoteMethod) && e.remoteMethod(le), e.defaultFirstOption && (e.filterable || e.remote) && te.value ? Va(Oe) : Va(Fe)); }, Oe = () => { const le = X.value.filter((Je) => Je.visible && !Je.disabled && !Je.states.groupDisabled), Se = le.find((Je) => Je.created), He = le[0]; o.hoveringIndex = nt(X.value, Se || He); }, Be = () => { if (e.multiple) o.selectedLabel = ""; else { const Se = Ri(e.modelValue) ? e.modelValue[0] : e.modelValue, He = Ie(Se); o.selectedLabel = He.currentLabel, o.selected = [He]; return; } const le = []; Uu(e.modelValue) || ji(e.modelValue).forEach((Se) => { le.push(Ie(Se)); }), o.selected = le; }, Ie = (le) => { let Se; const He = Sg(le).toLowerCase() === "object", Je = Sg(le).toLowerCase() === "null", Dt = Sg(le).toLowerCase() === "undefined"; for (let Pt = o.cachedOptions.size - 1; Pt >= 0; Pt--) { const _t = ce.value[Pt]; if (He ? ho(_t.value, e.valueKey) === ho(le, e.valueKey) : _t.value === le) { Se = { value: le, currentLabel: _t.currentLabel, get isDisabled() { return _t.isDisabled; } }; break; } } if (Se) return Se; const zt = He ? le.label : !Je && !Dt ? le : ""; return { value: le, currentLabel: zt }; }, Fe = () => { o.hoveringIndex = X.value.findIndex((le) => o.selected.some((Se) => $(Se) === $(le))); }, Re = () => { o.selectionWidth = s.value.getBoundingClientRect().width; }, We = () => { o.calculatorWidth = h.value.getBoundingClientRect().width; }, Ce = () => { o.collapseItemWidth = m.value.getBoundingClientRect().width; }, Ve = () => { var le, Se; (Se = (le = c.value) == null ? void 0 : le.updatePopper) == null || Se.call(le); }, Ke = () => { var le, Se; (Se = (le = u.value) == null ? void 0 : le.updatePopper) == null || Se.call(le); }, Xe = () => { o.inputValue.length > 0 && !C.value && (C.value = !0), ye(o.inputValue); }, ct = (le) => { if (o.inputValue = le.target.value, e.remote) vt(); else return Xe(); }, vt = nj(() => { Xe(); }, Q.value), lt = (le) => { Wm(e.modelValue, le) || t($p, le); }, ut = (le) => rj(le, (Se) => !o.disabledOptions.has(Se)), dt = (le) => { if (e.multiple && le.code !== dd.delete && le.target.value.length <= 0) { const Se = ji(e.modelValue).slice(), He = ut(Se); if (He < 0) return; const Je = Se[He]; Se.splice(He, 1), t(Jo, Se), lt(Se), t("remove-tag", Je); } }, Pe = (le, Se) => { const He = o.selected.indexOf(Se); if (He > -1 && !U.value) { const Je = ji(e.modelValue).slice(); Je.splice(He, 1), t(Jo, Je), lt(Je), t("remove-tag", Se.value); } le.stopPropagation(), tt(); }, ze = (le) => { le.stopPropagation(); const Se = e.multiple ? [] : W.value; if (e.multiple) for (const He of o.selected) He.isDisabled && Se.push(He.value); t(Jo, Se), lt(Se), o.hoveringIndex = -1, C.value = !1, t("clear"), tt(); }, Ne = (le) => { var Se; if (e.multiple) { const He = ji((Se = e.modelValue) != null ? Se : []).slice(), Je = nt(He, le.value); Je > -1 ? He.splice(Je, 1) : (e.multipleLimit <= 0 || He.length < e.multipleLimit) && He.push(le.value), t(Jo, He), lt(He), le.created && ye(""), e.filterable && !e.reserveKeyword && (o.inputValue = ""); } else t(Jo, le.value), lt(le.value), C.value = !1; tt(), !C.value && Va(() => { Qe(le); }); }, nt = (le = [], Se) => { if (!Ni(Se)) return le.indexOf(Se); const He = e.valueKey; let Je = -1; return le.some((Dt, zt) => a1(ho(Dt, He)) === ho(Se, He) ? (Je = zt, !0) : !1), Je; }, Qe = (le) => { var Se, He, Je, Dt, zt; const Pt = Ri(le) ? le[0] : le; let _t = null; if (Pt != null && Pt.value) { const $t = X.value.filter((Nt) => Nt.value === Pt.value); $t.length > 0 && (_t = $t[0].$el); } if (c.value && _t) { const $t = (Dt = (Je = (He = (Se = c.value) == null ? void 0 : Se.popperRef) == null ? void 0 : He.contentRef) == null ? void 0 : Je.querySelector) == null ? void 0 : Dt.call(Je, `.${a.be("dropdown", "wrap")}`); $t && hj($t, _t); } (zt = b.value) == null || zt.handleScroll(); }, it = (le) => { o.options.set(le.value, le), o.cachedOptions.set(le.value, le), le.disabled && o.disabledOptions.set(le.value, le); }, rt = (le, Se) => { o.options.get(le) === Se && o.options.delete(le); }, bt = at(() => { var le, Se; return (Se = (le = c.value) == null ? void 0 : le.popperRef) == null ? void 0 : Se.contentRef; }), je = () => { o.isBeforeHide = !1, Va(() => Qe(o.selected)); }, tt = () => { var le; (le = f.value) == null || le.focus(); }, pt = () => { var le; (le = f.value) == null || le.blur(); }, kt = (le) => { ze(le); }, et = () => { C.value = !1, M.value && pt(); }, ft = () => { o.inputValue.length > 0 ? o.inputValue = "" : C.value = !1; }, $e = () => { U.value || (Pm && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : C.value = !C.value); }, Lt = () => { C.value ? X.value[o.hoveringIndex] && Ne(X.value[o.hoveringIndex]) : $e(); }, $ = (le) => Ni(le.value) ? ho(le.value, e.valueKey) : le.value, se = at(() => X.value.filter((le) => le.visible).every((le) => le.disabled)), ie = at(() => e.multiple ? e.collapseTags ? o.selected.slice(0, e.maxCollapseTags) : o.selected : []), de = at(() => e.multiple ? e.collapseTags ? o.selected.slice(e.maxCollapseTags) : [] : []), Te = (le) => { if (!C.value) { C.value = !0; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || w.value) && !se.value) { le === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : le === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Se = X.value[o.hoveringIndex]; (Se.disabled === !0 || Se.states.groupDisabled === !0 || !Se.visible) && Te(le), Va(() => Qe(I.value)); } }, xe = () => { if (!s.value) return 0; const le = window.getComputedStyle(s.value); return Number.parseFloat(le.gap || "6px"); }, Ge = at(() => { const le = xe(); return { maxWidth: `${m.value && e.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - le : o.selectionWidth}px` }; }), qe = at(() => ({ maxWidth: `${o.selectionWidth}px` })), De = at(() => ({ width: `${Math.max(o.calculatorWidth, qB)}px` })); return Zo(s, Re), Zo(h, We), Zo(v, Ve), Zo(O, Ve), Zo(y, Ke), Zo(m, Ce), Yr(() => { Be(); }), { inputId: N, contentId: r, nsSelect: a, nsInput: i, states: o, isFocused: M, expanded: C, optionsArray: X, hoverOption: I, selectSize: Z, filteredOptionsCount: te, resetCalculatorWidth: We, updateTooltip: Ve, updateTagTooltip: Ke, debouncedOnInputChange: vt, onInput: ct, deletePrevTag: dt, deleteTag: Pe, deleteSelected: ze, handleOptionSelect: Ne, scrollToOption: Qe, hasModelValue: E, shouldShowPlaceholder: ge, currentPlaceholder: ve, mouseEnterEventName: pe, showClose: z, iconComponent: F, iconReverse: q, validateState: H, validateIcon: K, showNewOption: B, updateOptions: G, collapseTagSize: oe, setSelected: Be, selectDisabled: U, emptyText: re, handleCompositionStart: _, handleCompositionUpdate: k, handleCompositionEnd: T, onOptionCreate: it, onOptionDestroy: rt, handleMenuEnter: je, focus: tt, blur: pt, handleClearClick: kt, handleClickOutside: et, handleEsc: ft, toggleMenu: $e, selectOption: Lt, getValueKey: $, navigateOptions: Te, dropdownMenuVisible: ae, showTagList: ie, collapseTagList: de, tagStyle: Ge, collapseTagStyle: qe, inputStyle: De, popperRef: bt, inputRef: f, tooltipRef: c, tagTooltipRef: u, calculatorRef: h, prefixRef: g, suffixRef: p, selectRef: l, wrapperRef: O, selectionRef: s, scrollbarRef: b, menuRef: v, tagMenuRef: y, collapseItemRef: m }; }; var GB = en({ name: "ElOptions", setup(e, { slots: t }) { const n = zn(n0); let r = []; return () => { var a, i; const o = (a = t.default) == null ? void 0 : a.call(t), l = []; function s(c) { Ri(c) && c.forEach((u) => { var f, h, g, p; const v = (f = (u == null ? void 0 : u.type) || {}) == null ? void 0 : f.name; v === "ElOptionGroup" ? s(!Vc(u.children) && !Ri(u.children) && ca((h = u.children) == null ? void 0 : h.default) ? (g = u.children) == null ? void 0 : g.default() : u.children) : v === "ElOption" ? l.push((p = u.props) == null ? void 0 : p.value) : Ri(u.children) && s(u.children); }); } return o.length && s((i = o[0]) == null ? void 0 : i.children), Wm(l, r) || (r = l, n && (n.states.optionValues = l)), o; }; } }); const WB = Zn({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: tS, effect: { type: hn(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: hn(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: !0 }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: va.teleported, persistent: { type: Boolean, default: !0 }, clearIcon: { type: _c, default: P3 }, fitInputWidth: Boolean, suffixIcon: { type: _c, default: gj }, tagType: { ...Qm.type, default: "info" }, tagEffect: { ...Qm.effect, default: "light" }, validateEvent: { type: Boolean, default: !0 }, remoteShowSuffix: Boolean, placement: { type: hn(String), values: Kp, default: "bottom-start" }, fallbackPlacements: { type: hn(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...cR, ...Xp(["ariaLabel"]) }), Ww = "ElSelect", ZB = en({ name: Ww, componentName: Ww, components: { ElSelectMenu: VB, ElOption: D1, ElOptions: GB, ElTag: fB, ElScrollbar: FR, ElTooltip: dS, ElIcon: Cc }, directives: { ClickOutside: lB }, props: WB, emits: [ Jo, $p, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(e, { emit: t }) { const n = at(() => { const { modelValue: i, multiple: o } = e, l = o ? [] : void 0; return Ri(i) ? o ? i : l : o ? l : i; }), r = es({ ...r1(e), modelValue: n }), a = UB(r, t); return wa(n0, es({ props: r, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: n }; } }); function YB(e, t, n, r, a, i) { const o = co("el-tag"), l = co("el-tooltip"), s = co("el-icon"), c = co("el-option"), u = co("el-options"), f = co("el-scrollbar"), h = co("el-select-menu"), g = G7("click-outside"); return xo((Tt(), Kt("div", { ref: "selectRef", class: Gt([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]), [W7(e.mouseEnterEventName)]: (p) => e.states.inputHovering = !0, onMouseleave: (p) => e.states.inputHovering = !1 }, [ Mn(l, { ref: "tooltipRef", visible: e.dropdownMenuVisible, placement: e.placement, teleported: e.teleported, "popper-class": [e.nsSelect.e("popper"), e.popperClass], "popper-options": e.popperOptions, "fallback-placements": e.fallbackPlacements, effect: e.effect, pure: "", trigger: "click", transition: `${e.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": !1, "gpu-acceleration": !1, persistent: e.persistent, "append-to": e.appendTo, onBeforeShow: e.handleMenuEnter, onHide: (p) => e.states.isBeforeHide = !1 }, { default: on(() => { var p; return [ fn("div", { ref: "wrapperRef", class: Gt([ e.nsSelect.e("wrapper"), e.nsSelect.is("focused", e.isFocused), e.nsSelect.is("hovering", e.states.inputHovering), e.nsSelect.is("filterable", e.filterable), e.nsSelect.is("disabled", e.selectDisabled) ]), onClick: ga(e.toggleMenu, ["prevent"]) }, [ e.$slots.prefix ? (Tt(), Kt("div", { key: 0, ref: "prefixRef", class: Gt(e.nsSelect.e("prefix")) }, [ un(e.$slots, "prefix") ], 2)) : In("v-if", !0), fn("div", { ref: "selectionRef", class: Gt([ e.nsSelect.e("selection"), e.nsSelect.is("near", e.multiple && !e.$slots.prefix && !!e.states.selected.length) ]) }, [ e.multiple ? un(e.$slots, "tag", { key: 0 }, () => [ (Tt(!0), Kt(_o, null, bc(e.showTagList, (v) => (Tt(), Kt("div", { key: e.getValueKey(v), class: Gt(e.nsSelect.e("selected-item")) }, [ Mn(o, { closable: !e.selectDisabled && !v.isDisabled, size: e.collapseTagSize, type: e.tagType, effect: e.tagEffect, "disable-transitions": "", style: Bi(e.tagStyle), onClose: (y) => e.deleteTag(y, v) }, { default: on(() => [ fn("span", { class: Gt(e.nsSelect.e("tags-text")) }, [ un(e.$slots, "label", { label: v.currentLabel, value: v.value }, () => [ ts(ma(v.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), e.collapseTags && e.states.selected.length > e.maxCollapseTags ? (Tt(), An(l, { key: 0, ref: "tagTooltipRef", disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: e.effect, placement: "bottom", teleported: e.teleported }, { default: on(() => [ fn("div", { ref: "collapseItemRef", class: Gt(e.nsSelect.e("selected-item")) }, [ Mn(o, { closable: !1, size: e.collapseTagSize, type: e.tagType, effect: e.tagEffect, "disable-transitions": "", style: Bi(e.collapseTagStyle) }, { default: on(() => [ fn("span", { class: Gt(e.nsSelect.e("tags-text")) }, " + " + ma(e.states.selected.length - e.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: on(() => [ fn("div", { ref: "tagMenuRef", class: Gt(e.nsSelect.e("selection")) }, [ (Tt(!0), Kt(_o, null, bc(e.collapseTagList, (v) => (Tt(), Kt("div", { key: e.getValueKey(v), class: Gt(e.nsSelect.e("selected-item")) }, [ Mn(o, { class: "in-tooltip", closable: !e.selectDisabled && !v.isDisabled, size: e.collapseTagSize, type: e.tagType, effect: e.tagEffect, "disable-transitions": "", onClose: (y) => e.deleteTag(y, v) }, { default: on(() => [ fn("span", { class: Gt(e.nsSelect.e("tags-text")) }, [ un(e.$slots, "label", { label: v.currentLabel, value: v.value }, () => [ ts(ma(v.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : In("v-if", !0) ]) : In("v-if", !0), e.selectDisabled ? In("v-if", !0) : (Tt(), Kt("div", { key: 1, class: Gt([ e.nsSelect.e("selected-item"), e.nsSelect.e("input-wrapper"), e.nsSelect.is("hidden", !e.filterable) ]) }, [ xo(fn("input", { id: e.inputId, ref: "inputRef", "onUpdate:modelValue": (v) => e.states.inputValue = v, type: "text", name: e.name, class: Gt([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]), disabled: e.selectDisabled, autocomplete: e.autocomplete, style: Bi(e.inputStyle), role: "combobox", readonly: !e.filterable, spellcheck: "false", "aria-activedescendant": ((p = e.hoverOption) == null ? void 0 : p.id) || "", "aria-controls": e.contentId, "aria-expanded": e.dropdownMenuVisible, "aria-label": e.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ Xs(ga((v) => e.navigateOptions("next"), ["stop", "prevent"]), ["down"]), Xs(ga((v) => e.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), Xs(ga(e.handleEsc, ["stop", "prevent"]), ["esc"]), Xs(ga(e.selectOption, ["stop", "prevent"]), ["enter"]), Xs(ga(e.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: e.handleCompositionStart, onCompositionupdate: e.handleCompositionUpdate, onCompositionend: e.handleCompositionEnd, onInput: e.onInput, onClick: ga(e.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [Z7, e.states.inputValue] ]), e.filterable ? (Tt(), Kt("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: Gt(e.nsSelect.e("input-calculator")), textContent: ma(e.states.inputValue) }, null, 10, ["textContent"])) : In("v-if", !0) ], 2)), e.shouldShowPlaceholder ? (Tt(), Kt("div", { key: 2, class: Gt([ e.nsSelect.e("selected-item"), e.nsSelect.e("placeholder"), e.nsSelect.is("transparent", !e.hasModelValue || e.expanded && !e.states.inputValue) ]) }, [ e.hasModelValue ? un(e.$slots, "label", { key: 0, label: e.currentPlaceholder, value: e.modelValue }, () => [ fn("span", null, ma(e.currentPlaceholder), 1) ]) : (Tt(), Kt("span", { key: 1 }, ma(e.currentPlaceholder), 1)) ], 2)) : In("v-if", !0) ], 2), fn("div", { ref: "suffixRef", class: Gt(e.nsSelect.e("suffix")) }, [ e.iconComponent && !e.showClose ? (Tt(), An(s, { key: 0, class: Gt([e.nsSelect.e("caret"), e.nsSelect.e("icon"), e.iconReverse]) }, { default: on(() => [ (Tt(), An(yo(e.iconComponent))) ]), _: 1 }, 8, ["class"])) : In("v-if", !0), e.showClose && e.clearIcon ? (Tt(), An(s, { key: 1, class: Gt([ e.nsSelect.e("caret"), e.nsSelect.e("icon"), e.nsSelect.e("clear") ]), onClick: e.handleClearClick }, { default: on(() => [ (Tt(), An(yo(e.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : In("v-if", !0), e.validateState && e.validateIcon ? (Tt(), An(s, { key: 2, class: Gt([e.nsInput.e("icon"), e.nsInput.e("validateIcon")]) }, { default: on(() => [ (Tt(), An(yo(e.validateIcon))) ]), _: 1 }, 8, ["class"])) : In("v-if", !0) ], 2) ], 10, ["onClick"]) ]; }), content: on(() => [ Mn(h, { ref: "menuRef" }, { default: on(() => [ e.$slots.header ? (Tt(), Kt("div", { key: 0, class: Gt(e.nsSelect.be("dropdown", "header")), onClick: ga(() => { }, ["stop"]) }, [ un(e.$slots, "header") ], 10, ["onClick"])) : In("v-if", !0), xo(Mn(f, { id: e.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": e.nsSelect.be("dropdown", "wrap"), "view-class": e.nsSelect.be("dropdown", "list"), class: Gt([e.nsSelect.is("empty", e.filteredOptionsCount === 0)]), role: "listbox", "aria-label": e.ariaLabel, "aria-orientation": "vertical" }, { default: on(() => [ e.showNewOption ? (Tt(), An(c, { key: 0, value: e.states.inputValue, created: !0 }, null, 8, ["value"])) : In("v-if", !0), Mn(u, null, { default: on(() => [ un(e.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [Hc, e.states.options.size > 0 && !e.loading] ]), e.$slots.loading && e.loading ? (Tt(), Kt("div", { key: 1, class: Gt(e.nsSelect.be("dropdown", "loading")) }, [ un(e.$slots, "loading") ], 2)) : e.loading || e.filteredOptionsCount === 0 ? (Tt(), Kt("div", { key: 2, class: Gt(e.nsSelect.be("dropdown", "empty")) }, [ un(e.$slots, "empty", {}, () => [ fn("span", null, ma(e.emptyText), 1) ]) ], 2)) : In("v-if", !0), e.$slots.footer ? (Tt(), Kt("div", { key: 3, class: Gt(e.nsSelect.be("dropdown", "footer")), onClick: ga(() => { }, ["stop"]) }, [ un(e.$slots, "footer") ], 10, ["onClick"])) : In("v-if", !0) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [g, e.handleClickOutside, e.popperRef] ]); } var $B = /* @__PURE__ */ qn(ZB, [["render", YB], ["__file", "select.vue"]]); const KB = en({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(e) { const t = or("select"), n = It(null), r = _a(), a = It([]); wa(xS, es({ ...r1(e) })); const i = at(() => a.value.some((c) => c.visible === !0)), o = (c) => { var u, f; return ((u = c.type) == null ? void 0 : u.name) === "ElOption" && !!((f = c.component) != null && f.proxy); }, l = (c) => { const u = ji(c), f = []; return u.forEach((h) => { var g, p; o(h) ? f.push(h.component.proxy) : (g = h.children) != null && g.length ? f.push(...l(h.children)) : (p = h.component) != null && p.subTree && f.push(...l(h.component.subTree)); }), f; }, s = () => { a.value = l(r.subTree); }; return Yr(() => { s(); }), sI(n, s, { attributes: !0, subtree: !0, childList: !0 }), { groupRef: n, visible: i, ns: t }; } }); function JB(e, t, n, r, a, i) { return xo((Tt(), Kt("ul", { ref: "groupRef", class: Gt(e.ns.be("group", "wrap")) }, [ fn("li", { class: Gt(e.ns.be("group", "title")) }, ma(e.label), 3), fn("li", null, [ fn("ul", { class: Gt(e.ns.b("group")) }, [ un(e.$slots, "default") ], 2) ]) ], 2)), [ [Hc, e.visible] ]); } var bS = /* @__PURE__ */ qn(KB, [["render", JB], ["__file", "option-group.vue"]]); const Uc = mi($B, { Option: D1, OptionGroup: bS }), Gc = Yp(D1); Yp(bS); const QB = Zn({ trigger: pd.trigger, placement: Ng.placement, disabled: pd.disabled, visible: va.visible, transition: va.transition, popperOptions: Ng.popperOptions, tabindex: Ng.tabindex, content: va.content, popperStyle: va.popperStyle, popperClass: va.popperClass, enterable: { ...va.enterable, default: !0 }, effect: { ...va.effect, default: "light" }, teleported: va.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: !0 }, persistent: { type: Boolean, default: !0 }, "onUpdate:visible": { type: Function } }), XB = { "update:visible": (e) => h1(e), "before-enter": () => !0, "before-leave": () => !0, "after-enter": () => !0, "after-leave": () => !0 }, eH = "onUpdate:visible", tH = en({ name: "ElPopover" }), nH = /* @__PURE__ */ en({ ...tH, props: QB, emits: XB, setup(e, { expose: t, emit: n }) { const r = e, a = at(() => r[eH]), i = or("popover"), o = It(), l = at(() => { var y; return (y = Ee(o)) == null ? void 0 : y.popperRef; }), s = at(() => [ { width: ep(r.width) }, r.popperStyle ]), c = at(() => [i.b(), r.popperClass, { [i.m("plain")]: !!r.content }]), u = at(() => r.transition === `${i.namespace.value}-fade-in-linear`), f = () => { var y; (y = o.value) == null || y.hide(); }, h = () => { n("before-enter"); }, g = () => { n("before-leave"); }, p = () => { n("after-enter"); }, v = () => { n("update:visible", !1), n("after-leave"); }; return t({ popperRef: l, hide: f }), (y, m) => (Tt(), An(Ee(dS), cs({ ref_key: "tooltipRef", ref: o }, y.$attrs, { trigger: y.trigger, placement: y.placement, disabled: y.disabled, visible: y.visible, transition: y.transition, "popper-options": y.popperOptions, tabindex: y.tabindex, content: y.content, offset: y.offset, "show-after": y.showAfter, "hide-after": y.hideAfter, "auto-close": y.autoClose, "show-arrow": y.showArrow, "aria-label": y.title, effect: y.effect, enterable: y.enterable, "popper-class": Ee(c), "popper-style": Ee(s), teleported: y.teleported, persistent: y.persistent, "gpu-acceleration": Ee(u), "onUpdate:visible": Ee(a), onBeforeShow: h, onBeforeHide: g, onShow: p, onHide: v }), { content: on(() => [ y.title ? (Tt(), Kt("div", { key: 0, class: Gt(Ee(i).e("title")), role: "title" }, ma(y.title), 3)) : In("v-if", !0), un(y.$slots, "default", {}, () => [ ts(ma(y.content), 1) ]) ]), default: on(() => [ y.$slots.reference ? un(y.$slots, "reference", { key: 0 }) : In("v-if", !0) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var rH = /* @__PURE__ */ qn(nH, [["__file", "popover.vue"]]); const Zw = (e, t) => { const n = t.arg || t.value, r = n == null ? void 0 : n.popperRef; r && (r.triggerRef = e); }; var aH = { mounted(e, t) { Zw(e, t); }, updated(e, t) { Zw(e, t); } }; const iH = "popover", oH = Aj(aH, iH), F1 = mi(rH, { directive: oH }), wS = (e, t) => { const n = e.__vccOpts || e; for (const [r, a] of t) n[r] = a; return n; }, lH = ["xlink:href"], sH = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: !0 }, /** * The option to spin the icon. */ spin: { type: Boolean, default: !1 } }, setup(e) { return (t, n) => (Tt(), Kt("svg", { class: Gt(["map-icon", { "map-icon-spin": e.spin }]) }, [ fn("use", { "xlink:href": `#${e.icon}` }, null, 8, lH) ], 2)); } }, cH = /* @__PURE__ */ wS(sH, [["__scopeId", "data-v-e172d5ff"]]), _S = ` 2horpanel ? `, kS = ` 2vertpanel ? `, TS = ` 3panel ? `, AS = ` 4panel ? `, MS = ` 2horpanel ? `, SS = ` 2horpanel ? `, CS = ` 4panel ? `, LS = ` changeBckgd `, OS = ` close no bk `, DS = ` close `, FS = ` closeFullScreen `, IS = ` Comment `, zS = ` Connection `, ES = ` dock `, jS = ` drawLine `, PS = ` drawPoint `, RS = ` drawPolygon `, NS = ` drawTrash `, BS = ` fitWindow `, HS = ` fullScreen `, VS = 'DataPortal-Icons', qS = ` magnifyingGlass `, US = `Created by Wahyu Prihantorofrom the Noun Project`, GS = ` openMap `, WS = ` Artboard Copy 6 `, ZS = ` permalink `, YS = ` play `, $S = ` resetZoom `, KS = ` singlepanel ? `, JS = ` tooltips ? `, QS = ` undock `, XS = ` zoomIn `, e4 = ` zoomOut `, t4 = (e, t, n, r) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = r || []; let l = document.createElement("div"); l.innerHTML = e, a.map((c) => { const u = l.querySelector(c); u && u.remove(); }), i.map((c) => { l.querySelector("svg").removeAttribute(c); }), r && o.map((c) => { Object.values(l.querySelectorAll(`[${c}]`)).map((u) => { u.removeAttribute(c); }); }); const s = l.innerHTML; return l = null, s; }, n4 = (e) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((t, n) => "".replace.apply(t, n), e).trim(), uH = !0, dH = !0, fH = ["fill"], Yw = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": _S, "/assets/icons/2vertpanel.svg": kS, "/assets/icons/3panel.svg": TS, "/assets/icons/4panel.svg": AS, "/assets/icons/5panel.svg": MS, "/assets/icons/6panel.svg": SS, "/assets/icons/6panelVertical.svg": CS, "/assets/icons/changeBckgd.svg": LS, "/assets/icons/close-no-bk.svg": OS, "/assets/icons/close.svg": DS, "/assets/icons/closeFullScreen.svg": FS, "/assets/icons/comment.svg": IS, "/assets/icons/connection.svg": zS, "/assets/icons/dock.svg": ES, "/assets/icons/drawLine.svg": jS, "/assets/icons/drawPoint.svg": PS, "/assets/icons/drawPolygon.svg": RS, "/assets/icons/drawTrash.svg": NS, "/assets/icons/fitWindow.svg": BS, "/assets/icons/fullScreen.svg": HS, "/assets/icons/help.svg": VS, "/assets/icons/magnifyingGlass.svg": qS, "/assets/icons/noun-filter.svg": US, "/assets/icons/openMap.svg": GS, "/assets/icons/pause.svg": WS, "/assets/icons/permalink.svg": ZS, "/assets/icons/play.svg": YS, "/assets/icons/resetZoom.svg": $S, "/assets/icons/singlepanel.svg": KS, "/assets/icons/tooltips.svg": JS, "/assets/icons/undock.svg": QS, "/assets/icons/zoomIn.svg": XS, "/assets/icons/zoomOut.svg": e4 }), hH = Object.keys(Yw).map((e) => { const t = t4(Yw[e], uH, dH, fH), n = e.replace(/^.+\/(\w+).svg$/, "$1"); return n4(t).replace("", "symbol>"); }); hH.join(` `); const Xm = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": _S, "/assets/icons/2vertpanel.svg": kS, "/assets/icons/3panel.svg": TS, "/assets/icons/4panel.svg": AS, "/assets/icons/5panel.svg": MS, "/assets/icons/6panel.svg": SS, "/assets/icons/6panelVertical.svg": CS, "/assets/icons/changeBckgd.svg": LS, "/assets/icons/close-no-bk.svg": OS, "/assets/icons/close.svg": DS, "/assets/icons/closeFullScreen.svg": FS, "/assets/icons/comment.svg": IS, "/assets/icons/connection.svg": zS, "/assets/icons/dock.svg": ES, "/assets/icons/drawLine.svg": jS, "/assets/icons/drawPoint.svg": PS, "/assets/icons/drawPolygon.svg": RS, "/assets/icons/drawTrash.svg": NS, "/assets/icons/fitWindow.svg": BS, "/assets/icons/fullScreen.svg": HS, "/assets/icons/help.svg": VS, "/assets/icons/magnifyingGlass.svg": qS, "/assets/icons/noun-filter.svg": US, "/assets/icons/openMap.svg": GS, "/assets/icons/pause.svg": WS, "/assets/icons/permalink.svg": ZS, "/assets/icons/play.svg": YS, "/assets/icons/resetZoom.svg": $S, "/assets/icons/singlepanel.svg": KS, "/assets/icons/tooltips.svg": JS, "/assets/icons/undock.svg": QS, "/assets/icons/zoomIn.svg": XS, "/assets/icons/zoomOut.svg": e4 }), pH = Object.keys(Xm).map((e) => { const t = t4(Xm[e]), n = e.replace(/^.+\/(\w+).svg$/, "$1"); return n4(t).replace("", "symbol>"); }), gH = { name: "MapSvgSpriteColor", svgContext: Xm, svgSprite: pH.join(` `) // concatenate all symbols into $options.svgSprite }, vH = ["innerHTML"]; function mH(e, t, n, r, a, i) { return Tt(), Kt("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: e.$options.svgSprite }, null, 8, vH); } const yH = /* @__PURE__ */ wS(gH, [["render", mH]]), r0 = (e, t) => { const n = e.__vccOpts || e; for (const [r, a] of t) n[r] = a; return n; }, xH = { name: "PlotControls", components: { MapSvgSpriteColor: yH, MapSvgIcon: cH, ElSelect: Uc, ElOption: Gc, ElCollapse: mS, ElCollapseItem: yS, ElButton: qd, ElPopover: F1 }, props: { parentElement: { type: Object, required: !0 }, controlsEnabled: { type: Boolean, required: !0 } }, data: function() { return { hoverVisibilities: [{ value: !1 }, { value: !1 }, { value: !1 }, { value: !1 }, { value: !1 }], zoomSelect: [ { value: "1", label: "100%" } ], selectZoom: "100%", zoom: 100, maxZoom: 800, zoomInDisabled: !1, zoomOutDisabled: !0 }; }, methods: { // zoomIn: Find and click the plotly modebar 'zoom in' zoomIn: function() { this.zoom += 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="in"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, // zoomOut: Find and click the plotly modebar 'zoom out' zoomOut: function() { this.zoom -= 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="out"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, // setDisabledButtons(zoomLevel): Disable buttons once they hit max zoom setDisabledButtons(e) { e >= this.maxZoom ? this.zoomInDisabled = !0 : this.zoomInDisabled = !1, e <= 0 ? this.zoomOutDisabled = !0 : this.zoomOutDisabled = !1; }, resetView: function() { this.zoom = 100, this.parentElement.element.querySelector('a[data-attr="zoom"][data-val="reset"]').click(), this.setDisabledButtons(this.zoom), this.updateZoomSelect(this.zoom); }, percentToNum(e) { return Number(e.slice(0, -1)); }, selectZoomChange: function(e) { if (e === "100%") { this.resetView(); return; } let t = this.percentToNum(e), n = Math.round((t - this.zoom) / 100); for (let r = 0; r < Math.abs(n); r++) n > 0 ? this.zoomIn() : this.zoomOut(); this.updateZoomSelect(t); }, updateZoomSelect(e) { this.selectZoom = String(e) + "%"; }, createZoomPercentages: function() { this.zoomSelect = []; for (let e = 0; e <= this.maxZoom / 100; e++) this.zoomSelect.push({ value: e, label: (e + 1) * 100 + "%" }); }, setHelpMode: function(e) { e ? (this.inHelp = !0, this.hoverVisibilities.forEach((t) => { t.value = !0; })) : (this.inHelp = !1, this.hoverVisibilities.forEach((t) => { t.value = !1; })); }, showToolitip: function(e) { this.inHelp || (this.hoverVisibilities[e].value = !0, this.tooltipWait = setTimeout(() => { this.hoverVisibilities[e].value = !0; }, 1e3)); }, hideToolitip: function(e) { this.inHelp || (this.hoverVisibilities[e].value = !1, clearInterval(this.tooltipWait)); }, handleWheel: function(e) { let t = Math.round(e.deltaY / 7); this.zoom = this.zoom - t, this.updateZoomSelect(this.zoom); } }, mounted: function() { this.createZoomPercentages(), setTimeout(() => { this.parentElement.element.addEventListener("wheel", this.handleWheel); }, 1e3); }, beforeUnmount: function() { this.parentElement.element.removeEventListener("wheel", this.handleWheel); } }, bH = { class: "container" }; function wH(e, t, n, r, a, i) { const o = co("map-svg-sprite-color"), l = co("map-svg-icon"), s = F1, c = Gc, u = Uc; return Tt(), Kt("div", bH, [ Mn(o), fn("div", { ref: "zoomControls", class: Gt([{ inactive: !n.controlsEnabled }, "bottom-right-control"]) }, [ Mn(s, { modelValue: e.hoverVisibilities[0].value, "onUpdate:modelValue": t[3] || (t[3] = (f) => e.hoverVisibilities[0].value = f), content: "Zoom in", placement: "left", teleported: !1, trigger: "manual", "popper-class": "plot-popper" }, { reference: on(() => [ Mn(l, { icon: "zoomIn", class: "icon-button zoomIn", onClick: t[0] || (t[0] = (f) => i.zoomIn()), onMouseover: t[1] || (t[1] = (f) => i.showToolitip(0)), onMouseout: t[2] || (t[2] = (f) => i.hideToolitip(0)) }) ]), _: 1 }, 8, ["modelValue"]), Mn(s, { modelValue: e.hoverVisibilities[1].value, "onUpdate:modelValue": t[7] || (t[7] = (f) => e.hoverVisibilities[1].value = f), content: "Zoom out", placement: "top-end", teleported: !1, trigger: "manual", "popper-class": "plot-popper popper-zoomout" }, { reference: on(() => [ Mn(l, { icon: "zoomOut", class: "icon-button zoomOut", onClick: t[4] || (t[4] = (f) => i.zoomOut()), onMouseover: t[5] || (t[5] = (f) => i.showToolitip(1)), onMouseout: t[6] || (t[6] = (f) => i.hideToolitip(1)) }) ]), _: 1 }, 8, ["modelValue"]), Mn(u, { size: "small", modelValue: e.selectZoom, "onUpdate:modelValue": t[8] || (t[8] = (f) => e.selectZoom = f), placeholder: "100%", class: "zoomSelect", onChange: i.selectZoomChange }, { default: on(() => [ (Tt(!0), Kt(_o, null, bc(e.zoomSelect, (f) => (Tt(), An(c, { key: f.value, label: f.label, value: f.label }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue", "onChange"]), Mn(s, { modelValue: e.hoverVisibilities[2].value, "onUpdate:modelValue": t[12] || (t[12] = (f) => e.hoverVisibilities[2].value = f), content: "Reset", placement: "top", teleported: !1, trigger: "manual", "popper-class": "plot-popper" }, { reference: on(() => [ Mn(l, { icon: "resetZoom", class: "icon-button resetView", onClick: t[9] || (t[9] = (f) => i.resetView()), onMouseover: t[10] || (t[10] = (f) => i.showToolitip(2)), onMouseout: t[11] || (t[11] = (f) => i.hideToolitip(2)) }) ]), _: 1 }, 8, ["modelValue"]) ], 2) ]); } const Gd = /* @__PURE__ */ r0(xH, [["render", wH], ["__scopeId", "data-v-2ec1d0d2"]]); var r4 = {}, a0 = {}; a0.version = "2.28.0"; var _H = { exports: {} }; /*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org */ (function(e) { (function(t, n, r) { n[t] = n[t] || r(), e.exports && (e.exports = n[t]); })("Promise", gd, function() { var t, n, r, a = Object.prototype.toString, i = typeof setImmediate < "u" ? function(m) { return setImmediate(m); } : setTimeout; try { Object.defineProperty({}, "x", {}), t = function(m, b, w, _) { return Object.defineProperty(m, b, { value: w, writable: !0, configurable: _ !== !1 }); }; } catch { t = function(m, b, w) { return m[b] = w, m; }; } r = /* @__PURE__ */ function() { var m, b, w; function _(k, T) { this.fn = k, this.self = T, this.next = void 0; } return { add: function(k, T) { w = new _(k, T), b ? b.next = w : m = w, b = w, w = void 0; }, drain: function() { var k = m; for (m = b = n = void 0; k; ) k.fn.call(k.self), k = k.next; } }; }(); function o(m, b) { r.add(m, b), n || (n = i(r.drain)); } function l(m) { var b, w = typeof m; return m != null && (w == "object" || w == "function") && (b = m.then), typeof b == "function" ? b : !1; } function s() { for (var m = 0; m < this.chain.length; m++) c( this, this.state === 1 ? this.chain[m].success : this.chain[m].failure, this.chain[m] ); this.chain.length = 0; } function c(m, b, w) { var _, k; try { b === !1 ? w.reject(m.msg) : (b === !0 ? _ = m.msg : _ = b.call(void 0, m.msg), _ === w.promise ? w.reject(TypeError("Promise-chain cycle")) : (k = l(_)) ? k.call(_, w.resolve, w.reject) : w.resolve(_)); } catch (T) { w.reject(T); } } function u(m) { var b, w = this; if (!w.triggered) { w.triggered = !0, w.def && (w = w.def); try { (b = l(m)) ? o(function() { var _ = new g(w); try { b.call( m, function() { u.apply(_, arguments); }, function() { f.apply(_, arguments); } ); } catch (k) { f.call(_, k); } }) : (w.msg = m, w.state = 1, w.chain.length > 0 && o(s, w)); } catch (_) { f.call(new g(w), _); } } } function f(m) { var b = this; b.triggered || (b.triggered = !0, b.def && (b = b.def), b.msg = m, b.state = 2, b.chain.length > 0 && o(s, b)); } function h(m, b, w, _) { for (var k = 0; k < b.length; k++) (function(T) { m.resolve(b[T]).then( function(O) { w(T, O); }, _ ); })(k); } function g(m) { this.def = m, this.triggered = !1; } function p(m) { this.promise = m, this.state = 0, this.triggered = !1, this.chain = [], this.msg = void 0; } function v(m) { if (typeof m != "function") throw TypeError("Not a function"); if (this.__NPO__ !== 0) throw TypeError("Not a promise"); this.__NPO__ = 1; var b = new p(this); this.then = function(w, _) { var k = { success: typeof w == "function" ? w : !0, failure: typeof _ == "function" ? _ : !1 }; return k.promise = new this.constructor(function(T, O) { if (typeof T != "function" || typeof O != "function") throw TypeError("Not a function"); k.resolve = T, k.reject = O; }), b.chain.push(k), b.state !== 0 && o(s, b), k.promise; }, this.catch = function(w) { return this.then(void 0, w); }; try { m.call( void 0, function(w) { u.call(b, w); }, function(w) { f.call(b, w); } ); } catch (w) { f.call(b, w); } } var y = t( {}, "constructor", v, /*configurable=*/ !1 ); return v.prototype = y, t( y, "__NPO__", 0, /*configurable=*/ !1 ), t(v, "resolve", function(m) { var b = this; return m && typeof m == "object" && m.__NPO__ === 1 ? m : new b(function(w, _) { if (typeof w != "function" || typeof _ != "function") throw TypeError("Not a function"); w(m); }); }), t(v, "reject", function(m) { return new this(function(b, w) { if (typeof b != "function" || typeof w != "function") throw TypeError("Not a function"); w(m); }); }), t(v, "all", function(m) { var b = this; return a.call(m) != "[object Array]" ? b.reject(TypeError("Not an array")) : m.length === 0 ? b.resolve([]) : new b(function(w, _) { if (typeof w != "function" || typeof _ != "function") throw TypeError("Not a function"); var k = m.length, T = Array(k), O = 0; h(b, m, function(M, C) { T[M] = C, ++O === k && w(T); }, _); }); }), t(v, "race", function(m) { var b = this; return a.call(m) != "[object Array]" ? b.reject(TypeError("Not an array")) : new b(function(w, _) { if (typeof w != "function" || typeof _ != "function") throw TypeError("Not a function"); h(b, m, function(k, T) { w(T); }, _); }); }), v; }); })(_H); var a4 = { exports: {} }, i4 = { exports: {} }; (function(e) { (function() { var t = { version: "3.8.0" }, n = [].slice, r = function(d) { return n.call(d); }, a = self.document; function i(d) { return d && (d.ownerDocument || d.document || d).documentElement; } function o(d) { return d && (d.ownerDocument && d.ownerDocument.defaultView || d.document && d || d.defaultView); } if (a) try { r(a.documentElement.childNodes)[0].nodeType; } catch { r = function(d) { for (var x = d.length, A = new Array(x); x--; ) A[x] = d[x]; return A; }; } if (Date.now || (Date.now = function() { return +/* @__PURE__ */ new Date(); }), a) try { a.createElement("DIV").style.setProperty("opacity", 0, ""); } catch { var l = this.Element.prototype, s = l.setAttribute, c = l.setAttributeNS, u = this.CSSStyleDeclaration.prototype, f = u.setProperty; l.setAttribute = function(d, x) { s.call(this, d, x + ""); }, l.setAttributeNS = function(d, x, A) { c.call(this, d, x, A + ""); }, u.setProperty = function(d, x, A) { f.call(this, d, x + "", A); }; } t.ascending = h; function h(d, x) { return d < x ? -1 : d > x ? 1 : d >= x ? 0 : NaN; } t.descending = function(d, x) { return x < d ? -1 : x > d ? 1 : x >= d ? 0 : NaN; }, t.min = function(d, x) { var A = -1, S = d.length, L, D; if (arguments.length === 1) { for (; ++A < S; ) if ((D = d[A]) != null && D >= D) { L = D; break; } for (; ++A < S; ) (D = d[A]) != null && L > D && (L = D); } else { for (; ++A < S; ) if ((D = x.call(d, d[A], A)) != null && D >= D) { L = D; break; } for (; ++A < S; ) (D = x.call(d, d[A], A)) != null && L > D && (L = D); } return L; }, t.max = function(d, x) { var A = -1, S = d.length, L, D; if (arguments.length === 1) { for (; ++A < S; ) if ((D = d[A]) != null && D >= D) { L = D; break; } for (; ++A < S; ) (D = d[A]) != null && D > L && (L = D); } else { for (; ++A < S; ) if ((D = x.call(d, d[A], A)) != null && D >= D) { L = D; break; } for (; ++A < S; ) (D = x.call(d, d[A], A)) != null && D > L && (L = D); } return L; }, t.extent = function(d, x) { var A = -1, S = d.length, L, D, V; if (arguments.length === 1) { for (; ++A < S; ) if ((D = d[A]) != null && D >= D) { L = V = D; break; } for (; ++A < S; ) (D = d[A]) != null && (L > D && (L = D), V < D && (V = D)); } else { for (; ++A < S; ) if ((D = x.call(d, d[A], A)) != null && D >= D) { L = V = D; break; } for (; ++A < S; ) (D = x.call(d, d[A], A)) != null && (L > D && (L = D), V < D && (V = D)); } return [L, V]; }; function g(d) { return d === null ? NaN : +d; } function p(d) { return !isNaN(d); } t.sum = function(d, x) { var A = 0, S = d.length, L, D = -1; if (arguments.length === 1) for (; ++D < S; ) p(L = +d[D]) && (A += L); else for (; ++D < S; ) p(L = +x.call(d, d[D], D)) && (A += L); return A; }, t.mean = function(d, x) { var A = 0, S = d.length, L, D = -1, V = S; if (arguments.length === 1) for (; ++D < S; ) p(L = g(d[D])) ? A += L : --V; else for (; ++D < S; ) p(L = g(x.call(d, d[D], D))) ? A += L : --V; if (V) return A / V; }, t.quantile = function(d, x) { var A = (d.length - 1) * x + 1, S = Math.floor(A), L = +d[S - 1], D = A - S; return D ? L + D * (d[S] - L) : L; }, t.median = function(d, x) { var A = [], S = d.length, L, D = -1; if (arguments.length === 1) for (; ++D < S; ) p(L = g(d[D])) && A.push(L); else for (; ++D < S; ) p(L = g(x.call(d, d[D], D))) && A.push(L); if (A.length) return t.quantile(A.sort(h), 0.5); }, t.variance = function(d, x) { var A = d.length, S = 0, L, D, V = 0, R = -1, Y = 0; if (arguments.length === 1) for (; ++R < A; ) p(L = g(d[R])) && (D = L - S, S += D / ++Y, V += D * (L - S)); else for (; ++R < A; ) p(L = g(x.call(d, d[R], R))) && (D = L - S, S += D / ++Y, V += D * (L - S)); if (Y > 1) return V / (Y - 1); }, t.deviation = function() { var d = t.variance.apply(this, arguments); return d && Math.sqrt(d); }; function v(d) { return { left: function(x, A, S, L) { for (arguments.length < 3 && (S = 0), arguments.length < 4 && (L = x.length); S < L; ) { var D = S + L >>> 1; d(x[D], A) < 0 ? S = D + 1 : L = D; } return S; }, right: function(x, A, S, L) { for (arguments.length < 3 && (S = 0), arguments.length < 4 && (L = x.length); S < L; ) { var D = S + L >>> 1; d(x[D], A) > 0 ? L = D : S = D + 1; } return S; } }; } var y = v(h); t.bisectLeft = y.left, t.bisect = t.bisectRight = y.right, t.bisector = function(d) { return v(d.length === 1 ? function(x, A) { return h(d(x), A); } : d); }, t.shuffle = function(d, x, A) { (S = arguments.length) < 3 && (A = d.length, S < 2 && (x = 0)); for (var S = A - x, L, D; S; ) D = Math.random() * S-- | 0, L = d[S + x], d[S + x] = d[D + x], d[D + x] = L; return d; }, t.permute = function(d, x) { for (var A = x.length, S = new Array(A); A--; ) S[A] = d[x[A]]; return S; }, t.pairs = function(d) { for (var x = 0, A = d.length - 1, S = d[0], L = new Array(A < 0 ? 0 : A); x < A; ) L[x] = [S, S = d[++x]]; return L; }, t.transpose = function(d) { if (!(D = d.length)) return []; for (var x = -1, A = t.min(d, m), S = new Array(A); ++x < A; ) for (var L = -1, D, V = S[x] = new Array(D); ++L < D; ) V[L] = d[L][x]; return S; }; function m(d) { return d.length; } t.zip = function() { return t.transpose(arguments); }, t.keys = function(d) { var x = []; for (var A in d) x.push(A); return x; }, t.values = function(d) { var x = []; for (var A in d) x.push(d[A]); return x; }, t.entries = function(d) { var x = []; for (var A in d) x.push({ key: A, value: d[A] }); return x; }, t.merge = function(d) { for (var x = d.length, A, S = -1, L = 0, D, V; ++S < x; ) L += d[S].length; for (D = new Array(L); --x >= 0; ) for (V = d[x], A = V.length; --A >= 0; ) D[--L] = V[A]; return D; }; var b = Math.abs; t.range = function(d, x, A) { if (arguments.length < 3 && (A = 1, arguments.length < 2 && (x = d, d = 0)), (x - d) / A === 1 / 0) throw new Error("infinite range"); var S = [], L = w(b(A)), D = -1, V; if (d *= L, x *= L, A *= L, A < 0) for (; (V = d + A * ++D) > x; ) S.push(V / L); else for (; (V = d + A * ++D) < x; ) S.push(V / L); return S; }; function w(d) { for (var x = 1; d * x % 1; ) x *= 10; return x; } function _(d, x) { for (var A in x) Object.defineProperty(d.prototype, A, { value: x[A], enumerable: !1 }); } t.map = function(d, x) { var A = new k(); if (d instanceof k) d.forEach(function(R, Y) { A.set(R, Y); }); else if (Array.isArray(d)) { var S = -1, L = d.length, D; if (arguments.length === 1) for (; ++S < L; ) A.set(S, d[S]); else for (; ++S < L; ) A.set(x.call(d, D = d[S], S), D); } else for (var V in d) A.set(V, d[V]); return A; }; function k() { this._ = /* @__PURE__ */ Object.create(null); } var T = "__proto__", O = "\0"; _(k, { has: I, get: function(d) { return this._[M(d)]; }, set: function(d, x) { return this._[M(d)] = x; }, remove: j, keys: P, values: function() { var d = []; for (var x in this._) d.push(this._[x]); return d; }, entries: function() { var d = []; for (var x in this._) d.push({ key: C(x), value: this._[x] }); return d; }, size: N, empty: W, forEach: function(d) { for (var x in this._) d.call(this, C(x), this._[x]); } }); function M(d) { return (d += "") === T || d[0] === O ? O + d : d; } function C(d) { return (d += "")[0] === O ? d.slice(1) : d; } function I(d) { return M(d) in this._; } function j(d) { return (d = M(d)) in this._ && delete this._[d]; } function P() { var d = []; for (var x in this._) d.push(C(x)); return d; } function N() { var d = 0; for (var x in this._) ++d; return d; } function W() { for (var d in this._) return !1; return !0; } t.nest = function() { var d = {}, x = [], A = [], S, L; function D(R, Y, ee) { if (ee >= x.length) return L ? L.call(d, Y) : S ? Y.sort(S) : Y; for (var ne = -1, ue = Y.length, fe = x[ee++], ke, Me, he, me = new k(), be; ++ne < ue; ) (be = me.get(ke = fe(Me = Y[ne]))) ? be.push(Me) : me.set(ke, [Me]); return R ? (Me = R(), he = function(Ae, Le) { Me.set(Ae, D(R, Le, ee)); }) : (Me = {}, he = function(Ae, Le) { Me[Ae] = D(R, Le, ee); }), me.forEach(he), Me; } function V(R, Y) { if (Y >= x.length) return R; var ee = [], ne = A[Y++]; return R.forEach(function(ue, fe) { ee.push({ key: ue, values: V(fe, Y) }); }), ne ? ee.sort(function(ue, fe) { return ne(ue.key, fe.key); }) : ee; } return d.map = function(R, Y) { return D(Y, R, 0); }, d.entries = function(R) { return V(D(t.map, R, 0), 0); }, d.key = function(R) { return x.push(R), d; }, d.sortKeys = function(R) { return A[x.length - 1] = R, d; }, d.sortValues = function(R) { return S = R, d; }, d.rollup = function(R) { return L = R, d; }, d; }, t.set = function(d) { var x = new J(); if (d) for (var A = 0, S = d.length; A < S; ++A) x.add(d[A]); return x; }; function J() { this._ = /* @__PURE__ */ Object.create(null); } _(J, { has: I, add: function(d) { return this._[M(d += "")] = !0, d; }, remove: j, values: P, size: N, empty: W, forEach: function(d) { for (var x in this._) d.call(this, C(x)); } }), t.behavior = {}; function U(d) { return d; } t.rebind = function(d, x) { for (var A = 1, S = arguments.length, L; ++A < S; ) d[L = arguments[A]] = E(d, x, x[L]); return d; }; function E(d, x, A) { return function() { var S = A.apply(x, arguments); return S === x ? d : S; }; } function z(d, x) { if (x in d) return x; x = x.charAt(0).toUpperCase() + x.slice(1); for (var A = 0, S = F.length; A < S; ++A) { var L = F[A] + x; if (L in d) return L; } } var F = ["webkit", "ms", "moz", "Moz", "o", "O"]; function q() { } t.dispatch = function() { for (var d = new H(), x = -1, A = arguments.length; ++x < A; ) d[arguments[x]] = K(d); return d; }; function H() { } H.prototype.on = function(d, x) { var A = d.indexOf("."), S = ""; if (A >= 0 && (S = d.slice(A + 1), d = d.slice(0, A)), d) return arguments.length < 2 ? this[d].on(S) : this[d].on(S, x); if (arguments.length === 2) { if (x == null) for (d in this) this.hasOwnProperty(d) && this[d].on(S, null); return this; } }; function K(d) { var x = [], A = new k(); function S() { for (var L = x, D = -1, V = L.length, R; ++D < V; ) (R = L[D].on) && R.apply(this, arguments); return d; } return S.on = function(L, D) { var V = A.get(L), R; return arguments.length < 2 ? V && V.on : (V && (V.on = null, x = x.slice(0, R = x.indexOf(V)).concat(x.slice(R + 1)), A.remove(L)), D && x.push(A.set(L, { on: D })), d); }, S; } t.event = null; function Q() { t.event.preventDefault(); } function re() { for (var d = t.event, x; x = d.sourceEvent; ) d = x; return d; } function te(d) { for (var x = new H(), A = 0, S = arguments.length; ++A < S; ) x[arguments[A]] = K(x); return x.of = function(L, D) { return function(V) { try { var R = V.sourceEvent = t.event; V.target = d, t.event = V, x[V.type].apply(L, D); } finally { t.event = R; } }; }, x; } t.requote = function(d) { return d.replace(X, "\\$&"); }; var X = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, ce = {}.__proto__ ? function(d, x) { d.__proto__ = x; } : function(d, x) { for (var A in x) d[A] = x[A]; }; function B(d) { return ce(d, ae), d; } var G = function(d, x) { return x.querySelector(d); }, Z = function(d, x) { return x.querySelectorAll(d); }, oe = function(d, x) { var A = d.matches || d[z(d, "matchesSelector")]; return oe = function(S, L) { return A.call(S, L); }, oe(d, x); }; typeof Sizzle == "function" && (G = function(d, x) { return Sizzle(d, x)[0] || null; }, Z = Sizzle, oe = Sizzle.matchesSelector), t.selection = function() { return t.select(a.documentElement); }; var ae = t.selection.prototype = []; ae.select = function(d) { var x = [], A, S, L, D; d = ge(d); for (var V = -1, R = this.length; ++V < R; ) { x.push(A = []), A.parentNode = (L = this[V]).parentNode; for (var Y = -1, ee = L.length; ++Y < ee; ) (D = L[Y]) ? (A.push(S = d.call(D, D.__data__, Y, V)), S && "__data__" in D && (S.__data__ = D.__data__)) : A.push(null); } return B(x); }; function ge(d) { return typeof d == "function" ? d : function() { return G(d, this); }; } ae.selectAll = function(d) { var x = [], A, S; d = ve(d); for (var L = -1, D = this.length; ++L < D; ) for (var V = this[L], R = -1, Y = V.length; ++R < Y; ) (S = V[R]) && (x.push(A = r(d.call(S, S.__data__, R, L))), A.parentNode = S); return B(x); }; function ve(d) { return typeof d == "function" ? d : function() { return Z(d, this); }; } var pe = "http://www.w3.org/1999/xhtml", ye = { svg: "http://www.w3.org/2000/svg", xhtml: pe, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; t.ns = { prefix: ye, qualify: function(d) { var x = d.indexOf(":"), A = d; return x >= 0 && (A = d.slice(0, x)) !== "xmlns" && (d = d.slice(x + 1)), ye.hasOwnProperty(A) ? { space: ye[A], local: d } : d; } }, ae.attr = function(d, x) { if (arguments.length < 2) { if (typeof d == "string") { var A = this.node(); return d = t.ns.qualify(d), d.local ? A.getAttributeNS(d.space, d.local) : A.getAttribute(d); } for (x in d) this.each(Oe(x, d[x])); return this; } return this.each(Oe(d, x)); }; function Oe(d, x) { d = t.ns.qualify(d); function A() { this.removeAttribute(d); } function S() { this.removeAttributeNS(d.space, d.local); } function L() { this.setAttribute(d, x); } function D() { this.setAttributeNS(d.space, d.local, x); } function V() { var Y = x.apply(this, arguments); Y == null ? this.removeAttribute(d) : this.setAttribute(d, Y); } function R() { var Y = x.apply(this, arguments); Y == null ? this.removeAttributeNS(d.space, d.local) : this.setAttributeNS(d.space, d.local, Y); } return x == null ? d.local ? S : A : typeof x == "function" ? d.local ? R : V : d.local ? D : L; } function Be(d) { return d.trim().replace(/\s+/g, " "); } ae.classed = function(d, x) { if (arguments.length < 2) { if (typeof d == "string") { var A = this.node(), S = (d = Fe(d)).length, L = -1; if (x = A.classList) { for (; ++L < S; ) if (!x.contains(d[L])) return !1; } else for (x = A.getAttribute("class"); ++L < S; ) if (!Ie(d[L]).test(x)) return !1; return !0; } for (x in d) this.each(Re(x, d[x])); return this; } return this.each(Re(d, x)); }; function Ie(d) { return new RegExp("(?:^|\\s+)" + t.requote(d) + "(?:\\s+|$)", "g"); } function Fe(d) { return (d + "").trim().split(/^|\s+/); } function Re(d, x) { d = Fe(d).map(We); var A = d.length; function S() { for (var D = -1; ++D < A; ) d[D](this, x); } function L() { for (var D = -1, V = x.apply(this, arguments); ++D < A; ) d[D](this, V); } return typeof x == "function" ? L : S; } function We(d) { var x = Ie(d); return function(A, S) { if (L = A.classList) return S ? L.add(d) : L.remove(d); var L = A.getAttribute("class") || ""; S ? (x.lastIndex = 0, x.test(L) || A.setAttribute("class", Be(L + " " + d))) : A.setAttribute("class", Be(L.replace(x, " "))); }; } ae.style = function(d, x, A) { var S = arguments.length; if (S < 3) { if (typeof d != "string") { S < 2 && (x = ""); for (A in d) this.each(Ce(A, d[A], x)); return this; } if (S < 2) { var L = this.node(); return o(L).getComputedStyle(L, null).getPropertyValue(d); } A = ""; } return this.each(Ce(d, x, A)); }; function Ce(d, x, A) { function S() { this.style.removeProperty(d); } function L() { this.style.setProperty(d, x, A); } function D() { var V = x.apply(this, arguments); V == null ? this.style.removeProperty(d) : this.style.setProperty(d, V, A); } return x == null ? S : typeof x == "function" ? D : L; } ae.property = function(d, x) { if (arguments.length < 2) { if (typeof d == "string") return this.node()[d]; for (x in d) this.each(Ve(x, d[x])); return this; } return this.each(Ve(d, x)); }; function Ve(d, x) { function A() { delete this[d]; } function S() { this[d] = x; } function L() { var D = x.apply(this, arguments); D == null ? delete this[d] : this[d] = D; } return x == null ? A : typeof x == "function" ? L : S; } ae.text = function(d) { return arguments.length ? this.each(typeof d == "function" ? function() { var x = d.apply(this, arguments); this.textContent = x ?? ""; } : d == null ? function() { this.textContent = ""; } : function() { this.textContent = d; }) : this.node().textContent; }, ae.html = function(d) { return arguments.length ? this.each(typeof d == "function" ? function() { var x = d.apply(this, arguments); this.innerHTML = x ?? ""; } : d == null ? function() { this.innerHTML = ""; } : function() { this.innerHTML = d; }) : this.node().innerHTML; }, ae.append = function(d) { return d = Ke(d), this.select(function() { return this.appendChild(d.apply(this, arguments)); }); }; function Ke(d) { function x() { var S = this.ownerDocument, L = this.namespaceURI; return L === pe && S.documentElement.namespaceURI === pe ? S.createElement(d) : S.createElementNS(L, d); } function A() { return this.ownerDocument.createElementNS(d.space, d.local); } return typeof d == "function" ? d : (d = t.ns.qualify(d)).local ? A : x; } ae.insert = function(d, x) { return d = Ke(d), x = ge(x), this.select(function() { return this.insertBefore(d.apply(this, arguments), x.apply(this, arguments) || null); }); }, ae.remove = function() { return this.each(Xe); }; function Xe() { var d = this.parentNode; d && d.removeChild(this); } ae.data = function(d, x) { var A = -1, S = this.length, L, D; if (!arguments.length) { for (d = new Array(S = (L = this[0]).length); ++A < S; ) (D = L[A]) && (d[A] = D.__data__); return d; } function V(ne, ue) { var fe, ke = ne.length, Me = ue.length, he = Math.min(ke, Me), me = new Array(Me), be = new Array(Me), Ae = new Array(ke), Le, _e; if (x) { var Ze = new k(), gt = new Array(ke), xt; for (fe = -1; ++fe < ke; ) (Le = ne[fe]) && (Ze.has(xt = x.call(Le, Le.__data__, fe)) ? Ae[fe] = Le : Ze.set(xt, Le), gt[fe] = xt); for (fe = -1; ++fe < Me; ) (Le = Ze.get(xt = x.call(ue, _e = ue[fe], fe))) ? Le !== !0 && (me[fe] = Le, Le.__data__ = _e) : be[fe] = ct(_e), Ze.set(xt, !0); for (fe = -1; ++fe < ke; ) fe in gt && Ze.get(gt[fe]) !== !0 && (Ae[fe] = ne[fe]); } else { for (fe = -1; ++fe < he; ) Le = ne[fe], _e = ue[fe], Le ? (Le.__data__ = _e, me[fe] = Le) : be[fe] = ct(_e); for (; fe < Me; ++fe) be[fe] = ct(ue[fe]); for (; fe < ke; ++fe) Ae[fe] = ne[fe]; } be.update = me, be.parentNode = me.parentNode = Ae.parentNode = ne.parentNode, R.push(be), Y.push(me), ee.push(Ae); } var R = dt([]), Y = B([]), ee = B([]); if (typeof d == "function") for (; ++A < S; ) V(L = this[A], d.call(L, L.parentNode.__data__, A)); else for (; ++A < S; ) V(L = this[A], d); return Y.enter = function() { return R; }, Y.exit = function() { return ee; }, Y; }; function ct(d) { return { __data__: d }; } ae.datum = function(d) { return arguments.length ? this.property("__data__", d) : this.property("__data__"); }, ae.filter = function(d) { var x = [], A, S, L; typeof d != "function" && (d = vt(d)); for (var D = 0, V = this.length; D < V; D++) { x.push(A = []), A.parentNode = (S = this[D]).parentNode; for (var R = 0, Y = S.length; R < Y; R++) (L = S[R]) && d.call(L, L.__data__, R, D) && A.push(L); } return B(x); }; function vt(d) { return function() { return oe(this, d); }; } ae.order = function() { for (var d = -1, x = this.length; ++d < x; ) for (var A = this[d], S = A.length - 1, L = A[S], D; --S >= 0; ) (D = A[S]) && (L && L !== D.nextSibling && L.parentNode.insertBefore(D, L), L = D); return this; }, ae.sort = function(d) { d = lt.apply(this, arguments); for (var x = -1, A = this.length; ++x < A; ) this[x].sort(d); return this.order(); }; function lt(d) { return arguments.length || (d = h), function(x, A) { return x && A ? d(x.__data__, A.__data__) : !x - !A; }; } ae.each = function(d) { return ut(this, function(x, A, S) { d.call(x, x.__data__, A, S); }); }; function ut(d, x) { for (var A = 0, S = d.length; A < S; A++) for (var L = d[A], D = 0, V = L.length, R; D < V; D++) (R = L[D]) && x(R, D, A); return d; } ae.call = function(d) { var x = r(arguments); return d.apply(x[0] = this, x), this; }, ae.empty = function() { return !this.node(); }, ae.node = function() { for (var d = 0, x = this.length; d < x; d++) for (var A = this[d], S = 0, L = A.length; S < L; S++) { var D = A[S]; if (D) return D; } return null; }, ae.size = function() { var d = 0; return ut(this, function() { ++d; }), d; }; function dt(d) { return ce(d, Pe), d; } var Pe = []; t.selection.enter = dt, t.selection.enter.prototype = Pe, Pe.append = ae.append, Pe.empty = ae.empty, Pe.node = ae.node, Pe.call = ae.call, Pe.size = ae.size, Pe.select = function(d) { for (var x = [], A, S, L, D, V, R = -1, Y = this.length; ++R < Y; ) { L = (D = this[R]).update, x.push(A = []), A.parentNode = D.parentNode; for (var ee = -1, ne = D.length; ++ee < ne; ) (V = D[ee]) ? (A.push(L[ee] = S = d.call(D.parentNode, V.__data__, ee, R)), S.__data__ = V.__data__) : A.push(null); } return B(x); }, Pe.insert = function(d, x) { return arguments.length < 2 && (x = ze(this)), ae.insert.call(this, d, x); }; function ze(d) { var x, A; return function(S, L, D) { var V = d[D].update, R = V.length, Y; for (D != A && (A = D, x = 0), L >= x && (x = L + 1); !(Y = V[x]) && ++x < R; ) ; return Y; }; } t.select = function(d) { var x; return typeof d == "string" ? (x = [G(d, a)], x.parentNode = a.documentElement) : (x = [d], x.parentNode = i(d)), B([x]); }, t.selectAll = function(d) { var x; return typeof d == "string" ? (x = r(Z(d, a)), x.parentNode = a.documentElement) : (x = r(d), x.parentNode = null), B([x]); }, ae.on = function(d, x, A) { var S = arguments.length; if (S < 3) { if (typeof d != "string") { S < 2 && (x = !1); for (A in d) this.each(Ne(A, d[A], x)); return this; } if (S < 2) return (S = this.node()["__on" + d]) && S._; A = !1; } return this.each(Ne(d, x, A)); }; function Ne(d, x, A) { var S = "__on" + d, L = d.indexOf("."), D = Qe; L > 0 && (d = d.slice(0, L)); var V = nt.get(d); V && (d = V, D = it); function R() { var ne = this[S]; ne && (this.removeEventListener(d, ne, ne.$), delete this[S]); } function Y() { var ne = D(x, r(arguments)); R.call(this), this.addEventListener(d, this[S] = ne, ne.$ = A), ne._ = x; } function ee() { var ne = new RegExp("^__on([^.]+)" + t.requote(d) + "$"), ue; for (var fe in this) if (ue = fe.match(ne)) { var ke = this[fe]; this.removeEventListener(ue[1], ke, ke.$), delete this[fe]; } } return L ? x ? Y : R : x ? q : ee; } var nt = t.map({ mouseenter: "mouseover", mouseleave: "mouseout" }); a && nt.forEach(function(d) { "on" + d in a && nt.remove(d); }); function Qe(d, x) { return function(A) { var S = t.event; t.event = A, x[0] = this.__data__; try { d.apply(this, x); } finally { t.event = S; } }; } function it(d, x) { var A = Qe(d, x); return function(S) { var L = this, D = S.relatedTarget; (!D || D !== L && !(D.compareDocumentPosition(L) & 8)) && A.call(L, S); }; } var rt, bt = 0; function je(d) { var x = ".dragsuppress-" + ++bt, A = "click" + x, S = t.select(o(d)).on("touchmove" + x, Q).on("dragstart" + x, Q).on("selectstart" + x, Q); if (rt == null && (rt = "onselectstart" in d ? !1 : z(d.style, "userSelect")), rt) { var L = i(d).style, D = L[rt]; L[rt] = "none"; } return function(V) { if (S.on(x, null), rt && (L[rt] = D), V) { var R = function() { S.on(A, null); }; S.on(A, function() { Q(), R(); }, !0), setTimeout(R, 0); } }; } t.mouse = function(d) { return pt(d, re()); }; var tt = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; function pt(d, x) { x.changedTouches && (x = x.changedTouches[0]); var A = d.ownerSVGElement || d; if (A.createSVGPoint) { var S = A.createSVGPoint(); if (tt < 0) { var L = o(d); if (L.scrollX || L.scrollY) { A = t.select("body").append("svg").style({ position: "absolute", top: 0, left: 0, margin: 0, padding: 0, border: "none" }, "important"); var D = A[0][0].getScreenCTM(); tt = !(D.f || D.e), A.remove(); } } return tt ? (S.x = x.pageX, S.y = x.pageY) : (S.x = x.clientX, S.y = x.clientY), S = S.matrixTransform(d.getScreenCTM().inverse()), [S.x, S.y]; } var V = d.getBoundingClientRect(); return [x.clientX - V.left - d.clientLeft, x.clientY - V.top - d.clientTop]; } t.touch = function(d, x, A) { if (arguments.length < 3 && (A = x, x = re().changedTouches), x) { for (var S = 0, L = x.length, D; S < L; ++S) if ((D = x[S]).identifier === A) return pt(d, D); } }, t.behavior.drag = function() { var d = te(L, "drag", "dragstart", "dragend"), x = null, A = D(q, t.mouse, o, "mousemove", "mouseup"), S = D(kt, t.touch, U, "touchmove", "touchend"); function L() { this.on("mousedown.drag", A).on("touchstart.drag", S); } function D(V, R, Y, ee, ne) { return function() { var ue = this, fe = t.event.target.correspondingElement || t.event.target, ke = ue.parentNode, Me = d.of(ue, arguments), he = 0, me = V(), be = ".drag" + (me == null ? "" : "-" + me), Ae, Le = t.select(Y(fe)).on(ee + be, gt).on(ne + be, xt), _e = je(fe), Ze = R(ke, me); x ? (Ae = x.apply(ue, arguments), Ae = [Ae.x - Ze[0], Ae.y - Ze[1]]) : Ae = [0, 0], Me({ type: "dragstart" }); function gt() { var mt = R(ke, me), St, Ct; mt && (St = mt[0] - Ze[0], Ct = mt[1] - Ze[1], he |= St | Ct, Ze = mt, Me({ type: "drag", x: mt[0] + Ae[0], y: mt[1] + Ae[1], dx: St, dy: Ct })); } function xt() { R(ke, me) && (Le.on(ee + be, null).on(ne + be, null), _e(he), Me({ type: "dragend" })); } }; } return L.origin = function(V) { return arguments.length ? (x = V, L) : x; }, t.rebind(L, d, "on"); }; function kt() { return t.event.changedTouches[0].identifier; } t.touches = function(d, x) { return arguments.length < 2 && (x = re().touches), x ? r(x).map(function(A) { var S = pt(d, A); return S.identifier = A.identifier, S; }) : []; }; var et = 1e-6, ft = et * et, $e = Math.PI, Lt = 2 * $e, $ = Lt - et, se = $e / 2, ie = $e / 180, de = 180 / $e; function Te(d, x, A) { return (x[0] - d[0]) * (A[1] - d[1]) - (x[1] - d[1]) * (A[0] - d[0]); } function xe(d) { return d > 1 ? se : d < -1 ? -se : Math.asin(d); } function Ge(d) { return ((d = Math.exp(d)) - 1 / d) / 2; } function qe(d) { return ((d = Math.exp(d)) + 1 / d) / 2; } function De(d) { return ((d = Math.exp(2 * d)) - 1) / (d + 1); } var le = Math.SQRT2, Se = 2, He = 4; t.interpolateZoom = function(d, x) { var A = d[0], S = d[1], L = d[2], D = x[0], V = x[1], R = x[2], Y = D - A, ee = V - S, ne = Y * Y + ee * ee, ue, fe; if (ne < ft) fe = Math.log(R / L) / le, ue = function(Ae) { return [A + Ae * Y, S + Ae * ee, L * Math.exp(le * Ae * fe)]; }; else { var ke = Math.sqrt(ne), Me = (R * R - L * L + He * ne) / (2 * L * Se * ke), he = (R * R - L * L - He * ne) / (2 * R * Se * ke), me = Math.log(Math.sqrt(Me * Me + 1) - Me), be = Math.log(Math.sqrt(he * he + 1) - he); fe = (be - me) / le, ue = function(Ae) { var Le = Ae * fe, _e = qe(me), Ze = L / (Se * ke) * (_e * De(le * Le + me) - Ge(me)); return [A + Ze * Y, S + Ze * ee, L * _e / qe(le * Le + me)]; }; } return ue.duration = fe * 1e3, ue; }, t.behavior.zoom = function() { var d = { x: 0, y: 0, k: 1 }, x, A, S, L = [960, 500], D = Je, V = 250, R = 0, Y = "mousedown.zoom", ee = "mousemove.zoom", ne = "mouseup.zoom", ue, fe = "touchstart.zoom", ke, Me = te(Le, "zoomstart", "zoom", "zoomend"), he, me, be, Ae; zt || (zt = "onwheel" in a ? (Dt = function() { return -t.event.deltaY * (t.event.deltaMode ? 120 : 1); }, "wheel") : "onmousewheel" in a ? (Dt = function() { return t.event.wheelDelta; }, "mousewheel") : (Dt = function() { return -t.event.detail; }, "MozMousePixelScroll")); function Le(ht) { ht.on(Y, Ut).on(zt + ".zoom", Kn).on("dblclick.zoom", _n).on(fe, yn); } Le.event = function(ht) { ht.each(function() { var Zt = Me.of(this, arguments), Qt = d; Al ? t.select(this).transition().each("start.zoom", function() { d = this.__chart__ || { x: 0, y: 0, k: 1 }, Ct(Zt); }).tween("zoom:zoom", function() { var xn = L[0], Gn = L[1], cr = A ? A[0] : xn / 2, Tr = A ? A[1] : Gn / 2, Er = t.interpolateZoom([(cr - d.x) / d.k, (Tr - d.y) / d.k, xn / d.k], [(cr - Qt.x) / Qt.k, (Tr - Qt.y) / Qt.k, xn / Qt.k]); return function(qr) { var jr = Er(qr), Xr = xn / jr[2]; this.__chart__ = d = { x: cr - jr[0] * Xr, y: Tr - jr[1] * Xr, k: Xr }, Wt(Zt); }; }).each("interrupt.zoom", function() { Ft(Zt); }).each("end.zoom", function() { Ft(Zt); }) : (this.__chart__ = d, Ct(Zt), Wt(Zt), Ft(Zt)); }); }, Le.translate = function(ht) { return arguments.length ? (d = { x: +ht[0], y: +ht[1], k: d.k }, St(), Le) : [d.x, d.y]; }, Le.scale = function(ht) { return arguments.length ? (d = { x: d.x, y: d.y, k: null }, gt(+ht), St(), Le) : d.k; }, Le.scaleExtent = function(ht) { return arguments.length ? (D = ht == null ? Je : [+ht[0], +ht[1]], Le) : D; }, Le.center = function(ht) { return arguments.length ? (S = ht && [+ht[0], +ht[1]], Le) : S; }, Le.size = function(ht) { return arguments.length ? (L = ht && [+ht[0], +ht[1]], Le) : L; }, Le.duration = function(ht) { return arguments.length ? (V = +ht, Le) : V; }, Le.x = function(ht) { return arguments.length ? (me = ht, he = ht.copy(), d = { x: 0, y: 0, k: 1 }, Le) : me; }, Le.y = function(ht) { return arguments.length ? (Ae = ht, be = ht.copy(), d = { x: 0, y: 0, k: 1 }, Le) : Ae; }; function _e(ht) { return [(ht[0] - d.x) / d.k, (ht[1] - d.y) / d.k]; } function Ze(ht) { return [ht[0] * d.k + d.x, ht[1] * d.k + d.y]; } function gt(ht) { d.k = Math.max(D[0], Math.min(D[1], ht)); } function xt(ht, Zt) { Zt = Ze(Zt), d.x += ht[0] - Zt[0], d.y += ht[1] - Zt[1]; } function mt(ht, Zt, Qt, xn) { ht.__chart__ = { x: d.x, y: d.y, k: d.k }, gt(Math.pow(2, xn)), xt(A = Zt, Qt), ht = t.select(ht), V > 0 && (ht = ht.transition().duration(V)), ht.call(Le.event); } function St() { me && me.domain(he.range().map(function(ht) { return (ht - d.x) / d.k; }).map(he.invert)), Ae && Ae.domain(be.range().map(function(ht) { return (ht - d.y) / d.k; }).map(be.invert)); } function Ct(ht) { R++ || ht({ type: "zoomstart" }); } function Wt(ht) { St(), ht({ type: "zoom", scale: d.k, translate: [d.x, d.y] }); } function Ft(ht) { --R || (ht({ type: "zoomend" }), A = null); } function Ut() { var ht = this, Zt = Me.of(ht, arguments), Qt = 0, xn = t.select(o(ht)).on(ee, Tr).on(ne, Er), Gn = _e(t.mouse(ht)), cr = je(ht); wf.call(ht), Ct(Zt); function Tr() { Qt = 1, xt(t.mouse(ht), Gn), Wt(Zt); } function Er() { xn.on(ee, null).on(ne, null), cr(Qt), Ft(Zt); } } function yn() { var ht = this, Zt = Me.of(ht, arguments), Qt = {}, xn = 0, Gn, cr = ".zoom-" + t.event.changedTouches[0].identifier, Tr = "touchmove" + cr, Er = "touchend" + cr, qr = [], jr = t.select(ht), Xr = je(ht); ea(), Ct(Zt), jr.on(Y, null).on(fe, ea); function Cr() { var ei = t.touches(ht); return Gn = d.k, ei.forEach(function(Ar) { Ar.identifier in Qt && (Qt[Ar.identifier] = _e(Ar)); }), ei; } function ea() { var ei = t.event.target; t.select(ei).on(Tr, Ml).on(Er, C7), qr.push(ei); for (var Ar = t.event.changedTouches, Ca = 0, Ai = Ar.length; Ca < Ai; ++Ca) Qt[Ar[Ca].identifier] = null; var La = Cr(), Ls = Date.now(); if (La.length === 1) { if (Ls - ke < 500) { var Sl = La[0]; mt(ht, Sl, Qt[Sl.identifier], Math.floor(Math.log(d.k) / Math.LN2) + 1), Q(); } ke = Ls; } else if (La.length > 1) { var Sl = La[0], zo = La[1], Tf = Sl[0] - zo[0], z2 = Sl[1] - zo[1]; xn = Tf * Tf + z2 * z2; } } function Ml() { var ei = t.touches(ht), Ar, Ca, Ai, La; wf.call(ht); for (var Ls = 0, Sl = ei.length; Ls < Sl; ++Ls, La = null) if (Ai = ei[Ls], La = Qt[Ai.identifier]) { if (Ca) break; Ar = Ai, Ca = La; } if (La) { var zo = (zo = Ai[0] - Ar[0]) * zo + (zo = Ai[1] - Ar[1]) * zo, Tf = xn && Math.sqrt(zo / xn); Ar = [(Ar[0] + Ai[0]) / 2, (Ar[1] + Ai[1]) / 2], Ca = [(Ca[0] + La[0]) / 2, (Ca[1] + La[1]) / 2], gt(Tf * Gn); } ke = null, xt(Ar, Ca), Wt(Zt); } function C7() { if (t.event.touches.length) { for (var ei = t.event.changedTouches, Ar = 0, Ca = ei.length; Ar < Ca; ++Ar) delete Qt[ei[Ar].identifier]; for (var Ai in Qt) return void Cr(); } t.selectAll(qr).on(cr, null), jr.on(Y, Ut).on(fe, yn), Xr(), Ft(Zt); } } function Kn() { var ht = Me.of(this, arguments); ue ? clearTimeout(ue) : (wf.call(this), x = _e(A = S || t.mouse(this)), Ct(ht)), ue = setTimeout(function() { ue = null, Ft(ht); }, 50), Q(), gt(Math.pow(2, Dt() * 2e-3) * d.k), xt(A, x), Wt(ht); } function _n() { var ht = t.mouse(this), Zt = Math.log(d.k) / Math.LN2; mt(this, ht, _e(ht), t.event.shiftKey ? Math.ceil(Zt) - 1 : Math.floor(Zt) + 1); } return t.rebind(Le, Me, "on"); }; var Je = [0, 1 / 0], Dt, zt; t.color = Pt; function Pt() { } Pt.prototype.toString = function() { return this.rgb() + ""; }, t.hsl = _t; function _t(d, x, A) { return this instanceof _t ? (this.h = +d, this.s = +x, void (this.l = +A)) : arguments.length < 2 ? d instanceof _t ? new _t(d.h, d.s, d.l) : Ja("" + d, to, _t) : new _t(d, x, A); } var $t = _t.prototype = new Pt(); $t.brighter = function(d) { return d = Math.pow(0.7, arguments.length ? d : 1), new _t(this.h, this.s, this.l / d); }, $t.darker = function(d) { return d = Math.pow(0.7, arguments.length ? d : 1), new _t(this.h, this.s, d * this.l); }, $t.rgb = function() { return Nt(this.h, this.s, this.l); }; function Nt(d, x, A) { var S, L; d = isNaN(d) ? 0 : (d %= 360) < 0 ? d + 360 : d, x = isNaN(x) || x < 0 ? 0 : x > 1 ? 1 : x, A = A < 0 ? 0 : A > 1 ? 1 : A, L = A <= 0.5 ? A * (1 + x) : A + x - A * x, S = 2 * A - L; function D(R) { return R > 360 ? R -= 360 : R < 0 && (R += 360), R < 60 ? S + (L - S) * R / 60 : R < 180 ? L : R < 240 ? S + (L - S) * (240 - R) / 60 : S; } function V(R) { return Math.round(D(R) * 255); } return new En(V(d + 120), V(d), V(d - 120)); } t.hcl = wt; function wt(d, x, A) { return this instanceof wt ? (this.h = +d, this.c = +x, void (this.l = +A)) : arguments.length < 2 ? d instanceof wt ? new wt(d.h, d.c, d.l) : d instanceof jt ? tn(d.l, d.a, d.b) : tn((d = lr((d = t.rgb(d)).r, d.g, d.b)).l, d.a, d.b) : new wt(d, x, A); } var Yt = wt.prototype = new Pt(); Yt.brighter = function(d) { return new wt(this.h, this.c, Math.min(100, this.l + Et * (arguments.length ? d : 1))); }, Yt.darker = function(d) { return new wt(this.h, this.c, Math.max(0, this.l - Et * (arguments.length ? d : 1))); }, Yt.rgb = function() { return Jt(this.h, this.c, this.l).rgb(); }; function Jt(d, x, A) { return isNaN(d) && (d = 0), isNaN(x) && (x = 0), new jt(A, Math.cos(d *= ie) * x, Math.sin(d) * x); } t.lab = jt; function jt(d, x, A) { return this instanceof jt ? (this.l = +d, this.a = +x, void (this.b = +A)) : arguments.length < 2 ? d instanceof jt ? new jt(d.l, d.a, d.b) : d instanceof wt ? Jt(d.h, d.c, d.l) : lr((d = En(d)).r, d.g, d.b) : new jt(d, x, A); } var Et = 18, At = 0.95047, Ot = 1, qt = 1.08883, dn = jt.prototype = new Pt(); dn.brighter = function(d) { return new jt(Math.min(100, this.l + Et * (arguments.length ? d : 1)), this.a, this.b); }, dn.darker = function(d) { return new jt(Math.max(0, this.l - Et * (arguments.length ? d : 1)), this.a, this.b); }, dn.rgb = function() { return Mt(this.l, this.a, this.b); }; function Mt(d, x, A) { var S = (d + 16) / 116, L = S + x / 500, D = S - A / 200; return L = Ht(L) * At, S = Ht(S) * Ot, D = Ht(D) * qt, new En(an(3.2404542 * L - 1.5371385 * S - 0.4985314 * D), an(-0.969266 * L + 1.8760108 * S + 0.041556 * D), an(0.0556434 * L - 0.2040259 * S + 1.0572252 * D)); } function tn(d, x, A) { return d > 0 ? new wt(Math.atan2(A, x) * de, Math.sqrt(x * x + A * A), d) : new wt(NaN, NaN, d); } function Ht(d) { return d > 0.206893034 ? d * d * d : (d - 4 / 29) / 7.787037; } function jn(d) { return d > 8856e-6 ? Math.pow(d, 1 / 3) : 7.787037 * d + 4 / 29; } function an(d) { return Math.round(255 * (d <= 304e-5 ? 12.92 * d : 1.055 * Math.pow(d, 1 / 2.4) - 0.055)); } t.rgb = En; function En(d, x, A) { return this instanceof En ? (this.r = ~~d, this.g = ~~x, void (this.b = ~~A)) : arguments.length < 2 ? d instanceof En ? new En(d.r, d.g, d.b) : Ja("" + d, En, Nt) : new En(d, x, A); } function Un(d) { return new En(d >> 16, d >> 8 & 255, d & 255); } function zr(d) { return Un(d) + ""; } var hr = En.prototype = new Pt(); hr.brighter = function(d) { d = Math.pow(0.7, arguments.length ? d : 1); var x = this.r, A = this.g, S = this.b, L = 30; return !x && !A && !S ? new En(L, L, L) : (x && x < L && (x = L), A && A < L && (A = L), S && S < L && (S = L), new En(Math.min(255, x / d), Math.min(255, A / d), Math.min(255, S / d))); }, hr.darker = function(d) { return d = Math.pow(0.7, arguments.length ? d : 1), new En(d * this.r, d * this.g, d * this.b); }, hr.hsl = function() { return to(this.r, this.g, this.b); }, hr.toString = function() { return "#" + pr(this.r) + pr(this.g) + pr(this.b); }; function pr(d) { return d < 16 ? "0" + Math.max(0, d).toString(16) : Math.min(255, d).toString(16); } function Ja(d, x, A) { var S = 0, L = 0, D = 0, V, R, Y; if (V = /([a-z]+)\((.*)\)/.exec(d = d.toLowerCase()), V) switch (R = V[2].split(","), V[1]) { case "hsl": return A(parseFloat(R[0]), parseFloat(R[1]) / 100, parseFloat(R[2]) / 100); case "rgb": return x(no(R[0]), no(R[1]), no(R[2])); } return (Y = Ta.get(d)) ? x(Y.r, Y.g, Y.b) : (d != null && d.charAt(0) === "#" && !isNaN(Y = parseInt(d.slice(1), 16)) && (d.length === 4 ? (S = (Y & 3840) >> 4, S = S >> 4 | S, L = Y & 240, L = L >> 4 | L, D = Y & 15, D = D << 4 | D) : d.length === 7 && (S = (Y & 16711680) >> 16, L = (Y & 65280) >> 8, D = Y & 255)), x(S, L, D)); } function to(d, x, A) { var S = Math.min(d /= 255, x /= 255, A /= 255), L = Math.max(d, x, A), D = L - S, V, R, Y = (L + S) / 2; return D ? (R = Y < 0.5 ? D / (L + S) : D / (2 - L - S), d == L ? V = (x - A) / D + (x < A ? 6 : 0) : x == L ? V = (A - d) / D + 2 : V = (d - x) / D + 4, V *= 60) : (V = NaN, R = Y > 0 && Y < 1 ? 0 : V), new _t(V, R, Y); } function lr(d, x, A) { d = Kr(d), x = Kr(x), A = Kr(A); var S = jn((0.4124564 * d + 0.3575761 * x + 0.1804375 * A) / At), L = jn((0.2126729 * d + 0.7151522 * x + 0.072175 * A) / Ot), D = jn((0.0193339 * d + 0.119192 * x + 0.9503041 * A) / qt); return jt(116 * L - 16, 500 * (S - L), 200 * (L - D)); } function Kr(d) { return (d /= 255) <= 0.04045 ? d / 12.92 : Math.pow((d + 0.055) / 1.055, 2.4); } function no(d) { var x = parseFloat(d); return d.charAt(d.length - 1) === "%" ? Math.round(x * 2.55) : x; } var Ta = t.map({ aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }); Ta.forEach(function(d, x) { Ta.set(d, Un(x)); }); function mn(d) { return typeof d == "function" ? d : function() { return d; }; } t.functor = mn, t.xhr = Aa(U); function Aa(d) { return function(x, A, S) { return arguments.length === 2 && typeof A == "function" && (S = A, A = null), Qa(x, A, d, S); }; } function Qa(d, x, A, S) { var L = {}, D = t.dispatch("beforesend", "progress", "load", "error"), V = {}, R = new XMLHttpRequest(), Y = null; self.XDomainRequest && !("withCredentials" in R) && /^(http(s)?:)?\/\//.test(d) && (R = new XDomainRequest()), "onload" in R ? R.onload = R.onerror = ee : R.onreadystatechange = function() { R.readyState > 3 && ee(); }; function ee() { var ne = R.status, ue; if (!ne && Pn(R) || ne >= 200 && ne < 300 || ne === 304) { try { ue = A.call(L, R); } catch (fe) { D.error.call(L, fe); return; } D.load.call(L, ue); } else D.error.call(L, R); } return R.onprogress = function(ne) { var ue = t.event; t.event = ne; try { D.progress.call(L, R); } finally { t.event = ue; } }, L.header = function(ne, ue) { return ne = (ne + "").toLowerCase(), arguments.length < 2 ? V[ne] : (ue == null ? delete V[ne] : V[ne] = ue + "", L); }, L.mimeType = function(ne) { return arguments.length ? (x = ne == null ? null : ne + "", L) : x; }, L.responseType = function(ne) { return arguments.length ? (Y = ne, L) : Y; }, L.response = function(ne) { return A = ne, L; }, ["get", "post"].forEach(function(ne) { L[ne] = function() { return L.send.apply(L, [ne].concat(r(arguments))); }; }), L.send = function(ne, ue, fe) { if (arguments.length === 2 && typeof ue == "function" && (fe = ue, ue = null), R.open(ne, d, !0), x != null && !("accept" in V) && (V.accept = x + ",*/*"), R.setRequestHeader) for (var ke in V) R.setRequestHeader(ke, V[ke]); return x != null && R.overrideMimeType && R.overrideMimeType(x), Y != null && (R.responseType = Y), fe != null && L.on("error", fe).on("load", function(Me) { fe(null, Me); }), D.beforesend.call(L, R), R.send(ue ?? null), L; }, L.abort = function() { return R.abort(), L; }, t.rebind(L, D, "on"), S == null ? L : L.get(ro(S)); } function ro(d) { return d.length === 1 ? function(x, A) { d(x == null ? A : null); } : d; } function Pn(d) { var x = d.responseType; return x && x !== "text" ? d.response : d.responseText; } t.dsv = function(d, x) { var A = new RegExp('["' + d + ` ]`), S = d.charCodeAt(0); function L(ee, ne, ue) { arguments.length < 3 && (ue = ne, ne = null); var fe = Qa(ee, x, ne == null ? D : V(ne), ue); return fe.row = function(ke) { return arguments.length ? fe.response((ne = ke) == null ? D : V(ke)) : ne; }, fe; } function D(ee) { return L.parse(ee.responseText); } function V(ee) { return function(ne) { return L.parse(ne.responseText, ee); }; } L.parse = function(ee, ne) { var ue; return L.parseRows(ee, function(fe, ke) { if (ue) return ue(fe, ke - 1); var Me = function(he) { for (var me = {}, be = fe.length, Ae = 0; Ae < be; ++Ae) me[fe[Ae]] = he[Ae]; return me; }; ue = ne ? function(he, me) { return ne(Me(he), me); } : Me; }); }, L.parseRows = function(ee, ne) { var ue = {}, fe = {}, ke = [], Me = ee.length, he = 0, me = 0, be, Ae; function Le() { if (he >= Me) return fe; if (Ae) return Ae = !1, ue; var Ze = he; if (ee.charCodeAt(Ze) === 34) { for (var gt = Ze; gt++ < Me; ) if (ee.charCodeAt(gt) === 34) { if (ee.charCodeAt(gt + 1) !== 34) break; ++gt; } he = gt + 2; var xt = ee.charCodeAt(gt + 1); return xt === 13 ? (Ae = !0, ee.charCodeAt(gt + 2) === 10 && ++he) : xt === 10 && (Ae = !0), ee.slice(Ze + 1, gt).replace(/""/g, '"'); } for (; he < Me; ) { var xt = ee.charCodeAt(he++), mt = 1; if (xt === 10) Ae = !0; else if (xt === 13) Ae = !0, ee.charCodeAt(he) === 10 && (++he, ++mt); else if (xt !== S) continue; return ee.slice(Ze, he - mt); } return ee.slice(Ze); } for (; (be = Le()) !== fe; ) { for (var _e = []; be !== ue && be !== fe; ) _e.push(be), be = Le(); ne && (_e = ne(_e, me++)) == null || ke.push(_e); } return ke; }, L.format = function(ee) { if (Array.isArray(ee[0])) return L.formatRows(ee); var ne = new J(), ue = []; return ee.forEach(function(fe) { for (var ke in fe) ne.has(ke) || ue.push(ne.add(ke)); }), [ue.map(Y).join(d)].concat(ee.map(function(fe) { return ue.map(function(ke) { return Y(fe[ke]); }).join(d); })).join(` `); }, L.formatRows = function(ee) { return ee.map(R).join(` `); }; function R(ee) { return ee.map(Y).join(d); } function Y(ee) { return A.test(ee) ? '"' + ee.replace(/\"/g, '""') + '"' : ee; } return L; }, t.csv = t.dsv(",", "text/csv"), t.tsv = t.dsv(" ", "text/tab-separated-values"); var nr, Jr, Ma, ki, Qr = this[z(this, "requestAnimationFrame")] || function(d) { setTimeout(d, 17); }; t.timer = function() { ha.apply(this, arguments); }; function ha(d, x, A) { var S = arguments.length; S < 2 && (x = 0), S < 3 && (A = Date.now()); var L = A + x, D = { c: d, t: L, n: null }; return Jr ? Jr.n = D : nr = D, Jr = D, Ma || (ki = clearTimeout(ki), Ma = 1, Qr(_s)), D; } function _s() { var d = of(), x = kb() - d; x > 24 ? (isFinite(x) && (clearTimeout(ki), ki = setTimeout(_s, x)), Ma = 0) : (Ma = 1, Qr(_s)); } t.timer.flush = function() { of(), kb(); }; function of() { for (var d = Date.now(), x = nr; x; ) d >= x.t && x.c(d - x.t) && (x.c = null), x = x.n; return d; } function kb() { for (var d, x = nr, A = 1 / 0; x; ) x.c ? (x.t < A && (A = x.t), x = (d = x).n) : x = d ? d.n = x.n : nr = x.n; return Jr = d, A; } t.round = function(d, x) { return x ? Math.round(d * (x = Math.pow(10, x))) / x : Math.round(d); }, t.geom = {}; function ks(d) { return d[0]; } function au(d) { return d[1]; } t.geom.hull = function(d) { var x = ks, A = au; if (arguments.length) return S(d); function S(L) { if (L.length < 3) return []; var D = mn(x), V = mn(A), R, Y = L.length, ee = [], ne = []; for (R = 0; R < Y; R++) ee.push([+D.call(this, L[R], R), +V.call(this, L[R], R), R]); for (ee.sort(FD), R = 0; R < Y; R++) ne.push([ee[R][0], -ee[R][1]]); var ue = Tb(ee), fe = Tb(ne), ke = fe[0] === ue[0], Me = fe[fe.length - 1] === ue[ue.length - 1], he = []; for (R = ue.length - 1; R >= 0; --R) he.push(L[ee[ue[R]][2]]); for (R = +ke; R < fe.length - Me; ++R) he.push(L[ee[fe[R]][2]]); return he; } return S.x = function(L) { return arguments.length ? (x = L, S) : x; }, S.y = function(L) { return arguments.length ? (A = L, S) : A; }, S; }; function Tb(d) { for (var x = d.length, A = [0, 1], S = 2, L = 2; L < x; L++) { for (; S > 1 && Te(d[A[S - 2]], d[A[S - 1]], d[L]) <= 0; ) --S; A[S++] = L; } return A.slice(0, S); } function FD(d, x) { return d[0] - x[0] || d[1] - x[1]; } t.geom.polygon = function(d) { return ce(d, lf), d; }; var lf = t.geom.polygon.prototype = []; lf.area = function() { for (var d = -1, x = this.length, A, S = this[x - 1], L = 0; ++d < x; ) A = S, S = this[d], L += A[1] * S[0] - A[0] * S[1]; return L * 0.5; }, lf.centroid = function(d) { var x = -1, A = this.length, S = 0, L = 0, D, V = this[A - 1], R; for (arguments.length || (d = -1 / (6 * this.area())); ++x < A; ) D = V, V = this[x], R = D[0] * V[1] - V[0] * D[1], S += (D[0] + V[0]) * R, L += (D[1] + V[1]) * R; return [S * d, L * d]; }, lf.clip = function(d) { for (var x, A = Ab(d), S = -1, L = this.length - Ab(this), D, V, R = this[L - 1], Y, ee, ne; ++S < L; ) { for (x = d.slice(), d.length = 0, Y = this[S], ee = x[(V = x.length - A) - 1], D = -1; ++D < V; ) ne = x[D], eg(ne, R, Y) ? (eg(ee, R, Y) || d.push(tg(ee, ne, R, Y)), d.push(ne)) : eg(ee, R, Y) && d.push(tg(ee, ne, R, Y)), ee = ne; A && d.push(d[0]), R = Y; } return d; }; function eg(d, x, A) { return (A[0] - x[0]) * (d[1] - x[1]) < (A[1] - x[1]) * (d[0] - x[0]); } function tg(d, x, A, S) { var L = d[0], D = A[0], V = x[0] - L, R = S[0] - D, Y = d[1], ee = A[1], ne = x[1] - Y, ue = S[1] - ee, fe = (R * (Y - ee) - ue * (L - D)) / (ue * V - R * ne); return [L + fe * V, Y + fe * ne]; } function Ab(d) { var x = d[0], A = d[d.length - 1]; return !(x[0] - A[0] || x[1] - A[1]); } var Ts, kl, As, Mb = [], ng, iu, Sb = []; function ID() { uf(this), this.edge = this.site = this.circle = null; } function Cb(d) { var x = Mb.pop() || new ID(); return x.site = d, x; } function rg(d) { Ss(d), As.remove(d), Mb.push(d), uf(d); } function zD(d) { var x = d.circle, A = x.x, S = x.cy, L = { x: A, y: S }, D = d.P, V = d.N, R = [d]; rg(d); for (var Y = D; Y.circle && b(A - Y.circle.x) < et && b(S - Y.circle.cy) < et; ) D = Y.P, R.unshift(Y), rg(Y), Y = D; R.unshift(Y), Ss(Y); for (var ee = V; ee.circle && b(A - ee.circle.x) < et && b(S - ee.circle.cy) < et; ) V = ee.N, R.push(ee), rg(ee), ee = V; R.push(ee), Ss(ee); var ne = R.length, ue; for (ue = 1; ue < ne; ++ue) ee = R[ue], Y = R[ue - 1], sf(ee.edge, Y.site, ee.site, L); Y = R[0], ee = R[ne - 1], ee.edge = ou(Y.site, ee.site, null, L), Ms(Y), Ms(ee); } function ED(d) { for (var x = d.x, A = d.y, S, L, D, V, R = As._; R; ) if (D = Lb(R, A) - x, D > et) R = R.L; else if (V = x - jD(R, A), V > et) { if (!R.R) { S = R; break; } R = R.R; } else { D > -et ? (S = R.P, L = R) : V > -et ? (S = R, L = R.N) : S = L = R; break; } var Y = Cb(d); if (As.insert(S, Y), !(!S && !L)) { if (S === L) { Ss(S), L = Cb(S.site), As.insert(Y, L), Y.edge = L.edge = ou(S.site, Y.site), Ms(S), Ms(L); return; } if (!L) { Y.edge = ou(S.site, Y.site); return; } Ss(S), Ss(L); var ee = S.site, ne = ee.x, ue = ee.y, fe = d.x - ne, ke = d.y - ue, Me = L.site, he = Me.x - ne, me = Me.y - ue, be = 2 * (fe * me - ke * he), Ae = fe * fe + ke * ke, Le = he * he + me * me, _e = { x: (me * Ae - ke * Le) / be + ne, y: (fe * Le - he * Ae) / be + ue }; sf(L.edge, ee, Me, _e), Y.edge = ou(ee, d, null, _e), L.edge = ou(d, Me, null, _e), Ms(S), Ms(L); } } function Lb(d, x) { var A = d.site, S = A.x, L = A.y, D = L - x; if (!D) return S; var V = d.P; if (!V) return -1 / 0; A = V.site; var R = A.x, Y = A.y, ee = Y - x; if (!ee) return R; var ne = R - S, ue = 1 / D - 1 / ee, fe = ne / ee; return ue ? (-fe + Math.sqrt(fe * fe - 2 * ue * (ne * ne / (-2 * ee) - Y + ee / 2 + L - D / 2))) / ue + S : (S + R) / 2; } function jD(d, x) { var A = d.N; if (A) return Lb(A, x); var S = d.site; return S.y === x ? S.x : 1 / 0; } function Ob(d) { this.site = d, this.edges = []; } Ob.prototype.prepare = function() { for (var d = this.edges, x = d.length, A; x--; ) A = d[x].edge, (!A.b || !A.a) && d.splice(x, 1); return d.sort(Db), d.length; }; function PD(d) { for (var x = d[0][0], A = d[1][0], S = d[0][1], L = d[1][1], D, V, R, Y, ee = kl, ne = ee.length, ue, fe, ke, Me, he, me; ne--; ) if (ue = ee[ne], !(!ue || !ue.prepare())) for (ke = ue.edges, Me = ke.length, fe = 0; fe < Me; ) me = ke[fe].end(), R = me.x, Y = me.y, he = ke[++fe % Me].start(), D = he.x, V = he.y, (b(R - D) > et || b(Y - V) > et) && (ke.splice(fe, 0, new cf(VD(ue.site, me, b(R - x) < et && L - Y > et ? { x, y: b(D - x) < et ? V : L } : b(Y - L) < et && A - R > et ? { x: b(V - L) < et ? D : A, y: L } : b(R - A) < et && Y - S > et ? { x: A, y: b(D - A) < et ? V : S } : b(Y - S) < et && R - x > et ? { x: b(V - S) < et ? D : x, y: S } : null), ue.site, null)), ++Me); } function Db(d, x) { return x.angle - d.angle; } function RD() { uf(this), this.x = this.y = this.arc = this.site = this.cy = null; } function Ms(d) { var x = d.P, A = d.N; if (!(!x || !A)) { var S = x.site, L = d.site, D = A.site; if (S !== D) { var V = L.x, R = L.y, Y = S.x - V, ee = S.y - R, ne = D.x - V, ue = D.y - R, fe = 2 * (Y * ue - ee * ne); if (!(fe >= -ft)) { var ke = Y * Y + ee * ee, Me = ne * ne + ue * ue, he = (ue * ke - ee * Me) / fe, me = (Y * Me - ne * ke) / fe, ue = me + R, be = Sb.pop() || new RD(); be.arc = d, be.site = L, be.x = he + V, be.y = ue + Math.sqrt(he * he + me * me), be.cy = ue, d.circle = be; for (var Ae = null, Le = iu._; Le; ) if (be.y < Le.y || be.y === Le.y && be.x <= Le.x) if (Le.L) Le = Le.L; else { Ae = Le.P; break; } else if (Le.R) Le = Le.R; else { Ae = Le; break; } iu.insert(Ae, be), Ae || (ng = be); } } } } function Ss(d) { var x = d.circle; x && (x.P || (ng = x.N), iu.remove(x), Sb.push(x), uf(x), d.circle = null); } function ND(d, x, A, S) { return function(L) { var D = L.a, V = L.b, R = D.x, Y = D.y, ee = V.x, ne = V.y, ue = 0, fe = 1, ke = ee - R, Me = ne - Y, he; if (he = d - R, !(!ke && he > 0)) { if (he /= ke, ke < 0) { if (he < ue) return; he < fe && (fe = he); } else if (ke > 0) { if (he > fe) return; he > ue && (ue = he); } if (he = A - R, !(!ke && he < 0)) { if (he /= ke, ke < 0) { if (he > fe) return; he > ue && (ue = he); } else if (ke > 0) { if (he < ue) return; he < fe && (fe = he); } if (he = x - Y, !(!Me && he > 0)) { if (he /= Me, Me < 0) { if (he < ue) return; he < fe && (fe = he); } else if (Me > 0) { if (he > fe) return; he > ue && (ue = he); } if (he = S - Y, !(!Me && he < 0)) { if (he /= Me, Me < 0) { if (he > fe) return; he > ue && (ue = he); } else if (Me > 0) { if (he < ue) return; he < fe && (fe = he); } return ue > 0 && (L.a = { x: R + ue * ke, y: Y + ue * Me }), fe < 1 && (L.b = { x: R + fe * ke, y: Y + fe * Me }), L; } } } } }; } function BD(d) { for (var x = Ts, A = ND(d[0][0], d[0][1], d[1][0], d[1][1]), S = x.length, L; S--; ) L = x[S], (!HD(L, d) || !A(L) || b(L.a.x - L.b.x) < et && b(L.a.y - L.b.y) < et) && (L.a = L.b = null, x.splice(S, 1)); } function HD(d, x) { var A = d.b; if (A) return !0; var S = d.a, L = x[0][0], D = x[1][0], V = x[0][1], R = x[1][1], Y = d.l, ee = d.r, ne = Y.x, ue = Y.y, fe = ee.x, ke = ee.y, Me = (ne + fe) / 2, he = (ue + ke) / 2, me, be; if (ke === ue) { if (Me < L || Me >= D) return; if (ne > fe) { if (!S) S = { x: Me, y: V }; else if (S.y >= R) return; A = { x: Me, y: R }; } else { if (!S) S = { x: Me, y: R }; else if (S.y < V) return; A = { x: Me, y: V }; } } else if (me = (ne - fe) / (ke - ue), be = he - me * Me, me < -1 || me > 1) if (ne > fe) { if (!S) S = { x: (V - be) / me, y: V }; else if (S.y >= R) return; A = { x: (R - be) / me, y: R }; } else { if (!S) S = { x: (R - be) / me, y: R }; else if (S.y < V) return; A = { x: (V - be) / me, y: V }; } else if (ue < ke) { if (!S) S = { x: L, y: me * L + be }; else if (S.x >= D) return; A = { x: D, y: me * D + be }; } else { if (!S) S = { x: D, y: me * D + be }; else if (S.x < L) return; A = { x: L, y: me * L + be }; } return d.a = S, d.b = A, !0; } function Fb(d, x) { this.l = d, this.r = x, this.a = this.b = null; } function ou(d, x, A, S) { var L = new Fb(d, x); return Ts.push(L), A && sf(L, d, x, A), S && sf(L, x, d, S), kl[d.i].edges.push(new cf(L, d, x)), kl[x.i].edges.push(new cf(L, x, d)), L; } function VD(d, x, A) { var S = new Fb(d, null); return S.a = x, S.b = A, Ts.push(S), S; } function sf(d, x, A, S) { !d.a && !d.b ? (d.a = S, d.l = x, d.r = A) : d.l === A ? d.b = S : d.a = S; } function cf(d, x, A) { var S = d.a, L = d.b; this.edge = d, this.site = x, this.angle = A ? Math.atan2(A.y - x.y, A.x - x.x) : d.l === x ? Math.atan2(L.x - S.x, S.y - L.y) : Math.atan2(S.x - L.x, L.y - S.y); } cf.prototype = { start: function() { return this.edge.l === this.site ? this.edge.a : this.edge.b; }, end: function() { return this.edge.l === this.site ? this.edge.b : this.edge.a; } }; function ag() { this._ = null; } function uf(d) { d.U = d.C = d.L = d.R = d.P = d.N = null; } ag.prototype = { insert: function(d, x) { var A, S, L; if (d) { if (x.P = d, x.N = d.N, d.N && (d.N.P = x), d.N = x, d.R) { for (d = d.R; d.L; ) d = d.L; d.L = x; } else d.R = x; A = d; } else this._ ? (d = Ib(this._), x.P = null, x.N = d, d.P = d.L = x, A = d) : (x.P = x.N = null, this._ = x, A = null); for (x.L = x.R = null, x.U = A, x.C = !0, d = x; A && A.C; ) S = A.U, A === S.L ? (L = S.R, L && L.C ? (A.C = L.C = !1, S.C = !0, d = S) : (d === A.R && (lu(this, A), d = A, A = d.U), A.C = !1, S.C = !0, su(this, S))) : (L = S.L, L && L.C ? (A.C = L.C = !1, S.C = !0, d = S) : (d === A.L && (su(this, A), d = A, A = d.U), A.C = !1, S.C = !0, lu(this, S))), A = d.U; this._.C = !1; }, remove: function(d) { d.N && (d.N.P = d.P), d.P && (d.P.N = d.N), d.N = d.P = null; var x = d.U, A, S = d.L, L = d.R, D, V; if (S ? L ? D = Ib(L) : D = S : D = L, x ? x.L === d ? x.L = D : x.R = D : this._ = D, S && L ? (V = D.C, D.C = d.C, D.L = S, S.U = D, D !== L ? (x = D.U, D.U = d.U, d = D.R, x.L = d, D.R = L, L.U = D) : (D.U = x, x = D, d = D.R)) : (V = d.C, d = D), d && (d.U = x), !V) { if (d && d.C) { d.C = !1; return; } do { if (d === this._) break; if (d === x.L) { if (A = x.R, A.C && (A.C = !1, x.C = !0, lu(this, x), A = x.R), A.L && A.L.C || A.R && A.R.C) { (!A.R || !A.R.C) && (A.L.C = !1, A.C = !0, su(this, A), A = x.R), A.C = x.C, x.C = A.R.C = !1, lu(this, x), d = this._; break; } } else if (A = x.L, A.C && (A.C = !1, x.C = !0, su(this, x), A = x.L), A.L && A.L.C || A.R && A.R.C) { (!A.L || !A.L.C) && (A.R.C = !1, A.C = !0, lu(this, A), A = x.L), A.C = x.C, x.C = A.L.C = !1, su(this, x), d = this._; break; } A.C = !0, d = x, x = x.U; } while (!d.C); d && (d.C = !1); } } }; function lu(d, x) { var A = x, S = x.R, L = A.U; L ? L.L === A ? L.L = S : L.R = S : d._ = S, S.U = L, A.U = S, A.R = S.L, A.R && (A.R.U = A), S.L = A; } function su(d, x) { var A = x, S = x.L, L = A.U; L ? L.L === A ? L.L = S : L.R = S : d._ = S, S.U = L, A.U = S, A.L = S.R, A.L && (A.L.U = A), S.R = A; } function Ib(d) { for (; d.L; ) d = d.L; return d; } function ig(d, x) { var A = d.sort(qD).pop(), S, L, D; for (Ts = [], kl = new Array(d.length), As = new ag(), iu = new ag(); ; ) if (D = ng, A && (!D || A.y < D.y || A.y === D.y && A.x < D.x)) (A.x !== S || A.y !== L) && (kl[A.i] = new Ob(A), ED(A), S = A.x, L = A.y), A = d.pop(); else if (D) zD(D.arc); else break; x && (BD(x), PD(x)); var V = { cells: kl, edges: Ts }; return As = iu = Ts = kl = null, V; } function qD(d, x) { return x.y - d.y || x.x - d.x; } t.geom.voronoi = function(d) { var x = ks, A = au, S = x, L = A, D = df; if (d) return V(d); function V(Y) { var ee = new Array(Y.length), ne = D[0][0], ue = D[0][1], fe = D[1][0], ke = D[1][1]; return ig(R(Y), D).cells.forEach(function(Me, he) { var me = Me.edges, be = Me.site, Ae = ee[he] = me.length ? me.map(function(Le) { var _e = Le.start(); return [_e.x, _e.y]; }) : be.x >= ne && be.x <= fe && be.y >= ue && be.y <= ke ? [[ne, ke], [fe, ke], [fe, ue], [ne, ue]] : []; Ae.point = Y[he]; }), ee; } function R(Y) { return Y.map(function(ee, ne) { return { x: Math.round(S(ee, ne) / et) * et, y: Math.round(L(ee, ne) / et) * et, i: ne }; }); } return V.links = function(Y) { return ig(R(Y)).edges.filter(function(ee) { return ee.l && ee.r; }).map(function(ee) { return { source: Y[ee.l.i], target: Y[ee.r.i] }; }); }, V.triangles = function(Y) { var ee = []; return ig(R(Y)).cells.forEach(function(ne, ue) { for (var fe = ne.site, ke = ne.edges.sort(Db), Me = -1, he = ke.length, me, be = ke[he - 1].edge, Ae = be.l === fe ? be.r : be.l; ++Me < he; ) me = Ae, be = ke[Me].edge, Ae = be.l === fe ? be.r : be.l, ue < me.i && ue < Ae.i && UD(fe, me, Ae) < 0 && ee.push([Y[ue], Y[me.i], Y[Ae.i]]); }), ee; }, V.x = function(Y) { return arguments.length ? (S = mn(x = Y), V) : x; }, V.y = function(Y) { return arguments.length ? (L = mn(A = Y), V) : A; }, V.clipExtent = function(Y) { return arguments.length ? (D = Y ?? df, V) : D === df ? null : D; }, V.size = function(Y) { return arguments.length ? V.clipExtent(Y && [[0, 0], Y]) : D === df ? null : D && D[1]; }, V; }; var df = [[-1e6, -1e6], [1e6, 1e6]]; function UD(d, x, A) { return (d.x - A.x) * (x.y - d.y) - (d.x - x.x) * (A.y - d.y); } t.geom.delaunay = function(d) { return t.geom.voronoi().triangles(d); }, t.geom.quadtree = function(d, x, A, S, L) { var D = ks, V = au, R; if (R = arguments.length) return D = GD, V = WD, R === 3 && (L = A, S = x, A = x = 0), Y(d); function Y(ee) { var ne, ue = mn(D), fe = mn(V), ke, Me, he, me, be, Ae, Le, _e; if (x != null) be = x, Ae = A, Le = S, _e = L; else if (Le = _e = -(be = Ae = 1 / 0), ke = [], Me = [], me = ee.length, R) for (he = 0; he < me; ++he) ne = ee[he], ne.x < be && (be = ne.x), ne.y < Ae && (Ae = ne.y), ne.x > Le && (Le = ne.x), ne.y > _e && (_e = ne.y), ke.push(ne.x), Me.push(ne.y); else for (he = 0; he < me; ++he) { var Ze = +ue(ne = ee[he], he), gt = +fe(ne, he); Ze < be && (be = Ze), gt < Ae && (Ae = gt), Ze > Le && (Le = Ze), gt > _e && (_e = gt), ke.push(Ze), Me.push(gt); } var xt = Le - be, mt = _e - Ae; xt > mt ? _e = Ae + xt : Le = be + mt; function St(Ft, Ut, yn, Kn, _n, ht, Zt, Qt) { if (!(isNaN(yn) || isNaN(Kn))) if (Ft.leaf) { var xn = Ft.x, Gn = Ft.y; if (xn != null) if (b(xn - yn) + b(Gn - Kn) < 0.01) Ct(Ft, Ut, yn, Kn, _n, ht, Zt, Qt); else { var cr = Ft.point; Ft.x = Ft.y = Ft.point = null, Ct(Ft, cr, xn, Gn, _n, ht, Zt, Qt), Ct(Ft, Ut, yn, Kn, _n, ht, Zt, Qt); } else Ft.x = yn, Ft.y = Kn, Ft.point = Ut; } else Ct(Ft, Ut, yn, Kn, _n, ht, Zt, Qt); } function Ct(Ft, Ut, yn, Kn, _n, ht, Zt, Qt) { var xn = (_n + Zt) * 0.5, Gn = (ht + Qt) * 0.5, cr = yn >= xn, Tr = Kn >= Gn, Er = Tr << 1 | cr; Ft.leaf = !1, Ft = Ft.nodes[Er] || (Ft.nodes[Er] = zb()), cr ? _n = xn : Zt = xn, Tr ? ht = Gn : Qt = Gn, St(Ft, Ut, yn, Kn, _n, ht, Zt, Qt); } var Wt = zb(); if (Wt.add = function(Ft) { St(Wt, Ft, +ue(Ft, ++he), +fe(Ft, he), be, Ae, Le, _e); }, Wt.visit = function(Ft) { cu(Ft, Wt, be, Ae, Le, _e); }, Wt.find = function(Ft) { return ZD(Wt, Ft[0], Ft[1], be, Ae, Le, _e); }, he = -1, x == null) { for (; ++he < me; ) St(Wt, ee[he], ke[he], Me[he], be, Ae, Le, _e); --he; } else ee.forEach(Wt.add); return ke = Me = ee = ne = null, Wt; } return Y.x = function(ee) { return arguments.length ? (D = ee, Y) : D; }, Y.y = function(ee) { return arguments.length ? (V = ee, Y) : V; }, Y.extent = function(ee) { return arguments.length ? (ee == null ? x = A = S = L = null : (x = +ee[0][0], A = +ee[0][1], S = +ee[1][0], L = +ee[1][1]), Y) : x == null ? null : [[x, A], [S, L]]; }, Y.size = function(ee) { return arguments.length ? (ee == null ? x = A = S = L = null : (x = A = 0, S = +ee[0], L = +ee[1]), Y) : x == null ? null : [S - x, L - A]; }, Y; }; function GD(d) { return d.x; } function WD(d) { return d.y; } function zb() { return { leaf: !0, nodes: [], point: null, x: null, y: null }; } function cu(d, x, A, S, L, D) { if (!d(x, A, S, L, D)) { var V = (A + L) * 0.5, R = (S + D) * 0.5, Y = x.nodes; Y[0] && cu(d, Y[0], A, S, V, R), Y[1] && cu(d, Y[1], V, S, L, R), Y[2] && cu(d, Y[2], A, R, V, D), Y[3] && cu(d, Y[3], V, R, L, D); } } function ZD(d, x, A, S, L, D, V) { var R = 1 / 0, Y; return function ee(ne, ue, fe, ke, Me) { if (!(ue > D || fe > V || ke < S || Me < L)) { if (he = ne.point) { var he, me = x - ne.x, be = A - ne.y, Ae = me * me + be * be; if (Ae < R) { var Le = Math.sqrt(R = Ae); S = x - Le, L = A - Le, D = x + Le, V = A + Le, Y = he; } } for (var _e = ne.nodes, Ze = (ue + ke) * 0.5, gt = (fe + Me) * 0.5, xt = x >= Ze, mt = A >= gt, St = mt << 1 | xt, Ct = St + 4; St < Ct; ++St) if (ne = _e[St & 3]) switch (St & 3) { case 0: ee(ne, ue, fe, Ze, gt); break; case 1: ee(ne, Ze, fe, ke, gt); break; case 2: ee(ne, ue, gt, Ze, Me); break; case 3: ee(ne, Ze, gt, ke, Me); break; } } }(d, S, L, D, V), Y; } t.interpolateRgb = og; function og(d, x) { d = t.rgb(d), x = t.rgb(x); var A = d.r, S = d.g, L = d.b, D = x.r - A, V = x.g - S, R = x.b - L; return function(Y) { return "#" + pr(Math.round(A + D * Y)) + pr(Math.round(S + V * Y)) + pr(Math.round(L + R * Y)); }; } t.interpolateObject = Eb; function Eb(d, x) { var A = {}, S = {}, L; for (L in d) L in x ? A[L] = Tl(d[L], x[L]) : S[L] = d[L]; for (L in x) L in d || (S[L] = x[L]); return function(D) { for (L in A) S[L] = A[L](D); return S; }; } t.interpolateNumber = ao; function ao(d, x) { return d = +d, x = +x, function(A) { return d * (1 - A) + x * A; }; } t.interpolateString = jb; function jb(d, x) { var A = lg.lastIndex = sg.lastIndex = 0, S, L, D, V = -1, R = [], Y = []; for (d = d + "", x = x + ""; (S = lg.exec(d)) && (L = sg.exec(x)); ) (D = L.index) > A && (D = x.slice(A, D), R[V] ? R[V] += D : R[++V] = D), (S = S[0]) === (L = L[0]) ? R[V] ? R[V] += L : R[++V] = L : (R[++V] = null, Y.push({ i: V, x: ao(S, L) })), A = sg.lastIndex; return A < x.length && (D = x.slice(A), R[V] ? R[V] += D : R[++V] = D), R.length < 2 ? Y[0] ? (x = Y[0].x, function(ee) { return x(ee) + ""; }) : function() { return x; } : (x = Y.length, function(ee) { for (var ne = 0, ue; ne < x; ++ne) R[(ue = Y[ne]).i] = ue.x(ee); return R.join(""); }); } var lg = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, sg = new RegExp(lg.source, "g"); t.interpolate = Tl; function Tl(d, x) { for (var A = t.interpolators.length, S; --A >= 0 && !(S = t.interpolators[A](d, x)); ) ; return S; } t.interpolators = [function(d, x) { var A = typeof x; return (A === "string" ? Ta.has(x.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(x) ? og : jb : x instanceof Pt ? og : Array.isArray(x) ? ff : A === "object" && isNaN(x) ? Eb : ao)(d, x); }], t.interpolateArray = ff; function ff(d, x) { var A = [], S = [], L = d.length, D = x.length, V = Math.min(d.length, x.length), R; for (R = 0; R < V; ++R) A.push(Tl(d[R], x[R])); for (; R < L; ++R) S[R] = d[R]; for (; R < D; ++R) S[R] = x[R]; return function(Y) { for (R = 0; R < V; ++R) S[R] = A[R](Y); return S; }; } var Pb = function() { return U; }, YD = t.map({ linear: Pb, poly: eF, quad: function() { return JD; }, cubic: function() { return QD; }, sin: function() { return tF; }, exp: function() { return nF; }, circle: function() { return rF; }, elastic: aF, back: iF, bounce: function() { return oF; } }), $D = t.map({ in: U, out: Rb, "in-out": Nb, "out-in": function(d) { return Nb(Rb(d)); } }); t.ease = function(d) { var x = d.indexOf("-"), A = x >= 0 ? d.slice(0, x) : d, S = x >= 0 ? d.slice(x + 1) : "in"; return A = YD.get(A) || Pb, S = $D.get(S) || U, KD(S(A.apply(null, n.call(arguments, 1)))); }; function KD(d) { return function(x) { return x <= 0 ? 0 : x >= 1 ? 1 : d(x); }; } function Rb(d) { return function(x) { return 1 - d(1 - x); }; } function Nb(d) { return function(x) { return 0.5 * (x < 0.5 ? d(2 * x) : 2 - d(2 - 2 * x)); }; } function JD(d) { return d * d; } function QD(d) { return d * d * d; } function XD(d) { if (d <= 0) return 0; if (d >= 1) return 1; var x = d * d, A = x * d; return 4 * (d < 0.5 ? A : 3 * (d - x) + A - 0.75); } function eF(d) { return function(x) { return Math.pow(x, d); }; } function tF(d) { return 1 - Math.cos(d * se); } function nF(d) { return Math.pow(2, 10 * (d - 1)); } function rF(d) { return 1 - Math.sqrt(1 - d * d); } function aF(d, x) { var A; return arguments.length < 2 && (x = 0.45), arguments.length ? A = x / Lt * Math.asin(1 / d) : (d = 1, A = x / 4), function(S) { return 1 + d * Math.pow(2, -10 * S) * Math.sin((S - A) * Lt / x); }; } function iF(d) { return d || (d = 1.70158), function(x) { return x * x * ((d + 1) * x - d); }; } function oF(d) { return d < 1 / 2.75 ? 7.5625 * d * d : d < 2 / 2.75 ? 7.5625 * (d -= 1.5 / 2.75) * d + 0.75 : d < 2.5 / 2.75 ? 7.5625 * (d -= 2.25 / 2.75) * d + 0.9375 : 7.5625 * (d -= 2.625 / 2.75) * d + 0.984375; } t.interpolateHcl = lF; function lF(d, x) { d = t.hcl(d), x = t.hcl(x); var A = d.h, S = d.c, L = d.l, D = x.h - A, V = x.c - S, R = x.l - L; return isNaN(V) && (V = 0, S = isNaN(S) ? x.c : S), isNaN(D) ? (D = 0, A = isNaN(A) ? x.h : A) : D > 180 ? D -= 360 : D < -180 && (D += 360), function(Y) { return Jt(A + D * Y, S + V * Y, L + R * Y) + ""; }; } t.interpolateHsl = sF; function sF(d, x) { d = t.hsl(d), x = t.hsl(x); var A = d.h, S = d.s, L = d.l, D = x.h - A, V = x.s - S, R = x.l - L; return isNaN(V) && (V = 0, S = isNaN(S) ? x.s : S), isNaN(D) ? (D = 0, A = isNaN(A) ? x.h : A) : D > 180 ? D -= 360 : D < -180 && (D += 360), function(Y) { return Nt(A + D * Y, S + V * Y, L + R * Y) + ""; }; } t.interpolateLab = cF; function cF(d, x) { d = t.lab(d), x = t.lab(x); var A = d.l, S = d.a, L = d.b, D = x.l - A, V = x.a - S, R = x.b - L; return function(Y) { return Mt(A + D * Y, S + V * Y, L + R * Y) + ""; }; } t.interpolateRound = Bb; function Bb(d, x) { return x -= d, function(A) { return Math.round(d + x * A); }; } t.transform = function(d) { var x = a.createElementNS(t.ns.prefix.svg, "g"); return (t.transform = function(A) { if (A != null) { x.setAttribute("transform", A); var S = x.transform.baseVal.consolidate(); } return new Hb(S ? S.matrix : dF); })(d); }; function Hb(d) { var x = [d.a, d.b], A = [d.c, d.d], S = qb(x), L = Vb(x, A), D = qb(uF(A, x, -L)) || 0; x[0] * A[1] < A[0] * x[1] && (x[0] *= -1, x[1] *= -1, S *= -1, L *= -1), this.rotate = (S ? Math.atan2(x[1], x[0]) : Math.atan2(-A[0], A[1])) * de, this.translate = [d.e, d.f], this.scale = [S, D], this.skew = D ? Math.atan2(L, D) * de : 0; } Hb.prototype.toString = function() { return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; }; function Vb(d, x) { return d[0] * x[0] + d[1] * x[1]; } function qb(d) { var x = Math.sqrt(Vb(d, d)); return x && (d[0] /= x, d[1] /= x), x; } function uF(d, x, A) { return d[0] += A * x[0], d[1] += A * x[1], d; } var dF = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 }; t.interpolateTransform = Ub; function Cs(d) { return d.length ? d.pop() + "," : ""; } function fF(d, x, A, S) { if (d[0] !== x[0] || d[1] !== x[1]) { var L = A.push("translate(", null, ",", null, ")"); S.push({ i: L - 4, x: ao(d[0], x[0]) }, { i: L - 2, x: ao(d[1], x[1]) }); } else (x[0] || x[1]) && A.push("translate(" + x + ")"); } function hF(d, x, A, S) { d !== x ? (d - x > 180 ? x += 360 : x - d > 180 && (d += 360), S.push({ i: A.push(Cs(A) + "rotate(", null, ")") - 2, x: ao(d, x) })) : x && A.push(Cs(A) + "rotate(" + x + ")"); } function pF(d, x, A, S) { d !== x ? S.push({ i: A.push(Cs(A) + "skewX(", null, ")") - 2, x: ao(d, x) }) : x && A.push(Cs(A) + "skewX(" + x + ")"); } function gF(d, x, A, S) { if (d[0] !== x[0] || d[1] !== x[1]) { var L = A.push(Cs(A) + "scale(", null, ",", null, ")"); S.push({ i: L - 4, x: ao(d[0], x[0]) }, { i: L - 2, x: ao(d[1], x[1]) }); } else (x[0] !== 1 || x[1] !== 1) && A.push(Cs(A) + "scale(" + x + ")"); } function Ub(d, x) { var A = [], S = []; return d = t.transform(d), x = t.transform(x), fF(d.translate, x.translate, A, S), hF(d.rotate, x.rotate, A, S), pF(d.skew, x.skew, A, S), gF(d.scale, x.scale, A, S), d = x = null, function(L) { for (var D = -1, V = S.length, R; ++D < V; ) A[(R = S[D]).i] = R.x(L); return A.join(""); }; } function vF(d, x) { return x = (x -= d = +d) || 1 / x, function(A) { return (A - d) / x; }; } function mF(d, x) { return x = (x -= d = +d) || 1 / x, function(A) { return Math.max(0, Math.min(1, (A - d) / x)); }; } t.layout = {}, t.layout.bundle = function() { return function(d) { for (var x = [], A = -1, S = d.length; ++A < S; ) x.push(yF(d[A])); return x; }; }; function yF(d) { for (var x = d.source, A = d.target, S = xF(x, A), L = [x]; x !== S; ) x = x.parent, L.push(x); for (var D = L.length; A !== S; ) L.splice(D, 0, A), A = A.parent; return L; } function Gb(d) { for (var x = [], A = d.parent; A != null; ) x.push(d), d = A, A = A.parent; return x.push(d), x; } function xF(d, x) { if (d === x) return d; for (var A = Gb(d), S = Gb(x), L = A.pop(), D = S.pop(), V = null; L === D; ) V = L, L = A.pop(), D = S.pop(); return V; } t.layout.chord = function() { var d = {}, x, A, S, L, D = 0, V, R, Y; function ee() { var ue = {}, fe = [], ke = t.range(L), Me = [], he, me, be, Ae, Le; for (x = [], A = [], he = 0, Ae = -1; ++Ae < L; ) { for (me = 0, Le = -1; ++Le < L; ) me += S[Ae][Le]; fe.push(me), Me.push(t.range(L)), he += me; } for (V && ke.sort(function(Wt, Ft) { return V(fe[Wt], fe[Ft]); }), R && Me.forEach(function(Wt, Ft) { Wt.sort(function(Ut, yn) { return R(S[Ft][Ut], S[Ft][yn]); }); }), he = (Lt - D * L) / he, me = 0, Ae = -1; ++Ae < L; ) { for (be = me, Le = -1; ++Le < L; ) { var _e = ke[Ae], Ze = Me[_e][Le], gt = S[_e][Ze], xt = me, mt = me += gt * he; ue[_e + "-" + Ze] = { index: _e, subindex: Ze, startAngle: xt, endAngle: mt, value: gt }; } A[_e] = { index: _e, startAngle: be, endAngle: me, value: fe[_e] }, me += D; } for (Ae = -1; ++Ae < L; ) for (Le = Ae - 1; ++Le < L; ) { var St = ue[Ae + "-" + Le], Ct = ue[Le + "-" + Ae]; (St.value || Ct.value) && x.push(St.value < Ct.value ? { source: Ct, target: St } : { source: St, target: Ct }); } Y && ne(); } function ne() { x.sort(function(ue, fe) { return Y((ue.source.value + ue.target.value) / 2, (fe.source.value + fe.target.value) / 2); }); } return d.matrix = function(ue) { return arguments.length ? (L = (S = ue) && S.length, x = A = null, d) : S; }, d.padding = function(ue) { return arguments.length ? (D = ue, x = A = null, d) : D; }, d.sortGroups = function(ue) { return arguments.length ? (V = ue, x = A = null, d) : V; }, d.sortSubgroups = function(ue) { return arguments.length ? (R = ue, x = null, d) : R; }, d.sortChords = function(ue) { return arguments.length ? (Y = ue, x && ne(), d) : Y; }, d.chords = function() { return x || ee(), x; }, d.groups = function() { return A || ee(), A; }, d; }, t.layout.force = function() { var d = {}, x = t.dispatch("start", "tick", "end"), A, S = [1, 1], L, D, V = 0.9, R = TF, Y = AF, ee = -30, ne = MF, ue = 0.1, fe = 0.64, ke = [], Me = [], he, me, be; function Ae(_e) { return function(Ze, gt, xt, mt) { if (Ze.point !== _e) { var St = Ze.cx - _e.x, Ct = Ze.cy - _e.y, Wt = mt - gt, Ft = St * St + Ct * Ct; if (Wt * Wt / fe < Ft) { if (Ft < ne) { var Ut = Ze.charge / Ft; _e.px -= St * Ut, _e.py -= Ct * Ut; } return !0; } if (Ze.point && Ft && Ft < ne) { var Ut = Ze.pointCharge / Ft; _e.px -= St * Ut, _e.py -= Ct * Ut; } } return !Ze.charge; }; } d.tick = function() { if ((D *= 0.99) < 5e-3) return A = null, x.end({ type: "end", alpha: D = 0 }), !0; var _e = ke.length, Ze = Me.length, gt, xt, mt, St, Ct, Wt, Ft, Ut, yn; for (xt = 0; xt < Ze; ++xt) mt = Me[xt], St = mt.source, Ct = mt.target, Ut = Ct.x - St.x, yn = Ct.y - St.y, (Wt = Ut * Ut + yn * yn) && (Wt = D * me[xt] * ((Wt = Math.sqrt(Wt)) - he[xt]) / Wt, Ut *= Wt, yn *= Wt, Ct.x -= Ut * (Ft = St.weight + Ct.weight ? St.weight / (St.weight + Ct.weight) : 0.5), Ct.y -= yn * Ft, St.x += Ut * (Ft = 1 - Ft), St.y += yn * Ft); if ((Ft = D * ue) && (Ut = S[0] / 2, yn = S[1] / 2, xt = -1, Ft)) for (; ++xt < _e; ) mt = ke[xt], mt.x += (Ut - mt.x) * Ft, mt.y += (yn - mt.y) * Ft; if (ee) for (Wb(gt = t.geom.quadtree(ke), D, be), xt = -1; ++xt < _e; ) (mt = ke[xt]).fixed || gt.visit(Ae(mt)); for (xt = -1; ++xt < _e; ) mt = ke[xt], mt.fixed ? (mt.x = mt.px, mt.y = mt.py) : (mt.x -= (mt.px - (mt.px = mt.x)) * V, mt.y -= (mt.py - (mt.py = mt.y)) * V); x.tick({ type: "tick", alpha: D }); }, d.nodes = function(_e) { return arguments.length ? (ke = _e, d) : ke; }, d.links = function(_e) { return arguments.length ? (Me = _e, d) : Me; }, d.size = function(_e) { return arguments.length ? (S = _e, d) : S; }, d.linkDistance = function(_e) { return arguments.length ? (R = typeof _e == "function" ? _e : +_e, d) : R; }, d.distance = d.linkDistance, d.linkStrength = function(_e) { return arguments.length ? (Y = typeof _e == "function" ? _e : +_e, d) : Y; }, d.friction = function(_e) { return arguments.length ? (V = +_e, d) : V; }, d.charge = function(_e) { return arguments.length ? (ee = typeof _e == "function" ? _e : +_e, d) : ee; }, d.chargeDistance = function(_e) { return arguments.length ? (ne = _e * _e, d) : Math.sqrt(ne); }, d.gravity = function(_e) { return arguments.length ? (ue = +_e, d) : ue; }, d.theta = function(_e) { return arguments.length ? (fe = _e * _e, d) : Math.sqrt(fe); }, d.alpha = function(_e) { return arguments.length ? (_e = +_e, D ? _e > 0 ? D = _e : (A.c = null, A.t = NaN, A = null, x.end({ type: "end", alpha: D = 0 })) : _e > 0 && (x.start({ type: "start", alpha: D = _e }), A = ha(d.tick)), d) : D; }, d.start = function() { var _e, Ze = ke.length, gt = Me.length, xt = S[0], mt = S[1], St, Ct; for (_e = 0; _e < Ze; ++_e) (Ct = ke[_e]).index = _e, Ct.weight = 0; for (_e = 0; _e < gt; ++_e) Ct = Me[_e], typeof Ct.source == "number" && (Ct.source = ke[Ct.source]), typeof Ct.target == "number" && (Ct.target = ke[Ct.target]), ++Ct.source.weight, ++Ct.target.weight; for (_e = 0; _e < Ze; ++_e) Ct = ke[_e], isNaN(Ct.x) && (Ct.x = Wt("x", xt)), isNaN(Ct.y) && (Ct.y = Wt("y", mt)), isNaN(Ct.px) && (Ct.px = Ct.x), isNaN(Ct.py) && (Ct.py = Ct.y); if (he = [], typeof R == "function") for (_e = 0; _e < gt; ++_e) he[_e] = +R.call(this, Me[_e], _e); else for (_e = 0; _e < gt; ++_e) he[_e] = R; if (me = [], typeof Y == "function") for (_e = 0; _e < gt; ++_e) me[_e] = +Y.call(this, Me[_e], _e); else for (_e = 0; _e < gt; ++_e) me[_e] = Y; if (be = [], typeof ee == "function") for (_e = 0; _e < Ze; ++_e) be[_e] = +ee.call(this, ke[_e], _e); else for (_e = 0; _e < Ze; ++_e) be[_e] = ee; function Wt(Ft, Ut) { if (!St) { for (St = new Array(Ze), _n = 0; _n < Ze; ++_n) St[_n] = []; for (_n = 0; _n < gt; ++_n) { var yn = Me[_n]; St[yn.source.index].push(yn.target), St[yn.target.index].push(yn.source); } } for (var Kn = St[_e], _n = -1, ht = Kn.length, Zt; ++_n < ht; ) if (!isNaN(Zt = Kn[_n][Ft])) return Zt; return Math.random() * Ut; } return d.resume(); }, d.resume = function() { return d.alpha(0.1); }, d.stop = function() { return d.alpha(0); }, d.drag = function() { if (L || (L = t.behavior.drag().origin(U).on("dragstart.force", bF).on("drag.force", Le).on("dragend.force", wF)), !arguments.length) return L; this.on("mouseover.force", _F).on("mouseout.force", kF).call(L); }; function Le(_e) { _e.px = t.event.x, _e.py = t.event.y, d.resume(); } return t.rebind(d, x, "on"); }; function bF(d) { d.fixed |= 2; } function wF(d) { d.fixed &= -7; } function _F(d) { d.fixed |= 4, d.px = d.x, d.py = d.y; } function kF(d) { d.fixed &= -5; } function Wb(d, x, A) { var S = 0, L = 0; if (d.charge = 0, !d.leaf) for (var D = d.nodes, V = D.length, R = -1, Y; ++R < V; ) Y = D[R], Y != null && (Wb(Y, x, A), d.charge += Y.charge, S += Y.charge * Y.cx, L += Y.charge * Y.cy); if (d.point) { d.leaf || (d.point.x += Math.random() - 0.5, d.point.y += Math.random() - 0.5); var ee = x * A[d.point.index]; d.charge += d.pointCharge = ee, S += ee * d.point.x, L += ee * d.point.y; } d.cx = S / d.charge, d.cy = L / d.charge; } var TF = 20, AF = 1, MF = 1 / 0; t.layout.hierarchy = function() { var d = LF, x = SF, A = CF; function S(L) { var D = [L], V = [], R; for (L.depth = 0; (R = D.pop()) != null; ) if (V.push(R), (ee = x.call(S, R, R.depth)) && (Y = ee.length)) { for (var Y, ee, ne; --Y >= 0; ) D.push(ne = ee[Y]), ne.parent = R, ne.depth = R.depth + 1; A && (R.value = 0), R.children = ee; } else A && (R.value = +A.call(S, R, R.depth) || 0), delete R.children; return Ti(L, function(ue) { var fe, ke; d && (fe = ue.children) && fe.sort(d), A && (ke = ue.parent) && (ke.value += ue.value); }), V; } return S.sort = function(L) { return arguments.length ? (d = L, S) : d; }, S.children = function(L) { return arguments.length ? (x = L, S) : x; }, S.value = function(L) { return arguments.length ? (A = L, S) : A; }, S.revalue = function(L) { return A && (du(L, function(D) { D.children && (D.value = 0); }), Ti(L, function(D) { var V; D.children || (D.value = +A.call(S, D, D.depth) || 0), (V = D.parent) && (V.value += D.value); })), L; }, S; }; function uu(d, x) { return t.rebind(d, x, "sort", "children", "value"), d.nodes = d, d.links = OF, d; } function du(d, x) { for (var A = [d]; (d = A.pop()) != null; ) if (x(d), (L = d.children) && (S = L.length)) for (var S, L; --S >= 0; ) A.push(L[S]); } function Ti(d, x) { for (var A = [d], S = []; (d = A.pop()) != null; ) if (S.push(d), (V = d.children) && (D = V.length)) for (var L = -1, D, V; ++L < D; ) A.push(V[L]); for (; (d = S.pop()) != null; ) x(d); } function SF(d) { return d.children; } function CF(d) { return d.value; } function LF(d, x) { return x.value - d.value; } function OF(d) { return t.merge(d.map(function(x) { return (x.children || []).map(function(A) { return { source: x, target: A }; }); })); } t.layout.partition = function() { var d = t.layout.hierarchy(), x = [1, 1]; function A(D, V, R, Y) { var ee = D.children; if (D.x = V, D.y = D.depth * Y, D.dx = R, D.dy = Y, ee && (ue = ee.length)) { var ne = -1, ue, fe, ke; for (R = D.value ? R / D.value : 0; ++ne < ue; ) A(fe = ee[ne], V, ke = fe.value * R, Y), V += ke; } } function S(D) { var V = D.children, R = 0; if (V && (ee = V.length)) for (var Y = -1, ee; ++Y < ee; ) R = Math.max(R, S(V[Y])); return 1 + R; } function L(D, V) { var R = d.call(this, D, V); return A(R[0], 0, x[0], x[1] / S(R[0])), R; } return L.size = function(D) { return arguments.length ? (x = D, L) : x; }, uu(L, d); }, t.layout.pie = function() { var d = Number, x = Zb, A = 0, S = Lt, L = 0; function D(V) { var R = V.length, Y = V.map(function(Ae, Le) { return +d.call(D, Ae, Le); }), ee = +(typeof A == "function" ? A.apply(this, arguments) : A), ne = (typeof S == "function" ? S.apply(this, arguments) : S) - ee, ue = Math.min(Math.abs(ne) / R, +(typeof L == "function" ? L.apply(this, arguments) : L)), fe = ue * (ne < 0 ? -1 : 1), ke = t.sum(Y), Me = ke ? (ne - R * fe) / ke : 0, he = t.range(R), me = [], be; return x != null && he.sort(x === Zb ? function(Ae, Le) { return Y[Le] - Y[Ae]; } : function(Ae, Le) { return x(V[Ae], V[Le]); }), he.forEach(function(Ae) { me[Ae] = { data: V[Ae], value: be = Y[Ae], startAngle: ee, endAngle: ee += be * Me + fe, padAngle: ue }; }), me; } return D.value = function(V) { return arguments.length ? (d = V, D) : d; }, D.sort = function(V) { return arguments.length ? (x = V, D) : x; }, D.startAngle = function(V) { return arguments.length ? (A = V, D) : A; }, D.endAngle = function(V) { return arguments.length ? (S = V, D) : S; }, D.padAngle = function(V) { return arguments.length ? (L = V, D) : L; }, D; }; var Zb = {}; t.layout.stack = function() { var d = U, x = cg, A = ug, S = IF, L = DF, D = FF; function V(R, Y) { if (!(Me = R.length)) return R; var ee = R.map(function(Ae, Le) { return d.call(V, Ae, Le); }), ne = ee.map(function(Ae) { return Ae.map(function(Le, _e) { return [L.call(V, Le, _e), D.call(V, Le, _e)]; }); }), ue = x.call(V, ne, Y); ee = t.permute(ee, ue), ne = t.permute(ne, ue); var fe = A.call(V, ne, Y), ke = ee[0].length, Me, he, me, be; for (me = 0; me < ke; ++me) for (S.call(V, ee[0][me], be = fe[me], ne[0][me][1]), he = 1; he < Me; ++he) S.call(V, ee[he][me], be += ne[he - 1][me][1], ne[he][me][1]); return R; } return V.values = function(R) { return arguments.length ? (d = R, V) : d; }, V.order = function(R) { return arguments.length ? (x = typeof R == "function" ? R : zF.get(R) || cg, V) : x; }, V.offset = function(R) { return arguments.length ? (A = typeof R == "function" ? R : EF.get(R) || ug, V) : A; }, V.x = function(R) { return arguments.length ? (L = R, V) : L; }, V.y = function(R) { return arguments.length ? (D = R, V) : D; }, V.out = function(R) { return arguments.length ? (S = R, V) : S; }, V; }; function DF(d) { return d.x; } function FF(d) { return d.y; } function IF(d, x, A) { d.y0 = x, d.y = A; } var zF = t.map({ "inside-out": function(d) { var x = d.length, A, S, L = d.map(jF), D = d.map(PF), V = t.range(x).sort(function(ue, fe) { return L[ue] - L[fe]; }), R = 0, Y = 0, ee = [], ne = []; for (A = 0; A < x; ++A) S = V[A], R < Y ? (R += D[S], ee.push(S)) : (Y += D[S], ne.push(S)); return ne.reverse().concat(ee); }, reverse: function(d) { return t.range(d.length).reverse(); }, default: cg }), EF = t.map({ silhouette: function(d) { var x = d.length, A = d[0].length, S = [], L = 0, D, V, R, Y = []; for (V = 0; V < A; ++V) { for (D = 0, R = 0; D < x; D++) R += d[D][V][1]; R > L && (L = R), S.push(R); } for (V = 0; V < A; ++V) Y[V] = (L - S[V]) / 2; return Y; }, wiggle: function(d) { var x = d.length, A = d[0], S = A.length, L, D, V, R, Y, ee, ne, ue, fe, ke = []; for (ke[0] = ue = fe = 0, D = 1; D < S; ++D) { for (L = 0, R = 0; L < x; ++L) R += d[L][D][1]; for (L = 0, Y = 0, ne = A[D][0] - A[D - 1][0]; L < x; ++L) { for (V = 0, ee = (d[L][D][1] - d[L][D - 1][1]) / (2 * ne); V < L; ++V) ee += (d[V][D][1] - d[V][D - 1][1]) / ne; Y += ee * d[L][D][1]; } ke[D] = ue -= R ? Y / R * ne : 0, ue < fe && (fe = ue); } for (D = 0; D < S; ++D) ke[D] -= fe; return ke; }, expand: function(d) { var x = d.length, A = d[0].length, S = 1 / x, L, D, V, R = []; for (D = 0; D < A; ++D) { for (L = 0, V = 0; L < x; L++) V += d[L][D][1]; if (V) for (L = 0; L < x; L++) d[L][D][1] /= V; else for (L = 0; L < x; L++) d[L][D][1] = S; } for (D = 0; D < A; ++D) R[D] = 0; return R; }, zero: ug }); function cg(d) { return t.range(d.length); } function ug(d) { for (var x = -1, A = d[0].length, S = []; ++x < A; ) S[x] = 0; return S; } function jF(d) { for (var x = 1, A = 0, S = d[0][1], L, D = d.length; x < D; ++x) (L = d[x][1]) > S && (A = x, S = L); return A; } function PF(d) { return d.reduce(RF, 0); } function RF(d, x) { return d + x[1]; } t.layout.histogram = function() { var d = !0, x = Number, A = BF, S = NF; function L(D, V) { for (var R = [], Y = D.map(x, this), ee = A.call(this, Y, V), ne = S.call(this, ee, Y, V), ue, V = -1, fe = Y.length, ke = ne.length - 1, Me = d ? 1 : 1 / fe, he; ++V < ke; ) ue = R[V] = [], ue.dx = ne[V + 1] - (ue.x = ne[V]), ue.y = 0; if (ke > 0) for (V = -1; ++V < fe; ) he = Y[V], he >= ee[0] && he <= ee[1] && (ue = R[t.bisect(ne, he, 1, ke) - 1], ue.y += Me, ue.push(D[V])); return R; } return L.value = function(D) { return arguments.length ? (x = D, L) : x; }, L.range = function(D) { return arguments.length ? (A = mn(D), L) : A; }, L.bins = function(D) { return arguments.length ? (S = typeof D == "number" ? function(V) { return Yb(V, D); } : mn(D), L) : S; }, L.frequency = function(D) { return arguments.length ? (d = !!D, L) : d; }, L; }; function NF(d, x) { return Yb(d, Math.ceil(Math.log(x.length) / Math.LN2 + 1)); } function Yb(d, x) { for (var A = -1, S = +d[0], L = (d[1] - S) / x, D = []; ++A <= x; ) D[A] = L * A + S; return D; } function BF(d) { return [t.min(d), t.max(d)]; } t.layout.pack = function() { var d = t.layout.hierarchy().sort(HF), x = 0, A = [1, 1], S; function L(D, V) { var R = d.call(this, D, V), Y = R[0], ee = A[0], ne = A[1], ue = S == null ? Math.sqrt : typeof S == "function" ? S : function() { return S; }; if (Y.x = Y.y = 0, Ti(Y, function(ke) { ke.r = +ue(ke.value); }), Ti(Y, Jb), x) { var fe = x * (S ? 1 : Math.max(2 * Y.r / ee, 2 * Y.r / ne)) / 2; Ti(Y, function(ke) { ke.r += fe; }), Ti(Y, Jb), Ti(Y, function(ke) { ke.r -= fe; }); } return Qb(Y, ee / 2, ne / 2, S ? 1 : 1 / Math.max(2 * Y.r / ee, 2 * Y.r / ne)), R; } return L.size = function(D) { return arguments.length ? (A = D, L) : A; }, L.radius = function(D) { return arguments.length ? (S = D == null || typeof D == "function" ? D : +D, L) : S; }, L.padding = function(D) { return arguments.length ? (x = +D, L) : x; }, uu(L, d); }; function HF(d, x) { return d.value - x.value; } function dg(d, x) { var A = d._pack_next; d._pack_next = x, x._pack_prev = d, x._pack_next = A, A._pack_prev = x; } function $b(d, x) { d._pack_next = x, x._pack_prev = d; } function Kb(d, x) { var A = x.x - d.x, S = x.y - d.y, L = d.r + x.r; return 0.999 * L * L > A * A + S * S; } function Jb(d) { if (!(x = d.children) || !(fe = x.length)) return; var x, A = 1 / 0, S = -1 / 0, L = 1 / 0, D = -1 / 0, V, R, Y, ee, ne, ue, fe; function ke(_e) { A = Math.min(_e.x - _e.r, A), S = Math.max(_e.x + _e.r, S), L = Math.min(_e.y - _e.r, L), D = Math.max(_e.y + _e.r, D); } if (x.forEach(VF), V = x[0], V.x = -V.r, V.y = 0, ke(V), fe > 1 && (R = x[1], R.x = R.r, R.y = 0, ke(R), fe > 2)) for (Y = x[2], Xb(V, R, Y), ke(Y), dg(V, Y), V._pack_prev = Y, dg(Y, R), R = V._pack_next, ee = 3; ee < fe; ee++) { Xb(V, R, Y = x[ee]); var Me = 0, he = 1, me = 1; for (ne = R._pack_next; ne !== R; ne = ne._pack_next, he++) if (Kb(ne, Y)) { Me = 1; break; } if (Me == 1) for (ue = V._pack_prev; ue !== ne._pack_prev && !Kb(ue, Y); ue = ue._pack_prev, me++) ; Me ? (he < me || he == me && R.r < V.r ? $b(V, R = ne) : $b(V = ue, R), ee--) : (dg(V, Y), R = Y, ke(Y)); } var be = (A + S) / 2, Ae = (L + D) / 2, Le = 0; for (ee = 0; ee < fe; ee++) Y = x[ee], Y.x -= be, Y.y -= Ae, Le = Math.max(Le, Y.r + Math.sqrt(Y.x * Y.x + Y.y * Y.y)); d.r = Le, x.forEach(qF); } function VF(d) { d._pack_next = d._pack_prev = d; } function qF(d) { delete d._pack_next, delete d._pack_prev; } function Qb(d, x, A, S) { var L = d.children; if (d.x = x += S * d.x, d.y = A += S * d.y, d.r *= S, L) for (var D = -1, V = L.length; ++D < V; ) Qb(L[D], x, A, S); } function Xb(d, x, A) { var S = d.r + A.r, L = x.x - d.x, D = x.y - d.y; if (S && (L || D)) { var V = x.r + A.r, R = L * L + D * D; V *= V, S *= S; var Y = 0.5 + (S - V) / (2 * R), ee = Math.sqrt(Math.max(0, 2 * V * (S + R) - (S -= R) * S - V * V)) / (2 * R); A.x = d.x + Y * L + ee * D, A.y = d.y + Y * D - ee * L; } else A.x = d.x + S, A.y = d.y; } t.layout.tree = function() { var d = t.layout.hierarchy().sort(null).value(null), x = e2, A = [1, 1], S = null; function L(ne, ue) { var fe = d.call(this, ne, ue), ke = fe[0], Me = D(ke); if (Ti(Me, V), Me.parent.m = -Me.z, du(Me, R), S) du(ke, ee); else { var he = ke, me = ke, be = ke; du(ke, function(Ze) { Ze.x < he.x && (he = Ze), Ze.x > me.x && (me = Ze), Ze.depth > be.depth && (be = Ze); }); var Ae = x(he, me) / 2 - he.x, Le = A[0] / (me.x + x(me, he) / 2 + Ae), _e = A[1] / (be.depth || 1); du(ke, function(Ze) { Ze.x = (Ze.x + Ae) * Le, Ze.y = Ze.depth * _e; }); } return fe; } function D(ne) { for (var ue = { A: null, children: [ne] }, fe = [ue], ke; (ke = fe.pop()) != null; ) for (var Me = ke.children, he, me = 0, be = Me.length; me < be; ++me) fe.push((Me[me] = he = { _: Me[me], parent: ke, children: (he = Me[me].children) && he.slice() || [], A: null, a: null, z: 0, m: 0, c: 0, s: 0, t: null, i: me }).a = he); return ue.children[0]; } function V(ne) { var ue = ne.children, fe = ne.parent.children, ke = ne.i ? fe[ne.i - 1] : null; if (ue.length) { GF(ne); var Me = (ue[0].z + ue[ue.length - 1].z) / 2; ke ? (ne.z = ke.z + x(ne._, ke._), ne.m = ne.z - Me) : ne.z = Me; } else ke && (ne.z = ke.z + x(ne._, ke._)); ne.parent.A = Y(ne, ke, ne.parent.A || fe[0]); } function R(ne) { ne._.x = ne.z + ne.parent.m, ne.m += ne.parent.m; } function Y(ne, ue, fe) { if (ue) { for (var ke = ne, Me = ne, he = ue, me = ke.parent.children[0], be = ke.m, Ae = Me.m, Le = he.m, _e = me.m, Ze; he = hg(he), ke = fg(ke), he && ke; ) me = fg(me), Me = hg(Me), Me.a = ne, Ze = he.z + Le - ke.z - be + x(he._, ke._), Ze > 0 && (UF(WF(he, ne, fe), ne, Ze), be += Ze, Ae += Ze), Le += he.m, be += ke.m, _e += me.m, Ae += Me.m; he && !hg(Me) && (Me.t = he, Me.m += Le - Ae), ke && !fg(me) && (me.t = ke, me.m += be - _e, fe = ne); } return fe; } function ee(ne) { ne.x *= A[0], ne.y = ne.depth * A[1]; } return L.separation = function(ne) { return arguments.length ? (x = ne, L) : x; }, L.size = function(ne) { return arguments.length ? (S = (A = ne) == null ? ee : null, L) : S ? null : A; }, L.nodeSize = function(ne) { return arguments.length ? (S = (A = ne) == null ? null : ee, L) : S ? A : null; }, uu(L, d); }; function e2(d, x) { return d.parent == x.parent ? 1 : 2; } function fg(d) { var x = d.children; return x.length ? x[0] : d.t; } function hg(d) { var x = d.children, A; return (A = x.length) ? x[A - 1] : d.t; } function UF(d, x, A) { var S = A / (x.i - d.i); x.c -= S, x.s += A, d.c += S, x.z += A, x.m += A; } function GF(d) { for (var x = 0, A = 0, S = d.children, L = S.length, D; --L >= 0; ) D = S[L], D.z += x, D.m += x, x += D.s + (A += D.c); } function WF(d, x, A) { return d.a.parent === x.parent ? d.a : A; } t.layout.cluster = function() { var d = t.layout.hierarchy().sort(null).value(null), x = e2, A = [1, 1], S = !1; function L(D, V) { var R = d.call(this, D, V), Y = R[0], ee, ne = 0; Ti(Y, function(he) { var me = he.children; me && me.length ? (he.x = YF(me), he.y = ZF(me)) : (he.x = ee ? ne += x(he, ee) : 0, he.y = 0, ee = he); }); var ue = t2(Y), fe = n2(Y), ke = ue.x - x(ue, fe) / 2, Me = fe.x + x(fe, ue) / 2; return Ti(Y, S ? function(he) { he.x = (he.x - Y.x) * A[0], he.y = (Y.y - he.y) * A[1]; } : function(he) { he.x = (he.x - ke) / (Me - ke) * A[0], he.y = (1 - (Y.y ? he.y / Y.y : 1)) * A[1]; }), R; } return L.separation = function(D) { return arguments.length ? (x = D, L) : x; }, L.size = function(D) { return arguments.length ? (S = (A = D) == null, L) : S ? null : A; }, L.nodeSize = function(D) { return arguments.length ? (S = (A = D) != null, L) : S ? A : null; }, uu(L, d); }; function ZF(d) { return 1 + t.max(d, function(x) { return x.y; }); } function YF(d) { return d.reduce(function(x, A) { return x + A.x; }, 0) / d.length; } function t2(d) { var x = d.children; return x && x.length ? t2(x[0]) : d; } function n2(d) { var x = d.children, A; return x && (A = x.length) ? n2(x[A - 1]) : d; } t.layout.treemap = function() { var d = t.layout.hierarchy(), x = Math.round, A = [1, 1], S = null, L = pg, D = !1, V, R = "squarify", Y = 0.5 * (1 + Math.sqrt(5)); function ee(he, me) { for (var be = -1, Ae = he.length, Le, _e; ++be < Ae; ) _e = (Le = he[be]).value * (me < 0 ? 0 : me), Le.area = isNaN(_e) || _e <= 0 ? 0 : _e; } function ne(he) { var me = he.children; if (me && me.length) { var be = L(he), Ae = [], Le = me.slice(), _e, Ze = 1 / 0, gt, xt = R === "slice" ? be.dx : R === "dice" ? be.dy : R === "slice-dice" ? he.depth & 1 ? be.dy : be.dx : Math.min(be.dx, be.dy), mt; for (ee(Le, be.dx * be.dy / he.value), Ae.area = 0; (mt = Le.length) > 0; ) Ae.push(_e = Le[mt - 1]), Ae.area += _e.area, R !== "squarify" || (gt = fe(Ae, xt)) <= Ze ? (Le.pop(), Ze = gt) : (Ae.area -= Ae.pop().area, ke(Ae, xt, be, !1), xt = Math.min(be.dx, be.dy), Ae.length = Ae.area = 0, Ze = 1 / 0); Ae.length && (ke(Ae, xt, be, !0), Ae.length = Ae.area = 0), me.forEach(ne); } } function ue(he) { var me = he.children; if (me && me.length) { var be = L(he), Ae = me.slice(), Le, _e = []; for (ee(Ae, be.dx * be.dy / he.value), _e.area = 0; Le = Ae.pop(); ) _e.push(Le), _e.area += Le.area, Le.z != null && (ke(_e, Le.z ? be.dx : be.dy, be, !Ae.length), _e.length = _e.area = 0); me.forEach(ue); } } function fe(he, me) { for (var be = he.area, Ae, Le = 0, _e = 1 / 0, Ze = -1, gt = he.length; ++Ze < gt; ) (Ae = he[Ze].area) && (Ae < _e && (_e = Ae), Ae > Le && (Le = Ae)); return be *= be, me *= me, be ? Math.max(me * Le * Y / be, be / (me * _e * Y)) : 1 / 0; } function ke(he, me, be, Ae) { var Le = -1, _e = he.length, Ze = be.x, gt = be.y, xt = me ? x(he.area / me) : 0, mt; if (me == be.dx) { for ((Ae || xt > be.dy) && (xt = be.dy); ++Le < _e; ) mt = he[Le], mt.x = Ze, mt.y = gt, mt.dy = xt, Ze += mt.dx = Math.min(be.x + be.dx - Ze, xt ? x(mt.area / xt) : 0); mt.z = !0, mt.dx += be.x + be.dx - Ze, be.y += xt, be.dy -= xt; } else { for ((Ae || xt > be.dx) && (xt = be.dx); ++Le < _e; ) mt = he[Le], mt.x = Ze, mt.y = gt, mt.dx = xt, gt += mt.dy = Math.min(be.y + be.dy - gt, xt ? x(mt.area / xt) : 0); mt.z = !1, mt.dy += be.y + be.dy - gt, be.x += xt, be.dx -= xt; } } function Me(he) { var me = V || d(he), be = me[0]; return be.x = be.y = 0, be.value ? (be.dx = A[0], be.dy = A[1]) : be.dx = be.dy = 0, V && d.revalue(be), ee([be], be.dx * be.dy / be.value), (V ? ue : ne)(be), D && (V = me), me; } return Me.size = function(he) { return arguments.length ? (A = he, Me) : A; }, Me.padding = function(he) { if (!arguments.length) return S; function me(Le) { var _e = he.call(Me, Le, Le.depth); return _e == null ? pg(Le) : r2(Le, typeof _e == "number" ? [_e, _e, _e, _e] : _e); } function be(Le) { return r2(Le, he); } var Ae; return L = (S = he) == null ? pg : (Ae = typeof he) == "function" ? me : (Ae === "number" && (he = [he, he, he, he]), be), Me; }, Me.round = function(he) { return arguments.length ? (x = he ? Math.round : Number, Me) : x != Number; }, Me.sticky = function(he) { return arguments.length ? (D = he, V = null, Me) : D; }, Me.ratio = function(he) { return arguments.length ? (Y = he, Me) : Y; }, Me.mode = function(he) { return arguments.length ? (R = he + "", Me) : R; }, uu(Me, d); }; function pg(d) { return { x: d.x, y: d.y, dx: d.dx, dy: d.dy }; } function r2(d, x) { var A = d.x + x[3], S = d.y + x[0], L = d.dx - x[1] - x[3], D = d.dy - x[0] - x[2]; return L < 0 && (A += L / 2, L = 0), D < 0 && (S += D / 2, D = 0), { x: A, y: S, dx: L, dy: D }; } t.random = { normal: function(d, x) { var A = arguments.length; return A < 2 && (x = 1), A < 1 && (d = 0), function() { var S, L, D; do S = Math.random() * 2 - 1, L = Math.random() * 2 - 1, D = S * S + L * L; while (!D || D > 1); return d + x * S * Math.sqrt(-2 * Math.log(D) / D); }; }, logNormal: function() { var d = t.random.normal.apply(t, arguments); return function() { return Math.exp(d()); }; }, bates: function(d) { var x = t.random.irwinHall(d); return function() { return x() / d; }; }, irwinHall: function(d) { return function() { for (var x = 0, A = 0; A < d; A++) x += Math.random(); return x; }; } }, t.scale = {}; function hf(d) { var x = d[0], A = d[d.length - 1]; return x < A ? [x, A] : [A, x]; } function pf(d) { return d.rangeExtent ? d.rangeExtent() : hf(d.range()); } function $F(d, x, A, S) { var L = A(d[0], d[1]), D = S(x[0], x[1]); return function(V) { return D(L(V)); }; } function gg(d, x) { var A = 0, S = d.length - 1, L = d[A], D = d[S], V; return D < L && (V = A, A = S, S = V, V = L, L = D, D = V), d[A] = x.floor(L), d[S] = x.ceil(D), d; } function a2(d) { return d ? { floor: function(x) { return Math.floor(x / d) * d; }, ceil: function(x) { return Math.ceil(x / d) * d; } } : KF; } var KF = { floor: U, ceil: U }; function JF(d, x, A, S) { var L = [], D = [], V = 0, R = Math.min(d.length, x.length) - 1; for (d[R] < d[0] && (d = d.slice().reverse(), x = x.slice().reverse()); ++V <= R; ) L.push(A(d[V - 1], d[V])), D.push(S(x[V - 1], x[V])); return function(Y) { var ee = t.bisect(d, Y, 1, R) - 1; return D[ee](L[ee](Y)); }; } t.scale.linear = function() { return i2([0, 1], [0, 1], Tl, !1); }; function i2(d, x, A, S) { var L, D; function V() { var Y = Math.min(d.length, x.length) > 2 ? JF : $F, ee = S ? mF : vF; return L = Y(d, x, ee, A), D = Y(x, d, ee, Tl), R; } function R(Y) { return L(Y); } return R.invert = function(Y) { return D(Y); }, R.domain = function(Y) { return arguments.length ? (d = Y.map(Number), V()) : d; }, R.range = function(Y) { return arguments.length ? (x = Y, V()) : x; }, R.rangeRound = function(Y) { return R.range(Y).interpolate(Bb); }, R.clamp = function(Y) { return arguments.length ? (S = Y, V()) : S; }, R.interpolate = function(Y) { return arguments.length ? (A = Y, V()) : A; }, R.ticks = function(Y) { return mg(d, Y); }, R.tickFormat = function(Y, ee) { return d3_scale_linearTickFormat(d, Y, ee); }, R.nice = function(Y) { return l2(d, Y), V(); }, R.copy = function() { return i2(d, x, A, S); }, V(); } function o2(d, x) { return t.rebind(d, x, "range", "rangeRound", "interpolate", "clamp"); } function l2(d, x) { return gg(d, a2(vg(d, x)[2])), gg(d, a2(vg(d, x)[2])), d; } function vg(d, x) { x == null && (x = 10); var A = hf(d), S = A[1] - A[0], L = Math.pow(10, Math.floor(Math.log(S / x) / Math.LN10)), D = x / S * L; return D <= 0.15 ? L *= 10 : D <= 0.35 ? L *= 5 : D <= 0.75 && (L *= 2), A[0] = Math.ceil(A[0] / L) * L, A[1] = Math.floor(A[1] / L) * L + L * 0.5, A[2] = L, A; } function mg(d, x) { return t.range.apply(t, vg(d, x)); } t.scale.log = function() { return s2(t.scale.linear().domain([0, 1]), 10, !0, [1, 10]); }; function s2(d, x, A, S) { function L(R) { return (A ? Math.log(R < 0 ? 0 : R) : -Math.log(R > 0 ? 0 : -R)) / Math.log(x); } function D(R) { return A ? Math.pow(x, R) : -Math.pow(x, -R); } function V(R) { return d(L(R)); } return V.invert = function(R) { return D(d.invert(R)); }, V.domain = function(R) { return arguments.length ? (A = R[0] >= 0, d.domain((S = R.map(Number)).map(L)), V) : S; }, V.base = function(R) { return arguments.length ? (x = +R, d.domain(S.map(L)), V) : x; }, V.nice = function() { var R = gg(S.map(L), A ? Math : QF); return d.domain(R), S = R.map(D), V; }, V.ticks = function() { var R = hf(S), Y = [], ee = R[0], ne = R[1], ue = Math.floor(L(ee)), fe = Math.ceil(L(ne)), ke = x % 1 ? 2 : x; if (isFinite(fe - ue)) { if (A) { for (; ue < fe; ue++) for (var Me = 1; Me < ke; Me++) Y.push(D(ue) * Me); Y.push(D(ue)); } else for (Y.push(D(ue)); ue++ < fe; ) for (var Me = ke - 1; Me > 0; Me--) Y.push(D(ue) * Me); for (ue = 0; Y[ue] < ee; ue++) ; for (fe = Y.length; Y[fe - 1] > ne; fe--) ; Y = Y.slice(ue, fe); } return Y; }, V.copy = function() { return s2(d.copy(), x, A, S); }, o2(V, d); } var QF = { floor: function(d) { return -Math.ceil(-d); }, ceil: function(d) { return -Math.floor(-d); } }; t.scale.pow = function() { return c2(t.scale.linear(), 1, [0, 1]); }; function c2(d, x, A) { var S = gf(x), L = gf(1 / x); function D(V) { return d(S(V)); } return D.invert = function(V) { return L(d.invert(V)); }, D.domain = function(V) { return arguments.length ? (d.domain((A = V.map(Number)).map(S)), D) : A; }, D.ticks = function(V) { return mg(A, V); }, D.tickFormat = function(V, R) { return d3_scale_linearTickFormat(A, V, R); }, D.nice = function(V) { return D.domain(l2(A, V)); }, D.exponent = function(V) { return arguments.length ? (S = gf(x = V), L = gf(1 / x), d.domain(A.map(S)), D) : x; }, D.copy = function() { return c2(d.copy(), x, A); }, o2(D, d); } function gf(d) { return function(x) { return x < 0 ? -Math.pow(-x, d) : Math.pow(x, d); }; } t.scale.sqrt = function() { return t.scale.pow().exponent(0.5); }, t.scale.ordinal = function() { return u2([], { t: "range", a: [[]] }); }; function u2(d, x) { var A, S, L; function D(R) { return S[((A.get(R) || (x.t === "range" ? A.set(R, d.push(R)) : NaN)) - 1) % S.length]; } function V(R, Y) { return t.range(d.length).map(function(ee) { return R + Y * ee; }); } return D.domain = function(R) { if (!arguments.length) return d; d = [], A = new k(); for (var Y = -1, ee = R.length, ne; ++Y < ee; ) A.has(ne = R[Y]) || A.set(ne, d.push(ne)); return D[x.t].apply(D, x.a); }, D.range = function(R) { return arguments.length ? (S = R, L = 0, x = { t: "range", a: arguments }, D) : S; }, D.rangePoints = function(R, Y) { arguments.length < 2 && (Y = 0); var ee = R[0], ne = R[1], ue = d.length < 2 ? (ee = (ee + ne) / 2, 0) : (ne - ee) / (d.length - 1 + Y); return S = V(ee + ue * Y / 2, ue), L = 0, x = { t: "rangePoints", a: arguments }, D; }, D.rangeRoundPoints = function(R, Y) { arguments.length < 2 && (Y = 0); var ee = R[0], ne = R[1], ue = d.length < 2 ? (ee = ne = Math.round((ee + ne) / 2), 0) : (ne - ee) / (d.length - 1 + Y) | 0; return S = V(ee + Math.round(ue * Y / 2 + (ne - ee - (d.length - 1 + Y) * ue) / 2), ue), L = 0, x = { t: "rangeRoundPoints", a: arguments }, D; }, D.rangeBands = function(R, Y, ee) { arguments.length < 2 && (Y = 0), arguments.length < 3 && (ee = Y); var ne = R[1] < R[0], ue = R[ne - 0], fe = R[1 - ne], ke = (fe - ue) / (d.length - Y + 2 * ee); return S = V(ue + ke * ee, ke), ne && S.reverse(), L = ke * (1 - Y), x = { t: "rangeBands", a: arguments }, D; }, D.rangeRoundBands = function(R, Y, ee) { arguments.length < 2 && (Y = 0), arguments.length < 3 && (ee = Y); var ne = R[1] < R[0], ue = R[ne - 0], fe = R[1 - ne], ke = Math.floor((fe - ue) / (d.length - Y + 2 * ee)); return S = V(ue + Math.round((fe - ue - (d.length - Y) * ke) / 2), ke), ne && S.reverse(), L = Math.round(ke * (1 - Y)), x = { t: "rangeRoundBands", a: arguments }, D; }, D.rangeBand = function() { return L; }, D.rangeExtent = function() { return hf(x.a[0]); }, D.copy = function() { return u2(d, x); }, D.domain(d); } t.scale.category10 = function() { return t.scale.ordinal().range(XF); }, t.scale.category20 = function() { return t.scale.ordinal().range(e7); }, t.scale.category20b = function() { return t.scale.ordinal().range(t7); }, t.scale.category20c = function() { return t.scale.ordinal().range(n7); }; var XF = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(zr), e7 = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(zr), t7 = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(zr), n7 = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(zr); t.scale.quantile = function() { return d2([], []); }; function d2(d, x) { var A; function S() { var D = 0, V = x.length; for (A = []; ++D < V; ) A[D - 1] = t.quantile(d, D / V); return L; } function L(D) { if (!isNaN(D = +D)) return x[t.bisect(A, D)]; } return L.domain = function(D) { return arguments.length ? (d = D.map(g).filter(p).sort(h), S()) : d; }, L.range = function(D) { return arguments.length ? (x = D, S()) : x; }, L.quantiles = function() { return A; }, L.invertExtent = function(D) { return D = x.indexOf(D), D < 0 ? [NaN, NaN] : [D > 0 ? A[D - 1] : d[0], D < A.length ? A[D] : d[d.length - 1]]; }, L.copy = function() { return d2(d, x); }, S(); } t.scale.quantize = function() { return f2(0, 1, [0, 1]); }; function f2(d, x, A) { var S, L; function D(R) { return A[Math.max(0, Math.min(L, Math.floor(S * (R - d))))]; } function V() { return S = A.length / (x - d), L = A.length - 1, D; } return D.domain = function(R) { return arguments.length ? (d = +R[0], x = +R[R.length - 1], V()) : [d, x]; }, D.range = function(R) { return arguments.length ? (A = R, V()) : A; }, D.invertExtent = function(R) { return R = A.indexOf(R), R = R < 0 ? NaN : R / S + d, [R, R + 1 / S]; }, D.copy = function() { return f2(d, x, A); }, V(); } t.scale.threshold = function() { return h2([0.5], [0, 1]); }; function h2(d, x) { function A(S) { if (S <= S) return x[t.bisect(d, S)]; } return A.domain = function(S) { return arguments.length ? (d = S, A) : d; }, A.range = function(S) { return arguments.length ? (x = S, A) : x; }, A.invertExtent = function(S) { return S = x.indexOf(S), [d[S - 1], d[S]]; }, A.copy = function() { return h2(d, x); }, A; } t.scale.identity = function() { return p2([0, 1]); }; function p2(d) { function x(A) { return +A; } return x.invert = x, x.domain = x.range = function(A) { return arguments.length ? (d = A.map(x), x) : d; }, x.ticks = function(A) { return mg(d, A); }, x.tickFormat = function(A, S) { return d3_scale_linearTickFormat(d, A, S); }, x.copy = function() { return p2(d); }, x; } t.svg = {}; function r7() { return 0; } t.svg.arc = function() { var d = a7, x = i7, A = r7, S = vf, L = g2, D = v2, V = o7; function R() { var ee = Math.max(0, +d.apply(this, arguments)), ne = Math.max(0, +x.apply(this, arguments)), ue = L.apply(this, arguments) - se, fe = D.apply(this, arguments) - se, ke = Math.abs(fe - ue), Me = ue > fe ? 0 : 1; if (ne < ee && (he = ne, ne = ee, ee = he), ke >= $) return Y(ne, Me) + (ee ? Y(ee, 1 - Me) : "") + "Z"; var he, me, be, Ae, Le = 0, _e = 0, Ze, gt, xt, mt, St, Ct, Wt, Ft, Ut = []; if ((Ae = (+V.apply(this, arguments) || 0) / 2) && (be = S === vf ? Math.sqrt(ee * ee + ne * ne) : +S.apply(this, arguments), Me || (_e *= -1), ne && (_e = xe(be / ne * Math.sin(Ae))), ee && (Le = xe(be / ee * Math.sin(Ae)))), ne) { Ze = ne * Math.cos(ue + _e), gt = ne * Math.sin(ue + _e), xt = ne * Math.cos(fe - _e), mt = ne * Math.sin(fe - _e); var yn = Math.abs(fe - ue - 2 * _e) <= $e ? 0 : 1; if (_e && mf(Ze, gt, xt, mt) === Me ^ yn) { var Kn = (ue + fe) / 2; Ze = ne * Math.cos(Kn), gt = ne * Math.sin(Kn), xt = mt = null; } } else Ze = gt = 0; if (ee) { St = ee * Math.cos(fe - Le), Ct = ee * Math.sin(fe - Le), Wt = ee * Math.cos(ue + Le), Ft = ee * Math.sin(ue + Le); var _n = Math.abs(ue - fe + 2 * Le) <= $e ? 0 : 1; if (Le && mf(St, Ct, Wt, Ft) === 1 - Me ^ _n) { var ht = (ue + fe) / 2; St = ee * Math.cos(ht), Ct = ee * Math.sin(ht), Wt = Ft = null; } } else St = Ct = 0; if (ke > et && (he = Math.min(Math.abs(ne - ee) / 2, +A.apply(this, arguments))) > 1e-3) { me = ee < ne ^ Me ? 0 : 1; var Zt = he, Qt = he; if (ke < $e) { var xn = Wt == null ? [St, Ct] : xt == null ? [Ze, gt] : tg([Ze, gt], [Wt, Ft], [xt, mt], [St, Ct]), Gn = Ze - xn[0], cr = gt - xn[1], Tr = xt - xn[0], Er = mt - xn[1], qr = 1 / Math.sin(Math.acos((Gn * Tr + cr * Er) / (Math.sqrt(Gn * Gn + cr * cr) * Math.sqrt(Tr * Tr + Er * Er))) / 2), jr = Math.sqrt(xn[0] * xn[0] + xn[1] * xn[1]); Qt = Math.min(he, (ee - jr) / (qr - 1)), Zt = Math.min(he, (ne - jr) / (qr + 1)); } if (xt != null) { var Xr = yf(Wt == null ? [St, Ct] : [Wt, Ft], [Ze, gt], ne, Zt, Me), Cr = yf([xt, mt], [St, Ct], ne, Zt, Me); he === Zt ? Ut.push("M", Xr[0], "A", Zt, ",", Zt, " 0 0,", me, " ", Xr[1], "A", ne, ",", ne, " 0 ", 1 - Me ^ mf(Xr[1][0], Xr[1][1], Cr[1][0], Cr[1][1]), ",", Me, " ", Cr[1], "A", Zt, ",", Zt, " 0 0,", me, " ", Cr[0]) : Ut.push("M", Xr[0], "A", Zt, ",", Zt, " 0 1,", me, " ", Cr[0]); } else Ut.push("M", Ze, ",", gt); if (Wt != null) { var ea = yf([Ze, gt], [Wt, Ft], ee, -Qt, Me), Ml = yf([St, Ct], xt == null ? [Ze, gt] : [xt, mt], ee, -Qt, Me); he === Qt ? Ut.push("L", Ml[0], "A", Qt, ",", Qt, " 0 0,", me, " ", Ml[1], "A", ee, ",", ee, " 0 ", Me ^ mf(Ml[1][0], Ml[1][1], ea[1][0], ea[1][1]), ",", 1 - Me, " ", ea[1], "A", Qt, ",", Qt, " 0 0,", me, " ", ea[0]) : Ut.push("L", Ml[0], "A", Qt, ",", Qt, " 0 0,", me, " ", ea[0]); } else Ut.push("L", St, ",", Ct); } else Ut.push("M", Ze, ",", gt), xt != null && Ut.push("A", ne, ",", ne, " 0 ", yn, ",", Me, " ", xt, ",", mt), Ut.push("L", St, ",", Ct), Wt != null && Ut.push("A", ee, ",", ee, " 0 ", _n, ",", 1 - Me, " ", Wt, ",", Ft); return Ut.push("Z"), Ut.join(""); } function Y(ee, ne) { return "M0," + ee + "A" + ee + "," + ee + " 0 1," + ne + " 0," + -ee + "A" + ee + "," + ee + " 0 1," + ne + " 0," + ee; } return R.innerRadius = function(ee) { return arguments.length ? (d = mn(ee), R) : d; }, R.outerRadius = function(ee) { return arguments.length ? (x = mn(ee), R) : x; }, R.cornerRadius = function(ee) { return arguments.length ? (A = mn(ee), R) : A; }, R.padRadius = function(ee) { return arguments.length ? (S = ee == vf ? vf : mn(ee), R) : S; }, R.startAngle = function(ee) { return arguments.length ? (L = mn(ee), R) : L; }, R.endAngle = function(ee) { return arguments.length ? (D = mn(ee), R) : D; }, R.padAngle = function(ee) { return arguments.length ? (V = mn(ee), R) : V; }, R.centroid = function() { var ee = (+d.apply(this, arguments) + +x.apply(this, arguments)) / 2, ne = (+L.apply(this, arguments) + +D.apply(this, arguments)) / 2 - se; return [Math.cos(ne) * ee, Math.sin(ne) * ee]; }, R; }; var vf = "auto"; function a7(d) { return d.innerRadius; } function i7(d) { return d.outerRadius; } function g2(d) { return d.startAngle; } function v2(d) { return d.endAngle; } function o7(d) { return d && d.padAngle; } function mf(d, x, A, S) { return (d - A) * x - (x - S) * d > 0 ? 0 : 1; } function yf(d, x, A, S, L) { var D = d[0] - x[0], V = d[1] - x[1], R = (L ? S : -S) / Math.sqrt(D * D + V * V), Y = R * V, ee = -R * D, ne = d[0] + Y, ue = d[1] + ee, fe = x[0] + Y, ke = x[1] + ee, Me = (ne + fe) / 2, he = (ue + ke) / 2, me = fe - ne, be = ke - ue, Ae = me * me + be * be, Le = A - S, _e = ne * ke - fe * ue, Ze = (be < 0 ? -1 : 1) * Math.sqrt(Math.max(0, Le * Le * Ae - _e * _e)), gt = (_e * be - me * Ze) / Ae, xt = (-_e * me - be * Ze) / Ae, mt = (_e * be + me * Ze) / Ae, St = (-_e * me + be * Ze) / Ae, Ct = gt - Me, Wt = xt - he, Ft = mt - Me, Ut = St - he; return Ct * Ct + Wt * Wt > Ft * Ft + Ut * Ut && (gt = mt, xt = St), [[gt - Y, xt - ee], [gt * A / Le, xt * A / Le]]; } function m2() { return !0; } function y2(d) { var x = ks, A = au, S = m2, L = Xa, D = L.key, V = 0.7; function R(Y) { var ee = [], ne = [], ue = -1, fe = Y.length, ke, Me = mn(x), he = mn(A); function me() { ee.push("M", L(d(ne), V)); } for (; ++ue < fe; ) S.call(this, ke = Y[ue], ue) ? ne.push([+Me.call(this, ke, ue), +he.call(this, ke, ue)]) : ne.length && (me(), ne = []); return ne.length && me(), ee.length ? ee.join("") : null; } return R.x = function(Y) { return arguments.length ? (x = Y, R) : x; }, R.y = function(Y) { return arguments.length ? (A = Y, R) : A; }, R.defined = function(Y) { return arguments.length ? (S = Y, R) : S; }, R.interpolate = function(Y) { return arguments.length ? (typeof Y == "function" ? D = L = Y : D = (L = yg.get(Y) || Xa).key, R) : D; }, R.tension = function(Y) { return arguments.length ? (V = Y, R) : V; }, R; } t.svg.line = function() { return y2(U); }; var yg = t.map({ linear: Xa, "linear-closed": x2, step: l7, "step-before": xg, "step-after": bg, basis: b2, "basis-open": d7, "basis-closed": f7, bundle: h7, cardinal: u7, "cardinal-open": s7, "cardinal-closed": c7, monotone: v7 }); yg.forEach(function(d, x) { x.key = d, x.closed = /-closed$/.test(d); }); function Xa(d) { return d.length > 1 ? d.join("L") : d + "Z"; } function x2(d) { return d.join("L") + "Z"; } function l7(d) { for (var x = 0, A = d.length, S = d[0], L = [S[0], ",", S[1]]; ++x < A; ) L.push("H", (S[0] + (S = d[x])[0]) / 2, "V", S[1]); return A > 1 && L.push("H", S[0]), L.join(""); } function xg(d) { for (var x = 0, A = d.length, S = d[0], L = [S[0], ",", S[1]]; ++x < A; ) L.push("V", (S = d[x])[1], "H", S[0]); return L.join(""); } function bg(d) { for (var x = 0, A = d.length, S = d[0], L = [S[0], ",", S[1]]; ++x < A; ) L.push("H", (S = d[x])[0], "V", S[1]); return L.join(""); } function s7(d, x) { return d.length < 4 ? Xa(d) : d[1] + xf(d.slice(1, -1), wg(d, x)); } function c7(d, x) { return d.length < 3 ? x2(d) : d[0] + xf((d.push(d[0]), d), wg([d[d.length - 2]].concat(d, [d[1]]), x)); } function u7(d, x) { return d.length < 3 ? Xa(d) : d[0] + xf(d, wg(d, x)); } function xf(d, x) { if (x.length < 1 || d.length != x.length && d.length != x.length + 2) return Xa(d); var A = d.length != x.length, S = "", L = d[0], D = d[1], V = x[0], R = V, Y = 1; if (A && (S += "Q" + (D[0] - V[0] * 2 / 3) + "," + (D[1] - V[1] * 2 / 3) + "," + D[0] + "," + D[1], L = d[1], Y = 2), x.length > 1) { R = x[1], D = d[Y], Y++, S += "C" + (L[0] + V[0]) + "," + (L[1] + V[1]) + "," + (D[0] - R[0]) + "," + (D[1] - R[1]) + "," + D[0] + "," + D[1]; for (var ee = 2; ee < x.length; ee++, Y++) D = d[Y], R = x[ee], S += "S" + (D[0] - R[0]) + "," + (D[1] - R[1]) + "," + D[0] + "," + D[1]; } if (A) { var ne = d[Y]; S += "Q" + (D[0] + R[0] * 2 / 3) + "," + (D[1] + R[1] * 2 / 3) + "," + ne[0] + "," + ne[1]; } return S; } function wg(d, x) { for (var A = [], S = (1 - x) / 2, L, D = d[0], V = d[1], R = 1, Y = d.length; ++R < Y; ) L = D, D = V, V = d[R], A.push([S * (V[0] - L[0]), S * (V[1] - L[1])]); return A; } function b2(d) { if (d.length < 3) return Xa(d); var x = 1, A = d.length, S = d[0], L = S[0], D = S[1], V = [L, L, L, (S = d[1])[0]], R = [D, D, D, S[1]], Y = [L, ",", D, "L", Sa(Io, V), ",", Sa(Io, R)]; for (d.push(d[A - 1]); ++x <= A; ) S = d[x], V.shift(), V.push(S[0]), R.shift(), R.push(S[1]), _g(Y, V, R); return d.pop(), Y.push("L", S), Y.join(""); } function d7(d) { if (d.length < 4) return Xa(d); for (var x = [], A = -1, S = d.length, L, D = [0], V = [0]; ++A < 3; ) L = d[A], D.push(L[0]), V.push(L[1]); for (x.push(Sa(Io, D) + "," + Sa(Io, V)), --A; ++A < S; ) L = d[A], D.shift(), D.push(L[0]), V.shift(), V.push(L[1]), _g(x, D, V); return x.join(""); } function f7(d) { for (var x, A = -1, S = d.length, L = S + 4, D, V = [], R = []; ++A < 4; ) D = d[A % S], V.push(D[0]), R.push(D[1]); for (x = [Sa(Io, V), ",", Sa(Io, R)], --A; ++A < L; ) D = d[A % S], V.shift(), V.push(D[0]), R.shift(), R.push(D[1]), _g(x, V, R); return x.join(""); } function h7(d, x) { var A = d.length - 1; if (A) for (var S = d[0][0], L = d[0][1], D = d[A][0] - S, V = d[A][1] - L, R = -1, Y, ee; ++R <= A; ) Y = d[R], ee = R / A, Y[0] = x * Y[0] + (1 - x) * (S + ee * D), Y[1] = x * Y[1] + (1 - x) * (L + ee * V); return b2(d); } function Sa(d, x) { return d[0] * x[0] + d[1] * x[1] + d[2] * x[2] + d[3] * x[3]; } var w2 = [0, 2 / 3, 1 / 3, 0], _2 = [0, 1 / 3, 2 / 3, 0], Io = [0, 1 / 6, 2 / 3, 1 / 6]; function _g(d, x, A) { d.push("C", Sa(w2, x), ",", Sa(w2, A), ",", Sa(_2, x), ",", Sa(_2, A), ",", Sa(Io, x), ",", Sa(Io, A)); } function kg(d, x) { return (x[1] - d[1]) / (x[0] - d[0]); } function p7(d) { for (var x = 0, A = d.length - 1, S = [], L = d[0], D = d[1], V = S[0] = kg(L, D); ++x < A; ) S[x] = (V + (V = kg(L = D, D = d[x + 1]))) / 2; return S[x] = V, S; } function g7(d) { for (var x = [], A, S, L, D, V = p7(d), R = -1, Y = d.length - 1; ++R < Y; ) A = kg(d[R], d[R + 1]), b(A) < et ? V[R] = V[R + 1] = 0 : (S = V[R] / A, L = V[R + 1] / A, D = S * S + L * L, D > 9 && (D = A * 3 / Math.sqrt(D), V[R] = D * S, V[R + 1] = D * L)); for (R = -1; ++R <= Y; ) D = (d[Math.min(Y, R + 1)][0] - d[Math.max(0, R - 1)][0]) / (6 * (1 + V[R] * V[R])), x.push([D || 0, V[R] * D || 0]); return x; } function v7(d) { return d.length < 3 ? Xa(d) : d[0] + xf(d, g7(d)); } t.svg.line.radial = function() { var d = y2(k2); return d.radius = d.x, delete d.x, d.angle = d.y, delete d.y, d; }; function k2(d) { for (var x, A = -1, S = d.length, L, D; ++A < S; ) x = d[A], L = x[0], D = x[1] - se, x[0] = L * Math.cos(D), x[1] = L * Math.sin(D); return d; } function T2(d) { var x = ks, A = ks, S = 0, L = au, D = m2, V = Xa, R = V.key, Y = V, ee = "L", ne = 0.7; function ue(fe) { var ke = [], Me = [], he = [], me = -1, be = fe.length, Ae, Le = mn(x), _e = mn(S), Ze = x === A ? function() { return xt; } : mn(A), gt = S === L ? function() { return mt; } : mn(L), xt, mt; function St() { ke.push("M", V(d(he), ne), ee, Y(d(Me.reverse()), ne), "Z"); } for (; ++me < be; ) D.call(this, Ae = fe[me], me) ? (Me.push([xt = +Le.call(this, Ae, me), mt = +_e.call(this, Ae, me)]), he.push([+Ze.call(this, Ae, me), +gt.call(this, Ae, me)])) : Me.length && (St(), Me = [], he = []); return Me.length && St(), ke.length ? ke.join("") : null; } return ue.x = function(fe) { return arguments.length ? (x = A = fe, ue) : A; }, ue.x0 = function(fe) { return arguments.length ? (x = fe, ue) : x; }, ue.x1 = function(fe) { return arguments.length ? (A = fe, ue) : A; }, ue.y = function(fe) { return arguments.length ? (S = L = fe, ue) : L; }, ue.y0 = function(fe) { return arguments.length ? (S = fe, ue) : S; }, ue.y1 = function(fe) { return arguments.length ? (L = fe, ue) : L; }, ue.defined = function(fe) { return arguments.length ? (D = fe, ue) : D; }, ue.interpolate = function(fe) { return arguments.length ? (typeof fe == "function" ? R = V = fe : R = (V = yg.get(fe) || Xa).key, Y = V.reverse || V, ee = V.closed ? "M" : "L", ue) : R; }, ue.tension = function(fe) { return arguments.length ? (ne = fe, ue) : ne; }, ue; } xg.reverse = bg, bg.reverse = xg, t.svg.area = function() { return T2(U); }, t.svg.area.radial = function() { var d = T2(k2); return d.radius = d.x, delete d.x, d.innerRadius = d.x0, delete d.x0, d.outerRadius = d.x1, delete d.x1, d.angle = d.y, delete d.y, d.startAngle = d.y0, delete d.y0, d.endAngle = d.y1, delete d.y1, d; }; function A2(d) { return d.source; } function M2(d) { return d.target; } t.svg.chord = function() { var d = A2, x = M2, A = m7, S = g2, L = v2; function D(ne, ue) { var fe = V(this, d, ne, ue), ke = V(this, x, ne, ue); return "M" + fe.p0 + Y(fe.r, fe.p1, fe.a1 - fe.a0) + (R(fe, ke) ? ee(fe.r, fe.p1, fe.r, fe.p0) : ee(fe.r, fe.p1, ke.r, ke.p0) + Y(ke.r, ke.p1, ke.a1 - ke.a0) + ee(ke.r, ke.p1, fe.r, fe.p0)) + "Z"; } function V(ne, ue, fe, ke) { var Me = ue.call(ne, fe, ke), he = A.call(ne, Me, ke), me = S.call(ne, Me, ke) - se, be = L.call(ne, Me, ke) - se; return { r: he, a0: me, a1: be, p0: [he * Math.cos(me), he * Math.sin(me)], p1: [he * Math.cos(be), he * Math.sin(be)] }; } function R(ne, ue) { return ne.a0 == ue.a0 && ne.a1 == ue.a1; } function Y(ne, ue, fe) { return "A" + ne + "," + ne + " 0 " + +(fe > $e) + ",1 " + ue; } function ee(ne, ue, fe, ke) { return "Q 0,0 " + ke; } return D.radius = function(ne) { return arguments.length ? (A = mn(ne), D) : A; }, D.source = function(ne) { return arguments.length ? (d = mn(ne), D) : d; }, D.target = function(ne) { return arguments.length ? (x = mn(ne), D) : x; }, D.startAngle = function(ne) { return arguments.length ? (S = mn(ne), D) : S; }, D.endAngle = function(ne) { return arguments.length ? (L = mn(ne), D) : L; }, D; }; function m7(d) { return d.radius; } t.svg.diagonal = function() { var d = A2, x = M2, A = S2; function S(L, D) { var V = d.call(this, L, D), R = x.call(this, L, D), Y = (V.y + R.y) / 2, ee = [V, { x: V.x, y: Y }, { x: R.x, y: Y }, R]; return ee = ee.map(A), "M" + ee[0] + "C" + ee[1] + " " + ee[2] + " " + ee[3]; } return S.source = function(L) { return arguments.length ? (d = mn(L), S) : d; }, S.target = function(L) { return arguments.length ? (x = mn(L), S) : x; }, S.projection = function(L) { return arguments.length ? (A = L, S) : A; }, S; }; function S2(d) { return [d.x, d.y]; } t.svg.diagonal.radial = function() { var d = t.svg.diagonal(), x = S2, A = d.projection; return d.projection = function(S) { return arguments.length ? A(y7(x = S)) : x; }, d; }; function y7(d) { return function() { var x = d.apply(this, arguments), A = x[0], S = x[1] - se; return [A * Math.cos(S), A * Math.sin(S)]; }; } t.svg.symbol = function() { var d = b7, x = x7; function A(S, L) { return (L2.get(d.call(this, S, L)) || C2)(x.call(this, S, L)); } return A.type = function(S) { return arguments.length ? (d = mn(S), A) : d; }, A.size = function(S) { return arguments.length ? (x = mn(S), A) : x; }, A; }; function x7() { return 64; } function b7() { return "circle"; } function C2(d) { var x = Math.sqrt(d / $e); return "M0," + x + "A" + x + "," + x + " 0 1,1 0," + -x + "A" + x + "," + x + " 0 1,1 0," + x + "Z"; } var L2 = t.map({ circle: C2, cross: function(d) { var x = Math.sqrt(d / 5) / 2; return "M" + -3 * x + "," + -x + "H" + -x + "V" + -3 * x + "H" + x + "V" + -x + "H" + 3 * x + "V" + x + "H" + x + "V" + 3 * x + "H" + -x + "V" + x + "H" + -3 * x + "Z"; }, diamond: function(d) { var x = Math.sqrt(d / (2 * O2)), A = x * O2; return "M0," + -x + "L" + A + ",0 0," + x + " " + -A + ",0Z"; }, square: function(d) { var x = Math.sqrt(d) / 2; return "M" + -x + "," + -x + "L" + x + "," + -x + " " + x + "," + x + " " + -x + "," + x + "Z"; }, "triangle-down": function(d) { var x = Math.sqrt(d / bf), A = x * bf / 2; return "M0," + A + "L" + x + "," + -A + " " + -x + "," + -A + "Z"; }, "triangle-up": function(d) { var x = Math.sqrt(d / bf), A = x * bf / 2; return "M0," + -A + "L" + x + "," + A + " " + -x + "," + A + "Z"; } }); t.svg.symbolTypes = L2.keys(); var bf = Math.sqrt(3), O2 = Math.tan(30 * ie); ae.transition = function(d) { for (var x = Al || ++F2, A = Ag(d), S = [], L, D, V = _f || { time: Date.now(), ease: XD, delay: 0, duration: 250 }, R = -1, Y = this.length; ++R < Y; ) { S.push(L = []); for (var ee = this[R], ne = -1, ue = ee.length; ++ne < ue; ) (D = ee[ne]) && kf(D, ne, A, x, V), L.push(D); } return fu(S, A, x); }, ae.interrupt = function(d) { return this.each(d == null ? wf : D2(Ag(d))); }; var wf = D2(Ag()); function D2(d) { return function() { var x, A, S; (x = this[d]) && (S = x[A = x.active]) && (S.timer.c = null, S.timer.t = NaN, --x.count ? delete x[A] : delete this[d], x.active += 0.5, S.event && S.event.interrupt.call(this, this.__data__, S.index)); }; } function fu(d, x, A) { return ce(d, sr), d.namespace = x, d.id = A, d; } var sr = [], F2 = 0, Al, _f; sr.call = ae.call, sr.empty = ae.empty, sr.node = ae.node, sr.size = ae.size, t.transition = function(d, x) { return d && d.transition ? Al ? d.transition(x) : d : t.selection().transition(d); }, t.transition.prototype = sr, sr.select = function(d) { var x = this.id, A = this.namespace, S = [], L, D, V; d = ge(d); for (var R = -1, Y = this.length; ++R < Y; ) { S.push(L = []); for (var ee = this[R], ne = -1, ue = ee.length; ++ne < ue; ) (V = ee[ne]) && (D = d.call(V, V.__data__, ne, R)) ? ("__data__" in V && (D.__data__ = V.__data__), kf(D, ne, A, x, V[A][x]), L.push(D)) : L.push(null); } return fu(S, A, x); }, sr.selectAll = function(d) { var x = this.id, A = this.namespace, S = [], L, D, V, R, Y; d = ve(d); for (var ee = -1, ne = this.length; ++ee < ne; ) for (var ue = this[ee], fe = -1, ke = ue.length; ++fe < ke; ) if (V = ue[fe]) { Y = V[A][x], D = d.call(V, V.__data__, fe, ee), S.push(L = []); for (var Me = -1, he = D.length; ++Me < he; ) (R = D[Me]) && kf(R, Me, A, x, Y), L.push(R); } return fu(S, A, x); }, sr.filter = function(d) { var x = [], A, S, L; typeof d != "function" && (d = vt(d)); for (var D = 0, V = this.length; D < V; D++) { x.push(A = []); for (var S = this[D], R = 0, Y = S.length; R < Y; R++) (L = S[R]) && d.call(L, L.__data__, R, D) && A.push(L); } return fu(x, this.namespace, this.id); }, sr.tween = function(d, x) { var A = this.id, S = this.namespace; return arguments.length < 2 ? this.node()[S][A].tween.get(d) : ut(this, x == null ? function(L) { L[S][A].tween.remove(d); } : function(L) { L[S][A].tween.set(d, x); }); }; function Tg(d, x, A, S) { var L = d.id, D = d.namespace; return ut(d, typeof A == "function" ? function(V, R, Y) { V[D][L].tween.set(x, S(A.call(V, V.__data__, R, Y))); } : (A = S(A), function(V) { V[D][L].tween.set(x, A); })); } sr.attr = function(d, x) { if (arguments.length < 2) { for (x in d) this.attr(x, d[x]); return this; } var A = d == "transform" ? Ub : Tl, S = t.ns.qualify(d); function L() { this.removeAttribute(S); } function D() { this.removeAttributeNS(S.space, S.local); } function V(Y) { return Y == null ? L : (Y += "", function() { var ee = this.getAttribute(S), ne; return ee !== Y && (ne = A(ee, Y), function(ue) { this.setAttribute(S, ne(ue)); }); }); } function R(Y) { return Y == null ? D : (Y += "", function() { var ee = this.getAttributeNS(S.space, S.local), ne; return ee !== Y && (ne = A(ee, Y), function(ue) { this.setAttributeNS(S.space, S.local, ne(ue)); }); }); } return Tg(this, "attr." + d, x, S.local ? R : V); }, sr.attrTween = function(d, x) { var A = t.ns.qualify(d); function S(D, V) { var R = x.call(this, D, V, this.getAttribute(A)); return R && function(Y) { this.setAttribute(A, R(Y)); }; } function L(D, V) { var R = x.call(this, D, V, this.getAttributeNS(A.space, A.local)); return R && function(Y) { this.setAttributeNS(A.space, A.local, R(Y)); }; } return this.tween("attr." + d, A.local ? L : S); }, sr.style = function(d, x, A) { var S = arguments.length; if (S < 3) { if (typeof d != "string") { S < 2 && (x = ""); for (A in d) this.style(A, d[A], x); return this; } A = ""; } function L() { this.style.removeProperty(d); } function D(V) { return V == null ? L : (V += "", function() { var R = o(this).getComputedStyle(this, null).getPropertyValue(d), Y; return R !== V && (Y = Tl(R, V), function(ee) { this.style.setProperty(d, Y(ee), A); }); }); } return Tg(this, "style." + d, x, D); }, sr.styleTween = function(d, x, A) { arguments.length < 3 && (A = ""); function S(L, D) { var V = x.call(this, L, D, o(this).getComputedStyle(this, null).getPropertyValue(d)); return V && function(R) { this.style.setProperty(d, V(R), A); }; } return this.tween("style." + d, S); }, sr.text = function(d) { return Tg(this, "text", d, w7); }; function w7(d) { return d == null && (d = ""), function() { this.textContent = d; }; } sr.remove = function() { var d = this.namespace; return this.each("end.transition", function() { var x; this[d].count < 2 && (x = this.parentNode) && x.removeChild(this); }); }, sr.ease = function(d) { var x = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][x].ease : (typeof d != "function" && (d = t.ease.apply(t, arguments)), ut(this, function(S) { S[A][x].ease = d; })); }, sr.delay = function(d) { var x = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][x].delay : ut(this, typeof d == "function" ? function(S, L, D) { S[A][x].delay = +d.call(S, S.__data__, L, D); } : (d = +d, function(S) { S[A][x].delay = d; })); }, sr.duration = function(d) { var x = this.id, A = this.namespace; return arguments.length < 1 ? this.node()[A][x].duration : ut(this, typeof d == "function" ? function(S, L, D) { S[A][x].duration = Math.max(1, d.call(S, S.__data__, L, D)); } : (d = Math.max(1, d), function(S) { S[A][x].duration = d; })); }, sr.each = function(d, x) { var A = this.id, S = this.namespace; if (arguments.length < 2) { var L = _f, D = Al; try { Al = A, ut(this, function(V, R, Y) { _f = V[S][A], d.call(V, V.__data__, R, Y); }); } finally { _f = L, Al = D; } } else ut(this, function(V) { var R = V[S][A]; (R.event || (R.event = t.dispatch("start", "end", "interrupt"))).on(d, x); }); return this; }, sr.transition = function() { for (var d = this.id, x = ++F2, A = this.namespace, S = [], L, D, V, R, Y = 0, ee = this.length; Y < ee; Y++) { S.push(L = []); for (var D = this[Y], ne = 0, ue = D.length; ne < ue; ne++) (V = D[ne]) && (R = V[A][d], kf(V, ne, A, x, { time: R.time, ease: R.ease, delay: R.delay + R.duration, duration: R.duration })), L.push(V); } return fu(S, A, x); }; function Ag(d) { return d == null ? "__transition__" : "__transition_" + d + "__"; } function kf(d, x, A, S, L) { var D = d[A] || (d[A] = { active: 0, count: 0 }), V = D[S], R, Y, ee, ne, ue; function fe(he) { var me = V.delay; if (Y.t = me + R, me <= he) return ke(he - me); Y.c = ke; } function ke(he) { var me = D.active, be = D[me]; be && (be.timer.c = null, be.timer.t = NaN, --D.count, delete D[me], be.event && be.event.interrupt.call(d, d.__data__, be.index)); for (var Ae in D) if (+Ae < S) { var Le = D[Ae]; Le.timer.c = null, Le.timer.t = NaN, --D.count, delete D[Ae]; } Y.c = Me, ha(function() { return Y.c && Me(he || 1) && (Y.c = null, Y.t = NaN), 1; }, 0, R), D.active = S, V.event && V.event.start.call(d, d.__data__, x), ue = [], V.tween.forEach(function(_e, Ze) { (Ze = Ze.call(d, d.__data__, x)) && ue.push(Ze); }), ne = V.ease, ee = V.duration; } function Me(he) { for (var me = he / ee, be = ne(me), Ae = ue.length; Ae > 0; ) ue[--Ae].call(d, be); if (me >= 1) return V.event && V.event.end.call(d, d.__data__, x), --D.count ? delete D[S] : delete d[A], 1; } V || (R = L.time, Y = ha(fe, 0, R), V = D[S] = { tween: new k(), time: R, timer: Y, delay: L.delay, duration: L.duration, ease: L.ease, index: x }, L = null, ++D.count); } t.svg.axis = function() { var d = t.scale.linear(), x = I2, A = 6, S = 6, L = 3, D = [10], V = null, R; function Y(ee) { ee.each(function() { var ne = t.select(this), ue = this.__chart__ || d, fe = this.__chart__ = d.copy(), ke = V ?? (fe.ticks ? fe.ticks.apply(fe, D) : fe.domain()), Me = R ?? (fe.tickFormat ? fe.tickFormat.apply(fe, D) : U), he = ne.selectAll(".tick").data(ke, fe), me = he.enter().insert("g", ".domain").attr("class", "tick").style("opacity", et), be = t.transition(he.exit()).style("opacity", et).remove(), Ae = t.transition(he.order()).style("opacity", 1), Le = Math.max(A, 0) + L, _e, Ze = pf(fe), gt = ne.selectAll(".domain").data([0]), xt = (gt.enter().append("path").attr("class", "domain"), t.transition(gt)); me.append("line"), me.append("text"); var mt = me.select("line"), St = Ae.select("line"), Ct = he.select("text").text(Me), Wt = me.select("text"), Ft = Ae.select("text"), Ut = x === "top" || x === "left" ? -1 : 1, yn, Kn, _n, ht; if (x === "bottom" || x === "top" ? (_e = k7, yn = "x", _n = "y", Kn = "x2", ht = "y2", Ct.attr("dy", Ut < 0 ? "0em" : ".71em").style("text-anchor", "middle"), xt.attr("d", "M" + Ze[0] + "," + Ut * S + "V0H" + Ze[1] + "V" + Ut * S)) : (_e = T7, yn = "y", _n = "x", Kn = "y2", ht = "x2", Ct.attr("dy", ".32em").style("text-anchor", Ut < 0 ? "end" : "start"), xt.attr("d", "M" + Ut * S + "," + Ze[0] + "H0V" + Ze[1] + "H" + Ut * S)), mt.attr(ht, Ut * A), Wt.attr(_n, Ut * Le), St.attr(Kn, 0).attr(ht, Ut * A), Ft.attr(yn, 0).attr(_n, Ut * Le), fe.rangeBand) { var Zt = fe, Qt = Zt.rangeBand() / 2; ue = fe = function(xn) { return Zt(xn) + Qt; }; } else ue.rangeBand ? ue = fe : be.call(_e, fe, ue); me.call(_e, ue, fe), Ae.call(_e, fe, fe); }); } return Y.scale = function(ee) { return arguments.length ? (d = ee, Y) : d; }, Y.orient = function(ee) { return arguments.length ? (x = ee in _7 ? ee + "" : I2, Y) : x; }, Y.ticks = function() { return arguments.length ? (D = r(arguments), Y) : D; }, Y.tickValues = function(ee) { return arguments.length ? (V = ee, Y) : V; }, Y.tickFormat = function(ee) { return arguments.length ? (R = ee, Y) : R; }, Y.tickSize = function(ee) { var ne = arguments.length; return ne ? (A = +ee, S = +arguments[ne - 1], Y) : A; }, Y.innerTickSize = function(ee) { return arguments.length ? (A = +ee, Y) : A; }, Y.outerTickSize = function(ee) { return arguments.length ? (S = +ee, Y) : S; }, Y.tickPadding = function(ee) { return arguments.length ? (L = +ee, Y) : L; }, Y.tickSubdivide = function() { return arguments.length && Y; }, Y; }; var I2 = "bottom", _7 = { top: 1, right: 1, bottom: 1, left: 1 }; function k7(d, x, A) { d.attr("transform", function(S) { var L = x(S); return "translate(" + (isFinite(L) ? L : A(S)) + ",0)"; }); } function T7(d, x, A) { d.attr("transform", function(S) { var L = x(S); return "translate(0," + (isFinite(L) ? L : A(S)) + ")"; }); } t.svg.brush = function() { var d = te(ne, "brushstart", "brush", "brushend"), x = null, A = null, S = [0, 0], L = [0, 0], D, V, R = !0, Y = !0, ee = Mg[0]; function ne(he) { he.each(function() { var me = t.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", Me).on("touchstart.brush", Me), be = me.selectAll(".background").data([0]); be.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), me.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move"); var Ae = me.selectAll(".resize").data(ee, U); Ae.exit().remove(), Ae.enter().append("g").attr("class", function(gt) { return "resize " + gt; }).style("cursor", function(gt) { return A7[gt]; }).append("rect").attr("x", function(gt) { return /[ew]$/.test(gt) ? -3 : null; }).attr("y", function(gt) { return /^[ns]/.test(gt) ? -3 : null; }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), Ae.style("display", ne.empty() ? "none" : null); var Le = t.transition(me), _e = t.transition(be), Ze; x && (Ze = pf(x), _e.attr("x", Ze[0]).attr("width", Ze[1] - Ze[0]), fe(Le)), A && (Ze = pf(A), _e.attr("y", Ze[0]).attr("height", Ze[1] - Ze[0]), ke(Le)), ue(Le); }); } ne.event = function(he) { he.each(function() { var me = d.of(this, arguments), be = { x: S, y: L, i: D, j: V }, Ae = this.__chart__ || be; this.__chart__ = be, Al ? t.select(this).transition().each("start.brush", function() { D = Ae.i, V = Ae.j, S = Ae.x, L = Ae.y, me({ type: "brushstart" }); }).tween("brush:brush", function() { var Le = ff(S, be.x), _e = ff(L, be.y); return D = V = null, function(Ze) { S = be.x = Le(Ze), L = be.y = _e(Ze), me({ type: "brush", mode: "resize" }); }; }).each("end.brush", function() { D = be.i, V = be.j, me({ type: "brush", mode: "resize" }), me({ type: "brushend" }); }) : (me({ type: "brushstart" }), me({ type: "brush", mode: "resize" }), me({ type: "brushend" })); }); }; function ue(he) { he.selectAll(".resize").attr("transform", function(me) { return "translate(" + S[+/e$/.test(me)] + "," + L[+/^s/.test(me)] + ")"; }); } function fe(he) { he.select(".extent").attr("x", S[0]), he.selectAll(".extent,.n>rect,.s>rect").attr("width", S[1] - S[0]); } function ke(he) { he.select(".extent").attr("y", L[0]), he.selectAll(".extent,.e>rect,.w>rect").attr("height", L[1] - L[0]); } function Me() { var he = this, me = t.select(t.event.target), be = d.of(he, arguments), Ae = t.select(he), Le = me.datum(), _e = !/^(n|s)$/.test(Le) && x, Ze = !/^(e|w)$/.test(Le) && A, gt = me.classed("extent"), xt = je(he), mt, St = t.mouse(he), Ct, Wt = t.select(o(he)).on("keydown.brush", yn).on("keyup.brush", Kn); if (t.event.changedTouches ? Wt.on("touchmove.brush", _n).on("touchend.brush", Zt) : Wt.on("mousemove.brush", _n).on("mouseup.brush", Zt), Ae.interrupt().selectAll("*").interrupt(), gt) St[0] = S[0] - St[0], St[1] = L[0] - St[1]; else if (Le) { var Ft = +/w$/.test(Le), Ut = +/^n/.test(Le); Ct = [S[1 - Ft] - St[0], L[1 - Ut] - St[1]], St[0] = S[Ft], St[1] = L[Ut]; } else t.event.altKey && (mt = St.slice()); Ae.style("pointer-events", "none").selectAll(".resize").style("display", null), t.select("body").style("cursor", me.style("cursor")), be({ type: "brushstart" }), _n(); function yn() { t.event.keyCode == 32 && (gt || (mt = null, St[0] -= S[1], St[1] -= L[1], gt = 2), Q()); } function Kn() { t.event.keyCode == 32 && gt == 2 && (St[0] += S[1], St[1] += L[1], gt = 0, Q()); } function _n() { var Qt = t.mouse(he), xn = !1; Ct && (Qt[0] += Ct[0], Qt[1] += Ct[1]), gt || (t.event.altKey ? (mt || (mt = [(S[0] + S[1]) / 2, (L[0] + L[1]) / 2]), St[0] = S[+(Qt[0] < mt[0])], St[1] = L[+(Qt[1] < mt[1])]) : mt = null), _e && ht(Qt, x, 0) && (fe(Ae), xn = !0), Ze && ht(Qt, A, 1) && (ke(Ae), xn = !0), xn && (ue(Ae), be({ type: "brush", mode: gt ? "move" : "resize" })); } function ht(Qt, xn, Gn) { var cr = pf(xn), Tr = cr[0], Er = cr[1], qr = St[Gn], jr = Gn ? L : S, Xr = jr[1] - jr[0], Cr, ea; if (gt && (Tr -= qr, Er -= Xr + qr), Cr = (Gn ? Y : R) ? Math.max(Tr, Math.min(Er, Qt[Gn])) : Qt[Gn], gt ? ea = (Cr += qr) + Xr : (mt && (qr = Math.max(Tr, Math.min(Er, 2 * mt[Gn] - Cr))), qr < Cr ? (ea = Cr, Cr = qr) : ea = qr), jr[0] != Cr || jr[1] != ea) return Gn ? V = null : D = null, jr[0] = Cr, jr[1] = ea, !0; } function Zt() { _n(), Ae.style("pointer-events", "all").selectAll(".resize").style("display", ne.empty() ? "none" : null), t.select("body").style("cursor", null), Wt.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), xt(), be({ type: "brushend" }); } } return ne.x = function(he) { return arguments.length ? (x = he, ee = Mg[!x << 1 | !A], ne) : x; }, ne.y = function(he) { return arguments.length ? (A = he, ee = Mg[!x << 1 | !A], ne) : A; }, ne.clamp = function(he) { return arguments.length ? (x && A ? (R = !!he[0], Y = !!he[1]) : x ? R = !!he : A && (Y = !!he), ne) : x && A ? [R, Y] : x ? R : A ? Y : null; }, ne.extent = function(he) { var me, be, Ae, Le, _e; return arguments.length ? (x && (me = he[0], be = he[1], A && (me = me[0], be = be[0]), D = [me, be], x.invert && (me = x(me), be = x(be)), be < me && (_e = me, me = be, be = _e), (me != S[0] || be != S[1]) && (S = [me, be])), A && (Ae = he[0], Le = he[1], x && (Ae = Ae[1], Le = Le[1]), V = [Ae, Le], A.invert && (Ae = A(Ae), Le = A(Le)), Le < Ae && (_e = Ae, Ae = Le, Le = _e), (Ae != L[0] || Le != L[1]) && (L = [Ae, Le])), ne) : (x && (D ? (me = D[0], be = D[1]) : (me = S[0], be = S[1], x.invert && (me = x.invert(me), be = x.invert(be)), be < me && (_e = me, me = be, be = _e))), A && (V ? (Ae = V[0], Le = V[1]) : (Ae = L[0], Le = L[1], A.invert && (Ae = A.invert(Ae), Le = A.invert(Le)), Le < Ae && (_e = Ae, Ae = Le, Le = _e))), x && A ? [[me, Ae], [be, Le]] : x ? [me, be] : A && [Ae, Le]); }, ne.clear = function() { return ne.empty() || (S = [0, 0], L = [0, 0], D = V = null), ne; }, ne.empty = function() { return !!x && S[0] == S[1] || !!A && L[0] == L[1]; }, t.rebind(ne, d, "on"); }; var A7 = { n: "ns-resize", e: "ew-resize", s: "ns-resize", w: "ew-resize", nw: "nwse-resize", ne: "nesw-resize", se: "nwse-resize", sw: "nesw-resize" }, Mg = [["n", "e", "s", "w", "nw", "ne", "se", "sw"], ["e", "w"], ["n", "s"], []]; t.text = Aa(function(d) { return d.responseText; }), t.json = function(d, x) { return Qa(d, "application/json", M7, x); }; function M7(d) { return JSON.parse(d.responseText); } t.html = function(d, x) { return Qa(d, "text/html", S7, x); }; function S7(d) { var x = a.createRange(); return x.selectNode(a.body), x.createContextualFragment(d.responseText); } t.xml = Aa(function(d) { return d.responseXML; }), e.exports ? e.exports = t : this.d3 = t; }).apply(self); })(i4); var sn = i4.exports, Bg = /* @__PURE__ */ new Date(), Hg = /* @__PURE__ */ new Date(); function _r(e, t, n, r) { function a(i) { return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i; } return a.floor = function(i) { return e(i = /* @__PURE__ */ new Date(+i)), i; }, a.ceil = function(i) { return e(i = new Date(i - 1)), t(i, 1), e(i), i; }, a.round = function(i) { var o = a(i), l = a.ceil(i); return i - o < l - i ? o : l; }, a.offset = function(i, o) { return t(i = /* @__PURE__ */ new Date(+i), o == null ? 1 : Math.floor(o)), i; }, a.range = function(i, o, l) { var s = [], c; if (i = a.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < o) || !(l > 0)) return s; do s.push(c = /* @__PURE__ */ new Date(+i)), t(i, l), e(i); while (c < i && i < o); return s; }, a.filter = function(i) { return _r(function(o) { if (o >= o) for (; e(o), !i(o); ) o.setTime(o - 1); }, function(o, l) { if (o >= o) if (l < 0) for (; ++l <= 0; ) for (; t(o, -1), !i(o); ) ; else for (; --l >= 0; ) for (; t(o, 1), !i(o); ) ; }); }, n && (a.count = function(i, o) { return Bg.setTime(+i), Hg.setTime(+o), e(Bg), e(Hg), Math.floor(n(Bg, Hg)); }, a.every = function(i) { return i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? a.filter(r ? function(o) { return r(o) % i === 0; } : function(o) { return a.count(0, o) % i === 0; }) : a; }), a; } var vd = _r(function() { }, function(e, t) { e.setTime(+e + t); }, function(e, t) { return t - e; }); vd.every = function(e) { return e = Math.floor(e), !isFinite(e) || !(e > 0) ? null : e > 1 ? _r(function(t) { t.setTime(Math.floor(t / e) * e); }, function(t, n) { t.setTime(+t + n * e); }, function(t, n) { return (n - t) / e; }) : vd; }; var $w = vd.range, rp = 1e3, rs = 6e4, ap = 36e5, o4 = 864e5, l4 = 6048e5, ey = _r(function(e) { e.setTime(e - e.getMilliseconds()); }, function(e, t) { e.setTime(+e + t * rp); }, function(e, t) { return (t - e) / rp; }, function(e) { return e.getUTCSeconds(); }), Kw = ey.range, s4 = _r(function(e) { e.setTime(e - e.getMilliseconds() - e.getSeconds() * rp); }, function(e, t) { e.setTime(+e + t * rs); }, function(e, t) { return (t - e) / rs; }, function(e) { return e.getMinutes(); }), kH = s4.range, c4 = _r(function(e) { e.setTime(e - e.getMilliseconds() - e.getSeconds() * rp - e.getMinutes() * rs); }, function(e, t) { e.setTime(+e + t * ap); }, function(e, t) { return (t - e) / ap; }, function(e) { return e.getHours(); }), TH = c4.range, i0 = _r(function(e) { e.setHours(0, 0, 0, 0); }, function(e, t) { e.setDate(e.getDate() + t); }, function(e, t) { return (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * rs) / o4; }, function(e) { return e.getDate() - 1; }), AH = i0.range; function hs(e) { return _r(function(t) { t.setDate(t.getDate() - (t.getDay() + 7 - e) % 7), t.setHours(0, 0, 0, 0); }, function(t, n) { t.setDate(t.getDate() + n * 7); }, function(t, n) { return (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * rs) / l4; }); } var ip = hs(0), md = hs(1), u4 = hs(2), d4 = hs(3), as = hs(4), f4 = hs(5), h4 = hs(6), Jw = ip.range, MH = md.range, SH = u4.range, CH = d4.range, LH = as.range, OH = f4.range, DH = h4.range, p4 = _r(function(e) { e.setDate(1), e.setHours(0, 0, 0, 0); }, function(e, t) { e.setMonth(e.getMonth() + t); }, function(e, t) { return t.getMonth() - e.getMonth() + (t.getFullYear() - e.getFullYear()) * 12; }, function(e) { return e.getMonth(); }), FH = p4.range, sl = _r(function(e) { e.setMonth(0, 1), e.setHours(0, 0, 0, 0); }, function(e, t) { e.setFullYear(e.getFullYear() + t); }, function(e, t) { return t.getFullYear() - e.getFullYear(); }, function(e) { return e.getFullYear(); }); sl.every = function(e) { return !isFinite(e = Math.floor(e)) || !(e > 0) ? null : _r(function(t) { t.setFullYear(Math.floor(t.getFullYear() / e) * e), t.setMonth(0, 1), t.setHours(0, 0, 0, 0); }, function(t, n) { t.setFullYear(t.getFullYear() + n * e); }); }; var IH = sl.range, g4 = _r(function(e) { e.setUTCSeconds(0, 0); }, function(e, t) { e.setTime(+e + t * rs); }, function(e, t) { return (t - e) / rs; }, function(e) { return e.getUTCMinutes(); }), zH = g4.range, v4 = _r(function(e) { e.setUTCMinutes(0, 0, 0); }, function(e, t) { e.setTime(+e + t * ap); }, function(e, t) { return (t - e) / ap; }, function(e) { return e.getUTCHours(); }), EH = v4.range, o0 = _r(function(e) { e.setUTCHours(0, 0, 0, 0); }, function(e, t) { e.setUTCDate(e.getUTCDate() + t); }, function(e, t) { return (t - e) / o4; }, function(e) { return e.getUTCDate() - 1; }), jH = o0.range; function ps(e) { return _r(function(t) { t.setUTCDate(t.getUTCDate() - (t.getUTCDay() + 7 - e) % 7), t.setUTCHours(0, 0, 0, 0); }, function(t, n) { t.setUTCDate(t.getUTCDate() + n * 7); }, function(t, n) { return (n - t) / l4; }); } var op = ps(0), yd = ps(1), m4 = ps(2), y4 = ps(3), is = ps(4), x4 = ps(5), b4 = ps(6), Qw = op.range, PH = yd.range, RH = m4.range, NH = y4.range, BH = is.range, HH = x4.range, VH = b4.range, w4 = _r(function(e) { e.setUTCDate(1), e.setUTCHours(0, 0, 0, 0); }, function(e, t) { e.setUTCMonth(e.getUTCMonth() + t); }, function(e, t) { return t.getUTCMonth() - e.getUTCMonth() + (t.getUTCFullYear() - e.getUTCFullYear()) * 12; }, function(e) { return e.getUTCMonth(); }), qH = w4.range, cl = _r(function(e) { e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); }, function(e, t) { e.setUTCFullYear(e.getUTCFullYear() + t); }, function(e, t) { return t.getUTCFullYear() - e.getUTCFullYear(); }, function(e) { return e.getUTCFullYear(); }); cl.every = function(e) { return !isFinite(e = Math.floor(e)) || !(e > 0) ? null : _r(function(t) { t.setUTCFullYear(Math.floor(t.getUTCFullYear() / e) * e), t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0); }, function(t, n) { t.setUTCFullYear(t.getUTCFullYear() + n * e); }); }; var UH = cl.range; const GH = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, timeDay: i0, timeDays: AH, timeFriday: f4, timeFridays: OH, timeHour: c4, timeHours: TH, timeInterval: _r, timeMillisecond: vd, timeMilliseconds: $w, timeMinute: s4, timeMinutes: kH, timeMonday: md, timeMondays: MH, timeMonth: p4, timeMonths: FH, timeSaturday: h4, timeSaturdays: DH, timeSecond: ey, timeSeconds: Kw, timeSunday: ip, timeSundays: Jw, timeThursday: as, timeThursdays: LH, timeTuesday: u4, timeTuesdays: SH, timeWednesday: d4, timeWednesdays: CH, timeWeek: ip, timeWeeks: Jw, timeYear: sl, timeYears: IH, utcDay: o0, utcDays: jH, utcFriday: x4, utcFridays: HH, utcHour: v4, utcHours: EH, utcMillisecond: vd, utcMilliseconds: $w, utcMinute: g4, utcMinutes: zH, utcMonday: yd, utcMondays: PH, utcMonth: w4, utcMonths: qH, utcSaturday: b4, utcSaturdays: VH, utcSecond: ey, utcSeconds: Kw, utcSunday: op, utcSundays: Qw, utcThursday: is, utcThursdays: BH, utcTuesday: m4, utcTuesdays: RH, utcWednesday: y4, utcWednesdays: NH, utcWeek: op, utcWeeks: Qw, utcYear: cl, utcYears: UH }, Symbol.toStringTag, { value: "Module" })); function Vg(e) { if (0 <= e.y && e.y < 100) { var t = new Date(-1, e.m, e.d, e.H, e.M, e.S, e.L); return t.setFullYear(e.y), t; } return new Date(e.y, e.m, e.d, e.H, e.M, e.S, e.L); } function qg(e) { if (0 <= e.y && e.y < 100) { var t = new Date(Date.UTC(-1, e.m, e.d, e.H, e.M, e.S, e.L)); return t.setUTCFullYear(e.y), t; } return new Date(Date.UTC(e.y, e.m, e.d, e.H, e.M, e.S, e.L)); } function gu(e, t, n) { return { y: e, m: t, d: n, H: 0, M: 0, S: 0, L: 0 }; } function _4(e) { var t = e.dateTime, n = e.date, r = e.time, a = e.periods, i = e.days, o = e.shortDays, l = e.months, s = e.shortMonths, c = vu(a), u = mu(a), f = vu(i), h = mu(i), g = vu(o), p = mu(o), v = vu(l), y = mu(l), m = vu(s), b = mu(s), w = { a: E, A: z, b: F, B: q, c: null, d: a_, e: a_, f: pV, g: TV, G: MV, H: dV, I: fV, j: hV, L: k4, m: gV, M: vV, p: H, q: K, Q: l_, s: s_, S: mV, u: yV, U: xV, V: bV, w: wV, W: _V, x: null, X: null, y: kV, Y: AV, Z: SV, "%": o_ }, _ = { a: Q, A: re, b: te, B: X, c: null, d: i_, e: i_, f: DV, g: HV, G: qV, H: CV, I: LV, j: OV, L: A4, m: FV, M: IV, p: ce, q: B, Q: l_, s: s_, S: zV, u: EV, U: jV, V: PV, w: RV, W: NV, x: null, X: null, y: BV, Y: VV, Z: UV, "%": o_ }, k = { a: I, A: j, b: P, B: N, c: W, d: n_, e: n_, f: lV, g: t_, G: e_, H: r_, I: r_, j: rV, L: oV, m: nV, M: aV, p: C, q: tV, Q: cV, s: uV, S: iV, u: KH, U: JH, V: QH, w: $H, W: XH, x: J, X: U, y: t_, Y: e_, Z: eV, "%": sV }; w.x = T(n, w), w.X = T(r, w), w.c = T(t, w), _.x = T(n, _), _.X = T(r, _), _.c = T(t, _); function T(G, Z) { return function(oe) { var ae = [], ge = -1, ve = 0, pe = G.length, ye, Oe, Be; for (oe instanceof Date || (oe = /* @__PURE__ */ new Date(+oe)); ++ge < pe; ) G.charCodeAt(ge) === 37 && (ae.push(G.slice(ve, ge)), (Oe = Xw[ye = G.charAt(++ge)]) != null ? ye = G.charAt(++ge) : Oe = ye === "e" ? " " : "0", (Be = Z[ye]) && (ye = Be(oe, Oe)), ae.push(ye), ve = ge + 1); return ae.push(G.slice(ve, ge)), ae.join(""); }; } function O(G, Z) { return function(oe) { var ae = gu(1900, void 0, 1), ge = M(ae, G, oe += "", 0), ve, pe; if (ge != oe.length) return null; if ("Q" in ae) return new Date(ae.Q); if ("s" in ae) return new Date(ae.s * 1e3 + ("L" in ae ? ae.L : 0)); if (Z && !("Z" in ae) && (ae.Z = 0), "p" in ae && (ae.H = ae.H % 12 + ae.p * 12), ae.m === void 0 && (ae.m = "q" in ae ? ae.q : 0), "V" in ae) { if (ae.V < 1 || ae.V > 53) return null; "w" in ae || (ae.w = 1), "Z" in ae ? (ve = qg(gu(ae.y, 0, 1)), pe = ve.getUTCDay(), ve = pe > 4 || pe === 0 ? yd.ceil(ve) : yd(ve), ve = o0.offset(ve, (ae.V - 1) * 7), ae.y = ve.getUTCFullYear(), ae.m = ve.getUTCMonth(), ae.d = ve.getUTCDate() + (ae.w + 6) % 7) : (ve = Vg(gu(ae.y, 0, 1)), pe = ve.getDay(), ve = pe > 4 || pe === 0 ? md.ceil(ve) : md(ve), ve = i0.offset(ve, (ae.V - 1) * 7), ae.y = ve.getFullYear(), ae.m = ve.getMonth(), ae.d = ve.getDate() + (ae.w + 6) % 7); } else ("W" in ae || "U" in ae) && ("w" in ae || (ae.w = "u" in ae ? ae.u % 7 : "W" in ae ? 1 : 0), pe = "Z" in ae ? qg(gu(ae.y, 0, 1)).getUTCDay() : Vg(gu(ae.y, 0, 1)).getDay(), ae.m = 0, ae.d = "W" in ae ? (ae.w + 6) % 7 + ae.W * 7 - (pe + 5) % 7 : ae.w + ae.U * 7 - (pe + 6) % 7); return "Z" in ae ? (ae.H += ae.Z / 100 | 0, ae.M += ae.Z % 100, qg(ae)) : Vg(ae); }; } function M(G, Z, oe, ae) { for (var ge = 0, ve = Z.length, pe = oe.length, ye, Oe; ge < ve; ) { if (ae >= pe) return -1; if (ye = Z.charCodeAt(ge++), ye === 37) { if (ye = Z.charAt(ge++), Oe = k[ye in Xw ? Z.charAt(ge++) : ye], !Oe || (ae = Oe(G, oe, ae)) < 0) return -1; } else if (ye != oe.charCodeAt(ae++)) return -1; } return ae; } function C(G, Z, oe) { var ae = c.exec(Z.slice(oe)); return ae ? (G.p = u[ae[0].toLowerCase()], oe + ae[0].length) : -1; } function I(G, Z, oe) { var ae = g.exec(Z.slice(oe)); return ae ? (G.w = p[ae[0].toLowerCase()], oe + ae[0].length) : -1; } function j(G, Z, oe) { var ae = f.exec(Z.slice(oe)); return ae ? (G.w = h[ae[0].toLowerCase()], oe + ae[0].length) : -1; } function P(G, Z, oe) { var ae = m.exec(Z.slice(oe)); return ae ? (G.m = b[ae[0].toLowerCase()], oe + ae[0].length) : -1; } function N(G, Z, oe) { var ae = v.exec(Z.slice(oe)); return ae ? (G.m = y[ae[0].toLowerCase()], oe + ae[0].length) : -1; } function W(G, Z, oe) { return M(G, t, Z, oe); } function J(G, Z, oe) { return M(G, n, Z, oe); } function U(G, Z, oe) { return M(G, r, Z, oe); } function E(G) { return o[G.getDay()]; } function z(G) { return i[G.getDay()]; } function F(G) { return s[G.getMonth()]; } function q(G) { return l[G.getMonth()]; } function H(G) { return a[+(G.getHours() >= 12)]; } function K(G) { return 1 + ~~(G.getMonth() / 3); } function Q(G) { return o[G.getUTCDay()]; } function re(G) { return i[G.getUTCDay()]; } function te(G) { return s[G.getUTCMonth()]; } function X(G) { return l[G.getUTCMonth()]; } function ce(G) { return a[+(G.getUTCHours() >= 12)]; } function B(G) { return 1 + ~~(G.getUTCMonth() / 3); } return { format: function(G) { var Z = T(G += "", w); return Z.toString = function() { return G; }, Z; }, parse: function(G) { var Z = O(G += "", !1); return Z.toString = function() { return G; }, Z; }, utcFormat: function(G) { var Z = T(G += "", _); return Z.toString = function() { return G; }, Z; }, utcParse: function(G) { var Z = O(G += "", !0); return Z.toString = function() { return G; }, Z; } }; } var Xw = { "-": "", _: " ", 0: "0" }, Sr = /^\s*\d+/, WH = /^%/, ZH = /[\\^$*+?|[\]().{}]/g; function On(e, t, n) { var r = e < 0 ? "-" : "", a = (r ? -e : e) + "", i = a.length; return r + (i < n ? new Array(n - i + 1).join(t) + a : a); } function YH(e) { return e.replace(ZH, "\\$&"); } function vu(e) { return new RegExp("^(?:" + e.map(YH).join("|") + ")", "i"); } function mu(e) { for (var t = {}, n = -1, r = e.length; ++n < r; ) t[e[n].toLowerCase()] = n; return t; } function $H(e, t, n) { var r = Sr.exec(t.slice(n, n + 1)); return r ? (e.w = +r[0], n + r[0].length) : -1; } function KH(e, t, n) { var r = Sr.exec(t.slice(n, n + 1)); return r ? (e.u = +r[0], n + r[0].length) : -1; } function JH(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.U = +r[0], n + r[0].length) : -1; } function QH(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.V = +r[0], n + r[0].length) : -1; } function XH(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.W = +r[0], n + r[0].length) : -1; } function e_(e, t, n) { var r = Sr.exec(t.slice(n, n + 4)); return r ? (e.y = +r[0], n + r[0].length) : -1; } function t_(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1; } function eV(e, t, n) { var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n, n + 6)); return r ? (e.Z = r[1] ? 0 : -(r[2] + (r[3] || "00")), n + r[0].length) : -1; } function tV(e, t, n) { var r = Sr.exec(t.slice(n, n + 1)); return r ? (e.q = r[0] * 3 - 3, n + r[0].length) : -1; } function nV(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.m = r[0] - 1, n + r[0].length) : -1; } function n_(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.d = +r[0], n + r[0].length) : -1; } function rV(e, t, n) { var r = Sr.exec(t.slice(n, n + 3)); return r ? (e.m = 0, e.d = +r[0], n + r[0].length) : -1; } function r_(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.H = +r[0], n + r[0].length) : -1; } function aV(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.M = +r[0], n + r[0].length) : -1; } function iV(e, t, n) { var r = Sr.exec(t.slice(n, n + 2)); return r ? (e.S = +r[0], n + r[0].length) : -1; } function oV(e, t, n) { var r = Sr.exec(t.slice(n, n + 3)); return r ? (e.L = +r[0], n + r[0].length) : -1; } function lV(e, t, n) { var r = Sr.exec(t.slice(n, n + 6)); return r ? (e.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1; } function sV(e, t, n) { var r = WH.exec(t.slice(n, n + 1)); return r ? n + r[0].length : -1; } function cV(e, t, n) { var r = Sr.exec(t.slice(n)); return r ? (e.Q = +r[0], n + r[0].length) : -1; } function uV(e, t, n) { var r = Sr.exec(t.slice(n)); return r ? (e.s = +r[0], n + r[0].length) : -1; } function a_(e, t) { return On(e.getDate(), t, 2); } function dV(e, t) { return On(e.getHours(), t, 2); } function fV(e, t) { return On(e.getHours() % 12 || 12, t, 2); } function hV(e, t) { return On(1 + i0.count(sl(e), e), t, 3); } function k4(e, t) { return On(e.getMilliseconds(), t, 3); } function pV(e, t) { return k4(e, t) + "000"; } function gV(e, t) { return On(e.getMonth() + 1, t, 2); } function vV(e, t) { return On(e.getMinutes(), t, 2); } function mV(e, t) { return On(e.getSeconds(), t, 2); } function yV(e) { var t = e.getDay(); return t === 0 ? 7 : t; } function xV(e, t) { return On(ip.count(sl(e) - 1, e), t, 2); } function T4(e) { var t = e.getDay(); return t >= 4 || t === 0 ? as(e) : as.ceil(e); } function bV(e, t) { return e = T4(e), On(as.count(sl(e), e) + (sl(e).getDay() === 4), t, 2); } function wV(e) { return e.getDay(); } function _V(e, t) { return On(md.count(sl(e) - 1, e), t, 2); } function kV(e, t) { return On(e.getFullYear() % 100, t, 2); } function TV(e, t) { return e = T4(e), On(e.getFullYear() % 100, t, 2); } function AV(e, t) { return On(e.getFullYear() % 1e4, t, 4); } function MV(e, t) { var n = e.getDay(); return e = n >= 4 || n === 0 ? as(e) : as.ceil(e), On(e.getFullYear() % 1e4, t, 4); } function SV(e) { var t = e.getTimezoneOffset(); return (t > 0 ? "-" : (t *= -1, "+")) + On(t / 60 | 0, "0", 2) + On(t % 60, "0", 2); } function i_(e, t) { return On(e.getUTCDate(), t, 2); } function CV(e, t) { return On(e.getUTCHours(), t, 2); } function LV(e, t) { return On(e.getUTCHours() % 12 || 12, t, 2); } function OV(e, t) { return On(1 + o0.count(cl(e), e), t, 3); } function A4(e, t) { return On(e.getUTCMilliseconds(), t, 3); } function DV(e, t) { return A4(e, t) + "000"; } function FV(e, t) { return On(e.getUTCMonth() + 1, t, 2); } function IV(e, t) { return On(e.getUTCMinutes(), t, 2); } function zV(e, t) { return On(e.getUTCSeconds(), t, 2); } function EV(e) { var t = e.getUTCDay(); return t === 0 ? 7 : t; } function jV(e, t) { return On(op.count(cl(e) - 1, e), t, 2); } function M4(e) { var t = e.getUTCDay(); return t >= 4 || t === 0 ? is(e) : is.ceil(e); } function PV(e, t) { return e = M4(e), On(is.count(cl(e), e) + (cl(e).getUTCDay() === 4), t, 2); } function RV(e) { return e.getUTCDay(); } function NV(e, t) { return On(yd.count(cl(e) - 1, e), t, 2); } function BV(e, t) { return On(e.getUTCFullYear() % 100, t, 2); } function HV(e, t) { return e = M4(e), On(e.getUTCFullYear() % 100, t, 2); } function VV(e, t) { return On(e.getUTCFullYear() % 1e4, t, 4); } function qV(e, t) { var n = e.getUTCDay(); return e = n >= 4 || n === 0 ? is(e) : is.ceil(e), On(e.getUTCFullYear() % 1e4, t, 4); } function UV() { return "+0000"; } function o_() { return "%"; } function l_(e) { return +e; } function s_(e) { return Math.floor(+e / 1e3); } var Fs, S4, C4, I1, z1; L4({ dateTime: "%x, %X", date: "%-m/%-d/%Y", time: "%-I:%M:%S %p", periods: ["AM", "PM"], days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }); function L4(e) { return Fs = _4(e), S4 = Fs.format, C4 = Fs.parse, I1 = Fs.utcFormat, z1 = Fs.utcParse, Fs; } var O4 = "%Y-%m-%dT%H:%M:%S.%LZ"; function GV(e) { return e.toISOString(); } var WV = Date.prototype.toISOString ? GV : I1(O4); function ZV(e) { var t = new Date(e); return isNaN(t) ? null : t; } var YV = +/* @__PURE__ */ new Date("2000-01-01T00:00:00.000Z") ? ZV : z1(O4); const $V = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, isoFormat: WV, isoParse: YV, get timeFormat() { return S4; }, timeFormatDefaultLocale: L4, timeFormatLocale: _4, get timeParse() { return C4; }, get utcFormat() { return I1; }, get utcParse() { return z1; } }, Symbol.toStringTag, { value: "Module" })), xd = /* @__PURE__ */ t0($V); function KV(e) { return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10); } function lp(e, t) { if ((n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null; var n, r = e.slice(0, n); return [ r.length > 1 ? r[0] + r.slice(2) : r, +e.slice(n + 1) ]; } function Lc(e) { return e = lp(Math.abs(e)), e ? e[1] : NaN; } function JV(e, t) { return function(n, r) { for (var a = n.length, i = [], o = 0, l = e[0], s = 0; a > 0 && l > 0 && (s + l + 1 > r && (l = Math.max(1, r - s)), i.push(n.substring(a -= l, a + l)), !((s += l + 1) > r)); ) l = e[o = (o + 1) % e.length]; return i.reverse().join(t); }; } function QV(e) { return function(t) { return t.replace(/[0-9]/g, function(n) { return e[+n]; }); }; } var XV = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; function sp(e) { if (!(t = XV.exec(e))) throw new Error("invalid format: " + e); var t; return new l0({ fill: t[1], align: t[2], sign: t[3], symbol: t[4], zero: t[5], width: t[6], comma: t[7], precision: t[8] && t[8].slice(1), trim: t[9], type: t[10] }); } sp.prototype = l0.prototype; function l0(e) { this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + ""; } l0.prototype.toString = function() { return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; }; function eq(e) { e: for (var t = e.length, n = 1, r = -1, a; n < t; ++n) switch (e[n]) { case ".": r = a = n; break; case "0": r === 0 && (r = n), a = n; break; default: if (!+e[n]) break e; r > 0 && (r = 0); break; } return r > 0 ? e.slice(0, r) + e.slice(a + 1) : e; } var D4; function tq(e, t) { var n = lp(e, t); if (!n) return e + ""; var r = n[0], a = n[1], i = a - (D4 = Math.max(-8, Math.min(8, Math.floor(a / 3))) * 3) + 1, o = r.length; return i === o ? r : i > o ? r + new Array(i - o + 1).join("0") : i > 0 ? r.slice(0, i) + "." + r.slice(i) : "0." + new Array(1 - i).join("0") + lp(e, Math.max(0, t + i - 1))[0]; } function c_(e, t) { var n = lp(e, t); if (!n) return e + ""; var r = n[0], a = n[1]; return a < 0 ? "0." + new Array(-a).join("0") + r : r.length > a + 1 ? r.slice(0, a + 1) + "." + r.slice(a + 1) : r + new Array(a - r.length + 2).join("0"); } const u_ = { "%": function(e, t) { return (e * 100).toFixed(t); }, b: function(e) { return Math.round(e).toString(2); }, c: function(e) { return e + ""; }, d: KV, e: function(e, t) { return e.toExponential(t); }, f: function(e, t) { return e.toFixed(t); }, g: function(e, t) { return e.toPrecision(t); }, o: function(e) { return Math.round(e).toString(8); }, p: function(e, t) { return c_(e * 100, t); }, r: c_, s: tq, X: function(e) { return Math.round(e).toString(16).toUpperCase(); }, x: function(e) { return Math.round(e).toString(16); } }; function d_(e) { return e; } var f_ = Array.prototype.map, h_ = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; function F4(e) { var t = e.grouping === void 0 || e.thousands === void 0 ? d_ : JV(f_.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", a = e.decimal === void 0 ? "." : e.decimal + "", i = e.numerals === void 0 ? d_ : QV(f_.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", l = e.minus === void 0 ? "-" : e.minus + "", s = e.nan === void 0 ? "NaN" : e.nan + ""; function c(f) { f = sp(f); var h = f.fill, g = f.align, p = f.sign, v = f.symbol, y = f.zero, m = f.width, b = f.comma, w = f.precision, _ = f.trim, k = f.type; k === "n" ? (b = !0, k = "g") : u_[k] || (w === void 0 && (w = 12), _ = !0, k = "g"), (y || h === "0" && g === "=") && (y = !0, h = "0", g = "="); var T = v === "$" ? n : v === "#" && /[boxX]/.test(k) ? "0" + k.toLowerCase() : "", O = v === "$" ? r : /[%p]/.test(k) ? o : "", M = u_[k], C = /[defgprs%]/.test(k); w = w === void 0 ? 6 : /[gprs]/.test(k) ? Math.max(1, Math.min(21, w)) : Math.max(0, Math.min(20, w)); function I(j) { var P = T, N = O, W, J, U; if (k === "c") N = M(j) + N, j = ""; else { j = +j; var E = j < 0 || 1 / j < 0; if (j = isNaN(j) ? s : M(Math.abs(j), w), _ && (j = eq(j)), E && +j == 0 && p !== "+" && (E = !1), P = (E ? p === "(" ? p : l : p === "-" || p === "(" ? "" : p) + P, N = (k === "s" ? h_[8 + D4 / 3] : "") + N + (E && p === "(" ? ")" : ""), C) { for (W = -1, J = j.length; ++W < J; ) if (U = j.charCodeAt(W), 48 > U || U > 57) { N = (U === 46 ? a + j.slice(W + 1) : j.slice(W)) + N, j = j.slice(0, W); break; } } } b && !y && (j = t(j, 1 / 0)); var z = P.length + j.length + N.length, F = z < m ? new Array(m - z + 1).join(h) : ""; switch (b && y && (j = t(F + j, F.length ? m - N.length : 1 / 0), F = ""), g) { case "<": j = P + j + N + F; break; case "=": j = P + F + j + N; break; case "^": j = F.slice(0, z = F.length >> 1) + P + j + N + F.slice(z); break; default: j = F + P + j + N; break; } return i(j); } return I.toString = function() { return f + ""; }, I; } function u(f, h) { var g = c((f = sp(f), f.type = "f", f)), p = Math.max(-8, Math.min(8, Math.floor(Lc(h) / 3))) * 3, v = Math.pow(10, -p), y = h_[8 + p / 3]; return function(m) { return g(v * m) + y; }; } return { format: c, formatPrefix: u }; } var Ff, I4, z4; E4({ decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], minus: "-" }); function E4(e) { return Ff = F4(e), I4 = Ff.format, z4 = Ff.formatPrefix, Ff; } function nq(e) { return Math.max(0, -Lc(Math.abs(e))); } function rq(e, t) { return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Lc(t) / 3))) * 3 - Lc(Math.abs(e))); } function aq(e, t) { return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, Lc(t) - Lc(e)) + 1; } const iq = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, FormatSpecifier: l0, get format() { return I4; }, formatDefaultLocale: E4, formatLocale: F4, get formatPrefix() { return z4; }, formatSpecifier: sp, precisionFixed: nq, precisionPrefix: rq, precisionRound: aq }, Symbol.toStringTag, { value: "Module" })), j4 = /* @__PURE__ */ t0(iq); var oq = function(e) { for (var t = e.length, n, r = 0; r < t; r++) if (n = e.charCodeAt(r), (n < 9 || n > 13) && n !== 32 && n !== 133 && n !== 160 && n !== 5760 && n !== 6158 && (n < 8192 || n > 8205) && n !== 8232 && n !== 8233 && n !== 8239 && n !== 8287 && n !== 8288 && n !== 12288 && n !== 65279) return !1; return !0; }, lq = oq, cn = function(e) { var t = typeof e; if (t === "string") { var n = e; if (e = +e, e === 0 && lq(n)) return !1; } else if (t !== "number") return !1; return e - e < 1; }, er = { /** * Standardize all missing data in calcdata to use undefined * never null or NaN. * That way we can use !==undefined, or !== BADNUM, * to test for real data */ BADNUM: void 0, /* * Limit certain operations to well below floating point max value * to avoid glitches: Make sure that even when you multiply it by the * number of pixels on a giant screen it still works */ FP_SAFE: Number.MAX_VALUE * 1e-4, /* * conversion of date units to milliseconds * year and month constants are marked "AVG" * to remind us that not all years and months * have the same length */ ONEMAXYEAR: 316224e5, // 366 * ONEDAY ONEAVGYEAR: 315576e5, // 365.25 days ONEMINYEAR: 31536e6, // 365 * ONEDAY ONEMAXQUARTER: 79488e5, // 92 * ONEDAY ONEAVGQUARTER: 78894e5, // 1/4 of ONEAVGYEAR ONEMINQUARTER: 76896e5, // 89 * ONEDAY ONEMAXMONTH: 26784e5, // 31 * ONEDAY ONEAVGMONTH: 26298e5, // 1/12 of ONEAVGYEAR ONEMINMONTH: 24192e5, // 28 * ONEDAY ONEWEEK: 6048e5, // 7 * ONEDAY ONEDAY: 864e5, // 24 * ONEHOUR ONEHOUR: 36e5, ONEMIN: 6e4, ONESEC: 1e3, /* * For fast conversion btwn world calendars and epoch ms, the Julian Day Number * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD() */ EPOCHJD: 24405875e-1, /* * Are two values nearly equal? Compare to 1PPM */ ALMOST_EQUAL: 1 - 1e-6, /* * If we're asked to clip a non-positive log value, how far off-screen * do we put it? */ LOG_CLIP: 10, /* * not a number, but for displaying numbers: the "minus sign" symbol is * wider than the regular ascii dash "-" */ MINUS_SIGN: "−" }, ir = {}, lc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Gu = typeof Uint8Array > "u" ? [] : new Uint8Array(256); for (var If = 0; If < lc.length; If++) Gu[lc.charCodeAt(If)] = If; var sq = function(e) { var t = new Uint8Array(e), n, r = t.length, a = ""; for (n = 0; n < r; n += 3) a += lc[t[n] >> 2], a += lc[(t[n] & 3) << 4 | t[n + 1] >> 4], a += lc[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], a += lc[t[n + 2] & 63]; return r % 3 === 2 ? a = a.substring(0, a.length - 1) + "=" : r % 3 === 1 && (a = a.substring(0, a.length - 2) + "=="), a; }, cq = function(e) { var t = e.length * 0.75, n = e.length, r, a = 0, i, o, l, s; e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--); var c = new ArrayBuffer(t), u = new Uint8Array(c); for (r = 0; r < n; r += 4) i = Gu[e.charCodeAt(r)], o = Gu[e.charCodeAt(r + 1)], l = Gu[e.charCodeAt(r + 2)], s = Gu[e.charCodeAt(r + 3)], u[a++] = i << 2 | o >> 4, u[a++] = (o & 15) << 4 | l >> 2, u[a++] = (l & 3) << 6 | s & 63; return c; }; const uq = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, decode: cq, encode: sq }, Symbol.toStringTag, { value: "Module" })), P4 = /* @__PURE__ */ t0(uq); var gs = function(e) { return window && window.process && window.process.versions ? Object.prototype.toString.call(e) === "[object Object]" : Object.prototype.toString.call(e) === "[object Object]" && Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty"); }, dq = P4.decode, fq = gs, E1 = Array.isArray, hq = ArrayBuffer, pq = DataView; function R4(e) { return hq.isView(e) && !(e instanceof pq); } ir.isTypedArray = R4; function cp(e) { return E1(e) || R4(e); } ir.isArrayOrTypedArray = cp; function gq(e) { return !cp(e[0]); } ir.isArray1D = gq; ir.ensureArray = function(e, t) { return E1(e) || (e = []), e.length = t, e; }; var wr = { u1c: typeof Uint8ClampedArray > "u" ? void 0 : Uint8ClampedArray, // not supported in numpy? i1: typeof Int8Array > "u" ? void 0 : Int8Array, u1: typeof Uint8Array > "u" ? void 0 : Uint8Array, i2: typeof Int16Array > "u" ? void 0 : Int16Array, u2: typeof Uint16Array > "u" ? void 0 : Uint16Array, i4: typeof Int32Array > "u" ? void 0 : Int32Array, u4: typeof Uint32Array > "u" ? void 0 : Uint32Array, f4: typeof Float32Array > "u" ? void 0 : Float32Array, f8: typeof Float64Array > "u" ? void 0 : Float64Array /* TODO: potentially add Big Int i8: typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, u8: typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, */ }; wr.uint8c = wr.u1c; wr.uint8 = wr.u1; wr.int8 = wr.i1; wr.uint16 = wr.u2; wr.int16 = wr.i2; wr.uint32 = wr.u4; wr.int32 = wr.i4; wr.float32 = wr.f4; wr.float64 = wr.f8; function j1(e) { return e.constructor === ArrayBuffer; } ir.isArrayBuffer = j1; ir.decodeTypedArraySpec = function(e) { var t = [], n = vq(e), r = n.dtype, a = wr[r]; if (!a) throw new Error('Error in dtype: "' + r + '"'); var i = a.BYTES_PER_ELEMENT, o = n.bdata; j1(o) || (o = dq(o)); var l = n.shape === void 0 ? ( // detect 1-d length [o.byteLength / i] ) : ( // convert number to string and split to array ("" + n.shape).split(",") ); l.reverse(); var s = l.length, c, u, f = +l[0], h = i * f, g = 0; if (s === 1) t = new a(o); else if (s === 2) for (c = +l[1], u = 0; u < c; u++) t[u] = new a(o, g, f), g += h; else if (s === 3) { c = +l[1]; for (var p = +l[2], v = 0; v < p; v++) for (t[v] = [], u = 0; u < c; u++) t[v][u] = new a(o, g, f), g += h; } else throw new Error("ndim: " + s + 'is not supported with the shape:"' + n.shape + '"'); return t.bdata = n.bdata, t.dtype = n.dtype, t.shape = l.reverse().join(","), e._inputArray = t, t; }; ir.isTypedArraySpec = function(e) { return fq(e) && e.hasOwnProperty("dtype") && typeof e.dtype == "string" && e.hasOwnProperty("bdata") && (typeof e.bdata == "string" || j1(e.bdata)) && (e.shape === void 0 || e.hasOwnProperty("shape") && (typeof e.shape == "string" || typeof e.shape == "number")); }; function vq(e) { return { bdata: e.bdata, dtype: e.dtype, shape: e.shape }; } ir.concat = function() { var e = [], t = !0, n = 0, r, a, i, o, l, s, c, u; for (i = 0; i < arguments.length; i++) o = arguments[i], s = o.length, s && (a ? e.push(o) : (a = o, l = s), E1(o) ? r = !1 : (t = !1, n ? r !== o.constructor && (r = !1) : r = o.constructor), n += s); if (!n) return []; if (!e.length) return a; if (t) return a.concat.apply(a, e); if (r) { for (c = new r(n), c.set(a), i = 0; i < e.length; i++) o = e[i], c.set(o, l), l += o.length; return c; } for (c = new Array(n), u = 0; u < a.length; u++) c[u] = a[u]; for (i = 0; i < e.length; i++) { for (o = e[i], u = 0; u < o.length; u++) c[l + u] = o[u]; l += u; } return c; }; ir.maxRowLength = function(e) { return N4(e, Math.max, 0); }; ir.minRowLength = function(e) { return N4(e, Math.min, 1 / 0); }; function N4(e, t, n) { if (cp(e)) if (cp(e[0])) { for (var r = n, a = 0; a < e.length; a++) r = t(r, e[a].length); return r; } else return e.length; return 0; } var B4 = cn, P1 = ir.isArrayOrTypedArray, R1 = function(e, t) { if (B4(t)) t = String(t); else if (typeof t != "string" || t.substr(t.length - 4) === "[-1]") throw "bad property string"; var n = t.split("."), r, a, i, o; for (o = 0; o < n.length; o++) if (String(n[o]).slice(0, 2) === "__") throw "bad property string"; for (o = 0; o < n.length; ) { if (r = String(n[o]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/), r) { if (r[1]) n[o] = r[1]; else if (o === 0) n.splice(0, 1); else throw "bad property string"; for (a = r[2].substr(1, r[2].length - 2).split("]["), i = 0; i < a.length; i++) o++, n.splice(o, 0, Number(a[i])); } o++; } return typeof e != "object" ? bq(e, t, n) : { set: V4(e, n, t), get: H4(e, n), astr: t, parts: n, obj: e }; }; function H4(e, t) { return function() { var n = e, r, a, i, o, l; for (o = 0; o < t.length - 1; o++) { if (r = t[o], r === -1) { for (a = !0, i = [], l = 0; l < n.length; l++) i[l] = H4(n[l], t.slice(o + 1))(), i[l] !== i[0] && (a = !1); return a ? i[0] : i; } if (typeof r == "number" && !P1(n) || (n = n[r], typeof n != "object" || n === null)) return; } if (!(typeof n != "object" || n === null) && (i = n[t[o]], i !== null)) return i; }; } var mq = /(^|\.)args\[/; function ty(e, t) { return e === void 0 || e === null && !t.match(mq); } function V4(e, t, n) { return function(r) { var a = e, i = "", o = ty(r, n), l, s; for (s = 0; s < t.length - 1; s++) { if (l = t[s], typeof l == "number" && !P1(a)) throw "array index but container is not an array"; if (l === -1) { if (o = !xq(a, t.slice(s + 1), r, n), o) break; return; } if (!q4(a, l, t[s + 1], o)) break; if (a = a[l], typeof a != "object" || a === null) throw "container is not an object"; i = yq(i, l); } if (o) { if (s === t.length - 1 && (delete a[t[s]], Array.isArray(a) && +t[s] === a.length - 1)) for (; a.length && a[a.length - 1] === void 0; ) a.pop(); } else a[t[s]] = r; }; } function yq(e, t) { var n = t; return B4(t) ? n = "[" + t + "]" : e && (n = "." + t), e + n; } function xq(e, t, n, r) { var a = P1(n), i = !0, o = n, l = r.replace("-1", 0), s = a ? !1 : ty(n, l), c = t[0], u; for (u = 0; u < e.length; u++) l = r.replace("-1", u), a && (o = n[u % n.length], s = ty(o, l)), s && (i = !1), q4(e, u, c, s) && V4(e[u], t, r.replace("-1", u))(o); return i; } function q4(e, t, n, r) { if (e[t] === void 0) { if (r) return !1; typeof n == "number" ? e[t] = [] : e[t] = {}; } return !0; } function bq(e, t, n) { return { set: function() { throw "bad container"; }, get: function() { }, astr: t, parts: n, obj: e }; } var Is = R1, wq = /^\w*$/, _q = 0, p_ = 1, zf = 2, g_ = 3, Ll = 4, kq = function(e, t, n, r) { n = n || "name", r = r || "value"; var a, i, o, l = {}; t && t.length ? (o = Is(e, t), i = o.get()) : i = e, t = t || ""; var s = {}; if (i) for (a = 0; a < i.length; a++) s[i[a][n]] = a; var c = wq.test(r), u = { set: function(f, h) { var g = h === null ? Ll : _q; if (!i) { if (!o || g === Ll) return; i = [], o.set(i); } var p = s[f]; if (p === void 0) { if (g === Ll) return; g = g | g_, p = i.length, s[f] = p; } else h !== (c ? i[p][r] : Is(i[p], r).get()) && (g = g | zf); var v = i[p] = i[p] || {}; return v[n] = f, c ? v[r] = h : Is(v, r).set(h), h !== null && (g = g & ~Ll), l[p] = l[p] | g, u; }, get: function(f) { if (i) { var h = s[f]; if (h !== void 0) return c ? i[h][r] : Is(i[h], r).get(); } }, rename: function(f, h) { var g = s[f]; return g === void 0 || (l[g] = l[g] | p_, s[h] = g, delete s[f], i[g][n] = h), u; }, remove: function(f) { var h = s[f]; if (h === void 0) return u; var g = i[h]; if (Object.keys(g).length > 2) return l[h] = l[h] | zf, u.set(f, null); if (c) { for (a = h; a < i.length; a++) l[a] = l[a] | g_; for (a = h; a < i.length; a++) s[i[a][n]]--; i.splice(h, 1), delete s[f]; } else Is(g, r).set(null), l[h] = l[h] | zf | Ll; return u; }, constructUpdate: function() { for (var f, h, g = {}, p = Object.keys(l), v = 0; v < p.length; v++) h = p[v], f = t + "[" + h + "]", i[h] ? (l[h] & p_ && (g[f + "." + n] = i[h][n]), l[h] & zf && (c ? g[f + "." + r] = l[h] & Ll ? null : i[h][r] : g[f + "." + r] = l[h] & Ll ? null : Is(i[h], r).get())) : g[f] = null; return g; } }; return u; }, Tq = /^(.*)(\.[^\.\[\]]+|\[\d\])$/, Aq = /^[^\.\[\]]+$/, Mq = function(e, t) { for (; t; ) { var n = e.match(Tq); if (n) e = n[1]; else if (e.match(Aq)) e = ""; else throw new Error("bad relativeAttr call:" + [e, t]); if (t.charAt(0) === "^") t = t.slice(1); else break; } return e && t.charAt(0) !== "[" ? e + "." + t : e + t; }, Sq = cn, N1 = function(e, t) { if (e > 0) return Math.log(e) / Math.LN10; var n = Math.log(Math.min(t[0], t[1])) / Math.LN10; return Sq(n) || (n = Math.log(Math.max(t[0], t[1])) / Math.LN10 - 6), n; }, v_ = ir.isArrayOrTypedArray, yu = gs, Cq = function e(t, n) { for (var r in n) { var a = n[r], i = t[r]; if (i !== a) if (r.charAt(0) === "_" || typeof a == "function") { if (r in t) continue; t[r] = a; } else if (v_(a) && v_(i) && yu(a[0])) { if (r === "customdata" || r === "ids") continue; for (var o = Math.min(a.length, i.length), l = 0; l < o; l++) i[l] !== a[l] && yu(a[l]) && yu(i[l]) && e(i[l], a[l]); } else yu(a) && yu(i) && (e(i, a), Object.keys(i).length || delete t[r]); } }; function Lq(e, t) { var n = e % t; return n < 0 ? n + t : n; } function Oq(e, t) { return Math.abs(e) > t / 2 ? e - Math.round(e / t) * t : e; } var Wd = { mod: Lq, modHalf: Oq }, U4 = {}, G4 = { exports: {} }; (function(e, t) { (function(n, r) { e.exports = r(); })(gd, function() { function n(B) { "@babel/helpers - typeof"; return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(G) { return typeof G; } : function(G) { return G && typeof Symbol == "function" && G.constructor === Symbol && G !== Symbol.prototype ? "symbol" : typeof G; }, n(B); } var r = /^\s+/, a = /\s+$/; function i(B, G) { if (B = B || "", G = G || {}, B instanceof i) return B; if (!(this instanceof i)) return new i(B, G); var Z = o(B); this._originalInput = B, this._r = Z.r, this._g = Z.g, this._b = Z.b, this._a = Z.a, this._roundA = Math.round(100 * this._a) / 100, this._format = G.format || Z.format, this._gradientType = G.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = Z.ok; } i.prototype = { isDark: function() { return this.getBrightness() < 128; }, isLight: function() { return !this.isDark(); }, isValid: function() { return this._ok; }, getOriginalInput: function() { return this._originalInput; }, getFormat: function() { return this._format; }, getAlpha: function() { return this._a; }, getBrightness: function() { var B = this.toRgb(); return (B.r * 299 + B.g * 587 + B.b * 114) / 1e3; }, getLuminance: function() { var B = this.toRgb(), G, Z, oe, ae, ge, ve; return G = B.r / 255, Z = B.g / 255, oe = B.b / 255, G <= 0.03928 ? ae = G / 12.92 : ae = Math.pow((G + 0.055) / 1.055, 2.4), Z <= 0.03928 ? ge = Z / 12.92 : ge = Math.pow((Z + 0.055) / 1.055, 2.4), oe <= 0.03928 ? ve = oe / 12.92 : ve = Math.pow((oe + 0.055) / 1.055, 2.4), 0.2126 * ae + 0.7152 * ge + 0.0722 * ve; }, setAlpha: function(B) { return this._a = W(B), this._roundA = Math.round(100 * this._a) / 100, this; }, toHsv: function() { var B = u(this._r, this._g, this._b); return { h: B.h * 360, s: B.s, v: B.v, a: this._a }; }, toHsvString: function() { var B = u(this._r, this._g, this._b), G = Math.round(B.h * 360), Z = Math.round(B.s * 100), oe = Math.round(B.v * 100); return this._a == 1 ? "hsv(" + G + ", " + Z + "%, " + oe + "%)" : "hsva(" + G + ", " + Z + "%, " + oe + "%, " + this._roundA + ")"; }, toHsl: function() { var B = s(this._r, this._g, this._b); return { h: B.h * 360, s: B.s, l: B.l, a: this._a }; }, toHslString: function() { var B = s(this._r, this._g, this._b), G = Math.round(B.h * 360), Z = Math.round(B.s * 100), oe = Math.round(B.l * 100); return this._a == 1 ? "hsl(" + G + ", " + Z + "%, " + oe + "%)" : "hsla(" + G + ", " + Z + "%, " + oe + "%, " + this._roundA + ")"; }, toHex: function(B) { return h(this._r, this._g, this._b, B); }, toHexString: function(B) { return "#" + this.toHex(B); }, toHex8: function(B) { return g(this._r, this._g, this._b, this._a, B); }, toHex8String: function(B) { return "#" + this.toHex8(B); }, toRgb: function() { return { r: Math.round(this._r), g: Math.round(this._g), b: Math.round(this._b), a: this._a }; }, toRgbString: function() { return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: Math.round(J(this._r, 255) * 100) + "%", g: Math.round(J(this._g, 255) * 100) + "%", b: Math.round(J(this._b, 255) * 100) + "%", a: this._a }; }, toPercentageRgbString: function() { return this._a == 1 ? "rgb(" + Math.round(J(this._r, 255) * 100) + "%, " + Math.round(J(this._g, 255) * 100) + "%, " + Math.round(J(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(J(this._r, 255) * 100) + "%, " + Math.round(J(this._g, 255) * 100) + "%, " + Math.round(J(this._b, 255) * 100) + "%, " + this._roundA + ")"; }, toName: function() { return this._a === 0 ? "transparent" : this._a < 1 ? !1 : P[h(this._r, this._g, this._b, !0)] || !1; }, toFilter: function(B) { var G = "#" + p(this._r, this._g, this._b, this._a), Z = G, oe = this._gradientType ? "GradientType = 1, " : ""; if (B) { var ae = i(B); Z = "#" + p(ae._r, ae._g, ae._b, ae._a); } return "progid:DXImageTransform.Microsoft.gradient(" + oe + "startColorstr=" + G + ",endColorstr=" + Z + ")"; }, toString: function(B) { var G = !!B; B = B || this._format; var Z = !1, oe = this._a < 1 && this._a >= 0, ae = !G && oe && (B === "hex" || B === "hex6" || B === "hex3" || B === "hex4" || B === "hex8" || B === "name"); return ae ? B === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (B === "rgb" && (Z = this.toRgbString()), B === "prgb" && (Z = this.toPercentageRgbString()), (B === "hex" || B === "hex6") && (Z = this.toHexString()), B === "hex3" && (Z = this.toHexString(!0)), B === "hex4" && (Z = this.toHex8String(!0)), B === "hex8" && (Z = this.toHex8String()), B === "name" && (Z = this.toName()), B === "hsl" && (Z = this.toHslString()), B === "hsv" && (Z = this.toHsvString()), Z || this.toHexString()); }, clone: function() { return i(this.toString()); }, _applyModification: function(B, G) { var Z = B.apply(null, [this].concat([].slice.call(G))); return this._r = Z._r, this._g = Z._g, this._b = Z._b, this.setAlpha(Z._a), this; }, lighten: function() { return this._applyModification(b, arguments); }, brighten: function() { return this._applyModification(w, arguments); }, darken: function() { return this._applyModification(_, arguments); }, desaturate: function() { return this._applyModification(v, arguments); }, saturate: function() { return this._applyModification(y, arguments); }, greyscale: function() { return this._applyModification(m, arguments); }, spin: function() { return this._applyModification(k, arguments); }, _applyCombination: function(B, G) { return B.apply(null, [this].concat([].slice.call(G))); }, analogous: function() { return this._applyCombination(C, arguments); }, complement: function() { return this._applyCombination(T, arguments); }, monochromatic: function() { return this._applyCombination(I, arguments); }, splitcomplement: function() { return this._applyCombination(M, arguments); }, // Disabled until https://github.com/bgrins/TinyColor/issues/254 // polyad: function (number) { // return this._applyCombination(polyad, [number]); // }, triad: function() { return this._applyCombination(O, [3]); }, tetrad: function() { return this._applyCombination(O, [4]); } }, i.fromRatio = function(B, G) { if (n(B) == "object") { var Z = {}; for (var oe in B) B.hasOwnProperty(oe) && (oe === "a" ? Z[oe] = B[oe] : Z[oe] = H(B[oe])); B = Z; } return i(B, G); }; function o(B) { var G = { r: 0, g: 0, b: 0 }, Z = 1, oe = null, ae = null, ge = null, ve = !1, pe = !1; return typeof B == "string" && (B = X(B)), n(B) == "object" && (te(B.r) && te(B.g) && te(B.b) ? (G = l(B.r, B.g, B.b), ve = !0, pe = String(B.r).substr(-1) === "%" ? "prgb" : "rgb") : te(B.h) && te(B.s) && te(B.v) ? (oe = H(B.s), ae = H(B.v), G = f(B.h, oe, ae), ve = !0, pe = "hsv") : te(B.h) && te(B.s) && te(B.l) && (oe = H(B.s), ge = H(B.l), G = c(B.h, oe, ge), ve = !0, pe = "hsl"), B.hasOwnProperty("a") && (Z = B.a)), Z = W(Z), { ok: ve, format: B.format || pe, r: Math.min(255, Math.max(G.r, 0)), g: Math.min(255, Math.max(G.g, 0)), b: Math.min(255, Math.max(G.b, 0)), a: Z }; } function l(B, G, Z) { return { r: J(B, 255) * 255, g: J(G, 255) * 255, b: J(Z, 255) * 255 }; } function s(B, G, Z) { B = J(B, 255), G = J(G, 255), Z = J(Z, 255); var oe = Math.max(B, G, Z), ae = Math.min(B, G, Z), ge, ve, pe = (oe + ae) / 2; if (oe == ae) ge = ve = 0; else { var ye = oe - ae; switch (ve = pe > 0.5 ? ye / (2 - oe - ae) : ye / (oe + ae), oe) { case B: ge = (G - Z) / ye + (G < Z ? 6 : 0); break; case G: ge = (Z - B) / ye + 2; break; case Z: ge = (B - G) / ye + 4; break; } ge /= 6; } return { h: ge, s: ve, l: pe }; } function c(B, G, Z) { var oe, ae, ge; B = J(B, 360), G = J(G, 100), Z = J(Z, 100); function ve(Oe, Be, Ie) { return Ie < 0 && (Ie += 1), Ie > 1 && (Ie -= 1), Ie < 1 / 6 ? Oe + (Be - Oe) * 6 * Ie : Ie < 1 / 2 ? Be : Ie < 2 / 3 ? Oe + (Be - Oe) * (2 / 3 - Ie) * 6 : Oe; } if (G === 0) oe = ae = ge = Z; else { var pe = Z < 0.5 ? Z * (1 + G) : Z + G - Z * G, ye = 2 * Z - pe; oe = ve(ye, pe, B + 1 / 3), ae = ve(ye, pe, B), ge = ve(ye, pe, B - 1 / 3); } return { r: oe * 255, g: ae * 255, b: ge * 255 }; } function u(B, G, Z) { B = J(B, 255), G = J(G, 255), Z = J(Z, 255); var oe = Math.max(B, G, Z), ae = Math.min(B, G, Z), ge, ve, pe = oe, ye = oe - ae; if (ve = oe === 0 ? 0 : ye / oe, oe == ae) ge = 0; else { switch (oe) { case B: ge = (G - Z) / ye + (G < Z ? 6 : 0); break; case G: ge = (Z - B) / ye + 2; break; case Z: ge = (B - G) / ye + 4; break; } ge /= 6; } return { h: ge, s: ve, v: pe }; } function f(B, G, Z) { B = J(B, 360) * 6, G = J(G, 100), Z = J(Z, 100); var oe = Math.floor(B), ae = B - oe, ge = Z * (1 - G), ve = Z * (1 - ae * G), pe = Z * (1 - (1 - ae) * G), ye = oe % 6, Oe = [Z, ve, ge, ge, pe, Z][ye], Be = [pe, Z, Z, ve, ge, ge][ye], Ie = [ge, ge, pe, Z, Z, ve][ye]; return { r: Oe * 255, g: Be * 255, b: Ie * 255 }; } function h(B, G, Z, oe) { var ae = [q(Math.round(B).toString(16)), q(Math.round(G).toString(16)), q(Math.round(Z).toString(16))]; return oe && ae[0].charAt(0) == ae[0].charAt(1) && ae[1].charAt(0) == ae[1].charAt(1) && ae[2].charAt(0) == ae[2].charAt(1) ? ae[0].charAt(0) + ae[1].charAt(0) + ae[2].charAt(0) : ae.join(""); } function g(B, G, Z, oe, ae) { var ge = [q(Math.round(B).toString(16)), q(Math.round(G).toString(16)), q(Math.round(Z).toString(16)), q(K(oe))]; return ae && ge[0].charAt(0) == ge[0].charAt(1) && ge[1].charAt(0) == ge[1].charAt(1) && ge[2].charAt(0) == ge[2].charAt(1) && ge[3].charAt(0) == ge[3].charAt(1) ? ge[0].charAt(0) + ge[1].charAt(0) + ge[2].charAt(0) + ge[3].charAt(0) : ge.join(""); } function p(B, G, Z, oe) { var ae = [q(K(oe)), q(Math.round(B).toString(16)), q(Math.round(G).toString(16)), q(Math.round(Z).toString(16))]; return ae.join(""); } i.equals = function(B, G) { return !B || !G ? !1 : i(B).toRgbString() == i(G).toRgbString(); }, i.random = function() { return i.fromRatio({ r: Math.random(), g: Math.random(), b: Math.random() }); }; function v(B, G) { G = G === 0 ? 0 : G || 10; var Z = i(B).toHsl(); return Z.s -= G / 100, Z.s = U(Z.s), i(Z); } function y(B, G) { G = G === 0 ? 0 : G || 10; var Z = i(B).toHsl(); return Z.s += G / 100, Z.s = U(Z.s), i(Z); } function m(B) { return i(B).desaturate(100); } function b(B, G) { G = G === 0 ? 0 : G || 10; var Z = i(B).toHsl(); return Z.l += G / 100, Z.l = U(Z.l), i(Z); } function w(B, G) { G = G === 0 ? 0 : G || 10; var Z = i(B).toRgb(); return Z.r = Math.max(0, Math.min(255, Z.r - Math.round(255 * -(G / 100)))), Z.g = Math.max(0, Math.min(255, Z.g - Math.round(255 * -(G / 100)))), Z.b = Math.max(0, Math.min(255, Z.b - Math.round(255 * -(G / 100)))), i(Z); } function _(B, G) { G = G === 0 ? 0 : G || 10; var Z = i(B).toHsl(); return Z.l -= G / 100, Z.l = U(Z.l), i(Z); } function k(B, G) { var Z = i(B).toHsl(), oe = (Z.h + G) % 360; return Z.h = oe < 0 ? 360 + oe : oe, i(Z); } function T(B) { var G = i(B).toHsl(); return G.h = (G.h + 180) % 360, i(G); } function O(B, G) { if (isNaN(G) || G <= 0) throw new Error("Argument to polyad must be a positive number"); for (var Z = i(B).toHsl(), oe = [i(B)], ae = 360 / G, ge = 1; ge < G; ge++) oe.push(i({ h: (Z.h + ge * ae) % 360, s: Z.s, l: Z.l })); return oe; } function M(B) { var G = i(B).toHsl(), Z = G.h; return [i(B), i({ h: (Z + 72) % 360, s: G.s, l: G.l }), i({ h: (Z + 216) % 360, s: G.s, l: G.l })]; } function C(B, G, Z) { G = G || 6, Z = Z || 30; var oe = i(B).toHsl(), ae = 360 / Z, ge = [i(B)]; for (oe.h = (oe.h - (ae * G >> 1) + 720) % 360; --G; ) oe.h = (oe.h + ae) % 360, ge.push(i(oe)); return ge; } function I(B, G) { G = G || 6; for (var Z = i(B).toHsv(), oe = Z.h, ae = Z.s, ge = Z.v, ve = [], pe = 1 / G; G--; ) ve.push(i({ h: oe, s: ae, v: ge })), ge = (ge + pe) % 1; return ve; } i.mix = function(B, G, Z) { Z = Z === 0 ? 0 : Z || 50; var oe = i(B).toRgb(), ae = i(G).toRgb(), ge = Z / 100, ve = { r: (ae.r - oe.r) * ge + oe.r, g: (ae.g - oe.g) * ge + oe.g, b: (ae.b - oe.b) * ge + oe.b, a: (ae.a - oe.a) * ge + oe.a }; return i(ve); }, i.readability = function(B, G) { var Z = i(B), oe = i(G); return (Math.max(Z.getLuminance(), oe.getLuminance()) + 0.05) / (Math.min(Z.getLuminance(), oe.getLuminance()) + 0.05); }, i.isReadable = function(B, G, Z) { var oe = i.readability(B, G), ae, ge; switch (ge = !1, ae = ce(Z), ae.level + ae.size) { case "AAsmall": case "AAAlarge": ge = oe >= 4.5; break; case "AAlarge": ge = oe >= 3; break; case "AAAsmall": ge = oe >= 7; break; } return ge; }, i.mostReadable = function(B, G, Z) { var oe = null, ae = 0, ge, ve, pe, ye; Z = Z || {}, ve = Z.includeFallbackColors, pe = Z.level, ye = Z.size; for (var Oe = 0; Oe < G.length; Oe++) ge = i.readability(B, G[Oe]), ge > ae && (ae = ge, oe = i(G[Oe])); return i.isReadable(B, oe, { level: pe, size: ye }) || !ve ? oe : (Z.includeFallbackColors = !1, i.mostReadable(B, ["#fff", "#000"], Z)); }; var j = i.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, P = i.hexNames = N(j); function N(B) { var G = {}; for (var Z in B) B.hasOwnProperty(Z) && (G[B[Z]] = Z); return G; } function W(B) { return B = parseFloat(B), (isNaN(B) || B < 0 || B > 1) && (B = 1), B; } function J(B, G) { z(B) && (B = "100%"); var Z = F(B); return B = Math.min(G, Math.max(0, parseFloat(B))), Z && (B = parseInt(B * G, 10) / 100), Math.abs(B - G) < 1e-6 ? 1 : B % G / parseFloat(G); } function U(B) { return Math.min(1, Math.max(0, B)); } function E(B) { return parseInt(B, 16); } function z(B) { return typeof B == "string" && B.indexOf(".") != -1 && parseFloat(B) === 1; } function F(B) { return typeof B == "string" && B.indexOf("%") != -1; } function q(B) { return B.length == 1 ? "0" + B : "" + B; } function H(B) { return B <= 1 && (B = B * 100 + "%"), B; } function K(B) { return Math.round(parseFloat(B) * 255).toString(16); } function Q(B) { return E(B) / 255; } var re = function() { var B = "[-\\+]?\\d+%?", G = "[-\\+]?\\d*\\.\\d+%?", Z = "(?:" + G + ")|(?:" + B + ")", oe = "[\\s|\\(]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")\\s*\\)?", ae = "[\\s|\\(]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")[,|\\s]+(" + Z + ")\\s*\\)?"; return { CSS_UNIT: new RegExp(Z), rgb: new RegExp("rgb" + oe), rgba: new RegExp("rgba" + ae), hsl: new RegExp("hsl" + oe), hsla: new RegExp("hsla" + ae), hsv: new RegExp("hsv" + oe), hsva: new RegExp("hsva" + ae), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; }(); function te(B) { return !!re.CSS_UNIT.exec(B); } function X(B) { B = B.replace(r, "").replace(a, "").toLowerCase(); var G = !1; if (j[B]) B = j[B], G = !0; else if (B == "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var Z; return (Z = re.rgb.exec(B)) ? { r: Z[1], g: Z[2], b: Z[3] } : (Z = re.rgba.exec(B)) ? { r: Z[1], g: Z[2], b: Z[3], a: Z[4] } : (Z = re.hsl.exec(B)) ? { h: Z[1], s: Z[2], l: Z[3] } : (Z = re.hsla.exec(B)) ? { h: Z[1], s: Z[2], l: Z[3], a: Z[4] } : (Z = re.hsv.exec(B)) ? { h: Z[1], s: Z[2], v: Z[3] } : (Z = re.hsva.exec(B)) ? { h: Z[1], s: Z[2], v: Z[3], a: Z[4] } : (Z = re.hex8.exec(B)) ? { r: E(Z[1]), g: E(Z[2]), b: E(Z[3]), a: Q(Z[4]), format: G ? "name" : "hex8" } : (Z = re.hex6.exec(B)) ? { r: E(Z[1]), g: E(Z[2]), b: E(Z[3]), format: G ? "name" : "hex" } : (Z = re.hex4.exec(B)) ? { r: E(Z[1] + "" + Z[1]), g: E(Z[2] + "" + Z[2]), b: E(Z[3] + "" + Z[3]), a: Q(Z[4] + "" + Z[4]), format: G ? "name" : "hex8" } : (Z = re.hex3.exec(B)) ? { r: E(Z[1] + "" + Z[1]), g: E(Z[2] + "" + Z[2]), b: E(Z[3] + "" + Z[3]), format: G ? "name" : "hex" } : !1; } function ce(B) { var G, Z; return B = B || { level: "AA", size: "small" }, G = (B.level || "AA").toUpperCase(), Z = (B.size || "small").toLowerCase(), G !== "AA" && G !== "AAA" && (G = "AA"), Z !== "small" && Z !== "large" && (Z = "small"), { level: G, size: Z }; } return i; }); })(G4); var xi = G4.exports, Fr = function(e) { var t = e.editType, n = e.colorEditType; n === void 0 && (n = t); var r = { family: { valType: "string", noBlank: !0, strict: !0, editType: t, description: [ "HTML font family - the typeface that will be applied by the web browser.", "The web browser will only be able to apply a font if it is available on the system", "which it operates. Provide multiple font families, separated by commas, to indicate", "the preference in which to apply fonts if they aren't available on the system.", "The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server,", "where only a select number of", "fonts are installed and supported.", "These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,", "*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,", "*PT Sans Narrow*, *Raleway*, *Times New Roman*." ].join(" ") }, size: { valType: "number", min: 1, editType: t }, color: { valType: "color", editType: n }, editType: t, // blank strings so compress_attributes can remove // TODO - that's uber hacky... better solution? description: "" + (e.description || "") }; return e.autoSize && (r.size.dflt = "auto"), e.autoColor && (r.color.dflt = "auto"), e.arrayOk && (r.family.arrayOk = !0, r.size.arrayOk = !0, r.color.arrayOk = !0), r; }, s0 = { // hover labels for multiple horizontal bars get tilted by this angle YANGLE: 60, // size and display constants for hover text // pixel size of hover arrows HOVERARROWSIZE: 6, // pixels padding around text HOVERTEXTPAD: 3, // hover font HOVERFONTSIZE: 13, HOVERFONT: "Arial, sans-serif", // minimum time (msec) between hover calls HOVERMINTIME: 50, // ID suffix (with fullLayout._uid) for hover events in the throttle cache HOVERID: "-hover" }, W4 = s0, Z4 = Fr, B1 = Z4({ editType: "none", description: "Sets the default hover label font used by all traces on the graph." }); B1.family.dflt = W4.HOVERFONT; B1.size.dflt = W4.HOVERFONTSIZE; var Zd = { clickmode: { valType: "flaglist", flags: ["event", "select"], dflt: "event", editType: "plot", extras: ["none"], description: [ "Determines the mode of single click interactions.", "*event* is the default value and emits the `plotly_click`", "event. In addition this mode emits the `plotly_selected` event", "in drag modes *lasso* and *select*, but with no event data attached", "(kept for compatibility reasons).", "The *select* flag enables selecting single", "data points via click. This mode also supports persistent selections,", "meaning that pressing Shift while clicking, adds to / subtracts from an", "existing selection. *select* with `hovermode`: *x* can be confusing, consider", "explicitly setting `hovermode`: *closest* when using this feature.", "Selection events are sent accordingly as long as *event* flag is set as well.", "When the *event* flag is missing, `plotly_click` and `plotly_selected`", "events are not fired." ].join(" ") }, dragmode: { valType: "enumerated", values: [ "zoom", "pan", "select", "lasso", "drawclosedpath", "drawopenpath", "drawline", "drawrect", "drawcircle", "orbit", "turntable", !1 ], dflt: "zoom", editType: "modebar", description: [ "Determines the mode of drag interactions.", "*select* and *lasso* apply only to scatter traces with", "markers or text. *orbit* and *turntable* apply only to", "3D scenes." ].join(" ") }, hovermode: { valType: "enumerated", values: ["x", "y", "closest", !1, "x unified", "y unified"], dflt: "closest", editType: "modebar", description: [ "Determines the mode of hover interactions.", "If *closest*, a single hoverlabel will appear", "for the *closest* point within the `hoverdistance`.", "If *x* (or *y*), multiple hoverlabels will appear for multiple points", "at the *closest* x- (or y-) coordinate within the `hoverdistance`,", "with the caveat that no more than one hoverlabel will appear per trace.", "If *x unified* (or *y unified*), a single hoverlabel will appear", "multiple points at the closest x- (or y-) coordinate within the `hoverdistance`", "with the caveat that no more than one hoverlabel will appear per trace.", "In this mode, spikelines are enabled by default perpendicular to the specified axis.", "If false, hover interactions are disabled." ].join(" ") }, hoverdistance: { valType: "integer", min: -1, dflt: 20, editType: "none", description: [ "Sets the default distance (in pixels) to look for data", "to add hover labels (-1 means no cutoff, 0 means no looking for data).", "This is only a real distance for hovering on point-like objects,", "like scatter points. For area-like objects (bars, scatter fills, etc)", "hovering is on inside the area and off outside, but these objects", "will not supersede hover on point-like objects in case of conflict." ].join(" ") }, spikedistance: { valType: "integer", min: -1, dflt: -1, editType: "none", description: [ "Sets the default distance (in pixels) to look for data to draw", "spikelines to (-1 means no cutoff, 0 means no looking for data).", "As with hoverdistance, distance does not apply to area-like objects.", "In addition, some objects can be hovered on but will not generate", "spikelines, such as scatter fills." ].join(" ") }, hoverlabel: { bgcolor: { valType: "color", editType: "none", description: [ "Sets the background color of all hover labels on graph" ].join(" ") }, bordercolor: { valType: "color", editType: "none", description: [ "Sets the border color of all hover labels on graph." ].join(" ") }, font: B1, grouptitlefont: Z4({ editType: "none", description: [ "Sets the font for group titles in hover (unified modes).", "Defaults to `hoverlabel.font`." ].join(" ") }), align: { valType: "enumerated", values: ["left", "right", "auto"], dflt: "auto", editType: "none", description: [ "Sets the horizontal alignment of the text content within hover label box.", "Has an effect only if the hover label text spans more two or more lines" ].join(" ") }, namelength: { valType: "integer", min: -1, dflt: 15, editType: "none", description: [ "Sets the default length (in number of characters) of the trace name in", "the hover labels for all traces. -1 shows the whole name", "regardless of length. 0-3 shows the first 0-3 characters, and", "an integer >3 will show the whole name if it is less than that", "many characters, but if it is longer, will truncate to", "`namelength - 3` characters and add an ellipsis." ].join(" ") }, editType: "none" }, selectdirection: { valType: "enumerated", values: ["h", "v", "d", "any"], dflt: "any", description: [ "When `dragmode` is set to *select*, this limits the selection of the drag to", "horizontal, vertical or diagonal. *h* only allows horizontal selection,", "*v* only vertical, *d* only diagonal and *any* sets no limit." ].join(" "), editType: "none" } }, tr = {}, m_ = gs, xu = Array.isArray; function Dq(e, t) { var n, r; for (n = 0; n < e.length; n++) { if (r = e[n], r !== null && typeof r == "object") return !1; r !== void 0 && (t[n] = r); } return !0; } tr.extendFlat = function() { return Yd(arguments, !1, !1, !1); }; tr.extendDeep = function() { return Yd(arguments, !0, !1, !1); }; tr.extendDeepAll = function() { return Yd(arguments, !0, !0, !1); }; tr.extendDeepNoArrays = function() { return Yd(arguments, !0, !1, !0); }; function Yd(e, t, n, r) { var a = e[0], i = e.length, o, l, s, c, u, f, h; if (i === 2 && xu(a) && xu(e[1]) && a.length === 0) { if (h = Dq(e[1], a), h) return a; a.splice(0, a.length); } for (var g = 1; g < i; g++) { o = e[g]; for (l in o) s = a[l], c = o[l], r && xu(c) ? a[l] = c : t && c && (m_(c) || (u = xu(c))) ? (u ? (u = !1, f = s && xu(s) ? s : []) : f = s && m_(s) ? s : {}, a[l] = Yd([f, c], t, n, r)) : (typeof c < "u" || n) && (a[l] = c); } return a; } var Fq = Fr, Ef = Zd.hoverlabel, jf = tr.extendFlat, H1 = { hoverlabel: { bgcolor: jf({}, Ef.bgcolor, { arrayOk: !0, description: "Sets the background color of the hover labels for this trace" }), bordercolor: jf({}, Ef.bordercolor, { arrayOk: !0, description: "Sets the border color of the hover labels for this trace." }), font: Fq({ arrayOk: !0, editType: "none", description: "Sets the font used in hover labels." }), align: jf({}, Ef.align, { arrayOk: !0 }), namelength: jf({}, Ef.namelength, { arrayOk: !0 }), editType: "none" } }, Iq = Fr, zq = H1, Zi = { type: { valType: "enumerated", values: [], // listed dynamically dflt: "scatter", editType: "calc+clearAxisTypes", _noTemplating: !0 // we handle this at a higher level }, visible: { valType: "enumerated", values: [!0, !1, "legendonly"], dflt: !0, editType: "calc", description: [ "Determines whether or not this trace is visible.", "If *legendonly*, the trace is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }, showlegend: { valType: "boolean", dflt: !0, editType: "style", description: [ "Determines whether or not an item corresponding to this", "trace is shown in the legend." ].join(" ") }, legend: { valType: "subplotid", dflt: "legend", editType: "style", description: [ "Sets the reference to a legend to show this trace in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }, legendgroup: { valType: "string", dflt: "", editType: "style", description: [ "Sets the legend group for this trace.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }, legendgrouptitle: { text: { valType: "string", dflt: "", editType: "style", description: [ "Sets the title of the legend group." ].join(" ") }, font: Iq({ editType: "style", description: [ "Sets this legend group's title font." ].join(" ") }), editType: "style" }, legendrank: { valType: "number", dflt: 1e3, editType: "style", description: [ "Sets the legend rank for this trace.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items.", "When having unranked or equal rank items shapes would be displayed after traces", "i.e. according to their order in data and layout." ].join(" ") }, legendwidth: { valType: "number", min: 0, editType: "style", description: "Sets the width (in px or fraction) of the legend for this trace." }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "style", description: "Sets the opacity of the trace." }, name: { valType: "string", editType: "style", description: [ "Sets the trace name.", "The trace name appears as the legend item and on hover." ].join(" ") }, uid: { valType: "string", editType: "plot", anim: !0, description: [ "Assign an id to this trace,", "Use this to provide object constancy between traces during animations", "and transitions." ].join(" ") }, ids: { valType: "data_array", editType: "calc", anim: !0, description: [ "Assigns id labels to each datum.", "These ids for object constancy of data points during animation.", "Should be an array of strings, not numbers or any other type." ].join(" ") }, customdata: { valType: "data_array", editType: "calc", description: [ "Assigns extra data each datum.", "This may be useful when listening to hover, click and selection events.", "Note that, *scatter* traces also appends customdata items in the markers", "DOM elements" ].join(" ") }, meta: { valType: "any", arrayOk: !0, editType: "plot", description: [ "Assigns extra meta information associated with this trace", "that can be used in various text attributes.", "Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`", "`rangeselector`, `updatemenues` and `sliders` `label` text", "all support `meta`.", "To access the trace `meta` values in an attribute in the same trace, simply use", "`%{meta[i]}` where `i` is the index or key of the `meta`", "item in question.", "To access trace `meta` in layout attributes, use", "`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`", "and `n` is the trace index." ].join(" ") }, // N.B. these cannot be 'data_array' as they do not have the same length as // other data arrays and arrayOk attributes in general // // Maybe add another valType: // https://github.com/plotly/plotly.js/issues/1894 selectedpoints: { valType: "any", editType: "calc", description: [ "Array containing integer indices of selected points.", "Has an effect only for traces that support selections.", "Note that an empty array means an empty selection where the `unselected`", "are turned on for all points, whereas, any other non-array values means no", "selection all where the `selected` and `unselected` styles have no effect." ].join(" ") }, hoverinfo: { valType: "flaglist", flags: ["x", "y", "z", "text", "name"], extras: ["all", "none", "skip"], arrayOk: !0, dflt: "all", editType: "none", description: [ "Determines which trace information appear on hover.", "If `none` or `skip` are set, no information is displayed upon hovering.", "But, if `none` is set, click and hover events are still fired." ].join(" ") }, hoverlabel: zq.hoverlabel, stream: { token: { valType: "string", noBlank: !0, strict: !0, editType: "calc", description: [ "The stream id number links a data trace on a plot with a stream.", "See https://chart-studio.plotly.com/settings for more details." ].join(" ") }, maxpoints: { valType: "number", min: 0, max: 1e4, dflt: 500, editType: "calc", description: [ "Sets the maximum number of points to keep on the plots from an", "incoming stream.", "If `maxpoints` is set to *50*, only the newest 50 points will", "be displayed on the plot." ].join(" ") }, editType: "calc" }, transforms: { _isLinkedToArray: "transform", editType: "calc", description: [ "WARNING: All transforms are deprecated and may be removed from the API in next major version.", "An array of operations that manipulate the trace data,", "for example filtering or sorting the data arrays." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of some user-driven changes to the trace:", "`constraintrange` in `parcoords` traces, as well as some", "`editable: true` modifications such as `name` and `colorbar.title`.", "Defaults to `layout.uirevision`.", "Note that other user-driven trace attribute changes are controlled", "by `layout` attributes:", "`trace.visible` is controlled by `layout.legend.uirevision`,", "`selectedpoints` is controlled by `layout.selectionrevision`,", "and `colorbar.(x|y)` (accessible with `config: {editable: true}`)", "is controlled by `layout.editrevision`.", "Trace changes are tracked by `uid`, which only falls back on trace", "index if no `uid` is provided. So if your app can add/remove traces", "before the end of the `data` array, such that the same trace has a", "different index, you can still preserve user-driven changes if you", "give each trace a `uid` that stays with it as it moves." ].join(" ") } }, Eq = xi, c0 = { Greys: [ [0, "rgb(0,0,0)"], [1, "rgb(255,255,255)"] ], YlGnBu: [ [0, "rgb(8,29,88)"], [0.125, "rgb(37,52,148)"], [0.25, "rgb(34,94,168)"], [0.375, "rgb(29,145,192)"], [0.5, "rgb(65,182,196)"], [0.625, "rgb(127,205,187)"], [0.75, "rgb(199,233,180)"], [0.875, "rgb(237,248,217)"], [1, "rgb(255,255,217)"] ], Greens: [ [0, "rgb(0,68,27)"], [0.125, "rgb(0,109,44)"], [0.25, "rgb(35,139,69)"], [0.375, "rgb(65,171,93)"], [0.5, "rgb(116,196,118)"], [0.625, "rgb(161,217,155)"], [0.75, "rgb(199,233,192)"], [0.875, "rgb(229,245,224)"], [1, "rgb(247,252,245)"] ], YlOrRd: [ [0, "rgb(128,0,38)"], [0.125, "rgb(189,0,38)"], [0.25, "rgb(227,26,28)"], [0.375, "rgb(252,78,42)"], [0.5, "rgb(253,141,60)"], [0.625, "rgb(254,178,76)"], [0.75, "rgb(254,217,118)"], [0.875, "rgb(255,237,160)"], [1, "rgb(255,255,204)"] ], Bluered: [ [0, "rgb(0,0,255)"], [1, "rgb(255,0,0)"] ], // modified RdBu based on // http://www.kennethmoreland.com/color-maps/ RdBu: [ [0, "rgb(5,10,172)"], [0.35, "rgb(106,137,247)"], [0.5, "rgb(190,190,190)"], [0.6, "rgb(220,170,132)"], [0.7, "rgb(230,145,90)"], [1, "rgb(178,10,28)"] ], // Scale for non-negative numeric values Reds: [ [0, "rgb(220,220,220)"], [0.2, "rgb(245,195,157)"], [0.4, "rgb(245,160,105)"], [1, "rgb(178,10,28)"] ], // Scale for non-positive numeric values Blues: [ [0, "rgb(5,10,172)"], [0.35, "rgb(40,60,190)"], [0.5, "rgb(70,100,245)"], [0.6, "rgb(90,120,245)"], [0.7, "rgb(106,137,247)"], [1, "rgb(220,220,220)"] ], Picnic: [ [0, "rgb(0,0,255)"], [0.1, "rgb(51,153,255)"], [0.2, "rgb(102,204,255)"], [0.3, "rgb(153,204,255)"], [0.4, "rgb(204,204,255)"], [0.5, "rgb(255,255,255)"], [0.6, "rgb(255,204,255)"], [0.7, "rgb(255,153,255)"], [0.8, "rgb(255,102,204)"], [0.9, "rgb(255,102,102)"], [1, "rgb(255,0,0)"] ], Rainbow: [ [0, "rgb(150,0,90)"], [0.125, "rgb(0,0,200)"], [0.25, "rgb(0,25,255)"], [0.375, "rgb(0,152,255)"], [0.5, "rgb(44,255,150)"], [0.625, "rgb(151,255,0)"], [0.75, "rgb(255,234,0)"], [0.875, "rgb(255,111,0)"], [1, "rgb(255,0,0)"] ], Portland: [ [0, "rgb(12,51,131)"], [0.25, "rgb(10,136,186)"], [0.5, "rgb(242,211,56)"], [0.75, "rgb(242,143,56)"], [1, "rgb(217,30,30)"] ], Jet: [ [0, "rgb(0,0,131)"], [0.125, "rgb(0,60,170)"], [0.375, "rgb(5,255,255)"], [0.625, "rgb(255,255,0)"], [0.875, "rgb(250,0,0)"], [1, "rgb(128,0,0)"] ], Hot: [ [0, "rgb(0,0,0)"], [0.3, "rgb(230,0,0)"], [0.6, "rgb(255,210,0)"], [1, "rgb(255,255,255)"] ], Blackbody: [ [0, "rgb(0,0,0)"], [0.2, "rgb(230,0,0)"], [0.4, "rgb(230,210,0)"], [0.7, "rgb(255,255,255)"], [1, "rgb(160,200,255)"] ], Earth: [ [0, "rgb(0,0,130)"], [0.1, "rgb(0,180,180)"], [0.2, "rgb(40,210,40)"], [0.4, "rgb(230,230,50)"], [0.6, "rgb(120,70,20)"], [1, "rgb(255,255,255)"] ], Electric: [ [0, "rgb(0,0,0)"], [0.15, "rgb(30,0,100)"], [0.4, "rgb(120,0,100)"], [0.6, "rgb(160,90,0)"], [0.8, "rgb(230,200,0)"], [1, "rgb(255,250,220)"] ], Viridis: [ [0, "#440154"], [0.06274509803921569, "#48186a"], [0.12549019607843137, "#472d7b"], [0.18823529411764706, "#424086"], [0.25098039215686274, "#3b528b"], [0.3137254901960784, "#33638d"], [0.3764705882352941, "#2c728e"], [0.4392156862745098, "#26828e"], [0.5019607843137255, "#21918c"], [0.5647058823529412, "#1fa088"], [0.6274509803921569, "#28ae80"], [0.6901960784313725, "#3fbc73"], [0.7529411764705882, "#5ec962"], [0.8156862745098039, "#84d44b"], [0.8784313725490196, "#addc30"], [0.9411764705882353, "#d8e219"], [1, "#fde725"] ], Cividis: [ [0, "rgb(0,32,76)"], [0.058824, "rgb(0,42,102)"], [0.117647, "rgb(0,52,110)"], [0.176471, "rgb(39,63,108)"], [0.235294, "rgb(60,74,107)"], [0.294118, "rgb(76,85,107)"], [0.352941, "rgb(91,95,109)"], [0.411765, "rgb(104,106,112)"], [0.470588, "rgb(117,117,117)"], [0.529412, "rgb(131,129,120)"], [0.588235, "rgb(146,140,120)"], [0.647059, "rgb(161,152,118)"], [0.705882, "rgb(176,165,114)"], [0.764706, "rgb(192,177,109)"], [0.823529, "rgb(209,191,102)"], [0.882353, "rgb(225,204,92)"], [0.941176, "rgb(243,219,79)"], [1, "rgb(255,233,69)"] ] }, Y4 = c0.RdBu; function jq(e, t) { if (t || (t = Y4), !e) return t; function n() { try { e = c0[e] || JSON.parse(e); } catch { e = t; } } return typeof e == "string" && (n(), typeof e == "string" && n()), $4(e) ? e : t; } function $4(e) { var t = 0; if (!Array.isArray(e) || e.length < 2 || !e[0] || !e[e.length - 1] || +e[0][0] != 0 || +e[e.length - 1][0] != 1) return !1; for (var n = 0; n < e.length; n++) { var r = e[n]; if (r.length !== 2 || +r[0] < t || !Eq(r[1]).isValid()) return !1; t = +r[0]; } return !0; } function Pq(e) { return c0[e] !== void 0 ? !0 : $4(e); } var Wc = { scales: c0, defaultScale: Y4, get: jq, isValid: Pq }, K4 = { exports: {} }, fa = {}; fa.defaults = [ "#1f77b4", // muted blue "#ff7f0e", // safety orange "#2ca02c", // cooked asparagus green "#d62728", // brick red "#9467bd", // muted purple "#8c564b", // chestnut brown "#e377c2", // raspberry yogurt pink "#7f7f7f", // middle gray "#bcbd22", // curry yellow-green "#17becf" // blue-teal ]; fa.defaultLine = "#444"; fa.lightLine = "#eee"; fa.background = "#fff"; fa.borderLine = "#BEC8D9"; fa.lightFraction = 100 * 10 / 11; var hi = xi, Rq = cn, Nq = ir.isTypedArray, br = K4.exports = {}, u0 = fa; br.defaults = u0.defaults; var Bq = br.defaultLine = u0.defaultLine; br.lightLine = u0.lightLine; var ny = br.background = u0.background; br.tinyRGB = function(e) { var t = e.toRgb(); return "rgb(" + Math.round(t.r) + ", " + Math.round(t.g) + ", " + Math.round(t.b) + ")"; }; br.rgb = function(e) { return br.tinyRGB(hi(e)); }; br.opacity = function(e) { return e ? hi(e).getAlpha() : 0; }; br.addOpacity = function(e, t) { var n = hi(e).toRgb(); return "rgba(" + Math.round(n.r) + ", " + Math.round(n.g) + ", " + Math.round(n.b) + ", " + t + ")"; }; br.combine = function(e, t) { var n = hi(e).toRgb(); if (n.a === 1) return hi(e).toRgbString(); var r = hi(t || ny).toRgb(), a = r.a === 1 ? r : { r: 255 * (1 - r.a) + r.r * r.a, g: 255 * (1 - r.a) + r.g * r.a, b: 255 * (1 - r.a) + r.b * r.a }, i = { r: a.r * (1 - n.a) + n.r * n.a, g: a.g * (1 - n.a) + n.g * n.a, b: a.b * (1 - n.a) + n.b * n.a }; return hi(i).toRgbString(); }; br.contrast = function(e, t, n) { var r = hi(e); r.getAlpha() !== 1 && (r = hi(br.combine(e, ny))); var a = r.isDark() ? t ? r.lighten(t) : ny : n ? r.darken(n) : Bq; return a.toString(); }; br.stroke = function(e, t) { var n = hi(t); e.style({ stroke: br.tinyRGB(n), "stroke-opacity": n.getAlpha() }); }; br.fill = function(e, t) { var n = hi(t); e.style({ fill: br.tinyRGB(n), "fill-opacity": n.getAlpha() }); }; br.clean = function(e) { if (!(!e || typeof e != "object")) { var t = Object.keys(e), n, r, a, i; for (n = 0; n < t.length; n++) if (a = t[n], i = e[a], a.substr(a.length - 5) === "color") if (Array.isArray(i)) for (r = 0; r < i.length; r++) i[r] = Ug(i[r]); else e[a] = Ug(i); else if (a.substr(a.length - 10) === "colorscale" && Array.isArray(i)) for (r = 0; r < i.length; r++) Array.isArray(i[r]) && (i[r][1] = Ug(i[r][1])); else if (Array.isArray(i)) { var o = i[0]; if (!Array.isArray(o) && o && typeof o == "object") for (r = 0; r < i.length; r++) br.clean(i[r]); } else i && typeof i == "object" && !Nq(i) && br.clean(i); } }; function Ug(e) { if (Rq(e) || typeof e != "string") return e; var t = e.trim(); if (t.substr(0, 3) !== "rgb") return e; var n = t.match(/^rgba?\s*\(([^()]*)\)$/); if (!n) return e; var r = n[1].trim().split(/\s*[\s,]\s*/), a = t.charAt(3) === "a" && r.length === 4; if (!a && r.length !== 3) return e; for (var i = 0; i < r.length; i++) { if (!r[i].length || (r[i] = Number(r[i]), !(r[i] >= 0))) return e; if (i === 3) r[i] > 1 && (r[i] = 1); else if (r[i] >= 1) return e; } var o = Math.round(r[0] * 255) + ", " + Math.round(r[1] * 255) + ", " + Math.round(r[2] * 255); return a ? "rgba(" + o + ", " + r[3] + ")" : "rgb(" + o + ")"; } var rn = K4.exports, V1 = { /** * Timing information for interactive elements */ SHOW_PLACEHOLDER: 100, HIDE_PLACEHOLDER: 1e3, // opacity dimming fraction for points that are not in selection DESELECTDIM: 0.2 }, Zc = {}; Zc.counter = function(e, t, n, r) { var a = (t || "") + (n ? "" : "$"), i = r === !1 ? "" : "^"; return e === "xy" ? new RegExp(i + "x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?" + a) : new RegExp(i + e + "([2-9]|[1-9][0-9]+)?" + a); }; (function(e) { var t = cn, n = xi, r = Zi, a = Wc, i = rn, o = V1.DESELECTDIM, l = R1, s = Zc.counter, c = Wd.modHalf, u = ir.isArrayOrTypedArray, f = ir.isTypedArraySpec, h = ir.decodeTypedArraySpec; e.valObjectMeta = { data_array: { // You can use *dflt=[] to force said array to exist though. description: [ "An {array} of data.", "The value must represent an {array} or it will be ignored,", "but this array can be provided in several forms:", "(1) a regular {array} object", "(2) a typed array (e.g. Float32Array)", "(3) an object with keys dtype, bdata, and optionally shape.", "In this 3rd form, dtype is one of", "*f8*, *f4*.", "*i4*, *u4*,", "*i2*, *u2*,", "*i1*, *u1* or *u1c* for Uint8ClampedArray.", "In addition to shorthand `dtype` above one could also use the following forms:", "*float64*, *float32*,", "*int32*, *uint32*,", "*int16*, *uint16*,", "*int8*, *uint8* or *uint8c* for Uint8ClampedArray.", "`bdata` is either a base64-encoded string or the ArrayBuffer of", "an integer or float typed array.", "For either multi-dimensional arrays you must also", "provide its dimensions separated by comma via `shape`.", "For example using `dtype`: *f4* and `shape`: *5,100* you can", "declare a 2-D array that has 5 rows and 100 columns", "containing float32 values i.e. 4 bits per value.", "`shape` is optional for one dimensional arrays." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(p, v, y) { v.set( u(p) ? p : f(p) ? h(p) : y ); } }, enumerated: { description: [ "Enumerated value type. The available values are listed", "in `values`." ].join(" "), requiredOpts: ["values"], otherOpts: ["dflt", "coerceNumber", "arrayOk"], coerceFunction: function(p, v, y, m) { m.coerceNumber && (p = +p), m.values.indexOf(p) === -1 ? v.set(y) : v.set(p); }, validateFunction: function(p, v) { v.coerceNumber && (p = +p); for (var y = v.values, m = 0; m < y.length; m++) { var b = String(y[m]); if (b.charAt(0) === "/" && b.charAt(b.length - 1) === "/") { var w = new RegExp(b.substr(1, b.length - 2)); if (w.test(p)) return !0; } else if (p === y[m]) return !0; } return !1; } }, boolean: { description: "A boolean (true/false) value.", requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(p, v, y) { p === !0 || p === !1 ? v.set(p) : v.set(y); } }, number: { description: [ "A number or a numeric value", "(e.g. a number inside a string).", "When applicable, values greater (less) than `max` (`min`)", "are coerced to the `dflt`." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "min", "max", "arrayOk"], coerceFunction: function(p, v, y, m) { !t(p) || m.min !== void 0 && p < m.min || m.max !== void 0 && p > m.max ? v.set(y) : v.set(+p); } }, integer: { description: [ "An integer or an integer inside a string.", "When applicable, values greater (less) than `max` (`min`)", "are coerced to the `dflt`." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "min", "max", "arrayOk"], coerceFunction: function(p, v, y, m) { p % 1 || !t(p) || m.min !== void 0 && p < m.min || m.max !== void 0 && p > m.max ? v.set(y) : v.set(+p); } }, string: { description: [ "A string value.", "Numbers are converted to strings except for attributes with", "`strict` set to true." ].join(" "), requiredOpts: [], // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter) otherOpts: ["dflt", "noBlank", "strict", "arrayOk", "values"], coerceFunction: function(p, v, y, m) { if (typeof p != "string") { var b = typeof p == "number"; m.strict === !0 || !b ? v.set(y) : v.set(String(p)); } else m.noBlank && !p ? v.set(y) : v.set(p); } }, color: { description: [ "A string describing color.", "Supported formats:", "- hex (e.g. '#d3d3d3')", "- rgb (e.g. 'rgb(255, 0, 0)')", "- rgba (e.g. 'rgb(255, 0, 0, 0.5)')", "- hsl (e.g. 'hsl(0, 100%, 50%)')", "- hsv (e.g. 'hsv(0, 100%, 100%)')", "- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)" ].join(" "), requiredOpts: [], otherOpts: ["dflt", "arrayOk"], coerceFunction: function(p, v, y) { n(p).isValid() ? v.set(p) : v.set(y); } }, colorlist: { description: [ "A list of colors.", "Must be an {array} containing valid colors." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(p, v, y) { function m(b) { return n(b).isValid(); } !Array.isArray(p) || !p.length ? v.set(y) : p.every(m) ? v.set(p) : v.set(y); } }, colorscale: { description: [ "A Plotly colorscale either picked by a name:", "(any of", Object.keys(a.scales).join(", "), ")", "customized as an {array} of 2-element {arrays} where", "the first element is the normalized color level value", "(starting at *0* and ending at *1*),", "and the second item is a valid color string." ].join(" "), requiredOpts: [], otherOpts: ["dflt"], coerceFunction: function(p, v, y) { v.set(a.get(p, y)); } }, angle: { description: [ "A number (in degree) between -180 and 180." ].join(" "), requiredOpts: [], otherOpts: ["dflt", "arrayOk"], coerceFunction: function(p, v, y) { p === "auto" ? v.set("auto") : t(p) ? v.set(c(+p, 360)) : v.set(y); } }, subplotid: { description: [ "An id string of a subplot type (given by dflt), optionally", "followed by an integer >1. e.g. if dflt='geo', we can have", "'geo', 'geo2', 'geo3', ..." ].join(" "), requiredOpts: ["dflt"], otherOpts: ["regex"], coerceFunction: function(p, v, y, m) { var b = m.regex || s(y); if (typeof p == "string" && b.test(p)) { v.set(p); return; } v.set(y); }, validateFunction: function(p, v) { var y = v.dflt; return p === y ? !0 : typeof p != "string" ? !1 : !!s(y).test(p); } }, flaglist: { description: [ "A string representing a combination of flags", "(order does not matter here).", "Combine any of the available `flags` with *+*.", "(e.g. ('lines+markers')).", "Values in `extras` cannot be combined." ].join(" "), requiredOpts: ["flags"], otherOpts: ["dflt", "extras", "arrayOk"], coerceFunction: function(p, v, y, m) { if ((m.extras || []).indexOf(p) !== -1) { v.set(p); return; } if (typeof p != "string") { v.set(y); return; } for (var b = p.split("+"), w = 0; w < b.length; ) { var _ = b[w]; m.flags.indexOf(_) === -1 || b.indexOf(_) < w ? b.splice(w, 1) : w++; } b.length ? v.set(b.join("+")) : v.set(y); } }, any: { description: "Any type.", requiredOpts: [], otherOpts: ["dflt", "values", "arrayOk"], coerceFunction: function(p, v, y) { p === void 0 ? v.set(y) : v.set( f(p) ? h(p) : p ); } }, info_array: { description: [ "An {array} of plot information." ].join(" "), requiredOpts: ["items"], // set `dimensions=2` for a 2D array or '1-2' for either // `items` may be a single object instead of an array, in which case // `freeLength` must be true. // if `dimensions='1-2'` and items is a 1D array, then the value can // either be a matching 1D array or an array of such matching 1D arrays otherOpts: ["dflt", "freeLength", "dimensions"], coerceFunction: function(p, v, y, m) { function b(U, E, z) { var F, q = { set: function(H) { F = H; } }; return z === void 0 && (z = E.dflt), e.valObjectMeta[E.valType].coerceFunction(U, q, z, E), F; } if (f(p) && (p = h(p)), !u(p)) { v.set(y); return; } var w = m.dimensions === 2 || m.dimensions === "1-2" && Array.isArray(p) && u(p[0]), _ = m.items, k = [], T = Array.isArray(_), O = T && w && u(_[0]), M = w && T && !O, C = T && !M ? _.length : p.length, I, j, P, N, W, J; if (y = Array.isArray(y) ? y : [], w) for (I = 0; I < C; I++) for (k[I] = [], P = u(p[I]) ? p[I] : [], M ? W = _.length : T ? W = _[I].length : W = P.length, j = 0; j < W; j++) M ? N = _[j] : T ? N = _[I][j] : N = _, J = b(P[j], N, (y[I] || [])[j]), J !== void 0 && (k[I][j] = J); else for (I = 0; I < C; I++) J = b(p[I], T ? _[I] : _, y[I]), J !== void 0 && (k[I] = J); v.set(k); }, validateFunction: function(p, v) { if (!u(p)) return !1; var y = v.items, m = Array.isArray(y), b = v.dimensions === 2; if (!v.freeLength && p.length !== y.length) return !1; for (var w = 0; w < p.length; w++) if (b) { if (!u(p[w]) || !v.freeLength && p[w].length !== y[w].length) return !1; for (var _ = 0; _ < p[w].length; _++) if (!g(p[w][_], m ? y[w][_] : y)) return !1; } else if (!g(p[w], m ? y[w] : y)) return !1; return !0; } } }, e.coerce = function(p, v, y, m, b) { var w = l(y, m).get(), _ = l(p, m), k = l(v, m), T = _.get(), O = v._template; if (T === void 0 && O && (T = l(O, m).get(), O = 0), b === void 0 && (b = w.dflt), w.arrayOk) { if (u(T)) return k.set(T), T; if (f(T)) return T = h(T), k.set(T), T; } var M = e.valObjectMeta[w.valType].coerceFunction; M(T, k, b, w); var C = k.get(); return O && C === b && !g(T, w) && (T = l(O, m).get(), M(T, k, b, w), C = k.get()), C; }, e.coerce2 = function(p, v, y, m, b) { var w = l(p, m), _ = e.coerce(p, v, y, m, b), k = w.get(); return k != null ? _ : !1; }, e.coerceFont = function(p, v, y) { var m = {}; return y = y || {}, m.family = p(v + ".family", y.family), m.size = p(v + ".size", y.size), m.color = p(v + ".color", y.color), m; }, e.coercePattern = function(p, v, y, m) { var b = p(v + ".shape"); if (b) { p(v + ".solidity"), p(v + ".size"); var w = p(v + ".fillmode"), _ = w === "overlay"; if (!m) { var k = p( v + ".bgcolor", _ ? y : void 0 ); p( v + ".fgcolor", _ ? i.contrast(k) : y ); } p( v + ".fgopacity", _ ? 0.5 : 1 ); } }, e.coerceHoverinfo = function(p, v, y) { var m = v._module.attributes, b = m.hoverinfo ? m : r, w = b.hoverinfo, _; if (y._dataLength === 1) { var k = w.dflt === "all" ? w.flags.slice() : w.dflt.split("+"); k.splice(k.indexOf("name"), 1), _ = k.join("+"); } return e.coerce(p, v, b, "hoverinfo", _); }, e.coerceSelectionMarkerOpacity = function(p, v) { if (p.marker) { var y = p.marker.opacity; if (y !== void 0) { var m, b; !u(y) && !p.selected && !p.unselected && (m = y, b = o * y), v("selected.marker.opacity", m), v("unselected.marker.opacity", b); } } }; function g(p, v) { var y = e.valObjectMeta[v.valType]; if (v.arrayOk && u(p)) return !0; if (y.validateFunction) return y.validateFunction(p, v); var m = {}, b = m, w = { set: function(_) { b = _; } }; return y.coerceFunction(p, w, m, v), b !== m; } e.validate = g; })(U4); var J4 = {}, Q4 = { exports: {} }, X4 = { staticPlot: { valType: "boolean", dflt: !1, description: [ "Determines whether the graphs are interactive or not.", "If *false*, no interactivity, for export or image generation." ].join(" ") }, typesetMath: { valType: "boolean", dflt: !0, description: [ "Determines whether math should be typeset or not,", "when MathJax (either v2 or v3) is present on the page." ].join(" ") }, plotlyServerURL: { valType: "string", dflt: "", description: [ "When set it determines base URL for", "the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button", "and the showLink/sendData on-graph link.", "To enable sending your data to Chart Studio Cloud, you need to", "set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and", "also set `showSendToCloud` to true." ].join(" ") }, editable: { valType: "boolean", dflt: !1, description: [ "Determines whether the graph is editable or not.", "Sets all pieces of `edits`", "unless a separate `edits` config item overrides individual parts." ].join(" ") }, edits: { annotationPosition: { valType: "boolean", dflt: !1, description: [ "Determines if the main anchor of the annotation is editable.", "The main anchor corresponds to the", "text (if no arrow) or the arrow (which drags the whole thing leaving", "the arrow length & direction unchanged)." ].join(" ") }, annotationTail: { valType: "boolean", dflt: !1, description: [ "Has only an effect for annotations with arrows.", "Enables changing the length and direction of the arrow." ].join(" ") }, annotationText: { valType: "boolean", dflt: !1, description: "Enables editing annotation text." }, axisTitleText: { valType: "boolean", dflt: !1, description: "Enables editing axis title text." }, colorbarPosition: { valType: "boolean", dflt: !1, description: "Enables moving colorbars." }, colorbarTitleText: { valType: "boolean", dflt: !1, description: "Enables editing colorbar title text." }, legendPosition: { valType: "boolean", dflt: !1, description: "Enables moving the legend." }, legendText: { valType: "boolean", dflt: !1, description: "Enables editing the trace name fields from the legend" }, shapePosition: { valType: "boolean", dflt: !1, description: "Enables moving shapes." }, titleText: { valType: "boolean", dflt: !1, description: "Enables editing the global layout title." } }, editSelection: { valType: "boolean", dflt: !0, description: "Enables moving selections." }, autosizable: { valType: "boolean", dflt: !1, description: [ "Determines whether the graphs are plotted with respect to", "layout.autosize:true and infer its container size." ].join(" ") }, responsive: { valType: "boolean", dflt: !1, description: [ "Determines whether to change the layout size when window is resized.", "In v3, this option will be removed and will always be true." ].join(" ") }, fillFrame: { valType: "boolean", dflt: !1, description: [ "When `layout.autosize` is turned on, determines whether the graph", "fills the container (the default) or the screen (if set to *true*)." ].join(" ") }, frameMargins: { valType: "number", dflt: 0, min: 0, max: 0.5, description: [ "When `layout.autosize` is turned on, set the frame margins", "in fraction of the graph size." ].join(" ") }, scrollZoom: { valType: "flaglist", flags: ["cartesian", "gl3d", "geo", "mapbox"], extras: [!0, !1], dflt: "gl3d+geo+mapbox", description: [ "Determines whether mouse wheel or two-finger scroll zooms is enable.", "Turned on by default for gl3d, geo and mapbox subplots", "(as these subplot types do not have zoombox via pan),", "but turned off by default for cartesian subplots.", "Set `scrollZoom` to *false* to disable scrolling for all subplots." ].join(" ") }, doubleClick: { valType: "enumerated", values: [!1, "reset", "autosize", "reset+autosize"], dflt: "reset+autosize", description: [ "Sets the double click interaction mode.", "Has an effect only in cartesian plots.", "If *false*, double click is disable.", "If *reset*, double click resets the axis ranges to their initial values.", "If *autosize*, double click set the axis ranges to their autorange values.", "If *reset+autosize*, the odd double clicks resets the axis ranges", "to their initial values and even double clicks set the axis ranges", "to their autorange values." ].join(" ") }, doubleClickDelay: { valType: "number", dflt: 300, min: 0, description: [ "Sets the delay for registering a double-click in ms.", "This is the time interval (in ms) between first mousedown and", "2nd mouseup to constitute a double-click.", "This setting propagates to all on-subplot double clicks", "(except for geo and mapbox) and on-legend double clicks." ].join(" ") }, showAxisDragHandles: { valType: "boolean", dflt: !0, description: [ "Set to *false* to omit cartesian axis pan/zoom drag handles." ].join(" ") }, showAxisRangeEntryBoxes: { valType: "boolean", dflt: !0, description: [ "Set to *false* to omit direct range entry at the pan/zoom drag points,", "note that `showAxisDragHandles` must be enabled to have an effect." ].join(" ") }, showTips: { valType: "boolean", dflt: !0, description: [ "Determines whether or not tips are shown while interacting", "with the resulting graphs." ].join(" ") }, showLink: { valType: "boolean", dflt: !1, description: [ "Determines whether a link to Chart Studio Cloud is displayed", "at the bottom right corner of resulting graphs.", "Use with `sendData` and `linkText`." ].join(" ") }, linkText: { valType: "string", dflt: "Edit chart", noBlank: !0, description: [ "Sets the text appearing in the `showLink` link." ].join(" ") }, sendData: { valType: "boolean", dflt: !0, description: [ "If *showLink* is true, does it contain data", "just link to a Chart Studio Cloud file?" ].join(" ") }, showSources: { valType: "any", dflt: !1, description: [ "Adds a source-displaying function to show sources on", "the resulting graphs." ].join(" ") }, displayModeBar: { valType: "enumerated", values: ["hover", !0, !1], dflt: "hover", description: [ "Determines the mode bar display mode.", "If *true*, the mode bar is always visible.", "If *false*, the mode bar is always hidden.", "If *hover*, the mode bar is visible while the mouse cursor", "is on the graph container." ].join(" ") }, showSendToCloud: { valType: "boolean", dflt: !1, description: [ 'Should we include a ModeBar button, labeled "Edit in Chart Studio",', "that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server", "as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0", "this button was included by default, now it is opt-in using this flag.", "Note that this button can (depending on `plotlyServerURL` being set) send your data", "to an external server. However that server does not persist your data", 'until you arrive at the Chart Studio and explicitly click "Save".' ].join(" ") }, showEditInChartStudio: { valType: "boolean", dflt: !1, description: [ "Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.", "Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,", "only `showEditInChartStudio` will be honored." ].join(" ") }, modeBarButtonsToRemove: { valType: "any", dflt: [], description: [ "Remove mode bar buttons by name.", "See ./components/modebar/buttons.js for the list of names." ].join(" ") }, modeBarButtonsToAdd: { valType: "any", dflt: [], description: [ "Add mode bar button using config objects", "See ./components/modebar/buttons.js for list of arguments.", "To enable predefined modebar buttons e.g. shape drawing, hover and spikelines,", "simply provide their string name(s). This could include:", "*v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*,", "*drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*.", "Please note that these predefined buttons will only be shown if they are compatible", "with all trace types used in a graph." ].join(" ") }, modeBarButtons: { valType: "any", dflt: !1, description: [ "Define fully custom mode bar buttons as nested array,", "where the outer arrays represents button groups, and", "the inner arrays have buttons config objects or names of default buttons", "See ./components/modebar/buttons.js for more info." ].join(" ") }, toImageButtonOptions: { valType: "any", dflt: {}, description: [ "Statically override options for toImage modebar button", "allowed keys are format, filename, width, height, scale", "see ../components/modebar/buttons.js" ].join(" ") }, displaylogo: { valType: "boolean", dflt: !0, description: [ "Determines whether or not the plotly logo is displayed", "on the end of the mode bar." ].join(" ") }, watermark: { valType: "boolean", dflt: !1, description: "watermark the images with the company's logo" }, plotGlPixelRatio: { valType: "number", dflt: 2, min: 1, max: 4, description: [ "Set the pixel ratio during WebGL image export.", "This config option was formerly named `plot3dPixelRatio`", "which is now deprecated." ].join(" ") }, setBackground: { valType: "any", dflt: "transparent", description: [ "Set function to add the background color (i.e. `layout.paper_color`)", "to a different container.", "This function take the graph div as first argument and the current background", "color as second argument.", "Alternatively, set to string *opaque* to ensure there is white behind it." ].join(" ") }, topojsonURL: { valType: "string", noBlank: !0, dflt: "https://cdn.plot.ly/", description: [ "Set the URL to topojson used in geo charts.", "By default, the topojson files are fetched from cdn.plot.ly.", "For example, set this option to:", "/dist/topojson/", "to render geographical feature using the topojson files", "that ship with the plotly.js module." ].join(" ") }, mapboxAccessToken: { valType: "string", dflt: null, description: [ "Mapbox access token (required to plot mapbox trace types)", "If using an Mapbox Atlas server, set this option to ''", "so that plotly.js won't attempt to authenticate to the public Mapbox server." ].join(" ") }, logging: { valType: "integer", min: 0, max: 2, dflt: 1, description: [ "Turn all console logging on or off (errors will be thrown)", "This should ONLY be set via Plotly.setPlotConfig", "Available levels:", "0: no logs", "1: warnings and errors, but not informational messages", "2: verbose logs" ].join(" ") }, notifyOnLogging: { valType: "integer", min: 0, max: 2, dflt: 0, description: [ "Set on-graph logging (notifier) level", "This should ONLY be set via Plotly.setPlotConfig", "Available levels:", "0: no on-graph logs", "1: warnings and errors, but not informational messages", "2: verbose logs" ].join(" ") }, queueLength: { valType: "integer", min: 0, dflt: 0, description: "Sets the length of the undo/redo queue." }, globalTransforms: { valType: "any", dflt: [], description: [ "Set global transform to be applied to all traces with no", "specification needed" ].join(" ") }, locale: { valType: "string", dflt: "en-US", description: [ "Which localization should we use?", "Should be a string like 'en' or 'en-US'." ].join(" ") }, locales: { valType: "any", dflt: {}, description: [ "Localization definitions", "Locales can be provided either here (specific to one chart) or globally", "by registering them as modules.", "Should be an object of objects {locale: {dictionary: {...}, format: {...}}}", "{", " da: {", " dictionary: {'Reset axes': 'Nulstil aksler', ...},", " format: {months: [...], shortMonths: [...]}", " },", " ...", "}", "All parts are optional. When looking for translation or format fields, we", "look first for an exact match in a config locale, then in a registered", "module. If those fail, we strip off any regionalization ('en-US' -> 'en')", "and try each (config, registry) again. The final fallback for translation", "is untranslated (which is US English) and for formats is the base English", "(the only consequence being the last fallback date format %x is DD/MM/YYYY", "instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored", "for our automatic number formatting, but can be used in custom formats." ].join(" ") } }, eC = {}; function tC(e, t) { for (var n in e) { var r = e[n]; r.valType ? t[n] = r.dflt : (t[n] || (t[n] = {}), tC(r, t[n])); } } tC(X4, eC); var Yc = { configAttributes: X4, dfltConfig: eC }, Gg = sn, Hq = cn, bu = [], nC = function(e, t) { if (bu.indexOf(e) !== -1) return; bu.push(e); var n = 1e3; Hq(t) ? n = t : t === "long" && (n = 3e3); var r = Gg.select("body").selectAll(".plotly-notifier").data([0]); r.enter().append("div").classed("plotly-notifier", !0); var a = r.selectAll(".notifier-note").data(bu); function i(o) { o.duration(700).style("opacity", 0).each("end", function(l) { var s = bu.indexOf(l); s !== -1 && bu.splice(s, 1), Gg.select(this).remove(); }); } a.enter().append("div").classed("notifier-note", !0).style("opacity", 0).each(function(o) { var l = Gg.select(this); l.append("button").classed("notifier-close", !0).html("×").on("click", function() { l.transition().call(i); }); for (var s = l.append("p"), c = o.split(//g), u = 0; u < c.length; u++) u && s.append("br"), s.append("span").text(c[u]); t === "stick" ? l.transition().duration(350).style("opacity", 1) : l.transition().duration(700).style("opacity", 1).transition().delay(n).call(i); }); }, Oc = Yc.dfltConfig, q1 = nC, U1 = Q4.exports = {}; U1.log = function() { var e; if (Oc.logging > 1) { var t = ["LOG:"]; for (e = 0; e < arguments.length; e++) t.push(arguments[e]); console.trace.apply(console, t); } if (Oc.notifyOnLogging > 1) { var n = []; for (e = 0; e < arguments.length; e++) n.push(arguments[e]); q1(n.join("
"), "long"); } }; U1.warn = function() { var e; if (Oc.logging > 0) { var t = ["WARN:"]; for (e = 0; e < arguments.length; e++) t.push(arguments[e]); console.trace.apply(console, t); } if (Oc.notifyOnLogging > 0) { var n = []; for (e = 0; e < arguments.length; e++) n.push(arguments[e]); q1(n.join("
"), "stick"); } }; U1.error = function() { var e; if (Oc.logging > 0) { var t = ["ERROR:"]; for (e = 0; e < arguments.length; e++) t.push(arguments[e]); console.error.apply(console, t); } if (Oc.notifyOnLogging > 0) { var n = []; for (e = 0; e < arguments.length; e++) n.push(arguments[e]); q1(n.join("
"), "stick"); } }; var $c = Q4.exports, Rt = {}, G1 = function() { }, rC = function(e, t) { if (t instanceof RegExp) { for (var n = t.toString(), r = 0; r < e.length; r++) if (e[r] instanceof RegExp && e[r].toString() === n) return e; e.push(t); } else (t || t === 0) && e.indexOf(t) === -1 && e.push(t); return e; }, d0 = {}, Vq = qq; function qq() { var e = new Float32Array(16); return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var Uq = Gq; function Gq(e) { var t = new Float32Array(16); return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15], t; } var Wq = Zq; function Zq(e, t) { return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; } var aC = Yq; function Yq(e) { return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var $q = Kq; function Kq(e, t) { if (e === t) { var n = t[1], r = t[2], a = t[3], i = t[6], o = t[7], l = t[11]; e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = n, e[6] = t[9], e[7] = t[13], e[8] = r, e[9] = i, e[11] = t[14], e[12] = a, e[13] = o, e[14] = l; } else e[0] = t[0], e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = t[1], e[5] = t[5], e[6] = t[9], e[7] = t[13], e[8] = t[2], e[9] = t[6], e[10] = t[10], e[11] = t[14], e[12] = t[3], e[13] = t[7], e[14] = t[11], e[15] = t[15]; return e; } var Jq = Qq; function Qq(e, t) { var n = t[0], r = t[1], a = t[2], i = t[3], o = t[4], l = t[5], s = t[6], c = t[7], u = t[8], f = t[9], h = t[10], g = t[11], p = t[12], v = t[13], y = t[14], m = t[15], b = n * l - r * o, w = n * s - a * o, _ = n * c - i * o, k = r * s - a * l, T = r * c - i * l, O = a * c - i * s, M = u * v - f * p, C = u * y - h * p, I = u * m - g * p, j = f * y - h * v, P = f * m - g * v, N = h * m - g * y, W = b * N - w * P + _ * j + k * I - T * C + O * M; return W ? (W = 1 / W, e[0] = (l * N - s * P + c * j) * W, e[1] = (a * P - r * N - i * j) * W, e[2] = (v * O - y * T + m * k) * W, e[3] = (h * T - f * O - g * k) * W, e[4] = (s * I - o * N - c * C) * W, e[5] = (n * N - a * I + i * C) * W, e[6] = (y * _ - p * O - m * w) * W, e[7] = (u * O - h * _ + g * w) * W, e[8] = (o * P - l * I + c * M) * W, e[9] = (r * I - n * P - i * M) * W, e[10] = (p * T - v * _ + m * b) * W, e[11] = (f * _ - u * T - g * b) * W, e[12] = (l * C - o * j - s * M) * W, e[13] = (n * j - r * C + a * M) * W, e[14] = (v * w - p * k - y * b) * W, e[15] = (u * k - f * w + h * b) * W, e) : null; } var Xq = eU; function eU(e, t) { var n = t[0], r = t[1], a = t[2], i = t[3], o = t[4], l = t[5], s = t[6], c = t[7], u = t[8], f = t[9], h = t[10], g = t[11], p = t[12], v = t[13], y = t[14], m = t[15]; return e[0] = l * (h * m - g * y) - f * (s * m - c * y) + v * (s * g - c * h), e[1] = -(r * (h * m - g * y) - f * (a * m - i * y) + v * (a * g - i * h)), e[2] = r * (s * m - c * y) - l * (a * m - i * y) + v * (a * c - i * s), e[3] = -(r * (s * g - c * h) - l * (a * g - i * h) + f * (a * c - i * s)), e[4] = -(o * (h * m - g * y) - u * (s * m - c * y) + p * (s * g - c * h)), e[5] = n * (h * m - g * y) - u * (a * m - i * y) + p * (a * g - i * h), e[6] = -(n * (s * m - c * y) - o * (a * m - i * y) + p * (a * c - i * s)), e[7] = n * (s * g - c * h) - o * (a * g - i * h) + u * (a * c - i * s), e[8] = o * (f * m - g * v) - u * (l * m - c * v) + p * (l * g - c * f), e[9] = -(n * (f * m - g * v) - u * (r * m - i * v) + p * (r * g - i * f)), e[10] = n * (l * m - c * v) - o * (r * m - i * v) + p * (r * c - i * l), e[11] = -(n * (l * g - c * f) - o * (r * g - i * f) + u * (r * c - i * l)), e[12] = -(o * (f * y - h * v) - u * (l * y - s * v) + p * (l * h - s * f)), e[13] = n * (f * y - h * v) - u * (r * y - a * v) + p * (r * h - a * f), e[14] = -(n * (l * y - s * v) - o * (r * y - a * v) + p * (r * s - a * l)), e[15] = n * (l * h - s * f) - o * (r * h - a * f) + u * (r * s - a * l), e; } var tU = nU; function nU(e) { var t = e[0], n = e[1], r = e[2], a = e[3], i = e[4], o = e[5], l = e[6], s = e[7], c = e[8], u = e[9], f = e[10], h = e[11], g = e[12], p = e[13], v = e[14], y = e[15], m = t * o - n * i, b = t * l - r * i, w = t * s - a * i, _ = n * l - r * o, k = n * s - a * o, T = r * s - a * l, O = c * p - u * g, M = c * v - f * g, C = c * y - h * g, I = u * v - f * p, j = u * y - h * p, P = f * y - h * v; return m * P - b * j + w * I + _ * C - k * M + T * O; } var rU = aU; function aU(e, t, n) { var r = t[0], a = t[1], i = t[2], o = t[3], l = t[4], s = t[5], c = t[6], u = t[7], f = t[8], h = t[9], g = t[10], p = t[11], v = t[12], y = t[13], m = t[14], b = t[15], w = n[0], _ = n[1], k = n[2], T = n[3]; return e[0] = w * r + _ * l + k * f + T * v, e[1] = w * a + _ * s + k * h + T * y, e[2] = w * i + _ * c + k * g + T * m, e[3] = w * o + _ * u + k * p + T * b, w = n[4], _ = n[5], k = n[6], T = n[7], e[4] = w * r + _ * l + k * f + T * v, e[5] = w * a + _ * s + k * h + T * y, e[6] = w * i + _ * c + k * g + T * m, e[7] = w * o + _ * u + k * p + T * b, w = n[8], _ = n[9], k = n[10], T = n[11], e[8] = w * r + _ * l + k * f + T * v, e[9] = w * a + _ * s + k * h + T * y, e[10] = w * i + _ * c + k * g + T * m, e[11] = w * o + _ * u + k * p + T * b, w = n[12], _ = n[13], k = n[14], T = n[15], e[12] = w * r + _ * l + k * f + T * v, e[13] = w * a + _ * s + k * h + T * y, e[14] = w * i + _ * c + k * g + T * m, e[15] = w * o + _ * u + k * p + T * b, e; } var iU = oU; function oU(e, t, n) { var r = n[0], a = n[1], i = n[2], o, l, s, c, u, f, h, g, p, v, y, m; return t === e ? (e[12] = t[0] * r + t[4] * a + t[8] * i + t[12], e[13] = t[1] * r + t[5] * a + t[9] * i + t[13], e[14] = t[2] * r + t[6] * a + t[10] * i + t[14], e[15] = t[3] * r + t[7] * a + t[11] * i + t[15]) : (o = t[0], l = t[1], s = t[2], c = t[3], u = t[4], f = t[5], h = t[6], g = t[7], p = t[8], v = t[9], y = t[10], m = t[11], e[0] = o, e[1] = l, e[2] = s, e[3] = c, e[4] = u, e[5] = f, e[6] = h, e[7] = g, e[8] = p, e[9] = v, e[10] = y, e[11] = m, e[12] = o * r + u * a + p * i + t[12], e[13] = l * r + f * a + v * i + t[13], e[14] = s * r + h * a + y * i + t[14], e[15] = c * r + g * a + m * i + t[15]), e; } var lU = sU; function sU(e, t, n) { var r = n[0], a = n[1], i = n[2]; return e[0] = t[0] * r, e[1] = t[1] * r, e[2] = t[2] * r, e[3] = t[3] * r, e[4] = t[4] * a, e[5] = t[5] * a, e[6] = t[6] * a, e[7] = t[7] * a, e[8] = t[8] * i, e[9] = t[9] * i, e[10] = t[10] * i, e[11] = t[11] * i, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e; } var cU = uU; function uU(e, t, n, r) { var a = r[0], i = r[1], o = r[2], l = Math.sqrt(a * a + i * i + o * o), s, c, u, f, h, g, p, v, y, m, b, w, _, k, T, O, M, C, I, j, P, N, W, J; return Math.abs(l) < 1e-6 ? null : (l = 1 / l, a *= l, i *= l, o *= l, s = Math.sin(n), c = Math.cos(n), u = 1 - c, f = t[0], h = t[1], g = t[2], p = t[3], v = t[4], y = t[5], m = t[6], b = t[7], w = t[8], _ = t[9], k = t[10], T = t[11], O = a * a * u + c, M = i * a * u + o * s, C = o * a * u - i * s, I = a * i * u - o * s, j = i * i * u + c, P = o * i * u + a * s, N = a * o * u + i * s, W = i * o * u - a * s, J = o * o * u + c, e[0] = f * O + v * M + w * C, e[1] = h * O + y * M + _ * C, e[2] = g * O + m * M + k * C, e[3] = p * O + b * M + T * C, e[4] = f * I + v * j + w * P, e[5] = h * I + y * j + _ * P, e[6] = g * I + m * j + k * P, e[7] = p * I + b * j + T * P, e[8] = f * N + v * W + w * J, e[9] = h * N + y * W + _ * J, e[10] = g * N + m * W + k * J, e[11] = p * N + b * W + T * J, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e); } var dU = fU; function fU(e, t, n) { var r = Math.sin(n), a = Math.cos(n), i = t[4], o = t[5], l = t[6], s = t[7], c = t[8], u = t[9], f = t[10], h = t[11]; return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = i * a + c * r, e[5] = o * a + u * r, e[6] = l * a + f * r, e[7] = s * a + h * r, e[8] = c * a - i * r, e[9] = u * a - o * r, e[10] = f * a - l * r, e[11] = h * a - s * r, e; } var hU = pU; function pU(e, t, n) { var r = Math.sin(n), a = Math.cos(n), i = t[0], o = t[1], l = t[2], s = t[3], c = t[8], u = t[9], f = t[10], h = t[11]; return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * a - c * r, e[1] = o * a - u * r, e[2] = l * a - f * r, e[3] = s * a - h * r, e[8] = i * r + c * a, e[9] = o * r + u * a, e[10] = l * r + f * a, e[11] = s * r + h * a, e; } var gU = vU; function vU(e, t, n) { var r = Math.sin(n), a = Math.cos(n), i = t[0], o = t[1], l = t[2], s = t[3], c = t[4], u = t[5], f = t[6], h = t[7]; return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = i * a + c * r, e[1] = o * a + u * r, e[2] = l * a + f * r, e[3] = s * a + h * r, e[4] = c * a - i * r, e[5] = u * a - o * r, e[6] = f * a - l * r, e[7] = h * a - s * r, e; } var mU = yU; function yU(e, t, n) { var r, a, i, o = n[0], l = n[1], s = n[2], c = Math.sqrt(o * o + l * l + s * s); return Math.abs(c) < 1e-6 ? null : (c = 1 / c, o *= c, l *= c, s *= c, r = Math.sin(t), a = Math.cos(t), i = 1 - a, e[0] = o * o * i + a, e[1] = l * o * i + s * r, e[2] = s * o * i - l * r, e[3] = 0, e[4] = o * l * i - s * r, e[5] = l * l * i + a, e[6] = s * l * i + o * r, e[7] = 0, e[8] = o * s * i + l * r, e[9] = l * s * i - o * r, e[10] = s * s * i + a, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e); } var xU = bU; function bU(e, t, n) { var r = t[0], a = t[1], i = t[2], o = t[3], l = r + r, s = a + a, c = i + i, u = r * l, f = r * s, h = r * c, g = a * s, p = a * c, v = i * c, y = o * l, m = o * s, b = o * c; return e[0] = 1 - (g + v), e[1] = f + b, e[2] = h - m, e[3] = 0, e[4] = f - b, e[5] = 1 - (u + v), e[6] = p + y, e[7] = 0, e[8] = h + m, e[9] = p - y, e[10] = 1 - (u + g), e[11] = 0, e[12] = n[0], e[13] = n[1], e[14] = n[2], e[15] = 1, e; } var wU = _U; function _U(e, t) { return e[0] = t[0], e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = t[1], e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = t[2], e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var kU = TU; function TU(e, t) { return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = t[0], e[13] = t[1], e[14] = t[2], e[15] = 1, e; } var AU = MU; function MU(e, t) { var n = Math.sin(t), r = Math.cos(t); return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = r, e[6] = n, e[7] = 0, e[8] = 0, e[9] = -n, e[10] = r, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var SU = CU; function CU(e, t) { var n = Math.sin(t), r = Math.cos(t); return e[0] = r, e[1] = 0, e[2] = -n, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = n, e[9] = 0, e[10] = r, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var LU = OU; function OU(e, t) { var n = Math.sin(t), r = Math.cos(t); return e[0] = r, e[1] = n, e[2] = 0, e[3] = 0, e[4] = -n, e[5] = r, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var iC = DU; function DU(e, t) { var n = t[0], r = t[1], a = t[2], i = t[3], o = n + n, l = r + r, s = a + a, c = n * o, u = r * o, f = r * l, h = a * o, g = a * l, p = a * s, v = i * o, y = i * l, m = i * s; return e[0] = 1 - f - p, e[1] = u + m, e[2] = h - y, e[3] = 0, e[4] = u - m, e[5] = 1 - c - p, e[6] = g + v, e[7] = 0, e[8] = h + y, e[9] = g - v, e[10] = 1 - c - f, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e; } var FU = IU; function IU(e, t, n, r, a, i, o) { var l = 1 / (n - t), s = 1 / (a - r), c = 1 / (i - o); return e[0] = i * 2 * l, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i * 2 * s, e[6] = 0, e[7] = 0, e[8] = (n + t) * l, e[9] = (a + r) * s, e[10] = (o + i) * c, e[11] = -1, e[12] = 0, e[13] = 0, e[14] = o * i * 2 * c, e[15] = 0, e; } var zU = EU; function EU(e, t, n, r, a) { var i = 1 / Math.tan(t / 2), o = 1 / (r - a); return e[0] = i / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = i, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = (a + r) * o, e[11] = -1, e[12] = 0, e[13] = 0, e[14] = 2 * a * r * o, e[15] = 0, e; } var jU = PU; function PU(e, t, n, r) { var a = Math.tan(t.upDegrees * Math.PI / 180), i = Math.tan(t.downDegrees * Math.PI / 180), o = Math.tan(t.leftDegrees * Math.PI / 180), l = Math.tan(t.rightDegrees * Math.PI / 180), s = 2 / (o + l), c = 2 / (a + i); return e[0] = s, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = c, e[6] = 0, e[7] = 0, e[8] = -((o - l) * s * 0.5), e[9] = (a - i) * c * 0.5, e[10] = r / (n - r), e[11] = -1, e[12] = 0, e[13] = 0, e[14] = r * n / (n - r), e[15] = 0, e; } var RU = NU; function NU(e, t, n, r, a, i, o) { var l = 1 / (t - n), s = 1 / (r - a), c = 1 / (i - o); return e[0] = -2 * l, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * s, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * c, e[11] = 0, e[12] = (t + n) * l, e[13] = (a + r) * s, e[14] = (o + i) * c, e[15] = 1, e; } var BU = aC, HU = VU; function VU(e, t, n, r) { var a, i, o, l, s, c, u, f, h, g, p = t[0], v = t[1], y = t[2], m = r[0], b = r[1], w = r[2], _ = n[0], k = n[1], T = n[2]; return Math.abs(p - _) < 1e-6 && Math.abs(v - k) < 1e-6 && Math.abs(y - T) < 1e-6 ? BU(e) : (u = p - _, f = v - k, h = y - T, g = 1 / Math.sqrt(u * u + f * f + h * h), u *= g, f *= g, h *= g, a = b * h - w * f, i = w * u - m * h, o = m * f - b * u, g = Math.sqrt(a * a + i * i + o * o), g ? (g = 1 / g, a *= g, i *= g, o *= g) : (a = 0, i = 0, o = 0), l = f * o - h * i, s = h * a - u * o, c = u * i - f * a, g = Math.sqrt(l * l + s * s + c * c), g ? (g = 1 / g, l *= g, s *= g, c *= g) : (l = 0, s = 0, c = 0), e[0] = a, e[1] = l, e[2] = u, e[3] = 0, e[4] = i, e[5] = s, e[6] = f, e[7] = 0, e[8] = o, e[9] = c, e[10] = h, e[11] = 0, e[12] = -(a * p + i * v + o * y), e[13] = -(l * p + s * v + c * y), e[14] = -(u * p + f * v + h * y), e[15] = 1, e); } var qU = UU; function UU(e) { return "mat4(" + e[0] + ", " + e[1] + ", " + e[2] + ", " + e[3] + ", " + e[4] + ", " + e[5] + ", " + e[6] + ", " + e[7] + ", " + e[8] + ", " + e[9] + ", " + e[10] + ", " + e[11] + ", " + e[12] + ", " + e[13] + ", " + e[14] + ", " + e[15] + ")"; } var oC = { create: Vq, clone: Uq, copy: Wq, identity: aC, transpose: $q, invert: Jq, adjoint: Xq, determinant: tU, multiply: rU, translate: iU, scale: lU, rotate: cU, rotateX: dU, rotateY: hU, rotateZ: gU, fromRotation: mU, fromRotationTranslation: xU, fromScaling: wU, fromTranslation: kU, fromXRotation: AU, fromYRotation: SU, fromZRotation: LU, fromQuat: iC, frustum: FU, perspective: zU, perspectiveFromFieldOfView: jU, ortho: RU, lookAt: HU, str: qU }; (function(e) { var t = oC; e.init2dArray = function(n, r) { for (var a = new Array(n), i = 0; i < n; i++) a[i] = new Array(r); return a; }, e.transposeRagged = function(n) { var r = 0, a = n.length, i, o; for (i = 0; i < a; i++) r = Math.max(r, n[i].length); var l = new Array(r); for (i = 0; i < r; i++) for (l[i] = new Array(a), o = 0; o < a; o++) l[i][o] = n[o][i]; return l; }, e.dot = function(n, r) { if (!(n.length && r.length) || n.length !== r.length) return null; var a = n.length, i, o; if (n[0].length) for (i = new Array(a), o = 0; o < a; o++) i[o] = e.dot(n[o], r); else if (r[0].length) { var l = e.transposeRagged(r); for (i = new Array(l.length), o = 0; o < l.length; o++) i[o] = e.dot(n, l[o]); } else for (i = 0, o = 0; o < a; o++) i += n[o] * r[o]; return i; }, e.translationMatrix = function(n, r) { return [[1, 0, n], [0, 1, r], [0, 0, 1]]; }, e.rotationMatrix = function(n) { var r = n * Math.PI / 180; return [ [Math.cos(r), -Math.sin(r), 0], [Math.sin(r), Math.cos(r), 0], [0, 0, 1] ]; }, e.rotationXYMatrix = function(n, r, a) { return e.dot( e.dot( e.translationMatrix(r, a), e.rotationMatrix(n) ), e.translationMatrix(-r, -a) ); }, e.apply3DTransform = function(n) { return function() { var r = arguments, a = arguments.length === 1 ? r[0] : [r[0], r[1], r[2] || 0]; return e.dot(n, [a[0], a[1], a[2], 1]).slice(0, 3); }; }, e.apply2DTransform = function(n) { return function() { var r = arguments; r.length === 3 && (r = r[0]); var a = arguments.length === 1 ? r[0] : [r[0], r[1]]; return e.dot(n, [a[0], a[1], 1]).slice(0, 2); }; }, e.apply2DTransform2 = function(n) { var r = e.apply2DTransform(n); return function(a) { return r(a.slice(0, 2)).concat(r(a.slice(2, 4))); }; }, e.convertCssMatrix = function(n) { if (n) { var r = n.length; if (r === 16) return n; if (r === 6) return [ n[0], n[1], 0, 0, n[2], n[3], 0, 0, 0, 0, 1, 0, n[4], n[5], 0, 1 ]; } return [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; }, e.inverseTransformMatrix = function(n) { var r = []; return t.invert(r, n), [ [r[0], r[1], r[2], r[3]], [r[4], r[5], r[6], r[7]], [r[8], r[9], r[10], r[11]], [r[12], r[13], r[14], r[15]] ]; }; })(d0); var GU = sn, WU = $c, ZU = d0, YU = oC; function $U(e) { var t; if (typeof e == "string") { if (t = document.getElementById(e), t === null) throw new Error("No DOM element with id '" + e + "' exists on the page."); return t; } else if (e == null) throw new Error("DOM element provided is null or undefined"); return e; } function KU(e) { var t = GU.select(e); return t.node() instanceof HTMLElement && t.size() && t.classed("js-plotly-plot"); } function lC(e) { var t = e && e.parentNode; t && t.removeChild(e); } function JU(e, t) { sC("global", e, t); } function sC(e, t, n) { var r = "plotly.js-style-" + e, a = document.getElementById(r); a || (a = document.createElement("style"), a.setAttribute("id", r), a.appendChild(document.createTextNode("")), document.head.appendChild(a)); var i = a.sheet; i.insertRule ? i.insertRule(t + "{" + n + "}", 0) : i.addRule ? i.addRule(t, n, 0) : WU.warn("addStyleRule failed"); } function QU(e) { var t = "plotly.js-style-" + e, n = document.getElementById(t); n && lC(n); } function XU(e) { var t = uC(e), n = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; return t.forEach(function(r) { var a = cC(r); if (a) { var i = ZU.convertCssMatrix(a); n = YU.multiply(n, n, i); } }), n; } function cC(e) { var t = window.getComputedStyle(e, null), n = t.getPropertyValue("-webkit-transform") || t.getPropertyValue("-moz-transform") || t.getPropertyValue("-ms-transform") || t.getPropertyValue("-o-transform") || t.getPropertyValue("transform"); return n === "none" ? null : n.replace("matrix", "").replace("3d", "").slice(1, -1).split(",").map(function(r) { return +r; }); } function uC(e) { for (var t = []; eG(e); ) t.push(e), e = e.parentNode; return t; } function eG(e) { return e && (e instanceof Element || e instanceof HTMLElement); } function tG(e, t) { return e && t && e.top === t.top && e.left === t.left && e.right === t.right && e.bottom === t.bottom; } var f0 = { getGraphDiv: $U, isPlotDiv: KU, removeElement: lC, addStyleRule: JU, addRelatedStyleRule: sC, deleteRelatedStyleRule: QU, getFullTransformMatrix: XU, getElementTransformMatrix: cC, getElementAndAncestors: uC, equalDomRects: tG }, h0 = { mode: { valType: "enumerated", dflt: "afterall", values: ["immediate", "next", "afterall"], description: [ "Describes how a new animate call interacts with currently-running", "animations. If `immediate`, current animations are interrupted and", "the new animation is started. If `next`, the current frame is allowed", "to complete, after which the new animation is started. If `afterall`", "all existing frames are animated to completion before the new animation", "is started." ].join(" ") }, direction: { valType: "enumerated", values: ["forward", "reverse"], dflt: "forward", description: [ "The direction in which to play the frames triggered by the animation call" ].join(" ") }, fromcurrent: { valType: "boolean", dflt: !1, description: [ "Play frames starting at the current frame instead of the beginning." ].join(" ") }, frame: { duration: { valType: "number", min: 0, dflt: 500, description: [ "The duration in milliseconds of each frame. If greater than the frame", "duration, it will be limited to the frame duration." ].join(" ") }, redraw: { valType: "boolean", dflt: !0, description: [ "Redraw the plot at completion of the transition. This is desirable", "for transitions that include properties that cannot be transitioned,", "but may significantly slow down updates that do not require a full", "redraw of the plot" ].join(" ") } }, transition: { duration: { valType: "number", min: 0, dflt: 500, editType: "none", description: [ "The duration of the transition, in milliseconds. If equal to zero,", "updates are synchronous." ].join(" ") }, easing: { valType: "enumerated", dflt: "cubic-in-out", values: [ "linear", "quad", "cubic", "sin", "exp", "circle", "elastic", "back", "bounce", "linear-in", "quad-in", "cubic-in", "sin-in", "exp-in", "circle-in", "elastic-in", "back-in", "bounce-in", "linear-out", "quad-out", "cubic-out", "sin-out", "exp-out", "circle-out", "elastic-out", "back-out", "bounce-out", "linear-in-out", "quad-in-out", "cubic-in-out", "sin-in-out", "exp-in-out", "circle-in-out", "elastic-in-out", "back-in-out", "bounce-in-out" ], editType: "none", description: "The easing function used for the transition" }, ordering: { valType: "enumerated", values: ["layout first", "traces first"], dflt: "layout first", editType: "none", description: [ "Determines whether the figure's layout or traces smoothly transitions", "during updates that make both traces and layout change." ].join(" ") } } }, dC = tr.extendFlat, nG = gs, fC = { valType: "flaglist", extras: ["none"], flags: ["calc", "clearAxisTypes", "plot", "style", "markerSize", "colorbars"], description: [ "trace attributes should include an `editType` string matching this flaglist.", "*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`", "to force it to be regenerated", "*clearAxisTypes* resets the types of the axes this trace is on, because new data could", "cause the automatic axis type detection to change. Log type will not be cleared, as that", "is never automatically chosen so must have been user-specified.", "*plot* (re)plots but without first clearing `gd.calcdata`.", "*style* only calls `module.style` (or module.editStyle) for all trace modules and redraws the legend.", "*markerSize* is like *style*, but propagate axis-range changes due to scatter `marker.size`", "*colorbars* only redraws colorbars." ].join(" ") }, hC = { valType: "flaglist", extras: ["none"], flags: [ "calc", "plot", "legend", "ticks", "axrange", "layoutstyle", "modebar", "camera", "arraydraw", "colorbars" ], description: [ "layout attributes should include an `editType` string matching this flaglist.", "*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`", "to force it to be regenerated", "*plot* (re)plots but without first clearing `gd.calcdata`.", "*legend* only redraws the legend.", "*ticks* only redraws axis ticks, labels, and gridlines.", "*axrange* minimal sequence when updating axis ranges.", "*layoutstyle* reapplies global and SVG cartesian axis styles.", "*modebar* just updates the modebar.", "*camera* just updates the camera settings for gl3d scenes.", "*arraydraw* allows component arrays to invoke the redraw routines just for the", "component(s) that changed.", "*colorbars* only redraws colorbars." ].join(" ") }, rG = fC.flags.slice().concat(["fullReplot"]), aG = hC.flags.slice().concat("layoutReplot"), Lo = { traces: fC, layout: hC, /* * default (all false) edit flags for restyle (traces) * creates a new object each call, so the caller can mutate freely */ traceFlags: function() { return y_(rG); }, /* * default (all false) edit flags for relayout * creates a new object each call, so the caller can mutate freely */ layoutFlags: function() { return y_(aG); }, /* * update `flags` with the `editType` values found in `attr` */ update: function(e, t) { var n = t.editType; if (n && n !== "none") for (var r = n.split("+"), a = 0; a < r.length; a++) e[r[a]] = !0; }, overrideAll: pC }; function y_(e) { for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = !1; return t; } function pC(e, t, n) { var r = dC({}, e); for (var a in r) { var i = r[a]; nG(i) && (r[a] = gC(i, t, n, a)); } return n === "from-root" && (r.editType = t), r; } function gC(e, t, n, r) { if (e.valType) { var a = dC({}, e); if (a.editType = t, Array.isArray(e.items)) { a.items = new Array(e.items.length); for (var i = 0; i < e.items.length; i++) a.items[i] = gC(e.items[i], t); } return a; } else return pC( e, t, r.charAt(0) === "_" ? "nested" : "from-root" ); } var Yi = {}; Yi.dash = { valType: "string", // string type usually doesn't take values... this one should really be // a special type or at least a special coercion function, from the GUI // you only get these values but elsewhere the user can supply a list of // dash lengths in px, and it will be honored values: ["solid", "dot", "dash", "longdash", "dashdot", "longdashdot"], dflt: "solid", editType: "style", description: [ "Sets the dash style of lines. Set to a dash type string", "(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)", "or a dash length list in px (eg *5px,10px,2px,2px*)." ].join(" ") }; Yi.pattern = { shape: { valType: "enumerated", values: ["", "/", "\\", "x", "-", "|", "+", "."], dflt: "", arrayOk: !0, editType: "style", description: [ "Sets the shape of the pattern fill.", "By default, no pattern is used for filling the area." ].join(" ") }, fillmode: { valType: "enumerated", values: ["replace", "overlay"], dflt: "replace", editType: "style", description: [ "Determines whether `marker.color` should be used", "as a default to `bgcolor` or a `fgcolor`." ].join(" ") }, bgcolor: { valType: "color", arrayOk: !0, editType: "style", description: [ "When there is no colorscale sets the color of background pattern fill.", "Defaults to a `marker.color` background when `fillmode` is *overlay*.", "Otherwise, defaults to a transparent background." ].join(" ") }, fgcolor: { valType: "color", arrayOk: !0, editType: "style", description: [ "When there is no colorscale sets the color of foreground pattern fill.", "Defaults to a `marker.color` background when `fillmode` is *replace*.", "Otherwise, defaults to dark grey or white", "to increase contrast with the `bgcolor`." ].join(" ") }, fgopacity: { valType: "number", editType: "style", min: 0, max: 1, description: [ "Sets the opacity of the foreground pattern fill.", "Defaults to a 0.5 when `fillmode` is *overlay*.", "Otherwise, defaults to 1." ].join(" ") }, size: { valType: "number", min: 0, dflt: 8, arrayOk: !0, editType: "style", description: [ "Sets the size of unit squares of the pattern fill in pixels,", "which corresponds to the interval of repetition of the pattern." ].join(" ") }, solidity: { valType: "number", min: 0, max: 1, dflt: 0.3, arrayOk: !0, editType: "style", description: [ "Sets the solidity of the pattern fill.", "Solidity is roughly the fraction of the area filled by the pattern.", "Solidity of 0 shows only the background color without pattern", "and solidty of 1 shows only the foreground color without pattern." ].join(" ") }, editType: "style", description: [ "Sets the pattern within the marker." ].join(" ") }; var bi = {}, vC = { FORMAT_LINK: "https://github.com/d3/d3-format/tree/v1.4.5#d3-format", DATE_FORMAT_LINK: "https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format" }, mC = vC, yC = mC.FORMAT_LINK, xC = mC.DATE_FORMAT_LINK; function bC(e) { var t = e && e.supportOther; return [ "Variables are inserted using %{variable},", 'for example "y: %{y}"' + (t ? " as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown." : "."), `Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`, yC, "for details on the formatting syntax.", `Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`, xC, "for details on the date formatting syntax." ].join(" "); } function iG() { return [ "Variables are inserted using %{variable},", 'for example "x0: %{x0}".', `Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{x0:$.2f}". See`, yC, "for details on the formatting syntax.", `Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{x0|%m %b %Y}". See`, xC, "for details on the date formatting syntax.", "A single multiplication or division operation may be applied to numeric variables, and combined with", 'd3 number formatting, for example "Length in cm: %{x0*2.54}", "%{slope*60:.1f} meters per second."', "For log axes, variable values are given in log units.", "For date axes, x/y coordinate variables and center variables use datetimes, while all other variable values use values in ms." ].join(" "); } function W1(e) { var t = e.description ? " " + e.description : "", n = e.keys || []; if (n.length > 0) { for (var r = [], a = 0; a < n.length; a++) r[a] = "`" + n[a] + "`"; t = t + "Finally, the template string has access to ", n.length === 1 ? t = t + "variable " + r[0] : t = t + "variables " + r.slice(0, -1).join(", ") + " and " + r.slice(-1) + "."; } return t; } bi.hovertemplateAttrs = function(e, t) { e = e || {}, t = t || {}; var n = W1(t), r = { valType: "string", dflt: "", editType: e.editType || "none", description: [ "Template string used for rendering the information that appear on hover box.", "Note that this will override `hoverinfo`.", bC({ supportOther: !0 }), "The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.", "Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.", n, 'Anything contained in tag `` is displayed in the secondary box, for example "{fullData.name}".', "To hide the secondary box completely, use an empty tag ``." ].join(" ") }; return e.arrayOk !== !1 && (r.arrayOk = !0), r; }; bi.texttemplateAttrs = function(e, t) { e = e || {}, t = t || {}; var n = W1(t), r = { valType: "string", dflt: "", editType: e.editType || "calc", description: [ "Template string used for rendering the information text that appear on points.", "Note that this will override `textinfo`.", bC(), "Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.", n ].join(" ") }; return e.arrayOk !== !1 && (r.arrayOk = !0), r; }; bi.shapeTexttemplateAttrs = function(e, t) { e = e || {}, t = t || {}; var n = e.newshape ? "new " : "", r = W1(t), a = { valType: "string", dflt: "", editType: e.editType || "arraydraw", description: [ "Template string used for rendering the " + n + "shape's label.", "Note that this will override `text`.", iG(), r ].join(" ") }; return a; }; function ul(e, t) { return t ? t.d2l(e) : e; } function wC(e, t) { return t ? t.l2d(e) : e; } function oG(e) { return e.x0; } function lG(e) { return e.x1; } function sG(e) { return e.y0; } function cG(e) { return e.y1; } function p0(e, t) { return ul(e.x1, t) - ul(e.x0, t); } function g0(e, t, n) { return ul(e.y1, n) - ul(e.y0, n); } function uG(e, t) { return Math.abs(p0(e, t)); } function dG(e, t, n) { return Math.abs(g0(e, t, n)); } function fG(e, t, n) { return e.type !== "line" ? void 0 : Math.sqrt( Math.pow(p0(e, t), 2) + Math.pow(g0(e, t, n), 2) ); } function hG(e, t) { return wC((ul(e.x1, t) + ul(e.x0, t)) / 2, t); } function pG(e, t, n) { return wC((ul(e.y1, n) + ul(e.y0, n)) / 2, n); } function gG(e, t, n) { return e.type !== "line" ? void 0 : g0(e, t, n) / p0(e, t); } var Z1 = { x0: oG, x1: lG, y0: sG, y1: cG, slope: gG, dx: p0, dy: g0, width: uG, height: dG, length: fG, xcenter: hG, ycenter: pG }, vG = Lo.overrideAll, Ol = Zi, x_ = Fr, mG = Yi.dash, jo = tr.extendFlat, yG = bi.shapeTexttemplateAttrs, xG = Z1, bG = vG({ newshape: { visible: jo({}, Ol.visible, { description: [ "Determines whether or not new shape is visible.", "If *legendonly*, the shape is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }), showlegend: { valType: "boolean", dflt: !1, description: [ "Determines whether or not new", "shape is shown in the legend." ].join(" ") }, legend: jo({}, Ol.legend, { description: [ "Sets the reference to a legend to show new shape in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }), legendgroup: jo({}, Ol.legendgroup, { description: [ "Sets the legend group for new shape.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }), legendgrouptitle: { text: jo({}, Ol.legendgrouptitle.text, {}), font: x_({ description: [ "Sets this legend group's title font." ].join(" ") }) }, legendrank: jo({}, Ol.legendrank, { description: [ "Sets the legend rank for new shape.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items." ].join(" ") }), legendwidth: jo({}, Ol.legendwidth, { description: "Sets the width (in px or fraction) of the legend for new shape." }), line: { color: { valType: "color", description: [ "Sets the line color.", "By default uses either dark grey or white", "to increase contrast with background color." ].join(" ") }, width: { valType: "number", min: 0, dflt: 4, description: "Sets the line width (in px)." }, dash: jo({}, mG, { dflt: "solid" }) }, fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", description: [ "Sets the color filling new shapes' interior.", "Please note that if using a fillcolor with alpha greater than half,", "drag inside the active shape starts moving the shape underneath,", "otherwise a new shape could be started over." ].join(" ") }, fillrule: { valType: "enumerated", values: ["evenodd", "nonzero"], dflt: "evenodd", description: [ "Determines the path's interior.", "For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule" ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, description: "Sets the opacity of new shapes." }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", description: "Specifies whether new shapes are drawn below or above traces." }, drawdirection: { valType: "enumerated", values: ["ortho", "horizontal", "vertical", "diagonal"], dflt: "diagonal", description: [ "When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*", "this limits the drag to be horizontal, vertical or diagonal.", "Using *diagonal* there is no limit e.g. in drawing lines in any direction.", "*ortho* limits the draw to be either horizontal or vertical.", "*horizontal* allows horizontal extend.", "*vertical* allows vertical extend." ].join(" ") }, name: jo({}, Ol.name, { description: [ "Sets new shape name.", "The name appears as the legend item." ].join(" ") }), label: { text: { valType: "string", dflt: "", description: [ "Sets the text to display with the new shape.", "It is also used for legend item if `name` is not provided." ].join(" ") }, texttemplate: yG({ newshape: !0 }, { keys: Object.keys(xG) }), font: x_({ description: "Sets the new shape label text font." }), textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end" ], description: [ "Sets the position of the label text relative to the new shape.", "Supported values for rectangles, circles and paths are", "*top left*, *top center*, *top right*, *middle left*,", "*middle center*, *middle right*, *bottom left*, *bottom center*,", "and *bottom right*.", "Supported values for lines are *start*, *middle*, and *end*.", "Default: *middle center* for rectangles, circles, and paths; *middle* for lines." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", description: [ "Sets the angle at which the label text is drawn", "with respect to the horizontal. For lines, angle *auto*", "is the same angle as the line. For all other shapes,", "angle *auto* is horizontal." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", description: [ "Sets the label's horizontal position anchor", "This anchor binds the specified `textposition` to the *left*, *center*", "or *right* of the label text.", "For example, if `textposition` is set to *top right* and", "`xanchor` to *right* then the right-most portion of the", "label text lines up with the right-most edge of the", "new shape." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], description: [ "Sets the label's vertical position anchor", "This anchor binds the specified `textposition` to the *top*, *middle*", "or *bottom* of the label text.", "For example, if `textposition` is set to *top right* and", "`yanchor` to *top* then the top-most portion of the", "label text lines up with the top-most edge of the", "new shape." ].join(" ") }, padding: { valType: "number", dflt: 3, min: 0, description: "Sets padding (in px) between edge of label and edge of new shape." } } }, activeshape: { fillcolor: { valType: "color", dflt: "rgb(255,0,255)", description: "Sets the color filling the active shape' interior." }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.5, description: "Sets the opacity of the active shape." } } }, "none", "from-root"), wG = Yi.dash, _G = tr.extendFlat, kG = { newselection: { mode: { valType: "enumerated", values: ["immediate", "gradual"], dflt: "immediate", editType: "none", description: [ "Describes how a new selection is created.", "If `immediate`, a new selection is created after first mouse up.", "If `gradual`, a new selection is not created after first mouse.", "By adding to and subtracting from the initial selection,", "this option allows declaring extra outlines of the selection." ].join(" ") }, line: { color: { valType: "color", editType: "none", description: [ "Sets the line color.", "By default uses either dark grey or white", "to increase contrast with background color." ].join(" ") }, width: { valType: "number", min: 1, dflt: 1, editType: "none", description: "Sets the line width (in px)." }, dash: _G({}, wG, { dflt: "dot", editType: "none" }), editType: "none" }, // no drawdirection here noting that layout.selectdirection is used instead. editType: "none" }, activeselection: { fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "none", description: "Sets the color filling the active selection' interior." }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.5, editType: "none", description: "Sets the opacity of the active selection." }, editType: "none" } }, Y1 = function(e) { var t = e.editType; return { t: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) along the top of the component." }, r: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) on the right side of the component." }, b: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) along the bottom of the component." }, l: { valType: "number", dflt: 0, editType: t, description: "The amount of padding (in px) on the left side of the component." }, editType: t }; }, ry = Fr, TG = h0, Fh = fa, b_ = bG, w_ = kG, AG = Y1, __ = tr.extendFlat, v0 = ry({ editType: "calc", description: [ "Sets the global font.", "Note that fonts used in traces and other", "layout components inherit from the global font." ].join(" ") }); v0.family.dflt = '"Open Sans", verdana, arial, sans-serif'; v0.size.dflt = 12; v0.color.dflt = Fh.defaultLine; var $d = { font: v0, title: { text: { valType: "string", editType: "layoutstyle", description: [ "Sets the plot's title.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: ry({ editType: "layoutstyle", description: [ "Sets the title font.", "Note that the title's font used to be customized", "by the now deprecated `titlefont` attribute." ].join(" ") }), xref: { valType: "enumerated", dflt: "container", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, yref: { valType: "enumerated", dflt: "container", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, x: { valType: "number", min: 0, max: 1, dflt: 0.5, editType: "layoutstyle", description: [ "Sets the x position with respect to `xref` in normalized", "coordinates from *0* (left) to *1* (right)." ].join(" ") }, y: { valType: "number", min: 0, max: 1, dflt: "auto", editType: "layoutstyle", description: [ "Sets the y position with respect to `yref` in normalized", "coordinates from *0* (bottom) to *1* (top).", "*auto* places the baseline of the title onto the", "vertical center of the top margin." ].join(" ") }, xanchor: { valType: "enumerated", dflt: "auto", values: ["auto", "left", "center", "right"], editType: "layoutstyle", description: [ "Sets the title's horizontal alignment with respect to its x position.", "*left* means that the title starts at x,", "*right* means that the title ends at x", "and *center* means that the title's center is at x.", "*auto* divides `xref` by three and calculates the `xanchor`", "value automatically based on the value of `x`." ].join(" ") }, yanchor: { valType: "enumerated", dflt: "auto", values: ["auto", "top", "middle", "bottom"], editType: "layoutstyle", description: [ "Sets the title's vertical alignment with respect to its y position.", "*top* means that the title's cap line is at y,", "*bottom* means that the title's baseline is at y", "and *middle* means that the title's midline is at y.", "*auto* divides `yref` by three and calculates the `yanchor`", "value automatically based on the value of `y`." ].join(" ") }, pad: __(AG({ editType: "layoutstyle" }), { description: [ "Sets the padding of the title.", "Each padding value only applies when the corresponding", "`xanchor`/`yanchor` value is set accordingly. E.g. for left", "padding to take effect, `xanchor` must be set to *left*.", "The same rule applies if `xanchor`/`yanchor` is determined automatically.", "Padding is muted if the respective anchor value is *middle*/*center*." ].join(" ") }), automargin: { valType: "boolean", dflt: !1, editType: "plot", description: [ "Determines whether the title can automatically push the figure margins.", "If `yref='paper'` then the margin will expand to ensure that the title doesn’t", "overlap with the edges of the container. If `yref='container'` then the margins", "will ensure that the title doesn’t overlap with the plot area, tick labels,", "and axis titles. If `automargin=true` and the margins need to be expanded,", "then y will be set to a default 1 and yanchor will be set to an appropriate", "default to ensure that minimal margin space is needed. Note that when `yref='paper'`,", "only 1 or 0 are allowed y values. Invalid values will be reset to the default 1." ].join(" ") }, editType: "layoutstyle" }, uniformtext: { mode: { valType: "enumerated", values: [!1, "hide", "show"], dflt: !1, editType: "plot", description: [ "Determines how the font size for various text", "elements are uniformed between each trace type.", "If the computed text sizes were smaller than", "the minimum size defined by `uniformtext.minsize`", "using *hide* option hides the text; and", "using *show* option shows the text without further downscaling.", "Please note that if the size defined by `minsize` is greater than", "the font size defined by trace, then the `minsize` is used." ].join(" ") }, minsize: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets the minimum text size between traces of the same type." ].join(" ") }, editType: "plot" }, autosize: { valType: "boolean", dflt: !1, // autosize, width, and height get special editType treatment in _relayout // so we can handle noop resizes more efficiently editType: "none", description: [ "Determines whether or not a layout width or height", "that has been left undefined by the user", "is initialized on each relayout.", "Note that, regardless of this attribute,", "an undefined layout width or height", "is always initialized on the first call to plot." ].join(" ") }, width: { valType: "number", min: 10, dflt: 700, editType: "plot", description: [ "Sets the plot's width (in px)." ].join(" ") }, height: { valType: "number", min: 10, dflt: 450, editType: "plot", description: [ "Sets the plot's height (in px)." ].join(" ") }, minreducedwidth: { valType: "number", min: 2, dflt: 64, editType: "plot", description: "Minimum width of the plot with margin.automargin applied (in px)" }, minreducedheight: { valType: "number", min: 2, dflt: 64, editType: "plot", description: "Minimum height of the plot with margin.automargin applied (in px)" }, margin: { l: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the left margin (in px)." }, r: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the right margin (in px)." }, t: { valType: "number", min: 0, dflt: 100, editType: "plot", description: "Sets the top margin (in px)." }, b: { valType: "number", min: 0, dflt: 80, editType: "plot", description: "Sets the bottom margin (in px)." }, pad: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets the amount of padding (in px)", "between the plotting area and the axis lines" ].join(" ") }, autoexpand: { valType: "boolean", dflt: !0, editType: "plot", description: [ "Turns on/off margin expansion computations.", "Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider", "are allowed to push the margins by defaults." ].join(" ") }, editType: "plot" }, computed: { valType: "any", editType: "none", description: [ "Placeholder for exporting automargin-impacting values namely", "`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode." ].join(" ") }, paper_bgcolor: { valType: "color", dflt: Fh.background, editType: "plot", description: "Sets the background color of the paper where the graph is drawn." }, plot_bgcolor: { // defined here, but set in cartesian.supplyLayoutDefaults // because it needs to know if there are (2D) axes or not valType: "color", dflt: Fh.background, editType: "layoutstyle", description: [ "Sets the background color of the plotting area in-between x and y axes." ].join(" ") }, autotypenumbers: { valType: "enumerated", values: ["convert types", "strict"], dflt: "convert types", editType: "calc", description: [ "Using *strict* a numeric string in trace data is not converted to a number.", "Using *convert types* a numeric string in trace data may be", "treated as a number during automatic axis `type` detection.", "This is the default value; however it could be overridden for individual axes." ].join(" ") }, separators: { valType: "string", editType: "plot", description: [ "Sets the decimal and thousand separators.", "For example, *. * puts a '.' before decimals and a space", "between thousands. In English locales, dflt is *.,* but", "other locales may alter this default." ].join(" ") }, hidesources: { valType: "boolean", dflt: !1, editType: "plot", description: [ "Determines whether or not a text link citing the data source is", "placed at the bottom-right cored of the figure.", "Has only an effect only on graphs that have been generated via", "forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise)." ].join(" ") }, showlegend: { // handled in legend.supplyLayoutDefaults // but included here because it's not in the legend object valType: "boolean", editType: "legend", description: [ "Determines whether or not a legend is drawn.", "Default is `true` if there is a trace to show and any of these:", "a) Two or more traces would by default be shown in the legend.", "b) One pie trace is shown in the legend.", "c) One trace is explicitly given with `showlegend: true`." ].join(" ") }, colorway: { valType: "colorlist", dflt: Fh.defaults, editType: "calc", description: "Sets the default trace colors." }, datarevision: { valType: "any", editType: "calc", description: [ "If provided, a changed value tells `Plotly.react` that", "one or more data arrays has changed. This way you can modify", "arrays in-place rather than making a complete new copy for an", "incremental change.", "If NOT provided, `Plotly.react` assumes that data arrays are", "being treated as immutable, thus any data array with a", "different identity from its predecessor contains new data." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Used to allow user interactions with the plot to persist after", "`Plotly.react` calls that are unaware of these interactions.", "If `uirevision` is omitted, or if it is given and it changed from", "the previous `Plotly.react` call, the exact new figure is used.", "If `uirevision` is truthy and did NOT change, any attribute", "that has been affected by user interactions and did not receive a", "different value in the new figure will keep the interaction value.", "`layout.uirevision` attribute serves as the default for", "`uirevision` attributes in various sub-containers. For finer", "control you can set these sub-attributes directly. For example,", "if your app separately controls the data on the x and y axes you", "might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.", "Then if only the y data is changed, you can update", "`yaxis.uirevision=*quantity*` and the y axis range will reset but", "the x axis range will retain any user-driven zoom." ].join(" ") }, editrevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in `editable: true`", "configuration, other than trace names and axis titles.", "Defaults to `layout.uirevision`." ].join(" ") }, selectionrevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in selected points", "from all traces." ].join(" ") }, template: { valType: "any", editType: "calc", description: [ "Default attributes to be applied to the plot. Templates can be", "created from existing plots using `Plotly.makeTemplate`, or", "created manually. They should be objects with format:", "`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`", "`layoutTemplate` and `traceTemplate` are objects matching the", "attribute structure of `layout` and a data trace. ", "Trace templates are applied cyclically to traces of each type.", "Container arrays (eg `annotations`) have special handling:", "An object ending in `defaults` (eg `annotationdefaults`) is applied", "to each array item. But if an item has a `templateitemname` key", "we look in the template array for an item with matching `name` and", "apply that instead. If no matching `name` is found we mark the item", "invisible. Any named template item not referenced is appended to", "the end of the array, so you can use this for a watermark annotation", "or a logo image, for example. To omit one of these items on the plot,", "make an item with matching `templateitemname` and `visible: false`." ].join(" ") }, newshape: b_.newshape, activeshape: b_.activeshape, newselection: w_.newselection, activeselection: w_.activeselection, meta: { valType: "any", arrayOk: !0, editType: "plot", description: [ "Assigns extra meta information that can be used in various `text` attributes.", "Attributes such as the graph, axis and colorbar `title.text`, annotation `text`", "`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text", "all support `meta`. One can access `meta` fields using template strings:", "`%{meta[i]}` where `i` is the index of the `meta`", "item in question.", "`meta` can also be an object for example `{key: value}` which can be accessed", "%{meta[key]}." ].join(" ") }, transition: __({}, TG.transition, { description: [ "Sets transition options used during Plotly.react updates." ].join(" "), editType: "none" }), _deprecated: { title: { valType: "string", editType: "layoutstyle", description: [ "Value of `title` is no longer a simple *string* but a set of sub-attributes.", "To set the contents of the title, please use `title.text` now." ].join(" ") }, titlefont: ry({ editType: "layoutstyle", description: [ "Former `titlefont` is now the sub-attribute `font` of `title`.", "To customize title font properties, please use `title.font` now." ].join(" ") }) } }; (function(e) { var t = $c, n = G1, r = rC, a = gs, i = f0.addStyleRule, o = tr, l = Zi, s = $d, c = o.extendFlat, u = o.extendDeepAll; e.modules = {}, e.allCategories = {}, e.allTypes = [], e.subplotsRegistry = {}, e.transformsRegistry = {}, e.componentsRegistry = {}, e.layoutArrayContainers = [], e.layoutArrayRegexes = [], e.traceLayoutAttributes = {}, e.localeRegistry = {}, e.apiMethodRegistry = {}, e.collectableSubplotTypes = null, e.register = function(k) { if (e.collectableSubplotTypes = null, k) k && !Array.isArray(k) && (k = [k]); else throw new Error("No argument passed to Plotly.register."); for (var T = 0; T < k.length; T++) { var O = k[T]; if (!O) throw new Error("Invalid module was attempted to be registered!"); switch (O.moduleType) { case "trace": f(O); break; case "transform": p(O); break; case "component": g(O); break; case "locale": v(O); break; case "apiMethod": var M = O.name; e.apiMethodRegistry[M] = O.fn; break; default: throw new Error("Invalid module was attempted to be registered!"); } } }, e.getModule = function(k) { var T = e.modules[_(k)]; return T ? T._module : !1; }, e.traceIs = function(k, T) { if (k = _(k), k === "various") return !1; var O = e.modules[k]; return O || (k && t.log("Unrecognized trace type " + k + "."), O = e.modules[l.type.dflt]), !!O.categories[T]; }, e.getTransformIndices = function(k, T) { for (var O = [], M = k.transforms || [], C = 0; C < M.length; C++) M[C].type === T && O.push(C); return O; }, e.hasTransform = function(k, T) { for (var O = k.transforms || [], M = 0; M < O.length; M++) if (O[M].type === T) return !0; return !1; }, e.getComponentMethod = function(k, T) { var O = e.componentsRegistry[k]; return O && O[T] || n; }, e.call = function() { var k = arguments[0], T = [].slice.call(arguments, 1); return e.apiMethodRegistry[k].apply(null, T); }; function f(k) { var T = k.name, O = k.categories, M = k.meta; if (e.modules[T]) { t.log("Type " + T + " already registered"); return; } e.subplotsRegistry[k.basePlotModule.name] || h(k.basePlotModule); for (var C = {}, I = 0; I < O.length; I++) C[O[I]] = !0, e.allCategories[O[I]] = !0; e.modules[T] = { _module: k, categories: C }, M && Object.keys(M).length && (e.modules[T].meta = M), e.allTypes.push(T); for (var j in e.componentsRegistry) m(j, T); k.layoutAttributes && c(e.traceLayoutAttributes, k.layoutAttributes); var P = k.basePlotModule, N = P.name; if (N === "mapbox") { var W = P.constants.styleRules; for (var J in W) i(".js-plotly-plot .plotly .mapboxgl-" + J, W[J]); } (N === "geo" || N === "mapbox") && window.PlotlyGeoAssets === void 0 && (window.PlotlyGeoAssets = { topojson: {} }); } function h(k) { var T = k.name; if (e.subplotsRegistry[T]) { t.log("Plot type " + T + " already registered."); return; } y(k), e.subplotsRegistry[T] = k; for (var O in e.componentsRegistry) w(O, k.name); } function g(k) { if (typeof k.name != "string") throw new Error("Component module *name* must be a string."); var T = k.name; e.componentsRegistry[T] = k, k.layoutAttributes && (k.layoutAttributes._isLinkedToArray && r(e.layoutArrayContainers, T), y(k)); for (var O in e.modules) m(T, O); for (var M in e.subplotsRegistry) w(T, M); for (var C in e.transformsRegistry) b(T, C); k.schema && k.schema.layout && u(s, k.schema.layout); } function p(k) { if (typeof k.name != "string") throw new Error("Transform module *name* must be a string."); var T = "Transform module " + k.name, O = typeof k.transform == "function", M = typeof k.calcTransform == "function"; if (!O && !M) throw new Error(T + " is missing a *transform* or *calcTransform* method."); O && M && t.log([ T + " has both a *transform* and *calcTransform* methods.", "Please note that all *transform* methods are executed", "before all *calcTransform* methods." ].join(" ")), a(k.attributes) || t.log(T + " registered without an *attributes* object."), typeof k.supplyDefaults != "function" && t.log(T + " registered without a *supplyDefaults* method."), e.transformsRegistry[k.name] = k; for (var C in e.componentsRegistry) b(C, k.name); } function v(k) { var T = k.name, O = T.split("-")[0], M = k.dictionary, C = k.format, I = M && Object.keys(M).length, j = C && Object.keys(C).length, P = e.localeRegistry, N = P[T]; if (N || (P[T] = N = {}), O !== T) { var W = P[O]; W || (P[O] = W = {}), I && W.dictionary === N.dictionary && (W.dictionary = M), j && W.format === N.format && (W.format = C); } I && (N.dictionary = M), j && (N.format = C); } function y(k) { if (k.layoutAttributes) { var T = k.layoutAttributes._arrayAttrRegexps; if (T) for (var O = 0; O < T.length; O++) r(e.layoutArrayRegexes, T[O]); } } function m(k, T) { var O = e.componentsRegistry[k].schema; if (!(!O || !O.traces)) { var M = O.traces[T]; M && u(e.modules[T]._module.attributes, M); } } function b(k, T) { var O = e.componentsRegistry[k].schema; if (!(!O || !O.transforms)) { var M = O.transforms[T]; M && u(e.transformsRegistry[T].attributes, M); } } function w(k, T) { var O = e.componentsRegistry[k].schema; if (!(!O || !O.subplots)) { var M = e.subplotsRegistry[T], C = M.layoutAttributes, I = M.attr === "subplot" ? M.name : M.attr; Array.isArray(I) && (I = I[0]); var j = O.subplots[I]; C && j && u(C, j); } } function _(k) { return typeof k == "object" && (k = k.type), k; } })(Rt); (function(e) { var t = xd.timeFormat, n = cn, r = $c, a = Wd.mod, i = er, o = i.BADNUM, l = i.ONEDAY, s = i.ONEHOUR, c = i.ONEMIN, u = i.ONESEC, f = i.EPOCHJD, h = Rt, g = xd.utcFormat, p = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, v = /^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m, y = (/* @__PURE__ */ new Date()).getFullYear() - 70; function m(E) { return E && h.componentsRegistry.calendars && typeof E == "string" && E !== "gregorian"; } e.dateTick0 = function(E, z) { var F = b(E, !!z); if (z < 2) return F; var q = e.dateTime2ms(F, E); return q += l * (z - 1), e.ms2DateTime(q, 0, E); }; function b(E, z) { return m(E) ? z ? h.getComponentMethod("calendars", "CANONICAL_SUNDAY")[E] : h.getComponentMethod("calendars", "CANONICAL_TICK")[E] : z ? "2000-01-02" : "2000-01-01"; } e.dfltRange = function(E) { return m(E) ? h.getComponentMethod("calendars", "DFLTRANGE")[E] : ["2000-01-01", "2001-01-01"]; }, e.isJSDate = function(E) { return typeof E == "object" && E !== null && typeof E.getTime == "function"; }; var w, _; e.dateTime2ms = function(E, z) { if (e.isJSDate(E)) { var F = E.getTimezoneOffset() * c, q = (E.getUTCMinutes() - E.getMinutes()) * c + (E.getUTCSeconds() - E.getSeconds()) * u + (E.getUTCMilliseconds() - E.getMilliseconds()); if (q) { var H = 3 * c; F = F - H / 2 + a(q - F + H / 2, H); } return E = Number(E) - F, E >= w && E <= _ ? E : o; } if (typeof E != "string" && typeof E != "number") return o; E = String(E); var K = m(z), Q = E.charAt(0); K && (Q === "G" || Q === "g") && (E = E.substr(1), z = ""); var re = K && z.substr(0, 7) === "chinese", te = E.match(re ? v : p); if (!te) return o; var X = te[1], ce = te[3] || "1", B = Number(te[5] || 1), G = Number(te[7] || 0), Z = Number(te[9] || 0), oe = Number(te[11] || 0); if (K) { if (X.length === 2) return o; X = Number(X); var ae; try { var ge = h.getComponentMethod("calendars", "getCal")(z); if (re) { var ve = ce.charAt(ce.length - 1) === "i"; ce = parseInt(ce, 10), ae = ge.newDate(X, ge.toMonthIndex(X, ce, ve), B); } else ae = ge.newDate(X, Number(ce), B); } catch { return o; } return ae ? (ae.toJD() - f) * l + G * s + Z * c + oe * u : o; } X.length === 2 ? X = (Number(X) + 2e3 - y) % 100 + y : X = Number(X), ce -= 1; var pe = new Date(Date.UTC(2e3, ce, B, G, Z)); return pe.setUTCFullYear(X), pe.getUTCMonth() !== ce || pe.getUTCDate() !== B ? o : pe.getTime() + oe * u; }, w = e.MIN_MS = e.dateTime2ms("-9999"), _ = e.MAX_MS = e.dateTime2ms("9999-12-31 23:59:59.9999"), e.isDateTime = function(E, z) { return e.dateTime2ms(E, z) !== o; }; function k(E, z) { return String(E + Math.pow(10, z)).substr(1); } var T = 90 * l, O = 3 * s, M = 5 * c; e.ms2DateTime = function(E, z, F) { if (typeof E != "number" || !(E >= w && E <= _)) return o; z || (z = 0); var q = Math.floor(a(E + 0.05, 1) * 10), H = Math.round(E - q / 10), K, Q, re, te, X, ce; if (m(F)) { var B = Math.floor(H / l) + f, G = Math.floor(a(E, l)); try { K = h.getComponentMethod("calendars", "getCal")(F).fromJD(B).formatDate("yyyy-mm-dd"); } catch { K = g("G%Y-%m-%d")(new Date(H)); } if (K.charAt(0) === "-") for (; K.length < 11; ) K = "-0" + K.substr(1); else for (; K.length < 10; ) K = "0" + K; Q = z < T ? Math.floor(G / s) : 0, re = z < T ? Math.floor(G % s / c) : 0, te = z < O ? Math.floor(G % c / u) : 0, X = z < M ? G % u * 10 + q : 0; } else ce = new Date(H), K = g("%Y-%m-%d")(ce), Q = z < T ? ce.getUTCHours() : 0, re = z < T ? ce.getUTCMinutes() : 0, te = z < O ? ce.getUTCSeconds() : 0, X = z < M ? ce.getUTCMilliseconds() * 10 + q : 0; return C(K, Q, re, te, X); }, e.ms2DateTimeLocal = function(E) { if (!(E >= w + l && E <= _ - l)) return o; var z = Math.floor(a(E + 0.05, 1) * 10), F = new Date(Math.round(E - z / 10)), q = t("%Y-%m-%d")(F), H = F.getHours(), K = F.getMinutes(), Q = F.getSeconds(), re = F.getUTCMilliseconds() * 10 + z; return C(q, H, K, Q, re); }; function C(E, z, F, q, H) { if ((z || F || q || H) && (E += " " + k(z, 2) + ":" + k(F, 2), (q || H) && (E += ":" + k(q, 2), H))) { for (var K = 4; H % 10 === 0; ) K -= 1, H /= 10; E += "." + k(H, K); } return E; } e.cleanDate = function(E, z, F) { if (E === o) return z; if (e.isJSDate(E) || typeof E == "number" && isFinite(E)) { if (m(F)) return r.error("JS Dates and milliseconds are incompatible with world calendars", E), z; if (E = e.ms2DateTimeLocal(+E), !E && z !== void 0) return z; } else if (!e.isDateTime(E, F)) return r.error("unrecognized date", E), z; return E; }; var I = /%\d?f/g, j = /%h/g, P = { 1: "1", 2: "1", 3: "2", 4: "2" }; function N(E, z, F, q) { E = E.replace(I, function(K) { var Q = Math.min(+K.charAt(1) || 6, 6), re = (z / 1e3 % 1 + 2).toFixed(Q).substr(2).replace(/0+$/, "") || "0"; return re; }); var H = new Date(Math.floor(z + 0.05)); if (E = E.replace(j, function() { return P[F("%q")(H)]; }), m(q)) try { E = h.getComponentMethod("calendars", "worldCalFmt")(E, z, q); } catch { return "Invalid"; } return F(E)(H); } var W = [59, 59.9, 59.99, 59.999, 59.9999]; function J(E, z) { var F = a(E + 0.05, l), q = k(Math.floor(F / s), 2) + ":" + k(a(Math.floor(F / c), 60), 2); if (z !== "M") { n(z) || (z = 0); var H = Math.min(a(E / u, 60), W[z]), K = (100 + H).toFixed(z).substr(1); z > 0 && (K = K.replace(/0+$/, "").replace(/[\.]$/, "")), q += ":" + K; } return q; } e.formatDate = function(E, z, F, q, H, K) { if (H = m(H) && H, !z) if (F === "y") z = K.year; else if (F === "m") z = K.month; else if (F === "d") z = K.dayMonth + ` ` + K.year; else return J(E, F) + ` ` + N(K.dayMonthYear, E, q, H); return N(z, E, q, H); }; var U = 3 * l; e.incrementMonth = function(E, z, F) { F = m(F) && F; var q = a(E, l); if (E = Math.round(E - q), F) try { var H = Math.round(E / l) + f, K = h.getComponentMethod("calendars", "getCal")(F), Q = K.fromJD(H); return z % 12 ? K.add(Q, z, "m") : K.add(Q, z / 12, "y"), (Q.toJD() - f) * l + q; } catch { r.error("invalid ms " + E + " in calendar " + F); } var re = new Date(E + U); return re.setUTCMonth(re.getUTCMonth() + z) + q - U; }, e.findExactDates = function(E, z) { for (var F = 0, q = 0, H = 0, K = 0, Q, re, te = m(z) && h.getComponentMethod("calendars", "getCal")(z), X = 0; X < E.length; X++) { if (re = E[X], !n(re)) { K++; continue; } if (!(re % l)) if (te) try { Q = te.fromJD(re / l + f), Q.day() === 1 ? Q.month() === 1 ? F++ : q++ : H++; } catch { } else Q = new Date(re), Q.getUTCDate() === 1 ? Q.getUTCMonth() === 0 ? F++ : q++ : H++; } q += F, H += q; var ce = E.length - K; return { exactYears: F / ce, exactMonths: q / ce, exactDays: H / ce }; }; })(J4); var $1 = {}, _C = function(e) { return e; }; (function(e) { var t = cn, n = $c, r = _C, a = er.BADNUM, i = 1e-9; e.findBin = function(u, f, h) { if (t(f.start)) return h ? Math.ceil((u - f.start) / f.size - i) - 1 : Math.floor((u - f.start) / f.size + i); var g = 0, p = f.length, v = 0, y = p > 1 ? (f[p - 1] - f[0]) / (p - 1) : 1, m, b; for (y >= 0 ? b = h ? o : l : b = h ? c : s, u += y * i * (h ? -1 : 1) * (y >= 0 ? 1 : -1); g < p && v++ < 100; ) m = Math.floor((g + p) / 2), b(f[m], u) ? g = m + 1 : p = m; return v > 90 && n.log("Long binary search..."), g - 1; }; function o(u, f) { return u < f; } function l(u, f) { return u <= f; } function s(u, f) { return u > f; } function c(u, f) { return u >= f; } e.sorterAsc = function(u, f) { return u - f; }, e.sorterDes = function(u, f) { return f - u; }, e.distinctVals = function(u) { var f = u.slice(); f.sort(e.sorterAsc); var h; for (h = f.length - 1; h > -1 && f[h] === a; h--) ; for (var g = f[h] - f[0] || 1, p = g / (h || 1) / 1e4, v = [], y, m = 0; m <= h; m++) { var b = f[m], w = b - y; y === void 0 ? (v.push(b), y = b) : w > p && (g = Math.min(g, w), v.push(b), y = b); } return { vals: v, minDiff: g }; }, e.roundUp = function(u, f, h) { for (var g = 0, p = f.length - 1, v, y = 0, m = h ? 0 : 1, b = h ? 1 : 0, w = h ? Math.ceil : Math.floor; g < p && y++ < 100; ) v = w((g + p) / 2), f[v] <= u ? g = v + m : p = v - b; return f[g]; }, e.sort = function(u, f) { for (var h = 0, g = 0, p = 1; p < u.length; p++) { var v = f(u[p], u[p - 1]); if (v < 0 ? h = 1 : v > 0 && (g = 1), h && g) return u.sort(f); } return g ? u : u.reverse(); }, e.findIndexOfMin = function(u, f) { f = f || r; for (var h = 1 / 0, g, p = 0; p < u.length; p++) { var v = f(u[p]); v < h && (h = v, g = p); } return g; }; })($1); var kC = function(e) { return Object.keys(e).sort(); }, TC = {}; (function(e) { var t = cn, n = ir.isArrayOrTypedArray; e.aggNums = function(r, a, i, o) { var l, s; if ((!o || o > i.length) && (o = i.length), t(a) || (a = !1), n(i[0])) { for (s = new Array(o), l = 0; l < o; l++) s[l] = e.aggNums(r, a, i[l]); i = s; } for (l = 0; l < o; l++) t(a) ? t(i[l]) && (a = r(+a, +i[l])) : a = i[l]; return a; }, e.len = function(r) { return e.aggNums(function(a) { return a + 1; }, 0, r); }, e.mean = function(r, a) { return a || (a = e.len(r)), e.aggNums(function(i, o) { return i + o; }, 0, r) / a; }, e.midRange = function(r) { if (!(r === void 0 || r.length === 0)) return (e.aggNums(Math.max, null, r) + e.aggNums(Math.min, null, r)) / 2; }, e.variance = function(r, a, i) { return a || (a = e.len(r)), t(i) || (i = e.mean(r, a)), e.aggNums(function(o, l) { return o + Math.pow(l - i, 2); }, 0, r) / a; }, e.stdev = function(r, a, i) { return Math.sqrt(e.variance(r, a, i)); }, e.median = function(r) { var a = r.slice().sort(); return e.interp(a, 0.5); }, e.interp = function(r, a) { if (!t(a)) throw "n should be a finite number"; if (a = a * r.length - 0.5, a < 0) return r[0]; if (a > r.length - 1) return r[r.length - 1]; var i = a % 1; return i * r[Math.ceil(a)] + (1 - i) * r[Math.floor(a)]; }; })(TC); var AC = Wd, Wg = AC.mod, MG = AC.modHalf, bd = Math.PI, Qo = 2 * bd; function SG(e) { return e / 180 * bd; } function CG(e) { return e / bd * 180; } function K1(e) { return Math.abs(e[1] - e[0]) > Qo - 1e-14; } function MC(e, t) { return MG(t - e, Qo); } function LG(e, t) { return Math.abs(MC(e, t)); } function SC(e, t) { if (K1(t)) return !0; var n, r; t[0] < t[1] ? (n = t[0], r = t[1]) : (n = t[1], r = t[0]), n = Wg(n, Qo), r = Wg(r, Qo), n > r && (r += Qo); var a = Wg(e, Qo), i = a + Qo; return a >= n && a <= r || i >= n && i <= r; } function OG(e, t, n, r) { if (!SC(t, r)) return !1; var a, i; return n[0] < n[1] ? (a = n[0], i = n[1]) : (a = n[1], i = n[0]), e >= a && e <= i; } function J1(e, t, n, r, a, i, o) { a = a || 0, i = i || 0; var l = K1([n, r]), s, c, u, f, h; l ? (s = 0, c = bd, u = Qo) : n < r ? (s = n, u = r) : (s = r, u = n), e < t ? (f = e, h = t) : (f = t, h = e); function g(m, b) { return [m * Math.cos(b) + a, i - m * Math.sin(b)]; } var p = Math.abs(u - s) <= bd ? 0 : 1; function v(m, b, w) { return "A" + [m, m] + " " + [0, p, w] + " " + g(m, b); } var y; return l ? f === null ? y = "M" + g(h, s) + v(h, c, 0) + v(h, u, 0) + "Z" : y = "M" + g(f, s) + v(f, c, 0) + v(f, u, 0) + "ZM" + g(h, s) + v(h, c, 1) + v(h, u, 1) + "Z" : f === null ? (y = "M" + g(h, s) + v(h, u, 0), o && (y += "L0,0Z")) : y = "M" + g(f, s) + "L" + g(h, s) + v(h, u, 0) + "L" + g(f, u) + v(f, s, 1) + "Z", y; } function DG(e, t, n, r, a) { return J1(null, e, t, n, r, a, 0); } function FG(e, t, n, r, a) { return J1(null, e, t, n, r, a, 1); } function IG(e, t, n, r, a, i) { return J1(e, t, n, r, a, i, 1); } var zG = { deg2rad: SG, rad2deg: CG, angleDelta: MC, angleDist: LG, isFullCircle: K1, isAngleInsideSector: SC, isPtInsideSector: OG, pathArc: DG, pathSector: FG, pathAnnulus: IG }, vs = {}; vs.isLeftAnchor = function(e) { return e.xanchor === "left" || e.xanchor === "auto" && e.x <= 1 / 3; }; vs.isCenterAnchor = function(e) { return e.xanchor === "center" || e.xanchor === "auto" && e.x > 1 / 3 && e.x < 2 / 3; }; vs.isRightAnchor = function(e) { return e.xanchor === "right" || e.xanchor === "auto" && e.x >= 2 / 3; }; vs.isTopAnchor = function(e) { return e.yanchor === "top" || e.yanchor === "auto" && e.y >= 2 / 3; }; vs.isMiddleAnchor = function(e) { return e.yanchor === "middle" || e.yanchor === "auto" && e.y > 1 / 3 && e.y < 2 / 3; }; vs.isBottomAnchor = function(e) { return e.yanchor === "bottom" || e.yanchor === "auto" && e.y <= 1 / 3; }; var ms = {}, Zg = Wd.mod; ms.segmentsIntersect = CC; function CC(e, t, n, r, a, i, o, l) { var s = n - e, c = a - e, u = o - a, f = r - t, h = i - t, g = l - i, p = s * g - u * f; if (p === 0) return null; var v = (c * g - u * h) / p, y = (c * f - s * h) / p; return y < 0 || y > 1 || v < 0 || v > 1 ? null : { x: e + s * v, y: t + f * v }; } ms.segmentDistance = function(e, t, n, r, a, i, o, l) { if (CC(e, t, n, r, a, i, o, l)) return 0; var s = n - e, c = r - t, u = o - a, f = l - i, h = s * s + c * c, g = u * u + f * f, p = Math.min( Pf(s, c, h, a - e, i - t), Pf(s, c, h, o - e, l - t), Pf(u, f, g, e - a, t - i), Pf(u, f, g, n - a, r - i) ); return Math.sqrt(p); }; function Pf(e, t, n, r, a) { var i = r * e + a * t; if (i < 0) return r * r + a * a; if (i > n) { var o = r - e, l = a - t; return o * o + l * l; } else { var s = r * t - a * e; return s * s / n; } } var Rf, ay, k_; ms.getTextLocation = function(e, t, n, r) { if ((e !== ay || r !== k_) && (Rf = {}, ay = e, k_ = r), Rf[n]) return Rf[n]; var a = e.getPointAtLength(Zg(n - r / 2, t)), i = e.getPointAtLength(Zg(n + r / 2, t)), o = Math.atan((i.y - a.y) / (i.x - a.x)), l = e.getPointAtLength(Zg(n, t)), s = (l.x * 4 + a.x + i.x) / 6, c = (l.y * 4 + a.y + i.y) / 6, u = { x: s, y: c, theta: o }; return Rf[n] = u, u; }; ms.clearLocationCache = function() { ay = null; }; ms.getVisibleSegment = function(e, t, n) { var r = t.left, a = t.right, i = t.top, o = t.bottom, l = 0, s = e.getTotalLength(), c = s, u, f; function h(p) { var v = e.getPointAtLength(p); p === 0 ? u = v : p === s && (f = v); var y = v.x < r ? r - v.x : v.x > a ? v.x - a : 0, m = v.y < i ? i - v.y : v.y > o ? v.y - o : 0; return Math.sqrt(y * y + m * m); } for (var g = h(l); g; ) { if (l += g + n, l > c) return; g = h(l); } for (g = h(c); g; ) { if (c -= g + n, l > c) return; g = h(c); } return { min: l, max: c, len: c - l, total: s, isClosed: l === 0 && c === s && Math.abs(u.x - f.x) < 0.1 && Math.abs(u.y - f.y) < 0.1 }; }; ms.findPointOnPath = function(e, t, n, r) { r = r || {}; for (var a = r.pathLength || e.getTotalLength(), i = r.tolerance || 1e-3, o = r.iterationLimit || 30, l = e.getPointAtLength(0)[n] > e.getPointAtLength(a)[n] ? -1 : 1, s = 0, c = 0, u = a, f, h, g; s < o; ) { if (f = (c + u) / 2, h = e.getPointAtLength(f), g = h[n] - t, Math.abs(g) < i) return h; l * g > 0 ? u = f : c = f, s++; } return h; }; var m0 = {}; (function(e) { var t = {}; e.throttle = function(r, a, i) { var o = t[r], l = Date.now(); if (!o) { for (var s in t) t[s].ts < l - 6e4 && delete t[s]; o = t[r] = { ts: 0, timer: null }; } n(o); function c() { i(), o.ts = Date.now(), o.onDone && (o.onDone(), o.onDone = null); } if (l > o.ts + a) { c(); return; } o.timer = setTimeout(function() { c(), o.timer = null; }, a); }, e.done = function(r) { var a = t[r]; return !a || !a.timer ? Promise.resolve() : new Promise(function(i) { var o = a.onDone; a.onDone = function() { o && o(), i(), a.onDone = null; }; }); }, e.clear = function(r) { if (r) n(t[r]), delete t[r]; else for (var a in t) e.clear(a); }; function n(r) { r && r.timer !== null && (clearTimeout(r.timer), r.timer = null); } })(m0); var EG = function(e) { e._responsiveChartHandler && (window.removeEventListener("resize", e._responsiveChartHandler), delete e._responsiveChartHandler); }, y0 = { exports: {} }; y0.exports = Q1; y0.exports.isMobile = Q1; y0.exports.default = Q1; const jG = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, PG = /CrOS/, RG = /android|ipad|playbook|silk/i; function Q1(e) { e || (e = {}); let t = e.ua; if (!t && typeof navigator < "u" && (t = navigator.userAgent), t && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string") return !1; let n = jG.test(t) && !PG.test(t) || !!e.tablet && RG.test(t); return !n && e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.indexOf("Macintosh") !== -1 && t.indexOf("Safari") !== -1 && (n = !0), n; } var NG = y0.exports, BG = cn, HG = NG, VG = function(e) { var t; if (e && e.hasOwnProperty("userAgent") ? t = e.userAgent : t = qG(), typeof t != "string") return !0; var n = HG({ ua: { headers: { "user-agent": t } }, tablet: !0, featureDetect: !1 }); if (!n) for (var r = t.split(" "), a = 1; a < r.length; a++) { var i = r[a]; if (i.indexOf("Safari") !== -1) for (var o = a - 1; o > -1; o--) { var l = r[o]; if (l.substr(0, 8) === "Version/") { var s = l.substr(8).split(".")[0]; if (BG(s) && (s = +s), s >= 13) return !0; } } } return n; }; function qG() { var e; return typeof navigator < "u" && (e = navigator.userAgent), e && e.headers && typeof e.headers["user-agent"] == "string" && (e = e.headers["user-agent"]), e; } var UG = sn, GG = function(e, t, n) { var r = e.selectAll("g." + n.replace(/\s/g, ".")).data(t, function(i) { return i[0].trace.uid; }); r.exit().remove(), r.enter().append("g").attr("class", n), r.order(); var a = e.classed("rangeplot") ? "nodeRangePlot3" : "node3"; return r.each(function(i) { i[0][a] = UG.select(this); }), r; }, WG = Rt, ZG = function(e, t) { for (var n = e._context.locale, r = 0; r < 2; r++) { for (var a = e._context.locales, i = 0; i < 2; i++) { var o = (a[n] || {}).dictionary; if (o) { var l = o[t]; if (l) return l; } a = WG.localeRegistry; } var s = n.split("-")[0]; if (s === n) break; n = s; } return t; }, YG = function(e) { for (var t = {}, n = [], r = 0, a = 0; a < e.length; a++) { var i = e[a]; t[i] !== 1 && (t[i] = 1, n[r++] = i); } return n; }, $G = function(e) { for (var t = QG(e) ? JG : KG, n = [], r = 0; r < e.length; r++) { var a = e[r]; t(a) && n.push(a); } return n; }; function KG(e) { return e.visible === !0; } function JG(e) { var t = e[0].trace; return t.visible === !0 && t._length !== 0; } function QG(e) { return Array.isArray(e) && Array.isArray(e[0]) && e[0][0] && e[0][0].trace; } var XG = function(e, t) { if (!t) return e; var n = 1 / Math.abs(t), r = n > 1 ? (n * e + n * t) / n : e + t, a = String(r).length; if (a > 16) { var i = String(t).length, o = String(e).length; if (a >= o + i) { var l = parseFloat(r).toPrecision(12); l.indexOf("e+") === -1 && (r = +l); } } return r; }, eW = cn, tW = er.BADNUM, nW = /^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g, rW = function(e) { return typeof e == "string" && (e = e.replace(nW, "")), eW(e) ? Number(e) : tW; }, Wu = sn, aW = xd.utcFormat, iW = j4.format, LC = cn, OC = er, DC = OC.FP_SAFE, oW = -DC, T_ = OC.BADNUM, we = a4.exports = {}; we.adjustFormat = function(e) { return !e || /^\d[.]\df/.test(e) || /[.]\d%/.test(e) ? e : e === "0.f" ? "~f" : /^\d%/.test(e) ? "~%" : /^\ds/.test(e) ? "~s" : !/^[~,.0$]/.test(e) && /[&fps]/.test(e) ? "~" + e : e; }; var A_ = {}; we.warnBadFormat = function(e) { var t = String(e); A_[t] || (A_[t] = 1, we.warn('encountered bad format: "' + t + '"')); }; we.noFormat = function(e) { return String(e); }; we.numberFormat = function(e) { var t; try { t = iW(we.adjustFormat(e)); } catch { return we.warnBadFormat(e), we.noFormat; } return t; }; we.nestedProperty = R1; we.keyedContainer = kq; we.relativeAttr = Mq; we.isPlainObject = gs; we.toLogRange = N1; we.relinkPrivateKeys = Cq; var gl = ir; we.isArrayBuffer = gl.isArrayBuffer; we.isTypedArray = gl.isTypedArray; we.isArrayOrTypedArray = gl.isArrayOrTypedArray; we.isArray1D = gl.isArray1D; we.ensureArray = gl.ensureArray; we.concat = gl.concat; we.maxRowLength = gl.maxRowLength; we.minRowLength = gl.minRowLength; var FC = Wd; we.mod = FC.mod; we.modHalf = FC.modHalf; var vl = U4; we.valObjectMeta = vl.valObjectMeta; we.coerce = vl.coerce; we.coerce2 = vl.coerce2; we.coerceFont = vl.coerceFont; we.coercePattern = vl.coercePattern; we.coerceHoverinfo = vl.coerceHoverinfo; we.coerceSelectionMarkerOpacity = vl.coerceSelectionMarkerOpacity; we.validate = vl.validate; var ka = J4; we.dateTime2ms = ka.dateTime2ms; we.isDateTime = ka.isDateTime; we.ms2DateTime = ka.ms2DateTime; we.ms2DateTimeLocal = ka.ms2DateTimeLocal; we.cleanDate = ka.cleanDate; we.isJSDate = ka.isJSDate; we.formatDate = ka.formatDate; we.incrementMonth = ka.incrementMonth; we.dateTick0 = ka.dateTick0; we.dfltRange = ka.dfltRange; we.findExactDates = ka.findExactDates; we.MIN_MS = ka.MIN_MS; we.MAX_MS = ka.MAX_MS; var ys = $1; we.findBin = ys.findBin; we.sorterAsc = ys.sorterAsc; we.sorterDes = ys.sorterDes; we.distinctVals = ys.distinctVals; we.roundUp = ys.roundUp; we.sort = ys.sort; we.findIndexOfMin = ys.findIndexOfMin; we.sortObjectKeys = kC; var ml = TC; we.aggNums = ml.aggNums; we.len = ml.len; we.mean = ml.mean; we.median = ml.median; we.midRange = ml.midRange; we.variance = ml.variance; we.stdev = ml.stdev; we.interp = ml.interp; var wi = d0; we.init2dArray = wi.init2dArray; we.transposeRagged = wi.transposeRagged; we.dot = wi.dot; we.translationMatrix = wi.translationMatrix; we.rotationMatrix = wi.rotationMatrix; we.rotationXYMatrix = wi.rotationXYMatrix; we.apply3DTransform = wi.apply3DTransform; we.apply2DTransform = wi.apply2DTransform; we.apply2DTransform2 = wi.apply2DTransform2; we.convertCssMatrix = wi.convertCssMatrix; we.inverseTransformMatrix = wi.inverseTransformMatrix; var $i = zG; we.deg2rad = $i.deg2rad; we.rad2deg = $i.rad2deg; we.angleDelta = $i.angleDelta; we.angleDist = $i.angleDist; we.isFullCircle = $i.isFullCircle; we.isAngleInsideSector = $i.isAngleInsideSector; we.isPtInsideSector = $i.isPtInsideSector; we.pathArc = $i.pathArc; we.pathSector = $i.pathSector; we.pathAnnulus = $i.pathAnnulus; var Kc = vs; we.isLeftAnchor = Kc.isLeftAnchor; we.isCenterAnchor = Kc.isCenterAnchor; we.isRightAnchor = Kc.isRightAnchor; we.isTopAnchor = Kc.isTopAnchor; we.isMiddleAnchor = Kc.isMiddleAnchor; we.isBottomAnchor = Kc.isBottomAnchor; var Jc = ms; we.segmentsIntersect = Jc.segmentsIntersect; we.segmentDistance = Jc.segmentDistance; we.getTextLocation = Jc.getTextLocation; we.clearLocationCache = Jc.clearLocationCache; we.getVisibleSegment = Jc.getVisibleSegment; we.findPointOnPath = Jc.findPointOnPath; var x0 = tr; we.extendFlat = x0.extendFlat; we.extendDeep = x0.extendDeep; we.extendDeepAll = x0.extendDeepAll; we.extendDeepNoArrays = x0.extendDeepNoArrays; var X1 = $c; we.log = X1.log; we.warn = X1.warn; we.error = X1.error; var lW = Zc; we.counterRegex = lW.counter; var ex = m0; we.throttle = ex.throttle; we.throttleDone = ex.done; we.clearThrottle = ex.clear; var Ki = f0; we.getGraphDiv = Ki.getGraphDiv; we.isPlotDiv = Ki.isPlotDiv; we.removeElement = Ki.removeElement; we.addStyleRule = Ki.addStyleRule; we.addRelatedStyleRule = Ki.addRelatedStyleRule; we.deleteRelatedStyleRule = Ki.deleteRelatedStyleRule; we.getFullTransformMatrix = Ki.getFullTransformMatrix; we.getElementTransformMatrix = Ki.getElementTransformMatrix; we.getElementAndAncestors = Ki.getElementAndAncestors; we.equalDomRects = Ki.equalDomRects; we.clearResponsive = EG; we.preserveDrawingBuffer = VG; we.makeTraceGroups = GG; we._ = ZG; we.notifier = nC; we.filterUnique = YG; we.filterVisible = $G; we.pushUnique = rC; we.increment = XG; we.cleanNumber = rW; we.ensureNumber = function(e) { return LC(e) ? (e = Number(e), e > DC || e < oW ? T_ : e) : T_; }; we.isIndex = function(e, t) { return t !== void 0 && e >= t ? !1 : LC(e) && e >= 0 && e % 1 === 0; }; we.noop = G1; we.identity = _C; we.repeat = function(e, t) { for (var n = new Array(t), r = 0; r < t; r++) n[r] = e; return n; }; we.swapAttrs = function(e, t, n, r) { n || (n = "x"), r || (r = "y"); for (var a = 0; a < t.length; a++) { var i = t[a], o = we.nestedProperty(e, i.replace("?", n)), l = we.nestedProperty(e, i.replace("?", r)), s = o.get(); o.set(l.get()), l.set(s); } }; we.raiseToTop = function(e) { e.parentNode.appendChild(e); }; we.cancelTransition = function(e) { return e.transition().duration(0); }; we.constrain = function(e, t, n) { return t > n ? Math.max(n, Math.min(t, e)) : Math.max(t, Math.min(n, e)); }; we.bBoxIntersect = function(e, t, n) { return n = n || 0, e.left <= t.right + n && t.left <= e.right + n && e.top <= t.bottom + n && t.top <= e.bottom + n; }; we.simpleMap = function(e, t, n, r, a) { for (var i = e.length, o = new Array(i), l = 0; l < i; l++) o[l] = t(e[l], n, r, a); return o; }; we.randstr = function e(t, n, r, a) { if (r || (r = 16), n === void 0 && (n = 24), n <= 0) return "0"; var i = Math.log(Math.pow(2, n)) / Math.log(r), o = "", l, s, c; for (l = 2; i === 1 / 0; l *= 2) i = Math.log(Math.pow(2, n / l)) / Math.log(r) * l; var u = i - Math.floor(i); for (l = 0; l < Math.floor(i); l++) c = Math.floor(Math.random() * r).toString(r), o = c + o; u && (s = Math.pow(r, u), c = Math.floor(Math.random() * s).toString(r), o = c + o); var f = parseInt(o, r); return t && t[o] || f !== 1 / 0 && f >= Math.pow(2, n) ? a > 10 ? (we.warn("randstr failed uniqueness"), o) : e(t, n, r, (a || 0) + 1) : o; }; we.OptionControl = function(e, t) { e || (e = {}), t || (t = "opt"); var n = {}; return n.optionList = [], n._newoption = function(r) { r[t] = e, n[r.name] = r, n.optionList.push(r); }, n["_" + t] = e, n; }; we.smooth = function(e, t) { if (t = Math.round(t) || 0, t < 2) return e; var n = e.length, r = 2 * n, a = 2 * t - 1, i = new Array(a), o = new Array(n), l, s, c, u; for (l = 0; l < a; l++) i[l] = (1 - Math.cos(Math.PI * (l + 1) / t)) / (2 * t); for (l = 0; l < n; l++) { for (u = 0, s = 0; s < a; s++) c = l + s + 1 - t, c < -n ? c -= r * Math.round(c / r) : c >= r && (c -= r * Math.floor(c / r)), c < 0 ? c = -1 - c : c >= n && (c = r - 1 - c), u += e[c] * i[s]; o[l] = u; } return o; }; we.syncOrAsync = function(e, t, n) { var r, a; function i() { return we.syncOrAsync(e, t, n); } for (; e.length; ) if (a = e.splice(0, 1)[0], r = a(t), r && r.then) return r.then(i); return n && n(t); }; we.stripTrailingSlash = function(e) { return e.substr(-1) === "/" ? e.substr(0, e.length - 1) : e; }; we.noneOrAll = function(e, t, n) { if (e) { var r = !1, a = !0, i, o; for (i = 0; i < n.length; i++) o = e[n[i]], o != null ? r = !0 : a = !1; if (r && !a) for (i = 0; i < n.length; i++) e[n[i]] = t[n[i]]; } }; we.mergeArray = function(e, t, n, r) { var a = typeof r == "function"; if (we.isArrayOrTypedArray(e)) for (var i = Math.min(e.length, t.length), o = 0; o < i; o++) { var l = e[o]; t[o][n] = a ? r(l) : l; } }; we.mergeArrayCastPositive = function(e, t, n) { return we.mergeArray(e, t, n, function(r) { var a = +r; return isFinite(a) && a > 0 ? a : 0; }); }; we.fillArray = function(e, t, n, r) { if (r = r || we.identity, we.isArrayOrTypedArray(e)) for (var a = 0; a < t.length; a++) t[a][n] = r(e[a]); }; we.castOption = function(e, t, n, r) { r = r || we.identity; var a = we.nestedProperty(e, n).get(); return we.isArrayOrTypedArray(a) ? Array.isArray(t) && we.isArrayOrTypedArray(a[t[0]]) ? r(a[t[0]][t[1]]) : r(a[t]) : a; }; we.extractOption = function(e, t, n, r) { if (n in e) return e[n]; var a = we.nestedProperty(t, r).get(); if (!Array.isArray(a)) return a; }; function IC(e) { var t = {}; for (var n in e) for (var r = e[n], a = 0; a < r.length; a++) t[r[a]] = +n; return t; } we.tagSelected = function(e, t, n) { var r = t.selectedpoints, a = t._indexToPoints, i; a && (i = IC(a)); function o(f) { return f !== void 0 && f < e.length; } for (var l = 0; l < r.length; l++) { var s = r[l]; if (we.isIndex(s) || we.isArrayOrTypedArray(s) && we.isIndex(s[0]) && we.isIndex(s[1])) { var c = i ? i[s] : s, u = n ? n[c] : c; o(u) && (e[u].selected = 1); } } }; we.selIndices2selPoints = function(e) { var t = e.selectedpoints, n = e._indexToPoints; if (n) { for (var r = IC(n), a = [], i = 0; i < t.length; i++) { var o = t[i]; if (we.isIndex(o)) { var l = r[o]; we.isIndex(l) && a.push(l); } } return a; } else return t; }; we.getTargetArray = function(e, t) { var n = t.target; if (typeof n == "string" && n) { var r = we.nestedProperty(e, n).get(); return we.isArrayOrTypedArray(r) ? r : !1; } else if (we.isArrayOrTypedArray(n)) return n; return !1; }; function zC(e, t, n) { var r = {}; typeof t != "object" && (t = {}); var a = n === "pieLike" ? -1 : 3, i = Object.keys(e), o, l, s; for (o = 0; o < i.length; o++) l = i[o], s = e[l], !(l.charAt(0) === "_" || typeof s == "function") && (l === "module" ? r[l] = s : Array.isArray(s) ? l === "colorscale" || a === -1 ? r[l] = s.slice() : r[l] = s.slice(0, a) : we.isTypedArray(s) ? a === -1 ? r[l] = s.subarray() : r[l] = s.subarray(0, a) : s && typeof s == "object" ? r[l] = zC(e[l], t[l], n) : r[l] = s); for (i = Object.keys(t), o = 0; o < i.length; o++) l = i[o], s = t[l], (typeof s != "object" || !(l in r) || typeof r[l] != "object") && (r[l] = s); return r; } we.minExtend = zC; we.titleCase = function(e) { return e.charAt(0).toUpperCase() + e.substr(1); }; we.containsAny = function(e, t) { for (var n = 0; n < t.length; n++) if (e.indexOf(t[n]) !== -1) return !0; return !1; }; we.isIE = function() { return typeof window.navigator.msSaveBlob < "u"; }; var sW = /Version\/[\d\.]+.*Safari/; we.isSafari = function() { return sW.test(window.navigator.userAgent); }; var cW = /iPad|iPhone|iPod/; we.isIOS = function() { return cW.test(window.navigator.userAgent); }; var uW = /Firefox\/(\d+)\.\d+/; we.getFirefoxVersion = function() { var e = uW.exec(window.navigator.userAgent); if (e && e.length === 2) { var t = parseInt(e[1]); if (!isNaN(t)) return t; } return null; }; we.isD3Selection = function(e) { return e instanceof Wu.selection; }; we.ensureSingle = function(e, t, n, r) { var a = e.select(t + (n ? "." + n : "")); if (a.size()) return a; var i = e.append(t); return n && i.classed(n, !0), r && i.call(r), i; }; we.ensureSingleById = function(e, t, n, r) { var a = e.select(t + "#" + n); if (a.size()) return a; var i = e.append(t).attr("id", n); return r && i.call(r), i; }; we.objectFromPath = function(e, t) { for (var n = e.split("."), r, a = r = {}, i = 0; i < n.length; i++) { var o = n[i], l = null, s = n[i].match(/(.*)\[([0-9]+)\]/); s ? (o = s[1], l = s[2], r = r[o] = [], i === n.length - 1 ? r[l] = t : r[l] = {}, r = r[l]) : (i === n.length - 1 ? r[o] = t : r[o] = {}, r = r[o]); } return a; }; var dW = /^([^\[\.]+)\.(.+)?/, fW = /^([^\.]+)\[([0-9]+)\](\.)?(.+)?/; function Nf(e) { return e.slice(0, 2) === "__"; } we.expandObjectPaths = function(e) { var t, n, r, a, i, o, l; if (typeof e == "object" && !Array.isArray(e)) { for (n in e) if (e.hasOwnProperty(n)) if (t = n.match(dW)) { if (a = e[n], r = t[1], Nf(r)) continue; delete e[n], e[r] = we.extendDeepNoArrays(e[r] || {}, we.objectFromPath(n, we.expandObjectPaths(a))[r]); } else if (t = n.match(fW)) { if (a = e[n], r = t[1], Nf(r)) continue; if (i = parseInt(t[2]), delete e[n], e[r] = e[r] || [], t[3] === ".") l = t[4], o = e[r][i] = e[r][i] || {}, we.extendDeepNoArrays(o, we.objectFromPath(l, we.expandObjectPaths(a))); else { if (Nf(r)) continue; e[r][i] = we.expandObjectPaths(a); } } else { if (Nf(n)) continue; e[n] = we.expandObjectPaths(e[n]); } } return e; }; we.numSeparate = function(e, t, n) { if (n || (n = !1), typeof t != "string" || t.length === 0) throw new Error("Separator string required for formatting!"); typeof e == "number" && (e = String(e)); var r = /(\d+)(\d{3})/, a = t.charAt(0), i = t.charAt(1), o = e.split("."), l = o[0], s = o.length > 1 ? a + o[1] : ""; if (i && (o.length > 1 || l.length > 4 || n)) for (; r.test(l); ) l = l.replace(r, "$1" + i + "$2"); return l + s; }; we.TEMPLATE_STRING_REGEX = /%{([^\s%{}:]*)([:|\|][^}]*)?}/g; var EC = /^\w*$/; we.templateString = function(e, t) { var n = {}; return e.replace(we.TEMPLATE_STRING_REGEX, function(r, a) { var i; return EC.test(a) ? i = t[a] : (n[a] = n[a] || we.nestedProperty(t, a).get, i = n[a]()), we.isValidTextValue(i) ? i : ""; }); }; var hW = { max: 10, count: 0, name: "hovertemplate" }; we.hovertemplateString = function() { return tx.apply(hW, arguments); }; var pW = { max: 10, count: 0, name: "texttemplate" }; we.texttemplateString = function() { return tx.apply(pW, arguments); }; var gW = /^(\S+)([\*\/])(-?\d+(\.\d+)?)$/; function vW(e) { var t = e.match(gW); return t ? { key: t[1], op: t[2], number: Number(t[3]) } : { key: e, op: null, number: null }; } var mW = { max: 10, count: 0, name: "texttemplate", parseMultDiv: !0 }; we.texttemplateStringForShapes = function() { return tx.apply(mW, arguments); }; var M_ = /^[:|\|]/; function tx(e, t, n) { var r = this, a = arguments; t || (t = {}); var i = {}; return e.replace(we.TEMPLATE_STRING_REGEX, function(o, l, s) { var c = l === "xother" || l === "yother", u = l === "_xother" || l === "_yother", f = l === "_xother_" || l === "_yother_", h = l === "xother_" || l === "yother_", g = c || u || h || f, p = l; (u || f) && (p = p.substring(1)), (h || f) && (p = p.substring(0, p.length - 1)); var v = null, y = null; if (r.parseMultDiv) { var m = vW(p); p = m.key, v = m.op, y = m.number; } var b; if (g) { if (b = t[p], b === void 0) return ""; } else { var w, _; for (_ = 3; _ < a.length; _++) if (w = a[_], !!w) { if (w.hasOwnProperty(p)) { b = w[p]; break; } if (EC.test(p) || (b = we.nestedProperty(w, p).get(), b = i[p] || we.nestedProperty(w, p).get(), b && (i[p] = b)), b !== void 0) break; } } if (b !== void 0 && (v === "*" && (b *= y), v === "/" && (b /= y)), b === void 0 && r) return r.count < r.max && (we.warn("Variable '" + p + "' in " + r.name + " could not be found!"), b = o), r.count === r.max && we.warn("Too many " + r.name + " warnings - additional warnings will be suppressed"), r.count++, o; if (s) { var k; if (s[0] === ":" && (k = n ? n.numberFormat : we.numberFormat, b = k(s.replace(M_, ""))(b)), s[0] === "|") { k = n ? n.timeFormat : aW; var T = we.dateTime2ms(b); b = we.formatDate(T, s.replace(M_, ""), !1, k); } } else { var O = p + "Label"; t.hasOwnProperty(O) && (b = t[O]); } return g && (b = "(" + b + ")", (u || f) && (b = " " + b), (h || f) && (b = b + " ")), b; }); } var Bf = 48, S_ = 57; we.subplotSort = function(e, t) { for (var n = Math.min(e.length, t.length) + 1, r = 0, a = 0, i = 0; i < n; i++) { var o = e.charCodeAt(i) || 0, l = t.charCodeAt(i) || 0, s = o >= Bf && o <= S_, c = l >= Bf && l <= S_; if (s && (r = 10 * r + o - Bf), c && (a = 10 * a + l - Bf), !s || !c) { if (r !== a) return r - a; if (o !== l) return o - l; } } return a - r; }; var tc = 2e9; we.seedPseudoRandom = function() { tc = 2e9; }; we.pseudoRandom = function() { var e = tc; return tc = (69069 * tc + 1) % 4294967296, Math.abs(tc - e) < 429496729 ? we.pseudoRandom() : tc / 4294967296; }; we.fillText = function(e, t, n) { var r = Array.isArray(n) ? function(o) { n.push(o); } : function(o) { n.text = o; }, a = we.extractOption(e, t, "htx", "hovertext"); if (we.isValidTextValue(a)) return r(a); var i = we.extractOption(e, t, "tx", "text"); if (we.isValidTextValue(i)) return r(i); }; we.isValidTextValue = function(e) { return e || e === 0; }; we.formatPercent = function(e, t) { t = t || 0; for (var n = (Math.round(100 * e * Math.pow(10, t)) * Math.pow(0.1, t)).toFixed(t) + "%", r = 0; r < t; r++) n.indexOf(".") !== -1 && (n = n.replace("0%", "%"), n = n.replace(".%", "%")); return n; }; we.isHidden = function(e) { var t = window.getComputedStyle(e).display; return !t || t === "none"; }; we.strTranslate = function(e, t) { return e || t ? "translate(" + e + "," + t + ")" : ""; }; we.strRotate = function(e) { return e ? "rotate(" + e + ")" : ""; }; we.strScale = function(e) { return e !== 1 ? "scale(" + e + ")" : ""; }; we.getTextTransform = function(e) { var t = e.noCenter, n = e.textX, r = e.textY, a = e.targetX, i = e.targetY, o = e.anchorX || 0, l = e.anchorY || 0, s = e.rotate, c = e.scale; return c ? c > 1 && (c = 1) : c = 0, we.strTranslate( a - c * (n + o), i - c * (r + l) ) + we.strScale(c) + (s ? "rotate(" + s + (t ? "" : " " + n + " " + r) + ")" : ""); }; we.setTransormAndDisplay = function(e, t) { e.attr("transform", we.getTextTransform(t)), e.style("display", t.scale ? null : "none"); }; we.ensureUniformFontSize = function(e, t) { var n = we.extendFlat({}, t); return n.size = Math.max( t.size, e._fullLayout.uniformtext.minsize || 0 ), n; }; we.join2 = function(e, t, n) { var r = e.length; return r > 1 ? e.slice(0, -1).join(t) + n + e[r - 1] : e.join(t); }; we.bigFont = function(e) { return Math.round(1.2 * e); }; var C_ = we.getFirefoxVersion(), yW = C_ !== null && C_ < 86; we.getPositionFromD3Event = function() { return yW ? [ Wu.event.layerX, Wu.event.layerY ] : [ Wu.event.offsetX, Wu.event.offsetY ]; }; var Ue = a4.exports, xW = Ue, L_ = { "X,X div": 'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;', "X input,X button": 'font-family:"Open Sans",verdana,arial,sans-serif;', "X input:focus,X button:focus": "outline:none;", "X a": "text-decoration:none;", "X a:hover": "text-decoration:none;", "X .crisp": "shape-rendering:crispEdges;", "X .user-select-none": "-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;", "X svg": "overflow:hidden;", "X svg a": "fill:#447adb;", "X svg a:hover": "fill:#3c6dc5;", "X .main-svg": "position:absolute;top:0;left:0;pointer-events:none;", "X .main-svg .draglayer": "pointer-events:all;", "X .cursor-default": "cursor:default;", "X .cursor-pointer": "cursor:pointer;", "X .cursor-crosshair": "cursor:crosshair;", "X .cursor-move": "cursor:move;", "X .cursor-col-resize": "cursor:col-resize;", "X .cursor-row-resize": "cursor:row-resize;", "X .cursor-ns-resize": "cursor:ns-resize;", "X .cursor-ew-resize": "cursor:ew-resize;", "X .cursor-sw-resize": "cursor:sw-resize;", "X .cursor-s-resize": "cursor:s-resize;", "X .cursor-se-resize": "cursor:se-resize;", "X .cursor-w-resize": "cursor:w-resize;", "X .cursor-e-resize": "cursor:e-resize;", "X .cursor-nw-resize": "cursor:nw-resize;", "X .cursor-n-resize": "cursor:n-resize;", "X .cursor-ne-resize": "cursor:ne-resize;", "X .cursor-grab": "cursor:-webkit-grab;cursor:grab;", "X .modebar": "position:absolute;top:2px;right:2px;", "X .ease-bg": "-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;", "X .modebar--hover>:not(.watermark)": "opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;", "X:hover .modebar--hover .modebar-group": "opacity:1;", "X .modebar-group": "float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;", "X .modebar-btn": "position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;", "X .modebar-btn svg": "position:relative;top:2px;", "X .modebar.vertical": "display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;", "X .modebar.vertical svg": "top:-1px;", "X .modebar.vertical .modebar-group": "display:block;float:none;padding-left:0px;padding-bottom:8px;", "X .modebar.vertical .modebar-group .modebar-btn": "display:block;text-align:center;", "X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;", "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;", "X [data-title]:before": 'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;', "X [data-title]:after": "content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;", "X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;", "X .vertical [data-title]:before": "border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;", Y: 'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;', "Y p": "margin:0;", "Y .notifier-note": "min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;", "Y .notifier-close": "color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;", "Y .notifier-close:hover": "color:#444;text-decoration:none;cursor:pointer;" }; for (var O_ in L_) { var bW = O_.replace(/^,/, " ,").replace(/X/g, ".js-plotly-plot .plotly").replace(/Y/g, ".plotly-notifier"); xW.addStyleRule(bW, L_[O_]); } var Bn = {}, nx = {}, wW = !0, _W = wW, iy; typeof gd.matchMedia == "function" ? iy = !gd.matchMedia("(hover: none)").matches : iy = _W; var jC = iy, rx = { exports: {} }, vc = typeof Reflect == "object" ? Reflect : null, D_ = vc && typeof vc.apply == "function" ? vc.apply : function(e, t, n) { return Function.prototype.apply.call(e, t, n); }, Ih; vc && typeof vc.ownKeys == "function" ? Ih = vc.ownKeys : Object.getOwnPropertySymbols ? Ih = function(e) { return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)); } : Ih = function(e) { return Object.getOwnPropertyNames(e); }; function kW(e) { console && console.warn && console.warn(e); } var PC = Number.isNaN || function(e) { return e !== e; }; function Nn() { Nn.init.call(this); } rx.exports = Nn; rx.exports.once = SW; Nn.EventEmitter = Nn; Nn.prototype._events = void 0; Nn.prototype._eventsCount = 0; Nn.prototype._maxListeners = void 0; var F_ = 10; function b0(e) { if (typeof e != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e); } Object.defineProperty(Nn, "defaultMaxListeners", { enumerable: !0, get: function() { return F_; }, set: function(e) { if (typeof e != "number" || e < 0 || PC(e)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e + "."); F_ = e; } }); Nn.init = function() { (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; }; Nn.prototype.setMaxListeners = function(e) { if (typeof e != "number" || e < 0 || PC(e)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + "."); return this._maxListeners = e, this; }; function RC(e) { return e._maxListeners === void 0 ? Nn.defaultMaxListeners : e._maxListeners; } Nn.prototype.getMaxListeners = function() { return RC(this); }; Nn.prototype.emit = function(e) { for (var t = [], n = 1; n < arguments.length; n++) t.push(arguments[n]); var r = e === "error", a = this._events; if (a !== void 0) r = r && a.error === void 0; else if (!r) return !1; if (r) { var i; if (t.length > 0 && (i = t[0]), i instanceof Error) throw i; var o = new Error("Unhandled error." + (i ? " (" + i.message + ")" : "")); throw o.context = i, o; } var l = a[e]; if (l === void 0) return !1; if (typeof l == "function") D_(l, this, t); else for (var s = l.length, c = qC(l, s), n = 0; n < s; ++n) D_(c[n], this, t); return !0; }; function NC(e, t, n, r) { var a, i, o; if (b0(n), i = e._events, i === void 0 ? (i = e._events = /* @__PURE__ */ Object.create(null), e._eventsCount = 0) : (i.newListener !== void 0 && (e.emit( "newListener", t, n.listener ? n.listener : n ), i = e._events), o = i[t]), o === void 0) o = i[t] = n, ++e._eventsCount; else if (typeof o == "function" ? o = i[t] = r ? [n, o] : [o, n] : r ? o.unshift(n) : o.push(n), a = RC(e), a > 0 && o.length > a && !o.warned) { o.warned = !0; var l = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit"); l.name = "MaxListenersExceededWarning", l.emitter = e, l.type = t, l.count = o.length, kW(l); } return e; } Nn.prototype.addListener = function(e, t) { return NC(this, e, t, !1); }; Nn.prototype.on = Nn.prototype.addListener; Nn.prototype.prependListener = function(e, t) { return NC(this, e, t, !0); }; function TW() { if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); } function BC(e, t, n) { var r = { fired: !1, wrapFn: void 0, target: e, type: t, listener: n }, a = TW.bind(r); return a.listener = n, r.wrapFn = a, a; } Nn.prototype.once = function(e, t) { return b0(t), this.on(e, BC(this, e, t)), this; }; Nn.prototype.prependOnceListener = function(e, t) { return b0(t), this.prependListener(e, BC(this, e, t)), this; }; Nn.prototype.removeListener = function(e, t) { var n, r, a, i, o; if (b0(t), r = this._events, r === void 0) return this; if (n = r[e], n === void 0) return this; if (n === t || n.listener === t) --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete r[e], r.removeListener && this.emit("removeListener", e, n.listener || t)); else if (typeof n != "function") { for (a = -1, i = n.length - 1; i >= 0; i--) if (n[i] === t || n[i].listener === t) { o = n[i].listener, a = i; break; } if (a < 0) return this; a === 0 ? n.shift() : AW(n, a), n.length === 1 && (r[e] = n[0]), r.removeListener !== void 0 && this.emit("removeListener", e, o || t); } return this; }; Nn.prototype.off = Nn.prototype.removeListener; Nn.prototype.removeAllListeners = function(e) { var t, n, r; if (n = this._events, n === void 0) return this; if (n.removeListener === void 0) return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : n[e] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete n[e]), this; if (arguments.length === 0) { var a = Object.keys(n), i; for (r = 0; r < a.length; ++r) i = a[r], i !== "removeListener" && this.removeAllListeners(i); return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; } if (t = n[e], typeof t == "function") this.removeListener(e, t); else if (t !== void 0) for (r = t.length - 1; r >= 0; r--) this.removeListener(e, t[r]); return this; }; function HC(e, t, n) { var r = e._events; if (r === void 0) return []; var a = r[t]; return a === void 0 ? [] : typeof a == "function" ? n ? [a.listener || a] : [a] : n ? MW(a) : qC(a, a.length); } Nn.prototype.listeners = function(e) { return HC(this, e, !0); }; Nn.prototype.rawListeners = function(e) { return HC(this, e, !1); }; Nn.listenerCount = function(e, t) { return typeof e.listenerCount == "function" ? e.listenerCount(t) : VC.call(e, t); }; Nn.prototype.listenerCount = VC; function VC(e) { var t = this._events; if (t !== void 0) { var n = t[e]; if (typeof n == "function") return 1; if (n !== void 0) return n.length; } return 0; } Nn.prototype.eventNames = function() { return this._eventsCount > 0 ? Ih(this._events) : []; }; function qC(e, t) { for (var n = new Array(t), r = 0; r < t; ++r) n[r] = e[r]; return n; } function AW(e, t) { for (; t + 1 < e.length; t++) e[t] = e[t + 1]; e.pop(); } function MW(e) { for (var t = new Array(e.length), n = 0; n < t.length; ++n) t[n] = e[n].listener || e[n]; return t; } function SW(e, t) { return new Promise(function(n, r) { function a(o) { e.removeListener(t, i), r(o); } function i() { typeof e.removeListener == "function" && e.removeListener("error", a), n([].slice.call(arguments)); } UC(e, t, i, { once: !0 }), t !== "error" && CW(e, a, { once: !0 }); }); } function CW(e, t, n) { typeof e.on == "function" && UC(e, "error", t, n); } function UC(e, t, n, r) { if (typeof e.on == "function") r.once ? e.once(t, n) : e.on(t, n); else if (typeof e.addEventListener == "function") e.addEventListener(t, function a(i) { r.once && e.removeEventListener(t, a), n(i); }); else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e); } var ax = rx.exports, Yg = ax.EventEmitter, LW = { init: function(e) { if (e._ev instanceof Yg) return e; var t = new Yg(), n = new Yg(); return e._ev = t, e._internalEv = n, e.on = t.on.bind(t), e.once = t.once.bind(t), e.removeListener = t.removeListener.bind(t), e.removeAllListeners = t.removeAllListeners.bind(t), e._internalOn = n.on.bind(n), e._internalOnce = n.once.bind(n), e._removeInternalListener = n.removeListener.bind(n), e._removeAllInternalListeners = n.removeAllListeners.bind(n), e.emit = function(r, a) { typeof jQuery < "u" && jQuery(e).trigger(r, a), t.emit(r, a), n.emit(r, a); }, e; }, /* * This function behaves like jQuery's triggerHandler. It calls * all handlers for a particular event and returns the return value * of the LAST handler. This function also triggers jQuery's * triggerHandler for backwards compatibility. */ triggerHandler: function(e, t, n) { var r, a; typeof jQuery < "u" && (r = jQuery(e).triggerHandler(t, n)); var i = e._ev; if (!i) return r; var o = i._events[t]; if (!o) return r; function l(c) { if (c.listener) { if (i.removeListener(t, c.listener), !c.fired) return c.fired = !0, c.listener.apply(i, [n]); } else return c.apply(i, [n]); } o = Array.isArray(o) ? o : [o]; var s; for (s = 0; s < o.length - 1; s++) l(o[s]); return a = l(o[s]), r !== void 0 ? r : a; }, purge: function(e) { return delete e._ev, delete e.on, delete e.once, delete e.removeListener, delete e.removeAllListeners, delete e.emit, delete e._ev, delete e._internalEv, delete e._internalOn, delete e._internalOnce, delete e._removeInternalListener, delete e._removeAllInternalListeners, e; } }, w0 = LW, I_ = Ue, OW = Yc.dfltConfig; function DW(e, t) { for (var n = [], r, a = 0; a < t.length; a++) r = t[a], r === e ? n[a] = r : typeof r == "object" ? n[a] = Array.isArray(r) ? I_.extendDeep([], r) : I_.extendDeepAll({}, r) : n[a] = r; return n; } var To = {}; To.add = function(e, t, n, r, a) { var i, o; if (e.undoQueue = e.undoQueue || { index: 0, queue: [], sequence: !1 }, o = e.undoQueue.index, e.autoplay) { e.undoQueue.inSequence || (e.autoplay = !1); return; } !e.undoQueue.sequence || e.undoQueue.beginSequence ? (i = { undo: { calls: [], args: [] }, redo: { calls: [], args: [] } }, e.undoQueue.queue.splice(o, e.undoQueue.queue.length - o, i), e.undoQueue.index += 1) : i = e.undoQueue.queue[o - 1], e.undoQueue.beginSequence = !1, i && (i.undo.calls.unshift(t), i.undo.args.unshift(n), i.redo.calls.push(r), i.redo.args.push(a)), e.undoQueue.queue.length > OW.queueLength && (e.undoQueue.queue.shift(), e.undoQueue.index--); }; To.startSequence = function(e) { e.undoQueue = e.undoQueue || { index: 0, queue: [], sequence: !1 }, e.undoQueue.sequence = !0, e.undoQueue.beginSequence = !0; }; To.stopSequence = function(e) { e.undoQueue = e.undoQueue || { index: 0, queue: [], sequence: !1 }, e.undoQueue.sequence = !1, e.undoQueue.beginSequence = !1; }; To.undo = function(e) { var t, n; if (!(e.undoQueue === void 0 || isNaN(e.undoQueue.index) || e.undoQueue.index <= 0)) { for (e.undoQueue.index--, t = e.undoQueue.queue[e.undoQueue.index], e.undoQueue.inSequence = !0, n = 0; n < t.undo.calls.length; n++) To.plotDo(e, t.undo.calls[n], t.undo.args[n]); e.undoQueue.inSequence = !1, e.autoplay = !1; } }; To.redo = function(e) { var t, n; if (!(e.undoQueue === void 0 || isNaN(e.undoQueue.index) || e.undoQueue.index >= e.undoQueue.queue.length)) { for (t = e.undoQueue.queue[e.undoQueue.index], e.undoQueue.inSequence = !0, n = 0; n < t.redo.calls.length; n++) To.plotDo(e, t.redo.calls[n], t.redo.args[n]); e.undoQueue.inSequence = !1, e.autoplay = !1, e.undoQueue.index++; } }; To.plotDo = function(e, t, n) { e.autoplay = !0, n = DW(e, n), t.apply(null, n); }; var FW = To, Qc = {}, GC = { _isLinkedToArray: "frames_entry", group: { valType: "string", description: [ "An identifier that specifies the group to which the frame belongs,", "used by animate to select a subset of frames." ].join(" ") }, name: { valType: "string", description: "A label by which to identify the frame" }, traces: { valType: "any", description: [ "A list of trace indices that identify the respective traces in the", "data attribute" ].join(" ") }, baseframe: { valType: "string", description: [ "The name of the frame into which this frame's properties are merged", "before applying. This is used to unify properties and avoid needing", "to specify the same values for the same properties in multiple frames." ].join(" ") }, data: { valType: "any", description: [ "A list of traces this frame modifies. The format is identical to the", "normal trace definition." ].join(" ") }, layout: { valType: "any", description: [ "Layout properties which this frame modifies. The format is identical", "to the normal layout definition." ].join(" ") } }; (function(e) { var t = Rt, n = Ue, r = Zi, a = $d, i = GC, o = h0, l = Yc.configAttributes, s = Lo, c = n.extendDeepAll, u = n.isPlainObject, f = n.isArrayOrTypedArray, h = n.nestedProperty, g = n.valObjectMeta, p = "_isSubplotObj", v = "_isLinkedToArray", y = "_arrayAttrRegexps", m = "_deprecated", b = [p, v, y, m]; e.IS_SUBPLOT_OBJ = p, e.IS_LINKED_TO_ARRAY = v, e.DEPRECATED = m, e.UNDERSCORE_ATTRS = b, e.get = function() { var U = {}; t.allTypes.forEach(function(z) { U[z] = T(z); }); var E = {}; return Object.keys(t.transformsRegistry).forEach(function(z) { E[z] = M(z); }), { defs: { valObjects: g, metaKeys: b.concat(["description", "role", "editType", "impliedEdits"]), editType: { traces: s.traces, layout: s.layout }, impliedEdits: { description: [ "Sometimes when an attribute is changed, other attributes", "must be altered as well in order to achieve the intended", "result. For example, when `range` is specified, it is", "important to set `autorange` to `false` or the new `range`", "value would be lost in the redraw. `impliedEdits` is the", "mechanism to do this: `impliedEdits: {autorange: false}`.", "Each key is a relative paths to the attribute string to", "change, using *^* to ascend into the parent container,", "for example `range[0]` has `impliedEdits: {*^autorange*: false}`.", "A value of `undefined` means that the attribute will not be", "changed, but its previous value should be recorded in case", "we want to reverse this change later. For example, `autorange`", "has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined}", "because the range will likely be changed by redraw." ].join(" ") } }, traces: U, layout: O(), transforms: E, frames: C(), animation: I(o), config: I(l) }; }, e.crawl = function(U, E, z, F) { var q = z || 0; F = F || "", Object.keys(U).forEach(function(H) { var K = U[H]; if (b.indexOf(H) === -1) { var Q = (F ? F + "." : "") + H; E(K, H, U, q, Q), !e.isValObject(K) && u(K) && H !== "impliedEdits" && e.crawl(K, E, q + 1, Q); } }); }, e.isValObject = function(U) { return U && U.valType !== void 0; }, e.findArrayAttributes = function(U) { var E = [], z = [], F = [], q, H; function K(B, G, Z, oe) { z = z.slice(0, oe).concat([G]), F = F.slice(0, oe).concat([B && B._isLinkedToArray]); var ae = B && (B.valType === "data_array" || B.arrayOk === !0) && !(z[oe - 1] === "colorbar" && (G === "ticktext" || G === "tickvals")); ae && Q(q, 0, ""); } function Q(B, G, Z) { var oe = B[z[G]], ae = Z + z[G]; if (G === z.length - 1) f(oe) && E.push(H + ae); else if (F[G]) { if (Array.isArray(oe)) for (var ge = 0; ge < oe.length; ge++) u(oe[ge]) && Q(oe[ge], G + 1, ae + "[" + ge + "]."); } else u(oe) && Q(oe, G + 1, ae + "."); } q = U, H = "", e.crawl(r, K), U._module && U._module.attributes && e.crawl(U._module.attributes, K); var re = U.transforms; if (re) for (var te = 0; te < re.length; te++) { var X = re[te], ce = X._module; ce && (H = "transforms[" + te + "].", q = X, e.crawl(ce.attributes, K)); } return E; }, e.getTraceValObject = function(U, E) { var z = E[0], F = 1, q, H; if (z === "transforms") { if (E.length === 1) return r.transforms; var K = U.transforms; if (!Array.isArray(K) || !K.length) return !1; var Q = E[1]; if (!k(Q) || Q >= K.length) return !1; q = (t.transformsRegistry[K[Q].type] || {}).attributes, H = q && q[E[2]], F = 3; } else { var re = U._module; if (re || (re = (t.modules[U.type || r.type.dflt] || {})._module), !re) return !1; if (q = re.attributes, H = q && q[z], !H) { var te = re.basePlotModule; te && te.attributes && (H = te.attributes[z]); } H || (H = r[z]); } return _(H, E, F); }, e.getLayoutValObject = function(U, E) { var z = w(U, E[0]); return _(z, E, 1); }; function w(U, E) { var z, F, q, H, K = U._basePlotModules; if (K) { var Q; for (z = 0; z < K.length; z++) { if (q = K[z], q.attrRegex && q.attrRegex.test(E)) { if (q.layoutAttrOverrides) return q.layoutAttrOverrides; !Q && q.layoutAttributes && (Q = q.layoutAttributes); } var re = q.baseLayoutAttrOverrides; if (re && E in re) return re[E]; } if (Q) return Q; } var te = U._modules; if (te) { for (z = 0; z < te.length; z++) if (H = te[z].layoutAttributes, H && E in H) return H[E]; } for (F in t.componentsRegistry) { if (q = t.componentsRegistry[F], q.name === "colorscale" && E.indexOf("coloraxis") === 0) return q.layoutAttributes[E]; if (!q.schema && E === q.name) return q.layoutAttributes; } return E in a ? a[E] : !1; } function _(U, E, z) { if (!U) return !1; if (U._isLinkedToArray) { if (k(E[z])) z++; else if (z < E.length) return !1; } for (; z < E.length; z++) { var F = U[E[z]]; if (u(F)) U = F; else break; if (z === E.length - 1) break; if (U._isLinkedToArray) { if (z++, !k(E[z])) return !1; } else if (U.valType === "info_array") { z++; var q = E[z]; if (!k(q)) return !1; var H = U.items; if (Array.isArray(H)) { if (q >= H.length) return !1; if (U.dimensions === 2) { if (z++, E.length === z) return U; var K = E[z]; if (!k(K)) return !1; U = H[q][K]; } else U = H[q]; } else U = H; } } return U; } function k(U) { return U === Math.round(U) && U >= 0; } function T(U) { var E, z; E = t.modules[U]._module, z = E.basePlotModule; var F = {}; F.type = null; var q = c({}, r), H = c({}, E.attributes); e.crawl(H, function(re, te, X, ce, B) { h(q, B).set(void 0), re === void 0 && h(H, B).set(void 0); }), c(F, q), t.traceIs(U, "noOpacity") && delete F.opacity, t.traceIs(U, "showLegend") || (delete F.showlegend, delete F.legendgroup), t.traceIs(U, "noHover") && (delete F.hoverinfo, delete F.hoverlabel), E.selectPoints || delete F.selectedpoints, c(F, H), z.attributes && c(F, z.attributes), F.type = U; var K = { meta: E.meta || {}, categories: E.categories || {}, animatable: !!E.animatable, type: U, attributes: I(F) }; if (E.layoutAttributes) { var Q = {}; c(Q, E.layoutAttributes), K.layoutAttributes = I(Q); } return E.animatable || e.crawl(K, function(re) { e.isValObject(re) && "anim" in re && delete re.anim; }), K; } function O() { var U = {}, E, z; c(U, a); for (E in t.subplotsRegistry) if (z = t.subplotsRegistry[E], !!z.layoutAttributes) if (Array.isArray(z.attr)) for (var F = 0; F < z.attr.length; F++) W(U, z, z.attr[F]); else { var q = z.attr === "subplot" ? z.name : z.attr; W(U, z, q); } for (E in t.componentsRegistry) { z = t.componentsRegistry[E]; var H = z.schema; if (H && (H.subplots || H.layout)) { var K = H.subplots; if (K && K.xaxis && !K.yaxis) for (var Q in K.xaxis) delete U.yaxis[Q]; delete U.xaxis.shift, delete U.xaxis.autoshift; } else z.name === "colorscale" ? c(U, z.layoutAttributes) : z.layoutAttributes && J(U, z.layoutAttributes, z.name); } return { layoutAttributes: I(U) }; } function M(U) { var E = t.transformsRegistry[U], z = c({}, E.attributes); return Object.keys(t.componentsRegistry).forEach(function(F) { var q = t.componentsRegistry[F]; q.schema && q.schema.transforms && q.schema.transforms[U] && Object.keys(q.schema.transforms[U]).forEach(function(H) { J(z, q.schema.transforms[U][H], H); }); }), { attributes: I(z) }; } function C() { var U = { frames: c({}, i) }; return I(U), U.frames; } function I(U) { return j(U), P(U), N(U), U; } function j(U) { function E(F) { return { valType: "string", description: "Sets the source reference on Chart Studio Cloud for `" + F + "`.", editType: "none" }; } function z(F, q, H) { e.isValObject(F) ? (F.arrayOk === !0 || F.valType === "data_array") && (H[q + "src"] = E(q)) : u(F) && (F.role = "object"); } e.crawl(U, z); } function P(U) { function E(z, F, q) { if (z) { var H = z[v]; H && (delete z[v], q[F] = { items: {} }, q[F].items[H] = z, q[F].role = "object"); } } e.crawl(U, E); } function N(U) { function E(z) { for (var F in z) if (u(z[F])) E(z[F]); else if (Array.isArray(z[F])) for (var q = 0; q < z[F].length; q++) E(z[F][q]); else z[F] instanceof RegExp && (z[F] = z[F].toString()); } E(U); } function W(U, E, z) { var F = h(U, z), q = c({}, E.layoutAttributes); q[p] = !0, F.set(q); } function J(U, E, z) { var F = h(U, z); F.set(c(F.get() || {}, E)); } })(Qc); var WC = { exports: {} }, Sn = {}, mc = Ue, IW = Zi, nl = "templateitemname", oy = { name: { valType: "string", editType: "none", description: [ "When used in a template, named items are created in the output figure", "in addition to any items the figure already has in this array.", "You can modify these items in the output figure by making your own", "item with `templateitemname` matching this `name`", "alongside your modifications (including `visible: false` or", "`enabled: false` to hide it).", "Has no effect outside of a template." ].join(" ") } }; oy[nl] = { valType: "string", editType: "calc", description: [ "Used to refer to a named item in this array in the template. Named", "items from the template will be created even without a matching item", "in the input figure, but you can modify one by making an item with", "`templateitemname` matching its `name`, alongside your modifications", "(including `visible: false` or `enabled: false` to hide it).", "If there is no template or no matching item, this item will be", "hidden unless you explicitly show it with `visible: true`." ].join(" ") }; Sn.templatedArray = function(e, t) { return t._isLinkedToArray = e, t.name = oy.name, t[nl] = oy[nl], t; }; Sn.traceTemplater = function(e) { var t = {}, n, r; for (n in e) r = e[n], Array.isArray(r) && r.length && (t[n] = 0); function a(i) { n = mc.coerce(i, {}, IW, "type"); var o = { type: n, _template: null }; if (n in t) { r = e[n]; var l = t[n] % r.length; t[n]++, o._template = r[l]; } return o; } return { newTrace: a // TODO: function to figure out what's left & what didn't work }; }; Sn.newContainer = function(e, t, n) { var r = e._template, a = r && (r[t] || n && r[n]); mc.isPlainObject(a) || (a = null); var i = e[t] = { _template: a }; return i; }; Sn.arrayTemplater = function(e, t, n) { var r = e._template, a = r && r[ZC(t)], i = r && r[t]; (!Array.isArray(i) || !i.length) && (i = []); var o = {}; function l(c) { var u = { name: c.name, _input: c }, f = u[nl] = c[nl]; if (!z_(f)) return u._template = a, u; for (var h = 0; h < i.length; h++) { var g = i[h]; if (g.name === f) return o[f] = 1, u._template = g, u; } return u[n] = c[n] || !1, u._template = !1, u; } function s() { for (var c = [], u = 0; u < i.length; u++) { var f = i[u], h = f.name; if (z_(h) && !o[h]) { var g = { _template: f, name: h, _input: { _templateitemname: h } }; g[nl] = f[nl], c.push(g), o[h] = 1; } } return c; } return { newItem: l, defaultItems: s }; }; function z_(e) { return e && typeof e == "string"; } function ZC(e) { var t = e.length - 1; return e.charAt(t) !== "s" && mc.warn("bad argument to arrayDefaultKey: " + e), e.substr(0, e.length - 1) + "defaults"; } Sn.arrayDefaultKey = ZC; Sn.arrayEditor = function(e, t, n) { var r = (mc.nestedProperty(e, t).get() || []).length, a = n._index, i = a >= r && (n._input || {})._templateitemname; i && (a = r); var o = t + "[" + a + "]", l; function s() { l = {}, i && (l[o] = {}, l[o][nl] = i); } s(); function c(g, p) { l[g] = p; } function u(g, p) { i ? mc.nestedProperty(l[o], g).set(p) : l[o + "." + g] = p; } function f() { var g = l; return s(), g; } function h(g, p) { g && u(g, p); var v = f(); for (var y in v) mc.nestedProperty(e, y).set(v[y]); } return { modifyBase: c, modifyItem: u, getUpdateObj: f, applyUpdate: h }; }; var mr = {}, wu = Zc.counter, $r = { idRegex: { x: wu("x", "( domain)?"), y: wu("y", "( domain)?") }, attrRegex: wu("[xy]axis"), // axis match regular expression xAxisMatch: wu("xaxis"), yAxisMatch: wu("yaxis"), // pattern matching axis ids and names // note that this is more permissive than counterRegex, as // id2name, name2id, and cleanId accept "x1" etc AX_ID_PATTERN: /^[xyz][0-9]*( domain)?$/, AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/, // and for 2D subplots SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/, HOUR_PATTERN: "hour", WEEKDAY_PATTERN: "day of week", // pixels to move mouse before you stop clamping to starting point MINDRAG: 8, // smallest dimension allowed for a zoombox MINZOOM: 20, // width of axis drag regions DRAGGERSIZE: 20, // delay before a redraw (relayout) after smooth panning and zooming REDRAWDELAY: 50, // last resort axis ranges for x and y axes if we have no data DFLTRANGEX: [-1, 6], DFLTRANGEY: [-1, 4], // Layers to keep trace types in the right order // N.B. each 'unique' plot method must have its own layer traceLayerClasses: [ "imagelayer", "heatmaplayer", "contourcarpetlayer", "contourlayer", "funnellayer", "waterfalllayer", "barlayer", "carpetlayer", "violinlayer", "boxlayer", "ohlclayer", "scattercarpetlayer", "scatterlayer" ], clipOnAxisFalseQuery: [ ".scatterlayer", ".barlayer", ".funnellayer", ".waterfalllayer" ], layerValue2layerClass: { "above traces": "above", "below traces": "below" } }; (function(e) { var t = Rt, n = $r; e.id2name = function(a) { if (!(typeof a != "string" || !a.match(n.AX_ID_PATTERN))) { var i = a.split(" ")[0].substr(1); return i === "1" && (i = ""), a.charAt(0) + "axis" + i; } }, e.name2id = function(a) { if (a.match(n.AX_NAME_PATTERN)) { var i = a.substr(5); return i === "1" && (i = ""), a.charAt(0) + i; } }, e.cleanId = function(a, i, o) { var l = /( domain)$/.test(a); if (!(typeof a != "string" || !a.match(n.AX_ID_PATTERN)) && !(i && a.charAt(0) !== i) && !(l && !o)) { var s = a.split(" ")[0].substr(1).replace(/^0+/, ""); return s === "1" && (s = ""), a.charAt(0) + s + (l && o ? " domain" : ""); } }, e.list = function(a, i, o) { var l = a._fullLayout; if (!l) return []; var s = e.listIds(a, i), c = new Array(s.length), u; for (u = 0; u < s.length; u++) { var f = s[u]; c[u] = l[f.charAt(0) + "axis" + f.substr(1)]; } if (!o) { var h = l._subplots.gl3d || []; for (u = 0; u < h.length; u++) { var g = l[h[u]]; i ? c.push(g[i + "axis"]) : c.push(g.xaxis, g.yaxis, g.zaxis); } } return c; }, e.listIds = function(a, i) { var o = a._fullLayout; if (!o) return []; var l = o._subplots; return i ? l[i + "axis"] : l.xaxis.concat(l.yaxis); }, e.getFromId = function(a, i, o) { var l = a._fullLayout; return i = i === void 0 || typeof i != "string" ? i : i.replace(" domain", ""), o === "x" ? i = i.replace(/y[0-9]*/, "") : o === "y" && (i = i.replace(/x[0-9]*/, "")), l[e.id2name(i)]; }, e.getFromTrace = function(a, i, o) { var l = a._fullLayout, s = null; if (t.traceIs(i, "gl3d")) { var c = i.scene; c.substr(0, 5) === "scene" && (s = l[c][o + "axis"]); } else s = e.getFromId(a, i[o + "axis"] || o); return s; }, e.idSort = function(a, i) { var o = a.charAt(0), l = i.charAt(0); return o !== l ? o > l ? 1 : -1 : +(a.substr(1) || 1) - +(i.substr(1) || 1); }, e.ref2id = function(a) { return /^[xyz]/.test(a) ? a.split(" ")[0] : !1; }; function r(a, i) { if (i && i.length) { for (var o = 0; o < i.length; o++) if (i[o][a]) return !0; } return !1; } e.isLinked = function(a, i) { return r(i, a._axisMatchGroups) || r(i, a._axisConstraintGroups); }; })(mr); function zW(e) { var t = e._fullLayout._zoomlayer; t && t.selectAll(".outline-controllers").remove(); } function EW(e) { var t = e._fullLayout._zoomlayer; t && t.selectAll(".select-outline").remove(), e._fullLayout._outlining = !1; } var xs = { clearOutlineControllers: zW, clearOutline: EW }, ix = { scattermode: { valType: "enumerated", values: ["group", "overlay"], dflt: "overlay", editType: "calc", description: [ "Determines how scatter points at the same location coordinate", "are displayed on the graph.", "With *group*, the scatter points are plotted next to one another", "centered around the shared location.", "With *overlay*, the scatter points are plotted over one another,", "you might need to reduce *opacity* to see multiple scatter points." ].join(" ") }, scattergap: { valType: "number", min: 0, max: 1, editType: "calc", description: [ "Sets the gap (in plot fraction) between scatter points of", "adjacent location coordinates.", "Defaults to `bargap`." ].join(" ") } }, Kd = {}, Xu = Rt, jW = $r.SUBPLOT_PATTERN; Kd.getSubplotCalcData = function(e, t, n) { var r = Xu.subplotsRegistry[t]; if (!r) return []; for (var a = r.attr, i = [], o = 0; o < e.length; o++) { var l = e[o], s = l[0].trace; s[a] === n && i.push(l); } return i; }; Kd.getModuleCalcData = function(e, t) { var n = [], r = [], a; if (typeof t == "string" ? a = Xu.getModule(t).plot : typeof t == "function" ? a = t : a = t.plot, !a) return [n, e]; for (var i = 0; i < e.length; i++) { var o = e[i], l = o[0].trace; l.visible !== !0 || l._length === 0 || (l._module && l._module.plot === a ? n.push(o) : r.push(o)); } return [n, r]; }; Kd.getSubplotData = function(e, t, n) { if (!Xu.subplotsRegistry[t]) return []; var r = Xu.subplotsRegistry[t].attr, a = [], i, o, l; if (t === "gl2d") { var s = n.match(jW); o = "x" + s[1], l = "y" + s[2]; } for (var c = 0; c < e.length; c++) i = e[c], t === "gl2d" && Xu.traceIs(i, "gl2d") ? i[r[0]] === o && i[r[1]] === l && a.push(i) : i[r] === n && a.push(i); return a; }; var E_ = {}, j_; function PW() { return j_ || (j_ = 1, function(e) { var t = Rt, n = Ue; e.manageCommandObserver = function(s, c, u, f) { var h = {}, g = !0; c && c._commandObserver && (h = c._commandObserver), h.cache || (h.cache = {}), h.lookupTable = {}; var p = e.hasSimpleAPICommandBindings(s, u, h.lookupTable); if (c && c._commandObserver) { if (p) return h; if (c._commandObserver.remove) return c._commandObserver.remove(), c._commandObserver = null, h; } if (p) { r(s, p, h.cache), h.check = function() { if (g) { var m = r(s, p, h.cache); return m.changed && f && h.lookupTable[m.value] !== void 0 && (h.disable(), Promise.resolve(f({ value: m.value, type: p.type, prop: p.prop, traces: p.traces, index: h.lookupTable[m.value] })).then(h.enable, h.enable)), m.changed; } }; for (var v = [ "plotly_relayout", "plotly_redraw", "plotly_restyle", "plotly_update", "plotly_animatingframe", "plotly_afterplot" ], y = 0; y < v.length; y++) s._internalOn(v[y], h.check); h.remove = function() { for (var m = 0; m < v.length; m++) s._removeInternalListener(v[m], h.check); }; } else n.log("Unable to automatically bind plot updates to API command"), h.lookupTable = {}, h.remove = function() { }; return h.disable = function() { g = !1; }, h.enable = function() { g = !0; }, c && (c._commandObserver = h), h; }, e.hasSimpleAPICommandBindings = function(s, c, u) { var f, h = c.length, g; for (f = 0; f < h; f++) { var p, v = c[f], y = v.method, m = v.args; if (Array.isArray(m) || (m = []), !y) return !1; var b = e.computeAPICommandBindings(s, y, m); if (b.length !== 1) return !1; if (!g) g = b[0], Array.isArray(g.traces) && g.traces.sort(); else { if (p = b[0], p.type !== g.type || p.prop !== g.prop) return !1; if (Array.isArray(g.traces)) if (Array.isArray(p.traces)) { p.traces.sort(); for (var w = 0; w < g.traces.length; w++) if (g.traces[w] !== p.traces[w]) return !1; } else return !1; else if (p.prop !== g.prop) return !1; } p = b[0]; var _ = p.value; if (Array.isArray(_)) if (_.length === 1) _ = _[0]; else return !1; u && (u[_] = f); } return g; }; function r(s, c, u) { var f, h, g, p = !1; if (c.type === "data") f = s._fullData[c.traces !== null ? c.traces[0] : 0]; else if (c.type === "layout") f = s._fullLayout; else return !1; return h = n.nestedProperty(f, c.prop).get(), g = u[c.type] = u[c.type] || {}, g.hasOwnProperty(c.prop) && g[c.prop] !== h && (p = !0), g[c.prop] = h, { changed: p, value: h }; } e.executeAPICommand = function(s, c, u) { if (c === "skip") return Promise.resolve(); var f = t.apiMethodRegistry[c], h = [s]; Array.isArray(u) || (u = []); for (var g = 0; g < u.length; g++) h.push(u[g]); return f.apply(null, h).catch(function(p) { return n.warn("API call to Plotly." + c + " rejected.", p), Promise.reject(p); }); }, e.computeAPICommandBindings = function(s, c, u) { var f; switch (Array.isArray(u) || (u = []), c) { case "restyle": f = o(s, u); break; case "relayout": f = i(s, u); break; case "update": f = o(s, [u[0], u[2]]).concat(i(s, [u[1]])); break; case "animate": f = a(s, u); break; default: f = []; } return f; }; function a(s, c) { return Array.isArray(c[0]) && c[0].length === 1 && ["string", "number"].indexOf(typeof c[0][0]) !== -1 ? [{ type: "layout", prop: "_currentFrame", value: c[0][0].toString() }] : []; } function i(s, c) { var u = [], f = c[0], h = {}; if (typeof f == "string") h[f] = c[1]; else if (n.isPlainObject(f)) h = f; else return u; return l(h, function(g, p, v) { u.push({ type: "layout", prop: g, value: v }); }, "", 0), u; } function o(s, c) { var u, f, h, g, p = []; if (f = c[0], h = c[1], u = c[2], g = {}, typeof f == "string") g[f] = h; else if (n.isPlainObject(f)) g = f, u === void 0 && (u = h); else return p; return u === void 0 && (u = null), l(g, function(v, y, m) { var b, w; if (Array.isArray(m)) { w = m.slice(); var _ = Math.min(w.length, s.data.length); u && (_ = Math.min(_, u.length)), b = []; for (var k = 0; k < _; k++) b[k] = u ? u[k] : k; } else w = m, b = u ? u.slice() : null; if (b === null) Array.isArray(w) && (w = w[0]); else if (Array.isArray(b)) { if (!Array.isArray(w)) { var T = w; w = []; for (var O = 0; O < b.length; O++) w[O] = T; } w.length = Math.min(b.length, w.length); } p.push({ type: "data", prop: v, traces: b, value: w }); }, "", 0), p; } function l(s, c, u, f) { Object.keys(s).forEach(function(h) { var g = s[h]; if (h[0] !== "_") { var p = u + (f > 0 ? "." : "") + h; n.isPlainObject(g) ? l(g, c, p, f + 1) : c(p, h, g); } }); } }(E_)), E_; } var YC = sn, RW = xd.timeFormatLocale, NW = j4.formatLocale, ed = cn, BW = P4, pn = Rt, $C = Qc, HW = Sn, yt = Ue, KC = rn, P_ = er.BADNUM, oa = mr, VW = xs.clearOutline, qW = ix, ox = h0, UW = GC, GW = Kd.getModuleCalcData, ly = yt.relinkPrivateKeys, zs = yt._, ot = WC.exports = {}; yt.extendFlat(ot, pn); ot.attributes = Zi; ot.attributes.type.values = ot.allTypes; ot.fontAttrs = Fr; ot.layoutAttributes = $d; ot.fontWeight = "normal"; var _0 = ot.transformsRegistry, k0 = PW(); ot.executeAPICommand = k0.executeAPICommand; ot.computeAPICommandBindings = k0.computeAPICommandBindings; ot.manageCommandObserver = k0.manageCommandObserver; ot.hasSimpleAPICommandBindings = k0.hasSimpleAPICommandBindings; ot.redrawText = function(e) { return e = yt.getGraphDiv(e), new Promise(function(t) { setTimeout(function() { e._fullLayout && (pn.getComponentMethod("annotations", "draw")(e), pn.getComponentMethod("legend", "draw")(e), pn.getComponentMethod("colorbar", "draw")(e), t(ot.previousPromises(e))); }, 300); }); }; ot.resize = function(e) { e = yt.getGraphDiv(e); var t, n = new Promise(function(r, a) { (!e || yt.isHidden(e)) && a(new Error("Resize must be passed a displayed plot div element.")), e._redrawTimer && clearTimeout(e._redrawTimer), e._resolveResize && (t = e._resolveResize), e._resolveResize = r, e._redrawTimer = setTimeout(function() { if (!e.layout || e.layout.width && e.layout.height || yt.isHidden(e)) { r(e); return; } delete e.layout.width, delete e.layout.height; var i = e.changed; e.autoplay = !0, pn.call("relayout", e, { autosize: !0 }).then(function() { e.changed = i, e._resolveResize === r && (delete e._resolveResize, r(e)); }); }, 100); }); return t && t(n), n; }; ot.previousPromises = function(e) { if ((e._promises || []).length) return Promise.all(e._promises).then(function() { e._promises = []; }); }; ot.addLinks = function(e) { if (!(!e._context.showLink && !e._context.showSources)) { var t = e._fullLayout, n = yt.ensureSingle(t._paper, "text", "js-plot-link-container", function(s) { s.style({ "font-family": '"Open Sans", Arial, sans-serif', "font-size": "12px", fill: KC.defaultLine, "pointer-events": "all" }).each(function() { var c = YC.select(this); c.append("tspan").classed("js-link-to-tool", !0), c.append("tspan").classed("js-link-spacer", !0), c.append("tspan").classed("js-sourcelinks", !0); }); }), r = n.node(), a = { y: t._paper.attr("height") - 9 }; document.body.contains(r) && r.getComputedTextLength() >= t.width - 20 ? (a["text-anchor"] = "start", a.x = 5) : (a["text-anchor"] = "end", a.x = t._paper.attr("width") - 7), n.attr(a); var i = n.select(".js-link-to-tool"), o = n.select(".js-link-spacer"), l = n.select(".js-sourcelinks"); e._context.showSources && e._context.showSources(e), e._context.showLink && WW(e, i), o.text(i.text() && l.text() ? " - " : ""); } }; function WW(e, t) { t.text(""); var n = t.append("a").attr({ "xlink:xlink:href": "#", class: "link--impt link--embedview", "font-weight": "bold" }).text(e._context.linkText + " »"); if (e._context.sendData) n.on("click", function() { ot.sendDataToCloud(e); }); else { var r = window.location.pathname.split("/"), a = window.location.search; n.attr({ "xlink:xlink:show": "new", "xlink:xlink:href": "/" + r[2].split(".")[0] + "/" + r[1] + a }); } } ot.sendDataToCloud = function(e) { var t = (window.PLOTLYENV || {}).BASE_URL || e._context.plotlyServerURL; if (t) { e.emit("plotly_beforeexport"); var n = YC.select(e).append("div").attr("id", "hiddenform").style("display", "none"), r = n.append("form").attr({ action: t + "/external", method: "post", target: "_blank" }), a = r.append("input").attr({ type: "text", name: "data" }); return a.node().value = ot.graphJson(e, !1, "keepdata"), r.node().submit(), n.remove(), e.emit("plotly_afterexport"), !1; } }; var ZW = [ "days", "shortDays", "months", "shortMonths", "periods", "dateTime", "date", "time", "decimal", "thousands", "grouping", "currency" ], YW = [ "year", "month", "dayMonth", "dayMonthYear" ]; ot.supplyDefaults = function(e, t) { var n = t && t.skipUpdateCalc, r = e._fullLayout || {}; if (r._skipDefaults) { delete r._skipDefaults; return; } var a = e._fullLayout = {}, i = e.layout || {}, o = e._fullData || [], l = e._fullData = [], s = e.data || [], c = e.calcdata || [], u = e._context || {}, f; e._transitionData || ot.createTransitionData(e), a._dfltTitle = { plot: zs(e, "Click to enter Plot title"), x: zs(e, "Click to enter X axis title"), y: zs(e, "Click to enter Y axis title"), colorbar: zs(e, "Click to enter Colorscale title"), annotation: zs(e, "new text") }, a._traceWord = zs(e, "trace"); var h = R_(e, ZW); if (a._mapboxAccessToken = u.mapboxAccessToken, r._initialAutoSizeIsDone) { var g = r.width, p = r.height; ot.supplyLayoutGlobalDefaults(i, a, h), i.width || (a.width = g), i.height || (a.height = p), ot.sanitizeMargins(a); } else { ot.supplyLayoutGlobalDefaults(i, a, h); var v = !i.width || !i.height, y = a.autosize, m = u.autosizable, b = v && (y || m); b ? ot.plotAutoSize(e, i, a) : v && ot.sanitizeMargins(a), !y && v && (i.width = a.width, i.height = a.height); } a._d3locale = JW(h, a.separators), a._extraFormat = R_(e, YW), a._initialAutoSizeIsDone = !0, a._dataLength = s.length, a._modules = [], a._visibleModules = [], a._basePlotModules = []; var w = a._subplots = KW(), _ = a._splomAxes = { x: {}, y: {} }, k = a._splomSubplots = {}; a._splomGridDflt = {}, a._scatterStackOpts = {}, a._firstScatter = {}, a._alignmentOpts = {}, a._colorAxes = {}, a._requestRangeslider = {}, a._traceUids = $W(o, s), a._globalTransforms = (e._context || {}).globalTransforms, ot.supplyDataDefaults(s, l, i, a); var T = Object.keys(_.x), O = Object.keys(_.y); if (T.length > 1 && O.length > 1) { for (pn.getComponentMethod("grid", "sizeDefaults")(i, a), f = 0; f < T.length; f++) yt.pushUnique(w.xaxis, T[f]); for (f = 0; f < O.length; f++) yt.pushUnique(w.yaxis, O[f]); for (var M in k) yt.pushUnique(w.cartesian, M); } if (a._has = ot._hasPlotType.bind(a), o.length === l.length) for (f = 0; f < l.length; f++) ly(l[f], o[f]); ot.supplyLayoutModuleDefaults(i, a, l, e._transitionData); var C = a._visibleModules, I = []; for (f = 0; f < C.length; f++) { var j = C[f].crossTraceDefaults; j && yt.pushUnique(I, j); } for (f = 0; f < I.length; f++) I[f](l, a); a._hasOnlyLargeSploms = a._basePlotModules.length === 1 && a._basePlotModules[0].name === "splom" && T.length > 15 && O.length > 15 && a.shapes.length === 0 && a.images.length === 0, ot.linkSubplots(l, a, o, r), ot.cleanPlot(l, a, o, r); var P = !!(r._has && r._has("gl2d")), N = !!(a._has && a._has("gl2d")), W = !!(r._has && r._has("cartesian")), J = !!(a._has && a._has("cartesian")), U = W || P, E = J || N; U && !E ? r._bgLayer.remove() : E && !U && (a._shouldCreateBgLayer = !0), r._zoomlayer && !e._dragging && VW({ // mock old gd _fullLayout: r }), QW(l, a), ly(a, r), pn.getComponentMethod("colorscale", "crossTraceDefaults")(l, a), a._preGUI || (a._preGUI = {}), a._tracePreGUI || (a._tracePreGUI = {}); var z = a._tracePreGUI, F = {}, q; for (q in z) F[q] = "old"; for (f = 0; f < l.length; f++) q = l[f]._fullInput.uid, F[q] || (z[q] = {}), F[q] = "new"; for (q in F) F[q] === "old" && delete z[q]; QC(a), pn.getComponentMethod("rangeslider", "makeData")(a), !n && c.length === l.length && ot.supplyDefaultsUpdateCalc(c, l); }; ot.supplyDefaultsUpdateCalc = function(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n], a = (e[n] || [])[0]; if (a && a.trace) { var i = a.trace; if (i._hasCalcTransform) { var o = i._arrayAttrs, l, s, c; for (l = 0; l < o.length; l++) s = o[l], c = yt.nestedProperty(i, s).get().slice(), yt.nestedProperty(r, s).set(c); } a.trace = r; } } }; function $W(e, t) { var n = t.length, r = [], a, i; for (a = 0; a < e.length; a++) { var o = e[a]._fullInput; o !== i && r.push(o), i = o; } var l = r.length, s = new Array(n), c = {}; function u(g, p) { s[p] = g, c[g] = 1; } function f(g, p) { if (g && typeof g == "string" && !c[g]) return u(g, p), !0; } for (a = 0; a < n; a++) { var h = t[a].uid; typeof h == "number" && (h = String(h)), !f(h, a) && (a < l && f(r[a].uid, a) || u(yt.randstr(c), a)); } return s; } function KW() { var e = pn.collectableSubplotTypes, t = {}, n, r; if (!e) { e = []; var a = pn.subplotsRegistry; for (var i in a) { var o = a[i], l = o.attr; if (l && (e.push(i), Array.isArray(l))) for (r = 0; r < l.length; r++) yt.pushUnique(e, l[r]); } } for (n = 0; n < e.length; n++) t[e[n]] = []; return t; } function R_(e, t) { var n = e._context.locale; n || (n = "en-US"); var r = !1, a = {}; function i(f) { for (var h = !0, g = 0; g < t.length; g++) { var p = t[g]; a[p] || (f[p] ? a[p] = f[p] : h = !1); } h && (r = !0); } for (var o = 0; o < 2; o++) { for (var l = e._context.locales, s = 0; s < 2; s++) { var c = (l[n] || {}).format; if (c && (i(c), r)) break; l = pn.localeRegistry; } var u = n.split("-")[0]; if (r || u === n) break; n = u; } return r || i(pn.localeRegistry.en.format), a; } function JW(e, t) { return e.decimal = t.charAt(0), e.thousands = t.charAt(1), { numberFormat: function(n) { try { n = NW(e).format( yt.adjustFormat(n) ); } catch { return yt.warnBadFormat(n), yt.noFormat; } return n; }, timeFormat: RW(e).utcFormat }; } function QW(e, t) { var n, r = []; t.meta && (n = t._meta = { meta: t.meta, layout: { meta: t.meta } }); for (var a = 0; a < e.length; a++) { var i = e[a]; i.meta ? r[i.index] = i._meta = { meta: i.meta } : t.meta && (i._meta = { meta: t.meta }), t.meta && (i._meta.layout = { meta: t.meta }); } r.length && (n || (n = t._meta = {}), n.data = r); } ot.createTransitionData = function(e) { e._transitionData || (e._transitionData = {}), e._transitionData._frames || (e._transitionData._frames = []), e._transitionData._frameHash || (e._transitionData._frameHash = {}), e._transitionData._counter || (e._transitionData._counter = 0), e._transitionData._interruptCallbacks || (e._transitionData._interruptCallbacks = []); }; ot._hasPlotType = function(e) { var t, n = this._basePlotModules || []; for (t = 0; t < n.length; t++) if (n[t].name === e) return !0; var r = this._modules || []; for (t = 0; t < r.length; t++) { var a = r[t].name; if (a === e) return !0; var i = pn.modules[a]; if (i && i.categories[e]) return !0; } return !1; }; ot.cleanPlot = function(e, t, n, r) { var a, i, o = r._basePlotModules || []; for (a = 0; a < o.length; a++) { var l = o[a]; l.clean && l.clean(e, t, n, r); } var s = r._has && r._has("gl"), c = t._has && t._has("gl"); s && !c && r._glcontainer !== void 0 && (r._glcontainer.selectAll(".gl-canvas").remove(), r._glcontainer.selectAll(".no-webgl").remove(), r._glcanvas = null); var u = !!r._infolayer; e: for (a = 0; a < n.length; a++) { var f = n[a], h = f.uid; for (i = 0; i < e.length; i++) { var g = e[i]; if (h === g.uid) continue e; } u && r._infolayer.select(".cb" + h).remove(); } }; ot.linkSubplots = function(e, t, n, r) { var a, i, o = r._plots || {}, l = t._plots = {}, s = t._subplots, c = { _fullData: e, _fullLayout: t }, u = s.cartesian.concat(s.gl2d || []); for (a = 0; a < u.length; a++) { var f = u[a], h = o[f], g = oa.getFromId(c, f, "x"), p = oa.getFromId(c, f, "y"), v; for (h ? v = l[f] = h : (v = l[f] = {}, v.id = f), g._counterAxes.push(p._id), p._counterAxes.push(g._id), g._subplotsWith.push(f), p._subplotsWith.push(f), v.xaxis = g, v.yaxis = p, v._hasClipOnAxisFalse = !1, i = 0; i < e.length; i++) { var y = e[i]; if (y.xaxis === v.xaxis._id && y.yaxis === v.yaxis._id && y.cliponaxis === !1) { v._hasClipOnAxisFalse = !0; break; } } } var m = oa.list(c, null, !0), b; for (a = 0; a < m.length; a++) { b = m[a]; var w = null; b.overlaying && (w = oa.getFromId(c, b.overlaying), w && w.overlaying && (b.overlaying = !1, w = null)), b._mainAxis = w || b, w && (b.domain = w.domain.slice()), b._anchorAxis = b.anchor === "free" ? null : oa.getFromId(c, b.anchor); } for (a = 0; a < m.length; a++) if (b = m[a], b._counterAxes.sort(oa.idSort), b._subplotsWith.sort(yt.subplotSort), b._mainSubplot = XW(b, t), b._counterAxes.length && (b.spikemode && b.spikemode.indexOf("across") !== -1 || b.automargin && b.mirror && b.anchor !== "free" || pn.getComponentMethod("rangeslider", "isVisible")(b))) { var _ = 1, k = 0; for (i = 0; i < b._counterAxes.length; i++) { var T = oa.getFromId(c, b._counterAxes[i]); _ = Math.min(_, T.domain[0]), k = Math.max(k, T.domain[1]); } _ < k && (b._counterDomainMin = _, b._counterDomainMax = k); } }; function XW(e, t) { var n = { _fullLayout: t }, r = e._id.charAt(0) === "x", a = e._mainAxis._anchorAxis, i = "", o = "", l = ""; if (a && (l = a._mainAxis._id, i = r ? e._id + l : l + e._id), !i || !t._plots[i]) { i = ""; for (var s = e._counterAxes, c = 0; c < s.length; c++) { var u = s[c], f = r ? e._id + u : u + e._id; o || (o = f); var h = oa.getFromId(n, u); if (l && h.overlaying === l) { i = f; break; } } } return i || o; } ot.clearExpandedTraceDefaultColors = function(e) { var t, n, r; function a(o, l, s, c) { n[c] = l, n.length = c + 1, o.valType === "color" && o.dflt === void 0 && t.push(n.join(".")); } for (n = [], t = e._module._colorAttrs, t || (e._module._colorAttrs = t = [], $C.crawl( e._module.attributes, a )), r = 0; r < t.length; r++) { var i = yt.nestedProperty(e, "_input." + t[r]); i.get() || yt.nestedProperty(e, t[r]).set(null); } }; ot.supplyDataDefaults = function(e, t, n, r) { var a = r._modules, i = r._visibleModules, o = r._basePlotModules, l = 0, s = 0, c, u, f; r._transformModules = []; function h(O) { t.push(O); var M = O._module; M && (yt.pushUnique(a, M), O.visible === !0 && yt.pushUnique(i, M), yt.pushUnique(o, O._module.basePlotModule), l++, O._input.visible !== !1 && s++); } var g = {}, p = [], v = (n.template || {}).data || {}, y = HW.traceTemplater(v); for (c = 0; c < e.length; c++) { if (f = e[c], u = y.newTrace(f), u.uid = r._traceUids[c], ot.supplyTraceDefaults(f, u, s, r, c), u.index = c, u._input = f, u._expandedIndex = l, u.transforms && u.transforms.length) for (var m = f.visible !== !1 && u.visible === !1, b = eZ(u, t, n, r), w = 0; w < b.length; w++) { var _ = b[w], k = { _template: u._template, type: u.type, // set uid using parent uid and expanded index // to promote consistency between update calls uid: u.uid + w }; m && _.visible === !1 && delete _.visible, ot.supplyTraceDefaults(_, k, l, r, c), ly(k, _), k.index = c, k._input = f, k._fullInput = u, k._expandedIndex = l, k._expandedInput = _, h(k); } else u._fullInput = u, u._expandedInput = u, h(u); pn.traceIs(u, "carpetAxis") && (g[u.carpet] = u), pn.traceIs(u, "carpetDependent") && p.push(c); } for (c = 0; c < p.length; c++) if (u = t[p[c]], !!u.visible) { var T = g[u.carpet]; if (u._carpet = T, !T || !T.visible) { u.visible = !1; continue; } u.xaxis = T.xaxis, u.yaxis = T.yaxis; } }; ot.supplyAnimationDefaults = function(e) { e = e || {}; var t, n = {}; function r(a, i) { return yt.coerce(e || {}, n, ox, a, i); } if (r("mode"), r("direction"), r("fromcurrent"), Array.isArray(e.frame)) for (n.frame = [], t = 0; t < e.frame.length; t++) n.frame[t] = ot.supplyAnimationFrameDefaults(e.frame[t] || {}); else n.frame = ot.supplyAnimationFrameDefaults(e.frame || {}); if (Array.isArray(e.transition)) for (n.transition = [], t = 0; t < e.transition.length; t++) n.transition[t] = ot.supplyAnimationTransitionDefaults(e.transition[t] || {}); else n.transition = ot.supplyAnimationTransitionDefaults(e.transition || {}); return n; }; ot.supplyAnimationFrameDefaults = function(e) { var t = {}; function n(r, a) { return yt.coerce(e || {}, t, ox.frame, r, a); } return n("duration"), n("redraw"), t; }; ot.supplyAnimationTransitionDefaults = function(e) { var t = {}; function n(r, a) { return yt.coerce(e || {}, t, ox.transition, r, a); } return n("duration"), n("easing"), t; }; ot.supplyFrameDefaults = function(e) { var t = {}; function n(r, a) { return yt.coerce(e, t, UW, r, a); } return n("group"), n("name"), n("traces"), n("baseframe"), n("data"), n("layout"), t; }; ot.supplyTraceDefaults = function(e, t, n, r, a) { var i = r.colorway || KC.defaults, o = i[n % i.length], l; function s(w, _) { return yt.coerce(e, t, ot.attributes, w, _); } var c = s("visible"); s("type"), s("name", r._traceWord + " " + a), s("uirevision", r.uirevision); var u = ot.getModule(t); if (t._module = u, u) { var f = u.basePlotModule, h = f.attr, g = f.attributes; if (h && g) { var p = r._subplots, v = ""; if (c || f.name !== "gl2d") { if (Array.isArray(h)) for (l = 0; l < h.length; l++) { var y = h[l], m = yt.coerce(e, t, g, y); p[y] && yt.pushUnique(p[y], m), v += m; } else v = yt.coerce(e, t, g, h); p[f.name] && yt.pushUnique(p[f.name], v); } } } if (c) { if (s("customdata"), s("ids"), s("meta"), pn.traceIs(t, "showLegend") ? (yt.coerce( e, t, u.attributes.showlegend ? u.attributes : ot.attributes, "showlegend" ), s("legend"), s("legendwidth"), s("legendgroup"), s("legendgrouptitle.text"), s("legendrank"), t._dfltShowLegend = !0) : t._dfltShowLegend = !1, u && u.supplyDefaults(e, t, o, r), pn.traceIs(t, "noOpacity") || s("opacity"), pn.traceIs(t, "notLegendIsolatable") && (t.visible = !!t.visible), pn.traceIs(t, "noHover") || (t.hovertemplate || yt.coerceHoverinfo(e, t, r), t.type !== "parcats" && pn.getComponentMethod("fx", "supplyDefaults")(e, t, o, r)), u && u.selectPoints) { var b = s("selectedpoints"); yt.isTypedArray(b) && (t.selectedpoints = Array.from(b)); } ot.supplyTransformDefaults(e, t, r); } return t; }; function JC(e) { var t = e.transforms; if (Array.isArray(t) && t.length) for (var n = 0; n < t.length; n++) { var r = t[n], a = r._module || _0[r.type]; if (a && a.makesData) return !0; } return !1; } ot.hasMakesDataTransform = JC; ot.supplyTransformDefaults = function(e, t, n) { if (t._length || JC(e)) { var r = n._globalTransforms || [], a = n._transformModules || []; if (!(!Array.isArray(e.transforms) && r.length === 0)) for (var i = e.transforms || [], o = r.concat(i), l = t.transforms = [], s = 0; s < o.length; s++) { var c = o[s], u = c.type, f = _0[u], h, g = !(c._module && c._module === f), p = f && typeof f.transform == "function"; f || yt.warn("Unrecognized transform type " + u + "."), f && f.supplyDefaults && (g || p) ? (h = f.supplyDefaults(c, t, n, e), h.type = u, h._module = f, yt.pushUnique(a, f)) : h = yt.extendFlat({}, c), l.push(h); } } }; function eZ(e, t, n, r) { for (var a = e.transforms, i = [e], o = 0; o < a.length; o++) { var l = a[o], s = _0[l.type]; s && s.transform && (i = s.transform(i, { transform: l, fullTrace: e, fullData: t, layout: n, fullLayout: r, transformIndex: o })); } return i; } ot.supplyLayoutGlobalDefaults = function(e, t, n) { function r(f, h) { return yt.coerce(e, t, ot.layoutAttributes, f, h); } var a = e.template; yt.isPlainObject(a) && (t.template = a, t._template = a.layout, t._dataTemplate = a.data), r("autotypenumbers"); var i = yt.coerceFont(r, "font"), o = i.size; yt.coerceFont(r, "title.font", yt.extendFlat({}, i, { size: Math.round(o * 1.4) })), r("title.text", t._dfltTitle.plot), r("title.xref"); var l = r("title.yref"); r("title.pad.t"), r("title.pad.r"), r("title.pad.b"), r("title.pad.l"); var s = r("title.automargin"); r("title.x"), r("title.xanchor"), r("title.y"), r("title.yanchor"), s && (l === "paper" && (t.title.y !== 0 && (t.title.y = 1), t.title.yanchor === "auto" && (t.title.yanchor = t.title.y === 0 ? "top" : "bottom")), l === "container" && (t.title.y === "auto" && (t.title.y = 1), t.title.yanchor === "auto" && (t.title.yanchor = t.title.y < 0.5 ? "bottom" : "top"))); var c = r("uniformtext.mode"); c && r("uniformtext.minsize"), r("autosize", !(e.width && e.height)), r("width"), r("height"), r("minreducedwidth"), r("minreducedheight"), r("margin.l"), r("margin.r"), r("margin.t"), r("margin.b"), r("margin.pad"), r("margin.autoexpand"), e.width && e.height && ot.sanitizeMargins(t), pn.getComponentMethod("grid", "sizeDefaults")(e, t), r("paper_bgcolor"), r("separators", n.decimal + n.thousands), r("hidesources"), r("colorway"), r("datarevision"); var u = r("uirevision"); r("editrevision", u), r("selectionrevision", u), pn.getComponentMethod( "modebar", "supplyLayoutDefaults" )(e, t), pn.getComponentMethod( "shapes", "supplyDrawNewShapeDefaults" )(e, t, r), pn.getComponentMethod( "selections", "supplyDrawNewSelectionDefaults" )(e, t, r), r("meta"), yt.isPlainObject(e.transition) && (r("transition.duration"), r("transition.easing"), r("transition.ordering")), pn.getComponentMethod( "calendars", "handleDefaults" )(e, t, "calendar"), pn.getComponentMethod( "fx", "supplyLayoutGlobalDefaults" )(e, t, r), yt.coerce(e, t, qW, "scattermode"); }; function Hf(e) { return typeof e == "string" && e.substr(e.length - 2) === "px" && parseFloat(e); } ot.plotAutoSize = function(e, t, n) { var r = e._context || {}, a = r.frameMargins, i, o, l = yt.isPlotDiv(e); if (l && e.emit("plotly_autosize"), r.fillFrame) i = window.innerWidth, o = window.innerHeight, document.body.style.overflow = "hidden"; else { var s = l ? window.getComputedStyle(e) : {}; if (i = Hf(s.width) || Hf(s.maxWidth) || n.width, o = Hf(s.height) || Hf(s.maxHeight) || n.height, ed(a) && a > 0) { var c = 1 - 2 * a; i = Math.round(c * i), o = Math.round(c * o); } } var u = ot.layoutAttributes.width.min, f = ot.layoutAttributes.height.min; i < u && (i = u), o < f && (o = f); var h = !t.width && Math.abs(n.width - i) > 1, g = !t.height && Math.abs(n.height - o) > 1; (g || h) && (h && (n.width = i), g && (n.height = o)), e._initialAutoSize || (e._initialAutoSize = { width: i, height: o }), ot.sanitizeMargins(n); }; ot.supplyLayoutModuleDefaults = function(e, t, n, r) { var a = pn.componentsRegistry, i = t._basePlotModules, o, l, s, c = pn.subplotsRegistry.cartesian; for (o in a) s = a[o], s.includeBasePlot && s.includeBasePlot(e, t); i.length || i.push(c), t._has("cartesian") && (pn.getComponentMethod("grid", "contentDefaults")(e, t), c.finalizeSubplots(e, t)); for (var u in t._subplots) t._subplots[u].sort(yt.subplotSort); for (l = 0; l < i.length; l++) s = i[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e, t, n); var f = t._modules; for (l = 0; l < f.length; l++) s = f[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e, t, n); var h = t._transformModules; for (l = 0; l < h.length; l++) s = h[l], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e, t, n, r); for (o in a) s = a[o], s.supplyLayoutDefaults && s.supplyLayoutDefaults(e, t, n); }; ot.purge = function(e) { var t = e._fullLayout || {}; t._glcontainer !== void 0 && (t._glcontainer.selectAll(".gl-canvas").remove(), t._glcontainer.remove(), t._glcanvas = null), t._modeBar && t._modeBar.destroy(), e._transitionData && (e._transitionData._interruptCallbacks && (e._transitionData._interruptCallbacks.length = 0), e._transitionData._animationRaf && window.cancelAnimationFrame(e._transitionData._animationRaf)), yt.clearThrottle(), yt.clearResponsive(e), delete e.data, delete e.layout, delete e._fullData, delete e._fullLayout, delete e.calcdata, delete e.empty, delete e.fid, delete e.undoqueue, delete e.undonum, delete e.autoplay, delete e.changed, delete e._promises, delete e._redrawTimer, delete e._hmlumcount, delete e._hmpixcount, delete e._transitionData, delete e._transitioning, delete e._initialAutoSize, delete e._transitioningWithDuration, delete e._dragging, delete e._dragged, delete e._dragdata, delete e._hoverdata, delete e._snapshotInProgress, delete e._editing, delete e._mouseDownTime, delete e._legendMouseDownTime, e.removeAllListeners && e.removeAllListeners(); }; ot.style = function(e) { var t = e._fullLayout._visibleModules, n = [], r; for (r = 0; r < t.length; r++) { var a = t[r]; a.style && yt.pushUnique(n, a.style); } for (r = 0; r < n.length; r++) n[r](e); }; ot.sanitizeMargins = function(e) { if (!(!e || !e.margin)) { var t = e.width, n = e.height, r = e.margin, a = t - (r.l + r.r), i = n - (r.t + r.b), o; a < 0 && (o = (t - 1) / (r.l + r.r), r.l = Math.floor(o * r.l), r.r = Math.floor(o * r.r)), i < 0 && (o = (n - 1) / (r.t + r.b), r.t = Math.floor(o * r.t), r.b = Math.floor(o * r.b)); } }; ot.clearAutoMarginIds = function(e) { e._fullLayout._pushmarginIds = {}; }; ot.allowAutoMargin = function(e, t) { e._fullLayout._pushmarginIds[t] = 1; }; function QC(e) { var t = e.margin; if (!e._size) { var n = e._size = { l: Math.round(t.l), r: Math.round(t.r), t: Math.round(t.t), b: Math.round(t.b), p: Math.round(t.pad) }; n.w = Math.round(e.width) - n.l - n.r, n.h = Math.round(e.height) - n.t - n.b; } e._pushmargin || (e._pushmargin = {}), e._pushmarginIds || (e._pushmarginIds = {}), e._reservedMargin || (e._reservedMargin = {}); } var XC = 2, eL = 2; ot.autoMargin = function(e, t, n) { var r = e._fullLayout, a = r.width, i = r.height, o = r.margin, l = r.minreducedwidth, s = r.minreducedheight, c = yt.constrain( a - o.l - o.r, XC, l ), u = yt.constrain( i - o.t - o.b, eL, s ), f = Math.max(0, a - c), h = Math.max(0, i - u), g = r._pushmargin, p = r._pushmarginIds; if (o.autoexpand !== !1) { if (!n) delete g[t], delete p[t]; else { var v = n.pad; if (v === void 0 && (v = Math.min(12, o.l, o.r, o.t, o.b)), f) { var y = (n.l + n.r) / f; y > 1 && (n.l /= y, n.r /= y); } if (h) { var m = (n.t + n.b) / h; m > 1 && (n.t /= m, n.b /= m); } var b = n.xl !== void 0 ? n.xl : n.x, w = n.xr !== void 0 ? n.xr : n.x, _ = n.yt !== void 0 ? n.yt : n.y, k = n.yb !== void 0 ? n.yb : n.y; g[t] = { l: { val: b, size: n.l + v }, r: { val: w, size: n.r + v }, b: { val: k, size: n.b + v }, t: { val: _, size: n.t + v } }, p[t] = 1; } if (!r._replotting) return ot.doAutoMargin(e); } }; function tZ(e) { if ("_redrawFromAutoMarginCount" in e._fullLayout) return !1; var t = oa.list(e, "", !0); for (var n in t) if (t[n].autoshift || t[n].shift) return !0; return !1; } ot.doAutoMargin = function(e) { var t = e._fullLayout, n = t.width, r = t.height; t._size || (t._size = {}), QC(t); var a = t._size, i = t.margin, o = { t: 0, b: 0, l: 0, r: 0 }, l = yt.extendFlat({}, a), s = i.l, c = i.r, u = i.t, f = i.b, h = t._pushmargin, g = t._pushmarginIds, p = t.minreducedwidth, v = t.minreducedheight; if (i.autoexpand !== !1) { for (var y in h) g[y] || delete h[y]; var m = e._fullLayout._reservedMargin; for (var b in m) for (var w in m[b]) { var _ = m[b][w]; o[w] = Math.max(o[w], _); } h.base = { l: { val: 0, size: s }, r: { val: 1, size: c }, t: { val: 1, size: u }, b: { val: 0, size: f } }; for (var k in o) { var T = 0; for (var O in h) O !== "base" && ed(h[O][k].size) && (T = h[O][k].size > T ? h[O][k].size : T); var M = Math.max(0, i[k] - T); o[k] = Math.max(0, o[k] - M); } for (var C in h) { var I = h[C].l || {}, j = h[C].b || {}, P = I.val, N = I.size, W = j.val, J = j.size, U = n - o.r - o.l, E = r - o.t - o.b; for (var z in h) { if (ed(N) && h[z].r) { var F = h[z].r.val, q = h[z].r.size; if (F > P) { var H = (N * F + (q - U) * P) / (F - P), K = (q * (1 - P) + (N - U) * (1 - F)) / (F - P); H + K > s + c && (s = H, c = K); } } if (ed(J) && h[z].t) { var Q = h[z].t.val, re = h[z].t.size; if (Q > W) { var te = (J * Q + (re - E) * W) / (Q - W), X = (re * (1 - W) + (J - E) * (1 - Q)) / (Q - W); te + X > f + u && (f = te, u = X); } } } } } var ce = yt.constrain( n - i.l - i.r, XC, p ), B = yt.constrain( r - i.t - i.b, eL, v ), G = Math.max(0, n - ce), Z = Math.max(0, r - B); if (G) { var oe = (s + c) / G; oe > 1 && (s /= oe, c /= oe); } if (Z) { var ae = (f + u) / Z; ae > 1 && (f /= ae, u /= ae); } if (a.l = Math.round(s) + o.l, a.r = Math.round(c) + o.r, a.t = Math.round(u) + o.t, a.b = Math.round(f) + o.b, a.p = Math.round(i.pad), a.w = Math.round(n) - a.l - a.r, a.h = Math.round(r) - a.t - a.b, !t._replotting && (ot.didMarginChange(l, a) || tZ(e))) { "_redrawFromAutoMarginCount" in t ? t._redrawFromAutoMarginCount++ : t._redrawFromAutoMarginCount = 1; var ge = 3 * (1 + Object.keys(g).length); if (t._redrawFromAutoMarginCount < ge) return pn.call("_doPlot", e); t._size = l, yt.warn("Too many auto-margin redraws."); } nZ(e); }; function nZ(e) { var t = oa.list(e, "", !0); [ "_adjustTickLabelsOverflow", "_hideCounterAxisInsideTickLabels" ].forEach(function(n) { for (var r = 0; r < t.length; r++) { var a = t[r][n]; a && a(); } }); } var N_ = ["l", "r", "t", "b", "p", "w", "h"]; ot.didMarginChange = function(e, t) { for (var n = 0; n < N_.length; n++) { var r = N_[n], a = e[r], i = t[r]; if (!ed(a) || Math.abs(i - a) > 1) return !0; } return !1; }; ot.graphJson = function(e, t, n, r, a, i) { (a && t && !e._fullData || a && !t && !e._fullLayout) && ot.supplyDefaults(e); var o = a ? e._fullData : e.data, l = a ? e._fullLayout : e.layout, s = (e._transitionData || {})._frames; function c(h, g) { if (typeof h == "function") return g ? "_function_" : null; if (yt.isPlainObject(h)) { var p = {}, v; return Object.keys(h).sort().forEach(function(w) { if (["_", "["].indexOf(w.charAt(0)) === -1) { if (typeof h[w] == "function") { g && (p[w] = "_function"); return; } if (n === "keepdata") { if (w.substr(w.length - 3) === "src") return; } else if (n === "keepstream") { if (v = h[w + "src"], typeof v == "string" && v.indexOf(":") > 0 && !yt.isPlainObject(h.stream)) return; } else if (n !== "keepall" && (v = h[w + "src"], typeof v == "string" && v.indexOf(":") > 0)) return; p[w] = c(h[w], g); } }), p; } var y = Array.isArray(h), m = yt.isTypedArray(h); if ((y || m) && h.dtype && h.shape) { var b = h.bdata; return c({ dtype: h.dtype, shape: h.shape, bdata: ( // case of ArrayBuffer yt.isArrayBuffer(b) ? BW.encode(b) : ( // case of b64 string b ) ) }, g); } return y ? h.map(function(w) { return c(w, g); }) : m ? yt.simpleMap(h, yt.identity) : yt.isJSDate(h) ? yt.ms2DateTimeLocal(+h) : h; } var u = { data: (o || []).map(function(h) { var g = c(h); return t && delete g.fit, g; }) }; if (!t && (u.layout = c(l), a)) { var f = l._size; u.layout.computed = { margin: { b: f.b, l: f.l, r: f.r, t: f.t } }; } return s && (u.frames = c(s)), i && (u.config = c(e._context, !0)), r === "object" ? u : JSON.stringify(u); }; ot.modifyFrames = function(e, t) { var n, r, a, i = e._transitionData._frames, o = e._transitionData._frameHash; for (n = 0; n < t.length; n++) switch (r = t[n], r.type) { case "replace": a = r.value; var l = (i[r.index] || {}).name, s = a.name; i[r.index] = o[s] = a, s !== l && (delete o[l], o[s] = a); break; case "insert": a = r.value, o[a.name] = a, i.splice(r.index, 0, a); break; case "delete": a = i[r.index], delete o[a.name], i.splice(r.index, 1); break; } return Promise.resolve(); }; ot.computeFrame = function(e, t) { var n = e._transitionData._frameHash, r, a, i, o; if (!t) throw new Error("computeFrame must be given a string frame name"); var l = n[t.toString()]; if (!l) return !1; for (var s = [l], c = [l.name]; l.baseframe && (l = n[l.baseframe.toString()]) && c.indexOf(l.name) === -1; ) s.push(l), c.push(l.name); for (var u = {}; l = s.pop(); ) if (l.layout && (u.layout = ot.extendLayout(u.layout, l.layout)), l.data) { if (u.data || (u.data = []), a = l.traces, !a) for (a = [], r = 0; r < l.data.length; r++) a[r] = r; for (u.traces || (u.traces = []), r = 0; r < l.data.length; r++) i = a[r], i != null && (o = u.traces.indexOf(i), o === -1 && (o = u.data.length, u.traces[o] = i), u.data[o] = ot.extendTrace(u.data[o], l.data[r])); } return u; }; ot.recomputeFrameHash = function(e) { for (var t = e._transitionData._frameHash = {}, n = e._transitionData._frames, r = 0; r < n.length; r++) { var a = n[r]; a && a.name && (t[a.name] = a); } }; ot.extendObjectWithContainers = function(e, t, n) { var r, a, i, o, l, s, c, u, f = yt.extendDeepNoArrays({}, t || {}), h = yt.expandObjectPaths(f), g = {}; if (n && n.length) for (i = 0; i < n.length; i++) r = yt.nestedProperty(h, n[i]), a = r.get(), a === void 0 ? yt.nestedProperty(g, n[i]).set(null) : (r.set(null), yt.nestedProperty(g, n[i]).set(a)); if (e = yt.extendDeepNoArrays(e || {}, h), n && n.length) { for (i = 0; i < n.length; i++) if (l = yt.nestedProperty(g, n[i]), c = l.get(), !!c) { for (s = yt.nestedProperty(e, n[i]), u = s.get(), Array.isArray(u) || (u = [], s.set(u)), o = 0; o < c.length; o++) { var p = c[o]; p === null ? u[o] = null : u[o] = ot.extendObjectWithContainers(u[o], p); } s.set(u); } } return e; }; ot.dataArrayContainers = ["transforms", "dimensions"]; ot.layoutArrayContainers = pn.layoutArrayContainers; ot.extendTrace = function(e, t) { return ot.extendObjectWithContainers(e, t, ot.dataArrayContainers); }; ot.extendLayout = function(e, t) { return ot.extendObjectWithContainers(e, t, ot.layoutArrayContainers); }; ot.transition = function(e, t, n, r, a, i) { var o = { redraw: a.redraw }, l = {}, s = []; return o.prepareFn = function() { for (var c = Array.isArray(t) ? t.length : 0, u = r.slice(0, c), f = 0; f < u.length; f++) { var h = u[f], g = e._fullData[h], p = g._module; if (p) { if (p.animatable) { var v = p.basePlotModule.name; l[v] || (l[v] = []), l[v].push(h); } e.data[u[f]] = ot.extendTrace(e.data[u[f]], t[f]); } } var y = yt.expandObjectPaths(yt.extendDeepNoArrays({}, n)), m = /^[xy]axis[0-9]*$/; for (var b in y) m.test(b) && delete y[b].range; ot.extendLayout(e.layout, y), delete e.calcdata, ot.supplyDefaults(e), ot.doCalcdata(e); var w = yt.expandObjectPaths(n); if (w) { var _ = e._fullLayout._plots; for (var k in _) { var T = _[k], O = T.xaxis, M = T.yaxis, C = O.range.slice(), I = M.range.slice(), j = null, P = null, N = null, W = null; Array.isArray(w[O._name + ".range"]) ? j = w[O._name + ".range"].slice() : Array.isArray((w[O._name] || {}).range) && (j = w[O._name].range.slice()), Array.isArray(w[M._name + ".range"]) ? P = w[M._name + ".range"].slice() : Array.isArray((w[M._name] || {}).range) && (P = w[M._name].range.slice()), C && j && (O.r2l(C[0]) !== O.r2l(j[0]) || O.r2l(C[1]) !== O.r2l(j[1])) && (N = { xr0: C, xr1: j }), I && P && (M.r2l(I[0]) !== M.r2l(P[0]) || M.r2l(I[1]) !== M.r2l(P[1])) && (W = { yr0: I, yr1: P }), (N || W) && s.push(yt.extendFlat({ plotinfo: T }, N, W)); } } return Promise.resolve(); }, o.runFn = function(c) { var u, f = e._fullLayout._basePlotModules, h = s.length, g; if (n) for (g = 0; g < f.length; g++) f[g].transitionAxes && f[g].transitionAxes(e, s, i, c); h ? (u = yt.extendFlat({}, i), u.duration = 0, delete l.cartesian) : u = i; for (var p in l) { var v = l[p], y = e._fullData[v[0]]._module; y.basePlotModule.plot(e, v, u, c); } }, tL(e, i, o); }; ot.transitionFromReact = function(e, t, n, r) { var a = e._fullLayout, i = a.transition, o = {}, l = []; return o.prepareFn = function() { var s = a._plots; o.redraw = !1, t.anim === "some" && (o.redraw = !0), n.anim === "some" && (o.redraw = !0); for (var c in s) { var u = s[c], f = u.xaxis, h = u.yaxis, g = r[f._name].range.slice(), p = r[h._name].range.slice(), v = f.range.slice(), y = h.range.slice(); f.setScale(), h.setScale(); var m = null, b = null; (f.r2l(g[0]) !== f.r2l(v[0]) || f.r2l(g[1]) !== f.r2l(v[1])) && (m = { xr0: g, xr1: v }), (h.r2l(p[0]) !== h.r2l(y[0]) || h.r2l(p[1]) !== h.r2l(y[1])) && (b = { yr0: p, yr1: y }), (m || b) && l.push(yt.extendFlat({ plotinfo: u }, m, b)); } return Promise.resolve(); }, o.runFn = function(s) { for (var c = e._fullData, u = e._fullLayout, f = u._basePlotModules, h, g, p, v = [], y = 0; y < c.length; y++) v.push(y); function m() { if (e._fullLayout) for (var w = 0; w < f.length; w++) f[w].transitionAxes && f[w].transitionAxes(e, l, h, s); } function b() { if (e._fullLayout) for (var w = 0; w < f.length; w++) f[w].plot(e, p, g, s); } l.length && t.anim ? i.ordering === "traces first" ? (h = yt.extendFlat({}, i, { duration: 0 }), p = v, g = i, setTimeout(m, i.duration), b()) : (h = i, p = null, g = yt.extendFlat({}, i, { duration: 0 }), setTimeout(b, h.duration), m()) : l.length ? (h = i, m()) : t.anim && (p = v, g = i, b()); }, tL(e, i, o); }; function tL(e, t, n) { var r = !1; function a(f) { var h = Promise.resolve(); if (!f) return h; for (; f.length; ) h = h.then(f.shift()); return h; } function i(f) { if (f) for (; f.length; ) f.shift(); } function o() { return e.emit("plotly_transitioning", []), new Promise(function(f) { e._transitioning = !0, t.duration > 0 && (e._transitioningWithDuration = !0), e._transitionData._interruptCallbacks.push(function() { r = !0; }), n.redraw && e._transitionData._interruptCallbacks.push(function() { return pn.call("redraw", e); }), e._transitionData._interruptCallbacks.push(function() { e.emit("plotly_transitioninterrupted", []); }); var h = 0, g = 0; function p() { return h++, function() { g++, !r && g === h && l(f); }; } n.runFn(p), setTimeout(p()); }); } function l(f) { if (e._transitionData) return i(e._transitionData._interruptCallbacks), Promise.resolve().then(function() { if (n.redraw) return pn.call("redraw", e); }).then(function() { e._transitioning = !1, e._transitioningWithDuration = !1, e.emit("plotly_transitioned", []); }).then(f); } function s() { if (e._transitionData) return e._transitioning = !1, a(e._transitionData._interruptCallbacks); } var c = [ ot.previousPromises, s, n.prepareFn, ot.rehover, ot.reselect, o ], u = yt.syncOrAsync(c, e); return (!u || !u.then) && (u = Promise.resolve()), u.then(function() { return e; }); } ot.doCalcdata = function(e, t) { var n = oa.list(e), r = e._fullData, a = e._fullLayout, i, o, l, s, c = new Array(r.length), u = (e.calcdata || []).slice(); for (e.calcdata = c, a._numBoxes = 0, a._numViolins = 0, a._violinScaleGroupStats = {}, e._hmpixcount = 0, e._hmlumcount = 0, a._piecolormap = {}, a._sunburstcolormap = {}, a._treemapcolormap = {}, a._iciclecolormap = {}, a._funnelareacolormap = {}, l = 0; l < r.length; l++) if (Array.isArray(t) && t.indexOf(l) === -1) { c[l] = u[l]; continue; } for (l = 0; l < r.length; l++) i = r[l], i._arrayAttrs = $C.findArrayAttributes(i), i._extremes = {}; var f = a._subplots.polar || []; for (l = 0; l < f.length; l++) n.push( a[f[l]].radialaxis, a[f[l]].angularaxis ); for (var h in a._colorAxes) { var g = a[h]; g.cauto !== !1 && (delete g.cmin, delete g.cmax); } var p = !1; function v(b) { if (i = r[b], o = i._module, i.visible === !0 && i.transforms) { if (o && o.calc) { var w = o.calc(e, i); w[0] && w[0].t && w[0].t._scene && delete w[0].t._scene.dirty; } for (s = 0; s < i.transforms.length; s++) { var _ = i.transforms[s]; o = _0[_.type], o && o.calcTransform && (i._hasCalcTransform = !0, p = !0, o.calcTransform(e, i, _)); } } } function y(b, w) { if (i = r[b], o = i._module, !!o.isContainer === w) { var _ = []; if (i.visible === !0 && i._length !== 0) { delete i._indexToPoints; var k = i.transforms || []; for (s = k.length - 1; s >= 0; s--) if (k[s].enabled) { i._indexToPoints = k[s]._indexToPoints; break; } o && o.calc && (_ = o.calc(e, i)); } (!Array.isArray(_) || !_[0]) && (_ = [{ x: P_, y: P_ }]), _[0].t || (_[0].t = {}), _[0].trace = i, c[b] = _; } } for (B_(n, r, a), l = 0; l < r.length; l++) y(l, !0); for (l = 0; l < r.length; l++) v(l); for (p && B_(n, r, a), l = 0; l < r.length; l++) y(l, !0); for (l = 0; l < r.length; l++) y(l, !1); H_(e); var m = aZ(n, e); if (m.length) { for (a._numBoxes = 0, a._numViolins = 0, l = 0; l < m.length; l++) y(m[l], !0); for (l = 0; l < m.length; l++) y(m[l], !1); H_(e); } pn.getComponentMethod("fx", "calc")(e), pn.getComponentMethod("errorbars", "calc")(e); }; var rZ = /(total|sum|min|max|mean|median) (ascending|descending)/; function aZ(e, t) { var n = [], r, a, i, o, l; function s(z, F, q) { var H = F._id.charAt(0); if (z === "histogram2dcontour") { var K = F._counterAxes[0], Q = oa.getFromId(t, K), re = H === "x" || K === "x" && Q.type === "category", te = H === "y" || K === "y" && Q.type === "category"; return function(X, ce) { return X === 0 || ce === 0 || re && X === q[ce].length - 1 || te && ce === q.length - 1 ? -1 : (H === "y" ? ce : X) - 1; }; } else return function(X, ce) { return H === "y" ? ce : X; }; } var c = { min: function(z) { return yt.aggNums(Math.min, null, z); }, max: function(z) { return yt.aggNums(Math.max, null, z); }, sum: function(z) { return yt.aggNums(function(F, q) { return F + q; }, null, z); }, total: function(z) { return yt.aggNums(function(F, q) { return F + q; }, null, z); }, mean: function(z) { return yt.mean(z); }, median: function(z) { return yt.median(z); } }; function u(z, F) { return z[1] - F[1]; } function f(z, F) { return F[1] - z[1]; } for (r = 0; r < e.length; r++) { var h = e[r]; if (h.type === "category") { var g = h.categoryorder.match(rZ); if (g) { var p = g[1], v = g[2], y = h._id.charAt(0), m = y === "x", b = []; for (a = 0; a < h._categories.length; a++) b.push([h._categories[a], []]); for (a = 0; a < h._traceIndices.length; a++) { var w = h._traceIndices[a], _ = t._fullData[w]; if (_.visible === !0) { var k = _.type; pn.traceIs(_, "histogram") && (delete _._xautoBinFinished, delete _._yautoBinFinished); var T = k === "splom", O = k === "scattergl", M = t.calcdata[w]; for (i = 0; i < M.length; i++) { var C = M[i], I, j; if (T) { var P = _._axesDim[h._id]; if (!m) { var N = _._diag[P][0]; N && (h = t._fullLayout[oa.id2name(N)]); } var W = C.trace.dimensions[P].values; for (o = 0; o < W.length; o++) for (I = h._categoriesMap[W[o]], l = 0; l < C.trace.dimensions.length; l++) if (l !== P) { var J = C.trace.dimensions[l]; b[I][1].push(J.values[o]); } } else if (O) { for (o = 0; o < C.t.x.length; o++) m ? (I = C.t.x[o], j = C.t.y[o]) : (I = C.t.y[o], j = C.t.x[o]), b[I][1].push(j); C.t && C.t._scene && delete C.t._scene.dirty; } else if (C.hasOwnProperty("z")) { j = C.z; var U = s(_.type, h, j); for (o = 0; o < j.length; o++) for (l = 0; l < j[o].length; l++) I = U(l, o), I + 1 && b[I][1].push(j[o][l]); } else for (I = C.p, I === void 0 && (I = C[y]), j = C.s, j === void 0 && (j = C.v), j === void 0 && (j = m ? C.y : C.x), Array.isArray(j) || (j === void 0 ? j = [] : j = [j]), o = 0; o < j.length; o++) b[I][1].push(j[o]); } } } h._categoriesValue = b; var E = []; for (a = 0; a < b.length; a++) E.push([ b[a][0], c[p](b[a][1]) ]); E.sort(v === "descending" ? f : u), h._categoriesAggregatedValue = E, h._initialCategories = E.map(function(z) { return z[0]; }), n = n.concat(h.sortByInitialCategories()); } } } return n; } function B_(e, t, n) { var r = {}; function a(s) { s.clearCalc(), s.type === "multicategory" && s.setupMultiCategory(t), r[s._id] = 1; } yt.simpleMap(e, a); for (var i = n._axisMatchGroups || [], o = 0; o < i.length; o++) for (var l in i[o]) r[l] || a(n[oa.id2name(l)]); } function H_(e) { var t = e._fullLayout, n = t._visibleModules, r = {}, a, i, o; for (i = 0; i < n.length; i++) { var l = n[i], s = l.crossTraceCalc; if (s) { var c = l.basePlotModule.name; r[c] ? yt.pushUnique(r[c], s) : r[c] = [s]; } } for (o in r) { var u = r[o], f = t._subplots[o]; if (Array.isArray(f)) for (a = 0; a < f.length; a++) { var h = f[a], g = o === "cartesian" ? t._plots[h] : t[h]; for (i = 0; i < u.length; i++) u[i](e, g, h); } else for (i = 0; i < u.length; i++) u[i](e); } } ot.rehover = function(e) { e._fullLayout._rehover && e._fullLayout._rehover(); }; ot.redrag = function(e) { e._fullLayout._redrag && e._fullLayout._redrag(); }; ot.reselect = function(e) { var t = e._fullLayout, n = (e.layout || {}).selections, r = t._previousSelections; t._previousSelections = n; var a = t._reselect || JSON.stringify(n) !== JSON.stringify(r); pn.getComponentMethod("selections", "reselect")(e, a); }; ot.generalUpdatePerTraceModule = function(e, t, n, r) { var a = t.traceHash, i = {}, o; for (o = 0; o < n.length; o++) { var l = n[o], s = l[0].trace; s.visible && (i[s.type] = i[s.type] || [], i[s.type].push(l)); } for (var c in a) if (!i[c]) { var u = a[c][0], f = u[0].trace; f.visible = !1, i[c] = [u]; } for (var h in i) { var g = i[h], p = g[0][0].trace._module; p.plot(e, t, yt.filterVisible(g), r); } t.traceHash = i; }; ot.plotBasePlot = function(e, t, n, r, a) { var i = pn.getModule(e), o = GW(t.calcdata, i)[0]; i.plot(t, o, r, a); }; ot.cleanBasePlot = function(e, t, n, r, a) { var i = a._has && a._has(e), o = n._has && n._has(e); i && !o && a["_" + e + "layer"].selectAll("g.trace").remove(); }; var kr = WC.exports, nL = { exports: {} }, Ir = {}, yl = {}; (function(e) { e.xmlns = "http://www.w3.org/2000/xmlns/", e.svg = "http://www.w3.org/2000/svg", e.xlink = "http://www.w3.org/1999/xlink", e.svgAttrs = { xmlns: e.svg, "xmlns:xlink": e.xlink }; })(yl); var Nr = { // from bottom left: this is the origin of our paper-reference // positioning system FROM_BL: { left: 0, center: 0.5, right: 1, bottom: 0, middle: 0.5, top: 1 }, // from top left: this is the screen pixel positioning origin FROM_TL: { left: 0, center: 0.5, right: 1, bottom: 1, middle: 0.5, top: 0 }, // from bottom right: sometimes you just need the opposite of ^^ FROM_BR: { left: 1, center: 0.5, right: 0, bottom: 0, middle: 0.5, top: 1 }, // multiple of fontSize to get the vertical offset between lines LINE_SPACING: 1.3, // multiple of fontSize to shift from the baseline // to the cap (captical letter) line // (to use when we don't calculate this shift from Drawing.bBox) // This is an approximation since in reality cap height can differ // from font to font. However, according to Wikipedia // an "average" font might have a cap height of 70% of the em // https://en.wikipedia.org/wiki/Em_(typography)#History CAP_SHIFT: 0.7, // half the cap height (distance between baseline and cap line) // of an "average" font (for more info see above). MID_SHIFT: 0.35, OPPOSITE_SIDE: { left: "right", right: "left", top: "bottom", bottom: "top" } }; (function(e) { var t = sn, n = Ue, r = n.strTranslate, a = yl, i = Nr.LINE_SPACING, o = /([^$]*)([$]+[^$]*[$]+)([^$]*)/; e.convertToTspans = function(F, q, H) { var K = F.text(), Q = !F.attr("data-notex") && q && q._context.typesetMath && typeof MathJax < "u" && K.match(o), re = t.select(F.node().parentNode); if (re.empty()) return; var te = F.attr("class") ? F.attr("class").split(" ")[0] : "text"; te += "-math", re.selectAll("svg." + te).remove(), re.selectAll("g." + te + "-group").remove(), F.style("display", null).attr({ // some callers use data-unformatted *from the element* in 'cancel' // so we need it here even if we're going to turn it into math // these two (plus style and text-anchor attributes) form the key we're // going to use for Drawing.bBox "data-unformatted": K, "data-math": "N" }); function X() { re.empty() || (te = F.attr("class") + "-math", re.select("svg." + te).remove()), F.text("").style("white-space", "pre"); var ce = J(F.node(), K); ce && F.style("pointer-events", "all"), e.positionText(F), H && H.call(F); } return Q ? (q && q._promises || []).push(new Promise(function(ce) { F.style("display", "none"); var B = parseInt(F.node().style.fontSize, 10), G = { fontSize: B }; f(Q[2], G, function(Z, oe, ae) { re.selectAll("svg." + te).remove(), re.selectAll("g." + te + "-group").remove(); var ge = Z && Z.select("svg"); if (!ge || !ge.node()) { X(), ce(); return; } var ve = re.append("g").classed(te + "-group", !0).attr({ "pointer-events": "none", "data-unformatted": K, "data-math": "Y" }); ve.node().appendChild(ge.node()), oe && oe.node() && ge.node().insertBefore( oe.node().cloneNode(!0), ge.node().firstChild ); var pe = ae.width, ye = ae.height; ge.attr({ class: te, height: ye, preserveAspectRatio: "xMinYMin meet" }).style({ overflow: "visible", "pointer-events": "none" }); var Oe = F.node().style.fill || "black", Be = ge.select("g"); Be.attr({ fill: Oe, stroke: Oe }); var Ie = Be.node().getBoundingClientRect(), Fe = Ie.width, Re = Ie.height; (Fe > pe || Re > ye) && (ge.style("overflow", "hidden"), Ie = ge.node().getBoundingClientRect(), Fe = Ie.width, Re = Ie.height); var We = +F.attr("x"), Ce = +F.attr("y"), Ve = B || F.node().getBoundingClientRect().height, Ke = -Ve / 4; if (te[0] === "y") ve.attr({ transform: "rotate(" + [-90, We, Ce] + ")" + r(-Fe / 2, Ke - Re / 2) }); else if (te[0] === "l") Ce = Ke - Re / 2; else if (te[0] === "a" && te.indexOf("atitle") !== 0) We = 0, Ce = Ke; else { var Xe = F.attr("text-anchor"); We = We - Fe * (Xe === "middle" ? 0.5 : Xe === "end" ? 1 : 0), Ce = Ce + Ke - Re / 2; } ge.attr({ x: We, y: Ce }), H && H.call(F, ve), ce(ve); }); })) : X(), F; }; var l = /(<|<|<)/g, s = /(>|>|>)/g; function c(F) { return F.replace(l, "\\lt ").replace(s, "\\gt "); } var u = [["$", "$"], ["\\(", "\\)"]]; function f(F, q, H) { var K = parseInt( (MathJax.version || "").split(".")[0] ); if (K !== 2 && K !== 3) { n.warn("No MathJax version:", MathJax.version); return; } var Q, re, te, X, ce = function() { return re = n.extendDeepAll({}, MathJax.Hub.config), te = MathJax.Hub.processSectionDelay, MathJax.Hub.processSectionDelay !== void 0 && (MathJax.Hub.processSectionDelay = 0), MathJax.Hub.Config({ messageStyle: "none", tex2jax: { inlineMath: u }, displayAlign: "left" }); }, B = function() { re = n.extendDeepAll({}, MathJax.config), MathJax.config.tex || (MathJax.config.tex = {}), MathJax.config.tex.inlineMath = u; }, G = function() { if (Q = MathJax.Hub.config.menuSettings.renderer, Q !== "SVG") return MathJax.Hub.setRenderer("SVG"); }, Z = function() { Q = MathJax.config.startup.output, Q !== "svg" && (MathJax.config.startup.output = "svg"); }, oe = function() { var Oe = "math-output-" + n.randstr({}, 64); X = t.select("body").append("div").attr({ id: Oe }).style({ visibility: "hidden", position: "absolute", "font-size": q.fontSize + "px" }).text(c(F)); var Be = X.node(); return K === 2 ? MathJax.Hub.Typeset(Be) : MathJax.typeset([Be]); }, ae = function() { var Oe = X.select( K === 2 ? ".MathJax_SVG" : ".MathJax" ), Be = !Oe.empty() && X.select("svg").node(); if (!Be) n.log("There was an error in the tex syntax.", F), H(); else { var Ie = Be.getBoundingClientRect(), Fe; K === 2 ? Fe = t.select("body").select("#MathJax_SVG_glyphs") : Fe = Oe.select("defs"), H(Oe, Fe, Ie); } X.remove(); }, ge = function() { if (Q !== "SVG") return MathJax.Hub.setRenderer(Q); }, ve = function() { Q !== "svg" && (MathJax.config.startup.output = Q); }, pe = function() { return te !== void 0 && (MathJax.Hub.processSectionDelay = te), MathJax.Hub.Config(re); }, ye = function() { MathJax.config = re; }; K === 2 ? MathJax.Hub.Queue( ce, G, oe, ae, ge, pe ) : K === 3 && (B(), Z(), MathJax.startup.defaultReady(), MathJax.startup.promise.then(function() { oe(), ae(), ve(), ye(); })); } var h = { // would like to use baseline-shift for sub/sup but FF doesn't support it // so we need to use dy along with the uber hacky shift-back-to // baseline below sup: "font-size:70%", sub: "font-size:70%", b: "font-weight:bold", i: "font-style:italic", a: "cursor:pointer", span: "", em: "font-style:italic;font-weight:bold" }, g = { sub: "0.3em", sup: "-0.6em" }, p = { sub: "-0.21em", sup: "0.42em" }, v = "​", y = ["http:", "https:", "mailto:", "", void 0, ":"], m = e.NEWLINES = /(\r\n?|\n)/g, b = /(<[^<>]*>)/, w = /<(\/?)([^ >]*)(\s+(.*))?>/i, _ = //i; e.BR_TAG_ALL = //gi; var k = /(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i, T = /(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i, O = /(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i, M = /(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i; function C(F, q) { if (!F) return null; var H = F.match(q), K = H && (H[3] || H[4]); return K && N(K); } var I = /(^|;)\s*color:/; e.plainText = function(F, q) { q = q || {}; for (var H = q.len !== void 0 && q.len !== -1 ? q.len : 1 / 0, K = q.allowedTags !== void 0 ? q.allowedTags : ["br"], Q = "...", re = Q.length, te = F.split(b), X = [], ce = "", B = 0, G = 0; G < te.length; G++) { var Z = te[G], oe = Z.match(w), ae = oe && oe[2].toLowerCase(); if (ae) K.indexOf(ae) !== -1 && (X.push(Z), ce = ae); else { var ge = Z.length; if (B + ge < H) X.push(Z), B += ge; else if (B < H) { var ve = H - B; ce && (ce !== "br" || ve <= re || ge <= re) && X.pop(), H > re ? X.push(Z.substr(0, ve - re) + Q) : X.push(Z.substr(0, ve)); break; } ce = ""; } } return X.join(""); }; var j = { mu: "μ", amp: "&", lt: "<", gt: ">", nbsp: " ", times: "×", plusmn: "±", deg: "°" }, P = /&(#\d+|#x[\da-fA-F]+|[a-z]+);/g; function N(F) { return F.replace(P, function(q, H) { var K; return H.charAt(0) === "#" ? K = W( H.charAt(1) === "x" ? parseInt(H.substr(2), 16) : parseInt(H.substr(1), 10) ) : K = j[H], K || q; }); } e.convertEntities = N; function W(F) { if (!(F > 1114111)) { var q = String.fromCodePoint; if (q) return q(F); var H = String.fromCharCode; return F <= 65535 ? H(F) : H( (F >> 10) + 55232, F % 1024 + 56320 ); } } function J(F, q) { q = q.replace(m, " "); var H = !1, K = [], Q, re = -1; function te() { re++; var Re = document.createElementNS(a.svg, "tspan"); t.select(Re).attr({ class: "line", dy: re * i + "em" }), F.appendChild(Re), Q = Re; var We = K; if (K = [{ node: Re }], We.length > 1) for (var Ce = 1; Ce < We.length; Ce++) X(We[Ce]); } function X(Re) { var We = Re.type, Ce = {}, Ve; if (We === "a") { Ve = "a"; var Ke = Re.target, Xe = Re.href, ct = Re.popup; Xe && (Ce = { "xlink:xlink:show": Ke === "_blank" || Ke.charAt(0) !== "_" ? "new" : "replace", target: Ke, "xlink:xlink:href": Xe }, ct && (Ce.onclick = 'window.open(this.href.baseVal,this.target.baseVal,"' + ct + '");return false;')); } else Ve = "tspan"; Re.style && (Ce.style = Re.style); var vt = document.createElementNS(a.svg, Ve); if (We === "sup" || We === "sub") { ce(Q, v), Q.appendChild(vt); var lt = document.createElementNS(a.svg, "tspan"); ce(lt, v), t.select(lt).attr("dy", p[We]), Ce.dy = g[We], Q.appendChild(vt), Q.appendChild(lt); } else Q.appendChild(vt); t.select(vt).attr(Ce), Q = Re.node = vt, K.push(Re); } function ce(Re, We) { Re.appendChild(document.createTextNode(We)); } function B(Re) { if (K.length === 1) { n.log("Ignoring unexpected end tag .", q); return; } var We = K.pop(); Re !== We.type && n.log("Start tag <" + We.type + "> doesnt match end tag <" + Re + ">. Pretending it did match.", q), Q = K[K.length - 1].node; } var G = _.test(q); G ? te() : (Q = F, K = [{ node: F }]); for (var Z = q.split(b), oe = 0; oe < Z.length; oe++) { var ae = Z[oe], ge = ae.match(w), ve = ge && ge[2].toLowerCase(), pe = h[ve]; if (ve === "br") te(); else if (pe === void 0) ce(Q, N(ae)); else if (ge[1]) B(ve); else { var ye = ge[4], Oe = { type: ve }, Be = C(ye, k); if (Be ? (Be = Be.replace(I, "$1 fill:"), pe && (Be += ";" + pe)) : pe && (Be = pe), Be && (Oe.style = Be), ve === "a") { H = !0; var Ie = C(ye, T); if (Ie) { var Fe = U(Ie); Fe && (Oe.href = Fe, Oe.target = C(ye, O) || "_blank", Oe.popup = C(ye, M)); } } X(Oe); } } return H; } function U(F) { var q = encodeURI(decodeURI(F)), H = document.createElement("a"), K = document.createElement("a"); H.href = F, K.href = q; var Q = H.protocol, re = K.protocol; return y.indexOf(Q) !== -1 && y.indexOf(re) !== -1 ? q : ""; } e.sanitizeHTML = function(F) { F = F.replace(m, " "); for (var q = document.createElement("p"), H = q, K = [], Q = F.split(b), re = 0; re < Q.length; re++) { var te = Q[re], X = te.match(w), ce = X && X[2].toLowerCase(); if (ce in h) if (X[1]) K.length && (H = K.pop()); else { var B = X[4], G = C(B, k), Z = G ? { style: G } : {}; if (ce === "a") { var oe = C(B, T); if (oe) { var ae = U(oe); if (ae) { Z.href = ae; var ge = C(B, O); ge && (Z.target = ge); } } } var ve = document.createElement(ce); H.appendChild(ve), t.select(ve).attr(Z), H = ve, K.push(ve); } else H.appendChild( document.createTextNode(N(te)) ); } var pe = "innerHTML"; return q[pe]; }, e.lineCount = function(F) { return F.selectAll("tspan.line").size() || 1; }, e.positionText = function(F, q, H) { return F.each(function() { var K = t.select(this); function Q(X, ce) { return ce === void 0 ? (ce = K.attr(X), ce === null && (K.attr(X, 0), ce = 0)) : K.attr(X, ce), ce; } var re = Q("x", q), te = Q("y", H); this.nodeName === "text" && K.selectAll("tspan.line").attr({ x: re, y: te }); }); }; function E(F, q, H) { var K = H.horizontalAlign, Q = H.verticalAlign || "top", re = F.node().getBoundingClientRect(), te = q.node().getBoundingClientRect(), X, ce, B; return Q === "bottom" ? ce = function() { return re.bottom - X.height; } : Q === "middle" ? ce = function() { return re.top + (re.height - X.height) / 2; } : ce = function() { return re.top; }, K === "right" ? B = function() { return re.right - X.width; } : K === "center" ? B = function() { return re.left + (re.width - X.width) / 2; } : B = function() { return re.left; }, function() { X = this.node().getBoundingClientRect(); var G = B() - te.left, Z = ce() - te.top, oe = H.gd || {}; if (H.gd) { oe._fullLayout._calcInverseTransform(oe); var ae = n.apply3DTransform(oe._fullLayout._invTransform)(G, Z); G = ae[0], Z = ae[1]; } return this.style({ top: Z + "px", left: G + "px", "z-index": 1e3 }), this; }; } var z = "1px "; e.makeTextShadow = function(F) { var q = z, H = z, K = z; return q + H + K + F + ", -" + q + "-" + H + K + F + ", " + q + "-" + H + K + F + ", -" + q + H + K + F; }, e.makeEditable = function(F, q) { var H = q.gd, K = q.delegate, Q = t.dispatch("edit", "input", "cancel"), re = K || F; if (F.style({ "pointer-events": K ? "none" : "all" }), F.size() !== 1) throw new Error("boo"); function te() { ce(), F.style({ opacity: 0 }); var B = re.attr("class"), G; B ? G = "." + B.split(" ")[0] + "-math-group" : G = "[class*=-math-group]", G && t.select(F.node().parentNode).select(G).style({ opacity: 0 }); } function X(B) { var G = B.node(), Z = document.createRange(); Z.selectNodeContents(G); var oe = window.getSelection(); oe.removeAllRanges(), oe.addRange(Z), G.focus(); } function ce() { var B = t.select(H), G = B.select(".svg-container"), Z = G.append("div"), oe = F.node().style, ae = parseFloat(oe.fontSize || 12), ge = q.text; ge === void 0 && (ge = F.attr("data-unformatted")), Z.classed("plugin-editable editable", !0).style({ position: "absolute", "font-family": oe.fontFamily || "Arial", "font-size": ae, color: q.fill || oe.fill || "black", opacity: 1, "background-color": q.background || "transparent", outline: "#ffffff33 1px solid", margin: [-ae / 8 + 1, 0, 0, -1].join("px ") + "px", padding: "0", "box-sizing": "border-box" }).attr({ contenteditable: !0 }).text(ge).call(E(F, G, q)).on("blur", function() { H._editing = !1, F.text(this.textContent).style({ opacity: 1 }); var ve = t.select(this).attr("class"), pe; ve ? pe = "." + ve.split(" ")[0] + "-math-group" : pe = "[class*=-math-group]", pe && t.select(F.node().parentNode).select(pe).style({ opacity: 0 }); var ye = this.textContent; t.select(this).transition().duration(0).remove(), t.select(document).on("mouseup", null), Q.edit.call(F, ye); }).on("focus", function() { var ve = this; H._editing = !0, t.select(document).on("mouseup", function() { if (t.event.target === ve) return !1; document.activeElement === Z.node() && Z.node().blur(); }); }).on("keyup", function() { t.event.which === 27 ? (H._editing = !1, F.style({ opacity: 1 }), t.select(this).style({ opacity: 0 }).on("blur", function() { return !1; }).transition().remove(), Q.cancel.call(F, this.textContent)) : (Q.input.call(F, this.textContent), t.select(this).call(E(F, G, q))); }).on("keydown", function() { t.event.which === 13 && this.blur(); }).call(X); } return q.immediate ? te() : re.on("click", te), t.rebind(F, Q, "on"); }; })(Ir); var rL = { exports: {} }, iZ = sn, zh = xi, td = cn, Vf = Ue, V_ = rn, oZ = Wc.isValid; function lZ(e, t, n) { var r = t ? Vf.nestedProperty(e, t).get() || {} : e, a = r[n || "color"]; a && a._inputArray && (a = a._inputArray); var i = !1; if (Vf.isArrayOrTypedArray(a)) { for (var o = 0; o < a.length; o++) if (td(a[o])) { i = !0; break; } } return Vf.isPlainObject(r) && (i || r.showscale === !0 || td(r.cmin) && td(r.cmax) || oZ(r.colorscale) || Vf.isPlainObject(r.colorbar)); } var q_ = ["showscale", "autocolorscale", "colorscale", "reversescale", "colorbar"], _u = ["min", "max", "mid", "auto"]; function aL(e) { var t = e._colorAx, n = t || e, r = {}, a, i, o; for (i = 0; i < q_.length; i++) o = q_[i], r[o] = n[o]; if (t) for (a = "c", i = 0; i < _u.length; i++) o = _u[i], r[o] = n["c" + o]; else { var l; for (i = 0; i < _u.length; i++) { if (o = _u[i], l = "c" + o, l in n) { r[o] = n[l]; continue; } l = "z" + o, l in n && (r[o] = n[l]); } a = l.charAt(0); } return r._sync = function(s, c) { var u = _u.indexOf(s) !== -1 ? a + s : s; n[u] = n["_" + u] = c; }, r; } function iL(e) { for (var t = aL(e), n = t.min, r = t.max, a = t.reversescale ? oL(t.colorscale) : t.colorscale, i = a.length, o = new Array(i), l = new Array(i), s = 0; s < i; s++) { var c = a[s]; o[s] = n + c[0] * (r - n), l[s] = c[1]; } return { domain: o, range: l }; } function oL(e) { for (var t = e.length, n = new Array(t), r = t - 1, a = 0; r >= 0; r--, a++) { var i = e[r]; n[a] = [1 - i[0], i[1]]; } return n; } function lL(e, t) { t = t || {}; for (var n = e.domain, r = e.range, a = r.length, i = new Array(a), o = 0; o < a; o++) { var l = zh(r[o]).toRgb(); i[o] = [l.r, l.g, l.b, l.a]; } var s = iZ.scale.linear().domain(n).range(i).clamp(!0), c = t.noNumericCheck, u = t.returnArray, f; return c && u ? f = s : c ? f = function(h) { return U_(s(h)); } : u ? f = function(h) { return td(h) ? s(h) : zh(h).isValid() ? h : V_.defaultLine; } : f = function(h) { return td(h) ? U_(s(h)) : zh(h).isValid() ? h : V_.defaultLine; }, f.domain = s.domain, f.range = function() { return r; }, f; } function sZ(e, t) { return lL(iL(e), t); } function U_(e) { var t = { r: e[0], g: e[1], b: e[2], a: e[3] }; return zh(t).toRgbString(); } var _i = { hasColorscale: lZ, extractOpts: aL, extractScale: iL, flipScale: oL, makeColorScaleFunc: lL, makeColorScaleFuncFromTrace: sZ }, sL = vC, cZ = sL.FORMAT_LINK, uZ = sL.DATE_FORMAT_LINK; function dZ(e, t) { return { valType: "string", dflt: "", editType: "none", description: (t ? lx : cL)("hover text", e) + [ "By default the values are formatted using " + (t ? "generic number format" : "`" + e + "axis.hoverformat`") + "." ].join(" ") }; } function lx(e, t) { return [ "Sets the " + e + " formatting rule" + (t ? "for `" + t + "` " : ""), "using d3 formatting mini-languages", "which are very similar to those in Python. For numbers, see: " + cZ + "." ].join(" "); } function cL(e, t) { return lx(e, t) + [ " And for dates see: " + uZ + ".", "We add two items to d3's date formatter:", "*%h* for half of the year as a decimal number as well as", "*%{n}f* for fractional seconds", "with n digits. For example, *2016-10-13 09:15:23.456* with tickformat", "*%H~%M~%S.%2f* would display *09~15~23.46*" ].join(" "); } var T0 = { axisHoverFormat: dZ, descriptionOnlyNumbers: lx, descriptionWithDates: cL }, $g = Fr, sc = fa, uL = Yi.dash, sx = tr.extendFlat, G_ = Sn.templatedArray, W_ = T0.descriptionWithDates, fZ = er.ONEDAY, Fi = $r, Kg = Fi.HOUR_PATTERN, Jg = Fi.WEEKDAY_PATTERN, Eh = { valType: "enumerated", values: ["auto", "linear", "array"], editType: "ticks", impliedEdits: { tick0: void 0, dtick: void 0 }, description: [ "Sets the tick mode for this axis.", "If *auto*, the number of ticks is set via `nticks`.", "If *linear*, the placement of the ticks is determined by", "a starting position `tick0` and a tick step `dtick`", "(*linear* is the default value if `tick0` and `dtick` are provided).", "If *array*, the placement of the ticks is set via `tickvals`", "and the tick text is `ticktext`.", "(*array* is the default value if `tickvals` is provided)." ].join(" ") }, hZ = sx({}, Eh, { values: Eh.values.slice().concat(["sync"]), description: [ Eh.description, "If *sync*, the number of ticks will sync with the overlayed axis", "set by `overlaying` property." ].join(" ") }); function Z_(e) { return { valType: "integer", min: 0, dflt: e ? 5 : 0, editType: "ticks", description: [ "Specifies the maximum number of ticks for the particular axis.", "The actual number of ticks will be chosen automatically to be", "less than or equal to `nticks`.", "Has an effect only if `tickmode` is set to *auto*." ].join(" ") }; } var Y_ = { valType: "any", editType: "ticks", impliedEdits: { tickmode: "linear" }, description: [ "Sets the placement of the first tick on this axis.", "Use with `dtick`.", "If the axis `type` is *log*, then you must take the log of your starting tick", "(e.g. to set the starting tick to 100, set the `tick0` to 2)", "except when `dtick`=*L* (see `dtick` for more info).", "If the axis `type` is *date*, it should be a date string, like date data.", "If the axis `type` is *category*, it should be a number, using the scale where", "each category is assigned a serial number from zero in the order it appears." ].join(" ") }, $_ = { valType: "any", editType: "ticks", impliedEdits: { tickmode: "linear" }, description: [ "Sets the step in-between ticks on this axis. Use with `tick0`.", "Must be a positive number, or special strings available to *log* and *date* axes.", "If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n", "is the tick number. For example,", "to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.", "To set tick marks at 1, 100, 10000, ... set dtick to 2.", "To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.", "*log* has several special values; *L*, where `f` is a positive number,", "gives ticks linearly spaced in value (but not position).", "For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.", "To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).", "`tick0` is ignored for *D1* and *D2*.", "If the axis `type` is *date*, then you must convert the time to milliseconds.", "For example, to set the interval between ticks to one day,", "set `dtick` to 86400000.0.", "*date* also has special values *M* gives ticks spaced by a number of months.", "`n` must be a positive integer.", "To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.", "To set ticks every 4 years, set `dtick` to *M48*" ].join(" ") }, K_ = { valType: "data_array", editType: "ticks", description: [ "Sets the values at which ticks on this axis appear.", "Only has an effect if `tickmode` is set to *array*.", "Used with `ticktext`." ].join(" ") }, J_ = { valType: "enumerated", values: ["outside", "inside", ""], editType: "ticks", description: [ "Determines whether ticks are drawn or not.", "If **, this axis' ticks are not drawn.", "If *outside* (*inside*), this axis' are drawn outside (inside)", "the axis lines." ].join(" ") }; function Q_(e) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the tick length (in px)." }; return e || (t.dflt = 5), t; } function X_(e) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the tick width (in px)." }; return e || (t.dflt = 1), t; } var ek = { valType: "color", dflt: sc.defaultLine, editType: "ticks", description: "Sets the tick color." }, tk = { valType: "color", dflt: sc.lightLine, editType: "ticks", description: "Sets the color of the grid lines." }; function nk(e) { var t = { valType: "number", min: 0, editType: "ticks", description: "Sets the width (in px) of the grid lines." }; return e || (t.dflt = 1), t; } var rk = sx({}, uL, { editType: "ticks" }), ak = { valType: "boolean", editType: "ticks", description: [ "Determines whether or not grid lines are drawn.", "If *true*, the grid lines are drawn at every tick mark." ].join(" ") }, Ji = { visible: { valType: "boolean", editType: "plot", description: [ "A single toggle to hide the axis while preserving interaction like dragging.", "Default is true when a cheater plot is present on the axis, otherwise", "false" ].join(" ") }, color: { valType: "color", dflt: sc.defaultLine, editType: "ticks", description: [ "Sets default for all colors associated with this axis", "all at once: line, font, tick, and grid colors.", "Grid color is lightened by blending this with the plot background", "Individual pieces can override this." ].join(" ") }, title: { text: { valType: "string", editType: "ticks", description: [ "Sets the title of this axis.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: $g({ editType: "ticks", description: [ "Sets this axis' title font.", "Note that the title's font used to be customized", "by the now deprecated `titlefont` attribute." ].join(" ") }), standoff: { valType: "number", min: 0, editType: "ticks", description: [ "Sets the standoff distance (in px) between the axis labels and the title text", "The default value is a function of the axis tick labels, the title `font.size`", "and the axis `linewidth`.", "Note that the axis title position is always constrained within the margins,", "so the actual standoff distance is always less than the set or default value.", "By setting `standoff` and turning on `automargin`, plotly.js will push the", "margins to fit the axis title at given standoff distance." ].join(" ") }, editType: "ticks" }, type: { valType: "enumerated", // '-' means we haven't yet run autotype or couldn't find any data // it gets turned into linear in gd._fullLayout but not copied back // to gd.data like the others are. values: ["-", "linear", "log", "date", "category", "multicategory"], dflt: "-", editType: "calc", // we forget when an axis has been autotyped, just writing the auto // value back to the input - so it doesn't make sense to template this. // Note: we do NOT prohibit this in `coerce`, so if someone enters a // type in the template explicitly it will be honored as the default. _noTemplating: !0, description: [ "Sets the axis type.", "By default, plotly attempts to determined the axis type", "by looking into the data of the traces that referenced", "the axis in question." ].join(" ") }, autotypenumbers: { valType: "enumerated", values: ["convert types", "strict"], dflt: "convert types", editType: "calc", description: [ "Using *strict* a numeric string in trace data is not converted to a number.", "Using *convert types* a numeric string in trace data may be", "treated as a number during automatic axis `type` detection.", "Defaults to layout.autotypenumbers." ].join(" ") }, autorange: { valType: "enumerated", values: [!0, !1, "reversed", "min reversed", "max reversed", "min", "max"], dflt: !0, editType: "axrange", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Determines whether or not the range of this axis is", "computed in relation to the input data.", "See `rangemode` for more info.", "If `range` is provided and it has a value for both the", "lower and upper bound, `autorange` is set to *false*.", "Using *min* applies autorange only to set the minimum.", "Using *max* applies autorange only to set the maximum.", "Using *min reversed* applies autorange only to set the minimum on a reversed axis.", "Using *max reversed* applies autorange only to set the maximum on a reversed axis.", "Using *reversed* applies autorange on both ends and reverses the axis direction." ].join(" ") }, autorangeoptions: { minallowed: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Use this value exactly as autorange minimum." ].join(" ") }, maxallowed: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Use this value exactly as autorange maximum." ].join(" ") }, clipmin: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Clip autorange minimum if it goes beyond this value.", "Has no effect when `autorangeoptions.minallowed` is provided." ].join(" ") }, clipmax: { valType: "any", editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Clip autorange maximum if it goes beyond this value.", "Has no effect when `autorangeoptions.maxallowed` is provided." ].join(" ") }, include: { valType: "any", arrayOk: !0, editType: "plot", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Ensure this value is included in autorange." ].join(" ") }, editType: "plot" }, rangemode: { valType: "enumerated", values: ["normal", "tozero", "nonnegative"], dflt: "normal", editType: "plot", description: [ "If *normal*, the range is computed in relation to the extrema", "of the input data.", "If *tozero*`, the range extends to 0,", "regardless of the input data", "If *nonnegative*, the range is non-negative,", "regardless of the input data.", "Applies only to linear axes." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "axrange", impliedEdits: { "^autorange": !1 }, anim: !0 }, { valType: "any", editType: "axrange", impliedEdits: { "^autorange": !1 }, anim: !0 } ], editType: "axrange", impliedEdits: { autorange: !1 }, anim: !0, description: [ "Sets the range of this axis.", "If the axis `type` is *log*, then you must take the log of your", "desired range (e.g. to set the range from 1 to 100,", "set the range from 0 to 2).", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears.", "Leaving either or both elements `null` impacts the default `autorange`." ].join(" ") }, minallowed: { valType: "any", editType: "plot", impliedEdits: { "^autorange": !1 }, description: [ "Determines the minimum range of this axis." ].join(" ") }, maxallowed: { valType: "any", editType: "plot", impliedEdits: { "^autorange": !1 }, description: [ "Determines the maximum range of this axis." ].join(" ") }, fixedrange: { valType: "boolean", dflt: !1, editType: "calc", description: [ "Determines whether or not this axis is zoom-able.", "If true, then zoom is disabled." ].join(" ") }, insiderange: { valType: "info_array", items: [ { valType: "any", editType: "plot" }, { valType: "any", editType: "plot" } ], editType: "plot", description: [ "Could be used to set the desired inside range of this axis", "(excluding the labels) when `ticklabelposition` of", "the anchored axis has *inside*.", "Not implemented for axes with `type` *log*.", "This would be ignored when `range` is provided." ].join(" ") }, // scaleanchor: not used directly, just put here for reference // values are any opposite-letter axis id, or `false`. scaleanchor: { valType: "enumerated", values: [ Fi.idRegex.x.toString(), Fi.idRegex.y.toString(), !1 ], editType: "plot", description: [ "If set to another axis id (e.g. `x2`, `y`), the range of this axis", "changes together with the range of the corresponding axis", "such that the scale of pixels per unit is in a constant ratio.", "Both axes are still zoomable, but when you zoom one, the other will", "zoom the same amount, keeping a fixed midpoint.", "`constrain` and `constraintoward` determine how we enforce the constraint.", "You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}`", "but you can only link axes of the same `type`.", "The linked axis can have the opposite letter (to constrain the aspect ratio)", "or the same letter (to match scales across subplots).", "Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant", "and the last constraint encountered will be ignored to avoid possible", "inconsistent constraints via `scaleratio`.", "Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint", "is currently forbidden.", "Setting `false` allows to remove a default constraint (occasionally,", "you may need to prevent a default `scaleanchor` constraint from", 'being applied, eg. when having an image trace `yaxis: {scaleanchor: "x"}`', "is set automatically in order for pixels to be rendered as squares,", "setting `yaxis: {scaleanchor: false}` allows to remove the constraint)." ].join(" ") }, scaleratio: { valType: "number", min: 0, dflt: 1, editType: "plot", description: [ "If this axis is linked to another by `scaleanchor`, this determines the pixel", "to unit scale ratio. For example, if this value is 10, then every unit on", "this axis spans 10 times the number of pixels as a unit on the linked axis.", "Use this for example to create an elevation profile where the vertical scale", "is exaggerated a fixed amount with respect to the horizontal." ].join(" ") }, constrain: { valType: "enumerated", values: ["range", "domain"], editType: "plot", description: [ "If this axis needs to be compressed (either due to its own `scaleanchor` and", "`scaleratio` or those of the other axis), determines how that happens:", "by increasing the *range*, or by decreasing the *domain*.", "Default is *domain* for axes containing image traces, *range* otherwise." ].join(" ") }, // constraintoward: not used directly, just put here for reference constraintoward: { valType: "enumerated", values: ["left", "center", "right", "top", "middle", "bottom"], editType: "plot", description: [ "If this axis needs to be compressed (either due to its own `scaleanchor` and", "`scaleratio` or those of the other axis), determines which direction we push", "the originally specified plot area. Options are *left*, *center* (default),", "and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes." ].join(" ") }, matches: { valType: "enumerated", values: [ Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "calc", description: [ "If set to another axis id (e.g. `x2`, `y`), the range of this axis", "will match the range of the corresponding axis in data-coordinates space.", "Moreover, matching axes share auto-range values, category lists and", "histogram auto-bins.", "Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint", "is currently forbidden.", "Moreover, note that matching axes must have the same `type`." ].join(" ") }, rangebreaks: G_("rangebreak", { enabled: { valType: "boolean", dflt: !0, editType: "calc", description: [ "Determines whether this axis rangebreak is enabled or disabled.", "Please note that `rangebreaks` only work for *date* axis type." ].join(" ") }, bounds: { valType: "info_array", items: [ { valType: "any", editType: "calc" }, { valType: "any", editType: "calc" } ], editType: "calc", description: [ "Sets the lower and upper bounds of this axis rangebreak.", "Can be used with `pattern`." ].join(" ") }, pattern: { valType: "enumerated", values: [Jg, Kg, ""], editType: "calc", description: [ "Determines a pattern on the time line that generates breaks.", "If *" + Jg + "* - days of the week in English e.g. 'Sunday' or `sun`", "(matching is case-insensitive and considers only the first three characters),", "as well as Sunday-based integers between 0 and 6.", "If *" + Kg + "* - hour (24-hour clock) as decimal numbers between 0 and 24.", "for more info.", "Examples:", "- { pattern: '" + Jg + "', bounds: [6, 1] }", " or simply { bounds: ['sat', 'mon'] }", " breaks from Saturday to Monday (i.e. skips the weekends).", "- { pattern: '" + Kg + "', bounds: [17, 8] }", " breaks from 5pm to 8am (i.e. skips non-work hours)." ].join(" ") }, values: { valType: "info_array", freeLength: !0, editType: "calc", items: { valType: "any", editType: "calc" }, description: [ "Sets the coordinate values corresponding to the rangebreaks.", "An alternative to `bounds`.", "Use `dvalue` to set the size of the values along the axis." ].join(" ") }, dvalue: { // TODO could become 'any' to add support for 'months', 'years' valType: "number", editType: "calc", min: 0, dflt: fZ, description: [ "Sets the size of each `values` item.", "The default is one day in milliseconds." ].join(" ") }, /* gap: { valType: 'number', min: 0, dflt: 0, // for *date* axes, maybe something else for *linear* editType: 'calc', description: [ 'Sets the gap distance between the start and the end of this rangebreak.', 'Use with `gapmode` to set the unit of measurement.' ].join(' ') }, gapmode: { valType: 'enumerated', values: ['pixels', 'fraction'], dflt: 'pixels', editType: 'calc', description: [ 'Determines if the `gap` value corresponds to a pixel length', 'or a fraction of the plot area.' ].join(' ') }, */ // To complete https://github.com/plotly/plotly.js/issues/4210 // we additionally need `gap` and make this work on *linear*, and // possibly all other cartesian axis types. We possibly would also need // some style attributes controlling the zig-zag on the corresponding // axis. editType: "calc" }), // ticks tickmode: hZ, nticks: Z_(), tick0: Y_, dtick: $_, ticklabelstep: { valType: "integer", min: 1, dflt: 1, editType: "ticks", description: [ "Sets the spacing between tick labels as compared to the spacing between ticks.", "A value of 1 (default) means each tick gets a label.", "A value of 2 means shows every 2nd label.", "A larger value n means only every nth tick is labeled.", "`tick0` determines which labels are shown.", "Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*." ].join(" ") }, tickvals: K_, ticktext: { valType: "data_array", editType: "ticks", description: [ "Sets the text displayed at the ticks position via `tickvals`.", "Only has an effect if `tickmode` is set to *array*.", "Used with `tickvals`." ].join(" ") }, ticks: J_, tickson: { valType: "enumerated", values: ["labels", "boundaries"], dflt: "labels", editType: "ticks", description: [ "Determines where ticks and grid lines are drawn with respect to their", "corresponding tick labels.", "Only has an effect for axes of `type` *category* or *multicategory*.", "When set to *boundaries*, ticks and grid lines are drawn half a category", "to the left/bottom of labels." ].join(" ") }, ticklabelmode: { valType: "enumerated", values: ["instant", "period"], dflt: "instant", editType: "ticks", description: [ "Determines where tick labels are drawn with respect to their", "corresponding ticks and grid lines.", "Only has an effect for axes of `type` *date*", "When set to *period*, tick labels are drawn in the middle of the period", "between ticks." ].join(" ") }, // ticklabelposition: not used directly, as values depend on direction (similar to side) // left/right options are for x axes, and top/bottom options are for y axes ticklabelposition: { valType: "enumerated", values: [ "outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom" ], dflt: "outside", editType: "calc", description: [ "Determines where tick labels are drawn with respect to the axis", "Please note that", "top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*.", "Similarly", "left or right has no effect on y axes or when `ticklabelmode` is set to *period*.", "Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.", "When used on axes linked by `matches` or `scaleanchor`,", "no extra padding for inside labels would be added by autorange,", "so that the scales could match." ].join(" ") }, ticklabeloverflow: { valType: "enumerated", values: [ "allow", "hide past div", "hide past domain" ], editType: "calc", description: [ "Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.", "The default value for inside tick labels is *hide past domain*.", "Otherwise on *category* and *multicategory* axes the default is *allow*.", "In other cases the default is *hide past div*." ].join(" ") }, mirror: { valType: "enumerated", values: [!0, "ticks", !1, "all", "allticks"], dflt: !1, editType: "ticks+layoutstyle", description: [ "Determines if the axis lines or/and ticks are mirrored to", "the opposite side of the plotting area.", "If *true*, the axis lines are mirrored.", "If *ticks*, the axis lines and ticks are mirrored.", "If *false*, mirroring is disable.", "If *all*, axis lines are mirrored on all shared-axes subplots.", "If *allticks*, axis lines and ticks are mirrored", "on all shared-axes subplots." ].join(" ") }, ticklen: Q_(), tickwidth: X_(), tickcolor: ek, showticklabels: { valType: "boolean", dflt: !0, editType: "ticks", description: "Determines whether or not the tick labels are drawn." }, labelalias: { valType: "any", dflt: !1, editType: "ticks", description: [ "Replacement text for specific tick or hover labels.", "For example using {US: 'USA', CA: 'Canada'} changes US to USA", "and CA to Canada. The labels we would have shown must match", "the keys exactly, after adding any tickprefix or ticksuffix.", "For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash.", "That means you need to use −1 instead of -1.", "labelalias can be used with any axis type, and both keys (if needed)", "and values (if desired) can include html-like tags or MathJax." ].join(" ") }, automargin: { valType: "flaglist", flags: ["height", "width", "left", "right", "top", "bottom"], extras: [!0, !1], dflt: !1, editType: "ticks", description: [ "Determines whether long tick labels automatically grow the figure", "margins." ].join(" ") }, showspikes: { valType: "boolean", dflt: !1, editType: "modebar", description: [ "Determines whether or not spikes (aka droplines) are drawn for this axis.", "Note: This only takes affect when hovermode = closest" ].join(" ") }, spikecolor: { valType: "color", dflt: null, editType: "none", description: "Sets the spike color. If undefined, will use the series color" }, spikethickness: { valType: "number", dflt: 3, editType: "none", description: "Sets the width (in px) of the zero line." }, spikedash: sx({}, uL, { dflt: "dash", editType: "none" }), spikemode: { valType: "flaglist", flags: ["toaxis", "across", "marker"], dflt: "toaxis", editType: "none", description: [ "Determines the drawing mode for the spike line", "If *toaxis*, the line is drawn from the data point to the axis the ", "series is plotted on.", "If *across*, the line is drawn across the entire plot area, and", "supercedes *toaxis*.", "If *marker*, then a marker dot is drawn on the axis the series is", "plotted on" ].join(" ") }, spikesnap: { valType: "enumerated", values: ["data", "cursor", "hovered data"], dflt: "hovered data", editType: "none", description: "Determines whether spikelines are stuck to the cursor or to the closest datapoints." }, tickfont: $g({ editType: "ticks", description: "Sets the tick font." }), tickangle: { valType: "angle", dflt: "auto", editType: "ticks", description: [ "Sets the angle of the tick labels with respect to the horizontal.", "For example, a `tickangle` of -90 draws the tick labels", "vertically." ].join(" ") }, tickprefix: { valType: "string", dflt: "", editType: "ticks", description: "Sets a tick label prefix." }, showtickprefix: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: [ "If *all*, all tick labels are displayed with a prefix.", "If *first*, only the first tick is displayed with a prefix.", "If *last*, only the last tick is displayed with a suffix.", "If *none*, tick prefixes are hidden." ].join(" ") }, ticksuffix: { valType: "string", dflt: "", editType: "ticks", description: "Sets a tick label suffix." }, showticksuffix: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: "Same as `showtickprefix` but for tick suffixes." }, showexponent: { valType: "enumerated", values: ["all", "first", "last", "none"], dflt: "all", editType: "ticks", description: [ "If *all*, all exponents are shown besides their significands.", "If *first*, only the exponent of the first tick is shown.", "If *last*, only the exponent of the last tick is shown.", "If *none*, no exponents appear." ].join(" ") }, exponentformat: { valType: "enumerated", values: ["none", "e", "E", "power", "SI", "B"], dflt: "B", editType: "ticks", description: [ "Determines a formatting rule for the tick exponents.", "For example, consider the number 1,000,000,000.", "If *none*, it appears as 1,000,000,000.", "If *e*, 1e+9.", "If *E*, 1E+9.", "If *power*, 1x10^9 (with 9 in a super script).", "If *SI*, 1G.", "If *B*, 1B." ].join(" ") }, minexponent: { valType: "number", dflt: 3, min: 0, editType: "ticks", description: [ "Hide SI prefix for 10^n if |n| is below this number.", "This only has an effect when `tickformat` is *SI* or *B*." ].join(" ") }, separatethousands: { valType: "boolean", dflt: !1, editType: "ticks", description: [ 'If "true", even 4-digit integers are separated' ].join(" ") }, tickformat: { valType: "string", dflt: "", editType: "ticks", description: W_("tick label") }, tickformatstops: G_("tickformatstop", { enabled: { valType: "boolean", dflt: !0, editType: "ticks", description: [ "Determines whether or not this stop is used.", "If `false`, this stop is ignored even within its `dtickrange`." ].join(" ") }, dtickrange: { valType: "info_array", items: [ { valType: "any", editType: "ticks" }, { valType: "any", editType: "ticks" } ], editType: "ticks", description: [ "range [*min*, *max*], where *min*, *max* - dtick values", "which describe some zoom level, it is possible to omit *min*", "or *max* value by passing *null*" ].join(" ") }, value: { valType: "string", dflt: "", editType: "ticks", description: [ "string - dtickformat for described zoom level, the same as *tickformat*" ].join(" ") }, editType: "ticks" }), hoverformat: { valType: "string", dflt: "", editType: "none", description: W_("hover text") }, // lines and grids showline: { valType: "boolean", dflt: !1, editType: "ticks+layoutstyle", description: [ "Determines whether or not a line bounding this axis is drawn." ].join(" ") }, linecolor: { valType: "color", dflt: sc.defaultLine, editType: "layoutstyle", description: "Sets the axis line color." }, linewidth: { valType: "number", min: 0, dflt: 1, editType: "ticks+layoutstyle", description: "Sets the width (in px) of the axis line." }, showgrid: ak, gridcolor: tk, gridwidth: nk(), griddash: rk, zeroline: { valType: "boolean", editType: "ticks", description: [ "Determines whether or not a line is drawn at along the 0 value", "of this axis.", "If *true*, the zero line is drawn on top of the grid lines." ].join(" ") }, zerolinecolor: { valType: "color", dflt: sc.defaultLine, editType: "ticks", description: "Sets the line color of the zero line." }, zerolinewidth: { valType: "number", dflt: 1, editType: "ticks", description: "Sets the width (in px) of the zero line." }, showdividers: { valType: "boolean", dflt: !0, editType: "ticks", description: [ "Determines whether or not a dividers are drawn", "between the category levels of this axis.", "Only has an effect on *multicategory* axes." ].join(" ") }, dividercolor: { valType: "color", dflt: sc.defaultLine, editType: "ticks", description: [ "Sets the color of the dividers", "Only has an effect on *multicategory* axes." ].join(" ") }, dividerwidth: { valType: "number", dflt: 1, editType: "ticks", description: [ "Sets the width (in px) of the dividers", "Only has an effect on *multicategory* axes." ].join(" ") }, // TODO dividerlen: that would override "to label base" length? // positioning attributes // anchor: not used directly, just put here for reference // values are any opposite-letter axis id anchor: { valType: "enumerated", values: [ "free", Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "plot", description: [ "If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to", "the corresponding opposite-letter axis.", "If set to *free*, this axis' position is determined by `position`." ].join(" ") }, // side: not used directly, as values depend on direction // values are top, bottom for x axes, and left, right for y side: { valType: "enumerated", values: ["top", "bottom", "left", "right"], editType: "plot", description: [ "Determines whether a x (y) axis is positioned", "at the *bottom* (*left*) or *top* (*right*)", "of the plotting area." ].join(" ") }, // overlaying: not used directly, just put here for reference // values are false and any other same-letter axis id that's not // itself overlaying anything overlaying: { valType: "enumerated", values: [ "free", Fi.idRegex.x.toString(), Fi.idRegex.y.toString() ], editType: "plot", description: [ "If set a same-letter axis id, this axis is overlaid on top of", "the corresponding same-letter axis, with traces and axes visible for both", "axes.", "If *false*, this axis does not overlay any same-letter axes.", "In this case, for axes with overlapping domains only the highest-numbered", "axis will be visible." ].join(" ") }, minor: { tickmode: Eh, nticks: Z_("minor"), tick0: Y_, dtick: $_, tickvals: K_, ticks: J_, ticklen: Q_("minor"), tickwidth: X_("minor"), tickcolor: ek, gridcolor: tk, gridwidth: nk("minor"), griddash: rk, showgrid: ak, editType: "ticks" }, layer: { valType: "enumerated", values: ["above traces", "below traces"], dflt: "above traces", editType: "plot", description: [ "Sets the layer on which this axis is displayed.", "If *above traces*, this axis is displayed above all the subplot's traces", "If *below traces*, this axis is displayed below all the subplot's traces,", "but above the grid lines.", "Useful when used together with scatter-like traces with `cliponaxis`", "set to *false* to show markers and/or text nodes above this axis." ].join(" ") }, domain: { valType: "info_array", items: [ { valType: "number", min: 0, max: 1, editType: "plot" }, { valType: "number", min: 0, max: 1, editType: "plot" } ], dflt: [0, 1], editType: "plot", description: [ "Sets the domain of this axis (in plot fraction)." ].join(" ") }, position: { valType: "number", min: 0, max: 1, dflt: 0, editType: "plot", description: [ "Sets the position of this axis in the plotting space", "(in normalized coordinates).", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, autoshift: { valType: "boolean", dflt: !1, editType: "plot", description: [ "Automatically reposition the axis to avoid", "overlap with other axes with the same `overlaying` value.", "This repositioning will account for any `shift` amount applied to other", "axes on the same side with `autoshift` is set to true.", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, shift: { valType: "number", editType: "plot", description: [ "Moves the axis a given number of pixels from where it would have been otherwise.", "Accepts both positive and negative values, which will shift the axis either right", "or left, respectively.", "If `autoshift` is set to true, then this defaults to a padding of -3 if `side` is set to *left*.", "and defaults to +3 if `side` is set to *right*. Defaults to 0 if `autoshift` is set to false.", "Only has an effect if `anchor` is set to *free*." ].join(" ") }, categoryorder: { valType: "enumerated", values: [ "trace", "category ascending", "category descending", "array", "total ascending", "total descending", "min ascending", "min descending", "max ascending", "max descending", "sum ascending", "sum descending", "mean ascending", "mean descending", "median ascending", "median descending" ], dflt: "trace", editType: "calc", description: [ "Specifies the ordering logic for the case of categorical variables.", "By default, plotly uses *trace*, which specifies the order that is present in the data supplied.", "Set `categoryorder` to *category ascending* or *category descending* if order should be determined by", "the alphanumerical order of the category names.", "Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category", "is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to", "the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", "Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the", "numerical order of the values.", "Similarly, the order can be determined by the min, max, sum, mean or median of all the values." ].join(" ") }, categoryarray: { valType: "data_array", editType: "calc", description: [ "Sets the order in which categories on this axis appear.", "Only has an effect if `categoryorder` is set to *array*.", "Used with `categoryorder`." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes in axis `range`,", "`autorange`, and `title` if in `editable: true` configuration.", "Defaults to `layout.uirevision`." ].join(" ") }, editType: "calc", _deprecated: { autotick: { valType: "boolean", editType: "ticks", description: [ "Obsolete.", "Set `tickmode` to *auto* for old `autotick` *true* behavior.", "Set `tickmode` to *linear* for `autotick` *false*." ].join(" ") }, title: { valType: "string", editType: "ticks", description: [ "Value of `title` is no longer a simple *string* but a set of sub-attributes.", "To set the axis' title, please use `title.text` now." ].join(" ") }, titlefont: $g({ editType: "ticks", description: [ "Former `titlefont` is now the sub-attribute `font` of `title`.", "To customize title font properties, please use `title.font` now." ].join(" ") }) } }, Rn = Ji, Qg = Fr, ik = tr.extendFlat, pZ = Lo.overrideAll, cx = pZ({ orientation: { valType: "enumerated", values: ["h", "v"], dflt: "v", description: "Sets the orientation of the colorbar." }, thicknessmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "pixels", description: [ "Determines whether this color bar's thickness", "(i.e. the measure in the constant color direction)", "is set in units of plot *fraction* or in *pixels*.", "Use `thickness` to set the value." ].join(" ") }, thickness: { valType: "number", min: 0, dflt: 30, description: [ "Sets the thickness of the color bar", "This measure excludes the size of the padding, ticks and labels." ].join(" ") }, lenmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "fraction", description: [ "Determines whether this color bar's length", "(i.e. the measure in the color variation direction)", "is set in units of plot *fraction* or in *pixels.", "Use `len` to set the value." ].join(" ") }, len: { valType: "number", min: 0, dflt: 1, description: [ "Sets the length of the color bar", "This measure excludes the padding of both ends.", "That is, the color bar length is this length minus the", "padding on both ends." ].join(" ") }, x: { valType: "number", description: [ "Sets the x position with respect to `xref` of the color bar (in plot fraction).", "When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and", "0.5 when `orientation` is *h*.", "When `xref` is *container*, defaults to *1* when `orientation` is *v* and", "0.5 when `orientation` is *h*.", "Must be between *0* and *1* if `xref` is *container*", "and between *-2* and *3* if `xref` is *paper*." ].join(" ") }, xref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], description: [ "Sets this color bar's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the color bar.", "Defaults to *left* when `orientation` is *v* and", "*center* when `orientation` is *h*." ].join(" ") }, xpad: { valType: "number", min: 0, dflt: 10, description: "Sets the amount of padding (in px) along the x direction." }, y: { valType: "number", description: [ "Sets the y position with respect to `yref` of the color bar (in plot fraction).", "When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and", "1.02 when `orientation` is *h*.", "When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and", "1 when `orientation` is *h*.", "Must be between *0* and *1* if `yref` is *container*", "and between *-2* and *3* if `yref` is *paper*." ].join(" ") }, yref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], description: [ "Sets this color bar's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the color bar.", "Defaults to *middle* when `orientation` is *v* and", "*bottom* when `orientation` is *h*." ].join(" ") }, ypad: { valType: "number", min: 0, dflt: 10, description: "Sets the amount of padding (in px) along the y direction." }, // a possible line around the bar itself outlinecolor: Rn.linecolor, outlinewidth: Rn.linewidth, // Should outlinewidth have {dflt: 0} ? // another possible line outside the padding and tick labels bordercolor: Rn.linecolor, borderwidth: { valType: "number", min: 0, dflt: 0, description: [ "Sets the width (in px) or the border enclosing this color bar." ].join(" ") }, bgcolor: { valType: "color", dflt: "rgba(0,0,0,0)", description: "Sets the color of padded area." }, // tick and title properties named and function exactly as in axes tickmode: Rn.minor.tickmode, nticks: Rn.nticks, tick0: Rn.tick0, dtick: Rn.dtick, tickvals: Rn.tickvals, ticktext: Rn.ticktext, ticks: ik({}, Rn.ticks, { dflt: "" }), ticklabeloverflow: ik({}, Rn.ticklabeloverflow, { description: [ "Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.", "The default value for inside tick labels is *hide past domain*.", "In other cases the default is *hide past div*." ].join(" ") }), // ticklabelposition: not used directly, as values depend on orientation // left/right options are for x axes, and top/bottom options are for y axes ticklabelposition: { valType: "enumerated", values: [ "outside", "inside", "outside top", "inside top", "outside left", "inside left", "outside right", "inside right", "outside bottom", "inside bottom" ], dflt: "outside", description: [ "Determines where tick labels are drawn relative to the ticks.", "Left and right options are used when `orientation` is *h*,", "top and bottom when `orientation` is *v*." ].join(" ") }, ticklen: Rn.ticklen, tickwidth: Rn.tickwidth, tickcolor: Rn.tickcolor, ticklabelstep: Rn.ticklabelstep, showticklabels: Rn.showticklabels, labelalias: Rn.labelalias, tickfont: Qg({ description: "Sets the color bar's tick label font" }), tickangle: Rn.tickangle, tickformat: Rn.tickformat, tickformatstops: Rn.tickformatstops, tickprefix: Rn.tickprefix, showtickprefix: Rn.showtickprefix, ticksuffix: Rn.ticksuffix, showticksuffix: Rn.showticksuffix, separatethousands: Rn.separatethousands, exponentformat: Rn.exponentformat, minexponent: Rn.minexponent, showexponent: Rn.showexponent, title: { text: { valType: "string", description: [ "Sets the title of the color bar.", "Note that before the existence of `title.text`, the title's", "contents used to be defined as the `title` attribute itself.", "This behavior has been deprecated." ].join(" ") }, font: Qg({ description: [ "Sets this color bar's title font.", "Note that the title's font used to be set", "by the now deprecated `titlefont` attribute." ].join(" ") }), side: { valType: "enumerated", values: ["right", "top", "bottom"], description: [ "Determines the location of color bar's title", "with respect to the color bar.", "Defaults to *top* when `orientation` if *v* and ", "defaults to *right* when `orientation` if *h*.", "Note that the title's location used to be set", "by the now deprecated `titleside` attribute." ].join(" ") } }, _deprecated: { title: { valType: "string", description: [ "Deprecated in favor of color bar's `title.text`.", "Note that value of color bar's `title` is no longer a simple", "*string* but a set of sub-attributes." ].join(" ") }, titlefont: Qg({ description: "Deprecated in favor of color bar's `title.font`." }), titleside: { valType: "enumerated", values: ["right", "top", "bottom"], dflt: "top", description: "Deprecated in favor of color bar's `title.side`." } } }, "colorbars", "from-root"), gZ = cx, vZ = Zc.counter, mZ = kC, dL = Wc.scales, yZ = mZ(dL); function ku(e) { return "`" + e + "`"; } var Jd = function(e, t) { e = e || "", t = t || {}; var n = t.cLetter || "c", r = "onlyIfNumerical" in t ? t.onlyIfNumerical : !!e, a = "noScale" in t ? t.noScale : e === "marker.line", i = "showScaleDflt" in t ? t.showScaleDflt : n === "z", o = typeof t.colorscaleDflt == "string" ? dL[t.colorscaleDflt] : null, l = t.editTypeOverride || "", s = e ? e + "." : "", c, u; "colorAttr" in t ? (c = t.colorAttr, u = t.colorAttr) : (c = { z: "z", c: "color" }[n], u = "in " + ku(s + c)); var f = r ? " Has an effect only if " + u + " is set to a numerical array." : "", h = n + "auto", g = n + "min", p = n + "max", v = n + "mid", y = ku(s + h), m = ku(s + g), b = ku(s + p), w = m + " and " + b, _ = {}; _[g] = _[p] = void 0; var k = {}; k[h] = !1; var T = {}; return c === "color" && (T.color = { valType: "color", arrayOk: !0, editType: l || "style", description: [ "Sets the", e, "color.", "It accepts either a specific color", "or an array of numbers that are mapped to the colorscale", "relative to the max and min values of the array or relative to", w, "if set." ].join(" ") }, t.anim && (T.color.anim = !0)), T[h] = { valType: "boolean", dflt: !0, editType: "calc", impliedEdits: _, description: [ "Determines whether or not the color domain is computed", "with respect to the input data (here " + u + ") or the bounds set in", w + f, "Defaults to `false` when", w, "are set by the user." ].join(" ") }, T[g] = { valType: "number", dflt: null, editType: l || "plot", impliedEdits: k, description: [ "Sets the lower bound of the color domain." + f, "Value should have the same units as", u, "and if set,", b, "must be set as well." ].join(" ") }, T[p] = { valType: "number", dflt: null, editType: l || "plot", impliedEdits: k, description: [ "Sets the upper bound of the color domain." + f, "Value should have the same units as", u, "and if set,", m, "must be set as well." ].join(" ") }, T[v] = { valType: "number", dflt: null, editType: "calc", impliedEdits: _, description: [ "Sets the mid-point of the color domain by scaling", m, "and/or", b, "to be equidistant to this point." + f, "Value should have the same units as", u + ".", "Has no effect when", y, "is `false`." ].join(" ") }, T.colorscale = { valType: "colorscale", editType: "calc", dflt: o, impliedEdits: { autocolorscale: !1 }, description: [ "Sets the colorscale." + f, "The colorscale must be an array containing", "arrays mapping a normalized value to an", "rgb, rgba, hex, hsl, hsv, or named color string.", "At minimum, a mapping for the lowest (0) and highest (1)", "values are required. For example,", "`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.", "To control the bounds of the colorscale in color space,", "use", w + ".", "Alternatively, `colorscale` may be a palette name string", "of the following list: " + yZ + "." ].join(" ") }, T.autocolorscale = { valType: "boolean", // gets overrode in 'heatmap' & 'surface' for backwards comp. dflt: t.autoColorDflt !== !1, editType: "calc", impliedEdits: { colorscale: void 0 }, description: [ "Determines whether the colorscale is a default palette (`autocolorscale: true`)", "or the palette determined by", ku(s + "colorscale") + "." + f, "In case `colorscale` is unspecified or `autocolorscale` is true, the default", "palette will be chosen according to whether numbers in the `color` array are", "all positive, all negative or mixed." ].join(" ") }, T.reversescale = { valType: "boolean", dflt: !1, editType: "plot", description: [ "Reverses the color mapping if true." + f, "If true,", m, "will correspond to the last color", "in the array and", b, "will correspond to the first color." ].join(" ") }, a || (T.showscale = { valType: "boolean", dflt: i, editType: "calc", description: [ "Determines whether or not a colorbar is displayed for this trace." + f ].join(" ") }, T.colorbar = gZ), t.noColorAxis || (T.coloraxis = { valType: "subplotid", regex: vZ("coloraxis"), dflt: null, editType: "calc", description: [ "Sets a reference to a shared color axis.", "References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc.", "Settings for these shared color axes are set in the layout, under", "`layout.coloraxis`, `layout.coloraxis2`, etc.", "Note that multiple color scales can be linked to the same color axis." ].join(" ") }), T; }, xZ = tr.extendFlat, bZ = Jd, Xg = Wc.scales, ev = "Note that `autocolorscale` must be true for this attribute to work.", fL = { editType: "calc", colorscale: { editType: "calc", sequential: { valType: "colorscale", dflt: Xg.Reds, editType: "calc", description: [ "Sets the default sequential colorscale for positive values.", ev ].join(" ") }, sequentialminus: { valType: "colorscale", dflt: Xg.Blues, editType: "calc", description: [ "Sets the default sequential colorscale for negative values.", ev ].join(" ") }, diverging: { valType: "colorscale", dflt: Xg.RdBu, editType: "calc", description: [ "Sets the default diverging colorscale.", ev ].join(" ") } }, coloraxis: xZ({ // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: !0, editType: "calc", description: [ "" ].join(" ") }, bZ("", { colorAttr: "corresponding trace color array(s)", noColorAxis: !0, showScaleDflt: !0 })) }, wZ = Ue, hL = function(e) { return wZ.isPlainObject(e.colorbar); }, A0 = {}, sy = cn, ok = Ue, pL = er, _Z = pL.ONEDAY, kZ = pL.ONEWEEK; A0.dtick = function(e, t) { var n = t === "log", r = t === "date", a = t === "category", i = r ? _Z : 1; if (!e) return i; if (sy(e)) return e = Number(e), e <= 0 ? i : a ? Math.max(1, Math.round(e)) : r ? Math.max(0.1, e) : e; if (typeof e != "string" || !(r || n)) return i; var o = e.charAt(0), l = e.substr(1); return l = sy(l) ? Number(l) : 0, l <= 0 || !// "M" gives ticks every (integer) n months (r && o === "M" && l === Math.round(l) || // "L" gives ticks linearly spaced in data (not in position) every (float) f n && o === "L" || // "D1" gives powers of 10 with all small digits between, "D2" gives only 2 and 5 n && o === "D" && (l === 1 || l === 2)) ? i : e; }; A0.tick0 = function(e, t, n, r) { if (t === "date") return ok.cleanDate( e, ok.dateTick0(n, r % kZ === 0 ? 1 : 0) ); if (!(r === "D1" || r === "D2")) return sy(e) ? Number(e) : 0; }; var lk = A0, TZ = Ue.isArrayOrTypedArray, AZ = ir.isTypedArraySpec, MZ = ir.decodeTypedArraySpec, gL = function(e, t, n, r, a) { a || (a = {}); var i = a.isMinor, o = i ? e.minor || {} : e, l = i ? t.minor : t, s = i ? "minor." : ""; function c(m) { var b = o[m]; return AZ(b) && (b = MZ(b)), b !== void 0 ? b : (l._template || {})[m]; } var u = c("tick0"), f = c("dtick"), h = c("tickvals"), g = TZ(h) ? "array" : f ? "linear" : "auto", p = n(s + "tickmode", g); if (p === "auto" || p === "sync") n(s + "nticks"); else if (p === "linear") { var v = l.dtick = lk.dtick( f, r ); l.tick0 = lk.tick0( u, r, t.calendar, v ); } else if (r !== "multicategory") { var y = n(s + "tickvals"); y === void 0 ? l.tickmode = "auto" : i || n("ticktext"); } }, tv = Ue, sk = Ji, vL = function(e, t, n, r) { var a = r.isMinor, i = a ? e.minor || {} : e, o = a ? t.minor : t, l = a ? sk.minor : sk, s = a ? "minor." : "", c = tv.coerce2(i, o, l, "ticklen", a ? (t.ticklen || 5) * 0.6 : void 0), u = tv.coerce2(i, o, l, "tickwidth", a ? t.tickwidth || 1 : void 0), f = tv.coerce2(i, o, l, "tickcolor", (a ? t.tickcolor : void 0) || o.color), h = n(s + "ticks", !a && r.outerTicks || c || u || f ? "outside" : ""); h || (delete o.ticklen, delete o.tickwidth, delete o.tickcolor); }, mL = function(e) { var t = ["showexponent", "showtickprefix", "showticksuffix"], n = t.filter(function(a) { return e[a] !== void 0; }), r = function(a) { return e[a] === e[n[0]]; }; if (n.every(r) || n.length === 1) return e[n[0]]; }, qf = Ue, SZ = Sn, Qi = function(e, t, n) { var r = n.name, a = n.inclusionAttr || "visible", i = t[r], o = qf.isArrayOrTypedArray(e[r]) ? e[r] : [], l = t[r] = [], s = SZ.arrayTemplater(t, r, a), c, u; for (c = 0; c < o.length; c++) { var f = o[c]; qf.isPlainObject(f) ? u = s.newItem(f) : (u = s.newItem({}), u[a] = !1), u._index = c, u[a] !== !1 && n.handleItemDefaults(f, u, t, n), l.push(u); } var h = s.defaultItems(); for (c = 0; c < h.length; c++) u = h[c], u._index = l.length, n.handleItemDefaults({}, u, t, n, {}), l.push(u); if (qf.isArrayOrTypedArray(i)) { var g = Math.min(i.length, l.length); for (c = 0; c < g; c++) qf.relinkPrivateKeys(l[c], i[c]); } return l; }, cy = Ue, CZ = rn.contrast, yL = Ji, LZ = mL, OZ = Qi, xL = function(e, t, n, r, a) { a || (a = {}); var i = n("labelalias"); cy.isPlainObject(i) || delete t.labelalias; var o = LZ(e), l = n("showticklabels"); if (l) { var s = a.font || {}, c = t.color, u = t.ticklabelposition || "", f = u.indexOf("inside") !== -1 ? CZ(a.bgColor) : ( // as with titlefont.color, inherit axis.color only if one was // explicitly provided c && c !== yL.color.dflt ? c : s.color ); if (cy.coerceFont(n, "tickfont", { family: s.family, size: s.size, color: f }), !a.noTicklabelstep && r !== "multicategory" && r !== "log" && n("ticklabelstep"), a.noAng || n("tickangle"), r !== "category") { var h = n("tickformat"); OZ(e, t, { name: "tickformatstops", inclusionAttr: "enabled", handleItemDefaults: DZ }), t.tickformatstops.length || delete t.tickformatstops, !a.noExp && !h && r !== "date" && (n("showexponent", o), n("exponentformat"), n("minexponent"), n("separatethousands")); } } }; function DZ(e, t) { function n(a, i) { return cy.coerce(e, t, yL.tickformatstops, a, i); } var r = n("enabled"); r && (n("dtickrange"), n("value")); } var FZ = mL, bL = function(e, t, n, r, a) { a || (a = {}); var i = a.tickSuffixDflt, o = FZ(e), l = n("tickprefix"); l && n("showtickprefix", o); var s = n("ticksuffix", i); s && n("showticksuffix", o); }, Po = Ue, IZ = Sn, zZ = gL, EZ = vL, jZ = xL, PZ = bL, RZ = cx, wL = function(e, t, n) { var r = IZ.newContainer(t, "colorbar"), a = e.colorbar || {}; function i(I, j) { return Po.coerce(a, r, RZ, I, j); } var o = n.margin || { t: 0, b: 0, l: 0, r: 0 }, l = n.width - o.l - o.r, s = n.height - o.t - o.b, c = i("orientation"), u = c === "v", f = i("thicknessmode"); i( "thickness", f === "fraction" ? 30 / (u ? l : s) : 30 ); var h = i("lenmode"); i( "len", h === "fraction" ? 1 : u ? s : l ); var g = i("yref"), p = i("xref"), v = g === "paper", y = p === "paper", m, b, w, _ = "left"; u ? (w = "middle", _ = y ? "left" : "right", m = y ? 1.02 : 1, b = 0.5) : (w = v ? "bottom" : "top", _ = "center", m = 0.5, b = v ? 1.02 : 1), Po.coerce(a, r, { x: { valType: "number", min: y ? -2 : 0, max: y ? 3 : 1, dflt: m } }, "x"), Po.coerce(a, r, { y: { valType: "number", min: v ? -2 : 0, max: v ? 3 : 1, dflt: b } }, "y"), i("xanchor", _), i("xpad"), i("yanchor", w), i("ypad"), Po.noneOrAll(a, r, ["x", "y"]), i("outlinecolor"), i("outlinewidth"), i("bordercolor"), i("borderwidth"), i("bgcolor"); var k = Po.coerce(a, r, { ticklabelposition: { valType: "enumerated", dflt: "outside", values: u ? [ "outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom" ] : [ "outside", "inside", "outside left", "inside left", "outside right", "inside right" ] } }, "ticklabelposition"); i("ticklabeloverflow", k.indexOf("inside") !== -1 ? "hide past domain" : "hide past div"), zZ(a, r, i, "linear"); var T = n.font, O = { outerTicks: !1, font: T }; k.indexOf("inside") !== -1 && (O.bgColor = "black"), PZ(a, r, i, "linear", O), jZ(a, r, i, "linear", O), EZ(a, r, i, "linear"), i("title.text", n._dfltTitle.colorbar); var M = r.showticklabels ? r.tickfont : T, C = Po.extendFlat({}, M, { color: T.color, size: Po.bigFont(M.size) }); Po.coerceFont(i, "title.font", C), i("title.side", u ? "top" : "right"); }, ck = cn, uy = Ue, NZ = hL, BZ = wL, uk = Wc.isValid, HZ = Rt.traceIs; function nv(e, t) { var n = t.slice(0, t.length - 1); return t ? uy.nestedProperty(e, n).get() || {} : e; } var Xc = function e(t, n, r, a, i) { var o = i.prefix, l = i.cLetter, s = "_module" in n, c = nv(t, o), u = nv(n, o), f = nv(n._template || {}, o) || {}, h = function() { return delete t.coloraxis, delete n.coloraxis, e(t, n, r, a, i); }; if (s) { var g = r._colorAxes || {}, p = a(o + "coloraxis"); if (p) { var v = HZ(n, "contour") && uy.nestedProperty(n, "contours.coloring").get() || "heatmap", y = g[p]; y ? (y[2].push(h), y[0] !== v && (y[0] = !1, uy.warn([ "Ignoring coloraxis:", p, "setting", "as it is linked to incompatible colorscales." ].join(" ")))) : g[p] = [v, n, [h]]; return; } } var m = c[l + "min"], b = c[l + "max"], w = ck(m) && ck(b) && m < b, _ = a(o + l + "auto", !w); _ ? a(o + l + "mid") : (a(o + l + "min"), a(o + l + "max")); var k = c.colorscale, T = f.colorscale, O; if (k !== void 0 && (O = !uk(k)), T !== void 0 && (O = !uk(T)), a(o + "autocolorscale", O), a(o + "colorscale"), a(o + "reversescale"), o !== "marker.line.") { var M; o && s && (M = NZ(c)); var C = a(o + "showscale", M); C && (o && f && (u._template = f), BZ(c, u, r)); } }, dk = Ue, VZ = Sn, fk = fL, qZ = Xc, UZ = function(e, t) { function n(u, f) { return dk.coerce(e, t, fk, u, f); } n("colorscale.sequential"), n("colorscale.sequentialminus"), n("colorscale.diverging"); var r = t._colorAxes, a, i; function o(u, f) { return dk.coerce(a, i, fk.coloraxis, u, f); } for (var l in r) { var s = r[l]; if (s[0]) a = e[l] || {}, i = VZ.newContainer(t, l, "coloraxis"), i._name = l, qZ(a, i, t, o, { prefix: "", cLetter: "c" }); else { for (var c = 0; c < s[2].length; c++) s[2][c](); delete t._colorAxes[l]; } } }, GZ = Ue, WZ = _i.hasColorscale, ZZ = _i.extractOpts, YZ = function(e, t) { function n(c, u) { var f = c["_" + u]; f !== void 0 && (c[u] = f); } function r(c, u) { var f = u.container ? GZ.nestedProperty(c, u.container).get() : c; if (f) if (f.coloraxis) f._colorAx = t[f.coloraxis]; else { var h = ZZ(f), g = h.auto; (g || h.min === void 0) && n(f, u.min), (g || h.max === void 0) && n(f, u.max), h.autocolorscale && n(f, "colorscale"); } } for (var a = 0; a < e.length; a++) { var i = e[a], o = i._module.colorbar; if (o) if (Array.isArray(o)) for (var l = 0; l < o.length; l++) r(i, o[l]); else r(i, o); WZ(i, "marker.line") && r(i, { container: "marker.line", min: "cmin", max: "cmax" }); } for (var s in t._colorAxes) r(t[s], { min: "cmin", max: "cmax" }); }, hk = cn, rv = Ue, $Z = _i.extractOpts, M0 = function(e, t, n) { var r = e._fullLayout, a = n.vals, i = n.containerStr, o = i ? rv.nestedProperty(t, i).get() : t, l = $Z(o), s = l.auto !== !1, c = l.min, u = l.max, f = l.mid, h = function() { return rv.aggNums(Math.min, null, a); }, g = function() { return rv.aggNums(Math.max, null, a); }; if (c === void 0 ? c = h() : s && (o._colorAx && hk(c) ? c = Math.min(c, h()) : c = h()), u === void 0 ? u = g() : s && (o._colorAx && hk(u) ? u = Math.max(u, g()) : u = g()), s && f !== void 0 && (u - f > f - c ? c = f - (u - f) : u - f < f - c && (u = f + (f - c))), c === u && (c -= 0.5, u += 0.5), l._sync("min", c), l._sync("max", u), l.autocolorscale) { var p; c * u < 0 ? p = r.colorscale.diverging : c >= 0 ? p = r.colorscale.sequential : p = r.colorscale.sequentialminus, l._sync("colorscale", p); } }, Uf = Wc, Es = _i, Qd = { moduleType: "component", name: "colorscale", attributes: Jd, layoutAttributes: fL, supplyLayoutDefaults: UZ, handleDefaults: Xc, crossTraceDefaults: YZ, calc: M0, // ./scales.js is required in lib/coerce.js ; // it needs to be a separate module to avoid a circular dependency scales: Uf.scales, defaultScale: Uf.defaultScale, getScale: Uf.get, isValidScale: Uf.isValid, hasColorscale: Es.hasColorscale, extractOpts: Es.extractOpts, extractScale: Es.extractScale, flipScale: Es.flipScale, makeColorScaleFunc: Es.makeColorScaleFunc, makeColorScaleFuncFromTrace: Es.makeColorScaleFuncFromTrace }, pk = Ue, KZ = ir.isTypedArraySpec, $a = { hasLines: function(e) { return e.visible && e.mode && e.mode.indexOf("lines") !== -1; }, hasMarkers: function(e) { return e.visible && (e.mode && e.mode.indexOf("markers") !== -1 || // until splom implements 'mode' e.type === "splom"); }, hasText: function(e) { return e.visible && e.mode && e.mode.indexOf("text") !== -1; }, isBubble: function(e) { var t = e.marker; return pk.isPlainObject(t) && (pk.isArrayOrTypedArray(t.size) || KZ(t.size)); } }, JZ = cn, QZ = function(e, t) { t || (t = 2); var n = e.marker, r = n.sizeref || 1, a = n.sizemin || 0, i = n.sizemode === "area" ? function(o) { return Math.sqrt(o / r); } : function(o) { return o / r; }; return function(o) { var l = i(o / t); return JZ(l) && l > 0 ? Math.max(l, a) : 0; }; }, Oo = {}; (function(e) { var t = Ue; e.getSubplot = function(l) { return l.subplot || l.xaxis + l.yaxis || l.geo; }, e.isTraceInSubplots = function(l, s) { if (l.type === "splom") { for (var c = l.xaxes || [], u = l.yaxes || [], f = 0; f < c.length; f++) for (var h = 0; h < u.length; h++) if (s.indexOf(c[f] + u[h]) !== -1) return !0; return !1; } return s.indexOf(e.getSubplot(l)) !== -1; }, e.flat = function(l, s) { for (var c = new Array(l.length), u = 0; u < l.length; u++) c[u] = s; return c; }, e.p2c = function(l, s) { for (var c = new Array(l.length), u = 0; u < l.length; u++) c[u] = l[u].p2c(s); return c; }, e.getDistanceFunction = function(l, s, c, u) { return l === "closest" ? u || e.quadrature(s, c) : l.charAt(0) === "x" ? s : c; }, e.getClosest = function(l, s, c) { if (c.index !== !1) c.index >= 0 && c.index < l.length ? c.distance = 0 : c.index = !1; else for (var u = 0; u < l.length; u++) { var f = s(l[u]); f <= c.distance && (c.index = u, c.distance = f); } return c; }, e.inbox = function(l, s, c) { return l * s < 0 || l === 0 ? c : 1 / 0; }, e.quadrature = function(l, s) { return function(c) { var u = l(c), f = s(c); return Math.sqrt(u * u + f * f); }; }, e.makeEventData = function(l, s, c) { var u = "index" in l ? l.index : l.pointNumber, f = { data: s._input, fullData: s, curveNumber: s.index, pointNumber: u }; if (s._indexToPoints) { var h = s._indexToPoints[u]; h.length === 1 ? f.pointIndex = h[0] : f.pointIndices = h; } else f.pointIndex = u; return s._module.eventData ? f = s._module.eventData(f, l, s, c, u) : ("xVal" in l ? f.x = l.xVal : "x" in l && (f.x = l.x), "yVal" in l ? f.y = l.yVal : "y" in l && (f.y = l.y), l.xa && (f.xaxis = l.xa), l.ya && (f.yaxis = l.ya), l.zLabelVal !== void 0 && (f.z = l.zLabelVal)), e.appendArrayPointValue(f, s, u), f; }, e.appendArrayPointValue = function(l, s, c) { var u = s._arrayAttrs; if (u) for (var f = 0; f < u.length; f++) { var h = u[f], g = r(h); if (l[g] === void 0) { var p = t.nestedProperty(s, h).get(), v = a(p, c); v !== void 0 && (l[g] = v); } } }, e.appendArrayMultiPointValues = function(l, s, c) { var u = s._arrayAttrs; if (u) for (var f = 0; f < u.length; f++) { var h = u[f], g = r(h); if (l[g] === void 0) { for (var p = t.nestedProperty(s, h).get(), v = new Array(c.length), y = 0; y < c.length; y++) v[y] = a(p, c[y]); l[g] = v; } } }; var n = { ids: "id", locations: "location", labels: "label", values: "value", "marker.colors": "color", parents: "parent" }; function r(l) { return n[l] || l; } function a(l, s) { if (Array.isArray(s)) { if (Array.isArray(l) && Array.isArray(l[s[0]])) return l[s[0]][s[1]]; } else return l[s]; } var i = { x: !0, y: !0 }, o = { "x unified": !0, "y unified": !0 }; e.isUnifiedHover = function(l) { return typeof l != "string" ? !1 : !!o[l]; }, e.isXYhover = function(l) { return typeof l != "string" ? !1 : !!i[l]; }; })(Oo); var _L = eY, av = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, XZ = /([astvzqmhlc])([^astvzqmhlc]*)/ig; function eY(e) { var t = []; return e.replace(XZ, function(n, r, a) { var i = r.toLowerCase(); for (a = nY(a), i == "m" && a.length > 2 && (t.push([r].concat(a.splice(0, 2))), i = "l", r = r == "m" ? "l" : "L"); ; ) { if (a.length == av[i]) return a.unshift(r), t.push(a); if (a.length < av[i]) throw new Error("malformed path data"); t.push([r].concat(a.splice(0, av[i]))); } }), t; } var tY = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig; function nY(e) { var t = e.match(tY); return t ? t.map(Number) : []; } var iv, gk; function rY() { if (gk) return iv; gk = 1; var e = _L, t = sn.round, n = "M0,0Z", r = Math.sqrt(2), a = Math.sqrt(3), i = Math.PI, o = Math.cos, l = Math.sin; iv = { circle: { n: 0, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = "M" + m + ",0A" + m + "," + m + " 0 1,1 0,-" + m + "A" + m + "," + m + " 0 0,1 " + m + ",0Z"; return y ? g(v, y, b) : b; } }, square: { n: 1, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "H-" + m + "V-" + m + "H" + m + "Z"); } }, diamond: { n: 2, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.3, 2); return g(v, y, "M" + m + ",0L0," + m + "L-" + m + ",0L0,-" + m + "Z"); } }, cross: { n: 3, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.4, 2), b = t(p * 1.2, 2); return g(v, y, "M" + b + "," + m + "H" + m + "V" + b + "H-" + m + "V" + m + "H-" + b + "V-" + m + "H-" + m + "V-" + b + "H" + m + "V-" + m + "H" + b + "Z"); } }, x: { n: 4, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.8 / r, 2), b = "l" + m + "," + m, w = "l" + m + ",-" + m, _ = "l-" + m + ",-" + m, k = "l-" + m + "," + m; return g(v, y, "M0," + m + b + w + _ + w + _ + k + _ + k + b + k + b + "Z"); } }, "triangle-up": { n: 5, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2 / a, 2), b = t(p / 2, 2), w = t(p, 2); return g(v, y, "M-" + m + "," + b + "H" + m + "L0,-" + w + "Z"); } }, "triangle-down": { n: 6, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2 / a, 2), b = t(p / 2, 2), w = t(p, 2); return g(v, y, "M-" + m + ",-" + b + "H" + m + "L0," + w + "Z"); } }, "triangle-left": { n: 7, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2 / a, 2), b = t(p / 2, 2), w = t(p, 2); return g(v, y, "M" + b + ",-" + m + "V" + m + "L-" + w + ",0Z"); } }, "triangle-right": { n: 8, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2 / a, 2), b = t(p / 2, 2), w = t(p, 2); return g(v, y, "M-" + b + ",-" + m + "V" + m + "L" + w + ",0Z"); } }, "triangle-ne": { n: 9, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.6, 2), b = t(p * 1.2, 2); return g(v, y, "M-" + b + ",-" + m + "H" + m + "V" + b + "Z"); } }, "triangle-se": { n: 10, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.6, 2), b = t(p * 1.2, 2); return g(v, y, "M" + m + ",-" + b + "V" + m + "H-" + b + "Z"); } }, "triangle-sw": { n: 11, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.6, 2), b = t(p * 1.2, 2); return g(v, y, "M" + b + "," + m + "H-" + m + "V-" + b + "Z"); } }, "triangle-nw": { n: 12, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.6, 2), b = t(p * 1.2, 2); return g(v, y, "M-" + m + "," + b + "V-" + m + "H" + b + "Z"); } }, pentagon: { n: 13, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.951, 2), b = t(p * 0.588, 2), w = t(-p, 2), _ = t(p * -0.309, 2), k = t(p * 0.809, 2); return g(v, y, "M" + m + "," + _ + "L" + b + "," + k + "H-" + b + "L-" + m + "," + _ + "L0," + w + "Z"); } }, hexagon: { n: 14, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p / 2, 2), w = t(p * a / 2, 2); return g(v, y, "M" + w + ",-" + b + "V" + b + "L0," + m + "L-" + w + "," + b + "V-" + b + "L0,-" + m + "Z"); } }, hexagon2: { n: 15, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p / 2, 2), w = t(p * a / 2, 2); return g(v, y, "M-" + b + "," + w + "H" + b + "L" + m + ",0L" + b + ",-" + w + "H-" + b + "L-" + m + ",0Z"); } }, octagon: { n: 16, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.924, 2), b = t(p * 0.383, 2); return g(v, y, "M-" + b + ",-" + m + "H" + b + "L" + m + ",-" + b + "V" + b + "L" + b + "," + m + "H-" + b + "L-" + m + "," + b + "V-" + b + "Z"); } }, star: { n: 17, f: function(p, v, y) { if (s(v)) return n; var m = p * 1.4, b = t(m * 0.225, 2), w = t(m * 0.951, 2), _ = t(m * 0.363, 2), k = t(m * 0.588, 2), T = t(-m, 2), O = t(m * -0.309, 2), M = t(m * 0.118, 2), C = t(m * 0.809, 2), I = t(m * 0.382, 2); return g(v, y, "M" + b + "," + O + "H" + w + "L" + _ + "," + M + "L" + k + "," + C + "L0," + I + "L-" + k + "," + C + "L-" + _ + "," + M + "L-" + w + "," + O + "H-" + b + "L0," + T + "Z"); } }, hexagram: { n: 18, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.66, 2), b = t(p * 0.38, 2), w = t(p * 0.76, 2); return g(v, y, "M-" + w + ",0l-" + b + ",-" + m + "h" + w + "l" + b + ",-" + m + "l" + b + "," + m + "h" + w + "l-" + b + "," + m + "l" + b + "," + m + "h-" + w + "l-" + b + "," + m + "l-" + b + ",-" + m + "h-" + w + "Z"); } }, "star-triangle-up": { n: 19, f: function(p, v, y) { if (s(v)) return n; var m = t(p * a * 0.8, 2), b = t(p * 0.8, 2), w = t(p * 1.6, 2), _ = t(p * 4, 2), k = "A " + _ + "," + _ + " 0 0 1 "; return g(v, y, "M-" + m + "," + b + k + m + "," + b + k + "0,-" + w + k + "-" + m + "," + b + "Z"); } }, "star-triangle-down": { n: 20, f: function(p, v, y) { if (s(v)) return n; var m = t(p * a * 0.8, 2), b = t(p * 0.8, 2), w = t(p * 1.6, 2), _ = t(p * 4, 2), k = "A " + _ + "," + _ + " 0 0 1 "; return g(v, y, "M" + m + ",-" + b + k + "-" + m + ",-" + b + k + "0," + w + k + m + ",-" + b + "Z"); } }, "star-square": { n: 21, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.1, 2), b = t(p * 2, 2), w = "A " + b + "," + b + " 0 0 1 "; return g(v, y, "M-" + m + ",-" + m + w + "-" + m + "," + m + w + m + "," + m + w + m + ",-" + m + w + "-" + m + ",-" + m + "Z"); } }, "star-diamond": { n: 22, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.4, 2), b = t(p * 1.9, 2), w = "A " + b + "," + b + " 0 0 1 "; return g(v, y, "M-" + m + ",0" + w + "0," + m + w + m + ",0" + w + "0,-" + m + w + "-" + m + ",0Z"); } }, "diamond-tall": { n: 23, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 0.7, 2), b = t(p * 1.4, 2); return g(v, y, "M0," + b + "L" + m + ",0L0,-" + b + "L-" + m + ",0Z"); } }, "diamond-wide": { n: 24, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.4, 2), b = t(p * 0.7, 2); return g(v, y, "M0," + b + "L" + m + ",0L0,-" + b + "L-" + m + ",0Z"); } }, hourglass: { n: 25, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "H-" + m + "L" + m + ",-" + m + "H-" + m + "Z"); }, noDot: !0 }, bowtie: { n: 26, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "V-" + m + "L-" + m + "," + m + "V-" + m + "Z"); }, noDot: !0 }, "circle-cross": { n: 27, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M0," + m + "V-" + m + "M" + m + ",0H-" + m + "M" + m + ",0A" + m + "," + m + " 0 1,1 0,-" + m + "A" + m + "," + m + " 0 0,1 " + m + ",0Z"); }, needLine: !0, noDot: !0 }, "circle-x": { n: 28, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p / r, 2); return g(v, y, "M" + b + "," + b + "L-" + b + ",-" + b + "M" + b + ",-" + b + "L-" + b + "," + b + "M" + m + ",0A" + m + "," + m + " 0 1,1 0,-" + m + "A" + m + "," + m + " 0 0,1 " + m + ",0Z"); }, needLine: !0, noDot: !0 }, "square-cross": { n: 29, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M0," + m + "V-" + m + "M" + m + ",0H-" + m + "M" + m + "," + m + "H-" + m + "V-" + m + "H" + m + "Z"); }, needLine: !0, noDot: !0 }, "square-x": { n: 30, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "L-" + m + ",-" + m + "M" + m + ",-" + m + "L-" + m + "," + m + "M" + m + "," + m + "H-" + m + "V-" + m + "H" + m + "Z"); }, needLine: !0, noDot: !0 }, "diamond-cross": { n: 31, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.3, 2); return g(v, y, "M" + m + ",0L0," + m + "L-" + m + ",0L0,-" + m + "ZM0,-" + m + "V" + m + "M-" + m + ",0H" + m); }, needLine: !0, noDot: !0 }, "diamond-x": { n: 32, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.3, 2), b = t(p * 0.65, 2); return g(v, y, "M" + m + ",0L0," + m + "L-" + m + ",0L0,-" + m + "ZM-" + b + ",-" + b + "L" + b + "," + b + "M-" + b + "," + b + "L" + b + ",-" + b); }, needLine: !0, noDot: !0 }, "cross-thin": { n: 33, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.4, 2); return g(v, y, "M0," + m + "V-" + m + "M" + m + ",0H-" + m); }, needLine: !0, noDot: !0, noFill: !0 }, "x-thin": { n: 34, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "L-" + m + ",-" + m + "M" + m + ",-" + m + "L-" + m + "," + m); }, needLine: !0, noDot: !0, noFill: !0 }, asterisk: { n: 35, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.2, 2), b = t(p * 0.85, 2); return g(v, y, "M0," + m + "V-" + m + "M" + m + ",0H-" + m + "M" + b + "," + b + "L-" + b + ",-" + b + "M" + b + ",-" + b + "L-" + b + "," + b); }, needLine: !0, noDot: !0, noFill: !0 }, hash: { n: 36, f: function(p, v, y) { if (s(v)) return n; var m = t(p / 2, 2), b = t(p, 2); return g(v, y, "M" + m + "," + b + "V-" + b + "M" + (m - b) + ",-" + b + "V" + b + "M" + b + "," + m + "H-" + b + "M-" + b + "," + (m - b) + "H" + b); }, needLine: !0, noFill: !0 }, "y-up": { n: 37, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.2, 2), b = t(p * 1.6, 2), w = t(p * 0.8, 2); return g(v, y, "M-" + m + "," + w + "L0,0M" + m + "," + w + "L0,0M0,-" + b + "L0,0"); }, needLine: !0, noDot: !0, noFill: !0 }, "y-down": { n: 38, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.2, 2), b = t(p * 1.6, 2), w = t(p * 0.8, 2); return g(v, y, "M-" + m + ",-" + w + "L0,0M" + m + ",-" + w + "L0,0M0," + b + "L0,0"); }, needLine: !0, noDot: !0, noFill: !0 }, "y-left": { n: 39, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.2, 2), b = t(p * 1.6, 2), w = t(p * 0.8, 2); return g(v, y, "M" + w + "," + m + "L0,0M" + w + ",-" + m + "L0,0M-" + b + ",0L0,0"); }, needLine: !0, noDot: !0, noFill: !0 }, "y-right": { n: 40, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.2, 2), b = t(p * 1.6, 2), w = t(p * 0.8, 2); return g(v, y, "M-" + w + "," + m + "L0,0M-" + w + ",-" + m + "L0,0M" + b + ",0L0,0"); }, needLine: !0, noDot: !0, noFill: !0 }, "line-ew": { n: 41, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.4, 2); return g(v, y, "M" + m + ",0H-" + m); }, needLine: !0, noDot: !0, noFill: !0 }, "line-ns": { n: 42, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 1.4, 2); return g(v, y, "M0," + m + "V-" + m); }, needLine: !0, noDot: !0, noFill: !0 }, "line-ne": { n: 43, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + ",-" + m + "L-" + m + "," + m); }, needLine: !0, noDot: !0, noFill: !0 }, "line-nw": { n: 44, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2); return g(v, y, "M" + m + "," + m + "L-" + m + ",-" + m); }, needLine: !0, noDot: !0, noFill: !0 }, "arrow-up": { n: 45, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p * 2, 2); return g(v, y, "M0,0L-" + m + "," + b + "H" + m + "Z"); }, backoff: 1, noDot: !0 }, "arrow-down": { n: 46, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p * 2, 2); return g(v, y, "M0,0L-" + m + ",-" + b + "H" + m + "Z"); }, noDot: !0 }, "arrow-left": { n: 47, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2, 2), b = t(p, 2); return g(v, y, "M0,0L" + m + ",-" + b + "V" + b + "Z"); }, noDot: !0 }, "arrow-right": { n: 48, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2, 2), b = t(p, 2); return g(v, y, "M0,0L-" + m + ",-" + b + "V" + b + "Z"); }, noDot: !0 }, "arrow-bar-up": { n: 49, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p * 2, 2); return g(v, y, "M-" + m + ",0H" + m + "M0,0L-" + m + "," + b + "H" + m + "Z"); }, backoff: 1, needLine: !0, noDot: !0 }, "arrow-bar-down": { n: 50, f: function(p, v, y) { if (s(v)) return n; var m = t(p, 2), b = t(p * 2, 2); return g(v, y, "M-" + m + ",0H" + m + "M0,0L-" + m + ",-" + b + "H" + m + "Z"); }, needLine: !0, noDot: !0 }, "arrow-bar-left": { n: 51, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2, 2), b = t(p, 2); return g(v, y, "M0,-" + b + "V" + b + "M0,0L" + m + ",-" + b + "V" + b + "Z"); }, needLine: !0, noDot: !0 }, "arrow-bar-right": { n: 52, f: function(p, v, y) { if (s(v)) return n; var m = t(p * 2, 2), b = t(p, 2); return g(v, y, "M0,-" + b + "V" + b + "M0,0L-" + m + ",-" + b + "V" + b + "Z"); }, needLine: !0, noDot: !0 }, arrow: { n: 53, f: function(p, v, y) { if (s(v)) return n; var m = i / 2.5, b = 2 * p * o(m), w = 2 * p * l(m); return g( v, y, "M0,0L" + -b + "," + w + "L" + b + "," + w + "Z" ); }, backoff: 0.9, noDot: !0 }, "arrow-wide": { n: 54, f: function(p, v, y) { if (s(v)) return n; var m = i / 4, b = 2 * p * o(m), w = 2 * p * l(m); return g( v, y, "M0,0L" + -b + "," + w + "A " + 2 * p + "," + 2 * p + " 0 0 1 " + b + "," + w + "Z" ); }, backoff: 0.4, noDot: !0 } }; function s(p) { return p === null; } var c, u, f, h; function g(p, v, y) { if ((!p || p % 360 === 0) && !v) return y; if (f === p && h === v && c === y) return u; f = p, h = v, c = y; function m(W, J) { var U = o(W), E = l(W), z = J[0], F = J[1] + (v || 0); return [ z * U - F * E, z * E + F * U ]; } for (var b = p / 180 * i, w = 0, _ = 0, k = e(y), T = "", O = 0; O < k.length; O++) { var M = k[O], C = M[0], I = w, j = _; if (C === "M" || C === "L") w = +M[1], _ = +M[2]; else if (C === "m" || C === "l") w += +M[1], _ += +M[2]; else if (C === "H") w = +M[1]; else if (C === "h") w += +M[1]; else if (C === "V") _ = +M[1]; else if (C === "v") _ += +M[1]; else if (C === "A") { w = +M[1], _ = +M[2]; var P = m(b, [+M[6], +M[7]]); M[6] = P[0], M[7] = P[1], M[3] = +M[3] + p; } (C === "H" || C === "V") && (C = "L"), (C === "h" || C === "v") && (C = "l"), (C === "m" || C === "l") && (w -= I, _ -= j); var N = m(b, [w, _]); (C === "H" || C === "V") && (C = "L"), (C === "M" || C === "L" || C === "m" || C === "l") && (M[1] = N[0], M[2] = N[1]), M[0] = C, T += M[0] + M.slice(1).join(","); } return u = T, T; } return iv; } var vr = sn, Tn = Ue, aY = Tn.numberFormat, os = cn, dy = xi, S0 = Rt, Or = rn, iY = Qd, wd = Tn.strTranslate, ux = Ir, oY = yl, lY = Nr, sY = lY.LINE_SPACING, kL = V1.DESELECTDIM, cY = $a, uY = QZ, dY = Oo.appendArrayPointValue, st = rL.exports = {}; st.font = function(e, t, n, r) { Tn.isPlainObject(t) && (r = t.color, n = t.size, t = t.family), t && e.style("font-family", t), n + 1 && e.style("font-size", n + "px"), r && e.call(Or.fill, r); }; st.setPosition = function(e, t, n) { e.attr("x", t).attr("y", n); }; st.setSize = function(e, t, n) { e.attr("width", t).attr("height", n); }; st.setRect = function(e, t, n, r, a) { e.call(st.setPosition, t, n).call(st.setSize, r, a); }; st.translatePoint = function(e, t, n, r) { var a = n.c2p(e.x), i = r.c2p(e.y); if (os(a) && os(i) && t.node()) t.node().nodeName === "text" ? t.attr("x", a).attr("y", i) : t.attr("transform", wd(a, i)); else return !1; return !0; }; st.translatePoints = function(e, t, n) { e.each(function(r) { var a = vr.select(this); st.translatePoint(r, a, t, n); }); }; st.hideOutsideRangePoint = function(e, t, n, r, a, i) { t.attr( "display", n.isPtWithinRange(e, a) && r.isPtWithinRange(e, i) ? null : "none" ); }; st.hideOutsideRangePoints = function(e, t) { if (t._hasClipOnAxisFalse) { var n = t.xaxis, r = t.yaxis; e.each(function(a) { var i = a[0].trace, o = i.xcalendar, l = i.ycalendar, s = S0.traceIs(i, "bar-like") ? ".bartext" : ".point,.textpoint"; e.selectAll(s).each(function(c) { st.hideOutsideRangePoint(c, vr.select(this), n, r, o, l); }); }); } }; st.crispRound = function(e, t, n) { return !t || !os(t) ? n || 0 : e._context.staticPlot ? t : t < 1 ? 1 : Math.round(t); }; st.singleLineStyle = function(e, t, n, r, a) { t.style("fill", "none"); var i = (((e || [])[0] || {}).trace || {}).line || {}, o = n || i.width || 0, l = a || i.dash || ""; Or.stroke(t, r || i.color), st.dashLine(t, l, o); }; st.lineGroupStyle = function(e, t, n, r) { e.style("fill", "none").each(function(a) { var i = (((a || [])[0] || {}).trace || {}).line || {}, o = t || i.width || 0, l = r || i.dash || ""; vr.select(this).call(Or.stroke, n || i.color).call(st.dashLine, l, o); }); }; st.dashLine = function(e, t, n) { n = +n || 0, t = st.dashStyle(t, n), e.style({ "stroke-dasharray": t, "stroke-width": n + "px" }); }; st.dashStyle = function(e, t) { t = +t || 1; var n = Math.max(t, 3); return e === "solid" ? e = "" : e === "dot" ? e = n + "px," + n + "px" : e === "dash" ? e = 3 * n + "px," + 3 * n + "px" : e === "longdash" ? e = 5 * n + "px," + 5 * n + "px" : e === "dashdot" ? e = 3 * n + "px," + n + "px," + n + "px," + n + "px" : e === "longdashdot" && (e = 5 * n + "px," + 2 * n + "px," + n + "px," + 2 * n + "px"), e; }; function TL(e, t, n) { var r = t.fillpattern, a = r && st.getPatternAttr(r.shape, 0, ""); if (a) { var i = st.getPatternAttr(r.bgcolor, 0, null), o = st.getPatternAttr(r.fgcolor, 0, null), l = r.fgopacity, s = st.getPatternAttr(r.size, 0, 8), c = st.getPatternAttr(r.solidity, 0, 0.3), u = t.uid; st.pattern( e, "point", n, u, a, s, c, void 0, r.fillmode, i, o, l ); } else t.fillcolor && e.call(Or.fill, t.fillcolor); } st.singleFillStyle = function(e, t) { var n = vr.select(e.node()), r = n.data(), a = ((r[0] || [])[0] || {}).trace || {}; TL(e, a, t); }; st.fillGroupStyle = function(e, t) { e.style("stroke-width", 0).each(function(n) { var r = vr.select(this); n[0].trace && TL(r, n[0].trace, t); }); }; var vk = rY(); st.symbolNames = []; st.symbolFuncs = []; st.symbolBackOffs = []; st.symbolNeedLines = {}; st.symbolNoDot = {}; st.symbolNoFill = {}; st.symbolList = []; Object.keys(vk).forEach(function(e) { var t = vk[e], n = t.n; st.symbolList.push( n, String(n), e, n + 100, String(n + 100), e + "-open" ), st.symbolNames[n] = e, st.symbolFuncs[n] = t.f, st.symbolBackOffs[n] = t.backoff || 0, t.needLine && (st.symbolNeedLines[n] = !0), t.noDot ? st.symbolNoDot[n] = !0 : st.symbolList.push( n + 200, String(n + 200), e + "-dot", n + 300, String(n + 300), e + "-open-dot" ), t.noFill && (st.symbolNoFill[n] = !0); }); var fY = st.symbolNames.length, hY = "M0,0.5L0.5,0L0,-0.5L-0.5,0Z"; st.symbolNumber = function(e) { if (os(e)) e = +e; else if (typeof e == "string") { var t = 0; e.indexOf("-open") > 0 && (t = 100, e = e.replace("-open", "")), e.indexOf("-dot") > 0 && (t += 200, e = e.replace("-dot", "")), e = st.symbolNames.indexOf(e), e >= 0 && (e += t); } return e % 100 >= fY || e >= 400 ? 0 : Math.floor(Math.max(e, 0)); }; function AL(e, t, n, r) { var a = e % 100; return st.symbolFuncs[a](t, n, r) + (e >= 200 ? hY : ""); } var mk = { x1: 1, x2: 0, y1: 0, y2: 0 }, yk = { x1: 0, x2: 0, y1: 1, y2: 0 }, xk = aY("~f"), ML = { radial: { node: "radialGradient" }, radialreversed: { node: "radialGradient", reversed: !0 }, horizontal: { node: "linearGradient", attrs: mk }, horizontalreversed: { node: "linearGradient", attrs: mk, reversed: !0 }, vertical: { node: "linearGradient", attrs: yk }, verticalreversed: { node: "linearGradient", attrs: yk, reversed: !0 } }; st.gradient = function(e, t, n, r, a, i) { for (var o = a.length, l = ML[r], s = new Array(o), c = 0; c < o; c++) l.reversed ? s[o - 1 - c] = [xk((1 - a[c][0]) * 100), a[c][1]] : s[c] = [xk(a[c][0] * 100), a[c][1]]; var u = t._fullLayout, f = "g" + u._uid + "-" + n, h = u._defs.select(".gradients").selectAll("#" + f).data([r + s.join(";")], Tn.identity); h.exit().remove(), h.enter().append(l.node).each(function() { var g = vr.select(this); l.attrs && g.attr(l.attrs), g.attr("id", f); var p = g.selectAll("stop").data(s); p.exit().remove(), p.enter().append("stop"), p.each(function(v) { var y = dy(v[1]); vr.select(this).attr({ offset: v[0] + "%", "stop-color": Or.tinyRGB(y), "stop-opacity": y.getAlpha() }); }); }), e.style(i, dx(f, t)).style(i + "-opacity", null), e.classed("gradient_filled", !0); }; st.pattern = function(e, t, n, r, a, i, o, l, s, c, u, f) { var h = t === "legend"; l && (s === "overlay" ? (c = l, u = Or.contrast(c)) : (c = void 0, u = l)); var g = n._fullLayout, p = "p" + g._uid + "-" + r, v, y, m = function(N, W, J, U, E) { return U + (E - U) * (N - W) / (J - W); }, b, w, _, k, T = {}, O = dy(u), M = Or.tinyRGB(O), C = O.getAlpha(), I = f * C; switch (a) { case "/": v = i * Math.sqrt(2), y = i * Math.sqrt(2), b = "M-" + v / 4 + "," + y / 4 + "l" + v / 2 + ",-" + y / 2 + "M0," + y + "L" + v + ",0M" + v / 4 * 3 + "," + y / 4 * 5 + "l" + v / 2 + ",-" + y / 2, w = o * i, k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case "\\": v = i * Math.sqrt(2), y = i * Math.sqrt(2), b = "M" + v / 4 * 3 + ",-" + y / 4 + "l" + v / 2 + "," + y / 2 + "M0,0L" + v + "," + y + "M-" + v / 4 + "," + y / 4 * 3 + "l" + v / 2 + "," + y / 2, w = o * i, k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case "x": v = i * Math.sqrt(2), y = i * Math.sqrt(2), b = "M-" + v / 4 + "," + y / 4 + "l" + v / 2 + ",-" + y / 2 + "M0," + y + "L" + v + ",0M" + v / 4 * 3 + "," + y / 4 * 5 + "l" + v / 2 + ",-" + y / 2 + "M" + v / 4 * 3 + ",-" + y / 4 + "l" + v / 2 + "," + y / 2 + "M0,0L" + v + "," + y + "M-" + v / 4 + "," + y / 4 * 3 + "l" + v / 2 + "," + y / 2, w = i - i * Math.sqrt(1 - o), k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case "|": v = i, y = i, k = "path", b = "M" + v / 2 + ",0L" + v / 2 + "," + y, w = o * i, k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case "-": v = i, y = i, k = "path", b = "M0," + y / 2 + "L" + v + "," + y / 2, w = o * i, k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case "+": v = i, y = i, k = "path", b = "M" + v / 2 + ",0L" + v / 2 + "," + y + "M0," + y / 2 + "L" + v + "," + y / 2, w = i - i * Math.sqrt(1 - o), k = "path", T = { d: b, opacity: I, stroke: M, "stroke-width": w + "px" }; break; case ".": v = i, y = i, o < Math.PI / 4 ? _ = Math.sqrt(o * i * i / Math.PI) : _ = m(o, Math.PI / 4, 1, i / 2, i / Math.sqrt(2)), k = "circle", T = { cx: v / 2, cy: y / 2, r: _, opacity: I, fill: M }; break; } var j = [ a || "noSh", c || "noBg", u || "noFg", i, o ].join(";"), P = g._defs.select(".patterns").selectAll("#" + p).data([j], Tn.identity); P.exit().remove(), P.enter().append("pattern").each(function() { var N = vr.select(this); if (N.attr({ id: p, width: v + "px", height: y + "px", patternUnits: "userSpaceOnUse", // for legends scale down patterns just a bit so that default size (i.e 8) nicely fit in small icons patternTransform: h ? "scale(0.8)" : "" }), c) { var W = dy(c), J = Or.tinyRGB(W), U = W.getAlpha(), E = N.selectAll("rect").data([0]); E.exit().remove(), E.enter().append("rect").attr({ width: v + "px", height: y + "px", fill: J, "fill-opacity": U }); } var z = N.selectAll(k).data([0]); z.exit().remove(), z.enter().append(k).attr(T); }), e.style("fill", dx(p, n)).style("fill-opacity", null), e.classed("pattern_filled", !0); }; st.initGradients = function(e) { var t = e._fullLayout, n = Tn.ensureSingle(t._defs, "g", "gradients"); n.selectAll("linearGradient,radialGradient").remove(), vr.select(e).selectAll(".gradient_filled").classed("gradient_filled", !1); }; st.initPatterns = function(e) { var t = e._fullLayout, n = Tn.ensureSingle(t._defs, "g", "patterns"); n.selectAll("pattern").remove(), vr.select(e).selectAll(".pattern_filled").classed("pattern_filled", !1); }; st.getPatternAttr = function(e, t, n) { return e && Tn.isArrayOrTypedArray(e) ? t < e.length ? e[t] : n : e; }; st.pointStyle = function(e, t, n, r) { if (e.size()) { var a = st.makePointStyleFns(t); e.each(function(i) { st.singlePointStyle(i, vr.select(this), t, a, n, r); }); } }; st.singlePointStyle = function(e, t, n, r, a, i) { var o = n.marker, l = o.line; if (i && i.i >= 0 && e.i === void 0 && (e.i = i.i), t.style( "opacity", r.selectedOpacityFn ? r.selectedOpacityFn(e) : e.mo === void 0 ? o.opacity : e.mo ), r.ms2mrc) { var s; e.ms === "various" || o.size === "various" ? s = 3 : s = r.ms2mrc(e.ms), e.mrc = s, r.selectedSizeFn && (s = e.mrc = r.selectedSizeFn(e)); var c = st.symbolNumber(e.mx || o.symbol) || 0; e.om = c % 200 >= 100; var u = hx(e, n), f = fx(e, n); t.attr("d", AL(c, s, u, f)); } var h = !1, g, p, v; if (e.so) v = l.outlierwidth, p = l.outliercolor, g = o.outliercolor; else { var y = (l || {}).width; v = (e.mlw + 1 || y + 1 || // TODO: we need the latter for legends... can we get rid of it? (e.trace ? (e.trace.marker.line || {}).width : 0) + 1) - 1 || 0, "mlc" in e ? p = e.mlcc = r.lineScale(e.mlc) : Tn.isArrayOrTypedArray(l.color) ? p = Or.defaultLine : p = l.color, Tn.isArrayOrTypedArray(o.color) && (g = Or.defaultLine, h = !0), "mc" in e ? g = e.mcc = r.markerScale(e.mc) : g = o.color || o.colors || "rgba(0,0,0,0)", r.selectedColorFn && (g = r.selectedColorFn(e)); } if (e.om) t.call(Or.stroke, g).style({ "stroke-width": (v || 1) + "px", fill: "none" }); else { t.style("stroke-width", (e.isBlank ? 0 : v) + "px"); var m = o.gradient, b = e.mgt; b ? h = !0 : b = m && m.type, Tn.isArrayOrTypedArray(b) && (b = b[0], ML[b] || (b = 0)); var w = o.pattern, _ = w && st.getPatternAttr(w.shape, e.i, ""); if (b && b !== "none") { var k = e.mgc; k ? h = !0 : k = m.color; var T = n.uid; h && (T += "-" + e.i), st.gradient( t, a, T, b, [[0, k], [1, g]], "fill" ); } else if (_) { var O = !1, M = w.fgcolor; !M && i && i.color && (M = i.color, O = !0); var C = st.getPatternAttr(M, e.i, i && i.color || null), I = st.getPatternAttr(w.bgcolor, e.i, null), j = w.fgopacity, P = st.getPatternAttr(w.size, e.i, 8), N = st.getPatternAttr(w.solidity, e.i, 0.3); O = O || e.mcc || Tn.isArrayOrTypedArray(w.shape) || Tn.isArrayOrTypedArray(w.bgcolor) || Tn.isArrayOrTypedArray(w.fgcolor) || Tn.isArrayOrTypedArray(w.size) || Tn.isArrayOrTypedArray(w.solidity); var W = n.uid; O && (W += "-" + e.i), st.pattern( t, "point", a, W, _, P, N, e.mcc, w.fillmode, I, C, j ); } else Tn.isArrayOrTypedArray(g) ? Or.fill(t, g[e.i]) : Or.fill(t, g); v && Or.stroke(t, p); } }; st.makePointStyleFns = function(e) { var t = {}, n = e.marker; return t.markerScale = st.tryColorscale(n, ""), t.lineScale = st.tryColorscale(n, "line"), S0.traceIs(e, "symbols") && (t.ms2mrc = cY.isBubble(e) ? uY(e) : function() { return (n.size || 6) / 2; }), e.selectedpoints && Tn.extendFlat(t, st.makeSelectedPointStyleFns(e)), t; }; st.makeSelectedPointStyleFns = function(e) { var t = {}, n = e.selected || {}, r = e.unselected || {}, a = e.marker || {}, i = n.marker || {}, o = r.marker || {}, l = a.opacity, s = i.opacity, c = o.opacity, u = s !== void 0, f = c !== void 0; (Tn.isArrayOrTypedArray(l) || u || f) && (t.selectedOpacityFn = function(_) { var k = _.mo === void 0 ? a.opacity : _.mo; return _.selected ? u ? s : k : f ? c : kL * k; }); var h = a.color, g = i.color, p = o.color; (g || p) && (t.selectedColorFn = function(_) { var k = _.mcc || h; return _.selected ? g || k : p || k; }); var v = a.size, y = i.size, m = o.size, b = y !== void 0, w = m !== void 0; return S0.traceIs(e, "symbols") && (b || w) && (t.selectedSizeFn = function(_) { var k = _.mrc || v / 2; return _.selected ? b ? y / 2 : k : w ? m / 2 : k; }), t; }; st.makeSelectedTextStyleFns = function(e) { var t = {}, n = e.selected || {}, r = e.unselected || {}, a = e.textfont || {}, i = n.textfont || {}, o = r.textfont || {}, l = a.color, s = i.color, c = o.color; return t.selectedTextColorFn = function(u) { var f = u.tc || l; return u.selected ? s || f : c || (s ? f : Or.addOpacity(f, kL)); }, t; }; st.selectedPointStyle = function(e, t) { if (!(!e.size() || !t.selectedpoints)) { var n = st.makeSelectedPointStyleFns(t), r = t.marker || {}, a = []; n.selectedOpacityFn && a.push(function(i, o) { i.style("opacity", n.selectedOpacityFn(o)); }), n.selectedColorFn && a.push(function(i, o) { Or.fill(i, n.selectedColorFn(o)); }), n.selectedSizeFn && a.push(function(i, o) { var l = o.mx || r.symbol || 0, s = n.selectedSizeFn(o); i.attr("d", AL(st.symbolNumber(l), s, hx(o, t), fx(o, t))), o.mrc2 = s; }), a.length && e.each(function(i) { for (var o = vr.select(this), l = 0; l < a.length; l++) a[l](o, i); }); } }; st.tryColorscale = function(e, t) { var n = t ? Tn.nestedProperty(e, t).get() : e; if (n) { var r = n.color; if ((n.colorscale || n._colorAx) && Tn.isArrayOrTypedArray(r)) return iY.makeColorScaleFuncFromTrace(n); } return Tn.identity; }; var ov = { start: 1, end: -1, middle: 0, bottom: 1, top: -1 }; function SL(e, t, n, r, a) { var i = vr.select(e.node().parentNode), o = t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle", l = t.indexOf("left") !== -1 ? "end" : t.indexOf("right") !== -1 ? "start" : "middle", s = r ? r / 0.8 + 1 : 0, c = (ux.lineCount(e) - 1) * sY + 1, u = ov[l] * s, f = n * 0.75 + ov[o] * s + (ov[o] - 1) * c * n / 2; e.attr("text-anchor", l), a || i.attr("transform", wd(u, f)); } function CL(e, t) { var n = e.ts || t.textfont.size; return os(n) && n > 0 ? n : 0; } st.textPointStyle = function(e, t, n) { if (e.size()) { var r; if (t.selectedpoints) { var a = st.makeSelectedTextStyleFns(t); r = a.selectedTextColorFn; } var i = t.texttemplate, o = n._fullLayout; e.each(function(l) { var s = vr.select(this), c = i ? Tn.extractOption(l, t, "txt", "texttemplate") : Tn.extractOption(l, t, "tx", "text"); if (!c && c !== 0) { s.remove(); return; } if (i) { var u = t._module.formatLabels, f = u ? u(l, t, o) : {}, h = {}; dY(h, t, l.i); var g = t._meta || {}; c = Tn.texttemplateString(c, f, o._d3locale, h, l, g); } var p = l.tp || t.textposition, v = CL(l, t), y = r ? r(l) : l.tc || t.textfont.color; s.call( st.font, l.tf || t.textfont.family, v, y ).text(c).call(ux.convertToTspans, n).call(SL, p, v, l.mrc); }); } }; st.selectedTextStyle = function(e, t) { if (!(!e.size() || !t.selectedpoints)) { var n = st.makeSelectedTextStyleFns(t); e.each(function(r) { var a = vr.select(this), i = n.selectedTextColorFn(r), o = r.tp || t.textposition, l = CL(r, t); Or.fill(a, i); var s = S0.traceIs(t, "bar-like"); SL(a, o, l, r.mrc2 || r.mrc, s); }); } }; var bk = 0.5; st.smoothopen = function(e, t) { if (e.length < 3) return "M" + e.join("L"); var n = "M" + e[0], r = [], a; for (a = 1; a < e.length - 1; a++) r.push(jh(e[a - 1], e[a], e[a + 1], t)); for (n += "Q" + r[0][0] + " " + e[1], a = 2; a < e.length - 1; a++) n += "C" + r[a - 2][1] + " " + r[a - 1][0] + " " + e[a]; return n += "Q" + r[e.length - 3][1] + " " + e[e.length - 1], n; }; st.smoothclosed = function(e, t) { if (e.length < 3) return "M" + e.join("L") + "Z"; var n = "M" + e[0], r = e.length - 1, a = [jh(e[r], e[0], e[1], t)], i; for (i = 1; i < r; i++) a.push(jh(e[i - 1], e[i], e[i + 1], t)); for (a.push( jh(e[r - 1], e[r], e[0], t) ), i = 1; i <= r; i++) n += "C" + a[i - 1][1] + " " + a[i][0] + " " + e[i]; return n += "C" + a[r][1] + " " + a[0][0] + " " + e[0] + "Z", n; }; var LL, OL; function cc(e, t, n) { return n && (e = DL(e)), t ? Yl(e[1]) : Zl(e[0]); } function Zl(e) { var t = vr.round(e, 2); return LL = t, t; } function Yl(e) { var t = vr.round(e, 2); return OL = t, t; } function jh(e, t, n, r) { var a = e[0] - t[0], i = e[1] - t[1], o = n[0] - t[0], l = n[1] - t[1], s = Math.pow(a * a + i * i, bk / 2), c = Math.pow(o * o + l * l, bk / 2), u = (c * c * a - s * s * o) * r, f = (c * c * i - s * s * l) * r, h = 3 * c * (s + c), g = 3 * s * (s + c); return [ [ Zl(t[0] + (h && u / h)), Yl(t[1] + (h && f / h)) ], [ Zl(t[0] - (g && u / g)), Yl(t[1] - (g && f / g)) ] ]; } var pY = { hv: function(e, t, n) { return "H" + Zl(t[0]) + "V" + cc(t, 1, n); }, vh: function(e, t, n) { return "V" + Yl(t[1]) + "H" + cc(t, 0, n); }, hvh: function(e, t, n) { return "H" + Zl((e[0] + t[0]) / 2) + "V" + Yl(t[1]) + "H" + cc(t, 0, n); }, vhv: function(e, t, n) { return "V" + Yl((e[1] + t[1]) / 2) + "H" + Zl(t[0]) + "V" + cc(t, 1, n); } }, gY = function(e, t, n) { return "L" + cc(t, 0, n) + "," + cc(t, 1, n); }; st.steps = function(e) { var t = pY[e] || gY; return function(n) { for (var r = "M" + Zl(n[0][0]) + "," + Yl(n[0][1]), a = n.length, i = 1; i < a; i++) r += t(n[i - 1], n[i], i === a - 1); return r; }; }; function DL(e, t) { var n = e.backoff, r = e.trace, a = e.d, i = e.i; if (n && r && r.marker && r.marker.angle % 360 === 0 && r.line && r.line.shape !== "spline") { var o = Tn.isArrayOrTypedArray(n), l = e, s = t ? t[0] : LL || 0, c = t ? t[1] : OL || 0, u = l[0], f = l[1], h = u - s, g = f - c, p = Math.atan2(g, h), v = o ? n[i] : n; if (v === "auto") { var y = l.i; r.type === "scatter" && y--; var m = l.marker, b = m.symbol; Tn.isArrayOrTypedArray(b) && (b = b[y]); var w = m.size; Tn.isArrayOrTypedArray(w) && (w = w[y]), v = m ? st.symbolBackOffs[st.symbolNumber(b)] * w : 0, v += st.getMarkerStandoff(a[y], r) || 0; } var _ = u - v * Math.cos(p), k = f - v * Math.sin(p); (_ <= u && _ >= s || _ >= u && _ <= s) && (k <= f && k >= c || k >= f && k <= c) && (e = [_, k]); } return e; } st.applyBackoff = DL; st.makeTester = function() { var e = Tn.ensureSingleById(vr.select("body"), "svg", "js-plotly-tester", function(n) { n.attr(oY.svgAttrs).style({ position: "absolute", left: "-10000px", top: "-10000px", width: "9000px", height: "9000px", "z-index": "1" }); }), t = Tn.ensureSingle(e, "path", "js-reference-point", function(n) { n.attr("d", "M0,0H1V1H0Z").style({ "stroke-width": 0, fill: "black" }); }); st.tester = e, st.testref = t; }; st.savedBBoxes = {}; var lv = 0, vY = 1e4; st.bBox = function(e, t, n) { n || (n = wk(e)); var r; if (n) { if (r = st.savedBBoxes[n], r) return Tn.extendFlat({}, r); } else if (e.childNodes.length === 1) { var a = e.childNodes[0]; if (n = wk(a), n) { var i = +a.getAttribute("x") || 0, o = +a.getAttribute("y") || 0, l = a.getAttribute("transform"); if (!l) { var s = st.bBox(a, !1, n); return i && (s.left += i, s.right += i), o && (s.top += o, s.bottom += o), s; } if (n += "~" + i + "~" + o + "~" + l, r = st.savedBBoxes[n], r) return Tn.extendFlat({}, r); } } var c, u; t ? c = e : (u = st.tester.node(), c = e.cloneNode(!0), u.appendChild(c)), vr.select(c).attr("transform", null).call(ux.positionText, 0, 0); var f = c.getBoundingClientRect(), h = st.testref.node().getBoundingClientRect(); t || u.removeChild(c); var g = { height: f.height, width: f.width, left: f.left - h.left, top: f.top - h.top, right: f.right - h.left, bottom: f.bottom - h.top }; return lv >= vY && (st.savedBBoxes = {}, lv = 0), n && (st.savedBBoxes[n] = g), lv++, Tn.extendFlat({}, g); }; function wk(e) { var t = e.getAttribute("data-unformatted"); if (t !== null) return t + e.getAttribute("data-math") + e.getAttribute("text-anchor") + e.getAttribute("style"); } st.setClipUrl = function(e, t, n) { e.attr("clip-path", dx(t, n)); }; function dx(e, t) { if (!e) return null; var n = t._context, r = n._exportedPlot ? "" : n._baseUrl || ""; return r ? "url('" + r + "#" + e + "')" : "url(#" + e + ")"; } st.getTranslate = function(e) { var t = /.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/, n = e.attr ? "attr" : "getAttribute", r = e[n]("transform") || "", a = r.replace(t, function(i, o, l) { return [o, l].join(" "); }).split(" "); return { x: +a[0] || 0, y: +a[1] || 0 }; }; st.setTranslate = function(e, t, n) { var r = /(\btranslate\(.*?\);?)/, a = e.attr ? "attr" : "getAttribute", i = e.attr ? "attr" : "setAttribute", o = e[a]("transform") || ""; return t = t || 0, n = n || 0, o = o.replace(r, "").trim(), o += wd(t, n), o = o.trim(), e[i]("transform", o), o; }; st.getScale = function(e) { var t = /.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/, n = e.attr ? "attr" : "getAttribute", r = e[n]("transform") || "", a = r.replace(t, function(i, o, l) { return [o, l].join(" "); }).split(" "); return { x: +a[0] || 1, y: +a[1] || 1 }; }; st.setScale = function(e, t, n) { var r = /(\bscale\(.*?\);?)/, a = e.attr ? "attr" : "getAttribute", i = e.attr ? "attr" : "setAttribute", o = e[a]("transform") || ""; return t = t || 1, n = n || 1, o = o.replace(r, "").trim(), o += "scale(" + t + "," + n + ")", o = o.trim(), e[i]("transform", o), o; }; var mY = /\s*sc.*/; st.setPointGroupScale = function(e, t, n) { if (t = t || 1, n = n || 1, !!e) { var r = t === 1 && n === 1 ? "" : "scale(" + t + "," + n + ")"; e.each(function() { var a = (this.getAttribute("transform") || "").replace(mY, ""); a += r, a = a.trim(), this.setAttribute("transform", a); }); } }; var yY = /translate\([^)]*\)\s*$/; st.setTextPointsScale = function(e, t, n) { e && e.each(function() { var r, a = vr.select(this), i = a.select("text"); if (i.node()) { var o = parseFloat(i.attr("x") || 0), l = parseFloat(i.attr("y") || 0), s = (a.attr("transform") || "").match(yY); t === 1 && n === 1 ? r = [] : r = [ wd(o, l), "scale(" + t + "," + n + ")", wd(-o, -l) ], s && r.push(s), a.attr("transform", r.join("")); } }); }; function fx(e, t) { var n; return e && (n = e.mf), n === void 0 && (n = t.marker && t.marker.standoff || 0), !t._geo && !t._xA ? -n : n; } st.getMarkerStandoff = fx; var Tu = Math.atan2, Pl = Math.cos, uc = Math.sin; function _k(e, t) { var n = t[0], r = t[1]; return [ n * Pl(e) - r * uc(e), n * uc(e) + r * Pl(e) ]; } var kk, Tk, Ak, Mk, sv, cv; function hx(e, t) { var n = e.ma; n === void 0 && (n = t.marker.angle, (!n || Tn.isArrayOrTypedArray(n)) && (n = 0)); var r, a, i = t.marker.angleref; if (i === "previous" || i === "north") { if (t._geo) { var o = t._geo.project(e.lonlat); r = o[0], a = o[1]; } else { var l = t._xA, s = t._yA; if (l && s) r = l.c2p(e.x), a = s.c2p(e.y); else return 90; } if (t._geo) { var c = e.lonlat[0], u = e.lonlat[1], f = t._geo.project([ c, u + 1e-5 // epsilon ]), h = t._geo.project([ c + 1e-5, // epsilon u ]), g = Tu( h[1] - a, h[0] - r ), p = Tu( f[1] - a, f[0] - r ), v; if (i === "north") v = n / 180 * Math.PI; else if (i === "previous") { var y = c / 180 * Math.PI, m = u / 180 * Math.PI, b = kk / 180 * Math.PI, w = Tk / 180 * Math.PI, _ = b - y, k = Pl(w) * uc(_), T = uc(w) * Pl(m) - Pl(w) * uc(m) * Pl(_); v = -Tu( k, T ) - Math.PI, kk = c, Tk = u; } var O = _k(g, [Pl(v), 0]), M = _k(p, [uc(v), 0]); n = Tu( O[1] + M[1], O[0] + M[0] ) / Math.PI * 180, i === "previous" && !(cv === t.uid && e.i === sv + 1) && (n = null); } if (i === "previous" && !t._geo) if (cv === t.uid && e.i === sv + 1 && os(r) && os(a)) { var C = r - Ak, I = a - Mk, j = t.line && t.line.shape || "", P = j.slice(j.length - 1); P === "h" && (I = 0), P === "v" && (C = 0), n += Tu(I, C) / Math.PI * 180 + 90; } else n = null; } return Ak = r, Mk = a, sv = e.i, cv = t.uid, n; } st.getMarkerAngle = hx; var Cn = rL.exports, Gf = sn, xY = cn, Sk = kr, Ck = Rt, nc = Ue, Lk = nc.strTranslate, Ok = Cn, Dk = rn, uv = Ir, Fk = V1, bY = Nr.OPPOSITE_SIDE, Ik = / [XY][0-9]* /; function wY(e, t, n) { var r = n.propContainer, a = n.propName, i = n.placeholder, o = n.traceIndex, l = n.avoid || {}, s = n.attributes, c = n.transform, u = n.containerGroup, f = e._fullLayout, h = 1, g = !1, p = r.title, v = (p && p.text ? p.text : "").trim(), y = p && p.font ? p.font : {}, m = y.family, b = y.size, w = y.color, _; a === "title.text" ? _ = "titleText" : a.indexOf("axis") !== -1 ? _ = "axisTitleText" : a.indexOf("colorbar" !== -1) && (_ = "colorbarTitleText"); var k = e._context.edits[_]; v === "" ? h = 0 : v.replace(Ik, " % ") === i.replace(Ik, " % ") && (h = 0.2, g = !0, k || (v = "")), n._meta ? v = nc.templateString(v, n._meta) : f._meta && (v = nc.templateString(v, f._meta)); var T = v || k, O; u || (u = nc.ensureSingle(f._infolayer, "g", "g-" + t), O = f._hColorbarMoveTitle); var M = u.selectAll("text").data(T ? [0] : []); if (M.enter().append("text"), M.text(v).attr("class", t), M.exit().remove(), !T) return u; function C(N) { nc.syncOrAsync([I, j], N); } function I(N) { var W; return !c && O && (c = {}), c ? (W = "", c.rotate && (W += "rotate(" + [c.rotate, s.x, s.y] + ")"), (c.offset || O) && (W += Lk(0, (c.offset || 0) - (O || 0)))) : W = null, N.attr("transform", W), N.style({ "font-family": m, "font-size": Gf.round(b, 2) + "px", fill: Dk.rgb(w), opacity: h * Dk.opacity(w), "font-weight": Sk.fontWeight }).attr(s).call(uv.convertToTspans, e), Sk.previousPromises(e); } function j(N) { var W = Gf.select(N.node().parentNode); if (l && l.selection && l.side && v) { W.attr("transform", null); var J = bY[l.side], U = l.side === "left" || l.side === "top" ? -1 : 1, E = xY(l.pad) ? l.pad : 2, z = Ok.bBox(W.node()), F = { t: 0, b: 0, l: 0, r: 0 }, q = e._fullLayout._reservedMargin; for (var H in q) for (var K in q[H]) { var Q = q[H][K]; F[K] = Math.max(F[K], Q); } var re = { left: F.l, top: F.t, right: f.width - F.r, bottom: f.height - F.b }, te = l.maxShift || U * (re[l.side] - z[l.side]), X = 0; if (te < 0) X = te; else { var ce = l.offsetLeft || 0, B = l.offsetTop || 0; z.left -= ce, z.right -= ce, z.top -= B, z.bottom -= B, l.selection.each(function() { var Z = Ok.bBox(this); nc.bBoxIntersect(z, Z, E) && (X = Math.max(X, U * (Z[l.side] - z[J]) + E)); }), X = Math.min(te, X), r._titleScoot = Math.abs(X); } if (X > 0 || te < 0) { var G = { left: [-X, 0], right: [X, 0], top: [0, -X], bottom: [0, X] }[l.side]; W.attr("transform", Lk(G[0], G[1])); } } } M.call(C); function P() { h = 0, g = !0, M.text(i).on("mouseover.opacity", function() { Gf.select(this).transition().duration(Fk.SHOW_PLACEHOLDER).style("opacity", 1); }).on("mouseout.opacity", function() { Gf.select(this).transition().duration(Fk.HIDE_PLACEHOLDER).style("opacity", 0); }); } return k && (v ? M.on(".opacity", null) : P(), M.call(uv.makeEditable, { gd: e }).on("edit", function(N) { o !== void 0 ? Ck.call("_guiRestyle", e, a, N, o) : Ck.call("_guiRelayout", e, a, N); }).on("cancel", function() { this.text(this.attr("data-unformatted")).call(C); }).on("input", function(N) { this.text(N || " ").call(uv.positionText, s.x, s.y); })), M.classed("js-placeholder", g), u; } var C0 = { draw: wY }, _Y = sn, kY = xd.utcFormat, Dn = Ue, TY = Dn.numberFormat, Mi = cn, Ro = Dn.cleanNumber, AY = Dn.ms2DateTime, zk = Dn.dateTime2ms, Si = Dn.ensureNumber, Ek = Dn.isArrayOrTypedArray, xl = er, Wf = xl.FP_SAFE, ti = xl.BADNUM, MY = xl.LOG_CLIP, SY = xl.ONEWEEK, Zf = xl.ONEDAY, Yf = xl.ONEHOUR, jk = xl.ONEMIN, Pk = xl.ONESEC, $f = mr, up = $r, Kf = up.HOUR_PATTERN, Jf = up.WEEKDAY_PATTERN; function Au(e) { return Math.pow(10, e); } function dv(e) { return e != null; } var px = function(e, t) { t = t || {}; var n = e._id || "x", r = n.charAt(0); function a(w, _) { if (w > 0) return Math.log(w) / Math.LN10; if (w <= 0 && _ && e.range && e.range.length === 2) { var k = e.range[0], T = e.range[1]; return 0.5 * (k + T - 2 * MY * Math.abs(k - T)); } else return ti; } function i(w, _, k, T) { if ((T || {}).msUTC && Mi(w)) return +w; var O = zk(w, k || e.calendar); if (O === ti) if (Mi(w)) { w = +w; var M = Math.floor(Dn.mod(w + 0.05, 1) * 10), C = Math.round(w - M / 10); O = zk(new Date(C)) + M / 10; } else return ti; return O; } function o(w, _, k) { return AY(w, _, k || e.calendar); } function l(w) { return e._categories[Math.round(w)]; } function s(w) { if (dv(w)) { if (e._categoriesMap === void 0 && (e._categoriesMap = {}), e._categoriesMap[w] !== void 0) return e._categoriesMap[w]; e._categories.push(typeof w == "number" ? String(w) : w); var _ = e._categories.length - 1; return e._categoriesMap[w] = _, _; } return ti; } function c(w, _) { for (var k = new Array(_), T = 0; T < _; T++) { var O = (w[0] || [])[T], M = (w[1] || [])[T]; k[T] = u([O, M]); } return k; } function u(w) { if (e._categoriesMap) return e._categoriesMap[w]; } function f(w) { var _ = u(w); if (_ !== void 0) return _; if (Mi(w)) return +w; } function h(w) { return Mi(w) ? +w : u(w); } function g(w, _, k) { return _Y.round(k + _ * w, 2); } function p(w, _, k) { return (w - k) / _; } var v = function(w) { return Mi(w) ? g(w, e._m, e._b) : ti; }, y = function(w) { return p(w, e._m, e._b); }; if (e.rangebreaks) { var m = r === "y"; v = function(w) { if (!Mi(w)) return ti; var _ = e._rangebreaks.length; if (!_) return g(w, e._m, e._b); var k = m; e.range[0] > e.range[1] && (k = !k); for (var T = k ? -1 : 1, O = T * w, M = 0, C = 0; C < _; C++) { var I = T * e._rangebreaks[C].min, j = T * e._rangebreaks[C].max; if (O < I) break; if (O > j) M = C + 1; else { M = O < (I + j) / 2 ? C : C + 1; break; } } var P = e._B[M] || 0; return isFinite(P) ? g(w, e._m2, P) : 0; }, y = function(w) { var _ = e._rangebreaks.length; if (!_) return p(w, e._m, e._b); for (var k = 0, T = 0; T < _ && !(w < e._rangebreaks[T].pmin); T++) w > e._rangebreaks[T].pmax && (k = T + 1); return p(w, e._m2, e._B[k]); }; } e.c2l = e.type === "log" ? a : Si, e.l2c = e.type === "log" ? Au : Si, e.l2p = v, e.p2l = y, e.c2p = e.type === "log" ? function(w, _) { return v(a(w, _)); } : v, e.p2c = e.type === "log" ? function(w) { return Au(y(w)); } : y, ["linear", "-"].indexOf(e.type) !== -1 ? (e.d2r = e.r2d = e.d2c = e.r2c = e.d2l = e.r2l = Ro, e.c2d = e.c2r = e.l2d = e.l2r = Si, e.d2p = e.r2p = function(w) { return e.l2p(Ro(w)); }, e.p2d = e.p2r = y, e.cleanPos = Si) : e.type === "log" ? (e.d2r = e.d2l = function(w, _) { return a(Ro(w), _); }, e.r2d = e.r2c = function(w) { return Au(Ro(w)); }, e.d2c = e.r2l = Ro, e.c2d = e.l2r = Si, e.c2r = a, e.l2d = Au, e.d2p = function(w, _) { return e.l2p(e.d2r(w, _)); }, e.p2d = function(w) { return Au(y(w)); }, e.r2p = function(w) { return e.l2p(Ro(w)); }, e.p2r = y, e.cleanPos = Si) : e.type === "date" ? (e.d2r = e.r2d = Dn.identity, e.d2c = e.r2c = e.d2l = e.r2l = i, e.c2d = e.c2r = e.l2d = e.l2r = o, e.d2p = e.r2p = function(w, _, k) { return e.l2p(i(w, 0, k)); }, e.p2d = e.p2r = function(w, _, k) { return o(y(w), _, k); }, e.cleanPos = function(w) { return Dn.cleanDate(w, ti, e.calendar); }) : e.type === "category" ? (e.d2c = e.d2l = s, e.r2d = e.c2d = e.l2d = l, e.d2r = e.d2l_noadd = f, e.r2c = function(w) { var _ = h(w); return _ !== void 0 ? _ : e.fraction2r(0.5); }, e.l2r = e.c2r = Si, e.r2l = h, e.d2p = function(w) { return e.l2p(e.r2c(w)); }, e.p2d = function(w) { return l(y(w)); }, e.r2p = e.d2p, e.p2r = y, e.cleanPos = function(w) { return typeof w == "string" && w !== "" ? w : Si(w); }) : e.type === "multicategory" && (e.r2d = e.c2d = e.l2d = l, e.d2r = e.d2l_noadd = f, e.r2c = function(w) { var _ = f(w); return _ !== void 0 ? _ : e.fraction2r(0.5); }, e.r2c_just_indices = u, e.l2r = e.c2r = Si, e.r2l = f, e.d2p = function(w) { return e.l2p(e.r2c(w)); }, e.p2d = function(w) { return l(y(w)); }, e.r2p = e.d2p, e.p2r = y, e.cleanPos = function(w) { return Array.isArray(w) || typeof w == "string" && w !== "" ? w : Si(w); }, e.setupMultiCategory = function(w) { var _ = e._traceIndices, k, T, O = e._matchGroup; if (O && e._categories.length === 0) { for (var M in O) if (M !== n) { var C = t[$f.id2name(M)]; _ = _.concat(C._traceIndices); } } var I = [[0, {}], [0, {}]], j = []; for (k = 0; k < _.length; k++) { var P = w[_[k]]; if (r in P) { var N = P[r], W = P._length || Dn.minRowLength(N); if (Ek(N[0]) && Ek(N[1])) for (T = 0; T < W; T++) { var J = N[0][T], U = N[1][T]; dv(J) && dv(U) && (j.push([J, U]), J in I[0][1] || (I[0][1][J] = I[0][0]++), U in I[1][1] || (I[1][1][U] = I[1][0]++)); } } } for (j.sort(function(E, z) { var F = I[0][1], q = F[E[0]] - F[z[0]]; if (q) return q; var H = I[1][1]; return H[E[1]] - H[z[1]]; }), k = 0; k < j.length; k++) s(j[k]); }), e.fraction2r = function(w) { var _ = e.r2l(e.range[0]), k = e.r2l(e.range[1]); return e.l2r(_ + w * (k - _)); }, e.r2fraction = function(w) { var _ = e.r2l(e.range[0]), k = e.r2l(e.range[1]); return (e.r2l(w) - _) / (k - _); }, e.limitRange = function(w) { var _ = e.minallowed, k = e.maxallowed; if (!(_ === void 0 && k === void 0)) { w || (w = "range"); var T = Dn.nestedProperty(e, w).get(), O = Dn.simpleMap(T, e.r2l), M = O[1] < O[0]; M && O.reverse(); var C = Dn.simpleMap([_, k], e.r2l); if (_ !== void 0 && O[0] < C[0] && (T[M ? 1 : 0] = _), k !== void 0 && O[1] > C[1] && (T[M ? 0 : 1] = k), T[0] === T[1]) { var I = e.l2r(_), j = e.l2r(k); if (_ !== void 0) { var P = I + 1; k !== void 0 && (P = Math.min(P, j)), T[M ? 1 : 0] = P; } if (k !== void 0) { var N = j + 1; _ !== void 0 && (N = Math.max(N, I)), T[M ? 0 : 1] = N; } } } }, e.cleanRange = function(w, _) { e._cleanRange(w, _), e.limitRange(w); }, e._cleanRange = function(w, _) { _ || (_ = {}), w || (w = "range"); var k = Dn.nestedProperty(e, w).get(), T, O; if (e.type === "date" ? O = Dn.dfltRange(e.calendar) : r === "y" ? O = up.DFLTRANGEY : e._name === "realaxis" ? O = [0, 1] : O = _.dfltRange || up.DFLTRANGEX, O = O.slice(), (e.rangemode === "tozero" || e.rangemode === "nonnegative") && (O[0] = 0), !k || k.length !== 2) { Dn.nestedProperty(e, w).set(O); return; } var M = k[0] === null, C = k[1] === null; for (e.type === "date" && !e.autorange && (k[0] = Dn.cleanDate(k[0], ti, e.calendar), k[1] = Dn.cleanDate(k[1], ti, e.calendar)), T = 0; T < 2; T++) if (e.type === "date") { if (!Dn.isDateTime(k[T], e.calendar)) { e[w] = O; break; } if (e.r2l(k[0]) === e.r2l(k[1])) { var I = Dn.constrain( e.r2l(k[0]), Dn.MIN_MS + 1e3, Dn.MAX_MS - 1e3 ); k[0] = e.l2r(I - 1e3), k[1] = e.l2r(I + 1e3); break; } } else { if (!Mi(k[T])) if (!(M || C) && Mi(k[1 - T])) k[T] = k[1 - T] * (T ? 10 : 0.1); else { e[w] = O; break; } if (k[T] < -Wf ? k[T] = -Wf : k[T] > Wf && (k[T] = Wf), k[0] === k[1]) { var j = Math.max(1, Math.abs(k[0] * 1e-6)); k[0] -= j, k[1] += j; } } }, e.setScale = function(w) { var _ = t._size; if (e.overlaying) { var k = $f.getFromId({ _fullLayout: t }, e.overlaying); e.domain = k.domain; } var T = w && e._r ? "_r" : "range", O = e.calendar; e.cleanRange(T); var M = e.r2l(e[T][0], O), C = e.r2l(e[T][1], O), I = r === "y"; if (I ? (e._offset = _.t + (1 - e.domain[1]) * _.h, e._length = _.h * (e.domain[1] - e.domain[0]), e._m = e._length / (M - C), e._b = -e._m * C) : (e._offset = _.l + e.domain[0] * _.w, e._length = _.w * (e.domain[1] - e.domain[0]), e._m = e._length / (C - M), e._b = -e._m * M), e._rangebreaks = [], e._lBreaks = 0, e._m2 = 0, e._B = [], e.rangebreaks) { var j, P; if (e._rangebreaks = e.locateBreaks( Math.min(M, C), Math.max(M, C) ), e._rangebreaks.length) { for (j = 0; j < e._rangebreaks.length; j++) P = e._rangebreaks[j], e._lBreaks += Math.abs(P.max - P.min); var N = I; M > C && (N = !N), N && e._rangebreaks.reverse(); var W = N ? -1 : 1; for (e._m2 = W * e._length / (Math.abs(C - M) - e._lBreaks), e._B.push(-e._m2 * (I ? C : M)), j = 0; j < e._rangebreaks.length; j++) P = e._rangebreaks[j], e._B.push( e._B[e._B.length - 1] - W * e._m2 * (P.max - P.min) ); for (j = 0; j < e._rangebreaks.length; j++) P = e._rangebreaks[j], P.pmin = v(P.min), P.pmax = v(P.max); } } if (!isFinite(e._m) || !isFinite(e._b) || e._length < 0) throw t._replotting = !1, new Error("Something went wrong with axis scaling"); }, e.maskBreaks = function(w) { var _ = e.rangebreaks || [], k, T, O, M, C; _._cachedPatterns || (_._cachedPatterns = _.map(function(F) { return F.enabled && F.bounds ? Dn.simpleMap( F.bounds, F.pattern ? Ro : e.d2c // case of pattern: '' ) : null; })), _._cachedValues || (_._cachedValues = _.map(function(F) { return F.enabled && F.values ? Dn.simpleMap(F.values, e.d2c).sort(Dn.sorterAsc) : null; })); for (var I = 0; I < _.length; I++) { var j = _[I]; if (j.enabled) { if (j.bounds) { var P = j.pattern; switch (k = _._cachedPatterns[I], T = k[0], O = k[1], P) { case Jf: C = new Date(w), M = C.getUTCDay(), T > O && (O += 7, M < T && (M += 7)); break; case Kf: C = new Date(w); var N = C.getUTCHours(), W = C.getUTCMinutes(), J = C.getUTCSeconds(), U = C.getUTCMilliseconds(); M = N + (W / 60 + J / 3600 + U / 36e5), T > O && (O += 24, M < T && (M += 24)); break; case "": M = w; break; } if (M >= T && M < O) return ti; } else for (var E = _._cachedValues[I], z = 0; z < E.length; z++) if (T = E[z], O = T + j.dvalue, w >= T && w < O) return ti; } } return w; }, e.locateBreaks = function(w, _) { var k, T, O, M, C = []; if (!e.rangebreaks) return C; var I = e.rangebreaks.slice().sort(function(H, K) { return H.pattern === Jf && K.pattern === Kf ? -1 : K.pattern === Jf && H.pattern === Kf ? 1 : 0; }), j = function(H, K) { if (H = Dn.constrain(H, w, _), K = Dn.constrain(K, w, _), H !== K) { for (var Q = !0, re = 0; re < C.length; re++) { var te = C[re]; H < te.max && K >= te.min && (H < te.min && (te.min = H), K > te.max && (te.max = K), Q = !1); } Q && C.push({ min: H, max: K }); } }; for (k = 0; k < I.length; k++) { var P = I[k]; if (P.enabled) if (P.bounds) { var N = w, W = _; P.pattern && (N = Math.floor(N)), T = Dn.simpleMap(P.bounds, P.pattern ? Ro : e.r2l), O = T[0], M = T[1]; var J = new Date(N), U, E; switch (P.pattern) { case Jf: E = SY, U = ((M < O ? 7 : 0) + (M - O)) * Zf, N += O * Zf - (J.getUTCDay() * Zf + J.getUTCHours() * Yf + J.getUTCMinutes() * jk + J.getUTCSeconds() * Pk + J.getUTCMilliseconds()); break; case Kf: E = Zf, U = ((M < O ? 24 : 0) + (M - O)) * Yf, N += O * Yf - (J.getUTCHours() * Yf + J.getUTCMinutes() * jk + J.getUTCSeconds() * Pk + J.getUTCMilliseconds()); break; default: N = Math.min(T[0], T[1]), W = Math.max(T[0], T[1]), E = W - N, U = E; } for (var z = N; z < W; z += E) j(z, z + U); } else for (var F = Dn.simpleMap(P.values, e.d2c), q = 0; q < F.length; q++) O = F[q], M = O + P.dvalue, j(O, M); } return C.sort(function(H, K) { return H.min - K.min; }), C; }, e.makeCalcdata = function(w, _, k) { var T, O, M, C, I = e.type, j = I === "date" && w[_ + "calendar"]; if (_ in w) { if (T = w[_], C = w._length || Dn.minRowLength(T), Dn.isTypedArray(T) && (I === "linear" || I === "log")) { if (C === T.length) return T; if (T.subarray) return T.subarray(0, C); } if (I === "multicategory") return c(T, C); for (O = new Array(C), M = 0; M < C; M++) O[M] = e.d2c(T[M], 0, j, k); } else { var P = _ + "0" in w ? e.d2c(w[_ + "0"], 0, j) : 0, N = w["d" + _] ? Number(w["d" + _]) : 1; for (T = w[{ x: "y", y: "x" }[_]], C = w._length || T.length, O = new Array(C), M = 0; M < C; M++) O[M] = P + M * N; } if (e.rangebreaks) for (M = 0; M < C; M++) O[M] = e.maskBreaks(O[M]); return O; }, e.isValidRange = function(w, _) { return Array.isArray(w) && w.length === 2 && (_ && w[0] === null || Mi(e.r2l(w[0]))) && (_ && w[1] === null || Mi(e.r2l(w[1]))); }, e.getAutorangeDflt = function(w, _) { var k = !e.isValidRange(w, "nullOk"); return k && _ && _.reverseDflt ? k = "reversed" : w && (w[0] === null && w[1] === null ? k = !0 : w[0] === null && w[1] !== null ? k = "min" : w[0] !== null && w[1] === null && (k = "max")), k; }, e.isReversed = function() { var w = e.autorange; return w === "reversed" || w === "min reversed" || w === "max reversed"; }, e.isPtWithinRange = function(w, _) { var k = e.c2l(w[r], null, _), T = e.r2l(e.range[0]), O = e.r2l(e.range[1]); return T < O ? T <= k && k <= O : O <= k && k <= T; }, e._emptyCategories = function() { e._categories = [], e._categoriesMap = {}; }, e.clearCalc = function() { var w = e._matchGroup; if (w) { var _ = null, k = null; for (var T in w) { var O = t[$f.id2name(T)]; if (O._categories) { _ = O._categories, k = O._categoriesMap; break; } } _ && k ? (e._categories = _, e._categoriesMap = k) : e._emptyCategories(); } else e._emptyCategories(); if (e._initialCategories) for (var M = 0; M < e._initialCategories.length; M++) s(e._initialCategories[M]); }, e.sortByInitialCategories = function() { var w = []; if (e._emptyCategories(), e._initialCategories) for (var _ = 0; _ < e._initialCategories.length; _++) s(e._initialCategories[_]); w = w.concat(e._traceIndices); var k = e._matchGroup; for (var T in k) if (n !== T) { var O = t[$f.id2name(T)]; O._categories = e._categories, O._categoriesMap = e._categoriesMap, w = w.concat(O._traceIndices); } return w; }; var b = t._d3locale; e.type === "date" && (e._dateFormat = b ? b.timeFormat : kY, e._extraFormat = t._extraFormat), e._separators = t.separators, e._numFormat = b ? b.numberFormat : TY, delete e._minDtick, delete e._forceTick0; }, FL = cn, gx = Ue, CY = er.BADNUM, dp = gx.isArrayOrTypedArray, LY = gx.isDateTime, OY = gx.cleanNumber, IL = Math.round, zL = function(e, t, n) { var r = e, a = n.noMultiCategory; if (dp(r) && !r.length) return "-"; if (!a && EY(r)) return "multicategory"; if (a && Array.isArray(r[0])) { for (var i = [], o = 0; o < r.length; o++) if (dp(r[o])) for (var l = 0; l < r[o].length; l++) i.push(r[o][l]); r = i; } if (IY(r, t)) return "date"; var s = n.autotypenumbers !== "strict"; return zY(r, s) ? "category" : FY(r, s) ? "linear" : "-"; }; function DY(e, t) { return t ? FL(e) : typeof e == "number"; } function FY(e, t) { for (var n = e.length, r = 0; r < n; r++) if (DY(e[r], t)) return !0; return !1; } function IY(e, t) { for (var n = e.length, r = EL(n), a = 0, i = 0, o = {}, l = 0; l < n; l += r) { var s = IL(l), c = e[s], u = String(c); o[u] || (o[u] = 1, LY(c, t) && a++, FL(c) && i++); } return a > i * 2; } function EL(e) { return Math.max(1, (e - 1) / 1e3); } function zY(e, t) { for (var n = e.length, r = EL(n), a = 0, i = 0, o = {}, l = 0; l < n; l += r) { var s = IL(l), c = e[s], u = String(c); if (!o[u]) { o[u] = 1; var f = typeof c; f === "boolean" ? i++ : (t ? OY(c) !== CY : f === "number") ? a++ : f === "string" && i++; } } return i > a * 2; } function EY(e) { return dp(e[0]) && dp(e[1]); } var jY = sn, jL = cn, il = Ue, Ph = er.FP_SAFE, PY = Rt, RY = Cn, PL = mr, NY = PL.getFromId, BY = PL.isLinked, L0 = { applyAutorangeOptions: NL, getAutoRange: fy, makePadFn: hy, doAutoRange: VY, findExtremes: qY, concatExtremes: vx }; function fy(e, t) { var n, r, a = [], i = e._fullLayout, o = hy(i, t, 0), l = hy(i, t, 1), s = vx(e, t), c = s.min, u = s.max; if (c.length === 0 || u.length === 0) return il.simpleMap(t.range, t.r2l); var f = c[0].val, h = u[0].val; for (n = 1; n < c.length && f === h; n++) f = Math.min(f, c[n].val); for (n = 1; n < u.length && f === h; n++) h = Math.max(h, u[n].val); var g = t.autorange, p = g === "reversed" || g === "min reversed" || g === "max reversed"; if (!p && t.range) { var v = il.simpleMap(t.range, t.r2l); p = v[1] < v[0]; } t.autorange === "reversed" && (t.autorange = !0); var y = t.rangemode, m = y === "tozero", b = y === "nonnegative", w = t._length, _ = w / 10, k = 0, T, O, M, C, I, j; for (n = 0; n < c.length; n++) for (T = c[n], r = 0; r < u.length; r++) O = u[r], j = O.val - T.val - Rk(t, T.val, O.val), j > 0 && (I = w - o(T) - l(O), I > _ ? j / I > k && (M = T, C = O, k = j / I) : j / w > k && (M = { val: T.val, nopad: 1 }, C = { val: O.val, nopad: 1 }, k = j / w)); function P(E, z) { return Math.max(E, l(z)); } if (f === h) { var N = f - 1, W = f + 1; if (m) if (f === 0) a = [0, 1]; else { var J = (f > 0 ? u : c).reduce(P, 0), U = f / (1 - Math.min(0.5, J / w)); a = f > 0 ? [0, U] : [U, 0]; } else b ? a = [Math.max(0, N), Math.max(1, W)] : a = [N, W]; } else m ? (M.val >= 0 && (M = { val: 0, nopad: 1 }), C.val <= 0 && (C = { val: 0, nopad: 1 })) : b && (M.val - k * o(M) < 0 && (M = { val: 0, nopad: 1 }), C.val <= 0 && (C = { val: 1, nopad: 1 })), k = (C.val - M.val - Rk(t, T.val, O.val)) / (w - o(M) - l(C)), a = [ M.val - k * o(M), C.val + k * l(C) ]; return a = NL(a, t), t.limitRange && t.limitRange(), p && a.reverse(), il.simpleMap(a, t.l2r || Number); } function Rk(e, t, n) { var r = 0; if (e.rangebreaks) for (var a = e.locateBreaks(t, n), i = 0; i < a.length; i++) { var o = a[i]; r += o.max - o.min; } return r; } function hy(e, t, n) { var r = 0.05 * t._length, a = t._anchorAxis || {}; if ((t.ticklabelposition || "").indexOf("inside") !== -1 || (a.ticklabelposition || "").indexOf("inside") !== -1) { var i = t.isReversed(); if (!i) { var o = il.simpleMap(t.range, t.r2l); i = o[1] < o[0]; } i && (n = !n); } var l = 0; return BY(e, t._id) || (l = HY(e, t, n)), r = Math.max(l, r), t.constrain === "domain" && t._inputDomain && (r *= (t._inputDomain[1] - t._inputDomain[0]) / (t.domain[1] - t.domain[0])), function(s) { return s.nopad ? 0 : s.pad + (s.extrapad ? r : l); }; } var Nk = 3; function HY(e, t, n) { var r = 0, a = t._id.charAt(0) === "x"; for (var i in e._plots) { var o = e._plots[i]; if (!(t._id !== o.xaxis._id && t._id !== o.yaxis._id)) { var l = (a ? o.yaxis : o.xaxis) || {}; if ((l.ticklabelposition || "").indexOf("inside") !== -1 && (!n && (l.side === "left" || l.side === "bottom") || n && (l.side === "top" || l.side === "right"))) { if (l._vals) { var s = il.deg2rad(l._tickAngles[l._id + "tick"] || 0), c = Math.abs(Math.cos(s)), u = Math.abs(Math.sin(s)); if (!l._vals[0].bb) { var f = l._id + "tick", h = l._selections[f]; h.each(function(b) { var w = jY.select(this), _ = w.select(".text-math-group"); _.empty() && (b.bb = RY.bBox(w.node())); }); } for (var g = 0; g < l._vals.length; g++) { var p = l._vals[g], v = p.bb; if (v) { var y = 2 * Nk + v.width, m = 2 * Nk + v.height; r = Math.max( r, a ? Math.max(y * c, m * u) : Math.max(m * c, y * u) ); } } } l.ticks === "inside" && l.ticklabelposition === "inside" && (r += l.ticklen || 0); } } } return r; } function vx(e, t, n) { var r = t._id, a = e._fullData, i = e._fullLayout, o = [], l = [], s, c, u; function f(y, m) { for (s = 0; s < m.length; s++) { var b = y[m[s]], w = (b._extremes || {})[r]; if (b.visible === !0 && w) { for (c = 0; c < w.min.length; c++) u = w.min[c], py(o, u.val, u.pad, { extrapad: u.extrapad }); for (c = 0; c < w.max.length; c++) u = w.max[c], gy(l, u.val, u.pad, { extrapad: u.extrapad }); } } } if (f(a, t._traceIndices), f(i.annotations || [], t._annIndices || []), f(i.shapes || [], t._shapeIndices || []), t._matchGroup && !n) { for (var h in t._matchGroup) if (h !== t._id) { var g = NY(e, h), p = vx(e, g, !0), v = t._length / g._length; for (c = 0; c < p.min.length; c++) u = p.min[c], py(o, u.val, u.pad * v, { extrapad: u.extrapad }); for (c = 0; c < p.max.length; c++) u = p.max[c], gy(l, u.val, u.pad * v, { extrapad: u.extrapad }); } } return { min: o, max: l }; } function VY(e, t, n) { if (t.setScale(), t.autorange) { t.range = n ? n.slice() : fy(e, t), t._r = t.range.slice(), t._rl = il.simpleMap(t._r, t.r2l); var r = t._input, a = {}; a[t._attr + ".range"] = t.range, a[t._attr + ".autorange"] = t.autorange, PY.call("_storeDirectGUIEdit", e.layout, e._fullLayout._preGUI, a), r.range = t.range.slice(), r.autorange = t.autorange; } var i = t._anchorAxis; if (i && i.rangeslider) { var o = i.rangeslider[t._name]; o && o.rangemode === "auto" && (o.range = fy(e, t)), i._input.rangeslider[t._name] = il.extendFlat({}, o); } } function qY(e, t, n) { n || (n = {}), e._m || e.setScale(); var r = [], a = [], i = t.length, o = n.padded || !1, l = n.tozero && (e.type === "linear" || e.type === "-"), s = e.type === "log", c = !1, u = n.vpadLinearized || !1, f, h, g, p, v, y, m, b, w; function _(P) { if (Array.isArray(P)) return c = !0, function(W) { return Math.max(Number(P[W] || 0), 0); }; var N = Math.max(Number(P || 0), 0); return function() { return N; }; } var k = _((e._m > 0 ? n.ppadplus : n.ppadminus) || n.ppad || 0), T = _((e._m > 0 ? n.ppadminus : n.ppadplus) || n.ppad || 0), O = _(n.vpadplus || n.vpad), M = _(n.vpadminus || n.vpad); if (!c) { if (b = 1 / 0, w = -1 / 0, s) for (f = 0; f < i; f++) h = t[f], h < b && h > 0 && (b = h), h > w && h < Ph && (w = h); else for (f = 0; f < i; f++) h = t[f], h < b && h > -Ph && (b = h), h > w && h < Ph && (w = h); t = [b, w], i = 2; } var C = { tozero: l, extrapad: o }; function I(P) { g = t[P], jL(g) && (y = k(P), m = T(P), u ? (p = e.c2l(g) - M(P), v = e.c2l(g) + O(P)) : (b = g - M(P), w = g + O(P), s && b < w / 10 && (b = w / 10), p = e.c2l(b), v = e.c2l(w)), l && (p = Math.min(0, p), v = Math.max(0, v)), Bk(p) && py(r, p, m, C), Bk(v) && gy(a, v, y, C)); } var j = Math.min(6, i); for (f = 0; f < j; f++) I(f); for (f = i - 1; f >= j; f--) I(f); return { min: r, max: a, opts: n }; } function py(e, t, n, r) { RL(e, t, n, r, UY); } function gy(e, t, n, r) { RL(e, t, n, r, GY); } function RL(e, t, n, r, a) { for (var i = r.tozero, o = r.extrapad, l = !0, s = 0; s < e.length && l; s++) { var c = e[s]; if (a(c.val, t) && c.pad >= n && (c.extrapad || !o)) { l = !1; break; } else a(t, c.val) && c.pad <= n && (o || !c.extrapad) && (e.splice(s, 1), s--); } if (l) { var u = i && t === 0; e.push({ val: t, pad: u ? 0 : n, extrapad: u ? !1 : o }); } } function Bk(e) { return jL(e) && Math.abs(e) < Ph; } function UY(e, t) { return e <= t; } function GY(e, t) { return e >= t; } function WY(e, t) { var n = t.autorangeoptions; return n && n.minallowed !== void 0 && fp(t, n.minallowed, n.maxallowed) ? n.minallowed : n && n.clipmin !== void 0 && fp(t, n.clipmin, n.clipmax) ? Math.max(e, t.d2l(n.clipmin)) : e; } function ZY(e, t) { var n = t.autorangeoptions; return n && n.maxallowed !== void 0 && fp(t, n.minallowed, n.maxallowed) ? n.maxallowed : n && n.clipmax !== void 0 && fp(t, n.clipmin, n.clipmax) ? Math.min(e, t.d2l(n.clipmax)) : e; } function fp(e, t, n) { return t !== void 0 && n !== void 0 ? (t = e.d2l(t), n = e.d2l(n), t < n) : !0; } function NL(e, t) { if (!t || !t.autorangeoptions) return e; var n = e[0], r = e[1], a = t.autorangeoptions.include; if (a !== void 0) { var i = t.d2l(n), o = t.d2l(r); il.isArrayOrTypedArray(a) || (a = [a]); for (var l = 0; l < a.length; l++) { var s = t.d2l(a[l]); i >= s && (i = s, n = s), o <= s && (o = s, r = s); } } return n = WY(n, t), r = ZY(r, t), [n, r]; } var Ra = sn, Xn = cn, yc = kr, _d = Rt, Vt = Ue, Dc = Vt.strTranslate, Zu = Ir, YY = C0, kd = rn, ya = Cn, $Y = Ji, Hk = A0, Br = er, KY = Br.ONEMAXYEAR, hp = Br.ONEAVGYEAR, vy = Br.ONEMINYEAR, JY = Br.ONEMAXQUARTER, my = Br.ONEAVGQUARTER, yy = Br.ONEMINQUARTER, QY = Br.ONEMAXMONTH, Fc = Br.ONEAVGMONTH, xy = Br.ONEMINMONTH, qa = Br.ONEWEEK, Zr = Br.ONEDAY, $l = Zr / 2, wo = Br.ONEHOUR, pp = Br.ONEMIN, by = Br.ONESEC, Kl = Br.MINUS_SIGN, O0 = Br.BADNUM, wy = { K: "zeroline" }, _y = { K: "gridline", L: "path" }, ky = { K: "minor-gridline", L: "path" }, BL = { K: "tick", L: "path" }, Vk = { K: "tick", L: "text" }, qk = { width: ["x", "r", "l", "xl", "xr"], height: ["y", "t", "b", "yt", "yb"], right: ["r", "xr"], left: ["l", "xl"], top: ["t", "yt"], bottom: ["b", "yb"] }, D0 = Nr, Qf = D0.MID_SHIFT, Jl = D0.CAP_SHIFT, gp = D0.LINE_SPACING, XY = D0.OPPOSITE_SIDE, vp = 3, Ye = nL.exports = {}; Ye.setConvert = px; var e$ = zL, Do = mr, t$ = Do.idSort, n$ = Do.isLinked; Ye.id2name = Do.id2name; Ye.name2id = Do.name2id; Ye.cleanId = Do.cleanId; Ye.list = Do.list; Ye.listIds = Do.listIds; Ye.getFromId = Do.getFromId; Ye.getFromTrace = Do.getFromTrace; var HL = L0; Ye.getAutoRange = HL.getAutoRange; Ye.findExtremes = HL.findExtremes; var r$ = 1e-4; function mx(e) { var t = (e[1] - e[0]) * r$; return [ e[0] - t, e[1] + t ]; } Ye.coerceRef = function(e, t, n, r, a, i) { var o = r.charAt(r.length - 1), l = n._fullLayout._subplots[o + "axis"], s = r + "ref", c = {}; return a || (a = l[0] || (typeof i == "string" ? i : i[0])), i || (i = a), l = l.concat(l.map(function(u) { return u + " domain"; })), c[s] = { valType: "enumerated", values: l.concat(i ? typeof i == "string" ? [i] : i : []), dflt: a }, Vt.coerce(e, t, c, s); }; Ye.getRefType = function(e) { return e === void 0 ? e : e === "paper" ? "paper" : e === "pixel" ? "pixel" : /( domain)$/.test(e) ? "domain" : "range"; }; Ye.coercePosition = function(e, t, n, r, a, i) { var o, l, s = Ye.getRefType(r); if (s !== "range") o = Vt.ensureNumber, l = n(a, i); else { var c = Ye.getFromId(t, r); i = c.fraction2r(i), l = n(a, i), o = c.cleanPos; } e[a] = o(l); }; Ye.cleanPosition = function(e, t, n) { var r = n === "paper" || n === "pixel" ? Vt.ensureNumber : Ye.getFromId(t, n).cleanPos; return r(e); }; Ye.redrawComponents = function(e, t) { t = t || Ye.listIds(e); var n = e._fullLayout; function r(a, i, o, l) { for (var s = _d.getComponentMethod(a, i), c = {}, u = 0; u < t.length; u++) for (var f = n[Ye.id2name(t[u])], h = f[o], g = 0; g < h.length; g++) { var p = h[g]; if (!c[p] && (s(e, p), c[p] = 1, l)) return; } } r("annotations", "drawOne", "_annIndices"), r("shapes", "drawOne", "_shapeIndices"), r("images", "draw", "_imgIndices", !0), r("selections", "drawOne", "_selectionIndices"); }; var a$ = Ye.getDataConversions = function(e, t, n, r) { var a, i = n === "x" || n === "y" || n === "z" ? n : r; if (Vt.isArrayOrTypedArray(i)) { if (a = { type: e$(r, void 0, { autotypenumbers: e._fullLayout.autotypenumbers }), _categories: [] }, Ye.setConvert(a), a.type === "category") for (var o = 0; o < r.length; o++) a.d2c(r[o]); } else a = Ye.getFromTrace(e, t, i); return a ? { d2c: a.d2c, c2d: a.c2d } : i === "ids" ? { d2c: Gk, c2d: Gk } : { d2c: Uk, c2d: Uk }; }; function Uk(e) { return +e; } function Gk(e) { return String(e); } Ye.getDataToCoordFunc = function(e, t, n, r) { return a$(e, t, n, r).d2c; }; Ye.counterLetter = function(e) { var t = e.charAt(0); if (t === "x") return "y"; if (t === "y") return "x"; }; Ye.minDtick = function(e, t, n, r) { ["log", "category", "multicategory"].indexOf(e.type) !== -1 || !r ? e._minDtick = 0 : e._minDtick === void 0 ? (e._minDtick = t, e._forceTick0 = n) : e._minDtick && ((e._minDtick / t + 1e-6) % 1 < 2e-6 && // existing minDtick is an integer multiple of newDiff // (within rounding err) // and forceTick0 can be shifted to newFirst ((n - e._forceTick0) / t % 1 + 1.000001) % 1 < 2e-6 ? (e._minDtick = t, e._forceTick0 = n) : ((t / e._minDtick + 1e-6) % 1 > 2e-6 || // if the converse is true (newDiff is a multiple of minDtick and // newFirst can be shifted to forceTick0) then do nothing - same // forcing stands. Otherwise, cancel forced minimum ((n - e._forceTick0) / e._minDtick % 1 + 1.000001) % 1 > 2e-6) && (e._minDtick = 0)); }; Ye.saveRangeInitial = function(e, t) { for (var n = Ye.list(e, "", !0), r = !1, a = 0; a < n.length; a++) { var i = n[a], o = i._rangeInitial0 === void 0 && i._rangeInitial1 === void 0, l = o || i.range[0] !== i._rangeInitial0 || i.range[1] !== i._rangeInitial1, s = i.autorange; (o && s !== !0 || t && l) && (i._rangeInitial0 = s === "min" || s === "max reversed" ? void 0 : i.range[0], i._rangeInitial1 = s === "max" || s === "min reversed" ? void 0 : i.range[1], i._autorangeInitial = s, r = !0); } return r; }; Ye.saveShowSpikeInitial = function(e, t) { for (var n = Ye.list(e, "", !0), r = !1, a = "on", i = 0; i < n.length; i++) { var o = n[i], l = o._showSpikeInitial === void 0, s = l || o.showspikes !== o._showspikes; (l || t && s) && (o._showSpikeInitial = o.showspikes, r = !0), a === "on" && !o.showspikes && (a = "off"); } return e._fullLayout._cartesianSpikesEnabled = a, r; }; Ye.autoBin = function(e, t, n, r, a, i) { var o = Vt.aggNums(Math.min, null, e), l = Vt.aggNums(Math.max, null, e); if (t.type === "category" || t.type === "multicategory") return { start: o - 0.5, end: l + 0.5, size: Math.max(1, Math.round(i) || 1), _dataSpan: l - o }; a || (a = t.calendar); var s; if (t.type === "log" ? s = { type: "linear", range: [o, l] } : s = { type: t.type, range: Vt.simpleMap([o, l], t.c2r, 0, a), calendar: a }, Ye.setConvert(s), i = i && Hk.dtick(i, s.type), i) s.dtick = i, s.tick0 = Hk.tick0(void 0, s.type, a); else { var c; if (n) c = (l - o) / n; else { var u = Vt.distinctVals(e), f = Math.pow(10, Math.floor( Math.log(u.minDiff) / Math.LN10 )), h = f * Vt.roundUp( u.minDiff / f, [0.9, 1.9, 4.9, 9.9], !0 ); c = Math.max(h, 2 * Vt.stdev(e) / Math.pow(e.length, r ? 0.25 : 0.4)), Xn(c) || (c = 1); } Ye.autoTicks(s, c); } var g = s.dtick, p = Ye.tickIncrement( Ye.tickFirst(s), g, "reverse", a ), v, y; if (typeof g == "number") p = i$(p, e, s, o, l), y = 1 + Math.floor((l - p) / g), v = p + y * g; else for (s.dtick.charAt(0) === "M" && (p = o$(p, e, g, o, a)), v = p, y = 0; v <= l; ) v = Ye.tickIncrement(v, g, !1, a), y++; return { start: t.c2r(p, 0, a), end: t.c2r(v, 0, a), size: g, _dataSpan: l - o }; }; function i$(e, t, n, r, a) { var i = 0, o = 0, l = 0, s = 0; function c(g) { return (1 + (g - e) * 100 / n.dtick) % 100 < 2; } for (var u = 0; u < t.length; u++) t[u] % 1 === 0 ? l++ : Xn(t[u]) || s++, c(t[u]) && i++, c(t[u] + n.dtick / 2) && o++; var f = t.length - s; if (l === f && n.type !== "date") n.dtick < 1 ? e = r - 0.5 * n.dtick : (e -= 0.5, e + n.dtick < r && (e += n.dtick)); else if (o < f * 0.1 && (i > f * 0.3 || c(r) || c(a))) { var h = n.dtick / 2; e += e + h < r ? h : -h; } return e; } function o$(e, t, n, r, a) { var i = Vt.findExactDates(t, a), o = 0.8; if (i.exactDays > o) { var l = Number(n.substr(1)); i.exactYears > o && l % 12 === 0 ? e = Ye.tickIncrement(e, "M6", "reverse") + Zr * 1.5 : i.exactMonths > o ? e = Ye.tickIncrement(e, "M1", "reverse") + Zr * 15.5 : e -= $l; var s = Ye.tickIncrement(e, n); if (s <= r) return s; } return e; } Ye.prepMinorTicks = function(e, t, n) { if (!t.minor.dtick) { delete e.dtick; var r = t.dtick && Xn(t._tmin), a; if (r) { var i = Ye.tickIncrement(t._tmin, t.dtick, !0); a = [t._tmin, i * 0.99 + t._tmin * 0.01]; } else { var o = Vt.simpleMap(t.range, t.r2l); a = [o[0], 0.8 * o[0] + 0.2 * o[1]]; } if (e.range = Vt.simpleMap(a, t.l2r), e._isMinor = !0, Ye.prepTicks(e, n), r) { var l = Xn(t.dtick), s = Xn(e.dtick), c = l ? t.dtick : +t.dtick.substring(1), u = s ? e.dtick : +e.dtick.substring(1); l && s ? fv(c, u) ? c === 2 * qa && u === 2 * Zr && (e.dtick = qa) : c === 2 * qa && u === 3 * Zr ? e.dtick = qa : c === qa && !(t._input.minor || {}).nticks ? e.dtick = Zr : Wk(c / u, 2.5) ? e.dtick = c / 2 : e.dtick = c : String(t.dtick).charAt(0) === "M" ? s ? e.dtick = "M1" : fv(c, u) ? c >= 12 && u === 2 && (e.dtick = "M3") : e.dtick = t.dtick : String(e.dtick).charAt(0) === "L" ? String(t.dtick).charAt(0) === "L" ? fv(c, u) || (e.dtick = Wk(c / u, 2.5) ? t.dtick / 2 : t.dtick) : e.dtick = "D1" : e.dtick === "D2" && +t.dtick > 1 && (e.dtick = 1); } e.range = t.range; } t.minor._tick0Init === void 0 && (e.tick0 = t.tick0); }; function fv(e, t) { return Math.abs((e / t + 0.5) % 1 - 0.5) < 1e-3; } function Wk(e, t) { return Math.abs(e / t - 1) < 1e-3; } Ye.prepTicks = function(e, t) { var n = Vt.simpleMap(e.range, e.r2l, void 0, void 0, t); if (e.tickmode === "auto" || !e.dtick) { var r = e.nticks, a; r || (e.type === "category" || e.type === "multicategory" ? (a = e.tickfont ? Vt.bigFont(e.tickfont.size || 12) : 15, r = e._length / a) : (a = e._id.charAt(0) === "y" ? 40 : 80, r = Vt.constrain(e._length / a, 4, 9) + 1), e._name === "radialaxis" && (r *= 2)), e.minor && e.minor.tickmode !== "array" || e.tickmode === "array" && (r *= 100), e._roughDTick = Math.abs(n[1] - n[0]) / r, Ye.autoTicks(e, e._roughDTick), e._minDtick > 0 && e.dtick < e._minDtick * 2 && (e.dtick = e._minDtick, e.tick0 = e.l2r(e._forceTick0)); } e.ticklabelmode === "period" && l$(e), e.tick0 || (e.tick0 = e.type === "date" ? "2000-01-01" : 0), e.type === "date" && e.dtick < 0.1 && (e.dtick = 0.1), GL(e); }; function hv(e) { return +e.substring(1); } function l$(e) { var t; function n() { return !(Xn(e.dtick) || e.dtick.charAt(0) !== "M"); } var r = n(), a = Ye.getTickFormat(e); if (a) { var i = e._dtickInit !== e.dtick; /%[fLQsSMX]/.test(a) || (/%[HI]/.test(a) ? (t = wo, i && !r && e.dtick < wo && (e.dtick = wo)) : /%p/.test(a) ? (t = $l, i && !r && e.dtick < $l && (e.dtick = $l)) : /%[Aadejuwx]/.test(a) ? (t = Zr, i && !r && e.dtick < Zr && (e.dtick = Zr)) : /%[UVW]/.test(a) ? (t = qa, i && !r && e.dtick < qa && (e.dtick = qa)) : /%[Bbm]/.test(a) ? (t = Fc, i && (r ? hv(e.dtick) < 1 : e.dtick < xy) && (e.dtick = "M1")) : /%[q]/.test(a) ? (t = my, i && (r ? hv(e.dtick) < 3 : e.dtick < yy) && (e.dtick = "M3")) : /%[Yy]/.test(a) && (t = hp, i && (r ? hv(e.dtick) < 12 : e.dtick < vy) && (e.dtick = "M12"))); } r = n(), r && e.tick0 === e._dowTick0 && (e.tick0 = e._rawTick0), e._definedDelta = t; } function s$(e, t, n) { for (var r = 0; r < e.length; r++) { var a = e[r].value, i = r, o = r + 1; r < e.length - 1 ? (i = r, o = r + 1) : r > 0 ? (i = r - 1, o = r) : (i = r, o = r); var l = e[i].value, s = e[o].value, c = Math.abs(s - l), u = n || c, f = 0; u >= vy ? c >= vy && c <= KY ? f = c : f = hp : n === my && u >= yy ? c >= yy && c <= JY ? f = c : f = my : u >= xy ? c >= xy && c <= QY ? f = c : f = Fc : n === qa && u >= qa ? f = qa : u >= Zr ? f = Zr : n === $l && u >= $l ? f = $l : n === wo && u >= wo && (f = wo); var h; f >= c && (f = c, h = !0); var g = a + f; if (t.rangebreaks && f > 0) { for (var p = 84, v = 0, y = 0; y < p; y++) { var m = (y + 0.5) / p; t.maskBreaks(a * (1 - m) + m * g) !== O0 && v++; } f *= v / p, f || (e[r].drop = !0), h && c > qa && (f = c); } (f > 0 || // not instant r === 0) && (e[r].periodX = a + f / 2); } } Ye.calcTicks = function(e, t) { for (var n = e.type, r = e.calendar, a = e.ticklabelstep, i = e.ticklabelmode === "period", o = Vt.simpleMap(e.range, e.r2l, void 0, void 0, t), l = o[1] < o[0], s = Math.min(o[0], o[1]), c = Math.max(o[0], o[1]), u = Math.max(1e3, e._length || 0), f = [], h = [], g = [], p = [], v = e.minor && (e.minor.ticks || e.minor.showgrid), y = 1; y >= (v ? 0 : 1); y--) { var m = !y; y ? (e._dtickInit = e.dtick, e._tick0Init = e.tick0) : (e.minor._dtickInit = e.minor.dtick, e.minor._tick0Init = e.minor.tick0); var b = y ? e : Vt.extendFlat({}, e, e.minor); if (m ? Ye.prepMinorTicks(b, e, t) : Ye.prepTicks(b, t), b.tickmode === "array") { y ? (g = [], f = Zk(e, !m)) : (p = [], h = Zk(e, !m)); continue; } if (b.tickmode === "sync") { g = [], f = c$(e); continue; } var w = mx(o), _ = w[0], k = w[1], T = Xn(b.dtick), O = n === "log" && !(T || b.dtick.charAt(0) === "L"), M = Ye.tickFirst(b, t); if (y) { if (e._tmin = M, M < _ !== l) break; (n === "category" || n === "multicategory") && (k = l ? Math.max(-0.5, k) : Math.min(e._categories.length - 0.5, k)); } var C = null, I = M, j; if (y) { var P; T ? P = e.dtick : n === "date" ? typeof e.dtick == "string" && e.dtick.charAt(0) === "M" && (P = Fc * e.dtick.substring(1)) : P = e._roughDTick, j = Math.round((e.r2l(I) - e.r2l(e.tick0)) / P) - 1; } var N = b.dtick; for (b.rangebreaks && b._tick0Init !== b.tick0 && (I = pv(I, e), l || (I = Ye.tickIncrement(I, N, !l, r))), y && i && (I = Ye.tickIncrement(I, N, !l, r), j--); l ? I >= k : I <= k; I = Ye.tickIncrement( I, N, l, r )) { if (y && j++, b.rangebreaks && !l) { if (I < _) continue; if (b.maskBreaks(I) === O0 && pv(I, b) >= c) break; } if (g.length > u || I === C) break; C = I; var W = { value: I }; y ? (O && I !== (I | 0) && (W.simpleLabel = !0), a > 1 && j % a && (W.skipLabel = !0), g.push(W)) : (W.minor = !0, p.push(W)); } } if (v) { var J = e.minor.ticks === "inside" && e.ticks === "outside" || e.minor.ticks === "outside" && e.ticks === "inside"; if (!J) { for (var U = g.map(function(ve) { return ve.value; }), E = [], z = 0; z < p.length; z++) { var F = p[z], q = F.value; if (U.indexOf(q) === -1) { for (var H = !1, K = 0; !H && K < g.length; K++) 1e7 + g[K].value === 1e7 + q && (H = !0); H || E.push(F); } } p = E; } } i && s$(g, e, e._definedDelta); var Q; if (e.rangebreaks) { var re = e._id.charAt(0) === "y", te = 1; e.tickmode === "auto" && (te = e.tickfont ? e.tickfont.size : 12); var X = NaN; for (Q = g.length - 1; Q > -1; Q--) { if (g[Q].drop) { g.splice(Q, 1); continue; } g[Q].value = pv(g[Q].value, e); var ce = e.c2p(g[Q].value); (re ? X > ce - te : X < ce + te) ? g.splice(l ? Q + 1 : Q, 1) : X = ce; } } wx(e) && Math.abs(o[1] - o[0]) === 360 && g.pop(), e._tmax = (g[g.length - 1] || {}).value, e._prevDateHead = "", e._inCalcTicks = !0; var B, G = function(ve) { ve.text = "", e._prevDateHead = B; }; g = g.concat(p); var Z, oe; for (Q = 0; Q < g.length; Q++) { var ae = g[Q].minor, ge = g[Q].value; ae ? h.push({ x: ge, minor: !0 }) : (B = e._prevDateHead, Z = Ye.tickText( e, ge, !1, // hover g[Q].simpleLabel // noSuffixPrefix ), oe = g[Q].periodX, oe !== void 0 && (Z.periodX = oe, (oe > c || oe < s) && (oe > c && (Z.periodX = c), oe < s && (Z.periodX = s), G(Z))), g[Q].skipLabel && G(Z), f.push(Z)); } return f = f.concat(h), e._inCalcTicks = !1, i && f.length && (f[0].noTick = !0), f; }; function VL(e, t) { return e.rangebreaks && (t = t.filter(function(n) { return e.maskBreaks(n.x) !== O0; })), t; } function c$(e) { var t = e._mainAxis, n = []; if (t._vals) { for (var r = 0; r < t._vals.length; r++) if (!t._vals[r].noTick) { var a = t.l2p(t._vals[r].x), i = e.p2l(a), o = Ye.tickText(e, i); t._vals[r].minor && (o.minor = !0, o.text = ""), n.push(o); } } return n = VL(e, n), n; } function Zk(e, t) { var n = Vt.simpleMap(e.range, e.r2l), r = mx(n), a = Math.min(r[0], r[1]), i = Math.max(r[0], r[1]), o = e.type === "category" ? e.d2l_noadd : e.d2l; e.type === "log" && String(e.dtick).charAt(0) !== "L" && (e.dtick = "L" + Math.pow(10, Math.floor(Math.min(e.range[0], e.range[1])) - 1)); for (var l = [], s = 0; s <= 1; s++) if (!(t !== void 0 && (t && s || t === !1 && !s)) && !(s && !e.minor)) { var c = s ? e.minor.tickvals : e.tickvals, u = s ? [] : e.ticktext; if (c) { Vt.isArrayOrTypedArray(u) || (u = []); for (var f = 0; f < c.length; f++) { var h = o(c[f]); if (h > a && h < i) { var g = u[f] === void 0 ? Ye.tickText(e, h) : yx(e, h, String(u[f])); s && (g.minor = !0, g.text = ""), l.push(g); } } } } return l = VL(e, l), l; } var Xf = [2, 5, 10], Yk = [1, 2, 3, 6, 12], $k = [1, 2, 5, 10, 15, 30], u$ = [1, 2, 3, 7, 14], qL = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1], UL = [-0.301, 0, 0.301, 0.699, 1], d$ = [15, 30, 45, 90, 180]; function Ci(e, t, n) { return t * Vt.roundUp(e / t, n); } Ye.autoTicks = function(e, t, n) { var r; function a(f) { return Math.pow(f, Math.floor(Math.log(t) / Math.LN10)); } if (e.type === "date") { e.tick0 = Vt.dateTick0(e.calendar, 0); var i = 2 * t; if (i > hp) t /= hp, r = a(10), e.dtick = "M" + 12 * Ci(t, r, Xf); else if (i > Fc) t /= Fc, e.dtick = "M" + Ci(t, 1, Yk); else if (i > Zr) { if (e.dtick = Ci(t, Zr, e._hasDayOfWeekBreaks ? [1, 2, 7, 14] : u$), !n) { var o = Ye.getTickFormat(e), l = e.ticklabelmode === "period"; l && (e._rawTick0 = e.tick0), /%[uVW]/.test(o) ? e.tick0 = Vt.dateTick0(e.calendar, 2) : e.tick0 = Vt.dateTick0(e.calendar, 1), l && (e._dowTick0 = e.tick0); } } else i > wo ? e.dtick = Ci(t, wo, Yk) : i > pp ? e.dtick = Ci(t, pp, $k) : i > by ? e.dtick = Ci(t, by, $k) : (r = a(10), e.dtick = Ci(t, r, Xf)); } else if (e.type === "log") { e.tick0 = 0; var s = Vt.simpleMap(e.range, e.r2l); if (e._isMinor && (t *= 1.5), t > 0.7) e.dtick = Math.ceil(t); else if (Math.abs(s[1] - s[0]) < 1) { var c = 1.5 * Math.abs((s[1] - s[0]) / t); t = Math.abs(Math.pow(10, s[1]) - Math.pow(10, s[0])) / c, r = a(10), e.dtick = "L" + Ci(t, r, Xf); } else e.dtick = t > 0.3 ? "D2" : "D1"; } else e.type === "category" || e.type === "multicategory" ? (e.tick0 = 0, e.dtick = Math.ceil(Math.max(t, 1))) : wx(e) ? (e.tick0 = 0, r = 1, e.dtick = Ci(t, r, d$)) : (e.tick0 = 0, r = a(10), e.dtick = Ci(t, r, Xf)); if (e.dtick === 0 && (e.dtick = 1), !Xn(e.dtick) && typeof e.dtick != "string") { var u = e.dtick; throw e.dtick = 1, "ax.dtick error: " + String(u); } }; function GL(e) { var t = e.dtick; if (e._tickexponent = 0, !Xn(t) && typeof t != "string" && (t = 1), (e.type === "category" || e.type === "multicategory") && (e._tickround = null), e.type === "date") { var n = e.r2l(e.tick0), r = e.l2r(n).replace(/(^-|i)/g, ""), a = r.length; if (String(t).charAt(0) === "M") a > 10 || r.substr(5) !== "01-01" ? e._tickround = "d" : e._tickround = +t.substr(1) % 12 === 0 ? "y" : "m"; else if (t >= Zr && a <= 10 || t >= Zr * 15) e._tickround = "d"; else if (t >= pp && a <= 16 || t >= wo) e._tickround = "M"; else if (t >= by && a <= 19 || t >= pp) e._tickround = "S"; else { var i = e.l2r(n + t).replace(/^-/, "").length; e._tickround = Math.max(a, i) - 20, e._tickround < 0 && (e._tickround = 4); } } else if (Xn(t) || t.charAt(0) === "L") { var o = e.range.map(e.r2d || Number); Xn(t) || (t = Number(t.substr(1))), e._tickround = 2 - Math.floor(Math.log(t) / Math.LN10 + 0.01); var l = Math.max(Math.abs(o[0]), Math.abs(o[1])), s = Math.floor(Math.log(l) / Math.LN10 + 0.01), c = e.minexponent === void 0 ? 3 : e.minexponent; Math.abs(s) > c && (mp(e.exponentformat) && !xx(s) ? e._tickexponent = 3 * Math.round((s - 1) / 3) : e._tickexponent = s); } else e._tickround = null; } Ye.tickIncrement = function(e, t, n, r) { var a = n ? -1 : 1; if (Xn(t)) return Vt.increment(e, a * t); var i = t.charAt(0), o = a * Number(t.substr(1)); if (i === "M") return Vt.incrementMonth(e, o, r); if (i === "L") return Math.log(Math.pow(10, e) + o) / Math.LN10; if (i === "D") { var l = t === "D2" ? UL : qL, s = e + a * 0.01, c = Vt.roundUp(Vt.mod(s, 1), l, n); return Math.floor(s) + Math.log(Ra.round(Math.pow(10, c), 1)) / Math.LN10; } throw "unrecognized dtick " + String(t); }; Ye.tickFirst = function(e, t) { var n = e.r2l || Number, r = Vt.simpleMap(e.range, n, void 0, void 0, t), a = r[1] < r[0], i = a ? Math.floor : Math.ceil, o = mx(r)[0], l = e.dtick, s = n(e.tick0); if (Xn(l)) { var c = i((o - s) / l) * l + s; return (e.type === "category" || e.type === "multicategory") && (c = Vt.constrain(c, 0, e._categories.length - 1)), c; } var u = l.charAt(0), f = Number(l.substr(1)); if (u === "M") { for (var h = 0, g = s, p, v, y; h < 10; ) { if (p = Ye.tickIncrement(g, l, a, e.calendar), (p - o) * (g - o) <= 0) return a ? Math.min(g, p) : Math.max(g, p); v = (o - (g + p) / 2) / (p - g), y = u + (Math.abs(Math.round(v)) || 1) * f, g = Ye.tickIncrement(g, y, v < 0 ? !a : a, e.calendar), h++; } return Vt.error("tickFirst did not converge", e), g; } else { if (u === "L") return Math.log(i( (Math.pow(10, o) - s) / f ) * f + s) / Math.LN10; if (u === "D") { var m = l === "D2" ? UL : qL, b = Vt.roundUp(Vt.mod(o, 1), m, a); return Math.floor(o) + Math.log(Ra.round(Math.pow(10, b), 1)) / Math.LN10; } else throw "unrecognized dtick " + String(l); } }; Ye.tickText = function(e, t, n, r) { var a = yx(e, t), i = e.tickmode === "array", o = n || i, l = e.type, s = l === "category" ? e.d2l_noadd : e.d2l, c; if (i && Vt.isArrayOrTypedArray(e.ticktext)) { var u = Vt.simpleMap(e.range, e.r2l), f = (Math.abs(u[1] - u[0]) - (e._lBreaks || 0)) / 1e4; for (c = 0; c < e.ticktext.length && !(Math.abs(t - s(e.tickvals[c])) < f); c++) ; if (c < e.ticktext.length) return a.text = String(e.ticktext[c]), a; } function h(y) { if (y === void 0) return !0; if (n) return y === "none"; var m = { first: e._tmin, last: e._tmax }[y]; return y !== "all" && t !== m; } var g = n ? "never" : e.exponentformat !== "none" && h(e.showexponent) ? "hide" : ""; if (l === "date" ? f$(e, a, n, o) : l === "log" ? h$(e, a, n, o, g) : l === "category" ? p$(e, a) : l === "multicategory" ? g$(e, a, n) : wx(e) ? m$(e, a, n, o, g) : v$(e, a, n, o, g), r || (e.tickprefix && !h(e.showtickprefix) && (a.text = e.tickprefix + a.text), e.ticksuffix && !h(e.showticksuffix) && (a.text += e.ticksuffix)), e.labelalias && e.labelalias.hasOwnProperty(a.text)) { var p = e.labelalias[a.text]; typeof p == "string" && (a.text = p); } if (e.tickson === "boundaries" || e.showdividers) { var v = function(y) { var m = e.l2p(y); return m >= 0 && m <= e._length ? y : null; }; a.xbnd = [ v(a.x - 0.5), v(a.x + e.dtick - 0.5) ]; } return a; }; Ye.hoverLabelText = function(e, t, n) { n && (e = Vt.extendFlat({}, e, { hoverformat: n })); var r = Vt.isArrayOrTypedArray(t) ? t[0] : t, a = Vt.isArrayOrTypedArray(t) ? t[1] : void 0; if (a !== void 0 && a !== r) return Ye.hoverLabelText(e, r, n) + " - " + Ye.hoverLabelText(e, a, n); var i = e.type === "log" && r <= 0, o = Ye.tickText(e, e.c2l(i ? -r : r), "hover").text; return i ? r === 0 ? "0" : Kl + o : o; }; function yx(e, t, n) { var r = e.tickfont || {}; return { x: t, dx: 0, dy: 0, text: n || "", fontSize: r.size, font: r.family, fontColor: r.color }; } function f$(e, t, n, r) { var a = e._tickround, i = n && e.hoverformat || Ye.getTickFormat(e); r = !i && r, r && (Xn(a) ? a = 4 : a = { y: "m", m: "d", d: "M", M: "S", S: 4 }[a]); var o = Vt.formatDate(t.x, i, a, e._dateFormat, e.calendar, e._extraFormat), l, s = o.indexOf(` `); if (s !== -1 && (l = o.substr(s + 1), o = o.substr(0, s)), r && (l !== void 0 && (o === "00:00:00" || o === "00:00") ? (o = l, l = "") : o.length === 8 && (o = o.replace(/:00$/, ""))), l) if (n) a === "d" ? o += ", " + l : o = l + (o ? ", " + o : ""); else if (!e._inCalcTicks || e._prevDateHead !== l) e._prevDateHead = l, o += "
" + l; else { var c = Ad(e), u = e._trueSide || e.side; (!c && u === "top" || c && u === "bottom") && (o += "
"); } t.text = o; } function h$(e, t, n, r, a) { var i = e.dtick, o = t.x, l = e.tickformat, s = typeof i == "string" && i.charAt(0); if (a === "never" && (a = ""), r && s !== "L" && (i = "L3", s = "L"), l || s === "L") t.text = Td(Math.pow(10, o), e, a, r); else if (Xn(i) || s === "D" && Vt.mod(o + 0.01, 1) < 0.1) { var c = Math.round(o), u = Math.abs(c), f = e.exponentformat; f === "power" || mp(f) && xx(c) ? (c === 0 ? t.text = 1 : c === 1 ? t.text = "10" : t.text = "10" + (c > 1 ? "" : Kl) + u + "", t.fontSize *= 1.25) : (f === "e" || f === "E") && u > 2 ? t.text = "1" + f + (c > 0 ? "+" : Kl) + u : (t.text = Td(Math.pow(10, o), e, "", "fakehover"), i === "D1" && e._id.charAt(0) === "y" && (t.dy -= t.fontSize / 6)); } else if (s === "D") t.text = String(Math.round(Math.pow(10, Vt.mod(o, 1)))), t.fontSize *= 0.75; else throw "unrecognized dtick " + String(i); if (e.dtick === "D1") { var h = String(t.text).charAt(0); (h === "0" || h === "1") && (e._id.charAt(0) === "y" ? t.dx -= t.fontSize / 4 : (t.dy += t.fontSize / 2, t.dx += (e.range[1] > e.range[0] ? 1 : -1) * t.fontSize * (o < 0 ? 0.5 : 0.25))); } } function p$(e, t) { var n = e._categories[Math.round(t.x)]; n === void 0 && (n = ""), t.text = String(n); } function g$(e, t, n) { var r = Math.round(t.x), a = e._categories[r] || [], i = a[1] === void 0 ? "" : String(a[1]), o = a[0] === void 0 ? "" : String(a[0]); n ? t.text = o + " - " + i : (t.text = i, t.text2 = o); } function v$(e, t, n, r, a) { a === "never" ? a = "" : e.showexponent === "all" && Math.abs(t.x / e.dtick) < 1e-6 && (a = "hide"), t.text = Td(t.x, e, a, r); } function m$(e, t, n, r, a) { if (e.thetaunit === "radians" && !n) { var i = t.x / 180; if (i === 0) t.text = "0"; else { var o = y$(i); if (o[1] >= 100) t.text = Td(Vt.deg2rad(t.x), e, a, r); else { var l = t.x < 0; o[1] === 1 ? o[0] === 1 ? t.text = "π" : t.text = o[0] + "π" : t.text = [ "", o[0], "", "⁄", "", o[1], "", "π" ].join(""), l && (t.text = Kl + t.text); } } } else t.text = Td(t.x, e, a, r); } function y$(e) { function t(l, s) { return Math.abs(l - s) <= 1e-6; } function n(l, s) { return t(s, 0) ? l : n(s, l % s); } function r(l) { for (var s = 1; !t(Math.round(l * s) / s, l); ) s *= 10; return s; } var a = r(e), i = e * a, o = Math.abs(n(i, a)); return [ // numerator Math.round(i / o), // denominator Math.round(a / o) ]; } var x$ = ["f", "p", "n", "μ", "m", "", "k", "M", "G", "T"]; function mp(e) { return e === "SI" || e === "B"; } function xx(e) { return e > 14 || e < -15; } function Td(e, t, n, r) { var a = e < 0, i = t._tickround, o = n || t.exponentformat || "B", l = t._tickexponent, s = Ye.getTickFormat(t), c = t.separatethousands; if (r) { var u = { exponentformat: o, minexponent: t.minexponent, dtick: t.showexponent === "none" ? t.dtick : Xn(e) && Math.abs(e) || 1, // if not showing any exponents, don't change the exponent // from what we calculate range: t.showexponent === "none" ? t.range.map(t.r2d) : [0, e || 1] }; GL(u), i = (Number(u._tickround) || 0) + 4, l = u._tickexponent, t.hoverformat && (s = t.hoverformat); } if (s) return t._numFormat(s)(e).replace(/-/g, Kl); var f = Math.pow(10, -i) / 2; if (o === "none" && (l = 0), e = Math.abs(e), e < f) e = "0", a = !1; else { if (e += f, l && (e *= Math.pow(10, -l), i += l), i === 0) e = String(Math.floor(e)); else if (i < 0) { e = String(Math.round(e)), e = e.substr(0, e.length + i); for (var h = i; h < 0; h++) e += "0"; } else { e = String(e); var g = e.indexOf(".") + 1; g && (e = e.substr(0, g + i).replace(/\.?0+$/, "")); } e = Vt.numSeparate(e, t._separators, c); } if (l && o !== "hide") { mp(o) && xx(l) && (o = "power"); var p; l < 0 ? p = Kl + -l : o !== "power" ? p = "+" + l : p = String(l), o === "e" || o === "E" ? e += o + p : o === "power" ? e += "×10" + p + "" : o === "B" && l === 9 ? e += "B" : mp(o) && (e += x$[l / 3 + 5]); } return a ? Kl + e : e; } Ye.getTickFormat = function(e) { var t; function n(s) { return typeof s != "string" ? s : Number(s.replace("M", "")) * Fc; } function r(s, c) { var u = ["L", "D"]; if (typeof s == typeof c) { if (typeof s == "number") return s - c; var f = u.indexOf(s.charAt(0)), h = u.indexOf(c.charAt(0)); return f === h ? Number(s.replace(/(L|D)/g, "")) - Number(c.replace(/(L|D)/g, "")) : f - h; } else return typeof s == "number" ? 1 : -1; } function a(s, c, u) { var f = u || function(p) { return p; }, h = c[0], g = c[1]; return (!h && typeof h != "number" || f(h) <= f(s)) && (!g && typeof g != "number" || f(g) >= f(s)); } function i(s, c) { var u = c[0] === null, f = c[1] === null, h = r(s, c[0]) >= 0, g = r(s, c[1]) <= 0; return (u || h) && (f || g); } var o, l; if (e.tickformatstops && e.tickformatstops.length > 0) switch (e.type) { case "date": case "linear": { for (t = 0; t < e.tickformatstops.length; t++) if (l = e.tickformatstops[t], l.enabled && a(e.dtick, l.dtickrange, n)) { o = l; break; } break; } case "log": { for (t = 0; t < e.tickformatstops.length; t++) if (l = e.tickformatstops[t], l.enabled && i(e.dtick, l.dtickrange)) { o = l; break; } break; } } return o ? o.value : e.tickformat; }; Ye.getSubplots = function(e, t) { var n = e._fullLayout._subplots, r = n.cartesian.concat(n.gl2d || []), a = t ? Ye.findSubplotsWithAxis(r, t) : r; return a.sort(function(i, o) { var l = i.substr(1).split("y"), s = o.substr(1).split("y"); return l[0] === s[0] ? +l[1] - +s[1] : +l[0] - +s[0]; }), a; }; Ye.findSubplotsWithAxis = function(e, t) { for (var n = new RegExp( t._id.charAt(0) === "x" ? "^" + t._id + "y" : t._id + "$" ), r = [], a = 0; a < e.length; a++) { var i = e[a]; n.test(i) && r.push(i); } return r; }; Ye.makeClipPaths = function(e) { var t = e._fullLayout; if (!t._hasOnlyLargeSploms) { var n = { _offset: 0, _length: t.width, _id: "" }, r = { _offset: 0, _length: t.height, _id: "" }, a = Ye.list(e, "x", !0), i = Ye.list(e, "y", !0), o = [], l, s; for (l = 0; l < a.length; l++) for (o.push({ x: a[l], y: r }), s = 0; s < i.length; s++) l === 0 && o.push({ x: n, y: i[s] }), o.push({ x: a[l], y: i[s] }); var c = t._clips.selectAll(".axesclip").data(o, function(u) { return u.x._id + u.y._id; }); c.enter().append("clipPath").classed("axesclip", !0).attr("id", function(u) { return "clip" + t._uid + u.x._id + u.y._id; }).append("rect"), c.exit().remove(), c.each(function(u) { Ra.select(this).select("rect").attr({ x: u.x._offset || 0, y: u.y._offset || 0, width: u.x._length || 1, height: u.y._length || 1 }); }); } }; Ye.draw = function(e, t, n) { var r = e._fullLayout; t === "redraw" && r._paper.selectAll("g.subplot").each(function(s) { var c = s[0], u = r._plots[c]; if (u) { var f = u.xaxis, h = u.yaxis; u.xaxislayer.selectAll("." + f._id + "tick").remove(), u.yaxislayer.selectAll("." + h._id + "tick").remove(), u.xaxislayer.selectAll("." + f._id + "tick2").remove(), u.yaxislayer.selectAll("." + h._id + "tick2").remove(), u.xaxislayer.selectAll("." + f._id + "divider").remove(), u.yaxislayer.selectAll("." + h._id + "divider").remove(), u.minorGridlayer && u.minorGridlayer.selectAll("path").remove(), u.gridlayer && u.gridlayer.selectAll("path").remove(), u.zerolinelayer && u.zerolinelayer.selectAll("path").remove(), r._infolayer.select(".g-" + f._id + "title").remove(), r._infolayer.select(".g-" + h._id + "title").remove(); } }); var a = !t || t === "redraw" ? Ye.listIds(e) : t, i = Ye.list(e), o = i.filter(function(s) { return s.autoshift; }).map(function(s) { return s.overlaying; }); a.map(function(s) { var c = Ye.getFromId(e, s); if (c.tickmode === "sync" && c.overlaying) { var u = a.findIndex(function(f) { return f === c.overlaying; }); u >= 0 && a.unshift(a.splice(u, 1).shift()); } }); var l = { false: { left: 0, right: 0 } }; return Vt.syncOrAsync(a.map(function(s) { return function() { if (s) { var c = Ye.getFromId(e, s); n || (n = {}), n.axShifts = l, n.overlayingShiftedAx = o; var u = Ye.drawOne(e, c, n); return c._shiftPusher && Sy(c, c._fullDepth || 0, l, !0), c._r = c.range.slice(), c._rl = Vt.simpleMap(c._r, c.r2l), u; } }; })); }; Ye.drawOne = function(e, t, n) { n = n || {}; var r = n.axShifts || {}, a = n.overlayingShiftedAx || [], i, o, l; t.setScale(); var s = e._fullLayout, c = t._id, u = c.charAt(0), f = Ye.counterLetter(c), h = s._plots[t._mainSubplot]; if (!h) return; if (t._shiftPusher = t.autoshift || a.indexOf(t._id) !== -1 || a.indexOf(t.overlaying) !== -1, t._shiftPusher & t.anchor === "free") { var g = t.linewidth / 2 || 0; t.ticks === "inside" && (g += t.ticklen), Sy(t, g, r, !0), Sy(t, t.shift || 0, r, !1); } (n.skipTitle !== !0 || t._shift === void 0) && (t._shift = F$(t, r)); var p = h[u + "axislayer"], v = t._mainLinePosition, y = v += t._shift, m = t._mainMirrorPosition, b = t._vals = Ye.calcTicks(t), w = [t.mirror, y, m].join("_"); for (i = 0; i < b.length; i++) b[i].axInfo = w; t._selections = {}, t._tickAngles && (t._prevTickAngles = t._tickAngles), t._tickAngles = {}, t._depth = null; var _ = {}; function k(Ie) { var Fe = c + (Ie || "tick"); return _[Fe] || (_[Fe] = k$(t, Fe)), _[Fe]; } if (t.visible) { var T = Ye.makeTransTickFn(t), O = Ye.makeTransTickLabelFn(t), M, C, I = t.ticks === "inside", j = t.ticks === "outside"; if (t.tickson === "boundaries") { var P = b$(t, b); C = Ye.clipEnds(t, P), M = I ? C : P; } else C = Ye.clipEnds(t, b), M = I && t.ticklabelmode !== "period" ? C : b; var N = t._gridVals = C, W = _$(t, b); if (!s._hasOnlyLargeSploms) { var J = t._subplotsWith, U = {}; for (i = 0; i < J.length; i++) { o = J[i], l = s._plots[o]; var E = l[f + "axis"], z = E._mainAxis._id; if (!U[z]) { U[z] = 1; var F = u === "x" ? "M0," + E._offset + "v" + E._length : "M" + E._offset + ",0h" + E._length; Ye.drawGrid(e, t, { vals: N, counterAxis: E, layer: l.gridlayer.select("." + c), minorLayer: l.minorGridlayer.select("." + c), path: F, transFn: T }), Ye.drawZeroLine(e, t, { counterAxis: E, layer: l.zerolinelayer, path: F, transFn: T }); } } } var q, H = Ye.getTickSigns(t), K = Ye.getTickSigns(t, "minor"); if (t.ticks || t.minor && t.minor.ticks) { var Q = Ye.makeTickPath(t, y, H[2]), re = Ye.makeTickPath(t, y, K[2], { minor: !0 }), te, X, ce, B; if (t._anchorAxis && t.mirror && t.mirror !== !0 ? (te = Ye.makeTickPath(t, m, H[3]), X = Ye.makeTickPath(t, m, K[3], { minor: !0 }), ce = Q + te, B = re + X) : (te = "", X = "", ce = Q, B = re), t.showdividers && j && t.tickson === "boundaries") { var G = {}; for (i = 0; i < W.length; i++) G[W[i].x] = 1; q = function(Ie) { return G[Ie.x] ? te : ce; }; } else q = function(Ie) { return Ie.minor ? B : ce; }; } if (Ye.drawTicks(e, t, { vals: M, layer: p, path: q, transFn: T }), t.mirror === "allticks") { var Z = Object.keys(t._linepositions || {}); for (i = 0; i < Z.length; i++) { o = Z[i], l = s._plots[o]; var oe = t._linepositions[o] || [], ae = oe[0], ge = oe[1], ve = oe[2], pe = Ye.makeTickPath( t, ae, ve ? H[0] : K[0], { minor: ve } ) + Ye.makeTickPath( t, ge, ve ? H[1] : K[1], { minor: ve } ); Ye.drawTicks(e, t, { vals: M, layer: l[u + "axislayer"], path: pe, transFn: T }); } } var ye = []; if (ye.push(function() { return Ye.drawLabels(e, t, { vals: b, layer: p, plotinfo: l, transFn: O, labelFns: Ye.makeLabelFns(t, y) }); }), t.type === "multicategory") { var Oe = { x: 2, y: 10 }[u]; ye.push(function() { var Ie = { x: "height", y: "width" }[u], Fe = k()[Ie] + Oe + (t._tickAngles[c + "tick"] ? t.tickfont.size * gp : 0); return Ye.drawLabels(e, t, { vals: w$(t, b), layer: p, cls: c + "tick2", repositionOnUpdate: !0, secondary: !0, transFn: T, labelFns: Ye.makeLabelFns(t, y + Fe * H[4]) }); }), ye.push(function() { return t._depth = H[4] * (k("tick2")[t.side] - y), A$(e, t, { vals: W, layer: p, path: Ye.makeTickPath(t, y, H[4], { len: t._depth }), transFn: T }); }); } else t.title.hasOwnProperty("standoff") && ye.push(function() { t._depth = H[4] * (k()[t.side] - y); }); var Be = _d.getComponentMethod("rangeslider", "isVisible")(t); return !n.skipTitle && !(Be && t.side === "bottom") && ye.push(function() { return M$(e, t); }), ye.push(function() { var Ie = t.side.charAt(0), Fe = XY[t.side].charAt(0), Re = Ye.getPxPosition(e, t), We = j ? t.ticklen : 0, Ce, Ve, Ke, Xe; (t.automargin || Be || t._shiftPusher) && (t.type === "multicategory" ? Ce = k("tick2") : (Ce = k(), u === "x" && Ie === "b" && (t._depth = Math.max(Ce.width > 0 ? Ce.bottom - Re : 0, We)))); var ct = 0, vt = 0; if (t._shiftPusher && (ct = Math.max( We, Ce.height > 0 ? Ie === "l" ? Re - Ce.left : Ce.right - Re : 0 ), t.title.text !== s._dfltTitle[u] && (vt = (t._titleStandoff || 0) + (t._titleScoot || 0), Ie === "l" && (vt += Ay(t))), t._fullDepth = Math.max(ct, vt)), t.automargin) { Ve = { x: 0, y: 0, r: 0, l: 0, t: 0, b: 0 }; var lt = [0, 1], ut = typeof t._shift == "number" ? t._shift : 0; if (u === "x") { if (Ie === "b" ? Ve[Ie] = t._depth : (Ve[Ie] = t._depth = Math.max(Ce.width > 0 ? Re - Ce.top : 0, We), lt.reverse()), Ce.width > 0) { var dt = Ce.right - (t._offset + t._length); dt > 0 && (Ve.xr = 1, Ve.r = dt); var Pe = t._offset - Ce.left; Pe > 0 && (Ve.xl = 0, Ve.l = Pe); } } else if (Ie === "l" ? (t._depth = Math.max(Ce.height > 0 ? Re - Ce.left : 0, We), Ve[Ie] = t._depth - ut) : (t._depth = Math.max(Ce.height > 0 ? Ce.right - Re : 0, We), Ve[Ie] = t._depth + ut, lt.reverse()), Ce.height > 0) { var ze = Ce.bottom - (t._offset + t._length); ze > 0 && (Ve.yb = 0, Ve.b = ze); var Ne = t._offset - Ce.top; Ne > 0 && (Ve.yt = 1, Ve.t = Ne); } Ve[f] = t.anchor === "free" ? t.position : t._anchorAxis.domain[lt[0]], t.title.text !== s._dfltTitle[u] && (Ve[Ie] += Ay(t) + (t.title.standoff || 0)), t.mirror && t.anchor !== "free" && (Ke = { x: 0, y: 0, r: 0, l: 0, t: 0, b: 0 }, Ke[Fe] = t.linewidth, t.mirror && t.mirror !== !0 && (Ke[Fe] += We), t.mirror === !0 || t.mirror === "ticks" ? Ke[f] = t._anchorAxis.domain[lt[1]] : (t.mirror === "all" || t.mirror === "allticks") && (Ke[f] = [t._counterDomainMin, t._counterDomainMax][lt[1]])); } Be && (Xe = _d.getComponentMethod("rangeslider", "autoMarginOpts")(e, t)), typeof t.automargin == "string" && (Kk(Ve, t.automargin), Kk(Ke, t.automargin)), yc.autoMargin(e, bx(t), Ve), yc.autoMargin(e, ZL(t), Ke), yc.autoMargin(e, YL(t), Xe); }), Vt.syncOrAsync(ye); } }; function Kk(e, t) { if (e) { var n = Object.keys(qk).reduce(function(r, a) { return t.indexOf(a) !== -1 && qk[a].forEach(function(i) { r[i] = 1; }), r; }, {}); Object.keys(e).forEach(function(r) { n[r] || (r.length === 1 ? e[r] = 0 : delete e[r]); }); } } function b$(e, t) { var n = [], r, a = function(i, o) { var l = i.xbnd[o]; l !== null && n.push(Vt.extendFlat({}, i, { x: l })); }; if (t.length) { for (r = 0; r < t.length; r++) a(t[r], 0); a(t[r - 1], 1); } return n; } function w$(e, t) { for (var n = [], r = {}, a = 0; a < t.length; a++) { var i = t[a]; r[i.text2] ? r[i.text2].push(i.x) : r[i.text2] = [i.x]; } for (var o in r) n.push(yx(e, Vt.interp(r[o], 0.5), o)); return n; } function _$(e, t) { var n = [], r, a, i = t.length && t[t.length - 1].x < t[0].x, o = function(s, c) { var u = s.xbnd[c]; u !== null && n.push(Vt.extendFlat({}, s, { x: u })); }; if (e.showdividers && t.length) { for (r = 0; r < t.length; r++) { var l = t[r]; l.text2 !== a && o(l, i ? 1 : 0), a = l.text2; } o(t[r - 1], i ? 0 : 1); } return n; } function k$(e, t) { var n, r, a, i; return e._selections[t].size() ? (n = 1 / 0, r = -1 / 0, a = 1 / 0, i = -1 / 0, e._selections[t].each(function() { var o = My(this), l = ya.bBox(o.node().parentNode); n = Math.min(n, l.top), r = Math.max(r, l.bottom), a = Math.min(a, l.left), i = Math.max(i, l.right); })) : (n = 0, r = 0, a = 0, i = 0), { top: n, bottom: r, left: a, right: i, height: r - n, width: i - a }; } Ye.getTickSigns = function(e, t) { var n = e._id.charAt(0), r = { x: "top", y: "right" }[n], a = e.side === r ? 1 : -1, i = [-1, 1, a, -a], o = t ? (e.minor || {}).ticks : e.ticks; return o !== "inside" == (n === "x") && (i = i.map(function(l) { return -l; })), e.side && i.push({ l: -1, t: -1, r: 1, b: 1 }[e.side.charAt(0)]), i; }; Ye.makeTransTickFn = function(e) { return e._id.charAt(0) === "x" ? function(t) { return Dc(e._offset + e.l2p(t.x), 0); } : function(t) { return Dc(0, e._offset + e.l2p(t.x)); }; }; Ye.makeTransTickLabelFn = function(e) { var t = T$(e), n = t[0], r = t[1]; return e._id.charAt(0) === "x" ? function(a) { return Dc( n + e._offset + e.l2p(Ty(a)), r ); } : function(a) { return Dc( r, n + e._offset + e.l2p(Ty(a)) ); }; }; function Ty(e) { return e.periodX !== void 0 ? e.periodX : e.x; } function T$(e) { var t = e.ticklabelposition || "", n = function(g) { return t.indexOf(g) !== -1; }, r = n("top"), a = n("left"), i = n("right"), o = n("bottom"), l = n("inside"), s = o || a || r || i; if (!s && !l) return [0, 0]; var c = e.side, u = s ? (e.tickwidth || 0) / 2 : 0, f = vp, h = e.tickfont ? e.tickfont.size : 12; return (o || r) && (u += h * Jl, f += (e.linewidth || 0) / 2), (a || i) && (u += (e.linewidth || 0) / 2, f += vp), l && c === "top" && (f -= h * (1 - Jl)), (a || r) && (u = -u), (c === "bottom" || c === "right") && (f = -f), [ s ? u : 0, l ? f : 0 ]; } Ye.makeTickPath = function(e, t, n, r) { r || (r = {}); var a = r.minor; if (a && !e.minor) return ""; var i = r.len !== void 0 ? r.len : a ? e.minor.ticklen : e.ticklen, o = e._id.charAt(0), l = (e.linewidth || 1) / 2; return o === "x" ? "M0," + (t + l * n) + "v" + i * n : "M" + (t + l * n) + ",0h" + i * n; }; Ye.makeLabelFns = function(e, t, n) { var r = e.ticklabelposition || "", a = function(P) { return r.indexOf(P) !== -1; }, i = a("top"), o = a("left"), l = a("right"), s = a("bottom"), c = s || o || i || l, u = a("inside"), f = r === "inside" && e.ticks === "inside" || !u && e.ticks === "outside" && e.tickson !== "boundaries", h = 0, g = 0, p = f ? e.ticklen : 0; if (u ? p *= -1 : c && (p = 0), f && (h += p, n)) { var v = Vt.deg2rad(n); h = p * Math.cos(v) + 1, g = p * Math.sin(v); } e.showticklabels && (f || e.showline) && (h += 0.2 * e.tickfont.size), h += (e.linewidth || 1) / 2 * (u ? -1 : 1); var y = { labelStandoff: h, labelShift: g }, m, b, w, _, k = 0, T = e.side, O = e._id.charAt(0), M = e.tickangle, C; if (O === "x") C = !u && T === "bottom" || u && T === "top", _ = C ? 1 : -1, u && (_ *= -1), m = g * _, b = t + h * _, w = C ? 1 : -0.2, Math.abs(M) === 90 && (u ? w += Qf : M === -90 && T === "bottom" ? w = Jl : M === 90 && T === "top" ? w = Qf : w = 0.5, k = Qf / 2 * (M / 90)), y.xFn = function(P) { return P.dx + m + k * P.fontSize; }, y.yFn = function(P) { return P.dy + b + P.fontSize * w; }, y.anchorFn = function(P, N) { if (c) { if (o) return "end"; if (l) return "start"; } return !Xn(N) || N === 0 || N === 180 ? "middle" : N * _ < 0 !== u ? "end" : "start"; }, y.heightFn = function(P, N, W) { return N < -60 || N > 60 ? -0.5 * W : e.side === "top" !== u ? -W : 0; }; else if (O === "y") { if (C = !u && T === "left" || u && T === "right", _ = C ? 1 : -1, u && (_ *= -1), m = h, b = g * _, w = 0, !u && Math.abs(M) === 90 && (M === -90 && T === "left" || M === 90 && T === "right" ? w = Jl : w = 0.5), u) { var I = Xn(M) ? +M : 0; if (I !== 0) { var j = Vt.deg2rad(I); k = Math.abs(Math.sin(j)) * Jl * _, w = 0; } } y.xFn = function(P) { return P.dx + t - (m + P.fontSize * w) * _ + k * P.fontSize; }, y.yFn = function(P) { return P.dy + b + P.fontSize * Qf; }, y.anchorFn = function(P, N) { return Xn(N) && Math.abs(N) === 90 ? "middle" : C ? "end" : "start"; }, y.heightFn = function(P, N, W) { return e.side === "right" && (N *= -1), N < -30 ? -W : N < 30 ? -0.5 * W : 0; }; } return y; }; function F0(e) { return [e.text, e.x, e.axInfo, e.font, e.fontSize, e.fontColor].join("_"); } Ye.drawTicks = function(e, t, n) { n = n || {}; var r = t._id + "tick", a = [].concat( t.minor && t.minor.ticks ? ( // minor vals n.vals.filter(function(o) { return o.minor && !o.noTick; }) ) : [] ).concat( t.ticks ? ( // major vals n.vals.filter(function(o) { return !o.minor && !o.noTick; }) ) : [] ), i = n.layer.selectAll("path." + r).data(a, F0); i.exit().remove(), i.enter().append("path").classed(r, 1).classed("ticks", 1).classed("crisp", n.crisp !== !1).each(function(o) { return kd.stroke(Ra.select(this), o.minor ? t.minor.tickcolor : t.tickcolor); }).style("stroke-width", function(o) { return ya.crispRound( e, o.minor ? t.minor.tickwidth : t.tickwidth, 1 ) + "px"; }).attr("d", n.path).style("display", null), I0(t, [BL]), i.attr("transform", n.transFn); }; Ye.drawGrid = function(e, t, n) { if (n = n || {}, t.tickmode !== "sync") { var r = t._id + "grid", a = t.minor && t.minor.showgrid, i = a ? n.vals.filter(function(m) { return m.minor; }) : [], o = t.showgrid ? n.vals.filter(function(m) { return !m.minor; }) : [], l = n.counterAxis; if (l && Ye.shouldShowZeroLine(e, t, l)) for (var s = t.tickmode === "array", c = 0; c < o.length; c++) { var u = o[c].x; if (s ? !u : Math.abs(u) < t.dtick / 100) if (o = o.slice(0, c).concat(o.slice(c + 1)), s) c--; else break; } t._gw = ya.crispRound(e, t.gridwidth, 1); for (var f = a ? ya.crispRound(e, t.minor.gridwidth, 1) : 0, h = n.layer, g = n.minorLayer, p = 1; p >= 0; p--) { var v = p ? h : g; if (v) { var y = v.selectAll("path." + r).data(p ? o : i, F0); y.exit().remove(), y.enter().append("path").classed(r, 1).classed("crisp", n.crisp !== !1), y.attr("transform", n.transFn).attr("d", n.path).each(function(m) { return kd.stroke( Ra.select(this), m.minor ? t.minor.gridcolor : t.gridcolor || "#ddd" ); }).style("stroke-dasharray", function(m) { return ya.dashStyle( m.minor ? t.minor.griddash : t.griddash, m.minor ? t.minor.gridwidth : t.gridwidth ); }).style("stroke-width", function(m) { return (m.minor ? f : t._gw) + "px"; }).style("display", null), typeof n.path == "function" && y.attr("d", n.path); } } I0(t, [_y, ky]); } }; Ye.drawZeroLine = function(e, t, n) { n = n || n; var r = t._id + "zl", a = Ye.shouldShowZeroLine(e, t, n.counterAxis), i = n.layer.selectAll("path." + r).data(a ? [{ x: 0, id: t._id }] : []); i.exit().remove(), i.enter().append("path").classed(r, 1).classed("zl", 1).classed("crisp", n.crisp !== !1).each(function() { n.layer.selectAll("path").sort(function(o, l) { return t$(o.id, l.id); }); }), i.attr("transform", n.transFn).attr("d", n.path).call(kd.stroke, t.zerolinecolor || kd.defaultLine).style("stroke-width", ya.crispRound(e, t.zerolinewidth, t._gw || 1) + "px").style("display", null), I0(t, [wy]); }; Ye.drawLabels = function(e, t, n) { n = n || {}; var r = e._fullLayout, a = t._id, i = a.charAt(0), o = n.cls || a + "tick", l = n.vals.filter(function(W) { return W.text; }), s = n.labelFns, c = n.secondary ? 0 : t.tickangle, u = (t._prevTickAngles || {})[o], f = n.layer.selectAll("g." + o).data(t.showticklabels ? l : [], F0), h = []; f.enter().append("g").classed(o, 1).append("text").attr("text-anchor", "middle").each(function(W) { var J = Ra.select(this), U = e._promises.length; J.call(Zu.positionText, s.xFn(W), s.yFn(W)).call(ya.font, W.font, W.fontSize, W.fontColor).text(W.text).call(Zu.convertToTspans, e), e._promises[U] ? h.push(e._promises.pop().then(function() { g(J, c); })) : g(J, c); }), I0(t, [Vk]), f.exit().remove(), n.repositionOnUpdate && f.each(function(W) { Ra.select(this).select("text").call(Zu.positionText, s.xFn(W), s.yFn(W)); }); function g(W, J) { W.each(function(U) { var E = Ra.select(this), z = E.select(".text-math-group"), F = s.anchorFn(U, J), q = n.transFn.call(E.node(), U) + (Xn(J) && +J != 0 ? " rotate(" + J + "," + s.xFn(U) + "," + (s.yFn(U) - U.fontSize / 2) + ")" : ""), H = Zu.lineCount(E), K = gp * U.fontSize, Q = s.heightFn(U, Xn(J) ? +J : 0, (H - 1) * K); if (Q && (q += Dc(0, Q)), z.empty()) { var re = E.select("text"); re.attr({ transform: q, "text-anchor": F }), re.style("opacity", 1), t._adjustTickLabelsOverflow && t._adjustTickLabelsOverflow(); } else { var te = ya.bBox(z.node()).width, X = te * { end: -0.5, start: 0.5 }[F]; z.attr("transform", q + Dc(X, 0)); } }); } t._adjustTickLabelsOverflow = function() { var W = t.ticklabeloverflow; if (!(!W || W === "allow")) { var J = W.indexOf("hide") !== -1, U = t._id.charAt(0) === "x", E = 0, z = U ? e._fullLayout.width : e._fullLayout.height; if (W.indexOf("domain") !== -1) { var F = Vt.simpleMap(t.range, t.r2l); E = t.l2p(F[0]) + t._offset, z = t.l2p(F[1]) + t._offset; } var q = Math.min(E, z), H = Math.max(E, z), K = t.side, Q = 1 / 0, re = -1 / 0; f.each(function(B) { var G = Ra.select(this), Z = G.select(".text-math-group"); if (Z.empty()) { var oe = ya.bBox(G.node()), ae = 0; U ? (oe.right > H || oe.left < q) && (ae = 1) : (oe.bottom > H || oe.top + (t.tickangle ? 0 : B.fontSize / 4) < q) && (ae = 1); var ge = G.select("text"); ae ? J && ge.style("opacity", 0) : (ge.style("opacity", 1), K === "bottom" || K === "right" ? Q = Math.min(Q, U ? oe.top : oe.left) : Q = -1 / 0, K === "top" || K === "left" ? re = Math.max(re, U ? oe.bottom : oe.right) : re = 1 / 0); } }); for (var te in r._plots) { var X = r._plots[te]; if (!(t._id !== X.xaxis._id && t._id !== X.yaxis._id)) { var ce = U ? X.yaxis : X.xaxis; ce && (ce["_visibleLabelMin_" + t._id] = Q, ce["_visibleLabelMax_" + t._id] = re); } } } }, t._hideCounterAxisInsideTickLabels = function(W) { var J = t._id.charAt(0) === "x", U = []; for (var E in r._plots) { var z = r._plots[E]; t._id !== z.xaxis._id && t._id !== z.yaxis._id || U.push(J ? z.yaxis : z.xaxis); } U.forEach(function(F, q) { F && Ad(F) && (W || [ wy, ky, _y, BL, Vk ]).forEach(function(H) { var K = H.K === "tick" && H.L === "text" && t.ticklabelmode === "period", Q = r._plots[t._mainSubplot], re; H.K === wy.K ? re = Q.zerolinelayer.selectAll("." + t._id + "zl") : H.K === ky.K ? re = Q.minorGridlayer.selectAll("." + t._id) : H.K === _y.K ? re = Q.gridlayer.selectAll("." + t._id) : re = Q[t._id.charAt(0) + "axislayer"], re.each(function() { var te = Ra.select(this); H.L && (te = te.selectAll(H.L)), te.each(function(X) { var ce = t.l2p( K ? Ty(X) : X.x ) + t._offset, B = Ra.select(this); ce < t["_visibleLabelMax_" + F._id] && ce > t["_visibleLabelMin_" + F._id] ? B.style("display", "none") : H.K === "tick" && !q && B.style("display", null); }); }); }); }); }, g(f, u + 1 ? u : c); function p() { return h.length && Promise.all(h); } var v = null; function y() { if (g(f, c), l.length && i === "x" && !Xn(c) && (t.type !== "log" || String(t.dtick).charAt(0) !== "D")) { v = 0; var W = 0, J = [], U; if (f.each(function(oe) { W = Math.max(W, oe.fontSize); var ae = t.l2p(oe.x), ge = My(this), ve = ya.bBox(ge.node()); J.push({ // ignore about y, just deal with x overlaps top: 0, bottom: 10, height: 10, left: ae - ve.width / 2, // impose a 2px gap right: ae + ve.width / 2 + 2, width: ve.width + 2 }); }), (t.tickson === "boundaries" || t.showdividers) && !n.secondary) { var E = 2; for (t.ticks && (E += t.tickwidth / 2), U = 0; U < J.length; U++) { var z = l[U].xbnd, F = J[U]; if (z[0] !== null && F.left - t.l2p(z[0]) < E || z[1] !== null && t.l2p(z[1]) - F.right < E) { v = 90; break; } } } else { var q = l.length, H = Math.abs((l[q - 1].x - l[0].x) * t._m) / (q - 1), K = t.ticklabelposition || "", Q = function(oe) { return K.indexOf(oe) !== -1; }, re = Q("top"), te = Q("left"), X = Q("right"), ce = Q("bottom"), B = ce || te || re || X, G = B ? (t.tickwidth || 0) + 2 * vp : 0, Z = H < W * 2.5 || t.type === "multicategory" || t._name === "realaxis"; for (U = 0; U < J.length - 1; U++) if (Vt.bBoxIntersect(J[U], J[U + 1], G)) { v = Z ? 90 : 30; break; } } v && g(f, v); } } t._selections && (t._selections[o] = f); var m = [p]; t.automargin && r._redrawFromAutoMarginCount && u === 90 ? (v = 90, m.push(function() { g(f, u); })) : m.push(y), t._tickAngles && m.push(function() { t._tickAngles[o] = v === null ? Xn(c) ? c : 0 : v; }); var b = function() { var W = 0, J = 0; return f.each(function(U, E) { var z = My(this), F = z.select(".text-math-group"); if (F.empty()) { var q; t._vals[E] && (q = t._vals[E].bb || ya.bBox(z.node()), t._vals[E].bb = q), W = Math.max(W, q.width), J = Math.max(J, q.height); } }), { labelsMaxW: W, labelsMaxH: J }; }, w = t._anchorAxis; if (w && (w.autorange || w.insiderange) && Ad(t) && !n$(r, t._id) && (r._insideTickLabelsUpdaterange || (r._insideTickLabelsUpdaterange = {}), w.autorange && (r._insideTickLabelsUpdaterange[w._name + ".autorange"] = w.autorange, m.push(b)), w.insiderange)) { var _ = b(), k = t._id.charAt(0) === "y" ? _.labelsMaxW : _.labelsMaxH; k += 2 * vp, t.ticklabelposition === "inside" && (k += t.ticklen || 0); var T = t.side === "right" || t.side === "top" ? 1 : -1, O = T === 1 ? 1 : 0, M = T === 1 ? 0 : 1, C = []; C[M] = w.range[M]; var I = w.d2p(w.range[O]), j = w.d2p(w.range[M]), P = Math.abs(j - I); P - k > 0 ? (P -= k, k *= 1 + k / P) : k = 0, t._id.charAt(0) !== "y" && (k = -k), C[O] = w.p2d( w.d2p(w.range[O]) + T * k ), w.autorange === "min" || w.autorange === "max reversed" ? (C[0] = null, w._rangeInitial0 = void 0, w._rangeInitial1 = void 0) : (w.autorange === "max" || w.autorange === "min reversed") && (C[1] = null, w._rangeInitial0 = void 0, w._rangeInitial1 = void 0), r._insideTickLabelsUpdaterange[w._name + ".range"] = C; } var N = Vt.syncOrAsync(m); return N && N.then && e._promises.push(N), N; }; function A$(e, t, n) { var r = t._id + "divider", a = n.vals, i = n.layer.selectAll("path." + r).data(a, F0); i.exit().remove(), i.enter().insert("path", ":first-child").classed(r, 1).classed("crisp", 1).call(kd.stroke, t.dividercolor).style("stroke-width", ya.crispRound(e, t.dividerwidth, 1) + "px"), i.attr("transform", n.transFn).attr("d", n.path); } Ye.getPxPosition = function(e, t) { var n = e._fullLayout._size, r = t._id.charAt(0), a = t.side, i; if (t.anchor !== "free" ? i = t._anchorAxis : r === "x" ? i = { _offset: n.t + (1 - (t.position || 0)) * n.h, _length: 0 } : r === "y" && (i = { _offset: n.l + (t.position || 0) * n.w + t._shift, _length: 0 }), a === "top" || a === "left") return i._offset; if (a === "bottom" || a === "right") return i._offset + i._length; }; function Ay(e) { var t = e.title.font.size, n = (e.title.text.match(Zu.BR_TAG_ALL) || []).length; return e.title.hasOwnProperty("standoff") ? n ? t * (Jl + n * gp) : t * Jl : n ? t * (n + 1) * gp : t; } function M$(e, t) { var n = e._fullLayout, r = t._id, a = r.charAt(0), i = t.title.font.size, o; if (t.title.hasOwnProperty("standoff")) o = t._depth + t.title.standoff + Ay(t); else { var l = Ad(t); if (t.type === "multicategory") o = t._depth; else { var s = 1.5 * i; l && (s = 0.5 * i, t.ticks === "outside" && (s += t.ticklen)), o = 10 + s + (t.linewidth ? t.linewidth - 1 : 0); } l || (a === "x" ? o += t.side === "top" ? i * (t.showticklabels ? 1 : 0) : i * (t.showticklabels ? 1.5 : 0.5) : o += t.side === "right" ? i * (t.showticklabels ? 1 : 0.5) : i * (t.showticklabels ? 0.5 : 0)); } var c = Ye.getPxPosition(e, t), u, f, h; a === "x" ? (f = t._offset + t._length / 2, h = t.side === "top" ? c - o : c + o) : (h = t._offset + t._length / 2, f = t.side === "right" ? c + o : c - o, u = { rotate: "-90", offset: 0 }); var g; if (t.type !== "multicategory") { var p = t._selections[t._id + "tick"]; if (g = { selection: p, side: t.side }, p && p.node() && p.node().parentNode) { var v = ya.getTranslate(p.node().parentNode); g.offsetLeft = v.x, g.offsetTop = v.y; } t.title.hasOwnProperty("standoff") && (g.pad = 0); } return t._titleStandoff = o, YY.draw(e, r + "title", { propContainer: t, propName: t._name + ".title.text", placeholder: n._dfltTitle[a], avoid: g, transform: u, attributes: { x: f, y: h, "text-anchor": "middle" } }); } Ye.shouldShowZeroLine = function(e, t, n) { var r = Vt.simpleMap(t.range, t.r2l); return r[0] * r[1] <= 0 && t.zeroline && (t.type === "linear" || t.type === "-") && !(t.rangebreaks && t.maskBreaks(0) === O0) && (WL(t, 0) || !S$(e, t, n, r) || C$(e, t)); }; Ye.clipEnds = function(e, t) { return t.filter(function(n) { return WL(e, n.x); }); }; function WL(e, t) { var n = e.l2p(t); return n > 1 && n < e._length - 1; } function S$(e, t, n, r) { var a = n._mainAxis; if (!a) return; var i = e._fullLayout, o = t._id.charAt(0), l = Ye.counterLetter(t._id), s = t._offset + (Math.abs(r[0]) < Math.abs(r[1]) == (o === "x") ? 0 : t._length); function c(p) { if (!p.showline || !p.linewidth) return !1; var v = Math.max((p.linewidth + t.zerolinewidth) / 2, 1); function y(w) { return typeof w == "number" && Math.abs(w - s) < v; } if (y(p._mainLinePosition) || y(p._mainMirrorPosition)) return !0; var m = p._linepositions || {}; for (var b in m) if (y(m[b][0]) || y(m[b][1])) return !0; } var u = i._plots[n._mainSubplot]; if (!(u.mainplotinfo || u).overlays.length) return c(n); for (var f = Ye.list(e, l), h = 0; h < f.length; h++) { var g = f[h]; if (g._mainAxis === a && c(g)) return !0; } } function C$(e, t) { for (var n = e._fullData, r = t._mainSubplot, a = t._id.charAt(0), i = 0; i < n.length; i++) { var o = n[i]; if (o.visible === !0 && o.xaxis + o.yaxis === r && (_d.traceIs(o, "bar-like") && o.orientation === { x: "h", y: "v" }[a] || o.fill && o.fill.charAt(o.fill.length - 1) === a)) return !0; } return !1; } function My(e) { var t = Ra.select(e), n = t.select(".text-math-group"); return n.empty() ? t.select("text") : n; } Ye.allowAutoMargin = function(e) { for (var t = Ye.list(e, "", !0), n = 0; n < t.length; n++) { var r = t[n]; r.automargin && (yc.allowAutoMargin(e, bx(r)), r.mirror && yc.allowAutoMargin(e, ZL(r))), _d.getComponentMethod("rangeslider", "isVisible")(r) && yc.allowAutoMargin(e, YL(r)); } }; function bx(e) { return e._id + ".automargin"; } function ZL(e) { return bx(e) + ".mirror"; } function YL(e) { return e._id + ".rangeslider"; } Ye.swap = function(e, t) { for (var n = L$(e, t), r = 0; r < n.length; r++) O$(e, n[r].x, n[r].y); }; function L$(e, t) { var n = [], r, a; for (r = 0; r < t.length; r++) { var i = [], o = e._fullData[t[r]].xaxis, l = e._fullData[t[r]].yaxis; if (!(!o || !l)) { for (a = 0; a < n.length; a++) (n[a].x.indexOf(o) !== -1 || n[a].y.indexOf(l) !== -1) && i.push(a); if (!i.length) { n.push({ x: [o], y: [l] }); continue; } var s = n[i[0]], c; if (i.length > 1) for (a = 1; a < i.length; a++) c = n[i[a]], eh(s.x, c.x), eh(s.y, c.y); eh(s.x, [o]), eh(s.y, [l]); } } return n; } function eh(e, t) { for (var n = 0; n < t.length; n++) e.indexOf(t[n]) === -1 && e.push(t[n]); } function O$(e, t, n) { var r = [], a = [], i = e.layout, o, l; for (o = 0; o < t.length; o++) r.push(Ye.getFromId(e, t[o])); for (o = 0; o < n.length; o++) a.push(Ye.getFromId(e, n[o])); var s = Object.keys($Y), c = [ "anchor", "domain", "overlaying", "position", "side", "tickangle", "editType" ], u = ["linear", "log"]; for (o = 0; o < s.length; o++) { var f = s[o], h = r[0][f], g = a[0][f], p = !0, v = !1, y = !1; if (!(f.charAt(0) === "_" || typeof h == "function" || c.indexOf(f) !== -1)) { for (l = 1; l < r.length && p; l++) { var m = r[l][f]; f === "type" && u.indexOf(h) !== -1 && u.indexOf(m) !== -1 && h !== m ? v = !0 : m !== h && (p = !1); } for (l = 1; l < a.length && p; l++) { var b = a[l][f]; f === "type" && u.indexOf(g) !== -1 && u.indexOf(b) !== -1 && g !== b ? y = !0 : a[l][f] !== g && (p = !1); } p && (v && (i[r[0]._name].type = "linear"), y && (i[a[0]._name].type = "linear"), D$(i, f, r, a, e._fullLayout._dfltTitle)); } } for (o = 0; o < e._fullLayout.annotations.length; o++) { var w = e._fullLayout.annotations[o]; t.indexOf(w.xref) !== -1 && n.indexOf(w.yref) !== -1 && Vt.swapAttrs(i.annotations[o], ["?"]); } } function D$(e, t, n, r, a) { var i = Vt.nestedProperty, o = i(e[n[0]._name], t).get(), l = i(e[r[0]._name], t).get(), s; for (t === "title" && (o && o.text === a.x && (o.text = a.y), l && l.text === a.y && (l.text = a.x)), s = 0; s < n.length; s++) i(e, n[s]._name + "." + t).set(l); for (s = 0; s < r.length; s++) i(e, r[s]._name + "." + t).set(o); } function wx(e) { return e._id === "angularaxis"; } function pv(e, t) { for (var n = t._rangebreaks.length, r = 0; r < n; r++) { var a = t._rangebreaks[r]; if (e >= a.min && e < a.max) return a.max; } return e; } function Ad(e) { return (e.ticklabelposition || "").indexOf("inside") !== -1; } function I0(e, t) { Ad(e._anchorAxis || {}) && e._hideCounterAxisInsideTickLabels && e._hideCounterAxisInsideTickLabels(t); } function Sy(e, t, n, r) { var a = e.anchor !== "free" && (e.overlaying === void 0 || e.overlaying === !1) ? e._id : e.overlaying, i; r ? i = e.side === "right" ? t : -t : i = t, a in n || (n[a] = {}), e.side in n[a] || (n[a][e.side] = 0), n[a][e.side] += i; } function F$(e, t) { return e.autoshift ? t[e.overlaying][e.side] : e.shift || 0; } var Ln = nL.exports, I$ = function(e, t, n) { var r, a; if (n) { var i = t === "reversed" || t === "min reversed" || t === "max reversed"; r = n[i ? 1 : 0], a = n[i ? 0 : 1]; } var o = e("autorangeoptions.minallowed", a === null ? r : void 0), l = e("autorangeoptions.maxallowed", r === null ? a : void 0); o === void 0 && e("autorangeoptions.clipmin"), l === void 0 && e("autorangeoptions.clipmax"), e("autorangeoptions.include"); }, z$ = I$, $L = function(e, t, n, r) { var a = t._template || {}, i = t.type || a.type || "-"; n("minallowed"), n("maxallowed"); var o = n("range"); if (!o) { var l; !r.noInsiderange && i !== "log" && (l = n("insiderange"), l && (l[0] === null || l[1] === null) && (t.insiderange = !1, l = void 0), l && (o = n("range", l))); } var s = t.getAutorangeDflt(o, r), c = n("autorange", s), u; o && (o[0] === null && o[1] === null || (o[0] === null || o[1] === null) && (c === "reversed" || c === !0) || o[0] !== null && (c === "min" || c === "max reversed") || o[1] !== null && (c === "max" || c === "min reversed")) && (o = void 0, delete t.range, t.autorange = !0, u = !0), u || (s = t.getAutorangeDflt(o, r), c = n("autorange", s)), c && (z$(n, c, o), (i === "linear" || i === "-") && n("rangemode")), t.cleanRange(); }, _x = {}, KL = { exports: {} }, E$ = { left: 0, top: 0 }, j$ = P$; function P$(e, t, n) { t = t || e.currentTarget || e.srcElement, Array.isArray(n) || (n = [0, 0]); var r = e.clientX || 0, a = e.clientY || 0, i = R$(t); return n[0] = r - i.left, n[1] = a - i.top, n; } function R$(e) { return e === window || e === document || e === document.body ? E$ : e.getBoundingClientRect(); } function N$() { var e = !1; try { var t = Object.defineProperty({}, "passive", { get: function() { e = !0; } }); window.addEventListener("test", null, t), window.removeEventListener("test", null, t); } catch { e = !1; } return e; } var JL = N$(), B$ = function(e, t, n, r, a) { var i = (e - n) / (r - n), o = i + t / (r - n), l = (i + o) / 2; return a === "left" || a === "bottom" ? i : a === "center" || a === "middle" ? l : a === "right" || a === "top" ? o : i < 2 / 3 - l ? i : o > 4 / 3 - l ? o : l; }, Jk = Ue, H$ = [ ["sw-resize", "s-resize", "se-resize"], ["w-resize", "move", "e-resize"], ["nw-resize", "n-resize", "ne-resize"] ], V$ = function(e, t, n, r) { return n === "left" ? e = 0 : n === "center" ? e = 1 : n === "right" ? e = 2 : e = Jk.constrain(Math.floor(e * 3), 0, 2), r === "bottom" ? t = 0 : r === "middle" ? t = 1 : r === "top" ? t = 2 : t = Jk.constrain(Math.floor(t * 3), 0, 2), H$[t][e]; }, QL = { exports: {} }, q$ = w0, U$ = m0, G$ = f0.getGraphDiv, W$ = s0, Cy = QL.exports = {}; Cy.wrapped = function(e, t, n) { e = G$(e), e._fullLayout && U$.clear(e._fullLayout._uid + W$.HOVERID), Cy.raw(e, t, n); }; Cy.raw = function(e, t) { var n = e._fullLayout, r = e._hoverdata; t || (t = {}), !(t.target && !e._dragged && q$.triggerHandler(e, "plotly_beforehover", t) === !1) && (n._hoverlayer.selectAll("g").remove(), n._hoverlayer.selectAll("line").remove(), n._hoverlayer.selectAll("circle").remove(), e._hoverdata = void 0, t.target && r && e.emit("plotly_unhover", { event: t, points: r })); }; var Z$ = QL.exports, Y$ = j$, gv = jC, $$ = JL, K$ = Ue.removeElement, J$ = $r, ls = KL.exports = {}; ls.align = B$; ls.getCursor = V$; var XL = Z$; ls.unhover = XL.wrapped; ls.unhoverRaw = XL.raw; ls.init = function(e) { var t = e.gd, n = 1, r = t._context.doubleClickDelay, a = e.element, i, o, l, s, c, u, f, h; t._mouseDownTime || (t._mouseDownTime = 0), a.style.pointerEvents = "all", a.onmousedown = v, $$ ? (a._ontouchstart && a.removeEventListener("touchstart", a._ontouchstart), a._ontouchstart = v, a.addEventListener("touchstart", v, { passive: !1 })) : a.ontouchstart = v; function g(b, w, _) { return Math.abs(b) < _ && (b = 0), Math.abs(w) < _ && (w = 0), [b, w]; } var p = e.clampFn || g; function v(b) { t._dragged = !1, t._dragging = !0; var w = vv(b); i = w[0], o = w[1], f = b.target, u = b, h = b.buttons === 2 || b.ctrlKey, typeof b.clientX > "u" && typeof b.clientY > "u" && (b.clientX = i, b.clientY = o), l = (/* @__PURE__ */ new Date()).getTime(), l - t._mouseDownTime < r ? n += 1 : (n = 1, t._mouseDownTime = l), e.prepFn && e.prepFn(b, i, o), gv && !h ? (c = e6(), c.style.cursor = window.getComputedStyle(a).cursor) : gv || (c = document, s = window.getComputedStyle(document.documentElement).cursor, document.documentElement.style.cursor = window.getComputedStyle(a).cursor), document.addEventListener("mouseup", m), document.addEventListener("touchend", m), e.dragmode !== !1 && (b.preventDefault(), document.addEventListener("mousemove", y), document.addEventListener("touchmove", y, { passive: !1 })); } function y(b) { b.preventDefault(); var w = vv(b), _ = e.minDrag || J$.MINDRAG, k = p(w[0] - i, w[1] - o, _), T = k[0], O = k[1]; (T || O) && (t._dragged = !0, ls.unhover(t, b)), t._dragged && e.moveFn && !h && (t._dragdata = { element: a, dx: T, dy: O }, e.moveFn(T, O)); } function m(b) { if (delete t._dragdata, e.dragmode !== !1 && (b.preventDefault(), document.removeEventListener("mousemove", y), document.removeEventListener("touchmove", y)), document.removeEventListener("mouseup", m), document.removeEventListener("touchend", m), gv ? K$(c) : s && (c.documentElement.style.cursor = s, s = null), !t._dragging) { t._dragged = !1; return; } if (t._dragging = !1, (/* @__PURE__ */ new Date()).getTime() - t._mouseDownTime > r && (n = Math.max(n - 1, 1)), t._dragged) e.doneFn && e.doneFn(); else if (e.clickFn && e.clickFn(n, u), !h) { var w; try { w = new MouseEvent("click", b); } catch { var _ = vv(b); w = document.createEvent("MouseEvents"), w.initMouseEvent( "click", b.bubbles, b.cancelable, b.view, b.detail, b.screenX, b.screenY, _[0], _[1], b.ctrlKey, b.altKey, b.shiftKey, b.metaKey, b.button, b.relatedTarget ); } f.dispatchEvent(w); } t._dragging = !1, t._dragged = !1; } }; function e6() { var e = document.createElement("div"); e.className = "dragcover"; var t = e.style; return t.position = "fixed", t.left = 0, t.right = 0, t.top = 0, t.bottom = 0, t.zIndex = 999999999, t.background = "none", document.body.appendChild(e), e; } ls.coverSlip = e6; function vv(e) { return Y$( e.changedTouches ? e.changedTouches[0] : e, document.body ); } var Xi = KL.exports, z0 = {}, bs = function(e, t) { (e.attr("class") || "").split(" ").forEach(function(n) { n.indexOf("cursor-") === 0 && e.classed(n, !1); }), t && e.classed("cursor-" + t, !0); }, mv = bs, Mu = "data-savedcursor", Qk = "!!", Q$ = function(e, t) { var n = e.attr(Mu); if (t) { if (!n) { for (var r = (e.attr("class") || "").split(" "), a = 0; a < r.length; a++) { var i = r[a]; i.indexOf("cursor-") === 0 && e.attr(Mu, i.substr(7)).classed(i, !1); } e.attr(Mu) || e.attr(Mu, Qk); } mv(e, t); } else n && (e.attr(Mu, null), n === Qk ? mv(e) : mv(e, n)); }, yv = Fr, X$ = fa, t6 = { // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: !0, visible: { valType: "boolean", dflt: !0, editType: "legend", description: [ "Determines whether or not this legend is visible." ].join(" ") }, bgcolor: { valType: "color", editType: "legend", description: [ "Sets the legend background color.", "Defaults to `layout.paper_bgcolor`." ].join(" ") }, bordercolor: { valType: "color", dflt: X$.defaultLine, editType: "legend", description: "Sets the color of the border enclosing the legend." }, borderwidth: { valType: "number", min: 0, dflt: 0, editType: "legend", description: "Sets the width (in px) of the border enclosing the legend." }, font: yv({ editType: "legend", description: "Sets the font used to text the legend items." }), grouptitlefont: yv({ editType: "legend", description: [ "Sets the font for group titles in legend.", "Defaults to `legend.font` with its size increased about 10%." ].join(" ") }), orientation: { valType: "enumerated", values: ["v", "h"], dflt: "v", editType: "legend", description: "Sets the orientation of the legend." }, traceorder: { valType: "flaglist", flags: ["reversed", "grouped"], extras: ["normal"], editType: "legend", description: [ "Determines the order at which the legend items are displayed.", "If *normal*, the items are displayed top-to-bottom in the same", "order as the input data.", "If *reversed*, the items are displayed in the opposite order", "as *normal*.", "If *grouped*, the items are displayed in groups", "(when a trace `legendgroup` is provided).", "if *grouped+reversed*, the items are displayed in the opposite order", "as *grouped*." ].join(" ") }, tracegroupgap: { valType: "number", min: 0, dflt: 10, editType: "legend", description: [ "Sets the amount of vertical space (in px) between legend groups." ].join(" ") }, entrywidth: { valType: "number", min: 0, editType: "legend", description: [ "Sets the width (in px or fraction) of the legend.", "Use 0 to size the entry based on the text width,", "when `entrywidthmode` is set to *pixels*." ].join(" ") }, entrywidthmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "pixels", editType: "legend", description: "Determines what entrywidth means." }, itemsizing: { valType: "enumerated", values: ["trace", "constant"], dflt: "trace", editType: "legend", description: [ "Determines if the legend items symbols scale with their corresponding *trace* attributes", "or remain *constant* independent of the symbol size on the graph." ].join(" ") }, itemwidth: { valType: "number", min: 30, dflt: 30, editType: "legend", description: "Sets the width (in px) of the legend item symbols (the part other than the title.text)." }, itemclick: { valType: "enumerated", values: ["toggle", "toggleothers", !1], dflt: "toggle", editType: "legend", description: [ "Determines the behavior on legend item click.", "*toggle* toggles the visibility of the item clicked on the graph.", "*toggleothers* makes the clicked item the sole visible item on the graph.", "*false* disables legend item click interactions." ].join(" ") }, itemdoubleclick: { valType: "enumerated", values: ["toggle", "toggleothers", !1], dflt: "toggleothers", editType: "legend", description: [ "Determines the behavior on legend item double-click.", "*toggle* toggles the visibility of the item clicked on the graph.", "*toggleothers* makes the clicked item the sole visible item on the graph.", "*false* disables legend item double-click interactions." ].join(" ") }, groupclick: { valType: "enumerated", values: ["toggleitem", "togglegroup"], dflt: "togglegroup", editType: "legend", description: [ "Determines the behavior on legend group item click.", "*toggleitem* toggles the visibility of the individual item clicked on the graph.", "*togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph." ].join(" ") }, x: { valType: "number", editType: "legend", description: [ "Sets the x position with respect to `xref` (in normalized coordinates) of the legend.", "When `xref` is *paper*, defaults to *1.02* for vertical legends and", "defaults to *0* for horizontal legends.", "When `xref` is *container*, defaults to *1* for vertical legends and", "defaults to *0* for horizontal legends.", "Must be between *0* and *1* if `xref` is *container*.", "and between *-2* and *3* if `xref` is *paper*." ].join(" ") }, xref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `x` refers to.", "*container* spans the entire `width` of the plot.", "*paper* refers to the width of the plotting area only." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", editType: "legend", description: [ "Sets the legend's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the legend.", "Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,", "anchors legends to the left for `x` values less than or equal to 1/3 and", "anchors legends with respect to their center otherwise." ].join(" ") }, y: { valType: "number", editType: "legend", description: [ "Sets the y position with respect to `yref` (in normalized coordinates) of the legend.", "When `yref` is *paper*, defaults to *1* for vertical legends,", "defaults to *-0.1* for horizontal legends on graphs w/o range sliders and", "defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.", "When `yref` is *container*, defaults to *1*.", "Must be between *0* and *1* if `yref` is *container*", "and between *-2* and *3* if `yref` is *paper*." ].join(" ") }, yref: { valType: "enumerated", dflt: "paper", values: ["container", "paper"], editType: "layoutstyle", description: [ "Sets the container `y` refers to.", "*container* spans the entire `height` of the plot.", "*paper* refers to the height of the plotting area only." ].join(" ") }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], editType: "legend", description: [ "Sets the legend's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the legend.", "Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,", "anchors legends to at their top for `y` values greater than or equal to 2/3 and", "anchors legends with respect to their middle otherwise." ].join(" ") }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of legend-driven changes in trace and pie label", "visibility. Defaults to `layout.uirevision`." ].join(" ") }, valign: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "middle", editType: "legend", description: [ "Sets the vertical alignment of the symbols with respect to their associated text." ].join(" ") }, title: { text: { valType: "string", dflt: "", editType: "legend", description: [ "Sets the title of the legend." ].join(" ") }, font: yv({ editType: "legend", description: [ "Sets this legend's title font.", "Defaults to `legend.font` with its size increased about 20%." ].join(" ") }), side: { valType: "enumerated", values: ["top", "left", "top left", "top center", "top right"], editType: "legend", description: [ "Determines the location of legend's title", "with respect to the legend items.", "Defaulted to *top* with `orientation` is *h*.", "Defaulted to *left* with `orientation` is *v*.", "The *top left* options could be used to expand", "top center and top right are for horizontal alignment", "legend area in both x and y sides." ].join(" ") }, editType: "legend" }, editType: "legend" }, eu = {}; eu.isGrouped = function(e) { return (e.traceorder || "").indexOf("grouped") !== -1; }; eu.isVertical = function(e) { return e.orientation !== "h"; }; eu.isReversed = function(e) { return (e.traceorder || "").indexOf("reversed") !== -1; }; var xv = Rt, na = Ue, eK = Sn, tK = Zi, nK = t6, rK = $d, bv = eu; function aK(e, t, n, r) { var a = t[e] || {}, i = eK.newContainer(n, e); function o(E, z) { return na.coerce(a, i, nK, E, z); } var l = na.coerceFont(o, "font", n.font); o("bgcolor", n.paper_bgcolor), o("bordercolor"); var s = o("visible"); if (s) { for (var c, u = function(E, z) { var F = c._input, q = c; return na.coerce(F, q, tK, E, z); }, f = n.font || {}, h = na.coerceFont(o, "grouptitlefont", na.extendFlat({}, f, { size: Math.round(f.size * 1.1) })), g = 0, p = !1, v = "normal", y = (n.shapes || []).filter(function(E) { return E.showlegend; }), m = r.concat(y).filter(function(E) { return e === (E.legend || "legend"); }), b = 0; b < m.length; b++) if (c = m[b], !!c.visible) { var w = c._isShape; (c.showlegend || c._dfltShowLegend && !(c._module && c._module.attributes && c._module.attributes.showlegend && c._module.attributes.showlegend.dflt === !1)) && (g++, c.showlegend && (p = !0, (!w && xv.traceIs(c, "pie-like") || c._input.showlegend === !0) && g++), na.coerceFont(u, "legendgrouptitle.font", h)), (!w && xv.traceIs(c, "bar") && n.barmode === "stack" || ["tonextx", "tonexty"].indexOf(c.fill) !== -1) && (v = bv.isGrouped({ traceorder: v }) ? "grouped+reversed" : "reversed"), c.legendgroup !== void 0 && c.legendgroup !== "" && (v = bv.isReversed({ traceorder: v }) ? "reversed+grouped" : "grouped"); } var _ = na.coerce( t, n, rK, "showlegend", p && g > (e === "legend" ? 1 : 0) ); if (_ === !1 && (n[e] = void 0), !(_ === !1 && !a.uirevision) && (o("uirevision", n.uirevision), _ !== !1)) { o("borderwidth"); var k = o("orientation"), T = o("yref"), O = o("xref"), M = k === "h", C = T === "paper", I = O === "paper", j, P, N, W = "left"; M ? (j = 0, xv.getComponentMethod("rangeslider", "isVisible")(t.xaxis) ? C ? (P = 1.1, N = "bottom") : (P = 1, N = "top") : C ? (P = -0.1, N = "top") : (P = 0, N = "bottom")) : (P = 1, N = "auto", I ? j = 1.02 : (j = 1, W = "right")), na.coerce(a, i, { x: { valType: "number", editType: "legend", min: I ? -2 : 0, max: I ? 3 : 1, dflt: j } }, "x"), na.coerce(a, i, { y: { valType: "number", editType: "legend", min: C ? -2 : 0, max: C ? 3 : 1, dflt: P } }, "y"), o("traceorder", v), bv.isGrouped(n[e]) && o("tracegroupgap"), o("entrywidth"), o("entrywidthmode"), o("itemsizing"), o("itemwidth"), o("itemclick"), o("itemdoubleclick"), o("groupclick"), o("xanchor", W), o("yanchor", N), o("valign"), na.noneOrAll(a, i, ["x", "y"]); var J = o("title.text"); if (J) { o("title.side", M ? "left" : "top"); var U = na.extendFlat({}, l, { size: na.bigFont(l.size) }); na.coerceFont(o, "title.font", U); } } } } var n6 = function(e, t, n) { var r, a = n.slice(), i = t.shapes; if (i) for (r = 0; r < i.length; r++) { var o = i[r]; if (o.showlegend) { var l = { _input: o._input, visible: o.visible, showlegend: o.showlegend, legend: o.legend }; a.push(l); } } var s = ["legend"]; for (r = 0; r < a.length; r++) na.pushUnique(s, a[r].legend); for (t._legends = [], r = 0; r < s.length; r++) { var c = s[r]; aK(c, e, t, a), t[c] && t[c].visible && (t[c]._id = c), t._legends.push(c); } }, No = Rt, Rh = Ue, iK = Rh.pushUnique, Xk = !0, oK = function(e, t, n) { var r = t._fullLayout; if (t._dragged || t._editing) return; var a = r.legend.itemclick, i = r.legend.itemdoubleclick, o = r.legend.groupclick; n === 1 && a === "toggle" && i === "toggleothers" && Xk && t.data && t._context.showTips && Rh.notifier(Rh._(t, "Double-click on legend to isolate one trace"), "long"), Xk = !1; var l; if (n === 1 ? l = a : n === 2 && (l = i), !l) return; var s = o === "togglegroup", c = r.hiddenlabels ? r.hiddenlabels.slice() : [], u = e.data()[0][0]; if (u.groupTitle && u.noClick) return; var f = t._fullData, h = (r.shapes || []).filter(function(Fe) { return Fe.showlegend; }), g = f.concat(h), p = u.trace; p._isShape && (p = p._fullInput); var v = p.legendgroup, y, m, b, w, _, k, T = {}, O = [], M = [], C = []; function I(Fe, Re) { var We = O.indexOf(Fe), Ce = T.visible; return Ce || (Ce = T.visible = []), O.indexOf(Fe) === -1 && (O.push(Fe), We = O.length - 1), Ce[We] = Re, We; } var j = (r.shapes || []).map(function(Fe) { return Fe._input; }), P = !1; function N(Fe, Re) { j[Fe].visible = Re, P = !0; } function W(Fe, Re) { if (!(u.groupTitle && !s)) { var We = Fe._fullInput || Fe, Ce = We._isShape, Ve = We.index; if (Ve === void 0 && (Ve = We._index), No.hasTransform(We, "groupby")) { var Ke = M[Ve]; if (!Ke) { var Xe = No.getTransformIndices(We, "groupby"), ct = Xe[Xe.length - 1]; Ke = Rh.keyedContainer(We, "transforms[" + ct + "].styles", "target", "value.visible"), M[Ve] = Ke; } var vt = Ke.get(Fe._group); vt === void 0 && (vt = !0), vt !== !1 && Ke.set(Fe._group, Re), C[Ve] = I(Ve, We.visible !== !1); } else { var lt = We.visible === !1 ? !1 : Re; Ce ? N(Ve, lt) : I(Ve, lt); } } } var J = p.legend, U = p._fullInput, E = U && U._isShape; if (!E && No.traceIs(p, "pie-like")) { var z = u.label, F = c.indexOf(z); if (l === "toggle") F === -1 ? c.push(z) : c.splice(F, 1); else if (l === "toggleothers") { var q = F !== -1, H = []; for (y = 0; y < t.calcdata.length; y++) { var K = t.calcdata[y]; for (m = 0; m < K.length; m++) { var Q = K[m], re = Q.label; J === K[0].trace.legend && z !== re && (c.indexOf(re) === -1 && (q = !0), iK(c, re), H.push(re)); } } if (!q) for (var te = 0; te < H.length; te++) { var X = c.indexOf(H[te]); X !== -1 && c.splice(X, 1); } } No.call("_guiRelayout", t, "hiddenlabels", c); } else { var ce = v && v.length, B = [], G; if (ce) for (y = 0; y < g.length; y++) G = g[y], G.visible && G.legendgroup === v && B.push(y); if (l === "toggle") { var Z; switch (p.visible) { case !0: Z = "legendonly"; break; case !1: Z = !1; break; case "legendonly": Z = !0; break; } if (ce) if (s) for (y = 0; y < g.length; y++) { var oe = g[y]; oe.visible !== !1 && oe.legendgroup === v && W(oe, Z); } else W(p, Z); else W(p, Z); } else if (l === "toggleothers") { var ae, ge, ve, pe, ye, Oe = !0; for (y = 0; y < g.length; y++) if (ye = g[y], ae = ye === p, ve = ye.showlegend !== !0, !(ae || ve) && (ge = ce && ye.legendgroup === v, !ge && ye.legend === J && ye.visible === !0 && !No.traceIs(ye, "notLegendIsolatable"))) { Oe = !1; break; } for (y = 0; y < g.length; y++) if (ye = g[y], !(ye.visible === !1 || ye.legend !== J) && !No.traceIs(ye, "notLegendIsolatable")) switch (p.visible) { case "legendonly": W(ye, !0); break; case !0: pe = Oe ? !0 : "legendonly", ae = ye === p, ve = ye.showlegend !== !0 && !ye.legendgroup, ge = ae || ce && ye.legendgroup === v, W(ye, ge || ve ? !0 : pe); break; } } for (y = 0; y < M.length; y++) if (b = M[y], !!b) { var Be = b.constructUpdate(), Ie = Object.keys(Be); for (m = 0; m < Ie.length; m++) w = Ie[m], k = T[w] = T[w] || [], k[C[y]] = Be[w]; } for (_ = Object.keys(T), y = 0; y < _.length; y++) for (w = _[y], m = 0; m < O.length; m++) T[w].hasOwnProperty(m) || (T[w][m] = void 0); P ? No.call("_guiUpdate", t, T, { shapes: j }, O) : No.call("_guiRestyle", t, T, O); } }, r6 = { scrollBarWidth: 6, scrollBarMinHeight: 20, scrollBarColor: "#808BA4", scrollBarMargin: 4, scrollBarEnterAttrs: { rx: 20, ry: 3, width: 0, height: 0 }, // number of px between legend title and (left) side of legend (always in x direction and from inner border) titlePad: 2, // number of px between each legend item (x and/or y direction) itemGap: 5 }, eT = Rt, wv = eu, lK = function(e, t, n) { var r = t._inHover, a = wv.isGrouped(t), i = wv.isReversed(t), o = {}, l = [], s = !1, c = {}, u = 0, f = 0, h, g; function p(U, E, z) { if (t.visible !== !1 && !(n && U !== t._id)) if (E === "" || !wv.isGrouped(t)) { var F = "~~i" + u; l.push(F), o[F] = [z], u++; } else l.indexOf(E) === -1 ? (l.push(E), s = !0, o[E] = [z]) : o[E].push(z); } for (h = 0; h < e.length; h++) { var v = e[h], y = v[0], m = y.trace, b = m.legend, w = m.legendgroup; if (!(!r && (!m.visible || !m.showlegend))) if (eT.traceIs(m, "pie-like")) for (c[w] || (c[w] = {}), g = 0; g < v.length; g++) { var _ = v[g].label; c[w][_] || (p(b, w, { label: _, color: v[g].color, i: v[g].i, trace: m, pts: v[g].pts }), c[w][_] = !0, f = Math.max(f, (_ || "").length)); } else p(b, w, y), f = Math.max(f, (m.name || "").length); } if (!l.length) return []; var k = !s || !a, T = []; for (h = 0; h < l.length; h++) { var O = o[l[h]]; k ? T.push(O[0]) : T.push(O); } for (k && (T = [T]), h = 0; h < T.length; h++) { var M = 1 / 0; for (g = 0; g < T[h].length; g++) { var C = T[h][g].trace.legendrank; M > C && (M = C); } T[h][0]._groupMinRank = M, T[h][0]._preGroupSort = h; } var I = function(U, E) { return U[0]._groupMinRank - E[0]._groupMinRank || U[0]._preGroupSort - E[0]._preGroupSort; }, j = function(U, E) { return U.trace.legendrank - E.trace.legendrank || U._preSort - E._preSort; }; for (T.forEach(function(U, E) { U[0]._preGroupSort = E; }), T.sort(I), h = 0; h < T.length; h++) { T[h].forEach(function(U, E) { U._preSort = E; }), T[h].sort(j); var P = T[h][0].trace, N = null; for (g = 0; g < T[h].length; g++) { var W = T[h][g].trace.legendgrouptitle; if (W && W.text) { N = W, r && (W.font = t._groupTitleFont); break; } } if (i && T[h].reverse(), N) { var J = !1; for (g = 0; g < T[h].length; g++) if (eT.traceIs(T[h][g].trace, "pie-like")) { J = !0; break; } T[h].unshift({ i: -1, groupTitle: N, noClick: J, trace: { showlegend: P.showlegend, legendgroup: P.legendgroup, visible: t.groupclick === "toggleitem" ? !0 : P.visible } }); } for (g = 0; g < T[h].length; g++) T[h][g] = [ T[h][g] ]; } return t._lgroupsLength = T.length, t._maxNameLength = f, T; }, kx = {}; (function(e) { var t = Ue; function n(r) { return r.indexOf("e") !== -1 ? r.replace(/[.]?0+e/, "e") : r.indexOf(".") !== -1 ? r.replace(/[.]?0+$/, "") : r; } e.formatPiePercent = function(r, a) { var i = n((r * 100).toPrecision(3)); return t.numSeparate(i, a) + "%"; }, e.formatPieValue = function(r, a) { var i = n(r.toPrecision(10)); return t.numSeparate(i, a); }, e.getFirstFilled = function(r, a) { if (t.isArrayOrTypedArray(r)) for (var i = 0; i < a.length; i++) { var o = r[a[i]]; if (o || o === 0 || o === "") return o; } }, e.castOption = function(r, a) { if (t.isArrayOrTypedArray(r)) return e.getFirstFilled(r, a); if (r) return r; }, e.getRotationAngle = function(r) { return (r === "auto" ? 0 : r) * Math.PI / 180; }; })(kx); var sK = Cn, cK = rn, uK = function(e, t, n, r) { var a = n.marker.pattern; a && a.shape ? sK.pointStyle(e, n, r, t) : cK.fill(e, t.color); }, tT = rn, nT = kx.castOption, dK = uK, fK = function(e, t, n, r) { var a = n.marker.line, i = nT(a.color, t.pts) || tT.defaultLine, o = nT(a.width, t.pts) || 0; e.call(dK, t, n, r).style("stroke-width", o).call(tT.stroke, i); }, Pr = sn, _v = Rt, Lr = Ue, rT = Lr.strTranslate, Ur = Cn, Oa = rn, kv = _i.extractOpts, yp = $a, hK = fK, pK = kx.castOption, gK = r6, aT = 12, iT = 5, Dl = 2, vK = 10, js = 5, a6 = function(e, t, n) { var r = t._fullLayout; n || (n = r.legend); var a = n.itemsizing === "constant", i = n.itemwidth, o = (i + gK.itemGap * 2) / 2, l = rT(o, 0), s = function(T, O, M, C) { var I; if (T + 1) I = T; else if (O && O.width > 0) I = O.width; else return 0; return a ? C : Math.min(I, M); }; e.each(function(T) { var O = Pr.select(this), M = Lr.ensureSingle(O, "g", "layers"); M.style("opacity", T[0].trace.opacity); var C = n.valign, I = T[0].lineHeight, j = T[0].height; if (C === "middle" || !I || !j) M.attr("transform", null); else { var P = { top: 1, bottom: -1 }[C], N = P * (0.5 * (I - j + 3)); M.attr("transform", rT(0, N)); } var W = M.selectAll("g.legendfill").data([T]); W.enter().append("g").classed("legendfill", !0); var J = M.selectAll("g.legendlines").data([T]); J.enter().append("g").classed("legendlines", !0); var U = M.selectAll("g.legendsymbols").data([T]); U.enter().append("g").classed("legendsymbols", !0), U.selectAll("g.legendpoints").data([T]).enter().append("g").classed("legendpoints", !0); }).each(k).each(f).each(g).each(h).each(v).each(w).each(b).each(c).each(u).each(y).each(m); function c(T) { var O = oT(T), M = O.showFill, C = O.showLine, I = O.showGradientLine, j = O.showGradientFill, P = O.anyFill, N = O.anyLine, W = T[0], J = W.trace, U, E, z = kv(J), F = z.colorscale, q = z.reversescale, H = function(B) { if (B.size()) if (M) Ur.fillGroupStyle(B, t); else { var G = "legendfill-" + J.uid; Ur.gradient( B, t, G, Tv(q), F, "fill" ); } }, K = function(B) { if (B.size()) { var G = "legendline-" + J.uid; Ur.lineGroupStyle(B), Ur.gradient( B, t, G, Tv(q), F, "stroke" ); } }, Q = yp.hasMarkers(J) || !P ? "M5,0" : ( // with a line leave it slightly below center, to leave room for the // line thickness and because the line is usually more prominent N ? "M5,-2" : "M5,-3" ), re = Pr.select(this), te = re.select(".legendfill").selectAll("path").data(M || j ? [T] : []); if (te.enter().append("path").classed("js-fill", !0), te.exit().remove(), te.attr("d", Q + "h" + i + "v6h-" + i + "z").call(H), C || I) { var X = s(void 0, J.line, vK, iT); E = Lr.minExtend(J, { line: { width: X } }), U = [Lr.minExtend(W, { trace: E })]; } var ce = re.select(".legendlines").selectAll("path").data(C || I ? [U] : []); ce.enter().append("path").classed("js-line", !0), ce.exit().remove(), ce.attr("d", Q + (I ? "l" + i + ",0.0001" : "h" + i)).call(C ? Ur.lineGroupStyle : K); } function u(T) { var O = oT(T), M = O.anyFill, C = O.anyLine, I = O.showLine, j = O.showMarker, P = T[0], N = P.trace, W = !j && !C && !M && yp.hasText(N), J, U; function E(te, X, ce, B) { var G = Lr.nestedProperty(N, te).get(), Z = Lr.isArrayOrTypedArray(G) && X ? X(G) : G; if (a && Z && B !== void 0 && (Z = B), ce) { if (Z < ce[0]) return ce[0]; if (Z > ce[1]) return ce[1]; } return Z; } function z(te) { return P._distinct && P.index && te[P.index] ? te[P.index] : te[0]; } if (j || W || I) { var F = {}, q = {}; if (j) { F.mc = E("marker.color", z), F.mx = E("marker.symbol", z), F.mo = E("marker.opacity", Lr.mean, [0.2, 1]), F.mlc = E("marker.line.color", z), F.mlw = E("marker.line.width", Lr.mean, [0, 5], Dl), q.marker = { sizeref: 1, sizemin: 1, sizemode: "diameter" }; var H = E("marker.size", Lr.mean, [2, 16], aT); F.ms = H, q.marker.size = H; } I && (q.line = { width: E("line.width", z, [0, 10], iT) }), W && (F.tx = "Aa", F.tp = E("textposition", z), F.ts = 10, F.tc = E("textfont.color", z), F.tf = E("textfont.family", z)), J = [Lr.minExtend(P, F)], U = Lr.minExtend(N, q), U.selectedpoints = null, U.texttemplate = null; } var K = Pr.select(this).select("g.legendpoints"), Q = K.selectAll("path.scatterpts").data(j ? J : []); Q.enter().insert("path", ":first-child").classed("scatterpts", !0).attr("transform", l), Q.exit().remove(), Q.call(Ur.pointStyle, U, t), j && (J[0].mrc = 3); var re = K.selectAll("g.pointtext").data(W ? J : []); re.enter().append("g").classed("pointtext", !0).append("text").attr("transform", l), re.exit().remove(), re.selectAll("text").call(Ur.textPointStyle, U, t); } function f(T) { var O = T[0].trace, M = O.type === "waterfall"; if (T[0]._distinct && M) { var C = T[0].trace[T[0].dir].marker; return T[0].mc = C.color, T[0].mlw = C.line.width, T[0].mlc = C.line.color, p(T, this, "waterfall"); } var I = []; O.visible && M && (I = T[0].hasTotals ? [["increasing", "M-6,-6V6H0Z"], ["totals", "M6,6H0L-6,-6H-0Z"], ["decreasing", "M6,6V-6H0Z"]] : [["increasing", "M-6,-6V6H6Z"], ["decreasing", "M6,6V-6H-6Z"]]); var j = Pr.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(I); j.enter().append("path").classed("legendwaterfall", !0).attr("transform", l).style("stroke-miterlimit", 1), j.exit().remove(), j.each(function(P) { var N = Pr.select(this), W = O[P[0]].marker, J = s(void 0, W.line, js, Dl); N.attr("d", P[1]).style("stroke-width", J + "px").call(Oa.fill, W.color), J && N.call(Oa.stroke, W.line.color); }); } function h(T) { p(T, this); } function g(T) { p(T, this, "funnel"); } function p(T, O, M) { var C = T[0].trace, I = C.marker || {}, j = I.line || {}, P = M ? C.visible && C.type === M : _v.traceIs(C, "bar"), N = Pr.select(O).select("g.legendpoints").selectAll("path.legend" + M).data(P ? [T] : []); N.enter().append("path").classed("legend" + M, !0).attr("d", "M6,6H-6V-6H6Z").attr("transform", l), N.exit().remove(), N.each(function(W) { var J = Pr.select(this), U = W[0], E = s(U.mlw, I.line, js, Dl); J.style("stroke-width", E + "px"); var z = U.mcc; if (!n._inHover && "mc" in U) { var F = kv(I), q = F.mid; q === void 0 && (q = (F.max + F.min) / 2), z = Ur.tryColorscale(I, "")(q); } var H = z || U.mc || I.color, K = I.pattern, Q = K && Ur.getPatternAttr(K.shape, 0, ""); if (Q) { var re = Ur.getPatternAttr(K.bgcolor, 0, null), te = Ur.getPatternAttr(K.fgcolor, 0, null), X = K.fgopacity, ce = lT(K.size, 8, 10), B = lT(K.solidity, 0.5, 1), G = "legend-" + C.uid; J.call( Ur.pattern, "legend", t, G, Q, ce, B, z, K.fillmode, re, te, X ); } else J.call(Oa.fill, H); E && Oa.stroke(J, U.mlc || j.color); }); } function v(T) { var O = T[0].trace, M = Pr.select(this).select("g.legendpoints").selectAll("path.legendbox").data(O.visible && _v.traceIs(O, "box-violin") ? [T] : []); M.enter().append("path").classed("legendbox", !0).attr("d", "M6,6H-6V-6H6Z").attr("transform", l), M.exit().remove(), M.each(function() { var C = Pr.select(this); if ((O.boxpoints === "all" || O.points === "all") && Oa.opacity(O.fillcolor) === 0 && Oa.opacity((O.line || {}).color) === 0) { var I = Lr.minExtend(O, { marker: { size: a ? aT : Lr.constrain(O.marker.size, 2, 16), sizeref: 1, sizemin: 1, sizemode: "diameter" } }); M.call(Ur.pointStyle, I, t); } else { var j = s(void 0, O.line, js, Dl); C.style("stroke-width", j + "px").call(Oa.fill, O.fillcolor), j && Oa.stroke(C, O.line.color); } }); } function y(T) { var O = T[0].trace, M = Pr.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(O.visible && O.type === "candlestick" ? [T, T] : []); M.enter().append("path").classed("legendcandle", !0).attr("d", function(C, I) { return I ? "M-15,0H-8M-8,6V-6H8Z" : "M15,0H8M8,-6V6H-8Z"; }).attr("transform", l).style("stroke-miterlimit", 1), M.exit().remove(), M.each(function(C, I) { var j = Pr.select(this), P = O[I ? "increasing" : "decreasing"], N = s(void 0, P.line, js, Dl); j.style("stroke-width", N + "px").call(Oa.fill, P.fillcolor), N && Oa.stroke(j, P.line.color); }); } function m(T) { var O = T[0].trace, M = Pr.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(O.visible && O.type === "ohlc" ? [T, T] : []); M.enter().append("path").classed("legendohlc", !0).attr("d", function(C, I) { return I ? "M-15,0H0M-8,-6V0" : "M15,0H0M8,6V0"; }).attr("transform", l).style("stroke-miterlimit", 1), M.exit().remove(), M.each(function(C, I) { var j = Pr.select(this), P = O[I ? "increasing" : "decreasing"], N = s(void 0, P.line, js, Dl); j.style("fill", "none").call(Ur.dashLine, P.line.dash, N), N && Oa.stroke(j, P.line.color); }); } function b(T) { _(T, this, "pie"); } function w(T) { _(T, this, "funnelarea"); } function _(T, O, M) { var C = T[0], I = C.trace, j = M ? I.visible && I.type === M : _v.traceIs(I, M), P = Pr.select(O).select("g.legendpoints").selectAll("path.legend" + M).data(j ? [T] : []); if (P.enter().append("path").classed("legend" + M, !0).attr("d", "M6,6H-6V-6H6Z").attr("transform", l), P.exit().remove(), P.size()) { var N = I.marker || {}, W = s(pK(N.line.width, C.pts), N.line, js, Dl), J = "pieLike", U = Lr.minExtend(I, { marker: { line: { width: W } } }, J), E = Lr.minExtend(C, { trace: U }, J); hK(P, E, U, t); } } function k(T) { var O = T[0].trace, M, C = []; if (O.visible) switch (O.type) { case "histogram2d": case "heatmap": C = [ ["M-15,-2V4H15V-2Z"] // similar to contour ], M = !0; break; case "choropleth": case "choroplethmapbox": C = [ ["M-6,-6V6H6V-6Z"] ], M = !0; break; case "densitymapbox": C = [ ["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"] ], M = "radial"; break; case "cone": C = [ ["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"], ["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"] ], M = !1; break; case "streamtube": C = [ ["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"], ["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"], ["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"] ], M = !1; break; case "surface": C = [ ["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"], ["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"] ], M = !0; break; case "mesh3d": C = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"] ], M = !1; break; case "volume": C = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6H6L0,6Z"] ], M = !0; break; case "isosurface": C = [ ["M-6,6H0L-6,-6Z"], ["M6,6H0L6,-6Z"], ["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"] ], M = !1; break; } var I = Pr.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(C); I.enter().append("path").classed("legend3dandfriends", !0).attr("transform", l).style("stroke-miterlimit", 1), I.exit().remove(), I.each(function(j, P) { var N = Pr.select(this), W = kv(O), J = W.colorscale, U = W.reversescale, E = function(H) { if (H.size()) { var K = "legendfill-" + O.uid; Ur.gradient( H, t, K, Tv(U, M === "radial"), J, "fill" ); } }, z; if (J) { if (!M) { var F = J.length; z = P === 0 ? J[U ? F - 1 : 0][1] : ( // minimum P === 1 ? J[U ? 0 : F - 1][1] : ( // maximum J[Math.floor((F - 1) / 2)][1] ) ); } } else { var q = O.vertexcolor || O.facecolor || O.color; z = Lr.isArrayOrTypedArray(q) ? q[P] || q[0] : q; } N.attr("d", j[0]), z ? N.call(Oa.fill, z) : N.call(E); }); } }; function Tv(e, t) { var n = t ? "radial" : "horizontal"; return n + (e ? "" : "reversed"); } function oT(e) { var t = e[0].trace, n = t.contours, r = yp.hasLines(t), a = yp.hasMarkers(t), i = t.visible && t.fill && t.fill !== "none", o = !1, l = !1; if (n) { var s = n.coloring; s === "lines" ? o = !0 : r = s === "none" || s === "heatmap" || n.showlines, n.type === "constraint" ? i = n._operation !== "=" : (s === "fill" || s === "heatmap") && (l = !0); } return { showMarker: a, showLine: r, showFill: i, showGradientLine: o, showGradientFill: l, anyLine: r || o, anyFill: i || l }; } function lT(e, t, n) { return e && Lr.isArrayOrTypedArray(e) ? t : e > n ? n : e; } var aa = sn, Jn = Ue, Ly = kr, Xo = Rt, sT = w0, Av = Xi, ar = Cn, Nh = rn, Ql = Ir, cT = oK, ur = r6, Tx = Nr, i6 = Tx.LINE_SPACING, dc = Tx.FROM_TL, uT = Tx.FROM_BR, dT = lK, mK = a6, fT = eu, rc = 1, yK = /^legend[0-9]*$/, o6 = function(e, t) { if (t) hT(e, t); else { var n = e._fullLayout, r = n._legends, a = n._infolayer.selectAll('[class^="legend"]'); a.each(function() { var s = aa.select(this), c = s.attr("class"), u = c.split(" ")[0]; u.match(yK) && r.indexOf(u) === -1 && s.remove(); }); for (var i = 0; i < r.length; i++) { var o = r[i], l = e._fullLayout[o]; hT(e, l); } } }; function xK(e, t, n) { if (!(t.title.side !== "top center" && t.title.side !== "top right")) { var r = t.title.font, a = r.size * i6, i = 0, o = e.node(), l = ar.bBox(o).width; t.title.side === "top center" ? i = 0.5 * (t._width - 2 * n - 2 * ur.titlePad - l) : t.title.side === "top right" && (i = t._width - 2 * n - 2 * ur.titlePad - l), Ql.positionText( e, n + ur.titlePad + i, n + a ); } } function hT(e, t) { var n = t || {}, r = e._fullLayout, a = E0(n), i, o, l = n._inHover; if (l ? (o = n.layer, i = "hover") : (o = r._infolayer, i = a), !!o) { i += r._uid, e._legendMouseDownTime || (e._legendMouseDownTime = 0); var s; if (l) { if (!n.entries) return; s = dT(n.entries, n); } else { for (var c = (e.calcdata || []).slice(), u = r.shapes, f = 0; f < u.length; f++) { var h = u[f]; if (h.showlegend) { var g = { _isShape: !0, _fullInput: h, index: h._index, name: h.name || h.label.text || "shape " + h._index, legend: h.legend, legendgroup: h.legendgroup, legendgrouptitle: h.legendgrouptitle, legendrank: h.legendrank, legendwidth: h.legendwidth, showlegend: h.showlegend, visible: h.visible, opacity: h.opacity, mode: h.type === "line" ? "lines" : "markers", line: h.line, marker: { line: h.line, color: h.fillcolor, size: 12, symbol: h.type === "rect" ? "square" : h.type === "circle" ? "circle" : ( // case of path "hexagon2" ) } }; c.push([{ trace: g }]); } } s = r.showlegend && dT(c, n, r._legends.length > 1); } var p = r.hiddenlabels || []; if (!l && (!r.showlegend || !s.length)) return o.selectAll("." + a).remove(), r._topdefs.select("#" + i).remove(), Ly.autoMargin(e, a); var v = Jn.ensureSingle(o, "g", a, function(M) { l || M.attr("pointer-events", "all"); }), y = Jn.ensureSingleById(r._topdefs, "clipPath", i, function(M) { M.append("rect"); }), m = Jn.ensureSingle(v, "rect", "bg", function(M) { M.attr("shape-rendering", "crispEdges"); }); m.call(Nh.stroke, n.bordercolor).call(Nh.fill, n.bgcolor).style("stroke-width", n.borderwidth + "px"); var b = Jn.ensureSingle(v, "g", "scrollbox"), w = n.title; n._titleWidth = 0, n._titleHeight = 0; var _; w.text ? (_ = Jn.ensureSingle(b, "text", a + "titletext"), _.attr("text-anchor", "start").call(ar.font, w.font).text(w.text), Bh(_, b, e, n, rc)) : b.selectAll("." + a + "titletext").remove(); var k = Jn.ensureSingle(v, "rect", "scrollbar", function(M) { M.attr(ur.scrollBarEnterAttrs).call(Nh.fill, ur.scrollBarColor); }), T = b.selectAll("g.groups").data(s); T.enter().append("g").attr("class", "groups"), T.exit().remove(); var O = T.selectAll("g.traces").data(Jn.identity); O.enter().append("g").attr("class", "traces"), O.exit().remove(), O.style("opacity", function(M) { var C = M[0].trace; return Xo.traceIs(C, "pie-like") ? p.indexOf(M[0].label) !== -1 ? 0.5 : 1 : C.visible === "legendonly" ? 0.5 : 1; }).each(function() { aa.select(this).call(bK, e, n); }).call(mK, e, n).each(function() { l || aa.select(this).call(wK, e, a); }), Jn.syncOrAsync([ Ly.previousPromises, function() { return TK(e, T, O, n); }, function() { var M = r._size, C = n.borderwidth, I = n.xref === "paper", j = n.yref === "paper"; if (w.text && xK(_, n, C), !l) { var P, N; I ? P = M.l + M.w * n.x - dc[xp(n)] * n._width : P = r.width * n.x - dc[xp(n)] * n._width, j ? N = M.t + M.h * (1 - n.y) - dc[bp(n)] * n._effHeight : N = r.height * (1 - n.y) - dc[bp(n)] * n._effHeight; var W = AK(e, a, P, N); if (W) return; if (r.margin.autoexpand) { var J = P, U = N; P = I ? Jn.constrain(P, 0, r.width - n._width) : J, N = j ? Jn.constrain(N, 0, r.height - n._effHeight) : U, P !== J && Jn.log("Constrain " + a + ".x to make legend fit inside graph"), N !== U && Jn.log("Constrain " + a + ".y to make legend fit inside graph"); } ar.setTranslate(v, P, N); } if (k.on(".drag", null), v.on("wheel", null), l || n._height <= n._maxHeight || e._context.staticPlot) { var E = n._effHeight; l && (E = n._height), m.attr({ width: n._width - C, height: E - C, x: C / 2, y: C / 2 }), ar.setTranslate(b, 0, 0), y.select("rect").attr({ width: n._width - 2 * C, height: E - 2 * C, x: C, y: C }), ar.setClipUrl(b, i, e), ar.setRect(k, 0, 0, 0, 0), delete n._scrollY; } else { var z = Math.max( ur.scrollBarMinHeight, n._effHeight * n._effHeight / n._height ), F = n._effHeight - z - 2 * ur.scrollBarMargin, q = n._height - n._effHeight, H = F / q, K = Math.min(n._scrollY || 0, q); m.attr({ width: n._width - 2 * C + ur.scrollBarWidth + ur.scrollBarMargin, height: n._effHeight - C, x: C / 2, y: C / 2 }), y.select("rect").attr({ width: n._width - 2 * C + ur.scrollBarWidth + ur.scrollBarMargin, height: n._effHeight - 2 * C, x: C, y: C + K }), ar.setClipUrl(b, i, e), Z(K, z, H), v.on("wheel", function() { K = Jn.constrain( n._scrollY + aa.event.deltaY / F * q, 0, q ), Z(K, z, H), K !== 0 && K !== q && aa.event.preventDefault(); }); var Q, re, te, X = function(pe, ye, Oe) { var Be = (Oe - ye) / H + pe; return Jn.constrain(Be, 0, q); }, ce = function(pe, ye, Oe) { var Be = (ye - Oe) / H + pe; return Jn.constrain(Be, 0, q); }, B = aa.behavior.drag().on("dragstart", function() { var pe = aa.event.sourceEvent; pe.type === "touchstart" ? Q = pe.changedTouches[0].clientY : Q = pe.clientY, te = K; }).on("drag", function() { var pe = aa.event.sourceEvent; pe.buttons === 2 || pe.ctrlKey || (pe.type === "touchmove" ? re = pe.changedTouches[0].clientY : re = pe.clientY, K = X(te, Q, re), Z(K, z, H)); }); k.call(B); var G = aa.behavior.drag().on("dragstart", function() { var pe = aa.event.sourceEvent; pe.type === "touchstart" && (Q = pe.changedTouches[0].clientY, te = K); }).on("drag", function() { var pe = aa.event.sourceEvent; pe.type === "touchmove" && (re = pe.changedTouches[0].clientY, K = ce(te, Q, re), Z(K, z, H)); }); b.call(G); } function Z(pe, ye, Oe) { n._scrollY = e._fullLayout[a]._scrollY = pe, ar.setTranslate(b, 0, -pe), ar.setRect( k, n._width, ur.scrollBarMargin + pe * Oe, ur.scrollBarWidth, ye ), y.select("rect").attr("y", C + pe); } if (e._context.edits.legendPosition) { var oe, ae, ge, ve; v.classed("cursor-move", !0), Av.init({ element: v.node(), gd: e, prepFn: function() { var pe = ar.getTranslate(v); ge = pe.x, ve = pe.y; }, moveFn: function(pe, ye) { var Oe = ge + pe, Be = ve + ye; ar.setTranslate(v, Oe, Be), oe = Av.align(Oe, n._width, M.l, M.l + M.w, n.xanchor), ae = Av.align(Be + n._height, -n._height, M.t + M.h, M.t, n.yanchor); }, doneFn: function() { if (oe !== void 0 && ae !== void 0) { var pe = {}; pe[a + ".x"] = oe, pe[a + ".y"] = ae, Xo.call("_guiRelayout", e, pe); } }, clickFn: function(pe, ye) { var Oe = o.selectAll("g.traces").filter(function() { var Be = this.getBoundingClientRect(); return ye.clientX >= Be.left && ye.clientX <= Be.right && ye.clientY >= Be.top && ye.clientY <= Be.bottom; }); Oe.size() > 0 && l6(e, v, Oe, pe, ye); } }); } } ], e); } } function th(e, t, n) { var r = e[0], a = r.width, i = t.entrywidthmode, o = r.trace.legendwidth || t.entrywidth; return i === "fraction" ? t._maxWidth * o : n + (o || a); } function l6(e, t, n, r, a) { var i = n.data()[0][0].trace, o = { event: a, node: n.node(), curveNumber: i.index, expandedIndex: i._expandedIndex, data: e.data, layout: e.layout, frames: e._transitionData._frames, config: e._context, fullData: e._fullData, fullLayout: e._fullLayout }; i._group && (o.group = i._group), Xo.traceIs(i, "pie-like") && (o.label = n.datum()[0].label); var l = sT.triggerHandler(e, "plotly_legendclick", o); if (r === 1) { if (l === !1) return; t._clickTimeout = setTimeout(function() { e._fullLayout && cT(n, e, r); }, e._context.doubleClickDelay); } else if (r === 2) { t._clickTimeout && clearTimeout(t._clickTimeout), e._legendMouseDownTime = 0; var s = sT.triggerHandler(e, "plotly_legenddoubleclick", o); s !== !1 && l !== !1 && cT(n, e, r); } } function bK(e, t, n) { var r = E0(n), a = e.data()[0][0], i = a.trace, o = Xo.traceIs(i, "pie-like"), l = !n._inHover && t._context.edits.legendText && !o, s = n._maxNameLength, c, u; a.groupTitle ? (c = a.groupTitle.text, u = a.groupTitle.font) : (u = n.font, n.entries ? c = a.text : (c = o ? a.label : i.name, i._meta && (c = Jn.templateString(c, i._meta)))); var f = Jn.ensureSingle(e, "text", r + "text"); f.attr("text-anchor", "start").call(ar.font, u).text(l ? pT(c, s) : c); var h = n.itemwidth + ur.itemGap * 2; Ql.positionText(f, h, 0), l ? f.call(Ql.makeEditable, { gd: t, text: c }).call(Bh, e, t, n).on("edit", function(g) { this.text(pT(g, s)).call(Bh, e, t, n); var p = a.trace._fullInput || {}, v = {}; if (Xo.hasTransform(p, "groupby")) { var y = Xo.getTransformIndices(p, "groupby"), m = y[y.length - 1], b = Jn.keyedContainer(p, "transforms[" + m + "].styles", "target", "value.name"); b.set(a.trace._group, g), v = b.constructUpdate(); } else v.name = g; return p._isShape ? Xo.call("_guiRelayout", t, "shapes[" + i.index + "].name", v.name) : Xo.call("_guiRestyle", t, v, i.index); }) : Bh(f, e, t, n); } function pT(e, t) { var n = Math.max(4, t); if (e && e.trim().length >= n / 2) return e; e = e || ""; for (var r = n - e.length; r > 0; r--) e += " "; return e; } function wK(e, t, n) { var r = t._context.doubleClickDelay, a, i = 1, o = Jn.ensureSingle(e, "rect", n + "toggle", function(l) { t._context.staticPlot || l.style("cursor", "pointer").attr("pointer-events", "all"), l.call(Nh.fill, "rgba(0,0,0,0)"); }); t._context.staticPlot || (o.on("mousedown", function() { a = (/* @__PURE__ */ new Date()).getTime(), a - t._legendMouseDownTime < r ? i += 1 : (i = 1, t._legendMouseDownTime = a); }), o.on("mouseup", function() { if (!(t._dragged || t._editing)) { var l = t._fullLayout[n]; (/* @__PURE__ */ new Date()).getTime() - t._legendMouseDownTime > r && (i = Math.max(i - 1, 1)), l6(t, l, e, i, aa.event); } })); } function Bh(e, t, n, r, a) { r._inHover && e.attr("data-notex", !0), Ql.convertToTspans(e, n, function() { _K(t, n, r, a); }); } function _K(e, t, n, r) { var a = e.data()[0][0]; if (!n._inHover && a && !a.trace.showlegend) { e.remove(); return; } var i = e.select("g[class*=math-group]"), o = i.node(), l = E0(n); n || (n = t._fullLayout[l]); var s = n.borderwidth, c; r === rc ? c = n.title.font : a.groupTitle ? c = a.groupTitle.font : c = n.font; var u = c.size * i6, f, h; if (o) { var g = ar.bBox(o); f = g.height, h = g.width, r === rc ? ar.setTranslate(i, s, s + f * 0.75) : ar.setTranslate(i, 0, f * 0.25); } else { var p = "." + l + (r === rc ? "title" : "") + "text", v = e.select(p), y = Ql.lineCount(v), m = v.node(); if (f = u * y, h = m ? ar.bBox(m).width : 0, r === rc) n.title.side === "left" && (h += ur.itemGap * 2), Ql.positionText( v, s + ur.titlePad, s + u ); else { var b = ur.itemGap * 2 + n.itemwidth; a.groupTitle && (b = ur.itemGap, h -= n.itemwidth), Ql.positionText( v, b, -u * ((y - 1) / 2 - 0.3) ); } } r === rc ? (n._titleWidth = h, n._titleHeight = f) : (a.lineHeight = u, a.height = Math.max(f, 16) + 3, a.width = h); } function kK(e) { var t = 0, n = 0, r = e.title.side; return r && (r.indexOf("left") !== -1 && (t = e._titleWidth), r.indexOf("top") !== -1 && (n = e._titleHeight)), [t, n]; } function TK(e, t, n, r) { var a = e._fullLayout, i = E0(r); r || (r = a[i]); var o = a._size, l = fT.isVertical(r), s = fT.isGrouped(r), c = r.entrywidthmode === "fraction", u = r.borderwidth, f = 2 * u, h = ur.itemGap, g = r.itemwidth + h * 2, p = 2 * (u + h), v = bp(r), y = r.y < 0 || r.y === 0 && v === "top", m = r.y > 1 || r.y === 1 && v === "bottom", b = r.tracegroupgap, w = {}; r._maxHeight = Math.max( y || m ? a.height / 2 : o.h, 30 ); var _ = 0; r._width = 0, r._height = 0; var k = kK(r); if (l) n.each(function(te) { var X = te[0].height; ar.setTranslate( this, u + k[0], u + k[1] + r._height + X / 2 + h ), r._height += X, r._width = Math.max(r._width, te[0].width); }), _ = g + r._width, r._width += h + g + f, r._height += p, s && (t.each(function(te, X) { ar.setTranslate(this, 0, X * r.tracegroupgap); }), r._height += (r._lgroupsLength - 1) * r.tracegroupgap); else { var T = xp(r), O = r.x < 0 || r.x === 0 && T === "right", M = r.x > 1 || r.x === 1 && T === "left", C = m || y, I = a.width / 2; r._maxWidth = Math.max( O ? C && T === "left" ? o.l + o.w : I : M ? C && T === "right" ? o.r + o.w : I : o.w, 2 * g ); var j = 0, P = 0; n.each(function(te) { var X = th(te, r, g); j = Math.max(j, X), P += X; }), _ = null; var N = 0; if (s) { var W = 0, J = 0, U = 0; t.each(function() { var te = 0, X = 0; aa.select(this).selectAll("g.traces").each(function(B) { var G = th(B, r, g), Z = B[0].height; ar.setTranslate( this, k[0], k[1] + u + h + Z / 2 + X ), X += Z, te = Math.max(te, G), w[B[0].trace.legendgroup] = te; }); var ce = te + h; J > 0 && // goes beyound limit ce + u + J > r._maxWidth ? (N = Math.max(N, J), J = 0, U += W + b, W = X) : W = Math.max(W, X), ar.setTranslate(this, J, U), J += ce; }), r._width = Math.max(N, J) + u, r._height = U + W + p; } else { var E = n.size(), z = P + f + (E - 1) * h < r._maxWidth, F = 0, q = 0, H = 0, K = 0; n.each(function(te) { var X = te[0].height, ce = th(te, r, g), B = z ? ce : j; c || (B += h), B + u + q - h >= r._maxWidth && (N = Math.max(N, K), q = 0, H += F, r._height += F, F = 0), ar.setTranslate( this, k[0] + u + q, k[1] + u + H + X / 2 + h ), K = q + ce + h, q += B, F = Math.max(F, X); }), z ? (r._width = q + f, r._height = F + p) : (r._width = Math.max(N, K) + f, r._height += F + p); } } r._width = Math.ceil( Math.max( r._width + k[0], r._titleWidth + 2 * (u + ur.titlePad) ) ), r._height = Math.ceil( Math.max( r._height + k[1], r._titleHeight + 2 * (u + ur.itemGap) ) ), r._effHeight = Math.min(r._height, r._maxHeight); var Q = e._context.edits, re = Q.legendText || Q.legendPosition; n.each(function(te) { var X = aa.select(this).select("." + i + "toggle"), ce = te[0].height, B = te[0].trace.legendgroup, G = th(te, r, g); s && B !== "" && (G = w[B]); var Z = re ? g : _ || G; !l && !c && (Z += h / 2), ar.setRect(X, 0, -ce / 2, Z, ce); }); } function AK(e, t, n, r) { var a = e._fullLayout, i = a[t], o = xp(i), l = bp(i), s = i.xref === "paper", c = i.yref === "paper"; e._fullLayout._reservedMargin[t] = {}; var u = i.y < 0.5 ? "b" : "t", f = i.x < 0.5 ? "l" : "r", h = { r: a.width - n, l: n + i._width, b: a.height - r, t: r + i._effHeight }; if (s && c) return Ly.autoMargin(e, t, { x: i.x, y: i.y, l: i._width * dc[o], r: i._width * uT[o], b: i._effHeight * uT[l], t: i._effHeight * dc[l] }); s ? e._fullLayout._reservedMargin[t][u] = h[u] : c || i.orientation === "v" ? e._fullLayout._reservedMargin[t][f] = h[f] : e._fullLayout._reservedMargin[t][u] = h[u]; } function xp(e) { return Jn.isRightAnchor(e) ? "right" : Jn.isCenterAnchor(e) ? "center" : "left"; } function bp(e) { return Jn.isBottomAnchor(e) ? "bottom" : Jn.isMiddleAnchor(e) ? "middle" : "top"; } function E0(e) { return e._id || "legend"; } var Hl = sn, so = cn, gT = xi, Qn = Ue, Mv = Qn.strTranslate, MK = Qn.strRotate, SK = w0, Ia = Ir, CK = Q$, Ei = Cn, gr = rn, nh = Xi, $o = Ln, Ic = Rt, ii = Oo, ss = s0, LK = n6, OK = o6, s6 = ss.YANGLE, Ax = Math.PI * s6 / 180, DK = 1 / Math.sin(Ax), FK = Math.cos(Ax), IK = Math.sin(Ax), bn = ss.HOVERARROWSIZE, nn = ss.HOVERTEXTPAD, vT = { box: !0, ohlc: !0, violin: !0, candlestick: !0 }, zK = { scatter: !0, scattergl: !0, splom: !0 }; z0.hover = function(e, t, n, r) { e = Qn.getGraphDiv(e); var a = t.target; Qn.throttle( e._fullLayout._uid + ss.HOVERID, ss.HOVERMINTIME, function() { EK(e, t, n, r, a); } ); }; z0.loneHover = function(e, t) { var n = !0; Array.isArray(e) || (n = !1, e = [e]); var r = t.gd, a = h6(r), i = p6(r), o = e.map(function(v) { var y = v._x0 || v.x0 || v.x || 0, m = v._x1 || v.x1 || v.x || 0, b = v._y0 || v.y0 || v.y || 0, w = v._y1 || v.y1 || v.y || 0, _ = v.eventData; if (_) { var k = Math.min(y, m), T = Math.max(y, m), O = Math.min(b, w), M = Math.max(b, w), C = v.trace; if (Ic.traceIs(C, "gl3d")) { var I = r._fullLayout[C.scene]._scene.container, j = I.offsetLeft, P = I.offsetTop; k += j, T += j, O += P, M += P; } _.bbox = { x0: k + i, x1: T + i, y0: O + a, y1: M + a }, t.inOut_bbox && t.inOut_bbox.push(_.bbox); } else _ = !1; return { color: v.color || gr.defaultLine, x0: v.x0 || v.x || 0, x1: v.x1 || v.x || 0, y0: v.y0 || v.y || 0, y1: v.y1 || v.y || 0, xLabel: v.xLabel, yLabel: v.yLabel, zLabel: v.zLabel, text: v.text, name: v.name, idealAlign: v.idealAlign, // optional extra bits of styling borderColor: v.borderColor, fontFamily: v.fontFamily, fontSize: v.fontSize, fontColor: v.fontColor, nameLength: v.nameLength, textAlign: v.textAlign, // filler to make createHoverText happy trace: v.trace || { index: 0, hoverinfo: "" }, xa: { _offset: 0 }, ya: { _offset: 0 }, index: 0, hovertemplate: v.hovertemplate || !1, hovertemplateLabels: v.hovertemplateLabels || !1, eventData: _ }; }), l = !1, s = u6(o, { gd: r, hovermode: "closest", rotateLabels: l, bgColor: t.bgColor || gr.background, container: Hl.select(t.container), outerContainer: t.outerContainer || t.container }), c = s.hoverLabels, u = 5, f = 0, h = 0; c.sort(function(v, y) { return v.y0 - y.y0; }).each(function(v, y) { var m = v.y0 - v.by / 2; m - u < f ? v.offset = f - m + u : v.offset = 0, f = m + v.by + v.offset, y === t.anchorIndex && (h = v.offset); }).each(function(v) { v.offset -= h; }); var g = r._fullLayout._invScaleX, p = r._fullLayout._invScaleY; return f6(c, l, g, p), n ? c : c.node(); }; function EK(e, t, n, r, a) { n || (n = "xy"); var i = Array.isArray(n) ? n : [n], o = e._fullLayout, l = o._plots || [], s = l[n], c = o._has("cartesian"); if (s) { var u = s.overlays.map(function(ie) { return ie.id; }); i = i.concat(u); } for (var f = i.length, h = new Array(f), g = new Array(f), p = !1, v = 0; v < f; v++) { var y = i[v]; if (l[y]) p = !0, h[v] = l[y].xaxis, g[v] = l[y].yaxis; else if (o[y] && o[y]._subplot) { var m = o[y]._subplot; h[v] = m.xaxis, g[v] = m.yaxis; } else { Qn.warn("Unrecognized subplot: " + y); return; } } var b = t.hovermode || o.hovermode; if (b && !p && (b = "closest"), ["x", "y", "closest", "x unified", "y unified"].indexOf(b) === -1 || !e.calcdata || e.querySelector(".zoombox") || e._dragging) return nh.unhoverRaw(e, t); var w = o.hoverdistance; w === -1 && (w = 1 / 0); var _ = o.spikedistance; _ === -1 && (_ = 1 / 0); var k = [], T = [], O, M, C, I, j, P, N, W, J, U, E, z, F, q = { hLinePoint: null, vLinePoint: null }, H = !1; if (Array.isArray(t)) for (b = "array", C = 0; C < t.length; C++) j = e.calcdata[t[C].curveNumber || 0], j && (P = j[0].trace, j[0].trace.hoverinfo !== "skip" && (T.push(j), P.orientation === "h" && (H = !0))); else { for (I = 0; I < e.calcdata.length; I++) j = e.calcdata[I], P = j[0].trace, P.hoverinfo !== "skip" && ii.isTraceInSubplots(P, i) && (T.push(j), P.orientation === "h" && (H = !0)); var K = !a, Q, re; if (K) "xpx" in t ? Q = t.xpx : Q = h[0]._length / 2, "ypx" in t ? re = t.ypx : re = g[0]._length / 2; else { if (SK.triggerHandler(e, "plotly_beforehover", t) === !1) return; var te = a.getBoundingClientRect(); Q = t.clientX - te.left, re = t.clientY - te.top, o._calcInverseTransform(e); var X = Qn.apply3DTransform(o._invTransform)(Q, re); if (Q = X[0], re = X[1], Q < 0 || Q > h[0]._length || re < 0 || re > g[0]._length) return nh.unhoverRaw(e, t); } if (t.pointerX = Q + h[0]._offset, t.pointerY = re + g[0]._offset, "xval" in t ? O = ii.flat(i, t.xval) : O = ii.p2c(h, Q), "yval" in t ? M = ii.flat(i, t.yval) : M = ii.p2c(g, re), !so(O[0]) || !so(M[0])) return Qn.warn("Fx.hover failed", t, e), nh.unhoverRaw(e, t); } var ce = 1 / 0; function B(ie, de) { for (I = 0; I < T.length; I++) if (j = T[I], !(!j || !j[0] || !j[0].trace) && (P = j[0].trace, !(P.visible !== !0 || P._length === 0) && ["carpet", "contourcarpet"].indexOf(P._module.name) === -1)) { if (P.type === "splom" ? (W = 0, N = i[W]) : (N = ii.getSubplot(P), W = i.indexOf(N)), J = b, ii.isUnifiedHover(J) && (J = J.charAt(0)), z = { // trace properties cd: j, trace: P, xa: h[W], ya: g[W], // max distances for hover and spikes - for points that want to show but do not // want to override other points, set distance/spikeDistance equal to max*Distance // and it will not get filtered out but it will be guaranteed to have a greater // distance than any point that calculated a real distance. maxHoverDistance: w, maxSpikeDistance: _, // point properties - override all of these index: !1, // point index in trace - only used by plotly.js hoverdata consumers distance: Math.min(ce, w), // pixel distance or pseudo-distance // distance/pseudo-distance for spikes. This distance should always be calculated // as if in "closest" mode, and should only be set if this point should // generate a spike. spikeDistance: 1 / 0, // in some cases the spikes have different positioning from the hover label // they don't need x0/x1, just one position xSpike: void 0, ySpike: void 0, // where and how to display the hover label color: gr.defaultLine, // trace color name: P.name, x0: void 0, x1: void 0, y0: void 0, y1: void 0, xLabelVal: void 0, yLabelVal: void 0, zLabelVal: void 0, text: void 0 }, o[N] && (z.subplot = o[N]._subplot), o._splomScenes && o._splomScenes[P.uid] && (z.scene = o._splomScenes[P.uid]), F = k.length, J === "array") { var Te = t[I]; "pointNumber" in Te ? (z.index = Te.pointNumber, J = "closest") : (J = "", "xval" in Te && (U = Te.xval, J = "x"), "yval" in Te && (E = Te.yval, J = J ? "closest" : "y")); } else ie !== void 0 && de !== void 0 ? (U = ie, E = de) : (U = O[W], E = M[W]); if (w !== 0) if (P._module && P._module.hoverPoints) { var xe = P._module.hoverPoints(z, U, E, J, { finiteRange: !0, hoverLayer: o._hoverlayer }); if (xe) for (var Ge, qe = 0; qe < xe.length; qe++) Ge = xe[qe], so(Ge.x0) && so(Ge.y0) && k.push(NK(Ge, b)); } else Qn.log("Unrecognized trace type in hover:", P); if (b === "closest" && k.length > F && (k.splice(0, F), ce = k[0].distance), c && _ !== 0 && k.length === 0) { z.distance = _, z.index = !1; var De = P._module.hoverPoints(z, U, E, "closest", { hoverLayer: o._hoverlayer }); if (De && (De = De.filter(function(zt) { return zt.spikeDistance <= _; })), De && De.length) { var le, Se = De.filter(function(zt) { return zt.xa.showspikes && zt.xa.spikesnap !== "hovered data"; }); if (Se.length) { var He = Se[0]; so(He.x0) && so(He.y0) && (le = Z(He), (!q.vLinePoint || q.vLinePoint.spikeDistance > le.spikeDistance) && (q.vLinePoint = le)); } var Je = De.filter(function(zt) { return zt.ya.showspikes && zt.ya.spikesnap !== "hovered data"; }); if (Je.length) { var Dt = Je[0]; so(Dt.x0) && so(Dt.y0) && (le = Z(Dt), (!q.hLinePoint || q.hLinePoint.spikeDistance > le.spikeDistance) && (q.hLinePoint = le)); } } } } } B(); function G(ie, de, Te) { for (var xe = null, Ge = 1 / 0, qe, De = 0; De < ie.length; De++) qe = ie[De].spikeDistance, Te && De === 0 && (qe = -1 / 0), qe <= Ge && qe <= de && (xe = ie[De], Ge = qe); return xe; } function Z(ie) { return ie ? { xa: ie.xa, ya: ie.ya, x: ie.xSpike !== void 0 ? ie.xSpike : (ie.x0 + ie.x1) / 2, y: ie.ySpike !== void 0 ? ie.ySpike : (ie.y0 + ie.y1) / 2, distance: ie.distance, spikeDistance: ie.spikeDistance, curveNumber: ie.trace.index, color: ie.color, pointNumber: ie.index } : null; } var oe = { fullLayout: o, container: o._hoverlayer, event: t }; e._spikepoints; var ae = { vLinePoint: q.vLinePoint, hLinePoint: q.hLinePoint }; e._spikepoints = ae; var ge = function() { k.sort(function(ie, de) { return ie.distance - de.distance; }), k = HK(k, b); }; ge(); var ve = b.charAt(0), pe = (ve === "x" || ve === "y") && k[0] && zK[k[0].trace.type]; if (c && _ !== 0 && k.length !== 0) { var ye = k.filter(function(ie) { return ie.ya.showspikes; }), Oe = G(ye, _, pe); q.hLinePoint = Z(Oe); var Be = k.filter(function(ie) { return ie.xa.showspikes; }), Ie = G(Be, _, pe); q.vLinePoint = Z(Ie); } if (k.length === 0) { var Fe = nh.unhoverRaw(e, t); return c && (q.hLinePoint !== null || q.vLinePoint !== null) && xT() && yT(e, q, oe), Fe; } if (c && xT() && yT(e, q, oe), ii.isXYhover(J) && k[0].length !== 0 && k[0].trace.type !== "splom") { var Re = k[0]; vT[Re.trace.type] ? k = k.filter(function(ie) { return ie.trace.index === Re.trace.index; }) : k = [Re]; var We = k.length, Ce = wT("x", Re, o), Ve = wT("y", Re, o); B(Ce, Ve); var Ke = [], Xe = {}, ct = 0, vt = function(ie) { var de = vT[ie.trace.type] ? c6(ie) : ie.trace.index; if (!Xe[de]) ct++, Xe[de] = ct, Ke.push(ie); else { var Te = Xe[de] - 1, xe = Ke[Te]; Te > 0 && Math.abs(ie.distance) < Math.abs(xe.distance) && (Ke[Te] = ie); } }, lt; for (lt = 0; lt < We; lt++) vt(k[lt]); for (lt = k.length - 1; lt > We - 1; lt--) vt(k[lt]); k = Ke, ge(); } var ut = e._hoverdata, dt = [], Pe = h6(e), ze = p6(e); for (C = 0; C < k.length; C++) { var Ne = k[C], nt = ii.makeEventData(Ne, Ne.trace, Ne.cd); if (Ne.hovertemplate !== !1) { var Qe = !1; Ne.cd[Ne.index] && Ne.cd[Ne.index].ht && (Qe = Ne.cd[Ne.index].ht), Ne.hovertemplate = Qe || Ne.trace.hovertemplate || !1; } if (Ne.xa && Ne.ya) { var it = Ne.x0 + Ne.xa._offset, rt = Ne.x1 + Ne.xa._offset, bt = Ne.y0 + Ne.ya._offset, je = Ne.y1 + Ne.ya._offset, tt = Math.min(it, rt), pt = Math.max(it, rt), kt = Math.min(bt, je), et = Math.max(bt, je); nt.bbox = { x0: tt + ze, x1: pt + ze, y0: kt + Pe, y1: et + Pe }; } Ne.eventData = [nt], dt.push(nt); } e._hoverdata = dt; var ft = b === "y" && (T.length > 1 || k.length > 1) || b === "closest" && H && k.length > 1, $e = gr.combine( o.plot_bgcolor || gr.background, o.paper_bgcolor ), Lt = u6(k, { gd: e, hovermode: b, rotateLabels: ft, bgColor: $e, container: o._hoverlayer, outerContainer: o._paper.node(), commonLabelOpts: o.hoverlabel, hoverdistance: o.hoverdistance }), $ = Lt.hoverLabels; if (ii.isUnifiedHover(b) || (PK($, ft, o, Lt.commonLabelBoundingBox), f6($, ft, o._invScaleX, o._invScaleY)), a && a.tagName) { var se = Ic.getComponentMethod("annotations", "hasClickToShow")(e, dt); CK(Hl.select(a), se ? "pointer" : ""); } !a || r || !BK(e, t, ut) || (ut && e.emit("plotly_unhover", { event: t, points: ut }), e.emit("plotly_hover", { event: t, points: e._hoverdata, xaxes: h, yaxes: g, xvals: O, yvals: M })); } function c6(e) { return [e.trace.index, e.index, e.x0, e.y0, e.name, e.attr, e.xa ? e.xa._id : "", e.ya ? e.ya._id : ""].join(","); } var jK = /([\s\S]*)<\/extra>/; function u6(e, t) { var n = t.gd, r = n._fullLayout, a = t.hovermode, i = t.rotateLabels, o = t.bgColor, l = t.container, s = t.outerContainer, c = t.commonLabelOpts || {}; if (e.length === 0) return [[]]; var u = t.fontFamily || ss.HOVERFONT, f = t.fontSize || ss.HOVERFONTSIZE, h = e[0], g = h.xa, p = h.ya, v = a.charAt(0), y = v + "Label", m = h[y]; if (m === void 0 && g.type === "multicategory") for (var b = 0; b < e.length && (m = e[b][y], m === void 0); b++) ; var w = Ps(n, s), _ = w.top, k = w.width, T = w.height, O = m !== void 0 && h.distance <= t.hoverdistance && (a === "x" || a === "y"); if (O) { var M = !0, C, I; for (C = 0; C < e.length; C++) if (M && e[C].zLabel === void 0 && (M = !1), I = e[C].hoverinfo || e[C].trace.hoverinfo, I) { var j = Array.isArray(I) ? I : I.split("+"); if (j.indexOf("all") === -1 && j.indexOf(a) === -1) { O = !1; break; } } M && (O = !1); } var P = l.selectAll("g.axistext").data(O ? [0] : []); P.enter().append("g").classed("axistext", !0), P.exit().remove(); var N = { minX: 0, maxX: 0, minY: 0, maxY: 0 }; if (P.each(function() { var Ce = Hl.select(this), Ve = Qn.ensureSingle(Ce, "path", "", function(et) { et.style({ "stroke-width": "1px" }); }), Ke = Qn.ensureSingle(Ce, "text", "", function(et) { et.attr("data-notex", 1); }), Xe = c.bgcolor || gr.defaultLine, ct = c.bordercolor || gr.contrast(Xe), vt = gr.contrast(Xe), lt = { family: c.font.family || u, size: c.font.size || f, color: c.font.color || vt }; Ve.style({ fill: Xe, stroke: ct }), Ke.text(m).call(Ei.font, lt).call(Ia.positionText, 0, 0).call(Ia.convertToTspans, n), Ce.attr("transform", ""); var ut = Ps(n, Ke.node()), dt, Pe; if (a === "x") { var ze = g.side === "top" ? "-" : ""; Ke.attr("text-anchor", "middle").call(Ia.positionText, 0, g.side === "top" ? _ - ut.bottom - bn - nn : _ - ut.top + bn + nn), dt = g._offset + (h.x0 + h.x1) / 2, Pe = p._offset + (g.side === "top" ? 0 : p._length); var Ne = ut.width / 2 + nn; dt < Ne ? (dt = Ne, Ve.attr("d", "M-" + (Ne - bn) + ",0L-" + (Ne - bn * 2) + "," + ze + bn + "H" + Ne + "v" + ze + (nn * 2 + ut.height) + "H-" + Ne + "V" + ze + bn + "Z")) : dt > r.width - Ne ? (dt = r.width - Ne, Ve.attr("d", "M" + (Ne - bn) + ",0L" + Ne + "," + ze + bn + "v" + ze + (nn * 2 + ut.height) + "H-" + Ne + "V" + ze + bn + "H" + (Ne - bn * 2) + "Z")) : Ve.attr("d", "M0,0L" + bn + "," + ze + bn + "H" + Ne + "v" + ze + (nn * 2 + ut.height) + "H-" + Ne + "V" + ze + bn + "H-" + bn + "Z"), N.minX = dt - Ne, N.maxX = dt + Ne, g.side === "top" ? (N.minY = Pe - (nn * 2 + ut.height), N.maxY = Pe - nn) : (N.minY = Pe + nn, N.maxY = Pe + (nn * 2 + ut.height)); } else { var nt, Qe, it; p.side === "right" ? (nt = "start", Qe = 1, it = "", dt = g._offset + g._length) : (nt = "end", Qe = -1, it = "-", dt = g._offset), Pe = p._offset + (h.y0 + h.y1) / 2, Ke.attr("text-anchor", nt), Ve.attr("d", "M0,0L" + it + bn + "," + bn + "V" + (nn + ut.height / 2) + "h" + it + (nn * 2 + ut.width) + "V-" + (nn + ut.height / 2) + "H" + it + bn + "V-" + bn + "Z"), N.minY = Pe - (nn + ut.height / 2), N.maxY = Pe + (nn + ut.height / 2), p.side === "right" ? (N.minX = dt + bn, N.maxX = dt + bn + (nn * 2 + ut.width)) : (N.minX = dt - bn - (nn * 2 + ut.width), N.maxX = dt - bn); var rt = ut.height / 2, bt = _ - ut.top - rt, je = "clip" + r._uid + "commonlabel" + p._id, tt; if (dt < ut.width + 2 * nn + bn) { tt = "M-" + (bn + nn) + "-" + rt + "h-" + (ut.width - nn) + "V" + rt + "h" + (ut.width - nn) + "Z"; var pt = ut.width - dt + nn; Ia.positionText(Ke, pt, bt), nt === "end" && Ke.selectAll("tspan").each(function() { var et = Hl.select(this), ft = Ei.tester.append("text").text(et.text()).call(Ei.font, lt), $e = Ps(n, ft.node()); Math.round($e.width) < Math.round(ut.width) && et.attr("x", pt - $e.width), ft.remove(); }); } else Ia.positionText(Ke, Qe * (nn + bn), bt), tt = null; var kt = r._topclips.selectAll("#" + je).data(tt ? [0] : []); kt.enter().append("clipPath").attr("id", je).append("path"), kt.exit().remove(), kt.select("path").attr("d", tt), Ei.setClipUrl(Ke, tt ? je : null, n); } Ce.attr("transform", Mv(dt, Pe)); }), ii.isUnifiedHover(a)) { l.selectAll("g.hovertext").remove(); var W = e.filter(function(Ce) { return Ce.hoverinfo !== "none"; }); if (W.length === 0) return []; var J = r.hoverlabel, U = J.font, E = { showlegend: !0, legend: { title: { text: m, font: U }, font: U, bgcolor: J.bgcolor, bordercolor: J.bordercolor, borderwidth: 1, tracegroupgap: 7, traceorder: r.legend ? r.legend.traceorder : void 0, orientation: "v" } }, z = { font: U }; LK(E, z, n._fullData); var F = z.legend; F.entries = []; for (var q = 0; q < W.length; q++) { var H = W[q]; if (H.hoverinfo !== "none") { var K = mT(H, !0, a, r, m), Q = K[0], re = K[1]; H.name = re, re !== "" ? H.text = re + " : " + Q : H.text = Q; var te = H.cd[H.index]; te && (te.mc && (H.mc = te.mc), te.mcc && (H.mc = te.mcc), te.mlc && (H.mlc = te.mlc), te.mlcc && (H.mlc = te.mlcc), te.mlw && (H.mlw = te.mlw), te.mrc && (H.mrc = te.mrc), te.dir && (H.dir = te.dir)), H._distinct = !0, F.entries.push([H]); } } F.entries.sort(function(Ce, Ve) { return Ce[0].trace.index - Ve[0].trace.index; }), F.layer = l, F._inHover = !0, F._groupTitleFont = J.grouptitlefont, OK(n, F); var X = l.select("g.legend"), ce = Ps(n, X.node()), B = ce.width + 2 * nn, G = ce.height + 2 * nn, Z = W[0], oe = (Z.x0 + Z.x1) / 2, ae = (Z.y0 + Z.y1) / 2, ge = !(Ic.traceIs(Z.trace, "bar-like") || Ic.traceIs(Z.trace, "box-violin")), ve, pe; v === "y" ? ge ? (pe = ae - nn, ve = ae + nn) : (pe = Math.min.apply(null, W.map(function(Ce) { return Math.min(Ce.y0, Ce.y1); })), ve = Math.max.apply(null, W.map(function(Ce) { return Math.max(Ce.y0, Ce.y1); }))) : pe = ve = Qn.mean(W.map(function(Ce) { return (Ce.y0 + Ce.y1) / 2; })) - G / 2; var ye, Oe; v === "x" ? ge ? (ye = oe + nn, Oe = oe - nn) : (ye = Math.max.apply(null, W.map(function(Ce) { return Math.max(Ce.x0, Ce.x1); })), Oe = Math.min.apply(null, W.map(function(Ce) { return Math.min(Ce.x0, Ce.x1); }))) : ye = Oe = Qn.mean(W.map(function(Ce) { return (Ce.x0 + Ce.x1) / 2; })) - B / 2; var Be = g._offset, Ie = p._offset; ve += Ie, ye += Be, Oe += Be - B, pe += Ie - G; var Fe, Re; return ye + B < k && ye >= 0 ? Fe = ye : Oe + B < k && Oe >= 0 ? Fe = Oe : Be + B < k ? Fe = Be : ye - oe < oe - Oe + B ? Fe = k - B : Fe = 0, Fe += nn, ve + G < T && ve >= 0 ? Re = ve : pe + G < T && pe >= 0 ? Re = pe : Ie + G < T ? Re = Ie : ve - ae < ae - pe + G ? Re = T - G : Re = 0, Re += nn, X.attr("transform", Mv(Fe - 1, Re - 1)), X; } var We = l.selectAll("g.hovertext").data(e, function(Ce) { return c6(Ce); }); return We.enter().append("g").classed("hovertext", !0).each(function() { var Ce = Hl.select(this); Ce.append("rect").call(gr.fill, gr.addOpacity(o, 0.8)), Ce.append("text").classed("name", !0), Ce.append("path").style("stroke-width", "1px"), Ce.append("text").classed("nums", !0).call(Ei.font, u, f); }), We.exit().remove(), We.each(function(Ce) { var Ve = Hl.select(this).attr("transform", ""), Ke = Ce.color; Array.isArray(Ke) && (Ke = Ke[Ce.eventData[0].pointNumber]); var Xe = Ce.bgcolor || Ke, ct = gr.combine( gr.opacity(Xe) ? Xe : gr.defaultLine, o ), vt = gr.combine( gr.opacity(Ke) ? Ke : gr.defaultLine, o ), lt = Ce.borderColor || gr.contrast(ct), ut = mT(Ce, O, a, r, m, Ve), dt = ut[0], Pe = ut[1], ze = Ve.select("text.nums").call( Ei.font, Ce.fontFamily || u, Ce.fontSize || f, Ce.fontColor || lt ).text(dt).attr("data-notex", 1).call(Ia.positionText, 0, 0).call(Ia.convertToTspans, n), Ne = Ve.select("text.name"), nt = 0, Qe = 0; if (Pe && Pe !== dt) { Ne.call( Ei.font, Ce.fontFamily || u, Ce.fontSize || f, vt ).text(Pe).attr("data-notex", 1).call(Ia.positionText, 0, 0).call(Ia.convertToTspans, n); var it = Ps(n, Ne.node()); nt = it.width + 2 * nn, Qe = it.height + 2 * nn; } else Ne.remove(), Ve.select("rect").remove(); Ve.select("path").style({ fill: ct, stroke: lt }); var rt = Ce.xa._offset + (Ce.x0 + Ce.x1) / 2, bt = Ce.ya._offset + (Ce.y0 + Ce.y1) / 2, je = Math.abs(Ce.x1 - Ce.x0), tt = Math.abs(Ce.y1 - Ce.y0), pt = Ps(n, ze.node()), kt = pt.width / r._invScaleX, et = pt.height / r._invScaleY; Ce.ty0 = (_ - pt.top) / r._invScaleY, Ce.bx = kt + 2 * nn, Ce.by = Math.max(et + 2 * nn, Qe), Ce.anchor = "start", Ce.txwidth = kt, Ce.tx2width = nt, Ce.offset = 0; var ft = (kt + bn + nn + nt) * r._invScaleX, $e, Lt; if (i) Ce.pos = rt, $e = bt + tt / 2 + ft <= T, Lt = bt - tt / 2 - ft >= 0, (Ce.idealAlign === "top" || !$e) && Lt ? (bt -= tt / 2, Ce.anchor = "end") : $e ? (bt += tt / 2, Ce.anchor = "start") : Ce.anchor = "middle", Ce.crossPos = bt; else { if (Ce.pos = bt, $e = rt + je / 2 + ft <= k, Lt = rt - je / 2 - ft >= 0, (Ce.idealAlign === "left" || !$e) && Lt) rt -= je / 2, Ce.anchor = "end"; else if ($e) rt += je / 2, Ce.anchor = "start"; else { Ce.anchor = "middle"; var $ = ft / 2, se = rt + $ - k, ie = rt - $; se > 0 && (rt -= se), ie < 0 && (rt += -ie); } Ce.crossPos = rt; } ze.attr("text-anchor", Ce.anchor), nt && Ne.attr("text-anchor", Ce.anchor), Ve.attr("transform", Mv(rt, bt) + (i ? MK(s6) : "")); }), { hoverLabels: We, commonLabelBoundingBox: N }; } function mT(e, t, n, r, a, i) { var o = "", l = ""; e.nameOverride !== void 0 && (e.name = e.nameOverride), e.name && (e.trace._meta && (e.name = Qn.templateString(e.name, e.trace._meta)), o = bT(e.name, e.nameLength)); var s = n.charAt(0), c = s === "x" ? "y" : "x"; e.zLabel !== void 0 ? (e.xLabel !== void 0 && (l += "x: " + e.xLabel + "
"), e.yLabel !== void 0 && (l += "y: " + e.yLabel + "
"), e.trace.type !== "choropleth" && e.trace.type !== "choroplethmapbox" && (l += (l ? "z: " : "") + e.zLabel)) : t && e[s + "Label"] === a ? l = e[c + "Label"] || "" : e.xLabel === void 0 ? e.yLabel !== void 0 && e.trace.type !== "scattercarpet" && (l = e.yLabel) : e.yLabel === void 0 ? l = e.xLabel : l = "(" + e.xLabel + ", " + e.yLabel + ")", (e.text || e.text === 0) && !Array.isArray(e.text) && (l += (l ? "
" : "") + e.text), e.extraText !== void 0 && (l += (l ? "
" : "") + e.extraText), i && l === "" && !e.hovertemplate && (o === "" && i.remove(), l = o); var u = e.hovertemplate || !1; if (u) { var f = e.hovertemplateLabels || e; e[s + "Label"] !== a && (f[s + "other"] = f[s + "Val"], f[s + "otherLabel"] = f[s + "Label"]), l = Qn.hovertemplateString( u, f, r._d3locale, e.eventData[0] || {}, e.trace._meta ), l = l.replace(jK, function(h, g) { return o = bT(g, e.nameLength), ""; }); } return [l, o]; } function PK(e, t, n, r) { var a = t ? "xa" : "ya", i = t ? "ya" : "xa", o = 0, l = 1, s = e.size(), c = new Array(s), u = 0, f = r.minX, h = r.maxX, g = r.minY, p = r.maxY, v = function(U) { return U * n._invScaleX; }, y = function(U) { return U * n._invScaleY; }; e.each(function(U) { var E = U[a], z = U[i], F = E._id.charAt(0) === "x", q = E.range; u === 0 && q && q[0] > q[1] !== F && (l = -1); var H = 0, K = F ? n.width : n.height; if (n.hovermode === "x" || n.hovermode === "y") { var Q = d6(U, t), re = U.anchor, te = re === "end" ? -1 : 1, X, ce; if (re === "middle") X = U.crossPos + (F ? y(Q.y - U.by / 2) : v(U.bx / 2 + U.tx2width / 2)), ce = X + (F ? y(U.by) : v(U.bx)); else if (F) X = U.crossPos + y(bn + Q.y) - y(U.by / 2 - bn), ce = X + y(U.by); else { var B = v(te * bn + Q.x), G = B + v(te * U.bx); X = U.crossPos + Math.min(B, G), ce = U.crossPos + Math.max(B, G); } F ? g !== void 0 && p !== void 0 && Math.min(ce, p) - Math.max(X, g) > 1 && (z.side === "left" ? (H = z._mainLinePosition, K = n.width) : K = z._mainLinePosition) : f !== void 0 && h !== void 0 && Math.min(ce, h) - Math.max(X, f) > 1 && (z.side === "top" ? (H = z._mainLinePosition, K = n.height) : K = z._mainLinePosition); } c[u++] = [{ datum: U, traceIndex: U.trace.index, dp: 0, pos: U.pos, posref: U.posref, size: U.by * (F ? DK : 1) / 2, pmin: H, pmax: K }]; }), c.sort(function(U, E) { return U[0].posref - E[0].posref || // for equal positions, sort trace indices increasing or decreasing // depending on whether the axis is reversed or not... so stacked // traces will generally keep their order even if one trace adds // nothing to the stack. l * (E[0].traceIndex - U[0].traceIndex); }); var m, b, w, _, k, T, O; function M(U) { var E = U[0], z = U[U.length - 1]; if (b = E.pmin - E.pos - E.dp + E.size, w = z.pos + z.dp + z.size - E.pmax, b > 0.01) { for (k = U.length - 1; k >= 0; k--) U[k].dp += b; m = !1; } if (!(w < 0.01)) { if (b < -0.01) { for (k = U.length - 1; k >= 0; k--) U[k].dp -= w; m = !1; } if (m) { var F = 0; for (_ = 0; _ < U.length; _++) T = U[_], T.pos + T.dp + T.size > E.pmax && F++; for (_ = U.length - 1; _ >= 0 && !(F <= 0); _--) T = U[_], T.pos > E.pmax - 1 && (T.del = !0, F--); for (_ = 0; _ < U.length && !(F <= 0); _++) if (T = U[_], T.pos < E.pmin + 1) for (T.del = !0, F--, w = T.size * 2, k = U.length - 1; k >= 0; k--) U[k].dp -= w; for (_ = U.length - 1; _ >= 0 && !(F <= 0); _--) T = U[_], T.pos + T.dp + T.size > E.pmax && (T.del = !0, F--); } } } for (; !m && o <= s; ) { for (o++, m = !0, _ = 0; _ < c.length - 1; ) { var C = c[_], I = c[_ + 1], j = C[C.length - 1], P = I[0]; if (b = j.pos + j.dp + j.size - P.pos - P.dp + P.size, b > 0.01 && j.pmin === P.pmin && j.pmax === P.pmax) { for (k = I.length - 1; k >= 0; k--) I[k].dp += b; for (C.push.apply(C, I), c.splice(_ + 1, 1), O = 0, k = C.length - 1; k >= 0; k--) O += C[k].dp; for (w = O / C.length, k = C.length - 1; k >= 0; k--) C[k].dp -= w; m = !1; } else _++; } c.forEach(M); } for (_ = c.length - 1; _ >= 0; _--) { var N = c[_]; for (k = N.length - 1; k >= 0; k--) { var W = N[k], J = W.datum; J.offset = W.dp, J.del = W.del; } } } function d6(e, t) { var n = 0, r = e.offset; return t && (r *= -IK, n = e.offset * FK), { x: n, y: r }; } function RK(e) { var t = { start: 1, end: -1, middle: 0 }[e.anchor], n = t * (bn + nn), r = n + t * (e.txwidth + nn), a = e.anchor === "middle"; return a && (n -= e.tx2width / 2, r += e.txwidth / 2 + nn), { alignShift: t, textShiftX: n, text2ShiftX: r }; } function f6(e, t, n, r) { var a = function(o) { return o * n; }, i = function(o) { return o * r; }; e.each(function(o) { var l = Hl.select(this); if (o.del) return l.remove(); var s = l.select("text.nums"), c = o.anchor, u = c === "end" ? -1 : 1, f = RK(o), h = d6(o, t), g = h.x, p = h.y, v = c === "middle"; l.select("path").attr("d", v ? ( // middle aligned: rect centered on data "M-" + a(o.bx / 2 + o.tx2width / 2) + "," + i(p - o.by / 2) + "h" + a(o.bx) + "v" + i(o.by) + "h-" + a(o.bx) + "Z" ) : ( // left or right aligned: side rect with arrow to data "M0,0L" + a(u * bn + g) + "," + i(bn + p) + "v" + i(o.by / 2 - bn) + "h" + a(u * o.bx) + "v-" + i(o.by) + "H" + a(u * bn + g) + "V" + i(p - bn) + "Z" )); var y = g + f.textShiftX, m = p + o.ty0 - o.by / 2 + nn, b = o.textAlign || "auto"; b !== "auto" && (b === "left" && c !== "start" ? (s.attr("text-anchor", "start"), y = v ? -o.bx / 2 - o.tx2width / 2 + nn : -o.bx - nn) : b === "right" && c !== "end" && (s.attr("text-anchor", "end"), y = v ? o.bx / 2 - o.tx2width / 2 - nn : o.bx + nn)), s.call(Ia.positionText, a(y), i(m)), o.tx2width && (l.select("text.name").call( Ia.positionText, a(f.text2ShiftX + f.alignShift * nn + g), i(p + o.ty0 - o.by / 2 + nn) ), l.select("rect").call( Ei.setRect, a(f.text2ShiftX + (f.alignShift - 1) * o.tx2width / 2 + g), i(p - o.by / 2 - 1), a(o.tx2width), i(o.by + 2) )); }); } function NK(e, t) { var n = e.index, r = e.trace || {}, a = e.cd[0], i = e.cd[n] || {}; function o(h) { return h || so(h) && h === 0; } var l = Array.isArray(n) ? function(h, g) { var p = Qn.castOption(a, n, h); return o(p) ? p : Qn.extractOption({}, r, "", g); } : function(h, g) { return Qn.extractOption(i, r, h, g); }; function s(h, g, p) { var v = l(g, p); o(v) && (e[h] = v); } if (s("hoverinfo", "hi", "hoverinfo"), s("bgcolor", "hbg", "hoverlabel.bgcolor"), s("borderColor", "hbc", "hoverlabel.bordercolor"), s("fontFamily", "htf", "hoverlabel.font.family"), s("fontSize", "hts", "hoverlabel.font.size"), s("fontColor", "htc", "hoverlabel.font.color"), s("nameLength", "hnl", "hoverlabel.namelength"), s("textAlign", "hta", "hoverlabel.align"), e.posref = t === "y" || t === "closest" && r.orientation === "h" ? e.xa._offset + (e.x0 + e.x1) / 2 : e.ya._offset + (e.y0 + e.y1) / 2, e.x0 = Qn.constrain(e.x0, 0, e.xa._length), e.x1 = Qn.constrain(e.x1, 0, e.xa._length), e.y0 = Qn.constrain(e.y0, 0, e.ya._length), e.y1 = Qn.constrain(e.y1, 0, e.ya._length), e.xLabelVal !== void 0 && (e.xLabel = "xLabel" in e ? e.xLabel : $o.hoverLabelText(e.xa, e.xLabelVal, r.xhoverformat), e.xVal = e.xa.c2d(e.xLabelVal)), e.yLabelVal !== void 0 && (e.yLabel = "yLabel" in e ? e.yLabel : $o.hoverLabelText(e.ya, e.yLabelVal, r.yhoverformat), e.yVal = e.ya.c2d(e.yLabelVal)), e.zLabelVal !== void 0 && e.zLabel === void 0 && (e.zLabel = String(e.zLabelVal)), !isNaN(e.xerr) && !(e.xa.type === "log" && e.xerr <= 0)) { var c = $o.tickText(e.xa, e.xa.c2l(e.xerr), "hover").text; e.xerrneg !== void 0 ? e.xLabel += " +" + c + " / -" + $o.tickText(e.xa, e.xa.c2l(e.xerrneg), "hover").text : e.xLabel += " ± " + c, t === "x" && (e.distance += 1); } if (!isNaN(e.yerr) && !(e.ya.type === "log" && e.yerr <= 0)) { var u = $o.tickText(e.ya, e.ya.c2l(e.yerr), "hover").text; e.yerrneg !== void 0 ? e.yLabel += " +" + u + " / -" + $o.tickText(e.ya, e.ya.c2l(e.yerrneg), "hover").text : e.yLabel += " ± " + u, t === "y" && (e.distance += 1); } var f = e.hoverinfo || e.trace.hoverinfo; return f && f !== "all" && (f = Array.isArray(f) ? f : f.split("+"), f.indexOf("x") === -1 && (e.xLabel = void 0), f.indexOf("y") === -1 && (e.yLabel = void 0), f.indexOf("z") === -1 && (e.zLabel = void 0), f.indexOf("text") === -1 && (e.text = void 0), f.indexOf("name") === -1 && (e.name = void 0)), e; } function yT(e, t, n) { var r = n.container, a = n.fullLayout, i = a._size, o = n.event, l = !!t.hLinePoint, s = !!t.vLinePoint, c, u; if (r.selectAll(".spikeline").remove(), !!(s || l)) { var f = gr.combine(a.plot_bgcolor, a.paper_bgcolor); if (l) { var h = t.hLinePoint, g, p; c = h && h.xa, u = h && h.ya; var v = u.spikesnap; v === "cursor" ? (g = o.pointerX, p = o.pointerY) : (g = c._offset + h.x, p = u._offset + h.y); var y = gT.readability(h.color, f) < 1.5 ? gr.contrast(f) : h.color, m = u.spikemode, b = u.spikethickness, w = u.spikecolor || y, _ = $o.getPxPosition(e, u), k, T; if (m.indexOf("toaxis") !== -1 || m.indexOf("across") !== -1) { if (m.indexOf("toaxis") !== -1 && (k = _, T = g), m.indexOf("across") !== -1) { var O = u._counterDomainMin, M = u._counterDomainMax; u.anchor === "free" && (O = Math.min(O, u.position), M = Math.max(M, u.position)), k = i.l + O * i.w, T = i.l + M * i.w; } r.insert("line", ":first-child").attr({ x1: k, x2: T, y1: p, y2: p, "stroke-width": b, stroke: w, "stroke-dasharray": Ei.dashStyle(u.spikedash, b) }).classed("spikeline", !0).classed("crisp", !0), r.insert("line", ":first-child").attr({ x1: k, x2: T, y1: p, y2: p, "stroke-width": b + 2, stroke: f }).classed("spikeline", !0).classed("crisp", !0); } m.indexOf("marker") !== -1 && r.insert("circle", ":first-child").attr({ cx: _ + (u.side !== "right" ? b : -b), cy: p, r: b, fill: w }).classed("spikeline", !0); } if (s) { var C = t.vLinePoint, I, j; c = C && C.xa, u = C && C.ya; var P = c.spikesnap; P === "cursor" ? (I = o.pointerX, j = o.pointerY) : (I = c._offset + C.x, j = u._offset + C.y); var N = gT.readability(C.color, f) < 1.5 ? gr.contrast(f) : C.color, W = c.spikemode, J = c.spikethickness, U = c.spikecolor || N, E = $o.getPxPosition(e, c), z, F; if (W.indexOf("toaxis") !== -1 || W.indexOf("across") !== -1) { if (W.indexOf("toaxis") !== -1 && (z = E, F = j), W.indexOf("across") !== -1) { var q = c._counterDomainMin, H = c._counterDomainMax; c.anchor === "free" && (q = Math.min(q, c.position), H = Math.max(H, c.position)), z = i.t + (1 - H) * i.h, F = i.t + (1 - q) * i.h; } r.insert("line", ":first-child").attr({ x1: I, x2: I, y1: z, y2: F, "stroke-width": J, stroke: U, "stroke-dasharray": Ei.dashStyle(c.spikedash, J) }).classed("spikeline", !0).classed("crisp", !0), r.insert("line", ":first-child").attr({ x1: I, x2: I, y1: z, y2: F, "stroke-width": J + 2, stroke: f }).classed("spikeline", !0).classed("crisp", !0); } W.indexOf("marker") !== -1 && r.insert("circle", ":first-child").attr({ cx: I, cy: E - (c.side !== "top" ? J : -J), r: J, fill: U }).classed("spikeline", !0); } } } function BK(e, t, n) { if (!n || n.length !== e._hoverdata.length) return !0; for (var r = n.length - 1; r >= 0; r--) { var a = n[r], i = e._hoverdata[r]; if (a.curveNumber !== i.curveNumber || String(a.pointNumber) !== String(i.pointNumber) || String(a.pointNumbers) !== String(i.pointNumbers)) return !0; } return !1; } function xT(e, t) { return !0; } function bT(e, t) { return Ia.plainText(e || "", { len: t, allowedTags: ["br", "sub", "sup", "b", "i", "em"] }); } function HK(e, t) { for (var n = t.charAt(0), r = [], a = [], i = [], o = 0; o < e.length; o++) { var l = e[o]; Ic.traceIs(l.trace, "bar-like") || Ic.traceIs(l.trace, "box-violin") ? i.push(l) : l.trace[n + "period"] ? a.push(l) : r.push(l); } return r.concat(a).concat(i); } function wT(e, t, n) { var r = t[e + "a"], a = t[e + "Val"], i = t.cd[0]; if (r.type === "category" || r.type === "multicategory") a = r._categoriesMap[a]; else if (r.type === "date") { var o = t.trace[e + "periodalignment"]; if (o) { var l = t.cd[t.index], s = l[e + "Start"]; s === void 0 && (s = l[e]); var c = l[e + "End"]; c === void 0 && (c = l[e]); var u = c - s; o === "end" ? a += u : o === "middle" && (a += u / 2); } a = r.d2c(a); } return i && i.t && i.t.posLetter === r._id && (n.boxmode === "group" || n.violinmode === "group") && (a += i.t.dPos), a; } function h6(e) { return e.offsetTop + e.clientTop; } function p6(e) { return e.offsetLeft + e.clientLeft; } function Ps(e, t) { var n = e._fullLayout, r = t.getBoundingClientRect(), a = r.left, i = r.top, o = a + r.width, l = i + r.height, s = Qn.apply3DTransform(n._invTransform)(a, i), c = Qn.apply3DTransform(n._invTransform)(o, l), u = s[0], f = s[1], h = c[0], g = c[1]; return { x: u, y: f, width: h - u, height: g - f, top: Math.min(f, g), left: Math.min(u, h), right: Math.max(u, h), bottom: Math.max(f, g) }; } var VK = Ue, qK = rn, UK = Oo.isUnifiedHover, Mx = function(e, t, n, r) { r = r || {}; var a = t.legend; function i(o) { r.font[o] || (r.font[o] = a ? t.legend.font[o] : t.font[o]); } t && UK(t.hovermode) && (r.font || (r.font = {}), i("size"), i("family"), i("color"), a ? (r.bgcolor || (r.bgcolor = qK.combine(t.legend.bgcolor, t.paper_bgcolor)), r.bordercolor || (r.bordercolor = t.legend.bordercolor)) : r.bgcolor || (r.bgcolor = t.paper_bgcolor)), n("hoverlabel.bgcolor", r.bgcolor), n("hoverlabel.bordercolor", r.bordercolor), n("hoverlabel.namelength", r.namelength), VK.coerceFont(n, "hoverlabel.font", r.font), n("hoverlabel.align", r.align); }, GK = Ue, WK = Mx, ZK = Zd, YK = function(e, t) { function n(r, a) { return GK.coerce(e, t, ZK, r, a); } WK(e, t, n); }, _T = Ue, $K = H1, KK = Mx, JK = function(e, t, n, r) { function a(o, l) { return _T.coerce(e, t, $K, o, l); } var i = _T.extendFlat({}, r.hoverlabel); t.hovertemplate && (i.namelength = -1), KK(e, t, a, i); }, QK = Ue, XK = Zd, g6 = function(e, t) { function n(r, a) { return t[r] !== void 0 ? t[r] : QK.coerce(e, t, XK, r, a); } return n("clickmode"), n("hovermode"); }, kT = Ue, eJ = Zd, tJ = g6, nJ = Mx, rJ = function(e, t) { function n(s, c) { return kT.coerce(e, t, eJ, s, c); } var r = tJ(e, t); r && (n("hoverdistance"), n("spikedistance")); var a = n("dragmode"); a === "select" && n("selectdirection"); var i = t._has("mapbox"), o = t._has("geo"), l = t._basePlotModules.length; t.dragmode === "zoom" && ((i || o) && l === 1 || i && o && l === 2) && (t.dragmode = "pan"), nJ(e, t, n), kT.coerceFont(n, "hoverlabel.grouptitlefont", t.hoverlabel.font); }, Oy = Ue, TT = Rt, aJ = function(e) { var t = e.calcdata, n = e._fullLayout; function r(s) { return function(c) { return Oy.coerceHoverinfo({ hoverinfo: c }, { _module: s._module }, n); }; } for (var a = 0; a < t.length; a++) { var i = t[a], o = i[0].trace; if (!TT.traceIs(o, "pie-like")) { var l = TT.traceIs(o, "2dMap") ? iJ : Oy.fillArray; l(o.hoverinfo, i, "hi", r(o)), o.hovertemplate && l(o.hovertemplate, i, "ht"), o.hoverlabel && (l(o.hoverlabel.bgcolor, i, "hbg"), l(o.hoverlabel.bordercolor, i, "hbc"), l(o.hoverlabel.font.size, i, "hts"), l(o.hoverlabel.font.color, i, "htc"), l(o.hoverlabel.font.family, i, "htf"), l(o.hoverlabel.namelength, i, "hnl"), l(o.hoverlabel.align, i, "hta")); } } }; function iJ(e, t, n, r) { r = r || Oy.identity, Array.isArray(e) && (t[0][n] = r(e)); } var oJ = Rt, lJ = z0.hover, sJ = function(e, t, n) { var r = oJ.getComponentMethod("annotations", "onClick")(e, e._hoverdata); n !== void 0 && lJ(e, t, n, !0); function a() { e.emit("plotly_click", { points: e._hoverdata, event: t }); } e._hoverdata && t && t.target && (r && r.then ? r.then(a) : a(), t.stopImmediatePropagation && t.stopImmediatePropagation()); }, cJ = sn, wp = Ue, uJ = Xi, Su = Oo, AT = Zd, MT = z0, Ao = { moduleType: "component", name: "fx", constants: s0, schema: { layout: AT }, attributes: H1, layoutAttributes: AT, supplyLayoutGlobalDefaults: YK, supplyDefaults: JK, supplyLayoutDefaults: rJ, calc: aJ, getDistanceFunction: Su.getDistanceFunction, getClosest: Su.getClosest, inbox: Su.inbox, quadrature: Su.quadrature, appendArrayPointValue: Su.appendArrayPointValue, castHoverOption: fJ, castHoverinfo: hJ, hover: MT.hover, unhover: uJ.unhover, loneHover: MT.loneHover, loneUnhover: dJ, click: sJ }; function dJ(e) { var t = wp.isD3Selection(e) ? e : cJ.select(e); t.selectAll("g.hovertext").remove(), t.selectAll(".spikeline").remove(); } function fJ(e, t, n) { return wp.castOption(e, t, "hoverlabel." + n); } function hJ(e, t, n) { function r(a) { return wp.coerceHoverinfo({ hoverinfo: a }, { _module: e._module }, t); } return wp.castOption(e, n, "hoverinfo", r); } var tu = {}; (function(e) { e.selectMode = function(t) { return t === "lasso" || t === "select"; }, e.drawMode = function(t) { return t === "drawclosedpath" || t === "drawopenpath" || t === "drawline" || t === "drawrect" || t === "drawcircle"; }, e.openMode = function(t) { return t === "drawline" || t === "drawopenpath"; }, e.rectMode = function(t) { return t === "select" || t === "drawline" || t === "drawrect" || t === "drawcircle"; }, e.freeMode = function(t) { return t === "lasso" || t === "drawclosedpath" || t === "drawopenpath"; }, e.selectingOrDrawing = function(t) { return e.freeMode(t) || e.rectMode(t); }; })(tu); var Sx = function(e) { var t = e._fullLayout; t._glcanvas && t._glcanvas.size() && t._glcanvas.each(function(n) { n.regl && n.regl.clear({ color: !0, depth: !0 }); }); }, j0 = {}, v6 = { exports: {} }, Cx = { undo: { width: 857.1, height: 1e3, path: "m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z", transform: "matrix(1 0 0 -1 0 850)" }, home: { width: 928.6, height: 1e3, path: "m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z", transform: "matrix(1 0 0 -1 0 850)" }, "camera-retro": { width: 1e3, height: 1e3, path: "m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z", transform: "matrix(1 0 0 -1 0 850)" }, zoombox: { width: 1e3, height: 1e3, path: "m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z", transform: "matrix(1 0 0 -1 0 850)" }, pan: { width: 1e3, height: 1e3, path: "m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z", transform: "matrix(1 0 0 -1 0 850)" }, zoom_plus: { width: 875, height: 1e3, path: "m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z", transform: "matrix(1 0 0 -1 0 850)" }, zoom_minus: { width: 875, height: 1e3, path: "m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z", transform: "matrix(1 0 0 -1 0 850)" }, autoscale: { width: 1e3, height: 1e3, path: "m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z", transform: "matrix(1 0 0 -1 0 850)" }, tooltip_basic: { width: 1500, height: 1e3, path: "m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z", transform: "matrix(1 0 0 -1 0 850)" }, tooltip_compare: { width: 1125, height: 1e3, path: "m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z", transform: "matrix(1 0 0 -1 0 850)" }, plotlylogo: { width: 1542, height: 1e3, path: "m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z", transform: "matrix(1 0 0 -1 0 850)" }, "z-axis": { width: 1e3, height: 1e3, path: "m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z", transform: "matrix(1 0 0 -1 0 850)" }, "3d_rotate": { width: 1e3, height: 1e3, path: "m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z", transform: "matrix(1 0 0 -1 0 850)" }, camera: { width: 1e3, height: 1e3, path: "m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z", transform: "matrix(1 0 0 -1 0 850)" }, movie: { width: 1e3, height: 1e3, path: "m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z", transform: "matrix(1 0 0 -1 0 850)" }, question: { width: 857.1, height: 1e3, path: "m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z", transform: "matrix(1 0 0 -1 0 850)" }, disk: { width: 857.1, height: 1e3, path: "m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z", transform: "matrix(1 0 0 -1 0 850)" }, drawopenpath: { width: 70, height: 70, path: "M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z", transform: "matrix(1 0 0 1 -15 -15)" }, drawclosedpath: { width: 90, height: 90, path: "M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z", transform: "matrix(1 0 0 1 -5 -5)" }, lasso: { width: 1031, height: 1e3, path: "m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z", transform: "matrix(1 0 0 -1 0 850)" }, selectbox: { width: 1e3, height: 1e3, path: "m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z", transform: "matrix(1 0 0 -1 0 850)" }, drawline: { width: 70, height: 70, path: "M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z", transform: "matrix(1 0 0 1 -15 -15)" }, drawrect: { width: 80, height: 80, path: "M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z", transform: "matrix(1 0 0 1 -10 -10)" }, drawcircle: { width: 80, height: 80, path: "M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z", transform: "matrix(1 0 0 1 -10 -10)" }, eraseshape: { width: 80, height: 80, path: "M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z", transform: "matrix(1 0 0 1 -10 -10)" }, spikeline: { width: 1e3, height: 1e3, path: "M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z", transform: "matrix(1.5 0 0 -1.5 0 850)" }, pencil: { width: 1792, height: 1792, path: "M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z", transform: "matrix(1 0 0 1 0 1)" }, newplotlylogo: { name: "newplotlylogo", svg: [ "", "", " ", "", " plotly-logomark", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "" ].join("") } }, bl = {}, rh = 32, Lx = { CIRCLE_SIDES: rh, i000: 0, i090: rh / 4, i180: rh / 2, i270: rh / 4 * 3, cos45: Math.cos(Math.PI / 4), sin45: Math.sin(Math.PI / 4), SQRT2: Math.sqrt(2) }, pJ = Ue.strTranslate; function m6(e, t) { switch (e.type) { case "log": return e.p2d(t); case "date": return e.p2r(t, 0, e.calendar); default: return e.p2r(t); } } function gJ(e, t) { switch (e.type) { case "log": return e.d2p(t); case "date": return e.r2p(t, 0, e.calendar); default: return e.r2p(t); } } function vJ(e) { var t = e._id.charAt(0) === "y" ? 1 : 0; return function(n) { return m6(e, n[t]); }; } function mJ(e) { return pJ( e.xaxis._offset, e.yaxis._offset ); } var Ox = { p2r: m6, r2p: gJ, axValue: vJ, getTransform: mJ }; (function(e) { var t = _L, n = Lx, r = n.CIRCLE_SIDES, a = n.SQRT2, i = Ox, o = i.p2r, l = i.r2p, s = [0, 3, 4, 5, 6, 1, 2], c = [0, 3, 4, 1, 2]; e.writePaths = function(h) { var g = h.length; if (!g) return "M0,0Z"; for (var p = "", v = 0; v < g; v++) for (var y = h[v].length, m = 0; m < y; m++) { var b = h[v][m][0]; if (b === "Z") p += "Z"; else for (var w = h[v][m].length, _ = 0; _ < w; _++) { var k = _; b === "Q" || b === "S" ? k = c[_] : b === "C" && (k = s[_]), p += h[v][m][k], _ > 0 && _ < w - 1 && (p += ","); } } return p; }, e.readPaths = function(h, g, p, v) { var y = t(h), m = [], b = -1, w = function() { b++, m[b] = []; }, _, k = 0, T = 0, O, M, C = function() { O = k, M = T; }; C(); for (var I = 0; I < y.length; I++) { var j = [], P, N, W, J, U = y[I][0], E = U; switch (U) { case "M": w(), k = +y[I][1], T = +y[I][2], j.push([E, k, T]), C(); break; case "Q": case "S": P = +y[I][1], W = +y[I][2], k = +y[I][3], T = +y[I][4], j.push([E, k, T, P, W]); break; case "C": P = +y[I][1], W = +y[I][2], N = +y[I][3], J = +y[I][4], k = +y[I][5], T = +y[I][6], j.push([E, k, T, P, W, N, J]); break; case "T": case "L": k = +y[I][1], T = +y[I][2], j.push([E, k, T]); break; case "H": E = "L", k = +y[I][1], j.push([E, k, T]); break; case "V": E = "L", T = +y[I][1], j.push([E, k, T]); break; case "A": E = "L"; var z = +y[I][1], F = +y[I][2]; +y[I][4] || (z = -z, F = -F); var q = k - z, H = T; for (_ = 1; _ <= r / 2; _++) { var K = 2 * Math.PI * _ / r; j.push([ E, q + z * Math.cos(K), H + F * Math.sin(K) ]); } break; case "Z": (k !== O || T !== M) && (k = O, T = M, j.push([E, k, T])); break; } for (var Q = (p || {}).domain, re = g._fullLayout._size, te = p && p.xsizemode === "pixel", X = p && p.ysizemode === "pixel", ce = v === !1, B = 0; B < j.length; B++) { for (_ = 0; _ + 2 < 7; _ += 2) { var G = j[B][_ + 1], Z = j[B][_ + 2]; G === void 0 || Z === void 0 || (k = G, T = Z, p && (p.xaxis && p.xaxis.p2r ? (ce && (G -= p.xaxis._offset), te ? G = l(p.xaxis, p.xanchor) + G : G = o(p.xaxis, G)) : (ce && (G -= re.l), Q ? G = Q.x[0] + G / re.w : G = G / re.w), p.yaxis && p.yaxis.p2r ? (ce && (Z -= p.yaxis._offset), X ? Z = l(p.yaxis, p.yanchor) - Z : Z = o(p.yaxis, Z)) : (ce && (Z -= re.t), Q ? Z = Q.y[1] - Z / re.h : Z = 1 - Z / re.h)), j[B][_ + 1] = G, j[B][_ + 2] = Z); } m[b].push( j[B].slice() ); } } return m; }; function u(h, g) { return Math.abs(h - g) <= 1e-6; } function f(h, g) { var p = g[1] - h[1], v = g[2] - h[2]; return Math.sqrt( p * p + v * v ); } e.pointsOnRectangle = function(h) { var g = h.length; if (g !== 5) return !1; for (var p = 1; p < 3; p++) { var v = h[0][p] - h[1][p], y = h[3][p] - h[2][p]; if (!u(v, y)) return !1; var m = h[0][p] - h[3][p], b = h[1][p] - h[2][p]; if (!u(m, b)) return !1; } return !u(h[0][1], h[1][1]) && !u(h[0][1], h[3][1]) ? !1 : !!(f(h[0], h[1]) * f(h[0], h[3])); }, e.pointsOnEllipse = function(h) { var g = h.length; if (g !== r + 1) return !1; g = r; for (var p = 0; p < g; p++) { var v = (g * 2 - p) % g, y = (g / 2 + v) % g, m = (g / 2 + p) % g; if (!u( f(h[p], h[m]), f(h[v], h[y]) )) return !1; } return !0; }, e.handleEllipse = function(h, g, p) { if (!h) return [g, p]; var v = e.ellipseOver({ x0: g[0], y0: g[1], x1: p[0], y1: p[1] }), y = (v.x1 + v.x0) / 2, m = (v.y1 + v.y0) / 2, b = (v.x1 - v.x0) / 2, w = (v.y1 - v.y0) / 2; b || (b = w = w / a), w || (w = b = b / a); for (var _ = [], k = 0; k < r; k++) { var T = k * 2 * Math.PI / r; _.push([ y + b * Math.cos(T), m + w * Math.sin(T) ]); } return _; }, e.ellipseOver = function(h) { var g = h.x0, p = h.y0, v = h.x1, y = h.y1, m = v - g, b = y - p; g -= m, p -= b; var w = (g + v) / 2, _ = (p + y) / 2, k = a; return m *= k, b *= k, { x0: w - m, y0: _ - b, x1: w + m, y1: _ + b }; }, e.fixDatesForPaths = function(h, g, p) { var v = g.type === "date", y = p.type === "date"; if (!v && !y) return h; for (var m = 0; m < h.length; m++) for (var b = 0; b < h[m].length; b++) for (var w = 0; w + 2 < h[m][b].length; w += 2) v && (h[m][b][w + 1] = h[m][b][w + 1].replace(" ", "_")), y && (h[m][b][w + 2] = h[m][b][w + 2].replace(" ", "_")); return h; }; })(bl); var y6 = tu, yJ = y6.drawMode, xJ = y6.openMode, nu = Lx, ST = nu.i000, CT = nu.i090, LT = nu.i180, OT = nu.i270, bJ = nu.cos45, wJ = nu.sin45, x6 = Ox, ah = x6.p2r, Bo = x6.r2p, _J = xs, kJ = _J.clearOutline, P0 = bl, TJ = P0.readPaths, AJ = P0.writePaths, MJ = P0.ellipseOver, SJ = P0.fixDatesForPaths; function CJ(e, t) { if (e.length) { var n = e[0][0]; if (n) { var r = t.gd, a = t.isActiveShape, i = t.dragmode, o = (r.layout || {}).shapes || []; if (!yJ(i) && a !== void 0) { var l = r._fullLayout._activeShapeIndex; if (l < o.length) switch (r._fullLayout.shapes[l].type) { case "rect": i = "drawrect"; break; case "circle": i = "drawcircle"; break; case "line": i = "drawline"; break; case "path": var s = o[l].path || ""; s[s.length - 1] === "Z" ? i = "drawclosedpath" : i = "drawopenpath"; break; } } var c = b6(e, t, i); kJ(r); for (var u = t.editHelpers, f = (u || {}).modifyItem, h = [], g = 0; g < o.length; g++) { var p = r._fullLayout.shapes[g]; if (h[g] = p._input, a !== void 0 && g === r._fullLayout._activeShapeIndex) { var v = c; switch (p.type) { case "line": case "rect": case "circle": f("x0", v.x0), f("x1", v.x1), f("y0", v.y0), f("y1", v.y1); break; case "path": f("path", v.path); break; } } } return a === void 0 ? (h.push(c), h) : u ? u.getUpdateObj() : {}; } } } function b6(e, t, n) { var r = e[0][0], a = t.gd, i = r.getAttribute("d"), o = a._fullLayout.newshape, l = t.plotinfo, s = t.isActiveShape, c = l.xaxis, u = l.yaxis, f = !!l.domain || !l.xaxis, h = !!l.domain || !l.yaxis, g = xJ(n), p = TJ(i, a, l, s), v = { editable: !0, visible: o.visible, name: o.name, showlegend: o.showlegend, legend: o.legend, legendwidth: o.legendwidth, legendgroup: o.legendgroup, legendgrouptitle: { text: o.legendgrouptitle.text, font: o.legendgrouptitle.font }, legendrank: o.legendrank, label: o.label, xref: f ? "paper" : c._id, yref: h ? "paper" : u._id, layer: o.layer, opacity: o.opacity, line: { color: o.line.color, width: o.line.width, dash: o.line.dash } }; g || (v.fillcolor = o.fillcolor, v.fillrule = o.fillrule); var y; if (p.length === 1 && (y = p[0]), y && y.length === 5 && // ensure we only have 4 corners for a rect n === "drawrect") v.type = "rect", v.x0 = y[0][1], v.y0 = y[0][2], v.x1 = y[2][1], v.y1 = y[2][2]; else if (y && n === "drawline") v.type = "line", v.x0 = y[0][1], v.y0 = y[0][2], v.x1 = y[1][1], v.y1 = y[1][2]; else if (y && n === "drawcircle") { v.type = "circle"; var m = y[ST][1], b = y[CT][1], w = y[LT][1], _ = y[OT][1], k = y[ST][2], T = y[CT][2], O = y[LT][2], M = y[OT][2], C = l.xaxis && (l.xaxis.type === "date" || l.xaxis.type === "log"), I = l.yaxis && (l.yaxis.type === "date" || l.yaxis.type === "log"); C && (m = Bo(l.xaxis, m), b = Bo(l.xaxis, b), w = Bo(l.xaxis, w), _ = Bo(l.xaxis, _)), I && (k = Bo(l.yaxis, k), T = Bo(l.yaxis, T), O = Bo(l.yaxis, O), M = Bo(l.yaxis, M)); var j = (b + _) / 2, P = (k + O) / 2, N = (_ - b + w - m) / 2, W = (M - T + O - k) / 2, J = MJ({ x0: j, y0: P, x1: j + N * bJ, y1: P + W * wJ }); C && (J.x0 = ah(l.xaxis, J.x0), J.x1 = ah(l.xaxis, J.x1)), I && (J.y0 = ah(l.yaxis, J.y0), J.y1 = ah(l.yaxis, J.y1)), v.x0 = J.x0, v.y0 = J.y0, v.x1 = J.x1, v.y1 = J.y1; } else v.type = "path", c && u && SJ(p, c, u), v.path = AJ(p), y = null; return v; } var Dx = { newShapes: CJ, createShapeObj: b6 }, LJ = tu, OJ = LJ.selectMode, DJ = xs, FJ = DJ.clearOutline, Fx = bl, IJ = Fx.readPaths, zJ = Fx.writePaths, EJ = Fx.fixDatesForPaths, w6 = function(e, t) { if (e.length) { var n = e[0][0]; if (n) { var r = n.getAttribute("d"), a = t.gd, i = a._fullLayout.newselection, o = t.plotinfo, l = o.xaxis, s = o.yaxis, c = t.isActiveSelection, u = t.dragmode, f = (a.layout || {}).selections || []; if (!OJ(u) && c !== void 0) { var h = a._fullLayout._activeSelectionIndex; if (h < f.length) switch (a._fullLayout.selections[h].type) { case "rect": u = "select"; break; case "path": u = "lasso"; break; } } var g = IJ(r, a, o, c), p = { xref: l._id, yref: s._id, opacity: i.opacity, line: { color: i.line.color, width: i.line.width, dash: i.line.dash } }, v; g.length === 1 && (v = g[0]), v && v.length === 5 && // ensure we only have 4 corners for a rect u === "select" ? (p.type = "rect", p.x0 = v[0][1], p.y0 = v[0][2], p.x1 = v[2][1], p.y1 = v[2][2]) : (p.type = "path", l && s && EJ(g, l, s), p.path = zJ(g), v = null), FJ(a); for (var y = t.editHelpers, m = (y || {}).modifyItem, b = [], w = 0; w < f.length; w++) { var _ = a._fullLayout.selections[w]; if (!_) { b[w] = _; continue; } if (b[w] = _._input, c !== void 0 && w === a._fullLayout._activeSelectionIndex) { var k = p; switch (_.type) { case "rect": m("x0", k.x0), m("x1", k.x1), m("y0", k.y0), m("y1", k.y1); break; case "path": m("path", k.path); break; } } } return c === void 0 ? (b.push(p), b) : y ? y.getUpdateObj() : {}; } } }, wl = {}, R0 = { segmentRE: /[MLHVQCTSZ][^MLHVQCTSZ]*/g, paramRE: /[^\s,]+/g, // which numbers in each path segment are x (or y) values // drawn is which param is a drawn point, as opposed to a // control point (which doesn't count toward autorange. // TODO: this means curved paths could extend beyond the // autorange bounds. This is a bit tricky to get right // unless we revert to bounding boxes, but perhaps there's // a calculation we could do...) paramIsX: { M: { 0: !0, drawn: 0 }, L: { 0: !0, drawn: 0 }, H: { 0: !0, drawn: 0 }, V: {}, Q: { 0: !0, 2: !0, drawn: 2 }, C: { 0: !0, 2: !0, 4: !0, drawn: 4 }, T: { 0: !0, drawn: 0 }, S: { 0: !0, 2: !0, drawn: 2 }, // A: {0: true, 5: true}, Z: {} }, paramIsY: { M: { 1: !0, drawn: 1 }, L: { 1: !0, drawn: 1 }, H: {}, V: { 0: !0, drawn: 0 }, Q: { 1: !0, 3: !0, drawn: 3 }, C: { 1: !0, 3: !0, 5: !0, drawn: 5 }, T: { 1: !0, drawn: 1 }, S: { 1: !0, 3: !0, drawn: 5 }, // A: {1: true, 6: true}, Z: {} }, numParams: { M: 2, L: 2, H: 1, V: 1, Q: 4, C: 6, T: 2, S: 4, // A: 7, Z: 0 } }; (function(e) { var t = R0, n = Ue, r = Ln; e.rangeToShapePosition = function(i) { return i.type === "log" ? i.r2d : function(o) { return o; }; }, e.shapePositionToRange = function(i) { return i.type === "log" ? i.d2r : function(o) { return o; }; }, e.decodeDate = function(i) { return function(o) { return o.replace && (o = o.replace("_", " ")), i(o); }; }, e.encodeDate = function(i) { return function(o) { return i(o).replace(" ", "_"); }; }, e.extractPathCoords = function(i, o, l) { var s = [], c = i.match(t.segmentRE); return c.forEach(function(u) { var f = o[u.charAt(0)].drawn; if (f !== void 0) { var h = u.substr(1).match(t.paramRE); if (!(!h || h.length < f)) { var g = h[f], p = l ? g : n.cleanNumber(g); s.push(p); } } }), s; }, e.getDataToPixel = function(i, o, l, s) { var c = i._fullLayout._size, u; if (o) if (s === "domain") u = function(h) { return o._length * (l ? 1 - h : h) + o._offset; }; else { var f = e.shapePositionToRange(o); u = function(h) { return o._offset + o.r2p(f(h, !0)); }, o.type === "date" && (u = e.decodeDate(u)); } else l ? u = function(h) { return c.t + c.h * (1 - h); } : u = function(h) { return c.l + c.w * h; }; return u; }, e.getPixelToData = function(i, o, l, s) { var c = i._fullLayout._size, u; if (o) if (s === "domain") u = function(h) { var g = (h - o._offset) / o._length; return l ? 1 - g : g; }; else { var f = e.rangeToShapePosition(o); u = function(h) { return f(o.p2r(h - o._offset)); }; } else l ? u = function(h) { return 1 - (h - c.t) / c.h; } : u = function(h) { return (h - c.l) / c.w; }; return u; }, e.roundPositionForSharpStrokeRendering = function(i, o) { var l = Math.round(o % 2) === 1, s = Math.round(i); return l ? s + 0.5 : s; }, e.makeShapesOptionsAndPlotinfo = function(i, o) { var l = i._fullLayout.shapes[o] || {}, s = i._fullLayout._plots[l.xref + l.yref], c = !!s; return c ? s._hadPlotinfo = !0 : (s = {}, l.xref && l.xref !== "paper" && (s.xaxis = i._fullLayout[l.xref + "axis"]), l.yref && l.yref !== "paper" && (s.yaxis = i._fullLayout[l.yref + "axis"])), s.xsizemode = l.xsizemode, s.ysizemode = l.ysizemode, s.xanchor = l.xanchor, s.yanchor = l.yanchor, { options: l, plotinfo: s }; }, e.makeSelectionsOptionsAndPlotinfo = function(i, o) { var l = i._fullLayout.selections[o] || {}, s = i._fullLayout._plots[l.xref + l.yref], c = !!s; return c ? s._hadPlotinfo = !0 : (s = {}, l.xref && (s.xaxis = i._fullLayout[l.xref + "axis"]), l.yref && (s.yaxis = i._fullLayout[l.yref + "axis"])), { options: l, plotinfo: s }; }, e.getPathString = function(i, o) { var l = o.type, s = r.getRefType(o.xref), c = r.getRefType(o.yref), u = r.getFromId(i, o.xref), f = r.getFromId(i, o.yref), h = i._fullLayout._size, g, p, v, y, m, b, w, _; if (u ? s === "domain" ? p = function(W) { return u._offset + u._length * W; } : (g = e.shapePositionToRange(u), p = function(W) { return u._offset + u.r2p(g(W, !0)); }) : p = function(W) { return h.l + h.w * W; }, f ? c === "domain" ? y = function(W) { return f._offset + f._length * (1 - W); } : (v = e.shapePositionToRange(f), y = function(W) { return f._offset + f.r2p(v(W, !0)); }) : y = function(W) { return h.t + h.h * (1 - W); }, l === "path") return u && u.type === "date" && (p = e.decodeDate(p)), f && f.type === "date" && (y = e.decodeDate(y)), a(o, p, y); if (o.xsizemode === "pixel") { var k = p(o.xanchor); m = k + o.x0, b = k + o.x1; } else m = p(o.x0), b = p(o.x1); if (o.ysizemode === "pixel") { var T = y(o.yanchor); w = T - o.y0, _ = T - o.y1; } else w = y(o.y0), _ = y(o.y1); if (l === "line") return "M" + m + "," + w + "L" + b + "," + _; if (l === "rect") return "M" + m + "," + w + "H" + b + "V" + _ + "H" + m + "Z"; var O = (m + b) / 2, M = (w + _) / 2, C = Math.abs(O - m), I = Math.abs(M - w), j = "A" + C + "," + I, P = O + C + "," + M, N = O + "," + (M - I); return "M" + P + j + " 0 1,1 " + N + j + " 0 0,1 " + P + "Z"; }; function a(i, o, l) { var s = i.path, c = i.xsizemode, u = i.ysizemode, f = i.xanchor, h = i.yanchor; return s.replace(t.segmentRE, function(g) { var p = 0, v = g.charAt(0), y = t.paramIsX[v], m = t.paramIsY[v], b = t.numParams[v], w = g.substr(1).replace(t.paramRE, function(_) { return y[p] ? c === "pixel" ? _ = o(f) + Number(_) : _ = o(_) : m[p] && (u === "pixel" ? _ = l(h) - Number(_) : _ = l(_)), p++, p > b && (_ = "X"), _; }); return p > b && (w = w.replace(/[\s,]*X.*/, ""), n.log("Ignoring extra params in segment " + g)), v + w; }); } })(wl); var jJ = Ue, Rs = Ln, DT = Ir, FT = Cn, PJ = bl.readPaths, Dy = wl, RJ = Dy.getPathString, IT = Z1, NJ = Nr.FROM_TL, _6 = function(e, t, n, r) { if (r.selectAll(".shape-label").remove(), !!(n.label.text || n.label.texttemplate)) { var a; if (n.label.texttemplate) { var i = {}; if (n.type !== "path") { var o = Rs.getFromId(e, n.xref), l = Rs.getFromId(e, n.yref); for (var s in IT) { var c = IT[s](n, o, l); c !== void 0 && (i[s] = c); } } a = jJ.texttemplateStringForShapes( n.label.texttemplate, {}, e._fullLayout._d3locale, i ); } else a = n.label.text; var u = { "data-index": t }, f = n.label.font, h = { "data-notex": 1 }, g = r.append("g").attr(u).classed("shape-label", !0), p = g.append("text").attr(h).classed("shape-label-text", !0).text(a), v, y, m, b; if (n.path) { var w = RJ(e, n), _ = PJ(w, e); v = 1 / 0, m = 1 / 0, y = -1 / 0, b = -1 / 0; for (var k = 0; k < _.length; k++) for (var T = 0; T < _[k].length; T++) for (var O = _[k][T], M = 1; M < O.length; M += 2) { var C = O[M], I = O[M + 1]; v = Math.min(v, C), y = Math.max(y, C), m = Math.min(m, I), b = Math.max(b, I); } } else { var j = Rs.getFromId(e, n.xref), P = Rs.getRefType(n.xref), N = Rs.getFromId(e, n.yref), W = Rs.getRefType(n.yref), J = Dy.getDataToPixel(e, j, !1, P), U = Dy.getDataToPixel(e, N, !0, W); v = J(n.x0), y = J(n.x1), m = U(n.y0), b = U(n.y1); } var E = n.label.textangle; E === "auto" && (n.type === "line" ? E = BJ(v, m, y, b) : E = 0), p.call(function(Q) { return Q.call(FT.font, f).attr({}), DT.convertToTspans(Q, e), Q; }); var z = FT.bBox(p.node()), F = HJ(v, m, y, b, n, E, z), q = F.textx, H = F.texty, K = F.xanchor; p.attr({ "text-anchor": { left: "start", center: "middle", right: "end" }[K], y: H, x: q, transform: "rotate(" + E + "," + q + "," + H + ")" }).call(DT.positionText, q, H); } }; function BJ(e, t, n, r) { var a, i; return i = Math.abs(n - e), n >= e ? a = t - r : a = r - t, -180 / Math.PI * Math.atan2(a, i); } function HJ(e, t, n, r, a, i, o) { var l = a.label.textposition, s = a.label.textangle, c = a.label.padding, u = a.type, f = Math.PI / 180 * i, h = Math.sin(f), g = Math.cos(f), p = a.label.xanchor, v = a.label.yanchor, y, m, b, w; if (u === "line") { l === "start" ? (y = e, m = t) : l === "end" ? (y = n, m = r) : (y = (e + n) / 2, m = (t + r) / 2), p === "auto" && (l === "start" ? s === "auto" ? n > e ? p = "left" : n < e ? p = "right" : p = "center" : n > e ? p = "right" : n < e ? p = "left" : p = "center" : l === "end" ? s === "auto" ? n > e ? p = "right" : n < e ? p = "left" : p = "center" : n > e ? p = "left" : n < e ? p = "right" : p = "center" : p = "center"); var _ = { left: 1, center: 0, right: -1 }, k = { bottom: -1, middle: 0, top: 1 }; if (s === "auto") { var T = k[v]; b = -c * h * T, w = c * g * T; } else { var O = _[p], M = k[v]; b = c * O, w = c * M; } y = y + b, m = m + w; } else b = c + 3, l.indexOf("right") !== -1 ? (y = Math.max(e, n) - b, p === "auto" && (p = "right")) : l.indexOf("left") !== -1 ? (y = Math.min(e, n) + b, p === "auto" && (p = "left")) : (y = (e + n) / 2, p === "auto" && (p = "center")), l.indexOf("top") !== -1 ? m = Math.min(t, r) : l.indexOf("bottom") !== -1 ? m = Math.max(t, r) : m = (t + r) / 2, w = c, v === "bottom" ? m = m - w : v === "top" && (m = m + w); var C = NJ[v], I = a.label.font.size, j = o.height, P = (j * C - I) * h, N = -(j * C - I) * g; return { textx: y + P, texty: m + N, xanchor: p }; } var VJ = Ue, qJ = VJ.strTranslate, zT = Xi, k6 = tu, UJ = k6.drawMode, T6 = k6.selectMode, A6 = Rt, ET = rn, N0 = Lx, GJ = N0.i000, WJ = N0.i090, ZJ = N0.i180, YJ = N0.i270, $J = xs, M6 = $J.clearOutlineControllers, Ix = bl, ih = Ix.pointsOnRectangle, Sv = Ix.pointsOnEllipse, KJ = Ix.writePaths, JJ = Dx.newShapes, QJ = Dx.createShapeObj, XJ = w6, eQ = _6, zx = function e(t, n, r, a) { a || (a = 0); var i = r.gd; function o() { e(t, n, r, a++), (Sv(t[0]) || r.hasText) && l({ redrawing: !0 }); } function l(E) { var z = {}; r.isActiveShape !== void 0 && (r.isActiveShape = !1, z = JJ(n, r)), r.isActiveSelection !== void 0 && (r.isActiveSelection = !1, z = XJ(n, r), i._fullLayout._reselect = !0), Object.keys(z).length && A6.call((E || {}).redrawing ? "relayout" : "_guiRelayout", i, z); } var s = i._fullLayout, c = s._zoomlayer, u = r.dragmode, f = UJ(u), h = T6(u); (f || h) && (i._fullLayout._outlining = !0), M6(i), n.attr("d", KJ(t)); var g, p, v, y, m; if (!a && (r.isActiveShape || r.isActiveSelection)) { m = tQ([], t); var b = c.append("g").attr("class", "outline-controllers"); I(b), U(); } if (f && r.hasText) { var w = c.select(".label-temp"), _ = QJ(n, r, r.dragmode); eQ(i, "label-temp", _, w); } function k(E) { v = +E.srcElement.getAttribute("data-i"), y = +E.srcElement.getAttribute("data-j"), g[v][y].moveFn = T; } function T(E, z) { if (t.length) { var F = m[v][y][1], q = m[v][y][2], H = t[v], K = H.length; if (ih(H)) { var Q = E, re = z; if (r.isActiveSelection) { var te = jT(H, y); te[1] === H[y][1] ? re = 0 : Q = 0; } for (var X = 0; X < K; X++) if (X !== y) { var ce = H[X]; ce[1] === H[y][1] && (ce[1] = F + Q), ce[2] === H[y][2] && (ce[2] = q + re); } if (H[y][1] = F + Q, H[y][2] = q + re, !ih(H)) for (var B = 0; B < K; B++) for (var G = 0; G < H[B].length; G++) H[B][G] = m[v][B][G]; } else H[y][1] = F + E, H[y][2] = q + z; o(); } } function O() { l(); } function M() { if (t.length && t[v] && t[v].length) { for (var E = [], z = 0; z < t[v].length; z++) z !== y && E.push( t[v][z] ); E.length > 1 && !(E.length === 2 && E[1][0] === "Z") && (y === 0 && (E[0][0] = "M"), t[v] = E, o(), l()); } } function C(E, z) { if (E === 2) { v = +z.srcElement.getAttribute("data-i"), y = +z.srcElement.getAttribute("data-j"); var F = t[v]; !ih(F) && !Sv(F) && M(); } } function I(E) { g = []; for (var z = 0; z < t.length; z++) { var F = t[z], q = ih(F), H = !q && Sv(F); g[z] = []; for (var K = F.length, Q = 0; Q < K; Q++) if (F[Q][0] !== "Z" && !(H && Q !== GJ && Q !== WJ && Q !== ZJ && Q !== YJ)) { var re = q && r.isActiveSelection, te; re && (te = jT(F, Q)); var X = F[Q][1], ce = F[Q][2], B = E.append(re ? "rect" : "circle").attr("data-i", z).attr("data-j", Q).style({ fill: ET.background, stroke: ET.defaultLine, "stroke-width": 1, "shape-rendering": "crispEdges" }); if (re) { var G = te[1] - X, Z = te[2] - ce, oe = Z ? 5 : Math.max(Math.min(25, Math.abs(G) - 5), 5), ae = G ? 5 : Math.max(Math.min(25, Math.abs(Z) - 5), 5); B.classed(Z ? "cursor-ew-resize" : "cursor-ns-resize", !0).attr("width", oe).attr("height", ae).attr("x", X - oe / 2).attr("y", ce - ae / 2).attr("transform", qJ(G / 2, Z / 2)); } else B.classed("cursor-grab", !0).attr("r", 5).attr("cx", X).attr("cy", ce); g[z][Q] = { element: B.node(), gd: i, prepFn: k, doneFn: O, clickFn: C }, zT.init(g[z][Q]); } } } function j(E, z) { if (t.length) for (var F = 0; F < t.length; F++) for (var q = 0; q < t[F].length; q++) for (var H = 0; H + 2 < t[F][q].length; H += 2) t[F][q][H + 1] = m[F][q][H + 1] + E, t[F][q][H + 2] = m[F][q][H + 2] + z; } function P(E, z) { j(E, z), o(); } function N(E) { v = +E.srcElement.getAttribute("data-i"), v || (v = 0), p[v].moveFn = P; } function W() { l(); } function J(E) { E === 2 && nQ(i); } function U() { if (p = [], !!t.length) { var E = 0; p[E] = { element: n[0][0], gd: i, prepFn: N, doneFn: W, clickFn: J }, zT.init(p[E]); } } }; function tQ(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; e[n] = []; for (var a = 0; a < r.length; a++) { e[n][a] = []; for (var i = 0; i < r[a].length; i++) e[n][a][i] = r[a][i]; } } return e; } function jT(e, t) { var n = e[t][1], r = e[t][2], a = e.length, i, o, l; return i = (t + 1) % a, o = e[i][1], l = e[i][2], o === n && l === r && (i = (t + 2) % a, o = e[i][1], l = e[i][2]), [i, o, l]; } function nQ(e) { if (T6(e._fullLayout.dragmode)) { M6(e); var t = e._fullLayout._activeSelectionIndex, n = (e.layout || {}).selections || []; if (t < n.length) { for (var r = [], a = 0; a < n.length; a++) a !== t && r.push(n[a]); delete e._fullLayout._activeSelectionIndex; var i = e._fullLayout.selections[t]; e._fullLayout._deselect = { xref: i.xref, yref: i.yref }, A6.call("_guiRelayout", e, { selections: r }); } } } var rQ = sn, S6 = Rt, PT = Ue, Ns = Ln, aQ = bl.readPaths, iQ = zx, _p = _6, C6 = xs.clearOutlineControllers, Cv = rn, Ex = Cn, oQ = Sn.arrayEditor, RT = Xi, NT = bs, Rl = R0, ra = wl, Fy = ra.getPathString, jx = { draw: Px, drawOne: L6, eraseActiveShape: cQ, drawLabel: _p }; function Px(e) { var t = e._fullLayout; t._shapeUpperLayer.selectAll("path").remove(), t._shapeLowerLayer.selectAll("path").remove(), t._shapeUpperLayer.selectAll("text").remove(), t._shapeLowerLayer.selectAll("text").remove(); for (var n in t._plots) { var r = t._plots[n].shapelayer; r && (r.selectAll("path").remove(), r.selectAll("text").remove()); } for (var a = 0; a < t.shapes.length; a++) t.shapes[a].visible === !0 && L6(e, a); } function oh(e) { return !!e._fullLayout._outlining; } function B0(e) { return !e._context.edits.shapePosition; } function L6(e, t) { e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="' + t + '"]').remove(); var n = ra.makeShapesOptionsAndPlotinfo(e, t), r = n.options, a = n.plotinfo; if (!r._input || r.visible !== !0) return; if (r.layer !== "below") o(e._fullLayout._shapeUpperLayer); else if (r.xref === "paper" || r.yref === "paper") o(e._fullLayout._shapeLowerLayer); else if (a._hadPlotinfo) { var i = a.mainplotinfo || a; o(i.shapelayer); } else o(e._fullLayout._shapeLowerLayer); function o(l) { var s = Fy(e, r), c = { "data-index": t, "fill-rule": r.fillrule, d: s }, u = r.opacity, f = r.fillcolor, h = r.line.width ? r.line.color : "rgba(0,0,0,0)", g = r.line.width, p = r.line.dash; !g && r.editable === !0 && (g = 5, p = "solid"); var v = s[s.length - 1] !== "Z", y = B0(e) && r.editable && e._fullLayout._activeShapeIndex === t; y && (f = v ? "rgba(0,0,0,0)" : e._fullLayout.activeshape.fillcolor, u = e._fullLayout.activeshape.opacity); var m = l.append("g").classed("shape-group", !0).attr({ "data-index": t }), b = m.append("path").attr(c).style("opacity", u).call(Cv.stroke, h).call(Cv.fill, f).call(Ex.dashLine, p, g); O6(m, e, r), _p(e, t, r, m); var w; if ((y || e._context.edits.shapePosition) && (w = oQ(e.layout, "shapes", r)), y) { b.style({ cursor: "move" }); var _ = { element: b.node(), plotinfo: a, gd: e, editHelpers: w, hasText: r.label.text || r.label.texttemplate, isActiveShape: !0 // i.e. to enable controllers }, k = aQ(s, e); iQ(k, b, _); } else e._context.edits.shapePosition ? lQ(e, b, r, t, l, w) : r.editable === !0 && b.style( "pointer-events", v || Cv.opacity(f) * u <= 0.5 ? "stroke" : "all" ); b.node().addEventListener("click", function() { return sQ(e, b); }); } } function O6(e, t, n) { var r = (n.xref + n.yref).replace(/paper/g, "").replace(/[xyz][1-9]* *domain/g, ""); Ex.setClipUrl( e, r ? "clip" + t._fullLayout._uid + r : null, t ); } function lQ(e, t, n, r, a, i) { var o = 10, l = 10, s = n.xsizemode === "pixel", c = n.ysizemode === "pixel", u = n.type === "line", f = n.type === "path", h = i.modifyItem, g, p, v, y, m, b, w, _, k, T, O, M, C, I, j, P = rQ.select(t.node().parentNode), N = Ns.getFromId(e, n.xref), W = Ns.getRefType(n.xref), J = Ns.getFromId(e, n.yref), U = Ns.getRefType(n.yref), E = ra.getDataToPixel(e, N, !1, W), z = ra.getDataToPixel(e, J, !0, U), F = ra.getPixelToData(e, N, !1, W), q = ra.getPixelToData(e, J, !0, U), H = re(), K = { element: H.node(), gd: e, prepFn: ce, doneFn: B, clickFn: G }, Q; RT.init(K), H.node().onmousemove = X; function re() { return u ? te() : t; } function te() { var pe = 10, ye = Math.max(n.line.width, pe), Oe = a.append("g").attr("data-index", r).attr("drag-helper", !0); Oe.append("path").attr("d", t.attr("d")).style({ cursor: "move", "stroke-width": ye, "stroke-opacity": "0" // ensure not visible }); var Be = { "fill-opacity": "0" // ensure not visible }, Ie = Math.max(ye / 2, pe); return Oe.append("circle").attr({ "data-line-point": "start-point", cx: s ? E(n.xanchor) + n.x0 : E(n.x0), cy: c ? z(n.yanchor) - n.y0 : z(n.y0), r: Ie }).style(Be).classed("cursor-grab", !0), Oe.append("circle").attr({ "data-line-point": "end-point", cx: s ? E(n.xanchor) + n.x1 : E(n.x1), cy: c ? z(n.yanchor) - n.y1 : z(n.y1), r: Ie }).style(Be).classed("cursor-grab", !0), Oe; } function X(pe) { if (oh(e)) { Q = null; return; } if (u) pe.target.tagName === "path" ? Q = "move" : Q = pe.target.attributes["data-line-point"].value === "start-point" ? "resize-over-start-point" : "resize-over-end-point"; else { var ye = K.element.getBoundingClientRect(), Oe = ye.right - ye.left, Be = ye.bottom - ye.top, Ie = pe.clientX - ye.left, Fe = pe.clientY - ye.top, Re = !f && Oe > o && Be > l && !pe.shiftKey ? RT.getCursor(Ie / Oe, 1 - Fe / Be) : "move"; NT(t, Re), Q = Re.split("-")[0]; } } function ce(pe) { oh(e) || (s && (m = E(n.xanchor)), c && (b = z(n.yanchor)), n.type === "path" ? j = n.path : (g = s ? n.x0 : E(n.x0), p = c ? n.y0 : z(n.y0), v = s ? n.x1 : E(n.x1), y = c ? n.y1 : z(n.y1)), g < v ? (k = g, C = "x0", T = v, I = "x1") : (k = v, C = "x1", T = g, I = "x0"), !c && p < y || c && p > y ? (w = p, O = "y0", _ = y, M = "y1") : (w = y, O = "y1", _ = p, M = "y0"), X(pe), ae(a, n), ve(t, n, e), K.moveFn = Q === "move" ? Z : oe, K.altKey = pe.altKey); } function B() { oh(e) || (NT(t), ge(a), O6(t, e, n), S6.call("_guiRelayout", e, i.getUpdateObj())); } function G() { oh(e) || ge(a); } function Z(pe, ye) { if (n.type === "path") { var Oe = function(Fe) { return Fe; }, Be = Oe, Ie = Oe; s ? h("xanchor", n.xanchor = F(m + pe)) : (Be = function(Fe) { return F(E(Fe) + pe); }, N && N.type === "date" && (Be = ra.encodeDate(Be))), c ? h("yanchor", n.yanchor = q(b + ye)) : (Ie = function(Fe) { return q(z(Fe) + ye); }, J && J.type === "date" && (Ie = ra.encodeDate(Ie))), h("path", n.path = BT(j, Be, Ie)); } else s ? h("xanchor", n.xanchor = F(m + pe)) : (h("x0", n.x0 = F(g + pe)), h("x1", n.x1 = F(v + pe))), c ? h("yanchor", n.yanchor = q(b + ye)) : (h("y0", n.y0 = q(p + ye)), h("y1", n.y1 = q(y + ye))); t.attr("d", Fy(e, n)), ae(a, n), _p(e, r, n, P); } function oe(pe, ye) { if (f) { var Oe = function(ze) { return ze; }, Be = Oe, Ie = Oe; s ? h("xanchor", n.xanchor = F(m + pe)) : (Be = function(ze) { return F(E(ze) + pe); }, N && N.type === "date" && (Be = ra.encodeDate(Be))), c ? h("yanchor", n.yanchor = q(b + ye)) : (Ie = function(ze) { return q(z(ze) + ye); }, J && J.type === "date" && (Ie = ra.encodeDate(Ie))), h("path", n.path = BT(j, Be, Ie)); } else if (u) { if (Q === "resize-over-start-point") { var Fe = g + pe, Re = c ? p - ye : p + ye; h("x0", n.x0 = s ? Fe : F(Fe)), h("y0", n.y0 = c ? Re : q(Re)); } else if (Q === "resize-over-end-point") { var We = v + pe, Ce = c ? y - ye : y + ye; h("x1", n.x1 = s ? We : F(We)), h("y1", n.y1 = c ? Ce : q(Ce)); } } else { var Ve = function(ze) { return Q.indexOf(ze) !== -1; }, Ke = Ve("n"), Xe = Ve("s"), ct = Ve("w"), vt = Ve("e"), lt = Ke ? w + ye : w, ut = Xe ? _ + ye : _, dt = ct ? k + pe : k, Pe = vt ? T + pe : T; c && (Ke && (lt = w - ye), Xe && (ut = _ - ye)), (!c && ut - lt > l || c && lt - ut > l) && (h(O, n[O] = c ? lt : q(lt)), h(M, n[M] = c ? ut : q(ut))), Pe - dt > o && (h(C, n[C] = s ? dt : F(dt)), h(I, n[I] = s ? Pe : F(Pe))); } t.attr("d", Fy(e, n)), ae(a, n), _p(e, r, n, P); } function ae(pe, ye) { (s || c) && Oe(); function Oe() { var Be = ye.type !== "path", Ie = pe.selectAll(".visual-cue").data([0]), Fe = 1; Ie.enter().append("path").attr({ fill: "#fff", "fill-rule": "evenodd", stroke: "#000", "stroke-width": Fe }).classed("visual-cue", !0); var Re = E( s ? ye.xanchor : PT.midRange( Be ? [ye.x0, ye.x1] : ra.extractPathCoords(ye.path, Rl.paramIsX) ) ), We = z( c ? ye.yanchor : PT.midRange( Be ? [ye.y0, ye.y1] : ra.extractPathCoords(ye.path, Rl.paramIsY) ) ); if (Re = ra.roundPositionForSharpStrokeRendering(Re, Fe), We = ra.roundPositionForSharpStrokeRendering(We, Fe), s && c) { var Ce = "M" + (Re - 1 - Fe) + "," + (We - 1 - Fe) + "h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z"; Ie.attr("d", Ce); } else if (s) { var Ve = "M" + (Re - 1 - Fe) + "," + (We - 9 - Fe) + "v18 h2 v-18 Z"; Ie.attr("d", Ve); } else { var Ke = "M" + (Re - 9 - Fe) + "," + (We - 1 - Fe) + "h18 v2 h-18 Z"; Ie.attr("d", Ke); } } } function ge(pe) { pe.selectAll(".visual-cue").remove(); } function ve(pe, ye, Oe) { var Be = ye.xref, Ie = ye.yref, Fe = Ns.getFromId(Oe, Be), Re = Ns.getFromId(Oe, Ie), We = ""; Be !== "paper" && !Fe.autorange && (We += Be), Ie !== "paper" && !Re.autorange && (We += Ie), Ex.setClipUrl( pe, We ? "clip" + Oe._fullLayout._uid + We : null, Oe ); } } function BT(e, t, n) { return e.replace(Rl.segmentRE, function(r) { var a = 0, i = r.charAt(0), o = Rl.paramIsX[i], l = Rl.paramIsY[i], s = Rl.numParams[i], c = r.substr(1).replace(Rl.paramRE, function(u) { return a >= s || (o[a] ? u = t(u) : l[a] && (u = n(u)), a++), u; }); return i + c; }); } function sQ(e, t) { if (B0(e)) { var n = t.node(), r = +n.getAttribute("data-index"); if (r >= 0) { if (r === e._fullLayout._activeShapeIndex) { HT(e); return; } e._fullLayout._activeShapeIndex = r, e._fullLayout._deactivateShape = HT, Px(e); } } } function HT(e) { if (B0(e)) { var t = e._fullLayout._activeShapeIndex; t >= 0 && (C6(e), delete e._fullLayout._activeShapeIndex, Px(e)); } } function cQ(e) { if (B0(e)) { C6(e); var t = e._fullLayout._activeShapeIndex, n = (e.layout || {}).shapes || []; if (t < n.length) { for (var r = [], a = 0; a < n.length; a++) a !== t && r.push(n[a]); return delete e._fullLayout._activeShapeIndex, S6.call("_guiRelayout", e, { shapes: r }); } } } var Ka = Rt, D6 = kr, F6 = mr, gn = Cx, uQ = jx.eraseActiveShape, ac = Ue, ln = ac._, vn = v6.exports = {}; vn.toImage = { name: "toImage", title: function(e) { var t = e._context.toImageButtonOptions || {}, n = t.format || "png"; return n === "png" ? ln(e, "Download plot as a png") : ( // legacy text ln(e, "Download plot") ); }, icon: gn.camera, click: function(e) { var t = e._context.toImageButtonOptions, n = { format: t.format || "png" }; ac.notifier(ln(e, "Taking snapshot - this may take a few seconds"), "long"), n.format !== "svg" && ac.isIE() && (ac.notifier(ln(e, "IE only supports svg. Changing format to svg."), "long"), n.format = "svg"), ["filename", "width", "height", "scale"].forEach(function(r) { r in t && (n[r] = t[r]); }), Ka.call("downloadImage", e, n).then(function(r) { ac.notifier(ln(e, "Snapshot succeeded") + " - " + r, "long"); }).catch(function() { ac.notifier(ln(e, "Sorry, there was a problem downloading your snapshot!"), "long"); }); } }; vn.sendDataToCloud = { name: "sendDataToCloud", title: function(e) { return ln(e, "Edit in Chart Studio"); }, icon: gn.disk, click: function(e) { D6.sendDataToCloud(e); } }; vn.editInChartStudio = { name: "editInChartStudio", title: function(e) { return ln(e, "Edit in Chart Studio"); }, icon: gn.pencil, click: function(e) { D6.sendDataToCloud(e); } }; vn.zoom2d = { name: "zoom2d", _cat: "zoom", title: function(e) { return ln(e, "Zoom"); }, attr: "dragmode", val: "zoom", icon: gn.zoombox, click: Hr }; vn.pan2d = { name: "pan2d", _cat: "pan", title: function(e) { return ln(e, "Pan"); }, attr: "dragmode", val: "pan", icon: gn.pan, click: Hr }; vn.select2d = { name: "select2d", _cat: "select", title: function(e) { return ln(e, "Box Select"); }, attr: "dragmode", val: "select", icon: gn.selectbox, click: Hr }; vn.lasso2d = { name: "lasso2d", _cat: "lasso", title: function(e) { return ln(e, "Lasso Select"); }, attr: "dragmode", val: "lasso", icon: gn.lasso, click: Hr }; vn.drawclosedpath = { name: "drawclosedpath", title: function(e) { return ln(e, "Draw closed freeform"); }, attr: "dragmode", val: "drawclosedpath", icon: gn.drawclosedpath, click: Hr }; vn.drawopenpath = { name: "drawopenpath", title: function(e) { return ln(e, "Draw open freeform"); }, attr: "dragmode", val: "drawopenpath", icon: gn.drawopenpath, click: Hr }; vn.drawline = { name: "drawline", title: function(e) { return ln(e, "Draw line"); }, attr: "dragmode", val: "drawline", icon: gn.drawline, click: Hr }; vn.drawrect = { name: "drawrect", title: function(e) { return ln(e, "Draw rectangle"); }, attr: "dragmode", val: "drawrect", icon: gn.drawrect, click: Hr }; vn.drawcircle = { name: "drawcircle", title: function(e) { return ln(e, "Draw circle"); }, attr: "dragmode", val: "drawcircle", icon: gn.drawcircle, click: Hr }; vn.eraseshape = { name: "eraseshape", title: function(e) { return ln(e, "Erase active shape"); }, icon: gn.eraseshape, click: uQ }; vn.zoomIn2d = { name: "zoomIn2d", _cat: "zoomin", title: function(e) { return ln(e, "Zoom in"); }, attr: "zoom", val: "in", icon: gn.zoom_plus, click: Hr }; vn.zoomOut2d = { name: "zoomOut2d", _cat: "zoomout", title: function(e) { return ln(e, "Zoom out"); }, attr: "zoom", val: "out", icon: gn.zoom_minus, click: Hr }; vn.autoScale2d = { name: "autoScale2d", _cat: "autoscale", title: function(e) { return ln(e, "Autoscale"); }, attr: "zoom", val: "auto", icon: gn.autoscale, click: Hr }; vn.resetScale2d = { name: "resetScale2d", _cat: "resetscale", title: function(e) { return ln(e, "Reset axes"); }, attr: "zoom", val: "reset", icon: gn.home, click: Hr }; vn.hoverClosestCartesian = { name: "hoverClosestCartesian", _cat: "hoverclosest", title: function(e) { return ln(e, "Show closest data on hover"); }, attr: "hovermode", val: "closest", icon: gn.tooltip_basic, gravity: "ne", click: Hr }; vn.hoverCompareCartesian = { name: "hoverCompareCartesian", _cat: "hoverCompare", title: function(e) { return ln(e, "Compare data on hover"); }, attr: "hovermode", val: function(e) { return e._fullLayout._isHoriz ? "y" : "x"; }, icon: gn.tooltip_compare, gravity: "ne", click: Hr }; function Hr(e, t) { var n = t.currentTarget, r = n.getAttribute("data-attr"), a = n.getAttribute("data-val") || !0, i = e._fullLayout, o = {}, l = F6.list(e, null, !0), s = i._cartesianSpikesEnabled, c, u; if (r === "zoom") { var f = a === "in" ? 0.5 : 2, h = (1 + f) / 2, g = (1 - f) / 2, p; for (u = 0; u < l.length; u++) if (c = l[u], !c.fixedrange) if (p = c._name, a === "auto") o[p + ".autorange"] = !0; else if (a === "reset") c._rangeInitial0 === void 0 && c._rangeInitial1 === void 0 ? o[p + ".autorange"] = !0 : c._rangeInitial0 === void 0 ? (o[p + ".autorange"] = c._autorangeInitial, o[p + ".range"] = [null, c._rangeInitial1]) : c._rangeInitial1 === void 0 ? (o[p + ".range"] = [c._rangeInitial0, null], o[p + ".autorange"] = c._autorangeInitial) : o[p + ".range"] = [c._rangeInitial0, c._rangeInitial1], c._showSpikeInitial !== void 0 && (o[p + ".showspikes"] = c._showSpikeInitial, s === "on" && !c._showSpikeInitial && (s = "off")); else { var v = [ c.r2l(c.range[0]), c.r2l(c.range[1]) ], y = [ h * v[0] + g * v[1], h * v[1] + g * v[0] ]; o[p + ".range[0]"] = c.l2r(y[0]), o[p + ".range[1]"] = c.l2r(y[1]); } } else r === "hovermode" && (a === "x" || a === "y") && (a = i._isHoriz ? "y" : "x", n.setAttribute("data-val", a)), o[r] = a; i._cartesianSpikesEnabled = s, Ka.call("_guiRelayout", e, o); } vn.zoom3d = { name: "zoom3d", _cat: "zoom", title: function(e) { return ln(e, "Zoom"); }, attr: "scene.dragmode", val: "zoom", icon: gn.zoombox, click: H0 }; vn.pan3d = { name: "pan3d", _cat: "pan", title: function(e) { return ln(e, "Pan"); }, attr: "scene.dragmode", val: "pan", icon: gn.pan, click: H0 }; vn.orbitRotation = { name: "orbitRotation", title: function(e) { return ln(e, "Orbital rotation"); }, attr: "scene.dragmode", val: "orbit", icon: gn["3d_rotate"], click: H0 }; vn.tableRotation = { name: "tableRotation", title: function(e) { return ln(e, "Turntable rotation"); }, attr: "scene.dragmode", val: "turntable", icon: gn["z-axis"], click: H0 }; function H0(e, t) { for (var n = t.currentTarget, r = n.getAttribute("data-attr"), a = n.getAttribute("data-val") || !0, i = e._fullLayout._subplots.gl3d || [], o = {}, l = r.split("."), s = 0; s < i.length; s++) o[i[s] + "." + l[1]] = a; var c = a === "pan" ? a : "zoom"; o.dragmode = c, Ka.call("_guiRelayout", e, o); } vn.resetCameraDefault3d = { name: "resetCameraDefault3d", _cat: "resetCameraDefault", title: function(e) { return ln(e, "Reset camera to default"); }, attr: "resetDefault", icon: gn.home, click: Rx }; vn.resetCameraLastSave3d = { name: "resetCameraLastSave3d", _cat: "resetCameraLastSave", title: function(e) { return ln(e, "Reset camera to last save"); }, attr: "resetLastSave", icon: gn.movie, click: Rx }; function Rx(e, t) { for (var n = t.currentTarget, r = n.getAttribute("data-attr"), a = r === "resetLastSave", i = r === "resetDefault", o = e._fullLayout, l = o._subplots.gl3d || [], s = {}, c = 0; c < l.length; c++) { var u = l[c], f = u + ".camera", h = u + ".aspectratio", g = u + ".aspectmode", p = o[u]._scene, v; a ? (s[f + ".up"] = p.viewInitial.up, s[f + ".eye"] = p.viewInitial.eye, s[f + ".center"] = p.viewInitial.center, v = !0) : i && (s[f + ".up"] = null, s[f + ".eye"] = null, s[f + ".center"] = null, v = !0), v && (s[h + ".x"] = p.viewInitial.aspectratio.x, s[h + ".y"] = p.viewInitial.aspectratio.y, s[h + ".z"] = p.viewInitial.aspectratio.z, s[g] = p.viewInitial.aspectmode); } Ka.call("_guiRelayout", e, s); } vn.hoverClosest3d = { name: "hoverClosest3d", _cat: "hoverclosest", title: function(e) { return ln(e, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: !0, icon: gn.tooltip_basic, gravity: "ne", click: dQ }; function I6(e, t) { var n = t.currentTarget, r = n._previousVal, a = e._fullLayout, i = a._subplots.gl3d || [], o = ["xaxis", "yaxis", "zaxis"], l = {}, s = {}; if (r) s = r, n._previousVal = null; else { for (var c = 0; c < i.length; c++) { var u = i[c], f = a[u], h = u + ".hovermode"; l[h] = f.hovermode, s[h] = !1; for (var g = 0; g < 3; g++) { var p = o[g], v = u + "." + p + ".showspikes"; s[v] = !1, l[v] = f[p].showspikes; } } n._previousVal = l; } return s; } function dQ(e, t) { var n = I6(e, t); Ka.call("_guiRelayout", e, n); } vn.zoomInGeo = { name: "zoomInGeo", _cat: "zoomin", title: function(e) { return ln(e, "Zoom in"); }, attr: "zoom", val: "in", icon: gn.zoom_plus, click: Nx }; vn.zoomOutGeo = { name: "zoomOutGeo", _cat: "zoomout", title: function(e) { return ln(e, "Zoom out"); }, attr: "zoom", val: "out", icon: gn.zoom_minus, click: Nx }; vn.resetGeo = { name: "resetGeo", _cat: "reset", title: function(e) { return ln(e, "Reset"); }, attr: "reset", val: null, icon: gn.autoscale, click: Nx }; vn.hoverClosestGeo = { name: "hoverClosestGeo", _cat: "hoverclosest", title: function(e) { return ln(e, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: !0, icon: gn.tooltip_basic, gravity: "ne", click: Bx }; function Nx(e, t) { for (var n = t.currentTarget, r = n.getAttribute("data-attr"), a = n.getAttribute("data-val") || !0, i = e._fullLayout, o = i._subplots.geo || [], l = 0; l < o.length; l++) { var s = o[l], c = i[s]; if (r === "zoom") { var u = c.projection.scale, f = a === "in" ? 2 * u : 0.5 * u; Ka.call("_guiRelayout", e, s + ".projection.scale", f); } } r === "reset" && kp(e, "geo"); } vn.hoverClosestGl2d = { name: "hoverClosestGl2d", _cat: "hoverclosest", title: function(e) { return ln(e, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: !0, icon: gn.tooltip_basic, gravity: "ne", click: Bx }; vn.hoverClosestPie = { name: "hoverClosestPie", _cat: "hoverclosest", title: function(e) { return ln(e, "Toggle show closest data on hover"); }, attr: "hovermode", val: "closest", icon: gn.tooltip_basic, gravity: "ne", click: Bx }; function z6(e) { var t = e._fullLayout; return t.hovermode ? !1 : t._has("cartesian") ? t._isHoriz ? "y" : "x" : "closest"; } function Bx(e) { var t = z6(e); Ka.call("_guiRelayout", e, "hovermode", t); } vn.resetViewSankey = { name: "resetSankeyGroup", title: function(e) { return ln(e, "Reset view"); }, icon: gn.home, click: function(e) { for (var t = { "node.groups": [], "node.x": [], "node.y": [] }, n = 0; n < e._fullData.length; n++) { var r = e._fullData[n]._viewInitial; t["node.groups"].push(r.node.groups.slice()), t["node.x"].push(r.node.x.slice()), t["node.y"].push(r.node.y.slice()); } Ka.call("restyle", e, t); } }; vn.toggleHover = { name: "toggleHover", title: function(e) { return ln(e, "Toggle show closest data on hover"); }, attr: "hovermode", val: null, toggle: !0, icon: gn.tooltip_basic, gravity: "ne", click: function(e, t) { var n = I6(e, t); n.hovermode = z6(e), Ka.call("_guiRelayout", e, n); } }; vn.resetViews = { name: "resetViews", title: function(e) { return ln(e, "Reset views"); }, icon: gn.home, click: function(e, t) { var n = t.currentTarget; n.setAttribute("data-attr", "zoom"), n.setAttribute("data-val", "reset"), Hr(e, t), n.setAttribute("data-attr", "resetLastSave"), Rx(e, t), kp(e, "geo"), kp(e, "mapbox"); } }; vn.toggleSpikelines = { name: "toggleSpikelines", title: function(e) { return ln(e, "Toggle Spike Lines"); }, icon: gn.spikeline, attr: "_cartesianSpikesEnabled", val: "on", click: function(e) { var t = e._fullLayout, n = t._cartesianSpikesEnabled; t._cartesianSpikesEnabled = n === "on" ? "off" : "on", Ka.call("_guiRelayout", e, fQ(e)); } }; function fQ(e) { for (var t = e._fullLayout, n = t._cartesianSpikesEnabled === "on", r = F6.list(e, null, !0), a = {}, i = 0; i < r.length; i++) { var o = r[i]; a[o._name + ".showspikes"] = n ? !0 : o._showSpikeInitial; } return a; } vn.resetViewMapbox = { name: "resetViewMapbox", _cat: "resetView", title: function(e) { return ln(e, "Reset view"); }, attr: "reset", icon: gn.home, click: function(e) { kp(e, "mapbox"); } }; vn.zoomInMapbox = { name: "zoomInMapbox", _cat: "zoomin", title: function(e) { return ln(e, "Zoom in"); }, attr: "zoom", val: "in", icon: gn.zoom_plus, click: E6 }; vn.zoomOutMapbox = { name: "zoomOutMapbox", _cat: "zoomout", title: function(e) { return ln(e, "Zoom out"); }, attr: "zoom", val: "out", icon: gn.zoom_minus, click: E6 }; function E6(e, t) { for (var n = t.currentTarget, r = n.getAttribute("data-val"), a = e._fullLayout, i = a._subplots.mapbox || [], o = 1.05, l = {}, s = 0; s < i.length; s++) { var c = i[s], u = a[c].zoom, f = r === "in" ? o * u : u / o; l[c + ".zoom"] = f; } Ka.call("_guiRelayout", e, l); } function kp(e, t) { for (var n = e._fullLayout, r = n._subplots[t] || [], a = {}, i = 0; i < r.length; i++) for (var o = r[i], l = n[o]._subplot, s = l.viewInitial, c = Object.keys(s), u = 0; u < c.length; u++) { var f = c[u]; a[o + "." + f] = s[f]; } Ka.call("_guiRelayout", e, a); } var j6 = v6.exports, P6 = j6, hQ = Object.keys(P6), R6 = [ "drawline", "drawopenpath", "drawclosedpath", "drawcircle", "drawrect", "eraseshape" ], N6 = [ "v1hovermode", "hoverclosest", "hovercompare", "togglehover", "togglespikelines" ].concat(R6), fc = [], pQ = function(e) { if (N6.indexOf(e._cat || e.name) === -1) { var t = e.name, n = (e._cat || e.name).toLowerCase(); fc.indexOf(t) === -1 && fc.push(t), fc.indexOf(n) === -1 && fc.push(n); } }; hQ.forEach(function(e) { pQ(P6[e]); }); fc.sort(); var B6 = { DRAW_MODES: R6, backButtons: N6, foreButtons: fc }, VT = B6, H6 = { editType: "modebar", orientation: { valType: "enumerated", values: ["v", "h"], dflt: "h", editType: "modebar", description: "Sets the orientation of the modebar." }, bgcolor: { valType: "color", editType: "modebar", description: "Sets the background color of the modebar." }, color: { valType: "color", editType: "modebar", description: "Sets the color of the icons in the modebar." }, activecolor: { valType: "color", editType: "modebar", description: "Sets the color of the active or hovered on icons in the modebar." }, uirevision: { valType: "any", editType: "none", description: [ "Controls persistence of user-driven changes related to the modebar,", "including `hovermode`, `dragmode`, and `showspikes` at both the", "root level and inside subplots. Defaults to `layout.uirevision`." ].join(" ") }, add: { valType: "string", arrayOk: !0, dflt: "", editType: "modebar", description: [ "Determines which predefined modebar buttons to add.", "Please note that these buttons will only be shown if they are", "compatible with all trace types used in a graph.", "Similar to `config.modeBarButtonsToAdd` option.", "This may include *" + VT.backButtons.join("*, *") + "*." ].join(" ") }, remove: { valType: "string", arrayOk: !0, dflt: "", editType: "modebar", description: [ "Determines which predefined modebar buttons to remove.", "Similar to `config.modeBarButtonsToRemove` option.", "This may include *" + VT.foreButtons.join("*, *") + "*." ].join(" ") } }, gQ = Ue, Cu = rn, vQ = Sn, mQ = H6, yQ = function(e, t) { var n = e.modebar || {}, r = vQ.newContainer(t, "modebar"); function a(o, l) { return gQ.coerce(n, r, mQ, o, l); } a("orientation"), a("bgcolor", Cu.addOpacity(t.paper_bgcolor, 0.5)); var i = Cu.contrast(Cu.rgb(t.modebar.bgcolor)); a("color", Cu.addOpacity(i, 0.3)), a("activecolor", Cu.addOpacity(i, 0.7)), a("uirevision", t.uirevision), a("add"), a("remove"); }, Hx = sn, xQ = cn, po = Ue, V6 = Cx, bQ = a0.version, wQ = new DOMParser(); function q6(e) { this.container = e.container, this.element = document.createElement("div"), this.update(e.graphInfo, e.buttons), this.container.appendChild(this.element); } var eo = q6.prototype; eo.update = function(e, t) { this.graphInfo = e; var n = this.graphInfo._context, r = this.graphInfo._fullLayout, a = "modebar-" + r._uid; this.element.setAttribute("id", a), this._uid = a, this.element.className = "modebar", n.displayModeBar === "hover" && (this.element.className += " modebar--hover ease-bg"), r.modebar.orientation === "v" && (this.element.className += " vertical", t = t.reverse()); var i = r.modebar, o = n.displayModeBar === "hover" ? ".js-plotly-plot .plotly:hover " : ""; po.deleteRelatedStyleRule(a), po.addRelatedStyleRule(a, o + "#" + a + " .modebar-group", "background-color: " + i.bgcolor), po.addRelatedStyleRule(a, "#" + a + " .modebar-btn .icon path", "fill: " + i.color), po.addRelatedStyleRule(a, "#" + a + " .modebar-btn:hover .icon path", "fill: " + i.activecolor), po.addRelatedStyleRule(a, "#" + a + " .modebar-btn.active .icon path", "fill: " + i.activecolor); var l = !this.hasButtons(t), s = this.hasLogo !== n.displaylogo, c = this.locale !== n.locale; if (this.locale = n.locale, (l || s || c) && (this.removeAllButtons(), this.updateButtons(t), n.watermark || n.displaylogo)) { var u = this.getLogo(); n.watermark && (u.className = u.className + " watermark"), r.modebar.orientation === "v" ? this.element.insertBefore(u, this.element.childNodes[0]) : this.element.appendChild(u), this.hasLogo = !0; } this.updateActiveButton(); }; eo.updateButtons = function(e) { var t = this; this.buttons = e, this.buttonElements = [], this.buttonsNames = [], this.buttons.forEach(function(n) { var r = t.createGroup(); n.forEach(function(a) { var i = a.name; if (!i) throw new Error("must provide button 'name' in button config"); if (t.buttonsNames.indexOf(i) !== -1) throw new Error("button name '" + i + "' is taken"); t.buttonsNames.push(i); var o = t.createButton(a); t.buttonElements.push(o), r.appendChild(o); }), t.element.appendChild(r); }); }; eo.createGroup = function() { var e = document.createElement("div"); return e.className = "modebar-group", e; }; eo.createButton = function(e) { var t = this, n = document.createElement("a"); n.setAttribute("rel", "tooltip"), n.className = "modebar-btn"; var r = e.title; r === void 0 ? r = e.name : typeof r == "function" && (r = r(this.graphInfo)), (r || r === 0) && n.setAttribute("data-title", r), e.attr !== void 0 && n.setAttribute("data-attr", e.attr); var a = e.val; a !== void 0 && (typeof a == "function" && (a = a(this.graphInfo)), n.setAttribute("data-val", a)); var i = e.click; if (typeof i != "function") throw new Error("must provide button 'click' function in button config"); n.addEventListener("click", function(l) { e.click(t.graphInfo, l), t.updateActiveButton(l.currentTarget); }), n.setAttribute("data-toggle", e.toggle || !1), e.toggle && Hx.select(n).classed("active", !0); var o = e.icon; return typeof o == "function" ? n.appendChild(o()) : n.appendChild(this.createIcon(o || V6.question)), n.setAttribute("data-gravity", e.gravity || "n"), n; }; eo.createIcon = function(e) { var t = xQ(e.height) ? Number(e.height) : e.ascent - e.descent, n = "http://www.w3.org/2000/svg", r; if (e.path) { r = document.createElementNS(n, "svg"), r.setAttribute("viewBox", [0, 0, e.width, t].join(" ")), r.setAttribute("class", "icon"); var a = document.createElementNS(n, "path"); a.setAttribute("d", e.path), e.transform ? a.setAttribute("transform", e.transform) : e.ascent !== void 0 && a.setAttribute("transform", "matrix(1 0 0 -1 0 " + e.ascent + ")"), r.appendChild(a); } if (e.svg) { var i = wQ.parseFromString(e.svg, "application/xml"); r = i.childNodes[0]; } return r.setAttribute("height", "1em"), r.setAttribute("width", "1em"), r; }; eo.updateActiveButton = function(e) { var t = this.graphInfo._fullLayout, n = e !== void 0 ? e.getAttribute("data-attr") : null; this.buttonElements.forEach(function(r) { var a = r.getAttribute("data-val") || !0, i = r.getAttribute("data-attr"), o = r.getAttribute("data-toggle") === "true", l = Hx.select(r); if (o) i === n && l.classed("active", !l.classed("active")); else { var s = i === null ? i : po.nestedProperty(t, i).get(); l.classed("active", s === a); } }); }; eo.hasButtons = function(e) { var t = this.buttons; if (!t || e.length !== t.length) return !1; for (var n = 0; n < e.length; ++n) { if (e[n].length !== t[n].length) return !1; for (var r = 0; r < e[n].length; r++) if (e[n][r].name !== t[n][r].name) return !1; } return !0; }; function _Q(e) { return e + " (v" + bQ + ")"; } eo.getLogo = function() { var e = this.createGroup(), t = document.createElement("a"); return t.href = "https://plotly.com/", t.target = "_blank", t.setAttribute("data-title", _Q(po._(this.graphInfo, "Produced with Plotly.js"))), t.className = "modebar-btn plotlyjsicon modebar-btn--logo", t.appendChild(this.createIcon(V6.newplotlylogo)), e.appendChild(t), e; }; eo.removeAllButtons = function() { for (; this.element.firstChild; ) this.element.removeChild(this.element.firstChild); this.hasLogo = !1; }; eo.destroy = function() { po.removeElement(this.container.querySelector(".modebar")), po.deleteRelatedStyleRule(this._uid); }; function kQ(e, t) { var n = e._fullLayout, r = new q6({ graphInfo: e, container: n._modebardiv.node(), buttons: t }); return n._privateplot && Hx.select(r.element).append("span").classed("badge-private float--left", !0).text("PRIVATE"), r; } var TQ = kQ, AQ = mr, qT = $a, Iy = Rt, MQ = Oo.isUnifiedHover, SQ = TQ, Tp = j6, CQ = B6.DRAW_MODES, LQ = Ue.extendDeep, OQ = function(e) { var t = e._fullLayout, n = e._context, r = t._modeBar; if (!n.displayModeBar && !n.watermark) { r && (r.destroy(), delete t._modeBar); return; } if (!Array.isArray(n.modeBarButtonsToRemove)) throw new Error([ "*modeBarButtonsToRemove* configuration options", "must be an array." ].join(" ")); if (!Array.isArray(n.modeBarButtonsToAdd)) throw new Error([ "*modeBarButtonsToAdd* configuration options", "must be an array." ].join(" ")); var a = n.modeBarButtons, i; Array.isArray(a) && a.length ? i = jQ(a) : !n.displayModeBar && n.watermark ? i = [] : i = DQ(e), r ? r.update(e, i) : t._modeBar = SQ(e, i); }; function DQ(e) { var t = e._fullLayout, n = e._fullData, r = e._context; function a(z, F) { if (typeof F == "string") { if (F.toLowerCase() === z.toLowerCase()) return !0; } else { var q = F.name, H = F._cat || F.name; if (q === z || H === z.toLowerCase()) return !0; } return !1; } var i = t.modebar.add; typeof i == "string" && (i = [i]); var o = t.modebar.remove; typeof o == "string" && (o = [o]); var l = r.modeBarButtonsToAdd.concat( i.filter(function(z) { for (var F = 0; F < r.modeBarButtonsToRemove.length; F++) if (a(z, r.modeBarButtonsToRemove[F])) return !1; return !0; }) ), s = r.modeBarButtonsToRemove.concat( o.filter(function(z) { for (var F = 0; F < r.modeBarButtonsToAdd.length; F++) if (a(z, r.modeBarButtonsToAdd[F])) return !1; return !0; }) ), c = t._has("cartesian"), u = t._has("gl3d"), f = t._has("geo"), h = t._has("pie"), g = t._has("funnelarea"), p = t._has("gl2d"), v = t._has("ternary"), y = t._has("mapbox"), m = t._has("polar"), b = t._has("smith"), w = t._has("sankey"), _ = FQ(t), k = MQ(t.hovermode), T = []; function O(z) { if (z.length) { for (var F = [], q = 0; q < z.length; q++) { for (var H = z[q], K = Tp[H], Q = K.name.toLowerCase(), re = (K._cat || K.name).toLowerCase(), te = !1, X = 0; X < s.length; X++) { var ce = s[X].toLowerCase(); if (ce === Q || ce === re) { te = !0; break; } } te || F.push(Tp[H]); } T.push(F); } } var M = ["toImage"]; r.showEditInChartStudio ? M.push("editInChartStudio") : r.showSendToCloud && M.push("sendDataToCloud"), O(M); var C = [], I = [], j = [], P = []; (c || p || h || g || v) + f + u + y + m + b > 1 ? (I = ["toggleHover"], j = ["resetViews"]) : f ? (C = ["zoomInGeo", "zoomOutGeo"], I = ["hoverClosestGeo"], j = ["resetGeo"]) : u ? (I = ["hoverClosest3d"], j = ["resetCameraDefault3d", "resetCameraLastSave3d"]) : y ? (C = ["zoomInMapbox", "zoomOutMapbox"], I = ["toggleHover"], j = ["resetViewMapbox"]) : p ? I = ["hoverClosestGl2d"] : h ? I = ["hoverClosestPie"] : w ? (I = ["hoverClosestCartesian", "hoverCompareCartesian"], j = ["resetViewSankey"]) : I = ["toggleHover"], c && (I = ["toggleSpikelines", "hoverClosestCartesian", "hoverCompareCartesian"]), (zQ(n) || k) && (I = []), (c || p) && !_ && (C = ["zoomIn2d", "zoomOut2d", "autoScale2d"], j[0] !== "resetViews" && (j = ["resetScale2d"])), u ? P = ["zoom3d", "pan3d", "orbitRotation", "tableRotation"] : (c || p) && !_ || v ? P = ["zoom2d", "pan2d"] : y || f ? P = ["pan2d"] : m && (P = ["zoom2d"]), IQ(n) && P.push("select2d", "lasso2d"); var N = [], W = function(z) { N.indexOf(z) === -1 && I.indexOf(z) !== -1 && N.push(z); }; if (Array.isArray(l)) { for (var J = [], U = 0; U < l.length; U++) { var E = l[U]; typeof E == "string" ? (E = E.toLowerCase(), CQ.indexOf(E) !== -1 ? (t._has("mapbox") || // draw shapes in paper coordinate (could be improved in future to support data coordinate, when there is no pitch) t._has("cartesian")) && P.push(E) : E === "togglespikelines" ? W("toggleSpikelines") : E === "togglehover" ? W("toggleHover") : E === "hovercompare" ? W("hoverCompareCartesian") : E === "hoverclosest" ? (W("hoverClosestCartesian"), W("hoverClosestGeo"), W("hoverClosest3d"), W("hoverClosestGl2d"), W("hoverClosestPie")) : E === "v1hovermode" && (W("toggleHover"), W("hoverClosestCartesian"), W("hoverCompareCartesian"), W("hoverClosestGeo"), W("hoverClosest3d"), W("hoverClosestGl2d"), W("hoverClosestPie"))) : J.push(E); } l = J; } return O(P), O(C.concat(j)), O(N), EQ(T, l); } function FQ(e) { for (var t = AQ.list({ _fullLayout: e }, null, !0), n = 0; n < t.length; n++) if (!t[n].fixedrange) return !1; return !0; } function IQ(e) { for (var t = !1, n = 0; n < e.length && !t; n++) { var r = e[n]; !r._module || !r._module.selectPoints || (Iy.traceIs(r, "scatter-like") ? (qT.hasMarkers(r) || qT.hasText(r)) && (t = !0) : Iy.traceIs(r, "box-violin") ? (r.boxpoints === "all" || r.points === "all") && (t = !0) : t = !0); } return t; } function zQ(e) { for (var t = 0; t < e.length; t++) if (!Iy.traceIs(e[t], "noHover")) return !1; return !0; } function EQ(e, t) { if (t.length) if (Array.isArray(t[0])) for (var n = 0; n < t.length; n++) e.push(t[n]); else e.push(t); return e; } function jQ(e) { for (var t = LQ([], e), n = 0; n < t.length; n++) for (var r = t[n], a = 0; a < r.length; a++) { var i = r[a]; if (typeof i == "string") if (Tp[i] !== void 0) t[n][a] = Tp[i]; else throw new Error([ "*modeBarButtons* configuration options", "invalid button name" ].join(" ")); } return t; } var U6 = { moduleType: "component", name: "modebar", layoutAttributes: H6, supplyLayoutDefaults: yQ, manage: OQ }, _l = {}, PQ = Nr.FROM_BL, G6 = function(e, t, n) { n === void 0 && (n = PQ[e.constraintoward || "center"]); var r = [e.r2l(e.range[0]), e.r2l(e.range[1])], a = r[0] + (r[1] - r[0]) * n; e.range = e._input.range = [ e.l2r(a + (r[0] - a) * t), e.l2r(a + (r[1] - a) * t) ], e.setScale(); }, jl = Ue, Lv = L0, li = mr.id2name, RQ = Ji, UT = G6, NQ = px, BQ = er.ALMOST_EQUAL, HQ = Nr.FROM_BL; _l.handleDefaults = function(e, t, n) { var r = n.axIds, a = n.axHasImage, i = t._axisConstraintGroups = [], o = t._axisMatchGroups = [], l, s, c, u, f, h, g, p; for (l = 0; l < r.length; l++) u = li(r[l]), f = e[u], h = t[u], VQ(f, h, { axIds: r, layoutOut: t, hasImage: a[u] }); function v(M, C) { for (l = 0; l < M.length; l++) { s = M[l]; for (c in s) t[li(c)][C] = s; } } for (v(o, "_matchGroup"), l = 0; l < i.length; l++) { s = i[l]; for (c in s) if (h = t[li(c)], h.fixedrange) { for (var y in s) { var m = li(y); (e[m] || {}).fixedrange === !1 && jl.warn( "fixedrange was specified as false for axis " + m + " but was overridden because another axis in its constraint group has fixedrange true" ), t[m].fixedrange = !0; } break; } } for (l = 0; l < i.length; ) { s = i[l]; for (c in s) { h = t[li(c)], h._matchGroup && Object.keys(h._matchGroup).length === Object.keys(s).length && (i.splice(l, 1), l--); break; } l++; } v(i, "_constraintGroup"); var b = [ "constrain", "range", "autorange", "rangemode", "rangebreaks", "categoryorder", "categoryarray" ], w = !1, _ = !1; function k() { p = h[g], g === "rangebreaks" && (_ = h._hasDayOfWeekBreaks); } for (l = 0; l < o.length; l++) { s = o[l]; for (var T = 0; T < b.length; T++) { g = b[T], p = null; var O; for (c in s) if (u = li(c), f = e[u], h = t[u], g in h) { if (!h.matches && (O = h, g in f)) { k(); break; } p === null && g in f && k(); } if (g === "range" && p && f.range && f.range.length === 2 && f.range[0] !== null && f.range[1] !== null && (w = !0), g === "autorange" && p === null && w && (p = !1), p === null && g in O && (p = O[g]), p !== null) for (c in s) h = t[li(c)], h[g] = g === "range" ? p.slice() : p, g === "rangebreaks" && (h._hasDayOfWeekBreaks = _, NQ(h, t)); } } }; function VQ(e, t, n) { var r = n.axIds, a = n.layoutOut, i = n.hasImage, o = a._axisConstraintGroups, l = a._axisMatchGroups, s = t._id, c = s.charAt(0), u = ((a._splomAxes || {})[c] || {})[s] || {}, f = t._id, h = f.charAt(0) === "x"; t._matchGroup = null, t._constraintGroup = null; function g(P, N) { return jl.coerce(e, t, RQ, P, N); } g("constrain", i ? "domain" : "range"), jl.coerce(e, t, { constraintoward: { valType: "enumerated", values: h ? ["left", "center", "right"] : ["bottom", "middle", "top"], dflt: h ? "center" : "middle" } }, "constraintoward"); var p = t.type, v, y, m = []; for (v = 0; v < r.length; v++) if (y = r[v], y !== f) { var b = a[li(y)]; b.type === p && m.push(y); } var w = W6(o, f); if (w) { var _ = []; for (v = 0; v < m.length; v++) y = m[v], w[y] || _.push(y); m = _; } var k = m.length, T, O; k && (e.matches || u.matches) && (T = jl.coerce(e, t, { matches: { valType: "enumerated", values: m, dflt: m.indexOf(u.matches) !== -1 ? u.matches : void 0 } }, "matches")); var M = i && !h ? t.anchor : void 0; if (k && !T && (e.scaleanchor || M) && (O = jl.coerce(e, t, { scaleanchor: { valType: "enumerated", values: m.concat([!1]) } }, "scaleanchor", M)), T) { t._matchGroup = Ov(l, f, T, 1); var C = a[li(T)], I = GT(a, t) / GT(a, C); h !== (T.charAt(0) === "x") && (I = (h ? "x" : "y") + I), Ov(o, f, T, I); } else e.matches && r.indexOf(e.matches) !== -1 && jl.warn("ignored " + t._name + '.matches: "' + e.matches + '" to avoid an infinite loop'); if (O) { var j = g("scaleratio"); j || (j = t.scaleratio = 1), Ov(o, f, O, j); } else e.scaleanchor && r.indexOf(e.scaleanchor) !== -1 && jl.warn("ignored " + t._name + '.scaleanchor: "' + e.scaleanchor + '" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.'); } function GT(e, t) { var n = t.domain; return n || (n = e[li(t.overlaying)].domain), n[1] - n[0]; } function W6(e, t) { for (var n = 0; n < e.length; n++) if (e[n][t]) return e[n]; return null; } function Ov(e, t, n, r) { var a, i, o, l, s, c = W6(e, t); c === null ? (c = {}, c[t] = 1, s = e.length, e.push(c)) : s = e.indexOf(c); var u = Object.keys(c); for (a = 0; a < e.length; a++) if (o = e[a], a !== s && o[n]) { var f = o[n]; for (i = 0; i < u.length; i++) l = u[i], o[l] = Dv(f, Dv(r, c[l])); e.splice(s, 1); return; } if (r !== 1) for (i = 0; i < u.length; i++) { var h = u[i]; c[h] = Dv(r, c[h]); } c[n] = 1; } function Dv(e, t) { var n = "", r = "", a, i; typeof e == "string" && (n = e.match(/^[xy]*/)[0], a = n.length, e = +e.substr(a)), typeof t == "string" && (r = t.match(/^[xy]*/)[0], i = r.length, t = +t.substr(i)); var o = e * t; return !a && !i ? o : !a || !i || n.charAt(0) === r.charAt(0) ? n + r + e * t : a === i ? o : (a > i ? n.substr(i) : r.substr(a)) + o; } function qQ(e, t) { for (var n = t._size, r = n.h / n.w, a = {}, i = Object.keys(e), o = 0; o < i.length; o++) { var l = i[o], s = e[l]; if (typeof s == "string") { var c = s.match(/^[xy]*/)[0], u = c.length; s = +s.substr(u); for (var f = c.charAt(0) === "y" ? r : 1 / r, h = 0; h < u; h++) s *= f; } a[l] = s; } return a; } _l.enforce = function(e) { var t = e._fullLayout, n = t._axisConstraintGroups || [], r, a, i, o, l, s, c, u; for (r = 0; r < n.length; r++) { i = qQ(n[r], t); var f = Object.keys(i), h = 1 / 0, g = 0, p = 1 / 0, v = {}, y = {}, m = !1; for (a = 0; a < f.length; a++) o = f[a], y[o] = l = t[li(o)], l._inputDomain ? l.domain = l._inputDomain.slice() : l._inputDomain = l.domain.slice(), l._inputRange || (l._inputRange = l.range.slice()), l.setScale(), v[o] = s = Math.abs(l._m) / i[o], h = Math.min(h, s), (l.constrain === "domain" || !l._constraintShrinkable) && (p = Math.min(p, s)), delete l._constraintShrinkable, g = Math.max(g, s), l.constrain === "domain" && (m = !0); if (!(h > BQ * g && !m)) { for (a = 0; a < f.length; a++) if (o = f[a], s = v[o], l = y[o], c = l.constrain, s !== p || c === "domain") if (u = s / p, c === "range") UT(l, u); else { var b = l._inputDomain, w = (l.domain[1] - l.domain[0]) / (b[1] - b[0]), _ = (l.r2l(l.range[1]) - l.r2l(l.range[0])) / (l.r2l(l._inputRange[1]) - l.r2l(l._inputRange[0])); if (u /= w, u * _ < 1) { l.domain = l._input.domain = b.slice(), UT(l, u); continue; } if (_ < 1 && (l.range = l._input.range = l._inputRange.slice(), u *= _), l.autorange) { var k = l.r2l(l.range[0]), T = l.r2l(l.range[1]), O = (k + T) / 2, M = O, C = O, I = Math.abs(T - O), j = O - I * u * 1.0001, P = O + I * u * 1.0001, N = Lv.makePadFn(t, l, 0), W = Lv.makePadFn(t, l, 1); WT(l, u); var J = Math.abs(l._m), U = Lv.concatExtremes(e, l), E = U.min, z = U.max, F, q; for (q = 0; q < E.length; q++) F = E[q].val - N(E[q]) / J, F > j && F < M && (M = F); for (q = 0; q < z.length; q++) F = z[q].val + W(z[q]) / J, F < P && F > C && (C = F); var H = (C - M) / (2 * I); u /= H, M = l.l2r(M), C = l.l2r(C), l.range = l._input.range = k < T ? [M, C] : [C, M]; } WT(l, u); } } } }; _l.getAxisGroup = function(e, t) { for (var n = e._axisMatchGroups, r = 0; r < n.length; r++) { var a = n[r]; if (a[t]) return "g" + r; } return t; }; _l.clean = function(e, t) { if (t._inputDomain) { for (var n = !1, r = t._id, a = e._fullLayout._axisConstraintGroups, i = 0; i < a.length; i++) if (a[i][r]) { n = !0; break; } (!n || t.constrain !== "domain") && (t._input.domain = t.domain = t._inputDomain, delete t._inputDomain); } }; function WT(e, t) { var n = e._inputDomain, r = HQ[e.constraintoward], a = n[0] + (n[1] - n[0]) * r; e.domain = e._input.domain = [ a + (n[0] - a) / t, a + (n[1] - a) / t ], e.setScale(); } (function(e) { var t = sn, n = Rt, r = kr, a = Ue, i = Ir, o = Sx, l = rn, s = Cn, c = C0, u = U6, f = Ln, h = Nr, g = _l, p = g.enforce, v = g.clean, y = L0.doAutoRange, m = "start", b = "middle", w = "end"; e.layoutStyles = function(z) { return a.syncOrAsync([r.doAutoMargin, k], z); }; function _(z, F, q) { for (var H = 0; H < q.length; H++) { var K = q[H][0], Q = q[H][1]; if (!(K[0] >= z[1] || K[1] <= z[0]) && Q[0] < F[1] && Q[1] > F[0]) return !0; } return !1; } function k(z) { var F = z._fullLayout, q = F._size, H = q.p, K = f.list(z, "", !0), Q, re, te, X, ce, B; if (F._paperdiv.style({ width: z._context.responsive && F.autosize && !z._context._hasZeroWidth && !z.layout.width ? "100%" : F.width + "px", height: z._context.responsive && F.autosize && !z._context._hasZeroHeight && !z.layout.height ? "100%" : F.height + "px" }).selectAll(".main-svg").call(s.setSize, F.width, F.height), z._context.setBackground(z, F.paper_bgcolor), e.drawMainTitle(z), u.manage(z), !F._has("cartesian")) return r.previousPromises(z); function G(ft, $e, Lt) { var $ = ft._lw / 2; if (ft._id.charAt(0) === "x") { if ($e) { if (Lt === "top") return $e._offset - H - $; } else return q.t + q.h * (1 - (ft.position || 0)) + $ % 1; return $e._offset + $e._length + H + $; } if ($e) { if (Lt === "right") return $e._offset + $e._length + H + $; } else return q.l + q.w * (ft.position || 0) + $ % 1; return $e._offset - H - $; } for (Q = 0; Q < K.length; Q++) { X = K[Q]; var Z = X._anchorAxis; X._linepositions = {}, X._lw = s.crispRound(z, X.linewidth, 1), X._mainLinePosition = G(X, Z, X.side), X._mainMirrorPosition = X.mirror && Z ? G( X, Z, h.OPPOSITE_SIDE[X.side] ) : null; } var oe = [], ae = [], ge = [], ve = l.opacity(F.paper_bgcolor) === 1 && l.opacity(F.plot_bgcolor) === 1 && F.paper_bgcolor === F.plot_bgcolor; for (re in F._plots) if (te = F._plots[re], te.mainplot) te.bg && te.bg.remove(), te.bg = void 0; else { var pe = te.xaxis.domain, ye = te.yaxis.domain, Oe = te.plotgroup; if (_(pe, ye, ge)) { var Be = Oe.node(), Ie = te.bg = a.ensureSingle(Oe, "rect", "bg"); Be.insertBefore(Ie.node(), Be.childNodes[0]), ae.push(re); } else Oe.select("rect.bg").remove(), ge.push([pe, ye]), ve || (oe.push(re), ae.push(re)); } var Fe = F._bgLayer.selectAll(".bg").data(oe); for (Fe.enter().append("rect").classed("bg", !0), Fe.exit().remove(), Fe.each(function(ft) { F._plots[ft].bg = t.select(this); }), Q = 0; Q < ae.length; Q++) te = F._plots[ae[Q]], ce = te.xaxis, B = te.yaxis, te.bg && ce._offset !== void 0 && B._offset !== void 0 && te.bg.call( s.setRect, ce._offset - H, B._offset - H, ce._length + 2 * H, B._length + 2 * H ).call(l.fill, F.plot_bgcolor).style("stroke-width", 0); if (!F._hasOnlyLargeSploms) for (re in F._plots) { te = F._plots[re], ce = te.xaxis, B = te.yaxis; var Re = te.clipId = "clip" + F._uid + re + "plot", We = a.ensureSingleById(F._clips, "clipPath", Re, function(ft) { ft.classed("plotclip", !0).append("rect"); }); te.clipRect = We.select("rect").attr({ width: ce._length, height: B._length }), s.setTranslate(te.plot, ce._offset, B._offset); var Ce, Ve; te._hasClipOnAxisFalse ? (Ce = null, Ve = Re) : (Ce = Re, Ve = null), s.setClipUrl(te.plot, Ce, z), te.layerClipId = Ve; } var Ke, Xe, ct, vt, lt, ut, dt, Pe, ze, Ne, nt, Qe, it; function rt(ft) { return "M" + Ke + "," + ft + "H" + Xe; } function bt(ft) { return "M" + ce._offset + "," + ft + "h" + ce._length; } function je(ft) { return "M" + ft + "," + Pe + "V" + dt; } function tt(ft) { return B._shift !== void 0 && (ft += B._shift), "M" + ft + "," + B._offset + "v" + B._length; } function pt(ft, $e, Lt) { if (!ft.showline || re !== ft._mainSubplot) return ""; if (!ft._anchorAxis) return Lt(ft._mainLinePosition); var $ = $e(ft._mainLinePosition); return ft.mirror && ($ += $e(ft._mainMirrorPosition)), $; } for (re in F._plots) { te = F._plots[re], ce = te.xaxis, B = te.yaxis; var kt = "M0,0"; T(ce, re) && (lt = M(ce, "left", B, K), Ke = ce._offset - (lt ? H + lt : 0), ut = M(ce, "right", B, K), Xe = ce._offset + ce._length + (ut ? H + ut : 0), ct = G(ce, B, "bottom"), vt = G(ce, B, "top"), it = !ce._anchorAxis || re !== ce._mainSubplot, it && (ce.mirror === "allticks" || ce.mirror === "all") && (ce._linepositions[re] = [ct, vt]), kt = pt(ce, rt, bt), it && ce.showline && (ce.mirror === "all" || ce.mirror === "allticks") && (kt += rt(ct) + rt(vt)), te.xlines.style("stroke-width", ce._lw + "px").call(l.stroke, ce.showline ? ce.linecolor : "rgba(0,0,0,0)")), te.xlines.attr("d", kt); var et = "M0,0"; T(B, re) && (nt = M(B, "bottom", ce, K), dt = B._offset + B._length + (nt ? H : 0), Qe = M(B, "top", ce, K), Pe = B._offset - (Qe ? H : 0), ze = G(B, ce, "left"), Ne = G(B, ce, "right"), it = !B._anchorAxis || re !== B._mainSubplot, it && (B.mirror === "allticks" || B.mirror === "all") && (B._linepositions[re] = [ze, Ne]), et = pt(B, je, tt), it && B.showline && (B.mirror === "all" || B.mirror === "allticks") && (et += je(ze) + je(Ne)), te.ylines.style("stroke-width", B._lw + "px").call(l.stroke, B.showline ? B.linecolor : "rgba(0,0,0,0)")), te.ylines.attr("d", et); } return f.makeClipPaths(z), r.previousPromises(z); } function T(z, F) { return (z.ticks || z.showline) && (F === z._mainSubplot || z.mirror === "all" || z.mirror === "allticks"); } function O(z, F, q) { if (!q.showline || !q._lw) return !1; if (q.mirror === "all" || q.mirror === "allticks") return !0; var H = q._anchorAxis; if (!H) return !1; var K = h.FROM_BL[F]; return q.side === F ? H.domain[K] === z.domain[K] : q.mirror && H.domain[1 - K] === z.domain[1 - K]; } function M(z, F, q, H) { if (O(z, F, q)) return q._lw; for (var K = 0; K < H.length; K++) { var Q = H[K]; if (Q._mainAxis === q._mainAxis && O(z, F, Q)) return Q._lw; } return 0; } e.drawMainTitle = function(z) { var F = z._fullLayout.title, q = z._fullLayout, H = U(q), K = E(q), Q = W(q, K), re = N(q, H); if (c.draw(z, "gtitle", { propContainer: q, propName: "title.text", placeholder: q._dfltTitle.plot, attributes: { x: re, y: Q, "text-anchor": H, dy: K } }), F.text && F.automargin) { var te = t.selectAll(".gtitle"), X = s.bBox(te.node()).height, ce = j(z, F, X); if (ce > 0) { P(z, Q, ce, X), te.attr({ x: re, y: Q, "text-anchor": H, dy: J(F.yanchor) }).call(i.positionText, re, Q); var B = (F.text.match(i.BR_TAG_ALL) || []).length; if (B) { var G = h.LINE_SPACING * B + h.MID_SHIFT; F.y === 0 && (G = -G), te.selectAll(".line").each(function() { var Z = +this.getAttribute("dy").slice(0, -2) - G + "em"; this.setAttribute("dy", Z); }); } } } }; function C(z, F, q, H, K) { var Q = F.yref === "paper" ? z._fullLayout._size.h : z._fullLayout.height, re = a.isTopAnchor(F) ? H : H - K, te = q === "b" ? Q - re : re; return a.isTopAnchor(F) && q === "t" || a.isBottomAnchor(F) && q === "b" ? !1 : te < K; } function I(z, F, q, H, K) { var Q = 0; return q === "middle" && (Q += K / 2), z === "t" ? (q === "top" && (Q += K), Q += H - F * H) : (q === "bottom" && (Q += K), Q += F * H), Q; } function j(z, F, q) { var H = F.y, K = F.yanchor, Q = H > 0.5 ? "t" : "b", re = z._fullLayout.margin[Q], te = 0; return F.yref === "paper" ? te = q + F.pad.t + F.pad.b : F.yref === "container" && (te = I(Q, H, K, z._fullLayout.height, q) + F.pad.t + F.pad.b), te > re ? te : 0; } function P(z, F, q, H) { var K = "title.automargin", Q = z._fullLayout.title, re = Q.y > 0.5 ? "t" : "b", te = { x: Q.x, y: Q.y, t: 0, b: 0 }, X = {}; Q.yref === "paper" && C(z, Q, re, F, H) ? te[re] = q : Q.yref === "container" && (X[re] = q, z._fullLayout._reservedMargin[K] = X), r.allowAutoMargin(z, K), r.autoMargin(z, K, te); } function N(z, F) { var q = z.title, H = z._size, K = 0; switch (F === m ? K = q.pad.l : F === w && (K = -q.pad.r), q.xref) { case "paper": return H.l + H.w * q.x + K; case "container": default: return z.width * q.x + K; } } function W(z, F) { var q = z.title, H = z._size, K = 0; if (F === "0em" || !F ? K = -q.pad.b : F === h.CAP_SHIFT + "em" && (K = q.pad.t), q.y === "auto") return H.t / 2; switch (q.yref) { case "paper": return H.t + H.h - H.h * q.y + K; case "container": default: return z.height - z.height * q.y + K; } } function J(z) { return z === "top" ? h.CAP_SHIFT + 0.3 + "em" : z === "bottom" ? "-0.3em" : h.MID_SHIFT + "em"; } function U(z) { var F = z.title, q = b; return a.isRightAnchor(F) ? q = w : a.isLeftAnchor(F) && (q = m), q; } function E(z) { var F = z.title, q = "0em"; return a.isTopAnchor(F) ? q = h.CAP_SHIFT + "em" : a.isMiddleAnchor(F) && (q = h.MID_SHIFT + "em"), q; } e.doTraceStyle = function(z) { var F = z.calcdata, q = [], H; for (H = 0; H < F.length; H++) { var K = F[H], Q = K[0] || {}, re = Q.trace || {}, te = re._module || {}, X = te.arraysToCalcdata; X && X(K, re); var ce = te.editStyle; ce && q.push({ fn: ce, cd0: Q }); } if (q.length) { for (H = 0; H < q.length; H++) { var B = q[H]; B.fn(z, B.cd0); } o(z), e.redrawReglTraces(z); } return r.style(z), n.getComponentMethod("legend", "draw")(z), r.previousPromises(z); }, e.doColorBars = function(z) { return n.getComponentMethod("colorbar", "draw")(z), r.previousPromises(z); }, e.layoutReplot = function(z) { var F = z.layout; return z.layout = void 0, n.call("_doPlot", z, "", F); }, e.doLegend = function(z) { return n.getComponentMethod("legend", "draw")(z), r.previousPromises(z); }, e.doTicksRelayout = function(z) { return f.draw(z, "redraw"), z._fullLayout._hasOnlyLargeSploms && (n.subplotsRegistry.splom.updateGrid(z), o(z), e.redrawReglTraces(z)), e.drawMainTitle(z), r.previousPromises(z); }, e.doModeBar = function(z) { var F = z._fullLayout; u.manage(z); for (var q = 0; q < F._basePlotModules.length; q++) { var H = F._basePlotModules[q].updateFx; H && H(z); } return r.previousPromises(z); }, e.doCamera = function(z) { for (var F = z._fullLayout, q = F._subplots.gl3d, H = 0; H < q.length; H++) { var K = F[q[H]], Q = K._scene; Q.setViewport(K); } }, e.drawData = function(z) { var F = z._fullLayout; o(z); for (var q = F._basePlotModules, H = 0; H < q.length; H++) q[H].plot(z); return e.redrawReglTraces(z), r.style(z), n.getComponentMethod("selections", "draw")(z), n.getComponentMethod("shapes", "draw")(z), n.getComponentMethod("annotations", "draw")(z), n.getComponentMethod("images", "draw")(z), F._replotting = !1, r.previousPromises(z); }, e.redrawReglTraces = function(z) { var F = z._fullLayout; if (F._has("regl")) { var q = z._fullData, H = [], K = [], Q, re; for (F._hasOnlyLargeSploms && F._splomGrid.draw(), Q = 0; Q < q.length; Q++) { var te = q[Q]; te.visible === !0 && te._length !== 0 && (te.type === "splom" ? F._splomScenes[te.uid].draw() : te.type === "scattergl" ? a.pushUnique(H, te.xaxis + te.yaxis) : te.type === "scatterpolargl" && a.pushUnique(K, te.subplot)); } for (Q = 0; Q < H.length; Q++) re = F._plots[H[Q]], re._scene && re._scene.draw(); for (Q = 0; Q < K.length; Q++) re = F[K[Q]]._subplot, re._scene && re._scene.draw(); } }, e.doAutoRangeAndConstraints = function(z) { for (var F = f.list(z, "", !0), q, H = {}, K = 0; K < F.length; K++) if (q = F[K], !H[q._id]) { H[q._id] = 1, v(z, q), y(z, q); var Q = q._matchGroup; if (Q) for (var re in Q) { var te = f.getFromId(z, re); y(z, te, q.range), H[re] = 1; } } p(z); }, e.finalDraw = function(z) { n.getComponentMethod("rangeslider", "draw")(z), n.getComponentMethod("rangeselector", "draw")(z); }, e.drawMarginPushers = function(z) { n.getComponentMethod("legend", "draw")(z), n.getComponentMethod("rangeselector", "draw")(z), n.getComponentMethod("sliders", "draw")(z), n.getComponentMethod("updatemenus", "draw")(z), n.getComponentMethod("colorbar", "draw")(z); }; })(j0); var UQ = bl.readPaths, GQ = zx, Z6 = xs.clearOutlineControllers, Fv = rn, Y6 = Cn, WQ = Sn.arrayEditor, $6 = wl, ZQ = $6.getPathString, K6 = { draw: V0, drawOne: J6, activateLastSelection: KQ }; function V0(e) { var t = e._fullLayout; Z6(e), t._selectionLayer.selectAll("path").remove(); for (var n in t._plots) { var r = t._plots[n].selectionLayer; r && r.selectAll("path").remove(); } for (var a = 0; a < t.selections.length; a++) J6(e, a); } function q0(e) { return e._context.editSelection; } function J6(e, t) { e._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="' + t + '"]').remove(); var n = $6.makeSelectionsOptionsAndPlotinfo(e, t), r = n.options, a = n.plotinfo; if (!r._input) return; i(e._fullLayout._selectionLayer); function i(o) { var l = ZQ(e, r), s = { "data-index": t, "fill-rule": "evenodd", d: l }, c = r.opacity, u = "rgba(0,0,0,0)", f = r.line.color || Fv.contrast(e._fullLayout.plot_bgcolor), h = r.line.width, g = r.line.dash; h || (h = 5, g = "solid"); var p = q0(e) && e._fullLayout._activeSelectionIndex === t; p && (u = e._fullLayout.activeselection.fillcolor, c = e._fullLayout.activeselection.opacity); for (var v = [], y = 1; y >= 0; y--) { var m = o.append("path").attr(s).style("opacity", y ? 0.1 : c).call(Fv.stroke, f).call(Fv.fill, u).call( Y6.dashLine, y ? "solid" : g, y ? 4 + h : h ); if (YQ(m, e, r), p) { var b = WQ(e.layout, "selections", r); m.style({ cursor: "move" }); var w = { element: m.node(), plotinfo: a, gd: e, editHelpers: b, isActiveSelection: !0 // i.e. to enable controllers }, _ = UQ(l, e); GQ(_, m, w); } else m.style("pointer-events", y ? "all" : "none"); v[y] = m; } var k = v[0], T = v[1]; T.node().addEventListener("click", function() { return $Q(e, k); }); } } function YQ(e, t, n) { var r = n.xref + n.yref; Y6.setClipUrl( e, "clip" + t._fullLayout._uid + r, t ); } function $Q(e, t) { if (q0(e)) { var n = t.node(), r = +n.getAttribute("data-index"); if (r >= 0) { if (r === e._fullLayout._activeSelectionIndex) { zy(e); return; } e._fullLayout._activeSelectionIndex = r, e._fullLayout._deactivateSelection = zy, V0(e); } } } function KQ(e) { if (q0(e)) { var t = e._fullLayout.selections.length - 1; e._fullLayout._activeSelectionIndex = t, e._fullLayout._deactivateSelection = zy, V0(e); } } function zy(e) { if (q0(e)) { var t = e._fullLayout._activeSelectionIndex; t >= 0 && (Z6(e), delete e._fullLayout._activeSelectionIndex, V0(e)); } } function JQ() { var e, t = 0, n = !1; function r(a, i) { return e.list.push({ type: a, data: i ? JSON.parse(JSON.stringify(i)) : void 0 }), e; } return e = { list: [], segmentId: function() { return t++; }, checkIntersection: function(a, i) { return r("check", { seg1: a, seg2: i }); }, segmentChop: function(a, i) { return r("div_seg", { seg: a, pt: i }), r("chop", { seg: a, pt: i }); }, statusRemove: function(a) { return r("pop_seg", { seg: a }); }, segmentUpdate: function(a) { return r("seg_update", { seg: a }); }, segmentNew: function(a, i) { return r("new_seg", { seg: a, primary: i }); }, segmentRemove: function(a) { return r("rem_seg", { seg: a }); }, tempStatus: function(a, i, o) { return r("temp_status", { seg: a, above: i, below: o }); }, rewind: function(a) { return r("rewind", { seg: a }); }, status: function(a, i, o) { return r("status", { seg: a, above: i, below: o }); }, vert: function(a) { return a === n ? e : (n = a, r("vert", { x: a })); }, log: function(a) { return typeof a != "string" && (a = JSON.stringify(a, !1, " ")), r("log", { txt: a }); }, reset: function() { return r("reset"); }, selected: function(a) { return r("selected", { segs: a }); }, chainStart: function(a) { return r("chain_start", { seg: a }); }, chainRemoveHead: function(a, i) { return r("chain_rem_head", { index: a, pt: i }); }, chainRemoveTail: function(a, i) { return r("chain_rem_tail", { index: a, pt: i }); }, chainNew: function(a, i) { return r("chain_new", { pt1: a, pt2: i }); }, chainMatch: function(a) { return r("chain_match", { index: a }); }, chainClose: function(a) { return r("chain_close", { index: a }); }, chainAddHead: function(a, i) { return r("chain_add_head", { index: a, pt: i }); }, chainAddTail: function(a, i) { return r("chain_add_tail", { index: a, pt: i }); }, chainConnect: function(a, i) { return r("chain_con", { index1: a, index2: i }); }, chainReverse: function(a) { return r("chain_rev", { index: a }); }, chainJoin: function(a, i) { return r("chain_join", { index1: a, index2: i }); }, done: function() { return r("done"); } }, e; } var QQ = JQ; function XQ(e) { typeof e != "number" && (e = 1e-10); var t = { epsilon: function(n) { return typeof n == "number" && (e = n), e; }, pointAboveOrOnLine: function(n, r, a) { var i = r[0], o = r[1], l = a[0], s = a[1], c = n[0], u = n[1]; return (l - i) * (u - o) - (s - o) * (c - i) >= -e; }, pointBetween: function(n, r, a) { var i = n[1] - r[1], o = a[0] - r[0], l = n[0] - r[0], s = a[1] - r[1], c = l * o + i * s; if (c < e) return !1; var u = o * o + s * s; return !(c - u > -e); }, pointsSameX: function(n, r) { return Math.abs(n[0] - r[0]) < e; }, pointsSameY: function(n, r) { return Math.abs(n[1] - r[1]) < e; }, pointsSame: function(n, r) { return t.pointsSameX(n, r) && t.pointsSameY(n, r); }, pointsCompare: function(n, r) { return t.pointsSameX(n, r) ? t.pointsSameY(n, r) ? 0 : n[1] < r[1] ? -1 : 1 : n[0] < r[0] ? -1 : 1; }, pointsCollinear: function(n, r, a) { var i = n[0] - r[0], o = n[1] - r[1], l = r[0] - a[0], s = r[1] - a[1]; return Math.abs(i * s - l * o) < e; }, linesIntersect: function(n, r, a, i) { var o = r[0] - n[0], l = r[1] - n[1], s = i[0] - a[0], c = i[1] - a[1], u = o * c - l * s; if (Math.abs(u) < e) return !1; var f = n[0] - a[0], h = n[1] - a[1], g = (s * h - c * f) / u, p = (o * h - l * f) / u, v = { alongA: 0, alongB: 0, pt: [ n[0] + g * o, n[1] + g * l ] }; return g <= -e ? v.alongA = -2 : g < e ? v.alongA = -1 : g - 1 <= -e ? v.alongA = 0 : g - 1 < e ? v.alongA = 1 : v.alongA = 2, p <= -e ? v.alongB = -2 : p < e ? v.alongB = -1 : p - 1 <= -e ? v.alongB = 0 : p - 1 < e ? v.alongB = 1 : v.alongB = 2, v; }, pointInsideRegion: function(n, r) { for (var a = n[0], i = n[1], o = r[r.length - 1][0], l = r[r.length - 1][1], s = !1, c = 0; c < r.length; c++) { var u = r[c][0], f = r[c][1]; f - i > e != l - i > e && (o - u) * (i - f) / (l - f) + u - a > e && (s = !s), o = u, l = f; } return s; } }; return t; } var eX = XQ, tX = { create: function() { var e = { root: { root: !0, next: null }, exists: function(t) { return !(t === null || t === e.root); }, isEmpty: function() { return e.root.next === null; }, getHead: function() { return e.root.next; }, insertBefore: function(t, n) { for (var r = e.root, a = e.root.next; a !== null; ) { if (n(a)) { t.prev = a.prev, t.next = a, a.prev.next = t, a.prev = t; return; } r = a, a = a.next; } r.next = t, t.prev = r, t.next = null; }, findTransition: function(t) { for (var n = e.root, r = e.root.next; r !== null && !t(r); ) n = r, r = r.next; return { before: n === e.root ? null : n, after: r, insert: function(a) { return a.prev = n, a.next = r, n.next = a, r !== null && (r.prev = a), a; } }; } }; return e; }, node: function(e) { return e.prev = null, e.next = null, e.remove = function() { e.prev.next = e.next, e.next && (e.next.prev = e.prev), e.prev = null, e.next = null; }, e; } }, nX = tX, Lu = nX; function rX(e, t, n) { function r(p, v) { return { id: n ? n.segmentId() : -1, start: p, end: v, myFill: { above: null, // is there fill above us? below: null // is there fill below us? }, otherFill: null }; } function a(p, v, y) { return { id: n ? n.segmentId() : -1, start: p, end: v, myFill: { above: y.myFill.above, below: y.myFill.below }, otherFill: null }; } var i = Lu.create(); function o(p, v, y, m, b, w) { var _ = t.pointsCompare(v, b); return _ !== 0 ? _ : t.pointsSame(y, w) ? 0 : p !== m ? p ? 1 : -1 : t.pointAboveOrOnLine( y, m ? b : w, // order matters m ? w : b ) ? 1 : -1; } function l(p, v) { i.insertBefore(p, function(y) { var m = o( p.isStart, p.pt, v, y.isStart, y.pt, y.other.pt ); return m < 0; }); } function s(p, v) { var y = Lu.node({ isStart: !0, pt: p.start, seg: p, primary: v, other: null, status: null }); return l(y, p.end), y; } function c(p, v, y) { var m = Lu.node({ isStart: !1, pt: v.end, seg: v, primary: y, other: p, status: null }); p.other = m, l(m, p.pt); } function u(p, v) { var y = s(p, v); return c(y, p, v), y; } function f(p, v) { n && n.segmentChop(p.seg, v), p.other.remove(), p.seg.end = v, p.other.pt = v, l(p.other, p.pt); } function h(p, v) { var y = a(v, p.seg.end, p.seg); return f(p, v), u(y, p.primary); } function g(p, v) { var y = Lu.create(); function m(W, J) { var U = W.seg.start, E = W.seg.end, z = J.seg.start, F = J.seg.end; return t.pointsCollinear(U, z, F) ? t.pointsCollinear(E, z, F) || t.pointAboveOrOnLine(E, z, F) ? 1 : -1 : t.pointAboveOrOnLine(U, z, F) ? 1 : -1; } function b(W) { return y.findTransition(function(J) { var U = m(W, J.ev); return U > 0; }); } function w(W, J) { var U = W.seg, E = J.seg, z = U.start, F = U.end, q = E.start, H = E.end; n && n.checkIntersection(U, E); var K = t.linesIntersect(z, F, q, H); if (K === !1) { if (!t.pointsCollinear(z, F, q) || t.pointsSame(z, H) || t.pointsSame(F, q)) return !1; var Q = t.pointsSame(z, q), re = t.pointsSame(F, H); if (Q && re) return J; var te = !Q && t.pointBetween(z, q, H), X = !re && t.pointBetween(F, q, H); if (Q) return X ? h(J, F) : h(W, H), J; te && (re || (X ? h(J, F) : h(W, H)), h(J, z)); } else K.alongA === 0 && (K.alongB === -1 ? h(W, q) : K.alongB === 0 ? h(W, K.pt) : K.alongB === 1 && h(W, H)), K.alongB === 0 && (K.alongA === -1 ? h(J, z) : K.alongA === 0 ? h(J, K.pt) : K.alongA === 1 && h(J, F)); return !1; } for (var _ = []; !i.isEmpty(); ) { var k = i.getHead(); if (n && n.vert(k.pt[0]), k.isStart) { let W = function() { if (O) { var J = w(k, O); if (J) return J; } return M ? w(k, M) : !1; }; n && n.segmentNew(k.seg, k.primary); var T = b(k), O = T.before ? T.before.ev : null, M = T.after ? T.after.ev : null; n && n.tempStatus( k.seg, O ? O.seg : !1, M ? M.seg : !1 ); var C = W(); if (C) { if (e) { var I; k.seg.myFill.below === null ? I = !0 : I = k.seg.myFill.above !== k.seg.myFill.below, I && (C.seg.myFill.above = !C.seg.myFill.above); } else C.seg.otherFill = k.seg.myFill; n && n.segmentUpdate(C.seg), k.other.remove(), k.remove(); } if (i.getHead() !== k) { n && n.rewind(k.seg); continue; } if (e) { var I; k.seg.myFill.below === null ? I = !0 : I = k.seg.myFill.above !== k.seg.myFill.below, M ? k.seg.myFill.below = M.seg.myFill.above : k.seg.myFill.below = p, I ? k.seg.myFill.above = !k.seg.myFill.below : k.seg.myFill.above = k.seg.myFill.below; } else if (k.seg.otherFill === null) { var j; M ? k.primary === M.primary ? j = M.seg.otherFill.above : j = M.seg.myFill.above : j = k.primary ? v : p, k.seg.otherFill = { above: j, below: j }; } n && n.status( k.seg, O ? O.seg : !1, M ? M.seg : !1 ), k.other.status = T.insert(Lu.node({ ev: k })); } else { var P = k.status; if (P === null) throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large"); if (y.exists(P.prev) && y.exists(P.next) && w(P.prev.ev, P.next.ev), n && n.statusRemove(P.ev.seg), P.remove(), !k.primary) { var N = k.seg.myFill; k.seg.myFill = k.seg.otherFill, k.seg.otherFill = N; } _.push(k.seg); } i.getHead().remove(); } return n && n.done(), _; } return e ? { addRegion: function(p) { for (var v, y = p[p.length - 1], m = 0; m < p.length; m++) { v = y, y = p[m]; var b = t.pointsCompare(v, y); b !== 0 && u( r( b < 0 ? v : y, b < 0 ? y : v ), !0 ); } }, calculate: function(p) { return g(p, !1); } } : { calculate: function(p, v, y, m) { return p.forEach(function(b) { u(a(b.start, b.end, b), !0); }), y.forEach(function(b) { u(a(b.start, b.end, b), !1); }), g(v, m); } }; } var aX = rX; function iX(e, t, n) { var r = [], a = []; return e.forEach(function(i) { var o = i.start, l = i.end; if (t.pointsSame(o, l)) { console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large"); return; } n && n.chainStart(i); var s = { index: 0, matches_head: !1, matches_pt1: !1 }, c = { index: 0, matches_head: !1, matches_pt1: !1 }, u = s; function f(P, N, W) { return u.index = P, u.matches_head = N, u.matches_pt1 = W, u === s ? (u = c, !1) : (u = null, !0); } for (var h = 0; h < r.length; h++) { var g = r[h], p = g[0]; g[1]; var v = g[g.length - 1]; if (g[g.length - 2], t.pointsSame(p, o)) { if (f(h, !0, !0)) break; } else if (t.pointsSame(p, l)) { if (f(h, !0, !1)) break; } else if (t.pointsSame(v, o)) { if (f(h, !1, !0)) break; } else if (t.pointsSame(v, l) && f(h, !1, !1)) break; } if (u === s) { r.push([o, l]), n && n.chainNew(o, l); return; } if (u === c) { n && n.chainMatch(s.index); var y = s.index, m = s.matches_pt1 ? l : o, b = s.matches_head, g = r[y], w = b ? g[0] : g[g.length - 1], _ = b ? g[1] : g[g.length - 2], k = b ? g[g.length - 1] : g[0], T = b ? g[g.length - 2] : g[1]; if (t.pointsCollinear(_, w, m) && (b ? (n && n.chainRemoveHead(s.index, m), g.shift()) : (n && n.chainRemoveTail(s.index, m), g.pop()), w = _), t.pointsSame(k, m)) { r.splice(y, 1), t.pointsCollinear(T, k, w) && (b ? (n && n.chainRemoveTail(s.index, w), g.pop()) : (n && n.chainRemoveHead(s.index, w), g.shift())), n && n.chainClose(s.index), a.push(g); return; } b ? (n && n.chainAddHead(s.index, m), g.unshift(m)) : (n && n.chainAddTail(s.index, m), g.push(m)); return; } function O(P) { n && n.chainReverse(P), r[P].reverse(); } function M(P, N) { var W = r[P], J = r[N], U = W[W.length - 1], E = W[W.length - 2], z = J[0], F = J[1]; t.pointsCollinear(E, U, z) && (n && n.chainRemoveTail(P, U), W.pop(), U = E), t.pointsCollinear(U, z, F) && (n && n.chainRemoveHead(N, z), J.shift()), n && n.chainJoin(P, N), r[P] = W.concat(J), r.splice(N, 1); } var C = s.index, I = c.index; n && n.chainConnect(C, I); var j = r[C].length < r[I].length; s.matches_head ? c.matches_head ? j ? (O(C), M(C, I)) : (O(I), M(I, C)) : M(I, C) : c.matches_head ? M(C, I) : j ? (O(C), M(I, C)) : (O(I), M(C, I)); }), a; } var oX = iX; function Ou(e, t, n) { var r = []; return e.forEach(function(a) { var i = (a.myFill.above ? 8 : 0) + (a.myFill.below ? 4 : 0) + (a.otherFill && a.otherFill.above ? 2 : 0) + (a.otherFill && a.otherFill.below ? 1 : 0); t[i] !== 0 && r.push({ id: n ? n.segmentId() : -1, start: a.start, end: a.end, myFill: { above: t[i] === 1, // 1 if filled above below: t[i] === 2 // 2 if filled below }, otherFill: null }); }), n && n.selected(r), r; } var lX = { union: function(e, t) { return Ou(e, [ 0, 2, 1, 0, 2, 2, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0 ], t); }, intersect: function(e, t) { return Ou(e, [ 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 1, 1, 0, 2, 1, 0 ], t); }, difference: function(e, t) { return Ou(e, [ 0, 0, 0, 0, 2, 0, 2, 0, 1, 1, 0, 0, 0, 1, 2, 0 ], t); }, differenceRev: function(e, t) { return Ou(e, [ 0, 2, 1, 0, 0, 0, 1, 1, 0, 2, 0, 2, 0, 0, 0, 0 ], t); }, xor: function(e, t) { return Ou(e, [ 0, 2, 1, 0, 2, 0, 0, 1, 1, 0, 0, 2, 0, 1, 2, 0 ], t); } }, sX = lX, cX = { // convert a GeoJSON object to a PolyBool polygon toPolygon: function(e, t) { function n(i) { if (i.length <= 0) return e.segments({ inverted: !1, regions: [] }); function o(c) { var u = c.slice(0, c.length - 1); return e.segments({ inverted: !1, regions: [u] }); } for (var l = o(i[0]), s = 1; s < i.length; s++) l = e.selectDifference(e.combine(l, o(i[s]))); return l; } if (t.type === "Polygon") return e.polygon(n(t.coordinates)); if (t.type === "MultiPolygon") { for (var r = e.segments({ inverted: !1, regions: [] }), a = 0; a < t.coordinates.length; a++) r = e.selectUnion(e.combine(r, n(t.coordinates[a]))); return e.polygon(r); } throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon"); }, // convert a PolyBool polygon to a GeoJSON object fromPolygon: function(e, t, n) { n = e.polygon(e.segments(n)); function r(g, p) { return t.pointInsideRegion([ (g[0][0] + g[1][0]) * 0.5, (g[0][1] + g[1][1]) * 0.5 ], p); } function a(g) { return { region: g, children: [] }; } var i = a(null); function o(g, p) { for (var v = 0; v < g.children.length; v++) { var y = g.children[v]; if (r(p, y.region)) { o(y, p); return; } } for (var m = a(p), v = 0; v < g.children.length; v++) { var y = g.children[v]; r(y.region, p) && (m.children.push(y), g.children.splice(v, 1), v--); } g.children.push(m); } for (var l = 0; l < n.regions.length; l++) { var s = n.regions[l]; s.length < 3 || o(i, s); } function c(g, p) { for (var v = 0, y = g[g.length - 1][0], m = g[g.length - 1][1], b = [], w = 0; w < g.length; w++) { var _ = g[w][0], k = g[w][1]; b.push([_, k]), v += k * y - _ * m, y = _, m = k; } var T = v < 0; return T !== p && b.reverse(), b.push([b[0][0], b[0][1]]), b; } var u = []; function f(g) { var p = [c(g.region, !1)]; u.push(p); for (var v = 0; v < g.children.length; v++) p.push(h(g.children[v])); } function h(g) { for (var p = 0; p < g.children.length; p++) f(g.children[p]); return c(g.region, !0); } for (var l = 0; l < i.children.length; l++) f(i.children[l]); return u.length <= 0 ? { type: "Polygon", coordinates: [] } : u.length == 1 ? { type: "Polygon", coordinates: u[0] } : { // otherwise, use a GeoJSON MultiPolygon type: "MultiPolygon", coordinates: u }; } }, uX = cX; /* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ var dX = QQ, fX = eX, ZT = aX, hX = oX, Du = sX, YT = uX, Da = !1, Fu = fX(), ia; ia = { // getter/setter for buildLog buildLog: function(e) { return e === !0 ? Da = dX() : e === !1 && (Da = !1), Da === !1 ? !1 : Da.list; }, // getter/setter for epsilon epsilon: function(e) { return Fu.epsilon(e); }, // core API segments: function(e) { var t = ZT(!0, Fu, Da); return e.regions.forEach(t.addRegion), { segments: t.calculate(e.inverted), inverted: e.inverted }; }, combine: function(e, t) { var n = ZT(!1, Fu, Da); return { combined: n.calculate( e.segments, e.inverted, t.segments, t.inverted ), inverted1: e.inverted, inverted2: t.inverted }; }, selectUnion: function(e) { return { segments: Du.union(e.combined, Da), inverted: e.inverted1 || e.inverted2 }; }, selectIntersect: function(e) { return { segments: Du.intersect(e.combined, Da), inverted: e.inverted1 && e.inverted2 }; }, selectDifference: function(e) { return { segments: Du.difference(e.combined, Da), inverted: e.inverted1 && !e.inverted2 }; }, selectDifferenceRev: function(e) { return { segments: Du.differenceRev(e.combined, Da), inverted: !e.inverted1 && e.inverted2 }; }, selectXor: function(e) { return { segments: Du.xor(e.combined, Da), inverted: e.inverted1 !== e.inverted2 }; }, polygon: function(e) { return { regions: hX(e.segments, Fu, Da), inverted: e.inverted }; }, // GeoJSON converters polygonFromGeoJSON: function(e) { return YT.toPolygon(ia, e); }, polygonToGeoJSON: function(e) { return YT.fromPolygon(ia, Fu, e); }, // helper functions for common operations union: function(e, t) { return Iu(e, t, ia.selectUnion); }, intersect: function(e, t) { return Iu(e, t, ia.selectIntersect); }, difference: function(e, t) { return Iu(e, t, ia.selectDifference); }, differenceRev: function(e, t) { return Iu(e, t, ia.selectDifferenceRev); }, xor: function(e, t) { return Iu(e, t, ia.selectXor); } }; function Iu(e, t, n) { var r = ia.segments(e), a = ia.segments(t), i = ia.combine(r, a), o = n(i); return ia.polygon(o); } typeof window == "object" && (window.PolyBool = ia); var pX = ia, gX = function(e, t, n, r) { var a = e[0], i = e[1], o = !1; n === void 0 && (n = 0), r === void 0 && (r = t.length); for (var l = r - n, s = 0, c = l - 1; s < l; c = s++) { var u = t[s + n][0], f = t[s + n][1], h = t[c + n][0], g = t[c + n][1], p = f > i != g > i && a < (h - u) * (i - f) / (g - f) + u; p && (o = !o); } return o; }, Q6 = { exports: {} }, Iv = d0.dot, lh = er.BADNUM, Ap = Q6.exports = {}; Ap.tester = function(e) { var t = e.slice(), n = t[0][0], r = n, a = t[0][1], i = a, o; for ((t[t.length - 1][0] !== t[0][0] || t[t.length - 1][1] !== t[0][1]) && t.push(t[0]), o = 1; o < t.length; o++) n = Math.min(n, t[o][0]), r = Math.max(r, t[o][0]), a = Math.min(a, t[o][1]), i = Math.max(i, t[o][1]); var l = !1, s; t.length === 5 && (t[0][0] === t[1][0] ? t[2][0] === t[3][0] && t[0][1] === t[3][1] && t[1][1] === t[2][1] && (l = !0, s = function(g) { return g[0] === t[0][0]; }) : t[0][1] === t[1][1] && t[2][1] === t[3][1] && t[0][0] === t[3][0] && t[1][0] === t[2][0] && (l = !0, s = function(g) { return g[1] === t[0][1]; })); function c(g, p) { var v = g[0], y = g[1]; return !(v === lh || v < n || v > r || y === lh || y < a || y > i || p && s(g)); } function u(g, p) { var v = g[0], y = g[1]; if (v === lh || v < n || v > r || y === lh || y < a || y > i) return !1; var m = t.length, b = t[0][0], w = t[0][1], _ = 0, k, T, O, M, C; for (k = 1; k < m; k++) if (T = b, O = w, b = t[k][0], w = t[k][1], M = Math.min(T, b), !(v < M || v > Math.max(T, b) || y > Math.max(O, w))) if (y < Math.min(O, w)) v !== M && _++; else { if (b === T ? C = y : C = O + (v - T) * (w - O) / (b - T), y === C) return !(k === 1 && p); y <= C && v !== M && _++; } return _ % 2 === 1; } var f = !0, h = t[0]; for (o = 1; o < t.length; o++) if (h[0] !== t[o][0] || h[1] !== t[o][1]) { f = !1; break; } return { xmin: n, xmax: r, ymin: a, ymax: i, pts: t, contains: l ? c : u, isRect: l, degenerate: f }; }; Ap.isSegmentBent = function(e, t, n, r) { var a = e[t], i = [e[n][0] - a[0], e[n][1] - a[1]], o = Iv(i, i), l = Math.sqrt(o), s = [-i[1] / l, i[0] / l], c, u, f; for (c = t + 1; c < n; c++) if (u = [e[c][0] - a[0], e[c][1] - a[1]], f = Iv(u, i), f < 0 || f > o || Math.abs(Iv(u, s)) > r) return !0; return !1; }; Ap.filter = function(e, t) { var n = [e[0]], r = 0, a = 0; function i(l) { e.push(l); var s = n.length, c = r; n.splice(a + 1); for (var u = c + 1; u < e.length; u++) (u === e.length - 1 || Ap.isSegmentBent(e, c, u + 1, t)) && (n.push(e[u]), n.length < s - 2 && (r = u, a = n.length - 1), c = u); } if (e.length > 1) { var o = e.pop(); i(o); } return { addPt: i, raw: e, filtered: n }; }; var X6 = Q6.exports, vX = { // max pixels off straight before a lasso select line counts as bent BENDPX: 1.5, // smallest dimension allowed for a select box MINSELECT: 12, // throttling limit (ms) for selectPoints calls SELECTDELAY: 100, // cache ID suffix for throttle SELECTID: "-select" }, $T = pX, mX = gX, Md = Rt, yX = Cn.dashStyle, zu = rn, xX = Ao, bX = Oo.makeEventData, Xd = tu, wX = Xd.freeMode, _X = Xd.rectMode, Sd = Xd.drawMode, Vx = Xd.openMode, qx = Xd.selectMode, KT = wl, JT = R0, e8 = zx, t8 = xs.clearOutline, n8 = bl, zv = n8.handleEllipse, kX = n8.readPaths, TX = Dx.newShapes, AX = w6, MX = K6.activateLastSelection, Hh = Ue, SX = Hh.sorterAsc, r8 = X6, Eu = m0, Na = mr.getFromId, CX = Sx, LX = j0.redrawReglTraces, Vh = vX, Li = Vh.MINSELECT, OX = r8.filter, Ux = r8.tester, Gx = Ox, QT = Gx.p2r, DX = Gx.axValue, FX = Gx.getTransform; function Wx(e) { return e.subplot !== void 0; } function IX(e, t, n, r, a) { var i = !Wx(r), o = wX(a), l = _X(a), s = Vx(a), c = Sd(a), u = qx(a), f = a === "drawline", h = a === "drawcircle", g = f || h, p = r.gd, v = p._fullLayout, y = u && v.newselection.mode === "immediate" && i, m = v._zoomlayer, b = r.element.getBoundingClientRect(), w = r.plotinfo, _ = FX(w), k = t - b.left, T = n - b.top; v._calcInverseTransform(p); var O = Hh.apply3DTransform(v._invTransform)(k, T); k = O[0], T = O[1]; var M = v._invScaleX, C = v._invScaleY, I = k, j = T, P = "M" + k + "," + T, N = r.xaxes[0], W = r.yaxes[0], J = N._length, U = W._length, E = e.altKey && !(Sd(a) && s), z, F, q, H, K, Q, re; i8(e, p, r), o && (z = OX([[k, T]], Vh.BENDPX)); var te = m.selectAll("path.select-outline-" + w.id).data([1]), X = c ? v.newshape : v.newselection; c && (r.hasText = X.label.text || X.label.texttemplate); var ce = c && !s ? X.fillcolor : "rgba(0,0,0,0)", B = X.line.color || (i ? zu.contrast(p._fullLayout.plot_bgcolor) : "#7f7f7f"); te.enter().append("path").attr("class", "select-outline select-outline-" + w.id).style({ opacity: c ? X.opacity / 2 : 1, "stroke-dasharray": yX(X.line.dash, X.line.width), "stroke-width": X.line.width + "px", "shape-rendering": "crispEdges" }).call(zu.stroke, B).call(zu.fill, ce).attr("fill-rule", "evenodd").classed("cursor-move", !!c).attr("transform", _).attr("d", P + "Z"); var G = m.append("path").attr("class", "zoombox-corners").style({ fill: zu.background, stroke: zu.defaultLine, "stroke-width": 1 }).attr("transform", _).attr("d", "M0,0Z"); if (c && r.hasText) { var Z = m.select(".label-temp"); Z.empty() && (Z = m.append("g").classed("label-temp", !0).classed("select-outline", !0).style({ opacity: 0.8 })); } var oe = v._uid + Vh.SELECTID, ae = [], ge = U0( p, r.xaxes, r.yaxes, r.subplot ); y && !e.shiftKey && (r._clearSubplotSelections = function() { if (i) { var pe = N._id, ye = W._id; u8(p, pe, ye, ge); for (var Oe = (p.layout || {}).selections || [], Be = [], Ie = !1, Fe = 0; Fe < Oe.length; Fe++) { var Re = v.selections[Fe]; Re.xref !== pe || Re.yref !== ye ? Be.push(Oe[Fe]) : Ie = !0; } Ie && (p._fullLayout._noEmitSelectedAtStart = !0, Md.call("_guiRelayout", p, { selections: Be })); } }); var ve = ZX(r); r.moveFn = function(pe, ye) { r._clearSubplotSelections && (r._clearSubplotSelections(), r._clearSubplotSelections = void 0), I = Math.max(0, Math.min(J, M * pe + k)), j = Math.max(0, Math.min(U, C * ye + T)); var Oe = Math.abs(I - k), Be = Math.abs(j - T); if (l) { var Ie, Fe, Re; if (u) { var We = v.selectdirection; switch (We === "any" ? Be < Math.min(Oe * 0.6, Li) ? Ie = "h" : Oe < Math.min(Be * 0.6, Li) ? Ie = "v" : Ie = "d" : Ie = We, Ie) { case "h": Fe = h ? U / 2 : 0, Re = U; break; case "v": Fe = h ? J / 2 : 0, Re = J; break; } } if (c) switch (v.newshape.drawdirection) { case "vertical": Ie = "h", Fe = h ? U / 2 : 0, Re = U; break; case "horizontal": Ie = "v", Fe = h ? J / 2 : 0, Re = J; break; case "ortho": Oe < Be ? (Ie = "h", Fe = T, Re = j) : (Ie = "v", Fe = k, Re = I); break; default: Ie = "d"; } Ie === "h" ? (H = g ? zv(h, [I, Fe], [I, Re]) : ( // using x1 instead of x0 allows adjusting the line while drawing [[k, Fe], [k, Re], [I, Re], [I, Fe]] ), H.xmin = g ? I : Math.min(k, I), H.xmax = g ? I : Math.max(k, I), H.ymin = Math.min(Fe, Re), H.ymax = Math.max(Fe, Re), G.attr("d", "M" + H.xmin + "," + (T - Li) + "h-4v" + 2 * Li + "h4ZM" + (H.xmax - 1) + "," + (T - Li) + "h4v" + 2 * Li + "h-4Z")) : Ie === "v" ? (H = g ? zv(h, [Fe, j], [Re, j]) : ( // using y1 instead of y0 allows adjusting the line while drawing [[Fe, T], [Fe, j], [Re, j], [Re, T]] ), H.xmin = Math.min(Fe, Re), H.xmax = Math.max(Fe, Re), H.ymin = g ? j : Math.min(T, j), H.ymax = g ? j : Math.max(T, j), G.attr("d", "M" + (k - Li) + "," + H.ymin + "v-4h" + 2 * Li + "v4ZM" + (k - Li) + "," + (H.ymax - 1) + "v4h" + 2 * Li + "v-4Z")) : Ie === "d" && (H = g ? zv(h, [k, T], [I, j]) : [[k, T], [k, j], [I, j], [I, T]], H.xmin = Math.min(k, I), H.xmax = Math.max(k, I), H.ymin = Math.min(T, j), H.ymax = Math.max(T, j), G.attr("d", "M0,0Z")); } else o && (z.addPt([I, j]), H = z.filtered); if (r.selectionDefs && r.selectionDefs.length ? (q = o8(r.mergedPolygons, H, E), H.subtract = E, F = Zx(r.selectionDefs.concat([H]))) : (q = [H], F = Ux(H)), e8(s8(q, s), te, r), u) { var Ce = Ey(p, !1), Ve = Ce.eventData ? Ce.eventData.points.slice() : []; Ce = Ey(p, !1, F, ge, r), F = Ce.selectionTesters, re = Ce.eventData; var Ke; z ? Ke = z.filtered : Ke = d8(q), Eu.throttle( oe, Vh.SELECTDELAY, function() { ae = c8(F, ge); for (var Xe = ae.slice(), ct = 0; ct < Ve.length; ct++) { for (var vt = Ve[ct], lt = !1, ut = 0; ut < Xe.length; ut++) if (Xe[ut].curveNumber === vt.curveNumber && Xe[ut].pointNumber === vt.pointNumber) { lt = !0; break; } lt || Xe.push(vt); } Xe.length && (re || (re = {}), re.points = Xe), ve(re, Ke), YX(p, re); } ); } }, r.clickFn = function(pe, ye) { if (G.remove(), p._fullLayout._activeShapeIndex >= 0) { p._fullLayout._deactivateShape(p); return; } if (!c) { var Oe = v.clickmode; Eu.done(oe).then(function() { if (Eu.clear(oe), pe === 2) { for (te.remove(), K = 0; K < ge.length; K++) Q = ge[K], Q._module.selectPoints(Q, !1); if (Ld(p, ge), Cd(r), $x(p), ge.length) { var Be = ge[0].xaxis, Ie = ge[0].yaxis; if (Be && Ie) { for (var Fe = [], Re = p._fullLayout.selections, We = 0; We < Re.length; We++) { var Ce = Re[We]; Ce && (Ce.xref !== Be._id || Ce.yref !== Ie._id) && Fe.push(Ce); } Fe.length < Re.length && (p._fullLayout._noEmitSelectedAtStart = !0, Md.call("_guiRelayout", p, { selections: Fe })); } } } else Oe.indexOf("select") > -1 && a8( ye, p, r.xaxes, r.yaxes, r.subplot, r, te ), Oe === "event" && Od(p, void 0); xX.click(p, ye, w.id); }).catch(Hh.error); } }, r.doneFn = function() { G.remove(), Eu.done(oe).then(function() { Eu.clear(oe), !y && H && r.selectionDefs && (H.subtract = E, r.selectionDefs.push(H), r.mergedPolygons.length = 0, [].push.apply(r.mergedPolygons, q)), (y || c) && Cd(r, y), r.doneFnCompleted && r.doneFnCompleted(ae), u && Od(p, re); }).catch(Hh.error); }; } function a8(e, t, n, r, a, i, o) { var l = t._hoverdata, s = t._fullLayout, c = s.clickmode, u = c.indexOf("event") > -1, f = [], h, g, p, v, y, m, b, w, _, k; if (RX(l)) { i8(e, t, i), h = U0(t, n, r, a); var T = NX(l, h), O = T.pointNumbers.length > 0; if (O ? BX(h, T) : HX(h) && (b = e5(T))) { for (o && o.remove(), k = 0; k < h.length; k++) g = h[k], g._module.selectPoints(g, !1); Ld(t, h), Cd(i), u && $x(t); } else { w = e.shiftKey && (b !== void 0 ? b : e5(T)), p = zX(T.pointNumber, T.searchInfo, w); var M = i.selectionDefs.concat([p]); for (v = Zx(M), k = 0; k < h.length; k++) if (y = h[k]._module.selectPoints(h[k], v), m = l8(y, h[k]), f.length) for (var C = 0; C < m.length; C++) f.push(m[C]); else f = m; if (_ = { points: f }, Ld(t, h, _), p && i && i.selectionDefs.push(p), o) { var I = i.mergedPolygons, j = Vx(i.dragmode); e8(s8(I, j), o, i); } u && Od(t, _); } } } function zX(e, t, n) { return { pointNumber: e, searchInfo: t, subtract: !!n }; } function Ev(e) { return "pointNumber" in e && "searchInfo" in e; } function EX(e) { return { xmin: 0, xmax: 0, ymin: 0, ymax: 0, pts: [], contains: function(t, n, r, a) { var i = e.searchInfo.cd[0].trace._expandedIndex, o = a.cd[0].trace._expandedIndex; return o === i && r === e.pointNumber; }, isRect: !1, degenerate: !1, subtract: !!e.subtract }; } function Zx(e) { if (!e.length) return; for (var t = [], n = Ev(e[0]) ? 0 : e[0][0][0], r = n, a = Ev(e[0]) ? 0 : e[0][0][1], i = a, o = 0; o < e.length; o++) if (Ev(e[o])) t.push(EX(e[o])); else { var l = Ux(e[o]); l.subtract = !!e[o].subtract, t.push(l), n = Math.min(n, l.xmin), r = Math.max(r, l.xmax), a = Math.min(a, l.ymin), i = Math.max(i, l.ymax); } function s(c, u, f, h) { for (var g = !1, p = 0; p < t.length; p++) t[p].contains(c, u, f, h) && (g = !t[p].subtract); return g; } return { xmin: n, xmax: r, ymin: a, ymax: i, pts: [], contains: s, isRect: !1, degenerate: !1 }; } function i8(e, t, n) { var r = t._fullLayout, a = n.plotinfo, i = n.dragmode, o = r._lastSelectedSubplot && r._lastSelectedSubplot === a.id, l = (e.shiftKey || e.altKey) && !(Sd(i) && Vx(i)); o && l && a.selection && a.selection.selectionDefs && !n.selectionDefs ? (n.selectionDefs = a.selection.selectionDefs, n.mergedPolygons = a.selection.mergedPolygons) : (!l || !a.selection) && Cd(n), o || (t8(t), r._lastSelectedSubplot = a.id); } function jX(e) { return e._fullLayout._activeShapeIndex >= 0; } function PX(e) { return e._fullLayout._activeSelectionIndex >= 0; } function Cd(e, t) { var n = e.dragmode, r = e.plotinfo, a = e.gd; jX(a) && a._fullLayout._deactivateShape(a), PX(a) && a._fullLayout._deactivateSelection(a); var i = a._fullLayout, o = i._zoomlayer, l = Sd(n), s = qx(n); if (l || s) { var c = o.selectAll(".select-outline-" + r.id); if (c && a._fullLayout._outlining) { var u; l && (u = TX(c, e)), u && Md.call("_guiRelayout", a, { shapes: u }); var f; s && !Wx(e) && (f = AX(c, e)), f && (a._fullLayout._noEmitSelectedAtStart = !0, Md.call("_guiRelayout", a, { selections: f }).then(function() { t && MX(a); })), a._fullLayout._outlining = !1; } } r.selection = {}, r.selection.selectionDefs = e.selectionDefs = [], r.selection.mergedPolygons = e.mergedPolygons = []; } function XT(e) { return e._id; } function U0(e, t, n, r) { if (!e.calcdata) return []; var a = [], i = t.map(XT), o = n.map(XT), l, s, c; for (c = 0; c < e.calcdata.length; c++) if (l = e.calcdata[c], s = l[0].trace, !(s.visible !== !0 || !s._module || !s._module.selectPoints)) if (Wx({ subplot: r }) && (s.subplot === r || s.geo === r)) a.push(sh(s._module, l, t[0], n[0])); else if (s.type === "splom") { if (s._xaxes[i[0]] && s._yaxes[o[0]]) { var u = sh(s._module, l, t[0], n[0]); u.scene = e._fullLayout._splomScenes[s.uid], a.push(u); } } else if (s.type === "sankey") { var f = sh(s._module, l, t[0], n[0]); a.push(f); } else { if (i.indexOf(s.xaxis) === -1 || o.indexOf(s.yaxis) === -1) continue; a.push(sh( s._module, l, Na(e, s.xaxis), Na(e, s.yaxis) )); } return a; } function sh(e, t, n, r) { return { _module: e, cd: t, xaxis: n, yaxis: r }; } function RX(e) { return e && Array.isArray(e) && e[0].hoverOnBox !== !0; } function NX(e, t) { var n = e[0], r = -1, a = [], i, o; for (o = 0; o < t.length; o++) if (i = t[o], n.fullData._expandedIndex === i.cd[0].trace._expandedIndex) { if (n.hoverOnBox === !0) break; n.pointNumber !== void 0 ? r = n.pointNumber : n.binNumber !== void 0 && (r = n.binNumber, a = n.pointNumbers); break; } return { pointNumber: r, pointNumbers: a, searchInfo: i }; } function e5(e) { var t = e.searchInfo.cd[0].trace, n = e.pointNumber, r = e.pointNumbers, a = r.length > 0, i = a ? r[0] : n; return t.selectedpoints ? t.selectedpoints.indexOf(i) > -1 : !1; } function BX(e, t) { var n = [], r, a, i, o; for (o = 0; o < e.length; o++) r = e[o], r.cd[0].trace.selectedpoints && r.cd[0].trace.selectedpoints.length > 0 && n.push(r); if (n.length === 1 && (i = n[0] === t.searchInfo, i && (a = t.searchInfo.cd[0].trace, a.selectedpoints.length === t.pointNumbers.length))) { for (o = 0; o < t.pointNumbers.length; o++) if (a.selectedpoints.indexOf(t.pointNumbers[o]) < 0) return !1; return !0; } return !1; } function HX(e) { var t = 0, n, r, a; for (a = 0; a < e.length; a++) if (n = e[a], r = n.cd[0].trace, r.selectedpoints && (r.selectedpoints.length > 1 || (t += r.selectedpoints.length, t > 1))) return !1; return t === 1; } function Ld(e, t, n) { var r; for (r = 0; r < t.length; r++) { var a = t[r].cd[0].trace._fullInput, i = e._fullLayout._tracePreGUI[a.uid] || {}; i.selectedpoints === void 0 && (i.selectedpoints = a._input.selectedpoints || null); } var o; if (n) { var l = n.points || []; for (r = 0; r < t.length; r++) o = t[r].cd[0].trace, o._input.selectedpoints = o._fullInput.selectedpoints = [], o._fullInput !== o && (o.selectedpoints = []); for (var s = 0; s < l.length; s++) { var c = l[s], u = c.data, f = c.fullData, h = c.pointIndex, g = c.pointIndices; g ? ([].push.apply(u.selectedpoints, g), o._fullInput !== o && [].push.apply(f.selectedpoints, g)) : (u.selectedpoints.push(h), o._fullInput !== o && f.selectedpoints.push(h)); } } else for (r = 0; r < t.length; r++) o = t[r].cd[0].trace, delete o.selectedpoints, delete o._input.selectedpoints, o._fullInput !== o && delete o._fullInput.selectedpoints; VX(e, t); } function VX(e, t) { for (var n = !1, r = 0; r < t.length; r++) { var a = t[r], i = a.cd; Md.traceIs(i[0].trace, "regl") && (n = !0); var o = a._module, l = o.styleOnSelect || o.style; l && (l(e, i, i[0].node3), i[0].nodeRangePlot3 && l(e, i, i[0].nodeRangePlot3)); } n && (CX(e), LX(e)); } function o8(e, t, n) { for (var r = n ? $T.difference : $T.union, a = r({ regions: e }, { regions: [t] }), i = a.regions.reverse(), o = 0; o < i.length; o++) { var l = i[o]; l.subtract = Yx(l, i.slice(0, o)); } return i; } function l8(e, t) { if (Array.isArray(e)) for (var n = t.cd, r = t.cd[0].trace, a = 0; a < e.length; a++) e[a] = bX(e[a], r, n); return e; } function s8(e, t) { for (var n = [], r = 0; r < e.length; r++) { n[r] = []; for (var a = 0; a < e[r].length; a++) { n[r][a] = [], n[r][a][0] = a ? "L" : "M"; for (var i = 0; i < e[r][a].length; i++) n[r][a].push( e[r][a][i] ); } t || n[r].push([ "Z", n[r][0][1], // initial x n[r][0][2] // initial y ]); } return n; } function c8(e, t) { for (var n = [], r, a, i = 0; i < t.length; i++) { var o = t[i]; a = o._module.selectPoints(o, e), r = l8(a, o), n = n.concat(r); } return n; } function Ey(e, t, n, r, a) { var i = !!r, o, l, s; a && (o = a.plotinfo, l = a.xaxes[0]._id, s = a.yaxes[0]._id); var c = [], u = [], f = t5(e), h = e._fullLayout; if (o) { var g = h._zoomlayer, p = h.dragmode, v = Sd(p), y = qx(p); if (v || y) { var m = Na(e, l, "x"), b = Na(e, s, "y"); if (m && b) { var w = g.selectAll(".select-outline-" + o.id); if (w && e._fullLayout._outlining && w.length) { for (var _ = w[0][0], k = _.getAttribute("d"), T = kX(k, e, o), O = [], M = 0; M < T.length; M++) { for (var C = T[M], I = [], j = 0; j < C.length; j++) I.push([ Ko(m, C[j][1]), Ko(b, C[j][2]) ]); I.xref = l, I.yref = s, I.subtract = Yx(I, O), O.push(I); } f = f.concat(O); } } } } var P = l && s ? [l + s] : h._subplots.cartesian; qX(e); for (var N = {}, W = 0; W < P.length; W++) { var J = P[W], U = J.indexOf("y"), E = J.slice(0, U), z = J.slice(U), F = l && s ? n : void 0; if (F = GX(f, E, z, F), F) { var q = r; if (!i) { var H = Na(e, E, "x"), K = Na(e, z, "y"); q = U0( e, [H], [K], J ); for (var Q = 0; Q < q.length; Q++) { var re = q[Q], te = re.cd[0], X = te.trace; if (re._module.name === "scattergl" && !te.t.xpx) { var ce = X.x, B = X.y, G = X._length; te.t.xpx = [], te.t.ypx = []; for (var Z = 0; Z < G; Z++) te.t.xpx[Z] = H.c2p(ce[Z]), te.t.ypx[Z] = K.c2p(B[Z]); } re._module.name === "splom" && (N[X.uid] || (N[X.uid] = !0)); } } var oe = c8(F, q); c = c.concat(oe), u = u.concat(q); } } var ae = { points: c }; Ld(e, u, ae); var ge = h.clickmode, ve = ge.indexOf("event") > -1 && t; if (!o && // get called from plot_api & plots t) { var pe = t5(e, !0); if (pe.length) { var ye = pe[0].xref, Oe = pe[0].yref; if (ye && Oe) { var Be = d8(pe), Ie = f8([ Na(e, ye, "x"), Na(e, Oe, "y") ]); Ie(ae, Be); } } e._fullLayout._noEmitSelectedAtStart ? e._fullLayout._noEmitSelectedAtStart = !1 : ve && Od(e, ae), h._reselect = !1; } if (!o && // get called from plot_api & plots h._deselect) { var Fe = h._deselect; l = Fe.xref, s = Fe.yref, UX(l, s, u) || u8(e, l, s, r), ve && (ae.points.length ? Od(e, ae) : $x(e)), h._deselect = !1; } return { eventData: ae, selectionTesters: n }; } function qX(e) { var t = e.calcdata; if (t) for (var n = 0; n < t.length; n++) { var r = t[n][0], a = r.trace, i = e._fullLayout._splomScenes; if (i) { var o = i[a.uid]; o && (o.selectBatch = []); } } } function UX(e, t, n) { for (var r = 0; r < n.length; r++) { var a = n[r]; if (a.xaxis && a.xaxis._id === e && a.yaxis && a.yaxis._id === t) return !0; } return !1; } function u8(e, t, n, r) { r = U0( e, [Na(e, t, "x")], [Na(e, n, "y")], t + n ); for (var a = 0; a < r.length; a++) { var i = r[a]; i._module.selectPoints(i, !1); } Ld(e, r); } function GX(e, t, n, r) { for (var a, i = 0; i < e.length; i++) { var o = e[i]; if (!(t !== o.xref || n !== o.yref)) if (a) { var l = !!o.subtract; a = o8(a, o, l), r = Zx(a); } else a = [o], r = Ux(o); } return r; } function t5(e, t) { for (var n = [], r = e._fullLayout, a = r.selections, i = a.length, o = 0; o < i; o++) if (!(t && o !== r._activeSelectionIndex)) { var l = a[o]; if (l) { var s = l.xref, c = l.yref, u = Na(e, s, "x"), f = Na(e, c, "y"), h, g, p, v, y; if (l.type === "rect") { y = []; var m = Ko(u, l.x0), b = Ko(u, l.x1), w = Ko(f, l.y0), _ = Ko(f, l.y1); y = [[m, w], [m, _], [b, _], [b, w]], h = Math.min(m, b), g = Math.max(m, b), p = Math.min(w, _), v = Math.max(w, _), y.xmin = h, y.xmax = g, y.ymin = p, y.ymax = v, y.xref = s, y.yref = c, y.subtract = !1, y.isRect = !0, n.push(y); } else if (l.type === "path") for (var k = l.path.split("Z"), T = [], O = 0; O < k.length; O++) { var M = k[O]; if (M) { M += "Z"; var C = KT.extractPathCoords(M, JT.paramIsX, "raw"), I = KT.extractPathCoords(M, JT.paramIsY, "raw"); h = 1 / 0, g = -1 / 0, p = 1 / 0, v = -1 / 0, y = []; for (var j = 0; j < C.length; j++) { var P = Ko(u, C[j]), N = Ko(f, I[j]); y.push([P, N]), h = Math.min(P, h), g = Math.max(P, g), p = Math.min(N, p), v = Math.max(N, v); } y.xmin = h, y.xmax = g, y.ymin = p, y.ymax = v, y.xref = s, y.yref = c, y.subtract = Yx(y, T), T.push(y), n.push(y); } } } } return n; } function Yx(e, t) { for (var n = !1, r = 0; r < t.length; r++) for (var a = t[r], i = 0; i < e.length; i++) if (mX(e[i], a)) { n = !n; break; } return n; } function Ko(e, t) { return e.type === "date" && (t = t.replace("_", " ")), e.type === "log" ? e.c2p(t) : e.r2p(t, null, e.calendar); } function d8(e) { for (var t = e.length, n = [], r = 0; r < t; r++) { var a = e[r]; n = n.concat(a), n = n.concat([a[0]]); } return WX(n); } function WX(e) { return e.isRect = e.length === 5 && e[0][0] === e[4][0] && e[0][1] === e[4][1] && e[0][0] === e[1][0] && e[2][0] === e[3][0] && e[0][1] === e[3][1] && e[1][1] === e[2][1] || e[0][1] === e[1][1] && e[2][1] === e[3][1] && e[0][0] === e[3][0] && e[1][0] === e[2][0], e.isRect && (e.xmin = Math.min(e[0][0], e[2][0]), e.xmax = Math.max(e[0][0], e[2][0]), e.ymin = Math.min(e[0][1], e[2][1]), e.ymax = Math.max(e[0][1], e[2][1])), e; } function f8(e) { return function(t, n) { for (var r, a, i = 0; i < e.length; i++) { var o = e[i], l = o._id, s = l.charAt(0); if (n.isRect) { r || (r = {}); var c = n[s + "min"], u = n[s + "max"]; c !== void 0 && u !== void 0 && (r[l] = [ QT(o, c), QT(o, u) ].sort(SX)); } else a || (a = {}), a[l] = n.map(DX(o)); } r && (t.range = r), a && (t.lassoPoints = a); }; } function ZX(e) { var t = e.plotinfo; return t.fillRangeItems || // allow subplots (i.e. geo, mapbox, sankey) to override fillRangeItems routine f8(e.xaxes.concat(e.yaxes)); } function YX(e, t) { e.emit("plotly_selecting", t); } function Od(e, t) { t && (t.selections = (e.layout || {}).selections || []), e.emit("plotly_selected", t); } function $x(e) { e.emit("plotly_deselect", null); } var $X = { reselect: Ey, prepSelect: IX, clearOutline: t8, clearSelectionsCache: Cd, selectOnClick: a8 }, h8 = [ // no arrow { path: "", backoff: 0 }, // wide with flat back { path: "M-2.4,-3V3L0.6,0Z", backoff: 0.6 }, // narrower with flat back { path: "M-3.7,-2.5V2.5L1.3,0Z", backoff: 1.3 }, // barbed { path: "M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z", backoff: 1.55 }, // wide line-drawn { path: "M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z", backoff: 1.6 }, // narrower line-drawn { path: "M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z", backoff: 2 }, // circle { path: "M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z", backoff: 0, noRotate: !0 }, // square { path: "M2,2V-2H-2V2Z", backoff: 0, noRotate: !0 } ], G0 = { axisRefDescription: function(e, t, n) { return [ "If set to a", e, "axis id (e.g. *" + e + "* or", "*" + e + "2*), the `" + e + "` position refers to a", e, "coordinate. If set to *paper*, the `" + e + "`", "position refers to the distance from the", t, "of the plotting", "area in normalized coordinates where *0* (*1*) corresponds to the", t, "(" + n + "). If set to a", e, "axis ID followed by", "*domain* (separated by a space), the position behaves like for", "*paper*, but refers to the distance in fractions of the domain", "length from the", t, "of the domain of that axis: e.g.,", "*" + e + "2 domain* refers to the domain of the second", e, " axis and a", e, "position of 0.5 refers to the", "point between the", t, "and the", n, "of the domain of the", "second", e, "axis." ].join(" "); } }, n5 = h8, r5 = Fr, ch = $r, KX = Sn.templatedArray, uh = G0; function a5(e) { return [ "In order for absolute positioning of the arrow to work, *a" + e + "ref* must be exactly the same as *" + e + "ref*, otherwise *a" + e + "ref* will revert to *pixel* (explained next).", "For relative positioning, *a" + e + "ref* can be set to *pixel*,", "in which case the *a" + e + "* value is specified in pixels", "relative to *" + e + "*.", "Absolute positioning is useful", "for trendline annotations which should continue to indicate", "the correct trend when zoomed. Relative positioning is useful", "for specifying the text offset for an annotated point." ].join(" "); } function i5(e, t, n) { return [ "Sets the", e, "component of the arrow tail about the arrow head.", "If `a" + e + "ref` is `pixel`, a positive (negative)", "component corresponds to an arrow pointing", "from", n, "to", t, "(" + t, "to", n + ").", "If `a" + e + "ref` is not `pixel` and is exactly the same as `" + e + "ref`,", "this is an absolute value on that axis,", "like `" + e + "`, specified in the same coordinates as `" + e + "ref`." ].join(" "); } var ef = KX("annotation", { visible: { valType: "boolean", dflt: !0, editType: "calc+arraydraw", description: [ "Determines whether or not this annotation is visible." ].join(" ") }, text: { valType: "string", editType: "calc+arraydraw", description: [ "Sets the text associated with this annotation.", "Plotly uses a subset of HTML tags to do things like", "newline (
), bold (), italics (),", "hyperlinks (). Tags , , ", " are also supported." ].join(" ") }, textangle: { valType: "angle", dflt: 0, editType: "calc+arraydraw", description: [ "Sets the angle at which the `text` is drawn", "with respect to the horizontal." ].join(" ") }, font: r5({ editType: "calc+arraydraw", colorEditType: "arraydraw", description: "Sets the annotation text font." }), width: { valType: "number", min: 1, dflt: null, editType: "calc+arraydraw", description: [ "Sets an explicit width for the text box. null (default) lets the", "text set the box width. Wider text will be clipped.", "There is no automatic wrapping; use
to start a new line." ].join(" ") }, height: { valType: "number", min: 1, dflt: null, editType: "calc+arraydraw", description: [ "Sets an explicit height for the text box. null (default) lets the", "text set the box height. Taller text will be clipped." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the annotation (text + arrow)." }, align: { valType: "enumerated", values: ["left", "center", "right"], dflt: "center", editType: "arraydraw", description: [ "Sets the horizontal alignment of the `text` within the box.", "Has an effect only if `text` spans two or more lines", "(i.e. `text` contains one or more
HTML tags) or if an", "explicit width is set to override the text width." ].join(" ") }, valign: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "middle", editType: "arraydraw", description: [ "Sets the vertical alignment of the `text` within the box.", "Has an effect only if an explicit height is set to override", "the text height." ].join(" ") }, bgcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: "Sets the background color of the annotation." }, bordercolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: [ "Sets the color of the border enclosing the annotation `text`." ].join(" ") }, borderpad: { valType: "number", min: 0, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the padding (in px) between the `text`", "and the enclosing border." ].join(" ") }, borderwidth: { valType: "number", min: 0, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the width (in px) of the border enclosing", "the annotation `text`." ].join(" ") }, // arrow showarrow: { valType: "boolean", dflt: !0, editType: "calc+arraydraw", description: [ "Determines whether or not the annotation is drawn with an arrow.", "If *true*, `text` is placed near the arrow's tail.", "If *false*, `text` lines up with the `x` and `y` provided." ].join(" ") }, arrowcolor: { valType: "color", editType: "arraydraw", description: "Sets the color of the annotation arrow." }, arrowhead: { valType: "integer", min: 0, max: n5.length, dflt: 1, editType: "arraydraw", description: "Sets the end annotation arrow head style." }, startarrowhead: { valType: "integer", min: 0, max: n5.length, dflt: 1, editType: "arraydraw", description: "Sets the start annotation arrow head style." }, arrowside: { valType: "flaglist", flags: ["end", "start"], extras: ["none"], dflt: "end", editType: "arraydraw", description: "Sets the annotation arrow head position." }, arrowsize: { valType: "number", min: 0.3, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the size of the end annotation arrow head, relative to `arrowwidth`.", "A value of 1 (default) gives a head about 3x as wide as the line." ].join(" ") }, startarrowsize: { valType: "number", min: 0.3, dflt: 1, editType: "calc+arraydraw", description: [ "Sets the size of the start annotation arrow head, relative to `arrowwidth`.", "A value of 1 (default) gives a head about 3x as wide as the line." ].join(" ") }, arrowwidth: { valType: "number", min: 0.1, editType: "calc+arraydraw", description: "Sets the width (in px) of annotation arrow line." }, standoff: { valType: "number", min: 0, dflt: 0, editType: "calc+arraydraw", description: [ "Sets a distance, in pixels, to move the end arrowhead away from the", "position it is pointing at, for example to point at the edge of", "a marker independent of zoom. Note that this shortens the arrow", "from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`", "which moves everything by this amount." ].join(" ") }, startstandoff: { valType: "number", min: 0, dflt: 0, editType: "calc+arraydraw", description: [ "Sets a distance, in pixels, to move the start arrowhead away from the", "position it is pointing at, for example to point at the edge of", "a marker independent of zoom. Note that this shortens the arrow", "from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`", "which moves everything by this amount." ].join(" ") }, ax: { valType: "any", editType: "calc+arraydraw", description: [ i5("x", "left", "right") ].join(" ") }, ay: { valType: "any", editType: "calc+arraydraw", description: [ i5("y", "top", "bottom") ].join(" ") }, axref: { valType: "enumerated", dflt: "pixel", values: [ "pixel", ch.idRegex.x.toString() ], editType: "calc", description: [ "Indicates in what coordinates the tail of the", "annotation (ax,ay) is specified.", uh.axisRefDescription("x", "left", "right"), a5("x") ].join(" ") }, ayref: { valType: "enumerated", dflt: "pixel", values: [ "pixel", ch.idRegex.y.toString() ], editType: "calc", description: [ "Indicates in what coordinates the tail of the", "annotation (ax,ay) is specified.", uh.axisRefDescription("y", "bottom", "top"), a5("y") ].join(" ") }, // positioning xref: { valType: "enumerated", values: [ "paper", ch.idRegex.x.toString() ], editType: "calc", description: [ "Sets the annotation's x coordinate axis.", uh.axisRefDescription("x", "left", "right") ].join(" ") }, x: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the annotation's x position.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the text box's horizontal position anchor", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the annotation.", "For example, if `x` is set to 1, `xref` to *paper* and", "`xanchor` to *right* then the right-most portion of the", "annotation lines up with the right-most edge of the", "plotting area.", "If *auto*, the anchor is equivalent to *center* for", "data-referenced annotations or if there is an arrow,", "whereas for paper-referenced with no arrow, the anchor picked", "corresponds to the closest side." ].join(" ") }, xshift: { valType: "number", dflt: 0, editType: "calc+arraydraw", description: [ "Shifts the position of the whole annotation and arrow to the", "right (positive) or left (negative) by this many pixels." ].join(" ") }, yref: { valType: "enumerated", values: [ "paper", ch.idRegex.y.toString() ], editType: "calc", description: [ "Sets the annotation's y coordinate axis.", uh.axisRefDescription("y", "bottom", "top") ].join(" ") }, y: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the annotation's y position.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the text box's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the annotation.", "For example, if `y` is set to 1, `yref` to *paper* and", "`yanchor` to *top* then the top-most portion of the", "annotation lines up with the top-most edge of the", "plotting area.", "If *auto*, the anchor is equivalent to *middle* for", "data-referenced annotations or if there is an arrow,", "whereas for paper-referenced with no arrow, the anchor picked", "corresponds to the closest side." ].join(" ") }, yshift: { valType: "number", dflt: 0, editType: "calc+arraydraw", description: [ "Shifts the position of the whole annotation and arrow up", "(positive) or down (negative) by this many pixels." ].join(" ") }, clicktoshow: { valType: "enumerated", values: [!1, "onoff", "onout"], dflt: !1, editType: "arraydraw", description: [ "Makes this annotation respond to clicks on the plot.", "If you click a data point that exactly matches the `x` and `y`", "values of this annotation, and it is hidden (visible: false),", "it will appear. In *onoff* mode, you must click the same point", "again to make it disappear, so if you click multiple points,", "you can show multiple annotations. In *onout* mode, a click", "anywhere else in the plot (on another data point or not) will", "hide this annotation.", "If you need to show/hide this annotation in response to different", "`x` or `y` values, you can set `xclick` and/or `yclick`. This is", "useful for example to label the side of a bar. To label markers", "though, `standoff` is preferred over `xclick` and `yclick`." ].join(" ") }, xclick: { valType: "any", editType: "arraydraw", description: [ "Toggle this annotation when clicking a data point whose `x` value", "is `xclick` rather than the annotation's `x` value." ].join(" ") }, yclick: { valType: "any", editType: "arraydraw", description: [ "Toggle this annotation when clicking a data point whose `y` value", "is `yclick` rather than the annotation's `y` value." ].join(" ") }, hovertext: { valType: "string", editType: "arraydraw", description: [ "Sets text to appear when hovering over this annotation.", "If omitted or blank, no hover label will appear." ].join(" ") }, hoverlabel: { bgcolor: { valType: "color", editType: "arraydraw", description: [ "Sets the background color of the hover label.", "By default uses the annotation's `bgcolor` made opaque,", "or white if it was transparent." ].join(" ") }, bordercolor: { valType: "color", editType: "arraydraw", description: [ "Sets the border color of the hover label.", "By default uses either dark grey or white, for maximum", "contrast with `hoverlabel.bgcolor`." ].join(" ") }, font: r5({ editType: "arraydraw", description: [ "Sets the hover label text font.", "By default uses the global hover font and size,", "with color from `hoverlabel.bordercolor`." ].join(" ") }), editType: "arraydraw" }, captureevents: { valType: "boolean", editType: "arraydraw", description: [ "Determines whether the annotation text box captures mouse move", "and click events, or allows those events to pass through to data", "points in the plot that may be behind the annotation. By default", "`captureevents` is *false* unless `hovertext` is provided.", "If you use the event `plotly_clickannotation` without `hovertext`", "you must explicitly enable `captureevents`." ].join(" ") }, editType: "calc", _deprecated: { ref: { valType: "string", editType: "calc", description: [ "Obsolete. Set `xref` and `yref` separately instead." ].join(" ") } } }), Kx = { PTS_LINESONLY: 20, // fixed parameters of clustering and clipping algorithms // fraction of clustering tolerance "so close we don't even consider it a new point" minTolerance: 0.2, // how fast does clustering tolerance increase as you get away from the visible region toleranceGrowth: 10, // number of viewport sizes away from the visible region // at which we clip all lines to the perimeter maxScreensAway: 20, eventDataKeys: [] }, o5 = T0.axisHoverFormat, JX = bi.texttemplateAttrs, QX = bi.hovertemplateAttrs, l5 = Jd, XX = Fr, eee = Yi.dash, tee = Yi.pattern, nee = Cn, s5 = Kx, jv = tr.extendFlat; function c5(e) { return { valType: "any", dflt: 0, editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the period positioning in milliseconds or *M* on the " + e + " axis.", "Special values in the form of *M* could be used to declare", "the number of months. In this case `n` must be a positive integer." ].join(" ") }; } function u5(e) { return { valType: "any", editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the base for period positioning in milliseconds or date string on the " + e + " axis.", "When `" + e + "period` is round number of weeks,", "the `" + e + "period0` by default would be on a Sunday i.e. 2000-01-02,", "otherwise it would be at 2000-01-01." ].join(" ") }; } function d5(e) { return { valType: "enumerated", values: [ "start", "middle", "end" ], dflt: "middle", editType: "calc", description: [ "Only relevant when the axis `type` is *date*.", "Sets the alignment of data points on the " + e + " axis." ].join(" ") }; } var ws = { x: { valType: "data_array", editType: "calc+clearAxisTypes", anim: !0, description: "Sets the x coordinates." }, x0: { valType: "any", dflt: 0, editType: "calc+clearAxisTypes", anim: !0, description: [ "Alternate to `x`.", "Builds a linear space of x coordinates.", "Use with `dx`", "where `x0` is the starting coordinate and `dx` the step." ].join(" ") }, dx: { valType: "number", dflt: 1, editType: "calc", anim: !0, description: [ "Sets the x coordinate step.", "See `x0` for more info." ].join(" ") }, y: { valType: "data_array", editType: "calc+clearAxisTypes", anim: !0, description: "Sets the y coordinates." }, y0: { valType: "any", dflt: 0, editType: "calc+clearAxisTypes", anim: !0, description: [ "Alternate to `y`.", "Builds a linear space of y coordinates.", "Use with `dy`", "where `y0` is the starting coordinate and `dy` the step." ].join(" ") }, dy: { valType: "number", dflt: 1, editType: "calc", anim: !0, description: [ "Sets the y coordinate step.", "See `y0` for more info." ].join(" ") }, xperiod: c5("x"), yperiod: c5("y"), xperiod0: u5("x0"), yperiod0: u5("y0"), xperiodalignment: d5("x"), yperiodalignment: d5("y"), xhoverformat: o5("x"), yhoverformat: o5("y"), offsetgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several traces linked to the same position axis", "or matching axes to the same", "offsetgroup where bars of the same position coordinate will line up." ].join(" ") }, alignmentgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several traces linked to the same position axis", "or matching axes to the same", "alignmentgroup. This controls whether bars compute their positional", "range dependently or independently." ].join(" ") }, stackgroup: { valType: "string", dflt: "", editType: "calc", description: [ "Set several scatter traces (on the same subplot) to the same", "stackgroup in order to add their y values (or their x values if", "`orientation` is *h*). If blank or omitted this trace will not be", "stacked. Stacking also turns `fill` on by default, using *tonexty*", "(*tonextx*) if `orientation` is *h* (*v*) and sets the default", "`mode` to *lines* irrespective of point count.", "You can only stack on a numeric (linear or log) axis.", "Traces in a `stackgroup` will only fill to (or be filled to) other", "traces in the same group. With multiple `stackgroup`s or some", "traces stacked and some not, if fill-linked traces are not already", "consecutive, the later ones will be pushed down in the drawing order." ].join(" ") }, orientation: { valType: "enumerated", values: ["v", "h"], editType: "calc", description: [ "Only relevant in the following cases:", "1. when `scattermode` is set to *group*.", "2. when `stackgroup` is used, and only the first", "`orientation` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`. Sets the", "stacking direction. With *v* (*h*), the y (x) values of subsequent", "traces are added. Also affects the default value of `fill`." ].join(" ") }, groupnorm: { valType: "enumerated", values: ["", "fraction", "percent"], dflt: "", editType: "calc", description: [ "Only relevant when `stackgroup` is used, and only the first", "`groupnorm` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`.", "Sets the normalization for the sum of this `stackgroup`.", "With *fraction*, the value of each trace at each location is", "divided by the sum of all trace values at that location.", "*percent* is the same but multiplied by 100 to show percentages.", "If there are multiple subplots, or multiple `stackgroup`s on one", "subplot, each will be normalized within its own set." ].join(" ") }, stackgaps: { valType: "enumerated", values: ["infer zero", "interpolate"], dflt: "infer zero", editType: "calc", description: [ "Only relevant when `stackgroup` is used, and only the first", "`stackgaps` found in the `stackgroup` will be used - including", "if `visible` is *legendonly* but not if it is `false`.", "Determines how we handle locations at which other traces in this", "group have data but this one does not.", "With *infer zero* we insert a zero at these locations.", "With *interpolate* we linearly interpolate between existing", "values, and extrapolate a constant beyond the existing values." // TODO - implement interrupt mode // '*interrupt* omits this trace from the stack at this location by', // 'dropping abruptly, midway between the existing and missing locations.' ].join(" ") }, text: { valType: "string", dflt: "", arrayOk: !0, editType: "calc", description: [ "Sets text elements associated with each (x,y) pair.", "If a single string, the same string appears over", "all the data points.", "If an array of string, the items are mapped in order to the", "this trace's (x,y) coordinates.", "If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,", "these elements will be seen in the hover labels." ].join(" ") }, texttemplate: JX({}, {}), hovertext: { valType: "string", dflt: "", arrayOk: !0, editType: "style", description: [ "Sets hover text elements associated with each (x,y) pair.", "If a single string, the same string appears over", "all the data points.", "If an array of string, the items are mapped in order to the", "this trace's (x,y) coordinates.", "To be seen, trace `hoverinfo` must contain a *text* flag." ].join(" ") }, mode: { valType: "flaglist", flags: ["lines", "markers", "text"], extras: ["none"], editType: "calc", description: [ "Determines the drawing mode for this scatter trace.", "If the provided `mode` includes *text* then the `text` elements", "appear at the coordinates. Otherwise, the `text` elements", "appear on hover.", "If there are less than " + s5.PTS_LINESONLY + " points", "and the trace is not stacked", "then the default is *lines+markers*. Otherwise, *lines*." ].join(" ") }, hoveron: { valType: "flaglist", flags: ["points", "fills"], editType: "style", description: [ "Do the hover effects highlight individual points (markers or", "line points) or do they highlight filled regions?", "If the fill is *toself* or *tonext* and there are no markers", "or text, then the default is *fills*, otherwise it is *points*." ].join(" ") }, hovertemplate: QX({}, { keys: s5.eventDataKeys }), line: { color: { valType: "color", editType: "style", anim: !0, description: "Sets the line color." }, width: { valType: "number", min: 0, dflt: 2, editType: "style", anim: !0, description: "Sets the line width (in px)." }, shape: { valType: "enumerated", values: ["linear", "spline", "hv", "vh", "hvh", "vhv"], dflt: "linear", editType: "plot", description: [ "Determines the line shape.", "With *spline* the lines are drawn using spline interpolation.", "The other available values correspond to step-wise line shapes." ].join(" ") }, smoothing: { valType: "number", min: 0, max: 1.3, dflt: 1, editType: "plot", description: [ "Has an effect only if `shape` is set to *spline*", "Sets the amount of smoothing.", "*0* corresponds to no smoothing (equivalent to a *linear* shape)." ].join(" ") }, dash: jv({}, eee, { editType: "style" }), backoff: { // we want to have a similar option for the start of the line valType: "number", min: 0, dflt: "auto", arrayOk: !0, editType: "plot", description: [ "Sets the line back off from the end point of the nth line segment (in px).", "This option is useful e.g. to avoid overlap with arrowhead markers.", "With *auto* the lines would trim before markers if `marker.angleref` is set to *previous*." ].join(" ") }, simplify: { valType: "boolean", dflt: !0, editType: "plot", description: [ "Simplifies lines by removing nearly-collinear points. When transitioning", "lines, it may be desirable to disable this so that the number of points", "along the resulting SVG path is unaffected." ].join(" ") }, editType: "plot" }, connectgaps: { valType: "boolean", dflt: !1, editType: "calc", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the provided data arrays are connected." ].join(" ") }, cliponaxis: { valType: "boolean", dflt: !0, editType: "plot", description: [ "Determines whether or not markers and text nodes", "are clipped about the subplot axes.", "To show markers and text nodes above axis lines and tick labels,", "make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*." ].join(" ") }, fill: { valType: "enumerated", values: ["none", "tozeroy", "tozerox", "tonexty", "tonextx", "toself", "tonext"], editType: "calc", description: [ "Sets the area to fill with a solid color.", "Defaults to *none* unless this trace is stacked, then it gets", "*tonexty* (*tonextx*) if `orientation` is *v* (*h*)", "Use with `fillcolor` if not *none*.", "*tozerox* and *tozeroy* fill to x=0 and y=0 respectively.", "*tonextx* and *tonexty* fill between the endpoints of this", "trace and the endpoints of the trace before it, connecting those", "endpoints with straight lines (to make a stacked area graph);", "if there is no trace before it, they behave like *tozerox* and", "*tozeroy*.", "*toself* connects the endpoints of the trace (or each segment", "of the trace if it has gaps) into a closed shape.", "*tonext* fills the space between two traces if one completely", "encloses the other (eg consecutive contour lines), and behaves like", "*toself* if there is no trace before it. *tonext* should not be", "used if one trace does not enclose the other.", "Traces in a `stackgroup` will only fill to (or be filled to) other", "traces in the same group. With multiple `stackgroup`s or some", "traces stacked and some not, if fill-linked traces are not already", "consecutive, the later ones will be pushed down in the drawing order." ].join(" ") }, fillcolor: { valType: "color", editType: "style", anim: !0, description: [ "Sets the fill color.", "Defaults to a half-transparent variant of the line color,", "marker color, or marker line color, whichever is available." ].join(" ") }, fillpattern: tee, marker: jv( { symbol: { valType: "enumerated", values: nee.symbolList, dflt: "circle", arrayOk: !0, editType: "style", description: [ "Sets the marker symbol type.", "Adding 100 is equivalent to appending *-open* to a symbol name.", "Adding 200 is equivalent to appending *-dot* to a symbol name.", "Adding 300 is equivalent to appending *-open-dot*", "or *dot-open* to a symbol name." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, arrayOk: !0, editType: "style", anim: !0, description: "Sets the marker opacity." }, angle: { valType: "angle", dflt: 0, arrayOk: !0, editType: "plot", anim: !1, // TODO: possibly set to true in future description: [ "Sets the marker angle in respect to `angleref`." ].join(" ") }, angleref: { valType: "enumerated", values: ["previous", "up"], dflt: "up", editType: "plot", anim: !1, description: [ "Sets the reference for marker angle.", "With *previous*, angle 0 points along the line from the previous point to this one.", "With *up*, angle 0 points toward the top of the screen." ].join(" ") }, standoff: { valType: "number", min: 0, dflt: 0, arrayOk: !0, editType: "plot", anim: !0, description: [ "Moves the marker away from the data point in the direction of `angle` (in px).", "This can be useful for example if you have another marker at this", "location and you want to point an arrowhead marker at it." ].join(" ") }, size: { valType: "number", min: 0, dflt: 6, arrayOk: !0, editType: "calc", anim: !0, description: "Sets the marker size (in px)." }, maxdisplayed: { valType: "number", min: 0, dflt: 0, editType: "plot", description: [ "Sets a maximum number of points to be drawn on the graph.", "*0* corresponds to no limit." ].join(" ") }, sizeref: { valType: "number", dflt: 1, editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the scale factor used to determine the rendered size of", "marker points. Use with `sizemin` and `sizemode`." ].join(" ") }, sizemin: { valType: "number", min: 0, dflt: 0, editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the minimum size (in px) of the rendered marker points." ].join(" ") }, sizemode: { valType: "enumerated", values: ["diameter", "area"], dflt: "diameter", editType: "calc", description: [ "Has an effect only if `marker.size` is set to a numerical array.", "Sets the rule for which the data in `size` is converted", "to pixels." ].join(" ") }, line: jv( { width: { valType: "number", min: 0, arrayOk: !0, editType: "style", anim: !0, description: "Sets the width (in px) of the lines bounding the marker points." }, editType: "calc" }, l5("marker.line", { anim: !0 }) ), gradient: { type: { valType: "enumerated", values: ["radial", "horizontal", "vertical", "none"], arrayOk: !0, dflt: "none", editType: "calc", description: [ "Sets the type of gradient used to fill the markers" ].join(" ") }, color: { valType: "color", arrayOk: !0, editType: "calc", description: [ "Sets the final color of the gradient fill:", "the center color for radial, the right for horizontal,", "or the bottom for vertical." ].join(" ") }, editType: "calc" }, editType: "calc" }, l5("marker", { anim: !0 }) ), selected: { marker: { opacity: { valType: "number", min: 0, max: 1, editType: "style", description: "Sets the marker opacity of selected points." }, color: { valType: "color", editType: "style", description: "Sets the marker color of selected points." }, size: { valType: "number", min: 0, editType: "style", description: "Sets the marker size of selected points." }, editType: "style" }, textfont: { color: { valType: "color", editType: "style", description: "Sets the text font color of selected points." }, editType: "style" }, editType: "style" }, unselected: { marker: { opacity: { valType: "number", min: 0, max: 1, editType: "style", description: "Sets the marker opacity of unselected points, applied only when a selection exists." }, color: { valType: "color", editType: "style", description: "Sets the marker color of unselected points, applied only when a selection exists." }, size: { valType: "number", min: 0, editType: "style", description: "Sets the marker size of unselected points, applied only when a selection exists." }, editType: "style" }, textfont: { color: { valType: "color", editType: "style", description: "Sets the text font color of unselected points, applied only when a selection exists." }, editType: "style" }, editType: "style" }, textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right" ], dflt: "middle center", arrayOk: !0, editType: "calc", description: [ "Sets the positions of the `text` elements", "with respects to the (x,y) coordinates." ].join(" ") }, textfont: XX({ editType: "calc", colorEditType: "style", arrayOk: !0, description: "Sets the text font." }) }, f5 = ef, h5 = ws.line, ree = Yi.dash, dh = tr.extendFlat, aee = Lo.overrideAll, iee = Sn.templatedArray, p5 = G0, p8 = aee(iee("selection", { type: { valType: "enumerated", values: ["rect", "path"], description: [ "Specifies the selection type to be drawn.", "If *rect*, a rectangle is drawn linking", "(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`) and (`x0`,`y1`).", "If *path*, draw a custom SVG path using `path`." ].join(" ") }, xref: dh({}, f5.xref, { description: [ "Sets the selection's x coordinate axis.", p5.axisRefDescription("x", "left", "right") ].join(" ") }), yref: dh({}, f5.yref, { description: [ "Sets the selection's x coordinate axis.", p5.axisRefDescription("y", "bottom", "top") ].join(" ") }), x0: { valType: "any", description: "Sets the selection's starting x position." }, x1: { valType: "any", description: "Sets the selection's end x position." }, y0: { valType: "any", description: "Sets the selection's starting y position." }, y1: { valType: "any", description: "Sets the selection's end y position." }, path: { valType: "string", editType: "arraydraw", description: [ "For `type` *path* - a valid SVG path similar to `shapes.path` in data coordinates.", "Allowed segments are: M, L and Z." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 0.7, editType: "arraydraw", description: "Sets the opacity of the selection." }, line: { color: h5.color, width: dh({}, h5.width, { min: 1, dflt: 1 }), dash: dh({}, ree, { dflt: "dot" }) } }), "arraydraw", "from-root"), g5 = Ue, fh = Ln, oee = Qi, lee = p8, v5 = wl, see = function(e, t) { oee(e, t, { name: "selections", handleItemDefaults: cee }); for (var n = t.selections, r = 0; r < n.length; r++) { var a = n[r]; a && a.path === void 0 && (a.x0 === void 0 || a.x1 === void 0 || a.y0 === void 0 || a.y1 === void 0) && (t.selections[r] = null); } }; function cee(e, t, n) { function r(T, O) { return g5.coerce(e, t, lee, T, O); } var a = r("path"), i = a ? "path" : "rect", o = r("type", i), l = o !== "path"; l && delete t.path, r("opacity"), r("line.color"), r("line.width"), r("line.dash"); for (var s = ["x", "y"], c = 0; c < 2; c++) { var u = s[c], f = { _fullLayout: n }, h, g, p, v = fh.coerceRef(e, t, f, u); if (h = fh.getFromId(f, v), h._selectionIndices.push(t._index), p = v5.rangeToShapePosition(h), g = v5.shapePositionToRange(h), l) { var y = u + "0", m = u + "1", b = e[y], w = e[m]; e[y] = g(e[y], !0), e[m] = g(e[m], !0), fh.coercePosition(t, f, r, v, y), fh.coercePosition(t, f, r, v, m); var _ = t[y], k = t[m]; _ !== void 0 && k !== void 0 && (t[y] = p(_), t[m] = p(k), e[y] = b, e[m] = w); } } l && g5.noneOrAll(e, t, ["x0", "x1", "y0", "y1"]); } var uee = function(e, t, n) { n("newselection.mode"); var r = n("newselection.line.width"); r && (n("newselection.line.color"), n("newselection.line.dash")), n("activeselection.fillcolor"), n("activeselection.opacity"); }, dee = Rt, m5 = Ue, y5 = mr, W0 = function(e) { return function(t, n) { var r = t[e]; if (Array.isArray(r)) for (var a = dee.subplotsRegistry.cartesian, i = a.idRegex, o = n._subplots, l = o.xaxis, s = o.yaxis, c = o.cartesian, u = n._has("cartesian") || n._has("gl2d"), f = 0; f < r.length; f++) { var h = r[f]; if (m5.isPlainObject(h)) { var g = y5.cleanId(h.xref, "x", !1), p = y5.cleanId(h.yref, "y", !1), v = i.x.test(g), y = i.y.test(p); if (v || y) { u || m5.pushUnique(n._basePlotModules, a); var m = !1; v && l.indexOf(g) === -1 && (l.push(g), m = !0), y && s.indexOf(p) === -1 && (s.push(p), m = !0), m && v && y && c.push(g + p); } } } }; }, x5 = K6, ju = $X, tf = { moduleType: "component", name: "selections", layoutAttributes: p8, supplyLayoutDefaults: see, supplyDrawNewSelectionDefaults: uee, includeBasePlot: W0("selections"), draw: x5.draw, drawOne: x5.drawOne, reselect: ju.reselect, prepSelect: ju.prepSelect, clearOutline: ju.clearOutline, clearSelectionsCache: ju.clearSelectionsCache, selectOnClick: ju.selectOnClick }, Jx = sn, Ba = Ue, b5 = Ba.numberFormat, fee = xi, hee = JL, hh = Rt, g8 = Ba.strTranslate, pee = Ir, w5 = rn, Uo = Cn, gee = Ao, _5 = Ln, vee = bs, mee = Xi, v8 = tu, ph = v8.selectingOrDrawing, yee = v8.freeMode, xee = Nr.FROM_TL, bee = Sx, wee = j0.redrawReglTraces, _ee = kr, jy = mr.getFromId, kee = tf.prepSelect, Tee = tf.clearOutline, Aee = tf.selectOnClick, Pv = G6, Qx = $r, k5 = Qx.MINDRAG, Gr = Qx.MINZOOM, T5 = !0; function Mee(e, t, n, r, a, i, o, l) { var s = e._fullLayout._zoomlayer, c = o + l === "nsew", u = (o + l).length === 1, f, h, g, p, v, y, m, b, w, _, k, T, O, M, C, I, j, P, N, W, J, U, E; n += t.yaxis._shift; function z() { if (f = t.xaxis, h = t.yaxis, w = f._length, _ = h._length, m = f._offset, b = h._offset, g = {}, g[f._id] = f, p = {}, p[h._id] = h, o && l) for (var Pe = t.overlays, ze = 0; ze < Pe.length; ze++) { var Ne = Pe[ze].xaxis; g[Ne._id] = Ne; var nt = Pe[ze].yaxis; p[nt._id] = nt; } v = C5(g), y = C5(p), O = A5(v, l), M = A5(y, o), C = !M && !O, T = S5(e, e._fullLayout._axisMatchGroups, g, p), k = S5(e, e._fullLayout._axisConstraintGroups, g, p, T); var Qe = k.isSubplotConstrained || T.isSubplotConstrained; I = l || Qe, j = o || Qe; var it = e._fullLayout; P = it._has("scattergl"), N = it._has("splom"), W = it._has("svg"); } z(); var F = Lee(M + O, e._fullLayout.dragmode, c), q = y8(t, o + l + "drag", F, n, r, a, i); if (C && !c) return q.onmousedown = null, q.style.pointerEvents = "none", q; var H = { element: q, gd: e, plotinfo: t }; H.prepFn = function(Pe, ze, Ne) { var nt = H.dragmode, Qe = e._fullLayout.dragmode; Qe !== nt && (H.dragmode = Qe), z(), U = e._fullLayout._invScaleX, E = e._fullLayout._invScaleY, C || (c ? Pe.shiftKey ? Qe === "pan" ? Qe = "zoom" : ph(Qe) || (Qe = "pan") : Pe.ctrlKey && (Qe = "pan") : Qe = "pan"), yee(Qe) ? H.minDrag = 1 : H.minDrag = void 0, ph(Qe) ? (H.xaxes = v, H.yaxes = y, kee(Pe, ze, Ne, H, Qe)) : (H.clickFn = Q, ph(nt) && K(), C || (Qe === "zoom" ? (H.moveFn = pe, H.doneFn = Oe, H.minDrag = 1, ve(Pe, ze, Ne)) : Qe === "pan" && (H.moveFn = Ce, H.doneFn = ct))), e._fullLayout._redrag = function() { var it = e._dragdata; if (it && it.element === q) { var rt = e._fullLayout.dragmode; ph(rt) || (z(), vt([0, 0, w, _]), H.moveFn(it.dx, it.dy)); } }; }; function K() { H.plotinfo.selection = !1, Tee(e); } function Q(Pe, ze) { var Ne = H.gd; if (Ne._fullLayout._activeShapeIndex >= 0) { Ne._fullLayout._deactivateShape(Ne); return; } var nt = Ne._fullLayout.clickmode; if (Ry(Ne), Pe === 2 && !u && Xe(), c) nt.indexOf("select") > -1 && Aee(ze, Ne, v, y, t.id, H), nt.indexOf("event") > -1 && gee.click(Ne, ze, t.id); else if (Pe === 1 && u) { var Qe = o ? h : f, it = o === "s" || l === "w" ? 0 : 1, rt = Qe._name + ".range[" + it + "]", bt = See(Qe, it), je = "left", tt = "middle"; if (Qe.fixedrange) return; o ? (tt = o === "n" ? "top" : "bottom", Qe.side === "right" && (je = "right")) : l === "e" && (je = "right"), Ne._context.showAxisRangeEntryBoxes && Jx.select(q).call(pee.makeEditable, { gd: Ne, immediate: !0, background: Ne._fullLayout.paper_bgcolor, text: String(bt), fill: Qe.tickfont ? Qe.tickfont.color : "#444", horizontalAlign: je, verticalAlign: tt }).on("edit", function(pt) { var kt = Qe.d2r(pt); kt !== void 0 && hh.call("_guiRelayout", Ne, rt, kt); }); } } mee.init(H); var re, te, X, ce, B, G, Z, oe, ae, ge; function ve(Pe, ze, Ne) { var nt = q.getBoundingClientRect(); re = ze - nt.left, te = Ne - nt.top, e._fullLayout._calcInverseTransform(e); var Qe = Ba.apply3DTransform(e._fullLayout._invTransform)(re, te); re = Qe[0], te = Qe[1], X = { l: re, r: re, w: 0, t: te, b: te, h: 0 }, ce = e._hmpixcount ? e._hmlumcount / e._hmpixcount : fee(e._fullLayout.plot_bgcolor).getLuminance(), B = "M0,0H" + w + "V" + _ + "H0V0", G = !1, Z = "xy", ge = !1, oe = x8(s, ce, m, b, B), ae = b8(s, m, b); } function pe(Pe, ze) { if (e._transitioningWithDuration) return !1; var Ne = Math.max(0, Math.min(w, U * Pe + re)), nt = Math.max(0, Math.min(_, E * ze + te)), Qe = Math.abs(Ne - re), it = Math.abs(nt - te); X.l = Math.min(re, Ne), X.r = Math.max(re, Ne), X.t = Math.min(te, nt), X.b = Math.max(te, nt); function rt() { Z = "", X.r = X.l, X.t = X.b, ae.attr("d", "M0,0Z"); } if (k.isSubplotConstrained) Qe > Gr || it > Gr ? (Z = "xy", Qe / w > it / _ ? (it = Qe * _ / w, te > nt ? X.t = te - it : X.b = te + it) : (Qe = it * w / _, re > Ne ? X.l = re - Qe : X.r = re + Qe), ae.attr("d", qh(X))) : rt(); else if (T.isSubplotConstrained) if (Qe > Gr || it > Gr) { Z = "xy"; var bt = Math.min(X.l / w, (_ - X.b) / _), je = Math.max(X.r / w, (_ - X.t) / _); X.l = bt * w, X.r = je * w, X.b = (1 - bt) * _, X.t = (1 - je) * _, ae.attr("d", qh(X)); } else rt(); else !M || it < Math.min(Math.max(Qe * 0.6, k5), Gr) ? Qe < k5 || !O ? rt() : (X.t = 0, X.b = _, Z = "x", ae.attr("d", Oee(X, te))) : !O || Qe < Math.min(it * 0.6, Gr) ? (X.l = 0, X.r = w, Z = "y", ae.attr("d", Dee(X, re))) : (Z = "xy", ae.attr("d", qh(X))); X.w = X.r - X.l, X.h = X.b - X.t, Z && (ge = !0), e._dragged = ge, w8(oe, ae, X, B, G, ce), ye(), e.emit("plotly_relayouting", J), G = !0; } function ye() { J = {}, (Z === "xy" || Z === "x") && (Py(v, X.l / w, X.r / w, J, k.xaxes), Ve("x", J)), (Z === "xy" || Z === "y") && (Py(y, (_ - X.b) / _, (_ - X.t) / _, J, k.yaxes), Ve("y", J)); } function Oe() { ye(), Ry(e), ct(), k8(e); } var Be = [0, 0, w, _], Ie = null, Fe = Qx.REDRAWDELAY, Re = t.mainplot ? e._fullLayout._plots[t.mainplot] : t; function We(Pe) { if (!e._context._scrollZoom.cartesian && !e._fullLayout._enablescrollzoom) return; if (K(), e._transitioningWithDuration) { Pe.preventDefault(), Pe.stopPropagation(); return; } z(), clearTimeout(Ie); var ze = -Pe.deltaY; if (isFinite(ze) || (ze = Pe.wheelDelta / 10), !isFinite(ze)) { Ba.log("Did not find wheel motion attributes: ", Pe); return; } var Ne = Math.exp(-Math.min(Math.max(ze, -20), 20) / 200), nt = Re.draglayer.select(".nsewdrag").node().getBoundingClientRect(), Qe = (Pe.clientX - nt.left) / nt.width, it = (nt.bottom - Pe.clientY) / nt.height, rt; function bt(je, tt, pt) { if (je.fixedrange) return; var kt = Ba.simpleMap(je.range, je.r2l), et = kt[0] + (kt[1] - kt[0]) * tt; function ft($e) { return je.l2r(et + ($e - et) * pt); } je.range = kt.map(ft); } if (I) { for (l || (Qe = 0.5), rt = 0; rt < v.length; rt++) bt(v[rt], Qe, Ne); Ve("x"), Be[2] *= Ne, Be[0] += Be[2] * Qe * (1 / Ne - 1); } if (j) { for (o || (it = 0.5), rt = 0; rt < y.length; rt++) bt(y[rt], it, Ne); Ve("y"), Be[3] *= Ne, Be[1] += Be[3] * (1 - it) * (1 / Ne - 1); } vt(Be), Ke(), e.emit("plotly_relayouting", J), Ie = setTimeout(function() { e._fullLayout && (Be = [0, 0, w, _], ct()); }, Fe), Pe.preventDefault(); } o.length * l.length !== 1 && T8(q, We); function Ce(Pe, ze) { if (Pe = Pe * U, ze = ze * E, e._transitioningWithDuration) return; if (e._fullLayout._replotting = !0, O === "ew" || M === "ns") { var Ne = O ? -Pe : 0, nt = M ? -ze : 0; if (T.isSubplotConstrained) { if (O && M) { var Qe = (Pe / w - ze / _) / 2; Pe = Qe * w, ze = -Qe * _, Ne = -Pe, nt = -ze; } M ? Ne = -nt * w / _ : nt = -Ne * _ / w; } O && (M5(v, Pe), Ve("x")), M && (M5(y, ze), Ve("y")), vt([Ne, nt, w, _]), Ke(), e.emit("plotly_relayouting", J); return; } function it(ft, $e, Lt) { for (var $ = 1 - $e, se, ie, de = 0; de < ft.length; de++) { var Te = ft[de]; if (!Te.fixedrange) { se = Te, ie = Te._rl[$] + (Te._rl[$e] - Te._rl[$]) / Cee(Lt / Te._length); var xe = Te.l2r(ie); xe !== !1 && xe !== void 0 && (Te.range[$e] = xe); } } return se._length * (se._rl[$e] - ie) / (se._rl[$e] - se._rl[$]); } var rt = O === "w" == (M === "n") ? 1 : -1; if (O && M && (k.isSubplotConstrained || T.isSubplotConstrained)) { var bt = (Pe / w + rt * ze / _) / 2; Pe = bt * w, ze = rt * bt * _; } var je, tt; if (O === "w" ? Pe = it(v, 0, Pe) : O === "e" ? Pe = it(v, 1, -Pe) : O || (Pe = 0), M === "n" ? ze = it(y, 1, ze) : M === "s" ? ze = it(y, 0, -ze) : M || (ze = 0), je = O === "w" ? Pe : 0, tt = M === "n" ? ze : 0, k.isSubplotConstrained && !T.isSubplotConstrained || // NW or SE on matching axes - create a symmetric zoom T.isSubplotConstrained && O && M && rt > 0) { var pt; if (T.isSubplotConstrained || !O && M.length === 1) { for (pt = 0; pt < v.length; pt++) v[pt].range = v[pt]._r.slice(), Pv(v[pt], 1 - ze / _); Pe = ze * w / _, je = Pe / 2; } if (T.isSubplotConstrained || !M && O.length === 1) { for (pt = 0; pt < y.length; pt++) y[pt].range = y[pt]._r.slice(), Pv(y[pt], 1 - Pe / w); ze = Pe * _ / w, tt = ze / 2; } } (!T.isSubplotConstrained || !M) && Ve("x"), (!T.isSubplotConstrained || !O) && Ve("y"); var kt = w - Pe, et = _ - ze; T.isSubplotConstrained && !(O && M) && (O ? (tt = je ? 0 : Pe * _ / w, et = kt * _ / w) : (je = tt ? 0 : ze * w / _, kt = et * w / _)), vt([je, tt, kt, et]), Ke(), e.emit("plotly_relayouting", J); } function Ve(Pe, ze) { for (var Ne = T.isSubplotConstrained ? { x: y, y: v }[Pe] : T[Pe + "axes"], nt = T.isSubplotConstrained ? { x: v, y }[Pe] : [], Qe = 0; Qe < Ne.length; Qe++) { var it = Ne[Qe], rt = it._id, bt = T.xLinks[rt] || T.yLinks[rt], je = nt[0] || g[bt] || p[bt]; je && (ze ? (ze[it._name + ".range[0]"] = ze[je._name + ".range[0]"], ze[it._name + ".range[1]"] = ze[je._name + ".range[1]"]) : it.range = je.range.slice()); } } function Ke() { var Pe = [], ze; function Ne(rt) { for (ze = 0; ze < rt.length; ze++) rt[ze].fixedrange || Pe.push(rt[ze]._id); } function nt(rt, bt) { for (ze = 0; ze < rt.length; ze++) { var je = rt[ze], tt = je[bt]; !je.fixedrange && tt.tickmode === "sync" && Pe.push(tt._id); } } for (I && (Ne(v), Ne(k.xaxes), Ne(T.xaxes), nt(t.overlays, "xaxis")), j && (Ne(y), Ne(k.yaxes), Ne(T.yaxes), nt(t.overlays, "yaxis")), J = {}, ze = 0; ze < Pe.length; ze++) { var Qe = Pe[ze], it = jy(e, Qe); _5.drawOne(e, it, { skipTitle: !0 }), J[it._name + ".range[0]"] = it.range[0], J[it._name + ".range[1]"] = it.range[1]; } _5.redrawComponents(e, Pe); } function Xe() { if (!e._transitioningWithDuration) { var Pe = e._context.doubleClick, ze = []; O && (ze = ze.concat(v)), M && (ze = ze.concat(y)), T.xaxes && (ze = ze.concat(T.xaxes)), T.yaxes && (ze = ze.concat(T.yaxes)); var Ne = {}, nt, Qe; if (Pe === "reset+autosize") for (Pe = "autosize", Qe = 0; Qe < ze.length; Qe++) { nt = ze[Qe]; var it = nt._rangeInitial0, rt = nt._rangeInitial1, bt = it !== void 0 || rt !== void 0; if (bt && (it !== void 0 && it !== nt.range[0] || rt !== void 0 && rt !== nt.range[1]) || !bt && nt.autorange !== !0) { Pe = "reset"; break; } } if (Pe === "autosize") for (Qe = 0; Qe < ze.length; Qe++) nt = ze[Qe], nt.fixedrange || (Ne[nt._name + ".autorange"] = !0); else if (Pe === "reset") { for ((O || k.isSubplotConstrained) && (ze = ze.concat(k.xaxes)), M && !k.isSubplotConstrained && (ze = ze.concat(k.yaxes)), k.isSubplotConstrained && (O ? M || (ze = ze.concat(y)) : ze = ze.concat(v)), Qe = 0; Qe < ze.length; Qe++) if (nt = ze[Qe], !nt.fixedrange) { var je = nt._name, tt = nt._autorangeInitial; nt._rangeInitial0 === void 0 && nt._rangeInitial1 === void 0 ? Ne[je + ".autorange"] = !0 : nt._rangeInitial0 === void 0 ? (Ne[je + ".autorange"] = tt, Ne[je + ".range"] = [null, nt._rangeInitial1]) : nt._rangeInitial1 === void 0 ? (Ne[je + ".range"] = [nt._rangeInitial0, null], Ne[je + ".autorange"] = tt) : Ne[je + ".range"] = [nt._rangeInitial0, nt._rangeInitial1]; } } e.emit("plotly_doubleclick", null), hh.call("_guiRelayout", e, Ne); } } function ct() { vt([0, 0, w, _]), Ba.syncOrAsync([ _ee.previousPromises, function() { e._fullLayout._replotting = !1, hh.call("_guiRelayout", e, J); } ], e); } function vt(Pe) { var ze = e._fullLayout, Ne = ze._plots, nt = ze._subplots.cartesian, Qe, it, rt, bt; if (N && hh.subplotsRegistry.splom.drag(e), P) { for (Qe = 0; Qe < nt.length; Qe++) if (it = Ne[nt[Qe]], rt = it.xaxis, bt = it.yaxis, it._scene) { var je = Ba.simpleMap(rt.range, rt.r2l), tt = Ba.simpleMap(bt.range, bt.r2l); rt.limitRange && rt.limitRange(), bt.limitRange && bt.limitRange(), je = rt.range, tt = bt.range, it._scene.update({ range: [je[0], tt[0], je[1], tt[1]] }); } } if ((N || P) && (bee(e), wee(e)), W) { var pt = Pe[2] / f._length, kt = Pe[3] / h._length; for (Qe = 0; Qe < nt.length; Qe++) { it = Ne[nt[Qe]], rt = it.xaxis, bt = it.yaxis; var et = (I || T.isSubplotConstrained) && !rt.fixedrange && g[rt._id], ft = (j || T.isSubplotConstrained) && !bt.fixedrange && p[bt._id], $e, Lt, $, se; if (et ? ($e = pt, $ = l || T.isSubplotConstrained ? Pe[0] : dt(rt, $e)) : T.xaHash[rt._id] ? ($e = pt, $ = Pe[0] * rt._length / f._length) : T.yaHash[rt._id] ? ($e = kt, $ = M === "ns" ? -Pe[1] * rt._length / h._length : dt(rt, $e, { n: "top", s: "bottom" }[M])) : ($e = lt(rt, pt, kt), $ = ut(rt, $e)), $e > 1 && (rt.maxallowed !== void 0 && I === (rt.range[0] < rt.range[1] ? "e" : "w") || rt.minallowed !== void 0 && I === (rt.range[0] < rt.range[1] ? "w" : "e")) && ($e = 1, $ = 0), ft ? (Lt = kt, se = o || T.isSubplotConstrained ? Pe[1] : dt(bt, Lt)) : T.yaHash[bt._id] ? (Lt = kt, se = Pe[1] * bt._length / h._length) : T.xaHash[bt._id] ? (Lt = pt, se = O === "ew" ? -Pe[0] * bt._length / f._length : dt(bt, Lt, { e: "right", w: "left" }[O])) : (Lt = lt(bt, pt, kt), se = ut(bt, Lt)), Lt > 1 && (bt.maxallowed !== void 0 && j === (bt.range[0] < bt.range[1] ? "n" : "s") || bt.minallowed !== void 0 && j === (bt.range[0] < bt.range[1] ? "s" : "n")) && (Lt = 1, se = 0), !(!$e && !Lt)) { $e || ($e = 1), Lt || (Lt = 1); var ie = rt._offset - $ / $e, de = bt._offset - se / Lt; it.clipRect.call(Uo.setTranslate, $, se).call(Uo.setScale, $e, Lt), it.plot.call(Uo.setTranslate, ie, de).call(Uo.setScale, 1 / $e, 1 / Lt), ($e !== it.xScaleFactor || Lt !== it.yScaleFactor) && (Uo.setPointGroupScale(it.zoomScalePts, $e, Lt), Uo.setTextPointsScale(it.zoomScaleTxt, $e, Lt)), Uo.hideOutsideRangePoints(it.clipOnAxisFalseTraces, it), it.xScaleFactor = $e, it.yScaleFactor = Lt; } } } } function lt(Pe, ze, Ne) { return Pe.fixedrange ? 0 : I && k.xaHash[Pe._id] ? ze : j && (k.isSubplotConstrained ? k.xaHash : k.yaHash)[Pe._id] ? Ne : 0; } function ut(Pe, ze) { return ze ? (Pe.range = Pe._r.slice(), Pv(Pe, ze), dt(Pe, ze)) : 0; } function dt(Pe, ze, Ne) { return Pe._length * (1 - ze) * xee[Ne || Pe.constraintoward || "middle"]; } return q; } function m8(e, t, n, r) { var a = Ba.ensureSingle(e.draglayer, t, n, function(i) { i.classed("drag", !0).style({ fill: "transparent", "stroke-width": 0 }).attr("data-subplot", e.id); }); return a.call(vee, r), a.node(); } function y8(e, t, n, r, a, i, o) { var l = m8(e, "rect", t, n); return Jx.select(l).call(Uo.setRect, r, a, i, o), l; } function A5(e, t) { for (var n = 0; n < e.length; n++) if (!e[n].fixedrange) return t; return ""; } function See(e, t) { var n = e.range[t], r = Math.abs(n - e.range[1 - t]), a; return e.type === "date" ? n : e.type === "log" ? (a = Math.ceil(Math.max(0, -Math.log(r) / Math.LN10)) + 3, b5("." + a + "g")(Math.pow(10, n))) : (a = Math.floor(Math.log(Math.abs(n)) / Math.LN10) - Math.floor(Math.log(r) / Math.LN10) + 4, b5("." + String(a) + "g")(n)); } function Py(e, t, n, r, a) { for (var i = 0; i < e.length; i++) { var o = e[i]; if (!o.fixedrange) if (o.rangebreaks) { var l = o._id.charAt(0) === "y", s = l ? 1 - t : t, c = l ? 1 - n : n; r[o._name + ".range[0]"] = o.l2r(o.p2l(s * o._length)), r[o._name + ".range[1]"] = o.l2r(o.p2l(c * o._length)); } else { var u = o._rl[0], f = o._rl[1] - u; r[o._name + ".range[0]"] = o.l2r(u + f * t), r[o._name + ".range[1]"] = o.l2r(u + f * n); } } if (a && a.length) { var h = (t + (1 - n)) / 2; Py(a, h, 1 - h, r, []); } } function M5(e, t) { for (var n = 0; n < e.length; n++) { var r = e[n]; if (!r.fixedrange) { if (r.rangebreaks) { var a = 0, i = r._length, o = r.p2l(a + t) - r.p2l(a), l = r.p2l(i + t) - r.p2l(i), s = (o + l) / 2; r.range = [ r.l2r(r._rl[0] - s), r.l2r(r._rl[1] - s) ]; } else r.range = [ r.l2r(r._rl[0] - t / r._m), r.l2r(r._rl[1] - t / r._m) ]; r.limitRange && r.limitRange(); } } } function Cee(e) { return 1 - (e >= 0 ? Math.min(e, 0.9) : 1 / (1 / Math.max(e, -0.3) + 3.222)); } function Lee(e, t, n) { return e ? e === "nsew" ? n ? "" : t === "pan" ? "move" : "crosshair" : e.toLowerCase() + "-resize" : "pointer"; } function x8(e, t, n, r, a) { return e.append("path").attr("class", "zoombox").style({ fill: t > 0.2 ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)", "stroke-width": 0 }).attr("transform", g8(n, r)).attr("d", a + "Z"); } function b8(e, t, n) { return e.append("path").attr("class", "zoombox-corners").style({ fill: w5.background, stroke: w5.defaultLine, "stroke-width": 1, opacity: 0 }).attr("transform", g8(t, n)).attr("d", "M0,0Z"); } function w8(e, t, n, r, a, i) { e.attr( "d", r + "M" + n.l + "," + n.t + "v" + n.h + "h" + n.w + "v-" + n.h + "h-" + n.w + "Z" ), _8(e, t, a, i); } function _8(e, t, n, r) { n || (e.transition().style("fill", r > 0.2 ? "rgba(0,0,0,0.4)" : "rgba(255,255,255,0.3)").duration(200), t.transition().style("opacity", 1).duration(200)); } function Ry(e) { Jx.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove(); } function k8(e) { T5 && e.data && e._context.showTips && (Ba.notifier(Ba._(e, "Double-click to zoom back out"), "long"), T5 = !1); } function Oee(e, t) { return "M" + (e.l - 0.5) + "," + (t - Gr - 0.5) + "h-3v" + (2 * Gr + 1) + "h3ZM" + (e.r + 0.5) + "," + (t - Gr - 0.5) + "h3v" + (2 * Gr + 1) + "h-3Z"; } function Dee(e, t) { return "M" + (t - Gr - 0.5) + "," + (e.t - 0.5) + "v-3h" + (2 * Gr + 1) + "v3ZM" + (t - Gr - 0.5) + "," + (e.b + 0.5) + "v3h" + (2 * Gr + 1) + "v-3Z"; } function qh(e) { var t = Math.floor(Math.min(e.b - e.t, e.r - e.l, Gr) / 2); return "M" + (e.l - 3.5) + "," + (e.t - 0.5 + t) + "h3v" + -t + "h" + t + "v-3h-" + (t + 3) + "ZM" + (e.r + 3.5) + "," + (e.t - 0.5 + t) + "h-3v" + -t + "h" + -t + "v-3h" + (t + 3) + "ZM" + (e.r + 3.5) + "," + (e.b + 0.5 - t) + "h-3v" + t + "h" + -t + "v3h" + (t + 3) + "ZM" + (e.l - 3.5) + "," + (e.b + 0.5 - t) + "h3v" + t + "h" + t + "v3h-" + (t + 3) + "Z"; } function S5(e, t, n, r, a) { for (var i = !1, o = {}, l = {}, s, c, u, f, h = (a || {}).xaHash, g = (a || {}).yaHash, p = 0; p < t.length; p++) { var v = t[p]; for (s in n) if (v[s]) { for (u in v) !(a && (h[u] || g[u])) && !(u.charAt(0) === "x" ? n : r)[u] && (o[u] = s); for (c in r) !(a && (h[c] || g[c])) && v[c] && (i = !0); } for (c in r) if (v[c]) for (f in v) !(a && (h[f] || g[f])) && !(f.charAt(0) === "x" ? n : r)[f] && (l[f] = c); } i && (Ba.extendFlat(o, l), l = {}); var y = {}, m = []; for (u in o) { var b = jy(e, u); m.push(b), y[b._id] = b; } var w = {}, _ = []; for (f in l) { var k = jy(e, f); _.push(k), w[k._id] = k; } return { xaHash: y, yaHash: w, xaxes: m, yaxes: _, xLinks: o, yLinks: l, isSubplotConstrained: i }; } function T8(e, t) { if (!hee) e.onwheel !== void 0 ? e.onwheel = t : e.onmousewheel !== void 0 ? e.onmousewheel = t : e.isAddedWheelEvent || (e.isAddedWheelEvent = !0, e.addEventListener("wheel", t, { passive: !1 })); else { var n = e.onwheel !== void 0 ? "wheel" : "mousewheel"; e._onwheel && e.removeEventListener(n, e._onwheel), e._onwheel = t, e.addEventListener(n, t, { passive: !1 }); } } function C5(e) { var t = []; for (var n in e) t.push(e[n]); return t; } var Fee = { makeDragBox: Mee, makeDragger: m8, makeRectDragger: y8, makeZoombox: x8, makeCorners: b8, updateZoombox: w8, xyCorners: qh, transitionZoombox: _8, removeZoombox: Ry, showDoubleClickNotifier: k8, attachWheelEventHandler: T8 }; (function(e) { var t = sn, n = Ao, r = Xi, a = bs, i = Fee.makeDragBox, o = $r.DRAGGERSIZE; e.initInteractions = function(l) { var s = l._fullLayout; if (l._context.staticPlot) { t.select(l).selectAll(".drag").remove(); return; } if (!(!s._has("cartesian") && !s._has("splom"))) { var c = Object.keys(s._plots || {}).sort(function(f, h) { if ((s._plots[f].mainplot && !0) === (s._plots[h].mainplot && !0)) { var g = f.split("y"), p = h.split("y"); return g[0] === p[0] ? Number(g[1] || 1) - Number(p[1] || 1) : Number(g[0] || 1) - Number(p[0] || 1); } return s._plots[f].mainplot ? 1 : -1; }); c.forEach(function(f) { var h = s._plots[f], g = h.xaxis, p = h.yaxis; if (!h.mainplot) { var v = i( l, h, g._offset, p._offset, g._length, p._length, "ns", "ew" ); v.onmousemove = function(b) { l._fullLayout._rehover = function() { l._fullLayout._hoversubplot === f && l._fullLayout._plots[f] && n.hover(l, b, f); }, n.hover(l, b, f), l._fullLayout._lasthover = v, l._fullLayout._hoversubplot = f; }, v.onmouseout = function(b) { l._dragging || (l._fullLayout._hoversubplot = null, r.unhover(l, b)); }, l._context.showAxisDragHandles && (i( l, h, g._offset - o, p._offset - o, o, o, "n", "w" ), i( l, h, g._offset + g._length, p._offset - o, o, o, "n", "e" ), i( l, h, g._offset - o, p._offset + p._length, o, o, "s", "w" ), i( l, h, g._offset + g._length, p._offset + p._length, o, o, "s", "e" )); } if (l._context.showAxisDragHandles) { if (f === g._mainSubplot) { var y = g._mainLinePosition; g.side === "top" && (y -= o), i( l, h, g._offset + g._length * 0.1, y, g._length * 0.8, o, "", "ew" ), i( l, h, g._offset, y, g._length * 0.1, o, "", "w" ), i( l, h, g._offset + g._length * 0.9, y, g._length * 0.1, o, "", "e" ); } if (f === p._mainSubplot) { var m = p._mainLinePosition; p.side !== "right" && (m -= o), i( l, h, m, p._offset + p._length * 0.1, o, p._length * 0.8, "ns", "" ), i( l, h, m, p._offset + p._length * 0.9, o, p._length * 0.1, "s", "" ), i( l, h, m, p._offset, o, p._length * 0.1, "n", "" ); } } }); var u = s._hoverlayer.node(); u.onmousemove = function(f) { f.target = l._fullLayout._lasthover, n.hover(l, f, s._hoversubplot); }, u.onclick = function(f) { f.target = l._fullLayout._lasthover, n.click(l, f); }, u.onmousedown = function(f) { l._fullLayout._lasthover.onmousedown(f); }, e.updateFx(l); } }, e.updateFx = function(l) { var s = l._fullLayout, c = s.dragmode === "pan" ? "move" : "crosshair"; a(s._draggers, c); }; })(_x); var nf = {}, L5 = Rt, Iee = function(e) { for (var t = L5.layoutArrayContainers, n = L5.layoutArrayRegexes, r = e.split("[")[0], a, i, o = 0; o < n.length; o++) if (i = e.match(n[o]), i && i.index === 0) { a = i[0]; break; } if (a || (a = t[t.indexOf(r)]), !a) return !1; var l = e.substr(a.length); return l ? (i = l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/), i ? { array: a, index: Number(i[1]), property: i[3] || "" } : !1) : { array: a, index: "", property: "" }; }, zee = gs, Rv = G1, Pu = $c, Eee = $1.sorterAsc, Nv = Rt; nf.containerArrayMatch = Iee; var jee = nf.isAddVal = function(e) { return e === "add" || zee(e); }, O5 = nf.isRemoveVal = function(e) { return e === null || e === "remove"; }; nf.applyContainerArrayChanges = function(e, t, n, r, a) { var i = t.astr, o = Nv.getComponentMethod(i, "supplyLayoutDefaults"), l = Nv.getComponentMethod(i, "draw"), s = Nv.getComponentMethod(i, "drawOne"), c = r.replot || r.recalc || o === Rv || l === Rv, u = e.layout, f = e._fullLayout; if (n[""]) { Object.keys(n).length > 1 && Pu.warn( "Full array edits are incompatible with other edits", i ); var h = n[""][""]; if (O5(h)) t.set(null); else if (Array.isArray(h)) t.set(h); else return Pu.warn("Unrecognized full array edit value", i, h), !0; return c ? !1 : (o(u, f), l(e), !0); } var g = Object.keys(n).map(Number).sort(Eee), p = t.get(), v = p || [], y = a(f, i).get(), m = [], b = -1, w = v.length, _, k, T, O, M, C, I, j; for (_ = 0; _ < g.length; _++) { if (T = g[_], O = n[T], M = Object.keys(O), C = O[""], I = jee(C), T < 0 || T > v.length - (I ? 0 : 1)) { Pu.warn("index out of range", i, T); continue; } if (C !== void 0) M.length > 1 && Pu.warn( "Insertion & removal are incompatible with edits to the same index.", i, T ), O5(C) ? m.push(T) : I ? (C === "add" && (C = {}), v.splice(T, 0, C), y && y.splice(T, 0, {})) : Pu.warn( "Unrecognized full object edit value", i, T, C ), b === -1 && (b = T); else for (k = 0; k < M.length; k++) j = i + "[" + T + "].", a(v[T], M[k], j).set(O[M[k]]); } for (_ = m.length - 1; _ >= 0; _--) v.splice(m[_], 1), y && y.splice(m[_], 1); if (v.length ? p || t.set(v) : t.set(null), c) return !1; if (o(u, f), s !== Rv) { var P; if (b === -1) P = g; else { for (w = Math.max(v.length, w), P = [], _ = 0; _ < g.length && (T = g[_], !(T >= b)); _++) P.push(T); for (_ = b; _ < w; _++) P.push(_); } for (_ = 0; _ < P.length; _++) s(e, P[_]); } else l(e); return !0; }; var A8 = {}; (function(e) { var t = cn, n = iC, r = Rt, a = Ue, i = kr, o = mr, l = rn, s = o.cleanId, c = o.getFromTrace, u = r.traceIs; e.clearPromiseQueue = function(_) { Array.isArray(_._promises) && _._promises.length > 0 && a.log("Clearing previous rejected promises from queue."), _._promises = []; }, e.cleanLayout = function(_) { var k, T; _ || (_ = {}), _.xaxis1 && (_.xaxis || (_.xaxis = _.xaxis1), delete _.xaxis1), _.yaxis1 && (_.yaxis || (_.yaxis = _.yaxis1), delete _.yaxis1), _.scene1 && (_.scene || (_.scene = _.scene1), delete _.scene1); var O = (i.subplotsRegistry.cartesian || {}).attrRegex, M = (i.subplotsRegistry.polar || {}).attrRegex, C = (i.subplotsRegistry.ternary || {}).attrRegex, I = (i.subplotsRegistry.gl3d || {}).attrRegex, j = Object.keys(_); for (k = 0; k < j.length; k++) { var P = j[k]; if (O && O.test(P)) { var N = _[P]; N.anchor && N.anchor !== "free" && (N.anchor = s(N.anchor)), N.overlaying && (N.overlaying = s(N.overlaying)), N.type || (N.isdate ? N.type = "date" : N.islog ? N.type = "log" : N.isdate === !1 && N.islog === !1 && (N.type = "linear")), (N.autorange === "withzero" || N.autorange === "tozero") && (N.autorange = !0, N.rangemode = "tozero"), N.insiderange && delete N.range, delete N.islog, delete N.isdate, delete N.categories, y(N, "domain") && delete N.domain, N.autotick !== void 0 && (N.tickmode === void 0 && (N.tickmode = N.autotick ? "auto" : "linear"), delete N.autotick), h(N); } else if (M && M.test(P)) { var W = _[P]; h(W.radialaxis); } else if (C && C.test(P)) { var J = _[P]; h(J.aaxis), h(J.baxis), h(J.caxis); } else if (I && I.test(P)) { var U = _[P], E = U.cameraposition; if (Array.isArray(E) && E[0].length === 4) { var z = E[0], F = E[1], q = E[2], H = n([], z), K = []; for (T = 0; T < 3; ++T) K[T] = F[T] + q * H[2 + 4 * T]; U.camera = { eye: { x: K[0], y: K[1], z: K[2] }, center: { x: F[0], y: F[1], z: F[2] }, up: { x: 0, y: 0, z: 1 } // we just ignore calculating camera z up in this case }, delete U.cameraposition; } h(U.xaxis), h(U.yaxis), h(U.zaxis); } } var Q = Array.isArray(_.annotations) ? _.annotations.length : 0; for (k = 0; k < Q; k++) { var re = _.annotations[k]; a.isPlainObject(re) && (re.ref && (re.ref === "paper" ? (re.xref = "paper", re.yref = "paper") : re.ref === "data" && (re.xref = "x", re.yref = "y"), delete re.ref), f(re, "xref"), f(re, "yref")); } var te = Array.isArray(_.shapes) ? _.shapes.length : 0; for (k = 0; k < te; k++) { var X = _.shapes[k]; a.isPlainObject(X) && (f(X, "xref"), f(X, "yref")); } var ce = Array.isArray(_.images) ? _.images.length : 0; for (k = 0; k < ce; k++) { var B = _.images[k]; a.isPlainObject(B) && (f(B, "xref"), f(B, "yref")); } var G = _.legend; return G && (G.x > 3 ? (G.x = 1.02, G.xanchor = "left") : G.x < -2 && (G.x = -0.02, G.xanchor = "right"), G.y > 3 ? (G.y = 1.02, G.yanchor = "bottom") : G.y < -2 && (G.y = -0.02, G.yanchor = "top")), h(_), _.dragmode === "rotate" && (_.dragmode = "orbit"), l.clean(_), _.template && _.template.layout && e.cleanLayout(_.template.layout), _; }; function f(_, k) { var T = _[k], O = k.charAt(0); T && T !== "paper" && (_[k] = s(T, O, !0)); } function h(_) { _ && ((typeof _.title == "string" || typeof _.title == "number") && (_.title = { text: _.title }), k("titlefont", "font"), k("titleposition", "position"), k("titleside", "side"), k("titleoffset", "offset")); function k(T, O) { var M = _[T], C = _.title && _.title[O]; M && !C && (_.title || (_.title = {}), _.title[O] = _[T], delete _[T]); } } e.cleanData = function(_) { for (var k = 0; k < _.length; k++) { var T = _[k], O; if (T.type === "histogramy" && "xbins" in T && !("ybins" in T) && (T.ybins = T.xbins, delete T.xbins), T.error_y && "opacity" in T.error_y) { var M = l.defaults, C = T.error_y.color || (u(T, "bar") ? l.defaultLine : M[k % M.length]); T.error_y.color = l.addOpacity( l.rgb(C), l.opacity(C) * T.error_y.opacity ), delete T.error_y.opacity; } if ("bardir" in T && (T.bardir === "h" && (u(T, "bar") || T.type.substr(0, 9) === "histogram") && (T.orientation = "h", e.swapXYData(T)), delete T.bardir), T.type === "histogramy" && e.swapXYData(T), (T.type === "histogramx" || T.type === "histogramy") && (T.type = "histogram"), "scl" in T && !("colorscale" in T) && (T.colorscale = T.scl, delete T.scl), "reversescl" in T && !("reversescale" in T) && (T.reversescale = T.reversescl, delete T.reversescl), T.xaxis && (T.xaxis = s(T.xaxis, "x")), T.yaxis && (T.yaxis = s(T.yaxis, "y")), u(T, "gl3d") && T.scene && (T.scene = i.subplotsRegistry.gl3d.cleanId(T.scene)), !u(T, "pie-like") && !u(T, "bar-like")) if (Array.isArray(T.textposition)) for (O = 0; O < T.textposition.length; O++) T.textposition[O] = v(T.textposition[O]); else T.textposition && (T.textposition = v(T.textposition)); var I = r.getModule(T); if (I && I.colorbar) { var j = I.colorbar.container, P = j ? T[j] : T; P && P.colorscale && (P.colorscale === "YIGnBu" && (P.colorscale = "YlGnBu"), P.colorscale === "YIOrRd" && (P.colorscale = "YlOrRd")); } if (T.type === "surface" && a.isPlainObject(T.contours)) { var N = ["x", "y", "z"]; for (O = 0; O < N.length; O++) { var W = T.contours[N[O]]; a.isPlainObject(W) && (W.highlightColor && (W.highlightcolor = W.highlightColor, delete W.highlightColor), W.highlightWidth && (W.highlightwidth = W.highlightWidth, delete W.highlightWidth)); } } if (T.type === "candlestick" || T.type === "ohlc") { var J = (T.increasing || {}).showlegend !== !1, U = (T.decreasing || {}).showlegend !== !1, E = g(T.increasing), z = g(T.decreasing); if (E !== !1 && z !== !1) { var F = p( E, z, J, U ); F && (T.name = F); } else (E || z) && !T.name && (T.name = E || z); } if (Array.isArray(T.transforms)) { var q = T.transforms; for (O = 0; O < q.length; O++) { var H = q[O]; if (a.isPlainObject(H)) switch (H.type) { case "filter": H.filtersrc && (H.target = H.filtersrc, delete H.filtersrc), H.calendar && (H.valuecalendar || (H.valuecalendar = H.calendar), delete H.calendar); break; case "groupby": if (H.styles = H.styles || H.style, H.styles && !Array.isArray(H.styles)) { var K = H.styles, Q = Object.keys(K); H.styles = []; for (var re = 0; re < Q.length; re++) H.styles.push({ target: Q[re], value: K[Q[re]] }); } break; } } } y(T, "line") && delete T.line, "marker" in T && (y(T.marker, "line") && delete T.marker.line, y(T, "marker") && delete T.marker), l.clean(T), T.autobinx && (delete T.autobinx, delete T.xbins), T.autobiny && (delete T.autobiny, delete T.ybins), h(T), T.colorbar && h(T.colorbar), T.marker && T.marker.colorbar && h(T.marker.colorbar), T.line && T.line.colorbar && h(T.line.colorbar), T.aaxis && h(T.aaxis), T.baxis && h(T.baxis); } }; function g(_) { if (!a.isPlainObject(_)) return !1; var k = _.name; return delete _.name, delete _.showlegend, (typeof k == "string" || typeof k == "number") && String(k); } function p(_, k, T, O) { if (T && !O) return _; if (O && !T || !_.trim()) return k; if (!k.trim()) return _; var M = Math.min(_.length, k.length), C; for (C = 0; C < M && _.charAt(C) === k.charAt(C); C++) ; var I = _.substr(0, C); return I.trim(); } function v(_) { var k = "middle", T = "center"; return typeof _ == "string" && (_.indexOf("top") !== -1 ? k = "top" : _.indexOf("bottom") !== -1 && (k = "bottom"), _.indexOf("left") !== -1 ? T = "left" : _.indexOf("right") !== -1 && (T = "right")), k + " " + T; } function y(_, k) { return k in _ && typeof _[k] == "object" && Object.keys(_[k]).length === 0; } e.swapXYData = function(_) { var k; if (a.swapAttrs(_, ["?", "?0", "d?", "?bins", "nbins?", "autobin?", "?src", "error_?"]), Array.isArray(_.z) && Array.isArray(_.z[0]) && (_.transpose ? delete _.transpose : _.transpose = !0), _.error_x && _.error_y) { var T = _.error_y, O = "copy_ystyle" in T ? T.copy_ystyle : !(T.color || T.thickness || T.width); a.swapAttrs(_, ["error_?.copy_ystyle"]), O && a.swapAttrs(_, ["error_?.color", "error_?.thickness", "error_?.width"]); } if (typeof _.hoverinfo == "string") { var M = _.hoverinfo.split("+"); for (k = 0; k < M.length; k++) M[k] === "x" ? M[k] = "y" : M[k] === "y" && (M[k] = "x"); _.hoverinfo = M.join("+"); } }, e.coerceTraceIndices = function(_, k) { if (t(k)) return [k]; if (!Array.isArray(k) || !k.length) return _.data.map(function(M, C) { return C; }); if (Array.isArray(k)) { for (var T = [], O = 0; O < k.length; O++) a.isIndex(k[O], _.data.length) ? T.push(k[O]) : a.warn("trace index (", k[O], ") is not a number or is out of bounds"); return T; } return k; }, e.manageArrayContainers = function(_, k, T) { var O = _.obj, M = _.parts, C = M.length, I = M[C - 1], j = t(I); if (j && k === null) { var P = M.slice(0, C - 1).join("."), N = a.nestedProperty(O, P).get(); N.splice(I, 1); } else j && _.get() === void 0 && _.get() === void 0 && (T[_.astr] = null), _.set(k); }; var m = /(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/; function b(_) { var k = _.search(m); if (k > 0) return _.substr(0, k); } e.hasParent = function(_, k) { for (var T = b(k); T; ) { if (T in _) return !0; T = b(T); } return !1; }; var w = ["x", "y", "z"]; e.clearAxisTypes = function(_, k, T) { for (var O = 0; O < k.length; O++) for (var M = _._fullData[O], C = 0; C < 3; C++) { var I = c(_, M, w[C]); if (I && I.type !== "log") { var j = I._name, P = I._id.substr(1); if (P.substr(0, 5) === "scene") { if (T[P] !== void 0) continue; j = P + "." + j; } var N = j + ".type"; T[j] === void 0 && T[N] === void 0 && a.nestedProperty(_.layout, N).set(null); } } }; })(A8); (function(e) { var t = sn, n = cn, r = jC, a = Ue, i = a.nestedProperty, o = w0, l = FW, s = Rt, c = Qc, u = kr, f = Ln, h = $L, g = Ji, p = Cn, v = rn, y = _x.initInteractions, m = yl, b = tf.clearOutline, w = Yc.dfltConfig, _ = nf, k = A8, T = j0, O = Lo, M = $r.AX_NAME_PATTERN, C = 0, I = 5; function j($, se, ie, de) { var Te; if ($ = a.getGraphDiv($), o.init($), a.isPlainObject(se)) { var xe = se; se = xe.data, ie = xe.layout, de = xe.config, Te = xe.frames; } var Ge = o.triggerHandler($, "plotly_beforeplot", [se, ie, de]); if (Ge === !1) return Promise.reject(); !se && !ie && !a.isPlotDiv($) && a.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.", $); function qe() { if (Te) return e.addFrames($, Te); } U($, de), ie || (ie = {}), t.select($).classed("js-plotly-plot", !0), p.makeTester(), Array.isArray($._promises) || ($._promises = []); var De = ($.data || []).length === 0 && Array.isArray(se); Array.isArray(se) && (k.cleanData(se), De ? $.data = se : $.data.push.apply($.data, se), $.empty = !1), (!$.layout || De) && ($.layout = k.cleanLayout(ie)), u.supplyDefaults($); var le = $._fullLayout, Se = le._has("cartesian"); le._replotting = !0, (De || le._shouldCreateBgLayer) && (Lt($), le._shouldCreateBgLayer && delete le._shouldCreateBgLayer), p.initGradients($), p.initPatterns($), De && f.saveShowSpikeInitial($); var He = !$.calcdata || $.calcdata.length !== ($._fullData || []).length; He && u.doCalcdata($); for (var Je = 0; Je < $.calcdata.length; Je++) $.calcdata[Je][0].trace = $._fullData[Je]; $._context.responsive ? $._responsiveChartHandler || ($._responsiveChartHandler = function() { a.isHidden($) || u.resize($); }, window.addEventListener("resize", $._responsiveChartHandler)) : a.clearResponsive($); var Dt = a.extendFlat({}, le._size), zt = 0; function Pt() { for (var Et = le._basePlotModules, At = 0; At < Et.length; At++) Et[At].drawFramework && Et[At].drawFramework($); !le._glcanvas && le._has("gl") && (le._glcanvas = le._glcontainer.selectAll(".gl-canvas").data([{ key: "contextLayer", context: !0, pick: !1 }, { key: "focusLayer", context: !1, pick: !1 }, { key: "pickLayer", context: !1, pick: !0 }], function(Mt) { return Mt.key; }), le._glcanvas.enter().append("canvas").attr("class", function(Mt) { return "gl-canvas gl-canvas-" + Mt.key.replace("Layer", ""); }).style({ position: "absolute", top: 0, left: 0, overflow: "visible", "pointer-events": "none" })); var Ot = $._context.plotGlPixelRatio; if (le._glcanvas) { le._glcanvas.attr("width", le.width * Ot).attr("height", le.height * Ot).style("width", le.width + "px").style("height", le.height + "px"); var qt = le._glcanvas.data()[0].regl; if (qt && (Math.floor(le.width * Ot) !== qt._gl.drawingBufferWidth || Math.floor(le.height * Ot) !== qt._gl.drawingBufferHeight)) { var dn = "WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug."; if (zt) a.error(dn); else return a.log(dn + " Clearing graph and plotting again."), u.cleanPlot([], {}, $._fullData, le), u.supplyDefaults($), le = $._fullLayout, u.doCalcdata($), zt++, Pt(); } } return le.modebar.orientation === "h" ? le._modebardiv.style("height", null).style("width", "100%") : le._modebardiv.style("width", null).style("height", le.height + "px"), u.previousPromises($); } function _t() { if (u.clearAutoMarginIds($), T.drawMarginPushers($), f.allowAutoMargin($), $._fullLayout.title.text && $._fullLayout.title.automargin && u.allowAutoMargin($, "title.automargin"), le._has("pie")) for (var Et = $._fullData, At = 0; At < Et.length; At++) { var Ot = Et[At]; Ot.type === "pie" && Ot.automargin && u.allowAutoMargin($, "pie." + Ot.uid + ".automargin"); } return u.doAutoMargin($), u.previousPromises($); } function $t() { if (u.didMarginChange(Dt, le._size)) return a.syncOrAsync([ _t, T.layoutStyles ], $); } function Nt() { if (!He) { wt(); return; } return a.syncOrAsync([ s.getComponentMethod("shapes", "calcAutorange"), s.getComponentMethod("annotations", "calcAutorange"), wt ], $); } function wt() { $._transitioning || (T.doAutoRangeAndConstraints($), De && f.saveRangeInitial($), s.getComponentMethod("rangeslider", "calcAutorange")($)); } function Yt() { return f.draw($, De ? "" : "redraw"); } var Jt = [ u.previousPromises, qe, Pt, _t, $t ]; Se && Jt.push(Nt), Jt.push(T.layoutStyles), Se && Jt.push( Yt, function(Et) { var At = Et._fullLayout._insideTickLabelsUpdaterange; if (At) return Et._fullLayout._insideTickLabelsUpdaterange = void 0, Ie(Et, At).then(function() { f.saveRangeInitial(Et, !0); }); } ), Jt.push( T.drawData, T.finalDraw, y, u.addLinks, u.rehover, u.redrag, u.reselect, // TODO: doAutoMargin is only needed here for axis automargin, which // happens outside of marginPushers where all the other automargins are // calculated. Would be much better to separate margin calculations from // component drawing - see https://github.com/plotly/plotly.js/issues/2704 u.doAutoMargin, u.previousPromises ); var jt = a.syncOrAsync(Jt, $); return (!jt || !jt.then) && (jt = Promise.resolve()), jt.then(function() { return P($), $; }); } function P($) { var se = $._fullLayout; se._redrawFromAutoMarginCount ? se._redrawFromAutoMarginCount-- : $.emit("plotly_afterplot"); } function N($) { return a.extendFlat(w, $); } function W($, se) { try { $._fullLayout._paper.style("background", se); } catch (ie) { a.error(ie); } } function J($, se) { var ie = v.combine(se, "white"); W($, ie); } function U($, se) { if (!$._context) { $._context = a.extendDeep({}, w); var ie = t.select("base"); $._context._baseUrl = ie.size() && ie.attr("href") ? window.location.href.split("#")[0] : ""; } var de = $._context, Te, xe, Ge; if (se) { for (xe = Object.keys(se), Te = 0; Te < xe.length; Te++) Ge = xe[Te], !(Ge === "editable" || Ge === "edits") && Ge in de && (Ge === "setBackground" && se[Ge] === "opaque" ? de[Ge] = J : de[Ge] = se[Ge]); se.plot3dPixelRatio && !de.plotGlPixelRatio && (de.plotGlPixelRatio = de.plot3dPixelRatio); var qe = se.editable; if (qe !== void 0) for (de.editable = qe, xe = Object.keys(de.edits), Te = 0; Te < xe.length; Te++) de.edits[xe[Te]] = qe; if (se.edits) for (xe = Object.keys(se.edits), Te = 0; Te < xe.length; Te++) Ge = xe[Te], Ge in de.edits && (de.edits[Ge] = se.edits[Ge]); de._exportedPlot = se._exportedPlot; } de.staticPlot && (de.editable = !1, de.edits = {}, de.autosizable = !1, de.scrollZoom = !1, de.doubleClick = !1, de.showTips = !1, de.showLink = !1, de.displayModeBar = !1), de.displayModeBar === "hover" && !r && (de.displayModeBar = !0), (de.setBackground === "transparent" || typeof de.setBackground != "function") && (de.setBackground = W), de._hasZeroHeight = de._hasZeroHeight || $.clientHeight === 0, de._hasZeroWidth = de._hasZeroWidth || $.clientWidth === 0; var De = de.scrollZoom, le = de._scrollZoom = {}; if (De === !0) le.cartesian = 1, le.gl3d = 1, le.geo = 1, le.mapbox = 1; else if (typeof De == "string") { var Se = De.split("+"); for (Te = 0; Te < Se.length; Te++) le[Se[Te]] = 1; } else De !== !1 && (le.gl3d = 1, le.geo = 1, le.mapbox = 1); } function E($) { if ($ = a.getGraphDiv($), !a.isPlotDiv($)) throw new Error("This element is not a Plotly plot: " + $); return k.cleanData($.data), k.cleanLayout($.layout), $.calcdata = void 0, e._doPlot($).then(function() { return $.emit("plotly_redraw"), $; }); } function z($, se, ie, de) { return $ = a.getGraphDiv($), u.cleanPlot([], {}, $._fullData || [], $._fullLayout || {}), u.purge($), e._doPlot($, se, ie, de); } function F($, se) { var ie = se + 1, de = [], Te, xe; for (Te = 0; Te < $.length; Te++) xe = $[Te], xe < 0 ? de.push(ie + xe) : de.push(xe); return de; } function q($, se, ie) { var de, Te; for (de = 0; de < se.length; de++) { if (Te = se[de], Te !== parseInt(Te, 10)) throw new Error("all values in " + ie + " must be integers"); if (Te >= $.data.length || Te < -$.data.length) throw new Error(ie + " must be valid indices for gd.data."); if (se.indexOf(Te, de + 1) > -1 || Te >= 0 && se.indexOf(-$.data.length + Te) > -1 || Te < 0 && se.indexOf($.data.length + Te) > -1) throw new Error("each index in " + ie + " must be unique."); } } function H($, se, ie) { if (!Array.isArray($.data)) throw new Error("gd.data must be an array."); if (typeof se > "u") throw new Error("currentIndices is a required argument."); if (Array.isArray(se) || (se = [se]), q($, se, "currentIndices"), typeof ie < "u" && !Array.isArray(ie) && (ie = [ie]), typeof ie < "u" && q($, ie, "newIndices"), typeof ie < "u" && se.length !== ie.length) throw new Error("current and new indices must be of equal length."); } function K($, se, ie) { var de, Te; if (!Array.isArray($.data)) throw new Error("gd.data must be an array."); if (typeof se > "u") throw new Error("traces must be defined."); for (Array.isArray(se) || (se = [se]), de = 0; de < se.length; de++) if (Te = se[de], typeof Te != "object" || Array.isArray(Te) || Te === null) throw new Error("all values in traces array must be non-array objects"); if (typeof ie < "u" && !Array.isArray(ie) && (ie = [ie]), typeof ie < "u" && ie.length !== se.length) throw new Error( "if indices is specified, traces.length must equal indices.length" ); } function Q($, se, ie, de) { var Te = a.isPlainObject(de); if (!Array.isArray($.data)) throw new Error("gd.data must be an array"); if (!a.isPlainObject(se)) throw new Error("update must be a key:value object"); if (typeof ie > "u") throw new Error("indices must be an integer or array of integers"); q($, ie, "indices"); for (var xe in se) { if (!Array.isArray(se[xe]) || se[xe].length !== ie.length) throw new Error("attribute " + xe + " must be an array of length equal to indices array length"); if (Te && (!(xe in de) || !Array.isArray(de[xe]) || de[xe].length !== se[xe].length)) throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object"); } } function re($, se, ie, de) { var Te = a.isPlainObject(de), xe = [], Ge, qe, De, le, Se; Array.isArray(ie) || (ie = [ie]), ie = F(ie, $.data.length - 1); for (var He in se) for (var Je = 0; Je < ie.length; Je++) { if (Ge = $.data[ie[Je]], De = i(Ge, He), qe = De.get(), le = se[He][Je], !a.isArrayOrTypedArray(le)) throw new Error("attribute: " + He + " index: " + Je + " must be an array"); if (!a.isArrayOrTypedArray(qe)) throw new Error("cannot extend missing or non-array attribute: " + He); if (qe.constructor !== le.constructor) throw new Error("cannot extend array with an array of a different type: " + He); Se = Te ? de[He][Je] : de, n(Se) || (Se = -1), xe.push({ prop: De, target: qe, insert: le, maxp: Math.floor(Se) }); } return xe; } function te($, se, ie, de, Te) { Q($, se, ie, de); for (var xe = re($, se, ie, de), Ge = {}, qe = {}, De = 0; De < xe.length; De++) { var le = xe[De].prop, Se = xe[De].maxp, He = Te(xe[De].target, xe[De].insert, Se); le.set(He[0]), Array.isArray(Ge[le.astr]) || (Ge[le.astr] = []), Ge[le.astr].push(He[1]), Array.isArray(qe[le.astr]) || (qe[le.astr] = []), qe[le.astr].push(xe[De].target.length); } return { update: Ge, maxPoints: qe }; } function X($, se) { var ie = new $.constructor($.length + se.length); return ie.set($), ie.set(se, $.length), ie; } function ce($, se, ie, de) { $ = a.getGraphDiv($); function Te(De, le, Se) { var He, Je; if (a.isTypedArray(De)) if (Se < 0) { var Dt = new De.constructor(0), zt = X(De, le); Se < 0 ? (He = zt, Je = Dt) : (He = Dt, Je = zt); } else if (He = new De.constructor(Se), Je = new De.constructor(De.length + le.length - Se), Se === le.length) He.set(le), Je.set(De); else if (Se < le.length) { var Pt = le.length - Se; He.set(le.subarray(Pt)), Je.set(De), Je.set(le.subarray(0, Pt), De.length); } else { var _t = Se - le.length, $t = De.length - _t; He.set(De.subarray($t)), He.set(le, _t), Je.set(De.subarray(0, $t)); } else He = De.concat(le), Je = Se >= 0 && Se < He.length ? He.splice(0, He.length - Se) : []; return [He, Je]; } var xe = te($, se, ie, de, Te), Ge = e.redraw($), qe = [$, xe.update, ie, xe.maxPoints]; return l.add($, e.prependTraces, qe, ce, arguments), Ge; } function B($, se, ie, de) { $ = a.getGraphDiv($); function Te(De, le, Se) { var He, Je; if (a.isTypedArray(De)) if (Se <= 0) { var Dt = new De.constructor(0), zt = X(le, De); Se < 0 ? (He = zt, Je = Dt) : (He = Dt, Je = zt); } else if (He = new De.constructor(Se), Je = new De.constructor(De.length + le.length - Se), Se === le.length) He.set(le), Je.set(De); else if (Se < le.length) { var Pt = le.length - Se; He.set(le.subarray(0, Pt)), Je.set(le.subarray(Pt)), Je.set(De, Pt); } else { var _t = Se - le.length; He.set(le), He.set(De.subarray(0, _t), le.length), Je.set(De.subarray(_t)); } else He = le.concat(De), Je = Se >= 0 && Se < He.length ? He.splice(Se, He.length) : []; return [He, Je]; } var xe = te($, se, ie, de, Te), Ge = e.redraw($), qe = [$, xe.update, ie, xe.maxPoints]; return l.add($, e.extendTraces, qe, B, arguments), Ge; } function G($, se, ie) { $ = a.getGraphDiv($); var de = [], Te = e.deleteTraces, xe = G, Ge = [$, de], qe = [$, se], De, le; for (K($, se, ie), Array.isArray(se) || (se = [se]), se = se.map(function(Se) { return a.extendFlat({}, Se); }), k.cleanData(se), De = 0; De < se.length; De++) $.data.push(se[De]); for (De = 0; De < se.length; De++) de.push(-se.length + De); if (typeof ie > "u") return le = e.redraw($), l.add($, Te, Ge, xe, qe), le; Array.isArray(ie) || (ie = [ie]); try { H($, de, ie); } catch (Se) { throw $.data.splice($.data.length - se.length, se.length), Se; } return l.startSequence($), l.add($, Te, Ge, xe, qe), le = e.moveTraces($, de, ie), l.stopSequence($), le; } function Z($, se) { $ = a.getGraphDiv($); var ie = [], de = e.addTraces, Te = Z, xe = [$, ie, se], Ge = [$, se], qe, De; if (typeof se > "u") throw new Error("indices must be an integer or array of integers."); for (Array.isArray(se) || (se = [se]), q($, se, "indices"), se = F(se, $.data.length - 1), se.sort(a.sorterDes), qe = 0; qe < se.length; qe += 1) De = $.data.splice(se[qe], 1)[0], ie.push(De); var le = e.redraw($); return l.add($, de, xe, Te, Ge), le; } function oe($, se, ie) { $ = a.getGraphDiv($); var de = [], Te = [], xe = oe, Ge = oe, qe = [$, ie, se], De = [$, se, ie], le; if (H($, se, ie), se = Array.isArray(se) ? se : [se], typeof ie > "u") for (ie = [], le = 0; le < se.length; le++) ie.push(-se.length + le); for (ie = Array.isArray(ie) ? ie : [ie], se = F(se, $.data.length - 1), ie = F(ie, $.data.length - 1), le = 0; le < $.data.length; le++) se.indexOf(le) === -1 && de.push($.data[le]); for (le = 0; le < se.length; le++) Te.push({ newIndex: ie[le], trace: $.data[se[le]] }); for (Te.sort(function(He, Je) { return He.newIndex - Je.newIndex; }), le = 0; le < Te.length; le += 1) de.splice(Te[le].newIndex, 0, Te[le].trace); $.data = de; var Se = e.redraw($); return l.add($, xe, qe, Ge, De), Se; } function ae($, se, ie, de) { $ = a.getGraphDiv($), k.clearPromiseQueue($); var Te = {}; if (typeof se == "string") Te[se] = ie; else if (a.isPlainObject(se)) Te = a.extendFlat({}, se), de === void 0 && (de = ie); else return a.warn("Restyle fail.", se, ie, de), Promise.reject(); Object.keys(Te).length && ($.changed = !0); var xe = k.coerceTraceIndices($, de), Ge = Oe($, Te, xe), qe = Ge.flags; qe.calc && ($.calcdata = void 0), qe.clearAxisTypes && k.clearAxisTypes($, xe, {}); var De = []; qe.fullReplot ? De.push(e._doPlot) : (De.push(u.previousPromises), u.supplyDefaults($), qe.markerSize && (u.doCalcdata($), Re(De)), qe.style && De.push(T.doTraceStyle), qe.colorbars && De.push(T.doColorBars), De.push(P)), De.push( u.rehover, u.redrag, u.reselect ), l.add( $, ae, [$, Ge.undoit, Ge.traces], ae, [$, Ge.redoit, Ge.traces] ); var le = a.syncOrAsync(De, $); return (!le || !le.then) && (le = Promise.resolve()), le.then(function() { return $.emit("plotly_restyle", Ge.eventData), $; }); } function ge($) { return $ === void 0 ? null : $; } function ve($, se) { return se ? function(ie, de, Te) { var xe = i(ie, de), Ge = xe.set; return xe.set = function(qe) { var De = (Te || "") + de; pe(De, xe.get(), qe, $), Ge(qe); }, xe; } : i; } function pe($, se, ie, de) { if (Array.isArray(se) || Array.isArray(ie)) for (var Te = Array.isArray(se) ? se : [], xe = Array.isArray(ie) ? ie : [], Ge = Math.max(Te.length, xe.length), qe = 0; qe < Ge; qe++) pe($ + "[" + qe + "]", Te[qe], xe[qe], de); else if (a.isPlainObject(se) || a.isPlainObject(ie)) { var De = a.isPlainObject(se) ? se : {}, le = a.isPlainObject(ie) ? ie : {}, Se = a.extendFlat({}, De, le); for (var He in Se) pe($ + "." + He, De[He], le[He], de); } else de[$] === void 0 && (de[$] = ge(se)); } function ye($, se, ie) { for (var de in ie) { var Te = i($, de); pe(de, Te.get(), ie[de], se); } } function Oe($, se, ie) { var de = $._fullLayout, Te = $._fullData, xe = $.data, Ge = de._guiEditing, qe = ve(de._preGUI, Ge), De = a.extendDeepAll({}, se), le; Be(se); var Se = O.traceFlags(), He = {}, Je = {}, Dt; function zt() { return ie.map(function() { }); } function Pt(Pn) { var nr = f.id2name(Pn); Dt.indexOf(nr) === -1 && Dt.push(nr); } function _t(Pn) { return "LAYOUT" + Pn + ".autorange"; } function $t(Pn) { return "LAYOUT" + Pn + ".range"; } function Nt(Pn) { for (var nr = Pn; nr < Te.length; nr++) if (Te[nr]._input === xe[Pn]) return Te[nr]; } function wt(Pn, nr, Jr) { if (Array.isArray(Pn)) { Pn.forEach(function(ha) { wt(ha, nr, Jr); }); return; } if (!(Pn in se || k.hasParent(se, Pn))) { var Ma; if (Pn.substr(0, 6) === "LAYOUT") Ma = qe($.layout, Pn.replace("LAYOUT", "")); else { var ki = ie[Jr], Qr = de._tracePreGUI[Nt(ki)._fullInput.uid]; Ma = ve(Qr, Ge)(xe[ki], Pn); } Pn in Je || (Je[Pn] = zt()), Je[Pn][Jr] === void 0 && (Je[Pn][Jr] = ge(Ma.get())), nr !== void 0 && Ma.set(nr); } } function Yt(Pn) { return function(nr) { return Te[nr][Pn]; }; } function Jt(Pn) { return function(nr, Jr) { return nr === !1 ? Te[ie[Jr]][Pn] : null; }; } for (var jt in se) { if (k.hasParent(se, jt)) throw new Error("cannot set " + jt + " and a parent attribute simultaneously"); var Et = se[jt], At, Ot, qt, dn, Mt, tn; if ((jt === "autobinx" || jt === "autobiny") && (jt = jt.charAt(jt.length - 1) + "bins", Array.isArray(Et) ? Et = Et.map(Jt(jt)) : Et === !1 ? Et = ie.map(Yt(jt)) : Et = null), He[jt] = Et, jt.substr(0, 6) === "LAYOUT") { qt = qe($.layout, jt.replace("LAYOUT", "")), Je[jt] = [ge(qt.get())], qt.set(Array.isArray(Et) ? Et[0] : Et), Se.calc = !0; continue; } for (Je[jt] = zt(), le = 0; le < ie.length; le++) { At = xe[ie[le]], Ot = Nt(ie[le]); var Ht = de._tracePreGUI[Ot._fullInput.uid]; if (qt = ve(Ht, Ge)(At, jt), dn = qt.get(), Mt = Array.isArray(Et) ? Et[le % Et.length] : Et, Mt !== void 0) { var jn = qt.parts[qt.parts.length - 1], an = jt.substr(0, jt.length - jn.length - 1), En = an ? an + "." : "", Un = an ? i(Ot, an).get() : Ot; if (tn = c.getTraceValObject(Ot, qt.parts), tn && tn.impliedEdits && Mt !== null) for (var zr in tn.impliedEdits) wt(a.relativeAttr(jt, zr), tn.impliedEdits[zr], le); else if ((jn === "thicknessmode" || jn === "lenmode") && dn !== Mt && (Mt === "fraction" || Mt === "pixels") && Un) { var hr = de._size, pr = Un.orient, Ja = pr === "top" || pr === "bottom"; if (jn === "thicknessmode") { var to = Ja ? hr.h : hr.w; wt(En + "thickness", Un.thickness * (Mt === "fraction" ? 1 / to : to), le); } else { var lr = Ja ? hr.w : hr.h; wt(En + "len", Un.len * (Mt === "fraction" ? 1 / lr : lr), le); } } else if (jt === "type" && (Mt === "pie" != (dn === "pie") || Mt === "funnelarea" != (dn === "funnelarea"))) { var Kr = "x", no = "y"; (Mt === "bar" || dn === "bar") && At.orientation === "h" && (Kr = "y", no = "x"), a.swapAttrs(At, ["?", "?src"], "labels", Kr), a.swapAttrs(At, ["d?", "?0"], "label", Kr), a.swapAttrs(At, ["?", "?src"], "values", no), dn === "pie" || dn === "funnelarea" ? (i(At, "marker.color").set(i(At, "marker.colors").get()), de._pielayer.selectAll("g.trace").remove()) : s.traceIs(At, "cartesian") && i(At, "marker.colors").set(i(At, "marker.color").get()); } Je[jt][le] = ge(dn); var Ta = [ "swapxy", "swapxyaxes", "orientation", "orientationaxes" ]; if (Ta.indexOf(jt) !== -1) { if (jt === "orientation") { qt.set(Mt); var mn = At.x && !At.y ? "h" : "v"; if ((qt.get() || mn) === Ot.orientation) continue; } else jt === "orientationaxes" && (At.orientation = { v: "h", h: "v" }[Ot.orientation]); k.swapXYData(At), Se.calc = Se.clearAxisTypes = !0; } else u.dataArrayContainers.indexOf(qt.parts[0]) !== -1 ? (k.manageArrayContainers(qt, Mt, Je), Se.calc = !0) : (tn ? tn.arrayOk && !s.traceIs(Ot, "regl") && (a.isArrayOrTypedArray(Mt) || a.isArrayOrTypedArray(dn)) ? Se.calc = !0 : O.update(Se, tn) : Se.calc = !0, qt.set(Mt)); } } if (["swapxyaxes", "orientationaxes"].indexOf(jt) !== -1 && f.swap($, ie), jt === "orientationaxes") { var Aa = i($.layout, "hovermode"), Qa = Aa.get(); Qa === "x" ? Aa.set("y") : Qa === "y" ? Aa.set("x") : Qa === "x unified" ? Aa.set("y unified") : Qa === "y unified" && Aa.set("x unified"); } if (["orientation", "type"].indexOf(jt) !== -1) { for (Dt = [], le = 0; le < ie.length; le++) { var ro = xe[ie[le]]; s.traceIs(ro, "cartesian") && (Pt(ro.xaxis || "x"), Pt(ro.yaxis || "y")); } wt(Dt.map(_t), !0, 0), wt(Dt.map($t), [0, 1], 0); } } return (Se.calc || Se.plot) && (Se.fullReplot = !0), { flags: Se, undoit: Je, redoit: He, traces: ie, eventData: a.extendDeepNoArrays([], [De, ie]) }; } function Be($) { var se = a.counterRegex("axis", ".title", !1, !1), ie = /colorbar\.title$/, de = Object.keys($), Te, xe, Ge; for (Te = 0; Te < de.length; Te++) xe = de[Te], Ge = $[xe], (xe === "title" || se.test(xe) || ie.test(xe)) && (typeof Ge == "string" || typeof Ge == "number") ? qe(xe, xe.replace("title", "title.text")) : xe.indexOf("titlefont") > -1 && xe.indexOf("grouptitlefont") === -1 ? qe(xe, xe.replace("titlefont", "title.font")) : xe.indexOf("titleposition") > -1 ? qe(xe, xe.replace("titleposition", "title.position")) : xe.indexOf("titleside") > -1 ? qe(xe, xe.replace("titleside", "title.side")) : xe.indexOf("titleoffset") > -1 && qe(xe, xe.replace("titleoffset", "title.offset")); function qe(De, le) { $[le] = $[De], delete $[De]; } } function Ie($, se, ie) { $ = a.getGraphDiv($), k.clearPromiseQueue($); var de = {}; if (typeof se == "string") de[se] = ie; else if (a.isPlainObject(se)) de = a.extendFlat({}, se); else return a.warn("Relayout fail.", se, ie), Promise.reject(); Object.keys(de).length && ($.changed = !0); var Te = Ke($, de), xe = Te.flags; xe.calc && ($.calcdata = void 0); var Ge = [u.previousPromises]; xe.layoutReplot ? Ge.push(T.layoutReplot) : Object.keys(de).length && (Fe($, xe, Te) || u.supplyDefaults($), xe.legend && Ge.push(T.doLegend), xe.layoutstyle && Ge.push(T.layoutStyles), xe.axrange && Re(Ge, Te.rangesAltered), xe.ticks && Ge.push(T.doTicksRelayout), xe.modebar && Ge.push(T.doModeBar), xe.camera && Ge.push(T.doCamera), xe.colorbars && Ge.push(T.doColorBars), Ge.push(P)), Ge.push( u.rehover, u.redrag, u.reselect ), l.add( $, Ie, [$, Te.undoit], Ie, [$, Te.redoit] ); var qe = a.syncOrAsync(Ge, $); return (!qe || !qe.then) && (qe = Promise.resolve($)), qe.then(function() { return $.emit("plotly_relayout", Te.eventData), $; }); } function Fe($, se, ie) { var de = $._fullLayout; if (!se.axrange) return !1; for (var Te in se) if (Te !== "axrange" && se[Te]) return !1; var xe, Ge, qe = function(Dt, zt) { return a.coerce(xe, Ge, g, Dt, zt); }, De = {}; for (var le in ie.rangesAltered) { var Se = f.id2name(le); if (xe = $.layout[Se], Ge = de[Se], h(xe, Ge, qe, De), Ge._matchGroup) { for (var He in Ge._matchGroup) if (He !== le) { var Je = de[f.id2name(He)]; Je.autorange = Ge.autorange, Je.range = Ge.range.slice(), Je._input.range = Ge.range.slice(); } } } return !0; } function Re($, se) { var ie = se ? function(de) { var Te = [], xe = !0; for (var Ge in se) { var qe = f.getFromId(de, Ge); if (Te.push(Ge), (qe.ticklabelposition || "").indexOf("inside") !== -1 && qe._anchorAxis && Te.push(qe._anchorAxis._id), qe._matchGroup) for (var De in qe._matchGroup) se[De] || Te.push(De); } return f.draw(de, Te, { skipTitle: xe }); } : function(de) { return f.draw(de, "redraw"); }; $.push( b, T.doAutoRangeAndConstraints, ie, T.drawData, T.finalDraw ); } var We = /^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/, Ce = /^[xyz]axis[0-9]*\.autorange$/, Ve = /^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/; function Ke($, se) { var ie = $.layout, de = $._fullLayout, Te = de._guiEditing, xe = ve(de._preGUI, Te), Ge = Object.keys(se), qe = f.list($), De = a.extendDeepAll({}, se), le = {}, Se, He, Je; for (Be(se), Ge = Object.keys(se), He = 0; He < Ge.length; He++) if (Ge[He].indexOf("allaxes") === 0) { for (Je = 0; Je < qe.length; Je++) { var Dt = qe[Je]._id.substr(1), zt = Dt.indexOf("scene") !== -1 ? Dt + "." : "", Pt = Ge[He].replace("allaxes", zt + qe[Je]._name); se[Pt] || (se[Pt] = se[Ge[He]]); } delete se[Ge[He]]; } var _t = O.layoutFlags(), $t = {}, Nt = {}; function wt(Qr, ha) { if (Array.isArray(Qr)) { Qr.forEach(function(of) { wt(of, ha); }); return; } if (!(Qr in se || k.hasParent(se, Qr))) { var _s = xe(ie, Qr); Qr in Nt || (Nt[Qr] = ge(_s.get())), ha !== void 0 && _s.set(ha); } } var Yt = {}, Jt; function jt(Qr) { var ha = f.name2id(Qr.split(".")[0]); return Yt[ha] = 1, ha; } for (var Et in se) { if (k.hasParent(se, Et)) throw new Error("cannot set " + Et + " and a parent attribute simultaneously"); for (var At = xe(ie, Et), Ot = se[Et], qt = At.parts.length, dn = qt - 1; dn > 0 && typeof At.parts[dn] != "string"; ) dn--; var Mt = At.parts[dn], tn = At.parts[dn - 1] + "." + Mt, Ht = At.parts.slice(0, dn).join("."), jn = i($.layout, Ht).get(), an = i(de, Ht).get(), En = At.get(); if (Ot !== void 0) { $t[Et] = Ot, Nt[Et] = Mt === "reverse" ? Ot : ge(En); var Un = c.getLayoutValObject(de, At.parts); if (Un && Un.impliedEdits && Ot !== null) for (var zr in Un.impliedEdits) wt(a.relativeAttr(Et, zr), Un.impliedEdits[zr]); if (["width", "height"].indexOf(Et) !== -1) if (Ot) { wt("autosize", null); var hr = Et === "height" ? "width" : "height"; wt(hr, de[hr]); } else de[Et] = $._initialAutoSize[Et]; else if (Et === "autosize") wt("width", Ot ? null : de.width), wt("height", Ot ? null : de.height); else if (tn.match(We)) jt(tn), i(de, Ht + "._inputRange").set(null); else if (tn.match(Ce)) { jt(tn), i(de, Ht + "._inputRange").set(null); var pr = i(de, Ht).get(); pr._inputDomain && (pr._input.domain = pr._inputDomain.slice()); } else tn.match(Ve) && i(de, Ht + "._inputDomain").set(null); if (Mt === "type") { Jt = jn; var Ja = an.type === "linear" && Ot === "log", to = an.type === "log" && Ot === "linear"; if (Ja || to) { if (!Jt || !Jt.range) wt(Ht + ".autorange", !0); else if (an.autorange) Ja && (Jt.range = Jt.range[1] > Jt.range[0] ? [1, 2] : [2, 1]); else { var lr = Jt.range[0], Kr = Jt.range[1]; Ja ? (lr <= 0 && Kr <= 0 && wt(Ht + ".autorange", !0), lr <= 0 ? lr = Kr / 1e6 : Kr <= 0 && (Kr = lr / 1e6), wt(Ht + ".range[0]", Math.log(lr) / Math.LN10), wt(Ht + ".range[1]", Math.log(Kr) / Math.LN10)) : (wt(Ht + ".range[0]", Math.pow(10, lr)), wt(Ht + ".range[1]", Math.pow(10, Kr))); } Array.isArray(de._subplots.polar) && de._subplots.polar.length && de[At.parts[0]] && At.parts[1] === "radialaxis" && delete de[At.parts[0]]._subplot.viewInitial["radialaxis.range"], s.getComponentMethod("annotations", "convertCoords")($, an, Ot, wt), s.getComponentMethod("images", "convertCoords")($, an, Ot, wt); } else wt(Ht + ".autorange", !0), wt(Ht + ".range", null); i(de, Ht + "._inputRange").set(null); } else if (Mt.match(M)) { var no = i(de, Et).get(), Ta = (Ot || {}).type; (!Ta || Ta === "-") && (Ta = "linear"), s.getComponentMethod("annotations", "convertCoords")($, no, Ta, wt), s.getComponentMethod("images", "convertCoords")($, no, Ta, wt); } var mn = _.containerArrayMatch(Et); if (mn) { Se = mn.array, He = mn.index; var Aa = mn.property, Qa = Un || { editType: "calc" }; He !== "" && Aa === "" && (_.isAddVal(Ot) ? Nt[Et] = null : _.isRemoveVal(Ot) ? Nt[Et] = (i(ie, Se).get() || [])[He] : a.warn("unrecognized full object value", se)), O.update(_t, Qa), le[Se] || (le[Se] = {}); var ro = le[Se][He]; ro || (ro = le[Se][He] = {}), ro[Aa] = Ot, delete se[Et]; } else Mt === "reverse" ? (jn.range ? jn.range.reverse() : (wt(Ht + ".autorange", !0), jn.range = [1, 0]), an.autorange ? _t.calc = !0 : _t.plot = !0) : (Et === "dragmode" && (Ot === !1 && En !== !1 || Ot !== !1 && En === !1) || de._has("scatter-like") && de._has("regl") && Et === "dragmode" && (Ot === "lasso" || Ot === "select") && !(En === "lasso" || En === "select") || de._has("gl2d") ? _t.plot = !0 : Un ? O.update(_t, Un) : _t.calc = !0, At.set(Ot)); } } for (Se in le) { var Pn = _.applyContainerArrayChanges( $, xe(ie, Se), le[Se], _t, xe ); Pn || (_t.plot = !0); } for (var nr in Yt) { Jt = f.getFromId($, nr); var Jr = Jt && Jt._constraintGroup; if (Jr) { _t.calc = !0; for (var Ma in Jr) Yt[Ma] || (f.getFromId($, Ma)._constraintShrinkable = !0); } } (Xe($) || se.height || se.width) && (_t.plot = !0); var ki = de.shapes; for (He = 0; He < ki.length; He++) if (ki[He].showlegend) { _t.calc = !0; break; } return (_t.plot || _t.calc) && (_t.layoutReplot = !0), { flags: _t, rangesAltered: Yt, undoit: Nt, redoit: $t, eventData: De }; } function Xe($) { var se = $._fullLayout, ie = se.width, de = se.height; return $.layout.autosize && u.plotAutoSize($, $.layout, se), se.width !== ie || se.height !== de; } function ct($, se, ie, de) { $ = a.getGraphDiv($), k.clearPromiseQueue($), a.isPlainObject(se) || (se = {}), a.isPlainObject(ie) || (ie = {}), Object.keys(se).length && ($.changed = !0), Object.keys(ie).length && ($.changed = !0); var Te = k.coerceTraceIndices($, de), xe = Oe($, a.extendFlat({}, se), Te), Ge = xe.flags, qe = Ke($, a.extendFlat({}, ie)), De = qe.flags; (Ge.calc || De.calc) && ($.calcdata = void 0), Ge.clearAxisTypes && k.clearAxisTypes($, Te, ie); var le = []; De.layoutReplot ? le.push(T.layoutReplot) : Ge.fullReplot ? le.push(e._doPlot) : (le.push(u.previousPromises), Fe($, De, qe) || u.supplyDefaults($), Ge.style && le.push(T.doTraceStyle), (Ge.colorbars || De.colorbars) && le.push(T.doColorBars), De.legend && le.push(T.doLegend), De.layoutstyle && le.push(T.layoutStyles), De.axrange && Re(le, qe.rangesAltered), De.ticks && le.push(T.doTicksRelayout), De.modebar && le.push(T.doModeBar), De.camera && le.push(T.doCamera), le.push(P)), le.push( u.rehover, u.redrag, u.reselect ), l.add( $, ct, [$, xe.undoit, qe.undoit, xe.traces], ct, [$, xe.redoit, qe.redoit, xe.traces] ); var Se = a.syncOrAsync(le, $); return (!Se || !Se.then) && (Se = Promise.resolve($)), Se.then(function() { return $.emit("plotly_update", { data: xe.eventData, layout: qe.eventData }), $; }); } function vt($) { return function(se) { se._fullLayout._guiEditing = !0; var ie = $.apply(null, arguments); return se._fullLayout._guiEditing = !1, ie; }; } var lt = [ { pattern: /^hiddenlabels/, attr: "legend.uirevision" }, { pattern: /^((x|y)axis\d*)\.((auto)?range|title\.text)/ }, // showspikes and modes include those nested inside scenes { pattern: /axis\d*\.showspikes$/, attr: "modebar.uirevision" }, { pattern: /(hover|drag)mode$/, attr: "modebar.uirevision" }, { pattern: /^(scene\d*)\.camera/ }, { pattern: /^(geo\d*)\.(projection|center|fitbounds)/ }, { pattern: /^(ternary\d*\.[abc]axis)\.(min|title\.text)$/ }, { pattern: /^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/ }, { pattern: /^(polar\d*\.angularaxis)\.rotation/ }, { pattern: /^(mapbox\d*)\.(center|zoom|bearing|pitch)/ }, { pattern: /^legend\.(x|y)$/, attr: "editrevision" }, { pattern: /^(shapes|annotations)/, attr: "editrevision" }, { pattern: /^title\.text$/, attr: "editrevision" } ], ut = [ { pattern: /^selectedpoints$/, attr: "selectionrevision" }, // "visible" includes trace.transforms[i].styles[j].value.visible { pattern: /(^|value\.)visible$/, attr: "legend.uirevision" }, { pattern: /^dimensions\[\d+\]\.constraintrange/ }, { pattern: /^node\.(x|y|groups)/ }, // for Sankey nodes { pattern: /^level$/ }, // for Sunburst, Treemap and Icicle traces // below this you must be in editable: true mode // TODO: I still put name and title with `trace.uirevision` // reasonable or should these be `editrevision`? // Also applies to axis titles up in the layout section // "name" also includes transform.styles { pattern: /(^|value\.)name$/ }, // including nested colorbar attributes (ie marker.colorbar) { pattern: /colorbar\.title\.text$/ }, { pattern: /colorbar\.(x|y)$/, attr: "editrevision" } ]; function dt($, se) { for (var ie = 0; ie < se.length; ie++) { var de = se[ie], Te = $.match(de.pattern); if (Te) { var xe = Te[1] || ""; return { head: xe, tail: $.substr(xe.length + 1), attr: de.attr }; } } } function Pe($, se) { var ie = i(se, $).get(); if (ie !== void 0) return ie; var de = $.split("."); for (de.pop(); de.length > 1; ) if (de.pop(), ie = i(se, de.join(".") + ".uirevision").get(), ie !== void 0) return ie; return se.uirevision; } function ze($, se) { for (var ie = 0; ie < se.length; ie++) if (se[ie]._fullInput.uid === $) return ie; return -1; } function Ne($, se, ie) { for (var de = 0; de < se.length; de++) if (se[de].uid === $) return de; return !se[ie] || se[ie].uid ? -1 : ie; } function nt($, se) { var ie = a.isPlainObject($), de = Array.isArray($); return ie || de ? (ie && a.isPlainObject(se) || de && Array.isArray(se)) && JSON.stringify($) === JSON.stringify(se) : $ === se; } function Qe($, se, ie, de) { var Te = de._preGUI, xe, Ge, qe, De, le, Se, He, Je, Dt, zt, Pt = [], _t = {}, $t = {}; for (xe in Te) { if (le = dt(xe, lt), le) { if (Dt = le.head, zt = le.tail, Ge = le.attr || Dt + ".uirevision", qe = i(de, Ge).get(), De = qe && Pe(Ge, se), De && De === qe) { if (Se = Te[xe], Se === null && (Se = void 0), He = i(se, xe), Je = He.get(), nt(Je, Se)) { Je === void 0 && zt === "autorange" && Pt.push(Dt), He.set(ge(i(de, xe).get())); continue; } else if (zt === "autorange" || zt.substr(0, 6) === "range[") { var Nt = Te[Dt + ".range[0]"], wt = Te[Dt + ".range[1]"], Yt = Te[Dt + ".autorange"]; if (Yt || Yt === null && Nt === null && wt === null) { if (!(Dt in _t)) { var Jt = i(se, Dt).get(); _t[Dt] = Jt && (Jt.autorange || Jt.autorange !== !1 && (!Jt.range || Jt.range.length !== 2)); } if (_t[Dt]) { He.set(ge(i(de, xe).get())); continue; } } } } } else a.warn("unrecognized GUI edit: " + xe); delete Te[xe], le && le.tail.substr(0, 6) === "range[" && ($t[le.head] = 1); } for (var jt = 0; jt < Pt.length; jt++) { var Et = Pt[jt]; if ($t[Et]) { var At = i(se, Et).get(); At && delete At.autorange; } } var Ot = de._tracePreGUI; for (var qt in Ot) { var dn = Ot[qt], Mt = null, tn; for (xe in dn) { if (!Mt) { var Ht = ze(qt, ie); if (Ht < 0) { delete Ot[qt]; break; } var jn = ie[Ht]; tn = jn._fullInput; var an = Ne(qt, $, tn.index); if (an < 0) { delete Ot[qt]; break; } Mt = $[an]; } if (le = dt(xe, ut), le) { if (le.attr ? (qe = i(de, le.attr).get(), De = qe && Pe(le.attr, se)) : (qe = tn.uirevision, De = Mt.uirevision, De === void 0 && (De = se.uirevision)), De && De === qe && (Se = dn[xe], Se === null && (Se = void 0), He = i(Mt, xe), Je = He.get(), nt(Je, Se))) { He.set(ge(i(tn, xe).get())); continue; } } else a.warn("unrecognized GUI edit: " + xe + " in trace uid " + qt); delete dn[xe]; } } } function it($, se, ie, de) { var Te, xe; function Ge() { return e.addFrames($, Te); } $ = a.getGraphDiv($), k.clearPromiseQueue($); var qe = $._fullData, De = $._fullLayout; if (!a.isPlotDiv($) || !qe || !De) xe = e.newPlot($, se, ie, de); else { if (a.isPlainObject(se)) { var le = se; se = le.data, ie = le.layout, de = le.config, Te = le.frames; } var Se = !1; if (de) { var He = a.extendDeep({}, $._context); $._context = void 0, U($, de), Se = tt(He, $._context); } $.data = se || [], k.cleanData($.data), $.layout = ie || {}, k.cleanLayout($.layout), Qe($.data, $.layout, qe, De), u.supplyDefaults($, { skipUpdateCalc: !0 }); var Je = $._fullData, Dt = $._fullLayout, zt = Dt.datarevision === void 0, Pt = Dt.transition, _t = bt($, De, Dt, zt, Pt), $t = _t.newDataRevision, Nt = rt($, qe, Je, zt, Pt, $t); if (Xe($) && (_t.layoutReplot = !0), Nt.calc || _t.calc) { $.calcdata = void 0; for (var wt = Object.getOwnPropertyNames(Dt), Yt = 0; Yt < wt.length; Yt++) { var Jt = wt[Yt], jt = Jt.substring(0, 5); if (jt === "xaxis" || jt === "yaxis") { var Et = Dt[Jt]._emptyCategories; Et && Et(); } } } else u.supplyDefaultsUpdateCalc($.calcdata, Je); var At = []; if (Te && ($._transitionData = {}, u.createTransitionData($), At.push(Ge)), Dt.transition && !Se && (Nt.anim || _t.anim)) _t.ticks && At.push(T.doTicksRelayout), u.doCalcdata($), T.doAutoRangeAndConstraints($), At.push(function() { return u.transitionFromReact($, Nt, _t, De); }); else if (Nt.fullReplot || _t.layoutReplot || Se) $._fullLayout._skipDefaults = !0, At.push(e._doPlot); else { for (var Ot in _t.arrays) { var qt = _t.arrays[Ot]; if (qt.length) { var dn = s.getComponentMethod(Ot, "drawOne"); if (dn !== a.noop) for (var Mt = 0; Mt < qt.length; Mt++) dn($, qt[Mt]); else { var tn = s.getComponentMethod(Ot, "draw"); if (tn === a.noop) throw new Error("cannot draw components: " + Ot); tn($); } } } At.push(u.previousPromises), Nt.style && At.push(T.doTraceStyle), (Nt.colorbars || _t.colorbars) && At.push(T.doColorBars), _t.legend && At.push(T.doLegend), _t.layoutstyle && At.push(T.layoutStyles), _t.axrange && Re(At), _t.ticks && At.push(T.doTicksRelayout), _t.modebar && At.push(T.doModeBar), _t.camera && At.push(T.doCamera), At.push(P); } At.push( u.rehover, u.redrag, u.reselect ), xe = a.syncOrAsync(At, $), (!xe || !xe.then) && (xe = Promise.resolve($)); } return xe.then(function() { return $.emit("plotly_react", { data: se, layout: ie }), $; }); } function rt($, se, ie, de, Te, xe) { var Ge = se.length === ie.length; if (!Te && !Ge) return { fullReplot: !0, calc: !0 }; var qe = O.traceFlags(); qe.arrays = {}, qe.nChanges = 0, qe.nChangesAnim = 0; var De, le; function Se(Dt) { var zt = c.getTraceValObject(le, Dt); return !le._module.animatable && zt.anim && (zt.anim = !1), zt; } var He = { getValObject: Se, flags: qe, immutable: de, transition: Te, newDataRevision: xe, gd: $ }, Je = {}; for (De = 0; De < se.length; De++) if (ie[De]) { if (le = ie[De]._fullInput, u.hasMakesDataTransform(le) && (le = ie[De]), Je[le.uid]) continue; Je[le.uid] = 1, je(se[De]._fullInput, le, [], He); } return (qe.calc || qe.plot) && (qe.fullReplot = !0), Te && qe.nChanges && qe.nChangesAnim && (qe.anim = qe.nChanges === qe.nChangesAnim && Ge ? "all" : "some"), qe; } function bt($, se, ie, de, Te) { var xe = O.layoutFlags(); xe.arrays = {}, xe.rangesAltered = {}, xe.nChanges = 0, xe.nChangesAnim = 0; function Ge(De) { return c.getLayoutValObject(ie, De); } var qe = { getValObject: Ge, flags: xe, immutable: de, transition: Te, gd: $ }; return je(se, ie, [], qe), (xe.plot || xe.calc) && (xe.layoutReplot = !0), Te && xe.nChanges && xe.nChangesAnim && (xe.anim = xe.nChanges === xe.nChangesAnim ? "all" : "some"), xe; } function je($, se, ie, de) { var Te, xe, Ge, qe = de.getValObject, De = de.flags, le = de.immutable, Se = de.inArray, He = de.arrayIndex; function Je() { var Ht = Te.editType; if (Se && Ht.indexOf("arraydraw") !== -1) { a.pushUnique(De.arrays[Se], He); return; } O.update(De, Te), Ht !== "none" && De.nChanges++, de.transition && Te.anim && De.nChangesAnim++, (We.test(Ge) || Ce.test(Ge)) && (De.rangesAltered[ie[0]] = 1), Ve.test(Ge) && i(se, "_inputDomain").set(null), xe === "datarevision" && (De.newDataRevision = 1); } function Dt(Ht) { return Ht.valType === "data_array" || Ht.arrayOk; } for (xe in $) { if (De.calc && !de.transition) return; var zt = $[xe], Pt = se[xe], _t = ie.concat(xe); if (Ge = _t.join("."), !(xe.charAt(0) === "_" || typeof zt == "function" || zt === Pt)) { if ((xe === "tick0" || xe === "dtick") && ie[0] !== "geo") { var $t = se.tickmode; if ($t === "auto" || $t === "array" || !$t) continue; } if (!(xe === "range" && se.autorange) && !((xe === "zmin" || xe === "zmax") && se.type === "contourcarpet") && (Te = qe(_t), !!Te && !(Te._compareAsJSON && JSON.stringify(zt) === JSON.stringify(Pt)))) { var Nt = Te.valType, wt, Yt = Dt(Te), Jt = Array.isArray(zt), jt = Array.isArray(Pt); if (Jt && jt) { var Et = "_input_" + xe, At = $[Et], Ot = se[Et]; if (Array.isArray(At) && At === Ot) continue; } if (Pt === void 0) Yt && Jt ? De.calc = !0 : Je(); else if (Te._isLinkedToArray) { var qt = [], dn = !1; Se || (De.arrays[xe] = qt); var Mt = Math.min(zt.length, Pt.length), tn = Math.max(zt.length, Pt.length); if (Mt !== tn) if (Te.editType === "arraydraw") dn = !0; else { Je(); continue; } for (wt = 0; wt < Mt; wt++) je( zt[wt], Pt[wt], _t.concat(wt), // add array indices, but not if we're already in an array a.extendFlat({ inArray: xe, arrayIndex: wt }, de) ); if (dn) for (wt = Mt; wt < tn; wt++) qt.push(wt); } else !Nt && a.isPlainObject(zt) ? je(zt, Pt, _t, de) : Yt ? Jt && jt ? (le && (De.calc = !0), (le || de.newDataRevision) && Je()) : Jt !== jt ? De.calc = !0 : Je() : Jt && jt ? (zt.length !== Pt.length || String(zt) !== String(Pt)) && Je() : Je(); } } } for (xe in se) if (!(xe in $ || xe.charAt(0) === "_" || typeof se[xe] == "function")) if (Te = qe(ie.concat(xe)), Dt(Te) && Array.isArray(se[xe])) { De.calc = !0; return; } else Je(); } function tt($, se) { var ie; for (ie in $) if (ie.charAt(0) !== "_") { var de = $[ie], Te = se[ie]; if (de !== Te) if (a.isPlainObject(de) && a.isPlainObject(Te)) { if (tt(de, Te)) return !0; } else if (Array.isArray(de) && Array.isArray(Te)) { if (de.length !== Te.length) return !0; for (var xe = 0; xe < de.length; xe++) if (de[xe] !== Te[xe]) if (a.isPlainObject(de[xe]) && a.isPlainObject(Te[xe])) { if (tt(de[xe], Te[xe])) return !0; } else return !0; } else return !0; } } function pt($, se, ie) { if ($ = a.getGraphDiv($), !a.isPlotDiv($)) throw new Error( "This element is not a Plotly plot: " + $ + ". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/" ); var de = $._transitionData; de._frameQueue || (de._frameQueue = []), ie = u.supplyAnimationDefaults(ie); var Te = ie.transition, xe = ie.frame; de._frameWaitingCnt === void 0 && (de._frameWaitingCnt = 0); function Ge(le) { return Array.isArray(Te) ? le >= Te.length ? Te[0] : Te[le] : Te; } function qe(le) { return Array.isArray(xe) ? le >= xe.length ? xe[0] : xe[le] : xe; } function De(le, Se) { var He = 0; return function() { if (le && ++He === Se) return le(); }; } return new Promise(function(le, Se) { function He() { if (de._frameQueue.length !== 0) { for (; de._frameQueue.length; ) { var Mt = de._frameQueue.pop(); Mt.onInterrupt && Mt.onInterrupt(); } $.emit("plotly_animationinterrupted", []); } } function Je(Mt) { if (Mt.length !== 0) { for (var tn = 0; tn < Mt.length; tn++) { var Ht; Mt[tn].type === "byname" ? Ht = u.computeFrame($, Mt[tn].name) : Ht = Mt[tn].data; var jn = qe(tn), an = Ge(tn); an.duration = Math.min(an.duration, jn.duration); var En = { frame: Ht, name: Mt[tn].name, frameOpts: jn, transitionOpts: an }; tn === Mt.length - 1 && (En.onComplete = De(le, 2), En.onInterrupt = Se), de._frameQueue.push(En); } ie.mode === "immediate" && (de._lastFrameAt = -1 / 0), de._animationRaf || Pt(); } } function Dt() { $.emit("plotly_animated"), window.cancelAnimationFrame(de._animationRaf), de._animationRaf = null; } function zt() { de._currentFrame && de._currentFrame.onComplete && de._currentFrame.onComplete(); var Mt = de._currentFrame = de._frameQueue.shift(); if (Mt) { var tn = Mt.name ? Mt.name.toString() : null; $._fullLayout._currentFrame = tn, de._lastFrameAt = Date.now(), de._timeToNext = Mt.frameOpts.duration, u.transition( $, Mt.frame.data, Mt.frame.layout, k.coerceTraceIndices($, Mt.frame.traces), Mt.frameOpts, Mt.transitionOpts ).then(function() { Mt.onComplete && Mt.onComplete(); }), $.emit("plotly_animatingframe", { name: tn, frame: Mt.frame, animation: { frame: Mt.frameOpts, transition: Mt.transitionOpts } }); } else Dt(); } function Pt() { $.emit("plotly_animating"), de._lastFrameAt = -1 / 0, de._timeToNext = 0, de._runningTransitions = 0, de._currentFrame = null; var Mt = function() { de._animationRaf = window.requestAnimationFrame(Mt), Date.now() - de._lastFrameAt > de._timeToNext && zt(); }; Mt(); } var _t = 0; function $t(Mt) { return Array.isArray(Te) ? _t >= Te.length ? Mt.transitionOpts = Te[_t] : Mt.transitionOpts = Te[0] : Mt.transitionOpts = Te, _t++, Mt; } var Nt, wt, Yt = [], Jt = se == null, jt = Array.isArray(se), Et = !Jt && !jt && a.isPlainObject(se); if (Et) Yt.push({ type: "object", data: $t(a.extendFlat({}, se)) }); else if (Jt || ["string", "number"].indexOf(typeof se) !== -1) for (Nt = 0; Nt < de._frames.length; Nt++) wt = de._frames[Nt], wt && (Jt || String(wt.group) === String(se)) && Yt.push({ type: "byname", name: String(wt.name), data: $t({ name: wt.name }) }); else if (jt) for (Nt = 0; Nt < se.length; Nt++) { var At = se[Nt]; ["number", "string"].indexOf(typeof At) !== -1 ? (At = String(At), Yt.push({ type: "byname", name: At, data: $t({ name: At }) })) : a.isPlainObject(At) && Yt.push({ type: "object", data: $t(a.extendFlat({}, At)) }); } for (Nt = 0; Nt < Yt.length; Nt++) if (wt = Yt[Nt], wt.type === "byname" && !de._frameHash[wt.data.name]) { a.warn('animate failure: frame not found: "' + wt.data.name + '"'), Se(); return; } ["next", "immediate"].indexOf(ie.mode) !== -1 && He(), ie.direction === "reverse" && Yt.reverse(); var Ot = $._fullLayout._currentFrame; if (Ot && ie.fromcurrent) { var qt = -1; for (Nt = 0; Nt < Yt.length; Nt++) if (wt = Yt[Nt], wt.type === "byname" && wt.name === Ot) { qt = Nt; break; } if (qt > 0 && qt < Yt.length - 1) { var dn = []; for (Nt = 0; Nt < Yt.length; Nt++) wt = Yt[Nt], (Yt[Nt].type !== "byname" || Nt > qt) && dn.push(wt); Yt = dn; } } Yt.length > 0 ? Je(Yt) : ($.emit("plotly_animated"), le()); }); } function kt($, se, ie) { if ($ = a.getGraphDiv($), se == null) return Promise.resolve(); if (!a.isPlotDiv($)) throw new Error( "This element is not a Plotly plot: " + $ + ". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/" ); var de, Te, xe, Ge, qe = $._transitionData._frames, De = $._transitionData._frameHash; if (!Array.isArray(se)) throw new Error("addFrames failure: frameList must be an Array of frame definitions" + se); var le = qe.length + se.length * 2, Se = [], He = {}; for (de = se.length - 1; de >= 0; de--) if (a.isPlainObject(se[de])) { var Je = se[de].name, Dt = (De[Je] || He[Je] || {}).name, zt = se[de].name, Pt = De[Dt] || He[Dt]; Dt && zt && typeof zt == "number" && Pt && C < I && (C++, a.warn('addFrames: overwriting frame "' + (De[Dt] || He[Dt]).name + '" with a frame whose name of type "number" also equates to "' + Dt + '". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'), C === I && a.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")), He[Je] = { name: Je }, Se.push({ frame: u.supplyFrameDefaults(se[de]), index: ie && ie[de] !== void 0 && ie[de] !== null ? ie[de] : le + de }); } Se.sort(function(Et, At) { return Et.index > At.index ? -1 : Et.index < At.index ? 1 : 0; }); var _t = [], $t = [], Nt = qe.length; for (de = Se.length - 1; de >= 0; de--) { if (Te = Se[de].frame, typeof Te.name == "number" && a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"), !Te.name) for (; De[Te.name = "frame " + $._transitionData._counter++]; ) ; if (De[Te.name]) { for (xe = 0; xe < qe.length && (qe[xe] || {}).name !== Te.name; xe++) ; _t.push({ type: "replace", index: xe, value: Te }), $t.unshift({ type: "replace", index: xe, value: qe[xe] }); } else Ge = Math.max(0, Math.min(Se[de].index, Nt)), _t.push({ type: "insert", index: Ge, value: Te }), $t.unshift({ type: "delete", index: Ge }), Nt++; } var wt = u.modifyFrames, Yt = u.modifyFrames, Jt = [$, $t], jt = [$, _t]; return l && l.add($, wt, Jt, Yt, jt), u.modifyFrames($, _t); } function et($, se) { if ($ = a.getGraphDiv($), !a.isPlotDiv($)) throw new Error("This element is not a Plotly plot: " + $); var ie, de, Te = $._transitionData._frames, xe = [], Ge = []; if (!se) for (se = [], ie = 0; ie < Te.length; ie++) se.push(ie); for (se = se.slice(), se.sort(), ie = se.length - 1; ie >= 0; ie--) de = se[ie], xe.push({ type: "delete", index: de }), Ge.unshift({ type: "insert", index: de, value: Te[de] }); var qe = u.modifyFrames, De = u.modifyFrames, le = [$, Ge], Se = [$, xe]; return l && l.add($, qe, le, De, Se), u.modifyFrames($, xe); } function ft($) { $ = a.getGraphDiv($); var se = $._fullLayout || {}, ie = $._fullData || []; return u.cleanPlot([], {}, ie, se), u.purge($), o.purge($), se._container && se._container.remove(), delete $._context, $; } function $e($) { var se = $._fullLayout, ie = $.getBoundingClientRect(); if (!a.equalDomRects(ie, se._lastBBox)) { var de = se._invTransform = a.inverseTransformMatrix(a.getFullTransformMatrix($)); se._invScaleX = Math.sqrt(de[0][0] * de[0][0] + de[0][1] * de[0][1] + de[0][2] * de[0][2]), se._invScaleY = Math.sqrt(de[1][0] * de[1][0] + de[1][1] * de[1][1] + de[1][2] * de[1][2]), se._lastBBox = ie; } } function Lt($) { var se = t.select($), ie = $._fullLayout; if (ie._calcInverseTransform = $e, ie._calcInverseTransform($), ie._container = se.selectAll(".plot-container").data([0]), ie._container.enter().insert("div", ":first-child").classed("plot-container", !0).classed("plotly", !0), ie._paperdiv = ie._container.selectAll(".svg-container").data([0]), ie._paperdiv.enter().append("div").classed("user-select-none", !0).classed("svg-container", !0).style("position", "relative"), ie._glcontainer = ie._paperdiv.selectAll(".gl-container").data([{}]), ie._glcontainer.enter().append("div").classed("gl-container", !0), ie._paperdiv.selectAll(".main-svg").remove(), ie._paperdiv.select(".modebar-container").remove(), ie._paper = ie._paperdiv.insert("svg", ":first-child").classed("main-svg", !0), ie._toppaper = ie._paperdiv.append("svg").classed("main-svg", !0), ie._modebardiv = ie._paperdiv.append("div"), delete ie._modeBar, ie._hoverpaper = ie._paperdiv.append("svg").classed("main-svg", !0), !ie._uid) { var de = {}; t.selectAll("defs").each(function() { this.id && (de[this.id.split("-")[1]] = 1); }), ie._uid = a.randstr(de); } ie._paperdiv.selectAll(".main-svg").attr(m.svgAttrs), ie._defs = ie._paper.append("defs").attr("id", "defs-" + ie._uid), ie._clips = ie._defs.append("g").classed("clips", !0), ie._topdefs = ie._toppaper.append("defs").attr("id", "topdefs-" + ie._uid), ie._topclips = ie._topdefs.append("g").classed("clips", !0), ie._bgLayer = ie._paper.append("g").classed("bglayer", !0), ie._draggers = ie._paper.append("g").classed("draglayer", !0); var Te = ie._paper.append("g").classed("layer-below", !0); ie._imageLowerLayer = Te.append("g").classed("imagelayer", !0), ie._shapeLowerLayer = Te.append("g").classed("shapelayer", !0), ie._cartesianlayer = ie._paper.append("g").classed("cartesianlayer", !0), ie._polarlayer = ie._paper.append("g").classed("polarlayer", !0), ie._smithlayer = ie._paper.append("g").classed("smithlayer", !0), ie._ternarylayer = ie._paper.append("g").classed("ternarylayer", !0), ie._geolayer = ie._paper.append("g").classed("geolayer", !0), ie._funnelarealayer = ie._paper.append("g").classed("funnelarealayer", !0), ie._pielayer = ie._paper.append("g").classed("pielayer", !0), ie._iciclelayer = ie._paper.append("g").classed("iciclelayer", !0), ie._treemaplayer = ie._paper.append("g").classed("treemaplayer", !0), ie._sunburstlayer = ie._paper.append("g").classed("sunburstlayer", !0), ie._indicatorlayer = ie._toppaper.append("g").classed("indicatorlayer", !0), ie._glimages = ie._paper.append("g").classed("glimages", !0); var xe = ie._toppaper.append("g").classed("layer-above", !0); ie._imageUpperLayer = xe.append("g").classed("imagelayer", !0), ie._shapeUpperLayer = xe.append("g").classed("shapelayer", !0), ie._selectionLayer = ie._toppaper.append("g").classed("selectionlayer", !0), ie._infolayer = ie._toppaper.append("g").classed("infolayer", !0), ie._menulayer = ie._toppaper.append("g").classed("menulayer", !0), ie._zoomlayer = ie._toppaper.append("g").classed("zoomlayer", !0), ie._hoverlayer = ie._hoverpaper.append("g").classed("hoverlayer", !0), ie._modebardiv.classed("modebar-container", !0).style("position", "absolute").style("top", "0px").style("right", "0px"), $.emit("plotly_framework"); } e.animate = pt, e.addFrames = kt, e.deleteFrames = et, e.addTraces = G, e.deleteTraces = Z, e.extendTraces = ce, e.moveTraces = oe, e.prependTraces = B, e.newPlot = z, e._doPlot = j, e.purge = ft, e.react = it, e.redraw = E, e.relayout = Ie, e.restyle = ae, e.setPlotConfig = N, e.update = ct, e._guiRelayout = vt(Ie), e._guiRestyle = vt(ae), e._guiUpdate = vt(ct), e._storeDirectGUIEdit = ye; })(nx); var Vr = {}, Pee = Rt; Vr.getDelay = function(e) { return e._has && (e._has("gl3d") || e._has("gl2d") || e._has("mapbox")) ? 500 : 0; }; Vr.getRedrawFunc = function(e) { return function() { Pee.getComponentMethod("colorbar", "draw")(e); }; }; Vr.encodeSVG = function(e) { return "data:image/svg+xml," + encodeURIComponent(e); }; Vr.encodeJSON = function(e) { return "data:application/json," + encodeURIComponent(e); }; var M8 = window.URL || window.webkitURL; Vr.createObjectURL = function(e) { return M8.createObjectURL(e); }; Vr.revokeObjectURL = function(e) { return M8.revokeObjectURL(e); }; Vr.createBlob = function(e, t) { if (t === "svg") return new window.Blob([e], { type: "image/svg+xml;charset=utf-8" }); if (t === "full-json") return new window.Blob([e], { type: "application/json;charset=utf-8" }); var n = Ree(window.atob(e)); return new window.Blob([n], { type: "image/" + t }); }; Vr.octetStream = function(e) { document.location.href = "data:application/octet-stream" + e; }; function Ree(e) { for (var t = e.length, n = new ArrayBuffer(t), r = new Uint8Array(n), a = 0; a < t; a++) r[a] = e.charCodeAt(a); return n; } Vr.IMAGE_URL_PREFIX = /^data:image\/\w+;base64,/; Vr.MSG_IE_BAD_FORMAT = "Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."; var Ny = sn, Nee = Ue, Bee = Cn, Hee = rn, gh = yl, Bv = /"/g, nd = "TOBESTRIPPED", Vee = new RegExp('("' + nd + ")|(" + nd + '")', "g"); function qee(e) { var t = Ny.select("body").append("div").style({ display: "none" }).html(""), n = e.replace(/(&[^;]*;)/gi, function(r) { return r === "<" ? "<" : r === "&rt;" ? ">" : r.indexOf("<") !== -1 || r.indexOf(">") !== -1 ? "" : t.html(r).text(); }); return t.remove(), n; } function Uee(e) { return e.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g, "&"); } var Xx = function(e, t, n) { var r = e._fullLayout, a = r._paper, i = r._toppaper, o = r.width, l = r.height, s; a.insert("rect", ":first-child").call(Bee.setRect, 0, 0, o, l).call(Hee.fill, r.paper_bgcolor); var c = r._basePlotModules || []; for (s = 0; s < c.length; s++) { var u = c[s]; u.toSVG && u.toSVG(e); } if (i) { var f = i.node().childNodes, h = Array.prototype.slice.call(f); for (s = 0; s < h.length; s++) { var g = h[s]; g.childNodes.length && a.node().appendChild(g); } } r._draggers && r._draggers.remove(), a.node().style.background = "", a.selectAll("text").attr({ "data-unformatted": null, "data-math": null }).each(function() { var v = Ny.select(this); if (this.style.visibility === "hidden" || this.style.display === "none") { v.remove(); return; } else v.style({ visibility: null, display: null }); var y = this.style.fontFamily; y && y.indexOf('"') !== -1 && v.style("font-family", y.replace(Bv, nd)); }), a.selectAll(".gradient_filled,.pattern_filled").each(function() { var v = Ny.select(this), y = this.style.fill; y && y.indexOf("url(") !== -1 && v.style("fill", y.replace(Bv, nd)); var m = this.style.stroke; m && m.indexOf("url(") !== -1 && v.style("stroke", m.replace(Bv, nd)); }), (t === "pdf" || t === "eps") && a.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width", 0), a.node().setAttributeNS(gh.xmlns, "xmlns", gh.svg), a.node().setAttributeNS(gh.xmlns, "xmlns:xlink", gh.xlink), t === "svg" && n && (a.attr("width", n * o), a.attr("height", n * l), a.attr("viewBox", "0 0 " + o + " " + l)); var p = new window.XMLSerializer().serializeToString(a.node()); return p = qee(p), p = Uee(p), p = p.replace(Vee, "'"), Nee.isIE() && (p = p.replace(/"/gi, "'"), p = p.replace(/(\('#)([^']*)('\))/gi, '("#$2")'), p = p.replace(/(\\')/gi, '"')), p; }, D5 = Ue, Gee = ax.EventEmitter, Bs = Vr; function Wee(e) { var t = e.emitter || new Gee(), n = new Promise(function(r, a) { var i = window.Image, o = e.svg, l = e.format || "png"; if (D5.isIE() && l !== "svg") { var s = new Error(Bs.MSG_IE_BAD_FORMAT); return a(s), e.promise ? n : t.emit("error", s); } var c = e.canvas, u = e.scale || 1, f = e.width || 300, h = e.height || 150, g = u * f, p = u * h, v = c.getContext("2d", { willReadFrequently: !0 }), y = new i(), m, b; l === "svg" || D5.isSafari() ? b = Bs.encodeSVG(o) : (m = Bs.createBlob(o, "svg"), b = Bs.createObjectURL(m)), c.width = g, c.height = p, y.onload = function() { var w; switch (m = null, Bs.revokeObjectURL(b), l !== "svg" && v.drawImage(y, 0, 0, g, p), l) { case "jpeg": w = c.toDataURL("image/jpeg"); break; case "png": w = c.toDataURL("image/png"); break; case "webp": w = c.toDataURL("image/webp"); break; case "svg": w = b; break; default: var _ = "Image format is not jpeg, png, svg or webp."; if (a(new Error(_)), !e.promise) return t.emit("error", _); } r(w), e.promise || t.emit("success", w); }, y.onerror = function(w) { if (m = null, Bs.revokeObjectURL(b), a(w), !e.promise) return t.emit("error", w); }, y.src = b; }); return e.promise ? n : t; } var eb = Wee, F5 = cn, I5 = nx, Zee = kr, Oi = Ue, Ru = Vr, Yee = Xx, $ee = eb, Kee = a0.version, Hv = { format: { valType: "enumerated", values: ["png", "jpeg", "webp", "svg", "full-json"], dflt: "png", description: "Sets the format of exported image." }, width: { valType: "number", min: 1, description: [ "Sets the exported image width.", "Defaults to the value found in `layout.width`", "If set to *null*, the exported image width will match the current graph width." ].join(" ") }, height: { valType: "number", min: 1, description: [ "Sets the exported image height.", "Defaults to the value found in `layout.height`", "If set to *null*, the exported image height will match the current graph height." ].join(" ") }, scale: { valType: "number", min: 0, dflt: 1, description: [ "Sets a scaling for the generated image.", "If set, all features of a graphs (e.g. text, line width)", "are scaled, unlike simply setting", "a bigger *width* and *height*." ].join(" ") }, setBackground: { valType: "any", dflt: !1, description: [ "Sets the image background mode.", "By default, the image background is determined by `layout.paper_bgcolor`,", "the *transparent* mode.", "One might consider setting `setBackground` to *opaque*", "when exporting a *jpeg* image as JPEGs do not support opacity." ].join(" ") }, imageDataOnly: { valType: "boolean", dflt: !1, description: [ "Determines whether or not the return value is prefixed by", "the image format's corresponding 'data:image;' spec." ].join(" ") } }; function Jee(e, t) { t = t || {}; var n, r, a, i; Oi.isPlainObject(e) ? (n = e.data || [], r = e.layout || {}, a = e.config || {}, i = {}) : (e = Oi.getGraphDiv(e), n = Oi.extendDeep([], e.data), r = Oi.extendDeep({}, e.layout), a = e._context, i = e._fullLayout || {}); function o(T) { return !(T in t) || Oi.validate(t[T], Hv[T]); } if (!o("width") && t.width !== null || !o("height") && t.height !== null) throw new Error("Height and width should be pixel values."); if (!o("format")) throw new Error("Export format is not " + Oi.join2(Hv.format.values, ", ", " or ") + "."); var l = {}; function s(T, O) { return Oi.coerce(t, l, Hv, T, O); } var c = s("format"), u = s("width"), f = s("height"), h = s("scale"), g = s("setBackground"), p = s("imageDataOnly"), v = document.createElement("div"); v.style.position = "absolute", v.style.left = "-5000px", document.body.appendChild(v); var y = Oi.extendFlat({}, r); u ? y.width = u : t.width === null && F5(i.width) && (y.width = i.width), f ? y.height = f : t.height === null && F5(i.height) && (y.height = i.height); var m = Oi.extendFlat({}, a, { _exportedPlot: !0, staticPlot: !0, setBackground: g }), b = Ru.getRedrawFunc(v); function w() { return new Promise(function(T) { setTimeout(T, Ru.getDelay(v._fullLayout)); }); } function _() { return new Promise(function(T, O) { var M = Yee(v, c, h), C = v._fullLayout.width, I = v._fullLayout.height; function j() { I5.purge(v), document.body.removeChild(v); } if (c === "full-json") { var P = Zee.graphJson(v, !1, "keepdata", "object", !0, !0); return P.version = Kee, P = JSON.stringify(P), j(), T(p ? P : Ru.encodeJSON(P)); } if (j(), c === "svg") return T(p ? M : Ru.encodeSVG(M)); var N = document.createElement("canvas"); N.id = Oi.randstr(), $ee({ format: c, width: C, height: I, scale: h, canvas: N, svg: M, // ask svgToImg to return a Promise // rather than EventEmitter // leave EventEmitter for backward // compatibility promise: !0 }).then(T).catch(O); }); } function k(T) { return p ? T.replace(Ru.IMAGE_URL_PREFIX, "") : T; } return new Promise(function(T, O) { I5.newPlot(v, n, y, m).then(b).then(w).then(_).then(function(M) { T(k(M)); }).catch(function(M) { O(M); }); }); } var S8 = Jee, Wa = Ue, Qee = kr, Xee = Qc, ete = Yc.dfltConfig, za = Wa.isPlainObject, ol = Array.isArray, z5 = Wa.isArrayOrTypedArray, tte = function(e, t) { e === void 0 && (e = []), t === void 0 && (t = {}); var n = Xee.get(), r = [], a = { _context: Wa.extendFlat({}, ete) }, i, o; ol(e) ? (a.data = Wa.extendDeep([], e), i = e) : (a.data = [], i = [], r.push(rr("array", "data"))), za(t) ? (a.layout = Wa.extendDeep({}, t), o = t) : (a.layout = {}, o = {}, arguments.length > 1 && r.push(rr("object", "layout"))), Qee.supplyDefaults(a); for (var l = a._fullData, s = i.length, c = 0; c < s; c++) { var u = i[c], f = ["data", c]; if (!za(u)) { r.push(rr("object", f)); continue; } var h = l[c], g = h.type, p = n.traces[g].attributes; p.type = { valType: "enumerated", values: [g] }, h.visible === !1 && u.visible !== !1 && r.push(rr("invisible", f)), rd(u, h, p, r, f); var v = u.transforms, y = h.transforms; if (v) { ol(v) || r.push(rr("array", f, ["transforms"])), f.push("transforms"); for (var m = 0; m < v.length; m++) { var b = ["transforms", m], w = v[m].type; if (!za(v[m])) { r.push(rr("object", f, b)); continue; } var _ = n.transforms[w] ? n.transforms[w].attributes : {}; _.type = { valType: "enumerated", values: Object.keys(n.transforms) }, rd(v[m], y[m], _, r, f, b); } } } var k = a._fullLayout, T = nte(n, l); return rd(o, k, T, r, "layout"), r.length === 0 ? void 0 : r; }; function rd(e, t, n, r, a, i) { i = i || []; for (var o = Object.keys(e), l = 0; l < o.length; l++) { var s = o[l]; if (s !== "transforms") { var c = i.slice(); c.push(s); var u = e[s], f = t[s], h = ite(n, s), g = (h || {}).valType, p = g === "info_array", v = g === "colorscale", y = (h || {}).items; if (!ate(n, s)) r.push(rr("schema", a, c)); else if (za(u) && za(f) && g !== "any") rd(u, f, h, r, a, c); else if (p && ol(u)) { u.length > f.length && r.push(rr("unused", a, c.concat(f.length))); var m = f.length, b = Array.isArray(y); b && (m = Math.min(m, y.length)); var w, _, k, T, O; if (h.dimensions === 2) for (_ = 0; _ < m; _++) if (ol(u[_])) { u[_].length > f[_].length && r.push(rr("unused", a, c.concat(_, f[_].length))); var M = f[_].length; for (w = 0; w < (b ? Math.min(M, y[_].length) : M); w++) k = b ? y[_][w] : y, T = u[_][w], O = f[_][w], Wa.validate(T, k) ? O !== T && O !== +T && r.push(rr("dynamic", a, c.concat(_, w), T, O)) : r.push(rr("value", a, c.concat(_, w), T)); } else r.push(rr("array", a, c.concat(_), u[_])); else for (_ = 0; _ < m; _++) k = b ? y[_] : y, T = u[_], O = f[_], Wa.validate(T, k) ? O !== T && O !== +T && r.push(rr("dynamic", a, c.concat(_), T, O)) : r.push(rr("value", a, c.concat(_), T)); } else if (h.items && !p && ol(u)) { var C = y[Object.keys(y)[0]], I = [], j, P; for (j = 0; j < f.length; j++) { var N = f[j]._index || j; if (P = c.slice(), P.push(N), za(u[N]) && za(f[j])) { I.push(N); var W = u[N], J = f[j]; za(W) && W.visible !== !1 && J.visible === !1 ? r.push(rr("invisible", a, P)) : rd(W, J, C, r, a, P); } } for (j = 0; j < u.length; j++) P = c.slice(), P.push(j), za(u[j]) ? I.indexOf(j) === -1 && r.push(rr("unused", a, P)) : r.push(rr("object", a, P, u[j])); } else !za(u) && za(f) ? r.push(rr("object", a, c, u)) : !z5(u) && z5(f) && !p && !v ? r.push(rr("array", a, c, u)) : s in t ? Wa.validate(u, h) ? h.valType === "enumerated" && (h.coerceNumber && u !== +f || u !== f) && r.push(rr("dynamic", a, c, u, f)) : r.push(rr("value", a, c, u)) : r.push(rr("unused", a, c, u)); } } return r; } function nte(e, t) { for (var n = e.layout.layoutAttributes, r = 0; r < t.length; r++) { var a = t[r], i = e.traces[a.type], o = i.layoutAttributes; o && (a.subplot ? Wa.extendFlat(n[i.attributes.subplot.dflt], o) : Wa.extendFlat(n, o)); } return n; } var rte = { object: function(e, t) { var n; return e === "layout" && t === "" ? n = "The layout argument" : e[0] === "data" && t === "" ? n = "Trace " + e[1] + " in the data argument" : n = Fl(e) + "key " + t, n + " must be linked to an object container"; }, array: function(e, t) { var n; return e === "data" ? n = "The data argument" : n = Fl(e) + "key " + t, n + " must be linked to an array container"; }, schema: function(e, t) { return Fl(e) + "key " + t + " is not part of the schema"; }, unused: function(e, t, n) { var r = za(n) ? "container" : "key"; return Fl(e) + r + " " + t + " did not get coerced"; }, dynamic: function(e, t, n, r) { return [ Fl(e) + "key", t, "(set to '" + n + "')", "got reset to", "'" + r + "'", "during defaults." ].join(" "); }, invisible: function(e, t) { return (t ? Fl(e) + "item " + t : "Trace " + e[1]) + " got defaulted to be not visible"; }, value: function(e, t, n) { return [ Fl(e) + "key " + t, "is set to an invalid value (" + n + ")" ].join(" "); } }; function Fl(e) { return ol(e) ? "In data trace " + e[1] + ", " : "In " + e + ", "; } function rr(e, t, n, r, a) { n = n || ""; var i, o; ol(t) ? (i = t[0], o = t[1]) : (i = t, o = null); var l = lte(n), s = rte[e](t, l, r, a); return Wa.log(s), { code: e, container: i, trace: o, path: n, astr: l, msg: s }; } function ate(e, t) { var n = C8(t), r = n.keyMinusId, a = n.id; return r in e && e[r]._isSubplotObj && a ? !0 : t in e; } function ite(e, t) { if (t in e) return e[t]; var n = C8(t); return e[n.keyMinusId]; } var ote = Wa.counterRegex("([a-z]+)"); function C8(e) { var t = e.match(ote); return { keyMinusId: t && t[1], id: t && t[2] }; } function lte(e) { if (!ol(e)) return String(e); for (var t = "", n = 0; n < e.length; n++) { var r = e[n]; typeof r == "number" ? t = t.substr(0, t.length - 1) + "[" + r + "]" : t += r, n < e.length - 1 && (t += "."); } return t; } var E5 = Ue, Nu = Vr; function ste(e, t, n) { var r = document.createElement("a"), a = "download" in r, i = new Promise(function(o, l) { var s, c; if (E5.isIE()) return s = Nu.createBlob(e, "svg"), window.navigator.msSaveBlob(s, t), s = null, o(t); if (a) return s = Nu.createBlob(e, n), c = Nu.createObjectURL(s), r.href = c, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), Nu.revokeObjectURL(c), s = null, o(t); if (E5.isSafari()) { var u = n === "svg" ? "," : ";base64,"; return Nu.octetStream(u + encodeURIComponent(e)), o(t); } l(new Error("download error")); }); return i; } var cte = ste, Vv = Ue, ute = S8, dte = cte, fte = Vr; function hte(e, t) { var n; return Vv.isPlainObject(e) || (n = Vv.getGraphDiv(e)), t = t || {}, t.format = t.format || "png", t.width = t.width || null, t.height = t.height || null, t.imageDataOnly = !0, new Promise(function(r, a) { n && n._snapshotInProgress && a(new Error("Snapshotting already in progress.")), Vv.isIE() && t.format !== "svg" && a(new Error(fte.MSG_IE_BAD_FORMAT)), n && (n._snapshotInProgress = !0); var i = ute(e, t), o = t.filename || e.fn || "newplot"; o += "." + t.format.replace("-", "."), i.then(function(l) { return n && (n._snapshotInProgress = !1), dte(l, o, t.format); }).then(function(l) { r(l); }).catch(function(l) { n && (n._snapshotInProgress = !1), a(l); }); }); } var L8 = hte, tb = {}, la = Ue, sa = la.isPlainObject, O8 = Qc, D8 = kr, pte = Zi, F8 = Sn, I8 = Yc.dfltConfig; tb.makeTemplate = function(e) { e = la.isPlainObject(e) ? e : la.getGraphDiv(e), e = la.extendDeep({ _context: I8 }, { data: e.data, layout: e.layout }), D8.supplyDefaults(e); var t = e.data || [], n = e.layout || {}; n._basePlotModules = e._fullLayout._basePlotModules, n._modules = e._fullLayout._modules; var r = { data: {}, layout: {} }; t.forEach(function(g) { var p = {}; ad(g, p, vte.bind(null, g)); var v = la.coerce(g, {}, pte, "type"), y = r.data[v]; y || (y = r.data[v] = []), y.push(p); }), ad(n, r.layout, gte.bind(null, n)), delete r.layout.template; var a = n.template; if (sa(a)) { var i = a.layout, o, l, s, c, u, f; sa(i) && Mp(i, r.layout); var h = a.data; if (sa(h)) { for (l in r.data) if (s = h[l], Array.isArray(s)) { for (u = r.data[l], f = u.length, c = s.length, o = 0; o < f; o++) Mp(s[o % c], u[o]); for (o = f; o < c; o++) u.push(la.extendDeep({}, s[o])); } for (l in h) l in r.data || (r.data[l] = la.extendDeep([], h[l])); } } return r; }; function Mp(e, t) { e = la.extendDeep({}, e); var n = Object.keys(e).sort(), r, a; function i(u, f, h) { if (sa(f) && sa(u)) Mp(u, f); else if (Array.isArray(f) && Array.isArray(u)) { var g = F8.arrayTemplater({ _template: e }, h); for (a = 0; a < f.length; a++) { var p = f[a], v = g.newItem(p)._template; v && Mp(v, p); } var y = g.defaultItems(); for (a = 0; a < y.length; a++) f.push(y[a]._template); for (a = 0; a < f.length; a++) delete f[a].templateitemname; } } for (r = 0; r < n.length; r++) { var o = n[r], l = e[o]; if (o in t ? i(l, t[o], o) : t[o] = l, Sp(o) === o) for (var s in t) { var c = Sp(s); s !== c && c === o && !(s in e) && i(l, t[s], o); } } } function Sp(e) { return e.replace(/[0-9]+$/, ""); } function ad(e, t, n, r, a) { var i = a && n(a); for (var o in e) { var l = e[o], s = Ea(e, o, r), c = Ea(e, o, a), u = n(c); if (!u) { var f = Sp(o); f !== o && (c = Ea(e, f, a), u = n(c)); } if (!(i && i === u) && !(!u || u._noTemplating || u.valType === "data_array" || u.arrayOk && Array.isArray(l))) if (!u.valType && sa(l)) ad(l, t, n, s, c); else if (u._isLinkedToArray && Array.isArray(l)) for (var h = !1, g = 0, p = {}, v = 0; v < l.length; v++) { var y = l[v]; if (sa(y)) { var m = y.name; if (m) p[m] || (ad( y, t, n, Ea(l, g, s), Ea(l, g, c) ), g++, p[m] = 1); else if (!h) { var b = F8.arrayDefaultKey(o), w = Ea(e, b, r), _ = Ea(l, g, s); ad( y, t, n, _, Ea(l, g, c) ); var k = la.nestedProperty(t, _), T = la.nestedProperty(t, w); T.set(k.get()), k.set(null), h = !0; } } } else { var O = la.nestedProperty(t, s); O.set(l); } } } function gte(e, t) { return O8.getLayoutValObject( e, la.nestedProperty({}, t).parts ); } function vte(e, t) { return O8.getTraceValObject( e, la.nestedProperty({}, t).parts ); } function Ea(e, t, n) { var r; return n ? Array.isArray(e) ? r = n + "[" + t + "]" : r = n + "." + t : r = t, r; } tb.validateTemplate = function(e, t) { var n = la.extendDeep({}, { _context: I8, data: e.data, layout: e.layout }), r = n.layout || {}; sa(t) || (t = r.template || {}); var a = t.layout, i = t.data, o = []; n.layout = r, n.layout.template = t, D8.supplyDefaults(n); var l = n._fullLayout, s = n._fullData, c = {}; function u(w, _) { for (var k in w) if (k.charAt(0) !== "_" && sa(w[k])) { var T = Sp(k), O = [], M; for (M = 0; M < _.length; M++) O.push(Ea(w, k, _[M])), T !== k && O.push(Ea(w, T, _[M])); for (M = 0; M < O.length; M++) c[O[M]] = 1; u(w[k], O); } } function f(w, _) { for (var k in w) if (k.indexOf("defaults") === -1 && sa(w[k])) { var T = Ea(w, k, _); c[T] ? f(w[k], T) : o.push({ code: "unused", path: T }); } } if (sa(a) ? (u(l, ["layout"]), f(a, "layout")) : o.push({ code: "layout" }), !sa(i)) o.push({ code: "data" }); else { for (var h = {}, g, p = 0; p < s.length; p++) { var v = s[p]; g = v.type, h[g] = (h[g] || 0) + 1, v._fullInput._template || o.push({ code: "missing", index: v._fullInput.index, traceType: g }); } for (g in i) { var y = i[g].length, m = h[g] || 0; y > m ? o.push({ code: "unused", traceType: g, templateCount: y, dataCount: m }) : m > y && o.push({ code: "reused", traceType: g, templateCount: y, dataCount: m }); } } function b(w, _) { for (var k in w) if (k.charAt(0) !== "_") { var T = w[k], O = Ea(w, k, _); sa(T) ? (Array.isArray(w) && T._template === !1 && T.templateitemname && o.push({ code: "missing", path: O, templateitemname: T.templateitemname }), b(T, O)) : Array.isArray(T) && mte(T) && b(T, O); } } if (b({ data: s, layout: l }, ""), o.length) return o.map(yte); }; function mte(e) { for (var t = 0; t < e.length; t++) if (sa(e[t])) return !0; } function yte(e) { var t; switch (e.code) { case "data": t = "The template has no key data."; break; case "layout": t = "The template has no key layout."; break; case "missing": e.path ? t = "There are no templates for item " + e.path + " with name " + e.templateitemname : t = "There are no templates for trace " + e.index + ", of type " + e.traceType + "."; break; case "unused": e.path ? t = "The template item at " + e.path + " was not used in constructing the plot." : e.dataCount ? t = "Some of the templates of type " + e.traceType + " were not used. The template has " + e.templateCount + " traces, the data only has " + e.dataCount + " of this type." : t = "The template has " + e.templateCount + " traces of type " + e.traceType + " but there are none in the data."; break; case "reused": t = "Some of the templates of type " + e.traceType + " were used more than once. The template has " + e.templateCount + " traces, the data has " + e.dataCount + " of this type."; break; } return e.msg = t, e; } var fr = nx; Bn._doPlot = fr._doPlot; Bn.newPlot = fr.newPlot; Bn.restyle = fr.restyle; Bn.relayout = fr.relayout; Bn.redraw = fr.redraw; Bn.update = fr.update; Bn._guiRestyle = fr._guiRestyle; Bn._guiRelayout = fr._guiRelayout; Bn._guiUpdate = fr._guiUpdate; Bn._storeDirectGUIEdit = fr._storeDirectGUIEdit; Bn.react = fr.react; Bn.extendTraces = fr.extendTraces; Bn.prependTraces = fr.prependTraces; Bn.addTraces = fr.addTraces; Bn.deleteTraces = fr.deleteTraces; Bn.moveTraces = fr.moveTraces; Bn.purge = fr.purge; Bn.addFrames = fr.addFrames; Bn.deleteFrames = fr.deleteFrames; Bn.animate = fr.animate; Bn.setPlotConfig = fr.setPlotConfig; var xte = f0.getGraphDiv, bte = jx.eraseActiveShape; Bn.deleteActiveShape = function(e) { return bte(xte(e)); }; Bn.toImage = S8; Bn.validate = tte; Bn.downloadImage = L8; var z8 = tb; Bn.makeTemplate = z8.makeTemplate; Bn.validateTemplate = z8.validateTemplate; var qv = Ue, wte = Rt, E8 = function(e, t, n, r) { var a = r("x"), i = r("y"), o, l = wte.getComponentMethod("calendars", "handleTraceDefaults"); if (l(e, t, ["x", "y"], n), a) { var s = qv.minRowLength(a); i ? o = Math.min(s, qv.minRowLength(i)) : (o = s, r("y0"), r("dy")); } else { if (!i) return 0; o = qv.minRowLength(i), r("x0"), r("dx"); } return t._length = o, o; }, j5 = Ue.dateTick0, _te = er, kte = _te.ONEWEEK; function P5(e, t) { return e % kte === 0 ? j5(t, 1) : j5(t, 0); } var nb = function(e, t, n, r, a) { if (a || (a = { x: !0, y: !0 }), a.x) { var i = r("xperiod"); i && (r("xperiod0", P5(i, t.xcalendar)), r("xperiodalignment")); } if (a.y) { var o = r("yperiod"); o && (r("yperiod0", P5(o, t.ycalendar)), r("yperiodalignment")); } }, R5 = ["orientation", "groupnorm", "stackgaps"], Tte = function(e, t, n, r) { var a = n._scatterStackOpts, i = r("stackgroup"); if (i) { var o = t.xaxis + t.yaxis, l = a[o]; l || (l = a[o] = {}); var s = l[i], c = !1; s ? s.traces.push(t) : (s = l[i] = { // keep track of trace indices for use during stacking calculations // this will be filled in during `calc` and used during `crossTraceCalc` // so it's OK if we don't recreate it during a non-calc edit traceIndices: [], // Hold on to the whole set of prior traces // First one is most important, so we can clear defaults // there if we find explicit values only in later traces. // We're only going to *use* the values stored in groupOpts, // but for the editor and validate we want things self-consistent // The full set of traces is used only to fix `fill` default if // we find `orientation: 'h'` beyond the first trace traces: [t] }, c = !0); for (var u = { orientation: t.x && !t.y ? "h" : "v" }, f = 0; f < R5.length; f++) { var h = R5[f], g = h + "Found"; if (!s[g]) { var p = e[h] !== void 0, v = h === "orientation"; if ((p || c) && (s[h] = r(h, u[h]), v && (s.fillDflt = s[h] === "h" ? "tonextx" : "tonexty"), p && (s[g] = !0, !c && (delete s.traces[0][h], v)))) for (var y = 0; y < s.traces.length - 1; y++) { var m = s.traces[y]; m._input.fill !== m.fill && (m.fill = s.fillDflt); } } } return s; } }, N5 = rn, B5 = _i.hasColorscale, H5 = Xc, Ate = $a, Mte = function(e, t, n, r, a, i) { var o = Ate.isBubble(e), l = (e.line || {}).color, s; if (i = i || {}, l && (n = l), a("marker.symbol"), a("marker.opacity", o ? 0.7 : 1), a("marker.size"), i.noAngle || (a("marker.angle"), i.noAngleRef || a("marker.angleref"), i.noStandOff || a("marker.standoff")), a("marker.color", n), B5(e, "marker") && H5(e, t, r, a, { prefix: "marker.", cLetter: "c" }), i.noSelect || (a("selected.marker.color"), a("unselected.marker.color"), a("selected.marker.size"), a("unselected.marker.size")), i.noLine || (l && !Array.isArray(l) && t.marker.color !== l ? s = l : o ? s = N5.background : s = N5.defaultLine, a("marker.line.color", s), B5(e, "marker.line") && H5(e, t, r, a, { prefix: "marker.line.", cLetter: "c" }), a("marker.line.width", o ? 1 : 0)), o && (a("marker.sizeref"), a("marker.sizemin"), a("marker.sizemode")), i.gradient) { var c = a("marker.gradient.type"); c !== "none" && a("marker.gradient.color"); } }, Ste = Ue.isArrayOrTypedArray, Cte = _i.hasColorscale, Lte = Xc, Ote = function(e, t, n, r, a, i) { i || (i = {}); var o = (e.marker || {}).color; if (o && o._inputArray && (o = o._inputArray), a("line.color", n), Cte(e, "line")) Lte(e, t, r, a, { prefix: "line.", cLetter: "c" }); else { var l = (Ste(o) ? !1 : o) || n; a("line.color", l); } a("line.width"), i.noDash || a("line.dash"), i.backoff && a("line.backoff"); }, Dte = function(e, t, n) { var r = n("line.shape"); r === "spline" && n("line.smoothing"); }, Fte = Ue, Ite = function(e, t, n, r, a) { a = a || {}, r("textposition"), Fte.coerceFont(r, "textfont", a.font || n.font), a.noSelect || (r("selected.textfont.color"), r("unselected.textfont.color")); }, zte = rn, V5 = Ue.isArrayOrTypedArray, Ete = function(e, t, n, r) { var a = !1; if (t.marker) { var i = t.marker.color, o = (t.marker.line || {}).color; i && !V5(i) ? a = i : o && !V5(o) && (a = o); } r("fillcolor", zte.addOpacity( (t.line || {}).color || a || n, 0.5 )); }, q5 = Ue, jte = Rt, Pte = ws, Rte = Kx, Hs = $a, Nte = E8, Bte = nb, Hte = Tte, Vte = Mte, qte = Ote, U5 = Dte, Ute = Ite, Gte = Ete, Wte = Ue.coercePattern, Zte = function(e, t, n, r) { function a(h, g) { return q5.coerce(e, t, Pte, h, g); } var i = Nte(e, t, r, a); if (i || (t.visible = !1), !!t.visible) { Bte(e, t, r, a), a("xhoverformat"), a("yhoverformat"); var o = Hte(e, t, r, a); r.scattermode === "group" && t.orientation === void 0 && a("orientation", "v"); var l = !o && i < Rte.PTS_LINESONLY ? "lines+markers" : "lines"; a("text"), a("hovertext"), a("mode", l), Hs.hasMarkers(t) && Vte(e, t, n, r, a, { gradient: !0 }), Hs.hasLines(t) && (qte(e, t, n, r, a, { backoff: !0 }), U5(e, t, a), a("connectgaps"), a("line.simplify")), Hs.hasText(t) && (a("texttemplate"), Ute(e, t, r, a)); var s = []; (Hs.hasMarkers(t) || Hs.hasText(t)) && (a("cliponaxis"), a("marker.maxdisplayed"), s.push("points")), a("fill", o ? o.fillDflt : "none"), t.fill !== "none" && (Gte(e, t, n, a), Hs.hasLines(t) || U5(e, t, a), Wte(a, "fillpattern", t.fillcolor, !1)); var c = (t.line || {}).color, u = (t.marker || {}).color; (t.fill === "tonext" || t.fill === "toself") && s.push("fills"), a("hoveron", s.join("+") || "points"), t.hoveron !== "fills" && a("hovertemplate"); var f = jte.getComponentMethod("errorbars", "supplyDefaults"); f(e, t, c || u || n, { axis: "y" }), f(e, t, c || u || n, { axis: "x", inherit: "y" }), q5.coerceSelectionMarkerOpacity(t, a); } }, Yte = _l.getAxisGroup, j8 = function(e, t, n, r) { var a = t.orientation, i = t[{ v: "x", h: "y" }[a] + "axis"], o = Yte(n, i) + a, l = n._alignmentOpts || {}, s = r("alignmentgroup"), c = l[o]; c || (c = l[o] = {}); var u = c[s]; u ? u.traces.push(t) : u = c[s] = { traces: [t], alignmentIndex: Object.keys(c).length, offsetGroups: {} }; var f = r("offsetgroup"), h = u.offsetGroups, g = h[f]; f && (g || (g = h[f] = { offsetIndex: Object.keys(h).length }), t._offsetIndex = g.offsetIndex); }, $te = Ue, Kte = j8, Jte = ws, Qte = function(e, t) { var n, r, a; function i(u) { return $te.coerce(r._input, r, Jte, u); } if (t.scattermode === "group") for (a = 0; a < e.length; a++) r = e[a], r.type === "scatter" && (n = r._input, Kte(n, r, t, i)); for (a = 0; a < e.length; a++) { var o = e[a]; if (o.type === "scatter") { var l = o.fill; if (!(l === "none" || l === "toself") && (o.opacity = void 0, l === "tonexty" || l === "tonextx")) for (var s = a - 1; s >= 0; s--) { var c = e[s]; if (c.type === "scatter" && c.xaxis === o.xaxis && c.yaxis === o.yaxis) { c.opacity = void 0; break; } } } } }, Xte = Ue, ene = ix, tne = function(e, t) { function n(a, i) { return Xte.coerce(e, t, ene, a, i); } var r = t.barmode === "group"; t.scattermode === "group" && n("scattergap", r ? t.bargap : 0.2); }, nne = cn, P8 = Ue, rne = P8.dateTime2ms, vh = P8.incrementMonth, ane = er, ine = ane.ONEAVGMONTH, Z0 = function(e, t, n, r) { if (t.type !== "date") return { vals: r }; var a = e[n + "periodalignment"]; if (!a) return { vals: r }; var i = e[n + "period"], o; if (nne(i)) { if (i = +i, i <= 0) return { vals: r }; } else if (typeof i == "string" && i.charAt(0) === "M") { var l = +i.substring(1); if (l > 0 && Math.round(l) === l) o = l; else return { vals: r }; } for (var s = t.calendar, c = a === "start", u = a === "end", f = e[n + "period0"], h = rne(f, s) || 0, g = [], p = [], v = [], y = r.length, m = 0; m < y; m++) { var b = r[m], w, _, k; if (o) { for (w = Math.round((b - h) / (o * ine)), k = vh(h, o * w, s); k > b; ) k = vh(k, -o, s); for (; k <= b; ) k = vh(k, o, s); _ = vh(k, -o, s); } else { for (w = Math.round((b - h) / i), k = h + w * i; k > b; ) k -= i; for (; k <= b; ) k += i; _ = k - i; } g[m] = c ? _ : u ? k : (_ + k) / 2, p[m] = _, v[m] = k; } return { vals: g, starts: p, ends: v }; }, Uv = _i.hasColorscale, Gv = M0, G5 = $a, one = function(e, t) { G5.hasLines(t) && Uv(t, "line") && Gv(e, t, { vals: t.line.color, containerStr: "line", cLetter: "c" }), G5.hasMarkers(t) && (Uv(t, "marker") && Gv(e, t, { vals: t.marker.color, containerStr: "marker", cLetter: "c" }), Uv(t, "marker.line") && Gv(e, t, { vals: t.marker.line.color, containerStr: "marker.line", cLetter: "c" })); }, Mr = Ue, R8 = function(e, t) { for (var n = 0; n < e.length; n++) e[n].i = n; Mr.mergeArray(t.text, e, "tx"), Mr.mergeArray(t.texttemplate, e, "txt"), Mr.mergeArray(t.hovertext, e, "htx"), Mr.mergeArray(t.customdata, e, "data"), Mr.mergeArray(t.textposition, e, "tp"), t.textfont && (Mr.mergeArrayCastPositive(t.textfont.size, e, "ts"), Mr.mergeArray(t.textfont.color, e, "tc"), Mr.mergeArray(t.textfont.family, e, "tf")); var r = t.marker; if (r) { Mr.mergeArrayCastPositive(r.size, e, "ms"), Mr.mergeArrayCastPositive(r.opacity, e, "mo"), Mr.mergeArray(r.symbol, e, "mx"), Mr.mergeArray(r.angle, e, "ma"), Mr.mergeArray(r.standoff, e, "mf"), Mr.mergeArray(r.color, e, "mc"); var a = r.line; r.line && (Mr.mergeArray(a.color, e, "mlc"), Mr.mergeArrayCastPositive(a.width, e, "mlw")); var i = r.gradient; i && i.type !== "none" && (Mr.mergeArray(i.type, e, "mgt"), Mr.mergeArray(i.color, e, "mgc")); } }, W5 = Ue, N8 = function(e, t) { W5.isArrayOrTypedArray(t.selectedpoints) && W5.tagSelected(e, t); }, Z5 = cn, By = Ue, Dd = Ln, Y5 = Z0, Wv = er.BADNUM, Hy = $a, lne = one, sne = R8, cne = N8; function une(e, t) { var n = e._fullLayout, r = t._xA = Dd.getFromId(e, t.xaxis || "x", "x"), a = t._yA = Dd.getFromId(e, t.yaxis || "y", "y"), i = r.makeCalcdata(t, "x"), o = a.makeCalcdata(t, "y"), l = Y5(t, r, "x", i), s = Y5(t, a, "y", o), c = l.vals, u = s.vals, f = t._length, h = new Array(f), g = t.ids, p = rb(t, n, r, a), v = !1, y, m, b, w, _, k; V8(n, t); var T = "x", O = "y", M; if (p) By.pushUnique(p.traceIndices, t._expandedIndex), y = p.orientation === "v", y ? (O = "s", M = "x") : (T = "s", M = "y"), _ = p.stackgaps === "interpolate"; else { var C = H8(t, f); B8(e, t, r, a, c, u, C); } var I = !!t.xperiodalignment, j = !!t.yperiodalignment; for (m = 0; m < f; m++) { var P = h[m] = {}, N = Z5(c[m]), W = Z5(u[m]); N && W ? (P[T] = c[m], P[O] = u[m], I && (P.orig_x = i[m], P.xEnd = l.ends[m], P.xStart = l.starts[m]), j && (P.orig_y = o[m], P.yEnd = s.ends[m], P.yStart = s.starts[m])) : p && (y ? N : W) ? (P[M] = y ? c[m] : u[m], P.gap = !0, _ ? (P.s = Wv, v = !0) : P.s = 0) : P[T] = P[O] = Wv, g && (P.id = String(g[m])); } if (sne(h, t), lne(e, t), cne(h, t), p) { for (m = 0; m < h.length; ) h[m][M] === Wv ? h.splice(m, 1) : m++; if (By.sort(h, function(z, F) { return z[M] - F[M] || z.i - F.i; }), v) { for (m = 0; m < h.length - 1 && h[m].gap; ) m++; for (k = h[m].s, k || (k = h[m].s = 0), b = 0; b < m; b++) h[b].s = k; for (w = h.length - 1; w > m && h[w].gap; ) w--; for (k = h[w].s, b = h.length - 1; b > w; b--) h[b].s = k; for (; m < w; ) if (m++, h[m].gap) { for (b = m + 1; h[b].gap; ) b++; for (var J = h[m - 1][M], U = h[m - 1].s, E = (h[b].s - U) / (h[b][M] - J); m < b; ) h[m].s = U + (h[m][M] - J) * E, m++; } } } return h; } function B8(e, t, n, r, a, i, o) { var l = t._length, s = e._fullLayout, c = n._id, u = r._id, f = s._firstScatter[q8(t)] === t.uid, h = (rb(t, s, n, r) || {}).orientation, g = t.fill; n._minDtick = 0, r._minDtick = 0; var p = { padded: !0 }, v = { padded: !0 }; o && (p.ppad = v.ppad = o); var y = l < 2 || a[0] !== a[l - 1] || i[0] !== i[l - 1]; y && (g === "tozerox" || g === "tonextx" && (f || h === "h")) ? p.tozero = !0 : !(t.error_y || {}).visible && // if no error bars, markers or text, or fill to y=0 remove x padding (g === "tonexty" || g === "tozeroy" || !Hy.hasMarkers(t) && !Hy.hasText(t)) && (p.padded = !1, p.ppad = 0), y && (g === "tozeroy" || g === "tonexty" && (f || h === "v")) ? v.tozero = !0 : (g === "tonextx" || g === "tozerox") && (v.padded = !1), c && (t._extremes[c] = Dd.findExtremes(n, a, p)), u && (t._extremes[u] = Dd.findExtremes(r, i, v)); } function H8(e, t) { if (Hy.hasMarkers(e)) { var n = e.marker, r = 1.6 * (e.marker.sizeref || 1), a; if (e.marker.sizemode === "area" ? a = function(c) { return Math.max(Math.sqrt((c || 0) / r), 3); } : a = function(c) { return Math.max((c || 0) / r, 3); }, By.isArrayOrTypedArray(n.size)) { var i = { type: "linear" }; Dd.setConvert(i); for (var o = i.makeCalcdata(e.marker, "size"), l = new Array(t), s = 0; s < t; s++) l[s] = a(o[s]); return l; } else return a(n.size); } } function V8(e, t) { var n = q8(t), r = e._firstScatter; r[n] || (r[n] = t.uid); } function q8(e) { var t = e.stackgroup; return e.xaxis + e.yaxis + e.type + (t ? "-" + t : ""); } function rb(e, t, n, r) { var a = e.stackgroup; if (a) { var i = t._scatterStackOpts[n._id + r._id][a], o = i.orientation === "v" ? r : n; if (o.type === "linear" || o.type === "log") return i; } } var U8 = { calc: une, calcMarkerSize: H8, calcAxisExpansion: B8, setFirstScatter: V8, getStackOpts: rb }, dne = Y0, fne = Ue.distinctVals; function Y0(e, t) { this.traces = e, this.sepNegVal = t.sepNegVal, this.overlapNoMerge = t.overlapNoMerge; for (var n = 1 / 0, r = t.posAxis._id.charAt(0), a = [], i = 0; i < e.length; i++) { for (var o = e[i], l = 0; l < o.length; l++) { var s = o[l], c = s.p; c === void 0 && (c = s[r]), c !== void 0 && a.push(c); } o[0] && o[0].width1 && (n = Math.min(o[0].width1, n)); } this.positions = a; var u = fne(a); this.distinctPositions = u.vals, u.vals.length === 1 && n !== 1 / 0 ? this.minDiff = n : this.minDiff = Math.min(u.minDiff, n); var f = (t.posAxis || {}).type; (f === "category" || f === "multicategory") && (this.minDiff = 1), this.binWidth = this.minDiff, this.bins = {}; } Y0.prototype.put = function(e, t) { var n = this.getLabel(e, t), r = this.bins[n] || 0; return this.bins[n] = r + t, r; }; Y0.prototype.get = function(e, t) { var n = this.getLabel(e, t); return this.bins[n] || 0; }; Y0.prototype.getLabel = function(e, t) { var n = t < 0 && this.sepNegVal ? "v" : "^", r = this.overlapNoMerge ? e : Math.round(e / this.binWidth); return n + r; }; var dl = cn, fl = Ue.isArrayOrTypedArray, zc = er.BADNUM, hne = Rt, Fd = Ln, pne = _l.getAxisGroup, $0 = dne; function gne(e, t) { for (var n = t.xaxis, r = t.yaxis, a = e._fullLayout, i = e._fullData, o = e.calcdata, l = [], s = [], c = 0; c < i.length; c++) { var u = i[c]; if (u.visible === !0 && hne.traceIs(u, "bar") && u.xaxis === n._id && u.yaxis === r._id && (u.orientation === "h" ? l.push(o[c]) : s.push(o[c]), u._computePh)) for (var f = e.calcdata[c], h = 0; h < f.length; h++) typeof f[h].ph0 == "function" && (f[h].ph0 = f[h].ph0()), typeof f[h].ph1 == "function" && (f[h].ph1 = f[h].ph1()); } var g = { xCat: n.type === "category" || n.type === "multicategory", yCat: r.type === "category" || r.type === "multicategory", mode: a.barmode, norm: a.barnorm, gap: a.bargap, groupgap: a.bargroupgap }; Vy(e, n, r, s, g), Vy(e, r, n, l, g); } function Vy(e, t, n, r, a) { if (r.length) { var i, o, l, s, c; switch (vne(n, r), a.mode) { case "overlay": Zv(t, n, r, a); break; case "group": for (i = [], o = [], l = 0; l < r.length; l++) s = r[l], c = s[0].trace, c.offset === void 0 ? o.push(s) : i.push(s); o.length && mne(e, t, n, o, a), i.length && Zv(t, n, i, a); break; case "stack": case "relative": for (i = [], o = [], l = 0; l < r.length; l++) s = r[l], c = s[0].trace, c.base === void 0 ? o.push(s) : i.push(s); o.length && yne(e, t, n, o, a), i.length && Zv(t, n, i, a); break; } _ne(r, t); } } function vne(e, t) { var n, r; for (n = 0; n < t.length; n++) { var a = t[n], i = a[0].trace, o = i.type === "funnel" ? i._base : i.base, l, s = i.orientation === "h" ? i.xcalendar : i.ycalendar, c = e.type === "category" || e.type === "multicategory" ? function() { return null; } : e.d2c; if (fl(o)) { for (r = 0; r < Math.min(o.length, a.length); r++) l = c(o[r], 0, s), dl(l) ? (a[r].b = +l, a[r].hasB = 1) : a[r].b = 0; for (; r < a.length; r++) a[r].b = 0; } else { l = c(o, 0, s); var u = dl(l); for (l = u ? l : 0, r = 0; r < a.length; r++) a[r].b = l, u && (a[r].hasB = 1); } } } function Zv(e, t, n, r) { for (var a = 0; a < n.length; a++) { var i = n[a], o = new $0([i], { posAxis: e, sepNegVal: !1, overlapNoMerge: !r.norm }); G8(e, o, r), r.norm ? (K8(o), ab(t, o, r)) : $8(t, o); } } function mne(e, t, n, r, a) { var i = new $0(r, { posAxis: t, sepNegVal: !1, overlapNoMerge: !a.norm }); xne(e, t, i, a), wne(i, t), a.norm ? (K8(i), ab(n, i, a)) : $8(n, i); } function yne(e, t, n, r, a) { var i = new $0(r, { posAxis: t, sepNegVal: a.mode === "relative", overlapNoMerge: !(a.norm || a.mode === "stack" || a.mode === "relative") }); G8(t, i, a), bne(n, i, a); for (var o = 0; o < r.length; o++) for (var l = r[o], s = 0; s < l.length; s++) { var c = l[s]; if (c.s !== zc) { var u = c.b + c.s === i.get(c.p, c.s); u && (c._outmost = !0); } } a.norm && ab(n, i, a); } function G8(e, t, n) { for (var r = t.minDiff, a = t.traces, i = r * (1 - n.gap), o = i, l = o * (1 - (n.groupgap || 0)), s = -l / 2, c = 0; c < a.length; c++) { var u = a[c], f = u[0].t; f.barwidth = l, f.poffset = s, f.bargroupwidth = i, f.bardelta = r; } t.binWidth = a[0][0].t.barwidth / 100, W8(t), Z8(e, t), Y8(e, t); } function xne(e, t, n, r) { for (var a = e._fullLayout, i = n.positions, o = n.distinctPositions, l = n.minDiff, s = n.traces, c = s.length, u = i.length !== o.length, f = l * (1 - r.gap), h = pne(a, t._id) + s[0][0].trace.orientation, g = a._alignmentOpts[h] || {}, p = 0; p < c; p++) { var v = s[p], y = v[0].trace, m = g[y.alignmentgroup] || {}, b = Object.keys(m.offsetGroups || {}).length, w; b ? w = f / b : w = u ? f / c : f; var _ = w * (1 - (r.groupgap || 0)), k; b ? k = ((2 * y._offsetIndex + 1 - b) * w - _) / 2 : k = u ? ((2 * p + 1 - c) * w - _) / 2 : -_ / 2; var T = v[0].t; T.barwidth = _, T.poffset = k, T.bargroupwidth = f, T.bardelta = l; } n.binWidth = s[0][0].t.barwidth / 100, W8(n), Z8(t, n), Y8(t, n, u); } function W8(e) { var t = e.traces, n, r; for (n = 0; n < t.length; n++) { var a = t[n], i = a[0], o = i.trace, l = i.t, s = o._offset || o.offset, c = l.poffset, u; if (fl(s)) { for (u = Array.prototype.slice.call(s, 0, a.length), r = 0; r < u.length; r++) dl(u[r]) || (u[r] = c); for (r = u.length; r < a.length; r++) u.push(c); l.poffset = u; } else s !== void 0 && (l.poffset = s); var f = o._width || o.width, h = l.barwidth; if (fl(f)) { var g = Array.prototype.slice.call(f, 0, a.length); for (r = 0; r < g.length; r++) dl(g[r]) || (g[r] = h); for (r = g.length; r < a.length; r++) g.push(h); if (l.barwidth = g, s === void 0) { for (u = [], r = 0; r < a.length; r++) u.push( c + (h - g[r]) / 2 ); l.poffset = u; } } else f !== void 0 && (l.barwidth = f, s === void 0 && (l.poffset = c + (h - f) / 2)); } } function Z8(e, t) { for (var n = t.traces, r = rf(e), a = 0; a < n.length; a++) for (var i = n[a], o = i[0].t, l = o.poffset, s = fl(l), c = o.barwidth, u = fl(c), f = 0; f < i.length; f++) { var h = i[f], g = h.w = u ? c[f] : c; h.p === void 0 && (h.p = h[r], h["orig_" + r] = h[r]); var p = (s ? l[f] : l) + g / 2; h[r] = h.p + p; } } function Y8(e, t, n) { var r = t.traces, a = t.minDiff, i = a / 2; Fd.minDtick(e, t.minDiff, t.distinctPositions[0], n); for (var o = 0; o < r.length; o++) { var l = r[o], s = l[0], c = s.trace, u = [], f, h, g, p; for (p = 0; p < l.length; p++) f = l[p], h = f.p - i, g = f.p + i, u.push(h, g); if (c.width || c.offset) { var v = s.t, y = v.poffset, m = v.barwidth, b = fl(y), w = fl(m); for (p = 0; p < l.length; p++) { f = l[p]; var _ = b ? y[p] : y, k = w ? m[p] : m; h = f.p + _, g = h + k, u.push(h, g); } } c._extremes[e._id] = Fd.findExtremes(e, u, { padded: !1 }); } } function $8(e, t) { for (var n = t.traces, r = rf(e), a = 0; a < n.length; a++) { for (var i = n[a], o = i[0].trace, l = o.type === "scatter", s = o.orientation === "v", c = [], u = !1, f = 0; f < i.length; f++) { var h = i[f], g = l ? 0 : h.b, p = l ? s ? h.y : h.x : g + h.s; h[r] = p, c.push(p), h.hasB && c.push(g), (!h.hasB || !h.b) && (u = !0); } o._extremes[e._id] = Fd.findExtremes(e, c, { tozero: u, padded: !0 }); } } function bne(e, t, n) { var r = rf(e), a = t.traces, i, o, l, s, c, u; for (s = 0; s < a.length; s++) if (i = a[s], o = i[0].trace, o.type === "funnel") for (c = 0; c < i.length; c++) u = i[c], u.s !== zc && t.put(u.p, -0.5 * u.s); for (s = 0; s < a.length; s++) { i = a[s], o = i[0].trace, l = o.type === "funnel"; var f = []; for (c = 0; c < i.length; c++) if (u = i[c], u.s !== zc) { var h; l ? h = u.s : h = u.s + u.b; var g = t.put(u.p, h), p = g + h; u.b = g, u[r] = p, n.norm || (f.push(p), u.hasB && f.push(g)); } n.norm || (o._extremes[e._id] = Fd.findExtremes(e, f, { // N.B. we don't stack base with 'base', // so set tozero:true always! tozero: !0, padded: !0 })); } } function K8(e) { for (var t = e.traces, n = 0; n < t.length; n++) for (var r = t[n], a = 0; a < r.length; a++) { var i = r[a]; i.s !== zc && e.put(i.p, i.b + i.s); } } function wne(e, t) { for (var n = e.traces, r = 0; r < n.length; r++) { var a = n[r], i = a[0].trace; if (i.base === void 0) for (var o = new $0([a], { posAxis: t, sepNegVal: !0, overlapNoMerge: !0 }), l = 0; l < a.length; l++) { var s = a[l]; if (s.p !== zc) { var c = o.put(s.p, s.b + s.s); c && (s.b = c); } } } } function ab(e, t, n) { var r = t.traces, a = rf(e), i = n.norm === "fraction" ? 1 : 100, o = i / 1e9, l = e.l2c(e.c2l(0)), s = n.mode === "stack" ? i : l; function c(k) { return dl(e.c2l(k)) && (k < l - o || k > s + o || !dl(l)); } for (var u = 0; u < r.length; u++) { for (var f = r[u], h = f[0].trace, g = [], p = !1, v = !1, y = 0; y < f.length; y++) { var m = f[y]; if (m.s !== zc) { var b = Math.abs(i / t.get(m.p, m.s)); m.b *= b, m.s *= b; var w = m.b, _ = w + m.s; m[a] = _, g.push(_), v = v || c(_), m.hasB && (g.push(w), v = v || c(w)), (!m.hasB || !m.b) && (p = !0); } } h._extremes[e._id] = Fd.findExtremes(e, g, { tozero: p, padded: v }); } } function _ne(e, t) { var n = rf(t), r = {}, a, i, o, l = 1 / 0, s = -1 / 0; for (a = 0; a < e.length; a++) for (o = e[a], i = 0; i < o.length; i++) { var c = o[i].p; dl(c) && (l = Math.min(l, c), s = Math.max(s, c)); } var u = 1e4 / (s - l), f = r.round = function(b) { return String(Math.round(u * (b - l))); }; for (a = 0; a < e.length; a++) { o = e[a], o[0].t.extents = r; var h = o[0].t.poffset, g = fl(h); for (i = 0; i < o.length; i++) { var p = o[i], v = p[n] - p.w / 2; if (dl(v)) { var y = p[n] + p.w / 2, m = f(p.p); r[m] ? r[m] = [Math.min(v, r[m][0]), Math.max(y, r[m][1])] : r[m] = [v, y]; } p.p0 = p.p + (g ? h[i] : h), p.p1 = p.p0 + p.w, p.s0 = p.b, p.s1 = p.s0 + p.s; } } } function rf(e) { return e._id.charAt(0); } var J8 = { crossTraceCalc: gne, setGroupPositions: Vy }, $5 = U8, K5 = J8.setGroupPositions; function kne(e, t) { for (var n = t.xaxis, r = t.yaxis, a = e._fullLayout, i = e._fullData, o = e.calcdata, l = [], s = [], c = 0; c < i.length; c++) { var u = i[c]; u.visible === !0 && u.type === "scatter" && u.xaxis === n._id && u.yaxis === r._id && (u.orientation === "h" ? l.push(o[c]) : u.orientation === "v" && s.push(o[c])); } var f = { mode: a.scattermode, gap: a.scattergap }; K5(e, n, r, s, f), K5(e, r, n, l, f); } var Tne = function(e, t) { e._fullLayout.scattermode === "group" && kne(e, t); var n = t.xaxis, r = t.yaxis, a = n._id + r._id, i = e._fullLayout._scatterStackOpts[a]; if (i) { var o = e.calcdata, l, s, c, u, f, h, g, p, v, y, m, b, w, _, k; for (var T in i) { y = i[T]; var O = y.traceIndices; if (O.length) { for (m = y.stackgaps === "interpolate", b = y.groupnorm, y.orientation === "v" ? (w = "x", _ = "y") : (w = "y", _ = "x"), k = new Array(O.length), l = 0; l < k.length; l++) k[l] = !1; h = o[O[0]]; var M = new Array(h.length); for (l = 0; l < h.length; l++) M[l] = h[l][w]; for (l = 1; l < O.length; l++) { for (f = o[O[l]], s = c = 0; s < f.length; s++) { for (g = f[s][w]; g > M[c] && c < M.length; c++) Yv(f, s, M[c], l, k, m, w), s++; if (g !== M[c]) { for (u = 0; u < l; u++) Yv(o[O[u]], c, g, u, k, m, w); M.splice(c, 0, g); } c++; } for (; c < M.length; c++) Yv(f, s, M[c], l, k, m, w), s++; } var C = M.length; for (s = 0; s < h.length; s++) { for (p = h[s][_] = h[s].s, l = 1; l < O.length; l++) f = o[O[l]], f[0].trace._rawLength = f[0].trace._length, f[0].trace._length = C, p += f[s].s, f[s][_] = p; if (b) for (v = (b === "fraction" ? p : p / 100) || 1, l = 0; l < O.length; l++) { var I = o[O[l]][s]; I[_] /= v, I.sNorm = I.s / v; } } for (l = 0; l < O.length; l++) { f = o[O[l]]; var j = f[0].trace, P = $5.calcMarkerSize(j, j._rawLength), N = Array.isArray(P); if (P && k[l] || N) { var W = P; for (P = new Array(C), s = 0; s < C; s++) P[s] = f[s].gap ? 0 : N ? W[f[s].i] : W; } var J = new Array(C), U = new Array(C); for (s = 0; s < C; s++) J[s] = f[s].x, U[s] = f[s].y; $5.calcAxisExpansion(e, j, n, r, J, U, P), f[0].t.orientation = y.orientation; } } } } }; function Yv(e, t, n, r, a, i, o) { a[r] = !0; var l = { i: null, gap: !0, s: 0 }; if (l[o] = n, e.splice(t, 0, l), t && n === e[t - 1][o]) { var s = e[t - 1]; l.s = s.s, l.i = s.i, l.gap = s.gap; } else i && (l.s = Ane(e, t, n, o)); t || (e[0].t = e[1].t, e[0].trace = e[1].trace, delete e[1].t, delete e[1].trace); } function Ane(e, t, n, r) { var a = e[t - 1], i = e[t + 1]; return i ? a ? a.s + (i.s - a.s) * (n - a[r]) / (i[r] - a[r]) : i.s : a.s; } var Mne = Cn, Q8 = er, Bu = Q8.BADNUM, X8 = Q8.LOG_CLIP, J5 = X8 + 0.5, Q5 = X8 - 0.5, Cp = Ue, Sne = Cp.segmentsIntersect, X5 = Cp.constrain, $v = Kx, Cne = function(e, t) { var n = t.trace || {}, r = t.xaxis, a = t.yaxis, i = r.type === "log", o = a.type === "log", l = r._length, s = a._length, c = t.backoff, u = n.marker, f = t.connectGaps, h = t.baseTolerance, g = t.shape, p = g === "linear", v = n.fill && n.fill !== "none", y = [], m = $v.minTolerance, b = e.length, w = new Array(b), _ = 0, k, T, O, M, C, I, j, P, N, W, J, U, E, z, F, q; function H(je) { var tt = e[je]; if (!tt) return !1; var pt = t.linearized ? r.l2p(tt.x) : r.c2p(tt.x), kt = t.linearized ? a.l2p(tt.y) : a.c2p(tt.y); if (pt === Bu) { if (i && (pt = r.c2p(tt.x, !0)), pt === Bu) return !1; o && kt === Bu && (pt *= Math.abs(r._m * s * (r._m > 0 ? J5 : Q5) / (a._m * l * (a._m > 0 ? J5 : Q5)))), pt *= 1e3; } if (kt === Bu) { if (o && (kt = a.c2p(tt.y, !0)), kt === Bu) return !1; kt *= 1e3; } return [pt, kt]; } function K(je, tt, pt, kt) { var et = pt - je, ft = kt - tt, $e = 0.5 - je, Lt = 0.5 - tt, $ = et * et + ft * ft, se = et * $e + ft * Lt; if (se > 0 && se < $) { var ie = $e * ft - Lt * et; if (ie * ie < $) return !0; } } var Q, re; function te(je, tt) { var pt = je[0] / l, kt = je[1] / s, et = Math.max(0, -pt, pt - 1, -kt, kt - 1); return et && Q !== void 0 && K(pt, kt, Q, re) && (et = 0), et && tt && K(pt, kt, tt[0] / l, tt[1] / s) && (et = 0), (1 + $v.toleranceGrowth * et) * h; } function X(je, tt) { var pt = je[0] - tt[0], kt = je[1] - tt[1]; return Math.sqrt(pt * pt + kt * kt); } var ce = $v.maxScreensAway, B = -l * ce, G = l * (1 + ce), Z = -s * ce, oe = s * (1 + ce), ae = [ [B, Z, G, Z], [G, Z, G, oe], [G, oe, B, oe], [B, oe, B, Z] ], ge, ve, pe, ye, Oe, Be; function Ie(je, tt) { for (var pt = [], kt = 0, et = 0; et < 4; et++) { var ft = ae[et], $e = Sne( je[0], je[1], tt[0], tt[1], ft[0], ft[1], ft[2], ft[3] ); $e && (!kt || Math.abs($e.x - pt[0][0]) > 1 || Math.abs($e.y - pt[0][1]) > 1) && ($e = [$e.x, $e.y], kt && X($e, je) < X(pt[0], je) ? pt.unshift($e) : pt.push($e), kt++); } return pt; } function Fe(je) { if (je[0] < B || je[0] > G || je[1] < Z || je[1] > oe) return [X5(je[0], B, G), X5(je[1], Z, oe)]; } function Re(je, tt) { if (je[0] === tt[0] && (je[0] === B || je[0] === G) || je[1] === tt[1] && (je[1] === Z || je[1] === oe)) return !0; } function We(je, tt) { var pt = [], kt = Fe(je), et = Fe(tt); return kt && et && Re(kt, et) || (kt && pt.push(kt), et && pt.push(et)), pt; } function Ce(je, tt, pt) { return function(kt, et) { var ft = Fe(kt), $e = Fe(et), Lt = []; if (ft && $e && Re(ft, $e)) return Lt; ft && Lt.push(ft), $e && Lt.push($e); var $ = 2 * Cp.constrain((kt[je] + et[je]) / 2, tt, pt) - ((ft || kt)[je] + ($e || et)[je]); if ($) { var se; ft && $e ? se = $ > 0 == ft[je] > $e[je] ? ft : $e : se = ft || $e, se[je] += $; } return Lt; }; } var Ve; g === "linear" || g === "spline" ? Ve = Ie : g === "hv" || g === "vh" ? Ve = We : g === "hvh" ? Ve = Ce(0, B, G) : g === "vhv" && (Ve = Ce(1, Z, oe)); function Ke(je, tt) { var pt = tt[0] - je[0], kt = (tt[1] - je[1]) / pt, et = (je[1] * tt[0] - tt[1] * je[0]) / pt; return et > 0 ? [kt > 0 ? B : G, oe] : [kt > 0 ? G : B, Z]; } function Xe(je) { var tt = je[0], pt = je[1], kt = tt === w[_ - 1][0], et = pt === w[_ - 1][1]; if (!(kt && et)) if (_ > 1) { var ft = tt === w[_ - 2][0], $e = pt === w[_ - 2][1]; kt && (tt === B || tt === G) && ft ? $e ? _-- : w[_ - 1] = je : et && (pt === Z || pt === oe) && $e ? ft ? _-- : w[_ - 1] = je : w[_++] = je; } else w[_++] = je; } function ct(je) { w[_ - 1][0] !== je[0] && w[_ - 1][1] !== je[1] && Xe([pe, ye]), Xe(je), Oe = null, pe = ye = 0; } var vt = Cp.isArrayOrTypedArray(u); function lt(je) { if (je && c && (je.i = k, je.d = e, je.trace = n, je.marker = vt ? u[je.i] : u, je.backoff = c), Q = je[0] / l, re = je[1] / s, ge = je[0] < B ? B : je[0] > G ? G : 0, ve = je[1] < Z ? Z : je[1] > oe ? oe : 0, ge || ve) { if (!_) w[_++] = [ge || je[0], ve || je[1]]; else if (Oe) { var tt = Ve(Oe, je); tt.length > 1 && (ct(tt[0]), w[_++] = tt[1]); } else Be = Ve(w[_ - 1], je)[0], w[_++] = Be; var pt = w[_ - 1]; ge && ve && (pt[0] !== ge || pt[1] !== ve) ? (Oe && (pe !== ge && ye !== ve ? Xe(pe && ye ? Ke(Oe, je) : [pe || ge, ye || ve]) : pe && ye && Xe([pe, ye])), Xe([ge, ve])) : pe - ge && ye - ve && Xe([ge || pe, ve || ye]), Oe = je, pe = ge, ye = ve; } else Oe && ct(Ve(Oe, je)[0]), w[_++] = je; } for (k = 0; k < b; k++) if (T = H(k), !!T) { for (_ = 0, Oe = null, lt(T), k++; k < b; k++) { if (M = H(k), !M) { if (f) continue; break; } if (!p || !t.simplify) { lt(M); continue; } var ut = H(k + 1); if (W = X(M, T), !(!(v && (_ === 0 || _ === b - 1)) && W < te(M, ut) * m)) { for (P = [ (M[0] - T[0]) / W, (M[1] - T[1]) / W ], C = T, J = W, U = z = F = 0, j = !1, O = M, k++; k < e.length; k++) { if (I = ut, ut = H(k + 1), !I) { if (f) continue; break; } if (N = [ I[0] - T[0], I[1] - T[1] ], q = N[0] * P[1] - N[1] * P[0], z = Math.min(z, q), F = Math.max(F, q), F - z > te(I, ut)) break; O = I, E = N[0] * P[0] + N[1] * P[1], E > J ? (J = E, M = I, j = !1) : E < U && (U = E, C = I, j = !0); } if (j ? (lt(M), O !== C && lt(C)) : (C !== T && lt(C), O !== M && lt(M)), lt(O), k >= e.length || !I) break; lt(I), T = I; } } Oe && Xe([pe || Oe[0], ye || Oe[1]]), y.push(w.slice(0, _)); } var dt = g.slice(g.length - 1); if (c && dt !== "h" && dt !== "v") { for (var Pe = !1, ze = -1, Ne = [], nt = 0; nt < y.length; nt++) for (var Qe = 0; Qe < y[nt].length - 1; Qe++) { var it = y[nt][Qe], rt = y[nt][Qe + 1], bt = Mne.applyBackoff(rt, it); (bt[0] !== rt[0] || bt[1] !== rt[1]) && (Pe = !0), Ne[ze + 1] || (ze++, Ne[ze] = [ it, [bt[0], bt[1]] ]); } return Pe ? Ne : y; } return y; }, eA = { tonextx: 1, tonexty: 1, tonext: 1 }, Lne = function(e, t, n) { var r, a, i, o, l, s = {}, c = !1, u = -1, f = 0, h = -1; for (a = 0; a < n.length; a++) r = n[a][0].trace, i = r.stackgroup || "", i ? i in s ? l = s[i] : (l = s[i] = f, f++) : r.fill in eA && h >= 0 ? l = h : (l = h = f, f++), l < u && (c = !0), r._groupIndex = u = l; var g = n.slice(); c && g.sort(function(v, y) { var m = v[0].trace, b = y[0].trace; return m._groupIndex - b._groupIndex || m.index - b.index; }); var p = {}; for (a = 0; a < g.length; a++) r = g[a][0].trace, i = r.stackgroup || "", r.visible === !0 ? (r._nexttrace = null, r.fill in eA && (o = p[i], r._prevtrace = o || null, o && (o._nexttrace = r)), r._ownfill = r.fill && (r.fill.substr(0, 6) === "tozero" || r.fill === "toself" || r.fill.substr(0, 2) === "to" && !r._prevtrace), p[i] = r) : r._prevtrace = r._nexttrace = r._ownfill = null; return g; }, si = sn, One = Rt, Id = Ue, hc = Id.ensureSingle, eO = Id.identity, Yn = Cn, pc = $a, Dne = Cne, Fne = Lne, Ine = X6.tester, zne = function(e, t, n, r, a, i) { var o, l, s = !a, c = !!a && a.duration > 0, u = Fne(e, t, n); if (o = r.selectAll("g.trace").data(u, function(h) { return h[0].trace.uid; }), o.enter().append("g").attr("class", function(h) { return "trace scatter trace" + h[0].trace.uid; }).style("stroke-miterlimit", 2), o.order(), Ene(e, o, t), c) { i && (l = i()); var f = si.transition().duration(a.duration).ease(a.easing).each("end", function() { l && l(); }).each("interrupt", function() { l && l(); }); f.each(function() { r.selectAll("g.trace").each(function(h, g) { tA(e, g, t, h, u, this, a); }); }); } else o.each(function(h, g) { tA(e, g, t, h, u, this, a); }); s && o.exit().remove(), r.selectAll("path:not([d])").remove(); }; function Ene(e, t, n) { t.each(function(r) { var a = hc(si.select(this), "g", "fills"); Yn.setClipUrl(a, n.layerClipId, e); var i = r[0].trace, o = []; i._ownfill && o.push("_ownFill"), i._nexttrace && o.push("_nextFill"); var l = a.selectAll("g").data(o, eO); l.enter().append("g"), l.exit().each(function(s) { i[s] = null; }).remove(), l.order().each(function(s) { i[s] = hc(si.select(this), "path", "js-fill"); }); }); } function tA(e, t, n, r, a, i, o) { var l = e._context.staticPlot, s; jne(e, t, n, r, a); var c = !!o && o.duration > 0; function u(ve) { return c ? ve.transition() : ve; } var f = n.xaxis, h = n.yaxis, g = r[0].trace, p = g.line, v = si.select(i), y = hc(v, "g", "errorbars"), m = hc(v, "g", "lines"), b = hc(v, "g", "points"), w = hc(v, "g", "text"); if (One.getComponentMethod("errorbars", "plot")(e, y, n, o), g.visible !== !0) return; u(v).style("opacity", g.opacity); var _, k, T = g.fill.charAt(g.fill.length - 1); T !== "x" && T !== "y" && (T = ""), r[0][n.isRangePlot ? "nodeRangePlot3" : "node3"] = v; var O = "", M = [], C = g._prevtrace; C && (O = C._prevRevpath || "", k = C._nextFill, M = C._polygons); var I, j, P = "", N = "", W, J, U, E, z, F, q, H = [], K = Id.noop; if (_ = g._ownFill, pc.hasLines(g) || g.fill !== "none") { for (k && k.datum(r), ["hv", "vh", "hvh", "vhv"].indexOf(p.shape) !== -1 ? (W = Yn.steps(p.shape), J = Yn.steps( p.shape.split("").reverse().join("") )) : p.shape === "spline" ? W = J = function(ve) { var pe = ve[ve.length - 1]; return ve.length > 1 && ve[0][0] === pe[0] && ve[0][1] === pe[1] ? Yn.smoothclosed(ve.slice(1), p.smoothing) : Yn.smoothopen(ve, p.smoothing); } : W = J = function(ve) { return "M" + ve.join("L"); }, U = function(ve) { return J(ve.reverse()); }, H = Dne(r, { xaxis: f, yaxis: h, trace: g, connectGaps: g.connectgaps, baseTolerance: Math.max(p.width || 1, 3) / 4, shape: p.shape, backoff: p.backoff, simplify: p.simplify, fill: g.fill }), q = g._polygons = new Array(H.length), s = 0; s < H.length; s++) g._polygons[s] = Ine(H[s]); H.length && (E = H[0][0], z = H[H.length - 1], F = z[z.length - 1]), K = function(ve) { return function(pe) { if (I = W(pe), j = U(pe), P ? T ? (P += "L" + I.substr(1), N = j + ("L" + N.substr(1))) : (P += "Z" + I, N = j + "Z" + N) : (P = I, N = j), pc.hasLines(g)) { var ye = si.select(this); if (ye.datum(r), ve) u(ye.style("opacity", 0).attr("d", I).call(Yn.lineGroupStyle)).style("opacity", 1); else { var Oe = u(ye); Oe.attr("d", I), Yn.singleLineStyle(r, Oe); } } }; }; } var Q = m.selectAll(".js-line").data(H); u(Q.exit()).style("opacity", 0).remove(), Q.each(K(!1)), Q.enter().append("path").classed("js-line", !0).style("vector-effect", l ? "none" : "non-scaling-stroke").call(Yn.lineGroupStyle).each(K(!0)), Yn.setClipUrl(Q, n.layerClipId, e); function re(ve) { u(ve).attr("d", "M0,0Z"); } H.length ? (_ ? (_.datum(r), E && F && (T ? (T === "y" ? E[1] = F[1] = h.c2p(0, !0) : T === "x" && (E[0] = F[0] = f.c2p(0, !0)), u(_).attr("d", "M" + F + "L" + E + "L" + P.substr(1)).call(Yn.singleFillStyle, e)) : u(_).attr("d", P + "Z").call(Yn.singleFillStyle, e))) : k && (g.fill.substr(0, 6) === "tonext" && P && O ? (g.fill === "tonext" ? u(k).attr("d", P + "Z" + O + "Z").call(Yn.singleFillStyle, e) : u(k).attr("d", P + "L" + O.substr(1) + "Z").call(Yn.singleFillStyle, e), g._polygons = g._polygons.concat(M)) : (re(k), g._polygons = null)), g._prevRevpath = N, g._prevPolygons = q) : (_ ? re(_) : k && re(k), g._polygons = g._prevRevpath = g._prevPolygons = null); function te(ve) { return ve.filter(function(pe) { return !pe.gap && pe.vis; }); } function X(ve) { return ve.filter(function(pe) { return pe.vis; }); } function ce(ve) { return ve.filter(function(pe) { return !pe.gap; }); } function B(ve) { return ve.id; } function G(ve) { if (ve.ids) return B; } function Z() { return !1; } function oe(ve, pe, ye) { var Oe, Be, Ie, Fe = ye[0].trace, Re = pc.hasMarkers(Fe), We = pc.hasText(Fe), Ce = G(Fe), Ve = Z, Ke = Z; if (Re || We) { var Xe = eO, ct = Fe.stackgroup, vt = ct && e._fullLayout._scatterStackOpts[f._id + h._id][ct].stackgaps === "infer zero"; Fe.marker.maxdisplayed || Fe._needsCull ? Xe = vt ? X : te : ct && !vt && (Xe = ce), Re && (Ve = Xe), We && (Ke = Xe); } Be = ve.selectAll("path.point"), Oe = Be.data(Ve, Ce); var lt = Oe.enter().append("path").classed("point", !0); c && lt.call(Yn.pointStyle, Fe, e).call(Yn.translatePoints, f, h).style("opacity", 0).transition().style("opacity", 1), Oe.order(); var ut; Re && (ut = Yn.makePointStyleFns(Fe)), Oe.each(function(dt) { var Pe = si.select(this), ze = u(Pe); Ie = Yn.translatePoint(dt, ze, f, h), Ie ? (Yn.singlePointStyle(dt, ze, Fe, ut, e), n.layerClipId && Yn.hideOutsideRangePoint(dt, ze, f, h, Fe.xcalendar, Fe.ycalendar), Fe.customdata && Pe.classed("plotly-customdata", dt.data !== null && dt.data !== void 0)) : ze.remove(); }), c ? Oe.exit().transition().style("opacity", 0).remove() : Oe.exit().remove(), Be = pe.selectAll("g"), Oe = Be.data(Ke, Ce), Oe.enter().append("g").classed("textpoint", !0).append("text"), Oe.order(), Oe.each(function(dt) { var Pe = si.select(this), ze = u(Pe.select("text")); Ie = Yn.translatePoint(dt, ze, f, h), Ie ? n.layerClipId && Yn.hideOutsideRangePoint(dt, Pe, f, h, Fe.xcalendar, Fe.ycalendar) : Pe.remove(); }), Oe.selectAll("text").call(Yn.textPointStyle, Fe, e).each(function(dt) { var Pe = f.c2p(dt.x), ze = h.c2p(dt.y); si.select(this).selectAll("tspan.line").each(function() { u(si.select(this)).attr({ x: Pe, y: ze }); }); }), Oe.exit().remove(); } b.datum(r), w.datum(r), oe(b, w, r); var ae = g.cliponaxis === !1, ge = ae ? null : n.layerClipId; Yn.setClipUrl(b, ge, e), Yn.setClipUrl(w, ge, e); } function jne(e, t, n, r, a) { var i = n.xaxis, o = n.yaxis, l = si.extent(Id.simpleMap(i.range, i.r2c)), s = si.extent(Id.simpleMap(o.range, o.r2c)), c = r[0].trace; if (pc.hasMarkers(c)) { var u = c.marker.maxdisplayed; if (u !== 0) { var f = r.filter(function(v) { return v.x >= l[0] && v.x <= l[1] && v.y >= s[0] && v.y <= s[1]; }), h = Math.ceil(f.length / u), g = 0; a.forEach(function(v, y) { var m = v[0].trace; pc.hasMarkers(m) && m.marker.maxdisplayed > 0 && y < t && g++; }); var p = Math.round(g * h / 3 + Math.floor(g / 3) * h / 7.1); r.forEach(function(v) { delete v.vis; }), f.forEach(function(v, y) { Math.round((y + p) % h) === 0 && (v.vis = !0); }); } } } var tO = { container: "marker", min: "cmin", max: "cmax" }, mh = Ln, nO = function(e, t, n) { var r = {}, a = { _fullLayout: n }, i = mh.getFromTrace(a, t, "x"), o = mh.getFromTrace(a, t, "y"), l = e.orig_x; l === void 0 && (l = e.x); var s = e.orig_y; return s === void 0 && (s = e.y), r.xLabel = mh.tickText(i, i.c2l(l), !0).text, r.yLabel = mh.tickText(o, o.c2l(s), !0).text, r; }, Kv = sn, Ec = Cn, Pne = Rt; function Rne(e) { var t = Kv.select(e).selectAll("g.trace.scatter"); t.style("opacity", function(n) { return n[0].trace.opacity; }), t.selectAll("g.points").each(function(n) { var r = Kv.select(this), a = n.trace || n[0].trace; ib(r, a, e); }), t.selectAll("g.text").each(function(n) { var r = Kv.select(this), a = n.trace || n[0].trace; ob(r, a, e); }), t.selectAll("g.trace path.js-line").call(Ec.lineGroupStyle), t.selectAll("g.trace path.js-fill").call(Ec.fillGroupStyle, e), Pne.getComponentMethod("errorbars", "style")(t); } function ib(e, t, n) { Ec.pointStyle(e.selectAll("path.point"), t, n); } function ob(e, t, n) { Ec.textPointStyle(e.selectAll("text"), t, n); } function Nne(e, t, n) { var r = t[0].trace; r.selectedpoints ? (Ec.selectedPointStyle(n.selectAll("path.point"), r), Ec.selectedTextStyle(n.selectAll("text"), r)) : (ib(n, r, e), ob(n, r, e)); } var nA = { style: Rne, stylePoints: ib, styleText: ob, styleOnSelect: Nne }, Vs = rn, Bne = $a, Hne = function(e, t) { var n, r; if (e.mode === "lines") return n = e.line.color, n && Vs.opacity(n) ? n : e.fillcolor; if (e.mode === "none") return e.fill ? e.fillcolor : ""; var a = t.mcc || (e.marker || {}).color, i = t.mlcc || ((e.marker || {}).line || {}).color; return r = a && Vs.opacity(a) ? a : i && Vs.opacity(i) && (t.mlw || ((e.marker || {}).line || {}).width) ? i : "", r ? Vs.opacity(r) < 0.3 ? Vs.addOpacity(r, 0.3) : r : (n = (e.line || {}).color, n && Vs.opacity(n) && Bne.hasLines(e) && e.line.width ? n : e.fillcolor); }, Uh = Ue, rA = Ao, Vne = Rt, qne = Hne, Jv = rn, Une = Uh.fillText, Gne = function(e, t, n, r) { var a = e.cd, i = a[0].trace, o = e.xa, l = e.ya, s = o.c2p(t), c = l.c2p(n), u = [s, c], f = i.hoveron || "", h = i.mode.indexOf("markers") !== -1 ? 3 : 0.5, g = !!i.xperiodalignment, p = !!i.yperiodalignment; if (f.indexOf("points") !== -1) { var v = function(G) { if (g) { var Z = o.c2p(G.xStart), oe = o.c2p(G.xEnd); return s >= Math.min(Z, oe) && s <= Math.max(Z, oe) ? 0 : 1 / 0; } var ae = Math.max(3, G.mrc || 0), ge = 1 - 1 / ae, ve = Math.abs(o.c2p(G.x) - s); return ve < ae ? ge * ve / ae : ve - ae + ge; }, y = function(G) { if (p) { var Z = l.c2p(G.yStart), oe = l.c2p(G.yEnd); return c >= Math.min(Z, oe) && c <= Math.max(Z, oe) ? 0 : 1 / 0; } var ae = Math.max(3, G.mrc || 0), ge = 1 - 1 / ae, ve = Math.abs(l.c2p(G.y) - c); return ve < ae ? ge * ve / ae : ve - ae + ge; }, m = function(G) { var Z = Math.max(h, G.mrc || 0), oe = o.c2p(G.x) - s, ae = l.c2p(G.y) - c; return Math.max(Math.sqrt(oe * oe + ae * ae) - Z, 1 - h / Z); }, b = rA.getDistanceFunction(r, v, y, m); if (rA.getClosest(a, b, e), e.index !== !1) { var w = a[e.index], _ = o.c2p(w.x, !0), k = l.c2p(w.y, !0), T = w.mrc || 1; e.index = w.i; var O = a[0].t.orientation, M = O && (w.sNorm || w.s), C = O === "h" ? M : w.orig_x !== void 0 ? w.orig_x : w.x, I = O === "v" ? M : w.orig_y !== void 0 ? w.orig_y : w.y; return Uh.extendFlat(e, { color: qne(i, w), x0: _ - T, x1: _ + T, xLabelVal: C, y0: k - T, y1: k + T, yLabelVal: I, spikeDistance: m(w), hovertemplate: i.hovertemplate }), Une(w, i, e), Vne.getComponentMethod("errorbars", "hoverInfo")(w, i, e), [e]; } } if (f.indexOf("fills") !== -1 && i._polygons) { var j = i._polygons, P = [], N = !1, W = 1 / 0, J = -1 / 0, U = 1 / 0, E = -1 / 0, z, F, q, H, K, Q, re, te, X; for (z = 0; z < j.length; z++) q = j[z], q.contains(u) && (N = !N, P.push(q), U = Math.min(U, q.ymin), E = Math.max(E, q.ymax)); if (N) { U = Math.max(U, 0), E = Math.min(E, l._length); var ce = (U + E) / 2; for (z = 0; z < P.length; z++) for (H = P[z].pts, F = 1; F < H.length; F++) te = H[F - 1][1], X = H[F][1], te > ce != X >= ce && (Q = H[F - 1][0], re = H[F][0], X - te && (K = Q + (re - Q) * (ce - te) / (X - te), W = Math.min(W, K), J = Math.max(J, K))); W = Math.max(W, 0), J = Math.min(J, o._length); var B = Jv.defaultLine; return Jv.opacity(i.fillcolor) ? B = i.fillcolor : Jv.opacity((i.line || {}).color) && (B = i.line.color), Uh.extendFlat(e, { // never let a 2D override 1D type as closest point // also: no spikeDistance, it's not allowed for fills distance: e.maxHoverDistance, x0: W, x1: J, y0: ce, y1: ce, color: B, hovertemplate: !1 }), delete e.index, i.text && !Uh.isArrayOrTypedArray(i.text) ? e.text = String(i.text) : e.text = i.name, [e]; } } }, aA = $a, Wne = function(e, t) { var n = e.cd, r = e.xaxis, a = e.yaxis, i = [], o = n[0].trace, l, s, c, u, f = !aA.hasMarkers(o) && !aA.hasText(o); if (f) return []; if (t === !1) for (l = 0; l < n.length; l++) n[l].selected = 0; else for (l = 0; l < n.length; l++) s = n[l], c = r.c2p(s.x), u = a.c2p(s.y), s.i !== null && t.contains([c, u], !1, l, e) ? (i.push({ pointNumber: s.i, x: r.c2d(s.x), y: a.c2d(s.y) }), s.selected = 1) : s.selected = 0; return i; }, yr = {}, iA, oA; function Zne() { return oA || (oA = 1, iA = { xaxis: { valType: "subplotid", dflt: "x", editType: "calc+clearAxisTypes", description: [ "Sets a reference between this trace's x coordinates and", "a 2D cartesian x axis.", "If *x* (the default value), the x coordinates refer to", "`layout.xaxis`.", "If *x2*, the x coordinates refer to `layout.xaxis2`, and so on." ].join(" ") }, yaxis: { valType: "subplotid", dflt: "y", editType: "calc+clearAxisTypes", description: [ "Sets a reference between this trace's y coordinates and", "a 2D cartesian y axis.", "If *y* (the default value), the y coordinates refer to", "`layout.yaxis`.", "If *y2*, the y coordinates refer to `layout.yaxis2`, and so on." ].join(" ") } }), iA; } var Qv, lA; function Yne() { if (lA) return Qv; lA = 1; var e = Rt.traceIs, t = zL; Qv = function(o, l, s, c) { s("autotypenumbers", c.autotypenumbersDflt); var u = s("type", (c.splomStash || {}).type); u === "-" && (n(l, c.data), l.type === "-" ? l.type = "linear" : o.type = l.type); }; function n(o, l) { if (o.type === "-") { var s = o._id, c = s.charAt(0), u; s.indexOf("scene") !== -1 && (s = c); var f = r(l, s, c); if (f) { if (f.type === "histogram" && c === { v: "y", h: "x" }[f.orientation || "v"]) { o.type = "linear"; return; } var h = c + "calendar", g = f[h], p = { noMultiCategory: !e(f, "cartesian") || e(f, "noMultiCategory") }; if (f.type === "box" && f._hasPreCompStats && c === { h: "x", v: "y" }[f.orientation || "v"] && (p.noMultiCategory = !0), p.autotypenumbers = o.autotypenumbers, i(f, c)) { var v = a(f), y = []; for (u = 0; u < l.length; u++) { var m = l[u]; !e(m, "box-violin") || (m[c + "axis"] || c) !== s || (m[v] !== void 0 ? y.push(m[v][0]) : m.name !== void 0 ? y.push(m.name) : y.push("text"), m[h] !== g && (g = void 0)); } o.type = t(y, g, p); } else if (f.type === "splom") { var b = f.dimensions, w = b[f._axesDim[s]]; w.visible && (o.type = t(w.values, g, p)); } else o.type = t(f[c] || [f[c + "0"]], g, p); } } } function r(o, l, s) { for (var c = 0; c < o.length; c++) { var u = o[c]; if (u.type === "splom" && u._length > 0 && (u["_" + s + "axes"] || {})[l] || (u[s + "axis"] || s) === l && (i(u, s) || (u[s] || []).length || u[s + "0"])) return u; } } function a(o) { return { v: "x", h: "y" }[o.orientation || "v"]; } function i(o, l) { var s = a(o), c = e(o, "box-violin"), u = e(o._fullInput || {}, "candlestick"); return c && !u && l === s && o[s] === void 0 && o[s + "0"] === void 0; } return Qv; } var $ne = ir.isTypedArraySpec; function Kne(e, t) { var n = t.dataAttr || e._id.charAt(0), r = {}, a, i, o; if (t.axData) a = t.axData; else for (a = [], i = 0; i < t.data.length; i++) { var l = t.data[i]; l[n + "axis"] === e._id && a.push(l); } for (i = 0; i < a.length; i++) { var s = a[i][n]; for (o = 0; o < s.length; o++) { var c = s[o]; c != null && (r[c] = 1); } } return Object.keys(r); } var Jne = function(e, t, n, r) { if (t.type === "category") { var a = e.categoryarray, i = Array.isArray(a) && a.length > 0 || $ne(a), o; i && (o = "array"); var l = n("categoryorder", o), s; l === "array" && (s = n("categoryarray")), !i && l === "array" && (l = t.categoryorder = "trace"), l === "trace" ? t._initialCategories = [] : l === "array" ? t._initialCategories = s.slice() : (s = Kne(t, r).sort(), l === "category ascending" ? t._initialCategories = s : l === "category descending" && (t._initialCategories = s.reverse())); } }, sA = xi.mix, Qne = fa, Xne = Ue, ere = function(e, t, n, r) { r = r || {}; var a = r.dfltColor; function i(T, O) { return Xne.coerce2(e, t, r.attributes, T, O); } var o = i("linecolor", a), l = i("linewidth"), s = n("showline", r.showLine || !!o || !!l); s || (delete t.linecolor, delete t.linewidth); var c = sA(a, r.bgColor, r.blend || Qne.lightFraction).toRgbString(), u = i("gridcolor", c), f = i("gridwidth"), h = i("griddash"), g = n( "showgrid", r.showGrid || !!u || !!f || !!h ); if (g || (delete t.gridcolor, delete t.gridwidth, delete t.griddash), r.hasMinor) { var p = sA(t.gridcolor, r.bgColor, 67).toRgbString(), v = i("minor.gridcolor", p), y = i("minor.gridwidth", t.gridwidth || 1), m = i("minor.griddash", t.griddash || "solid"), b = n( "minor.showgrid", !!v || !!y || !!m ); b || (delete t.minor.gridcolor, delete t.minor.gridwidth, delete t.minor.griddash); } if (!r.noZeroLine) { var w = i("zerolinecolor", a), _ = i("zerolinewidth"), k = n("zeroline", r.showGrid || !!w || !!_); k || (delete t.zerolinecolor, delete t.zerolinewidth); } }, cA = cn, tre = Rt, Yu = Ue, nre = Sn, rre = Qi, qy = Ji, uA = gL, dA = vL, are = xL, ire = bL, ore = Jne, lre = ere, sre = $L, fA = px, Gh = $r.WEEKDAY_PATTERN, cre = $r.HOUR_PATTERN, rO = function(e, t, n, r, a) { var i = r.letter, o = r.font || {}, l = r.splomStash || {}, s = n("visible", !r.visibleDflt), c = t._template || {}, u = t.type || c.type || "-", f; if (u === "date") { var h = tre.getComponentMethod("calendars", "handleDefaults"); h(e, t, "calendar", r.calendar), r.noTicklabelmode || (f = n("ticklabelmode")); } var g = ""; (!r.noTicklabelposition || u === "multicategory") && (g = Yu.coerce(e, t, { ticklabelposition: { valType: "enumerated", dflt: "outside", values: f === "period" ? ["outside", "inside"] : i === "x" ? [ "outside", "inside", "outside left", "inside left", "outside right", "inside right" ] : [ "outside", "inside", "outside top", "inside top", "outside bottom", "inside bottom" ] } }, "ticklabelposition")), r.noTicklabeloverflow || n( "ticklabeloverflow", g.indexOf("inside") !== -1 ? "hide past domain" : u === "category" || u === "multicategory" ? "allow" : "hide past div" ), fA(t, a), sre(e, t, n, r), ore(e, t, n, r), u !== "category" && !r.noHover && n("hoverformat"); var p = n("color"), v = p !== qy.color.dflt ? p : o.color, y = l.label || a._dfltTitle[i]; if (ire(e, t, n, u, r), !s) return t; n("title.text", y), Yu.coerceFont(n, "title.font", { family: o.family, size: Yu.bigFont(o.size), color: v }), uA(e, t, n, u); var m = r.hasMinor; if (m && (nre.newContainer(t, "minor"), uA(e, t, n, u, { isMinor: !0 })), are(e, t, n, u, r), dA(e, t, n, r), m) { var b = r.isMinor; r.isMinor = !0, dA(e, t, n, r), r.isMinor = b; } lre(e, t, n, { dfltColor: p, bgColor: r.bgColor, showGrid: r.showGrid, hasMinor: m, attributes: qy }), m && !t.minor.ticks && !t.minor.showgrid && delete t.minor, (t.showline || t.ticks) && n("mirror"); var w = u === "multicategory"; if (!r.noTickson && (u === "category" || w) && (t.ticks || t.showgrid)) { var _; w && (_ = "boundaries"); var k = n("tickson", _); k === "boundaries" && delete t.ticklabelposition; } if (w) { var T = n("showdividers"); T && (n("dividercolor"), n("dividerwidth")); } if (u === "date") if (rre(e, t, { name: "rangebreaks", inclusionAttr: "enabled", handleItemDefaults: ure }), !t.rangebreaks.length) delete t.rangebreaks; else { for (var O = 0; O < t.rangebreaks.length; O++) if (t.rangebreaks[O].pattern === Gh) { t._hasDayOfWeekBreaks = !0; break; } if (fA(t, a), a._has("scattergl") || a._has("splom")) for (var M = 0; M < r.data.length; M++) { var C = r.data[M]; (C.type === "scattergl" || C.type === "splom") && (C.visible = !1, Yu.warn(C.type + " traces do not work on axes with rangebreaks. Setting trace " + C.index + " to `visible: false`.")); } } return t; }; function ure(e, t, n) { function r(h, g) { return Yu.coerce(e, t, qy.rangebreaks, h, g); } var a = r("enabled"); if (a) { var i = r("bounds"); if (i && i.length >= 2) { var o = "", l, s; if (i.length === 2) { for (l = 0; l < 2; l++) if (s = hA(i[l]), s) { o = Gh; break; } } var c = r("pattern", o); if (c === Gh) for (l = 0; l < 2; l++) s = hA(i[l]), s && (t.bounds[l] = i[l] = s - 1); if (c) for (l = 0; l < 2; l++) switch (s = i[l], c) { case Gh: if (!cA(s)) { t.enabled = !1; return; } if (s = +s, s !== Math.floor(s) || // don't accept fractional days for mow s < 0 || s >= 7) { t.enabled = !1; return; } t.bounds[l] = i[l] = s; break; case cre: if (!cA(s)) { t.enabled = !1; return; } if (s = +s, s < 0 || s > 24) { t.enabled = !1; return; } t.bounds[l] = i[l] = s; break; } if (n.autorange === !1) { var u = n.range; if (u[0] < u[1]) { if (i[0] < u[0] && i[1] > u[1]) { t.enabled = !1; return; } } else if (i[0] > u[0] && i[1] < u[1]) { t.enabled = !1; return; } } } else { var f = r("values"); if (f && f.length) r("dvalue"); else { t.enabled = !1; return; } } } } var dre = { sun: 1, mon: 2, tue: 3, wed: 4, thu: 5, fri: 6, sat: 7 }; function hA(e) { if (typeof e == "string") return dre[e.substr(0, 3).toLowerCase()]; } var fre = cn, yh = Ue, aO = function(e, t, n, r) { var a = r.counterAxes || [], i = r.overlayableAxes || [], o = r.letter, l = r.grid, s = r.overlayingDomain, c, u, f, h, g, p; l && (u = l._domains[o][l._axisMap[t._id]], c = l._anchors[t._id], u && (f = l[o + "side"].split(" ")[0], h = l.domain[o][f === "right" || f === "top" ? 1 : 0])), u = u || [0, 1], c = c || (fre(e.position) ? "free" : a[0] || "free"), f = f || (o === "x" ? "bottom" : "left"), h = h || 0, g = 0, p = !1; var v = yh.coerce(e, t, { anchor: { valType: "enumerated", values: ["free"].concat(a), dflt: c } }, "anchor"), y = yh.coerce(e, t, { side: { valType: "enumerated", values: o === "x" ? ["bottom", "top"] : ["left", "right"], dflt: f } }, "side"); if (v === "free") { if (o === "y") { var m = n("autoshift"); m && (h = y === "left" ? s[0] : s[1], p = t.automargin ? t.automargin : !0, g = y === "left" ? -3 : 3), n("shift", g); } n("position", h); } n("automargin", p); var b = !1; if (i.length && (b = yh.coerce(e, t, { overlaying: { valType: "enumerated", values: [!1].concat(i), dflt: !1 } }, "overlaying")), !b) { var w = n("domain", u); w[0] > w[1] - 1 / 4096 && (t.domain = u), yh.noneOrAll(e.domain, t.domain, u), t.tickmode === "sync" && (t.tickmode = "auto"); } return n("layer"), t; }, Xv, pA; function hre() { if (pA) return Xv; pA = 1; var e = Ue, t = rn, n = Oo.isUnifiedHover, r = g6, a = Sn, i = $d, o = Ji, l = Yne(), s = rO, c = _l, u = aO, f = mr, h = f.id2name, g = f.name2id, p = $r.AX_ID_PATTERN, v = Rt, y = v.traceIs, m = v.getComponentMethod; function b(w, _, k) { Array.isArray(w[_]) ? w[_].push(k) : w[_] = [k]; } return Xv = function(w, _, k) { var T = _.autotypenumbers, O = {}, M = {}, C = {}, I = {}, j = {}, P = {}, N = {}, W = {}, J = {}, U = {}, E, z; for (E = 0; E < k.length; E++) { var F = k[E]; if (!(!y(F, "cartesian") && !y(F, "gl2d"))) { var q; if (F.xaxis) q = h(F.xaxis), b(O, q, F); else if (F.xaxes) for (z = 0; z < F.xaxes.length; z++) b(O, h(F.xaxes[z]), F); var H; if (F.yaxis) H = h(F.yaxis), b(O, H, F); else if (F.yaxes) for (z = 0; z < F.yaxes.length; z++) b(O, h(F.yaxes[z]), F); if (F.type === "funnel" ? F.orientation === "h" ? (q && (M[q] = !0), H && (N[H] = !0)) : H && (C[H] = !0) : F.type === "image" ? (H && (W[H] = !0), q && (W[q] = !0)) : (H && (j[H] = !0, P[H] = !0), (!y(F, "carpet") || F.type === "carpet" && !F._cheater) && q && (I[q] = !0)), F.type === "carpet" && F._cheater && q && (M[q] = !0), y(F, "2dMap") && (J[q] = !0, J[H] = !0), y(F, "oriented")) { var K = F.orientation === "h" ? H : q; U[K] = !0; } } } var Q = _._subplots, re = Q.xaxis, te = Q.yaxis, X = e.simpleMap(re, h), ce = e.simpleMap(te, h), B = X.concat(ce), G = t.background; re.length && te.length && (G = e.coerce(w, _, i, "plot_bgcolor")); var Z = t.combine(G, _.paper_bgcolor), oe, ae, ge, ve, pe; function ye() { var $e = O[oe] || []; pe._traceIndices = $e.map(function(Lt) { return Lt._expandedIndex; }), pe._annIndices = [], pe._shapeIndices = [], pe._selectionIndices = [], pe._imgIndices = [], pe._subplotsWith = [], pe._counterAxes = [], pe._name = pe._attr = oe, pe._id = ae; } function Oe($e, Lt) { return e.coerce(ve, pe, o, $e, Lt); } function Be($e, Lt) { return e.coerce2(ve, pe, o, $e, Lt); } function Ie($e) { return $e === "x" ? te : re; } function Fe($e, Lt) { for (var $ = $e === "x" ? X : ce, se = [], ie = 0; ie < $.length; ie++) { var de = $[ie]; de !== Lt && !(w[de] || {}).overlaying && se.push(g(de)); } return se; } var Re = { x: Ie("x"), y: Ie("y") }, We = Re.x.concat(Re.y), Ce = {}, Ve = []; function Ke() { var $e = ve.matches; p.test($e) && We.indexOf($e) === -1 && (Ce[$e] = ve.type, Ve = Object.keys(Ce)); } var Xe = r(w, _), ct = n(Xe); for (E = 0; E < B.length; E++) { oe = B[E], ae = g(oe), ge = oe.charAt(0), e.isPlainObject(w[oe]) || (w[oe] = {}), ve = w[oe], pe = a.newContainer(_, oe, ge + "axis"), ye(); var vt = ge === "x" && !I[oe] && M[oe] || ge === "y" && !j[oe] && C[oe], lt = ge === "y" && (!P[oe] && N[oe] || W[oe]), ut = { hasMinor: !0, letter: ge, font: _.font, outerTicks: J[oe], showGrid: !U[oe], data: O[oe] || [], bgColor: Z, calendar: _.calendar, automargin: !0, visibleDflt: vt, reverseDflt: lt, autotypenumbersDflt: T, splomStash: ((_._splomAxes || {})[ge] || {})[ae] }; Oe("uirevision", _.uirevision), l(ve, pe, Oe, ut), s(ve, pe, Oe, ut, _); var dt = ct && ge === Xe.charAt(0), Pe = Be("spikecolor", ct ? pe.color : void 0), ze = Be("spikethickness", ct ? 1.5 : void 0), Ne = Be("spikedash", ct ? "dot" : void 0), nt = Be("spikemode", ct ? "across" : void 0), Qe = Be("spikesnap"), it = Oe("showspikes", !!dt || !!Pe || !!ze || !!Ne || !!nt || !!Qe); it || (delete pe.spikecolor, delete pe.spikethickness, delete pe.spikedash, delete pe.spikemode, delete pe.spikesnap); var rt = h(ve.overlaying), bt = [0, 1]; if (_[rt] !== void 0) { var je = h(_[rt].anchor); _[je] !== void 0 && (bt = _[je].domain); } u(ve, pe, Oe, { letter: ge, counterAxes: Re[ge], overlayableAxes: Fe(ge, oe), grid: _.grid, overlayingDomain: bt }), Oe("title.standoff"), Ke(), pe._input = ve; } for (E = 0; E < Ve.length; ) { ae = Ve[E++], oe = h(ae), ge = oe.charAt(0), e.isPlainObject(w[oe]) || (w[oe] = {}), ve = w[oe], pe = a.newContainer(_, oe, ge + "axis"), ye(); var tt = { letter: ge, font: _.font, outerTicks: J[oe], showGrid: !U[oe], data: [], bgColor: Z, calendar: _.calendar, automargin: !0, visibleDflt: !1, reverseDflt: !1, autotypenumbersDflt: T, splomStash: ((_._splomAxes || {})[ge] || {})[ae] }; Oe("uirevision", _.uirevision), pe.type = Ce[ae] || "linear", s(ve, pe, Oe, tt, _), u(ve, pe, Oe, { letter: ge, counterAxes: Re[ge], overlayableAxes: Fe(ge, oe), grid: _.grid }), Oe("fixedrange"), Ke(), pe._input = ve; } var pt = m("rangeslider", "handleDefaults"), kt = m("rangeselector", "handleDefaults"); for (E = 0; E < X.length; E++) oe = X[E], ve = w[oe], pe = _[oe], pt(w, _, oe), pe.type === "date" && kt( ve, pe, _, ce, pe.calendar ), Oe("fixedrange"); for (E = 0; E < ce.length; E++) { oe = ce[E], ve = w[oe], pe = _[oe]; var et = _[h(pe.anchor)], ft = m("rangeslider", "isVisible")(et); Oe("fixedrange", ft); } c.handleDefaults(w, _, { axIds: We.concat(Ve).sort(f.idSort), axHasImage: W }); }, Xv; } var em, gA; function pre() { if (gA) return em; gA = 1; var e = sn, t = Rt, n = Ue, r = Cn, a = Ln; return em = function(i, o, l, s) { var c = i._fullLayout; if (o.length === 0) { a.redrawComponents(i); return; } function u(_) { var k = _.xaxis, T = _.yaxis; c._defs.select("#" + _.clipId + "> rect").call(r.setTranslate, 0, 0).call(r.setScale, 1, 1), _.plot.call(r.setTranslate, k._offset, T._offset).call(r.setScale, 1, 1); var O = _.plot.selectAll(".scatterlayer .trace"); O.selectAll(".point").call(r.setPointGroupScale, 1, 1), O.selectAll(".textpoint").call(r.setTextPointsScale, 1, 1), O.call(r.hideOutsideRangePoints, _); } function f(_, k) { var T = _.plotinfo, O = T.xaxis, M = T.yaxis, C = O._length, I = M._length, j = !!_.xr1, P = !!_.yr1, N = []; if (j) { var W = n.simpleMap(_.xr0, O.r2l), J = n.simpleMap(_.xr1, O.r2l), U = W[1] - W[0], E = J[1] - J[0]; N[0] = (W[0] * (1 - k) + k * J[0] - W[0]) / (W[1] - W[0]) * C, N[2] = C * (1 - k + k * E / U), O.range[0] = O.l2r(W[0] * (1 - k) + k * J[0]), O.range[1] = O.l2r(W[1] * (1 - k) + k * J[1]); } else N[0] = 0, N[2] = C; if (P) { var z = n.simpleMap(_.yr0, M.r2l), F = n.simpleMap(_.yr1, M.r2l), q = z[1] - z[0], H = F[1] - F[0]; N[1] = (z[1] * (1 - k) + k * F[1] - z[1]) / (z[0] - z[1]) * I, N[3] = I * (1 - k + k * H / q), M.range[0] = O.l2r(z[0] * (1 - k) + k * F[0]), M.range[1] = M.l2r(z[1] * (1 - k) + k * F[1]); } else N[1] = 0, N[3] = I; a.drawOne(i, O, { skipTitle: !0 }), a.drawOne(i, M, { skipTitle: !0 }), a.redrawComponents(i, [O._id, M._id]); var K = j ? C / N[2] : 1, Q = P ? I / N[3] : 1, re = j ? N[0] : 0, te = P ? N[1] : 0, X = j ? N[0] / N[2] * C : 0, ce = P ? N[1] / N[3] * I : 0, B = O._offset - X, G = M._offset - ce; T.clipRect.call(r.setTranslate, re, te).call(r.setScale, 1 / K, 1 / Q), T.plot.call(r.setTranslate, B, G).call(r.setScale, K, Q), r.setPointGroupScale(T.zoomScalePts, 1 / K, 1 / Q), r.setTextPointsScale(T.zoomScaleTxt, 1 / K, 1 / Q); } var h; s && (h = s()); function g() { for (var _ = {}, k = 0; k < o.length; k++) { var T = o[k], O = T.plotinfo.xaxis, M = T.plotinfo.yaxis; T.xr1 && (_[O._name + ".range"] = T.xr1.slice()), T.yr1 && (_[M._name + ".range"] = T.yr1.slice()); } return h && h(), t.call("relayout", i, _).then(function() { for (var C = 0; C < o.length; C++) u(o[C].plotinfo); }); } function p() { for (var _ = {}, k = 0; k < o.length; k++) { var T = o[k], O = T.plotinfo.xaxis, M = T.plotinfo.yaxis; T.xr0 && (_[O._name + ".range"] = T.xr0.slice()), T.yr0 && (_[M._name + ".range"] = T.yr0.slice()); } return t.call("relayout", i, _).then(function() { for (var C = 0; C < o.length; C++) u(o[C].plotinfo); }); } var v, y, m, b = e.ease(l.easing); i._transitionData._interruptCallbacks.push(function() { return window.cancelAnimationFrame(m), m = null, p(); }); function w() { y = Date.now(); for (var _ = Math.min(1, (y - v) / l.duration), k = b(_), T = 0; T < o.length; T++) f(o[T], k); y - v > l.duration ? (g(), m = window.cancelAnimationFrame(w)) : m = window.requestAnimationFrame(w); } return v = Date.now(), m = window.requestAnimationFrame(w), Promise.resolve(); }, em; } var K0 = sn, vA = Rt, Lp = Ue, gre = kr, vre = Cn, mA = Kd.getModuleCalcData, rl = mr, Vi = $r, mre = yl, kn = Lp.ensureSingle; function xh(e, t, n) { return Lp.ensureSingle(e, t, n, function(r) { r.datum(n); }); } yr.name = "cartesian"; yr.attr = ["xaxis", "yaxis"]; yr.idRoot = ["x", "y"]; yr.idRegex = Vi.idRegex; yr.attrRegex = Vi.attrRegex; yr.attributes = Zne(); yr.layoutAttributes = Ji; yr.supplyLayoutDefaults = hre(); yr.transitionAxes = pre(); yr.finalizeSubplots = function(e, t) { var n = t._subplots, r = n.xaxis, a = n.yaxis, i = n.cartesian, o = i.concat(n.gl2d || []), l = {}, s = {}, c, u, f; for (c = 0; c < o.length; c++) { var h = o[c].split("y"); l[h[0]] = 1, s["y" + h[1]] = 1; } for (c = 0; c < r.length; c++) u = r[c], l[u] || (f = (e[rl.id2name(u)] || {}).anchor, Vi.idRegex.y.test(f) || (f = "y"), i.push(u + f), o.push(u + f), s[f] || (s[f] = 1, Lp.pushUnique(a, f))); for (c = 0; c < a.length; c++) f = a[c], s[f] || (u = (e[rl.id2name(f)] || {}).anchor, Vi.idRegex.x.test(u) || (u = "x"), i.push(u + f), o.push(u + f), l[u] || (l[u] = 1, Lp.pushUnique(r, u))); if (!o.length) { u = "", f = ""; for (var g in e) if (Vi.attrRegex.test(g)) { var p = g.charAt(0); p === "x" ? (!u || +g.substr(5) < +u.substr(5)) && (u = g) : (!f || +g.substr(5) < +f.substr(5)) && (f = g); } u = u ? rl.name2id(u) : "x", f = f ? rl.name2id(f) : "y", r.push(u), a.push(f), i.push(u + f); } }; yr.plot = function(e, t, n, r) { var a = e._fullLayout, i = a._subplots.cartesian, o = e.calcdata, l; if (!Array.isArray(t)) for (t = [], l = 0; l < o.length; l++) t.push(l); for (l = 0; l < i.length; l++) { for (var s = i[l], c = a._plots[s], u = [], f, h = 0; h < o.length; h++) { var g = o[h], p = g[0].trace; p.xaxis + p.yaxis === s && ((t.indexOf(p.index) !== -1 || p.carpet) && (f && f[0].trace.xaxis + f[0].trace.yaxis === s && ["tonextx", "tonexty", "tonext"].indexOf(p.fill) !== -1 && u.indexOf(f) === -1 && u.push(f), u.push(g)), f = g); } iO(e, c, u, n, r); } }; function iO(e, t, n, r, a) { for (var i = Vi.traceLayerClasses, o = e._fullLayout, l = o._modules, s, c, u, f = [], h = [], g = 0; g < l.length; g++) { s = l[g]; var p = s.name, v = vA.modules[p].categories; if (v.svg) { var y = s.layerName || p + "layer", m = s.plot; c = mA(n, m), u = c[0], n = c[1], u.length && f.push({ i: i.indexOf(y), className: y, plotMethod: m, cdModule: u }), v.zoomScale && h.push("." + y); } } f.sort(function(_, k) { return _.i - k.i; }); var b = t.plot.selectAll("g.mlayer").data(f, function(_) { return _.className; }); if (b.enter().append("g").attr("class", function(_) { return _.className; }).classed("mlayer", !0).classed("rangeplot", t.isRangePlot), b.exit().remove(), b.order(), b.each(function(_) { var k = K0.select(this), T = _.className; _.plotMethod( e, t, _.cdModule, k, r, a ), Vi.clipOnAxisFalseQuery.indexOf("." + T) === -1 && vre.setClipUrl(k, t.layerClipId, e); }), o._has("scattergl") && (s = vA.getModule("scattergl"), u = mA(n, s)[0], s.plot(e, t, u)), !e._context.staticPlot && (t._hasClipOnAxisFalse && (t.clipOnAxisFalseTraces = t.plot.selectAll(Vi.clipOnAxisFalseQuery.join(",")).selectAll(".trace")), h.length)) { var w = t.plot.selectAll(h.join(",")).selectAll(".trace"); t.zoomScalePts = w.selectAll("path.point"), t.zoomScaleTxt = w.selectAll(".textpoint"); } } yr.clean = function(e, t, n, r) { var a = r._plots || {}, i = t._plots || {}, o = r._subplots || {}, l, s, c; if (r._hasOnlyLargeSploms && !t._hasOnlyLargeSploms) for (c in a) l = a[c], l.plotgroup && l.plotgroup.remove(); var u = r._has && r._has("gl"), f = t._has && t._has("gl"); if (u && !f) for (c in a) l = a[c], l._scene && l._scene.destroy(); if (o.xaxis && o.yaxis) { var h = rl.listIds({ _fullLayout: r }); for (s = 0; s < h.length; s++) { var g = h[s]; t[rl.id2name(g)] || r._infolayer.selectAll(".g-" + g + "title").remove(); } } var p = r._has && r._has("cartesian"), v = t._has && t._has("cartesian"); if (p && !v) lO(r._cartesianlayer.selectAll(".subplot"), r), r._defs.selectAll(".axesclip").remove(), delete r._axisConstraintGroups, delete r._axisMatchGroups; else if (o.cartesian) for (s = 0; s < o.cartesian.length; s++) { var y = o.cartesian[s]; if (!i[y]) { var m = "." + y + ",." + y + "-x,." + y + "-y"; r._cartesianlayer.selectAll(m).remove(), sO(y, r); } } }; yr.drawFramework = function(e) { var t = e._fullLayout, n = yre(e), r = t._cartesianlayer.selectAll(".subplot").data(n, String); r.enter().append("g").attr("class", function(a) { return "subplot " + a[0]; }), r.order(), r.exit().call(lO, t), r.each(function(a) { var i = a[0], o = t._plots[i]; o.plotgroup = K0.select(this), oO(e, o), o.draglayer = kn(t._draggers, "g", i); }); }; yr.rangePlot = function(e, t, n) { oO(e, t), iO(e, t, n), gre.style(e); }; function yre(e) { var t = e._fullLayout, n = t._subplots.cartesian, r = n.length, a, i, o, l, s, c, u = [], f = []; for (a = 0; a < r; a++) { o = n[a], l = t._plots[o], s = l.xaxis, c = l.yaxis; var h = s._mainAxis, g = c._mainAxis, p = h._id + g._id, v = t._plots[p]; l.overlays = [], p !== o && v ? (l.mainplot = p, l.mainplotinfo = v, f.push(o)) : (l.mainplot = void 0, l.mainplotinfo = void 0, u.push(o)); } for (a = 0; a < f.length; a++) o = f[a], l = t._plots[o], l.mainplotinfo.overlays.push(l); var y = u.concat(f), m = new Array(r); for (a = 0; a < r; a++) { o = y[a], l = t._plots[o], s = l.xaxis, c = l.yaxis; var b = [o, s.layer, c.layer, s.overlaying || "", c.overlaying || ""]; for (i = 0; i < l.overlays.length; i++) b.push(l.overlays[i].id); m[a] = b; } return m; } function oO(e, t) { var n = t.plotgroup, r = t.id, a = Vi.layerValue2layerClass[t.xaxis.layer], i = Vi.layerValue2layerClass[t.yaxis.layer], o = e._fullLayout._hasOnlyLargeSploms; if (t.mainplot) { var l = t.mainplotinfo, s = l.plotgroup, c = r + "-x", u = r + "-y"; t.minorGridlayer = l.minorGridlayer, t.gridlayer = l.gridlayer, t.zerolinelayer = l.zerolinelayer, kn(l.overlinesBelow, "path", c), kn(l.overlinesBelow, "path", u), kn(l.overaxesBelow, "g", c), kn(l.overaxesBelow, "g", u), t.plot = kn(l.overplot, "g", r), kn(l.overlinesAbove, "path", c), kn(l.overlinesAbove, "path", u), kn(l.overaxesAbove, "g", c), kn(l.overaxesAbove, "g", u), t.xlines = s.select(".overlines-" + a).select("." + c), t.ylines = s.select(".overlines-" + i).select("." + u), t.xaxislayer = s.select(".overaxes-" + a).select("." + c), t.yaxislayer = s.select(".overaxes-" + i).select("." + u); } else if (o) t.xlines = kn(n, "path", "xlines-above"), t.ylines = kn(n, "path", "ylines-above"), t.xaxislayer = kn(n, "g", "xaxislayer-above"), t.yaxislayer = kn(n, "g", "yaxislayer-above"); else { var f = kn(n, "g", "layer-subplot"); t.shapelayer = kn(f, "g", "shapelayer"), t.imagelayer = kn(f, "g", "imagelayer"), t.minorGridlayer = kn(n, "g", "minor-gridlayer"), t.gridlayer = kn(n, "g", "gridlayer"), t.zerolinelayer = kn(n, "g", "zerolinelayer"), kn(n, "path", "xlines-below"), kn(n, "path", "ylines-below"), t.overlinesBelow = kn(n, "g", "overlines-below"), kn(n, "g", "xaxislayer-below"), kn(n, "g", "yaxislayer-below"), t.overaxesBelow = kn(n, "g", "overaxes-below"), t.plot = kn(n, "g", "plot"), t.overplot = kn(n, "g", "overplot"), t.xlines = kn(n, "path", "xlines-above"), t.ylines = kn(n, "path", "ylines-above"), t.overlinesAbove = kn(n, "g", "overlines-above"), kn(n, "g", "xaxislayer-above"), kn(n, "g", "yaxislayer-above"), t.overaxesAbove = kn(n, "g", "overaxes-above"), t.xlines = n.select(".xlines-" + a), t.ylines = n.select(".ylines-" + i), t.xaxislayer = n.select(".xaxislayer-" + a), t.yaxislayer = n.select(".yaxislayer-" + i); } o || (xh(t.minorGridlayer, "g", t.xaxis._id), xh(t.minorGridlayer, "g", t.yaxis._id), t.minorGridlayer.selectAll("g").map(function(h) { return h[0]; }).sort(rl.idSort), xh(t.gridlayer, "g", t.xaxis._id), xh(t.gridlayer, "g", t.yaxis._id), t.gridlayer.selectAll("g").map(function(h) { return h[0]; }).sort(rl.idSort)), t.xlines.style("fill", "none").classed("crisp", !0), t.ylines.style("fill", "none").classed("crisp", !0); } function lO(e, t) { if (e) { var n = {}; e.each(function(s) { var c = s[0], u = K0.select(this); u.remove(), sO(c, t), n[c] = !0; }); for (var r in t._plots) for (var a = t._plots[r], i = a.overlays || [], o = 0; o < i.length; o++) { var l = i[o]; n[l.id] && l.plot.selectAll(".trace").remove(); } } } function sO(e, t) { t._draggers.selectAll("g." + e).remove(), t._defs.select("#clip" + t._uid + e + "plot").remove(); } yr.toSVG = function(e) { var t = e._fullLayout._glimages, n = K0.select(e).selectAll(".svg-container"), r = n.filter(function(i, o) { return o === n.size() - 1; }).selectAll(".gl-canvas-context, .gl-canvas-focus"); function a() { var i = this, o = i.toDataURL("image/png"), l = t.append("svg:image"); l.attr({ xmlns: mre.svg, "xlink:href": o, preserveAspectRatio: "none", x: 0, y: 0, width: i.style.width, height: i.style.height }); } r.each(a); }; yr.updateFx = _x.updateFx; var bh = $a, cO = { hasLines: bh.hasLines, hasMarkers: bh.hasMarkers, hasText: bh.hasText, isBubble: bh.isBubble, attributes: ws, layoutAttributes: ix, supplyDefaults: Zte, crossTraceDefaults: Qte, supplyLayoutDefaults: tne, calc: U8.calc, crossTraceCalc: Tne, arraysToCalcdata: R8, plot: zne, colorbar: tO, formatLabels: nO, style: nA.style, styleOnSelect: nA.styleOnSelect, hoverPoints: Gne, selectPoints: Wne, animatable: !0, moduleType: "trace", name: "scatter", basePlotModule: yr, categories: [ "cartesian", "svg", "symbols", "errorBarsOK", "showLegend", "scatter-like", "zoomScale" ], meta: { description: [ "The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.", "The data visualized as scatter point or lines is set in `x` and `y`.", "Text (appearing either on the chart or on hover only) is via `text`.", "Bubble charts are achieved by setting `marker.size` and/or `marker.color`", "to numerical arrays." ].join(" ") } }, xre = sn, bre = rn, yA = h8, lb = Ue, wre = lb.strScale, _re = lb.strRotate, kre = lb.strTranslate, Tre = function(e, t, n) { var r = e.node(), a = yA[n.arrowhead || 0], i = yA[n.startarrowhead || 0], o = (n.arrowwidth || 1) * (n.arrowsize || 1), l = (n.arrowwidth || 1) * (n.startarrowsize || 1), s = t.indexOf("start") >= 0, c = t.indexOf("end") >= 0, u = a.backoff * o + n.standoff, f = i.backoff * l + n.startstandoff, h, g, p, v; if (r.nodeName === "line") { h = { x: +e.attr("x1"), y: +e.attr("y1") }, g = { x: +e.attr("x2"), y: +e.attr("y2") }; var y = h.x - g.x, m = h.y - g.y; if (p = Math.atan2(m, y), v = p + Math.PI, u && f && u + f > Math.sqrt(y * y + m * m)) { N(); return; } if (u) { if (u * u > y * y + m * m) { N(); return; } var b = u * Math.cos(p), w = u * Math.sin(p); g.x += b, g.y += w, e.attr({ x2: g.x, y2: g.y }); } if (f) { if (f * f > y * y + m * m) { N(); return; } var _ = f * Math.cos(p), k = f * Math.sin(p); h.x -= _, h.y -= k, e.attr({ x1: h.x, y1: h.y }); } } else if (r.nodeName === "path") { var T = r.getTotalLength(), O = ""; if (T < u + f) { N(); return; } var M = r.getPointAtLength(0), C = r.getPointAtLength(0.1); p = Math.atan2(M.y - C.y, M.x - C.x), h = r.getPointAtLength(Math.min(f, T)), O = "0px," + f + "px,"; var I = r.getPointAtLength(T), j = r.getPointAtLength(T - 0.1); v = Math.atan2(I.y - j.y, I.x - j.x), g = r.getPointAtLength(Math.max(0, T - u)); var P = O ? f + u : u; O += T - P + "px," + T + "px", e.style("stroke-dasharray", O); } function N() { e.style("stroke-dasharray", "0px,100px"); } function W(J, U, E, z) { J.path && (J.noRotate && (E = 0), xre.select(r.parentNode).append("path").attr({ class: e.attr("class"), d: J.path, transform: kre(U.x, U.y) + _re(E * 180 / Math.PI) + wre(z) }).style({ fill: bre.rgb(n.arrowcolor), "stroke-width": 0 })); } s && W(i, h, p, l), c && W(a, g, v, o); }, xA = sn, tm = Rt, Are = kr, Go = Ue, nm = Go.strTranslate, zd = Ln, Il = rn, oo = Cn, bA = Ao, rm = Ir, am = bs, Hu = Xi, Mre = Sn.arrayEditor, Sre = Tre, sb = { draw: Cre, drawOne: uO, drawRaw: dO }; function Cre(e) { var t = e._fullLayout; t._infolayer.selectAll(".annotation").remove(); for (var n = 0; n < t.annotations.length; n++) t.annotations[n].visible && uO(e, n); return Are.previousPromises(e); } function uO(e, t) { var n = e._fullLayout, r = n.annotations[t] || {}, a = zd.getFromId(e, r.xref), i = zd.getFromId(e, r.yref); a && a.setScale(), i && i.setScale(), dO(e, r, t, !1, a, i); } function Ho(e, t, n, r, a) { var i = a[n], o = a[n + "ref"], l = n.indexOf("y") !== -1, s = zd.getRefType(o) === "domain", c = l ? r.h : r.w; return e ? s ? i + (l ? -t : t) / e._length : e.p2r(e.r2p(i) + t) : i + (l ? -t : t) / c; } function dO(e, t, n, r, a, i) { var o = e._fullLayout, l = e._fullLayout._size, s = e._context.edits, c, u; r ? (c = "annotation-" + r, u = r + ".annotations") : (c = "annotation", u = "annotations"); var f = Mre(e.layout, u, t), h = f.modifyBase, g = f.modifyItem, p = f.getUpdateObj; o._infolayer.selectAll("." + c + '[data-index="' + n + '"]').remove(); var v = "clip" + o._uid + "_ann" + n; if (!t._input || t.visible === !1) { xA.selectAll("#" + v).remove(); return; } var y = { x: {}, y: {} }, m = +t.textangle || 0, b = o._infolayer.append("g").classed(c, !0).attr("data-index", String(n)).style("opacity", t.opacity), w = b.append("g").classed("annotation-text-g", !0), _ = s[t.showarrow ? "annotationTail" : "annotationPosition"], k = t.captureevents || s.annotationText || _; function T(F) { var q = { index: n, annotation: t._input, fullAnnotation: t, event: F }; return r && (q.subplotId = r), q; } var O = w.append("g").style("pointer-events", k ? "all" : null).call(am, "pointer").on("click", function() { e._dragging = !1, e.emit("plotly_clickannotation", T(xA.event)); }); t.hovertext && O.on("mouseover", function() { var F = t.hoverlabel, q = F.font, H = this.getBoundingClientRect(), K = e.getBoundingClientRect(); bA.loneHover({ x0: H.left - K.left, x1: H.right - K.left, y: (H.top + H.bottom) / 2 - K.top, text: t.hovertext, color: F.bgcolor, borderColor: F.bordercolor, fontFamily: q.family, fontSize: q.size, fontColor: q.color }, { container: o._hoverlayer.node(), outerContainer: o._paper.node(), gd: e }); }).on("mouseout", function() { bA.loneUnhover(o._hoverlayer.node()); }); var M = t.borderwidth, C = t.borderpad, I = M + C, j = O.append("rect").attr("class", "bg").style("stroke-width", M + "px").call(Il.stroke, t.bordercolor).call(Il.fill, t.bgcolor), P = t.width || t.height, N = o._topclips.selectAll("#" + v).data(P ? [0] : []); N.enter().append("clipPath").classed("annclip", !0).attr("id", v).append("rect"), N.exit().remove(); var W = t.font, J = o._meta ? Go.templateString(t.text, o._meta) : t.text, U = O.append("text").classed("annotation-text", !0).text(J); function E(F) { return F.call(oo.font, W).attr({ "text-anchor": { left: "start", right: "end" }[t.align] || "middle" }), rm.convertToTspans(F, e, z), F; } function z() { var F = U.selectAll("a"); if (F.size() === 1 && F.text() === U.text()) { var q = O.insert("a", ":first-child").attr({ "xlink:xlink:href": F.attr("xlink:href"), "xlink:xlink:show": F.attr("xlink:show") }).style({ cursor: "pointer" }); q.node().appendChild(j.node()); } var H = O.select(".annotation-text-math-group"), K = !H.empty(), Q = oo.bBox( (K ? H : U).node() ), re = Q.width, te = Q.height, X = t.width || re, ce = t.height || te, B = Math.round(X + 2 * I), G = Math.round(ce + 2 * I); function Z(et, ft) { return ft === "auto" && (et < 1 / 3 ? ft = "left" : et > 2 / 3 ? ft = "right" : ft = "center"), { center: 0, middle: 0, left: 0.5, bottom: -0.5, right: -0.5, top: 0.5 }[ft]; } for (var oe = !1, ae = ["x", "y"], ge = 0; ge < ae.length; ge++) { var ve = ae[ge], pe = t[ve + "ref"] || ve, ye = t["a" + ve + "ref"], Oe = { x: a, y: i }[ve], Be = (m + (ve === "x" ? 0 : -90)) * Math.PI / 180, Ie = B * Math.cos(Be), Fe = G * Math.sin(Be), Re = Math.abs(Ie) + Math.abs(Fe), We = t[ve + "anchor"], Ce = t[ve + "shift"] * (ve === "x" ? 1 : -1), Ve = y[ve], Ke, Xe, ct, vt, lt, ut = zd.getRefType(pe); if (Oe && ut !== "domain") { var dt = Oe.r2fraction(t[ve]); (dt < 0 || dt > 1) && (ye === pe ? (dt = Oe.r2fraction(t["a" + ve]), (dt < 0 || dt > 1) && (oe = !0)) : oe = !0), Ke = Oe._offset + Oe.r2p(t[ve]), vt = 0.5; } else { var Pe = ut === "domain"; ve === "x" ? (ct = t[ve], Ke = Pe ? Oe._offset + Oe._length * ct : Ke = l.l + l.w * ct) : (ct = 1 - t[ve], Ke = Pe ? Oe._offset + Oe._length * ct : Ke = l.t + l.h * ct), vt = t.showarrow ? 0.5 : ct; } if (t.showarrow) { Ve.head = Ke; var ze = t["a" + ve]; if (lt = Ie * Z(0.5, t.xanchor) - Fe * Z(0.5, t.yanchor), ye === pe) { var Ne = zd.getRefType(ye); Ne === "domain" ? (ve === "y" && (ze = 1 - ze), Ve.tail = Oe._offset + Oe._length * ze) : Ne === "paper" ? ve === "y" ? (ze = 1 - ze, Ve.tail = l.t + l.h * ze) : Ve.tail = l.l + l.w * ze : Ve.tail = Oe._offset + Oe.r2p(ze), Xe = lt; } else Ve.tail = Ke + ze, Xe = lt + ze; Ve.text = Ve.tail + lt; var nt = o[ve === "x" ? "width" : "height"]; if (pe === "paper" && (Ve.head = Go.constrain(Ve.head, 1, nt - 1)), ye === "pixel") { var Qe = -Math.max(Ve.tail - 3, Ve.text), it = Math.min(Ve.tail + 3, Ve.text) - nt; Qe > 0 ? (Ve.tail += Qe, Ve.text += Qe) : it > 0 && (Ve.tail -= it, Ve.text -= it); } Ve.tail += Ce, Ve.head += Ce; } else lt = Re * Z(vt, We), Xe = lt, Ve.text = Ke + lt; Ve.text += Ce, lt += Ce, Xe += Ce, t["_" + ve + "padplus"] = Re / 2 + Xe, t["_" + ve + "padminus"] = Re / 2 - Xe, t["_" + ve + "size"] = Re, t["_" + ve + "shift"] = lt; } if (oe) { O.remove(); return; } var rt = 0, bt = 0; if (t.align !== "left" && (rt = (X - re) * (t.align === "center" ? 0.5 : 1)), t.valign !== "top" && (bt = (ce - te) * (t.valign === "middle" ? 0.5 : 1)), K) H.select("svg").attr({ x: I + rt - 1, y: I + bt }).call(oo.setClipUrl, P ? v : null, e); else { var je = I + bt - Q.top, tt = I + rt - Q.left; U.call(rm.positionText, tt, je).call(oo.setClipUrl, P ? v : null, e); } N.select("rect").call( oo.setRect, I, I, X, ce ), j.call( oo.setRect, M / 2, M / 2, B - M, G - M ), O.call( oo.setTranslate, Math.round(y.x.text - B / 2), Math.round(y.y.text - G / 2) ), w.attr({ transform: "rotate(" + m + "," + y.x.text + "," + y.y.text + ")" }); var pt = function(et, ft) { b.selectAll(".annotation-arrow-g").remove(); var $e = y.x.head, Lt = y.y.head, $ = y.x.tail + et, se = y.y.tail + ft, ie = y.x.text + et, de = y.y.text + ft, Te = Go.rotationXYMatrix(m, ie, de), xe = Go.apply2DTransform(Te), Ge = Go.apply2DTransform2(Te), qe = +j.attr("width"), De = +j.attr("height"), le = ie - 0.5 * qe, Se = le + qe, He = de - 0.5 * De, Je = He + De, Dt = [ [le, He, le, Je], [le, Je, Se, Je], [Se, Je, Se, He], [Se, He, le, He] ].map(Ge); if (!Dt.reduce(function(Ot, qt) { return Ot ^ !!Go.segmentsIntersect( $e, Lt, $e + 1e6, Lt + 1e6, qt[0], qt[1], qt[2], qt[3] ); }, !1)) { Dt.forEach(function(Ot) { var qt = Go.segmentsIntersect( $, se, $e, Lt, Ot[0], Ot[1], Ot[2], Ot[3] ); qt && ($ = qt.x, se = qt.y); }); var zt = t.arrowwidth, Pt = t.arrowcolor, _t = t.arrowside, $t = b.append("g").style({ opacity: Il.opacity(Pt) }).classed("annotation-arrow-g", !0), Nt = $t.append("path").attr("d", "M" + $ + "," + se + "L" + $e + "," + Lt).style("stroke-width", zt + "px").call(Il.stroke, Il.rgb(Pt)); if (Sre(Nt, _t, t), s.annotationPosition && Nt.node().parentNode && !r) { var wt = $e, Yt = Lt; if (t.standoff) { var Jt = Math.sqrt(Math.pow($e - $, 2) + Math.pow(Lt - se, 2)); wt += t.standoff * ($ - $e) / Jt, Yt += t.standoff * (se - Lt) / Jt; } var jt = $t.append("path").classed("annotation-arrow", !0).classed("anndrag", !0).classed("cursor-move", !0).attr({ d: "M3,3H-3V-3H3ZM0,0L" + ($ - wt) + "," + (se - Yt), transform: nm(wt, Yt) }).style("stroke-width", zt + 6 + "px").call(Il.stroke, "rgba(0,0,0,0)").call(Il.fill, "rgba(0,0,0,0)"), Et, At; Hu.init({ element: jt.node(), gd: e, prepFn: function() { var Ot = oo.getTranslate(O); Et = Ot.x, At = Ot.y, a && a.autorange && h(a._name + ".autorange", !0), i && i.autorange && h(i._name + ".autorange", !0); }, moveFn: function(Ot, qt) { var dn = xe(Et, At), Mt = dn[0] + Ot, tn = dn[1] + qt; O.call(oo.setTranslate, Mt, tn), g( "x", Ho(a, Ot, "x", l, t) ), g( "y", Ho(i, qt, "y", l, t) ), t.axref === t.xref && g("ax", Ho(a, Ot, "ax", l, t)), t.ayref === t.yref && g("ay", Ho(i, qt, "ay", l, t)), $t.attr("transform", nm(Ot, qt)), w.attr({ transform: "rotate(" + m + "," + Mt + "," + tn + ")" }); }, doneFn: function() { tm.call("_guiRelayout", e, p()); var Ot = document.querySelector(".js-notes-box-panel"); Ot && Ot.redraw(Ot.selectedObj); } }); } } }; if (t.showarrow && pt(0, 0), _) { var kt; Hu.init({ element: O.node(), gd: e, prepFn: function() { kt = w.attr("transform"); }, moveFn: function(et, ft) { var $e = "pointer"; if (t.showarrow) t.axref === t.xref ? g("ax", Ho(a, et, "ax", l, t)) : g("ax", t.ax + et), t.ayref === t.yref ? g("ay", Ho(i, ft, "ay", l.w, t)) : g("ay", t.ay + ft), pt(et, ft); else { if (r) return; var Lt, $; if (a) Lt = Ho(a, et, "x", l, t); else { var se = t._xsize / l.w, ie = t.x + (t._xshift - t.xshift) / l.w - se / 2; Lt = Hu.align( ie + et / l.w, se, 0, 1, t.xanchor ); } if (i) $ = Ho(i, ft, "y", l, t); else { var de = t._ysize / l.h, Te = t.y - (t._yshift + t.yshift) / l.h - de / 2; $ = Hu.align( Te - ft / l.h, de, 0, 1, t.yanchor ); } g("x", Lt), g("y", $), (!a || !i) && ($e = Hu.getCursor( a ? 0.5 : Lt, i ? 0.5 : $, t.xanchor, t.yanchor )); } w.attr({ transform: nm(et, ft) + kt }), am(O, $e); }, clickFn: function(et, ft) { t.captureevents && e.emit("plotly_clickannotation", T(ft)); }, doneFn: function() { am(O), tm.call("_guiRelayout", e, p()); var et = document.querySelector(".js-notes-box-panel"); et && et.redraw(et.selectedObj); } }); } } s.annotationText ? U.call(rm.makeEditable, { delegate: O, gd: e }).call(E).on("edit", function(F) { t.text = F, this.call(E), g("text", F), a && a.autorange && h(a._name + ".autorange", !0), i && i.autorange && h(i._name + ".autorange", !0), tm.call("_guiRelayout", e, p()); }) : U.call(E); } var wA = Ue, Lre = Rt, _A = Sn.arrayEditor, Ore = { hasClickToShow: Dre, onClick: Fre }; function Dre(e, t) { var n = fO(e, t); return n.on.length > 0 || n.explicitOff.length > 0; } function Fre(e, t) { var n = fO(e, t), r = n.on, a = n.off.concat(n.explicitOff), i = {}, o = e._fullLayout.annotations, l, s; if (r.length || a.length) { for (l = 0; l < r.length; l++) s = _A(e.layout, "annotations", o[r[l]]), s.modifyItem("visible", !0), wA.extendFlat(i, s.getUpdateObj()); for (l = 0; l < a.length; l++) s = _A(e.layout, "annotations", o[a[l]]), s.modifyItem("visible", !1), wA.extendFlat(i, s.getUpdateObj()); return Lre.call("update", e, {}, i); } } function fO(e, t) { var n = e._fullLayout.annotations, r = [], a = [], i = [], o = (t || []).length, l, s, c, u, f, h, g, p; for (l = 0; l < n.length; l++) if (c = n[l], u = c.clicktoshow, u) { for (s = 0; s < o; s++) if (f = t[s], h = f.xaxis, g = f.yaxis, h._id === c.xref && g._id === c.yref && h.d2r(f.x) === kA(c._xclick, h) && g.d2r(f.y) === kA(c._yclick, g)) { c.visible ? u === "onout" ? p = a : p = i : p = r, p.push(l); break; } s === o && c.visible && u === "onout" && a.push(l); } return { on: r, off: a, explicitOff: i }; } function kA(e, t) { return t.type === "log" ? t.l2r(e) : t.d2r(e); } var TA = Ue, qs = rn, hO = function(e, t, n, r) { r("opacity"); var a = r("bgcolor"), i = r("bordercolor"), o = qs.opacity(i); r("borderpad"); var l = r("borderwidth"), s = r("showarrow"); r("text", s ? " " : n._dfltTitle.annotation), r("textangle"), TA.coerceFont(r, "font", n.font), r("width"), r("align"); var c = r("height"); if (c && r("valign"), s) { var u = r("arrowside"), f, h; u.indexOf("end") !== -1 && (f = r("arrowhead"), h = r("arrowsize")), u.indexOf("start") !== -1 && (r("startarrowhead", f), r("startarrowsize", h)), r("arrowcolor", o ? t.bordercolor : qs.defaultLine), r("arrowwidth", (o && l || 1) * 2), r("standoff"), r("startstandoff"); } var g = r("hovertext"), p = n.hoverlabel || {}; if (g) { var v = r( "hoverlabel.bgcolor", p.bgcolor || (qs.opacity(a) ? qs.rgb(a) : qs.defaultLine) ), y = r( "hoverlabel.bordercolor", p.bordercolor || qs.contrast(v) ); TA.coerceFont(r, "hoverlabel.font", { family: p.font.family, size: p.font.size, color: p.font.color || y }); } r("captureevents", !!g); }, im = Ue, zl = Ln, Ire = Qi, zre = hO, Ere = ef, jre = function(e, t) { Ire(e, t, { name: "annotations", handleItemDefaults: Pre }); }; function Pre(e, t, n) { function r(w, _) { return im.coerce(e, t, Ere, w, _); } var a = r("visible"), i = r("clicktoshow"); if (a || i) { zre(e, t, n, r); for (var o = t.showarrow, l = ["x", "y"], s = [-10, -30], c = { _fullLayout: n }, u = 0; u < 2; u++) { var f = l[u], h = zl.coerceRef(e, t, c, f, "", "paper"); if (h !== "paper") { var g = zl.getFromId(c, h); g._annIndices.push(t._index); } if (zl.coercePosition(t, c, r, h, f, 0.5), o) { var p = "a" + f, v = zl.coerceRef( e, t, c, p, "pixel", ["pixel", "paper"] ); v !== "pixel" && v !== h && (v = t[p] = "pixel"); var y = v === "pixel" ? s[u] : 0.4; zl.coercePosition(t, c, r, v, p, y); } r(f + "anchor"), r(f + "shift"); } if (im.noneOrAll(e, t, ["x", "y"]), o && im.noneOrAll(e, t, ["ax", "ay"]), i) { var m = r("xclick"), b = r("yclick"); t._xclick = m === void 0 ? t.x : zl.cleanPosition(m, c, t.xref), t._yclick = b === void 0 ? t.y : zl.cleanPosition(b, c, t.yref); } } } var Uy = Ue, Vl = Ln, Rre = sb.draw, Nre = function(e) { var t = e._fullLayout, n = Uy.filterVisible(t.annotations); if (n.length && e._fullData.length) return Uy.syncOrAsync([Rre, Bre], e); }; function Bre(e) { var t = e._fullLayout; Uy.filterVisible(t.annotations).forEach(function(n) { var r = Vl.getFromId(e, n.xref), a = Vl.getFromId(e, n.yref), i = Vl.getRefType(n.xref), o = Vl.getRefType(n.yref); n._extremes = {}, i === "range" && AA(n, r), o === "range" && AA(n, a); }); } function AA(e, t) { var n = t._id, r = n.charAt(0), a = e[r], i = e["a" + r], o = e[r + "ref"], l = e["a" + r + "ref"], s = e["_" + r + "padplus"], c = e["_" + r + "padminus"], u = { x: 1, y: -1 }[r] * e[r + "shift"], f = 3 * e.arrowsize * e.arrowwidth || 0, h = f + u, g = f - u, p = 3 * e.startarrowsize * e.arrowwidth || 0, v = p + u, y = p - u, m; if (l === o) { var b = Vl.findExtremes(t, [t.r2c(a)], { ppadplus: h, ppadminus: g }), w = Vl.findExtremes(t, [t.r2c(i)], { ppadplus: Math.max(s, v), ppadminus: Math.max(c, y) }); m = { min: [b.min[0], w.min[0]], max: [b.max[0], w.max[0]] }; } else v = i ? v + i : v, y = i ? y - i : y, m = Vl.findExtremes(t, [t.r2c(a)], { ppadplus: Math.max(s, h, v), ppadminus: Math.max(c, g, y) }); e._extremes[n] = m; } var Hre = cn, Vre = N1, qre = function(e, t, n, r) { t = t || {}; var a = n === "log" && t.type === "linear", i = n === "linear" && t.type === "log"; if (!(a || i)) return; var o = e._fullLayout.annotations, l = t._id.charAt(0), s, c; function u(h) { var g = s[h], p = null; a ? p = Vre(g, t.range) : p = Math.pow(10, g), Hre(p) || (p = null), r(c + h, p); } for (var f = 0; f < o.length; f++) s = o[f], c = "annotations[" + f + "].", s[l + "ref"] === t._id && u(l), s["a" + l + "ref"] === t._id && u("a" + l); }, om = sb, MA = Ore, Ure = { moduleType: "component", name: "annotations", layoutAttributes: ef, supplyLayoutDefaults: jre, includeBasePlot: W0("annotations"), calcAutorange: Nre, draw: om.draw, drawOne: om.drawOne, drawRaw: om.drawRaw, hasClickToShow: MA.hasClickToShow, onClick: MA.onClick, convertCoords: qre }, Fn = ef, Gre = Lo.overrideAll, Wre = Sn.templatedArray, Gy = Gre(Wre("annotation", { visible: Fn.visible, x: { valType: "any", description: [ "Sets the annotation's x position." ].join(" ") }, y: { valType: "any", description: [ "Sets the annotation's y position." ].join(" ") }, z: { valType: "any", description: [ "Sets the annotation's z position." ].join(" ") }, ax: { valType: "number", description: [ "Sets the x component of the arrow tail about the arrow head (in pixels)." ].join(" ") }, ay: { valType: "number", description: [ "Sets the y component of the arrow tail about the arrow head (in pixels)." ].join(" ") }, xanchor: Fn.xanchor, xshift: Fn.xshift, yanchor: Fn.yanchor, yshift: Fn.yshift, text: Fn.text, textangle: Fn.textangle, font: Fn.font, width: Fn.width, height: Fn.height, opacity: Fn.opacity, align: Fn.align, valign: Fn.valign, bgcolor: Fn.bgcolor, bordercolor: Fn.bordercolor, borderpad: Fn.borderpad, borderwidth: Fn.borderwidth, showarrow: Fn.showarrow, arrowcolor: Fn.arrowcolor, arrowhead: Fn.arrowhead, startarrowhead: Fn.startarrowhead, arrowside: Fn.arrowside, arrowsize: Fn.arrowsize, startarrowsize: Fn.startarrowsize, arrowwidth: Fn.arrowwidth, standoff: Fn.standoff, startstandoff: Fn.startstandoff, hovertext: Fn.hovertext, hoverlabel: Fn.hoverlabel, captureevents: Fn.captureevents // maybes later? // clicktoshow: annAttrs.clicktoshow, // xclick: annAttrs.xclick, // yclick: annAttrs.yclick, // not needed! // axref: 'pixel' // ayref: 'pixel' // xref: 'x' // yref: 'y // zref: 'z' }), "calc", "from-root"), lm = Ue, Zre = Ln, Yre = Qi, $re = hO, Kre = Gy, Jre = function(e, t, n) { Yre(e, t, { name: "annotations", handleItemDefaults: Qre, fullLayout: n.fullLayout }); }; function Qre(e, t, n, r) { function a(l, s) { return lm.coerce(e, t, Kre, l, s); } function i(l) { var s = l + "axis", c = { _fullLayout: {} }; return c._fullLayout[s] = n[s], Zre.coercePosition(t, c, a, l, l, 0.5); } var o = a("visible"); o && ($re(e, t, r.fullLayout, a), i("x"), i("y"), i("z"), lm.noneOrAll(e, t, ["x", "y", "z"]), t.xref = "x", t.yref = "y", t.zref = "z", a("xanchor"), a("yanchor"), a("xshift"), a("yshift"), t.showarrow && (t.axref = "pixel", t.ayref = "pixel", a("ax", -10), a("ay", -30), lm.noneOrAll(e, t, ["ax", "ay"]))); } var SA = Ue, CA = Ln, Xre = function(e) { for (var t = e.fullSceneLayout, n = t.annotations, r = 0; r < n.length; r++) eae(n[r], e); e.fullLayout._infolayer.selectAll(".annotation-" + e.id).remove(); }; function eae(e, t) { var n = t.fullSceneLayout, r = n.domain, a = t.fullLayout._size, i = { // this gets fill in on render pdata: null, // to get setConvert to not execute cleanly type: "linear", // don't try to update them on `editable: true` autorange: !1, // set infinite range so that annotation draw routine // does not try to remove 'outside-range' annotations, // this case is handled in the render loop range: [-1 / 0, 1 / 0] }; e._xa = {}, SA.extendFlat(e._xa, i), CA.setConvert(e._xa), e._xa._offset = a.l + r.x[0] * a.w, e._xa.l2p = function() { return 0.5 * (1 + e._pdata[0] / e._pdata[3]) * a.w * (r.x[1] - r.x[0]); }, e._ya = {}, SA.extendFlat(e._ya, i), CA.setConvert(e._ya), e._ya._offset = a.t + (1 - r.y[1]) * a.h, e._ya.l2p = function() { return 0.5 * (1 - e._pdata[1] / e._pdata[3]) * a.h * (r.y[1] - r.y[0]); }; } function sm(e, t) { var n = [0, 0, 0, 0], r, a; for (r = 0; r < 4; ++r) for (a = 0; a < 4; ++a) n[a] += e[4 * r + a] * t[r]; return n; } function tae(e, t) { var n = sm( e.projection, sm( e.view, sm(e.model, [t[0], t[1], t[2], 1]) ) ); return n; } var nae = tae, rae = sb.drawRaw, aae = nae, iae = ["x", "y", "z"], oae = function(e) { for (var t = e.fullSceneLayout, n = e.dataScale, r = t.annotations, a = 0; a < r.length; a++) { for (var i = r[a], o = !1, l = 0; l < 3; l++) { var s = iae[l], c = i[s], u = t[s + "axis"], f = u.r2fraction(c); if (f < 0 || f > 1) { o = !0; break; } } o ? e.fullLayout._infolayer.select(".annotation-" + e.id + '[data-index="' + a + '"]').remove() : (i._pdata = aae(e.glplot.cameraParams, [ t.xaxis.r2l(i.x) * n[0], t.yaxis.r2l(i.y) * n[1], t.zaxis.r2l(i.z) * n[2] ]), rae(e.graphDiv, i, a, e.id, i._xa, i._ya)); } }, lae = Rt, LA = Ue, sae = { moduleType: "component", name: "annotations3d", schema: { subplots: { scene: { annotations: Gy } } }, layoutAttributes: Gy, handleDefaults: Jre, includeBasePlot: cae, convert: Xre, draw: oae }; function cae(e, t) { var n = lae.subplotsRegistry.gl3d; if (n) for (var r = n.attrRegex, a = Object.keys(e), i = 0; i < a.length; i++) { var o = a[i]; r.test(o) && (e[o].annotations || []).length && (LA.pushUnique(t._basePlotModules, n), LA.pushUnique(t._subplots.gl3d, o)); } } var OA = ef, DA = Fr, FA = ws.line, uae = Yi.dash, ni = tr.extendFlat, dae = Sn.templatedArray, IA = G0, Us = Zi, fae = bi.shapeTexttemplateAttrs, hae = Z1, pO = dae("shape", { visible: ni({}, Us.visible, { editType: "calc+arraydraw", description: [ "Determines whether or not this shape is visible.", "If *legendonly*, the shape is not drawn,", "but can appear as a legend item", "(provided that the legend itself is visible)." ].join(" ") }), showlegend: { valType: "boolean", dflt: !1, editType: "calc+arraydraw", description: [ "Determines whether or not this", "shape is shown in the legend." ].join(" ") }, legend: ni({}, Us.legend, { editType: "calc+arraydraw", description: [ "Sets the reference to a legend to show this shape in.", "References to these legends are *legend*, *legend2*, *legend3*, etc.", "Settings for these legends are set in the layout, under", "`layout.legend`, `layout.legend2`, etc." ].join(" ") }), legendgroup: ni({}, Us.legendgroup, { editType: "calc+arraydraw", description: [ "Sets the legend group for this shape.", "Traces and shapes part of the same legend group hide/show at the same time", "when toggling legend items." ].join(" ") }), legendgrouptitle: { text: ni({}, Us.legendgrouptitle.text, { editType: "calc+arraydraw" }), font: DA({ editType: "calc+arraydraw", description: [ "Sets this legend group's title font." ].join(" ") }), editType: "calc+arraydraw" }, legendrank: ni({}, Us.legendrank, { editType: "calc+arraydraw", description: [ "Sets the legend rank for this shape.", "Items and groups with smaller ranks are presented on top/left side while", "with *reversed* `legend.traceorder` they are on bottom/right side.", "The default legendrank is 1000,", "so that you can use ranks less than 1000 to place certain items before all unranked items,", "and ranks greater than 1000 to go after all unranked items.", "When having unranked or equal rank items shapes would be displayed after traces", "i.e. according to their order in data and layout." ].join(" ") }), legendwidth: ni({}, Us.legendwidth, { editType: "calc+arraydraw", description: "Sets the width (in px or fraction) of the legend for this shape." }), type: { valType: "enumerated", values: ["circle", "rect", "path", "line"], editType: "calc+arraydraw", description: [ "Specifies the shape type to be drawn.", "If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)", "with respect to the axes' sizing mode.", "If *circle*, a circle is drawn from", "((`x0`+`x1`)/2, (`y0`+`y1`)/2))", "with radius", "(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)", "with respect to the axes' sizing mode.", "If *rect*, a rectangle is drawn linking", "(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)", "with respect to the axes' sizing mode.", "If *path*, draw a custom SVG path using `path`.", "with respect to the axes' sizing mode." ].join(" ") }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", editType: "arraydraw", description: "Specifies whether shapes are drawn below or above traces." }, xref: ni({}, OA.xref, { description: [ "Sets the shape's x coordinate axis.", IA.axisRefDescription("x", "left", "right") ].join(" ") }), xsizemode: { valType: "enumerated", values: ["scaled", "pixel"], dflt: "scaled", editType: "calc+arraydraw", description: [ "Sets the shapes's sizing mode along the x axis.", "If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to", "data values on the x axis or a fraction of the plot area's width", "(`xref` set to *paper*).", "If set to *pixel*, `xanchor` specifies the x position in terms", "of data or plot fraction but `x0`, `x1` and x coordinates within `path`", "are pixels relative to `xanchor`. This way, the shape can have", "a fixed width while maintaining a position relative to data or", "plot fraction." ].join(" ") }, xanchor: { valType: "any", editType: "calc+arraydraw", description: [ "Only relevant in conjunction with `xsizemode` set to *pixel*.", "Specifies the anchor point on the x axis to which `x0`, `x1`", "and x coordinates within `path` are relative to.", "E.g. useful to attach a pixel sized shape to a certain data value.", "No effect when `xsizemode` not set to *pixel*." ].join(" ") }, x0: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's starting x position.", "See `type` and `xsizemode` for more info." ].join(" ") }, x1: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's end x position.", "See `type` and `xsizemode` for more info." ].join(" ") }, yref: ni({}, OA.yref, { description: [ "Sets the shape's y coordinate axis.", IA.axisRefDescription("y", "bottom", "top") ].join(" ") }), ysizemode: { valType: "enumerated", values: ["scaled", "pixel"], dflt: "scaled", editType: "calc+arraydraw", description: [ "Sets the shapes's sizing mode along the y axis.", "If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to", "data values on the y axis or a fraction of the plot area's height", "(`yref` set to *paper*).", "If set to *pixel*, `yanchor` specifies the y position in terms", "of data or plot fraction but `y0`, `y1` and y coordinates within `path`", "are pixels relative to `yanchor`. This way, the shape can have", "a fixed height while maintaining a position relative to data or", "plot fraction." ].join(" ") }, yanchor: { valType: "any", editType: "calc+arraydraw", description: [ "Only relevant in conjunction with `ysizemode` set to *pixel*.", "Specifies the anchor point on the y axis to which `y0`, `y1`", "and y coordinates within `path` are relative to.", "E.g. useful to attach a pixel sized shape to a certain data value.", "No effect when `ysizemode` not set to *pixel*." ].join(" ") }, y0: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's starting y position.", "See `type` and `ysizemode` for more info." ].join(" ") }, y1: { valType: "any", editType: "calc+arraydraw", description: [ "Sets the shape's end y position.", "See `type` and `ysizemode` for more info." ].join(" ") }, path: { valType: "string", editType: "calc+arraydraw", description: [ "For `type` *path* - a valid SVG path with the pixel values", "replaced by data values in `xsizemode`/`ysizemode` being *scaled*", "and taken unmodified as pixels relative to `xanchor` and `yanchor`", "in case of *pixel* size mode.", "There are a few restrictions / quirks", "only absolute instructions, not relative. So the allowed segments", "are: M, L, H, V, Q, C, T, S, and Z", "arcs (A) are not allowed because radius rx and ry are relative.", "In the future we could consider supporting relative commands,", "but we would have to decide on how to handle date and log axes.", "Note that even as is, Q and C Bezier paths that are smooth on", "linear axes may not be smooth on log, and vice versa.", 'no chained "polybezier" commands - specify the segment type for', "each one.", "On category axes, values are numbers scaled to the serial numbers", "of categories because using the categories themselves there would", "be no way to describe fractional positions", "On data axes: because space and T are both normal components of path", "strings, we can't use either to separate date from time parts.", "Therefore we'll use underscore for this purpose:", "2015-02-21_13:45:56.789" ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the shape." }, line: { color: ni({}, FA.color, { editType: "arraydraw" }), width: ni({}, FA.width, { editType: "calc+arraydraw" }), dash: ni({}, uae, { editType: "arraydraw" }), editType: "calc+arraydraw" }, fillcolor: { valType: "color", dflt: "rgba(0,0,0,0)", editType: "arraydraw", description: [ "Sets the color filling the shape's interior. Only applies to closed shapes." ].join(" ") }, fillrule: { valType: "enumerated", values: ["evenodd", "nonzero"], dflt: "evenodd", editType: "arraydraw", description: [ "Determines which regions of complex paths constitute the interior.", "For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule" ].join(" ") }, editable: { valType: "boolean", dflt: !1, editType: "calc+arraydraw", description: [ "Determines whether the shape could be activated for edit or not.", "Has no effect when the older editable shapes mode is enabled via", "`config.editable` or `config.edits.shapePosition`." ].join(" ") }, label: { text: { valType: "string", dflt: "", editType: "arraydraw", description: [ "Sets the text to display with shape.", "It is also used for legend item if `name` is not provided." ].join(" ") }, texttemplate: fae({}, { keys: Object.keys(hae) }), font: DA({ editType: "calc+arraydraw", colorEditType: "arraydraw", description: "Sets the shape label text font." }), textposition: { valType: "enumerated", values: [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right", "start", "middle", "end" ], editType: "arraydraw", description: [ "Sets the position of the label text relative to the shape.", "Supported values for rectangles, circles and paths are", "*top left*, *top center*, *top right*, *middle left*,", "*middle center*, *middle right*, *bottom left*, *bottom center*,", "and *bottom right*.", "Supported values for lines are *start*, *middle*, and *end*.", "Default: *middle center* for rectangles, circles, and paths; *middle* for lines." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the angle at which the label text is drawn", "with respect to the horizontal. For lines, angle *auto*", "is the same angle as the line. For all other shapes,", "angle *auto* is horizontal." ].join(" ") }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "auto", editType: "calc+arraydraw", description: [ "Sets the label's horizontal position anchor", "This anchor binds the specified `textposition` to the *left*, *center*", "or *right* of the label text.", "For example, if `textposition` is set to *top right* and", "`xanchor` to *right* then the right-most portion of the", "label text lines up with the right-most edge of the", "shape." ].join(" ") }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], editType: "calc+arraydraw", description: [ "Sets the label's vertical position anchor", "This anchor binds the specified `textposition` to the *top*, *middle*", "or *bottom* of the label text.", "For example, if `textposition` is set to *top right* and", "`yanchor` to *top* then the top-most portion of the", "label text lines up with the top-most edge of the", "shape." ].join(" ") }, padding: { valType: "number", dflt: 3, min: 0, editType: "arraydraw", description: "Sets padding (in px) between edge of label and edge of shape." }, editType: "arraydraw" }, editType: "arraydraw" }), Vu = Ue, Gs = Ln, pae = Qi, gae = pO, zA = wl, vae = function(e, t) { pae(e, t, { name: "shapes", handleItemDefaults: yae }); }; function mae(e, t) { return e ? "bottom" : t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle"; } function yae(e, t, n) { function r(F, q) { return Vu.coerce(e, t, gae, F, q); } t._isShape = !0; var a = r("visible"); if (a) { var i = r("showlegend"); i && (r("legend"), r("legendwidth"), r("legendgroup"), r("legendgrouptitle.text"), Vu.coerceFont(r, "legendgrouptitle.font"), r("legendrank")); var o = r("path"), l = o ? "path" : "rect", s = r("type", l), c = s !== "path"; c && delete t.path, r("editable"), r("layer"), r("opacity"), r("fillcolor"), r("fillrule"); var u = r("line.width"); u && (r("line.color"), r("line.dash")); for (var f = r("xsizemode"), h = r("ysizemode"), g = ["x", "y"], p = 0; p < 2; p++) { var v = g[p], y = v + "anchor", m = v === "x" ? f : h, b = { _fullLayout: n }, w, _, k, T = Gs.coerceRef( e, t, b, v, void 0, "paper" ), O = Gs.getRefType(T); if (O === "range" ? (w = Gs.getFromId(b, T), w._shapeIndices.push(t._index), k = zA.rangeToShapePosition(w), _ = zA.shapePositionToRange(w)) : _ = k = Vu.identity, c) { var M = 0.25, C = 0.75, I = v + "0", j = v + "1", P = e[I], N = e[j]; e[I] = _(e[I], !0), e[j] = _(e[j], !0), m === "pixel" ? (r(I, 0), r(j, 10)) : (Gs.coercePosition(t, b, r, T, I, M), Gs.coercePosition(t, b, r, T, j, C)), t[I] = k(t[I]), t[j] = k(t[j]), e[I] = P, e[j] = N; } if (m === "pixel") { var W = e[y]; e[y] = _(e[y], !0), Gs.coercePosition(t, b, r, T, y, 0.25), t[y] = k(t[y]), e[y] = W; } } c && Vu.noneOrAll(e, t, ["x0", "x1", "y0", "y1"]); var J = s === "line", U, E; if (c && (U = r("label.texttemplate")), U || (E = r("label.text")), E || U) { r("label.textangle"); var z = r("label.textposition", J ? "middle" : "middle center"); r("label.xanchor"), r("label.yanchor", mae(J, z)), r("label.padding"), Vu.coerceFont(r, "label.font", n.font); } } } var xae = rn, EA = Ue; function bae(e, t) { return e ? "bottom" : t.indexOf("top") !== -1 ? "top" : t.indexOf("bottom") !== -1 ? "bottom" : "middle"; } var wae = function(e, t, n) { n("newshape.visible"), n("newshape.name"), n("newshape.showlegend"), n("newshape.legend"), n("newshape.legendwidth"), n("newshape.legendgroup"), n("newshape.legendgrouptitle.text"), EA.coerceFont(n, "newshape.legendgrouptitle.font"), n("newshape.legendrank"), n("newshape.drawdirection"), n("newshape.layer"), n("newshape.fillcolor"), n("newshape.fillrule"), n("newshape.opacity"); var r = n("newshape.line.width"); if (r) { var a = (e || {}).plot_bgcolor || "#FFF"; n("newshape.line.color", xae.contrast(a)), n("newshape.line.dash"); } var i = e.dragmode === "drawline", o = n("newshape.label.text"), l = n("newshape.label.texttemplate"); if (o || l) { n("newshape.label.textangle"); var s = n("newshape.label.textposition", i ? "middle" : "middle center"); n("newshape.label.xanchor"), n("newshape.label.yanchor", bae(i, s)), n("newshape.label.padding"), EA.coerceFont(n, "newshape.label.font", t.font); } n("activeshape.fillcolor"), n("activeshape.opacity"); }, Wy = Ue, Ws = Ln, jc = R0, gO = wl, _ae = function(e) { var t = e._fullLayout, n = Wy.filterVisible(t.shapes); if (!(!n.length || !e._fullData.length)) for (var r = 0; r < n.length; r++) { var a = n[r]; a._extremes = {}; var i, o, l = Ws.getRefType(a.xref), s = Ws.getRefType(a.yref); if (a.xref !== "paper" && l !== "domain") { var c = a.xsizemode === "pixel" ? a.xanchor : a.x0, u = a.xsizemode === "pixel" ? a.xanchor : a.x1; i = Ws.getFromId(e, a.xref), o = jA(i, c, u, a.path, jc.paramIsX), o && (a._extremes[i._id] = Ws.findExtremes(i, o, kae(a))); } if (a.yref !== "paper" && s !== "domain") { var f = a.ysizemode === "pixel" ? a.yanchor : a.y0, h = a.ysizemode === "pixel" ? a.yanchor : a.y1; i = Ws.getFromId(e, a.yref), o = jA(i, f, h, a.path, jc.paramIsY), o && (a._extremes[i._id] = Ws.findExtremes(i, o, Tae(a))); } } }; function kae(e) { return vO(e.line.width, e.xsizemode, e.x0, e.x1, e.path, !1); } function Tae(e) { return vO(e.line.width, e.ysizemode, e.y0, e.y1, e.path, !0); } function vO(e, t, n, r, a, i) { var o = e / 2, l = i; if (t === "pixel") { var s = a ? gO.extractPathCoords(a, i ? jc.paramIsY : jc.paramIsX) : [n, r], c = Wy.aggNums(Math.max, null, s), u = Wy.aggNums(Math.min, null, s), f = u < 0 ? Math.abs(u) + o : o, h = c > 0 ? c + o : o; return { ppad: o, ppadplus: l ? f : h, ppadminus: l ? h : f }; } else return { ppad: o }; } function jA(e, t, n, r, a) { var i = e.type === "category" || e.type === "multicategory" ? e.r2c : e.d2c; if (t !== void 0) return [i(t), i(n)]; if (r) { var o = 1 / 0, l = -1 / 0, s = r.match(jc.segmentRE), c, u, f, h, g; for (e.type === "date" && (i = gO.decodeDate(i)), c = 0; c < s.length; c++) u = s[c], f = a[u.charAt(0)].drawn, f !== void 0 && (h = s[c].substr(1).match(jc.paramRE), !(!h || h.length < f) && (g = i(h[f]), g < o && (o = g), g > l && (l = g))); if (l >= o) return [o, l]; } } var PA = jx, Aae = { moduleType: "component", name: "shapes", layoutAttributes: pO, supplyLayoutDefaults: vae, supplyDrawNewShapeDefaults: wae, includeBasePlot: W0("shapes"), calcAutorange: _ae, draw: PA.draw, drawOne: PA.drawOne }, RA = $r, Mae = Sn.templatedArray, NA = G0, mO = Mae("image", { visible: { valType: "boolean", dflt: !0, editType: "arraydraw", description: [ "Determines whether or not this image is visible." ].join(" ") }, source: { valType: "string", editType: "arraydraw", description: [ "Specifies the URL of the image to be used.", "The URL must be accessible from the domain where the", "plot code is run, and can be either relative or absolute." ].join(" ") }, layer: { valType: "enumerated", values: ["below", "above"], dflt: "above", editType: "arraydraw", description: [ "Specifies whether images are drawn below or above traces.", "When `xref` and `yref` are both set to `paper`,", "image is drawn below the entire plot area." ].join(" ") }, sizex: { valType: "number", dflt: 0, editType: "arraydraw", description: [ "Sets the image container size horizontally.", "The image will be sized based on the `position` value.", "When `xref` is set to `paper`, units are sized relative", "to the plot width.", "When `xref` ends with ` domain`, units are sized relative", "to the axis width." ].join(" ") }, sizey: { valType: "number", dflt: 0, editType: "arraydraw", description: [ "Sets the image container size vertically.", "The image will be sized based on the `position` value.", "When `yref` is set to `paper`, units are sized relative", "to the plot height.", "When `yref` ends with ` domain`, units are sized relative", "to the axis height." ].join(" ") }, sizing: { valType: "enumerated", values: ["fill", "contain", "stretch"], dflt: "contain", editType: "arraydraw", description: [ "Specifies which dimension of the image to constrain." ].join(" ") }, opacity: { valType: "number", min: 0, max: 1, dflt: 1, editType: "arraydraw", description: "Sets the opacity of the image." }, x: { valType: "any", dflt: 0, editType: "arraydraw", description: [ "Sets the image's x position.", "When `xref` is set to `paper`, units are sized relative", "to the plot height.", "See `xref` for more info" ].join(" ") }, y: { valType: "any", dflt: 0, editType: "arraydraw", description: [ "Sets the image's y position.", "When `yref` is set to `paper`, units are sized relative", "to the plot height.", "See `yref` for more info" ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], dflt: "left", editType: "arraydraw", description: "Sets the anchor for the x position" }, yanchor: { valType: "enumerated", values: ["top", "middle", "bottom"], dflt: "top", editType: "arraydraw", description: "Sets the anchor for the y position." }, xref: { valType: "enumerated", values: [ "paper", RA.idRegex.x.toString() ], dflt: "paper", editType: "arraydraw", description: [ "Sets the images's x coordinate axis.", NA.axisRefDescription("x", "left", "right") ].join(" ") }, yref: { valType: "enumerated", values: [ "paper", RA.idRegex.y.toString() ], dflt: "paper", editType: "arraydraw", description: [ "Sets the images's y coordinate axis.", NA.axisRefDescription("y", "bottom", "top") ].join(" ") }, editType: "arraydraw" }), Sae = Ue, cm = Ln, Cae = Qi, Lae = mO, Oae = "images", Dae = function(e, t) { var n = { name: Oae, handleItemDefaults: Fae }; Cae(e, t, n); }; function Fae(e, t, n) { function r(h, g) { return Sae.coerce(e, t, Lae, h, g); } var a = r("source"), i = r("visible", !!a); if (!i) return t; r("layer"), r("xanchor"), r("yanchor"), r("sizex"), r("sizey"), r("sizing"), r("opacity"); for (var o = { _fullLayout: n }, l = ["x", "y"], s = 0; s < 2; s++) { var c = l[s], u = cm.coerceRef(e, t, o, c, "paper", void 0); if (u !== "paper") { var f = cm.getFromId(o, u); f._imgIndices.push(t._index); } cm.coercePosition(t, o, r, u, c, 0); } return t; } var BA = sn, Iae = Cn, Zs = Ln, HA = mr, zae = yl, Eae = function(e) { var t = e._fullLayout, n = [], r = {}, a = [], i, o; for (o = 0; o < t.images.length; o++) { var l = t.images[o]; if (l.visible) if (l.layer === "below" && l.xref !== "paper" && l.yref !== "paper") { i = HA.ref2id(l.xref) + HA.ref2id(l.yref); var s = t._plots[i]; if (!s) { a.push(l); continue; } s.mainplot && (i = s.mainplot.id), r[i] || (r[i] = []), r[i].push(l); } else l.layer === "above" ? n.push(l) : a.push(l); } var c = { x: { left: { sizing: "xMin", offset: 0 }, center: { sizing: "xMid", offset: -1 / 2 }, right: { sizing: "xMax", offset: -1 } }, y: { top: { sizing: "YMin", offset: 0 }, middle: { sizing: "YMid", offset: -1 / 2 }, bottom: { sizing: "YMax", offset: -1 } } }; function u(m) { var b = BA.select(this); if (this._imgSrc !== m.source) if (b.attr("xmlns", zae.svg), m.source && m.source.slice(0, 5) === "data:") b.attr("xlink:href", m.source), this._imgSrc = m.source; else { var w = new Promise((function(_) { var k = new Image(); this.img = k, k.setAttribute("crossOrigin", "anonymous"), k.onerror = T, k.onload = function() { var O = document.createElement("canvas"); O.width = this.width, O.height = this.height; var M = O.getContext("2d", { willReadFrequently: !0 }); M.drawImage(this, 0, 0); var C = O.toDataURL("image/png"); b.attr("xlink:href", C), _(); }, b.on("error", T), k.src = m.source, this._imgSrc = m.source; function T() { b.remove(), _(); } }).bind(this)); e._promises.push(w); } } function f(m) { var b = BA.select(this), w = Zs.getFromId(e, m.xref), _ = Zs.getFromId(e, m.yref), k = Zs.getRefType(m.xref) === "domain", T = Zs.getRefType(m.yref) === "domain", O = t._size, M, C; w !== void 0 ? M = typeof m.xref == "string" && k ? w._length * m.sizex : Math.abs(w.l2p(m.sizex) - w.l2p(0)) : M = m.sizex * O.w, _ !== void 0 ? C = typeof m.yref == "string" && T ? _._length * m.sizey : Math.abs(_.l2p(m.sizey) - _.l2p(0)) : C = m.sizey * O.h; var I = M * c.x[m.xanchor].offset, j = C * c.y[m.yanchor].offset, P = c.x[m.xanchor].sizing + c.y[m.yanchor].sizing, N, W; switch (w !== void 0 ? N = typeof m.xref == "string" && k ? w._length * m.x + w._offset : w.r2p(m.x) + w._offset : N = m.x * O.w + O.l, N += I, _ !== void 0 ? W = typeof m.yref == "string" && T ? ( // consistent with "paper" yref value, where positive values // move up the page _._length * (1 - m.y) + _._offset ) : _.r2p(m.y) + _._offset : W = O.h - m.y * O.h + O.t, W += j, m.sizing) { case "fill": P += " slice"; break; case "stretch": P = "none"; break; } b.attr({ x: N, y: W, width: M, height: C, preserveAspectRatio: P, opacity: m.opacity }); var J = w && Zs.getRefType(m.xref) !== "domain" ? w._id : "", U = _ && Zs.getRefType(m.yref) !== "domain" ? _._id : "", E = J + U; Iae.setClipUrl( b, E ? "clip" + t._uid + E : null, e ); } var h = t._imageLowerLayer.selectAll("image").data(a), g = t._imageUpperLayer.selectAll("image").data(n); h.enter().append("image"), g.enter().append("image"), h.exit().remove(), g.exit().remove(), h.each(function(m) { u.bind(this)(m), f.bind(this)(m); }), g.each(function(m) { u.bind(this)(m), f.bind(this)(m); }); var p = Object.keys(t._plots); for (o = 0; o < p.length; o++) { i = p[o]; var v = t._plots[i]; if (v.imagelayer) { var y = v.imagelayer.selectAll("image").data(r[i] || []); y.enter().append("image"), y.exit().remove(), y.each(function(m) { u.bind(this)(m), f.bind(this)(m); }); } } }, VA = cn, jae = N1, Pae = function(e, t, n, r) { t = t || {}; var a = n === "log" && t.type === "linear", i = n === "linear" && t.type === "log"; if (a || i) { for (var o = e._fullLayout.images, l = t._id.charAt(0), s, c, u = 0; u < o.length; u++) if (s = o[u], c = "images[" + u + "].", s[l + "ref"] === t._id) { var f = s[l], h = s["size" + l], g = null, p = null; if (a) { g = jae(f, t.range); var v = h / Math.pow(10, g) / 2; p = 2 * Math.log(v + Math.sqrt(1 + v * v)) / Math.LN10; } else g = Math.pow(10, f), p = g * (Math.pow(10, h / 2) - Math.pow(10, -h / 2)); VA(g) ? VA(p) || (p = null) : (g = null, p = null), r(c + l, g), r(c + "size" + l, p); } } }, Rae = { moduleType: "component", name: "images", layoutAttributes: mO, supplyLayoutDefaults: Dae, includeBasePlot: W0("images"), draw: Eae, convertCoords: Pae }, cb = { // layout attribute name name: "updatemenus", // class names containerClassName: "updatemenu-container", headerGroupClassName: "updatemenu-header-group", headerClassName: "updatemenu-header", headerArrowClassName: "updatemenu-header-arrow", dropdownButtonGroupClassName: "updatemenu-dropdown-button-group", dropdownButtonClassName: "updatemenu-dropdown-button", buttonClassName: "updatemenu-button", itemRectClassName: "updatemenu-item-rect", itemTextClassName: "updatemenu-item-text", // DOM attribute name in button group keeping track // of active update menu menuIndexAttrName: "updatemenu-active-index", // id root pass to Plots.autoMargin autoMarginIdRoot: "updatemenu-", // options when 'active: -1' blankHeaderOpts: { label: " " }, // min item width / height minWidth: 30, minHeight: 30, // padding around item text textPadX: 24, arrowPadX: 16, // item rect radii rx: 2, ry: 2, // item text x offset off left edge textOffsetX: 12, // item text y offset (w.r.t. middle) textOffsetY: 3, // arrow offset off right edge arrowOffsetX: 4, // gap between header and buttons gapButtonHeader: 5, // gap between between buttons gapButton: 2, // color given to active buttons activeColor: "#F4FAFF", // color given to hovered buttons hoverColor: "#F4FAFF", // symbol for menu open arrow arrowSymbol: { left: "◄", right: "►", up: "▲", down: "▼" } }, Nae = Fr, Bae = fa, Hae = tr.extendFlat, Vae = Lo.overrideAll, qae = Y1, yO = Sn.templatedArray, Uae = yO("button", { visible: { valType: "boolean", description: "Determines whether or not this button is visible." }, method: { valType: "enumerated", values: ["restyle", "relayout", "animate", "update", "skip"], dflt: "restyle", description: [ "Sets the Plotly method to be called on click.", "If the `skip` method is used, the API updatemenu will function as normal", "but will perform no API calls and will not bind automatically to state", "updates. This may be used to create a component interface and attach to", "updatemenu events manually via JavaScript." ].join(" ") }, args: { valType: "info_array", freeLength: !0, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets the arguments values to be passed to the Plotly", "method set in `method` on click." ].join(" ") }, args2: { valType: "info_array", freeLength: !0, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets a 2nd set of `args`,", "these arguments values are passed to the Plotly", "method set in `method` when clicking this button while in the active state.", "Use this to create toggle buttons." ].join(" ") }, label: { valType: "string", dflt: "", description: "Sets the text label to appear on the button." }, execute: { valType: "boolean", dflt: !0, description: [ "When true, the API method is executed. When false, all other behaviors are the same", "and command execution is skipped. This may be useful when hooking into, for example,", "the `plotly_buttonclicked` method and executing the API command manually without losing", "the benefit of the updatemenu automatically binding to the state of the plot through the", "specification of `method` and `args`." ].join(" ") } }), xO = Vae(yO("updatemenu", { _arrayAttrRegexps: [/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/], visible: { valType: "boolean", description: [ "Determines whether or not the update menu is visible." ].join(" ") }, type: { valType: "enumerated", values: ["dropdown", "buttons"], dflt: "dropdown", description: [ "Determines whether the buttons are accessible via a dropdown menu", "or whether the buttons are stacked horizontally or vertically" ].join(" ") }, direction: { valType: "enumerated", values: ["left", "right", "up", "down"], dflt: "down", description: [ "Determines the direction in which the buttons are laid out, whether", "in a dropdown menu or a row/column of buttons. For `left` and `up`,", "the buttons will still appear in left-to-right or top-to-bottom order", "respectively." ].join(" ") }, active: { valType: "integer", min: -1, dflt: 0, description: [ "Determines which button (by index starting from 0) is", "considered active." ].join(" ") }, showactive: { valType: "boolean", dflt: !0, description: "Highlights active dropdown item or active button if true." }, buttons: Uae, x: { valType: "number", min: -2, max: 3, dflt: -0.05, description: "Sets the x position (in normalized coordinates) of the update menu." }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "right", description: [ "Sets the update menu's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, dflt: 1, description: "Sets the y position (in normalized coordinates) of the update menu." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "top", description: [ "Sets the update menu's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, pad: Hae(qae({ editType: "arraydraw" }), { description: "Sets the padding around the buttons or dropdown menu." }), font: Nae({ description: "Sets the font of the update menu button text." }), bgcolor: { valType: "color", description: "Sets the background color of the update menu buttons." }, bordercolor: { valType: "color", dflt: Bae.borderLine, description: "Sets the color of the border enclosing the update menu." }, borderwidth: { valType: "number", min: 0, dflt: 1, editType: "arraydraw", description: "Sets the width (in px) of the border enclosing the update menu." } }), "arraydraw", "from-root"), Wh = Ue, bO = Qi, wO = xO, Gae = cb, Wae = Gae.name, Zae = wO.buttons, Yae = function(e, t) { var n = { name: Wae, handleItemDefaults: $ae }; bO(e, t, n); }; function $ae(e, t, n) { function r(o, l) { return Wh.coerce(e, t, wO, o, l); } var a = bO(e, t, { name: "buttons", handleItemDefaults: Kae }), i = r("visible", a.length > 0); i && (r("active"), r("direction"), r("type"), r("showactive"), r("x"), r("y"), Wh.noneOrAll(e, t, ["x", "y"]), r("xanchor"), r("yanchor"), r("pad.t"), r("pad.r"), r("pad.b"), r("pad.l"), Wh.coerceFont(r, "font", n.font), r("bgcolor", n.paper_bgcolor), r("bordercolor"), r("borderwidth")); } function Kae(e, t) { function n(a, i) { return Wh.coerce(e, t, Zae, a, i); } var r = n( "visible", e.method === "skip" || Array.isArray(e.args) ); r && (n("method"), n("args"), n("args2"), n("label"), n("execute")); } var Jae = Vn, ui = sn, qA = rn, xc = Cn, Op = Ue; function Vn(e, t, n) { this.gd = e, this.container = t, this.id = n, this.position = null, this.translateX = null, this.translateY = null, this.hbar = null, this.vbar = null, this.bg = this.container.selectAll("rect.scrollbox-bg").data([0]), this.bg.exit().on(".drag", null).on("wheel", null).remove(), this.bg.enter().append("rect").classed("scrollbox-bg", !0).style("pointer-events", "all").attr({ opacity: 0, x: 0, y: 0, width: 0, height: 0 }); } Vn.barWidth = 2; Vn.barLength = 20; Vn.barRadius = 2; Vn.barPad = 1; Vn.barColor = "#808BA4"; Vn.prototype.enable = function(e, t, n) { var r = this.gd._fullLayout, a = r.width, i = r.height; this.position = e; var o = this.position.l, l = this.position.w, s = this.position.t, c = this.position.h, u = this.position.direction, f = u === "down", h = u === "left", g = u === "right", p = u === "up", v = l, y = c, m, b, w, _; !f && !h && !g && !p && (this.position.direction = "down", f = !0); var k = f || p; k ? (m = o, b = m + v, f ? (w = s, _ = Math.min(w + y, i), y = _ - w) : (_ = s + y, w = Math.max(_ - y, 0), y = _ - w)) : (w = s, _ = w + y, h ? (b = o + v, m = Math.max(b - v, 0), v = b - m) : (m = o, b = Math.min(m + v, a), v = b - m)), this._box = { l: m, t: w, w: v, h: y }; var T = l > v, O = Vn.barLength + 2 * Vn.barPad, M = Vn.barWidth + 2 * Vn.barPad, C = o, I = s + c; I + M > i && (I = i - M); var j = this.container.selectAll("rect.scrollbar-horizontal").data( T ? [0] : [] ); j.exit().on(".drag", null).remove(), j.enter().append("rect").classed("scrollbar-horizontal", !0).call(qA.fill, Vn.barColor), T ? (this.hbar = j.attr({ rx: Vn.barRadius, ry: Vn.barRadius, x: C, y: I, width: O, height: M }), this._hbarXMin = C + O / 2, this._hbarTranslateMax = v - O) : (delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax); var P = c > y, N = Vn.barWidth + 2 * Vn.barPad, W = Vn.barLength + 2 * Vn.barPad, J = o + l, U = s; J + N > a && (J = a - N); var E = this.container.selectAll("rect.scrollbar-vertical").data( P ? [0] : [] ); E.exit().on(".drag", null).remove(), E.enter().append("rect").classed("scrollbar-vertical", !0).call(qA.fill, Vn.barColor), P ? (this.vbar = E.attr({ rx: Vn.barRadius, ry: Vn.barRadius, x: J, y: U, width: N, height: W }), this._vbarYMin = U + W / 2, this._vbarTranslateMax = y - W) : (delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax); var z = this.id, F = m - 0.5, q = P ? b + N + 0.5 : b + 0.5, H = w - 0.5, K = T ? _ + M + 0.5 : _ + 0.5, Q = r._topdefs.selectAll("#" + z).data(T || P ? [0] : []); if (Q.exit().remove(), Q.enter().append("clipPath").attr("id", z).append("rect"), T || P ? (this._clipRect = Q.select("rect").attr({ x: Math.floor(F), y: Math.floor(H), width: Math.ceil(q) - Math.floor(F), height: Math.ceil(K) - Math.floor(H) }), this.container.call(xc.setClipUrl, z, this.gd), this.bg.attr({ x: o, y: s, width: l, height: c })) : (this.bg.attr({ width: 0, height: 0 }), this.container.on("wheel", null).on(".drag", null).call(xc.setClipUrl, null), delete this._clipRect), T || P) { var re = ui.behavior.drag().on("dragstart", function() { ui.event.sourceEvent.preventDefault(); }).on("drag", this._onBoxDrag.bind(this)); this.container.on("wheel", null).on("wheel", this._onBoxWheel.bind(this)).on(".drag", null).call(re); var te = ui.behavior.drag().on("dragstart", function() { ui.event.sourceEvent.preventDefault(), ui.event.sourceEvent.stopPropagation(); }).on("drag", this._onBarDrag.bind(this)); T && this.hbar.on(".drag", null).call(te), P && this.vbar.on(".drag", null).call(te); } this.setTranslate(t, n); }; Vn.prototype.disable = function() { (this.hbar || this.vbar) && (this.bg.attr({ width: 0, height: 0 }), this.container.on("wheel", null).on(".drag", null).call(xc.setClipUrl, null), delete this._clipRect), this.hbar && (this.hbar.on(".drag", null), this.hbar.remove(), delete this.hbar, delete this._hbarXMin, delete this._hbarTranslateMax), this.vbar && (this.vbar.on(".drag", null), this.vbar.remove(), delete this.vbar, delete this._vbarYMin, delete this._vbarTranslateMax); }; Vn.prototype._onBoxDrag = function() { var e = this.translateX, t = this.translateY; this.hbar && (e -= ui.event.dx), this.vbar && (t -= ui.event.dy), this.setTranslate(e, t); }; Vn.prototype._onBoxWheel = function() { var e = this.translateX, t = this.translateY; this.hbar && (e += ui.event.deltaY), this.vbar && (t += ui.event.deltaY), this.setTranslate(e, t); }; Vn.prototype._onBarDrag = function() { var e = this.translateX, t = this.translateY; if (this.hbar) { var n = e + this._hbarXMin, r = n + this._hbarTranslateMax, a = Op.constrain(ui.event.x, n, r), i = (a - n) / (r - n), o = this.position.w - this._box.w; e = i * o; } if (this.vbar) { var l = t + this._vbarYMin, s = l + this._vbarTranslateMax, c = Op.constrain(ui.event.y, l, s), u = (c - l) / (s - l), f = this.position.h - this._box.h; t = u * f; } this.setTranslate(e, t); }; Vn.prototype.setTranslate = function(e, t) { var n = this.position.w - this._box.w, r = this.position.h - this._box.h; if (e = Op.constrain(e || 0, 0, n), t = Op.constrain(t || 0, 0, r), this.translateX = e, this.translateY = t, this.container.call( xc.setTranslate, this._box.l - this.position.l - e, this._box.t - this.position.t - t ), this._clipRect && this._clipRect.attr({ x: Math.floor(this.position.l + e - 0.5), y: Math.floor(this.position.t + t - 0.5) }), this.hbar) { var a = e / n; this.hbar.call( xc.setTranslate, e + a * this._hbarTranslateMax, t ); } if (this.vbar) { var i = t / r; this.vbar.call( xc.setTranslate, e, t + i * this._vbarTranslateMax ); } }; var Pc = sn, Ed = kr, jd = rn, Rc = Cn, xa = Ue, Dp = Ir, Qae = Sn.arrayEditor, _O = Nr.LINE_SPACING, Bt = cb, Xae = Jae, eie = function(e) { var t = e._fullLayout, n = xa.filterVisible(t[Bt.name]); function r(f) { Ed.autoMargin(e, SO(f)); } var a = t._menulayer.selectAll("g." + Bt.containerClassName).data(n.length > 0 ? [0] : []); if (a.enter().append("g").classed(Bt.containerClassName, !0).style("cursor", "pointer"), a.exit().each(function() { Pc.select(this).selectAll("g." + Bt.headerGroupClassName).each(r); }).remove(), n.length !== 0) { var i = a.selectAll("g." + Bt.headerGroupClassName).data(n, tie); i.enter().append("g").classed(Bt.headerGroupClassName, !0); for (var o = xa.ensureSingle(a, "g", Bt.dropdownButtonGroupClassName, function(f) { f.style("pointer-events", "all"); }), l = 0; l < n.length; l++) { var s = n[l]; lie(e, s); } var c = "updatemenus" + t._uid, u = new Xae(e, o, c); i.enter().size() && (o.node().parentNode.appendChild(o.node()), o.call(Yy)), i.exit().each(function(f) { o.call(Yy), r(f); }).remove(), i.each(function(f) { var h = Pc.select(this), g = f.type === "dropdown" ? o : null; Ed.manageCommandObserver(e, f, f.buttons, function(p) { Zy(e, f, f.buttons[p.index], h, g, u, p.index, !0); }), f.type === "dropdown" ? (TO(e, h, o, u, f), kO(o, f) && Pd(e, h, o, u, f)) : Pd(e, h, null, null, f); }); } }; function tie(e) { return e._index; } function nie(e) { return +e.attr(Bt.menuIndexAttrName) == -1; } function kO(e, t) { return +e.attr(Bt.menuIndexAttrName) === t._index; } function Zy(e, t, n, r, a, i, o, l) { t.active = o, Qae(e.layout, Bt.name, t).applyUpdate("active", o), t.type === "buttons" ? Pd(e, r, null, null, t) : t.type === "dropdown" && (a.attr(Bt.menuIndexAttrName, "-1"), TO(e, r, a, i, t), l || Pd(e, r, a, i, t)); } function TO(e, t, n, r, a) { var i = xa.ensureSingle(t, "g", Bt.headerClassName, function(h) { h.style("pointer-events", "all"); }), o = a._dims, l = a.active, s = a.buttons[l] || Bt.blankHeaderOpts, c = { y: a.pad.t, yPad: 0, x: a.pad.l, xPad: 0, index: 0 }, u = { width: o.headerWidth, height: o.headerHeight }; i.call(ub, a, s, e).call(CO, a, c, u); var f = xa.ensureSingle(t, "text", Bt.headerArrowClassName, function(h) { h.attr("text-anchor", "end").call(Rc.font, a.font).text(Bt.arrowSymbol[a.direction]); }); f.attr({ x: o.headerWidth - Bt.arrowOffsetX + a.pad.l, y: o.headerHeight / 2 + Bt.textOffsetY + a.pad.t }), i.on("click", function() { n.call( Yy, String(kO(n, a) ? -1 : a._index) ), Pd(e, t, n, r, a); }), i.on("mouseover", function() { i.call(AO); }), i.on("mouseout", function() { i.call(MO, a); }), Rc.setTranslate(t, o.lx, o.ly); } function Pd(e, t, n, r, a) { n || (n = t, n.attr("pointer-events", "all")); var i = !nie(n) || a.type === "buttons" ? a.buttons : [], o = a.type === "dropdown" ? Bt.dropdownButtonClassName : Bt.buttonClassName, l = n.selectAll("g." + o).data(xa.filterVisible(i)), s = l.enter().append("g").classed(o, !0), c = l.exit(); a.type === "dropdown" ? (s.attr("opacity", "0").transition().attr("opacity", "1"), c.transition().attr("opacity", "0").remove()) : c.remove(); var u = 0, f = 0, h = a._dims, g = ["up", "down"].indexOf(a.direction) !== -1; a.type === "dropdown" && (g ? f = h.headerHeight + Bt.gapButtonHeader : u = h.headerWidth + Bt.gapButtonHeader), a.type === "dropdown" && a.direction === "up" && (f = -Bt.gapButtonHeader + Bt.gapButton - h.openHeight), a.type === "dropdown" && a.direction === "left" && (u = -Bt.gapButtonHeader + Bt.gapButton - h.openWidth); var p = { x: h.lx + u + a.pad.l, y: h.ly + f + a.pad.t, yPad: Bt.gapButton, xPad: Bt.gapButton, index: 0 }, v = { l: p.x + a.borderwidth, t: p.y + a.borderwidth }; l.each(function(y, m) { var b = Pc.select(this); b.call(ub, a, y, e).call(CO, a, p), b.on("click", function() { Pc.event.defaultPrevented || (y.execute && (y.args2 && a.active === m ? (Zy(e, a, y, t, n, r, -1), Ed.executeAPICommand(e, y.method, y.args2)) : (Zy(e, a, y, t, n, r, m), Ed.executeAPICommand(e, y.method, y.args))), e.emit("plotly_buttonclicked", { menu: a, button: y, active: a.active })); }), b.on("mouseover", function() { b.call(AO); }), b.on("mouseout", function() { b.call(MO, a), l.call(UA, a); }); }), l.call(UA, a), g ? (v.w = Math.max(h.openWidth, h.headerWidth), v.h = p.y - v.t) : (v.w = p.x - v.l, v.h = Math.max(h.openHeight, h.headerHeight)), v.direction = a.direction, r && (l.size() ? rie(e, t, n, r, a, v) : aie(r)); } function rie(e, t, n, r, a, i) { var o = a.direction, l = o === "up" || o === "down", s = a._dims, c = a.active, u, f, h; if (l) for (f = 0, h = 0; h < c; h++) f += s.heights[h] + Bt.gapButton; else for (u = 0, h = 0; h < c; h++) u += s.widths[h] + Bt.gapButton; r.enable(i, u, f), r.hbar && r.hbar.attr("opacity", "0").transition().attr("opacity", "1"), r.vbar && r.vbar.attr("opacity", "0").transition().attr("opacity", "1"); } function aie(e) { var t = !!e.hbar, n = !!e.vbar; t && e.hbar.transition().attr("opacity", "0").each("end", function() { t = !1, n || e.disable(); }), n && e.vbar.transition().attr("opacity", "0").each("end", function() { n = !1, t || e.disable(); }); } function ub(e, t, n, r) { e.call(iie, t).call(oie, t, n, r); } function iie(e, t) { var n = xa.ensureSingle(e, "rect", Bt.itemRectClassName, function(r) { r.attr({ rx: Bt.rx, ry: Bt.ry, "shape-rendering": "crispEdges" }); }); n.call(jd.stroke, t.bordercolor).call(jd.fill, t.bgcolor).style("stroke-width", t.borderwidth + "px"); } function oie(e, t, n, r) { var a = xa.ensureSingle(e, "text", Bt.itemTextClassName, function(l) { l.attr({ "text-anchor": "start", "data-notex": 1 }); }), i = n.label, o = r._fullLayout._meta; o && (i = xa.templateString(i, o)), a.call(Rc.font, t.font).text(i).call(Dp.convertToTspans, r); } function UA(e, t) { var n = t.active; e.each(function(r, a) { var i = Pc.select(this); a === n && t.showactive && i.select("rect." + Bt.itemRectClassName).call(jd.fill, Bt.activeColor); }); } function AO(e) { e.select("rect." + Bt.itemRectClassName).call(jd.fill, Bt.hoverColor); } function MO(e, t) { e.select("rect." + Bt.itemRectClassName).call(jd.fill, t.bgcolor); } function lie(e, t) { var n = t._dims = { width1: 0, height1: 0, heights: [], widths: [], totalWidth: 0, totalHeight: 0, openWidth: 0, openHeight: 0, lx: 0, ly: 0 }, r = Rc.tester.selectAll("g." + Bt.dropdownButtonClassName).data(xa.filterVisible(t.buttons)); r.enter().append("g").classed(Bt.dropdownButtonClassName, !0); var a = ["up", "down"].indexOf(t.direction) !== -1; r.each(function(u, f) { var h = Pc.select(this); h.call(ub, t, u, e); var g = h.select("." + Bt.itemTextClassName), p = g.node() && Rc.bBox(g.node()).width, v = Math.max(p + Bt.textPadX, Bt.minWidth), y = t.font.size * _O, m = Dp.lineCount(g), b = Math.max(y * m, Bt.minHeight) + Bt.textOffsetY; b = Math.ceil(b), v = Math.ceil(v), n.widths[f] = v, n.heights[f] = b, n.height1 = Math.max(n.height1, b), n.width1 = Math.max(n.width1, v), a ? (n.totalWidth = Math.max(n.totalWidth, v), n.openWidth = n.totalWidth, n.totalHeight += b + Bt.gapButton, n.openHeight += b + Bt.gapButton) : (n.totalWidth += v + Bt.gapButton, n.openWidth += v + Bt.gapButton, n.totalHeight = Math.max(n.totalHeight, b), n.openHeight = n.totalHeight); }), a ? n.totalHeight -= Bt.gapButton : n.totalWidth -= Bt.gapButton, n.headerWidth = n.width1 + Bt.arrowPadX, n.headerHeight = n.height1, t.type === "dropdown" && (a ? (n.width1 += Bt.arrowPadX, n.totalHeight = n.height1) : n.totalWidth = n.width1, n.totalWidth += Bt.arrowPadX), r.remove(); var i = n.totalWidth + t.pad.l + t.pad.r, o = n.totalHeight + t.pad.t + t.pad.b, l = e._fullLayout._size; n.lx = l.l + l.w * t.x, n.ly = l.t + l.h * (1 - t.y); var s = "left"; xa.isRightAnchor(t) && (n.lx -= i, s = "right"), xa.isCenterAnchor(t) && (n.lx -= i / 2, s = "center"); var c = "top"; xa.isBottomAnchor(t) && (n.ly -= o, c = "bottom"), xa.isMiddleAnchor(t) && (n.ly -= o / 2, c = "middle"), n.totalWidth = Math.ceil(n.totalWidth), n.totalHeight = Math.ceil(n.totalHeight), n.lx = Math.round(n.lx), n.ly = Math.round(n.ly), Ed.autoMargin(e, SO(t), { x: t.x, y: t.y, l: i * ({ right: 1, center: 0.5 }[s] || 0), r: i * ({ left: 1, center: 0.5 }[s] || 0), b: o * ({ top: 1, middle: 0.5 }[c] || 0), t: o * ({ bottom: 1, middle: 0.5 }[c] || 0) }); } function SO(e) { return Bt.autoMarginIdRoot + e._index; } function CO(e, t, n, r) { r = r || {}; var a = e.select("." + Bt.itemRectClassName), i = e.select("." + Bt.itemTextClassName), o = t.borderwidth, l = n.index, s = t._dims; Rc.setTranslate(e, o + n.x, o + n.y); var c = ["up", "down"].indexOf(t.direction) !== -1, u = r.height || (c ? s.heights[l] : s.height1); a.attr({ x: 0, y: 0, width: r.width || (c ? s.width1 : s.widths[l]), height: u }); var f = t.font.size * _O, h = Dp.lineCount(i), g = (h - 1) * f / 2; Dp.positionText( i, Bt.textOffsetX, u / 2 - g + Bt.textOffsetY ), c ? n.y += s.heights[l] + n.yPad : n.x += s.widths[l] + n.xPad, n.index++; } function Yy(e, t) { e.attr(Bt.menuIndexAttrName, t || "-1").selectAll("g." + Bt.dropdownButtonClassName).remove(); } var sie = cb, cie = { moduleType: "component", name: sie.name, layoutAttributes: xO, supplyLayoutDefaults: Yae, draw: eie }, J0 = { // layout attribute name name: "sliders", // class names containerClassName: "slider-container", groupClassName: "slider-group", inputAreaClass: "slider-input-area", railRectClass: "slider-rail-rect", railTouchRectClass: "slider-rail-touch-rect", gripRectClass: "slider-grip-rect", tickRectClass: "slider-tick-rect", inputProxyClass: "slider-input-proxy", labelsClass: "slider-labels", labelGroupClass: "slider-label-group", labelClass: "slider-label", currentValueClass: "slider-current-value", railHeight: 5, // DOM attribute name in button group keeping track // of active update menu menuIndexAttrName: "slider-active-index", // id root pass to Plots.autoMargin autoMarginIdRoot: "slider-", // min item width / height minWidth: 30, minHeight: 30, // padding around item text textPadX: 40, // arrow offset off right edge arrowOffsetX: 4, railRadius: 2, railWidth: 5, railBorder: 4, railBorderWidth: 1, railBorderColor: "#bec8d9", railBgColor: "#f8fafc", // The distance of the rail from the edge of the touchable area // Slightly less than the step inset because of the curved edges // of the rail railInset: 8, // The distance from the extremal tick marks to the edge of the // touchable area. This is basically the same as the grip radius, // but for other styles it wouldn't really need to be. stepInset: 10, gripRadius: 10, gripWidth: 20, gripHeight: 20, gripBorder: 20, gripBorderWidth: 1, gripBorderColor: "#bec8d9", gripBgColor: "#f6f8fa", gripBgActiveColor: "#dbdde0", labelPadding: 8, labelOffset: 0, tickWidth: 1, tickColor: "#333", tickOffset: 25, tickLength: 7, minorTickOffset: 25, minorTickColor: "#333", minorTickLength: 4, // Extra space below the current value label: currentValuePadding: 8, currentValueInset: 0 }, GA = Fr, uie = Y1, die = tr.extendDeepAll, fie = Lo.overrideAll, hie = h0, LO = Sn.templatedArray, El = J0, pie = LO("step", { visible: { valType: "boolean", dflt: !0, description: [ "Determines whether or not this step is included in the slider." ].join(" ") }, method: { valType: "enumerated", values: ["restyle", "relayout", "animate", "update", "skip"], dflt: "restyle", description: [ "Sets the Plotly method to be called when the slider value is changed.", "If the `skip` method is used, the API slider will function as normal", "but will perform no API calls and will not bind automatically to state", "updates. This may be used to create a component interface and attach to", "slider events manually via JavaScript." ].join(" ") }, args: { valType: "info_array", freeLength: !0, items: [ { valType: "any" }, { valType: "any" }, { valType: "any" } ], description: [ "Sets the arguments values to be passed to the Plotly", "method set in `method` on slide." ].join(" ") }, label: { valType: "string", description: "Sets the text label to appear on the slider" }, value: { valType: "string", description: [ "Sets the value of the slider step, used to refer to the step programatically.", "Defaults to the slider label if not provided." ].join(" ") }, execute: { valType: "boolean", dflt: !0, description: [ "When true, the API method is executed. When false, all other behaviors are the same", "and command execution is skipped. This may be useful when hooking into, for example,", "the `plotly_sliderchange` method and executing the API command manually without losing", "the benefit of the slider automatically binding to the state of the plot through the", "specification of `method` and `args`." ].join(" ") } }), OO = fie(LO("slider", { visible: { valType: "boolean", dflt: !0, description: [ "Determines whether or not the slider is visible." ].join(" ") }, active: { valType: "number", min: 0, dflt: 0, description: [ "Determines which button (by index starting from 0) is", "considered active." ].join(" ") }, steps: pie, lenmode: { valType: "enumerated", values: ["fraction", "pixels"], dflt: "fraction", description: [ "Determines whether this slider length", "is set in units of plot *fraction* or in *pixels.", "Use `len` to set the value." ].join(" ") }, len: { valType: "number", min: 0, dflt: 1, description: [ "Sets the length of the slider", "This measure excludes the padding of both ends.", "That is, the slider's length is this length minus the", "padding on both ends." ].join(" ") }, x: { valType: "number", min: -2, max: 3, dflt: 0, description: "Sets the x position (in normalized coordinates) of the slider." }, pad: die(uie({ editType: "arraydraw" }), { description: "Set the padding of the slider component along each side." }, { t: { dflt: 20 } }), xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", description: [ "Sets the slider's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, dflt: 0, description: "Sets the y position (in normalized coordinates) of the slider." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "top", description: [ "Sets the slider's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, transition: { duration: { valType: "number", min: 0, dflt: 150, description: "Sets the duration of the slider transition" }, easing: { valType: "enumerated", values: hie.transition.easing.values, dflt: "cubic-in-out", description: "Sets the easing function of the slider transition" } }, currentvalue: { visible: { valType: "boolean", dflt: !0, description: [ "Shows the currently-selected value above the slider." ].join(" ") }, xanchor: { valType: "enumerated", values: ["left", "center", "right"], dflt: "left", description: [ "The alignment of the value readout relative to the length of the slider." ].join(" ") }, offset: { valType: "number", dflt: 10, description: [ "The amount of space, in pixels, between the current value label", "and the slider." ].join(" ") }, prefix: { valType: "string", description: "When currentvalue.visible is true, this sets the prefix of the label." }, suffix: { valType: "string", description: "When currentvalue.visible is true, this sets the suffix of the label." }, font: GA({ description: "Sets the font of the current value label text." }) }, font: GA({ description: "Sets the font of the slider step labels." }), activebgcolor: { valType: "color", dflt: El.gripBgActiveColor, description: [ "Sets the background color of the slider grip", "while dragging." ].join(" ") }, bgcolor: { valType: "color", dflt: El.railBgColor, description: "Sets the background color of the slider." }, bordercolor: { valType: "color", dflt: El.railBorderColor, description: "Sets the color of the border enclosing the slider." }, borderwidth: { valType: "number", min: 0, dflt: El.railBorderWidth, description: "Sets the width (in px) of the border enclosing the slider." }, ticklen: { valType: "number", min: 0, dflt: El.tickLength, description: "Sets the length in pixels of step tick marks" }, tickcolor: { valType: "color", dflt: El.tickColor, description: "Sets the color of the border enclosing the slider." }, tickwidth: { valType: "number", min: 0, dflt: 1, description: "Sets the tick width (in px)." }, minorticklen: { valType: "number", min: 0, dflt: El.minorTickLength, description: "Sets the length in pixels of minor step tick marks" } }), "arraydraw", "from-root"), ic = Ue, DO = Qi, FO = OO, gie = J0, vie = gie.name, mie = FO.steps, yie = function(e, t) { DO(e, t, { name: vie, handleItemDefaults: xie }); }; function xie(e, t, n) { function r(f, h) { return ic.coerce(e, t, FO, f, h); } for (var a = DO(e, t, { name: "steps", handleItemDefaults: bie }), i = 0, o = 0; o < a.length; o++) a[o].visible && i++; var l; if (i < 2 ? l = t.visible = !1 : l = r("visible"), !!l) { t._stepCount = i; var s = t._visibleSteps = ic.filterVisible(a), c = r("active"); (a[c] || {}).visible || (t.active = s[0]._index), r("x"), r("y"), ic.noneOrAll(e, t, ["x", "y"]), r("xanchor"), r("yanchor"), r("len"), r("lenmode"), r("pad.t"), r("pad.r"), r("pad.b"), r("pad.l"), ic.coerceFont(r, "font", n.font); var u = r("currentvalue.visible"); u && (r("currentvalue.xanchor"), r("currentvalue.prefix"), r("currentvalue.suffix"), r("currentvalue.offset"), ic.coerceFont(r, "currentvalue.font", t.font)), r("transition.duration"), r("transition.easing"), r("bgcolor"), r("activebgcolor"), r("bordercolor"), r("borderwidth"), r("ticklen"), r("tickwidth"), r("tickcolor"), r("minorticklen"); } } function bie(e, t) { function n(i, o) { return ic.coerce(e, t, mie, i, o); } var r; if (e.method !== "skip" && !Array.isArray(e.args) ? r = t.visible = !1 : r = n("visible"), r) { n("method"), n("args"); var a = n("label", "step-" + t._index); n("value", a), n("execute"); } } var di = sn, Fp = kr, hl = rn, pi = Cn, ba = Ue, wie = ba.strTranslate, id = Ir, _ie = Sn.arrayEditor, Xt = J0, db = Nr, IO = db.LINE_SPACING, um = db.FROM_TL, dm = db.FROM_BR, kie = function(e) { var t = e._context.staticPlot, n = e._fullLayout, r = Tie(n, e), a = n._infolayer.selectAll("g." + Xt.containerClassName).data(r.length > 0 ? [0] : []); a.enter().append("g").classed(Xt.containerClassName, !0).style("cursor", t ? null : "ew-resize"); function i(c) { c._commandObserver && (c._commandObserver.remove(), delete c._commandObserver), Fp.autoMargin(e, zO(c)); } if (a.exit().each(function() { di.select(this).selectAll("g." + Xt.groupClassName).each(i); }).remove(), r.length !== 0) { var o = a.selectAll("g." + Xt.groupClassName).data(r, Aie); o.enter().append("g").classed(Xt.groupClassName, !0), o.exit().each(i).remove(); for (var l = 0; l < r.length; l++) { var s = r[l]; Mie(e, s); } o.each(function(c) { var u = di.select(this); Die(c), Fp.manageCommandObserver(e, c, c._visibleSteps, function(f) { var h = u.data()[0]; h.active !== f.index && (h._dragging || jO(e, u, h, f.index, !1, !0)); }), Sie(e, di.select(this), c); }); } }; function zO(e) { return Xt.autoMarginIdRoot + e._index; } function Tie(e, t) { for (var n = e[Xt.name], r = [], a = 0; a < n.length; a++) { var i = n[a]; i.visible && (i._gd = t, r.push(i)); } return r; } function Aie(e) { return e._index; } function Mie(e, t) { var n = pi.tester.selectAll("g." + Xt.labelGroupClass).data(t._visibleSteps); n.enter().append("g").classed(Xt.labelGroupClass, !0); var r = 0, a = 0; n.each(function(p) { var v = di.select(this), y = EO(v, { step: p }, t), m = y.node(); if (m) { var b = pi.bBox(m); a = Math.max(a, b.height), r = Math.max(r, b.width); } }), n.remove(); var i = t._dims = {}; i.inputAreaWidth = Math.max( Xt.railWidth, Xt.gripHeight ); var o = e._fullLayout._size; i.lx = o.l + o.w * t.x, i.ly = o.t + o.h * (1 - t.y), t.lenmode === "fraction" ? i.outerLength = Math.round(o.w * t.len) : i.outerLength = t.len, i.inputAreaStart = 0, i.inputAreaLength = Math.round(i.outerLength - t.pad.l - t.pad.r); var l = i.inputAreaLength - 2 * Xt.stepInset, s = l / (t._stepCount - 1), c = r + Xt.labelPadding; if (i.labelStride = Math.max(1, Math.ceil(c / s)), i.labelHeight = a, i.currentValueMaxWidth = 0, i.currentValueHeight = 0, i.currentValueTotalHeight = 0, i.currentValueMaxLines = 1, t.currentvalue.visible) { var u = pi.tester.append("g"); n.each(function(p) { var v = Ip(u, t, p.label), y = v.node() && pi.bBox(v.node()) || { width: 0, height: 0 }, m = id.lineCount(v); i.currentValueMaxWidth = Math.max(i.currentValueMaxWidth, Math.ceil(y.width)), i.currentValueHeight = Math.max(i.currentValueHeight, Math.ceil(y.height)), i.currentValueMaxLines = Math.max(i.currentValueMaxLines, m); }), i.currentValueTotalHeight = i.currentValueHeight + t.currentvalue.offset, u.remove(); } i.height = i.currentValueTotalHeight + Xt.tickOffset + t.ticklen + Xt.labelOffset + i.labelHeight + t.pad.t + t.pad.b; var f = "left"; ba.isRightAnchor(t) && (i.lx -= i.outerLength, f = "right"), ba.isCenterAnchor(t) && (i.lx -= i.outerLength / 2, f = "center"); var h = "top"; ba.isBottomAnchor(t) && (i.ly -= i.height, h = "bottom"), ba.isMiddleAnchor(t) && (i.ly -= i.height / 2, h = "middle"), i.outerLength = Math.ceil(i.outerLength), i.height = Math.ceil(i.height), i.lx = Math.round(i.lx), i.ly = Math.round(i.ly); var g = { y: t.y, b: i.height * dm[h], t: i.height * um[h] }; t.lenmode === "fraction" ? (g.l = 0, g.xl = t.x - t.len * um[f], g.r = 0, g.xr = t.x + t.len * dm[f]) : (g.x = t.x, g.l = i.outerLength * um[f], g.r = i.outerLength * dm[f]), Fp.autoMargin(e, zO(t), g); } function Sie(e, t, n) { (n.steps[n.active] || {}).visible || (n.active = n._visibleSteps[0]._index), t.call(Ip, n).call(Iie, n).call(Lie, n).call(Oie, n).call(Fie, e, n).call(Cie, e, n); var r = n._dims; pi.setTranslate(t, r.lx + n.pad.l, r.ly + n.pad.t), t.call(RO, n, !1), t.call(Ip, n); } function Ip(e, t, n) { if (t.currentvalue.visible) { var r = t._dims, a, i; switch (t.currentvalue.xanchor) { case "right": a = r.inputAreaLength - Xt.currentValueInset - r.currentValueMaxWidth, i = "left"; break; case "center": a = r.inputAreaLength * 0.5, i = "middle"; break; default: a = Xt.currentValueInset, i = "left"; } var o = ba.ensureSingle(e, "text", Xt.labelClass, function(h) { h.attr({ "text-anchor": i, "data-notex": 1 }); }), l = t.currentvalue.prefix ? t.currentvalue.prefix : ""; if (typeof n == "string") l += n; else { var s = t.steps[t.active].label, c = t._gd._fullLayout._meta; c && (s = ba.templateString(s, c)), l += s; } t.currentvalue.suffix && (l += t.currentvalue.suffix), o.call(pi.font, t.currentvalue.font).text(l).call(id.convertToTspans, t._gd); var u = id.lineCount(o), f = (r.currentValueMaxLines + 1 - u) * t.currentvalue.font.size * IO; return id.positionText(o, a, f), o; } } function Cie(e, t, n) { var r = ba.ensureSingle(e, "rect", Xt.gripRectClass, function(a) { a.call(PO, t, e, n).style("pointer-events", "all"); }); r.attr({ width: Xt.gripWidth, height: Xt.gripHeight, rx: Xt.gripRadius, ry: Xt.gripRadius }).call(hl.stroke, n.bordercolor).call(hl.fill, n.bgcolor).style("stroke-width", n.borderwidth + "px"); } function EO(e, t, n) { var r = ba.ensureSingle(e, "text", Xt.labelClass, function(o) { o.attr({ "text-anchor": "middle", "data-notex": 1 }); }), a = t.step.label, i = n._gd._fullLayout._meta; return i && (a = ba.templateString(a, i)), r.call(pi.font, n.font).text(a).call(id.convertToTspans, n._gd), r; } function Lie(e, t) { var n = ba.ensureSingle(e, "g", Xt.labelsClass), r = t._dims, a = n.selectAll("g." + Xt.labelGroupClass).data(r.labelSteps); a.enter().append("g").classed(Xt.labelGroupClass, !0), a.exit().remove(), a.each(function(i) { var o = di.select(this); o.call(EO, i, t), pi.setTranslate( o, fb(t, i.fraction), Xt.tickOffset + t.ticklen + // position is the baseline of the top line of text only, even // if the label spans multiple lines t.font.size * IO + Xt.labelOffset + r.currentValueTotalHeight ); }); } function WA(e, t, n, r, a) { var i = Math.round(r * (n._stepCount - 1)), o = n._visibleSteps[i]._index; o !== n.active && jO(e, t, n, o, !0, a); } function jO(e, t, n, r, a, i) { var o = n.active; n.active = r, _ie(e.layout, Xt.name, n).applyUpdate("active", r); var l = n.steps[n.active]; t.call(RO, n, i), t.call(Ip, n), e.emit("plotly_sliderchange", { slider: n, step: n.steps[n.active], interaction: a, previousActive: o }), l && l.method && a && (t._nextMethod ? (t._nextMethod.step = l, t._nextMethod.doCallback = a, t._nextMethod.doTransition = i) : (t._nextMethod = { step: l, doCallback: a, doTransition: i }, t._nextMethodRaf = window.requestAnimationFrame(function() { var s = t._nextMethod.step; s.method && (s.execute && Fp.executeAPICommand(e, s.method, s.args), t._nextMethod = null, t._nextMethodRaf = null); }))); } function PO(e, t, n) { if (t._context.staticPlot) return; var r = n.node(), a = di.select(t); function i() { return n.data()[0]; } function o() { var l = i(); t.emit("plotly_sliderstart", { slider: l }); var s = n.select("." + Xt.gripRectClass); di.event.stopPropagation(), di.event.preventDefault(), s.call(hl.fill, l.activebgcolor); var c = ZA(l, di.mouse(r)[0]); WA(t, n, l, c, !0), l._dragging = !0; function u() { var h = i(), g = ZA(h, di.mouse(r)[0]); WA(t, n, h, g, !1); } a.on("mousemove", u), a.on("touchmove", u); function f() { var h = i(); h._dragging = !1, s.call(hl.fill, h.bgcolor), a.on("mouseup", null), a.on("mousemove", null), a.on("touchend", null), a.on("touchmove", null), t.emit("plotly_sliderend", { slider: h, step: h.steps[h.active] }); } a.on("mouseup", f), a.on("touchend", f); } e.on("mousedown", o), e.on("touchstart", o); } function Oie(e, t) { var n = e.selectAll("rect." + Xt.tickRectClass).data(t._visibleSteps), r = t._dims; n.enter().append("rect").classed(Xt.tickRectClass, !0), n.exit().remove(), n.attr({ width: t.tickwidth + "px", "shape-rendering": "crispEdges" }), n.each(function(a, i) { var o = i % r.labelStride === 0, l = di.select(this); l.attr({ height: o ? t.ticklen : t.minorticklen }).call(hl.fill, t.tickcolor), pi.setTranslate( l, fb(t, i / (t._stepCount - 1)) - 0.5 * t.tickwidth, (o ? Xt.tickOffset : Xt.minorTickOffset) + r.currentValueTotalHeight ); }); } function Die(e) { var t = e._dims; t.labelSteps = []; for (var n = e._stepCount, r = 0; r < n; r += t.labelStride) t.labelSteps.push({ fraction: r / (n - 1), step: e._visibleSteps[r] }); } function RO(e, t, n) { for (var r = e.select("rect." + Xt.gripRectClass), a = 0, i = 0; i < t._stepCount; i++) if (t._visibleSteps[i]._index === t.active) { a = i; break; } var o = fb(t, a / (t._stepCount - 1)); if (!t._invokingCommand) { var l = r; n && t.transition.duration > 0 && (l = l.transition().duration(t.transition.duration).ease(t.transition.easing)), l.attr("transform", wie(o - Xt.gripWidth * 0.5, t._dims.currentValueTotalHeight)); } } function fb(e, t) { var n = e._dims; return n.inputAreaStart + Xt.stepInset + (n.inputAreaLength - 2 * Xt.stepInset) * Math.min(1, Math.max(0, t)); } function ZA(e, t) { var n = e._dims; return Math.min(1, Math.max(0, (t - Xt.stepInset - n.inputAreaStart) / (n.inputAreaLength - 2 * Xt.stepInset - 2 * n.inputAreaStart))); } function Fie(e, t, n) { var r = n._dims, a = ba.ensureSingle(e, "rect", Xt.railTouchRectClass, function(i) { i.call(PO, t, e, n).style("pointer-events", "all"); }); a.attr({ width: r.inputAreaLength, height: Math.max(r.inputAreaWidth, Xt.tickOffset + n.ticklen + r.labelHeight) }).call(hl.fill, n.bgcolor).attr("opacity", 0), pi.setTranslate(a, 0, r.currentValueTotalHeight); } function Iie(e, t) { var n = t._dims, r = n.inputAreaLength - Xt.railInset * 2, a = ba.ensureSingle(e, "rect", Xt.railRectClass); a.attr({ width: r, height: Xt.railWidth, rx: Xt.railRadius, ry: Xt.railRadius, "shape-rendering": "crispEdges" }).call(hl.stroke, t.bordercolor).call(hl.fill, t.bgcolor).style("stroke-width", t.borderwidth + "px"), pi.setTranslate( a, Xt.railInset, (n.inputAreaWidth - Xt.railWidth) * 0.5 + n.currentValueTotalHeight ); } var zie = J0, Eie = { moduleType: "component", name: zie.name, layoutAttributes: OO, supplyLayoutDefaults: yie, draw: kie }, YA = fa, hb = { bgcolor: { valType: "color", dflt: YA.background, editType: "plot", description: "Sets the background color of the range slider." }, bordercolor: { valType: "color", dflt: YA.defaultLine, editType: "plot", description: "Sets the border color of the range slider." }, borderwidth: { valType: "integer", dflt: 0, min: 0, editType: "plot", description: "Sets the border width of the range slider." }, autorange: { valType: "boolean", dflt: !0, editType: "calc", impliedEdits: { "range[0]": void 0, "range[1]": void 0 }, description: [ "Determines whether or not the range slider range is", "computed in relation to the input data.", "If `range` is provided, then `autorange` is set to *false*." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "calc", impliedEdits: { "^autorange": !1 } }, { valType: "any", editType: "calc", impliedEdits: { "^autorange": !1 } } ], editType: "calc", impliedEdits: { autorange: !1 }, description: [ "Sets the range of the range slider.", "If not set, defaults to the full xaxis range.", "If the axis `type` is *log*, then you must take the", "log of your desired range.", "If the axis `type` is *date*, it should be date strings,", "like date data, though Date objects and unix milliseconds", "will be accepted and converted to strings.", "If the axis `type` is *category*, it should be numbers,", "using the scale where each category is assigned a serial", "number from zero in the order it appears." ].join(" ") }, thickness: { valType: "number", dflt: 0.15, min: 0, max: 1, editType: "plot", description: [ "The height of the range slider as a fraction of the", "total plot area height." ].join(" ") }, visible: { valType: "boolean", dflt: !0, editType: "calc", description: [ "Determines whether or not the range slider will be visible.", "If visible, perpendicular axes will be set to `fixedrange`" ].join(" ") }, editType: "calc" }, NO = { // not really a 'subplot' attribute container, // but this is the flag we use to denote attributes that // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: !0, rangemode: { valType: "enumerated", values: ["auto", "fixed", "match"], dflt: "match", editType: "calc", description: [ "Determines whether or not the range of this axis in", "the rangeslider use the same value than in the main plot", "when zooming in/out.", "If *auto*, the autorange will be used.", "If *fixed*, the `range` is used.", "If *match*, the current range of the corresponding y-axis on the main subplot is used." ].join(" ") }, range: { valType: "info_array", items: [ { valType: "any", editType: "plot" }, { valType: "any", editType: "plot" } ], editType: "plot", description: [ "Sets the range of this axis for the rangeslider." ].join(" ") }, editType: "calc" }, Q0 = {}, pb = { // attribute container name name: "rangeslider", // class names containerClassName: "rangeslider-container", bgClassName: "rangeslider-bg", rangePlotClassName: "rangeslider-rangeplot", maskMinClassName: "rangeslider-mask-min", maskMaxClassName: "rangeslider-mask-max", slideBoxClassName: "rangeslider-slidebox", grabberMinClassName: "rangeslider-grabber-min", grabAreaMinClassName: "rangeslider-grabarea-min", handleMinClassName: "rangeslider-handle-min", grabberMaxClassName: "rangeslider-grabber-max", grabAreaMaxClassName: "rangeslider-grabarea-max", handleMaxClassName: "rangeslider-handle-max", maskMinOppAxisClassName: "rangeslider-mask-min-opp-axis", maskMaxOppAxisClassName: "rangeslider-mask-max-opp-axis", // style constants maskColor: "rgba(0,0,0,0.4)", maskOppAxisColor: "rgba(0,0,0,0.2)", slideBoxFill: "transparent", slideBoxCursor: "ew-resize", grabAreaFill: "transparent", grabAreaCursor: "col-resize", grabAreaWidth: 10, handleWidth: 4, handleRadius: 1, handleStrokeWidth: 1, extraPad: 15 }, jie = mr, Pie = Ir, BO = pb, Rie = Nr.LINE_SPACING, zp = BO.name; function HO(e) { var t = e && e[zp]; return t && t.visible; } Q0.isVisible = HO; Q0.makeData = function(e) { var t = jie.list({ _fullLayout: e }, "x", !0), n = e.margin, r = []; if (!e._has("gl2d")) for (var a = 0; a < t.length; a++) { var i = t[a]; if (HO(i)) { r.push(i); var o = i[zp]; o._id = zp + i._id, o._height = (e.height - n.b - n.t) * o.thickness, o._offsetShift = Math.floor(o.borderwidth / 2); } } e._rangeSliderData = r; }; Q0.autoMarginOpts = function(e, t) { var n = e._fullLayout, r = t[zp], a = t._id.charAt(0), i = 0, o = 0; if (t.side === "bottom" && (i = t._depth, t.title.text !== n._dfltTitle[a])) { o = 1.5 * t.title.font.size + 10 + r._offsetShift; var l = (t.title.text.match(Pie.BR_TAG_ALL) || []).length; o += l * t.title.font.size * Rie; } return { x: 0, y: t._counterDomainMin, l: 0, r: 0, t: 0, b: r._height + i + Math.max(n.margin.b, o), pad: BO.extraPad + r._offsetShift * 2 }; }; var fm, $A; function Nie() { if ($A) return fm; $A = 1; var e = Ue, t = Sn, n = mr, r = hb, a = NO; return fm = function(i, o, l) { var s = i[l], c = o[l]; if (!(s.rangeslider || o._requestRangeslider[c._id])) return; e.isPlainObject(s.rangeslider) || (s.rangeslider = {}); var u = s.rangeslider, f = t.newContainer(c, "rangeslider"); function h(C, I) { return e.coerce(u, f, r, C, I); } var g, p; function v(C, I) { return e.coerce(g, p, a, C, I); } var y = h("visible"); if (y) { h("bgcolor", o.plot_bgcolor), h("bordercolor"), h("borderwidth"), h("thickness"), h("autorange", !c.isValidRange(u.range)), h("range"); var m = o._subplots; if (m) for (var b = m.cartesian.filter(function(C) { return C.substr(0, C.indexOf("y")) === n.name2id(l); }).map(function(C) { return C.substr(C.indexOf("y"), C.length); }), w = e.simpleMap(b, n.id2name), _ = 0; _ < w.length; _++) { var k = w[_]; g = u[k] || {}, p = t.newContainer(f, k, "yaxis"); var T = o[k], O; g.range && T.isValidRange(g.range) && (O = "fixed"); var M = v("rangemode", O); M !== "match" && v("range", T.range.slice()); } f._input = u; } }, fm; } var hm, KA; function Bie() { if (KA) return hm; KA = 1; var e = mr.list, t = L0.getAutoRange, n = pb; return hm = function(r) { for (var a = e(r, "x", !0), i = 0; i < a.length; i++) { var o = a[i], l = o[n.name]; l && l.visible && l.autorange && (l._input.autorange = !0, l._input.range = l.range = t(r, o)); } }, hm; } var pm, JA; function Hie() { if (JA) return pm; JA = 1; var e = sn, t = Rt, n = kr, r = Ue, a = r.strTranslate, i = Cn, o = rn, l = C0, s = yr, c = mr, u = Xi, f = bs, h = pb; pm = function(M) { for (var C = M._fullLayout, I = C._rangeSliderData, j = 0; j < I.length; j++) { var P = I[j][h.name]; P._clipId = P._id + "-" + C._uid; } function N(J) { return J._name; } var W = C._infolayer.selectAll("g." + h.containerClassName).data(I, N); W.exit().each(function(J) { var U = J[h.name]; C._topdefs.select("#" + U._clipId).remove(); }).remove(), I.length !== 0 && (W.enter().append("g").classed(h.containerClassName, !0).attr("pointer-events", "all"), W.each(function(J) { var U = e.select(this), E = J[h.name], z = C[c.id2name(J.anchor)], F = E[c.id2name(J.anchor)]; if (E.range) { var q = r.simpleMap(E.range, J.r2l), H = r.simpleMap(J.range, J.r2l), K; H[0] < H[1] ? K = [ Math.min(q[0], H[0]), Math.max(q[1], H[1]) ] : K = [ Math.max(q[0], H[0]), Math.min(q[1], H[1]) ], E.range = E._input.range = r.simpleMap(K, J.l2r); } J.cleanRange("rangeslider.range"); var Q = C._size, re = J.domain; E._width = Q.w * (re[1] - re[0]); var te = Math.round(Q.l + Q.w * re[0]), X = Math.round( Q.t + Q.h * (1 - J._counterDomainMin) + (J.side === "bottom" ? J._depth : 0) + E._offsetShift + h.extraPad ); U.attr("transform", a(te, X)), E._rl = r.simpleMap(E.range, J.r2l); var ce = E._rl[0], B = E._rl[1], G = B - ce; if (E.p2d = function(Ie) { return Ie / E._width * G + ce; }, E.d2p = function(Ie) { return (Ie - ce) / G * E._width; }, J.rangebreaks) { var Z = J.locateBreaks(ce, B); if (Z.length) { var oe, ae, ge = 0; for (oe = 0; oe < Z.length; oe++) ae = Z[oe], ge += ae.max - ae.min; var ve = E._width / (B - ce - ge), pe = [-ve * ce]; for (oe = 0; oe < Z.length; oe++) ae = Z[oe], pe.push(pe[pe.length - 1] - ve * (ae.max - ae.min)); for (E.d2p = function(Ie) { for (var Fe = pe[0], Re = 0; Re < Z.length; Re++) { var We = Z[Re]; if (Ie >= We.max) Fe = pe[Re + 1]; else if (Ie < We.min) break; } return Fe + ve * Ie; }, oe = 0; oe < Z.length; oe++) ae = Z[oe], ae.pmin = E.d2p(ae.min), ae.pmax = E.d2p(ae.max); E.p2d = function(Ie) { for (var Fe = pe[0], Re = 0; Re < Z.length; Re++) { var We = Z[Re]; if (Ie >= We.pmax) Fe = pe[Re + 1]; else if (Ie < We.pmin) break; } return (Ie - Fe) / ve; }; } } if (F.rangemode !== "match") { var ye = z.r2l(F.range[0]), Oe = z.r2l(F.range[1]), Be = Oe - ye; E.d2pOppAxis = function(Ie) { return (Ie - ye) / Be * E._height; }; } U.call(m, M, J, E).call(b, M, J, E).call(w, M, J, E).call(k, M, J, E, F).call(T, M, J, E).call(O, M, J, E), p(U, M, J, E), y(U, M, J, E, z, F), J.side === "bottom" && l.draw(M, J._id + "title", { propContainer: J, propName: J._name + ".title", placeholder: C._dfltTitle.x, attributes: { x: J._offset + J._length / 2, y: X + E._height + E._offsetShift + 10 + 1.5 * J.title.font.size, "text-anchor": "middle" } }); })); }; function g(M) { return typeof M.clientX == "number" ? M.clientX : M.touches && M.touches.length > 0 ? M.touches[0].clientX : 0; } function p(M, C, I, j) { if (C._context.staticPlot) return; var P = M.select("rect." + h.slideBoxClassName).node(), N = M.select("rect." + h.grabAreaMinClassName).node(), W = M.select("rect." + h.grabAreaMaxClassName).node(); function J() { var U = e.event, E = U.target, z = g(U), F = z - M.node().getBoundingClientRect().left, q = j.d2p(I._rl[0]), H = j.d2p(I._rl[1]), K = u.coverSlip(); this.addEventListener("touchmove", Q), this.addEventListener("touchend", re), K.addEventListener("mousemove", Q), K.addEventListener("mouseup", re); function Q(te) { var X = g(te), ce = +X - z, B, G, Z; switch (E) { case P: if (Z = "ew-resize", q + ce > I._length || H + ce < 0) return; B = q + ce, G = H + ce; break; case N: if (Z = "col-resize", q + ce > I._length) return; B = q + ce, G = H; break; case W: if (Z = "col-resize", H + ce < 0) return; B = q, G = H + ce; break; default: Z = "ew-resize", B = F, G = F + ce; break; } if (G < B) { var oe = G; G = B, B = oe; } j._pixelMin = B, j._pixelMax = G, f(e.select(K), Z), v(M, C, I, j); } function re() { K.removeEventListener("mousemove", Q), K.removeEventListener("mouseup", re), this.removeEventListener("touchmove", Q), this.removeEventListener("touchend", re), r.removeElement(K); } } M.on("mousedown", J), M.on("touchstart", J); } function v(M, C, I, j) { function P(J) { return I.l2r(r.constrain(J, j._rl[0], j._rl[1])); } var N = P(j.p2d(j._pixelMin)), W = P(j.p2d(j._pixelMax)); window.requestAnimationFrame(function() { t.call("_guiRelayout", C, I._name + ".range", [N, W]); }); } function y(M, C, I, j, P, N) { var W = h.handleWidth / 2; function J(te) { return r.constrain(te, 0, j._width); } function U(te) { return r.constrain(te, 0, j._height); } function E(te) { return r.constrain(te, -W, j._width + W); } var z = J(j.d2p(I._rl[0])), F = J(j.d2p(I._rl[1])); if (M.select("rect." + h.slideBoxClassName).attr("x", z).attr("width", F - z), M.select("rect." + h.maskMinClassName).attr("width", z), M.select("rect." + h.maskMaxClassName).attr("x", F).attr("width", j._width - F), N.rangemode !== "match") { var q = j._height - U(j.d2pOppAxis(P._rl[1])), H = j._height - U(j.d2pOppAxis(P._rl[0])); M.select("rect." + h.maskMinOppAxisClassName).attr("x", z).attr("height", q).attr("width", F - z), M.select("rect." + h.maskMaxOppAxisClassName).attr("x", z).attr("y", H).attr("height", j._height - H).attr("width", F - z), M.select("rect." + h.slideBoxClassName).attr("y", q).attr("height", H - q); } var K = 0.5, Q = Math.round(E(z - W)) - K, re = Math.round(E(F - W)) + K; M.select("g." + h.grabberMinClassName).attr("transform", a(Q, K)), M.select("g." + h.grabberMaxClassName).attr("transform", a(re, K)); } function m(M, C, I, j) { var P = r.ensureSingle(M, "rect", h.bgClassName, function(U) { U.attr({ x: 0, y: 0, "shape-rendering": "crispEdges" }); }), N = j.borderwidth % 2 === 0 ? j.borderwidth : j.borderwidth - 1, W = -j._offsetShift, J = i.crispRound(C, j.borderwidth); P.attr({ width: j._width + N, height: j._height + N, transform: a(W, W), "stroke-width": J }).call(o.stroke, j.bordercolor).call(o.fill, j.bgcolor); } function b(M, C, I, j) { var P = C._fullLayout, N = r.ensureSingleById(P._topdefs, "clipPath", j._clipId, function(W) { W.append("rect").attr({ x: 0, y: 0 }); }); N.select("rect").attr({ width: j._width, height: j._height }); } function w(M, C, I, j) { var P = C.calcdata, N = M.selectAll("g." + h.rangePlotClassName).data(I._subplotsWith, r.identity); N.enter().append("g").attr("class", function(J) { return h.rangePlotClassName + " " + J; }).call(i.setClipUrl, j._clipId, C), N.order(), N.exit().remove(); var W; N.each(function(J, U) { var E = e.select(this), z = U === 0, F = c.getFromId(C, J, "y"), q = F._name, H = j[q], K = { data: [], layout: { xaxis: { type: I.type, domain: [0, 1], range: j.range.slice(), calendar: I.calendar }, width: j._width, height: j._height, margin: { t: 0, b: 0, l: 0, r: 0 } }, _context: C._context }; I.rangebreaks && (K.layout.xaxis.rangebreaks = I.rangebreaks), K.layout[q] = { type: F.type, domain: [0, 1], range: H.rangemode !== "match" ? H.range.slice() : F.range.slice(), calendar: F.calendar }, F.rangebreaks && (K.layout[q].rangebreaks = F.rangebreaks), n.supplyDefaults(K); var Q = K._fullLayout.xaxis, re = K._fullLayout[q]; Q.clearCalc(), Q.setScale(), re.clearCalc(), re.setScale(); var te = { id: J, plotgroup: E, xaxis: Q, yaxis: re, isRangePlot: !0 }; z ? W = te : (te.mainplot = "xy", te.mainplotinfo = W), s.rangePlot(C, te, _(P, J)); }); } function _(M, C) { for (var I = [], j = 0; j < M.length; j++) { var P = M[j], N = P[0].trace; N.xaxis + N.yaxis === C && I.push(P); } return I; } function k(M, C, I, j, P) { var N = r.ensureSingle(M, "rect", h.maskMinClassName, function(E) { E.attr({ x: 0, y: 0, "shape-rendering": "crispEdges" }); }); N.attr("height", j._height).call(o.fill, h.maskColor); var W = r.ensureSingle(M, "rect", h.maskMaxClassName, function(E) { E.attr({ y: 0, "shape-rendering": "crispEdges" }); }); if (W.attr("height", j._height).call(o.fill, h.maskColor), P.rangemode !== "match") { var J = r.ensureSingle(M, "rect", h.maskMinOppAxisClassName, function(E) { E.attr({ y: 0, "shape-rendering": "crispEdges" }); }); J.attr("width", j._width).call(o.fill, h.maskOppAxisColor); var U = r.ensureSingle(M, "rect", h.maskMaxOppAxisClassName, function(E) { E.attr({ y: 0, "shape-rendering": "crispEdges" }); }); U.attr("width", j._width).style("border-top", h.maskOppBorder).call(o.fill, h.maskOppAxisColor); } } function T(M, C, I, j) { if (!C._context.staticPlot) { var P = r.ensureSingle(M, "rect", h.slideBoxClassName, function(N) { N.attr({ y: 0, cursor: h.slideBoxCursor, "shape-rendering": "crispEdges" }); }); P.attr({ height: j._height, fill: h.slideBoxFill }); } } function O(M, C, I, j) { var P = r.ensureSingle(M, "g", h.grabberMinClassName), N = r.ensureSingle(M, "g", h.grabberMaxClassName), W = { x: 0, width: h.handleWidth, rx: h.handleRadius, fill: o.background, stroke: o.defaultLine, "stroke-width": h.handleStrokeWidth, "shape-rendering": "crispEdges" }, J = { y: Math.round(j._height / 4), height: Math.round(j._height / 2) }, U = r.ensureSingle(P, "rect", h.handleMinClassName, function(H) { H.attr(W); }); U.attr(J); var E = r.ensureSingle(N, "rect", h.handleMaxClassName, function(H) { H.attr(W); }); E.attr(J); var z = { width: h.grabAreaWidth, x: 0, y: 0, fill: h.grabAreaFill, cursor: C._context.staticPlot ? void 0 : h.grabAreaCursor }, F = r.ensureSingle(P, "rect", h.grabAreaMinClassName, function(H) { H.attr(z); }); F.attr("height", j._height); var q = r.ensureSingle(N, "rect", h.grabAreaMaxClassName, function(H) { H.attr(z); }); q.attr("height", j._height); } return pm; } var Vie = Ue, qie = hb, Uie = NO, gm = Q0, Gie = { moduleType: "component", name: "rangeslider", schema: { subplots: { xaxis: { rangeslider: Vie.extendFlat({}, qie, { yaxis: Uie }) } } }, layoutAttributes: hb, handleDefaults: Nie(), calcAutorange: Bie(), draw: Hie(), isVisible: gm.isVisible, makeData: gm.makeData, autoMarginOpts: gm.autoMarginOpts }, Wie = Fr, QA = fa, Zie = Sn.templatedArray, Yie = Zie("button", { visible: { valType: "boolean", dflt: !0, editType: "plot", description: "Determines whether or not this button is visible." }, step: { valType: "enumerated", values: ["month", "year", "day", "hour", "minute", "second", "all"], dflt: "month", editType: "plot", description: [ "The unit of measurement that the `count` value will set the range by." ].join(" ") }, stepmode: { valType: "enumerated", values: ["backward", "todate"], dflt: "backward", editType: "plot", description: [ "Sets the range update mode.", "If *backward*, the range update shifts the start of range", "back *count* times *step* milliseconds.", "If *todate*, the range update shifts the start of range", "back to the first timestamp from *count* times", "*step* milliseconds back.", "For example, with `step` set to *year* and `count` set to *1*", "the range update shifts the start of the range back to", "January 01 of the current year.", "Month and year *todate* are currently available only", "for the built-in (Gregorian) calendar." ].join(" ") }, count: { valType: "number", min: 0, dflt: 1, editType: "plot", description: [ "Sets the number of steps to take to update the range.", "Use with `step` to specify the update interval." ].join(" ") }, label: { valType: "string", editType: "plot", description: "Sets the text label to appear on the button." }, editType: "plot", description: [ "Sets the specifications for each buttons.", "By default, a range selector comes with no buttons." ].join(" ") }), $y = { visible: { valType: "boolean", editType: "plot", description: [ "Determines whether or not this range selector is visible.", "Note that range selectors are only available for x axes of", "`type` set to or auto-typed to *date*." ].join(" ") }, buttons: Yie, x: { valType: "number", min: -2, max: 3, editType: "plot", description: "Sets the x position (in normalized coordinates) of the range selector." }, xanchor: { valType: "enumerated", values: ["auto", "left", "center", "right"], dflt: "left", editType: "plot", description: [ "Sets the range selector's horizontal position anchor.", "This anchor binds the `x` position to the *left*, *center*", "or *right* of the range selector." ].join(" ") }, y: { valType: "number", min: -2, max: 3, editType: "plot", description: "Sets the y position (in normalized coordinates) of the range selector." }, yanchor: { valType: "enumerated", values: ["auto", "top", "middle", "bottom"], dflt: "bottom", editType: "plot", description: [ "Sets the range selector's vertical position anchor", "This anchor binds the `y` position to the *top*, *middle*", "or *bottom* of the range selector." ].join(" ") }, font: Wie({ editType: "plot", description: "Sets the font of the range selector button text." }), bgcolor: { valType: "color", dflt: QA.lightLine, editType: "plot", description: "Sets the background color of the range selector buttons." }, activecolor: { valType: "color", editType: "plot", description: "Sets the background color of the active range selector button." }, bordercolor: { valType: "color", dflt: QA.defaultLine, editType: "plot", description: "Sets the color of the border enclosing the range selector." }, borderwidth: { valType: "number", min: 0, dflt: 0, editType: "plot", description: "Sets the width (in px) of the border enclosing the range selector." }, editType: "plot" }, VO = { // 'y' position pad above counter axis domain yPad: 0.02, // minimum button width (regardless of text size) minButtonWidth: 30, // buttons rect radii rx: 3, ry: 3, // light fraction used to compute the 'activecolor' default lightAmount: 25, darkAmount: 10 }, Zh = Ue, $ie = rn, Kie = Sn, Jie = Qi, qO = $y, Ky = VO, Qie = function(e, t, n, r, a) { var i = e.rangeselector || {}, o = Kie.newContainer(t, "rangeselector"); function l(h, g) { return Zh.coerce(i, o, qO, h, g); } var s = Jie(i, o, { name: "buttons", handleItemDefaults: Xie, calendar: a }), c = l("visible", s.length > 0); if (c) { var u = eoe(t, n, r); l("x", u[0]), l("y", u[1]), Zh.noneOrAll(e, t, ["x", "y"]), l("xanchor"), l("yanchor"), Zh.coerceFont(l, "font", n.font); var f = l("bgcolor"); l("activecolor", $ie.contrast(f, Ky.lightAmount, Ky.darkAmount)), l("bordercolor"), l("borderwidth"); } }; function Xie(e, t, n, r) { var a = r.calendar; function i(s, c) { return Zh.coerce(e, t, qO.buttons, s, c); } var o = i("visible"); if (o) { var l = i("step"); l !== "all" && (a && a !== "gregorian" && (l === "month" || l === "year") ? t.stepmode = "backward" : i("stepmode"), i("count")), i("label"); } } function eoe(e, t, n) { for (var r = n.filter(function(l) { return t[l].anchor === e._id; }), a = 0, i = 0; i < r.length; i++) { var o = t[r[i]].domain; o && (a = Math.max(o[1], a)); } return [e.domain[0], a + Ky.yPad]; } const toe = /* @__PURE__ */ t0(GH); var noe = toe, roe = Ue.titleCase, aoe = function(e, t) { var n = e._name, r = {}; if (t.step === "all") r[n + ".autorange"] = !0; else { var a = ioe(e, t); r[n + ".range[0]"] = a[0], r[n + ".range[1]"] = a[1]; } return r; }; function ioe(e, t) { var n = e.range, r = new Date(e.r2l(n[1])), a = t.step, i = noe["utc" + roe(a)], o = t.count, l; switch (t.stepmode) { case "backward": l = e.l2r(+i.offset(r, -o)); break; case "todate": var s = i.offset(r, -o); l = e.l2r(+i.ceil(s)); break; } var c = n[1]; return [l, c]; } var Ep = sn, ooe = Rt, loe = kr, XA = rn, UO = Cn, mo = Ue, eM = mo.strTranslate, Yh = Ir, soe = mr, gb = Nr, tM = gb.LINE_SPACING, nM = gb.FROM_TL, rM = gb.FROM_BR, Jy = VO, coe = aoe, uoe = function(e) { var t = e._fullLayout, n = t._infolayer.selectAll(".rangeselector").data(doe(e), foe); n.enter().append("g").classed("rangeselector", !0), n.exit().remove(), n.style({ cursor: "pointer", "pointer-events": "all" }), n.each(function(r) { var a = Ep.select(this), i = r, o = i.rangeselector, l = a.selectAll("g.button").data(mo.filterVisible(o.buttons)); l.enter().append("g").classed("button", !0), l.exit().remove(), l.each(function(s) { var c = Ep.select(this), u = coe(i, s); s._isActive = hoe(i, s, u), c.call(vm, o, s), c.call(goe, o, s, e), c.on("click", function() { e._dragged || ooe.call("_guiRelayout", e, u); }), c.on("mouseover", function() { s._isHovered = !0, c.call(vm, o, s); }), c.on("mouseout", function() { s._isHovered = !1, c.call(vm, o, s); }); }), moe(e, l, o, i._name, a); }); }; function doe(e) { for (var t = soe.list(e, "x", !0), n = [], r = 0; r < t.length; r++) { var a = t[r]; a.rangeselector && a.rangeselector.visible && n.push(a); } return n; } function foe(e) { return e._id; } function hoe(e, t, n) { if (t.step === "all") return e.autorange === !0; var r = Object.keys(n); return e.range[0] === n[r[0]] && e.range[1] === n[r[1]]; } function vm(e, t, n) { var r = mo.ensureSingle(e, "rect", "selector-rect", function(a) { a.attr("shape-rendering", "crispEdges"); }); r.attr({ rx: Jy.rx, ry: Jy.ry }), r.call(XA.stroke, t.bordercolor).call(XA.fill, poe(t, n)).style("stroke-width", t.borderwidth + "px"); } function poe(e, t) { return t._isActive || t._isHovered ? e.activecolor : e.bgcolor; } function goe(e, t, n, r) { function a(o) { Yh.convertToTspans(o, r); } var i = mo.ensureSingle(e, "text", "selector-text", function(o) { o.attr("text-anchor", "middle"); }); i.call(UO.font, t.font).text(voe(n, r._fullLayout._meta)).call(a); } function voe(e, t) { return e.label ? t ? mo.templateString(e.label, t) : e.label : e.step === "all" ? "all" : e.count + e.step.charAt(0); } function moe(e, t, n, r, a) { var i = 0, o = 0, l = n.borderwidth; t.each(function() { var g = Ep.select(this), p = g.select(".selector-text"), v = n.font.size * tM, y = Math.max(v * Yh.lineCount(p), 16) + 3; o = Math.max(o, y); }), t.each(function() { var g = Ep.select(this), p = g.select(".selector-rect"), v = g.select(".selector-text"), y = v.node() && UO.bBox(v.node()).width, m = n.font.size * tM, b = Yh.lineCount(v), w = Math.max(y + 10, Jy.minButtonWidth); g.attr("transform", eM(l + i, l)), p.attr({ x: 0, y: 0, width: w, height: o }), Yh.positionText( v, w / 2, o / 2 - (b - 1) * m / 2 + 3 ), i += w + 5; }); var s = e._fullLayout._size, c = s.l + s.w * n.x, u = s.t + s.h * (1 - n.y), f = "left"; mo.isRightAnchor(n) && (c -= i, f = "right"), mo.isCenterAnchor(n) && (c -= i / 2, f = "center"); var h = "top"; mo.isBottomAnchor(n) && (u -= o, h = "bottom"), mo.isMiddleAnchor(n) && (u -= o / 2, h = "middle"), i = Math.ceil(i), o = Math.ceil(o), c = Math.round(c), u = Math.round(u), loe.autoMargin(e, r + "-range-selector", { x: n.x, y: n.y, l: i * nM[f], r: i * rM[f], b: o * rM[h], t: o * nM[h] }), a.attr("transform", eM(c, u)); } var yoe = { moduleType: "component", name: "rangeselector", schema: { subplots: { xaxis: { rangeselector: $y } } }, layoutAttributes: $y, handleDefaults: Qie, draw: uoe }, vb = {}, aM = tr.extendFlat; vb.attributes = function(e, t) { e = e || {}, t = t || {}; var n = { valType: "info_array", editType: e.editType, items: [ { valType: "number", min: 0, max: 1, editType: e.editType }, { valType: "number", min: 0, max: 1, editType: e.editType } ], dflt: [0, 1] }, r = e.name ? e.name + " " : "", a = e.trace ? "trace " : "subplot ", i = t.description ? " " + t.description : "", o = { x: aM({}, n, { description: [ "Sets the horizontal domain of this ", r, a, "(in plot fraction).", i ].join("") }), y: aM({}, n, { description: [ "Sets the vertical domain of this ", r, a, "(in plot fraction).", i ].join("") }), editType: e.editType }; return e.noGridCell || (o.row = { valType: "integer", min: 0, dflt: 0, editType: e.editType, description: [ "If there is a layout grid, use the domain ", "for this row in the grid for this ", r, a, ".", i ].join("") }, o.column = { valType: "integer", min: 0, dflt: 0, editType: e.editType, description: [ "If there is a layout grid, use the domain ", "for this column in the grid for this ", r, a, ".", i ].join("") }), o; }; vb.defaults = function(e, t, n, r) { var a = r && r.x || [0, 1], i = r && r.y || [0, 1], o = t.grid; if (o) { var l = n("domain.column"); l !== void 0 && (l < o.columns ? a = o._domains.x[l] : delete e.domain.column); var s = n("domain.row"); s !== void 0 && (s < o.rows ? i = o._domains.y[s] : delete e.domain.row); } var c = n("domain.x", a), u = n("domain.y", i); c[0] < c[1] || (e.domain.x = a.slice()), u[0] < u[1] || (e.domain.y = i.slice()); }; var xoe = Ue, boe = Zc.counter, woe = vb.attributes, iM = $r.idRegex, _oe = Sn, Qy = { rows: { valType: "integer", min: 1, editType: "plot", description: [ "The number of rows in the grid. If you provide a 2D `subplots`", "array or a `yaxes` array, its length is used as the default.", "But it's also possible to have a different length, if you", "want to leave a row at the end for non-cartesian subplots." ].join(" ") }, roworder: { valType: "enumerated", values: ["top to bottom", "bottom to top"], dflt: "top to bottom", editType: "plot", description: [ "Is the first row the top or the bottom? Note that columns", "are always enumerated from left to right." ].join(" ") }, columns: { valType: "integer", min: 1, editType: "plot", description: [ "The number of columns in the grid. If you provide a 2D `subplots`", "array, the length of its longest row is used as the default.", "If you give an `xaxes` array, its length is used as the default.", "But it's also possible to have a different length, if you", "want to leave a row at the end for non-cartesian subplots." ].join(" ") }, subplots: { valType: "info_array", freeLength: !0, dimensions: 2, items: { valType: "enumerated", values: [boe("xy").toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used for freeform grids, where some axes may be shared across subplots", "but others are not. Each entry should be a cartesian subplot id, like", "*xy* or *x3y2*, or ** to leave that cell empty. You may reuse x axes", "within the same column, and y axes within the same row.", "Non-cartesian subplots and traces that support `domain` can place themselves", "in this grid separately using the `gridcell` attribute." ].join(" ") }, xaxes: { valType: "info_array", freeLength: !0, items: { valType: "enumerated", values: [iM.x.toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used with `yaxes` when the x and y axes are shared across columns and rows.", "Each entry should be an x axis id like *x*, *x2*, etc., or ** to", "not put an x axis in that column. Entries other than ** must be unique.", "Ignored if `subplots` is present. If missing but `yaxes` is present,", "will generate consecutive IDs." ].join(" ") }, yaxes: { valType: "info_array", freeLength: !0, items: { valType: "enumerated", values: [iM.y.toString(), ""], editType: "plot" }, editType: "plot", description: [ "Used with `yaxes` when the x and y axes are shared across columns and rows.", "Each entry should be an y axis id like *y*, *y2*, etc., or ** to", "not put a y axis in that row. Entries other than ** must be unique.", "Ignored if `subplots` is present. If missing but `xaxes` is present,", "will generate consecutive IDs." ].join(" ") }, pattern: { valType: "enumerated", values: ["independent", "coupled"], dflt: "coupled", editType: "plot", description: [ "If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`,", "we can generate defaults using consecutive axis IDs, in two ways:", "*coupled* gives one x axis per column and one y axis per row.", "*independent* uses a new xy pair for each cell, left-to-right across each row", "then iterating rows according to `roworder`." ].join(" ") }, xgap: { valType: "number", min: 0, max: 1, editType: "plot", description: [ "Horizontal space between grid cells, expressed as a fraction", "of the total width available to one cell. Defaults to 0.1", "for coupled-axes grids and 0.2 for independent grids." ].join(" ") }, ygap: { valType: "number", min: 0, max: 1, editType: "plot", description: [ "Vertical space between grid cells, expressed as a fraction", "of the total height available to one cell. Defaults to 0.1", "for coupled-axes grids and 0.3 for independent grids." ].join(" ") }, domain: woe({ name: "grid", editType: "plot", noGridCell: !0 }, { description: [ "The first and last cells end exactly at the domain", "edges, with no grout around the edges." ].join(" ") }), xside: { valType: "enumerated", values: ["bottom", "bottom plot", "top plot", "top"], dflt: "bottom plot", editType: "plot", description: [ "Sets where the x axis labels and titles go. *bottom* means", "the very bottom of the grid. *bottom plot* is the lowest plot", "that each x axis is used in. *top* and *top plot* are similar." ].join(" ") }, yside: { valType: "enumerated", values: ["left", "left plot", "right plot", "right"], dflt: "left plot", editType: "plot", description: [ "Sets where the y axis labels and titles go. *left* means", "the very left edge of the grid. *left plot* is the leftmost plot", "that each y axis is used in. *right* and *right plot* are similar." ].join(" ") }, editType: "plot" }; function jp(e, t, n) { var r = t[n + "axes"], a = Object.keys((e._splomAxes || {})[n] || {}); if (Array.isArray(r)) return r; if (a.length) return a; } function koe(e, t) { var n = e.grid || {}, r = jp(t, n, "x"), a = jp(t, n, "y"); if (!e.grid && !r && !a) return; var i = Array.isArray(n.subplots) && Array.isArray(n.subplots[0]), o = Array.isArray(r), l = Array.isArray(a), s = o && r !== n.xaxes && l && a !== n.yaxes, c, u; i ? (c = n.subplots.length, u = n.subplots[0].length) : (l && (c = a.length), o && (u = r.length)); var f = _oe.newContainer(t, "grid"); function h(T, O) { return xoe.coerce(n, f, Qy, T, O); } var g = h("rows", c), p = h("columns", u); if (!(g * p > 1)) { delete t.grid; return; } if (!i && !o && !l) { var v = h("pattern") === "independent"; v && (i = !0); } f._hasSubplotGrid = i; var y = h("roworder"), m = y === "top to bottom", b = i ? 0.2 : 0.1, w = i ? 0.3 : 0.1, _, k; s && t._splomGridDflt && (_ = t._splomGridDflt.xside, k = t._splomGridDflt.yside), f._domains = { x: oM("x", h, b, _, p), y: oM("y", h, w, k, g, m) }; } function oM(e, t, n, r, a, i) { var o = t(e + "gap", n), l = t("domain." + e); t(e + "side", r); for (var s = new Array(a), c = l[0], u = (l[1] - c) / (a - o), f = u * (1 - o), h = 0; h < a; h++) { var g = c + u * h; s[i ? a - 1 - h : h] = [g, g + f]; } return s; } function Toe(e, t) { var n = t.grid; if (!(!n || !n._domains)) { var r = e.grid || {}, a = t._subplots, i = n._hasSubplotGrid, o = n.rows, l = n.columns, s = n.pattern === "independent", c, u, f, h, g, p, v, y = n._axisMap = {}; if (i) { var m = r.subplots || []; p = n.subplots = new Array(o); var b = 1; for (c = 0; c < o; c++) { var w = p[c] = new Array(l), _ = m[c] || []; for (u = 0; u < l; u++) if (s ? (g = b === 1 ? "xy" : "x" + b + "y" + b, b++) : g = _[u], w[u] = "", a.cartesian.indexOf(g) !== -1) { if (v = g.indexOf("y"), f = g.slice(0, v), h = g.slice(v), y[f] !== void 0 && y[f] !== u || y[h] !== void 0 && y[h] !== c) continue; w[u] = g, y[f] = u, y[h] = c; } } } else { var k = jp(t, r, "x"), T = jp(t, r, "y"); n.xaxes = lM(k, a.xaxis, l, y, "x"), n.yaxes = lM(T, a.yaxis, o, y, "y"); } var O = n._anchors = {}, M = n.roworder === "top to bottom"; for (var C in y) { var I = C.charAt(0), j = n[I + "side"], P, N, W; if (j.length < 8) O[C] = "free"; else if (I === "x") { if (j.charAt(0) === "t" === M ? (P = 0, N = 1, W = o) : (P = o - 1, N = -1, W = -1), i) { var J = y[C]; for (c = P; c !== W; c += N) if (g = p[c][J], !!g && (v = g.indexOf("y"), g.slice(0, v) === C)) { O[C] = g.slice(v); break; } } else for (c = P; c !== W; c += N) if (h = n.yaxes[c], a.cartesian.indexOf(C + h) !== -1) { O[C] = h; break; } } else if (j.charAt(0) === "l" ? (P = 0, N = 1, W = l) : (P = l - 1, N = -1, W = -1), i) { var U = y[C]; for (c = P; c !== W; c += N) if (g = p[U][c], !!g && (v = g.indexOf("y"), g.slice(v) === C)) { O[C] = g.slice(0, v); break; } } else for (c = P; c !== W; c += N) if (f = n.xaxes[c], a.cartesian.indexOf(f + C) !== -1) { O[C] = f; break; } } } } function lM(e, t, n, r, a) { var i = new Array(n), o; function l(s, c) { t.indexOf(c) !== -1 && r[c] === void 0 ? (i[s] = c, r[c] = s) : i[s] = ""; } if (Array.isArray(e)) for (o = 0; o < n; o++) l(o, e[o]); else for (l(0, a), o = 1; o < n; o++) l(o, a + (o + 1)); return i; } var Aoe = { moduleType: "component", name: "grid", schema: { layout: { grid: Qy } }, layoutAttributes: Qy, sizeDefaults: koe, contentDefaults: Toe }, GO = { visible: { valType: "boolean", editType: "calc", description: [ "Determines whether or not this set of error bars is visible." ].join(" ") }, type: { valType: "enumerated", values: ["percent", "constant", "sqrt", "data"], editType: "calc", description: [ "Determines the rule used to generate the error bars.", "If *constant`, the bar lengths are of a constant value.", "Set this constant in `value`.", "If *percent*, the bar lengths correspond to a percentage of", "underlying data. Set this percentage in `value`.", "If *sqrt*, the bar lengths correspond to the square of the", "underlying data.", "If *data*, the bar lengths are set with data set `array`." ].join(" ") }, symmetric: { valType: "boolean", editType: "calc", description: [ "Determines whether or not the error bars have the same length", "in both direction", "(top/bottom for vertical bars, left/right for horizontal bars." ].join(" ") }, array: { valType: "data_array", editType: "calc", description: [ "Sets the data corresponding the length of each error bar.", "Values are plotted relative to the underlying data." ].join(" ") }, arrayminus: { valType: "data_array", editType: "calc", description: [ "Sets the data corresponding the length of each error bar in the", "bottom (left) direction for vertical (horizontal) bars", "Values are plotted relative to the underlying data." ].join(" ") }, value: { valType: "number", min: 0, dflt: 10, editType: "calc", description: [ "Sets the value of either the percentage", "(if `type` is set to *percent*) or the constant", "(if `type` is set to *constant*) corresponding to the lengths of", "the error bars." ].join(" ") }, valueminus: { valType: "number", min: 0, dflt: 10, editType: "calc", description: [ "Sets the value of either the percentage", "(if `type` is set to *percent*) or the constant", "(if `type` is set to *constant*) corresponding to the lengths of", "the error bars in the", "bottom (left) direction for vertical (horizontal) bars" ].join(" ") }, traceref: { valType: "integer", min: 0, dflt: 0, editType: "style" }, tracerefminus: { valType: "integer", min: 0, dflt: 0, editType: "style" }, copy_ystyle: { valType: "boolean", editType: "plot" }, copy_zstyle: { valType: "boolean", editType: "style" }, color: { valType: "color", editType: "style", description: "Sets the stoke color of the error bars." }, thickness: { valType: "number", min: 0, dflt: 2, editType: "style", description: "Sets the thickness (in px) of the error bars." }, width: { valType: "number", min: 0, editType: "plot", description: [ "Sets the width (in px) of the cross-bar at both ends", "of the error bars." ].join(" ") }, editType: "calc", _deprecated: { opacity: { valType: "number", editType: "style", description: [ "Obsolete.", "Use the alpha channel in error bar `color` to set the opacity." ].join(" ") } } }, mm, sM; function Moe() { if (sM) return mm; sM = 1; var e = cn, t = Rt, n = Ue, r = Sn, a = GO; return mm = function(i, o, l, s) { var c = "error_" + s.axis, u = r.newContainer(o, c), f = i[c] || {}; function h(w, _) { return n.coerce(f, u, a, w, _); } var g = f.array !== void 0 || f.value !== void 0 || f.type === "sqrt", p = h("visible", g); if (p !== !1) { var v = h("type", "array" in f ? "data" : "percent"), y = !0; v !== "sqrt" && (y = h( "symmetric", !((v === "data" ? "arrayminus" : "valueminus") in f) )), v === "data" ? (h("array"), h("traceref"), y || (h("arrayminus"), h("tracerefminus"))) : (v === "percent" || v === "constant") && (h("value"), y || h("valueminus")); var m = "copy_" + s.inherit + "style"; if (s.inherit) { var b = o["error_" + s.inherit]; (b || {}).visible && h(m, !(f.color || e(f.thickness) || e(f.width))); } (!s.inherit || !u[m]) && (h("color", l), h("thickness"), h("width", t.traceIs(o, "gl3d") ? 0 : 4)); } }, mm; } var ym, cM; function WO() { if (cM) return ym; cM = 1, ym = function(t) { var n = t.type, r = t.symmetric; if (n === "data") { var a = t.array || []; if (r) return function(s, c) { var u = +a[c]; return [u, u]; }; var i = t.arrayminus || []; return function(s, c) { var u = +a[c], f = +i[c]; return !isNaN(u) || !isNaN(f) ? [f || 0, u || 0] : [NaN, NaN]; }; } else { var o = e(n, t.value), l = e(n, t.valueminus); return r || t.valueminus === void 0 ? function(s) { var c = o(s); return [c, c]; } : function(s) { return [ l(s), o(s) ]; }; } }; function e(t, n) { if (t === "percent") return function(r) { return Math.abs(r * n / 100); }; if (t === "constant") return function() { return Math.abs(n); }; if (t === "sqrt") return function(r) { return Math.sqrt(Math.abs(r)); }; } return ym; } var xm, uM; function Soe() { if (uM) return xm; uM = 1; var e = cn, t = Rt, n = Ln, r = Ue, a = WO(); xm = function(o) { for (var l = o.calcdata, s = 0; s < l.length; s++) { var c = l[s], u = c[0].trace; if (u.visible === !0 && t.traceIs(u, "errorBarsOK")) { var f = n.getFromId(o, u.xaxis), h = n.getFromId(o, u.yaxis); i(c, u, f, "x"), i(c, u, h, "y"); } } }; function i(o, l, s, c) { var u = l["error_" + c] || {}, f = u.visible && ["linear", "log"].indexOf(s.type) !== -1, h = []; if (f) { for (var g = a(u), p = 0; p < o.length; p++) { var v = o[p], y = v.i; if (y === void 0) y = p; else if (y === null) continue; var m = v[c]; if (e(s.c2l(m))) { var b = g(m, y); if (e(b[0]) && e(b[1])) { var w = v[c + "s"] = m - b[0], _ = v[c + "h"] = m + b[1]; h.push(w, _); } } } var k = s._id, T = l._extremes[k], O = n.findExtremes( s, h, r.extendFlat({ tozero: T.opts.tozero }, { padded: !0 }) ); T.min = T.min.concat(O.min), T.max = T.max.concat(O.max); } } return xm; } var bm, dM; function Coe() { if (dM) return bm; dM = 1; var e = sn, t = cn, n = Cn, r = $a; bm = function(i, o, l, s) { var c, u = l.xaxis, f = l.yaxis, h = s && s.duration > 0, g = i._context.staticPlot; o.each(function(p) { var v = p[0].trace, y = v.error_x || {}, m = v.error_y || {}, b; v.ids && (b = function(T) { return T.id; }); var w = r.hasMarkers(v) && v.marker.maxdisplayed > 0; !m.visible && !y.visible && (p = []); var _ = e.select(this).selectAll("g.errorbar").data(p, b); if (_.exit().remove(), !!p.length) { y.visible || _.selectAll("path.xerror").remove(), m.visible || _.selectAll("path.yerror").remove(), _.style("opacity", 1); var k = _.enter().append("g").classed("errorbar", !0); h && k.style("opacity", 0).transition().duration(s.duration).style("opacity", 1), n.setClipUrl(_, l.layerClipId, i), _.each(function(T) { var O = e.select(this), M = a(T, u, f); if (!(w && !T.vis)) { var C, I = O.select("path.yerror"); if (m.visible && t(M.x) && t(M.yh) && t(M.ys)) { var j = m.width; C = "M" + (M.x - j) + "," + M.yh + "h" + 2 * j + // hat "m-" + j + ",0V" + M.ys, M.noYS || (C += "m-" + j + ",0h" + 2 * j), c = !I.size(), c ? I = O.append("path").style("vector-effect", g ? "none" : "non-scaling-stroke").classed("yerror", !0) : h && (I = I.transition().duration(s.duration).ease(s.easing)), I.attr("d", C); } else I.remove(); var P = O.select("path.xerror"); if (y.visible && t(M.y) && t(M.xh) && t(M.xs)) { var N = (y.copy_ystyle ? m : y).width; C = "M" + M.xh + "," + (M.y - N) + "v" + 2 * N + // hat "m0,-" + N + "H" + M.xs, M.noXS || (C += "m0,-" + N + "v" + 2 * N), c = !P.size(), c ? P = O.append("path").style("vector-effect", g ? "none" : "non-scaling-stroke").classed("xerror", !0) : h && (P = P.transition().duration(s.duration).ease(s.easing)), P.attr("d", C); } else P.remove(); } }); } }); }; function a(i, o, l) { var s = { x: o.c2p(i.x), y: l.c2p(i.y) }; return i.yh !== void 0 && (s.yh = l.c2p(i.yh), s.ys = l.c2p(i.ys), t(s.ys) || (s.noYS = !0, s.ys = l.c2p(i.ys, !0))), i.xh !== void 0 && (s.xh = o.c2p(i.xh), s.xs = o.c2p(i.xs), t(s.xs) || (s.noXS = !0, s.xs = o.c2p(i.xs, !0))), s; } return bm; } var wm, fM; function Loe() { if (fM) return wm; fM = 1; var e = sn, t = rn; return wm = function(n) { n.each(function(r) { var a = r[0].trace, i = a.error_y || {}, o = a.error_x || {}, l = e.select(this); l.selectAll("path.yerror").style("stroke-width", i.thickness + "px").call(t.stroke, i.color), o.copy_ystyle && (o = i), l.selectAll("path.xerror").style("stroke-width", o.thickness + "px").call(t.stroke, o.color); }); }, wm; } var od = Ue, hM = Lo.overrideAll, ld = GO, ql = { error_x: od.extendFlat({}, ld), error_y: od.extendFlat({}, ld) }; delete ql.error_x.copy_zstyle; delete ql.error_y.copy_zstyle; delete ql.error_y.copy_ystyle; var af = { error_x: od.extendFlat({}, ld), error_y: od.extendFlat({}, ld), error_z: od.extendFlat({}, ld) }; delete af.error_x.copy_ystyle; delete af.error_y.copy_ystyle; delete af.error_z.copy_ystyle; delete af.error_z.copy_zstyle; var Ooe = { moduleType: "component", name: "errorbars", schema: { traces: { scatter: ql, bar: ql, histogram: ql, scatter3d: hM(af, "calc", "nested"), scattergl: hM(ql, "calc", "nested") } }, supplyDefaults: Moe(), calc: Soe(), makeComputeError: WO(), plot: Coe(), style: Loe(), hoverInfo: Doe }; function Doe(e, t, n) { (t.error_y || {}).visible && (n.yerr = e.yh - e.y, t.error_y.symmetric || (n.yerrneg = e.y - e.ys)), (t.error_x || {}).visible && (n.xerr = e.xh - e.x, t.error_x.symmetric || (n.xerrneg = e.x - e.xs)); } var Foe = { cn: { colorbar: "colorbar", cbbg: "cbbg", cbfill: "cbfill", cbfills: "cbfills", cbline: "cbline", cblines: "cblines", cbaxis: "cbaxis", cbtitleunshift: "cbtitleunshift", cbtitle: "cbtitle", cboutline: "cboutline", crisp: "crisp", jsPlaceholder: "js-placeholder" } }, Wo = sn, _m = xi, $h = kr, pM = Rt, lo = Ln, wh = Xi, Ha = Ue, oi = Ha.strTranslate, ZO = tr.extendFlat, km = bs, ri = Cn, Tm = rn, Ioe = C0, zoe = Ir, Eoe = _i.flipScale, joe = rO, Poe = aO, Roe = Ji, mb = Nr, gM = mb.LINE_SPACING, vM = mb.FROM_TL, mM = mb.FROM_BR, Hn = Foe.cn; function Noe(e) { var t = e._fullLayout, n = t._infolayer.selectAll("g." + Hn.colorbar).data(Boe(e), function(r) { return r._id; }); n.enter().append("g").attr("class", function(r) { return r._id; }).classed(Hn.colorbar, !0), n.each(function(r) { var a = Wo.select(this); Ha.ensureSingle(a, "rect", Hn.cbbg), Ha.ensureSingle(a, "g", Hn.cbfills), Ha.ensureSingle(a, "g", Hn.cblines), Ha.ensureSingle(a, "g", Hn.cbaxis, function(o) { o.classed(Hn.crisp, !0); }), Ha.ensureSingle(a, "g", Hn.cbtitleunshift, function(o) { o.append("g").classed(Hn.cbtitle, !0); }), Ha.ensureSingle(a, "rect", Hn.cboutline); var i = Hoe(a, r, e); i && i.then && (e._promises || []).push(i), e._context.edits.colorbarPosition && Voe(a, r, e); }), n.exit().each(function(r) { $h.autoMargin(e, r._id); }).remove(), n.order(); } function Boe(e) { var t = e._fullLayout, n = e.calcdata, r = [], a, i, o, l; function s(w) { return ZO(w, { // fillcolor can be a d3 scale, domain is z values, range is colors // or leave it out for no fill, // or set to a string constant for single-color fill _fillcolor: null, // line.color has the same options as fillcolor _line: { color: null, width: null, dash: null }, // levels of lines to draw. // note that this DOES NOT determine the extent of the bar // that's given by the domain of fillcolor // (or line.color if no fillcolor domain) _levels: { start: null, end: null, size: null }, // separate fill levels (for example, heatmap coloring of a // contour map) if this is omitted, fillcolors will be // evaluated halfway between levels _filllevels: null, // for continuous colorscales: fill with a gradient instead of explicit levels // value should be the colorscale [[0, c0], [v1, c1], ..., [1, cEnd]] _fillgradient: null, // when using a gradient, we need the data range specified separately _zrange: null }); } function c() { typeof l.calc == "function" ? l.calc(e, o, a) : (a._fillgradient = i.reversescale ? Eoe(i.colorscale) : i.colorscale, a._zrange = [i[l.min], i[l.max]]); } for (var u = 0; u < n.length; u++) { var f = n[u]; if (o = f[0].trace, !!o._module) { var h = o._module.colorbar; if (o.visible === !0 && h) for (var g = Array.isArray(h), p = g ? h : [h], v = 0; v < p.length; v++) { l = p[v]; var y = l.container; i = y ? o[y] : o, i && i.showscale && (a = s(i.colorbar), a._id = "cb" + o.uid + (g && y ? "-" + y : ""), a._traceIndex = o.index, a._propPrefix = (y ? y + "." : "") + "colorbar.", a._meta = o._meta, c(), r.push(a)); } } } for (var m in t._colorAxes) if (i = t[m], i.showscale) { var b = t._colorAxes[m]; a = s(i.colorbar), a._id = "cb" + m, a._propPrefix = m + ".colorbar.", a._meta = t._meta, l = { min: "cmin", max: "cmax" }, b[0] !== "heatmap" && (o = b[1], l.calc = o._module.colorbar.calc), c(), r.push(a); } return r; } function Hoe(e, t, n) { var r = t.orientation === "v", a = t.len, i = t.lenmode, o = t.thickness, l = t.thicknessmode, s = t.outlinewidth, c = t.borderwidth, u = t.bgcolor, f = t.xanchor, h = t.yanchor, g = t.xpad, p = t.ypad, v = t.x, y = r ? t.y : 1 - t.y, m = t.yref === "paper", b = t.xref === "paper", w = n._fullLayout, _ = w._size, k = t._fillcolor, T = t._line, O = t.title, M = O.side, C = t._zrange || Wo.extent((typeof k == "function" ? k : T.color).domain()), I = typeof T.color == "function" ? T.color : function() { return T.color; }, j = typeof k == "function" ? k : function() { return k; }, P = t._levels, N = qoe(n, t, C), W = N.fill, J = N.line, U = Math.round(o * (l === "fraction" ? r ? _.w : _.h : 1)), E = U / (r ? _.w : _.h), z = Math.round(a * (i === "fraction" ? r ? _.h : _.w : 1)), F = z / (r ? _.h : _.w), q = b ? _.w : n._fullLayout.width, H = m ? _.h : n._fullLayout.height, K = Math.round( r ? v * q + g : y * H + p ), Q = { center: 0.5, right: 1 }[f] || 0, re = { top: 1, middle: 0.5 }[h] || 0, te = r ? v - Q * E : y - re * E, X = r ? y - re * F : v - Q * F, ce = Math.round( r ? H * (1 - X) : q * X ); t._lenFrac = F, t._thickFrac = E, t._uFrac = te, t._vFrac = X; var B = t._axis = Uoe(n, t, C); B.position = E + (r ? v + g / _.w : y + p / _.h); var G = ["top", "bottom"].indexOf(M) !== -1; if (r && G && (B.title.side = M, B.titlex = v + g / _.w, B.titley = X + (O.side === "top" ? F - p / _.h : p / _.h)), !r && !G && (B.title.side = M, B.titley = y + p / _.h, B.titlex = X + g / _.w), T.color && t.tickmode === "auto") { B.tickmode = "linear", B.tick0 = P.start; var Z = P.size, oe = Ha.constrain(z / 50, 4, 15) + 1, ae = (C[1] - C[0]) / ((t.nticks || oe) * Z); if (ae > 1) { var ge = Math.pow(10, Math.floor(Math.log(ae) / Math.LN10)); Z *= ge * Ha.roundUp(ae / ge, [2, 5, 10]), (Math.abs(P.start) / P.size + 1e-6) % 1 < 2e-6 && (B.tick0 = 0); } B.dtick = Z; } B.domain = r ? [ X + p / _.h, X + F - p / _.h ] : [ X + g / _.w, X + F - g / _.w ], B.setScale(), e.attr("transform", oi(Math.round(_.l), Math.round(_.t))); var ve = e.select("." + Hn.cbtitleunshift).attr("transform", oi(-Math.round(_.l), -Math.round(_.t))), pe = B.ticklabelposition, ye = B.title.font.size, Oe = e.select("." + Hn.cbaxis), Be, Ie = 0, Fe = 0; function Re(Xe, ct) { var vt = { propContainer: B, propName: t._propPrefix + "title", traceIndex: t._traceIndex, _meta: t._meta, placeholder: w._dfltTitle.colorbar, containerGroup: e.select("." + Hn.cbtitle) }, lt = Xe.charAt(0) === "h" ? Xe.substr(1) : "h" + Xe; e.selectAll("." + lt + ",." + lt + "-math-group").remove(), Ioe.draw(n, Xe, ZO(vt, ct || {})); } function We() { if (r && G || !r && !G) { var Xe, ct; M === "top" && (Xe = g + _.l + q * v, ct = p + _.t + H * (1 - X - F) + 3 + ye * 0.75), M === "bottom" && (Xe = g + _.l + q * v, ct = p + _.t + H * (1 - X) - 3 - ye * 0.25), M === "right" && (ct = p + _.t + H * y + 3 + ye * 0.75, Xe = g + _.l + q * X), Re(B._id + "title", { attributes: { x: Xe, y: ct, "text-anchor": r ? "start" : "middle" } }); } } function Ce() { if (r && !G || !r && G) { var Xe = B.position || 0, ct = B._offset + B._length / 2, vt, lt; if (M === "right") lt = ct, vt = _.l + q * Xe + 10 + ye * (B.showticklabels ? 1 : 0.5); else if (vt = ct, M === "bottom" && (lt = _.t + H * Xe + 10 + (pe.indexOf("inside") === -1 ? B.tickfont.size : 0) + (B.ticks !== "intside" && t.ticklen || 0)), M === "top") { var ut = O.text.split("
").length; lt = _.t + H * Xe + 10 - U - gM * ye * ut; } Re((r ? ( // the 'h' + is a hack to get around the fact that // convertToTspans rotates any 'y...' class by 90 degrees. // TODO: find a better way to control this. "h" ) : "v") + B._id + "title", { avoid: { selection: Wo.select(n).selectAll("g." + B._id + "tick"), side: M, offsetTop: r ? 0 : _.t, offsetLeft: r ? _.l : 0, maxShift: r ? w.width : w.height }, attributes: { x: vt, y: lt, "text-anchor": "middle" }, transform: { rotate: r ? -90 : 0, offset: 0 } }); } } function Ve() { if (!r && !G || r && G) { var Xe = e.select("." + Hn.cbtitle), ct = Xe.select("text"), vt = [-s / 2, s / 2], lt = Xe.select(".h" + B._id + "title-math-group").node(), ut = 15.6; ct.node() && (ut = parseInt(ct.node().style.fontSize, 10) * gM); var dt; if (lt ? (dt = ri.bBox(lt), Fe = dt.width, Ie = dt.height, Ie > ut && (vt[1] -= (Ie - ut) / 2)) : ct.node() && !ct.classed(Hn.jsPlaceholder) && (dt = ri.bBox(ct.node()), Fe = dt.width, Ie = dt.height), r) { if (Ie) { if (Ie += 5, M === "top") B.domain[1] -= Ie / _.h, vt[1] *= -1; else { B.domain[0] += Ie / _.h; var Pe = zoe.lineCount(ct); vt[1] += (1 - Pe) * ut; } Xe.attr("transform", oi(vt[0], vt[1])), B.setScale(); } } else Fe && (M === "right" && (B.domain[0] += (Fe + ye / 2) / _.w), Xe.attr("transform", oi(vt[0], vt[1])), B.setScale()); } e.selectAll("." + Hn.cbfills + ",." + Hn.cblines).attr( "transform", r ? oi(0, Math.round(_.h * (1 - B.domain[1]))) : oi(Math.round(_.w * B.domain[0]), 0) ), Oe.attr( "transform", r ? oi(0, Math.round(-_.t)) : oi(Math.round(-_.l), 0) ); var ze = e.select("." + Hn.cbfills).selectAll("rect." + Hn.cbfill).attr("style", "").data(W); ze.enter().append("rect").classed(Hn.cbfill, !0).attr("style", ""), ze.exit().remove(); var Ne = C.map(B.c2p).map(Math.round).sort(function(bt, je) { return bt - je; }); ze.each(function(bt, je) { var tt = [ je === 0 ? C[0] : (W[je] + W[je - 1]) / 2, je === W.length - 1 ? C[1] : (W[je] + W[je + 1]) / 2 ].map(B.c2p).map(Math.round); r && (tt[1] = Ha.constrain(tt[1] + (tt[1] > tt[0]) ? 1 : -1, Ne[0], Ne[1])); var pt = Wo.select(this).attr(r ? "x" : "y", K).attr(r ? "y" : "x", Wo.min(tt)).attr(r ? "width" : "height", Math.max(U, 2)).attr(r ? "height" : "width", Math.max(Wo.max(tt) - Wo.min(tt), 2)); if (t._fillgradient) ri.gradient(pt, n, t._id, r ? "vertical" : "horizontalreversed", t._fillgradient, "fill"); else { var kt = j(bt).replace("e-", ""); pt.attr("fill", _m(kt).toHexString()); } }); var nt = e.select("." + Hn.cblines).selectAll("path." + Hn.cbline).data(T.color && T.width ? J : []); nt.enter().append("path").classed(Hn.cbline, !0), nt.exit().remove(), nt.each(function(bt) { var je = K, tt = Math.round(B.c2p(bt)) + T.width / 2 % 1; Wo.select(this).attr( "d", "M" + (r ? je + "," + tt : tt + "," + je) + (r ? "h" : "v") + U ).call(ri.lineGroupStyle, T.width, I(bt), T.dash); }), Oe.selectAll("g." + B._id + "tick,path").remove(); var Qe = K + U + (s || 0) / 2 - (t.ticks === "outside" ? 1 : 0), it = lo.calcTicks(B), rt = lo.getTickSigns(B)[2]; return lo.drawTicks(n, B, { vals: B.ticks === "inside" ? lo.clipEnds(B, it) : it, layer: Oe, path: lo.makeTickPath(B, Qe, rt), transFn: lo.makeTransTickFn(B) }), lo.drawLabels(n, B, { vals: it, layer: Oe, transFn: lo.makeTransTickLabelFn(B), labelFns: lo.makeLabelFns(B, Qe) }); } function Ke() { var Xe, ct = U + s / 2; pe.indexOf("inside") === -1 && (Xe = ri.bBox(Oe.node()), ct += r ? Xe.width : Xe.height), Be = ve.select("text"); var vt = 0, lt = r && M === "top", ut = !r && M === "right", dt = 0; if (Be.node() && !Be.classed(Hn.jsPlaceholder)) { var Pe, ze = ve.select(".h" + B._id + "title-math-group").node(); ze && (r && G || !r && !G) ? (Xe = ri.bBox(ze), vt = Xe.width, Pe = Xe.height) : (Xe = ri.bBox(ve.node()), vt = Xe.right - _.l - (r ? K : ce), Pe = Xe.bottom - _.t - (r ? ce : K), !r && M === "top" && (ct += Xe.height, dt = Xe.height)), ut && (Be.attr("transform", oi(vt / 2 + ye / 2, 0)), vt *= 2), ct = Math.max( ct, r ? vt : Pe ); } var Ne = (r ? g : p) * 2 + ct + c + s / 2, nt = 0; !r && O.text && h === "bottom" && y <= 0 && (nt = Ne / 2, Ne += nt, dt += nt), w._hColorbarMoveTitle = nt, w._hColorbarMoveCBTitle = dt; var Qe = c + s, it = (r ? K : ce) - Qe / 2 - (r ? g : 0), rt = (r ? ce : K) - (r ? z : p + dt - nt); e.select("." + Hn.cbbg).attr("x", it).attr("y", rt).attr(r ? "width" : "height", Math.max(Ne - nt, 2)).attr(r ? "height" : "width", Math.max(z + Qe, 2)).call(Tm.fill, u).call(Tm.stroke, t.bordercolor).style("stroke-width", c); var bt = ut ? Math.max(vt - 10, 0) : 0; e.selectAll("." + Hn.cboutline).attr("x", (r ? K : ce + g) + bt).attr("y", (r ? ce + p - z : K) + (lt ? Ie : 0)).attr(r ? "width" : "height", Math.max(U, 2)).attr(r ? "height" : "width", Math.max(z - (r ? 2 * p + Ie : 2 * g + bt), 2)).call(Tm.stroke, t.outlinecolor).style({ fill: "none", "stroke-width": s }); var je = r ? Q * Ne : 0, tt = r ? 0 : (1 - re) * Ne - dt; if (je = b ? _.l - je : -je, tt = m ? _.t - tt : -tt, e.attr("transform", oi( je, tt )), !r && (c || _m(u).getAlpha() && !_m.equals(w.paper_bgcolor, u))) { var pt = Oe.selectAll("text"), kt = pt[0].length, et = e.select("." + Hn.cbbg).node(), ft = ri.bBox(et), $e = ri.getTranslate(e), Lt = 2; pt.each(function(le, Se) { var He = 0, Je = kt - 1; if (Se === He || Se === Je) { var Dt = ri.bBox(this), zt = ri.getTranslate(this), Pt; if (Se === Je) { var _t = Dt.right + zt.x, $t = ft.right + $e.x + ce - c - Lt + v; Pt = $t - _t, Pt > 0 && (Pt = 0); } else if (Se === He) { var Nt = Dt.left + zt.x, wt = ft.left + $e.x + ce + c + Lt; Pt = wt - Nt, Pt < 0 && (Pt = 0); } Pt && (kt < 3 ? this.setAttribute( "transform", "translate(" + Pt + ",0) " + this.getAttribute("transform") ) : this.setAttribute("visibility", "hidden")); } }); } var $ = {}, se = vM[f], ie = mM[f], de = vM[h], Te = mM[h], xe = Ne - U; r ? (i === "pixels" ? ($.y = y, $.t = z * de, $.b = z * Te) : ($.t = $.b = 0, $.yt = y + a * de, $.yb = y - a * Te), l === "pixels" ? ($.x = v, $.l = Ne * se, $.r = Ne * ie) : ($.l = xe * se, $.r = xe * ie, $.xl = v - o * se, $.xr = v + o * ie)) : (i === "pixels" ? ($.x = v, $.l = z * se, $.r = z * ie) : ($.l = $.r = 0, $.xl = v + a * se, $.xr = v - a * ie), l === "pixels" ? ($.y = 1 - y, $.t = Ne * de, $.b = Ne * Te) : ($.t = xe * de, $.b = xe * Te, $.yt = y - o * de, $.yb = y + o * Te)); var Ge = t.y < 0.5 ? "b" : "t", qe = t.x < 0.5 ? "l" : "r"; n._fullLayout._reservedMargin[t._id] = {}; var De = { r: w.width - it - je, l: it + $.r, b: w.height - rt - tt, t: rt + $.b }; b && m ? $h.autoMargin(n, t._id, $) : b ? n._fullLayout._reservedMargin[t._id][Ge] = De[Ge] : m || r ? n._fullLayout._reservedMargin[t._id][qe] = De[qe] : n._fullLayout._reservedMargin[t._id][Ge] = De[Ge]; } return Ha.syncOrAsync([ $h.previousPromises, We, Ve, Ce, $h.previousPromises, Ke ], n); } function Voe(e, t, n) { var r = t.orientation === "v", a = n._fullLayout, i = a._size, o, l, s; wh.init({ element: e.node(), gd: n, prepFn: function() { o = e.attr("transform"), km(e); }, moveFn: function(c, u) { e.attr("transform", o + oi(c, u)), l = wh.align( (r ? t._uFrac : t._vFrac) + c / i.w, r ? t._thickFrac : t._lenFrac, 0, 1, t.xanchor ), s = wh.align( (r ? t._vFrac : 1 - t._uFrac) - u / i.h, r ? t._lenFrac : t._thickFrac, 0, 1, t.yanchor ); var f = wh.getCursor(l, s, t.xanchor, t.yanchor); km(e, f); }, doneFn: function() { if (km(e), l !== void 0 && s !== void 0) { var c = {}; c[t._propPrefix + "x"] = l, c[t._propPrefix + "y"] = s, t._traceIndex !== void 0 ? pM.call("_guiRestyle", n, c, t._traceIndex) : pM.call("_guiRelayout", n, c); } } }); } function qoe(e, t, n) { var r = t._levels, a = [], i = [], o, l, s = r.end + r.size / 100, c = r.size, u = 1.001 * n[0] - 1e-3 * n[1], f = 1.001 * n[1] - 1e-3 * n[0]; for (l = 0; l < 1e5 && (o = r.start + l * c, !(c > 0 ? o >= s : o <= s)); l++) o > u && o < f && a.push(o); if (t._fillgradient) i = [0]; else if (typeof t._fillcolor == "function") { var h = t._filllevels; if (h) for (s = h.end + h.size / 100, c = h.size, l = 0; l < 1e5 && (o = h.start + l * c, !(c > 0 ? o >= s : o <= s)); l++) o > n[0] && o < n[1] && i.push(o); else i = a.map(function(g) { return g - r.size / 2; }), i.push(i[i.length - 1] + r.size); } else t._fillcolor && typeof t._fillcolor == "string" && (i = [0]); return r.size < 0 && (a.reverse(), i.reverse()), { line: a, fill: i }; } function Uoe(e, t, n) { var r = e._fullLayout, a = t.orientation === "v", i = { type: "linear", range: n, tickmode: t.tickmode, nticks: t.nticks, tick0: t.tick0, dtick: t.dtick, tickvals: t.tickvals, ticktext: t.ticktext, ticks: t.ticks, ticklen: t.ticklen, tickwidth: t.tickwidth, tickcolor: t.tickcolor, showticklabels: t.showticklabels, labelalias: t.labelalias, ticklabelposition: t.ticklabelposition, ticklabeloverflow: t.ticklabeloverflow, ticklabelstep: t.ticklabelstep, tickfont: t.tickfont, tickangle: t.tickangle, tickformat: t.tickformat, exponentformat: t.exponentformat, minexponent: t.minexponent, separatethousands: t.separatethousands, showexponent: t.showexponent, showtickprefix: t.showtickprefix, tickprefix: t.tickprefix, showticksuffix: t.showticksuffix, ticksuffix: t.ticksuffix, title: t.title, showline: !0, anchor: "free", side: a ? "right" : "bottom", position: 1 }, o = a ? "y" : "x", l = { type: "linear", _id: o + t._id }, s = { letter: o, font: r.font, noHover: !0, noTickson: !0, noTicklabelmode: !0, noInsideRange: !0, calendar: r.calendar // not really necessary (yet?) }; function c(u, f) { return Ha.coerce(i, l, Roe, u, f); } return joe(i, l, c, s, r), Poe(i, l, c, s), l; } var Goe = { draw: Noe }, Woe = { moduleType: "component", name: "colorbar", attributes: cx, supplyDefaults: wL, draw: Goe.draw, hasColorbar: hL }, Zoe = { moduleType: "component", name: "legend", layoutAttributes: t6, supplyLayoutDefaults: n6, draw: o6, style: a6 }, Yoe = { moduleType: "locale", name: "en", dictionary: { "Click to enter Colorscale title": "Click to enter Colourscale title" }, format: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], periods: ["AM", "PM"], dateTime: "%a %b %e %X %Y", date: "%d/%m/%Y", time: "%H:%M:%S", decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], year: "%Y", month: "%b %Y", dayMonth: "%b %-d", dayMonthYear: "%b %-d, %Y" } }, $oe = { moduleType: "locale", name: "en-US", dictionary: { "Click to enter Colorscale title": "Click to enter Colorscale title" }, format: { date: "%m/%d/%Y" } }, Koe = Rt, YO = Ue, Am = YO.extendFlat, yM = YO.extendDeep; function xM(e) { var t; switch (e) { case "themes__thumb": t = { autosize: !0, width: 150, height: 150, title: { text: "" }, showlegend: !1, margin: { l: 5, r: 5, t: 5, b: 5, pad: 0 }, annotations: [] }; break; case "thumbnail": t = { title: { text: "" }, hidesources: !0, showlegend: !1, borderwidth: 0, bordercolor: "", margin: { l: 1, r: 1, t: 1, b: 1, pad: 0 }, annotations: [] }; break; default: t = {}; } return t; } function Joe(e) { var t = ["xaxis", "yaxis", "zaxis"]; return t.indexOf(e.slice(0, 5)) > -1; } var $O = function(e, t) { var n, r = e.data, a = e.layout, i = yM([], r), o = yM({}, a, xM(t.tileClass)), l = e._context || {}; if (t.width && (o.width = t.width), t.height && (o.height = t.height), t.tileClass === "thumbnail" || t.tileClass === "themes__thumb") { o.annotations = []; var s = Object.keys(o); for (n = 0; n < s.length; n++) Joe(s[n]) && (o[s[n]].title = { text: "" }); for (n = 0; n < i.length; n++) { var c = i[n]; c.showscale = !1, c.marker && (c.marker.showscale = !1), Koe.traceIs(c, "pie-like") && (c.textposition = "none"); } } if (Array.isArray(t.annotations)) for (n = 0; n < t.annotations.length; n++) o.annotations.push(t.annotations[n]); var u = Object.keys(o).filter(function(v) { return v.match(/^scene\d*$/); }); if (u.length) { var f = {}; for (t.tileClass === "thumbnail" && (f = { title: { text: "" }, showaxeslabels: !1, showticklabels: !1, linetickenable: !1 }), n = 0; n < u.length; n++) { var h = o[u[n]]; h.xaxis || (h.xaxis = {}), h.yaxis || (h.yaxis = {}), h.zaxis || (h.zaxis = {}), Am(h.xaxis, f), Am(h.yaxis, f), Am(h.zaxis, f), h._scene = null; } } var g = document.createElement("div"); t.tileClass && (g.className = t.tileClass); var p = { gd: g, td: g, // for external (image server) compatibility layout: o, data: i, config: { staticPlot: t.staticPlot === void 0 ? !0 : t.staticPlot, plotGlPixelRatio: t.plotGlPixelRatio === void 0 ? 2 : t.plotGlPixelRatio, displaylogo: t.displaylogo || !1, showLink: t.showLink || !1, showTips: t.showTips || !1, mapboxAccessToken: l.mapboxAccessToken } }; return t.setBackground !== "transparent" && (p.config.setBackground = t.setBackground || "opaque"), p.gd.defaultLayout = xM(t.tileClass), p; }, Qoe = ax.EventEmitter, Xoe = Rt, ele = Ue, bM = Vr, tle = $O, nle = Xx, rle = eb; function ale(e, t) { var n = new Qoe(), r = tle(e, { format: "png" }), a = r.gd; a.style.position = "absolute", a.style.left = "-5000px", document.body.appendChild(a); function i() { var l = bM.getDelay(a._fullLayout); setTimeout(function() { var s = nle(a), c = document.createElement("canvas"); c.id = ele.randstr(), n = rle({ format: t.format, width: a._fullLayout.width, height: a._fullLayout.height, canvas: c, emitter: n, svg: s }), n.clean = function() { a && document.body.removeChild(a); }; }, l); } var o = bM.getRedrawFunc(a); return Xoe.call("_doPlot", a, r.data, r.layout, r.config).then(o).then(i).catch(function(l) { n.emit("error", l); }), n; } var ile = ale, wM = Vr, ole = { getDelay: wM.getDelay, getRedrawFunc: wM.getRedrawFunc, clone: $O, toSVG: Xx, svgToImg: eb, toImage: ile, downloadImage: L8 }, lle = ole; (function(e) { e.version = a0.version; for (var t = Rt, n = e.register = t.register, r = Bn, a = Object.keys(r), i = 0; i < a.length; i++) { var o = a[i]; o.charAt(0) !== "_" && (e[o] = r[o]), n({ moduleType: "apiMethod", name: o, fn: r[o] }); } n(cO), n([ Ure, sae, tf, Aae, Rae, cie, Eie, Gie, yoe, Aoe, Ooe, Qd, Woe, Zoe, // legend needs to come after shape | legend defaults depends on shapes Ao, // fx needs to come after legend | unified hover defaults depends on legends U6 ]), n([ Yoe, $oe ]), window.PlotlyLocales && Array.isArray(window.PlotlyLocales) && (n(window.PlotlyLocales), delete window.PlotlyLocales), e.Icons = Cx; var l = Ao, s = kr; e.Plots = { resize: s.resize, graphJson: s.graphJson, sendDataToCloud: s.sendDataToCloud }, e.Fx = { hover: l.hover, unhover: l.unhover, loneHover: l.loneHover, loneUnhover: l.loneUnhover }, e.Snapshot = lle, e.PlotSchema = Qc; })(r4); var sle = r4; const Rd = /* @__PURE__ */ Ud(sle); var cle = cO; const ule = /* @__PURE__ */ Ud(cle); var KO = { // padding in pixels around text TEXTPAD: 3, // 'value' and 'label' are not really necessary for bar traces, // but they were made available to `texttemplate` (maybe by accident) // via tokens `%{value}` and `%{label}` starting in 1.50.0, // so let's include them in the event data also. eventDataKeys: ["value", "label"] }, $n = ws, _M = T0.axisHoverFormat, dle = bi.hovertemplateAttrs, fle = bi.texttemplateAttrs, JO = Jd, hle = Fr, kM = KO, ple = Yi.pattern, Ul = tr.extendFlat, Mm = hle({ editType: "calc", arrayOk: !0, colorEditType: "style", description: "" }), gle = $n.marker, vle = gle.line, mle = Ul( {}, vle.width, { dflt: 0 } ), yle = Ul({ width: mle, editType: "calc" }, JO("marker.line")), xle = Ul({ line: yle, editType: "calc" }, JO("marker"), { opacity: { valType: "number", arrayOk: !0, dflt: 1, min: 0, max: 1, editType: "style", description: "Sets the opacity of the bars." }, pattern: ple }), X0 = { x: $n.x, x0: $n.x0, dx: $n.dx, y: $n.y, y0: $n.y0, dy: $n.dy, xperiod: $n.xperiod, yperiod: $n.yperiod, xperiod0: $n.xperiod0, yperiod0: $n.yperiod0, xperiodalignment: $n.xperiodalignment, yperiodalignment: $n.yperiodalignment, xhoverformat: _M("x"), yhoverformat: _M("y"), text: $n.text, texttemplate: fle({ editType: "plot" }, { keys: kM.eventDataKeys }), hovertext: $n.hovertext, hovertemplate: dle({}, { keys: kM.eventDataKeys }), textposition: { valType: "enumerated", values: ["inside", "outside", "auto", "none"], dflt: "auto", arrayOk: !0, editType: "calc", description: [ "Specifies the location of the `text`.", "*inside* positions `text` inside, next to the bar end", "(rotated and scaled if needed).", "*outside* positions `text` outside, next to the bar end", "(scaled if needed), unless there is another bar stacked on", "this one, then the text gets pushed inside.", "*auto* tries to position `text` inside the bar, but if", "the bar is too small and no bar is stacked on this one", "the text is moved outside.", "If *none*, no text appears." ].join(" ") }, insidetextanchor: { valType: "enumerated", values: ["end", "middle", "start"], dflt: "end", editType: "plot", description: [ "Determines if texts are kept at center or start/end points in `textposition` *inside* mode." ].join(" ") }, textangle: { valType: "angle", dflt: "auto", editType: "plot", description: [ "Sets the angle of the tick labels with respect to the bar.", "For example, a `tickangle` of -90 draws the tick labels", "vertically. With *auto* the texts may automatically be", "rotated to fit with the maximum size in bars." ].join(" ") }, textfont: Ul({}, Mm, { description: "Sets the font used for `text`." }), insidetextfont: Ul({}, Mm, { description: "Sets the font used for `text` lying inside the bar." }), outsidetextfont: Ul({}, Mm, { description: "Sets the font used for `text` lying outside the bar." }), constraintext: { valType: "enumerated", values: ["inside", "outside", "both", "none"], dflt: "both", editType: "calc", description: [ "Constrain the size of text inside or outside a bar to be no", "larger than the bar itself." ].join(" ") }, cliponaxis: Ul({}, $n.cliponaxis, { description: [ "Determines whether the text nodes", "are clipped about the subplot axes.", "To show the text nodes above axis lines and tick labels,", "make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*." ].join(" ") }), orientation: { valType: "enumerated", values: ["v", "h"], editType: "calc+clearAxisTypes", description: [ "Sets the orientation of the bars.", "With *v* (*h*), the value of the each bar spans", "along the vertical (horizontal)." ].join(" ") }, base: { valType: "any", dflt: null, arrayOk: !0, editType: "calc", description: [ "Sets where the bar base is drawn (in position axis units).", "In *stack* or *relative* barmode,", "traces that set *base* will be excluded", "and drawn in *overlay* mode instead." ].join(" ") }, offset: { valType: "number", dflt: null, arrayOk: !0, editType: "calc", description: [ "Shifts the position where the bar is drawn", "(in position axis units).", "In *group* barmode,", "traces that set *offset* will be excluded", "and drawn in *overlay* mode instead." ].join(" ") }, width: { valType: "number", dflt: null, min: 0, arrayOk: !0, editType: "calc", description: [ "Sets the bar width (in position axis units)." ].join(" ") }, marker: xle, offsetgroup: $n.offsetgroup, alignmentgroup: $n.alignmentgroup, selected: { marker: { opacity: $n.selected.marker.opacity, color: $n.selected.marker.color, editType: "style" }, textfont: $n.selected.textfont, editType: "style" }, unselected: { marker: { opacity: $n.unselected.marker.opacity, color: $n.unselected.marker.color, editType: "style" }, textfont: $n.unselected.textfont, editType: "style" }, _deprecated: { bardir: { valType: "enumerated", editType: "calc", values: ["v", "h"], description: "Renamed to `orientation`." } } }, QO = { barmode: { valType: "enumerated", values: ["stack", "group", "overlay", "relative"], dflt: "group", editType: "calc", description: [ "Determines how bars at the same location coordinate", "are displayed on the graph.", "With *stack*, the bars are stacked on top of one another", "With *relative*, the bars are stacked on top of one another,", "with negative values below the axis, positive values above", "With *group*, the bars are plotted next to one another", "centered around the shared location.", "With *overlay*, the bars are plotted over one another,", "you might need to reduce *opacity* to see multiple bars." ].join(" ") }, barnorm: { valType: "enumerated", values: ["", "fraction", "percent"], dflt: "", editType: "calc", description: [ "Sets the normalization for bar traces on the graph.", "With *fraction*, the value of each bar is divided by the sum of all", "values at that location coordinate.", "*percent* is the same but multiplied by 100 to show percentages." ].join(" ") }, bargap: { valType: "number", min: 0, max: 1, editType: "calc", description: [ "Sets the gap (in plot fraction) between bars of", "adjacent location coordinates." ].join(" ") }, bargroupgap: { valType: "number", min: 0, max: 1, dflt: 0, editType: "calc", description: [ "Sets the gap (in plot fraction) between bars of", "the same location coordinate." ].join(" ") } }, ble = rn, TM = _i.hasColorscale, AM = Xc, wle = Ue.coercePattern, _le = function(e, t, n, r, a) { var i = n("marker.color", r), o = TM(e, "marker"); o && AM( e, t, a, n, { prefix: "marker.", cLetter: "c" } ), n("marker.line.color", ble.defaultLine), TM(e, "marker.line") && AM( e, t, a, n, { prefix: "marker.line.", cLetter: "c" } ), n("marker.line.width"), n("marker.opacity"), wle(n, "marker.pattern", i, o), n("selected.marker.color"), n("unselected.marker.color"); }, Nc = Ue, MM = rn, kle = Rt, Tle = E8, Ale = nb, Mle = _le, Sle = j8, XO = X0, _h = Nc.coerceFont; function Cle(e, t, n, r) { function a(c, u) { return Nc.coerce(e, t, XO, c, u); } var i = Tle(e, t, r, a); if (!i) { t.visible = !1; return; } Ale(e, t, r, a), a("xhoverformat"), a("yhoverformat"), a("orientation", t.x && !t.y ? "h" : "v"), a("base"), a("offset"), a("width"), a("text"), a("hovertext"), a("hovertemplate"); var o = a("textposition"); eD(e, t, r, a, o, { moduleHasSelected: !0, moduleHasUnselected: !0, moduleHasConstrain: !0, moduleHasCliponaxis: !0, moduleHasTextangle: !0, moduleHasInsideanchor: !0 }), Mle(e, t, a, n, r); var l = (t.marker.line || {}).color, s = kle.getComponentMethod("errorbars", "supplyDefaults"); s(e, t, l || MM.defaultLine, { axis: "y" }), s(e, t, l || MM.defaultLine, { axis: "x", inherit: "y" }), Nc.coerceSelectionMarkerOpacity(t, a); } function Lle(e, t) { var n, r; function a(o) { return Nc.coerce(r._input, r, XO, o); } if (t.barmode === "group") for (var i = 0; i < e.length; i++) r = e[i], r.type === "bar" && (n = r._input, Sle(n, r, t, a)); } function eD(e, t, n, r, a, i) { i = i || {}; var o = i.moduleHasSelected !== !1, l = i.moduleHasUnselected !== !1, s = i.moduleHasConstrain !== !1, c = i.moduleHasCliponaxis !== !1, u = i.moduleHasTextangle !== !1, f = i.moduleHasInsideanchor !== !1, h = !!i.hasPathbar, g = Array.isArray(a) || a === "auto", p = g || a === "inside", v = g || a === "outside"; if (p || v) { var y = _h(r, "textfont", n.font), m = Nc.extendFlat({}, y), b = e.textfont && e.textfont.color, w = !b; if (w && delete m.color, _h(r, "insidetextfont", m), h) { var _ = Nc.extendFlat({}, y); w && delete _.color, _h(r, "pathbar.textfont", _); } v && _h(r, "outsidetextfont", y), o && r("selected.textfont.color"), l && r("unselected.textfont.color"), s && r("constraintext"), c && r("cliponaxis"), u && r("textangle"), r("texttemplate"); } p && f && r("insidetextanchor"); } var SM = { supplyDefaults: Cle, crossTraceDefaults: Lle, handleText: eD }, Ole = Rt, Dle = Ln, Fle = Ue, Ile = QO, zle = function(e, t, n) { function r(g, p) { return Fle.coerce(e, t, Ile, g, p); } for (var a = !1, i = !1, o = !1, l = {}, s = r("barmode"), c = 0; c < n.length; c++) { var u = n[c]; if (Ole.traceIs(u, "bar") && u.visible) a = !0; else continue; if (s === "group") { var f = u.xaxis + u.yaxis; l[f] && (o = !0), l[f] = !0; } if (u.visible && u.type === "histogram") { var h = Dle.getFromId( { _fullLayout: t }, u[u.orientation === "v" ? "xaxis" : "yaxis"] ); h.type !== "category" && (i = !0); } } if (!a) { delete t.barmode; return; } s !== "overlay" && r("barnorm"), r("bargap", i && !o ? 0 : 0.2), r("bargroupgap"); }, Ys = Ue, yb = function(e, t) { for (var n = 0; n < e.length; n++) e[n].i = n; Ys.mergeArray(t.text, e, "tx"), Ys.mergeArray(t.hovertext, e, "htx"); var r = t.marker; if (r) { Ys.mergeArray(r.opacity, e, "mo", !0), Ys.mergeArray(r.color, e, "mc"); var a = r.line; a && (Ys.mergeArray(a.color, e, "mlc"), Ys.mergeArrayCastPositive(a.width, e, "mlw")); } }, CM = Ln, LM = Z0, OM = _i.hasColorscale, DM = M0, Ele = yb, jle = N8, Ple = function(e, t) { var n = CM.getFromId(e, t.xaxis || "x"), r = CM.getFromId(e, t.yaxis || "y"), a, i, o, l, s, c, u = { msUTC: !!(t.base || t.base === 0) }; t.orientation === "h" ? (a = n.makeCalcdata(t, "x", u), o = r.makeCalcdata(t, "y"), l = LM(t, r, "y", o), s = !!t.yperiodalignment, c = "y") : (a = r.makeCalcdata(t, "y", u), o = n.makeCalcdata(t, "x"), l = LM(t, n, "x", o), s = !!t.xperiodalignment, c = "x"), i = l.vals; for (var f = Math.min(i.length, a.length), h = new Array(f), g = 0; g < f; g++) h[g] = { p: i[g], s: a[g] }, s && (h[g].orig_p = o[g], h[g][c + "End"] = l.ends[g], h[g][c + "Start"] = l.starts[g]), t.ids && (h[g].id = String(t.ids[g])); return OM(t, "marker") && DM(e, t, { vals: t.marker.color, containerStr: "marker", cLetter: "c" }), OM(t, "marker.line") && DM(e, t, { vals: t.marker.line.color, containerStr: "marker.line", cLetter: "c" }), Ele(h, t), jle(h, t), h; }, Rle = sn, Nle = Ue; function Ble(e, t, n) { var r = e._fullLayout, a = r["_" + n + "Text_minsize"]; if (a) { var i = r.uniformtext.mode === "hide", o; switch (n) { case "funnelarea": case "pie": case "sunburst": o = "g.slice"; break; case "treemap": case "icicle": o = "g.slice, g.pathbar"; break; default: o = "g.points > g.point"; } t.selectAll(o).each(function(l) { var s = l.transform; if (s) { s.scale = i && s.hide ? 0 : a / s.fontSize; var c = Rle.select(this).select("text"); Nle.setTransormAndDisplay(c, s); } }); } } function Hle(e, t, n) { if (n.uniformtext.mode) { var r = tD(e), a = n.uniformtext.minsize, i = t.scale * t.fontSize; t.hide = i < a, n[r] = n[r] || 1 / 0, t.hide || (n[r] = Math.min( n[r], Math.max(i, a) )); } } function Vle(e, t) { var n = tD(e); t[n] = void 0; } function tD(e) { return "_" + e + "Text_minsize"; } var nD = { recordMinTextSize: Hle, clearMinTextSize: Vle, resizeText: Ble }, Fo = {}, qle = cn, Ule = xi, rD = Ue.isArrayOrTypedArray; Fo.coerceString = function(e, t, n) { if (typeof t == "string") { if (t || !e.noBlank) return t; } else if ((typeof t == "number" || t === !0) && !e.strict) return String(t); return n !== void 0 ? n : e.dflt; }; Fo.coerceNumber = function(e, t, n) { if (qle(t)) { t = +t; var r = e.min, a = e.max, i = r !== void 0 && t < r || a !== void 0 && t > a; if (!i) return t; } return n !== void 0 ? n : e.dflt; }; Fo.coerceColor = function(e, t, n) { return Ule(t).isValid() ? t : n !== void 0 ? n : e.dflt; }; Fo.coerceEnumerated = function(e, t, n) { return e.coerceNumber && (t = +t), e.values.indexOf(t) !== -1 ? t : n !== void 0 ? n : e.dflt; }; Fo.getValue = function(e, t) { var n; return rD(e) ? t < e.length && (n = e[t]) : n = e, n; }; Fo.getLineWidth = function(e, t) { var n = 0 < t.mlw ? t.mlw : rD(e.marker.line.width) ? 0 : e.marker.line.width; return n; }; var sd = sn, Gle = rn, Nd = Cn, aD = Ue, iD = Rt, oD = nD.resizeText, xb = X0, Wle = xb.textfont, Zle = xb.insidetextfont, Yle = xb.outsidetextfont, $s = Fo; function $le(e) { var t = sd.select(e).selectAll("g.barlayer").selectAll("g.trace"); oD(e, t, "bar"); var n = t.size(), r = e._fullLayout; t.style("opacity", function(a) { return a[0].trace.opacity; }).each(function(a) { (r.barmode === "stack" && n > 1 || r.bargap === 0 && r.bargroupgap === 0 && !a[0].trace.marker.line.width) && sd.select(this).attr("shape-rendering", "crispEdges"); }), t.selectAll("g.points").each(function(a) { var i = sd.select(this), o = a[0].trace; lD(i, o, e); }), iD.getComponentMethod("errorbars", "style")(t); } function lD(e, t, n) { Nd.pointStyle(e.selectAll("path"), t, n), sD(e, t, n); } function sD(e, t, n) { e.selectAll("text").each(function(r) { var a = sd.select(this), i = aD.ensureUniformFontSize(n, cD(a, r, t, n)); Nd.font(a, i); }); } function Kle(e, t, n) { var r = t[0].trace; r.selectedpoints ? Jle(n, r, e) : (lD(n, r, e), iD.getComponentMethod("errorbars", "style")(n)); } function Jle(e, t, n) { Nd.selectedPointStyle(e.selectAll("path"), t), Qle(e.selectAll("text"), t, n); } function Qle(e, t, n) { e.each(function(r) { var a = sd.select(this), i; if (r.selected) { i = aD.ensureUniformFontSize(n, cD(a, r, t, n)); var o = t.selected.textfont && t.selected.textfont.color; o && (i.color = o), Nd.font(a, i); } else Nd.selectedTextStyle(a, t); }); } function cD(e, t, n, r) { var a = r._fullLayout.font, i = n.textfont; if (e.classed("bartext-inside")) { var o = hD(t, n); i = dD(n, t.i, a, o); } else e.classed("bartext-outside") && (i = fD(n, t.i, a)); return i; } function uD(e, t, n) { return bb( Wle, e.textfont, t, n ); } function dD(e, t, n, r) { var a = uD(e, t, n), i = e._input.textfont === void 0 || e._input.textfont.color === void 0 || Array.isArray(e.textfont.color) && e.textfont.color[t] === void 0; return i && (a = { color: Gle.contrast(r), family: a.family, size: a.size }), bb( Zle, e.insidetextfont, t, a ); } function fD(e, t, n) { var r = uD(e, t, n); return bb( Yle, e.outsidetextfont, t, r ); } function bb(e, t, n, r) { t = t || {}; var a = $s.getValue(t.family, n), i = $s.getValue(t.size, n), o = $s.getValue(t.color, n); return { family: $s.coerceString( e.family, a, r.family ), size: $s.coerceNumber( e.size, i, r.size ), color: $s.coerceColor( e.color, o, r.color ) }; } function hD(e, t) { return t.type === "waterfall" ? t[e.dir].marker.color : e.mcc || e.mc || t.marker.color; } var Xy = { style: $le, styleTextPoints: sD, styleOnSelect: Kle, getInsideTextFont: dD, getOutsideTextFont: fD, getBarColor: hD, resizeText: oD }, kh = sn, Th = cn, xr = Ue, Xle = Ir, ese = rn, el = Cn, tse = Rt, Pp = Ln.tickText, pD = nD, nse = pD.recordMinTextSize, rse = pD.clearMinTextSize, Sm = Xy, Bc = Fo, ase = KO, gD = X0, ise = gD.text, ose = gD.textposition, lse = Oo.appendArrayPointValue, fi = ase.TEXTPAD; function sse(e) { return e.id; } function cse(e) { if (e.ids) return sse; } function al(e, t) { return e < t ? 1 : -1; } function use(e, t, n, r) { var a = [], i = [], o = r ? t : n, l = r ? n : t; return a[0] = o.c2p(e.s0, !0), i[0] = l.c2p(e.p0, !0), a[1] = o.c2p(e.s1, !0), i[1] = l.c2p(e.p1, !0), r ? [a, i] : [i, a]; } function vD(e, t, n, r) { if (!t.uniformtext.mode && mD(n)) { var a; return r && (a = r()), e.transition().duration(n.duration).ease(n.easing).each("end", function() { a && a(); }).each("interrupt", function() { a && a(); }); } else return e; } function mD(e) { return e && e.duration > 0; } function dse(e, t, n, r, a, i) { var o = t.xaxis, l = t.yaxis, s = e._fullLayout, c = e._context.staticPlot; a || (a = { mode: s.barmode, norm: s.barmode, gap: s.bargap, groupgap: s.bargroupgap }, rse("bar", s)); var u = xr.makeTraceGroups(r, n, "trace bars").each(function(f) { var h = kh.select(this), g = f[0].trace, p = g.type === "waterfall", v = g.type === "funnel", y = g.type === "bar", m = y || v, b = 0; p && g.connector.visible && g.connector.mode === "between" && (b = g.connector.line.width / 2); var w = g.orientation === "h", _ = mD(a), k = xr.ensureSingle(h, "g", "points"), T = cse(g), O = k.selectAll("g.point").data(xr.identity, T); O.enter().append("g").classed("point", !0), O.exit().remove(), O.each(function(C, I) { var j = kh.select(this), P = use(C, o, l, w), N = P[0][0], W = P[0][1], J = P[1][0], U = P[1][1], E = (w ? W - N : U - J) === 0; E && m && Bc.getLineWidth(g, C) && (E = !1), E || (E = !Th(N) || !Th(W) || !Th(J) || !Th(U)), C.isBlank = E, E && (w ? W = N : U = J), b && !E && (w ? (N -= al(N, W) * b, W += al(N, W) * b) : (J -= al(J, U) * b, U += al(J, U) * b)); var z, F; if (g.type === "waterfall") { if (!E) { var q = g[C.dir].marker; z = q.line.width, F = q.color; } } else z = Bc.getLineWidth(g, C), F = C.mc || g.marker.color; function H(ce) { var B = kh.round(z / 2 % 1, 2); return a.gap === 0 && a.groupgap === 0 ? kh.round(Math.round(ce) - B, 2) : ce; } function K(ce, B, G) { return G && ce === B ? ce : Math.abs(ce - B) >= 2 ? H(ce) : ( // but if it's very thin, expand it so it's // necessarily visible, even if it might overlap // its neighbor ce > B ? Math.ceil(ce) : Math.floor(ce) ); } if (!e._context.staticPlot) { var Q = ese.opacity(F), re = Q < 1 || z > 0.01 ? H : K; N = re(N, W, w), W = re(W, N, w), J = re(J, U, !w), U = re(U, J, !w); } var te = vD(xr.ensureSingle(j, "path"), s, a, i); if (te.style("vector-effect", c ? "none" : "non-scaling-stroke").attr("d", isNaN((W - N) * (U - J)) || E && e._context.staticPlot ? "M0,0Z" : "M" + N + "," + J + "V" + U + "H" + W + "V" + J + "Z").call(el.setClipUrl, t.layerClipId, e), !s.uniformtext.mode && _) { var X = el.makePointStyleFns(g); el.singlePointStyle(C, te, g, X, e); } fse(e, t, j, f, I, N, W, J, U, a, i), t.layerClipId && el.hideOutsideRangePoint(C, j.select("text"), o, l, g.xcalendar, g.ycalendar); }); var M = g.cliponaxis === !1; el.setClipUrl(h, M ? null : t.layerClipId, e); }); tse.getComponentMethod("errorbars", "plot")(e, u, t, a); } function fse(e, t, n, r, a, i, o, l, s, c, u) { var f = t.xaxis, h = t.yaxis, g = e._fullLayout, p; function v(ce, B, G) { var Z = xr.ensureSingle(ce, "text").text(B).attr({ class: "bartext bartext-" + p, "text-anchor": "middle", // prohibit tex interpretation until we can handle // tex and regular text together "data-notex": 1 }).call(el.font, G).call(Xle.convertToTspans, e); return Z; } var y = r[0].trace, m = y.orientation === "h", b = pse(g, r, a, f, h); p = gse(y, a); var w = c.mode === "stack" || c.mode === "relative", _ = r[a], k = !w || _._outmost; if (!b || p === "none" || (_.isBlank || i === o || l === s) && (p === "auto" || p === "inside")) { n.select("text").remove(); return; } var T = g.font, O = Sm.getBarColor(r[a], y), M = Sm.getInsideTextFont(y, a, T, O), C = Sm.getOutsideTextFont(y, a, T), I = n.datum(); m ? f.type === "log" && I.s0 <= 0 && (f.range[0] < f.range[1] ? i = 0 : i = f._length) : h.type === "log" && I.s0 <= 0 && (h.range[0] < h.range[1] ? l = h._length : l = 0); var j = Math.abs(o - i) - 2 * fi, P = Math.abs(s - l) - 2 * fi, N, W, J, U, E; if (p === "outside" && !k && !_.hasB && (p = "inside"), p === "auto") if (k) { p = "inside", E = xr.ensureUniformFontSize(e, M), N = v(n, b, E), W = el.bBox(N.node()), J = W.width, U = W.height; var z = J > 0 && U > 0, F = J <= j && U <= P, q = J <= P && U <= j, H = m ? j >= J * (P / U) : P >= U * (j / J); z && (F || q || H) ? p = "inside" : (p = "outside", N.remove(), N = null); } else p = "inside"; if (!N) { E = xr.ensureUniformFontSize(e, p === "outside" ? C : M), N = v(n, b, E); var K = N.attr("transform"); if (N.attr("transform", ""), W = el.bBox(N.node()), J = W.width, U = W.height, N.attr("transform", K), J <= 0 || U <= 0) { N.remove(); return; } } var Q = y.textangle, re, te; p === "outside" ? (te = y.constraintext === "both" || y.constraintext === "outside", re = hse(i, o, l, s, W, { isHorizontal: m, constrained: te, angle: Q })) : (te = y.constraintext === "both" || y.constraintext === "inside", re = bD(i, o, l, s, W, { isHorizontal: m, constrained: te, angle: Q, anchor: y.insidetextanchor })), re.fontSize = E.size, nse(y.type === "histogram" ? "bar" : y.type, re, g), _.transform = re; var X = vD(N, g, c, u); xr.setTransormAndDisplay(X, re); } function yD(e) { return e === "auto" ? 0 : e; } function xD(e, t) { var n = Math.PI / 180 * t, r = Math.abs(Math.sin(n)), a = Math.abs(Math.cos(n)); return { x: e.width * a + e.height * r, y: e.width * r + e.height * a }; } function bD(e, t, n, r, a, i) { var o = !!i.isHorizontal, l = !!i.constrained, s = i.angle || 0, c = i.anchor || "end", u = c === "end", f = c === "start", h = i.leftToRight || 0, g = (h + 1) / 2, p = 1 - g, v = a.width, y = a.height, m = Math.abs(t - e), b = Math.abs(r - n), w = m > 2 * fi && b > 2 * fi ? fi : 0; m -= 2 * w, b -= 2 * w; var _ = yD(s); s === "auto" && !(v <= m && y <= b) && (v > m || y > b) && (!(v > b || y > m) || v < y != m < b) && (_ += 90); var k = xD(a, _), T = 1; l && (T = Math.min( 1, m / k.x, b / k.y )); var O = a.left * p + a.right * g, M = (a.top + a.bottom) / 2, C = (e + fi) * p + (t - fi) * g, I = (n + r) / 2, j = 0, P = 0; if (f || u) { var N = (o ? k.x : k.y) / 2, W = o ? al(e, t) : al(n, r); o ? f ? (C = e + W * w, j = -W * N) : (C = t - W * w, j = W * N) : f ? (I = n + W * w, P = -W * N) : (I = r - W * w, P = W * N); } return { textX: O, textY: M, targetX: C, targetY: I, anchorX: j, anchorY: P, scale: T, rotate: _ }; } function hse(e, t, n, r, a, i) { var o = !!i.isHorizontal, l = !!i.constrained, s = i.angle || 0, c = a.width, u = a.height, f = Math.abs(t - e), h = Math.abs(r - n), g; o ? g = h > 2 * fi ? fi : 0 : g = f > 2 * fi ? fi : 0; var p = 1; l && (p = o ? Math.min(1, h / u) : Math.min(1, f / c)); var v = yD(s), y = xD(a, v), m = (o ? y.x : y.y) / 2, b = (a.left + a.right) / 2, w = (a.top + a.bottom) / 2, _ = (e + t) / 2, k = (n + r) / 2, T = 0, O = 0, M = o ? al(t, e) : al(n, r); return o ? (_ = t - M * g, T = M * m) : (k = r + M * g, O = -M * m), { textX: b, textY: w, targetX: _, targetY: k, anchorX: T, anchorY: O, scale: p, rotate: v }; } function pse(e, t, n, r, a) { var i = t[0].trace, o = i.texttemplate, l; return o ? l = vse(e, t, n, r, a) : i.textinfo ? l = mse(t, n, r, a) : l = Bc.getValue(i.text, n), Bc.coerceString(ise, l); } function gse(e, t) { var n = Bc.getValue(e.textposition, t); return Bc.coerceEnumerated(ose, n); } function vse(e, t, n, r, a) { var i = t[0].trace, o = xr.castOption(i, n, "texttemplate"); if (!o) return ""; var l = i.type === "histogram", s = i.type === "waterfall", c = i.type === "funnel", u = i.orientation === "h", f, h, g, p; u ? (f = "y", h = a, g = "x", p = r) : (f = "x", h = r, g = "y", p = a); function v(T) { return Pp(h, h.c2l(T), !0).text; } function y(T) { return Pp(p, p.c2l(T), !0).text; } var m = t[n], b = {}; b.label = m.p, b.labelLabel = b[f + "Label"] = v(m.p); var w = xr.castOption(i, m.i, "text"); (w === 0 || w) && (b.text = w), b.value = m.s, b.valueLabel = b[g + "Label"] = y(m.s); var _ = {}; lse(_, i, m.i), (l || _.x === void 0) && (_.x = u ? b.value : b.label), (l || _.y === void 0) && (_.y = u ? b.label : b.value), (l || _.xLabel === void 0) && (_.xLabel = u ? b.valueLabel : b.labelLabel), (l || _.yLabel === void 0) && (_.yLabel = u ? b.labelLabel : b.valueLabel), s && (b.delta = +m.rawS || m.s, b.deltaLabel = y(b.delta), b.final = m.v, b.finalLabel = y(b.final), b.initial = b.final - b.delta, b.initialLabel = y(b.initial)), c && (b.value = m.s, b.valueLabel = y(b.value), b.percentInitial = m.begR, b.percentInitialLabel = xr.formatPercent(m.begR), b.percentPrevious = m.difR, b.percentPreviousLabel = xr.formatPercent(m.difR), b.percentTotal = m.sumR, b.percenTotalLabel = xr.formatPercent(m.sumR)); var k = xr.castOption(i, m.i, "customdata"); return k && (b.customdata = k), xr.texttemplateString(o, b, e._d3locale, _, b, i._meta || {}); } function mse(e, t, n, r) { var a = e[0].trace, i = a.orientation === "h", o = a.type === "waterfall", l = a.type === "funnel"; function s(k) { var T = i ? r : n; return Pp(T, k, !0).text; } function c(k) { var T = i ? n : r; return Pp(T, +k, !0).text; } var u = a.textinfo, f = e[t], h = u.split("+"), g = [], p, v = function(k) { return h.indexOf(k) !== -1; }; if (v("label") && g.push(s(e[t].p)), v("text") && (p = xr.castOption(a, f.i, "text"), (p === 0 || p) && g.push(p)), o) { var y = +f.rawS || f.s, m = f.v, b = m - y; v("initial") && g.push(c(b)), v("delta") && g.push(c(y)), v("final") && g.push(c(m)); } if (l) { v("value") && g.push(c(f.s)); var w = 0; v("percent initial") && w++, v("percent previous") && w++, v("percent total") && w++; var _ = w > 1; v("percent initial") && (p = xr.formatPercent(f.begR), _ && (p += " of initial"), g.push(p)), v("percent previous") && (p = xr.formatPercent(f.difR), _ && (p += " of previous"), g.push(p)), v("percent total") && (p = xr.formatPercent(f.sumR), _ && (p += " of total"), g.push(p)); } return g.join("
"); } var yse = { plot: dse, toMoveInsideBar: bD }, qu = Ao, xse = Rt, FM = rn, bse = Ue.fillText, wse = Fo.getLineWidth, Cm = Ln.hoverLabelText, _se = er.BADNUM; function kse(e, t, n, r, a) { var i = wD(e, t, n, r, a); if (i) { var o = i.cd, l = o[0].trace, s = o[i.index]; return i.color = _D(l, s), xse.getComponentMethod("errorbars", "hoverInfo")(s, l, i), [i]; } } function wD(e, t, n, r, a) { var i = e.cd, o = i[0].trace, l = i[0].t, s = r === "closest", c = o.type === "waterfall", u = e.maxHoverDistance, f = e.maxSpikeDistance, h, g, p, v, y, m, b; o.orientation === "h" ? (h = n, g = t, p = "y", v = "x", y = J, m = P) : (h = t, g = n, p = "x", v = "y", m = J, y = P); var w = o[p + "period"], _ = s || w; function k(X) { return O(X, -1); } function T(X) { return O(X, 1); } function O(X, ce) { var B = X.w; return X[p] + ce * B / 2; } function M(X) { return X[p + "End"] - X[p + "Start"]; } var C = s ? k : w ? function(X) { return X.p - M(X) / 2; } : function(X) { return Math.min(k(X), X.p - l.bardelta / 2); }, I = s ? T : w ? function(X) { return X.p + M(X) / 2; } : function(X) { return Math.max(T(X), X.p + l.bardelta / 2); }; function j(X, ce, B) { return a.finiteRange && (B = 0), qu.inbox( X - h, ce - h, B + Math.min(1, Math.abs(ce - X) / b) - 1 ); } function P(X) { return j(C(X), I(X), u); } function N(X) { return j(k(X), T(X), f); } function W(X) { var ce = X[v]; if (c) { var B = Math.abs(X.rawS) || 0; g > 0 ? ce += B : g < 0 && (ce -= B); } return ce; } function J(X) { var ce = g, B = X.b, G = W(X); return qu.inbox(B - ce, G - ce, u + (G - ce) / (G - B) - 1); } function U(X) { var ce = g, B = X.b, G = W(X); return qu.inbox(B - ce, G - ce, f + (G - ce) / (G - B) - 1); } var E = e[p + "a"], z = e[v + "a"]; b = Math.abs(E.r2c(E.range[1]) - E.r2c(E.range[0])); function F(X) { return (y(X) + m(X)) / 2; } var q = qu.getDistanceFunction(r, y, m, F); if (qu.getClosest(i, q, e), e.index !== !1 && i[e.index].p !== _se) { _ || (C = function(X) { return Math.min(k(X), X.p - l.bargroupwidth / 2); }, I = function(X) { return Math.max(T(X), X.p + l.bargroupwidth / 2); }); var H = e.index, K = i[H], Q = o.base ? K.b + K.s : K.s; e[v + "0"] = e[v + "1"] = z.c2p(K[v], !0), e[v + "LabelVal"] = Q; var re = l.extents[l.extents.round(K.p)]; e[p + "0"] = E.c2p(s ? C(K) : re[0], !0), e[p + "1"] = E.c2p(s ? I(K) : re[1], !0); var te = K.orig_p !== void 0; return e[p + "LabelVal"] = te ? K.orig_p : K.p, e.labelLabel = Cm(E, e[p + "LabelVal"], o[p + "hoverformat"]), e.valueLabel = Cm(z, e[v + "LabelVal"], o[v + "hoverformat"]), e.baseLabel = Cm(z, K.b, o[v + "hoverformat"]), e.spikeDistance = (U(K) + N(K)) / 2, e[p + "Spike"] = E.c2p(K.p, !0), bse(K, o, e), e.hovertemplate = o.hovertemplate, e; } } function _D(e, t) { var n = t.mcc || e.marker.color, r = t.mlcc || e.marker.line.color, a = wse(e, t); if (FM.opacity(n)) return n; if (FM.opacity(r) && a) return r; } var Tse = { hoverPoints: kse, hoverOnBars: wD, getTraceColor: _D }, Ase = function(e, t, n) { return e.x = "xVal" in t ? t.xVal : t.x, e.y = "yVal" in t ? t.yVal : t.y, t.xa && (e.xaxis = t.xa), t.ya && (e.yaxis = t.ya), n.orientation === "h" ? (e.label = e.y, e.value = e.x) : (e.label = e.x, e.value = e.y), e; }, Mse = function(e, t) { var n = e.cd, r = e.xaxis, a = e.yaxis, i = n[0].trace, o = i.type === "funnel", l = i.orientation === "h", s = [], c; if (t === !1) for (c = 0; c < n.length; c++) n[c].selected = 0; else for (c = 0; c < n.length; c++) { var u = n[c], f = "ct" in u ? u.ct : Sse(u, r, a, l, o); t.contains(f, !1, c, e) ? (s.push({ pointNumber: c, x: r.c2d(u.x), y: a.c2d(u.y) }), u.selected = 1) : u.selected = 0; } return s; }; function Sse(e, t, n, r, a) { var i = t.c2p(r ? e.s0 : e.p0, !0), o = t.c2p(r ? e.s1 : e.p1, !0), l = n.c2p(r ? e.p0 : e.s0, !0), s = n.c2p(r ? e.p1 : e.s1, !0); return a ? [(i + o) / 2, (l + s) / 2] : r ? [o, (l + s) / 2] : [(i + o) / 2, s]; } var Cse = { attributes: X0, layoutAttributes: QO, supplyDefaults: SM.supplyDefaults, crossTraceDefaults: SM.crossTraceDefaults, supplyLayoutDefaults: zle, calc: Ple, crossTraceCalc: J8.crossTraceCalc, colorbar: tO, arraysToCalcdata: yb, plot: yse.plot, style: Xy.style, styleOnSelect: Xy.styleOnSelect, hoverPoints: Tse.hoverPoints, eventData: Ase, selectPoints: Mse, moduleType: "trace", name: "bar", basePlotModule: yr, categories: ["bar-like", "cartesian", "svg", "bar", "oriented", "errorBarsOK", "showLegend", "zoomScale"], animatable: !0, meta: { description: [ "The data visualized by the span of the bars is set in `y`", "if `orientation` is set to *v* (the default)", "and the labels are set in `x`.", "By setting `orientation` to *h*, the roles are interchanged." ].join(" ") } }, Lse = Cse; const Ose = /* @__PURE__ */ Ud(Lse); var Fa = ws, Dse = Zi, Fse = Fr, Lm = T0.axisHoverFormat, Ise = bi.hovertemplateAttrs, zse = bi.texttemplateAttrs, Ese = Jd, ta = tr.extendFlat, kD = ta( { z: { valType: "data_array", editType: "calc", description: "Sets the z data." }, x: ta({}, Fa.x, { impliedEdits: { xtype: "array" } }), x0: ta({}, Fa.x0, { impliedEdits: { xtype: "scaled" } }), dx: ta({}, Fa.dx, { impliedEdits: { xtype: "scaled" } }), y: ta({}, Fa.y, { impliedEdits: { ytype: "array" } }), y0: ta({}, Fa.y0, { impliedEdits: { ytype: "scaled" } }), dy: ta({}, Fa.dy, { impliedEdits: { ytype: "scaled" } }), xperiod: ta({}, Fa.xperiod, { impliedEdits: { xtype: "scaled" } }), yperiod: ta({}, Fa.yperiod, { impliedEdits: { ytype: "scaled" } }), xperiod0: ta({}, Fa.xperiod0, { impliedEdits: { xtype: "scaled" } }), yperiod0: ta({}, Fa.yperiod0, { impliedEdits: { ytype: "scaled" } }), xperiodalignment: ta({}, Fa.xperiodalignment, { impliedEdits: { xtype: "scaled" } }), yperiodalignment: ta({}, Fa.yperiodalignment, { impliedEdits: { ytype: "scaled" } }), text: { valType: "data_array", editType: "calc", description: "Sets the text elements associated with each z value." }, hovertext: { valType: "data_array", editType: "calc", description: "Same as `text`." }, transpose: { valType: "boolean", dflt: !1, editType: "calc", description: "Transposes the z data." }, xtype: { valType: "enumerated", values: ["array", "scaled"], editType: "calc+clearAxisTypes", description: [ "If *array*, the heatmap's x coordinates are given by *x*", "(the default behavior when `x` is provided).", "If *scaled*, the heatmap's x coordinates are given by *x0* and *dx*", "(the default behavior when `x` is not provided)." ].join(" ") }, ytype: { valType: "enumerated", values: ["array", "scaled"], editType: "calc+clearAxisTypes", description: [ "If *array*, the heatmap's y coordinates are given by *y*", "(the default behavior when `y` is provided)", "If *scaled*, the heatmap's y coordinates are given by *y0* and *dy*", "(the default behavior when `y` is not provided)" ].join(" ") }, zsmooth: { valType: "enumerated", values: ["fast", "best", !1], dflt: !1, editType: "calc", description: [ "Picks a smoothing algorithm use to smooth `z` data." ].join(" ") }, hoverongaps: { valType: "boolean", dflt: !0, editType: "none", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the `z` data have hover labels associated with them." ].join(" ") }, connectgaps: { valType: "boolean", editType: "calc", description: [ "Determines whether or not gaps", "(i.e. {nan} or missing values)", "in the `z` data are filled in.", "It is defaulted to true if `z` is a", "one dimensional array and `zsmooth` is not false;", "otherwise it is defaulted to false." ].join(" ") }, xgap: { valType: "number", dflt: 0, min: 0, editType: "plot", description: "Sets the horizontal gap (in pixels) between bricks." }, ygap: { valType: "number", dflt: 0, min: 0, editType: "plot", description: "Sets the vertical gap (in pixels) between bricks." }, xhoverformat: Lm("x"), yhoverformat: Lm("y"), zhoverformat: Lm("z", 1), hovertemplate: Ise(), texttemplate: zse({ arrayOk: !1, editType: "plot" }, { keys: ["x", "y", "z", "text"] }), textfont: Fse({ editType: "plot", autoSize: !0, autoColor: !0, colorEditType: "style", description: "Sets the text font." }), showlegend: ta({}, Dse.showlegend, { dflt: !1 }) }, { transforms: void 0 }, Ese("", { cLetter: "z", autoColorDflt: !1 }) ), jse = cn, Kh = Ue, Pse = Rt, Rse = function(e, t, n, r, a, i) { var o = n("z"); a = a || "x", i = i || "y"; var l, s; if (o === void 0 || !o.length) return 0; if (Kh.isArray1D(o)) { l = n(a), s = n(i); var c = Kh.minRowLength(l), u = Kh.minRowLength(s); if (c === 0 || u === 0) return 0; t._length = Math.min(c, u, o.length); } else { if (l = IM(a, n), s = IM(i, n), !Nse(o)) return 0; n("transpose"), t._length = null; } if (e.type === "heatmapgl") return !0; var f = Pse.getComponentMethod("calendars", "handleTraceDefaults"); return f(e, t, [a, i], r), !0; }; function IM(e, t) { var n = t(e), r = n ? t(e + "type", "array") : "scaled"; return r === "scaled" && (t(e + "0"), t("d" + e)), n; } function Nse(e) { for (var t = !0, n = !1, r = !1, a, i = 0; i < e.length; i++) { if (a = e[i], !Kh.isArrayOrTypedArray(a)) { t = !1; break; } a.length > 0 && (n = !0); for (var o = 0; o < a.length; o++) if (jse(a[o])) { r = !0; break; } } return t && n && r; } var zM = Ue, Bse = function(e, t) { e("texttemplate"); var n = zM.extendFlat({}, t.font, { color: "auto", size: "auto" }); zM.coerceFont(e, "textfont", n); }, Hse = function(e, t, n) { var r = n("zsmooth"); r === !1 && (n("xgap"), n("ygap")), n("zhoverformat"); }, EM = Ue, Vse = Rse, qse = Bse, Use = nb, Gse = Hse, Wse = Xc, Zse = kD, Yse = function(e, t, n, r) { function a(o, l) { return EM.coerce(e, t, Zse, o, l); } var i = Vse(e, t, a, r); if (!i) { t.visible = !1; return; } Use(e, t, r, a), a("xhoverformat"), a("yhoverformat"), a("text"), a("hovertext"), a("hovertemplate"), qse(a, r), Gse(e, t, a), a("hoverongaps"), a("connectgaps", EM.isArray1D(t.z) && t.zsmooth !== !1), Wse(e, t, r, a, { prefix: "", cLetter: "z" }); }, Ks = cn, TD = { count: function(e, t, n) { return n[e]++, 1; }, sum: function(e, t, n, r) { var a = r[t]; return Ks(a) ? (a = Number(a), n[e] += a, a) : 0; }, avg: function(e, t, n, r, a) { var i = r[t]; return Ks(i) && (i = Number(i), n[e] += i, a[e]++), 0; }, min: function(e, t, n, r) { var a = r[t]; if (Ks(a)) if (a = Number(a), Ks(n[e])) { if (n[e] > a) { var i = a - n[e]; return n[e] = a, i; } } else return n[e] = a, a; return 0; }, max: function(e, t, n, r) { var a = r[t]; if (Ks(a)) if (a = Number(a), Ks(n[e])) { if (n[e] < a) { var i = a - n[e]; return n[e] = a, i; } } else return n[e] = a, a; return 0; } }, AD = { percent: function(e, t) { for (var n = e.length, r = 100 / t, a = 0; a < n; a++) e[a] *= r; }, probability: function(e, t) { for (var n = e.length, r = 0; r < n; r++) e[r] /= t; }, density: function(e, t, n, r) { var a = e.length; r = r || 1; for (var i = 0; i < a; i++) e[i] *= n[i] * r; }, "probability density": function(e, t, n, r) { var a = e.length; r && (t /= r); for (var i = 0; i < a; i++) e[i] *= n[i] / t; } }, MD = function(e, t) { for (var n = e.length, r = 0, a = 0; a < n; a++) t[a] ? (e[a] /= t[a], r += e[a]) : e[a] = null; return r; }, ru = er, Xl = ru.ONEAVGYEAR, jM = ru.ONEAVGMONTH, Rp = ru.ONEDAY, PM = ru.ONEHOUR, RM = ru.ONEMIN, NM = ru.ONESEC, BM = Ln.tickIncrement, SD = function(e, t, n, r, a) { var i = -1.1 * t, o = -0.1 * t, l = e - o, s = n[0], c = n[1], u = Math.min( Ah(s + o, s + l, r, a), Ah(c + o, c + l, r, a) ), f = Math.min( Ah(s + i, s + o, r, a), Ah(c + i, c + o, r, a) ), h, g; if (u > f && f < Math.abs(c - s) / 4e3 ? (h = u, g = !1) : (h = Math.min(u, f), g = !0), r.type === "date" && h > Rp) { var p = h === Xl ? 1 : 6, v = h === Xl ? "M12" : "M1"; return function(y, m) { var b = r.c2d(y, Xl, a), w = b.indexOf("-", p); w > 0 && (b = b.substr(0, w)); var _ = r.d2c(b, 0, a); if (_ < y) { var k = BM(_, v, !1, a); (_ + k) / 2 < y + e && (_ = k); } return m && g ? BM(_, v, !0, a) : _; }; } return function(y, m) { var b = h * Math.round(y / h); return b + h / 10 < y && b + h * 0.9 < y + e && (b += h), m && g && (b -= h), b; }; }; function Ah(e, t, n, r) { if (e * t <= 0) return 1 / 0; for (var a = Math.abs(t - e), i = n.type === "date", o = HM(a, i), l = 0; l < 10; l++) { var s = HM(o * 80, i); if (o === s) break; if ($se(s, e, t, i, n, r)) o = s; else break; } return o; } function HM(e, t) { return t && e > NM ? e > Rp ? e > Xl * 1.1 ? Xl : e > jM * 1.1 ? jM : Rp : e > PM ? PM : e > RM ? RM : NM : Math.pow(10, Math.floor(Math.log(e) / Math.LN10)); } function $se(e, t, n, r, a, i) { if (r && e > Rp) { var o = VM(t, a, i), l = VM(n, a, i), s = e === Xl ? 0 : 1; return o[s] !== l[s]; } return Math.floor(n / e) - Math.floor(t / e) > 0.1; } function VM(e, t, n) { var r = t.c2d(e, Xl, n).split("-"); return r[0] === "" && (r.unshift(), r[0] = "-" + r[0]), r; } var e1 = cn, Rr = Ue, qM = Rt, ja = Ln, Kse = yb, UM = TD, Jse = AD, Qse = MD, Xse = SD; function ece(e, t) { var n = [], r = [], a = t.orientation === "h", i = ja.getFromId(e, a ? t.yaxis : t.xaxis), o = a ? "y" : "x", l = { x: "y", y: "x" }[o], s = t[o + "calendar"], c = t.cumulative, u, f = wb(e, t, i, o), h = f[0], g = f[1], p = typeof h.size == "string", v = [], y = p ? v : h, m = [], b = [], w = [], _ = 0, k = t.histnorm, T = t.histfunc, O = k.indexOf("density") !== -1, M, C, I; c.enabled && O && (k = k.replace(/ ?density$/, ""), O = !1); var j = T === "max" || T === "min", P = j ? null : 0, N = UM.count, W = Jse[k], J = !1, U = function(ae) { return i.r2c(ae, 0, s); }, E; for (Rr.isArrayOrTypedArray(t[l]) && T !== "count" && (E = t[l], J = T === "avg", N = UM[T]), u = U(h.start), C = U(h.end) + (u - ja.tickIncrement(u, h.size, !1, s)) / 1e6; u < C && n.length < 1e6 && (M = ja.tickIncrement(u, h.size, !1, s), n.push((u + M) / 2), r.push(P), w.push([]), v.push(u), O && m.push(1 / (M - u)), J && b.push(0), !(M <= u)); ) u = M; v.push(u), !p && i.type === "date" && (y = { start: U(y.start), end: U(y.end), size: y.size }), e._fullLayout._roundFnOpts || (e._fullLayout._roundFnOpts = {}); var z = t["_" + o + "bingroup"], F = { leftGap: 1 / 0, rightGap: 1 / 0 }; z && (e._fullLayout._roundFnOpts[z] || (e._fullLayout._roundFnOpts[z] = F), F = e._fullLayout._roundFnOpts[z]); var q = r.length, H = !0, K = F.leftGap, Q = F.rightGap, re = {}; for (u = 0; u < g.length; u++) { var te = g[u]; I = Rr.findBin(te, y), I >= 0 && I < q && (_ += N(I, u, r, E, b), H && w[I].length && te !== g[w[I][0]] && (H = !1), w[I].push(u), re[u] = I, K = Math.min(K, te - v[I]), Q = Math.min(Q, v[I + 1] - te)); } F.leftGap = K, F.rightGap = Q; var X; H || (X = function(ae, ge) { return function() { var ve = e._fullLayout._roundFnOpts[z]; return Xse( ve.leftGap, ve.rightGap, v, i, s )(ae, ge); }; }), J && (_ = Qse(r, b)), W && W(r, _, m), c.enabled && rce(r, c.direction, c.currentbin); var ce = Math.min(n.length, r.length), B = [], G = 0, Z = ce - 1; for (u = 0; u < ce; u++) if (r[u]) { G = u; break; } for (u = ce - 1; u >= G; u--) if (r[u]) { Z = u; break; } for (u = G; u <= Z; u++) if (e1(n[u]) && e1(r[u])) { var oe = { p: n[u], s: r[u], b: 0 }; c.enabled || (oe.pts = w[u], H ? oe.ph0 = oe.ph1 = w[u].length ? g[w[u][0]] : n[u] : (t._computePh = !0, oe.ph0 = X(v[u]), oe.ph1 = X(v[u + 1], !0))), B.push(oe); } return B.length === 1 && (B[0].width1 = ja.tickIncrement(B[0].p, h.size, !1, s) - B[0].p), Kse(B, t), Rr.isArrayOrTypedArray(t.selectedpoints) && Rr.tagSelected(B, t, re), B; } function wb(e, t, n, r, a) { var i = r + "bins", o = e._fullLayout, l = t["_" + r + "bingroup"], s = o._histogramBinOpts[l], c = o.barmode === "overlay", u, f, h, g, p, v, y, m = function(te) { return n.r2c(te, 0, g); }, b = function(te) { return n.c2r(te, 0, g); }, w = n.type === "date" ? function(te) { return te || te === 0 ? Rr.cleanDate(te, null, g) : null; } : function(te) { return e1(te) ? Number(te) : null; }; function _(te, X, ce) { X[te + "Found"] ? (X[te] = w(X[te]), X[te] === null && (X[te] = ce[te])) : (v[te] = X[te] = ce[te], Rr.nestedProperty(f[0], i + "." + te).set(ce[te])); } if (t["_" + r + "autoBinFinished"]) delete t["_" + r + "autoBinFinished"]; else { f = s.traces; var k = [], T = !0, O = !1, M = !1; for (u = 0; u < f.length; u++) if (h = f[u], h.visible) { var C = s.dirs[u]; p = h["_" + C + "pos0"] = n.makeCalcdata(h, C), k = Rr.concat(k, p), delete h["_" + r + "autoBinFinished"], t.visible === !0 && (T ? T = !1 : (delete h._autoBin, h["_" + r + "autoBinFinished"] = 1), qM.traceIs(h, "2dMap") && (O = !0), h.type === "histogram2dcontour" && (M = !0)); } g = f[0][r + "calendar"]; var I = ja.autoBin(k, n, s.nbins, O, g, s.sizeFound && s.size), j = f[0]._autoBin = {}; if (v = j[s.dirs[0]] = {}, M && (s.size || (I.start = b(ja.tickIncrement( m(I.start), I.size, !0, g ))), s.end === void 0 && (I.end = b(ja.tickIncrement( m(I.end), I.size, !1, g )))), c && !qM.traceIs(t, "2dMap") && I._dataSpan === 0 && n.type !== "category" && n.type !== "multicategory" && t.bingroup === "" && typeof t.xbins > "u") { if (a) return [I, p, !0]; I = tce(e, t, n, r, i); } y = h.cumulative || {}, y.enabled && y.currentbin !== "include" && (y.direction === "decreasing" ? I.start = b(ja.tickIncrement( m(I.start), I.size, !0, g )) : I.end = b(ja.tickIncrement( m(I.end), I.size, !1, g ))), s.size = I.size, s.sizeFound || (v.size = I.size, Rr.nestedProperty(f[0], i + ".size").set(I.size)), _("start", s, I), _("end", s, I); } p = t["_" + r + "pos0"], delete t["_" + r + "pos0"]; var P = t._input[i] || {}, N = Rr.extendFlat({}, s), W = s.start, J = n.r2l(P.start), U = J !== void 0; if ((s.startFound || U) && J !== n.r2l(W)) { var E = U ? J : Rr.aggNums(Math.min, null, p), z = { type: n.type === "category" || n.type === "multicategory" ? "linear" : n.type, r2l: n.r2l, dtick: s.size, tick0: W, calendar: g, range: [E, ja.tickIncrement(E, s.size, !1, g)].map(n.l2r) }, F = ja.tickFirst(z); F > n.r2l(E) && (F = ja.tickIncrement(F, s.size, !0, g)), N.start = n.l2r(F), U || Rr.nestedProperty(t, i + ".start").set(N.start); } var q = s.end, H = n.r2l(P.end), K = H !== void 0; if ((s.endFound || K) && H !== n.r2l(q)) { var Q = K ? H : Rr.aggNums(Math.max, null, p); N.end = n.l2r(Q), K || Rr.nestedProperty(t, i + ".start").set(N.end); } var re = "autobin" + r; return t._input[re] === !1 && (t._input[i] = Rr.extendFlat({}, t[i] || {}), delete t._input[re], delete t[re]), [N, p]; } function tce(e, t, n, r, a) { var i = e._fullLayout, o = nce(e, t), l = !1, s = 1 / 0, c = [t], u, f, h; for (u = 0; u < o.length; u++) if (f = o[u], f === t) l = !0; else if (!l) h = i._histogramBinOpts[f["_" + r + "bingroup"]], s = Math.min(s, h.size || f[a].size); else { var g = wb(e, f, n, r, !0), p = g[0], v = g[2]; f["_" + r + "autoBinFinished"] = 1, f["_" + r + "pos0"] = g[1], v ? c.push(f) : s = Math.min(s, p.size); } var y = new Array(c.length); for (u = 0; u < c.length; u++) for (var m = c[u]["_" + r + "pos0"], b = 0; b < m.length; b++) if (m[b] !== void 0) { y[u] = m[b]; break; } for (isFinite(s) || (s = Rr.distinctVals(y).minDiff), u = 0; u < c.length; u++) { f = c[u]; var w = f[r + "calendar"], _ = { start: n.c2r(y[u] - s / 2, 0, w), end: n.c2r(y[u] + s / 2, 0, w), size: s }; f._input[a] = f[a] = _, h = i._histogramBinOpts[f["_" + r + "bingroup"]], h && Rr.extendFlat(h, _); } return t[a]; } function nce(e, t) { for (var n = t.xaxis, r = t.yaxis, a = t.orientation, i = [], o = e._fullData, l = 0; l < o.length; l++) { var s = o[l]; s.type === "histogram" && s.visible === !0 && s.orientation === a && s.xaxis === n && s.yaxis === r && i.push(s); } return i; } function rce(e, t, n) { var r, a, i; function o(s) { i = e[s], e[s] /= 2; } function l(s) { a = e[s], e[s] = i + a / 2, i += a; } if (n === "half") if (t === "increasing") for (o(0), r = 1; r < e.length; r++) l(r); else for (o(e.length - 1), r = e.length - 2; r >= 0; r--) l(r); else if (t === "increasing") { for (r = 1; r < e.length; r++) e[r] += e[r - 1]; n === "exclude" && (e.unshift(0), e.pop()); } else { for (r = e.length - 2; r >= 0; r--) e[r] += e[r + 1]; n === "exclude" && (e.push(0), e.shift()); } } var ace = { calc: ece, calcAllAutoBins: wb }, GM = Ue, Js = Ln, WM = TD, ice = AD, oce = MD, lce = SD, ZM = ace.calcAllAutoBins, sce = function(e, t) { var n = Js.getFromId(e, t.xaxis), r = Js.getFromId(e, t.yaxis), a = t.xcalendar, i = t.ycalendar, o = function(dt) { return n.r2c(dt, 0, a); }, l = function(dt) { return r.r2c(dt, 0, i); }, s = function(dt) { return n.c2r(dt, 0, a); }, c = function(dt) { return r.c2r(dt, 0, i); }, u, f, h, g, p = ZM(e, t, n, "x"), v = p[0], y = p[1], m = ZM(e, t, r, "y"), b = m[0], w = m[1], _ = t._length; y.length > _ && y.splice(_, y.length - _), w.length > _ && w.splice(_, w.length - _); var k = [], T = [], O = [], M = typeof v.size == "string", C = typeof b.size == "string", I = [], j = [], P = M ? I : v, N = C ? j : b, W = 0, J = [], U = [], E = t.histnorm, z = t.histfunc, F = E.indexOf("density") !== -1, q = z === "max" || z === "min", H = q ? null : 0, K = WM.count, Q = ice[E], re = !1, te = [], X = [], ce = "z" in t ? t.z : "marker" in t && Array.isArray(t.marker.color) ? t.marker.color : ""; ce && z !== "count" && (re = z === "avg", K = WM[z]); var B = v.size, G = o(v.start), Z = o(v.end) + (G - Js.tickIncrement(G, B, !1, a)) / 1e6; for (u = G; u < Z; u = Js.tickIncrement(u, B, !1, a)) T.push(H), I.push(u), re && O.push(0); I.push(u); var oe = T.length, ae = (u - G) / oe, ge = s(G + ae / 2), ve = b.size, pe = l(b.start), ye = l(b.end) + (pe - Js.tickIncrement(pe, ve, !1, i)) / 1e6; for (u = pe; u < ye; u = Js.tickIncrement(u, ve, !1, i)) { k.push(T.slice()), j.push(u); var Oe = new Array(oe); for (f = 0; f < oe; f++) Oe[f] = []; U.push(Oe), re && J.push(O.slice()); } j.push(u); var Be = k.length, Ie = (u - pe) / Be, Fe = c(pe + Ie / 2); F && (te = YM(T.length, P, ae, M), X = YM(k.length, N, Ie, C)), !M && n.type === "date" && (P = $M(o, P)), !C && r.type === "date" && (N = $M(l, N)); var Re = !0, We = !0, Ce = new Array(oe), Ve = new Array(Be), Ke = 1 / 0, Xe = 1 / 0, ct = 1 / 0, vt = 1 / 0; for (u = 0; u < _; u++) { var lt = y[u], ut = w[u]; h = GM.findBin(lt, P), g = GM.findBin(ut, N), h >= 0 && h < oe && g >= 0 && g < Be && (W += K(h, u, k[g], ce, J[g]), U[g][h].push(u), Re && (Ce[h] === void 0 ? Ce[h] = lt : Ce[h] !== lt && (Re = !1)), We && (Ve[g] === void 0 ? Ve[g] = ut : Ve[g] !== ut && (We = !1)), Ke = Math.min(Ke, lt - I[h]), Xe = Math.min(Xe, I[h + 1] - lt), ct = Math.min(ct, ut - j[g]), vt = Math.min(vt, j[g + 1] - ut)); } if (re) for (g = 0; g < Be; g++) W += oce(k[g], J[g]); if (Q) for (g = 0; g < Be; g++) Q(k[g], W, te, X[g]); return { x: y, xRanges: KM(I, Re && Ce, Ke, Xe, n, a), x0: ge, dx: ae, y: w, yRanges: KM(j, We && Ve, ct, vt, r, i), y0: Fe, dy: Ie, z: k, pts: U }; }; function YM(e, t, n, r) { var a = new Array(e), i; if (r) for (i = 0; i < e; i++) a[i] = 1 / (t[i + 1] - t[i]); else { var o = 1 / n; for (i = 0; i < e; i++) a[i] = o; } return a; } function $M(e, t) { return { start: e(t.start), end: e(t.end), size: t.size }; } function KM(e, t, n, r, a, i) { var o, l = e.length - 1, s = new Array(l), c = lce(n, r, e, a, i); for (o = 0; o < l; o++) { var u = (t || [])[o]; s[o] = u === void 0 ? [c(e[o]), c(e[o + 1], !0)] : [u, u]; } return s; } var Di = Ue, JM = er.BADNUM, QM = Z0, cce = function(e, t, n, r, a, i) { var o = e._length, l = t.makeCalcdata(e, r), s = n.makeCalcdata(e, a); l = QM(e, t, r, l).vals, s = QM(e, n, a, s).vals; var c = e.text, u = c !== void 0 && Di.isArray1D(c), f = e.hovertext, h = f !== void 0 && Di.isArray1D(f), g, p, v = Di.distinctVals(l), y = v.vals, m = Di.distinctVals(s), b = m.vals, w = [], _, k, T = b.length, O = y.length; for (g = 0; g < i.length; g++) w[g] = Di.init2dArray(T, O); u && (_ = Di.init2dArray(T, O)), h && (k = Di.init2dArray(T, O)); var M = Di.init2dArray(T, O); for (g = 0; g < o; g++) if (l[g] !== JM && s[g] !== JM) { var C = Di.findBin(l[g] + v.minDiff / 2, y), I = Di.findBin(s[g] + m.minDiff / 2, b); for (p = 0; p < i.length; p++) { var j = i[p], P = e[j], N = w[p]; N[I][C] = P[g], M[I][C] = g; } u && (_[I][C] = c[g]), h && (k[I][C] = f[g]); } for (e["_" + r] = y, e["_" + a] = b, p = 0; p < i.length; p++) e["_" + i[p]] = w[p]; u && (e._text = _), h && (e._hovertext = k), t && t.type === "category" && (e["_" + r + "CategoryMap"] = y.map(function(W) { return t._categories[W]; })), n && n.type === "category" && (e["_" + a + "CategoryMap"] = b.map(function(W) { return n._categories[W]; })), e._after2before = M; }, uce = cn, dce = Ue, Mh = er.BADNUM, fce = function(e, t, n, r) { var a, i, o, l, s, c; function u(y) { if (uce(y)) return +y; } if (t && t.transpose) { for (a = 0, s = 0; s < e.length; s++) a = Math.max(a, e[s].length); if (a === 0) return !1; o = function(y) { return y.length; }, l = function(y, m, b) { return (y[b] || [])[m]; }; } else a = e.length, o = function(y, m) { return y[m].length; }, l = function(y, m, b) { return (y[m] || [])[b]; }; var f = function(y, m, b) { return m === Mh || b === Mh ? Mh : l(y, m, b); }; function h(y) { if (t && t.type !== "carpet" && t.type !== "contourcarpet" && y && y.type === "category" && t["_" + y._id.charAt(0)].length) { var m = y._id.charAt(0), b = {}, w = t["_" + m + "CategoryMap"] || t[m]; for (s = 0; s < w.length; s++) b[w[s]] = s; return function(_) { var k = b[y._categories[_]]; return k + 1 ? k : Mh; }; } else return dce.identity; } var g = h(n), p = h(r); r && r.type === "category" && (a = r._categories.length); var v = new Array(a); for (s = 0; s < a; s++) for (n && n.type === "category" ? i = n._categories.length : i = o(e, s), v[s] = new Array(i), c = 0; c < i; c++) v[s][c] = u(f(e, p(s), g(c))); return v; }, hce = Ue, XM = 0.01, pce = [[-1, 0], [1, 0], [0, -1], [0, 1]]; function gce(e) { return 0.5 - 0.25 * Math.min(1, e * 0.5); } var vce = function(e, t) { var n = 1, r; for (e3(e, t), r = 0; r < t.length && !(t[r][2] < 4); r++) ; for (t = t.slice(r), r = 0; r < 100 && n > XM; r++) n = e3( e, t, gce(n) ); return n > XM && hce.log("interp2d didn't converge quickly", n), e; }; function e3(e, t, n) { var r = 0, a, i, o, l, s, c, u, f, h, g, p, v, y; for (l = 0; l < t.length; l++) { for (a = t[l], i = a[0], o = a[1], p = e[i][o], g = 0, h = 0, s = 0; s < 4; s++) c = pce[s], u = e[i + c[0]], u && (f = u[o + c[1]], f !== void 0 && (g === 0 ? v = y = f : (v = Math.min(v, f), y = Math.max(y, f)), h++, g += f)); if (h === 0) throw "iterateInterp2d order is wrong: no defined neighbors"; e[i][o] = g / h, p === void 0 ? h < 4 && (r = 1) : (e[i][o] = (1 + n) * e[i][o] - n * p, y > v && (r = Math.max( r, Math.abs(e[i][o] - p) / (y - v) ))); } return r; } var mce = Ue.maxRowLength, yce = function(e) { var t = [], n = {}, r = [], a = e[0], i = [], o = [0, 0, 0], l = mce(e), s, c, u, f, h, g, p, v; for (c = 0; c < e.length; c++) for (s = i, i = a, a = e[c + 1] || [], u = 0; u < l; u++) i[u] === void 0 && (g = (i[u - 1] !== void 0 ? 1 : 0) + (i[u + 1] !== void 0 ? 1 : 0) + (s[u] !== void 0 ? 1 : 0) + (a[u] !== void 0 ? 1 : 0), g ? (c === 0 && g++, u === 0 && g++, c === e.length - 1 && g++, u === i.length - 1 && g++, g < 4 && (n[[c, u]] = [c, u, g]), t.push([c, u, g])) : r.push([c, u])); for (; r.length; ) { for (p = {}, v = !1, h = r.length - 1; h >= 0; h--) f = r[h], c = f[0], u = f[1], g = ((n[[c - 1, u]] || o)[2] + (n[[c + 1, u]] || o)[2] + (n[[c, u - 1]] || o)[2] + (n[[c, u + 1]] || o)[2]) / 20, g && (p[f] = [c, u, g], r.splice(h, 1), v = !0); if (!v) throw "findEmpties iterated with no new neighbors"; for (f in p) n[f] = p[f], t.push(p[f]); } return t.sort(function(y, m) { return m[2] - y[2]; }); }, Om = Rt, t3 = Ue.isArrayOrTypedArray, xce = function(e, t, n, r, a, i) { var o = [], l = Om.traceIs(e, "contour"), s = Om.traceIs(e, "histogram"), c = Om.traceIs(e, "gl2d"), u, f, h, g = t3(t) && t.length > 1; if (g && !s && i.type !== "category") { var p = t.length; if (p <= a) { if (l || c) o = Array.from(t).slice(0, a); else if (a === 1) o = [t[0] - 0.5, t[0] + 0.5]; else { for (o = [1.5 * t[0] - 0.5 * t[1]], h = 1; h < p; h++) o.push((t[h - 1] + t[h]) * 0.5); o.push(1.5 * t[p - 1] - 0.5 * t[p - 2]); } if (p < a) { var v = o[o.length - 1], y = v - o[o.length - 2]; for (h = p; h < a; h++) v += y, o.push(v); } } else return l ? t.slice(0, a) : ( // we must be strict for contours t.slice(0, a + 1) ); } else { var m = e[i._id.charAt(0) + "calendar"]; if (s) u = i.r2c(n, 0, m); else if (t3(t) && t.length === 1) u = t[0]; else if (n === void 0) u = 0; else { var b = i.type === "log" ? i.d2c : i.r2c; u = b(n, 0, m); } for (f = r || 1, h = l || c ? 0 : -0.5; h < a; h++) o.push(u + f * h); } return o; }, Dm = Rt, Fm = Ue, Sh = Ln, n3 = Z0, bce = sce, wce = M0, _ce = cce, kce = fce, Tce = vce, Ace = yce, Ch = xce, t1 = er.BADNUM, Mce = function(e, t) { var n = Sh.getFromId(e, t.xaxis || "x"), r = Sh.getFromId(e, t.yaxis || "y"), a = Dm.traceIs(t, "contour"), i = Dm.traceIs(t, "histogram"), o = Dm.traceIs(t, "gl2d"), l = a ? "best" : t.zsmooth, s, c, u, f, h, g, p, v, y, m, b; if (n._minDtick = 0, r._minDtick = 0, i) b = bce(e, t), f = b.orig_x, s = b.x, c = b.x0, u = b.dx, v = b.orig_y, h = b.y, g = b.y0, p = b.dy, y = b.z; else { var w = t.z; Fm.isArray1D(w) ? (_ce(t, n, r, "x", "y", ["z"]), s = t._x, h = t._y, w = t._z) : (f = t.x ? n.makeCalcdata(t, "x") : [], v = t.y ? r.makeCalcdata(t, "y") : [], s = n3(t, n, "x", f).vals, h = n3(t, r, "y", v).vals, t._x = s, t._y = h), c = t.x0, u = t.dx, g = t.y0, p = t.dy, y = kce(w, t, n, r); } (n.rangebreaks || r.rangebreaks) && (y = Sce(s, h, y), i || (s = r3(s), h = r3(h), t._x = s, t._y = h)), !i && (a || t.connectgaps) && (t._emptypoints = Ace(y), Tce(y, t._emptypoints)); function _(N) { l = t._input.zsmooth = t.zsmooth = !1, Fm.warn('cannot use zsmooth: "fast": ' + N); } function k(N) { if (N.length > 1) { var W = (N[N.length - 1] - N[0]) / (N.length - 1), J = Math.abs(W / 100); for (m = 0; m < N.length - 1; m++) if (Math.abs(N[m + 1] - N[m] - W) > J) return !1; } return !0; } t._islinear = !1, n.type === "log" || r.type === "log" ? l === "fast" && _("log axis found") : k(s) ? k(h) ? t._islinear = !0 : l === "fast" && _("y scale is not linear") : l === "fast" && _("x scale is not linear"); var T = Fm.maxRowLength(y), O = t.xtype === "scaled" ? "" : s, M = Ch(t, O, c, u, T, n), C = t.ytype === "scaled" ? "" : h, I = Ch(t, C, g, p, y.length, r); o || (t._extremes[n._id] = Sh.findExtremes(n, M), t._extremes[r._id] = Sh.findExtremes(r, I)); var j = { x: M, y: I, z: y, text: t._text || t.text, hovertext: t._hovertext || t.hovertext }; if (t.xperiodalignment && f && (j.orig_x = f), t.yperiodalignment && v && (j.orig_y = v), O && O.length === M.length - 1 && (j.xCenter = O), C && C.length === I.length - 1 && (j.yCenter = C), i && (j.xRanges = b.xRanges, j.yRanges = b.yRanges, j.pts = b.pts), a || wce(e, t, { vals: y, cLetter: "z" }), a && t.contours && t.contours.coloring === "heatmap") { var P = { type: t.type === "contour" ? "heatmap" : "histogram2d", xcalendar: t.xcalendar, ycalendar: t.ycalendar }; j.xfill = Ch(P, O, c, u, T, n), j.yfill = Ch(P, C, g, p, y.length, r); } return [j]; }; function r3(e) { for (var t = [], n = e.length, r = 0; r < n; r++) { var a = e[r]; a !== t1 && t.push(a); } return t; } function Sce(e, t, n) { for (var r = [], a = -1, i = 0; i < n.length; i++) if (t[i] !== t1) { a++, r[a] = []; for (var o = 0; o < n[i].length; o++) e[o] !== t1 && r[a].push(n[i][o]); } return r; } var _b = {}; (function(e) { e.CSS_DECLARATIONS = [ ["image-rendering", "optimizeSpeed"], ["image-rendering", "-moz-crisp-edges"], ["image-rendering", "-o-crisp-edges"], ["image-rendering", "-webkit-optimize-contrast"], ["image-rendering", "optimize-contrast"], ["image-rendering", "crisp-edges"], ["image-rendering", "pixelated"] ], e.STYLE = e.CSS_DECLARATIONS.map(function(t) { return t.join(": ") + "; "; }).join(""); })(_b); var a3 = _b, Cce = Cn, Im = Ue, Qs = null; function Lce() { if (Qs !== null) return Qs; Qs = !1; var e = Im.isIE() || Im.isSafari() || Im.isIOS(); if (window.navigator.userAgent && !e) { var t = Array.from(a3.CSS_DECLARATIONS).reverse(), n = window.CSS && window.CSS.supports || window.supportsCSS; if (typeof n == "function") Qs = t.some(function(o) { return n.apply(null, o); }); else { var r = Cce.tester.append("image").attr("style", a3.STYLE), a = window.getComputedStyle(r.node()), i = a.imageRendering; Qs = t.some(function(o) { var l = o[1]; return i === l || i === l.toLowerCase(); }), r.remove(); } } return Qs; } var Oce = Lce, i3 = sn, Dce = xi, Fce = Rt, Ice = Cn, zce = Ln, Pa = Ue, o3 = Ir, Ece = nO, jce = rn, Pce = Qd.extractOpts, Rce = Qd.makeColorScaleFuncFromTrace, Nce = yl, Bce = Nr, zm = Bce.LINE_SPACING, Hce = Oce, Vce = _b.STYLE, CD = "heatmap-label"; function LD(e) { return e.selectAll("g." + CD); } function l3(e) { LD(e).remove(); } var qce = function(e, t, n, r) { var a = t.xaxis, i = t.yaxis; Pa.makeTraceGroups(r, n, "hm").each(function(o) { var l = i3.select(this), s = o[0], c = s.trace, u = c.xgap || 0, f = c.ygap || 0, h = s.z, g = s.x, p = s.y, v = s.xCenter, y = s.yCenter, m = Fce.traceIs(c, "contour"), b = m ? "best" : c.zsmooth, w = h.length, _ = Pa.maxRowLength(h), k = !1, T = !1, O, M, C, I, j, P, N, W; for (P = 0; O === void 0 && P < g.length - 1; ) O = a.c2p(g[P]), P++; for (P = g.length - 1; M === void 0 && P > 0; ) M = a.c2p(g[P]), P--; for (M < O && (C = M, M = O, O = C, k = !0), P = 0; I === void 0 && P < p.length - 1; ) I = i.c2p(p[P]), P++; for (P = p.length - 1; j === void 0 && P > 0; ) j = i.c2p(p[P]), P--; j < I && (C = I, I = j, j = C, T = !0), m && (v = g, y = p, g = s.xfill, p = s.yfill); var J = "default"; if (b ? J = b === "best" ? "smooth" : "fast" : c._islinear && u === 0 && f === 0 && Hce() && (J = "fast"), J !== "fast") { var U = b === "best" ? 0 : 0.5; O = Math.max(-U * a._length, O), M = Math.min((1 + U) * a._length, M), I = Math.max(-U * i._length, I), j = Math.min((1 + U) * i._length, j); } var E = Math.round(M - O), z = Math.round(j - I), F = O >= a._length || M <= 0 || I >= i._length || j <= 0; if (F) { var q = l.selectAll("image").data([]); q.exit().remove(), l3(l); return; } var H, K; J === "fast" ? (H = _, K = w) : (H = E, K = z); var Q = document.createElement("canvas"); Q.width = H, Q.height = K; var re = Q.getContext("2d", { willReadFrequently: !0 }), te = Rce(c, { noNumericCheck: !0, returnArray: !0 }), X, ce; J === "fast" ? (X = k ? function(Ht) { return _ - 1 - Ht; } : Pa.identity, ce = T ? function(Ht) { return w - 1 - Ht; } : Pa.identity) : (X = function(Ht) { return Pa.constrain( Math.round(a.c2p(g[Ht]) - O), 0, E ); }, ce = function(Ht) { return Pa.constrain( Math.round(i.c2p(p[Ht]) - I), 0, z ); }); var B = ce(0), G = [B, B], Z = k ? 0 : 1, oe = T ? 0 : 1, ae = 0, ge = 0, ve = 0, pe = 0, ye, Oe, Be, Ie, Fe; function Re(Ht, jn) { if (Ht !== void 0) { var an = te(Ht); return an[0] = Math.round(an[0]), an[1] = Math.round(an[1]), an[2] = Math.round(an[2]), ae += jn, ge += an[0] * jn, ve += an[1] * jn, pe += an[2] * jn, an; } return [0, 0, 0, 0]; } function We(Ht, jn, an, En) { var Un = Ht[an.bin0]; if (Un === void 0) return Re(void 0, 1); var zr = Ht[an.bin1], hr = jn[an.bin0], pr = jn[an.bin1], Ja = zr - Un || 0, to = hr - Un || 0, lr; return zr === void 0 ? pr === void 0 ? lr = 0 : hr === void 0 ? lr = 2 * (pr - Un) : lr = (2 * pr - hr - Un) * 2 / 3 : pr === void 0 ? hr === void 0 ? lr = 0 : lr = (2 * Un - zr - hr) * 2 / 3 : hr === void 0 ? lr = (2 * pr - zr - Un) * 2 / 3 : lr = pr + Un - zr - hr, Re(Un + an.frac * Ja + En.frac * (to + an.frac * lr)); } if (J !== "default") { var Ce = 0, Ve; try { Ve = new Uint8Array(H * K * 4); } catch { Ve = new Array(H * K * 4); } if (J === "smooth") { var Ke = v || g, Xe = y || p, ct = new Array(Ke.length), vt = new Array(Xe.length), lt = new Array(E), ut = v ? c3 : s3, dt = y ? c3 : s3, Pe, ze, Ne; for (P = 0; P < Ke.length; P++) ct[P] = Math.round(a.c2p(Ke[P]) - O); for (P = 0; P < Xe.length; P++) vt[P] = Math.round(i.c2p(Xe[P]) - I); for (P = 0; P < E; P++) lt[P] = ut(P, ct); for (N = 0; N < z; N++) for (Pe = dt(N, vt), ze = h[Pe.bin0], Ne = h[Pe.bin1], P = 0; P < E; P++, Ce += 4) Fe = We(ze, Ne, lt[P], Pe), u3(Ve, Ce, Fe); } else for (N = 0; N < w; N++) for (Ie = h[N], G = ce(N), P = 0; P < _; P++) Fe = Re(Ie[P], 1), Ce = (G * _ + X(P)) * 4, u3(Ve, Ce, Fe); var nt = re.createImageData(H, K); try { nt.data.set(Ve); } catch { var Qe = nt.data, it = Qe.length; for (N = 0; N < it; N++) Qe[N] = Ve[N]; } re.putImageData(nt, 0, 0); } else { var rt = Math.floor(u / 2), bt = Math.floor(f / 2); for (N = 0; N < w; N++) if (Ie = h[N], G.reverse(), G[oe] = ce(N + 1), !(G[0] === G[1] || G[0] === void 0 || G[1] === void 0)) for (Oe = X(0), ye = [Oe, Oe], P = 0; P < _; P++) ye.reverse(), ye[Z] = X(P + 1), !(ye[0] === ye[1] || ye[0] === void 0 || ye[1] === void 0) && (Be = Ie[P], Fe = Re(Be, (ye[1] - ye[0]) * (G[1] - G[0])), re.fillStyle = "rgba(" + Fe.join(",") + ")", re.fillRect( ye[0] + rt, G[0] + bt, ye[1] - ye[0] - u, G[1] - G[0] - f )); } ge = Math.round(ge / ae), ve = Math.round(ve / ae), pe = Math.round(pe / ae); var je = Dce("rgb(" + ge + "," + ve + "," + pe + ")"); e._hmpixcount = (e._hmpixcount || 0) + ae, e._hmlumcount = (e._hmlumcount || 0) + ae * je.getLuminance(); var tt = l.selectAll("image").data(o); tt.enter().append("svg:image").attr({ xmlns: Nce.svg, preserveAspectRatio: "none" }), tt.attr({ height: z, width: E, x: O, y: I, "xlink:href": Q.toDataURL("image/png") }), J === "fast" && !b && tt.attr("style", Vce), l3(l); var pt = c.texttemplate; if (pt) { var kt = Pce(c), et = { type: "linear", range: [kt.min, kt.max], _separators: a._separators, _numFormat: a._numFormat }, ft = c.type === "histogram2dcontour", $e = c.type === "contour", Lt = $e ? 1 : 0, $ = $e ? w - 1 : w, se = $e ? 1 : 0, ie = $e ? _ - 1 : _, de = []; for (P = Lt; P < $; P++) { var Te; if ($e) Te = s.y[P]; else if (ft) { if (P === 0 || P === w - 1) continue; Te = s.y[P]; } else if (s.yCenter) Te = s.yCenter[P]; else { if (P + 1 === w && s.y[P + 1] === void 0) continue; Te = (s.y[P] + s.y[P + 1]) / 2; } var xe = Math.round(i.c2p(Te)); if (!(0 > xe || xe > i._length)) for (N = se; N < ie; N++) { var Ge; if ($e) Ge = s.x[N]; else if (ft) { if (N === 0 || N === _ - 1) continue; Ge = s.x[N]; } else if (s.xCenter) Ge = s.xCenter[N]; else { if (N + 1 === _ && s.x[N + 1] === void 0) continue; Ge = (s.x[N] + s.x[N + 1]) / 2; } var qe = Math.round(a.c2p(Ge)); if (!(0 > qe || qe > a._length)) { var De = Ece({ x: Ge, y: Te }, c, e._fullLayout); De.x = Ge, De.y = Te; var le = s.z[P][N]; le === void 0 ? (De.z = "", De.zLabel = "") : (De.z = le, De.zLabel = zce.tickText(et, le, "hover").text); var Se = s.text && s.text[P] && s.text[P][N]; (Se === void 0 || Se === !1) && (Se = ""), De.text = Se; var He = Pa.texttemplateString(pt, De, e._fullLayout._d3locale, De, c._meta || {}); if (He) { var Je = He.split("
"), Dt = Je.length, zt = 0; for (W = 0; W < Dt; W++) zt = Math.max(zt, Je[W].length); de.push({ l: Dt, // number of lines c: zt, // maximum number of chars in a line t: He, // text x: qe, y: xe, z: le }); } } } } var Pt = c.textfont, _t = Pt.family, $t = Pt.size, Nt = e._fullLayout.font.size; if (!$t || $t === "auto") { var wt = 1 / 0, Yt = 1 / 0, Jt = 0, jt = 0; for (W = 0; W < de.length; W++) { var Et = de[W]; if (Jt = Math.max(Jt, Et.l), jt = Math.max(jt, Et.c), W < de.length - 1) { var At = de[W + 1], Ot = Math.abs(At.x - Et.x), qt = Math.abs(At.y - Et.y); Ot && (wt = Math.min(wt, Ot)), qt && (Yt = Math.min(Yt, qt)); } } !isFinite(wt) || !isFinite(Yt) ? $t = Nt : (wt -= u, Yt -= f, wt /= jt, Yt /= Jt, wt /= zm / 2, Yt /= zm, $t = Math.min( Math.floor(wt), Math.floor(Yt), Nt )); } if ($t <= 0 || !isFinite($t)) return; var dn = function(Ht) { return Ht.x; }, Mt = function(Ht) { return Ht.y - $t * (Ht.l * zm / 2 - 1); }, tn = LD(l).data(de); tn.enter().append("g").classed(CD, 1).append("text").attr("text-anchor", "middle").each(function(Ht) { var jn = i3.select(this), an = Pt.color; (!an || an === "auto") && (an = jce.contrast( "rgba(" + te(Ht.z).join() + ")" )), jn.attr("data-notex", 1).call(o3.positionText, dn(Ht), Mt(Ht)).call(Ice.font, _t, $t, an).text(Ht.t).call(o3.convertToTspans, e); }); } }); }; function s3(e, t) { var n = t.length - 2, r = Pa.constrain(Pa.findBin(e, t), 0, n), a = t[r], i = t[r + 1], o = Pa.constrain(r + (e - a) / (i - a) - 0.5, 0, n), l = Math.round(o), s = Math.abs(o - l); return !o || o === n || !s ? { bin0: l, bin1: l, frac: 0 } : { bin0: l, frac: s, bin1: Math.round(l + s / (o - l)) }; } function c3(e, t) { var n = t.length - 1, r = Pa.constrain(Pa.findBin(e, t), 0, n), a = t[r], i = t[r + 1], o = (e - a) / (i - a) || 0; return o <= 0 ? { bin0: r, bin1: r, frac: 0 } : o < 0.5 ? { bin0: r, bin1: r + 1, frac: o } : { bin0: r + 1, bin1: r, frac: 1 - o }; } function u3(e, t, n) { e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = Math.round(n[3] * 255); } var Uce = { min: "zmin", max: "zmax" }, Gce = sn, Wce = function(e) { Gce.select(e).selectAll(".hm image").style("opacity", function(t) { return t.trace.opacity; }); }, d3 = Ao, $u = Ue, Lh = $u.isArrayOrTypedArray, Zce = Ln, Yce = Qd.extractOpts, $ce = function(e, t, n, r, a) { a || (a = {}); var i = a.isContour, o = e.cd[0], l = o.trace, s = e.xa, c = e.ya, u = o.x, f = o.y, h = o.z, g = o.xCenter, p = o.yCenter, v = o.zmask, y = l.zhoverformat, m = u, b = f, w, _, k, T; if (e.index !== !1) { try { k = Math.round(e.index[1]), T = Math.round(e.index[0]); } catch { $u.error("Error hovering on heatmap, pointNumber must be [row,col], found:", e.index); return; } if (k < 0 || k >= h[0].length || T < 0 || T > h.length) return; } else { if (d3.inbox(t - u[0], t - u[u.length - 1], 0) > 0 || d3.inbox(n - f[0], n - f[f.length - 1], 0) > 0) return; if (i) { var O; for (m = [2 * u[0] - u[1]], O = 1; O < u.length; O++) m.push((u[O] + u[O - 1]) / 2); for (m.push([2 * u[u.length - 1] - u[u.length - 2]]), b = [2 * f[0] - f[1]], O = 1; O < f.length; O++) b.push((f[O] + f[O - 1]) / 2); b.push([2 * f[f.length - 1] - f[f.length - 2]]); } k = Math.max(0, Math.min(m.length - 2, $u.findBin(t, m))), T = Math.max(0, Math.min(b.length - 2, $u.findBin(n, b))); } var M = s.c2p(u[k]), C = s.c2p(u[k + 1]), I = c.c2p(f[T]), j = c.c2p(f[T + 1]), P, N; i ? (P = o.orig_x || u, N = o.orig_y || f, C = M, w = P[k], j = I, _ = N[T]) : (P = o.orig_x || g || u, N = o.orig_y || p || f, w = g ? P[k] : (P[k] + P[k + 1]) / 2, _ = p ? N[T] : (N[T] + N[T + 1]) / 2, s && s.type === "category" && (w = u[k]), c && c.type === "category" && (_ = f[T]), l.zsmooth && (M = C = s.c2p(w), I = j = c.c2p(_))); var W = h[T][k]; if (v && !v[T][k] && (W = void 0), !(W === void 0 && !l.hoverongaps)) { var J; Lh(o.hovertext) && Lh(o.hovertext[T]) ? J = o.hovertext[T][k] : Lh(o.text) && Lh(o.text[T]) && (J = o.text[T][k]); var U = Yce(l), E = { type: "linear", range: [U.min, U.max], hoverformat: y, _separators: s._separators, _numFormat: s._numFormat }, z = Zce.tickText(E, W, "hover").text; return [$u.extendFlat(e, { index: l._after2before ? l._after2before[T][k] : [T, k], // never let a 2D override 1D type as closest point distance: e.maxHoverDistance, spikeDistance: e.maxSpikeDistance, x0: M, x1: C, y0: I, y1: j, xLabelVal: w, yLabelVal: _, zLabelVal: W, zLabel: z, text: J })]; } }, Kce = { attributes: kD, supplyDefaults: Yse, calc: Mce, plot: qce, colorbar: Uce, style: Wce, hoverPoints: $ce, moduleType: "trace", name: "heatmap", basePlotModule: yr, categories: ["cartesian", "svg", "2dMap", "showLegend"], meta: { description: [ "The data that describes the heatmap value-to-color mapping", "is set in `z`.", "Data in `z` can either be a {2D array} of values (ragged or not)", "or a 1D array of values.", "In the case where `z` is a {2D array},", "say that `z` has N rows and M columns.", "Then, by default, the resulting heatmap will have N partitions along", "the y axis and M partitions along the x axis.", "In other words, the i-th row/ j-th column cell in `z`", "is mapped to the i-th partition of the y axis", "(starting from the bottom of the plot) and the j-th partition", "of the x-axis (starting from the left of the plot).", "This behavior can be flipped by using `transpose`.", "Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.", "If M (N), then the coordinates correspond to the center of the", "heatmap cells and the cells have equal width.", "If M+1 (N+1), then the coordinates correspond to the edges of the", "heatmap cells.", "In the case where `z` is a 1D {array}, the x and y coordinates must be", "provided in `x` and `y` respectively to form data triplets." ].join(" ") } }, Jce = Kce; const Qce = /* @__PURE__ */ Ud(Jce); Rd.register([ule, Ose, Qce]); var OD = { exports: {} }; /* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse License: MIT */ (function(e, t) { (function(n, r) { e.exports = r(); })(gd, function n() { var r = typeof self < "u" ? self : typeof window < "u" ? window : r !== void 0 ? r : {}, a = !r.document && !!r.postMessage, i = r.IS_PAPA_WORKER || !1, o = {}, l = 0, s = { parse: function(M, C) { var I = (C = C || {}).dynamicTyping || !1; if (O(I) && (C.dynamicTypingFunction = I, I = {}), C.dynamicTyping = I, C.transform = !!O(C.transform) && C.transform, C.worker && s.WORKERS_SUPPORTED) { var j = function() { if (!s.WORKERS_SUPPORTED) return !1; var N = (J = r.URL || r.webkitURL || null, U = n.toString(), s.BLOB_URL || (s.BLOB_URL = J.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", U, ")();"], { type: "text/javascript" })))), W = new r.Worker(N), J, U; return W.onmessage = b, W.id = l++, o[W.id] = W; }(); return j.userStep = C.step, j.userChunk = C.chunk, j.userComplete = C.complete, j.userError = C.error, C.step = O(C.step), C.chunk = O(C.chunk), C.complete = O(C.complete), C.error = O(C.error), delete C.worker, void j.postMessage({ input: M, config: C, workerId: j.id }); } var P = null; return s.NODE_STREAM_INPUT, typeof M == "string" ? (M = function(N) { return N.charCodeAt(0) === 65279 ? N.slice(1) : N; }(M), P = C.download ? new f(C) : new g(C)) : M.readable === !0 && O(M.read) && O(M.on) ? P = new p(C) : (r.File && M instanceof File || M instanceof Object) && (P = new h(C)), P.stream(M); }, unparse: function(M, C) { var I = !1, j = !0, P = ",", N = `\r `, W = '"', J = W + W, U = !1, E = null, z = !1; (function() { if (typeof C == "object") { if (typeof C.delimiter != "string" || s.BAD_DELIMITERS.filter(function(K) { return C.delimiter.indexOf(K) !== -1; }).length || (P = C.delimiter), (typeof C.quotes == "boolean" || typeof C.quotes == "function" || Array.isArray(C.quotes)) && (I = C.quotes), typeof C.skipEmptyLines != "boolean" && typeof C.skipEmptyLines != "string" || (U = C.skipEmptyLines), typeof C.newline == "string" && (N = C.newline), typeof C.quoteChar == "string" && (W = C.quoteChar), typeof C.header == "boolean" && (j = C.header), Array.isArray(C.columns)) { if (C.columns.length === 0) throw new Error("Option columns is empty"); E = C.columns; } C.escapeChar !== void 0 && (J = C.escapeChar + W), (typeof C.escapeFormulae == "boolean" || C.escapeFormulae instanceof RegExp) && (z = C.escapeFormulae instanceof RegExp ? C.escapeFormulae : /^[=+\-@\t\r].*$/); } })(); var F = new RegExp(y(W), "g"); if (typeof M == "string" && (M = JSON.parse(M)), Array.isArray(M)) { if (!M.length || Array.isArray(M[0])) return q(null, M, U); if (typeof M[0] == "object") return q(E || Object.keys(M[0]), M, U); } else if (typeof M == "object") return typeof M.data == "string" && (M.data = JSON.parse(M.data)), Array.isArray(M.data) && (M.fields || (M.fields = M.meta && M.meta.fields || E), M.fields || (M.fields = Array.isArray(M.data[0]) ? M.fields : typeof M.data[0] == "object" ? Object.keys(M.data[0]) : []), Array.isArray(M.data[0]) || typeof M.data[0] == "object" || (M.data = [M.data])), q(M.fields || [], M.data || [], U); throw new Error("Unable to serialize unrecognized input"); function q(K, Q, re) { var te = ""; typeof K == "string" && (K = JSON.parse(K)), typeof Q == "string" && (Q = JSON.parse(Q)); var X = Array.isArray(K) && 0 < K.length, ce = !Array.isArray(Q[0]); if (X && j) { for (var B = 0; B < K.length; B++) 0 < B && (te += P), te += H(K[B], B); 0 < Q.length && (te += N); } for (var G = 0; G < Q.length; G++) { var Z = X ? K.length : Q[G].length, oe = !1, ae = X ? Object.keys(Q[G]).length === 0 : Q[G].length === 0; if (re && !X && (oe = re === "greedy" ? Q[G].join("").trim() === "" : Q[G].length === 1 && Q[G][0].length === 0), re === "greedy" && X) { for (var ge = [], ve = 0; ve < Z; ve++) { var pe = ce ? K[ve] : ve; ge.push(Q[G][pe]); } oe = ge.join("").trim() === ""; } if (!oe) { for (var ye = 0; ye < Z; ye++) { 0 < ye && !ae && (te += P); var Oe = X && ce ? K[ye] : ye; te += H(Q[G][Oe], ye); } G < Q.length - 1 && (!re || 0 < Z && !ae) && (te += N); } } return te; } function H(K, Q) { if (K == null) return ""; if (K.constructor === Date) return JSON.stringify(K).slice(1, 25); var re = !1; z && typeof K == "string" && z.test(K) && (K = "'" + K, re = !0); var te = K.toString().replace(F, J); return (re = re || I === !0 || typeof I == "function" && I(K, Q) || Array.isArray(I) && I[Q] || function(X, ce) { for (var B = 0; B < ce.length; B++) if (-1 < X.indexOf(ce[B])) return !0; return !1; }(te, s.BAD_DELIMITERS) || -1 < te.indexOf(P) || te.charAt(0) === " " || te.charAt(te.length - 1) === " ") ? W + te + W : te; } } }; if (s.RECORD_SEP = "", s.UNIT_SEP = "", s.BYTE_ORDER_MARK = "\uFEFF", s.BAD_DELIMITERS = ["\r", ` `, '"', s.BYTE_ORDER_MARK], s.WORKERS_SUPPORTED = !a && !!r.Worker, s.NODE_STREAM_INPUT = 1, s.LocalChunkSize = 10485760, s.RemoteChunkSize = 5242880, s.DefaultDelimiter = ",", s.Parser = m, s.ParserHandle = v, s.NetworkStreamer = f, s.FileStreamer = h, s.StringStreamer = g, s.ReadableStreamStreamer = p, r.jQuery) { var c = r.jQuery; c.fn.parse = function(M) { var C = M.config || {}, I = []; return this.each(function(N) { if (!(c(this).prop("tagName").toUpperCase() === "INPUT" && c(this).attr("type").toLowerCase() === "file" && r.FileReader) || !this.files || this.files.length === 0) return !0; for (var W = 0; W < this.files.length; W++) I.push({ file: this.files[W], inputElem: this, instanceConfig: c.extend({}, C) }); }), j(), this; function j() { if (I.length !== 0) { var N, W, J, U, E = I[0]; if (O(M.before)) { var z = M.before(E.file, E.inputElem); if (typeof z == "object") { if (z.action === "abort") return N = "AbortError", W = E.file, J = E.inputElem, U = z.reason, void (O(M.error) && M.error({ name: N }, W, J, U)); if (z.action === "skip") return void P(); typeof z.config == "object" && (E.instanceConfig = c.extend(E.instanceConfig, z.config)); } else if (z === "skip") return void P(); } var F = E.instanceConfig.complete; E.instanceConfig.complete = function(q) { O(F) && F(q, E.file, E.inputElem), P(); }, s.parse(E.file, E.instanceConfig); } else O(M.complete) && M.complete(); } function P() { I.splice(0, 1), j(); } }; } function u(M) { this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(C) { var I = k(C); I.chunkSize = parseInt(I.chunkSize), C.step || C.chunk || (I.chunkSize = null), this._handle = new v(I), (this._handle.streamer = this)._config = I; }).call(this, M), this.parseChunk = function(C, I) { if (this.isFirstChunk && O(this._config.beforeFirstChunk)) { var j = this._config.beforeFirstChunk(C); j !== void 0 && (C = j); } this.isFirstChunk = !1, this._halted = !1; var P = this._partialLine + C; this._partialLine = ""; var N = this._handle.parse(P, this._baseIndex, !this._finished); if (!this._handle.paused() && !this._handle.aborted()) { var W = N.meta.cursor; this._finished || (this._partialLine = P.substring(W - this._baseIndex), this._baseIndex = W), N && N.data && (this._rowCount += N.data.length); var J = this._finished || this._config.preview && this._rowCount >= this._config.preview; if (i) r.postMessage({ results: N, workerId: s.WORKER_ID, finished: J }); else if (O(this._config.chunk) && !I) { if (this._config.chunk(N, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0); N = void 0, this._completeResults = void 0; } return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(N.data), this._completeResults.errors = this._completeResults.errors.concat(N.errors), this._completeResults.meta = N.meta), this._completed || !J || !O(this._config.complete) || N && N.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), J || N && N.meta.paused || this._nextChunk(), N; } this._halted = !0; }, this._sendError = function(C) { O(this._config.error) ? this._config.error(C) : i && this._config.error && r.postMessage({ workerId: s.WORKER_ID, error: C, finished: !1 }); }; } function f(M) { var C; (M = M || {}).chunkSize || (M.chunkSize = s.RemoteChunkSize), u.call(this, M), this._nextChunk = a ? function() { this._readChunk(), this._chunkLoaded(); } : function() { this._readChunk(); }, this.stream = function(I) { this._input = I, this._nextChunk(); }, this._readChunk = function() { if (this._finished) this._chunkLoaded(); else { if (C = new XMLHttpRequest(), this._config.withCredentials && (C.withCredentials = this._config.withCredentials), a || (C.onload = T(this._chunkLoaded, this), C.onerror = T(this._chunkError, this)), C.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !a), this._config.downloadRequestHeaders) { var I = this._config.downloadRequestHeaders; for (var j in I) C.setRequestHeader(j, I[j]); } if (this._config.chunkSize) { var P = this._start + this._config.chunkSize - 1; C.setRequestHeader("Range", "bytes=" + this._start + "-" + P); } try { C.send(this._config.downloadRequestBody); } catch (N) { this._chunkError(N.message); } a && C.status === 0 && this._chunkError(); } }, this._chunkLoaded = function() { C.readyState === 4 && (C.status < 200 || 400 <= C.status ? this._chunkError() : (this._start += this._config.chunkSize ? this._config.chunkSize : C.responseText.length, this._finished = !this._config.chunkSize || this._start >= function(I) { var j = I.getResponseHeader("Content-Range"); return j === null ? -1 : parseInt(j.substring(j.lastIndexOf("/") + 1)); }(C), this.parseChunk(C.responseText))); }, this._chunkError = function(I) { var j = C.statusText || I; this._sendError(new Error(j)); }; } function h(M) { var C, I; (M = M || {}).chunkSize || (M.chunkSize = s.LocalChunkSize), u.call(this, M); var j = typeof FileReader < "u"; this.stream = function(P) { this._input = P, I = P.slice || P.webkitSlice || P.mozSlice, j ? ((C = new FileReader()).onload = T(this._chunkLoaded, this), C.onerror = T(this._chunkError, this)) : C = new FileReaderSync(), this._nextChunk(); }, this._nextChunk = function() { this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk(); }, this._readChunk = function() { var P = this._input; if (this._config.chunkSize) { var N = Math.min(this._start + this._config.chunkSize, this._input.size); P = I.call(P, this._start, N); } var W = C.readAsText(P, this._config.encoding); j || this._chunkLoaded({ target: { result: W } }); }, this._chunkLoaded = function(P) { this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(P.target.result); }, this._chunkError = function() { this._sendError(C.error); }; } function g(M) { var C; u.call(this, M = M || {}), this.stream = function(I) { return C = I, this._nextChunk(); }, this._nextChunk = function() { if (!this._finished) { var I, j = this._config.chunkSize; return j ? (I = C.substring(0, j), C = C.substring(j)) : (I = C, C = ""), this._finished = !C, this.parseChunk(I); } }; } function p(M) { u.call(this, M = M || {}); var C = [], I = !0, j = !1; this.pause = function() { u.prototype.pause.apply(this, arguments), this._input.pause(); }, this.resume = function() { u.prototype.resume.apply(this, arguments), this._input.resume(); }, this.stream = function(P) { this._input = P, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError); }, this._checkIsFinished = function() { j && C.length === 1 && (this._finished = !0); }, this._nextChunk = function() { this._checkIsFinished(), C.length ? this.parseChunk(C.shift()) : I = !0; }, this._streamData = T(function(P) { try { C.push(typeof P == "string" ? P : P.toString(this._config.encoding)), I && (I = !1, this._checkIsFinished(), this.parseChunk(C.shift())); } catch (N) { this._streamError(N); } }, this), this._streamError = T(function(P) { this._streamCleanUp(), this._sendError(P); }, this), this._streamEnd = T(function() { this._streamCleanUp(), j = !0, this._streamData(""); }, this), this._streamCleanUp = T(function() { this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError); }, this); } function v(M) { var C, I, j, P = Math.pow(2, 53), N = -P, W = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, J = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, U = this, E = 0, z = 0, F = !1, q = !1, H = [], K = { data: [], errors: [], meta: {} }; if (O(M.step)) { var Q = M.step; M.step = function(G) { if (K = G, X()) te(); else { if (te(), K.data.length === 0) return; E += G.data.length, M.preview && E > M.preview ? I.abort() : (K.data = K.data[0], Q(K, U)); } }; } function re(G) { return M.skipEmptyLines === "greedy" ? G.join("").trim() === "" : G.length === 1 && G[0].length === 0; } function te() { return K && j && (B("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + s.DefaultDelimiter + "'"), j = !1), M.skipEmptyLines && (K.data = K.data.filter(function(G) { return !re(G); })), X() && function() { if (!K) return; function G(oe, ae) { O(M.transformHeader) && (oe = M.transformHeader(oe, ae)), H.push(oe); } if (Array.isArray(K.data[0])) { for (var Z = 0; X() && Z < K.data.length; Z++) K.data[Z].forEach(G); K.data.splice(0, 1); } else K.data.forEach(G); }(), function() { if (!K || !M.header && !M.dynamicTyping && !M.transform) return K; function G(oe, ae) { var ge, ve = M.header ? {} : []; for (ge = 0; ge < oe.length; ge++) { var pe = ge, ye = oe[ge]; M.header && (pe = ge >= H.length ? "__parsed_extra" : H[ge]), M.transform && (ye = M.transform(ye, pe)), ye = ce(pe, ye), pe === "__parsed_extra" ? (ve[pe] = ve[pe] || [], ve[pe].push(ye)) : ve[pe] = ye; } return M.header && (ge > H.length ? B("FieldMismatch", "TooManyFields", "Too many fields: expected " + H.length + " fields but parsed " + ge, z + ae) : ge < H.length && B("FieldMismatch", "TooFewFields", "Too few fields: expected " + H.length + " fields but parsed " + ge, z + ae)), ve; } var Z = 1; return !K.data.length || Array.isArray(K.data[0]) ? (K.data = K.data.map(G), Z = K.data.length) : K.data = G(K.data, 0), M.header && K.meta && (K.meta.fields = H), z += Z, K; }(); } function X() { return M.header && H.length === 0; } function ce(G, Z) { return oe = G, M.dynamicTypingFunction && M.dynamicTyping[oe] === void 0 && (M.dynamicTyping[oe] = M.dynamicTypingFunction(oe)), (M.dynamicTyping[oe] || M.dynamicTyping) === !0 ? Z === "true" || Z === "TRUE" || Z !== "false" && Z !== "FALSE" && (function(ae) { if (W.test(ae)) { var ge = parseFloat(ae); if (N < ge && ge < P) return !0; } return !1; }(Z) ? parseFloat(Z) : J.test(Z) ? new Date(Z) : Z === "" ? null : Z) : Z; var oe; } function B(G, Z, oe, ae) { var ge = { type: G, code: Z, message: oe }; ae !== void 0 && (ge.row = ae), K.errors.push(ge); } this.parse = function(G, Z, oe) { var ae = M.quoteChar || '"'; if (M.newline || (M.newline = function(pe, ye) { pe = pe.substring(0, 1048576); var Oe = new RegExp(y(ye) + "([^]*?)" + y(ye), "gm"), Be = (pe = pe.replace(Oe, "")).split("\r"), Ie = pe.split(` `), Fe = 1 < Ie.length && Ie[0].length < Be[0].length; if (Be.length === 1 || Fe) return ` `; for (var Re = 0, We = 0; We < Be.length; We++) Be[We][0] === ` ` && Re++; return Re >= Be.length / 2 ? `\r ` : "\r"; }(G, ae)), j = !1, M.delimiter) O(M.delimiter) && (M.delimiter = M.delimiter(G), K.meta.delimiter = M.delimiter); else { var ge = function(pe, ye, Oe, Be, Ie) { var Fe, Re, We, Ce; Ie = Ie || [",", " ", "|", ";", s.RECORD_SEP, s.UNIT_SEP]; for (var Ve = 0; Ve < Ie.length; Ve++) { var Ke = Ie[Ve], Xe = 0, ct = 0, vt = 0; We = void 0; for (var lt = new m({ comments: Be, delimiter: Ke, newline: ye, preview: 10 }).parse(pe), ut = 0; ut < lt.data.length; ut++) if (Oe && re(lt.data[ut])) vt++; else { var dt = lt.data[ut].length; ct += dt, We !== void 0 ? 0 < dt && (Xe += Math.abs(dt - We), We = dt) : We = dt; } 0 < lt.data.length && (ct /= lt.data.length - vt), (Re === void 0 || Xe <= Re) && (Ce === void 0 || Ce < ct) && 1.99 < ct && (Re = Xe, Fe = Ke, Ce = ct); } return { successful: !!(M.delimiter = Fe), bestDelimiter: Fe }; }(G, M.newline, M.skipEmptyLines, M.comments, M.delimitersToGuess); ge.successful ? M.delimiter = ge.bestDelimiter : (j = !0, M.delimiter = s.DefaultDelimiter), K.meta.delimiter = M.delimiter; } var ve = k(M); return M.preview && M.header && ve.preview++, C = G, I = new m(ve), K = I.parse(C, Z, oe), te(), F ? { meta: { paused: !0 } } : K || { meta: { paused: !1 } }; }, this.paused = function() { return F; }, this.pause = function() { F = !0, I.abort(), C = O(M.chunk) ? "" : C.substring(I.getCharIndex()); }, this.resume = function() { U.streamer._halted ? (F = !1, U.streamer.parseChunk(C, !0)) : setTimeout(U.resume, 3); }, this.aborted = function() { return q; }, this.abort = function() { q = !0, I.abort(), K.meta.aborted = !0, O(M.complete) && M.complete(K), C = ""; }; } function y(M) { return M.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function m(M) { var C, I = (M = M || {}).delimiter, j = M.newline, P = M.comments, N = M.step, W = M.preview, J = M.fastMode, U = C = M.quoteChar === void 0 || M.quoteChar === null ? '"' : M.quoteChar; if (M.escapeChar !== void 0 && (U = M.escapeChar), (typeof I != "string" || -1 < s.BAD_DELIMITERS.indexOf(I)) && (I = ","), P === I) throw new Error("Comment character same as delimiter"); P === !0 ? P = "#" : (typeof P != "string" || -1 < s.BAD_DELIMITERS.indexOf(P)) && (P = !1), j !== ` ` && j !== "\r" && j !== `\r ` && (j = ` `); var E = 0, z = !1; this.parse = function(F, q, H) { if (typeof F != "string") throw new Error("Input must be a string"); var K = F.length, Q = I.length, re = j.length, te = P.length, X = O(N), ce = [], B = [], G = [], Z = E = 0; if (!F) return Pe(); if (M.header && !q) { var oe = F.split(j)[0].split(I), ae = [], ge = {}, ve = !1; for (var pe in oe) { var ye = oe[pe]; O(M.transformHeader) && (ye = M.transformHeader(ye, pe)); var Oe = ye, Be = ge[ye] || 0; for (0 < Be && (ve = !0, Oe = ye + "_" + Be), ge[ye] = Be + 1; ae.includes(Oe); ) Oe = Oe + "_" + Be; ae.push(Oe); } if (ve) { var Ie = F.split(j); Ie[0] = ae.join(I), F = Ie.join(j); } } if (J || J !== !1 && F.indexOf(C) === -1) { for (var Fe = F.split(j), Re = 0; Re < Fe.length; Re++) { if (G = Fe[Re], E += G.length, Re !== Fe.length - 1) E += j.length; else if (H) return Pe(); if (!P || G.substring(0, te) !== P) { if (X) { if (ce = [], vt(G.split(I)), ze(), z) return Pe(); } else vt(G.split(I)); if (W && W <= Re) return ce = ce.slice(0, W), Pe(!0); } } return Pe(); } for (var We = F.indexOf(I, E), Ce = F.indexOf(j, E), Ve = new RegExp(y(U) + y(C), "g"), Ke = F.indexOf(C, E); ; ) if (F[E] !== C) if (P && G.length === 0 && F.substring(E, E + te) === P) { if (Ce === -1) return Pe(); E = Ce + re, Ce = F.indexOf(j, E), We = F.indexOf(I, E); } else if (We !== -1 && (We < Ce || Ce === -1)) G.push(F.substring(E, We)), E = We + Q, We = F.indexOf(I, E); else { if (Ce === -1) break; if (G.push(F.substring(E, Ce)), dt(Ce + re), X && (ze(), z)) return Pe(); if (W && ce.length >= W) return Pe(!0); } else for (Ke = E, E++; ; ) { if ((Ke = F.indexOf(C, Ke + 1)) === -1) return H || B.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: ce.length, index: E }), ut(); if (Ke === K - 1) return ut(F.substring(E, Ke).replace(Ve, C)); if (C !== U || F[Ke + 1] !== U) { if (C === U || Ke === 0 || F[Ke - 1] !== U) { We !== -1 && We < Ke + 1 && (We = F.indexOf(I, Ke + 1)), Ce !== -1 && Ce < Ke + 1 && (Ce = F.indexOf(j, Ke + 1)); var Xe = lt(Ce === -1 ? We : Math.min(We, Ce)); if (F.substr(Ke + 1 + Xe, Q) === I) { G.push(F.substring(E, Ke).replace(Ve, C)), F[E = Ke + 1 + Xe + Q] !== C && (Ke = F.indexOf(C, E)), We = F.indexOf(I, E), Ce = F.indexOf(j, E); break; } var ct = lt(Ce); if (F.substring(Ke + 1 + ct, Ke + 1 + ct + re) === j) { if (G.push(F.substring(E, Ke).replace(Ve, C)), dt(Ke + 1 + ct + re), We = F.indexOf(I, E), Ke = F.indexOf(C, E), X && (ze(), z)) return Pe(); if (W && ce.length >= W) return Pe(!0); break; } B.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: ce.length, index: E }), Ke++; } } else Ke++; } return ut(); function vt(Ne) { ce.push(Ne), Z = E; } function lt(Ne) { var nt = 0; if (Ne !== -1) { var Qe = F.substring(Ke + 1, Ne); Qe && Qe.trim() === "" && (nt = Qe.length); } return nt; } function ut(Ne) { return H || (Ne === void 0 && (Ne = F.substring(E)), G.push(Ne), E = K, vt(G), X && ze()), Pe(); } function dt(Ne) { E = Ne, vt(G), G = [], Ce = F.indexOf(j, E); } function Pe(Ne) { return { data: ce, errors: B, meta: { delimiter: I, linebreak: j, aborted: z, truncated: !!Ne, cursor: Z + (q || 0) } }; } function ze() { N(Pe()), ce = [], B = []; } }, this.abort = function() { z = !0; }, this.getCharIndex = function() { return E; }; } function b(M) { var C = M.data, I = o[C.workerId], j = !1; if (C.error) I.userError(C.error, C.file); else if (C.results && C.results.data) { var P = { abort: function() { j = !0, w(C.workerId, { data: [], errors: [], meta: { aborted: !0 } }); }, pause: _, resume: _ }; if (O(I.userStep)) { for (var N = 0; N < C.results.data.length && (I.userStep({ data: C.results.data[N], errors: C.results.errors, meta: C.results.meta }, P), !j); N++) ; delete C.results; } else O(I.userChunk) && (I.userChunk(C.results, P, C.file), delete C.results); } C.finished && !j && w(C.workerId, C.results); } function w(M, C) { var I = o[M]; O(I.userComplete) && I.userComplete(C), I.terminate(), delete o[M]; } function _() { throw new Error("Not implemented."); } function k(M) { if (typeof M != "object" || M === null) return M; var C = Array.isArray(M) ? [] : {}; for (var I in M) C[I] = k(M[I]); return C; } function T(M, C) { return function() { M.apply(C, arguments); }; } function O(M) { return typeof M == "function"; } return i && (r.onmessage = function(M) { var C = M.data; if (s.WORKER_ID === void 0 && C && (s.WORKER_ID = C.workerId), typeof C.input == "string") r.postMessage({ workerId: s.WORKER_ID, results: s.parse(C.input, C.config), finished: !0 }); else if (r.File && C.input instanceof File || C.input instanceof Object) { var I = s.parse(C.input, C.config); I && r.postMessage({ workerId: s.WORKER_ID, results: I, finished: !0 }); } }), (f.prototype = Object.create(u.prototype)).constructor = f, (h.prototype = Object.create(u.prototype)).constructor = h, (g.prototype = Object.create(g.prototype)).constructor = g, (p.prototype = Object.create(u.prototype)).constructor = p, s; }); })(OD); var Xce = OD.exports; const eue = /* @__PURE__ */ Ud(Xce), tue = (e, t) => eue.parse(e, { download: !0, complete: t }), n1 = { loadFile: tue }, DD = { components: { PlotControls: Gd }, props: { metadata: { type: Object, required: !0 }, sourceData: { type: Object, required: !0 }, plotLayout: { type: Object, required: !0 }, supplementalData: { type: Array, required: !0 }, version: { type: String, required: !0 }, selectorUi: { type: Boolean, default: !0 } }, data: function() { return { layout: { paper_bgcolor: "rgba(0,0,0,0)", plot_bgcolor: "rgba(0,0,0,0)", autosize: !0, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 } }, loading: !1, options: { responsive: !0, scrollZoom: !0 } }; }, computed: { title() { return this.sourceData.url.split("\\").pop().split("/").pop().split(".")[0]; } } }, nue = { name: "TimeseriesPlot", components: { PlotControls: Gd, ElSelect: Uc, ElButton: qd, ElOption: Gc }, mixins: [DD], data: function() { return { dataValues: fo([]), filterX: [], parsedData: null, time: fo([]), traceData: null, traceNames: [], xAxisLabel: "time" }; }, computed: { fullMetadata() { let e = JSON.parse(JSON.stringify(this.metadata)); return e["y-axes-columns"] || (e["y-axes-columns"] = []), e["x-axis-column"] || (e["x-axis-column"] = 0), e["no-header"] || (e["no-header"] = !1), e["row-major"] || (e["row-major"] = !1), e; } }, watch: { sourceData: function() { this.loadData(this.sourceData); } }, mounted: function() { this.loadData(this.sourceData); }, methods: { loadData(e) { e.url ? (this.loading = !0, n1.loadFile(e.url, this.dataReady)) : Rd.react(this.$refs.plotlyplot, this.sourceData.data, this.plotLayout ? this.plotLayout : this.layout, this.options); }, dataReady(e) { const t = Date.now(); this.fullMetadata["no-header"] && n1.loadFile(this.supplementalData[0].url, this.headerDataReady), this.loading = !1, this.parsedData = fo(e), this.findYaxesCols(), this.populateTime(), this.populateDataValues(), this.fullMetadata["no-header"] || (this.populateXaxisLabel(), this.populateTraceNames()), this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames), console.log(Date.now() - t); }, headerDataReady(e) { this.traceData = fo(e), this.populateXaxisLabel(), this.populateTraceNames(), this.loading || this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames); }, filterPlot() { let e = this.filterX; if (e.length === 0) { this.createPlot(this.time, this.xAxisLabel, this.dataValues, this.traceNames); return; } let t = []; for (let a of e) t.push(this.fullMetadata["y-axes-columns"][this.traceNames.indexOf(a)]); let n = this.parsedData.data; this.fullMetadata["no-header"] || (n = n.slice(1)); let r = []; for (let a of t) { const i = n.map((o) => o[a]); r.push(i); } this.createPlot(this.time, this.xAxisLabel, r, e); }, createPlot(e, t, n, r) { let a = []; for (let s = 0; s < n.length; s++) a.push({ type: "scatter", mode: "lines", name: r[s], x: e, y: n[s] }); let i = this.plotLayout ? this.plotLayout : this.layout, o = { title: { text: this.title }, xaxis: { title: { text: t } } }, l = { ...a1(i), ...o }; Rd.react(this.$refs.plotlyplot, a, l, this.options); }, findYaxesCols() { if (this.fullMetadata["y-axes-columns"].length === 0) { let e = Array(this.parsedData.data[0].length).keys(); e.shift(), e.shift(), this.fullMetadata["y-axes-columns"] = e; } }, populateXaxisLabel() { this.fullMetadata["no-header"] ? this.xAxisLabel = this.traceData.data[0][this.fullMetadata["x-axis-column"]] : this.xAxisLabel = this.parsedData.data[0][this.fullMetadata["x-axis-column"]]; }, populateTraceNames() { if (this.fullMetadata["no-header"]) { this.traceNames.splice(0, this.traceNames.length); for (let e of this.fullMetadata["y-axes-columns"]) this.traceNames.push(this.traceData.data[0][e]); this.$set(this.traceNames, 0, this.traceNames[0]); } else { this.traceNames = []; for (let e of this.fullMetadata["y-axes-columns"]) this.traceNames.push(this.parsedData.data[0][e]); } }, populateTime() { const e = this; let t = this.parsedData.data; this.fullMetadata["no-header"] || (t = t.slice(1)), this.time = fo(t.map(function(n) { return n[e.fullMetadata["x-axis-column"]]; })); }, populateDataValues() { let e = this.parsedData.data; this.fullMetadata["no-header"] || (e = e.slice(1)); let t = []; for (let n of this.fullMetadata["y-axes-columns"]) { const r = e.map((a) => a[n]); t.push(r); } this.dataValues = fo(t); } } }, rue = { ref: "plotContainer", class: "container" }, aue = { ref: "plotlyplot", class: "vue-plotly" }; function iue(e, t, n, r, a, i) { const o = Gc, l = Uc, s = qd, c = Gd; return Tt(), Kt("div", rue, [ fn("div", aue, null, 512), e.selectorUi ? (Tt(), Kt("div", { key: 0, class: Gt(["chooser-container", { inactive: e.loading }]) }, [ fn("span", null, [ Mn(l, { ref: "selectBox", modelValue: e.filterX, "onUpdate:modelValue": t[0] || (t[0] = (u) => e.filterX = u), class: "channel-select", size: "large", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", teleported: !1, placeholder: "select" }, { default: on(() => [ (Tt(!0), Kt(_o, null, bc(e.traceNames, (u) => (Tt(), An(o, { key: u, label: u, value: u }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), fn("span", null, [ Mn(s, { class: "view-heatmap-button", onClick: i.filterPlot }, { default: on(() => [ ts("Filter plot") ]), _: 1 }, 8, ["onClick"]) ]) ], 2)) : In("", !0), Mn(c, { ref: "controls", "parent-element": { element: e.$refs.plotContainer }, "controls-enabled": !e.loading }, null, 8, ["parent-element", "controls-enabled"]) ], 512); } const oue = /* @__PURE__ */ r0(nue, [["render", iue], ["__scopeId", "data-v-ab61b52c"]]), lue = { name: "HeatmapPlot", components: { PlotControls: Gd, ElSelect: Uc, ElOption: Gc, ElCollapse: mS, ElCollapseItem: yS, ElButton: qd, ElPopover: F1 }, mixins: [DD], data: function() { return { columnHeaders: [], rowHeaders: [], dataValues: fo([]), filterX: [], filterY: [], loading: !1, logScale: !1, logDataValues: fo([]) }; }, computed: { fullMetadata() { let e = JSON.parse(JSON.stringify(this.metadata)); return e.columnHeaderSize || (e.columnHeaderSize = 1), e.columnHeaderIndex || (e.columnHeaderIndex = 0), e.rowHeaderSize || (e.rowHeaderSize = 1), e.rowHeaderIndex || (e.rowHeaderIndex = 0), e; }, logScaleEnabled() { return !!JSON.parse(JSON.stringify(this.metadata)).logScale; }, plotTitle() { return this.logScale ? this.title + " (Log scale)" : this.title; } }, watch: { sourceData: function() { this.loadData(this.sourceData); } }, mounted: function() { this.loadData(this.sourceData); }, methods: { loadData(e) { e.url ? (this.loading = !0, n1.loadFile(e.url, this.dataReady)) : Rd.react(this.$refs.plotlyplot, this.sourceData.data, this.sourceData.layout ? this.sourceData.layout : this.layout, this.options); }, dataReady(e) { this.loading = !1; const t = e; this.populateColumnHeaders(t), this.populateRowHeaders(t), this.populateDataValues(t), this.logScaleEnabled ? (this.logValues(), this.logScale = !0, this.createPlot(this.columnHeaders, this.rowHeaders, this.logDataValues, "heatmap")) : this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap"); }, logValues() { this.dataValues.forEach((e, t) => { this.logDataValues.push([]), e.forEach((n) => { this.logDataValues[t].push(Math.log10(n)); }); }); }, logToggle() { this.logScale ? (this.logScale = !1, this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap")) : (this.logScale = !0, this.createPlot(this.columnHeaders, this.rowHeaders, this.logDataValues, "heatmap")); }, filterPlot() { let e = this.filterX, t = this.filterY; if (e.length === 0 && t.length === 0) { this.createPlot(this.columnHeaders, this.rowHeaders, this.dataValues, "heatmap"); return; } e.length === 0 && (e = this.columnHeaders), t.length === 0 && (t = this.rowHeaders); let n = []; for (let i of e) n.push(this.columnHeaders.indexOf(i)); let r = []; for (let i of t) r.push(this.rowHeaders.indexOf(i)); let a = []; for (let i of n) { const o = this.dataValues.map((s) => s[i]); let l = []; for (let s of r) l.push(o[s]); a.push(l); } a = a[0].map((i, o) => a.map((l) => l[o])), this.createPlot(e, t, a, "heatmap"); }, createPlot(e, t, n, r) { var a = [ { x: e, y: t, z: n, type: r } ]; const i = { title: { text: this.plotTitle } }; Rd.react(this.$refs.plotlyplot, a, { ...this.layout, ...i, ...this.plotLayout }, this.options); }, populateColumnHeaders(e) { let t = [...e.data[this.fullMetadata.columnHeaderIndex]]; this.columnHeaders = t.slice(this.fullMetadata.rowHeaderSize); }, populateRowHeaders(e) { const t = e.data.map((n) => n[this.fullMetadata.rowHeaderIndex]); this.rowHeaders = t.slice(this.fullMetadata.columnHeaderSize); }, populateDataValues(e) { const t = e.data.slice(this.fullMetadata.columnHeaderSize); this.dataValues = fo(t.map((n) => n.slice(this.fullMetadata.rowHeaderSize))); } } }, sue = { ref: "plotContainer", class: "container" }, cue = { ref: "plotlyplot", class: "vue-plotly" }, uue = { key: 0 }; function due(e, t, n, r, a, i) { const o = Gc, l = Uc, s = qd, c = Gd; return Tt(), Kt("div", sue, [ fn("div", cue, null, 512), e.selectorUi ? (Tt(), Kt("div", { key: 0, class: Gt(["chooser-container", { inactive: e.loading }]) }, [ fn("span", null, [ Mn(l, { modelValue: e.filterX, "onUpdate:modelValue": t[0] || (t[0] = (u) => e.filterX = u), class: "channel-select", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", placeholder: "select" }, { default: on(() => [ (Tt(!0), Kt(_o, null, bc(e.columnHeaders, (u) => (Tt(), An(o, { key: u, label: u, value: u }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), fn("span", null, [ Mn(l, { modelValue: e.filterY, "onUpdate:modelValue": t[1] || (t[1] = (u) => e.filterY = u), class: "channel-select", multiple: "", filterable: "", "collapse-tags": "", "default-first-option": "", placeholder: "select" }, { default: on(() => [ (Tt(!0), Kt(_o, null, bc(e.rowHeaders, (u) => (Tt(), An(o, { key: u, label: u, value: u }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), fn("span", null, [ Mn(s, { class: "view-heatmap-button", onClick: i.filterPlot }, { default: on(() => [ ts("Filter plot") ]), _: 1 }, 8, ["onClick"]) ]), i.logScaleEnabled ? (Tt(), Kt("span", uue, [ Mn(s, { class: "view-heatmap-button", onClick: i.logToggle }, { default: on(() => [ ts("Toggle log") ]), _: 1 }, 8, ["onClick"]) ])) : In("", !0) ], 2)) : In("", !0), Mn(c, { "parent-element": { element: e.$refs.plotContainer }, "controls-enabled": !e.loading }, null, 8, ["parent-element", "controls-enabled"]) ], 512); } const fue = /* @__PURE__ */ r0(lue, [["render", due], ["__scopeId", "data-v-e71fb8c3"]]), hue = ["1.2.0", "1.1.0"], pue = { name: "PlotVuer", components: { TimeseriesPlot: oue, HeatmapPlot: fue }, props: { /** * The object with `url` property * where the `url` is the source url to load the data. */ dataSource: { type: Object, required: !0, default: () => { } }, /** * The metadata object * with `version`, `type`, and `attrs` properties. */ metadata: { type: Object, required: !0, validator: function(e) { return hue.includes(e.version) && e.type === "plot"; } }, /** * The plotLayout for UI. */ plotLayout: { type: Object, /** * `{ * paper_bgcolor: 'rgba(0,0,0,0)', plot_bgcolor: 'rgba(0,0,0,0)', autosize: true, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 }, loading: false, options: { responsive: true, scrollZoom: true } * }` */ default: () => ({ paper_bgcolor: "rgba(0,0,0,0)", plot_bgcolor: "rgba(0,0,0,0)", autosize: !0, margin: { t: 25, l: 55, r: 55, b: 90, pad: 4 }, loading: !1, options: { responsive: !0, scrollZoom: !0 } }) }, /** * The supplemental data to load. */ supplementalData: { type: Array, default: () => [] }, /** * The option to choose helpMode. */ helpMode: { type: Boolean, default: !1 }, /** * The option to show the selector UI. */ selectorUi: { type: Boolean, default: !0 } }, computed: { plotType: function() { return this.metadata.attrs.style + "-plot"; }, layout: function() { return this.metadata ? this.metadata.attrs ? this.metadata.attrs.layout ? this.metadata.attrs.layout : this.plotLayout : this.plotLayout : this.plotLayout; } } }, gue = { class: "plotvuer_parent" }; function vue(e, t, n, r, a, i) { return Tt(), Kt("div", gue, [ i.plotType != "-plot" ? (Tt(), An(yo(i.plotType), { key: 0, sourceData: n.dataSource, plotLayout: i.layout, version: n.metadata.version, metadata: n.metadata.attrs, selectorUi: n.selectorUi, supplementalData: n.supplementalData }, null, 8, ["sourceData", "plotLayout", "version", "metadata", "selectorUi", "supplementalData"])) : In("", !0) ]); } const yue = /* @__PURE__ */ r0(pue, [["render", vue], ["__scopeId", "data-v-72189ced"]]); export { yue as y };