import { aJ as $, aK as He, aL as T, af as y, aM as Ye, aN as Ze, ae as Ae, aO as qe, aP as Oe, aQ as D, ac as q, aR as Xe, aS as Te, aT as Je, aU as C, al as Ee, aV as x, a7 as me, aW as Qe, aX as Y, aY as We, aZ as ze, a_ as L, ak as Ve, a$ as ke, ad as en, b0 as ne, b1 as nn, b2 as rn, aj as tn, ai as we, ag as sn, b3 as j, aa as an, b4 as un, am as F, z as re, b5 as te } from "./index-B4uS92Er.mjs";
var fn = "[object Symbol]";
function X(e) {
  return typeof e == "symbol" || $(e) && He(e) == fn;
}
function Pe(e, n) {
  for (var r = -1, t = e == null ? 0 : e.length, i = Array(t); ++r < t; )
    i[r] = n(e[r], r, e);
  return i;
}
var ie = T ? T.prototype : void 0, se = ie ? ie.toString : void 0;
function ve(e) {
  if (typeof e == "string")
    return e;
  if (y(e))
    return Pe(e, ve) + "";
  if (X(e))
    return se ? se.call(e) : "";
  var n = e + "";
  return n == "0" && 1 / e == -1 / 0 ? "-0" : n;
}
function on() {
}
function Le(e, n) {
  for (var r = -1, t = e == null ? 0 : e.length; ++r < t && n(e[r], r, e) !== !1; )
    ;
  return e;
}
function dn(e, n, r, t) {
  for (var i = e.length, s = r + -1; ++s < i; )
    if (n(e[s], s, e))
      return s;
  return -1;
}
function hn(e) {
  return e !== e;
}
function ln(e, n, r) {
  for (var t = r - 1, i = e.length; ++t < i; )
    if (e[t] === n)
      return t;
  return -1;
}
function gn(e, n, r) {
  return n === n ? ln(e, n, r) : dn(e, hn, r);
}
function cn(e, n) {
  var r = e == null ? 0 : e.length;
  return !!r && gn(e, n, 0) > -1;
}
function O(e) {
  return Ae(e) ? Ye(e) : Ze(e);
}
var _n = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, pn = /^\w*$/;
function J(e, n) {
  if (y(e))
    return !1;
  var r = typeof e;
  return r == "number" || r == "symbol" || r == "boolean" || e == null || X(e) ? !0 : pn.test(e) || !_n.test(e) || n != null && e in Object(n);
}
var bn = 500;
function yn(e) {
  var n = qe(e, function(t) {
    return r.size === bn && r.clear(), t;
  }), r = n.cache;
  return n;
}
var An = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, On = /\\(\\)?/g, Tn = yn(function(e) {
  var n = [];
  return e.charCodeAt(0) === 46 && n.push(""), e.replace(An, function(r, t, i, s) {
    n.push(i ? s.replace(On, "$1") : t || r);
  }), n;
});
function En(e) {
  return e == null ? "" : ve(e);
}
function $e(e, n) {
  return y(e) ? e : J(e, n) ? [e] : Tn(En(e));
}
function G(e) {
  if (typeof e == "string" || X(e))
    return e;
  var n = e + "";
  return n == "0" && 1 / e == -1 / 0 ? "-0" : n;
}
function Ce(e, n) {
  n = $e(n, e);
  for (var r = 0, t = n.length; e != null && r < t; )
    e = e[G(n[r++])];
  return r && r == t ? e : void 0;
}
function mn(e, n, r) {
  var t = e == null ? void 0 : Ce(e, n);
  return t === void 0 ? r : t;
}
function Q(e, n) {
  for (var r = -1, t = n.length, i = e.length; ++r < t; )
    e[i + r] = n[r];
  return e;
}
var ae = T ? T.isConcatSpreadable : void 0;
function wn(e) {
  return y(e) || Oe(e) || !!(ae && e && e[ae]);
}
function Pn(e, n, r, t, i) {
  var s = -1, a = e.length;
  for (r || (r = wn), i || (i = []); ++s < a; ) {
    var u = e[s];
    r(u) ? Q(i, u) : t || (i[i.length] = u);
  }
  return i;
}
function vn(e, n, r, t) {
  var i = -1, s = e == null ? 0 : e.length;
  for (t && s && (r = e[++i]); ++i < s; )
    r = n(r, e[i], i, e);
  return r;
}
function Ln(e, n) {
  return e && D(n, O(n), e);
}
function $n(e, n) {
  return e && D(n, q(n), e);
}
function Ie(e, n) {
  for (var r = -1, t = e == null ? 0 : e.length, i = 0, s = []; ++r < t; ) {
    var a = e[r];
    n(a, r, e) && (s[i++] = a);
  }
  return s;
}
function Se() {
  return [];
}
var Cn = Object.prototype, In = Cn.propertyIsEnumerable, ue = Object.getOwnPropertySymbols, W = ue ? function(e) {
  return e == null ? [] : (e = Object(e), Ie(ue(e), function(n) {
    return In.call(e, n);
  }));
} : Se;
function Sn(e, n) {
  return D(e, W(e), n);
}
var Nn = Object.getOwnPropertySymbols, Ne = Nn ? function(e) {
  for (var n = []; e; )
    Q(n, W(e)), e = Xe(e);
  return n;
} : Se;
function Fn(e, n) {
  return D(e, Ne(e), n);
}
function Fe(e, n, r) {
  var t = n(e);
  return y(e) ? t : Q(t, r(e));
}
function Z(e) {
  return Fe(e, O, W);
}
function Mn(e) {
  return Fe(e, q, Ne);
}
var Rn = Object.prototype, xn = Rn.hasOwnProperty;
function Dn(e) {
  var n = e.length, r = new e.constructor(n);
  return n && typeof e[0] == "string" && xn.call(e, "index") && (r.index = e.index, r.input = e.input), r;
}
function Gn(e, n) {
  var r = n ? Te(e.buffer) : e.buffer;
  return new e.constructor(r, e.byteOffset, e.byteLength);
}
var jn = /\w*$/;
function Un(e) {
  var n = new e.constructor(e.source, jn.exec(e));
  return n.lastIndex = e.lastIndex, n;
}
var fe = T ? T.prototype : void 0, oe = fe ? fe.valueOf : void 0;
function Bn(e) {
  return oe ? Object(oe.call(e)) : {};
}
var Kn = "[object Boolean]", Hn = "[object Date]", Yn = "[object Map]", Zn = "[object Number]", qn = "[object RegExp]", Xn = "[object Set]", Jn = "[object String]", Qn = "[object Symbol]", Wn = "[object ArrayBuffer]", zn = "[object DataView]", Vn = "[object Float32Array]", kn = "[object Float64Array]", er = "[object Int8Array]", nr = "[object Int16Array]", rr = "[object Int32Array]", tr = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", sr = "[object Uint16Array]", ar = "[object Uint32Array]";
function ur(e, n, r) {
  var t = e.constructor;
  switch (n) {
    case Wn:
      return Te(e);
    case Kn:
    case Hn:
      return new t(+e);
    case zn:
      return Gn(e, r);
    case Vn:
    case kn:
    case er:
    case nr:
    case rr:
    case tr:
    case ir:
    case sr:
    case ar:
      return Je(e, r);
    case Yn:
      return new t();
    case Zn:
    case Jn:
      return new t(e);
    case qn:
      return Un(e);
    case Xn:
      return new t();
    case Qn:
      return Bn(e);
  }
}
var fr = "[object Map]";
function or(e) {
  return $(e) && C(e) == fr;
}
var de = x && x.isMap, dr = de ? Ee(de) : or, hr = "[object Set]";
function lr(e) {
  return $(e) && C(e) == hr;
}
var he = x && x.isSet, gr = he ? Ee(he) : lr, cr = 1, _r = 2, pr = 4, Me = "[object Arguments]", br = "[object Array]", yr = "[object Boolean]", Ar = "[object Date]", Or = "[object Error]", Re = "[object Function]", Tr = "[object GeneratorFunction]", Er = "[object Map]", mr = "[object Number]", xe = "[object Object]", wr = "[object RegExp]", Pr = "[object Set]", vr = "[object String]", Lr = "[object Symbol]", $r = "[object WeakMap]", Cr = "[object ArrayBuffer]", Ir = "[object DataView]", Sr = "[object Float32Array]", Nr = "[object Float64Array]", Fr = "[object Int8Array]", Mr = "[object Int16Array]", Rr = "[object Int32Array]", xr = "[object Uint8Array]", Dr = "[object Uint8ClampedArray]", Gr = "[object Uint16Array]", jr = "[object Uint32Array]", d = {};
d[Me] = d[br] = d[Cr] = d[Ir] = d[yr] = d[Ar] = d[Sr] = d[Nr] = d[Fr] = d[Mr] = d[Rr] = d[Er] = d[mr] = d[xe] = d[wr] = d[Pr] = d[vr] = d[Lr] = d[xr] = d[Dr] = d[Gr] = d[jr] = !0;
d[Or] = d[Re] = d[$r] = !1;
function U(e, n, r, t, i, s) {
  var a, u = n & cr, f = n & _r, g = n & pr;
  if (a !== void 0)
    return a;
  if (!me(e))
    return e;
  var l = y(e);
  if (l) {
    if (a = Dn(e), !u)
      return Qe(e, a);
  } else {
    var o = C(e), h = o == Re || o == Tr;
    if (Y(e))
      return We(e, u);
    if (o == xe || o == Me || h && !i) {
      if (a = f || h ? {} : ze(e), !u)
        return f ? Fn(e, $n(a, e)) : Sn(e, Ln(a, e));
    } else {
      if (!d[o])
        return i ? e : {};
      a = ur(e, o, u);
    }
  }
  s || (s = new L());
  var A = s.get(e);
  if (A)
    return A;
  s.set(e, a), gr(e) ? e.forEach(function(c) {
    a.add(U(c, n, r, c, e, s));
  }) : dr(e) && e.forEach(function(c, _) {
    a.set(_, U(c, n, r, _, e, s));
  });
  var p = g ? f ? Mn : Z : f ? q : O, b = l ? void 0 : p(e);
  return Le(b || e, function(c, _) {
    b && (_ = c, c = e[_]), Ve(a, _, U(c, n, r, _, e, s));
  }), a;
}
var Ur = "__lodash_hash_undefined__";
function Br(e) {
  return this.__data__.set(e, Ur), this;
}
function Kr(e) {
  return this.__data__.has(e);
}
function I(e) {
  var n = -1, r = e == null ? 0 : e.length;
  for (this.__data__ = new ke(); ++n < r; )
    this.add(e[n]);
}
I.prototype.add = I.prototype.push = Br;
I.prototype.has = Kr;
function Hr(e, n) {
  for (var r = -1, t = e == null ? 0 : e.length; ++r < t; )
    if (n(e[r], r, e))
      return !0;
  return !1;
}
function De(e, n) {
  return e.has(n);
}
var Yr = 1, Zr = 2;
function Ge(e, n, r, t, i, s) {
  var a = r & Yr, u = e.length, f = n.length;
  if (u != f && !(a && f > u))
    return !1;
  var g = s.get(e), l = s.get(n);
  if (g && l)
    return g == n && l == e;
  var o = -1, h = !0, A = r & Zr ? new I() : void 0;
  for (s.set(e, n), s.set(n, e); ++o < u; ) {
    var p = e[o], b = n[o];
    if (t)
      var c = a ? t(b, p, o, n, e, s) : t(p, b, o, e, n, s);
    if (c !== void 0) {
      if (c)
        continue;
      h = !1;
      break;
    }
    if (A) {
      if (!Hr(n, function(_, E) {
        if (!De(A, E) && (p === _ || i(p, _, r, t, s)))
          return A.push(E);
      })) {
        h = !1;
        break;
      }
    } else if (!(p === b || i(p, b, r, t, s))) {
      h = !1;
      break;
    }
  }
  return s.delete(e), s.delete(n), h;
}
function qr(e) {
  var n = -1, r = Array(e.size);
  return e.forEach(function(t, i) {
    r[++n] = [i, t];
  }), r;
}
function z(e) {
  var n = -1, r = Array(e.size);
  return e.forEach(function(t) {
    r[++n] = t;
  }), r;
}
var Xr = 1, Jr = 2, Qr = "[object Boolean]", Wr = "[object Date]", zr = "[object Error]", Vr = "[object Map]", kr = "[object Number]", et = "[object RegExp]", nt = "[object Set]", rt = "[object String]", tt = "[object Symbol]", it = "[object ArrayBuffer]", st = "[object DataView]", le = T ? T.prototype : void 0, B = le ? le.valueOf : void 0;
function at(e, n, r, t, i, s, a) {
  switch (r) {
    case st:
      if (e.byteLength != n.byteLength || e.byteOffset != n.byteOffset)
        return !1;
      e = e.buffer, n = n.buffer;
    case it:
      return !(e.byteLength != n.byteLength || !s(new ne(e), new ne(n)));
    case Qr:
    case Wr:
    case kr:
      return en(+e, +n);
    case zr:
      return e.name == n.name && e.message == n.message;
    case et:
    case rt:
      return e == n + "";
    case Vr:
      var u = qr;
    case nt:
      var f = t & Xr;
      if (u || (u = z), e.size != n.size && !f)
        return !1;
      var g = a.get(e);
      if (g)
        return g == n;
      t |= Jr, a.set(e, n);
      var l = Ge(u(e), u(n), t, i, s, a);
      return a.delete(e), l;
    case tt:
      if (B)
        return B.call(e) == B.call(n);
  }
  return !1;
}
var ut = 1, ft = Object.prototype, ot = ft.hasOwnProperty;
function dt(e, n, r, t, i, s) {
  var a = r & ut, u = Z(e), f = u.length, g = Z(n), l = g.length;
  if (f != l && !a)
    return !1;
  for (var o = f; o--; ) {
    var h = u[o];
    if (!(a ? h in n : ot.call(n, h)))
      return !1;
  }
  var A = s.get(e), p = s.get(n);
  if (A && p)
    return A == n && p == e;
  var b = !0;
  s.set(e, n), s.set(n, e);
  for (var c = a; ++o < f; ) {
    h = u[o];
    var _ = e[h], E = n[h];
    if (t)
      var ee = a ? t(E, _, h, n, e, s) : t(_, E, h, e, n, s);
    if (!(ee === void 0 ? _ === E || i(_, E, r, t, s) : ee)) {
      b = !1;
      break;
    }
    c || (c = h == "constructor");
  }
  if (b && !c) {
    var S = e.constructor, N = n.constructor;
    S != N && "constructor" in e && "constructor" in n && !(typeof S == "function" && S instanceof S && typeof N == "function" && N instanceof N) && (b = !1);
  }
  return s.delete(e), s.delete(n), b;
}
var ht = 1, ge = "[object Arguments]", ce = "[object Array]", M = "[object Object]", lt = Object.prototype, _e = lt.hasOwnProperty;
function gt(e, n, r, t, i, s) {
  var a = y(e), u = y(n), f = a ? ce : C(e), g = u ? ce : C(n);
  f = f == ge ? M : f, g = g == ge ? M : g;
  var l = f == M, o = g == M, h = f == g;
  if (h && Y(e)) {
    if (!Y(n))
      return !1;
    a = !0, l = !1;
  }
  if (h && !l)
    return s || (s = new L()), a || nn(e) ? Ge(e, n, r, t, i, s) : at(e, n, f, r, t, i, s);
  if (!(r & ht)) {
    var A = l && _e.call(e, "__wrapped__"), p = o && _e.call(n, "__wrapped__");
    if (A || p) {
      var b = A ? e.value() : e, c = p ? n.value() : n;
      return s || (s = new L()), i(b, c, r, t, s);
    }
  }
  return h ? (s || (s = new L()), dt(e, n, r, t, i, s)) : !1;
}
function V(e, n, r, t, i) {
  return e === n ? !0 : e == null || n == null || !$(e) && !$(n) ? e !== e && n !== n : gt(e, n, r, t, V, i);
}
var ct = 1, _t = 2;
function pt(e, n, r, t) {
  var i = r.length, s = i;
  if (e == null)
    return !s;
  for (e = Object(e); i--; ) {
    var a = r[i];
    if (a[2] ? a[1] !== e[a[0]] : !(a[0] in e))
      return !1;
  }
  for (; ++i < s; ) {
    a = r[i];
    var u = a[0], f = e[u], g = a[1];
    if (a[2]) {
      if (f === void 0 && !(u in e))
        return !1;
    } else {
      var l = new L(), o;
      if (!(o === void 0 ? V(g, f, ct | _t, t, l) : o))
        return !1;
    }
  }
  return !0;
}
function je(e) {
  return e === e && !me(e);
}
function bt(e) {
  for (var n = O(e), r = n.length; r--; ) {
    var t = n[r], i = e[t];
    n[r] = [t, i, je(i)];
  }
  return n;
}
function Ue(e, n) {
  return function(r) {
    return r == null ? !1 : r[e] === n && (n !== void 0 || e in Object(r));
  };
}
function yt(e) {
  var n = bt(e);
  return n.length == 1 && n[0][2] ? Ue(n[0][0], n[0][1]) : function(r) {
    return r === e || pt(r, e, n);
  };
}
function At(e, n) {
  return e != null && n in Object(e);
}
function Ot(e, n, r) {
  n = $e(n, e);
  for (var t = -1, i = n.length, s = !1; ++t < i; ) {
    var a = G(n[t]);
    if (!(s = e != null && r(e, a)))
      break;
    e = e[a];
  }
  return s || ++t != i ? s : (i = e == null ? 0 : e.length, !!i && rn(i) && tn(a, i) && (y(e) || Oe(e)));
}
function Tt(e, n) {
  return e != null && Ot(e, n, At);
}
var Et = 1, mt = 2;
function wt(e, n) {
  return J(e) && je(n) ? Ue(G(e), n) : function(r) {
    var t = mn(r, e);
    return t === void 0 && t === n ? Tt(r, e) : V(n, t, Et | mt);
  };
}
function Pt(e) {
  return function(n) {
    return n?.[e];
  };
}
function vt(e) {
  return function(n) {
    return Ce(n, e);
  };
}
function Lt(e) {
  return J(e) ? Pt(G(e)) : vt(e);
}
function Be(e) {
  return typeof e == "function" ? e : e == null ? we : typeof e == "object" ? y(e) ? wt(e[0], e[1]) : yt(e) : Lt(e);
}
function $t(e, n) {
  return e && sn(e, n, O);
}
function Ct(e, n) {
  return function(r, t) {
    if (r == null)
      return r;
    if (!Ae(r))
      return e(r, t);
    for (var i = r.length, s = -1, a = Object(r); ++s < i && t(a[s], s, a) !== !1; )
      ;
    return r;
  };
}
var k = Ct($t);
function It(e) {
  return typeof e == "function" ? e : we;
}
function m(e, n) {
  var r = y(e) ? Le : k;
  return r(e, It(n));
}
function St(e, n) {
  var r = [];
  return k(e, function(t, i, s) {
    n(t, i, s) && r.push(t);
  }), r;
}
function R(e, n) {
  var r = y(e) ? Ie : St;
  return r(e, Be(n));
}
function Nt(e, n) {
  return Pe(n, function(r) {
    return e[r];
  });
}
function K(e) {
  return e == null ? [] : Nt(e, O(e));
}
function P(e) {
  return e === void 0;
}
function Ft(e, n, r, t, i) {
  return i(e, function(s, a, u) {
    r = t ? (t = !1, s) : n(r, s, a, u);
  }), r;
}
function Mt(e, n, r) {
  var t = y(e) ? vn : Ft, i = arguments.length < 3;
  return t(e, Be(n), r, i, k);
}
var Rt = 1 / 0, xt = j && 1 / z(new j([, -0]))[1] == Rt ? function(e) {
  return new j(e);
} : on, Dt = 200;
function Gt(e, n, r) {
  var t = -1, i = cn, s = e.length, a = !0, u = [], f = u;
  if (s >= Dt) {
    var g = xt(e);
    if (g)
      return z(g);
    a = !1, i = De, f = new I();
  } else
    f = u;
  e:
    for (; ++t < s; ) {
      var l = e[t], o = l;
      if (l = l !== 0 ? l : 0, a && o === o) {
        for (var h = f.length; h--; )
          if (f[h] === o)
            continue e;
        u.push(l);
      } else i(f, o, r) || (f !== u && f.push(o), u.push(l));
    }
  return u;
}
var jt = an(function(e) {
  return Gt(Pn(e, 1, un, !0));
}), Ut = "\0", w = "\0", pe = "";
class Ke {
  constructor(n = {}) {
    this._isDirected = Object.prototype.hasOwnProperty.call(n, "directed") ? n.directed : !0, this._isMultigraph = Object.prototype.hasOwnProperty.call(n, "multigraph") ? n.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(n, "compound") ? n.compound : !1, this._label = void 0, this._defaultNodeLabelFn = F(void 0), this._defaultEdgeLabelFn = F(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[w] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
  }
  /* === Graph functions ========= */
  isDirected() {
    return this._isDirected;
  }
  isMultigraph() {
    return this._isMultigraph;
  }
  isCompound() {
    return this._isCompound;
  }
  setGraph(n) {
    return this._label = n, this;
  }
  graph() {
    return this._label;
  }
  /* === Node functions ========== */
  setDefaultNodeLabel(n) {
    return re(n) || (n = F(n)), this._defaultNodeLabelFn = n, this;
  }
  nodeCount() {
    return this._nodeCount;
  }
  nodes() {
    return O(this._nodes);
  }
  sources() {
    var n = this;
    return R(this.nodes(), function(r) {
      return te(n._in[r]);
    });
  }
  sinks() {
    var n = this;
    return R(this.nodes(), function(r) {
      return te(n._out[r]);
    });
  }
  setNodes(n, r) {
    var t = arguments, i = this;
    return m(n, function(s) {
      t.length > 1 ? i.setNode(s, r) : i.setNode(s);
    }), this;
  }
  setNode(n, r) {
    return Object.prototype.hasOwnProperty.call(this._nodes, n) ? (arguments.length > 1 && (this._nodes[n] = r), this) : (this._nodes[n] = arguments.length > 1 ? r : this._defaultNodeLabelFn(n), this._isCompound && (this._parent[n] = w, this._children[n] = {}, this._children[w][n] = !0), this._in[n] = {}, this._preds[n] = {}, this._out[n] = {}, this._sucs[n] = {}, ++this._nodeCount, this);
  }
  node(n) {
    return this._nodes[n];
  }
  hasNode(n) {
    return Object.prototype.hasOwnProperty.call(this._nodes, n);
  }
  removeNode(n) {
    if (Object.prototype.hasOwnProperty.call(this._nodes, n)) {
      var r = (t) => this.removeEdge(this._edgeObjs[t]);
      delete this._nodes[n], this._isCompound && (this._removeFromParentsChildList(n), delete this._parent[n], m(this.children(n), (t) => {
        this.setParent(t);
      }), delete this._children[n]), m(O(this._in[n]), r), delete this._in[n], delete this._preds[n], m(O(this._out[n]), r), delete this._out[n], delete this._sucs[n], --this._nodeCount;
    }
    return this;
  }
  setParent(n, r) {
    if (!this._isCompound)
      throw new Error("Cannot set parent in a non-compound graph");
    if (P(r))
      r = w;
    else {
      r += "";
      for (var t = r; !P(t); t = this.parent(t))
        if (t === n)
          throw new Error("Setting " + r + " as parent of " + n + " would create a cycle");
      this.setNode(r);
    }
    return this.setNode(n), this._removeFromParentsChildList(n), this._parent[n] = r, this._children[r][n] = !0, this;
  }
  _removeFromParentsChildList(n) {
    delete this._children[this._parent[n]][n];
  }
  parent(n) {
    if (this._isCompound) {
      var r = this._parent[n];
      if (r !== w)
        return r;
    }
  }
  children(n) {
    if (P(n) && (n = w), this._isCompound) {
      var r = this._children[n];
      if (r)
        return O(r);
    } else {
      if (n === w)
        return this.nodes();
      if (this.hasNode(n))
        return [];
    }
  }
  predecessors(n) {
    var r = this._preds[n];
    if (r)
      return O(r);
  }
  successors(n) {
    var r = this._sucs[n];
    if (r)
      return O(r);
  }
  neighbors(n) {
    var r = this.predecessors(n);
    if (r)
      return jt(r, this.successors(n));
  }
  isLeaf(n) {
    var r;
    return this.isDirected() ? r = this.successors(n) : r = this.neighbors(n), r.length === 0;
  }
  filterNodes(n) {
    var r = new this.constructor({
      directed: this._isDirected,
      multigraph: this._isMultigraph,
      compound: this._isCompound
    });
    r.setGraph(this.graph());
    var t = this;
    m(this._nodes, function(a, u) {
      n(u) && r.setNode(u, a);
    }), m(this._edgeObjs, function(a) {
      r.hasNode(a.v) && r.hasNode(a.w) && r.setEdge(a, t.edge(a));
    });
    var i = {};
    function s(a) {
      var u = t.parent(a);
      return u === void 0 || r.hasNode(u) ? (i[a] = u, u) : u in i ? i[u] : s(u);
    }
    return this._isCompound && m(r.nodes(), function(a) {
      r.setParent(a, s(a));
    }), r;
  }
  /* === Edge functions ========== */
  setDefaultEdgeLabel(n) {
    return re(n) || (n = F(n)), this._defaultEdgeLabelFn = n, this;
  }
  edgeCount() {
    return this._edgeCount;
  }
  edges() {
    return K(this._edgeObjs);
  }
  setPath(n, r) {
    var t = this, i = arguments;
    return Mt(n, function(s, a) {
      return i.length > 1 ? t.setEdge(s, a, r) : t.setEdge(s, a), a;
    }), this;
  }
  /*
   * setEdge(v, w, [value, [name]])
   * setEdge({ v, w, [name] }, [value])
   */
  setEdge() {
    var n, r, t, i, s = !1, a = arguments[0];
    typeof a == "object" && a !== null && "v" in a ? (n = a.v, r = a.w, t = a.name, arguments.length === 2 && (i = arguments[1], s = !0)) : (n = a, r = arguments[1], t = arguments[3], arguments.length > 2 && (i = arguments[2], s = !0)), n = "" + n, r = "" + r, P(t) || (t = "" + t);
    var u = v(this._isDirected, n, r, t);
    if (Object.prototype.hasOwnProperty.call(this._edgeLabels, u))
      return s && (this._edgeLabels[u] = i), this;
    if (!P(t) && !this._isMultigraph)
      throw new Error("Cannot set a named edge when isMultigraph = false");
    this.setNode(n), this.setNode(r), this._edgeLabels[u] = s ? i : this._defaultEdgeLabelFn(n, r, t);
    var f = Bt(this._isDirected, n, r, t);
    return n = f.v, r = f.w, Object.freeze(f), this._edgeObjs[u] = f, be(this._preds[r], n), be(this._sucs[n], r), this._in[r][u] = f, this._out[n][u] = f, this._edgeCount++, this;
  }
  edge(n, r, t) {
    var i = arguments.length === 1 ? H(this._isDirected, arguments[0]) : v(this._isDirected, n, r, t);
    return this._edgeLabels[i];
  }
  hasEdge(n, r, t) {
    var i = arguments.length === 1 ? H(this._isDirected, arguments[0]) : v(this._isDirected, n, r, t);
    return Object.prototype.hasOwnProperty.call(this._edgeLabels, i);
  }
  removeEdge(n, r, t) {
    var i = arguments.length === 1 ? H(this._isDirected, arguments[0]) : v(this._isDirected, n, r, t), s = this._edgeObjs[i];
    return s && (n = s.v, r = s.w, delete this._edgeLabels[i], delete this._edgeObjs[i], ye(this._preds[r], n), ye(this._sucs[n], r), delete this._in[r][i], delete this._out[n][i], this._edgeCount--), this;
  }
  inEdges(n, r) {
    var t = this._in[n];
    if (t) {
      var i = K(t);
      return r ? R(i, function(s) {
        return s.v === r;
      }) : i;
    }
  }
  outEdges(n, r) {
    var t = this._out[n];
    if (t) {
      var i = K(t);
      return r ? R(i, function(s) {
        return s.w === r;
      }) : i;
    }
  }
  nodeEdges(n, r) {
    var t = this.inEdges(n, r);
    if (t)
      return t.concat(this.outEdges(n, r));
  }
}
Ke.prototype._nodeCount = 0;
Ke.prototype._edgeCount = 0;
function be(e, n) {
  e[n] ? e[n]++ : e[n] = 1;
}
function ye(e, n) {
  --e[n] || delete e[n];
}
function v(e, n, r, t) {
  var i = "" + n, s = "" + r;
  if (!e && i > s) {
    var a = i;
    i = s, s = a;
  }
  return i + pe + s + pe + (P(t) ? Ut : t);
}
function Bt(e, n, r, t) {
  var i = "" + n, s = "" + r;
  if (!e && i > s) {
    var a = i;
    i = s, s = a;
  }
  var u = { v: i, w: s };
  return t && (u.name = t), u;
}
function H(e, n) {
  return v(e, n.v, n.w, n.name);
}
export {
  Ke as G,
  X as a,
  Pn as b,
  U as c,
  Be as d,
  dn as e,
  k as f,
  Pe as g,
  It as h,
  P as i,
  $t as j,
  O as k,
  Ot as l,
  $e as m,
  Ce as n,
  Tt as o,
  En as p,
  m as q,
  R as r,
  Mt as s,
  G as t,
  K as v
};
