var Wn = { exports: {} };
(function(qt, wn) {
  (function(Te, O) {
    qt.exports = O(function() {
      try {
        return require("@jupyter-widgets/base");
      } catch {
      }
    }());
  })(window, function(tn) {
    return (
      /******/
      function(Te) {
        var O = {};
        function d(a) {
          if (O[a])
            return O[a].exports;
          var X = O[a] = {
            /******/
            i: a,
            /******/
            l: !1,
            /******/
            exports: {}
            /******/
          };
          return Te[a].call(X.exports, X, X.exports, d), X.l = !0, X.exports;
        }
        return d.m = Te, d.c = O, d.d = function(a, X, q) {
          d.o(a, X) || Object.defineProperty(a, X, { enumerable: !0, get: q });
        }, d.r = function(a) {
          typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(a, "__esModule", { value: !0 });
        }, d.t = function(a, X) {
          if (X & 1 && (a = d(a)), X & 8 || X & 4 && typeof a == "object" && a && a.__esModule)
            return a;
          var q = /* @__PURE__ */ Object.create(null);
          if (d.r(q), Object.defineProperty(q, "default", { enumerable: !0, value: a }), X & 2 && typeof a != "string")
            for (var ee in a)
              d.d(q, ee, (function(j) {
                return a[j];
              }).bind(null, ee));
          return q;
        }, d.n = function(a) {
          var X = a && a.__esModule ? (
            /******/
            function() {
              return a.default;
            }
          ) : (
            /******/
            function() {
              return a;
            }
          );
          return d.d(X, "a", X), X;
        }, d.o = function(a, X) {
          return Object.prototype.hasOwnProperty.call(a, X);
        }, d.p = "", d(d.s = 38);
      }([
        /* 0 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = "http://www.w3.org/1999/xhtml", X = {
            svg: "http://www.w3.org/2000/svg",
            xhtml: a,
            xlink: "http://www.w3.org/1999/xlink",
            xml: "http://www.w3.org/XML/1998/namespace",
            xmlns: "http://www.w3.org/2000/xmlns/"
          }, q = function(S) {
            var ve = S += "", Ie = ve.indexOf(":");
            return Ie >= 0 && (ve = S.slice(0, Ie)) !== "xmlns" && (S = S.slice(Ie + 1)), X.hasOwnProperty(ve) ? { space: X[ve], local: S } : S;
          };
          function ee(S) {
            return function() {
              var ve = this.ownerDocument, Ie = this.namespaceURI;
              return Ie === a && ve.documentElement.namespaceURI === a ? ve.createElement(S) : ve.createElementNS(Ie, S);
            };
          }
          function j(S) {
            return function() {
              return this.ownerDocument.createElementNS(S.space, S.local);
            };
          }
          var t = function(S) {
            var ve = q(S);
            return (ve.local ? j : ee)(ve);
          };
          function F() {
          }
          var M = function(S) {
            return S == null ? F : function() {
              return this.querySelector(S);
            };
          }, h = function(S) {
            typeof S != "function" && (S = M(S));
            for (var ve = this._groups, Ie = ve.length, Qe = new Array(Ie), Fe = 0; Fe < Ie; ++Fe)
              for (var Ge = ve[Fe], He = Ge.length, Re = Qe[Fe] = new Array(He), Xe, at, dt = 0; dt < He; ++dt)
                (Xe = Ge[dt]) && (at = S.call(Xe, Xe.__data__, dt, Ge)) && ("__data__" in Xe && (at.__data__ = Xe.__data__), Re[dt] = at);
            return new $e(Qe, this._parents);
          };
          function x() {
            return [];
          }
          var m = function(S) {
            return S == null ? x : function() {
              return this.querySelectorAll(S);
            };
          }, D = function(S) {
            typeof S != "function" && (S = m(S));
            for (var ve = this._groups, Ie = ve.length, Qe = [], Fe = [], Ge = 0; Ge < Ie; ++Ge)
              for (var He = ve[Ge], Re = He.length, Xe, at = 0; at < Re; ++at)
                (Xe = He[at]) && (Qe.push(S.call(Xe, Xe.__data__, at, He)), Fe.push(Xe));
            return new $e(Qe, Fe);
          }, H = function(S) {
            return function() {
              return this.matches(S);
            };
          }, B = function(S) {
            typeof S != "function" && (S = H(S));
            for (var ve = this._groups, Ie = ve.length, Qe = new Array(Ie), Fe = 0; Fe < Ie; ++Fe)
              for (var Ge = ve[Fe], He = Ge.length, Re = Qe[Fe] = [], Xe, at = 0; at < He; ++at)
                (Xe = Ge[at]) && S.call(Xe, Xe.__data__, at, Ge) && Re.push(Xe);
            return new $e(Qe, this._parents);
          }, k = function(S) {
            return new Array(S.length);
          }, _ = function() {
            return new $e(this._enter || this._groups.map(k), this._parents);
          };
          function Q(S, ve) {
            this.ownerDocument = S.ownerDocument, this.namespaceURI = S.namespaceURI, this._next = null, this._parent = S, this.__data__ = ve;
          }
          Q.prototype = {
            constructor: Q,
            appendChild: function(S) {
              return this._parent.insertBefore(S, this._next);
            },
            insertBefore: function(S, ve) {
              return this._parent.insertBefore(S, ve);
            },
            querySelector: function(S) {
              return this._parent.querySelector(S);
            },
            querySelectorAll: function(S) {
              return this._parent.querySelectorAll(S);
            }
          };
          var o = function(S) {
            return function() {
              return S;
            };
          }, W = "$";
          function y(S, ve, Ie, Qe, Fe, Ge) {
            for (var He = 0, Re, Xe = ve.length, at = Ge.length; He < at; ++He)
              (Re = ve[He]) ? (Re.__data__ = Ge[He], Qe[He] = Re) : Ie[He] = new Q(S, Ge[He]);
            for (; He < Xe; ++He)
              (Re = ve[He]) && (Fe[He] = Re);
          }
          function v(S, ve, Ie, Qe, Fe, Ge, He) {
            var Re, Xe, at = {}, dt = ve.length, Tt = Ge.length, Gt = new Array(dt), Dt;
            for (Re = 0; Re < dt; ++Re)
              (Xe = ve[Re]) && (Gt[Re] = Dt = W + He.call(Xe, Xe.__data__, Re, ve), Dt in at ? Fe[Re] = Xe : at[Dt] = Xe);
            for (Re = 0; Re < Tt; ++Re)
              Dt = W + He.call(S, Ge[Re], Re, Ge), (Xe = at[Dt]) ? (Qe[Re] = Xe, Xe.__data__ = Ge[Re], at[Dt] = null) : Ie[Re] = new Q(S, Ge[Re]);
            for (Re = 0; Re < dt; ++Re)
              (Xe = ve[Re]) && at[Gt[Re]] === Xe && (Fe[Re] = Xe);
          }
          var T = function(S, ve) {
            if (!S)
              return Dt = new Array(this.size()), at = -1, this.each(function(Mn) {
                Dt[++at] = Mn;
              }), Dt;
            var Ie = ve ? v : y, Qe = this._parents, Fe = this._groups;
            typeof S != "function" && (S = o(S));
            for (var Ge = Fe.length, He = new Array(Ge), Re = new Array(Ge), Xe = new Array(Ge), at = 0; at < Ge; ++at) {
              var dt = Qe[at], Tt = Fe[at], Gt = Tt.length, Dt = S.call(dt, dt && dt.__data__, at, Qe), ln = Dt.length, fn = Re[at] = new Array(ln), gn = He[at] = new Array(ln), _n = Xe[at] = new Array(Gt);
              Ie(dt, Tt, fn, gn, _n, Dt, ve);
              for (var an = 0, un = 0, vn, mn; an < ln; ++an)
                if (vn = fn[an]) {
                  for (an >= un && (un = an + 1); !(mn = gn[un]) && ++un < ln; )
                    ;
                  vn._next = mn || null;
                }
            }
            return He = new $e(He, Qe), He._enter = Re, He._exit = Xe, He;
          }, n = function() {
            return new $e(this._exit || this._groups.map(k), this._parents);
          }, r = function(S, ve, Ie) {
            var Qe = this.enter(), Fe = this, Ge = this.exit();
            return Qe = typeof S == "function" ? S(Qe) : Qe.append(S + ""), ve != null && (Fe = ve(Fe)), Ie == null ? Ge.remove() : Ie(Ge), Qe && Fe ? Qe.merge(Fe).order() : Fe;
          }, b = function(S) {
            for (var ve = this._groups, Ie = S._groups, Qe = ve.length, Fe = Ie.length, Ge = Math.min(Qe, Fe), He = new Array(Qe), Re = 0; Re < Ge; ++Re)
              for (var Xe = ve[Re], at = Ie[Re], dt = Xe.length, Tt = He[Re] = new Array(dt), Gt, Dt = 0; Dt < dt; ++Dt)
                (Gt = Xe[Dt] || at[Dt]) && (Tt[Dt] = Gt);
            for (; Re < Qe; ++Re)
              He[Re] = ve[Re];
            return new $e(He, this._parents);
          }, C = function() {
            for (var S = this._groups, ve = -1, Ie = S.length; ++ve < Ie; )
              for (var Qe = S[ve], Fe = Qe.length - 1, Ge = Qe[Fe], He; --Fe >= 0; )
                (He = Qe[Fe]) && (Ge && He.compareDocumentPosition(Ge) ^ 4 && Ge.parentNode.insertBefore(He, Ge), Ge = He);
            return this;
          }, ne = function(S) {
            S || (S = ge);
            function ve(Tt, Gt) {
              return Tt && Gt ? S(Tt.__data__, Gt.__data__) : !Tt - !Gt;
            }
            for (var Ie = this._groups, Qe = Ie.length, Fe = new Array(Qe), Ge = 0; Ge < Qe; ++Ge) {
              for (var He = Ie[Ge], Re = He.length, Xe = Fe[Ge] = new Array(Re), at, dt = 0; dt < Re; ++dt)
                (at = He[dt]) && (Xe[dt] = at);
              Xe.sort(ve);
            }
            return new $e(Fe, this._parents).order();
          };
          function ge(S, ve) {
            return S < ve ? -1 : S > ve ? 1 : S >= ve ? 0 : NaN;
          }
          var ce = function() {
            var S = arguments[0];
            return arguments[0] = this, S.apply(null, arguments), this;
          }, xe = function() {
            var S = new Array(this.size()), ve = -1;
            return this.each(function() {
              S[++ve] = this;
            }), S;
          }, fe = function() {
            for (var S = this._groups, ve = 0, Ie = S.length; ve < Ie; ++ve)
              for (var Qe = S[ve], Fe = 0, Ge = Qe.length; Fe < Ge; ++Fe) {
                var He = Qe[Fe];
                if (He)
                  return He;
              }
            return null;
          }, Ce = function() {
            var S = 0;
            return this.each(function() {
              ++S;
            }), S;
          }, he = function() {
            return !this.node();
          }, le = function(S) {
            for (var ve = this._groups, Ie = 0, Qe = ve.length; Ie < Qe; ++Ie)
              for (var Fe = ve[Ie], Ge = 0, He = Fe.length, Re; Ge < He; ++Ge)
                (Re = Fe[Ge]) && S.call(Re, Re.__data__, Ge, Fe);
            return this;
          };
          function G(S) {
            return function() {
              this.removeAttribute(S);
            };
          }
          function P(S) {
            return function() {
              this.removeAttributeNS(S.space, S.local);
            };
          }
          function $(S, ve) {
            return function() {
              this.setAttribute(S, ve);
            };
          }
          function E(S, ve) {
            return function() {
              this.setAttributeNS(S.space, S.local, ve);
            };
          }
          function V(S, ve) {
            return function() {
              var Ie = ve.apply(this, arguments);
              Ie == null ? this.removeAttribute(S) : this.setAttribute(S, Ie);
            };
          }
          function ie(S, ve) {
            return function() {
              var Ie = ve.apply(this, arguments);
              Ie == null ? this.removeAttributeNS(S.space, S.local) : this.setAttributeNS(S.space, S.local, Ie);
            };
          }
          var ae = function(S, ve) {
            var Ie = q(S);
            if (arguments.length < 2) {
              var Qe = this.node();
              return Ie.local ? Qe.getAttributeNS(Ie.space, Ie.local) : Qe.getAttribute(Ie);
            }
            return this.each((ve == null ? Ie.local ? P : G : typeof ve == "function" ? Ie.local ? ie : V : Ie.local ? E : $)(Ie, ve));
          }, K = function(S) {
            return S.ownerDocument && S.ownerDocument.defaultView || S.document && S || S.defaultView;
          };
          function s(S) {
            return function() {
              this.style.removeProperty(S);
            };
          }
          function g(S, ve, Ie) {
            return function() {
              this.style.setProperty(S, ve, Ie);
            };
          }
          function U(S, ve, Ie) {
            return function() {
              var Qe = ve.apply(this, arguments);
              Qe == null ? this.style.removeProperty(S) : this.style.setProperty(S, Qe, Ie);
            };
          }
          var Y = function(S, ve, Ie) {
            return arguments.length > 1 ? this.each((ve == null ? s : typeof ve == "function" ? U : g)(S, ve, Ie ?? "")) : p(this.node(), S);
          };
          function p(S, ve) {
            return S.style.getPropertyValue(ve) || K(S).getComputedStyle(S, null).getPropertyValue(ve);
          }
          function w(S) {
            return function() {
              delete this[S];
            };
          }
          function u(S, ve) {
            return function() {
              this[S] = ve;
            };
          }
          function Z(S, ve) {
            return function() {
              var Ie = ve.apply(this, arguments);
              Ie == null ? delete this[S] : this[S] = Ie;
            };
          }
          var re = function(S, ve) {
            return arguments.length > 1 ? this.each((ve == null ? w : typeof ve == "function" ? Z : u)(S, ve)) : this.node()[S];
          };
          function de(S) {
            return S.trim().split(/^|\s+/);
          }
          function be(S) {
            return S.classList || new i(S);
          }
          function i(S) {
            this._node = S, this._names = de(S.getAttribute("class") || "");
          }
          i.prototype = {
            add: function(S) {
              var ve = this._names.indexOf(S);
              ve < 0 && (this._names.push(S), this._node.setAttribute("class", this._names.join(" ")));
            },
            remove: function(S) {
              var ve = this._names.indexOf(S);
              ve >= 0 && (this._names.splice(ve, 1), this._node.setAttribute("class", this._names.join(" ")));
            },
            contains: function(S) {
              return this._names.indexOf(S) >= 0;
            }
          };
          function f(S, ve) {
            for (var Ie = be(S), Qe = -1, Fe = ve.length; ++Qe < Fe; )
              Ie.add(ve[Qe]);
          }
          function R(S, ve) {
            for (var Ie = be(S), Qe = -1, Fe = ve.length; ++Qe < Fe; )
              Ie.remove(ve[Qe]);
          }
          function z(S) {
            return function() {
              f(this, S);
            };
          }
          function se(S) {
            return function() {
              R(this, S);
            };
          }
          function ue(S, ve) {
            return function() {
              (ve.apply(this, arguments) ? f : R)(this, S);
            };
          }
          var ye = function(S, ve) {
            var Ie = de(S + "");
            if (arguments.length < 2) {
              for (var Qe = be(this.node()), Fe = -1, Ge = Ie.length; ++Fe < Ge; )
                if (!Qe.contains(Ie[Fe]))
                  return !1;
              return !0;
            }
            return this.each((typeof ve == "function" ? ue : ve ? z : se)(Ie, ve));
          };
          function N() {
            this.textContent = "";
          }
          function c(S) {
            return function() {
              this.textContent = S;
            };
          }
          function J(S) {
            return function() {
              var ve = S.apply(this, arguments);
              this.textContent = ve ?? "";
            };
          }
          var oe = function(S) {
            return arguments.length ? this.each(S == null ? N : (typeof S == "function" ? J : c)(S)) : this.node().textContent;
          };
          function Be() {
            this.innerHTML = "";
          }
          function Ye(S) {
            return function() {
              this.innerHTML = S;
            };
          }
          function We(S) {
            return function() {
              var ve = S.apply(this, arguments);
              this.innerHTML = ve ?? "";
            };
          }
          var Ke = function(S) {
            return arguments.length ? this.each(S == null ? Be : (typeof S == "function" ? We : Ye)(S)) : this.node().innerHTML;
          };
          function et() {
            this.nextSibling && this.parentNode.appendChild(this);
          }
          var nt = function() {
            return this.each(et);
          };
          function pt() {
            this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
          }
          var Et = function() {
            return this.each(pt);
          }, gt = function(S) {
            var ve = typeof S == "function" ? S : t(S);
            return this.select(function() {
              return this.appendChild(ve.apply(this, arguments));
            });
          };
          function bt() {
            return null;
          }
          var Bt = function(S, ve) {
            var Ie = typeof S == "function" ? S : t(S), Qe = ve == null ? bt : typeof ve == "function" ? ve : M(ve);
            return this.select(function() {
              return this.insertBefore(Ie.apply(this, arguments), Qe.apply(this, arguments) || null);
            });
          };
          function St() {
            var S = this.parentNode;
            S && S.removeChild(this);
          }
          var Nt = function() {
            return this.each(St);
          };
          function Wt() {
            return this.parentNode.insertBefore(this.cloneNode(!1), this.nextSibling);
          }
          function Kt() {
            return this.parentNode.insertBefore(this.cloneNode(!0), this.nextSibling);
          }
          var Ot = function(S) {
            return this.select(S ? Kt : Wt);
          }, It = function(S) {
            return arguments.length ? this.property("__data__", S) : this.node().__data__;
          }, e = {}, A = null;
          if (typeof document < "u") {
            var L = document.documentElement;
            "onmouseenter" in L || (e = { mouseenter: "mouseover", mouseleave: "mouseout" });
          }
          function te(S, ve, Ie) {
            return S = we(S, ve, Ie), function(Qe) {
              var Fe = Qe.relatedTarget;
              (!Fe || Fe !== this && !(Fe.compareDocumentPosition(this) & 8)) && S.call(this, Qe);
            };
          }
          function we(S, ve, Ie) {
            return function(Qe) {
              var Fe = A;
              A = Qe;
              try {
                S.call(this, this.__data__, ve, Ie);
              } finally {
                A = Fe;
              }
            };
          }
          function Ne(S) {
            return S.trim().split(/^|\s+/).map(function(ve) {
              var Ie = "", Qe = ve.indexOf(".");
              return Qe >= 0 && (Ie = ve.slice(Qe + 1), ve = ve.slice(0, Qe)), { type: ve, name: Ie };
            });
          }
          function ze(S) {
            return function() {
              var ve = this.__on;
              if (ve) {
                for (var Ie = 0, Qe = -1, Fe = ve.length, Ge; Ie < Fe; ++Ie)
                  Ge = ve[Ie], (!S.type || Ge.type === S.type) && Ge.name === S.name ? this.removeEventListener(Ge.type, Ge.listener, Ge.capture) : ve[++Qe] = Ge;
                ++Qe ? ve.length = Qe : delete this.__on;
              }
            };
          }
          function Ve(S, ve, Ie) {
            var Qe = e.hasOwnProperty(S.type) ? te : we;
            return function(Fe, Ge, He) {
              var Re = this.__on, Xe, at = Qe(ve, Ge, He);
              if (Re) {
                for (var dt = 0, Tt = Re.length; dt < Tt; ++dt)
                  if ((Xe = Re[dt]).type === S.type && Xe.name === S.name) {
                    this.removeEventListener(Xe.type, Xe.listener, Xe.capture), this.addEventListener(Xe.type, Xe.listener = at, Xe.capture = Ie), Xe.value = ve;
                    return;
                  }
              }
              this.addEventListener(S.type, at, Ie), Xe = { type: S.type, name: S.name, value: ve, listener: at, capture: Ie }, Re ? Re.push(Xe) : this.__on = [Xe];
            };
          }
          var Ze = function(S, ve, Ie) {
            var Qe = Ne(S + ""), Fe, Ge = Qe.length, He;
            if (arguments.length < 2) {
              var Re = this.node().__on;
              if (Re) {
                for (var Xe = 0, at = Re.length, dt; Xe < at; ++Xe)
                  for (Fe = 0, dt = Re[Xe]; Fe < Ge; ++Fe)
                    if ((He = Qe[Fe]).type === dt.type && He.name === dt.name)
                      return dt.value;
              }
              return;
            }
            for (Re = ve ? Ve : ze, Ie == null && (Ie = !1), Fe = 0; Fe < Ge; ++Fe)
              this.each(Re(Qe[Fe], ve, Ie));
            return this;
          };
          function Je(S, ve, Ie, Qe) {
            var Fe = A;
            S.sourceEvent = A, A = S;
            try {
              return ve.apply(Ie, Qe);
            } finally {
              A = Fe;
            }
          }
          function st(S, ve, Ie) {
            var Qe = K(S), Fe = Qe.CustomEvent;
            typeof Fe == "function" ? Fe = new Fe(ve, Ie) : (Fe = Qe.document.createEvent("Event"), Ie ? (Fe.initEvent(ve, Ie.bubbles, Ie.cancelable), Fe.detail = Ie.detail) : Fe.initEvent(ve, !1, !1)), S.dispatchEvent(Fe);
          }
          function ot(S, ve) {
            return function() {
              return st(this, S, ve);
            };
          }
          function ut(S, ve) {
            return function() {
              return st(this, S, ve.apply(this, arguments));
            };
          }
          var mt = function(S, ve) {
            return this.each((typeof ve == "function" ? ut : ot)(S, ve));
          }, qe = [null];
          function $e(S, ve) {
            this._groups = S, this._parents = ve;
          }
          function vt() {
            return new $e([[document.documentElement]], qe);
          }
          $e.prototype = vt.prototype = {
            constructor: $e,
            select: h,
            selectAll: D,
            filter: B,
            data: T,
            enter: _,
            exit: n,
            join: r,
            merge: b,
            order: C,
            sort: ne,
            call: ce,
            nodes: xe,
            node: fe,
            size: Ce,
            empty: he,
            each: le,
            attr: ae,
            style: Y,
            property: re,
            classed: ye,
            text: oe,
            html: Ke,
            raise: nt,
            lower: Et,
            append: gt,
            insert: Bt,
            remove: Nt,
            clone: Ot,
            datum: It,
            on: Ze,
            dispatch: mt
          };
          var wt = vt, rt = function(S) {
            return typeof S == "string" ? new $e([[document.querySelector(S)]], [document.documentElement]) : new $e([[S]], qe);
          }, lt = function(S) {
            return rt(t(S).call(document.documentElement));
          }, ct = 0;
          function _t() {
            return new xt();
          }
          function xt() {
            this._ = "@" + (++ct).toString(36);
          }
          xt.prototype = _t.prototype = {
            constructor: xt,
            get: function(S) {
              for (var ve = this._; !(ve in S); )
                if (!(S = S.parentNode))
                  return;
              return S[ve];
            },
            set: function(S, ve) {
              return S[this._] = ve;
            },
            remove: function(S) {
              return this._ in S && delete S[this._];
            },
            toString: function() {
              return this._;
            }
          };
          var Ae = function() {
            for (var S = A, ve; ve = S.sourceEvent; )
              S = ve;
            return S;
          }, me = function(S, ve) {
            var Ie = S.ownerSVGElement || S;
            if (Ie.createSVGPoint) {
              var Qe = Ie.createSVGPoint();
              return Qe.x = ve.clientX, Qe.y = ve.clientY, Qe = Qe.matrixTransform(S.getScreenCTM().inverse()), [Qe.x, Qe.y];
            }
            var Fe = S.getBoundingClientRect();
            return [ve.clientX - Fe.left - S.clientLeft, ve.clientY - Fe.top - S.clientTop];
          }, _e = function(S) {
            var ve = Ae();
            return ve.changedTouches && (ve = ve.changedTouches[0]), me(S, ve);
          }, Ee = function(S) {
            return typeof S == "string" ? new $e([document.querySelectorAll(S)], [document.documentElement]) : new $e([S ?? []], qe);
          }, Oe = function(S, ve, Ie) {
            arguments.length < 3 && (Ie = ve, ve = Ae().changedTouches);
            for (var Qe = 0, Fe = ve ? ve.length : 0, Ge; Qe < Fe; ++Qe)
              if ((Ge = ve[Qe]).identifier === Ie)
                return me(S, Ge);
            return null;
          }, ke = function(S, ve) {
            ve == null && (ve = Ae().touches);
            for (var Ie = 0, Qe = ve ? ve.length : 0, Fe = new Array(Qe); Ie < Qe; ++Ie)
              Fe[Ie] = me(S, ve[Ie]);
            return Fe;
          };
          d.d(O, "create", function() {
            return lt;
          }), d.d(O, "creator", function() {
            return t;
          }), d.d(O, "local", function() {
            return _t;
          }), d.d(O, "matcher", function() {
            return H;
          }), d.d(O, "mouse", function() {
            return _e;
          }), d.d(O, "namespace", function() {
            return q;
          }), d.d(O, "namespaces", function() {
            return X;
          }), d.d(O, "clientPoint", function() {
            return me;
          }), d.d(O, "select", function() {
            return rt;
          }), d.d(O, "selectAll", function() {
            return Ee;
          }), d.d(O, "selection", function() {
            return wt;
          }), d.d(O, "selector", function() {
            return M;
          }), d.d(O, "selectorAll", function() {
            return m;
          }), d.d(O, "style", function() {
            return p;
          }), d.d(O, "touch", function() {
            return Oe;
          }), d.d(O, "touches", function() {
            return ke;
          }), d.d(O, "window", function() {
            return K;
          }), d.d(O, "event", function() {
            return A;
          }), d.d(O, "customEvent", function() {
            return Je;
          });
        },
        /* 1 */
        /***/
        function(Te, O, d) {
          var a = function(c, J, oe) {
            c.prototype = J.prototype = oe, oe.constructor = c;
          };
          function X(c, J) {
            var oe = Object.create(c.prototype);
            for (var Be in J)
              oe[Be] = J[Be];
            return oe;
          }
          function q() {
          }
          var ee = 0.7, j = 1 / ee, t = "\\s*([+-]?\\d+)\\s*", F = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", M = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", h = /^#([0-9a-f]{3})$/, x = /^#([0-9a-f]{6})$/, m = new RegExp("^rgb\\(" + [t, t, t] + "\\)$"), D = new RegExp("^rgb\\(" + [M, M, M] + "\\)$"), H = new RegExp("^rgba\\(" + [t, t, t, F] + "\\)$"), B = new RegExp("^rgba\\(" + [M, M, M, F] + "\\)$"), k = new RegExp("^hsl\\(" + [F, M, M] + "\\)$"), _ = new RegExp("^hsla\\(" + [F, M, M, F] + "\\)$"), Q = {
            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
          };
          a(q, o, {
            displayable: function() {
              return this.rgb().displayable();
            },
            hex: function() {
              return this.rgb().hex();
            },
            toString: function() {
              return this.rgb() + "";
            }
          });
          function o(c) {
            var J;
            return c = (c + "").trim().toLowerCase(), (J = h.exec(c)) ? (J = parseInt(J[1], 16), new n(J >> 8 & 15 | J >> 4 & 240, J >> 4 & 15 | J & 240, (J & 15) << 4 | J & 15, 1)) : (J = x.exec(c)) ? W(parseInt(J[1], 16)) : (J = m.exec(c)) ? new n(J[1], J[2], J[3], 1) : (J = D.exec(c)) ? new n(J[1] * 255 / 100, J[2] * 255 / 100, J[3] * 255 / 100, 1) : (J = H.exec(c)) ? y(J[1], J[2], J[3], J[4]) : (J = B.exec(c)) ? y(J[1] * 255 / 100, J[2] * 255 / 100, J[3] * 255 / 100, J[4]) : (J = k.exec(c)) ? b(J[1], J[2] / 100, J[3] / 100, 1) : (J = _.exec(c)) ? b(J[1], J[2] / 100, J[3] / 100, J[4]) : Q.hasOwnProperty(c) ? W(Q[c]) : c === "transparent" ? new n(NaN, NaN, NaN, 0) : null;
          }
          function W(c) {
            return new n(c >> 16 & 255, c >> 8 & 255, c & 255, 1);
          }
          function y(c, J, oe, Be) {
            return Be <= 0 && (c = J = oe = NaN), new n(c, J, oe, Be);
          }
          function v(c) {
            return c instanceof q || (c = o(c)), c ? (c = c.rgb(), new n(c.r, c.g, c.b, c.opacity)) : new n();
          }
          function T(c, J, oe, Be) {
            return arguments.length === 1 ? v(c) : new n(c, J, oe, Be ?? 1);
          }
          function n(c, J, oe, Be) {
            this.r = +c, this.g = +J, this.b = +oe, this.opacity = +Be;
          }
          a(n, T, X(q, {
            brighter: function(c) {
              return c = c == null ? j : Math.pow(j, c), new n(this.r * c, this.g * c, this.b * c, this.opacity);
            },
            darker: function(c) {
              return c = c == null ? ee : Math.pow(ee, c), new n(this.r * c, this.g * c, this.b * c, this.opacity);
            },
            rgb: function() {
              return this;
            },
            displayable: function() {
              return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
            },
            hex: function() {
              return "#" + r(this.r) + r(this.g) + r(this.b);
            },
            toString: function() {
              var c = this.opacity;
              return c = isNaN(c) ? 1 : Math.max(0, Math.min(1, c)), (c === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (c === 1 ? ")" : ", " + c + ")");
            }
          }));
          function r(c) {
            return c = Math.max(0, Math.min(255, Math.round(c) || 0)), (c < 16 ? "0" : "") + c.toString(16);
          }
          function b(c, J, oe, Be) {
            return Be <= 0 ? c = J = oe = NaN : oe <= 0 || oe >= 1 ? c = J = NaN : J <= 0 && (c = NaN), new ge(c, J, oe, Be);
          }
          function C(c) {
            if (c instanceof ge)
              return new ge(c.h, c.s, c.l, c.opacity);
            if (c instanceof q || (c = o(c)), !c)
              return new ge();
            if (c instanceof ge)
              return c;
            c = c.rgb();
            var J = c.r / 255, oe = c.g / 255, Be = c.b / 255, Ye = Math.min(J, oe, Be), We = Math.max(J, oe, Be), Ke = NaN, et = We - Ye, nt = (We + Ye) / 2;
            return et ? (J === We ? Ke = (oe - Be) / et + (oe < Be) * 6 : oe === We ? Ke = (Be - J) / et + 2 : Ke = (J - oe) / et + 4, et /= nt < 0.5 ? We + Ye : 2 - We - Ye, Ke *= 60) : et = nt > 0 && nt < 1 ? 0 : Ke, new ge(Ke, et, nt, c.opacity);
          }
          function ne(c, J, oe, Be) {
            return arguments.length === 1 ? C(c) : new ge(c, J, oe, Be ?? 1);
          }
          function ge(c, J, oe, Be) {
            this.h = +c, this.s = +J, this.l = +oe, this.opacity = +Be;
          }
          a(ge, ne, X(q, {
            brighter: function(c) {
              return c = c == null ? j : Math.pow(j, c), new ge(this.h, this.s, this.l * c, this.opacity);
            },
            darker: function(c) {
              return c = c == null ? ee : Math.pow(ee, c), new ge(this.h, this.s, this.l * c, this.opacity);
            },
            rgb: function() {
              var c = this.h % 360 + (this.h < 0) * 360, J = isNaN(c) || isNaN(this.s) ? 0 : this.s, oe = this.l, Be = oe + (oe < 0.5 ? oe : 1 - oe) * J, Ye = 2 * oe - Be;
              return new n(
                ce(c >= 240 ? c - 240 : c + 120, Ye, Be),
                ce(c, Ye, Be),
                ce(c < 120 ? c + 240 : c - 120, Ye, Be),
                this.opacity
              );
            },
            displayable: function() {
              return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
            }
          }));
          function ce(c, J, oe) {
            return (c < 60 ? J + (oe - J) * c / 60 : c < 180 ? oe : c < 240 ? J + (oe - J) * (240 - c) / 60 : J) * 255;
          }
          var xe = Math.PI / 180, fe = 180 / Math.PI, Ce = 18, he = 0.96422, le = 1, G = 0.82521, P = 4 / 29, $ = 6 / 29, E = 3 * $ * $, V = $ * $ * $;
          function ie(c) {
            if (c instanceof K)
              return new K(c.l, c.a, c.b, c.opacity);
            if (c instanceof u)
              return Z(c);
            c instanceof n || (c = v(c));
            var J = Y(c.r), oe = Y(c.g), Be = Y(c.b), Ye = s((0.2225045 * J + 0.7168786 * oe + 0.0606169 * Be) / le), We, Ke;
            return J === oe && oe === Be ? We = Ke = Ye : (We = s((0.4360747 * J + 0.3850649 * oe + 0.1430804 * Be) / he), Ke = s((0.0139322 * J + 0.0971045 * oe + 0.7141733 * Be) / G)), new K(116 * Ye - 16, 500 * (We - Ye), 200 * (Ye - Ke), c.opacity);
          }
          function ae(c, J, oe, Be) {
            return arguments.length === 1 ? ie(c) : new K(c, J, oe, Be ?? 1);
          }
          function K(c, J, oe, Be) {
            this.l = +c, this.a = +J, this.b = +oe, this.opacity = +Be;
          }
          a(K, ae, X(q, {
            brighter: function(c) {
              return new K(this.l + Ce * (c ?? 1), this.a, this.b, this.opacity);
            },
            darker: function(c) {
              return new K(this.l - Ce * (c ?? 1), this.a, this.b, this.opacity);
            },
            rgb: function() {
              var c = (this.l + 16) / 116, J = isNaN(this.a) ? c : c + this.a / 500, oe = isNaN(this.b) ? c : c - this.b / 200;
              return J = he * g(J), c = le * g(c), oe = G * g(oe), new n(
                U(3.1338561 * J - 1.6168667 * c - 0.4906146 * oe),
                U(-0.9787684 * J + 1.9161415 * c + 0.033454 * oe),
                U(0.0719453 * J - 0.2289914 * c + 1.4052427 * oe),
                this.opacity
              );
            }
          }));
          function s(c) {
            return c > V ? Math.pow(c, 1 / 3) : c / E + P;
          }
          function g(c) {
            return c > $ ? c * c * c : E * (c - P);
          }
          function U(c) {
            return 255 * (c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055);
          }
          function Y(c) {
            return (c /= 255) <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
          }
          function p(c) {
            if (c instanceof u)
              return new u(c.h, c.c, c.l, c.opacity);
            if (c instanceof K || (c = ie(c)), c.a === 0 && c.b === 0)
              return new u(NaN, 0 < c.l && c.l < 100 ? 0 : NaN, c.l, c.opacity);
            var J = Math.atan2(c.b, c.a) * fe;
            return new u(J < 0 ? J + 360 : J, Math.sqrt(c.a * c.a + c.b * c.b), c.l, c.opacity);
          }
          function w(c, J, oe, Be) {
            return arguments.length === 1 ? p(c) : new u(c, J, oe, Be ?? 1);
          }
          function u(c, J, oe, Be) {
            this.h = +c, this.c = +J, this.l = +oe, this.opacity = +Be;
          }
          function Z(c) {
            if (isNaN(c.h))
              return new K(c.l, 0, 0, c.opacity);
            var J = c.h * xe;
            return new K(c.l, Math.cos(J) * c.c, Math.sin(J) * c.c, c.opacity);
          }
          a(u, w, X(q, {
            brighter: function(c) {
              return new u(this.h, this.c, this.l + Ce * (c ?? 1), this.opacity);
            },
            darker: function(c) {
              return new u(this.h, this.c, this.l - Ce * (c ?? 1), this.opacity);
            },
            rgb: function() {
              return Z(this).rgb();
            }
          }));
          var re = -0.14861, de = 1.78277, be = -0.29227, i = -0.90649, f = 1.97294, R = f * i, z = f * de, se = de * be - i * re;
          function ue(c) {
            if (c instanceof N)
              return new N(c.h, c.s, c.l, c.opacity);
            c instanceof n || (c = v(c));
            var J = c.r / 255, oe = c.g / 255, Be = c.b / 255, Ye = (se * Be + R * J - z * oe) / (se + R - z), We = Be - Ye, Ke = (f * (oe - Ye) - be * We) / i, et = Math.sqrt(Ke * Ke + We * We) / (f * Ye * (1 - Ye)), nt = et ? Math.atan2(Ke, We) * fe - 120 : NaN;
            return new N(nt < 0 ? nt + 360 : nt, et, Ye, c.opacity);
          }
          function ye(c, J, oe, Be) {
            return arguments.length === 1 ? ue(c) : new N(c, J, oe, Be ?? 1);
          }
          function N(c, J, oe, Be) {
            this.h = +c, this.s = +J, this.l = +oe, this.opacity = +Be;
          }
          a(N, ye, X(q, {
            brighter: function(c) {
              return c = c == null ? j : Math.pow(j, c), new N(this.h, this.s, this.l * c, this.opacity);
            },
            darker: function(c) {
              return c = c == null ? ee : Math.pow(ee, c), new N(this.h, this.s, this.l * c, this.opacity);
            },
            rgb: function() {
              var c = isNaN(this.h) ? 0 : (this.h + 120) * xe, J = +this.l, oe = isNaN(this.s) ? 0 : this.s * J * (1 - J), Be = Math.cos(c), Ye = Math.sin(c);
              return new n(
                255 * (J + oe * (re * Be + de * Ye)),
                255 * (J + oe * (be * Be + i * Ye)),
                255 * (J + oe * (f * Be)),
                this.opacity
              );
            }
          })), d.d(O, "a", function() {
            return o;
          }), d.d(O, "f", function() {
            return T;
          }), d.d(O, "d", function() {
            return ne;
          }), d.d(O, "e", function() {
            return ae;
          }), d.d(O, "c", function() {
            return w;
          }), d.d(O, "b", function() {
            return ye;
          });
        },
        /* 2 */
        /***/
        function(Te, O, d) {
          var a = d(1), X = function(K) {
            return function() {
              return K;
            };
          };
          function q(K, s) {
            return function(g) {
              return K + g * s;
            };
          }
          function ee(K, s, g) {
            return K = Math.pow(K, g), s = Math.pow(s, g) - K, g = 1 / g, function(U) {
              return Math.pow(K + U * s, g);
            };
          }
          function j(K, s) {
            var g = s - K;
            return g ? q(K, g > 180 || g < -180 ? g - 360 * Math.round(g / 360) : g) : X(isNaN(K) ? s : K);
          }
          function t(K) {
            return (K = +K) == 1 ? F : function(s, g) {
              return g - s ? ee(s, g, K) : X(isNaN(s) ? g : s);
            };
          }
          function F(K, s) {
            var g = s - K;
            return g ? q(K, g) : X(isNaN(K) ? s : K);
          }
          var M = function K(s) {
            var g = t(s);
            function U(Y, p) {
              var w = g((Y = Object(a.f)(Y)).r, (p = Object(a.f)(p)).r), u = g(Y.g, p.g), Z = g(Y.b, p.b), re = F(Y.opacity, p.opacity);
              return function(de) {
                return Y.r = w(de), Y.g = u(de), Y.b = Z(de), Y.opacity = re(de), Y + "";
              };
            }
            return U.gamma = K, U;
          }(1), h = function(K, s) {
            var g = s ? s.length : 0, U = K ? Math.min(g, K.length) : 0, Y = new Array(U), p = new Array(g), w;
            for (w = 0; w < U; ++w)
              Y[w] = o(K[w], s[w]);
            for (; w < g; ++w)
              p[w] = s[w];
            return function(u) {
              for (w = 0; w < U; ++w)
                p[w] = Y[w](u);
              return p;
            };
          }, x = function(K, s) {
            var g = /* @__PURE__ */ new Date();
            return K = +K, s -= K, function(U) {
              return g.setTime(K + s * U), g;
            };
          }, m = function(K, s) {
            return K = +K, s -= K, function(g) {
              return K + s * g;
            };
          }, D = function(K, s) {
            var g = {}, U = {}, Y;
            (K === null || typeof K != "object") && (K = {}), (s === null || typeof s != "object") && (s = {});
            for (Y in s)
              Y in K ? g[Y] = o(K[Y], s[Y]) : U[Y] = s[Y];
            return function(p) {
              for (Y in g)
                U[Y] = g[Y](p);
              return U;
            };
          }, H = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, B = new RegExp(H.source, "g");
          function k(K) {
            return function() {
              return K;
            };
          }
          function _(K) {
            return function(s) {
              return K(s) + "";
            };
          }
          var Q = function(K, s) {
            var g = H.lastIndex = B.lastIndex = 0, U, Y, p, w = -1, u = [], Z = [];
            for (K = K + "", s = s + ""; (U = H.exec(K)) && (Y = B.exec(s)); )
              (p = Y.index) > g && (p = s.slice(g, p), u[w] ? u[w] += p : u[++w] = p), (U = U[0]) === (Y = Y[0]) ? u[w] ? u[w] += Y : u[++w] = Y : (u[++w] = null, Z.push({ i: w, x: m(U, Y) })), g = B.lastIndex;
            return g < s.length && (p = s.slice(g), u[w] ? u[w] += p : u[++w] = p), u.length < 2 ? Z[0] ? _(Z[0].x) : k(s) : (s = Z.length, function(re) {
              for (var de = 0, be; de < s; ++de)
                u[(be = Z[de]).i] = be.x(re);
              return u.join("");
            });
          }, o = function(K, s) {
            var g = typeof s, U;
            return s == null || g === "boolean" ? X(s) : (g === "number" ? m : g === "string" ? (U = Object(a.a)(s)) ? (s = U, M) : Q : s instanceof a.a ? M : s instanceof Date ? x : Array.isArray(s) ? h : typeof s.valueOf != "function" && typeof s.toString != "function" || isNaN(s) ? D : m)(K, s);
          }, W = function(K, s) {
            return K = +K, s -= K, function(g) {
              return Math.round(K + s * g);
            };
          }, y = 180 / Math.PI, v = {
            translateX: 0,
            translateY: 0,
            rotate: 0,
            skewX: 0,
            scaleX: 1,
            scaleY: 1
          }, T = function(K, s, g, U, Y, p) {
            var w, u, Z;
            return (w = Math.sqrt(K * K + s * s)) && (K /= w, s /= w), (Z = K * g + s * U) && (g -= K * Z, U -= s * Z), (u = Math.sqrt(g * g + U * U)) && (g /= u, U /= u, Z /= u), K * U < s * g && (K = -K, s = -s, Z = -Z, w = -w), {
              translateX: Y,
              translateY: p,
              rotate: Math.atan2(s, K) * y,
              skewX: Math.atan(Z) * y,
              scaleX: w,
              scaleY: u
            };
          }, n, r, b, C;
          function ne(K) {
            return K === "none" ? v : (n || (n = document.createElement("DIV"), r = document.documentElement, b = document.defaultView), n.style.transform = K, K = b.getComputedStyle(r.appendChild(n), null).getPropertyValue("transform"), r.removeChild(n), K = K.slice(7, -1).split(","), T(+K[0], +K[1], +K[2], +K[3], +K[4], +K[5]));
          }
          function ge(K) {
            return K == null || (C || (C = document.createElementNS("http://www.w3.org/2000/svg", "g")), C.setAttribute("transform", K), !(K = C.transform.baseVal.consolidate())) ? v : (K = K.matrix, T(K.a, K.b, K.c, K.d, K.e, K.f));
          }
          function ce(K, s, g, U) {
            function Y(re) {
              return re.length ? re.pop() + " " : "";
            }
            function p(re, de, be, i, f, R) {
              if (re !== be || de !== i) {
                var z = f.push("translate(", null, s, null, g);
                R.push({ i: z - 4, x: m(re, be) }, { i: z - 2, x: m(de, i) });
              } else
                (be || i) && f.push("translate(" + be + s + i + g);
            }
            function w(re, de, be, i) {
              re !== de ? (re - de > 180 ? de += 360 : de - re > 180 && (re += 360), i.push({ i: be.push(Y(be) + "rotate(", null, U) - 2, x: m(re, de) })) : de && be.push(Y(be) + "rotate(" + de + U);
            }
            function u(re, de, be, i) {
              re !== de ? i.push({ i: be.push(Y(be) + "skewX(", null, U) - 2, x: m(re, de) }) : de && be.push(Y(be) + "skewX(" + de + U);
            }
            function Z(re, de, be, i, f, R) {
              if (re !== be || de !== i) {
                var z = f.push(Y(f) + "scale(", null, ",", null, ")");
                R.push({ i: z - 4, x: m(re, be) }, { i: z - 2, x: m(de, i) });
              } else
                (be !== 1 || i !== 1) && f.push(Y(f) + "scale(" + be + "," + i + ")");
            }
            return function(re, de) {
              var be = [], i = [];
              return re = K(re), de = K(de), p(re.translateX, re.translateY, de.translateX, de.translateY, be, i), w(re.rotate, de.rotate, be, i), u(re.skewX, de.skewX, be, i), Z(re.scaleX, re.scaleY, de.scaleX, de.scaleY, be, i), re = de = null, function(f) {
                for (var R = -1, z = i.length, se; ++R < z; )
                  be[(se = i[R]).i] = se.x(f);
                return be.join("");
              };
            };
          }
          var xe = ce(ne, "px, ", "px)", "deg)"), fe = ce(ge, ", ", ")", ")"), Ce = Math.SQRT2, he = 2, le = 4, G = 1e-12;
          function P(K) {
            return ((K = Math.exp(K)) + 1 / K) / 2;
          }
          function $(K) {
            return ((K = Math.exp(K)) - 1 / K) / 2;
          }
          function E(K) {
            return ((K = Math.exp(2 * K)) - 1) / (K + 1);
          }
          var V = function(K, s) {
            var g = K[0], U = K[1], Y = K[2], p = s[0], w = s[1], u = s[2], Z = p - g, re = w - U, de = Z * Z + re * re, be, i;
            if (de < G)
              i = Math.log(u / Y) / Ce, be = function(ye) {
                return [
                  g + ye * Z,
                  U + ye * re,
                  Y * Math.exp(Ce * ye * i)
                ];
              };
            else {
              var f = Math.sqrt(de), R = (u * u - Y * Y + le * de) / (2 * Y * he * f), z = (u * u - Y * Y - le * de) / (2 * u * he * f), se = Math.log(Math.sqrt(R * R + 1) - R), ue = Math.log(Math.sqrt(z * z + 1) - z);
              i = (ue - se) / Ce, be = function(ye) {
                var N = ye * i, c = P(se), J = Y / (he * f) * (c * E(Ce * N + se) - $(se));
                return [
                  g + J * Z,
                  U + J * re,
                  Y * c / P(Ce * N + se)
                ];
              };
            }
            return be.duration = i * 1e3, be;
          };
          function ie(K) {
            return function s(g) {
              g = +g;
              function U(Y, p) {
                var w = K((Y = Object(a.b)(Y)).h, (p = Object(a.b)(p)).h), u = F(Y.s, p.s), Z = F(Y.l, p.l), re = F(Y.opacity, p.opacity);
                return function(de) {
                  return Y.h = w(de), Y.s = u(de), Y.l = Z(Math.pow(de, g)), Y.opacity = re(de), Y + "";
                };
              }
              return U.gamma = s, U;
            }(1);
          }
          ie(j);
          var ae = ie(F);
          d.d(O, "a", function() {
            return o;
          }), d.d(O, "c", function() {
            return m;
          }), d.d(O, "e", function() {
            return W;
          }), d.d(O, "f", function() {
            return Q;
          }), d.d(O, "g", function() {
            return xe;
          }), d.d(O, "h", function() {
            return fe;
          }), d.d(O, "i", function() {
            return V;
          }), d.d(O, "d", function() {
            return M;
          }), d.d(O, "b", function() {
            return ae;
          });
        },
        /* 3 */
        /***/
        function(Te, O, d) {
          var a = d(21), X = d(4), q = d(16).json, ee = d(16).text, j = d(14).csvParseRows, t = d(0).selection;
          try {
            var F = d(39).saveAs;
          } catch {
            console.warn("Not a browser, so FileSaver.js not available.");
          }
          Te.exports = {
            set_options: h,
            remove_child_nodes: x,
            load_css: m,
            load_files: B,
            load_the_file: H,
            make_class: k,
            class_with_optional_new: _,
            setup_defs: Q,
            draw_an_object: o,
            draw_a_nested_object: W,
            make_array: y,
            make_array_ref: v,
            compare_arrays: T,
            arrayToObject: n,
            clone: r,
            extend: b,
            uniqueConcat: C,
            unique_strings_array: ne,
            debounce: ge,
            object_slice_for_ids: ce,
            object_slice_for_ids_ref: xe,
            c_plus_c: fe,
            c_minus_c: Ce,
            c_times_scalar: he,
            download_json: le,
            load_json: G,
            load_json_or_csv: P,
            downloadSvg: $,
            downloadPng: E,
            rotate_coords_recursive: V,
            rotate_coords: ie,
            get_angle: ae,
            to_degrees: K,
            angleNorm: s,
            to_radians: g,
            to_radians_norm: U,
            angle_for_event: Y,
            distance: p,
            check_undefined: w,
            compartmentalize: u,
            decompartmentalize: Z,
            mean: re,
            median: de,
            quartiles: be,
            random_characters: i,
            generate_map_id: f,
            check_for_parent_tag: R,
            name_to_url: z,
            get_document: se,
            get_window: ue,
            d3_transform_catch: ye
            // check_browser: check_browser
            /**
             * Check if Blob is available, and alert if it is not.
             */
          };
          function M() {
            try {
              var N = !!new Blob();
            } catch {
              alert("Blob not supported");
            }
          }
          function h(N, c, J) {
            if (N == null)
              return c;
            var oe = {};
            for (var Be in c) {
              var Ye = Be in N && N[Be] !== null && N[Be] !== void 0, We = Ye ? N[Be] : c[Be];
              J && Be in J && (We = parseFloat(We), isNaN(We) && (Ye ? (console.warn("Bad float for option " + Be), We = parseFloat(c[Be]), isNaN(We) && (console.warn("Bad float for default " + Be), We = null)) : (console.warn("Bad float for default " + Be), We = null))), oe[Be] = We;
            }
            return oe;
          }
          function x(N) {
            for (var c = N.node(); c.hasChildNodes(); )
              c.removeChild(c.lastChild);
          }
          function m(N, c) {
            var J = "";
            return N && ee(N, function(oe, Be) {
              oe && console.warn(oe), J = Be, c(J);
            }), !1;
          }
          function D(N, c) {
            return N.indexOf(c, N.length - c.length) !== -1;
          }
          function H(N, c, J, oe) {
            if (oe) {
              c && console.warn("File " + c + " overridden by value."), J.call(N, null, oe);
              return;
            }
            if (!c) {
              J.call(N, "No filename", null);
              return;
            }
            D(c, "json") ? q(c, function(Be, Ye) {
              J.call(N, Be, Ye);
            }) : D(c, "css") ? ee(c, function(Be, Ye) {
              J.call(N, Be, Ye);
            }) : J.call(N, "Unrecognized file type", null);
          }
          function B(N, c, J) {
            c.length === 0 && J.call(N);
            for (var oe = -1, Be = c.length; ++oe < c.length; )
              H(N, c[oe].file, (function(Ye, We) {
                this.call(N, Ye, We), --Be || J.call(N);
              }).bind(c[oe].callback), c[oe].value);
          }
          function k() {
            var N, c = function J(oe) {
              if (this instanceof J)
                typeof this.init == "function" && this.init.apply(this, N ? oe : arguments);
              else {
                N = !0;
                var Be = new J(arguments);
                return N = !1, Be;
              }
            };
            return c;
          }
          function _(N) {
            return new Proxy(N, {
              apply: function(J, oe, Be) {
                return new (Function.prototype.bind.apply(J, [null].concat(Be)))();
              }
            });
          }
          function Q(N, c) {
            N.select("defs").remove();
            var J = N.append("defs"), oe = J.node();
            return oe.parentNode.insertBefore(oe, oe.parentNode.firstChild), J.append("style").attr("type", "text/css").text(c), J;
          }
          function o(N, c, J, oe, Be, Ye, We, Ke) {
            var et = {};
            for (var nt in oe)
              oe[nt] === void 0 ? console.warn("Undefined value for id " + nt + " in object. Ignoring.") : et[nt] = oe[nt];
            var pt = N.select(c).selectAll(J).data(v(et, Be), function(gt) {
              return gt[Be];
            }), Et = Ye ? Ye(pt.enter()).merge(pt) : pt;
            We && Et.call(We), Ke && pt.exit().call(Ke);
          }
          function W(N, c, J, oe, Be, Ye, We) {
            var Ke = N.selectAll(c).data(function(nt) {
              return v(nt[J], oe);
            }, function(nt) {
              return nt[oe];
            }), et = Be ? Be(Ke.enter()).merge(Ke) : Ke;
            Ye && et.call(Ye), We && Ke.exit().call(We);
          }
          function y(N, c) {
            var J = [];
            for (var oe in N) {
              var Be = r(N[oe]);
              Be[c] = oe, J.push(Be);
            }
            return J;
          }
          function v(N, c) {
            var J = [];
            for (var oe in N) {
              var Be = N[oe];
              Be[c] = oe, J.push(Be);
            }
            return J;
          }
          function T(N, c) {
            if (!N || !c || N.length != c.length)
              return !1;
            for (var J = 0, oe = N.length; J < oe; J++)
              if (N[J] != c[J])
                return !1;
            return !0;
          }
          function n(N) {
            for (var c = {}, J = 0, oe = N.length; J < oe; J++)
              for (var Be = N[J], Ye = Object.keys(Be), We = 0, Ke = Ye.length; We < Ke; We++) {
                var et = Ye[We];
                if (et in c)
                  c[et][J] = Be[et];
                else {
                  for (var nt = [], pt = 0; pt < oe; pt++)
                    nt[pt] = null;
                  nt[J] = Be[et], c[et] = nt;
                }
              }
            return c;
          }
          function r(N) {
            return X.isArray(N) ? X.map(N, function(c) {
              return r(c);
            }) : X.isObject(N) ? X.mapObject(N, function(c, J) {
              return r(c);
            }) : N;
          }
          function b(N, c, J) {
            J === void 0 && (J = !1);
            for (var oe in c)
              if (!(oe in N) || J)
                N[oe] = c[oe];
              else
                throw new Error("Attribute " + oe + " already in object.");
          }
          function C(N) {
            var c = [];
            return N.forEach(function(J) {
              J.forEach(function(oe) {
                c.indexOf(oe) < 0 && c.push(oe);
              });
            }), c;
          }
          function ne(N) {
            for (var c = [], J = 0, oe = N.length; J < oe; J++)
              c.indexOf(N[J]) === -1 && c.push(N[J]);
            return c;
          }
          function ge(N, c, J) {
            var oe;
            return function() {
              var Be = this, Ye = arguments, We = function() {
                oe = null, J || N.apply(Be, Ye);
              }, Ke = J && !oe;
              clearTimeout(oe), oe = setTimeout(We, c), Ke && N.apply(Be, Ye);
            };
          }
          function ce(N, c) {
            for (var J = {}, oe = -1; ++oe < c.length; )
              J[c[oe]] = r(N[c[oe]]);
            return c.length !== Object.keys(J).length && console.warn("did not find correct reaction subset"), J;
          }
          function xe(N, c) {
            for (var J = {}, oe = -1; ++oe < c.length; )
              J[c[oe]] = N[c[oe]];
            return c.length !== Object.keys(J).length && console.warn("did not find correct reaction subset"), J;
          }
          function fe(N, c) {
            return N === null || c === null || N === void 0 || c === void 0 ? null : {
              x: N.x + c.x,
              y: N.y + c.y
            };
          }
          function Ce(N, c) {
            return N === null || c === null || N === void 0 || c === void 0 ? null : {
              x: N.x - c.x,
              y: N.y - c.y
            };
          }
          function he(N, c) {
            return {
              x: N.x * c,
              y: N.y * c
            };
          }
          function le(N, c) {
            M();
            var J = JSON.stringify(N), oe = new Blob([J], { type: "application/json" });
            F(oe, c + ".json");
          }
          function G(N, c, J, oe) {
            window.File && window.FileReader && window.FileList && window.Blob || c("The File APIs are not fully supported in this browser.", null);
            var Be = new window.FileReader();
            if (Be.onload = function(Ye) {
              var We = Ye.target.result, Ke;
              try {
                Ke = JSON.parse(We);
              } catch (et) {
                c(et, null);
                return;
              }
              c(null, Ke);
            }, J != null)
              try {
                J();
              } catch (Ye) {
                console.warn(Ye);
              }
            Be.onabort = function(Ye) {
              try {
                oe();
              } catch (We) {
                console.warn(We);
              }
            }, Be.onerror = function(Ye) {
              try {
                oe();
              } catch (We) {
                console.warn(We);
              }
            }, Be.readAsText(N);
          }
          function P(N, c, J, oe, Be, Ye) {
            var We = function(nt) {
              var pt = nt.target.result, Et, gt;
              try {
                Et = JSON.parse(pt);
              } catch (bt) {
                gt = "JSON error: " + bt;
                try {
                  Et = c(j(pt));
                } catch (Bt) {
                  J(gt + `
CSV error: ` + Bt, null);
                  return;
                }
              }
              J(null, Et);
            };
            if (Ye != null)
              return console.warn("Debugging load_json_or_csv"), We(Ye);
            window.File && window.FileReader && window.FileList && window.Blob || J("The File APIs are not fully supported in this browser.", null);
            var Ke = new window.FileReader();
            if (oe != null)
              try {
                oe();
              } catch (et) {
                console.warn(et);
              }
            Ke.onabort = function(et) {
              try {
                Be();
              } catch (nt) {
                console.warn(nt);
              }
            }, Ke.onerror = function(et) {
              try {
                Be();
              } catch (nt) {
                console.warn(nt);
              }
            }, Ke.onload = We, Ke.readAsText(N);
          }
          function $(N, c, J) {
            M();
            var oe = new XMLSerializer().serializeToString(c.node());
            J && (oe = a.xml(oe)), oe = `<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
` + oe;
            var Be = new Blob([oe], { type: "image/svg+xml" });
            F(Be, N + ".svg");
          }
          function E(N, c) {
            M();
            var J = new XMLSerializer().serializeToString(c.node());
            J = `<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
` + J;
            var oe = document.createElement("canvas"), Be = oe.getContext("2d"), Ye = c.node().getBBox(), We = Ye.width + Ye.x, Ke = Ye.height + Ye.y;
            We < 1e4 && Ke < 1e4 ? (oe.width = We, oe.height = Ke) : oe.width > oe.height ? (oe.width = 1e4, oe.height = 1e4 * (Ke / We)) : (oe.width = 1e4 * (We / Ke), oe.height = 1e4);
            var et = new Image();
            et.src = "data:image/svg+xml;base64," + btoa(J), et.onload = function() {
              Be.fillStyle = "#FFF", Be.fillRect(0, 0, oe.width, oe.height), Be.drawImage(et, 0, 0, oe.width, oe.height), oe.toBlob(function(nt) {
                F(nt, N + ".png");
              });
            };
          }
          function V(N, c, J) {
            return N.map(function(oe) {
              return ie(oe, c, J);
            });
          }
          function ie(N, c, J) {
            var oe = Math.cos(-c) * (N.x - J.x) + Math.sin(-c) * (N.y - J.y) + J.x - N.x, Be = -Math.sin(-c) * (N.x - J.x) + Math.cos(-c) * (N.y - J.y) + J.y - N.y;
            return { x: oe, y: Be };
          }
          function ae(N) {
            var c = N[1].x - N[0].x, J = N[1].y - N[0].y;
            return c === 0 && J >= 0 ? Math.PI / 2 : c === 0 && J < 0 ? 3 * Math.PI / 2 : c >= 0 && J >= 0 ? Math.atan(J / c) : c >= 0 ? Math.atan(J / c) + 2 * Math.PI : Math.atan(J / c) + Math.PI;
          }
          function K(N) {
            return N * 180 / Math.PI;
          }
          function s(N) {
            return N < -Math.PI ? N + Math.floor((N - Math.PI) / (-2 * Math.PI)) * 2 * Math.PI : N > Math.PI ? N - Math.floor((N + Math.PI) / (2 * Math.PI)) * 2 * Math.PI : N;
          }
          function g(N) {
            return Math.PI / 180 * N;
          }
          function U(N) {
            var c = g(N);
            return s(c);
          }
          function Y(N, c, J) {
            var oe = Math.atan2(c.x - J.x, J.y - c.y), Be = Math.atan2(c.x - J.x + N.x, J.y - c.y - N.y), Ye = Be - oe;
            return Ye;
          }
          function p(N, c) {
            return Math.sqrt(Math.pow(c.y - N.y, 2) + Math.pow(c.x - N.x, 2));
          }
          function w(N, c) {
            c.forEach(function(J, oe) {
              N[oe] === void 0 && console.error("Argument is undefined: " + c[oe]);
            });
          }
          function u(N, c) {
            return N + "_" + c;
          }
          function Z(N) {
            var c = /(.*)_([a-z0-9]{1,2})$/, J = c.exec(N);
            return J !== null ? J.slice(1, 3) : [N, null];
          }
          function re(N) {
            var c = N.reduce(function(oe, Be) {
              return oe + Be;
            }), J = c / N.length;
            return J;
          }
          function de(N) {
            N.sort(function(J, oe) {
              return J - oe;
            });
            var c = Math.floor(N.length / 2);
            return N.length % 2 == 1 ? N[c] : (N[c - 1] + N[c]) / 2;
          }
          function be(N) {
            N.sort(function(J, oe) {
              return J - oe;
            });
            var c = Math.floor(N.length / 2);
            return N.length === 1 ? [N[0], N[0], N[0]] : N.length % 2 === 1 ? [de(N.slice(0, c)), N[c], de(N.slice(c + 1))] : [de(N.slice(0, c)), (N[c - 1] + N[c]) / 2, de(N.slice(c))];
          }
          function i(N) {
            for (var c = "", J = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", oe = 0; oe < N; oe++)
              c += J.charAt(Math.floor(Math.random() * J.length));
            return c;
          }
          function f() {
            return i(12);
          }
          function R(N, c) {
            for (N instanceof t && (N = N.node()); N.parentNode !== null; )
              if (N = N.parentNode, N.tagName !== void 0 && N.tagName.toLowerCase() === c.toLowerCase())
                return !0;
            return !1;
          }
          function z(N, c) {
            return c != null && (c = c.replace(/^\/|\/$/g, ""), N = [c, N].join("/")), N.replace(/^\/|\/$/g, "") + ".json";
          }
          function se(N) {
            return N.ownerDocument;
          }
          function ue(N) {
            return se(N).defaultView;
          }
          function ye(N) {
            if (N.indexOf("skew") !== -1 || N.indexOf("matrix") !== -1)
              throw new Error("d3_transform_catch does not work with skew or matrix");
            var c = /translate\s*\(\s*([0-9.-]+)\s*,\s*([0-9.-]+)\s*\)/.exec(N), J = X.isNull(c), oe = J ? 0 : Number(c[1]), Be = J ? 0 : Number(c[2]), Ye = /rotate\s*\(\s*([0-9.-]+)\s*\)/.exec(N), We = X.isNull(Ye), Ke = We ? 0 : Number(Ye[1]), et = /scale\s*\(\s*([0-9.-]+)\s*\)/.exec(N), nt = X.isNull(et), pt = nt ? 0 : Number(et[1]);
            return {
              translate: [oe, Be],
              rotate: Ke,
              scale: pt
              // // Create a dummy g for calculation purposes only. This will new be appended
              // // to the DOM and will be discarded once this function returns.
              // var g = document.createElementNS('http://www.w3.org/2000/svg', 'g')
              // // Set the transform attribute to the provided string value.
              // g.setAttributeNS(null, 'transform', transform_attr)
              // // Consolidate the SVGTransformList containing all Try to a single
              // // SVGTransform of type SVG_TRANSFORM_MATRIX and get its SVGMatrix.
              // var matrix = g.transform.baseVal.consolidate().matrix
              // // Below calculations are taken and adapted from the private func
              // // transform/decompose.js of D3's module d3-interpolate.
              // var a = matrix.a
              // var b = matrix.b
              // var c = matrix.c
              // var d = matrix.d
              // var e = matrix.e
              // var f = matrix.f
              // var scaleX = Math.sqrt(a * a + b * b)
              // if (scaleX) {
              //   a /= scaleX
              //   b /= scaleX
              // }
              // if (a * d < b * c) {
              //   a = -a
              //   b = -b
              // }
              // return {
              //   translate: [ e, f ],
              //   rotate: Math.atan2(b, a) * Math.PI / 180,
              // }
            };
          }
        },
        /* 4 */
        /***/
        function(Te, O, d) {
          (function(a, X) {
            var q, ee;
            (function() {
              var j = typeof self == "object" && self.self === self && self || typeof a == "object" && a.global === a && a || this || {}, t = j._, F = Array.prototype, M = Object.prototype, h = typeof Symbol < "u" ? Symbol.prototype : null, x = F.push, m = F.slice, D = M.toString, H = M.hasOwnProperty, B = Array.isArray, k = Object.keys, _ = Object.create, Q = function() {
              }, o = function(i) {
                if (i instanceof o)
                  return i;
                if (!(this instanceof o))
                  return new o(i);
                this._wrapped = i;
              };
              O.nodeType ? j._ = o : (!X.nodeType && X.exports && (O = X.exports = o), O._ = o), o.VERSION = "1.9.1";
              var W = function(i, f, R) {
                if (f === void 0)
                  return i;
                switch (R ?? 3) {
                  case 1:
                    return function(z) {
                      return i.call(f, z);
                    };
                  case 3:
                    return function(z, se, ue) {
                      return i.call(f, z, se, ue);
                    };
                  case 4:
                    return function(z, se, ue, ye) {
                      return i.call(f, z, se, ue, ye);
                    };
                }
                return function() {
                  return i.apply(f, arguments);
                };
              }, y, v = function(i, f, R) {
                return o.iteratee !== y ? o.iteratee(i, f) : i == null ? o.identity : o.isFunction(i) ? W(i, f, R) : o.isObject(i) && !o.isArray(i) ? o.matcher(i) : o.property(i);
              };
              o.iteratee = y = function(i, f) {
                return v(i, f, 1 / 0);
              };
              var T = function(i, f) {
                return f = f == null ? i.length - 1 : +f, function() {
                  for (var R = Math.max(arguments.length - f, 0), z = Array(R), se = 0; se < R; se++)
                    z[se] = arguments[se + f];
                  switch (f) {
                    case 0:
                      return i.call(this, z);
                    case 1:
                      return i.call(this, arguments[0], z);
                    case 2:
                      return i.call(this, arguments[0], arguments[1], z);
                  }
                  var ue = Array(f + 1);
                  for (se = 0; se < f; se++)
                    ue[se] = arguments[se];
                  return ue[f] = z, i.apply(this, ue);
                };
              }, n = function(i) {
                if (!o.isObject(i))
                  return {};
                if (_)
                  return _(i);
                Q.prototype = i;
                var f = new Q();
                return Q.prototype = null, f;
              }, r = function(i) {
                return function(f) {
                  return f == null ? void 0 : f[i];
                };
              }, b = function(i, f) {
                return i != null && H.call(i, f);
              }, C = function(i, f) {
                for (var R = f.length, z = 0; z < R; z++) {
                  if (i == null)
                    return;
                  i = i[f[z]];
                }
                return R ? i : void 0;
              }, ne = Math.pow(2, 53) - 1, ge = r("length"), ce = function(i) {
                var f = ge(i);
                return typeof f == "number" && f >= 0 && f <= ne;
              };
              o.each = o.forEach = function(i, f, R) {
                f = W(f, R);
                var z, se;
                if (ce(i))
                  for (z = 0, se = i.length; z < se; z++)
                    f(i[z], z, i);
                else {
                  var ue = o.keys(i);
                  for (z = 0, se = ue.length; z < se; z++)
                    f(i[ue[z]], ue[z], i);
                }
                return i;
              }, o.map = o.collect = function(i, f, R) {
                f = v(f, R);
                for (var z = !ce(i) && o.keys(i), se = (z || i).length, ue = Array(se), ye = 0; ye < se; ye++) {
                  var N = z ? z[ye] : ye;
                  ue[ye] = f(i[N], N, i);
                }
                return ue;
              };
              var xe = function(i) {
                var f = function(R, z, se, ue) {
                  var ye = !ce(R) && o.keys(R), N = (ye || R).length, c = i > 0 ? 0 : N - 1;
                  for (ue || (se = R[ye ? ye[c] : c], c += i); c >= 0 && c < N; c += i) {
                    var J = ye ? ye[c] : c;
                    se = z(se, R[J], J, R);
                  }
                  return se;
                };
                return function(R, z, se, ue) {
                  var ye = arguments.length >= 3;
                  return f(R, W(z, ue, 4), se, ye);
                };
              };
              o.reduce = o.foldl = o.inject = xe(1), o.reduceRight = o.foldr = xe(-1), o.find = o.detect = function(i, f, R) {
                var z = ce(i) ? o.findIndex : o.findKey, se = z(i, f, R);
                if (se !== void 0 && se !== -1)
                  return i[se];
              }, o.filter = o.select = function(i, f, R) {
                var z = [];
                return f = v(f, R), o.each(i, function(se, ue, ye) {
                  f(se, ue, ye) && z.push(se);
                }), z;
              }, o.reject = function(i, f, R) {
                return o.filter(i, o.negate(v(f)), R);
              }, o.every = o.all = function(i, f, R) {
                f = v(f, R);
                for (var z = !ce(i) && o.keys(i), se = (z || i).length, ue = 0; ue < se; ue++) {
                  var ye = z ? z[ue] : ue;
                  if (!f(i[ye], ye, i))
                    return !1;
                }
                return !0;
              }, o.some = o.any = function(i, f, R) {
                f = v(f, R);
                for (var z = !ce(i) && o.keys(i), se = (z || i).length, ue = 0; ue < se; ue++) {
                  var ye = z ? z[ue] : ue;
                  if (f(i[ye], ye, i))
                    return !0;
                }
                return !1;
              }, o.contains = o.includes = o.include = function(i, f, R, z) {
                return ce(i) || (i = o.values(i)), (typeof R != "number" || z) && (R = 0), o.indexOf(i, f, R) >= 0;
              }, o.invoke = T(function(i, f, R) {
                var z, se;
                return o.isFunction(f) ? se = f : o.isArray(f) && (z = f.slice(0, -1), f = f[f.length - 1]), o.map(i, function(ue) {
                  var ye = se;
                  if (!ye) {
                    if (z && z.length && (ue = C(ue, z)), ue == null)
                      return;
                    ye = ue[f];
                  }
                  return ye == null ? ye : ye.apply(ue, R);
                });
              }), o.pluck = function(i, f) {
                return o.map(i, o.property(f));
              }, o.where = function(i, f) {
                return o.filter(i, o.matcher(f));
              }, o.findWhere = function(i, f) {
                return o.find(i, o.matcher(f));
              }, o.max = function(i, f, R) {
                var z = -1 / 0, se = -1 / 0, ue, ye;
                if (f == null || typeof f == "number" && typeof i[0] != "object" && i != null) {
                  i = ce(i) ? i : o.values(i);
                  for (var N = 0, c = i.length; N < c; N++)
                    ue = i[N], ue != null && ue > z && (z = ue);
                } else
                  f = v(f, R), o.each(i, function(J, oe, Be) {
                    ye = f(J, oe, Be), (ye > se || ye === -1 / 0 && z === -1 / 0) && (z = J, se = ye);
                  });
                return z;
              }, o.min = function(i, f, R) {
                var z = 1 / 0, se = 1 / 0, ue, ye;
                if (f == null || typeof f == "number" && typeof i[0] != "object" && i != null) {
                  i = ce(i) ? i : o.values(i);
                  for (var N = 0, c = i.length; N < c; N++)
                    ue = i[N], ue != null && ue < z && (z = ue);
                } else
                  f = v(f, R), o.each(i, function(J, oe, Be) {
                    ye = f(J, oe, Be), (ye < se || ye === 1 / 0 && z === 1 / 0) && (z = J, se = ye);
                  });
                return z;
              }, o.shuffle = function(i) {
                return o.sample(i, 1 / 0);
              }, o.sample = function(i, f, R) {
                if (f == null || R)
                  return ce(i) || (i = o.values(i)), i[o.random(i.length - 1)];
                var z = ce(i) ? o.clone(i) : o.values(i), se = ge(z);
                f = Math.max(Math.min(f, se), 0);
                for (var ue = se - 1, ye = 0; ye < f; ye++) {
                  var N = o.random(ye, ue), c = z[ye];
                  z[ye] = z[N], z[N] = c;
                }
                return z.slice(0, f);
              }, o.sortBy = function(i, f, R) {
                var z = 0;
                return f = v(f, R), o.pluck(o.map(i, function(se, ue, ye) {
                  return {
                    value: se,
                    index: z++,
                    criteria: f(se, ue, ye)
                  };
                }).sort(function(se, ue) {
                  var ye = se.criteria, N = ue.criteria;
                  if (ye !== N) {
                    if (ye > N || ye === void 0)
                      return 1;
                    if (ye < N || N === void 0)
                      return -1;
                  }
                  return se.index - ue.index;
                }), "value");
              };
              var fe = function(i, f) {
                return function(R, z, se) {
                  var ue = f ? [[], []] : {};
                  return z = v(z, se), o.each(R, function(ye, N) {
                    var c = z(ye, N, R);
                    i(ue, ye, c);
                  }), ue;
                };
              };
              o.groupBy = fe(function(i, f, R) {
                b(i, R) ? i[R].push(f) : i[R] = [f];
              }), o.indexBy = fe(function(i, f, R) {
                i[R] = f;
              }), o.countBy = fe(function(i, f, R) {
                b(i, R) ? i[R]++ : i[R] = 1;
              });
              var Ce = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
              o.toArray = function(i) {
                return i ? o.isArray(i) ? m.call(i) : o.isString(i) ? i.match(Ce) : ce(i) ? o.map(i, o.identity) : o.values(i) : [];
              }, o.size = function(i) {
                return i == null ? 0 : ce(i) ? i.length : o.keys(i).length;
              }, o.partition = fe(function(i, f, R) {
                i[R ? 0 : 1].push(f);
              }, !0), o.first = o.head = o.take = function(i, f, R) {
                return i == null || i.length < 1 ? f == null ? void 0 : [] : f == null || R ? i[0] : o.initial(i, i.length - f);
              }, o.initial = function(i, f, R) {
                return m.call(i, 0, Math.max(0, i.length - (f == null || R ? 1 : f)));
              }, o.last = function(i, f, R) {
                return i == null || i.length < 1 ? f == null ? void 0 : [] : f == null || R ? i[i.length - 1] : o.rest(i, Math.max(0, i.length - f));
              }, o.rest = o.tail = o.drop = function(i, f, R) {
                return m.call(i, f == null || R ? 1 : f);
              }, o.compact = function(i) {
                return o.filter(i, Boolean);
              };
              var he = function(i, f, R, z) {
                z = z || [];
                for (var se = z.length, ue = 0, ye = ge(i); ue < ye; ue++) {
                  var N = i[ue];
                  if (ce(N) && (o.isArray(N) || o.isArguments(N)))
                    if (f)
                      for (var c = 0, J = N.length; c < J; )
                        z[se++] = N[c++];
                    else
                      he(N, f, R, z), se = z.length;
                  else
                    R || (z[se++] = N);
                }
                return z;
              };
              o.flatten = function(i, f) {
                return he(i, f, !1);
              }, o.without = T(function(i, f) {
                return o.difference(i, f);
              }), o.uniq = o.unique = function(i, f, R, z) {
                o.isBoolean(f) || (z = R, R = f, f = !1), R != null && (R = v(R, z));
                for (var se = [], ue = [], ye = 0, N = ge(i); ye < N; ye++) {
                  var c = i[ye], J = R ? R(c, ye, i) : c;
                  f && !R ? ((!ye || ue !== J) && se.push(c), ue = J) : R ? o.contains(ue, J) || (ue.push(J), se.push(c)) : o.contains(se, c) || se.push(c);
                }
                return se;
              }, o.union = T(function(i) {
                return o.uniq(he(i, !0, !0));
              }), o.intersection = function(i) {
                for (var f = [], R = arguments.length, z = 0, se = ge(i); z < se; z++) {
                  var ue = i[z];
                  if (!o.contains(f, ue)) {
                    var ye;
                    for (ye = 1; ye < R && o.contains(arguments[ye], ue); ye++)
                      ;
                    ye === R && f.push(ue);
                  }
                }
                return f;
              }, o.difference = T(function(i, f) {
                return f = he(f, !0, !0), o.filter(i, function(R) {
                  return !o.contains(f, R);
                });
              }), o.unzip = function(i) {
                for (var f = i && o.max(i, ge).length || 0, R = Array(f), z = 0; z < f; z++)
                  R[z] = o.pluck(i, z);
                return R;
              }, o.zip = T(o.unzip), o.object = function(i, f) {
                for (var R = {}, z = 0, se = ge(i); z < se; z++)
                  f ? R[i[z]] = f[z] : R[i[z][0]] = i[z][1];
                return R;
              };
              var le = function(i) {
                return function(f, R, z) {
                  R = v(R, z);
                  for (var se = ge(f), ue = i > 0 ? 0 : se - 1; ue >= 0 && ue < se; ue += i)
                    if (R(f[ue], ue, f))
                      return ue;
                  return -1;
                };
              };
              o.findIndex = le(1), o.findLastIndex = le(-1), o.sortedIndex = function(i, f, R, z) {
                R = v(R, z, 1);
                for (var se = R(f), ue = 0, ye = ge(i); ue < ye; ) {
                  var N = Math.floor((ue + ye) / 2);
                  R(i[N]) < se ? ue = N + 1 : ye = N;
                }
                return ue;
              };
              var G = function(i, f, R) {
                return function(z, se, ue) {
                  var ye = 0, N = ge(z);
                  if (typeof ue == "number")
                    i > 0 ? ye = ue >= 0 ? ue : Math.max(ue + N, ye) : N = ue >= 0 ? Math.min(ue + 1, N) : ue + N + 1;
                  else if (R && ue && N)
                    return ue = R(z, se), z[ue] === se ? ue : -1;
                  if (se !== se)
                    return ue = f(m.call(z, ye, N), o.isNaN), ue >= 0 ? ue + ye : -1;
                  for (ue = i > 0 ? ye : N - 1; ue >= 0 && ue < N; ue += i)
                    if (z[ue] === se)
                      return ue;
                  return -1;
                };
              };
              o.indexOf = G(1, o.findIndex, o.sortedIndex), o.lastIndexOf = G(-1, o.findLastIndex), o.range = function(i, f, R) {
                f == null && (f = i || 0, i = 0), R || (R = f < i ? -1 : 1);
                for (var z = Math.max(Math.ceil((f - i) / R), 0), se = Array(z), ue = 0; ue < z; ue++, i += R)
                  se[ue] = i;
                return se;
              }, o.chunk = function(i, f) {
                if (f == null || f < 1)
                  return [];
                for (var R = [], z = 0, se = i.length; z < se; )
                  R.push(m.call(i, z, z += f));
                return R;
              };
              var P = function(i, f, R, z, se) {
                if (!(z instanceof f))
                  return i.apply(R, se);
                var ue = n(i.prototype), ye = i.apply(ue, se);
                return o.isObject(ye) ? ye : ue;
              };
              o.bind = T(function(i, f, R) {
                if (!o.isFunction(i))
                  throw new TypeError("Bind must be called on a function");
                var z = T(function(se) {
                  return P(i, z, f, this, R.concat(se));
                });
                return z;
              }), o.partial = T(function(i, f) {
                var R = o.partial.placeholder, z = function() {
                  for (var se = 0, ue = f.length, ye = Array(ue), N = 0; N < ue; N++)
                    ye[N] = f[N] === R ? arguments[se++] : f[N];
                  for (; se < arguments.length; )
                    ye.push(arguments[se++]);
                  return P(i, z, this, this, ye);
                };
                return z;
              }), o.partial.placeholder = o, o.bindAll = T(function(i, f) {
                f = he(f, !1, !1);
                var R = f.length;
                if (R < 1)
                  throw new Error("bindAll must be passed function names");
                for (; R--; ) {
                  var z = f[R];
                  i[z] = o.bind(i[z], i);
                }
              }), o.memoize = function(i, f) {
                var R = function(z) {
                  var se = R.cache, ue = "" + (f ? f.apply(this, arguments) : z);
                  return b(se, ue) || (se[ue] = i.apply(this, arguments)), se[ue];
                };
                return R.cache = {}, R;
              }, o.delay = T(function(i, f, R) {
                return setTimeout(function() {
                  return i.apply(null, R);
                }, f);
              }), o.defer = o.partial(o.delay, o, 1), o.throttle = function(i, f, R) {
                var z, se, ue, ye, N = 0;
                R || (R = {});
                var c = function() {
                  N = R.leading === !1 ? 0 : o.now(), z = null, ye = i.apply(se, ue), z || (se = ue = null);
                }, J = function() {
                  var oe = o.now();
                  !N && R.leading === !1 && (N = oe);
                  var Be = f - (oe - N);
                  return se = this, ue = arguments, Be <= 0 || Be > f ? (z && (clearTimeout(z), z = null), N = oe, ye = i.apply(se, ue), z || (se = ue = null)) : !z && R.trailing !== !1 && (z = setTimeout(c, Be)), ye;
                };
                return J.cancel = function() {
                  clearTimeout(z), N = 0, z = se = ue = null;
                }, J;
              }, o.debounce = function(i, f, R) {
                var z, se, ue = function(N, c) {
                  z = null, c && (se = i.apply(N, c));
                }, ye = T(function(N) {
                  if (z && clearTimeout(z), R) {
                    var c = !z;
                    z = setTimeout(ue, f), c && (se = i.apply(this, N));
                  } else
                    z = o.delay(ue, f, this, N);
                  return se;
                });
                return ye.cancel = function() {
                  clearTimeout(z), z = null;
                }, ye;
              }, o.wrap = function(i, f) {
                return o.partial(f, i);
              }, o.negate = function(i) {
                return function() {
                  return !i.apply(this, arguments);
                };
              }, o.compose = function() {
                var i = arguments, f = i.length - 1;
                return function() {
                  for (var R = f, z = i[f].apply(this, arguments); R--; )
                    z = i[R].call(this, z);
                  return z;
                };
              }, o.after = function(i, f) {
                return function() {
                  if (--i < 1)
                    return f.apply(this, arguments);
                };
              }, o.before = function(i, f) {
                var R;
                return function() {
                  return --i > 0 && (R = f.apply(this, arguments)), i <= 1 && (f = null), R;
                };
              }, o.once = o.partial(o.before, 2), o.restArguments = T;
              var $ = !{ toString: null }.propertyIsEnumerable("toString"), E = [
                "valueOf",
                "isPrototypeOf",
                "toString",
                "propertyIsEnumerable",
                "hasOwnProperty",
                "toLocaleString"
              ], V = function(i, f) {
                var R = E.length, z = i.constructor, se = o.isFunction(z) && z.prototype || M, ue = "constructor";
                for (b(i, ue) && !o.contains(f, ue) && f.push(ue); R--; )
                  ue = E[R], ue in i && i[ue] !== se[ue] && !o.contains(f, ue) && f.push(ue);
              };
              o.keys = function(i) {
                if (!o.isObject(i))
                  return [];
                if (k)
                  return k(i);
                var f = [];
                for (var R in i)
                  b(i, R) && f.push(R);
                return $ && V(i, f), f;
              }, o.allKeys = function(i) {
                if (!o.isObject(i))
                  return [];
                var f = [];
                for (var R in i)
                  f.push(R);
                return $ && V(i, f), f;
              }, o.values = function(i) {
                for (var f = o.keys(i), R = f.length, z = Array(R), se = 0; se < R; se++)
                  z[se] = i[f[se]];
                return z;
              }, o.mapObject = function(i, f, R) {
                f = v(f, R);
                for (var z = o.keys(i), se = z.length, ue = {}, ye = 0; ye < se; ye++) {
                  var N = z[ye];
                  ue[N] = f(i[N], N, i);
                }
                return ue;
              }, o.pairs = function(i) {
                for (var f = o.keys(i), R = f.length, z = Array(R), se = 0; se < R; se++)
                  z[se] = [f[se], i[f[se]]];
                return z;
              }, o.invert = function(i) {
                for (var f = {}, R = o.keys(i), z = 0, se = R.length; z < se; z++)
                  f[i[R[z]]] = R[z];
                return f;
              }, o.functions = o.methods = function(i) {
                var f = [];
                for (var R in i)
                  o.isFunction(i[R]) && f.push(R);
                return f.sort();
              };
              var ie = function(i, f) {
                return function(R) {
                  var z = arguments.length;
                  if (f && (R = Object(R)), z < 2 || R == null)
                    return R;
                  for (var se = 1; se < z; se++)
                    for (var ue = arguments[se], ye = i(ue), N = ye.length, c = 0; c < N; c++) {
                      var J = ye[c];
                      (!f || R[J] === void 0) && (R[J] = ue[J]);
                    }
                  return R;
                };
              };
              o.extend = ie(o.allKeys), o.extendOwn = o.assign = ie(o.keys), o.findKey = function(i, f, R) {
                f = v(f, R);
                for (var z = o.keys(i), se, ue = 0, ye = z.length; ue < ye; ue++)
                  if (se = z[ue], f(i[se], se, i))
                    return se;
              };
              var ae = function(i, f, R) {
                return f in R;
              };
              o.pick = T(function(i, f) {
                var R = {}, z = f[0];
                if (i == null)
                  return R;
                o.isFunction(z) ? (f.length > 1 && (z = W(z, f[1])), f = o.allKeys(i)) : (z = ae, f = he(f, !1, !1), i = Object(i));
                for (var se = 0, ue = f.length; se < ue; se++) {
                  var ye = f[se], N = i[ye];
                  z(N, ye, i) && (R[ye] = N);
                }
                return R;
              }), o.omit = T(function(i, f) {
                var R = f[0], z;
                return o.isFunction(R) ? (R = o.negate(R), f.length > 1 && (z = f[1])) : (f = o.map(he(f, !1, !1), String), R = function(se, ue) {
                  return !o.contains(f, ue);
                }), o.pick(i, R, z);
              }), o.defaults = ie(o.allKeys, !0), o.create = function(i, f) {
                var R = n(i);
                return f && o.extendOwn(R, f), R;
              }, o.clone = function(i) {
                return o.isObject(i) ? o.isArray(i) ? i.slice() : o.extend({}, i) : i;
              }, o.tap = function(i, f) {
                return f(i), i;
              }, o.isMatch = function(i, f) {
                var R = o.keys(f), z = R.length;
                if (i == null)
                  return !z;
                for (var se = Object(i), ue = 0; ue < z; ue++) {
                  var ye = R[ue];
                  if (f[ye] !== se[ye] || !(ye in se))
                    return !1;
                }
                return !0;
              };
              var K, s;
              K = function(i, f, R, z) {
                if (i === f)
                  return i !== 0 || 1 / i === 1 / f;
                if (i == null || f == null)
                  return !1;
                if (i !== i)
                  return f !== f;
                var se = typeof i;
                return se !== "function" && se !== "object" && typeof f != "object" ? !1 : s(i, f, R, z);
              }, s = function(i, f, R, z) {
                i instanceof o && (i = i._wrapped), f instanceof o && (f = f._wrapped);
                var se = D.call(i);
                if (se !== D.call(f))
                  return !1;
                switch (se) {
                  case "[object RegExp]":
                  case "[object String]":
                    return "" + i == "" + f;
                  case "[object Number]":
                    return +i != +i ? +f != +f : +i == 0 ? 1 / +i === 1 / f : +i == +f;
                  case "[object Date]":
                  case "[object Boolean]":
                    return +i == +f;
                  case "[object Symbol]":
                    return h.valueOf.call(i) === h.valueOf.call(f);
                }
                var ue = se === "[object Array]";
                if (!ue) {
                  if (typeof i != "object" || typeof f != "object")
                    return !1;
                  var ye = i.constructor, N = f.constructor;
                  if (ye !== N && !(o.isFunction(ye) && ye instanceof ye && o.isFunction(N) && N instanceof N) && "constructor" in i && "constructor" in f)
                    return !1;
                }
                R = R || [], z = z || [];
                for (var c = R.length; c--; )
                  if (R[c] === i)
                    return z[c] === f;
                if (R.push(i), z.push(f), ue) {
                  if (c = i.length, c !== f.length)
                    return !1;
                  for (; c--; )
                    if (!K(i[c], f[c], R, z))
                      return !1;
                } else {
                  var J = o.keys(i), oe;
                  if (c = J.length, o.keys(f).length !== c)
                    return !1;
                  for (; c--; )
                    if (oe = J[c], !(b(f, oe) && K(i[oe], f[oe], R, z)))
                      return !1;
                }
                return R.pop(), z.pop(), !0;
              }, o.isEqual = function(i, f) {
                return K(i, f);
              }, o.isEmpty = function(i) {
                return i == null ? !0 : ce(i) && (o.isArray(i) || o.isString(i) || o.isArguments(i)) ? i.length === 0 : o.keys(i).length === 0;
              }, o.isElement = function(i) {
                return !!(i && i.nodeType === 1);
              }, o.isArray = B || function(i) {
                return D.call(i) === "[object Array]";
              }, o.isObject = function(i) {
                var f = typeof i;
                return f === "function" || f === "object" && !!i;
              }, o.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error", "Symbol", "Map", "WeakMap", "Set", "WeakSet"], function(i) {
                o["is" + i] = function(f) {
                  return D.call(f) === "[object " + i + "]";
                };
              }), o.isArguments(arguments) || (o.isArguments = function(i) {
                return b(i, "callee");
              });
              var g = j.document && j.document.childNodes;
              typeof Int8Array != "object" && typeof g != "function" && (o.isFunction = function(i) {
                return typeof i == "function" || !1;
              }), o.isFinite = function(i) {
                return !o.isSymbol(i) && isFinite(i) && !isNaN(parseFloat(i));
              }, o.isNaN = function(i) {
                return o.isNumber(i) && isNaN(i);
              }, o.isBoolean = function(i) {
                return i === !0 || i === !1 || D.call(i) === "[object Boolean]";
              }, o.isNull = function(i) {
                return i === null;
              }, o.isUndefined = function(i) {
                return i === void 0;
              }, o.has = function(i, f) {
                if (!o.isArray(f))
                  return b(i, f);
                for (var R = f.length, z = 0; z < R; z++) {
                  var se = f[z];
                  if (i == null || !H.call(i, se))
                    return !1;
                  i = i[se];
                }
                return !!R;
              }, o.noConflict = function() {
                return j._ = t, this;
              }, o.identity = function(i) {
                return i;
              }, o.constant = function(i) {
                return function() {
                  return i;
                };
              }, o.noop = function() {
              }, o.property = function(i) {
                return o.isArray(i) ? function(f) {
                  return C(f, i);
                } : r(i);
              }, o.propertyOf = function(i) {
                return i == null ? function() {
                } : function(f) {
                  return o.isArray(f) ? C(i, f) : i[f];
                };
              }, o.matcher = o.matches = function(i) {
                return i = o.extendOwn({}, i), function(f) {
                  return o.isMatch(f, i);
                };
              }, o.times = function(i, f, R) {
                var z = Array(Math.max(0, i));
                f = W(f, R, 1);
                for (var se = 0; se < i; se++)
                  z[se] = f(se);
                return z;
              }, o.random = function(i, f) {
                return f == null && (f = i, i = 0), i + Math.floor(Math.random() * (f - i + 1));
              }, o.now = Date.now || function() {
                return (/* @__PURE__ */ new Date()).getTime();
              };
              var U = {
                "&": "&amp;",
                "<": "&lt;",
                ">": "&gt;",
                '"': "&quot;",
                "'": "&#x27;",
                "`": "&#x60;"
              }, Y = o.invert(U), p = function(i) {
                var f = function(ue) {
                  return i[ue];
                }, R = "(?:" + o.keys(i).join("|") + ")", z = RegExp(R), se = RegExp(R, "g");
                return function(ue) {
                  return ue = ue == null ? "" : "" + ue, z.test(ue) ? ue.replace(se, f) : ue;
                };
              };
              o.escape = p(U), o.unescape = p(Y), o.result = function(i, f, R) {
                o.isArray(f) || (f = [f]);
                var z = f.length;
                if (!z)
                  return o.isFunction(R) ? R.call(i) : R;
                for (var se = 0; se < z; se++) {
                  var ue = i == null ? void 0 : i[f[se]];
                  ue === void 0 && (ue = R, se = z), i = o.isFunction(ue) ? ue.call(i) : ue;
                }
                return i;
              };
              var w = 0;
              o.uniqueId = function(i) {
                var f = ++w + "";
                return i ? i + f : f;
              }, o.templateSettings = {
                evaluate: /<%([\s\S]+?)%>/g,
                interpolate: /<%=([\s\S]+?)%>/g,
                escape: /<%-([\s\S]+?)%>/g
              };
              var u = /(.)^/, Z = {
                "'": "'",
                "\\": "\\",
                "\r": "r",
                "\n": "n",
                "\u2028": "u2028",
                "\u2029": "u2029"
              }, re = /\\|'|\r|\n|\u2028|\u2029/g, de = function(i) {
                return "\\" + Z[i];
              };
              o.template = function(i, f, R) {
                !f && R && (f = R), f = o.defaults({}, f, o.templateSettings);
                var z = RegExp([
                  (f.escape || u).source,
                  (f.interpolate || u).source,
                  (f.evaluate || u).source
                ].join("|") + "|$", "g"), se = 0, ue = "__p+='";
                i.replace(z, function(J, oe, Be, Ye, We) {
                  return ue += i.slice(se, We).replace(re, de), se = We + J.length, oe ? ue += `'+
((__t=(` + oe + `))==null?'':_.escape(__t))+
'` : Be ? ue += `'+
((__t=(` + Be + `))==null?'':__t)+
'` : Ye && (ue += `';
` + Ye + `
__p+='`), J;
                }), ue += `';
`, f.variable || (ue = `with(obj||{}){
` + ue + `}
`), ue = `var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
` + ue + `return __p;
`;
                var ye;
                try {
                  ye = new Function(f.variable || "obj", "_", ue);
                } catch (J) {
                  throw J.source = ue, J;
                }
                var N = function(J) {
                  return ye.call(this, J, o);
                }, c = f.variable || "obj";
                return N.source = "function(" + c + `){
` + ue + "}", N;
              }, o.chain = function(i) {
                var f = o(i);
                return f._chain = !0, f;
              };
              var be = function(i, f) {
                return i._chain ? o(f).chain() : f;
              };
              o.mixin = function(i) {
                return o.each(o.functions(i), function(f) {
                  var R = o[f] = i[f];
                  o.prototype[f] = function() {
                    var z = [this._wrapped];
                    return x.apply(z, arguments), be(this, R.apply(o, z));
                  };
                }), o;
              }, o.mixin(o), o.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(i) {
                var f = F[i];
                o.prototype[i] = function() {
                  var R = this._wrapped;
                  return f.apply(R, arguments), (i === "shift" || i === "splice") && R.length === 0 && delete R[0], be(this, R);
                };
              }), o.each(["concat", "join", "slice"], function(i) {
                var f = F[i];
                o.prototype[i] = function() {
                  return be(this, f.apply(this._wrapped, arguments));
                };
              }), o.prototype.value = function() {
                return this._wrapped;
              }, o.prototype.valueOf = o.prototype.toJSON = o.prototype.value, o.prototype.toString = function() {
                return String(this._wrapped);
              }, q = [], ee = (function() {
                return o;
              }).apply(O, q), ee !== void 0 && (X.exports = ee);
            })();
          }).call(this, d(22), d(23)(Te));
        },
        /* 5 */
        /***/
        function(Te, O, d) {
          d.r(O), d.d(O, "h", function() {
            return j;
          }), d.d(O, "createElement", function() {
            return j;
          }), d.d(O, "cloneElement", function() {
            return h;
          }), d.d(O, "createRef", function() {
            return ae;
          }), d.d(O, "Component", function() {
            return V;
          }), d.d(O, "render", function() {
            return ie;
          }), d.d(O, "rerender", function() {
            return H;
          }), d.d(O, "options", function() {
            return X;
          });
          var a = function() {
          }, X = {}, q = [], ee = [];
          function j(s, g) {
            var U = ee, Y, p, w, u;
            for (u = arguments.length; u-- > 2; )
              q.push(arguments[u]);
            for (g && g.children != null && (q.length || q.push(g.children), delete g.children); q.length; )
              if ((p = q.pop()) && p.pop !== void 0)
                for (u = p.length; u--; )
                  q.push(p[u]);
              else
                typeof p == "boolean" && (p = null), (w = typeof s != "function") && (p == null ? p = "" : typeof p == "number" ? p = String(p) : typeof p != "string" && (w = !1)), w && Y ? U[U.length - 1] += p : U === ee ? U = [p] : U.push(p), Y = w;
            var Z = new a();
            return Z.nodeName = s, Z.children = U, Z.attributes = g ?? void 0, Z.key = g == null ? void 0 : g.key, X.vnode !== void 0 && X.vnode(Z), Z;
          }
          function t(s, g) {
            for (var U in g)
              s[U] = g[U];
            return s;
          }
          function F(s, g) {
            s != null && (typeof s == "function" ? s(g) : s.current = g);
          }
          var M = typeof Promise == "function" ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;
          function h(s, g) {
            return j(s.nodeName, t(t({}, s.attributes), g), arguments.length > 2 ? [].slice.call(arguments, 2) : s.children);
          }
          var x = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i, m = [];
          function D(s) {
            !s._dirty && (s._dirty = !0) && m.push(s) == 1 && (X.debounceRendering || M)(H);
          }
          function H() {
            for (var s; s = m.pop(); )
              s._dirty && P(s);
          }
          function B(s, g, U) {
            return typeof g == "string" || typeof g == "number" ? s.splitText !== void 0 : typeof g.nodeName == "string" ? !s._componentConstructor && k(s, g.nodeName) : U || s._componentConstructor === g.nodeName;
          }
          function k(s, g) {
            return s.normalizedNodeName === g || s.nodeName.toLowerCase() === g.toLowerCase();
          }
          function _(s) {
            var g = t({}, s.attributes);
            g.children = s.children;
            var U = s.nodeName.defaultProps;
            if (U !== void 0)
              for (var Y in U)
                g[Y] === void 0 && (g[Y] = U[Y]);
            return g;
          }
          function Q(s, g) {
            var U = g ? document.createElementNS("http://www.w3.org/2000/svg", s) : document.createElement(s);
            return U.normalizedNodeName = s, U;
          }
          function o(s) {
            var g = s.parentNode;
            g && g.removeChild(s);
          }
          function W(s, g, U, Y, p) {
            if (g === "className" && (g = "class"), g !== "key")
              if (g === "ref")
                F(U, null), F(Y, s);
              else if (g === "class" && !p)
                s.className = Y || "";
              else if (g === "style") {
                if ((!Y || typeof Y == "string" || typeof U == "string") && (s.style.cssText = Y || ""), Y && typeof Y == "object") {
                  if (typeof U != "string")
                    for (var w in U)
                      w in Y || (s.style[w] = "");
                  for (var w in Y)
                    s.style[w] = typeof Y[w] == "number" && x.test(w) === !1 ? Y[w] + "px" : Y[w];
                }
              } else if (g === "dangerouslySetInnerHTML")
                Y && (s.innerHTML = Y.__html || "");
              else if (g[0] == "o" && g[1] == "n") {
                var u = g !== (g = g.replace(/Capture$/, ""));
                g = g.toLowerCase().substring(2), Y ? U || s.addEventListener(g, y, u) : s.removeEventListener(g, y, u), (s._listeners || (s._listeners = {}))[g] = Y;
              } else if (g !== "list" && g !== "type" && !p && g in s) {
                try {
                  s[g] = Y ?? "";
                } catch {
                }
                (Y == null || Y === !1) && g != "spellcheck" && s.removeAttribute(g);
              } else {
                var Z = p && g !== (g = g.replace(/^xlink:?/, ""));
                Y == null || Y === !1 ? Z ? s.removeAttributeNS("http://www.w3.org/1999/xlink", g.toLowerCase()) : s.removeAttribute(g) : typeof Y != "function" && (Z ? s.setAttributeNS("http://www.w3.org/1999/xlink", g.toLowerCase(), Y) : s.setAttribute(g, Y));
              }
          }
          function y(s) {
            return this._listeners[s.type](X.event && X.event(s) || s);
          }
          var v = [], T = 0, n = !1, r = !1;
          function b() {
            for (var s; s = v.shift(); )
              X.afterMount && X.afterMount(s), s.componentDidMount && s.componentDidMount();
          }
          function C(s, g, U, Y, p, w) {
            T++ || (n = p != null && p.ownerSVGElement !== void 0, r = s != null && !("__preactattr_" in s));
            var u = ne(s, g, U, Y, w);
            return p && u.parentNode !== p && p.appendChild(u), --T || (r = !1, w || b()), u;
          }
          function ne(s, g, U, Y, p) {
            var w = s, u = n;
            if ((g == null || typeof g == "boolean") && (g = ""), typeof g == "string" || typeof g == "number")
              return s && s.splitText !== void 0 && s.parentNode && (!s._component || p) ? s.nodeValue != g && (s.nodeValue = g) : (w = document.createTextNode(g), s && (s.parentNode && s.parentNode.replaceChild(w, s), ce(s, !0))), w.__preactattr_ = !0, w;
            var Z = g.nodeName;
            if (typeof Z == "function")
              return $(s, g, U, Y);
            if (n = Z === "svg" ? !0 : Z === "foreignObject" ? !1 : n, Z = String(Z), (!s || !k(s, Z)) && (w = Q(Z, n), s)) {
              for (; s.firstChild; )
                w.appendChild(s.firstChild);
              s.parentNode && s.parentNode.replaceChild(w, s), ce(s, !0);
            }
            var re = w.firstChild, de = w.__preactattr_, be = g.children;
            if (de == null) {
              de = w.__preactattr_ = {};
              for (var i = w.attributes, f = i.length; f--; )
                de[i[f].name] = i[f].value;
            }
            return !r && be && be.length === 1 && typeof be[0] == "string" && re != null && re.splitText !== void 0 && re.nextSibling == null ? re.nodeValue != be[0] && (re.nodeValue = be[0]) : (be && be.length || re != null) && ge(w, be, U, Y, r || de.dangerouslySetInnerHTML != null), fe(w, g.attributes, de), n = u, w;
          }
          function ge(s, g, U, Y, p) {
            var w = s.childNodes, u = [], Z = {}, re = 0, de = 0, be = w.length, i = 0, f = g ? g.length : 0, R, z, se, ue, ye;
            if (be !== 0)
              for (var N = 0; N < be; N++) {
                var c = w[N], J = c.__preactattr_, oe = f && J ? c._component ? c._component.__key : J.key : null;
                oe != null ? (re++, Z[oe] = c) : (J || (c.splitText !== void 0 ? !p || c.nodeValue.trim() : p)) && (u[i++] = c);
              }
            if (f !== 0)
              for (var N = 0; N < f; N++) {
                ue = g[N], ye = null;
                var oe = ue.key;
                if (oe != null)
                  re && Z[oe] !== void 0 && (ye = Z[oe], Z[oe] = void 0, re--);
                else if (de < i) {
                  for (R = de; R < i; R++)
                    if (u[R] !== void 0 && B(z = u[R], ue, p)) {
                      ye = z, u[R] = void 0, R === i - 1 && i--, R === de && de++;
                      break;
                    }
                }
                ye = ne(ye, ue, U, Y), se = w[N], ye && ye !== s && ye !== se && (se == null ? s.appendChild(ye) : ye === se.nextSibling ? o(se) : s.insertBefore(ye, se));
              }
            if (re)
              for (var N in Z)
                Z[N] !== void 0 && ce(Z[N], !1);
            for (; de <= i; )
              (ye = u[i--]) !== void 0 && ce(ye, !1);
          }
          function ce(s, g) {
            var U = s._component;
            U ? E(U) : (s.__preactattr_ != null && F(s.__preactattr_.ref, null), (g === !1 || s.__preactattr_ == null) && o(s), xe(s));
          }
          function xe(s) {
            for (s = s.lastChild; s; ) {
              var g = s.previousSibling;
              ce(s, !0), s = g;
            }
          }
          function fe(s, g, U) {
            var Y;
            for (Y in U)
              !(g && g[Y] != null) && U[Y] != null && W(s, Y, U[Y], U[Y] = void 0, n);
            for (Y in g)
              Y !== "children" && Y !== "innerHTML" && (!(Y in U) || g[Y] !== (Y === "value" || Y === "checked" ? s[Y] : U[Y])) && W(s, Y, U[Y], U[Y] = g[Y], n);
          }
          var Ce = [];
          function he(s, g, U) {
            var Y, p = Ce.length;
            for (s.prototype && s.prototype.render ? (Y = new s(g, U), V.call(Y, g, U)) : (Y = new V(g, U), Y.constructor = s, Y.render = le); p--; )
              if (Ce[p].constructor === s)
                return Y.nextBase = Ce[p].nextBase, Ce.splice(p, 1), Y;
            return Y;
          }
          function le(s, g, U) {
            return this.constructor(s, U);
          }
          function G(s, g, U, Y, p) {
            s._disable || (s._disable = !0, s.__ref = g.ref, s.__key = g.key, delete g.ref, delete g.key, typeof s.constructor.getDerivedStateFromProps > "u" && (!s.base || p ? s.componentWillMount && s.componentWillMount() : s.componentWillReceiveProps && s.componentWillReceiveProps(g, Y)), Y && Y !== s.context && (s.prevContext || (s.prevContext = s.context), s.context = Y), s.prevProps || (s.prevProps = s.props), s.props = g, s._disable = !1, U !== 0 && (U === 1 || X.syncComponentUpdates !== !1 || !s.base ? P(s, 1, p) : D(s)), F(s.__ref, s));
          }
          function P(s, g, U, Y) {
            if (!s._disable) {
              var p = s.props, w = s.state, u = s.context, Z = s.prevProps || p, re = s.prevState || w, de = s.prevContext || u, be = s.base, i = s.nextBase, f = be || i, R = s._component, z = !1, se = de, ue, ye, N;
              if (s.constructor.getDerivedStateFromProps && (w = t(t({}, w), s.constructor.getDerivedStateFromProps(p, w)), s.state = w), be && (s.props = Z, s.state = re, s.context = de, g !== 2 && s.shouldComponentUpdate && s.shouldComponentUpdate(p, w, u) === !1 ? z = !0 : s.componentWillUpdate && s.componentWillUpdate(p, w, u), s.props = p, s.state = w, s.context = u), s.prevProps = s.prevState = s.prevContext = s.nextBase = null, s._dirty = !1, !z) {
                ue = s.render(p, w, u), s.getChildContext && (u = t(t({}, u), s.getChildContext())), be && s.getSnapshotBeforeUpdate && (se = s.getSnapshotBeforeUpdate(Z, re));
                var c = ue && ue.nodeName, J, oe;
                if (typeof c == "function") {
                  var Be = _(ue);
                  ye = R, ye && ye.constructor === c && Be.key == ye.__key ? G(ye, Be, 1, u, !1) : (J = ye, s._component = ye = he(c, Be, u), ye.nextBase = ye.nextBase || i, ye._parentComponent = s, G(ye, Be, 0, u, !1), P(ye, 1, U, !0)), oe = ye.base;
                } else
                  N = f, J = R, J && (N = s._component = null), (f || g === 1) && (N && (N._component = null), oe = C(N, ue, u, U || !be, f && f.parentNode, !0));
                if (f && oe !== f && ye !== R) {
                  var Ye = f.parentNode;
                  Ye && oe !== Ye && (Ye.replaceChild(oe, f), J || (f._component = null, ce(f, !1)));
                }
                if (J && E(J), s.base = oe, oe && !Y) {
                  for (var We = s, Ke = s; Ke = Ke._parentComponent; )
                    (We = Ke).base = oe;
                  oe._component = We, oe._componentConstructor = We.constructor;
                }
              }
              for (!be || U ? v.push(s) : z || (s.componentDidUpdate && s.componentDidUpdate(Z, re, se), X.afterUpdate && X.afterUpdate(s)); s._renderCallbacks.length; )
                s._renderCallbacks.pop().call(s);
              !T && !Y && b();
            }
          }
          function $(s, g, U, Y) {
            for (var p = s && s._component, w = p, u = s, Z = p && s._componentConstructor === g.nodeName, re = Z, de = _(g); p && !re && (p = p._parentComponent); )
              re = p.constructor === g.nodeName;
            return p && re && (!Y || p._component) ? (G(p, de, 3, U, Y), s = p.base) : (w && !Z && (E(w), s = u = null), p = he(g.nodeName, de, U), s && !p.nextBase && (p.nextBase = s, u = null), G(p, de, 1, U, Y), s = p.base, u && s !== u && (u._component = null, ce(u, !1))), s;
          }
          function E(s) {
            X.beforeUnmount && X.beforeUnmount(s);
            var g = s.base;
            s._disable = !0, s.componentWillUnmount && s.componentWillUnmount(), s.base = null;
            var U = s._component;
            U ? E(U) : g && (g.__preactattr_ != null && F(g.__preactattr_.ref, null), s.nextBase = g, o(g), Ce.push(s), xe(g)), F(s.__ref, null);
          }
          function V(s, g) {
            this._dirty = !0, this.context = g, this.props = s, this.state = this.state || {}, this._renderCallbacks = [];
          }
          t(V.prototype, {
            setState: function(g, U) {
              this.prevState || (this.prevState = this.state), this.state = t(t({}, this.state), typeof g == "function" ? g(this.state, this.props) : g), U && this._renderCallbacks.push(U), D(this);
            },
            forceUpdate: function(g) {
              g && this._renderCallbacks.push(g), P(this, 2);
            },
            render: function() {
            }
          });
          function ie(s, g, U) {
            return C(U, s, {}, !1, g, !1);
          }
          function ae() {
            return {};
          }
          var K = {
            h: j,
            createElement: j,
            cloneElement: h,
            createRef: ae,
            Component: V,
            render: ie,
            rerender: H,
            options: X
          };
          O.default = K;
        },
        /* 6 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = function(n, r) {
            if ((b = (n = r ? n.toExponential(r - 1) : n.toExponential()).indexOf("e")) < 0)
              return null;
            var b, C = n.slice(0, b);
            return [
              C.length > 1 ? C[0] + C.slice(2) : C,
              +n.slice(b + 1)
            ];
          }, X = function(n) {
            return n = a(Math.abs(n)), n ? n[1] : NaN;
          }, q = function(n, r) {
            return function(b, C) {
              for (var ne = b.length, ge = [], ce = 0, xe = n[0], fe = 0; ne > 0 && xe > 0 && (fe + xe + 1 > C && (xe = Math.max(1, C - fe)), ge.push(b.substring(ne -= xe, ne + xe)), !((fe += xe + 1) > C)); )
                xe = n[ce = (ce + 1) % n.length];
              return ge.reverse().join(r);
            };
          }, ee = function(n) {
            return function(r) {
              return r.replace(/[0-9]/g, function(b) {
                return n[+b];
              });
            };
          }, j = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
          function t(n) {
            return new F(n);
          }
          t.prototype = F.prototype;
          function F(n) {
            if (!(r = j.exec(n)))
              throw new Error("invalid format: " + n);
            var r;
            this.fill = r[1] || " ", this.align = r[2] || ">", this.sign = r[3] || "-", this.symbol = r[4] || "", this.zero = !!r[5], this.width = r[6] && +r[6], this.comma = !!r[7], this.precision = r[8] && +r[8].slice(1), this.trim = !!r[9], this.type = r[10] || "";
          }
          F.prototype.toString = function() {
            return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width == null ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
          };
          var M = function(n) {
            e:
              for (var r = n.length, b = 1, C = -1, ne; b < r; ++b)
                switch (n[b]) {
                  case ".":
                    C = ne = b;
                    break;
                  case "0":
                    C === 0 && (C = b), ne = b;
                    break;
                  default:
                    if (C > 0) {
                      if (!+n[b])
                        break e;
                      C = 0;
                    }
                    break;
                }
            return C > 0 ? n.slice(0, C) + n.slice(ne + 1) : n;
          }, h, x = function(n, r) {
            var b = a(n, r);
            if (!b)
              return n + "";
            var C = b[0], ne = b[1], ge = ne - (h = Math.max(-8, Math.min(8, Math.floor(ne / 3))) * 3) + 1, ce = C.length;
            return ge === ce ? C : ge > ce ? C + new Array(ge - ce + 1).join("0") : ge > 0 ? C.slice(0, ge) + "." + C.slice(ge) : "0." + new Array(1 - ge).join("0") + a(n, Math.max(0, r + ge - 1))[0];
          }, m = function(n, r) {
            var b = a(n, r);
            if (!b)
              return n + "";
            var C = b[0], ne = b[1];
            return ne < 0 ? "0." + new Array(-ne).join("0") + C : C.length > ne + 1 ? C.slice(0, ne + 1) + "." + C.slice(ne + 1) : C + new Array(ne - C.length + 2).join("0");
          }, D = {
            "%": function(n, r) {
              return (n * 100).toFixed(r);
            },
            b: function(n) {
              return Math.round(n).toString(2);
            },
            c: function(n) {
              return n + "";
            },
            d: function(n) {
              return Math.round(n).toString(10);
            },
            e: function(n, r) {
              return n.toExponential(r);
            },
            f: function(n, r) {
              return n.toFixed(r);
            },
            g: function(n, r) {
              return n.toPrecision(r);
            },
            o: function(n) {
              return Math.round(n).toString(8);
            },
            p: function(n, r) {
              return m(n * 100, r);
            },
            r: m,
            s: x,
            X: function(n) {
              return Math.round(n).toString(16).toUpperCase();
            },
            x: function(n) {
              return Math.round(n).toString(16);
            }
          }, H = function(n) {
            return n;
          }, B = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"], k = function(n) {
            var r = n.grouping && n.thousands ? q(n.grouping, n.thousands) : H, b = n.currency, C = n.decimal, ne = n.numerals ? ee(n.numerals) : H, ge = n.percent || "%";
            function ce(fe) {
              fe = t(fe);
              var Ce = fe.fill, he = fe.align, le = fe.sign, G = fe.symbol, P = fe.zero, $ = fe.width, E = fe.comma, V = fe.precision, ie = fe.trim, ae = fe.type;
              ae === "n" ? (E = !0, ae = "g") : D[ae] || (V == null && (V = 12), ie = !0, ae = "g"), (P || Ce === "0" && he === "=") && (P = !0, Ce = "0", he = "=");
              var K = G === "$" ? b[0] : G === "#" && /[boxX]/.test(ae) ? "0" + ae.toLowerCase() : "", s = G === "$" ? b[1] : /[%p]/.test(ae) ? ge : "", g = D[ae], U = /[defgprs%]/.test(ae);
              V = V == null ? 6 : /[gprs]/.test(ae) ? Math.max(1, Math.min(21, V)) : Math.max(0, Math.min(20, V));
              function Y(p) {
                var w = K, u = s, Z, re, de;
                if (ae === "c")
                  u = g(p) + u, p = "";
                else {
                  p = +p;
                  var be = p < 0;
                  if (p = g(Math.abs(p), V), ie && (p = M(p)), be && +p == 0 && (be = !1), w = (be ? le === "(" ? le : "-" : le === "-" || le === "(" ? "" : le) + w, u = (ae === "s" ? B[8 + h / 3] : "") + u + (be && le === "(" ? ")" : ""), U) {
                    for (Z = -1, re = p.length; ++Z < re; )
                      if (de = p.charCodeAt(Z), 48 > de || de > 57) {
                        u = (de === 46 ? C + p.slice(Z + 1) : p.slice(Z)) + u, p = p.slice(0, Z);
                        break;
                      }
                  }
                }
                E && !P && (p = r(p, 1 / 0));
                var i = w.length + p.length + u.length, f = i < $ ? new Array($ - i + 1).join(Ce) : "";
                switch (E && P && (p = r(f + p, f.length ? $ - u.length : 1 / 0), f = ""), he) {
                  case "<":
                    p = w + p + u + f;
                    break;
                  case "=":
                    p = w + f + p + u;
                    break;
                  case "^":
                    p = f.slice(0, i = f.length >> 1) + w + p + u + f.slice(i);
                    break;
                  default:
                    p = f + w + p + u;
                    break;
                }
                return ne(p);
              }
              return Y.toString = function() {
                return fe + "";
              }, Y;
            }
            function xe(fe, Ce) {
              var he = ce((fe = t(fe), fe.type = "f", fe)), le = Math.max(-8, Math.min(8, Math.floor(X(Ce) / 3))) * 3, G = Math.pow(10, -le), P = B[8 + le / 3];
              return function($) {
                return he(G * $) + P;
              };
            }
            return {
              format: ce,
              formatPrefix: xe
            };
          }, _, Q, o;
          W({
            decimal: ".",
            thousands: ",",
            grouping: [3],
            currency: ["$", ""]
          });
          function W(n) {
            return _ = k(n), Q = _.format, o = _.formatPrefix, _;
          }
          var y = function(n) {
            return Math.max(0, -X(Math.abs(n)));
          }, v = function(n, r) {
            return Math.max(0, Math.max(-8, Math.min(8, Math.floor(X(r) / 3))) * 3 - X(Math.abs(n)));
          }, T = function(n, r) {
            return n = Math.abs(n), r = Math.abs(r) - n, Math.max(0, X(r) - X(n)) + 1;
          };
          d.d(O, "formatDefaultLocale", function() {
            return W;
          }), d.d(O, "format", function() {
            return Q;
          }), d.d(O, "formatPrefix", function() {
            return o;
          }), d.d(O, "formatLocale", function() {
            return k;
          }), d.d(O, "formatSpecifier", function() {
            return t;
          }), d.d(O, "precisionFixed", function() {
            return y;
          }), d.d(O, "precisionPrefix", function() {
            return v;
          }), d.d(O, "precisionRound", function() {
            return T;
          });
        },
        /* 7 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = d(8), X = d(0);
          function q() {
            X.event.stopImmediatePropagation();
          }
          var ee = function() {
            X.event.preventDefault(), X.event.stopImmediatePropagation();
          }, j = function(B) {
            var k = B.document.documentElement, _ = Object(X.select)(B).on("dragstart.drag", ee, !0);
            "onselectstart" in k ? _.on("selectstart.drag", ee, !0) : (k.__noselect = k.style.MozUserSelect, k.style.MozUserSelect = "none");
          };
          function t(B, k) {
            var _ = B.document.documentElement, Q = Object(X.select)(B).on("dragstart.drag", null);
            k && (Q.on("click.drag", ee, !0), setTimeout(function() {
              Q.on("click.drag", null);
            }, 0)), "onselectstart" in _ ? Q.on("selectstart.drag", null) : (_.style.MozUserSelect = _.__noselect, delete _.__noselect);
          }
          var F = function(B) {
            return function() {
              return B;
            };
          };
          function M(B, k, _, Q, o, W, y, v, T, n) {
            this.target = B, this.type = k, this.subject = _, this.identifier = Q, this.active = o, this.x = W, this.y = y, this.dx = v, this.dy = T, this._ = n;
          }
          M.prototype.on = function() {
            var B = this._.on.apply(this._, arguments);
            return B === this._ ? this : B;
          };
          function h() {
            return !X.event.button;
          }
          function x() {
            return this.parentNode;
          }
          function m(B) {
            return B ?? { x: X.event.x, y: X.event.y };
          }
          function D() {
            return "ontouchstart" in this;
          }
          var H = function() {
            var B = h, k = x, _ = m, Q = D, o = {}, W = Object(a.a)("start", "drag", "end"), y = 0, v, T, n, r, b = 0;
            function C(le) {
              le.on("mousedown.drag", ne).filter(Q).on("touchstart.drag", xe).on("touchmove.drag", fe).on("touchend.drag touchcancel.drag", Ce).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
            }
            function ne() {
              if (!(r || !B.apply(this, arguments))) {
                var le = he("mouse", k.apply(this, arguments), X.mouse, this, arguments);
                le && (Object(X.select)(X.event.view).on("mousemove.drag", ge, !0).on("mouseup.drag", ce, !0), j(X.event.view), q(), n = !1, v = X.event.clientX, T = X.event.clientY, le("start"));
              }
            }
            function ge() {
              if (ee(), !n) {
                var le = X.event.clientX - v, G = X.event.clientY - T;
                n = le * le + G * G > b;
              }
              o.mouse("drag");
            }
            function ce() {
              Object(X.select)(X.event.view).on("mousemove.drag mouseup.drag", null), t(X.event.view, n), ee(), o.mouse("end");
            }
            function xe() {
              if (B.apply(this, arguments)) {
                var le = X.event.changedTouches, G = k.apply(this, arguments), P = le.length, $, E;
                for ($ = 0; $ < P; ++$)
                  (E = he(le[$].identifier, G, X.touch, this, arguments)) && (q(), E("start"));
              }
            }
            function fe() {
              var le = X.event.changedTouches, G = le.length, P, $;
              for (P = 0; P < G; ++P)
                ($ = o[le[P].identifier]) && (ee(), $("drag"));
            }
            function Ce() {
              var le = X.event.changedTouches, G = le.length, P, $;
              for (r && clearTimeout(r), r = setTimeout(function() {
                r = null;
              }, 500), P = 0; P < G; ++P)
                ($ = o[le[P].identifier]) && (q(), $("end"));
            }
            function he(le, G, P, $, E) {
              var V = P(G, le), ie, ae, K, s = W.copy();
              if (Object(X.customEvent)(new M(C, "beforestart", ie, le, y, V[0], V[1], 0, 0, s), function() {
                return (X.event.subject = ie = _.apply($, E)) == null ? !1 : (ae = ie.x - V[0] || 0, K = ie.y - V[1] || 0, !0);
              }))
                return function g(U) {
                  var Y = V, p;
                  switch (U) {
                    case "start":
                      o[le] = g, p = y++;
                      break;
                    case "end":
                      delete o[le], --y;
                    case "drag":
                      V = P(G, le), p = y;
                      break;
                  }
                  Object(X.customEvent)(new M(C, U, ie, le, p, V[0] + ae, V[1] + K, V[0] - Y[0], V[1] - Y[1], s), s.apply, s, [U, $, E]);
                };
            }
            return C.filter = function(le) {
              return arguments.length ? (B = typeof le == "function" ? le : F(!!le), C) : B;
            }, C.container = function(le) {
              return arguments.length ? (k = typeof le == "function" ? le : F(le), C) : k;
            }, C.subject = function(le) {
              return arguments.length ? (_ = typeof le == "function" ? le : F(le), C) : _;
            }, C.touchable = function(le) {
              return arguments.length ? (Q = typeof le == "function" ? le : F(!!le), C) : Q;
            }, C.on = function() {
              var le = W.on.apply(W, arguments);
              return le === W ? C : le;
            }, C.clickDistance = function(le) {
              return arguments.length ? (b = (le = +le) * le, C) : Math.sqrt(b);
            }, C;
          };
          d.d(O, "drag", function() {
            return H;
          }), d.d(O, "dragDisable", function() {
            return j;
          }), d.d(O, "dragEnable", function() {
            return t;
          });
        },
        /* 8 */
        /***/
        function(Te, O, d) {
          var a = { value: function() {
          } };
          function X() {
            for (var M = 0, h = arguments.length, x = {}, m; M < h; ++M) {
              if (!(m = arguments[M] + "") || m in x)
                throw new Error("illegal type: " + m);
              x[m] = [];
            }
            return new q(x);
          }
          function q(M) {
            this._ = M;
          }
          function ee(M, h) {
            return M.trim().split(/^|\s+/).map(function(x) {
              var m = "", D = x.indexOf(".");
              if (D >= 0 && (m = x.slice(D + 1), x = x.slice(0, D)), x && !h.hasOwnProperty(x))
                throw new Error("unknown type: " + x);
              return { type: x, name: m };
            });
          }
          q.prototype = X.prototype = {
            constructor: q,
            on: function(M, h) {
              var x = this._, m = ee(M + "", x), D, H = -1, B = m.length;
              if (arguments.length < 2) {
                for (; ++H < B; )
                  if ((D = (M = m[H]).type) && (D = j(x[D], M.name)))
                    return D;
                return;
              }
              if (h != null && typeof h != "function")
                throw new Error("invalid callback: " + h);
              for (; ++H < B; )
                if (D = (M = m[H]).type)
                  x[D] = t(x[D], M.name, h);
                else if (h == null)
                  for (D in x)
                    x[D] = t(x[D], M.name, null);
              return this;
            },
            copy: function() {
              var M = {}, h = this._;
              for (var x in h)
                M[x] = h[x].slice();
              return new q(M);
            },
            call: function(M, h) {
              if ((D = arguments.length - 2) > 0)
                for (var x = new Array(D), m = 0, D, H; m < D; ++m)
                  x[m] = arguments[m + 2];
              if (!this._.hasOwnProperty(M))
                throw new Error("unknown type: " + M);
              for (H = this._[M], m = 0, D = H.length; m < D; ++m)
                H[m].value.apply(h, x);
            },
            apply: function(M, h, x) {
              if (!this._.hasOwnProperty(M))
                throw new Error("unknown type: " + M);
              for (var m = this._[M], D = 0, H = m.length; D < H; ++D)
                m[D].value.apply(h, x);
            }
          };
          function j(M, h) {
            for (var x = 0, m = M.length, D; x < m; ++x)
              if ((D = M[x]).name === h)
                return D.value;
          }
          function t(M, h, x) {
            for (var m = 0, D = M.length; m < D; ++m)
              if (M[m].name === h) {
                M[m] = a, M = M.slice(0, m).concat(M.slice(m + 1));
                break;
              }
            return x != null && M.push({ name: h, value: x }), M;
          }
          var F = X;
          d.d(O, "a", function() {
            return F;
          });
        },
        /* 9 */
        /***/
        function(Te, O, d) {
          Te.exports = function(q) {
            var ee = [];
            return ee.toString = function() {
              return this.map(function(t) {
                var F = a(t, q);
                return t[2] ? "@media ".concat(t[2], "{").concat(F, "}") : F;
              }).join("");
            }, ee.i = function(j, t) {
              typeof j == "string" && (j = [[null, j, ""]]);
              for (var F = {}, M = 0; M < this.length; M++) {
                var h = this[M][0];
                h != null && (F[h] = !0);
              }
              for (var x = 0; x < j.length; x++) {
                var m = j[x];
                (m[0] == null || !F[m[0]]) && (t && !m[2] ? m[2] = t : t && (m[2] = "(".concat(m[2], ") and (").concat(t, ")")), ee.push(m));
              }
            }, ee;
          };
          function a(q, ee) {
            var j = q[1] || "", t = q[3];
            if (!t)
              return j;
            if (ee && typeof btoa == "function") {
              var F = X(t), M = t.sources.map(function(h) {
                return "/*# sourceURL=".concat(t.sourceRoot).concat(h, " */");
              });
              return [j].concat(M).concat([F]).join(`
`);
            }
            return [j].join(`
`);
          }
          function X(q) {
            var ee = btoa(unescape(encodeURIComponent(JSON.stringify(q)))), j = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(ee);
            return "/*# ".concat(j, " */");
          }
        },
        /* 10 */
        /***/
        function(Te, O, d) {
          var a = {}, X = function(n) {
            var r;
            return function() {
              return typeof r > "u" && (r = n.apply(this, arguments)), r;
            };
          }, q = X(function() {
            return window && document && document.all && !window.atob;
          }), ee = function(n, r) {
            return r ? r.querySelector(n) : document.querySelector(n);
          }, j = /* @__PURE__ */ function(n) {
            var r = {};
            return function(b, C) {
              if (typeof b == "function")
                return b();
              if (typeof r[b] > "u") {
                var ne = ee.call(this, b, C);
                if (window.HTMLIFrameElement && ne instanceof window.HTMLIFrameElement)
                  try {
                    ne = ne.contentDocument.head;
                  } catch {
                    ne = null;
                  }
                r[b] = ne;
              }
              return r[b];
            };
          }(), t = null, F = 0, M = [], h = d(54);
          Te.exports = function(n, r) {
            if (typeof DEBUG < "u" && DEBUG && typeof document != "object")
              throw new Error("The style-loader cannot be used in a non-browser environment");
            r = r || {}, r.attrs = typeof r.attrs == "object" ? r.attrs : {}, !r.singleton && typeof r.singleton != "boolean" && (r.singleton = q()), r.insertInto || (r.insertInto = "head"), r.insertAt || (r.insertAt = "bottom");
            var b = m(n, r);
            return x(b, r), function(ne) {
              for (var ge = [], ce = 0; ce < b.length; ce++) {
                var xe = b[ce], fe = a[xe.id];
                fe.refs--, ge.push(fe);
              }
              if (ne) {
                var Ce = m(ne, r);
                x(Ce, r);
              }
              for (var ce = 0; ce < ge.length; ce++) {
                var fe = ge[ce];
                if (fe.refs === 0) {
                  for (var he = 0; he < fe.parts.length; he++)
                    fe.parts[he]();
                  delete a[fe.id];
                }
              }
            };
          };
          function x(n, r) {
            for (var b = 0; b < n.length; b++) {
              var C = n[b], ne = a[C.id];
              if (ne) {
                ne.refs++;
                for (var ge = 0; ge < ne.parts.length; ge++)
                  ne.parts[ge](C.parts[ge]);
                for (; ge < C.parts.length; ge++)
                  ne.parts.push(o(C.parts[ge], r));
              } else {
                for (var ce = [], ge = 0; ge < C.parts.length; ge++)
                  ce.push(o(C.parts[ge], r));
                a[C.id] = { id: C.id, refs: 1, parts: ce };
              }
            }
          }
          function m(n, r) {
            for (var b = [], C = {}, ne = 0; ne < n.length; ne++) {
              var ge = n[ne], ce = r.base ? ge[0] + r.base : ge[0], xe = ge[1], fe = ge[2], Ce = ge[3], he = { css: xe, media: fe, sourceMap: Ce };
              C[ce] ? C[ce].parts.push(he) : b.push(C[ce] = { id: ce, parts: [he] });
            }
            return b;
          }
          function D(n, r) {
            var b = j(n.insertInto);
            if (!b)
              throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
            var C = M[M.length - 1];
            if (n.insertAt === "top")
              C ? C.nextSibling ? b.insertBefore(r, C.nextSibling) : b.appendChild(r) : b.insertBefore(r, b.firstChild), M.push(r);
            else if (n.insertAt === "bottom")
              b.appendChild(r);
            else if (typeof n.insertAt == "object" && n.insertAt.before) {
              var ne = j(n.insertAt.before, b);
              b.insertBefore(r, ne);
            } else
              throw new Error(`[Style Loader]

 Invalid value for parameter 'insertAt' ('options.insertAt') found.
 Must be 'top', 'bottom', or Object.
 (https://github.com/webpack-contrib/style-loader#insertat)
`);
          }
          function H(n) {
            if (n.parentNode === null)
              return !1;
            n.parentNode.removeChild(n);
            var r = M.indexOf(n);
            r >= 0 && M.splice(r, 1);
          }
          function B(n) {
            var r = document.createElement("style");
            if (n.attrs.type === void 0 && (n.attrs.type = "text/css"), n.attrs.nonce === void 0) {
              var b = Q();
              b && (n.attrs.nonce = b);
            }
            return _(r, n.attrs), D(n, r), r;
          }
          function k(n) {
            var r = document.createElement("link");
            return n.attrs.type === void 0 && (n.attrs.type = "text/css"), n.attrs.rel = "stylesheet", _(r, n.attrs), D(n, r), r;
          }
          function _(n, r) {
            Object.keys(r).forEach(function(b) {
              n.setAttribute(b, r[b]);
            });
          }
          function Q() {
            return d.nc;
          }
          function o(n, r) {
            var b, C, ne, ge;
            if (r.transform && n.css)
              if (ge = typeof r.transform == "function" ? r.transform(n.css) : r.transform.default(n.css), ge)
                n.css = ge;
              else
                return function() {
                };
            if (r.singleton) {
              var ce = F++;
              b = t || (t = B(r)), C = y.bind(null, b, ce, !1), ne = y.bind(null, b, ce, !0);
            } else
              n.sourceMap && typeof URL == "function" && typeof URL.createObjectURL == "function" && typeof URL.revokeObjectURL == "function" && typeof Blob == "function" && typeof btoa == "function" ? (b = k(r), C = T.bind(null, b, r), ne = function() {
                H(b), b.href && URL.revokeObjectURL(b.href);
              }) : (b = B(r), C = v.bind(null, b), ne = function() {
                H(b);
              });
            return C(n), function(fe) {
              if (fe) {
                if (fe.css === n.css && fe.media === n.media && fe.sourceMap === n.sourceMap)
                  return;
                C(n = fe);
              } else
                ne();
            };
          }
          var W = /* @__PURE__ */ function() {
            var n = [];
            return function(r, b) {
              return n[r] = b, n.filter(Boolean).join(`
`);
            };
          }();
          function y(n, r, b, C) {
            var ne = b ? "" : C.css;
            if (n.styleSheet)
              n.styleSheet.cssText = W(r, ne);
            else {
              var ge = document.createTextNode(ne), ce = n.childNodes;
              ce[r] && n.removeChild(ce[r]), ce.length ? n.insertBefore(ge, ce[r]) : n.appendChild(ge);
            }
          }
          function v(n, r) {
            var b = r.css, C = r.media;
            if (C && n.setAttribute("media", C), n.styleSheet)
              n.styleSheet.cssText = b;
            else {
              for (; n.firstChild; )
                n.removeChild(n.firstChild);
              n.appendChild(document.createTextNode(b));
            }
          }
          function T(n, r, b) {
            var C = b.css, ne = b.sourceMap, ge = r.convertToAbsoluteUrls === void 0 && ne;
            (r.convertToAbsoluteUrls || ge) && (C = h(C)), ne && (C += `
/*# sourceMappingURL=data:application/json;base64,` + btoa(unescape(encodeURIComponent(JSON.stringify(ne)))) + " */");
            var ce = new Blob([C], { type: "text/css" }), xe = n.href;
            n.href = URL.createObjectURL(ce), xe && URL.revokeObjectURL(xe);
          }
        },
        /* 11 */
        /***/
        function(Te, O, d) {
          var a = d(0), X = d(8), q = 0, ee = 0, j = 0, t = 1e3, F, M, h = 0, x = 0, m = 0, D = typeof performance == "object" && performance.now ? performance : Date, H = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(Ae) {
            setTimeout(Ae, 17);
          };
          function B() {
            return x || (H(k), x = D.now() + m);
          }
          function k() {
            x = 0;
          }
          function _() {
            this._call = this._time = this._next = null;
          }
          _.prototype = Q.prototype = {
            constructor: _,
            restart: function(Ae, me, _e) {
              if (typeof Ae != "function")
                throw new TypeError("callback is not a function");
              _e = (_e == null ? B() : +_e) + (me == null ? 0 : +me), !this._next && M !== this && (M ? M._next = this : F = this, M = this), this._call = Ae, this._time = _e, T();
            },
            stop: function() {
              this._call && (this._call = null, this._time = 1 / 0, T());
            }
          };
          function Q(Ae, me, _e) {
            var Ee = new _();
            return Ee.restart(Ae, me, _e), Ee;
          }
          function o() {
            B(), ++q;
            for (var Ae = F, me; Ae; )
              (me = x - Ae._time) >= 0 && Ae._call.call(null, me), Ae = Ae._next;
            --q;
          }
          function W() {
            x = (h = D.now()) + m, q = ee = 0;
            try {
              o();
            } finally {
              q = 0, v(), x = 0;
            }
          }
          function y() {
            var Ae = D.now(), me = Ae - h;
            me > t && (m -= me, h = Ae);
          }
          function v() {
            for (var Ae, me = F, _e, Ee = 1 / 0; me; )
              me._call ? (Ee > me._time && (Ee = me._time), Ae = me, me = me._next) : (_e = me._next, me._next = null, me = Ae ? Ae._next = _e : F = _e);
            M = Ae, T(Ee);
          }
          function T(Ae) {
            if (!q) {
              ee && (ee = clearTimeout(ee));
              var me = Ae - x;
              me > 24 ? (Ae < 1 / 0 && (ee = setTimeout(W, Ae - D.now() - m)), j && (j = clearInterval(j))) : (j || (h = D.now(), j = setInterval(y, t)), q = 1, H(W));
            }
          }
          var n = function(Ae, me, _e) {
            var Ee = new _();
            return me = me == null ? 0 : +me, Ee.restart(function(Oe) {
              Ee.stop(), Ae(Oe + me);
            }, me, _e), Ee;
          }, r = Object(X.a)("start", "end", "cancel", "interrupt"), b = [], C = 0, ne = 1, ge = 2, ce = 3, xe = 4, fe = 5, Ce = 6, he = function(Ae, me, _e, Ee, Oe, ke) {
            var S = Ae.__transition;
            if (!S)
              Ae.__transition = {};
            else if (_e in S)
              return;
            $(Ae, _e, {
              name: me,
              index: Ee,
              // For context during callback.
              group: Oe,
              // For context during callback.
              on: r,
              tween: b,
              time: ke.time,
              delay: ke.delay,
              duration: ke.duration,
              ease: ke.ease,
              timer: null,
              state: C
            });
          };
          function le(Ae, me) {
            var _e = P(Ae, me);
            if (_e.state > C)
              throw new Error("too late; already scheduled");
            return _e;
          }
          function G(Ae, me) {
            var _e = P(Ae, me);
            if (_e.state > ce)
              throw new Error("too late; already running");
            return _e;
          }
          function P(Ae, me) {
            var _e = Ae.__transition;
            if (!_e || !(_e = _e[me]))
              throw new Error("transition not found");
            return _e;
          }
          function $(Ae, me, _e) {
            var Ee = Ae.__transition, Oe;
            Ee[me] = _e, _e.timer = Q(ke, 0, _e.time);
            function ke(Qe) {
              _e.state = ne, _e.timer.restart(S, _e.delay, _e.time), _e.delay <= Qe && S(Qe - _e.delay);
            }
            function S(Qe) {
              var Fe, Ge, He, Re;
              if (_e.state !== ne)
                return Ie();
              for (Fe in Ee)
                if (Re = Ee[Fe], Re.name === _e.name) {
                  if (Re.state === ce)
                    return n(S);
                  Re.state === xe ? (Re.state = Ce, Re.timer.stop(), Re.on.call("interrupt", Ae, Ae.__data__, Re.index, Re.group), delete Ee[Fe]) : +Fe < me && (Re.state = Ce, Re.timer.stop(), Re.on.call("cancel", Ae, Ae.__data__, Re.index, Re.group), delete Ee[Fe]);
                }
              if (n(function() {
                _e.state === ce && (_e.state = xe, _e.timer.restart(ve, _e.delay, _e.time), ve(Qe));
              }), _e.state = ge, _e.on.call("start", Ae, Ae.__data__, _e.index, _e.group), _e.state === ge) {
                for (_e.state = ce, Oe = new Array(He = _e.tween.length), Fe = 0, Ge = -1; Fe < He; ++Fe)
                  (Re = _e.tween[Fe].value.call(Ae, Ae.__data__, _e.index, _e.group)) && (Oe[++Ge] = Re);
                Oe.length = Ge + 1;
              }
            }
            function ve(Qe) {
              for (var Fe = Qe < _e.duration ? _e.ease.call(null, Qe / _e.duration) : (_e.timer.restart(Ie), _e.state = fe, 1), Ge = -1, He = Oe.length; ++Ge < He; )
                Oe[Ge].call(Ae, Fe);
              _e.state === fe && (_e.on.call("end", Ae, Ae.__data__, _e.index, _e.group), Ie());
            }
            function Ie() {
              _e.state = Ce, _e.timer.stop(), delete Ee[me];
              for (var Qe in Ee)
                return;
              delete Ae.__transition;
            }
          }
          var E = function(Ae, me) {
            var _e = Ae.__transition, Ee, Oe, ke = !0, S;
            if (_e) {
              me = me == null ? null : me + "";
              for (S in _e) {
                if ((Ee = _e[S]).name !== me) {
                  ke = !1;
                  continue;
                }
                Oe = Ee.state > ge && Ee.state < fe, Ee.state = Ce, Ee.timer.stop(), Ee.on.call(Oe ? "interrupt" : "cancel", Ae, Ae.__data__, Ee.index, Ee.group), delete _e[S];
              }
              ke && delete Ae.__transition;
            }
          }, V = function(Ae) {
            return this.each(function() {
              E(this, Ae);
            });
          }, ie = d(2);
          function ae(Ae, me) {
            var _e, Ee;
            return function() {
              var Oe = G(this, Ae), ke = Oe.tween;
              if (ke !== _e) {
                Ee = _e = ke;
                for (var S = 0, ve = Ee.length; S < ve; ++S)
                  if (Ee[S].name === me) {
                    Ee = Ee.slice(), Ee.splice(S, 1);
                    break;
                  }
              }
              Oe.tween = Ee;
            };
          }
          function K(Ae, me, _e) {
            var Ee, Oe;
            if (typeof _e != "function")
              throw new Error();
            return function() {
              var ke = G(this, Ae), S = ke.tween;
              if (S !== Ee) {
                Oe = (Ee = S).slice();
                for (var ve = { name: me, value: _e }, Ie = 0, Qe = Oe.length; Ie < Qe; ++Ie)
                  if (Oe[Ie].name === me) {
                    Oe[Ie] = ve;
                    break;
                  }
                Ie === Qe && Oe.push(ve);
              }
              ke.tween = Oe;
            };
          }
          var s = function(Ae, me) {
            var _e = this._id;
            if (Ae += "", arguments.length < 2) {
              for (var Ee = P(this.node(), _e).tween, Oe = 0, ke = Ee.length, S; Oe < ke; ++Oe)
                if ((S = Ee[Oe]).name === Ae)
                  return S.value;
              return null;
            }
            return this.each((me == null ? ae : K)(_e, Ae, me));
          };
          function g(Ae, me, _e) {
            var Ee = Ae._id;
            return Ae.each(function() {
              var Oe = G(this, Ee);
              (Oe.value || (Oe.value = {}))[me] = _e.apply(this, arguments);
            }), function(Oe) {
              return P(Oe, Ee).value[me];
            };
          }
          var U = d(1), Y = function(Ae, me) {
            var _e;
            return (typeof me == "number" ? ie.c : me instanceof U.a ? ie.d : (_e = Object(U.a)(me)) ? (me = _e, ie.d) : ie.f)(Ae, me);
          };
          function p(Ae) {
            return function() {
              this.removeAttribute(Ae);
            };
          }
          function w(Ae) {
            return function() {
              this.removeAttributeNS(Ae.space, Ae.local);
            };
          }
          function u(Ae, me, _e) {
            var Ee, Oe = _e + "", ke;
            return function() {
              var S = this.getAttribute(Ae);
              return S === Oe ? null : S === Ee ? ke : ke = me(Ee = S, _e);
            };
          }
          function Z(Ae, me, _e) {
            var Ee, Oe = _e + "", ke;
            return function() {
              var S = this.getAttributeNS(Ae.space, Ae.local);
              return S === Oe ? null : S === Ee ? ke : ke = me(Ee = S, _e);
            };
          }
          function re(Ae, me, _e) {
            var Ee, Oe, ke;
            return function() {
              var S, ve = _e(this), Ie;
              return ve == null ? void this.removeAttribute(Ae) : (S = this.getAttribute(Ae), Ie = ve + "", S === Ie ? null : S === Ee && Ie === Oe ? ke : (Oe = Ie, ke = me(Ee = S, ve)));
            };
          }
          function de(Ae, me, _e) {
            var Ee, Oe, ke;
            return function() {
              var S, ve = _e(this), Ie;
              return ve == null ? void this.removeAttributeNS(Ae.space, Ae.local) : (S = this.getAttributeNS(Ae.space, Ae.local), Ie = ve + "", S === Ie ? null : S === Ee && Ie === Oe ? ke : (Oe = Ie, ke = me(Ee = S, ve)));
            };
          }
          var be = function(Ae, me) {
            var _e = Object(a.namespace)(Ae), Ee = _e === "transform" ? ie.h : Y;
            return this.attrTween(Ae, typeof me == "function" ? (_e.local ? de : re)(_e, Ee, g(this, "attr." + Ae, me)) : me == null ? (_e.local ? w : p)(_e) : (_e.local ? Z : u)(_e, Ee, me));
          };
          function i(Ae, me) {
            return function(_e) {
              this.setAttribute(Ae, me(_e));
            };
          }
          function f(Ae, me) {
            return function(_e) {
              this.setAttributeNS(Ae.space, Ae.local, me(_e));
            };
          }
          function R(Ae, me) {
            var _e, Ee;
            function Oe() {
              var ke = me.apply(this, arguments);
              return ke !== Ee && (_e = (Ee = ke) && f(Ae, ke)), _e;
            }
            return Oe._value = me, Oe;
          }
          function z(Ae, me) {
            var _e, Ee;
            function Oe() {
              var ke = me.apply(this, arguments);
              return ke !== Ee && (_e = (Ee = ke) && i(Ae, ke)), _e;
            }
            return Oe._value = me, Oe;
          }
          var se = function(Ae, me) {
            var _e = "attr." + Ae;
            if (arguments.length < 2)
              return (_e = this.tween(_e)) && _e._value;
            if (me == null)
              return this.tween(_e, null);
            if (typeof me != "function")
              throw new Error();
            var Ee = Object(a.namespace)(Ae);
            return this.tween(_e, (Ee.local ? R : z)(Ee, me));
          };
          function ue(Ae, me) {
            return function() {
              le(this, Ae).delay = +me.apply(this, arguments);
            };
          }
          function ye(Ae, me) {
            return me = +me, function() {
              le(this, Ae).delay = me;
            };
          }
          var N = function(Ae) {
            var me = this._id;
            return arguments.length ? this.each((typeof Ae == "function" ? ue : ye)(me, Ae)) : P(this.node(), me).delay;
          };
          function c(Ae, me) {
            return function() {
              G(this, Ae).duration = +me.apply(this, arguments);
            };
          }
          function J(Ae, me) {
            return me = +me, function() {
              G(this, Ae).duration = me;
            };
          }
          var oe = function(Ae) {
            var me = this._id;
            return arguments.length ? this.each((typeof Ae == "function" ? c : J)(me, Ae)) : P(this.node(), me).duration;
          };
          function Be(Ae, me) {
            if (typeof me != "function")
              throw new Error();
            return function() {
              G(this, Ae).ease = me;
            };
          }
          var Ye = function(Ae) {
            var me = this._id;
            return arguments.length ? this.each(Be(me, Ae)) : P(this.node(), me).ease;
          }, We = function(Ae) {
            typeof Ae != "function" && (Ae = Object(a.matcher)(Ae));
            for (var me = this._groups, _e = me.length, Ee = new Array(_e), Oe = 0; Oe < _e; ++Oe)
              for (var ke = me[Oe], S = ke.length, ve = Ee[Oe] = [], Ie, Qe = 0; Qe < S; ++Qe)
                (Ie = ke[Qe]) && Ae.call(Ie, Ie.__data__, Qe, ke) && ve.push(Ie);
            return new ot(Ee, this._parents, this._name, this._id);
          }, Ke = function(Ae) {
            if (Ae._id !== this._id)
              throw new Error();
            for (var me = this._groups, _e = Ae._groups, Ee = me.length, Oe = _e.length, ke = Math.min(Ee, Oe), S = new Array(Ee), ve = 0; ve < ke; ++ve)
              for (var Ie = me[ve], Qe = _e[ve], Fe = Ie.length, Ge = S[ve] = new Array(Fe), He, Re = 0; Re < Fe; ++Re)
                (He = Ie[Re] || Qe[Re]) && (Ge[Re] = He);
            for (; ve < Ee; ++ve)
              S[ve] = me[ve];
            return new ot(S, this._parents, this._name, this._id);
          };
          function et(Ae) {
            return (Ae + "").trim().split(/^|\s+/).every(function(me) {
              var _e = me.indexOf(".");
              return _e >= 0 && (me = me.slice(0, _e)), !me || me === "start";
            });
          }
          function nt(Ae, me, _e) {
            var Ee, Oe, ke = et(me) ? le : G;
            return function() {
              var S = ke(this, Ae), ve = S.on;
              ve !== Ee && (Oe = (Ee = ve).copy()).on(me, _e), S.on = Oe;
            };
          }
          var pt = function(Ae, me) {
            var _e = this._id;
            return arguments.length < 2 ? P(this.node(), _e).on.on(Ae) : this.each(nt(_e, Ae, me));
          };
          function Et(Ae) {
            return function() {
              var me = this.parentNode;
              for (var _e in this.__transition)
                if (+_e !== Ae)
                  return;
              me && me.removeChild(this);
            };
          }
          var gt = function() {
            return this.on("end.remove", Et(this._id));
          }, bt = function(Ae) {
            var me = this._name, _e = this._id;
            typeof Ae != "function" && (Ae = Object(a.selector)(Ae));
            for (var Ee = this._groups, Oe = Ee.length, ke = new Array(Oe), S = 0; S < Oe; ++S)
              for (var ve = Ee[S], Ie = ve.length, Qe = ke[S] = new Array(Ie), Fe, Ge, He = 0; He < Ie; ++He)
                (Fe = ve[He]) && (Ge = Ae.call(Fe, Fe.__data__, He, ve)) && ("__data__" in Fe && (Ge.__data__ = Fe.__data__), Qe[He] = Ge, he(Qe[He], me, _e, He, Qe, P(Fe, _e)));
            return new ot(ke, this._parents, me, _e);
          }, Bt = function(Ae) {
            var me = this._name, _e = this._id;
            typeof Ae != "function" && (Ae = Object(a.selectorAll)(Ae));
            for (var Ee = this._groups, Oe = Ee.length, ke = [], S = [], ve = 0; ve < Oe; ++ve)
              for (var Ie = Ee[ve], Qe = Ie.length, Fe, Ge = 0; Ge < Qe; ++Ge)
                if (Fe = Ie[Ge]) {
                  for (var He = Ae.call(Fe, Fe.__data__, Ge, Ie), Re, Xe = P(Fe, _e), at = 0, dt = He.length; at < dt; ++at)
                    (Re = He[at]) && he(Re, me, _e, at, He, Xe);
                  ke.push(He), S.push(Fe);
                }
            return new ot(ke, S, me, _e);
          }, St = a.selection.prototype.constructor, Nt = function() {
            return new St(this._groups, this._parents);
          };
          function Wt(Ae, me) {
            var _e, Ee, Oe;
            return function() {
              var ke = Object(a.style)(this, Ae), S = (this.style.removeProperty(Ae), Object(a.style)(this, Ae));
              return ke === S ? null : ke === _e && S === Ee ? Oe : Oe = me(_e = ke, Ee = S);
            };
          }
          function Kt(Ae) {
            return function() {
              this.style.removeProperty(Ae);
            };
          }
          function Ot(Ae, me, _e) {
            var Ee, Oe = _e + "", ke;
            return function() {
              var S = Object(a.style)(this, Ae);
              return S === Oe ? null : S === Ee ? ke : ke = me(Ee = S, _e);
            };
          }
          function It(Ae, me, _e) {
            var Ee, Oe, ke;
            return function() {
              var S = Object(a.style)(this, Ae), ve = _e(this), Ie = ve + "";
              return ve == null && (Ie = ve = (this.style.removeProperty(Ae), Object(a.style)(this, Ae))), S === Ie ? null : S === Ee && Ie === Oe ? ke : (Oe = Ie, ke = me(Ee = S, ve));
            };
          }
          function e(Ae, me) {
            var _e, Ee, Oe, ke = "style." + me, S = "end." + ke, ve;
            return function() {
              var Ie = G(this, Ae), Qe = Ie.on, Fe = Ie.value[ke] == null ? ve || (ve = Kt(me)) : void 0;
              (Qe !== _e || Oe !== Fe) && (Ee = (_e = Qe).copy()).on(S, Oe = Fe), Ie.on = Ee;
            };
          }
          var A = function(Ae, me, _e) {
            var Ee = (Ae += "") == "transform" ? ie.g : Y;
            return me == null ? this.styleTween(Ae, Wt(Ae, Ee)).on("end.style." + Ae, Kt(Ae)) : typeof me == "function" ? this.styleTween(Ae, It(Ae, Ee, g(this, "style." + Ae, me))).each(e(this._id, Ae)) : this.styleTween(Ae, Ot(Ae, Ee, me), _e).on("end.style." + Ae, null);
          };
          function L(Ae, me, _e) {
            return function(Ee) {
              this.style.setProperty(Ae, me(Ee), _e);
            };
          }
          function te(Ae, me, _e) {
            var Ee, Oe;
            function ke() {
              var S = me.apply(this, arguments);
              return S !== Oe && (Ee = (Oe = S) && L(Ae, S, _e)), Ee;
            }
            return ke._value = me, ke;
          }
          var we = function(Ae, me, _e) {
            var Ee = "style." + (Ae += "");
            if (arguments.length < 2)
              return (Ee = this.tween(Ee)) && Ee._value;
            if (me == null)
              return this.tween(Ee, null);
            if (typeof me != "function")
              throw new Error();
            return this.tween(Ee, te(Ae, me, _e ?? ""));
          };
          function Ne(Ae) {
            return function() {
              this.textContent = Ae;
            };
          }
          function ze(Ae) {
            return function() {
              var me = Ae(this);
              this.textContent = me ?? "";
            };
          }
          var Ve = function(Ae) {
            return this.tween("text", typeof Ae == "function" ? ze(g(this, "text", Ae)) : Ne(Ae == null ? "" : Ae + ""));
          }, Ze = function() {
            for (var Ae = this._name, me = this._id, _e = ut(), Ee = this._groups, Oe = Ee.length, ke = 0; ke < Oe; ++ke)
              for (var S = Ee[ke], ve = S.length, Ie, Qe = 0; Qe < ve; ++Qe)
                if (Ie = S[Qe]) {
                  var Fe = P(Ie, me);
                  he(Ie, Ae, _e, Qe, S, {
                    time: Fe.time + Fe.delay + Fe.duration,
                    delay: 0,
                    duration: Fe.duration,
                    ease: Fe.ease
                  });
                }
            return new ot(Ee, this._parents, Ae, _e);
          }, Je = function() {
            var Ae, me, _e = this, Ee = _e._id, Oe = _e.size();
            return new Promise(function(ke, S) {
              var ve = { value: S }, Ie = { value: function() {
                --Oe === 0 && ke();
              } };
              _e.each(function() {
                var Qe = G(this, Ee), Fe = Qe.on;
                Fe !== Ae && (me = (Ae = Fe).copy(), me._.cancel.push(ve), me._.interrupt.push(ve), me._.end.push(Ie)), Qe.on = me;
              });
            });
          }, st = 0;
          function ot(Ae, me, _e, Ee) {
            this._groups = Ae, this._parents = me, this._name = _e, this._id = Ee;
          }
          function ut() {
            return ++st;
          }
          var mt = a.selection.prototype;
          ot.prototype = {
            constructor: ot,
            select: bt,
            selectAll: Bt,
            filter: We,
            merge: Ke,
            selection: Nt,
            transition: Ze,
            call: mt.call,
            nodes: mt.nodes,
            node: mt.node,
            size: mt.size,
            empty: mt.empty,
            each: mt.each,
            on: pt,
            attr: be,
            attrTween: se,
            style: A,
            styleTween: we,
            text: Ve,
            remove: gt,
            tween: s,
            delay: N,
            duration: oe,
            ease: Ye,
            end: Je
          };
          function qe(Ae) {
            return ((Ae *= 2) <= 1 ? Ae * Ae * Ae : (Ae -= 2) * Ae * Ae + 2) / 2;
          }
          var $e = 3;
          (function Ae(me) {
            me = +me;
            function _e(Ee) {
              return Math.pow(Ee, me);
            }
            return _e.exponent = Ae, _e;
          })($e), function Ae(me) {
            me = +me;
            function _e(Ee) {
              return 1 - Math.pow(1 - Ee, me);
            }
            return _e.exponent = Ae, _e;
          }($e), function Ae(me) {
            me = +me;
            function _e(Ee) {
              return ((Ee *= 2) <= 1 ? Math.pow(Ee, me) : 2 - Math.pow(2 - Ee, me)) / 2;
            }
            return _e.exponent = Ae, _e;
          }($e);
          var vt = 1.70158;
          (function Ae(me) {
            me = +me;
            function _e(Ee) {
              return Ee * Ee * ((me + 1) * Ee - me);
            }
            return _e.overshoot = Ae, _e;
          })(vt), function Ae(me) {
            me = +me;
            function _e(Ee) {
              return --Ee * Ee * ((me + 1) * Ee + me) + 1;
            }
            return _e.overshoot = Ae, _e;
          }(vt), function Ae(me) {
            me = +me;
            function _e(Ee) {
              return ((Ee *= 2) < 1 ? Ee * Ee * ((me + 1) * Ee - me) : (Ee -= 2) * Ee * ((me + 1) * Ee + me) + 2) / 2;
            }
            return _e.overshoot = Ae, _e;
          }(vt);
          var wt = 2 * Math.PI, rt = 1, lt = 0.3;
          (function Ae(me, _e) {
            var Ee = Math.asin(1 / (me = Math.max(1, me))) * (_e /= wt);
            function Oe(ke) {
              return me * Math.pow(2, 10 * --ke) * Math.sin((Ee - ke) / _e);
            }
            return Oe.amplitude = function(ke) {
              return Ae(ke, _e * wt);
            }, Oe.period = function(ke) {
              return Ae(me, ke);
            }, Oe;
          })(rt, lt), function Ae(me, _e) {
            var Ee = Math.asin(1 / (me = Math.max(1, me))) * (_e /= wt);
            function Oe(ke) {
              return 1 - me * Math.pow(2, -10 * (ke = +ke)) * Math.sin((ke + Ee) / _e);
            }
            return Oe.amplitude = function(ke) {
              return Ae(ke, _e * wt);
            }, Oe.period = function(ke) {
              return Ae(me, ke);
            }, Oe;
          }(rt, lt), function Ae(me, _e) {
            var Ee = Math.asin(1 / (me = Math.max(1, me))) * (_e /= wt);
            function Oe(ke) {
              return ((ke = ke * 2 - 1) < 0 ? me * Math.pow(2, 10 * ke) * Math.sin((Ee - ke) / _e) : 2 - me * Math.pow(2, -10 * ke) * Math.sin((Ee + ke) / _e)) / 2;
            }
            return Oe.amplitude = function(ke) {
              return Ae(ke, _e * wt);
            }, Oe.period = function(ke) {
              return Ae(me, ke);
            }, Oe;
          }(rt, lt);
          var ct = {
            time: null,
            // Set on use.
            delay: 0,
            duration: 250,
            ease: qe
          };
          function _t(Ae, me) {
            for (var _e; !(_e = Ae.__transition) || !(_e = _e[me]); )
              if (!(Ae = Ae.parentNode))
                return ct.time = B(), ct;
            return _e;
          }
          var xt = function(Ae) {
            var me, _e;
            Ae instanceof ot ? (me = Ae._id, Ae = Ae._name) : (me = ut(), (_e = ct).time = B(), Ae = Ae == null ? null : Ae + "");
            for (var Ee = this._groups, Oe = Ee.length, ke = 0; ke < Oe; ++ke)
              for (var S = Ee[ke], ve = S.length, Ie, Qe = 0; Qe < ve; ++Qe)
                (Ie = S[Qe]) && he(Ie, Ae, me, Qe, S, _e || _t(Ie, me));
            return new ot(Ee, this._parents, Ae, me);
          };
          a.selection.prototype.interrupt = V, a.selection.prototype.transition = xt, d.d(O, "a", function() {
            return E;
          });
        },
        /* 12 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0, O.importAndCheck = C, O.floatForData = ne, O.reverse_flux_for_data = ge, O.gene_string_for_data = ce, O.text_for_data = xe, O.csv_converter = fe, O.genes_for_gene_reaction_rule = Ce, O.evaluate_gene_reaction_rule = he, O.replace_gene_in_rule = le, O.apply_reaction_data_to_reactions = G, O.apply_metabolite_data_to_nodes = P, O.apply_gene_data_to_reactions = $;
          var a = d(3), X = F(a), q = d(4), ee = t(q), j = d(6);
          function t(E) {
            return E && E.__esModule ? E : { default: E };
          }
          function F(E) {
            if (E && E.__esModule)
              return E;
            var V = {};
            if (E != null)
              for (var ie in E)
                Object.prototype.hasOwnProperty.call(E, ie) && (V[ie] = E[ie]);
            return V.default = E, V;
          }
          var M = function(V) {
            return V;
          }, h = /([.*+?^=!:${}()|[\]/\\])/g, x = /\n\s*\n/g, m = /\n\s*(\)*)\s*$/, D = /([() ])(?:and|or)([)( ])/ig, H = /[()]/g, B = /\(\s*(\S+)\s*\)/g, k = /\s+or\s+/i, _ = /\s+and\s+/i, Q = /(^|\()(\s*-?[0-9.]+\s+(?:or\s+-?[0-9.]+\s*)+)(\)|$)/ig, o = /(^|\(|or\s)(\s*-?[0-9.]+\s+(?:and\s+-?[0-9.]+\s*)+)(\sor|\)|$)/ig;
          function W(E) {
            var V = Number(E);
            return isNaN(V) || parseFloat(E) !== V ? null : V;
          }
          function y(E, V) {
            var ie = {}, ae = [null];
            for (var K in E) {
              ae = E[K].map(function() {
                return null;
              });
              break;
            }
            var s = function(Y) {
              var p = V[Y], w = p.bigg_id, u = {};
              p.genes.forEach(function(Z) {
                ["bigg_id", "name"].forEach(function(re) {
                  var de = E[Z[re]] || X.clone(ae), be = u[Z.bigg_id];
                  if (be === void 0)
                    u[Z.bigg_id] = de;
                  else
                    for (var i = 0; i < de.length; i++) {
                      var f = de[i];
                      f !== null && (be[i] = f);
                    }
                });
              }), ie[w] = u;
            };
            for (var g in V)
              s(g);
            return ie;
          }
          function v(E) {
            return isFinite(E) ? E : null;
          }
          function T(E, V) {
            return V ? Math.abs(E) : E;
          }
          function n(E, V, ie) {
            return ie ? Math.abs(V - E) : V - E;
          }
          function r(E, V, ie) {
            if (E === 0 || V === 0)
              return null;
            var ae = V >= E ? V / E : -E / V;
            return ie ? Math.abs(ae) : ae;
          }
          function b(E, V, ie) {
            if (E === 0 || V / E < 0)
              return null;
            var ae = Math.log(V / E) / Math.log(2);
            return ie ? Math.abs(ae) : ae;
          }
          function C(E, V, ie) {
            if (!E)
              return null;
            if (["reaction_data", "metabolite_data", "gene_data"].indexOf(V) === -1)
              throw new Error("Invalid name argument: " + V);
            E instanceof Array || (E = [E]);
            var ae = function() {
              return E === null || E.length === 1 || E.length === 2 ? null : console.warn("Bad data style: " + V);
            };
            if (ae(), E = X.arrayToObject(E), V === "gene_data") {
              if (ie === void 0)
                throw new Error("Must pass all_reactions argument for gene_data");
              E = y(E, ie);
            }
            return E;
          }
          function ne(E, V, ie) {
            if (E === null)
              return null;
            var ae = V.indexOf("abs") !== -1;
            if (E.length === 1) {
              var K = W(E[0]);
              return K === null ? null : T(K, ae);
            } else if (E.length === 2) {
              var s = E.map(W);
              if (s[0] === null || s[1] === null)
                return null;
              if (ie === "diff")
                return n(s[0], s[1], ae);
              if (ie === "fold")
                return v(r(s[0], s[1], ae));
              if (ie === "log2_fold")
                return v(b(s[0], s[1], ae));
            } else
              throw new Error("Data array must be of length 1 or 2");
            throw new Error("Bad data compare_style: " + ie);
          }
          function ge(E) {
            return E === null || E[0] === null ? !1 : E[0] < 0;
          }
          function ce(E, V, ie, ae, K, s) {
            var g = E, U = V === null, Y = {};
            ie.forEach(function(u) {
              var Z = u.bigg_id;
              if (!(Z in Y))
                if (Y[Z] = !0, U)
                  g = le(g, Z, Z + `
`);
                else {
                  if (!(Z in V))
                    return;
                  var re = V[Z], de = ne(re, ae, s), be = de === null ? M : (0, j.format)(".3g");
                  if (re.length === 1)
                    g = le(g, Z, Z + " (" + w(re[0], be) + `)
`);
                  else if (re.length === 2) {
                    var i, f = ee.default.any(re, function(R) {
                      return W(R) !== null;
                    });
                    f ? i = Z + " (" + w(re[0], be) + ", " + w(re[1], be) + ": " + w(de, be) + `)
` : i = Z + " (" + w(re[0], be) + ", " + w(re[1], be) + `)
`, g = le(g, Z, i);
                  }
                }
            }), g = g.replace(x, `
`).replace(m, "$1");
            var p = g.split(`
`).map(function(u) {
              for (var Z = 0, re = ie.length; Z < re; Z++) {
                var de = ie[Z];
                if (u.indexOf(de.bigg_id) !== -1)
                  return K === "name" && (u = le(u, de.bigg_id, de.name)), { bigg_id: de.bigg_id, name: de.name, text: u };
              }
              return { bigg_id: null, name: null, text: u };
            });
            return p;
            function w(u, Z) {
              return u === null ? "nd" : Z(u);
            }
          }
          function xe(E, V) {
            if (E === null)
              return K(null);
            if (E.length === 1) {
              var ie = V === null ? M : (0, j.format)(".3g");
              return K(E[0], ie);
            }
            if (E.length === 2) {
              var ie = V === null ? M : (0, j.format)(".3g"), ae = K(E[0], ie);
              return ae += ", " + K(E[1], ie), ae += ": " + K(V, ie), ae;
            }
            return "";
            function K(s, g) {
              return s === null ? "(nd)" : g(s);
            }
          }
          function fe(E) {
            var V = E[0].length, ie = [];
            if (V < 2 || V > 3)
              throw new Error("CSV file must have 2 or 3 columns");
            for (var ae = 1; ae < V; ae++)
              ie[ae - 1] = {};
            return E.slice(1).forEach(function(K) {
              for (var s = 1, g = K.length; s < g; s++)
                ie[s - 1][K[0]] = K[s];
            }), ie;
          }
          function Ce(E) {
            var V = E.replace(D, "$1$2").replace(H, "").split(" ").filter(function(ie) {
              return ie != "";
            });
            return X.unique_strings_array(V);
          }
          function he(E, V, ie) {
            var ae = [null], K = 1;
            for (var s in V) {
              ae = V[s].map(function() {
                return null;
              }), K = ae.length;
              break;
            }
            if (E == "")
              return X.clone(ae);
            for (var g = [], U = 0; U < K; U++) {
              var Y = E, p = !0;
              for (var s in V) {
                var w = W(V[s][U]);
                w === null ? w = 0 : p = !1, Y = le(Y, s, w);
              }
              if (p) {
                g.push(null);
                continue;
              }
              for (; ; ) {
                var u = Y;
                if (u = u.replace(B, " $1 "), u = u.replace(Q, function(re, de, be, i) {
                  var f = be.split(k).map(parseFloat), R = f.reduce(function(z, se) {
                    return z + se;
                  });
                  return de + R + i;
                }), u = u.replace(o, function(re, de, be, i) {
                  var f = be.split(_).map(parseFloat), R = ie == "min" ? Math.min.apply(null, f) : f.reduce(function(z, se) {
                    return z + se;
                  }) / f.length;
                  return de + R + i;
                }), u == Y)
                  break;
                Y = u;
              }
              var Z = Number(Y);
              isNaN(Z) ? (console.warn("Could not evaluate " + E), g.push(null)) : g.push(Z);
            }
            return g;
          }
          function le(E, V, ie) {
            var ae = "(^|[\\s\\(\\)])", K = "([\\s\\(\\)]|$)", s = ae + g(V) + K;
            return E.replace(new RegExp(s, "g"), "$1" + ie + "$2");
            function g(U) {
              return U.replace(h, "\\$1");
            }
          }
          function G(E, V, ie, ae, K) {
            ee.default.isUndefined(K) && (K = Object.keys(E));
            var s, g, U;
            return V === null ? (K.map(function(Y) {
              s = E[Y], s.data = null, s.data_string = "";
              for (g in s.segments)
                U = s.segments[g], U.data = null;
              s.gene_string = null;
            }), !1) : (K.map(function(Y) {
              s = E[Y];
              var p = V[s.bigg_id] || V[s.name] || null, w = ne(p, ie, ae), u = ge(p), Z = xe(p, w);
              s.data = w, s.data_string = Z, s.reverse_flux = u, s.gene_string = null;
              for (g in s.segments)
                U = s.segments[g], U.data = s.data, U.reverse_flux = s.reverse_flux;
            }), !0);
          }
          function P(E, V, ie, ae, K) {
            return ee.default.isUndefined(K) && (K = Object.keys(E)), V === null ? (K.map(function(s) {
              E[s].data = null, E[s].data_string = "";
            }), !1) : (K.map(function(s) {
              var g = E[s], U = V[g.bigg_id] || V[g.name] || null, Y = ne(U, ie, ae), p = xe(U, Y);
              g.data = Y, g.data_string = p;
            }), !0);
          }
          function $(E, V, ie, ae, K, s, g) {
            if (ee.default.isUndefined(g) && (g = Object.keys(E)), V === null)
              return g.map(function(w) {
                var u = E[w];
                u.data = null, u.data_string = "", u.reverse_flux = !1;
                for (var Z in u.segments) {
                  var re = u.segments[Z];
                  re.data = null;
                }
                u.gene_string = null;
              }), !1;
            var U = [null];
            for (var Y in V) {
              for (var p in V[Y]) {
                U = V[Y][p].map(function() {
                  return null;
                });
                break;
              }
              break;
            }
            return g.map(function(w) {
              var u = E[w], Z = u.gene_reaction_rule, re, de, be = V[u.bigg_id];
              ee.default.isUndefined(be) ? (de = {}, re = X.clone(U)) : (de = be, re = he(Z, de, s));
              var i = ne(re, ie, K), f = ge(re), R = xe(re, i);
              u.data = i, u.data_string = R, u.reverse_flux = f;
              for (var z in u.segments) {
                var se = u.segments[z];
                se.data = u.data, se.reverse_flux = u.reverse_flux;
              }
              u.gene_string = ce(Z, de, u.genes, ie, ae, K);
            }), !0;
          }
        },
        /* 13 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          function a(q, ee) {
            if (!(q instanceof ee))
              throw new TypeError("Cannot call a class as a function");
          }
          var X = function() {
            function q() {
              a(this, q);
            }
            return q.prototype.set = function(j, t) {
              this.callbacks === void 0 && (this.callbacks = {}), this.callbacks[j] === void 0 && (this.callbacks[j] = []), this.callbacks[j].push(t);
            }, q.prototype.remove = function(j) {
              this.callbacks === void 0 || Object.keys(this.callbacks).length === 0 ? console.warn("No callbacks to remove") : delete this.callbacks[j];
            }, q.prototype.run = function(j) {
              for (var t = arguments.length, F = Array(t > 2 ? t - 2 : 0), M = 2; M < t; M++)
                F[M - 2] = arguments[M];
              var h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
              if (this.callbacks !== void 0)
                for (var x in this.callbacks) {
                  var m = x.split(".")[0];
                  m === j && this.callbacks[x].forEach(function(D) {
                    D.apply(h, F);
                  });
                }
            }, q;
          }();
          O.default = X;
        },
        /* 14 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = {}, X = {}, q = 34, ee = 10, j = 13;
          function t(C) {
            return new Function("d", "return {" + C.map(function(ne, ge) {
              return JSON.stringify(ne) + ": d[" + ge + "]";
            }).join(",") + "}");
          }
          function F(C, ne) {
            var ge = t(C);
            return function(ce, xe) {
              return ne(ge(ce), xe, C);
            };
          }
          function M(C) {
            var ne = /* @__PURE__ */ Object.create(null), ge = [];
            return C.forEach(function(ce) {
              for (var xe in ce)
                xe in ne || ge.push(ne[xe] = xe);
            }), ge;
          }
          function h(C, ne) {
            var ge = C + "", ce = ge.length;
            return ce < ne ? new Array(ne - ce + 1).join(0) + ge : ge;
          }
          function x(C) {
            return C < 0 ? "-" + h(-C, 6) : C > 9999 ? "+" + h(C, 6) : h(C, 4);
          }
          function m(C) {
            var ne = C.getUTCHours(), ge = C.getUTCMinutes(), ce = C.getUTCSeconds(), xe = C.getUTCMilliseconds();
            return isNaN(C) ? "Invalid Date" : x(C.getUTCFullYear()) + "-" + h(C.getUTCMonth() + 1, 2) + "-" + h(C.getUTCDate(), 2) + (xe ? "T" + h(ne, 2) + ":" + h(ge, 2) + ":" + h(ce, 2) + "." + h(xe, 3) + "Z" : ce ? "T" + h(ne, 2) + ":" + h(ge, 2) + ":" + h(ce, 2) + "Z" : ge || ne ? "T" + h(ne, 2) + ":" + h(ge, 2) + "Z" : "");
          }
          var D = function(C) {
            var ne = new RegExp('["' + C + `
\r]`), ge = C.charCodeAt(0);
            function ce($, E) {
              var V, ie, ae = xe($, function(K, s) {
                if (V)
                  return V(K, s - 1);
                ie = K, V = E ? F(K, E) : t(K);
              });
              return ae.columns = ie || [], ae;
            }
            function xe($, E) {
              var V = [], ie = $.length, ae = 0, K = 0, s, g = ie <= 0, U = !1;
              $.charCodeAt(ie - 1) === ee && --ie, $.charCodeAt(ie - 1) === j && --ie;
              function Y() {
                if (g)
                  return X;
                if (U)
                  return U = !1, a;
                var w, u = ae, Z;
                if ($.charCodeAt(u) === q) {
                  for (; ae++ < ie && $.charCodeAt(ae) !== q || $.charCodeAt(++ae) === q; )
                    ;
                  return (w = ae) >= ie ? g = !0 : (Z = $.charCodeAt(ae++)) === ee ? U = !0 : Z === j && (U = !0, $.charCodeAt(ae) === ee && ++ae), $.slice(u + 1, w - 1).replace(/""/g, '"');
                }
                for (; ae < ie; ) {
                  if ((Z = $.charCodeAt(w = ae++)) === ee)
                    U = !0;
                  else if (Z === j)
                    U = !0, $.charCodeAt(ae) === ee && ++ae;
                  else if (Z !== ge)
                    continue;
                  return $.slice(u, w);
                }
                return g = !0, $.slice(u, ie);
              }
              for (; (s = Y()) !== X; ) {
                for (var p = []; s !== a && s !== X; )
                  p.push(s), s = Y();
                E && (p = E(p, K++)) == null || V.push(p);
              }
              return V;
            }
            function fe($, E) {
              return $.map(function(V) {
                return E.map(function(ie) {
                  return P(V[ie]);
                }).join(C);
              });
            }
            function Ce($, E) {
              return E == null && (E = M($)), [E.map(P).join(C)].concat(fe($, E)).join(`
`);
            }
            function he($, E) {
              return E == null && (E = M($)), fe($, E).join(`
`);
            }
            function le($) {
              return $.map(G).join(`
`);
            }
            function G($) {
              return $.map(P).join(C);
            }
            function P($) {
              return $ == null ? "" : $ instanceof Date ? m($) : ne.test($ += "") ? '"' + $.replace(/"/g, '""') + '"' : $;
            }
            return {
              parse: ce,
              parseRows: xe,
              format: Ce,
              formatBody: he,
              formatRows: le
            };
          }, H = D(","), B = H.parse, k = H.parseRows, _ = H.format, Q = H.formatBody, o = H.formatRows, W = D("	"), y = W.parse, v = W.parseRows, T = W.format, n = W.formatBody, r = W.formatRows;
          function b(C) {
            for (var ne in C) {
              var ge = C[ne].trim(), ce;
              if (!ge)
                ge = null;
              else if (ge === "true")
                ge = !0;
              else if (ge === "false")
                ge = !1;
              else if (ge === "NaN")
                ge = NaN;
              else if (!isNaN(ce = +ge))
                ge = ce;
              else if (/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/.test(ge))
                ge = new Date(ge);
              else
                continue;
              C[ne] = ge;
            }
            return C;
          }
          d.d(O, "dsvFormat", function() {
            return D;
          }), d.d(O, "csvParse", function() {
            return B;
          }), d.d(O, "csvParseRows", function() {
            return k;
          }), d.d(O, "csvFormat", function() {
            return _;
          }), d.d(O, "csvFormatBody", function() {
            return Q;
          }), d.d(O, "csvFormatRows", function() {
            return o;
          }), d.d(O, "tsvParse", function() {
            return y;
          }), d.d(O, "tsvParseRows", function() {
            return v;
          }), d.d(O, "tsvFormat", function() {
            return T;
          }), d.d(O, "tsvFormatBody", function() {
            return n;
          }), d.d(O, "tsvFormatRows", function() {
            return r;
          }), d.d(O, "autoType", function() {
            return b;
          });
        },
        /* 15 */
        /***/
        function(Te, O, d) {
          var a = "$";
          function X() {
          }
          X.prototype = q.prototype = {
            constructor: X,
            has: function(F) {
              return a + F in this;
            },
            get: function(F) {
              return this[a + F];
            },
            set: function(F, M) {
              return this[a + F] = M, this;
            },
            remove: function(F) {
              var M = a + F;
              return M in this && delete this[M];
            },
            clear: function() {
              for (var F in this)
                F[0] === a && delete this[F];
            },
            keys: function() {
              var F = [];
              for (var M in this)
                M[0] === a && F.push(M.slice(1));
              return F;
            },
            values: function() {
              var F = [];
              for (var M in this)
                M[0] === a && F.push(this[M]);
              return F;
            },
            entries: function() {
              var F = [];
              for (var M in this)
                M[0] === a && F.push({ key: M.slice(1), value: this[M] });
              return F;
            },
            size: function() {
              var F = 0;
              for (var M in this)
                M[0] === a && ++F;
              return F;
            },
            empty: function() {
              for (var F in this)
                if (F[0] === a)
                  return !1;
              return !0;
            },
            each: function(F) {
              for (var M in this)
                M[0] === a && F(this[M], M.slice(1), this);
            }
          };
          function q(F, M) {
            var h = new X();
            if (F instanceof X)
              F.each(function(B, k) {
                h.set(k, B);
              });
            else if (Array.isArray(F)) {
              var x = -1, m = F.length, D;
              if (M == null)
                for (; ++x < m; )
                  h.set(x, F[x]);
              else
                for (; ++x < m; )
                  h.set(M(D = F[x], x, F), D);
            } else if (F)
              for (var H in F)
                h.set(H, F[H]);
            return h;
          }
          var ee = q;
          function j() {
          }
          var t = ee.prototype;
          j.prototype = {
            constructor: j,
            has: t.has,
            add: function(F) {
              return F += "", this[a + F] = F, this;
            },
            remove: t.remove,
            clear: t.clear,
            values: t.keys,
            size: t.size,
            empty: t.empty,
            each: t.each
          }, d.d(O, "a", function() {
            return ee;
          });
        },
        /* 16 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = d(15), X = d(8), q = function(_, Q) {
            var o, W = Object(X.a)("beforesend", "progress", "load", "error"), y, v = Object(a.a)(), T = new XMLHttpRequest(), n = null, r = null, b, C, ne = 0;
            typeof XDomainRequest < "u" && !("withCredentials" in T) && /^(http(s)?:)?\/\//.test(_) && (T = new XDomainRequest()), "onload" in T ? T.onload = T.onerror = T.ontimeout = ge : T.onreadystatechange = function(ce) {
              T.readyState > 3 && ge(ce);
            };
            function ge(ce) {
              var xe = T.status, fe;
              if (!xe && j(T) || xe >= 200 && xe < 300 || xe === 304) {
                if (b)
                  try {
                    fe = b.call(o, T);
                  } catch (Ce) {
                    W.call("error", o, Ce);
                    return;
                  }
                else
                  fe = T;
                W.call("load", o, fe);
              } else
                W.call("error", o, ce);
            }
            if (T.onprogress = function(ce) {
              W.call("progress", o, ce);
            }, o = {
              header: function(ce, xe) {
                return ce = (ce + "").toLowerCase(), arguments.length < 2 ? v.get(ce) : (xe == null ? v.remove(ce) : v.set(ce, xe + ""), o);
              },
              // If mimeType is non-null and no Accept header is set, a default is used.
              mimeType: function(ce) {
                return arguments.length ? (y = ce == null ? null : ce + "", o) : y;
              },
              // Specifies what type the response value should take;
              // for instance, arraybuffer, blob, document, or text.
              responseType: function(ce) {
                return arguments.length ? (C = ce, o) : C;
              },
              timeout: function(ce) {
                return arguments.length ? (ne = +ce, o) : ne;
              },
              user: function(ce) {
                return arguments.length < 1 ? n : (n = ce == null ? null : ce + "", o);
              },
              password: function(ce) {
                return arguments.length < 1 ? r : (r = ce == null ? null : ce + "", o);
              },
              // Specify how to convert the response content to a specific type;
              // changes the callback value on "load" events.
              response: function(ce) {
                return b = ce, o;
              },
              // Alias for send("GET", …).
              get: function(ce, xe) {
                return o.send("GET", ce, xe);
              },
              // Alias for send("POST", …).
              post: function(ce, xe) {
                return o.send("POST", ce, xe);
              },
              // If callback is non-null, it will be used for error and load events.
              send: function(ce, xe, fe) {
                return T.open(ce, _, !0, n, r), y != null && !v.has("accept") && v.set("accept", y + ",*/*"), T.setRequestHeader && v.each(function(Ce, he) {
                  T.setRequestHeader(he, Ce);
                }), y != null && T.overrideMimeType && T.overrideMimeType(y), C != null && (T.responseType = C), ne > 0 && (T.timeout = ne), fe == null && typeof xe == "function" && (fe = xe, xe = null), fe != null && fe.length === 1 && (fe = ee(fe)), fe != null && o.on("error", fe).on("load", function(Ce) {
                  fe(null, Ce);
                }), W.call("beforesend", o, T), T.send(xe ?? null), o;
              },
              abort: function() {
                return T.abort(), o;
              },
              on: function() {
                var ce = W.on.apply(W, arguments);
                return ce === W ? o : ce;
              }
            }, Q != null) {
              if (typeof Q != "function")
                throw new Error("invalid callback: " + Q);
              return o.get(Q);
            }
            return o;
          };
          function ee(_) {
            return function(Q, o) {
              _(Q == null ? o : null);
            };
          }
          function j(_) {
            var Q = _.responseType;
            return Q && Q !== "text" ? _.response : _.responseText;
          }
          var t = function(_, Q) {
            return function(o, W) {
              var y = q(o).mimeType(_).response(Q);
              if (W != null) {
                if (typeof W != "function")
                  throw new Error("invalid callback: " + W);
                return y.get(W);
              }
              return y;
            };
          }, F = t("text/html", function(_) {
            return document.createRange().createContextualFragment(_.responseText);
          }), M = t("application/json", function(_) {
            return JSON.parse(_.responseText);
          }), h = t("text/plain", function(_) {
            return _.responseText;
          }), x = t("application/xml", function(_) {
            var Q = _.responseXML;
            if (!Q)
              throw new Error("parse error");
            return Q;
          }), m = d(14), D = function(_, Q) {
            return function(o, W, y) {
              arguments.length < 3 && (y = W, W = null);
              var v = q(o).mimeType(_);
              return v.row = function(T) {
                return arguments.length ? v.response(H(Q, W = T)) : W;
              }, v.row(W), y ? v.get(y) : v;
            };
          };
          function H(_, Q) {
            return function(o) {
              return _(o.responseText, Q);
            };
          }
          var B = D("text/csv", m.csvParse), k = D("text/tab-separated-values", m.tsvParse);
          d.d(O, "request", function() {
            return q;
          }), d.d(O, "html", function() {
            return F;
          }), d.d(O, "json", function() {
            return M;
          }), d.d(O, "text", function() {
            return h;
          }), d.d(O, "xml", function() {
            return x;
          }), d.d(O, "csv", function() {
            return B;
          }), d.d(O, "tsv", function() {
            return k;
          });
        },
        /* 17 */
        /***/
        function(Te, O, d) {
          var a = d(3), X = a.make_class();
          X.prototype = {
            init: q,
            is_visible: ee,
            place: j,
            hide: t
          }, Te.exports = X;
          function q(F, M) {
            var h = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { x: 0, y: 0 }, x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
            this.div = F, this.map = M, this.displacement = h, this.shouldReposition = x, this.visible = !0, this.hide();
          }
          function ee() {
            return this.visible;
          }
          function j(F) {
            this.div.style("display", null);
            var M = this.map.zoomContainer.windowTranslate, h = this.map.zoomContainer.windowScale, x = this.map.get_size();
            if (this.shouldReposition) {
              var m = Math.max(20, Math.min(x.width - 270, h * F.x + M.x - this.displacement.x)), D = Math.max(20, Math.min(x.height - 40, h * F.y + M.y - this.displacement.y));
              this.div.style("position", "absolute").style("display", "block").style("left", m + "px").style("top", D + "px");
            } else
              this.div.style("position", "absolute").style("display", "block").style("left", h * F.x + M.x - this.displacement.x + "px").style("top", h * F.y + M.y - this.displacement.y + "px");
            this.visible = !0;
          }
          function t() {
            this.visible && (this.div.style("display", "none"), this.visible = !1);
          }
        },
        /* 18 */
        /***/
        function(Te, O, d) {
          var a = d(3), X = d(12), q = a.make_class();
          q.from_cobra_json = j, q.build_reaction_string = ee, q.prototype = {
            init: t,
            apply_reaction_data: F,
            apply_metabolite_data: M,
            apply_gene_data: h
          }, Te.exports = q;
          function ee(x, m) {
            var D = function(W) {
              return W == 1 ? "" : String(W) + " ";
            }, H = [], B = [];
            for (var k in x) {
              var _ = x[k];
              _ > 0 ? B.push(D(_) + k) : H.push(D(Math.abs(_)) + k);
            }
            var Q = H.join(" + ");
            return m ? Q += " ↔ " : Q += " → ", Q += B.join(" + "), Q;
          }
          function j(x) {
            if (!(x.reactions && x.metabolites))
              throw new Error("Bad model data.");
            for (var m = {}, D = 0, H = x.genes.length; D < H; D++) {
              var B = x.genes[D], k = B.id;
              m[k] = B;
            }
            var _ = new q();
            _.reactions = {};
            for (var D = 0, H = x.reactions.length; D < H; D++) {
              var B = x.reactions[D], k = B.id, Q = a.clone(B);
              if (delete Q.id, Q.bigg_id = k, Q.data_string = "", Q.genes = [], Q.reversibility = Q.lower_bound < 0 && Q.upper_bound > 0, Q.upper_bound <= 0 && Q.lower_bound < 0)
                for (var o in Q.metabolites)
                  Q.metabolites[o] = -Q.metabolites[o];
              if (delete Q.lower_bound, delete Q.upper_bound, "gene_reaction_rule" in Q) {
                var W = X.genes_for_gene_reaction_rule(Q.gene_reaction_rule);
                W.forEach(function(b) {
                  if (b in m) {
                    var C = a.clone(m[b]);
                    C.bigg_id = C.id, delete C.id, Q.genes.push(C);
                  } else
                    console.warn("Could not find gene for gene_id " + b);
                });
              }
              _.reactions[k] = Q;
            }
            _.metabolites = {};
            for (var D = 0, H = x.metabolites.length; D < H; D++) {
              var B = x.metabolites[D], k = B.id, y = a.clone(B);
              delete y.id, y.bigg_id = k, _.metabolites[k] = y;
            }
            return _;
          }
          function t() {
            this.reactions = {}, this.metabolites = {};
          }
          function F(x, m, D) {
            X.apply_reaction_data_to_reactions(this.reactions, x, m, D);
          }
          function M(x, m, D) {
            X.apply_metabolite_data_to_nodes(this.metabolites, x, m, D);
          }
          function h(x, m, D, H, B) {
            X.apply_gene_data_to_reactions(this.reactions, x, m, D, H, B);
          }
        },
        /* 19 */
        /***/
        function(Te, O, d) {
          (function(a, X) {
            var q, ee;
            (function() {
              var j = Array.prototype.slice, t = {
                toString: function() {
                  return "Bacon";
                }
              };
              t.version = "0.7.95";
              var F = (typeof a < "u" && a !== null ? a : this).Error, M = function() {
              }, h = function(e, A) {
                return e;
              }, x = function(e) {
                return e.slice(0);
              }, m = function(e, A) {
                if (!A)
                  throw new F(e);
              }, D = function(e) {
                if (e != null && e._isObservable && !(e != null && e._isProperty))
                  throw new F("Observable is not a Property : " + e);
              }, H = function(e) {
                if (!(e != null && e._isEventStream))
                  throw new F("not an EventStream : " + e);
              }, B = function(e) {
                if (!(e != null && e._isObservable))
                  throw new F("not an Observable : " + e);
              }, k = function(e) {
                return m("not a function : " + e, n.isFunction(e));
              }, _ = Array.isArray || function(e) {
                return e instanceof Array;
              }, Q = function(e) {
                return e && e._isObservable;
              }, o = function(e) {
                if (!_(e))
                  throw new F("not an array : " + e);
              }, W = function(e) {
                return m("no arguments supported", e.length === 0);
              }, y = function(e) {
                for (var A = arguments.length, L = 1; 1 < A ? L < A : L > A; 1 < A ? L++ : L--)
                  for (var te in arguments[L])
                    e[te] = arguments[L][te];
                return e;
              }, v = function(e, A) {
                var L = {}.hasOwnProperty, te = function() {
                };
                te.prototype = A.prototype, e.prototype = new te();
                for (var we in A)
                  L.call(A, we) && (e[we] = A[we]);
                return e;
              }, T = function(e) {
                return typeof Symbol < "u" && Symbol[e] ? Symbol[e] : typeof Symbol < "u" && typeof Symbol.for == "function" ? Symbol[e] = Symbol.for(e) : "@@" + e;
              }, n = {
                indexOf: function() {
                  return Array.prototype.indexOf ? function(e, A) {
                    return e.indexOf(A);
                  } : function(e, A) {
                    for (var L = 0, te; L < e.length; L++)
                      if (te = e[L], A === te)
                        return L;
                    return -1;
                  };
                }(),
                indexWhere: function(e, A) {
                  for (var L = 0, te; L < e.length; L++)
                    if (te = e[L], A(te))
                      return L;
                  return -1;
                },
                head: function(e) {
                  return e[0];
                },
                always: function(e) {
                  return function() {
                    return e;
                  };
                },
                negate: function(e) {
                  return function(A) {
                    return !e(A);
                  };
                },
                empty: function(e) {
                  return e.length === 0;
                },
                tail: function(e) {
                  return e.slice(1, e.length);
                },
                filter: function(e, A) {
                  for (var L = [], te = 0, we; te < A.length; te++)
                    we = A[te], e(we) && L.push(we);
                  return L;
                },
                map: function(e, A) {
                  return function() {
                    for (var L = [], te = 0, we; te < A.length; te++)
                      we = A[te], L.push(e(we));
                    return L;
                  }();
                },
                each: function(e, A) {
                  for (var L in e)
                    if (Object.prototype.hasOwnProperty.call(e, L)) {
                      var te = e[L];
                      A(L, te);
                    }
                },
                toArray: function(e) {
                  return _(e) ? e : [e];
                },
                contains: function(e, A) {
                  return n.indexOf(e, A) !== -1;
                },
                id: function(e) {
                  return e;
                },
                last: function(e) {
                  return e[e.length - 1];
                },
                all: function(e) {
                  for (var A = arguments.length <= 1 || arguments[1] === void 0 ? n.id : arguments[1], L = 0, te; L < e.length; L++)
                    if (te = e[L], !A(te))
                      return !1;
                  return !0;
                },
                any: function(e) {
                  for (var A = arguments.length <= 1 || arguments[1] === void 0 ? n.id : arguments[1], L = 0, te; L < e.length; L++)
                    if (te = e[L], A(te))
                      return !0;
                  return !1;
                },
                without: function(e, A) {
                  return n.filter(function(L) {
                    return L !== e;
                  }, A);
                },
                remove: function(e, A) {
                  var L = n.indexOf(A, e);
                  if (L >= 0)
                    return A.splice(L, 1);
                },
                fold: function(e, A, L) {
                  for (var te = 0, we; te < e.length; te++)
                    we = e[te], A = L(A, we);
                  return A;
                },
                flatMap: function(e, A) {
                  return n.fold(A, [], function(L, te) {
                    return L.concat(e(te));
                  });
                },
                cached: function(e) {
                  var A = U;
                  return function() {
                    return typeof A < "u" && A !== null && A._isNone && (A = e(), e = void 0), A;
                  };
                },
                bind: function(e, A) {
                  return function() {
                    return e.apply(A, arguments);
                  };
                },
                isFunction: function(e) {
                  return typeof e == "function";
                },
                toString: function(e) {
                  var A, L, te, we = {}.hasOwnProperty;
                  try {
                    return r++, e == null ? "undefined" : n.isFunction(e) ? "function" : _(e) ? r > 5 ? "[..]" : "[" + n.map(n.toString, e).toString() + "]" : (e != null ? e.toString : void 0) != null && e.toString !== Object.prototype.toString ? e.toString() : typeof e == "object" ? r > 5 ? "{..}" : (A = function() {
                      var Ne = [];
                      for (L in e)
                        we.call(e, L) && (te = function() {
                          var ze;
                          try {
                            return e[L];
                          } catch (Ve) {
                            return Ve;
                          }
                        }(), Ne.push(n.toString(L) + ":" + n.toString(te)));
                      return Ne;
                    }(), "{" + A + "}") : e;
                  } finally {
                    r--;
                  }
                }
              }, r = 0;
              t._ = n;
              var b = t.UpdateBarrier = /* @__PURE__ */ function() {
                var e, A = [], L = {}, te = [], we = 0, Ne = {};
                function ze(rt) {
                  rt <= we || (te[rt - 1] || (te[rt - 1] = [[], 0]), we = rt);
                }
                var Ve = function(rt, lt) {
                  if (e || te.length) {
                    ze(1);
                    for (var ct = 0; ct < we - 1 && !Ze(rt, te[ct][0]); )
                      ct++;
                    var _t = te[ct][0];
                    _t.push([rt, lt]), e || Je();
                  } else
                    return lt();
                };
                function Ze(rt, lt) {
                  for (var ct = 0; ct < lt.length; ct++)
                    if (lt[ct][0].id == rt.id)
                      return !0;
                  return !1;
                }
                function Je() {
                  var rt = we;
                  if (rt)
                    for (; we >= rt; ) {
                      var lt = te[we - 1];
                      if (!lt)
                        throw new de("Unexpected stack top: " + lt);
                      var ct = lt[0], _t = lt[1];
                      if (_t < ct.length) {
                        var xt = ct[_t];
                        xt[0];
                        var Ae = xt[1];
                        lt[1]++, ze(we + 1);
                        var me = !1;
                        try {
                          for (Ae(), me = !0; we > rt && te[we - 1][0].length == 0; )
                            we--;
                        } finally {
                          me || (te = [], we = 0);
                        }
                      } else {
                        lt[0] = [], lt[1] = 0;
                        break;
                      }
                    }
                }
                var st = function(rt, lt) {
                  if (e) {
                    var ct = L[rt.id];
                    return typeof ct < "u" && ct !== null ? ct.push(lt) : (ct = L[rt.id] = [lt], A.push(rt));
                  } else
                    return lt();
                }, ot = function() {
                  for (; A.length > 0; )
                    ut(0, !0);
                  Ne = {};
                }, ut = function(rt, lt) {
                  var ct = A[rt], _t = ct.id, xt = L[_t];
                  A.splice(rt, 1), delete L[_t], lt && A.length > 0 && mt(ct);
                  for (var Ae = 0, me; Ae < xt.length; Ae++)
                    me = xt[Ae], me();
                }, mt = function(rt) {
                  if (!Ne[rt.id]) {
                    for (var lt = rt.internalDeps(), ct = 0, _t; ct < lt.length; ct++)
                      if (_t = lt[ct], mt(_t), L[_t.id]) {
                        var xt = n.indexOf(A, _t);
                        ut(xt, !1);
                      }
                    Ne[rt.id] = !0;
                  }
                }, qe = function(rt, lt, ct, _t) {
                  if (e)
                    return ct.apply(lt, _t);
                  e = rt;
                  try {
                    var xt = ct.apply(lt, _t);
                    ot();
                  } finally {
                    e = void 0, Je();
                  }
                  return xt;
                }, $e = function() {
                  return e ? e.id : void 0;
                }, vt = function(rt, lt) {
                  var ct = !1, _t = !1, xt = function() {
                    return _t = !0, _t;
                  }, Ae = function() {
                    return ct = !0, xt();
                  };
                  return xt = rt.dispatcher.subscribe(function(me) {
                    return Ve(rt, function() {
                      if (!ct) {
                        var _e = lt(me);
                        if (_e === t.noMore)
                          return Ae();
                      }
                    });
                  }), _t && xt(), Ae;
                }, wt = function() {
                  return A.length > 0;
                };
                return { whenDoneWith: st, hasWaiters: wt, inTransaction: qe, currentEventId: $e, wrappedSubscribe: vt, afterTransaction: Ve };
              }();
              function C(e, A) {
                var L = arguments.length <= 2 || arguments[2] === void 0 ? !1 : arguments[2];
                this.obs = e, this.sync = A, this.lazy = L, this.queue = [];
              }
              y(C.prototype, {
                _isSource: !0,
                subscribe: function(e) {
                  return this.obs.dispatcher.subscribe(e);
                },
                toString: function() {
                  return this.obs.toString();
                },
                markEnded: function() {
                  return this.ended = !0, !0;
                },
                consume: function() {
                  return this.lazy ? { value: n.always(this.queue[0]) } : this.queue[0];
                },
                push: function(e) {
                  return this.queue = [e], [e];
                },
                mayHave: function() {
                  return !0;
                },
                hasAtLeast: function() {
                  return this.queue.length;
                },
                flatten: !0
              });
              function ne() {
                C.apply(this, arguments);
              }
              v(ne, C), y(ne.prototype, {
                consume: function() {
                  return this.queue.shift();
                },
                push: function(e) {
                  return this.queue.push(e);
                },
                mayHave: function(e) {
                  return !this.ended || this.queue.length >= e;
                },
                hasAtLeast: function(e) {
                  return this.queue.length >= e;
                },
                flatten: !1
              });
              function ge(e) {
                C.call(this, e, !0);
              }
              v(ge, C), y(ge.prototype, {
                consume: function() {
                  var e = this.queue;
                  return this.queue = [], {
                    value: function() {
                      return e;
                    }
                  };
                },
                push: function(e) {
                  return this.queue.push(e.value());
                },
                hasAtLeast: function() {
                  return !0;
                }
              }), C.isTrigger = function(e) {
                return e != null && e._isSource ? e.sync : e != null ? e._isEventStream : void 0;
              }, C.fromObservable = function(e) {
                return e != null && e._isSource ? e : e != null && e._isProperty ? new C(e, !1) : new ne(e, !0);
              };
              function ce(e, A, L) {
                this.context = e, this.method = A, this.args = L;
              }
              y(ce.prototype, {
                _isDesc: !0,
                deps: function() {
                  return this.cached || (this.cached = Ce([this.context].concat(this.args))), this.cached;
                },
                toString: function() {
                  return n.toString(this.context) + "." + n.toString(this.method) + "(" + n.map(n.toString, this.args) + ")";
                }
              });
              var xe = function(e, A) {
                var L = e || A;
                if (L && L._isDesc)
                  return e || A;
                for (var te = arguments.length, we = Array(te > 2 ? te - 2 : 0), Ne = 2; Ne < te; Ne++)
                  we[Ne - 2] = arguments[Ne];
                return new ce(e, A, we);
              }, fe = function(e, A) {
                return A.desc = e, A;
              }, Ce = function(e) {
                return _(e) ? n.flatMap(Ce, e) : Q(e) ? [e] : typeof e < "u" && e !== null && e._isSource ? [e.obs] : [];
              };
              t.Desc = ce, t.Desc.empty = new t.Desc("", "", []);
              var he = function(e) {
                return function(A) {
                  for (var L = arguments.length, te = Array(L > 1 ? L - 1 : 0), we = 1; we < L; we++)
                    te[we - 1] = arguments[we];
                  if (typeof A == "object" && te.length) {
                    var Ne = A, ze = te[0];
                    A = function() {
                      return Ne[ze].apply(Ne, arguments);
                    }, te = te.slice(1);
                  }
                  return e.apply(void 0, [A].concat(te));
                };
              }, le = function(e) {
                return e = Array.prototype.slice.call(e), V.apply(void 0, e);
              }, G = function(e, A) {
                return function() {
                  for (var L = arguments.length, te = Array(L), we = 0; we < L; we++)
                    te[we] = arguments[we];
                  return e.apply(void 0, A.concat(te));
                };
              }, P = function(e) {
                return function(A) {
                  return function(L) {
                    if (typeof L < "u" && L !== null) {
                      var te = L[A];
                      return n.isFunction(te) ? te.apply(L, e) : te;
                    } else
                      return;
                  };
                };
              }, $ = function(e, A) {
                var L = e.slice(1).split("."), te = n.map(P(A), L);
                return function(we) {
                  for (var Ne = 0, ze; Ne < te.length; Ne++)
                    ze = te[Ne], we = ze(we);
                  return we;
                };
              }, E = function(e) {
                return typeof e == "string" && e.length > 1 && e.charAt(0) === ".";
              }, V = he(function(e) {
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return n.isFunction(e) ? L.length ? G(e, L) : e : E(e) ? $(e, L) : n.always(e);
              }), ie = function(e, A) {
                return V.apply(void 0, [e].concat(A));
              }, ae = function(e, A, L, te) {
                if (typeof A < "u" && A !== null && A._isProperty) {
                  var we = A.sampledBy(e, function(Ne, ze) {
                    return [Ne, ze];
                  });
                  return te.call(we, function(Ne) {
                    var ze = Ne[0];
                    return Ne[1], ze;
                  }).map(function(Ne) {
                    Ne[0];
                    var ze = Ne[1];
                    return ze;
                  });
                } else
                  return A = ie(A, L), te.call(e, A);
              }, K = function(e) {
                if (n.isFunction(e))
                  return e;
                if (E(e)) {
                  var A = s(e);
                  return function(L, te) {
                    return L[A](te);
                  };
                } else
                  throw new F("not a function or a field key: " + e);
              }, s = function(e) {
                return e.slice(1);
              };
              function g(e) {
                this.value = e;
              }
              y(g.prototype, {
                _isSome: !0,
                getOrElse: function() {
                  return this.value;
                },
                get: function() {
                  return this.value;
                },
                filter: function(e) {
                  return e(this.value) ? new g(this.value) : U;
                },
                map: function(e) {
                  return new g(e(this.value));
                },
                forEach: function(e) {
                  return e(this.value);
                },
                isDefined: !0,
                toArray: function() {
                  return [this.value];
                },
                inspect: function() {
                  return "Some(" + this.value + ")";
                },
                toString: function() {
                  return this.inspect();
                }
              });
              var U = {
                _isNone: !0,
                getOrElse: function(e) {
                  return e;
                },
                filter: function() {
                  return U;
                },
                map: function() {
                  return U;
                },
                forEach: function() {
                },
                isDefined: !1,
                toArray: function() {
                  return [];
                },
                inspect: function() {
                  return "None";
                },
                toString: function() {
                  return this.inspect();
                }
              }, Y = function(e) {
                return typeof e < "u" && e !== null && e._isSome || typeof e < "u" && e !== null && e._isNone ? e : new g(e);
              };
              t.noMore = "<no-more>", t.more = "<more>";
              var p = 0;
              function w() {
                this.id = ++p;
              }
              w.prototype._isEvent = !0, w.prototype.isEvent = function() {
                return !0;
              }, w.prototype.isEnd = function() {
                return !1;
              }, w.prototype.isInitial = function() {
                return !1;
              }, w.prototype.isNext = function() {
                return !1;
              }, w.prototype.isError = function() {
                return !1;
              }, w.prototype.hasValue = function() {
                return !1;
              }, w.prototype.filter = function() {
                return !0;
              }, w.prototype.inspect = function() {
                return this.toString();
              }, w.prototype.log = function() {
                return this.toString();
              };
              function u(e, A) {
                if (!(this instanceof u))
                  return new u(e, A);
                w.call(this), !A && n.isFunction(e) || e != null && e._isNext ? (this.valueF = e, this.valueInternal = void 0) : (this.valueF = void 0, this.valueInternal = e);
              }
              v(u, w), u.prototype.isNext = function() {
                return !0;
              }, u.prototype.hasValue = function() {
                return !0;
              }, u.prototype.value = function() {
                var e;
                return (e = this.valueF) != null && e._isNext ? (this.valueInternal = this.valueF.value(), this.valueF = void 0) : this.valueF && (this.valueInternal = this.valueF(), this.valueF = void 0), this.valueInternal;
              }, u.prototype.fmap = function(e) {
                var A, L;
                return this.valueInternal ? (L = this.valueInternal, this.apply(function() {
                  return e(L);
                })) : (A = this, this.apply(function() {
                  return e(A.value());
                }));
              }, u.prototype.apply = function(e) {
                return new u(e);
              }, u.prototype.filter = function(e) {
                return e(this.value());
              }, u.prototype.toString = function() {
                return n.toString(this.value());
              }, u.prototype.log = function() {
                return this.value();
              }, u.prototype._isNext = !0;
              function Z(e, A) {
                if (!(this instanceof Z))
                  return new Z(e, A);
                u.call(this, e, A);
              }
              v(Z, u), Z.prototype._isInitial = !0, Z.prototype.isInitial = function() {
                return !0;
              }, Z.prototype.isNext = function() {
                return !1;
              }, Z.prototype.apply = function(e) {
                return new Z(e);
              }, Z.prototype.toNext = function() {
                return new u(this);
              };
              function re() {
                if (!(this instanceof re))
                  return new re();
                w.call(this);
              }
              v(re, w), re.prototype.isEnd = function() {
                return !0;
              }, re.prototype.fmap = function() {
                return this;
              }, re.prototype.apply = function() {
                return this;
              }, re.prototype.toString = function() {
                return "<end>";
              };
              function de(e) {
                if (!(this instanceof de))
                  return new de(e);
                this.error = e, w.call(this);
              }
              v(de, w), de.prototype.isError = function() {
                return !0;
              }, de.prototype.fmap = function() {
                return this;
              }, de.prototype.apply = function() {
                return this;
              }, de.prototype.toString = function() {
                return "<error> " + n.toString(this.error);
              }, t.Event = w, t.Initial = Z, t.Next = u, t.End = re, t.Error = de;
              var be = function(e) {
                return new Z(e, !0);
              }, i = function(e) {
                return new u(e, !0);
              }, f = function() {
                return new re();
              }, R = function(e) {
                return e && e._isEvent ? e : i(e);
              }, z = 0, Ot = function() {
              };
              function se(e) {
                this.desc = e, this.id = ++z, this.initialDesc = this.desc;
              }
              y(se.prototype, {
                _isObservable: !0,
                subscribe: function(e) {
                  return b.wrappedSubscribe(this, e);
                },
                subscribeInternal: function(e) {
                  return this.dispatcher.subscribe(e);
                },
                onValue: function() {
                  var e = le(arguments);
                  return this.subscribe(function(A) {
                    if (A.hasValue())
                      return e(A.value());
                  });
                },
                onValues: function(e) {
                  return this.onValue(function(A) {
                    return e.apply(void 0, A);
                  });
                },
                onError: function() {
                  var e = le(arguments);
                  return this.subscribe(function(A) {
                    if (A.isError())
                      return e(A.error);
                  });
                },
                onEnd: function() {
                  var e = le(arguments);
                  return this.subscribe(function(A) {
                    if (A.isEnd())
                      return e();
                  });
                },
                name: function(e) {
                  return this._name = e, this;
                },
                withDescription: function() {
                  return this.desc = xe.apply(void 0, arguments), this;
                },
                toString: function() {
                  return this._name ? this._name : this.desc.toString();
                },
                deps: function() {
                  return this.desc.deps();
                },
                internalDeps: function() {
                  return this.initialDesc.deps();
                }
              }), se.prototype.assign = se.prototype.onValue, se.prototype.forEach = se.prototype.onValue, se.prototype.inspect = se.prototype.toString, t.Observable = se;
              function ue() {
                var e = arguments.length <= 0 || arguments[0] === void 0 ? [] : arguments[0];
                this.unsubscribe = n.bind(this.unsubscribe, this), this.unsubscribed = !1, this.subscriptions = [], this.starting = [];
                for (var A = 0, L; A < e.length; A++)
                  L = e[A], this.add(L);
              }
              y(ue.prototype, {
                add: function(e) {
                  var A = this;
                  if (!this.unsubscribed) {
                    var L = !1, te = M;
                    this.starting.push(e);
                    var we = function() {
                      if (!A.unsubscribed)
                        return L = !0, A.remove(te), n.remove(e, A.starting);
                    };
                    return te = e(this.unsubscribe, we), this.unsubscribed || L ? te() : this.subscriptions.push(te), n.remove(e, this.starting), te;
                  }
                },
                remove: function(e) {
                  if (!this.unsubscribed && n.remove(e, this.subscriptions) !== void 0)
                    return e();
                },
                unsubscribe: function() {
                  if (!this.unsubscribed) {
                    this.unsubscribed = !0;
                    for (var e = this.subscriptions, A = 0; A < e.length; A++)
                      e[A]();
                    return this.subscriptions = [], this.starting = [], [];
                  }
                },
                count: function() {
                  return this.unsubscribed ? 0 : this.subscriptions.length + this.starting.length;
                },
                empty: function() {
                  return this.count() === 0;
                }
              }), t.CompositeUnsubscribe = ue;
              function ye(e, A) {
                this._subscribe = e, this._handleEvent = A, this.subscribe = n.bind(this.subscribe, this), this.handleEvent = n.bind(this.handleEvent, this), this.pushing = !1, this.ended = !1, this.prevError = void 0, this.unsubSrc = void 0, this.subscriptions = [], this.queue = [];
              }
              ye.prototype.hasSubscribers = function() {
                return this.subscriptions.length > 0;
              }, ye.prototype.removeSub = function(e) {
                return this.subscriptions = n.without(e, this.subscriptions), this.subscriptions;
              }, ye.prototype.push = function(e) {
                return e.isEnd() && (this.ended = !0), b.inTransaction(e, this, this.pushIt, [e]);
              }, ye.prototype.pushToSubscriptions = function(e) {
                try {
                  for (var A = this.subscriptions, L = A.length, te = 0; te < L; te++) {
                    var we = A[te], Ne = we.sink(e);
                    (Ne === t.noMore || e.isEnd()) && this.removeSub(we);
                  }
                  return !0;
                } catch (ze) {
                  throw this.pushing = !1, this.queue = [], ze;
                }
              }, ye.prototype.pushIt = function(e) {
                if (this.pushing)
                  return this.queue.push(e), t.more;
                if (e === this.prevError)
                  return;
                for (e.isError() && (this.prevError = e), this.pushing = !0, this.pushToSubscriptions(e), this.pushing = !1; this.queue.length; )
                  e = this.queue.shift(), this.push(e);
                return this.hasSubscribers() ? t.more : (this.unsubscribeFromSource(), t.noMore);
              }, ye.prototype.handleEvent = function(e) {
                return this._handleEvent ? this._handleEvent(e) : this.push(e);
              }, ye.prototype.unsubscribeFromSource = function() {
                this.unsubSrc && this.unsubSrc(), this.unsubSrc = void 0;
              }, ye.prototype.subscribe = function(e) {
                var A;
                return this.ended ? (e(f()), M) : (k(e), A = {
                  sink: e
                }, this.subscriptions.push(A), this.subscriptions.length === 1 && (this.unsubSrc = this._subscribe(this.handleEvent), k(this.unsubSrc)), /* @__PURE__ */ function(L) {
                  return function() {
                    if (L.removeSub(A), !L.hasSubscribers())
                      return L.unsubscribeFromSource();
                  };
                }(this));
              }, t.Dispatcher = ye;
              function N(e, A, L) {
                if (!(this instanceof N))
                  return new N(e, A, L);
                n.isFunction(e) && (L = A, A = e, e = ce.empty), se.call(this, e), k(A), this.dispatcher = new ye(A, L), Ot(this);
              }
              v(N, se), y(N.prototype, {
                _isEventStream: !0,
                toProperty: function(e) {
                  var A = arguments.length === 0 ? U : Y(function() {
                    return e;
                  }), L = this.dispatcher, te = new t.Desc(this, "toProperty", [e]);
                  return new Be(te, function(we) {
                    var Ne = !1, ze = !1, Ve = M, Ze = t.more, Je = function() {
                      if (!Ne)
                        return A.forEach(function(st) {
                          if (Ne = !0, Ze = we(new Z(st)), Ze === t.noMore)
                            return Ve(), Ve = M, M;
                        });
                    };
                    return Ve = L.subscribe(function(st) {
                      if (st.hasValue())
                        return st.isInitial() && !ze ? (A = new g(function() {
                          return st.value();
                        }), t.more) : (st.isInitial() || Je(), Ne = !0, A = new g(st), we(st));
                      if (st.isEnd() && (Ze = Je()), Ze !== t.noMore)
                        return we(st);
                    }), ze = !0, Je(), Ve;
                  });
                },
                toEventStream: function() {
                  return this;
                },
                withHandler: function(e) {
                  return new N(new t.Desc(this, "withHandler", [e]), this.dispatcher.subscribe, e);
                }
              }), t.EventStream = N, t.never = function() {
                return new N(xe(t, "never"), function(e) {
                  return e(f()), M;
                });
              }, t.when = function() {
                if (arguments.length === 0)
                  return t.never();
                var e = arguments.length, A = "when: expecting arguments in the form (Observable+,function)+";
                m(A, e % 2 === 0);
                for (var L = [], te = [], we = 0, Ne = []; we < e; ) {
                  Ne[we] = arguments[we], Ne[we + 1] = arguments[we + 1];
                  for (var ze = n.toArray(arguments[we]), Ve = J(arguments[we + 1]), Ze = { f: Ve, ixs: [] }, Je = !1, st = 0, ot; st < ze.length; st++) {
                    ot = ze[st];
                    var ut = n.indexOf(L, ot);
                    Je || (Je = C.isTrigger(ot)), ut < 0 && (L.push(ot), ut = L.length - 1);
                    for (var mt = 0, qe; mt < Ze.ixs.length; mt++)
                      qe = Ze.ixs[mt], qe.index === ut && qe.count++;
                    Ze.ixs.push({ index: ut, count: 1 });
                  }
                  m("At least one EventStream required", Je || !ze.length), ze.length > 0 && te.push(Ze), we = we + 2;
                }
                if (!L.length)
                  return t.never();
                L = n.map(C.fromObservable, L);
                var $e = n.any(L, function(rt) {
                  return rt.flatten;
                }) && c(n.map(function(rt) {
                  return rt.obs;
                }, L)), vt = new t.Desc(t, "when", Ne), wt = new N(vt, function(rt) {
                  var lt = [], ct = !1, _t = function(Ee) {
                    for (var Oe = 0, ke; Oe < Ee.ixs.length; Oe++)
                      if (ke = Ee.ixs[Oe], !L[ke.index].hasAtLeast(ke.count))
                        return !1;
                    return !0;
                  }, xt = function(Ee) {
                    return !Ee.sync || Ee.ended;
                  }, Ae = function(Ee) {
                    for (var Oe = 0, ke; Oe < Ee.ixs.length; Oe++)
                      if (ke = Ee.ixs[Oe], !L[ke.index].mayHave(ke.count))
                        return !0;
                  }, me = function(Ee) {
                    return !Ee.source.flatten;
                  }, _e = function(Ee) {
                    return function(Oe) {
                      var ke = function() {
                        return b.whenDoneWith(wt, ve);
                      }, S = function() {
                        if (lt.length > 0) {
                          for (var Ie = t.more, Qe = lt.pop(), Fe = 0, Ge; Fe < te.length; Fe++)
                            if (Ge = te[Fe], _t(Ge)) {
                              var He = function() {
                                for (var Re = [], Xe = 0, at; Xe < Ge.ixs.length; Xe++)
                                  at = Ge.ixs[Xe], Re.push(L[at.index].consume());
                                return Re;
                              }();
                              return Ie = rt(Qe.e.apply(function() {
                                var Re, Xe = function() {
                                  for (var at = [], dt = 0, Tt; dt < He.length; dt++)
                                    Tt = He[dt], at.push(Tt.value());
                                  return at;
                                }();
                                return (Re = Ge).f.apply(Re, Xe);
                              })), lt.length && (lt = n.filter(me, lt)), Ie === t.noMore ? Ie : S();
                            }
                        } else
                          return t.more;
                      }, ve = function() {
                        var Ie = S();
                        return ct && (n.all(L, xt) || n.all(te, Ae)) && (Ie = t.noMore, rt(f())), Ie === t.noMore && Oe(), Ie;
                      };
                      return Ee.subscribe(function(Ie) {
                        if (Ie.isEnd())
                          ct = !0, Ee.markEnded(), ke();
                        else if (Ie.isError())
                          var Qe = rt(Ie);
                        else
                          Ee.push(Ie), Ee.sync && (lt.push({ source: Ee, e: Ie }), $e || b.hasWaiters() ? ke() : ve());
                        return Qe === t.noMore && Oe(), Qe || t.more;
                      });
                    };
                  };
                  return new t.CompositeUnsubscribe(function() {
                    for (var Ee = [], Oe = 0, ke; Oe < L.length; Oe++)
                      ke = L[Oe], Ee.push(_e(ke));
                    return Ee;
                  }()).unsubscribe;
                });
                return wt;
              };
              var c = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? [] : arguments[1], L = function(te) {
                  if (n.contains(A, te))
                    return !0;
                  var we = te.internalDeps();
                  return we.length ? (A.push(te), n.any(we, L)) : (A.push(te), !1);
                };
                return n.any(e, L);
              }, J = function(e) {
                return n.isFunction(e) ? e : n.always(e);
              };
              t.groupSimultaneous = function() {
                for (var e = arguments.length, A = Array(e), L = 0; L < e; L++)
                  A[L] = arguments[L];
                A.length === 1 && _(A[0]) && (A = A[0]);
                var te = function() {
                  for (var we = [], Ne = 0, ze; Ne < A.length; Ne++)
                    ze = A[Ne], we.push(new ge(ze));
                  return we;
                }();
                return fe(new t.Desc(t, "groupSimultaneous", A), t.when(te, function() {
                  for (var we = arguments.length, Ne = Array(we), ze = 0; ze < we; ze++)
                    Ne[ze] = arguments[ze];
                  return Ne;
                }));
              };
              function oe(e, A, L) {
                ye.call(this, A, L), this.property = e, this.subscribe = n.bind(this.subscribe, this), this.current = U, this.currentValueRootId = void 0, this.propertyEnded = !1;
              }
              v(oe, ye), y(oe.prototype, {
                push: function(e) {
                  return e.isEnd() && (this.propertyEnded = !0), e.hasValue() && (this.current = new g(e), this.currentValueRootId = b.currentEventId()), ye.prototype.push.call(this, e);
                },
                maybeSubSource: function(e, A) {
                  return A === t.noMore ? M : this.propertyEnded ? (e(f()), M) : ye.prototype.subscribe.call(this, e);
                },
                subscribe: function(e) {
                  var A = this, L = t.more;
                  if (this.current.isDefined && (this.hasSubscribers() || this.propertyEnded)) {
                    var te = b.currentEventId(), we = this.currentValueRootId;
                    return !this.propertyEnded && we && te && te !== we ? (b.whenDoneWith(this.property, function() {
                      if (A.currentValueRootId === we)
                        return e(be(A.current.get().value()));
                    }), this.maybeSubSource(e, L)) : (b.inTransaction(void 0, this, function() {
                      return L = e(be(this.current.get().value())), L;
                    }, []), this.maybeSubSource(e, L));
                  } else
                    return this.maybeSubSource(e, L);
                }
              });
              function Be(e, A, L) {
                se.call(this, e), k(A), this.dispatcher = new oe(this, A, L), Ot(this);
              }
              v(Be, se), y(Be.prototype, {
                _isProperty: !0,
                changes: function() {
                  var e = this;
                  return new N(new t.Desc(this, "changes", []), function(A) {
                    return e.dispatcher.subscribe(function(L) {
                      if (!L.isInitial())
                        return A(L);
                    });
                  });
                },
                withHandler: function(e) {
                  return new Be(new t.Desc(this, "withHandler", [e]), this.dispatcher.subscribe, e);
                },
                toProperty: function() {
                  return W(arguments), this;
                },
                toEventStream: function() {
                  var e = this;
                  return new N(new t.Desc(this, "toEventStream", []), function(A) {
                    return e.dispatcher.subscribe(function(L) {
                      return L.isInitial() && (L = L.toNext()), A(L);
                    });
                  });
                }
              }), t.Property = Be, t.constant = function(e) {
                return new Be(new t.Desc(t, "constant", [e]), function(A) {
                  return A(be(e)), A(f()), M;
                });
              }, t.fromBinder = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? n.id : arguments[1], L = new t.Desc(t, "fromBinder", [e, A]);
                return new N(L, function(te) {
                  var we = !1, Ne = !1, ze = function() {
                    if (!we)
                      return typeof Ve < "u" && Ve !== null ? (Ve(), we = !0) : Ne = !0;
                  }, Ve = e(function() {
                    for (var Ze, Je = arguments.length, st = Array(Je), ot = 0; ot < Je; ot++)
                      st[ot] = arguments[ot];
                    var ut = A.apply(this, st);
                    _(ut) && ((Ze = n.last(ut)) != null && Ze._isEvent) || (ut = [ut]);
                    for (var mt = t.more, qe = 0, $e; qe < ut.length; qe++)
                      if ($e = ut[qe], mt = te($e = R($e)), mt === t.noMore || $e.isEnd())
                        return ze(), mt;
                    return mt;
                  });
                  return Ne && ze(), ze;
                });
              }, t.Observable.prototype.map = function(e) {
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return ae(this, e, L, function(we) {
                  return fe(new t.Desc(this, "map", [we]), this.withHandler(function(Ne) {
                    return this.push(Ne.fmap(we));
                  }));
                });
              };
              var Ye = function(e) {
                return _(e[0]) ? e[0] : Array.prototype.slice.call(e);
              }, We = function(e) {
                return n.isFunction(e[0]) ? [Ye(Array.prototype.slice.call(e, 1)), e[0]] : [Ye(Array.prototype.slice.call(e, 0, e.length - 1)), n.last(e)];
              };
              t.combineAsArray = function() {
                var e = Ye(arguments);
                if (e.length) {
                  for (var A = [], L = 0; L < e.length; L++) {
                    var te = Q(e[L]) ? e[L] : t.constant(e[L]);
                    A.push(new C(te, !0));
                  }
                  return fe(new t.Desc(t, "combineAsArray", e), t.when(A, function() {
                    for (var we = arguments.length, Ne = Array(we), ze = 0; ze < we; ze++)
                      Ne[ze] = arguments[ze];
                    return Ne;
                  }).toProperty());
                } else
                  return t.constant([]);
              }, t.onValues = function() {
                return t.combineAsArray(Array.prototype.slice.call(arguments, 0, arguments.length - 1)).onValues(arguments[arguments.length - 1]);
              }, t.combineWith = function() {
                var e = We(arguments), A = e[0], L = e[1], te = new t.Desc(t, "combineWith", [L].concat(A));
                return fe(te, t.combineAsArray(A).map(function(we) {
                  return L.apply(void 0, we);
                }));
              }, t.Observable.prototype.combine = function(e, A) {
                var L = K(A), te = new t.Desc(this, "combine", [e, A]);
                return fe(te, t.combineAsArray(this, e).map(function(we) {
                  return L(we[0], we[1]);
                }));
              }, t.Observable.prototype.withStateMachine = function(e, A) {
                var L = e, te = new t.Desc(this, "withStateMachine", [e, A]);
                return fe(te, this.withHandler(function(we) {
                  var Ne = A(L, we), ze = Ne[0], Ve = Ne[1];
                  L = ze;
                  for (var Ze = t.more, Je = 0, st; Je < Ve.length; Je++)
                    if (st = Ve[Je], Ze = this.push(st), Ze === t.noMore)
                      return Ze;
                  return Ze;
                }));
              };
              var Ke = function(e, A) {
                return e === A;
              }, et = function(e) {
                return typeof e < "u" && e !== null ? e._isNone : !1;
              };
              t.Observable.prototype.skipDuplicates = function() {
                var e = arguments.length <= 0 || arguments[0] === void 0 ? Ke : arguments[0], A = new t.Desc(this, "skipDuplicates", []);
                return fe(A, this.withStateMachine(U, function(L, te) {
                  return te.hasValue() ? te.isInitial() || et(L) || !e(L.get(), te.value()) ? [new g(te.value()), [te]] : [L, []] : [L, [te]];
                }));
              }, t.Observable.prototype.awaiting = function(e) {
                var A = new t.Desc(this, "awaiting", [e]);
                return fe(A, t.groupSimultaneous(this, e).map(function(L) {
                  return L[1].length === 0;
                }).toProperty(!1).skipDuplicates());
              }, t.Observable.prototype.not = function() {
                return fe(new t.Desc(this, "not", []), this.map(function(e) {
                  return !e;
                }));
              }, t.Property.prototype.and = function(e) {
                return fe(new t.Desc(this, "and", [e]), this.combine(e, function(A, L) {
                  return A && L;
                }));
              }, t.Property.prototype.or = function(e) {
                return fe(new t.Desc(this, "or", [e]), this.combine(e, function(A, L) {
                  return A || L;
                }));
              }, t.scheduler = {
                setTimeout: function(e, A) {
                  return setTimeout(e, A);
                },
                setInterval: function(e, A) {
                  return setInterval(e, A);
                },
                clearInterval: function(e) {
                  return clearInterval(e);
                },
                clearTimeout: function(e) {
                  return clearTimeout(e);
                },
                now: function() {
                  return (/* @__PURE__ */ new Date()).getTime();
                }
              }, t.EventStream.prototype.bufferWithTime = function(e) {
                return fe(new t.Desc(this, "bufferWithTime", [e]), this.bufferWithTimeOrCount(e, Number.MAX_VALUE));
              }, t.EventStream.prototype.bufferWithCount = function(e) {
                return fe(new t.Desc(this, "bufferWithCount", [e]), this.bufferWithTimeOrCount(void 0, e));
              }, t.EventStream.prototype.bufferWithTimeOrCount = function(e, A) {
                var L = function(we) {
                  if (we.values.length === A)
                    return we.flush();
                  if (e !== void 0)
                    return we.schedule();
                }, te = new t.Desc(this, "bufferWithTimeOrCount", [e, A]);
                return fe(te, this.buffer(e, L, L));
              }, t.EventStream.prototype.buffer = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? M : arguments[1], L = arguments.length <= 2 || arguments[2] === void 0 ? M : arguments[2], te = {
                  scheduled: null,
                  end: void 0,
                  values: [],
                  flush: function() {
                    if (this.scheduled && (t.scheduler.clearTimeout(this.scheduled), this.scheduled = null), this.values.length > 0) {
                      var ze = this.values;
                      this.values = [];
                      var Ve = this.push(i(ze));
                      if (this.end != null)
                        return this.push(this.end);
                      if (Ve !== t.noMore)
                        return L(this);
                    } else if (this.end != null)
                      return this.push(this.end);
                  },
                  schedule: function() {
                    var ze = this;
                    if (!this.scheduled)
                      return this.scheduled = e(function() {
                        return ze.flush();
                      });
                  }
                }, we = t.more;
                if (!n.isFunction(e)) {
                  var Ne = e;
                  e = function(ze) {
                    return t.scheduler.setTimeout(ze, Ne);
                  };
                }
                return fe(new t.Desc(this, "buffer", []), this.withHandler(function(ze) {
                  var Ve = this;
                  return te.push = function(Ze) {
                    return Ve.push(Ze);
                  }, ze.isError() ? we = this.push(ze) : ze.isEnd() ? (te.end = ze, te.scheduled || te.flush()) : (te.values.push(ze.value()), A(te)), we;
                }));
              }, t.Observable.prototype.filter = function(e) {
                D(e);
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return ae(this, e, L, function(we) {
                  return fe(new t.Desc(this, "filter", [we]), this.withHandler(function(Ne) {
                    return Ne.filter(we) ? this.push(Ne) : t.more;
                  }));
                });
              }, t.once = function(e) {
                return new N(new ce(t, "once", [e]), function(A) {
                  return A(R(e)), A(f()), M;
                });
              }, t.EventStream.prototype.concat = function(e) {
                var A = this;
                return new N(new t.Desc(A, "concat", [e]), function(L) {
                  var te = M, we = A.dispatcher.subscribe(function(Ne) {
                    return Ne.isEnd() ? (te = e.toEventStream().dispatcher.subscribe(L), te) : L(Ne);
                  });
                  return function() {
                    return we(), te();
                  };
                });
              }, t.Property.prototype.concat = function(e) {
                return nt(this, this.changes().concat(e));
              }, t.concatAll = function() {
                var e = Ye(arguments);
                return e.length ? fe(new t.Desc(t, "concatAll", e), n.fold(n.tail(e), n.head(e).toEventStream(), function(A, L) {
                  return A.concat(L);
                })) : t.never();
              };
              var nt = function(e, A) {
                var L = new N(xe(e, "justInitValue"), function(te) {
                  var we = void 0, Ne = e.dispatcher.subscribe(function(ze) {
                    return ze.isEnd() || (we = ze), t.noMore;
                  });
                  return b.whenDoneWith(L, function() {
                    return typeof we < "u" && we !== null && te(we), te(f());
                  }), Ne;
                });
                return L.concat(A).toProperty();
              };
              t.Observable.prototype.flatMap = function() {
                return gt(this, pt(arguments));
              }, t.Observable.prototype.flatMapFirst = function() {
                return gt(this, pt(arguments), !0);
              };
              var pt = function(e) {
                return e.length === 1 && Q(e[0]) ? n.always(e[0]) : le(e);
              }, Et = function(e) {
                return Q(e) ? e : t.once(e);
              }, gt = function(e, A, L, te) {
                var we = [e], Ne = [], ze = new t.Desc(e, "flatMap" + (L ? "First" : ""), [A]), Ve = new N(ze, function(Ze) {
                  var Je = new ue(), st = [], ot = function(qe) {
                    var $e = Et(A(qe.value()));
                    return Ne.push($e), Je.add(function(vt, wt) {
                      return $e.dispatcher.subscribe(function(rt) {
                        if (rt.isEnd())
                          return n.remove($e, Ne), ut(), mt(wt), t.noMore;
                        typeof rt < "u" && rt !== null && rt._isInitial && (rt = rt.toNext());
                        var lt = Ze(rt);
                        return lt === t.noMore && vt(), lt;
                      });
                    });
                  }, ut = function() {
                    var qe = st.shift();
                    if (qe)
                      return ot(qe);
                  }, mt = function(qe) {
                    if (qe(), Je.empty())
                      return Ze(f());
                  };
                  return Je.add(function(qe, $e) {
                    return e.dispatcher.subscribe(function(vt) {
                      return vt.isEnd() ? mt($e) : vt.isError() ? Ze(vt) : L && Je.count() > 1 ? t.more : Je.unsubscribed ? t.noMore : te && Je.count() > te ? st.push(vt) : ot(vt);
                    });
                  }), Je.unsubscribe;
                });
                return Ve.internalDeps = function() {
                  return Ne.length ? we.concat(Ne) : we;
                }, Ve;
              };
              t.Observable.prototype.flatMapWithConcurrencyLimit = function(e) {
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                var we = new t.Desc(this, "flatMapWithConcurrencyLimit", [e].concat(L));
                return fe(we, gt(this, pt(L), !1, e));
              }, t.Observable.prototype.flatMapConcat = function() {
                var e = new t.Desc(this, "flatMapConcat", Array.prototype.slice.call(arguments, 0));
                return fe(e, this.flatMapWithConcurrencyLimit.apply(this, [1].concat(j.call(arguments))));
              }, t.later = function(e, A) {
                return fe(new t.Desc(t, "later", [e, A]), t.fromBinder(function(L) {
                  var te = function() {
                    return L([A, f()]);
                  }, we = t.scheduler.setTimeout(te, e);
                  return function() {
                    return t.scheduler.clearTimeout(we);
                  };
                }));
              }, t.Observable.prototype.bufferingThrottle = function(e) {
                var A = new t.Desc(this, "bufferingThrottle", [e]);
                return fe(A, this.flatMapConcat(function(L) {
                  return t.once(L).concat(t.later(e).filter(!1));
                }));
              }, t.Property.prototype.bufferingThrottle = function() {
                return t.Observable.prototype.bufferingThrottle.apply(this, arguments).toProperty();
              };
              function bt() {
                if (!(this instanceof bt))
                  return new bt();
                this.unsubAll = n.bind(this.unsubAll, this), this.subscribeAll = n.bind(this.subscribeAll, this), this.guardedSink = n.bind(this.guardedSink, this), this.sink = void 0, this.subscriptions = [], this.ended = !1, N.call(this, new t.Desc(t, "Bus", []), this.subscribeAll);
              }
              v(bt, N), y(bt.prototype, {
                unsubAll: function() {
                  for (var e = this.subscriptions, A = 0, L; A < e.length; A++)
                    L = e[A], typeof L.unsub == "function" && L.unsub();
                },
                subscribeAll: function(e) {
                  if (this.ended)
                    e(f());
                  else {
                    this.sink = e;
                    for (var A = x(this.subscriptions), L = 0, te; L < A.length; L++)
                      te = A[L], this.subscribeInput(te);
                  }
                  return this.unsubAll;
                },
                guardedSink: function(e) {
                  var A = this;
                  return function(L) {
                    return L.isEnd() ? (A.unsubscribeInput(e), t.noMore) : A.sink(L);
                  };
                },
                subscribeInput: function(e) {
                  return e.unsub = e.input.dispatcher.subscribe(this.guardedSink(e.input)), e.unsub;
                },
                unsubscribeInput: function(e) {
                  for (var A = this.subscriptions, L = 0, te; L < A.length; L++)
                    if (te = A[L], te.input === e) {
                      typeof te.unsub == "function" && te.unsub(), this.subscriptions.splice(L, 1);
                      return;
                    }
                },
                plug: function(e) {
                  var A = this;
                  if (B(e), !this.ended) {
                    var L = { input: e };
                    return this.subscriptions.push(L), typeof this.sink < "u" && this.subscribeInput(L), function() {
                      return A.unsubscribeInput(e);
                    };
                  }
                },
                end: function() {
                  if (this.ended = !0, this.unsubAll(), typeof this.sink == "function")
                    return this.sink(f());
                },
                push: function(e) {
                  if (!this.ended && typeof this.sink == "function") {
                    var A = !this.pushing;
                    if (!A) {
                      this.pushQueue || (this.pushQueue = []), this.pushQueue.push(e);
                      return;
                    }
                    this.pushing = !0;
                    try {
                      return this.sink(i(e));
                    } finally {
                      if (A && this.pushQueue) {
                        for (var L = 0; L < this.pushQueue.length; ) {
                          var e = this.pushQueue[L];
                          this.sink(i(e)), L++;
                        }
                        this.pushQueue = null;
                      }
                      this.pushing = !1;
                    }
                  }
                },
                error: function(e) {
                  if (typeof this.sink == "function")
                    return this.sink(new de(e));
                }
              }), t.Bus = bt;
              var Bt = function(e, A) {
                return he(function(L) {
                  for (var te = G(A, [function(Ve, Ze) {
                    return L.apply(void 0, Ve.concat([Ze]));
                  }]), we = arguments.length, Ne = Array(we > 1 ? we - 1 : 0), ze = 1; ze < we; ze++)
                    Ne[ze - 1] = arguments[ze];
                  return fe(new t.Desc(t, e, [L].concat(Ne)), t.combineAsArray(Ne).flatMap(te));
                });
              };
              t.fromCallback = Bt("fromCallback", function(e) {
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return t.fromBinder(function(we) {
                  return ie(e, L)(we), M;
                }, function(we) {
                  return [we, f()];
                });
              }), t.fromNodeCallback = Bt("fromNodeCallback", function(e) {
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return t.fromBinder(function(we) {
                  return ie(e, L)(we), M;
                }, function(we, Ne) {
                  return we ? [new de(we), f()] : [Ne, f()];
                });
              }), t.combineTemplate = function(e) {
                function A(qe) {
                  return qe[qe.length - 1];
                }
                function L(qe, $e, vt) {
                  return A(qe)[$e] = vt, vt;
                }
                function te(qe, $e) {
                  return function(vt, wt) {
                    L(vt, qe, wt[$e]);
                  };
                }
                function we(qe, $e) {
                  return function(vt) {
                    L(vt, qe, $e);
                  };
                }
                function Ne(qe) {
                  return _(qe) ? [] : {};
                }
                function ze(qe, $e) {
                  return function(vt) {
                    var wt = Ne($e);
                    L(vt, qe, wt), vt.push(wt);
                  };
                }
                function Ve(qe) {
                  if (Q(qe))
                    return !0;
                  if (qe && (qe.constructor == Object || qe.constructor == Array)) {
                    for (var $e in qe)
                      if (Object.prototype.hasOwnProperty.call(qe, $e)) {
                        var vt = qe[$e];
                        if (Ve(vt))
                          return !0;
                      }
                  }
                }
                function Ze(qe, $e) {
                  if (Q($e))
                    ut.push($e), ot.push(te(qe, ut.length - 1));
                  else if (Ve($e)) {
                    var vt = function(wt) {
                      wt.pop();
                    };
                    ot.push(ze(qe, $e)), st($e), ot.push(vt);
                  } else
                    ot.push(we(qe, $e));
                }
                function Je(qe) {
                  for (var $e = Ne(e), vt = [$e], wt = 0, rt; wt < ot.length; wt++)
                    rt = ot[wt], rt(vt, qe);
                  return $e;
                }
                function st(qe) {
                  n.each(qe, Ze);
                }
                var ot = [], ut = [], mt = Ve(e) ? (st(e), t.combineAsArray(ut).map(Je)) : t.constant(e);
                return fe(new t.Desc(t, "combineTemplate", [e]), mt);
              }, t.Observable.prototype.mapEnd = function() {
                var e = le(arguments);
                return fe(new t.Desc(this, "mapEnd", [e]), this.withHandler(function(A) {
                  return A.isEnd() ? (this.push(i(e(A))), this.push(f()), t.noMore) : this.push(A);
                }));
              }, t.Observable.prototype.skipErrors = function() {
                return fe(new t.Desc(this, "skipErrors", []), this.withHandler(function(e) {
                  return e.isError() ? t.more : this.push(e);
                }));
              }, t.EventStream.prototype.takeUntil = function(e) {
                var A = {};
                return fe(new t.Desc(this, "takeUntil", [e]), t.groupSimultaneous(this.mapEnd(A), e.skipErrors()).withHandler(function(L) {
                  if (L.hasValue()) {
                    var te = L.value(), we = te[0], Ne = te[1];
                    if (Ne.length)
                      return this.push(f());
                    for (var ze = t.more, Ve = 0, Ze; Ve < we.length; Ve++)
                      Ze = we[Ve], Ze === A ? ze = this.push(f()) : ze = this.push(i(Ze));
                    return ze;
                  } else
                    return this.push(L);
                }));
              }, t.Property.prototype.takeUntil = function(e) {
                var A = this.changes().takeUntil(e);
                return fe(new t.Desc(this, "takeUntil", [e]), nt(this, A));
              }, t.Observable.prototype.flatMapLatest = function() {
                var e = pt(arguments), A = this.toEventStream();
                return fe(new t.Desc(this, "flatMapLatest", [e]), A.flatMap(function(L) {
                  return Et(e(L)).takeUntil(A);
                }));
              }, t.Property.prototype.delayChanges = function(e, A) {
                return fe(e, nt(this, A(this.changes())));
              }, t.EventStream.prototype.delayChanges = function(e, A) {
                return fe(e, A(this));
              }, t.Observable.prototype.delay = function(e) {
                return this.delayChanges(new t.Desc(this, "delay", [e]), function(A) {
                  return A.flatMap(function(L) {
                    return t.later(e, L);
                  });
                });
              }, t.Observable.prototype.debounce = function(e) {
                return this.delayChanges(new t.Desc(this, "debounce", [e]), function(A) {
                  return A.flatMapLatest(function(L) {
                    return t.later(e, L);
                  });
                });
              }, t.Observable.prototype.debounceImmediate = function(e) {
                return this.delayChanges(new t.Desc(this, "debounceImmediate", [e]), function(A) {
                  return A.flatMapFirst(function(L) {
                    return t.once(L).concat(t.later(e).filter(!1));
                  });
                });
              }, t.Observable.prototype.decode = function(e) {
                return fe(new t.Desc(this, "decode", [e]), this.combine(t.combineTemplate(e), function(A, L) {
                  return L[A];
                }));
              }, t.Observable.prototype.scan = function(e, A) {
                var L = this, te;
                A = K(A);
                var we = Y(e), Ne = !1, ze = function(Ve) {
                  var Ze = !1, Je = M, st = t.more, ot = function() {
                    if (!Ze)
                      return we.forEach(function(ut) {
                        if (Ze = Ne = !0, st = Ve(new Z(function() {
                          return ut;
                        })), st === t.noMore)
                          return Je(), Je = M, Je;
                      });
                  };
                  return Je = L.dispatcher.subscribe(function(ut) {
                    if (ut.hasValue()) {
                      if (Ne && ut.isInitial())
                        return t.more;
                      ut.isInitial() || ot(), Ze = Ne = !0;
                      var mt = we.getOrElse(void 0), qe = A(mt, ut.value());
                      return we = new g(qe), Ve(ut.apply(function() {
                        return qe;
                      }));
                    } else if (ut.isEnd() && (st = ot()), st !== t.noMore)
                      return Ve(ut);
                  }), b.whenDoneWith(te, ot), Je;
                };
                return te = new Be(new t.Desc(this, "scan", [e, A]), ze), te;
              }, t.Observable.prototype.diff = function(e, A) {
                return A = K(A), fe(new t.Desc(this, "diff", [e, A]), this.scan([e], function(L, te) {
                  return [te, A(L[0], te)];
                }).filter(function(L) {
                  return L.length === 2;
                }).map(function(L) {
                  return L[1];
                }));
              }, t.Observable.prototype.doAction = function() {
                var e = le(arguments);
                return fe(new t.Desc(this, "doAction", [e]), this.withHandler(function(A) {
                  return A.hasValue() && e(A.value()), this.push(A);
                }));
              }, t.Observable.prototype.doEnd = function() {
                var e = le(arguments);
                return fe(new t.Desc(this, "doEnd", [e]), this.withHandler(function(A) {
                  return A.isEnd() && e(), this.push(A);
                }));
              }, t.Observable.prototype.doError = function() {
                var e = le(arguments);
                return fe(new t.Desc(this, "doError", [e]), this.withHandler(function(A) {
                  return A.isError() && e(A.error), this.push(A);
                }));
              }, t.Observable.prototype.doLog = function() {
                for (var e = arguments.length, A = Array(e), L = 0; L < e; L++)
                  A[L] = arguments[L];
                return fe(new t.Desc(this, "doLog", A), this.withHandler(function(te) {
                  return typeof console < "u" && console !== null && typeof console.log == "function" && console.log.apply(console, A.concat([te.log()])), this.push(te);
                }));
              }, t.Observable.prototype.endOnError = function(e) {
                typeof e < "u" && e !== null || (e = !0);
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return ae(this, e, L, function(we) {
                  return fe(new t.Desc(this, "endOnError", []), this.withHandler(function(Ne) {
                    return Ne.isError() && we(Ne.error) ? (this.push(Ne), this.push(f())) : this.push(Ne);
                  }));
                });
              }, se.prototype.errors = function() {
                return fe(new t.Desc(this, "errors", []), this.filter(function() {
                  return !1;
                }));
              }, t.Observable.prototype.take = function(e) {
                return e <= 0 ? t.never() : fe(new t.Desc(this, "take", [e]), this.withHandler(function(A) {
                  return A.hasValue() ? (e--, e > 0 ? this.push(A) : (e === 0 && this.push(A), this.push(f()), t.noMore)) : this.push(A);
                }));
              }, t.Observable.prototype.first = function() {
                return fe(new t.Desc(this, "first", []), this.take(1));
              }, t.Observable.prototype.mapError = function() {
                var e = le(arguments);
                return fe(new t.Desc(this, "mapError", [e]), this.withHandler(function(A) {
                  return A.isError() ? this.push(i(e(A.error))) : this.push(A);
                }));
              }, t.Observable.prototype.flatMapError = function(e) {
                var A = new t.Desc(this, "flatMapError", [e]);
                return fe(A, this.mapError(function(L) {
                  return new de(L);
                }).flatMap(function(L) {
                  return L instanceof de ? e(L.error) : t.once(L);
                }));
              }, t.EventStream.prototype.flatScan = function(e, A) {
                var L = e;
                return this.flatMapConcat(function(te) {
                  return Et(A(L, te)).doAction(function(we) {
                    return L = we;
                  });
                }).toProperty(e);
              }, t.EventStream.prototype.sampledBy = function(e, A) {
                return fe(new t.Desc(this, "sampledBy", [e, A]), this.toProperty().sampledBy(e, A));
              }, t.Property.prototype.sampledBy = function(e, A) {
                var L = !1;
                typeof A < "u" && A !== null ? A = K(A) : (L = !0, A = function(Ve) {
                  return Ve.value();
                });
                var te = new C(this, !1, L), we = new C(e, !0, L), Ne = t.when([te, we], A), ze = e._isProperty ? Ne.toProperty() : Ne;
                return fe(new t.Desc(this, "sampledBy", [e, A]), ze);
              }, t.Property.prototype.sample = function(e) {
                return fe(new t.Desc(this, "sample", [e]), this.sampledBy(t.interval(e, {})));
              }, t.Observable.prototype.map = function(e) {
                if (e && e._isProperty)
                  return e.sampledBy(this, h);
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return ae(this, e, L, function(we) {
                  return fe(new t.Desc(this, "map", [we]), this.withHandler(function(Ne) {
                    return this.push(Ne.fmap(we));
                  }));
                });
              }, t.Observable.prototype.fold = function(e, A) {
                return fe(new t.Desc(this, "fold", [e, A]), this.scan(e, A).sampledBy(this.filter(!1).mapEnd().toProperty()));
              }, se.prototype.reduce = se.prototype.fold;
              var St = [["addEventListener", "removeEventListener"], ["addListener", "removeListener"], ["on", "off"], ["bind", "unbind"]], Nt = function(e) {
                for (var A, L = 0; L < St.length; L++) {
                  A = St[L];
                  var te = [e[A[0]], e[A[1]]];
                  if (te[0] && te[1])
                    return te;
                }
                for (var we = 0; we < St.length; we++) {
                  A = St[we];
                  var Ne = e[A[0]];
                  if (Ne)
                    return [Ne, function() {
                    }];
                }
                throw new de("No suitable event methods in " + e);
              };
              t.fromEventTarget = function(e, A, L) {
                var te = Nt(e), we = te[0], Ne = te[1], ze = new t.Desc(t, "fromEvent", [e, A]);
                return fe(ze, t.fromBinder(function(Ve) {
                  return we.call(e, A, Ve), function() {
                    return Ne.call(e, A, Ve);
                  };
                }, L));
              }, t.fromEvent = t.fromEventTarget, t.fromPoll = function(e, A) {
                var L = new t.Desc(t, "fromPoll", [e, A]);
                return fe(L, t.fromBinder(function(te) {
                  var we = t.scheduler.setInterval(te, e);
                  return function() {
                    return t.scheduler.clearInterval(we);
                  };
                }, A));
              };
              function Wt(e) {
                return [e, f()];
              }
              t.fromPromise = function(e, A) {
                var L = arguments.length <= 2 || arguments[2] === void 0 ? Wt : arguments[2];
                return fe(new t.Desc(t, "fromPromise", [e]), t.fromBinder(function(te) {
                  var we = e.then(te, function(Ne) {
                    return te(new de(Ne));
                  });
                  return we && typeof we.done == "function" && we.done(), A ? function() {
                    if (typeof e.abort == "function")
                      return e.abort();
                  } : function() {
                  };
                }, L));
              }, t.Observable.prototype.groupBy = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? t._.id : arguments[1], L = {}, te = this;
                return te.filter(function(we) {
                  return !L[e(we)];
                }).map(function(we) {
                  var Ne = e(we), ze = te.filter(function(Je) {
                    return e(Je) === Ne;
                  }), Ve = t.once(we).concat(ze), Ze = A(Ve, we).withHandler(function(Je) {
                    if (this.push(Je), Je.isEnd())
                      return delete L[Ne];
                  });
                  return L[Ne] = Ze, Ze;
                });
              }, t.fromArray = function(e) {
                if (o(e), e.length) {
                  var A = 0, L = new N(new t.Desc(t, "fromArray", [e]), function(te) {
                    var we = !1, Ne = t.more, ze = !1, Ve = !1;
                    function Ze() {
                      if (Ve = !0, !ze) {
                        for (ze = !0; Ve; )
                          if (Ve = !1, Ne !== t.noMore && !we) {
                            var Je = e[A++];
                            Ne = te(R(Je)), Ne !== t.noMore && (A === e.length ? te(f()) : b.afterTransaction(L, Ze));
                          }
                        return ze = !1, ze;
                      }
                    }
                    return Ze(), function() {
                      return we = !0, we;
                    };
                  });
                  return L;
                } else
                  return fe(new t.Desc(t, "fromArray", e), t.never());
              }, t.EventStream.prototype.holdWhen = function(e) {
                var A = !1, L = [], te = this, we = !1;
                return new N(new t.Desc(this, "holdWhen", [e]), function(Ne) {
                  var ze = new ue(), Ve = !1, Ze = function(Je) {
                    if (typeof Je == "function" && Je(), ze.empty() && Ve)
                      return Ne(f());
                  };
                  return ze.add(function(Je, st) {
                    return e.subscribeInternal(function(ot) {
                      if (ot.hasValue()) {
                        if (A = ot.value(), !A) {
                          var ut = L;
                          return L = [], function() {
                            for (var mt = [], qe = 0, $e; qe < ut.length; qe++)
                              $e = ut[qe], mt.push(Ne(i($e)));
                            return we && (mt.push(Ne(f())), st()), mt;
                          }();
                        }
                      } else
                        return ot.isEnd() ? Ze(st) : Ne(ot);
                    });
                  }), ze.add(function(Je, st) {
                    return te.subscribeInternal(function(ot) {
                      return A && ot.hasValue() ? L.push(ot.value()) : ot.isEnd() && L.length ? (we = !0, Ze(st)) : Ne(ot);
                    });
                  }), Ve = !0, Ze(), ze.unsubscribe;
                });
              }, t.interval = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
                return fe(new t.Desc(t, "interval", [e, A]), t.fromPoll(e, function() {
                  return i(A);
                }));
              }, t.$ = {}, t.$.asEventStream = function(e, A, L) {
                var te = this;
                return n.isFunction(A) && (L = A, A = void 0), fe(new t.Desc(this.selector || this, "asEventStream", [e]), t.fromBinder(function(we) {
                  return te.on(e, A, we), function() {
                    return te.off(e, A, we);
                  };
                }, L));
              }, typeof jQuery < "u" && jQuery && (jQuery.fn.asEventStream = t.$.asEventStream), typeof Zepto < "u" && Zepto && (Zepto.fn.asEventStream = t.$.asEventStream), t.Observable.prototype.last = function() {
                var e;
                return fe(new t.Desc(this, "last", []), this.withHandler(function(A) {
                  if (A.isEnd())
                    return e && this.push(e), this.push(f()), t.noMore;
                  e = A;
                }));
              }, t.Observable.prototype.log = function() {
                for (var e = arguments.length, A = Array(e), L = 0; L < e; L++)
                  A[L] = arguments[L];
                return this.subscribe(function(te) {
                  typeof console < "u" && typeof console.log == "function" && console.log.apply(console, A.concat([te.log()]));
                }), this;
              }, t.EventStream.prototype.merge = function(e) {
                H(e);
                var A = this;
                return fe(new t.Desc(A, "merge", [e]), t.mergeAll(this, e));
              }, t.mergeAll = function() {
                var e = Ye(arguments);
                return e.length ? new N(new t.Desc(t, "mergeAll", e), function(A) {
                  var L = 0, te = function(Ne) {
                    return function(ze) {
                      return Ne.dispatcher.subscribe(function(Ve) {
                        if (Ve.isEnd())
                          return L++, L === e.length ? A(f()) : t.more;
                        var Ze = A(Ve);
                        return Ze === t.noMore && ze(), Ze;
                      });
                    };
                  }, we = n.map(te, e);
                  return new t.CompositeUnsubscribe(we).unsubscribe;
                }) : t.never();
              }, t.repeatedly = function(e, A) {
                var L = 0;
                return fe(new t.Desc(t, "repeatedly", [e, A]), t.fromPoll(e, function() {
                  return A[L++ % A.length];
                }));
              }, t.repeat = function(e) {
                var A = 0;
                return t.fromBinder(function(L) {
                  var te = !1, we = t.more, Ne = function() {
                  };
                  function ze(Ze) {
                    return Ze.isEnd() ? te ? Ve() : te = !0 : we = L(Ze);
                  }
                  function Ve() {
                    var Ze;
                    for (te = !0; te && we !== t.noMore; )
                      Ze = e(A++), te = !1, Ze ? Ne = Ze.subscribeInternal(ze) : L(f());
                    return te = !0;
                  }
                  return Ve(), function() {
                    return Ne();
                  };
                });
              }, t.retry = function(e) {
                if (!n.isFunction(e.source))
                  throw new F("'source' option has to be a function");
                var A = e.source, L = e.retries || 0, te = 0, we = e.delay || function() {
                  return 0;
                }, Ne = e.isRetryable || function() {
                  return !0;
                }, ze = !1, Ve = null;
                return fe(new t.Desc(t, "retry", [e]), t.repeat(function(Ze) {
                  function Je() {
                    return A(Ze).endOnError().withHandler(function(ut) {
                      if (ut.isError()) {
                        if (Ve = ut, !(Ne(Ve.error) && (L === 0 || te < L)))
                          return ze = !0, this.push(ut);
                      } else
                        return ut.hasValue() && (Ve = null, ze = !0), this.push(ut);
                    });
                  }
                  if (ze)
                    return null;
                  if (Ve) {
                    var st = {
                      error: Ve.error,
                      retriesDone: te
                    }, ot = t.later(we(st)).filter(!1);
                    return te++, ot.concat(t.once().flatMap(Je));
                  } else
                    return Je();
                }));
              }, t.sequentially = function(e, A) {
                var L = 0;
                return fe(new t.Desc(t, "sequentially", [e, A]), t.fromPoll(e, function() {
                  var te = A[L++];
                  return L < A.length ? te : L === A.length ? [te, f()] : f();
                }));
              }, t.Observable.prototype.skip = function(e) {
                return fe(new t.Desc(this, "skip", [e]), this.withHandler(function(A) {
                  return A.hasValue() ? e > 0 ? (e--, t.more) : this.push(A) : this.push(A);
                }));
              }, t.EventStream.prototype.skipUntil = function(e) {
                var A = e.take(1).map(!0).toProperty(!1);
                return fe(new t.Desc(this, "skipUntil", [e]), this.filter(A));
              }, t.EventStream.prototype.skipWhile = function(e) {
                D(e);
                for (var A = !1, L = arguments.length, te = Array(L > 1 ? L - 1 : 0), we = 1; we < L; we++)
                  te[we - 1] = arguments[we];
                return ae(this, e, te, function(Ne) {
                  return fe(new t.Desc(this, "skipWhile", [Ne]), this.withHandler(function(ze) {
                    return A || !ze.hasValue() || !Ne(ze.value()) ? (ze.hasValue() && (A = !0), this.push(ze)) : t.more;
                  }));
                });
              }, t.Observable.prototype.slidingWindow = function(e) {
                var A = arguments.length <= 1 || arguments[1] === void 0 ? 0 : arguments[1];
                return fe(new t.Desc(this, "slidingWindow", [e, A]), this.scan([], function(L, te) {
                  return L.concat([te]).slice(-e);
                }).filter(function(L) {
                  return L.length >= A;
                }));
              };
              var Kt = [], Ot = function(e) {
                if (Kt.length && !Ot.running)
                  try {
                    Ot.running = !0, Kt.forEach(function(A) {
                      A(e);
                    });
                  } finally {
                    delete Ot.running;
                  }
              };
              t.spy = function(e) {
                return Kt.push(e);
              }, t.Property.prototype.startWith = function(e) {
                return fe(new t.Desc(this, "startWith", [e]), this.scan(e, function(A, L) {
                  return L;
                }));
              }, t.EventStream.prototype.startWith = function(e) {
                return fe(new t.Desc(this, "startWith", [e]), t.once(e).concat(this));
              }, t.Observable.prototype.takeWhile = function(e) {
                D(e);
                for (var A = arguments.length, L = Array(A > 1 ? A - 1 : 0), te = 1; te < A; te++)
                  L[te - 1] = arguments[te];
                return ae(this, e, L, function(we) {
                  return fe(new t.Desc(this, "takeWhile", [we]), this.withHandler(function(Ne) {
                    return Ne.filter(we) ? this.push(Ne) : (this.push(f()), t.noMore);
                  }));
                });
              }, t.Observable.prototype.throttle = function(e) {
                return this.delayChanges(new t.Desc(this, "throttle", [e]), function(A) {
                  return A.bufferWithTime(e).map(function(L) {
                    return L[L.length - 1];
                  });
                });
              }, se.prototype.firstToPromise = function(e) {
                var A = this;
                if (typeof e != "function")
                  if (typeof Promise == "function")
                    e = Promise;
                  else
                    throw new F("There isn't default Promise, use shim or parameter");
                return new e(function(L, te) {
                  return A.subscribe(function(we) {
                    return we.hasValue() && L(we.value()), we.isError() && te(we.error), t.noMore;
                  });
                });
              }, se.prototype.toPromise = function(e) {
                return this.last().firstToPromise(e);
              }, t.try = function(e) {
                return function(A) {
                  try {
                    return t.once(e(A));
                  } catch (L) {
                    return new t.Error(L);
                  }
                };
              }, t.update = function(e) {
                function A(ze) {
                  return function() {
                    for (var Ve = arguments.length, Ze = Array(Ve), Je = 0; Je < Ve; Je++)
                      Ze[Je] = arguments[Je];
                    return function(st) {
                      return ze.apply(void 0, [st].concat(Ze));
                    };
                  };
                }
                for (var L = arguments.length, te = Array(L > 1 ? L - 1 : 0), we = 1; we < L; we++)
                  te[we - 1] = arguments[we];
                for (var Ne = te.length - 1; Ne > 0; )
                  te[Ne] instanceof Function || (te[Ne] = n.always(te[Ne])), te[Ne] = A(te[Ne]), Ne = Ne - 2;
                return fe(new t.Desc(t, "update", [e].concat(te)), t.when.apply(t, te).scan(e, function(ze, Ve) {
                  return Ve(ze);
                }));
              }, t.zipAsArray = function() {
                for (var e = arguments.length, A = Array(e), L = 0; L < e; L++)
                  A[L] = arguments[L];
                var te = Ye(A);
                return fe(new t.Desc(t, "zipAsArray", te), t.zipWith(te, function() {
                  for (var we = arguments.length, Ne = Array(we), ze = 0; ze < we; ze++)
                    Ne[ze] = arguments[ze];
                  return Ne;
                }));
              }, t.zipWith = function() {
                for (var e = arguments.length, A = Array(e), L = 0; L < e; L++)
                  A[L] = arguments[L];
                var te = We(A), we = te[0], Ne = te[1];
                return we = n.map(function(ze) {
                  return ze.toEventStream();
                }, we), fe(new t.Desc(t, "zipWith", [Ne].concat(we)), t.when(we, Ne));
              }, t.Observable.prototype.zip = function(e, A) {
                return fe(new t.Desc(this, "zip", [e]), t.zipWith([this, e], A || Array));
              };
              function It(e) {
                this.observable = e;
              }
              It.prototype.subscribe = function(e, A, L) {
                var te = typeof e == "function" ? { next: e, error: A, complete: L } : e, we = {
                  closed: !1,
                  unsubscribe: function() {
                    we.closed = !0, Ne();
                  }
                }, Ne = this.observable.subscribe(function(ze) {
                  ze.isError() ? (te.error && te.error(ze.error), we.unsubscribe()) : ze.isEnd() ? (we.closed = !0, te.complete && te.complete()) : te.next && te.next(ze.value());
                });
                return we;
              }, It.prototype[T("observable")] = function() {
                return this;
              }, t.Observable.prototype.toESObservable = function() {
                return new It(this);
              }, t.Observable.prototype[T("observable")] = t.Observable.prototype.toESObservable, t.fromESObservable = function(e) {
                var A;
                e[T("observable")] ? A = e[T("observable")]() : A = e;
                var L = new t.Desc(t, "fromESObservable", [A]);
                return new t.EventStream(L, function(te) {
                  var we = A.subscribe({
                    error: function() {
                      te(new t.Error()), te(new t.End());
                    },
                    next: function(Ne) {
                      te(new t.Next(Ne, !0));
                    },
                    complete: function() {
                      te(new t.End());
                    }
                  });
                  return we.unsubscribe ? function() {
                    we.unsubscribe();
                  } : we;
                });
              }, d(24) !== null && d(25) != null ? (q = [], ee = (function() {
                return t;
              }).apply(O, q), ee !== void 0 && (X.exports = ee), typeof this < "u" && this !== null && (this.Bacon = t)) : X !== null && X.exports != null ? (X.exports = t, t.Bacon = t) : this.Bacon = t;
            }).call(this);
          }).call(this, d(22), d(23)(Te));
        },
        /* 20 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = /* @__PURE__ */ function() {
            function U(Y, p) {
              for (var w = 0; w < p.length; w++) {
                var u = p[w];
                u.enumerable = u.enumerable || !1, u.configurable = !0, "value" in u && (u.writable = !0), Object.defineProperty(Y, u.key, u);
              }
            }
            return function(Y, p, w) {
              return p && U(Y.prototype, p), w && U(Y, w), Y;
            };
          }(), X = d(3), q = K(X), ee = d(40), j = ae(ee), t = d(26), F = ae(t), M = d(27), h = ae(M), x = d(18), m = ae(x), D = d(46), H = ae(D), B = d(13), k = ae(B), _ = d(35), Q = ae(_), o = d(47), W = ae(o), y = d(12), v = K(y), T = d(36), n = ae(T), r = d(48), b = ae(r), C = d(62), ne = ae(C), ge = d(67), ce = ae(ge), xe = d(70), fe = ae(xe), Ce = d(73), he = ae(Ce), le = d(74), G = ae(le), P = d(4), $ = ae(P), E = d(0);
          d(77), d(84);
          var V = d(86), ie = ae(V);
          function ae(U) {
            return U && U.__esModule ? U : { default: U };
          }
          function K(U) {
            if (U && U.__esModule)
              return U;
            var Y = {};
            if (U != null)
              for (var p in U)
                Object.prototype.hasOwnProperty.call(U, p) && (Y[p] = U[p]);
            return Y.default = U, Y;
          }
          function s(U, Y) {
            if (!(U instanceof Y))
              throw new TypeError("Cannot call a class as a function");
          }
          var g = function() {
            function U(Y, p, w, u, Z) {
              var re = this;
              s(this, U), u ? u instanceof E.selection || ("node" in u ? u = (0, E.select)(u.node()) : u = (0, E.select)(u)) : u = (0, E.select)("body").append("div"), Z || (Z = {}), w || (w = ie.default), this.map_data = Y, this.model_data = p, this.embeddedCss = w, this.selection = u, this.menu_div = null, this.button_div = null, this.search_bar_div = null, this.searchBarRef = null, this.semanticOptions = null, this.mode = "zoom", this.selection.datum(this), this.selection.__builder__ = this, this.has_custom_reaction_styles = !!Z.reaction_styles;
              var de = q.set_options(Z, {
                // view options
                menu: "all",
                scroll_behavior: "pan",
                use_3d_transform: !1,
                enable_editing: !0,
                enable_keys: !0,
                enable_search: !0,
                fill_screen: !1,
                zoom_to_element: null,
                full_screen_button: !1,
                ignore_bootstrap: !1,
                disabled_buttons: null,
                semantic_zoom: null,
                // map, model, and styles
                starting_reaction: null,
                never_ask_before_quit: !1,
                unique_map_id: null,
                // deprecated
                primary_metabolite_radius: 20,
                secondary_metabolite_radius: 10,
                marker_radius: 5,
                gene_font_size: 18,
                hide_secondary_metabolites: !1,
                show_gene_reaction_rules: !1,
                hide_all_labels: !1,
                canvas_size_and_loc: null,
                // applied data
                // reaction
                reaction_data: null,
                reaction_styles: ["color", "size", "text"],
                reaction_compare_style: "log2_fold",
                reaction_scale: null,
                reaction_scale_preset: "GaBuGeRd",
                reaction_no_data_color: "#dcdcdc",
                reaction_no_data_size: 8,
                // gene
                gene_data: null,
                and_method_in_gene_reaction_rule: "mean",
                // metabolite
                metabolite_data: null,
                metabolite_styles: ["color", "size", "text"],
                metabolite_compare_style: "log2_fold",
                metabolite_scale: null,
                metabolite_scale_preset: "WhYlRd",
                metabolite_no_data_color: "#ffffff",
                metabolite_no_data_size: 10,
                // View and build options
                identifiers_on_map: "bigg_id",
                highlight_missing: !1,
                allow_building_duplicate_reactions: !1,
                cofactors: ["atp", "adp", "nad", "nadh", "nadp", "nadph", "gtp", "gdp", "h", "coa", "ump", "h2o", "ppi"],
                // Extensions
                tooltip_component: G.default,
                enable_tooltips: ["label"],
                enable_keys_with_tooltip: !0,
                // Callbacks
                first_load_callback: null
              }, {
                primary_metabolite_radius: !0,
                secondary_metabolite_radius: !0,
                marker_radius: !0,
                gene_font_size: !0,
                reaction_no_data_size: !0,
                metabolite_no_data_size: !0
              });
              if (q.check_for_parent_tag(this.selection, "svg"))
                throw new Error("Builder cannot be placed within an svg node because UI elements are html-based.");
              var be = ["identifiers_on_map", "scroll_behavior", "hide_secondary_metabolites", "show_gene_reaction_rules", "hide_all_labels", "allow_building_duplicate_reactions", "highlight_missing", "enable_tooltips", "reaction_scale_preset", "reaction_no_data_color", "reaction_no_data_size", "reaction_scale", "reaction_styles", "reaction_compare_style", "and_method_in_gene_reaction_rule", "metabolite_scale_preset", "metabolite_scale", "metabolite_styles", "metabolite_compare_style", "metabolite_no_data_color", "metabolite_no_data_size"];
              this.settings = new Q.default(de, be), this.settings.get("fill_screen") && this.settings.get("full_screen_button") && (this.settings.set("full_screen_button", !1), console.warn("The option full_screen_button has no effect when fill_screen is true")), this.isFullScreen = !1, this.settings.get("fill_screen") && ((0, E.select)("html").classed("fill-screen", !0), (0, E.select)("body").classed("fill-screen", !0), this.selection.classed("fill-screen-div", !0), this.isFullScreen = !0), this.savedFullScreenSettings = null, this.savedFullScreenParent = null, this.clearFullScreenEscape = null, this.callback_manager = new k.default();
              var i = this.settings.get("first_load_callback");
              i !== null && this.callback_manager.set("first_load", function() {
                i(re);
              }), this.zoom_container = new F.default(this.selection, this.settings.get("scroll_behavior"), this.settings.get("use_3d_transform")), this.zoom_container.callbackManager.set("zoom_change", function() {
                if (re.settings.get("semantic_zoom")) {
                  var R = re.zoom_container.windowScale, z = re.settings.get("semantic_zoom").sort(function(ue, ye) {
                    return ue.zoomLevel - ye.zoomLevel;
                  }).find(function(ue) {
                    return ue.zoomLevel > R;
                  });
                  if (z) {
                    var se = !1;
                    $.default.mapObject(z.options, function(ue, ye) {
                      re.settings.get(ye) !== ue && (re.settings.set(ye, ue), se = !0);
                    }), se && re._updateData(!1, !0);
                  }
                }
              }), this.settings.streams.use_3d_transform.onValue(function(R) {
                re.zoom_container.setUse3dTransform(R);
              }), this.settings.streams.scroll_behavior.onValue(function(R) {
                re.zoom_container.setScrollBehavior(R);
              }), this.settings.streams.enable_tooltips.onValue(function(R) {
                re._updateTooltipSetting(R);
              }), this.mapToolsContainer = this.selection.append("div").attr("class", "map-tools-container"), this._createStatus(this.selection), this.load_model(this.model_data, !1);
              var f = this.selection.append("div").attr("class", "search-menu-container").append("div").attr("class", "search-menu-container-inline");
              this.menu_div = f.append("div"), this.search_bar_div = f.append("div"), this.button_div = this.selection.append("div"), $.default.delay(function() {
                re.load_map(re.map_data, !1);
                var R = re._reactionCheckAddAbs();
                re._updateData(!0, !0), re.settings.statusBus.onValue(function(z) {
                  if (z === "accept") {
                    if (re._updateData(!0, !0, ["reaction", "metabolite"], !1), re.zoom_container !== null) {
                      var se = re.settings.get("scroll_behavior");
                      re.zoom_container.setScrollBehavior(se);
                    }
                    re.map !== null && (re.map.draw_all_nodes(!1), re.map.draw_all_reactions(!0, !1), re.map.select_none());
                  }
                }), R !== null && setTimeout(R, 500), $.default.defer(function() {
                  return re.callback_manager.run("first_load", re);
                });
              }, 50);
            }
            return U.prototype.load_model = function(p) {
              var w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
              $.default.isNull(p) ? this.cobra_model = null : this.cobra_model = m.default.from_cobra_json(p), this.map && (this.map.cobra_model = this.cobra_model, w && this._updateData(!0, !1), this.settings.get("highlight_missing") && this.map.draw_all_reactions(!1, !1)), this.callback_manager.run("load_model", null, p, w);
            }, U.prototype.load_map = function(p) {
              var w = this, u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, Z = {};
              if (this.settings.get("semantic_zoom")) {
                for (var be = this.settings.get("semantic_zoom"), re = Array.isArray(be), de = 0, be = re ? be : be[Symbol.iterator](); ; ) {
                  var i;
                  if (re) {
                    if (de >= be.length)
                      break;
                    i = be[de++];
                  } else {
                    if (de = be.next(), de.done)
                      break;
                    i = de.value;
                  }
                  var f = i;
                  Object.keys(f.options).map(function(oe) {
                    Z[oe] === void 0 && (Z[oe] = w.settings.get(oe));
                  });
                }
                this.semanticOptions = Object.assign({}, Z);
              }
              q.remove_child_nodes(this.zoom_container.zoomedSel), q.remove_child_nodes(this.mapToolsContainer);
              var R = this.zoom_container.zoomedSel, z = this.zoom_container.svg;
              this.map && this.map.key_manager.toggle(!1), p !== null ? this.map = h.default.from_data(p, z, this.embeddedCss, R, this.zoom_container, this.settings, this.cobra_model, this.settings.get("enable_search")) : this.map = new h.default(z, this.embeddedCss, R, this.zoom_container, this.settings, this.cobra_model, this.settings.get("canvas_size_and_loc"), this.settings.get("enable_search")), this._setupStatus(this.map), this.map.set_status("Loading map ..."), this._updateTooltipSetting(this.settings.get("enable_tooltips")), u && this._updateData(!1, !0), this.build_input = new j.default(this.mapToolsContainer, this.map, this.zoom_container, this.settings), this.text_edit_input = new W.default(this.mapToolsContainer, this.map, this.zoom_container), this.brush = new H.default(R, !1, this.map, ".canvas-group"), this.map.canvas.callbackManager.set("resize", function() {
                w.mode === "brush" && w.brush.toggle(!0);
              }), this.setUpSettingsMenu(this.mapToolsContainer), this.setUpButtonPanel(this.mapToolsContainer);
              var se = this.mapToolsContainer.append("div").attr("class", "search-menu-container").append("div").attr("class", "search-menu-container-inline");
              this.setUpMenuBar(se), this.setUpSearchBar(se), this.tooltip_container = new he.default(this.mapToolsContainer, this.settings.get("tooltip_component"), this.zoom_container, this.map, this.settings), this.map.key_manager.assignedKeys = this.getKeys(), this.map.key_manager.inputList = [this.build_input, this.searchBarRef, function() {
                return w.settingsMenuRef;
              }, this.text_edit_input], this.settings.get("enable_keys_with_tooltip") || this.map.key_manager.inputList.push(this.tooltip_container), this.map.key_manager.update(), this.map.key_manager.toggle(this.settings.get("enable_keys")), this.settings.streams.enable_keys.onValue(function(oe) {
                w.map.key_manager.toggle(oe);
              });
              var ue = this.settings.get("disabled_buttons") || [];
              if (this.settings.get("reaction_data") || ue.push("Clear reaction data"), this.settings.get("gene_data") || ue.push("Clear gene data"), this.settings.get("metabolite_data") || ue.push("Clear metabolite data"), this.settings.get("enable_search") || ue.push("Find"), this.settings.get("enable_editing") || ue.push("Show control points"), this.settings.set("disabled_buttons", ue), this.settings.get("zoom_to_element")) {
                var ye = this.settings.get("zoom_to_element").type, N = this.settings.get("zoom_to_element").id;
                if ($.default.isUndefined(ye) || ["reaction", "node"].indexOf(ye) === -1)
                  throw new Error('zoom_to_element type must be "reaction" or "node"');
                if ($.default.isUndefined(N))
                  throw new Error("zoom_to_element must include id");
                ye === "reaction" ? this.map.zoom_to_reaction(N) : ye === "node" && this.map.zoom_to_node(N);
              } else if (p)
                this.map.zoom_extent_canvas();
              else if (this.settings.get("starting_reaction") && this.cobra_model !== null) {
                var c = this.zoom_container.get_size(), J = { x: c.width / 2, y: c.height / 4 };
                this.map.new_reaction_from_scratch(this.settings.get("starting_reaction"), J, 90), this.map.zoom_extent_nodes();
              } else
                this.map.zoom_extent_canvas();
              this.settings.get("enable_editing") ? this.zoom_mode() : this.view_mode(), this.settings.streams.enable_editing.onValue(function(oe) {
                oe ? w.zoom_mode() : w.view_mode();
              }), this.settings.get("enable_editing") && this._setupConfirmBeforeExit(), this.map.draw_everything(), this.map.set_status(""), this.callback_manager.run("load_map", null, p, u);
            }, U.prototype.passPropsSettingsMenu = function() {
              var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              this.map.callback_manager.run("pass_props_settings_menu", null, p);
            }, U.prototype.setUpSettingsMenu = function(p) {
              var w = this;
              this.settingsMenuRef = null, (0, n.default)(b.default, function(u) {
                w.settingsMenuRef = u;
              }, function(u) {
                return w.map.callback_manager.set("pass_props_settings_menu", u);
              }, p.append("div").node()), this.passPropsSettingsMenu({
                display: !1,
                settings: this.settings,
                map: this.map
              }), $.default.mapObject(this.settings.streams, function(u, Z) {
                u.onValue(function(re) {
                  w.passPropsSettingsMenu();
                });
              }), this.settings.streams.reaction_styles.map(function(u) {
                return $.default.contains(u, "abs");
              }).skipDuplicates().onValue(function() {
                return w._updateData(!1, !0);
              }), this.settings.streams.metabolite_styles.map(function(u) {
                return $.default.contains(u, "abs");
              }).skipDuplicates().onValue(function() {
                return w._updateData(!1, !0);
              });
            }, U.prototype.passPropsMenuBar = function() {
              var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              this.map.callback_manager.run("pass_props_menu_bar", null, p);
            }, U.prototype.setUpMenuBar = function(p) {
              var w = this;
              this.menuBarRef = null, (0, n.default)(ne.default, function(u) {
                w.menuBarRef = u;
              }, function(u) {
                return w.map.callback_manager.set("pass_props_menu_bar", u);
              }, p.append("div").node()), this.passPropsMenuBar({
                display: this.settings.get("menu") === "all",
                settings: this.settings,
                sel: this.selection,
                mode: this.mode,
                map: this.map,
                saveMap: function() {
                  w.semanticOptions && (Object.entries(w.semanticOptions).map(function(Z) {
                    var re = Z[0], de = Z[1];
                    w.settings.set(re, de);
                  }), w._updateData()), w.map.save();
                },
                loadMap: function(Z) {
                  return w.load_map(Z);
                },
                assignKeyLoadMap: function(Z) {
                  w.map.key_manager.assignedKeys.load_map.fn = Z;
                },
                save_svg: function() {
                  return w.map.save_svg();
                },
                save_png: function() {
                  return w.map.save_png();
                },
                clear_map: function() {
                  w.clear_map();
                },
                loadModel: function(Z) {
                  return w.load_model(Z, !0);
                },
                assignKeyLoadModel: function(Z) {
                  w.map.key_manager.assignedKeys.load_model.fn = Z;
                },
                clearModel: function() {
                  w.load_model(null), w.callback_manager.run("clear_model");
                },
                updateRules: function() {
                  return w.map.convert_map();
                },
                setReactionData: function(Z) {
                  return w.set_reaction_data(Z);
                },
                clearReactionData: function() {
                  return w.set_reaction_data(null);
                },
                setGeneData: function(Z) {
                  return w.set_gene_data(Z);
                },
                clearGeneData: function() {
                  return w.set_gene_data(null, !0);
                },
                setMetaboliteData: function(Z) {
                  return w.set_metabolite_data(Z);
                },
                clearMetaboliteData: function(Z) {
                  return w.set_metabolite_data(null);
                },
                setMode: function(Z) {
                  return w._setMode(Z);
                },
                deleteSelected: function() {
                  return w.map.delete_selected();
                },
                undo: function() {
                  return w.map.undo_stack.undo();
                },
                redo: function() {
                  return w.map.undo_stack.redo();
                },
                align_vertical: function() {
                  return w.map.align_vertical();
                },
                align_horizontal: function() {
                  return w.map.align_horizontal();
                },
                togglePrimary: function() {
                  return w.map.toggle_selected_node_primary();
                },
                cyclePrimary: function() {
                  return w.map.cycle_primary_node();
                },
                selectAll: function() {
                  return w.map.select_all();
                },
                selectNone: function() {
                  return w.map.select_none();
                },
                invertSelection: function() {
                  return w.map.invert_selection();
                },
                zoom_in: function() {
                  return w.zoom_container.zoom_in();
                },
                zoom_out: function() {
                  return w.zoom_container.zoom_out();
                },
                zoomExtentNodes: function() {
                  return w.map.zoom_extent_nodes();
                },
                zoomExtentCanvas: function() {
                  return w.map.zoom_extent_canvas();
                },
                full_screen: function() {
                  return w.full_screen();
                },
                search: function() {
                  return w.passPropsSearchBar({ display: !0 });
                },
                toggleBeziers: function() {
                  return w.map.toggle_beziers();
                },
                renderSettingsMenu: function() {
                  return w.passPropsSettingsMenu({ display: !0 });
                }
              }), this.map.callback_manager.set("toggle_beziers", function() {
                w.passPropsMenuBar();
              }), this.settings.streams.disabled_buttons.onValue(function(u) {
                w.passPropsMenuBar();
              }), this.callback_manager.set("set_mode", function(u) {
                w.passPropsMenuBar({ mode: u });
              }), this.settings.streams.menu.onValue(function(u) {
                w.passPropsMenuBar({ display: u === "all" });
              }), this.settings.streams.full_screen_button.onValue(function(u) {
                w.passPropsMenuBar();
              });
            }, U.prototype.passPropsSearchBar = function() {
              var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              this.map.callback_manager.run("pass_props_search_bar", null, p);
            }, U.prototype.setUpSearchBar = function(p) {
              var w = this;
              this.searchBarRef = null, (0, n.default)(ce.default, function(u) {
                w.searchBarRef = u;
              }, function(u) {
                return w.map.callback_manager.set("pass_props_search_bar", u);
              }, p.append("div").node()), this.passPropsSearchBar({
                display: !1,
                searchIndex: this.map.search_index,
                map: this.map
              });
            }, U.prototype.passPropsButtonPanel = function() {
              var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              this.map.callback_manager.run("pass_props_button_panel", null, p);
            }, U.prototype.setUpButtonPanel = function(p) {
              var w = this;
              (0, n.default)(fe.default, null, function(u) {
                return w.map.callback_manager.set("pass_props_button_panel", u);
              }, p.append("div").node()), this.passPropsButtonPanel({
                display: $.default.contains(["all", "zoom"], this.settings.get("menu")),
                mode: this.mode,
                settings: this.settings,
                setMode: function(Z) {
                  return w._setMode(Z);
                },
                zoomContainer: this.zoom_container,
                map: this.map,
                buildInput: this.build_input,
                full_screen: function() {
                  return w.full_screen();
                }
              }), this.callback_manager.set("set_mode", function(u) {
                w.passPropsButtonPanel({ mode: u });
              }), this.settings.streams.full_screen_button.onValue(function(u) {
                w.passPropsButtonPanel();
              });
            }, U.prototype._setMode = function(p) {
              this.mode = p, this.build_input.toggle(p === "build"), this.build_input.direction_arrow.toggle(p === "build"), this.brush.toggle(p === "brush"), this.zoom_container.togglePanDrag(p === "zoom" || p === "view"), this.map.canvas.toggleResize(p !== "view"), p === "rotate" ? (this.map.behavior.toggleSelectableDrag(!1), this.map.behavior.toggleRotationMode(!0)) : (this.map.behavior.toggleRotationMode(p === "rotate"), this.map.behavior.toggleSelectableDrag(p === "brush")), this.map.behavior.toggleSelectableClick(p === "build" || p === "brush"), this.map.behavior.toggleLabelDrag(p === "brush"), this.map.behavior.toggleTextLabelEdit(p === "text"), this.map.behavior.toggleBezierDrag(p === "brush"), (p === "view" || p === "text") && this.map.select_none(), p === "rotate" && this.map.deselect_text_labels(), this.map.draw_everything(), this.callback_manager.run("set_mode", null, p);
            }, U.prototype.view_mode = function() {
              this.callback_manager.run("view_mode"), this._setMode("view");
            }, U.prototype.build_mode = function() {
              this.callback_manager.run("build_mode"), this._setMode("build");
            }, U.prototype.brush_mode = function() {
              this.callback_manager.run("brush_mode"), this._setMode("brush");
            }, U.prototype.zoom_mode = function() {
              this.callback_manager.run("zoom_mode"), this._setMode("zoom");
            }, U.prototype.rotate_mode = function() {
              this.callback_manager.run("rotate_mode"), this._setMode("rotate");
            }, U.prototype.text_mode = function() {
              this.callback_manager.run("text_mode"), this._setMode("text");
            }, U.prototype._reactionCheckAddAbs = function() {
              var p = this, w = this.settings.get("reaction_styles");
              return this.settings.get("reaction_data") && !this.has_custom_reaction_styles && !$.default.contains(w, "abs") ? (this.settings.set("reaction_styles", w.concat("abs")), function() {
                p.map.set_status("Visualizing absolute value of reaction data. Change this option in Settings.", 5e3);
              }) : null;
            }, U.prototype.set_reaction_data = function(p) {
              this.settings.set("reaction_data", p), p && (this.settings._options.gene_data = null);
              var w = this._reactionCheckAddAbs();
              this._updateData(!0, !0, ["reaction"]), w ? w() : this.map.set_status("");
              var u = this.settings.get("disabled_buttons") || [], Z = "Clear reaction data", re = "Clear gene data", de = u.indexOf(Z);
              if (p && de !== -1) {
                u.splice(de, 1);
                var be = u.indexOf(re);
                be === -1 && u.push(re), this.settings.set("disabled_buttons", u);
              } else
                !p && de === -1 && (u.push(Z), this.settings.set("disabled_buttons", u));
            }, U.prototype.set_gene_data = function(p) {
              var w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
              this.settings.set("gene_data", p), w && this.settings.set("show_gene_reaction_rules", !1), p && (this.settings._options.reaction_data = null, this.settings.set("show_gene_reaction_rules", !0)), this._updateData(!0, !0, ["reaction"]), this.map.set_status("");
              var u = this.settings.get("disabled_buttons") || [], Z = u.indexOf("Clear gene data"), re = "Clear gene data", de = "Clear reaction data";
              if (Z > -1 && p) {
                u.splice(Z, 1);
                var be = u.indexOf("Clear reaction data");
                be === -1 && u.push(de), this.settings.set("disabled_buttons", u);
              } else
                Z === -1 && !p && (u.push(re), this.settings.set("disabled_buttons", u));
            }, U.prototype.set_metabolite_data = function(p) {
              this.settings.set("metabolite_data", p), this._updateData(!0, !0, ["metabolite"]), this.map.set_status("");
              var w = this.settings.get("disabled_buttons") || [], u = "Clear metabolite data", Z = w.indexOf(u);
              Z > -1 && p ? (w.splice(Z, 1), this.settings.set("disabled_buttons", w)) : Z === -1 && !p && (w.push(u), this.settings.set("disabled_buttons", w));
            }, U.prototype._makeGeneDataObject = function(p, w, u) {
              var Z = {};
              return w !== null && q.extend(Z, w.reactions), u !== null && q.extend(Z, u.reactions, !0), v.importAndCheck(p, "gene_data", Z);
            }, U.prototype.clear_map = function() {
              this.callback_manager.run("clear_map"), this.map.clearMapData(), this._updateData(!0, !0, ["reaction", "metabolite"], !1), this.map.draw_everything();
            }, U.prototype._updateData = function() {
              var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, u = this, Z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ["reaction", "metabolite"], re = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, de = $.default.contains(Z, "reaction"), be = $.default.contains(Z, "metabolite"), i = void 0, f = void 0, R = void 0;
              be && w && this.map !== null && (i = v.importAndCheck(this.settings.get("metabolite_data"), "metabolite_data"), this.map.apply_metabolite_data_to_map(i), re && this.map.draw_all_nodes(!1)), de && (this.settings.get("reaction_data") && w && this.map !== null ? (f = v.importAndCheck(this.settings.get("reaction_data"), "reaction_data"), this.map.apply_reaction_data_to_map(f), re && this.map.draw_all_reactions(!1, !1)) : this.settings.get("gene_data") && w && this.map !== null ? (R = this._makeGeneDataObject(this.settings.get("gene_data"), this.cobra_model, this.map), this.map.apply_gene_data_to_map(R), re && this.map.draw_all_reactions(!1, !1)) : w && this.map !== null && (this.map.apply_reaction_data_to_map(null), re && this.map.draw_all_reactions(!1, !1))), this.update_model_timer && clearTimeout(this.update_model_timer);
              var z = 5;
              this.update_model_timer = setTimeout(function() {
                be && p && u.cobra_model !== null && (i || (i = v.importAndCheck(u.settings.get("metabolite_data"), "metabolite_data")), u.cobra_model.apply_metabolite_data(i, u.settings.get("metabolite_styles"), u.settings.get("metabolite_compare_style"))), de && (u.settings.get("reaction_data") && p && u.cobra_model !== null ? (f || (f = v.importAndCheck(u.settings.get("reaction_data"), "reaction_data")), u.cobra_model.apply_reaction_data(f, u.settings.get("reaction_styles"), u.settings.get("reaction_compare_style"))) : u.settings.get("gene_data") && p && u.cobra_model !== null ? (R || (R = u._makeGeneDataObject(u.settings.get("gene_data"), u.cobra_model, u.map)), u.cobra_model.apply_gene_data(R, u.settings.get("reaction_styles"), u.settings.get("identifiers_on_map"), u.settings.get("reaction_compare_style"), u.settings.get("and_method_in_gene_reaction_rule"))) : p && u.cobra_model !== null && u.cobra_model.apply_reaction_data(null, u.settings.get("reaction_styles"), u.settings.get("reaction_compare_style"))), u.callback_manager.run("update_data", null, p, w, Z, re);
              }, z);
            }, U.prototype._createStatus = function(p) {
              this.status_bar = p.append("div").attr("id", "status");
            }, U.prototype._setupStatus = function(p) {
              var w = this;
              p.callback_manager.set("set_status", function(u) {
                return w.status_bar.html(u);
              });
            }, U.prototype._updateTooltipSetting = function(p) {
              this.map.behavior.toggleLabelMouseover(p && p.includes("label")), this.map.behavior.toggleObjectMouseover(p && p.includes("object"));
            }, U.prototype.getKeys = function() {
              var p = this, w = this.map, u = this.zoom_container;
              return {
                save: {
                  key: "ctrl+s",
                  target: w,
                  fn: w.save
                },
                save_svg: {
                  key: "ctrl+shift+s",
                  target: w,
                  fn: w.save_svg
                },
                save_png: {
                  key: "ctrl+shift+p",
                  target: w,
                  fn: w.save_png
                },
                load_map: {
                  key: "ctrl+o",
                  fn: null
                  // defined by button
                },
                convert_map: {
                  target: w,
                  fn: w.convert_map
                },
                load_model: {
                  key: "ctrl+m",
                  fn: null
                  // defined by button
                },
                zoom_in_ctrl: {
                  key: "ctrl+=",
                  target: u,
                  fn: u.zoom_in
                },
                zoom_in: {
                  key: "=",
                  target: u,
                  fn: u.zoom_in,
                  ignoreWithInput: !0
                },
                zoom_out_ctrl: {
                  key: "ctrl+-",
                  target: u,
                  fn: u.zoom_out
                },
                zoom_out: {
                  key: "-",
                  target: u,
                  fn: u.zoom_out,
                  ignoreWithInput: !0
                },
                extent_nodes_ctrl: {
                  key: "ctrl+0",
                  target: w,
                  fn: w.zoom_extent_nodes
                },
                extent_nodes: {
                  key: "0",
                  target: w,
                  fn: w.zoom_extent_nodes,
                  ignoreWithInput: !0
                },
                extent_canvas_ctrl: {
                  key: "ctrl+1",
                  target: w,
                  fn: w.zoom_extent_canvas
                },
                extent_canvas: {
                  key: "1",
                  target: w,
                  fn: w.zoom_extent_canvas,
                  ignoreWithInput: !0
                },
                view_mode: {
                  target: this,
                  fn: this.view_mode,
                  ignoreWithInput: !0
                },
                show_settings_ctrl: {
                  key: "ctrl+,",
                  fn: function() {
                    return p.passPropsSettingsMenu({ display: !0 });
                  }
                },
                show_settings: {
                  key: ",",
                  fn: function() {
                    return p.passPropsSettingsMenu({ display: !0 });
                  },
                  ignoreWithInput: !0
                },
                build_mode: {
                  key: "n",
                  target: this,
                  fn: this.build_mode,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                zoom_mode: {
                  key: "z",
                  target: this,
                  fn: this.zoom_mode,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                brush_mode: {
                  key: "v",
                  target: this,
                  fn: this.brush_mode,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                rotate_mode: {
                  key: "r",
                  target: this,
                  fn: this.rotate_mode,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                text_mode: {
                  key: "t",
                  target: this,
                  fn: this.text_mode,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                toggle_beziers: {
                  key: "b",
                  target: w,
                  fn: w.toggle_beziers,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                delete_ctrl: {
                  key: "ctrl+backspace",
                  target: w,
                  fn: w.delete_selected,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                delete: {
                  key: "backspace",
                  target: w,
                  fn: w.delete_selected,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                delete_del: {
                  key: "del",
                  target: w,
                  fn: w.delete_selected,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                align_vertical: {
                  key: "alt+l",
                  target: w,
                  fn: w.align_vertical
                },
                align_horizontal: {
                  key: "shift+alt+l",
                  target: w,
                  fn: w.align_horizontal
                },
                toggle_primary: {
                  key: "p",
                  target: w,
                  fn: w.toggle_selected_node_primary,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                cycle_primary: {
                  key: "c",
                  target: w,
                  fn: w.cycle_primary_node,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                direction_arrow_right: {
                  key: "right",
                  target: this.build_input.direction_arrow,
                  fn: this.build_input.direction_arrow.right,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                direction_arrow_down: {
                  key: "down",
                  target: this.build_input.direction_arrow,
                  fn: this.build_input.direction_arrow.down,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                direction_arrow_left: {
                  key: "left",
                  target: this.build_input.direction_arrow,
                  fn: this.build_input.direction_arrow.left,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                direction_arrow_up: {
                  key: "up",
                  target: this.build_input.direction_arrow,
                  fn: this.build_input.direction_arrow.up,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                undo: {
                  key: "ctrl+z",
                  target: w.undo_stack,
                  fn: w.undo_stack.undo,
                  requires: "enable_editing"
                },
                redo: {
                  key: "ctrl+shift+z",
                  target: w.undo_stack,
                  fn: w.undo_stack.redo,
                  requires: "enable_editing"
                },
                select_all: {
                  key: "ctrl+a",
                  target: w,
                  fn: w.select_all,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                select_none: {
                  key: "ctrl+shift+a",
                  target: w,
                  fn: w.select_none,
                  ignoreWithInput: !0,
                  requires: "enable_editing"
                },
                invert_selection: {
                  target: w,
                  fn: w.invert_selection,
                  requires: "enable_editing"
                },
                search_ctrl: {
                  key: "ctrl+f",
                  fn: function() {
                    return p.passPropsSearchBar({ display: !0 });
                  },
                  requires: "enable_search"
                },
                search: {
                  key: "f",
                  fn: function() {
                    return p.passPropsSearchBar({ display: !0 });
                  },
                  ignoreWithInput: !0,
                  requires: "enable_search"
                }
              };
            }, U.prototype._setupConfirmBeforeExit = function() {
              var p = this;
              window.onbeforeunload = function(w) {
                return p.settings.get("never_ask_before_quit") ? null : "You will lose any unsaved changes.";
              };
            }, U.prototype.full_screen = function() {
              var p = this, w = ["menu", "scroll_behavior", "enable_editing", "enable_keys", "enable_tooltips"];
              if (this.isFullScreen) {
                if ((0, E.select)("html").classed("fill-screen", !1), (0, E.select)("body").classed("fill-screen", !1), this.selection.classed("fill-screen-div", !1), this.isFullScreen = !1, this.clearFullScreenEscape && (this.clearFullScreenEscape(), this.clearFullScreenEscape = null), this.savedFullScreenParent) {
                  var u = this.savedFullScreenParent.node();
                  u.insertBefore(this.selection.remove().node(), u.firstChild), this.savedFullScreenParent = null;
                }
                this.savedFullScreenSettings !== null && $.default.mapObject(this.savedFullScreenSettings, function(de, be) {
                  p.settings.set(be, de);
                }), this.savedFullScreenSettings = null;
              } else {
                var Z = this.settings.get("full_screen_button");
                $.default.isObject(Z) && (this.savedFullScreenSettings = $.default.chain(Z).pairs().map(function(de) {
                  var be = de[0], i = de[1];
                  if ($.default.contains(w, be)) {
                    var f = p.settings.get(be);
                    return p.settings.set(be, i), [be, f];
                  } else
                    return console.warn(be + " not recognized as an option for full_screen_button"), [null, null];
                }).filter(function(de) {
                  var be = de[0];
                  return de[1], be;
                }).object().value()), (0, E.select)("html").classed("fill-screen", !0), (0, E.select)("body").classed("fill-screen", !0), this.selection.classed("fill-screen-div", !0), this.isFullScreen = !0, this.savedFullScreenParent = (0, E.select)(this.selection.node().parentNode);
                var re = (0, E.select)("body").node();
                re.insertBefore(this.selection.remove().node(), re.firstChild), this.clearFullScreenEscape = this.map.key_manager.addEscapeListener(function() {
                  return p.full_screen();
                });
              }
              this.map.zoom_extent_canvas(), this.passPropsButtonPanel({ isFullScreen: this.isFullScreen }), this.passPropsMenuBar({ isFullScreen: this.isFullScreen });
            }, a(U, [{
              key: "options",
              get: function() {
                throw new Error("builder.options is deprecated. Use builder.settings.get() and builder.settings.set() instead.");
              },
              set: function(p) {
                throw new Error("builder.options is deprecated. Use builder.settings.get() and builder.settings.set() instead.");
              }
            }]), U;
          }();
          O.default = q.class_with_optional_new(g);
        },
        /* 21 */
        /***/
        function(Te, O) {
          function d(ee) {
            var j = "    ";
            if (isNaN(parseInt(ee)))
              j = ee;
            else
              switch (ee) {
                case 1:
                  j = " ";
                  break;
                case 2:
                  j = "  ";
                  break;
                case 3:
                  j = "   ";
                  break;
                case 4:
                  j = "    ";
                  break;
                case 5:
                  j = "     ";
                  break;
                case 6:
                  j = "      ";
                  break;
                case 7:
                  j = "       ";
                  break;
                case 8:
                  j = "        ";
                  break;
                case 9:
                  j = "         ";
                  break;
                case 10:
                  j = "          ";
                  break;
                case 11:
                  j = "           ";
                  break;
                case 12:
                  j = "            ";
                  break;
              }
            for (var t = [`
`], F = 0; F < 100; F++)
              t.push(t[F] + j);
            return t;
          }
          function a() {
            this.step = "    ", this.shift = d(this.step);
          }
          a.prototype.xml = function(ee, j) {
            var t = ee.replace(/>\s{0,}</g, "><").replace(/</g, "~::~<").replace(/\s*xmlns\:/g, "~::~xmlns:").replace(/\s*xmlns\=/g, "~::~xmlns=").split("~::~"), F = t.length, M = !1, h = 0, x = "", m = 0, D = j ? d(j) : this.shift;
            for (m = 0; m < F; m++)
              t[m].search(/<!/) > -1 ? (x += D[h] + t[m], M = !0, (t[m].search(/-->/) > -1 || t[m].search(/\]>/) > -1 || t[m].search(/!DOCTYPE/) > -1) && (M = !1)) : t[m].search(/-->/) > -1 || t[m].search(/\]>/) > -1 ? (x += t[m], M = !1) : /^<\w/.exec(t[m - 1]) && /^<\/\w/.exec(t[m]) && /^<[\w:\-\.\,]+/.exec(t[m - 1]) == /^<\/[\w:\-\.\,]+/.exec(t[m])[0].replace("/", "") ? (x += t[m], M || h--) : t[m].search(/<\w/) > -1 && t[m].search(/<\//) == -1 && t[m].search(/\/>/) == -1 ? x = M ? x += t[m] : x += D[h++] + t[m] : t[m].search(/<\w/) > -1 && t[m].search(/<\//) > -1 ? x = M ? x += t[m] : x += D[h] + t[m] : t[m].search(/<\//) > -1 ? x = M ? x += t[m] : x += D[--h] + t[m] : t[m].search(/\/>/) > -1 ? x = M ? x += t[m] : x += D[h] + t[m] : t[m].search(/<\?/) > -1 || t[m].search(/xmlns\:/) > -1 || t[m].search(/xmlns\=/) > -1 ? x += D[h] + t[m] : x += t[m];
            return x[0] == `
` ? x.slice(1) : x;
          }, a.prototype.json = function(ee, t) {
            var t = t || this.step;
            return typeof JSON > "u" ? ee : typeof ee == "string" ? JSON.stringify(JSON.parse(ee), null, t) : typeof ee == "object" ? JSON.stringify(ee, null, t) : ee;
          }, a.prototype.css = function(ee, j) {
            var t = ee.replace(/\s{1,}/g, " ").replace(/\{/g, "{~::~").replace(/\}/g, "~::~}~::~").replace(/\;/g, ";~::~").replace(/\/\*/g, "~::~/*").replace(/\*\//g, "*/~::~").replace(/~::~\s{0,}~::~/g, "~::~").split("~::~"), F = t.length, M = 0, h = "", x = 0, m = j ? d(j) : this.shift;
            for (x = 0; x < F; x++)
              /\{/.exec(t[x]) ? h += m[M++] + t[x] : /\}/.exec(t[x]) ? h += m[--M] + t[x] : (/\*\\/.exec(t[x]), h += m[M] + t[x]);
            return h.replace(/^\n{1,}/, "");
          };
          function X(ee, j) {
            return j - (ee.replace(/\(/g, "").length - ee.replace(/\)/g, "").length);
          }
          function q(ee, j) {
            return ee.replace(/\s{1,}/g, " ").replace(/ AND /ig, "~::~" + j + j + "AND ").replace(/ BETWEEN /ig, "~::~" + j + "BETWEEN ").replace(/ CASE /ig, "~::~" + j + "CASE ").replace(/ ELSE /ig, "~::~" + j + "ELSE ").replace(/ END /ig, "~::~" + j + "END ").replace(/ FROM /ig, "~::~FROM ").replace(/ GROUP\s{1,}BY/ig, "~::~GROUP BY ").replace(/ HAVING /ig, "~::~HAVING ").replace(/ IN /ig, " IN ").replace(/ JOIN /ig, "~::~JOIN ").replace(/ CROSS~::~{1,}JOIN /ig, "~::~CROSS JOIN ").replace(/ INNER~::~{1,}JOIN /ig, "~::~INNER JOIN ").replace(/ LEFT~::~{1,}JOIN /ig, "~::~LEFT JOIN ").replace(/ RIGHT~::~{1,}JOIN /ig, "~::~RIGHT JOIN ").replace(/ ON /ig, "~::~" + j + "ON ").replace(/ OR /ig, "~::~" + j + j + "OR ").replace(/ ORDER\s{1,}BY/ig, "~::~ORDER BY ").replace(/ OVER /ig, "~::~" + j + "OVER ").replace(/\(\s{0,}SELECT /ig, "~::~(SELECT ").replace(/\)\s{0,}SELECT /ig, ")~::~SELECT ").replace(/ THEN /ig, " THEN~::~" + j).replace(/ UNION /ig, "~::~UNION~::~").replace(/ USING /ig, "~::~USING ").replace(/ WHEN /ig, "~::~" + j + "WHEN ").replace(/ WHERE /ig, "~::~WHERE ").replace(/ WITH /ig, "~::~WITH ").replace(/ ALL /ig, " ALL ").replace(/ AS /ig, " AS ").replace(/ ASC /ig, " ASC ").replace(/ DESC /ig, " DESC ").replace(/ DISTINCT /ig, " DISTINCT ").replace(/ EXISTS /ig, " EXISTS ").replace(/ NOT /ig, " NOT ").replace(/ NULL /ig, " NULL ").replace(/ LIKE /ig, " LIKE ").replace(/\s{0,}SELECT /ig, "SELECT ").replace(/\s{0,}UPDATE /ig, "UPDATE ").replace(/ SET /ig, " SET ").replace(/~::~{1,}/g, "~::~").split("~::~");
          }
          a.prototype.sql = function(ee, j) {
            var t = ee.replace(/\s{1,}/g, " ").replace(/\'/ig, "~::~'").split("~::~"), F = t.length, M = [], h = 0, x = this.step, m = 0, D = "", H = 0, B = j ? d(j) : this.shift;
            for (H = 0; H < F; H++)
              H % 2 ? M = M.concat(t[H]) : M = M.concat(q(t[H], x));
            for (F = M.length, H = 0; H < F; H++)
              m = X(M[H], m), /\s{0,}\s{0,}SELECT\s{0,}/.exec(M[H]) && (M[H] = M[H].replace(/\,/g, `,
` + x + x)), /\s{0,}\s{0,}SET\s{0,}/.exec(M[H]) && (M[H] = M[H].replace(/\,/g, `,
` + x + x)), /\s{0,}\(\s{0,}SELECT\s{0,}/.exec(M[H]) ? (h++, D += B[h] + M[H]) : /\'/.exec(M[H]) ? (m < 1 && h && h--, D += M[H]) : (D += B[h] + M[H], m < 1 && h && h--);
            return D = D.replace(/^\n{1,}/, "").replace(/\n{1,}/g, `
`), D;
          }, a.prototype.xmlmin = function(ee, j) {
            var t = j ? ee : ee.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g, "").replace(/[ \r\n\t]{1,}xmlns/g, " xmlns");
            return t.replace(/>\s{0,}</g, "><");
          }, a.prototype.jsonmin = function(ee) {
            return typeof JSON > "u" ? ee : JSON.stringify(JSON.parse(ee), null, 0);
          }, a.prototype.cssmin = function(ee, j) {
            var t = j ? ee : ee.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g, "");
            return t.replace(/\s{1,}/g, " ").replace(/\{\s{1,}/g, "{").replace(/\}\s{1,}/g, "}").replace(/\;\s{1,}/g, ";").replace(/\/\*\s{1,}/g, "/*").replace(/\*\/\s{1,}/g, "*/");
          }, a.prototype.sqlmin = function(ee) {
            return ee.replace(/\s{1,}/g, " ").replace(/\s{1,}\(/, "(").replace(/\s{1,}\)/, ")");
          }, Te.exports = new a();
        },
        /* 22 */
        /***/
        function(Te, O) {
          var d;
          d = /* @__PURE__ */ function() {
            return this;
          }();
          try {
            d = d || new Function("return this")();
          } catch {
            typeof window == "object" && (d = window);
          }
          Te.exports = d;
        },
        /* 23 */
        /***/
        function(Te, O) {
          Te.exports = function(d) {
            return d.webpackPolyfill || (d.deprecate = function() {
            }, d.paths = [], d.children || (d.children = []), Object.defineProperty(d, "loaded", {
              enumerable: !0,
              get: function() {
                return d.l;
              }
            }), Object.defineProperty(d, "id", {
              enumerable: !0,
              get: function() {
                return d.i;
              }
            }), d.webpackPolyfill = 1), d;
          };
        },
        /* 24 */
        /***/
        function(Te, O) {
          Te.exports = function() {
            throw new Error("define cannot be used indirect");
          };
        },
        /* 25 */
        /***/
        function(Te, O) {
          (function(d) {
            Te.exports = d;
          }).call(this, {});
        },
        /* 26 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(3), X = h(a), q = d(13), ee = h(q), j = d(4), t = h(j), F = d(0), M = d(91);
          function h(D) {
            return D && D.__esModule ? D : { default: D };
          }
          function x(D, H) {
            if (!(D instanceof H))
              throw new TypeError("Cannot call a class as a function");
          }
          var m = function() {
            function D(H, B, k) {
              x(this, D), H.classed("escher-container", !0), navigator && navigator.userAgent && navigator.userAgent.indexOf("Safari") !== -1 && navigator.userAgent.indexOf("Mozilla") === -1 && H.on("touchstart touchmove", function() {
                F.event.stopPropagation();
              });
              var _ = H.append("div").attr("class", "escher-zoom-container"), Q = _.append("div").attr("class", "escher-3d-transform-container"), o = Q.append("svg").attr("class", "escher-svg").attr("xmlns", "http://www.w3.org/2000/svg");
              o.select(".zoom-g").remove();
              var W = o.append("g").attr("class", "zoom-g");
              this.selection = H, this.container = _, this.css3TransformContainer = Q, this.svg = o, this.zoomedSel = W, this.windowTranslate = { x: 0, y: 0 }, this.windowScale = 1, this._scrollBehavior = B, this._use3dTransform = k, this._panDragOn = !0, this._zoomBehavior = null, this._zoomTimeout = null, this._svgScale = this.windowScale, this._svgTranslate = this.windowTranslate, this._3dTransform = null, this._requestedFrame = !1, this.callbackManager = new ee.default(), this._updateScroll();
            }
            return D.prototype.setScrollBehavior = function(B) {
              this._scrollBehavior = B, this._updateScroll();
            }, D.prototype.setUse3dTransform = function(B) {
              this._use3dTransform = B;
            }, D.prototype.togglePanDrag = function(B) {
              t.default.isUndefined(B) ? this._panDragOn = !this._panDragOn : this._panDragOn = B, this._panDragOn ? this.zoomedSel.style("cursor", "grab") : this.zoomedSel.style("cursor") === "grab" && this.zoomedSel.style("cursor", null), this._updateScroll();
            }, D.prototype._updateScroll = function() {
              var B = this;
              if (!t.default.contains(["zoom", "pan", "none"], this._scrollBehavior))
                throw Error("Bad value for scroll_behavior: " + this._scrollBehavior);
              if (this.container.on("mousewheel.zoom", null).on("DOMMouseScroll.zoom", null).on("wheel.zoom", null).on("dblclick.zoom", null).on("mousewheel.escher", null).on("DOMMouseScroll.escher", null).on("wheel.escher", null).on("mousedown.zoom", null).on("touchstart.zoom", null).on("touchmove.zoom", null).on("touchend.zoom", null), this._zoomBehavior = (0, M.zoom)().on("start", function() {
                F.event.sourceEvent !== null && (F.event.sourceEvent.stopPropagation(), F.event.sourceEvent.preventDefault());
              }).on("zoom", function() {
                B._goToCallback(F.event.transform.k, {
                  x: F.event.transform.x,
                  y: F.event.transform.y
                });
              }), this.container.call(this._zoomBehavior), this.container.on("dblclick.zoom", null), this._panDragOn || this.container.on("mousedown.zoom", null).on("touchstart.zoom", null).on("touchmove.zoom", null).on("touchend.zoom", null), this._scrollBehavior !== "zoom" && this.container.on("mousewheel.zoom", null).on("DOMMouseScroll.zoom", null).on("wheel.zoom", null), this._scrollBehavior === "pan") {
                var k = function() {
                  var Q = F.event, o = 0.5;
                  Q.stopPropagation(), Q.preventDefault(), Q.returnValue = !1;
                  var W = function(T, n) {
                    var r = t.default.isUndefined(T) ? n : -T / 1.5;
                    return r * o;
                  }, y = {
                    x: B.windowTranslate.x - W(Q.wheelDeltaX, Q.deltaX),
                    y: B.windowTranslate.y - W(Q.wheelDeltaY, Q.deltaY)
                  };
                  B.goTo(B.windowScale, y);
                };
                this.container.on("mousewheel.escher", k), this.container.on("DOMMouseScroll.escher", k), this.container.on("wheel.escher", k);
              }
              this.goTo(this.windowScale, this.windowTranslate);
            }, D.prototype.goTo = function(B, k) {
              if (!B) {
                console.error("Bad scale value");
                return;
              }
              if (!k || !("x" in k) || !("y" in k) || t.default.isNaN(k.x) || t.default.isNaN(k.y)) {
                console.error("Bad translate value");
                return;
              }
              var _ = M.zoomIdentity.translate(k.x, k.y).scale(B);
              this.container.call(this._zoomBehavior.transform, _);
            }, D.prototype._goToCallback = function(B, k) {
              var _ = this;
              this.windowScale !== B && (this.windowScale = B, this.callbackManager.run("zoom_change")), this.windowTranslate = k, this._use3dTransform ? (t.default.isNull(this._zoomTimeout) || clearTimeout(this._zoomTimeout), this._goTo3d(B, k, this._svgScale, this._svgTranslate), this._zoomTimeout = t.default.delay(function() {
                _._requestedFrame = !1, _._goToSvg(B, k);
              }, 100)) : this._goToSvg(B, k), this.callbackManager.run("go_to");
            }, D.prototype._goTo3dFrame = function() {
              var B = this;
              this._requestedFrame || (this._requestedFrame = !0, window.requestAnimationFrame(function() {
                B._requestedFrame = !1;
                var k = B._3dTransform;
                k ? (B.css3TransformContainer.style("transform", k), B.css3TransformContainer.style("-webkit-transform", k), B.css3TransformContainer.style("transform-origin", "0 0"), B.css3TransformContainer.style("-webkit-transform-origin", "0 0")) : console.warn("No _3dTransform defined");
              }));
            }, D.prototype._goTo3d = function(B, k, _, Q) {
              var o = B / _, W = X.default.c_minus_c(k, X.default.c_times_scalar(Q, o)), y = "translate(" + W.x + "px," + W.y + "px) scale(" + o + ")";
              this._3dTransform = y, this._goTo3dFrame();
            }, D.prototype._clear3d = function() {
              this._3dTransform && (this._3dTransform = null, this.css3TransformContainer.style("transform", null), this.css3TransformContainer.style("-webkit-transform", null), this.css3TransformContainer.style("transform-origin", null), this.css3TransformContainer.style("-webkit-transform-origin", null));
            }, D.prototype._goToSvgFrame = function() {
              var B = this, k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
              (!this._requestedFrame || k) && (this._requestedFrame = !0, window.requestAnimationFrame(function() {
                B._requestedFrame = !1, B._clear3d();
                var _ = B._svgScale, Q = B._svgTranslate;
                B.zoomedSel.attr("transform", "translate(" + Q.x + "," + Q.y + ") scale(" + _ + ")"), k && k();
              }));
            }, D.prototype._goToSvg = function(B, k) {
              var _ = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
              this._svgScale = B, this._svgTranslate = k, this._goToSvgFrame(_);
            }, D.prototype.zoomBy = function(B) {
              var k = this.get_size(), _ = {
                x: k.width / 2 - ((k.width / 2 - this.windowTranslate.x) * B + this.windowTranslate.x),
                y: k.height / 2 - ((k.height / 2 - this.windowTranslate.y) * B + this.windowTranslate.y)
              };
              this.goTo(this.windowScale * B, X.default.c_plus_c(this.windowTranslate, _));
            }, D.prototype.zoom_in = function() {
              this.zoomBy(1.5);
            }, D.prototype.zoom_out = function() {
              this.zoomBy(0.667);
            }, D.prototype.get_size = function() {
              var B = this.selection.node().getBoundingClientRect(), k = B.width, _ = B.height;
              return { width: k, height: _ };
            }, D.prototype.translateOffScreen = function(B) {
              var k = 120, _ = this.get_size(), Q = {
                x: {
                  min: -this.windowTranslate.x / this.windowScale + k / this.windowScale,
                  max: -this.windowTranslate.x / this.windowScale + (_.width - k) / this.windowScale
                },
                y: {
                  min: -this.windowTranslate.y / this.windowScale + k / this.windowScale,
                  max: -this.windowTranslate.y / this.windowScale + (_.height - k) / this.windowScale
                }
              };
              B.x < Q.x.min ? (this.windowTranslate.x = this.windowTranslate.x - (B.x - Q.x.min) * this.windowScale, this.goTo(this.windowScale, this.windowTranslate)) : B.x > Q.x.max && (this.windowTranslate.x = this.windowTranslate.x - (B.x - Q.x.max) * this.windowScale, this.goTo(this.windowScale, this.windowTranslate)), B.y < Q.y.min ? (this.windowTranslate.y = this.windowTranslate.y - (B.y - Q.y.min) * this.windowScale, this.goTo(this.windowScale, this.windowTranslate)) : B.y > Q.y.max && (this.windowTranslate.y = this.windowTranslate.y - (B.y - Q.y.max) * this.windowScale, this.goTo(this.windowScale, this.windowTranslate));
            }, D;
          }();
          O.default = m;
        },
        /* 27 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = Object.assign || function(he) {
            for (var le = 1; le < arguments.length; le++) {
              var G = arguments[le];
              for (var P in G)
                Object.prototype.hasOwnProperty.call(G, P) && (he[P] = G[P]);
            }
            return he;
          }, X = d(3), q = ce(X), ee = d(43), j = ge(ee), t = d(28), F = ge(t), M = d(44), h = ge(M), x = d(29), m = ce(x), D = d(31), H = ge(D), B = d(13), k = ge(B), _ = d(32), Q = ge(_), o = d(45), W = ge(o), y = d(12), v = ce(y), T = d(34), n = ge(T), r = d(19);
          ge(r);
          var b = d(4), C = ge(b), ne = d(0);
          function ge(he) {
            return he && he.__esModule ? he : { default: he };
          }
          function ce(he) {
            if (he && he.__esModule)
              return he;
            var le = {};
            if (he != null)
              for (var G in he)
                Object.prototype.hasOwnProperty.call(he, G) && (le[G] = he[G]);
            return le.default = he, le;
          }
          function xe(he, le) {
            if (!(he instanceof le))
              throw new TypeError("Cannot call a class as a function");
          }
          function fe(he) {
            return function(le) {
              return he.apply(null, le);
            };
          }
          var Ce = function() {
            function he(le, G, P, $, E, V, ie, ae, K, s, g) {
              if (xe(this, he), ie === null) {
                var U = $.get_size();
                ie = {
                  x: -U.width,
                  y: -U.height,
                  width: U.width * 3,
                  height: U.height * 3
                };
              }
              C.default.isUndefined(K) || K === null || K === "" ? K = "new_map" : K = String(K), C.default.isUndefined(s) || s === null || s === "" ? s = q.generate_map_id() : s = String(s), C.default.isUndefined(g) || g === null ? g = "" : g = String(g), this.callback_manager = new k.default(), this.svg = le, this.defs = q.setup_defs(le, G), this.canvas = new W.default(P, ie), this.setup_containers(P), this.sel = P, this.zoomContainer = $, this.settings = E, this.cobra_model = V, this.largest_ids = {
                reactions: -1,
                nodes: -1,
                segments: -1,
                text_labels: -1
                // make the undo/redo stack
              }, this.undo_stack = new H.default(), this.behavior = new F.default(this, this.undo_stack), this.draw = new j.default(this.behavior, this.settings, this), this.key_manager = new Q.default(), this.key_manager.settings = E, this.key_manager.ctrlEqualsCmd = !0, this.enable_search = ae, this.search_index = new n.default(), this.map_name = K, this.map_id = s, this.map_description = g, this.beziers_enabled = !1, this.has_data_on_reactions = !1, this.has_data_on_nodes = !1, this.imported_reaction_data = null, this.imported_metabolite_data = null, this.imported_gene_data = null, this.nodes = {}, this.reactions = {}, this.beziers = {}, this.text_labels = {}, this.apply_reaction_data_to_map(null), this.apply_metabolite_data_to_map(null), this.apply_gene_data_to_map(null), this.scale = new h.default(), this.scale.connectToSettings(this.settings, this, this.get_data_statistics.bind(this)), this.rotation_on = !1;
            }
            return he.from_data = function(G, P, $, E, V, ie, ae, K) {
              var s = G[1].canvas, g = G[0].map_name, U = G[0].map_id, Y = G[0].map_description.replace(/(\nLast Modified.*)+$/g, "") + `
Last Modified ` + Date(Date.now()).toString(), p = new he(P, $, E, V, ie, ae, s, K, g, U, Y);
              p.reactions = G[1].reactions, p.nodes = G[1].nodes, p.text_labels = G[1].text_labels;
              for (var w in p.nodes) {
                var u = p.nodes[w];
                if (u.connected_segments = [], K) {
                  if (u.node_type !== "metabolite")
                    continue;
                  p.search_index.insert("n" + w, {
                    name: u.bigg_id,
                    data: {
                      type: "metabolite",
                      node_id: w
                    }
                  }), p.search_index.insert("n_name" + w, {
                    name: u.name,
                    data: {
                      type: "metabolite",
                      node_id: w
                    }
                  });
                }
              }
              for (var Z in p.reactions) {
                var re = p.reactions[Z];
                if (K) {
                  p.search_index.insert("r" + Z, {
                    name: re.bigg_id,
                    data: {
                      type: "reaction",
                      reaction_id: Z
                    }
                  }), p.search_index.insert("r_name" + Z, {
                    name: re.name,
                    data: {
                      type: "reaction",
                      reaction_id: Z
                    }
                  });
                  for (var de in re.genes) {
                    var be = re.genes[de];
                    p.search_index.insert("r" + Z + "_g" + de, {
                      name: be.bigg_id,
                      data: {
                        type: "reaction",
                        reaction_id: Z
                      }
                    }), p.search_index.insert("r" + Z + "_g_name" + de, {
                      name: be.name,
                      data: {
                        type: "reaction",
                        reaction_id: Z
                      }
                    });
                  }
                }
                var i = [], f = function() {
                  if (z = re.segments[R], z.reversibility = re.reversibility, !(z.from_node_id in p.nodes) || !(z.to_node_id in p.nodes))
                    return console.warn("Bad node references in segment " + R + ". Deleting segment."), i.push(R), "continue";
                  var Ke = p.nodes[z.from_node_id], et = p.nodes[z.to_node_id];
                  re.metabolites.forEach(function(nt) {
                    nt.bigg_id === Ke.bigg_id ? z.from_node_coefficient = nt.coefficient : nt.bigg_id === et.bigg_id && (z.to_node_coefficient = nt.coefficient);
                  }), [Ke, et].forEach(function(nt) {
                    nt.connected_segments.push({
                      segment_id: R,
                      reaction_id: Z
                    });
                  }), se = p.nodes[z.from_node_id], ue = p.nodes[z.to_node_id], (se.node_type == "metabolite" || ue.node_type == "metabolite") && (ye = q.c_plus_c(se, q.c_times_scalar(q.c_minus_c(ue, se), 0.5)), z.b1 === null && (z.b1 = ye), z.b2 === null && (z.b2 = ye));
                };
                for (var R in re.segments)
                  var z, se, ue, ye, N = f();
                i.forEach(function(We) {
                  delete re.segments[We];
                });
              }
              if (K)
                for (var c in p.text_labels) {
                  var J = p.text_labels[c];
                  p.search_index.insert("l" + c, {
                    name: J.text,
                    data: {
                      type: "text_label",
                      text_label_id: c
                    }
                  });
                }
              p.beziers = m.newBeziersForReactions(p.reactions), p.largest_ids.reactions = Ye(p.reactions), p.largest_ids.nodes = Ye(p.nodes), p.largest_ids.text_labels = Ye(p.text_labels);
              var oe = 0;
              for (var Be in p.reactions)
                oe = Ye(p.reactions[Be].segments, oe);
              return p.largest_ids.segments = oe, p.apply_reaction_data_to_map(null), p.apply_metabolite_data_to_map(null), p.apply_gene_data_to_map(null), p;
              function Ye(We, Ke) {
                return C.default.isUndefined(Ke) && (Ke = 0), C.default.isUndefined(We) ? Ke : Math.max.apply(null, Object.keys(We).map(function(et) {
                  return parseInt(et);
                }).concat([Ke]));
              }
            }, he.prototype.setup_containers = function(G) {
              G.append("g").attr("id", "reactions"), G.append("g").attr("id", "nodes"), G.append("g").attr("id", "beziers"), G.append("g").attr("id", "text-labels");
            }, he.prototype.reset_containers = function() {
              this.sel.select("#reactions").selectAll(".reaction").remove(), this.sel.select("#nodes").selectAll(".node").remove(), this.sel.select("#beziers").selectAll(".bezier").remove(), this.sel.select("#text-labels").selectAll(".text-label").remove();
            }, he.prototype.set_status = function(G, P) {
              this.callback_manager.run("set_status", null, G), clearTimeout(this._status_timer), this._status_timer = null, P !== void 0 && (this._status_timer = setTimeout((function() {
                this.callback_manager.run("set_status", null, "");
              }).bind(this), P));
            }, he.prototype.clearMapData = function() {
              this.reactions = {}, this.beziers = {}, this.nodes = {}, this.text_labels = {}, this.map_name = "new_map", this.map_id = q.generate_map_id(), this.map_description = "";
            }, he.prototype.has_cobra_model = function() {
              return this.cobra_model !== null;
            }, he.prototype.draw_everything = function() {
              this.draw_all_reactions(!0, !0), this.draw_all_nodes(!0), this.draw_all_text_labels();
            }, he.prototype.draw_all_reactions = function(G, P) {
              C.default.isUndefined(G) && (G = !0), C.default.isUndefined(P) && (P = !0);
              var $ = [];
              for (var E in this.reactions)
                $.push(E);
              this.draw_these_reactions($, !1), G && this.beziers_enabled && this.draw_all_beziers(), P && this.clear_deleted_reactions(G);
            }, he.prototype.draw_these_reactions = function(G, P) {
              C.default.isUndefined(P) && (P = !0);
              var $ = q.object_slice_for_ids_ref(this.reactions, G), E = (function(ie) {
                return this.draw.update_reaction(ie, this.scale, this.cobra_model, this.nodes, this.defs, this.has_data_on_reactions);
              }).bind(this);
              if (q.draw_an_object(this.sel, "#reactions", ".reaction", $, "reaction_id", this.draw.create_reaction.bind(this.draw), E), P) {
                var V = m.bezierIdsForReactionIds($);
                this.draw_these_beziers(V);
              }
            }, he.prototype.clear_deleted_reactions = function(G) {
              C.default.isUndefined(G) && (G = !0), q.draw_an_object(this.sel, "#reactions", ".reaction", this.reactions, "reaction_id", null, function(P) {
                q.draw_a_nested_object(P, ".segment-group", "segments", "segment_id", null, null, function($) {
                  $.remove();
                });
              }, function(P) {
                P.remove();
              }), G === !0 && this.clear_deleted_beziers();
            }, he.prototype.draw_all_nodes = function(G) {
              G === void 0 && (G = !0);
              var P = [];
              for (var $ in this.nodes)
                P.push($);
              this.draw_these_nodes(P), G && this.clear_deleted_nodes();
            }, he.prototype.draw_these_nodes = function(G) {
              var P = q.object_slice_for_ids_ref(this.nodes, G), $ = (function(V) {
                return this.draw.create_node(V, this.nodes, this.reactions);
              }).bind(this), E = (function(V) {
                return this.draw.update_node(V, this.scale, this.has_data_on_nodes, this.behavior.selectableMousedown, this.behavior.selectableClick, this.behavior.nodeMouseover, this.behavior.nodeMouseout, this.behavior.selectableDrag, this.behavior.nodeLabelDrag);
              }).bind(this);
              q.draw_an_object(this.sel, "#nodes", ".node", P, "node_id", $, E);
            }, he.prototype.clear_deleted_nodes = function() {
              q.draw_an_object(this.sel, "#nodes", ".node", this.nodes, "node_id", null, null, function(G) {
                G.remove();
              });
            }, he.prototype.draw_all_text_labels = function() {
              this.draw_these_text_labels(Object.keys(this.text_labels)), this.clear_deleted_text_labels();
            }, he.prototype.draw_these_text_labels = function(G) {
              var P = q.object_slice_for_ids_ref(this.text_labels, G);
              q.draw_an_object(this.sel, "#text-labels", ".text-label", P, "text_label_id", this.draw.create_text_label.bind(this.draw), this.draw.update_text_label.bind(this.draw));
            }, he.prototype.clear_deleted_text_labels = function() {
              q.draw_an_object(this.sel, "#text-labels", ".text-label", this.text_labels, "text_label_id", null, null, function(G) {
                G.remove();
              });
            }, he.prototype.draw_all_beziers = function() {
              var G = [];
              for (var P in this.beziers)
                G.push(P);
              this.draw_these_beziers(G), this.clear_deleted_beziers();
            }, he.prototype.draw_these_beziers = function(G) {
              var P = q.object_slice_for_ids_ref(this.beziers, G), $ = (function(E) {
                return this.draw.update_bezier(E, this.beziers_enabled, this.behavior.bezierDrag, this.behavior.bezierMouseover, this.behavior.bezierMouseout, this.nodes, this.reactions);
              }).bind(this);
              q.draw_an_object(this.sel, "#beziers", ".bezier", P, "bezier_id", this.draw.create_bezier.bind(this.draw), $);
            }, he.prototype.clear_deleted_beziers = function() {
              q.draw_an_object(this.sel, "#beziers", ".bezier", this.beziers, "bezier_id", null, null, function(G) {
                G.remove();
              });
            }, he.prototype.show_beziers = function() {
              this.toggle_beziers(!0);
            }, he.prototype.hide_beziers = function() {
              this.toggle_beziers(!1);
            }, he.prototype.toggle_beziers = function(G) {
              C.default.isUndefined(G) ? this.beziers_enabled = !this.beziers_enabled : this.beziers_enabled = G, this.draw_all_beziers(), this.callback_manager.run("toggle_beziers", null, this.beziers_enabled);
            }, he.prototype.apply_reaction_data_to_map = function(G, P) {
              var $ = this.settings.get("reaction_styles"), E = this.settings.get("reaction_compare_style"), V = v.apply_reaction_data_to_reactions(this.reactions, G, $, E, P);
              return this.has_data_on_reactions = V, this.imported_reaction_data = V ? G : null, this.calc_data_stats("reaction");
            }, he.prototype.apply_metabolite_data_to_map = function(G, P) {
              var $ = this.settings.get("metabolite_styles"), E = this.settings.get("metabolite_compare_style"), V = v.apply_metabolite_data_to_nodes(this.nodes, G, $, E, P);
              return this.has_data_on_nodes = V, this.imported_metabolite_data = V ? G : null, this.calc_data_stats("metabolite");
            }, he.prototype.apply_gene_data_to_map = function(G, P) {
              var $ = this.settings.get("reaction_styles"), E = this.settings.get("reaction_compare_style"), V = this.settings.get("identifiers_on_map"), ie = this.settings.get("and_method_in_gene_reaction_rule"), ae = v.apply_gene_data_to_reactions(this.reactions, G, $, V, E, ie, P);
              return this.has_data_on_reactions = ae, this.imported_gene_data = ae ? G : null, this.calc_data_stats("reaction");
            }, he.prototype.get_data_statistics = function() {
              return this.data_statistics;
            }, he.prototype.calc_data_stats = function(G) {
              if (["reaction", "metabolite"].indexOf(G) === -1)
                throw new Error("Bad type " + G);
              "data_statistics" in this ? G in this.data_statistics || (this.data_statistics[G] = null) : (this.data_statistics = {}, this.data_statistics[G] = null);
              var P = [];
              if (G === "metabolite")
                for (var $ in this.nodes) {
                  var E = this.nodes[$];
                  C.default.isUndefined(E.data) ? console.error("metabolite missing ") : E.data !== null && P.push(E.data);
                }
              else if (G == "reaction")
                for (var V in this.reactions) {
                  var ie = this.reactions[V];
                  C.default.isUndefined(ie.data) ? console.error("reaction data missing ") : ie.data !== null && P.push(ie.data);
                }
              if (P.length === 0) {
                var ae = this.data_statistics[G] === null;
                return this.data_statistics[G] = null, G === "reaction" ? this.callback_manager.run("calc_data_stats__reaction", null, !ae) : this.callback_manager.run("calc_data_stats__metabolite", null, !ae), !ae;
              }
              this.data_statistics[G] === null && (this.data_statistics[G] = {});
              var K = !0, s = q.quartiles(P), g = [["min", fe(Math.min)], ["max", fe(Math.max)], ["mean", q.mean], ["Q1", function() {
                return s[0];
              }], ["median", function() {
                return s[1];
              }], ["Q3", function() {
                return s[2];
              }]];
              if (g.forEach((function(p) {
                var w, u = p[0];
                if (P.length === 0)
                  w = null;
                else {
                  var Z = p[1];
                  w = Z(P);
                }
                w != this.data_statistics[G][u] && (K = !1), this.data_statistics[G][u] = w;
              }).bind(this)), this.data_statistics[G].min === this.data_statistics[G].max && this.data_statistics[G].min !== null) {
                var U = this.data_statistics[G].min, Y = this.data_statistics[G].max;
                this.data_statistics[G].min = U - 1 - Math.abs(U) * 0.1, this.data_statistics[G].max = Y + 1 + Math.abs(Y) * 0.1;
              }
              return G === "reaction" ? this.callback_manager.run("calc_data_stats__reaction", null, !K) : this.callback_manager.run("calc_data_stats__metabolite", null, !K), !K;
            }, he.prototype.get_coords_for_node = function(G) {
              var P = this.nodes[G], $ = { x: P.x, y: P.y };
              return $;
            }, he.prototype.get_selected_node_ids = function() {
              var G = [];
              return this.sel.select("#nodes").selectAll(".selected").each(function(P) {
                G.push(P.node_id);
              }), G;
            }, he.prototype.getSelectedNodes = function() {
              var G = {};
              return this.sel.select("#nodes").selectAll(".selected").each((function(P) {
                G[P.node_id] = this.nodes[P.node_id];
              }).bind(this)), G;
            }, he.prototype.get_selected_text_label_ids = function() {
              var G = [];
              return this.sel.select("#text-labels").selectAll(".selected").each(function(P) {
                G.push(P.text_label_id);
              }), G;
            }, he.prototype.get_selected_text_labels = function() {
              var G = {};
              return this.sel.select("#text-labels").selectAll(".selected").each((function(P) {
                G[P.text_label_id] = this.text_labels[P.text_label_id];
              }).bind(this)), G;
            }, he.prototype.select_all = function() {
              this.sel.selectAll("#nodes,#text-labels").selectAll(".node,.text-label").classed("selected", !0);
            }, he.prototype.select_none = function() {
              this.sel.selectAll(".selected").classed("selected", !1);
            }, he.prototype.invert_selection = function() {
              var G = this.sel.selectAll("#nodes,#text-labels").selectAll(".node,.text-label");
              G.classed("selected", function() {
                return !(0, ne.select)(this).classed("selected");
              });
            }, he.prototype.select_metabolite_with_id = function(G) {
              this.deselect_text_labels();
              var P = this.sel.select("#nodes").selectAll(".node"), $, E;
              P.classed("selected", function(V) {
                var ie = String(V.node_id) == String(G);
                return ie && (E = V, $ = { x: V.x, y: V.y }), ie;
              }), this.sel.selectAll(".start-reaction-target").style("visibility", "hidden"), this.callback_manager.run("select_metabolite_with_id", null, E, $);
            }, he.prototype.select_selectable = function(G, P, $) {
              $ = C.default.isUndefined($) ? !1 : $;
              var E = this.sel.selectAll("#nodes,#text-labels").selectAll(".node,.text-label"), V;
              (0, ne.select)(G).attr("class").indexOf("text-label") == -1 ? V = G.parentNode : V = G, $ ? (0, ne.select)(V).classed("selected", !(0, ne.select)(V).classed("selected")) : (E.classed("selected", !1), (0, ne.select)(V).classed("selected", !0));
              var ie = this.sel.select("#nodes").selectAll(".selected"), ae = 0, K, s;
              ie.each(function(g) {
                s = g, K = { x: g.x, y: g.y }, ae++;
              }), this.callback_manager.run("select_selectable", null, ae, s, K);
            }, he.prototype.select_single_node = function() {
              var G = null, P = this.sel.select("#nodes").selectAll(".selected");
              return P.classed("selected", function($, E) {
                return E === 0 ? (G = $, !0) : !1;
              }), G;
            }, he.prototype.deselect_nodes = function() {
              var G = this.sel.select("#nodes").selectAll(".node");
              G.classed("selected", !1), this.callback_manager.run("deselect_nodes");
            }, he.prototype.select_text_label = function(G, P) {
              this.deselect_nodes();
              var $ = this.sel.select("#text-labels").selectAll(".text-label");
              $.classed("selected", function(V) {
                return P === V;
              });
              var E = this.sel.select("#text-labels").selectAll(".selected");
              E.each(function(V) {
                V.x, V.y;
              }), this.callback_manager.run("select_text_label");
            }, he.prototype.deselect_text_labels = function() {
              var G = this.sel.select("#text-labels").selectAll(".text-label");
              G.classed("selected", !1);
            }, he.prototype.align_vertical = function() {
              return this._align(!1);
            }, he.prototype.align_horizontal = function() {
              return this._align(!0);
            }, he.prototype._align = function(G) {
              var P = this, $ = this.getSelectedNodes(), E = C.default.pick($, function(p) {
                return p.node_type !== "metabolite" || p.node_is_primary;
              }), V = Object.keys(E).length > 0, ie = V ? E : $, ae = Object.keys(ie), K = ae.reduce(function(p, w) {
                return p + (G ? ie[w].y : ie[w].x);
              }, 0) / ae.length, s = C.default.pairs(ie).map(function(p) {
                var w = p[0], u = p[1];
                return {
                  nodeId: w,
                  displacement: G ? { x: 0, y: K - u.y } : { x: K - u.x, y: 0 }
                };
              }), g = [], U = {};
              V && C.default.mapObject(ie, function(p, w) {
                p.connected_segments.map(function(u) {
                  var Z = u.segment_id, re = u.reaction_id, de = P.reactions[re].segments[Z], be = de.to_node_id === p.node_id, i = be ? de.from_node_id : de.to_node_id, f = P.nodes[i], R = be ? "b2" : "b1";
                  if (f.node_id in $ && de[R]) {
                    var z = m.bezierIdForSegmentId(Z, R);
                    if (g.push({
                      reactionId: re,
                      segmentId: Z,
                      bez: R,
                      bezierId: z,
                      displacement: G ? { x: 0, y: p.y - de[R].y } : { x: p.x - de[R].x, y: 0 }
                    }), f.node_type === "metabolite" && !f.node_is_primary && !(i in U)) {
                      var se = f.connected_segments.filter(function(ue) {
                        var ye = P.reactions[re].segments[Z], N = ye.to_node_id === f.node_id;
                        return N ? ye.from_node_id in $ : ye.to_node_id in $;
                      });
                      f.connected_segments.length <= se.length && (s.push({
                        nodeId: i,
                        displacement: G ? { x: 0, y: K - p.y } : { x: K - p.x, y: 0 }
                      }), U[i] = !0);
                    }
                  }
                });
              });
              var Y = function(w, u) {
                var Z = [];
                w.map(function(re) {
                  var de = P.nodes[re.nodeId], be = m.moveNodeAndDependents(de, re.nodeId, P.reactions, P.beziers, re.displacement);
                  Z = q.uniqueConcat([Z, be.reaction_ids]);
                }), u.map(function(re) {
                  var de = P.reactions[re.reactionId].segments[re.segmentId];
                  de[re.bez] = q.c_plus_c(de[re.bez], re.displacement), P.beziers[re.bezierId].x = de[re.bez].x, P.beziers[re.bezierId].y = de[re.bez].y;
                }), P.draw_these_nodes(w.map(function(re) {
                  return re.nodeId;
                })), P.draw_these_reactions(Z, !0);
              };
              this.undo_stack.push(
                // undo
                function() {
                  var p = function(u) {
                    return u.map(function(Z) {
                      return a({}, Z, {
                        displacement: { x: -Z.displacement.x, y: -Z.displacement.y }
                      });
                    });
                  };
                  Y(p(s), p(g));
                },
                // redo
                function() {
                  Y(s, g);
                }
              ).do(), this.set_status(V ? "Aligned reactions" : "Aligned nodes", 3e3);
            }, he.prototype.delete_selected = function() {
              var G = this.getSelectedNodes(), P = this.get_selected_text_labels();
              (Object.keys(G).length >= 1 || Object.keys(P).length >= 1) && this.delete_selectable(G, P, !0);
            }, he.prototype.delete_selectable = function(G, P, $) {
              var E = this.segments_and_reactions_for_nodes(G), V = E.segment_objs_w_segments, ie = E.reactions, ae = q.clone(G), K = q.clone(V), s = q.clone(ie), g = q.clone(P), U = (function(Y, p, w, u) {
                this.delete_node_data(Object.keys(G)), this.delete_segment_data(w), this.delete_reaction_data(Object.keys(p)), this.delete_text_label_data(Object.keys(u));
                var Z = !1, re = !1;
                this.has_data_on_reactions && (Z = this.calc_data_stats("reaction")), this.has_data_on_nodes && (re = this.calc_data_stats("metabolite")), $ && (Z ? this.draw_all_reactions(!0, !0) : this.clear_deleted_reactions(), re ? this.draw_all_nodes(!0) : this.clear_deleted_nodes(), this.clear_deleted_text_labels());
              }).bind(this);
              U(G, ie, V, P), this.undo_stack.push((function() {
                this.extend_nodes(ae), this.extend_reactions(s);
                var Y = Object.keys(s);
                for (var p in K) {
                  var w = K[p], u = w.segment;
                  this.reactions[w.reaction_id].segments[w.segment_id] = u;
                  var Z = [u.from_node_id, u.to_node_id];
                  Z.forEach((function(R) {
                    if (!(R in ae)) {
                      var z = this.nodes[R];
                      z.connected_segments.push({
                        reaction_id: w.reaction_id,
                        segment_id: w.segment_id
                      });
                    }
                  }).bind(this));
                  var re = w.segment_id, de = w.reaction_id, be = {};
                  be[re] = w.segment, q.extend(this.beziers, m.newBeziersForSegments(be, de)), Y.indexOf(w.reaction_id) === -1 && Y.push(w.reaction_id);
                }
                if (this.has_data_on_reactions) {
                  var i = this.calc_data_stats("reaction");
                  i ? this.draw_all_reactions(!0, !1) : this.draw_these_reactions(Y);
                } else
                  $ && this.draw_these_reactions(Y);
                if (this.has_data_on_nodes) {
                  var f = this.calc_data_stats("metabolite");
                  $ && (f ? this.draw_all_nodes(!1) : this.draw_these_nodes(Object.keys(ae)));
                } else
                  $ && this.draw_these_nodes(Object.keys(ae));
                q.extend(this.text_labels, g), $ && this.draw_these_text_labels(Object.keys(g)), P = q.clone(g), G = q.clone(ae), V = q.clone(K), ie = q.clone(s);
              }).bind(this), (function() {
                U(G, ie, V, P);
              }).bind(this));
            }, he.prototype.delete_node_data = function(G) {
              var P = this;
              G.forEach(function($) {
                if (P.enable_search && P.nodes[$].node_type === "metabolite") {
                  var E = P.search_index.remove("n" + $) && P.search_index.remove("n_name" + $);
                  E || console.warn("Could not find deleted metabolite in search index");
                }
                delete P.nodes[$];
              });
            }, he.prototype.delete_segment_data = function(G) {
              for (var P in G) {
                var $ = G[P], E = this.reactions[$.reaction_id];
                if (!($.segment_id in E.segments))
                  return;
                var V = E.segments[$.segment_id];
                [V.from_node_id, V.to_node_id].forEach((function(ie) {
                  if (ie in this.nodes) {
                    var ae = this.nodes[ie];
                    ae.connected_segments = ae.connected_segments.filter(function(K) {
                      return K.segment_id != $.segment_id;
                    });
                  }
                }).bind(this)), ["b1", "b2"].forEach((function(ie) {
                  var ae = m.bezierIdForSegmentId($.segment_id, ie);
                  delete this.beziers[ae];
                }).bind(this)), delete E.segments[$.segment_id];
              }
            }, he.prototype.delete_reaction_data = function(G) {
              G.forEach((function(P) {
                var $ = this.reactions[P];
                for (var E in $.segments)
                  ["b1", "b2"].forEach((function(ae) {
                    var K = m.bezierIdForSegmentId(E, ae);
                    delete this.beziers[K];
                  }).bind(this));
                delete this.reactions[P];
                var V = this.search_index.remove("r" + P) && this.search_index.remove("r_name" + P);
                V || console.warn("Could not find deleted reaction " + P + " in search index");
                for (var ie in $.genes) {
                  var V = this.search_index.remove("r" + P + "_g" + ie) && this.search_index.remove("r" + P + "_g_name" + ie);
                  V || console.warn("Could not find deleted gene " + ie + " in search index");
                }
              }).bind(this));
            }, he.prototype.delete_text_label_data = function(G) {
              G.forEach((function(P) {
                delete this.text_labels[P];
                var $ = this.search_index.remove("l" + P);
                $ || console.warn("Could not find deleted text label in search index");
              }).bind(this));
            }, he.prototype._extend_and_draw_metabolite = function(G, P) {
              this.extend_nodes(G);
              var $ = [P];
              if (this.has_data_on_nodes) {
                if (this.imported_metabolite_data === null)
                  throw new Error("imported_metabolite_data should not be null");
                var E = this.apply_metabolite_data_to_map(this.imported_metabolite_data, $);
                E ? this.draw_all_nodes(!1) : this.draw_these_nodes($);
              } else
                this.draw_these_nodes($);
            }, he.prototype.new_reaction_from_scratch = function(G, P, $) {
              var E = this;
              if (!this.cobra_model) {
                console.error("No CobraModel. Cannot build new reaction");
                return;
              }
              var V = q.clone(this.cobra_model.reactions[G]);
              if (C.default.size(V.metabolites) === 0)
                throw Error("No metabolites in reaction " + V.bigg_id);
              var ie = C.default.map(V.metabolites, function(re, de) {
                return [re, de];
              }).filter(function(re) {
                return re[0] < 0;
              }).map(function(re) {
                return re[1];
              }), ae = ie.length > 0 ? ie[0] : Object.keys(V.metabolites)[0], K = this.cobra_model.metabolites[ae], s = String(++this.largest_ids.nodes), g = m.getMetLabelLoc(q.to_radians($), 0, 1, !0, ae, !0), U = {
                connected_segments: [],
                x: P.x,
                y: P.y,
                node_is_primary: !0,
                label_x: P.x + g.x,
                label_y: P.y + g.y,
                name: K.name,
                bigg_id: ae,
                node_type: "metabolite"
              }, Y = {};
              Y[s] = U, this._extend_and_draw_metabolite(Y, s);
              var p = q.clone(Y), w = this.new_reaction_for_metabolite(G, s, $, !1), u = w.redo, Z = w.undo;
              this.undo_stack.push(function() {
                Z(), E.delete_node_data(Object.keys(Y)), Y = q.clone(p), E.clear_deleted_nodes(), E.deselect_nodes();
              }, function() {
                E._extend_and_draw_metabolite(Y, s), u();
              });
            }, he.prototype.extend_nodes = function(G) {
              if (this.enable_search)
                for (var P in G) {
                  var $ = G[P];
                  $.node_type == "metabolite" && (this.search_index.insert("n" + P, {
                    name: $.bigg_id,
                    data: {
                      type: "metabolite",
                      node_id: P
                    }
                  }), this.search_index.insert("n_name" + P, {
                    name: $.name,
                    data: {
                      type: "metabolite",
                      node_id: P
                    }
                  }));
                }
              q.extend(this.nodes, G);
            }, he.prototype.extend_reactions = function(G) {
              if (this.enable_search)
                for (var P in G) {
                  var $ = G[P];
                  this.search_index.insert("r" + P, {
                    name: $.bigg_id,
                    data: {
                      type: "reaction",
                      reaction_id: P
                    }
                  }), this.search_index.insert("r_name" + P, {
                    name: $.name,
                    data: {
                      type: "reaction",
                      reaction_id: P
                    }
                  });
                  for (var E in $.genes) {
                    var V = $.genes[E];
                    this.search_index.insert("r" + P + "_g" + E, {
                      name: V.bigg_id,
                      data: {
                        type: "reaction",
                        reaction_id: P
                      }
                    }), this.search_index.insert("r" + P + "_g_name" + E, {
                      name: V.name,
                      data: {
                        type: "reaction",
                        reaction_id: P
                      }
                    });
                  }
                }
              q.extend(this.reactions, G);
            }, he.prototype._extend_and_draw_reaction = function(G, P, $, E) {
              this.extend_reactions(P), q.extend(this.beziers, $), this.delete_node_data([E]), this.extend_nodes(G);
              var V = Object.keys(P);
              if (this.has_data_on_reactions) {
                var ie = !1;
                if (this.imported_reaction_data)
                  ie = this.apply_reaction_data_to_map(this.imported_reaction_data, V);
                else if (this.imported_gene_data)
                  ie = this.apply_gene_data_to_map(this.imported_gene_data, V);
                else
                  throw new Error("imported_gene_data or imported_reaction_data should not be null");
                ie ? this.draw_all_reactions(!0, !1) : this.draw_these_reactions(V);
              } else
                this.draw_these_reactions(V);
              var ae = Object.keys(G);
              if (this.has_data_on_nodes) {
                if (this.imported_metabolite_data === null)
                  throw new Error("imported_metabolite_data should not be null");
                var ie = this.apply_metabolite_data_to_map(this.imported_metabolite_data, ae);
                ie ? this.draw_all_nodes(!1) : this.draw_these_nodes(ae);
              } else
                this.draw_these_nodes(ae);
              for (var K in G) {
                var s = G[K];
                if (s.node_is_primary && K != E) {
                  this.select_metabolite_with_id(K);
                  var g = { x: s.x, y: s.y };
                  this.zoomContainer && this.zoomContainer.translateOffScreen(g);
                }
              }
            }, he.prototype.new_reaction_for_metabolite = function(G, P, $, E) {
              var V = this;
              E === void 0 && (E = !0);
              var ie = this.nodes[P], ae = this.cobra_model.reactions[G], K = m.newReaction(G, ae, this.cobra_model.metabolites, P, q.clone(ie), this.largest_ids, this.settings.get("cofactors"), $), s = K.new_nodes, g = K.new_reactions, U = K.new_beziers;
              this._extend_and_draw_reaction(s, g, U, P);
              var Y = q.clone(s), p = q.clone(g), w = q.clone(U), u = function() {
                if (delete s[P], V.delete_node_data(Object.keys(s)), V.delete_reaction_data(Object.keys(g)), V.select_metabolite_with_id(P), s = q.clone(Y), g = q.clone(p), U = q.clone(w), V.has_data_on_reactions) {
                  var de = V.calc_data_stats("reaction");
                  de ? V.draw_all_reactions(!0, !0) : V.clear_deleted_reactions(!0);
                } else
                  V.clear_deleted_reactions(!0);
                if (V.has_data_on_nodes) {
                  var be = V.calc_data_stats("metabolite");
                  be ? V.draw_all_nodes(!0) : V.clear_deleted_nodes();
                } else
                  V.clear_deleted_nodes();
              }, Z = function() {
                V._extend_and_draw_reaction(s, g, U, P);
              };
              return E && this.undo_stack.push(u, Z), { undo: u, redo: Z };
            }, he.prototype.cycle_primary_node = function() {
              var G = this.getSelectedNodes();
              if (!C.default.isEmpty(G)) {
                var P = Object.keys(G)[0];
                G[P];
                var $ = this.reactions, E = this.nodes, V = [], ie;
                if (E[P].connected_segments.forEach(function(R) {
                  ie = [R.reaction_id];
                  var z;
                  try {
                    if (z = $[R.reaction_id].segments[R.segment_id], z === void 0)
                      throw new Error("undefined segment");
                  } catch {
                    console.warn("Could not find connected segment " + R.segment_id);
                    return;
                  }
                  V.push(z.from_node_id == P ? z.to_node_id : z.from_node_id);
                }), V.length != 1) {
                  console.error("Only connected nodes with a single reaction can be selected");
                  return;
                }
                var ae = V[0], K = [P];
                E[ae].connected_segments.forEach(function(R) {
                  var z;
                  try {
                    if (z = $[R.reaction_id].segments[R.segment_id], z === void 0)
                      throw new Error("undefined segment");
                  } catch {
                    console.warn("Could not find connected segment " + R.segment_id);
                    return;
                  }
                  var se = z.from_node_id == ae ? z.to_node_id : z.from_node_id, ue = E[se];
                  ue.node_type == "metabolite" && se != P && K.push(String(se));
                });
                for (var s = 0; s < K.length; s++)
                  if (E[K[s]].connected_segments.length > 1) {
                    console.error("Only connected nodes with a single reaction can be selected");
                    return;
                  }
                for (var g in G)
                  if (g != P && K.indexOf(g) == -1) {
                    console.warn("Selected nodes are not on the same reaction");
                    return;
                  }
                var U = [], i = K.length - 1, Y = E[K[i]], p = Y.node_is_primary, w = {
                  x: Y.x,
                  y: Y.y,
                  label_x: Y.label_x,
                  label_y: Y.label_y
                };
                Y.connected_segments.length > 1 && console.warn("Too many connected segments for node " + Y.node_id);
                var u = Y.connected_segments[0], Z;
                try {
                  if (Z = $[u.reaction_id].segments[u.segment_id], Z === void 0)
                    throw new Error("undefined segment");
                } catch {
                  console.error("Could not find connected segment " + u.segment_id);
                  return;
                }
                var re = { b1: Z.b1, b2: Z.b2 }, de;
                K.forEach(function(R) {
                  var z = E[R], se = z.node_is_primary, ue = {
                    x: z.x,
                    y: z.y,
                    label_x: z.label_x,
                    label_y: z.label_y
                  }, ye = z.connected_segments[0], N = $[ye.reaction_id].segments[ye.segment_id], c = { b1: N.b1, b2: N.b2 };
                  z.node_is_primary = p, z.x = w.x, z.y = w.y, z.label_x = w.label_x, z.label_y = w.label_y, N.b1 = re.b1, N.b2 = re.b2, p = se, w = ue, re = c, z.node_is_primary && (de = R), U.push(R);
                });
                var be = E[ae].connected_segments, i = be.length - 1, f = [be[i]];
                be.forEach(function(R, z) {
                  i != z && f.push(R);
                }), E[ae].connected_segments = f, this.draw_these_nodes(U), this.draw_these_reactions(ie), this.select_metabolite_with_id(de);
              }
            }, he.prototype.toggle_selected_node_primary = function() {
              var G = this.get_selected_node_ids(), P = (function($) {
                var E = {}, V = this.settings.get("hide_secondary_metabolites");
                if ($.forEach((function(g) {
                  if (!(g in this.nodes)) {
                    console.warn("Could not find node: " + g);
                    return;
                  }
                  var U = this.nodes[g];
                  U.node_type == "metabolite" && (U.node_is_primary = !U.node_is_primary, E[g] = U);
                }).bind(this)), this.draw_these_nodes(Object.keys(E)), V) {
                  var ie = this.segments_and_reactions_for_nodes(E), ae = {};
                  for (var K in ie.segment_objs_w_segments) {
                    var s = ie.segment_objs_w_segments[K].reaction_id;
                    ae[s] = !0;
                  }
                  this.draw_these_reactions(Object.keys(ae));
                }
              }).bind(this);
              P(G), this.undo_stack.push(function() {
                P(G);
              }, function() {
                P(G);
              });
            }, he.prototype.segments_and_reactions_for_nodes = function(G) {
              var P = {}, $ = {}, E = {}, V = this.reactions;
              for (var ie in G) {
                var ae = G[ie];
                ae.connected_segments.forEach(function(p) {
                  var w;
                  try {
                    if (w = V[p.reaction_id].segments[p.segment_id], w === void 0)
                      throw new Error("undefined segment");
                  } catch {
                    console.warn("Could not find connected segments for node");
                    return;
                  }
                  var u = q.clone(p);
                  u.segment = q.clone(w), P[p.segment_id] = u, p.reaction_id in E || (E[p.reaction_id] = []), E[p.reaction_id].push(p.segment_id);
                });
              }
              for (var K in E) {
                var s = V[K], g = E[K], U = !0;
                for (var Y in s.segments)
                  g.indexOf(Y) == -1 && (U = !1);
                U && ($[K] = s);
              }
              return { segment_objs_w_segments: P, reactions: $ };
            }, he.prototype.add_label_to_search_index = function(G, P) {
              this.search_index.insert("l" + G, {
                name: P,
                data: { type: "text_label", text_label_id: G }
              });
            }, he.prototype.new_text_label = function(G, P) {
              var $ = m.newTextLabel(this.largest_ids, P, G);
              return this.text_labels[$.id] = $.label, this.draw_these_text_labels([$.id]), P !== "" && this.add_label_to_search_index($.id, P), $.id;
            }, he.prototype.edit_text_label = function(G, P, $, E) {
              if (C.default.isUndefined(E) && (E = !1), P === "")
                throw new Error("Should not be called for empty string");
              var V = (function(ae, K) {
                var s = this.text_labels[G];
                s.text = ae, K && this.draw_these_text_labels([G]);
                var g = "l" + G, U = this.search_index.remove(g);
                !E && !U && console.warn("Could not find modified text label in search index"), this.search_index.insert(g, {
                  name: ae,
                  data: { type: "text_label", text_label_id: G }
                });
              }).bind(this), ie = q.clone(this.text_labels[G]);
              V(P, $), this.undo_stack.push((function() {
                E ? (this.delete_text_label_data([G]), this.clear_deleted_text_labels()) : V(ie.text, !0);
              }).bind(this), (function() {
                E ? (this.text_labels[G] = q.clone(ie), this.text_labels[G].text = P, this.draw_these_text_labels([G]), this.add_label_to_search_index(G, P)) : V(P, !0);
              }).bind(this));
            }, he.prototype.zoom_extent_nodes = function(G) {
              this._zoom_extent(G, "nodes");
            }, he.prototype.zoom_extent_canvas = function(G) {
              this._zoom_extent(G, "canvas");
            }, he.prototype._zoom_extent = function(G, P) {
              C.default.isUndefined(G) && (G = P === "nodes" ? 0.2 : 0), C.default.isUndefined(P) && (P = "canvas");
              var $, E, V = this.get_size();
              if (G = G * V.height, P === "nodes") {
                var ie = {
                  x: null,
                  y: null
                  // TODO make infinity?
                }, ae = { x: null, y: null };
                for (var K in this.nodes) {
                  var s = this.nodes[K];
                  ie.x === null && (ie.x = s.x), ie.y === null && (ie.y = s.y), ae.x === null && (ae.x = s.x), ae.y === null && (ae.y = s.y), ie.x = Math.min(ie.x, s.x), ie.y = Math.min(ie.y, s.y), ae.x = Math.max(ae.x, s.x), ae.y = Math.max(ae.y, s.y);
                }
                $ = Math.min((V.width - G * 2) / (ae.x - ie.x), (V.height - G * 2) / (ae.y - ie.y)), E = {
                  x: -(ie.x * $) + G + (V.width - G * 2 - (ae.x - ie.x) * $) / 2,
                  y: -(ie.y * $) + G + (V.height - G * 2 - (ae.y - ie.y) * $) / 2
                };
              } else if (P == "canvas")
                $ = Math.min((V.width - G * 2) / this.canvas.width, (V.height - G * 2) / this.canvas.height), E = {
                  x: -(this.canvas.x * $) + G + (V.width - G * 2 - this.canvas.width * $) / 2,
                  y: -(this.canvas.y * $) + G + (V.height - G * 2 - this.canvas.height * $) / 2
                };
              else
                return console.error("Did not recognize mode");
              return this.zoomContainer.goTo($, E), null;
            }, he.prototype.get_size = function() {
              return this.zoomContainer.get_size();
            }, he.prototype.zoom_to_reaction = function(G) {
              var P = this.reactions[G], $ = 0.5, E = this.get_size(), V = {
                x: -P.label_x * $ + E.width / 2,
                y: -P.label_y * $ + E.height / 2
              };
              this.zoomContainer.goTo($, V);
            }, he.prototype.zoom_to_node = function(G) {
              var P = this.nodes[G], $ = 0.5, E = this.get_size(), V = {
                x: -P.label_x * $ + E.width / 2,
                y: -P.label_y * $ + E.height / 2
              };
              this.zoomContainer.goTo($, V);
            }, he.prototype.zoom_to_text_label = function(G) {
              var P = this.text_labels[G], $ = 0.5, E = this.get_size(), V = {
                x: -P.x * $ + E.width / 2,
                y: -P.y * $ + E.height / 2
              };
              this.zoomContainer.goTo($, V);
            }, he.prototype.highlight_reaction = function(G) {
              this.highlight(this.sel.selectAll("#r" + G).selectAll("text"));
            }, he.prototype.highlight_node = function(G) {
              this.highlight(this.sel.selectAll("#n" + G).selectAll("text"));
            }, he.prototype.highlight_text_label = function(G) {
              this.highlight(this.sel.selectAll("#l" + G).selectAll("text"));
            }, he.prototype.highlight = function(G) {
              this.sel.selectAll(".highlight").classed("highlight", !1), G !== null && G.classed("highlight", !0);
            }, he.prototype.save = function() {
              q.download_json(this.map_for_export(), this.map_name);
            }, he.prototype.map_for_export = function() {
              var G = [{
                map_name: this.map_name,
                map_id: this.map_id,
                map_description: this.map_description,
                homepage: "https://escher.github.io",
                schema: "https://escher.github.io/escher/jsonschema/1-0-0#"
              }, {
                reactions: q.clone(this.reactions),
                nodes: q.clone(this.nodes),
                text_labels: q.clone(this.text_labels),
                canvas: this.canvas.sizeAndLocation()
              }];
              for (var P in G[1].reactions) {
                var $ = G[1].reactions[P], E = {}, Z = ["name", "bigg_id", "reversibility", "label_x", "label_y", "gene_reaction_rule", "genes", "metabolites"];
                Z.forEach(function(de) {
                  E[de] = $[de];
                }), E.segments = {};
                for (var V in $.segments) {
                  var ie = $.segments[V], ae = {}, Z = ["from_node_id", "to_node_id", "b1", "b2"];
                  Z.forEach(function(be) {
                    ae[be] = ie[be];
                  }), E.segments[V] = ae;
                }
                G[1].reactions[P] = E;
              }
              for (var K in G[1].nodes) {
                var s = G[1].nodes[K], g = {}, Z;
                s.node_type === "metabolite" ? Z = ["node_type", "x", "y", "bigg_id", "name", "label_x", "label_y", "node_is_primary"] : Z = ["node_type", "x", "y"], Z.forEach(function(de) {
                  g[de] = s[de];
                }), G[1].nodes[K] = g;
              }
              for (var U in G[1].text_labels) {
                var Y = G[1].text_labels[U], p = {}, Z = ["x", "y", "text"];
                Z.forEach(function(de) {
                  p[de] = Y[de];
                }), G[1].text_labels[U] = p;
              }
              var w = G[1].canvas, u = {}, Z = ["x", "y", "width", "height"];
              return Z.forEach(function(re) {
                u[re] = w[re];
              }), G[1].canvas = u, G;
            }, he.prototype.saveMap = function(G, P, $) {
              var E = this;
              this.callback_manager.run(G);
              var V = this.zoomContainer.windowScale, ie = this.zoomContainer.windowTranslate, ae = this.canvas.sizeAndLocation(), K = {
                w: this.canvas.mouseNode.attr("width"),
                h: this.canvas.mouseNode.attr("height"),
                transform: this.canvas.mouseNode.attr("transform")
              };
              this.zoomContainer._goToSvg(1, { x: -ae.x, y: -ae.y }, function() {
                E.svg.attr("width", ae.width), E.svg.attr("height", ae.height), E.canvas.mouseNode.attr("width", "0px"), E.canvas.mouseNode.attr("height", "0px"), E.canvas.mouseNode.attr("transform", null);
                var s = E.sel.selectAll(".multimarker-circle,.midmarker-circle,#canvas,.bezier,#rotation-center,.direction-arrow,.start-reaction-target").style("visibility", "hidden");
                $ === "svg" ? q.downloadSvg("saved_map", E.svg, !0) : $ === "png" && q.downloadPng("saved_map", E.svg), E.zoomContainer._goToSvg(V, ie, function() {
                  E.svg.attr("width", null), E.svg.attr("height", null), E.canvas.mouseNode.attr("width", K.w), E.canvas.mouseNode.attr("height", K.h), E.canvas.mouseNode.attr("transform", K.transform), s.style("visibility", null), E.callback_manager.run(P);
                });
              });
            }, he.prototype.save_svg = function() {
              this.saveMap("before_svg_export", "after_svg_export", "svg");
            }, he.prototype.save_png = function() {
              this.saveMap("before_png_export", "after_png_export", "png");
            }, he.prototype.convert_map = function() {
              var G = this;
              if (this.callback_manager.run("before_convert_map"), !this.has_cobra_model())
                throw Error("No COBRA model loaded.");
              var P = this.cobra_model, $ = {}, E = ["name", "gene_reaction_rule", "genes"], V = {}, ie = ["name"], ae = !1;
              for (var K in this.reactions) {
                var s = this.reactions[K];
                ae = !1;
                var g = function() {
                  var R = P.reactions[U];
                  if (R.bigg_id == s.bigg_id) {
                    E.forEach(function(J) {
                      s[J] = R[J];
                    });
                    var z = !0, se = null, ue = function(oe) {
                      var Be = R.metabolites[oe], Ye = C.default.find(s.metabolites, function(Ke) {
                        return Ke.bigg_id === oe;
                      });
                      if (Ye === void 0)
                        return z = !1, "break";
                      var We = Ye.coefficient;
                      if (se === null && (se = Be > 0 != We > 0), se === !0 && Be > 0 == We > 0 || se === !1 && Be > 0 != We > 0)
                        return z = !1, "break";
                    };
                    for (var ye in R.metabolites) {
                      var N = ue(ye);
                      if (N === "break")
                        break;
                    }
                    if (se && z) {
                      s.metabolites.forEach(function(J) {
                        J.coefficient = -J.coefficient;
                      });
                      var c = function() {
                        var oe = s.segments[Y];
                        oe.reversibility = s.reversibility;
                        var Be = G.nodes[oe.from_node_id], Ye = G.nodes[oe.to_node_id];
                        s.metabolites.forEach(function(We) {
                          We.bigg_id === Be.bigg_id ? oe.from_node_coefficient = We.coefficient : We.bigg_id === Ye.bigg_id && (oe.to_node_coefficient = We.coefficient);
                        });
                      };
                      for (Y in s.segments)
                        c();
                    }
                    if (!z)
                      return console.warn("Metabolites for " + R.bigg_id + ` are different in model and map. Could
 not check and fix direction.`), "break";
                    ae = !0;
                  }
                };
                for (var U in P.reactions) {
                  var Y, p = g();
                  if (p === "break")
                    break;
                }
                ae || ($[K] = !0);
              }
              for (var w in this.nodes) {
                var u = this.nodes[w];
                if (u.node_type == "metabolite") {
                  ae = !1;
                  for (var Z in P.metabolites) {
                    var re = P.metabolites[Z];
                    re.bigg_id == u.bigg_id && (ie.forEach(function(f) {
                      u[f] = re[f];
                    }), ae = !0);
                  }
                  ae || (V[w] = !0);
                }
              }
              var de = Object.keys($).length, be = Object.keys(V).length, i = 1e4;
              de === 0 && be === 0 ? this.set_status("Successfully converted attributes.", i) : be === 0 ? (this.set_status("Converted attributes, but count not find " + de + " reactions in the model.", i), this.settings.set("highlight_missing", !0)) : de === 0 ? (this.set_status("Converted attributes, but count not find " + be + " metabolites in the model.", i), this.settings.set("highlight_missing", !0)) : (this.set_status("Converted attributes, but count not find " + de + " reactions and " + be + " metabolites in the model.", i), this.settings.set("highlight_missing", !0)), this.draw_everything(), this.callback_manager.run("after_convert_map");
            }, he;
          }();
          O.default = Ce;
        },
        /* 28 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(3), X = h(a), q = d(29), ee = M(q), j = d(7), t = d(0), F = M(t);
          function M(B) {
            if (B && B.__esModule)
              return B;
            var k = {};
            if (B != null)
              for (var _ in B)
                Object.prototype.hasOwnProperty.call(B, _) && (k[_] = B[_]);
            return k.default = B, k;
          }
          function h(B) {
            return B && B.__esModule ? B : { default: B };
          }
          function x(B, k) {
            if (!(B instanceof k))
              throw new TypeError("Cannot call a class as a function");
          }
          var m = F.select, D = F.mouse;
          F.touch;
          var H = function() {
            function B(k, _) {
              x(this, B), this.map = k, this.undoStack = _, this.emptyBehavior = function() {
              }, this.rotationModeEnabled = !1, this.rotationDrag = (0, j.drag)(), this.selectableMousedown = null, this.textLabelMousedown = null, this.textLabelClick = null, this.selectableDrag = this.emptyBehavior, this.nodeLabelMouseover = null, this.nodeLabelTouch = null, this.nodeLabelMouseout = null, this.reactionLabelMouseover = null, this.reactionLabelTouch = null, this.reactionLabelMouseout = null, this.geneLabelMouseover = null, this.geneLabelTouch = null, this.geneLabelMouseout = null, this.nodeObjectMouseover = null, this.nodeObjectMouseout = null, this.reactionObjectMouseover = null, this.reactionObjectMouseout = null, this.bezierDrag = this.emptyBehavior, this.bezierMouseover = null, this.bezierMouseout = null, this.reactionLabelDrag = this.emptyBehavior, this.nodeLabelDrag = this.emptyBehavior, this.dragging = !1;
            }
            return B.prototype.averageLocation = function(_) {
              var Q = [], o = [];
              for (var W in _) {
                var y = _[W];
                y.x !== void 0 && Q.push(y.x), y.y !== void 0 && o.push(y.y);
              }
              return {
                x: X.default.mean(Q),
                y: X.default.mean(o)
              };
            }, B.prototype.showCenter = function() {
              var _ = this, Q = this.map.sel.selectAll("#rotation-center").data([0]), o = Q.enter().append("g").attr("id", "rotation-center");
              o.append("path").attr("d", "M-32 0 L32 0").attr("class", "rotation-center-line"), o.append("path").attr("d", "M0 -32 L0 32").attr("class", "rotation-center-line");
              var W = o.merge(Q);
              W.attr("transform", "translate(" + this.center.x + "," + this.center.y + ")").attr("visibility", "visible").on("mouseover", function() {
                var y = parseFloat(W.selectAll("path").style("stroke-width"));
                W.selectAll("path").style("stroke-width", y * 2 + "px");
              }).on("mouseout", function() {
                W.selectAll("path").style("stroke-width", null);
              }).call((0, j.drag)().on("drag", function() {
                var y = X.default.d3_transform_catch(W.attr("transform")), v = [F.event.dx + y.translate[0], F.event.dy + y.translate[1]];
                W.attr("transform", "translate(" + v + ")"), _.center = { x: v[0], y: v[1] };
              }));
            }, B.prototype.hideCenter = function() {
              this.map.sel.select("#rotation-center").attr("visibility", "hidden");
            }, B.prototype.toggleRotationMode = function(_) {
              var Q = this;
              _ === void 0 ? this.rotationModeEnabled = !this.rotationModeEnabled : this.rotationModeEnabled = _;
              var o = this.map.sel.selectAll(".node-circle"), W = this.map.sel.selectAll("#canvas");
              if (this.rotationModeEnabled) {
                var y = this.map.getSelectedNodes();
                if (Object.keys(y).length === 0) {
                  console.warn("No selected nodes");
                  return;
                }
                this.center = this.averageLocation(y), this.showCenter();
                var v = this.map, T = Object.keys(y), n = this.map.reactions, r = this.map.nodes, b = this.map.beziers, C = function(he) {
                  F.event.sourceEvent.stopPropagation();
                }, ne = function(he, le, G, P) {
                  var $ = ee.rotateNodes(y, n, b, le, P);
                  v.draw_these_nodes($.node_ids), v.draw_these_reactions($.reaction_ids);
                }, ge = function(he) {
                }, ce = function(he, le, G) {
                  var P = {};
                  T.forEach(function(E) {
                    P[E] = r[E];
                  });
                  var $ = ee.rotateNodes(P, n, b, -le, G);
                  v.draw_these_nodes($.node_ids), v.draw_these_reactions($.reaction_ids);
                }, xe = function(he, le, G) {
                  var P = {};
                  T.forEach(function(E) {
                    P[E] = r[E];
                  });
                  var $ = ee.rotatenodes(P, n, b, le, G);
                  v.draw_these_nodes($.node_ids), v.draw_these_reactions($.reaction_ids);
                }, fe = function() {
                  return Q.center;
                };
                this.rotationDrag = this.getGenericAngularDrag(C, ne, ge, ce, xe, fe, this.map.sel), W.call(this.rotationDrag), this.selectableDrag = this.rotationDrag;
              } else
                this.hideCenter(), o.on("mousedown.center", null), W.on("mousedown.center", null), W.on("mousedown.drag", null), W.on("touchstart.drag", null), this.rotationDrag = null, this.selectableDrag = null;
            }, B.prototype.toggleSelectableClick = function(_) {
              if (_ === void 0 && (_ = this.selectableMousedown === null), _) {
                var Q = this.map;
                this.selectableMousedown = function(o) {
                  F.event.stopPropagation();
                }, this.selectableClick = function(o) {
                  F.event.stopPropagation(), !F.event.defaultPrevented && Q.select_selectable(this, o, F.event.shiftKey);
                }, this.nodeMouseover = function(o) {
                  m(this).style("stroke-width", null);
                  var W = parseFloat(m(this).style("stroke-width"));
                  m(this.parentNode).classed("selected") || m(this).style("stroke-width", W * 3 + "px");
                }, this.nodeMouseout = function(o) {
                  m(this).style("stroke-width", null);
                };
              } else
                this.selectableMousedown = null, this.selectableClick = null, this.nodeMouseover = null, this.nodeMouseout = null, this.map.sel.select("#nodes").selectAll(".node-circle").style("stroke-width", null);
            }, B.prototype.toggleTextLabelEdit = function(_) {
              if (_ === void 0 && (_ = this.textEditMousedown == null), _) {
                var Q = this.map;
                this.textLabelMousedown = function() {
                  if (!F.event.defaultPrevented) {
                    var o = X.default.d3_transform_catch(m(this).attr("transform")).translate, W = { x: o[0], y: o[1] };
                    Q.callback_manager.run("edit_text_label", null, m(this), W), F.event.stopPropagation();
                  }
                }, this.textLabelClick = null, this.map.sel.select("#text-labels").selectAll(".label").style("cursor", "text"), this.map.sel.on("mousedown.new_text_label", (function(o) {
                  F.event.preventDefault();
                  var W = {
                    x: D(o)[0],
                    y: D(o)[1]
                  };
                  this.map.callback_manager.run("new_text_label", null, W);
                }).bind(this, this.map.sel.node()));
              } else
                this.textLabelMousedown = this.selectableMousedown, this.textLabelClick = this.selectableClick, this.map.sel.select("#text-labels").selectAll(".label").style("cursor", null), this.map.sel.on("mousedown.new_text_label", null), this.map.callback_manager.run("hide_text_label_editor");
            }, B.prototype.toggleSelectableDrag = function(_) {
              _ === void 0 && (_ = this.selectableDrag === this.emptyBehavior), _ ? (this.selectableDrag = this.getSelectableDrag(this.map, this.undoStack), this.bezierDrag = this.getBezierDrag(this.map, this.undoStack)) : (this.selectableDrag = this.emptyBehavior, this.bezierDrag = this.emptyBehavior);
            }, B.prototype.toggleLabelDrag = function(_) {
              _ === void 0 && (_ = this.labelDrag === this.emptyBehavior), _ ? (this.reactionLabelDrag = this.getReactionLabelDrag(this.map), this.nodeLabelDrag = this.getNodeLabelDrag(this.map)) : (this.reactionLabelDrag = this.emptyBehavior, this.nodeLabelDrag = this.emptyBehavior);
            }, B.prototype.toggleLabelMouseover = function(_) {
              var Q = this;
              if (_ === void 0 && (_ = this.nodeLabelMouseover === null), _) {
                var o = function(v) {
                  return function(T) {
                    Q.dragging || Q.map.callback_manager.run("show_tooltip", null, v, T);
                  };
                }, W = function() {
                  Q.map.callback_manager.run("delay_hide_tooltip");
                };
                this.nodeLabelMouseover = o("node_label"), this.nodeLabelTouch = o("node_label"), this.nodeLabelMouseout = W, this.reactionLabelMouseover = o("reaction_label"), this.reactionLabelTouch = o("reaction_label"), this.reactionLabelMouseout = W, this.geneLabelMouseover = o("gene_label"), this.geneLabelTouch = o("gene_label"), this.geneLabelMouseout = W;
              } else
                this.nodeLabelMouseover = null, this.nodeLabelTouch = null, this.nodeLabelMouseout = null, this.reactionLabelMouseover = null, this.reactionLabelTouch = null, this.reactionLabelMouseout = null, this.geneLabelMouseover = null, this.geneLabelTouch = null, this.geneLabelMouseout = null;
            }, B.prototype.toggleObjectMouseover = function(_) {
              var Q = this;
              if (_ === void 0 && (_ = this.nodeObjectMouseover === null), _) {
                var o = function(v) {
                  var T = Q;
                  return function(n) {
                    if (!T.dragging)
                      if (v === "reaction_object") {
                        var r = D(this), b = Object.assign({}, n, { xPos: r[0], yPos: r[1] });
                        T.map.callback_manager.run("show_tooltip", null, v, b);
                      } else
                        T.map.callback_manager.run("show_tooltip", null, v, n);
                  };
                }, W = function() {
                  Q.map.callback_manager.run("delay_hide_tooltip");
                };
                this.nodeObjectMouseover = o("node_object"), this.nodeObjectMouseout = W, this.reactionObjectMouseover = o("reaction_object"), this.reactionObjectMouseout = W;
              } else
                this.nodeObjectMouseover = null, this.nodeObjectMouseout = null, this.reactionObjectMouseover = null, this.reactionObjectMouseout = null;
            }, B.prototype.toggleObjectTouch = function(_) {
              var Q = this;
              _ === void 0 && (_ = this.labelTouch === null), _ ? this.objectTouch = function(o, W) {
                Q.dragging || Q.map.callback_manager.run("show_tooltip", null, o, W);
              } : this.objectTouch = null;
            }, B.prototype.toggleBezierDrag = function(_) {
              _ === void 0 && (_ = this.bezierDrag === this.emptyBehavior), _ ? (this.bezierDrag = this.getBezierDrag(this.map), this.bezierMouseover = function(Q) {
                m(this).style("stroke-width", "3px");
              }, this.bezierMouseout = function(Q) {
                m(this).style("stroke-width", "1px");
              }) : (this.bezierDrag = this.emptyBehavior, this.bezierMouseover = null, this.bezierMouseout = null);
            }, B.prototype.turnOffDrag = function(_) {
              _.on("mousedown.drag", null), _.on("touchstart.drag", null);
            }, B.prototype.combineNodesAndDraw = function(_, Q) {
              var o = this.map, W = o.nodes[Q], y = o.nodes[_], v = [];
              return W.connected_segments.forEach(function(T) {
                var n = null;
                try {
                  if (n = o.reactions[T.reaction_id].segments[T.segment_id], n === void 0)
                    throw new Error("undefined segment");
                } catch {
                  console.warn("Could not find connected segment " + T.segment_id);
                  return;
                }
                if (n.from_node_id === Q)
                  n.from_node_id = _;
                else if (n.to_node_id === Q)
                  n.to_node_id = _;
                else {
                  console.error("Segment does not connect to dragged node");
                  return;
                }
                y.connected_segments.push(T), v.push(X.default.clone(T));
              }), o.delete_node_data([Q]), o.sel.selectAll(".node-to-combine").classed("node-to-combine", !1), o.draw_everything(), v;
            }, B.prototype.getSelectableDrag = function(_, Q) {
              var o = this, W = (0, j.drag)(), y = null, v = null, T = null, n = null, r = null, b = function(ce, xe) {
                var fe = _.text_labels[ce];
                fe.x = fe.x + xe.x, fe.y = fe.y + xe.y;
              }, C = function(ce) {
                o.dragging = ce;
              };
              W.on("start", function(ge) {
                if (C(!0), F.event.sourceEvent.stopPropagation(), v = {
                  x: 0,
                  y: 0
                  // If a text label is selected, the rest is not necessary
                }, m(this).attr("class").indexOf("label") === -1) {
                  var ce = this.parentNode.__data__, xe = ce.bigg_id, fe = this.parentNode;
                  y = setTimeout(function() {
                    fe.parentNode.insertBefore(fe, fe.parentNode.firstChild);
                  }, 200), _.sel.selectAll(".metabolite-circle").on("mouseover.combine", function(Ce) {
                    Ce.bigg_id === xe && Ce.node_id !== ce.node_id && m(this).classed("node-to-combine", !0);
                  }).on("mouseout.combine", function(Ce) {
                    Ce.bigg_id === xe && _.sel.selectAll(".node-to-combine").classed("node-to-combine", !1);
                  });
                }
              }), W.on("drag", function(ge) {
                m(this.parentNode).classed("selected") || _.select_selectable(this, ge);
                var ce = {};
                m(this).attr("class").indexOf("label") === -1 ? (ce.type = "node", ce.id = this.parentNode.__data__.node_id) : (ce.type = "label", ce.id = this.__data__.text_label_id);
                var xe = _.get_selected_node_ids(), fe = _.get_selected_text_label_ids();
                T = [], r = [], ce.type === "node" && xe.indexOf(ce.id) === -1 ? T.push(ce.id) : ce.type === "label" && fe.indexOf(ce.id) === -1 ? r.push(ce.id) : (T = xe, r = fe), n = [];
                var Ce = {
                  x: F.event.dx,
                  y: F.event.dy
                };
                v = X.default.c_plus_c(v, Ce), T.forEach(function(he) {
                  var le = _.nodes[he], G = ee.moveNodeAndDependents(le, he, _.reactions, _.beziers, Ce);
                  n = X.default.uniqueConcat([n, G.reaction_ids]);
                }), r.forEach(function(he) {
                  b(he, Ce);
                }), _.draw_these_nodes(T), _.draw_these_reactions(n), _.draw_these_text_labels(r);
              });
              var ne = this.combineNodesAndDraw.bind(this);
              return W.on("end", function() {
                if (C(!1), T === null) {
                  v = null, T = null, r = null, n = null, y = null;
                  return;
                }
                var ge = [];
                if (_.sel.selectAll(".node-to-combine").each(function(E) {
                  ge.push(E.node_id);
                }), ge.length === 1) {
                  var ce = ge[0], xe = this.parentNode.__data__.node_id, fe = X.default.clone(_.nodes[xe]), Ce = ne(ce, xe), he = X.default.clone(v);
                  Q.push(function() {
                    _.nodes[xe] = fe;
                    var E = _.nodes[ce], V = [];
                    Ce.forEach(function(ie) {
                      var ae = _.reactions[ie.reaction_id].segments[ie.segment_id];
                      ae.from_node_id === ce ? ae.from_node_id = xe : ae.to_node_id === ce ? ae.to_node_id = xe : console.error("Segment does not connect to fixed node"), E.connected_segments = E.connected_segments.filter(function(K) {
                        return !(K.reaction_id === ie.reaction_id && K.segment_id === ie.segment_id);
                      }), V.indexOf(ie.reaction_id) === -1 && V.push(ie.reaction_id);
                    }), ee.moveNodeAndDependents(fe, xe, _.reactions, _.beziers, X.default.c_times_scalar(he, -1)), _.draw_these_nodes([xe]), _.draw_these_reactions(V);
                  }, function() {
                    ee.moveNodeAndDependents(fe, xe, _.reactions, _.beziers, X.default.c_times_scalar(he, 1)), ne(ce, xe);
                  });
                } else {
                  var le = X.default.clone(v), G = X.default.clone(T), P = X.default.clone(r), $ = X.default.clone(n);
                  Q.push(function() {
                    G.forEach(function(E) {
                      var V = _.nodes[E];
                      ee.moveNodeAndDependents(V, E, _.reactions, _.beziers, X.default.c_times_scalar(le, -1));
                    }), P.forEach(function(E) {
                      b(E, X.default.c_times_scalar(le, -1));
                    }), _.draw_these_nodes(G), _.draw_these_reactions($), _.draw_these_text_labels(P);
                  }, function() {
                    G.forEach(function(E) {
                      var V = _.nodes[E];
                      ee.moveNodeAndDependents(V, E, _.reactions, _.beziers, le);
                    }), P.forEach(function(E) {
                      b(E, le);
                    }), _.draw_these_nodes(G), _.draw_these_reactions($), _.draw_these_text_labels(P);
                  });
                }
                _.sel.selectAll(".metabolite-circle").on("mouseover.combine", null).on("mouseout.combine", null), clearTimeout(y), v = null, T = null, r = null, n = null, y = null;
              }), W;
            }, B.prototype.getBezierDrag = function(_) {
              var Q = function(r, b, C, ne, ge) {
                var ce = _.reactions[r].segments[b];
                ce[C] = X.default.c_plus_c(ce[C], ge), _.beziers[ne].x = ce[C].x, _.beziers[ne].y = ce[C].y;
              }, o = function(r) {
                r.dragging = !0;
              }, W = function(r, b, C) {
                Q(r.reaction_id, r.segment_id, r.bezier, r.bezier_id, b), _.draw_these_reactions([r.reaction_id], !1), _.draw_these_beziers([r.bezier_id]);
              }, y = function(r) {
                r.dragging = !1;
              }, v = function(r, b) {
                Q(r.reaction_id, r.segment_id, r.bezier, r.bezier_id, X.default.c_times_scalar(b, -1)), _.draw_these_reactions([r.reaction_id], !1), _.draw_these_beziers([r.bezier_id]);
              }, T = function(r, b) {
                Q(r.reaction_id, r.segment_id, r.bezier, r.bezier_id, b), _.draw_these_reactions([r.reaction_id], !1), _.draw_these_beziers([r.bezier_id]);
              };
              return this.getGenericDrag(o, W, y, v, T, this.map.sel);
            }, B.prototype.getReactionLabelDrag = function(_) {
              var Q = function(r, b) {
                var C = _.reactions[r];
                C.label_x = C.label_x + b.x, C.label_y = C.label_y + b.y;
              }, o = function(r) {
                _.callback_manager.run("hide_tooltip");
              }, W = function(r, b, C) {
                Q(r.reaction_id, b), _.draw_these_reactions([r.reaction_id]);
              }, y = function() {
              }, v = function(r, b) {
                Q(r.reaction_id, X.default.c_times_scalar(b, -1)), _.draw_these_reactions([r.reaction_id]);
              }, T = function(r, b) {
                Q(r.reaction_id, b), _.draw_these_reactions([r.reaction_id]);
              };
              return this.getGenericDrag(o, W, y, v, T, this.map.sel);
            }, B.prototype.getNodeLabelDrag = function(_) {
              var Q = function(r, b) {
                var C = _.nodes[r];
                C.label_x = C.label_x + b.x, C.label_y = C.label_y + b.y;
              }, o = function(r) {
                _.callback_manager.run("hide_tooltip");
              }, W = function(r, b, C) {
                Q(r.node_id, b), _.draw_these_nodes([r.node_id]);
              }, y = function() {
              }, v = function(r, b) {
                Q(r.node_id, X.default.c_times_scalar(b, -1)), _.draw_these_nodes([r.node_id]);
              }, T = function(r, b) {
                Q(r.node_id, b), _.draw_these_nodes([r.node_id]);
              };
              return this.getGenericDrag(o, W, y, v, T, this.map.sel);
            }, B.prototype.getGenericDrag = function(_, Q, o, W, y, v) {
              var T = this, n = (0, j.drag)(), r = this.undoStack, b = v.node(), C = void 0;
              return n.on("start", function(ne) {
                T.dragging = !0, F.event.sourceEvent.stopPropagation(), C = { x: 0, y: 0 }, _(ne);
              }), n.on("drag", function(ne) {
                var ge = {
                  x: F.event.dx,
                  y: F.event.dy
                }, ce = {
                  x: D(b)[0],
                  y: D(b)[1]
                  // remember the displacement
                };
                C = X.default.c_plus_c(C, ge), Q(ne, ge, C, ce);
              }), n.on("end", function(ne) {
                T.dragging = !1;
                var ge = X.default.clone(ne), ce = X.default.clone(C), xe = {
                  x: D(b)[0],
                  y: D(b)[1]
                };
                r.push(function() {
                  W(ge, ce, xe);
                }, function() {
                  y(ge, ce, xe);
                }), o(ne);
              }), n;
            }, B.prototype.getGenericAngularDrag = function(_, Q, o, W, y, v, T) {
              var n = this, r = (0, j.drag)(), b = this.undoStack, C = T.node(), ne = void 0;
              return r.on("start", function(ge) {
                n.dragging = !0, F.event.sourceEvent.stopPropagation(), ne = 0, _(ge);
              }), r.on("drag", function(ge) {
                var ce = {
                  x: F.event.dx,
                  y: F.event.dy
                }, xe = {
                  x: D(C)[0],
                  y: D(C)[1]
                }, fe = v(), Ce = X.default.angle_for_event(ce, xe, fe);
                ne = ne + Ce, Q(ge, Ce, ne, fe);
              }), r.on("end", function(ge) {
                n.dragging = !1;
                var ce = X.default.clone(ge), xe = ne, fe = X.default.clone(v());
                b.push(function() {
                  return W(ce, xe, fe);
                }, function() {
                  return y(ce, xe, fe);
                }), o(ge);
              }), r;
            }, B;
          }();
          O.default = H;
        },
        /* 29 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0, O.getMetLabelLoc = M, O.newReaction = h, O.rotateNodes = x, O.moveNodeAndDependents = m, O.newTextLabel = _, O.bezierIdForSegmentId = Q, O.bezierIdsForReactionIds = o, O.newBeziersForSegments = W, O.newBeziersForReactions = y;
          var a = d(3), X = t(a), q = d(4), ee = j(q);
          function j(v) {
            return v && v.__esModule ? v : { default: v };
          }
          function t(v) {
            if (v && v.__esModule)
              return v;
            var T = {};
            if (v != null)
              for (var n in v)
                Object.prototype.hasOwnProperty.call(v, n) && (T[n] = v[n]);
            return T.default = v, T;
          }
          function F(v) {
            if (Math.abs(v) > Math.PI)
              throw new Error("Angle must be between -PI and PI");
            return Math.abs(v) < Math.PI / 7 || Math.abs(v - Math.PI) < Math.PI / 7 ? { x: -50, y: -40 } : v > 0 ? {
              x: 15 * (1 - Math.abs(v - Math.PI / 2) / (Math.PI / 2)),
              y: 10 + (v - Math.PI / 2) * 50
            } : {
              x: 15 * (1 - Math.abs(v + Math.PI / 2) / (Math.PI / 2)),
              y: 10 - (Math.abs(v) - Math.PI / 2) * 50
            };
          }
          function M(v, T, n, r, b, C) {
            var ne = X.angleNorm(v), ge = b.length * 18, ce = T - (T > C) - n / 2 >= -1;
            return Math.abs(ne) < Math.PI / 7 ? r || ce ? { x: -ge * 0.3, y: 40 } : { x: -ge * 0.3, y: -20 } : Math.abs(ne - Math.PI) < Math.PI / 7 ? r || !ce ? { x: -ge * 0.3, y: 40 } : { x: -ge * 0.3, y: -20 } : r ? {
              x: 25 - 38 * Math.abs(Math.abs(ne) - Math.PI / 2),
              y: (Math.abs(ne) - Math.PI / 2) * ((ne > 0) * 2 - 1) * 50
            } : ne < 0 && ce || ne > 0 && !ce ? { x: 15, y: 0 } : { x: -ge * 0.5, y: 30 };
          }
          function h(v, T, n, r, b, C, ne, ge) {
            var ce = X.to_radians_norm(ge), xe = String(++C.reactions), fe = {
              x: b.x,
              y: b.y
              // Rotate main axis around angle with distance
            }, Ce = 350, he = [fe, X.c_plus_c(fe, { x: Ce, y: 0 })], le = {
              x: (he[0].x + he[1].x) / 2,
              y: (he[0].y + he[1].y) / 2
              // Relative label location
            }, G = F(ce), P = 20, $ = {
              name: T.name,
              bigg_id: T.bigg_id,
              reversibility: T.reversibility,
              gene_reaction_rule: T.gene_reaction_rule,
              genes: X.clone(T.genes),
              metabolites: X.clone(T.metabolites)
            };
            X.extend($, {
              label_x: le.x + G.x,
              label_y: le.y + G.y,
              segments: {}
            });
            var E = [], V = [], ie = 0, ae = 0, K = !1;
            for (var s in $.metabolites) {
              var g = n[s], U = $.metabolites[s], Y = g.formula, p = {
                coefficient: U,
                bigg_id: s,
                name: g.name
              };
              if (U < 0) {
                p.index = ie;
                var w = /C([0-9]+)/.exec(Y);
                b.bigg_id === p.bigg_id ? E.push([p.index, 1 / 0]) : w && ne.indexOf(X.decompartmentalize(p.bigg_id)[0]) === -1 && E.push([p.index, parseInt(w[1])]), ie++;
              } else {
                p.index = ae;
                var u = /C([0-9]+)/.exec(Y);
                b.bigg_id === p.bigg_id ? (V.push([p.index, 1 / 0]), K = !0) : u && ne.indexOf(X.decompartmentalize(p.bigg_id)[0]) === -1 && V.push([p.index, parseInt(u[1])]), ae++;
              }
              $.metabolites[s] = p;
            }
            var Z = function(bt, Bt) {
              return Bt[1] > bt[1] ? Bt : bt;
            }, re = E.reduce(Z, [0, 0])[0], de = V.reduce(Z, [0, 0])[0];
            for (var be in $.metabolites) {
              var i = $.metabolites[be];
              i.coefficient < 0 ? (i.is_primary = i.index === re, i.count = ie) : (i.is_primary = i.index === de, i.count = ae);
            }
            var f = {}, R = [{
              node_type: "anchor_reactants",
              dis: { x: P * (K ? 1 : -1), y: 0 }
            }, { node_type: "center", dis: { x: 0, y: 0 } }, {
              node_type: "anchor_products",
              dis: { x: P * (K ? -1 : 1), y: 0 }
            }], z = {};
            R.map(function(gt) {
              var bt = String(++C.nodes), Bt = gt.node_type === "center" ? "midmarker" : "multimarker";
              f[bt] = {
                node_type: Bt,
                x: le.x + gt.dis.x,
                y: le.y + gt.dis.y,
                connected_segments: [],
                name: null,
                bigg_id: null,
                label_x: null,
                label_y: null,
                node_is_primary: null,
                data: null
              }, z[gt.node_type] = bt;
            });
            var se = [[z.anchor_reactants, z.center, "reactants"], [z.anchor_products, z.center, "products"]];
            se.map(function(gt) {
              var bt = gt[0], Bt = gt[1], St = String(++C.segments), Nt = ie === 0 && gt[2] === "reactants" && $.reversibility || ae === 0 && gt[2] === "products";
              $.segments[St] = {
                b1: null,
                b2: null,
                from_node_id: bt,
                to_node_id: Bt,
                from_node_coefficient: null,
                to_node_coefficient: null,
                reversibility: $.reversibility,
                data: $.data,
                reverse_flux: $.reverse_flux,
                unconnected_segment_with_arrow: Nt
              }, f[bt].connected_segments.push({
                segment_id: St,
                reaction_id: xe
              }), f[Bt].connected_segments.push({
                segment_id: St,
                reaction_id: xe
              });
            });
            var ue = f;
            for (var ye in $.metabolites) {
              var N = $.metabolites[ye], c = void 0, J = void 0;
              N.coefficient < 0 ? (c = re, J = z.anchor_reactants) : (c = de, J = z.anchor_products);
              var oe = k(N, c, he, le, Ce, K);
              if (b.bigg_id === N.bigg_id) {
                var Be = String(++C.segments);
                $.segments[Be] = {
                  b1: oe.b1,
                  b2: oe.b2,
                  from_node_id: J,
                  to_node_id: r,
                  from_node_coefficient: null,
                  to_node_coefficient: N.coefficient,
                  reversibility: $.reversibility
                  // Update the existing node
                }, b.connected_segments.push({
                  segment_id: Be,
                  reaction_id: xe
                }), ue[J].connected_segments.push({
                  segment_id: Be,
                  reaction_id: xe
                });
              } else {
                var Ye = String(++C.segments), We = String(++C.nodes);
                $.segments[Ye] = {
                  b1: oe.b1,
                  b2: oe.b2,
                  from_node_id: J,
                  to_node_id: We,
                  from_node_coefficient: null,
                  to_node_coefficient: N.coefficient,
                  reversibility: $.reversibility
                  // save new node
                };
                var Ke = M(ce, N.index, N.count, N.is_primary, N.bigg_id, c);
                ue[We] = {
                  connected_segments: [{
                    segment_id: Ye,
                    reaction_id: xe
                  }],
                  x: oe.circle.x,
                  y: oe.circle.y,
                  node_is_primary: N.is_primary,
                  label_x: oe.circle.x + Ke.x,
                  label_y: oe.circle.y + Ke.y,
                  name: N.name,
                  bigg_id: N.bigg_id,
                  node_type: "metabolite"
                }, ue[J].connected_segments.push({
                  segment_id: Ye,
                  reaction_id: xe
                });
              }
            }
            var et = [];
            for (var nt in $.metabolites)
              et.push({
                bigg_id: nt,
                coefficient: $.metabolites[nt].coefficient
              });
            $.metabolites = et;
            var pt = {};
            pt[xe] = $;
            var Et = y(pt);
            return ue[r] = b, x(ue, pt, Et, ce, fe), {
              new_reactions: pt,
              new_beziers: Et,
              new_nodes: ue
            };
          }
          function x(v, T, n, r, b) {
            var C = function(Ce) {
              return Ce === null ? null : X.rotate_coords(Ce, r, b);
            }, ne = [], ge = [], ce = function(Ce) {
              var he = v[Ce], le = C({ x: he.x, y: he.y }), G = D(he, T, le);
              he.connected_segments.map(function(P) {
                var $ = T[P.reaction_id];
                if ($ !== void 0) {
                  var E = P.segment_id, V = $.segments[E];
                  if (V.to_node_id === Ce && V.b2) {
                    var ie = C(V.b2), ae = Q(E, "b2");
                    V.b2 = X.c_plus_c(V.b2, ie), n[ae].x = V.b2.x, n[ae].y = V.b2.y;
                  } else if (V.from_node_id === Ce && V.b1) {
                    var K = C(V.b1), s = Q(E, "b1");
                    V.b1 = X.c_plus_c(V.b1, K), n[s].x = V.b1.x, n[s].y = V.b1.y;
                  }
                }
              }), ge = X.uniqueConcat([ge, G.reaction_ids]), ne.push(Ce);
            };
            for (var xe in v)
              ce(xe);
            return {
              node_ids: ne,
              reaction_ids: ge
            };
          }
          function m(v, T, n, r, b) {
            var C = D(v, n, b);
            return v.connected_segments.map(function(ne) {
              var ge = n[ne.reaction_id];
              if (!ee.default.isUndefined(ge)) {
                var ce = ne.segment_id, xe = ge.segments[ce], fe = [["b1", "from_node_id"], ["b2", "to_node_id"]];
                fe.forEach(function(Ce) {
                  var he = Ce[0], le = Ce[1];
                  if (xe[le] === T && xe[he]) {
                    xe[he] = X.c_plus_c(xe[he], b);
                    var G = r[Q(ce, he)];
                    G.x = xe[he].x, G.y = xe[he].y;
                  }
                }), C.reaction_ids.indexOf(ne.reaction_id) < 0 && C.reaction_ids.push(ne.reaction_id);
              }
            }), C;
          }
          function D(v, T, n) {
            v.x = v.x + n.x, v.y = v.y + n.y, v.label_x = v.label_x + n.x, v.label_y = v.label_y + n.y;
            var r = [];
            return v.connected_segments.map(function(b) {
              var C = T[b.reaction_id];
              r.indexOf(b.reaction_id) < 0 && (r.push(b.reaction_id), v.node_type === "midmarker" && (C.label_x = C.label_x + n.x, C.label_y = C.label_y + n.y));
            }), { reaction_ids: r };
          }
          function H(v, T, n) {
            var r = Math.floor(n / 2);
            return v * (T - r + (T >= r));
          }
          function B(v, T, n, r) {
            var b = Math.floor(r / 2);
            return T + Math.abs(n - b + (n >= b)) * v;
          }
          function k(v, T, n, r, b, C) {
            var ne = n[0];
            n = [X.c_minus_c(n[0], ne), X.c_minus_c(n[1], ne)], r = X.c_minus_c(r, ne);
            var ge = 80, ce = 0.4, xe = 0.25, fe = ge * 0.3, Ce = 50, he = 20, le = v.count - 1, G = void 0, P = void 0;
            v.is_primary ? G = 20 : (G = 10, v.index > T ? P = v.index - 1 : P = v.index);
            var $ = b - G, E = [{ x: G, y: 0 }, { x: $, y: 0 }], V = void 0, ie = void 0, ae = void 0, K = void 0;
            return v.coefficient < 0 !== C && v.is_primary ? (V = {
              x: E[0].x,
              y: E[0].y
            }, ae = {
              x: r.x * (1 - ce) + E[0].x * ce,
              y: r.y * (1 - ce) + E[0].y * ce
            }, K = {
              x: r.x * xe + V.x * (1 - xe),
              y: r.y * xe + V.y * (1 - xe)
            }, ie = {
              x: n[0].x,
              y: n[0].y
            }) : v.coefficient < 0 !== C ? (V = {
              x: E[0].x + B(he, Ce, P, le),
              y: E[0].y + H(fe, P, le)
            }, ae = {
              x: r.x * (1 - ce) + E[0].x * ce,
              y: r.y * (1 - ce) + E[0].y * ce
            }, K = {
              x: r.x * xe + V.x * (1 - xe),
              y: r.y * xe + V.y * (1 - xe)
            }, ie = {
              x: n[0].x + B(he, Ce, P, le),
              y: n[0].y + H(ge, P, le)
            }) : v.coefficient > 0 !== C && v.is_primary ? (V = {
              x: E[1].x,
              y: E[1].y
            }, ae = {
              x: r.x * (1 - ce) + E[1].x * ce,
              y: r.y * (1 - ce) + E[1].y * ce
            }, K = {
              x: r.x * xe + V.x * (1 - xe),
              y: r.y * xe + V.y * (1 - xe)
            }, ie = {
              x: n[1].x,
              y: n[1].y
            }) : v.coefficient > 0 !== C && (V = {
              x: E[1].x - B(he, Ce, P, le),
              y: E[1].y + H(fe, P, le)
            }, ae = {
              x: r.x * (1 - ce) + E[1].x * ce,
              y: r.y * (1 - ce) + E[1].y * ce
            }, K = {
              x: r.x * xe + V.x * (1 - xe),
              y: r.y * xe + V.y * (1 - xe)
            }, ie = {
              x: n[1].x - B(he, Ce, P, le),
              y: n[1].y + H(ge, P, le)
            }), {
              b1: X.c_plus_c(ne, ae),
              b2: X.c_plus_c(ne, K),
              circle: X.c_plus_c(ne, ie)
            };
          }
          function _(v, T, n) {
            var r = String(++v.text_labels), b = { text: T, x: n.x, y: n.y };
            return { id: r, label: b };
          }
          function Q(v, T) {
            return v + "_" + T;
          }
          function o(v) {
            var T = [];
            for (var n in v) {
              var r = v[n], b = function(ge) {
                var ce = r.segments[ge], xe = ["b1", "b2"];
                xe.forEach(function(fe) {
                  var Ce = ce[fe];
                  Ce !== null && T.push(Q(ge, fe));
                });
              };
              for (var C in r.segments)
                b(C);
            }
            return T;
          }
          function W(v, T) {
            var n = {}, r = function(ne) {
              var ge = v[ne];
              ["b1", "b2"].forEach(function(ce) {
                var xe = ge[ce];
                if (xe !== null) {
                  var fe = Q(ne, ce);
                  n[fe] = {
                    bezier: ce,
                    x: xe.x,
                    y: xe.y,
                    reaction_id: T,
                    segment_id: ne
                  };
                }
              });
            };
            for (var b in v)
              r(b);
            return n;
          }
          function y(v) {
            var T = {};
            for (var n in v) {
              var r = v[n], b = W(r.segments, n);
              X.extend(T, b);
            }
            return T;
          }
        },
        /* 30 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = {
            GaBuGeRd: [{ type: "min", color: "#c8c8c8", size: 12 }, { type: "value", value: 0.01, color: "#9696ff", size: 16 }, { type: "value", value: 20, color: "#209123", size: 20 }, { type: "max", color: "#ff0000", size: 25 }],
            GaBuRd: [{ type: "min", color: "#c8c8c8", size: 12 }, { type: "median", color: "#9696ff", size: 20 }, { type: "max", color: "#ff0000", size: 25 }],
            RdYlBu: [{ type: "min", color: "#d7191c", size: 12 }, { type: "median", color: "#ffffbf", size: 20 }, { type: "max", color: "#2c7bb6", size: 25 }],
            GeGaRd: [{ type: "min", color: "#209123", size: 25 }, { type: "value", value: 0, color: "#c8c8c8", size: 12 }, { type: "max", color: "#ff0000", size: 25 }],
            WhYlRd: [{ type: "min", color: "#fffaf0", size: 20 }, { type: "median", color: "#f1c470", size: 30 }, { type: "max", color: "#800000", size: 40 }]
          };
          O.default = a;
        },
        /* 31 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          function a(j, t) {
            if (!(j instanceof t))
              throw new TypeError("Cannot call a class as a function");
          }
          function X(j, t) {
            return j + 1 > t - 1 ? 0 : j + 1;
          }
          function q(j, t) {
            return j - 1 < 0 ? t - 1 : j - 1;
          }
          var ee = function() {
            function j() {
              a(this, j);
              var t = 40;
              this.stack = Array(t), this.current = -1, this.oldest = -1, this.newest = -1, this.endOfStack = !0, this.topOfStack = !0;
            }
            return j.prototype.push = function(F, M) {
              return this.current = X(this.current, this.stack.length), this.endOfStack ? this.oldest = this.current : this.oldest === this.current && (this.oldest = X(this.oldest, this.stack.length)), this.stack[this.current] = { undo: F, redo: M }, this.newest = this.current, this.topOfStack = !0, this.endOfStack = !1, { do: function() {
                return M();
              } };
            }, j.prototype.undo = function() {
              if (this.endOfStack)
                return console.warn("End of stack.");
              this.stack[this.current].undo(), this.current === this.oldest ? this.endOfStack = !0 : this.current = q(this.current, this.stack.length), this.topOfStack = !1;
            }, j.prototype.redo = function() {
              if (this.topOfStack)
                return console.warn("Top of stack.");
              this.endOfStack || (this.current = X(this.current, this.stack.length)), this.stack[this.current].redo(), this.current === this.newest && (this.topOfStack = !0), this.endOfStack = !1;
            }, j;
          }();
          O.default = ee;
        },
        /* 32 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(33), X = j(a), q = d(4), ee = j(q);
          function j(h) {
            return h && h.__esModule ? h : { default: h };
          }
          function t(h, x) {
            if (!(h instanceof x))
              throw new TypeError("Cannot call a class as a function");
          }
          function F(h, x) {
            if (!x)
              return h;
            var m = ee.default.isArray(h) ? h : [h], D = m.reduce(function(H, B) {
              var k = B.replace("ctrl+", "meta+");
              return k !== B && H.push(k), H;
            }, m.slice());
            return D.length === m.length ? h : D;
          }
          var M = function() {
            function h() {
              var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], D = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, H = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, B = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null;
              t(this, h), this.assignedKeys = x, this.inputList = m, this.mousetrap = D ? new X.default(D) : new X.default(), this.ctrlEqualsCmd = H, this.mousetrap.stopCallback = function() {
                return !1;
              }, this.escapeQueue = [], this.removeEscapeListener = null, this.settings = B, this.enabled = !0, this.update();
            }
            return h.prototype.update = function() {
              var m = this;
              if (this.mousetrap.reset(), !!this.enabled) {
                var D = function(_) {
                  var Q = m.assignedKeys[_];
                  if (!Q.key)
                    return "continue";
                  var o = F(Q.key, m.ctrlEqualsCmd);
                  Q.inputList = m.inputList, m.mousetrap.bind(o, function(W) {
                    if (!(Q.requires && !m.settings.get(Q.requires))) {
                      var y = !1;
                      if (Q.ignoreWithInput)
                        for (var v = 0, T = Q.inputList.length; v < T; v++) {
                          var n = Q.inputList[v], r = ee.default.isFunction(n) ? n() : n;
                          if (r !== null && r.is_visible()) {
                            y = !0;
                            break;
                          }
                        }
                      y || (Q.fn ? Q.fn.call(Q.target) : console.warn("No function for key: " + Q.key), W.preventDefault());
                    }
                  }, "keydown");
                };
                for (var H in this.assignedKeys)
                  var B = D(H);
              }
            }, h.prototype.toggle = function(m) {
              ee.default.isUndefined(m) && (m = !this.enabled), this.enabled = m, this.update();
            }, h.prototype.addEnterListener = function(m, D) {
              return this.addKeyListener("enter", m, D);
            }, h.prototype._tryDropEscapeListener = function() {
              this.escapeQueue.length === 0 && this.removeEscapeListener && (this.removeEscapeListener(), this.removeEscapeListener = null);
            }, h.prototype.addEscapeListener = function(m) {
              var D = this;
              return this.removeEscapeListener === null && (this.removeEscapeListener = this.addKeyListener("escape", function() {
                if (D.escapeQueue.length > 0) {
                  var H = D.escapeQueue.pop();
                  H();
                }
                D._tryDropEscapeListener();
              })), this.escapeQueue.push(m), function() {
                var H = D.escapeQueue.indexOf(m);
                H > -1 && D.escapeQueue.splice(H, 1), D._tryDropEscapeListener();
              };
            }, h.prototype.addKeyListener = function(m, D) {
              var H = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, B = this.mousetrap.unbind.bind(this.mousetrap, m);
              return this.mousetrap.bind(F(m, this.ctrlEqualsCmd), function(k) {
                k.preventDefault(), D(), H && B();
              }), B;
            }, h;
          }();
          O.default = M;
        },
        /* 33 */
        /***/
        function(Te, O, d) {
          var a;
          (function(X, q, ee) {
            if (!X)
              return;
            for (var j = {
              8: "backspace",
              9: "tab",
              13: "enter",
              16: "shift",
              17: "ctrl",
              18: "alt",
              20: "capslock",
              27: "esc",
              32: "space",
              33: "pageup",
              34: "pagedown",
              35: "end",
              36: "home",
              37: "left",
              38: "up",
              39: "right",
              40: "down",
              45: "ins",
              46: "del",
              91: "meta",
              93: "meta",
              224: "meta"
            }, t = {
              106: "*",
              107: "+",
              109: "-",
              110: ".",
              111: "/",
              186: ";",
              187: "=",
              188: ",",
              189: "-",
              190: ".",
              191: "/",
              192: "`",
              219: "[",
              220: "\\",
              221: "]",
              222: "'"
            }, F = {
              "~": "`",
              "!": "1",
              "@": "2",
              "#": "3",
              $: "4",
              "%": "5",
              "^": "6",
              "&": "7",
              "*": "8",
              "(": "9",
              ")": "0",
              _: "-",
              "+": "=",
              ":": ";",
              '"': "'",
              "<": ",",
              ">": ".",
              "?": "/",
              "|": "\\"
            }, M = {
              option: "alt",
              command: "meta",
              return: "enter",
              escape: "esc",
              plus: "+",
              mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
            }, h, x = 1; x < 20; ++x)
              j[111 + x] = "f" + x;
            for (x = 0; x <= 9; ++x)
              j[x + 96] = x.toString();
            function m(r, b, C) {
              if (r.addEventListener) {
                r.addEventListener(b, C, !1);
                return;
              }
              r.attachEvent("on" + b, C);
            }
            function D(r) {
              if (r.type == "keypress") {
                var b = String.fromCharCode(r.which);
                return r.shiftKey || (b = b.toLowerCase()), b;
              }
              return j[r.which] ? j[r.which] : t[r.which] ? t[r.which] : String.fromCharCode(r.which).toLowerCase();
            }
            function H(r, b) {
              return r.sort().join(",") === b.sort().join(",");
            }
            function B(r) {
              var b = [];
              return r.shiftKey && b.push("shift"), r.altKey && b.push("alt"), r.ctrlKey && b.push("ctrl"), r.metaKey && b.push("meta"), b;
            }
            function k(r) {
              if (r.preventDefault) {
                r.preventDefault();
                return;
              }
              r.returnValue = !1;
            }
            function _(r) {
              if (r.stopPropagation) {
                r.stopPropagation();
                return;
              }
              r.cancelBubble = !0;
            }
            function Q(r) {
              return r == "shift" || r == "ctrl" || r == "alt" || r == "meta";
            }
            function o() {
              if (!h) {
                h = {};
                for (var r in j)
                  r > 95 && r < 112 || j.hasOwnProperty(r) && (h[j[r]] = r);
              }
              return h;
            }
            function W(r, b, C) {
              return C || (C = o()[r] ? "keydown" : "keypress"), C == "keypress" && b.length && (C = "keydown"), C;
            }
            function y(r) {
              return r === "+" ? ["+"] : (r = r.replace(/\+{2}/g, "+plus"), r.split("+"));
            }
            function v(r, b) {
              var C, ne, ge, ce = [];
              for (C = y(r), ge = 0; ge < C.length; ++ge)
                ne = C[ge], M[ne] && (ne = M[ne]), b && b != "keypress" && F[ne] && (ne = F[ne], ce.push("shift")), Q(ne) && ce.push(ne);
              return b = W(ne, ce, b), {
                key: ne,
                modifiers: ce,
                action: b
              };
            }
            function T(r, b) {
              return r === null || r === q ? !1 : r === b ? !0 : T(r.parentNode, b);
            }
            function n(r) {
              var b = this;
              if (r = r || q, !(b instanceof n))
                return new n(r);
              b.target = r, b._callbacks = {}, b._directMap = {};
              var C = {}, ne, ge = !1, ce = !1, xe = !1;
              function fe(E) {
                E = E || {};
                var V = !1, ie;
                for (ie in C) {
                  if (E[ie]) {
                    V = !0;
                    continue;
                  }
                  C[ie] = 0;
                }
                V || (xe = !1);
              }
              function Ce(E, V, ie, ae, K, s) {
                var g, U, Y = [], p = ie.type;
                if (!b._callbacks[E])
                  return [];
                for (p == "keyup" && Q(E) && (V = [E]), g = 0; g < b._callbacks[E].length; ++g)
                  if (U = b._callbacks[E][g], !(!ae && U.seq && C[U.seq] != U.level) && p == U.action && (p == "keypress" && !ie.metaKey && !ie.ctrlKey || H(V, U.modifiers))) {
                    var w = !ae && U.combo == K, u = ae && U.seq == ae && U.level == s;
                    (w || u) && b._callbacks[E].splice(g, 1), Y.push(U);
                  }
                return Y;
              }
              function he(E, V, ie, ae) {
                b.stopCallback(V, V.target || V.srcElement, ie, ae) || E(V, ie) === !1 && (k(V), _(V));
              }
              b._handleKey = function(E, V, ie) {
                var ae = Ce(E, V, ie), K, s = {}, g = 0, U = !1;
                for (K = 0; K < ae.length; ++K)
                  ae[K].seq && (g = Math.max(g, ae[K].level));
                for (K = 0; K < ae.length; ++K) {
                  if (ae[K].seq) {
                    if (ae[K].level != g)
                      continue;
                    U = !0, s[ae[K].seq] = 1, he(ae[K].callback, ie, ae[K].combo, ae[K].seq);
                    continue;
                  }
                  U || he(ae[K].callback, ie, ae[K].combo);
                }
                var Y = ie.type == "keypress" && ce;
                ie.type == xe && !Q(E) && !Y && fe(s), ce = U && ie.type == "keydown";
              };
              function le(E) {
                typeof E.which != "number" && (E.which = E.keyCode);
                var V = D(E);
                if (V) {
                  if (E.type == "keyup" && ge === V) {
                    ge = !1;
                    return;
                  }
                  b.handleKey(V, B(E), E);
                }
              }
              function G() {
                clearTimeout(ne), ne = setTimeout(fe, 1e3);
              }
              function P(E, V, ie, ae) {
                C[E] = 0;
                function K(p) {
                  return function() {
                    xe = p, ++C[E], G();
                  };
                }
                function s(p) {
                  he(ie, p, E), ae !== "keyup" && (ge = D(p)), setTimeout(fe, 10);
                }
                for (var g = 0; g < V.length; ++g) {
                  var U = g + 1 === V.length, Y = U ? s : K(ae || v(V[g + 1]).action);
                  $(V[g], Y, ae, E, g);
                }
              }
              function $(E, V, ie, ae, K) {
                b._directMap[E + ":" + ie] = V, E = E.replace(/\s+/g, " ");
                var s = E.split(" "), g;
                if (s.length > 1) {
                  P(E, s, V, ie);
                  return;
                }
                g = v(E, ie), b._callbacks[g.key] = b._callbacks[g.key] || [], Ce(g.key, g.modifiers, { type: g.action }, ae, E, K), b._callbacks[g.key][ae ? "unshift" : "push"]({
                  callback: V,
                  modifiers: g.modifiers,
                  action: g.action,
                  seq: ae,
                  level: K,
                  combo: E
                });
              }
              b._bindMultiple = function(E, V, ie) {
                for (var ae = 0; ae < E.length; ++ae)
                  $(E[ae], V, ie);
              }, m(r, "keypress", le), m(r, "keydown", le), m(r, "keyup", le);
            }
            n.prototype.bind = function(r, b, C) {
              var ne = this;
              return r = r instanceof Array ? r : [r], ne._bindMultiple.call(ne, r, b, C), ne;
            }, n.prototype.unbind = function(r, b) {
              var C = this;
              return C.bind.call(C, r, function() {
              }, b);
            }, n.prototype.trigger = function(r, b) {
              var C = this;
              return C._directMap[r + ":" + b] && C._directMap[r + ":" + b]({}, r), C;
            }, n.prototype.reset = function() {
              var r = this;
              return r._callbacks = {}, r._directMap = {}, r;
            }, n.prototype.stopCallback = function(r, b) {
              var C = this;
              if ((" " + b.className + " ").indexOf(" mousetrap ") > -1 || T(b, C.target))
                return !1;
              if ("composedPath" in r && typeof r.composedPath == "function") {
                var ne = r.composedPath()[0];
                ne !== r.target && (b = ne);
              }
              return b.tagName == "INPUT" || b.tagName == "SELECT" || b.tagName == "TEXTAREA" || b.isContentEditable;
            }, n.prototype.handleKey = function() {
              var r = this;
              return r._handleKey.apply(r, arguments);
            }, n.addKeycodes = function(r) {
              for (var b in r)
                r.hasOwnProperty(b) && (j[b] = r[b]);
              h = null;
            }, n.init = function() {
              var r = n(q);
              for (var b in r)
                b.charAt(0) !== "_" && (n[b] = /* @__PURE__ */ function(C) {
                  return function() {
                    return r[C].apply(r, arguments);
                  };
                }(b));
            }, n.init(), X.Mousetrap = n, Te.exports && (Te.exports = n), a = (function() {
              return n;
            }).call(O, d, O, Te), a !== ee && (Te.exports = a);
          })(typeof window < "u" ? window : null, typeof window < "u" ? document : null);
        },
        /* 34 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          function a(q, ee) {
            if (!(q instanceof ee))
              throw new TypeError("Cannot call a class as a function");
          }
          var X = function() {
            function q() {
              a(this, q), this.index = {};
            }
            return q.prototype.insert = function(j, t, F, M) {
              if (!F && j in this.index)
                throw new Error("id is already in the index");
              if (M && !("name" in t && "data" in t))
                throw new Error("malformed record");
              this.index[j] = t;
            }, q.prototype.remove = function(j) {
              return j in this.index ? (delete this.index[j], !0) : !1;
            }, q.prototype.find = function(j) {
              var t = RegExp(j, "i"), F = [];
              for (var M in this.index) {
                var h = this.index[M];
                t.exec(h.name) && F.push(h.data);
              }
              return F;
            }, q;
          }();
          O.default = X;
        },
        /* 35 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(19), X = j(a), q = d(4), ee = j(q);
          function j(h) {
            return h && h.__esModule ? h : { default: h };
          }
          function t(h, x) {
            if (!(h instanceof x))
              throw new TypeError("Cannot call a class as a function");
          }
          function F(h, x) {
            var m = {
              savedValue: null,
              currentValue: null,
              lastStatus: null
            }, D = X.default.combineAsArray(h, x.toProperty(null)).scan(m, function(H, B) {
              var k = H.savedValue, _ = H.currentValue, Q = H.lastStatus, o = B[0], W = B[1], y = Q !== W;
              return y && W === "hold" ? {
                savedValue: _,
                currentValue: _,
                lastStatus: W
              } : !y && W === "hold" ? {
                savedValue: k,
                currentValue: o,
                lastStatus: W
              } : y && W === "abandon" ? {
                savedValue: null,
                currentValue: k,
                lastStatus: W
              } : y && W === "accept" ? {
                savedValue: null,
                currentValue: _,
                lastStatus: W
              } : {
                savedValue: null,
                currentValue: o,
                lastStatus: W
              };
            }).skip(1).map(function(H) {
              var B = H.currentValue;
              return B;
            }).skipDuplicates().toEventStream();
            return D;
          }
          var M = function() {
            function h(x, m) {
              var D = this;
              t(this, h), this._options = x, this.statusBus = new X.default.Bus();
              var H = ee.default.chain(x).mapObject(function(B, k) {
                var _ = ee.default.contains(m, k), Q = D.createSetting(k, B, _), o = Q.bus, W = Q.stream, y = Q.acceptedStream;
                return [o, W, y];
              }).pairs().map(function(B) {
                var k = B[0], _ = B[1], Q = _[0], o = _[1], W = _[2];
                return [[k, Q], [k, o], [k, W]];
              }).unzip().map(function(B) {
                return ee.default.object(B);
              }).value();
              this.busses = H[0], this.streams = H[1], this.acceptedStreams = H[2];
            }
            return h.prototype.createSetting = function(m, D, H) {
              var B = this, k = new X.default.Bus(), _ = H ? F(k, this.statusBus) : k.toEventStream(), Q = _.sampledBy(this.statusBus.filter(function(o) {
                return o === "accept" || o === "abandon";
              })).merge(
                // Then merge with all the other changes
                _.filter(this.statusBus.map(function(o) {
                  return o === "accept";
                }).toProperty(!0))
              );
              return _.onValue(function(o) {
                B._options[m] = o;
              }), k.push(D), { bus: k, stream: _, acceptedStream: Q };
            }, h.prototype.set_conditional = function(m, D) {
              return console.warn("set_conditional is deprecated. Use Settings.set() instead"), this.set(m, D);
            }, h.prototype.set = function(m, D) {
              if (!(m in this.busses))
                throw new Error("Invalid setting name " + m);
              this.busses[m].push(D);
            }, h.prototype.get_option = function(m) {
              return console.warn("get_option is deprecated. Use Settings.get() instead"), this.get(m);
            }, h.prototype.get = function(m) {
              return this._options[m];
            }, h.prototype.holdChanges = function() {
              this.statusBus.push("hold");
            }, h.prototype.abandonChanges = function() {
              this.statusBus.push("abandon");
            }, h.prototype.acceptChanges = function() {
              this.statusBus.push("accept");
            }, h;
          }();
          O.default = M;
        },
        /* 36 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = Object.assign || function(M) {
            for (var h = 1; h < arguments.length; h++) {
              var x = arguments[h];
              for (var m in x)
                Object.prototype.hasOwnProperty.call(x, m) && (M[m] = x[m]);
            }
            return M;
          }, X = d(5);
          function q(M, h) {
            if (!(M instanceof h))
              throw new TypeError("Cannot call a class as a function");
          }
          function ee(M, h) {
            if (!M)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return h && (typeof h == "object" || typeof h == "function") ? h : M;
          }
          function j(M, h) {
            if (typeof h != "function" && h !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof h);
            M.prototype = Object.create(h && h.prototype, { constructor: { value: M, enumerable: !1, writable: !0, configurable: !0 } }), h && (Object.setPrototypeOf ? Object.setPrototypeOf(M, h) : M.__proto__ = h);
          }
          var t = function(M) {
            j(h, M);
            function h(x) {
              q(this, h);
              var m = ee(this, M.call(this, x));
              return m.state = {}, m;
            }
            return h.prototype.componentDidMount = function() {
              var m = this;
              this.props.connectSetStateFn(function(D) {
                return m.setState(D);
              });
            }, h.prototype.is_visible = function() {
              return this.state.display;
            }, h.prototype.render = function() {
              var m = this;
              return this.state.display ? (0, X.h)(this.props.component, a({
                setDisplay: function(H) {
                  return m.setState({ display: H });
                },
                ref: this.props.refPassthrough
              }, this.state)) : null;
            }, h;
          }(X.Component);
          function F(M, h, x, m) {
            var D = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null;
            (0, X.render)(
              (0, X.h)(t, {
                component: M,
                connectSetStateFn: x,
                ref: h,
                refPassthrough: D
              }),
              m,
              // If there is already a div, re-render it. Otherwise make a new one
              m.children.length > 0 ? m.firstChild : void 0
            );
          }
          O.default = F;
        },
        /* 37 */
        /***/
        function(Te, O) {
          Te.exports = "data:application/vnd.ms-fontobject;base64, ";
        },
        /* 38 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0, O.libs = O.EscherMapModel = O.EscherMapView = O.ZoomContainer = O.dataStyles = O.Settings = O.SearchIndex = O.utils = O.CobraModel = O.UndoStack = O.DataMenu = O.KeyManager = O.Behavior = O.Map = O.default = O.Builder = O.version = void 0;
          var a = d(20);
          Object.defineProperty(O, "Builder", {
            enumerable: !0,
            get: function() {
              return C(a).default;
            }
          }), Object.defineProperty(O, "default", {
            enumerable: !0,
            get: function() {
              return C(a).default;
            }
          });
          var X = d(27);
          Object.defineProperty(O, "Map", {
            enumerable: !0,
            get: function() {
              return C(X).default;
            }
          });
          var q = d(28);
          Object.defineProperty(O, "Behavior", {
            enumerable: !0,
            get: function() {
              return C(q).default;
            }
          });
          var ee = d(32);
          Object.defineProperty(O, "KeyManager", {
            enumerable: !0,
            get: function() {
              return C(ee).default;
            }
          });
          var j = d(87);
          Object.defineProperty(O, "DataMenu", {
            enumerable: !0,
            get: function() {
              return C(j).default;
            }
          });
          var t = d(31);
          Object.defineProperty(O, "UndoStack", {
            enumerable: !0,
            get: function() {
              return C(t).default;
            }
          });
          var F = d(18);
          Object.defineProperty(O, "CobraModel", {
            enumerable: !0,
            get: function() {
              return C(F).default;
            }
          });
          var M = d(3);
          Object.defineProperty(O, "utils", {
            enumerable: !0,
            get: function() {
              return C(M).default;
            }
          });
          var h = d(34);
          Object.defineProperty(O, "SearchIndex", {
            enumerable: !0,
            get: function() {
              return C(h).default;
            }
          });
          var x = d(35);
          Object.defineProperty(O, "Settings", {
            enumerable: !0,
            get: function() {
              return C(x).default;
            }
          });
          var m = d(12);
          Object.defineProperty(O, "dataStyles", {
            enumerable: !0,
            get: function() {
              return C(m).default;
            }
          });
          var D = d(26);
          Object.defineProperty(O, "ZoomContainer", {
            enumerable: !0,
            get: function() {
              return C(D).default;
            }
          });
          var H = d(88);
          Object.defineProperty(O, "EscherMapView", {
            enumerable: !0,
            get: function() {
              return H.EscherMapView;
            }
          }), Object.defineProperty(O, "EscherMapModel", {
            enumerable: !0,
            get: function() {
              return H.EscherMapModel;
            }
          });
          var B = d(4), k = C(B), _ = d(5), Q = C(_), o = d(19), W = C(o), y = d(33), v = C(y), T = d(21), n = C(T), r = d(0), b = d(16);
          function C(ne) {
            return ne && ne.__esModule ? ne : { default: ne };
          }
          O.version = "1.7.3";
          /**
                               * @license
                               *
                               * Escher
                               * Author: Zachary King
                               *
                               * The MIT License (MIT)
                               *
                               * This software is Copyright © 2015 The Regents of the University of
                               * California. All Rights Reserved.
                               *
                               * Permission is hereby granted, free of charge, to any person obtaining a copy
                               * of this software and associated documentation files (the "Software"), to deal
                               * in the Software without restriction, including without limitation the rights
                               * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
                               * copies of the Software, and to permit persons to whom the Software is
                               * furnished to do so, subject to the following conditions:
                               *
                               * The above copyright notice and this permission notice shall be included in
                               * all copies or substantial portions of the Software.
                               *
                               * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                               * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                               * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
                               * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                               * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                               * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
                               * THE SOFTWARE.
                               */
          O.libs = {
            _: k.default,
            underscore: k.default,
            preact: Q.default,
            baconjs: W.default,
            mousetrap: v.default,
            vkbeautify: n.default,
            d3_selection: r.selection,
            d3_select: r.select,
            d3_json: b.json
          };
        },
        /* 39 */
        /***/
        function(Te, O, d) {
          var a;
          /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
          var X = X || function(q) {
            if (!(typeof q > "u" || typeof navigator < "u" && /MSIE [1-9]\./.test(navigator.userAgent))) {
              var ee = q.document, j = function() {
                return q.URL || q.webkitURL || q;
              }, t = ee.createElementNS("http://www.w3.org/1999/xhtml", "a"), F = "download" in t, M = function(y) {
                var v = new MouseEvent("click");
                y.dispatchEvent(v);
              }, h = /constructor/i.test(q.HTMLElement) || q.safari, x = /CriOS\/[\d]+/.test(navigator.userAgent), m = function(y) {
                (q.setImmediate || q.setTimeout)(function() {
                  throw y;
                }, 0);
              }, D = "application/octet-stream", H = 1e3 * 40, B = function(y) {
                var v = function() {
                  typeof y == "string" ? j().revokeObjectURL(y) : y.remove();
                };
                setTimeout(v, H);
              }, k = function(y, v, T) {
                v = [].concat(v);
                for (var n = v.length; n--; ) {
                  var r = y["on" + v[n]];
                  if (typeof r == "function")
                    try {
                      r.call(y, T || y);
                    } catch (b) {
                      m(b);
                    }
                }
              }, _ = function(y) {
                return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(y.type) ? new Blob(["\uFEFF", y], { type: y.type }) : y;
              }, Q = function(y, v, T) {
                T || (y = _(y));
                var n = this, r = y.type, b = r === D, C, ne = function() {
                  k(n, "writestart progress write writeend".split(" "));
                }, ge = function() {
                  if ((x || b && h) && q.FileReader) {
                    var ce = new FileReader();
                    ce.onloadend = function() {
                      var fe = x ? ce.result : ce.result.replace(/^data:[^;]*;/, "data:attachment/file;"), Ce = q.open(fe, "_blank");
                      Ce || (q.location.href = fe), fe = void 0, n.readyState = n.DONE, ne();
                    }, ce.readAsDataURL(y), n.readyState = n.INIT;
                    return;
                  }
                  if (C || (C = j().createObjectURL(y)), b)
                    q.location.href = C;
                  else {
                    var xe = q.open(C, "_blank");
                    xe || (q.location.href = C);
                  }
                  n.readyState = n.DONE, ne(), B(C);
                };
                if (n.readyState = n.INIT, F) {
                  C = j().createObjectURL(y), setTimeout(function() {
                    t.href = C, t.download = v, M(t), ne(), B(C), n.readyState = n.DONE;
                  });
                  return;
                }
                ge();
              }, o = Q.prototype, W = function(y, v, T) {
                return new Q(y, v || y.name || "download", T);
              };
              return typeof navigator < "u" && navigator.msSaveOrOpenBlob ? function(y, v, T) {
                return v = v || y.name || "download", T || (y = _(y)), navigator.msSaveOrOpenBlob(y, v);
              } : (o.abort = function() {
              }, o.readyState = o.INIT = 0, o.WRITING = 1, o.DONE = 2, o.error = o.onwritestart = o.onprogress = o.onwrite = o.onabort = o.onerror = o.onwriteend = null, W);
            }
          }(
            typeof self < "u" && self || typeof window < "u" && window || this.content
          );
          Te.exports ? Te.exports.saveAs = X : d(24) !== null && d(25) !== null && (a = (function() {
            return X;
          }).call(O, d, O, Te), a !== void 0 && (Te.exports = a));
        },
        /* 40 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(3), X = B(a), q = d(17), ee = B(q), j = d(41), t = B(j), F = d(42), M = B(F), h = d(18), x = B(h), m = d(4), D = B(m), H = d(0);
          function B(Q) {
            return Q && Q.__esModule ? Q : { default: Q };
          }
          function k(Q, o) {
            if (!(Q instanceof o))
              throw new TypeError("Cannot call a class as a function");
          }
          var _ = function() {
            function Q(o, W, y, v) {
              var T = this;
              k(this, Q);
              var n = o.append("div").attr("id", "rxn-input");
              this.placed_div = (0, ee.default)(n, W, { x: 240, y: 0 }), this.placed_div.hide(), this.completely = (0, t.default)(n.node(), { backgroundColor: "#eee" }), n.append("button").attr("class", "button input-close-button").text("×").on("mousedown", function() {
                return T.hideDropdown();
              }), this.map = W;
              var r = 90;
              this.direction_arrow = new M.default(W.sel), this.direction_arrow.setRotation(r), this.setUpMapCallbacks(W), this.zoomContainer = y, this.setUpZoomCallbacks(y), this.settings = v, this.toggle(!1), this.target_coords = null;
            }
            return Q.prototype.setUpMapCallbacks = function(W) {
              var y = this;
              W.callback_manager.set("select_metabolite_with_id.input", function(v, T) {
                if (y.is_active) {
                  var n = y.reload(v, T, !1);
                  n && y.showDropdown(T);
                }
                y.hideTarget();
              }), W.callback_manager.set("select_selectable.input", function(v, T, n) {
                if (y.hideTarget(), v === 1 && y.is_active && n) {
                  var r = y.reload(T, n, !1);
                  r && y.showDropdown(n);
                } else
                  y.toggle(!1);
              }), W.callback_manager.set("deselect_nodes", function() {
                y.direction_arrow.hide(), y.hideDropdown();
              }), W.callback_manager.set("before_svg_export", function() {
                y.direction_arrow.hide(), y.hideTarget();
              });
            }, Q.prototype.setUpZoomCallbacks = function(W) {
            }, Q.prototype.is_visible = function() {
              return this.placed_div.is_visible();
            }, Q.prototype.toggle = function(W) {
              if (W === void 0 ? this.is_active = !this.is_active : this.is_active = W, this.is_active) {
                this.toggleStartReactionListener(!0);
                var y = !0;
                D.default.isNull(this.target_coords) ? y = this.reloadAtSelected() : this.placed_div.place(this.target_coords), y && (this.showDropdown(), this.map.set_status("Click on the canvas or an existing metabolite")), this.direction_arrow.show();
              } else
                this.toggleStartReactionListener(!1), this.hideDropdown(), this.map.set_status(null), this.direction_arrow.hide();
            }, Q.prototype.showDropdown = function(W) {
              var y = this;
              this.clear_escape = this.map.key_manager.addEscapeListener(function() {
                return y.hideDropdown();
              }, !0), this.completely.input.blur(), this.completely.repaint(), this.completely.setText(""), this.completely.input.focus();
            }, Q.prototype.hideDropdown = function() {
              this.clear_escape && this.clear_escape(), this.clear_escape = null, this.placed_div.hide(), this.completely.input.blur(), this.completely.hideDropDown();
            }, Q.prototype.place = function(W) {
              this.placed_div.place(W), this.direction_arrow.setLocation(W), this.direction_arrow.show();
            }, Q.prototype.reloadAtSelected = function() {
              this.map.deselect_text_labels();
              var W = this.map.select_single_node();
              if (W === null)
                return !1;
              var y = {
                x: W.x,
                y: W.y
                // reload the reaction input
              };
              return this.reload(W, y, !1);
            }, Q.prototype.alreadyDrawn = function(W, y) {
              for (var v in y)
                if (y[v].bigg_id === W)
                  return !0;
              return !1;
            }, Q.prototype.reload = function(W, y, v) {
              var T = this;
              if (!v && !W) {
                console.error("No selected node and not starting from scratch");
                return;
              }
              if (this.place(y), this.map.cobra_model === null)
                return this.completely.setText("Cannot add: No model."), !1;
              var n = this.settings.get("identifiers_on_map") === "name", r = this.settings.get("allow_building_duplicate_reactions"), b = [], C = this.map.cobra_model.reactions, ne = this.map.cobra_model.metabolites, ge = this.map.reactions, ce = this.map.has_data_on_reactions, xe = W ? n ? W.name : W.bigg_id : "", fe = function(w, u) {
                return w.replace(new RegExp("(^| )(" + u.join("|") + ")($| )", "g"), "$1<b>$2</b>$3");
              }, Ce = {};
              for (var he in C) {
                var le = C[he], G = le.name, P = n ? G : he;
                if (!(!r && this.alreadyDrawn(he, ge))) {
                  for (var $ in le.metabolites)
                    if (v || $ === W.bigg_id) {
                      if (he in Ce)
                        continue;
                      var E = {}, V = [], ie = void 0;
                      if (n)
                        for (ie in le.metabolites) {
                          var ae = ne[ie].name;
                          E[ae] = le.metabolites[ie], V.push(ae);
                        }
                      else {
                        E = X.default.clone(le.metabolites);
                        for (ie in le.metabolites)
                          V.push(ie);
                      }
                      var K = D.default.flatten(le.genes.map(function(p) {
                        return [p.name, p.biggId];
                      })), s = x.default.build_reaction_string(E, le.reversibility, le.lower_bound, le.upper_bound), g = [P].concat(V).concat(K).filter(function(p) {
                        return p;
                      });
                      ce ? b.push({
                        reaction_data: le.data,
                        html: "<b>" + P + "</b>: " + le.data_string,
                        matches: g,
                        id: he
                      }) : b.push({
                        html: "<b>" + P + "</b>	" + fe(s, [xe]),
                        matches: g,
                        id: he
                      }), Ce[he] = !0;
                    }
                }
              }
              var U = ce ? function(p, w) {
                return Math.abs(p.reaction_data) > Math.abs(w.reaction_data) ? -1 : 1;
              } : function(p, w) {
                return p.html.toLowerCase() < w.html.toLowerCase() ? -1 : 1;
              };
              this.completely.options = b.sort(U), this.completely.setText("");
              var Y = function(w) {
                if (w !== null)
                  if (v)
                    T.map.new_reaction_from_scratch(w, y, T.direction_arrow.getRotation());
                  else {
                    if (!(W.node_id in T.map.nodes)) {
                      console.error("Selected node no longer exists"), T.hideDropdown();
                      return;
                    }
                    T.map.new_reaction_for_metabolite(w, W.node_id, T.direction_arrow.getRotation());
                  }
              };
              return this.completely.onEnter = function(p) {
                this.setText(""), this.onChange(""), Y(p);
              }, !0;
            }, Q.prototype.toggleStartReactionListener = function(W) {
              var y = this;
              if (W === void 0)
                this.start_reaction_listener = !this.start_reaction_listener;
              else {
                if (this.start_reaction_listener === W)
                  return;
                this.start_reaction_listener = W;
              }
              if (this.start_reaction_listener) {
                var v = this.map.sel.node();
                this.map.sel.on("click.start_reaction", function() {
                  if (!y.direction_arrow.dragging) {
                    var T = {
                      x: (0, H.mouse)(v)[0],
                      y: (0, H.mouse)(v)[1]
                      // unselect metabolites
                    };
                    y.map.deselect_nodes(), y.map.deselect_text_labels();
                    var n = y.reload(null, T, !0);
                    n && y.showDropdown(T), y.showTarget(y.map, T);
                  }
                }), this.map.sel.style("cursor", "pointer");
              } else
                this.map.sel.on("click.start_reaction", null), this.map.sel.style("cursor", null), this.hideTarget();
            }, Q.prototype.hideTarget = function() {
              this.target_coords && this.map.sel.selectAll(".start-reaction-target").remove(), this.target_coords = null;
            }, Q.prototype.showTarget = function(W, y) {
              var v = W.sel.selectAll(".start-reaction-target").data([12, 5]);
              v.enter().append("circle").classed("start-reaction-target", !0).attr("r", function(T) {
                return T;
              }).style("stroke-width", 4).merge(v).style("visibility", "visible").attr("transform", "translate(" + y.x + "," + y.y + ")"), this.target_coords = y;
            }, Q;
          }();
          O.default = _;
        },
        /* 41 */
        /***/
        function(Te, O, d) {
          var a = d(3), X = q(a);
          function q(ee) {
            if (ee && ee.__esModule)
              return ee;
            var j = {};
            if (ee != null)
              for (var t in ee)
                Object.prototype.hasOwnProperty.call(ee, t) && (j[t] = ee[t]);
            return j.default = ee, j;
          }
          Te.exports = function(ee, j) {
            var t = X.get_document(ee), F = X.get_window(ee);
            j = j || {}, j.fontSize = j.fontSize || "13px", j.fontFamily = j.fontFamily || "sans-serif", j.promptInnerHTML = j.promptInnerHTML || "", j.color = j.color || "#333", j.hintColor = j.hintColor || "#aaa", j.backgroundColor = j.backgroundColor || "#fff", j.dropDownBorderColor = j.dropDownBorderColor || "#aaa", j.dropDownZIndex = j.dropDownZIndex || "100", j.dropDownOnHoverBackgroundColor = j.dropDownOnHoverBackgroundColor || "#ddd";
            var M = t.createElement("input");
            M.type = "text", M.spellcheck = !1, M.style.fontSize = j.fontSize, M.style.fontFamily = j.fontFamily, M.style.color = j.color, M.style.backgroundColor = j.backgroundColor, M.style.width = "100%", M.style.outline = "0", M.style.border = "0", M.style.margin = "0", M.style.padding = "0";
            var h = M.cloneNode();
            h.disabled = "", h.style.position = "absolute", h.style.top = "0", h.style.left = "0", h.style.borderColor = "transparent", h.style.boxShadow = "none", h.style.color = j.hintColor, M.style.backgroundColor = "transparent", M.style.verticalAlign = "top", M.style.position = "relative";
            var x = t.createElement("div");
            x.style.position = "relative", x.style.outline = "0", x.style.border = "0", x.style.margin = "0", x.style.padding = "0";
            var m = t.createElement("div");
            if (m.style.position = "absolute", m.style.outline = "0", m.style.margin = "0", m.style.padding = "0", m.style.border = "0", m.style.fontSize = j.fontSize, m.style.fontFamily = j.fontFamily, m.style.color = j.color, m.style.backgroundColor = j.backgroundColor, m.style.top = "0", m.style.left = "0", m.style.overflow = "hidden", m.innerHTML = j.promptInnerHTML, m.style.background = "transparent", t.body === void 0)
              throw "thisDocument.body is undefined. The library was wired up incorrectly.";
            t.body.appendChild(m);
            var D = m.getBoundingClientRect().right;
            x.appendChild(m), m.style.visibility = "visible", m.style.left = "-" + D + "px", x.style.marginLeft = D + "px", x.appendChild(h), x.appendChild(M);
            var H = t.createElement("div");
            H.style.position = "absolute", H.style.visibility = "hidden", H.style.outline = "0", H.style.margin = "0", H.style.padding = "0", H.style.textAlign = "left", H.style.fontSize = j.fontSize, H.style.fontFamily = j.fontFamily, H.style.backgroundColor = j.backgroundColor, H.style.zIndex = j.dropDownZIndex, H.style.cursor = "default", H.style.borderStyle = "solid", H.style.borderWidth = "1px", H.style.borderColor = j.dropDownBorderColor, H.style.overflowX = "hidden", H.style.whiteSpace = "pre", H.style.overflowY = "scroll";
            var B = function(r) {
              var b = [], C = 0, ne = -1, ge = null, ce = function() {
                this.style.outline = "1px solid #ddd";
              }, xe = function() {
                this.style.outline = "0";
              }, fe = function(le) {
                le.preventDefault(), Ce.onmouseselection(this.id);
              }, Ce = {
                hide: function() {
                  r.style.visibility = "hidden";
                },
                refresh: function(le, G) {
                  r.style.visibility = "hidden", C = 0, r.innerHTML = "";
                  var P = F.innerHeight || t.documentElement.clientHeight, $ = r.parentNode.getBoundingClientRect(), E = $.top - 6, V = P - $.bottom - 6;
                  b = [];
                  for (var ie = 0; ie < G.length; ie++) {
                    var ae = G[ie].matches.filter(function(g) {
                      return g.toLowerCase().indexOf(le.toLowerCase()) == 0;
                    });
                    if (ae.length != 0) {
                      var K = t.createElement("div");
                      if (K.style.color = j.color, K.onmouseover = ce, K.onmouseout = xe, K.onmousedown = function(g) {
                        g.preventDefault();
                      }, K.ondblclick = fe, K.__hint = ae[0], K.id = G[ie].id, K.innerHTML = G[ie].html, b.push(K), r.appendChild(K), b.length >= W.display_limit) {
                        var s = t.createElement("div");
                        s.innerHTML = " " + (G.length - b.length) + " more", b.push(s), r.appendChild(s);
                        break;
                      }
                    }
                  }
                  b.length !== 0 && (Ce.highlight(0), E > V * 3 ? (r.style.maxHeight = E + "px", r.style.top = "", r.style.bottom = "100%") : (r.style.top = "100%", r.style.bottom = "", r.style.maxHeight = V + "px"), r.style.visibility = "visible");
                },
                highlight: function(le) {
                  ne != -1 && b[ne] && (b[ne].style.backgroundColor = j.backgroundColor), b[le].style.backgroundColor = j.dropDownOnHoverBackgroundColor, ne = le, ge = b[le];
                },
                // moves the selection either up or down (unless it's not
                // possible) step is either +1 or -1.
                move: function(le) {
                  return r.style.visibility === "hidden" ? "" : (C + le === -1 || C + le === b.length || (C += le, Ce.highlight(C)), b[C].__hint);
                },
                onmouseselection: function() {
                },
                get_current_row: function() {
                  return ge;
                }
              };
              return Ce;
            }, k = B(H);
            k.onmouseselection = function(n) {
              W.onEnter(n), W.input.focus();
            }, x.appendChild(H), ee.appendChild(x);
            var _, Q;
            function o(n) {
              return _ === void 0 && (_ = t.createElement("span"), _.style.visibility = "hidden", _.style.position = "fixed", _.style.outline = "0", _.style.margin = "0", _.style.padding = "0", _.style.border = "0", _.style.left = "0", _.style.whiteSpace = "pre", _.style.fontSize = j.fontSize, _.style.fontFamily = j.fontFamily, _.style.fontWeight = "normal", t.body.appendChild(_)), _.innerHTML = String(n).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), _.getBoundingClientRect().right;
            }
            var W = {
              get_hint: function(r) {
                return r;
              },
              display_limit: 1e3,
              onArrowDown: function() {
              },
              // defaults to no action.
              onArrowUp: function() {
              },
              // defaults to no action.
              onEnter: function() {
              },
              // defaults to no action.
              onTab: function() {
              },
              // defaults to no action.
              onChange: function() {
                W.repaint();
              },
              // defaults to repainting.
              startFrom: 0,
              options: [],
              // Only to allow easy access to the HTML elements to the final user
              // (possibly for minor customizations)
              wrapper: x,
              input: M,
              hint: h,
              dropDown: H,
              prompt: m,
              setText: function(r) {
                h.value = r, M.value = r;
              },
              getText: function() {
                return M.value;
              },
              hideDropDown: function() {
                k.hide();
              },
              repaint: function() {
                var r = M.value, b = W.startFrom, C = W.options, ne = C.length, ge = r.substring(b);
                Q = r.substring(0, b), h.value = "";
                for (var ce = 0; ce < ne; ce++) {
                  var xe = C[ce].matches.filter(function(fe) {
                    return fe.toLowerCase().indexOf(ge.toLowerCase()) == 0;
                  });
                  if (xe.length != 0) {
                    h.value = W.get_hint(xe[0]);
                    break;
                  }
                }
                H.style.left = o(Q) + "px", k.refresh(ge, W.options);
              }
            }, y, v = function(r, b) {
              y = r.value;
              var C = function() {
                var ge = r.value;
                y !== ge && (y = ge, b(ge));
              };
              r.addEventListener("input", C, !1), r.addEventListener("keyup", C, !1), r.addEventListener("change", C, !1);
            };
            v(M, function(n) {
              W.onChange(n), W.repaint();
            });
            var T = function(r) {
              r = r || F.event;
              var b = r.keyCode;
              if (b != 33 && b != 34) {
                if (b == 39 || b == 35 || b == 9) {
                  if (b == 9 && (r.preventDefault(), r.stopPropagation(), h.value.length == 0 && W.onTab()), h.value.length > 0) {
                    M.value = h.value;
                    var C = y != M.value;
                    y = M.value, C && W.onChange(M.value);
                  }
                  return;
                }
                if (b == 13) {
                  var ne = k.get_current_row().id;
                  W.onEnter(ne);
                  return;
                }
                if (b == 40) {
                  var ge = k.move(1);
                  ge == "" && W.onArrowDown(), h.value = W.get_hint(ge);
                  return;
                }
                if (b == 38) {
                  var ge = k.move(-1);
                  ge == "" && W.onArrowUp(), h.value = W.get_hint(ge), r.preventDefault(), r.stopPropagation();
                  return;
                }
                h.value = "";
              }
            };
            return M.addEventListener("keydown", T, !1), W;
          };
          /**
           * @license
           *
           * complete.ly 1.0.0
           * MIT Licensing
           * Copyright (c) 2013 Lorenzo Puccetti
           *
           * This Software shall be used for doing good things, not bad things.
           *
           *
           * Modified by Zachary King (c) 2014.
           *
           **/
        },
        /* 42 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(3), X = j(a), q = d(7), ee = d(0);
          function j(M) {
            if (M && M.__esModule)
              return M;
            var h = {};
            if (M != null)
              for (var x in M)
                Object.prototype.hasOwnProperty.call(M, x) && (h[x] = M[x]);
            return h.default = M, h;
          }
          function t(M, h) {
            if (!(M instanceof h))
              throw new TypeError("Cannot call a class as a function");
          }
          var F = function() {
            function M(h) {
              t(this, M), this.arrowContainer = h.append("g").attr("id", "direction-arrow-container").attr("transform", "translate(0,0)rotate(0)"), this.arrow = this.arrowContainer.append("path").classed("direction-arrow", !0).attr("d", "M0 -5 L0 5 L20 5 L20 10 L30 0 L20 -10 L20 -5 Z").style("visibility", "hidden").attr("transform", "translate(30,0)scale(2.5)"), this.sel = h, this.center = { x: 0, y: 0 }, this._setupDrag(), this.dragging = !1, this.isVisible = !1, this.show();
            }
            return M.prototype.setLocation = function(x) {
              this.center = x;
              var m = X.d3_transform_catch(this.arrowContainer.attr("transform"));
              this.arrowContainer.attr("transform", "translate(" + x.x + "," + x.y + ")rotate(" + m.rotate + ")");
            }, M.prototype.setRotation = function(x) {
              var m = X.d3_transform_catch(this.arrowContainer.attr("transform"));
              this.arrowContainer.attr("transform", "translate(" + m.translate + ")rotate(" + x + ")");
            }, M.prototype.displaceRotation = function(x) {
              var m = X.d3_transform_catch(this.arrowContainer.attr("transform"));
              this.arrowContainer.attr("transform", "translate(" + m.translate + ")rotate(" + (m.rotate + x) + ")");
            }, M.prototype.getRotation = function() {
              return X.d3_transform_catch(this.arrowContainer.attr("transform")).rotate;
            }, M.prototype.toggle = function(x) {
              x === void 0 ? this.isVisible = !this.isVisible : this.isVisible = x, this.arrow.style("visibility", this.isVisible ? "visible" : "hidden");
            }, M.prototype.show = function() {
              this.toggle(!0);
            }, M.prototype.hide = function() {
              this.toggle(!1);
            }, M.prototype.right = function() {
              this.setRotation(0);
            }, M.prototype.down = function() {
              this.setRotation(90);
            }, M.prototype.left = function() {
              this.setRotation(180);
            }, M.prototype.up = function() {
              this.setRotation(270);
            }, M.prototype._setupDrag = function() {
              var x = this, m = (0, q.drag)().on("start", function(D) {
                ee.event.sourceEvent.stopPropagation(), x.dragging = !0;
              }).on("drag", function(D) {
                var H = {
                  x: ee.event.dx,
                  y: ee.event.dy
                }, B = {
                  x: (0, ee.mouse)(x.sel.node())[0],
                  y: (0, ee.mouse)(x.sel.node())[1]
                }, k = X.angle_for_event(H, B, x.center);
                x.displaceRotation(X.to_degrees(k));
              }).on("end", function(D) {
                setTimeout(function() {
                  x.dragging = !1;
                }, 200);
              });
              this.arrowContainer.call(m);
            }, M;
          }();
          O.default = F;
        },
        /* 43 */
        /***/
        function(Te, O, d) {
          var a = d(3), X = d(12), q = d(13).default, ee = d(6).format, j = a.make_class();
          j.prototype = {
            init: t,
            create_reaction: h,
            update_reaction: x,
            create_bezier: k,
            update_bezier: _,
            create_node: Q,
            update_node: o,
            create_text_label: W,
            update_text_label: y,
            create_membrane: F,
            update_membrane: M,
            create_reaction_label: m,
            update_reaction_label: D,
            create_segment: H,
            update_segment: B
          }, Te.exports = j;
          function t(T, n, r) {
            this.behavior = T, this.settings = n, this.map = r, this.callback_manager = new q();
          }
          function F(T) {
            var n = T.append("rect").attr("class", "membrane");
            return this.callback_manager.run("create_membrane", this, T), n;
          }
          function M(T) {
            T.attr("width", function(n) {
              return n.width;
            }).attr("height", function(n) {
              return n.height;
            }).attr("transform", function(n) {
              return "translate(" + n.x + "," + n.y + ")";
            }).style("stroke-width", function(n) {
              return 10;
            }).attr("rx", function(n) {
              return 20;
            }).attr("ry", function(n) {
              return 20;
            }), this.callback_manager.run("update_membrane", this, T);
          }
          function h(T) {
            var n = T.append("g").attr("id", function(r) {
              return "r" + r.reaction_id;
            }).attr("class", "reaction");
            return this.create_reaction_label(n), this.callback_manager.run("create_reaction", this, T), n;
          }
          function x(T, n, r, b, C, ne) {
            T.select(".reaction-label-group").call((function(ge) {
              return this.update_reaction_label(ge, ne);
            }).bind(this)), a.draw_a_nested_object(T, ".segment-group", "segments", "segment_id", this.create_segment.bind(this), (function(ge) {
              return this.update_segment(ge, n, r, b, C, ne);
            }).bind(this), function(ge) {
              ge.remove();
            }), this.callback_manager.run("update_reaction", this, T);
          }
          function m(T, n) {
            var r = T.append("g").attr("class", "reaction-label-group");
            return r.append("text").attr("class", "reaction-label label"), r.append("g").attr("class", "all-genes-label-group"), this.callback_manager.run("create_reaction_label", this, T), r;
          }
          function D(T, n) {
            ee(".4g");
            var r = this.settings.get("identifiers_on_map"), b = this.settings.get("reaction_styles"), C = this.settings.get("show_gene_reaction_rules"), ne = this.settings.get("hide_all_labels"), ge = this.settings.get("gene_font_size"), ce = this.behavior.reactionLabelMouseover, xe = this.behavior.reactionLabelMouseout, fe = this.behavior.reactionLabelTouch, Ce = this.behavior.geneLabelMouseover, he = this.behavior.geneLabelMouseout, le = this.behavior.geneLabelTouch;
            T.attr("transform", function(ie) {
              return "translate(" + ie.label_x + "," + ie.label_y + ")";
            }).call(this.behavior.turnOffDrag).call(this.behavior.reactionLabelDrag);
            var G = T.select(".reaction-label").attr("visibility", ne ? "hidden" : "visible");
            ne || G.text(function(ie) {
              var ae = ie[r];
              return n && b.indexOf("text") !== -1 && (ae += " " + ie.data_string), ae;
            }).on("mouseover", ce).on("mouseout", xe).on("touchend", fe);
            var P = function(ae, K) {
              return ae + ge * 1.5 * (K + 1);
            }, $ = T.select(".all-genes-label-group").selectAll(".gene-label-group").data(function(ie) {
              var ae = "gene_string" in ie && ie.gene_string !== null && C && !ne && b.indexOf("text") !== -1, K = "gene_reaction_rule" in ie && ie.gene_reaction_rule !== null && C && !ne;
              if (ae)
                return console.warn("Showing gene_string. See TODO in source."), ie.gene_string;
              if (K) {
                var s = X.gene_string_for_data(ie.gene_reaction_rule, null, ie.genes, null, r, null);
                return s.forEach(function(g, U) {
                  g.label_x = ie.label_x, g.label_y = P(ie.label_y, U);
                }), s;
              } else
                return [];
            }), E = $.enter().append("g").attr("class", "gene-label-group");
            E.append("text").attr("class", "gene-label").style("font-size", ge + "px");
            var V = E.merge($);
            V.attr("transform", function(ie, ae) {
              return "translate(0, " + P(0, ae) + ")";
            }), V.select("text").text(function(ie) {
              return ie.text;
            }).on("mouseover", Ce).on("mouseout", he).on("touchend", le), $.exit().remove(), this.callback_manager.run("update_reaction_label", this, T);
          }
          function H(T) {
            var n = T.append("g").attr("class", "segment-group").attr("id", function(r) {
              return "s" + r.segment_id;
            });
            return n.append("path").attr("class", "segment"), n.append("g").attr("class", "arrowheads"), n.append("g").attr("class", "stoichiometry-labels"), this.callback_manager.run("create_segment", this, T), n;
          }
          function B(T, n, r, b, C, ne) {
            var ge = this.settings.get("reaction_styles"), ce = ne && ge.indexOf("size") !== -1, xe = ne && ge.indexOf("color") !== -1, fe = this.settings.get("reaction_no_data_size"), Ce = this.settings.get("reaction_no_data_color"), he = this.settings.get("highlight_missing"), le = this.settings.get("hide_secondary_metabolites"), G = this.settings.get("primary_metabolite_radius"), P = this.settings.get("secondary_metabolite_radius"), $ = this.behavior.reactionObjectMouseover, E = this.behavior.reactionObjectMouseout, V = function(g, U) {
              var Y = 20, p = 13;
              return U && (p = g === null ? fe : n.reaction_size(g), isNaN(p) && (p = fe), Y = p * 2), { width: Y, height: p };
            }, ie = function(g, U, Y, p) {
              var w = U || Y > 0 ? g.height : 0, u = p ? G : P;
              return u + w + 10;
            };
            T.selectAll(".segment").datum(function() {
              return Object.assign({}, this.parentNode.__data__, this.parentNode.parentNode.__data__);
            }).style("visibility", function(s) {
              var g = b[s.from_node_id], U = b[s.to_node_id];
              return le && (U.node_type === "metabolite" && !U.node_is_primary || g.node_type === "metabolite" && !g.node_is_primary) ? "hidden" : null;
            }).attr("d", function(s) {
              if (s.from_node_id === null || s.to_node_id === null)
                return null;
              var g = b[s.from_node_id], U = b[s.to_node_id], Y = s.b1, p = s.b2;
              if (g.node_type === "metabolite") {
                var w = V(s.data, ce), u = ie(w, s.reversibility, s.from_node_coefficient, g.node_is_primary), Z = Y === null ? U : Y;
                g = v(u, g, Z, "start");
              }
              if (U.node_type == "metabolite") {
                var w = V(s.data, ce), u = ie(w, s.reversibility, s.to_node_coefficient, U.node_is_primary), Z = p === null ? g : p;
                U = v(u, Z, U, "end");
              }
              var re = "M" + g.x + "," + g.y + " ";
              return Y !== null && p !== null && (re += "C" + Y.x + "," + Y.y + " " + p.x + "," + p.y + " "), re += U.x + "," + U.y, re;
            }).style("stroke", function(s) {
              var g = this.parentNode.parentNode.__data__.bigg_id, U = he && r !== null && !(g in r.reactions);
              if (U)
                return "red";
              if (xe) {
                var Y = s.data;
                return Y === null ? Ce : n.reaction_color(Y);
              }
              return null;
            }).style("stroke-width", function(s) {
              if (ce) {
                var g = s.data;
                return g === null ? fe : n.reaction_size(g);
              } else
                return null;
            }).attr("pointer-events", "visibleStroke").on("mouseover", $).on("mouseout", E);
            var ae = T.select(".arrowheads").selectAll(".arrowhead").data(function(s) {
              var g = [], U = b[s.from_node_id], Y = s.b1, p = b[s.to_node_id], w = s.b2;
              if (le && (p.node_type === "metabolite" && !p.node_is_primary || U.node_type === "metabolite" && !U.node_is_primary))
                return g;
              if (U.node_type === "metabolite" && (s.reversibility || s.from_node_coefficient > 0)) {
                var u = V(s.data, ce), Z = ie(u, s.reversibility, s.from_node_coefficient, U.node_is_primary), re = Y === null ? p : Y, de = a.to_degrees(a.get_angle([U, re])) + 90, be = v(Z, U, re, "start");
                g.push({
                  data: s.data,
                  x: be.x,
                  y: be.y,
                  size: u,
                  rotation: de,
                  show_arrowhead_flux: s.from_node_coefficient < 0 === s.reverse_flux || s.data === 0
                });
              }
              if (p.node_type === "metabolite" && (s.reversibility || s.to_node_coefficient > 0)) {
                var u = V(s.data, ce), Z = ie(u, s.reversibility, s.to_node_coefficient, p.node_is_primary), re = w === null ? U : w, de = a.to_degrees(a.get_angle([p, re])) + 90, be = v(Z, re, p, "end");
                g.push({
                  data: s.data,
                  x: be.x,
                  y: be.y,
                  size: u,
                  rotation: de,
                  show_arrowhead_flux: s.to_node_coefficient < 0 === s.reverse_flux || s.data === 0
                });
              }
              if (s.unconnected_segment_with_arrow) {
                var u = V(s.data, ce), re = p, de = a.to_degrees(a.get_angle([U, re])) + 90;
                g.push({
                  data: s.data,
                  x: U.x,
                  y: U.y,
                  size: u,
                  rotation: de,
                  show_arrowhead_flux: s.to_node_coefficient < 0 === s.reverse_flux || s.data === 0
                });
              }
              return g;
            });
            ae.enter().append("path").classed("arrowhead", !0).merge(ae).attr("d", function(s) {
              return "M" + [-s.size.width / 2, 0] + " L" + [0, s.size.height] + " L" + [s.size.width / 2, 0] + " Z";
            }).attr("transform", function(s) {
              return "translate(" + s.x + "," + s.y + ")rotate(" + s.rotation + ")";
            }).style("fill", function(s) {
              if (xe)
                if (s.show_arrowhead_flux) {
                  var g = s.data;
                  return g === null ? Ce : n.reaction_color(g);
                } else
                  return "#FFFFFF";
              return null;
            }).style("stroke", function(s) {
              if (xe) {
                var g = s.data;
                return g === null ? Ce : n.reaction_color(g);
              }
              return null;
            }), ae.exit().remove();
            var K = T.select(".stoichiometry-labels").selectAll(".stoichiometry-label").data(function(s) {
              var g = [], U = b[s.from_node_id], Y = s.b1, p = b[s.to_node_id], w = s.b2, u = 1.5;
              if (le && (p.node_type == "metabolite" && !p.node_is_primary || U.node_type == "metabolite" && !U.node_is_primary))
                return g;
              if (U.node_type === "metabolite" && Math.abs(s.from_node_coefficient) != 1) {
                var Z = V(s.data, ce), re = u * ie(Z, !1, 0, p.node_is_primary), de = Y === null ? p : Y;
                de = a.c_plus_c(de, a.rotate_coords(de, 0.5, U));
                var be = v(re, U, de, "start");
                be = a.c_plus_c(be, { x: 0, y: 7 }), g.push({
                  coefficient: Math.abs(s.from_node_coefficient),
                  x: be.x,
                  y: be.y,
                  data: s.data
                });
              }
              if (p.node_type === "metabolite" && Math.abs(s.to_node_coefficient) !== 1) {
                var Z = V(s.data, ce), re = u * ie(Z, !1, 0, p.node_is_primary), de = w === null ? U : w;
                de = a.c_plus_c(de, a.rotate_coords(de, 0.5, p));
                var be = v(re, de, p, "end");
                be = a.c_plus_c(be, { x: 0, y: 7 }), g.push({
                  coefficient: Math.abs(s.to_node_coefficient),
                  x: be.x,
                  y: be.y,
                  data: s.data
                });
              }
              return g;
            });
            K.enter().append("text").attr("class", "stoichiometry-label").attr("text-anchor", "middle").merge(K).attr("transform", function(s) {
              return "translate(" + s.x + "," + s.y + ")";
            }).text(function(s) {
              return s.coefficient;
            }).style("fill", function(s) {
              if (xe) {
                var g = s.data;
                return g === null ? Ce : n.reaction_color(g);
              }
              return null;
            }), K.exit().remove(), this.callback_manager.run("update_segment", this, T);
          }
          function k(T) {
            var n = T.append("g").attr("id", function(r) {
              return r.bezier_id;
            }).attr("class", function(r) {
              return "bezier";
            });
            return n.append("path").attr("class", "connect-line"), n.append("circle").attr("class", function(r) {
              return "bezier-circle " + r.bezier;
            }).style("stroke-width", String(1) + "px").attr("r", String(7) + "px"), this.callback_manager.run("create_bezier", this, T), n;
          }
          function _(T, n, r, b, C, ne, ge) {
            var ce = this.settings.get("hide_secondary_metabolites");
            if (n)
              T.attr("visibility", "visible");
            else {
              T.attr("visibility", "hidden");
              return;
            }
            T.style("visibility", function(xe) {
              var fe = ge[xe.reaction_id].segments[xe.segment_id], Ce = ne[fe.from_node_id], he = ne[fe.to_node_id];
              return ce && (he.node_type === "metabolite" && !he.node_is_primary || Ce.node_type === "metabolite" && !Ce.node_is_primary) ? "hidden" : null;
            }), T.select(".bezier-circle").call(this.behavior.turnOffDrag).call(r).on("mouseover", b).on("mouseout", C).attr("transform", function(xe) {
              return xe.x === null || xe.y === null ? "" : "translate(" + xe.x + "," + xe.y + ")";
            }), T.select(".connect-line").attr("d", function(xe) {
              var fe = ge[xe.reaction_id].segments[xe.segment_id], Ce = xe.bezier === "b1" ? ne[fe.from_node_id] : ne[fe.to_node_id];
              return xe.x === null || xe.y === null || Ce.x === null || Ce.y === null ? "" : "M" + xe.x + ", " + xe.y + " " + Ce.x + "," + Ce.y;
            }), this.callback_manager.run("update_bezier", this, T);
          }
          function Q(T, n, r) {
            var b = T.append("g").attr("class", "node").attr("id", function(ne) {
              return "n" + ne.node_id;
            });
            b.append("circle").attr("class", function(ne) {
              var ge = "node-circle";
              return ne.node_type !== null && (ge += " " + ne.node_type + "-circle"), ge;
            });
            var C = b.filter(function(ne) {
              return ne.node_type === "metabolite";
            });
            return C.append("text").attr("class", "node-label label"), this.callback_manager.run("create_node", this, T), b;
          }
          function o(T, n, r, b, C, ne, ge, ce, xe) {
            var fe = this.settings.get("hide_secondary_metabolites"), Ce = this.settings.get("primary_metabolite_radius"), he = this.settings.get("secondary_metabolite_radius"), le = this.settings.get("marker_radius"), G = this.settings.get("hide_all_labels"), P = this.settings.get("identifiers_on_map"), $ = this.settings.get("metabolite_styles"), E = {
              color: this.settings.get("metabolite_no_data_color"),
              size: this.settings.get("metabolite_no_data_size")
            }, V = this.behavior.nodeLabelMouseover, ie = this.behavior.nodeLabelMouseout, ae = this.behavior.nodeLabelTouch, K = this.behavior.nodeObjectMouseover, s = this.behavior.nodeObjectMouseout;
            T.select(".node-circle").attr("transform", function(Y) {
              return "translate(" + Y.x + "," + Y.y + ")";
            }).style("visibility", function(Y) {
              return U(Y, fe) ? "hidden" : null;
            }).attr("r", function(Y) {
              if (Y.node_type === "metabolite") {
                var p = r && $.indexOf("size") !== -1;
                if (p) {
                  var w = Y.data;
                  return w === null ? E.size : n.metabolite_size(w);
                } else
                  return Y.node_is_primary ? Ce : he;
              }
              return le;
            }).style("fill", function(Y) {
              if (Y.node_type === "metabolite") {
                var p = r && $.indexOf("color") !== -1;
                if (p) {
                  var w = Y.data;
                  return w === null ? E.color : n.metabolite_color(w);
                } else
                  return null;
              }
              return null;
            }).call(this.behavior.turnOffDrag).call(ce).on("mousedown", b).on("click", C).on("mouseover", K).on("mouseout", s);
            var g = T.select(".node-label").attr("visibility", G ? "hidden" : "visible");
            G || g.style("visibility", function(Y) {
              return U(Y, fe) ? "hidden" : null;
            }).attr("transform", function(Y) {
              return "translate(" + Y.label_x + "," + Y.label_y + ")";
            }).text(function(Y) {
              var p = Y[P];
              return r && $.indexOf("text") !== -1 && (p += " " + Y.data_string), p;
            }).call(this.behavior.turnOffDrag).call(xe).on("mouseover", V).on("mouseout", ie).on("touchend", ae), this.callback_manager.run("update_node", this, T);
            function U(Y, p) {
              return Y.node_type === "metabolite" && p && !Y.node_is_primary;
            }
          }
          function W(T) {
            var n = T.append("g").attr("id", function(r) {
              return "l" + r.text_label_id;
            }).attr("class", "text-label");
            return n.append("text").attr("class", "label"), this.callback_manager.run("create_text_label", this, T), n;
          }
          function y(T) {
            var n = this.behavior.textLabelMousedown, r = this.behavior.textLabelClick, b = this.behavior.turnOffDrag, C = this.behavior.selectableDrag;
            T.select(".label").text(function(ne) {
              return ne.text;
            }).attr("transform", function(ne) {
              return "translate(" + ne.x + "," + ne.y + ")";
            }).on("mousedown", n).on("click", r).call(b).call(C), this.callback_manager.run("update_text_label", this, T);
          }
          function v(T, n, r, b) {
            var C = T, ne = a.distance(n, r);
            if (!C || !ne)
              return console.warn("No space for displacement"), { x: n.x, y: n.y };
            if (b === "start")
              return {
                x: n.x + C * (r.x - n.x) / ne,
                y: n.y + C * (r.y - n.y) / ne
              };
            if (b === "end")
              return {
                x: r.x - C * (r.x - n.x) / ne,
                y: r.y - C * (r.y - n.y) / ne
              };
            console.error("bad displace value: " + b);
          }
        },
        /* 44 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(30), X = ee(a), q = d(90);
          function ee(F) {
            return F && F.__esModule ? F : { default: F };
          }
          function j(F, M) {
            if (!(F instanceof M))
              throw new TypeError("Cannot call a class as a function");
          }
          var t = function() {
            function F() {
              j(this, F), this.x = (0, q.scaleLinear)(), this.y = (0, q.scaleLinear)(), this.x_size = (0, q.scaleLinear)(), this.y_size = (0, q.scaleLinear)(), this.size = (0, q.scaleLinear)(), this.reaction_color = (0, q.scaleLinear)().clamp(!0), this.reaction_size = (0, q.scaleLinear)().clamp(!0), this.metabolite_color = (0, q.scaleLinear)().clamp(!0), this.metabolite_size = (0, q.scaleLinear)().clamp(!0);
            }
            return F.prototype.connectToSettings = function(h, x, m) {
              var D = this, H = ["reaction", "metabolite"];
              H.forEach(function(B) {
                var k = B + "_scale", _ = B + "_scale_preset", Q = h.get(_), o = h.get(k);
                Q && o && o !== X.default[Q] ? (console.warn("Both " + k + " and " + _ + " are defined. Ignoring " + _ + ". Set " + _ + ' to "false" to hide this warning.'), h.set(_, null)) : Q ? h.set(k, X.default[Q]) : o || console.error("Must provide a " + k + " or " + _), h.get(k) && h.get(k).length < 2 ? console.error("Bad value for option " + k + ". Scales must have at least 2 points.") : D.setScale(B, k, m), h.streams[k].onValue(function(W) {
                  W && W !== X.default[h.get(_)] && h.set(_, null), D.setScale(B, W, m);
                }), h.streams[_].onValue(function(W) {
                  W && h.set(k, X.default[W]);
                }), x.callback_manager.set("calc_data_stats__" + B, function(W) {
                  W && D.setScale(B, h.get(B + "_scale"), m);
                });
              });
            }, F.prototype.sortScale = function(h, x) {
              var m = h.map(function(D) {
                var H = void 0;
                if (D.type in x)
                  H = x[D.type];
                else if (D.type === "value")
                  H = D.value;
                else
                  throw new Error("Bad domain type " + D.type);
                return { v: H, color: D.color, size: D.size };
              }).sort(function(D, H) {
                return D.v - H.v;
              });
              return {
                domain: m.map(function(D) {
                  return D.v;
                }),
                color_range: m.map(function(D) {
                  return D.color;
                }),
                size_range: m.map(function(D) {
                  return D.size;
                })
              };
            }, F.prototype.setScale = function(h, x, m) {
              h === "reaction" ? this.setReactionScale(x, m) : this.setMetaboliteScale(x, m);
            }, F.prototype.setReactionScale = function(h, x) {
              var m = x().reaction;
              if (m !== null) {
                var D = this.sortScale(h, m);
                this.reaction_color.domain(D.domain), this.reaction_size.domain(D.domain), this.reaction_color.range(D.color_range), this.reaction_size.range(D.size_range);
              }
            }, F.prototype.setMetaboliteScale = function(h, x) {
              var m = x().metabolite;
              if (m !== null) {
                var D = this.sortScale(h, m);
                this.metabolite_color.domain(D.domain), this.metabolite_size.domain(D.domain), this.metabolite_color.range(D.color_range), this.metabolite_size.range(D.size_range);
              }
            }, F;
          }();
          O.default = t;
        },
        /* 45 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(3), X = x(a), q = d(13), ee = h(q), j = d(7), t = d(0), F = d(4), M = h(F);
          function h(H) {
            return H && H.__esModule ? H : { default: H };
          }
          function x(H) {
            if (H && H.__esModule)
              return H;
            var B = {};
            if (H != null)
              for (var k in H)
                Object.prototype.hasOwnProperty.call(H, k) && (B[k] = H[k]);
            return B.default = H, B;
          }
          function m(H, B) {
            if (!(H instanceof B))
              throw new TypeError("Cannot call a class as a function");
          }
          var D = function() {
            function H(B, k) {
              m(this, H), this.selection = B, this.x = k.x, this.y = k.y, this.width = k.width, this.height = k.height, this.resizeEnabled = !0, this.callbackManager = new ee.default(), this.setup();
            }
            return H.prototype.toggleResize = function(k) {
              M.default.isUndefined(k) && (k = !this.resizeEnabled), k ? this.selection.selectAll(".drag-rect").style("pointer-events", "auto") : this.selection.selectAll(".drag-rect").style("pointer-events", "none");
            }, H.prototype.setup = function() {
              var k = this, _ = 100, Q = 10, o = this.selection.append("g").classed("canvas-group", !0).data([{ x: this.x, y: this.y }]), W = function() {
                t.event.sourceEvent.stopPropagation();
              }, y = function(Ce, he, le) {
                var G = X.d3_transform_catch(le), P = G.translate;
                return Ce !== null && (P[0] = Ce), he !== null && (P[1] = he), "translate(" + P + ")";
              }, v = o.append("rect").attr("id", "mouse-node").attr("width", this.width * Q).attr("height", this.height * Q).attr("transform", "translate(" + [this.x - this.width * Q / 2, this.y - this.height * Q / 2] + ")").attr("pointer-events", "all");
              this.mouseNode = v;
              var T = o.append("rect").attr("id", "canvas").attr("width", this.width).attr("height", this.height).attr("transform", "translate(" + [this.x, this.y] + ")"), n = (0, j.drag)().on("start", W).on("drag", function(fe) {
                var Ce = fe.x;
                fe.x = Math.min(fe.x + k.width - _ / 2, t.event.x), k.x = fe.x, k.width = k.width + (Ce - fe.x), r.attr("transform", function(he) {
                  return y(he.x - _ / 2, null, r.attr("transform"));
                }), v.attr("transform", function(he) {
                  return y(he.x, null, v.attr("transform"));
                }).attr("width", k.width * Q), T.attr("transform", function(he) {
                  return y(he.x, null, T.attr("transform"));
                }).attr("width", k.width), ge.attr("transform", function(he) {
                  return y(he.x + _ / 2, null, ge.attr("transform"));
                }).attr("width", k.width - _), xe.attr("transform", function(he) {
                  return y(he.x + _ / 2, null, xe.attr("transform"));
                }).attr("width", k.width - _), k.callbackManager.run("resize");
              }), r = o.append("rect").classed("drag-rect", !0).attr("transform", function(fe) {
                return "translate(" + [fe.x - _ / 2, fe.y + _ / 2] + ")";
              }).attr("height", this.height - _).attr("id", "dragleft").attr("width", _).attr("cursor", "ew-resize").classed("resize-rect", !0).call(n), b = (0, j.drag)().on("start", W).on("drag", function(fe) {
                t.event.sourceEvent.stopPropagation();
                var Ce = Math.max(fe.x + _ / 2, fe.x + k.width + t.event.dx);
                k.width = Ce - fe.x, C.attr("transform", function(he) {
                  return y(Ce - _ / 2, null, C.attr("transform"));
                }), v.attr("width", k.width * Q), T.attr("width", k.width), ge.attr("width", k.width - _), xe.attr("width", k.width - _), k.callbackManager.run("resize");
              }), C = o.append("rect").classed("drag-rect", !0).attr("transform", function(fe) {
                return "translate(" + [fe.x + k.width - _ / 2, fe.y + _ / 2] + ")";
              }).attr("id", "dragright").attr("height", this.height - _).attr("width", _).attr("cursor", "ew-resize").classed("resize-rect", !0).call(b), ne = (0, j.drag)().on("start", W).on("drag", function(fe) {
                t.event.sourceEvent.stopPropagation();
                var Ce = fe.y;
                fe.y = Math.min(fe.y + k.height - _ / 2, t.event.y), k.y = fe.y, k.height = k.height + (Ce - fe.y), ge.attr("transform", function(he) {
                  return y(null, he.y - _ / 2, ge.attr("transform"));
                }), v.attr("transform", function(he) {
                  return y(null, he.y, v.attr("transform"));
                }).attr("width", k.height * Q), T.attr("transform", function(he) {
                  return y(null, he.y, T.attr("transform"));
                }).attr("height", k.height), r.attr("transform", function(he) {
                  return y(null, he.y + _ / 2, r.attr("transform"));
                }).attr("height", k.height - _), C.attr("transform", function(he) {
                  return y(null, he.y + _ / 2, C.attr("transform"));
                }).attr("height", k.height - _), k.callbackManager.run("resize");
              }), ge = o.append("rect").classed("drag-rect", !0).attr("transform", function(fe) {
                return "translate(" + [fe.x + _ / 2, fe.y - _ / 2] + ")";
              }).attr("height", _).attr("width", this.width - _).attr("cursor", "ns-resize").classed("resize-rect", !0).call(ne), ce = (0, j.drag)().on("start", W).on("drag", function(fe) {
                t.event.sourceEvent.stopPropagation();
                var Ce = Math.max(fe.y + _ / 2, fe.y + k.height + t.event.dy);
                k.height = Ce - fe.y, xe.attr("transform", function(he) {
                  return y(null, Ce - _ / 2, xe.attr("transform"));
                }), v.attr("height", k.height * Q), T.attr("height", k.height), r.attr("height", k.height - _), C.attr("height", k.height - _), k.callbackManager.run("resize");
              }), xe = o.append("rect").classed("drag-rect", !0).attr("transform", function(fe) {
                return "translate(" + [fe.x + _ / 2, fe.y + k.height - _ / 2] + ")";
              }).attr("height", _).attr("width", this.width - _).attr("cursor", "ns-resize").classed("resize-rect", !0).call(ce);
            }, H.prototype.sizeAndLocation = function() {
              return {
                x: this.x,
                y: this.y,
                width: this.width,
                height: this.height
              };
            }, H;
          }();
          O.default = D;
        },
        /* 46 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(92), X = d(0);
          function q(j, t) {
            if (!(j instanceof t))
              throw new TypeError("Cannot call a class as a function");
          }
          var ee = function() {
            function j(t, F, M, h) {
              q(this, j), this.brushSel = t.append("g").attr("id", "brush-container");
              var x = this.brushSel.node(), m = t.select(h).node().nextSibling;
              x !== m && x.parentNode.insertBefore(x, m), this.enabled = F, this.map = M;
            }
            return j.prototype.brushIsEnabled = function() {
              return this.map.sel.select(".brush").empty();
            }, j.prototype.toggle = function(F) {
              F === void 0 && (F = !this.enabled), F ? this.setupSelectionBrush() : this.brushSel.selectAll("*").remove();
            }, j.prototype.turnOffCrosshair = function(F) {
              F.selectAll("rect").attr("cursor", null);
            }, j.prototype.setupSelectionBrush = function() {
              var F = this, M = this.map, h = this.brushSel, x = M.sel.selectAll("#nodes,#text-labels"), m = M.canvas.sizeAndLocation(), D = m.width, H = m.height, B = m.x, k = m.y, _ = this.turnOffCrosshair.bind(this);
              h.selectAll("*").remove();
              var Q = !1, o = (0, a.brush)().extent([[B, k], [B + D, k + H]]).on("start", function() {
                F.turnOffCrosshair(h), M.settings.get("hide_secondary_metabolites") && (M.settings.set("hide_secondary_metabolites", !1), M.draw_everything(), M.set_status("Showing secondary metabolites. You can hide them again in Settings.", 2e3));
              }).on("brush", function() {
                var W = X.event.sourceEvent.shiftKey, y = (0, a.brushSelection)(this);
                if (y !== null) {
                  var v = W ? x.selectAll(".node:not(.selected),.text-label:not(.selected)") : x.selectAll(".node,.text-label");
                  v.classed("selected", function(T) {
                    var n = T.x, r = T.y;
                    return y[0][0] <= n && n < y[1][0] && y[0][1] <= r && r < y[1][1];
                  });
                }
              }).on("end", function() {
                _(h);
                var W = (0, a.brushSelection)(this);
                W === null ? Q ? Q = !1 : M.select_none() : (Q = !0, h.call(o.move, null));
              });
              h.call(o), _(h);
            }, j;
          }();
          O.default = ee;
        },
        /* 47 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(17), X = q(a);
          function q(t) {
            return t && t.__esModule ? t : { default: t };
          }
          function ee(t, F) {
            if (!(t instanceof F))
              throw new TypeError("Cannot call a class as a function");
          }
          var j = function() {
            function t(F, M, h) {
              ee(this, t);
              var x = F.append("div").attr("id", "text-edit-input");
              this.placedDiv = (0, X.default)(x, M), this.placedDiv.hide(), this.input = x.append("input"), this.map = M, this.setUpMapCallbacks(M), this.zoomContainer = h, this.setUpZoomCallbacks(h), this.isNew = !1;
            }
            return t.prototype.setUpMapCallbacks = function(M) {
              var h = this;
              M.callback_manager.set("edit_text_label.text_edit_input", function(x, m) {
                h.show(x, m);
              }), M.callback_manager.set("new_text_label.text_edit_input", function(x) {
                h.activeTarget !== null && h._acceptChanges(h.activeTarget.target), h.hide(), h._addAndEdit(x);
              }), M.callback_manager.set("hide_text_label_editor.text_edit_input", function() {
                h.hide();
              });
            }, t.prototype.setUpZoomCallbacks = function(M) {
              var h = this;
              M.callbackManager.set("zoom.text_edit_input", function() {
                h.activeTarget && h._acceptChanges(h.activeTarget.target), h.is_visible() && h.hide();
              }), M.callbackManager.set("go_to.text_edit_input", function() {
                h.activeTarget && h._acceptChanges(h.activeTarget.target), h.is_visible() && h.hide();
              });
            }, t.prototype.is_visible = function() {
              return this.placedDiv.is_visible();
            }, t.prototype.show = function(M, h) {
              var x = this;
              this.activeTarget && this._acceptChanges(this.activeTarget.target), this.activeTarget = {
                target: M,
                coords: h
                // set the new value
              }, M.each(function(m) {
                x.input.node().value = m.text;
              }), this.placedDiv.place(h), this.input.node().focus(), this.clearEscape = this.map.key_manager.addEscapeListener(function() {
                x._acceptChanges(M), x.hide();
              }, !0), this.clearEnter = this.map.key_manager.addEnterListener(function() {
                x._acceptChanges(M), x.hide();
              }, !0);
            }, t.prototype.hide = function() {
              this.isNew = !1, this.placedDiv.hide(), this.input.attr("value", ""), this.activeTarget = null, this.clearEscape && this.clearEscape(), this.clearEscape = null, this.clearEnter && this.clearEnter(), this.clearEnter = null;
            }, t.prototype._acceptChanges = function(M) {
              var h = this, x = this.input.node().value;
              if (x === "")
                M.each(function(D) {
                  var H = {};
                  H[D.text_label_id] = h.map.text_labels[D.text_label_id], h.map.delete_selectable({}, H, !0);
                });
              else {
                var m = [];
                M.each(function(D) {
                  h.map.edit_text_label(D.text_label_id, x, !0, h.isNew), m.push(D.text_label_id);
                });
              }
            }, t.prototype._addAndEdit = function(M) {
              this.isNew = !0;
              var h = this.map.new_text_label(M, ""), x = this.map.sel.select("#text-labels").selectAll(".text-label").filter(function(m) {
                return m.text_label_id === h;
              });
              x.select("text").classed("edit-text-cursor", !0), this.show(x, M);
            }, t;
          }();
          O.default = j;
        },
        /* 48 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5), X = d(49), q = D(X), ee = d(50), j = D(ee), t = d(59), F = D(t), M = d(4), h = D(M);
          d(60);
          var x = d(30), m = D(x);
          function D(Q) {
            return Q && Q.__esModule ? Q : { default: Q };
          }
          function H(Q, o) {
            if (!(Q instanceof o))
              throw new TypeError("Cannot call a class as a function");
          }
          function B(Q, o) {
            if (!Q)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return o && (typeof o == "object" || typeof o == "function") ? o : Q;
          }
          function k(Q, o) {
            if (typeof o != "function" && o !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof o);
            Q.prototype = Object.create(o && o.prototype, { constructor: { value: Q, enumerable: !1, writable: !0, configurable: !0 } }), o && (Object.setPrototypeOf ? Object.setPrototypeOf(Q, o) : Q.__proto__ = o);
          }
          var _ = function(Q) {
            k(o, Q);
            function o() {
              return H(this, o), B(this, Q.apply(this, arguments));
            }
            return o.prototype.componentWillMount = function() {
              var y = this;
              this.props.settings.holdChanges(), this.setState({
                clearEscape: this.props.map.key_manager.addEscapeListener(function() {
                  return y.abandonChanges();
                }, !0),
                clearEnter: this.props.map.key_manager.addKeyListener(["enter"], function() {
                  return y.saveChanges();
                }, !0)
              });
            }, o.prototype.componentWillUnmount = function() {
              this.state.clearEscape(), this.state.clearEnter();
            }, o.prototype.abandonChanges = function() {
              this.props.settings.abandonChanges(), this.props.setDisplay(!1);
            }, o.prototype.saveChanges = function() {
              this.props.settings.acceptChanges(), this.props.setDisplay(!1);
            }, o.prototype.handleStyle = function(y, v) {
              var T = this.props.settings.get(v), n = T.indexOf(y);
              n === -1 ? this.props.settings.set(v, [].concat(T, [y])) : this.props.settings.set(v, [].concat(T.slice(0, n), T.slice(n + 1)));
            }, o.prototype.render = function() {
              var y = this, v = this.props.settings, T = v.get("enable_tooltips") || [], n = this.props.map.get_data_statistics();
              return (0, a.h)(
                "div",
                { className: "settingsBackground" },
                (0, a.h)(
                  "div",
                  { className: "settingsBoxContainer" },
                  (0, a.h)(
                    "button",
                    { className: "discardChanges btn", onClick: function() {
                      return y.abandonChanges();
                    } },
                    (0, a.h)("i", { className: "icon-cancel", "aria-hidden": "true" })
                  ),
                  (0, a.h)(
                    "button",
                    { className: "saveChanges btn", onClick: function() {
                      return y.saveChanges();
                    } },
                    (0, a.h)("i", { className: "icon-ok", "aria-hidden": "true" })
                  ),
                  (0, a.h)(
                    "div",
                    { className: "settingsBox" },
                    (0, a.h)(
                      "div",
                      { className: "settingsTip" },
                      (0, a.h)(
                        "i",
                        null,
                        "Tip: Hover over an option to see more details about it."
                      )
                    ),
                    (0, a.h)("hr", null),
                    (0, a.h)(
                      "div",
                      { className: "title" },
                      "View and build options"
                    ),
                    (0, a.h)(
                      "div",
                      { className: "settingsContainer" },
                      (0, a.h)(
                        "table",
                        { className: "radioSelection" },
                        (0, a.h)(
                          "tr",
                          { title: "The identifiers that are show in the reaction, gene, and metabolite labels on the map." },
                          (0, a.h)(
                            "td",
                            { className: "optionLabel" },
                            "Identifiers:"
                          ),
                          (0, a.h)(
                            "td",
                            { className: "singleLine" },
                            (0, a.h)(
                              "label",
                              { className: "optionGroup" },
                              (0, a.h)("input", {
                                type: "radio",
                                name: "identifiers",
                                onClick: function() {
                                  v.set("identifiers_on_map", "bigg_id");
                                },
                                checked: v.get("identifiers_on_map") === "bigg_id"
                              }),
                              "ID's"
                            ),
                            (0, a.h)(
                              "label",
                              { className: "optionGroup" },
                              (0, a.h)("input", {
                                type: "radio",
                                name: "identifiers",
                                onClick: function() {
                                  v.set("identifiers_on_map", "name");
                                },
                                checked: v.get("identifiers_on_map") === "name"
                              }),
                              "Descriptive names"
                            )
                          )
                        )
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If checked, then the scroll wheel and trackpad will control zoom rather than pan." },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            v.get("scroll_behavior") === "zoom" ? v.set("scroll_behavior", "pan") : v.set("scroll_behavior", "zoom");
                          },
                          checked: v.get("scroll_behavior") === "zoom"
                        }),
                        "Scroll to zoom (instead of scroll to pan)"
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If checked, then only the primary metabolites will be displayed." },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            return v.set("hide_secondary_metabolites", !v.get("hide_secondary_metabolites"));
                          },
                          checked: v.get("hide_secondary_metabolites")
                        }),
                        "Hide secondary metabolites"
                      ),
                      (0, a.h)(
                        "label",
                        {
                          title: "If checked, then gene reaction rules will be displayed below each reaction label. (Gene reaction rules are always shown when gene data is loaded.)"
                        },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            return v.set("show_gene_reaction_rules", !v.get("show_gene_reaction_rules"));
                          },
                          checked: v.get("show_gene_reaction_rules")
                        }),
                        "Show gene reaction rules"
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If checked, hide all reaction, gene, and metabolite labels" },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            return v.set("hide_all_labels", !v.get("hide_all_labels"));
                          },
                          checked: v.get("hide_all_labels")
                        }),
                        "Hide reaction, gene, and metabolite labels"
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If checked, then allow duplicate reactions during model building." },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            return v.set("allow_building_duplicate_reactions", !v.get("allow_building_duplicate_reactions"));
                          },
                          checked: v.get("allow_building_duplicate_reactions")
                        }),
                        "Allow duplicate reactions"
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If checked, then highlight in red all the reactions on the map that are not present in the loaded model." },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            v.set("highlight_missing", !v.get("highlight_missing"));
                          },
                          checked: v.get("highlight_missing")
                        }),
                        "Highlight reactions not in model"
                      ),
                      (0, a.h)(
                        "label",
                        { title: "If true, then use CSS3 3D transforms to speed up panning and zooming." },
                        (0, a.h)("input", {
                          type: "checkbox",
                          onClick: function() {
                            v.set("use_3d_transform", !v.get("use_3d_transform"));
                          },
                          checked: v.get("use_3d_transform")
                        }),
                        "Use 3D transform for responsive panning and zooming"
                      ),
                      (0, a.h)(
                        "table",
                        { style: { marginTop: "5px" } },
                        (0, a.h)(
                          "tr",
                          { title: "Determines over which elements tooltips will display for reactions, metabolites, and genes" },
                          (0, a.h)(
                            "td",
                            null,
                            "Show tooltips over:"
                          ),
                          (0, a.h)(
                            "td",
                            { className: "singleLine" },
                            (0, a.h)(
                              "label",
                              { className: "tooltipOption", title: "If checked, tooltips will display over the gene, reaction, and metabolite labels" },
                              (0, a.h)("input", {
                                type: "checkbox",
                                onClick: function() {
                                  var b = "label", C = h.default.contains(T, b) ? h.default.filter(T, function(ne) {
                                    return ne !== b;
                                  }) : [].concat(T, [b]);
                                  v.set("enable_tooltips", C);
                                },
                                checked: h.default.contains(T, "label")
                              }),
                              "Labels"
                            ),
                            (0, a.h)(
                              "label",
                              { className: "tooltipOption", title: "If checked, tooltips will display over the reaction line segments and metabolite circles" },
                              (0, a.h)("input", {
                                type: "checkbox",
                                onClick: function() {
                                  var b = "object", C = h.default.contains(T, b) ? h.default.filter(T, function(ne) {
                                    return ne !== b;
                                  }) : [].concat(T, [b]);
                                  v.set("enable_tooltips", C);
                                },
                                checked: h.default.contains(T, "object")
                              }),
                              "Objects"
                            )
                          )
                        )
                      )
                    ),
                    (0, a.h)(
                      "div",
                      { className: "settingsTip", style: { marginTop: "16px" } },
                      (0, a.h)(
                        "i",
                        null,
                        "Tip: To increase map performance, turn off text boxes (i.e. labels and gene reaction rules)."
                      )
                    ),
                    (0, a.h)("hr", null),
                    (0, a.h)(
                      "div",
                      { className: "scaleTitle" },
                      (0, a.h)(
                        "div",
                        { className: "title" },
                        "Reactions"
                      ),
                      (0, a.h)(
                        q.default,
                        { disabled: n.reaction === null },
                        Object.values(h.default.mapObject(m.default, function(r, b) {
                          return (0, a.h)(F.default, {
                            name: b,
                            scale: r,
                            onClick: function() {
                              v.set("reaction_scale_preset", b);
                            }
                          });
                        }))
                      )
                    ),
                    (0, a.h)(j.default, {
                      scale: v.get("reaction_scale"),
                      settings: v,
                      type: "Reaction",
                      stats: n.reaction,
                      noDataColor: v.get("reaction_no_data_color"),
                      noDataSize: v.get("reaction_no_data_size"),
                      onChange: function(b) {
                        v.set("reaction_scale", b);
                      },
                      onNoDataColorChange: function(b) {
                        v.set("reaction_no_data_color", b);
                      },
                      onNoDataSizeChange: function(b) {
                        v.set("reaction_no_data_size", b);
                      },
                      abs: v.get("reaction_styles").indexOf("abs") > -1
                    }),
                    (0, a.h)(
                      "div",
                      { className: "subheading" },
                      "Reaction or Gene data"
                    ),
                    (0, a.h)(
                      "table",
                      { className: "radioSelection" },
                      (0, a.h)(
                        "tr",
                        null,
                        (0, a.h)(
                          "td",
                          {
                            className: "optionLabel",
                            title: "Options for reactions data"
                          },
                          "Options:"
                        ),
                        (0, a.h)(
                          "td",
                          null,
                          (0, a.h)(
                            "label",
                            {
                              className: "optionGroup",
                              title: "If checked, use the absolute value when calculating colors and sizes of reactions on the map"
                            },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "reactionStyle",
                              onClick: function() {
                                return y.handleStyle("abs", "reaction_styles");
                              },
                              checked: h.default.contains(v.get("reaction_styles"), "abs"),
                              disabled: n.reaction === null
                            }),
                            "Absolute value"
                          ),
                          (0, a.h)(
                            "label",
                            {
                              className: "optionGroup",
                              title: "If checked, then size the thickness of reaction lines according to the value of the reaction data"
                            },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "reactionStyle",
                              onClick: function() {
                                return y.handleStyle("size", "reaction_styles");
                              },
                              checked: h.default.contains(v.get("reaction_styles"), "size"),
                              disabled: n.reaction === null
                            }),
                            "Size"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup", title: "If checked, then color the reaction lines according to the value of the reaction data" },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "reactionStyle",
                              onClick: function() {
                                return y.handleStyle("color", "reaction_styles");
                              },
                              checked: h.default.contains(v.get("reaction_styles"), "color"),
                              disabled: n.reaction === null
                            }),
                            "Color"
                          ),
                          (0, a.h)("br", null),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup", title: "If checked, then show data values in the reaction labels" },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "reactionStyle",
                              onClick: function() {
                                return y.handleStyle("text", "reaction_styles");
                              },
                              checked: h.default.contains(v.get("reaction_styles"), "text"),
                              disabled: n.reaction === null
                            }),
                            "Text (Show data in label)"
                          )
                        )
                      ),
                      (0, a.h)(
                        "tr",
                        { title: "The function that will be used to compare datasets, when paired data is loaded" },
                        (0, a.h)(
                          "td",
                          { className: "optionLabel" },
                          "Comparison:"
                        ),
                        (0, a.h)(
                          "td",
                          null,
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "reactionCompare",
                              onClick: function() {
                                return v.set("reaction_compare_style", "fold");
                              },
                              checked: v.get("reaction_compare_style") === "fold",
                              disabled: n.reaction === null
                            }),
                            "Fold Change"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "reactionCompare",
                              onClick: function() {
                                return v.set("reaction_compare_style", "log2_fold");
                              },
                              checked: v.get("reaction_compare_style") === "log2_fold",
                              disabled: n.reaction === null
                            }),
                            "Log2 (Fold Change)"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "reactionCompare",
                              onClick: function() {
                                return v.set("reaction_compare_style", "diff");
                              },
                              checked: v.get("reaction_compare_style") === "diff",
                              disabled: n.reaction === null
                            }),
                            "Difference"
                          )
                        )
                      )
                    ),
                    (0, a.h)(
                      "table",
                      { className: "radioSelection" },
                      (0, a.h)(
                        "tr",
                        {
                          title: "The function that will be used to evaluate AND connections in gene reaction rules (AND connections generally connect components of an enzyme complex)"
                        },
                        (0, a.h)(
                          "td",
                          { className: "optionLabelWide" },
                          "Method for evaluating AND:"
                        ),
                        (0, a.h)(
                          "td",
                          null,
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "andMethod",
                              onClick: function() {
                                return v.set("and_method_in_gene_reaction_rule", "mean");
                              },
                              checked: v.get("and_method_in_gene_reaction_rule") === "mean",
                              disabled: n.reaction === null
                            }),
                            "Mean"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "andMethod",
                              onClick: function() {
                                return v.set("and_method_in_gene_reaction_rule", "min");
                              },
                              checked: v.get("and_method_in_gene_reaction_rule") === "min",
                              disabled: n.reaction === null
                            }),
                            "Min"
                          )
                        )
                      )
                    ),
                    (0, a.h)("hr", null),
                    (0, a.h)(
                      "div",
                      { className: "scaleTitle" },
                      (0, a.h)(
                        "div",
                        { className: "title" },
                        "Metabolites"
                      ),
                      (0, a.h)(
                        q.default,
                        { disabled: n.metabolite === null },
                        Object.values(h.default.mapObject(m.default, function(r, b) {
                          return (0, a.h)(F.default, {
                            name: b,
                            scale: r,
                            onClick: function() {
                              return v.set("metabolite_scale", r);
                            }
                          });
                        }))
                      )
                    ),
                    (0, a.h)(j.default, {
                      scale: v.get("metabolite_scale"),
                      settings: v,
                      type: "Metabolite",
                      stats: n.metabolite,
                      noDataColor: v.get("metabolite_no_data_color"),
                      noDataSize: v.get("metabolite_no_data_size"),
                      onChange: function(b) {
                        v.set("metabolite_scale", b);
                      },
                      onNoDataColorChange: function(b) {
                        v.set("metabolite_no_data_color", b);
                      },
                      onNoDataSizeChange: function(b) {
                        v.set("metabolite_no_data_size", b);
                      },
                      abs: h.default.contains(v.get("metabolite_styles"), "abs")
                    }),
                    (0, a.h)(
                      "div",
                      { className: "subheading" },
                      "Metabolite data"
                    ),
                    (0, a.h)(
                      "table",
                      { className: "radioSelection" },
                      (0, a.h)(
                        "tr",
                        null,
                        (0, a.h)(
                          "td",
                          {
                            className: "optionLabel",
                            title: "Options for metabolite data"
                          },
                          "Options:"
                        ),
                        (0, a.h)(
                          "td",
                          null,
                          (0, a.h)(
                            "label",
                            {
                              className: "optionGroup",
                              title: "If checked, use the absolute value when calculating colors and sizes of metabolites on the map"
                            },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "metaboliteStyle",
                              onClick: function() {
                                return y.handleStyle("abs", "metabolite_styles");
                              },
                              checked: h.default.contains(v.get("metabolite_styles"), "abs"),
                              disabled: n.metabolite === null
                            }),
                            "Absolute value"
                          ),
                          (0, a.h)(
                            "label",
                            {
                              className: "optionGroup",
                              title: "If checked, then size the thickness of reaction lines according to the value of the metabolite data"
                            },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "metaboliteStyle",
                              onClick: function() {
                                return y.handleStyle("size", "metabolite_styles");
                              },
                              checked: h.default.contains(v.get("metabolite_styles"), "size"),
                              disabled: n.metabolite === null
                            }),
                            "Size"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup", title: "If checked, then color the reaction lines according to the value of the metabolite data" },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "metaboliteStyle",
                              onClick: function() {
                                return y.handleStyle("color", "metabolite_styles");
                              },
                              checked: h.default.contains(v.get("metabolite_styles"), "color"),
                              disabled: n.metabolite === null
                            }),
                            "Color"
                          ),
                          (0, a.h)("br", null),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup", title: "If checked, then show data values in the metabolite labels" },
                            (0, a.h)("input", {
                              type: "checkbox",
                              name: "metaboliteStyle",
                              onClick: function() {
                                return y.handleStyle("text", "metabolite_styles");
                              },
                              checked: h.default.contains(v.get("metabolite_styles"), "text"),
                              disabled: n.metabolite === null
                            }),
                            "Text (Show data in label)"
                          )
                        )
                      ),
                      (0, a.h)(
                        "tr",
                        { title: "The function that will be used to compare datasets, when paired data is loaded" },
                        (0, a.h)(
                          "td",
                          { className: "optionLabel" },
                          "Comparison:"
                        ),
                        (0, a.h)(
                          "td",
                          null,
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "metaboliteCompare",
                              onClick: function() {
                                return v.set("metabolite_compare_style", "fold");
                              },
                              checked: v.get("metabolite_compare_style") === "fold",
                              disabled: n.metabolite === null
                            }),
                            "Fold Change"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "metaboliteCompare",
                              onClick: function() {
                                return v.set("metabolite_compare_style", "log2_fold");
                              },
                              checked: v.get("metabolite_compare_style") === "log2_fold",
                              disabled: n.metabolite === null
                            }),
                            "Log2 (Fold Change)"
                          ),
                          (0, a.h)(
                            "label",
                            { className: "optionGroup" },
                            (0, a.h)("input", {
                              type: "radio",
                              name: "metaboliteCompare",
                              onClick: function() {
                                return v.set("metabolite_compare_style", "diff");
                              },
                              checked: v.get("metabolite_compare_style") === "diff",
                              disabled: n.metabolite === null
                            }),
                            "Difference"
                          )
                        )
                      )
                    )
                  )
                )
              );
            }, o;
          }(a.Component);
          O.default = _;
        },
        /* 49 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          function X(t, F) {
            if (!(t instanceof F))
              throw new TypeError("Cannot call a class as a function");
          }
          function q(t, F) {
            if (!t)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return F && (typeof F == "object" || typeof F == "function") ? F : t;
          }
          function ee(t, F) {
            if (typeof F != "function" && F !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof F);
            t.prototype = Object.create(F && F.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), F && (Object.setPrototypeOf ? Object.setPrototypeOf(t, F) : t.__proto__ = F);
          }
          var j = function(t) {
            ee(F, t);
            function F(M) {
              X(this, F);
              var h = q(this, t.call(this, M));
              return h.setWrapperRef = h.setWrapperRef.bind(h), h.handleClickOutside = h.handleClickOutside.bind(h), h.state = {
                visible: !1
              }, h;
            }
            return F.prototype.componentDidMount = function() {
              document.addEventListener("mouseup", this.handleClickOutside);
            }, F.prototype.setWrapperRef = function(h) {
              this.wrapperRef = h;
            }, F.prototype.handleClickOutside = function(h) {
              this.wrapperRef && !this.wrapperRef.contains(h.target) && this.setState({ visible: !1 });
            }, F.prototype.render = function() {
              var h = this;
              return (0, a.h)(
                "div",
                { className: "selector" },
                (0, a.h)(
                  "div",
                  {
                    className: ["selectorTitle", this.props.disabled ? "disabled" : ""].join(" "),
                    ref: this.setWrapperRef,
                    onClick: function() {
                      h.props.disabled || h.setState({ visible: !h.state.visible });
                    }
                  },
                  "Preset Scale Selections",
                  (0, a.h)("i", { className: "icon-sort-down" })
                ),
                (0, a.h)(
                  "div",
                  {
                    className: "selectorMenu",
                    style: this.state.visible ? { display: "block" } : { display: "none" }
                  },
                  this.props.children.map(function(x) {
                    return x;
                  })
                )
              );
            }, F;
          }(a.Component);
          O.default = j;
        },
        /* 50 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5), X = d(51), q = M(X), ee = d(55), j = M(ee), t = d(4), F = M(t);
          d(57);
          function M(B) {
            return B && B.__esModule ? B : { default: B };
          }
          function h(B, k) {
            if (!(B instanceof k))
              throw new TypeError("Cannot call a class as a function");
          }
          function x(B, k) {
            if (!B)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return k && (typeof k == "object" || typeof k == "function") ? k : B;
          }
          function m(B, k) {
            if (typeof k != "function" && k !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof k);
            B.prototype = Object.create(k && k.prototype, { constructor: { value: B, enumerable: !1, writable: !0, configurable: !0 } }), k && (Object.setPrototypeOf ? Object.setPrototypeOf(B, k) : B.__proto__ = k);
          }
          var D = 400, H = function(B) {
            m(k, B);
            function k() {
              return h(this, k), x(this, B.apply(this, arguments));
            }
            return k.prototype.sortScale = function() {
              var Q = this, o = F.default.sortBy(this.props.scale, function(W) {
                return W.type === "value" ? W.value : Q.props.stats[W.type];
              });
              return o;
            }, k.prototype.placePickers = function() {
              var Q = this.props.stats, o = this.props.scale.reduce(function(T, n) {
                var r = T[0], b = T[1];
                return n.type === "value" ? [Math.min(n.value, r), Math.max(n.value, b)] : [r, b];
              }, [Q.min, Q.max]), W = o[0], y = o[1], v = this.props.scale.map(function(T) {
                var n = T.type === "value" ? T.value : Q[T.type];
                return (n - W) / (y - W);
              });
              return { pickerLocations: v, absoluteMax: y, absoluteMin: W };
            }, k.prototype.scaleChange = function(Q, o, W) {
              var y = null;
              if (o === "type" && W !== "value") {
                var v, T;
                y = (0, j.default)(this.props.scale, (T = {}, T[Q] = (v = {}, v[o] = { $set: W }, v.$unset = ["value"], v), T)), this.props.onChange(y);
              } else if (o === "value" && this.props.scale[Q].type !== "value") {
                var n, r;
                y = (0, j.default)(this.props.scale, (r = {}, r[Q] = (n = {}, n[o] = { $set: W }, n.type = { $set: "value" }, n), r)), this.props.onChange(y);
              } else if (W === "value") {
                var b, C;
                y = (0, j.default)(this.props.scale, (C = {}, C[Q] = (b = {}, b[o] = { $set: W }, b.$merge = { value: this.props.stats[this.props.scale[Q].type] }, b), C)), this.props.onChange(y);
              } else if (!isNaN(parseFloat(W)) || W[0] === "#" && o === "color") {
                var ne, ge;
                y = (0, j.default)(this.props.scale, (ge = {}, ge[Q] = (ne = {}, ne[o] = { $set: W }, ne), ge)), this.props.onChange(y);
              }
            }, k.prototype.addColorStop = function(Q) {
              var o = (0, j.default)(this.props.scale, {
                $push: [{
                  type: "value",
                  value: Q.layerX / Q.target.clientWidth * this.props.stats.max + (1 - Q.layerX / Q.target.clientWidth) * this.props.stats.min,
                  color: "#9696ff",
                  size: 20
                }]
              });
              this.props.onChange(o);
            }, k.prototype.makeGradient = function(Q, o) {
              var W = this, y = this.sortScale(), v = y.length < 2 ? [{ type: "min", color: "#f1ecfa" }, { type: "max", color: "#f1ecfa" }] : y;
              return v.map(function(T) {
                var n = T.type === "value" ? T.value : W.props.stats[T.type];
                return " " + T.color + " " + (n - Q) / (o - Q) * 100 + "%";
              }).toString();
            }, k.prototype.removeColorStop = function(Q) {
              var o = (0, j.default)(this.props.scale, { $splice: [[[Q], 1]] });
              this.props.onChange(o);
            }, k.prototype.render = function() {
              var Q = this;
              if (!this.props.stats)
                return (0, a.h)(
                  "div",
                  { className: "scaleEditor" },
                  (0, a.h)(
                    "div",
                    null,
                    (0, a.h)(
                      "div",
                      {
                        className: "scaleTrack disabled",
                        style: { width: D }
                      },
                      this.props.type,
                      " data not loaded",
                      (0, a.h)(q.default, { location: 0, trackWidth: D, disabled: !0 }),
                      (0, a.h)(q.default, { location: 1, trackWidth: D, disabled: !0 })
                    )
                  ),
                  (0, a.h)(
                    "div",
                    { className: "scaleLabels" },
                    (0, a.h)(
                      "label",
                      null,
                      "Value:"
                    ),
                    (0, a.h)(
                      "label",
                      null,
                      "Color:"
                    ),
                    (0, a.h)(
                      "label",
                      null,
                      "Size:"
                    )
                  ),
                  (0, a.h)(
                    "div",
                    { className: "noDataStyle" },
                    (0, a.h)(
                      "label",
                      { className: "styleHeader" },
                      "Styles for reactions with no data"
                    ),
                    (0, a.h)("br", null),
                    (0, a.h)(
                      "label",
                      null,
                      "Color:"
                    ),
                    (0, a.h)("input", { type: "text", className: "colorInput", disabled: !0 }),
                    (0, a.h)("input", { type: "color", className: "colorWheel", disabled: !0 }),
                    (0, a.h)(
                      "label",
                      null,
                      "Size:"
                    ),
                    (0, a.h)("input", { type: "text", className: "sizeInput", disabled: !0 })
                  )
                );
              var o = this.placePickers(), W = o.pickerLocations, y = o.absoluteMax, v = o.absoluteMin, T = this.props.scale.map(function(n, r) {
                if (n.type !== "value")
                  return (0, a.h)(q.default, {
                    trackWidth: D,
                    type: n.type,
                    location: W[r],
                    onChange: function(C, ne) {
                      return Q.scaleChange(r, C, ne);
                    },
                    focus: function() {
                      return Q.setState({ focusedPicker: r });
                    },
                    remove: function() {
                      return Q.removeColorStop(r);
                    },
                    min: v,
                    max: y,
                    value: Q.props.stats[n.type],
                    color: n.color,
                    size: n.size,
                    zIndex: Q.state.focusedPicker === r ? "2" : "0",
                    showTrash: Q.props.scale.length >= 3
                  });
                if (n.value != null)
                  return (0, a.h)(q.default, {
                    trackWidth: D,
                    type: n.type,
                    location: W[r],
                    onChange: function(C, ne) {
                      return Q.scaleChange(r, C, ne);
                    },
                    focus: function() {
                      return Q.setState({ focusedPicker: r });
                    },
                    remove: function() {
                      return Q.removeColorStop(r);
                    },
                    min: v,
                    max: y,
                    value: n.value,
                    color: n.color,
                    size: n.size,
                    zIndex: Q.state.focusedPicker === r ? "2" : "0",
                    showTrash: Q.props.scale.length >= 3
                  });
              });
              return (0, a.h)(
                "div",
                { className: "scaleEditor" },
                (0, a.h)(
                  "div",
                  null,
                  (0, a.h)(
                    "i",
                    { className: "settingsTip" },
                    "To add a color stop to the scale, click the gradient"
                  ),
                  (0, a.h)(
                    "div",
                    {
                      className: "scaleTrack",
                      style: { width: D }
                    },
                    (0, a.h)("div", {
                      className: "gradient",
                      onClick: function(r) {
                        return Q.addColorStop(r);
                      },
                      style: {
                        background: "linear-gradient(to right," + this.makeGradient(v, y) + ")"
                      }
                    }),
                    T
                  )
                ),
                (0, a.h)(
                  "div",
                  { className: "scaleLabels" },
                  (0, a.h)(
                    "label",
                    null,
                    "Value:"
                  ),
                  (0, a.h)(
                    "label",
                    null,
                    "Color:"
                  ),
                  (0, a.h)(
                    "label",
                    null,
                    "Size:"
                  )
                ),
                (0, a.h)(
                  "div",
                  { className: "noDataStyle" },
                  (0, a.h)(
                    "label",
                    { className: "styleHeader" },
                    "Styles for reactions with no data"
                  ),
                  (0, a.h)("br", null),
                  (0, a.h)(
                    "label",
                    null,
                    "Color:"
                  ),
                  (0, a.h)("input", {
                    type: "text",
                    className: "colorInput",
                    value: this.props.noDataColor,
                    onInput: function(r) {
                      return Q.props.onNoDataColorChange(r.target.value);
                    }
                  }),
                  (0, a.h)("input", {
                    type: "color",
                    className: "colorWheel",
                    value: this.props.noDataColor,
                    onInput: function(r) {
                      return Q.props.onNoDataColorChange(r.target.value);
                    }
                  }),
                  (0, a.h)(
                    "label",
                    null,
                    "Size:"
                  ),
                  (0, a.h)("input", {
                    type: "text",
                    className: "sizeInput",
                    value: this.props.noDataSize,
                    onInput: function(r) {
                      return Q.props.onNoDataSizeChange(parseFloat(r.target.value));
                    }
                  })
                )
              );
            }, k;
          }(a.Component);
          O.default = H;
        },
        /* 51 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5), X = d(0), q = d(7);
          d(52);
          function ee(M, h) {
            if (!(M instanceof h))
              throw new TypeError("Cannot call a class as a function");
          }
          function j(M, h) {
            if (!M)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return h && (typeof h == "object" || typeof h == "function") ? h : M;
          }
          function t(M, h) {
            if (typeof h != "function" && h !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof h);
            M.prototype = Object.create(h && h.prototype, { constructor: { value: M, enumerable: !1, writable: !0, configurable: !0 } }), h && (Object.setPrototypeOf ? Object.setPrototypeOf(M, h) : M.__proto__ = h);
          }
          var F = function(M) {
            t(h, M);
            function h() {
              return ee(this, h), j(this, M.apply(this, arguments));
            }
            return h.prototype.setUpDrag = function() {
              var m = this;
              if ((0, X.select)(this.base).select(".pickerBox").on("mousedown.drag", null), !this.props.disabled) {
                var D = (0, q.drag)().on("start", function() {
                  m.props.focus && m.props.focus();
                }).on("drag", function() {
                  m.props.type !== "value" && m.props.onChange && m.props.onChange("type", "value");
                  var H = m.props.value + X.event.dx / m.props.trackWidth * (m.props.max - m.props.min), B = Math.max(m.props.min, Math.min(m.props.max, H));
                  m.props.onChange("value", B);
                }).container(function() {
                  return m.base.parentNode.parentNode;
                });
                (0, X.select)(this.base).select(".pickerBox").call(D);
              }
            }, h.prototype.componentDidUpdate = function() {
              this.setUpDrag();
            }, h.prototype.componentDidMount = function() {
              this.setUpDrag();
            }, h.prototype.render = function() {
              var m = this;
              return (0, a.h)(
                "div",
                {
                  className: "picker",
                  style: {
                    left: this.props.location * this.props.trackWidth + "px",
                    zIndex: this.props.zIndex
                  }
                },
                this.props.showTrash && (0, a.h)(
                  "div",
                  { className: "trashDiv" },
                  (0, a.h)("i", {
                    className: "icon-trash-empty",
                    "aria-hidden": "true",
                    onClick: function() {
                      m.props.remove && m.props.remove();
                    }
                  })
                ),
                (0, a.h)("div", {
                  className: "pickerBox",
                  onClick: function() {
                    m.props.focus && m.props.focus();
                  }
                }),
                (0, a.h)(
                  "div",
                  {
                    className: ["pickerOptions", this.props.location > 0.8 ? "rightOptions" : ""].join(" ")
                  },
                  (0, a.h)("input", {
                    type: "text",
                    className: "option",
                    value: this.props.disabled ? "" : this.props.type === "value" ? parseFloat(this.props.value.toFixed(2)) : this.props.type + " (" + parseFloat(this.props.value.toFixed(2)) + ")",
                    disabled: this.props.disabled,
                    onInput: function(H) {
                      var B = parseFloat(H.target.value);
                      isNaN(B) || m.props.onChange("value", B);
                    },
                    onFocus: function(H) {
                      H.target.select(), m.props.focus && m.props.focus();
                    }
                  }),
                  (0, a.h)(
                    "select",
                    {
                      className: "typePicker",
                      value: this.props.type,
                      onChange: function(H) {
                        m.props.onChange && m.props.onChange("type", H.target.value);
                      },
                      disabled: this.props.disabled,
                      onFocus: function(H) {
                        m.props.focus && m.props.focus();
                      }
                    },
                    (0, a.h)(
                      "option",
                      { value: "value" },
                      "Value"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "min" },
                      "Min"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "mean" },
                      "Mean"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "Q1" },
                      "Q1"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "median" },
                      "Median"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "Q3" },
                      "Q3"
                    ),
                    (0, a.h)(
                      "option",
                      { value: "max" },
                      "Max"
                    )
                  ),
                  (0, a.h)(
                    "div",
                    { className: "colorOptions" },
                    (0, a.h)("input", {
                      type: "text",
                      className: "colorText",
                      onInput: function(H) {
                        m.props.onChange && m.props.onChange("color", H.target.value);
                      },
                      onFocus: function(H) {
                        H.target.select(), m.props.focus && m.props.focus();
                      },
                      value: this.props.color || "",
                      disabled: this.props.disabled
                    }),
                    (0, a.h)("input", {
                      type: "color",
                      className: "colorWheel",
                      onInput: function(H) {
                        m.props.onChange && m.props.onChange("color", H.target.value);
                      },
                      onFocus: function(H) {
                        H.target.select(), m.props.focus && m.props.focus();
                      },
                      value: this.props.color || "",
                      disabled: this.props.disabled
                    })
                  ),
                  (0, a.h)("input", {
                    type: "text",
                    className: "option",
                    onInput: function(H) {
                      m.props.onChange && m.props.onChange("size", parseInt(H.target.value));
                    },
                    onFocus: function(H) {
                      H.target.select(), m.props.focus && m.props.focus();
                    },
                    value: this.props.size,
                    disabled: this.props.disabled
                  })
                )
              );
            }, h;
          }(a.Component);
          O.default = F;
        },
        /* 52 */
        /***/
        function(Te, O, d) {
          var a = d(53);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 53 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .picker {
  top: 35px;
  margin-left: -7px;
  position: absolute;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.escher-container .pickerBox {
  position: absolute;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.375);
  width: 14px;
  height: 35px;
  top: -35px
}

.escher-container .scaleTrack .rightOptions {
  position: absolute;
  left: -76px;
}

.escher-container .pickerOptions {
  box-shadow: 0 2px 14px #c5c5c5;
  margin-top: 1px;
  display: inline-flex;
  flex-direction: column;
  width: 90px;
}

.escher-container .pickerOptions * {
  font-size: 12px;
}

.escher-container .pickerOptions .option {
  padding: 3px 0px;
}

.escher-container .pickerOptions .typePicker {
  width: 20px;
  position: absolute;
  left: 70px;
  top: 1px;
  right: 0px;
  height: 14px;
  background-color: rgb(232, 232, 232);
}

.escher-container .pickerOptions .colorOptions {
  display: inline-flex;
}

.escher-container .colorOptions .colorText {
  padding: 3px 0px;
  width: 100%;
}

.escher-container .colorOptions .colorWheel {
  padding: 0px;
  position: absolute;
  right: 0;
  height: 24px;
  width: 21px;
  border: 1px solid black;
}

.escher-container .picker .trashDiv {
  position: absolute;
  top: -56px;
  font-size: 17px;
}

.escher-container .picker .trashDiv * {
  font-size: 17px;
  cursor: pointer;
}

.escher-container .picker .icon-trash-empty {
  margin: -5px;
}

.escher-container .scaleEditor :disabled {
  background: #f1ecfa;
}

.escher-container .scaleEditor input[type=color]:disabled {
  margin-top: 1px;
}
`, ""]);
        },
        /* 54 */
        /***/
        function(Te, O) {
          Te.exports = function(d) {
            var a = typeof window < "u" && window.location;
            if (!a)
              throw new Error("fixUrls requires window.location");
            if (!d || typeof d != "string")
              return d;
            var X = a.protocol + "//" + a.host, q = X + a.pathname.replace(/\/[^\/]*$/, "/"), ee = d.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(j, t) {
              var F = t.trim().replace(/^"(.*)"$/, function(h, x) {
                return x;
              }).replace(/^'(.*)'$/, function(h, x) {
                return x;
              });
              if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(F))
                return j;
              var M;
              return F.indexOf("//") === 0 ? M = F : F.indexOf("/") === 0 ? M = X + F : M = q + F.replace(/^\.\//, ""), "url(" + JSON.stringify(M) + ")";
            });
            return ee;
          };
        },
        /* 55 */
        /***/
        function(Te, O, d) {
          var a = d(56), X = Object.prototype.hasOwnProperty, q = Array.prototype.splice, ee = Object.prototype.toString, j = function(y) {
            return ee.call(y).slice(8, -1);
          }, t = Object.assign || /* istanbul ignore next */
          function(v, T) {
            return F(T).forEach(function(n) {
              X.call(T, n) && (v[n] = T[n]);
            }), v;
          }, F = typeof Object.getOwnPropertySymbols == "function" ? function(y) {
            return Object.keys(y).concat(Object.getOwnPropertySymbols(y));
          } : (
            /* istanbul ignore next */
            function(y) {
              return Object.keys(y);
            }
          );
          function M(y) {
            if (Array.isArray(y))
              return t(y.constructor(y.length), y);
            if (j(y) === "Map")
              return new Map(y);
            if (j(y) === "Set")
              return new Set(y);
            if (y && typeof y == "object") {
              var v = Object.getPrototypeOf(y);
              return t(Object.create(v), y);
            } else
              return y;
          }
          function h() {
            var y = t({}, x);
            return v.extend = function(T, n) {
              y[T] = n;
            }, v.isEquals = function(T, n) {
              return T === n;
            }, v;
            function v(T, n) {
              typeof n == "function" && (n = { $apply: n }), Array.isArray(T) && Array.isArray(n) || a(
                !Array.isArray(n),
                "update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."
              ), a(
                typeof n == "object" && n !== null,
                "update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: %s.",
                Object.keys(y).join(", ")
              );
              var r = T;
              return F(n).forEach(function(b) {
                if (X.call(y, b)) {
                  var C = T === r;
                  r = y[b](n[b], r, n, T), C && v.isEquals(r, T) && (r = T);
                } else {
                  var ne = j(T) === "Map" ? v(T.get(b), n[b]) : v(T[b], n[b]), ge = j(r) === "Map" ? r.get(b) : r[b];
                  (!v.isEquals(ne, ge) || typeof ne > "u" && !X.call(T, b)) && (r === T && (r = M(T)), j(r) === "Map" ? r.set(b, ne) : r[b] = ne);
                }
              }), r;
            }
          }
          var x = {
            $push: function(y, v, T) {
              return D(v, T, "$push"), y.length ? v.concat(y) : v;
            },
            $unshift: function(y, v, T) {
              return D(v, T, "$unshift"), y.length ? y.concat(v) : v;
            },
            $splice: function(y, v, T, n) {
              return B(v, T), y.forEach(function(r) {
                k(r), v === n && r.length && (v = M(n)), q.apply(v, r);
              }), v;
            },
            $set: function(y, v, T) {
              return Q(T), y;
            },
            $toggle: function(y, v) {
              H(y, "$toggle");
              var T = y.length ? M(v) : v;
              return y.forEach(function(n) {
                T[n] = !v[n];
              }), T;
            },
            $unset: function(y, v, T, n) {
              return H(y, "$unset"), y.forEach(function(r) {
                Object.hasOwnProperty.call(v, r) && (v === n && (v = M(n)), delete v[r]);
              }), v;
            },
            $add: function(y, v, T, n) {
              return W(v, "$add"), H(y, "$add"), j(v) === "Map" ? y.forEach(function(r) {
                var b = r[0], C = r[1];
                v === n && v.get(b) !== C && (v = M(n)), v.set(b, C);
              }) : y.forEach(function(r) {
                v === n && !v.has(r) && (v = M(n)), v.add(r);
              }), v;
            },
            $remove: function(y, v, T, n) {
              return W(v, "$remove"), H(y, "$remove"), y.forEach(function(r) {
                v === n && v.has(r) && (v = M(n)), v.delete(r);
              }), v;
            },
            $merge: function(y, v, T, n) {
              return o(v, y), F(y).forEach(function(r) {
                y[r] !== v[r] && (v === n && (v = M(n)), v[r] = y[r]);
              }), v;
            },
            $apply: function(y, v) {
              return _(y), y(v);
            }
          }, m = h();
          Te.exports = m, Te.exports.default = m, Te.exports.newContext = h;
          function D(y, v, T) {
            a(
              Array.isArray(y),
              "update(): expected target of %s to be an array; got %s.",
              T,
              y
            ), H(v[T], T);
          }
          function H(y, v) {
            a(
              Array.isArray(y),
              "update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?",
              v,
              y
            );
          }
          function B(y, v) {
            a(
              Array.isArray(y),
              "Expected $splice target to be an array; got %s",
              y
            ), k(v.$splice);
          }
          function k(y) {
            a(
              Array.isArray(y),
              "update(): expected spec of $splice to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",
              y
            );
          }
          function _(y) {
            a(
              typeof y == "function",
              "update(): expected spec of $apply to be a function; got %s.",
              y
            );
          }
          function Q(y) {
            a(
              Object.keys(y).length === 1,
              "Cannot have more than one key in an object with $set"
            );
          }
          function o(y, v) {
            a(
              v && typeof v == "object",
              "update(): $merge expects a spec of type 'object'; got %s",
              v
            ), a(
              y && typeof y == "object",
              "update(): $merge expects a target of type 'object'; got %s",
              y
            );
          }
          function W(y, v) {
            var T = j(y);
            a(
              T === "Map" || T === "Set",
              "update(): %s expects a target of type Set or Map; got %s",
              v,
              T
            );
          }
        },
        /* 56 */
        /***/
        function(Te, O, d) {
          var a = function(X, q, ee, j, t, F, M, h) {
            if (!X) {
              var x;
              if (q === void 0)
                x = new Error(
                  "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
                );
              else {
                var m = [ee, j, t, F, M, h], D = 0;
                x = new Error(
                  q.replace(/%s/g, function() {
                    return m[D++];
                  })
                ), x.name = "Invariant Violation";
              }
              throw x.framesToPop = 1, x;
            }
          };
          Te.exports = a;
        },
        /* 57 */
        /***/
        function(Te, O, d) {
          var a = d(58);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 58 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .scaleEditor * {
  font-size: 12px;
  color: #777;
  box-sizing: border-box;
}

.escher-container .scaleEditor {
  position: relative;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.escher-container .scaleTrack {
  position: relative;
  display: flex;
  height: 30px;
  margin-bottom: 9px;
  margin-top: 30px;
  margin-left: 55px;
  font-size: 15px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.escher-container .scaleTrack.disabled {
  background: #f1ecfa;
  color: #b19ec0;
  padding: 4px 0;
  justify-content: center;
}

.escher-container .gradient {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.escher-container .scaleLabels {
  display: inline-flex;
  flex-direction: column;
  font-size: 12px;
}

.escher-container .scaleLabels label {
  margin-bottom: 6px;
}

.escher-container .noDataStyle {
  position: relative;
  margin-top: 20px;
}

.escher-container .noDataStyle .styleHeader {
  font-size: 12px;
  font-weight: bold;
}

.escher-container .noDataStyle label {
  margin-right: 5px;
}

.escher-container .noDataStyle input[type=text] {
  margin-right: 10px;
  padding: 3px 0px;
  width: 86px;
}

.escher-container .noDataStyle input[type=color] {
  position: absolute;
  padding: 0px;
  border: 1px solid black;
  left: 103px;
  height: 24px;
  width: 21px;
}

.escher-container .scaleEditor .icon-plus {
  cursor: pointer;
  position: absolute;
  font-size: 14px;
  right: 19px;
}
`, ""]);
        },
        /* 59 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          function X(t, F) {
            if (!(t instanceof F))
              throw new TypeError("Cannot call a class as a function");
          }
          function q(t, F) {
            if (!t)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return F && (typeof F == "object" || typeof F == "function") ? F : t;
          }
          function ee(t, F) {
            if (typeof F != "function" && F !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof F);
            t.prototype = Object.create(F && F.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), F && (Object.setPrototypeOf ? Object.setPrototypeOf(t, F) : t.__proto__ = F);
          }
          var j = function(t) {
            ee(F, t);
            function F(M) {
              X(this, F);
              var h = q(this, t.call(this, M)), x = [];
              if (M.scale)
                for (var m = 0; m < M.scale.length; m++)
                  x.push(M.scale[m].color);
              return h.state = {
                colors: x
              }, h;
            }
            return F.prototype.render = function() {
              var h = this;
              return (0, a.h)(
                "div",
                { className: "scaleSelection", onClick: function() {
                  return h.props.onClick();
                } },
                (0, a.h)(
                  "div",
                  null,
                  this.props.name
                ),
                (0, a.h)(
                  "div",
                  { className: "scaleColors" },
                  this.state.colors.map(function(x) {
                    return (0, a.h)("i", { className: "icon-blank", style: { color: x } });
                  })
                )
              );
            }, F;
          }(a.Component);
          O.default = j;
        },
        /* 60 */
        /***/
        function(Te, O, d) {
          var a = d(61);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 61 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .settingsBackground {
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  background: rgba(0,0,0,.4);
  padding: 5% 0 80px;
  text-align: center;
}

.escher-container .scale-editor .domain-input {
  color: #333;
}

.escher-container .settingsBoxContainer button {
  position: absolute;
  top: 5px;
  right: 20px;
  z-index: 10;
  text-align: center;
  vertical-align: middle;
  font-weight: normal!important;
  width: 34px;
  height: 30px;
  margin: 0;
  padding: unset;
  font-size: 14px!important;
  border-radius: 3px;
  -ms-touch-action: none;
  touch-action: none;
}

.escher-container .settingsBoxContainer button:active {
  background-image: linear-gradient(#3F4141, #474949 6%, #4F5151);
}

.escher-container .settingsBoxContainer .discardChanges {
  right: 60px;
}

.escher-container .settingsBoxContainer {
  color: rgb(119, 119, 119);
  display: inline-block;
  position: relative;
  width: 90%;
  max-width: 520px;
  height: 100%;
  z-index: 10;
}

.escher-container .settingsBox {
  font-size: 13px;
  box-sizing: border-box;
  display: inline-block;
  max-height: 100%;
  width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.953);
  padding: 8px;
  margin: 0;
  border: 1px solid #ddd;
  text-align: left;
}

.escher-container .settingsBox * {
  box-sizing: border-box;
}

.escher-container .settingsBox .title {
  font-size: 17px;
  font-weight: 700;
  color: #777777;
}

.escher-container .settingsBox .subheading {
  font-size: 13px;
  font-weight: 700;
  margin-top: 15px;
  color: #777777;
}

.escher-container .settingsBox table {
  border-collapse: collapse;
}

.escher-container .settingsBox label {
  display: inline;
}

.escher-container .settingsBox .radioSelection {
  cursor: default;
}

.escher-container .radioSelection td {
  padding: 3px 5px;
}

.escher-container .radioSelection input[type=radio] {
  margin: 0;
  margin-top: 4px;
  margin-right: 4px;
}

.escher-container .radioSelection .optionLabel {
  width: 88px;
}

.escher-container .radioSelection .optionLabelWide {
  width: 192px;
}

.escher-container .radioSelection .optionGroup {
  margin-right: 10px
}

.escher-container .settingsBox .singleLine {
  display: flex;
}

.escher-container .settingsContainer label {
  display: block;
  margin-bottom: 0;
}

.escher-container .settingsBoxContainer input[type=checkbox] {
  margin: 0;
  margin-top: 4px;
  margin-right: 4px;
}

.escher-container .settingsTip {
  font-size: 13px;
}

.escher-container .settingsBoxContainer hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #dddddd;
}

.escher-container .scaleTitle {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
}

.escher-container .selector {
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  padding-top: 2px;
}

.escher-container .selectorTitle {
  background-color: white;
  border: 1px solid #a9a9a9;
  padding-left: 4px;
  cursor: default;
  width: 162px;
}

.escher-container .selectorTitle:hover:not(.disabled) {
  border-color: black;
}

.escher-container .selectorTitle.disabled {
  background-color: #f1ecfa;
}

.escher-container .selectorMenu {
  position: absolute;
  z-index: 4;
  background-color: white;
  border: 1px solid #a9a9a9;
  min-width: 162px;
}

.escher-container .scaleSelection {
  cursor: default;
  padding: 0 6px;
  display: flex;
  justify-content: space-between;
}

.escher-container .scaleSelection:hover {
  background-color: dodgerblue;
  color: white;
}

.escher-container .settingsBox .icon-sort-down {
  position: absolute;
  top: 0;
}

.escher-container .settingsBox .tooltipOption {
  margin-left: 10px;
}
`, ""]);
        },
        /* 62 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5), X = d(63), q = t(X), ee = d(66), j = t(ee);
          function t(m) {
            return m && m.__esModule ? m : { default: m };
          }
          function F(m, D) {
            if (!(m instanceof D))
              throw new TypeError("Cannot call a class as a function");
          }
          function M(m, D) {
            if (!m)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return D && (typeof D == "object" || typeof D == "function") ? D : m;
          }
          function h(m, D) {
            if (typeof D != "function" && D !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof D);
            m.prototype = Object.create(D && D.prototype, { constructor: { value: m, enumerable: !1, writable: !0, configurable: !0 } }), D && (Object.setPrototypeOf ? Object.setPrototypeOf(m, D) : m.__proto__ = D);
          }
          var x = function(m) {
            h(D, m);
            function D() {
              return F(this, D), M(this, m.apply(this, arguments));
            }
            return D.prototype.componentWillMount = function() {
              var B = this;
              this.props.sel.selectAll(".escher-zoom-container").on("touchend.menuBar", function() {
                return B.setState({ dropdownVisible: !1 });
              }).on("click.menuBar", function() {
                return B.setState({ dropdownVisible: !1 });
              });
            }, D.prototype.componentWillUnmount = function() {
              this.props.sel.selectAll(".escher-zoom-container").on("touchend.menuBar", null).on("click.menuBar", null);
            }, D.prototype.render = function() {
              var B = this, k = this.props.settings.get("enable_keys"), _ = this.props.settings.get("disabled_buttons"), Q = this.props.map.beziers_enabled, o = this.props.settings.get("full_screen_button");
              return (0, a.h)(
                "ul",
                { className: "menu-bar" },
                (0, a.h)(
                  q.default,
                  { name: "Map", dropdownVisible: this.props.dropdownVisible },
                  (0, a.h)(j.default, {
                    name: "Save map JSON" + (k ? " (Ctrl+S)" : ""),
                    onClick: function() {
                      return B.props.saveMap();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Load map JSON" + (k ? " (Ctrl+O)" : ""),
                    onClick: function(y) {
                      return B.props.loadMap(y);
                    },
                    assignKey: this.props.assignKeyLoadMap,
                    type: "load",
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Export as SVG" + (k ? " (Ctrl+Shift+S)" : ""),
                    onClick: function() {
                      return B.props.save_svg();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Export as PNG" + (k ? " (Ctrl+Shift+P)" : ""),
                    onClick: function() {
                      return B.props.save_png();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Clear map",
                    onClick: function() {
                      return B.props.clear_map();
                    },
                    disabledButtons: _
                  })
                ),
                (0, a.h)(
                  q.default,
                  { name: "Model", dropdownVisible: this.props.dropdownVisible },
                  (0, a.h)(j.default, {
                    name: "Load COBRA model JSON" + (k ? " (Ctrl+M)" : ""),
                    onClick: function(y) {
                      return B.props.loadModel(y);
                    },
                    assignKey: this.props.assignKeyLoadModel,
                    type: "load",
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Update names and gene reaction rules using model",
                    onClick: function() {
                      return B.props.updateRules();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Clear model",
                    onClick: function() {
                      return B.props.clearModel();
                    },
                    disabledButtons: _
                  })
                ),
                (0, a.h)(
                  q.default,
                  { name: "Data", dropdownVisible: this.props.dropdownVisible },
                  (0, a.h)(j.default, {
                    name: "Load reaction data",
                    onClick: function(y) {
                      return B.props.setReactionData(y);
                    },
                    type: "load",
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Clear reaction data",
                    onClick: function() {
                      return B.props.clearReactionData();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Load gene data",
                    onClick: function(y) {
                      return B.props.setGeneData(y);
                    },
                    type: "load",
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Clear gene data",
                    onClick: function() {
                      return B.props.clearGeneData();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Load metabolite data",
                    onClick: function(y) {
                      return B.props.setMetaboliteData(y);
                    },
                    type: "load",
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Clear metabolite data",
                    onClick: function() {
                      return B.props.clearMetaboliteData();
                    },
                    disabledButtons: _
                  })
                ),
                (0, a.h)(
                  q.default,
                  {
                    name: "Edit",
                    rightMenu: "true",
                    dropdownVisible: this.props.dropdownVisible,
                    disabledEditing: !this.props.settings.get("enable_editing")
                  },
                  (0, a.h)(j.default, {
                    name: "Pan mode" + (k ? " (Z)" : ""),
                    checkMark: this.props.mode === "zoom",
                    onClick: function() {
                      return B.props.setMode("zoom");
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Select mode" + (k ? " (V)" : ""),
                    checkMark: this.props.mode === "brush",
                    onClick: function() {
                      return B.props.setMode("brush");
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Add reaction mode" + (k ? " (N)" : ""),
                    checkMark: this.props.mode === "build",
                    onClick: function() {
                      return B.props.setMode("build");
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Rotate mode" + (k ? " (R)" : ""),
                    checkMark: this.props.mode === "rotate",
                    onClick: function() {
                      return B.props.setMode("rotate");
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Text mode" + (k ? " (T)" : ""),
                    checkMark: this.props.mode === "text",
                    onClick: function() {
                      return B.props.setMode("text");
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Delete" + (k ? " (Del)" : ""),
                    onClick: function() {
                      return B.props.deleteSelected();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Undo" + (k ? " (Ctrl+Z)" : ""),
                    onClick: function() {
                      return B.props.undo();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Redo" + (k ? " (Ctrl+Shift+Z)" : ""),
                    onClick: function() {
                      return B.props.redo();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Align vertical" + (k ? " (Alt+L)" : ""),
                    onClick: this.props.align_vertical,
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Align horizontal" + (k ? " (Shift+Alt+L)" : ""),
                    onClick: this.props.align_horizontal,
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Toggle primary/secondary" + (k ? " (P)" : ""),
                    onClick: function() {
                      return B.props.togglePrimary();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Rotate reactant locations" + (k ? " (C)" : ""),
                    onClick: function() {
                      return B.props.cyclePrimary();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Select all" + (k ? " (Ctrl+A)" : ""),
                    onClick: function() {
                      return B.props.selectAll();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Select none" + (k ? " (Ctrl+Shift+A)" : ""),
                    onClick: function() {
                      return B.props.selectNone();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Invert selection",
                    onClick: function() {
                      return B.props.invertSelection();
                    },
                    disabledButtons: _
                  })
                ),
                (0, a.h)(
                  q.default,
                  { name: "View", rightMenu: "true", dropdownVisible: this.props.dropdownVisible },
                  (0, a.h)(j.default, {
                    name: "Zoom in" + (k ? " (+)" : ""),
                    onClick: function() {
                      return B.props.zoom_in();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Zoom out" + (k ? " (-)" : ""),
                    onClick: function() {
                      return B.props.zoom_out();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Zoom to nodes" + (k ? " (0)" : ""),
                    onClick: function() {
                      return B.props.zoomExtentNodes();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Zoom to canvas" + (k ? " (1)" : ""),
                    onClick: function() {
                      return B.props.zoomExtentCanvas();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: "Find" + (k ? " (F)" : ""),
                    onClick: function() {
                      return B.props.search();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)(j.default, {
                    name: (Q ? "Hide" : "Show") + " control points" + (k ? " (B)" : ""),
                    onClick: function() {
                      return B.props.toggleBeziers();
                    },
                    disabledButtons: _
                  }),
                  (0, a.h)("li", { name: "divider" }),
                  o && (0, a.h)(j.default, {
                    name: "Full screen",
                    onClick: function() {
                      return B.props.full_screen();
                    },
                    checkMark: this.props.isFullScreen,
                    disabledButtons: _
                  }),
                  o && (0, a.h)("li", { name: "divider" }),
                  (0, a.h)(j.default, {
                    name: "Settings" + (k ? " (,)" : ""),
                    onClick: function() {
                      return B.props.renderSettingsMenu();
                    },
                    disabledButtons: _,
                    type: "settings"
                  })
                ),
                (0, a.h)(
                  "a",
                  { className: "helpButton", target: "#", href: "https://escher.readthedocs.org" },
                  "?"
                )
              );
            }, D;
          }(a.Component);
          O.default = x;
        },
        /* 63 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          d(64);
          function X(t, F) {
            if (!(t instanceof F))
              throw new TypeError("Cannot call a class as a function");
          }
          function q(t, F) {
            if (!t)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return F && (typeof F == "object" || typeof F == "function") ? F : t;
          }
          function ee(t, F) {
            if (typeof F != "function" && F !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof F);
            t.prototype = Object.create(F && F.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), F && (Object.setPrototypeOf ? Object.setPrototypeOf(t, F) : t.__proto__ = F);
          }
          var j = function(t) {
            ee(F, t);
            function F(M) {
              X(this, F);
              var h = q(this, t.call(this, M));
              return h.state = {
                visible: null
              }, h.setWrapperRef = h.setWrapperRef.bind(h), h.handleClickOutside = h.handleClickOutside.bind(h), h;
            }
            return F.prototype.componentWillMount = function() {
              this.setState({
                visible: !1
              });
            }, F.prototype.componentDidMount = function() {
              document.addEventListener("mouseup", this.handleClickOutside);
            }, F.prototype.componentWillReceiveProps = function(h) {
              this.setState({ visible: h.visible });
            }, F.prototype.setWrapperRef = function(h) {
              this.wrapperRef = h;
            }, F.prototype.handleClickOutside = function(h) {
              this.wrapperRef && !this.wrapperRef.contains(h.target) && this.setState({ visible: !1 });
            }, F.prototype.render = function() {
              var h = this;
              return (0, a.h)(
                "li",
                {
                  className: "dropdown",
                  style: this.props.disabledEditing ? { display: "none" } : { display: "block" }
                },
                (0, a.h)(
                  "div",
                  {
                    className: "dropdownButton",
                    tabindex: "0",
                    ref: this.setWrapperRef,
                    onClick: function() {
                      return h.setState({ visible: !h.state.visible });
                    }
                  },
                  this.props.name,
                  " ",
                  (0, a.h)("i", { className: "icon-sort-down" })
                ),
                (0, a.h)(
                  "ul",
                  {
                    className: "menu",
                    style: this.state.visible ? { display: "block" } : { display: "none" },
                    id: this.props.rightMenu === "true" ? "rightMenu" : ""
                  },
                  this.props.children.map(function(x) {
                    return x && x.attributes.name === "divider" ? (0, a.h)("li", {
                      style: {
                        height: "1px",
                        backgroundColor: "#e5e5e5",
                        padding: "0",
                        margin: "8px 0"
                      }
                    }) : x;
                  })
                )
              );
            }, F;
          }(a.Component);
          O.default = j;
        },
        /* 64 */
        /***/
        function(Te, O, d) {
          var a = d(65);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 65 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .menu-bar {
  box-sizing: border-box;
  list-style-type: none;
  padding: 0;
  padding-right: 20px;
  position: relative;
  margin: 5px 0px;
  background-color: white;
  border: 1px solid #ddd;
  display: inline-flex;
  box-sizing: border-box;
  width: 100%;
  justify-content: space-between;
}

.escher-container .dropdown {
  position: relative;
  float: left;
  box-sizing: border-box;
  font-size: 12px;
  border-radius: 3px;

  /* these sometimes get overridden */
  margin: 0 !important;
  font-weight: normal !important;

  text-align: center;
  vertical-align: middle;
  -ms-touch-action: none;
  touch-action: none;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.escher-container .dropdownButton {
  color: #d9230f!important;
  border: 1px solid transparent;
  padding: 6px 9px;
}

.escher-container .helpButton {
  color: #d9230f!important;
  padding: 0px 5px;
  background-color: #f5f5f5!important;
  border: 0!important;
  text-decoration: unset;
  height: fit-content;
  position: absolute;
  right: 0;
  font-size: 12px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.escher-container .dropdownButton:focus, .escher-container .helpButton:focus {
  color: #91170a!important;
  text-decoration: underline;
}

.escher-container .dropdownButton:hover, .escher-container .helpButton:hover {
  color: #91170a!important;
  text-decoration: underline;
}

.escher-container .menu-bar .icon-sort-down {
  position: absolute;
  font-size: 10px;
  margin-left: -5px;
}

@media (min-width: 550px) {
  .escher-container .menu-bar {
    padding-right: 25px;
  }

  .escher-container .dropdown {
    font-size: 18px;
  }

  .escher-container .dropdownButton {
    padding: 6px 10px;
    padding-right: 16px;
  }

  .escher-container .helpButton {
    font-size: 16px;
  }

  .escher-container .menu-bar .icon-sort-down {
    font-size: 14px;
  }
}

.escher-container .menu {
  box-sizing: border-box;
  font-weight: normal!important;
  word-spacing: 0;
  position: absolute;
  white-space: nowrap;
  top: 103%;
  left: -1%;
  z-index: 1000;
  display: block;
  float: none;
  min-width: 160px;
  padding: 5px 0;
  list-style: none;
  font-size: 13px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.175);
  background-clip: padding-box;
  border: 1px solid #ddd;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 0;
  margin: 0;
  text-align: left;
}

.escher-container #rightMenu {
  left: auto;
  right: -2%;
}

.escher-container .menu li:hover {
  background-color: #d9230f;
  color: #FFFFFF;
}

.escher-container .menu li, .menu label {
  font-size: 15px;
  display: block;
  color: #444444;

  /* these sometimes get overridden */
  font-weight: normal !important;
  margin: 0 !important;
}

.escher-container .menu.ul.li {
  background-color: rgba(255, 255, 255, 0.95);
}

.escher-container .menuButton {
  box-sizing: border-box;
  width: 100%;
  padding: 5px 20px;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.escher-container label:focus, .menuButton:focus {
  background-color: #d9230f;
  color: #FFFFFF;
}

.escher-container .menuButton:hover {
  background-color: #d9230f;
  color: #FFFFFF;
}

.escher-container input[type="file"] {
  display: none;
}

.escher-container #disabled {
  color: #e0e0e0;
}

.escher-container #disabled:hover, #disabled:focus {
  background-color: rgba(255, 255, 255, 0.95);
  cursor: default;
}
`, ""]);
        },
        /* 66 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5), X = d(4), q = h(X), ee = d(3), j = h(ee), t = d(12), F = M(t);
          function M(B) {
            if (B && B.__esModule)
              return B;
            var k = {};
            if (B != null)
              for (var _ in B)
                Object.prototype.hasOwnProperty.call(B, _) && (k[_] = B[_]);
            return k.default = B, k;
          }
          function h(B) {
            return B && B.__esModule ? B : { default: B };
          }
          function x(B, k) {
            if (!(B instanceof k))
              throw new TypeError("Cannot call a class as a function");
          }
          function m(B, k) {
            if (!B)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return k && (typeof k == "object" || typeof k == "function") ? k : B;
          }
          function D(B, k) {
            if (typeof k != "function" && k !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof k);
            B.prototype = Object.create(k && k.prototype, { constructor: { value: B, enumerable: !1, writable: !0, configurable: !0 } }), k && (Object.setPrototypeOf ? Object.setPrototypeOf(B, k) : B.__proto__ = k);
          }
          var H = function(B) {
            D(k, B);
            function k(_) {
              x(this, k);
              var Q = m(this, B.call(this, _));
              return Q.assignKeyForInput = Q.assignKeyForInput.bind(Q), Q;
            }
            return k.prototype.handleFileInput = function(Q) {
              var o = this, W = Q.files[0], y = new window.FileReader();
              y.onload = function() {
                j.default.load_json_or_csv(W, F.csv_converter, function(v, T) {
                  return o.props.onClick(T);
                });
              }, W !== void 0 && y.readAsText(W), Q.value = null;
            }, k.prototype.assignKeyForInput = function(Q) {
              this.props.assignKey && this.props.assignKey(function() {
                return Q.click();
              });
            }, k.prototype.render = function() {
              var Q = this, o = q.default.contains(this.props.disabledButtons, this.props.name.replace(/ \(.*\)$/, ""));
              return this.props.type === "load" ? (0, a.h)(
                "label",
                {
                  className: "menuButton",
                  tabindex: o ? "-1" : "0",
                  id: o ? "disabled" : ""
                },
                (0, a.h)("input", {
                  type: "file",
                  onChange: function(y) {
                    return Q.handleFileInput(y.target);
                  },
                  disabled: o,
                  ref: this.assignKeyForInput
                }),
                this.props.name
              ) : this.props.checkMark ? (0, a.h)(
                "li",
                {
                  className: "menuButton",
                  tabindex: o ? "-1" : "0",
                  onClick: this.props.onClick,
                  id: o ? "disabled" : ""
                },
                (0, a.h)(
                  "i",
                  { className: "icon-ok", "aria-hidden": "true" },
                  " "
                ),
                this.props.name
              ) : (0, a.h)(
                "li",
                {
                  className: "menuButton",
                  tabindex: o ? "-1" : "0",
                  onClick: o ? null : this.props.onClick,
                  id: o ? "disabled" : ""
                },
                this.props.name
              );
            }, k;
          }(a.Component);
          O.default = H;
        },
        /* 67 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          d(68);
          var X = d(4), q = ee(X);
          function ee(h) {
            return h && h.__esModule ? h : { default: h };
          }
          function j(h, x) {
            if (!(h instanceof x))
              throw new TypeError("Cannot call a class as a function");
          }
          function t(h, x) {
            if (!h)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return x && (typeof x == "object" || typeof x == "function") ? x : h;
          }
          function F(h, x) {
            if (typeof x != "function" && x !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof x);
            h.prototype = Object.create(x && x.prototype, { constructor: { value: h, enumerable: !1, writable: !0, configurable: !0 } }), x && (Object.setPrototypeOf ? Object.setPrototypeOf(h, x) : h.__proto__ = x);
          }
          var M = function(h) {
            F(x, h);
            function x(m) {
              j(this, x);
              var D = t(this, h.call(this, m));
              return D.state = {
                current: 0,
                searchItem: m.searchItem,
                counter: ""
              }, D;
            }
            return x.prototype.componentWillMount = function() {
              var D = this;
              this.setState({
                clearEscape: this.props.map.key_manager.addEscapeListener(function() {
                  return D.close();
                }, !0),
                clearNext: this.props.map.key_manager.addKeyListener(["enter", "ctrl+g"], function() {
                  return D.next();
                }, !1),
                clearPrevious: this.props.map.key_manager.addKeyListener(["shift+enter", "shift+ctrl+g"], function() {
                  return D.previous();
                }, !1)
              });
            }, x.prototype.componentDidMount = function() {
              this.inputRef.focus();
            }, x.prototype.componentWillUnmount = function() {
              this.state.clearEscape(), this.state.clearNext(), this.state.clearPrevious(), this.props.map.highlight(null);
            }, x.prototype.handleInput = function(D) {
              var H = this.dropDuplicates(this.props.map.search_index.find(D)), B = "";
              if (H === null || !D)
                this.props.map.highlight(null);
              else if (H.length === 0)
                B = "0 / 0", this.props.map.highlight(null);
              else {
                this.state.current >= H.length && this.setState({
                  current: 0
                }), B = this.state.current + 1 + "/" + H.length;
                var k = H[this.state.current];
                if (k.type === "reaction")
                  this.props.map.zoom_to_reaction(k.reaction_id), this.props.map.highlight_reaction(k.reaction_id);
                else if (k.type === "metabolite")
                  this.props.map.zoom_to_node(k.node_id), this.props.map.highlight_node(k.node_id);
                else if (k.type === "text_label")
                  this.props.map.zoom_to_text_label(k.text_label_id), this.props.map.highlight_text_label(k.text_label_id);
                else
                  throw new Error("Bad search index data type: " + k.type);
              }
              this.setState({
                searchItem: D,
                current: 0,
                counter: B,
                results: H
              });
            }, x.prototype.dropDuplicates = function(D) {
              var H = {
                metabolite: {
                  type: "m",
                  key: "node_id"
                },
                reaction: {
                  type: "r",
                  key: "reaction_id"
                },
                text_label: {
                  type: "t",
                  key: "text_label_id"
                }
              };
              return q.default.uniq(D, function(B) {
                var k = H[B.type], _ = k.type, Q = k.key;
                return "" + _ + B[Q];
              });
            }, x.prototype.next = function() {
              this.state.results && this.state.results.length > 0 && this.update((this.state.current + 1) % this.state.results.length);
            }, x.prototype.previous = function() {
              this.state.results && this.state.results.length > 0 && this.update((this.state.current + this.state.results.length - 1) % this.state.results.length);
            }, x.prototype.update = function(D) {
              this.setState({
                current: D,
                counter: D + 1 + "/" + this.state.results.length
              });
              var H = this.state.results[D];
              if (H.type === "reaction")
                this.props.map.zoom_to_reaction(H.reaction_id), this.props.map.highlight_reaction(H.reaction_id);
              else if (H.type === "metabolite")
                this.props.map.zoom_to_node(H.node_id), this.props.map.highlight_node(H.node_id);
              else if (H.type === "text_label")
                this.props.map.zoom_to_text_label(H.text_label_id), this.props.map.highlight_text_label(H.text_label_id);
              else
                throw new Error("Bad search index data type: " + H.type);
            }, x.prototype.close = function() {
              this.props.setDisplay(!1);
            }, x.prototype.render = function() {
              var D = this;
              return (0, a.h)(
                "div",
                { className: "search-container" },
                (0, a.h)("input", {
                  className: "search-field",
                  value: this.state.searchItem,
                  onInput: function(B) {
                    return D.handleInput(B.target.value);
                  },
                  ref: function(B) {
                    D.inputRef = B;
                  }
                }),
                (0, a.h)(
                  "button",
                  { className: "search-bar-button left btn", onClick: function() {
                    return D.previous();
                  } },
                  (0, a.h)("i", { className: "icon-left-open" })
                ),
                (0, a.h)(
                  "button",
                  { className: "search-bar-button right btn", onClick: function() {
                    return D.next();
                  } },
                  (0, a.h)("i", { className: "icon-right-open" })
                ),
                (0, a.h)(
                  "div",
                  { className: "search-counter" },
                  this.state.counter
                ),
                (0, a.h)(
                  "button",
                  { className: "search-bar-button btn", onClick: function() {
                    return D.close();
                  } },
                  (0, a.h)("i", { className: "icon-cancel" })
                )
              );
            }, x;
          }(a.Component);
          O.default = M;
        },
        /* 68 */
        /***/
        function(Te, O, d) {
          var a = d(69);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 69 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .search-container {
  display: flex;
  flex-direction: row;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 3px;
  border: 1px solid #DDD;
}

.escher-container .search-container .search-field {
  flex: 0 0 auto;
  color: #777;
  border: 1px solid #DDD;
  width: 114px;
  height: 29px;
  border-radius: 3px;
  font-size: 13px;
}

.escher-container .search-container .search-counter {
  flex: 1;
  color: #777;
  font-size: 13px;
  padding: 9px 0 0 6px;
}

.escher-container .search-container .search-bar-button {
  flex: 0 0 auto;
  border-radius: 4px;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 400;
  height: 29px;
  width: 34px;
  margin: 3px;
}

.escher-container .search-container .search-bar-button.left {
  border-top-right-radius: 0px;
  border-bottom-right-radius: 0px;
  margin-right: 0;
}

.escher-container .search-container .search-bar-button.right {
  border-top-left-radius: 0px;
  border-bottom-left-radius: 0px;
  margin-left: 0;
}

.escher-container .search-container .search-bar-button:active {
  background-image: linear-gradient(#3F4141, #474949 6%, #4F5151);
}
`, ""]);
        },
        /* 70 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          d(71);
          function X(t, F) {
            if (!(t instanceof F))
              throw new TypeError("Cannot call a class as a function");
          }
          function q(t, F) {
            if (!t)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return F && (typeof F == "object" || typeof F == "function") ? F : t;
          }
          function ee(t, F) {
            if (typeof F != "function" && F !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof F);
            t.prototype = Object.create(F && F.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), F && (Object.setPrototypeOf ? Object.setPrototypeOf(t, F) : t.__proto__ = F);
          }
          var j = function(t) {
            ee(F, t);
            function F() {
              return X(this, F), q(this, t.apply(this, arguments));
            }
            return F.prototype.render = function() {
              var h = this, x = this.props.settings.get("menu"), m = this.props.settings.get("enable_keys"), D = this.props.settings.get("enable_editing");
              return (0, a.h)(
                "ul",
                { className: "button-panel" },
                (0, a.h)(
                  "li",
                  null,
                  (0, a.h)(
                    "button",
                    {
                      className: "button btn",
                      onClick: function() {
                        return h.props.zoomContainer.zoom_in();
                      },
                      title: "Zoom in" + (m ? " (+)" : "")
                    },
                    (0, a.h)("i", { className: "icon-zoom-in" })
                  )
                ),
                (0, a.h)(
                  "li",
                  null,
                  (0, a.h)(
                    "button",
                    {
                      className: "button btn",
                      onClick: function() {
                        return h.props.zoomContainer.zoom_out();
                      },
                      title: "Zoom out" + (m ? " (-)" : "")
                    },
                    (0, a.h)("i", { className: "icon-zoom-out" })
                  )
                ),
                (0, a.h)(
                  "li",
                  null,
                  (0, a.h)(
                    "button",
                    {
                      className: "button btn",
                      onClick: function() {
                        return h.props.map.zoom_extent_canvas();
                      },
                      title: "Zoom to canvas" + (m ? " (1)" : "")
                    },
                    (0, a.h)("i", { className: "icon-resize-full" })
                  )
                ),
                (0, a.h)(
                  "li",
                  { style: { display: this.props.settings.get("full_screen_button") !== !1 ? "block" : "none" } },
                  (0, a.h)(
                    "button",
                    {
                      className: "button btn " + (this.props.isFullScreen ? "active-button" : ""),
                      onClick: function() {
                        return h.props.full_screen();
                      },
                      title: "Toggle full screen"
                    },
                    (0, a.h)("i", { className: "icon-resize-full-alt" })
                  )
                ),
                (0, a.h)(
                  "li",
                  {
                    className: "grouping",
                    style: { display: x === "all" && D ? "block" : "none" }
                  },
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Pan mode" + (m ? " (Z)" : ""),
                      for: "zoom",
                      id: this.props.mode === "zoom" ? "currentMode" : null,
                      onClick: function() {
                        return h.props.setMode("zoom");
                      }
                    },
                    (0, a.h)("i", { className: "icon-move" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Select mode" + (m ? " (V)" : ""),
                      for: "brush",
                      id: this.props.mode === "brush" ? "currentMode" : null,
                      onClick: function() {
                        return h.props.setMode("brush");
                      }
                    },
                    (0, a.h)("i", { className: "icon-mouse-pointer" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Add reaction mode" + (m ? " (N)" : ""),
                      for: "build",
                      onClick: function() {
                        return h.props.setMode("build");
                      },
                      id: this.props.mode === "build" ? "currentMode" : null
                    },
                    (0, a.h)("i", { className: "icon-wrench" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Rotate mode" + (m ? " (R)" : ""),
                      for: "rotate",
                      id: this.props.mode === "rotate" ? "currentMode" : null,
                      onClick: function() {
                        return h.props.setMode("rotate");
                      }
                    },
                    (0, a.h)("i", { className: "icon-cw" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Text mode" + (m ? " (T)" : ""),
                      for: "text",
                      id: this.props.mode === "text" ? "currentMode" : null,
                      onClick: function() {
                        return h.props.setMode("text");
                      }
                    },
                    (0, a.h)("i", { className: "icon-font" })
                  )
                ),
                (0, a.h)(
                  "li",
                  {
                    className: "grouping",
                    style: { display: this.props.mode === "build" && x === "all" && D ? "block" : "none" }
                  },
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Direction arrow" + (m ? " (←)" : ""),
                      onClick: function() {
                        return h.props.buildInput.direction_arrow.left();
                      }
                    },
                    (0, a.h)("i", { className: "icon-left-big" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Direction arrow" + (m ? " (→)" : ""),
                      onClick: function() {
                        return h.props.buildInput.direction_arrow.right();
                      }
                    },
                    (0, a.h)("i", { className: "icon-right-big" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Direction arrow" + (m ? " (↑)" : ""),
                      onClick: function() {
                        return h.props.buildInput.direction_arrow.up();
                      }
                    },
                    (0, a.h)("i", { className: "icon-up-big" })
                  ),
                  (0, a.h)(
                    "button",
                    {
                      className: "buttonGroup btn",
                      title: "Direction arrow" + (m ? " (↓)" : ""),
                      onClick: function() {
                        return h.props.buildInput.direction_arrow.down();
                      }
                    },
                    (0, a.h)("i", { className: "icon-down-big" })
                  )
                )
              );
            }, F;
          }(a.Component);
          O.default = j;
        },
        /* 71 */
        /***/
        function(Te, O, d) {
          var a = d(72);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 72 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .button-panel {
  position: absolute;
  left: 4px;
  top: 20%;
  margin-top: -32px;
  padding-left: 0;
  touch-action: none;
}

.escher-container .button-panel>li {
  margin-top: 5px;
  display: block;

  /* these sometimes get overridden */
  margin-left: 0 !important;
}

.escher-container .grouping {
  display: block;
}

.escher-container .buttonGroup {
  display: block;
  margin-bottom: -1px;
  padding: 5px 0px;
  border-radius: 0;
}

.escher-container .grouping>.buttonGroup:first-child {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.escher-container .grouping>.buttonGroup:last-child {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.escher-container .button-panel>.grouping:last-child {
  margin-top: 4px;
}

.escher-container #currentMode,
.escher-container .active-button {
  background-image: linear-gradient(#8F4F3F,#834c3c 6%,#8d3a2d) !important;
}

.escher-container .buttonGroup.btn {
  margin-top: -1px;
}

.escher-container .button {
  border-radius: 4px;
}

.escher-container .button.btn, .escher-container .buttonGroup.btn {
  padding: unset;
  color: white!important;
  border: 1px solid #474949;
  background-image: linear-gradient(#4F5151, #474949 6%, #3F4141);
  background-color: white;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  font-size: 14px!important;
  font-weight: 400;
  width: 40px;
  height: 40px;
}

.escher-container .button-panel .button:active, .escher-container .buttonGroup label:active, .escher-container .button-panel .buttonGroup:active {
  background-image: linear-gradient(#3F4141, #474949 6%, #4F5151);
}

.escher-container .button-panel .fa {
  font-size: 24px;
}

/* Icons */
.escher-container .button-panel [class^='icon-'] {
  font-size: 23px;
}
`, ""]);
        },
        /* 73 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(13), X = h(a), q = d(17), ee = h(q), j = d(36), t = h(j), F = d(4), M = h(F);
          function h(D) {
            return D && D.__esModule ? D : { default: D };
          }
          function x(D, H) {
            if (!(D instanceof H))
              throw new TypeError("Cannot call a class as a function");
          }
          var m = function() {
            function D(H, B, k, _, Q) {
              var o = this;
              x(this, D), this.div = H.append("div").attr("id", "tooltip-container"), this.tooltipRef = null, this.zoomContainer = k, this.setUpZoomCallbacks(k), this.callbackManager = new X.default(), this.div.on("mouseover", this.cancelHideTooltip.bind(this)), this.div.on("mouseleave", this.hide.bind(this)), this.map = _, this.setUpMapCallbacks(_), this.settings = Q, this.delay_hide_timeout = null, this.currentTooltip = null, (0, t.default)(B, null, function(W) {
                return o.callbackManager.set("pass_props", W);
              }, this.div.node(), function(W) {
                o.tooltipRef = W;
              }), this.passProps({
                display: !1,
                disableTooltips: function() {
                  return o.disableTooltips();
                }
              });
            }
            return D.prototype.disableTooltips = function() {
              this.settings.set("enable_tooltips", !1), this.map.draw_everything(), this.hide(), this.map.set_status(`Tooltips disabled. You can enable them again in the
                         settings menu.`, 3e3);
            }, D.prototype.passProps = function() {
              var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              this.callbackManager.run("pass_props", null, B);
            }, D.prototype.setUpMapCallbacks = function(B) {
              var k = this;
              this.placedDiv = (0, ee.default)(this.div, B, void 0, !1), B.callback_manager.set("show_tooltip.tooltip_container", function(_, Q) {
                k.show(_, Q);
              }), B.callback_manager.set("hide_tooltip.tooltip_container", function() {
                return k.hide();
              }), B.callback_manager.set("delay_hide_tooltip.tooltip_container", function() {
                return k.delayHide();
              }), B.sel.selectAll(".canvas-group").on("touchend", function() {
                return k.hide();
              });
            }, D.prototype.setUpZoomCallbacks = function(B) {
              B.callbackManager.set("zoom.tooltip_container", (function() {
                this.is_visible() && this.hide();
              }).bind(this)), B.callbackManager.set("go_to.tooltip_container", (function() {
                this.is_visible() && this.hide();
              }).bind(this));
            }, D.prototype.is_visible = function() {
              return this.placedDiv.is_visible();
            }, D.prototype.show = function(B, k) {
              if (this.cancelHideTooltip(), M.default.contains(["reaction_label", "node_label", "gene_label", "reaction_object", "node_object"], B)) {
                var _ = this.tooltipRef !== null && this.tooltipRef.get_size ? this.tooltipRef.get_size() : { width: 270, height: 100 };
                this.currentTooltip = { type: B, id: k[B.replace("_label", "_id").replace("_object", "_id")] };
                var Q = this.zoomContainer.windowTranslate, o = this.zoomContainer.windowScale, W = this.map !== null ? this.map.get_size() : { width: 1e3, height: 1e3 }, y = { x: 0, y: 0 }, v = B === "reaction_object" ? k.xPos : k.label_x, T = B === "reaction_object" ? k.yPos : k.label_y, n = o * v + Q.x + _.width, r = o * T + Q.y + _.height;
                W.width < 500 ? (n > W.width && (y.x = -(n - W.width) / o), r > W.height - 74 && (y.y = -(r - W.height + 77) / o)) : (o * v + Q.x + 0.5 * _.width > W.width ? y.x = -_.width / o : n > W.width && (y.x = -(n - W.width) / o), o * T + Q.y + 0.5 * _.height > W.height - 45 ? y.y = -_.height / o : r > W.height - 45 && (y.y = -(r - W.height + 47) / o));
                var b = { x: v + y.x, y: T + 10 + y.y };
                this.placedDiv.place(b), this.passProps({
                  display: !0,
                  biggId: k.bigg_id,
                  name: k.name,
                  loc: b,
                  data: k.data_string,
                  type: B.replace("_label", "").replace("node", "metabolite").replace("_object", "")
                });
              } else
                throw new Error("Tooltip not supported for object type " + B);
            }, D.prototype.hide = function() {
              this.placedDiv.hide(), this.currentTooltip = null;
            }, D.prototype.delayHide = function() {
              var B = this;
              this.delayHideTimeout = setTimeout(function() {
                return B.hide();
              }, 100);
            }, D.prototype.cancelHideTooltip = function() {
              this.delayHideTimeout !== null && clearTimeout(this.delayHideTimeout);
            }, D;
          }();
          O.default = m;
        },
        /* 74 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0;
          var a = d(5);
          d(75);
          var X = d(3), q = ee(X);
          function ee(h) {
            if (h && h.__esModule)
              return h;
            var x = {};
            if (h != null)
              for (var m in h)
                Object.prototype.hasOwnProperty.call(h, m) && (x[m] = h[m]);
            return x.default = h, x;
          }
          function j(h, x) {
            if (!(h instanceof x))
              throw new TypeError("Cannot call a class as a function");
          }
          function t(h, x) {
            if (!h)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return x && (typeof x == "object" || typeof x == "function") ? x : h;
          }
          function F(h, x) {
            if (typeof x != "function" && x !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof x);
            h.prototype = Object.create(x && x.prototype, { constructor: { value: h, enumerable: !1, writable: !0, configurable: !0 } }), x && (Object.setPrototypeOf ? Object.setPrototypeOf(h, x) : h.__proto__ = x);
          }
          var M = function(h) {
            F(x, h);
            function x() {
              j(this, x);
              var m = t(this, h.call(this));
              return m.openBigg = m.openBigg.bind(m), m;
            }
            return x.prototype.decompartmentalizeCheck = function(D, H) {
              return H === "metabolite" ? q.decompartmentalize(D)[0] : D;
            }, x.prototype.openBigg = function() {
              var D = this.props.type, H = this.props.biggId, B = "http://bigg.ucsd.edu/", k = D === "gene" ? B + "search?query=" + H : B + "universal/" + D + "s/" + this.decompartmentalizeCheck(H, D);
              window.open(k);
            }, x.prototype.capitalizeFirstLetter = function(D) {
              return typeof D == "string" ? D.charAt(0).toUpperCase() + D.slice(1) : console.warn("capitalizeFirstLetter was passed something other than a string");
            }, x.prototype.render = function() {
              var D = this.decompartmentalizeCheck(this.props.biggId, this.props.type), H = "Open " + D + " in BiGG Models.";
              return (0, a.h)(
                "div",
                { className: "default-tooltip" },
                (0, a.h)(
                  "div",
                  { className: "id" },
                  this.props.biggId
                ),
                (0, a.h)(
                  "div",
                  { className: "name" },
                  "name: ",
                  this.props.name
                ),
                (0, a.h)(
                  "div",
                  { className: "data" },
                  "data: ",
                  this.props.data && this.props.data !== "(nd)" ? this.props.data : "no data"
                ),
                (0, a.h)(
                  "button",
                  { onClick: this.openBigg },
                  H
                ),
                (0, a.h)(
                  "div",
                  { className: "top-right" },
                  (0, a.h)(
                    "div",
                    { className: "type-label" },
                    this.capitalizeFirstLetter(this.props.type)
                  ),
                  (0, a.h)(
                    "a",
                    { onClick: this.props.disableTooltips },
                    "Disable Tooltips"
                  )
                )
              );
            }, x;
          }(a.Component);
          O.default = M;
        },
        /* 75 */
        /***/
        function(Te, O, d) {
          var a = d(76);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 76 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `.escher-container .default-tooltip {
  box-sizing: border-box;
  min-width: 300px;
  min-height: 100px;
  border-radius: 2px;
  border: 1px solid #b58787;
  padding: 7px;
  background-color: #fff;
  text-align: left;
  font-size: 16px;
  font-family: sans-serif;
  color: #111;
  box-shadow: 4px 6px 20px 0px rgba(0, 0, 0, 0.4);
}

.escher-container .default-tooltip .id{
  font-size: 18px;
  font-weight: bold;
}

.escher-container .default-tooltip button {
  border-radius: 3px;
  background-color: #eee;
  border: 1px solid #ddd;
  margin-top: 4px;
  font-size: 16px;
  padding: 3px 6px;
}

.escher-container .default-tooltip .top-right {
  position: absolute;
  top: 4px;
  right: 4px;
}

.escher-container .default-tooltip .top-right * {
  float: right;
  text-align: right;
}

.escher-container .default-tooltip .top-right a {
  font-size: 11px;
  color: #999;
  cursor: pointer;
}
.escher-container .default-tooltip .top-right a:hover {
  color: #444;
  text-decoration: underline;
}

.escher-container .default-tooltip .type-label {
  font-size: 15px;
  color: #d27066;
  background-color: #ffeded;
  border-radius: 2px;
  margin: 0 0 0 10px;
  padding: 0 5px;
}
`, ""]);
        },
        /* 77 */
        /***/
        function(Te, O, d) {
          var a = d(78);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 78 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1);
          var a = d(79), X = a(d(37)), q = a(d(37) + "#iefix"), ee = a(d(80)), j = a(d(81)), t = a(d(82)), F = a(d(83) + "#fontello");
          O.push([Te.i, `@font-face {
  font-family: 'fontello';
  src: url(` + X + `);
  src: url(` + q + `) format('embedded-opentype'),
       url(` + ee + `) format('woff2'),
       url(` + j + `) format('woff'),
       url(` + t + `) format('truetype'),
       url(` + F + `) format('svg');
  font-weight: normal;
  font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
  @font-face {
    font-family: 'fontello';
    src: url('../font/fontello.svg?9130959#fontello') format('svg');
  }
}
*/
 
 [class^="icon-"]:before, [class*=" icon-"]:before {
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  speak: none;
 
  display: inline-block;
  text-decoration: inherit;
  width: 1em;
  margin-right: .2em;
  text-align: center;
  /* opacity: .8; */
 
  /* For safety - reset parent styles, that can break glyph codes*/
  font-variant: normal;
  text-transform: none;
 
  /* fix buttons height, for twitter bootstrap */
  line-height: 1em;
 
  /* Animation center compensation - margins should be symmetric */
  /* remove if not needed */
  margin-left: .2em;
 
  /* you can be more comfortable with increased icons size */
  /* font-size: 120%; */
 
  /* Font smoothing. That was taken from TWBS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
 
  /* Uncomment for 3D effect */
  /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
 
.icon-ok:before { content: '\\e800'; } /* '' */
.icon-cancel:before { content: '\\e801'; } /* '' */
.icon-plus:before { content: '\\e802'; } /* '' */
.icon-down-big:before { content: '\\e803'; } /* '' */
.icon-left-big:before { content: '\\e804'; } /* '' */
.icon-right-big:before { content: '\\e805'; } /* '' */
.icon-up-big:before { content: '\\e806'; } /* '' */
.icon-left-open:before { content: '\\e807'; } /* '' */
.icon-right-open:before { content: '\\e808'; } /* '' */
.icon-wrench:before { content: '\\e809'; } /* '' */
.icon-resize-full:before { content: '\\e80a'; } /* '' */
.icon-cw:before { content: '\\e80b'; } /* '' */
.icon-trash-empty:before { content: '\\e80e'; } /* '' */
.icon-font:before { content: '\\e80f'; } /* '' */
.icon-zoom-in:before { content: '\\e810'; } /* '' */
.icon-zoom-out:before { content: '\\e811'; } /* '' */
.icon-move:before { content: '\\f047'; } /* '' */
.icon-resize-full-alt:before { content: '\\f0b2'; } /* '' */
.icon-blank:before { content: '\\f0c8'; } /* '' */
.icon-sort-down:before { content: '\\f0dd'; } /* '' */
.icon-mouse-pointer:before { content: '\\f245'; } /* '' */`, ""]);
        },
        /* 79 */
        /***/
        function(Te, O, d) {
          Te.exports = function(a, X) {
            return typeof a != "string" ? a : (/^['"].*['"]$/.test(a) && (a = a.slice(1, -1)), /["'() \t\n]/.test(a) || X ? '"'.concat(a.replace(/"/g, '\\"').replace(/\n/g, "\\n"), '"') : a);
          };
        },
        /* 80 */
        /***/
        function(Te, O) {
          Te.exports = "data:application/font-woff2;base64, ";
        },
        /* 81 */
        /***/
        function(Te, O) {
          Te.exports = "data:application/font-woff;base64, ";
        },
        /* 82 */
        /***/
        function(Te, O) {
          Te.exports = "data:application/octet-stream;base64, ";
        },
        /* 83 */
        /***/
        function(Te, O) {
          Te.exports = "data:image/svg+xml;base64, ";
        },
        /* 84 */
        /***/
        function(Te, O, d) {
          var a = d(85);
          typeof a == "string" && (a = [[Te.i, a, ""]]);
          var X, q = { hmr: !0 };
          q.transform = X, q.insertInto = void 0, d(10)(a, q), a.locals && (Te.exports = a.locals);
        },
        /* 85 */
        /***/
        function(Te, O, d) {
          O = Te.exports = d(9)(!1), O.push([Te.i, `/* Containers */

/* The top level container for an Escher Builder */
.escher-container {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  background-color: #F3F3F3;
  text-align: center;
  position: relative;
  font-size: 14px;
  color: #333333;
}

/* Applied to the body when Escher fills the screen. This stops browser from
showing scroll-end animations. */
html.fill-screen {
  height: 100%;
  width: 100%;
}
body.fill-screen {
  margin: 0;
  position: relative;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* Applied to top level container (generally .escher-container) when Escher
fills the screen. These make sure Escher completely fills the screen, even after
resizes. */
.fill-screen-div {
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  width: 100% !important;
  height: 100% !important;
  z-index: 1000;
}

/* The zoom container classes. */
.escher-container .escher-zoom-container,
.escher-container .escher-3d-transform-container,
.escher-container svg.escher-svg {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
}

/* SVG text should not be selectable */
.escher-container svg text {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Status */
.escher-container #status {
  position:absolute;
  bottom:10px;
  left: 20px;
  color: red;
  background-color: white;
  font-size: 16px
}

/* Search & Menu */
.escher-container .search-menu-container {
  position: absolute;
  width: 100%;
  top: 0px;
  left: 0px;
  margin: 0;
  text-align: center;
  pointer-events: none;
}
.escher-container .search-menu-container-inline {
  box-sizing: border-box;
  width: 320px;
  display: inline-block;
  text-align: left;
  pointer-events: auto;
}
@media (min-width: 550px) {
  .escher-container .search-menu-container-inline {
    width: 410px;
  }
}

/* Reaction input */
.escher-container #rxn-input {
  z-index: 10;
  width: 200px;
}
.escher-container .input-close-button {
  position: absolute;
  right: 0px;
  width: 18px;
  bottom: 0px;
  padding: 0px;
  border-width: 0px;
  margin: 0px;
  background: none;
  font-size: 20px;
  font-weight: normal;
  top: -8px;
}
.escher-container .input-close-button:hover {
  color: #ff3333;
  font-weight: bold;
}

/* text edit input */
.escher-container #text-edit-input input {
  width: 500px;
  border: 1px solid #cccccc;
  font-size: 22px;
}

.escher-container #tooltip-container {
  -ms-touch-action: none;
  touch-action: none;
}

/* Buttons */
.escher-container .btn {
  color: white!important;
  border: 1px solid #2E2F2F;
  background-image: linear-gradient(#4F5151, #474949 6%, #3F4141);
  background-color: white;
  cursor: pointer;
}

.escher-container .btn:active {
  background-image: linear-gradient(#3F4141, #474949 6%, #4F5151);
}
`, ""]);
        },
        /* 86 */
        /***/
        function(Te, O, d) {
          d.r(O), O.default = `svg.escher-svg #mouse-node {
  fill: none;
}
svg.escher-svg #canvas {
  stroke: #ccc;
  stroke-width: 7px;
  fill: white;
}
svg.escher-svg .resize-rect {
  fill: black;
  opacity: 0;
  stroke: none;
}
svg.escher-svg .label {
  font-family: sans-serif;
  font-style: italic;
  font-weight: bold;
  font-size: 8px;
  fill: black;
  stroke: none;
  text-rendering: optimizelegibility;
  cursor: default;
}
svg.escher-svg .reaction-label {
  font-size: 30px;
  fill: rgb(32, 32, 120);
  text-rendering: optimizelegibility;
}
svg.escher-svg .node-label {
  font-size: 20px;
}
svg.escher-svg .gene-label {
  font-size: 18px;
  fill: rgb(32, 32, 120);
  text-rendering: optimizelegibility;
  cursor: default;
}
svg.escher-svg .text-label .label {
  font-size: 50px;
}
svg.escher-svg .text-label-input {
  font-size: 50px;
}
svg.escher-svg .node-circle {
  stroke-width: 2px;
}
svg.escher-svg .midmarker-circle, svg.escher-svg .multimarker-circle {
  fill: white;
  fill-opacity: 0.2;
  stroke: rgb(50, 50, 50);
}
svg.escher-svg g.selected .node-circle{
  stroke-width: 6px;
  stroke: rgb(20, 113, 199);
}
svg.escher-svg g.selected .label {
  fill: rgb(20, 113, 199);
}
svg.escher-svg .metabolite-circle {
  stroke: rgb(162, 69, 16);
  fill: rgb(224, 134, 91);
}
svg.escher-svg g.selected .metabolite-circle {
  stroke: rgb(5, 2, 0);
}
svg.escher-svg .segment {
  stroke: #334E75;
  stroke-width: 10px;
  fill: none;
}
svg.escher-svg .arrowhead {
  fill: #334E75;
}
svg.escher-svg .stoichiometry-label-rect {
  fill: white;
  opacity: 0.5;
}
svg.escher-svg .stoichiometry-label {
  fill: #334E75;
  font-size: 17px;
}
svg.escher-svg .membrane {
  fill: none;
  stroke: rgb(255, 187, 0);
}
svg.escher-svg .brush .extent {
  fill-opacity: 0.1;
  fill: black;
  stroke: #fff;
  shape-rendering: crispEdges;
}
svg.escher-svg #brush-container .background {
  fill: none;
}
svg.escher-svg .bezier-circle {
  fill: rgb(255,255,255);
}
svg.escher-svg .bezier-circle.b1 {
  stroke: red;
}
svg.escher-svg .bezier-circle.b2 {
  stroke: blue;
}
svg.escher-svg .connect-line{
  stroke: rgb(200,200,200);
}
svg.escher-svg .direction-arrow {
  cursor: default;
  stroke: black;
  stroke-width: 1px;
  fill: white;
  opacity: 0.3;
}
svg.escher-svg .start-reaction-target {
  stroke: rgb(100,100,100);
  fill: none;
  opacity: 0.5;
}
svg.escher-svg .rotation-center-line {
  stroke: red;
  stroke-width: 5px;
}
svg.escher-svg .highlight {
  fill: #D97000;
  text-decoration: underline;
}
svg.escher-svg .node-to-combine {
  stroke-width: 12px !important;
}
`;
        },
        /* 87 */
        /***/
        function(Te, O, d) {
          var a = d(3), X = d(16).json;
          Te.exports = function(q) {
            var ee = a.set_options(q, {
              selection: null,
              getdatafiles: null,
              datafiles: null,
              update_callback: null,
              target: null
            });
            if (ee.selection === null)
              throw new Error("No selection provided for DataMenu");
            var j = ee.selection.select(".data-menu");
            j.empty() && (j = ee.selection.append("div").attr("class", "data-menu"));
            var t = j.append("form").append("select").attr("class", "dropdown-menu");
            return ee.getdatafiles ? (ee.datafiles && console.warn("DataMenu: getdatafiles option overrides datafiles"), X(ee.getdatafiles, function(x, m) {
              return x ? console.warn(x) : (F(ee.target, m.data, t, ee.update_callback, ee.selection), null);
            })) : ee.datafiles ? F(ee.target, ee.datafiles, t, ee.update_callback, ee.selection) : console.warn("DataMenu: No datafiles given"), { update: h };
            function F(x, m, D, H, B) {
              D.node().addEventListener("change", function() {
                M(x, this.value, B, H);
              }, !1);
              var k = m[0];
              h(m, D), M(x, k, B, H);
            }
            function M(x, m, D, H) {
              a.load_the_file(x, m, function(B, k) {
                if (B)
                  return console.warn(B);
                ee.data = k, H && H(k);
              });
            }
            function h(x, m) {
              m.selectAll(".menu-option").data(x).enter().append("option").attr("value", function(D) {
                return D;
              }).text(function(D) {
                return D;
              }), m.node().focus();
            }
          };
        },
        /* 88 */
        /***/
        function(Te, O, d) {
          O.__esModule = !0, O.EscherMapModel = O.EscherMapView = void 0;
          var a = d(20), X = t(a), q = d(0), ee = d(4), j = t(ee);
          function t(_) {
            return _ && _.__esModule ? _ : { default: _ };
          }
          function F(_, Q) {
            if (!(_ instanceof Q))
              throw new TypeError("Cannot call a class as a function");
          }
          function M(_, Q) {
            if (!_)
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return Q && (typeof Q == "object" || typeof Q == "function") ? Q : _;
          }
          function h(_, Q) {
            if (typeof Q != "function" && Q !== null)
              throw new TypeError("Super expression must either be null or a function, not " + typeof Q);
            _.prototype = Object.create(Q && Q.prototype, { constructor: { value: _, enumerable: !1, writable: !0, configurable: !0 } }), Q && (Object.setPrototypeOf ? Object.setPrototypeOf(_, Q) : _.__proto__ = Q);
          }
          O.EscherMapView = null, O.EscherMapModel = null;
          var x = void 0;
          try {
            x = d(89);
          } catch {
          }
          if (x) {
            var m = "1.7.3", D = [
              "menu",
              "scroll_behavior",
              "use_3d_transform",
              "enable_editing",
              "enable_keys",
              "full_screen_button",
              // these already redraw
              "reaction_data",
              "metabolite_data",
              "gene_data"
            ], H = {
              reaction_data: "set_reaction_data",
              metabolite_data: "set_metabolite_data",
              gene_data: "set_gene_data"
              /**
               * Jupyter widget implementation for the Escher Builder.
               */
              // eslint-disable-next-line no-unused-vars
            }, B = function(_) {
              h(Q, _);
              function Q() {
                return F(this, Q), M(this, _.apply(this, arguments));
              }
              return Q.prototype.render = function() {
                var W = this;
                if (!x)
                  throw Error("@jupyter-widgets/base not installed. You must install it to use the jupyter widget");
                var y = (0, q.select)(this.el).append("div");
                this.setHeight(y), j.default.defer(function() {
                  W.builder = new X.default(W.getMapData(), W.getModelData(), W.model.get("embedded_css"), y, {
                    first_load_callback: function(T) {
                      T.callback_manager.set("clear_map", function() {
                        W.model.set("_loaded_map_json", null), W.model.save_changes();
                      }), T.callback_manager.set("clear_model", function() {
                        W.model.set("_loaded_model_json", null), W.model.save_changes();
                      }), W.model.on("change:height", function() {
                        W.setHeight(y);
                      }), W.model.on("change:_loaded_map_json", function() {
                        T.load_map(W.getMapData());
                      }), W.model.on("change:_loaded_model_json", function() {
                        T.load_model(W.getModelData());
                      }), j.default.mapObject(T.settings.acceptedStreams, function(n, r) {
                        if (W.model.keys().includes(r)) {
                          var b = W.model.get(r);
                          b !== null ? r in H ? T[H[r]](b) : T.settings.set(r, b) : (W.model.set(r, T.settings.get(r)), W.model.save_changes()), W.model.on("change:" + r, function() {
                            var C = W.model.get(r);
                            j.default.isEqual(C, T.settings.get(r)) || (r in H ? T[H[r]](C) : T.settings.set(r, C), D.includes(r) || T.map.draw_everything());
                          });
                        }
                        n.onValue(function(C) {
                          j.default.isEqual(C, W.model.get(r)) || (W.model.set(r, C), W.model.save_changes());
                        });
                      }), T.map.draw_everything();
                    }
                  });
                });
              }, Q.prototype.setHeight = function(W) {
                W.style("height", this.model.get("height") + "px");
              }, Q.prototype.getMapData = function() {
                var W = this.model.get("_loaded_map_json");
                return W ? JSON.parse(W) : null;
              }, Q.prototype.getModelData = function() {
                var W = this.model.get("_loaded_model_json");
                return W ? JSON.parse(W) : null;
              }, Q;
            }(x.DOMWidgetView), k = function(_) {
              h(Q, _);
              function Q() {
                return F(this, Q), M(this, _.apply(this, arguments));
              }
              return Q.prototype.defaults = function() {
                return j.default.extend(_.prototype.defaults.call(this), {
                  _model_name: "EscherMapModel",
                  _view_name: "EscherMapView",
                  _model_module: "escher",
                  _view_module: "escher",
                  _model_module_version: m,
                  _view_module_version: m
                });
              }, Q;
            }(x.DOMWidgetModel);
            O.EscherMapView = B, O.EscherMapModel = k;
          }
        },
        /* 89 */
        /***/
        function(Te, O) {
          if (typeof tn > "u") {
            var d = new Error("Cannot find module '@jupyter-widgets/base'");
            throw d.code = "MODULE_NOT_FOUND", d;
          }
          Te.exports = tn;
        },
        /* 90 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = function(l, I) {
            return l < I ? -1 : l > I ? 1 : l >= I ? 0 : NaN;
          }, X = function(l) {
            return l.length === 1 && (l = q(l)), {
              left: function(I, pe, Me, Se) {
                for (Me == null && (Me = 0), Se == null && (Se = I.length); Me < Se; ) {
                  var De = Me + Se >>> 1;
                  l(I[De], pe) < 0 ? Me = De + 1 : Se = De;
                }
                return Me;
              },
              right: function(I, pe, Me, Se) {
                for (Me == null && (Me = 0), Se == null && (Se = I.length); Me < Se; ) {
                  var De = Me + Se >>> 1;
                  l(I[De], pe) > 0 ? Se = De : Me = De + 1;
                }
                return Me;
              }
            };
          };
          function q(l) {
            return function(I, pe) {
              return a(l(I), pe);
            };
          }
          var ee = X(a), j = ee.right, t = j, F = function(l) {
            return l === null ? NaN : +l;
          }, M = function(l, I, pe) {
            l = +l, I = +I, pe = (Se = arguments.length) < 2 ? (I = l, l = 0, 1) : Se < 3 ? 1 : +pe;
            for (var Me = -1, Se = Math.max(0, Math.ceil((I - l) / pe)) | 0, De = new Array(Se); ++Me < Se; )
              De[Me] = l + Me * pe;
            return De;
          }, h = Math.sqrt(50), x = Math.sqrt(10), m = Math.sqrt(2), D = function(l, I, pe) {
            var Me, Se = -1, De, Le, Ue;
            if (I = +I, l = +l, pe = +pe, l === I && pe > 0)
              return [l];
            if ((Me = I < l) && (De = l, l = I, I = De), (Ue = H(l, I, pe)) === 0 || !isFinite(Ue))
              return [];
            if (Ue > 0)
              for (l = Math.ceil(l / Ue), I = Math.floor(I / Ue), Le = new Array(De = Math.ceil(I - l + 1)); ++Se < De; )
                Le[Se] = (l + Se) * Ue;
            else
              for (l = Math.floor(l * Ue), I = Math.ceil(I * Ue), Le = new Array(De = Math.ceil(l - I + 1)); ++Se < De; )
                Le[Se] = (l - Se) / Ue;
            return Me && Le.reverse(), Le;
          };
          function H(l, I, pe) {
            var Me = (I - l) / Math.max(0, pe), Se = Math.floor(Math.log(Me) / Math.LN10), De = Me / Math.pow(10, Se);
            return Se >= 0 ? (De >= h ? 10 : De >= x ? 5 : De >= m ? 2 : 1) * Math.pow(10, Se) : -Math.pow(10, -Se) / (De >= h ? 10 : De >= x ? 5 : De >= m ? 2 : 1);
          }
          function B(l, I, pe) {
            var Me = Math.abs(I - l) / Math.max(0, pe), Se = Math.pow(10, Math.floor(Math.log(Me) / Math.LN10)), De = Me / Se;
            return De >= h ? Se *= 10 : De >= x ? Se *= 5 : De >= m && (Se *= 2), I < l ? -Se : Se;
          }
          var k = function(l, I, pe) {
            if (pe == null && (pe = F), !!(Me = l.length)) {
              if ((I = +I) <= 0 || Me < 2)
                return +pe(l[0], 0, l);
              if (I >= 1)
                return +pe(l[Me - 1], Me - 1, l);
              var Me, Se = (Me - 1) * I, De = Math.floor(Se), Le = +pe(l[De], De, l), Ue = +pe(l[De + 1], De + 1, l);
              return Le + (Ue - Le) * (Se - De);
            }
          }, _ = d(15), Q = Array.prototype, o = Q.map, W = Q.slice, y = { name: "implicit" };
          function v(l) {
            var I = Object(_.a)(), pe = [], Me = y;
            l = l == null ? [] : W.call(l);
            function Se(De) {
              var Le = De + "", Ue = I.get(Le);
              if (!Ue) {
                if (Me !== y)
                  return Me;
                I.set(Le, Ue = pe.push(De));
              }
              return l[(Ue - 1) % l.length];
            }
            return Se.domain = function(De) {
              if (!arguments.length)
                return pe.slice();
              pe = [], I = Object(_.a)();
              for (var Le = -1, Ue = De.length, Pe, ft; ++Le < Ue; )
                I.has(ft = (Pe = De[Le]) + "") || I.set(ft, pe.push(Pe));
              return Se;
            }, Se.range = function(De) {
              return arguments.length ? (l = W.call(De), Se) : l.slice();
            }, Se.unknown = function(De) {
              return arguments.length ? (Me = De, Se) : Me;
            }, Se.copy = function() {
              return v().domain(pe).range(l).unknown(Me);
            }, Se;
          }
          function T() {
            var l = v().unknown(void 0), I = l.domain, pe = l.range, Me = [0, 1], Se, De, Le = !1, Ue = 0, Pe = 0, ft = 0.5;
            delete l.unknown;
            function Mt() {
              var it = I().length, Lt = Me[1] < Me[0], Qt = Me[Lt - 0], Ft = Me[1 - Lt];
              Se = (Ft - Qt) / Math.max(1, it - Ue + Pe * 2), Le && (Se = Math.floor(Se)), Qt += (Ft - Qt - Se * (it - Ue)) * ft, De = Se * (1 - Ue), Le && (Qt = Math.round(Qt), De = Math.round(De));
              var zt = M(it).map(function(rn) {
                return Qt + Se * rn;
              });
              return pe(Lt ? zt.reverse() : zt);
            }
            return l.domain = function(it) {
              return arguments.length ? (I(it), Mt()) : I();
            }, l.range = function(it) {
              return arguments.length ? (Me = [+it[0], +it[1]], Mt()) : Me.slice();
            }, l.rangeRound = function(it) {
              return Me = [+it[0], +it[1]], Le = !0, Mt();
            }, l.bandwidth = function() {
              return De;
            }, l.step = function() {
              return Se;
            }, l.round = function(it) {
              return arguments.length ? (Le = !!it, Mt()) : Le;
            }, l.padding = function(it) {
              return arguments.length ? (Ue = Pe = Math.max(0, Math.min(1, it)), Mt()) : Ue;
            }, l.paddingInner = function(it) {
              return arguments.length ? (Ue = Math.max(0, Math.min(1, it)), Mt()) : Ue;
            }, l.paddingOuter = function(it) {
              return arguments.length ? (Pe = Math.max(0, Math.min(1, it)), Mt()) : Pe;
            }, l.align = function(it) {
              return arguments.length ? (ft = Math.max(0, Math.min(1, it)), Mt()) : ft;
            }, l.copy = function() {
              return T().domain(I()).range(Me).round(Le).paddingInner(Ue).paddingOuter(Pe).align(ft);
            }, Mt();
          }
          function n(l) {
            var I = l.copy;
            return l.padding = l.paddingOuter, delete l.paddingInner, delete l.paddingOuter, l.copy = function() {
              return n(I());
            }, l;
          }
          function r() {
            return n(T().paddingInner(1));
          }
          var b = d(2), C = function(l) {
            return function() {
              return l;
            };
          }, ne = function(l) {
            return +l;
          }, ge = [0, 1];
          function ce(l, I) {
            return (I -= l = +l) ? function(pe) {
              return (pe - l) / I;
            } : C(I);
          }
          function xe(l) {
            return function(I, pe) {
              var Me = l(I = +I, pe = +pe);
              return function(Se) {
                return Se <= I ? 0 : Se >= pe ? 1 : Me(Se);
              };
            };
          }
          function fe(l) {
            return function(I, pe) {
              var Me = l(I = +I, pe = +pe);
              return function(Se) {
                return Se <= 0 ? I : Se >= 1 ? pe : Me(Se);
              };
            };
          }
          function Ce(l, I, pe, Me) {
            var Se = l[0], De = l[1], Le = I[0], Ue = I[1];
            return De < Se ? (Se = pe(De, Se), Le = Me(Ue, Le)) : (Se = pe(Se, De), Le = Me(Le, Ue)), function(Pe) {
              return Le(Se(Pe));
            };
          }
          function he(l, I, pe, Me) {
            var Se = Math.min(l.length, I.length) - 1, De = new Array(Se), Le = new Array(Se), Ue = -1;
            for (l[Se] < l[0] && (l = l.slice().reverse(), I = I.slice().reverse()); ++Ue < Se; )
              De[Ue] = pe(l[Ue], l[Ue + 1]), Le[Ue] = Me(I[Ue], I[Ue + 1]);
            return function(Pe) {
              var ft = t(l, Pe, 1, Se) - 1;
              return Le[ft](De[ft](Pe));
            };
          }
          function le(l, I) {
            return I.domain(l.domain()).range(l.range()).interpolate(l.interpolate()).clamp(l.clamp());
          }
          function G(l, I) {
            var pe = ge, Me = ge, Se = b.a, De = !1, Le, Ue, Pe;
            function ft() {
              return Le = Math.min(pe.length, Me.length) > 2 ? he : Ce, Ue = Pe = null, Mt;
            }
            function Mt(it) {
              return (Ue || (Ue = Le(pe, Me, De ? xe(l) : l, Se)))(+it);
            }
            return Mt.invert = function(it) {
              return (Pe || (Pe = Le(Me, pe, ce, De ? fe(I) : I)))(+it);
            }, Mt.domain = function(it) {
              return arguments.length ? (pe = o.call(it, ne), ft()) : pe.slice();
            }, Mt.range = function(it) {
              return arguments.length ? (Me = W.call(it), ft()) : Me.slice();
            }, Mt.rangeRound = function(it) {
              return Me = W.call(it), Se = b.e, ft();
            }, Mt.clamp = function(it) {
              return arguments.length ? (De = !!it, ft()) : De;
            }, Mt.interpolate = function(it) {
              return arguments.length ? (Se = it, ft()) : Se;
            }, ft();
          }
          var P = d(6), $ = function(l, I, pe) {
            var Me = l[0], Se = l[l.length - 1], De = B(Me, Se, I ?? 10), Le;
            switch (pe = Object(P.formatSpecifier)(pe ?? ",f"), pe.type) {
              case "s": {
                var Ue = Math.max(Math.abs(Me), Math.abs(Se));
                return pe.precision == null && !isNaN(Le = Object(P.precisionPrefix)(De, Ue)) && (pe.precision = Le), Object(P.formatPrefix)(pe, Ue);
              }
              case "":
              case "e":
              case "g":
              case "p":
              case "r": {
                pe.precision == null && !isNaN(Le = Object(P.precisionRound)(De, Math.max(Math.abs(Me), Math.abs(Se)))) && (pe.precision = Le - (pe.type === "e"));
                break;
              }
              case "f":
              case "%": {
                pe.precision == null && !isNaN(Le = Object(P.precisionFixed)(De)) && (pe.precision = Le - (pe.type === "%") * 2);
                break;
              }
            }
            return Object(P.format)(pe);
          };
          function E(l) {
            var I = l.domain;
            return l.ticks = function(pe) {
              var Me = I();
              return D(Me[0], Me[Me.length - 1], pe ?? 10);
            }, l.tickFormat = function(pe, Me) {
              return $(I(), pe, Me);
            }, l.nice = function(pe) {
              pe == null && (pe = 10);
              var Me = I(), Se = 0, De = Me.length - 1, Le = Me[Se], Ue = Me[De], Pe;
              return Ue < Le && (Pe = Le, Le = Ue, Ue = Pe, Pe = Se, Se = De, De = Pe), Pe = H(Le, Ue, pe), Pe > 0 ? (Le = Math.floor(Le / Pe) * Pe, Ue = Math.ceil(Ue / Pe) * Pe, Pe = H(Le, Ue, pe)) : Pe < 0 && (Le = Math.ceil(Le * Pe) / Pe, Ue = Math.floor(Ue * Pe) / Pe, Pe = H(Le, Ue, pe)), Pe > 0 ? (Me[Se] = Math.floor(Le / Pe) * Pe, Me[De] = Math.ceil(Ue / Pe) * Pe, I(Me)) : Pe < 0 && (Me[Se] = Math.ceil(Le * Pe) / Pe, Me[De] = Math.floor(Ue * Pe) / Pe, I(Me)), l;
            }, l;
          }
          function V() {
            var l = G(ce, b.c);
            return l.copy = function() {
              return le(l, V());
            }, E(l);
          }
          function ie() {
            var l = [0, 1];
            function I(pe) {
              return +pe;
            }
            return I.invert = I, I.domain = I.range = function(pe) {
              return arguments.length ? (l = o.call(pe, ne), I) : l.slice();
            }, I.copy = function() {
              return ie().domain(l);
            }, E(I);
          }
          var ae = function(l, I) {
            l = l.slice();
            var pe = 0, Me = l.length - 1, Se = l[pe], De = l[Me], Le;
            return De < Se && (Le = pe, pe = Me, Me = Le, Le = Se, Se = De, De = Le), l[pe] = I.floor(Se), l[Me] = I.ceil(De), l;
          };
          function K(l, I) {
            return (I = Math.log(I / l)) ? function(pe) {
              return Math.log(pe / l) / I;
            } : C(I);
          }
          function s(l, I) {
            return l < 0 ? function(pe) {
              return -Math.pow(-I, pe) * Math.pow(-l, 1 - pe);
            } : function(pe) {
              return Math.pow(I, pe) * Math.pow(l, 1 - pe);
            };
          }
          function g(l) {
            return isFinite(l) ? +("1e" + l) : l < 0 ? 0 : l;
          }
          function U(l) {
            return l === 10 ? g : l === Math.E ? Math.exp : function(I) {
              return Math.pow(l, I);
            };
          }
          function Y(l) {
            return l === Math.E ? Math.log : l === 10 && Math.log10 || l === 2 && Math.log2 || (l = Math.log(l), function(I) {
              return Math.log(I) / l;
            });
          }
          function p(l) {
            return function(I) {
              return -l(-I);
            };
          }
          function w() {
            var l = G(K, s).domain([1, 10]), I = l.domain, pe = 10, Me = Y(10), Se = U(10);
            function De() {
              return Me = Y(pe), Se = U(pe), I()[0] < 0 && (Me = p(Me), Se = p(Se)), l;
            }
            return l.base = function(Le) {
              return arguments.length ? (pe = +Le, De()) : pe;
            }, l.domain = function(Le) {
              return arguments.length ? (I(Le), De()) : I();
            }, l.ticks = function(Le) {
              var Ue = I(), Pe = Ue[0], ft = Ue[Ue.length - 1], Mt;
              (Mt = ft < Pe) && (it = Pe, Pe = ft, ft = it);
              var it = Me(Pe), Lt = Me(ft), Qt, Ft, zt, rn = Le == null ? 10 : +Le, $t = [];
              if (!(pe % 1) && Lt - it < rn) {
                if (it = Math.round(it) - 1, Lt = Math.round(Lt) + 1, Pe > 0) {
                  for (; it < Lt; ++it)
                    for (Ft = 1, Qt = Se(it); Ft < pe; ++Ft)
                      if (zt = Qt * Ft, !(zt < Pe)) {
                        if (zt > ft)
                          break;
                        $t.push(zt);
                      }
                } else
                  for (; it < Lt; ++it)
                    for (Ft = pe - 1, Qt = Se(it); Ft >= 1; --Ft)
                      if (zt = Qt * Ft, !(zt < Pe)) {
                        if (zt > ft)
                          break;
                        $t.push(zt);
                      }
              } else
                $t = D(it, Lt, Math.min(Lt - it, rn)).map(Se);
              return Mt ? $t.reverse() : $t;
            }, l.tickFormat = function(Le, Ue) {
              if (Ue == null && (Ue = pe === 10 ? ".0e" : ","), typeof Ue != "function" && (Ue = Object(P.format)(Ue)), Le === 1 / 0)
                return Ue;
              Le == null && (Le = 10);
              var Pe = Math.max(1, pe * Le / l.ticks().length);
              return function(ft) {
                var Mt = ft / Se(Math.round(Me(ft)));
                return Mt * pe < pe - 0.5 && (Mt *= pe), Mt <= Pe ? Ue(ft) : "";
              };
            }, l.nice = function() {
              return I(ae(I(), {
                floor: function(Le) {
                  return Se(Math.floor(Me(Le)));
                },
                ceil: function(Le) {
                  return Se(Math.ceil(Me(Le)));
                }
              }));
            }, l.copy = function() {
              return le(l, w().base(pe));
            }, l;
          }
          function u(l, I) {
            return l < 0 ? -Math.pow(-l, I) : Math.pow(l, I);
          }
          function Z() {
            var l = 1, I = G(Me, Se), pe = I.domain;
            function Me(De, Le) {
              return (Le = u(Le, l) - (De = u(De, l))) ? function(Ue) {
                return (u(Ue, l) - De) / Le;
              } : C(Le);
            }
            function Se(De, Le) {
              return Le = u(Le, l) - (De = u(De, l)), function(Ue) {
                return u(De + Le * Ue, 1 / l);
              };
            }
            return I.exponent = function(De) {
              return arguments.length ? (l = +De, pe(pe())) : l;
            }, I.copy = function() {
              return le(I, Z().exponent(l));
            }, E(I);
          }
          function re() {
            return Z().exponent(0.5);
          }
          function de() {
            var l = [], I = [], pe = [];
            function Me() {
              var De = 0, Le = Math.max(1, I.length);
              for (pe = new Array(Le - 1); ++De < Le; )
                pe[De - 1] = k(l, De / Le);
              return Se;
            }
            function Se(De) {
              if (!isNaN(De = +De))
                return I[t(pe, De)];
            }
            return Se.invertExtent = function(De) {
              var Le = I.indexOf(De);
              return Le < 0 ? [NaN, NaN] : [
                Le > 0 ? pe[Le - 1] : l[0],
                Le < pe.length ? pe[Le] : l[l.length - 1]
              ];
            }, Se.domain = function(De) {
              if (!arguments.length)
                return l.slice();
              l = [];
              for (var Le = 0, Ue = De.length, Pe; Le < Ue; ++Le)
                Pe = De[Le], Pe != null && !isNaN(Pe = +Pe) && l.push(Pe);
              return l.sort(a), Me();
            }, Se.range = function(De) {
              return arguments.length ? (I = W.call(De), Me()) : I.slice();
            }, Se.quantiles = function() {
              return pe.slice();
            }, Se.copy = function() {
              return de().domain(l).range(I);
            }, Se;
          }
          function be() {
            var l = 0, I = 1, pe = 1, Me = [0.5], Se = [0, 1];
            function De(Ue) {
              if (Ue <= Ue)
                return Se[t(Me, Ue, 0, pe)];
            }
            function Le() {
              var Ue = -1;
              for (Me = new Array(pe); ++Ue < pe; )
                Me[Ue] = ((Ue + 1) * I - (Ue - pe) * l) / (pe + 1);
              return De;
            }
            return De.domain = function(Ue) {
              return arguments.length ? (l = +Ue[0], I = +Ue[1], Le()) : [l, I];
            }, De.range = function(Ue) {
              return arguments.length ? (pe = (Se = W.call(Ue)).length - 1, Le()) : Se.slice();
            }, De.invertExtent = function(Ue) {
              var Pe = Se.indexOf(Ue);
              return Pe < 0 ? [NaN, NaN] : Pe < 1 ? [l, Me[0]] : Pe >= pe ? [Me[pe - 1], I] : [Me[Pe - 1], Me[Pe]];
            }, De.copy = function() {
              return be().domain([l, I]).range(Se);
            }, E(De);
          }
          function i() {
            var l = [0.5], I = [0, 1], pe = 1;
            function Me(Se) {
              if (Se <= Se)
                return I[t(l, Se, 0, pe)];
            }
            return Me.domain = function(Se) {
              return arguments.length ? (l = W.call(Se), pe = Math.min(l.length, I.length - 1), Me) : l.slice();
            }, Me.range = function(Se) {
              return arguments.length ? (I = W.call(Se), pe = Math.min(l.length, I.length - 1), Me) : I.slice();
            }, Me.invertExtent = function(Se) {
              var De = I.indexOf(Se);
              return [l[De - 1], l[De]];
            }, Me.copy = function() {
              return i().domain(l).range(I);
            }, Me;
          }
          var f = /* @__PURE__ */ new Date(), R = /* @__PURE__ */ new Date();
          function z(l, I, pe, Me) {
            function Se(De) {
              return l(De = /* @__PURE__ */ new Date(+De)), De;
            }
            return Se.floor = Se, Se.ceil = function(De) {
              return l(De = new Date(De - 1)), I(De, 1), l(De), De;
            }, Se.round = function(De) {
              var Le = Se(De), Ue = Se.ceil(De);
              return De - Le < Ue - De ? Le : Ue;
            }, Se.offset = function(De, Le) {
              return I(De = /* @__PURE__ */ new Date(+De), Le == null ? 1 : Math.floor(Le)), De;
            }, Se.range = function(De, Le, Ue) {
              var Pe = [], ft;
              if (De = Se.ceil(De), Ue = Ue == null ? 1 : Math.floor(Ue), !(De < Le) || !(Ue > 0))
                return Pe;
              do
                Pe.push(ft = /* @__PURE__ */ new Date(+De)), I(De, Ue), l(De);
              while (ft < De && De < Le);
              return Pe;
            }, Se.filter = function(De) {
              return z(function(Le) {
                if (Le >= Le)
                  for (; l(Le), !De(Le); )
                    Le.setTime(Le - 1);
              }, function(Le, Ue) {
                if (Le >= Le)
                  if (Ue < 0)
                    for (; ++Ue <= 0; )
                      for (; I(Le, -1), !De(Le); )
                        ;
                  else
                    for (; --Ue >= 0; )
                      for (; I(Le, 1), !De(Le); )
                        ;
              });
            }, pe && (Se.count = function(De, Le) {
              return f.setTime(+De), R.setTime(+Le), l(f), l(R), Math.floor(pe(f, R));
            }, Se.every = function(De) {
              return De = Math.floor(De), !isFinite(De) || !(De > 0) ? null : De > 1 ? Se.filter(Me ? function(Le) {
                return Me(Le) % De === 0;
              } : function(Le) {
                return Se.count(0, Le) % De === 0;
              }) : Se;
            }), Se;
          }
          var se = z(function() {
          }, function(l, I) {
            l.setTime(+l + I);
          }, function(l, I) {
            return I - l;
          });
          se.every = function(l) {
            return l = Math.floor(l), !isFinite(l) || !(l > 0) ? null : l > 1 ? z(function(I) {
              I.setTime(Math.floor(I / l) * l);
            }, function(I, pe) {
              I.setTime(+I + pe * l);
            }, function(I, pe) {
              return (pe - I) / l;
            }) : se;
          };
          var ue = se;
          se.range;
          var ye = 1e3, N = 6e4, c = 36e5, J = 864e5, oe = 6048e5, Be = z(function(l) {
            l.setTime(l - l.getMilliseconds());
          }, function(l, I) {
            l.setTime(+l + I * ye);
          }, function(l, I) {
            return (I - l) / ye;
          }, function(l) {
            return l.getUTCSeconds();
          }), Ye = Be;
          Be.range;
          var We = z(function(l) {
            l.setTime(l - l.getMilliseconds() - l.getSeconds() * ye);
          }, function(l, I) {
            l.setTime(+l + I * N);
          }, function(l, I) {
            return (I - l) / N;
          }, function(l) {
            return l.getMinutes();
          }), Ke = We;
          We.range;
          var et = z(function(l) {
            l.setTime(l - l.getMilliseconds() - l.getSeconds() * ye - l.getMinutes() * N);
          }, function(l, I) {
            l.setTime(+l + I * c);
          }, function(l, I) {
            return (I - l) / c;
          }, function(l) {
            return l.getHours();
          }), nt = et;
          et.range;
          var pt = z(function(l) {
            l.setHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setDate(l.getDate() + I);
          }, function(l, I) {
            return (I - l - (I.getTimezoneOffset() - l.getTimezoneOffset()) * N) / J;
          }, function(l) {
            return l.getDate() - 1;
          }), Et = pt;
          pt.range;
          function gt(l) {
            return z(function(I) {
              I.setDate(I.getDate() - (I.getDay() + 7 - l) % 7), I.setHours(0, 0, 0, 0);
            }, function(I, pe) {
              I.setDate(I.getDate() + pe * 7);
            }, function(I, pe) {
              return (pe - I - (pe.getTimezoneOffset() - I.getTimezoneOffset()) * N) / oe;
            });
          }
          var bt = gt(0), Bt = gt(1), St = gt(2), Nt = gt(3), Wt = gt(4), Kt = gt(5), Ot = gt(6);
          bt.range, Bt.range, St.range, Nt.range, Wt.range, Kt.range, Ot.range;
          var It = z(function(l) {
            l.setDate(1), l.setHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setMonth(l.getMonth() + I);
          }, function(l, I) {
            return I.getMonth() - l.getMonth() + (I.getFullYear() - l.getFullYear()) * 12;
          }, function(l) {
            return l.getMonth();
          }), e = It;
          It.range;
          var A = z(function(l) {
            l.setMonth(0, 1), l.setHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setFullYear(l.getFullYear() + I);
          }, function(l, I) {
            return I.getFullYear() - l.getFullYear();
          }, function(l) {
            return l.getFullYear();
          });
          A.every = function(l) {
            return !isFinite(l = Math.floor(l)) || !(l > 0) ? null : z(function(I) {
              I.setFullYear(Math.floor(I.getFullYear() / l) * l), I.setMonth(0, 1), I.setHours(0, 0, 0, 0);
            }, function(I, pe) {
              I.setFullYear(I.getFullYear() + pe * l);
            });
          };
          var L = A;
          A.range;
          var te = z(function(l) {
            l.setUTCSeconds(0, 0);
          }, function(l, I) {
            l.setTime(+l + I * N);
          }, function(l, I) {
            return (I - l) / N;
          }, function(l) {
            return l.getUTCMinutes();
          }), we = te;
          te.range;
          var Ne = z(function(l) {
            l.setUTCMinutes(0, 0, 0);
          }, function(l, I) {
            l.setTime(+l + I * c);
          }, function(l, I) {
            return (I - l) / c;
          }, function(l) {
            return l.getUTCHours();
          }), ze = Ne;
          Ne.range;
          var Ve = z(function(l) {
            l.setUTCHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setUTCDate(l.getUTCDate() + I);
          }, function(l, I) {
            return (I - l) / J;
          }, function(l) {
            return l.getUTCDate() - 1;
          }), Ze = Ve;
          Ve.range;
          function Je(l) {
            return z(function(I) {
              I.setUTCDate(I.getUTCDate() - (I.getUTCDay() + 7 - l) % 7), I.setUTCHours(0, 0, 0, 0);
            }, function(I, pe) {
              I.setUTCDate(I.getUTCDate() + pe * 7);
            }, function(I, pe) {
              return (pe - I) / oe;
            });
          }
          var st = Je(0), ot = Je(1), ut = Je(2), mt = Je(3), qe = Je(4), $e = Je(5), vt = Je(6);
          st.range, ot.range, ut.range, mt.range, qe.range, $e.range, vt.range;
          var wt = z(function(l) {
            l.setUTCDate(1), l.setUTCHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setUTCMonth(l.getUTCMonth() + I);
          }, function(l, I) {
            return I.getUTCMonth() - l.getUTCMonth() + (I.getUTCFullYear() - l.getUTCFullYear()) * 12;
          }, function(l) {
            return l.getUTCMonth();
          }), rt = wt;
          wt.range;
          var lt = z(function(l) {
            l.setUTCMonth(0, 1), l.setUTCHours(0, 0, 0, 0);
          }, function(l, I) {
            l.setUTCFullYear(l.getUTCFullYear() + I);
          }, function(l, I) {
            return I.getUTCFullYear() - l.getUTCFullYear();
          }, function(l) {
            return l.getUTCFullYear();
          });
          lt.every = function(l) {
            return !isFinite(l = Math.floor(l)) || !(l > 0) ? null : z(function(I) {
              I.setUTCFullYear(Math.floor(I.getUTCFullYear() / l) * l), I.setUTCMonth(0, 1), I.setUTCHours(0, 0, 0, 0);
            }, function(I, pe) {
              I.setUTCFullYear(I.getUTCFullYear() + pe * l);
            });
          };
          var ct = lt;
          lt.range;
          function _t(l) {
            if (0 <= l.y && l.y < 100) {
              var I = new Date(-1, l.m, l.d, l.H, l.M, l.S, l.L);
              return I.setFullYear(l.y), I;
            }
            return new Date(l.y, l.m, l.d, l.H, l.M, l.S, l.L);
          }
          function xt(l) {
            if (0 <= l.y && l.y < 100) {
              var I = new Date(Date.UTC(-1, l.m, l.d, l.H, l.M, l.S, l.L));
              return I.setUTCFullYear(l.y), I;
            }
            return new Date(Date.UTC(l.y, l.m, l.d, l.H, l.M, l.S, l.L));
          }
          function Ae(l) {
            return { y: l, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0 };
          }
          function me(l) {
            var I = l.dateTime, pe = l.date, Me = l.time, Se = l.periods, De = l.days, Le = l.shortDays, Ue = l.months, Pe = l.shortMonths, ft = Ie(Se), Mt = Qe(Se), it = Ie(De), Lt = Qe(De), Qt = Ie(Le), Ft = Qe(Le), zt = Ie(Ue), rn = Qe(Ue), $t = Ie(Pe), Bn = Qe(Pe), en = {
              a: Wr,
              A: Gr,
              b: Pr,
              B: jr,
              c: null,
              d: Dn,
              e: Dn,
              f: Hn,
              H: Gn,
              I: Pn,
              j: jn,
              L: Sn,
              m: Vn,
              M: Kn,
              p: Hr,
              Q: Qn,
              s: Fn,
              S: Zn,
              u: Jn,
              U: Xn,
              V: qn,
              w: $n,
              W: er,
              x: null,
              X: null,
              y: tr,
              Y: nr,
              Z: rr,
              "%": Ln
            }, Pt = {
              a: Vr,
              A: Kr,
              b: Zr,
              B: Jr,
              c: null,
              d: Tn,
              e: Tn,
              f: sr,
              H: ir,
              I: ar,
              j: or,
              L: Nn,
              m: lr,
              M: ur,
              p: Xr,
              Q: Qn,
              s: Fn,
              S: cr,
              u: fr,
              U: hr,
              V: dr,
              w: Ar,
              W: pr,
              x: null,
              X: null,
              y: gr,
              Y: vr,
              Z: mr,
              "%": Ln
            }, In = {
              a: jt,
              A: Xt,
              b: Yt,
              B: Zt,
              c: Ur,
              d: Dt,
              e: Dt,
              f: un,
              H: fn,
              I: fn,
              j: ln,
              L: an,
              m: Gt,
              M: gn,
              p: Ut,
              Q: mn,
              s: Mn,
              S: _n,
              u: Ge,
              U: He,
              V: Re,
              w: Fe,
              W: Xe,
              x: Yr,
              X: Rr,
              y: dt,
              Y: at,
              Z: Tt,
              "%": vn
            };
            en.x = Jt(pe, en), en.X = Jt(Me, en), en.c = Jt(I, en), Pt.x = Jt(pe, Pt), Pt.X = Jt(Me, Pt), Pt.c = Jt(I, Pt);
            function Jt(tt, At) {
              return function(yt) {
                var je = [], Rt = -1, Ct = 0, Ht = tt.length, Vt, sn, Rn;
                for (yt instanceof Date || (yt = /* @__PURE__ */ new Date(+yt)); ++Rt < Ht; )
                  tt.charCodeAt(Rt) === 37 && (je.push(tt.slice(Ct, Rt)), (sn = _e[Vt = tt.charAt(++Rt)]) != null ? Vt = tt.charAt(++Rt) : sn = Vt === "e" ? " " : "0", (Rn = At[Vt]) && (Vt = Rn(yt, sn)), je.push(Vt), Ct = Rt + 1);
                return je.push(tt.slice(Ct, Rt)), je.join("");
              };
            }
            function ht(tt, At) {
              return function(yt) {
                var je = Ae(1900), Rt = kt(je, tt, yt += "", 0), Ct, Ht;
                if (Rt != yt.length)
                  return null;
                if ("Q" in je)
                  return new Date(je.Q);
                if ("p" in je && (je.H = je.H % 12 + je.p * 12), "V" in je) {
                  if (je.V < 1 || je.V > 53)
                    return null;
                  "w" in je || (je.w = 1), "Z" in je ? (Ct = xt(Ae(je.y)), Ht = Ct.getUTCDay(), Ct = Ht > 4 || Ht === 0 ? ot.ceil(Ct) : ot(Ct), Ct = Ze.offset(Ct, (je.V - 1) * 7), je.y = Ct.getUTCFullYear(), je.m = Ct.getUTCMonth(), je.d = Ct.getUTCDate() + (je.w + 6) % 7) : (Ct = At(Ae(je.y)), Ht = Ct.getDay(), Ct = Ht > 4 || Ht === 0 ? Bt.ceil(Ct) : Bt(Ct), Ct = Et.offset(Ct, (je.V - 1) * 7), je.y = Ct.getFullYear(), je.m = Ct.getMonth(), je.d = Ct.getDate() + (je.w + 6) % 7);
                } else
                  ("W" in je || "U" in je) && ("w" in je || (je.w = "u" in je ? je.u % 7 : "W" in je ? 1 : 0), Ht = "Z" in je ? xt(Ae(je.y)).getUTCDay() : At(Ae(je.y)).getDay(), je.m = 0, je.d = "W" in je ? (je.w + 6) % 7 + je.W * 7 - (Ht + 5) % 7 : je.w + je.U * 7 - (Ht + 6) % 7);
                return "Z" in je ? (je.H += je.Z / 100 | 0, je.M += je.Z % 100, xt(je)) : At(je);
              };
            }
            function kt(tt, At, yt, je) {
              for (var Rt = 0, Ct = At.length, Ht = yt.length, Vt, sn; Rt < Ct; ) {
                if (je >= Ht)
                  return -1;
                if (Vt = At.charCodeAt(Rt++), Vt === 37) {
                  if (Vt = At.charAt(Rt++), sn = In[Vt in _e ? At.charAt(Rt++) : Vt], !sn || (je = sn(tt, yt, je)) < 0)
                    return -1;
                } else if (Vt != yt.charCodeAt(je++))
                  return -1;
              }
              return je;
            }
            function Ut(tt, At, yt) {
              var je = ft.exec(At.slice(yt));
              return je ? (tt.p = Mt[je[0].toLowerCase()], yt + je[0].length) : -1;
            }
            function jt(tt, At, yt) {
              var je = Qt.exec(At.slice(yt));
              return je ? (tt.w = Ft[je[0].toLowerCase()], yt + je[0].length) : -1;
            }
            function Xt(tt, At, yt) {
              var je = it.exec(At.slice(yt));
              return je ? (tt.w = Lt[je[0].toLowerCase()], yt + je[0].length) : -1;
            }
            function Yt(tt, At, yt) {
              var je = $t.exec(At.slice(yt));
              return je ? (tt.m = Bn[je[0].toLowerCase()], yt + je[0].length) : -1;
            }
            function Zt(tt, At, yt) {
              var je = zt.exec(At.slice(yt));
              return je ? (tt.m = rn[je[0].toLowerCase()], yt + je[0].length) : -1;
            }
            function Ur(tt, At, yt) {
              return kt(tt, I, At, yt);
            }
            function Yr(tt, At, yt) {
              return kt(tt, pe, At, yt);
            }
            function Rr(tt, At, yt) {
              return kt(tt, Me, At, yt);
            }
            function Wr(tt) {
              return Le[tt.getDay()];
            }
            function Gr(tt) {
              return De[tt.getDay()];
            }
            function Pr(tt) {
              return Pe[tt.getMonth()];
            }
            function jr(tt) {
              return Ue[tt.getMonth()];
            }
            function Hr(tt) {
              return Se[+(tt.getHours() >= 12)];
            }
            function Vr(tt) {
              return Le[tt.getUTCDay()];
            }
            function Kr(tt) {
              return De[tt.getUTCDay()];
            }
            function Zr(tt) {
              return Pe[tt.getUTCMonth()];
            }
            function Jr(tt) {
              return Ue[tt.getUTCMonth()];
            }
            function Xr(tt) {
              return Se[+(tt.getUTCHours() >= 12)];
            }
            return {
              format: function(tt) {
                var At = Jt(tt += "", en);
                return At.toString = function() {
                  return tt;
                }, At;
              },
              parse: function(tt) {
                var At = ht(tt += "", _t);
                return At.toString = function() {
                  return tt;
                }, At;
              },
              utcFormat: function(tt) {
                var At = Jt(tt += "", Pt);
                return At.toString = function() {
                  return tt;
                }, At;
              },
              utcParse: function(tt) {
                var At = ht(tt, xt);
                return At.toString = function() {
                  return tt;
                }, At;
              }
            };
          }
          var _e = { "-": "", _: " ", 0: "0" }, Ee = /^\s*\d+/, Oe = /^%/, ke = /[\\^$*+?|[\]().{}]/g;
          function S(l, I, pe) {
            var Me = l < 0 ? "-" : "", Se = (Me ? -l : l) + "", De = Se.length;
            return Me + (De < pe ? new Array(pe - De + 1).join(I) + Se : Se);
          }
          function ve(l) {
            return l.replace(ke, "\\$&");
          }
          function Ie(l) {
            return new RegExp("^(?:" + l.map(ve).join("|") + ")", "i");
          }
          function Qe(l) {
            for (var I = {}, pe = -1, Me = l.length; ++pe < Me; )
              I[l[pe].toLowerCase()] = pe;
            return I;
          }
          function Fe(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 1));
            return Me ? (l.w = +Me[0], pe + Me[0].length) : -1;
          }
          function Ge(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 1));
            return Me ? (l.u = +Me[0], pe + Me[0].length) : -1;
          }
          function He(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.U = +Me[0], pe + Me[0].length) : -1;
          }
          function Re(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.V = +Me[0], pe + Me[0].length) : -1;
          }
          function Xe(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.W = +Me[0], pe + Me[0].length) : -1;
          }
          function at(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 4));
            return Me ? (l.y = +Me[0], pe + Me[0].length) : -1;
          }
          function dt(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.y = +Me[0] + (+Me[0] > 68 ? 1900 : 2e3), pe + Me[0].length) : -1;
          }
          function Tt(l, I, pe) {
            var Me = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(I.slice(pe, pe + 6));
            return Me ? (l.Z = Me[1] ? 0 : -(Me[2] + (Me[3] || "00")), pe + Me[0].length) : -1;
          }
          function Gt(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.m = Me[0] - 1, pe + Me[0].length) : -1;
          }
          function Dt(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.d = +Me[0], pe + Me[0].length) : -1;
          }
          function ln(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 3));
            return Me ? (l.m = 0, l.d = +Me[0], pe + Me[0].length) : -1;
          }
          function fn(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.H = +Me[0], pe + Me[0].length) : -1;
          }
          function gn(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.M = +Me[0], pe + Me[0].length) : -1;
          }
          function _n(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 2));
            return Me ? (l.S = +Me[0], pe + Me[0].length) : -1;
          }
          function an(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 3));
            return Me ? (l.L = +Me[0], pe + Me[0].length) : -1;
          }
          function un(l, I, pe) {
            var Me = Ee.exec(I.slice(pe, pe + 6));
            return Me ? (l.L = Math.floor(Me[0] / 1e3), pe + Me[0].length) : -1;
          }
          function vn(l, I, pe) {
            var Me = Oe.exec(I.slice(pe, pe + 1));
            return Me ? pe + Me[0].length : -1;
          }
          function mn(l, I, pe) {
            var Me = Ee.exec(I.slice(pe));
            return Me ? (l.Q = +Me[0], pe + Me[0].length) : -1;
          }
          function Mn(l, I, pe) {
            var Me = Ee.exec(I.slice(pe));
            return Me ? (l.Q = +Me[0] * 1e3, pe + Me[0].length) : -1;
          }
          function Dn(l, I) {
            return S(l.getDate(), I, 2);
          }
          function Gn(l, I) {
            return S(l.getHours(), I, 2);
          }
          function Pn(l, I) {
            return S(l.getHours() % 12 || 12, I, 2);
          }
          function jn(l, I) {
            return S(1 + Et.count(L(l), l), I, 3);
          }
          function Sn(l, I) {
            return S(l.getMilliseconds(), I, 3);
          }
          function Hn(l, I) {
            return Sn(l, I) + "000";
          }
          function Vn(l, I) {
            return S(l.getMonth() + 1, I, 2);
          }
          function Kn(l, I) {
            return S(l.getMinutes(), I, 2);
          }
          function Zn(l, I) {
            return S(l.getSeconds(), I, 2);
          }
          function Jn(l) {
            var I = l.getDay();
            return I === 0 ? 7 : I;
          }
          function Xn(l, I) {
            return S(bt.count(L(l), l), I, 2);
          }
          function qn(l, I) {
            var pe = l.getDay();
            return l = pe >= 4 || pe === 0 ? Wt(l) : Wt.ceil(l), S(Wt.count(L(l), l) + (L(l).getDay() === 4), I, 2);
          }
          function $n(l) {
            return l.getDay();
          }
          function er(l, I) {
            return S(Bt.count(L(l), l), I, 2);
          }
          function tr(l, I) {
            return S(l.getFullYear() % 100, I, 2);
          }
          function nr(l, I) {
            return S(l.getFullYear() % 1e4, I, 4);
          }
          function rr(l) {
            var I = l.getTimezoneOffset();
            return (I > 0 ? "-" : (I *= -1, "+")) + S(I / 60 | 0, "0", 2) + S(I % 60, "0", 2);
          }
          function Tn(l, I) {
            return S(l.getUTCDate(), I, 2);
          }
          function ir(l, I) {
            return S(l.getUTCHours(), I, 2);
          }
          function ar(l, I) {
            return S(l.getUTCHours() % 12 || 12, I, 2);
          }
          function or(l, I) {
            return S(1 + Ze.count(ct(l), l), I, 3);
          }
          function Nn(l, I) {
            return S(l.getUTCMilliseconds(), I, 3);
          }
          function sr(l, I) {
            return Nn(l, I) + "000";
          }
          function lr(l, I) {
            return S(l.getUTCMonth() + 1, I, 2);
          }
          function ur(l, I) {
            return S(l.getUTCMinutes(), I, 2);
          }
          function cr(l, I) {
            return S(l.getUTCSeconds(), I, 2);
          }
          function fr(l) {
            var I = l.getUTCDay();
            return I === 0 ? 7 : I;
          }
          function hr(l, I) {
            return S(st.count(ct(l), l), I, 2);
          }
          function dr(l, I) {
            var pe = l.getUTCDay();
            return l = pe >= 4 || pe === 0 ? qe(l) : qe.ceil(l), S(qe.count(ct(l), l) + (ct(l).getUTCDay() === 4), I, 2);
          }
          function Ar(l) {
            return l.getUTCDay();
          }
          function pr(l, I) {
            return S(ot.count(ct(l), l), I, 2);
          }
          function gr(l, I) {
            return S(l.getUTCFullYear() % 100, I, 2);
          }
          function vr(l, I) {
            return S(l.getUTCFullYear() % 1e4, I, 4);
          }
          function mr() {
            return "+0000";
          }
          function Ln() {
            return "%";
          }
          function Qn(l) {
            return +l;
          }
          function Fn(l) {
            return Math.floor(+l / 1e3);
          }
          var cn, zn, xn, kn;
          yr({
            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 yr(l) {
            return cn = me(l), zn = cn.format, cn.parse, xn = cn.utcFormat, kn = cn.utcParse, cn;
          }
          var On = "%Y-%m-%dT%H:%M:%S.%LZ";
          function br(l) {
            return l.toISOString();
          }
          Date.prototype.toISOString || xn(On);
          function wr(l) {
            var I = new Date(l);
            return isNaN(I) ? null : I;
          }
          +/* @__PURE__ */ new Date("2000-01-01T00:00:00.000Z") || kn(On);
          var hn = 1e3, dn = hn * 60, An = dn * 60, pn = An * 24, _r = pn * 7, Un = pn * 30, Cn = pn * 365;
          function Mr(l) {
            return new Date(l);
          }
          function xr(l) {
            return l instanceof Date ? +l : +/* @__PURE__ */ new Date(+l);
          }
          function En(l, I, pe, Me, Se, De, Le, Ue, Pe) {
            var ft = G(ce, b.c), Mt = ft.invert, it = ft.domain, Lt = Pe(".%L"), Qt = Pe(":%S"), Ft = Pe("%I:%M"), zt = Pe("%I %p"), rn = Pe("%a %d"), $t = Pe("%b %d"), Bn = Pe("%B"), en = Pe("%Y"), Pt = [
              [Le, 1, hn],
              [Le, 5, 5 * hn],
              [Le, 15, 15 * hn],
              [Le, 30, 30 * hn],
              [De, 1, dn],
              [De, 5, 5 * dn],
              [De, 15, 15 * dn],
              [De, 30, 30 * dn],
              [Se, 1, An],
              [Se, 3, 3 * An],
              [Se, 6, 6 * An],
              [Se, 12, 12 * An],
              [Me, 1, pn],
              [Me, 2, 2 * pn],
              [pe, 1, _r],
              [I, 1, Un],
              [I, 3, 3 * Un],
              [l, 1, Cn]
            ];
            function In(ht) {
              return (Le(ht) < ht ? Lt : De(ht) < ht ? Qt : Se(ht) < ht ? Ft : Me(ht) < ht ? zt : I(ht) < ht ? pe(ht) < ht ? rn : $t : l(ht) < ht ? Bn : en)(ht);
            }
            function Jt(ht, kt, Ut, jt) {
              if (ht == null && (ht = 10), typeof ht == "number") {
                var Xt = Math.abs(Ut - kt) / ht, Yt = X(function(Zt) {
                  return Zt[2];
                }).right(Pt, Xt);
                Yt === Pt.length ? (jt = B(kt / Cn, Ut / Cn, ht), ht = l) : Yt ? (Yt = Pt[Xt / Pt[Yt - 1][2] < Pt[Yt][2] / Xt ? Yt - 1 : Yt], jt = Yt[1], ht = Yt[0]) : (jt = Math.max(B(kt, Ut, ht), 1), ht = Ue);
              }
              return jt == null ? ht : ht.every(jt);
            }
            return ft.invert = function(ht) {
              return new Date(Mt(ht));
            }, ft.domain = function(ht) {
              return arguments.length ? it(o.call(ht, xr)) : it().map(Mr);
            }, ft.ticks = function(ht, kt) {
              var Ut = it(), jt = Ut[0], Xt = Ut[Ut.length - 1], Yt = Xt < jt, Zt;
              return Yt && (Zt = jt, jt = Xt, Xt = Zt), Zt = Jt(ht, jt, Xt, kt), Zt = Zt ? Zt.range(jt, Xt + 1) : [], Yt ? Zt.reverse() : Zt;
            }, ft.tickFormat = function(ht, kt) {
              return kt == null ? In : Pe(kt);
            }, ft.nice = function(ht, kt) {
              var Ut = it();
              return (ht = Jt(ht, Ut[0], Ut[Ut.length - 1], kt)) ? it(ae(Ut, ht)) : ft;
            }, ft.copy = function() {
              return le(ft, En(l, I, pe, Me, Se, De, Le, Ue, Pe));
            }, ft;
          }
          var Cr = function() {
            return En(L, e, bt, Et, nt, Ke, Ye, ue, zn).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]);
          }, Er = function() {
            return En(ct, rt, st, Ze, ze, we, Ye, ue, xn).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]);
          }, nn = function(l) {
            return l.match(/.{6}/g).map(function(I) {
              return "#" + I;
            });
          }, Br = nn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"), Ir = nn("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"), Dr = nn("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"), Sr = nn("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"), on = d(1), Tr = Object(b.b)(Object(on.b)(300, 0.5, 0), Object(on.b)(-240, 0.5, 1)), Nr = Object(b.b)(Object(on.b)(-100, 0.75, 0.35), Object(on.b)(80, 1.5, 0.8)), Lr = Object(b.b)(Object(on.b)(260, 0.75, 0.35), Object(on.b)(80, 1.5, 0.8)), yn = Object(on.b)(), Qr = function(l) {
            (l < 0 || l > 1) && (l -= Math.floor(l));
            var I = Math.abs(l - 0.5);
            return yn.h = 360 * l - 100, yn.s = 1.5 - 1.5 * I, yn.l = 0.8 - 0.9 * I, yn + "";
          };
          function bn(l) {
            var I = l.length;
            return function(pe) {
              return l[Math.max(0, Math.min(I - 1, Math.floor(pe * I)))];
            };
          }
          var Fr = bn(nn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")), zr = bn(nn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")), kr = bn(nn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")), Or = bn(nn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
          function Yn(l) {
            var I = 0, pe = 1, Me = !1;
            function Se(De) {
              var Le = (De - I) / (pe - I);
              return l(Me ? Math.max(0, Math.min(1, Le)) : Le);
            }
            return Se.domain = function(De) {
              return arguments.length ? (I = +De[0], pe = +De[1], Se) : [I, pe];
            }, Se.clamp = function(De) {
              return arguments.length ? (Me = !!De, Se) : Me;
            }, Se.interpolator = function(De) {
              return arguments.length ? (l = De, Se) : l;
            }, Se.copy = function() {
              return Yn(l).domain([I, pe]).clamp(Me);
            }, E(Se);
          }
          d.d(O, "scaleBand", function() {
            return T;
          }), d.d(O, "scalePoint", function() {
            return r;
          }), d.d(O, "scaleIdentity", function() {
            return ie;
          }), d.d(O, "scaleLinear", function() {
            return V;
          }), d.d(O, "scaleLog", function() {
            return w;
          }), d.d(O, "scaleOrdinal", function() {
            return v;
          }), d.d(O, "scaleImplicit", function() {
            return y;
          }), d.d(O, "scalePow", function() {
            return Z;
          }), d.d(O, "scaleSqrt", function() {
            return re;
          }), d.d(O, "scaleQuantile", function() {
            return de;
          }), d.d(O, "scaleQuantize", function() {
            return be;
          }), d.d(O, "scaleThreshold", function() {
            return i;
          }), d.d(O, "scaleTime", function() {
            return Cr;
          }), d.d(O, "scaleUtc", function() {
            return Er;
          }), d.d(O, "schemeCategory10", function() {
            return Br;
          }), d.d(O, "schemeCategory20b", function() {
            return Ir;
          }), d.d(O, "schemeCategory20c", function() {
            return Dr;
          }), d.d(O, "schemeCategory20", function() {
            return Sr;
          }), d.d(O, "interpolateCubehelixDefault", function() {
            return Tr;
          }), d.d(O, "interpolateRainbow", function() {
            return Qr;
          }), d.d(O, "interpolateWarm", function() {
            return Nr;
          }), d.d(O, "interpolateCool", function() {
            return Lr;
          }), d.d(O, "interpolateViridis", function() {
            return Fr;
          }), d.d(O, "interpolateMagma", function() {
            return zr;
          }), d.d(O, "interpolateInferno", function() {
            return kr;
          }), d.d(O, "interpolatePlasma", function() {
            return Or;
          }), d.d(O, "scaleSequential", function() {
            return Yn;
          });
        },
        /* 91 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = d(8), X = d(7), q = d(2), ee = d(0), j = d(11), t = function(y) {
            return function() {
              return y;
            };
          };
          function F(y, v, T) {
            this.target = y, this.type = v, this.transform = T;
          }
          function M(y, v, T) {
            this.k = y, this.x = v, this.y = T;
          }
          M.prototype = {
            constructor: M,
            scale: function(y) {
              return y === 1 ? this : new M(this.k * y, this.x, this.y);
            },
            translate: function(y, v) {
              return y === 0 & v === 0 ? this : new M(this.k, this.x + this.k * y, this.y + this.k * v);
            },
            apply: function(y) {
              return [y[0] * this.k + this.x, y[1] * this.k + this.y];
            },
            applyX: function(y) {
              return y * this.k + this.x;
            },
            applyY: function(y) {
              return y * this.k + this.y;
            },
            invert: function(y) {
              return [(y[0] - this.x) / this.k, (y[1] - this.y) / this.k];
            },
            invertX: function(y) {
              return (y - this.x) / this.k;
            },
            invertY: function(y) {
              return (y - this.y) / this.k;
            },
            rescaleX: function(y) {
              return y.copy().domain(y.range().map(this.invertX, this).map(y.invert, y));
            },
            rescaleY: function(y) {
              return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
            },
            toString: function() {
              return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
            }
          };
          var h = new M(1, 0, 0);
          x.prototype = M.prototype;
          function x(y) {
            return y.__zoom || h;
          }
          function m() {
            ee.event.stopImmediatePropagation();
          }
          var D = function() {
            ee.event.preventDefault(), ee.event.stopImmediatePropagation();
          };
          function H() {
            return !ee.event.button;
          }
          function B() {
            var y = this, v, T;
            return y instanceof SVGElement ? (y = y.ownerSVGElement || y, v = y.width.baseVal.value, T = y.height.baseVal.value) : (v = y.clientWidth, T = y.clientHeight), [[0, 0], [v, T]];
          }
          function k() {
            return this.__zoom || h;
          }
          function _() {
            return -ee.event.deltaY * (ee.event.deltaMode ? 120 : 1) / 500;
          }
          function Q() {
            return "ontouchstart" in this;
          }
          function o(y, v, T) {
            var n = y.invertX(v[0][0]) - T[0][0], r = y.invertX(v[1][0]) - T[1][0], b = y.invertY(v[0][1]) - T[0][1], C = y.invertY(v[1][1]) - T[1][1];
            return y.translate(
              r > n ? (n + r) / 2 : Math.min(0, n) || Math.max(0, r),
              C > b ? (b + C) / 2 : Math.min(0, b) || Math.max(0, C)
            );
          }
          var W = function() {
            var y = H, v = B, T = o, n = _, r = Q, b = [0, 1 / 0], C = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], ne = 250, ge = q.i, ce = [], xe = Object(a.a)("start", "zoom", "end"), fe, Ce, he = 500, le = 150, G = 0;
            function P(u) {
              u.property("__zoom", k).on("wheel.zoom", s).on("mousedown.zoom", g).on("dblclick.zoom", U).filter(r).on("touchstart.zoom", Y).on("touchmove.zoom", p).on("touchend.zoom touchcancel.zoom", w).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
            }
            P.transform = function(u, Z) {
              var re = u.selection ? u.selection() : u;
              re.property("__zoom", k), u !== re ? ie(u, Z) : re.interrupt().each(function() {
                ae(this, arguments).start().zoom(null, typeof Z == "function" ? Z.apply(this, arguments) : Z).end();
              });
            }, P.scaleBy = function(u, Z) {
              P.scaleTo(u, function() {
                var re = this.__zoom.k, de = typeof Z == "function" ? Z.apply(this, arguments) : Z;
                return re * de;
              });
            }, P.scaleTo = function(u, Z) {
              P.transform(u, function() {
                var re = v.apply(this, arguments), de = this.__zoom, be = V(re), i = de.invert(be), f = typeof Z == "function" ? Z.apply(this, arguments) : Z;
                return T(E($(de, f), be, i), re, C);
              });
            }, P.translateBy = function(u, Z, re) {
              P.transform(u, function() {
                return T(this.__zoom.translate(
                  typeof Z == "function" ? Z.apply(this, arguments) : Z,
                  typeof re == "function" ? re.apply(this, arguments) : re
                ), v.apply(this, arguments), C);
              });
            }, P.translateTo = function(u, Z, re) {
              P.transform(u, function() {
                var de = v.apply(this, arguments), be = this.__zoom, i = V(de);
                return T(h.translate(i[0], i[1]).scale(be.k).translate(
                  typeof Z == "function" ? -Z.apply(this, arguments) : -Z,
                  typeof re == "function" ? -re.apply(this, arguments) : -re
                ), de, C);
              });
            };
            function $(u, Z) {
              return Z = Math.max(b[0], Math.min(b[1], Z)), Z === u.k ? u : new M(Z, u.x, u.y);
            }
            function E(u, Z, re) {
              var de = Z[0] - re[0] * u.k, be = Z[1] - re[1] * u.k;
              return de === u.x && be === u.y ? u : new M(u.k, de, be);
            }
            function V(u) {
              return [(+u[0][0] + +u[1][0]) / 2, (+u[0][1] + +u[1][1]) / 2];
            }
            function ie(u, Z, re) {
              u.on("start.zoom", function() {
                ae(this, arguments).start();
              }).on("interrupt.zoom end.zoom", function() {
                ae(this, arguments).end();
              }).tween("zoom", function() {
                var de = this, be = arguments, i = ae(de, be), f = v.apply(de, be), R = re || V(f), z = Math.max(f[1][0] - f[0][0], f[1][1] - f[0][1]), se = de.__zoom, ue = typeof Z == "function" ? Z.apply(de, be) : Z, ye = ge(se.invert(R).concat(z / se.k), ue.invert(R).concat(z / ue.k));
                return function(N) {
                  if (N === 1)
                    N = ue;
                  else {
                    var c = ye(N), J = z / c[2];
                    N = new M(J, R[0] - c[0] * J, R[1] - c[1] * J);
                  }
                  i.zoom(null, N);
                };
              });
            }
            function ae(u, Z) {
              for (var re = 0, de = ce.length, be; re < de; ++re)
                if ((be = ce[re]).that === u)
                  return be;
              return new K(u, Z);
            }
            function K(u, Z) {
              this.that = u, this.args = Z, this.index = -1, this.active = 0, this.extent = v.apply(u, Z);
            }
            K.prototype = {
              start: function() {
                return ++this.active === 1 && (this.index = ce.push(this) - 1, this.emit("start")), this;
              },
              zoom: function(u, Z) {
                return this.mouse && u !== "mouse" && (this.mouse[1] = Z.invert(this.mouse[0])), this.touch0 && u !== "touch" && (this.touch0[1] = Z.invert(this.touch0[0])), this.touch1 && u !== "touch" && (this.touch1[1] = Z.invert(this.touch1[0])), this.that.__zoom = Z, this.emit("zoom"), this;
              },
              end: function() {
                return --this.active === 0 && (ce.splice(this.index, 1), this.index = -1, this.emit("end")), this;
              },
              emit: function(u) {
                Object(ee.customEvent)(new F(P, u, this.that.__zoom), xe.apply, xe, [u, this.that, this.args]);
              }
            };
            function s() {
              if (!y.apply(this, arguments))
                return;
              var u = ae(this, arguments), Z = this.__zoom, re = Math.max(b[0], Math.min(b[1], Z.k * Math.pow(2, n.apply(this, arguments)))), de = Object(ee.mouse)(this);
              if (u.wheel)
                (u.mouse[0][0] !== de[0] || u.mouse[0][1] !== de[1]) && (u.mouse[1] = Z.invert(u.mouse[0] = de)), clearTimeout(u.wheel);
              else {
                if (Z.k === re)
                  return;
                u.mouse = [de, Z.invert(de)], Object(j.a)(this), u.start();
              }
              D(), u.wheel = setTimeout(be, le), u.zoom("mouse", T(E($(Z, re), u.mouse[0], u.mouse[1]), u.extent, C));
              function be() {
                u.wheel = null, u.end();
              }
            }
            function g() {
              if (Ce || !y.apply(this, arguments))
                return;
              var u = ae(this, arguments), Z = Object(ee.select)(ee.event.view).on("mousemove.zoom", i, !0).on("mouseup.zoom", f, !0), re = Object(ee.mouse)(this), de = ee.event.clientX, be = ee.event.clientY;
              Object(X.dragDisable)(ee.event.view), m(), u.mouse = [re, this.__zoom.invert(re)], Object(j.a)(this), u.start();
              function i() {
                if (D(), !u.moved) {
                  var R = ee.event.clientX - de, z = ee.event.clientY - be;
                  u.moved = R * R + z * z > G;
                }
                u.zoom("mouse", T(E(u.that.__zoom, u.mouse[0] = Object(ee.mouse)(u.that), u.mouse[1]), u.extent, C));
              }
              function f() {
                Z.on("mousemove.zoom mouseup.zoom", null), Object(X.dragEnable)(ee.event.view, u.moved), D(), u.end();
              }
            }
            function U() {
              if (y.apply(this, arguments)) {
                var u = this.__zoom, Z = Object(ee.mouse)(this), re = u.invert(Z), de = u.k * (ee.event.shiftKey ? 0.5 : 2), be = T(E($(u, de), Z, re), v.apply(this, arguments), C);
                D(), ne > 0 ? Object(ee.select)(this).transition().duration(ne).call(ie, be, Z) : Object(ee.select)(this).call(P.transform, be);
              }
            }
            function Y() {
              if (y.apply(this, arguments)) {
                var u = ae(this, arguments), Z = ee.event.changedTouches, re, de = Z.length, be, i, f;
                for (m(), be = 0; be < de; ++be)
                  i = Z[be], f = Object(ee.touch)(this, Z, i.identifier), f = [f, this.__zoom.invert(f), i.identifier], u.touch0 ? u.touch1 || (u.touch1 = f) : (u.touch0 = f, re = !0);
                if (fe && (fe = clearTimeout(fe), !u.touch1)) {
                  u.end(), f = Object(ee.select)(this).on("dblclick.zoom"), f && f.apply(this, arguments);
                  return;
                }
                re && (fe = setTimeout(function() {
                  fe = null;
                }, he), Object(j.a)(this), u.start());
              }
            }
            function p() {
              var u = ae(this, arguments), Z = ee.event.changedTouches, re = Z.length, de, be, i, f;
              for (D(), fe && (fe = clearTimeout(fe)), de = 0; de < re; ++de)
                be = Z[de], i = Object(ee.touch)(this, Z, be.identifier), u.touch0 && u.touch0[2] === be.identifier ? u.touch0[0] = i : u.touch1 && u.touch1[2] === be.identifier && (u.touch1[0] = i);
              if (be = u.that.__zoom, u.touch1) {
                var R = u.touch0[0], z = u.touch0[1], se = u.touch1[0], ue = u.touch1[1], ye = (ye = se[0] - R[0]) * ye + (ye = se[1] - R[1]) * ye, N = (N = ue[0] - z[0]) * N + (N = ue[1] - z[1]) * N;
                be = $(be, Math.sqrt(ye / N)), i = [(R[0] + se[0]) / 2, (R[1] + se[1]) / 2], f = [(z[0] + ue[0]) / 2, (z[1] + ue[1]) / 2];
              } else if (u.touch0)
                i = u.touch0[0], f = u.touch0[1];
              else
                return;
              u.zoom("touch", T(E(be, i, f), u.extent, C));
            }
            function w() {
              var u = ae(this, arguments), Z = ee.event.changedTouches, re = Z.length, de, be;
              for (m(), Ce && clearTimeout(Ce), Ce = setTimeout(function() {
                Ce = null;
              }, he), de = 0; de < re; ++de)
                be = Z[de], u.touch0 && u.touch0[2] === be.identifier ? delete u.touch0 : u.touch1 && u.touch1[2] === be.identifier && delete u.touch1;
              u.touch1 && !u.touch0 && (u.touch0 = u.touch1, delete u.touch1), u.touch0 ? u.touch0[1] = this.__zoom.invert(u.touch0[0]) : u.end();
            }
            return P.wheelDelta = function(u) {
              return arguments.length ? (n = typeof u == "function" ? u : t(+u), P) : n;
            }, P.filter = function(u) {
              return arguments.length ? (y = typeof u == "function" ? u : t(!!u), P) : y;
            }, P.touchable = function(u) {
              return arguments.length ? (r = typeof u == "function" ? u : t(!!u), P) : r;
            }, P.extent = function(u) {
              return arguments.length ? (v = typeof u == "function" ? u : t([[+u[0][0], +u[0][1]], [+u[1][0], +u[1][1]]]), P) : v;
            }, P.scaleExtent = function(u) {
              return arguments.length ? (b[0] = +u[0], b[1] = +u[1], P) : [b[0], b[1]];
            }, P.translateExtent = function(u) {
              return arguments.length ? (C[0][0] = +u[0][0], C[1][0] = +u[1][0], C[0][1] = +u[0][1], C[1][1] = +u[1][1], P) : [[C[0][0], C[0][1]], [C[1][0], C[1][1]]];
            }, P.constrain = function(u) {
              return arguments.length ? (T = u, P) : T;
            }, P.duration = function(u) {
              return arguments.length ? (ne = +u, P) : ne;
            }, P.interpolate = function(u) {
              return arguments.length ? (ge = u, P) : ge;
            }, P.on = function() {
              var u = xe.on.apply(xe, arguments);
              return u === xe ? P : u;
            }, P.clickDistance = function(u) {
              return arguments.length ? (G = (u = +u) * u, P) : Math.sqrt(G);
            }, P;
          };
          d.d(O, "zoom", function() {
            return W;
          }), d.d(O, "zoomTransform", function() {
            return x;
          }), d.d(O, "zoomIdentity", function() {
            return h;
          });
        },
        /* 92 */
        /***/
        function(Te, O, d) {
          d.r(O);
          var a = d(8), X = d(7), q = d(2), ee = d(0), j = d(11), t = function(Ce) {
            return function() {
              return Ce;
            };
          }, F = function(Ce, he, le) {
            this.target = Ce, this.type = he, this.selection = le;
          };
          function M() {
            ee.event.stopImmediatePropagation();
          }
          var h = function() {
            ee.event.preventDefault(), ee.event.stopImmediatePropagation();
          }, x = { name: "drag" }, m = { name: "space" }, D = { name: "handle" }, H = { name: "center" }, B = {
            name: "x",
            handles: ["e", "w"].map(T),
            input: function(Ce, he) {
              return Ce && [[Ce[0], he[0][1]], [Ce[1], he[1][1]]];
            },
            output: function(Ce) {
              return Ce && [Ce[0][0], Ce[1][0]];
            }
          }, k = {
            name: "y",
            handles: ["n", "s"].map(T),
            input: function(Ce, he) {
              return Ce && [[he[0][0], Ce[0]], [he[1][0], Ce[1]]];
            },
            output: function(Ce) {
              return Ce && [Ce[0][1], Ce[1][1]];
            }
          }, _ = {
            name: "xy",
            handles: ["n", "e", "s", "w", "nw", "ne", "se", "sw"].map(T),
            input: function(Ce) {
              return Ce;
            },
            output: function(Ce) {
              return Ce;
            }
          }, Q = {
            overlay: "crosshair",
            selection: "move",
            n: "ns-resize",
            e: "ew-resize",
            s: "ns-resize",
            w: "ew-resize",
            nw: "nwse-resize",
            ne: "nesw-resize",
            se: "nwse-resize",
            sw: "nesw-resize"
          }, o = {
            e: "w",
            w: "e",
            nw: "ne",
            ne: "nw",
            se: "sw",
            sw: "se"
          }, W = {
            n: "s",
            s: "n",
            nw: "sw",
            ne: "se",
            se: "ne",
            sw: "nw"
          }, y = {
            overlay: 1,
            selection: 1,
            n: null,
            e: 1,
            s: null,
            w: -1,
            nw: -1,
            ne: 1,
            se: 1,
            sw: -1
          }, v = {
            overlay: 1,
            selection: 1,
            n: -1,
            e: null,
            s: 1,
            w: null,
            nw: -1,
            ne: -1,
            se: 1,
            sw: 1
          };
          function T(Ce) {
            return { type: Ce };
          }
          function n() {
            return !ee.event.button;
          }
          function r() {
            var Ce = this.ownerSVGElement || this;
            return [[0, 0], [Ce.width.baseVal.value, Ce.height.baseVal.value]];
          }
          function b(Ce) {
            for (; !Ce.__brush; )
              if (!(Ce = Ce.parentNode))
                return;
            return Ce.__brush;
          }
          function C(Ce) {
            return Ce[0][0] === Ce[1][0] || Ce[0][1] === Ce[1][1];
          }
          function ne(Ce) {
            var he = Ce.__brush;
            return he ? he.dim.output(he.selection) : null;
          }
          function ge() {
            return fe(B);
          }
          function ce() {
            return fe(k);
          }
          var xe = function() {
            return fe(_);
          };
          function fe(Ce) {
            var he = r, le = n, G = Object(a.a)(E, "start", "brush", "end"), P = 6, $;
            function E(g) {
              var U = g.property("__brush", s).selectAll(".overlay").data([T("overlay")]);
              U.enter().append("rect").attr("class", "overlay").attr("pointer-events", "all").attr("cursor", Q.overlay).merge(U).each(function() {
                var p = b(this).extent;
                Object(ee.select)(this).attr("x", p[0][0]).attr("y", p[0][1]).attr("width", p[1][0] - p[0][0]).attr("height", p[1][1] - p[0][1]);
              }), g.selectAll(".selection").data([T("selection")]).enter().append("rect").attr("class", "selection").attr("cursor", Q.selection).attr("fill", "#777").attr("fill-opacity", 0.3).attr("stroke", "#fff").attr("shape-rendering", "crispEdges");
              var Y = g.selectAll(".handle").data(Ce.handles, function(p) {
                return p.type;
              });
              Y.exit().remove(), Y.enter().append("rect").attr("class", function(p) {
                return "handle handle--" + p.type;
              }).attr("cursor", function(p) {
                return Q[p.type];
              }), g.each(V).attr("fill", "none").attr("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush touchstart.brush", K);
            }
            E.move = function(g, U) {
              g.selection ? g.on("start.brush", function() {
                ie(this, arguments).beforestart().start();
              }).on("interrupt.brush end.brush", function() {
                ie(this, arguments).end();
              }).tween("brush", function() {
                var Y = this, p = Y.__brush, w = ie(Y, arguments), u = p.selection, Z = Ce.input(typeof U == "function" ? U.apply(this, arguments) : U, p.extent), re = Object(q.a)(u, Z);
                function de(be) {
                  p.selection = be === 1 && C(Z) ? null : re(be), V.call(Y), w.brush();
                }
                return u && Z ? de : de(1);
              }) : g.each(function() {
                var Y = this, p = arguments, w = Y.__brush, u = Ce.input(typeof U == "function" ? U.apply(Y, p) : U, w.extent), Z = ie(Y, p).beforestart();
                Object(j.a)(Y), w.selection = u == null || C(u) ? null : u, V.call(Y), Z.start().brush().end();
              });
            };
            function V() {
              var g = Object(ee.select)(this), U = b(this).selection;
              U ? (g.selectAll(".selection").style("display", null).attr("x", U[0][0]).attr("y", U[0][1]).attr("width", U[1][0] - U[0][0]).attr("height", U[1][1] - U[0][1]), g.selectAll(".handle").style("display", null).attr("x", function(Y) {
                return Y.type[Y.type.length - 1] === "e" ? U[1][0] - P / 2 : U[0][0] - P / 2;
              }).attr("y", function(Y) {
                return Y.type[0] === "s" ? U[1][1] - P / 2 : U[0][1] - P / 2;
              }).attr("width", function(Y) {
                return Y.type === "n" || Y.type === "s" ? U[1][0] - U[0][0] + P : P;
              }).attr("height", function(Y) {
                return Y.type === "e" || Y.type === "w" ? U[1][1] - U[0][1] + P : P;
              })) : g.selectAll(".selection,.handle").style("display", "none").attr("x", null).attr("y", null).attr("width", null).attr("height", null);
            }
            function ie(g, U) {
              return g.__brush.emitter || new ae(g, U);
            }
            function ae(g, U) {
              this.that = g, this.args = U, this.state = g.__brush, this.active = 0;
            }
            ae.prototype = {
              beforestart: function() {
                return ++this.active === 1 && (this.state.emitter = this, this.starting = !0), this;
              },
              start: function() {
                return this.starting && (this.starting = !1, this.emit("start")), this;
              },
              brush: function() {
                return this.emit("brush"), this;
              },
              end: function() {
                return --this.active === 0 && (delete this.state.emitter, this.emit("end")), this;
              },
              emit: function(g) {
                Object(ee.customEvent)(new F(E, g, Ce.output(this.state.selection)), G.apply, G, [g, this.that, this.args]);
              }
            };
            function K() {
              if (ee.event.touches) {
                if (ee.event.changedTouches.length < ee.event.touches.length)
                  return h();
              } else if ($)
                return;
              if (!le.apply(this, arguments))
                return;
              var g = this, U = ee.event.target.__data__.type, Y = (ee.event.metaKey ? U = "overlay" : U) === "selection" ? x : ee.event.altKey ? H : D, p = Ce === k ? null : y[U], w = Ce === B ? null : v[U], u = b(g), Z = u.extent, re = u.selection, de = Z[0][0], be, i, f = Z[0][1], R, z, se = Z[1][0], ue, ye, N = Z[1][1], c, J, oe, Be, Ye, We = !1, Ke, et, nt = Object(ee.mouse)(g), pt = nt, Et = ie(g, arguments).beforestart();
              U === "overlay" ? u.selection = re = [
                [be = Ce === k ? de : nt[0], R = Ce === B ? f : nt[1]],
                [ue = Ce === k ? se : be, c = Ce === B ? N : R]
              ] : (be = re[0][0], R = re[0][1], ue = re[1][0], c = re[1][1]), i = be, z = R, ye = ue, J = c;
              var gt = Object(ee.select)(g).attr("pointer-events", "none"), bt = gt.selectAll(".overlay").attr("cursor", Q[U]);
              if (ee.event.touches)
                gt.on("touchmove.brush", St, !0).on("touchend.brush touchcancel.brush", Wt, !0);
              else {
                var Bt = Object(ee.select)(ee.event.view).on("keydown.brush", Kt, !0).on("keyup.brush", Ot, !0).on("mousemove.brush", St, !0).on("mouseup.brush", Wt, !0);
                Object(X.dragDisable)(ee.event.view);
              }
              M(), Object(j.a)(g), V.call(g), Et.start();
              function St() {
                var It = Object(ee.mouse)(g);
                We && !Ke && !et && (Math.abs(It[0] - pt[0]) > Math.abs(It[1] - pt[1]) ? et = !0 : Ke = !0), pt = It, Ye = !0, h(), Nt();
              }
              function Nt() {
                var It;
                switch (oe = pt[0] - nt[0], Be = pt[1] - nt[1], Y) {
                  case m:
                  case x: {
                    p && (oe = Math.max(de - be, Math.min(se - ue, oe)), i = be + oe, ye = ue + oe), w && (Be = Math.max(f - R, Math.min(N - c, Be)), z = R + Be, J = c + Be);
                    break;
                  }
                  case D: {
                    p < 0 ? (oe = Math.max(de - be, Math.min(se - be, oe)), i = be + oe, ye = ue) : p > 0 && (oe = Math.max(de - ue, Math.min(se - ue, oe)), i = be, ye = ue + oe), w < 0 ? (Be = Math.max(f - R, Math.min(N - R, Be)), z = R + Be, J = c) : w > 0 && (Be = Math.max(f - c, Math.min(N - c, Be)), z = R, J = c + Be);
                    break;
                  }
                  case H: {
                    p && (i = Math.max(de, Math.min(se, be - oe * p)), ye = Math.max(de, Math.min(se, ue + oe * p))), w && (z = Math.max(f, Math.min(N, R - Be * w)), J = Math.max(f, Math.min(N, c + Be * w)));
                    break;
                  }
                }
                ye < i && (p *= -1, It = be, be = ue, ue = It, It = i, i = ye, ye = It, U in o && bt.attr("cursor", Q[U = o[U]])), J < z && (w *= -1, It = R, R = c, c = It, It = z, z = J, J = It, U in W && bt.attr("cursor", Q[U = W[U]])), u.selection && (re = u.selection), Ke && (i = re[0][0], ye = re[1][0]), et && (z = re[0][1], J = re[1][1]), (re[0][0] !== i || re[0][1] !== z || re[1][0] !== ye || re[1][1] !== J) && (u.selection = [[i, z], [ye, J]], V.call(g), Et.brush());
              }
              function Wt() {
                if (M(), ee.event.touches) {
                  if (ee.event.touches.length)
                    return;
                  $ && clearTimeout($), $ = setTimeout(function() {
                    $ = null;
                  }, 500), gt.on("touchmove.brush touchend.brush touchcancel.brush", null);
                } else
                  Object(X.dragEnable)(ee.event.view, Ye), Bt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
                gt.attr("pointer-events", "all"), bt.attr("cursor", Q.overlay), u.selection && (re = u.selection), C(re) && (u.selection = null, V.call(g)), Et.end();
              }
              function Kt() {
                switch (ee.event.keyCode) {
                  case 16: {
                    We = p && w;
                    break;
                  }
                  case 18: {
                    Y === D && (p && (ue = ye - oe * p, be = i + oe * p), w && (c = J - Be * w, R = z + Be * w), Y = H, Nt());
                    break;
                  }
                  case 32: {
                    (Y === D || Y === H) && (p < 0 ? ue = ye - oe : p > 0 && (be = i - oe), w < 0 ? c = J - Be : w > 0 && (R = z - Be), Y = m, bt.attr("cursor", Q.selection), Nt());
                    break;
                  }
                  default:
                    return;
                }
                h();
              }
              function Ot() {
                switch (ee.event.keyCode) {
                  case 16: {
                    We && (Ke = et = We = !1, Nt());
                    break;
                  }
                  case 18: {
                    Y === H && (p < 0 ? ue = ye : p > 0 && (be = i), w < 0 ? c = J : w > 0 && (R = z), Y = D, Nt());
                    break;
                  }
                  case 32: {
                    Y === m && (ee.event.altKey ? (p && (ue = ye - oe * p, be = i + oe * p), w && (c = J - Be * w, R = z + Be * w), Y = H) : (p < 0 ? ue = ye : p > 0 && (be = i), w < 0 ? c = J : w > 0 && (R = z), Y = D), bt.attr("cursor", Q[U]), Nt());
                    break;
                  }
                  default:
                    return;
                }
                h();
              }
            }
            function s() {
              var g = this.__brush || { selection: null };
              return g.extent = he.apply(this, arguments), g.dim = Ce, g;
            }
            return E.extent = function(g) {
              return arguments.length ? (he = typeof g == "function" ? g : t([[+g[0][0], +g[0][1]], [+g[1][0], +g[1][1]]]), E) : he;
            }, E.filter = function(g) {
              return arguments.length ? (le = typeof g == "function" ? g : t(!!g), E) : le;
            }, E.handleSize = function(g) {
              return arguments.length ? (P = +g, E) : P;
            }, E.on = function() {
              var g = G.on.apply(G, arguments);
              return g === G ? E : g;
            }, E;
          }
          d.d(O, "brush", function() {
            return xe;
          }), d.d(O, "brushX", function() {
            return ge;
          }), d.d(O, "brushY", function() {
            return ce;
          }), d.d(O, "brushSelection", function() {
            return ne;
          });
        }
        /******/
      ])
    );
  });
})(Wn);
var qr = Wn.exports;
function $r({ model: qt, el: wn }) {
  let tn = document.createElement("div"), Te = wn.getBoundingClientRect();
  wn.appendChild(tn);
  let O = qt.get("reaction_styles");
  qt.get("map_name");
  let d = qt.get("map_json"), a = qt.get("reaction_data"), X = qt.get("reaction_scale"), q = qt.get("never_ask_before_quit");
  tn.style.width = Te.width.toString() + "px";
  let ee = Math.max(Te.width / 2, 350 + Te.width * 0.2 - 34);
  tn.style.height = ee.toString() + "px";
  let j = qr.Builder(
    JSON.parse(d),
    null,
    null,
    tn,
    {
      reaction_styles: O,
      reaction_data: a,
      reaction_scale: X,
      never_ask_before_quit: q
    }
  );
  qt.on("change:reaction_scale", () => {
    j.options.reaction_scale = qt.get("reaction_scale");
  });
}
const ei = { render: $r };
export {
  ei as default
};
