import {
  Comment,
  Fragment,
  Teleport,
  Text,
  Transition,
  cloneVNode,
  computed,
  createApp,
  createBaseVNode,
  createBlock,
  createCommentVNode,
  createElementBlock,
  createStaticVNode,
  createTextVNode,
  createVNode,
  defineComponent,
  getCurrentInstance,
  getCurrentScope,
  h,
  inject,
  isRef,
  mergeProps,
  nextTick,
  normalizeClass,
  normalizeStyle,
  onActivated,
  onBeforeMount,
  onBeforeUnmount,
  onDeactivated,
  onMounted,
  onScopeDispose,
  onUnmounted,
  onUpdated,
  openBlock,
  popScopeId,
  provide,
  pushScopeId,
  reactive,
  readonly,
  ref,
  renderList,
  renderSlot,
  resolveComponent,
  resolveDirective,
  resolveDynamicComponent,
  shallowRef,
  toDisplayString,
  toHandlerKey,
  toHandlers,
  toRaw,
  toRef,
  toRefs,
  unref,
  useAttrs,
  useSlots,
  vModelCheckbox,
  vModelText,
  vShow,
  warn,
  watch,
  watchEffect,
  withCtx,
  withDirectives,
  withKeys,
  withModifiers
} from "./chunk-6UGCK2MK.js";

// node_modules/@abi-software/map-utilities/dist/map-utilities.js
var mm = Object.defineProperty;
var ym = (t13, e, r) => e in t13 ? mm(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r;
var Ir = (t13, e, r) => ym(t13, typeof e != "symbol" ? e + "" : e, r);
var un = (t13, e, { checkForDefaultPrevented: r = true } = {}) => (a) => {
  const i = t13 == null ? void 0 : t13(a);
  if (r === false || !i)
    return e == null ? void 0 : e(a);
};
var Bc;
var _t = typeof window < "u";
var Nm = (t13) => typeof t13 == "string";
var Cv = () => {
};
var jl = _t && ((Bc = window == null ? void 0 : window.navigator) == null ? void 0 : Bc.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function xv(t13) {
  return typeof t13 == "function" ? t13() : unref(t13);
}
function Rm(t13) {
  return t13;
}
function zs(t13) {
  return getCurrentScope() ? (onScopeDispose(t13), true) : false;
}
function $m(t13, e = true) {
  getCurrentInstance() ? onMounted(t13) : e ? t13() : nextTick(t13);
}
function fn(t13) {
  var e;
  const r = xv(t13);
  return (e = r == null ? void 0 : r.$el) != null ? e : r;
}
var Vs = _t ? window : void 0;
function kr(...t13) {
  let e, r, n, a;
  if (Nm(t13[0]) || Array.isArray(t13[0]) ? ([r, n, a] = t13, e = Vs) : [e, r, n, a] = t13, !e)
    return Cv;
  Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]);
  const i = [], o = () => {
    i.forEach((c) => c()), i.length = 0;
  }, s = (c, d, v, h6) => (c.addEventListener(d, v, h6), () => c.removeEventListener(d, v, h6)), l = watch(() => [fn(e), xv(a)], ([c, d]) => {
    o(), c && i.push(...r.flatMap((v) => n.map((h6) => s(c, v, h6, d))));
  }, { immediate: true, flush: "post" }), u = () => {
    l(), o();
  };
  return zs(u), u;
}
var Nc = false;
function zm(t13, e, r = {}) {
  const { window: n = Vs, ignore: a = [], capture: i = true, detectIframe: o = false } = r;
  if (!n)
    return;
  jl && !Nc && (Nc = true, Array.from(n.document.body.children).forEach((v) => v.addEventListener("click", Cv)));
  let s = true;
  const l = (v) => a.some((h6) => {
    if (typeof h6 == "string")
      return Array.from(n.document.querySelectorAll(h6)).some((f) => f === v.target || v.composedPath().includes(f));
    {
      const f = fn(h6);
      return f && (v.target === f || v.composedPath().includes(f));
    }
  }), c = [
    kr(n, "click", (v) => {
      const h6 = fn(t13);
      if (!(!h6 || h6 === v.target || v.composedPath().includes(h6))) {
        if (v.detail === 0 && (s = !l(v)), !s) {
          s = true;
          return;
        }
        e(v);
      }
    }, { passive: true, capture: i }),
    kr(n, "pointerdown", (v) => {
      const h6 = fn(t13);
      h6 && (s = !v.composedPath().includes(h6) && !l(v));
    }, { passive: true }),
    o && kr(n, "blur", (v) => {
      var h6;
      const f = fn(t13);
      ((h6 = n.document.activeElement) == null ? void 0 : h6.tagName) === "IFRAME" && !(f != null && f.contains(n.document.activeElement)) && e(v);
    })
  ].filter(Boolean);
  return () => c.forEach((v) => v());
}
function Ev(t13, e = false) {
  const r = ref(), n = () => r.value = !!t13();
  return n(), $m(n, e), r;
}
var Rc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
var $c = "__vueuse_ssr_handlers__";
Rc[$c] = Rc[$c] || {};
var zc = Object.getOwnPropertySymbols;
var Vm = Object.prototype.hasOwnProperty;
var Hm = Object.prototype.propertyIsEnumerable;
var Km = (t13, e) => {
  var r = {};
  for (var n in t13)
    Vm.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]);
  if (t13 != null && zc)
    for (var n of zc(t13))
      e.indexOf(n) < 0 && Hm.call(t13, n) && (r[n] = t13[n]);
  return r;
};
function cn(t13, e, r = {}) {
  const n = r, { window: a = Vs } = n, i = Km(n, ["window"]);
  let o;
  const s = Ev(() => a && "ResizeObserver" in a), l = () => {
    o && (o.disconnect(), o = void 0);
  }, u = watch(() => fn(t13), (d) => {
    l(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i));
  }, { immediate: true, flush: "post" }), c = () => {
    l(), u();
  };
  return zs(c), {
    isSupported: s,
    stop: c
  };
}
var Vc = Object.getOwnPropertySymbols;
var qm = Object.prototype.hasOwnProperty;
var Um = Object.prototype.propertyIsEnumerable;
var Gm = (t13, e) => {
  var r = {};
  for (var n in t13)
    qm.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]);
  if (t13 != null && Vc)
    for (var n of Vc(t13))
      e.indexOf(n) < 0 && Um.call(t13, n) && (r[n] = t13[n]);
  return r;
};
function Wm(t13, e, r = {}) {
  const n = r, { window: a = Vs } = n, i = Gm(n, ["window"]);
  let o;
  const s = Ev(() => a && "MutationObserver" in a), l = () => {
    o && (o.disconnect(), o = void 0);
  }, u = watch(() => fn(t13), (d) => {
    l(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i));
  }, { immediate: true }), c = () => {
    l(), u();
  };
  return zs(c), {
    isSupported: s,
    stop: c
  };
}
var Hc;
(function(t13) {
  t13.UP = "UP", t13.RIGHT = "RIGHT", t13.DOWN = "DOWN", t13.LEFT = "LEFT", t13.NONE = "NONE";
})(Hc || (Hc = {}));
var Ym = Object.defineProperty;
var Kc = Object.getOwnPropertySymbols;
var jm = Object.prototype.hasOwnProperty;
var Zm = Object.prototype.propertyIsEnumerable;
var qc = (t13, e, r) => e in t13 ? Ym(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r;
var Xm = (t13, e) => {
  for (var r in e || (e = {}))
    jm.call(e, r) && qc(t13, r, e[r]);
  if (Kc)
    for (var r of Kc(e))
      Zm.call(e, r) && qc(t13, r, e[r]);
  return t13;
};
var Qm = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
Xm({
  linear: Rm
}, Qm);
var Jm = () => _t && /firefox/i.test(window.navigator.userAgent);
var Pu = (t13) => {
  let e, r;
  return t13.type === "touchend" ? (r = t13.changedTouches[0].clientY, e = t13.changedTouches[0].clientX) : t13.type.startsWith("touch") ? (r = t13.touches[0].clientY, e = t13.touches[0].clientX) : (r = t13.clientY, e = t13.clientX), {
    clientX: e,
    clientY: r
  };
};
Object.freeze({});
Object.freeze([]);
var ji = () => {
};
var e0 = Object.prototype.hasOwnProperty;
var va = (t13, e) => e0.call(t13, e);
var fr = Array.isArray;
var lr = (t13) => typeof t13 == "function";
var tr = (t13) => typeof t13 == "string";
var Kt = (t13) => t13 !== null && typeof t13 == "object";
var t0 = Object.prototype.toString;
var r0 = (t13) => t0.call(t13);
var Cl = (t13) => r0(t13).slice(8, -1);
var kv = (t13) => {
  const e = /* @__PURE__ */ Object.create(null);
  return (r) => e[r] || (e[r] = t13(r));
};
var n0 = /-(\w)/g;
var a0 = kv((t13) => t13.replace(n0, (e, r) => r ? r.toUpperCase() : ""));
var i0 = /\B([A-Z])/g;
var o0 = kv(
  (t13) => t13.replace(i0, "-$1").toLowerCase()
);
var Sv = typeof global == "object" && global && global.Object === Object && global;
var s0 = typeof self == "object" && self && self.Object === Object && self;
var rn = Sv || s0 || Function("return this")();
var Jr = rn.Symbol;
var Tv = Object.prototype;
var l0 = Tv.hasOwnProperty;
var u0 = Tv.toString;
var Di = Jr ? Jr.toStringTag : void 0;
function c0(t13) {
  var e = l0.call(t13, Di), r = t13[Di];
  try {
    t13[Di] = void 0;
    var n = true;
  } catch {
  }
  var a = u0.call(t13);
  return n && (e ? t13[Di] = r : delete t13[Di]), a;
}
var d0 = Object.prototype;
var f0 = d0.toString;
function v0(t13) {
  return f0.call(t13);
}
var h0 = "[object Null]";
var p0 = "[object Undefined]";
var Uc = Jr ? Jr.toStringTag : void 0;
function vi(t13) {
  return t13 == null ? t13 === void 0 ? p0 : h0 : Uc && Uc in Object(t13) ? c0(t13) : v0(t13);
}
function Qa(t13) {
  return t13 != null && typeof t13 == "object";
}
var g0 = "[object Symbol]";
function Hs(t13) {
  return typeof t13 == "symbol" || Qa(t13) && vi(t13) == g0;
}
function m0(t13, e) {
  for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; )
    a[r] = e(t13[r], r, t13);
  return a;
}
var Vr = Array.isArray;
var y0 = 1 / 0;
var Gc = Jr ? Jr.prototype : void 0;
var Wc = Gc ? Gc.toString : void 0;
function _v(t13) {
  if (typeof t13 == "string")
    return t13;
  if (Vr(t13))
    return m0(t13, _v) + "";
  if (Hs(t13))
    return Wc ? Wc.call(t13) : "";
  var e = t13 + "";
  return e == "0" && 1 / t13 == -y0 ? "-0" : e;
}
var b0 = /\s/;
function w0(t13) {
  for (var e = t13.length; e-- && b0.test(t13.charAt(e)); )
    ;
  return e;
}
var C0 = /^\s+/;
function x0(t13) {
  return t13 && t13.slice(0, w0(t13) + 1).replace(C0, "");
}
function Vn(t13) {
  var e = typeof t13;
  return t13 != null && (e == "object" || e == "function");
}
var Yc = NaN;
var E0 = /^[-+]0x[0-9a-f]+$/i;
var k0 = /^0b[01]+$/i;
var S0 = /^0o[0-7]+$/i;
var T0 = parseInt;
function jc(t13) {
  if (typeof t13 == "number")
    return t13;
  if (Hs(t13))
    return Yc;
  if (Vn(t13)) {
    var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13;
    t13 = Vn(e) ? e + "" : e;
  }
  if (typeof t13 != "string")
    return t13 === 0 ? t13 : +t13;
  t13 = x0(t13);
  var r = k0.test(t13);
  return r || S0.test(t13) ? T0(t13.slice(2), r ? 2 : 8) : E0.test(t13) ? Yc : +t13;
}
function Dv(t13) {
  return t13;
}
var _0 = "[object AsyncFunction]";
var D0 = "[object Function]";
var P0 = "[object GeneratorFunction]";
var O0 = "[object Proxy]";
function Pv(t13) {
  if (!Vn(t13))
    return false;
  var e = vi(t13);
  return e == D0 || e == P0 || e == _0 || e == O0;
}
var xl = rn["__core-js_shared__"];
var Zc = function() {
  var t13 = /[^.]+$/.exec(xl && xl.keys && xl.keys.IE_PROTO || "");
  return t13 ? "Symbol(src)_1." + t13 : "";
}();
function L0(t13) {
  return !!Zc && Zc in t13;
}
var I0 = Function.prototype;
var A0 = I0.toString;
function ka(t13) {
  if (t13 != null) {
    try {
      return A0.call(t13);
    } catch {
    }
    try {
      return t13 + "";
    } catch {
    }
  }
  return "";
}
var F0 = /[\\^$.*+?()[\]{}|]/g;
var M0 = /^\[object .+?Constructor\]$/;
var B0 = Function.prototype;
var N0 = Object.prototype;
var R0 = B0.toString;
var $0 = N0.hasOwnProperty;
var z0 = RegExp(
  "^" + R0.call($0).replace(F0, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function V0(t13) {
  if (!Vn(t13) || L0(t13))
    return false;
  var e = Pv(t13) ? z0 : M0;
  return e.test(ka(t13));
}
function H0(t13, e) {
  return t13 == null ? void 0 : t13[e];
}
function Sa(t13, e) {
  var r = H0(t13, e);
  return V0(r) ? r : void 0;
}
var Zl = Sa(rn, "WeakMap");
function K0(t13, e, r) {
  switch (r.length) {
    case 0:
      return t13.call(e);
    case 1:
      return t13.call(e, r[0]);
    case 2:
      return t13.call(e, r[0], r[1]);
    case 3:
      return t13.call(e, r[0], r[1], r[2]);
  }
  return t13.apply(e, r);
}
var q0 = 800;
var U0 = 16;
var G0 = Date.now;
function W0(t13) {
  var e = 0, r = 0;
  return function() {
    var n = G0(), a = U0 - (n - r);
    if (r = n, a > 0) {
      if (++e >= q0)
        return arguments[0];
    } else
      e = 0;
    return t13.apply(void 0, arguments);
  };
}
function Y0(t13) {
  return function() {
    return t13;
  };
}
var Cs = function() {
  try {
    var t13 = Sa(Object, "defineProperty");
    return t13({}, "", {}), t13;
  } catch {
  }
}();
var j0 = Cs ? function(t13, e) {
  return Cs(t13, "toString", {
    configurable: true,
    enumerable: false,
    value: Y0(e),
    writable: true
  });
} : Dv;
var Z0 = W0(j0);
function X0(t13, e, r, n) {
  t13.length;
  for (var a = r + 1; a--; )
    if (e(t13[a], a, t13))
      return a;
  return -1;
}
var Q0 = 9007199254740991;
var J0 = /^(?:0|[1-9]\d*)$/;
function Ou(t13, e) {
  var r = typeof t13;
  return e = e ?? Q0, !!e && (r == "number" || r != "symbol" && J0.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e;
}
function ey(t13, e, r) {
  e == "__proto__" && Cs ? Cs(t13, e, {
    configurable: true,
    enumerable: true,
    value: r,
    writable: true
  }) : t13[e] = r;
}
function Lu(t13, e) {
  return t13 === e || t13 !== t13 && e !== e;
}
var ty = Object.prototype;
var ry = ty.hasOwnProperty;
function ny(t13, e, r) {
  var n = t13[e];
  (!(ry.call(t13, e) && Lu(n, r)) || r === void 0 && !(e in t13)) && ey(t13, e, r);
}
var Xc = Math.max;
function ay(t13, e, r) {
  return e = Xc(e === void 0 ? t13.length - 1 : e, 0), function() {
    for (var n = arguments, a = -1, i = Xc(n.length - e, 0), o = Array(i); ++a < i; )
      o[a] = n[e + a];
    a = -1;
    for (var s = Array(e + 1); ++a < e; )
      s[a] = n[a];
    return s[e] = r(o), K0(t13, this, s);
  };
}
var iy = 9007199254740991;
function Iu(t13) {
  return typeof t13 == "number" && t13 > -1 && t13 % 1 == 0 && t13 <= iy;
}
function oy(t13) {
  return t13 != null && Iu(t13.length) && !Pv(t13);
}
var sy = Object.prototype;
function ly(t13) {
  var e = t13 && t13.constructor, r = typeof e == "function" && e.prototype || sy;
  return t13 === r;
}
function uy(t13, e) {
  for (var r = -1, n = Array(t13); ++r < t13; )
    n[r] = e(r);
  return n;
}
var cy = "[object Arguments]";
function Qc(t13) {
  return Qa(t13) && vi(t13) == cy;
}
var Ov = Object.prototype;
var dy = Ov.hasOwnProperty;
var fy = Ov.propertyIsEnumerable;
var Au = Qc(/* @__PURE__ */ function() {
  return arguments;
}()) ? Qc : function(t13) {
  return Qa(t13) && dy.call(t13, "callee") && !fy.call(t13, "callee");
};
function vy() {
  return false;
}
var Lv = typeof exports == "object" && exports && !exports.nodeType && exports;
var Jc = Lv && typeof module == "object" && module && !module.nodeType && module;
var hy = Jc && Jc.exports === Lv;
var ed = hy ? rn.Buffer : void 0;
var py = ed ? ed.isBuffer : void 0;
var Xl = py || vy;
var gy = "[object Arguments]";
var my = "[object Array]";
var yy = "[object Boolean]";
var by = "[object Date]";
var wy = "[object Error]";
var Cy = "[object Function]";
var xy = "[object Map]";
var Ey = "[object Number]";
var ky = "[object Object]";
var Sy = "[object RegExp]";
var Ty = "[object Set]";
var _y = "[object String]";
var Dy = "[object WeakMap]";
var Py = "[object ArrayBuffer]";
var Oy = "[object DataView]";
var Ly = "[object Float32Array]";
var Iy = "[object Float64Array]";
var Ay = "[object Int8Array]";
var Fy = "[object Int16Array]";
var My = "[object Int32Array]";
var By = "[object Uint8Array]";
var Ny = "[object Uint8ClampedArray]";
var Ry = "[object Uint16Array]";
var $y = "[object Uint32Array]";
var ft = {};
ft[Ly] = ft[Iy] = ft[Ay] = ft[Fy] = ft[My] = ft[By] = ft[Ny] = ft[Ry] = ft[$y] = true;
ft[gy] = ft[my] = ft[Py] = ft[yy] = ft[Oy] = ft[by] = ft[wy] = ft[Cy] = ft[xy] = ft[Ey] = ft[ky] = ft[Sy] = ft[Ty] = ft[_y] = ft[Dy] = false;
function zy(t13) {
  return Qa(t13) && Iu(t13.length) && !!ft[vi(t13)];
}
function Vy(t13) {
  return function(e) {
    return t13(e);
  };
}
var Iv = typeof exports == "object" && exports && !exports.nodeType && exports;
var Ki = Iv && typeof module == "object" && module && !module.nodeType && module;
var Hy = Ki && Ki.exports === Iv;
var El = Hy && Sv.process;
var td = function() {
  try {
    var t13 = Ki && Ki.require && Ki.require("util").types;
    return t13 || El && El.binding && El.binding("util");
  } catch {
  }
}();
var rd = td && td.isTypedArray;
var Av = rd ? Vy(rd) : zy;
var Ky = Object.prototype;
var qy = Ky.hasOwnProperty;
function Uy(t13, e) {
  var r = Vr(t13), n = !r && Au(t13), a = !r && !n && Xl(t13), i = !r && !n && !a && Av(t13), o = r || n || a || i, s = o ? uy(t13.length, String) : [], l = s.length;
  for (var u in t13)
    qy.call(t13, u) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    a && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
    Ou(u, l))) && s.push(u);
  return s;
}
function Gy(t13, e) {
  return function(r) {
    return t13(e(r));
  };
}
var Wy = Gy(Object.keys, Object);
var Yy = Object.prototype;
var jy = Yy.hasOwnProperty;
function Zy(t13) {
  if (!ly(t13))
    return Wy(t13);
  var e = [];
  for (var r in Object(t13))
    jy.call(t13, r) && r != "constructor" && e.push(r);
  return e;
}
function Fv(t13) {
  return oy(t13) ? Uy(t13) : Zy(t13);
}
var Xy = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
var Qy = /^\w*$/;
function Fu(t13, e) {
  if (Vr(t13))
    return false;
  var r = typeof t13;
  return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Hs(t13) ? true : Qy.test(t13) || !Xy.test(t13) || e != null && t13 in Object(e);
}
var Zi = Sa(Object, "create");
function Jy() {
  this.__data__ = Zi ? Zi(null) : {}, this.size = 0;
}
function e1(t13) {
  var e = this.has(t13) && delete this.__data__[t13];
  return this.size -= e ? 1 : 0, e;
}
var t1 = "__lodash_hash_undefined__";
var r1 = Object.prototype;
var n1 = r1.hasOwnProperty;
function a1(t13) {
  var e = this.__data__;
  if (Zi) {
    var r = e[t13];
    return r === t1 ? void 0 : r;
  }
  return n1.call(e, t13) ? e[t13] : void 0;
}
var i1 = Object.prototype;
var o1 = i1.hasOwnProperty;
function s1(t13) {
  var e = this.__data__;
  return Zi ? e[t13] !== void 0 : o1.call(e, t13);
}
var l1 = "__lodash_hash_undefined__";
function u1(t13, e) {
  var r = this.__data__;
  return this.size += this.has(t13) ? 0 : 1, r[t13] = Zi && e === void 0 ? l1 : e, this;
}
function ha(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
ha.prototype.clear = Jy;
ha.prototype.delete = e1;
ha.prototype.get = a1;
ha.prototype.has = s1;
ha.prototype.set = u1;
function c1() {
  this.__data__ = [], this.size = 0;
}
function Ks(t13, e) {
  for (var r = t13.length; r--; )
    if (Lu(t13[r][0], e))
      return r;
  return -1;
}
var d1 = Array.prototype;
var f1 = d1.splice;
function v1(t13) {
  var e = this.__data__, r = Ks(e, t13);
  if (r < 0)
    return false;
  var n = e.length - 1;
  return r == n ? e.pop() : f1.call(e, r, 1), --this.size, true;
}
function h1(t13) {
  var e = this.__data__, r = Ks(e, t13);
  return r < 0 ? void 0 : e[r][1];
}
function p1(t13) {
  return Ks(this.__data__, t13) > -1;
}
function g1(t13, e) {
  var r = this.__data__, n = Ks(r, t13);
  return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this;
}
function bn(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
bn.prototype.clear = c1;
bn.prototype.delete = v1;
bn.prototype.get = h1;
bn.prototype.has = p1;
bn.prototype.set = g1;
var Xi = Sa(rn, "Map");
function m1() {
  this.size = 0, this.__data__ = {
    hash: new ha(),
    map: new (Xi || bn)(),
    string: new ha()
  };
}
function y1(t13) {
  var e = typeof t13;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null;
}
function qs(t13, e) {
  var r = t13.__data__;
  return y1(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
function b1(t13) {
  var e = qs(this, t13).delete(t13);
  return this.size -= e ? 1 : 0, e;
}
function w1(t13) {
  return qs(this, t13).get(t13);
}
function C1(t13) {
  return qs(this, t13).has(t13);
}
function x1(t13, e) {
  var r = qs(this, t13), n = r.size;
  return r.set(t13, e), this.size += r.size == n ? 0 : 1, this;
}
function wn(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
wn.prototype.clear = m1;
wn.prototype.delete = b1;
wn.prototype.get = w1;
wn.prototype.has = C1;
wn.prototype.set = x1;
var E1 = "Expected a function";
function Mu(t13, e) {
  if (typeof t13 != "function" || e != null && typeof e != "function")
    throw new TypeError(E1);
  var r = function() {
    var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache;
    if (i.has(a))
      return i.get(a);
    var o = t13.apply(this, n);
    return r.cache = i.set(a, o) || i, o;
  };
  return r.cache = new (Mu.Cache || wn)(), r;
}
Mu.Cache = wn;
var k1 = 500;
function S1(t13) {
  var e = Mu(t13, function(n) {
    return r.size === k1 && r.clear(), n;
  }), r = e.cache;
  return e;
}
var T1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var _1 = /\\(\\)?/g;
var D1 = S1(function(t13) {
  var e = [];
  return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(T1, function(r, n, a, i) {
    e.push(a ? i.replace(_1, "$1") : n || r);
  }), e;
});
function P1(t13) {
  return t13 == null ? "" : _v(t13);
}
function Us(t13, e) {
  return Vr(t13) ? t13 : Fu(t13, e) ? [t13] : D1(P1(t13));
}
var O1 = 1 / 0;
function mo(t13) {
  if (typeof t13 == "string" || Hs(t13))
    return t13;
  var e = t13 + "";
  return e == "0" && 1 / t13 == -O1 ? "-0" : e;
}
function Bu(t13, e) {
  e = Us(e, t13);
  for (var r = 0, n = e.length; t13 != null && r < n; )
    t13 = t13[mo(e[r++])];
  return r && r == n ? t13 : void 0;
}
function dn(t13, e, r) {
  var n = t13 == null ? void 0 : Bu(t13, e);
  return n === void 0 ? r : n;
}
function Mv(t13, e) {
  for (var r = -1, n = e.length, a = t13.length; ++r < n; )
    t13[a + r] = e[r];
  return t13;
}
var nd = Jr ? Jr.isConcatSpreadable : void 0;
function L1(t13) {
  return Vr(t13) || Au(t13) || !!(nd && t13 && t13[nd]);
}
function I1(t13, e, r, n, a) {
  var i = -1, o = t13.length;
  for (r || (r = L1), a || (a = []); ++i < o; ) {
    var s = t13[i];
    r(s) ? Mv(a, s) : a[a.length] = s;
  }
  return a;
}
function A1(t13) {
  var e = t13 == null ? 0 : t13.length;
  return e ? I1(t13) : [];
}
function F1(t13) {
  return Z0(ay(t13, void 0, A1), t13 + "");
}
function An() {
  if (!arguments.length)
    return [];
  var t13 = arguments[0];
  return Vr(t13) ? t13 : [t13];
}
function M1() {
  this.__data__ = new bn(), this.size = 0;
}
function B1(t13) {
  var e = this.__data__, r = e.delete(t13);
  return this.size = e.size, r;
}
function N1(t13) {
  return this.__data__.get(t13);
}
function R1(t13) {
  return this.__data__.has(t13);
}
var $1 = 200;
function z1(t13, e) {
  var r = this.__data__;
  if (r instanceof bn) {
    var n = r.__data__;
    if (!Xi || n.length < $1 - 1)
      return n.push([t13, e]), this.size = ++r.size, this;
    r = this.__data__ = new wn(n);
  }
  return r.set(t13, e), this.size = r.size, this;
}
function hn(t13) {
  var e = this.__data__ = new bn(t13);
  this.size = e.size;
}
hn.prototype.clear = M1;
hn.prototype.delete = B1;
hn.prototype.get = N1;
hn.prototype.has = R1;
hn.prototype.set = z1;
function V1(t13, e) {
  for (var r = -1, n = t13 == null ? 0 : t13.length, a = 0, i = []; ++r < n; ) {
    var o = t13[r];
    e(o, r, t13) && (i[a++] = o);
  }
  return i;
}
function H1() {
  return [];
}
var K1 = Object.prototype;
var q1 = K1.propertyIsEnumerable;
var ad = Object.getOwnPropertySymbols;
var U1 = ad ? function(t13) {
  return t13 == null ? [] : (t13 = Object(t13), V1(ad(t13), function(e) {
    return q1.call(t13, e);
  }));
} : H1;
function G1(t13, e, r) {
  var n = e(t13);
  return Vr(t13) ? n : Mv(n, r(t13));
}
function id(t13) {
  return G1(t13, Fv, U1);
}
var Ql = Sa(rn, "DataView");
var Jl = Sa(rn, "Promise");
var eu = Sa(rn, "Set");
var od = "[object Map]";
var W1 = "[object Object]";
var sd = "[object Promise]";
var ld = "[object Set]";
var ud = "[object WeakMap]";
var cd = "[object DataView]";
var Y1 = ka(Ql);
var j1 = ka(Xi);
var Z1 = ka(Jl);
var X1 = ka(eu);
var Q1 = ka(Zl);
var In = vi;
(Ql && In(new Ql(new ArrayBuffer(1))) != cd || Xi && In(new Xi()) != od || Jl && In(Jl.resolve()) != sd || eu && In(new eu()) != ld || Zl && In(new Zl()) != ud) && (In = function(t13) {
  var e = vi(t13), r = e == W1 ? t13.constructor : void 0, n = r ? ka(r) : "";
  if (n)
    switch (n) {
      case Y1:
        return cd;
      case j1:
        return od;
      case Z1:
        return sd;
      case X1:
        return ld;
      case Q1:
        return ud;
    }
  return e;
});
var dd = rn.Uint8Array;
var J1 = "__lodash_hash_undefined__";
function eb(t13) {
  return this.__data__.set(t13, J1), this;
}
function tb(t13) {
  return this.__data__.has(t13);
}
function xs(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.__data__ = new wn(); ++e < r; )
    this.add(t13[e]);
}
xs.prototype.add = xs.prototype.push = eb;
xs.prototype.has = tb;
function rb(t13, e) {
  for (var r = -1, n = t13 == null ? 0 : t13.length; ++r < n; )
    if (e(t13[r], r, t13))
      return true;
  return false;
}
function nb(t13, e) {
  return t13.has(e);
}
var ab = 1;
var ib = 2;
function Bv(t13, e, r, n, a, i) {
  var o = r & ab, s = t13.length, l = e.length;
  if (s != l && !(o && l > s))
    return false;
  var u = i.get(t13), c = i.get(e);
  if (u && c)
    return u == e && c == t13;
  var d = -1, v = true, h6 = r & ib ? new xs() : void 0;
  for (i.set(t13, e), i.set(e, t13); ++d < s; ) {
    var f = t13[d], p = e[d];
    if (n)
      var m = o ? n(p, f, d, e, t13, i) : n(f, p, d, t13, e, i);
    if (m !== void 0) {
      if (m)
        continue;
      v = false;
      break;
    }
    if (h6) {
      if (!rb(e, function(g, y) {
        if (!nb(h6, y) && (f === g || a(f, g, r, n, i)))
          return h6.push(y);
      })) {
        v = false;
        break;
      }
    } else if (!(f === p || a(f, p, r, n, i))) {
      v = false;
      break;
    }
  }
  return i.delete(t13), i.delete(e), v;
}
function ob(t13) {
  var e = -1, r = Array(t13.size);
  return t13.forEach(function(n, a) {
    r[++e] = [a, n];
  }), r;
}
function sb(t13) {
  var e = -1, r = Array(t13.size);
  return t13.forEach(function(n) {
    r[++e] = n;
  }), r;
}
var lb = 1;
var ub = 2;
var cb = "[object Boolean]";
var db = "[object Date]";
var fb = "[object Error]";
var vb = "[object Map]";
var hb = "[object Number]";
var pb = "[object RegExp]";
var gb = "[object Set]";
var mb = "[object String]";
var yb = "[object Symbol]";
var bb = "[object ArrayBuffer]";
var wb = "[object DataView]";
var fd = Jr ? Jr.prototype : void 0;
var kl = fd ? fd.valueOf : void 0;
function Cb(t13, e, r, n, a, i, o) {
  switch (r) {
    case wb:
      if (t13.byteLength != e.byteLength || t13.byteOffset != e.byteOffset)
        return false;
      t13 = t13.buffer, e = e.buffer;
    case bb:
      return !(t13.byteLength != e.byteLength || !i(new dd(t13), new dd(e)));
    case cb:
    case db:
    case hb:
      return Lu(+t13, +e);
    case fb:
      return t13.name == e.name && t13.message == e.message;
    case pb:
    case mb:
      return t13 == e + "";
    case vb:
      var s = ob;
    case gb:
      var l = n & lb;
      if (s || (s = sb), t13.size != e.size && !l)
        return false;
      var u = o.get(t13);
      if (u)
        return u == e;
      n |= ub, o.set(t13, e);
      var c = Bv(s(t13), s(e), n, a, i, o);
      return o.delete(t13), c;
    case yb:
      if (kl)
        return kl.call(t13) == kl.call(e);
  }
  return false;
}
var xb = 1;
var Eb = Object.prototype;
var kb = Eb.hasOwnProperty;
function Sb(t13, e, r, n, a, i) {
  var o = r & xb, s = id(t13), l = s.length, u = id(e), c = u.length;
  if (l != c && !o)
    return false;
  for (var d = l; d--; ) {
    var v = s[d];
    if (!(o ? v in e : kb.call(e, v)))
      return false;
  }
  var h6 = i.get(t13), f = i.get(e);
  if (h6 && f)
    return h6 == e && f == t13;
  var p = true;
  i.set(t13, e), i.set(e, t13);
  for (var m = o; ++d < l; ) {
    v = s[d];
    var g = t13[v], y = e[v];
    if (n)
      var b = o ? n(y, g, v, e, t13, i) : n(g, y, v, t13, e, i);
    if (!(b === void 0 ? g === y || a(g, y, r, n, i) : b)) {
      p = false;
      break;
    }
    m || (m = v == "constructor");
  }
  if (p && !m) {
    var w = t13.constructor, C = e.constructor;
    w != C && "constructor" in t13 && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof C == "function" && C instanceof C) && (p = false);
  }
  return i.delete(t13), i.delete(e), p;
}
var Tb = 1;
var vd = "[object Arguments]";
var hd = "[object Array]";
var No = "[object Object]";
var _b = Object.prototype;
var pd = _b.hasOwnProperty;
function Db(t13, e, r, n, a, i) {
  var o = Vr(t13), s = Vr(e), l = o ? hd : In(t13), u = s ? hd : In(e);
  l = l == vd ? No : l, u = u == vd ? No : u;
  var c = l == No, d = u == No, v = l == u;
  if (v && Xl(t13)) {
    if (!Xl(e))
      return false;
    o = true, c = false;
  }
  if (v && !c)
    return i || (i = new hn()), o || Av(t13) ? Bv(t13, e, r, n, a, i) : Cb(t13, e, l, r, n, a, i);
  if (!(r & Tb)) {
    var h6 = c && pd.call(t13, "__wrapped__"), f = d && pd.call(e, "__wrapped__");
    if (h6 || f) {
      var p = h6 ? t13.value() : t13, m = f ? e.value() : e;
      return i || (i = new hn()), a(p, m, r, n, i);
    }
  }
  return v ? (i || (i = new hn()), Sb(t13, e, r, n, a, i)) : false;
}
function Gs(t13, e, r, n, a) {
  return t13 === e ? true : t13 == null || e == null || !Qa(t13) && !Qa(e) ? t13 !== t13 && e !== e : Db(t13, e, r, n, Gs, a);
}
var Pb = 1;
var Ob = 2;
function Lb(t13, e, r, n) {
  var a = r.length, i = a;
  if (t13 == null)
    return !i;
  for (t13 = Object(t13); a--; ) {
    var o = r[a];
    if (o[2] ? o[1] !== t13[o[0]] : !(o[0] in t13))
      return false;
  }
  for (; ++a < i; ) {
    o = r[a];
    var s = o[0], l = t13[s], u = o[1];
    if (o[2]) {
      if (l === void 0 && !(s in t13))
        return false;
    } else {
      var c = new hn(), d;
      if (!(d === void 0 ? Gs(u, l, Pb | Ob, n, c) : d))
        return false;
    }
  }
  return true;
}
function Nv(t13) {
  return t13 === t13 && !Vn(t13);
}
function Ib(t13) {
  for (var e = Fv(t13), r = e.length; r--; ) {
    var n = e[r], a = t13[n];
    e[r] = [n, a, Nv(a)];
  }
  return e;
}
function Rv(t13, e) {
  return function(r) {
    return r == null ? false : r[t13] === e && (e !== void 0 || t13 in Object(r));
  };
}
function Ab(t13) {
  var e = Ib(t13);
  return e.length == 1 && e[0][2] ? Rv(e[0][0], e[0][1]) : function(r) {
    return r === t13 || Lb(r, t13, e);
  };
}
function Fb(t13, e) {
  return t13 != null && e in Object(t13);
}
function Mb(t13, e, r) {
  e = Us(e, t13);
  for (var n = -1, a = e.length, i = false; ++n < a; ) {
    var o = mo(e[n]);
    if (!(i = t13 != null && r(t13, o)))
      break;
    t13 = t13[o];
  }
  return i || ++n != a ? i : (a = t13 == null ? 0 : t13.length, !!a && Iu(a) && Ou(o, a) && (Vr(t13) || Au(t13)));
}
function $v(t13, e) {
  return t13 != null && Mb(t13, e, Fb);
}
var Bb = 1;
var Nb = 2;
function Rb(t13, e) {
  return Fu(t13) && Nv(e) ? Rv(mo(t13), e) : function(r) {
    var n = dn(r, t13);
    return n === void 0 && n === e ? $v(r, t13) : Gs(e, n, Bb | Nb);
  };
}
function $b(t13) {
  return function(e) {
    return e == null ? void 0 : e[t13];
  };
}
function zb(t13) {
  return function(e) {
    return Bu(e, t13);
  };
}
function Vb(t13) {
  return Fu(t13) ? $b(mo(t13)) : zb(t13);
}
function Hb(t13) {
  return typeof t13 == "function" ? t13 : t13 == null ? Dv : typeof t13 == "object" ? Vr(t13) ? Rb(t13[0], t13[1]) : Ab(t13) : Vb(t13);
}
var Sl = function() {
  return rn.Date.now();
};
var Kb = "Expected a function";
var qb = Math.max;
var Ub = Math.min;
function zv(t13, e, r) {
  var n, a, i, o, s, l, u = 0, c = false, d = false, v = true;
  if (typeof t13 != "function")
    throw new TypeError(Kb);
  e = jc(e) || 0, Vn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? qb(jc(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v);
  function h6(E) {
    var x = n, T = a;
    return n = a = void 0, u = E, o = t13.apply(T, x), o;
  }
  function f(E) {
    return u = E, s = setTimeout(g, e), c ? h6(E) : o;
  }
  function p(E) {
    var x = E - l, T = E - u, k = e - x;
    return d ? Ub(k, i - T) : k;
  }
  function m(E) {
    var x = E - l, T = E - u;
    return l === void 0 || x >= e || x < 0 || d && T >= i;
  }
  function g() {
    var E = Sl();
    if (m(E))
      return y(E);
    s = setTimeout(g, p(E));
  }
  function y(E) {
    return s = void 0, v && n ? h6(E) : (n = a = void 0, o);
  }
  function b() {
    s !== void 0 && clearTimeout(s), u = 0, n = l = a = s = void 0;
  }
  function w() {
    return s === void 0 ? o : y(Sl());
  }
  function C() {
    var E = Sl(), x = m(E);
    if (n = arguments, a = this, l = E, x) {
      if (s === void 0)
        return f(l);
      if (d)
        return clearTimeout(s), s = setTimeout(g, e), h6(l);
    }
    return s === void 0 && (s = setTimeout(g, e)), o;
  }
  return C.cancel = b, C.flush = w, C;
}
function Gb(t13, e, r) {
  var n = t13 == null ? 0 : t13.length;
  if (!n)
    return -1;
  var a = n - 1;
  return X0(t13, Hb(e), a);
}
function Es(t13) {
  for (var e = -1, r = t13 == null ? 0 : t13.length, n = {}; ++e < r; ) {
    var a = t13[e];
    n[a[0]] = a[1];
  }
  return n;
}
function ks(t13, e) {
  return Gs(t13, e);
}
function Rn(t13) {
  return t13 == null;
}
function Wb(t13) {
  return t13 === void 0;
}
function Yb(t13, e, r, n) {
  if (!Vn(t13))
    return t13;
  e = Us(e, t13);
  for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) {
    var l = mo(e[a]), u = r;
    if (l === "__proto__" || l === "constructor" || l === "prototype")
      return t13;
    if (a != o) {
      var c = s[l];
      u = void 0, u === void 0 && (u = Vn(c) ? c : Ou(e[a + 1]) ? [] : {});
    }
    ny(s, l, u), s = s[l];
  }
  return t13;
}
function jb(t13, e, r) {
  for (var n = -1, a = e.length, i = {}; ++n < a; ) {
    var o = e[n], s = Bu(t13, o);
    r(s, o) && Yb(i, Us(o, t13), s);
  }
  return i;
}
function Zb(t13, e) {
  return jb(t13, e, function(r, n) {
    return $v(t13, n);
  });
}
var Vv = F1(function(t13, e) {
  return t13 == null ? {} : Zb(t13, e);
});
var Mn = (t13) => t13 === void 0;
var Ja = (t13) => typeof t13 == "boolean";
var qt = (t13) => typeof t13 == "number";
var ua = (t13) => typeof Element > "u" ? false : t13 instanceof Element;
var Ss = (t13) => Rn(t13);
var Xb = (t13) => tr(t13) ? !Number.isNaN(Number(t13)) : false;
var Qb = (t13 = "") => t13.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
var gd = (t13) => Object.keys(t13);
var Hv = class extends Error {
  constructor(e) {
    super(e), this.name = "ElementPlusError";
  }
};
function Jb(t13, e) {
  throw new Hv(`[${t13}] ${e}`);
}
function Dt(t13, e) {
  if (true) {
    const r = tr(t13) ? new Hv(`[${t13}] ${e}`) : t13;
    console.warn(r);
  }
}
var e2 = "utils/dom/style";
var Kv = (t13 = "") => t13.split(" ").filter((e) => !!e.trim());
var tu = (t13, e) => {
  !t13 || !e.trim() || t13.classList.add(...Kv(e));
};
var ca = (t13, e) => {
  !t13 || !e.trim() || t13.classList.remove(...Kv(e));
};
var Pi = (t13, e) => {
  var r;
  if (!_t || !t13 || !e)
    return "";
  let n = a0(e);
  n === "float" && (n = "cssFloat");
  try {
    const a = t13.style[n];
    if (a)
      return a;
    const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t13, "");
    return i ? i[n] : "";
  } catch {
    return t13.style[n];
  }
};
function ei(t13, e = "px") {
  if (!t13)
    return "";
  if (qt(t13) || Xb(t13))
    return `${t13}${e}`;
  if (tr(t13))
    return t13;
  Dt(e2, "binding value must be a string or number");
}
function t2(t13, e) {
  if (!_t)
    return;
  if (!e) {
    t13.scrollTop = 0;
    return;
  }
  const r = [];
  let n = e.offsetParent;
  for (; n !== null && t13 !== n && t13.contains(n); )
    r.push(n), n = n.offsetParent;
  const a = e.offsetTop + r.reduce((l, u) => l + u.offsetTop, 0), i = a + e.offsetHeight, o = t13.scrollTop, s = o + t13.clientHeight;
  a < o ? t13.scrollTop = a : i > s && (t13.scrollTop = i - t13.clientHeight);
}
var r2 = defineComponent({
  name: "Aim",
  __name: "aim",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"
      })
    ]));
  }
});
var n2 = r2;
var a2 = defineComponent({
  name: "ArrowDown",
  __name: "arrow-down",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
      })
    ]));
  }
});
var Ws = a2;
var i2 = defineComponent({
  name: "ArrowUp",
  __name: "arrow-up",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
      })
    ]));
  }
});
var qv = i2;
var o2 = defineComponent({
  name: "CaretRight",
  __name: "caret-right",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M384 192v640l384-320.064z"
      })
    ]));
  }
});
var s2 = o2;
var l2 = defineComponent({
  name: "CircleCheck",
  __name: "circle-check",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
      })
    ]));
  }
});
var u2 = l2;
var c2 = defineComponent({
  name: "CircleClose",
  __name: "circle-close",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
      })
    ]));
  }
});
var Nu = c2;
var d2 = defineComponent({
  name: "Close",
  __name: "close",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
      })
    ]));
  }
});
var Ts = d2;
var f2 = defineComponent({
  name: "CopyDocument",
  __name: "copy-document",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"
      })
    ]));
  }
});
var v2 = f2;
var h2 = defineComponent({
  name: "Delete",
  __name: "delete",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
      })
    ]));
  }
});
var p2 = h2;
var g2 = defineComponent({
  name: "Edit",
  __name: "edit",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
      })
    ]));
  }
});
var m2 = g2;
var y2 = defineComponent({
  name: "Finished",
  __name: "finished",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"
      })
    ]));
  }
});
var b2 = y2;
var w2 = defineComponent({
  name: "Hide",
  __name: "hide",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
      })
    ]));
  }
});
var C2 = w2;
var x2 = defineComponent({
  name: "Loading",
  __name: "loading",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
      })
    ]));
  }
});
var Ru = x2;
var E2 = defineComponent({
  name: "Lock",
  __name: "lock",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
      })
    ]));
  }
});
var k2 = E2;
var S2 = defineComponent({
  name: "Unlock",
  __name: "unlock",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
      }),
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
      })
    ]));
  }
});
var T2 = S2;
var _2 = defineComponent({
  name: "View",
  __name: "view",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
      })
    ]));
  }
});
var D2 = _2;
var P2 = defineComponent({
  name: "Warning",
  __name: "warning",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
      })
    ]));
  }
});
var O2 = P2;
var L2 = defineComponent({
  name: "ZoomIn",
  __name: "zoom-in",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
      })
    ]));
  }
});
var I2 = L2;
var A2 = defineComponent({
  name: "ZoomOut",
  __name: "zoom-out",
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      viewBox: "0 0 1024 1024"
    }, [
      createBaseVNode("path", {
        fill: "currentColor",
        d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
      })
    ]));
  }
});
var F2 = A2;
var Uv = "__epPropKey";
var $e = (t13) => t13;
var M2 = (t13) => Kt(t13) && !!t13[Uv];
var Ys = (t13, e) => {
  if (!Kt(t13) || M2(t13))
    return t13;
  const { values: r, required: n, default: a, type: i, validator: o } = t13, l = {
    type: i,
    required: !!n,
    validator: r || o ? (u) => {
      let c = false, d = [];
      if (r && (d = Array.from(r), va(t13, "default") && d.push(a), c || (c = d.includes(u))), o && (c || (c = o(u))), !c && d.length > 0) {
        const v = [...new Set(d)].map((h6) => JSON.stringify(h6)).join(", ");
        warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${v}], got value ${JSON.stringify(u)}.`);
      }
      return c;
    } : void 0,
    [Uv]: true
  };
  return va(t13, "default") && (l.default = a), l;
};
var rt = (t13) => Es(Object.entries(t13).map(([e, r]) => [
  e,
  Ys(r, e)
]));
var Hn = $e([
  String,
  Object,
  Function
]);
var Gv = {
  validating: Ru,
  success: u2,
  error: Nu
};
var $t = (t13, e) => {
  if (t13.install = (r) => {
    for (const n of [t13, ...Object.values(e ?? {})])
      r.component(n.name, n);
  }, e)
    for (const [r, n] of Object.entries(e))
      t13[r] = n;
  return t13;
};
var B2 = (t13, e) => (t13.install = (r) => {
  r.directive(e, t13);
}, t13);
var Cn = (t13) => (t13.install = ji, t13);
var Lt = {
  tab: "Tab",
  enter: "Enter",
  space: "Space",
  left: "ArrowLeft",
  up: "ArrowUp",
  right: "ArrowRight",
  down: "ArrowDown",
  esc: "Escape",
  delete: "Delete",
  backspace: "Backspace",
  numpadEnter: "NumpadEnter",
  pageUp: "PageUp",
  pageDown: "PageDown",
  home: "Home",
  end: "End"
};
var Vt = "update:modelValue";
var $u = "change";
var Wv = ["", "default", "small", "large"];
var N2 = (t13) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t13);
var za = (t13) => t13;
var R2 = ["class", "style"];
var $2 = /^on[A-Z]/;
var z2 = (t13 = {}) => {
  const { excludeListeners: e = false, excludeKeys: r } = t13, n = computed(() => ((r == null ? void 0 : r.value) || []).concat(R2)), a = getCurrentInstance();
  return a ? computed(() => {
    var i;
    return Es(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && $2.test(o))));
  }) : (Dt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({})));
};
var as = ({ from: t13, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => {
  watch(() => unref(o), (s) => {
    s && Dt(r, `[${i}] ${t13} is about to be deprecated in version ${n}, please use ${e} instead.
For more detail, please visit: ${a}
`);
  }, {
    immediate: true
  });
};
var V2 = {
  name: "en",
  el: {
    breadcrumb: {
      label: "Breadcrumb"
    },
    colorpicker: {
      confirm: "OK",
      clear: "Clear",
      defaultLabel: "color picker",
      description: "current color is {color}. press enter to select a new color.",
      alphaLabel: "pick alpha value"
    },
    datepicker: {
      now: "Now",
      today: "Today",
      cancel: "Cancel",
      clear: "Clear",
      confirm: "OK",
      dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
      monthTablePrompt: "Use the arrow keys and enter to select the month",
      yearTablePrompt: "Use the arrow keys and enter to select the year",
      selectedDate: "Selected date",
      selectDate: "Select date",
      selectTime: "Select time",
      startDate: "Start Date",
      startTime: "Start Time",
      endDate: "End Date",
      endTime: "End Time",
      prevYear: "Previous Year",
      nextYear: "Next Year",
      prevMonth: "Previous Month",
      nextMonth: "Next Month",
      year: "",
      month1: "January",
      month2: "February",
      month3: "March",
      month4: "April",
      month5: "May",
      month6: "June",
      month7: "July",
      month8: "August",
      month9: "September",
      month10: "October",
      month11: "November",
      month12: "December",
      week: "week",
      weeks: {
        sun: "Sun",
        mon: "Mon",
        tue: "Tue",
        wed: "Wed",
        thu: "Thu",
        fri: "Fri",
        sat: "Sat"
      },
      weeksFull: {
        sun: "Sunday",
        mon: "Monday",
        tue: "Tuesday",
        wed: "Wednesday",
        thu: "Thursday",
        fri: "Friday",
        sat: "Saturday"
      },
      months: {
        jan: "Jan",
        feb: "Feb",
        mar: "Mar",
        apr: "Apr",
        may: "May",
        jun: "Jun",
        jul: "Jul",
        aug: "Aug",
        sep: "Sep",
        oct: "Oct",
        nov: "Nov",
        dec: "Dec"
      }
    },
    inputNumber: {
      decrease: "decrease number",
      increase: "increase number"
    },
    select: {
      loading: "Loading",
      noMatch: "No matching data",
      noData: "No data",
      placeholder: "Select"
    },
    mention: {
      loading: "Loading"
    },
    dropdown: {
      toggleDropdown: "Toggle Dropdown"
    },
    cascader: {
      noMatch: "No matching data",
      loading: "Loading",
      placeholder: "Select",
      noData: "No data"
    },
    pagination: {
      goto: "Go to",
      pagesize: "/page",
      total: "Total {total}",
      pageClassifier: "",
      page: "Page",
      prev: "Go to previous page",
      next: "Go to next page",
      currentPage: "page {pager}",
      prevPages: "Previous {pager} pages",
      nextPages: "Next {pager} pages",
      deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
    },
    dialog: {
      close: "Close this dialog"
    },
    drawer: {
      close: "Close this dialog"
    },
    messagebox: {
      title: "Message",
      confirm: "OK",
      cancel: "Cancel",
      error: "Illegal input",
      close: "Close this dialog"
    },
    upload: {
      deleteTip: "press delete to remove",
      delete: "Delete",
      preview: "Preview",
      continue: "Continue"
    },
    slider: {
      defaultLabel: "slider between {min} and {max}",
      defaultRangeStartLabel: "pick start value",
      defaultRangeEndLabel: "pick end value"
    },
    table: {
      emptyText: "No Data",
      confirmFilter: "Confirm",
      resetFilter: "Reset",
      clearFilter: "All",
      sumText: "Sum"
    },
    tour: {
      next: "Next",
      previous: "Previous",
      finish: "Finish"
    },
    tree: {
      emptyText: "No Data"
    },
    transfer: {
      noMatch: "No matching data",
      noData: "No data",
      titles: ["List 1", "List 2"],
      filterPlaceholder: "Enter keyword",
      noCheckedFormat: "{total} items",
      hasCheckedFormat: "{checked}/{total} checked"
    },
    image: {
      error: "FAILED"
    },
    pageHeader: {
      title: "Back"
    },
    popconfirm: {
      confirmButtonText: "Yes",
      cancelButtonText: "No"
    },
    carousel: {
      leftArrow: "Carousel arrow left",
      rightArrow: "Carousel arrow right",
      indicator: "Carousel switch to index {index}"
    }
  }
};
var H2 = (t13) => (e, r) => K2(e, r, unref(t13));
var K2 = (t13, e, r) => dn(r, t13, t13).replace(/\{(\w+)\}/g, (n, a) => {
  var i;
  return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`;
});
var q2 = (t13) => {
  const e = computed(() => unref(t13).name), r = isRef(t13) ? t13 : ref(t13);
  return {
    lang: e,
    locale: r,
    t: H2(t13)
  };
};
var Yv = Symbol("localeContextKey");
var yo = (t13) => {
  const e = t13 || inject(Yv, ref());
  return q2(computed(() => e.value || V2));
};
var is = "el";
var U2 = "is-";
var Qn = (t13, e, r, n, a) => {
  let i = `${t13}-${e}`;
  return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i;
};
var jv = Symbol("namespaceContextKey");
var zu = (t13) => {
  const e = t13 || (getCurrentInstance() ? inject(jv, ref(is)) : ref(is));
  return computed(() => unref(e) || is);
};
var He = (t13, e) => {
  const r = zu(e);
  return {
    namespace: r,
    b: (p = "") => Qn(r.value, t13, p, "", ""),
    e: (p) => p ? Qn(r.value, t13, "", p, "") : "",
    m: (p) => p ? Qn(r.value, t13, "", "", p) : "",
    be: (p, m) => p && m ? Qn(r.value, t13, p, m, "") : "",
    em: (p, m) => p && m ? Qn(r.value, t13, "", p, m) : "",
    bm: (p, m) => p && m ? Qn(r.value, t13, p, "", m) : "",
    bem: (p, m, g) => p && m && g ? Qn(r.value, t13, p, m, g) : "",
    is: (p, ...m) => {
      const g = m.length >= 1 ? m[0] : true;
      return p && g ? `${U2}${p}` : "";
    },
    cssVar: (p) => {
      const m = {};
      for (const g in p)
        p[g] && (m[`--${r.value}-${g}`] = p[g]);
      return m;
    },
    cssVarName: (p) => `--${r.value}-${p}`,
    cssVarBlock: (p) => {
      const m = {};
      for (const g in p)
        p[g] && (m[`--${r.value}-${t13}-${g}`] = p[g]);
      return m;
    },
    cssVarBlockName: (p) => `--${r.value}-${t13}-${p}`
  };
};
var G2 = Ys({
  type: $e(Boolean),
  default: null
});
var W2 = Ys({
  type: $e(Function)
});
var Y2 = (t13) => {
  const e = `update:${t13}`, r = `onUpdate:${t13}`, n = [e], a = {
    [t13]: G2,
    [r]: W2
  };
  return {
    useModelToggle: ({
      indicator: o,
      toggleReason: s,
      shouldHideWhenRouteChanges: l,
      shouldProceed: u,
      onShow: c,
      onHide: d
    }) => {
      const v = getCurrentInstance(), { emit: h6 } = v, f = v.props, p = computed(() => lr(f[r])), m = computed(() => f[t13] === null), g = (x) => {
        o.value !== true && (o.value = true, s && (s.value = x), lr(c) && c(x));
      }, y = (x) => {
        o.value !== false && (o.value = false, s && (s.value = x), lr(d) && d(x));
      }, b = (x) => {
        if (f.disabled === true || lr(u) && !u())
          return;
        const T = p.value && _t;
        T && h6(e, true), (m.value || !T) && g(x);
      }, w = (x) => {
        if (f.disabled === true || !_t)
          return;
        const T = p.value && _t;
        T && h6(e, false), (m.value || !T) && y(x);
      }, C = (x) => {
        Ja(x) && (f.disabled && x ? p.value && h6(e, false) : o.value !== x && (x ? g() : y()));
      }, E = () => {
        o.value ? w() : b();
      };
      return watch(() => f[t13], C), l && v.appContext.config.globalProperties.$route !== void 0 && watch(() => ({
        ...v.proxy.$route
      }), () => {
        l.value && o.value && w();
      }), onMounted(() => {
        C(f[t13]);
      }), {
        hide: w,
        show: b,
        toggle: E,
        hasUpdateHandler: p
      };
    },
    useModelToggleProps: a,
    useModelToggleEmits: n
  };
};
var Zv = (t13) => {
  const e = getCurrentInstance();
  return computed(() => {
    var r, n;
    return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t13];
  });
};
var vr = "top";
var _r = "bottom";
var Dr = "right";
var hr = "left";
var Vu = "auto";
var bo = [vr, _r, Dr, hr];
var ti = "start";
var Qi = "end";
var j2 = "clippingParents";
var Xv = "viewport";
var Oi = "popper";
var Z2 = "reference";
var md = bo.reduce(function(t13, e) {
  return t13.concat([e + "-" + ti, e + "-" + Qi]);
}, []);
var js = [].concat(bo, [Vu]).reduce(function(t13, e) {
  return t13.concat([e, e + "-" + ti, e + "-" + Qi]);
}, []);
var X2 = "beforeRead";
var Q2 = "read";
var J2 = "afterRead";
var ew = "beforeMain";
var tw = "main";
var rw = "afterMain";
var nw = "beforeWrite";
var aw = "write";
var iw = "afterWrite";
var ow = [X2, Q2, J2, ew, tw, rw, nw, aw, iw];
function en(t13) {
  return t13 ? (t13.nodeName || "").toLowerCase() : null;
}
function qr(t13) {
  if (t13 == null) return window;
  if (t13.toString() !== "[object Window]") {
    var e = t13.ownerDocument;
    return e && e.defaultView || window;
  }
  return t13;
}
function ri(t13) {
  var e = qr(t13).Element;
  return t13 instanceof e || t13 instanceof Element;
}
function Tr(t13) {
  var e = qr(t13).HTMLElement;
  return t13 instanceof e || t13 instanceof HTMLElement;
}
function Hu(t13) {
  if (typeof ShadowRoot > "u") return false;
  var e = qr(t13).ShadowRoot;
  return t13 instanceof e || t13 instanceof ShadowRoot;
}
function sw(t13) {
  var e = t13.state;
  Object.keys(e.elements).forEach(function(r) {
    var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r];
    !Tr(i) || !en(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) {
      var s = a[o];
      s === false ? i.removeAttribute(o) : i.setAttribute(o, s === true ? "" : s);
    }));
  });
}
function lw(t13) {
  var e = t13.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() {
    Object.keys(e.elements).forEach(function(n) {
      var a = e.elements[n], i = e.attributes[n] || {}, o = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), s = o.reduce(function(l, u) {
        return l[u] = "", l;
      }, {});
      !Tr(a) || !en(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(l) {
        a.removeAttribute(l);
      }));
    });
  };
}
var Qv = { name: "applyStyles", enabled: true, phase: "write", fn: sw, effect: lw, requires: ["computeStyles"] };
function Xr(t13) {
  return t13.split("-")[0];
}
var da = Math.max;
var _s = Math.min;
var ni = Math.round;
function ai(t13, e) {
  e === void 0 && (e = false);
  var r = t13.getBoundingClientRect(), n = 1, a = 1;
  if (Tr(t13) && e) {
    var i = t13.offsetHeight, o = t13.offsetWidth;
    o > 0 && (n = ni(r.width) / o || 1), i > 0 && (a = ni(r.height) / i || 1);
  }
  return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a };
}
function Ku(t13) {
  var e = ai(t13), r = t13.offsetWidth, n = t13.offsetHeight;
  return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t13.offsetLeft, y: t13.offsetTop, width: r, height: n };
}
function Jv(t13, e) {
  var r = e.getRootNode && e.getRootNode();
  if (t13.contains(e)) return true;
  if (r && Hu(r)) {
    var n = e;
    do {
      if (n && t13.isSameNode(n)) return true;
      n = n.parentNode || n.host;
    } while (n);
  }
  return false;
}
function pn(t13) {
  return qr(t13).getComputedStyle(t13);
}
function uw(t13) {
  return ["table", "td", "th"].indexOf(en(t13)) >= 0;
}
function Yn(t13) {
  return ((ri(t13) ? t13.ownerDocument : t13.document) || window.document).documentElement;
}
function Zs(t13) {
  return en(t13) === "html" ? t13 : t13.assignedSlot || t13.parentNode || (Hu(t13) ? t13.host : null) || Yn(t13);
}
function yd(t13) {
  return !Tr(t13) || pn(t13).position === "fixed" ? null : t13.offsetParent;
}
function cw(t13) {
  var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1;
  if (r && Tr(t13)) {
    var n = pn(t13);
    if (n.position === "fixed") return null;
  }
  var a = Zs(t13);
  for (Hu(a) && (a = a.host); Tr(a) && ["html", "body"].indexOf(en(a)) < 0; ) {
    var i = pn(a);
    if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return a;
    a = a.parentNode;
  }
  return null;
}
function wo(t13) {
  for (var e = qr(t13), r = yd(t13); r && uw(r) && pn(r).position === "static"; ) r = yd(r);
  return r && (en(r) === "html" || en(r) === "body" && pn(r).position === "static") ? e : r || cw(t13) || e;
}
function qu(t13) {
  return ["top", "bottom"].indexOf(t13) >= 0 ? "x" : "y";
}
function qi(t13, e, r) {
  return da(t13, _s(e, r));
}
function dw(t13, e, r) {
  var n = qi(t13, e, r);
  return n > r ? r : n;
}
function eh() {
  return { top: 0, right: 0, bottom: 0, left: 0 };
}
function th(t13) {
  return Object.assign({}, eh(), t13);
}
function rh(t13, e) {
  return e.reduce(function(r, n) {
    return r[n] = t13, r;
  }, {});
}
var fw = function(t13, e) {
  return t13 = typeof t13 == "function" ? t13(Object.assign({}, e.rects, { placement: e.placement })) : t13, th(typeof t13 != "number" ? t13 : rh(t13, bo));
};
function vw(t13) {
  var e, r = t13.state, n = t13.name, a = t13.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = Xr(r.placement), l = qu(s), u = [hr, Dr].indexOf(s) >= 0, c = u ? "height" : "width";
  if (!(!i || !o)) {
    var d = fw(a.padding, r), v = Ku(i), h6 = l === "y" ? vr : hr, f = l === "y" ? _r : Dr, p = r.rects.reference[c] + r.rects.reference[l] - o[l] - r.rects.popper[c], m = o[l] - r.rects.reference[l], g = wo(i), y = g ? l === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, b = p / 2 - m / 2, w = d[h6], C = y - v[c] - d[f], E = y / 2 - v[c] / 2 + b, x = qi(w, E, C), T = l;
    r.modifiersData[n] = (e = {}, e[T] = x, e.centerOffset = x - E, e);
  }
}
function hw(t13) {
  var e = t13.state, r = t13.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n;
  a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !Jv(e.elements.popper, a) || (e.elements.arrow = a));
}
var pw = { name: "arrow", enabled: true, phase: "main", fn: vw, effect: hw, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function ii(t13) {
  return t13.split("-")[1];
}
var gw = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function mw(t13) {
  var e = t13.x, r = t13.y, n = window, a = n.devicePixelRatio || 1;
  return { x: ni(e * a) / a || 0, y: ni(r * a) / a || 0 };
}
function bd(t13) {
  var e, r = t13.popper, n = t13.popperRect, a = t13.placement, i = t13.variation, o = t13.offsets, s = t13.position, l = t13.gpuAcceleration, u = t13.adaptive, c = t13.roundOffsets, d = t13.isFixed, v = o.x, h6 = v === void 0 ? 0 : v, f = o.y, p = f === void 0 ? 0 : f, m = typeof c == "function" ? c({ x: h6, y: p }) : { x: h6, y: p };
  h6 = m.x, p = m.y;
  var g = o.hasOwnProperty("x"), y = o.hasOwnProperty("y"), b = hr, w = vr, C = window;
  if (u) {
    var E = wo(r), x = "clientHeight", T = "clientWidth";
    if (E === qr(r) && (E = Yn(r), pn(E).position !== "static" && s === "absolute" && (x = "scrollHeight", T = "scrollWidth")), E = E, a === vr || (a === hr || a === Dr) && i === Qi) {
      w = _r;
      var k = d && E === C && C.visualViewport ? C.visualViewport.height : E[x];
      p -= k - n.height, p *= l ? 1 : -1;
    }
    if (a === hr || (a === vr || a === _r) && i === Qi) {
      b = Dr;
      var _ = d && E === C && C.visualViewport ? C.visualViewport.width : E[T];
      h6 -= _ - n.width, h6 *= l ? 1 : -1;
    }
  }
  var D = Object.assign({ position: s }, u && gw), O = c === true ? mw({ x: h6, y: p }) : { x: h6, y: p };
  if (h6 = O.x, p = O.y, l) {
    var A;
    return Object.assign({}, D, (A = {}, A[w] = y ? "0" : "", A[b] = g ? "0" : "", A.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + h6 + "px, " + p + "px)" : "translate3d(" + h6 + "px, " + p + "px, 0)", A));
  }
  return Object.assign({}, D, (e = {}, e[w] = y ? p + "px" : "", e[b] = g ? h6 + "px" : "", e.transform = "", e));
}
function yw(t13) {
  var e = t13.state, r = t13.options, n = r.gpuAcceleration, a = n === void 0 ? true : n, i = r.adaptive, o = i === void 0 ? true : i, s = r.roundOffsets, l = s === void 0 ? true : s, u = { placement: Xr(e.placement), variation: ii(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: a, isFixed: e.options.strategy === "fixed" };
  e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, bd(Object.assign({}, u, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: l })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, bd(Object.assign({}, u, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: l })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var nh = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: yw, data: {} };
var Ro = { passive: true };
function bw(t13) {
  var e = t13.state, r = t13.instance, n = t13.options, a = n.scroll, i = a === void 0 ? true : a, o = n.resize, s = o === void 0 ? true : o, l = qr(e.elements.popper), u = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  return i && u.forEach(function(c) {
    c.addEventListener("scroll", r.update, Ro);
  }), s && l.addEventListener("resize", r.update, Ro), function() {
    i && u.forEach(function(c) {
      c.removeEventListener("scroll", r.update, Ro);
    }), s && l.removeEventListener("resize", r.update, Ro);
  };
}
var ah = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
}, effect: bw, data: {} };
var ww = { left: "right", right: "left", bottom: "top", top: "bottom" };
function os(t13) {
  return t13.replace(/left|right|bottom|top/g, function(e) {
    return ww[e];
  });
}
var Cw = { start: "end", end: "start" };
function wd(t13) {
  return t13.replace(/start|end/g, function(e) {
    return Cw[e];
  });
}
function Uu(t13) {
  var e = qr(t13), r = e.pageXOffset, n = e.pageYOffset;
  return { scrollLeft: r, scrollTop: n };
}
function Gu(t13) {
  return ai(Yn(t13)).left + Uu(t13).scrollLeft;
}
function xw(t13) {
  var e = qr(t13), r = Yn(t13), n = e.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, s = 0;
  return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, s = n.offsetTop)), { width: a, height: i, x: o + Gu(t13), y: s };
}
function Ew(t13) {
  var e, r = Yn(t13), n = Uu(t13), a = (e = t13.ownerDocument) == null ? void 0 : e.body, i = da(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = da(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + Gu(t13), l = -n.scrollTop;
  return pn(a || r).direction === "rtl" && (s += da(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: l };
}
function Wu(t13) {
  var e = pn(t13), r = e.overflow, n = e.overflowX, a = e.overflowY;
  return /auto|scroll|overlay|hidden/.test(r + a + n);
}
function ih(t13) {
  return ["html", "body", "#document"].indexOf(en(t13)) >= 0 ? t13.ownerDocument.body : Tr(t13) && Wu(t13) ? t13 : ih(Zs(t13));
}
function Ui(t13, e) {
  var r;
  e === void 0 && (e = []);
  var n = ih(t13), a = n === ((r = t13.ownerDocument) == null ? void 0 : r.body), i = qr(n), o = a ? [i].concat(i.visualViewport || [], Wu(n) ? n : []) : n, s = e.concat(o);
  return a ? s : s.concat(Ui(Zs(o)));
}
function ru(t13) {
  return Object.assign({}, t13, { left: t13.x, top: t13.y, right: t13.x + t13.width, bottom: t13.y + t13.height });
}
function kw(t13) {
  var e = ai(t13);
  return e.top = e.top + t13.clientTop, e.left = e.left + t13.clientLeft, e.bottom = e.top + t13.clientHeight, e.right = e.left + t13.clientWidth, e.width = t13.clientWidth, e.height = t13.clientHeight, e.x = e.left, e.y = e.top, e;
}
function Cd(t13, e) {
  return e === Xv ? ru(xw(t13)) : ri(e) ? kw(e) : ru(Ew(Yn(t13)));
}
function Sw(t13) {
  var e = Ui(Zs(t13)), r = ["absolute", "fixed"].indexOf(pn(t13).position) >= 0, n = r && Tr(t13) ? wo(t13) : t13;
  return ri(n) ? e.filter(function(a) {
    return ri(a) && Jv(a, n) && en(a) !== "body";
  }) : [];
}
function Tw(t13, e, r) {
  var n = e === "clippingParents" ? Sw(t13) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, l) {
    var u = Cd(t13, l);
    return s.top = da(u.top, s.top), s.right = _s(u.right, s.right), s.bottom = _s(u.bottom, s.bottom), s.left = da(u.left, s.left), s;
  }, Cd(t13, i));
  return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
}
function oh(t13) {
  var e = t13.reference, r = t13.element, n = t13.placement, a = n ? Xr(n) : null, i = n ? ii(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, l;
  switch (a) {
    case vr:
      l = { x: o, y: e.y - r.height };
      break;
    case _r:
      l = { x: o, y: e.y + e.height };
      break;
    case Dr:
      l = { x: e.x + e.width, y: s };
      break;
    case hr:
      l = { x: e.x - r.width, y: s };
      break;
    default:
      l = { x: e.x, y: e.y };
  }
  var u = a ? qu(a) : null;
  if (u != null) {
    var c = u === "y" ? "height" : "width";
    switch (i) {
      case ti:
        l[u] = l[u] - (e[c] / 2 - r[c] / 2);
        break;
      case Qi:
        l[u] = l[u] + (e[c] / 2 - r[c] / 2);
        break;
    }
  }
  return l;
}
function Ji(t13, e) {
  e === void 0 && (e = {});
  var r = e, n = r.placement, a = n === void 0 ? t13.placement : n, i = r.boundary, o = i === void 0 ? j2 : i, s = r.rootBoundary, l = s === void 0 ? Xv : s, u = r.elementContext, c = u === void 0 ? Oi : u, d = r.altBoundary, v = d === void 0 ? false : d, h6 = r.padding, f = h6 === void 0 ? 0 : h6, p = th(typeof f != "number" ? f : rh(f, bo)), m = c === Oi ? Z2 : Oi, g = t13.rects.popper, y = t13.elements[v ? m : c], b = Tw(ri(y) ? y : y.contextElement || Yn(t13.elements.popper), o, l), w = ai(t13.elements.reference), C = oh({ reference: w, element: g, strategy: "absolute", placement: a }), E = ru(Object.assign({}, g, C)), x = c === Oi ? E : w, T = { top: b.top - x.top + p.top, bottom: x.bottom - b.bottom + p.bottom, left: b.left - x.left + p.left, right: x.right - b.right + p.right }, k = t13.modifiersData.offset;
  if (c === Oi && k) {
    var _ = k[a];
    Object.keys(T).forEach(function(D) {
      var O = [Dr, _r].indexOf(D) >= 0 ? 1 : -1, A = [vr, _r].indexOf(D) >= 0 ? "y" : "x";
      T[D] += _[A] * O;
    });
  }
  return T;
}
function _w(t13, e) {
  e === void 0 && (e = {});
  var r = e, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, s = r.flipVariations, l = r.allowedAutoPlacements, u = l === void 0 ? js : l, c = ii(n), d = c ? s ? md : md.filter(function(f) {
    return ii(f) === c;
  }) : bo, v = d.filter(function(f) {
    return u.indexOf(f) >= 0;
  });
  v.length === 0 && (v = d);
  var h6 = v.reduce(function(f, p) {
    return f[p] = Ji(t13, { placement: p, boundary: a, rootBoundary: i, padding: o })[Xr(p)], f;
  }, {});
  return Object.keys(h6).sort(function(f, p) {
    return h6[f] - h6[p];
  });
}
function Dw(t13) {
  if (Xr(t13) === Vu) return [];
  var e = os(t13);
  return [wd(t13), e, wd(e)];
}
function Pw(t13) {
  var e = t13.state, r = t13.options, n = t13.name;
  if (!e.modifiersData[n]._skip) {
    for (var a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? true : o, l = r.fallbackPlacements, u = r.padding, c = r.boundary, d = r.rootBoundary, v = r.altBoundary, h6 = r.flipVariations, f = h6 === void 0 ? true : h6, p = r.allowedAutoPlacements, m = e.options.placement, g = Xr(m), y = g === m, b = l || (y || !f ? [os(m)] : Dw(m)), w = [m].concat(b).reduce(function(se, oe) {
      return se.concat(Xr(oe) === Vu ? _w(e, { placement: oe, boundary: c, rootBoundary: d, padding: u, flipVariations: f, allowedAutoPlacements: p }) : oe);
    }, []), C = e.rects.reference, E = e.rects.popper, x = /* @__PURE__ */ new Map(), T = true, k = w[0], _ = 0; _ < w.length; _++) {
      var D = w[_], O = Xr(D), A = ii(D) === ti, L = [vr, _r].indexOf(O) >= 0, N = L ? "width" : "height", I = Ji(e, { placement: D, boundary: c, rootBoundary: d, altBoundary: v, padding: u }), M = L ? A ? Dr : hr : A ? _r : vr;
      C[N] > E[N] && (M = os(M));
      var F = os(M), $ = [];
      if (i && $.push(I[O] <= 0), s && $.push(I[M] <= 0, I[F] <= 0), $.every(function(se) {
        return se;
      })) {
        k = D, T = false;
        break;
      }
      x.set(D, $);
    }
    if (T) for (var U = f ? 3 : 1, H = function(se) {
      var oe = w.find(function(ne) {
        var ue = x.get(ne);
        if (ue) return ue.slice(0, se).every(function(te) {
          return te;
        });
      });
      if (oe) return k = oe, "break";
    }, K = U; K > 0; K--) {
      var ee = H(K);
      if (ee === "break") break;
    }
    e.placement !== k && (e.modifiersData[n]._skip = true, e.placement = k, e.reset = true);
  }
}
var Ow = { name: "flip", enabled: true, phase: "main", fn: Pw, requiresIfExists: ["offset"], data: { _skip: false } };
function xd(t13, e, r) {
  return r === void 0 && (r = { x: 0, y: 0 }), { top: t13.top - e.height - r.y, right: t13.right - e.width + r.x, bottom: t13.bottom - e.height + r.y, left: t13.left - e.width - r.x };
}
function Ed(t13) {
  return [vr, Dr, _r, hr].some(function(e) {
    return t13[e] >= 0;
  });
}
function Lw(t13) {
  var e = t13.state, r = t13.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = Ji(e, { elementContext: "reference" }), s = Ji(e, { altBoundary: true }), l = xd(o, n), u = xd(s, a, i), c = Ed(l), d = Ed(u);
  e.modifiersData[r] = { referenceClippingOffsets: l, popperEscapeOffsets: u, isReferenceHidden: c, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d });
}
var Iw = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Lw };
function Aw(t13, e, r) {
  var n = Xr(t13), a = [hr, vr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t13 })) : r, o = i[0], s = i[1];
  return o = o || 0, s = (s || 0) * a, [hr, Dr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s };
}
function Fw(t13) {
  var e = t13.state, r = t13.options, n = t13.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = js.reduce(function(c, d) {
    return c[d] = Aw(d, e.rects, i), c;
  }, {}), s = o[e.placement], l = s.x, u = s.y;
  e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += l, e.modifiersData.popperOffsets.y += u), e.modifiersData[n] = o;
}
var Mw = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: Fw };
function Bw(t13) {
  var e = t13.state, r = t13.name;
  e.modifiersData[r] = oh({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var sh = { name: "popperOffsets", enabled: true, phase: "read", fn: Bw, data: {} };
function Nw(t13) {
  return t13 === "x" ? "y" : "x";
}
function Rw(t13) {
  var e = t13.state, r = t13.options, n = t13.name, a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? false : o, l = r.boundary, u = r.rootBoundary, c = r.altBoundary, d = r.padding, v = r.tether, h6 = v === void 0 ? true : v, f = r.tetherOffset, p = f === void 0 ? 0 : f, m = Ji(e, { boundary: l, rootBoundary: u, padding: d, altBoundary: c }), g = Xr(e.placement), y = ii(e.placement), b = !y, w = qu(g), C = Nw(w), E = e.modifiersData.popperOffsets, x = e.rects.reference, T = e.rects.popper, k = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof k == "number" ? { mainAxis: k, altAxis: k } : Object.assign({ mainAxis: 0, altAxis: 0 }, k), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 };
  if (E) {
    if (i) {
      var A, L = w === "y" ? vr : hr, N = w === "y" ? _r : Dr, I = w === "y" ? "height" : "width", M = E[w], F = M + m[L], $ = M - m[N], U = h6 ? -T[I] / 2 : 0, H = y === ti ? x[I] : T[I], K = y === ti ? -T[I] : -x[I], ee = e.elements.arrow, se = h6 && ee ? Ku(ee) : { width: 0, height: 0 }, oe = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : eh(), ne = oe[L], ue = oe[N], te = qi(0, x[I], se[I]), R = b ? x[I] / 2 - U - te - ne - _.mainAxis : H - te - ne - _.mainAxis, Y = b ? -x[I] / 2 + U + te + ue + _.mainAxis : K + te + ue + _.mainAxis, J = e.elements.arrow && wo(e.elements.arrow), ge = J ? w === "y" ? J.clientTop || 0 : J.clientLeft || 0 : 0, Ee = (A = D == null ? void 0 : D[w]) != null ? A : 0, ve = M + R - Ee - ge, me = M + Y - Ee, Ce = qi(h6 ? _s(F, ve) : F, M, h6 ? da($, me) : $);
      E[w] = Ce, O[w] = Ce - M;
    }
    if (s) {
      var ke, xe = w === "x" ? vr : hr, Pe = w === "x" ? _r : Dr, Ke = E[C], qe = C === "y" ? "height" : "width", Ne = Ke + m[xe], Ge = Ke - m[Pe], le = [vr, hr].indexOf(g) !== -1, S = (ke = D == null ? void 0 : D[C]) != null ? ke : 0, z = le ? Ne : Ke - x[qe] - T[qe] - S + _.altAxis, ae = le ? Ke + x[qe] + T[qe] - S - _.altAxis : Ge, Q = h6 && le ? dw(z, Ke, ae) : qi(h6 ? z : Ne, Ke, h6 ? ae : Ge);
      E[C] = Q, O[C] = Q - Ke;
    }
    e.modifiersData[n] = O;
  }
}
var $w = { name: "preventOverflow", enabled: true, phase: "main", fn: Rw, requiresIfExists: ["offset"] };
function zw(t13) {
  return { scrollLeft: t13.scrollLeft, scrollTop: t13.scrollTop };
}
function Vw(t13) {
  return t13 === qr(t13) || !Tr(t13) ? Uu(t13) : zw(t13);
}
function Hw(t13) {
  var e = t13.getBoundingClientRect(), r = ni(e.width) / t13.offsetWidth || 1, n = ni(e.height) / t13.offsetHeight || 1;
  return r !== 1 || n !== 1;
}
function Kw(t13, e, r) {
  r === void 0 && (r = false);
  var n = Tr(e), a = Tr(e) && Hw(e), i = Yn(e), o = ai(t13, a), s = { scrollLeft: 0, scrollTop: 0 }, l = { x: 0, y: 0 };
  return (n || !n && !r) && ((en(e) !== "body" || Wu(i)) && (s = Vw(e)), Tr(e) ? (l = ai(e, true), l.x += e.clientLeft, l.y += e.clientTop) : i && (l.x = Gu(i))), { x: o.left + s.scrollLeft - l.x, y: o.top + s.scrollTop - l.y, width: o.width, height: o.height };
}
function qw(t13) {
  var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
  t13.forEach(function(i) {
    e.set(i.name, i);
  });
  function a(i) {
    r.add(i.name);
    var o = [].concat(i.requires || [], i.requiresIfExists || []);
    o.forEach(function(s) {
      if (!r.has(s)) {
        var l = e.get(s);
        l && a(l);
      }
    }), n.push(i);
  }
  return t13.forEach(function(i) {
    r.has(i.name) || a(i);
  }), n;
}
function Uw(t13) {
  var e = qw(t13);
  return ow.reduce(function(r, n) {
    return r.concat(e.filter(function(a) {
      return a.phase === n;
    }));
  }, []);
}
function Gw(t13) {
  var e;
  return function() {
    return e || (e = new Promise(function(r) {
      Promise.resolve().then(function() {
        e = void 0, r(t13());
      });
    })), e;
  };
}
function Ww(t13) {
  var e = t13.reduce(function(r, n) {
    var a = r[n.name];
    return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r;
  }, {});
  return Object.keys(e).map(function(r) {
    return e[r];
  });
}
var kd = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Sd() {
  for (var t13 = arguments.length, e = new Array(t13), r = 0; r < t13; r++) e[r] = arguments[r];
  return !e.some(function(n) {
    return !(n && typeof n.getBoundingClientRect == "function");
  });
}
function Yu(t13) {
  t13 === void 0 && (t13 = {});
  var e = t13, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? kd : a;
  return function(o, s, l) {
    l === void 0 && (l = i);
    var u = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, kd, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = false, v = { state: u, setOptions: function(p) {
      var m = typeof p == "function" ? p(u.options) : p;
      f(), u.options = Object.assign({}, i, u.options, m), u.scrollParents = { reference: ri(o) ? Ui(o) : o.contextElement ? Ui(o.contextElement) : [], popper: Ui(s) };
      var g = Uw(Ww([].concat(n, u.options.modifiers)));
      return u.orderedModifiers = g.filter(function(y) {
        return y.enabled;
      }), h6(), v.update();
    }, forceUpdate: function() {
      if (!d) {
        var p = u.elements, m = p.reference, g = p.popper;
        if (Sd(m, g)) {
          u.rects = { reference: Kw(m, wo(g), u.options.strategy === "fixed"), popper: Ku(g) }, u.reset = false, u.placement = u.options.placement, u.orderedModifiers.forEach(function(T) {
            return u.modifiersData[T.name] = Object.assign({}, T.data);
          });
          for (var y = 0; y < u.orderedModifiers.length; y++) {
            if (u.reset === true) {
              u.reset = false, y = -1;
              continue;
            }
            var b = u.orderedModifiers[y], w = b.fn, C = b.options, E = C === void 0 ? {} : C, x = b.name;
            typeof w == "function" && (u = w({ state: u, options: E, name: x, instance: v }) || u);
          }
        }
      }
    }, update: Gw(function() {
      return new Promise(function(p) {
        v.forceUpdate(), p(u);
      });
    }), destroy: function() {
      f(), d = true;
    } };
    if (!Sd(o, s)) return v;
    v.setOptions(l).then(function(p) {
      !d && l.onFirstUpdate && l.onFirstUpdate(p);
    });
    function h6() {
      u.orderedModifiers.forEach(function(p) {
        var m = p.name, g = p.options, y = g === void 0 ? {} : g, b = p.effect;
        if (typeof b == "function") {
          var w = b({ state: u, name: m, instance: v, options: y }), C = function() {
          };
          c.push(w || C);
        }
      });
    }
    function f() {
      c.forEach(function(p) {
        return p();
      }), c = [];
    }
    return v;
  };
}
Yu();
var Yw = [ah, sh, nh, Qv];
Yu({ defaultModifiers: Yw });
var jw = [ah, sh, nh, Qv, Mw, Ow, $w, pw, Iw];
var Zw = Yu({ defaultModifiers: jw });
var Xw = (t13, e, r = {}) => {
  const n = {
    name: "updateState",
    enabled: true,
    phase: "write",
    fn: ({ state: l }) => {
      const u = Qw(l);
      Object.assign(o.value, u);
    },
    requires: ["computeStyles"]
  }, a = computed(() => {
    const { onFirstUpdate: l, placement: u, strategy: c, modifiers: d } = unref(r);
    return {
      onFirstUpdate: l,
      placement: u || "bottom",
      strategy: c || "absolute",
      modifiers: [
        ...d || [],
        n,
        { name: "applyStyles", enabled: false }
      ]
    };
  }), i = shallowRef(), o = ref({
    styles: {
      popper: {
        position: unref(a).strategy,
        left: "0",
        top: "0"
      },
      arrow: {
        position: "absolute"
      }
    },
    attributes: {}
  }), s = () => {
    i.value && (i.value.destroy(), i.value = void 0);
  };
  return watch(a, (l) => {
    const u = unref(i);
    u && u.setOptions(l);
  }, {
    deep: true
  }), watch([t13, e], ([l, u]) => {
    s(), !(!l || !u) && (i.value = Zw(l, u, unref(a)));
  }), onBeforeUnmount(() => {
    s();
  }), {
    state: computed(() => {
      var l;
      return { ...((l = unref(i)) == null ? void 0 : l.state) || {} };
    }),
    styles: computed(() => unref(o).styles),
    attributes: computed(() => unref(o).attributes),
    update: () => {
      var l;
      return (l = unref(i)) == null ? void 0 : l.update();
    },
    forceUpdate: () => {
      var l;
      return (l = unref(i)) == null ? void 0 : l.forceUpdate();
    },
    instanceRef: computed(() => unref(i))
  };
};
function Qw(t13) {
  const e = Object.keys(t13.elements), r = Es(e.map((a) => [a, t13.styles[a] || {}])), n = Es(e.map((a) => [a, t13.attributes[a]]));
  return {
    styles: r,
    attributes: n
  };
}
function Td() {
  let t13;
  const e = (n, a) => {
    r(), t13 = window.setTimeout(n, a);
  }, r = () => window.clearTimeout(t13);
  return zs(() => r()), {
    registerTimeout: e,
    cancelTimeout: r
  };
}
var nu = {
  prefix: Math.floor(Math.random() * 1e4),
  current: 0
};
var Jw = Symbol("elIdInjection");
var lh = () => getCurrentInstance() ? inject(Jw, nu) : nu;
var Xs = (t13) => {
  const e = lh();
  !_t && e === nu && Dt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
usage: app.provide(ID_INJECTION_KEY, {
  prefix: number,
  current: number,
})`);
  const r = zu();
  return computed(() => unref(t13) || `${r.value}-id-${e.prefix}-${e.current++}`);
};
var Va = [];
var _d = (t13) => {
  const e = t13;
  e.key === Lt.esc && Va.forEach((r) => r(e));
};
var eC = (t13) => {
  onMounted(() => {
    Va.length === 0 && document.addEventListener("keydown", _d), _t && Va.push(t13);
  }), onBeforeUnmount(() => {
    Va = Va.filter((e) => e !== t13), Va.length === 0 && _t && document.removeEventListener("keydown", _d);
  });
};
var Dd;
var uh = () => {
  const t13 = zu(), e = lh(), r = computed(() => `${t13.value}-popper-container-${e.prefix}`), n = computed(() => `#${r.value}`);
  return {
    id: r,
    selector: n
  };
};
var tC = (t13) => {
  const e = document.createElement("div");
  return e.id = t13, document.body.appendChild(e), e;
};
var rC = () => {
  const { id: t13, selector: e } = uh();
  return onBeforeMount(() => {
    _t && (!Dd || !document.body.querySelector(e.value)) && (Dd = tC(t13.value));
  }), {
    id: t13,
    selector: e
  };
};
var nC = rt({
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  }
});
var aC = ({
  showAfter: t13,
  hideAfter: e,
  autoClose: r,
  open: n,
  close: a
}) => {
  const { registerTimeout: i } = Td(), {
    registerTimeout: o,
    cancelTimeout: s
  } = Td();
  return {
    onOpen: (c) => {
      i(() => {
        n(c);
        const d = unref(r);
        qt(d) && d > 0 && o(() => {
          a(c);
        }, d);
      }, unref(t13));
    },
    onClose: (c) => {
      s(), i(() => {
        a(c);
      }, unref(e));
    }
  };
};
var ch = Symbol("elForwardRef");
var iC = (t13) => {
  provide(ch, {
    setForwardRef: (r) => {
      t13.value = r;
    }
  });
};
var oC = (t13) => ({
  mounted(e) {
    t13(e);
  },
  updated(e) {
    t13(e);
  },
  unmounted() {
    t13(null);
  }
});
var Pd = {
  current: 0
};
var Od = ref(0);
var dh = 2e3;
var Ld = Symbol("elZIndexContextKey");
var fh = Symbol("zIndexContextKey");
var vh = (t13) => {
  const e = getCurrentInstance() ? inject(Ld, Pd) : Pd, r = t13 || (getCurrentInstance() ? inject(fh, void 0) : void 0), n = computed(() => {
    const o = unref(r);
    return qt(o) ? o : dh;
  }), a = computed(() => n.value + Od.value), i = () => (e.current++, Od.value = e.current, a.value);
  return !_t && !inject(Ld) && Dt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), {
    initialZIndex: n,
    currentZIndex: a,
    nextZIndex: i
  };
};
function sC(t13) {
  let e;
  function r() {
    if (t13.value == null)
      return;
    const { selectionStart: a, selectionEnd: i, value: o } = t13.value;
    if (a == null || i == null)
      return;
    const s = o.slice(0, Math.max(0, a)), l = o.slice(Math.max(0, i));
    e = {
      selectionStart: a,
      selectionEnd: i,
      value: o,
      beforeTxt: s,
      afterTxt: l
    };
  }
  function n() {
    if (t13.value == null || e == null)
      return;
    const { value: a } = t13.value, { beforeTxt: i, afterTxt: o, selectionStart: s } = e;
    if (i == null || o == null || s == null)
      return;
    let l = a.length;
    if (a.endsWith(o))
      l = a.length - o.length;
    else if (a.startsWith(i))
      l = i.length;
    else {
      const u = i[s - 1], c = a.indexOf(u, s - 1);
      c !== -1 && (l = c + 1);
    }
    t13.value.setSelectionRange(l, l);
  }
  return [r, n];
}
var hi = Ys({
  type: String,
  values: Wv,
  required: false
});
var hh = Symbol("size");
var lC = () => {
  const t13 = inject(hh, {});
  return computed(() => unref(t13.size) || "");
};
function ju(t13, {
  beforeFocus: e,
  afterFocus: r,
  beforeBlur: n,
  afterBlur: a
} = {}) {
  const i = getCurrentInstance(), { emit: o } = i, s = shallowRef(), l = ref(false), u = (v) => {
    lr(e) && e(v) || l.value || (l.value = true, o("focus", v), r == null || r());
  }, c = (v) => {
    var h6;
    lr(n) && n(v) || v.relatedTarget && ((h6 = s.value) != null && h6.contains(v.relatedTarget)) || (l.value = false, o("blur", v), a == null || a());
  }, d = () => {
    var v, h6;
    (v = s.value) != null && v.contains(document.activeElement) && s.value !== document.activeElement || (h6 = t13.value) == null || h6.focus();
  };
  return watch(s, (v) => {
    v && v.setAttribute("tabindex", "-1");
  }), kr(s, "focus", u, true), kr(s, "blur", c, true), kr(s, "click", d, true), false, {
    isFocused: l,
    wrapperRef: s,
    handleFocus: u,
    handleBlur: c
  };
}
function ph({
  afterComposition: t13,
  emit: e
}) {
  const r = ref(false), n = (s) => {
    e == null || e("compositionstart", s), r.value = true;
  }, a = (s) => {
    var l;
    e == null || e("compositionupdate", s);
    const u = (l = s.target) == null ? void 0 : l.value, c = u[u.length - 1] || "";
    r.value = !N2(c);
  }, i = (s) => {
    e == null || e("compositionend", s), r.value && (r.value = false, nextTick(() => t13(s)));
  };
  return {
    isComposing: r,
    handleComposition: (s) => {
      s.type === "compositionend" ? i(s) : a(s);
    },
    handleCompositionStart: n,
    handleCompositionUpdate: a,
    handleCompositionEnd: i
  };
}
var gh = Symbol("emptyValuesContextKey");
var uC = "use-empty-values";
var cC = ["", void 0, null];
var dC = void 0;
var fC = rt({
  emptyValues: Array,
  valueOnClear: {
    type: [String, Number, Boolean, Function],
    default: void 0,
    validator: (t13) => lr(t13) ? !t13() : !t13
  }
});
var vC = (t13, e) => {
  const r = getCurrentInstance() ? inject(gh, ref({})) : ref({}), n = computed(() => t13.emptyValues || r.value.emptyValues || cC), a = computed(() => lr(t13.valueOnClear) ? t13.valueOnClear() : t13.valueOnClear !== void 0 ? t13.valueOnClear : lr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : dC), i = (o) => n.value.includes(o);
  return n.value.includes(a.value) || Dt(uC, "value-on-clear should be a value of empty-values"), {
    emptyValues: n,
    valueOnClear: a,
    isEmptyValue: i
  };
};
var hC = rt({
  ariaLabel: String,
  ariaOrientation: {
    type: String,
    values: ["horizontal", "vertical", "undefined"]
  },
  ariaControls: String
});
var jn = (t13) => Vv(hC, t13);
var mh = Symbol();
var Ds = ref();
function Zu(t13, e = void 0) {
  const r = getCurrentInstance() ? inject(mh, Ds) : Ds;
  return t13 ? computed(() => {
    var n, a;
    return (a = (n = r.value) == null ? void 0 : n[t13]) != null ? a : e;
  }) : r;
}
function pC(t13, e) {
  const r = Zu(), n = He(t13, computed(() => {
    var s;
    return ((s = r.value) == null ? void 0 : s.namespace) || is;
  })), a = yo(computed(() => {
    var s;
    return (s = r.value) == null ? void 0 : s.locale;
  })), i = vh(computed(() => {
    var s;
    return ((s = r.value) == null ? void 0 : s.zIndex) || dh;
  })), o = computed(() => {
    var s;
    return unref(e) || ((s = r.value) == null ? void 0 : s.size) || "";
  });
  return gC(computed(() => unref(r) || {})), {
    ns: n,
    locale: a,
    zIndex: i,
    size: o
  };
}
var gC = (t13, e, r = false) => {
  var n;
  const a = !!getCurrentInstance(), i = a ? Zu() : void 0, o = (n = void 0) != null ? n : a ? provide : void 0;
  if (!o) {
    Dt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
    return;
  }
  const s = computed(() => {
    const l = unref(t13);
    return i != null && i.value ? mC(i.value, l) : l;
  });
  return o(mh, s), o(Yv, computed(() => s.value.locale)), o(jv, computed(() => s.value.namespace)), o(fh, computed(() => s.value.zIndex)), o(hh, {
    size: computed(() => s.value.size || "")
  }), o(gh, computed(() => ({
    emptyValues: s.value.emptyValues,
    valueOnClear: s.value.valueOnClear
  }))), (r || !Ds.value) && (Ds.value = s.value), s;
};
var mC = (t13, e) => {
  const r = [.../* @__PURE__ */ new Set([...gd(t13), ...gd(e)])], n = {};
  for (const a of r)
    n[a] = e[a] !== void 0 ? e[a] : t13[a];
  return n;
};
var Ve = (t13, e) => {
  const r = t13.__vccOpts || t13;
  for (const [n, a] of e)
    r[n] = a;
  return r;
};
var yC = rt({
  size: {
    type: $e([Number, String])
  },
  color: {
    type: String
  }
});
var bC = defineComponent({
  name: "ElIcon",
  inheritAttrs: false
});
var wC = defineComponent({
  ...bC,
  props: yC,
  setup(t13) {
    const e = t13, r = He("icon"), n = computed(() => {
      const { size: a, color: i } = e;
      return !a && !i ? {} : {
        fontSize: Mn(a) ? void 0 : ei(a),
        "--color": i
      };
    });
    return (a, i) => (openBlock(), createElementBlock("i", mergeProps({
      class: unref(r).b(),
      style: unref(n)
    }, a.$attrs), [
      renderSlot(a.$slots, "default")
    ], 16));
  }
});
var CC = Ve(wC, [["__file", "icon.vue"]]);
var Ht = $t(CC);
var Xu = Symbol("formContextKey");
var eo = Symbol("formItemContextKey");
var pa = (t13, e = {}) => {
  const r = ref(void 0), n = e.prop ? r : Zv("size"), a = e.global ? r : lC(), i = e.form ? { size: void 0 } : inject(Xu, void 0), o = e.formItem ? { size: void 0 } : inject(eo, void 0);
  return computed(() => n.value || unref(t13) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || "");
};
var Co = (t13) => {
  const e = Zv("disabled"), r = inject(Xu, void 0);
  return computed(() => e.value || unref(t13) || (r == null ? void 0 : r.disabled) || false);
};
var Ta = () => {
  const t13 = inject(Xu, void 0), e = inject(eo, void 0);
  return {
    form: t13,
    formItem: e
  };
};
var xo = (t13, {
  formItemContext: e,
  disableIdGeneration: r,
  disableIdManagement: n
}) => {
  r || (r = ref(false)), n || (n = ref(false));
  const a = ref();
  let i;
  const o = computed(() => {
    var s;
    return !!(!(t13.label || t13.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
  });
  return onMounted(() => {
    i = watch([toRef(t13, "id"), r], ([s, l]) => {
      const u = s ?? (l ? void 0 : Xs().value);
      u !== a.value && (e != null && e.removeInputId && (a.value && e.removeInputId(a.value), !(n != null && n.value) && !l && u && e.addInputId(u)), a.value = u);
    }, { immediate: true });
  }), onUnmounted(() => {
    i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value);
  }), {
    isLabeledByFormItem: o,
    inputId: a
  };
};
var Ar;
var xC = `
  height:0 !important;
  visibility:hidden !important;
  ${Jm() ? "" : "overflow:hidden !important;"}
  position:absolute !important;
  z-index:-1000 !important;
  top:0 !important;
  right:0 !important;
`;
var EC = [
  "letter-spacing",
  "line-height",
  "padding-top",
  "padding-bottom",
  "font-family",
  "font-weight",
  "font-size",
  "text-rendering",
  "text-transform",
  "width",
  "text-indent",
  "padding-left",
  "padding-right",
  "border-width",
  "box-sizing"
];
function kC(t13) {
  const e = window.getComputedStyle(t13), r = e.getPropertyValue("box-sizing"), n = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), a = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
  return { contextStyle: EC.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r };
}
function Id(t13, e = 1, r) {
  var n;
  Ar || (Ar = document.createElement("textarea"), document.body.appendChild(Ar));
  const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = kC(t13);
  Ar.setAttribute("style", `${s};${xC}`), Ar.value = t13.value || t13.placeholder || "";
  let l = Ar.scrollHeight;
  const u = {};
  o === "border-box" ? l = l + i : o === "content-box" && (l = l - a), Ar.value = "";
  const c = Ar.scrollHeight - a;
  if (qt(e)) {
    let d = c * e;
    o === "border-box" && (d = d + a + i), l = Math.max(d, l), u.minHeight = `${d}px`;
  }
  if (qt(r)) {
    let d = c * r;
    o === "border-box" && (d = d + a + i), l = Math.min(d, l);
  }
  return u.height = `${l}px`, (n = Ar.parentNode) == null || n.removeChild(Ar), Ar = void 0, u;
}
var SC = rt({
  id: {
    type: String,
    default: void 0
  },
  size: hi,
  disabled: Boolean,
  modelValue: {
    type: $e([
      String,
      Number,
      Object
    ]),
    default: ""
  },
  maxlength: {
    type: [String, Number]
  },
  minlength: {
    type: [String, Number]
  },
  type: {
    type: String,
    default: "text"
  },
  resize: {
    type: String,
    values: ["none", "both", "horizontal", "vertical"]
  },
  autosize: {
    type: $e([Boolean, Object]),
    default: false
  },
  autocomplete: {
    type: String,
    default: "off"
  },
  formatter: {
    type: Function
  },
  parser: {
    type: Function
  },
  placeholder: {
    type: String
  },
  form: {
    type: String
  },
  readonly: Boolean,
  clearable: Boolean,
  showPassword: Boolean,
  showWordLimit: Boolean,
  suffixIcon: {
    type: Hn
  },
  prefixIcon: {
    type: Hn
  },
  containerRole: {
    type: String,
    default: void 0
  },
  tabindex: {
    type: [String, Number],
    default: 0
  },
  validateEvent: {
    type: Boolean,
    default: true
  },
  inputStyle: {
    type: $e([Object, Array, String]),
    default: () => za({})
  },
  autofocus: Boolean,
  rows: {
    type: Number,
    default: 2
  },
  ...jn(["ariaLabel"])
});
var TC = {
  [Vt]: (t13) => tr(t13),
  input: (t13) => tr(t13),
  change: (t13) => tr(t13),
  focus: (t13) => t13 instanceof FocusEvent,
  blur: (t13) => t13 instanceof FocusEvent,
  clear: () => true,
  mouseleave: (t13) => t13 instanceof MouseEvent,
  mouseenter: (t13) => t13 instanceof MouseEvent,
  keydown: (t13) => t13 instanceof Event,
  compositionstart: (t13) => t13 instanceof CompositionEvent,
  compositionupdate: (t13) => t13 instanceof CompositionEvent,
  compositionend: (t13) => t13 instanceof CompositionEvent
};
var _C = defineComponent({
  name: "ElInput",
  inheritAttrs: false
});
var DC = defineComponent({
  ..._C,
  props: SC,
  emits: TC,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, a = useAttrs(), i = useSlots(), o = computed(() => {
      const S = {};
      return n.containerRole === "combobox" && (S["aria-haspopup"] = a["aria-haspopup"], S["aria-owns"] = a["aria-owns"], S["aria-expanded"] = a["aria-expanded"]), S;
    }), s = computed(() => [
      n.type === "textarea" ? m.b() : p.b(),
      p.m(h6.value),
      p.is("disabled", f.value),
      p.is("exceed", ee.value),
      {
        [p.b("group")]: i.prepend || i.append,
        [p.m("prefix")]: i.prefix || n.prefixIcon,
        [p.m("suffix")]: i.suffix || n.suffixIcon || n.clearable || n.showPassword,
        [p.bm("suffix", "password-clear")]: $.value && U.value,
        [p.b("hidden")]: n.type === "hidden"
      },
      a.class
    ]), l = computed(() => [
      p.e("wrapper"),
      p.is("focus", k.value)
    ]), u = z2({
      excludeKeys: computed(() => Object.keys(o.value))
    }), { form: c, formItem: d } = Ta(), { inputId: v } = xo(n, {
      formItemContext: d
    }), h6 = pa(), f = Co(), p = He("input"), m = He("textarea"), g = shallowRef(), y = shallowRef(), b = ref(false), w = ref(false), C = ref(), E = shallowRef(n.inputStyle), x = computed(() => g.value || y.value), { wrapperRef: T, isFocused: k, handleFocus: _, handleBlur: D } = ju(x, {
      beforeFocus() {
        return f.value;
      },
      afterBlur() {
        var S;
        n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "blur").catch((z) => Dt(z)));
      }
    }), O = computed(() => {
      var S;
      return (S = c == null ? void 0 : c.statusIcon) != null ? S : false;
    }), A = computed(() => (d == null ? void 0 : d.validateState) || ""), L = computed(() => A.value && Gv[A.value]), N = computed(() => w.value ? D2 : C2), I = computed(() => [
      a.style
    ]), M = computed(() => [
      n.inputStyle,
      E.value,
      { resize: n.resize }
    ]), F = computed(() => Rn(n.modelValue) ? "" : String(n.modelValue)), $ = computed(() => n.clearable && !f.value && !n.readonly && !!F.value && (k.value || b.value)), U = computed(() => n.showPassword && !f.value && !n.readonly && !!F.value && (!!F.value || k.value)), H = computed(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !f.value && !n.readonly && !n.showPassword), K = computed(() => F.value.length), ee = computed(() => !!H.value && K.value > Number(n.maxlength)), se = computed(() => !!i.suffix || !!n.suffixIcon || $.value || n.showPassword || H.value || !!A.value && O.value), [oe, ne] = sC(g);
    cn(y, (S) => {
      if (R(), !H.value || n.resize !== "both")
        return;
      const z = S[0], { width: ae } = z.contentRect;
      C.value = {
        right: `calc(100% - ${ae + 15 + 6}px)`
      };
    });
    const ue = () => {
      const { type: S, autosize: z } = n;
      if (!(!_t || S !== "textarea" || !y.value))
        if (z) {
          const ae = Kt(z) ? z.minRows : void 0, Q = Kt(z) ? z.maxRows : void 0, X = Id(y.value, ae, Q);
          E.value = {
            overflowY: "hidden",
            ...X
          }, nextTick(() => {
            y.value.offsetHeight, E.value = X;
          });
        } else
          E.value = {
            minHeight: Id(y.value).minHeight
          };
    }, R = /* @__PURE__ */ ((S) => {
      let z = false;
      return () => {
        var ae;
        if (z || !n.autosize)
          return;
        ((ae = y.value) == null ? void 0 : ae.offsetParent) === null || (S(), z = true);
      };
    })(ue), Y = () => {
      const S = x.value, z = n.formatter ? n.formatter(F.value) : F.value;
      !S || S.value === z || (S.value = z);
    }, J = async (S) => {
      oe();
      let { value: z } = S.target;
      if (n.formatter && (z = n.parser ? n.parser(z) : z), !Ee.value) {
        if (z === F.value) {
          Y();
          return;
        }
        r(Vt, z), r("input", z), await nextTick(), Y(), ne();
      }
    }, ge = (S) => {
      r("change", S.target.value);
    }, {
      isComposing: Ee,
      handleCompositionStart: ve,
      handleCompositionUpdate: me,
      handleCompositionEnd: Ce
    } = ph({ emit: r, afterComposition: J }), ke = () => {
      w.value = !w.value, xe();
    }, xe = async () => {
      var S;
      await nextTick(), (S = x.value) == null || S.focus();
    }, Pe = () => {
      var S;
      return (S = x.value) == null ? void 0 : S.blur();
    }, Ke = (S) => {
      b.value = false, r("mouseleave", S);
    }, qe = (S) => {
      b.value = true, r("mouseenter", S);
    }, Ne = (S) => {
      r("keydown", S);
    }, Ge = () => {
      var S;
      (S = x.value) == null || S.select();
    }, le = () => {
      r(Vt, ""), r("change", ""), r("clear"), r("input", "");
    };
    return watch(() => n.modelValue, () => {
      var S;
      nextTick(() => ue()), n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "change").catch((z) => Dt(z)));
    }), watch(F, () => Y()), watch(() => n.type, async () => {
      await nextTick(), Y(), ue();
    }), onMounted(() => {
      !n.formatter && n.parser && Dt("ElInput", "If you set the parser, you also need to set the formatter."), Y(), nextTick(ue);
    }), e({
      input: g,
      textarea: y,
      ref: x,
      textareaStyle: M,
      autosize: toRef(n, "autosize"),
      isComposing: Ee,
      focus: xe,
      blur: Pe,
      select: Ge,
      clear: le,
      resizeTextarea: ue
    }), (S, z) => (openBlock(), createElementBlock("div", mergeProps(unref(o), {
      class: [
        unref(s),
        {
          [unref(p).bm("group", "append")]: S.$slots.append,
          [unref(p).bm("group", "prepend")]: S.$slots.prepend
        }
      ],
      style: unref(I),
      role: S.containerRole,
      onMouseenter: qe,
      onMouseleave: Ke
    }), [
      createCommentVNode(" input "),
      S.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
        createCommentVNode(" prepend slot "),
        S.$slots.prepend ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(unref(p).be("group", "prepend"))
        }, [
          renderSlot(S.$slots, "prepend")
        ], 2)) : createCommentVNode("v-if", true),
        createBaseVNode("div", {
          ref_key: "wrapperRef",
          ref: T,
          class: normalizeClass(unref(l))
        }, [
          createCommentVNode(" prefix slot "),
          S.$slots.prefix || S.prefixIcon ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: normalizeClass(unref(p).e("prefix"))
          }, [
            createBaseVNode("span", {
              class: normalizeClass(unref(p).e("prefix-inner"))
            }, [
              renderSlot(S.$slots, "prefix"),
              S.prefixIcon ? (openBlock(), createBlock(unref(Ht), {
                key: 0,
                class: normalizeClass(unref(p).e("icon"))
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(S.prefixIcon)))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ], 2)
          ], 2)) : createCommentVNode("v-if", true),
          createBaseVNode("input", mergeProps({
            id: unref(v),
            ref_key: "input",
            ref: g,
            class: unref(p).e("inner")
          }, unref(u), {
            minlength: S.minlength,
            maxlength: S.maxlength,
            type: S.showPassword ? w.value ? "text" : "password" : S.type,
            disabled: unref(f),
            readonly: S.readonly,
            autocomplete: S.autocomplete,
            tabindex: S.tabindex,
            "aria-label": S.ariaLabel,
            placeholder: S.placeholder,
            style: S.inputStyle,
            form: S.form,
            autofocus: S.autofocus,
            onCompositionstart: unref(ve),
            onCompositionupdate: unref(me),
            onCompositionend: unref(Ce),
            onInput: J,
            onChange: ge,
            onKeydown: Ne
          }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
          createCommentVNode(" suffix slot "),
          unref(se) ? (openBlock(), createElementBlock("span", {
            key: 1,
            class: normalizeClass(unref(p).e("suffix"))
          }, [
            createBaseVNode("span", {
              class: normalizeClass(unref(p).e("suffix-inner"))
            }, [
              !unref($) || !unref(U) || !unref(H) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                renderSlot(S.$slots, "suffix"),
                S.suffixIcon ? (openBlock(), createBlock(unref(Ht), {
                  key: 0,
                  class: normalizeClass(unref(p).e("icon"))
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(S.suffixIcon)))
                  ]),
                  _: 1
                }, 8, ["class"])) : createCommentVNode("v-if", true)
              ], 64)) : createCommentVNode("v-if", true),
              unref($) ? (openBlock(), createBlock(unref(Ht), {
                key: 1,
                class: normalizeClass([unref(p).e("icon"), unref(p).e("clear")]),
                onMousedown: withModifiers(unref(ji), ["prevent"]),
                onClick: le
              }, {
                default: withCtx(() => [
                  createVNode(unref(Nu))
                ]),
                _: 1
              }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
              unref(U) ? (openBlock(), createBlock(unref(Ht), {
                key: 2,
                class: normalizeClass([unref(p).e("icon"), unref(p).e("password")]),
                onClick: ke
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(unref(N))))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true),
              unref(H) ? (openBlock(), createElementBlock("span", {
                key: 3,
                class: normalizeClass(unref(p).e("count"))
              }, [
                createBaseVNode("span", {
                  class: normalizeClass(unref(p).e("count-inner"))
                }, toDisplayString(unref(K)) + " / " + toDisplayString(S.maxlength), 3)
              ], 2)) : createCommentVNode("v-if", true),
              unref(A) && unref(L) && unref(O) ? (openBlock(), createBlock(unref(Ht), {
                key: 4,
                class: normalizeClass([
                  unref(p).e("icon"),
                  unref(p).e("validateIcon"),
                  unref(p).is("loading", unref(A) === "validating")
                ])
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(unref(L))))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ], 2)
          ], 2)) : createCommentVNode("v-if", true)
        ], 2),
        createCommentVNode(" append slot "),
        S.$slots.append ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: normalizeClass(unref(p).be("group", "append"))
        }, [
          renderSlot(S.$slots, "append")
        ], 2)) : createCommentVNode("v-if", true)
      ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
        createCommentVNode(" textarea "),
        createBaseVNode("textarea", mergeProps({
          id: unref(v),
          ref_key: "textarea",
          ref: y,
          class: [unref(m).e("inner"), unref(p).is("focus", unref(k))]
        }, unref(u), {
          minlength: S.minlength,
          maxlength: S.maxlength,
          tabindex: S.tabindex,
          disabled: unref(f),
          readonly: S.readonly,
          autocomplete: S.autocomplete,
          style: unref(M),
          "aria-label": S.ariaLabel,
          placeholder: S.placeholder,
          form: S.form,
          autofocus: S.autofocus,
          rows: S.rows,
          onCompositionstart: unref(ve),
          onCompositionupdate: unref(me),
          onCompositionend: unref(Ce),
          onInput: J,
          onFocus: unref(_),
          onBlur: unref(D),
          onChange: ge,
          onKeydown: Ne
        }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
        unref(H) ? (openBlock(), createElementBlock("span", {
          key: 0,
          style: normalizeStyle(C.value),
          class: normalizeClass(unref(p).e("count"))
        }, toDisplayString(unref(K)) + " / " + toDisplayString(S.maxlength), 7)) : createCommentVNode("v-if", true)
      ], 64))
    ], 16, ["role"]));
  }
});
var PC = Ve(DC, [["__file", "input.vue"]]);
var Eo = $t(PC);
var Ia = 4;
var OC = {
  vertical: {
    offset: "offsetHeight",
    scroll: "scrollTop",
    scrollSize: "scrollHeight",
    size: "height",
    key: "vertical",
    axis: "Y",
    client: "clientY",
    direction: "top"
  },
  horizontal: {
    offset: "offsetWidth",
    scroll: "scrollLeft",
    scrollSize: "scrollWidth",
    size: "width",
    key: "horizontal",
    axis: "X",
    client: "clientX",
    direction: "left"
  }
};
var LC = ({
  move: t13,
  size: e,
  bar: r
}) => ({
  [r.size]: e,
  transform: `translate${r.axis}(${t13}%)`
});
var Qu = Symbol("scrollbarContextKey");
var IC = rt({
  vertical: Boolean,
  size: String,
  move: Number,
  ratio: {
    type: Number,
    required: true
  },
  always: Boolean
});
var AC = "Thumb";
var FC = defineComponent({
  __name: "thumb",
  props: IC,
  setup(t13) {
    const e = t13, r = inject(Qu), n = He("scrollbar");
    r || Jb(AC, "can not inject scrollbar context");
    const a = ref(), i = ref(), o = ref({}), s = ref(false);
    let l = false, u = false, c = _t ? document.onselectstart : null;
    const d = computed(() => OC[e.vertical ? "vertical" : "horizontal"]), v = computed(() => LC({
      size: e.size,
      move: e.move,
      bar: d.value
    })), h6 = computed(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), f = (E) => {
      var x;
      if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button))
        return;
      (x = window.getSelection()) == null || x.removeAllRanges(), m(E);
      const T = E.currentTarget;
      T && (o.value[d.value.axis] = T[d.value.offset] - (E[d.value.client] - T.getBoundingClientRect()[d.value.direction]));
    }, p = (E) => {
      if (!i.value || !a.value || !r.wrapElement)
        return;
      const x = Math.abs(E.target.getBoundingClientRect()[d.value.direction] - E[d.value.client]), T = i.value[d.value.offset] / 2, k = (x - T) * 100 * h6.value / a.value[d.value.offset];
      r.wrapElement[d.value.scroll] = k * r.wrapElement[d.value.scrollSize] / 100;
    }, m = (E) => {
      E.stopImmediatePropagation(), l = true, document.addEventListener("mousemove", g), document.addEventListener("mouseup", y), c = document.onselectstart, document.onselectstart = () => false;
    }, g = (E) => {
      if (!a.value || !i.value || l === false)
        return;
      const x = o.value[d.value.axis];
      if (!x)
        return;
      const T = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, k = i.value[d.value.offset] - x, _ = (T - k) * 100 * h6.value / a.value[d.value.offset];
      r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100;
    }, y = () => {
      l = false, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", y), C(), u && (s.value = false);
    }, b = () => {
      u = false, s.value = !!e.size;
    }, w = () => {
      u = true, s.value = l;
    };
    onBeforeUnmount(() => {
      C(), document.removeEventListener("mouseup", y);
    });
    const C = () => {
      document.onselectstart !== c && (document.onselectstart = c);
    };
    return kr(toRef(r, "scrollbarElement"), "mousemove", b), kr(toRef(r, "scrollbarElement"), "mouseleave", w), (E, x) => (openBlock(), createBlock(Transition, {
      name: unref(n).b("fade"),
      persisted: ""
    }, {
      default: withCtx(() => [
        withDirectives(createBaseVNode("div", {
          ref_key: "instance",
          ref: a,
          class: normalizeClass([unref(n).e("bar"), unref(n).is(unref(d).key)]),
          onMousedown: p
        }, [
          createBaseVNode("div", {
            ref_key: "thumb",
            ref: i,
            class: normalizeClass(unref(n).e("thumb")),
            style: normalizeStyle(unref(v)),
            onMousedown: f
          }, null, 38)
        ], 34), [
          [vShow, E.always || s.value]
        ])
      ]),
      _: 1
    }, 8, ["name"]));
  }
});
var Ad = Ve(FC, [["__file", "thumb.vue"]]);
var MC = rt({
  always: {
    type: Boolean,
    default: true
  },
  minSize: {
    type: Number,
    required: true
  }
});
var BC = defineComponent({
  __name: "bar",
  props: MC,
  setup(t13, { expose: e }) {
    const r = t13, n = inject(Qu), a = ref(0), i = ref(0), o = ref(""), s = ref(""), l = ref(1), u = ref(1);
    return e({
      handleScroll: (v) => {
        if (v) {
          const h6 = v.offsetHeight - Ia, f = v.offsetWidth - Ia;
          i.value = v.scrollTop * 100 / h6 * l.value, a.value = v.scrollLeft * 100 / f * u.value;
        }
      },
      update: () => {
        const v = n == null ? void 0 : n.wrapElement;
        if (!v)
          return;
        const h6 = v.offsetHeight - Ia, f = v.offsetWidth - Ia, p = h6 ** 2 / v.scrollHeight, m = f ** 2 / v.scrollWidth, g = Math.max(p, r.minSize), y = Math.max(m, r.minSize);
        l.value = p / (h6 - p) / (g / (h6 - g)), u.value = m / (f - m) / (y / (f - y)), s.value = g + Ia < h6 ? `${g}px` : "", o.value = y + Ia < f ? `${y}px` : "";
      }
    }), (v, h6) => (openBlock(), createElementBlock(Fragment, null, [
      createVNode(Ad, {
        move: a.value,
        ratio: u.value,
        size: o.value,
        always: v.always
      }, null, 8, ["move", "ratio", "size", "always"]),
      createVNode(Ad, {
        move: i.value,
        ratio: l.value,
        size: s.value,
        vertical: "",
        always: v.always
      }, null, 8, ["move", "ratio", "size", "always"])
    ], 64));
  }
});
var NC = Ve(BC, [["__file", "bar.vue"]]);
var RC = rt({
  height: {
    type: [String, Number],
    default: ""
  },
  maxHeight: {
    type: [String, Number],
    default: ""
  },
  native: {
    type: Boolean,
    default: false
  },
  wrapStyle: {
    type: $e([String, Object, Array]),
    default: ""
  },
  wrapClass: {
    type: [String, Array],
    default: ""
  },
  viewClass: {
    type: [String, Array],
    default: ""
  },
  viewStyle: {
    type: [String, Array, Object],
    default: ""
  },
  noresize: Boolean,
  tag: {
    type: String,
    default: "div"
  },
  always: Boolean,
  minSize: {
    type: Number,
    default: 20
  },
  tabindex: {
    type: [String, Number],
    default: void 0
  },
  id: String,
  role: String,
  ...jn(["ariaLabel", "ariaOrientation"])
});
var $C = {
  scroll: ({
    scrollTop: t13,
    scrollLeft: e
  }) => [t13, e].every(qt)
};
var au = "ElScrollbar";
var zC = defineComponent({
  name: au
});
var VC = defineComponent({
  ...zC,
  props: RC,
  emits: $C,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, a = He("scrollbar");
    let i, o, s = 0, l = 0;
    const u = ref(), c = ref(), d = ref(), v = ref(), h6 = computed(() => {
      const C = {};
      return n.height && (C.height = ei(n.height)), n.maxHeight && (C.maxHeight = ei(n.maxHeight)), [n.wrapStyle, C];
    }), f = computed(() => [
      n.wrapClass,
      a.e("wrap"),
      { [a.em("wrap", "hidden-default")]: !n.native }
    ]), p = computed(() => [a.e("view"), n.viewClass]), m = () => {
      var C;
      c.value && ((C = v.value) == null || C.handleScroll(c.value), s = c.value.scrollTop, l = c.value.scrollLeft, r("scroll", {
        scrollTop: c.value.scrollTop,
        scrollLeft: c.value.scrollLeft
      }));
    };
    function g(C, E) {
      Kt(C) ? c.value.scrollTo(C) : qt(C) && qt(E) && c.value.scrollTo(C, E);
    }
    const y = (C) => {
      if (!qt(C)) {
        Dt(au, "value must be a number");
        return;
      }
      c.value.scrollTop = C;
    }, b = (C) => {
      if (!qt(C)) {
        Dt(au, "value must be a number");
        return;
      }
      c.value.scrollLeft = C;
    }, w = () => {
      var C;
      (C = v.value) == null || C.update();
    };
    return watch(() => n.noresize, (C) => {
      C ? (i == null || i(), o == null || o()) : ({ stop: i } = cn(d, w), o = kr("resize", w));
    }, { immediate: true }), watch(() => [n.maxHeight, n.height], () => {
      n.native || nextTick(() => {
        var C;
        w(), c.value && ((C = v.value) == null || C.handleScroll(c.value));
      });
    }), provide(Qu, reactive({
      scrollbarElement: u,
      wrapElement: c
    })), onActivated(() => {
      c.value && (c.value.scrollTop = s, c.value.scrollLeft = l);
    }), onMounted(() => {
      n.native || nextTick(() => {
        w();
      });
    }), onUpdated(() => w()), e({
      wrapRef: c,
      update: w,
      scrollTo: g,
      setScrollTop: y,
      setScrollLeft: b,
      handleScroll: m
    }), (C, E) => (openBlock(), createElementBlock("div", {
      ref_key: "scrollbarRef",
      ref: u,
      class: normalizeClass(unref(a).b())
    }, [
      createBaseVNode("div", {
        ref_key: "wrapRef",
        ref: c,
        class: normalizeClass(unref(f)),
        style: normalizeStyle(unref(h6)),
        tabindex: C.tabindex,
        onScroll: m
      }, [
        (openBlock(), createBlock(resolveDynamicComponent(C.tag), {
          id: C.id,
          ref_key: "resizeRef",
          ref: d,
          class: normalizeClass(unref(p)),
          style: normalizeStyle(C.viewStyle),
          role: C.role,
          "aria-label": C.ariaLabel,
          "aria-orientation": C.ariaOrientation
        }, {
          default: withCtx(() => [
            renderSlot(C.$slots, "default")
          ]),
          _: 3
        }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
      ], 46, ["tabindex"]),
      C.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(NC, {
        key: 0,
        ref_key: "barRef",
        ref: v,
        always: C.always,
        "min-size": C.minSize
      }, null, 8, ["always", "min-size"]))
    ], 2));
  }
});
var HC = Ve(VC, [["__file", "scrollbar.vue"]]);
var KC = $t(HC);
var Ju = Symbol("popper");
var yh = Symbol("popperContent");
var qC = [
  "dialog",
  "grid",
  "group",
  "listbox",
  "menu",
  "navigation",
  "tooltip",
  "tree"
];
var bh = rt({
  role: {
    type: String,
    values: qC,
    default: "tooltip"
  }
});
var UC = defineComponent({
  name: "ElPopper",
  inheritAttrs: false
});
var GC = defineComponent({
  ...UC,
  props: bh,
  setup(t13, { expose: e }) {
    const r = t13, n = ref(), a = ref(), i = ref(), o = ref(), s = computed(() => r.role), l = {
      triggerRef: n,
      popperInstanceRef: a,
      contentRef: i,
      referenceRef: o,
      role: s
    };
    return e(l), provide(Ju, l), (u, c) => renderSlot(u.$slots, "default");
  }
});
var WC = Ve(GC, [["__file", "popper.vue"]]);
var wh = rt({
  arrowOffset: {
    type: Number,
    default: 5
  }
});
var YC = defineComponent({
  name: "ElPopperArrow",
  inheritAttrs: false
});
var jC = defineComponent({
  ...YC,
  props: wh,
  setup(t13, { expose: e }) {
    const r = t13, n = He("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = inject(yh, void 0);
    return watch(() => r.arrowOffset, (s) => {
      a.value = s;
    }), onBeforeUnmount(() => {
      i.value = void 0;
    }), e({
      arrowRef: i
    }), (s, l) => (openBlock(), createElementBlock("span", {
      ref_key: "arrowRef",
      ref: i,
      class: normalizeClass(unref(n).e("arrow")),
      style: normalizeStyle(unref(o)),
      "data-popper-arrow": ""
    }, null, 6));
  }
});
var ZC = Ve(jC, [["__file", "arrow.vue"]]);
var Tl = "ElOnlyChild";
var XC = defineComponent({
  name: Tl,
  setup(t13, {
    slots: e,
    attrs: r
  }) {
    var n;
    const a = inject(ch), i = oC((n = a == null ? void 0 : a.setForwardRef) != null ? n : ji);
    return () => {
      var o;
      const s = (o = e.default) == null ? void 0 : o.call(e, r);
      if (!s)
        return null;
      if (s.length > 1)
        return Dt(Tl, "requires exact only one valid child."), null;
      const l = Ch(s);
      return l ? withDirectives(cloneVNode(l, r), [[i]]) : (Dt(Tl, "no valid child node found"), null);
    };
  }
});
function Ch(t13) {
  if (!t13)
    return null;
  const e = t13;
  for (const r of e) {
    if (Kt(r))
      switch (r.type) {
        case Comment:
          continue;
        case Text:
        case "svg":
          return Fd(r);
        case Fragment:
          return Ch(r.children);
        default:
          return r;
      }
    return Fd(r);
  }
  return null;
}
function Fd(t13) {
  const e = He("only-child");
  return createVNode("span", {
    class: e.e("content")
  }, [t13]);
}
var xh = rt({
  virtualRef: {
    type: $e(Object)
  },
  virtualTriggering: Boolean,
  onMouseenter: {
    type: $e(Function)
  },
  onMouseleave: {
    type: $e(Function)
  },
  onClick: {
    type: $e(Function)
  },
  onKeydown: {
    type: $e(Function)
  },
  onFocus: {
    type: $e(Function)
  },
  onBlur: {
    type: $e(Function)
  },
  onContextmenu: {
    type: $e(Function)
  },
  id: String,
  open: Boolean
});
var QC = defineComponent({
  name: "ElPopperTrigger",
  inheritAttrs: false
});
var JC = defineComponent({
  ...QC,
  props: xh,
  setup(t13, { expose: e }) {
    const r = t13, { role: n, triggerRef: a } = inject(Ju, void 0);
    iC(a);
    const i = computed(() => s.value ? r.id : void 0), o = computed(() => {
      if (n && n.value === "tooltip")
        return r.open && r.id ? r.id : void 0;
    }), s = computed(() => {
      if (n && n.value !== "tooltip")
        return n.value;
    }), l = computed(() => s.value ? `${r.open}` : void 0);
    let u;
    const c = [
      "onMouseenter",
      "onMouseleave",
      "onClick",
      "onKeydown",
      "onFocus",
      "onBlur",
      "onContextmenu"
    ];
    return onMounted(() => {
      watch(() => r.virtualRef, (d) => {
        d && (a.value = fn(d));
      }, {
        immediate: true
      }), watch(a, (d, v) => {
        u == null || u(), u = void 0, ua(d) && (c.forEach((h6) => {
          var f;
          const p = r[h6];
          p && (d.addEventListener(h6.slice(2).toLowerCase(), p), (f = v == null ? void 0 : v.removeEventListener) == null || f.call(v, h6.slice(2).toLowerCase(), p));
        }), u = watch([i, o, s, l], (h6) => {
          [
            "aria-controls",
            "aria-describedby",
            "aria-haspopup",
            "aria-expanded"
          ].forEach((f, p) => {
            Rn(h6[p]) ? d.removeAttribute(f) : d.setAttribute(f, h6[p]);
          });
        }, { immediate: true })), ua(v) && [
          "aria-controls",
          "aria-describedby",
          "aria-haspopup",
          "aria-expanded"
        ].forEach((h6) => v.removeAttribute(h6));
      }, {
        immediate: true
      });
    }), onBeforeUnmount(() => {
      if (u == null || u(), u = void 0, a.value && ua(a.value)) {
        const d = a.value;
        c.forEach((v) => {
          const h6 = r[v];
          h6 && d.removeEventListener(v.slice(2).toLowerCase(), h6);
        }), a.value = void 0;
      }
    }), e({
      triggerRef: a
    }), (d, v) => d.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(XC), mergeProps({ key: 0 }, d.$attrs, {
      "aria-controls": unref(i),
      "aria-describedby": unref(o),
      "aria-expanded": unref(l),
      "aria-haspopup": unref(s)
    }), {
      default: withCtx(() => [
        renderSlot(d.$slots, "default")
      ]),
      _: 3
    }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
  }
});
var ex = Ve(JC, [["__file", "trigger.vue"]]);
var _l = "focus-trap.focus-after-trapped";
var Dl = "focus-trap.focus-after-released";
var tx = "focus-trap.focusout-prevented";
var Md = {
  cancelable: true,
  bubbles: false
};
var rx = {
  cancelable: true,
  bubbles: false
};
var Bd = "focusAfterTrapped";
var Nd = "focusAfterReleased";
var nx = Symbol("elFocusTrap");
var ec = ref();
var Qs = ref(0);
var tc = ref(0);
var $o = 0;
var Eh = (t13) => {
  const e = [], r = document.createTreeWalker(t13, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (n) => {
      const a = n.tagName === "INPUT" && n.type === "hidden";
      return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; r.nextNode(); )
    e.push(r.currentNode);
  return e;
};
var Rd = (t13, e) => {
  for (const r of t13)
    if (!ax(r, e))
      return r;
};
var ax = (t13, e) => {
  if (false)
    return false;
  if (getComputedStyle(t13).visibility === "hidden")
    return true;
  for (; t13; ) {
    if (e && t13 === e)
      return false;
    if (getComputedStyle(t13).display === "none")
      return true;
    t13 = t13.parentElement;
  }
  return false;
};
var ix = (t13) => {
  const e = Eh(t13), r = Rd(e, t13), n = Rd(e.reverse(), t13);
  return [r, n];
};
var ox = (t13) => t13 instanceof HTMLInputElement && "select" in t13;
var On = (t13, e) => {
  if (t13 && t13.focus) {
    const r = document.activeElement;
    t13.focus({ preventScroll: true }), tc.value = window.performance.now(), t13 !== r && ox(t13) && e && t13.select();
  }
};
function $d(t13, e) {
  const r = [...t13], n = t13.indexOf(e);
  return n !== -1 && r.splice(n, 1), r;
}
var sx = () => {
  let t13 = [];
  return {
    push: (n) => {
      const a = t13[0];
      a && n !== a && a.pause(), t13 = $d(t13, n), t13.unshift(n);
    },
    remove: (n) => {
      var a, i;
      t13 = $d(t13, n), (i = (a = t13[0]) == null ? void 0 : a.resume) == null || i.call(a);
    }
  };
};
var lx = (t13, e = false) => {
  const r = document.activeElement;
  for (const n of t13)
    if (On(n, e), document.activeElement !== r)
      return;
};
var zd = sx();
var ux = () => Qs.value > tc.value;
var zo = () => {
  ec.value = "pointer", Qs.value = window.performance.now();
};
var Vd = () => {
  ec.value = "keyboard", Qs.value = window.performance.now();
};
var cx = () => (onMounted(() => {
  $o === 0 && (document.addEventListener("mousedown", zo), document.addEventListener("touchstart", zo), document.addEventListener("keydown", Vd)), $o++;
}), onBeforeUnmount(() => {
  $o--, $o <= 0 && (document.removeEventListener("mousedown", zo), document.removeEventListener("touchstart", zo), document.removeEventListener("keydown", Vd));
}), {
  focusReason: ec,
  lastUserFocusTimestamp: Qs,
  lastAutomatedFocusTimestamp: tc
});
var Vo = (t13) => new CustomEvent(tx, {
  ...rx,
  detail: t13
});
var dx = defineComponent({
  name: "ElFocusTrap",
  inheritAttrs: false,
  props: {
    loop: Boolean,
    trapped: Boolean,
    focusTrapEl: Object,
    focusStartEl: {
      type: [Object, String],
      default: "first"
    }
  },
  emits: [
    Bd,
    Nd,
    "focusin",
    "focusout",
    "focusout-prevented",
    "release-requested"
  ],
  setup(t13, { emit: e }) {
    const r = ref();
    let n, a;
    const { focusReason: i } = cx();
    eC((f) => {
      t13.trapped && !o.paused && e("release-requested", f);
    });
    const o = {
      paused: false,
      pause() {
        this.paused = true;
      },
      resume() {
        this.paused = false;
      }
    }, s = (f) => {
      if (!t13.loop && !t13.trapped || o.paused)
        return;
      const { key: p, altKey: m, ctrlKey: g, metaKey: y, currentTarget: b, shiftKey: w } = f, { loop: C } = t13, E = p === Lt.tab && !m && !g && !y, x = document.activeElement;
      if (E && x) {
        const T = b, [k, _] = ix(T);
        if (k && _) {
          if (!w && x === _) {
            const O = Vo({
              focusReason: i.value
            });
            e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(k, true));
          } else if (w && [k, T].includes(x)) {
            const O = Vo({
              focusReason: i.value
            });
            e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(_, true));
          }
        } else if (x === T) {
          const O = Vo({
            focusReason: i.value
          });
          e("focusout-prevented", O), O.defaultPrevented || f.preventDefault();
        }
      }
    };
    provide(nx, {
      focusTrapRef: r,
      onKeydown: s
    }), watch(() => t13.focusTrapEl, (f) => {
      f && (r.value = f);
    }, { immediate: true }), watch([r], ([f], [p]) => {
      f && (f.addEventListener("keydown", s), f.addEventListener("focusin", c), f.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d));
    });
    const l = (f) => {
      e(Bd, f);
    }, u = (f) => e(Nd, f), c = (f) => {
      const p = unref(r);
      if (!p)
        return;
      const m = f.target, g = f.relatedTarget, y = m && p.contains(m);
      t13.trapped || g && p.contains(g) || (n = g), y && e("focusin", f), !o.paused && t13.trapped && (y ? a = m : On(a, true));
    }, d = (f) => {
      const p = unref(r);
      if (!(o.paused || !p))
        if (t13.trapped) {
          const m = f.relatedTarget;
          !Rn(m) && !p.contains(m) && setTimeout(() => {
            if (!o.paused && t13.trapped) {
              const g = Vo({
                focusReason: i.value
              });
              e("focusout-prevented", g), g.defaultPrevented || On(a, true);
            }
          }, 0);
        } else {
          const m = f.target;
          m && p.contains(m) || e("focusout", f);
        }
    };
    async function v() {
      await nextTick();
      const f = unref(r);
      if (f) {
        zd.push(o);
        const p = f.contains(document.activeElement) ? n : document.activeElement;
        if (n = p, !f.contains(p)) {
          const g = new Event(_l, Md);
          f.addEventListener(_l, l), f.dispatchEvent(g), g.defaultPrevented || nextTick(() => {
            let y = t13.focusStartEl;
            tr(y) || (On(y), document.activeElement !== y && (y = "first")), y === "first" && lx(Eh(f), true), (document.activeElement === p || y === "container") && On(f);
          });
        }
      }
    }
    function h6() {
      const f = unref(r);
      if (f) {
        f.removeEventListener(_l, l);
        const p = new CustomEvent(Dl, {
          ...Md,
          detail: {
            focusReason: i.value
          }
        });
        f.addEventListener(Dl, u), f.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !ux() || f.contains(document.activeElement)) && On(n ?? document.body), f.removeEventListener(Dl, u), zd.remove(o);
      }
    }
    return onMounted(() => {
      t13.trapped && v(), watch(() => t13.trapped, (f) => {
        f ? v() : h6();
      });
    }), onBeforeUnmount(() => {
      t13.trapped && h6(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0);
    }), {
      onKeydown: s
    };
  }
});
function fx(t13, e, r, n, a, i) {
  return renderSlot(t13.$slots, "default", { handleKeydown: t13.onKeydown });
}
var vx = Ve(dx, [["render", fx], ["__file", "focus-trap.vue"]]);
var hx = ["fixed", "absolute"];
var px = rt({
  boundariesPadding: {
    type: Number,
    default: 0
  },
  fallbackPlacements: {
    type: $e(Array),
    default: void 0
  },
  gpuAcceleration: {
    type: Boolean,
    default: true
  },
  offset: {
    type: Number,
    default: 12
  },
  placement: {
    type: String,
    values: js,
    default: "bottom"
  },
  popperOptions: {
    type: $e(Object),
    default: () => ({})
  },
  strategy: {
    type: String,
    values: hx,
    default: "absolute"
  }
});
var kh = rt({
  ...px,
  id: String,
  style: {
    type: $e([String, Array, Object])
  },
  className: {
    type: $e([String, Array, Object])
  },
  effect: {
    type: $e(String),
    default: "dark"
  },
  visible: Boolean,
  enterable: {
    type: Boolean,
    default: true
  },
  pure: Boolean,
  focusOnShow: {
    type: Boolean,
    default: false
  },
  trapping: {
    type: Boolean,
    default: false
  },
  popperClass: {
    type: $e([String, Array, Object])
  },
  popperStyle: {
    type: $e([String, Array, Object])
  },
  referenceEl: {
    type: $e(Object)
  },
  triggerTargetEl: {
    type: $e(Object)
  },
  stopPopperMouseEvent: {
    type: Boolean,
    default: true
  },
  virtualTriggering: Boolean,
  zIndex: Number,
  ...jn(["ariaLabel"])
});
var gx = {
  mouseenter: (t13) => t13 instanceof MouseEvent,
  mouseleave: (t13) => t13 instanceof MouseEvent,
  focus: () => true,
  blur: () => true,
  close: () => true
};
var mx = (t13, e = []) => {
  const { placement: r, strategy: n, popperOptions: a } = t13, i = {
    placement: r,
    strategy: n,
    ...a,
    modifiers: [...bx(t13), ...e]
  };
  return wx(i, a == null ? void 0 : a.modifiers), i;
};
var yx = (t13) => {
  if (_t)
    return fn(t13);
};
function bx(t13) {
  const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t13;
  return [
    {
      name: "offset",
      options: {
        offset: [0, e ?? 12]
      }
    },
    {
      name: "preventOverflow",
      options: {
        padding: {
          top: 2,
          bottom: 2,
          left: 5,
          right: 5
        }
      }
    },
    {
      name: "flip",
      options: {
        padding: 5,
        fallbackPlacements: n
      }
    },
    {
      name: "computeStyles",
      options: {
        gpuAcceleration: r
      }
    }
  ];
}
function wx(t13, e) {
  e && (t13.modifiers = [...t13.modifiers, ...e ?? []]);
}
var Cx = 0;
var xx = (t13) => {
  const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = inject(Ju, void 0), i = ref(), o = ref(), s = computed(() => ({
    name: "eventListeners",
    enabled: !!t13.visible
  })), l = computed(() => {
    var g;
    const y = unref(i), b = (g = unref(o)) != null ? g : Cx;
    return {
      name: "arrow",
      enabled: !Wb(y),
      options: {
        element: y,
        padding: b
      }
    };
  }), u = computed(() => ({
    onFirstUpdate: () => {
      f();
    },
    ...mx(t13, [
      unref(l),
      unref(s)
    ])
  })), c = computed(() => yx(t13.referenceEl) || unref(n)), { attributes: d, state: v, styles: h6, update: f, forceUpdate: p, instanceRef: m } = Xw(c, r, u);
  return watch(m, (g) => e.value = g), onMounted(() => {
    watch(() => {
      var g;
      return (g = unref(c)) == null ? void 0 : g.getBoundingClientRect();
    }, () => {
      f();
    });
  }), {
    attributes: d,
    arrowRef: i,
    contentRef: r,
    instanceRef: m,
    state: v,
    styles: h6,
    role: a,
    forceUpdate: p,
    update: f
  };
};
var Ex = (t13, {
  attributes: e,
  styles: r,
  role: n
}) => {
  const { nextZIndex: a } = vh(), i = He("popper"), o = computed(() => unref(e).popper), s = ref(qt(t13.zIndex) ? t13.zIndex : a()), l = computed(() => [
    i.b(),
    i.is("pure", t13.pure),
    i.is(t13.effect),
    t13.popperClass
  ]), u = computed(() => [
    { zIndex: unref(s) },
    unref(r).popper,
    t13.popperStyle || {}
  ]), c = computed(() => n.value === "dialog" ? "false" : void 0), d = computed(() => unref(r).arrow || {});
  return {
    ariaModal: c,
    arrowStyle: d,
    contentAttrs: o,
    contentClass: l,
    contentStyle: u,
    contentZIndex: s,
    updateZIndex: () => {
      s.value = qt(t13.zIndex) ? t13.zIndex : a();
    }
  };
};
var kx = (t13, e) => {
  const r = ref(false), n = ref();
  return {
    focusStartRef: n,
    trapped: r,
    onFocusAfterReleased: (u) => {
      var c;
      ((c = u.detail) == null ? void 0 : c.focusReason) !== "pointer" && (n.value = "first", e("blur"));
    },
    onFocusAfterTrapped: () => {
      e("focus");
    },
    onFocusInTrap: (u) => {
      t13.visible && !r.value && (u.target && (n.value = u.target), r.value = true);
    },
    onFocusoutPrevented: (u) => {
      t13.trapping || (u.detail.focusReason === "pointer" && u.preventDefault(), r.value = false);
    },
    onReleaseRequested: () => {
      r.value = false, e("close");
    }
  };
};
var Sx = defineComponent({
  name: "ElPopperContent"
});
var Tx = defineComponent({
  ...Sx,
  props: kh,
  emits: gx,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, {
      focusStartRef: a,
      trapped: i,
      onFocusAfterReleased: o,
      onFocusAfterTrapped: s,
      onFocusInTrap: l,
      onFocusoutPrevented: u,
      onReleaseRequested: c
    } = kx(n, r), { attributes: d, arrowRef: v, contentRef: h6, styles: f, instanceRef: p, role: m, update: g } = xx(n), {
      ariaModal: y,
      arrowStyle: b,
      contentAttrs: w,
      contentClass: C,
      contentStyle: E,
      updateZIndex: x
    } = Ex(n, {
      styles: f,
      attributes: d,
      role: m
    }), T = inject(eo, void 0), k = ref();
    provide(yh, {
      arrowStyle: b,
      arrowRef: v,
      arrowOffset: k
    }), T && provide(eo, {
      ...T,
      addInputId: ji,
      removeInputId: ji
    });
    let _;
    const D = (A = true) => {
      g(), A && x();
    }, O = () => {
      D(false), n.visible && n.focusOnShow ? i.value = true : n.visible === false && (i.value = false);
    };
    return onMounted(() => {
      watch(() => n.triggerTargetEl, (A, L) => {
        _ == null || _(), _ = void 0;
        const N = unref(A || h6.value), I = unref(L || h6.value);
        ua(N) && (_ = watch([m, () => n.ariaLabel, y, () => n.id], (M) => {
          ["role", "aria-label", "aria-modal", "id"].forEach((F, $) => {
            Rn(M[$]) ? N.removeAttribute(F) : N.setAttribute(F, M[$]);
          });
        }, { immediate: true })), I !== N && ua(I) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => {
          I.removeAttribute(M);
        });
      }, { immediate: true }), watch(() => n.visible, O, { immediate: true });
    }), onBeforeUnmount(() => {
      _ == null || _(), _ = void 0;
    }), e({
      popperContentRef: h6,
      popperInstanceRef: p,
      updatePopper: D,
      contentStyle: E
    }), (A, L) => (openBlock(), createElementBlock("div", mergeProps({
      ref_key: "contentRef",
      ref: h6
    }, unref(w), {
      style: unref(E),
      class: unref(C),
      tabindex: "-1",
      onMouseenter: (N) => A.$emit("mouseenter", N),
      onMouseleave: (N) => A.$emit("mouseleave", N)
    }), [
      createVNode(unref(vx), {
        trapped: unref(i),
        "trap-on-focus-in": true,
        "focus-trap-el": unref(h6),
        "focus-start-el": unref(a),
        onFocusAfterTrapped: unref(s),
        onFocusAfterReleased: unref(o),
        onFocusin: unref(l),
        onFocusoutPrevented: unref(u),
        onReleaseRequested: unref(c)
      }, {
        default: withCtx(() => [
          renderSlot(A.$slots, "default")
        ]),
        _: 3
      }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
    ], 16, ["onMouseenter", "onMouseleave"]));
  }
});
var _x = Ve(Tx, [["__file", "content.vue"]]);
var Dx = $t(WC);
var rc = Symbol("elTooltip");
var cr = rt({
  ...nC,
  ...kh,
  appendTo: {
    type: $e([String, Object])
  },
  content: {
    type: String,
    default: ""
  },
  rawContent: Boolean,
  persistent: Boolean,
  visible: {
    type: $e(Boolean),
    default: null
  },
  transition: String,
  teleported: {
    type: Boolean,
    default: true
  },
  disabled: Boolean,
  ...jn(["ariaLabel"])
});
var to = rt({
  ...xh,
  disabled: Boolean,
  trigger: {
    type: $e([String, Array]),
    default: "hover"
  },
  triggerKeys: {
    type: $e(Array),
    default: () => [Lt.enter, Lt.space]
  }
});
var {
  useModelToggleProps: Px,
  useModelToggleEmits: Ox,
  useModelToggle: Lx
} = Y2("visible");
var Ix = rt({
  ...bh,
  ...Px,
  ...cr,
  ...to,
  ...wh,
  showArrow: {
    type: Boolean,
    default: true
  }
});
var Ax = [
  ...Ox,
  "before-show",
  "before-hide",
  "show",
  "hide",
  "open",
  "close"
];
var Fx = (t13, e) => fr(t13) ? t13.includes(e) : t13 === e;
var Aa = (t13, e, r) => (n) => {
  Fx(unref(t13), e) && r(n);
};
var Mx = defineComponent({
  name: "ElTooltipTrigger"
});
var Bx = defineComponent({
  ...Mx,
  props: to,
  setup(t13, { expose: e }) {
    const r = t13, n = He("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: l, onToggle: u } = inject(rc, void 0), c = ref(null), d = () => {
      if (unref(a) || r.disabled)
        return true;
    }, v = toRef(r, "trigger"), h6 = un(d, Aa(v, "hover", s)), f = un(d, Aa(v, "hover", l)), p = un(d, Aa(v, "click", (w) => {
      w.button === 0 && u(w);
    })), m = un(d, Aa(v, "focus", s)), g = un(d, Aa(v, "focus", l)), y = un(d, Aa(v, "contextmenu", (w) => {
      w.preventDefault(), u(w);
    })), b = un(d, (w) => {
      const { code: C } = w;
      r.triggerKeys.includes(C) && (w.preventDefault(), u(w));
    });
    return e({
      triggerRef: c
    }), (w, C) => (openBlock(), createBlock(unref(ex), {
      id: unref(i),
      "virtual-ref": w.virtualRef,
      open: unref(o),
      "virtual-triggering": w.virtualTriggering,
      class: normalizeClass(unref(n).e("trigger")),
      onBlur: unref(g),
      onClick: unref(p),
      onContextmenu: unref(y),
      onFocus: unref(m),
      onMouseenter: unref(h6),
      onMouseleave: unref(f),
      onKeydown: unref(b)
    }, {
      default: withCtx(() => [
        renderSlot(w.$slots, "default")
      ]),
      _: 3
    }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
  }
});
var Nx = Ve(Bx, [["__file", "trigger.vue"]]);
var Rx = rt({
  to: {
    type: $e([String, Object]),
    required: true
  },
  disabled: Boolean
});
var $x = defineComponent({
  __name: "teleport",
  props: Rx,
  setup(t13) {
    return (e, r) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, {
      key: 1,
      to: e.to
    }, [
      renderSlot(e.$slots, "default")
    ], 8, ["to"]));
  }
});
var zx = Ve($x, [["__file", "teleport.vue"]]);
var Vx = $t(zx);
var Hx = defineComponent({
  name: "ElTooltipContent",
  inheritAttrs: false
});
var Kx = defineComponent({
  ...Hx,
  props: cr,
  setup(t13, { expose: e }) {
    const r = t13, { selector: n } = uh(), a = He("tooltip"), i = ref(null);
    let o;
    const {
      controlled: s,
      id: l,
      open: u,
      trigger: c,
      onClose: d,
      onOpen: v,
      onShow: h6,
      onHide: f,
      onBeforeShow: p,
      onBeforeHide: m
    } = inject(rc, void 0), g = computed(() => r.transition || `${a.namespace.value}-fade-in-linear`), y = computed(() => false ? true : r.persistent);
    onBeforeUnmount(() => {
      o == null || o();
    });
    const b = computed(() => unref(y) ? true : unref(u)), w = computed(() => r.disabled ? false : unref(u)), C = computed(() => r.appendTo || n.value), E = computed(() => {
      var I;
      return (I = r.style) != null ? I : {};
    }), x = ref(true), T = () => {
      f(), x.value = true;
    }, k = () => {
      if (unref(s))
        return true;
    }, _ = un(k, () => {
      r.enterable && unref(c) === "hover" && v();
    }), D = un(k, () => {
      unref(c) === "hover" && d();
    }), O = () => {
      var I, M;
      (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I), p == null || p();
    }, A = () => {
      m == null || m();
    }, L = () => {
      h6(), o = zm(computed(() => {
        var I;
        return (I = i.value) == null ? void 0 : I.popperContentRef;
      }), () => {
        if (unref(s))
          return;
        unref(c) !== "hover" && d();
      });
    }, N = () => {
      r.virtualTriggering || d();
    };
    return watch(() => unref(u), (I) => {
      I ? x.value = false : o == null || o();
    }, {
      flush: "post"
    }), watch(() => r.content, () => {
      var I, M;
      (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I);
    }), e({
      contentRef: i
    }), (I, M) => (openBlock(), createBlock(unref(Vx), {
      disabled: !I.teleported,
      to: unref(C)
    }, {
      default: withCtx(() => [
        createVNode(Transition, {
          name: unref(g),
          onAfterLeave: T,
          onBeforeEnter: O,
          onAfterEnter: L,
          onBeforeLeave: A
        }, {
          default: withCtx(() => [
            unref(b) ? withDirectives((openBlock(), createBlock(unref(_x), mergeProps({
              key: 0,
              id: unref(l),
              ref_key: "contentRef",
              ref: i
            }, I.$attrs, {
              "aria-label": I.ariaLabel,
              "aria-hidden": x.value,
              "boundaries-padding": I.boundariesPadding,
              "fallback-placements": I.fallbackPlacements,
              "gpu-acceleration": I.gpuAcceleration,
              offset: I.offset,
              placement: I.placement,
              "popper-options": I.popperOptions,
              strategy: I.strategy,
              effect: I.effect,
              enterable: I.enterable,
              pure: I.pure,
              "popper-class": I.popperClass,
              "popper-style": [I.popperStyle, unref(E)],
              "reference-el": I.referenceEl,
              "trigger-target-el": I.triggerTargetEl,
              visible: unref(w),
              "z-index": I.zIndex,
              onMouseenter: unref(_),
              onMouseleave: unref(D),
              onBlur: N,
              onClose: unref(d)
            }), {
              default: withCtx(() => [
                renderSlot(I.$slots, "default")
              ]),
              _: 3
            }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
              [vShow, unref(w)]
            ]) : createCommentVNode("v-if", true)
          ]),
          _: 3
        }, 8, ["name"])
      ]),
      _: 3
    }, 8, ["disabled", "to"]));
  }
});
var qx = Ve(Kx, [["__file", "content.vue"]]);
var Ux = defineComponent({
  name: "ElTooltip"
});
var Gx = defineComponent({
  ...Ux,
  props: Ix,
  emits: Ax,
  setup(t13, { expose: e, emit: r }) {
    const n = t13;
    rC();
    const a = Xs(), i = ref(), o = ref(), s = () => {
      var g;
      const y = unref(i);
      y && ((g = y.popperInstanceRef) == null || g.update());
    }, l = ref(false), u = ref(), { show: c, hide: d, hasUpdateHandler: v } = Lx({
      indicator: l,
      toggleReason: u
    }), { onOpen: h6, onClose: f } = aC({
      showAfter: toRef(n, "showAfter"),
      hideAfter: toRef(n, "hideAfter"),
      autoClose: toRef(n, "autoClose"),
      open: c,
      close: d
    }), p = computed(() => Ja(n.visible) && !v.value);
    provide(rc, {
      controlled: p,
      id: a,
      open: readonly(l),
      trigger: toRef(n, "trigger"),
      onOpen: (g) => {
        h6(g);
      },
      onClose: (g) => {
        f(g);
      },
      onToggle: (g) => {
        unref(l) ? f(g) : h6(g);
      },
      onShow: () => {
        r("show", u.value);
      },
      onHide: () => {
        r("hide", u.value);
      },
      onBeforeShow: () => {
        r("before-show", u.value);
      },
      onBeforeHide: () => {
        r("before-hide", u.value);
      },
      updatePopper: s
    }), watch(() => n.disabled, (g) => {
      g && l.value && (l.value = false);
    });
    const m = (g) => {
      var y, b;
      const w = (b = (y = o.value) == null ? void 0 : y.contentRef) == null ? void 0 : b.popperContentRef, C = (g == null ? void 0 : g.relatedTarget) || document.activeElement;
      return w && w.contains(C);
    };
    return onDeactivated(() => l.value && d()), e({
      popperRef: i,
      contentRef: o,
      isFocusInsideContent: m,
      updatePopper: s,
      onOpen: h6,
      onClose: f,
      hide: d
    }), (g, y) => (openBlock(), createBlock(unref(Dx), {
      ref_key: "popperRef",
      ref: i,
      role: g.role
    }, {
      default: withCtx(() => [
        createVNode(Nx, {
          disabled: g.disabled,
          trigger: g.trigger,
          "trigger-keys": g.triggerKeys,
          "virtual-ref": g.virtualRef,
          "virtual-triggering": g.virtualTriggering
        }, {
          default: withCtx(() => [
            g.$slots.default ? renderSlot(g.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
          ]),
          _: 3
        }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
        createVNode(qx, {
          ref_key: "contentRef",
          ref: o,
          "aria-label": g.ariaLabel,
          "boundaries-padding": g.boundariesPadding,
          content: g.content,
          disabled: g.disabled,
          effect: g.effect,
          enterable: g.enterable,
          "fallback-placements": g.fallbackPlacements,
          "hide-after": g.hideAfter,
          "gpu-acceleration": g.gpuAcceleration,
          offset: g.offset,
          persistent: g.persistent,
          "popper-class": g.popperClass,
          "popper-style": g.popperStyle,
          placement: g.placement,
          "popper-options": g.popperOptions,
          pure: g.pure,
          "raw-content": g.rawContent,
          "reference-el": g.referenceEl,
          "trigger-target-el": g.triggerTargetEl,
          "show-after": g.showAfter,
          strategy: g.strategy,
          teleported: g.teleported,
          transition: g.transition,
          "virtual-triggering": g.virtualTriggering,
          "z-index": g.zIndex,
          "append-to": g.appendTo
        }, {
          default: withCtx(() => [
            renderSlot(g.$slots, "content", {}, () => [
              g.rawContent ? (openBlock(), createElementBlock("span", {
                key: 0,
                innerHTML: g.content
              }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(g.content), 1))
            ]),
            g.showArrow ? (openBlock(), createBlock(unref(ZC), {
              key: 0,
              "arrow-offset": g.arrowOffset
            }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true)
          ]),
          _: 3
        }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
      ]),
      _: 3
    }, 8, ["role"]));
  }
});
var Wx = Ve(Gx, [["__file", "tooltip.vue"]]);
var ko = $t(Wx);
var Sh = Symbol("buttonGroupContextKey");
var Yx = (t13, e) => {
  as({
    from: "type.text",
    replacement: "link",
    version: "3.0.0",
    scope: "props",
    ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  }, computed(() => t13.type === "text"));
  const r = inject(Sh, void 0), n = Zu("button"), { form: a } = Ta(), i = pa(computed(() => r == null ? void 0 : r.size)), o = Co(), s = ref(), l = useSlots(), u = computed(() => t13.type || (r == null ? void 0 : r.type) || ""), c = computed(() => {
    var f, p, m;
    return (m = (p = t13.autoInsertSpace) != null ? p : (f = n.value) == null ? void 0 : f.autoInsertSpace) != null ? m : false;
  }), d = computed(() => t13.tag === "button" ? {
    ariaDisabled: o.value || t13.loading,
    disabled: o.value || t13.loading,
    autofocus: t13.autofocus,
    type: t13.nativeType
  } : {}), v = computed(() => {
    var f;
    const p = (f = l.default) == null ? void 0 : f.call(l);
    if (c.value && (p == null ? void 0 : p.length) === 1) {
      const m = p[0];
      if ((m == null ? void 0 : m.type) === Text) {
        const g = m.children;
        return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(g.trim());
      }
    }
    return false;
  });
  return {
    _disabled: o,
    _size: i,
    _type: u,
    _ref: s,
    _props: d,
    shouldAddSpace: v,
    handleClick: (f) => {
      if (o.value || t13.loading) {
        f.stopPropagation();
        return;
      }
      t13.nativeType === "reset" && (a == null || a.resetFields()), e("click", f);
    }
  };
};
var jx = [
  "default",
  "primary",
  "success",
  "warning",
  "info",
  "danger",
  "text",
  ""
];
var Zx = ["button", "submit", "reset"];
var iu = rt({
  size: hi,
  disabled: Boolean,
  type: {
    type: String,
    values: jx,
    default: ""
  },
  icon: {
    type: Hn
  },
  nativeType: {
    type: String,
    values: Zx,
    default: "button"
  },
  loading: Boolean,
  loadingIcon: {
    type: Hn,
    default: () => Ru
  },
  plain: Boolean,
  text: Boolean,
  link: Boolean,
  bg: Boolean,
  autofocus: Boolean,
  round: Boolean,
  circle: Boolean,
  color: String,
  dark: Boolean,
  autoInsertSpace: {
    type: Boolean,
    default: void 0
  },
  tag: {
    type: $e([String, Object]),
    default: "button"
  }
});
var Xx = {
  click: (t13) => t13 instanceof MouseEvent
};
function Ut(t13, e) {
  Qx(t13) && (t13 = "100%");
  var r = Jx(t13);
  return t13 = e === 360 ? t13 : Math.min(e, Math.max(0, parseFloat(t13))), r && (t13 = parseInt(String(t13 * e), 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : (e === 360 ? t13 = (t13 < 0 ? t13 % e + e : t13 % e) / parseFloat(String(e)) : t13 = t13 % e / parseFloat(String(e)), t13);
}
function Ho(t13) {
  return Math.min(1, Math.max(0, t13));
}
function Qx(t13) {
  return typeof t13 == "string" && t13.indexOf(".") !== -1 && parseFloat(t13) === 1;
}
function Jx(t13) {
  return typeof t13 == "string" && t13.indexOf("%") !== -1;
}
function Th(t13) {
  return t13 = parseFloat(t13), (isNaN(t13) || t13 < 0 || t13 > 1) && (t13 = 1), t13;
}
function Ko(t13) {
  return t13 <= 1 ? "".concat(Number(t13) * 100, "%") : t13;
}
function sa(t13) {
  return t13.length === 1 ? "0" + t13 : String(t13);
}
function eE(t13, e, r) {
  return {
    r: Ut(t13, 255) * 255,
    g: Ut(e, 255) * 255,
    b: Ut(r, 255) * 255
  };
}
function Hd(t13, e, r) {
  t13 = Ut(t13, 255), e = Ut(e, 255), r = Ut(r, 255);
  var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = 0, s = (n + a) / 2;
  if (n === a)
    o = 0, i = 0;
  else {
    var l = n - a;
    switch (o = s > 0.5 ? l / (2 - n - a) : l / (n + a), n) {
      case t13:
        i = (e - r) / l + (e < r ? 6 : 0);
        break;
      case e:
        i = (r - t13) / l + 2;
        break;
      case r:
        i = (t13 - e) / l + 4;
        break;
    }
    i /= 6;
  }
  return { h: i, s: o, l: s };
}
function Pl(t13, e, r) {
  return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t13 + (e - t13) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t13 + (e - t13) * (2 / 3 - r) * 6 : t13;
}
function tE(t13, e, r) {
  var n, a, i;
  if (t13 = Ut(t13, 360), e = Ut(e, 100), r = Ut(r, 100), e === 0)
    a = r, i = r, n = r;
  else {
    var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o;
    n = Pl(s, o, t13 + 1 / 3), a = Pl(s, o, t13), i = Pl(s, o, t13 - 1 / 3);
  }
  return { r: n * 255, g: a * 255, b: i * 255 };
}
function Kd(t13, e, r) {
  t13 = Ut(t13, 255), e = Ut(e, 255), r = Ut(r, 255);
  var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = n, s = n - a, l = n === 0 ? 0 : s / n;
  if (n === a)
    i = 0;
  else {
    switch (n) {
      case t13:
        i = (e - r) / s + (e < r ? 6 : 0);
        break;
      case e:
        i = (r - t13) / s + 2;
        break;
      case r:
        i = (t13 - e) / s + 4;
        break;
    }
    i /= 6;
  }
  return { h: i, s: l, v: o };
}
function rE(t13, e, r) {
  t13 = Ut(t13, 360) * 6, e = Ut(e, 100), r = Ut(r, 100);
  var n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), l = n % 6, u = [r, o, i, i, s, r][l], c = [s, r, r, o, i, i][l], d = [i, i, s, r, r, o][l];
  return { r: u * 255, g: c * 255, b: d * 255 };
}
function qd(t13, e, r, n) {
  var a = [
    sa(Math.round(t13).toString(16)),
    sa(Math.round(e).toString(16)),
    sa(Math.round(r).toString(16))
  ];
  return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
}
function nE(t13, e, r, n, a) {
  var i = [
    sa(Math.round(t13).toString(16)),
    sa(Math.round(e).toString(16)),
    sa(Math.round(r).toString(16)),
    sa(aE(n))
  ];
  return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
}
function aE(t13) {
  return Math.round(parseFloat(t13) * 255).toString(16);
}
function Ud(t13) {
  return mr(t13) / 255;
}
function mr(t13) {
  return parseInt(t13, 16);
}
function iE(t13) {
  return {
    r: t13 >> 16,
    g: (t13 & 65280) >> 8,
    b: t13 & 255
  };
}
var ou = {
  aliceblue: "#f0f8ff",
  antiquewhite: "#faebd7",
  aqua: "#00ffff",
  aquamarine: "#7fffd4",
  azure: "#f0ffff",
  beige: "#f5f5dc",
  bisque: "#ffe4c4",
  black: "#000000",
  blanchedalmond: "#ffebcd",
  blue: "#0000ff",
  blueviolet: "#8a2be2",
  brown: "#a52a2a",
  burlywood: "#deb887",
  cadetblue: "#5f9ea0",
  chartreuse: "#7fff00",
  chocolate: "#d2691e",
  coral: "#ff7f50",
  cornflowerblue: "#6495ed",
  cornsilk: "#fff8dc",
  crimson: "#dc143c",
  cyan: "#00ffff",
  darkblue: "#00008b",
  darkcyan: "#008b8b",
  darkgoldenrod: "#b8860b",
  darkgray: "#a9a9a9",
  darkgreen: "#006400",
  darkgrey: "#a9a9a9",
  darkkhaki: "#bdb76b",
  darkmagenta: "#8b008b",
  darkolivegreen: "#556b2f",
  darkorange: "#ff8c00",
  darkorchid: "#9932cc",
  darkred: "#8b0000",
  darksalmon: "#e9967a",
  darkseagreen: "#8fbc8f",
  darkslateblue: "#483d8b",
  darkslategray: "#2f4f4f",
  darkslategrey: "#2f4f4f",
  darkturquoise: "#00ced1",
  darkviolet: "#9400d3",
  deeppink: "#ff1493",
  deepskyblue: "#00bfff",
  dimgray: "#696969",
  dimgrey: "#696969",
  dodgerblue: "#1e90ff",
  firebrick: "#b22222",
  floralwhite: "#fffaf0",
  forestgreen: "#228b22",
  fuchsia: "#ff00ff",
  gainsboro: "#dcdcdc",
  ghostwhite: "#f8f8ff",
  goldenrod: "#daa520",
  gold: "#ffd700",
  gray: "#808080",
  green: "#008000",
  greenyellow: "#adff2f",
  grey: "#808080",
  honeydew: "#f0fff0",
  hotpink: "#ff69b4",
  indianred: "#cd5c5c",
  indigo: "#4b0082",
  ivory: "#fffff0",
  khaki: "#f0e68c",
  lavenderblush: "#fff0f5",
  lavender: "#e6e6fa",
  lawngreen: "#7cfc00",
  lemonchiffon: "#fffacd",
  lightblue: "#add8e6",
  lightcoral: "#f08080",
  lightcyan: "#e0ffff",
  lightgoldenrodyellow: "#fafad2",
  lightgray: "#d3d3d3",
  lightgreen: "#90ee90",
  lightgrey: "#d3d3d3",
  lightpink: "#ffb6c1",
  lightsalmon: "#ffa07a",
  lightseagreen: "#20b2aa",
  lightskyblue: "#87cefa",
  lightslategray: "#778899",
  lightslategrey: "#778899",
  lightsteelblue: "#b0c4de",
  lightyellow: "#ffffe0",
  lime: "#00ff00",
  limegreen: "#32cd32",
  linen: "#faf0e6",
  magenta: "#ff00ff",
  maroon: "#800000",
  mediumaquamarine: "#66cdaa",
  mediumblue: "#0000cd",
  mediumorchid: "#ba55d3",
  mediumpurple: "#9370db",
  mediumseagreen: "#3cb371",
  mediumslateblue: "#7b68ee",
  mediumspringgreen: "#00fa9a",
  mediumturquoise: "#48d1cc",
  mediumvioletred: "#c71585",
  midnightblue: "#191970",
  mintcream: "#f5fffa",
  mistyrose: "#ffe4e1",
  moccasin: "#ffe4b5",
  navajowhite: "#ffdead",
  navy: "#000080",
  oldlace: "#fdf5e6",
  olive: "#808000",
  olivedrab: "#6b8e23",
  orange: "#ffa500",
  orangered: "#ff4500",
  orchid: "#da70d6",
  palegoldenrod: "#eee8aa",
  palegreen: "#98fb98",
  paleturquoise: "#afeeee",
  palevioletred: "#db7093",
  papayawhip: "#ffefd5",
  peachpuff: "#ffdab9",
  peru: "#cd853f",
  pink: "#ffc0cb",
  plum: "#dda0dd",
  powderblue: "#b0e0e6",
  purple: "#800080",
  rebeccapurple: "#663399",
  red: "#ff0000",
  rosybrown: "#bc8f8f",
  royalblue: "#4169e1",
  saddlebrown: "#8b4513",
  salmon: "#fa8072",
  sandybrown: "#f4a460",
  seagreen: "#2e8b57",
  seashell: "#fff5ee",
  sienna: "#a0522d",
  silver: "#c0c0c0",
  skyblue: "#87ceeb",
  slateblue: "#6a5acd",
  slategray: "#708090",
  slategrey: "#708090",
  snow: "#fffafa",
  springgreen: "#00ff7f",
  steelblue: "#4682b4",
  tan: "#d2b48c",
  teal: "#008080",
  thistle: "#d8bfd8",
  tomato: "#ff6347",
  turquoise: "#40e0d0",
  violet: "#ee82ee",
  wheat: "#f5deb3",
  white: "#ffffff",
  whitesmoke: "#f5f5f5",
  yellow: "#ffff00",
  yellowgreen: "#9acd32"
};
function oE(t13) {
  var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = false, s = false;
  return typeof t13 == "string" && (t13 = uE(t13)), typeof t13 == "object" && (sn(t13.r) && sn(t13.g) && sn(t13.b) ? (e = eE(t13.r, t13.g, t13.b), o = true, s = String(t13.r).substr(-1) === "%" ? "prgb" : "rgb") : sn(t13.h) && sn(t13.s) && sn(t13.v) ? (n = Ko(t13.s), a = Ko(t13.v), e = rE(t13.h, n, a), o = true, s = "hsv") : sn(t13.h) && sn(t13.s) && sn(t13.l) && (n = Ko(t13.s), i = Ko(t13.l), e = tE(t13.h, n, i), o = true, s = "hsl"), Object.prototype.hasOwnProperty.call(t13, "a") && (r = t13.a)), r = Th(r), {
    ok: o,
    format: t13.format || s,
    r: Math.min(255, Math.max(e.r, 0)),
    g: Math.min(255, Math.max(e.g, 0)),
    b: Math.min(255, Math.max(e.b, 0)),
    a: r
  };
}
var sE = "[-\\+]?\\d+%?";
var lE = "[-\\+]?\\d*\\.\\d+%?";
var Bn = "(?:".concat(lE, ")|(?:").concat(sE, ")");
var Ol = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?");
var Ll = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?");
var Fr = {
  CSS_UNIT: new RegExp(Bn),
  rgb: new RegExp("rgb" + Ol),
  rgba: new RegExp("rgba" + Ll),
  hsl: new RegExp("hsl" + Ol),
  hsla: new RegExp("hsla" + Ll),
  hsv: new RegExp("hsv" + Ol),
  hsva: new RegExp("hsva" + Ll),
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function uE(t13) {
  if (t13 = t13.trim().toLowerCase(), t13.length === 0)
    return false;
  var e = false;
  if (ou[t13])
    t13 = ou[t13], e = true;
  else if (t13 === "transparent")
    return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  var r = Fr.rgb.exec(t13);
  return r ? { r: r[1], g: r[2], b: r[3] } : (r = Fr.rgba.exec(t13), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Fr.hsl.exec(t13), r ? { h: r[1], s: r[2], l: r[3] } : (r = Fr.hsla.exec(t13), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Fr.hsv.exec(t13), r ? { h: r[1], s: r[2], v: r[3] } : (r = Fr.hsva.exec(t13), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Fr.hex8.exec(t13), r ? {
    r: mr(r[1]),
    g: mr(r[2]),
    b: mr(r[3]),
    a: Ud(r[4]),
    format: e ? "name" : "hex8"
  } : (r = Fr.hex6.exec(t13), r ? {
    r: mr(r[1]),
    g: mr(r[2]),
    b: mr(r[3]),
    format: e ? "name" : "hex"
  } : (r = Fr.hex4.exec(t13), r ? {
    r: mr(r[1] + r[1]),
    g: mr(r[2] + r[2]),
    b: mr(r[3] + r[3]),
    a: Ud(r[4] + r[4]),
    format: e ? "name" : "hex8"
  } : (r = Fr.hex3.exec(t13), r ? {
    r: mr(r[1] + r[1]),
    g: mr(r[2] + r[2]),
    b: mr(r[3] + r[3]),
    format: e ? "name" : "hex"
  } : false)))))))));
}
function sn(t13) {
  return !!Fr.CSS_UNIT.exec(String(t13));
}
var cE = (
  /** @class */
  function() {
    function t13(e, r) {
      e === void 0 && (e = ""), r === void 0 && (r = {});
      var n;
      if (e instanceof t13)
        return e;
      typeof e == "number" && (e = iE(e)), this.originalInput = e;
      var a = oE(e);
      this.originalInput = e, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
    }
    return t13.prototype.isDark = function() {
      return this.getBrightness() < 128;
    }, t13.prototype.isLight = function() {
      return !this.isDark();
    }, t13.prototype.getBrightness = function() {
      var e = this.toRgb();
      return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
    }, t13.prototype.getLuminance = function() {
      var e = this.toRgb(), r, n, a, i = e.r / 255, o = e.g / 255, s = e.b / 255;
      return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a;
    }, t13.prototype.getAlpha = function() {
      return this.a;
    }, t13.prototype.setAlpha = function(e) {
      return this.a = Th(e), this.roundA = Math.round(100 * this.a) / 100, this;
    }, t13.prototype.isMonochrome = function() {
      var e = this.toHsl().s;
      return e === 0;
    }, t13.prototype.toHsv = function() {
      var e = Kd(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
    }, t13.prototype.toHsvString = function() {
      var e = Kd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.v * 100);
      return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")");
    }, t13.prototype.toHsl = function() {
      var e = Hd(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
    }, t13.prototype.toHslString = function() {
      var e = Hd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.l * 100);
      return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")");
    }, t13.prototype.toHex = function(e) {
      return e === void 0 && (e = false), qd(this.r, this.g, this.b, e);
    }, t13.prototype.toHexString = function(e) {
      return e === void 0 && (e = false), "#" + this.toHex(e);
    }, t13.prototype.toHex8 = function(e) {
      return e === void 0 && (e = false), nE(this.r, this.g, this.b, this.a, e);
    }, t13.prototype.toHex8String = function(e) {
      return e === void 0 && (e = false), "#" + this.toHex8(e);
    }, t13.prototype.toHexShortString = function(e) {
      return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
    }, t13.prototype.toRgb = function() {
      return {
        r: Math.round(this.r),
        g: Math.round(this.g),
        b: Math.round(this.b),
        a: this.a
      };
    }, t13.prototype.toRgbString = function() {
      var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b);
      return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")");
    }, t13.prototype.toPercentageRgb = function() {
      var e = function(r) {
        return "".concat(Math.round(Ut(r, 255) * 100), "%");
      };
      return {
        r: e(this.r),
        g: e(this.g),
        b: e(this.b),
        a: this.a
      };
    }, t13.prototype.toPercentageRgbString = function() {
      var e = function(r) {
        return Math.round(Ut(r, 255) * 100);
      };
      return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")");
    }, t13.prototype.toName = function() {
      if (this.a === 0)
        return "transparent";
      if (this.a < 1)
        return false;
      for (var e = "#" + qd(this.r, this.g, this.b, false), r = 0, n = Object.entries(ou); r < n.length; r++) {
        var a = n[r], i = a[0], o = a[1];
        if (e === o)
          return i;
      }
      return false;
    }, t13.prototype.toString = function(e) {
      var r = !!e;
      e = e ?? this.format;
      var n = false, a = this.a < 1 && this.a >= 0, i = !r && a && (e.startsWith("hex") || e === "name");
      return i ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(true)), e === "hex4" && (n = this.toHex8String(true)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
    }, t13.prototype.toNumber = function() {
      return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
    }, t13.prototype.clone = function() {
      return new t13(this.toString());
    }, t13.prototype.lighten = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.l += e / 100, r.l = Ho(r.l), new t13(r);
    }, t13.prototype.brighten = function(e) {
      e === void 0 && (e = 10);
      var r = this.toRgb();
      return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t13(r);
    }, t13.prototype.darken = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.l -= e / 100, r.l = Ho(r.l), new t13(r);
    }, t13.prototype.tint = function(e) {
      return e === void 0 && (e = 10), this.mix("white", e);
    }, t13.prototype.shade = function(e) {
      return e === void 0 && (e = 10), this.mix("black", e);
    }, t13.prototype.desaturate = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.s -= e / 100, r.s = Ho(r.s), new t13(r);
    }, t13.prototype.saturate = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.s += e / 100, r.s = Ho(r.s), new t13(r);
    }, t13.prototype.greyscale = function() {
      return this.desaturate(100);
    }, t13.prototype.spin = function(e) {
      var r = this.toHsl(), n = (r.h + e) % 360;
      return r.h = n < 0 ? 360 + n : n, new t13(r);
    }, t13.prototype.mix = function(e, r) {
      r === void 0 && (r = 50);
      var n = this.toRgb(), a = new t13(e).toRgb(), i = r / 100, o = {
        r: (a.r - n.r) * i + n.r,
        g: (a.g - n.g) * i + n.g,
        b: (a.b - n.b) * i + n.b,
        a: (a.a - n.a) * i + n.a
      };
      return new t13(o);
    }, t13.prototype.analogous = function(e, r) {
      e === void 0 && (e = 6), r === void 0 && (r = 30);
      var n = this.toHsl(), a = 360 / r, i = [this];
      for (n.h = (n.h - (a * e >> 1) + 720) % 360; --e; )
        n.h = (n.h + a) % 360, i.push(new t13(n));
      return i;
    }, t13.prototype.complement = function() {
      var e = this.toHsl();
      return e.h = (e.h + 180) % 360, new t13(e);
    }, t13.prototype.monochromatic = function(e) {
      e === void 0 && (e = 6);
      for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], s = 1 / e; e--; )
        o.push(new t13({ h: n, s: a, v: i })), i = (i + s) % 1;
      return o;
    }, t13.prototype.splitcomplement = function() {
      var e = this.toHsl(), r = e.h;
      return [
        this,
        new t13({ h: (r + 72) % 360, s: e.s, l: e.l }),
        new t13({ h: (r + 216) % 360, s: e.s, l: e.l })
      ];
    }, t13.prototype.onBackground = function(e) {
      var r = this.toRgb(), n = new t13(e).toRgb(), a = r.a + n.a * (1 - r.a);
      return new t13({
        r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a,
        g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a,
        b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a,
        a
      });
    }, t13.prototype.triad = function() {
      return this.polyad(3);
    }, t13.prototype.tetrad = function() {
      return this.polyad(4);
    }, t13.prototype.polyad = function(e) {
      for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / e, o = 1; o < e; o++)
        a.push(new t13({ h: (n + o * i) % 360, s: r.s, l: r.l }));
      return a;
    }, t13.prototype.equals = function(e) {
      return this.toRgbString() === new t13(e).toRgbString();
    }, t13;
  }()
);
function _n(t13, e = 20) {
  return t13.mix("#141414", e).toString();
}
function dE(t13) {
  const e = Co(), r = He("button");
  return computed(() => {
    let n = {}, a = t13.color;
    if (a) {
      const i = a.match(/var\((.*?)\)/);
      i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));
      const o = new cE(a), s = t13.dark ? o.tint(20).toString() : _n(o, 20);
      if (t13.plain)
        n = r.cssVarBlock({
          "bg-color": t13.dark ? _n(o, 90) : o.tint(90).toString(),
          "text-color": a,
          "border-color": t13.dark ? _n(o, 50) : o.tint(50).toString(),
          "hover-text-color": `var(${r.cssVarName("color-white")})`,
          "hover-bg-color": a,
          "hover-border-color": a,
          "active-bg-color": s,
          "active-text-color": `var(${r.cssVarName("color-white")})`,
          "active-border-color": s
        }), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t13.dark ? _n(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? _n(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t13.dark ? _n(o, 80) : o.tint(80).toString());
      else {
        const l = t13.dark ? _n(o, 30) : o.tint(30).toString(), u = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`;
        if (n = r.cssVarBlock({
          "bg-color": a,
          "text-color": u,
          "border-color": a,
          "hover-bg-color": l,
          "hover-text-color": u,
          "hover-border-color": l,
          "active-bg-color": s,
          "active-border-color": s
        }), e.value) {
          const c = t13.dark ? _n(o, 50) : o.tint(50).toString();
          n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c;
        }
      }
    }
    return n;
  });
}
var fE = defineComponent({
  name: "ElButton"
});
var vE = defineComponent({
  ...fE,
  props: iu,
  emits: Xx,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, a = dE(n), i = He("button"), { _ref: o, _size: s, _type: l, _disabled: u, _props: c, shouldAddSpace: d, handleClick: v } = Yx(n, r), h6 = computed(() => [
      i.b(),
      i.m(l.value),
      i.m(s.value),
      i.is("disabled", u.value),
      i.is("loading", n.loading),
      i.is("plain", n.plain),
      i.is("round", n.round),
      i.is("circle", n.circle),
      i.is("text", n.text),
      i.is("link", n.link),
      i.is("has-bg", n.bg)
    ]);
    return e({
      ref: o,
      size: s,
      type: l,
      disabled: u,
      shouldAddSpace: d
    }), (f, p) => (openBlock(), createBlock(resolveDynamicComponent(f.tag), mergeProps({
      ref_key: "_ref",
      ref: o
    }, unref(c), {
      class: unref(h6),
      style: unref(a),
      onClick: unref(v)
    }), {
      default: withCtx(() => [
        f.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
          f.$slots.loading ? renderSlot(f.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Ht), {
            key: 1,
            class: normalizeClass(unref(i).is("loading"))
          }, {
            default: withCtx(() => [
              (openBlock(), createBlock(resolveDynamicComponent(f.loadingIcon)))
            ]),
            _: 1
          }, 8, ["class"]))
        ], 64)) : f.icon || f.$slots.icon ? (openBlock(), createBlock(unref(Ht), { key: 1 }, {
          default: withCtx(() => [
            f.icon ? (openBlock(), createBlock(resolveDynamicComponent(f.icon), { key: 0 })) : renderSlot(f.$slots, "icon", { key: 1 })
          ]),
          _: 3
        })) : createCommentVNode("v-if", true),
        f.$slots.default ? (openBlock(), createElementBlock("span", {
          key: 2,
          class: normalizeClass({ [unref(i).em("text", "expand")]: unref(d) })
        }, [
          renderSlot(f.$slots, "default")
        ], 2)) : createCommentVNode("v-if", true)
      ]),
      _: 3
    }, 16, ["class", "style", "onClick"]));
  }
});
var hE = Ve(vE, [["__file", "button.vue"]]);
var pE = {
  size: iu.size,
  type: iu.type
};
var gE = defineComponent({
  name: "ElButtonGroup"
});
var mE = defineComponent({
  ...gE,
  props: pE,
  setup(t13) {
    const e = t13;
    provide(Sh, reactive({
      size: toRef(e, "size"),
      type: toRef(e, "type")
    }));
    const r = He("button");
    return (n, a) => (openBlock(), createElementBlock("div", {
      class: normalizeClass(unref(r).b("group"))
    }, [
      renderSlot(n.$slots, "default")
    ], 2));
  }
});
var _h = Ve(mE, [["__file", "button-group.vue"]]);
var Hr = $t(hE, {
  ButtonGroup: _h
});
Cn(_h);
var Ln = /* @__PURE__ */ new Map();
if (_t) {
  let t13;
  document.addEventListener("mousedown", (e) => t13 = e), document.addEventListener("mouseup", (e) => {
    if (t13) {
      for (const r of Ln.values())
        for (const { documentHandler: n } of r)
          n(e, t13);
      t13 = void 0;
    }
  });
}
function Gd(t13, e) {
  let r = [];
  return Array.isArray(e.arg) ? r = e.arg : ua(e.arg) && r.push(e.arg), function(n, a) {
    const i = e.instance.popperRef, o = n.target, s = a == null ? void 0 : a.target, l = !e || !e.instance, u = !o || !s, c = t13.contains(o) || t13.contains(s), d = t13 === o, v = r.length && r.some((f) => f == null ? void 0 : f.contains(o)) || r.length && r.includes(s), h6 = i && (i.contains(o) || i.contains(s));
    l || u || c || d || v || h6 || e.value(n, a);
  };
}
var Dh = {
  beforeMount(t13, e) {
    Ln.has(t13) || Ln.set(t13, []), Ln.get(t13).push({
      documentHandler: Gd(t13, e),
      bindingFn: e.value
    });
  },
  updated(t13, e) {
    Ln.has(t13) || Ln.set(t13, []);
    const r = Ln.get(t13), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = {
      documentHandler: Gd(t13, e),
      bindingFn: e.value
    };
    n >= 0 ? r.splice(n, 1, a) : r.push(a);
  },
  unmounted(t13) {
    Ln.delete(t13);
  }
};
var yE = rt({
  header: {
    type: String,
    default: ""
  },
  footer: {
    type: String,
    default: ""
  },
  bodyStyle: {
    type: $e([String, Object, Array]),
    default: ""
  },
  bodyClass: String,
  shadow: {
    type: String,
    values: ["always", "hover", "never"],
    default: "always"
  }
});
var bE = defineComponent({
  name: "ElCard"
});
var wE = defineComponent({
  ...bE,
  props: yE,
  setup(t13) {
    const e = He("card");
    return (r, n) => (openBlock(), createElementBlock("div", {
      class: normalizeClass([unref(e).b(), unref(e).is(`${r.shadow}-shadow`)])
    }, [
      r.$slots.header || r.header ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: normalizeClass(unref(e).e("header"))
      }, [
        renderSlot(r.$slots, "header", {}, () => [
          createTextVNode(toDisplayString(r.header), 1)
        ])
      ], 2)) : createCommentVNode("v-if", true),
      createBaseVNode("div", {
        class: normalizeClass([unref(e).e("body"), r.bodyClass]),
        style: normalizeStyle(r.bodyStyle)
      }, [
        renderSlot(r.$slots, "default")
      ], 6),
      r.$slots.footer || r.footer ? (openBlock(), createElementBlock("div", {
        key: 1,
        class: normalizeClass(unref(e).e("footer"))
      }, [
        renderSlot(r.$slots, "footer", {}, () => [
          createTextVNode(toDisplayString(r.footer), 1)
        ])
      ], 2)) : createCommentVNode("v-if", true)
    ], 2));
  }
});
var CE = Ve(wE, [["__file", "card.vue"]]);
var xE = $t(CE);
var Ph = {
  modelValue: {
    type: [Number, String, Boolean],
    default: void 0
  },
  label: {
    type: [String, Boolean, Number, Object],
    default: void 0
  },
  value: {
    type: [String, Boolean, Number, Object],
    default: void 0
  },
  indeterminate: Boolean,
  disabled: Boolean,
  checked: Boolean,
  name: {
    type: String,
    default: void 0
  },
  trueValue: {
    type: [String, Number],
    default: void 0
  },
  falseValue: {
    type: [String, Number],
    default: void 0
  },
  trueLabel: {
    type: [String, Number],
    default: void 0
  },
  falseLabel: {
    type: [String, Number],
    default: void 0
  },
  id: {
    type: String,
    default: void 0
  },
  border: Boolean,
  size: hi,
  tabindex: [String, Number],
  validateEvent: {
    type: Boolean,
    default: true
  },
  ...jn(["ariaControls"])
};
var Oh = {
  [Vt]: (t13) => tr(t13) || qt(t13) || Ja(t13),
  change: (t13) => tr(t13) || qt(t13) || Ja(t13)
};
var pi = Symbol("checkboxGroupContextKey");
var EE = ({
  model: t13,
  isChecked: e
}) => {
  const r = inject(pi, void 0), n = computed(() => {
    var i, o;
    const s = (i = r == null ? void 0 : r.max) == null ? void 0 : i.value, l = (o = r == null ? void 0 : r.min) == null ? void 0 : o.value;
    return !Mn(s) && t13.value.length >= s && !e.value || !Mn(l) && t13.value.length <= l && e.value;
  });
  return {
    isDisabled: Co(computed(() => (r == null ? void 0 : r.disabled.value) || n.value)),
    isLimitDisabled: n
  };
};
var kE = (t13, {
  model: e,
  isLimitExceeded: r,
  hasOwnLabel: n,
  isDisabled: a,
  isLabeledByFormItem: i
}) => {
  const o = inject(pi, void 0), { formItem: s } = Ta(), { emit: l } = getCurrentInstance();
  function u(f) {
    var p, m, g, y;
    return [true, t13.trueValue, t13.trueLabel].includes(f) ? (m = (p = t13.trueValue) != null ? p : t13.trueLabel) != null ? m : true : (y = (g = t13.falseValue) != null ? g : t13.falseLabel) != null ? y : false;
  }
  function c(f, p) {
    l("change", u(f), p);
  }
  function d(f) {
    if (r.value)
      return;
    const p = f.target;
    l("change", u(p.checked), f);
  }
  async function v(f) {
    r.value || !n.value && !a.value && i.value && (f.composedPath().some((g) => g.tagName === "LABEL") || (e.value = u([false, t13.falseValue, t13.falseLabel].includes(e.value)), await nextTick(), c(e.value, f)));
  }
  const h6 = computed(() => (o == null ? void 0 : o.validateEvent) || t13.validateEvent);
  return watch(() => t13.modelValue, () => {
    h6.value && (s == null || s.validate("change").catch((f) => Dt(f)));
  }), {
    handleChange: d,
    onClickRoot: v
  };
};
var SE = (t13) => {
  const e = ref(false), { emit: r } = getCurrentInstance(), n = inject(pi, void 0), a = computed(() => Mn(n) === false), i = ref(false), o = computed({
    get() {
      var s, l;
      return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (l = t13.modelValue) != null ? l : e.value;
    },
    set(s) {
      var l, u;
      a.value && fr(s) ? (i.value = ((l = n == null ? void 0 : n.max) == null ? void 0 : l.value) !== void 0 && s.length > (n == null ? void 0 : n.max.value) && s.length > o.value.length, i.value === false && ((u = n == null ? void 0 : n.changeEvent) == null || u.call(n, s))) : (r(Vt, s), e.value = s);
    }
  });
  return {
    model: o,
    isGroup: a,
    isLimitExceeded: i
  };
};
var TE = (t13, e, { model: r }) => {
  const n = inject(pi, void 0), a = ref(false), i = computed(() => Ss(t13.value) ? t13.label : t13.value), o = computed(() => {
    const c = r.value;
    return Ja(c) ? c : fr(c) ? Kt(i.value) ? c.map(toRaw).some((d) => ks(d, i.value)) : c.map(toRaw).includes(i.value) : c != null ? c === t13.trueValue || c === t13.trueLabel : !!c;
  }), s = pa(computed(() => {
    var c;
    return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value;
  }), {
    prop: true
  }), l = pa(computed(() => {
    var c;
    return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value;
  })), u = computed(() => !!e.default || !Ss(i.value));
  return {
    checkboxButtonSize: s,
    isChecked: o,
    isFocused: a,
    checkboxSize: l,
    hasOwnLabel: u,
    actualValue: i
  };
};
var Lh = (t13, e) => {
  const { formItem: r } = Ta(), { model: n, isGroup: a, isLimitExceeded: i } = SE(t13), {
    isFocused: o,
    isChecked: s,
    checkboxButtonSize: l,
    checkboxSize: u,
    hasOwnLabel: c,
    actualValue: d
  } = TE(t13, e, { model: n }), { isDisabled: v } = EE({ model: n, isChecked: s }), { inputId: h6, isLabeledByFormItem: f } = xo(t13, {
    formItemContext: r,
    disableIdGeneration: c,
    disableIdManagement: a
  }), { handleChange: p, onClickRoot: m } = kE(t13, {
    model: n,
    isLimitExceeded: i,
    hasOwnLabel: c,
    isDisabled: v,
    isLabeledByFormItem: f
  });
  return (() => {
    function y() {
      var b, w;
      fr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t13.trueValue) != null ? b : t13.trueLabel) != null ? w : true;
    }
    t13.checked && y();
  })(), as({
    from: "label act as value",
    replacement: "value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, computed(() => a.value && Ss(t13.value))), as({
    from: "true-label",
    replacement: "true-value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, computed(() => !!t13.trueLabel)), as({
    from: "false-label",
    replacement: "false-value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, computed(() => !!t13.falseLabel)), {
    inputId: h6,
    isLabeledByFormItem: f,
    isChecked: s,
    isDisabled: v,
    isFocused: o,
    checkboxButtonSize: l,
    checkboxSize: u,
    hasOwnLabel: c,
    model: n,
    actualValue: d,
    handleChange: p,
    onClickRoot: m
  };
};
var _E = defineComponent({
  name: "ElCheckbox"
});
var DE = defineComponent({
  ..._E,
  props: Ph,
  emits: Oh,
  setup(t13) {
    const e = t13, r = useSlots(), {
      inputId: n,
      isLabeledByFormItem: a,
      isChecked: i,
      isDisabled: o,
      isFocused: s,
      checkboxSize: l,
      hasOwnLabel: u,
      model: c,
      actualValue: d,
      handleChange: v,
      onClickRoot: h6
    } = Lh(e, r), f = He("checkbox"), p = computed(() => [
      f.b(),
      f.m(l.value),
      f.is("disabled", o.value),
      f.is("bordered", e.border),
      f.is("checked", i.value)
    ]), m = computed(() => [
      f.e("input"),
      f.is("disabled", o.value),
      f.is("checked", i.value),
      f.is("indeterminate", e.indeterminate),
      f.is("focus", s.value)
    ]);
    return (g, y) => (openBlock(), createBlock(resolveDynamicComponent(!unref(u) && unref(a) ? "span" : "label"), {
      class: normalizeClass(unref(p)),
      "aria-controls": g.indeterminate ? g.ariaControls : null,
      onClick: unref(h6)
    }, {
      default: withCtx(() => {
        var b, w, C, E;
        return [
          createBaseVNode("span", {
            class: normalizeClass(unref(m))
          }, [
            g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
              key: 0,
              id: unref(n),
              "onUpdate:modelValue": (x) => isRef(c) ? c.value = x : null,
              class: normalizeClass(unref(f).e("original")),
              type: "checkbox",
              indeterminate: g.indeterminate,
              name: g.name,
              tabindex: g.tabindex,
              disabled: unref(o),
              "true-value": (w = (b = g.trueValue) != null ? b : g.trueLabel) != null ? w : true,
              "false-value": (E = (C = g.falseValue) != null ? C : g.falseLabel) != null ? E : false,
              onChange: unref(v),
              onFocus: (x) => s.value = true,
              onBlur: (x) => s.value = false,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
              [vModelCheckbox, unref(c)]
            ]) : withDirectives((openBlock(), createElementBlock("input", {
              key: 1,
              id: unref(n),
              "onUpdate:modelValue": (x) => isRef(c) ? c.value = x : null,
              class: normalizeClass(unref(f).e("original")),
              type: "checkbox",
              indeterminate: g.indeterminate,
              disabled: unref(o),
              value: unref(d),
              name: g.name,
              tabindex: g.tabindex,
              onChange: unref(v),
              onFocus: (x) => s.value = true,
              onBlur: (x) => s.value = false,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
              [vModelCheckbox, unref(c)]
            ]),
            createBaseVNode("span", {
              class: normalizeClass(unref(f).e("inner"))
            }, null, 2)
          ], 2),
          unref(u) ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: normalizeClass(unref(f).e("label"))
          }, [
            renderSlot(g.$slots, "default"),
            g.$slots.default ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [
              createTextVNode(toDisplayString(g.label), 1)
            ], 64))
          ], 2)) : createCommentVNode("v-if", true)
        ];
      }),
      _: 3
    }, 8, ["class", "aria-controls", "onClick"]));
  }
});
var PE = Ve(DE, [["__file", "checkbox.vue"]]);
var OE = defineComponent({
  name: "ElCheckboxButton"
});
var LE = defineComponent({
  ...OE,
  props: Ph,
  emits: Oh,
  setup(t13) {
    const e = t13, r = useSlots(), {
      isFocused: n,
      isChecked: a,
      isDisabled: i,
      checkboxButtonSize: o,
      model: s,
      actualValue: l,
      handleChange: u
    } = Lh(e, r), c = inject(pi, void 0), d = He("checkbox"), v = computed(() => {
      var f, p, m, g;
      const y = (p = (f = c == null ? void 0 : c.fill) == null ? void 0 : f.value) != null ? p : "";
      return {
        backgroundColor: y,
        borderColor: y,
        color: (g = (m = c == null ? void 0 : c.textColor) == null ? void 0 : m.value) != null ? g : "",
        boxShadow: y ? `-1px 0 0 0 ${y}` : void 0
      };
    }), h6 = computed(() => [
      d.b("button"),
      d.bm("button", o.value),
      d.is("disabled", i.value),
      d.is("checked", a.value),
      d.is("focus", n.value)
    ]);
    return (f, p) => {
      var m, g, y, b;
      return openBlock(), createElementBlock("label", {
        class: normalizeClass(unref(h6))
      }, [
        f.trueValue || f.falseValue || f.trueLabel || f.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
          key: 0,
          "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null,
          class: normalizeClass(unref(d).be("button", "original")),
          type: "checkbox",
          name: f.name,
          tabindex: f.tabindex,
          disabled: unref(i),
          "true-value": (g = (m = f.trueValue) != null ? m : f.trueLabel) != null ? g : true,
          "false-value": (b = (y = f.falseValue) != null ? y : f.falseLabel) != null ? b : false,
          onChange: unref(u),
          onFocus: (w) => n.value = true,
          onBlur: (w) => n.value = false,
          onClick: withModifiers(() => {
          }, ["stop"])
        }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
          [vModelCheckbox, unref(s)]
        ]) : withDirectives((openBlock(), createElementBlock("input", {
          key: 1,
          "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null,
          class: normalizeClass(unref(d).be("button", "original")),
          type: "checkbox",
          name: f.name,
          tabindex: f.tabindex,
          disabled: unref(i),
          value: unref(l),
          onChange: unref(u),
          onFocus: (w) => n.value = true,
          onBlur: (w) => n.value = false,
          onClick: withModifiers(() => {
          }, ["stop"])
        }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
          [vModelCheckbox, unref(s)]
        ]),
        f.$slots.default || f.label ? (openBlock(), createElementBlock("span", {
          key: 2,
          class: normalizeClass(unref(d).be("button", "inner")),
          style: normalizeStyle(unref(a) ? unref(v) : void 0)
        }, [
          renderSlot(f.$slots, "default", {}, () => [
            createTextVNode(toDisplayString(f.label), 1)
          ])
        ], 6)) : createCommentVNode("v-if", true)
      ], 2);
    };
  }
});
var Ih = Ve(LE, [["__file", "checkbox-button.vue"]]);
var IE = rt({
  modelValue: {
    type: $e(Array),
    default: () => []
  },
  disabled: Boolean,
  min: Number,
  max: Number,
  size: hi,
  fill: String,
  textColor: String,
  tag: {
    type: String,
    default: "div"
  },
  validateEvent: {
    type: Boolean,
    default: true
  },
  ...jn(["ariaLabel"])
});
var AE = {
  [Vt]: (t13) => fr(t13),
  change: (t13) => fr(t13)
};
var FE = defineComponent({
  name: "ElCheckboxGroup"
});
var ME = defineComponent({
  ...FE,
  props: IE,
  emits: AE,
  setup(t13, { emit: e }) {
    const r = t13, n = He("checkbox"), { formItem: a } = Ta(), { inputId: i, isLabeledByFormItem: o } = xo(r, {
      formItemContext: a
    }), s = async (u) => {
      e(Vt, u), await nextTick(), e("change", u);
    }, l = computed({
      get() {
        return r.modelValue;
      },
      set(u) {
        s(u);
      }
    });
    return provide(pi, {
      ...Vv(toRefs(r), [
        "size",
        "min",
        "max",
        "disabled",
        "validateEvent",
        "fill",
        "textColor"
      ]),
      modelValue: l,
      changeEvent: s
    }), watch(() => r.modelValue, () => {
      r.validateEvent && (a == null || a.validate("change").catch((u) => Dt(u)));
    }), (u, c) => {
      var d;
      return openBlock(), createBlock(resolveDynamicComponent(u.tag), {
        id: unref(i),
        class: normalizeClass(unref(n).b("group")),
        role: "group",
        "aria-label": unref(o) ? void 0 : u.ariaLabel || "checkbox-group",
        "aria-labelledby": unref(o) ? (d = unref(a)) == null ? void 0 : d.labelId : void 0
      }, {
        default: withCtx(() => [
          renderSlot(u.$slots, "default")
        ]),
        _: 3
      }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
    };
  }
});
var Ah = Ve(ME, [["__file", "checkbox-group.vue"]]);
var BE = $t(PE, {
  CheckboxButton: Ih,
  CheckboxGroup: Ah
});
Cn(Ih);
Cn(Ah);
var su = rt({
  type: {
    type: String,
    values: ["primary", "success", "info", "warning", "danger"],
    default: "primary"
  },
  closable: Boolean,
  disableTransitions: Boolean,
  hit: Boolean,
  color: String,
  size: {
    type: String,
    values: Wv
  },
  effect: {
    type: String,
    values: ["dark", "light", "plain"],
    default: "light"
  },
  round: Boolean
});
var NE = {
  close: (t13) => t13 instanceof MouseEvent,
  click: (t13) => t13 instanceof MouseEvent
};
var RE = defineComponent({
  name: "ElTag"
});
var $E = defineComponent({
  ...RE,
  props: su,
  emits: NE,
  setup(t13, { emit: e }) {
    const r = t13, n = pa(), a = He("tag"), i = computed(() => {
      const { type: u, hit: c, effect: d, closable: v, round: h6 } = r;
      return [
        a.b(),
        a.is("closable", v),
        a.m(u || "primary"),
        a.m(n.value),
        a.m(d),
        a.is("hit", c),
        a.is("round", h6)
      ];
    }), o = (u) => {
      e("close", u);
    }, s = (u) => {
      e("click", u);
    }, l = (u) => {
      u.component.subTree.component.bum = null;
    };
    return (u, c) => u.disableTransitions ? (openBlock(), createElementBlock("span", {
      key: 0,
      class: normalizeClass(unref(i)),
      style: normalizeStyle({ backgroundColor: u.color }),
      onClick: s
    }, [
      createBaseVNode("span", {
        class: normalizeClass(unref(a).e("content"))
      }, [
        renderSlot(u.$slots, "default")
      ], 2),
      u.closable ? (openBlock(), createBlock(unref(Ht), {
        key: 0,
        class: normalizeClass(unref(a).e("close")),
        onClick: withModifiers(o, ["stop"])
      }, {
        default: withCtx(() => [
          createVNode(unref(Ts))
        ]),
        _: 1
      }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
    ], 6)) : (openBlock(), createBlock(Transition, {
      key: 1,
      name: `${unref(a).namespace.value}-zoom-in-center`,
      appear: "",
      onVnodeMounted: l
    }, {
      default: withCtx(() => [
        createBaseVNode("span", {
          class: normalizeClass(unref(i)),
          style: normalizeStyle({ backgroundColor: u.color }),
          onClick: s
        }, [
          createBaseVNode("span", {
            class: normalizeClass(unref(a).e("content"))
          }, [
            renderSlot(u.$slots, "default")
          ], 2),
          u.closable ? (openBlock(), createBlock(unref(Ht), {
            key: 0,
            class: normalizeClass(unref(a).e("close")),
            onClick: withModifiers(o, ["stop"])
          }, {
            default: withCtx(() => [
              createVNode(unref(Ts))
            ]),
            _: 1
          }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
        ], 6)
      ]),
      _: 3
    }, 8, ["name"]));
  }
});
var zE = Ve($E, [["__file", "tag.vue"]]);
var VE = $t(zE);
var Fh = Symbol("rowContextKey");
var HE = [
  "start",
  "center",
  "end",
  "space-around",
  "space-between",
  "space-evenly"
];
var KE = ["top", "middle", "bottom"];
var qE = rt({
  tag: {
    type: String,
    default: "div"
  },
  gutter: {
    type: Number,
    default: 0
  },
  justify: {
    type: String,
    values: HE,
    default: "start"
  },
  align: {
    type: String,
    values: KE
  }
});
var UE = defineComponent({
  name: "ElRow"
});
var GE = defineComponent({
  ...UE,
  props: qE,
  setup(t13) {
    const e = t13, r = He("row"), n = computed(() => e.gutter);
    provide(Fh, {
      gutter: n
    });
    const a = computed(() => {
      const o = {};
      return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o;
    }), i = computed(() => [
      r.b(),
      r.is(`justify-${e.justify}`, e.justify !== "start"),
      r.is(`align-${e.align}`, !!e.align)
    ]);
    return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), {
      class: normalizeClass(unref(i)),
      style: normalizeStyle(unref(a))
    }, {
      default: withCtx(() => [
        renderSlot(o.$slots, "default")
      ]),
      _: 3
    }, 8, ["class", "style"]));
  }
});
var WE = Ve(GE, [["__file", "row.vue"]]);
var Js = $t(WE);
var YE = rt({
  tag: {
    type: String,
    default: "div"
  },
  span: {
    type: Number,
    default: 24
  },
  offset: {
    type: Number,
    default: 0
  },
  pull: {
    type: Number,
    default: 0
  },
  push: {
    type: Number,
    default: 0
  },
  xs: {
    type: $e([Number, Object]),
    default: () => za({})
  },
  sm: {
    type: $e([Number, Object]),
    default: () => za({})
  },
  md: {
    type: $e([Number, Object]),
    default: () => za({})
  },
  lg: {
    type: $e([Number, Object]),
    default: () => za({})
  },
  xl: {
    type: $e([Number, Object]),
    default: () => za({})
  }
});
var jE = defineComponent({
  name: "ElCol"
});
var ZE = defineComponent({
  ...jE,
  props: YE,
  setup(t13) {
    const e = t13, { gutter: r } = inject(Fh, { gutter: computed(() => 0) }), n = He("col"), a = computed(() => {
      const o = {};
      return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o;
    }), i = computed(() => {
      const o = [];
      return ["span", "offset", "pull", "push"].forEach((u) => {
        const c = e[u];
        qt(c) && (u === "span" ? o.push(n.b(`${e[u]}`)) : c > 0 && o.push(n.b(`${u}-${e[u]}`)));
      }), ["xs", "sm", "md", "lg", "xl"].forEach((u) => {
        qt(e[u]) ? o.push(n.b(`${u}-${e[u]}`)) : Kt(e[u]) && Object.entries(e[u]).forEach(([c, d]) => {
          o.push(c !== "span" ? n.b(`${u}-${c}-${d}`) : n.b(`${u}-${d}`));
        });
      }), r.value && o.push(n.is("guttered")), [n.b(), o];
    });
    return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), {
      class: normalizeClass(unref(i)),
      style: normalizeStyle(unref(a))
    }, {
      default: withCtx(() => [
        renderSlot(o.$slots, "default")
      ]),
      _: 3
    }, 8, ["class", "style"]));
  }
});
var XE = Ve(ZE, [["__file", "col.vue"]]);
var So = $t(XE);
var QE = defineComponent({
  name: "ElCollapseTransition"
});
var JE = defineComponent({
  ...QE,
  setup(t13) {
    const e = He("collapse-transition"), r = (a) => {
      a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom;
    }, n = {
      beforeEnter(a) {
        a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0;
      },
      enter(a) {
        requestAnimationFrame(() => {
          a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden";
        });
      },
      afterEnter(a) {
        a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow;
      },
      enterCancelled(a) {
        r(a);
      },
      beforeLeave(a) {
        a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden";
      },
      leave(a) {
        a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0);
      },
      afterLeave(a) {
        r(a);
      },
      leaveCancelled(a) {
        r(a);
      }
    };
    return (a, i) => (openBlock(), createBlock(Transition, mergeProps({
      name: unref(e).b()
    }, toHandlers(n)), {
      default: withCtx(() => [
        renderSlot(a.$slots, "default")
      ]),
      _: 3
    }, 16, ["name"]));
  }
});
var ek = Ve(JE, [["__file", "collapse-transition.vue"]]);
var tk = $t(ek);
var rk = rt({
  color: {
    type: $e(Object),
    required: true
  },
  vertical: {
    type: Boolean,
    default: false
  }
});
var Il = false;
function ro(t13, e) {
  if (!_t)
    return;
  const r = function(i) {
    var o;
    (o = e.drag) == null || o.call(e, i);
  }, n = function(i) {
    var o;
    document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", n), document.onselectstart = null, document.ondragstart = null, Il = false, (o = e.end) == null || o.call(e, i);
  }, a = function(i) {
    var o;
    Il || (i.preventDefault(), document.onselectstart = () => false, document.ondragstart = () => false, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Il = true, (o = e.start) == null || o.call(e, i));
  };
  t13.addEventListener("mousedown", a), t13.addEventListener("touchstart", a, { passive: false });
}
var nk = (t13) => {
  const e = getCurrentInstance(), { t: r } = yo(), n = shallowRef(), a = shallowRef(), i = computed(() => t13.color.get("alpha")), o = computed(() => r("el.colorpicker.alphaLabel"));
  function s(d) {
    var v;
    d.target !== n.value && l(d), (v = n.value) == null || v.focus();
  }
  function l(d) {
    if (!a.value || !n.value)
      return;
    const h6 = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = Pu(d);
    if (t13.vertical) {
      let m = p - h6.top;
      m = Math.max(n.value.offsetHeight / 2, m), m = Math.min(m, h6.height - n.value.offsetHeight / 2), t13.color.set("alpha", Math.round((m - n.value.offsetHeight / 2) / (h6.height - n.value.offsetHeight) * 100));
    } else {
      let m = f - h6.left;
      m = Math.max(n.value.offsetWidth / 2, m), m = Math.min(m, h6.width - n.value.offsetWidth / 2), t13.color.set("alpha", Math.round((m - n.value.offsetWidth / 2) / (h6.width - n.value.offsetWidth) * 100));
    }
  }
  function u(d) {
    const { code: v, shiftKey: h6 } = d, f = h6 ? 10 : 1;
    switch (v) {
      case Lt.left:
      case Lt.down:
        d.preventDefault(), d.stopPropagation(), c(-f);
        break;
      case Lt.right:
      case Lt.up:
        d.preventDefault(), d.stopPropagation(), c(f);
        break;
    }
  }
  function c(d) {
    let v = i.value + d;
    v = v < 0 ? 0 : v > 100 ? 100 : v, t13.color.set("alpha", v);
  }
  return {
    thumb: n,
    bar: a,
    alpha: i,
    alphaLabel: o,
    handleDrag: l,
    handleClick: s,
    handleKeydown: u
  };
};
var ak = (t13, {
  bar: e,
  thumb: r,
  handleDrag: n
}) => {
  const a = getCurrentInstance(), i = He("color-alpha-slider"), o = ref(0), s = ref(0), l = ref();
  function u() {
    if (!r.value || t13.vertical)
      return 0;
    const y = a.vnode.el, b = t13.color.get("alpha");
    return y ? Math.round(b * (y.offsetWidth - r.value.offsetWidth / 2) / 100) : 0;
  }
  function c() {
    if (!r.value)
      return 0;
    const y = a.vnode.el;
    if (!t13.vertical)
      return 0;
    const b = t13.color.get("alpha");
    return y ? Math.round(b * (y.offsetHeight - r.value.offsetHeight / 2) / 100) : 0;
  }
  function d() {
    if (t13.color && t13.color.value) {
      const { r: y, g: b, b: w } = t13.color.toRgb();
      return `linear-gradient(to right, rgba(${y}, ${b}, ${w}, 0) 0%, rgba(${y}, ${b}, ${w}, 1) 100%)`;
    }
    return "";
  }
  function v() {
    o.value = u(), s.value = c(), l.value = d();
  }
  onMounted(() => {
    if (!e.value || !r.value)
      return;
    const y = {
      drag: (b) => {
        n(b);
      },
      end: (b) => {
        n(b);
      }
    };
    ro(e.value, y), ro(r.value, y), v();
  }), watch(() => t13.color.get("alpha"), () => v()), watch(() => t13.color.value, () => v());
  const h6 = computed(() => [i.b(), i.is("vertical", t13.vertical)]), f = computed(() => i.e("bar")), p = computed(() => i.e("thumb")), m = computed(() => ({ background: l.value })), g = computed(() => ({
    left: ei(o.value),
    top: ei(s.value)
  }));
  return { rootKls: h6, barKls: f, barStyle: m, thumbKls: p, thumbStyle: g, update: v };
};
var ik = "ElColorAlphaSlider";
var ok = defineComponent({
  name: ik
});
var sk = defineComponent({
  ...ok,
  props: rk,
  setup(t13, { expose: e }) {
    const r = t13, {
      alpha: n,
      alphaLabel: a,
      bar: i,
      thumb: o,
      handleDrag: s,
      handleClick: l,
      handleKeydown: u
    } = nk(r), { rootKls: c, barKls: d, barStyle: v, thumbKls: h6, thumbStyle: f, update: p } = ak(r, {
      bar: i,
      thumb: o,
      handleDrag: s
    });
    return e({
      update: p,
      bar: i,
      thumb: o
    }), (m, g) => (openBlock(), createElementBlock("div", {
      class: normalizeClass(unref(c))
    }, [
      createBaseVNode("div", {
        ref_key: "bar",
        ref: i,
        class: normalizeClass(unref(d)),
        style: normalizeStyle(unref(v)),
        onClick: unref(l)
      }, null, 14, ["onClick"]),
      createBaseVNode("div", {
        ref_key: "thumb",
        ref: o,
        class: normalizeClass(unref(h6)),
        style: normalizeStyle(unref(f)),
        "aria-label": unref(a),
        "aria-valuenow": unref(n),
        "aria-orientation": m.vertical ? "vertical" : "horizontal",
        "aria-valuemin": "0",
        "aria-valuemax": "100",
        role: "slider",
        tabindex: "0",
        onKeydown: unref(u)
      }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"])
    ], 2));
  }
});
var lk = Ve(sk, [["__file", "alpha-slider.vue"]]);
var uk = defineComponent({
  name: "ElColorHueSlider",
  props: {
    color: {
      type: Object,
      required: true
    },
    vertical: Boolean
  },
  setup(t13) {
    const e = He("color-hue-slider"), r = getCurrentInstance(), n = ref(), a = ref(), i = ref(0), o = ref(0), s = computed(() => t13.color.get("hue"));
    watch(() => s.value, () => {
      v();
    });
    function l(h6) {
      h6.target !== n.value && u(h6);
    }
    function u(h6) {
      if (!a.value || !n.value)
        return;
      const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: g } = Pu(h6);
      let y;
      if (t13.vertical) {
        let b = g - p.top;
        b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), y = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360);
      } else {
        let b = m - p.left;
        b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), y = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360);
      }
      t13.color.set("hue", y);
    }
    function c() {
      if (!n.value)
        return 0;
      const h6 = r.vnode.el;
      if (t13.vertical)
        return 0;
      const f = t13.color.get("hue");
      return h6 ? Math.round(f * (h6.offsetWidth - n.value.offsetWidth / 2) / 360) : 0;
    }
    function d() {
      if (!n.value)
        return 0;
      const h6 = r.vnode.el;
      if (!t13.vertical)
        return 0;
      const f = t13.color.get("hue");
      return h6 ? Math.round(f * (h6.offsetHeight - n.value.offsetHeight / 2) / 360) : 0;
    }
    function v() {
      i.value = c(), o.value = d();
    }
    return onMounted(() => {
      if (!a.value || !n.value)
        return;
      const h6 = {
        drag: (f) => {
          u(f);
        },
        end: (f) => {
          u(f);
        }
      };
      ro(a.value, h6), ro(n.value, h6), v();
    }), {
      bar: a,
      thumb: n,
      thumbLeft: i,
      thumbTop: o,
      hueValue: s,
      handleClick: l,
      update: v,
      ns: e
    };
  }
});
function ck(t13, e, r, n, a, i) {
  return openBlock(), createElementBlock("div", {
    class: normalizeClass([t13.ns.b(), t13.ns.is("vertical", t13.vertical)])
  }, [
    createBaseVNode("div", {
      ref: "bar",
      class: normalizeClass(t13.ns.e("bar")),
      onClick: t13.handleClick
    }, null, 10, ["onClick"]),
    createBaseVNode("div", {
      ref: "thumb",
      class: normalizeClass(t13.ns.e("thumb")),
      style: normalizeStyle({
        left: t13.thumbLeft + "px",
        top: t13.thumbTop + "px"
      })
    }, null, 6)
  ], 2);
}
var dk = Ve(uk, [["render", ck], ["__file", "hue-slider.vue"]]);
var fk = rt({
  modelValue: String,
  id: String,
  showAlpha: Boolean,
  colorFormat: String,
  disabled: Boolean,
  size: hi,
  popperClass: {
    type: String,
    default: ""
  },
  tabindex: {
    type: [String, Number],
    default: 0
  },
  teleported: cr.teleported,
  predefine: {
    type: $e(Array)
  },
  validateEvent: {
    type: Boolean,
    default: true
  },
  ...jn(["ariaLabel"])
});
var vk = {
  [Vt]: (t13) => tr(t13) || Rn(t13),
  [$u]: (t13) => tr(t13) || Rn(t13),
  activeChange: (t13) => tr(t13) || Rn(t13),
  focus: (t13) => t13 instanceof FocusEvent,
  blur: (t13) => t13 instanceof FocusEvent
};
var Mh = Symbol("colorPickerContextKey");
var Wd = function(t13, e, r) {
  return [
    t13,
    e * r / ((t13 = (2 - e) * r) < 1 ? t13 : 2 - t13) || 0,
    t13 / 2
  ];
};
var hk = function(t13) {
  return typeof t13 == "string" && t13.includes(".") && Number.parseFloat(t13) === 1;
};
var pk = function(t13) {
  return typeof t13 == "string" && t13.includes("%");
};
var Ua = function(t13, e) {
  hk(t13) && (t13 = "100%");
  const r = pk(t13);
  return t13 = Math.min(e, Math.max(0, Number.parseFloat(`${t13}`))), r && (t13 = Number.parseInt(`${t13 * e}`, 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : t13 % e / Number.parseFloat(e);
};
var Yd = {
  10: "A",
  11: "B",
  12: "C",
  13: "D",
  14: "E",
  15: "F"
};
var ss = (t13) => {
  t13 = Math.min(Math.round(t13), 255);
  const e = Math.floor(t13 / 16), r = t13 % 16;
  return `${Yd[e] || e}${Yd[r] || r}`;
};
var jd = function({ r: t13, g: e, b: r }) {
  return Number.isNaN(+t13) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${ss(t13)}${ss(e)}${ss(r)}`;
};
var Al = {
  A: 10,
  B: 11,
  C: 12,
  D: 13,
  E: 14,
  F: 15
};
var Jn = function(t13) {
  return t13.length === 2 ? (Al[t13[0].toUpperCase()] || +t13[0]) * 16 + (Al[t13[1].toUpperCase()] || +t13[1]) : Al[t13[1].toUpperCase()] || +t13[1];
};
var gk = function(t13, e, r) {
  e = e / 100, r = r / 100;
  let n = e;
  const a = Math.max(r, 0.01);
  r *= 2, e *= r <= 1 ? r : 2 - r, n *= a <= 1 ? a : 2 - a;
  const i = (r + e) / 2, o = r === 0 ? 2 * n / (a + n) : 2 * e / (r + e);
  return {
    h: t13,
    s: o * 100,
    v: i * 100
  };
};
var Zd = (t13, e, r) => {
  t13 = Ua(t13, 255), e = Ua(e, 255), r = Ua(r, 255);
  const n = Math.max(t13, e, r), a = Math.min(t13, e, r);
  let i;
  const o = n, s = n - a, l = n === 0 ? 0 : s / n;
  if (n === a)
    i = 0;
  else {
    switch (n) {
      case t13: {
        i = (e - r) / s + (e < r ? 6 : 0);
        break;
      }
      case e: {
        i = (r - t13) / s + 2;
        break;
      }
      case r: {
        i = (t13 - e) / s + 4;
        break;
      }
    }
    i /= 6;
  }
  return { h: i * 360, s: l * 100, v: o * 100 };
};
var Li = function(t13, e, r) {
  t13 = Ua(t13, 360) * 6, e = Ua(e, 100), r = Ua(r, 100);
  const n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), l = n % 6, u = [r, o, i, i, s, r][l], c = [s, r, r, o, i, i][l], d = [i, i, s, r, r, o][l];
  return {
    r: Math.round(u * 255),
    g: Math.round(c * 255),
    b: Math.round(d * 255)
  };
};
var Gi = class {
  constructor(e = {}) {
    this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = false, this.format = "hex", this.value = "";
    for (const r in e)
      va(e, r) && (this[r] = e[r]);
    e.value ? this.fromString(e.value) : this.doOnChange();
  }
  set(e, r) {
    if (arguments.length === 1 && typeof e == "object") {
      for (const n in e)
        va(e, n) && this.set(n, e[n]);
      return;
    }
    this[`_${e}`] = r, this.doOnChange();
  }
  get(e) {
    return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`];
  }
  toRgb() {
    return Li(this._hue, this._saturation, this._value);
  }
  fromString(e) {
    if (!e) {
      this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange();
      return;
    }
    const r = (n, a, i) => {
      this._hue = Math.max(0, Math.min(360, n)), this._saturation = Math.max(0, Math.min(100, a)), this._value = Math.max(0, Math.min(100, i)), this.doOnChange();
    };
    if (e.includes("hsl")) {
      const n = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) {
        const { h: a, s: i, v: o } = gk(n[0], n[1], n[2]);
        r(a, i, o);
      }
    } else if (e.includes("hsv")) {
      const n = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3 && r(n[0], n[1], n[2]);
    } else if (e.includes("rgb")) {
      const n = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) {
        const { h: a, s: i, v: o } = Zd(n[0], n[1], n[2]);
        r(a, i, o);
      }
    } else if (e.includes("#")) {
      const n = e.replace("#", "").trim();
      if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))
        return;
      let a, i, o;
      n.length === 3 ? (a = Jn(n[0] + n[0]), i = Jn(n[1] + n[1]), o = Jn(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = Jn(n.slice(0, 2)), i = Jn(n.slice(2, 4)), o = Jn(n.slice(4, 6))), n.length === 8 ? this._alpha = Jn(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100);
      const { h: s, s: l, v: u } = Zd(a, i, o);
      r(s, l, u);
    }
  }
  compare(e) {
    return Math.abs(e._hue - this._hue) < 2 && Math.abs(e._saturation - this._saturation) < 1 && Math.abs(e._value - this._value) < 1 && Math.abs(e._alpha - this._alpha) < 1;
  }
  doOnChange() {
    const { _hue: e, _saturation: r, _value: n, _alpha: a, format: i } = this;
    if (this.enableAlpha)
      switch (i) {
        case "hsl": {
          const o = Wd(e, r / 100, n / 100);
          this.value = `hsla(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%, ${this.get("alpha") / 100})`;
          break;
        }
        case "hsv": {
          this.value = `hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha") / 100})`;
          break;
        }
        case "hex": {
          this.value = `${jd(Li(e, r, n))}${ss(a * 255 / 100)}`;
          break;
        }
        default: {
          const { r: o, g: s, b: l } = Li(e, r, n);
          this.value = `rgba(${o}, ${s}, ${l}, ${this.get("alpha") / 100})`;
        }
      }
    else
      switch (i) {
        case "hsl": {
          const o = Wd(e, r / 100, n / 100);
          this.value = `hsl(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%)`;
          break;
        }
        case "hsv": {
          this.value = `hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;
          break;
        }
        case "rgb": {
          const { r: o, g: s, b: l } = Li(e, r, n);
          this.value = `rgb(${o}, ${s}, ${l})`;
          break;
        }
        default:
          this.value = jd(Li(e, r, n));
      }
  }
};
var mk = defineComponent({
  props: {
    colors: {
      type: Array,
      required: true
    },
    color: {
      type: Object,
      required: true
    },
    enableAlpha: {
      type: Boolean,
      required: true
    }
  },
  setup(t13) {
    const e = He("color-predefine"), { currentColor: r } = inject(Mh), n = ref(i(t13.colors, t13.color));
    watch(() => r.value, (o) => {
      const s = new Gi();
      s.fromString(o), n.value.forEach((l) => {
        l.selected = s.compare(l);
      });
    }), watchEffect(() => {
      n.value = i(t13.colors, t13.color);
    });
    function a(o) {
      t13.color.fromString(t13.colors[o]);
    }
    function i(o, s) {
      return o.map((l) => {
        const u = new Gi();
        return u.enableAlpha = t13.enableAlpha, u.format = "rgba", u.fromString(l), u.selected = u.value === s.value, u;
      });
    }
    return {
      rgbaColors: n,
      handleSelect: a,
      ns: e
    };
  }
});
function yk(t13, e, r, n, a, i) {
  return openBlock(), createElementBlock("div", {
    class: normalizeClass(t13.ns.b())
  }, [
    createBaseVNode("div", {
      class: normalizeClass(t13.ns.e("colors"))
    }, [
      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.rgbaColors, (o, s) => (openBlock(), createElementBlock("div", {
        key: t13.colors[s],
        class: normalizeClass([
          t13.ns.e("color-selector"),
          t13.ns.is("alpha", o._alpha < 100),
          { selected: o.selected }
        ]),
        onClick: (l) => t13.handleSelect(s)
      }, [
        createBaseVNode("div", {
          style: normalizeStyle({ backgroundColor: o.value })
        }, null, 4)
      ], 10, ["onClick"]))), 128))
    ], 2)
  ], 2);
}
var bk = Ve(mk, [["render", yk], ["__file", "predefine.vue"]]);
var wk = defineComponent({
  name: "ElSlPanel",
  props: {
    color: {
      type: Object,
      required: true
    }
  },
  setup(t13) {
    const e = He("color-svpanel"), r = getCurrentInstance(), n = ref(0), a = ref(0), i = ref("hsl(0, 100%, 50%)"), o = computed(() => {
      const u = t13.color.get("hue"), c = t13.color.get("value");
      return { hue: u, value: c };
    });
    function s() {
      const u = t13.color.get("saturation"), c = t13.color.get("value"), d = r.vnode.el, { clientWidth: v, clientHeight: h6 } = d;
      a.value = u * v / 100, n.value = (100 - c) * h6 / 100, i.value = `hsl(${t13.color.get("hue")}, 100%, 50%)`;
    }
    function l(u) {
      const d = r.vnode.el.getBoundingClientRect(), { clientX: v, clientY: h6 } = Pu(u);
      let f = v - d.left, p = h6 - d.top;
      f = Math.max(0, f), f = Math.min(f, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = f, n.value = p, t13.color.set({
        saturation: f / d.width * 100,
        value: 100 - p / d.height * 100
      });
    }
    return watch(() => o.value, () => {
      s();
    }), onMounted(() => {
      ro(r.vnode.el, {
        drag: (u) => {
          l(u);
        },
        end: (u) => {
          l(u);
        }
      }), s();
    }), {
      cursorTop: n,
      cursorLeft: a,
      background: i,
      colorValue: o,
      handleDrag: l,
      update: s,
      ns: e
    };
  }
});
function Ck(t13, e, r, n, a, i) {
  return openBlock(), createElementBlock("div", {
    class: normalizeClass(t13.ns.b()),
    style: normalizeStyle({
      backgroundColor: t13.background
    })
  }, [
    createBaseVNode("div", {
      class: normalizeClass(t13.ns.e("white"))
    }, null, 2),
    createBaseVNode("div", {
      class: normalizeClass(t13.ns.e("black"))
    }, null, 2),
    createBaseVNode("div", {
      class: normalizeClass(t13.ns.e("cursor")),
      style: normalizeStyle({
        top: t13.cursorTop + "px",
        left: t13.cursorLeft + "px"
      })
    }, [
      createBaseVNode("div")
    ], 6)
  ], 6);
}
var xk = Ve(wk, [["render", Ck], ["__file", "sv-panel.vue"]]);
var Ek = defineComponent({
  name: "ElColorPicker"
});
var kk = defineComponent({
  ...Ek,
  props: fk,
  emits: vk,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, { t: a } = yo(), i = He("color"), { formItem: o } = Ta(), s = pa(), l = Co(), { inputId: u, isLabeledByFormItem: c } = xo(n, {
      formItemContext: o
    }), d = ref(), v = ref(), h6 = ref(), f = ref(), p = ref(), m = ref(), { isFocused: g, handleFocus: y, handleBlur: b } = ju(p, {
      beforeFocus() {
        return l.value;
      },
      beforeBlur(R) {
        var Y;
        return (Y = f.value) == null ? void 0 : Y.isFocusInsideContent(R);
      },
      afterBlur() {
        N(false), $();
      }
    });
    let w = true;
    const C = reactive(new Gi({
      enableAlpha: n.showAlpha,
      format: n.colorFormat || "",
      value: n.modelValue
    })), E = ref(false), x = ref(false), T = ref(""), k = computed(() => !n.modelValue && !x.value ? "transparent" : L(C, n.showAlpha)), _ = computed(() => !n.modelValue && !x.value ? "" : C.value), D = computed(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = computed(() => c.value ? o == null ? void 0 : o.labelId : void 0), A = computed(() => [
      i.b("picker"),
      i.is("disabled", l.value),
      i.bm("picker", s.value),
      i.is("focused", g.value)
    ]);
    function L(R, Y) {
      if (!(R instanceof Gi))
        throw new TypeError("color should be instance of _color Class");
      const { r: J, g: ge, b: Ee } = R.toRgb();
      return Y ? `rgba(${J}, ${ge}, ${Ee}, ${R.get("alpha") / 100})` : `rgb(${J}, ${ge}, ${Ee})`;
    }
    function N(R) {
      E.value = R;
    }
    const I = zv(N, 100, { leading: true });
    function M() {
      l.value || N(true);
    }
    function F() {
      I(false), $();
    }
    function $() {
      nextTick(() => {
        n.modelValue ? C.fromString(n.modelValue) : (C.value = "", nextTick(() => {
          x.value = false;
        }));
      });
    }
    function U() {
      l.value || I(!E.value);
    }
    function H() {
      C.fromString(T.value);
    }
    function K() {
      const R = C.value;
      r(Vt, R), r("change", R), n.validateEvent && (o == null || o.validate("change").catch((Y) => Dt(Y))), I(false), nextTick(() => {
        const Y = new Gi({
          enableAlpha: n.showAlpha,
          format: n.colorFormat || "",
          value: n.modelValue
        });
        C.compare(Y) || $();
      });
    }
    function ee() {
      I(false), r(Vt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch((R) => Dt(R))), $();
    }
    function se() {
      E.value && (F(), g.value && ue());
    }
    function oe(R) {
      R.preventDefault(), R.stopPropagation(), N(false), $();
    }
    function ne(R) {
      switch (R.code) {
        case Lt.enter:
        case Lt.space:
          R.preventDefault(), R.stopPropagation(), M(), m.value.focus();
          break;
        case Lt.esc:
          oe(R);
          break;
      }
    }
    function ue() {
      p.value.focus();
    }
    function te() {
      p.value.blur();
    }
    return onMounted(() => {
      n.modelValue && (T.value = _.value);
    }), watch(() => n.modelValue, (R) => {
      R ? R && R !== C.value && (w = false, C.fromString(R)) : x.value = false;
    }), watch(() => [n.colorFormat, n.showAlpha], () => {
      C.enableAlpha = n.showAlpha, C.format = n.colorFormat || C.format, C.doOnChange(), r(Vt, C.value);
    }), watch(() => _.value, (R) => {
      T.value = R, w && r("activeChange", R), w = true;
    }), watch(() => C.value, () => {
      !n.modelValue && !x.value && (x.value = true);
    }), watch(() => E.value, () => {
      nextTick(() => {
        var R, Y, J;
        (R = d.value) == null || R.update(), (Y = v.value) == null || Y.update(), (J = h6.value) == null || J.update();
      });
    }), provide(Mh, {
      currentColor: _
    }), e({
      color: C,
      show: M,
      hide: F,
      focus: ue,
      blur: te
    }), (R, Y) => (openBlock(), createBlock(unref(ko), {
      ref_key: "popper",
      ref: f,
      visible: E.value,
      "show-arrow": false,
      "fallback-placements": ["bottom", "top", "right", "left"],
      offset: 0,
      "gpu-acceleration": false,
      "popper-class": [unref(i).be("picker", "panel"), unref(i).b("dropdown"), R.popperClass],
      "stop-popper-mouse-event": false,
      effect: "light",
      trigger: "click",
      teleported: R.teleported,
      transition: `${unref(i).namespace.value}-zoom-in-top`,
      persistent: "",
      onHide: (J) => N(false)
    }, {
      content: withCtx(() => [
        withDirectives((openBlock(), createElementBlock("div", {
          onKeydown: withKeys(oe, ["esc"])
        }, [
          createBaseVNode("div", {
            class: normalizeClass(unref(i).be("dropdown", "main-wrapper"))
          }, [
            createVNode(dk, {
              ref_key: "hue",
              ref: d,
              class: "hue-slider",
              color: unref(C),
              vertical: ""
            }, null, 8, ["color"]),
            createVNode(xk, {
              ref_key: "sv",
              ref: v,
              color: unref(C)
            }, null, 8, ["color"])
          ], 2),
          R.showAlpha ? (openBlock(), createBlock(lk, {
            key: 0,
            ref_key: "alpha",
            ref: h6,
            color: unref(C)
          }, null, 8, ["color"])) : createCommentVNode("v-if", true),
          R.predefine ? (openBlock(), createBlock(bk, {
            key: 1,
            ref: "predefine",
            "enable-alpha": R.showAlpha,
            color: unref(C),
            colors: R.predefine
          }, null, 8, ["enable-alpha", "color", "colors"])) : createCommentVNode("v-if", true),
          createBaseVNode("div", {
            class: normalizeClass(unref(i).be("dropdown", "btns"))
          }, [
            createBaseVNode("span", {
              class: normalizeClass(unref(i).be("dropdown", "value"))
            }, [
              createVNode(unref(Eo), {
                ref_key: "inputRef",
                ref: m,
                modelValue: T.value,
                "onUpdate:modelValue": (J) => T.value = J,
                "validate-event": false,
                size: "small",
                onKeyup: withKeys(H, ["enter"]),
                onBlur: H
              }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"])
            ], 2),
            createVNode(unref(Hr), {
              class: normalizeClass(unref(i).be("dropdown", "link-btn")),
              text: "",
              size: "small",
              onClick: ee
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(unref(a)("el.colorpicker.clear")), 1)
              ]),
              _: 1
            }, 8, ["class"]),
            createVNode(unref(Hr), {
              plain: "",
              size: "small",
              class: normalizeClass(unref(i).be("dropdown", "btn")),
              onClick: K
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(unref(a)("el.colorpicker.confirm")), 1)
              ]),
              _: 1
            }, 8, ["class"])
          ], 2)
        ], 40, ["onKeydown"])), [
          [unref(Dh), se]
        ])
      ]),
      default: withCtx(() => [
        createBaseVNode("div", mergeProps({
          id: unref(u),
          ref_key: "triggerRef",
          ref: p
        }, R.$attrs, {
          class: unref(A),
          role: "button",
          "aria-label": unref(D),
          "aria-labelledby": unref(O),
          "aria-description": unref(a)("el.colorpicker.description", { color: R.modelValue || "" }),
          "aria-disabled": unref(l),
          tabindex: unref(l) ? -1 : R.tabindex,
          onKeydown: ne,
          onFocus: unref(y),
          onBlur: unref(b)
        }), [
          unref(l) ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: normalizeClass(unref(i).be("picker", "mask"))
          }, null, 2)) : createCommentVNode("v-if", true),
          createBaseVNode("div", {
            class: normalizeClass(unref(i).be("picker", "trigger")),
            onClick: U
          }, [
            createBaseVNode("span", {
              class: normalizeClass([unref(i).be("picker", "color"), unref(i).is("alpha", R.showAlpha)])
            }, [
              createBaseVNode("span", {
                class: normalizeClass(unref(i).be("picker", "color-inner")),
                style: normalizeStyle({
                  backgroundColor: unref(k)
                })
              }, [
                withDirectives(createVNode(unref(Ht), {
                  class: normalizeClass([unref(i).be("picker", "icon"), unref(i).is("icon-arrow-down")])
                }, {
                  default: withCtx(() => [
                    createVNode(unref(Ws))
                  ]),
                  _: 1
                }, 8, ["class"]), [
                  [vShow, R.modelValue || x.value]
                ]),
                withDirectives(createVNode(unref(Ht), {
                  class: normalizeClass([unref(i).be("picker", "empty"), unref(i).is("icon-close")])
                }, {
                  default: withCtx(() => [
                    createVNode(unref(Ts))
                  ]),
                  _: 1
                }, 8, ["class"]), [
                  [vShow, !R.modelValue && !x.value]
                ])
              ], 6)
            ], 2)
          ], 2)
        ], 16, ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex", "onFocus", "onBlur"])
      ]),
      _: 1
    }, 8, ["visible", "popper-class", "teleported", "transition", "onHide"]));
  }
});
var Sk = Ve(kk, [["__file", "color-picker.vue"]]);
var Tk = $t(Sk);
var _k = defineComponent({
  name: "ElContainer"
});
var Dk = defineComponent({
  ..._k,
  props: {
    direction: {
      type: String
    }
  },
  setup(t13) {
    const e = t13, r = useSlots(), n = He("container"), a = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : r && r.default ? r.default().some((o) => {
      const s = o.type.name;
      return s === "ElHeader" || s === "ElFooter";
    }) : false);
    return (i, o) => (openBlock(), createElementBlock("section", {
      class: normalizeClass([unref(n).b(), unref(n).is("vertical", unref(a))])
    }, [
      renderSlot(i.$slots, "default")
    ], 2));
  }
});
var Pk = Ve(Dk, [["__file", "container.vue"]]);
var Ok = defineComponent({
  name: "ElAside"
});
var Lk = defineComponent({
  ...Ok,
  props: {
    width: {
      type: String,
      default: null
    }
  },
  setup(t13) {
    const e = t13, r = He("aside"), n = computed(() => e.width ? r.cssVarBlock({ width: e.width }) : {});
    return (a, i) => (openBlock(), createElementBlock("aside", {
      class: normalizeClass(unref(r).b()),
      style: normalizeStyle(unref(n))
    }, [
      renderSlot(a.$slots, "default")
    ], 6));
  }
});
var Bh = Ve(Lk, [["__file", "aside.vue"]]);
var Ik = defineComponent({
  name: "ElFooter"
});
var Ak = defineComponent({
  ...Ik,
  props: {
    height: {
      type: String,
      default: null
    }
  },
  setup(t13) {
    const e = t13, r = He("footer"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {});
    return (a, i) => (openBlock(), createElementBlock("footer", {
      class: normalizeClass(unref(r).b()),
      style: normalizeStyle(unref(n))
    }, [
      renderSlot(a.$slots, "default")
    ], 6));
  }
});
var Nh = Ve(Ak, [["__file", "footer.vue"]]);
var Fk = defineComponent({
  name: "ElHeader"
});
var Mk = defineComponent({
  ...Fk,
  props: {
    height: {
      type: String,
      default: null
    }
  },
  setup(t13) {
    const e = t13, r = He("header"), n = computed(() => e.height ? r.cssVarBlock({
      height: e.height
    }) : {});
    return (a, i) => (openBlock(), createElementBlock("header", {
      class: normalizeClass(unref(r).b()),
      style: normalizeStyle(unref(n))
    }, [
      renderSlot(a.$slots, "default")
    ], 6));
  }
});
var Rh = Ve(Mk, [["__file", "header.vue"]]);
var Bk = defineComponent({
  name: "ElMain"
});
var Nk = defineComponent({
  ...Bk,
  setup(t13) {
    const e = He("main");
    return (r, n) => (openBlock(), createElementBlock("main", {
      class: normalizeClass(unref(e).b())
    }, [
      renderSlot(r.$slots, "default")
    ], 2));
  }
});
var $h = Ve(Nk, [["__file", "main.vue"]]);
var zh = $t(Pk, {
  Aside: Bh,
  Footer: Nh,
  Header: Rh,
  Main: $h
});
Cn(Bh);
Cn(Nh);
var Vh = Cn(Rh);
var nc = Cn($h);
var Rk = defineComponent({
  inheritAttrs: false
});
function $k(t13, e, r, n, a, i) {
  return renderSlot(t13.$slots, "default");
}
var zk = Ve(Rk, [["render", $k], ["__file", "collection.vue"]]);
var Vk = defineComponent({
  name: "ElCollectionItem",
  inheritAttrs: false
});
function Hk(t13, e, r, n, a, i) {
  return renderSlot(t13.$slots, "default");
}
var Kk = Ve(Vk, [["render", Hk], ["__file", "collection-item.vue"]]);
var qk = "data-el-collection-item";
var Uk = (t13) => {
  const e = `El${t13}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = {
    ...zk,
    name: e,
    setup() {
      const s = ref(null), l = /* @__PURE__ */ new Map();
      provide(n, {
        itemMap: l,
        getItems: () => {
          const c = unref(s);
          if (!c)
            return [];
          const d = Array.from(c.querySelectorAll(`[${qk}]`));
          return [...l.values()].sort((h6, f) => d.indexOf(h6.ref) - d.indexOf(f.ref));
        },
        collectionRef: s
      });
    }
  }, o = {
    ...Kk,
    name: r,
    setup(s, { attrs: l }) {
      const u = ref(null), c = inject(n, void 0);
      provide(a, {
        collectionItemRef: u
      }), onMounted(() => {
        const d = unref(u);
        d && c.itemMap.set(d, {
          ref: d,
          ...l
        });
      }), onBeforeUnmount(() => {
        const d = unref(u);
        c.itemMap.delete(d);
      });
    }
  };
  return {
    COLLECTION_INJECTION_KEY: n,
    COLLECTION_ITEM_INJECTION_KEY: a,
    ElCollection: i,
    ElCollectionItem: o
  };
};
var Fl = rt({
  trigger: to.trigger,
  effect: {
    ...cr.effect,
    default: "light"
  },
  type: {
    type: $e(String)
  },
  placement: {
    type: $e(String),
    default: "bottom"
  },
  popperOptions: {
    type: $e(Object),
    default: () => ({})
  },
  id: String,
  size: {
    type: String,
    default: ""
  },
  splitButton: Boolean,
  hideOnClick: {
    type: Boolean,
    default: true
  },
  loop: {
    type: Boolean,
    default: true
  },
  showTimeout: {
    type: Number,
    default: 150
  },
  hideTimeout: {
    type: Number,
    default: 150
  },
  tabindex: {
    type: $e([Number, String]),
    default: 0
  },
  maxHeight: {
    type: $e([Number, String]),
    default: ""
  },
  popperClass: {
    type: String,
    default: ""
  },
  disabled: Boolean,
  role: {
    type: String,
    default: "menu"
  },
  buttonProps: {
    type: $e(Object)
  },
  teleported: cr.teleported
});
rt({
  command: {
    type: [Object, String, Number],
    default: () => ({})
  },
  disabled: Boolean,
  divided: Boolean,
  textValue: String,
  icon: {
    type: Hn
  }
});
rt({
  onKeydown: { type: $e(Function) }
});
Uk("Dropdown");
var Hh = Symbol("ElSelectGroup");
var To = Symbol("ElSelect");
function Gk(t13, e) {
  const r = inject(To), n = inject(Hh, { disabled: false }), a = computed(() => c(An(r.props.modelValue), t13.value)), i = computed(() => {
    var h6;
    if (r.props.multiple) {
      const f = An((h6 = r.props.modelValue) != null ? h6 : []);
      return !a.value && f.length >= r.props.multipleLimit && r.props.multipleLimit > 0;
    } else
      return false;
  }), o = computed(() => t13.label || (Kt(t13.value) ? "" : t13.value)), s = computed(() => t13.value || t13.label || ""), l = computed(() => t13.disabled || e.groupDisabled || i.value), u = getCurrentInstance(), c = (h6 = [], f) => {
    if (Kt(t13.value)) {
      const p = r.props.valueKey;
      return h6 && h6.some((m) => toRaw(dn(m, p)) === dn(f, p));
    } else
      return h6 && h6.includes(f);
  }, d = () => {
    !t13.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(u.proxy));
  }, v = (h6) => {
    const f = new RegExp(Qb(h6), "i");
    e.visible = f.test(o.value) || t13.created;
  };
  return watch(() => o.value, () => {
    !t13.created && !r.props.remote && r.setSelected();
  }), watch(() => t13.value, (h6, f) => {
    const { remote: p, valueKey: m } = r.props;
    if (h6 !== f && (r.onOptionDestroy(f, u.proxy), r.onOptionCreate(u.proxy)), !t13.created && !p) {
      if (m && Kt(h6) && Kt(f) && h6[m] === f[m])
        return;
      r.setSelected();
    }
  }), watch(() => n.disabled, () => {
    e.groupDisabled = n.disabled;
  }, { immediate: true }), {
    select: r,
    currentLabel: o,
    currentValue: s,
    itemSelected: a,
    isDisabled: l,
    hoverItem: d,
    updateOption: v
  };
}
var Wk = defineComponent({
  name: "ElOption",
  componentName: "ElOption",
  props: {
    value: {
      required: true,
      type: [String, Number, Boolean, Object]
    },
    label: [String, Number],
    created: Boolean,
    disabled: Boolean
  },
  setup(t13) {
    const e = He("select"), r = Xs(), n = computed(() => [
      e.be("dropdown", "item"),
      e.is("disabled", unref(s)),
      e.is("selected", unref(o)),
      e.is("hovering", unref(v))
    ]), a = reactive({
      index: -1,
      groupDisabled: false,
      visible: true,
      hover: false
    }), {
      currentLabel: i,
      itemSelected: o,
      isDisabled: s,
      select: l,
      hoverItem: u,
      updateOption: c
    } = Gk(t13, a), { visible: d, hover: v } = toRefs(a), h6 = getCurrentInstance().proxy;
    l.onOptionCreate(h6), onBeforeUnmount(() => {
      const p = h6.value, { selected: m } = l.states, y = (l.props.multiple ? m : [m]).some((b) => b.value === h6.value);
      nextTick(() => {
        l.states.cachedOptions.get(p) === h6 && !y && l.states.cachedOptions.delete(p);
      }), l.onOptionDestroy(p, h6);
    });
    function f() {
      s.value || l.handleOptionSelect(h6);
    }
    return {
      ns: e,
      id: r,
      containerKls: n,
      currentLabel: i,
      itemSelected: o,
      isDisabled: s,
      select: l,
      hoverItem: u,
      updateOption: c,
      visible: d,
      hover: v,
      selectOptionClick: f,
      states: a
    };
  }
});
function Yk(t13, e, r, n, a, i) {
  return withDirectives((openBlock(), createElementBlock("li", {
    id: t13.id,
    class: normalizeClass(t13.containerKls),
    role: "option",
    "aria-disabled": t13.isDisabled || void 0,
    "aria-selected": t13.itemSelected,
    onMouseenter: t13.hoverItem,
    onClick: withModifiers(t13.selectOptionClick, ["stop"])
  }, [
    renderSlot(t13.$slots, "default", {}, () => [
      createBaseVNode("span", null, toDisplayString(t13.currentLabel), 1)
    ])
  ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
    [vShow, t13.visible]
  ]);
}
var ac = Ve(Wk, [["render", Yk], ["__file", "option.vue"]]);
var jk = defineComponent({
  name: "ElSelectDropdown",
  componentName: "ElSelectDropdown",
  setup() {
    const t13 = inject(To), e = He("select"), r = computed(() => t13.props.popperClass), n = computed(() => t13.props.multiple), a = computed(() => t13.props.fitInputWidth), i = ref("");
    function o() {
      var s;
      i.value = `${(s = t13.selectRef) == null ? void 0 : s.offsetWidth}px`;
    }
    return onMounted(() => {
      o(), cn(t13.selectRef, o);
    }), {
      ns: e,
      minWidth: i,
      popperClass: r,
      isMultiple: n,
      isFitInputWidth: a
    };
  }
});
function Zk(t13, e, r, n, a, i) {
  return openBlock(), createElementBlock("div", {
    class: normalizeClass([t13.ns.b("dropdown"), t13.ns.is("multiple", t13.isMultiple), t13.popperClass]),
    style: normalizeStyle({ [t13.isFitInputWidth ? "width" : "minWidth"]: t13.minWidth })
  }, [
    t13.$slots.header ? (openBlock(), createElementBlock("div", {
      key: 0,
      class: normalizeClass(t13.ns.be("dropdown", "header"))
    }, [
      renderSlot(t13.$slots, "header")
    ], 2)) : createCommentVNode("v-if", true),
    renderSlot(t13.$slots, "default"),
    t13.$slots.footer ? (openBlock(), createElementBlock("div", {
      key: 1,
      class: normalizeClass(t13.ns.be("dropdown", "footer"))
    }, [
      renderSlot(t13.$slots, "footer")
    ], 2)) : createCommentVNode("v-if", true)
  ], 6);
}
var Xk = Ve(jk, [["render", Zk], ["__file", "select-dropdown.vue"]]);
var Qk = 11;
var Jk = (t13, e) => {
  const { t: r } = yo(), n = Xs(), a = He("select"), i = He("input"), o = reactive({
    inputValue: "",
    options: /* @__PURE__ */ new Map(),
    cachedOptions: /* @__PURE__ */ new Map(),
    disabledOptions: /* @__PURE__ */ new Map(),
    optionValues: [],
    selected: [],
    selectionWidth: 0,
    calculatorWidth: 0,
    collapseItemWidth: 0,
    selectedLabel: "",
    hoveringIndex: -1,
    previousQuery: null,
    inputHovering: false,
    menuVisibleOnFocus: false,
    isBeforeHide: false
  }), s = ref(null), l = ref(null), u = ref(null), c = ref(null), d = ref(null), v = ref(null), h6 = ref(null), f = ref(null), p = ref(null), m = ref(null), g = ref(null), y = ref(null), {
    isComposing: b,
    handleCompositionStart: w,
    handleCompositionUpdate: C,
    handleCompositionEnd: E
  } = ph({
    afterComposition: (j) => ae(j)
  }), { wrapperRef: x, isFocused: T } = ju(d, {
    beforeFocus() {
      return I.value;
    },
    afterFocus() {
      t13.automaticDropdown && !k.value && (k.value = true, o.menuVisibleOnFocus = true);
    },
    beforeBlur(j) {
      var we, We;
      return ((we = u.value) == null ? void 0 : we.isFocusInsideContent(j)) || ((We = c.value) == null ? void 0 : We.isFocusInsideContent(j));
    },
    afterBlur() {
      k.value = false, o.menuVisibleOnFocus = false;
    }
  }), k = ref(false), _ = ref(), { form: D, formItem: O } = Ta(), { inputId: A } = xo(t13, {
    formItemContext: O
  }), { valueOnClear: L, isEmptyValue: N } = vC(t13), I = computed(() => t13.disabled || (D == null ? void 0 : D.disabled)), M = computed(() => fr(t13.modelValue) ? t13.modelValue.length > 0 : !N(t13.modelValue)), F = computed(() => t13.clearable && !I.value && o.inputHovering && M.value), $ = computed(() => t13.remote && t13.filterable && !t13.remoteShowSuffix ? "" : t13.suffixIcon), U = computed(() => a.is("reverse", $.value && k.value)), H = computed(() => (O == null ? void 0 : O.validateState) || ""), K = computed(() => Gv[H.value]), ee = computed(() => t13.remote ? 300 : 0), se = computed(() => t13.loading ? t13.loadingText || r("el.select.loading") : t13.remote && !o.inputValue && o.options.size === 0 ? false : t13.filterable && o.inputValue && o.options.size > 0 && oe.value === 0 ? t13.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t13.noDataText || r("el.select.noData") : null), oe = computed(() => ne.value.filter((j) => j.visible).length), ne = computed(() => {
    const j = Array.from(o.options.values()), we = [];
    return o.optionValues.forEach((We) => {
      const at = j.findIndex((Gr) => Gr.value === We);
      at > -1 && we.push(j[at]);
    }), we.length >= j.length ? we : j;
  }), ue = computed(() => Array.from(o.cachedOptions.values())), te = computed(() => {
    const j = ne.value.filter((we) => !we.created).some((we) => we.currentLabel === o.inputValue);
    return t13.filterable && t13.allowCreate && o.inputValue !== "" && !j;
  }), R = () => {
    t13.filterable && lr(t13.filterMethod) || t13.filterable && t13.remote && lr(t13.remoteMethod) || ne.value.forEach((j) => {
      var we;
      (we = j.updateOption) == null || we.call(j, o.inputValue);
    });
  }, Y = pa(), J = computed(() => ["small"].includes(Y.value) ? "small" : "default"), ge = computed({
    get() {
      return k.value && se.value !== false;
    },
    set(j) {
      k.value = j;
    }
  }), Ee = computed(() => {
    if (t13.multiple && !Mn(t13.modelValue))
      return An(t13.modelValue).length === 0 && !o.inputValue;
    const j = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue;
    return t13.filterable || Mn(j) ? !o.inputValue : true;
  }), ve = computed(() => {
    var j;
    const we = (j = t13.placeholder) != null ? j : r("el.select.placeholder");
    return t13.multiple || !M.value ? we : o.selectedLabel;
  }), me = computed(() => jl ? null : "mouseenter");
  watch(() => t13.modelValue, (j, we) => {
    t13.multiple && t13.filterable && !t13.reserveKeyword && (o.inputValue = "", Ce("")), xe(), !ks(j, we) && t13.validateEvent && (O == null || O.validate("change").catch((We) => Dt(We)));
  }, {
    flush: "post",
    deep: true
  }), watch(() => k.value, (j) => {
    j ? Ce(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", j);
  }), watch(() => o.options.entries(), () => {
    var j;
    if (!_t)
      return;
    const we = ((j = s.value) == null ? void 0 : j.querySelectorAll("input")) || [];
    (!t13.filterable && !t13.defaultFirstOption && !Mn(t13.modelValue) || !Array.from(we).includes(document.activeElement)) && xe(), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value && ke();
  }, {
    flush: "post"
  }), watch(() => o.hoveringIndex, (j) => {
    qt(j) && j > -1 ? _.value = ne.value[j] || {} : _.value = {}, ne.value.forEach((we) => {
      we.hover = _.value === we;
    });
  }), watchEffect(() => {
    o.isBeforeHide || R();
  });
  const Ce = (j) => {
    o.previousQuery === j || b.value || (o.previousQuery = j, t13.filterable && lr(t13.filterMethod) ? t13.filterMethod(j) : t13.filterable && t13.remote && lr(t13.remoteMethod) && t13.remoteMethod(j), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value ? nextTick(ke) : nextTick(Ke));
  }, ke = () => {
    const j = ne.value.filter((at) => at.visible && !at.disabled && !at.states.groupDisabled), we = j.find((at) => at.created), We = j[0];
    o.hoveringIndex = _e(ne.value, we || We);
  }, xe = () => {
    if (t13.multiple)
      o.selectedLabel = "";
    else {
      const we = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue, We = Pe(we);
      o.selectedLabel = We.currentLabel, o.selected = [We];
      return;
    }
    const j = [];
    Mn(t13.modelValue) || An(t13.modelValue).forEach((we) => {
      j.push(Pe(we));
    }), o.selected = j;
  }, Pe = (j) => {
    let we;
    const We = Cl(j).toLowerCase() === "object", at = Cl(j).toLowerCase() === "null", Gr = Cl(j).toLowerCase() === "undefined";
    for (let on = o.cachedOptions.size - 1; on >= 0; on--) {
      const Cr = ue.value[on];
      if (We ? dn(Cr.value, t13.valueKey) === dn(j, t13.valueKey) : Cr.value === j) {
        we = {
          value: j,
          currentLabel: Cr.currentLabel,
          get isDisabled() {
            return Cr.isDisabled;
          }
        };
        break;
      }
    }
    if (we)
      return we;
    const Sn = We ? j.label : !at && !Gr ? j : "";
    return {
      value: j,
      currentLabel: Sn
    };
  }, Ke = () => {
    o.hoveringIndex = ne.value.findIndex((j) => o.selected.some((we) => Xt(we) === Xt(j)));
  }, qe = () => {
    o.selectionWidth = l.value.getBoundingClientRect().width;
  }, Ne = () => {
    o.calculatorWidth = v.value.getBoundingClientRect().width;
  }, Ge = () => {
    o.collapseItemWidth = g.value.getBoundingClientRect().width;
  }, le = () => {
    var j, we;
    (we = (j = u.value) == null ? void 0 : j.updatePopper) == null || we.call(j);
  }, S = () => {
    var j, we;
    (we = (j = c.value) == null ? void 0 : j.updatePopper) == null || we.call(j);
  }, z = () => {
    o.inputValue.length > 0 && !k.value && (k.value = true), Ce(o.inputValue);
  }, ae = (j) => {
    if (o.inputValue = j.target.value, t13.remote)
      Q();
    else
      return z();
  }, Q = zv(() => {
    z();
  }, ee.value), X = (j) => {
    ks(t13.modelValue, j) || e($u, j);
  }, pe = (j) => Gb(j, (we) => !o.disabledOptions.has(we)), re = (j) => {
    if (t13.multiple && j.code !== Lt.delete && j.target.value.length <= 0) {
      const we = An(t13.modelValue).slice(), We = pe(we);
      if (We < 0)
        return;
      const at = we[We];
      we.splice(We, 1), e(Vt, we), X(we), e("remove-tag", at);
    }
  }, he = (j, we) => {
    const We = o.selected.indexOf(we);
    if (We > -1 && !I.value) {
      const at = An(t13.modelValue).slice();
      at.splice(We, 1), e(Vt, at), X(at), e("remove-tag", we.value);
    }
    j.stopPropagation(), kt();
  }, Fe = (j) => {
    j.stopPropagation();
    const we = t13.multiple ? [] : L.value;
    if (t13.multiple)
      for (const We of o.selected)
        We.isDisabled && we.push(We.value);
    e(Vt, we), X(we), o.hoveringIndex = -1, k.value = false, e("clear"), kt();
  }, Me = (j) => {
    var we;
    if (t13.multiple) {
      const We = An((we = t13.modelValue) != null ? we : []).slice(), at = _e(We, j.value);
      at > -1 ? We.splice(at, 1) : (t13.multipleLimit <= 0 || We.length < t13.multipleLimit) && We.push(j.value), e(Vt, We), X(We), j.created && Ce(""), t13.filterable && !t13.reserveKeyword && (o.inputValue = "");
    } else
      e(Vt, j.value), X(j.value), k.value = false;
    kt(), !k.value && nextTick(() => {
      Re(j);
    });
  }, _e = (j = [], we) => {
    if (!Kt(we))
      return j.indexOf(we);
    const We = t13.valueKey;
    let at = -1;
    return j.some((Gr, Sn) => toRaw(dn(Gr, We)) === dn(we, We) ? (at = Sn, true) : false), at;
  }, Re = (j) => {
    var we, We, at, Gr, Sn;
    const La = fr(j) ? j[0] : j;
    let on = null;
    if (La != null && La.value) {
      const Cr = ne.value.filter((Tn) => Tn.value === La.value);
      Cr.length > 0 && (on = Cr[0].$el);
    }
    if (u.value && on) {
      const Cr = (Gr = (at = (We = (we = u.value) == null ? void 0 : we.popperRef) == null ? void 0 : We.contentRef) == null ? void 0 : at.querySelector) == null ? void 0 : Gr.call(at, `.${a.be("dropdown", "wrap")}`);
      Cr && t2(Cr, on);
    }
    (Sn = y.value) == null || Sn.handleScroll();
  }, Te = (j) => {
    o.options.set(j.value, j), o.cachedOptions.set(j.value, j), j.disabled && o.disabledOptions.set(j.value, j);
  }, Le = (j, we) => {
    o.options.get(j) === we && o.options.delete(j);
  }, ut = computed(() => {
    var j, we;
    return (we = (j = u.value) == null ? void 0 : j.popperRef) == null ? void 0 : we.contentRef;
  }), nt = () => {
    o.isBeforeHide = false, nextTick(() => Re(o.selected));
  }, kt = () => {
    var j;
    (j = d.value) == null || j.focus();
  }, St = () => {
    var j;
    (j = d.value) == null || j.blur();
  }, wt = (j) => {
    Fe(j);
  }, Zt = () => {
    k.value = false, T.value && St();
  }, Pt = () => {
    o.inputValue.length > 0 ? o.inputValue = "" : k.value = false;
  }, Bt = () => {
    I.value || (jl && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : k.value = !k.value);
  }, gr = () => {
    k.value ? ne.value[o.hoveringIndex] && Me(ne.value[o.hoveringIndex]) : Bt();
  }, Xt = (j) => Kt(j.value) ? dn(j.value, t13.valueKey) : j.value, Qt = computed(() => ne.value.filter((j) => j.visible).every((j) => j.disabled)), wr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(0, t13.maxCollapseTags) : o.selected : []), Pr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(t13.maxCollapseTags) : [] : []), ur = (j) => {
    if (!k.value) {
      k.value = true;
      return;
    }
    if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !Qt.value) {
      j === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : j === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1));
      const we = ne.value[o.hoveringIndex];
      (we.disabled === true || we.states.groupDisabled === true || !we.visible) && ur(j), nextTick(() => Re(_.value));
    }
  }, Ct = () => {
    if (!l.value)
      return 0;
    const j = window.getComputedStyle(l.value);
    return Number.parseFloat(j.gap || "6px");
  }, Tt = computed(() => {
    const j = Ct();
    return { maxWidth: `${g.value && t13.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - j : o.selectionWidth}px` };
  }), Nt = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), kn = computed(() => ({
    width: `${Math.max(o.calculatorWidth, Qk)}px`
  }));
  return cn(l, qe), cn(v, Ne), cn(p, le), cn(x, le), cn(m, S), cn(g, Ge), onMounted(() => {
    xe();
  }), {
    inputId: A,
    contentId: n,
    nsSelect: a,
    nsInput: i,
    states: o,
    isFocused: T,
    expanded: k,
    optionsArray: ne,
    hoverOption: _,
    selectSize: Y,
    filteredOptionsCount: oe,
    resetCalculatorWidth: Ne,
    updateTooltip: le,
    updateTagTooltip: S,
    debouncedOnInputChange: Q,
    onInput: ae,
    deletePrevTag: re,
    deleteTag: he,
    deleteSelected: Fe,
    handleOptionSelect: Me,
    scrollToOption: Re,
    hasModelValue: M,
    shouldShowPlaceholder: Ee,
    currentPlaceholder: ve,
    mouseEnterEventName: me,
    showClose: F,
    iconComponent: $,
    iconReverse: U,
    validateState: H,
    validateIcon: K,
    showNewOption: te,
    updateOptions: R,
    collapseTagSize: J,
    setSelected: xe,
    selectDisabled: I,
    emptyText: se,
    handleCompositionStart: w,
    handleCompositionUpdate: C,
    handleCompositionEnd: E,
    onOptionCreate: Te,
    onOptionDestroy: Le,
    handleMenuEnter: nt,
    focus: kt,
    blur: St,
    handleClearClick: wt,
    handleClickOutside: Zt,
    handleEsc: Pt,
    toggleMenu: Bt,
    selectOption: gr,
    getValueKey: Xt,
    navigateOptions: ur,
    dropdownMenuVisible: ge,
    showTagList: wr,
    collapseTagList: Pr,
    tagStyle: Tt,
    collapseTagStyle: Nt,
    inputStyle: kn,
    popperRef: ut,
    inputRef: d,
    tooltipRef: u,
    tagTooltipRef: c,
    calculatorRef: v,
    prefixRef: h6,
    suffixRef: f,
    selectRef: s,
    wrapperRef: x,
    selectionRef: l,
    scrollbarRef: y,
    menuRef: p,
    tagMenuRef: m,
    collapseItemRef: g
  };
};
var eS = defineComponent({
  name: "ElOptions",
  setup(t13, { slots: e }) {
    const r = inject(To);
    let n = [];
    return () => {
      var a, i;
      const o = (a = e.default) == null ? void 0 : a.call(e), s = [];
      function l(u) {
        fr(u) && u.forEach((c) => {
          var d, v, h6, f;
          const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name;
          p === "ElOptionGroup" ? l(!tr(c.children) && !fr(c.children) && lr((v = c.children) == null ? void 0 : v.default) ? (h6 = c.children) == null ? void 0 : h6.default() : c.children) : p === "ElOption" ? s.push((f = c.props) == null ? void 0 : f.value) : fr(c.children) && l(c.children);
        });
      }
      return o.length && l((i = o[0]) == null ? void 0 : i.children), ks(s, n) || (n = s, r && (r.states.optionValues = s)), o;
    };
  }
});
var tS = rt({
  name: String,
  id: String,
  modelValue: {
    type: [Array, String, Number, Boolean, Object],
    default: void 0
  },
  autocomplete: {
    type: String,
    default: "off"
  },
  automaticDropdown: Boolean,
  size: hi,
  effect: {
    type: $e(String),
    default: "light"
  },
  disabled: Boolean,
  clearable: Boolean,
  filterable: Boolean,
  allowCreate: Boolean,
  loading: Boolean,
  popperClass: {
    type: String,
    default: ""
  },
  popperOptions: {
    type: $e(Object),
    default: () => ({})
  },
  remote: Boolean,
  loadingText: String,
  noMatchText: String,
  noDataText: String,
  remoteMethod: Function,
  filterMethod: Function,
  multiple: Boolean,
  multipleLimit: {
    type: Number,
    default: 0
  },
  placeholder: {
    type: String
  },
  defaultFirstOption: Boolean,
  reserveKeyword: {
    type: Boolean,
    default: true
  },
  valueKey: {
    type: String,
    default: "value"
  },
  collapseTags: Boolean,
  collapseTagsTooltip: Boolean,
  maxCollapseTags: {
    type: Number,
    default: 1
  },
  teleported: cr.teleported,
  persistent: {
    type: Boolean,
    default: true
  },
  clearIcon: {
    type: Hn,
    default: Nu
  },
  fitInputWidth: Boolean,
  suffixIcon: {
    type: Hn,
    default: Ws
  },
  tagType: { ...su.type, default: "info" },
  tagEffect: { ...su.effect, default: "light" },
  validateEvent: {
    type: Boolean,
    default: true
  },
  remoteShowSuffix: Boolean,
  placement: {
    type: $e(String),
    values: js,
    default: "bottom-start"
  },
  fallbackPlacements: {
    type: $e(Array),
    default: ["bottom-start", "top-start", "right", "left"]
  },
  appendTo: String,
  ...fC,
  ...jn(["ariaLabel"])
});
var Xd = "ElSelect";
var rS = defineComponent({
  name: Xd,
  componentName: Xd,
  components: {
    ElSelectMenu: Xk,
    ElOption: ac,
    ElOptions: eS,
    ElTag: VE,
    ElScrollbar: KC,
    ElTooltip: ko,
    ElIcon: Ht
  },
  directives: { ClickOutside: Dh },
  props: tS,
  emits: [
    Vt,
    $u,
    "remove-tag",
    "clear",
    "visible-change",
    "focus",
    "blur"
  ],
  setup(t13, { emit: e }) {
    const r = computed(() => {
      const { modelValue: i, multiple: o } = t13, s = o ? [] : void 0;
      return fr(i) ? o ? i : s : o ? s : i;
    }), n = reactive({
      ...toRefs(t13),
      modelValue: r
    }), a = Jk(n, e);
    return provide(To, reactive({
      props: n,
      states: a.states,
      optionsArray: a.optionsArray,
      handleOptionSelect: a.handleOptionSelect,
      onOptionCreate: a.onOptionCreate,
      onOptionDestroy: a.onOptionDestroy,
      selectRef: a.selectRef,
      setSelected: a.setSelected
    })), {
      ...a,
      modelValue: r
    };
  }
});
function nS(t13, e, r, n, a, i) {
  const o = resolveComponent("el-tag"), s = resolveComponent("el-tooltip"), l = resolveComponent("el-icon"), u = resolveComponent("el-option"), c = resolveComponent("el-options"), d = resolveComponent("el-scrollbar"), v = resolveComponent("el-select-menu"), h6 = resolveDirective("click-outside");
  return withDirectives((openBlock(), createElementBlock("div", {
    ref: "selectRef",
    class: normalizeClass([t13.nsSelect.b(), t13.nsSelect.m(t13.selectSize)]),
    [toHandlerKey(t13.mouseEnterEventName)]: (f) => t13.states.inputHovering = true,
    onMouseleave: (f) => t13.states.inputHovering = false
  }, [
    createVNode(s, {
      ref: "tooltipRef",
      visible: t13.dropdownMenuVisible,
      placement: t13.placement,
      teleported: t13.teleported,
      "popper-class": [t13.nsSelect.e("popper"), t13.popperClass],
      "popper-options": t13.popperOptions,
      "fallback-placements": t13.fallbackPlacements,
      effect: t13.effect,
      pure: "",
      trigger: "click",
      transition: `${t13.nsSelect.namespace.value}-zoom-in-top`,
      "stop-popper-mouse-event": false,
      "gpu-acceleration": false,
      persistent: t13.persistent,
      "append-to": t13.appendTo,
      onBeforeShow: t13.handleMenuEnter,
      onHide: (f) => t13.states.isBeforeHide = false
    }, {
      default: withCtx(() => {
        var f;
        return [
          createBaseVNode("div", {
            ref: "wrapperRef",
            class: normalizeClass([
              t13.nsSelect.e("wrapper"),
              t13.nsSelect.is("focused", t13.isFocused),
              t13.nsSelect.is("hovering", t13.states.inputHovering),
              t13.nsSelect.is("filterable", t13.filterable),
              t13.nsSelect.is("disabled", t13.selectDisabled)
            ]),
            onClick: withModifiers(t13.toggleMenu, ["prevent"])
          }, [
            t13.$slots.prefix ? (openBlock(), createElementBlock("div", {
              key: 0,
              ref: "prefixRef",
              class: normalizeClass(t13.nsSelect.e("prefix"))
            }, [
              renderSlot(t13.$slots, "prefix")
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              ref: "selectionRef",
              class: normalizeClass([
                t13.nsSelect.e("selection"),
                t13.nsSelect.is("near", t13.multiple && !t13.$slots.prefix && !!t13.states.selected.length)
              ])
            }, [
              t13.multiple ? renderSlot(t13.$slots, "tag", { key: 0 }, () => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(t13.showTagList, (p) => (openBlock(), createElementBlock("div", {
                  key: t13.getValueKey(p),
                  class: normalizeClass(t13.nsSelect.e("selected-item"))
                }, [
                  createVNode(o, {
                    closable: !t13.selectDisabled && !p.isDisabled,
                    size: t13.collapseTagSize,
                    type: t13.tagType,
                    effect: t13.tagEffect,
                    "disable-transitions": "",
                    style: normalizeStyle(t13.tagStyle),
                    onClose: (m) => t13.deleteTag(m, p)
                  }, {
                    default: withCtx(() => [
                      createBaseVNode("span", {
                        class: normalizeClass(t13.nsSelect.e("tags-text"))
                      }, [
                        renderSlot(t13.$slots, "label", {
                          label: p.currentLabel,
                          value: p.value
                        }, () => [
                          createTextVNode(toDisplayString(p.currentLabel), 1)
                        ])
                      ], 2)
                    ]),
                    _: 2
                  }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
                ], 2))), 128)),
                t13.collapseTags && t13.states.selected.length > t13.maxCollapseTags ? (openBlock(), createBlock(s, {
                  key: 0,
                  ref: "tagTooltipRef",
                  disabled: t13.dropdownMenuVisible || !t13.collapseTagsTooltip,
                  "fallback-placements": ["bottom", "top", "right", "left"],
                  effect: t13.effect,
                  placement: "bottom",
                  teleported: t13.teleported
                }, {
                  default: withCtx(() => [
                    createBaseVNode("div", {
                      ref: "collapseItemRef",
                      class: normalizeClass(t13.nsSelect.e("selected-item"))
                    }, [
                      createVNode(o, {
                        closable: false,
                        size: t13.collapseTagSize,
                        type: t13.tagType,
                        effect: t13.tagEffect,
                        "disable-transitions": "",
                        style: normalizeStyle(t13.collapseTagStyle)
                      }, {
                        default: withCtx(() => [
                          createBaseVNode("span", {
                            class: normalizeClass(t13.nsSelect.e("tags-text"))
                          }, " + " + toDisplayString(t13.states.selected.length - t13.maxCollapseTags), 3)
                        ]),
                        _: 1
                      }, 8, ["size", "type", "effect", "style"])
                    ], 2)
                  ]),
                  content: withCtx(() => [
                    createBaseVNode("div", {
                      ref: "tagMenuRef",
                      class: normalizeClass(t13.nsSelect.e("selection"))
                    }, [
                      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.collapseTagList, (p) => (openBlock(), createElementBlock("div", {
                        key: t13.getValueKey(p),
                        class: normalizeClass(t13.nsSelect.e("selected-item"))
                      }, [
                        createVNode(o, {
                          class: "in-tooltip",
                          closable: !t13.selectDisabled && !p.isDisabled,
                          size: t13.collapseTagSize,
                          type: t13.tagType,
                          effect: t13.tagEffect,
                          "disable-transitions": "",
                          onClose: (m) => t13.deleteTag(m, p)
                        }, {
                          default: withCtx(() => [
                            createBaseVNode("span", {
                              class: normalizeClass(t13.nsSelect.e("tags-text"))
                            }, [
                              renderSlot(t13.$slots, "label", {
                                label: p.currentLabel,
                                value: p.value
                              }, () => [
                                createTextVNode(toDisplayString(p.currentLabel), 1)
                              ])
                            ], 2)
                          ]),
                          _: 2
                        }, 1032, ["closable", "size", "type", "effect", "onClose"])
                      ], 2))), 128))
                    ], 2)
                  ]),
                  _: 3
                }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true)
              ]) : createCommentVNode("v-if", true),
              t13.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass([
                  t13.nsSelect.e("selected-item"),
                  t13.nsSelect.e("input-wrapper"),
                  t13.nsSelect.is("hidden", !t13.filterable)
                ])
              }, [
                withDirectives(createBaseVNode("input", {
                  id: t13.inputId,
                  ref: "inputRef",
                  "onUpdate:modelValue": (p) => t13.states.inputValue = p,
                  type: "text",
                  name: t13.name,
                  class: normalizeClass([t13.nsSelect.e("input"), t13.nsSelect.is(t13.selectSize)]),
                  disabled: t13.selectDisabled,
                  autocomplete: t13.autocomplete,
                  style: normalizeStyle(t13.inputStyle),
                  role: "combobox",
                  readonly: !t13.filterable,
                  spellcheck: "false",
                  "aria-activedescendant": ((f = t13.hoverOption) == null ? void 0 : f.id) || "",
                  "aria-controls": t13.contentId,
                  "aria-expanded": t13.dropdownMenuVisible,
                  "aria-label": t13.ariaLabel,
                  "aria-autocomplete": "none",
                  "aria-haspopup": "listbox",
                  onKeydown: [
                    withKeys(withModifiers((p) => t13.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
                    withKeys(withModifiers((p) => t13.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
                    withKeys(withModifiers(t13.handleEsc, ["stop", "prevent"]), ["esc"]),
                    withKeys(withModifiers(t13.selectOption, ["stop", "prevent"]), ["enter"]),
                    withKeys(withModifiers(t13.deletePrevTag, ["stop"]), ["delete"])
                  ],
                  onCompositionstart: t13.handleCompositionStart,
                  onCompositionupdate: t13.handleCompositionUpdate,
                  onCompositionend: t13.handleCompositionEnd,
                  onInput: t13.onInput,
                  onClick: withModifiers(t13.toggleMenu, ["stop"])
                }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
                  [vModelText, t13.states.inputValue]
                ]),
                t13.filterable ? (openBlock(), createElementBlock("span", {
                  key: 0,
                  ref: "calculatorRef",
                  "aria-hidden": "true",
                  class: normalizeClass(t13.nsSelect.e("input-calculator")),
                  textContent: toDisplayString(t13.states.inputValue)
                }, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
              ], 2)),
              t13.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
                key: 2,
                class: normalizeClass([
                  t13.nsSelect.e("selected-item"),
                  t13.nsSelect.e("placeholder"),
                  t13.nsSelect.is("transparent", !t13.hasModelValue || t13.expanded && !t13.states.inputValue)
                ])
              }, [
                t13.hasModelValue ? renderSlot(t13.$slots, "label", {
                  key: 0,
                  label: t13.currentPlaceholder,
                  value: t13.modelValue
                }, () => [
                  createBaseVNode("span", null, toDisplayString(t13.currentPlaceholder), 1)
                ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(t13.currentPlaceholder), 1))
              ], 2)) : createCommentVNode("v-if", true)
            ], 2),
            createBaseVNode("div", {
              ref: "suffixRef",
              class: normalizeClass(t13.nsSelect.e("suffix"))
            }, [
              t13.iconComponent && !t13.showClose ? (openBlock(), createBlock(l, {
                key: 0,
                class: normalizeClass([t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.iconReverse])
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(t13.iconComponent)))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true),
              t13.showClose && t13.clearIcon ? (openBlock(), createBlock(l, {
                key: 1,
                class: normalizeClass([
                  t13.nsSelect.e("caret"),
                  t13.nsSelect.e("icon"),
                  t13.nsSelect.e("clear")
                ]),
                onClick: t13.handleClearClick
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(t13.clearIcon)))
                ]),
                _: 1
              }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
              t13.validateState && t13.validateIcon ? (openBlock(), createBlock(l, {
                key: 2,
                class: normalizeClass([t13.nsInput.e("icon"), t13.nsInput.e("validateIcon")])
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(t13.validateIcon)))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ], 2)
          ], 10, ["onClick"])
        ];
      }),
      content: withCtx(() => [
        createVNode(v, { ref: "menuRef" }, {
          default: withCtx(() => [
            t13.$slots.header ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(t13.nsSelect.be("dropdown", "header")),
              onClick: withModifiers(() => {
              }, ["stop"])
            }, [
              renderSlot(t13.$slots, "header")
            ], 10, ["onClick"])) : createCommentVNode("v-if", true),
            withDirectives(createVNode(d, {
              id: t13.contentId,
              ref: "scrollbarRef",
              tag: "ul",
              "wrap-class": t13.nsSelect.be("dropdown", "wrap"),
              "view-class": t13.nsSelect.be("dropdown", "list"),
              class: normalizeClass([t13.nsSelect.is("empty", t13.filteredOptionsCount === 0)]),
              role: "listbox",
              "aria-label": t13.ariaLabel,
              "aria-orientation": "vertical"
            }, {
              default: withCtx(() => [
                t13.showNewOption ? (openBlock(), createBlock(u, {
                  key: 0,
                  value: t13.states.inputValue,
                  created: true
                }, null, 8, ["value"])) : createCommentVNode("v-if", true),
                createVNode(c, null, {
                  default: withCtx(() => [
                    renderSlot(t13.$slots, "default")
                  ]),
                  _: 3
                })
              ]),
              _: 3
            }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
              [vShow, t13.states.options.size > 0 && !t13.loading]
            ]),
            t13.$slots.loading && t13.loading ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(t13.nsSelect.be("dropdown", "loading"))
            }, [
              renderSlot(t13.$slots, "loading")
            ], 2)) : t13.loading || t13.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", {
              key: 2,
              class: normalizeClass(t13.nsSelect.be("dropdown", "empty"))
            }, [
              renderSlot(t13.$slots, "empty", {}, () => [
                createBaseVNode("span", null, toDisplayString(t13.emptyText), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            t13.$slots.footer ? (openBlock(), createElementBlock("div", {
              key: 3,
              class: normalizeClass(t13.nsSelect.be("dropdown", "footer")),
              onClick: withModifiers(() => {
              }, ["stop"])
            }, [
              renderSlot(t13.$slots, "footer")
            ], 10, ["onClick"])) : createCommentVNode("v-if", true)
          ]),
          _: 3
        }, 512)
      ]),
      _: 3
    }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"])
  ], 16, ["onMouseleave"])), [
    [h6, t13.handleClickOutside, t13.popperRef]
  ]);
}
var aS = Ve(rS, [["render", nS], ["__file", "select.vue"]]);
var iS = defineComponent({
  name: "ElOptionGroup",
  componentName: "ElOptionGroup",
  props: {
    label: String,
    disabled: Boolean
  },
  setup(t13) {
    const e = He("select"), r = ref(null), n = getCurrentInstance(), a = ref([]);
    provide(Hh, reactive({
      ...toRefs(t13)
    }));
    const i = computed(() => a.value.some((u) => u.visible === true)), o = (u) => {
      var c, d;
      return ((c = u.type) == null ? void 0 : c.name) === "ElOption" && !!((d = u.component) != null && d.proxy);
    }, s = (u) => {
      const c = An(u), d = [];
      return c.forEach((v) => {
        var h6, f;
        o(v) ? d.push(v.component.proxy) : (h6 = v.children) != null && h6.length ? d.push(...s(v.children)) : (f = v.component) != null && f.subTree && d.push(...s(v.component.subTree));
      }), d;
    }, l = () => {
      a.value = s(n.subTree);
    };
    return onMounted(() => {
      l();
    }), Wm(r, l, {
      attributes: true,
      subtree: true,
      childList: true
    }), {
      groupRef: r,
      visible: i,
      ns: e
    };
  }
});
function oS(t13, e, r, n, a, i) {
  return withDirectives((openBlock(), createElementBlock("ul", {
    ref: "groupRef",
    class: normalizeClass(t13.ns.be("group", "wrap"))
  }, [
    createBaseVNode("li", {
      class: normalizeClass(t13.ns.be("group", "title"))
    }, toDisplayString(t13.label), 3),
    createBaseVNode("li", null, [
      createBaseVNode("ul", {
        class: normalizeClass(t13.ns.b("group"))
      }, [
        renderSlot(t13.$slots, "default")
      ], 2)
    ])
  ], 2)), [
    [vShow, t13.visible]
  ]);
}
var Kh = Ve(iS, [["render", oS], ["__file", "option-group.vue"]]);
var sS = $t(aS, {
  Option: ac,
  OptionGroup: Kh
});
var lS = Cn(ac);
Cn(Kh);
var uS = rt({
  trigger: to.trigger,
  placement: Fl.placement,
  disabled: to.disabled,
  visible: cr.visible,
  transition: cr.transition,
  popperOptions: Fl.popperOptions,
  tabindex: Fl.tabindex,
  content: cr.content,
  popperStyle: cr.popperStyle,
  popperClass: cr.popperClass,
  enterable: {
    ...cr.enterable,
    default: true
  },
  effect: {
    ...cr.effect,
    default: "light"
  },
  teleported: cr.teleported,
  title: String,
  width: {
    type: [String, Number],
    default: 150
  },
  offset: {
    type: Number,
    default: void 0
  },
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  },
  showArrow: {
    type: Boolean,
    default: true
  },
  persistent: {
    type: Boolean,
    default: true
  },
  "onUpdate:visible": {
    type: Function
  }
});
var cS = {
  "update:visible": (t13) => Ja(t13),
  "before-enter": () => true,
  "before-leave": () => true,
  "after-enter": () => true,
  "after-leave": () => true
};
var dS = "onUpdate:visible";
var fS = defineComponent({
  name: "ElPopover"
});
var vS = defineComponent({
  ...fS,
  props: uS,
  emits: cS,
  setup(t13, { expose: e, emit: r }) {
    const n = t13, a = computed(() => n[dS]), i = He("popover"), o = ref(), s = computed(() => {
      var m;
      return (m = unref(o)) == null ? void 0 : m.popperRef;
    }), l = computed(() => [
      {
        width: ei(n.width)
      },
      n.popperStyle
    ]), u = computed(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = computed(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => {
      var m;
      (m = o.value) == null || m.hide();
    }, v = () => {
      r("before-enter");
    }, h6 = () => {
      r("before-leave");
    }, f = () => {
      r("after-enter");
    }, p = () => {
      r("update:visible", false), r("after-leave");
    };
    return e({
      popperRef: s,
      hide: d
    }), (m, g) => (openBlock(), createBlock(unref(ko), mergeProps({
      ref_key: "tooltipRef",
      ref: o
    }, m.$attrs, {
      trigger: m.trigger,
      placement: m.placement,
      disabled: m.disabled,
      visible: m.visible,
      transition: m.transition,
      "popper-options": m.popperOptions,
      tabindex: m.tabindex,
      content: m.content,
      offset: m.offset,
      "show-after": m.showAfter,
      "hide-after": m.hideAfter,
      "auto-close": m.autoClose,
      "show-arrow": m.showArrow,
      "aria-label": m.title,
      effect: m.effect,
      enterable: m.enterable,
      "popper-class": unref(u),
      "popper-style": unref(l),
      teleported: m.teleported,
      persistent: m.persistent,
      "gpu-acceleration": unref(c),
      "onUpdate:visible": unref(a),
      onBeforeShow: v,
      onBeforeHide: h6,
      onShow: f,
      onHide: p
    }), {
      content: withCtx(() => [
        m.title ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(unref(i).e("title")),
          role: "title"
        }, toDisplayString(m.title), 3)) : createCommentVNode("v-if", true),
        renderSlot(m.$slots, "default", {}, () => [
          createTextVNode(toDisplayString(m.content), 1)
        ])
      ]),
      default: withCtx(() => [
        m.$slots.reference ? renderSlot(m.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
      ]),
      _: 3
    }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
  }
});
var hS = Ve(vS, [["__file", "popover.vue"]]);
var Qd = (t13, e) => {
  const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef;
  n && (n.triggerRef = t13);
};
var pS = {
  mounted(t13, e) {
    Qd(t13, e);
  },
  updated(t13, e) {
    Qd(t13, e);
  }
};
var gS = "popover";
var mS = B2(pS, gS);
var el = $t(hS, {
  directive: mS
});
var Ga = "$treeNodeId";
var Jd = function(t13, e) {
  !e || e[Ga] || Object.defineProperty(e, Ga, {
    value: t13.id,
    enumerable: false,
    configurable: false,
    writable: false
  });
};
var ic = function(t13, e) {
  return t13 ? e[t13] : e[Ga];
};
var lu = (t13, e, r) => {
  const n = t13.value.currentNode;
  r();
  const a = t13.value.currentNode;
  n !== a && e("current-change", a ? a.data : null, a);
};
var uu = (t13) => {
  let e = true, r = true, n = true;
  for (let a = 0, i = t13.length; a < i; a++) {
    const o = t13[a];
    (o.checked !== true || o.indeterminate) && (e = false, o.disabled || (n = false)), (o.checked !== false || o.indeterminate) && (r = false);
  }
  return { all: e, none: r, allWithoutDisable: n, half: !e && !r };
};
var Ni = function(t13) {
  if (t13.childNodes.length === 0 || t13.loading)
    return;
  const { all: e, none: r, half: n } = uu(t13.childNodes);
  e ? (t13.checked = true, t13.indeterminate = false) : n ? (t13.checked = false, t13.indeterminate = true) : r && (t13.checked = false, t13.indeterminate = false);
  const a = t13.parent;
  !a || a.level === 0 || t13.store.checkStrictly || Ni(a);
};
var qo = function(t13, e) {
  const r = t13.store.props, n = t13.data || {}, a = r[e];
  if (typeof a == "function")
    return a(n, t13);
  if (typeof a == "string")
    return n[a];
  if (typeof a > "u") {
    const i = n[e];
    return i === void 0 ? "" : i;
  }
};
var yS = 0;
var fa = class _fa {
  constructor(e) {
    this.id = yS++, this.text = null, this.checked = false, this.indeterminate = false, this.data = null, this.expanded = false, this.parent = null, this.visible = true, this.isCurrent = false, this.canFocus = false;
    for (const r in e)
      va(e, r) && (this[r] = e[r]);
    this.level = 0, this.loaded = false, this.childNodes = [], this.loading = false, this.parent && (this.level = this.parent.level + 1);
  }
  initialize() {
    const e = this.store;
    if (!e)
      throw new Error("[Node]store is required!");
    e.registerNode(this);
    const r = e.props;
    if (r && typeof r.isLeaf < "u") {
      const i = qo(this, "isLeaf");
      typeof i == "boolean" && (this.isLeafByUser = i);
    }
    if (e.lazy !== true && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = true, this.canFocus = true)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || Jd(this, this.data), !this.data)
      return;
    const n = e.defaultExpandedKeys, a = e.key;
    a && n && n.includes(this.key) && this.expand(null, e.autoExpandParent), a && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = true), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === true) && (this.canFocus = true);
  }
  setData(e) {
    Array.isArray(e) || Jd(this, e), this.data = e, this.childNodes = [];
    let r;
    this.level === 0 && Array.isArray(this.data) ? r = this.data : r = qo(this, "children") || [];
    for (let n = 0, a = r.length; n < a; n++)
      this.insertChild({ data: r[n] });
  }
  get label() {
    return qo(this, "label");
  }
  get key() {
    const e = this.store.key;
    return this.data ? this.data[e] : null;
  }
  get disabled() {
    return qo(this, "disabled");
  }
  get nextSibling() {
    const e = this.parent;
    if (e) {
      const r = e.childNodes.indexOf(this);
      if (r > -1)
        return e.childNodes[r + 1];
    }
    return null;
  }
  get previousSibling() {
    const e = this.parent;
    if (e) {
      const r = e.childNodes.indexOf(this);
      if (r > -1)
        return r > 0 ? e.childNodes[r - 1] : null;
    }
    return null;
  }
  contains(e, r = true) {
    return (this.childNodes || []).some((n) => n === e || r && n.contains(e));
  }
  remove() {
    const e = this.parent;
    e && e.removeChild(this);
  }
  insertChild(e, r, n) {
    if (!e)
      throw new Error("InsertChild error: child is required.");
    if (!(e instanceof _fa)) {
      if (!n) {
        const a = this.getChildren(true);
        a.includes(e.data) || (typeof r > "u" || r < 0 ? a.push(e.data) : a.splice(r, 0, e.data));
      }
      Object.assign(e, {
        parent: this,
        store: this.store
      }), e = reactive(new _fa(e)), e instanceof _fa && e.initialize();
    }
    e.level = this.level + 1, typeof r > "u" || r < 0 ? this.childNodes.push(e) : this.childNodes.splice(r, 0, e), this.updateLeafState();
  }
  insertBefore(e, r) {
    let n;
    r && (n = this.childNodes.indexOf(r)), this.insertChild(e, n);
  }
  insertAfter(e, r) {
    let n;
    r && (n = this.childNodes.indexOf(r), n !== -1 && (n += 1)), this.insertChild(e, n);
  }
  removeChild(e) {
    const r = this.getChildren() || [], n = r.indexOf(e.data);
    n > -1 && r.splice(n, 1);
    const a = this.childNodes.indexOf(e);
    a > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(a, 1)), this.updateLeafState();
  }
  removeChildByData(e) {
    let r = null;
    for (let n = 0; n < this.childNodes.length; n++)
      if (this.childNodes[n].data === e) {
        r = this.childNodes[n];
        break;
      }
    r && this.removeChild(r);
  }
  expand(e, r) {
    const n = () => {
      if (r) {
        let a = this.parent;
        for (; a.level > 0; )
          a.expanded = true, a = a.parent;
      }
      this.expanded = true, e && e(), this.childNodes.forEach((a) => {
        a.canFocus = true;
      });
    };
    this.shouldLoadData() ? this.loadData((a) => {
      Array.isArray(a) && (this.checked ? this.setChecked(true, true) : this.store.checkStrictly || Ni(this), n());
    }) : n();
  }
  doCreateChildren(e, r = {}) {
    e.forEach((n) => {
      this.insertChild(Object.assign({ data: n }, r), void 0, true);
    });
  }
  collapse() {
    this.expanded = false, this.childNodes.forEach((e) => {
      e.canFocus = false;
    });
  }
  shouldLoadData() {
    return this.store.lazy === true && this.store.load && !this.loaded;
  }
  updateLeafState() {
    if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser < "u") {
      this.isLeaf = this.isLeafByUser;
      return;
    }
    const e = this.childNodes;
    if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
      this.isLeaf = !e || e.length === 0;
      return;
    }
    this.isLeaf = false;
  }
  setChecked(e, r, n, a) {
    if (this.indeterminate = e === "half", this.checked = e === true, this.store.checkStrictly)
      return;
    if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
      const { all: o, allWithoutDisable: s } = uu(this.childNodes);
      !this.isLeaf && !o && s && (this.checked = false, e = false);
      const l = () => {
        if (r) {
          const u = this.childNodes;
          for (let v = 0, h6 = u.length; v < h6; v++) {
            const f = u[v];
            a = a || e !== false;
            const p = f.disabled ? f.checked : a;
            f.setChecked(p, r, true, a);
          }
          const { half: c, all: d } = uu(u);
          d || (this.checked = d, this.indeterminate = c);
        }
      };
      if (this.shouldLoadData()) {
        this.loadData(() => {
          l(), Ni(this);
        }, {
          checked: e !== false
        });
        return;
      } else
        l();
    }
    const i = this.parent;
    !i || i.level === 0 || n || Ni(i);
  }
  getChildren(e = false) {
    if (this.level === 0)
      return this.data;
    const r = this.data;
    if (!r)
      return null;
    const n = this.store.props;
    let a = "children";
    return n && (a = n.children || "children"), r[a] === void 0 && (r[a] = null), e && !r[a] && (r[a] = []), r[a];
  }
  updateChildren() {
    const e = this.getChildren() || [], r = this.childNodes.map((i) => i.data), n = {}, a = [];
    e.forEach((i, o) => {
      const s = i[Ga];
      !!s && r.findIndex((u) => u[Ga] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i });
    }), this.store.lazy || r.forEach((i) => {
      n[i[Ga]] || this.removeChildByData(i);
    }), a.forEach(({ index: i, data: o }) => {
      this.insertChild({ data: o }, i);
    }), this.updateLeafState();
  }
  loadData(e, r = {}) {
    if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) {
      this.loading = true;
      const n = (i) => {
        this.childNodes = [], this.doCreateChildren(i, r), this.loaded = true, this.loading = false, this.updateLeafState(), e && e.call(this, i);
      }, a = () => {
        this.loading = false;
      };
      this.store.load(this, n, a);
    } else
      e && e.call(this);
  }
  eachNode(e) {
    const r = [this];
    for (; r.length; ) {
      const n = r.shift();
      r.unshift(...n.childNodes), e(n);
    }
  }
  reInitChecked() {
    this.store.checkStrictly || Ni(this);
  }
};
var bS = class {
  constructor(e) {
    this.currentNode = null, this.currentNodeKey = null;
    for (const r in e)
      va(e, r) && (this[r] = e[r]);
    this.nodesMap = {};
  }
  initialize() {
    if (this.root = new fa({
      data: this.data,
      store: this
    }), this.root.initialize(), this.lazy && this.load) {
      const e = this.load;
      e(this.root, (r) => {
        this.root.doCreateChildren(r), this._initDefaultCheckedNodes();
      });
    } else
      this._initDefaultCheckedNodes();
  }
  filter(e) {
    const r = this.filterNodeMethod, n = this.lazy, a = function(i) {
      const o = i.root ? i.root.childNodes : i.childNodes;
      if (o.forEach((s) => {
        s.visible = r.call(s, e, s.data, s), a(s);
      }), !i.visible && o.length) {
        let s = true;
        s = !o.some((l) => l.visible), i.root ? i.root.visible = s === false : i.visible = s === false;
      }
      e && i.visible && !i.isLeaf && (!n || i.loaded) && i.expand();
    };
    a(this);
  }
  setData(e) {
    e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren();
  }
  getNode(e) {
    if (e instanceof fa)
      return e;
    const r = Kt(e) ? ic(this.key, e) : e;
    return this.nodesMap[r] || null;
  }
  insertBefore(e, r) {
    const n = this.getNode(r);
    n.parent.insertBefore({ data: e }, n);
  }
  insertAfter(e, r) {
    const n = this.getNode(r);
    n.parent.insertAfter({ data: e }, n);
  }
  remove(e) {
    const r = this.getNode(e);
    r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r));
  }
  append(e, r) {
    const n = Ss(r) ? this.root : this.getNode(r);
    n && n.insertChild({ data: e });
  }
  _initDefaultCheckedNodes() {
    const e = this.defaultCheckedKeys || [], r = this.nodesMap;
    e.forEach((n) => {
      const a = r[n];
      a && a.setChecked(true, !this.checkStrictly);
    });
  }
  _initDefaultCheckedNode(e) {
    (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(true, !this.checkStrictly);
  }
  setDefaultCheckedKey(e) {
    e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes());
  }
  registerNode(e) {
    const r = this.key;
    !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e);
  }
  deregisterNode(e) {
    !this.key || !e || !e.data || (e.childNodes.forEach((n) => {
      this.deregisterNode(n);
    }), delete this.nodesMap[e.key]);
  }
  getCheckedNodes(e = false, r = false) {
    const n = [], a = function(i) {
      (i.root ? i.root.childNodes : i.childNodes).forEach((s) => {
        (s.checked || r && s.indeterminate) && (!e || e && s.isLeaf) && n.push(s.data), a(s);
      });
    };
    return a(this), n;
  }
  getCheckedKeys(e = false) {
    return this.getCheckedNodes(e).map((r) => (r || {})[this.key]);
  }
  getHalfCheckedNodes() {
    const e = [], r = function(n) {
      (n.root ? n.root.childNodes : n.childNodes).forEach((i) => {
        i.indeterminate && e.push(i.data), r(i);
      });
    };
    return r(this), e;
  }
  getHalfCheckedKeys() {
    return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]);
  }
  _getAllNodes() {
    const e = [], r = this.nodesMap;
    for (const n in r)
      va(r, n) && e.push(r[n]);
    return e;
  }
  updateChildren(e, r) {
    const n = this.nodesMap[e];
    if (!n)
      return;
    const a = n.childNodes;
    for (let i = a.length - 1; i >= 0; i--) {
      const o = a[i];
      this.remove(o.data);
    }
    for (let i = 0, o = r.length; i < o; i++) {
      const s = r[i];
      this.append(s, n.data);
    }
  }
  _setCheckedKeys(e, r = false, n) {
    const a = this._getAllNodes().sort((l, u) => l.level - u.level), i = /* @__PURE__ */ Object.create(null), o = Object.keys(n);
    a.forEach((l) => l.setChecked(false, false));
    const s = (l) => {
      l.childNodes.forEach((u) => {
        var c;
        i[u.data[e]] = true, (c = u.childNodes) != null && c.length && s(u);
      });
    };
    for (let l = 0, u = a.length; l < u; l++) {
      const c = a[l], d = c.data[e].toString();
      if (!o.includes(d)) {
        c.checked && !i[d] && c.setChecked(false, false);
        continue;
      }
      if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) {
        c.setChecked(true, false);
        continue;
      }
      if (c.setChecked(true, true), r) {
        c.setChecked(false, false);
        const h6 = function(f) {
          f.childNodes.forEach((m) => {
            m.isLeaf || m.setChecked(false, false), h6(m);
          });
        };
        h6(c);
      }
    }
  }
  setCheckedNodes(e, r = false) {
    const n = this.key, a = {};
    e.forEach((i) => {
      a[(i || {})[n]] = true;
    }), this._setCheckedKeys(n, r, a);
  }
  setCheckedKeys(e, r = false) {
    this.defaultCheckedKeys = e;
    const n = this.key, a = {};
    e.forEach((i) => {
      a[i] = true;
    }), this._setCheckedKeys(n, r, a);
  }
  setDefaultExpandedKeys(e) {
    e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => {
      const n = this.getNode(r);
      n && n.expand(null, this.autoExpandParent);
    });
  }
  setChecked(e, r, n) {
    const a = this.getNode(e);
    a && a.setChecked(!!r, n);
  }
  getCurrentNode() {
    return this.currentNode;
  }
  setCurrentNode(e) {
    const r = this.currentNode;
    r && (r.isCurrent = false), this.currentNode = e, this.currentNode.isCurrent = true;
  }
  setUserCurrentNode(e, r = true) {
    const n = e[this.key], a = this.nodesMap[n];
    this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true);
  }
  setCurrentNodeKey(e, r = true) {
    if (e == null) {
      this.currentNode && (this.currentNode.isCurrent = false), this.currentNode = null;
      return;
    }
    const n = this.getNode(e);
    n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true));
  }
};
var wS = defineComponent({
  name: "ElTreeNodeContent",
  props: {
    node: {
      type: Object,
      required: true
    },
    renderContent: Function
  },
  setup(t13) {
    const e = He("tree"), r = inject("NodeInstance"), n = inject("RootTree");
    return () => {
      const a = t13.node, { data: i, store: o } = a;
      return t13.renderContent ? t13.renderContent(h, { _self: r, node: a, data: i, store: o }) : renderSlot(n.ctx.slots, "default", { node: a, data: i }, () => [
        h("span", { class: e.be("node", "label") }, [a.label])
      ]);
    };
  }
});
var CS = Ve(wS, [["__file", "tree-node-content.vue"]]);
function qh(t13) {
  const e = inject("TreeNodeMap", null), r = {
    treeNodeExpand: (n) => {
      t13.node !== n && t13.node.collapse();
    },
    children: []
  };
  return e && e.children.push(r), provide("TreeNodeMap", r), {
    broadcastExpanded: (n) => {
      if (t13.accordion)
        for (const a of r.children)
          a.treeNodeExpand(n);
    }
  };
}
var Uh = Symbol("dragEvents");
function xS({ props: t13, ctx: e, el$: r, dropIndicator$: n, store: a }) {
  const i = He("tree"), o = ref({
    showDropIndicator: false,
    draggingNode: null,
    dropNode: null,
    allowDrop: true,
    dropType: null
  });
  return provide(Uh, {
    treeNodeDragStart: ({ event: c, treeNode: d }) => {
      if (typeof t13.allowDrag == "function" && !t13.allowDrag(d.node))
        return c.preventDefault(), false;
      c.dataTransfer.effectAllowed = "move";
      try {
        c.dataTransfer.setData("text/plain", "");
      } catch {
      }
      o.value.draggingNode = d, e.emit("node-drag-start", d.node, c);
    },
    treeNodeDragOver: ({ event: c, treeNode: d }) => {
      const v = d, h6 = o.value.dropNode;
      h6 && h6.node.id !== v.node.id && ca(h6.$el, i.is("drop-inner"));
      const f = o.value.draggingNode;
      if (!f || !v)
        return;
      let p = true, m = true, g = true, y = true;
      typeof t13.allowDrop == "function" && (p = t13.allowDrop(f.node, v.node, "prev"), y = m = t13.allowDrop(f.node, v.node, "inner"), g = t13.allowDrop(f.node, v.node, "next")), c.dataTransfer.dropEffect = m || p || g ? "move" : "none", (p || m || g) && (h6 == null ? void 0 : h6.node.id) !== v.node.id && (h6 && e.emit("node-drag-leave", f.node, h6.node, c), e.emit("node-drag-enter", f.node, v.node, c)), p || m || g ? o.value.dropNode = v : o.value.dropNode = null, v.node.nextSibling === f.node && (g = false), v.node.previousSibling === f.node && (p = false), v.node.contains(f.node, false) && (m = false), (f.node === v.node || f.node.contains(v.node)) && (p = false, m = false, g = false);
      const b = v.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect();
      let C;
      const E = p ? m ? 0.25 : g ? 0.45 : 1 : -1, x = g ? m ? 0.75 : p ? 0.55 : 0 : 1;
      let T = -9999;
      const k = c.clientY - b.top;
      k < b.height * E ? C = "before" : k > b.height * x ? C = "after" : m ? C = "inner" : C = "none";
      const _ = v.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), D = n.value;
      C === "before" ? T = _.top - w.top : C === "after" && (T = _.bottom - w.top), D.style.top = `${T}px`, D.style.left = `${_.right - w.left}px`, C === "inner" ? tu(v.$el, i.is("drop-inner")) : ca(v.$el, i.is("drop-inner")), o.value.showDropIndicator = C === "before" || C === "after", o.value.allowDrop = o.value.showDropIndicator || y, o.value.dropType = C, e.emit("node-drag-over", f.node, v.node, c);
    },
    treeNodeDragEnd: (c) => {
      const { draggingNode: d, dropType: v, dropNode: h6 } = o.value;
      if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h6) {
        const f = { data: d.node.data };
        v !== "none" && d.node.remove(), v === "before" ? h6.node.parent.insertBefore(f, h6.node) : v === "after" ? h6.node.parent.insertAfter(f, h6.node) : v === "inner" && h6.node.insertChild(f), v !== "none" && (a.value.registerNode(f), a.value.key && d.node.eachNode((p) => {
          var m;
          (m = a.value.nodesMap[p.data[a.value.key]]) == null || m.setChecked(p.checked, !a.value.checkStrictly);
        })), ca(h6.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h6.node, v, c), v !== "none" && e.emit("node-drop", d.node, h6.node, v, c);
      }
      d && !h6 && e.emit("node-drag-end", d.node, null, v, c), o.value.showDropIndicator = false, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = true;
    }
  }), {
    dragState: o
  };
}
var ES = defineComponent({
  name: "ElTreeNode",
  components: {
    ElCollapseTransition: tk,
    ElCheckbox: BE,
    NodeContent: CS,
    ElIcon: Ht,
    Loading: Ru
  },
  props: {
    node: {
      type: fa,
      default: () => ({})
    },
    props: {
      type: Object,
      default: () => ({})
    },
    accordion: Boolean,
    renderContent: Function,
    renderAfterExpand: Boolean,
    showCheckbox: {
      type: Boolean,
      default: false
    }
  },
  emits: ["node-expand"],
  setup(t13, e) {
    const r = He("tree"), { broadcastExpanded: n } = qh(t13), a = inject("RootTree"), i = ref(false), o = ref(false), s = ref(null), l = ref(null), u = ref(null), c = inject(Uh), d = getCurrentInstance();
    provide("NodeInstance", d), a || Dt("Tree", "Can not find node's tree."), t13.node.expanded && (i.value = true, o.value = true);
    const v = a.props.props.children || "children";
    watch(() => {
      const k = t13.node.data[v];
      return k && [...k];
    }, () => {
      t13.node.updateChildren();
    }), watch(() => t13.node.indeterminate, (k) => {
      p(t13.node.checked, k);
    }), watch(() => t13.node.checked, (k) => {
      p(k, t13.node.indeterminate);
    }), watch(() => t13.node.childNodes.length, () => t13.node.reInitChecked()), watch(() => t13.node.expanded, (k) => {
      nextTick(() => i.value = k), k && (o.value = true);
    });
    const h6 = (k) => ic(a.props.nodeKey, k.data), f = (k) => {
      const _ = t13.props.class;
      if (!_)
        return {};
      let D;
      if (lr(_)) {
        const { data: O } = k;
        D = _(O, k);
      } else
        D = _;
      return tr(D) ? { [D]: true } : D;
    }, p = (k, _) => {
      (s.value !== k || l.value !== _) && a.ctx.emit("check-change", t13.node.data, k, _), s.value = k, l.value = _;
    }, m = (k) => {
      lu(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t13.node)), a.currentNode.value = t13.node, a.props.expandOnClickNode && y(), a.props.checkOnClickNode && !t13.node.disabled && b(null, {
        target: { checked: !t13.node.checked }
      }), a.ctx.emit("node-click", t13.node.data, t13.node, d, k);
    }, g = (k) => {
      a.instance.vnode.props.onNodeContextmenu && (k.stopPropagation(), k.preventDefault()), a.ctx.emit("node-contextmenu", k, t13.node.data, t13.node, d);
    }, y = () => {
      t13.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t13.node.data, t13.node, d), t13.node.collapse()) : t13.node.expand(() => {
        e.emit("node-expand", t13.node.data, t13.node, d);
      }));
    }, b = (k, _) => {
      t13.node.setChecked(_.target.checked, !a.props.checkStrictly), nextTick(() => {
        const D = a.store.value;
        a.ctx.emit("check", t13.node.data, {
          checkedNodes: D.getCheckedNodes(),
          checkedKeys: D.getCheckedKeys(),
          halfCheckedNodes: D.getHalfCheckedNodes(),
          halfCheckedKeys: D.getHalfCheckedKeys()
        });
      });
    };
    return {
      ns: r,
      node$: u,
      tree: a,
      expanded: i,
      childNodeRendered: o,
      oldChecked: s,
      oldIndeterminate: l,
      getNodeKey: h6,
      getNodeClass: f,
      handleSelectChange: p,
      handleClick: m,
      handleContextMenu: g,
      handleExpandIconClick: y,
      handleCheckChange: b,
      handleChildNodeExpand: (k, _, D) => {
        n(_), a.ctx.emit("node-expand", k, _, D);
      },
      handleDragStart: (k) => {
        a.props.draggable && c.treeNodeDragStart({ event: k, treeNode: t13 });
      },
      handleDragOver: (k) => {
        k.preventDefault(), a.props.draggable && c.treeNodeDragOver({
          event: k,
          treeNode: { $el: u.value, node: t13.node }
        });
      },
      handleDrop: (k) => {
        k.preventDefault();
      },
      handleDragEnd: (k) => {
        a.props.draggable && c.treeNodeDragEnd(k);
      },
      CaretRight: s2
    };
  }
});
function kS(t13, e, r, n, a, i) {
  const o = resolveComponent("el-icon"), s = resolveComponent("el-checkbox"), l = resolveComponent("loading"), u = resolveComponent("node-content"), c = resolveComponent("el-tree-node"), d = resolveComponent("el-collapse-transition");
  return withDirectives((openBlock(), createElementBlock("div", {
    ref: "node$",
    class: normalizeClass([
      t13.ns.b("node"),
      t13.ns.is("expanded", t13.expanded),
      t13.ns.is("current", t13.node.isCurrent),
      t13.ns.is("hidden", !t13.node.visible),
      t13.ns.is("focusable", !t13.node.disabled),
      t13.ns.is("checked", !t13.node.disabled && t13.node.checked),
      t13.getNodeClass(t13.node)
    ]),
    role: "treeitem",
    tabindex: "-1",
    "aria-expanded": t13.expanded,
    "aria-disabled": t13.node.disabled,
    "aria-checked": t13.node.checked,
    draggable: t13.tree.props.draggable,
    "data-key": t13.getNodeKey(t13.node),
    onClick: withModifiers(t13.handleClick, ["stop"]),
    onContextmenu: t13.handleContextMenu,
    onDragstart: withModifiers(t13.handleDragStart, ["stop"]),
    onDragover: withModifiers(t13.handleDragOver, ["stop"]),
    onDragend: withModifiers(t13.handleDragEnd, ["stop"]),
    onDrop: withModifiers(t13.handleDrop, ["stop"])
  }, [
    createBaseVNode("div", {
      class: normalizeClass(t13.ns.be("node", "content")),
      style: normalizeStyle({ paddingLeft: (t13.node.level - 1) * t13.tree.props.indent + "px" })
    }, [
      t13.tree.props.icon || t13.CaretRight ? (openBlock(), createBlock(o, {
        key: 0,
        class: normalizeClass([
          t13.ns.be("node", "expand-icon"),
          t13.ns.is("leaf", t13.node.isLeaf),
          {
            expanded: !t13.node.isLeaf && t13.expanded
          }
        ]),
        onClick: withModifiers(t13.handleExpandIconClick, ["stop"])
      }, {
        default: withCtx(() => [
          (openBlock(), createBlock(resolveDynamicComponent(t13.tree.props.icon || t13.CaretRight)))
        ]),
        _: 1
      }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
      t13.showCheckbox ? (openBlock(), createBlock(s, {
        key: 1,
        "model-value": t13.node.checked,
        indeterminate: t13.node.indeterminate,
        disabled: !!t13.node.disabled,
        onClick: withModifiers(() => {
        }, ["stop"]),
        onChange: t13.handleCheckChange
      }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : createCommentVNode("v-if", true),
      t13.node.loading ? (openBlock(), createBlock(o, {
        key: 2,
        class: normalizeClass([t13.ns.be("node", "loading-icon"), t13.ns.is("loading")])
      }, {
        default: withCtx(() => [
          createVNode(l)
        ]),
        _: 1
      }, 8, ["class"])) : createCommentVNode("v-if", true),
      createVNode(u, {
        node: t13.node,
        "render-content": t13.renderContent
      }, null, 8, ["node", "render-content"])
    ], 6),
    createVNode(d, null, {
      default: withCtx(() => [
        !t13.renderAfterExpand || t13.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(t13.ns.be("node", "children")),
          role: "group",
          "aria-expanded": t13.expanded
        }, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(t13.node.childNodes, (v) => (openBlock(), createBlock(c, {
            key: t13.getNodeKey(v),
            "render-content": t13.renderContent,
            "render-after-expand": t13.renderAfterExpand,
            "show-checkbox": t13.showCheckbox,
            node: v,
            accordion: t13.accordion,
            props: t13.props,
            onNodeExpand: t13.handleChildNodeExpand
          }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128))
        ], 10, ["aria-expanded"])), [
          [vShow, t13.expanded]
        ]) : createCommentVNode("v-if", true)
      ]),
      _: 1
    })
  ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [
    [vShow, t13.node.visible]
  ]);
}
var SS = Ve(ES, [["render", kS], ["__file", "tree-node.vue"]]);
function TS({ el$: t13 }, e) {
  const r = He("tree"), n = shallowRef([]), a = shallowRef([]);
  onMounted(() => {
    o();
  }), onUpdated(() => {
    n.value = Array.from(t13.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]"));
  }), watch(a, (s) => {
    s.forEach((l) => {
      l.setAttribute("tabindex", "-1");
    });
  }), kr(t13, "keydown", (s) => {
    const l = s.target;
    if (!l.className.includes(r.b("node")))
      return;
    const u = s.code;
    n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));
    const c = n.value.indexOf(l);
    let d;
    if ([Lt.up, Lt.down].includes(u)) {
      if (s.preventDefault(), u === Lt.up) {
        d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1;
        const h6 = d;
        for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) {
          if (d--, d === h6) {
            d = -1;
            break;
          }
          d < 0 && (d = n.value.length - 1);
        }
      } else {
        d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0;
        const h6 = d;
        for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) {
          if (d++, d === h6) {
            d = -1;
            break;
          }
          d >= n.value.length && (d = 0);
        }
      }
      d !== -1 && n.value[d].focus();
    }
    [Lt.left, Lt.right].includes(u) && (s.preventDefault(), l.click());
    const v = l.querySelector('[type="checkbox"]');
    [Lt.enter, Lt.space].includes(u) && v && (s.preventDefault(), v.click());
  });
  const o = () => {
    var s;
    n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]"));
    const l = t13.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);
    if (l.length) {
      l[0].setAttribute("tabindex", "0");
      return;
    }
    (s = n.value[0]) == null || s.setAttribute("tabindex", "0");
  };
}
var _S = defineComponent({
  name: "ElTree",
  components: { ElTreeNode: SS },
  props: {
    data: {
      type: Array,
      default: () => []
    },
    emptyText: {
      type: String
    },
    renderAfterExpand: {
      type: Boolean,
      default: true
    },
    nodeKey: String,
    checkStrictly: Boolean,
    defaultExpandAll: Boolean,
    expandOnClickNode: {
      type: Boolean,
      default: true
    },
    checkOnClickNode: Boolean,
    checkDescendants: {
      type: Boolean,
      default: false
    },
    autoExpandParent: {
      type: Boolean,
      default: true
    },
    defaultCheckedKeys: Array,
    defaultExpandedKeys: Array,
    currentNodeKey: [String, Number],
    renderContent: Function,
    showCheckbox: {
      type: Boolean,
      default: false
    },
    draggable: {
      type: Boolean,
      default: false
    },
    allowDrag: Function,
    allowDrop: Function,
    props: {
      type: Object,
      default: () => ({
        children: "children",
        label: "label",
        disabled: "disabled"
      })
    },
    lazy: {
      type: Boolean,
      default: false
    },
    highlightCurrent: Boolean,
    load: Function,
    filterNodeMethod: Function,
    accordion: Boolean,
    indent: {
      type: Number,
      default: 18
    },
    icon: {
      type: Hn
    }
  },
  emits: [
    "check-change",
    "current-change",
    "node-click",
    "node-contextmenu",
    "node-collapse",
    "node-expand",
    "check",
    "node-drag-start",
    "node-drag-end",
    "node-drop",
    "node-drag-leave",
    "node-drag-enter",
    "node-drag-over"
  ],
  setup(t13, e) {
    const { t: r } = yo(), n = He("tree"), a = inject(To, null), i = ref(new bS({
      key: t13.nodeKey,
      data: t13.data,
      lazy: t13.lazy,
      props: t13.props,
      load: t13.load,
      currentNodeKey: t13.currentNodeKey,
      checkStrictly: t13.checkStrictly,
      checkDescendants: t13.checkDescendants,
      defaultCheckedKeys: t13.defaultCheckedKeys,
      defaultExpandedKeys: t13.defaultExpandedKeys,
      autoExpandParent: t13.autoExpandParent,
      defaultExpandAll: t13.defaultExpandAll,
      filterNodeMethod: t13.filterNodeMethod
    }));
    i.value.initialize();
    const o = ref(i.value.root), s = ref(null), l = ref(null), u = ref(null), { broadcastExpanded: c } = qh(t13), { dragState: d } = xS({
      props: t13,
      ctx: e,
      el$: l,
      dropIndicator$: u,
      store: i
    });
    TS({ el$: l }, i);
    const v = computed(() => {
      const { childNodes: F } = o.value, $ = a ? a.hasFilteredOptions !== 0 : false;
      return (!F || F.length === 0 || F.every(({ visible: U }) => !U)) && !$;
    });
    watch(() => t13.currentNodeKey, (F) => {
      i.value.setCurrentNodeKey(F);
    }), watch(() => t13.defaultCheckedKeys, (F) => {
      i.value.setDefaultCheckedKey(F);
    }), watch(() => t13.defaultExpandedKeys, (F) => {
      i.value.setDefaultExpandedKeys(F);
    }), watch(() => t13.data, (F) => {
      i.value.setData(F);
    }, { deep: true }), watch(() => t13.checkStrictly, (F) => {
      i.value.checkStrictly = F;
    });
    const h6 = (F) => {
      if (!t13.filterNodeMethod)
        throw new Error("[Tree] filterNodeMethod is required when filter");
      i.value.filter(F);
    }, f = (F) => ic(t13.nodeKey, F.data), p = (F) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in getNodePath");
      const $ = i.value.getNode(F);
      if (!$)
        return [];
      const U = [$.data];
      let H = $.parent;
      for (; H && H !== o.value; )
        U.push(H.data), H = H.parent;
      return U.reverse();
    }, m = (F, $) => i.value.getCheckedNodes(F, $), g = (F) => i.value.getCheckedKeys(F), y = () => {
      const F = i.value.getCurrentNode();
      return F ? F.data : null;
    }, b = () => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in getCurrentKey");
      const F = y();
      return F ? F[t13.nodeKey] : null;
    }, w = (F, $) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCheckedNodes");
      i.value.setCheckedNodes(F, $);
    }, C = (F, $) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCheckedKeys");
      i.value.setCheckedKeys(F, $);
    }, E = (F, $, U) => {
      i.value.setChecked(F, $, U);
    }, x = () => i.value.getHalfCheckedNodes(), T = () => i.value.getHalfCheckedKeys(), k = (F, $ = true) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCurrentNode");
      lu(i, e.emit, () => {
        c(F), i.value.setUserCurrentNode(F, $);
      });
    }, _ = (F, $ = true) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCurrentKey");
      lu(i, e.emit, () => {
        c(), i.value.setCurrentNodeKey(F, $);
      });
    }, D = (F) => i.value.getNode(F), O = (F) => {
      i.value.remove(F);
    }, A = (F, $) => {
      i.value.append(F, $);
    }, L = (F, $) => {
      i.value.insertBefore(F, $);
    }, N = (F, $) => {
      i.value.insertAfter(F, $);
    }, I = (F, $, U) => {
      c($), e.emit("node-expand", F, $, U);
    }, M = (F, $) => {
      if (!t13.nodeKey)
        throw new Error("[Tree] nodeKey is required in updateKeyChild");
      i.value.updateChildren(F, $);
    };
    return provide("RootTree", {
      ctx: e,
      props: t13,
      store: i,
      root: o,
      currentNode: s,
      instance: getCurrentInstance()
    }), provide(eo, void 0), {
      ns: n,
      store: i,
      root: o,
      currentNode: s,
      dragState: d,
      el$: l,
      dropIndicator$: u,
      isEmpty: v,
      filter: h6,
      getNodeKey: f,
      getNodePath: p,
      getCheckedNodes: m,
      getCheckedKeys: g,
      getCurrentNode: y,
      getCurrentKey: b,
      setCheckedNodes: w,
      setCheckedKeys: C,
      setChecked: E,
      getHalfCheckedNodes: x,
      getHalfCheckedKeys: T,
      setCurrentNode: k,
      setCurrentKey: _,
      t: r,
      getNode: D,
      remove: O,
      append: A,
      insertBefore: L,
      insertAfter: N,
      handleNodeExpand: I,
      updateKeyChildren: M
    };
  }
});
function DS(t13, e, r, n, a, i) {
  const o = resolveComponent("el-tree-node");
  return openBlock(), createElementBlock("div", {
    ref: "el$",
    class: normalizeClass([
      t13.ns.b(),
      t13.ns.is("dragging", !!t13.dragState.draggingNode),
      t13.ns.is("drop-not-allow", !t13.dragState.allowDrop),
      t13.ns.is("drop-inner", t13.dragState.dropType === "inner"),
      { [t13.ns.m("highlight-current")]: t13.highlightCurrent }
    ]),
    role: "tree"
  }, [
    (openBlock(true), createElementBlock(Fragment, null, renderList(t13.root.childNodes, (s) => (openBlock(), createBlock(o, {
      key: t13.getNodeKey(s),
      node: s,
      props: t13.props,
      accordion: t13.accordion,
      "render-after-expand": t13.renderAfterExpand,
      "show-checkbox": t13.showCheckbox,
      "render-content": t13.renderContent,
      onNodeExpand: t13.handleNodeExpand
    }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)),
    t13.isEmpty ? (openBlock(), createElementBlock("div", {
      key: 0,
      class: normalizeClass(t13.ns.e("empty-block"))
    }, [
      renderSlot(t13.$slots, "empty", {}, () => {
        var s;
        return [
          createBaseVNode("span", {
            class: normalizeClass(t13.ns.e("empty-text"))
          }, toDisplayString((s = t13.emptyText) != null ? s : t13.t("el.tree.emptyText")), 3)
        ];
      })
    ], 2)) : createCommentVNode("v-if", true),
    withDirectives(createBaseVNode("div", {
      ref: "dropIndicator$",
      class: normalizeClass(t13.ns.e("drop-indicator"))
    }, null, 2), [
      [vShow, t13.dragState.showDropIndicator]
    ])
  ], 2);
}
var PS = Ve(_S, [["render", DS], ["__file", "tree.vue"]]);
var OS = $t(PS);
function LS(t13) {
  let e;
  const r = ref(false), n = reactive({
    ...t13,
    originalPosition: "",
    originalOverflow: "",
    visible: false
  });
  function a(v) {
    n.text = v;
  }
  function i() {
    const v = n.parent, h6 = d.ns;
    if (!v.vLoadingAddClassList) {
      let f = v.getAttribute("loading-number");
      f = Number.parseInt(f) - 1, f ? v.setAttribute("loading-number", f.toString()) : (ca(v, h6.bm("parent", "relative")), v.removeAttribute("loading-number")), ca(v, h6.bm("parent", "hidden"));
    }
    o(), c.unmount();
  }
  function o() {
    var v, h6;
    (h6 = (v = d.$el) == null ? void 0 : v.parentNode) == null || h6.removeChild(d.$el);
  }
  function s() {
    var v;
    t13.beforeClose && !t13.beforeClose() || (r.value = true, clearTimeout(e), e = setTimeout(l, 400), n.visible = false, (v = t13.closed) == null || v.call(t13));
  }
  function l() {
    if (!r.value)
      return;
    const v = n.parent;
    r.value = false, v.vLoadingAddClassList = void 0, i();
  }
  const u = defineComponent({
    name: "ElLoading",
    setup(v, { expose: h6 }) {
      const { ns: f, zIndex: p } = pC("loading");
      return h6({
        ns: f,
        zIndex: p
      }), () => {
        const m = n.spinner || n.svg, g = h("svg", {
          class: "circular",
          viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50",
          ...m ? { innerHTML: m } : {}
        }, [
          h("circle", {
            class: "path",
            cx: "25",
            cy: "25",
            r: "20",
            fill: "none"
          })
        ]), y = n.text ? h("p", { class: f.b("text") }, [n.text]) : void 0;
        return h(Transition, {
          name: f.b("fade"),
          onAfterLeave: l
        }, {
          default: withCtx(() => [
            withDirectives(createVNode("div", {
              style: {
                backgroundColor: n.background || ""
              },
              class: [
                f.b("mask"),
                n.customClass,
                n.fullscreen ? "is-fullscreen" : ""
              ]
            }, [
              h("div", {
                class: f.b("spinner")
              }, [g, y])
            ]), [[vShow, n.visible]])
          ])
        });
      };
    }
  }), c = createApp(u), d = c.mount(document.createElement("div"));
  return {
    ...toRefs(n),
    setText: a,
    removeElLoadingChild: o,
    close: s,
    handleAfterLeave: l,
    vm: d,
    get $el() {
      return d.$el;
    }
  };
}
var Uo;
var IS = function(t13 = {}) {
  if (!_t)
    return;
  const e = AS(t13);
  if (e.fullscreen && Uo)
    return Uo;
  const r = LS({
    ...e,
    closed: () => {
      var a;
      (a = e.closed) == null || a.call(e), e.fullscreen && (Uo = void 0);
    }
  });
  FS(e, e.parent, r), ef(e, e.parent, r), e.parent.vLoadingAddClassList = () => ef(e, e.parent, r);
  let n = e.parent.getAttribute("loading-number");
  return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(r.$el), nextTick(() => r.visible.value = e.visible), e.fullscreen && (Uo = r), r;
};
var AS = (t13) => {
  var e, r, n, a;
  let i;
  return tr(t13.target) ? i = (e = document.querySelector(t13.target)) != null ? e : document.body : i = t13.target || document.body, {
    parent: i === document.body || t13.body ? document.body : i,
    background: t13.background || "",
    svg: t13.svg || "",
    svgViewBox: t13.svgViewBox || "",
    spinner: t13.spinner || false,
    text: t13.text || "",
    fullscreen: i === document.body && ((r = t13.fullscreen) != null ? r : true),
    lock: (n = t13.lock) != null ? n : false,
    customClass: t13.customClass || "",
    visible: (a = t13.visible) != null ? a : true,
    beforeClose: t13.beforeClose,
    closed: t13.closed,
    target: i
  };
};
var FS = async (t13, e, r) => {
  const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {};
  if (t13.fullscreen)
    r.originalPosition.value = Pi(document.body, "position"), r.originalOverflow.value = Pi(document.body, "overflow"), a.zIndex = n();
  else if (t13.parent === document.body) {
    r.originalPosition.value = Pi(document.body, "position"), await nextTick();
    for (const i of ["top", "left"]) {
      const o = i === "top" ? "scrollTop" : "scrollLeft";
      a[i] = `${t13.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Pi(document.body, `margin-${i}`), 10)}px`;
    }
    for (const i of ["height", "width"])
      a[i] = `${t13.target.getBoundingClientRect()[i]}px`;
  } else
    r.originalPosition.value = Pi(e, "position");
  for (const [i, o] of Object.entries(a))
    r.$el.style[i] = o;
};
var ef = (t13, e, r) => {
  const n = r.vm.ns || r.vm._.exposed.ns;
  ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? ca(e, n.bm("parent", "relative")) : tu(e, n.bm("parent", "relative")), t13.fullscreen && t13.lock ? tu(e, n.bm("parent", "hidden")) : ca(e, n.bm("parent", "hidden"));
};
var ls = Symbol("ElLoading");
var tf = (t13, e) => {
  var r, n, a, i;
  const o = e.instance, s = (v) => Kt(e.value) ? e.value[v] : void 0, l = (v) => {
    const h6 = tr(v) && (o == null ? void 0 : o[v]) || v;
    return h6 && ref(h6);
  }, u = (v) => l(s(v) || t13.getAttribute(`element-loading-${o0(v)}`)), c = (r = s("fullscreen")) != null ? r : e.modifiers.fullscreen, d = {
    text: u("text"),
    svg: u("svg"),
    svgViewBox: u("svgViewBox"),
    spinner: u("spinner"),
    background: u("background"),
    customClass: u("customClass"),
    fullscreen: c,
    target: (n = s("target")) != null ? n : c ? void 0 : t13,
    body: (a = s("body")) != null ? a : e.modifiers.body,
    lock: (i = s("lock")) != null ? i : e.modifiers.lock
  };
  t13[ls] = {
    options: d,
    instance: IS(d)
  };
};
var MS = (t13, e) => {
  for (const r of Object.keys(e))
    isRef(e[r]) && (e[r].value = t13[r]);
};
var oc = {
  mounted(t13, e) {
    e.value && tf(t13, e);
  },
  updated(t13, e) {
    const r = t13[ls];
    e.oldValue !== e.value && (e.value && !e.oldValue ? tf(t13, e) : e.value && e.oldValue ? Kt(e.value) && MS(e.value, r.options) : r == null || r.instance.close());
  },
  unmounted(t13) {
    var e;
    (e = t13[ls]) == null || e.instance.close(), t13[ls] = null;
  }
};
var Ur = (t13, e) => {
  const r = t13.__vccOpts || t13;
  for (const [n, a] of e)
    r[n] = a;
  return r;
};
var BS = "Copy to clipboard";
var NS = "Copied!";
var RS = "#8300bf";
var $S = {
  name: "CopyToClipboard",
  props: {
    content: {
      type: String,
      default: ""
    },
    label: {
      type: String,
      default: BS
    },
    /**
     * `theme: light` will show white button,
     * to use when the button is over other readable text content.
     * Default button is transparent.
     */
    theme: {
      type: String,
      default: ""
    }
  },
  data: function() {
    return {
      textLabel: this.label,
      autoHideTimeout: 0,
      iconColor: RS,
      tooltipContainer: null
    };
  },
  mounted() {
    const t13 = document.querySelector(".mapcontent");
    t13 ? this.tooltipContainer = t13 : this.tooltipContainer = document.body;
  },
  methods: {
    copyToClipboard: async function() {
      let t13 = true;
      this.autoHideTimeout = 600;
      try {
        const e = this.content.replaceAll(`
`, ""), r = document.createElement("div");
        r.innerHTML = this.content;
        const n = r.textContent || r.innerText || "", a = new Blob([e], { type: "text/html" }), i = new Blob([n], { type: "text/plain" }), o = new ClipboardItem({
          "text/html": a,
          "text/plain": i
        });
        await navigator.clipboard.write([o]);
      } catch (e) {
        console.error(
          "Error when trying to use navigator.clipboard.write()",
          e
        ), t13 = false;
      }
      t13 ? this.textLabel = NS : this.textLabel = "Error trying to copy to clipboard!";
    },
    resetSettings: function() {
      this.autoHideTimeout = 0, this.textLabel = this.label;
    }
  }
};
var zS = { class: "visually-hidden" };
function VS(t13, e, r, n, a, i) {
  const o = v2, s = Ht, l = Hr, u = ko;
  return openBlock(), createBlock(u, {
    content: t13.textLabel,
    placement: "bottom",
    "hide-after": t13.autoHideTimeout,
    effect: "clipboard-tooltip",
    onHide: i.resetSettings,
    teleported: true,
    "append-to": t13.tooltipContainer
  }, {
    default: withCtx(() => [
      createVNode(l, {
        class: normalizeClass(["copy-clipboard-button", r.theme]),
        size: "small",
        onClick: i.copyToClipboard
      }, {
        default: withCtx(() => [
          createVNode(s, { color: t13.iconColor }, {
            default: withCtx(() => [
              createVNode(o)
            ]),
            _: 1
          }, 8, ["color"]),
          createBaseVNode("span", zS, toDisplayString(t13.textLabel), 1)
        ]),
        _: 1
      }, 8, ["class", "onClick"])
    ]),
    _: 1
  }, 8, ["content", "hide-after", "onHide", "append-to"]);
}
var Gh = Ur($S, [["render", VS], ["__scopeId", "data-v-08b3bab3"]]);
var HS = {
  name: "AnnotationPopup",
  props: {
    annotationEntry: {
      type: Object
    }
  },
  inject: ["$annotator", "userApiKey"],
  data: function() {
    return {
      displayPair: {
        "Feature ID": "featureId",
        Label: "label",
        Ontology: "models",
        Name: "name",
        Resource: "resourceId"
      },
      editing: false,
      evidencePrefixes: [
        { value: "DOI:", label: "DOI:" },
        { value: "PMID:", label: "PMID:" },
        { value: "", label: "Other:" }
      ],
      evidencePrefix: "DOI:",
      evidence: [],
      authenticated: false,
      newEvidence: "",
      comment: "",
      prevSubs: [],
      showSubmissions: true,
      errorMessage: "",
      creator: void 0,
      copyContent: ""
    };
  },
  computed: {
    isEditable: function() {
      return this.annotationEntry.resourceId && this.annotationEntry.featureId;
    },
    isPositionUpdated: function() {
      return this.annotationEntry.resourceId && this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated;
    },
    isDeleted: function() {
      return this.annotationEntry.resourceId && this.annotationEntry.type === "deleted";
    },
    ontologyLink: function() {
      const t13 = this.annotationEntry.models;
      if (t13 && t13.startsWith("UBERON"))
        return `http://purl.obolibrary.org/obo/${this.annotationEntry.models.replace(":", "_")}`;
    },
    updatedCopyContent: function() {
      return this.getUpdateCopyContent();
    }
  },
  methods: {
    processEvidences: function(t13) {
      var r;
      const e = [];
      return (r = t13 == null ? void 0 : t13.body) != null && r.evidence && t13.body.evidence.forEach((n) => {
        if (typeof n == "object")
          e.push(n);
        else {
          const a = {};
          if (n.includes("https://doi.org/")) {
            const i = n.replace("https://doi.org/", "DOI:");
            a[i] = n;
          } else if (n.includes("https://pubmed.ncbi.nlm.nih.gov/")) {
            const i = n.replace("https://pubmed.ncbi.nlm.nih.gov/", "PMID:");
            a[i] = n;
          }
          Object.keys(a).length > 0 ? e.push(a) : e.push(n);
        }
      }), e;
    },
    evidenceEntered: function(t13) {
      t13 && (this.evidence.push(this.evidencePrefix + t13), this.newEvidence = "");
    },
    formatTime: function(t13) {
      const e = {
        year: "numeric",
        month: "long",
        day: "numeric",
        hour: "numeric",
        minute: "numeric",
        second: "numeric"
      };
      return new Date(t13).toLocaleDateString(void 0, e);
    },
    updatePrevSubmissions: function() {
      var t13;
      this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t13 = this.$annotator) == null || t13.itemAnnotations(
        this.userApiKey,
        this.annotationEntry.resourceId,
        this.annotationEntry.featureId
      ).then((e) => {
        this.prevSubs = e;
      }).catch((e) => {
        console.log(e);
      }));
    },
    submit: function() {
      var t13;
      if (this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.annotationEntry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.annotationEntry.resourceId && this.annotationEntry.featureId) {
        const e = [];
        this.evidence.forEach((n) => {
          if (n.includes("DOI:")) {
            const a = n.replace("DOI:", "https://doi.org/");
            e.push(new URL(a));
          } else if (n.includes("PMID:")) {
            const a = n.replace(
              "PMID:",
              "https://pubmed.ncbi.nlm.nih.gov/"
            );
            e.push(new URL(a));
          } else
            e.push(n);
        });
        const r = {
          resource: this.annotationEntry.resourceId,
          item: Object.assign(
            { id: this.annotationEntry.featureId },
            Object.fromEntries(
              Object.entries(this.annotationEntry).filter(
                ([n]) => ["label", "models"].includes(n)
              )
            )
          ),
          body: {
            evidence: e,
            comment: this.comment
          },
          feature: this.annotationEntry.feature
        };
        Object.assign(r.body, this.annotationEntry.body), this.annotationEntry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t13 = this.$annotator) == null || t13.addAnnotation(this.userApiKey, r).then(() => {
          this.$emit("annotation", r), this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions();
        }).catch(() => {
          this.errorMessage = "There is a problem with the submission, please try again later";
        });
      }
    },
    removeEvidence: function(t13) {
      this.evidence.splice(t13, 1);
    },
    resetSubmission: function() {
      this.editing = false, this.evidence = [], this.newFeature = "", this.comment = "";
    },
    getUpdateCopyContent: function() {
      if (!this.annotationEntry)
        return "";
      const t13 = [];
      if (this.annotationEntry.featureId && t13.push(`<div><strong>Feature ID:</strong>${this.annotationEntry.featureId}</div>`), this.annotationEntry.label && t13.push(`<div><strong>Label:</strong>${this.annotationEntry.label}</div>`), this.annotationEntry.models && (t13.push(`<div><strong>Ontology:</strong>${this.annotationEntry.models}</div>`), this.ontologyLink && t13.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)), this.annotationEntry.resourceId && t13.push(`<div><strong>Resource:</strong>${this.annotationEntry.resourceId}</div>`), this.prevSubs.length) {
        let e = `<div><strong>Annotations:</strong></div>
<br>`;
        this.prevSubs.map((r, n) => {
          if (e += `<div><strong>Created:</strong>${this.formatTime(r.created)}</div>
<br>`, e += `<div><strong>Creator:</strong>${r.creator.name}</div>
<br>`, e += `<div><strong>Email:</strong>${r.creator.email}</div>
<br>`, r.body.evidence.length) {
            let a = "";
            r.body.evidence.forEach((i, o) => {
              a += `${typeof i == "object" ? Object.values(i)[0] : i}`, o !== r.body.evidence.length - 1 && (a += ", ");
            }), e += `<div><strong>Evidence:</strong>${a}</div>
<br>`;
          }
          e += `<div><strong>Comment:</strong>${r.body.comment}</div>
<br>`;
        }), t13.push(`<div>${e}</div>`);
      }
      return t13.join(`

<br>`);
    }
  },
  watch: {
    annotationEntry: {
      handler: function(t13, e) {
        t13 !== e && (this.resetSubmission(), this.updatePrevSubmissions());
      },
      immediate: false,
      deep: false
    }
  },
  mounted: function() {
    var t13;
    (t13 = this.$annotator) == null || t13.authenticate(this.userApiKey).then((e) => {
      e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = true, this.updatePrevSubmissions()) : this.errorMessage = "";
    });
  }
};
var _a = (t13) => (pushScopeId("data-v-56354500"), t13 = t13(), popScopeId(), t13);
var KS = { class: "block" };
var qS = _a(() => createBaseVNode("div", { class: "title" }, "Feature Annotations", -1));
var US = { class: "title-buttons" };
var GS = { key: 0 };
var WS = ["href"];
var YS = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Previous submissions:", -1));
var jS = _a(() => createBaseVNode("strong", null, "Evidence: ", -1));
var ZS = ["href"];
var XS = { key: 1 };
var QS = { key: 2 };
var JS = _a(() => createBaseVNode("strong", null, "Comment: ", -1));
var eT = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Suggest changes:", -1));
var tT = _a(() => createBaseVNode("strong", null, "Evidence:", -1));
var rT = _a(() => createBaseVNode("strong", null, "Comment:", -1));
var nT = { class: "sub-title" };
function aT(t13, e, r, n, a, i) {
  const o = Gh, s = Js, l = qv, u = Ht, c = Ws, d = m2, v = p2, h6 = b2, f = So, p = Ts, m = lS, g = sS, y = Eo, b = Hr, w = nc;
  return openBlock(), createBlock(w, { class: "main" }, {
    default: withCtx(() => [
      createBaseVNode("div", KS, [
        createVNode(s, { class: "info-field" }, {
          default: withCtx(() => [
            qS,
            createBaseVNode("div", US, [
              createVNode(o, { content: i.updatedCopyContent }, null, 8, ["content"])
            ])
          ]),
          _: 1
        }),
        r.annotationEntry ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(t13.displayPair, (C, E) => withDirectives((openBlock(), createBlock(s, {
            class: "dialog-text",
            key: C
          }, {
            default: withCtx(() => [
              createBaseVNode("strong", null, toDisplayString(E) + ": ", 1),
              createTextVNode("  "),
              E !== "Ontology" ? (openBlock(), createElementBlock("span", GS, toDisplayString(r.annotationEntry[C]), 1)) : (openBlock(), createElementBlock("a", {
                key: 1,
                href: i.ontologyLink,
                target: "_blank"
              }, toDisplayString(r.annotationEntry[C]), 9, WS))
            ]),
            _: 2
          }, 1024)), [
            [vShow, r.annotationEntry[C]]
          ])), 128)),
          t13.prevSubs.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            withDirectives(createBaseVNode("div", {
              class: "hide",
              onClick: e[0] || (e[0] = (C) => t13.showSubmissions = false)
            }, [
              createTextVNode(" Hide previous submissions "),
              createVNode(u, null, {
                default: withCtx(() => [
                  createVNode(l)
                ]),
                _: 1
              })
            ], 512), [
              [vShow, t13.showSubmissions]
            ]),
            withDirectives(createBaseVNode("div", {
              class: "hide",
              onClick: e[1] || (e[1] = (C) => t13.showSubmissions = true)
            }, [
              createTextVNode(" Show previous " + toDisplayString(t13.prevSubs.length) + " submission(s) ", 1),
              createVNode(u, null, {
                default: withCtx(() => [
                  createVNode(c)
                ]),
                _: 1
              })
            ], 512), [
              [vShow, !t13.showSubmissions]
            ]),
            t13.showSubmissions ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
              createVNode(s, { class: "dialog-spacer" }),
              createVNode(s, { class: "dialog-text" }, {
                default: withCtx(() => [
                  YS
                ]),
                _: 1
              }),
              (openBlock(true), createElementBlock(Fragment, null, renderList(t13.prevSubs, (C, E) => (openBlock(), createElementBlock("div", {
                class: "entry",
                key: E
              }, [
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    createBaseVNode("strong", null, toDisplayString(i.formatTime(C.created)), 1),
                    createTextVNode(" " + toDisplayString(C.creator.name), 1)
                  ]),
                  _: 2
                }, 1024),
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    jS,
                    (openBlock(true), createElementBlock(Fragment, null, renderList(i.processEvidences(C), (x, T) => (openBlock(), createBlock(s, {
                      key: x,
                      class: "dialog-text"
                    }, {
                      default: withCtx(() => [
                        typeof x == "object" ? (openBlock(), createElementBlock("a", {
                          key: 0,
                          href: Object.values(x)[0],
                          target: "_blank"
                        }, toDisplayString(Object.keys(x)[0]), 9, ZS)) : (openBlock(), createElementBlock("span", XS, toDisplayString(x), 1)),
                        T !== C.body.evidence.length - 1 ? (openBlock(), createElementBlock("span", QS, ", ")) : createCommentVNode("", true)
                      ]),
                      _: 2
                    }, 1024))), 128))
                  ]),
                  _: 2
                }, 1024),
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    JS,
                    createTextVNode(" " + toDisplayString(C.body.comment), 1)
                  ]),
                  _: 2
                }, 1024)
              ]))), 128))
            ], 64)) : createCommentVNode("", true)
          ], 64)) : createCommentVNode("", true),
          t13.authenticated ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
            i.isEditable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
              createVNode(s, { class: "dialog-spacer" }),
              t13.editing ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    eT
                  ]),
                  _: 1
                }),
                i.isDeleted ? createCommentVNode("", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                  createVNode(s, { class: "dialog-text" }, {
                    default: withCtx(() => [
                      tT
                    ]),
                    _: 1
                  }),
                  (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidence, (C, E) => (openBlock(), createBlock(s, { key: C }, {
                    default: withCtx(() => [
                      createVNode(f, { span: 20 }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(t13.evidence[E]), 1)
                        ]),
                        _: 2
                      }, 1024),
                      createVNode(f, { span: 4 }, {
                        default: withCtx(() => [
                          createVNode(u, { class: "standard-icon" }, {
                            default: withCtx(() => [
                              createVNode(p, {
                                onClick: (x) => i.removeEvidence(E)
                              }, null, 8, ["onClick"])
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1024)
                    ]),
                    _: 2
                  }, 1024))), 128)),
                  createVNode(s, null, {
                    default: withCtx(() => [
                      createVNode(y, {
                        size: "small",
                        placeholder: "Enter",
                        modelValue: t13.newEvidence,
                        "onUpdate:modelValue": e[4] || (e[4] = (C) => t13.newEvidence = C),
                        onChange: e[5] || (e[5] = (C) => i.evidenceEntered(C))
                      }, {
                        prepend: withCtx(() => [
                          createVNode(g, {
                            teleported: false,
                            modelValue: t13.evidencePrefix,
                            "onUpdate:modelValue": e[3] || (e[3] = (C) => t13.evidencePrefix = C),
                            placeholder: "Other:",
                            class: "select-box",
                            "popper-class": "flatmap_dropdown"
                          }, {
                            default: withCtx(() => [
                              (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidencePrefixes, (C) => (openBlock(), createBlock(m, {
                                key: C.label,
                                value: C.value
                              }, {
                                default: withCtx(() => [
                                  createVNode(s, null, {
                                    default: withCtx(() => [
                                      createVNode(f, { span: 12 }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(C.label), 1)
                                        ]),
                                        _: 2
                                      }, 1024)
                                    ]),
                                    _: 2
                                  }, 1024)
                                ]),
                                _: 2
                              }, 1032, ["value"]))), 128))
                            ]),
                            _: 1
                          }, 8, ["modelValue"])
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })
                ], 64)),
                createVNode(s, null, {
                  default: withCtx(() => [
                    rT
                  ]),
                  _: 1
                }),
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    createVNode(y, {
                      type: "textarea",
                      autosize: { minRows: 2, maxRows: 4 },
                      placeholder: "Enter",
                      modelValue: t13.comment,
                      "onUpdate:modelValue": e[6] || (e[6] = (C) => t13.comment = C)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                createVNode(s, { class: "dialog-text" }, {
                  default: withCtx(() => [
                    createVNode(b, {
                      class: "button",
                      type: "primary",
                      plain: "",
                      onClick: i.submit
                    }, {
                      default: withCtx(() => [
                        createTextVNode(" Submit ")
                      ]),
                      _: 1
                    }, 8, ["onClick"])
                  ]),
                  _: 1
                })
              ], 64)) : (openBlock(), createBlock(s, { key: 0 }, {
                default: withCtx(() => [
                  createVNode(u, { class: "standard-icon" }, {
                    default: withCtx(() => [
                      createVNode(d, {
                        onClick: e[2] || (e[2] = (C) => t13.editing = true)
                      })
                    ]),
                    _: 1
                  }),
                  i.isDeleted ? (openBlock(), createBlock(u, {
                    key: 0,
                    class: "standard-icon"
                  }, {
                    default: withCtx(() => [
                      createVNode(v, { onClick: i.submit }, null, 8, ["onClick"])
                    ]),
                    _: 1
                  })) : i.isPositionUpdated ? (openBlock(), createBlock(u, {
                    key: 1,
                    class: "standard-icon"
                  }, {
                    default: withCtx(() => [
                      createVNode(h6, { onClick: i.submit }, null, 8, ["onClick"])
                    ]),
                    _: 1
                  })) : createCommentVNode("", true)
                ]),
                _: 1
              })),
              t13.errorMessage ? (openBlock(), createBlock(s, {
                key: 2,
                class: "dialog-text"
              }, {
                default: withCtx(() => [
                  createBaseVNode("strong", nT, toDisplayString(t13.errorMessage), 1)
                ]),
                _: 1
              })) : createCommentVNode("", true)
            ], 64)) : createCommentVNode("", true)
          ], 64)) : createCommentVNode("", true)
        ], 64)) : createCommentVNode("", true)
      ])
    ]),
    _: 1
  });
}
var iT = Ur(HS, [["render", aT], ["__scopeId", "data-v-56354500"]]);
var oT = {
  name: "CreateTooltipContent",
  components: {
    Button: Hr,
    Col: So,
    Container: zh,
    Header: Vh,
    Input: Eo,
    Main: nc
  },
  props: {
    createData: {
      type: Object
    }
  },
  watch: {
    "createData.shape": {
      handler: function(t13, e) {
        this.group = t13, e !== void 0 && this.$emit("cancel-create");
      },
      immediate: true
    }
  },
  computed: {
    confirmText: function() {
      return this.createData.editingIndex > -1 ? "Edit" : "Confirm";
    }
  },
  data: function() {
    return {
      group: "default",
      region: "",
      showPoint: false
    };
  },
  methods: {
    confirm: function() {
      this.$emit(
        "confirm-create",
        {
          region: "__annotation/" + this.region,
          group: this.group,
          shape: this.createData.shape,
          editingIndex: this.createData.editingIndex
        }
      ), this.group = this.createData.shape;
    },
    cancel: function() {
      this.$emit("cancel-create");
    }
  }
};
var sT = (t13) => (pushScopeId("data-v-d61c5879"), t13 = t13(), popScopeId(), t13);
var lT = sT(() => createBaseVNode("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1));
function uT(t13, e, r, n, a, i) {
  const o = Vh, s = So, l = Js, u = Eo, c = Hr, d = nc, v = zh;
  return openBlock(), createBlock(v, { class: "create-container" }, {
    default: withCtx(() => [
      createVNode(o, {
        height: "30px",
        class: "header"
      }, {
        default: withCtx(() => [
          createBaseVNode("div", null, "Create " + toDisplayString(r.createData.shape), 1)
        ]),
        _: 1
      }),
      createVNode(d, { class: "slides-block" }, {
        default: withCtx(() => [
          lT,
          withDirectives(createVNode(l, { class: "row" }, {
            default: withCtx(() => [
              createVNode(s, {
                offset: 0,
                span: 8
              }, {
                default: withCtx(() => [
                  createTextVNode(" Position: ")
                ]),
                _: 1
              }),
              createVNode(s, {
                offset: 0,
                span: 16
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(r.createData.points, ({ value: h6, i: f }) => (openBlock(), createBlock(l, {
                    key: f,
                    class: "value"
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(f), 1)
                    ]),
                    _: 2
                  }, 1024))), 128))
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 512), [
            [vShow, t13.showPoint]
          ]),
          createVNode(l, { class: "row" }, {
            default: withCtx(() => [
              createVNode(s, {
                offset: 0,
                span: 8
              }, {
                default: withCtx(() => [
                  createTextVNode(" Region: ")
                ]),
                _: 1
              }),
              createVNode(s, {
                offset: 0,
                span: 16
              }, {
                default: withCtx(() => [
                  createVNode(u, {
                    modelValue: t13.region,
                    "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.region = h6),
                    placeholder: "__annotation",
                    size: "small"
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(l, { class: "row" }, {
            default: withCtx(() => [
              createVNode(s, {
                offset: 0,
                span: 8
              }, {
                default: withCtx(() => [
                  createTextVNode(" Group: ")
                ]),
                _: 1
              }),
              createVNode(s, {
                offset: 0,
                span: 16
              }, {
                default: withCtx(() => [
                  createVNode(u, {
                    modelValue: t13.group,
                    "onUpdate:modelValue": e[1] || (e[1] = (h6) => t13.group = h6),
                    placeholder: r.createData.shape,
                    size: "small"
                  }, null, 8, ["modelValue", "placeholder"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(l, null, {
            default: withCtx(() => [
              createVNode(s, {
                offset: 0,
                span: 12
              }, {
                default: withCtx(() => [
                  createVNode(c, {
                    type: "primary",
                    plain: "",
                    onClick: i.confirm
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(i.confirmText), 1)
                    ]),
                    _: 1
                  }, 8, ["onClick"])
                ]),
                _: 1
              }),
              createVNode(s, {
                offset: 0,
                span: 12
              }, {
                default: withCtx(() => [
                  createVNode(c, {
                    type: "primary",
                    plain: "",
                    onClick: i.cancel
                  }, {
                    default: withCtx(() => [
                      createTextVNode(" Cancel ")
                    ]),
                    _: 1
                  }, 8, ["onClick"])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]),
    _: 1
  });
}
var pA = Ur(oT, [["render", uT], ["__scopeId", "data-v-d61c5879"]]);
function Ft(t13) {
  "@babel/helpers - typeof";
  return Ft = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ft(t13);
}
function sc(t13, e) {
  if (!(t13 instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function cT(t13, e) {
  for (var r = 0; r < e.length; r++) {
    var n = e[r];
    n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(t13, n.key, n);
  }
}
function lc(t13, e, r) {
  return e && cT(t13.prototype, e), Object.defineProperty(t13, "prototype", {
    writable: false
  }), t13;
}
function Wh(t13, e, r) {
  return e in t13 ? Object.defineProperty(t13, e, {
    value: r,
    enumerable: true,
    configurable: true,
    writable: true
  }) : t13[e] = r, t13;
}
function Mr(t13, e) {
  return dT(t13) || fT(t13, e) || Yh(t13, e) || vT();
}
function dT(t13) {
  if (Array.isArray(t13)) return t13;
}
function fT(t13, e) {
  var r = t13 == null ? null : typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"];
  if (r != null) {
    var n = [], a = true, i = false, o, s;
    try {
      for (r = r.call(t13); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = true)
        ;
    } catch (l) {
      i = true, s = l;
    } finally {
      try {
        !a && r.return != null && r.return();
      } finally {
        if (i) throw s;
      }
    }
    return n;
  }
}
function Yh(t13, e) {
  if (t13) {
    if (typeof t13 == "string") return rf(t13, e);
    var r = Object.prototype.toString.call(t13).slice(8, -1);
    if (r === "Object" && t13.constructor && (r = t13.constructor.name), r === "Map" || r === "Set") return Array.from(t13);
    if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return rf(t13, e);
  }
}
function rf(t13, e) {
  (e == null || e > t13.length) && (e = t13.length);
  for (var r = 0, n = new Array(e); r < e; r++) n[r] = t13[r];
  return n;
}
function vT() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function jh(t13, e) {
  var r = typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"];
  if (!r) {
    if (Array.isArray(t13) || (r = Yh(t13)) || e) {
      r && (t13 = r);
      var n = 0, a = function() {
      };
      return {
        s: a,
        n: function() {
          return n >= t13.length ? {
            done: true
          } : {
            done: false,
            value: t13[n++]
          };
        },
        e: function(l) {
          throw l;
        },
        f: a
      };
    }
    throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  var i = true, o = false, s;
  return {
    s: function() {
      r = r.call(t13);
    },
    n: function() {
      var l = r.next();
      return i = l.done, l;
    },
    e: function(l) {
      o = true, s = l;
    },
    f: function() {
      try {
        !i && r.return != null && r.return();
      } finally {
        if (o) throw s;
      }
    }
  };
}
var Ot = typeof window > "u" ? null : window;
var nf = Ot ? Ot.navigator : null;
Ot && Ot.document;
var hT = Ft("");
var Zh = Ft({});
var pT = Ft(function() {
});
var gT = typeof HTMLElement > "u" ? "undefined" : Ft(HTMLElement);
var _o = function(e) {
  return e && e.instanceString && pt(e.instanceString) ? e.instanceString() : null;
};
var Ae = function(e) {
  return e != null && Ft(e) == hT;
};
var pt = function(e) {
  return e != null && Ft(e) === pT;
};
var st = function(e) {
  return !yr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array);
};
var Xe = function(e) {
  return e != null && Ft(e) === Zh && !st(e) && e.constructor === Object;
};
var mT = function(e) {
  return e != null && Ft(e) === Zh;
};
var be = function(e) {
  return e != null && Ft(e) === Ft(1) && !isNaN(e);
};
var yT = function(e) {
  return be(e) && Math.floor(e) === e;
};
var Ps = function(e) {
  if (gT !== "undefined")
    return e != null && e instanceof HTMLElement;
};
var yr = function(e) {
  return Do(e) || Xh(e);
};
var Do = function(e) {
  return _o(e) === "collection" && e._private.single;
};
var Xh = function(e) {
  return _o(e) === "collection" && !e._private.single;
};
var uc = function(e) {
  return _o(e) === "core";
};
var Qh = function(e) {
  return _o(e) === "stylesheet";
};
var bT = function(e) {
  return _o(e) === "event";
};
var Kn = function(e) {
  return e == null ? true : !!(e === "" || e.match(/^\s+$/));
};
var wT = function(e) {
  return typeof HTMLElement > "u" ? false : e instanceof HTMLElement;
};
var CT = function(e) {
  return Xe(e) && be(e.x1) && be(e.x2) && be(e.y1) && be(e.y2);
};
var xT = function(e) {
  return mT(e) && pt(e.then);
};
var ET = function() {
  return nf && nf.userAgent.match(/msie|trident|edge/i);
};
var no = function(e, r) {
  r || (r = function() {
    if (arguments.length === 1)
      return arguments[0];
    if (arguments.length === 0)
      return "undefined";
    for (var i = [], o = 0; o < arguments.length; o++)
      i.push(arguments[o]);
    return i.join("$");
  });
  var n = function a() {
    var i = this, o = arguments, s, l = r.apply(i, o), u = a.cache;
    return (s = u[l]) || (s = u[l] = e.apply(i, o)), s;
  };
  return n.cache = {}, n;
};
var cc = no(function(t13) {
  return t13.replace(/([A-Z])/g, function(e) {
    return "-" + e.toLowerCase();
  });
});
var tl = no(function(t13) {
  return t13.replace(/(-\w)/g, function(e) {
    return e[1].toUpperCase();
  });
});
var Jh = no(function(t13, e) {
  return t13 + e[0].toUpperCase() + e.substring(1);
}, function(t13, e) {
  return t13 + "$" + e;
});
var af = function(e) {
  return Kn(e) ? e : e.charAt(0).toUpperCase() + e.substring(1);
};
var At = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))";
var kT = "rgb[a]?\\((" + At + "[%]?)\\s*,\\s*(" + At + "[%]?)\\s*,\\s*(" + At + "[%]?)(?:\\s*,\\s*(" + At + "))?\\)";
var ST = "rgb[a]?\\((?:" + At + "[%]?)\\s*,\\s*(?:" + At + "[%]?)\\s*,\\s*(?:" + At + "[%]?)(?:\\s*,\\s*(?:" + At + "))?\\)";
var TT = "hsl[a]?\\((" + At + ")\\s*,\\s*(" + At + "[%])\\s*,\\s*(" + At + "[%])(?:\\s*,\\s*(" + At + "))?\\)";
var _T = "hsl[a]?\\((?:" + At + ")\\s*,\\s*(?:" + At + "[%])\\s*,\\s*(?:" + At + "[%])(?:\\s*,\\s*(?:" + At + "))?\\)";
var DT = "\\#[0-9a-fA-F]{3}";
var PT = "\\#[0-9a-fA-F]{6}";
var ep = function(e, r) {
  return e < r ? -1 : e > r ? 1 : 0;
};
var OT = function(e, r) {
  return -1 * ep(e, r);
};
var ze = Object.assign != null ? Object.assign.bind(Object) : function(t13) {
  for (var e = arguments, r = 1; r < e.length; r++) {
    var n = e[r];
    if (n != null)
      for (var a = Object.keys(n), i = 0; i < a.length; i++) {
        var o = a[i];
        t13[o] = n[o];
      }
  }
  return t13;
};
var LT = function(e) {
  if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) {
    var r = e.length === 4, n, a, i, o = 16;
    return r ? (n = parseInt(e[1] + e[1], o), a = parseInt(e[2] + e[2], o), i = parseInt(e[3] + e[3], o)) : (n = parseInt(e[1] + e[2], o), a = parseInt(e[3] + e[4], o), i = parseInt(e[5] + e[6], o)), [n, a, i];
  }
};
var IT = function(e) {
  var r, n, a, i, o, s, l, u;
  function c(f, p, m) {
    return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? f + (p - f) * 6 * m : m < 1 / 2 ? p : m < 2 / 3 ? f + (p - f) * (2 / 3 - m) * 6 : f;
  }
  var d = new RegExp("^" + TT + "$").exec(e);
  if (d) {
    if (n = parseInt(d[1]), n < 0 ? n = (360 - -1 * n % 360) % 360 : n > 360 && (n = n % 360), n /= 360, a = parseFloat(d[2]), a < 0 || a > 100 || (a = a / 100, i = parseFloat(d[3]), i < 0 || i > 100) || (i = i / 100, o = d[4], o !== void 0 && (o = parseFloat(o), o < 0 || o > 1)))
      return;
    if (a === 0)
      s = l = u = Math.round(i * 255);
    else {
      var v = i < 0.5 ? i * (1 + a) : i + a - i * a, h6 = 2 * i - v;
      s = Math.round(255 * c(h6, v, n + 1 / 3)), l = Math.round(255 * c(h6, v, n)), u = Math.round(255 * c(h6, v, n - 1 / 3));
    }
    r = [s, l, u, o];
  }
  return r;
};
var AT = function(e) {
  var r, n = new RegExp("^" + kT + "$").exec(e);
  if (n) {
    r = [];
    for (var a = [], i = 1; i <= 3; i++) {
      var o = n[i];
      if (o[o.length - 1] === "%" && (a[i] = true), o = parseFloat(o), a[i] && (o = o / 100 * 255), o < 0 || o > 255)
        return;
      r.push(Math.floor(o));
    }
    var s = a[1] || a[2] || a[3], l = a[1] && a[2] && a[3];
    if (s && !l)
      return;
    var u = n[4];
    if (u !== void 0) {
      if (u = parseFloat(u), u < 0 || u > 1)
        return;
      r.push(u);
    }
  }
  return r;
};
var FT = function(e) {
  return BT[e.toLowerCase()];
};
var MT = function(e) {
  return (st(e) ? e : null) || FT(e) || LT(e) || AT(e) || IT(e);
};
var BT = {
  // special colour names
  transparent: [0, 0, 0, 0],
  // NB alpha === 0
  // regular colours
  aliceblue: [240, 248, 255],
  antiquewhite: [250, 235, 215],
  aqua: [0, 255, 255],
  aquamarine: [127, 255, 212],
  azure: [240, 255, 255],
  beige: [245, 245, 220],
  bisque: [255, 228, 196],
  black: [0, 0, 0],
  blanchedalmond: [255, 235, 205],
  blue: [0, 0, 255],
  blueviolet: [138, 43, 226],
  brown: [165, 42, 42],
  burlywood: [222, 184, 135],
  cadetblue: [95, 158, 160],
  chartreuse: [127, 255, 0],
  chocolate: [210, 105, 30],
  coral: [255, 127, 80],
  cornflowerblue: [100, 149, 237],
  cornsilk: [255, 248, 220],
  crimson: [220, 20, 60],
  cyan: [0, 255, 255],
  darkblue: [0, 0, 139],
  darkcyan: [0, 139, 139],
  darkgoldenrod: [184, 134, 11],
  darkgray: [169, 169, 169],
  darkgreen: [0, 100, 0],
  darkgrey: [169, 169, 169],
  darkkhaki: [189, 183, 107],
  darkmagenta: [139, 0, 139],
  darkolivegreen: [85, 107, 47],
  darkorange: [255, 140, 0],
  darkorchid: [153, 50, 204],
  darkred: [139, 0, 0],
  darksalmon: [233, 150, 122],
  darkseagreen: [143, 188, 143],
  darkslateblue: [72, 61, 139],
  darkslategray: [47, 79, 79],
  darkslategrey: [47, 79, 79],
  darkturquoise: [0, 206, 209],
  darkviolet: [148, 0, 211],
  deeppink: [255, 20, 147],
  deepskyblue: [0, 191, 255],
  dimgray: [105, 105, 105],
  dimgrey: [105, 105, 105],
  dodgerblue: [30, 144, 255],
  firebrick: [178, 34, 34],
  floralwhite: [255, 250, 240],
  forestgreen: [34, 139, 34],
  fuchsia: [255, 0, 255],
  gainsboro: [220, 220, 220],
  ghostwhite: [248, 248, 255],
  gold: [255, 215, 0],
  goldenrod: [218, 165, 32],
  gray: [128, 128, 128],
  grey: [128, 128, 128],
  green: [0, 128, 0],
  greenyellow: [173, 255, 47],
  honeydew: [240, 255, 240],
  hotpink: [255, 105, 180],
  indianred: [205, 92, 92],
  indigo: [75, 0, 130],
  ivory: [255, 255, 240],
  khaki: [240, 230, 140],
  lavender: [230, 230, 250],
  lavenderblush: [255, 240, 245],
  lawngreen: [124, 252, 0],
  lemonchiffon: [255, 250, 205],
  lightblue: [173, 216, 230],
  lightcoral: [240, 128, 128],
  lightcyan: [224, 255, 255],
  lightgoldenrodyellow: [250, 250, 210],
  lightgray: [211, 211, 211],
  lightgreen: [144, 238, 144],
  lightgrey: [211, 211, 211],
  lightpink: [255, 182, 193],
  lightsalmon: [255, 160, 122],
  lightseagreen: [32, 178, 170],
  lightskyblue: [135, 206, 250],
  lightslategray: [119, 136, 153],
  lightslategrey: [119, 136, 153],
  lightsteelblue: [176, 196, 222],
  lightyellow: [255, 255, 224],
  lime: [0, 255, 0],
  limegreen: [50, 205, 50],
  linen: [250, 240, 230],
  magenta: [255, 0, 255],
  maroon: [128, 0, 0],
  mediumaquamarine: [102, 205, 170],
  mediumblue: [0, 0, 205],
  mediumorchid: [186, 85, 211],
  mediumpurple: [147, 112, 219],
  mediumseagreen: [60, 179, 113],
  mediumslateblue: [123, 104, 238],
  mediumspringgreen: [0, 250, 154],
  mediumturquoise: [72, 209, 204],
  mediumvioletred: [199, 21, 133],
  midnightblue: [25, 25, 112],
  mintcream: [245, 255, 250],
  mistyrose: [255, 228, 225],
  moccasin: [255, 228, 181],
  navajowhite: [255, 222, 173],
  navy: [0, 0, 128],
  oldlace: [253, 245, 230],
  olive: [128, 128, 0],
  olivedrab: [107, 142, 35],
  orange: [255, 165, 0],
  orangered: [255, 69, 0],
  orchid: [218, 112, 214],
  palegoldenrod: [238, 232, 170],
  palegreen: [152, 251, 152],
  paleturquoise: [175, 238, 238],
  palevioletred: [219, 112, 147],
  papayawhip: [255, 239, 213],
  peachpuff: [255, 218, 185],
  peru: [205, 133, 63],
  pink: [255, 192, 203],
  plum: [221, 160, 221],
  powderblue: [176, 224, 230],
  purple: [128, 0, 128],
  red: [255, 0, 0],
  rosybrown: [188, 143, 143],
  royalblue: [65, 105, 225],
  saddlebrown: [139, 69, 19],
  salmon: [250, 128, 114],
  sandybrown: [244, 164, 96],
  seagreen: [46, 139, 87],
  seashell: [255, 245, 238],
  sienna: [160, 82, 45],
  silver: [192, 192, 192],
  skyblue: [135, 206, 235],
  slateblue: [106, 90, 205],
  slategray: [112, 128, 144],
  slategrey: [112, 128, 144],
  snow: [255, 250, 250],
  springgreen: [0, 255, 127],
  steelblue: [70, 130, 180],
  tan: [210, 180, 140],
  teal: [0, 128, 128],
  thistle: [216, 191, 216],
  tomato: [255, 99, 71],
  turquoise: [64, 224, 208],
  violet: [238, 130, 238],
  wheat: [245, 222, 179],
  white: [255, 255, 255],
  whitesmoke: [245, 245, 245],
  yellow: [255, 255, 0],
  yellowgreen: [154, 205, 50]
};
var tp = function(e) {
  for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) {
    var o = n[i];
    if (Xe(o))
      throw Error("Tried to set map with object key");
    i < n.length - 1 ? (r[o] == null && (r[o] = {}), r = r[o]) : r[o] = e.value;
  }
};
var rp = function(e) {
  for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) {
    var o = n[i];
    if (Xe(o))
      throw Error("Tried to get map with object key");
    if (r = r[o], r == null)
      return r;
  }
  return r;
};
function NT(t13) {
  var e = typeof t13;
  return t13 != null && (e == "object" || e == "function");
}
var ga = NT;
var Ri = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function RT(t13, e) {
  return e = { exports: {} }, t13(e, e.exports), e.exports;
}
var $T = typeof Ri == "object" && Ri && Ri.Object === Object && Ri;
var zT = $T;
var VT = typeof self == "object" && self && self.Object === Object && self;
var HT = zT || VT || Function("return this")();
var rl = HT;
var KT = function() {
  return rl.Date.now();
};
var Ml = KT;
var qT = /\s/;
function UT(t13) {
  for (var e = t13.length; e-- && qT.test(t13.charAt(e)); )
    ;
  return e;
}
var GT = UT;
var WT = /^\s+/;
function YT(t13) {
  return t13 && t13.slice(0, GT(t13) + 1).replace(WT, "");
}
var jT = YT;
var ZT = rl.Symbol;
var oi = ZT;
var np = Object.prototype;
var XT = np.hasOwnProperty;
var QT = np.toString;
var Ii = oi ? oi.toStringTag : void 0;
function JT(t13) {
  var e = XT.call(t13, Ii), r = t13[Ii];
  try {
    t13[Ii] = void 0;
    var n = true;
  } catch {
  }
  var a = QT.call(t13);
  return n && (e ? t13[Ii] = r : delete t13[Ii]), a;
}
var e5 = JT;
var t5 = Object.prototype;
var r5 = t5.toString;
function n5(t13) {
  return r5.call(t13);
}
var a5 = n5;
var i5 = "[object Null]";
var o5 = "[object Undefined]";
var of = oi ? oi.toStringTag : void 0;
function s5(t13) {
  return t13 == null ? t13 === void 0 ? o5 : i5 : of && of in Object(t13) ? e5(t13) : a5(t13);
}
var ap = s5;
function l5(t13) {
  return t13 != null && typeof t13 == "object";
}
var u5 = l5;
var c5 = "[object Symbol]";
function d5(t13) {
  return typeof t13 == "symbol" || u5(t13) && ap(t13) == c5;
}
var Po = d5;
var sf = NaN;
var f5 = /^[-+]0x[0-9a-f]+$/i;
var v5 = /^0b[01]+$/i;
var h5 = /^0o[0-7]+$/i;
var p5 = parseInt;
function g5(t13) {
  if (typeof t13 == "number")
    return t13;
  if (Po(t13))
    return sf;
  if (ga(t13)) {
    var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13;
    t13 = ga(e) ? e + "" : e;
  }
  if (typeof t13 != "string")
    return t13 === 0 ? t13 : +t13;
  t13 = jT(t13);
  var r = v5.test(t13);
  return r || h5.test(t13) ? p5(t13.slice(2), r ? 2 : 8) : f5.test(t13) ? sf : +t13;
}
var lf = g5;
var m5 = "Expected a function";
var y5 = Math.max;
var b5 = Math.min;
function w5(t13, e, r) {
  var n, a, i, o, s, l, u = 0, c = false, d = false, v = true;
  if (typeof t13 != "function")
    throw new TypeError(m5);
  e = lf(e) || 0, ga(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? y5(lf(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v);
  function h6(E) {
    var x = n, T = a;
    return n = a = void 0, u = E, o = t13.apply(T, x), o;
  }
  function f(E) {
    return u = E, s = setTimeout(g, e), c ? h6(E) : o;
  }
  function p(E) {
    var x = E - l, T = E - u, k = e - x;
    return d ? b5(k, i - T) : k;
  }
  function m(E) {
    var x = E - l, T = E - u;
    return l === void 0 || x >= e || x < 0 || d && T >= i;
  }
  function g() {
    var E = Ml();
    if (m(E))
      return y(E);
    s = setTimeout(g, p(E));
  }
  function y(E) {
    return s = void 0, v && n ? h6(E) : (n = a = void 0, o);
  }
  function b() {
    s !== void 0 && clearTimeout(s), u = 0, n = l = a = s = void 0;
  }
  function w() {
    return s === void 0 ? o : y(Ml());
  }
  function C() {
    var E = Ml(), x = m(E);
    if (n = arguments, a = this, l = E, x) {
      if (s === void 0)
        return f(l);
      if (d)
        return clearTimeout(s), s = setTimeout(g, e), h6(l);
    }
    return s === void 0 && (s = setTimeout(g, e)), o;
  }
  return C.cancel = b, C.flush = w, C;
}
var nl = w5;
var Bl = Ot ? Ot.performance : null;
var ip = Bl && Bl.now ? function() {
  return Bl.now();
} : function() {
  return Date.now();
};
var C5 = function() {
  if (Ot) {
    if (Ot.requestAnimationFrame)
      return function(t13) {
        Ot.requestAnimationFrame(t13);
      };
    if (Ot.mozRequestAnimationFrame)
      return function(t13) {
        Ot.mozRequestAnimationFrame(t13);
      };
    if (Ot.webkitRequestAnimationFrame)
      return function(t13) {
        Ot.webkitRequestAnimationFrame(t13);
      };
    if (Ot.msRequestAnimationFrame)
      return function(t13) {
        Ot.msRequestAnimationFrame(t13);
      };
  }
  return function(t13) {
    t13 && setTimeout(function() {
      t13(ip());
    }, 1e3 / 60);
  };
}();
var Os = function(e) {
  return C5(e);
};
var gn = ip;
var Ha = 9261;
var op = 65599;
var $i = 5381;
var sp = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ha, n = r, a; a = e.next(), !a.done; )
    n = n * op + a.value | 0;
  return n;
};
var ao = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ha;
  return r * op + e | 0;
};
var io = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $i;
  return (r << 5) + r + e | 0;
};
var x5 = function(e, r) {
  return e * 2097152 + r;
};
var Dn = function(e) {
  return e[0] * 2097152 + e[1];
};
var Go = function(e, r) {
  return [ao(e[0], r[0]), io(e[1], r[1])];
};
var E5 = function(e, r) {
  var n = {
    value: 0,
    done: false
  }, a = 0, i = e.length, o = {
    next: function() {
      return a < i ? n.value = e[a++] : n.done = true, n;
    }
  };
  return sp(o, r);
};
var ma = function(e, r) {
  var n = {
    value: 0,
    done: false
  }, a = 0, i = e.length, o = {
    next: function() {
      return a < i ? n.value = e.charCodeAt(a++) : n.done = true, n;
    }
  };
  return sp(o, r);
};
var lp = function() {
  return k5(arguments);
};
var k5 = function(e) {
  for (var r, n = 0; n < e.length; n++) {
    var a = e[n];
    n === 0 ? r = ma(a) : r = ma(a, r);
  }
  return r;
};
var uf = true;
var S5 = console.warn != null;
var T5 = console.trace != null;
var dc = Number.MAX_SAFE_INTEGER || 9007199254740991;
var up = function() {
  return true;
};
var Ls = function() {
  return false;
};
var cf = function() {
  return 0;
};
var fc = function() {
};
var yt = function(e) {
  throw new Error(e);
};
var cp = function(e) {
  if (e !== void 0)
    uf = !!e;
  else
    return uf;
};
var tt = function(e) {
  cp() && (S5 ? console.warn(e) : (console.log(e), T5 && console.trace()));
};
var _5 = function(e) {
  return ze({}, e);
};
var jr = function(e) {
  return e == null ? e : st(e) ? e.slice() : Xe(e) ? _5(e) : e;
};
var D5 = function(e) {
  return e.slice();
};
var dp = function(e, r) {
  for (
    // loop :)
    r = e = "";
    // b - result , a - numeric letiable
    e++ < 36;
    //
    r += e * 51 & 52 ? (
      //  return a random number or 4
      (e ^ 15 ? (
        // generate a random number from 0 to 15
        8 ^ Math.random() * (e ^ 20 ? 16 : 4)
      ) : 4).toString(16)
    ) : "-"
  )
    ;
  return r;
};
var P5 = {};
var fp = function() {
  return P5;
};
var Yt = function(e) {
  var r = Object.keys(e);
  return function(n) {
    for (var a = {}, i = 0; i < r.length; i++) {
      var o = r[i], s = n == null ? void 0 : n[o];
      a[o] = s === void 0 ? e[o] : s;
    }
    return a;
  };
};
var qn = function(e, r, n) {
  for (var a = e.length - 1; a >= 0; a--)
    e[a] === r && e.splice(a, 1);
};
var vc = function(e) {
  e.splice(0, e.length);
};
var O5 = function(e, r) {
  for (var n = 0; n < r.length; n++) {
    var a = r[n];
    e.push(a);
  }
};
var Nr = function(e, r, n) {
  return n && (r = Jh(n, r)), e[r];
};
var Fn = function(e, r, n, a) {
  n && (r = Jh(n, r)), e[r] = a;
};
var L5 = function() {
  function t13() {
    sc(this, t13), this._obj = {};
  }
  return lc(t13, [{
    key: "set",
    value: function(r, n) {
      return this._obj[r] = n, this;
    }
  }, {
    key: "delete",
    value: function(r) {
      return this._obj[r] = void 0, this;
    }
  }, {
    key: "clear",
    value: function() {
      this._obj = {};
    }
  }, {
    key: "has",
    value: function(r) {
      return this._obj[r] !== void 0;
    }
  }, {
    key: "get",
    value: function(r) {
      return this._obj[r];
    }
  }]), t13;
}();
var Zr = typeof Map < "u" ? Map : L5;
var I5 = "undefined";
var A5 = function() {
  function t13(e) {
    if (sc(this, t13), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) {
      var r;
      e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e;
      for (var n = 0; n < r.length; n++)
        this.add(r[n]);
    }
  }
  return lc(t13, [{
    key: "instanceString",
    value: function() {
      return "set";
    }
  }, {
    key: "add",
    value: function(r) {
      var n = this._obj;
      n[r] !== 1 && (n[r] = 1, this.size++);
    }
  }, {
    key: "delete",
    value: function(r) {
      var n = this._obj;
      n[r] === 1 && (n[r] = 0, this.size--);
    }
  }, {
    key: "clear",
    value: function() {
      this._obj = /* @__PURE__ */ Object.create(null);
    }
  }, {
    key: "has",
    value: function(r) {
      return this._obj[r] === 1;
    }
  }, {
    key: "toArray",
    value: function() {
      var r = this;
      return Object.keys(this._obj).filter(function(n) {
        return r.has(n);
      });
    }
  }, {
    key: "forEach",
    value: function(r, n) {
      return this.toArray().forEach(r, n);
    }
  }]), t13;
}();
var gi = (typeof Set > "u" ? "undefined" : Ft(Set)) !== I5 ? Set : A5;
var al = function(e, r) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  if (e === void 0 || r === void 0 || !uc(e)) {
    yt("An element must have a core reference and parameters set");
    return;
  }
  var a = r.group;
  if (a == null && (r.data && r.data.source != null && r.data.target != null ? a = "edges" : a = "nodes"), a !== "nodes" && a !== "edges") {
    yt("An element must be of type `nodes` or `edges`; you specified `" + a + "`");
    return;
  }
  this.length = 1, this[0] = this;
  var i = this._private = {
    cy: e,
    single: true,
    // indicates this is an element
    data: r.data || {},
    // data object
    position: r.position || {
      x: 0,
      y: 0
    },
    // (x, y) position pair
    autoWidth: void 0,
    // width and height of nodes calculated by the renderer when set to special 'auto' value
    autoHeight: void 0,
    autoPadding: void 0,
    compoundBoundsClean: false,
    // whether the compound dimensions need to be recalculated the next time dimensions are read
    listeners: [],
    // array of bound listeners
    group: a,
    // string; 'nodes' or 'edges'
    style: {},
    // properties as set by the style
    rstyle: {},
    // properties for style sent from the renderer to the core
    styleCxts: [],
    // applied style contexts from the styler
    styleKeys: {},
    // per-group keys of style property values
    removed: true,
    // whether it's inside the vis; true if removed (set true here since we call restore)
    selected: !!r.selected,
    // whether it's selected
    selectable: r.selectable === void 0 ? true : !!r.selectable,
    // whether it's selectable
    locked: !!r.locked,
    // whether the element is locked (cannot be moved)
    grabbed: false,
    // whether the element is grabbed by the mouse; renderer sets this privately
    grabbable: r.grabbable === void 0 ? true : !!r.grabbable,
    // whether the element can be grabbed
    pannable: r.pannable === void 0 ? a === "edges" : !!r.pannable,
    // whether the element has passthrough panning enabled
    active: false,
    // whether the element is active from user interaction
    classes: new gi(),
    // map ( className => true )
    animation: {
      // object for currently-running animations
      current: [],
      queue: []
    },
    rscratch: {},
    // object in which the renderer can store information
    scratch: r.scratch || {},
    // scratch objects
    edges: [],
    // array of connected edges
    children: [],
    // array of children
    parent: r.parent && r.parent.isNode() ? r.parent : null,
    // parent ref
    traversalCache: {},
    // cache of output of traversal functions
    backgrounding: false,
    // whether background images are loading
    bbCache: null,
    // cache of the current bounding box
    bbCacheShift: {
      x: 0,
      y: 0
    },
    // shift applied to cached bb to be applied on next get
    bodyBounds: null,
    // bounds cache of element body, w/o overlay
    overlayBounds: null,
    // bounds cache of element body, including overlay
    labelBounds: {
      // bounds cache of labels
      all: null,
      source: null,
      target: null,
      main: null
    },
    arrowBounds: {
      // bounds cache of edge arrows
      source: null,
      target: null,
      "mid-source": null,
      "mid-target": null
    }
  };
  if (i.position.x == null && (i.position.x = 0), i.position.y == null && (i.position.y = 0), r.renderedPosition) {
    var o = r.renderedPosition, s = e.pan(), l = e.zoom();
    i.position = {
      x: (o.x - s.x) / l,
      y: (o.y - s.y) / l
    };
  }
  var u = [];
  st(r.classes) ? u = r.classes : Ae(r.classes) && (u = r.classes.split(/\s+/));
  for (var c = 0, d = u.length; c < d; c++) {
    var v = u[c];
    !v || v === "" || i.classes.add(v);
  }
  this.createEmitter();
  var h6 = r.style || r.css;
  h6 && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."), this.style(h6)), (n === void 0 || n) && this.restore();
};
var df = function(e) {
  return e = {
    bfs: e.bfs || !e.dfs,
    dfs: e.dfs || !e.bfs
  }, function(n, a, i) {
    var o;
    Xe(n) && !yr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !pt(a) ? a : i, a = pt(a) ? a : function() {
    };
    for (var s = this._private.cy, l = n = Ae(n) ? this.filter(n) : n, u = [], c = [], d = {}, v = {}, h6 = {}, f = 0, p, m = this.byGroup(), g = m.nodes, y = m.edges, b = 0; b < l.length; b++) {
      var w = l[b], C = w.id();
      w.isNode() && (u.unshift(w), e.bfs && (h6[C] = true, c.push(w)), v[C] = 0);
    }
    for (var E = function() {
      var A = e.bfs ? u.shift() : u.pop(), L = A.id();
      if (e.dfs) {
        if (h6[L])
          return "continue";
        h6[L] = true, c.push(A);
      }
      var N = v[L], I = d[L], M = I != null ? I.source() : null, F = I != null ? I.target() : null, $ = I == null ? void 0 : A.same(M) ? F[0] : M[0], U = void 0;
      if (U = a(A, I, $, f++, N), U === true)
        return p = A, "break";
      if (U === false)
        return "break";
      for (var H = A.connectedEdges().filter(function(ne) {
        return (!i || ne.source().same(A)) && y.has(ne);
      }), K = 0; K < H.length; K++) {
        var ee = H[K], se = ee.connectedNodes().filter(function(ne) {
          return !ne.same(A) && g.has(ne);
        }), oe = se.id();
        se.length !== 0 && !h6[oe] && (se = se[0], u.push(se), e.bfs && (h6[oe] = true, c.push(se)), d[oe] = ee, v[oe] = v[L] + 1);
      }
    }; u.length !== 0; ) {
      var x = E();
      if (x !== "continue" && x === "break")
        break;
    }
    for (var T = s.collection(), k = 0; k < c.length; k++) {
      var _ = c[k], D = d[_.id()];
      D != null && T.push(D), T.push(_);
    }
    return {
      path: s.collection(T),
      found: s.collection(p)
    };
  };
};
var oo = {
  breadthFirstSearch: df({
    bfs: true
  }),
  depthFirstSearch: df({
    dfs: true
  })
};
oo.bfs = oo.breadthFirstSearch;
oo.dfs = oo.depthFirstSearch;
var F5 = RT(function(t13, e) {
  (function() {
    var r, n, a, i, o, s, l, u, c, d, v, h6, f, p, m;
    a = Math.floor, d = Math.min, n = function(g, y) {
      return g < y ? -1 : g > y ? 1 : 0;
    }, c = function(g, y, b, w, C) {
      var E;
      if (b == null && (b = 0), C == null && (C = n), b < 0)
        throw new Error("lo must be non-negative");
      for (w == null && (w = g.length); b < w; )
        E = a((b + w) / 2), C(y, g[E]) < 0 ? w = E : b = E + 1;
      return [].splice.apply(g, [b, b - b].concat(y)), y;
    }, s = function(g, y, b) {
      return b == null && (b = n), g.push(y), p(g, 0, g.length - 1, b);
    }, o = function(g, y) {
      var b, w;
      return y == null && (y = n), b = g.pop(), g.length ? (w = g[0], g[0] = b, m(g, 0, y)) : w = b, w;
    }, u = function(g, y, b) {
      var w;
      return b == null && (b = n), w = g[0], g[0] = y, m(g, 0, b), w;
    }, l = function(g, y, b) {
      var w;
      return b == null && (b = n), g.length && b(g[0], y) < 0 && (w = [g[0], y], y = w[0], g[0] = w[1], m(g, 0, b)), y;
    }, i = function(g, y) {
      var b, w, C, E, x, T;
      for (y == null && (y = n), E = (function() {
        T = [];
        for (var k = 0, _ = a(g.length / 2); 0 <= _ ? k < _ : k > _; 0 <= _ ? k++ : k--)
          T.push(k);
        return T;
      }).apply(this).reverse(), x = [], w = 0, C = E.length; w < C; w++)
        b = E[w], x.push(m(g, b, y));
      return x;
    }, f = function(g, y, b) {
      var w;
      if (b == null && (b = n), w = g.indexOf(y), w !== -1)
        return p(g, 0, w, b), m(g, w, b);
    }, v = function(g, y, b) {
      var w, C, E, x, T;
      if (b == null && (b = n), C = g.slice(0, y), !C.length)
        return C;
      for (i(C, b), T = g.slice(y), E = 0, x = T.length; E < x; E++)
        w = T[E], l(C, w, b);
      return C.sort(b).reverse();
    }, h6 = function(g, y, b) {
      var w, C, E, x, T, k, _, D, O;
      if (b == null && (b = n), y * 10 <= g.length) {
        if (E = g.slice(0, y).sort(b), !E.length)
          return E;
        for (C = E[E.length - 1], _ = g.slice(y), x = 0, k = _.length; x < k; x++)
          w = _[x], b(w, C) < 0 && (c(E, w, 0, null, b), E.pop(), C = E[E.length - 1]);
        return E;
      }
      for (i(g, b), O = [], T = 0, D = d(y, g.length); 0 <= D ? T < D : T > D; 0 <= D ? ++T : --T)
        O.push(o(g, b));
      return O;
    }, p = function(g, y, b, w) {
      var C, E, x;
      for (w == null && (w = n), C = g[b]; b > y; ) {
        if (x = b - 1 >> 1, E = g[x], w(C, E) < 0) {
          g[b] = E, b = x;
          continue;
        }
        break;
      }
      return g[b] = C;
    }, m = function(g, y, b) {
      var w, C, E, x, T;
      for (b == null && (b = n), C = g.length, T = y, E = g[y], w = 2 * y + 1; w < C; )
        x = w + 1, x < C && !(b(g[w], g[x]) < 0) && (w = x), g[y] = g[w], y = w, w = 2 * y + 1;
      return g[y] = E, p(g, T, y, b);
    }, r = function() {
      g.push = s, g.pop = o, g.replace = u, g.pushpop = l, g.heapify = i, g.updateItem = f, g.nlargest = v, g.nsmallest = h6;
      function g(y) {
        this.cmp = y ?? n, this.nodes = [];
      }
      return g.prototype.push = function(y) {
        return s(this.nodes, y, this.cmp);
      }, g.prototype.pop = function() {
        return o(this.nodes, this.cmp);
      }, g.prototype.peek = function() {
        return this.nodes[0];
      }, g.prototype.contains = function(y) {
        return this.nodes.indexOf(y) !== -1;
      }, g.prototype.replace = function(y) {
        return u(this.nodes, y, this.cmp);
      }, g.prototype.pushpop = function(y) {
        return l(this.nodes, y, this.cmp);
      }, g.prototype.heapify = function() {
        return i(this.nodes, this.cmp);
      }, g.prototype.updateItem = function(y) {
        return f(this.nodes, y, this.cmp);
      }, g.prototype.clear = function() {
        return this.nodes = [];
      }, g.prototype.empty = function() {
        return this.nodes.length === 0;
      }, g.prototype.size = function() {
        return this.nodes.length;
      }, g.prototype.clone = function() {
        var y;
        return y = new g(), y.nodes = this.nodes.slice(0), y;
      }, g.prototype.toArray = function() {
        return this.nodes.slice(0);
      }, g.prototype.insert = g.prototype.push, g.prototype.top = g.prototype.peek, g.prototype.front = g.prototype.peek, g.prototype.has = g.prototype.contains, g.prototype.copy = g.prototype.clone, g;
    }(), function(g, y) {
      return t13.exports = y();
    }(this, function() {
      return r;
    });
  }).call(Ri);
});
var Oo = F5;
var M5 = Yt({
  root: null,
  weight: function(e) {
    return 1;
  },
  directed: false
});
var B5 = {
  dijkstra: function(e) {
    if (!Xe(e)) {
      var r = arguments;
      e = {
        root: r[0],
        weight: r[1],
        directed: r[2]
      };
    }
    var n = M5(e), a = n.root, i = n.weight, o = n.directed, s = this, l = i, u = Ae(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, v = {}, h6 = this.byGroup(), f = h6.nodes, p = h6.edges;
    p.unmergeBy(function(N) {
      return N.isLoop();
    });
    for (var m = function(I) {
      return c[I.id()];
    }, g = function(I, M) {
      c[I.id()] = M, y.updateItem(I);
    }, y = new Oo(function(N, I) {
      return m(N) - m(I);
    }), b = 0; b < f.length; b++) {
      var w = f[b];
      c[w.id()] = w.same(u) ? 0 : 1 / 0, y.push(w);
    }
    for (var C = function(I, M) {
      for (var F = (o ? I.edgesTo(M) : I.edgesWith(M)).intersect(p), $ = 1 / 0, U, H = 0; H < F.length; H++) {
        var K = F[H], ee = l(K);
        (ee < $ || !U) && ($ = ee, U = K);
      }
      return {
        edge: U,
        dist: $
      };
    }; y.size() > 0; ) {
      var E = y.pop(), x = m(E), T = E.id();
      if (v[T] = x, x !== 1 / 0)
        for (var k = E.neighborhood().intersect(f), _ = 0; _ < k.length; _++) {
          var D = k[_], O = D.id(), A = C(E, D), L = x + A.dist;
          L < m(D) && (g(D, L), d[O] = {
            node: E,
            edge: A.edge
          });
        }
    }
    return {
      distanceTo: function(I) {
        var M = Ae(I) ? f.filter(I)[0] : I[0];
        return v[M.id()];
      },
      pathTo: function(I) {
        var M = Ae(I) ? f.filter(I)[0] : I[0], F = [], $ = M, U = $.id();
        if (M.length > 0)
          for (F.unshift(M); d[U]; ) {
            var H = d[U];
            F.unshift(H.edge), F.unshift(H.node), $ = H.node, U = $.id();
          }
        return s.spawn(F);
      }
    };
  }
};
var N5 = {
  // kruskal's algorithm (finds min spanning tree, assuming undirected graph)
  // implemented from pseudocode from wikipedia
  kruskal: function(e) {
    e = e || function(b) {
      return 1;
    };
    for (var r = this.byGroup(), n = r.nodes, a = r.edges, i = n.length, o = new Array(i), s = n, l = function(w) {
      for (var C = 0; C < o.length; C++) {
        var E = o[C];
        if (E.has(w))
          return C;
      }
    }, u = 0; u < i; u++)
      o[u] = this.spawn(n[u]);
    for (var c = a.sort(function(b, w) {
      return e(b) - e(w);
    }), d = 0; d < c.length; d++) {
      var v = c[d], h6 = v.source()[0], f = v.target()[0], p = l(h6), m = l(f), g = o[p], y = o[m];
      p !== m && (s.merge(v), g.merge(y), o.splice(m, 1));
    }
    return s;
  }
};
var R5 = Yt({
  root: null,
  goal: null,
  weight: function(e) {
    return 1;
  },
  heuristic: function(e) {
    return 0;
  },
  directed: false
});
var $5 = {
  // Implemented from pseudocode from wikipedia
  aStar: function(e) {
    var r = this.cy(), n = R5(e), a = n.root, i = n.goal, o = n.heuristic, s = n.directed, l = n.weight;
    a = r.collection(a)[0], i = r.collection(i)[0];
    var u = a.id(), c = i.id(), d = {}, v = {}, h6 = {}, f = new Oo(function(U, H) {
      return v[U.id()] - v[H.id()];
    }), p = new gi(), m = {}, g = {}, y = function(H, K) {
      f.push(H), p.add(K);
    }, b, w, C = function() {
      b = f.pop(), w = b.id(), p.delete(w);
    }, E = function(H) {
      return p.has(H);
    };
    y(a, u), d[u] = 0, v[u] = o(a);
    for (var x = 0; f.size() > 0; ) {
      if (C(), x++, w === c) {
        for (var T = [], k = i, _ = c, D = g[_]; T.unshift(k), D != null && T.unshift(D), k = m[_], k != null; )
          _ = k.id(), D = g[_];
        return {
          found: true,
          distance: d[w],
          path: this.spawn(T),
          steps: x
        };
      }
      h6[w] = true;
      for (var O = b._private.edges, A = 0; A < O.length; A++) {
        var L = O[A];
        if (this.hasElementWithId(L.id()) && !(s && L.data("source") !== w)) {
          var N = L.source(), I = L.target(), M = N.id() !== w ? N : I, F = M.id();
          if (this.hasElementWithId(F) && !h6[F]) {
            var $ = d[w] + l(L);
            if (!E(F)) {
              d[F] = $, v[F] = $ + o(M), y(M, F), m[F] = b, g[F] = L;
              continue;
            }
            $ < d[F] && (d[F] = $, v[F] = $ + o(M), m[F] = b, g[F] = L);
          }
        }
      }
    }
    return {
      found: false,
      distance: void 0,
      path: void 0,
      steps: x
    };
  }
};
var z5 = Yt({
  weight: function(e) {
    return 1;
  },
  directed: false
});
var V5 = {
  // Implemented from pseudocode from wikipedia
  floydWarshall: function(e) {
    for (var r = this.cy(), n = z5(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), l = s.nodes, u = s.edges, c = l.length, d = c * c, v = function(ee) {
      return l.indexOf(ee);
    }, h6 = function(ee) {
      return l[ee];
    }, f = new Array(d), p = 0; p < d; p++) {
      var m = p % c, g = (p - m) / c;
      g === m ? f[p] = 0 : f[p] = 1 / 0;
    }
    for (var y = new Array(d), b = new Array(d), w = 0; w < u.length; w++) {
      var C = u[w], E = C.source()[0], x = C.target()[0];
      if (E !== x) {
        var T = v(E), k = v(x), _ = T * c + k, D = o(C);
        if (f[_] > D && (f[_] = D, y[_] = k, b[_] = C), !i) {
          var O = k * c + T;
          !i && f[O] > D && (f[O] = D, y[O] = T, b[O] = C);
        }
      }
    }
    for (var A = 0; A < c; A++)
      for (var L = 0; L < c; L++)
        for (var N = L * c + A, I = 0; I < c; I++) {
          var M = L * c + I, F = A * c + I;
          f[N] + f[F] < f[M] && (f[M] = f[N] + f[F], y[M] = y[N]);
        }
    var $ = function(ee) {
      return (Ae(ee) ? r.filter(ee) : ee)[0];
    }, U = function(ee) {
      return v($(ee));
    }, H = {
      distance: function(ee, se) {
        var oe = U(ee), ne = U(se);
        return f[oe * c + ne];
      },
      path: function(ee, se) {
        var oe = U(ee), ne = U(se), ue = h6(oe);
        if (oe === ne)
          return ue.collection();
        if (y[oe * c + ne] == null)
          return r.collection();
        var te = r.collection(), R = oe, Y;
        for (te.merge(ue); oe !== ne; )
          R = oe, oe = y[oe * c + ne], Y = b[R * c + oe], te.merge(Y), te.merge(h6(oe));
        return te;
      }
    };
    return H;
  }
  // floydWarshall
};
var H5 = Yt({
  weight: function(e) {
    return 1;
  },
  directed: false,
  root: null
});
var K5 = {
  // Implemented from pseudocode from wikipedia
  bellmanFord: function(e) {
    var r = this, n = H5(e), a = n.weight, i = n.directed, o = n.root, s = a, l = this, u = this.cy(), c = this.byGroup(), d = c.edges, v = c.nodes, h6 = v.length, f = new Zr(), p = false, m = [];
    o = u.collection(o)[0], d.unmergeBy(function(ke) {
      return ke.isLoop();
    });
    for (var g = d.length, y = function(xe) {
      var Pe = f.get(xe.id());
      return Pe || (Pe = {}, f.set(xe.id(), Pe)), Pe;
    }, b = function(xe) {
      return (Ae(xe) ? u.$(xe) : xe)[0];
    }, w = function(xe) {
      return y(b(xe)).dist;
    }, C = function(xe) {
      for (var Pe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, Ke = b(xe), qe = [], Ne = Ke; ; ) {
        if (Ne == null)
          return r.spawn();
        var Ge = y(Ne), le = Ge.edge, S = Ge.pred;
        if (qe.unshift(Ne[0]), Ne.same(Pe) && qe.length > 0)
          break;
        le != null && qe.unshift(le), Ne = S;
      }
      return l.spawn(qe);
    }, E = 0; E < h6; E++) {
      var x = v[E], T = y(x);
      x.same(o) ? T.dist = 0 : T.dist = 1 / 0, T.pred = null, T.edge = null;
    }
    for (var k = false, _ = function(xe, Pe, Ke, qe, Ne, Ge) {
      var le = qe.dist + Ge;
      le < Ne.dist && !Ke.same(qe.edge) && (Ne.dist = le, Ne.pred = xe, Ne.edge = Ke, k = true);
    }, D = 1; D < h6; D++) {
      k = false;
      for (var O = 0; O < g; O++) {
        var A = d[O], L = A.source(), N = A.target(), I = s(A), M = y(L), F = y(N);
        _(L, N, A, M, F, I), i || _(N, L, A, F, M, I);
      }
      if (!k)
        break;
    }
    if (k)
      for (var $ = [], U = 0; U < g; U++) {
        var H = d[U], K = H.source(), ee = H.target(), se = s(H), oe = y(K).dist, ne = y(ee).dist;
        if (oe + se < ne || !i && ne + se < oe)
          if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = true), e.findNegativeWeightCycles !== false) {
            var ue = [];
            oe + se < ne && ue.push(K), !i && ne + se < oe && ue.push(ee);
            for (var te = ue.length, R = 0; R < te; R++) {
              var Y = ue[R], J = [Y];
              J.push(y(Y).edge);
              for (var ge = y(Y).pred; J.indexOf(ge) === -1; )
                J.push(ge), J.push(y(ge).edge), ge = y(ge).pred;
              J = J.slice(J.indexOf(ge));
              for (var Ee = J[0].id(), ve = 0, me = 2; me < J.length; me += 2)
                J[me].id() < Ee && (Ee = J[me].id(), ve = me);
              J = J.slice(ve).concat(J.slice(0, ve)), J.push(J[0]);
              var Ce = J.map(function(ke) {
                return ke.id();
              }).join(",");
              $.indexOf(Ce) === -1 && (m.push(l.spawn(J)), $.push(Ce));
            }
          } else
            break;
      }
    return {
      distanceTo: w,
      pathTo: C,
      hasNegativeWeightCycle: p,
      negativeWeightCycles: m
    };
  }
  // bellmanFord
};
var q5 = Math.sqrt(2);
var U5 = function(e, r, n) {
  n.length === 0 && yt("Karger-Stein must be run on a connected (sub)graph");
  for (var a = n[e], i = a[1], o = a[2], s = r[i], l = r[o], u = n, c = u.length - 1; c >= 0; c--) {
    var d = u[c], v = d[1], h6 = d[2];
    (r[v] === s && r[h6] === l || r[v] === l && r[h6] === s) && u.splice(c, 1);
  }
  for (var f = 0; f < u.length; f++) {
    var p = u[f];
    p[1] === l ? (u[f] = p.slice(), u[f][1] = s) : p[2] === l && (u[f] = p.slice(), u[f][2] = s);
  }
  for (var m = 0; m < r.length; m++)
    r[m] === l && (r[m] = s);
  return u;
};
var Nl = function(e, r, n, a) {
  for (; n > a; ) {
    var i = Math.floor(Math.random() * r.length);
    r = U5(i, e, r), n--;
  }
  return r;
};
var G5 = {
  // Computes the minimum cut of an undirected graph
  // Returns the correct answer with high probability
  kargerStein: function() {
    var e = this, r = this.byGroup(), n = r.nodes, a = r.edges;
    a.unmergeBy(function(F) {
      return F.isLoop();
    });
    var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), l = Math.floor(i / q5);
    if (i < 2) {
      yt("At least 2 nodes are required for Karger-Stein algorithm");
      return;
    }
    for (var u = [], c = 0; c < o; c++) {
      var d = a[c];
      u.push([c, n.indexOf(d.source()), n.indexOf(d.target())]);
    }
    for (var v = 1 / 0, h6 = [], f = new Array(i), p = new Array(i), m = new Array(i), g = function($, U) {
      for (var H = 0; H < i; H++)
        U[H] = $[H];
    }, y = 0; y <= s; y++) {
      for (var b = 0; b < i; b++)
        p[b] = b;
      var w = Nl(p, u.slice(), i, l), C = w.slice();
      g(p, m);
      var E = Nl(p, w, l, 2), x = Nl(m, C, l, 2);
      E.length <= x.length && E.length < v ? (v = E.length, h6 = E, g(p, f)) : x.length <= E.length && x.length < v && (v = x.length, h6 = x, g(m, f));
    }
    for (var T = this.spawn(h6.map(function(F) {
      return a[F[0]];
    })), k = this.spawn(), _ = this.spawn(), D = f[0], O = 0; O < f.length; O++) {
      var A = f[O], L = n[O];
      A === D ? k.merge(L) : _.merge(L);
    }
    var N = function($) {
      var U = e.spawn();
      return $.forEach(function(H) {
        U.merge(H), H.connectedEdges().forEach(function(K) {
          e.contains(K) && !T.contains(K) && U.merge(K);
        });
      }), U;
    }, I = [N(k), N(_)], M = {
      cut: T,
      components: I,
      // n.b. partitions are included to be compatible with the old api spec
      // (could be removed in a future major version)
      partition1: k,
      partition2: _
    };
    return M;
  }
};
var W5 = function(e) {
  return {
    x: e.x,
    y: e.y
  };
};
var il = function(e, r, n) {
  return {
    x: e.x * r + n.x,
    y: e.y * r + n.y
  };
};
var vp = function(e, r, n) {
  return {
    x: (e.x - n.x) / r,
    y: (e.y - n.y) / r
  };
};
var Ka = function(e) {
  return {
    x: e[0],
    y: e[1]
  };
};
var Y5 = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 1 / 0, i = r; i < n; i++) {
    var o = e[i];
    isFinite(o) && (a = Math.min(o, a));
  }
  return a;
};
var j5 = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = -1 / 0, i = r; i < n; i++) {
    var o = e[i];
    isFinite(o) && (a = Math.max(o, a));
  }
  return a;
};
var Z5 = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 0, i = 0, o = r; o < n; o++) {
    var s = e[o];
    isFinite(s) && (a += s, i++);
  }
  return a / i;
};
var X5 = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
  a ? e = e.slice(r, n) : (n < e.length && e.splice(n, e.length - n), r > 0 && e.splice(0, r));
  for (var s = 0, l = e.length - 1; l >= 0; l--) {
    var u = e[l];
    o ? isFinite(u) || (e[l] = -1 / 0, s++) : e.splice(l, 1);
  }
  i && e.sort(function(v, h6) {
    return v - h6;
  });
  var c = e.length, d = Math.floor(c / 2);
  return c % 2 !== 0 ? e[d + 1 + s] : (e[d - 1 + s] + e[d + s]) / 2;
};
var Q5 = function(e) {
  return Math.PI * e / 180;
};
var Wo = function(e, r) {
  return Math.atan2(r, e) - Math.PI / 2;
};
var hc = Math.log2 || function(t13) {
  return Math.log(t13) / Math.log(2);
};
var hp = function(e) {
  return e > 0 ? 1 : e < 0 ? -1 : 0;
};
var ya = function(e, r) {
  return Math.sqrt(ta(e, r));
};
var ta = function(e, r) {
  var n = r.x - e.x, a = r.y - e.y;
  return n * n + a * a;
};
var J5 = function(e) {
  for (var r = e.length, n = 0, a = 0; a < r; a++)
    n += e[a];
  for (var i = 0; i < r; i++)
    e[i] = e[i] / n;
  return e;
};
var Rt = function(e, r, n, a) {
  return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n;
};
var Wa = function(e, r, n, a) {
  return {
    x: Rt(e.x, r.x, n.x, a),
    y: Rt(e.y, r.y, n.y, a)
  };
};
var e4 = function(e, r, n, a) {
  var i = {
    x: r.x - e.x,
    y: r.y - e.y
  }, o = ya(e, r), s = {
    x: i.x / o,
    y: i.y / o
  };
  return n = n ?? 0, a = a ?? n * o, {
    x: e.x + s.x * a,
    y: e.y + s.y * a
  };
};
var so = function(e, r, n) {
  return Math.max(e, Math.min(n, r));
};
var pr = function(e) {
  if (e == null)
    return {
      x1: 1 / 0,
      y1: 1 / 0,
      x2: -1 / 0,
      y2: -1 / 0,
      w: 0,
      h: 0
    };
  if (e.x1 != null && e.y1 != null) {
    if (e.x2 != null && e.y2 != null && e.x2 >= e.x1 && e.y2 >= e.y1)
      return {
        x1: e.x1,
        y1: e.y1,
        x2: e.x2,
        y2: e.y2,
        w: e.x2 - e.x1,
        h: e.y2 - e.y1
      };
    if (e.w != null && e.h != null && e.w >= 0 && e.h >= 0)
      return {
        x1: e.x1,
        y1: e.y1,
        x2: e.x1 + e.w,
        y2: e.y1 + e.h,
        w: e.w,
        h: e.h
      };
  }
};
var t4 = function(e) {
  return {
    x1: e.x1,
    x2: e.x2,
    w: e.w,
    y1: e.y1,
    y2: e.y2,
    h: e.h
  };
};
var r4 = function(e) {
  e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0;
};
var n4 = function(e, r, n) {
  return {
    x1: e.x1 + r,
    x2: e.x2 + r,
    y1: e.y1 + n,
    y2: e.y2 + n,
    w: e.w,
    h: e.h
  };
};
var pp = function(e, r) {
  e.x1 = Math.min(e.x1, r.x1), e.x2 = Math.max(e.x2, r.x2), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, r.y1), e.y2 = Math.max(e.y2, r.y2), e.h = e.y2 - e.y1;
};
var a4 = function(e, r, n) {
  e.x1 = Math.min(e.x1, r), e.x2 = Math.max(e.x2, r), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, n), e.y2 = Math.max(e.y2, n), e.h = e.y2 - e.y1;
};
var us = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  return e.x1 -= r, e.x2 += r, e.y1 -= r, e.y2 += r, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e;
};
var cs = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], n, a, i, o;
  if (r.length === 1)
    n = a = i = o = r[0];
  else if (r.length === 2)
    n = i = r[0], o = a = r[1];
  else if (r.length === 4) {
    var s = Mr(r, 4);
    n = s[0], a = s[1], i = s[2], o = s[3];
  }
  return e.x1 -= o, e.x2 += a, e.y1 -= n, e.y2 += i, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e;
};
var ff = function(e, r) {
  e.x1 = r.x1, e.y1 = r.y1, e.x2 = r.x2, e.y2 = r.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1;
};
var pc = function(e, r) {
  return !(e.x1 > r.x2 || r.x1 > e.x2 || e.x2 < r.x1 || r.x2 < e.x1 || e.y2 < r.y1 || r.y2 < e.y1 || e.y1 > r.y2 || r.y1 > e.y2);
};
var si = function(e, r, n) {
  return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2;
};
var i4 = function(e, r) {
  return si(e, r.x, r.y);
};
var gp = function(e, r) {
  return si(e, r.x1, r.y1) && si(e, r.x2, r.y2);
};
var mp = function(e, r, n, a, i, o, s) {
  var l = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", u = l === "auto" ? ba(i, o) : l, c = i / 2, d = o / 2;
  u = Math.min(u, c, d);
  var v = u !== c, h6 = u !== d, f;
  if (v) {
    var p = n - c + u - s, m = a - d - s, g = n + c - u + s, y = m;
    if (f = Nn(e, r, n, a, p, m, g, y, false), f.length > 0)
      return f;
  }
  if (h6) {
    var b = n + c + s, w = a - d + u - s, C = b, E = a + d - u + s;
    if (f = Nn(e, r, n, a, b, w, C, E, false), f.length > 0)
      return f;
  }
  if (v) {
    var x = n - c + u - s, T = a + d + s, k = n + c - u + s, _ = T;
    if (f = Nn(e, r, n, a, x, T, k, _, false), f.length > 0)
      return f;
  }
  if (h6) {
    var D = n - c - s, O = a - d + u - s, A = D, L = a + d - u + s;
    if (f = Nn(e, r, n, a, D, O, A, L, false), f.length > 0)
      return f;
  }
  var N;
  {
    var I = n - c + u, M = a - d + u;
    if (N = zi(e, r, n, a, I, M, u + s), N.length > 0 && N[0] <= I && N[1] <= M)
      return [N[0], N[1]];
  }
  {
    var F = n + c - u, $ = a - d + u;
    if (N = zi(e, r, n, a, F, $, u + s), N.length > 0 && N[0] >= F && N[1] <= $)
      return [N[0], N[1]];
  }
  {
    var U = n + c - u, H = a + d - u;
    if (N = zi(e, r, n, a, U, H, u + s), N.length > 0 && N[0] >= U && N[1] >= H)
      return [N[0], N[1]];
  }
  {
    var K = n - c + u, ee = a + d - u;
    if (N = zi(e, r, n, a, K, ee, u + s), N.length > 0 && N[0] <= K && N[1] >= ee)
      return [N[0], N[1]];
  }
  return [];
};
var o4 = function(e, r, n, a, i, o, s) {
  var l = s, u = Math.min(n, i), c = Math.max(n, i), d = Math.min(a, o), v = Math.max(a, o);
  return u - l <= e && e <= c + l && d - l <= r && r <= v + l;
};
var s4 = function(e, r, n, a, i, o, s, l, u) {
  var c = {
    x1: Math.min(n, s, i) - u,
    x2: Math.max(n, s, i) + u,
    y1: Math.min(a, l, o) - u,
    y2: Math.max(a, l, o) + u
  };
  return !(e < c.x1 || e > c.x2 || r < c.y1 || r > c.y2);
};
var l4 = function(e, r, n, a) {
  n -= a;
  var i = r * r - 4 * e * n;
  if (i < 0)
    return [];
  var o = Math.sqrt(i), s = 2 * e, l = (-r + o) / s, u = (-r - o) / s;
  return [l, u];
};
var u4 = function(e, r, n, a, i) {
  var o = 1e-5;
  e === 0 && (e = o), r /= e, n /= e, a /= e;
  var s, l, u, c, d, v, h6, f;
  if (l = (3 * n - r * r) / 9, u = -(27 * a) + r * (9 * n - 2 * (r * r)), u /= 54, s = l * l * l + u * u, i[1] = 0, h6 = r / 3, s > 0) {
    d = u + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), v = u - Math.sqrt(s), v = v < 0 ? -Math.pow(-v, 1 / 3) : Math.pow(v, 1 / 3), i[0] = -h6 + d + v, h6 += (d + v) / 2, i[4] = i[2] = -h6, h6 = Math.sqrt(3) * (-v + d) / 2, i[3] = h6, i[5] = -h6;
    return;
  }
  if (i[5] = i[3] = 0, s === 0) {
    f = u < 0 ? -Math.pow(-u, 1 / 3) : Math.pow(u, 1 / 3), i[0] = -h6 + 2 * f, i[4] = i[2] = -(f + h6);
    return;
  }
  l = -l, c = l * l * l, c = Math.acos(u / Math.sqrt(c)), f = 2 * Math.sqrt(l), i[0] = -h6 + f * Math.cos(c / 3), i[2] = -h6 + f * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h6 + f * Math.cos((c + 4 * Math.PI) / 3);
};
var c4 = function(e, r, n, a, i, o, s, l) {
  var u = 1 * n * n - 4 * n * i + 2 * n * s + 4 * i * i - 4 * i * s + s * s + a * a - 4 * a * o + 2 * a * l + 4 * o * o - 4 * o * l + l * l, c = 1 * 9 * n * i - 3 * n * n - 3 * n * s - 6 * i * i + 3 * i * s + 9 * a * o - 3 * a * a - 3 * a * l - 6 * o * o + 3 * o * l, d = 1 * 3 * n * n - 6 * n * i + n * s - n * e + 2 * i * i + 2 * i * e - s * e + 3 * a * a - 6 * a * o + a * l - a * r + 2 * o * o + 2 * o * r - l * r, v = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h6 = [];
  u4(u, c, d, v, h6);
  for (var f = 1e-7, p = [], m = 0; m < 6; m += 2)
    Math.abs(h6[m + 1]) < f && h6[m] >= 0 && h6[m] <= 1 && p.push(h6[m]);
  p.push(1), p.push(0);
  for (var g = -1, y, b, w, C = 0; C < p.length; C++)
    y = Math.pow(1 - p[C], 2) * n + 2 * (1 - p[C]) * p[C] * i + p[C] * p[C] * s, b = Math.pow(1 - p[C], 2) * a + 2 * (1 - p[C]) * p[C] * o + p[C] * p[C] * l, w = Math.pow(y - e, 2) + Math.pow(b - r, 2), g >= 0 ? w < g && (g = w) : g = w;
  return g;
};
var d4 = function(e, r, n, a, i, o) {
  var s = [e - n, r - a], l = [i - n, o - a], u = l[0] * l[0] + l[1] * l[1], c = s[0] * s[0] + s[1] * s[1], d = s[0] * l[0] + s[1] * l[1], v = d * d / u;
  return d < 0 ? c : v > u ? (e - i) * (e - i) + (r - o) * (r - o) : c - v;
};
var dr = function(e, r, n) {
  for (var a, i, o, s, l, u = 0, c = 0; c < n.length / 2; c++)
    if (a = n[c * 2], i = n[c * 2 + 1], c + 1 < n.length / 2 ? (o = n[(c + 1) * 2], s = n[(c + 1) * 2 + 1]) : (o = n[(c + 1 - n.length / 2) * 2], s = n[(c + 1 - n.length / 2) * 2 + 1]), !(a == e && o == e)) if (a >= e && e >= o || a <= e && e <= o)
      l = (e - a) / (o - a) * (s - i) + i, l > r && u++;
    else
      continue;
  return u % 2 !== 0;
};
var mn = function(e, r, n, a, i, o, s, l, u) {
  var c = new Array(n.length), d;
  l[0] != null ? (d = Math.atan(l[1] / l[0]), l[0] < 0 ? d = d + Math.PI / 2 : d = -d - Math.PI / 2) : d = l;
  for (var v = Math.cos(-d), h6 = Math.sin(-d), f = 0; f < c.length / 2; f++)
    c[f * 2] = o / 2 * (n[f * 2] * v - n[f * 2 + 1] * h6), c[f * 2 + 1] = s / 2 * (n[f * 2 + 1] * v + n[f * 2] * h6), c[f * 2] += a, c[f * 2 + 1] += i;
  var p;
  if (u > 0) {
    var m = As(c, -u);
    p = Is(m);
  } else
    p = c;
  return dr(e, r, p);
};
var f4 = function(e, r, n, a, i, o, s, l) {
  for (var u = new Array(n.length * 2), c = 0; c < l.length; c++) {
    var d = l[c];
    u[c * 4 + 0] = d.startX, u[c * 4 + 1] = d.startY, u[c * 4 + 2] = d.stopX, u[c * 4 + 3] = d.stopY;
    var v = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2);
    if (v <= Math.pow(d.radius, 2))
      return true;
  }
  return dr(e, r, u);
};
var Is = function(e) {
  for (var r = new Array(e.length / 2), n, a, i, o, s, l, u, c, d = 0; d < e.length / 4; d++) {
    n = e[d * 4], a = e[d * 4 + 1], i = e[d * 4 + 2], o = e[d * 4 + 3], d < e.length / 4 - 1 ? (s = e[(d + 1) * 4], l = e[(d + 1) * 4 + 1], u = e[(d + 1) * 4 + 2], c = e[(d + 1) * 4 + 3]) : (s = e[0], l = e[1], u = e[2], c = e[3]);
    var v = Nn(n, a, i, o, s, l, u, c, true);
    r[d * 2] = v[0], r[d * 2 + 1] = v[1];
  }
  return r;
};
var As = function(e, r) {
  for (var n = new Array(e.length * 2), a, i, o, s, l = 0; l < e.length / 2; l++) {
    a = e[l * 2], i = e[l * 2 + 1], l < e.length / 2 - 1 ? (o = e[(l + 1) * 2], s = e[(l + 1) * 2 + 1]) : (o = e[0], s = e[1]);
    var u = s - i, c = -(o - a), d = Math.sqrt(u * u + c * c), v = u / d, h6 = c / d;
    n[l * 4] = a + v * r, n[l * 4 + 1] = i + h6 * r, n[l * 4 + 2] = o + v * r, n[l * 4 + 3] = s + h6 * r;
  }
  return n;
};
var v4 = function(e, r, n, a, i, o) {
  var s = n - e, l = a - r;
  s /= i, l /= o;
  var u = Math.sqrt(s * s + l * l), c = u - 1;
  if (c < 0)
    return [];
  var d = c / u;
  return [(n - e) * d + e, (a - r) * d + r];
};
var la = function(e, r, n, a, i, o, s) {
  return e -= i, r -= o, e /= n / 2 + s, r /= a / 2 + s, e * e + r * r <= 1;
};
var zi = function(e, r, n, a, i, o, s) {
  var l = [n - e, a - r], u = [e - i, r - o], c = l[0] * l[0] + l[1] * l[1], d = 2 * (u[0] * l[0] + u[1] * l[1]), v = u[0] * u[0] + u[1] * u[1] - s * s, h6 = d * d - 4 * c * v;
  if (h6 < 0)
    return [];
  var f = (-d + Math.sqrt(h6)) / (2 * c), p = (-d - Math.sqrt(h6)) / (2 * c), m = Math.min(f, p), g = Math.max(f, p), y = [];
  if (m >= 0 && m <= 1 && y.push(m), g >= 0 && g <= 1 && y.push(g), y.length === 0)
    return [];
  var b = y[0] * l[0] + e, w = y[0] * l[1] + r;
  if (y.length > 1) {
    if (y[0] == y[1])
      return [b, w];
    var C = y[1] * l[0] + e, E = y[1] * l[1] + r;
    return [b, w, C, E];
  } else
    return [b, w];
};
var Rl = function(e, r, n) {
  return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n;
};
var Nn = function(e, r, n, a, i, o, s, l, u) {
  var c = e - i, d = n - e, v = s - i, h6 = r - o, f = a - r, p = l - o, m = v * h6 - p * c, g = d * h6 - f * c, y = p * d - v * f;
  if (y !== 0) {
    var b = m / y, w = g / y, C = 1e-3, E = 0 - C, x = 1 + C;
    return E <= b && b <= x && E <= w && w <= x ? [e + b * d, r + b * f] : u ? [e + b * d, r + b * f] : [];
  } else
    return m === 0 || g === 0 ? Rl(e, n, s) === s ? [s, l] : Rl(e, n, i) === i ? [i, o] : Rl(i, s, n) === n ? [n, a] : [] : [];
};
var lo = function(e, r, n, a, i, o, s, l) {
  var u = [], c, d = new Array(n.length), v = true;
  o == null && (v = false);
  var h6;
  if (v) {
    for (var f = 0; f < d.length / 2; f++)
      d[f * 2] = n[f * 2] * o + a, d[f * 2 + 1] = n[f * 2 + 1] * s + i;
    if (l > 0) {
      var p = As(d, -l);
      h6 = Is(p);
    } else
      h6 = d;
  } else
    h6 = n;
  for (var m, g, y, b, w = 0; w < h6.length / 2; w++)
    m = h6[w * 2], g = h6[w * 2 + 1], w < h6.length / 2 - 1 ? (y = h6[(w + 1) * 2], b = h6[(w + 1) * 2 + 1]) : (y = h6[0], b = h6[1]), c = Nn(e, r, a, i, m, g, y, b), c.length !== 0 && u.push(c[0], c[1]);
  return u;
};
var h4 = function(e, r, n, a, i, o, s, l, u) {
  var c = [], d, v = new Array(n.length * 2);
  u.forEach(function(y, b) {
    b === 0 ? (v[v.length - 2] = y.startX, v[v.length - 1] = y.startY) : (v[b * 4 - 2] = y.startX, v[b * 4 - 1] = y.startY), v[b * 4] = y.stopX, v[b * 4 + 1] = y.stopY, d = zi(e, r, a, i, y.cx, y.cy, y.radius), d.length !== 0 && c.push(d[0], d[1]);
  });
  for (var h6 = 0; h6 < v.length / 4; h6++)
    d = Nn(e, r, a, i, v[h6 * 4], v[h6 * 4 + 1], v[h6 * 4 + 2], v[h6 * 4 + 3], false), d.length !== 0 && c.push(d[0], d[1]);
  if (c.length > 2) {
    for (var f = [c[0], c[1]], p = Math.pow(f[0] - e, 2) + Math.pow(f[1] - r, 2), m = 1; m < c.length / 2; m++) {
      var g = Math.pow(c[m * 2] - e, 2) + Math.pow(c[m * 2 + 1] - r, 2);
      g <= p && (f[0] = c[m * 2], f[1] = c[m * 2 + 1], p = g);
    }
    return f;
  }
  return c;
};
var Yo = function(e, r, n) {
  var a = [e[0] - r[0], e[1] - r[1]], i = Math.sqrt(a[0] * a[0] + a[1] * a[1]), o = (i - n) / i;
  return o < 0 && (o = 1e-5), [r[0] + o * a[0], r[1] + o * a[1]];
};
var sr = function(e, r) {
  var n = cu(e, r);
  return n = yp(n), n;
};
var yp = function(e) {
  for (var r, n, a = e.length / 2, i = 1 / 0, o = 1 / 0, s = -1 / 0, l = -1 / 0, u = 0; u < a; u++)
    r = e[2 * u], n = e[2 * u + 1], i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), l = Math.max(l, n);
  for (var c = 2 / (s - i), d = 2 / (l - o), v = 0; v < a; v++)
    r = e[2 * v] = e[2 * v] * c, n = e[2 * v + 1] = e[2 * v + 1] * d, i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), l = Math.max(l, n);
  if (o < -1)
    for (var h6 = 0; h6 < a; h6++)
      n = e[2 * h6 + 1] = e[2 * h6 + 1] + (-1 - o);
  return e;
};
var cu = function(e, r) {
  var n = 1 / e * 2 * Math.PI, a = e % 2 === 0 ? Math.PI / 2 + n / 2 : Math.PI / 2;
  a += r;
  for (var i = new Array(e * 2), o, s = 0; s < e; s++)
    o = s * n + a, i[2 * s] = Math.cos(o), i[2 * s + 1] = Math.sin(-o);
  return i;
};
var ba = function(e, r) {
  return Math.min(e / 4, r / 4, 8);
};
var bp = function(e, r) {
  return Math.min(e / 10, r / 10, 8);
};
var gc = function() {
  return 8;
};
var p4 = function(e, r, n) {
  return [e - 2 * r + n, 2 * (r - e), e];
};
var du = function(e, r) {
  return {
    heightOffset: Math.min(15, 0.05 * r),
    widthOffset: Math.min(100, 0.25 * e),
    ctrlPtOffsetPct: 0.05
  };
};
var g4 = Yt({
  dampingFactor: 0.8,
  precision: 1e-6,
  iterations: 200,
  weight: function(e) {
    return 1;
  }
});
var m4 = {
  pageRank: function(e) {
    for (var r = g4(e), n = r.dampingFactor, a = r.precision, i = r.iterations, o = r.weight, s = this._private.cy, l = this.byGroup(), u = l.nodes, c = l.edges, d = u.length, v = d * d, h6 = c.length, f = new Array(v), p = new Array(d), m = (1 - n) / d, g = 0; g < d; g++) {
      for (var y = 0; y < d; y++) {
        var b = g * d + y;
        f[b] = 0;
      }
      p[g] = 0;
    }
    for (var w = 0; w < h6; w++) {
      var C = c[w], E = C.data("source"), x = C.data("target");
      if (E !== x) {
        var T = u.indexOfId(E), k = u.indexOfId(x), _ = o(C), D = k * d + T;
        f[D] += _, p[T] += _;
      }
    }
    for (var O = 1 / d + m, A = 0; A < d; A++)
      if (p[A] === 0)
        for (var L = 0; L < d; L++) {
          var N = L * d + A;
          f[N] = O;
        }
      else
        for (var I = 0; I < d; I++) {
          var M = I * d + A;
          f[M] = f[M] / p[A] + m;
        }
    for (var F = new Array(d), $ = new Array(d), U, H = 0; H < d; H++)
      F[H] = 1;
    for (var K = 0; K < i; K++) {
      for (var ee = 0; ee < d; ee++)
        $[ee] = 0;
      for (var se = 0; se < d; se++)
        for (var oe = 0; oe < d; oe++) {
          var ne = se * d + oe;
          $[se] += f[ne] * F[oe];
        }
      J5($), U = F, F = $, $ = U;
      for (var ue = 0, te = 0; te < d; te++) {
        var R = U[te] - F[te];
        ue += R * R;
      }
      if (ue < a)
        break;
    }
    var Y = {
      rank: function(ge) {
        return ge = s.collection(ge)[0], F[u.indexOf(ge)];
      }
    };
    return Y;
  }
  // pageRank
};
var vf = Yt({
  root: null,
  weight: function(e) {
    return 1;
  },
  directed: false,
  alpha: 0
});
var Ya = {
  degreeCentralityNormalized: function(e) {
    e = vf(e);
    var r = this.cy(), n = this.nodes(), a = n.length;
    if (e.directed) {
      for (var c = {}, d = {}, v = 0, h6 = 0, f = 0; f < a; f++) {
        var p = n[f], m = p.id();
        e.root = p;
        var g = this.degreeCentrality(e);
        v < g.indegree && (v = g.indegree), h6 < g.outdegree && (h6 = g.outdegree), c[m] = g.indegree, d[m] = g.outdegree;
      }
      return {
        indegree: function(b) {
          return v == 0 ? 0 : (Ae(b) && (b = r.filter(b)), c[b.id()] / v);
        },
        outdegree: function(b) {
          return h6 === 0 ? 0 : (Ae(b) && (b = r.filter(b)), d[b.id()] / h6);
        }
      };
    } else {
      for (var i = {}, o = 0, s = 0; s < a; s++) {
        var l = n[s];
        e.root = l;
        var u = this.degreeCentrality(e);
        o < u.degree && (o = u.degree), i[l.id()] = u.degree;
      }
      return {
        degree: function(b) {
          return o === 0 ? 0 : (Ae(b) && (b = r.filter(b)), i[b.id()] / o);
        }
      };
    }
  },
  // degreeCentralityNormalized
  // Implemented from the algorithm in Opsahl's paper
  // "Node centrality in weighted networks: Generalizing degree and shortest paths"
  // check the heading 2 "Degree"
  degreeCentrality: function(e) {
    e = vf(e);
    var r = this.cy(), n = this, a = e, i = a.root, o = a.weight, s = a.directed, l = a.alpha;
    if (i = r.collection(i)[0], s) {
      for (var h6 = i.connectedEdges(), f = h6.filter(function(E) {
        return E.target().same(i) && n.has(E);
      }), p = h6.filter(function(E) {
        return E.source().same(i) && n.has(E);
      }), m = f.length, g = p.length, y = 0, b = 0, w = 0; w < f.length; w++)
        y += o(f[w]);
      for (var C = 0; C < p.length; C++)
        b += o(p[C]);
      return {
        indegree: Math.pow(m, 1 - l) * Math.pow(y, l),
        outdegree: Math.pow(g, 1 - l) * Math.pow(b, l)
      };
    } else {
      for (var u = i.connectedEdges().intersection(n), c = u.length, d = 0, v = 0; v < u.length; v++)
        d += o(u[v]);
      return {
        degree: Math.pow(c, 1 - l) * Math.pow(d, l)
      };
    }
  }
  // degreeCentrality
};
Ya.dc = Ya.degreeCentrality;
Ya.dcn = Ya.degreeCentralityNormalised = Ya.degreeCentralityNormalized;
var hf = Yt({
  harmonic: true,
  weight: function() {
    return 1;
  },
  directed: false,
  root: null
});
var ja = {
  closenessCentralityNormalized: function(e) {
    for (var r = hf(e), n = r.harmonic, a = r.weight, i = r.directed, o = this.cy(), s = {}, l = 0, u = this.nodes(), c = this.floydWarshall({
      weight: a,
      directed: i
    }), d = 0; d < u.length; d++) {
      for (var v = 0, h6 = u[d], f = 0; f < u.length; f++)
        if (d !== f) {
          var p = c.distance(h6, u[f]);
          n ? v += 1 / p : v += p;
        }
      n || (v = 1 / v), l < v && (l = v), s[h6.id()] = v;
    }
    return {
      closeness: function(g) {
        return l == 0 ? 0 : (Ae(g) ? g = o.filter(g)[0].id() : g = g.id(), s[g] / l);
      }
    };
  },
  // Implemented from pseudocode from wikipedia
  closenessCentrality: function(e) {
    var r = hf(e), n = r.root, a = r.weight, i = r.directed, o = r.harmonic;
    n = this.filter(n)[0];
    for (var s = this.dijkstra({
      root: n,
      weight: a,
      directed: i
    }), l = 0, u = this.nodes(), c = 0; c < u.length; c++) {
      var d = u[c];
      if (!d.same(n)) {
        var v = s.distanceTo(d);
        o ? l += 1 / v : l += v;
      }
    }
    return o ? l : 1 / l;
  }
  // closenessCentrality
};
ja.cc = ja.closenessCentrality;
ja.ccn = ja.closenessCentralityNormalised = ja.closenessCentralityNormalized;
var y4 = Yt({
  weight: null,
  directed: false
});
var fu = {
  // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes
  betweennessCentrality: function(e) {
    for (var r = y4(e), n = r.directed, a = r.weight, i = a != null, o = this.cy(), s = this.nodes(), l = {}, u = {}, c = 0, d = {
      set: function(b, w) {
        u[b] = w, w > c && (c = w);
      },
      get: function(b) {
        return u[b];
      }
    }, v = 0; v < s.length; v++) {
      var h6 = s[v], f = h6.id();
      n ? l[f] = h6.outgoers().nodes() : l[f] = h6.openNeighborhood().nodes(), d.set(f, 0);
    }
    for (var p = function(b) {
      for (var w = s[b].id(), C = [], E = {}, x = {}, T = {}, k = new Oo(function(oe, ne) {
        return T[oe] - T[ne];
      }), _ = 0; _ < s.length; _++) {
        var D = s[_].id();
        E[D] = [], x[D] = 0, T[D] = 1 / 0;
      }
      for (x[w] = 1, T[w] = 0, k.push(w); !k.empty(); ) {
        var O = k.pop();
        if (C.push(O), i)
          for (var A = 0; A < l[O].length; A++) {
            var L = l[O][A], N = o.getElementById(O), I = void 0;
            N.edgesTo(L).length > 0 ? I = N.edgesTo(L)[0] : I = L.edgesTo(N)[0];
            var M = a(I);
            L = L.id(), T[L] > T[O] + M && (T[L] = T[O] + M, k.nodes.indexOf(L) < 0 ? k.push(L) : k.updateItem(L), x[L] = 0, E[L] = []), T[L] == T[O] + M && (x[L] = x[L] + x[O], E[L].push(O));
          }
        else
          for (var F = 0; F < l[O].length; F++) {
            var $ = l[O][F].id();
            T[$] == 1 / 0 && (k.push($), T[$] = T[O] + 1), T[$] == T[O] + 1 && (x[$] = x[$] + x[O], E[$].push(O));
          }
      }
      for (var U = {}, H = 0; H < s.length; H++)
        U[s[H].id()] = 0;
      for (; C.length > 0; ) {
        for (var K = C.pop(), ee = 0; ee < E[K].length; ee++) {
          var se = E[K][ee];
          U[se] = U[se] + x[se] / x[K] * (1 + U[K]);
        }
        K != s[b].id() && d.set(K, d.get(K) + U[K]);
      }
    }, m = 0; m < s.length; m++)
      p(m);
    var g = {
      betweenness: function(b) {
        var w = o.collection(b).id();
        return d.get(w);
      },
      betweennessNormalized: function(b) {
        if (c == 0)
          return 0;
        var w = o.collection(b).id();
        return d.get(w) / c;
      }
    };
    return g.betweennessNormalised = g.betweennessNormalized, g;
  }
  // betweennessCentrality
};
fu.bc = fu.betweennessCentrality;
var b4 = Yt({
  expandFactor: 2,
  // affects time of computation and cluster granularity to some extent: M * M
  inflateFactor: 2,
  // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j)
  multFactor: 1,
  // optional self loops for each node. Use a neutral value to improve cluster computations.
  maxIterations: 20,
  // maximum number of iterations of the MCL algorithm in a single run
  attributes: [
    // attributes/features used to group nodes, ie. similarity values between nodes
    function(t13) {
      return 1;
    }
  ]
});
var w4 = function(e) {
  return b4(e);
};
var C4 = function(e, r) {
  for (var n = 0, a = 0; a < r.length; a++)
    n += r[a](e);
  return n;
};
var x4 = function(e, r, n) {
  for (var a = 0; a < r; a++)
    e[a * r + a] = n;
};
var wp = function(e, r) {
  for (var n, a = 0; a < r; a++) {
    n = 0;
    for (var i = 0; i < r; i++)
      n += e[i * r + a];
    for (var o = 0; o < r; o++)
      e[o * r + a] = e[o * r + a] / n;
  }
};
var E4 = function(e, r, n) {
  for (var a = new Array(n * n), i = 0; i < n; i++) {
    for (var o = 0; o < n; o++)
      a[i * n + o] = 0;
    for (var s = 0; s < n; s++)
      for (var l = 0; l < n; l++)
        a[i * n + l] += e[i * n + s] * r[s * n + l];
  }
  return a;
};
var k4 = function(e, r, n) {
  for (var a = e.slice(0), i = 1; i < n; i++)
    e = E4(e, a, r);
  return e;
};
var S4 = function(e, r, n) {
  for (var a = new Array(r * r), i = 0; i < r * r; i++)
    a[i] = Math.pow(e[i], n);
  return wp(a, r), a;
};
var T4 = function(e, r, n, a) {
  for (var i = 0; i < n; i++) {
    var o = Math.round(e[i] * Math.pow(10, a)) / Math.pow(10, a), s = Math.round(r[i] * Math.pow(10, a)) / Math.pow(10, a);
    if (o !== s)
      return false;
  }
  return true;
};
var _4 = function(e, r, n, a) {
  for (var i = [], o = 0; o < r; o++) {
    for (var s = [], l = 0; l < r; l++)
      Math.round(e[o * r + l] * 1e3) / 1e3 > 0 && s.push(n[l]);
    s.length !== 0 && i.push(a.collection(s));
  }
  return i;
};
var D4 = function(e, r) {
  for (var n = 0; n < e.length; n++)
    if (!r[n] || e[n].id() !== r[n].id())
      return false;
  return true;
};
var P4 = function(e) {
  for (var r = 0; r < e.length; r++)
    for (var n = 0; n < e.length; n++)
      r != n && D4(e[r], e[n]) && e.splice(n, 1);
  return e;
};
var pf = function(e) {
  for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = w4(e), o = {}, s = 0; s < r.length; s++)
    o[r[s].id()] = s;
  for (var l = r.length, u = l * l, c = new Array(u), d, v = 0; v < u; v++)
    c[v] = 0;
  for (var h6 = 0; h6 < n.length; h6++) {
    var f = n[h6], p = o[f.source().id()], m = o[f.target().id()], g = C4(f, i.attributes);
    c[p * l + m] += g, c[m * l + p] += g;
  }
  x4(c, l, i.multFactor), wp(c, l);
  for (var y = true, b = 0; y && b < i.maxIterations; )
    y = false, d = k4(c, l, i.expandFactor), c = S4(d, l, i.inflateFactor), T4(c, d, u, 4) || (y = true), b++;
  var w = _4(c, l, r, a);
  return w = P4(w), w;
};
var O4 = {
  markovClustering: pf,
  mcl: pf
};
var L4 = function(e) {
  return e;
};
var Cp = function(e, r) {
  return Math.abs(r - e);
};
var gf = function(e, r, n) {
  return e + Cp(r, n);
};
var mf = function(e, r, n) {
  return e + Math.pow(n - r, 2);
};
var I4 = function(e) {
  return Math.sqrt(e);
};
var A4 = function(e, r, n) {
  return Math.max(e, Cp(r, n));
};
var Ai = function(e, r, n, a, i) {
  for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : L4, s = a, l, u, c = 0; c < e; c++)
    l = r(c), u = n(c), s = i(s, l, u);
  return o(s);
};
var li = {
  euclidean: function(e, r, n) {
    return e >= 2 ? Ai(e, r, n, 0, mf, I4) : Ai(e, r, n, 0, gf);
  },
  squaredEuclidean: function(e, r, n) {
    return Ai(e, r, n, 0, mf);
  },
  manhattan: function(e, r, n) {
    return Ai(e, r, n, 0, gf);
  },
  max: function(e, r, n) {
    return Ai(e, r, n, -1 / 0, A4);
  }
};
li["squared-euclidean"] = li.squaredEuclidean;
li.squaredeuclidean = li.squaredEuclidean;
function ol(t13, e, r, n, a, i) {
  var o;
  return pt(t13) ? o = t13 : o = li[t13] || li.euclidean, e === 0 && pt(t13) ? o(a, i) : o(e, r, n, a, i);
}
var F4 = Yt({
  k: 2,
  m: 2,
  sensitivityThreshold: 1e-4,
  distance: "euclidean",
  maxIterations: 10,
  attributes: [],
  testMode: false,
  testCentroids: null
});
var mc = function(e) {
  return F4(e);
};
var Fs = function(e, r, n, a, i) {
  var o = i !== "kMedoids", s = o ? function(d) {
    return n[d];
  } : function(d) {
    return a[d](n);
  }, l = function(v) {
    return a[v](r);
  }, u = n, c = r;
  return ol(e, a.length, s, l, u, c);
};
var $l = function(e, r, n) {
  for (var a = n.length, i = new Array(a), o = new Array(a), s = new Array(r), l = null, u = 0; u < a; u++)
    i[u] = e.min(n[u]).value, o[u] = e.max(n[u]).value;
  for (var c = 0; c < r; c++) {
    l = [];
    for (var d = 0; d < a; d++)
      l[d] = Math.random() * (o[d] - i[d]) + i[d];
    s[c] = l;
  }
  return s;
};
var xp = function(e, r, n, a, i) {
  for (var o = 1 / 0, s = 0, l = 0; l < r.length; l++) {
    var u = Fs(n, e, r[l], a, i);
    u < o && (o = u, s = l);
  }
  return s;
};
var Ep = function(e, r, n) {
  for (var a = [], i = null, o = 0; o < r.length; o++)
    i = r[o], n[i.id()] === e && a.push(i);
  return a;
};
var M4 = function(e, r, n) {
  return Math.abs(r - e) <= n;
};
var B4 = function(e, r, n) {
  for (var a = 0; a < e.length; a++)
    for (var i = 0; i < e[a].length; i++) {
      var o = Math.abs(e[a][i] - r[a][i]);
      if (o > n)
        return false;
    }
  return true;
};
var N4 = function(e, r, n) {
  for (var a = 0; a < n; a++)
    if (e === r[a]) return true;
  return false;
};
var yf = function(e, r) {
  var n = new Array(r);
  if (e.length < 50)
    for (var a = 0; a < r; a++) {
      for (var i = e[Math.floor(Math.random() * e.length)]; N4(i, n, a); )
        i = e[Math.floor(Math.random() * e.length)];
      n[a] = i;
    }
  else
    for (var o = 0; o < r; o++)
      n[o] = e[Math.floor(Math.random() * e.length)];
  return n;
};
var bf = function(e, r, n) {
  for (var a = 0, i = 0; i < r.length; i++)
    a += Fs("manhattan", r[i], e, n, "kMedoids");
  return a;
};
var R4 = function(e) {
  var r = this.cy(), n = this.nodes(), a = null, i = mc(e), o = new Array(i.k), s = {}, l;
  i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, l = $l(n, i.k, i.attributes)) : Ft(i.testCentroids) === "object" ? l = i.testCentroids : l = $l(n, i.k, i.attributes) : l = $l(n, i.k, i.attributes);
  for (var u = true, c = 0; u && c < i.maxIterations; ) {
    for (var d = 0; d < n.length; d++)
      a = n[d], s[a.id()] = xp(a, l, i.distance, i.attributes, "kMeans");
    u = false;
    for (var v = 0; v < i.k; v++) {
      var h6 = Ep(v, n, s);
      if (h6.length !== 0) {
        for (var f = i.attributes.length, p = l[v], m = new Array(f), g = new Array(f), y = 0; y < f; y++) {
          g[y] = 0;
          for (var b = 0; b < h6.length; b++)
            a = h6[b], g[y] += i.attributes[y](a);
          m[y] = g[y] / h6.length, M4(m[y], p[y], i.sensitivityThreshold) || (u = true);
        }
        l[v] = m, o[v] = r.collection(h6);
      }
    }
    c++;
  }
  return o;
};
var $4 = function(e) {
  var r = this.cy(), n = this.nodes(), a = null, i = mc(e), o = new Array(i.k), s, l = {}, u, c = new Array(i.k);
  i.testMode ? typeof i.testCentroids == "number" || (Ft(i.testCentroids) === "object" ? s = i.testCentroids : s = yf(n, i.k)) : s = yf(n, i.k);
  for (var d = true, v = 0; d && v < i.maxIterations; ) {
    for (var h6 = 0; h6 < n.length; h6++)
      a = n[h6], l[a.id()] = xp(a, s, i.distance, i.attributes, "kMedoids");
    d = false;
    for (var f = 0; f < s.length; f++) {
      var p = Ep(f, n, l);
      if (p.length !== 0) {
        c[f] = bf(s[f], p, i.attributes);
        for (var m = 0; m < p.length; m++)
          u = bf(p[m], p, i.attributes), u < c[f] && (c[f] = u, s[f] = p[m], d = true);
        o[f] = r.collection(p);
      }
    }
    v++;
  }
  return o;
};
var z4 = function(e, r, n, a, i) {
  for (var o, s, l = 0; l < r.length; l++)
    for (var u = 0; u < e.length; u++)
      a[l][u] = Math.pow(n[l][u], i.m);
  for (var c = 0; c < e.length; c++)
    for (var d = 0; d < i.attributes.length; d++) {
      o = 0, s = 0;
      for (var v = 0; v < r.length; v++)
        o += a[v][c] * i.attributes[d](r[v]), s += a[v][c];
      e[c][d] = o / s;
    }
};
var V4 = function(e, r, n, a, i) {
  for (var o = 0; o < e.length; o++)
    r[o] = e[o].slice();
  for (var s, l, u, c = 2 / (i.m - 1), d = 0; d < n.length; d++)
    for (var v = 0; v < a.length; v++) {
      s = 0;
      for (var h6 = 0; h6 < n.length; h6++)
        l = Fs(i.distance, a[v], n[d], i.attributes, "cmeans"), u = Fs(i.distance, a[v], n[h6], i.attributes, "cmeans"), s += Math.pow(l / u, c);
      e[v][d] = 1 / s;
    }
};
var H4 = function(e, r, n, a) {
  for (var i = new Array(n.k), o = 0; o < i.length; o++)
    i[o] = [];
  for (var s, l, u = 0; u < r.length; u++) {
    s = -1 / 0, l = -1;
    for (var c = 0; c < r[0].length; c++)
      r[u][c] > s && (s = r[u][c], l = c);
    i[l].push(e[u]);
  }
  for (var d = 0; d < i.length; d++)
    i[d] = a.collection(i[d]);
  return i;
};
var wf = function(e) {
  var r = this.cy(), n = this.nodes(), a = mc(e), i, o, s, l, u;
  l = new Array(n.length);
  for (var c = 0; c < n.length; c++)
    l[c] = new Array(a.k);
  s = new Array(n.length);
  for (var d = 0; d < n.length; d++)
    s[d] = new Array(a.k);
  for (var v = 0; v < n.length; v++) {
    for (var h6 = 0, f = 0; f < a.k; f++)
      s[v][f] = Math.random(), h6 += s[v][f];
    for (var p = 0; p < a.k; p++)
      s[v][p] = s[v][p] / h6;
  }
  o = new Array(a.k);
  for (var m = 0; m < a.k; m++)
    o[m] = new Array(a.attributes.length);
  u = new Array(n.length);
  for (var g = 0; g < n.length; g++)
    u[g] = new Array(a.k);
  for (var y = true, b = 0; y && b < a.maxIterations; )
    y = false, z4(o, n, s, u, a), V4(s, l, o, n, a), B4(s, l, a.sensitivityThreshold) || (y = true), b++;
  return i = H4(n, s, a, r), {
    clusters: i,
    degreeOfMembership: s
  };
};
var K4 = {
  kMeans: R4,
  kMedoids: $4,
  fuzzyCMeans: wf,
  fcm: wf
};
var q4 = Yt({
  distance: "euclidean",
  // distance metric to compare nodes
  linkage: "min",
  // linkage criterion : how to determine the distance between clusters of nodes
  mode: "threshold",
  // mode:'threshold' => clusters must be threshold distance apart
  threshold: 1 / 0,
  // the distance threshold
  // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters
  addDendrogram: false,
  // whether to add the dendrogram to the graph for viz
  dendrogramDepth: 0,
  // depth at which dendrogram branches are merged into the returned clusters
  attributes: []
  // array of attr functions
});
var U4 = {
  single: "min",
  complete: "max"
};
var G4 = function(e) {
  var r = q4(e), n = U4[r.linkage];
  return n != null && (r.linkage = n), r;
};
var Cf = function(e, r, n, a, i) {
  for (var o = 0, s = 1 / 0, l, u = i.attributes, c = function(k, _) {
    return ol(i.distance, u.length, function(D) {
      return u[D](k);
    }, function(D) {
      return u[D](_);
    }, k, _);
  }, d = 0; d < e.length; d++) {
    var v = e[d].key, h6 = n[v][a[v]];
    h6 < s && (o = v, s = h6);
  }
  if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1)
    return false;
  var f = r[o], p = r[a[o]], m;
  i.mode === "dendrogram" ? m = {
    left: f,
    right: p,
    key: f.key
  } : m = {
    value: f.value.concat(p.value),
    key: f.key
  }, e[f.index] = m, e.splice(p.index, 1), r[f.key] = m;
  for (var g = 0; g < e.length; g++) {
    var y = e[g];
    f.key === y.key ? l = 1 / 0 : i.linkage === "min" ? (l = n[f.key][y.key], n[f.key][y.key] > n[p.key][y.key] && (l = n[p.key][y.key])) : i.linkage === "max" ? (l = n[f.key][y.key], n[f.key][y.key] < n[p.key][y.key] && (l = n[p.key][y.key])) : i.linkage === "mean" ? l = (n[f.key][y.key] * f.size + n[p.key][y.key] * p.size) / (f.size + p.size) : i.mode === "dendrogram" ? l = c(y.value, f.value) : l = c(y.value[0], f.value[0]), n[f.key][y.key] = n[y.key][f.key] = l;
  }
  for (var b = 0; b < e.length; b++) {
    var w = e[b].key;
    if (a[w] === f.key || a[w] === p.key) {
      for (var C = w, E = 0; E < e.length; E++) {
        var x = e[E].key;
        n[w][x] < n[w][C] && (C = x);
      }
      a[w] = C;
    }
    e[b].index = b;
  }
  return f.key = p.key = f.index = p.index = null, true;
};
var jo = function t(e, r, n) {
  e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r)));
};
var W4 = function t3(e, r) {
  if (!e) return "";
  if (e.left && e.right) {
    var n = t3(e.left, r), a = t3(e.right, r), i = r.add({
      group: "nodes",
      data: {
        id: n + "," + a
      }
    });
    return r.add({
      group: "edges",
      data: {
        source: n,
        target: i.id()
      }
    }), r.add({
      group: "edges",
      data: {
        source: a,
        target: i.id()
      }
    }), i.id();
  } else if (e.value)
    return e.value.id();
};
var Y4 = function t6(e, r, n) {
  if (!e) return [];
  var a = [], i = [], o = [];
  return r === 0 ? (e.left && jo(e.left, a), e.right && jo(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && jo(e.left, a), e.right && jo(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t6(e.left, r - 1, n)), e.right && (i = t6(e.right, r - 1, n)), a.concat(i));
};
var xf = function(e) {
  for (var r = this.cy(), n = this.nodes(), a = G4(e), i = a.attributes, o = function(b, w) {
    return ol(a.distance, i.length, function(C) {
      return i[C](b);
    }, function(C) {
      return i[C](w);
    }, b, w);
  }, s = [], l = [], u = [], c = [], d = 0; d < n.length; d++) {
    var v = {
      value: a.mode === "dendrogram" ? n[d] : [n[d]],
      key: d,
      index: d
    };
    s[d] = v, c[d] = v, l[d] = [], u[d] = 0;
  }
  for (var h6 = 0; h6 < s.length; h6++)
    for (var f = 0; f <= h6; f++) {
      var p = void 0;
      a.mode === "dendrogram" ? p = h6 === f ? 1 / 0 : o(s[h6].value, s[f].value) : p = h6 === f ? 1 / 0 : o(s[h6].value[0], s[f].value[0]), l[h6][f] = p, l[f][h6] = p, p < l[h6][u[h6]] && (u[h6] = f);
    }
  for (var m = Cf(s, c, l, u, a); m; )
    m = Cf(s, c, l, u, a);
  var g;
  return a.mode === "dendrogram" ? (g = Y4(s[0], a.dendrogramDepth, r), a.addDendrogram && W4(s[0], r)) : (g = new Array(s.length), s.forEach(function(y, b) {
    y.key = y.index = null, g[b] = r.collection(y.value);
  })), g;
};
var j4 = {
  hierarchicalClustering: xf,
  hca: xf
};
var Z4 = Yt({
  distance: "euclidean",
  // distance metric to compare attributes between two nodes
  preference: "median",
  // suitability of a data point to serve as an exemplar
  damping: 0.8,
  // damping factor between [0.5, 1)
  maxIterations: 1e3,
  // max number of iterations to run
  minIterations: 100,
  // min number of iterations to run in order for clustering to stop
  attributes: [
    // functions to quantify the similarity between any two points
    // e.g. node => node.data('weight')
  ]
});
var X4 = function(e) {
  var r = e.damping, n = e.preference;
  0.5 <= r && r < 1 || yt("Damping must range on [0.5, 1).  Got: ".concat(r));
  var a = ["median", "mean", "min", "max"];
  return a.some(function(i) {
    return i === n;
  }) || be(n) || yt("Preference must be one of [".concat(a.map(function(i) {
    return "'".concat(i, "'");
  }).join(", "), "] or a number.  Got: ").concat(n)), Z4(e);
};
var Q4 = function(e, r, n, a) {
  var i = function(s, l) {
    return a[l](s);
  };
  return -ol(e, a.length, function(o) {
    return i(r, o);
  }, function(o) {
    return i(n, o);
  }, r, n);
};
var J4 = function(e, r) {
  var n = null;
  return r === "median" ? n = X5(e) : r === "mean" ? n = Z5(e) : r === "min" ? n = Y5(e) : r === "max" ? n = j5(e) : n = r, n;
};
var e3 = function(e, r, n) {
  for (var a = [], i = 0; i < e; i++)
    r[i * e + i] + n[i * e + i] > 0 && a.push(i);
  return a;
};
var Ef = function(e, r, n) {
  for (var a = [], i = 0; i < e; i++) {
    for (var o = -1, s = -1 / 0, l = 0; l < n.length; l++) {
      var u = n[l];
      r[i * e + u] > s && (o = u, s = r[i * e + u]);
    }
    o > 0 && a.push(o);
  }
  for (var c = 0; c < n.length; c++)
    a[n[c]] = n[c];
  return a;
};
var t32 = function(e, r, n) {
  for (var a = Ef(e, r, n), i = 0; i < n.length; i++) {
    for (var o = [], s = 0; s < a.length; s++)
      a[s] === n[i] && o.push(s);
    for (var l = -1, u = -1 / 0, c = 0; c < o.length; c++) {
      for (var d = 0, v = 0; v < o.length; v++)
        d += r[o[v] * e + o[c]];
      d > u && (l = c, u = d);
    }
    n[i] = o[l];
  }
  return a = Ef(e, r, n), a;
};
var kf = function(e) {
  for (var r = this.cy(), n = this.nodes(), a = X4(e), i = {}, o = 0; o < n.length; o++)
    i[n[o].id()] = o;
  var s, l, u, c, d, v;
  s = n.length, l = s * s, u = new Array(l);
  for (var h6 = 0; h6 < l; h6++)
    u[h6] = -1 / 0;
  for (var f = 0; f < s; f++)
    for (var p = 0; p < s; p++)
      f !== p && (u[f * s + p] = Q4(a.distance, n[f], n[p], a.attributes));
  c = J4(u, a.preference);
  for (var m = 0; m < s; m++)
    u[m * s + m] = c;
  d = new Array(l);
  for (var g = 0; g < l; g++)
    d[g] = 0;
  v = new Array(l);
  for (var y = 0; y < l; y++)
    v[y] = 0;
  for (var b = new Array(s), w = new Array(s), C = new Array(s), E = 0; E < s; E++)
    b[E] = 0, w[E] = 0, C[E] = 0;
  for (var x = new Array(s * a.minIterations), T = 0; T < x.length; T++)
    x[T] = 0;
  var k;
  for (k = 0; k < a.maxIterations; k++) {
    for (var _ = 0; _ < s; _++) {
      for (var D = -1 / 0, O = -1 / 0, A = -1, L = 0, N = 0; N < s; N++)
        b[N] = d[_ * s + N], L = v[_ * s + N] + u[_ * s + N], L >= D ? (O = D, D = L, A = N) : L > O && (O = L);
      for (var I = 0; I < s; I++)
        d[_ * s + I] = (1 - a.damping) * (u[_ * s + I] - D) + a.damping * b[I];
      d[_ * s + A] = (1 - a.damping) * (u[_ * s + A] - O) + a.damping * b[A];
    }
    for (var M = 0; M < s; M++) {
      for (var F = 0, $ = 0; $ < s; $++)
        b[$] = v[$ * s + M], w[$] = Math.max(0, d[$ * s + M]), F += w[$];
      F -= w[M], w[M] = d[M * s + M], F += w[M];
      for (var U = 0; U < s; U++)
        v[U * s + M] = (1 - a.damping) * Math.min(0, F - w[U]) + a.damping * b[U];
      v[M * s + M] = (1 - a.damping) * (F - w[M]) + a.damping * b[M];
    }
    for (var H = 0, K = 0; K < s; K++) {
      var ee = v[K * s + K] + d[K * s + K] > 0 ? 1 : 0;
      x[k % a.minIterations * s + K] = ee, H += ee;
    }
    if (H > 0 && (k >= a.minIterations - 1 || k == a.maxIterations - 1)) {
      for (var se = 0, oe = 0; oe < s; oe++) {
        C[oe] = 0;
        for (var ne = 0; ne < a.minIterations; ne++)
          C[oe] += x[ne * s + oe];
        (C[oe] === 0 || C[oe] === a.minIterations) && se++;
      }
      if (se === s)
        break;
    }
  }
  for (var ue = e3(s, d, v), te = t32(s, u, ue), R = {}, Y = 0; Y < ue.length; Y++)
    R[ue[Y]] = [];
  for (var J = 0; J < n.length; J++) {
    var ge = i[n[J].id()], Ee = te[ge];
    Ee != null && R[Ee].push(n[J]);
  }
  for (var ve = new Array(ue.length), me = 0; me < ue.length; me++)
    ve[me] = r.collection(R[ue[me]]);
  return ve;
};
var r3 = {
  affinityPropagation: kf,
  ap: kf
};
var n3 = Yt({
  root: void 0,
  directed: false
});
var a3 = {
  hierholzer: function(e) {
    if (!Xe(e)) {
      var r = arguments;
      e = {
        root: r[0],
        directed: r[1]
      };
    }
    var n = n3(e), a = n.root, i = n.directed, o = this, s = false, l, u, c;
    a && (c = Ae(a) ? this.filter(a)[0].id() : a[0].id());
    var d = {}, v = {};
    i ? o.forEach(function(y) {
      var b = y.id();
      if (y.isNode()) {
        var w = y.indegree(true), C = y.outdegree(true), E = w - C, x = C - w;
        E == 1 ? l ? s = true : l = b : x == 1 ? u ? s = true : u = b : (x > 1 || E > 1) && (s = true), d[b] = [], y.outgoers().forEach(function(T) {
          T.isEdge() && d[b].push(T.id());
        });
      } else
        v[b] = [void 0, y.target().id()];
    }) : o.forEach(function(y) {
      var b = y.id();
      if (y.isNode()) {
        var w = y.degree(true);
        w % 2 && (l ? u ? s = true : u = b : l = b), d[b] = [], y.connectedEdges().forEach(function(C) {
          return d[b].push(C.id());
        });
      } else
        v[b] = [y.source().id(), y.target().id()];
    });
    var h6 = {
      found: false,
      trail: void 0
    };
    if (s) return h6;
    if (u && l)
      if (i) {
        if (c && u != c)
          return h6;
        c = u;
      } else {
        if (c && u != c && l != c)
          return h6;
        c || (c = u);
      }
    else
      c || (c = o[0].id());
    var f = function(b) {
      for (var w = b, C = [b], E, x, T; d[w].length; )
        E = d[w].shift(), x = v[E][0], T = v[E][1], w != T ? (d[T] = d[T].filter(function(k) {
          return k != E;
        }), w = T) : !i && w != x && (d[x] = d[x].filter(function(k) {
          return k != E;
        }), w = x), C.unshift(E), C.unshift(w);
      return C;
    }, p = [], m = [];
    for (m = f(c); m.length != 1; )
      d[m[0]].length == 0 ? (p.unshift(o.getElementById(m.shift())), p.unshift(o.getElementById(m.shift()))) : m = f(m.shift()).concat(m);
    p.unshift(o.getElementById(m.shift()));
    for (var g in d)
      if (d[g].length)
        return h6;
    return h6.found = true, h6.trail = this.spawn(p, true), h6;
  }
};
var Zo = function() {
  var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, l = function(v, h6) {
    for (var f = o.length - 1, p = [], m = e.spawn(); o[f].x != v || o[f].y != h6; )
      p.push(o.pop().edge), f--;
    p.push(o.pop().edge), p.forEach(function(g) {
      var y = g.connectedNodes().intersection(e);
      m.merge(g), y.forEach(function(b) {
        var w = b.id(), C = b.connectedEdges().intersection(e);
        m.merge(b), r[w].cutVertex ? m.merge(C.filter(function(E) {
          return E.isLoop();
        })) : m.merge(C);
      });
    }), i.push(m);
  }, u = function d(v, h6, f) {
    v === f && (a += 1), r[h6] = {
      id: n,
      low: n++,
      cutVertex: false
    };
    var p = e.getElementById(h6).connectedEdges().intersection(e);
    if (p.size() === 0)
      i.push(e.spawn(e.getElementById(h6)));
    else {
      var m, g, y, b;
      p.forEach(function(w) {
        m = w.source().id(), g = w.target().id(), y = m === h6 ? g : m, y !== f && (b = w.id(), s[b] || (s[b] = true, o.push({
          x: h6,
          y,
          edge: w
        })), y in r ? r[h6].low = Math.min(r[h6].low, r[y].id) : (d(v, y, h6), r[h6].low = Math.min(r[h6].low, r[y].low), r[h6].id <= r[y].low && (r[h6].cutVertex = true, l(h6, y))));
      });
    }
  };
  e.forEach(function(d) {
    if (d.isNode()) {
      var v = d.id();
      v in r || (a = 0, u(v, v), r[v].cutVertex = a > 1);
    }
  });
  var c = Object.keys(r).filter(function(d) {
    return r[d].cutVertex;
  }).map(function(d) {
    return e.getElementById(d);
  });
  return {
    cut: e.spawn(c),
    components: i
  };
};
var i3 = {
  hopcroftTarjanBiconnected: Zo,
  htbc: Zo,
  htb: Zo,
  hopcroftTarjanBiconnectedComponents: Zo
};
var Xo = function() {
  var e = this, r = {}, n = 0, a = [], i = [], o = e.spawn(e), s = function l(u) {
    i.push(u), r[u] = {
      index: n,
      low: n++,
      explored: false
    };
    var c = e.getElementById(u).connectedEdges().intersection(e);
    if (c.forEach(function(p) {
      var m = p.target().id();
      m !== u && (m in r || l(m), r[m].explored || (r[u].low = Math.min(r[u].low, r[m].low)));
    }), r[u].index === r[u].low) {
      for (var d = e.spawn(); ; ) {
        var v = i.pop();
        if (d.merge(e.getElementById(v)), r[v].low = r[u].index, r[v].explored = true, v === u)
          break;
      }
      var h6 = d.edgesWith(d), f = d.merge(h6);
      a.push(f), o = o.difference(f);
    }
  };
  return e.forEach(function(l) {
    if (l.isNode()) {
      var u = l.id();
      u in r || s(u);
    }
  }), {
    cut: o,
    components: a
  };
};
var o3 = {
  tarjanStronglyConnected: Xo,
  tsc: Xo,
  tscc: Xo,
  tarjanStronglyConnectedComponents: Xo
};
var kp = {};
[oo, B5, N5, $5, V5, K5, G5, m4, Ya, ja, fu, O4, K4, j4, r3, a3, i3, o3].forEach(function(t13) {
  ze(kp, t13);
});
var Sp = 0;
var Tp = 1;
var _p = 2;
var yn = function t7(e) {
  if (!(this instanceof t7)) return new t7(e);
  this.id = "Thenable/1.0.7", this.state = Sp, this.fulfillValue = void 0, this.rejectReason = void 0, this.onFulfilled = [], this.onRejected = [], this.proxy = {
    then: this.then.bind(this)
  }, typeof e == "function" && e.call(this, this.fulfill.bind(this), this.reject.bind(this));
};
yn.prototype = {
  /*  promise resolving methods  */
  fulfill: function(e) {
    return Sf(this, Tp, "fulfillValue", e);
  },
  reject: function(e) {
    return Sf(this, _p, "rejectReason", e);
  },
  /*  "The then Method" [Promises/A+ 1.1, 1.2, 2.2]  */
  then: function(e, r) {
    var n = this, a = new yn();
    return n.onFulfilled.push(_f(e, a, "fulfill")), n.onRejected.push(_f(r, a, "reject")), Dp(n), a.proxy;
  }
};
var Sf = function(e, r, n, a) {
  return e.state === Sp && (e.state = r, e[n] = a, Dp(e)), e;
};
var Dp = function(e) {
  e.state === Tp ? Tf(e, "onFulfilled", e.fulfillValue) : e.state === _p && Tf(e, "onRejected", e.rejectReason);
};
var Tf = function(e, r, n) {
  if (e[r].length !== 0) {
    var a = e[r];
    e[r] = [];
    var i = function() {
      for (var s = 0; s < a.length; s++)
        a[s](n);
    };
    typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0);
  }
};
var _f = function(e, r, n) {
  return function(a) {
    if (typeof e != "function")
      r[n].call(r, a);
    else {
      var i;
      try {
        i = e(a);
      } catch (o) {
        r.reject(o);
        return;
      }
      s3(r, i);
    }
  };
};
var s3 = function t8(e, r) {
  if (e === r || e.proxy === r) {
    e.reject(new TypeError("cannot resolve promise with itself"));
    return;
  }
  var n;
  if (Ft(r) === "object" && r !== null || typeof r == "function")
    try {
      n = r.then;
    } catch (i) {
      e.reject(i);
      return;
    }
  if (typeof n == "function") {
    var a = false;
    try {
      n.call(
        r,
        /*  resolvePromise  */
        /*  [Promises/A+ 2.3.3.3.1]  */
        function(i) {
          a || (a = true, i === r ? e.reject(new TypeError("circular thenable chain")) : t8(e, i));
        },
        /*  rejectPromise  */
        /*  [Promises/A+ 2.3.3.3.2]  */
        function(i) {
          a || (a = true, e.reject(i));
        }
      );
    } catch (i) {
      a || e.reject(i);
    }
    return;
  }
  e.fulfill(r);
};
yn.all = function(t13) {
  return new yn(function(e, r) {
    for (var n = new Array(t13.length), a = 0, i = function(l, u) {
      n[l] = u, a++, a === t13.length && e(n);
    }, o = 0; o < t13.length; o++)
      (function(s) {
        var l = t13[s], u = l != null && l.then != null;
        if (u)
          l.then(function(d) {
            i(s, d);
          }, function(d) {
            r(d);
          });
        else {
          var c = l;
          i(s, c);
        }
      })(o);
  });
};
yn.resolve = function(t13) {
  return new yn(function(e, r) {
    e(t13);
  });
};
yn.reject = function(t13) {
  return new yn(function(e, r) {
    r(t13);
  });
};
var mi = typeof Promise < "u" ? Promise : yn;
var vu = function(e, r, n) {
  var a = uc(e), i = !a, o = this._private = ze({
    duration: 1e3
  }, r, n);
  if (o.target = e, o.style = o.style || o.css, o.started = false, o.playing = false, o.hooked = false, o.applying = false, o.progress = 0, o.completes = [], o.frames = [], o.complete && pt(o.complete) && o.completes.push(o.complete), i) {
    var s = e.position();
    o.startPosition = o.startPosition || {
      x: s.x,
      y: s.y
    }, o.startStyle = o.startStyle || e.cy().style().getAnimationStartStyle(e, o.style);
  }
  if (a) {
    var l = e.pan();
    o.startPan = {
      x: l.x,
      y: l.y
    }, o.startZoom = e.zoom();
  }
  this.length = 1, this[0] = this;
};
var wa = vu.prototype;
ze(wa, {
  instanceString: function() {
    return "animation";
  },
  hook: function() {
    var e = this._private;
    if (!e.hooked) {
      var r, n = e.target._private.animation;
      e.queue ? r = n.queue : r = n.current, r.push(this), yr(e.target) && e.target.cy().addToAnimationPool(e.target), e.hooked = true;
    }
    return this;
  },
  play: function() {
    var e = this._private;
    return e.progress === 1 && (e.progress = 0), e.playing = true, e.started = false, e.stopped = false, this.hook(), this;
  },
  playing: function() {
    return this._private.playing;
  },
  apply: function() {
    var e = this._private;
    return e.applying = true, e.started = false, e.stopped = false, this.hook(), this;
  },
  applying: function() {
    return this._private.applying;
  },
  pause: function() {
    var e = this._private;
    return e.playing = false, e.started = false, this;
  },
  stop: function() {
    var e = this._private;
    return e.playing = false, e.started = false, e.stopped = true, this;
  },
  rewind: function() {
    return this.progress(0);
  },
  fastforward: function() {
    return this.progress(1);
  },
  time: function(e) {
    var r = this._private;
    return e === void 0 ? r.progress * r.duration : this.progress(e / r.duration);
  },
  progress: function(e) {
    var r = this._private, n = r.playing;
    return e === void 0 ? r.progress : (n && this.pause(), r.progress = e, r.started = false, n && this.play(), this);
  },
  completed: function() {
    return this._private.progress === 1;
  },
  reverse: function() {
    var e = this._private, r = e.playing;
    r && this.pause(), e.progress = 1 - e.progress, e.started = false;
    var n = function(u, c) {
      var d = e[u];
      d != null && (e[u] = e[c], e[c] = d);
    };
    if (n("zoom", "startZoom"), n("pan", "startPan"), n("position", "startPosition"), e.style)
      for (var a = 0; a < e.style.length; a++) {
        var i = e.style[a], o = i.name, s = e.startStyle[o];
        e.startStyle[o] = i, e.style[a] = s;
      }
    return r && this.play(), this;
  },
  promise: function(e) {
    var r = this._private, n;
    switch (e) {
      case "frame":
        n = r.frames;
        break;
      default:
      case "complete":
      case "completed":
        n = r.completes;
    }
    return new mi(function(a, i) {
      n.push(function() {
        a();
      });
    });
  }
});
wa.complete = wa.completed;
wa.run = wa.play;
wa.running = wa.playing;
var l3 = {
  animated: function() {
    return function() {
      var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this;
      if (!i.styleEnabled())
        return false;
      var o = a[0];
      if (o)
        return o._private.animation.current.length > 0;
    };
  },
  // animated
  clearQueue: function() {
    return function() {
      var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this;
      if (!i.styleEnabled())
        return this;
      for (var o = 0; o < a.length; o++) {
        var s = a[o];
        s._private.animation.queue = [];
      }
      return this;
    };
  },
  // clearQueue
  delay: function() {
    return function(r, n) {
      var a = this._private.cy || this;
      return a.styleEnabled() ? this.animate({
        delay: r,
        duration: r,
        complete: n
      }) : this;
    };
  },
  // delay
  delayAnimation: function() {
    return function(r, n) {
      var a = this._private.cy || this;
      return a.styleEnabled() ? this.animation({
        delay: r,
        duration: r,
        complete: n
      }) : this;
    };
  },
  // delay
  animation: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this, l = !i, u = !l;
      if (!s.styleEnabled())
        return this;
      var c = s.style();
      r = ze({}, r, n);
      var d = Object.keys(r).length === 0;
      if (d)
        return new vu(o[0], r);
      switch (r.duration === void 0 && (r.duration = 400), r.duration) {
        case "slow":
          r.duration = 600;
          break;
        case "fast":
          r.duration = 200;
          break;
      }
      if (u && (r.style = c.getPropsList(r.style || r.css), r.css = void 0), u && r.renderedPosition != null) {
        var v = r.renderedPosition, h6 = s.pan(), f = s.zoom();
        r.position = vp(v, f, h6);
      }
      if (l && r.panBy != null) {
        var p = r.panBy, m = s.pan();
        r.pan = {
          x: m.x + p.x,
          y: m.y + p.y
        };
      }
      var g = r.center || r.centre;
      if (l && g != null) {
        var y = s.getCenterPan(g.eles, r.zoom);
        y != null && (r.pan = y);
      }
      if (l && r.fit != null) {
        var b = r.fit, w = s.getFitViewport(b.eles || b.boundingBox, b.padding);
        w != null && (r.pan = w.pan, r.zoom = w.zoom);
      }
      if (l && Xe(r.zoom)) {
        var C = s.getZoomedViewport(r.zoom);
        C != null ? (C.zoomed && (r.zoom = C.zoom), C.panned && (r.pan = C.pan)) : r.zoom = null;
      }
      return new vu(o[0], r);
    };
  },
  // animate
  animate: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this;
      if (!s.styleEnabled())
        return this;
      n && (r = ze({}, r, n));
      for (var l = 0; l < o.length; l++) {
        var u = o[l], c = u.animated() && (r.queue === void 0 || r.queue), d = u.animation(r, c ? {
          queue: true
        } : void 0);
        d.play();
      }
      return this;
    };
  },
  // animate
  stop: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this;
      if (!s.styleEnabled())
        return this;
      for (var l = 0; l < o.length; l++) {
        for (var u = o[l], c = u._private, d = c.animation.current, v = 0; v < d.length; v++) {
          var h6 = d[v], f = h6._private;
          n && (f.duration = 0);
        }
        r && (c.animation.queue = []), n || (c.animation.current = []);
      }
      return s.notify("draw"), this;
    };
  }
  // stop
};
var u3 = Array.isArray;
var sl = u3;
var c3 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
var d3 = /^\w*$/;
function f3(t13, e) {
  if (sl(t13))
    return false;
  var r = typeof t13;
  return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Po(t13) ? true : d3.test(t13) || !c3.test(t13) || e != null && t13 in Object(e);
}
var v3 = f3;
var h3 = "[object AsyncFunction]";
var p3 = "[object Function]";
var g3 = "[object GeneratorFunction]";
var m3 = "[object Proxy]";
function y3(t13) {
  if (!ga(t13))
    return false;
  var e = ap(t13);
  return e == p3 || e == g3 || e == h3 || e == m3;
}
var b3 = y3;
var w3 = rl["__core-js_shared__"];
var zl = w3;
var Df = function() {
  var t13 = /[^.]+$/.exec(zl && zl.keys && zl.keys.IE_PROTO || "");
  return t13 ? "Symbol(src)_1." + t13 : "";
}();
function C3(t13) {
  return !!Df && Df in t13;
}
var x3 = C3;
var E3 = Function.prototype;
var k3 = E3.toString;
function S3(t13) {
  if (t13 != null) {
    try {
      return k3.call(t13);
    } catch {
    }
    try {
      return t13 + "";
    } catch {
    }
  }
  return "";
}
var T3 = S3;
var _3 = /[\\^$.*+?()[\]{}|]/g;
var D3 = /^\[object .+?Constructor\]$/;
var P3 = Function.prototype;
var O3 = Object.prototype;
var L3 = P3.toString;
var I3 = O3.hasOwnProperty;
var A3 = RegExp(
  "^" + L3.call(I3).replace(_3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function F3(t13) {
  if (!ga(t13) || x3(t13))
    return false;
  var e = b3(t13) ? A3 : D3;
  return e.test(T3(t13));
}
var M3 = F3;
function B3(t13, e) {
  return t13 == null ? void 0 : t13[e];
}
var N3 = B3;
function R3(t13, e) {
  var r = N3(t13, e);
  return M3(r) ? r : void 0;
}
var yc = R3;
var $3 = yc(Object, "create");
var uo = $3;
function z3() {
  this.__data__ = uo ? uo(null) : {}, this.size = 0;
}
var V3 = z3;
function H3(t13) {
  var e = this.has(t13) && delete this.__data__[t13];
  return this.size -= e ? 1 : 0, e;
}
var K3 = H3;
var q3 = "__lodash_hash_undefined__";
var U3 = Object.prototype;
var G3 = U3.hasOwnProperty;
function W3(t13) {
  var e = this.__data__;
  if (uo) {
    var r = e[t13];
    return r === q3 ? void 0 : r;
  }
  return G3.call(e, t13) ? e[t13] : void 0;
}
var Y3 = W3;
var j3 = Object.prototype;
var Z3 = j3.hasOwnProperty;
function X3(t13) {
  var e = this.__data__;
  return uo ? e[t13] !== void 0 : Z3.call(e, t13);
}
var Q3 = X3;
var J3 = "__lodash_hash_undefined__";
function e_(t13, e) {
  var r = this.__data__;
  return this.size += this.has(t13) ? 0 : 1, r[t13] = uo && e === void 0 ? J3 : e, this;
}
var t_ = e_;
function yi(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
yi.prototype.clear = V3;
yi.prototype.delete = K3;
yi.prototype.get = Y3;
yi.prototype.has = Q3;
yi.prototype.set = t_;
var Pf = yi;
function r_() {
  this.__data__ = [], this.size = 0;
}
var n_ = r_;
function a_(t13, e) {
  return t13 === e || t13 !== t13 && e !== e;
}
var Pp = a_;
function i_(t13, e) {
  for (var r = t13.length; r--; )
    if (Pp(t13[r][0], e))
      return r;
  return -1;
}
var ll = i_;
var o_ = Array.prototype;
var s_ = o_.splice;
function l_(t13) {
  var e = this.__data__, r = ll(e, t13);
  if (r < 0)
    return false;
  var n = e.length - 1;
  return r == n ? e.pop() : s_.call(e, r, 1), --this.size, true;
}
var u_ = l_;
function c_(t13) {
  var e = this.__data__, r = ll(e, t13);
  return r < 0 ? void 0 : e[r][1];
}
var d_ = c_;
function f_(t13) {
  return ll(this.__data__, t13) > -1;
}
var v_ = f_;
function h_(t13, e) {
  var r = this.__data__, n = ll(r, t13);
  return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this;
}
var p_ = h_;
function bi(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
bi.prototype.clear = n_;
bi.prototype.delete = u_;
bi.prototype.get = d_;
bi.prototype.has = v_;
bi.prototype.set = p_;
var g_ = bi;
var m_ = yc(rl, "Map");
var y_ = m_;
function b_() {
  this.size = 0, this.__data__ = {
    hash: new Pf(),
    map: new (y_ || g_)(),
    string: new Pf()
  };
}
var w_ = b_;
function C_(t13) {
  var e = typeof t13;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null;
}
var x_ = C_;
function E_(t13, e) {
  var r = t13.__data__;
  return x_(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
var ul = E_;
function k_(t13) {
  var e = ul(this, t13).delete(t13);
  return this.size -= e ? 1 : 0, e;
}
var S_ = k_;
function T_(t13) {
  return ul(this, t13).get(t13);
}
var __ = T_;
function D_(t13) {
  return ul(this, t13).has(t13);
}
var P_ = D_;
function O_(t13, e) {
  var r = ul(this, t13), n = r.size;
  return r.set(t13, e), this.size += r.size == n ? 0 : 1, this;
}
var L_ = O_;
function wi(t13) {
  var e = -1, r = t13 == null ? 0 : t13.length;
  for (this.clear(); ++e < r; ) {
    var n = t13[e];
    this.set(n[0], n[1]);
  }
}
wi.prototype.clear = w_;
wi.prototype.delete = S_;
wi.prototype.get = __;
wi.prototype.has = P_;
wi.prototype.set = L_;
var Op = wi;
var I_ = "Expected a function";
function bc(t13, e) {
  if (typeof t13 != "function" || e != null && typeof e != "function")
    throw new TypeError(I_);
  var r = function() {
    var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache;
    if (i.has(a))
      return i.get(a);
    var o = t13.apply(this, n);
    return r.cache = i.set(a, o) || i, o;
  };
  return r.cache = new (bc.Cache || Op)(), r;
}
bc.Cache = Op;
var A_ = bc;
var F_ = 500;
function M_(t13) {
  var e = A_(t13, function(n) {
    return r.size === F_ && r.clear(), n;
  }), r = e.cache;
  return e;
}
var B_ = M_;
var N_ = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var R_ = /\\(\\)?/g;
var $_ = B_(function(t13) {
  var e = [];
  return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(N_, function(r, n, a, i) {
    e.push(a ? i.replace(R_, "$1") : n || r);
  }), e;
});
var Lp = $_;
function z_(t13, e) {
  for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; )
    a[r] = e(t13[r], r, t13);
  return a;
}
var Ip = z_;
var V_ = 1 / 0;
var Of = oi ? oi.prototype : void 0;
var Lf = Of ? Of.toString : void 0;
function Ap(t13) {
  if (typeof t13 == "string")
    return t13;
  if (sl(t13))
    return Ip(t13, Ap) + "";
  if (Po(t13))
    return Lf ? Lf.call(t13) : "";
  var e = t13 + "";
  return e == "0" && 1 / t13 == -V_ ? "-0" : e;
}
var H_ = Ap;
function K_(t13) {
  return t13 == null ? "" : H_(t13);
}
var Fp = K_;
function q_(t13, e) {
  return sl(t13) ? t13 : v3(t13, e) ? [t13] : Lp(Fp(t13));
}
var Mp = q_;
var U_ = 1 / 0;
function G_(t13) {
  if (typeof t13 == "string" || Po(t13))
    return t13;
  var e = t13 + "";
  return e == "0" && 1 / t13 == -U_ ? "-0" : e;
}
var wc = G_;
function W_(t13, e) {
  e = Mp(e, t13);
  for (var r = 0, n = e.length; t13 != null && r < n; )
    t13 = t13[wc(e[r++])];
  return r && r == n ? t13 : void 0;
}
var Y_ = W_;
function j_(t13, e, r) {
  var n = t13 == null ? void 0 : Y_(t13, e);
  return n === void 0 ? r : n;
}
var Z_ = j_;
var X_ = function() {
  try {
    var t13 = yc(Object, "defineProperty");
    return t13({}, "", {}), t13;
  } catch {
  }
}();
var If = X_;
function Q_(t13, e, r) {
  e == "__proto__" && If ? If(t13, e, {
    configurable: true,
    enumerable: true,
    value: r,
    writable: true
  }) : t13[e] = r;
}
var J_ = Q_;
var eD = Object.prototype;
var tD = eD.hasOwnProperty;
function rD(t13, e, r) {
  var n = t13[e];
  (!(tD.call(t13, e) && Pp(n, r)) || r === void 0 && !(e in t13)) && J_(t13, e, r);
}
var nD = rD;
var aD = 9007199254740991;
var iD = /^(?:0|[1-9]\d*)$/;
function oD(t13, e) {
  var r = typeof t13;
  return e = e ?? aD, !!e && (r == "number" || r != "symbol" && iD.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e;
}
var sD = oD;
function lD(t13, e, r, n) {
  if (!ga(t13))
    return t13;
  e = Mp(e, t13);
  for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) {
    var l = wc(e[a]), u = r;
    if (l === "__proto__" || l === "constructor" || l === "prototype")
      return t13;
    if (a != o) {
      var c = s[l];
      u = n ? n(c, l, s) : void 0, u === void 0 && (u = ga(c) ? c : sD(e[a + 1]) ? [] : {});
    }
    nD(s, l, u), s = s[l];
  }
  return t13;
}
var uD = lD;
function cD(t13, e, r) {
  return t13 == null ? t13 : uD(t13, e, r);
}
var dD = cD;
function fD(t13, e) {
  var r = -1, n = t13.length;
  for (e || (e = Array(n)); ++r < n; )
    e[r] = t13[r];
  return e;
}
var vD = fD;
function hD(t13) {
  return sl(t13) ? Ip(t13, wc) : Po(t13) ? [t13] : vD(Lp(Fp(t13)));
}
var pD = hD;
var gD = {
  // access data field
  data: function(e) {
    var r = {
      field: "data",
      bindingEvent: "data",
      allowBinding: false,
      allowSetting: false,
      allowGetting: false,
      settingEvent: "data",
      settingTriggersEvent: false,
      triggerFnName: "trigger",
      immutableKeys: {},
      // key => true if immutable
      updateStyle: false,
      beforeGet: function(a) {
      },
      beforeSet: function(a, i) {
      },
      onSet: function(a) {
      },
      canSet: function(a) {
        return true;
      }
    };
    return e = ze({}, r, e), function(a, i) {
      var o = e, s = this, l = s.length !== void 0, u = l ? s : [s], c = l ? s[0] : s;
      if (Ae(a)) {
        var d = a.indexOf(".") !== -1, v = d && pD(a);
        if (o.allowGetting && i === void 0) {
          var h6;
          return c && (o.beforeGet(c), v && c._private[o.field][a] === void 0 ? h6 = Z_(c._private[o.field], v) : h6 = c._private[o.field][a]), h6;
        } else if (o.allowSetting && i !== void 0) {
          var f = !o.immutableKeys[a];
          if (f) {
            var p = Wh({}, a, i);
            o.beforeSet(s, p);
            for (var m = 0, g = u.length; m < g; m++) {
              var y = u[m];
              o.canSet(y) && (v && c._private[o.field][a] === void 0 ? dD(y._private[o.field], v, i) : y._private[o.field][a] = i);
            }
            o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent);
          }
        }
      } else if (o.allowSetting && Xe(a)) {
        var b = a, w, C, E = Object.keys(b);
        o.beforeSet(s, b);
        for (var x = 0; x < E.length; x++) {
          w = E[x], C = b[w];
          var T = !o.immutableKeys[w];
          if (T)
            for (var k = 0; k < u.length; k++) {
              var _ = u[k];
              o.canSet(_) && (_._private[o.field][w] = C);
            }
        }
        o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent);
      } else if (o.allowBinding && pt(a)) {
        var D = a;
        s.on(o.bindingEvent, D);
      } else if (o.allowGetting && a === void 0) {
        var O;
        return c && (o.beforeGet(c), O = c._private[o.field]), O;
      }
      return s;
    };
  },
  // data
  // remove data field
  removeData: function(e) {
    var r = {
      field: "data",
      event: "data",
      triggerFnName: "trigger",
      triggerEvent: false,
      immutableKeys: {}
      // key => true if immutable
    };
    return e = ze({}, r, e), function(a) {
      var i = e, o = this, s = o.length !== void 0, l = s ? o : [o];
      if (Ae(a)) {
        for (var u = a.split(/\s+/), c = u.length, d = 0; d < c; d++) {
          var v = u[d];
          if (!Kn(v)) {
            var h6 = !i.immutableKeys[v];
            if (h6)
              for (var f = 0, p = l.length; f < p; f++)
                l[f]._private[i.field][v] = void 0;
          }
        }
        i.triggerEvent && o[i.triggerFnName](i.event);
      } else if (a === void 0) {
        for (var m = 0, g = l.length; m < g; m++)
          for (var y = l[m]._private[i.field], b = Object.keys(y), w = 0; w < b.length; w++) {
            var C = b[w], E = !i.immutableKeys[C];
            E && (y[C] = void 0);
          }
        i.triggerEvent && o[i.triggerFnName](i.event);
      }
      return o;
    };
  }
  // removeData
};
var mD = {
  eventAliasesOn: function(e) {
    var r = e;
    r.addListener = r.listen = r.bind = r.on, r.unlisten = r.unbind = r.off = r.removeListener, r.trigger = r.emit, r.pon = r.promiseOn = function(n, a) {
      var i = this, o = Array.prototype.slice.call(arguments, 0);
      return new mi(function(s, l) {
        var u = function(h6) {
          i.off.apply(i, d), s(h6);
        }, c = o.concat([u]), d = c.concat([]);
        i.on.apply(i, c);
      });
    };
  }
};
var et = {};
[l3, gD, mD].forEach(function(t13) {
  ze(et, t13);
});
var yD = {
  animate: et.animate(),
  animation: et.animation(),
  animated: et.animated(),
  clearQueue: et.clearQueue(),
  delay: et.delay(),
  delayAnimation: et.delayAnimation(),
  stop: et.stop()
};
var ds = {
  classes: function(e) {
    var r = this;
    if (e === void 0) {
      var n = [];
      return r[0]._private.classes.forEach(function(f) {
        return n.push(f);
      }), n;
    } else st(e) || (e = (e || "").match(/\S+/g) || []);
    for (var a = [], i = new gi(e), o = 0; o < r.length; o++) {
      for (var s = r[o], l = s._private, u = l.classes, c = false, d = 0; d < e.length; d++) {
        var v = e[d], h6 = u.has(v);
        if (!h6) {
          c = true;
          break;
        }
      }
      c || (c = u.size !== e.length), c && (l.classes = i, a.push(s));
    }
    return a.length > 0 && this.spawn(a).updateStyle().emit("class"), r;
  },
  addClass: function(e) {
    return this.toggleClass(e, true);
  },
  hasClass: function(e) {
    var r = this[0];
    return r != null && r._private.classes.has(e);
  },
  toggleClass: function(e, r) {
    st(e) || (e = e.match(/\S+/g) || []);
    for (var n = this, a = r === void 0, i = [], o = 0, s = n.length; o < s; o++)
      for (var l = n[o], u = l._private.classes, c = false, d = 0; d < e.length; d++) {
        var v = e[d], h6 = u.has(v), f = false;
        r || a && !h6 ? (u.add(v), f = true) : (!r || a && h6) && (u.delete(v), f = true), !c && f && (i.push(l), c = true);
      }
    return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n;
  },
  removeClass: function(e) {
    return this.toggleClass(e, false);
  },
  flashClass: function(e, r) {
    var n = this;
    if (r == null)
      r = 250;
    else if (r === 0)
      return n;
    return n.addClass(e), setTimeout(function() {
      n.removeClass(e);
    }, r), n;
  }
};
ds.className = ds.classNames = ds.classes;
var je = {
  metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",
  // chars we need to escape in let names, etc
  comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",
  // binary comparison op (used in data selectors)
  boolOp: "\\?|\\!|\\^",
  // boolean (unary) operators (used in data selectors)
  string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,
  // string literals (used in data selectors) -- doublequotes | singlequotes
  number: At,
  // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123
  meta: "degree|indegree|outdegree",
  // allowed metadata fields (i.e. allowed functions to use from Collection)
  separator: "\\s*,\\s*",
  // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass
  descendant: "\\s+",
  child: "\\s+>\\s+",
  subject: "\\$",
  group: "node|edge|\\*",
  directedEdge: "\\s+->\\s+",
  undirectedEdge: "\\s+<->\\s+"
};
je.variable = "(?:[\\w-.]|(?:\\\\" + je.metaChar + "))+";
je.className = "(?:[\\w-]|(?:\\\\" + je.metaChar + "))+";
je.value = je.string + "|" + je.number;
je.id = je.variable;
(function() {
  var t13, e, r;
  for (t13 = je.comparatorOp.split("|"), r = 0; r < t13.length; r++)
    e = t13[r], je.comparatorOp += "|@" + e;
  for (t13 = je.comparatorOp.split("|"), r = 0; r < t13.length; r++)
    e = t13[r], !(e.indexOf("!") >= 0) && e !== "=" && (je.comparatorOp += "|\\!" + e);
})();
var it = function() {
  return {
    checks: []
  };
};
var Se = {
  /** E.g. node */
  GROUP: 0,
  /** A collection of elements */
  COLLECTION: 1,
  /** A filter(ele) function */
  FILTER: 2,
  /** E.g. [foo > 1] */
  DATA_COMPARE: 3,
  /** E.g. [foo] */
  DATA_EXIST: 4,
  /** E.g. [?foo] */
  DATA_BOOL: 5,
  /** E.g. [[degree > 2]] */
  META_COMPARE: 6,
  /** E.g. :selected */
  STATE: 7,
  /** E.g. #foo */
  ID: 8,
  /** E.g. .foo */
  CLASS: 9,
  /** E.g. #foo <-> #bar */
  UNDIRECTED_EDGE: 10,
  /** E.g. #foo -> #bar */
  DIRECTED_EDGE: 11,
  /** E.g. $#foo -> #bar */
  NODE_SOURCE: 12,
  /** E.g. #foo -> $#bar */
  NODE_TARGET: 13,
  /** E.g. $#foo <-> #bar */
  NODE_NEIGHBOR: 14,
  /** E.g. #foo > #bar */
  CHILD: 15,
  /** E.g. #foo #bar */
  DESCENDANT: 16,
  /** E.g. $#foo > #bar */
  PARENT: 17,
  /** E.g. $#foo #bar */
  ANCESTOR: 18,
  /** E.g. #foo > $bar > #baz */
  COMPOUND_SPLIT: 19,
  /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */
  TRUE: 20
};
var hu = [{
  selector: ":selected",
  matches: function(e) {
    return e.selected();
  }
}, {
  selector: ":unselected",
  matches: function(e) {
    return !e.selected();
  }
}, {
  selector: ":selectable",
  matches: function(e) {
    return e.selectable();
  }
}, {
  selector: ":unselectable",
  matches: function(e) {
    return !e.selectable();
  }
}, {
  selector: ":locked",
  matches: function(e) {
    return e.locked();
  }
}, {
  selector: ":unlocked",
  matches: function(e) {
    return !e.locked();
  }
}, {
  selector: ":visible",
  matches: function(e) {
    return e.visible();
  }
}, {
  selector: ":hidden",
  matches: function(e) {
    return !e.visible();
  }
}, {
  selector: ":transparent",
  matches: function(e) {
    return e.transparent();
  }
}, {
  selector: ":grabbed",
  matches: function(e) {
    return e.grabbed();
  }
}, {
  selector: ":free",
  matches: function(e) {
    return !e.grabbed();
  }
}, {
  selector: ":removed",
  matches: function(e) {
    return e.removed();
  }
}, {
  selector: ":inside",
  matches: function(e) {
    return !e.removed();
  }
}, {
  selector: ":grabbable",
  matches: function(e) {
    return e.grabbable();
  }
}, {
  selector: ":ungrabbable",
  matches: function(e) {
    return !e.grabbable();
  }
}, {
  selector: ":animated",
  matches: function(e) {
    return e.animated();
  }
}, {
  selector: ":unanimated",
  matches: function(e) {
    return !e.animated();
  }
}, {
  selector: ":parent",
  matches: function(e) {
    return e.isParent();
  }
}, {
  selector: ":childless",
  matches: function(e) {
    return e.isChildless();
  }
}, {
  selector: ":child",
  matches: function(e) {
    return e.isChild();
  }
}, {
  selector: ":orphan",
  matches: function(e) {
    return e.isOrphan();
  }
}, {
  selector: ":nonorphan",
  matches: function(e) {
    return e.isChild();
  }
}, {
  selector: ":compound",
  matches: function(e) {
    return e.isNode() ? e.isParent() : e.source().isParent() || e.target().isParent();
  }
}, {
  selector: ":loop",
  matches: function(e) {
    return e.isLoop();
  }
}, {
  selector: ":simple",
  matches: function(e) {
    return e.isSimple();
  }
}, {
  selector: ":active",
  matches: function(e) {
    return e.active();
  }
}, {
  selector: ":inactive",
  matches: function(e) {
    return !e.active();
  }
}, {
  selector: ":backgrounding",
  matches: function(e) {
    return e.backgrounding();
  }
}, {
  selector: ":nonbackgrounding",
  matches: function(e) {
    return !e.backgrounding();
  }
}].sort(function(t13, e) {
  return OT(t13.selector, e.selector);
});
var bD = function() {
  for (var t13 = {}, e, r = 0; r < hu.length; r++)
    e = hu[r], t13[e.selector] = e.matches;
  return t13;
}();
var wD = function(e, r) {
  return bD[e](r);
};
var CD = "(" + hu.map(function(t13) {
  return t13.selector;
}).join("|") + ")";
var Fa = function(e) {
  return e.replace(new RegExp("\\\\(" + je.metaChar + ")", "g"), function(r, n) {
    return n;
  });
};
var Pn = function(e, r, n) {
  e[e.length - 1] = n;
};
var pu = [{
  name: "group",
  // just used for identifying when debugging
  query: true,
  regex: "(" + je.group + ")",
  populate: function(e, r, n) {
    var a = Mr(n, 1), i = a[0];
    r.checks.push({
      type: Se.GROUP,
      value: i === "*" ? i : i + "s"
    });
  }
}, {
  name: "state",
  query: true,
  regex: CD,
  populate: function(e, r, n) {
    var a = Mr(n, 1), i = a[0];
    r.checks.push({
      type: Se.STATE,
      value: i
    });
  }
}, {
  name: "id",
  query: true,
  regex: "\\#(" + je.id + ")",
  populate: function(e, r, n) {
    var a = Mr(n, 1), i = a[0];
    r.checks.push({
      type: Se.ID,
      value: Fa(i)
    });
  }
}, {
  name: "className",
  query: true,
  regex: "\\.(" + je.className + ")",
  populate: function(e, r, n) {
    var a = Mr(n, 1), i = a[0];
    r.checks.push({
      type: Se.CLASS,
      value: Fa(i)
    });
  }
}, {
  name: "dataExists",
  query: true,
  regex: "\\[\\s*(" + je.variable + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Mr(n, 1), i = a[0];
    r.checks.push({
      type: Se.DATA_EXIST,
      field: Fa(i)
    });
  }
}, {
  name: "dataCompare",
  query: true,
  regex: "\\[\\s*(" + je.variable + ")\\s*(" + je.comparatorOp + ")\\s*(" + je.value + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Mr(n, 3), i = a[0], o = a[1], s = a[2], l = new RegExp("^" + je.string + "$").exec(s) != null;
    l ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({
      type: Se.DATA_COMPARE,
      field: Fa(i),
      operator: o,
      value: s
    });
  }
}, {
  name: "dataBool",
  query: true,
  regex: "\\[\\s*(" + je.boolOp + ")\\s*(" + je.variable + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Mr(n, 2), i = a[0], o = a[1];
    r.checks.push({
      type: Se.DATA_BOOL,
      field: Fa(o),
      operator: i
    });
  }
}, {
  name: "metaCompare",
  query: true,
  regex: "\\[\\[\\s*(" + je.meta + ")\\s*(" + je.comparatorOp + ")\\s*(" + je.number + ")\\s*\\]\\]",
  populate: function(e, r, n) {
    var a = Mr(n, 3), i = a[0], o = a[1], s = a[2];
    r.checks.push({
      type: Se.META_COMPARE,
      field: Fa(i),
      operator: o,
      value: parseFloat(s)
    });
  }
}, {
  name: "nextQuery",
  separator: true,
  regex: je.separator,
  populate: function(e, r) {
    var n = e.currentSubject, a = e.edgeCount, i = e.compoundCount, o = e[e.length - 1];
    n != null && (o.subject = n, e.currentSubject = null), o.edgeCount = a, o.compoundCount = i, e.edgeCount = 0, e.compoundCount = 0;
    var s = e[e.length++] = it();
    return s;
  }
}, {
  name: "directedEdge",
  separator: true,
  regex: je.directedEdge,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = r, i = it();
      return n.checks.push({
        type: Se.DIRECTED_EDGE,
        source: a,
        target: i
      }), Pn(e, r, n), e.edgeCount++, i;
    } else {
      var o = it(), s = r, l = it();
      return o.checks.push({
        type: Se.NODE_SOURCE,
        source: s,
        target: l
      }), Pn(e, r, o), e.edgeCount++, l;
    }
  }
}, {
  name: "undirectedEdge",
  separator: true,
  regex: je.undirectedEdge,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = r, i = it();
      return n.checks.push({
        type: Se.UNDIRECTED_EDGE,
        nodes: [a, i]
      }), Pn(e, r, n), e.edgeCount++, i;
    } else {
      var o = it(), s = r, l = it();
      return o.checks.push({
        type: Se.NODE_NEIGHBOR,
        node: s,
        neighbor: l
      }), Pn(e, r, o), l;
    }
  }
}, {
  name: "child",
  separator: true,
  regex: je.child,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = it(), i = e[e.length - 1];
      return n.checks.push({
        type: Se.CHILD,
        parent: i,
        child: a
      }), Pn(e, r, n), e.compoundCount++, a;
    } else if (e.currentSubject === r) {
      var o = it(), s = e[e.length - 1], l = it(), u = it(), c = it(), d = it();
      return o.checks.push({
        type: Se.COMPOUND_SPLIT,
        left: s,
        right: l,
        subject: u
      }), u.checks = r.checks, r.checks = [{
        type: Se.TRUE
      }], d.checks.push({
        type: Se.TRUE
      }), l.checks.push({
        type: Se.PARENT,
        // type is swapped on right side queries
        parent: d,
        child: c
        // empty for now
      }), Pn(e, s, o), e.currentSubject = u, e.compoundCount++, c;
    } else {
      var v = it(), h6 = it(), f = [{
        type: Se.PARENT,
        parent: v,
        child: h6
      }];
      return v.checks = r.checks, r.checks = f, e.compoundCount++, h6;
    }
  }
}, {
  name: "descendant",
  separator: true,
  regex: je.descendant,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = it(), i = e[e.length - 1];
      return n.checks.push({
        type: Se.DESCENDANT,
        ancestor: i,
        descendant: a
      }), Pn(e, r, n), e.compoundCount++, a;
    } else if (e.currentSubject === r) {
      var o = it(), s = e[e.length - 1], l = it(), u = it(), c = it(), d = it();
      return o.checks.push({
        type: Se.COMPOUND_SPLIT,
        left: s,
        right: l,
        subject: u
      }), u.checks = r.checks, r.checks = [{
        type: Se.TRUE
      }], d.checks.push({
        type: Se.TRUE
      }), l.checks.push({
        type: Se.ANCESTOR,
        // type is swapped on right side queries
        ancestor: d,
        descendant: c
        // empty for now
      }), Pn(e, s, o), e.currentSubject = u, e.compoundCount++, c;
    } else {
      var v = it(), h6 = it(), f = [{
        type: Se.ANCESTOR,
        ancestor: v,
        descendant: h6
      }];
      return v.checks = r.checks, r.checks = f, e.compoundCount++, h6;
    }
  }
}, {
  name: "subject",
  modifier: true,
  regex: je.subject,
  populate: function(e, r) {
    if (e.currentSubject != null && e.currentSubject !== r)
      return tt("Redefinition of subject in selector `" + e.toString() + "`"), false;
    e.currentSubject = r;
    var n = e[e.length - 1], a = n.checks[0], i = a == null ? null : a.type;
    i === Se.DIRECTED_EDGE ? a.type = Se.NODE_TARGET : i === Se.UNDIRECTED_EDGE && (a.type = Se.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null);
  }
}];
pu.forEach(function(t13) {
  return t13.regexObj = new RegExp("^" + t13.regex);
});
var xD = function(e) {
  for (var r, n, a, i = 0; i < pu.length; i++) {
    var o = pu[i], s = o.name, l = e.match(o.regexObj);
    if (l != null) {
      n = l, r = o, a = s;
      var u = l[0];
      e = e.substring(u.length);
      break;
    }
  }
  return {
    expr: r,
    match: n,
    name: a,
    remaining: e
  };
};
var ED = function(e) {
  var r = e.match(/^\s+/);
  if (r) {
    var n = r[0];
    e = e.substring(n.length);
  }
  return e;
};
var kD = function(e) {
  var r = this, n = r.inputText = e, a = r[0] = it();
  for (r.length = 1, n = ED(n); ; ) {
    var i = xD(n);
    if (i.expr == null)
      return tt("The selector `" + e + "`is invalid"), false;
    var o = i.match.slice(1), s = i.expr.populate(r, a, o);
    if (s === false)
      return false;
    if (s != null && (a = s), n = i.remaining, n.match(/^\s*$/))
      break;
  }
  var l = r[r.length - 1];
  r.currentSubject != null && (l.subject = r.currentSubject), l.edgeCount = r.edgeCount, l.compoundCount = r.compoundCount;
  for (var u = 0; u < r.length; u++) {
    var c = r[u];
    if (c.compoundCount > 0 && c.edgeCount > 0)
      return tt("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), false;
    if (c.edgeCount > 1)
      return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), false;
    c.edgeCount === 1 && tt("The selector `" + e + "` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.");
  }
  return true;
};
var SD = function() {
  if (this.toStringCache != null)
    return this.toStringCache;
  for (var e = function(c) {
    return c ?? "";
  }, r = function(c) {
    return Ae(c) ? '"' + c + '"' : e(c);
  }, n = function(c) {
    return " " + c + " ";
  }, a = function(c, d) {
    var v = c.type, h6 = c.value;
    switch (v) {
      case Se.GROUP: {
        var f = e(h6);
        return f.substring(0, f.length - 1);
      }
      case Se.DATA_COMPARE: {
        var p = c.field, m = c.operator;
        return "[" + p + n(e(m)) + r(h6) + "]";
      }
      case Se.DATA_BOOL: {
        var g = c.operator, y = c.field;
        return "[" + e(g) + y + "]";
      }
      case Se.DATA_EXIST: {
        var b = c.field;
        return "[" + b + "]";
      }
      case Se.META_COMPARE: {
        var w = c.operator, C = c.field;
        return "[[" + C + n(e(w)) + r(h6) + "]]";
      }
      case Se.STATE:
        return h6;
      case Se.ID:
        return "#" + h6;
      case Se.CLASS:
        return "." + h6;
      case Se.PARENT:
      case Se.CHILD:
        return i(c.parent, d) + n(">") + i(c.child, d);
      case Se.ANCESTOR:
      case Se.DESCENDANT:
        return i(c.ancestor, d) + " " + i(c.descendant, d);
      case Se.COMPOUND_SPLIT: {
        var E = i(c.left, d), x = i(c.subject, d), T = i(c.right, d);
        return E + (E.length > 0 ? " " : "") + x + T;
      }
      case Se.TRUE:
        return "";
    }
  }, i = function(c, d) {
    return c.checks.reduce(function(v, h6, f) {
      return v + (d === c && f === 0 ? "$" : "") + a(h6, d);
    }, "");
  }, o = "", s = 0; s < this.length; s++) {
    var l = this[s];
    o += i(l, l.subject), this.length > 1 && s < this.length - 1 && (o += ", ");
  }
  return this.toStringCache = o, o;
};
var TD = {
  parse: kD,
  toString: SD
};
var Bp = function(e, r, n) {
  var a, i = Ae(e), o = be(e), s = Ae(n), l, u, c = false, d = false, v = false;
  switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = true), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = true), (i || s || c) && (l = !i && !o ? "" : "" + e, u = "" + n), c && (e = l = l.toLowerCase(), n = u = u.toLowerCase()), r) {
    case "*=":
      a = l.indexOf(u) >= 0;
      break;
    case "$=":
      a = l.indexOf(u, l.length - u.length) >= 0;
      break;
    case "^=":
      a = l.indexOf(u) === 0;
      break;
    case "=":
      a = e === n;
      break;
    case ">":
      v = true, a = e > n;
      break;
    case ">=":
      v = true, a = e >= n;
      break;
    case "<":
      v = true, a = e < n;
      break;
    case "<=":
      v = true, a = e <= n;
      break;
    default:
      a = false;
      break;
  }
  return d && (e != null || !v) && (a = !a), a;
};
var _D = function(e, r) {
  switch (r) {
    case "?":
      return !!e;
    case "!":
      return !e;
    case "^":
      return e === void 0;
  }
};
var DD = function(e) {
  return e !== void 0;
};
var Cc = function(e, r) {
  return e.data(r);
};
var PD = function(e, r) {
  return e[r]();
};
var bt = [];
var vt = function(e, r) {
  return e.checks.every(function(n) {
    return bt[n.type](n, r);
  });
};
bt[Se.GROUP] = function(t13, e) {
  var r = t13.value;
  return r === "*" || r === e.group();
};
bt[Se.STATE] = function(t13, e) {
  var r = t13.value;
  return wD(r, e);
};
bt[Se.ID] = function(t13, e) {
  var r = t13.value;
  return e.id() === r;
};
bt[Se.CLASS] = function(t13, e) {
  var r = t13.value;
  return e.hasClass(r);
};
bt[Se.META_COMPARE] = function(t13, e) {
  var r = t13.field, n = t13.operator, a = t13.value;
  return Bp(PD(e, r), n, a);
};
bt[Se.DATA_COMPARE] = function(t13, e) {
  var r = t13.field, n = t13.operator, a = t13.value;
  return Bp(Cc(e, r), n, a);
};
bt[Se.DATA_BOOL] = function(t13, e) {
  var r = t13.field, n = t13.operator;
  return _D(Cc(e, r), n);
};
bt[Se.DATA_EXIST] = function(t13, e) {
  var r = t13.field;
  return t13.operator, DD(Cc(e, r));
};
bt[Se.UNDIRECTED_EDGE] = function(t13, e) {
  var r = t13.nodes[0], n = t13.nodes[1], a = e.source(), i = e.target();
  return vt(r, a) && vt(n, i) || vt(n, a) && vt(r, i);
};
bt[Se.NODE_NEIGHBOR] = function(t13, e) {
  return vt(t13.node, e) && e.neighborhood().some(function(r) {
    return r.isNode() && vt(t13.neighbor, r);
  });
};
bt[Se.DIRECTED_EDGE] = function(t13, e) {
  return vt(t13.source, e.source()) && vt(t13.target, e.target());
};
bt[Se.NODE_SOURCE] = function(t13, e) {
  return vt(t13.source, e) && e.outgoers().some(function(r) {
    return r.isNode() && vt(t13.target, r);
  });
};
bt[Se.NODE_TARGET] = function(t13, e) {
  return vt(t13.target, e) && e.incomers().some(function(r) {
    return r.isNode() && vt(t13.source, r);
  });
};
bt[Se.CHILD] = function(t13, e) {
  return vt(t13.child, e) && vt(t13.parent, e.parent());
};
bt[Se.PARENT] = function(t13, e) {
  return vt(t13.parent, e) && e.children().some(function(r) {
    return vt(t13.child, r);
  });
};
bt[Se.DESCENDANT] = function(t13, e) {
  return vt(t13.descendant, e) && e.ancestors().some(function(r) {
    return vt(t13.ancestor, r);
  });
};
bt[Se.ANCESTOR] = function(t13, e) {
  return vt(t13.ancestor, e) && e.descendants().some(function(r) {
    return vt(t13.descendant, r);
  });
};
bt[Se.COMPOUND_SPLIT] = function(t13, e) {
  return vt(t13.subject, e) && vt(t13.left, e) && vt(t13.right, e);
};
bt[Se.TRUE] = function() {
  return true;
};
bt[Se.COLLECTION] = function(t13, e) {
  var r = t13.value;
  return r.has(e);
};
bt[Se.FILTER] = function(t13, e) {
  var r = t13.value;
  return r(e);
};
var OD = function(e) {
  var r = this;
  if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Se.ID)
    return e.getElementById(r[0].checks[0].value).collection();
  var n = function(i) {
    for (var o = 0; o < r.length; o++) {
      var s = r[o];
      if (vt(s, i))
        return true;
    }
    return false;
  };
  return r.text() == null && (n = function() {
    return true;
  }), e.filter(n);
};
var LD = function(e) {
  for (var r = this, n = 0; n < r.length; n++) {
    var a = r[n];
    if (vt(a, e))
      return true;
  }
  return false;
};
var ID = {
  matches: LD,
  filter: OD
};
var Un = function(e) {
  this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Ae(e) && e.match(/^\s*$/) || (yr(e) ? this.addQuery({
    checks: [{
      type: Se.COLLECTION,
      value: e.collection()
    }]
  }) : pt(e) ? this.addQuery({
    checks: [{
      type: Se.FILTER,
      value: e
    }]
  }) : Ae(e) ? this.parse(e) || (this.invalid = true) : yt("A selector must be created from a string; found "));
};
var Gn = Un.prototype;
[TD, ID].forEach(function(t13) {
  return ze(Gn, t13);
});
Gn.text = function() {
  return this.inputText;
};
Gn.size = function() {
  return this.length;
};
Gn.eq = function(t13) {
  return this[t13];
};
Gn.sameText = function(t13) {
  return !this.invalid && !t13.invalid && this.text() === t13.text();
};
Gn.addQuery = function(t13) {
  this[this.length++] = t13;
};
Gn.selector = Gn.toString;
var $n = {
  allAre: function(e) {
    var r = new Un(e);
    return this.every(function(n) {
      return r.matches(n);
    });
  },
  is: function(e) {
    var r = new Un(e);
    return this.some(function(n) {
      return r.matches(n);
    });
  },
  some: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this);
      if (a)
        return true;
    }
    return false;
  },
  every: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this);
      if (!a)
        return false;
    }
    return true;
  },
  same: function(e) {
    if (this === e)
      return true;
    e = this.cy().collection(e);
    var r = this.length, n = e.length;
    return r !== n ? false : r === 1 ? this[0] === e[0] : this.every(function(a) {
      return e.hasElementWithId(a.id());
    });
  },
  anySame: function(e) {
    return e = this.cy().collection(e), this.some(function(r) {
      return e.hasElementWithId(r.id());
    });
  },
  allAreNeighbors: function(e) {
    e = this.cy().collection(e);
    var r = this.neighborhood();
    return e.every(function(n) {
      return r.hasElementWithId(n.id());
    });
  },
  contains: function(e) {
    e = this.cy().collection(e);
    var r = this;
    return e.every(function(n) {
      return r.hasElementWithId(n.id());
    });
  }
};
$n.allAreNeighbours = $n.allAreNeighbors;
$n.has = $n.contains;
$n.equal = $n.equals = $n.same;
var Sr = function(e, r) {
  return function(a, i, o, s) {
    var l = a, u = this, c;
    if (l == null ? c = "" : yr(l) && l.length === 1 && (c = l.id()), u.length === 1 && c) {
      var d = u[0]._private, v = d.traversalCache = d.traversalCache || {}, h6 = v[r] = v[r] || [], f = ma(c), p = h6[f];
      return p || (h6[f] = e.call(u, a, i, o, s));
    } else
      return e.call(u, a, i, o, s);
  };
};
var ui = {
  parent: function(e) {
    var r = [];
    if (this.length === 1) {
      var n = this[0]._private.parent;
      if (n)
        return n;
    }
    for (var a = 0; a < this.length; a++) {
      var i = this[a], o = i._private.parent;
      o && r.push(o);
    }
    return this.spawn(r, true).filter(e);
  },
  parents: function(e) {
    for (var r = [], n = this.parent(); n.nonempty(); ) {
      for (var a = 0; a < n.length; a++) {
        var i = n[a];
        r.push(i);
      }
      n = n.parent();
    }
    return this.spawn(r, true).filter(e);
  },
  commonAncestors: function(e) {
    for (var r, n = 0; n < this.length; n++) {
      var a = this[n], i = a.parents();
      r = r || i, r = r.intersect(i);
    }
    return r.filter(e);
  },
  orphans: function(e) {
    return this.stdFilter(function(r) {
      return r.isOrphan();
    }).filter(e);
  },
  nonorphans: function(e) {
    return this.stdFilter(function(r) {
      return r.isChild();
    }).filter(e);
  },
  children: Sr(function(t13) {
    for (var e = [], r = 0; r < this.length; r++)
      for (var n = this[r], a = n._private.children, i = 0; i < a.length; i++)
        e.push(a[i]);
    return this.spawn(e, true).filter(t13);
  }, "children"),
  siblings: function(e) {
    return this.parent().children().not(this).filter(e);
  },
  isParent: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.children.length !== 0;
  },
  isChildless: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.children.length === 0;
  },
  isChild: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.parent != null;
  },
  isOrphan: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.parent == null;
  },
  descendants: function(e) {
    var r = [];
    function n(a) {
      for (var i = 0; i < a.length; i++) {
        var o = a[i];
        r.push(o), o.children().nonempty() && n(o.children());
      }
    }
    return n(this.children()), this.spawn(r, true).filter(e);
  }
};
function xc(t13, e, r, n) {
  for (var a = [], i = new gi(), o = t13.cy(), s = o.hasCompoundNodes(), l = 0; l < t13.length; l++) {
    var u = t13[l];
    r ? a.push(u) : s && n(a, i, u);
  }
  for (; a.length > 0; ) {
    var c = a.shift();
    e(c), i.add(c.id()), s && n(a, i, c);
  }
  return t13;
}
function Np(t13, e, r) {
  if (r.isParent())
    for (var n = r._private.children, a = 0; a < n.length; a++) {
      var i = n[a];
      e.has(i.id()) || t13.push(i);
    }
}
ui.forEachDown = function(t13) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
  return xc(this, t13, e, Np);
};
function Rp(t13, e, r) {
  if (r.isChild()) {
    var n = r._private.parent;
    e.has(n.id()) || t13.push(n);
  }
}
ui.forEachUp = function(t13) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
  return xc(this, t13, e, Rp);
};
function AD(t13, e, r) {
  Rp(t13, e, r), Np(t13, e, r);
}
ui.forEachUpAndDown = function(t13) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
  return xc(this, t13, e, AD);
};
ui.ancestors = ui.parents;
var co;
var $p;
co = $p = {
  data: et.data({
    field: "data",
    bindingEvent: "data",
    allowBinding: true,
    allowSetting: true,
    settingEvent: "data",
    settingTriggersEvent: true,
    triggerFnName: "trigger",
    allowGetting: true,
    immutableKeys: {
      id: true,
      source: true,
      target: true,
      parent: true
    },
    updateStyle: true
  }),
  removeData: et.removeData({
    field: "data",
    event: "data",
    triggerFnName: "trigger",
    triggerEvent: true,
    immutableKeys: {
      id: true,
      source: true,
      target: true,
      parent: true
    },
    updateStyle: true
  }),
  scratch: et.data({
    field: "scratch",
    bindingEvent: "scratch",
    allowBinding: true,
    allowSetting: true,
    settingEvent: "scratch",
    settingTriggersEvent: true,
    triggerFnName: "trigger",
    allowGetting: true,
    updateStyle: true
  }),
  removeScratch: et.removeData({
    field: "scratch",
    event: "scratch",
    triggerFnName: "trigger",
    triggerEvent: true,
    updateStyle: true
  }),
  rscratch: et.data({
    field: "rscratch",
    allowBinding: false,
    allowSetting: true,
    settingTriggersEvent: false,
    allowGetting: true
  }),
  removeRscratch: et.removeData({
    field: "rscratch",
    triggerEvent: false
  }),
  id: function() {
    var e = this[0];
    if (e)
      return e._private.data.id;
  }
};
co.attr = co.data;
co.removeAttr = co.removeData;
var FD = $p;
var cl = {};
function Vl(t13) {
  return function(e) {
    var r = this;
    if (e === void 0 && (e = true), r.length !== 0)
      if (r.isNode() && !r.removed()) {
        for (var n = 0, a = r[0], i = a._private.edges, o = 0; o < i.length; o++) {
          var s = i[o];
          !e && s.isLoop() || (n += t13(a, s));
        }
        return n;
      } else
        return;
  };
}
ze(cl, {
  degree: Vl(function(t13, e) {
    return e.source().same(e.target()) ? 2 : 1;
  }),
  indegree: Vl(function(t13, e) {
    return e.target().same(t13) ? 1 : 0;
  }),
  outdegree: Vl(function(t13, e) {
    return e.source().same(t13) ? 1 : 0;
  })
});
function Ma(t13, e) {
  return function(r) {
    for (var n, a = this.nodes(), i = 0; i < a.length; i++) {
      var o = a[i], s = o[t13](r);
      s !== void 0 && (n === void 0 || e(s, n)) && (n = s);
    }
    return n;
  };
}
ze(cl, {
  minDegree: Ma("degree", function(t13, e) {
    return t13 < e;
  }),
  maxDegree: Ma("degree", function(t13, e) {
    return t13 > e;
  }),
  minIndegree: Ma("indegree", function(t13, e) {
    return t13 < e;
  }),
  maxIndegree: Ma("indegree", function(t13, e) {
    return t13 > e;
  }),
  minOutdegree: Ma("outdegree", function(t13, e) {
    return t13 < e;
  }),
  maxOutdegree: Ma("outdegree", function(t13, e) {
    return t13 > e;
  })
});
ze(cl, {
  totalDegree: function(e) {
    for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++)
      r += n[a].degree(e);
    return r;
  }
});
var zr;
var zp;
var Vp = function(e, r, n) {
  for (var a = 0; a < e.length; a++) {
    var i = e[a];
    if (!i.locked()) {
      var o = i._private.position, s = {
        x: r.x != null ? r.x - o.x : 0,
        y: r.y != null ? r.y - o.y : 0
      };
      i.isParent() && !(s.x === 0 && s.y === 0) && i.children().shift(s, n), i.dirtyBoundingBoxCache();
    }
  }
};
var Af = {
  field: "position",
  bindingEvent: "position",
  allowBinding: true,
  allowSetting: true,
  settingEvent: "position",
  settingTriggersEvent: true,
  triggerFnName: "emitAndNotify",
  allowGetting: true,
  validKeys: ["x", "y"],
  beforeGet: function(e) {
    e.updateCompoundBounds();
  },
  beforeSet: function(e, r) {
    Vp(e, r, false);
  },
  onSet: function(e) {
    e.dirtyCompoundBoundsCache();
  },
  canSet: function(e) {
    return !e.locked();
  }
};
zr = zp = {
  position: et.data(Af),
  // position but no notification to renderer
  silentPosition: et.data(ze({}, Af, {
    allowBinding: false,
    allowSetting: true,
    settingTriggersEvent: false,
    allowGetting: false,
    beforeSet: function(e, r) {
      Vp(e, r, true);
    },
    onSet: function(e) {
      e.dirtyCompoundBoundsCache();
    }
  })),
  positions: function(e, r) {
    if (Xe(e))
      r ? this.silentPosition(e) : this.position(e);
    else if (pt(e)) {
      var n = e, a = this.cy();
      a.startBatch();
      for (var i = 0; i < this.length; i++) {
        var o = this[i], s = void 0;
        (s = n(o, i)) && (r ? o.silentPosition(s) : o.position(s));
      }
      a.endBatch();
    }
    return this;
  },
  silentPositions: function(e) {
    return this.positions(e, true);
  },
  shift: function(e, r, n) {
    var a;
    if (Xe(e) ? (a = {
      x: be(e.x) ? e.x : 0,
      y: be(e.y) ? e.y : 0
    }, n = r) : Ae(e) && be(r) && (a = {
      x: 0,
      y: 0
    }, a[e] = r), a != null) {
      var i = this.cy();
      i.startBatch();
      for (var o = 0; o < this.length; o++) {
        var s = this[o];
        if (!(i.hasCompoundNodes() && s.isChild() && s.ancestors().anySame(this))) {
          var l = s.position(), u = {
            x: l.x + a.x,
            y: l.y + a.y
          };
          n ? s.silentPosition(u) : s.position(u);
        }
      }
      i.endBatch();
    }
    return this;
  },
  silentShift: function(e, r) {
    return Xe(e) ? this.shift(e, true) : Ae(e) && be(r) && this.shift(e, r, true), this;
  },
  // get/set the rendered (i.e. on screen) positon of the element
  renderedPosition: function(e, r) {
    var n = this[0], a = this.cy(), i = a.zoom(), o = a.pan(), s = Xe(e) ? e : void 0, l = s !== void 0 || r !== void 0 && Ae(e);
    if (n && n.isNode())
      if (l)
        for (var u = 0; u < this.length; u++) {
          var c = this[u];
          r !== void 0 ? c.position(e, (r - o[e]) / i) : s !== void 0 && c.position(vp(s, i, o));
        }
      else {
        var d = n.position();
        return s = il(d, i, o), e === void 0 ? s : s[e];
      }
    else if (!l)
      return;
    return this;
  },
  // get/set the position relative to the parent
  relativePosition: function(e, r) {
    var n = this[0], a = this.cy(), i = Xe(e) ? e : void 0, o = i !== void 0 || r !== void 0 && Ae(e), s = a.hasCompoundNodes();
    if (n && n.isNode())
      if (o)
        for (var l = 0; l < this.length; l++) {
          var u = this[l], c = s ? u.parent() : null, d = c && c.length > 0, v = d;
          d && (c = c[0]);
          var h6 = v ? c.position() : {
            x: 0,
            y: 0
          };
          r !== void 0 ? u.position(e, r + h6[e]) : i !== void 0 && u.position({
            x: i.x + h6.x,
            y: i.y + h6.y
          });
        }
      else {
        var f = n.position(), p = s ? n.parent() : null, m = p && p.length > 0, g = m;
        m && (p = p[0]);
        var y = g ? p.position() : {
          x: 0,
          y: 0
        };
        return i = {
          x: f.x - y.x,
          y: f.y - y.y
        }, e === void 0 ? i : i[e];
      }
    else if (!o)
      return;
    return this;
  }
};
zr.modelPosition = zr.point = zr.position;
zr.modelPositions = zr.points = zr.positions;
zr.renderedPoint = zr.renderedPosition;
zr.relativePoint = zr.relativePosition;
var MD = zp;
var Za;
var Zn;
Za = Zn = {};
Zn.renderedBoundingBox = function(t13) {
  var e = this.boundingBox(t13), r = this.cy(), n = r.zoom(), a = r.pan(), i = e.x1 * n + a.x, o = e.x2 * n + a.x, s = e.y1 * n + a.y, l = e.y2 * n + a.y;
  return {
    x1: i,
    x2: o,
    y1: s,
    y2: l,
    w: o - i,
    h: l - s
  };
};
Zn.dirtyCompoundBoundsCache = function() {
  var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy();
  return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) {
    if (r.isParent()) {
      var n = r._private;
      n.compoundBoundsClean = false, n.bbCache = null, t13 || r.emitAndNotify("bounds");
    }
  }), this);
};
Zn.updateCompoundBounds = function() {
  var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy();
  if (!e.styleEnabled() || !e.hasCompoundNodes())
    return this;
  if (!t13 && e.batching())
    return this;
  function r(o) {
    if (!o.isParent())
      return;
    var s = o._private, l = o.children(), u = o.pstyle("compound-sizing-wrt-labels").value === "include", c = {
      width: {
        val: o.pstyle("min-width").pfValue,
        left: o.pstyle("min-width-bias-left"),
        right: o.pstyle("min-width-bias-right")
      },
      height: {
        val: o.pstyle("min-height").pfValue,
        top: o.pstyle("min-height-bias-top"),
        bottom: o.pstyle("min-height-bias-bottom")
      }
    }, d = l.boundingBox({
      includeLabels: u,
      includeOverlays: false,
      // updating the compound bounds happens outside of the regular
      // cache cycle (i.e. before fired events)
      useCache: false
    }), v = s.position;
    (d.w === 0 || d.h === 0) && (d = {
      w: o.pstyle("width").pfValue,
      h: o.pstyle("height").pfValue
    }, d.x1 = v.x - d.w / 2, d.x2 = v.x + d.w / 2, d.y1 = v.y - d.h / 2, d.y2 = v.y + d.h / 2);
    function h6(k, _, D) {
      var O = 0, A = 0, L = _ + D;
      return k > 0 && L > 0 && (O = _ / L * k, A = D / L * k), {
        biasDiff: O,
        biasComplementDiff: A
      };
    }
    function f(k, _, D, O) {
      if (D.units === "%")
        switch (O) {
          case "width":
            return k > 0 ? D.pfValue * k : 0;
          case "height":
            return _ > 0 ? D.pfValue * _ : 0;
          case "average":
            return k > 0 && _ > 0 ? D.pfValue * (k + _) / 2 : 0;
          case "min":
            return k > 0 && _ > 0 ? k > _ ? D.pfValue * _ : D.pfValue * k : 0;
          case "max":
            return k > 0 && _ > 0 ? k > _ ? D.pfValue * k : D.pfValue * _ : 0;
          default:
            return 0;
        }
      else return D.units === "px" ? D.pfValue : 0;
    }
    var p = c.width.left.value;
    c.width.left.units === "px" && c.width.val > 0 && (p = p * 100 / c.width.val);
    var m = c.width.right.value;
    c.width.right.units === "px" && c.width.val > 0 && (m = m * 100 / c.width.val);
    var g = c.height.top.value;
    c.height.top.units === "px" && c.height.val > 0 && (g = g * 100 / c.height.val);
    var y = c.height.bottom.value;
    c.height.bottom.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val);
    var b = h6(c.width.val - d.w, p, m), w = b.biasDiff, C = b.biasComplementDiff, E = h6(c.height.val - d.h, g, y), x = E.biasDiff, T = E.biasComplementDiff;
    s.autoPadding = f(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), v.x = (-w + d.x1 + d.x2 + C) / 2, s.autoHeight = Math.max(d.h, c.height.val), v.y = (-x + d.y1 + d.y2 + T) / 2;
  }
  for (var n = 0; n < this.length; n++) {
    var a = this[n], i = a._private;
    (!i.compoundBoundsClean || t13) && (r(a), e.batching() || (i.compoundBoundsClean = true));
  }
  return this;
};
var Er = function(e) {
  return e === 1 / 0 || e === -1 / 0 ? 0 : e;
};
var Br = function(e, r, n, a, i) {
  a - r === 0 || i - n === 0 || r == null || n == null || a == null || i == null || (e.x1 = r < e.x1 ? r : e.x1, e.x2 = a > e.x2 ? a : e.x2, e.y1 = n < e.y1 ? n : e.y1, e.y2 = i > e.y2 ? i : e.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1);
};
var ra = function(e, r) {
  return r == null ? e : Br(e, r.x1, r.y1, r.x2, r.y2);
};
var Fi = function(e, r, n) {
  return Nr(e, r, n);
};
var Qo = function(e, r, n) {
  if (!r.cy().headless()) {
    var a = r._private, i = a.rstyle, o = i.arrowWidth / 2, s = r.pstyle(n + "-arrow-shape").value, l, u;
    if (s !== "none") {
      n === "source" ? (l = i.srcX, u = i.srcY) : n === "target" ? (l = i.tgtX, u = i.tgtY) : (l = i.midX, u = i.midY);
      var c = a.arrowBounds = a.arrowBounds || {}, d = c[n] = c[n] || {};
      d.x1 = l - o, d.y1 = u - o, d.x2 = l + o, d.y2 = u + o, d.w = d.x2 - d.x1, d.h = d.y2 - d.y1, us(d, 1), Br(e, d.x1, d.y1, d.x2, d.y2);
    }
  }
};
var Hl = function(e, r, n) {
  if (!r.cy().headless()) {
    var a;
    n ? a = n + "-" : a = "";
    var i = r._private, o = i.rstyle, s = r.pstyle(a + "label").strValue;
    if (s) {
      var l = r.pstyle("text-halign"), u = r.pstyle("text-valign"), c = Fi(o, "labelWidth", n), d = Fi(o, "labelHeight", n), v = Fi(o, "labelX", n), h6 = Fi(o, "labelY", n), f = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, m = r.isEdge(), g = r.pstyle(a + "text-rotation"), y = r.pstyle("text-outline-width").pfValue, b = r.pstyle("text-border-width").pfValue, w = b / 2, C = r.pstyle("text-background-padding").pfValue, E = 2, x = d, T = c, k = T / 2, _ = x / 2, D, O, A, L;
      if (m)
        D = v - k, O = v + k, A = h6 - _, L = h6 + _;
      else {
        switch (l.value) {
          case "left":
            D = v - T, O = v;
            break;
          case "center":
            D = v - k, O = v + k;
            break;
          case "right":
            D = v, O = v + T;
            break;
        }
        switch (u.value) {
          case "top":
            A = h6 - x, L = h6;
            break;
          case "center":
            A = h6 - _, L = h6 + _;
            break;
          case "bottom":
            A = h6, L = h6 + x;
            break;
        }
      }
      D += f - Math.max(y, w) - C - E, O += f + Math.max(y, w) + C + E, A += p - Math.max(y, w) - C - E, L += p + Math.max(y, w) + C + E;
      var N = n || "main", I = i.labelBounds, M = I[N] = I[N] || {};
      M.x1 = D, M.y1 = A, M.x2 = O, M.y2 = L, M.w = O - D, M.h = L - A;
      var F = m && g.strValue === "autorotate", $ = g.pfValue != null && g.pfValue !== 0;
      if (F || $) {
        var U = F ? Fi(i.rstyle, "labelAngle", n) : g.pfValue, H = Math.cos(U), K = Math.sin(U), ee = (D + O) / 2, se = (A + L) / 2;
        if (!m) {
          switch (l.value) {
            case "left":
              ee = O;
              break;
            case "right":
              ee = D;
              break;
          }
          switch (u.value) {
            case "top":
              se = L;
              break;
            case "bottom":
              se = A;
              break;
          }
        }
        var oe = function(Ee, ve) {
          return Ee = Ee - ee, ve = ve - se, {
            x: Ee * H - ve * K + ee,
            y: Ee * K + ve * H + se
          };
        }, ne = oe(D, A), ue = oe(D, L), te = oe(O, A), R = oe(O, L);
        D = Math.min(ne.x, ue.x, te.x, R.x), O = Math.max(ne.x, ue.x, te.x, R.x), A = Math.min(ne.y, ue.y, te.y, R.y), L = Math.max(ne.y, ue.y, te.y, R.y);
      }
      var Y = N + "Rot", J = I[Y] = I[Y] || {};
      J.x1 = D, J.y1 = A, J.x2 = O, J.y2 = L, J.w = O - D, J.h = L - A, Br(e, D, A, O, L), Br(i.labelBounds.all, D, A, O, L);
    }
    return e;
  }
};
var BD = function(e, r) {
  if (!r.cy().headless()) {
    var n = r.pstyle("outline-opacity").value, a = r.pstyle("outline-width").value;
    if (n > 0 && a > 0) {
      var i = r.pstyle("outline-offset").value, o = r.pstyle("shape").value, s = a + i, l = (e.w + s * 2) / e.w, u = (e.h + s * 2) / e.h, c = 0, d = 0;
      ["diamond", "pentagon", "round-triangle"].includes(o) ? (l = (e.w + s * 2.4) / e.w, d = -s / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(o) ? l = (e.w + s * 2.4) / e.w : o === "star" ? (l = (e.w + s * 2.8) / e.w, u = (e.h + s * 2.6) / e.h, d = -s / 3.8) : o === "triangle" ? (l = (e.w + s * 2.8) / e.w, u = (e.h + s * 2.4) / e.h, d = -s / 1.4) : o === "vee" && (l = (e.w + s * 4.4) / e.w, u = (e.h + s * 3.8) / e.h, d = -s * 0.5);
      var v = e.h * u - e.h, h6 = e.w * l - e.w;
      if (cs(e, [Math.ceil(v / 2), Math.ceil(h6 / 2)]), c != 0 || d !== 0) {
        var f = n4(e, c, d);
        pp(e, f);
      }
    }
  }
};
var ND = function(e, r) {
  var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = pr(), s = e._private, l = e.isNode(), u = e.isEdge(), c, d, v, h6, f, p, m = s.rstyle, g = l && a ? e.pstyle("bounds-expansion").pfValue : [0], y = function(Ce) {
    return Ce.pstyle("display").value !== "none";
  }, b = !a || y(e) && (!u || y(e.source()) && y(e.target()));
  if (b) {
    var w = 0, C = 0;
    a && r.includeOverlays && (w = e.pstyle("overlay-opacity").value, w !== 0 && (C = e.pstyle("overlay-padding").value));
    var E = 0, x = 0;
    a && r.includeUnderlays && (E = e.pstyle("underlay-opacity").value, E !== 0 && (x = e.pstyle("underlay-padding").value));
    var T = Math.max(C, x), k = 0, _ = 0;
    if (a && (k = e.pstyle("width").pfValue, _ = k / 2), l && r.includeNodes) {
      var D = e.position();
      f = D.x, p = D.y;
      var O = e.outerWidth(), A = O / 2, L = e.outerHeight(), N = L / 2;
      c = f - A, d = f + A, v = p - N, h6 = p + N, Br(o, c, v, d, h6), a && r.includeOutlines && BD(o, e);
    } else if (u && r.includeEdges)
      if (a && !i) {
        var I = e.pstyle("curve-style").strValue;
        if (c = Math.min(m.srcX, m.midX, m.tgtX), d = Math.max(m.srcX, m.midX, m.tgtX), v = Math.min(m.srcY, m.midY, m.tgtY), h6 = Math.max(m.srcY, m.midY, m.tgtY), c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6), I === "haystack") {
          var M = m.haystackPts;
          if (M && M.length === 2) {
            if (c = M[0].x, v = M[0].y, d = M[1].x, h6 = M[1].y, c > d) {
              var F = c;
              c = d, d = F;
            }
            if (v > h6) {
              var $ = v;
              v = h6, h6 = $;
            }
            Br(o, c - _, v - _, d + _, h6 + _);
          }
        } else if (I === "bezier" || I === "unbundled-bezier" || I.endsWith("segments") || I.endsWith("taxi")) {
          var U;
          switch (I) {
            case "bezier":
            case "unbundled-bezier":
              U = m.bezierPts;
              break;
            case "segments":
            case "taxi":
            case "round-segments":
            case "round-taxi":
              U = m.linePts;
              break;
          }
          if (U != null)
            for (var H = 0; H < U.length; H++) {
              var K = U[H];
              c = K.x - _, d = K.x + _, v = K.y - _, h6 = K.y + _, Br(o, c, v, d, h6);
            }
        }
      } else {
        var ee = e.source(), se = ee.position(), oe = e.target(), ne = oe.position();
        if (c = se.x, d = ne.x, v = se.y, h6 = ne.y, c > d) {
          var ue = c;
          c = d, d = ue;
        }
        if (v > h6) {
          var te = v;
          v = h6, h6 = te;
        }
        c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6);
      }
    if (a && r.includeEdges && u && (Qo(o, e, "mid-source"), Qo(o, e, "mid-target"), Qo(o, e, "source"), Qo(o, e, "target")), a) {
      var R = e.pstyle("ghost").value === "yes";
      if (R) {
        var Y = e.pstyle("ghost-offset-x").pfValue, J = e.pstyle("ghost-offset-y").pfValue;
        Br(o, o.x1 + Y, o.y1 + J, o.x2 + Y, o.y2 + J);
      }
    }
    var ge = s.bodyBounds = s.bodyBounds || {};
    ff(ge, o), cs(ge, g), us(ge, 1), a && (c = o.x1, d = o.x2, v = o.y1, h6 = o.y2, Br(o, c - T, v - T, d + T, h6 + T));
    var Ee = s.overlayBounds = s.overlayBounds || {};
    ff(Ee, o), cs(Ee, g), us(Ee, 1);
    var ve = s.labelBounds = s.labelBounds || {};
    ve.all != null ? r4(ve.all) : ve.all = pr(), a && r.includeLabels && (r.includeMainLabels && Hl(o, e, null), u && (r.includeSourceLabels && Hl(o, e, "source"), r.includeTargetLabels && Hl(o, e, "target")));
  }
  return o.x1 = Er(o.x1), o.y1 = Er(o.y1), o.x2 = Er(o.x2), o.y2 = Er(o.y2), o.w = Er(o.x2 - o.x1), o.h = Er(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (cs(o, g), us(o, 1)), o;
};
var Hp = function(e) {
  var r = 0, n = function(o) {
    return (o ? 1 : 0) << r++;
  }, a = 0;
  return a += n(e.incudeNodes), a += n(e.includeEdges), a += n(e.includeLabels), a += n(e.includeMainLabels), a += n(e.includeSourceLabels), a += n(e.includeTargetLabels), a += n(e.includeOverlays), a += n(e.includeOutlines), a;
};
var Kp = function(e) {
  if (e.isEdge()) {
    var r = e.source().position(), n = e.target().position(), a = function(o) {
      return Math.round(o);
    };
    return E5([a(r.x), a(r.y), a(n.x), a(n.y)]);
  } else
    return 0;
};
var Ff = function(e, r) {
  var n = e._private, a, i = e.isEdge(), o = r == null ? Mf : Hp(r), s = o === Mf, l = Kp(e), u = n.bbCachePosKey === l, c = r.useCache && u, d = function(p) {
    return p._private.bbCache == null || p._private.styleDirty;
  }, v = !c || d(e) || i && d(e.source()) || d(e.target());
  if (v ? (u || e.recalculateRenderedStyle(c), a = ND(e, fo), n.bbCache = a, n.bbCachePosKey = l) : a = n.bbCache, !s) {
    var h6 = e.isNode();
    a = pr(), (r.includeNodes && h6 || r.includeEdges && !h6) && (r.includeOverlays ? ra(a, n.overlayBounds) : ra(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ra(a, n.labelBounds.all) : (r.includeMainLabels && ra(a, n.labelBounds.mainRot), r.includeSourceLabels && ra(a, n.labelBounds.sourceRot), r.includeTargetLabels && ra(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1;
  }
  return a;
};
var fo = {
  includeNodes: true,
  includeEdges: true,
  includeLabels: true,
  includeMainLabels: true,
  includeSourceLabels: true,
  includeTargetLabels: true,
  includeOverlays: true,
  includeUnderlays: true,
  includeOutlines: true,
  useCache: true
};
var Mf = Hp(fo);
var Bf = Yt(fo);
Zn.boundingBox = function(t13) {
  var e;
  if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t13 === void 0 || t13.useCache === void 0 || t13.useCache === true))
    t13 === void 0 ? t13 = fo : t13 = Bf(t13), e = Ff(this[0], t13);
  else {
    e = pr(), t13 = t13 || fo;
    var r = Bf(t13), n = this, a = n.cy(), i = a.styleEnabled();
    if (i)
      for (var o = 0; o < n.length; o++) {
        var s = n[o], l = s._private, u = Kp(s), c = l.bbCachePosKey === u, d = r.useCache && c && !l.styleDirty;
        s.recalculateRenderedStyle(d);
      }
    this.updateCompoundBounds(!t13.useCache);
    for (var v = 0; v < n.length; v++) {
      var h6 = n[v];
      ra(e, Ff(h6, r));
    }
  }
  return e.x1 = Er(e.x1), e.y1 = Er(e.y1), e.x2 = Er(e.x2), e.y2 = Er(e.y2), e.w = Er(e.x2 - e.x1), e.h = Er(e.y2 - e.y1), e;
};
Zn.dirtyBoundingBoxCache = function() {
  for (var t13 = 0; t13 < this.length; t13++) {
    var e = this[t13]._private;
    e.bbCache = null, e.bbCachePosKey = null, e.bodyBounds = null, e.overlayBounds = null, e.labelBounds.all = null, e.labelBounds.source = null, e.labelBounds.target = null, e.labelBounds.main = null, e.labelBounds.sourceRot = null, e.labelBounds.targetRot = null, e.labelBounds.mainRot = null, e.arrowBounds.source = null, e.arrowBounds.target = null, e.arrowBounds["mid-source"] = null, e.arrowBounds["mid-target"] = null;
  }
  return this.emitAndNotify("bounds"), this;
};
Zn.boundingBoxAt = function(t13) {
  var e = this.nodes(), r = this.cy(), n = r.hasCompoundNodes(), a = r.collection();
  if (n && (a = e.filter(function(u) {
    return u.isParent();
  }), e = e.not(a)), Xe(t13)) {
    var i = t13;
    t13 = function() {
      return i;
    };
  }
  var o = function(c, d) {
    return c._private.bbAtOldPos = t13(c, d);
  }, s = function(c) {
    return c._private.bbAtOldPos;
  };
  r.startBatch(), e.forEach(o).silentPositions(t13), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true));
  var l = t4(this.boundingBox({
    useCache: false
  }));
  return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)), r.endBatch(), l;
};
Za.boundingbox = Za.bb = Za.boundingBox;
Za.renderedBoundingbox = Za.renderedBoundingBox;
var RD = Zn;
var Vi;
var Lo;
Vi = Lo = {};
var qp = function(e) {
  e.uppercaseName = af(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = af(e.outerName), Vi[e.name] = function() {
    var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled;
    if (n)
      if (o) {
        if (n.isParent())
          return n.updateCompoundBounds(), a[e.autoName] || 0;
        var s = n.pstyle(e.name);
        switch (s.strValue) {
          case "label":
            return n.recalculateRenderedStyle(), a.rstyle[e.labelName] || 0;
          default:
            return s.pfValue;
        }
      } else
        return 1;
  }, Vi["outer" + e.uppercaseName] = function() {
    var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled;
    if (n)
      if (o) {
        var s = n[e.name](), l = n.pstyle("border-width").pfValue, u = 2 * n.padding();
        return s + l + u;
      } else
        return 1;
  }, Vi["rendered" + e.uppercaseName] = function() {
    var n = this[0];
    if (n) {
      var a = n[e.name]();
      return a * this.cy().zoom();
    }
  }, Vi["rendered" + e.uppercaseOuterName] = function() {
    var n = this[0];
    if (n) {
      var a = n[e.outerName]();
      return a * this.cy().zoom();
    }
  };
};
qp({
  name: "width"
});
qp({
  name: "height"
});
Lo.padding = function() {
  var t13 = this[0], e = t13._private;
  return t13.isParent() ? (t13.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t13.pstyle("padding").pfValue) : t13.pstyle("padding").pfValue;
};
Lo.paddedHeight = function() {
  var t13 = this[0];
  return t13.height() + 2 * t13.padding();
};
Lo.paddedWidth = function() {
  var t13 = this[0];
  return t13.width() + 2 * t13.padding();
};
var $D = Lo;
var zD = function(e, r) {
  if (e.isEdge())
    return r(e);
};
var VD = function(e, r) {
  if (e.isEdge()) {
    var n = e.cy();
    return il(r(e), n.zoom(), n.pan());
  }
};
var HD = function(e, r) {
  if (e.isEdge()) {
    var n = e.cy(), a = n.pan(), i = n.zoom();
    return r(e).map(function(o) {
      return il(o, i, a);
    });
  }
};
var KD = function(e) {
  return e.renderer().getControlPoints(e);
};
var qD = function(e) {
  return e.renderer().getSegmentPoints(e);
};
var UD = function(e) {
  return e.renderer().getSourceEndpoint(e);
};
var GD = function(e) {
  return e.renderer().getTargetEndpoint(e);
};
var WD = function(e) {
  return e.renderer().getEdgeMidpoint(e);
};
var Nf = {
  controlPoints: {
    get: KD,
    mult: true
  },
  segmentPoints: {
    get: qD,
    mult: true
  },
  sourceEndpoint: {
    get: UD
  },
  targetEndpoint: {
    get: GD
  },
  midpoint: {
    get: WD
  }
};
var YD = function(e) {
  return "rendered" + e[0].toUpperCase() + e.substr(1);
};
var jD = Object.keys(Nf).reduce(function(t13, e) {
  var r = Nf[e], n = YD(e);
  return t13[e] = function() {
    return zD(this, r.get);
  }, r.mult ? t13[n] = function() {
    return HD(this, r.get);
  } : t13[n] = function() {
    return VD(this, r.get);
  }, t13;
}, {});
var ZD = ze({}, MD, RD, $D, jD);
var Up = function(e, r) {
  this.recycle(e, r);
};
function Mi() {
  return false;
}
function Jo() {
  return true;
}
Up.prototype = {
  instanceString: function() {
    return "event";
  },
  recycle: function(e, r) {
    if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = Mi, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Jo : Mi) : e != null && e.type ? r = e : this.type = e, r != null && (this.originalEvent = r.originalEvent, this.type = r.type != null ? r.type : this.type, this.cy = r.cy, this.target = r.target, this.position = r.position, this.renderedPosition = r.renderedPosition, this.namespace = r.namespace, this.layout = r.layout), this.cy != null && this.position != null && this.renderedPosition == null) {
      var n = this.position, a = this.cy.zoom(), i = this.cy.pan();
      this.renderedPosition = {
        x: n.x * a + i.x,
        y: n.y * a + i.y
      };
    }
    this.timeStamp = e && e.timeStamp || Date.now();
  },
  preventDefault: function() {
    this.isDefaultPrevented = Jo;
    var e = this.originalEvent;
    e && e.preventDefault && e.preventDefault();
  },
  stopPropagation: function() {
    this.isPropagationStopped = Jo;
    var e = this.originalEvent;
    e && e.stopPropagation && e.stopPropagation();
  },
  stopImmediatePropagation: function() {
    this.isImmediatePropagationStopped = Jo, this.stopPropagation();
  },
  isDefaultPrevented: Mi,
  isPropagationStopped: Mi,
  isImmediatePropagationStopped: Mi
};
var Gp = /^([^.]+)(\.(?:[^.]+))?$/;
var XD = ".*";
var Wp = {
  qualifierCompare: function(e, r) {
    return e === r;
  },
  eventMatches: function() {
    return true;
  },
  addEventFields: function() {
  },
  callbackContext: function(e) {
    return e;
  },
  beforeEmit: function() {
  },
  afterEmit: function() {
  },
  bubble: function() {
    return false;
  },
  parent: function() {
    return null;
  },
  context: null
};
var Rf = Object.keys(Wp);
var QD = {};
function dl() {
  for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : QD, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < Rf.length; r++) {
    var n = Rf[r];
    this[n] = t13[n] || Wp[n];
  }
  this.context = e || this.context, this.listeners = [], this.emitting = 0;
}
var Wn = dl.prototype;
var Yp = function(e, r, n, a, i, o, s) {
  pt(a) && (i = a, a = null), s && (o == null ? o = s : o = ze({}, o, s));
  for (var l = st(n) ? n : n.split(/\s+/), u = 0; u < l.length; u++) {
    var c = l[u];
    if (!Kn(c)) {
      var d = c.match(Gp);
      if (d) {
        var v = d[1], h6 = d[2] ? d[2] : null, f = r(e, c, v, h6, a, i, o);
        if (f === false)
          break;
      }
    }
  }
};
var $f = function(e, r) {
  return e.addEventFields(e.context, r), new Up(r.type, r);
};
var JD = function(e, r, n) {
  if (bT(n)) {
    r(e, n);
    return;
  } else if (Xe(n)) {
    r(e, $f(e, n));
    return;
  }
  for (var a = st(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) {
    var o = a[i];
    if (!Kn(o)) {
      var s = o.match(Gp);
      if (s) {
        var l = s[1], u = s[2] ? s[2] : null, c = $f(e, {
          type: l,
          namespace: u,
          target: e.context
        });
        r(e, c);
      }
    }
  }
};
Wn.on = Wn.addListener = function(t13, e, r, n, a) {
  return Yp(this, function(i, o, s, l, u, c, d) {
    pt(c) && i.listeners.push({
      event: o,
      // full event string
      callback: c,
      // callback to run
      type: s,
      // the event type (e.g. 'click')
      namespace: l,
      // the event namespace (e.g. ".foo")
      qualifier: u,
      // a restriction on whether to match this emitter
      conf: d
      // additional configuration
    });
  }, t13, e, r, n, a), this;
};
Wn.one = function(t13, e, r, n) {
  return this.on(t13, e, r, n, {
    one: true
  });
};
Wn.removeListener = Wn.off = function(t13, e, r, n) {
  var a = this;
  this.emitting !== 0 && (this.listeners = D5(this.listeners));
  for (var i = this.listeners, o = function(u) {
    var c = i[u];
    Yp(a, function(d, v, h6, f, p, m) {
      if ((c.type === h6 || t13 === "*") && (!f && c.namespace !== ".*" || c.namespace === f) && (!p || d.qualifierCompare(c.qualifier, p)) && (!m || c.callback === m))
        return i.splice(u, 1), false;
    }, t13, e, r, n);
  }, s = i.length - 1; s >= 0; s--)
    o(s);
  return this;
};
Wn.removeAllListeners = function() {
  return this.removeListener("*");
};
Wn.emit = Wn.trigger = function(t13, e, r) {
  var n = this.listeners, a = n.length;
  return this.emitting++, st(e) || (e = [e]), JD(this, function(i, o) {
    r != null && (n = [{
      event: o.event,
      type: o.type,
      namespace: o.namespace,
      callback: r
    }], a = n.length);
    for (var s = function(c) {
      var d = n[c];
      if (d.type === o.type && (!d.namespace || d.namespace === o.namespace || d.namespace === XD) && i.eventMatches(i.context, d, o)) {
        var v = [o];
        e != null && O5(v, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) {
          return p !== d;
        }));
        var h6 = i.callbackContext(i.context, d, o), f = d.callback.apply(h6, v);
        i.afterEmit(i.context, d, o), f === false && (o.stopPropagation(), o.preventDefault());
      }
    }, l = 0; l < a; l++)
      s(l);
    i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e);
  }, t13), this.emitting--, this;
};
var eP = {
  qualifierCompare: function(e, r) {
    return e == null || r == null ? e == null && r == null : e.sameText(r);
  },
  eventMatches: function(e, r, n) {
    var a = r.qualifier;
    return a != null ? e !== n.target && Do(n.target) && a.matches(n.target) : true;
  },
  addEventFields: function(e, r) {
    r.cy = e.cy(), r.target = e;
  },
  callbackContext: function(e, r, n) {
    return r.qualifier != null ? n.target : e;
  },
  beforeEmit: function(e, r) {
    r.conf && r.conf.once && r.conf.onceCollection.removeListener(r.event, r.qualifier, r.callback);
  },
  bubble: function() {
    return true;
  },
  parent: function(e) {
    return e.isChild() ? e.parent() : e.cy();
  }
};
var es = function(e) {
  return Ae(e) ? new Un(e) : e;
};
var jp = {
  createEmitter: function() {
    for (var e = 0; e < this.length; e++) {
      var r = this[e], n = r._private;
      n.emitter || (n.emitter = new dl(eP, r));
    }
    return this;
  },
  emitter: function() {
    return this._private.emitter;
  },
  on: function(e, r, n) {
    for (var a = es(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().on(e, a, n);
    }
    return this;
  },
  removeListener: function(e, r, n) {
    for (var a = es(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().removeListener(e, a, n);
    }
    return this;
  },
  removeAllListeners: function() {
    for (var e = 0; e < this.length; e++) {
      var r = this[e];
      r.emitter().removeAllListeners();
    }
    return this;
  },
  one: function(e, r, n) {
    for (var a = es(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().one(e, a, n);
    }
    return this;
  },
  once: function(e, r, n) {
    for (var a = es(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().on(e, a, n, {
        once: true,
        onceCollection: this
      });
    }
  },
  emit: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = this[n];
      a.emitter().emit(e, r);
    }
    return this;
  },
  emitAndNotify: function(e, r) {
    if (this.length !== 0)
      return this.cy().notify(e, this), this.emit(e, r), this;
  }
};
et.eventAliasesOn(jp);
var Zp = {
  nodes: function(e) {
    return this.filter(function(r) {
      return r.isNode();
    }).filter(e);
  },
  edges: function(e) {
    return this.filter(function(r) {
      return r.isEdge();
    }).filter(e);
  },
  // internal helper to get nodes and edges as separate collections with single iteration over elements
  byGroup: function() {
    for (var e = this.spawn(), r = this.spawn(), n = 0; n < this.length; n++) {
      var a = this[n];
      a.isNode() ? e.push(a) : r.push(a);
    }
    return {
      nodes: e,
      edges: r
    };
  },
  filter: function(e, r) {
    if (e === void 0)
      return this;
    if (Ae(e) || yr(e))
      return new Un(e).filter(this);
    if (pt(e)) {
      for (var n = this.spawn(), a = this, i = 0; i < a.length; i++) {
        var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a);
        s && n.push(o);
      }
      return n;
    }
    return this.spawn();
  },
  not: function(e) {
    if (e) {
      Ae(e) && (e = this.filter(e));
      for (var r = this.spawn(), n = 0; n < this.length; n++) {
        var a = this[n], i = e.has(a);
        i || r.push(a);
      }
      return r;
    } else
      return this;
  },
  absoluteComplement: function() {
    var e = this.cy();
    return e.mutableElements().not(this);
  },
  intersect: function(e) {
    if (Ae(e)) {
      var r = e;
      return this.filter(r);
    }
    for (var n = this.spawn(), a = this, i = e, o = this.length < e.length, s = o ? a : i, l = o ? i : a, u = 0; u < s.length; u++) {
      var c = s[u];
      l.has(c) && n.push(c);
    }
    return n;
  },
  xor: function(e) {
    var r = this._private.cy;
    Ae(e) && (e = r.$(e));
    var n = this.spawn(), a = this, i = e, o = function(l, u) {
      for (var c = 0; c < l.length; c++) {
        var d = l[c], v = d._private.data.id, h6 = u.hasElementWithId(v);
        h6 || n.push(d);
      }
    };
    return o(a, i), o(i, a), n;
  },
  diff: function(e) {
    var r = this._private.cy;
    Ae(e) && (e = r.$(e));
    var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, l = function(c, d, v) {
      for (var h6 = 0; h6 < c.length; h6++) {
        var f = c[h6], p = f._private.data.id, m = d.hasElementWithId(p);
        m ? i.merge(f) : v.push(f);
      }
    };
    return l(o, s, n), l(s, o, a), {
      left: n,
      right: a,
      both: i
    };
  },
  add: function(e) {
    var r = this._private.cy;
    if (!e)
      return this;
    if (Ae(e)) {
      var n = e;
      e = r.mutableElements().filter(n);
    }
    for (var a = this.spawnSelf(), i = 0; i < e.length; i++) {
      var o = e[i], s = !this.has(o);
      s && a.push(o);
    }
    return a;
  },
  // in place merge on calling collection
  merge: function(e) {
    var r = this._private, n = r.cy;
    if (!e)
      return this;
    if (e && Ae(e)) {
      var a = e;
      e = n.mutableElements().filter(a);
    }
    for (var i = r.map, o = 0; o < e.length; o++) {
      var s = e[o], l = s._private.data.id, u = !i.has(l);
      if (u) {
        var c = this.length++;
        this[c] = s, i.set(l, {
          ele: s,
          index: c
        });
      }
    }
    return this;
  },
  unmergeAt: function(e) {
    var r = this[e], n = r.id(), a = this._private, i = a.map;
    this[e] = void 0, i.delete(n);
    var o = e === this.length - 1;
    if (this.length > 1 && !o) {
      var s = this.length - 1, l = this[s], u = l._private.data.id;
      this[s] = void 0, this[e] = l, i.set(u, {
        ele: l,
        index: e
      });
    }
    return this.length--, this;
  },
  // remove single ele in place in calling collection
  unmergeOne: function(e) {
    e = e[0];
    var r = this._private, n = e._private.data.id, a = r.map, i = a.get(n);
    if (!i)
      return this;
    var o = i.index;
    return this.unmergeAt(o), this;
  },
  // remove eles in place on calling collection
  unmerge: function(e) {
    var r = this._private.cy;
    if (!e)
      return this;
    if (e && Ae(e)) {
      var n = e;
      e = r.mutableElements().filter(n);
    }
    for (var a = 0; a < e.length; a++)
      this.unmergeOne(e[a]);
    return this;
  },
  unmergeBy: function(e) {
    for (var r = this.length - 1; r >= 0; r--) {
      var n = this[r];
      e(n) && this.unmergeAt(r);
    }
    return this;
  },
  map: function(e, r) {
    for (var n = [], a = this, i = 0; i < a.length; i++) {
      var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a);
      n.push(s);
    }
    return n;
  },
  reduce: function(e, r) {
    for (var n = r, a = this, i = 0; i < a.length; i++)
      n = e(n, a[i], i, a);
    return n;
  },
  max: function(e, r) {
    for (var n = -1 / 0, a, i = this, o = 0; o < i.length; o++) {
      var s = i[o], l = r ? e.apply(r, [s, o, i]) : e(s, o, i);
      l > n && (n = l, a = s);
    }
    return {
      value: n,
      ele: a
    };
  },
  min: function(e, r) {
    for (var n = 1 / 0, a, i = this, o = 0; o < i.length; o++) {
      var s = i[o], l = r ? e.apply(r, [s, o, i]) : e(s, o, i);
      l < n && (n = l, a = s);
    }
    return {
      value: n,
      ele: a
    };
  }
};
var Je = Zp;
Je.u = Je["|"] = Je["+"] = Je.union = Je.or = Je.add;
Je["\\"] = Je["!"] = Je["-"] = Je.difference = Je.relativeComplement = Je.subtract = Je.not;
Je.n = Je["&"] = Je["."] = Je.and = Je.intersection = Je.intersect;
Je["^"] = Je["(+)"] = Je["(-)"] = Je.symmetricDifference = Je.symdiff = Je.xor;
Je.fnFilter = Je.filterFn = Je.stdFilter = Je.filter;
Je.complement = Je.abscomp = Je.absoluteComplement;
var tP = {
  isNode: function() {
    return this.group() === "nodes";
  },
  isEdge: function() {
    return this.group() === "edges";
  },
  isLoop: function() {
    return this.isEdge() && this.source()[0] === this.target()[0];
  },
  isSimple: function() {
    return this.isEdge() && this.source()[0] !== this.target()[0];
  },
  group: function() {
    var e = this[0];
    if (e)
      return e._private.group;
  }
};
var Xp = function(e, r) {
  var n = e.cy(), a = n.hasCompoundNodes();
  function i(c) {
    var d = c.pstyle("z-compound-depth");
    return d.value === "auto" ? a ? c.zDepth() : 0 : d.value === "bottom" ? -1 : d.value === "top" ? dc : 0;
  }
  var o = i(e) - i(r);
  if (o !== 0)
    return o;
  function s(c) {
    var d = c.pstyle("z-index-compare");
    return d.value === "auto" && c.isNode() ? 1 : 0;
  }
  var l = s(e) - s(r);
  if (l !== 0)
    return l;
  var u = e.pstyle("z-index").value - r.pstyle("z-index").value;
  return u !== 0 ? u : e.poolIndex() - r.poolIndex();
};
var Ms = {
  forEach: function(e, r) {
    if (pt(e))
      for (var n = this.length, a = 0; a < n; a++) {
        var i = this[a], o = r ? e.apply(r, [i, a, this]) : e(i, a, this);
        if (o === false)
          break;
      }
    return this;
  },
  toArray: function() {
    for (var e = [], r = 0; r < this.length; r++)
      e.push(this[r]);
    return e;
  },
  slice: function(e, r) {
    var n = [], a = this.length;
    r == null && (r = a), e == null && (e = 0), e < 0 && (e = a + e), r < 0 && (r = a + r);
    for (var i = e; i >= 0 && i < r && i < a; i++)
      n.push(this[i]);
    return this.spawn(n);
  },
  size: function() {
    return this.length;
  },
  eq: function(e) {
    return this[e] || this.spawn();
  },
  first: function() {
    return this[0] || this.spawn();
  },
  last: function() {
    return this[this.length - 1] || this.spawn();
  },
  empty: function() {
    return this.length === 0;
  },
  nonempty: function() {
    return !this.empty();
  },
  sort: function(e) {
    if (!pt(e))
      return this;
    var r = this.toArray().sort(e);
    return this.spawn(r);
  },
  sortByZIndex: function() {
    return this.sort(Xp);
  },
  zDepth: function() {
    var e = this[0];
    if (e) {
      var r = e._private, n = r.group;
      if (n === "nodes") {
        var a = r.data.parent ? e.parents().size() : 0;
        return e.isParent() ? a : dc - 1;
      } else {
        var i = r.source, o = r.target, s = i.zDepth(), l = o.zDepth();
        return Math.max(s, l, 0);
      }
    }
  }
};
Ms.each = Ms.forEach;
var rP = function() {
  var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : Ft(Symbol)) != e && Ft(Symbol.iterator) != e;
  r && (Ms[Symbol.iterator] = function() {
    var n = this, a = {
      value: void 0,
      done: false
    }, i = 0, o = this.length;
    return Wh({
      next: function() {
        return i < o ? a.value = n[i++] : (a.value = void 0, a.done = true), a;
      }
    }, Symbol.iterator, function() {
      return this;
    });
  });
};
rP();
var nP = Yt({
  nodeDimensionsIncludeLabels: false
});
var fs = {
  // Calculates and returns node dimensions { x, y } based on options given
  layoutDimensions: function(e) {
    e = nP(e);
    var r;
    if (!this.takesUpSpace())
      r = {
        w: 0,
        h: 0
      };
    else if (e.nodeDimensionsIncludeLabels) {
      var n = this.boundingBox();
      r = {
        w: n.w,
        h: n.h
      };
    } else
      r = {
        w: this.outerWidth(),
        h: this.outerHeight()
      };
    return (r.w === 0 || r.h === 0) && (r.w = r.h = 1), r;
  },
  // using standard layout options, apply position function (w/ or w/o animation)
  layoutPositions: function(e, r, n) {
    var a = this.nodes().filter(function(C) {
      return !C.isParent();
    }), i = this.cy(), o = r.eles, s = function(E) {
      return E.id();
    }, l = no(n, s);
    e.emit({
      type: "layoutstart",
      layout: e
    }), e.animations = [];
    var u = function(E, x, T) {
      var k = {
        x: x.x1 + x.w / 2,
        y: x.y1 + x.h / 2
      }, _ = {
        // scale from center of bounding box (not necessarily 0,0)
        x: (T.x - k.x) * E,
        y: (T.y - k.y) * E
      };
      return {
        x: k.x + _.x,
        y: k.y + _.y
      };
    }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() {
      if (!c)
        return null;
      for (var E = pr(), x = 0; x < a.length; x++) {
        var T = a[x], k = l(T, x);
        a4(E, k.x, k.y);
      }
      return E;
    }, v = d(), h6 = no(function(C, E) {
      var x = l(C, E);
      if (c) {
        var T = Math.abs(r.spacingFactor);
        x = u(T, v, x);
      }
      return r.transform != null && (x = r.transform(C, x)), x;
    }, s);
    if (r.animate) {
      for (var f = 0; f < a.length; f++) {
        var p = a[f], m = h6(p, f), g = r.animateFilter == null || r.animateFilter(p, f);
        if (g) {
          var y = p.animation({
            position: m,
            duration: r.animationDuration,
            easing: r.animationEasing
          });
          e.animations.push(y);
        } else
          p.position(m);
      }
      if (r.fit) {
        var b = i.animation({
          fit: {
            boundingBox: o.boundingBoxAt(h6),
            padding: r.padding
          },
          duration: r.animationDuration,
          easing: r.animationEasing
        });
        e.animations.push(b);
      } else if (r.zoom !== void 0 && r.pan !== void 0) {
        var w = i.animation({
          zoom: r.zoom,
          pan: r.pan,
          duration: r.animationDuration,
          easing: r.animationEasing
        });
        e.animations.push(w);
      }
      e.animations.forEach(function(C) {
        return C.play();
      }), e.one("layoutready", r.ready), e.emit({
        type: "layoutready",
        layout: e
      }), mi.all(e.animations.map(function(C) {
        return C.promise();
      })).then(function() {
        e.one("layoutstop", r.stop), e.emit({
          type: "layoutstop",
          layout: e
        });
      });
    } else
      a.positions(h6), r.fit && i.fit(r.eles, r.padding), r.zoom != null && i.zoom(r.zoom), r.pan && i.pan(r.pan), e.one("layoutready", r.ready), e.emit({
        type: "layoutready",
        layout: e
      }), e.one("layoutstop", r.stop), e.emit({
        type: "layoutstop",
        layout: e
      });
    return this;
  },
  layout: function(e) {
    var r = this.cy();
    return r.makeLayout(ze({}, e, {
      eles: this
    }));
  }
};
fs.createLayout = fs.makeLayout = fs.layout;
function Qp(t13, e, r) {
  var n = r._private, a = n.styleCache = n.styleCache || [], i;
  return (i = a[t13]) != null || (i = a[t13] = e(r)), i;
}
function fl(t13, e) {
  return t13 = ma(t13), function(n) {
    return Qp(t13, e, n);
  };
}
function vl(t13, e) {
  t13 = ma(t13);
  var r = function(a) {
    return e.call(a);
  };
  return function() {
    var a = this[0];
    if (a)
      return Qp(t13, r, a);
  };
}
var Gt = {
  recalculateRenderedStyle: function(e) {
    var r = this.cy(), n = r.renderer(), a = r.styleEnabled();
    return n && a && n.recalculateRenderedStyle(this, e), this;
  },
  dirtyStyleCache: function() {
    var e = this.cy(), r = function(i) {
      return i._private.styleCache = null;
    };
    if (e.hasCompoundNodes()) {
      var n;
      n = this.spawnSelf().merge(this.descendants()).merge(this.parents()), n.merge(n.connectedEdges()), n.forEach(r);
    } else
      this.forEach(function(a) {
        r(a), a.connectedEdges().forEach(r);
      });
    return this;
  },
  // fully updates (recalculates) the style for the elements
  updateStyle: function(e) {
    var r = this._private.cy;
    if (!r.styleEnabled())
      return this;
    if (r.batching()) {
      var n = r._private.batchStyleEles;
      return n.merge(this), this;
    }
    var a = r.hasCompoundNodes(), i = this;
    e = !!(e || e === void 0), a && (i = this.spawnSelf().merge(this.descendants()).merge(this.parents()));
    var o = i;
    return e ? o.emitAndNotify("style") : o.emit("style"), i.forEach(function(s) {
      return s._private.styleDirty = true;
    }), this;
  },
  // private: clears dirty flag and recalculates style
  cleanStyle: function() {
    var e = this.cy();
    if (e.styleEnabled())
      for (var r = 0; r < this.length; r++) {
        var n = this[r];
        n._private.styleDirty && (n._private.styleDirty = false, e.style().apply(n));
      }
  },
  // get the internal parsed style object for the specified property
  parsedStyle: function(e) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, n = this[0], a = n.cy();
    if (a.styleEnabled() && n) {
      this.cleanStyle();
      var i = n._private.style[e];
      return i ?? (r ? a.style().getDefaultProperty(e) : null);
    }
  },
  numericStyle: function(e) {
    var r = this[0];
    if (r.cy().styleEnabled() && r) {
      var n = r.pstyle(e);
      return n.pfValue !== void 0 ? n.pfValue : n.value;
    }
  },
  numericStyleUnits: function(e) {
    var r = this[0];
    if (r.cy().styleEnabled() && r)
      return r.pstyle(e).units;
  },
  // get the specified css property as a rendered value (i.e. on-screen value)
  // or get the whole rendered style if no property specified (NB doesn't allow setting)
  renderedStyle: function(e) {
    var r = this.cy();
    if (!r.styleEnabled())
      return this;
    var n = this[0];
    if (n)
      return r.style().getRenderedStyle(n, e);
  },
  // read the calculated css style of the element or override the style (via a bypass)
  style: function(e, r) {
    var n = this.cy();
    if (!n.styleEnabled())
      return this;
    var a = false, i = n.style();
    if (Xe(e)) {
      var o = e;
      i.applyBypass(this, o, a), this.emitAndNotify("style");
    } else if (Ae(e))
      if (r === void 0) {
        var s = this[0];
        return s ? i.getStylePropertyValue(s, e) : void 0;
      } else
        i.applyBypass(this, e, r, a), this.emitAndNotify("style");
    else if (e === void 0) {
      var l = this[0];
      return l ? i.getRawStyle(l) : void 0;
    }
    return this;
  },
  removeStyle: function(e) {
    var r = this.cy();
    if (!r.styleEnabled())
      return this;
    var n = false, a = r.style(), i = this;
    if (e === void 0)
      for (var o = 0; o < i.length; o++) {
        var s = i[o];
        a.removeAllBypasses(s, n);
      }
    else {
      e = e.split(/\s+/);
      for (var l = 0; l < i.length; l++) {
        var u = i[l];
        a.removeBypasses(u, e, n);
      }
    }
    return this.emitAndNotify("style"), this;
  },
  show: function() {
    return this.css("display", "element"), this;
  },
  hide: function() {
    return this.css("display", "none"), this;
  },
  effectiveOpacity: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return 1;
    var r = e.hasCompoundNodes(), n = this[0];
    if (n) {
      var a = n._private, i = n.pstyle("opacity").value;
      if (!r)
        return i;
      var o = a.data.parent ? n.parents() : null;
      if (o)
        for (var s = 0; s < o.length; s++) {
          var l = o[s], u = l.pstyle("opacity").value;
          i = u * i;
        }
      return i;
    }
  },
  transparent: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return false;
    var r = this[0], n = r.cy().hasCompoundNodes();
    if (r)
      return n ? r.effectiveOpacity() === 0 : r.pstyle("opacity").value === 0;
  },
  backgrounding: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return false;
    var r = this[0];
    return !!r._private.backgrounding;
  }
};
function Kl(t13, e) {
  var r = t13._private, n = r.data.parent ? t13.parents() : null;
  if (n)
    for (var a = 0; a < n.length; a++) {
      var i = n[a];
      if (!e(i))
        return false;
    }
  return true;
}
function Ec(t13) {
  var e = t13.ok, r = t13.edgeOkViaNode || t13.ok, n = t13.parentOk || t13.ok;
  return function() {
    var a = this.cy();
    if (!a.styleEnabled())
      return true;
    var i = this[0], o = a.hasCompoundNodes();
    if (i) {
      var s = i._private;
      if (!e(i))
        return false;
      if (i.isNode())
        return !o || Kl(i, n);
      var l = s.source, u = s.target;
      return r(l) && (!o || Kl(l, r)) && (l === u || r(u) && (!o || Kl(u, r)));
    }
  };
}
var Ci = fl("eleTakesUpSpace", function(t13) {
  return t13.pstyle("display").value === "element" && t13.width() !== 0 && (t13.isNode() ? t13.height() !== 0 : true);
});
Gt.takesUpSpace = vl("takesUpSpace", Ec({
  ok: Ci
}));
var aP = fl("eleInteractive", function(t13) {
  return t13.pstyle("events").value === "yes" && t13.pstyle("visibility").value === "visible" && Ci(t13);
});
var iP = fl("parentInteractive", function(t13) {
  return t13.pstyle("visibility").value === "visible" && Ci(t13);
});
Gt.interactive = vl("interactive", Ec({
  ok: aP,
  parentOk: iP,
  edgeOkViaNode: Ci
}));
Gt.noninteractive = function() {
  var t13 = this[0];
  if (t13)
    return !t13.interactive();
};
var oP = fl("eleVisible", function(t13) {
  return t13.pstyle("visibility").value === "visible" && t13.pstyle("opacity").pfValue !== 0 && Ci(t13);
});
var sP = Ci;
Gt.visible = vl("visible", Ec({
  ok: oP,
  edgeOkViaNode: sP
}));
Gt.hidden = function() {
  var t13 = this[0];
  if (t13)
    return !t13.visible();
};
Gt.isBundledBezier = vl("isBundledBezier", function() {
  return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : false;
});
Gt.bypass = Gt.css = Gt.style;
Gt.renderedCss = Gt.renderedStyle;
Gt.removeBypass = Gt.removeCss = Gt.removeStyle;
Gt.pstyle = Gt.parsedStyle;
var zn = {};
function zf(t13) {
  return function() {
    var e = arguments, r = [];
    if (e.length === 2) {
      var n = e[0], a = e[1];
      this.on(t13.event, n, a);
    } else if (e.length === 1 && pt(e[0])) {
      var i = e[0];
      this.on(t13.event, i);
    } else if (e.length === 0 || e.length === 1 && st(e[0])) {
      for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) {
        var l = this[s], u = !t13.ableField || l._private[t13.ableField], c = l._private[t13.field] != t13.value;
        if (t13.overrideAble) {
          var d = t13.overrideAble(l);
          if (d !== void 0 && (u = d, !d))
            return this;
        }
        u && (l._private[t13.field] = t13.value, c && r.push(l));
      }
      var v = this.spawn(r);
      v.updateStyle(), v.emit(t13.event), o && v.emit(o);
    }
    return this;
  };
}
function xi(t13) {
  zn[t13.field] = function() {
    var e = this[0];
    if (e) {
      if (t13.overrideField) {
        var r = t13.overrideField(e);
        if (r !== void 0)
          return r;
      }
      return e._private[t13.field];
    }
  }, zn[t13.on] = zf({
    event: t13.on,
    field: t13.field,
    ableField: t13.ableField,
    overrideAble: t13.overrideAble,
    value: true
  }), zn[t13.off] = zf({
    event: t13.off,
    field: t13.field,
    ableField: t13.ableField,
    overrideAble: t13.overrideAble,
    value: false
  });
}
xi({
  field: "locked",
  overrideField: function(e) {
    return e.cy().autolock() ? true : void 0;
  },
  on: "lock",
  off: "unlock"
});
xi({
  field: "grabbable",
  overrideField: function(e) {
    return e.cy().autoungrabify() || e.pannable() ? false : void 0;
  },
  on: "grabify",
  off: "ungrabify"
});
xi({
  field: "selected",
  ableField: "selectable",
  overrideAble: function(e) {
    return e.cy().autounselectify() ? false : void 0;
  },
  on: "select",
  off: "unselect"
});
xi({
  field: "selectable",
  overrideField: function(e) {
    return e.cy().autounselectify() ? false : void 0;
  },
  on: "selectify",
  off: "unselectify"
});
zn.deselect = zn.unselect;
zn.grabbed = function() {
  var t13 = this[0];
  if (t13)
    return t13._private.grabbed;
};
xi({
  field: "active",
  on: "activate",
  off: "unactivate"
});
xi({
  field: "pannable",
  on: "panify",
  off: "unpanify"
});
zn.inactive = function() {
  var t13 = this[0];
  if (t13)
    return !t13._private.active;
};
var nr = {};
var Vf = function(e) {
  return function(n) {
    for (var a = this, i = [], o = 0; o < a.length; o++) {
      var s = a[o];
      if (s.isNode()) {
        for (var l = false, u = s.connectedEdges(), c = 0; c < u.length; c++) {
          var d = u[c], v = d.source(), h6 = d.target();
          if (e.noIncomingEdges && h6 === s && v !== s || e.noOutgoingEdges && v === s && h6 !== s) {
            l = true;
            break;
          }
        }
        l || i.push(s);
      }
    }
    return this.spawn(i, true).filter(n);
  };
};
var Hf = function(e) {
  return function(r) {
    for (var n = this, a = [], i = 0; i < n.length; i++) {
      var o = n[i];
      if (o.isNode())
        for (var s = o.connectedEdges(), l = 0; l < s.length; l++) {
          var u = s[l], c = u.source(), d = u.target();
          e.outgoing && c === o ? (a.push(u), a.push(d)) : e.incoming && d === o && (a.push(u), a.push(c));
        }
    }
    return this.spawn(a, true).filter(r);
  };
};
var Kf = function(e) {
  return function(r) {
    for (var n = this, a = [], i = {}; ; ) {
      var o = e.outgoing ? n.outgoers() : n.incomers();
      if (o.length === 0)
        break;
      for (var s = false, l = 0; l < o.length; l++) {
        var u = o[l], c = u.id();
        i[c] || (i[c] = true, a.push(u), s = true);
      }
      if (!s)
        break;
      n = o;
    }
    return this.spawn(a, true).filter(r);
  };
};
nr.clearTraversalCache = function() {
  for (var t13 = 0; t13 < this.length; t13++)
    this[t13]._private.traversalCache = null;
};
ze(nr, {
  // get the root nodes in the DAG
  roots: Vf({
    noIncomingEdges: true
  }),
  // get the leaf nodes in the DAG
  leaves: Vf({
    noOutgoingEdges: true
  }),
  // normally called children in graph theory
  // these nodes =edges=> outgoing nodes
  outgoers: Sr(Hf({
    outgoing: true
  }), "outgoers"),
  // aka DAG descendants
  successors: Kf({
    outgoing: true
  }),
  // normally called parents in graph theory
  // these nodes <=edges= incoming nodes
  incomers: Sr(Hf({
    incoming: true
  }), "incomers"),
  // aka DAG ancestors
  predecessors: Kf({
    incoming: true
  })
});
ze(nr, {
  neighborhood: Sr(function(t13) {
    for (var e = [], r = this.nodes(), n = 0; n < r.length; n++)
      for (var a = r[n], i = a.connectedEdges(), o = 0; o < i.length; o++) {
        var s = i[o], l = s.source(), u = s.target(), c = a === l ? u : l;
        c.length > 0 && e.push(c[0]), e.push(s[0]);
      }
    return this.spawn(e, true).filter(t13);
  }, "neighborhood"),
  closedNeighborhood: function(e) {
    return this.neighborhood().add(this).filter(e);
  },
  openNeighborhood: function(e) {
    return this.neighborhood(e);
  }
});
nr.neighbourhood = nr.neighborhood;
nr.closedNeighbourhood = nr.closedNeighborhood;
nr.openNeighbourhood = nr.openNeighborhood;
ze(nr, {
  source: Sr(function(e) {
    var r = this[0], n;
    return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n;
  }, "source"),
  target: Sr(function(e) {
    var r = this[0], n;
    return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n;
  }, "target"),
  sources: qf({
    attr: "source"
  }),
  targets: qf({
    attr: "target"
  })
});
function qf(t13) {
  return function(r) {
    for (var n = [], a = 0; a < this.length; a++) {
      var i = this[a], o = i._private[t13.attr];
      o && n.push(o);
    }
    return this.spawn(n, true).filter(r);
  };
}
ze(nr, {
  edgesWith: Sr(Uf(), "edgesWith"),
  edgesTo: Sr(Uf({
    thisIsSrc: true
  }), "edgesTo")
});
function Uf(t13) {
  return function(r) {
    var n = [], a = this._private.cy, i = t13 || {};
    Ae(r) && (r = a.$(r));
    for (var o = 0; o < r.length; o++)
      for (var s = r[o]._private.edges, l = 0; l < s.length; l++) {
        var u = s[l], c = u._private.data, d = this.hasElementWithId(c.source) && r.hasElementWithId(c.target), v = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h6 = d || v;
        h6 && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !v) || n.push(u));
      }
    return this.spawn(n, true);
  };
}
ze(nr, {
  connectedEdges: Sr(function(t13) {
    for (var e = [], r = this, n = 0; n < r.length; n++) {
      var a = r[n];
      if (a.isNode())
        for (var i = a._private.edges, o = 0; o < i.length; o++) {
          var s = i[o];
          e.push(s);
        }
    }
    return this.spawn(e, true).filter(t13);
  }, "connectedEdges"),
  connectedNodes: Sr(function(t13) {
    for (var e = [], r = this, n = 0; n < r.length; n++) {
      var a = r[n];
      a.isEdge() && (e.push(a.source()[0]), e.push(a.target()[0]));
    }
    return this.spawn(e, true).filter(t13);
  }, "connectedNodes"),
  parallelEdges: Sr(Gf(), "parallelEdges"),
  codirectedEdges: Sr(Gf({
    codirected: true
  }), "codirectedEdges")
});
function Gf(t13) {
  var e = {
    codirected: false
  };
  return t13 = ze({}, e, t13), function(n) {
    for (var a = [], i = this.edges(), o = t13, s = 0; s < i.length; s++)
      for (var l = i[s], u = l._private, c = u.source, d = c._private.data.id, v = u.data.target, h6 = c._private.edges, f = 0; f < h6.length; f++) {
        var p = h6[f], m = p._private.data, g = m.target, y = m.source, b = g === v && y === d, w = d === g && v === y;
        (o.codirected && b || !o.codirected && (b || w)) && a.push(p);
      }
    return this.spawn(a, true).filter(n);
  };
}
ze(nr, {
  components: function(e) {
    var r = this, n = r.cy(), a = n.collection(), i = e == null ? r.nodes() : e.nodes(), o = [];
    e != null && i.empty() && (i = e.sources());
    var s = function(c, d) {
      a.merge(c), i.unmerge(c), d.merge(c);
    };
    if (i.empty())
      return r.spawn();
    var l = function() {
      var c = n.collection();
      o.push(c);
      var d = i[0];
      s(d, c), r.bfs({
        directed: false,
        roots: d,
        visit: function(h6) {
          return s(h6, c);
        }
      }), c.forEach(function(v) {
        v.connectedEdges().forEach(function(h6) {
          r.has(h6) && c.has(h6.source()) && c.has(h6.target()) && c.merge(h6);
        });
      });
    };
    do
      l();
    while (i.length > 0);
    return o;
  },
  component: function() {
    var e = this[0];
    return e.cy().mutableElements().components(e)[0];
  }
});
nr.componentsOf = nr.components;
var Wt = function(e, r) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
  if (e === void 0) {
    yt("A collection must have a reference to the core");
    return;
  }
  var i = new Zr(), o = false;
  if (!r)
    r = [];
  else if (r.length > 0 && Xe(r[0]) && !Do(r[0])) {
    o = true;
    for (var s = [], l = new gi(), u = 0, c = r.length; u < c; u++) {
      var d = r[u];
      d.data == null && (d.data = {});
      var v = d.data;
      if (v.id == null)
        v.id = dp();
      else if (e.hasElementWithId(v.id) || l.has(v.id))
        continue;
      var h6 = new al(e, d, false);
      s.push(h6), l.add(v.id);
    }
    r = s;
  }
  this.length = 0;
  for (var f = 0, p = r.length; f < p; f++) {
    var m = r[f][0];
    if (m != null) {
      var g = m._private.data.id;
      (!n || !i.has(g)) && (n && i.set(g, {
        index: this.length,
        ele: m
      }), this[this.length] = m, this.length++);
    }
  }
  this._private = {
    eles: this,
    cy: e,
    get map() {
      return this.lazyMap == null && this.rebuildMap(), this.lazyMap;
    },
    set map(y) {
      this.lazyMap = y;
    },
    rebuildMap: function() {
      for (var b = this.lazyMap = new Zr(), w = this.eles, C = 0; C < w.length; C++) {
        var E = w[C];
        b.set(E.id(), {
          index: C,
          ele: E
        });
      }
    }
  }, n && (this._private.map = i), o && !a && this.restore();
};
var dt = al.prototype = Wt.prototype = Object.create(Array.prototype);
dt.instanceString = function() {
  return "collection";
};
dt.spawn = function(t13, e) {
  return new Wt(this.cy(), t13, e);
};
dt.spawnSelf = function() {
  return this.spawn(this);
};
dt.cy = function() {
  return this._private.cy;
};
dt.renderer = function() {
  return this._private.cy.renderer();
};
dt.element = function() {
  return this[0];
};
dt.collection = function() {
  return Xh(this) ? this : new Wt(this._private.cy, [this]);
};
dt.unique = function() {
  return new Wt(this._private.cy, this, true);
};
dt.hasElementWithId = function(t13) {
  return t13 = "" + t13, this._private.map.has(t13);
};
dt.getElementById = function(t13) {
  t13 = "" + t13;
  var e = this._private.cy, r = this._private.map.get(t13);
  return r ? r.ele : new Wt(e);
};
dt.$id = dt.getElementById;
dt.poolIndex = function() {
  var t13 = this._private.cy, e = t13._private.elements, r = this[0]._private.data.id;
  return e._private.map.get(r).index;
};
dt.indexOf = function(t13) {
  var e = t13[0]._private.data.id;
  return this._private.map.get(e).index;
};
dt.indexOfId = function(t13) {
  return t13 = "" + t13, this._private.map.get(t13).index;
};
dt.json = function(t13) {
  var e = this.element(), r = this.cy();
  if (e == null && t13)
    return this;
  if (e != null) {
    var n = e._private;
    if (Xe(t13)) {
      if (r.startBatch(), t13.data) {
        e.data(t13.data);
        var a = n.data;
        if (e.isEdge()) {
          var i = false, o = {}, s = t13.data.source, l = t13.data.target;
          s != null && s != a.source && (o.source = "" + s, i = true), l != null && l != a.target && (o.target = "" + l, i = true), i && (e = e.move(o));
        } else {
          var u = "parent" in t13.data, c = t13.data.parent;
          u && (c != null || a.parent != null) && c != a.parent && (c === void 0 && (c = null), c != null && (c = "" + c), e = e.move({
            parent: c
          }));
        }
      }
      t13.position && e.position(t13.position);
      var d = function(p, m, g) {
        var y = t13[p];
        y != null && y !== n[p] && (y ? e[m]() : e[g]());
      };
      return d("removed", "remove", "restore"), d("selected", "select", "unselect"), d("selectable", "selectify", "unselectify"), d("locked", "lock", "unlock"), d("grabbable", "grabify", "ungrabify"), d("pannable", "panify", "unpanify"), t13.classes != null && e.classes(t13.classes), r.endBatch(), this;
    } else if (t13 === void 0) {
      var v = {
        data: jr(n.data),
        position: jr(n.position),
        group: n.group,
        removed: n.removed,
        selected: n.selected,
        selectable: n.selectable,
        locked: n.locked,
        grabbable: n.grabbable,
        pannable: n.pannable,
        classes: null
      };
      v.classes = "";
      var h6 = 0;
      return n.classes.forEach(function(f) {
        return v.classes += h6++ === 0 ? f : " " + f;
      }), v;
    }
  }
};
dt.jsons = function() {
  for (var t13 = [], e = 0; e < this.length; e++) {
    var r = this[e], n = r.json();
    t13.push(n);
  }
  return t13;
};
dt.clone = function() {
  for (var t13 = this.cy(), e = [], r = 0; r < this.length; r++) {
    var n = this[r], a = n.json(), i = new al(t13, a, false);
    e.push(i);
  }
  return new Wt(t13, e);
};
dt.copy = dt.clone;
dt.restore = function() {
  for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = r.cy(), a = n._private, i = [], o = [], s, l = 0, u = r.length; l < u; l++) {
    var c = r[l];
    e && !c.removed() || (c.isNode() ? i.push(c) : o.push(c));
  }
  s = i.concat(o);
  var d, v = function() {
    s.splice(d, 1), d--;
  };
  for (d = 0; d < s.length; d++) {
    var h6 = s[d], f = h6._private, p = f.data;
    if (h6.clearTraversalCache(), !(!e && !f.removed)) {
      if (p.id === void 0)
        p.id = dp();
      else if (be(p.id))
        p.id = "" + p.id;
      else if (Kn(p.id) || !Ae(p.id)) {
        yt("Can not create element with invalid string ID `" + p.id + "`"), v();
        continue;
      } else if (n.hasElementWithId(p.id)) {
        yt("Can not create second element with ID `" + p.id + "`"), v();
        continue;
      }
    }
    var m = p.id;
    if (h6.isNode()) {
      var g = f.position;
      g.x == null && (g.x = 0), g.y == null && (g.y = 0);
    }
    if (h6.isEdge()) {
      for (var y = h6, b = ["source", "target"], w = b.length, C = false, E = 0; E < w; E++) {
        var x = b[E], T = p[x];
        be(T) && (T = p[x] = "" + p[x]), T == null || T === "" ? (yt("Can not create edge `" + m + "` with unspecified " + x), C = true) : n.hasElementWithId(T) || (yt("Can not create edge `" + m + "` with nonexistant " + x + " `" + T + "`"), C = true);
      }
      if (C) {
        v();
        continue;
      }
      var k = n.getElementById(p.source), _ = n.getElementById(p.target);
      k.same(_) ? k._private.edges.push(y) : (k._private.edges.push(y), _._private.edges.push(y)), y._private.source = k, y._private.target = _;
    }
    f.map = new Zr(), f.map.set(m, {
      ele: h6,
      index: 0
    }), f.removed = false, e && n.addToPool(h6);
  }
  for (var D = 0; D < i.length; D++) {
    var O = i[D], A = O._private.data;
    be(A.parent) && (A.parent = "" + A.parent);
    var L = A.parent, N = L != null;
    if (N || O._private.parent) {
      var I = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(L);
      if (I.empty())
        A.parent = void 0;
      else if (I[0].removed())
        tt("Node added with missing parent, reference to parent removed"), A.parent = void 0, O._private.parent = null;
      else {
        for (var M = false, F = I; !F.empty(); ) {
          if (O.same(F)) {
            M = true, A.parent = void 0;
            break;
          }
          F = F.parent();
        }
        M || (I[0]._private.children.push(O), O._private.parent = I[0], a.hasCompoundNodes = true);
      }
    }
  }
  if (s.length > 0) {
    for (var $ = s.length === r.length ? r : new Wt(n, s), U = 0; U < $.length; U++) {
      var H = $[U];
      H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache());
    }
    var K;
    a.hasCompoundNodes ? K = n.collection().merge($).merge($.connectedNodes()).merge($.parent()) : K = $, K.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t13), t13 ? $.emitAndNotify("add") : e && $.emit("add");
  }
  return r;
};
dt.removed = function() {
  var t13 = this[0];
  return t13 && t13._private.removed;
};
dt.inside = function() {
  var t13 = this[0];
  return t13 && !t13._private.removed;
};
dt.remove = function() {
  var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = [], a = {}, i = r._private.cy;
  function o(L) {
    for (var N = L._private.edges, I = 0; I < N.length; I++)
      l(N[I]);
  }
  function s(L) {
    for (var N = L._private.children, I = 0; I < N.length; I++)
      l(N[I]);
  }
  function l(L) {
    var N = a[L.id()];
    e && L.removed() || N || (a[L.id()] = true, L.isNode() ? (n.push(L), o(L), s(L)) : n.unshift(L));
  }
  for (var u = 0, c = r.length; u < c; u++) {
    var d = r[u];
    l(d);
  }
  function v(L, N) {
    var I = L._private.edges;
    qn(I, N), L.clearTraversalCache();
  }
  function h6(L) {
    L.clearTraversalCache();
  }
  var f = [];
  f.ids = {};
  function p(L, N) {
    N = N[0], L = L[0];
    var I = L._private.children, M = L.id();
    qn(I, N), N._private.parent = null, f.ids[M] || (f.ids[M] = true, f.push(L));
  }
  r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n);
  for (var m = 0; m < n.length; m++) {
    var g = n[m];
    if (g.isEdge()) {
      var y = g.source()[0], b = g.target()[0];
      v(y, g), v(b, g);
      for (var w = g.parallelEdges(), C = 0; C < w.length; C++) {
        var E = w[C];
        h6(E), E.isBundledBezier() && E.dirtyBoundingBoxCache();
      }
    } else {
      var x = g.parent();
      x.length !== 0 && p(x, g);
    }
    e && (g._private.removed = true);
  }
  var T = i._private.elements;
  i._private.hasCompoundNodes = false;
  for (var k = 0; k < T.length; k++) {
    var _ = T[k];
    if (_.isParent()) {
      i._private.hasCompoundNodes = true;
      break;
    }
  }
  var D = new Wt(this.cy(), n);
  D.size() > 0 && (t13 ? D.emitAndNotify("remove") : e && D.emit("remove"));
  for (var O = 0; O < f.length; O++) {
    var A = f[O];
    (!e || !A.removed()) && A.updateStyle();
  }
  return D;
};
dt.move = function(t13) {
  var e = this._private.cy, r = this, n = false, a = false, i = function(f) {
    return f == null ? f : "" + f;
  };
  if (t13.source !== void 0 || t13.target !== void 0) {
    var o = i(t13.source), s = i(t13.target), l = o != null && e.hasElementWithId(o), u = s != null && e.hasElementWithId(s);
    (l || u) && (e.batch(function() {
      r.remove(n, a), r.emitAndNotify("moveout");
      for (var h6 = 0; h6 < r.length; h6++) {
        var f = r[h6], p = f._private.data;
        f.isEdge() && (l && (p.source = o), u && (p.target = s));
      }
      r.restore(n, a);
    }), r.emitAndNotify("move"));
  } else if (t13.parent !== void 0) {
    var c = i(t13.parent), d = c === null || e.hasElementWithId(c);
    if (d) {
      var v = c === null ? void 0 : c;
      e.batch(function() {
        var h6 = r.remove(n, a);
        h6.emitAndNotify("moveout");
        for (var f = 0; f < r.length; f++) {
          var p = r[f], m = p._private.data;
          p.isNode() && (m.parent = v);
        }
        h6.restore(n, a);
      }), r.emitAndNotify("move");
    }
  }
  return this;
};
[kp, yD, ds, $n, ui, FD, cl, ZD, jp, Zp, tP, Ms, fs, Gt, zn, nr].forEach(function(t13) {
  ze(dt, t13);
});
var lP = {
  add: function(e) {
    var r, n = this;
    if (yr(e)) {
      var a = e;
      if (a._private.cy === n)
        r = a.restore();
      else {
        for (var i = [], o = 0; o < a.length; o++) {
          var s = a[o];
          i.push(s.json());
        }
        r = new Wt(n, i);
      }
    } else if (st(e)) {
      var l = e;
      r = new Wt(n, l);
    } else if (Xe(e) && (st(e.nodes) || st(e.edges))) {
      for (var u = e, c = [], d = ["nodes", "edges"], v = 0, h6 = d.length; v < h6; v++) {
        var f = d[v], p = u[f];
        if (st(p))
          for (var m = 0, g = p.length; m < g; m++) {
            var y = ze({
              group: f
            }, p[m]);
            c.push(y);
          }
      }
      r = new Wt(n, c);
    } else {
      var b = e;
      r = new al(n, b).collection();
    }
    return r;
  },
  remove: function(e) {
    if (!yr(e)) {
      if (Ae(e)) {
        var r = e;
        e = this.$(r);
      }
    }
    return e.remove();
  }
};
function uP(t13, e, r, n) {
  var a = 4, i = 1e-3, o = 1e-7, s = 10, l = 11, u = 1 / (l - 1), c = typeof Float32Array < "u";
  if (arguments.length !== 4)
    return false;
  for (var d = 0; d < 4; ++d)
    if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d]))
      return false;
  t13 = Math.min(t13, 1), r = Math.min(r, 1), t13 = Math.max(t13, 0), r = Math.max(r, 0);
  var v = c ? new Float32Array(l) : new Array(l);
  function h6(_, D) {
    return 1 - 3 * D + 3 * _;
  }
  function f(_, D) {
    return 3 * D - 6 * _;
  }
  function p(_) {
    return 3 * _;
  }
  function m(_, D, O) {
    return ((h6(D, O) * _ + f(D, O)) * _ + p(D)) * _;
  }
  function g(_, D, O) {
    return 3 * h6(D, O) * _ * _ + 2 * f(D, O) * _ + p(D);
  }
  function y(_, D) {
    for (var O = 0; O < a; ++O) {
      var A = g(D, t13, r);
      if (A === 0)
        return D;
      var L = m(D, t13, r) - _;
      D -= L / A;
    }
    return D;
  }
  function b() {
    for (var _ = 0; _ < l; ++_)
      v[_] = m(_ * u, t13, r);
  }
  function w(_, D, O) {
    var A, L, N = 0;
    do
      L = D + (O - D) / 2, A = m(L, t13, r) - _, A > 0 ? O = L : D = L;
    while (Math.abs(A) > o && ++N < s);
    return L;
  }
  function C(_) {
    for (var D = 0, O = 1, A = l - 1; O !== A && v[O] <= _; ++O)
      D += u;
    --O;
    var L = (_ - v[O]) / (v[O + 1] - v[O]), N = D + L * u, I = g(N, t13, r);
    return I >= i ? y(_, N) : I === 0 ? N : w(_, D, D + u);
  }
  var E = false;
  function x() {
    E = true, (t13 !== e || r !== n) && b();
  }
  var T = function(D) {
    return E || x(), t13 === e && r === n ? D : D === 0 ? 0 : D === 1 ? 1 : m(C(D), e, n);
  };
  T.getControlPoints = function() {
    return [{
      x: t13,
      y: e
    }, {
      x: r,
      y: n
    }];
  };
  var k = "generateBezier(" + [t13, e, r, n] + ")";
  return T.toString = function() {
    return k;
  }, T;
}
var cP = /* @__PURE__ */ function() {
  function t13(n) {
    return -n.tension * n.x - n.friction * n.v;
  }
  function e(n, a, i) {
    var o = {
      x: n.x + i.dx * a,
      v: n.v + i.dv * a,
      tension: n.tension,
      friction: n.friction
    };
    return {
      dx: o.v,
      dv: t13(o)
    };
  }
  function r(n, a) {
    var i = {
      dx: n.v,
      dv: t13(n)
    }, o = e(n, a * 0.5, i), s = e(n, a * 0.5, o), l = e(n, a, s), u = 1 / 6 * (i.dx + 2 * (o.dx + s.dx) + l.dx), c = 1 / 6 * (i.dv + 2 * (o.dv + s.dv) + l.dv);
    return n.x = n.x + u * a, n.v = n.v + c * a, n;
  }
  return function n(a, i, o) {
    var s = {
      x: -1,
      v: 0,
      tension: null,
      friction: null
    }, l = [0], u = 0, c = 1 / 1e4, d = 16 / 1e3, v, h6, f;
    for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, v = o !== null, v ? (u = n(a, i), h6 = u / o * d) : h6 = d; f = r(f || s, h6), l.push(1 + f.x), u += 16, Math.abs(f.x) > c && Math.abs(f.v) > c; )
      ;
    return v ? function(p) {
      return l[p * (l.length - 1) | 0];
    } : u;
  };
}();
var ct = function(e, r, n, a) {
  var i = uP(e, r, n, a);
  return function(o, s, l) {
    return o + (s - o) * i(l);
  };
};
var vs = {
  linear: function(e, r, n) {
    return e + (r - e) * n;
  },
  // default easings
  ease: ct(0.25, 0.1, 0.25, 1),
  "ease-in": ct(0.42, 0, 1, 1),
  "ease-out": ct(0, 0, 0.58, 1),
  "ease-in-out": ct(0.42, 0, 0.58, 1),
  // sine
  "ease-in-sine": ct(0.47, 0, 0.745, 0.715),
  "ease-out-sine": ct(0.39, 0.575, 0.565, 1),
  "ease-in-out-sine": ct(0.445, 0.05, 0.55, 0.95),
  // quad
  "ease-in-quad": ct(0.55, 0.085, 0.68, 0.53),
  "ease-out-quad": ct(0.25, 0.46, 0.45, 0.94),
  "ease-in-out-quad": ct(0.455, 0.03, 0.515, 0.955),
  // cubic
  "ease-in-cubic": ct(0.55, 0.055, 0.675, 0.19),
  "ease-out-cubic": ct(0.215, 0.61, 0.355, 1),
  "ease-in-out-cubic": ct(0.645, 0.045, 0.355, 1),
  // quart
  "ease-in-quart": ct(0.895, 0.03, 0.685, 0.22),
  "ease-out-quart": ct(0.165, 0.84, 0.44, 1),
  "ease-in-out-quart": ct(0.77, 0, 0.175, 1),
  // quint
  "ease-in-quint": ct(0.755, 0.05, 0.855, 0.06),
  "ease-out-quint": ct(0.23, 1, 0.32, 1),
  "ease-in-out-quint": ct(0.86, 0, 0.07, 1),
  // expo
  "ease-in-expo": ct(0.95, 0.05, 0.795, 0.035),
  "ease-out-expo": ct(0.19, 1, 0.22, 1),
  "ease-in-out-expo": ct(1, 0, 0, 1),
  // circ
  "ease-in-circ": ct(0.6, 0.04, 0.98, 0.335),
  "ease-out-circ": ct(0.075, 0.82, 0.165, 1),
  "ease-in-out-circ": ct(0.785, 0.135, 0.15, 0.86),
  // user param easings...
  spring: function(e, r, n) {
    if (n === 0)
      return vs.linear;
    var a = cP(e, r, n);
    return function(i, o, s) {
      return i + (o - i) * a(s);
    };
  },
  "cubic-bezier": ct
};
function Wf(t13, e, r, n, a) {
  if (n === 1 || e === r)
    return r;
  var i = a(e, r, n);
  return t13 == null || ((t13.roundValue || t13.color) && (i = Math.round(i)), t13.min !== void 0 && (i = Math.max(i, t13.min)), t13.max !== void 0 && (i = Math.min(i, t13.max))), i;
}
function Yf(t13, e) {
  return t13.pfValue != null || t13.value != null ? t13.pfValue != null && (e == null || e.type.units !== "%") ? t13.pfValue : t13.value : t13;
}
function Ba(t13, e, r, n, a) {
  var i = a != null ? a.type : null;
  r < 0 ? r = 0 : r > 1 && (r = 1);
  var o = Yf(t13, a), s = Yf(e, a);
  if (be(o) && be(s))
    return Wf(i, o, s, r, n);
  if (st(o) && st(s)) {
    for (var l = [], u = 0; u < s.length; u++) {
      var c = o[u], d = s[u];
      if (c != null && d != null) {
        var v = Wf(i, c, d, r, n);
        l.push(v);
      } else
        l.push(d);
    }
    return l;
  }
}
function dP(t13, e, r, n) {
  var a = !n, i = t13._private, o = e._private, s = o.easing, l = o.startTime, u = n ? t13 : t13.cy(), c = u.style();
  if (!o.easingImpl)
    if (s == null)
      o.easingImpl = vs.linear;
    else {
      var d;
      if (Ae(s)) {
        var v = c.parse("transition-timing-function", s);
        d = v.value;
      } else
        d = s;
      var h6, f;
      Ae(d) ? (h6 = d, f = []) : (h6 = d[1], f = d.slice(2).map(function($) {
        return +$;
      })), f.length > 0 ? (h6 === "spring" && f.push(o.duration), o.easingImpl = vs[h6].apply(null, f)) : o.easingImpl = vs[h6];
    }
  var p = o.easingImpl, m;
  if (o.duration === 0 ? m = 1 : m = (r - l) / o.duration, o.applying && (m = o.progress), m < 0 ? m = 0 : m > 1 && (m = 1), o.delay == null) {
    var g = o.startPosition, y = o.position;
    if (y && a && !t13.locked()) {
      var b = {};
      Bi(g.x, y.x) && (b.x = Ba(g.x, y.x, m, p)), Bi(g.y, y.y) && (b.y = Ba(g.y, y.y, m, p)), t13.position(b);
    }
    var w = o.startPan, C = o.pan, E = i.pan, x = C != null && n;
    x && (Bi(w.x, C.x) && (E.x = Ba(w.x, C.x, m, p)), Bi(w.y, C.y) && (E.y = Ba(w.y, C.y, m, p)), t13.emit("pan"));
    var T = o.startZoom, k = o.zoom, _ = k != null && n;
    _ && (Bi(T, k) && (i.zoom = so(i.minZoom, Ba(T, k, m, p), i.maxZoom)), t13.emit("zoom")), (x || _) && t13.emit("viewport");
    var D = o.style;
    if (D && D.length > 0 && a) {
      for (var O = 0; O < D.length; O++) {
        var A = D[O], L = A.name, N = A, I = o.startStyle[L], M = c.properties[I.name], F = Ba(I, N, m, p, M);
        c.overrideBypass(t13, L, F);
      }
      t13.emit("style");
    }
  }
  return o.progress = m, m;
}
function Bi(t13, e) {
  return t13 == null || e == null ? false : be(t13) && be(e) ? true : !!(t13 && e);
}
function fP(t13, e, r, n) {
  var a = e._private;
  a.started = true, a.startTime = r - a.progress * a.duration;
}
function jf(t13, e) {
  var r = e._private.aniEles, n = [];
  function a(c, d) {
    var v = c._private, h6 = v.animation.current, f = v.animation.queue, p = false;
    if (h6.length === 0) {
      var m = f.shift();
      m && h6.push(m);
    }
    for (var g = function(E) {
      for (var x = E.length - 1; x >= 0; x--) {
        var T = E[x];
        T();
      }
      E.splice(0, E.length);
    }, y = h6.length - 1; y >= 0; y--) {
      var b = h6[y], w = b._private;
      if (w.stopped) {
        h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.frames);
        continue;
      }
      !w.playing && !w.applying || (w.playing && w.applying && (w.applying = false), w.started || fP(c, b, t13), dP(c, b, t13, d), w.applying && (w.applying = false), g(w.frames), w.step != null && w.step(t13), b.completed() && (h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.completes)), p = true);
    }
    return !d && h6.length === 0 && f.length === 0 && n.push(c), p;
  }
  for (var i = false, o = 0; o < r.length; o++) {
    var s = r[o], l = a(s);
    i = i || l;
  }
  var u = a(e, true);
  (i || u) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step");
}
var vP = {
  // pull in animation functions
  animate: et.animate(),
  animation: et.animation(),
  animated: et.animated(),
  clearQueue: et.clearQueue(),
  delay: et.delay(),
  delayAnimation: et.delayAnimation(),
  stop: et.stop(),
  addToAnimationPool: function(e) {
    var r = this;
    r.styleEnabled() && r._private.aniEles.merge(e);
  },
  stopAnimationLoop: function() {
    this._private.animationsRunning = false;
  },
  startAnimationLoop: function() {
    var e = this;
    if (e._private.animationsRunning = true, !e.styleEnabled())
      return;
    function r() {
      e._private.animationsRunning && Os(function(i) {
        jf(i, e), r();
      });
    }
    var n = e.renderer();
    n && n.beforeRender ? n.beforeRender(function(i, o) {
      jf(o, e);
    }, n.beforeRenderPriorities.animations) : r();
  }
};
var hP = {
  qualifierCompare: function(e, r) {
    return e == null || r == null ? e == null && r == null : e.sameText(r);
  },
  eventMatches: function(e, r, n) {
    var a = r.qualifier;
    return a != null ? e !== n.target && Do(n.target) && a.matches(n.target) : true;
  },
  addEventFields: function(e, r) {
    r.cy = e, r.target = e;
  },
  callbackContext: function(e, r, n) {
    return r.qualifier != null ? n.target : e;
  }
};
var ts = function(e) {
  return Ae(e) ? new Un(e) : e;
};
var Jp = {
  createEmitter: function() {
    var e = this._private;
    return e.emitter || (e.emitter = new dl(hP, this)), this;
  },
  emitter: function() {
    return this._private.emitter;
  },
  on: function(e, r, n) {
    return this.emitter().on(e, ts(r), n), this;
  },
  removeListener: function(e, r, n) {
    return this.emitter().removeListener(e, ts(r), n), this;
  },
  removeAllListeners: function() {
    return this.emitter().removeAllListeners(), this;
  },
  one: function(e, r, n) {
    return this.emitter().one(e, ts(r), n), this;
  },
  once: function(e, r, n) {
    return this.emitter().one(e, ts(r), n), this;
  },
  emit: function(e, r) {
    return this.emitter().emit(e, r), this;
  },
  emitAndNotify: function(e, r) {
    return this.emit(e), this.notify(e, r), this;
  }
};
et.eventAliasesOn(Jp);
var gu = {
  png: function(e) {
    var r = this._private.renderer;
    return e = e || {}, r.png(e);
  },
  jpg: function(e) {
    var r = this._private.renderer;
    return e = e || {}, e.bg = e.bg || "#fff", r.jpg(e);
  }
};
gu.jpeg = gu.jpg;
var hs = {
  layout: function(e) {
    var r = this;
    if (e == null) {
      yt("Layout options must be specified to make a layout");
      return;
    }
    if (e.name == null) {
      yt("A `name` must be specified to make a layout");
      return;
    }
    var n = e.name, a = r.extension("layout", n);
    if (a == null) {
      yt("No such layout `" + n + "` found.  Did you forget to import it and `cytoscape.use()` it?");
      return;
    }
    var i;
    Ae(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$();
    var o = new a(ze({}, e, {
      cy: r,
      eles: i
    }));
    return o;
  }
};
hs.createLayout = hs.makeLayout = hs.layout;
var pP = {
  notify: function(e, r) {
    var n = this._private;
    if (this.batching()) {
      n.batchNotifications = n.batchNotifications || {};
      var a = n.batchNotifications[e] = n.batchNotifications[e] || this.collection();
      r != null && a.merge(r);
      return;
    }
    if (n.notificationsEnabled) {
      var i = this.renderer();
      this.destroyed() || !i || i.notify(e, r);
    }
  },
  notifications: function(e) {
    var r = this._private;
    return e === void 0 ? r.notificationsEnabled : (r.notificationsEnabled = !!e, this);
  },
  noNotifications: function(e) {
    this.notifications(false), e(), this.notifications(true);
  },
  batching: function() {
    return this._private.batchCount > 0;
  },
  startBatch: function() {
    var e = this._private;
    return e.batchCount == null && (e.batchCount = 0), e.batchCount === 0 && (e.batchStyleEles = this.collection(), e.batchNotifications = {}), e.batchCount++, this;
  },
  endBatch: function() {
    var e = this._private;
    if (e.batchCount === 0)
      return this;
    if (e.batchCount--, e.batchCount === 0) {
      e.batchStyleEles.updateStyle();
      var r = this.renderer();
      Object.keys(e.batchNotifications).forEach(function(n) {
        var a = e.batchNotifications[n];
        a.empty() ? r.notify(n) : r.notify(n, a);
      });
    }
    return this;
  },
  batch: function(e) {
    return this.startBatch(), e(), this.endBatch(), this;
  },
  // for backwards compatibility
  batchData: function(e) {
    var r = this;
    return this.batch(function() {
      for (var n = Object.keys(e), a = 0; a < n.length; a++) {
        var i = n[a], o = e[i], s = r.getElementById(i);
        s.data(o);
      }
    });
  }
};
var gP = Yt({
  hideEdgesOnViewport: false,
  textureOnViewport: false,
  motionBlur: false,
  motionBlurOpacity: 0.05,
  pixelRatio: void 0,
  desktopTapThreshold: 4,
  touchTapThreshold: 8,
  wheelSensitivity: 1,
  debug: false,
  showFps: false
});
var mu = {
  renderTo: function(e, r, n, a) {
    var i = this._private.renderer;
    return i.renderTo(e, r, n, a), this;
  },
  renderer: function() {
    return this._private.renderer;
  },
  forceRender: function() {
    return this.notify("draw"), this;
  },
  resize: function() {
    return this.invalidateSize(), this.emitAndNotify("resize"), this;
  },
  initRenderer: function(e) {
    var r = this, n = r.extension("renderer", e.name);
    if (n == null) {
      yt("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?"));
      return;
    }
    e.wheelSensitivity !== void 0 && tt("You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");
    var a = gP(e);
    a.cy = r, r._private.renderer = new n(a), this.notify("init");
  },
  destroyRenderer: function() {
    var e = this;
    e.notify("destroy");
    var r = e.container();
    if (r)
      for (r._cyreg = null; r.childNodes.length > 0; )
        r.removeChild(r.childNodes[0]);
    e._private.renderer = null, e.mutableElements().forEach(function(n) {
      var a = n._private;
      a.rscratch = {}, a.rstyle = {}, a.animation.current = [], a.animation.queue = [];
    });
  },
  onRender: function(e) {
    return this.on("render", e);
  },
  offRender: function(e) {
    return this.off("render", e);
  }
};
mu.invalidateDimensions = mu.resize;
var ps = {
  // get a collection
  // - empty collection on no args
  // - collection of elements in the graph on selector arg
  // - guarantee a returned collection when elements or collection specified
  collection: function(e, r) {
    return Ae(e) ? this.$(e) : yr(e) ? e.collection() : st(e) ? (r || (r = {}), new Wt(this, e, r.unique, r.removed)) : new Wt(this);
  },
  nodes: function(e) {
    var r = this.$(function(n) {
      return n.isNode();
    });
    return e ? r.filter(e) : r;
  },
  edges: function(e) {
    var r = this.$(function(n) {
      return n.isEdge();
    });
    return e ? r.filter(e) : r;
  },
  // search the graph like jQuery
  $: function(e) {
    var r = this._private.elements;
    return e ? r.filter(e) : r.spawnSelf();
  },
  mutableElements: function() {
    return this._private.elements;
  }
};
ps.elements = ps.filter = ps.$;
var ir = {};
var Wi = "t";
var mP = "f";
ir.apply = function(t13) {
  for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t13.length; i++) {
    var o = t13[i], s = e.getContextMeta(o);
    if (!s.empty) {
      var l = e.getContextStyle(s), u = e.applyContextStyle(s, l, o);
      o._private.appliedInitStyle ? e.updateTransitions(o, u.diffProps) : o._private.appliedInitStyle = true;
      var c = e.updateStyleHints(o);
      c && a.push(o);
    }
  }
  return a;
};
ir.getPropertiesDiff = function(t13, e) {
  var r = this, n = r._private.propDiffs = r._private.propDiffs || {}, a = t13 + "-" + e, i = n[a];
  if (i)
    return i;
  for (var o = [], s = {}, l = 0; l < r.length; l++) {
    var u = r[l], c = t13[l] === Wi, d = e[l] === Wi, v = c !== d, h6 = u.mappedProperties.length > 0;
    if (v || d && h6) {
      var f = void 0;
      v && h6 || v ? f = u.properties : h6 && (f = u.mappedProperties);
      for (var p = 0; p < f.length; p++) {
        for (var m = f[p], g = m.name, y = false, b = l + 1; b < r.length; b++) {
          var w = r[b], C = e[b] === Wi;
          if (C && (y = w.properties[m.name] != null, y))
            break;
        }
        !s[g] && !y && (s[g] = true, o.push(g));
      }
    }
  }
  return n[a] = o, o;
};
ir.getContextMeta = function(t13) {
  for (var e = this, r = "", n, a = t13._private.styleCxtKey || "", i = 0; i < e.length; i++) {
    var o = e[i], s = o.selector && o.selector.matches(t13);
    s ? r += Wi : r += mP;
  }
  return n = e.getPropertiesDiff(a, r), t13._private.styleCxtKey = r, {
    key: r,
    diffPropNames: n,
    empty: n.length === 0
  };
};
ir.getContextStyle = function(t13) {
  var e = t13.key, r = this, n = this._private.contextStyles = this._private.contextStyles || {};
  if (n[e])
    return n[e];
  for (var a = {
    _private: {
      key: e
    }
  }, i = 0; i < r.length; i++) {
    var o = r[i], s = e[i] === Wi;
    if (s)
      for (var l = 0; l < o.properties.length; l++) {
        var u = o.properties[l];
        a[u.name] = u;
      }
  }
  return n[e] = a, a;
};
ir.applyContextStyle = function(t13, e, r) {
  for (var n = this, a = t13.diffPropNames, i = {}, o = n.types, s = 0; s < a.length; s++) {
    var l = a[s], u = e[l], c = r.pstyle(l);
    if (!u)
      if (c)
        c.bypass ? u = {
          name: l,
          deleteBypassed: true
        } : u = {
          name: l,
          delete: true
        };
      else continue;
    if (c !== u) {
      if (u.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === u.value) {
        var d = c.mapping, v = d.fnValue = u.value(r);
        if (v === d.prevFnValue)
          continue;
      }
      var h6 = i[l] = {
        prev: c
      };
      n.applyParsedProperty(r, u), h6.next = r.pstyle(l), h6.next && h6.next.bypass && (h6.next = h6.next.bypassed);
    }
  }
  return {
    diffProps: i
  };
};
ir.updateStyleHints = function(t13) {
  var e = t13._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(J, ge, Ee) {
    return r.getPropertiesHash(J, ge, Ee);
  }, o = e.styleKey;
  if (t13.removed())
    return false;
  var s = e.group === "nodes", l = t13._private.style;
  n = Object.keys(l);
  for (var u = 0; u < a.length; u++) {
    var c = a[u];
    e.styleKeys[c] = [Ha, $i];
  }
  for (var d = function(J, ge) {
    return e.styleKeys[ge][0] = ao(J, e.styleKeys[ge][0]);
  }, v = function(J, ge) {
    return e.styleKeys[ge][1] = io(J, e.styleKeys[ge][1]);
  }, h6 = function(J, ge) {
    d(J, ge), v(J, ge);
  }, f = function(J, ge) {
    for (var Ee = 0; Ee < J.length; Ee++) {
      var ve = J.charCodeAt(Ee);
      d(ve, ge), v(ve, ge);
    }
  }, p = 2e9, m = function(J) {
    return -128 < J && J < 128 && Math.floor(J) !== J ? p - (J * 1024 | 0) : J;
  }, g = 0; g < n.length; g++) {
    var y = n[g], b = l[y];
    if (b != null) {
      var w = this.properties[y], C = w.type, E = w.groupKey, x = void 0;
      w.hashOverride != null ? x = w.hashOverride(t13, b) : b.pfValue != null && (x = b.pfValue);
      var T = w.enums == null ? b.value : null, k = x != null, _ = T != null, D = k || _, O = b.units;
      if (C.number && D && !C.multiple) {
        var A = k ? x : T;
        h6(m(A), E), !k && O != null && f(O, E);
      } else
        f(b.strValue, E);
    }
  }
  for (var L = [Ha, $i], N = 0; N < a.length; N++) {
    var I = a[N], M = e.styleKeys[I];
    L[0] = ao(M[0], L[0]), L[1] = io(M[1], L[1]);
  }
  e.styleKey = x5(L[0], L[1]);
  var F = e.styleKeys;
  e.labelDimsKey = Dn(F.labelDimensions);
  var $ = i(t13, ["label"], F.labelDimensions);
  if (e.labelKey = Dn($), e.labelStyleKey = Dn(Go(F.commonLabel, $)), !s) {
    var U = i(t13, ["source-label"], F.labelDimensions);
    e.sourceLabelKey = Dn(U), e.sourceLabelStyleKey = Dn(Go(F.commonLabel, U));
    var H = i(t13, ["target-label"], F.labelDimensions);
    e.targetLabelKey = Dn(H), e.targetLabelStyleKey = Dn(Go(F.commonLabel, H));
  }
  if (s) {
    var K = e.styleKeys, ee = K.nodeBody, se = K.nodeBorder, oe = K.nodeOutline, ne = K.backgroundImage, ue = K.compound, te = K.pie, R = [ee, se, oe, ne, ue, te].filter(function(Y) {
      return Y != null;
    }).reduce(Go, [Ha, $i]);
    e.nodeKey = Dn(R), e.hasPie = te != null && te[0] !== Ha && te[1] !== $i;
  }
  return o !== e.styleKey;
};
ir.clearStyleHints = function(t13) {
  var e = t13._private;
  e.styleCxtKey = "", e.styleKeys = {}, e.styleKey = null, e.labelKey = null, e.labelStyleKey = null, e.sourceLabelKey = null, e.sourceLabelStyleKey = null, e.targetLabelKey = null, e.targetLabelStyleKey = null, e.nodeKey = null, e.hasPie = null;
};
ir.applyParsedProperty = function(t13, e) {
  var r = this, n = e, a = t13._private.style, i, o = r.types, s = r.properties[n.name].type, l = n.bypass, u = a[n.name], c = u && u.bypass, d = t13._private, v = "mapping", h6 = function(ee) {
    return ee == null ? null : ee.pfValue != null ? ee.pfValue : ee.value;
  }, f = function() {
    var ee = h6(u), se = h6(n);
    r.checkTriggers(t13, n.name, ee, se);
  };
  if (e.name === "curve-style" && t13.isEdge() && // loops must be bundled beziers
  (e.value !== "bezier" && t13.isLoop() || // edges connected to compound nodes can not be haystacks
  e.value === "haystack" && (t13.source().isParent() || t13.target().isParent())) && (n = e = this.parse(e.name, "bezier", l)), n.delete)
    return a[n.name] = void 0, f(), true;
  if (n.deleteBypassed)
    return u ? u.bypass ? (u.bypassed = void 0, f(), true) : false : (f(), true);
  if (n.deleteBypass)
    return u ? u.bypass ? (a[n.name] = u.bypassed, f(), true) : false : (f(), true);
  var p = function() {
    tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t13.id() + "` has no mapping for property `" + n.name + "` with data field `" + n.field + "`); try a `[" + n.field + "]` selector to limit scope to elements with `" + n.field + "` defined");
  };
  switch (n.mapped) {
    case o.mapData: {
      for (var m = n.field.split("."), g = d.data, y = 0; y < m.length && g; y++) {
        var b = m[y];
        g = g[b];
      }
      if (g == null)
        return p(), false;
      var w;
      if (be(g)) {
        var C = n.fieldMax - n.fieldMin;
        C === 0 ? w = 0 : w = (g - n.fieldMin) / C;
      } else
        return tt("Do not use continuous mappers without specifying numeric data (i.e. `" + n.field + ": " + g + "` for `" + t13.id() + "` is non-numeric)"), false;
      if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) {
        var E = n.valueMin[0], x = n.valueMax[0], T = n.valueMin[1], k = n.valueMax[1], _ = n.valueMin[2], D = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], A = n.valueMax[3] == null ? 1 : n.valueMax[3], L = [Math.round(E + (x - E) * w), Math.round(T + (k - T) * w), Math.round(_ + (D - _) * w), Math.round(O + (A - O) * w)];
        i = {
          // colours are simple, so just create the flat property instead of expensive string parsing
          bypass: n.bypass,
          // we're a bypass if the mapping property is a bypass
          name: n.name,
          value: L,
          strValue: "rgb(" + L[0] + ", " + L[1] + ", " + L[2] + ")"
        };
      } else if (s.number) {
        var N = n.valueMin + (n.valueMax - n.valueMin) * w;
        i = this.parse(n.name, N, n.bypass, v);
      } else
        return false;
      if (!i)
        return p(), false;
      i.mapping = n, n = i;
      break;
    }
    case o.data: {
      for (var I = n.field.split("."), M = d.data, F = 0; F < I.length && M; F++) {
        var $ = I[F];
        M = M[$];
      }
      if (M != null && (i = this.parse(n.name, M, n.bypass, v)), !i)
        return p(), false;
      i.mapping = n, n = i;
      break;
    }
    case o.fn: {
      var U = n.value, H = n.fnValue != null ? n.fnValue : U(t13);
      if (n.prevFnValue = H, H == null)
        return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t13.id() + "` is null)"), false;
      if (i = this.parse(n.name, H, n.bypass, v), !i)
        return tt("Custom function mappers may not return invalid values for the property type (i.e. `" + n.name + "` for ele `" + t13.id() + "` is invalid)"), false;
      i.mapping = jr(n), n = i;
      break;
    }
    case void 0:
      break;
    default:
      return false;
  }
  return l ? (c ? n.bypassed = u.bypassed : n.bypassed = u, a[n.name] = n) : c ? u.bypassed = n : a[n.name] = n, f(), true;
};
ir.cleanElements = function(t13, e) {
  for (var r = 0; r < t13.length; r++) {
    var n = t13[r];
    if (this.clearStyleHints(n), n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), !e)
      n._private.style = {};
    else
      for (var a = n._private.style, i = Object.keys(a), o = 0; o < i.length; o++) {
        var s = i[o], l = a[s];
        l != null && (l.bypass ? l.bypassed = null : a[s] = null);
      }
  }
};
ir.update = function() {
  var t13 = this._private.cy, e = t13.mutableElements();
  e.updateStyle();
};
ir.updateTransitions = function(t13, e) {
  var r = this, n = t13._private, a = t13.pstyle("transition-property").value, i = t13.pstyle("transition-duration").pfValue, o = t13.pstyle("transition-delay").pfValue;
  if (a.length > 0 && i > 0) {
    for (var s = {}, l = false, u = 0; u < a.length; u++) {
      var c = a[u], d = t13.pstyle(c), v = e[c];
      if (v) {
        var h6 = v.prev, f = h6, p = v.next != null ? v.next : d, m = false, g = void 0, y = 1e-6;
        f && (be(f.pfValue) && be(p.pfValue) ? (m = p.pfValue - f.pfValue, g = f.pfValue + y * m) : be(f.value) && be(p.value) ? (m = p.value - f.value, g = f.value + y * m) : st(f.value) && st(p.value) && (m = f.value[0] !== p.value[0] || f.value[1] !== p.value[1] || f.value[2] !== p.value[2], g = f.strValue), m && (s[c] = p.strValue, this.applyBypass(t13, c, g), l = true));
      }
    }
    if (!l)
      return;
    n.transitioning = true, new mi(function(b) {
      o > 0 ? t13.delayAnimation(o).play().promise().then(b) : b();
    }).then(function() {
      return t13.animation({
        style: s,
        duration: i,
        easing: t13.pstyle("transition-timing-function").value,
        queue: false
      }).play().promise();
    }).then(function() {
      r.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false;
    });
  } else n.transitioning && (this.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false);
};
ir.checkTrigger = function(t13, e, r, n, a, i) {
  var o = this.properties[e], s = a(o);
  s != null && s(r, n) && i(o);
};
ir.checkZOrderTrigger = function(t13, e, r, n) {
  var a = this;
  this.checkTrigger(t13, e, r, n, function(i) {
    return i.triggersZOrder;
  }, function() {
    a._private.cy.notify("zorder", t13);
  });
};
ir.checkBoundsTrigger = function(t13, e, r, n) {
  this.checkTrigger(t13, e, r, n, function(a) {
    return a.triggersBounds;
  }, function(a) {
    t13.dirtyCompoundBoundsCache(), t13.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected
    a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t13.parallelEdges().forEach(function(i) {
      i.isBundledBezier() && i.dirtyBoundingBoxCache();
    }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t13.connectedEdges().forEach(function(i) {
      i.dirtyBoundingBoxCache();
    });
  });
};
ir.checkTriggers = function(t13, e, r, n) {
  t13.dirtyStyleCache(), this.checkZOrderTrigger(t13, e, r, n), this.checkBoundsTrigger(t13, e, r, n);
};
var Io = {};
Io.applyBypass = function(t13, e, r, n) {
  var a = this, i = [], o = true;
  if (e === "*" || e === "**") {
    if (r !== void 0)
      for (var s = 0; s < a.properties.length; s++) {
        var l = a.properties[s], u = l.name, c = this.parse(u, r, true);
        c && i.push(c);
      }
  } else if (Ae(e)) {
    var d = this.parse(e, r, true);
    d && i.push(d);
  } else if (Xe(e)) {
    var v = e;
    n = r;
    for (var h6 = Object.keys(v), f = 0; f < h6.length; f++) {
      var p = h6[f], m = v[p];
      if (m === void 0 && (m = v[tl(p)]), m !== void 0) {
        var g = this.parse(p, m, true);
        g && i.push(g);
      }
    }
  } else
    return false;
  if (i.length === 0)
    return false;
  for (var y = false, b = 0; b < t13.length; b++) {
    for (var w = t13[b], C = {}, E = void 0, x = 0; x < i.length; x++) {
      var T = i[x];
      if (n) {
        var k = w.pstyle(T.name);
        E = C[T.name] = {
          prev: k
        };
      }
      y = this.applyParsedProperty(w, jr(T)) || y, n && (E.next = w.pstyle(T.name));
    }
    y && this.updateStyleHints(w), n && this.updateTransitions(w, C, o);
  }
  return y;
};
Io.overrideBypass = function(t13, e, r) {
  e = cc(e);
  for (var n = 0; n < t13.length; n++) {
    var a = t13[n], i = a._private.style[e], o = this.properties[e].type, s = o.color, l = o.mutiple, u = i ? i.pfValue != null ? i.pfValue : i.value : null;
    !i || !i.bypass ? this.applyBypass(a, e, r) : (i.value = r, i.pfValue != null && (i.pfValue = r), s ? i.strValue = "rgb(" + r.join(",") + ")" : l ? i.strValue = r.join(" ") : i.strValue = "" + r, this.updateStyleHints(a)), this.checkTriggers(a, e, u, r);
  }
};
Io.removeAllBypasses = function(t13, e) {
  return this.removeBypasses(t13, this.propertyNames, e);
};
Io.removeBypasses = function(t13, e, r) {
  for (var n = true, a = 0; a < t13.length; a++) {
    for (var i = t13[a], o = {}, s = 0; s < e.length; s++) {
      var l = e[s], u = this.properties[l], c = i.pstyle(u.name);
      if (!(!c || !c.bypass)) {
        var d = "", v = this.parse(l, d, true), h6 = o[u.name] = {
          prev: c
        };
        this.applyParsedProperty(i, v), h6.next = i.pstyle(u.name);
      }
    }
    this.updateStyleHints(i), r && this.updateTransitions(i, o, n);
  }
};
var kc = {};
kc.getEmSizeInPixels = function() {
  var t13 = this.containerCss("font-size");
  return t13 != null ? parseFloat(t13) : 1;
};
kc.containerCss = function(t13) {
  var e = this._private.cy, r = e.container(), n = e.window();
  if (n && r && n.getComputedStyle)
    return n.getComputedStyle(r).getPropertyValue(t13);
};
var tn = {};
tn.getRenderedStyle = function(t13, e) {
  return e ? this.getStylePropertyValue(t13, e, true) : this.getRawStyle(t13, true);
};
tn.getRawStyle = function(t13, e) {
  var r = this;
  if (t13 = t13[0], t13) {
    for (var n = {}, a = 0; a < r.properties.length; a++) {
      var i = r.properties[a], o = r.getStylePropertyValue(t13, i.name, e);
      o != null && (n[i.name] = o, n[tl(i.name)] = o);
    }
    return n;
  }
};
tn.getIndexedStyle = function(t13, e, r, n) {
  var a = t13.pstyle(e)[r][n];
  return a ?? t13.cy().style().getDefaultProperty(e)[r][0];
};
tn.getStylePropertyValue = function(t13, e, r) {
  var n = this;
  if (t13 = t13[0], t13) {
    var a = n.properties[e];
    a.alias && (a = a.pointsTo);
    var i = a.type, o = t13.pstyle(a.name);
    if (o) {
      var s = o.value, l = o.units, u = o.strValue;
      if (r && i.number && s != null && be(s)) {
        var c = t13.cy().zoom(), d = function(m) {
          return m * c;
        }, v = function(m, g) {
          return d(m) + g;
        }, h6 = st(s), f = h6 ? l.every(function(p) {
          return p != null;
        }) : l != null;
        return f ? h6 ? s.map(function(p, m) {
          return v(p, l[m]);
        }).join(" ") : v(s, l) : h6 ? s.map(function(p) {
          return Ae(p) ? p : "" + d(p);
        }).join(" ") : "" + d(s);
      } else if (u != null)
        return u;
    }
    return null;
  }
};
tn.getAnimationStartStyle = function(t13, e) {
  for (var r = {}, n = 0; n < e.length; n++) {
    var a = e[n], i = a.name, o = t13.pstyle(i);
    o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o);
  }
  return r;
};
tn.getPropsList = function(t13) {
  var e = this, r = [], n = t13, a = e.properties;
  if (n)
    for (var i = Object.keys(n), o = 0; o < i.length; o++) {
      var s = i[o], l = n[s], u = a[s] || a[cc(s)], c = this.parse(u.name, l);
      c && r.push(c);
    }
  return r;
};
tn.getNonDefaultPropertiesHash = function(t13, e, r) {
  var n = r.slice(), a, i, o, s, l, u;
  for (l = 0; l < e.length; l++)
    if (a = e[l], i = t13.pstyle(a, false), i != null)
      if (i.pfValue != null)
        n[0] = ao(s, n[0]), n[1] = io(s, n[1]);
      else
        for (o = i.strValue, u = 0; u < o.length; u++)
          s = o.charCodeAt(u), n[0] = ao(s, n[0]), n[1] = io(s, n[1]);
  return n;
};
tn.getPropertiesHash = tn.getNonDefaultPropertiesHash;
var hl = {};
hl.appendFromJson = function(t13) {
  for (var e = this, r = 0; r < t13.length; r++) {
    var n = t13[r], a = n.selector, i = n.style || n.css, o = Object.keys(i);
    e.selector(a);
    for (var s = 0; s < o.length; s++) {
      var l = o[s], u = i[l];
      e.css(l, u);
    }
  }
  return e;
};
hl.fromJson = function(t13) {
  var e = this;
  return e.resetToDefault(), e.appendFromJson(t13), e;
};
hl.json = function() {
  for (var t13 = [], e = this.defaultLength; e < this.length; e++) {
    for (var r = this[e], n = r.selector, a = r.properties, i = {}, o = 0; o < a.length; o++) {
      var s = a[o];
      i[s.name] = s.strValue;
    }
    t13.push({
      selector: n ? n.toString() : "core",
      style: i
    });
  }
  return t13;
};
var Sc = {};
Sc.appendFromString = function(t13) {
  var e = this, r = this, n = "" + t13, a, i, o;
  n = n.replace(/[/][*](\s|.)+?[*][/]/g, "");
  function s() {
    n.length > a.length ? n = n.substr(a.length) : n = "";
  }
  function l() {
    i.length > o.length ? i = i.substr(o.length) : i = "";
  }
  for (; ; ) {
    var u = n.match(/^\s*$/);
    if (u)
      break;
    var c = n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);
    if (!c) {
      tt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + n);
      break;
    }
    a = c[0];
    var d = c[1];
    if (d !== "core") {
      var v = new Un(d);
      if (v.invalid) {
        tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s();
        continue;
      }
    }
    var h6 = c[2], f = false;
    i = h6;
    for (var p = []; ; ) {
      var m = i.match(/^\s*$/);
      if (m)
        break;
      var g = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);
      if (!g) {
        tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h6), f = true;
        break;
      }
      o = g[0];
      var y = g[1], b = g[2], w = e.properties[y];
      if (!w) {
        tt("Skipping property: Invalid property name in: " + o), l();
        continue;
      }
      var C = r.parse(y, b);
      if (!C) {
        tt("Skipping property: Invalid property definition in: " + o), l();
        continue;
      }
      p.push({
        name: y,
        val: b
      }), l();
    }
    if (f) {
      s();
      break;
    }
    r.selector(d);
    for (var E = 0; E < p.length; E++) {
      var x = p[E];
      r.css(x.name, x.val);
    }
    s();
  }
  return r;
};
Sc.fromString = function(t13) {
  var e = this;
  return e.resetToDefault(), e.appendFromString(t13), e;
};
var zt = {};
(function() {
  var t13 = At, e = ST, r = _T, n = DT, a = PT, i = function(R) {
    return "^" + R + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$";
  }, o = function(R) {
    var Y = t13 + "|\\w+|" + e + "|" + r + "|" + n + "|" + a;
    return "^" + R + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t13 + ")\\s*\\,\\s*(" + t13 + ")\\s*,\\s*(" + Y + ")\\s*\\,\\s*(" + Y + ")\\)$";
  }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"];
  zt.types = {
    time: {
      number: true,
      min: 0,
      units: "s|ms",
      implicitUnits: "ms"
    },
    percent: {
      number: true,
      min: 0,
      max: 100,
      units: "%",
      implicitUnits: "%"
    },
    percentages: {
      number: true,
      min: 0,
      max: 100,
      units: "%",
      implicitUnits: "%",
      multiple: true
    },
    zeroOneNumber: {
      number: true,
      min: 0,
      max: 1,
      unitless: true
    },
    zeroOneNumbers: {
      number: true,
      min: 0,
      max: 1,
      unitless: true,
      multiple: true
    },
    nOneOneNumber: {
      number: true,
      min: -1,
      max: 1,
      unitless: true
    },
    nonNegativeInt: {
      number: true,
      min: 0,
      integer: true,
      unitless: true
    },
    nonNegativeNumber: {
      number: true,
      min: 0,
      unitless: true
    },
    position: {
      enums: ["parent", "origin"]
    },
    nodeSize: {
      number: true,
      min: 0,
      enums: ["label"]
    },
    number: {
      number: true,
      unitless: true
    },
    numbers: {
      number: true,
      unitless: true,
      multiple: true
    },
    positiveNumber: {
      number: true,
      unitless: true,
      min: 0,
      strictMin: true
    },
    size: {
      number: true,
      min: 0
    },
    bidirectionalSize: {
      number: true
    },
    // allows negative
    bidirectionalSizeMaybePercent: {
      number: true,
      allowPercent: true
    },
    // allows negative
    bidirectionalSizes: {
      number: true,
      multiple: true
    },
    // allows negative
    sizeMaybePercent: {
      number: true,
      min: 0,
      allowPercent: true
    },
    axisDirection: {
      enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"]
    },
    paddingRelativeTo: {
      enums: ["width", "height", "average", "min", "max"]
    },
    bgWH: {
      number: true,
      min: 0,
      allowPercent: true,
      enums: ["auto"],
      multiple: true
    },
    bgPos: {
      number: true,
      allowPercent: true,
      multiple: true
    },
    bgRelativeTo: {
      enums: ["inner", "include-padding"],
      multiple: true
    },
    bgRepeat: {
      enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"],
      multiple: true
    },
    bgFit: {
      enums: ["none", "contain", "cover"],
      multiple: true
    },
    bgCrossOrigin: {
      enums: ["anonymous", "use-credentials", "null"],
      multiple: true
    },
    bgClip: {
      enums: ["none", "node"],
      multiple: true
    },
    bgContainment: {
      enums: ["inside", "over"],
      multiple: true
    },
    color: {
      color: true
    },
    colors: {
      color: true,
      multiple: true
    },
    fill: {
      enums: ["solid", "linear-gradient", "radial-gradient"]
    },
    bool: {
      enums: ["yes", "no"]
    },
    bools: {
      enums: ["yes", "no"],
      multiple: true
    },
    lineStyle: {
      enums: ["solid", "dotted", "dashed"]
    },
    lineCap: {
      enums: ["butt", "round", "square"]
    },
    linePosition: {
      enums: ["center", "inside", "outside"]
    },
    lineJoin: {
      enums: ["round", "bevel", "miter"]
    },
    borderStyle: {
      enums: ["solid", "dotted", "dashed", "double"]
    },
    curveStyle: {
      enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"]
    },
    radiusType: {
      enums: ["arc-radius", "influence-radius"],
      multiple: true
    },
    fontFamily: {
      regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'
    },
    fontStyle: {
      enums: ["italic", "normal", "oblique"]
    },
    fontWeight: {
      enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900]
    },
    textDecoration: {
      enums: ["none", "underline", "overline", "line-through"]
    },
    textTransform: {
      enums: ["none", "uppercase", "lowercase"]
    },
    textWrap: {
      enums: ["none", "wrap", "ellipsis"]
    },
    textOverflowWrap: {
      enums: ["whitespace", "anywhere"]
    },
    textBackgroundShape: {
      enums: ["rectangle", "roundrectangle", "round-rectangle"]
    },
    nodeShape: {
      enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"]
    },
    overlayShape: {
      enums: ["roundrectangle", "round-rectangle", "ellipse"]
    },
    cornerRadius: {
      number: true,
      min: 0,
      units: "px|em",
      implicitUnits: "px",
      enums: ["auto"]
    },
    compoundIncludeLabels: {
      enums: ["include", "exclude"]
    },
    arrowShape: {
      enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"]
    },
    arrowFill: {
      enums: ["filled", "hollow"]
    },
    arrowWidth: {
      number: true,
      units: "%|px|em",
      implicitUnits: "px",
      enums: ["match-line"]
    },
    display: {
      enums: ["element", "none"]
    },
    visibility: {
      enums: ["hidden", "visible"]
    },
    zCompoundDepth: {
      enums: ["bottom", "orphan", "auto", "top"]
    },
    zIndexCompare: {
      enums: ["auto", "manual"]
    },
    valign: {
      enums: ["top", "center", "bottom"]
    },
    halign: {
      enums: ["left", "center", "right"]
    },
    justification: {
      enums: ["left", "center", "right", "auto"]
    },
    text: {
      string: true
    },
    data: {
      mapping: true,
      regex: i("data")
    },
    layoutData: {
      mapping: true,
      regex: i("layoutData")
    },
    scratch: {
      mapping: true,
      regex: i("scratch")
    },
    mapData: {
      mapping: true,
      regex: o("mapData")
    },
    mapLayoutData: {
      mapping: true,
      regex: o("mapLayoutData")
    },
    mapScratch: {
      mapping: true,
      regex: o("mapScratch")
    },
    fn: {
      mapping: true,
      fn: true
    },
    url: {
      regexes: s,
      singleRegexMatchValue: true
    },
    urls: {
      regexes: s,
      singleRegexMatchValue: true,
      multiple: true
    },
    propList: {
      propList: true
    },
    angle: {
      number: true,
      units: "deg|rad",
      implicitUnits: "rad"
    },
    textRotation: {
      number: true,
      units: "deg|rad",
      implicitUnits: "rad",
      enums: ["none", "autorotate"]
    },
    polygonPointList: {
      number: true,
      multiple: true,
      evenMultiple: true,
      min: -1,
      max: 1,
      unitless: true
    },
    edgeDistances: {
      enums: ["intersection", "node-position", "endpoints"]
    },
    edgeEndpoint: {
      number: true,
      multiple: true,
      units: "%|px|em|deg|rad",
      implicitUnits: "px",
      enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"],
      singleEnum: true,
      validate: function(R, Y) {
        switch (R.length) {
          case 2:
            return Y[0] !== "deg" && Y[0] !== "rad" && Y[1] !== "deg" && Y[1] !== "rad";
          case 1:
            return Ae(R[0]) || Y[0] === "deg" || Y[0] === "rad";
          default:
            return false;
        }
      }
    },
    easing: {
      regexes: ["^(spring)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$"],
      enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"]
    },
    gradientDirection: {
      enums: [
        "to-bottom",
        "to-top",
        "to-left",
        "to-right",
        "to-bottom-right",
        "to-bottom-left",
        "to-top-right",
        "to-top-left",
        "to-right-bottom",
        "to-left-bottom",
        "to-right-top",
        "to-left-top"
        // different order
      ]
    },
    boundsExpansion: {
      number: true,
      multiple: true,
      min: 0,
      validate: function(R) {
        var Y = R.length;
        return Y === 1 || Y === 2 || Y === 4;
      }
    }
  };
  var l = {
    zeroNonZero: function(R, Y) {
      return (R == null || Y == null) && R !== Y || R == 0 && Y != 0 ? true : R != 0 && Y == 0;
    },
    any: function(R, Y) {
      return R != Y;
    },
    emptyNonEmpty: function(R, Y) {
      var J = Kn(R), ge = Kn(Y);
      return J && !ge || !J && ge;
    }
  }, u = zt.types, c = [{
    name: "label",
    type: u.text,
    triggersBounds: l.any,
    triggersZOrder: l.emptyNonEmpty
  }, {
    name: "text-rotation",
    type: u.textRotation,
    triggersBounds: l.any
  }, {
    name: "text-margin-x",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "text-margin-y",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }], d = [{
    name: "source-label",
    type: u.text,
    triggersBounds: l.any
  }, {
    name: "source-text-rotation",
    type: u.textRotation,
    triggersBounds: l.any
  }, {
    name: "source-text-margin-x",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "source-text-margin-y",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "source-text-offset",
    type: u.size,
    triggersBounds: l.any
  }], v = [{
    name: "target-label",
    type: u.text,
    triggersBounds: l.any
  }, {
    name: "target-text-rotation",
    type: u.textRotation,
    triggersBounds: l.any
  }, {
    name: "target-text-margin-x",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "target-text-margin-y",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "target-text-offset",
    type: u.size,
    triggersBounds: l.any
  }], h6 = [{
    name: "font-family",
    type: u.fontFamily,
    triggersBounds: l.any
  }, {
    name: "font-style",
    type: u.fontStyle,
    triggersBounds: l.any
  }, {
    name: "font-weight",
    type: u.fontWeight,
    triggersBounds: l.any
  }, {
    name: "font-size",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "text-transform",
    type: u.textTransform,
    triggersBounds: l.any
  }, {
    name: "text-wrap",
    type: u.textWrap,
    triggersBounds: l.any
  }, {
    name: "text-overflow-wrap",
    type: u.textOverflowWrap,
    triggersBounds: l.any
  }, {
    name: "text-max-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "text-outline-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "line-height",
    type: u.positiveNumber,
    triggersBounds: l.any
  }], f = [{
    name: "text-valign",
    type: u.valign,
    triggersBounds: l.any
  }, {
    name: "text-halign",
    type: u.halign,
    triggersBounds: l.any
  }, {
    name: "color",
    type: u.color
  }, {
    name: "text-outline-color",
    type: u.color
  }, {
    name: "text-outline-opacity",
    type: u.zeroOneNumber
  }, {
    name: "text-background-color",
    type: u.color
  }, {
    name: "text-background-opacity",
    type: u.zeroOneNumber
  }, {
    name: "text-background-padding",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "text-border-opacity",
    type: u.zeroOneNumber
  }, {
    name: "text-border-color",
    type: u.color
  }, {
    name: "text-border-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "text-border-style",
    type: u.borderStyle,
    triggersBounds: l.any
  }, {
    name: "text-background-shape",
    type: u.textBackgroundShape,
    triggersBounds: l.any
  }, {
    name: "text-justification",
    type: u.justification
  }], p = [{
    name: "events",
    type: u.bool,
    triggersZOrder: l.any
  }, {
    name: "text-events",
    type: u.bool,
    triggersZOrder: l.any
  }], m = [{
    name: "display",
    type: u.display,
    triggersZOrder: l.any,
    triggersBounds: l.any,
    triggersBoundsOfConnectedEdges: true
  }, {
    name: "visibility",
    type: u.visibility,
    triggersZOrder: l.any
  }, {
    name: "opacity",
    type: u.zeroOneNumber,
    triggersZOrder: l.zeroNonZero
  }, {
    name: "text-opacity",
    type: u.zeroOneNumber
  }, {
    name: "min-zoomed-font-size",
    type: u.size
  }, {
    name: "z-compound-depth",
    type: u.zCompoundDepth,
    triggersZOrder: l.any
  }, {
    name: "z-index-compare",
    type: u.zIndexCompare,
    triggersZOrder: l.any
  }, {
    name: "z-index",
    type: u.number,
    triggersZOrder: l.any
  }], g = [{
    name: "overlay-padding",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "overlay-color",
    type: u.color
  }, {
    name: "overlay-opacity",
    type: u.zeroOneNumber,
    triggersBounds: l.zeroNonZero
  }, {
    name: "overlay-shape",
    type: u.overlayShape,
    triggersBounds: l.any
  }, {
    name: "overlay-corner-radius",
    type: u.cornerRadius
  }], y = [{
    name: "underlay-padding",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "underlay-color",
    type: u.color
  }, {
    name: "underlay-opacity",
    type: u.zeroOneNumber,
    triggersBounds: l.zeroNonZero
  }, {
    name: "underlay-shape",
    type: u.overlayShape,
    triggersBounds: l.any
  }, {
    name: "underlay-corner-radius",
    type: u.cornerRadius
  }], b = [{
    name: "transition-property",
    type: u.propList
  }, {
    name: "transition-duration",
    type: u.time
  }, {
    name: "transition-delay",
    type: u.time
  }, {
    name: "transition-timing-function",
    type: u.easing
  }], w = function(R, Y) {
    return Y.value === "label" ? -R.poolIndex() : Y.pfValue;
  }, C = [{
    name: "height",
    type: u.nodeSize,
    triggersBounds: l.any,
    hashOverride: w
  }, {
    name: "width",
    type: u.nodeSize,
    triggersBounds: l.any,
    hashOverride: w
  }, {
    name: "shape",
    type: u.nodeShape,
    triggersBounds: l.any
  }, {
    name: "shape-polygon-points",
    type: u.polygonPointList,
    triggersBounds: l.any
  }, {
    name: "corner-radius",
    type: u.cornerRadius
  }, {
    name: "background-color",
    type: u.color
  }, {
    name: "background-fill",
    type: u.fill
  }, {
    name: "background-opacity",
    type: u.zeroOneNumber
  }, {
    name: "background-blacken",
    type: u.nOneOneNumber
  }, {
    name: "background-gradient-stop-colors",
    type: u.colors
  }, {
    name: "background-gradient-stop-positions",
    type: u.percentages
  }, {
    name: "background-gradient-direction",
    type: u.gradientDirection
  }, {
    name: "padding",
    type: u.sizeMaybePercent,
    triggersBounds: l.any
  }, {
    name: "padding-relative-to",
    type: u.paddingRelativeTo,
    triggersBounds: l.any
  }, {
    name: "bounds-expansion",
    type: u.boundsExpansion,
    triggersBounds: l.any
  }], E = [{
    name: "border-color",
    type: u.color
  }, {
    name: "border-opacity",
    type: u.zeroOneNumber
  }, {
    name: "border-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "border-style",
    type: u.borderStyle
  }, {
    name: "border-cap",
    type: u.lineCap
  }, {
    name: "border-join",
    type: u.lineJoin
  }, {
    name: "border-dash-pattern",
    type: u.numbers
  }, {
    name: "border-dash-offset",
    type: u.number
  }, {
    name: "border-position",
    type: u.linePosition
  }], x = [{
    name: "outline-color",
    type: u.color
  }, {
    name: "outline-opacity",
    type: u.zeroOneNumber
  }, {
    name: "outline-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "outline-style",
    type: u.borderStyle
  }, {
    name: "outline-offset",
    type: u.size,
    triggersBounds: l.any
  }], T = [{
    name: "background-image",
    type: u.urls
  }, {
    name: "background-image-crossorigin",
    type: u.bgCrossOrigin
  }, {
    name: "background-image-opacity",
    type: u.zeroOneNumbers
  }, {
    name: "background-image-containment",
    type: u.bgContainment
  }, {
    name: "background-image-smoothing",
    type: u.bools
  }, {
    name: "background-position-x",
    type: u.bgPos
  }, {
    name: "background-position-y",
    type: u.bgPos
  }, {
    name: "background-width-relative-to",
    type: u.bgRelativeTo
  }, {
    name: "background-height-relative-to",
    type: u.bgRelativeTo
  }, {
    name: "background-repeat",
    type: u.bgRepeat
  }, {
    name: "background-fit",
    type: u.bgFit
  }, {
    name: "background-clip",
    type: u.bgClip
  }, {
    name: "background-width",
    type: u.bgWH
  }, {
    name: "background-height",
    type: u.bgWH
  }, {
    name: "background-offset-x",
    type: u.bgPos
  }, {
    name: "background-offset-y",
    type: u.bgPos
  }], k = [{
    name: "position",
    type: u.position,
    triggersBounds: l.any
  }, {
    name: "compound-sizing-wrt-labels",
    type: u.compoundIncludeLabels,
    triggersBounds: l.any
  }, {
    name: "min-width",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "min-width-bias-left",
    type: u.sizeMaybePercent,
    triggersBounds: l.any
  }, {
    name: "min-width-bias-right",
    type: u.sizeMaybePercent,
    triggersBounds: l.any
  }, {
    name: "min-height",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "min-height-bias-top",
    type: u.sizeMaybePercent,
    triggersBounds: l.any
  }, {
    name: "min-height-bias-bottom",
    type: u.sizeMaybePercent,
    triggersBounds: l.any
  }], _ = [{
    name: "line-style",
    type: u.lineStyle
  }, {
    name: "line-color",
    type: u.color
  }, {
    name: "line-fill",
    type: u.fill
  }, {
    name: "line-cap",
    type: u.lineCap
  }, {
    name: "line-opacity",
    type: u.zeroOneNumber
  }, {
    name: "line-dash-pattern",
    type: u.numbers
  }, {
    name: "line-dash-offset",
    type: u.number
  }, {
    name: "line-outline-width",
    type: u.size
  }, {
    name: "line-outline-color",
    type: u.color
  }, {
    name: "line-gradient-stop-colors",
    type: u.colors
  }, {
    name: "line-gradient-stop-positions",
    type: u.percentages
  }, {
    name: "curve-style",
    type: u.curveStyle,
    triggersBounds: l.any,
    triggersBoundsOfParallelBeziers: true
  }, {
    name: "haystack-radius",
    type: u.zeroOneNumber,
    triggersBounds: l.any
  }, {
    name: "source-endpoint",
    type: u.edgeEndpoint,
    triggersBounds: l.any
  }, {
    name: "target-endpoint",
    type: u.edgeEndpoint,
    triggersBounds: l.any
  }, {
    name: "control-point-step-size",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "control-point-distances",
    type: u.bidirectionalSizes,
    triggersBounds: l.any
  }, {
    name: "control-point-weights",
    type: u.numbers,
    triggersBounds: l.any
  }, {
    name: "segment-distances",
    type: u.bidirectionalSizes,
    triggersBounds: l.any
  }, {
    name: "segment-weights",
    type: u.numbers,
    triggersBounds: l.any
  }, {
    name: "segment-radii",
    type: u.numbers,
    triggersBounds: l.any
  }, {
    name: "radius-type",
    type: u.radiusType,
    triggersBounds: l.any
  }, {
    name: "taxi-turn",
    type: u.bidirectionalSizeMaybePercent,
    triggersBounds: l.any
  }, {
    name: "taxi-turn-min-distance",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "taxi-direction",
    type: u.axisDirection,
    triggersBounds: l.any
  }, {
    name: "taxi-radius",
    type: u.number,
    triggersBounds: l.any
  }, {
    name: "edge-distances",
    type: u.edgeDistances,
    triggersBounds: l.any
  }, {
    name: "arrow-scale",
    type: u.positiveNumber,
    triggersBounds: l.any
  }, {
    name: "loop-direction",
    type: u.angle,
    triggersBounds: l.any
  }, {
    name: "loop-sweep",
    type: u.angle,
    triggersBounds: l.any
  }, {
    name: "source-distance-from-node",
    type: u.size,
    triggersBounds: l.any
  }, {
    name: "target-distance-from-node",
    type: u.size,
    triggersBounds: l.any
  }], D = [{
    name: "ghost",
    type: u.bool,
    triggersBounds: l.any
  }, {
    name: "ghost-offset-x",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "ghost-offset-y",
    type: u.bidirectionalSize,
    triggersBounds: l.any
  }, {
    name: "ghost-opacity",
    type: u.zeroOneNumber
  }], O = [{
    name: "selection-box-color",
    type: u.color
  }, {
    name: "selection-box-opacity",
    type: u.zeroOneNumber
  }, {
    name: "selection-box-border-color",
    type: u.color
  }, {
    name: "selection-box-border-width",
    type: u.size
  }, {
    name: "active-bg-color",
    type: u.color
  }, {
    name: "active-bg-opacity",
    type: u.zeroOneNumber
  }, {
    name: "active-bg-size",
    type: u.size
  }, {
    name: "outside-texture-bg-color",
    type: u.color
  }, {
    name: "outside-texture-bg-opacity",
    type: u.zeroOneNumber
  }], A = [];
  zt.pieBackgroundN = 16, A.push({
    name: "pie-size",
    type: u.sizeMaybePercent
  });
  for (var L = 1; L <= zt.pieBackgroundN; L++)
    A.push({
      name: "pie-" + L + "-background-color",
      type: u.color
    }), A.push({
      name: "pie-" + L + "-background-size",
      type: u.percent
    }), A.push({
      name: "pie-" + L + "-background-opacity",
      type: u.zeroOneNumber
    });
  var N = [], I = zt.arrowPrefixes = ["source", "mid-source", "target", "mid-target"];
  [{
    name: "arrow-shape",
    type: u.arrowShape,
    triggersBounds: l.any
  }, {
    name: "arrow-color",
    type: u.color
  }, {
    name: "arrow-fill",
    type: u.arrowFill
  }, {
    name: "arrow-width",
    type: u.arrowWidth
  }].forEach(function(te) {
    I.forEach(function(R) {
      var Y = R + "-" + te.name, J = te.type, ge = te.triggersBounds;
      N.push({
        name: Y,
        type: J,
        triggersBounds: ge
      });
    });
  }, {});
  var M = zt.properties = [].concat(p, b, m, g, y, D, f, h6, c, d, v, C, E, x, T, A, k, _, N, O), F = zt.propertyGroups = {
    // common to all eles
    behavior: p,
    transition: b,
    visibility: m,
    overlay: g,
    underlay: y,
    ghost: D,
    // labels
    commonLabel: f,
    labelDimensions: h6,
    mainLabel: c,
    sourceLabel: d,
    targetLabel: v,
    // node props
    nodeBody: C,
    nodeBorder: E,
    nodeOutline: x,
    backgroundImage: T,
    pie: A,
    compound: k,
    // edge props
    edgeLine: _,
    edgeArrow: N,
    core: O
  }, $ = zt.propertyGroupNames = {}, U = zt.propertyGroupKeys = Object.keys(F);
  U.forEach(function(te) {
    $[te] = F[te].map(function(R) {
      return R.name;
    }), F[te].forEach(function(R) {
      return R.groupKey = te;
    });
  });
  var H = zt.aliases = [{
    name: "content",
    pointsTo: "label"
  }, {
    name: "control-point-distance",
    pointsTo: "control-point-distances"
  }, {
    name: "control-point-weight",
    pointsTo: "control-point-weights"
  }, {
    name: "segment-distance",
    pointsTo: "segment-distances"
  }, {
    name: "segment-weight",
    pointsTo: "segment-weights"
  }, {
    name: "segment-radius",
    pointsTo: "segment-radii"
  }, {
    name: "edge-text-rotation",
    pointsTo: "text-rotation"
  }, {
    name: "padding-left",
    pointsTo: "padding"
  }, {
    name: "padding-right",
    pointsTo: "padding"
  }, {
    name: "padding-top",
    pointsTo: "padding"
  }, {
    name: "padding-bottom",
    pointsTo: "padding"
  }];
  zt.propertyNames = M.map(function(te) {
    return te.name;
  });
  for (var K = 0; K < M.length; K++) {
    var ee = M[K];
    M[ee.name] = ee;
  }
  for (var se = 0; se < H.length; se++) {
    var oe = H[se], ne = M[oe.pointsTo], ue = {
      name: oe.name,
      alias: true,
      pointsTo: ne
    };
    M.push(ue), M[oe.name] = ue;
  }
})();
zt.getDefaultProperty = function(t13) {
  return this.getDefaultProperties()[t13];
};
zt.getDefaultProperties = function() {
  var t13 = this._private;
  if (t13.defaultProperties != null)
    return t13.defaultProperties;
  for (var e = ze({
    // core props
    "selection-box-color": "#ddd",
    "selection-box-opacity": 0.65,
    "selection-box-border-color": "#aaa",
    "selection-box-border-width": 1,
    "active-bg-color": "black",
    "active-bg-opacity": 0.15,
    "active-bg-size": 30,
    "outside-texture-bg-color": "#000",
    "outside-texture-bg-opacity": 0.125,
    // common node/edge props
    events: "yes",
    "text-events": "no",
    "text-valign": "top",
    "text-halign": "center",
    "text-justification": "auto",
    "line-height": 1,
    color: "#000",
    "text-outline-color": "#000",
    "text-outline-width": 0,
    "text-outline-opacity": 1,
    "text-opacity": 1,
    "text-decoration": "none",
    "text-transform": "none",
    "text-wrap": "none",
    "text-overflow-wrap": "whitespace",
    "text-max-width": 9999,
    "text-background-color": "#000",
    "text-background-opacity": 0,
    "text-background-shape": "rectangle",
    "text-background-padding": 0,
    "text-border-opacity": 0,
    "text-border-width": 0,
    "text-border-style": "solid",
    "text-border-color": "#000",
    "font-family": "Helvetica Neue, Helvetica, sans-serif",
    "font-style": "normal",
    "font-weight": "normal",
    "font-size": 16,
    "min-zoomed-font-size": 0,
    "text-rotation": "none",
    "source-text-rotation": "none",
    "target-text-rotation": "none",
    visibility: "visible",
    display: "element",
    opacity: 1,
    "z-compound-depth": "auto",
    "z-index-compare": "auto",
    "z-index": 0,
    label: "",
    "text-margin-x": 0,
    "text-margin-y": 0,
    "source-label": "",
    "source-text-offset": 0,
    "source-text-margin-x": 0,
    "source-text-margin-y": 0,
    "target-label": "",
    "target-text-offset": 0,
    "target-text-margin-x": 0,
    "target-text-margin-y": 0,
    "overlay-opacity": 0,
    "overlay-color": "#000",
    "overlay-padding": 10,
    "overlay-shape": "round-rectangle",
    "overlay-corner-radius": "auto",
    "underlay-opacity": 0,
    "underlay-color": "#000",
    "underlay-padding": 10,
    "underlay-shape": "round-rectangle",
    "underlay-corner-radius": "auto",
    "transition-property": "none",
    "transition-duration": 0,
    "transition-delay": 0,
    "transition-timing-function": "linear",
    // node props
    "background-blacken": 0,
    "background-color": "#999",
    "background-fill": "solid",
    "background-opacity": 1,
    "background-image": "none",
    "background-image-crossorigin": "anonymous",
    "background-image-opacity": 1,
    "background-image-containment": "inside",
    "background-image-smoothing": "yes",
    "background-position-x": "50%",
    "background-position-y": "50%",
    "background-offset-x": 0,
    "background-offset-y": 0,
    "background-width-relative-to": "include-padding",
    "background-height-relative-to": "include-padding",
    "background-repeat": "no-repeat",
    "background-fit": "none",
    "background-clip": "node",
    "background-width": "auto",
    "background-height": "auto",
    "border-color": "#000",
    "border-opacity": 1,
    "border-width": 0,
    "border-style": "solid",
    "border-dash-pattern": [4, 2],
    "border-dash-offset": 0,
    "border-cap": "butt",
    "border-join": "miter",
    "border-position": "center",
    "outline-color": "#999",
    "outline-opacity": 1,
    "outline-width": 0,
    "outline-offset": 0,
    "outline-style": "solid",
    height: 30,
    width: 30,
    shape: "ellipse",
    "shape-polygon-points": "-1, -1,   1, -1,   1, 1,   -1, 1",
    "corner-radius": "auto",
    "bounds-expansion": 0,
    // node gradient
    "background-gradient-direction": "to-bottom",
    "background-gradient-stop-colors": "#999",
    "background-gradient-stop-positions": "0%",
    // ghost props
    ghost: "no",
    "ghost-offset-y": 0,
    "ghost-offset-x": 0,
    "ghost-opacity": 0,
    // compound props
    padding: 0,
    "padding-relative-to": "width",
    position: "origin",
    "compound-sizing-wrt-labels": "include",
    "min-width": 0,
    "min-width-bias-left": 0,
    "min-width-bias-right": 0,
    "min-height": 0,
    "min-height-bias-top": 0,
    "min-height-bias-bottom": 0
  }, {
    // node pie bg
    "pie-size": "100%"
  }, [{
    name: "pie-{{i}}-background-color",
    value: "black"
  }, {
    name: "pie-{{i}}-background-size",
    value: "0%"
  }, {
    name: "pie-{{i}}-background-opacity",
    value: 1
  }].reduce(function(l, u) {
    for (var c = 1; c <= zt.pieBackgroundN; c++) {
      var d = u.name.replace("{{i}}", c), v = u.value;
      l[d] = v;
    }
    return l;
  }, {}), {
    // edge props
    "line-style": "solid",
    "line-color": "#999",
    "line-fill": "solid",
    "line-cap": "butt",
    "line-opacity": 1,
    "line-outline-width": 0,
    "line-outline-color": "#000",
    "line-gradient-stop-colors": "#999",
    "line-gradient-stop-positions": "0%",
    "control-point-step-size": 40,
    "control-point-weights": 0.5,
    "segment-weights": 0.5,
    "segment-distances": 20,
    "segment-radii": 15,
    "radius-type": "arc-radius",
    "taxi-turn": "50%",
    "taxi-radius": 15,
    "taxi-turn-min-distance": 10,
    "taxi-direction": "auto",
    "edge-distances": "intersection",
    "curve-style": "haystack",
    "haystack-radius": 0,
    "arrow-scale": 1,
    "loop-direction": "-45deg",
    "loop-sweep": "-90deg",
    "source-distance-from-node": 0,
    "target-distance-from-node": 0,
    "source-endpoint": "outside-to-node",
    "target-endpoint": "outside-to-node",
    "line-dash-pattern": [6, 3],
    "line-dash-offset": 0
  }, [{
    name: "arrow-shape",
    value: "none"
  }, {
    name: "arrow-color",
    value: "#999"
  }, {
    name: "arrow-fill",
    value: "filled"
  }, {
    name: "arrow-width",
    value: 1
  }].reduce(function(l, u) {
    return zt.arrowPrefixes.forEach(function(c) {
      var d = c + "-" + u.name, v = u.value;
      l[d] = v;
    }), l;
  }, {})), r = {}, n = 0; n < this.properties.length; n++) {
    var a = this.properties[n];
    if (!a.pointsTo) {
      var i = a.name, o = e[i], s = this.parse(i, o);
      r[i] = s;
    }
  }
  return t13.defaultProperties = r, t13.defaultProperties;
};
zt.addDefaultStylesheet = function() {
  this.selector(":parent").css({
    shape: "rectangle",
    padding: 10,
    "background-color": "#eee",
    "border-color": "#ccc",
    "border-width": 1
  }).selector("edge").css({
    width: 3
  }).selector(":loop").css({
    "curve-style": "bezier"
  }).selector("edge:compound").css({
    "curve-style": "bezier",
    "source-endpoint": "outside-to-line",
    "target-endpoint": "outside-to-line"
  }).selector(":selected").css({
    "background-color": "#0169D9",
    "line-color": "#0169D9",
    "source-arrow-color": "#0169D9",
    "target-arrow-color": "#0169D9",
    "mid-source-arrow-color": "#0169D9",
    "mid-target-arrow-color": "#0169D9"
  }).selector(":parent:selected").css({
    "background-color": "#CCE1F9",
    "border-color": "#aec8e5"
  }).selector(":active").css({
    "overlay-color": "black",
    "overlay-padding": 10,
    "overlay-opacity": 0.25
  }), this.defaultLength = this.length;
};
var pl = {};
pl.parse = function(t13, e, r, n) {
  var a = this;
  if (pt(e))
    return a.parseImplWarn(t13, e, r, n);
  var i = n === "mapping" || n === true || n === false || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, l = lp(t13, s, o, i), u = a.propCache = a.propCache || [], c;
  return (c = u[l]) || (c = u[l] = a.parseImplWarn(t13, e, r, n)), (r || n === "mapping") && (c = jr(c), c && (c.value = jr(c.value))), c;
};
pl.parseImplWarn = function(t13, e, r, n) {
  var a = this.parseImpl(t13, e, r, n);
  return !a && e != null && tt("The style property `".concat(t13, ": ").concat(e, "` is invalid")), a && (a.name === "width" || a.name === "height") && e === "label" && tt("The style value of `label` is deprecated for `" + a.name + "`"), a;
};
pl.parseImpl = function(t13, e, r, n) {
  var a = this;
  t13 = cc(t13);
  var i = a.properties[t13], o = e, s = a.types;
  if (!i || e === void 0)
    return null;
  i.alias && (i = i.pointsTo, t13 = i.name);
  var l = Ae(e);
  l && (e = e.trim());
  var u = i.type;
  if (!u)
    return null;
  if (r && (e === "" || e === null))
    return {
      name: t13,
      value: e,
      bypass: true,
      deleteBypass: true
    };
  if (pt(e))
    return {
      name: t13,
      value: e,
      strValue: "fn",
      mapped: s.fn,
      bypass: r
    };
  var c, d;
  if (!(!l || n || e.length < 7 || e[1] !== "a")) {
    if (e.length >= 7 && e[0] === "d" && (c = new RegExp(s.data.regex).exec(e))) {
      if (r)
        return false;
      var v = s.data;
      return {
        name: t13,
        value: c,
        strValue: "" + e,
        mapped: v,
        field: c[1],
        bypass: r
      };
    } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) {
      if (r || u.multiple)
        return false;
      var h6 = s.mapData;
      if (!(u.color || u.number))
        return false;
      var f = this.parse(t13, d[4]);
      if (!f || f.mapped)
        return false;
      var p = this.parse(t13, d[5]);
      if (!p || p.mapped)
        return false;
      if (f.pfValue === p.pfValue || f.strValue === p.strValue)
        return tt("`" + t13 + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t13 + ": " + f.strValue + "`"), this.parse(t13, f.strValue);
      if (u.color) {
        var m = f.value, g = p.value, y = m[0] === g[0] && m[1] === g[1] && m[2] === g[2] && // optional alpha
        (m[3] === g[3] || (m[3] == null || m[3] === 1) && (g[3] == null || g[3] === 1));
        if (y)
          return false;
      }
      return {
        name: t13,
        value: d,
        strValue: "" + e,
        mapped: h6,
        field: d[1],
        fieldMin: parseFloat(d[2]),
        // min & max are numeric
        fieldMax: parseFloat(d[3]),
        valueMin: f.value,
        valueMax: p.value,
        bypass: r
      };
    }
  }
  if (u.multiple && n !== "multiple") {
    var b;
    if (l ? b = e.split(/\s+/) : st(e) ? b = e : b = [e], u.evenMultiple && b.length % 2 !== 0)
      return null;
    for (var w = [], C = [], E = [], x = "", T = false, k = 0; k < b.length; k++) {
      var _ = a.parse(t13, b[k], r, "multiple");
      T = T || Ae(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), C.push(_.units), x += (k > 0 ? " " : "") + _.strValue;
    }
    return u.validate && !u.validate(w, C) ? null : u.singleEnum && T ? w.length === 1 && Ae(w[0]) ? {
      name: t13,
      value: w[0],
      strValue: w[0],
      bypass: r
    } : null : {
      name: t13,
      value: w,
      pfValue: E,
      strValue: x,
      bypass: r,
      units: C
    };
  }
  var D = function() {
    for (var R = 0; R < u.enums.length; R++) {
      var Y = u.enums[R];
      if (Y === e)
        return {
          name: t13,
          value: e,
          strValue: "" + e,
          bypass: r
        };
    }
    return null;
  };
  if (u.number) {
    var O, A = "px";
    if (u.units && (O = u.units), u.implicitUnits && (A = u.implicitUnits), !u.unitless)
      if (l) {
        var L = "px|em" + (u.allowPercent ? "|\\%" : "");
        O && (L = O);
        var N = e.match("^(" + At + ")(" + L + ")?$");
        N && (e = N[1], O = N[2] || A);
      } else (!O || u.implicitUnits) && (O = A);
    if (e = parseFloat(e), isNaN(e) && u.enums === void 0)
      return null;
    if (isNaN(e) && u.enums !== void 0)
      return e = o, D();
    if (u.integer && !yT(e) || u.min !== void 0 && (e < u.min || u.strictMin && e === u.min) || u.max !== void 0 && (e > u.max || u.strictMax && e === u.max))
      return null;
    var I = {
      name: t13,
      value: e,
      strValue: "" + e + (O || ""),
      units: O,
      bypass: r
    };
    return u.unitless || O !== "px" && O !== "em" ? I.pfValue = e : I.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (I.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (I.pfValue = O === "rad" ? e : Q5(e)), O === "%" && (I.pfValue = e / 100), I;
  } else if (u.propList) {
    var M = [], F = "" + e;
    if (F !== "none") {
      for (var $ = F.split(/\s*,\s*|\s+/), U = 0; U < $.length; U++) {
        var H = $[U].trim();
        a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name");
      }
      if (M.length === 0)
        return null;
    }
    return {
      name: t13,
      value: M,
      strValue: M.length === 0 ? "none" : M.join(" "),
      bypass: r
    };
  } else if (u.color) {
    var K = MT(e);
    return K ? {
      name: t13,
      value: K,
      pfValue: K,
      strValue: "rgb(" + K[0] + "," + K[1] + "," + K[2] + ")",
      // n.b. no spaces b/c of multiple support
      bypass: r
    } : null;
  } else if (u.regex || u.regexes) {
    if (u.enums) {
      var ee = D();
      if (ee)
        return ee;
    }
    for (var se = u.regexes ? u.regexes : [u.regex], oe = 0; oe < se.length; oe++) {
      var ne = new RegExp(se[oe]), ue = ne.exec(e);
      if (ue)
        return {
          name: t13,
          value: u.singleRegexMatchValue ? ue[1] : ue,
          strValue: "" + e,
          bypass: r
        };
    }
    return null;
  } else return u.string ? {
    name: t13,
    value: "" + e,
    strValue: "" + e,
    bypass: r
  } : u.enums ? D() : null;
};
var rr = function t9(e) {
  if (!(this instanceof t9))
    return new t9(e);
  if (!uc(e)) {
    yt("A style must have a core reference");
    return;
  }
  this._private = {
    cy: e,
    coreStyle: {}
  }, this.length = 0, this.resetToDefault();
};
var ar = rr.prototype;
ar.instanceString = function() {
  return "style";
};
ar.clear = function() {
  for (var t13 = this._private, e = t13.cy, r = e.elements(), n = 0; n < this.length; n++)
    this[n] = void 0;
  return this.length = 0, t13.contextStyles = {}, t13.propDiffs = {}, this.cleanElements(r, true), r.forEach(function(a) {
    var i = a[0]._private;
    i.styleDirty = true, i.appliedInitStyle = false;
  }), this;
};
ar.resetToDefault = function() {
  return this.clear(), this.addDefaultStylesheet(), this;
};
ar.core = function(t13) {
  return this._private.coreStyle[t13] || this.getDefaultProperty(t13);
};
ar.selector = function(t13) {
  var e = t13 === "core" ? null : new Un(t13), r = this.length++;
  return this[r] = {
    selector: e,
    properties: [],
    mappedProperties: [],
    index: r
  }, this;
};
ar.css = function() {
  var t13 = this, e = arguments;
  if (e.length === 1)
    for (var r = e[0], n = 0; n < t13.properties.length; n++) {
      var a = t13.properties[n], i = r[a.name];
      i === void 0 && (i = r[tl(a.name)]), i !== void 0 && this.cssRule(a.name, i);
    }
  else e.length === 2 && this.cssRule(e[0], e[1]);
  return this;
};
ar.style = ar.css;
ar.cssRule = function(t13, e) {
  var r = this.parse(t13, e);
  if (r) {
    var n = this.length - 1;
    this[n].properties.push(r), this[n].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = true), r.mapped && this[n].mappedProperties.push(r);
    var a = !this[n].selector;
    a && (this._private.coreStyle[r.name] = r);
  }
  return this;
};
ar.append = function(t13) {
  return Qh(t13) ? t13.appendToStyle(this) : st(t13) ? this.appendFromJson(t13) : Ae(t13) && this.appendFromString(t13), this;
};
rr.fromJson = function(t13, e) {
  var r = new rr(t13);
  return r.fromJson(e), r;
};
rr.fromString = function(t13, e) {
  return new rr(t13).fromString(e);
};
[ir, Io, kc, tn, hl, Sc, zt, pl].forEach(function(t13) {
  ze(ar, t13);
});
rr.types = ar.types;
rr.properties = ar.properties;
rr.propertyGroups = ar.propertyGroups;
rr.propertyGroupNames = ar.propertyGroupNames;
rr.propertyGroupKeys = ar.propertyGroupKeys;
var yP = {
  style: function(e) {
    if (e) {
      var r = this.setStyle(e);
      r.update();
    }
    return this._private.style;
  },
  setStyle: function(e) {
    var r = this._private;
    return Qh(e) ? r.style = e.generateStyle(this) : st(e) ? r.style = rr.fromJson(this, e) : Ae(e) ? r.style = rr.fromString(this, e) : r.style = rr(this), r.style;
  },
  // e.g. cy.data() changed => recalc ele mappers
  updateStyle: function() {
    this.mutableElements().updateStyle();
  }
};
var bP = "single";
var Ca = {
  autolock: function(e) {
    if (e !== void 0)
      this._private.autolock = !!e;
    else
      return this._private.autolock;
    return this;
  },
  autoungrabify: function(e) {
    if (e !== void 0)
      this._private.autoungrabify = !!e;
    else
      return this._private.autoungrabify;
    return this;
  },
  autounselectify: function(e) {
    if (e !== void 0)
      this._private.autounselectify = !!e;
    else
      return this._private.autounselectify;
    return this;
  },
  selectionType: function(e) {
    var r = this._private;
    if (r.selectionType == null && (r.selectionType = bP), e !== void 0)
      (e === "additive" || e === "single") && (r.selectionType = e);
    else
      return r.selectionType;
    return this;
  },
  panningEnabled: function(e) {
    if (e !== void 0)
      this._private.panningEnabled = !!e;
    else
      return this._private.panningEnabled;
    return this;
  },
  userPanningEnabled: function(e) {
    if (e !== void 0)
      this._private.userPanningEnabled = !!e;
    else
      return this._private.userPanningEnabled;
    return this;
  },
  zoomingEnabled: function(e) {
    if (e !== void 0)
      this._private.zoomingEnabled = !!e;
    else
      return this._private.zoomingEnabled;
    return this;
  },
  userZoomingEnabled: function(e) {
    if (e !== void 0)
      this._private.userZoomingEnabled = !!e;
    else
      return this._private.userZoomingEnabled;
    return this;
  },
  boxSelectionEnabled: function(e) {
    if (e !== void 0)
      this._private.boxSelectionEnabled = !!e;
    else
      return this._private.boxSelectionEnabled;
    return this;
  },
  pan: function() {
    var e = arguments, r = this._private.pan, n, a, i, o, s;
    switch (e.length) {
      case 0:
        return r;
      case 1:
        if (Ae(e[0]))
          return n = e[0], r[n];
        if (Xe(e[0])) {
          if (!this._private.panningEnabled)
            return this;
          i = e[0], o = i.x, s = i.y, be(o) && (r.x = o), be(s) && (r.y = s), this.emit("pan viewport");
        }
        break;
      case 2:
        if (!this._private.panningEnabled)
          return this;
        n = e[0], a = e[1], (n === "x" || n === "y") && be(a) && (r[n] = a), this.emit("pan viewport");
        break;
    }
    return this.notify("viewport"), this;
  },
  panBy: function(e, r) {
    var n = arguments, a = this._private.pan, i, o, s, l, u;
    if (!this._private.panningEnabled)
      return this;
    switch (n.length) {
      case 1:
        Xe(e) && (s = n[0], l = s.x, u = s.y, be(l) && (a.x += l), be(u) && (a.y += u), this.emit("pan viewport"));
        break;
      case 2:
        i = e, o = r, (i === "x" || i === "y") && be(o) && (a[i] += o), this.emit("pan viewport");
        break;
    }
    return this.notify("viewport"), this;
  },
  fit: function(e, r) {
    var n = this.getFitViewport(e, r);
    if (n) {
      var a = this._private;
      a.zoom = n.zoom, a.pan = n.pan, this.emit("pan zoom viewport"), this.notify("viewport");
    }
    return this;
  },
  getFitViewport: function(e, r) {
    if (be(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) {
      var n;
      if (Ae(e)) {
        var a = e;
        e = this.$(a);
      } else if (CT(e)) {
        var i = e;
        n = {
          x1: i.x1,
          y1: i.y1,
          x2: i.x2,
          y2: i.y2
        }, n.w = n.x2 - n.x1, n.h = n.y2 - n.y1;
      } else yr(e) || (e = this.mutableElements());
      if (!(yr(e) && e.empty())) {
        n = n || e.boundingBox();
        var o = this.width(), s = this.height(), l;
        if (r = be(r) ? r : 0, !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0) {
          l = Math.min((o - 2 * r) / n.w, (s - 2 * r) / n.h), l = l > this._private.maxZoom ? this._private.maxZoom : l, l = l < this._private.minZoom ? this._private.minZoom : l;
          var u = {
            // now pan to middle
            x: (o - l * (n.x1 + n.x2)) / 2,
            y: (s - l * (n.y1 + n.y2)) / 2
          };
          return {
            zoom: l,
            pan: u
          };
        }
      }
    }
  },
  zoomRange: function(e, r) {
    var n = this._private;
    if (r == null) {
      var a = e;
      e = a.min, r = a.max;
    }
    return be(e) && be(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : be(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : be(r) && e === void 0 && r >= n.minZoom && (n.maxZoom = r), this;
  },
  minZoom: function(e) {
    return e === void 0 ? this._private.minZoom : this.zoomRange({
      min: e
    });
  },
  maxZoom: function(e) {
    return e === void 0 ? this._private.maxZoom : this.zoomRange({
      max: e
    });
  },
  getZoomedViewport: function(e) {
    var r = this._private, n = r.pan, a = r.zoom, i, o, s = false;
    if (r.zoomingEnabled || (s = true), be(e) ? o = e : Xe(e) && (o = e.level, e.position != null ? i = il(e.position, a, n) : e.renderedPosition != null && (i = e.renderedPosition), i != null && !r.panningEnabled && (s = true)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !be(o) || o === a || i != null && (!be(i.x) || !be(i.y)))
      return null;
    if (i != null) {
      var l = n, u = a, c = o, d = {
        x: -c / u * (i.x - l.x) + i.x,
        y: -c / u * (i.y - l.y) + i.y
      };
      return {
        zoomed: true,
        panned: true,
        zoom: c,
        pan: d
      };
    } else
      return {
        zoomed: true,
        panned: false,
        zoom: o,
        pan: n
      };
  },
  zoom: function(e) {
    if (e === void 0)
      return this._private.zoom;
    var r = this.getZoomedViewport(e), n = this._private;
    return r == null || !r.zoomed ? this : (n.zoom = r.zoom, r.panned && (n.pan.x = r.pan.x, n.pan.y = r.pan.y), this.emit("zoom" + (r.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this);
  },
  viewport: function(e) {
    var r = this._private, n = true, a = true, i = [], o = false, s = false;
    if (!e)
      return this;
    if (be(e.zoom) || (n = false), Xe(e.pan) || (a = false), !n && !a)
      return this;
    if (n) {
      var l = e.zoom;
      l < r.minZoom || l > r.maxZoom || !r.zoomingEnabled ? o = true : (r.zoom = l, i.push("zoom"));
    }
    if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) {
      var u = e.pan;
      be(u.x) && (r.pan.x = u.x, s = false), be(u.y) && (r.pan.y = u.y, s = false), s || i.push("pan");
    }
    return i.length > 0 && (i.push("viewport"), this.emit(i.join(" ")), this.notify("viewport")), this;
  },
  center: function(e) {
    var r = this.getCenterPan(e);
    return r && (this._private.pan = r, this.emit("pan viewport"), this.notify("viewport")), this;
  },
  getCenterPan: function(e, r) {
    if (this._private.panningEnabled) {
      if (Ae(e)) {
        var n = e;
        e = this.mutableElements().filter(n);
      } else yr(e) || (e = this.mutableElements());
      if (e.length !== 0) {
        var a = e.boundingBox(), i = this.width(), o = this.height();
        r = r === void 0 ? this._private.zoom : r;
        var s = {
          // middle
          x: (i - r * (a.x1 + a.x2)) / 2,
          y: (o - r * (a.y1 + a.y2)) / 2
        };
        return s;
      }
    }
  },
  reset: function() {
    return !this._private.panningEnabled || !this._private.zoomingEnabled ? this : (this.viewport({
      pan: {
        x: 0,
        y: 0
      },
      zoom: 1
    }), this);
  },
  invalidateSize: function() {
    this._private.sizeCache = null;
  },
  size: function() {
    var e = this._private, r = e.container, n = this;
    return e.sizeCache = e.sizeCache || (r ? function() {
      var a = n.window().getComputedStyle(r), i = function(s) {
        return parseFloat(a.getPropertyValue(s));
      };
      return {
        width: r.clientWidth - i("padding-left") - i("padding-right"),
        height: r.clientHeight - i("padding-top") - i("padding-bottom")
      };
    }() : {
      // fallback if no container (not 0 b/c can be used for dividing etc)
      width: 1,
      height: 1
    });
  },
  width: function() {
    return this.size().width;
  },
  height: function() {
    return this.size().height;
  },
  extent: function() {
    var e = this._private.pan, r = this._private.zoom, n = this.renderedExtent(), a = {
      x1: (n.x1 - e.x) / r,
      x2: (n.x2 - e.x) / r,
      y1: (n.y1 - e.y) / r,
      y2: (n.y2 - e.y) / r
    };
    return a.w = a.x2 - a.x1, a.h = a.y2 - a.y1, a;
  },
  renderedExtent: function() {
    var e = this.width(), r = this.height();
    return {
      x1: 0,
      y1: 0,
      x2: e,
      y2: r,
      w: e,
      h: r
    };
  },
  multiClickDebounceTime: function(e) {
    if (e) this._private.multiClickDebounceTime = e;
    else return this._private.multiClickDebounceTime;
    return this;
  }
};
Ca.centre = Ca.center;
Ca.autolockNodes = Ca.autolock;
Ca.autoungrabifyNodes = Ca.autoungrabify;
var vo = {
  data: et.data({
    field: "data",
    bindingEvent: "data",
    allowBinding: true,
    allowSetting: true,
    settingEvent: "data",
    settingTriggersEvent: true,
    triggerFnName: "trigger",
    allowGetting: true,
    updateStyle: true
  }),
  removeData: et.removeData({
    field: "data",
    event: "data",
    triggerFnName: "trigger",
    triggerEvent: true,
    updateStyle: true
  }),
  scratch: et.data({
    field: "scratch",
    bindingEvent: "scratch",
    allowBinding: true,
    allowSetting: true,
    settingEvent: "scratch",
    settingTriggersEvent: true,
    triggerFnName: "trigger",
    allowGetting: true,
    updateStyle: true
  }),
  removeScratch: et.removeData({
    field: "scratch",
    event: "scratch",
    triggerFnName: "trigger",
    triggerEvent: true,
    updateStyle: true
  })
};
vo.attr = vo.data;
vo.removeAttr = vo.removeData;
var ho = function(e) {
  var r = this;
  e = ze({}, e);
  var n = e.container;
  n && !Ps(n) && Ps(n[0]) && (n = n[0]);
  var a = n ? n._cyreg : null;
  a = a || {}, a && a.cy && (a.cy.destroy(), a = {});
  var i = a.readies = a.readies || [];
  n && (n._cyreg = a), a.cy = r;
  var o = Ot !== void 0 && n !== void 0 && !e.headless, s = e;
  s.layout = ze({
    name: o ? "grid" : "null"
  }, s.layout), s.renderer = ze({
    name: o ? "canvas" : "null"
  }, s.renderer);
  var l = function(f, p, m) {
    return p !== void 0 ? p : m !== void 0 ? m : f;
  }, u = this._private = {
    container: n,
    // html dom ele container
    ready: false,
    // whether ready has been triggered
    options: s,
    // cached options
    elements: new Wt(this),
    // elements in the graph
    listeners: [],
    // list of listeners
    aniEles: new Wt(this),
    // elements being animated
    data: s.data || {},
    // data for the core
    scratch: {},
    // scratch object for core
    layout: null,
    renderer: null,
    destroyed: false,
    // whether destroy was called
    notificationsEnabled: true,
    // whether notifications are sent to the renderer
    minZoom: 1e-50,
    maxZoom: 1e50,
    zoomingEnabled: l(true, s.zoomingEnabled),
    userZoomingEnabled: l(true, s.userZoomingEnabled),
    panningEnabled: l(true, s.panningEnabled),
    userPanningEnabled: l(true, s.userPanningEnabled),
    boxSelectionEnabled: l(true, s.boxSelectionEnabled),
    autolock: l(false, s.autolock, s.autolockNodes),
    autoungrabify: l(false, s.autoungrabify, s.autoungrabifyNodes),
    autounselectify: l(false, s.autounselectify),
    styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled,
    zoom: be(s.zoom) ? s.zoom : 1,
    pan: {
      x: Xe(s.pan) && be(s.pan.x) ? s.pan.x : 0,
      y: Xe(s.pan) && be(s.pan.y) ? s.pan.y : 0
    },
    animation: {
      // object for currently-running animations
      current: [],
      queue: []
    },
    hasCompoundNodes: false,
    multiClickDebounceTime: l(250, s.multiClickDebounceTime)
  };
  this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({
    min: s.minZoom,
    max: s.maxZoom
  });
  var c = function(f, p) {
    var m = f.some(xT);
    if (m)
      return mi.all(f).then(p);
    p(f);
  };
  u.styleEnabled && r.setStyle([]);
  var d = ze({}, s, s.renderer);
  r.initRenderer(d);
  var v = function(f, p, m) {
    r.notifications(false);
    var g = r.mutableElements();
    g.length > 0 && g.remove(), f != null && (Xe(f) || st(f)) && r.add(f), r.one("layoutready", function(b) {
      r.notifications(true), r.emit(b), r.one("load", p), r.emitAndNotify("load");
    }).one("layoutstop", function() {
      r.one("done", m), r.emit("done");
    });
    var y = ze({}, r._private.options.layout);
    y.eles = r.elements(), r.layout(y).run();
  };
  c([s.style, s.elements], function(h6) {
    var f = h6[0], p = h6[1];
    u.styleEnabled && r.style().append(f), v(p, function() {
      r.startAnimationLoop(), u.ready = true, pt(s.ready) && r.on("ready", s.ready);
      for (var m = 0; m < i.length; m++) {
        var g = i[m];
        r.on("ready", g);
      }
      a && (a.readies = []), r.emit("ready");
    }, s.done);
  });
};
var Bs = ho.prototype;
ze(Bs, {
  instanceString: function() {
    return "core";
  },
  isReady: function() {
    return this._private.ready;
  },
  destroyed: function() {
    return this._private.destroyed;
  },
  ready: function(e) {
    return this.isReady() ? this.emitter().emit("ready", [], e) : this.on("ready", e), this;
  },
  destroy: function() {
    var e = this;
    if (!e.destroyed())
      return e.stopAnimationLoop(), e.destroyRenderer(), this.emit("destroy"), e._private.destroyed = true, e;
  },
  hasElementWithId: function(e) {
    return this._private.elements.hasElementWithId(e);
  },
  getElementById: function(e) {
    return this._private.elements.getElementById(e);
  },
  hasCompoundNodes: function() {
    return this._private.hasCompoundNodes;
  },
  headless: function() {
    return this._private.renderer.isHeadless();
  },
  styleEnabled: function() {
    return this._private.styleEnabled;
  },
  addToPool: function(e) {
    return this._private.elements.merge(e), this;
  },
  removeFromPool: function(e) {
    return this._private.elements.unmerge(e), this;
  },
  container: function() {
    return this._private.container || null;
  },
  window: function() {
    var e = this._private.container;
    if (e == null) return Ot;
    var r = this._private.container.ownerDocument;
    return r === void 0 || r == null ? Ot : r.defaultView || Ot;
  },
  mount: function(e) {
    if (e != null) {
      var r = this, n = r._private, a = n.options;
      return !Ps(e) && Ps(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = true, r.invalidateSize(), r.initRenderer(ze({}, a, a.renderer, {
        // allow custom renderer name to be re-used, otherwise use canvas
        name: a.renderer.name === "null" ? "canvas" : a.renderer.name
      })), r.startAnimationLoop(), r.style(a.style), r.emit("mount"), r;
    }
  },
  unmount: function() {
    var e = this;
    return e.stopAnimationLoop(), e.destroyRenderer(), e.initRenderer({
      name: "null"
    }), e.emit("unmount"), e;
  },
  options: function() {
    return jr(this._private.options);
  },
  json: function(e) {
    var r = this, n = r._private, a = r.mutableElements(), i = function(w) {
      return r.getElementById(w.id());
    };
    if (Xe(e)) {
      if (r.startBatch(), e.elements) {
        var o = {}, s = function(w, C) {
          for (var E = [], x = [], T = 0; T < w.length; T++) {
            var k = w[T];
            if (!k.data.id) {
              tt("cy.json() cannot handle elements without an ID attribute");
              continue;
            }
            var _ = "" + k.data.id, D = r.getElementById(_);
            o[_] = true, D.length !== 0 ? x.push({
              ele: D,
              json: k
            }) : (C && (k.group = C), E.push(k));
          }
          r.add(E);
          for (var O = 0; O < x.length; O++) {
            var A = x[O], L = A.ele, N = A.json;
            L.json(N);
          }
        };
        if (st(e.elements))
          s(e.elements);
        else
          for (var l = ["nodes", "edges"], u = 0; u < l.length; u++) {
            var c = l[u], d = e.elements[c];
            st(d) && s(d, c);
          }
        var v = r.collection();
        a.filter(function(b) {
          return !o[b.id()];
        }).forEach(function(b) {
          b.isParent() ? v.merge(b) : b.remove();
        }), v.forEach(function(b) {
          return b.children().move({
            parent: null
          });
        }), v.forEach(function(b) {
          return i(b).remove();
        });
      }
      e.style && r.style(e.style), e.zoom != null && e.zoom !== n.zoom && r.zoom(e.zoom), e.pan && (e.pan.x !== n.pan.x || e.pan.y !== n.pan.y) && r.pan(e.pan), e.data && r.data(e.data);
      for (var h6 = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h6.length; f++) {
        var p = h6[f];
        e[p] != null && r[p](e[p]);
      }
      return r.endBatch(), this;
    } else {
      var m = !!e, g = {};
      m ? g.elements = this.elements().map(function(b) {
        return b.json();
      }) : (g.elements = {}, a.forEach(function(b) {
        var w = b.group();
        g.elements[w] || (g.elements[w] = []), g.elements[w].push(b.json());
      })), this._private.styleEnabled && (g.style = r.style().json()), g.data = jr(r.data());
      var y = n.options;
      return g.zoomingEnabled = n.zoomingEnabled, g.userZoomingEnabled = n.userZoomingEnabled, g.zoom = n.zoom, g.minZoom = n.minZoom, g.maxZoom = n.maxZoom, g.panningEnabled = n.panningEnabled, g.userPanningEnabled = n.userPanningEnabled, g.pan = jr(n.pan), g.boxSelectionEnabled = n.boxSelectionEnabled, g.renderer = jr(y.renderer), g.hideEdgesOnViewport = y.hideEdgesOnViewport, g.textureOnViewport = y.textureOnViewport, g.wheelSensitivity = y.wheelSensitivity, g.motionBlur = y.motionBlur, g.multiClickDebounceTime = y.multiClickDebounceTime, g;
    }
  }
});
Bs.$id = Bs.getElementById;
[lP, vP, Jp, gu, hs, pP, mu, ps, yP, Ca, vo].forEach(function(t13) {
  ze(Bs, t13);
});
var wP = {
  fit: true,
  // whether to fit the viewport to the graph
  directed: false,
  // whether the tree is directed downwards (or edges can point in any direction if false)
  padding: 30,
  // padding on fit
  circle: false,
  // put depths in concentric circles if true, put depths top down if false
  grid: false,
  // whether to create an even grid into which the DAG is placed (circle:false only)
  spacingFactor: 1.75,
  // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap)
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: true,
  // prevents node overlap, may overflow boundingBox if not enough space
  nodeDimensionsIncludeLabels: false,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  roots: void 0,
  // the roots of the trees
  depthSort: void 0,
  // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled,
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
};
var CP = {
  maximal: false,
  // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also
  acyclic: false
  // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops
};
var Na = function(e) {
  return e.scratch("breadthfirst");
};
var Zf = function(e, r) {
  return e.scratch("breadthfirst", r);
};
function eg(t13) {
  this.options = ze({}, wP, CP, t13);
}
eg.prototype.run = function() {
  var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().filter(function(ve) {
    return !ve.isParent();
  }), i = n, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, l = pr(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  }), u;
  if (yr(e.roots))
    u = e.roots;
  else if (st(e.roots)) {
    for (var c = [], d = 0; d < e.roots.length; d++) {
      var v = e.roots[d], h6 = r.getElementById(v);
      c.push(h6);
    }
    u = r.collection(c);
  } else if (Ae(e.roots))
    u = r.$(e.roots);
  else if (o)
    u = a.roots();
  else {
    var f = n.components();
    u = r.collection();
    for (var p = function(me) {
      var Ce = f[me], ke = Ce.maxDegree(false), xe = Ce.filter(function(Pe) {
        return Pe.degree(false) === ke;
      });
      u = u.add(xe);
    }, m = 0; m < f.length; m++)
      p(m);
  }
  var g = [], y = {}, b = function(me, Ce) {
    g[Ce] == null && (g[Ce] = []);
    var ke = g[Ce].length;
    g[Ce].push(me), Zf(me, {
      index: ke,
      depth: Ce
    });
  }, w = function(me, Ce) {
    var ke = Na(me), xe = ke.depth, Pe = ke.index;
    g[xe][Pe] = null, b(me, Ce);
  };
  i.bfs({
    roots: u,
    directed: e.directed,
    visit: function(me, Ce, ke, xe, Pe) {
      var Ke = me[0], qe = Ke.id();
      b(Ke, Pe), y[qe] = true;
    }
  });
  for (var C = [], E = 0; E < a.length; E++) {
    var x = a[E];
    y[x.id()] || C.push(x);
  }
  var T = function(me) {
    for (var Ce = g[me], ke = 0; ke < Ce.length; ke++) {
      var xe = Ce[ke];
      if (xe == null) {
        Ce.splice(ke, 1), ke--;
        continue;
      }
      Zf(xe, {
        depth: me,
        index: ke
      });
    }
  }, k = function() {
    for (var me = 0; me < g.length; me++)
      T(me);
  }, _ = function(me, Ce) {
    for (var ke = Na(me), xe = me.incomers().filter(function(S) {
      return S.isNode() && n.has(S);
    }), Pe = -1, Ke = me.id(), qe = 0; qe < xe.length; qe++) {
      var Ne = xe[qe], Ge = Na(Ne);
      Pe = Math.max(Pe, Ge.depth);
    }
    if (ke.depth <= Pe) {
      if (!e.acyclic && Ce[Ke])
        return null;
      var le = Pe + 1;
      return w(me, le), Ce[Ke] = le, true;
    }
    return false;
  };
  if (o && s) {
    var D = [], O = {}, A = function(me) {
      return D.push(me);
    }, L = function() {
      return D.shift();
    };
    for (a.forEach(function(ve) {
      return D.push(ve);
    }); D.length > 0; ) {
      var N = L(), I = _(N, O);
      if (I)
        N.outgoers().filter(function(ve) {
          return ve.isNode() && n.has(ve);
        }).forEach(A);
      else if (I === null) {
        tt("Detected double maximal shift for node `" + N.id() + "`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");
        break;
      }
    }
  }
  k();
  var M = 0;
  if (e.avoidOverlap)
    for (var F = 0; F < a.length; F++) {
      var $ = a[F], U = $.layoutDimensions(e), H = U.w, K = U.h;
      M = Math.max(M, H, K);
    }
  var ee = {}, se = function(me) {
    if (ee[me.id()])
      return ee[me.id()];
    for (var Ce = Na(me).depth, ke = me.neighborhood(), xe = 0, Pe = 0, Ke = 0; Ke < ke.length; Ke++) {
      var qe = ke[Ke];
      if (!(qe.isEdge() || qe.isParent() || !a.has(qe))) {
        var Ne = Na(qe);
        if (Ne != null) {
          var Ge = Ne.index, le = Ne.depth;
          if (!(Ge == null || le == null)) {
            var S = g[le].length;
            le < Ce && (xe += Ge / S, Pe++);
          }
        }
      }
    }
    return Pe = Math.max(1, Pe), xe = xe / Pe, Pe === 0 && (xe = 0), ee[me.id()] = xe, xe;
  }, oe = function(me, Ce) {
    var ke = se(me), xe = se(Ce), Pe = ke - xe;
    return Pe === 0 ? ep(me.id(), Ce.id()) : Pe;
  };
  e.depthSort !== void 0 && (oe = e.depthSort);
  for (var ne = 0; ne < g.length; ne++)
    g[ne].sort(oe), T(ne);
  for (var ue = [], te = 0; te < C.length; te++)
    ue.push(C[te]);
  g.unshift(ue), k();
  for (var R = 0, Y = 0; Y < g.length; Y++)
    R = Math.max(g[Y].length, R);
  var J = {
    x: l.x1 + l.w / 2,
    y: l.x1 + l.h / 2
  }, ge = g.reduce(function(ve, me) {
    return Math.max(ve, me.length);
  }, 0), Ee = function(me) {
    var Ce = Na(me), ke = Ce.depth, xe = Ce.index, Pe = g[ke].length, Ke = Math.max(l.w / ((e.grid ? ge : Pe) + 1), M), qe = Math.max(l.h / (g.length + 1), M), Ne = Math.min(l.w / 2 / g.length, l.h / 2 / g.length);
    if (Ne = Math.max(Ne, M), e.circle) {
      var le = Ne * ke + Ne - (g.length > 0 && g[0].length <= 3 ? Ne / 2 : 0), S = 2 * Math.PI / g[ke].length * xe;
      return ke === 0 && g[0].length === 1 && (le = 1), {
        x: J.x + le * Math.cos(S),
        y: J.y + le * Math.sin(S)
      };
    } else {
      var Ge = {
        x: J.x + (xe + 1 - (Pe + 1) / 2) * Ke,
        y: (ke + 1) * qe
      };
      return Ge;
    }
  };
  return n.nodes().layoutPositions(this, e, Ee), this;
};
var xP = {
  fit: true,
  // whether to fit the viewport to the graph
  padding: 30,
  // the padding on fit
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: true,
  // prevents node overlap, may overflow boundingBox and radius if not enough space
  nodeDimensionsIncludeLabels: false,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  radius: void 0,
  // the radius of the circle
  startAngle: 3 / 2 * Math.PI,
  // where nodes start in radians
  sweep: void 0,
  // how many radians should be between the first and last node (defaults to full circle)
  clockwise: true,
  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
  sort: void 0,
  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function tg(t13) {
  this.options = ze({}, xP, t13);
}
tg.prototype.run = function() {
  var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = n.nodes().not(":parent");
  e.sort && (i = i.sort(e.sort));
  for (var o = pr(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  }), s = {
    x: o.x1 + o.w / 2,
    y: o.y1 + o.h / 2
  }, l = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / i.length : e.sweep, u = l / Math.max(1, i.length - 1), c, d = 0, v = 0; v < i.length; v++) {
    var h6 = i[v], f = h6.layoutDimensions(e), p = f.w, m = f.h;
    d = Math.max(d, p, m);
  }
  if (be(e.radius) ? c = e.radius : i.length <= 1 ? c = 0 : c = Math.min(o.h, o.w) / 2 - d, i.length > 1 && e.avoidOverlap) {
    d *= 1.75;
    var g = Math.cos(u) - Math.cos(0), y = Math.sin(u) - Math.sin(0), b = Math.sqrt(d * d / (g * g + y * y));
    c = Math.max(b, c);
  }
  var w = function(E, x) {
    var T = e.startAngle + x * u * (a ? 1 : -1), k = c * Math.cos(T), _ = c * Math.sin(T), D = {
      x: s.x + k,
      y: s.y + _
    };
    return D;
  };
  return n.nodes().layoutPositions(this, e, w), this;
};
var EP = {
  fit: true,
  // whether to fit the viewport to the graph
  padding: 30,
  // the padding on fit
  startAngle: 3 / 2 * Math.PI,
  // where nodes start in radians
  sweep: void 0,
  // how many radians should be between the first and last node (defaults to full circle)
  clockwise: true,
  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
  equidistant: false,
  // whether levels have an equal radial distance betwen them, may cause bounding box overflow
  minNodeSpacing: 10,
  // min spacing between outside of nodes (used for radius adjustment)
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: true,
  // prevents node overlap, may overflow boundingBox if not enough space
  nodeDimensionsIncludeLabels: false,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  height: void 0,
  // height of layout area (overrides container height)
  width: void 0,
  // width of layout area (overrides container width)
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  concentric: function(e) {
    return e.degree();
  },
  levelWidth: function(e) {
    return e.maxDegree() / 4;
  },
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
};
function rg(t13) {
  this.options = ze({}, EP, t13);
}
rg.prototype.run = function() {
  for (var t13 = this.options, e = t13, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, n = t13.cy, a = e.eles, i = a.nodes().not(":parent"), o = pr(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: n.width(),
    h: n.height()
  }), s = {
    x: o.x1 + o.w / 2,
    y: o.y1 + o.h / 2
  }, l = [], u = 0, c = 0; c < i.length; c++) {
    var d = i[c], v = void 0;
    v = e.concentric(d), l.push({
      value: v,
      node: d
    }), d._private.scratch.concentric = v;
  }
  i.updateStyle();
  for (var h6 = 0; h6 < i.length; h6++) {
    var f = i[h6], p = f.layoutDimensions(e);
    u = Math.max(u, p.w, p.h);
  }
  l.sort(function(ve, me) {
    return me.value - ve.value;
  });
  for (var m = e.levelWidth(i), g = [[]], y = g[0], b = 0; b < l.length; b++) {
    var w = l[b];
    if (y.length > 0) {
      var C = Math.abs(y[0].value - w.value);
      C >= m && (y = [], g.push(y));
    }
    y.push(w);
  }
  var E = u + e.minNodeSpacing;
  if (!e.avoidOverlap) {
    var x = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - E, k = T / (g.length + x ? 1 : 0);
    E = Math.min(E, k);
  }
  for (var _ = 0, D = 0; D < g.length; D++) {
    var O = g[D], A = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, L = O.dTheta = A / Math.max(1, O.length - 1);
    if (O.length > 1 && e.avoidOverlap) {
      var N = Math.cos(L) - Math.cos(0), I = Math.sin(L) - Math.sin(0), M = Math.sqrt(E * E / (N * N + I * I));
      _ = Math.max(M, _);
    }
    O.r = _, _ += E;
  }
  if (e.equidistant) {
    for (var F = 0, $ = 0, U = 0; U < g.length; U++) {
      var H = g[U], K = H.r - $;
      F = Math.max(F, K);
    }
    $ = 0;
    for (var ee = 0; ee < g.length; ee++) {
      var se = g[ee];
      ee === 0 && ($ = se.r), se.r = $, $ += F;
    }
  }
  for (var oe = {}, ne = 0; ne < g.length; ne++)
    for (var ue = g[ne], te = ue.dTheta, R = ue.r, Y = 0; Y < ue.length; Y++) {
      var J = ue[Y], ge = e.startAngle + (r ? 1 : -1) * te * Y, Ee = {
        x: s.x + R * Math.cos(ge),
        y: s.y + R * Math.sin(ge)
      };
      oe[J.node.id()] = Ee;
    }
  return a.nodes().layoutPositions(this, e, function(ve) {
    var me = ve.id();
    return oe[me];
  }), this;
};
var ql;
var kP = {
  // Called on `layoutready`
  ready: function() {
  },
  // Called on `layoutstop`
  stop: function() {
  },
  // Whether to animate while running the layout
  // true : Animate continuously as the layout is running
  // false : Just show the end result
  // 'end' : Animate with the end result, from the initial positions to the end positions
  animate: true,
  // Easing of the animation for animate:'end'
  animationEasing: void 0,
  // The duration of the animation for animate:'end'
  animationDuration: void 0,
  // A function that determines whether the node should be animated
  // All nodes animated by default on animate enabled
  // Non-animated nodes are positioned immediately when the layout starts
  animateFilter: function(e, r) {
    return true;
  },
  // The layout animates only after this many milliseconds for animate:true
  // (prevents flashing on fast runs)
  animationThreshold: 250,
  // Number of iterations between consecutive screen positions update
  refresh: 20,
  // Whether to fit the network view after when done
  fit: true,
  // Padding on fit
  padding: 30,
  // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  boundingBox: void 0,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  nodeDimensionsIncludeLabels: false,
  // Randomize the initial positions of the nodes (true) or use existing positions (false)
  randomize: false,
  // Extra spacing between components in non-compound graphs
  componentSpacing: 40,
  // Node repulsion (non overlapping) multiplier
  nodeRepulsion: function(e) {
    return 2048;
  },
  // Node repulsion (overlapping) multiplier
  nodeOverlap: 4,
  // Ideal edge (non nested) length
  idealEdgeLength: function(e) {
    return 32;
  },
  // Divisor to compute edge forces
  edgeElasticity: function(e) {
    return 32;
  },
  // Nesting factor (multiplier) to compute ideal edge length for nested edges
  nestingFactor: 1.2,
  // Gravity force (constant)
  gravity: 1,
  // Maximum number of iterations to perform
  numIter: 1e3,
  // Initial temperature (maximum node displacement)
  initialTemp: 1e3,
  // Cooling factor (how the temperature is reduced between consecutive iterations
  coolingFactor: 0.99,
  // Lower temperature threshold (below this point the layout will end)
  minTemp: 1
};
function gl(t13) {
  this.options = ze({}, kP, t13), this.options.layout = this;
  var e = this.options.eles.nodes(), r = this.options.eles.edges(), n = r.filter(function(a) {
    var i = a.source().data("id"), o = a.target().data("id"), s = e.some(function(u) {
      return u.data("id") === i;
    }), l = e.some(function(u) {
      return u.data("id") === o;
    });
    return !s || !l;
  });
  this.options.eles = this.options.eles.not(n);
}
gl.prototype.run = function() {
  var t13 = this.options, e = t13.cy, r = this;
  r.stopped = false, (t13.animate === true || t13.animate === false) && r.emit({
    type: "layoutstart",
    layout: r
  }), t13.debug === true ? ql = true : ql = false;
  var n = SP(e, r, t13);
  ql && DP(n), t13.randomize && PP(n);
  var a = gn(), i = function() {
    OP(n, e, t13), t13.fit === true && e.fit(t13.padding);
  }, o = function(v) {
    return !(r.stopped || v >= t13.numIter || (LP(n, t13), n.temperature = n.temperature * t13.coolingFactor, n.temperature < t13.minTemp));
  }, s = function() {
    if (t13.animate === true || t13.animate === false)
      i(), r.one("layoutstop", t13.stop), r.emit({
        type: "layoutstop",
        layout: r
      });
    else {
      var v = t13.eles.nodes(), h6 = ng(n, t13, v);
      v.layoutPositions(r, t13, h6);
    }
  }, l = 0, u = true;
  if (t13.animate === true) {
    var c = function d() {
      for (var v = 0; u && v < t13.refresh; )
        u = o(l), l++, v++;
      if (!u)
        Qf(n, t13), s();
      else {
        var h6 = gn();
        h6 - a >= t13.animationThreshold && i(), Os(d);
      }
    };
    c();
  } else {
    for (; u; )
      u = o(l), l++;
    Qf(n, t13), s();
  }
  return this;
};
gl.prototype.stop = function() {
  return this.stopped = true, this.thread && this.thread.stop(), this.emit("layoutstop"), this;
};
gl.prototype.destroy = function() {
  return this.thread && this.thread.stop(), this;
};
var SP = function(e, r, n) {
  for (var a = n.eles.edges(), i = n.eles.nodes(), o = pr(n.boundingBox ? n.boundingBox : {
    x1: 0,
    y1: 0,
    w: e.width(),
    h: e.height()
  }), s = {
    isCompound: e.hasCompoundNodes(),
    layoutNodes: [],
    idToIndex: {},
    nodeSize: i.size(),
    graphSet: [],
    indexToGraph: [],
    layoutEdges: [],
    edgeSize: a.size(),
    temperature: n.initialTemp,
    clientWidth: o.w,
    clientHeight: o.h,
    boundingBox: o
  }, l = n.eles.components(), u = {}, c = 0; c < l.length; c++)
    for (var d = l[c], v = 0; v < d.length; v++) {
      var h6 = d[v];
      u[h6.id()] = c;
    }
  for (var c = 0; c < s.nodeSize; c++) {
    var f = i[c], p = f.layoutDimensions(n), m = {};
    m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = u[f.id()], m.children = [], m.positionX = f.position("x"), m.positionY = f.position("y"), m.offsetX = 0, m.offsetY = 0, m.height = p.w, m.width = p.h, m.maxX = m.positionX + m.width / 2, m.minX = m.positionX - m.width / 2, m.maxY = m.positionY + m.height / 2, m.minY = m.positionY - m.height / 2, m.padLeft = parseFloat(f.style("padding")), m.padRight = parseFloat(f.style("padding")), m.padTop = parseFloat(f.style("padding")), m.padBottom = parseFloat(f.style("padding")), m.nodeRepulsion = pt(n.nodeRepulsion) ? n.nodeRepulsion(f) : n.nodeRepulsion, s.layoutNodes.push(m), s.idToIndex[m.id] = c;
  }
  for (var g = [], y = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) {
    var f = s.layoutNodes[c], C = f.parentId;
    C != null ? s.layoutNodes[s.idToIndex[C]].children.push(f.id) : (g[++b] = f.id, w.push(f.id));
  }
  for (s.graphSet.push(w); y <= b; ) {
    var E = g[y++], x = s.idToIndex[E], h6 = s.layoutNodes[x], T = h6.children;
    if (T.length > 0) {
      s.graphSet.push(T);
      for (var c = 0; c < T.length; c++)
        g[++b] = T[c];
    }
  }
  for (var c = 0; c < s.graphSet.length; c++)
    for (var k = s.graphSet[c], v = 0; v < k.length; v++) {
      var _ = s.idToIndex[k[v]];
      s.indexToGraph[_] = c;
    }
  for (var c = 0; c < s.edgeSize; c++) {
    var D = a[c], O = {};
    O.id = D.data("id"), O.sourceId = D.data("source"), O.targetId = D.data("target");
    var A = pt(n.idealEdgeLength) ? n.idealEdgeLength(D) : n.idealEdgeLength, L = pt(n.edgeElasticity) ? n.edgeElasticity(D) : n.edgeElasticity, N = s.idToIndex[O.sourceId], I = s.idToIndex[O.targetId], M = s.indexToGraph[N], F = s.indexToGraph[I];
    if (M != F) {
      for (var $ = TP(O.sourceId, O.targetId, s), U = s.graphSet[$], H = 0, m = s.layoutNodes[N]; U.indexOf(m.id) === -1; )
        m = s.layoutNodes[s.idToIndex[m.parentId]], H++;
      for (m = s.layoutNodes[I]; U.indexOf(m.id) === -1; )
        m = s.layoutNodes[s.idToIndex[m.parentId]], H++;
      A *= H * n.nestingFactor;
    }
    O.idealLength = A, O.elasticity = L, s.layoutEdges.push(O);
  }
  return s;
};
var TP = function(e, r, n) {
  var a = _P(e, r, 0, n);
  return 2 > a.count ? 0 : a.graph;
};
var _P = function t10(e, r, n, a) {
  var i = a.graphSet[n];
  if (-1 < i.indexOf(e) && -1 < i.indexOf(r))
    return {
      count: 2,
      graph: n
    };
  for (var o = 0, s = 0; s < i.length; s++) {
    var l = i[s], u = a.idToIndex[l], c = a.layoutNodes[u].children;
    if (c.length !== 0) {
      var d = a.indexToGraph[a.idToIndex[c[0]]], v = t10(e, r, d, a);
      if (v.count !== 0)
        if (v.count === 1) {
          if (o++, o === 2)
            break;
        } else
          return v;
    }
  }
  return {
    count: o,
    graph: n
  };
};
var DP;
var PP = function(e, r) {
  for (var n = e.clientWidth, a = e.clientHeight, i = 0; i < e.nodeSize; i++) {
    var o = e.layoutNodes[i];
    o.children.length === 0 && !o.isLocked && (o.positionX = Math.random() * n, o.positionY = Math.random() * a);
  }
};
var ng = function(e, r, n) {
  var a = e.boundingBox, i = {
    x1: 1 / 0,
    x2: -1 / 0,
    y1: 1 / 0,
    y2: -1 / 0
  };
  return r.boundingBox && (n.forEach(function(o) {
    var s = e.layoutNodes[e.idToIndex[o.data("id")]];
    i.x1 = Math.min(i.x1, s.positionX), i.x2 = Math.max(i.x2, s.positionX), i.y1 = Math.min(i.y1, s.positionY), i.y2 = Math.max(i.y2, s.positionY);
  }), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1), function(o, s) {
    var l = e.layoutNodes[e.idToIndex[o.data("id")]];
    if (r.boundingBox) {
      var u = (l.positionX - i.x1) / i.w, c = (l.positionY - i.y1) / i.h;
      return {
        x: a.x1 + u * a.w,
        y: a.y1 + c * a.h
      };
    } else
      return {
        x: l.positionX,
        y: l.positionY
      };
  };
};
var OP = function(e, r, n) {
  var a = n.layout, i = n.eles.nodes(), o = ng(e, n, i);
  i.positions(o), e.ready !== true && (e.ready = true, a.one("layoutready", n.ready), a.emit({
    type: "layoutready",
    layout: this
  }));
};
var LP = function(e, r, n) {
  IP(e, r), MP(e), BP(e, r), NP(e), RP(e);
};
var IP = function(e, r) {
  for (var n = 0; n < e.graphSet.length; n++)
    for (var a = e.graphSet[n], i = a.length, o = 0; o < i; o++)
      for (var s = e.layoutNodes[e.idToIndex[a[o]]], l = o + 1; l < i; l++) {
        var u = e.layoutNodes[e.idToIndex[a[l]]];
        AP(s, u, e, r);
      }
};
var Xf = function(e) {
  return -e + 2 * e * Math.random();
};
var AP = function(e, r, n, a) {
  var i = e.cmptId, o = r.cmptId;
  if (!(i !== o && !n.isCompound)) {
    var s = r.positionX - e.positionX, l = r.positionY - e.positionY, u = 1;
    s === 0 && l === 0 && (s = Xf(u), l = Xf(u));
    var c = FP(e, r, s, l);
    if (c > 0)
      var d = a.nodeOverlap * c, v = Math.sqrt(s * s + l * l), h6 = d * s / v, f = d * l / v;
    else
      var p = Ns(e, s, l), m = Ns(r, -1 * s, -1 * l), g = m.x - p.x, y = m.y - p.y, b = g * g + y * y, v = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h6 = d * g / v, f = d * y / v;
    e.isLocked || (e.offsetX -= h6, e.offsetY -= f), r.isLocked || (r.offsetX += h6, r.offsetY += f);
  }
};
var FP = function(e, r, n, a) {
  if (n > 0)
    var i = e.maxX - r.minX;
  else
    var i = r.maxX - e.minX;
  if (a > 0)
    var o = e.maxY - r.minY;
  else
    var o = r.maxY - e.minY;
  return i >= 0 && o >= 0 ? Math.sqrt(i * i + o * o) : 0;
};
var Ns = function(e, r, n) {
  var a = e.positionX, i = e.positionY, o = e.height || 1, s = e.width || 1, l = n / r, u = o / s, c = {};
  return r === 0 && 0 < n || r === 0 && 0 > n ? (c.x = a, c.y = i + o / 2, c) : 0 < r && -1 * u <= l && l <= u ? (c.x = a + s / 2, c.y = i + s * n / 2 / r, c) : 0 > r && -1 * u <= l && l <= u ? (c.x = a - s / 2, c.y = i - s * n / 2 / r, c) : 0 < n && (l <= -1 * u || l >= u) ? (c.x = a + o * r / 2 / n, c.y = i + o / 2, c) : (0 > n && (l <= -1 * u || l >= u) && (c.x = a - o * r / 2 / n, c.y = i - o / 2), c);
};
var MP = function(e, r) {
  for (var n = 0; n < e.edgeSize; n++) {
    var a = e.layoutEdges[n], i = e.idToIndex[a.sourceId], o = e.layoutNodes[i], s = e.idToIndex[a.targetId], l = e.layoutNodes[s], u = l.positionX - o.positionX, c = l.positionY - o.positionY;
    if (!(u === 0 && c === 0)) {
      var d = Ns(o, u, c), v = Ns(l, -1 * u, -1 * c), h6 = v.x - d.x, f = v.y - d.y, p = Math.sqrt(h6 * h6 + f * f), m = Math.pow(a.idealLength - p, 2) / a.elasticity;
      if (p !== 0)
        var g = m * h6 / p, y = m * f / p;
      else
        var g = 0, y = 0;
      o.isLocked || (o.offsetX += g, o.offsetY += y), l.isLocked || (l.offsetX -= g, l.offsetY -= y);
    }
  }
};
var BP = function(e, r) {
  if (r.gravity !== 0)
    for (var n = 1, a = 0; a < e.graphSet.length; a++) {
      var i = e.graphSet[a], o = i.length;
      if (a === 0)
        var s = e.clientHeight / 2, l = e.clientWidth / 2;
      else
        var u = e.layoutNodes[e.idToIndex[i[0]]], c = e.layoutNodes[e.idToIndex[u.parentId]], s = c.positionX, l = c.positionY;
      for (var d = 0; d < o; d++) {
        var v = e.layoutNodes[e.idToIndex[i[d]]];
        if (!v.isLocked) {
          var h6 = s - v.positionX, f = l - v.positionY, p = Math.sqrt(h6 * h6 + f * f);
          if (p > n) {
            var m = r.gravity * h6 / p, g = r.gravity * f / p;
            v.offsetX += m, v.offsetY += g;
          }
        }
      }
    }
};
var NP = function(e, r) {
  var n = [], a = 0, i = -1;
  for (n.push.apply(n, e.graphSet[0]), i += e.graphSet[0].length; a <= i; ) {
    var o = n[a++], s = e.idToIndex[o], l = e.layoutNodes[s], u = l.children;
    if (0 < u.length && !l.isLocked) {
      for (var c = l.offsetX, d = l.offsetY, v = 0; v < u.length; v++) {
        var h6 = e.layoutNodes[e.idToIndex[u[v]]];
        h6.offsetX += c, h6.offsetY += d, n[++i] = u[v];
      }
      l.offsetX = 0, l.offsetY = 0;
    }
  }
};
var RP = function(e, r) {
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    0 < a.children.length && (a.maxX = void 0, a.minX = void 0, a.maxY = void 0, a.minY = void 0);
  }
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    if (!(0 < a.children.length || a.isLocked)) {
      var i = $P(a.offsetX, a.offsetY, e.temperature);
      a.positionX += i.x, a.positionY += i.y, a.offsetX = 0, a.offsetY = 0, a.minX = a.positionX - a.width, a.maxX = a.positionX + a.width, a.minY = a.positionY - a.height, a.maxY = a.positionY + a.height, zP(a, e);
    }
  }
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    0 < a.children.length && !a.isLocked && (a.positionX = (a.maxX + a.minX) / 2, a.positionY = (a.maxY + a.minY) / 2, a.width = a.maxX - a.minX, a.height = a.maxY - a.minY);
  }
};
var $P = function(e, r, n) {
  var a = Math.sqrt(e * e + r * r);
  if (a > n)
    var i = {
      x: n * e / a,
      y: n * r / a
    };
  else
    var i = {
      x: e,
      y: r
    };
  return i;
};
var zP = function t11(e, r) {
  var n = e.parentId;
  if (n != null) {
    var a = r.layoutNodes[r.idToIndex[n]], i = false;
    if ((a.maxX == null || e.maxX + a.padRight > a.maxX) && (a.maxX = e.maxX + a.padRight, i = true), (a.minX == null || e.minX - a.padLeft < a.minX) && (a.minX = e.minX - a.padLeft, i = true), (a.maxY == null || e.maxY + a.padBottom > a.maxY) && (a.maxY = e.maxY + a.padBottom, i = true), (a.minY == null || e.minY - a.padTop < a.minY) && (a.minY = e.minY - a.padTop, i = true), i)
      return t11(a, r);
  }
};
var Qf = function(e, r) {
  for (var n = e.layoutNodes, a = [], i = 0; i < n.length; i++) {
    var o = n[i], s = o.cmptId, l = a[s] = a[s] || [];
    l.push(o);
  }
  for (var u = 0, i = 0; i < a.length; i++) {
    var c = a[i];
    if (c) {
      c.x1 = 1 / 0, c.x2 = -1 / 0, c.y1 = 1 / 0, c.y2 = -1 / 0;
      for (var d = 0; d < c.length; d++) {
        var v = c[d];
        c.x1 = Math.min(c.x1, v.positionX - v.width / 2), c.x2 = Math.max(c.x2, v.positionX + v.width / 2), c.y1 = Math.min(c.y1, v.positionY - v.height / 2), c.y2 = Math.max(c.y2, v.positionY + v.height / 2);
      }
      c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, u += c.w * c.h;
    }
  }
  a.sort(function(y, b) {
    return b.w * b.h - y.w * y.h;
  });
  for (var h6 = 0, f = 0, p = 0, m = 0, g = Math.sqrt(u) * e.clientWidth / e.clientHeight, i = 0; i < a.length; i++) {
    var c = a[i];
    if (c) {
      for (var d = 0; d < c.length; d++) {
        var v = c[d];
        v.isLocked || (v.positionX += h6 - c.x1, v.positionY += f - c.y1);
      }
      h6 += c.w + r.componentSpacing, p += c.w + r.componentSpacing, m = Math.max(m, c.h), p > g && (f += m + r.componentSpacing, h6 = 0, p = 0, m = 0);
    }
  }
};
var VP = {
  fit: true,
  // whether to fit the viewport to the graph
  padding: 30,
  // padding used on fit
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: true,
  // prevents node overlap, may overflow boundingBox if not enough space
  avoidOverlapPadding: 10,
  // extra spacing around nodes when avoidOverlap: true
  nodeDimensionsIncludeLabels: false,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  condense: false,
  // uses all available space on false, uses minimal space on true
  rows: void 0,
  // force num of rows in the grid
  cols: void 0,
  // force num of columns in the grid
  position: function(e) {
  },
  // returns { row, col } for element
  sort: void 0,
  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function ag(t13) {
  this.options = ze({}, VP, t13);
}
ag.prototype.run = function() {
  var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().not(":parent");
  e.sort && (a = a.sort(e.sort));
  var i = pr(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  });
  if (i.h === 0 || i.w === 0)
    n.nodes().layoutPositions(this, e, function(ee) {
      return {
        x: i.x1,
        y: i.y1
      };
    });
  else {
    var o = a.size(), s = Math.sqrt(o * i.h / i.w), l = Math.round(s), u = Math.round(i.w / i.h * s), c = function(se) {
      if (se == null)
        return Math.min(l, u);
      var oe = Math.min(l, u);
      oe == l ? l = se : u = se;
    }, d = function(se) {
      if (se == null)
        return Math.max(l, u);
      var oe = Math.max(l, u);
      oe == l ? l = se : u = se;
    }, v = e.rows, h6 = e.cols != null ? e.cols : e.columns;
    if (v != null && h6 != null)
      l = v, u = h6;
    else if (v != null && h6 == null)
      l = v, u = Math.ceil(o / l);
    else if (v == null && h6 != null)
      u = h6, l = Math.ceil(o / u);
    else if (u * l > o) {
      var f = c(), p = d();
      (f - 1) * p >= o ? c(f - 1) : (p - 1) * f >= o && d(p - 1);
    } else
      for (; u * l < o; ) {
        var m = c(), g = d();
        (g + 1) * m >= o ? d(g + 1) : c(m + 1);
      }
    var y = i.w / u, b = i.h / l;
    if (e.condense && (y = 0, b = 0), e.avoidOverlap)
      for (var w = 0; w < a.length; w++) {
        var C = a[w], E = C._private.position;
        (E.x == null || E.y == null) && (E.x = 0, E.y = 0);
        var x = C.layoutDimensions(e), T = e.avoidOverlapPadding, k = x.w + T, _ = x.h + T;
        y = Math.max(y, k), b = Math.max(b, _);
      }
    for (var D = {}, O = function(se, oe) {
      return !!D["c-" + se + "-" + oe];
    }, A = function(se, oe) {
      D["c-" + se + "-" + oe] = true;
    }, L = 0, N = 0, I = function() {
      N++, N >= u && (N = 0, L++);
    }, M = {}, F = 0; F < a.length; F++) {
      var $ = a[F], U = e.position($);
      if (U && (U.row !== void 0 || U.col !== void 0)) {
        var H = {
          row: U.row,
          col: U.col
        };
        if (H.col === void 0)
          for (H.col = 0; O(H.row, H.col); )
            H.col++;
        else if (H.row === void 0)
          for (H.row = 0; O(H.row, H.col); )
            H.row++;
        M[$.id()] = H, A(H.row, H.col);
      }
    }
    var K = function(se, oe) {
      var ne, ue;
      if (se.locked() || se.isParent())
        return false;
      var te = M[se.id()];
      if (te)
        ne = te.col * y + y / 2 + i.x1, ue = te.row * b + b / 2 + i.y1;
      else {
        for (; O(L, N); )
          I();
        ne = N * y + y / 2 + i.x1, ue = L * b + b / 2 + i.y1, A(L, N), I();
      }
      return {
        x: ne,
        y: ue
      };
    };
    a.layoutPositions(this, e, K);
  }
  return this;
};
var HP = {
  ready: function() {
  },
  // on layoutready
  stop: function() {
  }
  // on layoutstop
};
function Tc(t13) {
  this.options = ze({}, HP, t13);
}
Tc.prototype.run = function() {
  var t13 = this.options, e = t13.eles, r = this;
  return t13.cy, r.emit("layoutstart"), e.nodes().positions(function() {
    return {
      x: 0,
      y: 0
    };
  }), r.one("layoutready", t13.ready), r.emit("layoutready"), r.one("layoutstop", t13.stop), r.emit("layoutstop"), this;
};
Tc.prototype.stop = function() {
  return this;
};
var KP = {
  positions: void 0,
  // map of (node id) => (position obj); or function(node){ return somPos; }
  zoom: void 0,
  // the zoom level to set (prob want fit = false if set)
  pan: void 0,
  // the pan level to set (prob want fit = false if set)
  fit: true,
  // whether to fit to viewport
  padding: 30,
  // padding on fit
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
};
function ig(t13) {
  this.options = ze({}, KP, t13);
}
ig.prototype.run = function() {
  var t13 = this.options, e = t13.eles, r = e.nodes(), n = pt(t13.positions);
  function a(i) {
    if (t13.positions == null)
      return W5(i.position());
    if (n)
      return t13.positions(i);
    var o = t13.positions[i._private.data.id];
    return o ?? null;
  }
  return r.layoutPositions(this, t13, function(i, o) {
    var s = a(i);
    return i.locked() || s == null ? false : s;
  }), this;
};
var qP = {
  fit: true,
  // whether to fit to viewport
  padding: 30,
  // fit padding
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  animate: false,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return true;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function og(t13) {
  this.options = ze({}, qP, t13);
}
og.prototype.run = function() {
  var t13 = this.options, e = t13.cy, r = t13.eles, n = pr(t13.boundingBox ? t13.boundingBox : {
    x1: 0,
    y1: 0,
    w: e.width(),
    h: e.height()
  }), a = function(o, s) {
    return {
      x: n.x1 + Math.round(Math.random() * n.w),
      y: n.y1 + Math.round(Math.random() * n.h)
    };
  };
  return r.nodes().layoutPositions(this, t13, a), this;
};
var UP = [{
  name: "breadthfirst",
  impl: eg
}, {
  name: "circle",
  impl: tg
}, {
  name: "concentric",
  impl: rg
}, {
  name: "cose",
  impl: gl
}, {
  name: "grid",
  impl: ag
}, {
  name: "null",
  impl: Tc
}, {
  name: "preset",
  impl: ig
}, {
  name: "random",
  impl: og
}];
function sg(t13) {
  this.options = t13, this.notifications = 0;
}
var Jf = function() {
};
var ev = function() {
  throw new Error("A headless instance can not render images");
};
sg.prototype = {
  recalculateRenderedStyle: Jf,
  notify: function() {
    this.notifications++;
  },
  init: Jf,
  isHeadless: function() {
    return true;
  },
  png: ev,
  jpg: ev
};
var _c = {};
_c.arrowShapeWidth = 0.3;
_c.registerArrowShapes = function() {
  var t13 = this.arrowShapes = {}, e = this, r = function(u, c, d, v, h6, f, p) {
    var m = h6.x - d / 2 - p, g = h6.x + d / 2 + p, y = h6.y - d / 2 - p, b = h6.y + d / 2 + p, w = m <= u && u <= g && y <= c && c <= b;
    return w;
  }, n = function(u, c, d, v, h6) {
    var f = u * Math.cos(v) - c * Math.sin(v), p = u * Math.sin(v) + c * Math.cos(v), m = f * d, g = p * d, y = m + h6.x, b = g + h6.y;
    return {
      x: y,
      y: b
    };
  }, a = function(u, c, d, v) {
    for (var h6 = [], f = 0; f < u.length; f += 2) {
      var p = u[f], m = u[f + 1];
      h6.push(n(p, m, c, d, v));
    }
    return h6;
  }, i = function(u) {
    for (var c = [], d = 0; d < u.length; d++) {
      var v = u[d];
      c.push(v.x, v.y);
    }
    return c;
  }, o = function(u) {
    return u.pstyle("width").pfValue * u.pstyle("arrow-scale").pfValue * 2;
  }, s = function(u, c) {
    Ae(c) && (c = t13[c]), t13[u] = ze({
      name: u,
      points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],
      collide: function(v, h6, f, p, m, g) {
        var y = i(a(this.points, f + 2 * g, p, m)), b = dr(v, h6, y);
        return b;
      },
      roughCollide: r,
      draw: function(v, h6, f, p) {
        var m = a(this.points, h6, f, p);
        e.arrowShapeImpl("polygon")(v, m);
      },
      spacing: function(v) {
        return 0;
      },
      gap: o
    }, c);
  };
  s("none", {
    collide: Ls,
    roughCollide: Ls,
    draw: fc,
    spacing: cf,
    gap: cf
  }), s("triangle", {
    points: [-0.15, -0.3, 0, 0, 0.15, -0.3]
  }), s("arrow", "triangle"), s("triangle-backcurve", {
    points: t13.triangle.points,
    controlPoint: [0, -0.15],
    roughCollide: r,
    draw: function(u, c, d, v, h6) {
      var f = a(this.points, c, d, v), p = this.controlPoint, m = n(p[0], p[1], c, d, v);
      e.arrowShapeImpl(this.name)(u, f, m);
    },
    gap: function(u) {
      return o(u) * 0.8;
    }
  }), s("triangle-tee", {
    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],
    pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4],
    collide: function(u, c, d, v, h6, f, p) {
      var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.pointsTee, d + 2 * p, v, h6)), y = dr(u, c, m) || dr(u, c, g);
      return y;
    },
    draw: function(u, c, d, v, h6) {
      var f = a(this.points, c, d, v), p = a(this.pointsTee, c, d, v);
      e.arrowShapeImpl(this.name)(u, f, p);
    }
  }), s("circle-triangle", {
    radius: 0.15,
    pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15],
    collide: function(u, c, d, v, h6, f, p) {
      var m = h6, g = Math.pow(m.x - u, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), y = i(a(this.points, d + 2 * p, v, h6));
      return dr(u, c, y) || g;
    },
    draw: function(u, c, d, v, h6) {
      var f = a(this.pointsTr, c, d, v);
      e.arrowShapeImpl(this.name)(u, f, v.x, v.y, this.radius * c);
    },
    spacing: function(u) {
      return e.getArrowWidth(u.pstyle("width").pfValue, u.pstyle("arrow-scale").value) * this.radius;
    }
  }), s("triangle-cross", {
    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],
    baseCrossLinePts: [
      -0.15,
      -0.4,
      // first half of the rectangle
      -0.15,
      -0.4,
      0.15,
      -0.4,
      // second half of the rectangle
      0.15,
      -0.4
    ],
    crossLinePts: function(u, c) {
      var d = this.baseCrossLinePts.slice(), v = c / u, h6 = 3, f = 5;
      return d[h6] = d[h6] - v, d[f] = d[f] - v, d;
    },
    collide: function(u, c, d, v, h6, f, p) {
      var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.crossLinePts(d, f), d + 2 * p, v, h6)), y = dr(u, c, m) || dr(u, c, g);
      return y;
    },
    draw: function(u, c, d, v, h6) {
      var f = a(this.points, c, d, v), p = a(this.crossLinePts(c, h6), c, d, v);
      e.arrowShapeImpl(this.name)(u, f, p);
    }
  }), s("vee", {
    points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15],
    gap: function(u) {
      return o(u) * 0.525;
    }
  }), s("circle", {
    radius: 0.15,
    collide: function(u, c, d, v, h6, f, p) {
      var m = h6, g = Math.pow(m.x - u, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2);
      return g;
    },
    draw: function(u, c, d, v, h6) {
      e.arrowShapeImpl(this.name)(u, v.x, v.y, this.radius * c);
    },
    spacing: function(u) {
      return e.getArrowWidth(u.pstyle("width").pfValue, u.pstyle("arrow-scale").value) * this.radius;
    }
  }), s("tee", {
    points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0],
    spacing: function(u) {
      return 1;
    },
    gap: function(u) {
      return 1;
    }
  }), s("square", {
    points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3]
  }), s("diamond", {
    points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0],
    gap: function(u) {
      return u.pstyle("width").pfValue * u.pstyle("arrow-scale").value;
    }
  }), s("chevron", {
    points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15],
    gap: function(u) {
      return 0.95 * u.pstyle("width").pfValue * u.pstyle("arrow-scale").value;
    }
  });
};
var Da = {};
Da.projectIntoViewport = function(t13, e) {
  var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), l = r.zoom(), u = ((t13 - a) / o - s.x) / l, c = ((e - i) / o - s.y) / l;
  return [u, c];
};
Da.findContainerClientCoords = function() {
  if (this.containerBB)
    return this.containerBB;
  var t13 = this.container, e = t13.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t13), n = function(g) {
    return parseFloat(r.getPropertyValue(g));
  }, a = {
    left: n("padding-left"),
    right: n("padding-right"),
    top: n("padding-top"),
    bottom: n("padding-bottom")
  }, i = {
    left: n("border-left-width"),
    right: n("border-right-width"),
    top: n("border-top-width"),
    bottom: n("border-bottom-width")
  }, o = t13.clientWidth, s = t13.clientHeight, l = a.left + a.right, u = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), v = o - l, h6 = s - u, f = e.left + a.left + i.left, p = e.top + a.top + i.top;
  return this.containerBB = [f, p, v, h6, d];
};
Da.invalidateContainerClientCoordsCache = function() {
  this.containerBB = null;
};
Da.findNearestElement = function(t13, e, r, n) {
  return this.findNearestElements(t13, e, r, n)[0];
};
Da.findNearestElements = function(t13, e, r, n) {
  var a = this, i = this, o = i.getCachedZSortedEles(), s = [], l = i.cy.zoom(), u = i.cy.hasCompoundNodes(), c = (n ? 24 : 8) / l, d = (n ? 8 : 2) / l, v = (n ? 8 : 2) / l, h6 = 1 / 0, f, p;
  r && (o = o.interactive);
  function m(x, T) {
    if (x.isNode()) {
      if (p)
        return;
      p = x, s.push(x);
    }
    if (x.isEdge() && (T == null || T < h6))
      if (f) {
        if (f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value && f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value) {
          for (var k = 0; k < s.length; k++)
            if (s[k].isEdge()) {
              s[k] = x, f = x, h6 = T ?? h6;
              break;
            }
        }
      } else
        s.push(x), f = x, h6 = T ?? h6;
  }
  function g(x) {
    var T = x.outerWidth() + 2 * d, k = x.outerHeight() + 2 * d, _ = T / 2, D = k / 2, O = x.position(), A = x.pstyle("corner-radius").value === "auto" ? "auto" : x.pstyle("corner-radius").pfValue, L = x._private.rscratch;
    if (O.x - _ <= t13 && t13 <= O.x + _ && O.y - D <= e && e <= O.y + D) {
      var N = i.nodeShapes[a.getNodeShape(x)];
      if (N.checkPoint(t13, e, 0, T, k, O.x, O.y, A, L))
        return m(x, 0), true;
    }
  }
  function y(x) {
    var T = x._private, k = T.rscratch, _ = x.pstyle("width").pfValue, D = x.pstyle("arrow-scale").value, O = _ / 2 + c, A = O * O, L = O * 2, F = T.source, $ = T.target, N;
    if (k.edgeType === "segments" || k.edgeType === "straight" || k.edgeType === "haystack") {
      for (var I = k.allpts, M = 0; M + 3 < I.length; M += 2)
        if (o4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], L) && A > (N = d4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3])))
          return m(x, N), true;
    } else if (k.edgeType === "bezier" || k.edgeType === "multibezier" || k.edgeType === "self" || k.edgeType === "compound") {
      for (var I = k.allpts, M = 0; M + 5 < k.allpts.length; M += 4)
        if (s4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5], L) && A > (N = c4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5])))
          return m(x, N), true;
    }
    for (var F = F || T.source, $ = $ || T.target, U = a.getArrowWidth(_, D), H = [{
      name: "source",
      x: k.arrowStartX,
      y: k.arrowStartY,
      angle: k.srcArrowAngle
    }, {
      name: "target",
      x: k.arrowEndX,
      y: k.arrowEndY,
      angle: k.tgtArrowAngle
    }, {
      name: "mid-source",
      x: k.midX,
      y: k.midY,
      angle: k.midsrcArrowAngle
    }, {
      name: "mid-target",
      x: k.midX,
      y: k.midY,
      angle: k.midtgtArrowAngle
    }], M = 0; M < H.length; M++) {
      var K = H[M], ee = i.arrowShapes[x.pstyle(K.name + "-arrow-shape").value], se = x.pstyle("width").pfValue;
      if (ee.roughCollide(t13, e, U, K.angle, {
        x: K.x,
        y: K.y
      }, se, c) && ee.collide(t13, e, U, K.angle, {
        x: K.x,
        y: K.y
      }, se, c))
        return m(x), true;
    }
    u && s.length > 0 && (g(F), g($));
  }
  function b(x, T, k) {
    return Nr(x, T, k);
  }
  function w(x, T) {
    var k = x._private, _ = v, D;
    T ? D = T + "-" : D = "", x.boundingBox();
    var O = k.labelBounds[T || "main"], A = x.pstyle(D + "label").value, L = x.pstyle("text-events").strValue === "yes";
    if (!(!L || !A)) {
      var N = b(k.rscratch, "labelX", T), I = b(k.rscratch, "labelY", T), M = b(k.rscratch, "labelAngle", T), F = x.pstyle(D + "text-margin-x").pfValue, $ = x.pstyle(D + "text-margin-y").pfValue, U = O.x1 - _ - F, H = O.x2 + _ - F, K = O.y1 - _ - $, ee = O.y2 + _ - $;
      if (M) {
        var se = Math.cos(M), oe = Math.sin(M), ne = function(Ee, ve) {
          return Ee = Ee - N, ve = ve - I, {
            x: Ee * se - ve * oe + N,
            y: Ee * oe + ve * se + I
          };
        }, ue = ne(U, K), te = ne(U, ee), R = ne(H, K), Y = ne(H, ee), J = [
          // with the margin added after the rotation is applied
          ue.x + F,
          ue.y + $,
          R.x + F,
          R.y + $,
          Y.x + F,
          Y.y + $,
          te.x + F,
          te.y + $
        ];
        if (dr(t13, e, J))
          return m(x), true;
      } else if (si(O, t13, e))
        return m(x), true;
    }
  }
  for (var C = o.length - 1; C >= 0; C--) {
    var E = o[C];
    E.isNode() ? g(E) || w(E) : y(E) || w(E) || w(E, "source") || w(E, "target");
  }
  return s;
};
Da.getAllInBox = function(t13, e, r, n) {
  var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t13, r), s = Math.max(t13, r), l = Math.min(e, n), u = Math.max(e, n);
  t13 = o, r = s, e = l, n = u;
  for (var c = pr({
    x1: t13,
    y1: e,
    x2: r,
    y2: n
  }), d = 0; d < a.length; d++) {
    var v = a[d];
    if (v.isNode()) {
      var h6 = v, f = h6.boundingBox({
        includeNodes: true,
        includeEdges: false,
        includeLabels: false
      });
      pc(c, f) && !gp(f, c) && i.push(h6);
    } else {
      var p = v, m = p._private, g = m.rscratch;
      if (g.startX != null && g.startY != null && !si(c, g.startX, g.startY) || g.endX != null && g.endY != null && !si(c, g.endX, g.endY))
        continue;
      if (g.edgeType === "bezier" || g.edgeType === "multibezier" || g.edgeType === "self" || g.edgeType === "compound" || g.edgeType === "segments" || g.edgeType === "haystack") {
        for (var y = m.rstyle.bezierPts || m.rstyle.linePts || m.rstyle.haystackPts, b = true, w = 0; w < y.length; w++)
          if (!i4(c, y[w])) {
            b = false;
            break;
          }
        b && i.push(p);
      } else (g.edgeType === "haystack" || g.edgeType === "straight") && i.push(p);
    }
  }
  return i;
};
var Rs = {};
Rs.calculateArrowAngles = function(t13) {
  var e = t13._private.rscratch, r = e.edgeType === "haystack", n = e.edgeType === "bezier", a = e.edgeType === "multibezier", i = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", l, u, c, d, v, h6, g, y;
  if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], v = e.haystackPts[2], h6 = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, v = e.arrowEndX, h6 = e.arrowEndY), g = e.midX, y = e.midY, i)
    l = c - e.segpts[0], u = d - e.segpts[1];
  else if (a || o || s || n) {
    var f = e.allpts, p = Rt(f[0], f[2], f[4], 0.1), m = Rt(f[1], f[3], f[5], 0.1);
    l = c - p, u = d - m;
  } else
    l = c - g, u = d - y;
  e.srcArrowAngle = Wo(l, u);
  var g = e.midX, y = e.midY;
  if (r && (g = (c + v) / 2, y = (d + h6) / 2), l = v - c, u = h6 - d, i) {
    var f = e.allpts;
    if (f.length / 2 % 2 === 0) {
      var b = f.length / 2, w = b - 2;
      l = f[b] - f[w], u = f[b + 1] - f[w + 1];
    } else if (e.isRound)
      l = e.midVector[1], u = -e.midVector[0];
    else {
      var b = f.length / 2 - 1, w = b - 2;
      l = f[b] - f[w], u = f[b + 1] - f[w + 1];
    }
  } else if (a || o || s) {
    var f = e.allpts, C = e.ctrlpts, E, x, T, k;
    if (C.length / 2 % 2 === 0) {
      var _ = f.length / 2 - 1, D = _ + 2, O = D + 2;
      E = Rt(f[_], f[D], f[O], 0), x = Rt(f[_ + 1], f[D + 1], f[O + 1], 0), T = Rt(f[_], f[D], f[O], 1e-4), k = Rt(f[_ + 1], f[D + 1], f[O + 1], 1e-4);
    } else {
      var D = f.length / 2 - 1, _ = D - 2, O = D + 2;
      E = Rt(f[_], f[D], f[O], 0.4999), x = Rt(f[_ + 1], f[D + 1], f[O + 1], 0.4999), T = Rt(f[_], f[D], f[O], 0.5), k = Rt(f[_ + 1], f[D + 1], f[O + 1], 0.5);
    }
    l = T - E, u = k - x;
  }
  if (e.midtgtArrowAngle = Wo(l, u), e.midDispX = l, e.midDispY = u, l *= -1, u *= -1, i) {
    var f = e.allpts;
    if (f.length / 2 % 2 !== 0) {
      if (!e.isRound) {
        var b = f.length / 2 - 1, A = b + 2;
        l = -(f[A] - f[b]), u = -(f[A + 1] - f[b + 1]);
      }
    }
  }
  if (e.midsrcArrowAngle = Wo(l, u), i)
    l = v - e.segpts[e.segpts.length - 2], u = h6 - e.segpts[e.segpts.length - 1];
  else if (a || o || s || n) {
    var f = e.allpts, L = f.length, p = Rt(f[L - 6], f[L - 4], f[L - 2], 0.9), m = Rt(f[L - 5], f[L - 3], f[L - 1], 0.9);
    l = v - p, u = h6 - m;
  } else
    l = v - g, u = h6 - y;
  e.tgtArrowAngle = Wo(l, u);
};
Rs.getArrowWidth = Rs.getArrowHeight = function(t13, e) {
  var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t13 + ", " + e];
  return n || (n = Math.max(Math.pow(t13 * 13.37, 0.9), 29) * e, r[t13 + ", " + e] = n, n);
};
var yu;
var bu;
var Yr = {};
var xr = {};
var tv;
var rv;
var oa;
var gs;
var ln;
var ea;
var na;
var Wr;
var Ra;
var rs;
var lg;
var ug;
var wu;
var Cu;
var nv;
var av = function(e, r, n) {
  n.x = r.x - e.x, n.y = r.y - e.y, n.len = Math.sqrt(n.x * n.x + n.y * n.y), n.nx = n.x / n.len, n.ny = n.y / n.len, n.ang = Math.atan2(n.ny, n.nx);
};
var GP = function(e, r) {
  r.x = e.x * -1, r.y = e.y * -1, r.nx = e.nx * -1, r.ny = e.ny * -1, r.ang = e.ang > 0 ? -(Math.PI - e.ang) : Math.PI + e.ang;
};
var WP = function(e, r, n, a, i) {
  if (e !== nv ? av(r, e, Yr) : GP(xr, Yr), av(r, n, xr), tv = Yr.nx * xr.ny - Yr.ny * xr.nx, rv = Yr.nx * xr.nx - Yr.ny * -xr.ny, ln = Math.asin(Math.max(-1, Math.min(1, tv))), Math.abs(ln) < 1e-6) {
    yu = r.x, bu = r.y, na = Ra = 0;
    return;
  }
  oa = 1, gs = false, rv < 0 ? ln < 0 ? ln = Math.PI + ln : (ln = Math.PI - ln, oa = -1, gs = true) : ln > 0 && (oa = -1, gs = true), r.radius !== void 0 ? Ra = r.radius : Ra = a, ea = ln / 2, rs = Math.min(Yr.len / 2, xr.len / 2), i ? (Wr = Math.abs(Math.cos(ea) * Ra / Math.sin(ea)), Wr > rs ? (Wr = rs, na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))) : na = Ra) : (Wr = Math.min(rs, Ra), na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))), wu = r.x + xr.nx * Wr, Cu = r.y + xr.ny * Wr, yu = wu - xr.ny * na * oa, bu = Cu + xr.nx * na * oa, lg = r.x + Yr.nx * Wr, ug = r.y + Yr.ny * Wr, nv = r;
};
function cg(t13, e) {
  e.radius === 0 ? t13.lineTo(e.cx, e.cy) : t13.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise);
}
function Dc(t13, e, r, n) {
  var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
  return n === 0 || e.radius === 0 ? {
    cx: e.x,
    cy: e.y,
    radius: 0,
    startX: e.x,
    startY: e.y,
    stopX: e.x,
    stopY: e.y,
    startAngle: void 0,
    endAngle: void 0,
    counterClockwise: void 0
  } : (WP(t13, e, r, n, a), {
    cx: yu,
    cy: bu,
    radius: na,
    startX: lg,
    startY: ug,
    stopX: wu,
    stopY: Cu,
    startAngle: Yr.ang + Math.PI / 2 * oa,
    endAngle: xr.ang - Math.PI / 2 * oa,
    counterClockwise: gs
  });
}
var or = {};
or.findMidptPtsEtc = function(t13, e) {
  var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t13.pstyle("source-endpoint"), s = t13.pstyle("target-endpoint"), l = o.units != null && s.units != null, u = function(C, E, x, T) {
    var k = T - E, _ = x - C, D = Math.sqrt(_ * _ + k * k);
    return {
      x: -k / D,
      y: _ / D
    };
  }, c = t13.pstyle("edge-distances").value;
  switch (c) {
    case "node-position":
      i = r;
      break;
    case "intersection":
      i = n;
      break;
    case "endpoints": {
      if (l) {
        var d = this.manualEndptToPx(t13.source()[0], o), v = Mr(d, 2), h6 = v[0], f = v[1], p = this.manualEndptToPx(t13.target()[0], s), m = Mr(p, 2), g = m[0], y = m[1], b = {
          x1: h6,
          y1: f,
          x2: g,
          y2: y
        };
        a = u(h6, f, g, y), i = b;
      } else
        tt("Edge ".concat(t13.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).")), i = n;
      break;
    }
  }
  return {
    midptPts: i,
    vectorNormInverse: a
  };
};
or.findHaystackPoints = function(t13) {
  for (var e = 0; e < t13.length; e++) {
    var r = t13[e], n = r._private, a = n.rscratch;
    if (!a.haystack) {
      var i = Math.random() * 2 * Math.PI;
      a.source = {
        x: Math.cos(i),
        y: Math.sin(i)
      }, i = Math.random() * 2 * Math.PI, a.target = {
        x: Math.cos(i),
        y: Math.sin(i)
      };
    }
    var o = n.source, s = n.target, l = o.position(), u = s.position(), c = o.width(), d = s.width(), v = o.height(), h6 = s.height(), f = r.pstyle("haystack-radius").value, p = f / 2;
    a.haystackPts = a.allpts = [a.source.x * c * p + l.x, a.source.y * v * p + l.y, a.target.x * d * p + u.x, a.target.y * h6 * p + u.y], a.midX = (a.allpts[0] + a.allpts[2]) / 2, a.midY = (a.allpts[1] + a.allpts[3]) / 2, a.edgeType = "haystack", a.haystack = true, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r);
  }
};
or.findSegmentsPoints = function(t13, e) {
  var r = t13._private.rscratch, n = t13.pstyle("segment-weights"), a = t13.pstyle("segment-distances"), i = t13.pstyle("segment-radii"), o = t13.pstyle("radius-type"), s = Math.min(n.pfValue.length, a.pfValue.length), l = i.pfValue[i.pfValue.length - 1], u = o.pfValue[o.pfValue.length - 1];
  r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = [];
  for (var c = 0; c < s; c++) {
    var d = n.pfValue[c], v = a.pfValue[c], h6 = 1 - d, f = d, p = this.findMidptPtsEtc(t13, e), m = p.midptPts, g = p.vectorNormInverse, y = {
      x: m.x1 * h6 + m.x2 * f,
      y: m.y1 * h6 + m.y2 * f
    };
    r.segpts.push(y.x + g.x * v, y.y + g.y * v), r.radii.push(i.pfValue[c] !== void 0 ? i.pfValue[c] : l), r.isArcRadius.push((o.pfValue[c] !== void 0 ? o.pfValue[c] : u) === "arc-radius");
  }
};
or.findLoopPoints = function(t13, e, r, n) {
  var a = t13._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t13.pstyle("control-point-distances"), l = s ? s.pfValue[0] : void 0, u = t13.pstyle("loop-direction").pfValue, c = t13.pstyle("loop-sweep").pfValue, d = t13.pstyle("control-point-step-size").pfValue;
  a.edgeType = "self";
  var v = r, h6 = d;
  n && (v = 0, h6 = l);
  var f = u - Math.PI / 2, p = f - c / 2, m = f + c / 2, g = u + "_" + c;
  v = i[g] === void 0 ? i[g] = 0 : ++i[g], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(p) * 1.4 * h6 * (v / 3 + 1), o.x + Math.cos(m) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(m) * 1.4 * h6 * (v / 3 + 1)];
};
or.findCompoundLoopPoints = function(t13, e, r, n) {
  var a = t13._private.rscratch;
  a.edgeType = "compound";
  var i = e.srcPos, o = e.tgtPos, s = e.srcW, l = e.srcH, u = e.tgtW, c = e.tgtH, d = t13.pstyle("control-point-step-size").pfValue, v = t13.pstyle("control-point-distances"), h6 = v ? v.pfValue[0] : void 0, f = r, p = d;
  n && (f = 0, p = h6);
  var m = 50, g = {
    x: i.x - s / 2,
    y: i.y - l / 2
  }, y = {
    x: o.x - u / 2,
    y: o.y - c / 2
  }, b = {
    x: Math.min(g.x, y.x),
    y: Math.min(g.y, y.y)
  }, w = 0.5, C = Math.max(w, Math.log(s * 0.01)), E = Math.max(w, Math.log(u * 0.01));
  a.ctrlpts = [b.x, b.y - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * C, b.x - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * E, b.y];
};
or.findStraightEdgePoints = function(t13) {
  t13._private.rscratch.edgeType = "straight";
};
or.findBezierPoints = function(t13, e, r, n, a) {
  var i = t13._private.rscratch, o = t13.pstyle("control-point-step-size").pfValue, s = t13.pstyle("control-point-distances"), l = t13.pstyle("control-point-weights"), u = s && l ? Math.min(s.value.length, l.value.length) : 1, c = s ? s.pfValue[0] : void 0, d = l.value[0], v = n;
  i.edgeType = v ? "multibezier" : "bezier", i.ctrlpts = [];
  for (var h6 = 0; h6 < u; h6++) {
    var f = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, m = hp(f);
    v && (c = s ? s.pfValue[h6] : o, d = l.value[h6]), n ? p = c : p = c !== void 0 ? m * c : void 0;
    var g = p !== void 0 ? p : f, y = 1 - d, b = d, w = this.findMidptPtsEtc(t13, e), C = w.midptPts, E = w.vectorNormInverse, x = {
      x: C.x1 * y + C.x2 * b,
      y: C.y1 * y + C.y2 * b
    };
    i.ctrlpts.push(x.x + E.x * g, x.y + E.y * g);
  }
};
or.findTaxiPoints = function(t13, e) {
  var r = t13._private.rscratch;
  r.edgeType = "segments";
  var n = "vertical", a = "horizontal", i = "leftward", o = "rightward", s = "downward", l = "upward", u = "auto", c = e.posPts, d = e.srcW, v = e.srcH, h6 = e.tgtW, f = e.tgtH, p = t13.pstyle("edge-distances").value, m = p !== "node-position", g = t13.pstyle("taxi-direction").value, y = g, b = t13.pstyle("taxi-turn"), w = b.units === "%", C = b.pfValue, E = C < 0, x = t13.pstyle("taxi-turn-min-distance").pfValue, T = m ? (d + h6) / 2 : 0, k = m ? (v + f) / 2 : 0, _ = c.x2 - c.x1, D = c.y2 - c.y1, O = function(Fe, Me) {
    return Fe > 0 ? Math.max(Fe - Me, 0) : Math.min(Fe + Me, 0);
  }, A = O(_, T), L = O(D, k), N = false;
  y === u ? g = Math.abs(A) > Math.abs(L) ? a : n : y === l || y === s ? (g = n, N = true) : (y === i || y === o) && (g = a, N = true);
  var I = g === n, M = I ? L : A, F = I ? D : _, $ = hp(F), U = false;
  !(N && (w || E)) && (y === s && F < 0 || y === l && F > 0 || y === i && F > 0 || y === o && F < 0) && ($ *= -1, M = $ * Math.abs(M), U = true);
  var H;
  if (w) {
    var K = C < 0 ? 1 + C : C;
    H = K * M;
  } else {
    var ee = C < 0 ? M : 0;
    H = ee + C * $;
  }
  var se = function(Fe) {
    return Math.abs(Fe) < x || Math.abs(Fe) >= Math.abs(M);
  }, oe = se(H), ne = se(Math.abs(M) - Math.abs(H)), ue = oe || ne;
  if (ue && !U)
    if (I) {
      var te = Math.abs(F) <= v / 2, R = Math.abs(_) <= h6 / 2;
      if (te) {
        var Y = (c.x1 + c.x2) / 2, J = c.y1, ge = c.y2;
        r.segpts = [Y, J, Y, ge];
      } else if (R) {
        var Ee = (c.y1 + c.y2) / 2, ve = c.x1, me = c.x2;
        r.segpts = [ve, Ee, me, Ee];
      } else
        r.segpts = [c.x1, c.y2];
    } else {
      var Ce = Math.abs(F) <= d / 2, ke = Math.abs(D) <= f / 2;
      if (Ce) {
        var xe = (c.y1 + c.y2) / 2, Pe = c.x1, Ke = c.x2;
        r.segpts = [Pe, xe, Ke, xe];
      } else if (ke) {
        var qe = (c.x1 + c.x2) / 2, Ne = c.y1, Ge = c.y2;
        r.segpts = [qe, Ne, qe, Ge];
      } else
        r.segpts = [c.x2, c.y1];
    }
  else if (I) {
    var le = c.y1 + H + (m ? v / 2 * $ : 0), S = c.x1, z = c.x2;
    r.segpts = [S, le, z, le];
  } else {
    var ae = c.x1 + H + (m ? d / 2 * $ : 0), Q = c.y1, X = c.y2;
    r.segpts = [ae, Q, ae, X];
  }
  if (r.isRound) {
    var pe = t13.pstyle("taxi-radius").value, re = t13.pstyle("radius-type").value[0] === "arc-radius";
    r.radii = new Array(r.segpts.length / 2).fill(pe), r.isArcRadius = new Array(r.segpts.length / 2).fill(re);
  }
};
or.tryToCorrectInvalidPoints = function(t13, e) {
  var r = t13._private.rscratch;
  if (r.edgeType === "bezier") {
    var n = e.srcPos, a = e.tgtPos, i = e.srcW, o = e.srcH, s = e.tgtW, l = e.tgtH, u = e.srcShape, c = e.tgtShape, d = e.srcCornerRadius, v = e.tgtCornerRadius, h6 = e.srcRs, f = e.tgtRs, p = !be(r.startX) || !be(r.startY), m = !be(r.arrowStartX) || !be(r.arrowStartY), g = !be(r.endX) || !be(r.endY), y = !be(r.arrowEndX) || !be(r.arrowEndY), b = 3, w = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth, C = b * w, E = ya({
      x: r.ctrlpts[0],
      y: r.ctrlpts[1]
    }, {
      x: r.startX,
      y: r.startY
    }), x = E < C, T = ya({
      x: r.ctrlpts[0],
      y: r.ctrlpts[1]
    }, {
      x: r.endX,
      y: r.endY
    }), k = T < C, _ = false;
    if (p || m || x) {
      _ = true;
      var D = {
        // delta
        x: r.ctrlpts[0] - n.x,
        y: r.ctrlpts[1] - n.y
      }, O = Math.sqrt(D.x * D.x + D.y * D.y), A = {
        // normalised delta
        x: D.x / O,
        y: D.y / O
      }, L = Math.max(i, o), N = {
        // *2 radius guarantees outside shape
        x: r.ctrlpts[0] + A.x * 2 * L,
        y: r.ctrlpts[1] + A.y * 2 * L
      }, I = u.intersectLine(n.x, n.y, i, o, N.x, N.y, 0, d, h6);
      x ? (r.ctrlpts[0] = r.ctrlpts[0] + A.x * (C - E), r.ctrlpts[1] = r.ctrlpts[1] + A.y * (C - E)) : (r.ctrlpts[0] = I[0] + A.x * C, r.ctrlpts[1] = I[1] + A.y * C);
    }
    if (g || y || k) {
      _ = true;
      var M = {
        // delta
        x: r.ctrlpts[0] - a.x,
        y: r.ctrlpts[1] - a.y
      }, F = Math.sqrt(M.x * M.x + M.y * M.y), $ = {
        // normalised delta
        x: M.x / F,
        y: M.y / F
      }, U = Math.max(i, o), H = {
        // *2 radius guarantees outside shape
        x: r.ctrlpts[0] + $.x * 2 * U,
        y: r.ctrlpts[1] + $.y * 2 * U
      }, K = c.intersectLine(a.x, a.y, s, l, H.x, H.y, 0, v, f);
      k ? (r.ctrlpts[0] = r.ctrlpts[0] + $.x * (C - T), r.ctrlpts[1] = r.ctrlpts[1] + $.y * (C - T)) : (r.ctrlpts[0] = K[0] + $.x * C, r.ctrlpts[1] = K[1] + $.y * C);
    }
    _ && this.findEndpoints(t13);
  }
};
or.storeAllpts = function(t13) {
  var e = t13._private.rscratch;
  if (e.edgeType === "multibezier" || e.edgeType === "bezier" || e.edgeType === "self" || e.edgeType === "compound") {
    e.allpts = [], e.allpts.push(e.startX, e.startY);
    for (var r = 0; r + 1 < e.ctrlpts.length; r += 2)
      e.allpts.push(e.ctrlpts[r], e.ctrlpts[r + 1]), r + 3 < e.ctrlpts.length && e.allpts.push((e.ctrlpts[r] + e.ctrlpts[r + 2]) / 2, (e.ctrlpts[r + 1] + e.ctrlpts[r + 3]) / 2);
    e.allpts.push(e.endX, e.endY);
    var n, a;
    e.ctrlpts.length / 2 % 2 === 0 ? (n = e.allpts.length / 2 - 1, e.midX = e.allpts[n], e.midY = e.allpts[n + 1]) : (n = e.allpts.length / 2 - 3, a = 0.5, e.midX = Rt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = Rt(e.allpts[n + 1], e.allpts[n + 3], e.allpts[n + 5], a));
  } else if (e.edgeType === "straight")
    e.allpts = [e.startX, e.startY, e.endX, e.endY], e.midX = (e.startX + e.endX + e.arrowStartX + e.arrowEndX) / 4, e.midY = (e.startY + e.endY + e.arrowStartY + e.arrowEndY) / 4;
  else if (e.edgeType === "segments") {
    if (e.allpts = [], e.allpts.push(e.startX, e.startY), e.allpts.push.apply(e.allpts, e.segpts), e.allpts.push(e.endX, e.endY), e.isRound) {
      e.roundCorners = [];
      for (var i = 2; i + 3 < e.allpts.length; i += 2) {
        var o = e.radii[i / 2 - 1], s = e.isArcRadius[i / 2 - 1];
        e.roundCorners.push(Dc({
          x: e.allpts[i - 2],
          y: e.allpts[i - 1]
        }, {
          x: e.allpts[i],
          y: e.allpts[i + 1],
          radius: o
        }, {
          x: e.allpts[i + 2],
          y: e.allpts[i + 3]
        }, o, s));
      }
    }
    if (e.segpts.length % 4 === 0) {
      var l = e.segpts.length / 2, u = l - 2;
      e.midX = (e.segpts[u] + e.segpts[l]) / 2, e.midY = (e.segpts[u + 1] + e.segpts[l + 1]) / 2;
    } else {
      var c = e.segpts.length / 2 - 1;
      if (!e.isRound)
        e.midX = e.segpts[c], e.midY = e.segpts[c + 1];
      else {
        var d = {
          x: e.segpts[c],
          y: e.segpts[c + 1]
        }, v = e.roundCorners[c / 2], h6 = [d.x - v.cx, d.y - v.cy], f = v.radius / Math.sqrt(Math.pow(h6[0], 2) + Math.pow(h6[1], 2));
        h6 = h6.map(function(p) {
          return p * f;
        }), e.midX = v.cx + h6[0], e.midY = v.cy + h6[1], e.midVector = h6;
      }
    }
  }
};
or.checkForInvalidEdgeWarning = function(t13) {
  var e = t13[0]._private.rscratch;
  e.nodesOverlap || be(e.startX) && be(e.startY) && be(e.endX) && be(e.endY) ? e.loggedErr = false : e.loggedErr || (e.loggedErr = true, tt("Edge `" + t13.id() + "` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap."));
};
or.findEdgeControlPoints = function(t13) {
  var e = this;
  if (!(!t13 || t13.length === 0)) {
    for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = {
      map: new Zr(),
      get: function(x) {
        var T = this.map.get(x[0]);
        return T != null ? T.get(x[1]) : null;
      },
      set: function(x, T) {
        var k = this.map.get(x[0]);
        k == null && (k = new Zr(), this.map.set(x[0], k)), k.set(x[1], T);
      }
    }, o = [], s = [], l = 0; l < t13.length; l++) {
      var u = t13[l], c = u._private, d = u.pstyle("curve-style").value;
      if (!(u.removed() || !u.takesUpSpace())) {
        if (d === "haystack") {
          s.push(u);
          continue;
        }
        var v = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h6 = d === "unbundled-bezier" || d === "bezier", f = c.source, p = c.target, m = f.poolIndex(), g = p.poolIndex(), y = [m, g].sort(), b = i.get(y);
        b == null && (b = {
          eles: []
        }, i.set(y, b), o.push(y)), b.eles.push(u), v && (b.hasUnbundled = true), h6 && (b.hasBezier = true);
      }
    }
    for (var w = function(x) {
      var T = o[x], k = i.get(T), _ = void 0;
      if (!k.hasUnbundled) {
        var D = k.eles[0].parallelEdges().filter(function(ae) {
          return ae.isBundledBezier();
        });
        vc(k.eles), D.forEach(function(ae) {
          return k.eles.push(ae);
        }), k.eles.sort(function(ae, Q) {
          return ae.poolIndex() - Q.poolIndex();
        });
      }
      var O = k.eles[0], A = O.source(), L = O.target();
      if (A.poolIndex() > L.poolIndex()) {
        var N = A;
        A = L, L = N;
      }
      var I = k.srcPos = A.position(), M = k.tgtPos = L.position(), F = k.srcW = A.outerWidth(), $ = k.srcH = A.outerHeight(), U = k.tgtW = L.outerWidth(), H = k.tgtH = L.outerHeight(), K = k.srcShape = r.nodeShapes[e.getNodeShape(A)], ee = k.tgtShape = r.nodeShapes[e.getNodeShape(L)], se = k.srcCornerRadius = A.pstyle("corner-radius").value === "auto" ? "auto" : A.pstyle("corner-radius").pfValue, oe = k.tgtCornerRadius = L.pstyle("corner-radius").value === "auto" ? "auto" : L.pstyle("corner-radius").pfValue, ne = k.tgtRs = L._private.rscratch, ue = k.srcRs = A._private.rscratch;
      k.dirCounts = {
        north: 0,
        west: 0,
        south: 0,
        east: 0,
        northwest: 0,
        southwest: 0,
        northeast: 0,
        southeast: 0
      };
      for (var te = 0; te < k.eles.length; te++) {
        var R = k.eles[te], Y = R[0]._private.rscratch, J = R.pstyle("curve-style").value, ge = J === "unbundled-bezier" || J.endsWith("segments") || J.endsWith("taxi"), Ee = !A.same(R.source());
        if (!k.calculatedIntersection && A !== L && (k.hasBezier || k.hasUnbundled)) {
          k.calculatedIntersection = true;
          var ve = K.intersectLine(I.x, I.y, F, $, M.x, M.y, 0, se, ue), me = k.srcIntn = ve, Ce = ee.intersectLine(M.x, M.y, U, H, I.x, I.y, 0, oe, ne), ke = k.tgtIntn = Ce, xe = k.intersectionPts = {
            x1: ve[0],
            x2: Ce[0],
            y1: ve[1],
            y2: Ce[1]
          }, Pe = k.posPts = {
            x1: I.x,
            x2: M.x,
            y1: I.y,
            y2: M.y
          }, Ke = Ce[1] - ve[1], qe = Ce[0] - ve[0], Ne = Math.sqrt(qe * qe + Ke * Ke), Ge = k.vector = {
            x: qe,
            y: Ke
          }, le = k.vectorNorm = {
            x: Ge.x / Ne,
            y: Ge.y / Ne
          }, S = {
            x: -le.y,
            y: le.x
          };
          k.nodesOverlap = !be(Ne) || ee.checkPoint(ve[0], ve[1], 0, U, H, M.x, M.y, oe, ne) || K.checkPoint(Ce[0], Ce[1], 0, F, $, I.x, I.y, se, ue), k.vectorNormInverse = S, _ = {
            nodesOverlap: k.nodesOverlap,
            dirCounts: k.dirCounts,
            calculatedIntersection: true,
            hasBezier: k.hasBezier,
            hasUnbundled: k.hasUnbundled,
            eles: k.eles,
            srcPos: M,
            tgtPos: I,
            srcW: U,
            srcH: H,
            tgtW: F,
            tgtH: $,
            srcIntn: ke,
            tgtIntn: me,
            srcShape: ee,
            tgtShape: K,
            posPts: {
              x1: Pe.x2,
              y1: Pe.y2,
              x2: Pe.x1,
              y2: Pe.y1
            },
            intersectionPts: {
              x1: xe.x2,
              y1: xe.y2,
              x2: xe.x1,
              y2: xe.y1
            },
            vector: {
              x: -Ge.x,
              y: -Ge.y
            },
            vectorNorm: {
              x: -le.x,
              y: -le.y
            },
            vectorNormInverse: {
              x: -S.x,
              y: -S.y
            }
          };
        }
        var z = Ee ? _ : k;
        Y.nodesOverlap = z.nodesOverlap, Y.srcIntn = z.srcIntn, Y.tgtIntn = z.tgtIntn, Y.isRound = J.startsWith("round"), a && (A.isParent() || A.isChild() || L.isParent() || L.isChild()) && (A.parents().anySame(L) || L.parents().anySame(A) || A.same(L) && A.isParent()) ? e.findCompoundLoopPoints(R, z, te, ge) : A === L ? e.findLoopPoints(R, z, te, ge) : J.endsWith("segments") ? e.findSegmentsPoints(R, z) : J.endsWith("taxi") ? e.findTaxiPoints(R, z) : J === "straight" || !ge && k.eles.length % 2 === 1 && te === Math.floor(k.eles.length / 2) ? e.findStraightEdgePoints(R) : e.findBezierPoints(R, z, te, ge, Ee), e.findEndpoints(R), e.tryToCorrectInvalidPoints(R, z), e.checkForInvalidEdgeWarning(R), e.storeAllpts(R), e.storeEdgeProjections(R), e.calculateArrowAngles(R), e.recalculateEdgeLabelProjections(R), e.calculateLabelAngles(R);
      }
    }, C = 0; C < o.length; C++)
      w(C);
    this.findHaystackPoints(s);
  }
};
function dg(t13) {
  var e = [];
  if (t13 != null) {
    for (var r = 0; r < t13.length; r += 2) {
      var n = t13[r], a = t13[r + 1];
      e.push({
        x: n,
        y: a
      });
    }
    return e;
  }
}
or.getSegmentPoints = function(t13) {
  var e = t13[0]._private.rscratch, r = e.edgeType;
  if (r === "segments")
    return this.recalculateRenderedStyle(t13), dg(e.segpts);
};
or.getControlPoints = function(t13) {
  var e = t13[0]._private.rscratch, r = e.edgeType;
  if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound")
    return this.recalculateRenderedStyle(t13), dg(e.ctrlpts);
};
or.getEdgeMidpoint = function(t13) {
  var e = t13[0]._private.rscratch;
  return this.recalculateRenderedStyle(t13), {
    x: e.midX,
    y: e.midY
  };
};
var Ao = {};
Ao.manualEndptToPx = function(t13, e) {
  var r = this, n = t13.position(), a = t13.outerWidth(), i = t13.outerHeight(), o = t13._private.rscratch;
  if (e.value.length === 2) {
    var s = [e.pfValue[0], e.pfValue[1]];
    return e.units[0] === "%" && (s[0] = s[0] * a), e.units[1] === "%" && (s[1] = s[1] * i), s[0] += n.x, s[1] += n.y, s;
  } else {
    var l = e.pfValue[0];
    l = -Math.PI / 2 + l;
    var u = 2 * Math.max(a, i), c = [n.x + Math.cos(l) * u, n.y + Math.sin(l) * u];
    return r.nodeShapes[this.getNodeShape(t13)].intersectLine(n.x, n.y, a, i, c[0], c[1], 0, t13.pstyle("corner-radius").value === "auto" ? "auto" : t13.pstyle("corner-radius").pfValue, o);
  }
};
Ao.findEndpoints = function(t13) {
  var e = this, r, n = t13.source()[0], a = t13.target()[0], i = n.position(), o = a.position(), s = t13.pstyle("target-arrow-shape").value, l = t13.pstyle("source-arrow-shape").value, u = t13.pstyle("target-distance-from-node").pfValue, c = t13.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, v = a._private.rscratch, h6 = t13.pstyle("curve-style").value, f = t13._private.rscratch, p = f.edgeType, m = h6 === "taxi", g = p === "self" || p === "compound", y = p === "bezier" || p === "multibezier" || g, b = p !== "bezier", w = p === "straight" || p === "segments", C = p === "segments", E = y || b || w, x = g || m, T = t13.pstyle("source-endpoint"), k = x ? "outside-to-node" : T.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, D = t13.pstyle("target-endpoint"), O = x ? "outside-to-node" : D.value, A = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue;
  f.srcManEndpt = T, f.tgtManEndpt = D;
  var L, N, I, M;
  if (y) {
    var F = [f.ctrlpts[0], f.ctrlpts[1]], $ = b ? [f.ctrlpts[f.ctrlpts.length - 2], f.ctrlpts[f.ctrlpts.length - 1]] : F;
    L = $, N = F;
  } else if (w) {
    var U = C ? f.segpts.slice(0, 2) : [o.x, o.y], H = C ? f.segpts.slice(f.segpts.length - 2) : [i.x, i.y];
    L = H, N = U;
  }
  if (O === "inside-to-node")
    r = [o.x, o.y];
  else if (D.units)
    r = this.manualEndptToPx(a, D);
  else if (O === "outside-to-line")
    r = f.tgtIntn;
  else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? I = L : (O === "outside-to-line" || O === "outside-to-line-or-label") && (I = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), I[0], I[1], 0, A, v), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") {
    var K = a._private.rscratch, ee = K.labelWidth, se = K.labelHeight, oe = K.labelX, ne = K.labelY, ue = ee / 2, te = se / 2, R = a.pstyle("text-valign").value;
    R === "top" ? ne -= te : R === "bottom" && (ne += te);
    var Y = a.pstyle("text-halign").value;
    Y === "left" ? oe -= ue : Y === "right" && (oe += ue);
    var J = lo(I[0], I[1], [oe - ue, ne - te, oe + ue, ne - te, oe + ue, ne + te, oe - ue, ne + te], o.x, o.y);
    if (J.length > 0) {
      var ge = i, Ee = ta(ge, Ka(r)), ve = ta(ge, Ka(J)), me = Ee;
      if (ve < Ee && (r = J, me = ve), J.length > 2) {
        var Ce = ta(ge, {
          x: J[2],
          y: J[3]
        });
        Ce < me && (r = [J[2], J[3]]);
      }
    }
  }
  var ke = Yo(r, L, e.arrowShapes[s].spacing(t13) + u), xe = Yo(r, L, e.arrowShapes[s].gap(t13) + u);
  if (f.endX = xe[0], f.endY = xe[1], f.arrowEndX = ke[0], f.arrowEndY = ke[1], k === "inside-to-node")
    r = [i.x, i.y];
  else if (T.units)
    r = this.manualEndptToPx(n, T);
  else if (k === "outside-to-line")
    r = f.srcIntn;
  else if (k === "outside-to-node" || k === "outside-to-node-or-label" ? M = N : (k === "outside-to-line" || k === "outside-to-line-or-label") && (M = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x, i.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, _, d), k === "outside-to-node-or-label" || k === "outside-to-line-or-label") {
    var Pe = n._private.rscratch, Ke = Pe.labelWidth, qe = Pe.labelHeight, Ne = Pe.labelX, Ge = Pe.labelY, le = Ke / 2, S = qe / 2, z = n.pstyle("text-valign").value;
    z === "top" ? Ge -= S : z === "bottom" && (Ge += S);
    var ae = n.pstyle("text-halign").value;
    ae === "left" ? Ne -= le : ae === "right" && (Ne += le);
    var Q = lo(M[0], M[1], [Ne - le, Ge - S, Ne + le, Ge - S, Ne + le, Ge + S, Ne - le, Ge + S], i.x, i.y);
    if (Q.length > 0) {
      var X = o, pe = ta(X, Ka(r)), re = ta(X, Ka(Q)), he = pe;
      if (re < pe && (r = [Q[0], Q[1]], he = re), Q.length > 2) {
        var Fe = ta(X, {
          x: Q[2],
          y: Q[3]
        });
        Fe < he && (r = [Q[2], Q[3]]);
      }
    }
  }
  var Me = Yo(r, N, e.arrowShapes[l].spacing(t13) + c), _e = Yo(r, N, e.arrowShapes[l].gap(t13) + c);
  f.startX = _e[0], f.startY = _e[1], f.arrowStartX = Me[0], f.arrowStartY = Me[1], E && (!be(f.startX) || !be(f.startY) || !be(f.endX) || !be(f.endY) ? f.badLine = true : f.badLine = false);
};
Ao.getSourceEndpoint = function(t13) {
  var e = t13[0]._private.rscratch;
  switch (this.recalculateRenderedStyle(t13), e.edgeType) {
    case "haystack":
      return {
        x: e.haystackPts[0],
        y: e.haystackPts[1]
      };
    default:
      return {
        x: e.arrowStartX,
        y: e.arrowStartY
      };
  }
};
Ao.getTargetEndpoint = function(t13) {
  var e = t13[0]._private.rscratch;
  switch (this.recalculateRenderedStyle(t13), e.edgeType) {
    case "haystack":
      return {
        x: e.haystackPts[2],
        y: e.haystackPts[3]
      };
    default:
      return {
        x: e.arrowEndX,
        y: e.arrowEndY
      };
  }
};
var Pc = {};
function YP(t13, e, r) {
  for (var n = function(u, c, d, v) {
    return Rt(u, c, d, v);
  }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t13.bezierProjPcts.length; o++) {
    var s = t13.bezierProjPcts[o];
    i.push({
      x: n(r[0], r[2], r[4], s),
      y: n(r[1], r[3], r[5], s)
    });
  }
}
Pc.storeEdgeProjections = function(t13) {
  var e = t13._private, r = e.rscratch, n = r.edgeType;
  if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, n === "multibezier" || n === "bezier" || n === "self" || n === "compound") {
    e.rstyle.bezierPts = [];
    for (var a = 0; a + 5 < r.allpts.length; a += 4)
      YP(this, t13, r.allpts.slice(a, a + 6));
  } else if (n === "segments")
    for (var i = e.rstyle.linePts = [], a = 0; a + 1 < r.allpts.length; a += 2)
      i.push({
        x: r.allpts[a],
        y: r.allpts[a + 1]
      });
  else if (n === "haystack") {
    var o = r.haystackPts;
    e.rstyle.haystackPts = [{
      x: o[0],
      y: o[1]
    }, {
      x: o[2],
      y: o[3]
    }];
  }
  e.rstyle.arrowWidth = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth;
};
Pc.recalculateEdgeProjections = function(t13) {
  this.findEdgeControlPoints(t13);
};
var nn = {};
nn.recalculateNodeLabelProjection = function(t13) {
  var e = t13.pstyle("label").strValue;
  if (!Kn(e)) {
    var r, n, a = t13._private, i = t13.width(), o = t13.height(), s = t13.padding(), l = t13.position(), u = t13.pstyle("text-halign").strValue, c = t13.pstyle("text-valign").strValue, d = a.rscratch, v = a.rstyle;
    switch (u) {
      case "left":
        r = l.x - i / 2 - s;
        break;
      case "right":
        r = l.x + i / 2 + s;
        break;
      default:
        r = l.x;
    }
    switch (c) {
      case "top":
        n = l.y - o / 2 - s;
        break;
      case "bottom":
        n = l.y + o / 2 + s;
        break;
      default:
        n = l.y;
    }
    d.labelX = r, d.labelY = n, v.labelX = r, v.labelY = n, this.calculateLabelAngles(t13), this.applyLabelDimensions(t13);
  }
};
var fg = function(e, r) {
  var n = Math.atan(r / e);
  return e === 0 && n < 0 && (n = n * -1), n;
};
var vg = function(e, r) {
  var n = r.x - e.x, a = r.y - e.y;
  return fg(n, a);
};
var jP = function(e, r, n, a) {
  var i = so(0, a - 1e-3, 1), o = so(0, a + 1e-3, 1), s = Wa(e, r, n, i), l = Wa(e, r, n, o);
  return vg(s, l);
};
nn.recalculateEdgeLabelProjections = function(t13) {
  var e, r = t13._private, n = r.rscratch, a = this, i = {
    mid: t13.pstyle("label").strValue,
    source: t13.pstyle("source-label").strValue,
    target: t13.pstyle("target-label").strValue
  };
  if (i.mid || i.source || i.target) {
    e = {
      x: n.midX,
      y: n.midY
    };
    var o = function(d, v, h6) {
      Fn(r.rscratch, d, v, h6), Fn(r.rstyle, d, v, h6);
    };
    o("labelX", null, e.x), o("labelY", null, e.y);
    var s = fg(n.midDispX, n.midDispY);
    o("labelAutoAngle", null, s);
    var l = function c() {
      if (c.cache)
        return c.cache;
      for (var d = [], v = 0; v + 5 < n.allpts.length; v += 4) {
        var h6 = {
          x: n.allpts[v],
          y: n.allpts[v + 1]
        }, f = {
          x: n.allpts[v + 2],
          y: n.allpts[v + 3]
        }, p = {
          x: n.allpts[v + 4],
          y: n.allpts[v + 5]
        };
        d.push({
          p0: h6,
          p1: f,
          p2: p,
          startDist: 0,
          length: 0,
          segments: []
        });
      }
      var m = r.rstyle.bezierPts, g = a.bezierProjPcts.length;
      function y(x, T, k, _, D) {
        var O = ya(T, k), A = x.segments[x.segments.length - 1], L = {
          p0: T,
          p1: k,
          t0: _,
          t1: D,
          startDist: A ? A.startDist + A.length : 0,
          length: O
        };
        x.segments.push(L), x.length += O;
      }
      for (var b = 0; b < d.length; b++) {
        var w = d[b], C = d[b - 1];
        C && (w.startDist = C.startDist + C.length), y(w, w.p0, m[b * g], 0, a.bezierProjPcts[0]);
        for (var E = 0; E < g - 1; E++)
          y(w, m[b * g + E], m[b * g + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]);
        y(w, m[b * g + g - 1], w.p2, a.bezierProjPcts[g - 1], 1);
      }
      return c.cache = d;
    }, u = function(d) {
      var v, h6 = d === "source";
      if (i[d]) {
        var f = t13.pstyle(d + "-text-offset").pfValue;
        switch (n.edgeType) {
          case "self":
          case "compound":
          case "bezier":
          case "multibezier": {
            for (var p = l(), m, g = 0, y = 0, b = 0; b < p.length; b++) {
              for (var w = p[h6 ? b : p.length - 1 - b], C = 0; C < w.segments.length; C++) {
                var E = w.segments[h6 ? C : w.segments.length - 1 - C], x = b === p.length - 1 && C === w.segments.length - 1;
                if (g = y, y += E.length, y >= f || x) {
                  m = {
                    cp: w,
                    segment: E
                  };
                  break;
                }
              }
              if (m)
                break;
            }
            var T = m.cp, k = m.segment, _ = (f - g) / k.length, D = k.t1 - k.t0, O = h6 ? k.t0 + D * _ : k.t1 - D * _;
            O = so(0, O, 1), e = Wa(T.p0, T.p1, T.p2, O), v = jP(T.p0, T.p1, T.p2, O);
            break;
          }
          case "straight":
          case "segments":
          case "haystack": {
            for (var A = 0, L, N, I, M, F = n.allpts.length, $ = 0; $ + 3 < F && (h6 ? (I = {
              x: n.allpts[$],
              y: n.allpts[$ + 1]
            }, M = {
              x: n.allpts[$ + 2],
              y: n.allpts[$ + 3]
            }) : (I = {
              x: n.allpts[F - 2 - $],
              y: n.allpts[F - 1 - $]
            }, M = {
              x: n.allpts[F - 4 - $],
              y: n.allpts[F - 3 - $]
            }), L = ya(I, M), N = A, A += L, !(A >= f)); $ += 2)
              ;
            var U = f - N, H = U / L;
            H = so(0, H, 1), e = e4(I, M, H), v = vg(I, M);
            break;
          }
        }
        o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, v);
      }
    };
    u("source"), u("target"), this.applyLabelDimensions(t13);
  }
};
nn.applyLabelDimensions = function(t13) {
  this.applyPrefixedLabelDimensions(t13), t13.isEdge() && (this.applyPrefixedLabelDimensions(t13, "source"), this.applyPrefixedLabelDimensions(t13, "target"));
};
nn.applyPrefixedLabelDimensions = function(t13, e) {
  var r = t13._private, n = this.getLabelText(t13, e), a = this.calculateLabelDimensions(t13, n), i = t13.pstyle("line-height").pfValue, o = t13.pstyle("text-wrap").strValue, s = Nr(r.rscratch, "labelWrapCachedLines", e) || [], l = o !== "wrap" ? 1 : Math.max(s.length, 1), u = a.height / l, c = u * i, d = a.width, v = a.height + (l - 1) * (i - 1) * u;
  Fn(r.rstyle, "labelWidth", e, d), Fn(r.rscratch, "labelWidth", e, d), Fn(r.rstyle, "labelHeight", e, v), Fn(r.rscratch, "labelHeight", e, v), Fn(r.rscratch, "labelLineHeight", e, c);
};
nn.getLabelText = function(t13, e) {
  var r = t13._private, n = e ? e + "-" : "", a = t13.pstyle(n + "label").strValue, i = t13.pstyle("text-transform").value, o = function(ee, se) {
    return se ? (Fn(r.rscratch, ee, e, se), se) : Nr(r.rscratch, ee, e);
  };
  if (!a)
    return "";
  i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase()));
  var s = t13.pstyle("text-wrap").value;
  if (s === "wrap") {
    var l = o("labelKey");
    if (l != null && o("labelWrapKey") === l)
      return o("labelWrapCachedText");
    for (var u = "​", c = a.split(`
`), d = t13.pstyle("text-max-width").pfValue, v = t13.pstyle("text-overflow-wrap").value, h6 = v === "anywhere", f = [], p = /[\s\u200b]+|$/g, m = 0; m < c.length; m++) {
      var g = c[m], y = this.calculateLabelDimensions(t13, g), b = y.width;
      if (h6) {
        var w = g.split("").join(u);
        g = w;
      }
      if (b > d) {
        var C = g.matchAll(p), E = "", x = 0, T = jh(C), k;
        try {
          for (T.s(); !(k = T.n()).done; ) {
            var _ = k.value, D = _[0], O = g.substring(x, _.index);
            x = _.index + D.length;
            var A = E.length === 0 ? O : E + O + D, L = this.calculateLabelDimensions(t13, A), N = L.width;
            N <= d ? E += O + D : (E && f.push(E), E = O + D);
          }
        } catch (K) {
          T.e(K);
        } finally {
          T.f();
        }
        E.match(/^[\s\u200b]+$/) || f.push(E);
      } else
        f.push(g);
    }
    o("labelWrapCachedLines", f), a = o("labelWrapCachedText", f.join(`
`)), o("labelWrapKey", l);
  } else if (s === "ellipsis") {
    var I = t13.pstyle("text-max-width").pfValue, M = "", F = "…", $ = false;
    if (this.calculateLabelDimensions(t13, a).width < I)
      return a;
    for (var U = 0; U < a.length; U++) {
      var H = this.calculateLabelDimensions(t13, M + a[U] + F).width;
      if (H > I)
        break;
      M += a[U], U === a.length - 1 && ($ = true);
    }
    return $ || (M += F), M;
  }
  return a;
};
nn.getLabelJustification = function(t13) {
  var e = t13.pstyle("text-justification").strValue, r = t13.pstyle("text-halign").strValue;
  if (e === "auto")
    if (t13.isNode())
      switch (r) {
        case "left":
          return "right";
        case "right":
          return "left";
        default:
          return "center";
      }
    else
      return "center";
  else
    return e;
};
nn.calculateLabelDimensions = function(t13, e) {
  var r = this, n = r.cy.window(), a = n.document, i = ma(e, t13._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i];
  if (s != null)
    return s;
  var l = 0, u = t13.pstyle("font-style").strValue, c = t13.pstyle("font-size").pfValue, d = t13.pstyle("font-family").strValue, v = t13.pstyle("font-weight").strValue, h6 = this.labelCalcCanvas, f = this.labelCalcCanvasContext;
  if (!h6) {
    h6 = this.labelCalcCanvas = a.createElement("canvas"), f = this.labelCalcCanvasContext = h6.getContext("2d");
    var p = h6.style;
    p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none";
  }
  f.font = "".concat(u, " ").concat(v, " ").concat(c, "px ").concat(d);
  for (var m = 0, g = 0, y = e.split(`
`), b = 0; b < y.length; b++) {
    var w = y[b], C = f.measureText(w), E = Math.ceil(C.width), x = c;
    m = Math.max(E, m), g += x;
  }
  return m += l, g += l, o[i] = {
    width: m,
    height: g
  };
};
nn.calculateLabelAngle = function(t13, e) {
  var r = t13._private, n = r.rscratch, a = t13.isEdge(), i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = o.strValue;
  return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue;
};
nn.calculateLabelAngles = function(t13) {
  var e = this, r = t13.isEdge(), n = t13._private, a = n.rscratch;
  a.labelAngle = e.calculateLabelAngle(t13), r && (a.sourceLabelAngle = e.calculateLabelAngle(t13, "source"), a.targetLabelAngle = e.calculateLabelAngle(t13, "target"));
};
var hg = {};
var iv = 28;
var ov = false;
hg.getNodeShape = function(t13) {
  var e = this, r = t13.pstyle("shape").value;
  if (r === "cutrectangle" && (t13.width() < iv || t13.height() < iv))
    return ov || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), ov = true), "rectangle";
  if (t13.isParent())
    return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle";
  if (r === "polygon") {
    var n = t13.pstyle("shape-polygon-points").value;
    return e.nodeShapes.makePolygon(n).name;
  }
  return r;
};
var ml = {};
ml.registerCalculationListeners = function() {
  var t13 = this.cy, e = t13.collection(), r = this, n = function(o) {
    var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
    if (e.merge(o), s)
      for (var l = 0; l < o.length; l++) {
        var u = o[l], c = u._private, d = c.rstyle;
        d.clean = false, d.cleanConnected = false;
      }
  };
  r.binder(t13).on("bounds.* dirty.*", function(o) {
    var s = o.target;
    n(s);
  }).on("style.* background.*", function(o) {
    var s = o.target;
    n(s, false);
  });
  var a = function(o) {
    if (o) {
      var s = r.onUpdateEleCalcsFns;
      e.cleanStyle();
      for (var l = 0; l < e.length; l++) {
        var u = e[l], c = u._private.rstyle;
        u.isNode() && !c.cleanConnected && (n(u.connectedEdges()), c.cleanConnected = true);
      }
      if (s)
        for (var d = 0; d < s.length; d++) {
          var v = s[d];
          v(o, e);
        }
      r.recalculateRenderedStyle(e), e = t13.collection();
    }
  };
  r.flushRenderedStyleQueue = function() {
    a(true);
  }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs);
};
ml.onUpdateEleCalcs = function(t13) {
  var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || [];
  e.push(t13);
};
ml.recalculateRenderedStyle = function(t13, e) {
  var r = function(w) {
    return w._private.rstyle.cleanConnected;
  }, n = [], a = [];
  if (!this.destroyed) {
    e === void 0 && (e = true);
    for (var i = 0; i < t13.length; i++) {
      var o = t13[i], s = o._private, l = s.rstyle;
      o.isEdge() && (!r(o.source()) || !r(o.target())) && (l.clean = false), !(e && l.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), l.clean = true);
    }
    for (var u = 0; u < a.length; u++) {
      var c = a[u], d = c._private, v = d.rstyle, h6 = c.position();
      this.recalculateNodeLabelProjection(c), v.nodeX = h6.x, v.nodeY = h6.y, v.nodeW = c.pstyle("width").pfValue, v.nodeH = c.pstyle("height").pfValue;
    }
    this.recalculateEdgeProjections(n);
    for (var f = 0; f < n.length; f++) {
      var p = n[f], m = p._private, g = m.rstyle, y = m.rscratch;
      g.srcX = y.arrowStartX, g.srcY = y.arrowStartY, g.tgtX = y.arrowEndX, g.tgtY = y.arrowEndY, g.midX = y.midX, g.midY = y.midY, g.labelAngle = y.labelAngle, g.sourceLabelAngle = y.sourceLabelAngle, g.targetLabelAngle = y.targetLabelAngle;
    }
  }
};
var yl = {};
yl.updateCachedGrabbedEles = function() {
  var t13 = this.cachedZSortedEles;
  if (t13) {
    t13.drag = [], t13.nondrag = [];
    for (var e = [], r = 0; r < t13.length; r++) {
      var n = t13[r], a = n._private.rscratch;
      n.grabbed() && !n.isParent() ? e.push(n) : a.inDragLayer ? t13.drag.push(n) : t13.nondrag.push(n);
    }
    for (var r = 0; r < e.length; r++) {
      var n = e[r];
      t13.drag.push(n);
    }
  }
};
yl.invalidateCachedZSortedEles = function() {
  this.cachedZSortedEles = null;
};
yl.getCachedZSortedEles = function(t13) {
  if (t13 || !this.cachedZSortedEles) {
    var e = this.cy.mutableElements().toArray();
    e.sort(Xp), e.interactive = e.filter(function(r) {
      return r.interactive();
    }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles();
  } else
    e = this.cachedZSortedEles;
  return e;
};
var pg = {};
[Da, Rs, or, Ao, Pc, nn, hg, ml, yl].forEach(function(t13) {
  ze(pg, t13);
});
var gg = {};
gg.getCachedImage = function(t13, e, r) {
  var n = this, a = n.imageCache = n.imageCache || {}, i = a[t13];
  if (i)
    return i.image.complete || i.image.addEventListener("load", r), i.image;
  i = a[t13] = a[t13] || {};
  var o = i.image = new Image();
  o.addEventListener("load", r), o.addEventListener("error", function() {
    o.error = true;
  });
  var s = "data:", l = t13.substring(0, s.length).toLowerCase() === s;
  return l || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t13, o;
};
var Ei = {};
Ei.registerBinding = function(t13, e, r, n) {
  var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t13);
  return i.on.apply(i, a);
};
Ei.binder = function(t13) {
  var e = this, r = e.cy.window(), n = t13 === r || t13 === r.document || t13 === r.document.body || wT(t13);
  if (e.supportsPassiveEvents == null) {
    var a = false;
    try {
      var i = Object.defineProperty({}, "passive", {
        get: function() {
          return a = true, true;
        }
      });
      r.addEventListener("test", null, i);
    } catch {
    }
    e.supportsPassiveEvents = a;
  }
  var o = function(l, u, c) {
    var d = Array.prototype.slice.call(arguments);
    return n && e.supportsPassiveEvents && (d[2] = {
      capture: c ?? false,
      passive: false,
      once: false
    }), e.bindings.push({
      target: t13,
      args: d
    }), (t13.addEventListener || t13.on).apply(t13, d), this;
  };
  return {
    on: o,
    addEventListener: o,
    addListener: o,
    bind: o
  };
};
Ei.nodeIsDraggable = function(t13) {
  return t13 && t13.isNode() && !t13.locked() && t13.grabbable();
};
Ei.nodeIsGrabbable = function(t13) {
  return this.nodeIsDraggable(t13) && t13.interactive();
};
Ei.load = function() {
  var t13 = this, e = t13.cy.window(), r = function(S) {
    return S.selected();
  }, n = function(S, z, ae, Q) {
    S == null && (S = t13.cy);
    for (var X = 0; X < z.length; X++) {
      var pe = z[X];
      S.emit({
        originalEvent: ae,
        type: pe,
        position: Q
      });
    }
  }, a = function(S) {
    return S.shiftKey || S.metaKey || S.ctrlKey;
  }, i = function(S, z) {
    var ae = true;
    if (t13.cy.hasCompoundNodes() && S && S.pannable())
      for (var Q = 0; z && Q < z.length; Q++) {
        var S = z[Q];
        if (S.isNode() && S.isParent() && !S.pannable()) {
          ae = false;
          break;
        }
      }
    else
      ae = true;
    return ae;
  }, o = function(S) {
    S[0]._private.grabbed = true;
  }, s = function(S) {
    S[0]._private.grabbed = false;
  }, l = function(S) {
    S[0]._private.rscratch.inDragLayer = true;
  }, u = function(S) {
    S[0]._private.rscratch.inDragLayer = false;
  }, c = function(S) {
    S[0]._private.rscratch.isGrabTarget = true;
  }, d = function(S) {
    S[0]._private.rscratch.isGrabTarget = false;
  }, v = function(S, z) {
    var ae = z.addToList, Q = ae.has(S);
    !Q && S.grabbable() && !S.locked() && (ae.merge(S), o(S));
  }, h6 = function(S, z) {
    if (S.cy().hasCompoundNodes() && !(z.inDragLayer == null && z.addToList == null)) {
      var ae = S.descendants();
      z.inDragLayer && (ae.forEach(l), ae.connectedEdges().forEach(l)), z.addToList && v(ae, z);
    }
  }, f = function(S, z) {
    z = z || {};
    var ae = S.cy().hasCompoundNodes();
    z.inDragLayer && (S.forEach(l), S.neighborhood().stdFilter(function(Q) {
      return !ae || Q.isEdge();
    }).forEach(l)), z.addToList && S.forEach(function(Q) {
      v(Q, z);
    }), h6(S, z), g(S, {
      inDragLayer: z.inDragLayer
    }), t13.updateCachedGrabbedEles();
  }, p = f, m = function(S) {
    S && (t13.getCachedZSortedEles().forEach(function(z) {
      s(z), u(z), d(z);
    }), t13.updateCachedGrabbedEles());
  }, g = function(S, z) {
    if (!(z.inDragLayer == null && z.addToList == null) && S.cy().hasCompoundNodes()) {
      var ae = S.ancestors().orphans();
      if (!ae.same(S)) {
        var Q = ae.descendants().spawnSelf().merge(ae).unmerge(S).unmerge(S.descendants()), X = Q.connectedEdges();
        z.inDragLayer && (X.forEach(l), Q.forEach(l)), z.addToList && Q.forEach(function(pe) {
          v(pe, z);
        });
      }
    }
  }, y = function() {
    document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur();
  }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u";
  b ? (t13.removeObserver = new MutationObserver(function(le) {
    for (var S = 0; S < le.length; S++) {
      var z = le[S], ae = z.removedNodes;
      if (ae)
        for (var Q = 0; Q < ae.length; Q++) {
          var X = ae[Q];
          if (X === t13.container) {
            t13.destroy();
            break;
          }
        }
    }
  }), t13.container.parentNode && t13.removeObserver.observe(t13.container.parentNode, {
    childList: true
  })) : t13.registerBinding(t13.container, "DOMNodeRemoved", function(le) {
    t13.destroy();
  });
  var C = nl(function() {
    t13.cy.resize();
  }, 100);
  b && (t13.styleObserver = new MutationObserver(C), t13.styleObserver.observe(t13.container, {
    attributes: true
  })), t13.registerBinding(e, "resize", C), w && (t13.resizeObserver = new ResizeObserver(C), t13.resizeObserver.observe(t13.container));
  var E = function(S, z) {
    for (; S != null; )
      z(S), S = S.parentNode;
  }, x = function() {
    t13.invalidateContainerClientCoordsCache();
  };
  E(t13.container, function(le) {
    t13.registerBinding(le, "transitionend", x), t13.registerBinding(le, "animationend", x), t13.registerBinding(le, "scroll", x);
  }), t13.registerBinding(t13.container, "contextmenu", function(le) {
    le.preventDefault();
  });
  var T = function() {
    return t13.selection[4] !== 0;
  }, k = function(S) {
    for (var z = t13.findContainerClientCoords(), ae = z[0], Q = z[1], X = z[2], pe = z[3], re = S.touches ? S.touches : [S], he = false, Fe = 0; Fe < re.length; Fe++) {
      var Me = re[Fe];
      if (ae <= Me.clientX && Me.clientX <= ae + X && Q <= Me.clientY && Me.clientY <= Q + pe) {
        he = true;
        break;
      }
    }
    if (!he)
      return false;
    for (var _e = t13.container, Re = S.target, Te = Re.parentNode, Le = false; Te; ) {
      if (Te === _e) {
        Le = true;
        break;
      }
      Te = Te.parentNode;
    }
    return !!Le;
  };
  t13.registerBinding(t13.container, "mousedown", function(S) {
    if (k(S) && !(t13.hoverData.which === 1 && S.which !== 1)) {
      S.preventDefault(), y(), t13.hoverData.capture = true, t13.hoverData.which = S.which;
      var z = t13.cy, ae = [S.clientX, S.clientY], Q = t13.projectIntoViewport(ae[0], ae[1]), X = t13.selection, pe = t13.findNearestElements(Q[0], Q[1], true, false), re = pe[0], he = t13.dragData.possibleDragElements;
      t13.hoverData.mdownPos = Q, t13.hoverData.mdownGPos = ae;
      var Fe = function() {
        t13.hoverData.tapholdCancelled = false, clearTimeout(t13.hoverData.tapholdTimeout), t13.hoverData.tapholdTimeout = setTimeout(function() {
          if (!t13.hoverData.tapholdCancelled) {
            var ut = t13.hoverData.down;
            ut ? ut.emit({
              originalEvent: S,
              type: "taphold",
              position: {
                x: Q[0],
                y: Q[1]
              }
            }) : z.emit({
              originalEvent: S,
              type: "taphold",
              position: {
                x: Q[0],
                y: Q[1]
              }
            });
          }
        }, t13.tapholdDuration);
      };
      if (S.which == 3) {
        t13.hoverData.cxtStarted = true;
        var Me = {
          originalEvent: S,
          type: "cxttapstart",
          position: {
            x: Q[0],
            y: Q[1]
          }
        };
        re ? (re.activate(), re.emit(Me), t13.hoverData.down = re) : z.emit(Me), t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t13.hoverData.cxtDragged = false;
      } else if (S.which == 1) {
        re && re.activate();
        {
          if (re != null && t13.nodeIsGrabbable(re)) {
            var _e = function(ut) {
              return {
                originalEvent: S,
                type: ut,
                position: {
                  x: Q[0],
                  y: Q[1]
                }
              };
            }, Re = function(ut) {
              ut.emit(_e("grab"));
            };
            if (c(re), !re.selected())
              he = t13.dragData.possibleDragElements = z.collection(), p(re, {
                addToList: he
              }), re.emit(_e("grabon")).emit(_e("grab"));
            else {
              he = t13.dragData.possibleDragElements = z.collection();
              var Te = z.$(function(Le) {
                return Le.isNode() && Le.selected() && t13.nodeIsGrabbable(Le);
              });
              f(Te, {
                addToList: he
              }), re.emit(_e("grabon")), Te.forEach(Re);
            }
            t13.redrawHint("eles", true), t13.redrawHint("drag", true);
          }
          t13.hoverData.down = re, t13.hoverData.downs = pe, t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime();
        }
        n(re, ["mousedown", "tapstart", "vmousedown"], S, {
          x: Q[0],
          y: Q[1]
        }), re == null ? (X[4] = 1, t13.data.bgActivePosistion = {
          x: Q[0],
          y: Q[1]
        }, t13.redrawHint("select", true), t13.redraw()) : re.pannable() && (X[4] = 1), Fe();
      }
      X[0] = X[2] = Q[0], X[1] = X[3] = Q[1];
    }
  }, false), t13.registerBinding(e, "mousemove", function(S) {
    var z = t13.hoverData.capture;
    if (!(!z && !k(S))) {
      var ae = false, Q = t13.cy, X = Q.zoom(), pe = [S.clientX, S.clientY], re = t13.projectIntoViewport(pe[0], pe[1]), he = t13.hoverData.mdownPos, Fe = t13.hoverData.mdownGPos, Me = t13.selection, _e = null;
      !t13.hoverData.draggingEles && !t13.hoverData.dragging && !t13.hoverData.selecting && (_e = t13.findNearestElement(re[0], re[1], true, false));
      var Re = t13.hoverData.last, Te = t13.hoverData.down, Le = [re[0] - Me[2], re[1] - Me[3]], ut = t13.dragData.possibleDragElements, nt;
      if (Fe) {
        var kt = pe[0] - Fe[0], St = kt * kt, wt = pe[1] - Fe[1], Zt = wt * wt, Pt = St + Zt;
        t13.hoverData.isOverThresholdDrag = nt = Pt >= t13.desktopTapThreshold2;
      }
      var Bt = a(S);
      nt && (t13.hoverData.tapholdCancelled = true);
      var gr = function() {
        var j = t13.hoverData.dragDelta = t13.hoverData.dragDelta || [];
        j.length === 0 ? (j.push(Le[0]), j.push(Le[1])) : (j[0] += Le[0], j[1] += Le[1]);
      };
      ae = true, n(_e, ["mousemove", "vmousemove", "tapdrag"], S, {
        x: re[0],
        y: re[1]
      });
      var Xt = function() {
        t13.data.bgActivePosistion = void 0, t13.hoverData.selecting || Q.emit({
          originalEvent: S,
          type: "boxstart",
          position: {
            x: re[0],
            y: re[1]
          }
        }), Me[4] = 1, t13.hoverData.selecting = true, t13.redrawHint("select", true), t13.redraw();
      };
      if (t13.hoverData.which === 3) {
        if (nt) {
          var Qt = {
            originalEvent: S,
            type: "cxtdrag",
            position: {
              x: re[0],
              y: re[1]
            }
          };
          Te ? Te.emit(Qt) : Q.emit(Qt), t13.hoverData.cxtDragged = true, (!t13.hoverData.cxtOver || _e !== t13.hoverData.cxtOver) && (t13.hoverData.cxtOver && t13.hoverData.cxtOver.emit({
            originalEvent: S,
            type: "cxtdragout",
            position: {
              x: re[0],
              y: re[1]
            }
          }), t13.hoverData.cxtOver = _e, _e && _e.emit({
            originalEvent: S,
            type: "cxtdragover",
            position: {
              x: re[0],
              y: re[1]
            }
          }));
        }
      } else if (t13.hoverData.dragging) {
        if (ae = true, Q.panningEnabled() && Q.userPanningEnabled()) {
          var wr;
          if (t13.hoverData.justStartedPan) {
            var Pr = t13.hoverData.mdownPos;
            wr = {
              x: (re[0] - Pr[0]) * X,
              y: (re[1] - Pr[1]) * X
            }, t13.hoverData.justStartedPan = false;
          } else
            wr = {
              x: Le[0] * X,
              y: Le[1] * X
            };
          Q.panBy(wr), Q.emit("dragpan"), t13.hoverData.dragged = true;
        }
        re = t13.projectIntoViewport(S.clientX, S.clientY);
      } else if (Me[4] == 1 && (Te == null || Te.pannable())) {
        if (nt) {
          if (!t13.hoverData.dragging && Q.boxSelectionEnabled() && (Bt || !Q.panningEnabled() || !Q.userPanningEnabled()))
            Xt();
          else if (!t13.hoverData.selecting && Q.panningEnabled() && Q.userPanningEnabled()) {
            var ur = i(Te, t13.hoverData.downs);
            ur && (t13.hoverData.dragging = true, t13.hoverData.justStartedPan = true, Me[4] = 0, t13.data.bgActivePosistion = Ka(he), t13.redrawHint("select", true), t13.redraw());
          }
          Te && Te.pannable() && Te.active() && Te.unactivate();
        }
      } else {
        if (Te && Te.pannable() && Te.active() && Te.unactivate(), (!Te || !Te.grabbed()) && _e != Re && (Re && n(Re, ["mouseout", "tapdragout"], S, {
          x: re[0],
          y: re[1]
        }), _e && n(_e, ["mouseover", "tapdragover"], S, {
          x: re[0],
          y: re[1]
        }), t13.hoverData.last = _e), Te)
          if (nt) {
            if (Q.boxSelectionEnabled() && Bt)
              Te && Te.grabbed() && (m(ut), Te.emit("freeon"), ut.emit("free"), t13.dragData.didDrag && (Te.emit("dragfreeon"), ut.emit("dragfree"))), Xt();
            else if (Te && Te.grabbed() && t13.nodeIsDraggable(Te)) {
              var Ct = !t13.dragData.didDrag;
              Ct && t13.redrawHint("eles", true), t13.dragData.didDrag = true, t13.hoverData.draggingEles || f(ut, {
                inDragLayer: true
              });
              var Tt = {
                x: 0,
                y: 0
              };
              if (be(Le[0]) && be(Le[1]) && (Tt.x += Le[0], Tt.y += Le[1], Ct)) {
                var Nt = t13.hoverData.dragDelta;
                Nt && be(Nt[0]) && be(Nt[1]) && (Tt.x += Nt[0], Tt.y += Nt[1]);
              }
              t13.hoverData.draggingEles = true, ut.silentShift(Tt).emit("position drag"), t13.redrawHint("drag", true), t13.redraw();
            }
          } else
            gr();
        ae = true;
      }
      if (Me[2] = re[0], Me[3] = re[1], ae)
        return S.stopPropagation && S.stopPropagation(), S.preventDefault && S.preventDefault(), false;
    }
  }, false);
  var _, D, O;
  t13.registerBinding(e, "mouseup", function(S) {
    if (!(t13.hoverData.which === 1 && S.which !== 1 && t13.hoverData.capture)) {
      var z = t13.hoverData.capture;
      if (z) {
        t13.hoverData.capture = false;
        var ae = t13.cy, Q = t13.projectIntoViewport(S.clientX, S.clientY), X = t13.selection, pe = t13.findNearestElement(Q[0], Q[1], true, false), re = t13.dragData.possibleDragElements, he = t13.hoverData.down, Fe = a(S);
        if (t13.data.bgActivePosistion && (t13.redrawHint("select", true), t13.redraw()), t13.hoverData.tapholdCancelled = true, t13.data.bgActivePosistion = void 0, he && he.unactivate(), t13.hoverData.which === 3) {
          var Me = {
            originalEvent: S,
            type: "cxttapend",
            position: {
              x: Q[0],
              y: Q[1]
            }
          };
          if (he ? he.emit(Me) : ae.emit(Me), !t13.hoverData.cxtDragged) {
            var _e = {
              originalEvent: S,
              type: "cxttap",
              position: {
                x: Q[0],
                y: Q[1]
              }
            };
            he ? he.emit(_e) : ae.emit(_e);
          }
          t13.hoverData.cxtDragged = false, t13.hoverData.which = null;
        } else if (t13.hoverData.which === 1) {
          if (n(pe, ["mouseup", "tapend", "vmouseup"], S, {
            x: Q[0],
            y: Q[1]
          }), !t13.dragData.didDrag && // didn't move a node around
          !t13.hoverData.dragged && // didn't pan
          !t13.hoverData.selecting && // not box selection
          !t13.hoverData.isOverThresholdDrag && (n(he, ["click", "tap", "vclick"], S, {
            x: Q[0],
            y: Q[1]
          }), D = false, S.timeStamp - O <= ae.multiClickDebounceTime() ? (_ && clearTimeout(_), D = true, O = null, n(he, ["dblclick", "dbltap", "vdblclick"], S, {
            x: Q[0],
            y: Q[1]
          })) : (_ = setTimeout(function() {
            D || n(he, ["oneclick", "onetap", "voneclick"], S, {
              x: Q[0],
              y: Q[1]
            });
          }, ae.multiClickDebounceTime()), O = S.timeStamp)), he == null && !t13.dragData.didDrag && !t13.hoverData.selecting && !t13.hoverData.dragged && !a(S) && (ae.$(r).unselect(["tapunselect"]), re.length > 0 && t13.redrawHint("eles", true), t13.dragData.possibleDragElements = re = ae.collection()), pe == he && !t13.dragData.didDrag && !t13.hoverData.selecting && pe != null && pe._private.selectable && (t13.hoverData.dragging || (ae.selectionType() === "additive" || Fe ? pe.selected() ? pe.unselect(["tapunselect"]) : pe.select(["tapselect"]) : Fe || (ae.$(r).unmerge(pe).unselect(["tapunselect"]), pe.select(["tapselect"]))), t13.redrawHint("eles", true)), t13.hoverData.selecting) {
            var Re = ae.collection(t13.getAllInBox(X[0], X[1], X[2], X[3]));
            t13.redrawHint("select", true), Re.length > 0 && t13.redrawHint("eles", true), ae.emit({
              type: "boxend",
              originalEvent: S,
              position: {
                x: Q[0],
                y: Q[1]
              }
            });
            var Te = function(nt) {
              return nt.selectable() && !nt.selected();
            };
            ae.selectionType() === "additive" || Fe || ae.$(r).unmerge(Re).unselect(), Re.emit("box").stdFilter(Te).select().emit("boxselect"), t13.redraw();
          }
          if (t13.hoverData.dragging && (t13.hoverData.dragging = false, t13.redrawHint("select", true), t13.redrawHint("eles", true), t13.redraw()), !X[4]) {
            t13.redrawHint("drag", true), t13.redrawHint("eles", true);
            var Le = he && he.grabbed();
            m(re), Le && (he.emit("freeon"), re.emit("free"), t13.dragData.didDrag && (he.emit("dragfreeon"), re.emit("dragfree")));
          }
        }
        X[4] = 0, t13.hoverData.down = null, t13.hoverData.cxtStarted = false, t13.hoverData.draggingEles = false, t13.hoverData.selecting = false, t13.hoverData.isOverThresholdDrag = false, t13.dragData.didDrag = false, t13.hoverData.dragged = false, t13.hoverData.dragDelta = [], t13.hoverData.mdownPos = null, t13.hoverData.mdownGPos = null, t13.hoverData.which = null;
      }
    }
  }, false);
  var A = function(S) {
    if (!t13.scrollingPage) {
      var z = t13.cy, ae = z.zoom(), Q = z.pan(), X = t13.projectIntoViewport(S.clientX, S.clientY), pe = [X[0] * ae + Q.x, X[1] * ae + Q.y];
      if (t13.hoverData.draggingEles || t13.hoverData.dragging || t13.hoverData.cxtStarted || T()) {
        S.preventDefault();
        return;
      }
      if (z.panningEnabled() && z.userPanningEnabled() && z.zoomingEnabled() && z.userZoomingEnabled()) {
        S.preventDefault(), t13.data.wheelZooming = true, clearTimeout(t13.data.wheelTimeout), t13.data.wheelTimeout = setTimeout(function() {
          t13.data.wheelZooming = false, t13.redrawHint("eles", true), t13.redraw();
        }, 150);
        var re;
        S.deltaY != null ? re = S.deltaY / -250 : S.wheelDeltaY != null ? re = S.wheelDeltaY / 1e3 : re = S.wheelDelta / 1e3, re = re * t13.wheelSensitivity;
        var he = S.deltaMode === 1;
        he && (re *= 33);
        var Fe = z.zoom() * Math.pow(10, re);
        S.type === "gesturechange" && (Fe = t13.gestureStartZoom * S.scale), z.zoom({
          level: Fe,
          renderedPosition: {
            x: pe[0],
            y: pe[1]
          }
        }), z.emit(S.type === "gesturechange" ? "pinchzoom" : "scrollzoom");
      }
    }
  };
  t13.registerBinding(t13.container, "wheel", A, true), t13.registerBinding(e, "scroll", function(S) {
    t13.scrollingPage = true, clearTimeout(t13.scrollingPageTimeout), t13.scrollingPageTimeout = setTimeout(function() {
      t13.scrollingPage = false;
    }, 250);
  }, true), t13.registerBinding(t13.container, "gesturestart", function(S) {
    t13.gestureStartZoom = t13.cy.zoom(), t13.hasTouchStarted || S.preventDefault();
  }, true), t13.registerBinding(t13.container, "gesturechange", function(le) {
    t13.hasTouchStarted || A(le);
  }, true), t13.registerBinding(t13.container, "mouseout", function(S) {
    var z = t13.projectIntoViewport(S.clientX, S.clientY);
    t13.cy.emit({
      originalEvent: S,
      type: "mouseout",
      position: {
        x: z[0],
        y: z[1]
      }
    });
  }, false), t13.registerBinding(t13.container, "mouseover", function(S) {
    var z = t13.projectIntoViewport(S.clientX, S.clientY);
    t13.cy.emit({
      originalEvent: S,
      type: "mouseover",
      position: {
        x: z[0],
        y: z[1]
      }
    });
  }, false);
  var L, N, I, M, F, $, U, H, K, ee, se, oe, ne, ue = function(S, z, ae, Q) {
    return Math.sqrt((ae - S) * (ae - S) + (Q - z) * (Q - z));
  }, te = function(S, z, ae, Q) {
    return (ae - S) * (ae - S) + (Q - z) * (Q - z);
  }, R;
  t13.registerBinding(t13.container, "touchstart", R = function(S) {
    if (t13.hasTouchStarted = true, !!k(S)) {
      y(), t13.touchData.capture = true, t13.data.bgActivePosistion = void 0;
      var z = t13.cy, ae = t13.touchData.now, Q = t13.touchData.earlier;
      if (S.touches[0]) {
        var X = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY);
        ae[0] = X[0], ae[1] = X[1];
      }
      if (S.touches[1]) {
        var X = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY);
        ae[2] = X[0], ae[3] = X[1];
      }
      if (S.touches[2]) {
        var X = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY);
        ae[4] = X[0], ae[5] = X[1];
      }
      if (S.touches[1]) {
        t13.touchData.singleTouchMoved = true, m(t13.dragData.touchDragEles);
        var pe = t13.findContainerClientCoords();
        K = pe[0], ee = pe[1], se = pe[2], oe = pe[3], L = S.touches[0].clientX - K, N = S.touches[0].clientY - ee, I = S.touches[1].clientX - K, M = S.touches[1].clientY - ee, ne = 0 <= L && L <= se && 0 <= I && I <= se && 0 <= N && N <= oe && 0 <= M && M <= oe;
        var re = z.pan(), he = z.zoom();
        F = ue(L, N, I, M), $ = te(L, N, I, M), U = [(L + I) / 2, (N + M) / 2], H = [(U[0] - re.x) / he, (U[1] - re.y) / he];
        var Fe = 200, Me = Fe * Fe;
        if ($ < Me && !S.touches[2]) {
          var _e = t13.findNearestElement(ae[0], ae[1], true, true), Re = t13.findNearestElement(ae[2], ae[3], true, true);
          _e && _e.isNode() ? (_e.activate().emit({
            originalEvent: S,
            type: "cxttapstart",
            position: {
              x: ae[0],
              y: ae[1]
            }
          }), t13.touchData.start = _e) : Re && Re.isNode() ? (Re.activate().emit({
            originalEvent: S,
            type: "cxttapstart",
            position: {
              x: ae[0],
              y: ae[1]
            }
          }), t13.touchData.start = Re) : z.emit({
            originalEvent: S,
            type: "cxttapstart",
            position: {
              x: ae[0],
              y: ae[1]
            }
          }), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = true, t13.touchData.cxtDragged = false, t13.data.bgActivePosistion = void 0, t13.redraw();
          return;
        }
      }
      if (S.touches[2])
        z.boxSelectionEnabled() && S.preventDefault();
      else if (!S.touches[1]) {
        if (S.touches[0]) {
          var Te = t13.findNearestElements(ae[0], ae[1], true, true), Le = Te[0];
          if (Le != null && (Le.activate(), t13.touchData.start = Le, t13.touchData.starts = Te, t13.nodeIsGrabbable(Le))) {
            var ut = t13.dragData.touchDragEles = z.collection(), nt = null;
            t13.redrawHint("eles", true), t13.redrawHint("drag", true), Le.selected() ? (nt = z.$(function(Pt) {
              return Pt.selected() && t13.nodeIsGrabbable(Pt);
            }), f(nt, {
              addToList: ut
            })) : p(Le, {
              addToList: ut
            }), c(Le);
            var kt = function(Bt) {
              return {
                originalEvent: S,
                type: Bt,
                position: {
                  x: ae[0],
                  y: ae[1]
                }
              };
            };
            Le.emit(kt("grabon")), nt ? nt.forEach(function(Pt) {
              Pt.emit(kt("grab"));
            }) : Le.emit(kt("grab"));
          }
          n(Le, ["touchstart", "tapstart", "vmousedown"], S, {
            x: ae[0],
            y: ae[1]
          }), Le == null && (t13.data.bgActivePosistion = {
            x: X[0],
            y: X[1]
          }, t13.redrawHint("select", true), t13.redraw()), t13.touchData.singleTouchMoved = false, t13.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t13.touchData.tapholdTimeout), t13.touchData.tapholdTimeout = setTimeout(function() {
            t13.touchData.singleTouchMoved === false && !t13.pinching && !t13.touchData.selecting && n(t13.touchData.start, ["taphold"], S, {
              x: ae[0],
              y: ae[1]
            });
          }, t13.tapholdDuration);
        }
      }
      if (S.touches.length >= 1) {
        for (var St = t13.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ae.length; wt++)
          St[wt] = Q[wt] = ae[wt];
        var Zt = S.touches[0];
        t13.touchData.startGPosition = [Zt.clientX, Zt.clientY];
      }
    }
  }, false);
  var Y;
  t13.registerBinding(e, "touchmove", Y = function(S) {
    var z = t13.touchData.capture;
    if (!(!z && !k(S))) {
      var ae = t13.selection, Q = t13.cy, X = t13.touchData.now, pe = t13.touchData.earlier, re = Q.zoom();
      if (S.touches[0]) {
        var he = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY);
        X[0] = he[0], X[1] = he[1];
      }
      if (S.touches[1]) {
        var he = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY);
        X[2] = he[0], X[3] = he[1];
      }
      if (S.touches[2]) {
        var he = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY);
        X[4] = he[0], X[5] = he[1];
      }
      var Fe = t13.touchData.startGPosition, Me;
      if (z && S.touches[0] && Fe) {
        for (var _e = [], Re = 0; Re < X.length; Re++)
          _e[Re] = X[Re] - pe[Re];
        var Te = S.touches[0].clientX - Fe[0], Le = Te * Te, ut = S.touches[0].clientY - Fe[1], nt = ut * ut, kt = Le + nt;
        Me = kt >= t13.touchTapThreshold2;
      }
      if (z && t13.touchData.cxt) {
        S.preventDefault();
        var St = S.touches[0].clientX - K, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - K, Pt = S.touches[1].clientY - ee, Bt = te(St, wt, Zt, Pt), gr = Bt / $, Xt = 150, Qt = Xt * Xt, wr = 1.5, Pr = wr * wr;
        if (gr >= Pr || Bt >= Qt) {
          t13.touchData.cxt = false, t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true);
          var ur = {
            originalEvent: S,
            type: "cxttapend",
            position: {
              x: X[0],
              y: X[1]
            }
          };
          t13.touchData.start ? (t13.touchData.start.unactivate().emit(ur), t13.touchData.start = null) : Q.emit(ur);
        }
      }
      if (z && t13.touchData.cxt) {
        var ur = {
          originalEvent: S,
          type: "cxtdrag",
          position: {
            x: X[0],
            y: X[1]
          }
        };
        t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.touchData.start ? t13.touchData.start.emit(ur) : Q.emit(ur), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxtDragged = true;
        var Ct = t13.findNearestElement(X[0], X[1], true, true);
        (!t13.touchData.cxtOver || Ct !== t13.touchData.cxtOver) && (t13.touchData.cxtOver && t13.touchData.cxtOver.emit({
          originalEvent: S,
          type: "cxtdragout",
          position: {
            x: X[0],
            y: X[1]
          }
        }), t13.touchData.cxtOver = Ct, Ct && Ct.emit({
          originalEvent: S,
          type: "cxtdragover",
          position: {
            x: X[0],
            y: X[1]
          }
        }));
      } else if (z && S.touches[2] && Q.boxSelectionEnabled())
        S.preventDefault(), t13.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t13.touchData.selecting || Q.emit({
          originalEvent: S,
          type: "boxstart",
          position: {
            x: X[0],
            y: X[1]
          }
        }), t13.touchData.selecting = true, t13.touchData.didSelect = true, ae[4] = 1, !ae || ae.length === 0 || ae[0] === void 0 ? (ae[0] = (X[0] + X[2] + X[4]) / 3, ae[1] = (X[1] + X[3] + X[5]) / 3, ae[2] = (X[0] + X[2] + X[4]) / 3 + 1, ae[3] = (X[1] + X[3] + X[5]) / 3 + 1) : (ae[2] = (X[0] + X[2] + X[4]) / 3, ae[3] = (X[1] + X[3] + X[5]) / 3), t13.redrawHint("select", true), t13.redraw();
      else if (z && S.touches[1] && !t13.touchData.didSelect && Q.zoomingEnabled() && Q.panningEnabled() && Q.userZoomingEnabled() && Q.userPanningEnabled()) {
        S.preventDefault(), t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true);
        var Tt = t13.dragData.touchDragEles;
        if (Tt) {
          t13.redrawHint("drag", true);
          for (var Nt = 0; Nt < Tt.length; Nt++) {
            var kn = Tt[Nt]._private;
            kn.grabbed = false, kn.rscratch.inDragLayer = false;
          }
        }
        var j = t13.touchData.start, St = S.touches[0].clientX - K, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - K, Pt = S.touches[1].clientY - ee, we = ue(St, wt, Zt, Pt), We = we / F;
        if (ne) {
          var at = St - L, Gr = wt - N, Sn = Zt - I, La = Pt - M, on = (at + Sn) / 2, Cr = (Gr + La) / 2, Tn = Q.zoom(), bl = Tn * We, Bo = Q.pan(), Ac = H[0] * Tn + Bo.x, Fc = H[1] * Tn + Bo.y, pm = {
            x: -bl / Tn * (Ac - Bo.x - on) + Ac,
            y: -bl / Tn * (Fc - Bo.y - Cr) + Fc
          };
          if (j && j.active()) {
            var Tt = t13.dragData.touchDragEles;
            m(Tt), t13.redrawHint("drag", true), t13.redrawHint("eles", true), j.unactivate().emit("freeon"), Tt.emit("free"), t13.dragData.didDrag && (j.emit("dragfreeon"), Tt.emit("dragfree"));
          }
          Q.viewport({
            zoom: bl,
            pan: pm,
            cancelOnFailedZoom: true
          }), Q.emit("pinchzoom"), F = we, L = St, N = wt, I = Zt, M = Pt, t13.pinching = true;
        }
        if (S.touches[0]) {
          var he = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY);
          X[0] = he[0], X[1] = he[1];
        }
        if (S.touches[1]) {
          var he = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY);
          X[2] = he[0], X[3] = he[1];
        }
        if (S.touches[2]) {
          var he = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY);
          X[4] = he[0], X[5] = he[1];
        }
      } else if (S.touches[0] && !t13.touchData.didSelect) {
        var Or = t13.touchData.start, wl = t13.touchData.last, Ct;
        if (!t13.hoverData.draggingEles && !t13.swipePanning && (Ct = t13.findNearestElement(X[0], X[1], true, true)), z && Or != null && S.preventDefault(), z && Or != null && t13.nodeIsDraggable(Or))
          if (Me) {
            var Tt = t13.dragData.touchDragEles, Mc = !t13.dragData.didDrag;
            Mc && f(Tt, {
              inDragLayer: true
            }), t13.dragData.didDrag = true;
            var _i = {
              x: 0,
              y: 0
            };
            if (be(_e[0]) && be(_e[1]) && (_i.x += _e[0], _i.y += _e[1], Mc)) {
              t13.redrawHint("eles", true);
              var Lr = t13.touchData.dragDelta;
              Lr && be(Lr[0]) && be(Lr[1]) && (_i.x += Lr[0], _i.y += Lr[1]);
            }
            t13.hoverData.draggingEles = true, Tt.silentShift(_i).emit("position drag"), t13.redrawHint("drag", true), t13.touchData.startPosition[0] == pe[0] && t13.touchData.startPosition[1] == pe[1] && t13.redrawHint("eles", true), t13.redraw();
          } else {
            var Lr = t13.touchData.dragDelta = t13.touchData.dragDelta || [];
            Lr.length === 0 ? (Lr.push(_e[0]), Lr.push(_e[1])) : (Lr[0] += _e[0], Lr[1] += _e[1]);
          }
        if (n(Or || Ct, ["touchmove", "tapdrag", "vmousemove"], S, {
          x: X[0],
          y: X[1]
        }), (!Or || !Or.grabbed()) && Ct != wl && (wl && wl.emit({
          originalEvent: S,
          type: "tapdragout",
          position: {
            x: X[0],
            y: X[1]
          }
        }), Ct && Ct.emit({
          originalEvent: S,
          type: "tapdragover",
          position: {
            x: X[0],
            y: X[1]
          }
        })), t13.touchData.last = Ct, z)
          for (var Nt = 0; Nt < X.length; Nt++)
            X[Nt] && t13.touchData.startPosition[Nt] && Me && (t13.touchData.singleTouchMoved = true);
        if (z && (Or == null || Or.pannable()) && Q.panningEnabled() && Q.userPanningEnabled()) {
          var gm = i(Or, t13.touchData.starts);
          gm && (S.preventDefault(), t13.data.bgActivePosistion || (t13.data.bgActivePosistion = Ka(t13.touchData.startPosition)), t13.swipePanning ? (Q.panBy({
            x: _e[0] * re,
            y: _e[1] * re
          }), Q.emit("dragpan")) : Me && (t13.swipePanning = true, Q.panBy({
            x: Te * re,
            y: ut * re
          }), Q.emit("dragpan"), Or && (Or.unactivate(), t13.redrawHint("select", true), t13.touchData.start = null)));
          var he = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY);
          X[0] = he[0], X[1] = he[1];
        }
      }
      for (var Re = 0; Re < X.length; Re++)
        pe[Re] = X[Re];
      z && S.touches.length > 0 && !t13.hoverData.draggingEles && !t13.swipePanning && t13.data.bgActivePosistion != null && (t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.redraw());
    }
  }, false);
  var J;
  t13.registerBinding(e, "touchcancel", J = function(S) {
    var z = t13.touchData.start;
    t13.touchData.capture = false, z && z.unactivate();
  });
  var ge, Ee, ve, me;
  if (t13.registerBinding(e, "touchend", ge = function(S) {
    var z = t13.touchData.start, ae = t13.touchData.capture;
    if (ae)
      S.touches.length === 0 && (t13.touchData.capture = false), S.preventDefault();
    else
      return;
    var Q = t13.selection;
    t13.swipePanning = false, t13.hoverData.draggingEles = false;
    var X = t13.cy, pe = X.zoom(), re = t13.touchData.now, he = t13.touchData.earlier;
    if (S.touches[0]) {
      var Fe = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY);
      re[0] = Fe[0], re[1] = Fe[1];
    }
    if (S.touches[1]) {
      var Fe = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY);
      re[2] = Fe[0], re[3] = Fe[1];
    }
    if (S.touches[2]) {
      var Fe = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY);
      re[4] = Fe[0], re[5] = Fe[1];
    }
    z && z.unactivate();
    var Me;
    if (t13.touchData.cxt) {
      if (Me = {
        originalEvent: S,
        type: "cxttapend",
        position: {
          x: re[0],
          y: re[1]
        }
      }, z ? z.emit(Me) : X.emit(Me), !t13.touchData.cxtDragged) {
        var _e = {
          originalEvent: S,
          type: "cxttap",
          position: {
            x: re[0],
            y: re[1]
          }
        };
        z ? z.emit(_e) : X.emit(_e);
      }
      t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = false, t13.touchData.start = null, t13.redraw();
      return;
    }
    if (!S.touches[2] && X.boxSelectionEnabled() && t13.touchData.selecting) {
      t13.touchData.selecting = false;
      var Re = X.collection(t13.getAllInBox(Q[0], Q[1], Q[2], Q[3]));
      Q[0] = void 0, Q[1] = void 0, Q[2] = void 0, Q[3] = void 0, Q[4] = 0, t13.redrawHint("select", true), X.emit({
        type: "boxend",
        originalEvent: S,
        position: {
          x: re[0],
          y: re[1]
        }
      });
      var Te = function(Qt) {
        return Qt.selectable() && !Qt.selected();
      };
      Re.emit("box").stdFilter(Te).select().emit("boxselect"), Re.nonempty() && t13.redrawHint("eles", true), t13.redraw();
    }
    if (z != null && z.unactivate(), S.touches[2])
      t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true);
    else if (!S.touches[1]) {
      if (!S.touches[0]) {
        if (!S.touches[0]) {
          t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true);
          var Le = t13.dragData.touchDragEles;
          if (z != null) {
            var ut = z._private.grabbed;
            m(Le), t13.redrawHint("drag", true), t13.redrawHint("eles", true), ut && (z.emit("freeon"), Le.emit("free"), t13.dragData.didDrag && (z.emit("dragfreeon"), Le.emit("dragfree"))), n(z, ["touchend", "tapend", "vmouseup", "tapdragout"], S, {
              x: re[0],
              y: re[1]
            }), z.unactivate(), t13.touchData.start = null;
          } else {
            var nt = t13.findNearestElement(re[0], re[1], true, true);
            n(nt, ["touchend", "tapend", "vmouseup", "tapdragout"], S, {
              x: re[0],
              y: re[1]
            });
          }
          var kt = t13.touchData.startPosition[0] - re[0], St = kt * kt, wt = t13.touchData.startPosition[1] - re[1], Zt = wt * wt, Pt = St + Zt, Bt = Pt * pe * pe;
          t13.touchData.singleTouchMoved || (z || X.$(":selected").unselect(["tapunselect"]), n(z, ["tap", "vclick"], S, {
            x: re[0],
            y: re[1]
          }), Ee = false, S.timeStamp - me <= X.multiClickDebounceTime() ? (ve && clearTimeout(ve), Ee = true, me = null, n(z, ["dbltap", "vdblclick"], S, {
            x: re[0],
            y: re[1]
          })) : (ve = setTimeout(function() {
            Ee || n(z, ["onetap", "voneclick"], S, {
              x: re[0],
              y: re[1]
            });
          }, X.multiClickDebounceTime()), me = S.timeStamp)), z != null && !t13.dragData.didDrag && z._private.selectable && Bt < t13.touchTapThreshold2 && !t13.pinching && (X.selectionType() === "single" ? (X.$(r).unmerge(z).unselect(["tapunselect"]), z.select(["tapselect"])) : z.selected() ? z.unselect(["tapunselect"]) : z.select(["tapselect"]), t13.redrawHint("eles", true)), t13.touchData.singleTouchMoved = true;
        }
      }
    }
    for (var gr = 0; gr < re.length; gr++)
      he[gr] = re[gr];
    t13.dragData.didDrag = false, S.touches.length === 0 && (t13.touchData.dragDelta = [], t13.touchData.startPosition = [null, null, null, null, null, null], t13.touchData.startGPosition = null, t13.touchData.didSelect = false), S.touches.length < 2 && (S.touches.length === 1 && (t13.touchData.startGPosition = [S.touches[0].clientX, S.touches[0].clientY]), t13.pinching = false, t13.redrawHint("eles", true), t13.redraw());
  }, false), typeof TouchEvent > "u") {
    var Ce = [], ke = function(S) {
      return {
        clientX: S.clientX,
        clientY: S.clientY,
        force: 1,
        identifier: S.pointerId,
        pageX: S.pageX,
        pageY: S.pageY,
        radiusX: S.width / 2,
        radiusY: S.height / 2,
        screenX: S.screenX,
        screenY: S.screenY,
        target: S.target
      };
    }, xe = function(S) {
      return {
        event: S,
        touch: ke(S)
      };
    }, Pe = function(S) {
      Ce.push(xe(S));
    }, Ke = function(S) {
      for (var z = 0; z < Ce.length; z++) {
        var ae = Ce[z];
        if (ae.event.pointerId === S.pointerId) {
          Ce.splice(z, 1);
          return;
        }
      }
    }, qe = function(S) {
      var z = Ce.filter(function(ae) {
        return ae.event.pointerId === S.pointerId;
      })[0];
      z.event = S, z.touch = ke(S);
    }, Ne = function(S) {
      S.touches = Ce.map(function(z) {
        return z.touch;
      });
    }, Ge = function(S) {
      return S.pointerType === "mouse" || S.pointerType === 4;
    };
    t13.registerBinding(t13.container, "pointerdown", function(le) {
      Ge(le) || (le.preventDefault(), Pe(le), Ne(le), R(le));
    }), t13.registerBinding(t13.container, "pointerup", function(le) {
      Ge(le) || (Ke(le), Ne(le), ge(le));
    }), t13.registerBinding(t13.container, "pointercancel", function(le) {
      Ge(le) || (Ke(le), Ne(le), J(le));
    }), t13.registerBinding(t13.container, "pointermove", function(le) {
      Ge(le) || (le.preventDefault(), qe(le), Ne(le), Y(le));
    });
  }
};
var xn = {};
xn.generatePolygon = function(t13, e) {
  return this.nodeShapes[t13] = {
    renderer: this,
    name: t13,
    points: e,
    draw: function(n, a, i, o, s, l) {
      this.renderer.nodeShapeImpl("polygon", n, a, i, o, s, this.points);
    },
    intersectLine: function(n, a, i, o, s, l, u, c) {
      return lo(s, l, this.points, n, a, i / 2, o / 2, u);
    },
    checkPoint: function(n, a, i, o, s, l, u, c) {
      return mn(n, a, this.points, l, u, o, s, [0, -1], i);
    }
  };
};
xn.generateEllipse = function() {
  return this.nodeShapes.ellipse = {
    renderer: this,
    name: "ellipse",
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i);
    },
    intersectLine: function(e, r, n, a, i, o, s, l) {
      return v4(i, o, e, r, n / 2 + s, a / 2 + s);
    },
    checkPoint: function(e, r, n, a, i, o, s, l) {
      return la(e, r, a, i, o, s, n);
    }
  };
};
xn.generateRoundPolygon = function(t13, e) {
  return this.nodeShapes[t13] = {
    renderer: this,
    name: t13,
    points: e,
    getOrCreateCorners: function(n, a, i, o, s, l, u) {
      if (l[u] !== void 0 && l[u + "-cx"] === n && l[u + "-cy"] === a)
        return l[u];
      l[u] = new Array(e.length / 2), l[u + "-cx"] = n, l[u + "-cy"] = a;
      var c = i / 2, d = o / 2;
      s = s === "auto" ? bp(i, o) : s;
      for (var v = new Array(e.length / 2), h6 = 0; h6 < e.length / 2; h6++)
        v[h6] = {
          x: n + c * e[h6 * 2],
          y: a + d * e[h6 * 2 + 1]
        };
      var f, p, m, g, y = v.length;
      for (p = v[y - 1], f = 0; f < y; f++)
        m = v[f % y], g = v[(f + 1) % y], l[u][f] = Dc(p, m, g, s), p = m, m = g;
      return l[u];
    },
    draw: function(n, a, i, o, s, l, u) {
      this.renderer.nodeShapeImpl("round-polygon", n, a, i, o, s, this.points, this.getOrCreateCorners(a, i, o, s, l, u, "drawCorners"));
    },
    intersectLine: function(n, a, i, o, s, l, u, c, d) {
      return h4(s, l, this.points, n, a, i, o, u, this.getOrCreateCorners(n, a, i, o, c, d, "corners"));
    },
    checkPoint: function(n, a, i, o, s, l, u, c, d) {
      return f4(n, a, this.points, l, u, o, s, this.getOrCreateCorners(l, u, o, s, c, d, "corners"));
    }
  };
};
xn.generateRoundRectangle = function() {
  return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = {
    renderer: this,
    name: "round-rectangle",
    points: sr(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o);
    },
    intersectLine: function(e, r, n, a, i, o, s, l) {
      return mp(i, o, e, r, n, a, s, l);
    },
    checkPoint: function(e, r, n, a, i, o, s, l) {
      var u = a / 2, c = i / 2;
      l = l === "auto" ? ba(a, i) : l, l = Math.min(u, c, l);
      var d = l * 2;
      return !!(mn(e, r, this.points, o, s, a, i - d, [0, -1], n) || mn(e, r, this.points, o, s, a - d, i, [0, -1], n) || la(e, r, d, d, o - u + l, s - c + l, n) || la(e, r, d, d, o + u - l, s - c + l, n) || la(e, r, d, d, o + u - l, s + c - l, n) || la(e, r, d, d, o - u + l, s + c - l, n));
    }
  };
};
xn.generateCutRectangle = function() {
  return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = {
    renderer: this,
    name: "cut-rectangle",
    cornerLength: gc(),
    points: sr(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, null, o);
    },
    generateCutTrianglePts: function(e, r, n, a, i) {
      var o = i === "auto" ? this.cornerLength : i, s = r / 2, l = e / 2, u = n - l, c = n + l, d = a - s, v = a + s;
      return {
        topLeft: [u, d + o, u + o, d, u + o, d + o],
        topRight: [c - o, d, c, d + o, c - o, d + o],
        bottomRight: [c, v - o, c - o, v, c - o, v - o],
        bottomLeft: [u + o, v, u, v - o, u + o, v - o]
      };
    },
    intersectLine: function(e, r, n, a, i, o, s, l) {
      var u = this.generateCutTrianglePts(n + 2 * s, a + 2 * s, e, r, l), c = [].concat.apply([], [u.topLeft.splice(0, 4), u.topRight.splice(0, 4), u.bottomRight.splice(0, 4), u.bottomLeft.splice(0, 4)]);
      return lo(i, o, c, e, r);
    },
    checkPoint: function(e, r, n, a, i, o, s, l) {
      var u = l === "auto" ? this.cornerLength : l;
      if (mn(e, r, this.points, o, s, a, i - 2 * u, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * u, i, [0, -1], n))
        return true;
      var c = this.generateCutTrianglePts(a, i, o, s);
      return dr(e, r, c.topLeft) || dr(e, r, c.topRight) || dr(e, r, c.bottomRight) || dr(e, r, c.bottomLeft);
    }
  };
};
xn.generateBarrel = function() {
  return this.nodeShapes.barrel = {
    renderer: this,
    name: "barrel",
    points: sr(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i);
    },
    intersectLine: function(e, r, n, a, i, o, s, l) {
      var u = 0.15, c = 0.5, d = 0.85, v = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h6 = function(m) {
        var g = Wa({
          x: m[0],
          y: m[1]
        }, {
          x: m[2],
          y: m[3]
        }, {
          x: m[4],
          y: m[5]
        }, u), y = Wa({
          x: m[0],
          y: m[1]
        }, {
          x: m[2],
          y: m[3]
        }, {
          x: m[4],
          y: m[5]
        }, c), b = Wa({
          x: m[0],
          y: m[1]
        }, {
          x: m[2],
          y: m[3]
        }, {
          x: m[4],
          y: m[5]
        }, d);
        return [m[0], m[1], g.x, g.y, y.x, y.y, b.x, b.y, m[4], m[5]];
      }, f = [].concat(h6(v.topLeft), h6(v.topRight), h6(v.bottomRight), h6(v.bottomLeft));
      return lo(i, o, f, e, r);
    },
    generateBarrelBezierPts: function(e, r, n, a) {
      var i = r / 2, o = e / 2, s = n - o, l = n + o, u = a - i, c = a + i, d = du(e, r), v = d.heightOffset, h6 = d.widthOffset, f = d.ctrlPtOffsetPct * e, p = {
        topLeft: [s, u + v, s + f, u, s + h6, u],
        topRight: [l - h6, u, l - f, u, l, u + v],
        bottomRight: [l, c - v, l - f, c, l - h6, c],
        bottomLeft: [s + h6, c, s + f, c, s, c - v]
      };
      return p.topLeft.isTop = true, p.topRight.isTop = true, p.bottomLeft.isBottom = true, p.bottomRight.isBottom = true, p;
    },
    checkPoint: function(e, r, n, a, i, o, s, l) {
      var u = du(a, i), c = u.heightOffset, d = u.widthOffset;
      if (mn(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n))
        return true;
      for (var v = this.generateBarrelBezierPts(a, i, o, s), h6 = function(T, k, _) {
        var D = _[4], O = _[2], A = _[0], L = _[5], N = _[1], I = Math.min(D, A), M = Math.max(D, A), F = Math.min(L, N), $ = Math.max(L, N);
        if (I <= T && T <= M && F <= k && k <= $) {
          var U = p4(D, O, A), H = l4(U[0], U[1], U[2], T), K = H.filter(function(ee) {
            return 0 <= ee && ee <= 1;
          });
          if (K.length > 0)
            return K[0];
        }
        return null;
      }, f = Object.keys(v), p = 0; p < f.length; p++) {
        var m = f[p], g = v[m], y = h6(e, r, g);
        if (y != null) {
          var b = g[5], w = g[3], C = g[1], E = Rt(b, w, C, y);
          if (g.isTop && E <= r || g.isBottom && r <= E)
            return true;
        }
      }
      return false;
    }
  };
};
xn.generateBottomRoundrectangle = function() {
  return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = {
    renderer: this,
    name: "bottom-round-rectangle",
    points: sr(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o);
    },
    intersectLine: function(e, r, n, a, i, o, s, l) {
      var u = e - (n / 2 + s), c = r - (a / 2 + s), d = c, v = e + (n / 2 + s), h6 = Nn(i, o, e, r, u, c, v, d, false);
      return h6.length > 0 ? h6 : mp(i, o, e, r, n, a, s, l);
    },
    checkPoint: function(e, r, n, a, i, o, s, l) {
      l = l === "auto" ? ba(a, i) : l;
      var u = 2 * l;
      if (mn(e, r, this.points, o, s, a, i - u, [0, -1], n) || mn(e, r, this.points, o, s, a - u, i, [0, -1], n))
        return true;
      var c = a / 2 + 2 * n, d = i / 2 + 2 * n, v = [o - c, s - d, o - c, s, o + c, s, o + c, s - d];
      return !!(dr(e, r, v) || la(e, r, u, u, o + a / 2 - l, s + i / 2 - l, n) || la(e, r, u, u, o - a / 2 + l, s + i / 2 - l, n));
    }
  };
};
xn.registerNodeShapes = function() {
  var t13 = this.nodeShapes = {}, e = this;
  this.generateEllipse(), this.generatePolygon("triangle", sr(3, 0)), this.generateRoundPolygon("round-triangle", sr(3, 0)), this.generatePolygon("rectangle", sr(4, 0)), t13.square = t13.rectangle, this.generateRoundRectangle(), this.generateCutRectangle(), this.generateBarrel(), this.generateBottomRoundrectangle();
  {
    var r = [0, 1, 1, 0, 0, -1, -1, 0];
    this.generatePolygon("diamond", r), this.generateRoundPolygon("round-diamond", r);
  }
  this.generatePolygon("pentagon", sr(5, 0)), this.generateRoundPolygon("round-pentagon", sr(5, 0)), this.generatePolygon("hexagon", sr(6, 0)), this.generateRoundPolygon("round-hexagon", sr(6, 0)), this.generatePolygon("heptagon", sr(7, 0)), this.generateRoundPolygon("round-heptagon", sr(7, 0)), this.generatePolygon("octagon", sr(8, 0)), this.generateRoundPolygon("round-octagon", sr(8, 0));
  var n = new Array(20);
  {
    var a = cu(5, 0), i = cu(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5));
    o *= 1.57;
    for (var s = 0; s < i.length / 2; s++)
      i[s * 2] *= o, i[s * 2 + 1] *= o;
    for (var s = 0; s < 20 / 4; s++)
      n[s * 4] = a[s * 2], n[s * 4 + 1] = a[s * 2 + 1], n[s * 4 + 2] = i[s * 2], n[s * 4 + 3] = i[s * 2 + 1];
  }
  n = yp(n), this.generatePolygon("star", n), this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), this.nodeShapes.concavehexagon = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]);
  {
    var l = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1];
    this.generatePolygon("tag", l), this.generateRoundPolygon("round-tag", l);
  }
  t13.makePolygon = function(u) {
    var c = u.join("$"), d = "polygon-" + c, v;
    return (v = this[d]) ? v : e.generatePolygon(d, u);
  };
};
var Fo = {};
Fo.timeToRender = function() {
  return this.redrawTotalTime / this.redrawCount;
};
Fo.redraw = function(t13) {
  t13 = t13 || fp();
  var e = this;
  e.averageRedrawTime === void 0 && (e.averageRedrawTime = 0), e.lastRedrawTime === void 0 && (e.lastRedrawTime = 0), e.lastDrawTime === void 0 && (e.lastDrawTime = 0), e.requestedFrame = true, e.renderOptions = t13;
};
Fo.beforeRender = function(t13, e) {
  if (!this.destroyed) {
    e == null && yt("Priority is not optional for beforeRender");
    var r = this.beforeRenderCallbacks;
    r.push({
      fn: t13,
      priority: e
    }), r.sort(function(n, a) {
      return a.priority - n.priority;
    });
  }
};
var sv = function(e, r, n) {
  for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++)
    a[i].fn(r, n);
};
Fo.startRenderLoop = function() {
  var t13 = this, e = t13.cy;
  if (!t13.renderLoopStarted) {
    t13.renderLoopStarted = true;
    var r = function n(a) {
      if (!t13.destroyed) {
        if (!e.batching()) if (t13.requestedFrame && !t13.skipFrame) {
          sv(t13, true, a);
          var i = gn();
          t13.render(t13.renderOptions);
          var o = t13.lastDrawTime = gn();
          t13.averageRedrawTime === void 0 && (t13.averageRedrawTime = o - i), t13.redrawCount === void 0 && (t13.redrawCount = 0), t13.redrawCount++, t13.redrawTotalTime === void 0 && (t13.redrawTotalTime = 0);
          var s = o - i;
          t13.redrawTotalTime += s, t13.lastRedrawTime = s, t13.averageRedrawTime = t13.averageRedrawTime / 2 + s / 2, t13.requestedFrame = false;
        } else
          sv(t13, false, a);
        t13.skipFrame = false, Os(n);
      }
    };
    Os(r);
  }
};
var ZP = function(e) {
  this.init(e);
};
var mg = ZP;
var ki = mg.prototype;
ki.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"];
ki.init = function(t13) {
  var e = this;
  e.options = t13, e.cy = t13.cy;
  var r = e.container = t13.cy.container(), n = e.cy.window();
  if (n) {
    var a = n.document, i = a.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", l = a.getElementById(o) != null;
    if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !l) {
      var u = a.createElement("style");
      u.id = o, u.textContent = "." + s + " { position: relative; }", i.insertBefore(u, i.children[0]);
    }
    var c = n.getComputedStyle(r), d = c.getPropertyValue("position");
    d === "static" && tt("A Cytoscape container has style position:static and so can not use UI extensions properly");
  }
  e.selection = [void 0, void 0, void 0, void 0, 0], e.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95], e.hoverData = {
    down: null,
    last: null,
    downTime: null,
    triggerMode: null,
    dragging: false,
    initialPan: [null, null],
    capture: false
  }, e.dragData = {
    possibleDragElements: []
  }, e.touchData = {
    start: null,
    capture: false,
    // These 3 fields related to tap, taphold events
    startPosition: [null, null, null, null, null, null],
    singleTouchStartTime: null,
    singleTouchMoved: true,
    now: [null, null, null, null, null, null],
    earlier: [null, null, null, null, null, null]
  }, e.redraws = 0, e.showFps = t13.showFps, e.debug = t13.debug, e.hideEdgesOnViewport = t13.hideEdgesOnViewport, e.textureOnViewport = t13.textureOnViewport, e.wheelSensitivity = t13.wheelSensitivity, e.motionBlurEnabled = t13.motionBlur, e.forcedPixelRatio = be(t13.pixelRatio) ? t13.pixelRatio : null, e.motionBlur = t13.motionBlur, e.motionBlurOpacity = t13.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = false, e.clearedForMotionBlur = [], e.desktopTapThreshold = t13.desktopTapThreshold, e.desktopTapThreshold2 = t13.desktopTapThreshold * t13.desktopTapThreshold, e.touchTapThreshold = t13.touchTapThreshold, e.touchTapThreshold2 = t13.touchTapThreshold * t13.touchTapThreshold, e.tapholdDuration = 500, e.bindings = [], e.beforeRenderCallbacks = [], e.beforeRenderPriorities = {
    // higher priority execs before lower one
    animations: 400,
    eleCalcs: 300,
    eleTxrDeq: 200,
    lyrTxrDeq: 150,
    lyrTxrSkip: 100
  }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners();
};
ki.notify = function(t13, e) {
  var r = this, n = r.cy;
  if (!this.destroyed) {
    if (t13 === "init") {
      r.load();
      return;
    }
    if (t13 === "destroy") {
      r.destroy();
      return;
    }
    (t13 === "add" || t13 === "remove" || t13 === "move" && n.hasCompoundNodes() || t13 === "load" || t13 === "zorder" || t13 === "mount") && r.invalidateCachedZSortedEles(), t13 === "viewport" && r.redrawHint("select", true), (t13 === "load" || t13 === "resize" || t13 === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", true), r.redrawHint("drag", true), this.startRenderLoop(), this.redraw();
  }
};
ki.destroy = function() {
  var t13 = this;
  t13.destroyed = true, t13.cy.stopAnimationLoop();
  for (var e = 0; e < t13.bindings.length; e++) {
    var r = t13.bindings[e], n = r, a = n.target;
    (a.off || a.removeEventListener).apply(a, n.args);
  }
  if (t13.bindings = [], t13.beforeRenderCallbacks = [], t13.onUpdateEleCalcsFns = [], t13.removeObserver && t13.removeObserver.disconnect(), t13.styleObserver && t13.styleObserver.disconnect(), t13.resizeObserver && t13.resizeObserver.disconnect(), t13.labelCalcDiv)
    try {
      document.body.removeChild(t13.labelCalcDiv);
    } catch {
    }
};
ki.isHeadless = function() {
  return false;
};
[_c, pg, gg, Ei, xn, Fo].forEach(function(t13) {
  ze(ki, t13);
});
var Ul = 1e3 / 60;
var yg = {
  setupDequeueing: function(e) {
    return function() {
      var n = this, a = this.renderer;
      if (!n.dequeueingSetup) {
        n.dequeueingSetup = true;
        var i = nl(function() {
          a.redrawHint("eles", true), a.redrawHint("drag", true), a.redraw();
        }, e.deqRedrawThreshold), o = function(u, c) {
          var d = gn(), v = a.averageRedrawTime, h6 = a.lastRedrawTime, f = [], p = a.cy.extent(), m = a.getPixelRatio();
          for (u || a.flushRenderedStyleQueue(); ; ) {
            var g = gn(), y = g - d, b = g - c;
            if (h6 < Ul) {
              var w = Ul - (u ? v : 0);
              if (b >= e.deqFastCost * w)
                break;
            } else if (u) {
              if (y >= e.deqCost * h6 || y >= e.deqAvgCost * v)
                break;
            } else if (b >= e.deqNoDrawCost * Ul)
              break;
            var C = e.deq(n, m, p);
            if (C.length > 0)
              for (var E = 0; E < C.length; E++)
                f.push(C[E]);
            else
              break;
          }
          f.length > 0 && (e.onDeqd(n, f), !u && e.shouldRedraw(n, f, m, p) && i());
        }, s = e.priority || fc;
        a.beforeRender(o, s(n));
      }
    };
  }
};
var XP = function() {
  function t13(e) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ls;
    sc(this, t13), this.idsByKey = new Zr(), this.keyForId = new Zr(), this.cachesByLvl = new Zr(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r;
  }
  return lc(t13, [{
    key: "getIdsFor",
    value: function(r) {
      r == null && yt("Can not get id list for null key");
      var n = this.idsByKey, a = this.idsByKey.get(r);
      return a || (a = new gi(), n.set(r, a)), a;
    }
  }, {
    key: "addIdForKey",
    value: function(r, n) {
      r != null && this.getIdsFor(r).add(n);
    }
  }, {
    key: "deleteIdForKey",
    value: function(r, n) {
      r != null && this.getIdsFor(r).delete(n);
    }
  }, {
    key: "getNumberOfIdsForKey",
    value: function(r) {
      return r == null ? 0 : this.getIdsFor(r).size;
    }
  }, {
    key: "updateKeyMappingFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r);
      this.deleteIdForKey(a, n), this.addIdForKey(i, n), this.keyForId.set(n, i);
    }
  }, {
    key: "deleteKeyMappingFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n);
      this.deleteIdForKey(a, n), this.keyForId.delete(n);
    }
  }, {
    key: "keyHasChangedFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r);
      return a !== i;
    }
  }, {
    key: "isInvalid",
    value: function(r) {
      return this.keyHasChangedFor(r) || this.doesEleInvalidateKey(r);
    }
  }, {
    key: "getCachesAt",
    value: function(r) {
      var n = this.cachesByLvl, a = this.lvls, i = n.get(r);
      return i || (i = new Zr(), n.set(r, i), a.push(r)), i;
    }
  }, {
    key: "getCache",
    value: function(r, n) {
      return this.getCachesAt(n).get(r);
    }
  }, {
    key: "get",
    value: function(r, n) {
      var a = this.getKey(r), i = this.getCache(a, n);
      return i != null && this.updateKeyMappingFor(r), i;
    }
  }, {
    key: "getForCachedKey",
    value: function(r, n) {
      var a = this.keyForId.get(r.id()), i = this.getCache(a, n);
      return i;
    }
  }, {
    key: "hasCache",
    value: function(r, n) {
      return this.getCachesAt(n).has(r);
    }
  }, {
    key: "has",
    value: function(r, n) {
      var a = this.getKey(r);
      return this.hasCache(a, n);
    }
  }, {
    key: "setCache",
    value: function(r, n, a) {
      a.key = r, this.getCachesAt(n).set(r, a);
    }
  }, {
    key: "set",
    value: function(r, n, a) {
      var i = this.getKey(r);
      this.setCache(i, n, a), this.updateKeyMappingFor(r);
    }
  }, {
    key: "deleteCache",
    value: function(r, n) {
      this.getCachesAt(n).delete(r);
    }
  }, {
    key: "delete",
    value: function(r, n) {
      var a = this.getKey(r);
      this.deleteCache(a, n);
    }
  }, {
    key: "invalidateKey",
    value: function(r) {
      var n = this;
      this.lvls.forEach(function(a) {
        return n.deleteCache(r, a);
      });
    }
    // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key)
  }, {
    key: "invalidate",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n);
      this.deleteKeyMappingFor(r);
      var i = this.doesEleInvalidateKey(r);
      return i && this.invalidateKey(a), i || this.getNumberOfIdsForKey(a) === 0;
    }
  }]), t13;
}();
var lv = 25;
var ns = 50;
var ms = -4;
var xu = 3;
var QP = 7.99;
var JP = 8;
var eO = 1024;
var tO = 1024;
var rO = 1024;
var nO = 0.2;
var aO = 0.8;
var iO = 10;
var oO = 0.15;
var sO = 0.1;
var lO = 0.9;
var uO = 0.9;
var cO = 100;
var dO = 1;
var qa = {
  dequeue: "dequeue",
  downscale: "downscale",
  highQuality: "highQuality"
};
var fO = Yt({
  getKey: null,
  doesEleInvalidateKey: Ls,
  drawElement: null,
  getBoundingBox: null,
  getRotationPoint: null,
  getRotationOffset: null,
  isVisible: up,
  allowEdgeTxrCaching: true,
  allowParentTxrCaching: true
});
var Hi = function(e, r) {
  var n = this;
  n.renderer = e, n.onDequeues = [];
  var a = fO(r);
  ze(n, a), n.lookup = new XP(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing();
};
var Mt = Hi.prototype;
Mt.reasons = qa;
Mt.getTextureQueue = function(t13) {
  var e = this;
  return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t13] = e.eleImgCaches[t13] || [];
};
Mt.getRetiredTextureQueue = function(t13) {
  var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t13] = r[t13] || [];
  return n;
};
Mt.getElementQueue = function() {
  var t13 = this, e = t13.eleCacheQueue = t13.eleCacheQueue || new Oo(function(r, n) {
    return n.reqs - r.reqs;
  });
  return e;
};
Mt.getElementKeyToQueue = function() {
  var t13 = this, e = t13.eleKeyToCacheQueue = t13.eleKeyToCacheQueue || {};
  return e;
};
Mt.getElement = function(t13, e, r, n, a) {
  var i = this, o = this.renderer, s = o.cy.zoom(), l = this.lookup;
  if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t13.visible() || t13.removed() || !i.allowEdgeTxrCaching && t13.isEdge() || !i.allowParentTxrCaching && t13.isParent())
    return null;
  if (n == null && (n = Math.ceil(hc(s * r))), n < ms)
    n = ms;
  else if (s >= QP || n > xu)
    return null;
  var u = Math.pow(2, n), c = e.h * u, d = e.w * u, v = o.eleTextBiggerThanMin(t13, u);
  if (!this.isVisible(t13, v))
    return null;
  var h6 = l.get(t13, n);
  if (h6 && h6.invalidated && (h6.invalidated = false, h6.texture.invalidatedWidth -= h6.width), h6)
    return h6;
  var f;
  if (c <= lv ? f = lv : c <= ns ? f = ns : f = Math.ceil(c / ns) * ns, c > rO || d > tO)
    return null;
  var p = i.getTextureQueue(f), m = p[p.length - 2], g = function() {
    return i.recycleTexture(f, d) || i.addTexture(f, d);
  };
  m || (m = p[p.length - 1]), m || (m = g()), m.width - m.usedWidth < d && (m = g());
  for (var y = function(I) {
    return I && I.scaledLabelShown === v;
  }, b = a && a === qa.dequeue, w = a && a === qa.highQuality, C = a && a === qa.downscale, E, x = n + 1; x <= xu; x++) {
    var T = l.get(t13, x);
    if (T) {
      E = T;
      break;
    }
  }
  var k = E && E.level === n + 1 ? E : null, _ = function() {
    m.context.drawImage(k.texture.canvas, k.x, 0, k.width, k.height, m.usedWidth, 0, d, c);
  };
  if (m.context.setTransform(1, 0, 0, 1, 0, 0), m.context.clearRect(m.usedWidth, 0, d, f), y(k))
    _();
  else if (y(E))
    if (w) {
      for (var D = E.level; D > n; D--)
        k = i.getElement(t13, e, r, D, qa.downscale);
      _();
    } else
      return i.queueElement(t13, E.level - 1), E;
  else {
    var O;
    if (!b && !w && !C)
      for (var A = n - 1; A >= ms; A--) {
        var L = l.get(t13, A);
        if (L) {
          O = L;
          break;
        }
      }
    if (y(O))
      return i.queueElement(t13, n), O;
    m.context.translate(m.usedWidth, 0), m.context.scale(u, u), this.drawElement(m.context, t13, e, v, false), m.context.scale(1 / u, 1 / u), m.context.translate(-m.usedWidth, 0);
  }
  return h6 = {
    x: m.usedWidth,
    texture: m,
    level: n,
    scale: u,
    width: d,
    height: c,
    scaledLabelShown: v
  }, m.usedWidth += Math.ceil(d + JP), m.eleCaches.push(h6), l.set(t13, n, h6), i.checkTextureFullness(m), h6;
};
Mt.invalidateElements = function(t13) {
  for (var e = 0; e < t13.length; e++)
    this.invalidateElement(t13[e]);
};
Mt.invalidateElement = function(t13) {
  var e = this, r = e.lookup, n = [], a = r.isInvalid(t13);
  if (a) {
    for (var i = ms; i <= xu; i++) {
      var o = r.getForCachedKey(t13, i);
      o && n.push(o);
    }
    var s = r.invalidate(t13);
    if (s)
      for (var l = 0; l < n.length; l++) {
        var u = n[l], c = u.texture;
        c.invalidatedWidth += u.width, u.invalidated = true, e.checkTextureUtility(c);
      }
    e.removeFromQueue(t13);
  }
};
Mt.checkTextureUtility = function(t13) {
  t13.invalidatedWidth >= nO * t13.width && this.retireTexture(t13);
};
Mt.checkTextureFullness = function(t13) {
  var e = this, r = e.getTextureQueue(t13.height);
  t13.usedWidth / t13.width > aO && t13.fullnessChecks >= iO ? qn(r, t13) : t13.fullnessChecks++;
};
Mt.retireTexture = function(t13) {
  var e = this, r = t13.height, n = e.getTextureQueue(r), a = this.lookup;
  qn(n, t13), t13.retired = true;
  for (var i = t13.eleCaches, o = 0; o < i.length; o++) {
    var s = i[o];
    a.deleteCache(s.key, s.level);
  }
  vc(i);
  var l = e.getRetiredTextureQueue(r);
  l.push(t13);
};
Mt.addTexture = function(t13, e) {
  var r = this, n = r.getTextureQueue(t13), a = {};
  return n.push(a), a.eleCaches = [], a.height = t13, a.width = Math.max(eO, e), a.usedWidth = 0, a.invalidatedWidth = 0, a.fullnessChecks = 0, a.canvas = r.renderer.makeOffscreenCanvas(a.width, a.height), a.context = a.canvas.getContext("2d"), a;
};
Mt.recycleTexture = function(t13, e) {
  for (var r = this, n = r.getTextureQueue(t13), a = r.getRetiredTextureQueue(t13), i = 0; i < a.length; i++) {
    var o = a[i];
    if (o.width >= e)
      return o.retired = false, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, vc(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), qn(a, o), n.push(o), o;
  }
};
Mt.queueElement = function(t13, e) {
  var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t13), o = a[i];
  if (o)
    o.level = Math.max(o.level, e), o.eles.merge(t13), o.reqs++, n.updateItem(o);
  else {
    var s = {
      eles: t13.spawn().merge(t13),
      level: e,
      reqs: 1,
      key: i
    };
    n.push(s), a[i] = s;
  }
};
Mt.dequeue = function(t13) {
  for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < dO && r.size() > 0; o++) {
    var s = r.pop(), l = s.key, u = s.eles[0], c = i.hasCache(u, s.level);
    if (n[l] = null, c)
      continue;
    a.push(s);
    var d = e.getBoundingBox(u);
    e.getElement(u, d, t13, s.level, qa.dequeue);
  }
  return a;
};
Mt.removeFromQueue = function(t13) {
  var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = this.getKey(t13), i = n[a];
  i != null && (i.eles.length === 1 ? (i.reqs = dc, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t13));
};
Mt.onDequeue = function(t13) {
  this.onDequeues.push(t13);
};
Mt.offDequeue = function(t13) {
  qn(this.onDequeues, t13);
};
Mt.setupDequeueing = yg.setupDequeueing({
  deqRedrawThreshold: cO,
  deqCost: oO,
  deqAvgCost: sO,
  deqNoDrawCost: lO,
  deqFastCost: uO,
  deq: function(e, r, n) {
    return e.dequeue(r, n);
  },
  onDeqd: function(e, r) {
    for (var n = 0; n < e.onDequeues.length; n++) {
      var a = e.onDequeues[n];
      a(r);
    }
  },
  shouldRedraw: function(e, r, n, a) {
    for (var i = 0; i < r.length; i++)
      for (var o = r[i].eles, s = 0; s < o.length; s++) {
        var l = o[s].boundingBox();
        if (pc(l, a))
          return true;
      }
    return false;
  },
  priority: function(e) {
    return e.renderer.beforeRenderPriorities.eleTxrDeq;
  }
});
var vO = 1;
var Yi = -4;
var $s = 2;
var hO = 3.99;
var pO = 50;
var gO = 50;
var mO = 0.15;
var yO = 0.1;
var bO = 0.9;
var wO = 0.9;
var CO = 1;
var uv = 250;
var xO = 4e3 * 4e3;
var EO = true;
var bg = function(e) {
  var r = this, n = r.renderer = e, a = n.cy;
  r.layersByLevel = {}, r.firstGet = true, r.lastInvalidationTime = gn() - 2 * uv, r.skipping = false, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = nl(function() {
    r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs);
  }, gO), n.beforeRender(function(o, s) {
    s - r.lastInvalidationTime <= uv ? r.skipping = true : r.skipping = false;
  }, n.beforeRenderPriorities.lyrTxrSkip);
  var i = function(s, l) {
    return l.reqs - s.reqs;
  };
  r.layersQueue = new Oo(i), r.setupDequeueing();
};
var jt = bg.prototype;
var cv = 0;
var kO = Math.pow(2, 53) - 1;
jt.makeLayer = function(t13, e) {
  var r = Math.pow(2, e), n = Math.ceil(t13.w * r), a = Math.ceil(t13.h * r), i = this.renderer.makeOffscreenCanvas(n, a), o = {
    id: cv = ++cv % kO,
    bb: t13,
    level: e,
    width: n,
    height: a,
    canvas: i,
    context: i.getContext("2d"),
    eles: [],
    elesQueue: [],
    reqs: 0
  }, s = o.context, l = -o.bb.x1, u = -o.bb.y1;
  return s.scale(r, r), s.translate(l, u), o;
};
jt.getLayers = function(t13, e, r) {
  var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet;
  if (n.firstGet = false, r == null) {
    if (r = Math.ceil(hc(o * e)), r < Yi)
      r = Yi;
    else if (o >= hO || r > $s)
      return null;
  }
  n.validateLayersElesOrdering(r, t13);
  var l = n.layersByLevel, u = Math.pow(2, r), c = l[r] = l[r] || [], d, v = n.levelIsComplete(r, t13), h6, f = function() {
    var _ = function(N) {
      if (n.validateLayersElesOrdering(N, t13), n.levelIsComplete(N, t13))
        return h6 = l[N], true;
    }, D = function(N) {
      if (!h6)
        for (var I = r + N; Yi <= I && I <= $s && !_(I); I += N)
          ;
    };
    D(1), D(-1);
    for (var O = c.length - 1; O >= 0; O--) {
      var A = c[O];
      A.invalid && qn(c, A);
    }
  };
  if (!v)
    f();
  else
    return c;
  var p = function() {
    if (!d) {
      d = pr();
      for (var _ = 0; _ < t13.length; _++)
        pp(d, t13[_].boundingBox());
    }
    return d;
  }, m = function(_) {
    _ = _ || {};
    var D = _.after;
    p();
    var O = d.w * u * (d.h * u);
    if (O > xO)
      return null;
    var A = n.makeLayer(d, r);
    if (D != null) {
      var L = c.indexOf(D) + 1;
      c.splice(L, 0, A);
    } else (_.insert === void 0 || _.insert) && c.unshift(A);
    return A;
  };
  if (n.skipping && !s)
    return null;
  for (var g = null, y = t13.length / vO, b = !s, w = 0; w < t13.length; w++) {
    var C = t13[w], E = C._private.rscratch, x = E.imgLayerCaches = E.imgLayerCaches || {}, T = x[r];
    if (T) {
      g = T;
      continue;
    }
    if ((!g || g.eles.length >= y || !gp(g.bb, C.boundingBox())) && (g = m({
      insert: true,
      after: g
    }), !g))
      return null;
    h6 || b ? n.queueLayer(g, C) : n.drawEleInLayer(g, C, r, e), g.eles.push(C), x[r] = g;
  }
  return h6 || (b ? null : c);
};
jt.getEleLevelForLayerLevel = function(t13, e) {
  return t13;
};
jt.drawEleInLayer = function(t13, e, r, n) {
  var a = this, i = this.renderer, o = t13.context, s = e.boundingBox();
  s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, false), i.drawCachedElement(o, e, null, null, r, EO), i.setImgSmoothing(o, true));
};
jt.levelIsComplete = function(t13, e) {
  var r = this, n = r.layersByLevel[t13];
  if (!n || n.length === 0)
    return false;
  for (var a = 0, i = 0; i < n.length; i++) {
    var o = n[i];
    if (o.reqs > 0 || o.invalid)
      return false;
    a += o.eles.length;
  }
  return a === e.length;
};
jt.validateLayersElesOrdering = function(t13, e) {
  var r = this.layersByLevel[t13];
  if (r)
    for (var n = 0; n < r.length; n++) {
      for (var a = r[n], i = -1, o = 0; o < e.length; o++)
        if (a.eles[0] === e[o]) {
          i = o;
          break;
        }
      if (i < 0) {
        this.invalidateLayer(a);
        continue;
      }
      for (var s = i, o = 0; o < a.eles.length; o++)
        if (a.eles[o] !== e[s + o]) {
          this.invalidateLayer(a);
          break;
        }
    }
};
jt.updateElementsInLayers = function(t13, e) {
  for (var r = this, n = Do(t13[0]), a = 0; a < t13.length; a++)
    for (var i = n ? null : t13[a], o = n ? t13[a] : t13[a].ele, s = o._private.rscratch, l = s.imgLayerCaches = s.imgLayerCaches || {}, u = Yi; u <= $s; u++) {
      var c = l[u];
      c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i));
    }
};
jt.haveLayers = function() {
  for (var t13 = this, e = false, r = Yi; r <= $s; r++) {
    var n = t13.layersByLevel[r];
    if (n && n.length > 0) {
      e = true;
      break;
    }
  }
  return e;
};
jt.invalidateElements = function(t13) {
  var e = this;
  t13.length !== 0 && (e.lastInvalidationTime = gn(), !(t13.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t13, function(n, a, i) {
    e.invalidateLayer(n);
  }));
};
jt.invalidateLayer = function(t13) {
  if (this.lastInvalidationTime = gn(), !t13.invalid) {
    var e = t13.level, r = t13.eles, n = this.layersByLevel[e];
    qn(n, t13), t13.elesQueue = [], t13.invalid = true, t13.replacement && (t13.replacement.invalid = true);
    for (var a = 0; a < r.length; a++) {
      var i = r[a]._private.rscratch.imgLayerCaches;
      i && (i[e] = null);
    }
  }
};
jt.refineElementTextures = function(t13) {
  var e = this;
  e.updateElementsInLayers(t13, function(n, a, i) {
    var o = n.replacement;
    if (o || (o = n.replacement = e.makeLayer(n.bb, n.level), o.replaces = n, o.eles = n.eles), !o.reqs)
      for (var s = 0; s < o.eles.length; s++)
        e.queueLayer(o, o.eles[s]);
  });
};
jt.enqueueElementRefinement = function(t13) {
  this.eleTxrDeqs.merge(t13), this.scheduleElementRefinement();
};
jt.queueLayer = function(t13, e) {
  var r = this, n = r.layersQueue, a = t13.elesQueue, i = a.hasId = a.hasId || {};
  if (!t13.replacement) {
    if (e) {
      if (i[e.id()])
        return;
      a.push(e), i[e.id()] = true;
    }
    t13.reqs ? (t13.reqs++, n.updateItem(t13)) : (t13.reqs = 1, n.push(t13));
  }
};
jt.dequeue = function(t13) {
  for (var e = this, r = e.layersQueue, n = [], a = 0; a < CO && r.size() !== 0; ) {
    var i = r.peek();
    if (i.replacement) {
      r.pop();
      continue;
    }
    if (i.replaces && i !== i.replaces.replacement) {
      r.pop();
      continue;
    }
    if (i.invalid) {
      r.pop();
      continue;
    }
    var o = i.elesQueue.shift();
    o && (e.drawEleInLayer(i, o, i.level, t13), a++), n.length === 0 && n.push(true), i.elesQueue.length === 0 && (r.pop(), i.reqs = 0, i.replaces && e.applyLayerReplacement(i), e.requestRedraw());
  }
  return n;
};
jt.applyLayerReplacement = function(t13) {
  var e = this, r = e.layersByLevel[t13.level], n = t13.replaces, a = r.indexOf(n);
  if (!(a < 0 || n.invalid)) {
    r[a] = t13;
    for (var i = 0; i < t13.eles.length; i++) {
      var o = t13.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {};
      s && (s[t13.level] = t13);
    }
    e.requestRedraw();
  }
};
jt.requestRedraw = nl(function() {
  var t13 = this.renderer;
  t13.redrawHint("eles", true), t13.redrawHint("drag", true), t13.redraw();
}, 100);
jt.setupDequeueing = yg.setupDequeueing({
  deqRedrawThreshold: pO,
  deqCost: mO,
  deqAvgCost: yO,
  deqNoDrawCost: bO,
  deqFastCost: wO,
  deq: function(e, r) {
    return e.dequeue(r);
  },
  onDeqd: fc,
  shouldRedraw: up,
  priority: function(e) {
    return e.renderer.beforeRenderPriorities.lyrTxrDeq;
  }
});
var wg = {};
var dv;
function SO(t13, e) {
  for (var r = 0; r < e.length; r++) {
    var n = e[r];
    t13.lineTo(n.x, n.y);
  }
}
function TO(t13, e, r) {
  for (var n, a = 0; a < e.length; a++) {
    var i = e[a];
    a === 0 && (n = i), t13.lineTo(i.x, i.y);
  }
  t13.quadraticCurveTo(r.x, r.y, n.x, n.y);
}
function fv(t13, e, r) {
  t13.beginPath && t13.beginPath();
  for (var n = e, a = 0; a < n.length; a++) {
    var i = n[a];
    t13.lineTo(i.x, i.y);
  }
  var o = r, s = r[0];
  t13.moveTo(s.x, s.y);
  for (var a = 1; a < o.length; a++) {
    var i = o[a];
    t13.lineTo(i.x, i.y);
  }
  t13.closePath && t13.closePath();
}
function _O(t13, e, r, n, a) {
  t13.beginPath && t13.beginPath(), t13.arc(r, n, a, 0, Math.PI * 2, false);
  var i = e, o = i[0];
  t13.moveTo(o.x, o.y);
  for (var s = 0; s < i.length; s++) {
    var l = i[s];
    t13.lineTo(l.x, l.y);
  }
  t13.closePath && t13.closePath();
}
function DO(t13, e, r, n) {
  t13.arc(e, r, n, 0, Math.PI * 2, false);
}
wg.arrowShapeImpl = function(t13) {
  return (dv || (dv = {
    polygon: SO,
    "triangle-backcurve": TO,
    "triangle-tee": fv,
    "circle-triangle": _O,
    "triangle-cross": fv,
    circle: DO
  }))[t13];
};
var an = {};
an.drawElement = function(t13, e, r, n, a, i) {
  var o = this;
  e.isNode() ? o.drawNode(t13, e, r, n, a, i) : o.drawEdge(t13, e, r, n, a, i);
};
an.drawElementOverlay = function(t13, e) {
  var r = this;
  e.isNode() ? r.drawNodeOverlay(t13, e) : r.drawEdgeOverlay(t13, e);
};
an.drawElementUnderlay = function(t13, e) {
  var r = this;
  e.isNode() ? r.drawNodeUnderlay(t13, e) : r.drawEdgeUnderlay(t13, e);
};
an.drawCachedElementPortion = function(t13, e, r, n, a, i, o, s) {
  var l = this, u = r.getBoundingBox(e);
  if (!(u.w === 0 || u.h === 0)) {
    var c = r.getElement(e, u, n, a, i);
    if (c != null) {
      var d = s(l, e);
      if (d === 0)
        return;
      var v = o(l, e), h6 = u.x1, f = u.y1, p = u.w, m = u.h, g, y, b, w, C;
      if (v !== 0) {
        var E = r.getRotationPoint(e);
        b = E.x, w = E.y, t13.translate(b, w), t13.rotate(v), C = l.getImgSmoothing(t13), C || l.setImgSmoothing(t13, true);
        var x = r.getRotationOffset(e);
        g = x.x, y = x.y;
      } else
        g = h6, y = f;
      var T;
      d !== 1 && (T = t13.globalAlpha, t13.globalAlpha = T * d), t13.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, g, y, p, m), d !== 1 && (t13.globalAlpha = T), v !== 0 && (t13.rotate(-v), t13.translate(-b, -w), C || l.setImgSmoothing(t13, false));
    } else
      r.drawElement(t13, e);
  }
};
var PO = function() {
  return 0;
};
var OO = function(e, r) {
  return e.getTextAngle(r, null);
};
var LO = function(e, r) {
  return e.getTextAngle(r, "source");
};
var IO = function(e, r) {
  return e.getTextAngle(r, "target");
};
var AO = function(e, r) {
  return r.effectiveOpacity();
};
var Gl = function(e, r) {
  return r.pstyle("text-opacity").pfValue * r.effectiveOpacity();
};
an.drawCachedElement = function(t13, e, r, n, a, i) {
  var o = this, s = o.data, l = s.eleTxrCache, u = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, v = e.boundingBox(), h6 = i === true ? l.reasons.highQuality : null;
  if (!(v.w === 0 || v.h === 0 || !e.visible()) && (!n || pc(v, n))) {
    var f = e.isEdge(), p = e.element()._private.rscratch.badLine;
    o.drawElementUnderlay(t13, e), o.drawCachedElementPortion(t13, e, l, r, a, h6, PO, AO), (!f || !p) && o.drawCachedElementPortion(t13, e, u, r, a, h6, OO, Gl), f && !p && (o.drawCachedElementPortion(t13, e, c, r, a, h6, LO, Gl), o.drawCachedElementPortion(t13, e, d, r, a, h6, IO, Gl)), o.drawElementOverlay(t13, e);
  }
};
an.drawElements = function(t13, e) {
  for (var r = this, n = 0; n < e.length; n++) {
    var a = e[n];
    r.drawElement(t13, a);
  }
};
an.drawCachedElements = function(t13, e, r, n) {
  for (var a = this, i = 0; i < e.length; i++) {
    var o = e[i];
    a.drawCachedElement(t13, o, r, n);
  }
};
an.drawCachedNodes = function(t13, e, r, n) {
  for (var a = this, i = 0; i < e.length; i++) {
    var o = e[i];
    o.isNode() && a.drawCachedElement(t13, o, r, n);
  }
};
an.drawLayeredElements = function(t13, e, r, n) {
  var a = this, i = a.data.lyrTxrCache.getLayers(e, r);
  if (i)
    for (var o = 0; o < i.length; o++) {
      var s = i[o], l = s.bb;
      l.w === 0 || l.h === 0 || t13.drawImage(s.canvas, l.x1, l.y1, l.w, l.h);
    }
  else
    a.drawCachedElements(t13, e, r, n);
};
var En = {};
En.drawEdge = function(t13, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s = e._private.rscratch;
  if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) {
    var l;
    r && (l = r, t13.translate(-l.x1, -l.y1));
    var u = i ? e.pstyle("opacity").value : 1, c = i ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, v = e.pstyle("line-style").value, h6 = e.pstyle("width").pfValue, f = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, m = e.pstyle("line-outline-color").value, g = u * c, y = u * c, b = function() {
      var N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g;
      d === "straight-triangle" ? (o.eleStrokeStyle(t13, e, N), o.drawEdgeTrianglePath(e, t13, s.allpts)) : (t13.lineWidth = h6, t13.lineCap = f, o.eleStrokeStyle(t13, e, N), o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt");
    }, w = function() {
      var N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g;
      if (t13.lineWidth = h6 + p, t13.lineCap = f, p > 0)
        o.colorStrokeStyle(t13, m[0], m[1], m[2], N);
      else {
        t13.lineCap = "butt";
        return;
      }
      d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t13, s.allpts) : (o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt");
    }, C = function() {
      a && o.drawEdgeOverlay(t13, e);
    }, E = function() {
      a && o.drawEdgeUnderlay(t13, e);
    }, x = function() {
      var N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y;
      o.drawArrowheads(t13, e, N);
    }, T = function() {
      o.drawElementText(t13, e, null, n);
    };
    t13.lineJoin = "round";
    var k = e.pstyle("ghost").value === "yes";
    if (k) {
      var _ = e.pstyle("ghost-offset-x").pfValue, D = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, A = g * O;
      t13.translate(_, D), b(A), x(A), t13.translate(-_, -D);
    } else
      w();
    E(), b(), x(), C(), T(), r && t13.translate(l.x1, l.y1);
  }
};
var Cg = function(e) {
  if (!["overlay", "underlay"].includes(e))
    throw new Error("Invalid state");
  return function(r, n) {
    if (n.visible()) {
      var a = n.pstyle("".concat(e, "-opacity")).value;
      if (a !== 0) {
        var i = this, o = i.usePaths(), s = n._private.rscratch, l = n.pstyle("".concat(e, "-padding")).pfValue, u = 2 * l, c = n.pstyle("".concat(e, "-color")).value;
        r.lineWidth = u, s.edgeType === "self" && !o ? r.lineCap = "butt" : r.lineCap = "round", i.colorStrokeStyle(r, c[0], c[1], c[2], a), i.drawEdgePath(n, r, s.allpts, "solid");
      }
    }
  };
};
En.drawEdgeOverlay = Cg("overlay");
En.drawEdgeUnderlay = Cg("underlay");
En.drawEdgePath = function(t13, e, r, n) {
  var a = t13._private.rscratch, i = e, o, s = false, l = this.usePaths(), u = t13.pstyle("line-dash-pattern").pfValue, c = t13.pstyle("line-dash-offset").pfValue;
  if (l) {
    var d = r.join("$"), v = a.pathCacheKey && a.pathCacheKey === d;
    v ? (o = e = a.pathCache, s = true) : (o = e = new Path2D(), a.pathCacheKey = d, a.pathCache = o);
  }
  if (i.setLineDash)
    switch (n) {
      case "dotted":
        i.setLineDash([1, 1]);
        break;
      case "dashed":
        i.setLineDash(u), i.lineDashOffset = c;
        break;
      case "solid":
        i.setLineDash([]);
        break;
    }
  if (!s && !a.badLine)
    switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), a.edgeType) {
      case "bezier":
      case "self":
      case "compound":
      case "multibezier":
        for (var h6 = 2; h6 + 3 < r.length; h6 += 4)
          e.quadraticCurveTo(r[h6], r[h6 + 1], r[h6 + 2], r[h6 + 3]);
        break;
      case "straight":
      case "haystack":
        for (var f = 2; f + 1 < r.length; f += 2)
          e.lineTo(r[f], r[f + 1]);
        break;
      case "segments":
        if (a.isRound) {
          var p = jh(a.roundCorners), m;
          try {
            for (p.s(); !(m = p.n()).done; ) {
              var g = m.value;
              cg(e, g);
            }
          } catch (b) {
            p.e(b);
          } finally {
            p.f();
          }
          e.lineTo(r[r.length - 2], r[r.length - 1]);
        } else
          for (var y = 2; y + 1 < r.length; y += 2)
            e.lineTo(r[y], r[y + 1]);
        break;
    }
  e = i, l ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]);
};
En.drawEdgeTrianglePath = function(t13, e, r) {
  e.fillStyle = e.strokeStyle;
  for (var n = t13.pstyle("width").pfValue, a = 0; a + 1 < r.length; a += 2) {
    var i = [r[a + 2] - r[a], r[a + 3] - r[a + 1]], o = Math.sqrt(i[0] * i[0] + i[1] * i[1]), s = [i[1] / o, -i[0] / o], l = [s[0] * n / 2, s[1] * n / 2];
    e.beginPath(), e.moveTo(r[a] - l[0], r[a + 1] - l[1]), e.lineTo(r[a] + l[0], r[a + 1] + l[1]), e.lineTo(r[a + 2], r[a + 3]), e.closePath(), e.fill();
  }
};
En.drawArrowheads = function(t13, e, r) {
  var n = e._private.rscratch, a = n.edgeType === "haystack";
  a || this.drawArrowhead(t13, e, "source", n.arrowStartX, n.arrowStartY, n.srcArrowAngle, r), this.drawArrowhead(t13, e, "mid-target", n.midX, n.midY, n.midtgtArrowAngle, r), this.drawArrowhead(t13, e, "mid-source", n.midX, n.midY, n.midsrcArrowAngle, r), a || this.drawArrowhead(t13, e, "target", n.arrowEndX, n.arrowEndY, n.tgtArrowAngle, r);
};
En.drawArrowhead = function(t13, e, r, n, a, i, o) {
  if (!(isNaN(n) || n == null || isNaN(a) || a == null || isNaN(i) || i == null)) {
    var s = this, l = e.pstyle(r + "-arrow-shape").value;
    if (l !== "none") {
      var u = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", c = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, v = e.pstyle(r + "-arrow-width"), h6 = v.value === "match-line" ? d : v.pfValue;
      v.units === "%" && (h6 *= d);
      var f = e.pstyle("opacity").value;
      o === void 0 && (o = f);
      var p = t13.globalCompositeOperation;
      (o !== 1 || c === "hollow") && (t13.globalCompositeOperation = "destination-out", s.colorFillStyle(t13, 255, 255, 255, 1), s.colorStrokeStyle(t13, 255, 255, 255, 1), s.drawArrowShape(e, t13, u, d, l, h6, n, a, i), t13.globalCompositeOperation = p);
      var m = e.pstyle(r + "-arrow-color").value;
      s.colorFillStyle(t13, m[0], m[1], m[2], o), s.colorStrokeStyle(t13, m[0], m[1], m[2], o), s.drawArrowShape(e, t13, c, d, l, h6, n, a, i);
    }
  }
};
En.drawArrowShape = function(t13, e, r, n, a, i, o, s, l) {
  var u = this, c = this.usePaths() && a !== "triangle-cross", d = false, v, h6 = e, f = {
    x: o,
    y: s
  }, p = t13.pstyle("arrow-scale").value, m = this.getArrowWidth(n, p), g = u.arrowShapes[a];
  if (c) {
    var y = u.arrowPathCache = u.arrowPathCache || [], b = ma(a), w = y[b];
    w != null ? (v = e = w, d = true) : (v = e = new Path2D(), y[b] = v);
  }
  d || (e.beginPath && e.beginPath(), c ? g.draw(e, 1, 0, {
    x: 0,
    y: 0
  }, 1) : g.draw(e, m, l, f, n), e.closePath && e.closePath()), e = h6, c && (e.translate(o, s), e.rotate(l), e.scale(m, m)), (r === "filled" || r === "both") && (c ? e.fill(v) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? m : 1), e.lineJoin = "miter", c ? e.stroke(v) : e.stroke()), c && (e.scale(1 / m, 1 / m), e.rotate(-l), e.translate(-o, -s));
};
var Oc = {};
Oc.safeDrawImage = function(t13, e, r, n, a, i, o, s, l, u) {
  if (!(a <= 0 || i <= 0 || l <= 0 || u <= 0))
    try {
      t13.drawImage(e, r, n, a, i, o, s, l, u);
    } catch (c) {
      tt(c);
    }
};
Oc.drawInscribedImage = function(t13, e, r, n, a) {
  var i = this, o = r.position(), s = o.x, l = o.y, u = r.cy().style(), c = u.getIndexedStyle.bind(u), d = c(r, "background-fit", "value", n), v = c(r, "background-repeat", "value", n), h6 = r.width(), f = r.height(), p = r.padding() * 2, m = h6 + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), g = f + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), y = r._private.rscratch, b = c(r, "background-clip", "value", n), w = b === "node", C = c(r, "background-image-opacity", "value", n) * a, E = c(r, "background-image-smoothing", "value", n), x = r.pstyle("corner-radius").value;
  x !== "auto" && (x = r.pstyle("corner-radius").pfValue);
  var T = e.width || e.cachedW, k = e.height || e.cachedH;
  (T == null || k == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, k = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e));
  var _ = T, D = k;
  if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * m : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? D = c(r, "background-height", "pfValue", n) * g : D = c(r, "background-height", "pfValue", n)), !(_ === 0 || D === 0)) {
    if (d === "contain") {
      var O = Math.min(m / _, g / D);
      _ *= O, D *= O;
    } else if (d === "cover") {
      var O = Math.max(m / _, g / D);
      _ *= O, D *= O;
    }
    var A = s - m / 2, L = c(r, "background-position-x", "units", n), N = c(r, "background-position-x", "pfValue", n);
    L === "%" ? A += (m - _) * N : A += N;
    var I = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n);
    I === "%" ? A += (m - _) * M : A += M;
    var F = l - g / 2, $ = c(r, "background-position-y", "units", n), U = c(r, "background-position-y", "pfValue", n);
    $ === "%" ? F += (g - D) * U : F += U;
    var H = c(r, "background-offset-y", "units", n), K = c(r, "background-offset-y", "pfValue", n);
    H === "%" ? F += (g - D) * K : F += K, y.pathCache && (A -= s, F -= l, s = 0, l = 0);
    var ee = t13.globalAlpha;
    t13.globalAlpha = C;
    var se = i.getImgSmoothing(t13), oe = false;
    if (E === "no" && se ? (i.setImgSmoothing(t13, false), oe = true) : E === "yes" && !se && (i.setImgSmoothing(t13, true), oe = true), v === "no-repeat")
      w && (t13.save(), y.pathCache ? t13.clip(y.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t13, s, l, m, g, x, y), t13.clip())), i.safeDrawImage(t13, e, 0, 0, T, k, A, F, _, D), w && t13.restore();
    else {
      var ne = t13.createPattern(e, v);
      t13.fillStyle = ne, i.nodeShapes[i.getNodeShape(r)].draw(t13, s, l, m, g, x, y), t13.translate(A, F), t13.fill(), t13.translate(-A, -F);
    }
    t13.globalAlpha = ee, oe && i.setImgSmoothing(t13, se);
  }
};
var Pa = {};
Pa.eleTextBiggerThanMin = function(t13, e) {
  if (!e) {
    var r = t13.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(hc(r * n));
    e = Math.pow(2, a);
  }
  var i = t13.pstyle("font-size").pfValue * e, o = t13.pstyle("min-zoomed-font-size").pfValue;
  return !(i < o);
};
Pa.drawElementText = function(t13, e, r, n, a) {
  var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this;
  if (n == null) {
    if (i && !o.eleTextBiggerThanMin(e))
      return;
  } else if (n === false)
    return;
  if (e.isNode()) {
    var s = e.pstyle("label");
    if (!s || !s.value)
      return;
    var l = o.getLabelJustification(e);
    t13.textAlign = l, t13.textBaseline = "bottom";
  } else {
    var u = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), v = e.pstyle("target-label");
    if (u || (!c || !c.value) && (!d || !d.value) && (!v || !v.value))
      return;
    t13.textAlign = "center", t13.textBaseline = "bottom";
  }
  var h6 = !r, f;
  r && (f = r, t13.translate(-f.x1, -f.y1)), a == null ? (o.drawText(t13, e, null, h6, i), e.isEdge() && (o.drawText(t13, e, "source", h6, i), o.drawText(t13, e, "target", h6, i))) : o.drawText(t13, e, a, h6, i), r && t13.translate(f.x1, f.y1);
};
Pa.getFontCache = function(t13) {
  var e;
  this.fontCaches = this.fontCaches || [];
  for (var r = 0; r < this.fontCaches.length; r++)
    if (e = this.fontCaches[r], e.context === t13)
      return e;
  return e = {
    context: t13
  }, this.fontCaches.push(e), e;
};
Pa.setupTextStyle = function(t13, e) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, n = e.pstyle("font-style").strValue, a = e.pstyle("font-size").pfValue + "px", i = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, l = e.pstyle("text-outline-opacity").value * s, u = e.pstyle("color").value, c = e.pstyle("text-outline-color").value;
  t13.font = n + " " + o + " " + a + " " + i, t13.lineJoin = "round", this.colorFillStyle(t13, u[0], u[1], u[2], s), this.colorStrokeStyle(t13, c[0], c[1], c[2], l);
};
function Wl(t13, e, r, n, a) {
  var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0;
  t13.beginPath(), t13.moveTo(e + i, r), t13.lineTo(e + n - i, r), t13.quadraticCurveTo(e + n, r, e + n, r + i), t13.lineTo(e + n, r + a - i), t13.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t13.lineTo(e + i, r + a), t13.quadraticCurveTo(e, r + a, e, r + a - i), t13.lineTo(e, r + i), t13.quadraticCurveTo(e, r, e + i, r), t13.closePath(), o ? t13.stroke() : t13.fill();
}
Pa.getTextAngle = function(t13, e) {
  var r, n = t13._private, a = n.rscratch, i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = Nr(a, "labelAngle", e);
  return o.strValue === "autorotate" ? r = t13.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r;
};
Pa.drawText = function(t13, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = e._private, o = i.rscratch, s = a ? e.effectiveOpacity() : 1;
  if (!(a && (s === 0 || e.pstyle("text-opacity").value === 0))) {
    r === "main" && (r = null);
    var l = Nr(o, "labelX", r), u = Nr(o, "labelY", r), c, d, v = this.getLabelText(e, r);
    if (v != null && v !== "" && !isNaN(l) && !isNaN(u)) {
      this.setupTextStyle(t13, e, a);
      var h6 = r ? r + "-" : "", f = Nr(o, "labelWidth", r), p = Nr(o, "labelHeight", r), m = e.pstyle(h6 + "text-margin-x").pfValue, g = e.pstyle(h6 + "text-margin-y").pfValue, y = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value;
      y && (b = "center", w = "center"), l += m, u += g;
      var C;
      switch (n ? C = this.getTextAngle(e, r) : C = 0, C !== 0 && (c = l, d = u, t13.translate(c, d), t13.rotate(C), l = 0, u = 0), w) {
        case "top":
          break;
        case "center":
          u += p / 2;
          break;
        case "bottom":
          u += p;
          break;
      }
      var E = e.pstyle("text-background-opacity").value, x = e.pstyle("text-border-opacity").value, T = e.pstyle("text-border-width").pfValue, k = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, D = _.indexOf("round") === 0, O = 2;
      if (E > 0 || T > 0 && x > 0) {
        var A = l - k;
        switch (b) {
          case "left":
            A -= f;
            break;
          case "center":
            A -= f / 2;
            break;
        }
        var L = u - p - k, N = f + 2 * k, I = p + 2 * k;
        if (E > 0) {
          var M = t13.fillStyle, F = e.pstyle("text-background-color").value;
          t13.fillStyle = "rgba(" + F[0] + "," + F[1] + "," + F[2] + "," + E * s + ")", D ? Wl(t13, A, L, N, I, O) : t13.fillRect(A, L, N, I), t13.fillStyle = M;
        }
        if (T > 0 && x > 0) {
          var $ = t13.strokeStyle, U = t13.lineWidth, H = e.pstyle("text-border-color").value, K = e.pstyle("text-border-style").value;
          if (t13.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + x * s + ")", t13.lineWidth = T, t13.setLineDash)
            switch (K) {
              case "dotted":
                t13.setLineDash([1, 1]);
                break;
              case "dashed":
                t13.setLineDash([4, 2]);
                break;
              case "double":
                t13.lineWidth = T / 4, t13.setLineDash([]);
                break;
              case "solid":
                t13.setLineDash([]);
                break;
            }
          if (D ? Wl(t13, A, L, N, I, O, "stroke") : t13.strokeRect(A, L, N, I), K === "double") {
            var ee = T / 2;
            D ? Wl(t13, A + ee, L + ee, N - ee * 2, I - ee * 2, O, "stroke") : t13.strokeRect(A + ee, L + ee, N - ee * 2, I - ee * 2);
          }
          t13.setLineDash && t13.setLineDash([]), t13.lineWidth = U, t13.strokeStyle = $;
        }
      }
      var se = 2 * e.pstyle("text-outline-width").pfValue;
      if (se > 0 && (t13.lineWidth = se), e.pstyle("text-wrap").value === "wrap") {
        var oe = Nr(o, "labelWrapCachedLines", r), ne = Nr(o, "labelLineHeight", r), ue = f / 2, te = this.getLabelJustification(e);
        switch (te === "auto" || (b === "left" ? te === "left" ? l += -f : te === "center" && (l += -ue) : b === "center" ? te === "left" ? l += -ue : te === "right" && (l += ue) : b === "right" && (te === "center" ? l += ue : te === "right" && (l += f))), w) {
          case "top":
            u -= (oe.length - 1) * ne;
            break;
          case "center":
          case "bottom":
            u -= (oe.length - 1) * ne;
            break;
        }
        for (var R = 0; R < oe.length; R++)
          se > 0 && t13.strokeText(oe[R], l, u), t13.fillText(oe[R], l, u), u += ne;
      } else
        se > 0 && t13.strokeText(v, l, u), t13.fillText(v, l, u);
      C !== 0 && (t13.rotate(-C), t13.translate(-c, -d));
    }
  }
};
var Si = {};
Si.drawNode = function(t13, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s, l, u = e._private, c = u.rscratch, d = e.position();
  if (!(!be(d.x) || !be(d.y)) && !(i && !e.visible())) {
    var v = i ? e.effectiveOpacity() : 1, h6 = o.usePaths(), f, p = false, m = e.padding();
    s = e.width() + 2 * m, l = e.height() + 2 * m;
    var g;
    r && (g = r, t13.translate(-g.x1, -g.y1));
    for (var y = e.pstyle("background-image"), b = y.value, w = new Array(b.length), C = new Array(b.length), E = 0, x = 0; x < b.length; x++) {
      var T = b[x], k = w[x] = T != null && T !== "none";
      if (k) {
        var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", x);
        E++, C[x] = o.getCachedImage(T, _, function() {
          u.backgroundTimestamp = Date.now(), e.emitAndNotify("background");
        });
      }
    }
    var D = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, A = e.pstyle("background-opacity").value * v, L = e.pstyle("border-color").value, N = e.pstyle("border-style").value, I = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, F = e.pstyle("border-position").value, $ = e.pstyle("border-dash-pattern").pfValue, U = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * v, K = e.pstyle("outline-width").pfValue, ee = e.pstyle("outline-color").value, se = e.pstyle("outline-style").value, oe = e.pstyle("outline-opacity").value * v, ne = e.pstyle("outline-offset").value, ue = e.pstyle("corner-radius").value;
    ue !== "auto" && (ue = e.pstyle("corner-radius").pfValue);
    var te = function() {
      var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : A;
      o.eleFillStyle(t13, e, pe);
    }, R = function() {
      var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H;
      o.colorStrokeStyle(t13, L[0], L[1], L[2], pe);
    }, Y = function() {
      var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oe;
      o.colorStrokeStyle(t13, ee[0], ee[1], ee[2], pe);
    }, J = function(pe, re, he, Fe) {
      var Me = o.nodePathCache = o.nodePathCache || [], _e = lp(he === "polygon" ? he + "," + Fe.join(",") : he, "" + re, "" + pe, "" + ue), Re = Me[_e], Te, Le = false;
      return Re != null ? (Te = Re, Le = true, c.pathCache = Te) : (Te = new Path2D(), Me[_e] = c.pathCache = Te), {
        path: Te,
        cacheHit: Le
      };
    }, ge = e.pstyle("shape").strValue, Ee = e.pstyle("shape-polygon-points").pfValue;
    if (h6) {
      t13.translate(d.x, d.y);
      var ve = J(s, l, ge, Ee);
      f = ve.path, p = ve.cacheHit;
    }
    var me = function() {
      if (!p) {
        var pe = d;
        h6 && (pe = {
          x: 0,
          y: 0
        }), o.nodeShapes[o.getNodeShape(e)].draw(f || t13, pe.x, pe.y, s, l, ue, c);
      }
      h6 ? t13.fill(f) : t13.fill();
    }, Ce = function() {
      for (var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, he = u.backgrounding, Fe = 0, Me = 0; Me < C.length; Me++) {
        var _e = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Me);
        if (re && _e === "over" || !re && _e === "inside") {
          Fe++;
          continue;
        }
        w[Me] && C[Me].complete && !C[Me].error && (Fe++, o.drawInscribedImage(t13, C[Me], e, Me, pe));
      }
      u.backgrounding = Fe !== E, he !== u.backgrounding && e.updateStyle(false);
    }, ke = function() {
      var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v;
      o.hasPie(e) && (o.drawPie(t13, e, re), pe && (h6 || o.nodeShapes[o.getNodeShape(e)].draw(t13, d.x, d.y, s, l, ue, c)));
    }, xe = function() {
      var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = (D > 0 ? D : -D) * pe, he = D > 0 ? 0 : 255;
      D !== 0 && (o.colorFillStyle(t13, he, he, he, re), h6 ? t13.fill(f) : t13.fill());
    }, Pe = function() {
      if (O > 0) {
        if (t13.lineWidth = O, t13.lineCap = M, t13.lineJoin = I, t13.setLineDash)
          switch (N) {
            case "dotted":
              t13.setLineDash([1, 1]);
              break;
            case "dashed":
              t13.setLineDash($), t13.lineDashOffset = U;
              break;
            case "solid":
            case "double":
              t13.setLineDash([]);
              break;
          }
        if (F !== "center") {
          if (t13.save(), t13.lineWidth *= 2, F === "inside")
            h6 ? t13.clip(f) : t13.clip();
          else {
            var pe = new Path2D();
            pe.rect(-s / 2 - O, -l / 2 - O, s + 2 * O, l + 2 * O), pe.addPath(f), t13.clip(pe, "evenodd");
          }
          h6 ? t13.stroke(f) : t13.stroke(), t13.restore();
        } else
          h6 ? t13.stroke(f) : t13.stroke();
        if (N === "double") {
          t13.lineWidth = O / 3;
          var re = t13.globalCompositeOperation;
          t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(f) : t13.stroke(), t13.globalCompositeOperation = re;
        }
        t13.setLineDash && t13.setLineDash([]);
      }
    }, Ke = function() {
      if (K > 0) {
        if (t13.lineWidth = K, t13.lineCap = "butt", t13.setLineDash)
          switch (se) {
            case "dotted":
              t13.setLineDash([1, 1]);
              break;
            case "dashed":
              t13.setLineDash([4, 2]);
              break;
            case "solid":
            case "double":
              t13.setLineDash([]);
              break;
          }
        var pe = d;
        h6 && (pe = {
          x: 0,
          y: 0
        });
        var re = o.getNodeShape(e), he = O;
        F === "inside" && (he = 0), F === "outside" && (he *= 2);
        var Fe = (s + he + (K + ne)) / s, Me = (l + he + (K + ne)) / l, _e = s * Fe, Re = l * Me, Te = o.nodeShapes[re].points, Le;
        if (h6) {
          var ut = J(_e, Re, re, Te);
          Le = ut.path;
        }
        if (re === "ellipse")
          o.drawEllipsePath(Le || t13, pe.x, pe.y, _e, Re);
        else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(re)) {
          var nt = 0, kt = 0, St = 0;
          re === "round-diamond" ? nt = (he + ne + K) * 1.4 : re === "round-heptagon" ? (nt = (he + ne + K) * 1.075, St = -(he / 2 + ne + K) / 35) : re === "round-hexagon" ? nt = (he + ne + K) * 1.12 : re === "round-pentagon" ? (nt = (he + ne + K) * 1.13, St = -(he / 2 + ne + K) / 15) : re === "round-tag" ? (nt = (he + ne + K) * 1.12, kt = (he / 2 + K + ne) * 0.07) : re === "round-triangle" && (nt = (he + ne + K) * (Math.PI / 2), St = -(he + ne / 2 + K) / Math.PI), nt !== 0 && (Fe = (s + nt) / s, _e = s * Fe, ["round-hexagon", "round-tag"].includes(re) || (Me = (l + nt) / l, Re = l * Me)), ue = ue === "auto" ? bp(_e, Re) : ue;
          for (var wt = _e / 2, Zt = Re / 2, Pt = ue + (he + K + ne) / 2, Bt = new Array(Te.length / 2), gr = new Array(Te.length / 2), Xt = 0; Xt < Te.length / 2; Xt++)
            Bt[Xt] = {
              x: pe.x + kt + wt * Te[Xt * 2],
              y: pe.y + St + Zt * Te[Xt * 2 + 1]
            };
          var Qt, wr, Pr, ur, Ct = Bt.length;
          for (wr = Bt[Ct - 1], Qt = 0; Qt < Ct; Qt++)
            Pr = Bt[Qt % Ct], ur = Bt[(Qt + 1) % Ct], gr[Qt] = Dc(wr, Pr, ur, Pt), wr = Pr, Pr = ur;
          o.drawRoundPolygonPath(Le || t13, pe.x + kt, pe.y + St, s * Fe, l * Me, Te, gr);
        } else if (["roundrectangle", "round-rectangle"].includes(re))
          ue = ue === "auto" ? ba(_e, Re) : ue, o.drawRoundRectanglePath(Le || t13, pe.x, pe.y, _e, Re, ue + (he + K + ne) / 2);
        else if (["cutrectangle", "cut-rectangle"].includes(re))
          ue = ue === "auto" ? gc() : ue, o.drawCutRectanglePath(Le || t13, pe.x, pe.y, _e, Re, null, ue + (he + K + ne) / 4);
        else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(re))
          ue = ue === "auto" ? ba(_e, Re) : ue, o.drawBottomRoundRectanglePath(Le || t13, pe.x, pe.y, _e, Re, ue + (he + K + ne) / 2);
        else if (re === "barrel")
          o.drawBarrelPath(Le || t13, pe.x, pe.y, _e, Re);
        else if (re.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(re)) {
          var Tt = (he + K + ne) / s;
          Te = Is(As(Te, Tt)), o.drawPolygonPath(Le || t13, pe.x, pe.y, s, l, Te);
        } else {
          var Nt = (he + K + ne) / s;
          Te = Is(As(Te, -Nt)), o.drawPolygonPath(Le || t13, pe.x, pe.y, s, l, Te);
        }
        if (h6 ? t13.stroke(Le) : t13.stroke(), se === "double") {
          t13.lineWidth = he / 3;
          var kn = t13.globalCompositeOperation;
          t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(Le) : t13.stroke(), t13.globalCompositeOperation = kn;
        }
        t13.setLineDash && t13.setLineDash([]);
      }
    }, qe = function() {
      a && o.drawNodeOverlay(t13, e, d, s, l);
    }, Ne = function() {
      a && o.drawNodeUnderlay(t13, e, d, s, l);
    }, Ge = function() {
      o.drawElementText(t13, e, null, n);
    }, le = e.pstyle("ghost").value === "yes";
    if (le) {
      var S = e.pstyle("ghost-offset-x").pfValue, z = e.pstyle("ghost-offset-y").pfValue, ae = e.pstyle("ghost-opacity").value, Q = ae * v;
      t13.translate(S, z), Y(), Ke(), te(ae * A), me(), Ce(Q, true), R(ae * H), Pe(), ke(D !== 0 || O !== 0), Ce(Q, false), xe(Q), t13.translate(-S, -z);
    }
    h6 && t13.translate(-d.x, -d.y), Ne(), h6 && t13.translate(d.x, d.y), Y(), Ke(), te(), me(), Ce(v, true), R(), Pe(), ke(D !== 0 || O !== 0), Ce(v, false), xe(), h6 && t13.translate(-d.x, -d.y), Ge(), qe(), r && t13.translate(g.x1, g.y1);
  }
};
var xg = function(e) {
  if (!["overlay", "underlay"].includes(e))
    throw new Error("Invalid state");
  return function(r, n, a, i, o) {
    var s = this;
    if (n.visible()) {
      var l = n.pstyle("".concat(e, "-padding")).pfValue, u = n.pstyle("".concat(e, "-opacity")).value, c = n.pstyle("".concat(e, "-color")).value, d = n.pstyle("".concat(e, "-shape")).value, v = n.pstyle("".concat(e, "-corner-radius")).value;
      if (u > 0) {
        if (a = a || n.position(), i == null || o == null) {
          var h6 = n.padding();
          i = n.width() + 2 * h6, o = n.height() + 2 * h6;
        }
        s.colorFillStyle(r, c[0], c[1], c[2], u), s.nodeShapes[d].draw(r, a.x, a.y, i + l * 2, o + l * 2, v), r.fill();
      }
    }
  };
};
Si.drawNodeOverlay = xg("overlay");
Si.drawNodeUnderlay = xg("underlay");
Si.hasPie = function(t13) {
  return t13 = t13[0], t13._private.hasPie;
};
Si.drawPie = function(t13, e, r, n) {
  e = e[0], n = n || e.position();
  var a = e.cy().style(), i = e.pstyle("pie-size"), o = n.x, s = n.y, l = e.width(), u = e.height(), c = Math.min(l, u) / 2, d = 0, v = this.usePaths();
  v && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2);
  for (var h6 = 1; h6 <= a.pieBackgroundN; h6++) {
    var f = e.pstyle("pie-" + h6 + "-background-size").value, p = e.pstyle("pie-" + h6 + "-background-color").value, m = e.pstyle("pie-" + h6 + "-background-opacity").value * r, g = f / 100;
    g + d > 1 && (g = 1 - d);
    var y = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * g, w = y + b;
    f === 0 || d >= 1 || d + g > 1 || (t13.beginPath(), t13.moveTo(o, s), t13.arc(o, s, c, y, w), t13.closePath(), this.colorFillStyle(t13, p[0], p[1], p[2], m), t13.fill(), d += g);
  }
};
var br = {};
var FO = 100;
br.getPixelRatio = function() {
  var t13 = this.data.contexts[0];
  if (this.forcedPixelRatio != null)
    return this.forcedPixelRatio;
  var e = this.cy.window(), r = t13.backingStorePixelRatio || t13.webkitBackingStorePixelRatio || t13.mozBackingStorePixelRatio || t13.msBackingStorePixelRatio || t13.oBackingStorePixelRatio || t13.backingStorePixelRatio || 1;
  return (e.devicePixelRatio || 1) / r;
};
br.paintCache = function(t13) {
  for (var e = this.paintCaches = this.paintCaches || [], r = true, n, a = 0; a < e.length; a++)
    if (n = e[a], n.context === t13) {
      r = false;
      break;
    }
  return r && (n = {
    context: t13
  }, e.push(n)), n;
};
br.createGradientStyleFor = function(t13, e, r, n, a) {
  var i, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, l = r.pstyle(e + "-gradient-stop-positions").pfValue;
  if (n === "radial-gradient")
    if (r.isEdge()) {
      var u = r.sourceEndpoint(), c = r.targetEndpoint(), d = r.midpoint(), v = ya(u, d), h6 = ya(c, d);
      i = t13.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(v, h6));
    } else {
      var f = o ? {
        x: 0,
        y: 0
      } : r.position(), p = r.paddedWidth(), m = r.paddedHeight();
      i = t13.createRadialGradient(f.x, f.y, 0, f.x, f.y, Math.max(p, m));
    }
  else if (r.isEdge()) {
    var g = r.sourceEndpoint(), y = r.targetEndpoint();
    i = t13.createLinearGradient(g.x, g.y, y.x, y.y);
  } else {
    var b = o ? {
      x: 0,
      y: 0
    } : r.position(), w = r.paddedWidth(), C = r.paddedHeight(), E = w / 2, x = C / 2, T = r.pstyle("background-gradient-direction").value;
    switch (T) {
      case "to-bottom":
        i = t13.createLinearGradient(b.x, b.y - x, b.x, b.y + x);
        break;
      case "to-top":
        i = t13.createLinearGradient(b.x, b.y + x, b.x, b.y - x);
        break;
      case "to-left":
        i = t13.createLinearGradient(b.x + E, b.y, b.x - E, b.y);
        break;
      case "to-right":
        i = t13.createLinearGradient(b.x - E, b.y, b.x + E, b.y);
        break;
      case "to-bottom-right":
      case "to-right-bottom":
        i = t13.createLinearGradient(b.x - E, b.y - x, b.x + E, b.y + x);
        break;
      case "to-top-right":
      case "to-right-top":
        i = t13.createLinearGradient(b.x - E, b.y + x, b.x + E, b.y - x);
        break;
      case "to-bottom-left":
      case "to-left-bottom":
        i = t13.createLinearGradient(b.x + E, b.y - x, b.x - E, b.y + x);
        break;
      case "to-top-left":
      case "to-left-top":
        i = t13.createLinearGradient(b.x + E, b.y + x, b.x - E, b.y - x);
        break;
    }
  }
  if (!i) return null;
  for (var k = l.length === s.length, _ = s.length, D = 0; D < _; D++)
    i.addColorStop(k ? l[D] : D / (_ - 1), "rgba(" + s[D][0] + "," + s[D][1] + "," + s[D][2] + "," + a + ")");
  return i;
};
br.gradientFillStyle = function(t13, e, r, n) {
  var a = this.createGradientStyleFor(t13, "background", e, r, n);
  if (!a) return null;
  t13.fillStyle = a;
};
br.colorFillStyle = function(t13, e, r, n, a) {
  t13.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")";
};
br.eleFillStyle = function(t13, e, r) {
  var n = e.pstyle("background-fill").value;
  if (n === "linear-gradient" || n === "radial-gradient")
    this.gradientFillStyle(t13, e, n, r);
  else {
    var a = e.pstyle("background-color").value;
    this.colorFillStyle(t13, a[0], a[1], a[2], r);
  }
};
br.gradientStrokeStyle = function(t13, e, r, n) {
  var a = this.createGradientStyleFor(t13, "line", e, r, n);
  if (!a) return null;
  t13.strokeStyle = a;
};
br.colorStrokeStyle = function(t13, e, r, n, a) {
  t13.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")";
};
br.eleStrokeStyle = function(t13, e, r) {
  var n = e.pstyle("line-fill").value;
  if (n === "linear-gradient" || n === "radial-gradient")
    this.gradientStrokeStyle(t13, e, n, r);
  else {
    var a = e.pstyle("line-color").value;
    this.colorStrokeStyle(t13, a[0], a[1], a[2], r);
  }
};
br.matchCanvasSize = function(t13) {
  var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio;
  (t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s);
  var l = a * o, u = i * o, c;
  if (!(l === e.canvasWidth && u === e.canvasHeight)) {
    e.fontCaches = null;
    var d = r.canvasContainer;
    d.style.width = a + "px", d.style.height = i + "px";
    for (var v = 0; v < e.CANVAS_LAYERS; v++)
      c = r.canvases[v], c.width = l, c.height = u, c.style.width = a + "px", c.style.height = i + "px";
    for (var v = 0; v < e.BUFFER_COUNT; v++)
      c = r.bufferCanvases[v], c.width = l, c.height = u, c.style.width = a + "px", c.style.height = i + "px";
    e.textureMult = 1, o <= 1 && (c = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, c.width = l * e.textureMult, c.height = u * e.textureMult), e.canvasWidth = l, e.canvasHeight = u;
  }
};
br.renderTo = function(t13, e, r, n) {
  this.render({
    forcedContext: t13,
    forcedZoom: e,
    forcedPan: r,
    drawAllLayers: true,
    forcedPxRatio: n
  });
};
br.render = function(t13) {
  t13 = t13 || fp();
  var e = t13.forcedContext, r = t13.drawAllLayers, n = t13.drawOnlyNodeLayer, a = t13.forcedZoom, i = t13.forcedPan, o = this, s = t13.forcedPxRatio === void 0 ? this.getPixelRatio() : t13.forcedPxRatio, l = o.cy, u = o.data, c = u.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), v = t13.motionBlur !== void 0 ? t13.motionBlur : o.motionBlur, h6 = o.motionBlurPxRatio, f = l.hasCompoundNodes(), p = o.hoverData.draggingEles, m = !!(o.hoverData.selecting || o.touchData.selecting);
  v = v && !e && o.motionBlurEnabled && !m;
  var g = v;
  e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", true), o.redrawHint("drag", true)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), v && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = false), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = true, c[o.SELECT_BOX] = true);
  var y = l.style(), b = l.zoom(), w = a !== void 0 ? a : b, C = l.pan(), E = {
    x: C.x,
    y: C.y
  }, x = {
    zoom: b,
    pan: {
      x: C.x,
      y: C.y
    }
  }, T = o.prevViewport, k = T === void 0 || x.zoom !== T.zoom || x.pan.x !== T.pan.x || x.pan.y !== T.pan.y;
  !k && !(p && !f) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s;
  var _ = o.getCachedZSortedEles();
  function D(ve, me, Ce, ke, xe) {
    var Pe = ve.globalCompositeOperation;
    ve.globalCompositeOperation = "destination-out", o.colorFillStyle(ve, 255, 255, 255, o.motionBlurTransparency), ve.fillRect(me, Ce, ke, xe), ve.globalCompositeOperation = Pe;
  }
  function O(ve, me) {
    var Ce, ke, xe, Pe;
    !o.clearingMotionBlur && (ve === u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || ve === u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (Ce = {
      x: C.x * h6,
      y: C.y * h6
    }, ke = b * h6, xe = o.canvasWidth * h6, Pe = o.canvasHeight * h6) : (Ce = E, ke = w, xe = o.canvasWidth, Pe = o.canvasHeight), ve.setTransform(1, 0, 0, 1, 0, 0), me === "motionBlur" ? D(ve, 0, 0, xe, Pe) : !e && (me === void 0 || me) && ve.clearRect(0, 0, xe, Pe), r || (ve.translate(Ce.x, Ce.y), ve.scale(ke, ke)), i && ve.translate(i.x, i.y), a && ve.scale(a, a);
  }
  if (d || (o.textureDrawLastFrame = false), d) {
    if (o.textureDrawLastFrame = true, !o.textureCache) {
      o.textureCache = {}, o.textureCache.bb = l.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER];
      var A = o.data.bufferContexts[o.TEXTURE_BUFFER];
      A.setTransform(1, 0, 0, 1, 0, 0), A.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({
        forcedContext: A,
        drawOnlyNodeLayer: true,
        forcedPxRatio: s * o.textureMult
      });
      var x = o.textureCache.viewport = {
        zoom: l.zoom(),
        pan: l.pan(),
        width: o.canvasWidth,
        height: o.canvasHeight
      };
      x.mpan = {
        x: (0 - x.pan.x) / x.zoom,
        y: (0 - x.pan.y) / x.zoom
      };
    }
    c[o.DRAG] = false, c[o.NODE] = false;
    var L = u.contexts[o.NODE], N = o.textureCache.texture, x = o.textureCache.viewport;
    L.setTransform(1, 0, 0, 1, 0, 0), v ? D(L, 0, 0, x.width, x.height) : L.clearRect(0, 0, x.width, x.height);
    var I = y.core("outside-texture-bg-color").value, M = y.core("outside-texture-bg-opacity").value;
    o.colorFillStyle(L, I[0], I[1], I[2], M), L.fillRect(0, 0, x.width, x.height);
    var b = l.zoom();
    O(L, false), L.clearRect(x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s), L.drawImage(N, x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s);
  } else o.textureOnViewport && !e && (o.textureCache = null);
  var F = l.extent(), $ = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), U = o.hideEdgesOnViewport && $, H = [];
  if (H[o.NODE] = !c[o.NODE] && v && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = true), H[o.DRAG] = !c[o.DRAG] && v && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = true), c[o.NODE] || r || n || H[o.NODE]) {
    var K = v && !H[o.NODE] && h6 !== 1, L = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : u.contexts[o.NODE]), ee = v && !K ? "motionBlur" : void 0;
    O(L, ee), U ? o.drawCachedNodes(L, _.nondrag, s, F) : o.drawLayeredElements(L, _.nondrag, s, F), o.debug && o.drawDebugPoints(L, _.nondrag), !r && !v && (c[o.NODE] = false);
  }
  if (!n && (c[o.DRAG] || r || H[o.DRAG])) {
    var K = v && !H[o.DRAG] && h6 !== 1, L = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : u.contexts[o.DRAG]);
    O(L, v && !K ? "motionBlur" : void 0), U ? o.drawCachedNodes(L, _.drag, s, F) : o.drawCachedElements(L, _.drag, s, F), o.debug && o.drawDebugPoints(L, _.drag), !r && !v && (c[o.DRAG] = false);
  }
  if (o.showFps || !n && c[o.SELECT_BOX] && !r) {
    var L = e || u.contexts[o.SELECT_BOX];
    if (O(L), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) {
      var b = o.cy.zoom(), se = y.core("selection-box-border-width").value / b;
      L.lineWidth = se, L.fillStyle = "rgba(" + y.core("selection-box-color").value[0] + "," + y.core("selection-box-color").value[1] + "," + y.core("selection-box-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), se > 0 && (L.strokeStyle = "rgba(" + y.core("selection-box-border-color").value[0] + "," + y.core("selection-box-border-color").value[1] + "," + y.core("selection-box-border-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]));
    }
    if (u.bgActivePosistion && !o.hoverData.selecting) {
      var b = o.cy.zoom(), oe = u.bgActivePosistion;
      L.fillStyle = "rgba(" + y.core("active-bg-color").value[0] + "," + y.core("active-bg-color").value[1] + "," + y.core("active-bg-color").value[2] + "," + y.core("active-bg-opacity").value + ")", L.beginPath(), L.arc(oe.x, oe.y, y.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), L.fill();
    }
    var ne = o.lastRedrawTime;
    if (o.showFps && ne) {
      ne = Math.round(ne);
      var ue = Math.round(1e3 / ne);
      L.setTransform(1, 0, 0, 1, 0, 0), L.fillStyle = "rgba(255, 0, 0, 0.75)", L.strokeStyle = "rgba(255, 0, 0, 0.75)", L.lineWidth = 1, L.fillText("1 frame = " + ne + " ms = " + ue + " fps", 0, 20);
      var te = 60;
      L.strokeRect(0, 30, 250, 20), L.fillRect(0, 30, 250 * Math.min(ue / te, 1), 20);
    }
    r || (c[o.SELECT_BOX] = false);
  }
  if (v && h6 !== 1) {
    var R = u.contexts[o.NODE], Y = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], J = u.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], Ee = function(me, Ce, ke) {
      me.setTransform(1, 0, 0, 1, 0, 0), ke || !g ? me.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : D(me, 0, 0, o.canvasWidth, o.canvasHeight);
      var xe = h6;
      me.drawImage(
        Ce,
        // img
        0,
        0,
        // sx, sy
        o.canvasWidth * xe,
        o.canvasHeight * xe,
        // sw, sh
        0,
        0,
        // x, y
        o.canvasWidth,
        o.canvasHeight
        // w, h
      );
    };
    (c[o.NODE] || H[o.NODE]) && (Ee(R, Y, H[o.NODE]), c[o.NODE] = false), (c[o.DRAG] || H[o.DRAG]) && (Ee(J, ge, H[o.DRAG]), c[o.DRAG] = false);
  }
  o.prevViewport = x, o.clearingMotionBlur && (o.clearingMotionBlur = false, o.motionBlurCleared = true, o.motionBlur = true), v && (o.motionBlurTimeout = setTimeout(function() {
    o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = false, o.clearedForMotionBlur[o.DRAG] = false, o.motionBlur = false, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = true, c[o.DRAG] = true, o.redraw();
  }, FO)), e || l.emit("render");
};
var Xn = {};
Xn.drawPolygonPath = function(t13, e, r, n, a, i) {
  var o = n / 2, s = a / 2;
  t13.beginPath && t13.beginPath(), t13.moveTo(e + o * i[0], r + s * i[1]);
  for (var l = 1; l < i.length / 2; l++)
    t13.lineTo(e + o * i[l * 2], r + s * i[l * 2 + 1]);
  t13.closePath();
};
Xn.drawRoundPolygonPath = function(t13, e, r, n, a, i, o) {
  o.forEach(function(s) {
    return cg(t13, s);
  }), t13.closePath();
};
Xn.drawRoundRectanglePath = function(t13, e, r, n, a, i) {
  var o = n / 2, s = a / 2, l = i === "auto" ? ba(n, a) : Math.min(i, s, o);
  t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.arcTo(e + o, r - s, e + o, r, l), t13.arcTo(e + o, r + s, e, r + s, l), t13.arcTo(e - o, r + s, e - o, r, l), t13.arcTo(e - o, r - s, e, r - s, l), t13.lineTo(e, r - s), t13.closePath();
};
Xn.drawBottomRoundRectanglePath = function(t13, e, r, n, a, i) {
  var o = n / 2, s = a / 2, l = i === "auto" ? ba(n, a) : i;
  t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.lineTo(e + o, r - s), t13.lineTo(e + o, r), t13.arcTo(e + o, r + s, e, r + s, l), t13.arcTo(e - o, r + s, e - o, r, l), t13.lineTo(e - o, r - s), t13.lineTo(e, r - s), t13.closePath();
};
Xn.drawCutRectanglePath = function(t13, e, r, n, a, i, o) {
  var s = n / 2, l = a / 2, u = o === "auto" ? gc() : o;
  t13.beginPath && t13.beginPath(), t13.moveTo(e - s + u, r - l), t13.lineTo(e + s - u, r - l), t13.lineTo(e + s, r - l + u), t13.lineTo(e + s, r + l - u), t13.lineTo(e + s - u, r + l), t13.lineTo(e - s + u, r + l), t13.lineTo(e - s, r + l - u), t13.lineTo(e - s, r - l + u), t13.closePath();
};
Xn.drawBarrelPath = function(t13, e, r, n, a) {
  var i = n / 2, o = a / 2, s = e - i, l = e + i, u = r - o, c = r + o, d = du(n, a), v = d.widthOffset, h6 = d.heightOffset, f = d.ctrlPtOffsetPct * v;
  t13.beginPath && t13.beginPath(), t13.moveTo(s, u + h6), t13.lineTo(s, c - h6), t13.quadraticCurveTo(s + f, c, s + v, c), t13.lineTo(l - v, c), t13.quadraticCurveTo(l - f, c, l, c - h6), t13.lineTo(l, u + h6), t13.quadraticCurveTo(l - f, u, l - v, u), t13.lineTo(s + v, u), t13.quadraticCurveTo(s + f, u, s, u + h6), t13.closePath();
};
var vv = Math.sin(0);
var hv = Math.cos(0);
var Eu = {};
var ku = {};
var Eg = Math.PI / 40;
for ($a = 0 * Math.PI; $a < 2 * Math.PI; $a += Eg)
  Eu[$a] = Math.sin($a), ku[$a] = Math.cos($a);
var $a;
Xn.drawEllipsePath = function(t13, e, r, n, a) {
  if (t13.beginPath && t13.beginPath(), t13.ellipse)
    t13.ellipse(e, r, n / 2, a / 2, 0, 0, 2 * Math.PI);
  else
    for (var i, o, s = n / 2, l = a / 2, u = 0 * Math.PI; u < 2 * Math.PI; u += Eg)
      i = e - s * Eu[u] * vv + s * ku[u] * hv, o = r + l * ku[u] * vv + l * Eu[u] * hv, u === 0 ? t13.moveTo(i, o) : t13.lineTo(i, o);
  t13.closePath();
};
var Mo = {};
Mo.createBuffer = function(t13, e) {
  var r = document.createElement("canvas");
  return r.width = t13, r.height = e, [r, r.getContext("2d")];
};
Mo.bufferCanvasImage = function(t13) {
  var e = this.cy, r = e.mutableElements(), n = r.boundingBox(), a = this.findContainerClientCoords(), i = t13.full ? Math.ceil(n.w) : a[2], o = t13.full ? Math.ceil(n.h) : a[3], s = be(t13.maxWidth) || be(t13.maxHeight), l = this.getPixelRatio(), u = 1;
  if (t13.scale !== void 0)
    i *= t13.scale, o *= t13.scale, u = t13.scale;
  else if (s) {
    var c = 1 / 0, d = 1 / 0;
    be(t13.maxWidth) && (c = u * t13.maxWidth / i), be(t13.maxHeight) && (d = u * t13.maxHeight / o), u = Math.min(c, d), i *= u, o *= u;
  }
  s || (i *= l, o *= l, u *= l);
  var v = document.createElement("canvas");
  v.width = i, v.height = o, v.style.width = i + "px", v.style.height = o + "px";
  var h6 = v.getContext("2d");
  if (i > 0 && o > 0) {
    h6.clearRect(0, 0, i, o), h6.globalCompositeOperation = "source-over";
    var f = this.getCachedZSortedEles();
    if (t13.full)
      h6.translate(-n.x1 * u, -n.y1 * u), h6.scale(u, u), this.drawElements(h6, f), h6.scale(1 / u, 1 / u), h6.translate(n.x1 * u, n.y1 * u);
    else {
      var p = e.pan(), m = {
        x: p.x * u,
        y: p.y * u
      };
      u *= e.zoom(), h6.translate(m.x, m.y), h6.scale(u, u), this.drawElements(h6, f), h6.scale(1 / u, 1 / u), h6.translate(-m.x, -m.y);
    }
    t13.bg && (h6.globalCompositeOperation = "destination-over", h6.fillStyle = t13.bg, h6.rect(0, 0, i, o), h6.fill());
  }
  return v;
};
function MO(t13, e) {
  for (var r = atob(t13), n = new ArrayBuffer(r.length), a = new Uint8Array(n), i = 0; i < r.length; i++)
    a[i] = r.charCodeAt(i);
  return new Blob([n], {
    type: e
  });
}
function pv(t13) {
  var e = t13.indexOf(",");
  return t13.substr(e + 1);
}
function kg(t13, e, r) {
  var n = function() {
    return e.toDataURL(r, t13.quality);
  };
  switch (t13.output) {
    case "blob-promise":
      return new mi(function(a, i) {
        try {
          e.toBlob(function(o) {
            o != null ? a(o) : i(new Error("`canvas.toBlob()` sent a null value in its callback"));
          }, r, t13.quality);
        } catch (o) {
          i(o);
        }
      });
    case "blob":
      return MO(pv(n()), r);
    case "base64":
      return pv(n());
    case "base64uri":
    default:
      return n();
  }
}
Mo.png = function(t13) {
  return kg(t13, this.bufferCanvasImage(t13), "image/png");
};
Mo.jpg = function(t13) {
  return kg(t13, this.bufferCanvasImage(t13), "image/jpeg");
};
var Sg = {};
Sg.nodeShapeImpl = function(t13, e, r, n, a, i, o, s) {
  switch (t13) {
    case "ellipse":
      return this.drawEllipsePath(e, r, n, a, i);
    case "polygon":
      return this.drawPolygonPath(e, r, n, a, i, o);
    case "round-polygon":
      return this.drawRoundPolygonPath(e, r, n, a, i, o, s);
    case "roundrectangle":
    case "round-rectangle":
      return this.drawRoundRectanglePath(e, r, n, a, i, s);
    case "cutrectangle":
    case "cut-rectangle":
      return this.drawCutRectanglePath(e, r, n, a, i, o, s);
    case "bottomroundrectangle":
    case "bottom-round-rectangle":
      return this.drawBottomRoundRectanglePath(e, r, n, a, i, s);
    case "barrel":
      return this.drawBarrelPath(e, r, n, a, i);
  }
};
var BO = Tg;
var Qe = Tg.prototype;
Qe.CANVAS_LAYERS = 3;
Qe.SELECT_BOX = 0;
Qe.DRAG = 1;
Qe.NODE = 2;
Qe.BUFFER_COUNT = 3;
Qe.TEXTURE_BUFFER = 0;
Qe.MOTIONBLUR_BUFFER_NODE = 1;
Qe.MOTIONBLUR_BUFFER_DRAG = 2;
function Tg(t13) {
  var e = this, r = e.cy.window(), n = r.document;
  e.data = {
    canvases: new Array(Qe.CANVAS_LAYERS),
    contexts: new Array(Qe.CANVAS_LAYERS),
    canvasNeedsRedraw: new Array(Qe.CANVAS_LAYERS),
    bufferCanvases: new Array(Qe.BUFFER_COUNT),
    bufferContexts: new Array(Qe.CANVAS_LAYERS)
  };
  var a = "-webkit-tap-highlight-color", i = "rgba(0,0,0,0)";
  e.data.canvasContainer = n.createElement("div");
  var o = e.data.canvasContainer.style;
  e.data.canvasContainer.style[a] = i, o.position = "relative", o.zIndex = "0", o.overflow = "hidden";
  var s = t13.cy.container();
  s.appendChild(e.data.canvasContainer), s.style[a] = i;
  var l = {
    "-webkit-user-select": "none",
    "-moz-user-select": "-moz-none",
    "user-select": "none",
    "-webkit-tap-highlight-color": "rgba(0,0,0,0)",
    "outline-style": "none"
  };
  ET() && (l["-ms-touch-action"] = "none", l["touch-action"] = "none");
  for (var u = 0; u < Qe.CANVAS_LAYERS; u++) {
    var c = e.data.canvases[u] = n.createElement("canvas");
    e.data.contexts[u] = c.getContext("2d"), Object.keys(l).forEach(function(te) {
      c.style[te] = l[te];
    }), c.style.position = "absolute", c.setAttribute("data-id", "layer" + u), c.style.zIndex = String(Qe.CANVAS_LAYERS - u), e.data.canvasContainer.appendChild(c), e.data.canvasNeedsRedraw[u] = false;
  }
  e.data.topCanvas = e.data.canvases[0], e.data.canvases[Qe.NODE].setAttribute("data-id", "layer" + Qe.NODE + "-node"), e.data.canvases[Qe.SELECT_BOX].setAttribute("data-id", "layer" + Qe.SELECT_BOX + "-selectbox"), e.data.canvases[Qe.DRAG].setAttribute("data-id", "layer" + Qe.DRAG + "-drag");
  for (var u = 0; u < Qe.BUFFER_COUNT; u++)
    e.data.bufferCanvases[u] = n.createElement("canvas"), e.data.bufferContexts[u] = e.data.bufferCanvases[u].getContext("2d"), e.data.bufferCanvases[u].style.position = "absolute", e.data.bufferCanvases[u].setAttribute("data-id", "buffer" + u), e.data.bufferCanvases[u].style.zIndex = String(-u - 1), e.data.bufferCanvases[u].style.visibility = "hidden";
  e.pathsEnabled = true;
  var d = pr(), v = function(R) {
    return {
      x: (R.x1 + R.x2) / 2,
      y: (R.y1 + R.y2) / 2
    };
  }, h6 = function(R) {
    return {
      x: -R.w / 2,
      y: -R.h / 2
    };
  }, f = function(R) {
    var Y = R[0]._private, J = Y.oldBackgroundTimestamp === Y.backgroundTimestamp;
    return !J;
  }, p = function(R) {
    return R[0]._private.nodeKey;
  }, m = function(R) {
    return R[0]._private.labelStyleKey;
  }, g = function(R) {
    return R[0]._private.sourceLabelStyleKey;
  }, y = function(R) {
    return R[0]._private.targetLabelStyleKey;
  }, b = function(R, Y, J, ge, Ee) {
    return e.drawElement(R, Y, J, false, false, Ee);
  }, w = function(R, Y, J, ge, Ee) {
    return e.drawElementText(R, Y, J, ge, "main", Ee);
  }, C = function(R, Y, J, ge, Ee) {
    return e.drawElementText(R, Y, J, ge, "source", Ee);
  }, E = function(R, Y, J, ge, Ee) {
    return e.drawElementText(R, Y, J, ge, "target", Ee);
  }, x = function(R) {
    return R.boundingBox(), R[0]._private.bodyBounds;
  }, T = function(R) {
    return R.boundingBox(), R[0]._private.labelBounds.main || d;
  }, k = function(R) {
    return R.boundingBox(), R[0]._private.labelBounds.source || d;
  }, _ = function(R) {
    return R.boundingBox(), R[0]._private.labelBounds.target || d;
  }, D = function(R, Y) {
    return Y;
  }, O = function(R) {
    return v(x(R));
  }, A = function(R, Y, J) {
    var ge = R ? R + "-" : "";
    return {
      x: Y.x + J.pstyle(ge + "text-margin-x").pfValue,
      y: Y.y + J.pstyle(ge + "text-margin-y").pfValue
    };
  }, L = function(R, Y, J) {
    var ge = R[0]._private.rscratch;
    return {
      x: ge[Y],
      y: ge[J]
    };
  }, N = function(R) {
    return A("", L(R, "labelX", "labelY"), R);
  }, I = function(R) {
    return A("source", L(R, "sourceLabelX", "sourceLabelY"), R);
  }, M = function(R) {
    return A("target", L(R, "targetLabelX", "targetLabelY"), R);
  }, F = function(R) {
    return h6(x(R));
  }, $ = function(R) {
    return h6(k(R));
  }, U = function(R) {
    return h6(_(R));
  }, H = function(R) {
    var Y = T(R), J = h6(T(R));
    if (R.isNode()) {
      switch (R.pstyle("text-halign").value) {
        case "left":
          J.x = -Y.w;
          break;
        case "right":
          J.x = 0;
          break;
      }
      switch (R.pstyle("text-valign").value) {
        case "top":
          J.y = -Y.h;
          break;
        case "bottom":
          J.y = 0;
          break;
      }
    }
    return J;
  }, K = e.data.eleTxrCache = new Hi(e, {
    getKey: p,
    doesEleInvalidateKey: f,
    drawElement: b,
    getBoundingBox: x,
    getRotationPoint: O,
    getRotationOffset: F,
    allowEdgeTxrCaching: false,
    allowParentTxrCaching: false
  }), ee = e.data.lblTxrCache = new Hi(e, {
    getKey: m,
    drawElement: w,
    getBoundingBox: T,
    getRotationPoint: N,
    getRotationOffset: H,
    isVisible: D
  }), se = e.data.slbTxrCache = new Hi(e, {
    getKey: g,
    drawElement: C,
    getBoundingBox: k,
    getRotationPoint: I,
    getRotationOffset: $,
    isVisible: D
  }), oe = e.data.tlbTxrCache = new Hi(e, {
    getKey: y,
    drawElement: E,
    getBoundingBox: _,
    getRotationPoint: M,
    getRotationOffset: U,
    isVisible: D
  }), ne = e.data.lyrTxrCache = new bg(e);
  e.onUpdateEleCalcs(function(R, Y) {
    K.invalidateElements(Y), ee.invalidateElements(Y), se.invalidateElements(Y), oe.invalidateElements(Y), ne.invalidateElements(Y);
    for (var J = 0; J < Y.length; J++) {
      var ge = Y[J]._private;
      ge.oldBackgroundTimestamp = ge.backgroundTimestamp;
    }
  });
  var ue = function(R) {
    for (var Y = 0; Y < R.length; Y++)
      ne.enqueueElementRefinement(R[Y].ele);
  };
  K.onDequeue(ue), ee.onDequeue(ue), se.onDequeue(ue), oe.onDequeue(ue);
}
Qe.redrawHint = function(t13, e) {
  var r = this;
  switch (t13) {
    case "eles":
      r.data.canvasNeedsRedraw[Qe.NODE] = e;
      break;
    case "drag":
      r.data.canvasNeedsRedraw[Qe.DRAG] = e;
      break;
    case "select":
      r.data.canvasNeedsRedraw[Qe.SELECT_BOX] = e;
      break;
  }
};
var NO = typeof Path2D < "u";
Qe.path2dEnabled = function(t13) {
  if (t13 === void 0)
    return this.pathsEnabled;
  this.pathsEnabled = !!t13;
};
Qe.usePaths = function() {
  return NO && this.pathsEnabled;
};
Qe.setImgSmoothing = function(t13, e) {
  t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled = e : (t13.webkitImageSmoothingEnabled = e, t13.mozImageSmoothingEnabled = e, t13.msImageSmoothingEnabled = e);
};
Qe.getImgSmoothing = function(t13) {
  return t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled : t13.webkitImageSmoothingEnabled || t13.mozImageSmoothingEnabled || t13.msImageSmoothingEnabled;
};
Qe.makeOffscreenCanvas = function(t13, e) {
  var r;
  if ((typeof OffscreenCanvas > "u" ? "undefined" : Ft(OffscreenCanvas)) !== "undefined")
    r = new OffscreenCanvas(t13, e);
  else {
    var n = this.cy.window(), a = n.document;
    r = a.createElement("canvas"), r.width = t13, r.height = e;
  }
  return r;
};
[wg, an, En, Oc, Pa, Si, br, Xn, Mo, Sg].forEach(function(t13) {
  ze(Qe, t13);
});
var RO = [{
  name: "null",
  impl: sg
}, {
  name: "base",
  impl: mg
}, {
  name: "canvas",
  impl: BO
}];
var $O = [{
  type: "layout",
  extensions: UP
}, {
  type: "renderer",
  extensions: RO
}];
var _g = {};
var Dg = {};
function Pg(t13, e, r) {
  var n = r, a = function(T) {
    tt("Can not register `" + e + "` for `" + t13 + "` since `" + T + "` already exists in the prototype and can not be overridden");
  };
  if (t13 === "core") {
    if (ho.prototype[e])
      return a(e);
    ho.prototype[e] = r;
  } else if (t13 === "collection") {
    if (Wt.prototype[e])
      return a(e);
    Wt.prototype[e] = r;
  } else if (t13 === "layout") {
    for (var i = function(T) {
      this.options = T, r.call(this, T), Xe(this._private) || (this._private = {}), this._private.cy = T.cy, this._private.listeners = [], this.createEmitter();
    }, o = i.prototype = Object.create(r.prototype), s = [], l = 0; l < s.length; l++) {
      var u = s[l];
      o[u] = o[u] || function() {
        return this;
      };
    }
    o.start && !o.run ? o.run = function() {
      return this.start(), this;
    } : !o.start && o.run && (o.start = function() {
      return this.run(), this;
    });
    var c = r.prototype.stop;
    o.stop = function() {
      var x = this.options;
      if (x && x.animate) {
        var T = this.animations;
        if (T)
          for (var k = 0; k < T.length; k++)
            T[k].stop();
      }
      return c ? c.call(this) : this.emit("layoutstop"), this;
    }, o.destroy || (o.destroy = function() {
      return this;
    }), o.cy = function() {
      return this._private.cy;
    };
    var d = function(T) {
      return T._private.cy;
    }, v = {
      addEventFields: function(T, k) {
        k.layout = T, k.cy = d(T), k.target = T;
      },
      bubble: function() {
        return true;
      },
      parent: function(T) {
        return d(T);
      }
    };
    ze(o, {
      createEmitter: function() {
        return this._private.emitter = new dl(v, this), this;
      },
      emitter: function() {
        return this._private.emitter;
      },
      on: function(T, k) {
        return this.emitter().on(T, k), this;
      },
      one: function(T, k) {
        return this.emitter().one(T, k), this;
      },
      once: function(T, k) {
        return this.emitter().one(T, k), this;
      },
      removeListener: function(T, k) {
        return this.emitter().removeListener(T, k), this;
      },
      removeAllListeners: function() {
        return this.emitter().removeAllListeners(), this;
      },
      emit: function(T, k) {
        return this.emitter().emit(T, k), this;
      }
    }), et.eventAliasesOn(o), n = i;
  } else if (t13 === "renderer" && e !== "null" && e !== "base") {
    var h6 = Og("renderer", "base"), f = h6.prototype, p = r, m = r.prototype, g = function() {
      h6.apply(this, arguments), p.apply(this, arguments);
    }, y = g.prototype;
    for (var b in f) {
      var w = f[b], C = m[b] != null;
      if (C)
        return a(b);
      y[b] = w;
    }
    for (var E in m)
      y[E] = m[E];
    f.clientFunctions.forEach(function(x) {
      y[x] = y[x] || function() {
        yt("Renderer does not implement `renderer." + x + "()` on its prototype");
      };
    }), n = g;
  } else if (t13 === "__proto__" || t13 === "constructor" || t13 === "prototype")
    return yt(t13 + " is an illegal type to be registered, possibly lead to prototype pollutions");
  return tp({
    map: _g,
    keys: [t13, e],
    value: n
  });
}
function Og(t13, e) {
  return rp({
    map: _g,
    keys: [t13, e]
  });
}
function zO(t13, e, r, n, a) {
  return tp({
    map: Dg,
    keys: [t13, e, r, n],
    value: a
  });
}
function VO(t13, e, r, n) {
  return rp({
    map: Dg,
    keys: [t13, e, r, n]
  });
}
var Su = function() {
  if (arguments.length === 2)
    return Og.apply(null, arguments);
  if (arguments.length === 3)
    return Pg.apply(null, arguments);
  if (arguments.length === 4)
    return VO.apply(null, arguments);
  if (arguments.length === 5)
    return zO.apply(null, arguments);
  yt("Invalid extension access syntax");
};
ho.prototype.extension = Su;
$O.forEach(function(t13) {
  t13.extensions.forEach(function(e) {
    Pg(t13.type, e.name, e.impl);
  });
});
var Lg = function t12() {
  if (!(this instanceof t12))
    return new t12();
  this.length = 0;
};
var xa = Lg.prototype;
xa.instanceString = function() {
  return "stylesheet";
};
xa.selector = function(t13) {
  var e = this.length++;
  return this[e] = {
    selector: t13,
    properties: []
  }, this;
};
xa.css = function(t13, e) {
  var r = this.length - 1;
  if (Ae(t13))
    this[r].properties.push({
      name: t13,
      value: e
    });
  else if (Xe(t13))
    for (var n = t13, a = Object.keys(n), i = 0; i < a.length; i++) {
      var o = a[i], s = n[o];
      if (s != null) {
        var l = rr.properties[o] || rr.properties[tl(o)];
        if (l != null) {
          var u = l.name, c = s;
          this[r].properties.push({
            name: u,
            value: c
          });
        }
      }
    }
  return this;
};
xa.style = xa.css;
xa.generateStyle = function(t13) {
  var e = new rr(t13);
  return this.appendToStyle(e);
};
xa.appendToStyle = function(t13) {
  for (var e = 0; e < this.length; e++) {
    var r = this[e], n = r.selector, a = r.properties;
    t13.selector(n);
    for (var i = 0; i < a.length; i++) {
      var o = a[i];
      t13.css(o.name, o.value);
    }
  }
  return t13;
};
var HO = "3.30.2";
var Ea = function(e) {
  if (e === void 0 && (e = {}), Xe(e))
    return new ho(e);
  if (Ae(e))
    return Su.apply(Su, arguments);
};
Ea.use = function(t13) {
  var e = Array.prototype.slice.call(arguments, 1);
  return e.unshift(Ea), t13.apply(null, e), this;
};
Ea.warnings = function(t13) {
  return cp(t13);
};
Ea.version = HO;
Ea.stylesheet = Ea.Stylesheet = Lg;
var KO = class extends EventTarget {
  constructor(r, n) {
    super();
    Ir(this, "cyg", null);
    Ir(this, "nodes", []);
    Ir(this, "edges", []);
    Ir(this, "axons", []);
    Ir(this, "dendrites", []);
    Ir(this, "somas", []);
    Ir(this, "labelCache", /* @__PURE__ */ new Map());
    Ir(this, "graphCanvas", null);
    this.labelCache = r, this.graphCanvas = n;
  }
  async addConnectivity(r) {
    var n;
    if (this.axons = r.axons.map((a) => JSON.stringify(a)), this.dendrites = r.dendrites.map((a) => JSON.stringify(a)), (n = r.somas) != null && n.length && (this.somas = r.somas.map((a) => JSON.stringify(a))), r.connectivity.length)
      for (const a of r.connectivity) {
        const i = await this.graphNode(a[0]), o = await this.graphNode(a[1]);
        this.nodes.push(i), this.nodes.push(o), this.edges.push({
          id: `${i.id}_${o.id}`,
          source: i.id,
          target: o.id
        });
      }
    else
      this.nodes.push({
        id: "MISSING",
        label: "NO PATHS"
      });
  }
  showConnectivity(r) {
    this.cyg = new jO(this, r), this.cyg.on("tap-node", (n) => {
      const a = new CustomEvent("tap-node", {
        detail: n.detail
      });
      this.dispatchEvent(a);
    });
  }
  selectConnectivity(r) {
    var n;
    if ((n = this.cyg) != null && n.cy) {
      let a = "";
      this.cyg.cy.elements().forEach((i) => {
        const o = i.data("label"), s = Tu(o);
        YO(r, s) && (a = i.id());
      }), a && this.cyg.cy.$id(a).select();
    }
  }
  clearConnectivity() {
    var r;
    (r = this.cyg) != null && r.cy && (this.cyg.cy.remove(), this.cyg.cy = null);
  }
  reset() {
    var r;
    (r = this.cyg) != null && r.cy && this.cyg.cy.reset();
  }
  zoom(r) {
    var n;
    if ((n = this.cyg) != null && n.cy) {
      const a = this.cyg.cy.zoom(), i = this.cyg.cy.width(), o = this.cyg.cy.height(), s = {
        x: i / 2,
        y: o / 2
      };
      this.cyg.cy.zoom({
        level: a + r,
        renderedPosition: s
      });
    }
  }
  enableZoom(r) {
    var n;
    (n = this.cyg) != null && n.cy && this.cyg.cy.userZoomingEnabled(r);
  }
  get elements() {
    return [
      ...this.nodes.map((r) => ({ data: r })),
      ...this.edges.map((r) => ({ data: r }))
    ];
  }
  get roots() {
    return [
      ...this.dendrites,
      ...this.somas
    ];
  }
  async graphNode(r) {
    const n = JSON.stringify(r), a = [r[0], ...r[1]], i = [];
    for (const s of a) {
      const l = this.labelCache.has(s) ? this.labelCache.get(s) : "";
      i.push(l);
    }
    a.push(...i);
    const o = {
      id: n,
      label: a.join(`
`)
    };
    return this.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o["both-a-d"] = true : o.axon = true : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = true), o;
  }
  on(r, n) {
    this.addEventListener(r, n);
  }
};
var qO = "#8300bf";
var UO = "#f3ecf6";
var GO = [
  {
    selector: "node",
    style: {
      label: function(t13) {
        return WO(t13.data("label"));
      },
      // 'background-color': '#80F0F0',
      "background-color": "transparent",
      "background-opacity": "0",
      "text-valign": "center",
      "text-wrap": "wrap",
      width: "80px",
      height: "80px",
      "text-max-width": "80px",
      "font-size": "6px",
      shape: "round-rectangle",
      "border-width": 1,
      "border-style": "solid",
      "border-color": "gray"
    }
  },
  {
    selector: "node[axon]",
    style: {
      // 'background-color': 'green',
      shape: "round-diamond",
      width: "100px",
      height: "100px"
    }
  },
  {
    selector: "node[dendrite]",
    style: {
      // 'background-color': 'red',
      shape: "ellipse"
    }
  },
  {
    selector: "node[both-a-d]",
    style: {
      // 'background-color': 'gray',
      shape: "round-rectangle"
    }
  },
  {
    selector: "edge",
    style: {
      width: 1,
      "line-color": "dimgray",
      "curve-style": "bezier"
    }
  },
  {
    selector: "node.active",
    style: {
      "border-color": qO,
      "background-color": UO,
      "background-opacity": 0.75
    }
  }
];
function WO(t13) {
  const e = t13.split(`
`), r = e.length / 2, n = e.slice(r);
  return Ig(n.join(`
`));
}
function Ig(t13) {
  return t13.split(`
`).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(`
`);
}
function Tu(t13) {
  const e = t13 ? t13.split(`
`) : [], r = [];
  for (let n = 0; n < e.length / 2; n++)
    r.push({
      id: e[n],
      label: e[n + e.length / 2]
    });
  return r;
}
function YO(t13, e) {
  t13.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0), e.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0);
  for (let r = 0; r < t13.length; r++)
    if (JSON.stringify(t13[r]) !== JSON.stringify(e[r]))
      return false;
  return true;
}
var jO = class extends EventTarget {
  constructor(r, n) {
    var a;
    super();
    Ir(this, "cy");
    Ir(this, "tooltip");
    this.cy = Ea({
      container: n,
      elements: r.elements,
      layout: {
        name: "breadthfirst",
        circle: false,
        roots: r.roots
      },
      directed: true,
      style: GO,
      minZoom: 0.1,
      maxZoom: 10,
      wheelSensitivity: 0.4
    }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = true, (a = n == null ? void 0 : n.lastChild) == null || a.appendChild(this.tooltip);
  }
  remove() {
    this.cy && this.cy.destroy();
  }
  checkRightBoundary(r) {
    var n;
    r + this.tooltip.offsetWidth >= ((n = this.tooltip.parentElement) == null ? void 0 : n.offsetWidth) && (this.tooltip.style.left = `${r - this.tooltip.offsetWidth}px`);
  }
  overNode(r) {
    const a = r.target.data(), { label: i } = a, s = Tu(i).map((l) => l.label + " (" + l.id + ")");
    this.tooltip.innerText = Ig(s.join(`
`)), this.tooltip.style.left = `${r.renderedPosition.x}px`, this.tooltip.style.top = `${r.renderedPosition.y}px`, this.tooltip.style.maxWidth = "240px", this.tooltip.style.zIndex = 2, this.tooltip.hidden = false, this.checkRightBoundary(r.renderedPosition.x), this.tapNode(r, true);
  }
  moveNode(r) {
    const n = r.target;
    this.tooltip.style.left = `${n.renderedPosition().x}px`, this.tooltip.style.top = `${n.renderedPosition().y}px`, this.checkRightBoundary(n.renderedPosition().x);
  }
  exitNode(r) {
    this.tooltip.hidden = true, this.tapNode(r, false);
  }
  tapNode(r, n) {
    const a = r.target, i = a.data();
    let { label: o } = i;
    n ? a.addClass("active") : (a.removeClass("active"), o = "", setTimeout(() => {
      a.unselect();
    }));
    const s = Tu(o), l = new CustomEvent("tap-node", {
      detail: s
    });
    this.dispatchEvent(l);
  }
  on(r, n) {
    this.addEventListener(r, n);
  }
};
var ZO = 1.3;
var XO = 24 * 60 * 60 * 1e3;
var QO = "Reset position";
var gv = "Lock zoom";
var JO = "Unlock zoom";
var eL = "Zoom in";
var tL = "Zoom out";
var mv = 0.25;
var rL = "#8300bf";
var nL = 3e3;
var aL = {
  name: "ConnectivityGraph",
  props: {
    /**
     * Entity to load its connectivity graph.
     */
    entry: {
      type: String,
      default: ""
    },
    mapServer: {
      type: String,
      default: ""
    },
    sckanVersion: {
      type: String,
      default: ""
    },
    selectedConnectivityData: {
      type: Array,
      default: []
    }
  },
  data: function() {
    return {
      loading: true,
      loadingError: "",
      connectivityGraph: null,
      selectedSource: "",
      availableSources: [],
      pathList: [],
      schemaVersion: "",
      knowledgeByPath: /* @__PURE__ */ new Map(),
      labelledTerms: /* @__PURE__ */ new Set(),
      labelCache: /* @__PURE__ */ new Map(),
      resetLabel: QO,
      zoomLockLabel: gv,
      zoomInLabel: eL,
      zoomOutLabel: tL,
      iconColor: rL,
      zoomEnabled: false,
      connectivityError: null,
      timeoutID: void 0,
      connectivityGraphContainer: null
    };
  },
  mounted() {
    this.showSpinner(), this.updateTooltipContainer(), this.refreshCache(), this.loadCacheData(), this.run().then((t13) => {
      t13 != null && t13.success ? this.showGraph(this.entry) : t13 != null && t13.error ? this.loadingError = t13.error : this.loadingError = "Loading error!", this.hideSpinner();
    }).catch((t13) => {
      this.loadingError = "Loading error!", this.hideSpinner();
    });
  },
  methods: {
    updateTooltipContainer: function() {
      this.connectivityGraphContainer = this.$refs.connectivityGraphRef;
    },
    loadCacheData: function() {
      const t13 = sessionStorage.getItem("connectivity-graph-sources"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version");
      if (this.sckanVersion && (this.selectedSource = this.sckanVersion), sessionStorage.setItem("connectivity-graph-selected-source", this.selectedSource), this.updateCacheExpiry(), t13 && (this.availableSources = JSON.parse(t13)), r && (this.pathList = JSON.parse(r)), e) {
        const a = JSON.parse(e);
        this.labelCache = new Map(Object.entries(a));
      }
      n && (this.schemaVersion = n);
    },
    isValidKnowledgeSource: function() {
      const t13 = sessionStorage.getItem("connectivity-graph-selected-source");
      return !(this.sckanVersion && this.sckanVersion !== t13);
    },
    removeAllCacheData: function() {
      [
        "connectivity-graph-expiry",
        "connectivity-graph-selected-source",
        "connectivity-graph-source",
        // to clear old data
        "connectivity-graph-sources",
        "connectivity-graph-labels",
        "connectivity-graph-pathlist",
        "connectivity-graph-schema-version"
      ].forEach((e) => {
        sessionStorage.removeItem(e);
      });
    },
    refreshCache: function() {
      const t13 = sessionStorage.getItem("connectivity-graph-expiry"), e = /* @__PURE__ */ new Date(), r = this.isValidKnowledgeSource();
      (e.getTime() > t13 || !r) && this.removeAllCacheData();
    },
    updateCacheExpiry: function() {
      const e = (/* @__PURE__ */ new Date()).getTime() + XO;
      sessionStorage.setItem("connectivity-graph-expiry", e);
    },
    run: async function() {
      return this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < ZO ? {
        error: `No server available for schema-version ${this.schemaVersion}.`
      } : (this.availableSources.length || (this.availableSources = await this.loadAvailableSources()), this.isSCKANVersionAvailable() ? (await this.setPathList(this.selectedSource), {
        success: true
      }) : {
        error: `No data available for SCKAN version ${this.selectedSource}.`
      });
    },
    showGraph: async function(t13) {
      const e = this.$refs.graphCanvas;
      this.connectivityGraph = new KO(this.labelCache, e), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t13)), this.connectivityGraph.showConnectivity(e), this.selectedConnectivityData.length && this.connectivityGraph.selectConnectivity(this.selectedConnectivityData), this.connectivityGraph.on("tap-node", (r) => {
        const n = r.detail;
        this.$emit("tap-node", n);
      });
    },
    query: async function(t13, e) {
      const r = `${this.mapServer}knowledge/query/`, n = { sql: t13, params: e };
      try {
        const a = await fetch(r, {
          method: "POST",
          headers: {
            Accept: "application/json; charset=utf-8",
            "Cache-Control": "no-store",
            "Content-Type": "application/json"
          },
          body: JSON.stringify(n)
        });
        if (!a.ok)
          throw new Error(`Cannot access ${r}`);
        return await a.json();
      } catch {
        return {
          values: []
        };
      }
    },
    isSCKANVersionAvailable: function() {
      return this.availableSources.includes(this.selectedSource);
    },
    loadAvailableSources: async function() {
      const t13 = await this.getJsonData(`${this.mapServer}knowledge/sources`), r = (t13 ? t13.sources || [] : []).filter((n) => n);
      return sessionStorage.setItem("connectivity-graph-sources", JSON.stringify(r)), this.updateCacheExpiry(), r;
    },
    loadPathData: async function(t13) {
      const e = await this.query(
        `select entity, knowledge from knowledge
          where entity like 'ilxtr:%' and source=?
          order by entity`,
        [t13]
      );
      return e ? e.values : [];
    },
    setPathList: async function(t13) {
      this.pathList.length || (this.pathList = await this.loadPathData(t13), sessionStorage.setItem("connectivity-graph-pathlist", JSON.stringify(this.pathList)), this.updateCacheExpiry()), this.knowledgeByPath.clear(), this.labelledTerms = /* @__PURE__ */ new Set();
      for (const [e, r] of this.pathList) {
        const n = JSON.parse(r);
        "connectivity" in n && (this.knowledgeByPath.set(e, n), this.cacheLabels(n));
      }
      return this.labelCache.size || await this.getCachedTermLabels(), "";
    },
    getSchemaVersion: async function() {
      const t13 = await this.getJsonData(`${this.mapServer}knowledge/schema-version`);
      return t13 && +t13.version || 0;
    },
    getJsonData: async function(t13) {
      try {
        const e = await fetch(t13, {
          method: "GET",
          headers: {
            Accept: "application/json; charset=utf-8",
            "Cache-Control": "no-store",
            "Content-Type": "application/json"
          }
        });
        return e.ok || console.error(`Cannot access ${t13}`), await e.json();
      } catch {
        return null;
      }
    },
    getCachedTermLabels: async function() {
      if (this.labelledTerms.size) {
        const t13 = await this.query(
          `select entity, knowledge from knowledge
            where entity in (?${", ?".repeat(this.labelledTerms.size - 1)})
            order by source desc`,
          [...this.labelledTerms.values()]
        );
        let e = null;
        for (const [n, a] of t13.values)
          if (n !== e) {
            const i = JSON.parse(a);
            this.labelCache.set(n, i.label || n), e = n;
          }
        const r = Object.fromEntries(this.labelCache);
        sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(r)), this.updateCacheExpiry();
      }
    },
    cacheNodeLabels: function(t13) {
      for (const e of [t13[0], ...t13[1]])
        this.labelledTerms.add(e);
    },
    cacheLabels: async function(t13) {
      for (const e of t13.connectivity)
        this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]);
    },
    showSpinner: function() {
      this.loading = true;
    },
    hideSpinner: function() {
      this.loading = false;
    },
    reset: function() {
      this.connectivityGraph.reset();
    },
    zoomIn: function() {
      this.connectivityGraph.zoom(mv);
    },
    zoomOut: function() {
      this.connectivityGraph.zoom(-mv);
    },
    /**
     * Enable/disable user zoom for scrolling
     */
    toggleZoom: function() {
      this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? JO : gv, this.connectivityGraph.enableZoom(!this.zoomEnabled);
    },
    showErrorMessage: function(t13) {
      this.connectivityError = { ...t13 }, this.timeoutID && clearTimeout(this.timeoutID), this.timeoutID = setTimeout(() => {
        this.connectivityError = null;
      }, nL);
    }
  }
};
var iL = {
  class: "connectivity-graph",
  ref: "connectivityGraphRef"
};
var oL = {
  ref: "graphCanvas",
  class: "graph-canvas"
};
var sL = { class: "control-panel control-panel-tools" };
var lL = { class: "visually-hidden" };
var uL = { class: "visually-hidden" };
var cL = { class: "visually-hidden" };
var dL = { class: "visually-hidden" };
var fL = createStaticVNode('<div class="control-panel control-panel-nodes" data-v-b16499ed><div class="node-key" data-v-b16499ed><div class="key-box-container" data-v-b16499ed><div class="key-box key-box-dendrite" data-v-b16499ed> Origin </div><div class="key-box key-box-node" data-v-b16499ed> Components </div><div class="key-box key-box-axon" data-v-b16499ed> Destination </div></div></div></div>', 1);
var vL = {
  key: 0,
  class: "connectivity-graph-error"
};
var hL = { key: 0 };
var pL = {
  key: 1,
  class: "loading-error"
};
function gL(t13, e, r, n, a, i) {
  const o = n2, s = Ht, l = Hr, u = ko, c = k2, d = T2, v = I2, h6 = F2, f = oc;
  return withDirectives((openBlock(), createElementBlock("div", iL, [
    createBaseVNode("div", oL, null, 512),
    createBaseVNode("div", sL, [
      createBaseVNode("div", {
        class: normalizeClass(["tools", { "zoom-locked": t13.zoomEnabled }])
      }, [
        createVNode(u, {
          content: t13.resetLabel,
          placement: "top",
          effect: "control-tooltip",
          teleported: true,
          "append-to": t13.connectivityGraphContainer
        }, {
          default: withCtx(() => [
            createVNode(l, {
              class: "control-button",
              size: "small",
              onClick: i.reset
            }, {
              default: withCtx(() => [
                createVNode(s, { color: "white" }, {
                  default: withCtx(() => [
                    createVNode(o)
                  ]),
                  _: 1
                }),
                createBaseVNode("span", lL, toDisplayString(t13.resetLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        createVNode(u, {
          content: t13.zoomLockLabel,
          placement: "top",
          effect: "control-tooltip",
          teleported: true,
          "append-to": t13.connectivityGraphContainer
        }, {
          default: withCtx(() => [
            createVNode(l, {
              class: "control-button",
              size: "small",
              onClick: i.toggleZoom
            }, {
              default: withCtx(() => [
                createVNode(s, { color: "white" }, {
                  default: withCtx(() => [
                    t13.zoomEnabled ? (openBlock(), createBlock(c, { key: 0 })) : (openBlock(), createBlock(d, { key: 1 }))
                  ]),
                  _: 1
                }),
                createBaseVNode("span", uL, toDisplayString(t13.zoomLockLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        createVNode(u, {
          content: t13.zoomInLabel,
          placement: "left",
          effect: "control-tooltip",
          teleported: true,
          "append-to": t13.connectivityGraphContainer
        }, {
          default: withCtx(() => [
            createVNode(l, {
              class: "control-button",
              size: "small",
              onClick: i.zoomIn
            }, {
              default: withCtx(() => [
                createVNode(s, { color: "white" }, {
                  default: withCtx(() => [
                    createVNode(v)
                  ]),
                  _: 1
                }),
                createBaseVNode("span", cL, toDisplayString(t13.zoomInLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        createVNode(u, {
          content: t13.zoomOutLabel,
          placement: "left",
          effect: "control-tooltip",
          teleported: true,
          "append-to": t13.connectivityGraphContainer
        }, {
          default: withCtx(() => [
            createVNode(l, {
              class: "control-button",
              size: "small",
              onClick: i.zoomOut
            }, {
              default: withCtx(() => [
                createVNode(s, { color: "white" }, {
                  default: withCtx(() => [
                    createVNode(h6)
                  ]),
                  _: 1
                }),
                createBaseVNode("span", dL, toDisplayString(t13.zoomOutLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"])
      ], 2)
    ]),
    fL,
    t13.connectivityError ? (openBlock(), createElementBlock("div", vL, [
      t13.connectivityError.errorConnectivities ? (openBlock(), createElementBlock("strong", hL, toDisplayString(t13.connectivityError.errorConnectivities), 1)) : createCommentVNode("", true),
      createTextVNode(" " + toDisplayString(t13.connectivityError.errorMessage), 1)
    ])) : createCommentVNode("", true),
    t13.loadingError ? (openBlock(), createElementBlock("div", pL, toDisplayString(t13.loadingError), 1)) : createCommentVNode("", true)
  ])), [
    [f, t13.loading]
  ]);
}
var mA = Ur(aL, [["render", gL], ["__scopeId", "data-v-b16499ed"]]);
var mL = function(t13) {
  return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : "";
};
var yL = {
  name: "ConnectionDialog",
  props: {
    connectionEntry: {
      type: Object,
      default: {}
    },
    inDrawing: {
      type: Boolean,
      default: false
    },
    connectionExist: {
      type: Boolean,
      default: false
    }
  },
  data: function() {
    return {
      tooltipId: void 0
    };
  },
  methods: {
    shadowDisplay: function(t13) {
      return this.tooltipId === t13 ? "always" : "hover";
    },
    capitalize: function(t13) {
      return mL(t13);
    },
    handleTooltip: function(t13) {
      this.tooltipId = this.tooltipId === t13 ? void 0 : t13, this.$emit("featureTooltip", this.tooltipId);
    }
  }
};
var Lc = (t13) => (pushScopeId("data-v-1ddab772"), t13 = t13(), popScopeId(), t13);
var bL = { class: "dialog-container" };
var wL = Lc(() => createBaseVNode("span", { class: "dialog-title" }, "Finalize drawing", -1));
var CL = Lc(() => createBaseVNode("span", { class: "dialog-title" }, "Visualize connection", -1));
var xL = Lc(() => createBaseVNode("b", null, [
  createBaseVNode("span", null, "Related Features")
], -1));
var EL = { class: "connection-label" };
function kL(t13, e, r, n, a, i) {
  const o = Hr, s = Js, l = So, u = el, c = xE;
  return openBlock(), createElementBlock("div", bL, [
    createVNode(s, null, {
      default: withCtx(() => [
        createVNode(l, null, {
          default: withCtx(() => [
            r.inDrawing ? (openBlock(), createBlock(s, { key: 0 }, {
              default: withCtx(() => [
                wL,
                createVNode(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[0] || (e[0] = (d) => t13.$emit("confirmDrawn", true))
                }, {
                  default: withCtx(() => [
                    createTextVNode(" Confirm ")
                  ]),
                  _: 1
                }),
                createVNode(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[1] || (e[1] = (d) => t13.$emit("cancelDrawn", true))
                }, {
                  default: withCtx(() => [
                    createTextVNode(" Cancel ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })) : (openBlock(), createBlock(s, { key: 1 }, {
              default: withCtx(() => [
                CL,
                createVNode(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[2] || (e[2] = (d) => t13.$emit("dialogDisplay", false))
                }, {
                  default: withCtx(() => [
                    createTextVNode(" Close ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }))
          ]),
          _: 1
        })
      ]),
      _: 1
    }),
    r.connectionExist ? (openBlock(), createBlock(s, { key: 0 }, {
      default: withCtx(() => [
        createVNode(l, null, {
          default: withCtx(() => [
            xL,
            (openBlock(true), createElementBlock(Fragment, null, renderList(r.connectionEntry, (d, v) => (openBlock(), createBlock(s, { key: v }, {
              default: withCtx(() => [
                createVNode(c, {
                  shadow: i.shadowDisplay(v),
                  onClick: (h6) => i.handleTooltip(v)
                }, {
                  default: withCtx(() => [
                    createVNode(u, {
                      trigger: "hover",
                      disabled: d.label.length < 20,
                      width: 200,
                      content: i.capitalize(d.label)
                    }, {
                      reference: withCtx(() => [
                        createBaseVNode("span", EL, toDisplayString(i.capitalize(d.label)), 1)
                      ]),
                      _: 2
                    }, 1032, ["disabled", "content"])
                  ]),
                  _: 2
                }, 1032, ["shadow", "onClick"])
              ]),
              _: 2
            }, 1024))), 128))
          ]),
          _: 1
        })
      ]),
      _: 1
    })) : createCommentVNode("", true)
  ]);
}
var SL = Ur(yL, [["render", kL], ["__scopeId", "data-v-1ddab772"]]);
var Ag = (t13, e) => {
  const r = t13.__vccOpts || t13;
  for (const [n, a] of e)
    r[n] = a;
  return r;
};
var TL = ["xlink:href"];
var _L = {
  __name: "SvgIcon",
  props: {
    /**
     * The svg icon to show.
     */
    icon: {
      type: String,
      required: true
    },
    /**
     * The option to spin the icon.
     */
    spin: {
      type: Boolean,
      default: false
    }
  },
  setup(t13) {
    return (e, r) => (openBlock(), createElementBlock("svg", {
      class: normalizeClass(["map-icon", { "map-icon-spin": t13.spin }])
    }, [
      createBaseVNode("use", {
        "xlink:href": `#${t13.icon}`
      }, null, 8, TL)
    ], 2));
  }
};
var DL = Ag(_L, [["__scopeId", "data-v-e172d5ff"]]);
var Fg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Mg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2vertpanel</title>
    <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-3">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Bg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>3panel</title>
    <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="11.5" y1="7.5" x2="11.5" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Ng = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>4panel</title>
    <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-2">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Rg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="12" y1="12.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="14.5" y1="12" x2="14.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var $g = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="14.5" y1="16" x2="14.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var zg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>4panel</title>
    <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-2">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="10.5" x2="5.5" y2="10.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Vg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>changeBckgd</title>
    <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5">
            <circle id="Oval-Copy" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <rect id="Rectangle" stroke="#FFFFFF" x="7" y="6" width="10" height="7"></rect>
            <line x1="12" y1="13.5" x2="12" y2="16.5" id="Line-4" stroke="#FFFFFF" stroke-width="2"></line>
            <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var Hg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>close no bk</title>
    <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
        <g id="Group-13" transform="translate(12.000000, 12.000000) rotate(-315.000000) translate(-12.000000, -12.000000) translate(5.000000, 5.000000)" stroke="#FFFFFF" stroke-width="2">
            <line x1="0" y1="7" x2="14" y2="7" id="Line-9"></line>
            <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
        </g>
    </g>
</svg>`;
var Kg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>close</title>
    <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <g id="Group-8" fill="currentColor">
                <circle id="Oval" cx="12" cy="12" r="12"></circle>
            </g>
            <g id="Group-13" transform="translate(12.000000, 12.000000) rotate(-315.000000) translate(-12.000000, -12.000000) translate(5.000000, 5.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="0" y1="7" x2="14" y2="7" id="Line-9"></line>
                <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
            </g>
        </g>
    </g>
</svg>`;
var qg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>closeFullScreen</title>
    <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(6.750000, 7.750000) rotate(-180.000000) translate(-6.750000, -7.750000) " points="5 9.5 5 6 8.5 6"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 15.750000) rotate(-360.000000) translate(-17.250000, -15.750000) " points="15.5 17.5 15.5 14 19 14"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(6.750000, 15.750000) scale(1, -1) rotate(-180.000000) translate(-6.750000, -15.750000) " points="5 17.5 5 14 8.5 14"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 7.750000) scale(1, -1) rotate(-360.000000) translate(-17.250000, -7.750000) " points="15.5 9.5 15.5 6 19 6"></polyline>
        </g>
    </g>
</svg>`;
var Ug = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Comment</title>
    <g id="Comment" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="512" cy="512" r="512"></circle>
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
            d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" />
    </g>
</svg>`;
var Gg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Connection</title>
    <g id="Connection" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="512" cy="512" r="512"></circle>
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
            d="M640 384v64H448a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h320a128 128 0 0 0 128-128V576a128 128 0 0 0-64-110.848V394.88c74.56 26.368 128 97.472 128 181.056v128a192 192 0 0 1-192 192H448a192 192 0 0 1-192-192V576a192 192 0 0 1 192-192z" />
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
            d="M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" />
    </g>
</svg>`;
var Wg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>dock</title>
    <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-8-Copy-2">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-5" transform="translate(2.972940, 3.512563)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="10.7289628" y1="7.03553391" x2="14.9716035" y2="2.79289322" id="Line"></line>
                <g id="Group" transform="translate(14.264497, 3.500000) rotate(-315.000000) translate(-14.264497, -3.500000) translate(11.264497, 2.000000)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
                <line x1="7.53553391" y1="10.1584369" x2="3.29289322" y2="14.4010776" id="Line"></line>
                <g id="Group" transform="translate(4.000000, 13.693971) rotate(-135.000000) translate(-4.000000, -13.693971) translate(1.000000, 12.193971)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`;
var Yg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawLine</title>
    <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(2 2.0625)" d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z" />
    </g>
</svg>`;
var jg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawPoint</title>
    <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(1.875 2.5)" d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z" />
    </g>
</svg>`;
var Zg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawPolygon</title>
    <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(1.875 1.625)" d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z" />
    </g>
</svg>`;
var Xg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawTrash</title>
    <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(2 1.5)" d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z" />
    </g>
</svg>`;
var Qg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>fitWindow</title>
    <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-3">
            <g id="Group-8-Copy">
                <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group" transform="translate(5.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="1.5">
                    <polyline id="Line-5" points="0 3.5 0 0 4.80123862 0"></polyline>
                    <polyline id="Line-5" transform="translate(2.400619, 9.750000) scale(1, -1) translate(-2.400619, -9.750000) " points="0 11.5 0 8 4.80123862 8"></polyline>
                    <polyline id="Line-5" transform="translate(11.600619, 1.750000) scale(1, -1) rotate(-180.000000) translate(-11.600619, -1.750000) " points="9.2 3.5 9.2 0 14.0012386 0"></polyline>
                </g>
            </g>
            <g id="Group-12" transform="translate(9.000000, 8.500000)" stroke="#FFFFFF" stroke-width="2">
                <circle id="Oval" cx="3.5" cy="3.5" r="3.5"></circle>
                <line x1="8.75" y1="8.75" x2="6.25" y2="6.25" id="Line-8" stroke-linecap="square"></line>
            </g>
        </g>
    </g>
</svg>`;
var Jg = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>fullScreen</title>
    <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-8-Copy">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group" transform="translate(5.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="1.5">
                <polyline id="Line-5" points="7.68274333e-14 3.5 7.68274333e-14 0 4.80123862 0"></polyline>
                <polyline id="Line-5" transform="translate(11.600619, 9.750000) rotate(-180.000000) translate(-11.600619, -9.750000) " points="9.2 11.5 9.2 8 14.0012386 8"></polyline>
                <polyline id="Line-5" transform="translate(2.400619, 9.750000) scale(1, -1) translate(-2.400619, -9.750000) " points="7.68274333e-14 11.5 7.68274333e-14 8 4.80123862 8"></polyline>
                <polyline id="Line-5" transform="translate(11.600619, 1.750000) scale(1, -1) rotate(-180.000000) translate(-11.600619, -1.750000) " points="9.2 3.5 9.2 0 14.0012386 0"></polyline>
            </g>
        </g>
    </g>
</svg>`;
var em = '<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>';
var tm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>magnifyingGlass</title>
    <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`;
var rm = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360   c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80   c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580   c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`;
var nm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>openMap</title>
    <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5-Copy" fill="currentColor">
            <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
        </g>
        <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
        <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
    </g>
</svg>`;
var am = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Artboard Copy 6</title>
    <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5-Copy" fill="currentColor">
            <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
        </g>
        <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
        <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
    </g>
</svg>`;
var im = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>permalink</title>
    <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <line x1="12.5" y1="9" x2="12.5" y2="15" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></line>
        <path d="M17,13 L17,16.5 C17,18.9852814 14.9852814,21 12.5,21 C10.0147186,21 8,18.9852814 8,16.5 L8,13 L10,13 L10,16.5 C10,17.8807119 11.1192881,19 12.5,19 C13.8254834,19 14.9100387,17.9684641 14.9946823,16.6643757 L15,16.5 L15,13 L17,13 Z M12.5,3 C14.9852814,3 17,5.01471863 17,7.5 L17,11 L15,11 L15,7.5 C15,6.11928813 13.8807119,5 12.5,5 C11.1745166,5 10.0899613,6.03153594 10.0053177,7.33562431 L10,7.5 L10,11 L8,11 L8,7.5 C8,5.01471863 10.0147186,3 12.5,3 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></path>
    </g>
</svg>`;
var om = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>play</title>
    <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <g id="Group-5-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
            </g>
            <polygon id="Triangle" fill="#FFFFFF" class="st0" transform="translate(13.000000, 11.500000) rotate(-270.000000) translate(-13.000000, -11.500000) " points="13 8 19 15 7 15"></polygon>
        </g>
    </g>
</svg>`;
var sm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>resetZoom</title>
    <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-13-Copy-2">
            <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
            </g>
            <g id="Group-4" transform="translate(7.500000, 7.000000)">
                <path d="M3,5 C3.83613696,5 4.57640148,4.58952131 5.03027306,3.95908443 C5.19488093,3.73044075 5.32181864,3.47286529 5.40199763,3.19544657 C5.46580562,2.97467142 5.5,2.74132897 5.5,2.5 C5.5,2.26693547 5.46810753,2.04131982 5.40844867,1.82727914 C5.31560782,1.49418996 5.15552386,1.18913241 4.9437468,0.927656488 C4.48541251,0.361762414 3.78495332,0 3,0 C1.61928813,0 0.5,1.11928813 0.5,2.5 C0.5,3.88071187 1.61928813,5 3,5 Z" id="Oval" stroke="#FFFFFF"></path>
                <rect id="Rectangle" fill="currentColor" x="2.5" y="2" width="4" height="1"></rect>
                <line x1="5.5" y1="1.5" x2="5.5" y2="0.5" id="Line-7" stroke="#FFFFFF" stroke-linecap="square"></line>
                <line x1="4.5" y1="1.5" x2="5.5" y2="1.5" id="Line-7" stroke="#FFFFFF" stroke-linecap="square"></line>
            </g>
        </g>
    </g>
</svg>`;
var lm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>singlepanel</title>
    <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-5">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
        </g>
    </g>
</svg>`;
var um = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>tooltips</title>
    <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-15">
            <circle id="Oval-Copy" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <path d="M6,5 L18,5 C19.1045695,5 20,5.8954305 20,7 L20,15.5714286 C20,16.6759981 19.1045695,17.5714286 18,17.5714286 L15.4003471,17.5714286 L15.4003471,17.5714286 L12.8157442,20.271248 C12.4338253,20.6701921 11.8008107,20.6839938 11.4018666,20.3020749 C11.3997428,20.3000417 11.3976279,20.2979991 11.3955221,20.2959473 L8.59934577,17.5714286 L8.59934577,17.5714286 L6,17.5714286 C4.8954305,17.5714286 4,16.6759981 4,15.5714286 L4,7 C4,5.8954305 4.8954305,5 6,5 Z" id="Rectangle" fill="#FFFFFF"></path>
            <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold" fill="currentColor">
                <tspan x="8.5" y="18">?</tspan>
            </text>
        </g>
    </g>
</svg>`;
var cm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>undock</title>
    <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-5" transform="translate(5.500000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="0.728962778" y1="12.0355339" x2="4.97160346" y2="7.79289322" id="Line"></line>
                <g id="Group" transform="translate(4.264497, 8.500000) rotate(-315.000000) translate(-4.264497, -8.500000) translate(1.264497, 7.000000)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
                <line x1="12.5355339" y1="0.158436893" x2="8.29289322" y2="4.40107758" id="Line"></line>
                <g id="Group" transform="translate(9.000000, 3.693971) rotate(-135.000000) translate(-9.000000, -3.693971) translate(6.000000, 2.193971)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`;
var dm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>zoomIn</title>
    <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(10.500000, 9.500000) rotate(90.000000) translate(-10.500000, -9.500000) "></line>
        </g>
    </g>
</svg>`;
var fm = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>zoomOut</title>
    <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy-3">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`;
var vm = (t13, e, r, n) => {
  const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || [];
  let s = document.createElement("div");
  s.innerHTML = t13, a.map((u) => {
    const c = s.querySelector(u);
    c && c.remove();
  }), i.map((u) => {
    s.querySelector("svg").removeAttribute(u);
  }), n && o.map((u) => {
    Object.values(s.querySelectorAll(`[${u}]`)).map((c) => {
      c.removeAttribute(u);
    });
  });
  const l = s.innerHTML;
  return s = null, l;
};
var hm = (t13) => [
  // Remove XML stuffs and comments
  [/<\?xml[\s\S]*?>/gi, ""],
  [/<!doctype[\s\S]*?>/gi, ""],
  [/<!--.*-->/gi, ""],
  // SVG XML -> HTML5
  [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2></$1>"],
  // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes
  [/\s+/g, " "],
  // replace whitespace sequences with a single space
  [/\> \</g, "><"]
  // remove whitespace between tags
].reduce((e, r) => "".replace.apply(e, r), t13).trim();
var PL = true;
var OL = true;
var LL = ["fill"];
var _u = Object.assign({
  "/assets/icons/2horpanel.svg": Fg,
  "/assets/icons/2vertpanel.svg": Mg,
  "/assets/icons/3panel.svg": Bg,
  "/assets/icons/4panel.svg": Ng,
  "/assets/icons/5panel.svg": Rg,
  "/assets/icons/6panel.svg": $g,
  "/assets/icons/6panelVertical.svg": zg,
  "/assets/icons/changeBckgd.svg": Vg,
  "/assets/icons/close-no-bk.svg": Hg,
  "/assets/icons/close.svg": Kg,
  "/assets/icons/closeFullScreen.svg": qg,
  "/assets/icons/comment.svg": Ug,
  "/assets/icons/connection.svg": Gg,
  "/assets/icons/dock.svg": Wg,
  "/assets/icons/drawLine.svg": Yg,
  "/assets/icons/drawPoint.svg": jg,
  "/assets/icons/drawPolygon.svg": Zg,
  "/assets/icons/drawTrash.svg": Xg,
  "/assets/icons/fitWindow.svg": Qg,
  "/assets/icons/fullScreen.svg": Jg,
  "/assets/icons/help.svg": em,
  "/assets/icons/magnifyingGlass.svg": tm,
  "/assets/icons/noun-filter.svg": rm,
  "/assets/icons/openMap.svg": nm,
  "/assets/icons/pause.svg": am,
  "/assets/icons/permalink.svg": im,
  "/assets/icons/play.svg": om,
  "/assets/icons/resetZoom.svg": sm,
  "/assets/icons/singlepanel.svg": lm,
  "/assets/icons/tooltips.svg": um,
  "/assets/icons/undock.svg": cm,
  "/assets/icons/zoomIn.svg": dm,
  "/assets/icons/zoomOut.svg": fm
});
var IL = Object.keys(_u).map((t13) => {
  const e = vm(_u[t13], PL, OL, LL), r = t13.replace(/^.+\/(\w+).svg$/, "$1");
  return hm(e).replace("<svg", `<symbol id="${r}"`).replace("svg>", "symbol>");
});
IL.join(`
`);
var Du = Object.assign({
  "/assets/icons/2horpanel.svg": Fg,
  "/assets/icons/2vertpanel.svg": Mg,
  "/assets/icons/3panel.svg": Bg,
  "/assets/icons/4panel.svg": Ng,
  "/assets/icons/5panel.svg": Rg,
  "/assets/icons/6panel.svg": $g,
  "/assets/icons/6panelVertical.svg": zg,
  "/assets/icons/changeBckgd.svg": Vg,
  "/assets/icons/close-no-bk.svg": Hg,
  "/assets/icons/close.svg": Kg,
  "/assets/icons/closeFullScreen.svg": qg,
  "/assets/icons/comment.svg": Ug,
  "/assets/icons/connection.svg": Gg,
  "/assets/icons/dock.svg": Wg,
  "/assets/icons/drawLine.svg": Yg,
  "/assets/icons/drawPoint.svg": jg,
  "/assets/icons/drawPolygon.svg": Zg,
  "/assets/icons/drawTrash.svg": Xg,
  "/assets/icons/fitWindow.svg": Qg,
  "/assets/icons/fullScreen.svg": Jg,
  "/assets/icons/help.svg": em,
  "/assets/icons/magnifyingGlass.svg": tm,
  "/assets/icons/noun-filter.svg": rm,
  "/assets/icons/openMap.svg": nm,
  "/assets/icons/pause.svg": am,
  "/assets/icons/permalink.svg": im,
  "/assets/icons/play.svg": om,
  "/assets/icons/resetZoom.svg": sm,
  "/assets/icons/singlepanel.svg": lm,
  "/assets/icons/tooltips.svg": um,
  "/assets/icons/undock.svg": cm,
  "/assets/icons/zoomIn.svg": dm,
  "/assets/icons/zoomOut.svg": fm
});
var AL = Object.keys(Du).map((t13) => {
  const e = vm(Du[t13]), r = t13.replace(/^.+\/(\w+).svg$/, "$1");
  return hm(e).replace("<svg", `<symbol id="${r}"`).replace("svg>", "symbol>");
});
var FL = {
  name: "MapSvgSpriteColor",
  svgContext: Du,
  svgSprite: AL.join(`
`)
  // concatenate all symbols into $options.svgSprite
};
var ML = ["innerHTML"];
function BL(t13, e, r, n, a, i) {
  return openBlock(), createElementBlock("svg", {
    width: "0",
    height: "0",
    style: { display: "none" },
    innerHTML: t13.$options.svgSprite
  }, null, 8, ML);
}
var NL = Ag(FL, [["render", BL]]);
var RL = (t13, e) => {
  let r, n, a, i, o, s;
  e.style.left = "", e.style.top = "", e.addEventListener(
    "mousedown",
    (u) => {
      u.preventDefault(), r = e.offsetLeft, n = e.offsetTop, a = u.clientX, i = u.clientY, e.addEventListener("mousemove", l, false), document.addEventListener(
        "mouseup",
        () => {
          e.removeEventListener("mousemove", l, false);
        },
        false
      );
    },
    false
  );
  function l(u) {
    u.preventDefault(), o = r - (a - u.clientX), s = n - (i - u.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`;
  }
};
var $L = {
  name: "DrawToolbar",
  components: {
    MapSvgIcon: DL,
    MapSvgSpriteColor: NL
  },
  props: {
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This is needed to display the dialog and provides the additional drag capability to the dialog.
     *
     * e.g.
     * :mapCanvas="{
     *   containerHTML: appRef, // Reference to the map canvas container.
     *   class: '.maplibregl-canvas', // CSS selector for the map canvas.
     * }"
     */
    mapCanvas: {
      type: Object,
      default: void 0
    },
    /**
     * Array of toolbar options to display.
     * 'Connection' requires 'LineString' is included in the toolbar options.
     */
    toolbarOptions: {
      type: Array,
      default: [
        "Edit",
        "Delete",
        "Point",
        "LineString",
        "Polygon",
        "Connection"
      ]
    },
    /**
     * Optional
     *
     * To update the toolbar icons or filter the features based on the tool type.
     * e.g. "All tools", "Point", "LineString", "Polygon" or "None".
     */
    drawnType: {
      type: String,
      default: "All tools"
    },
    activeDrawTool: {
      required: true
    },
    activeDrawMode: {
      required: true
    },
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This will popup a dialog if new feature is drawn and map canvas exists.
     */
    newlyDrawnEntry: {
      type: Object,
      default: {}
    },
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This will add entries to the dialog.
     */
    connectionEntry: {
      type: Object,
      default: {}
    },
    /**
     * Add following to the top hoverVisibilities array to enable tooltips for each icon.
     * [
     *  { value: false, refs: 'toolbarPopover', ref: 'editPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'deletePopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'pointPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' },
     * ]
     */
    hoverVisibilities: {
      type: Array,
      required: true,
      default: [
        { value: false, ref: "editPopover" },
        { value: false, ref: "deletePopover" },
        { value: false, ref: "pointPopover" },
        { value: false, ref: "lineStringPopover" },
        { value: false, ref: "polygonPopover" },
        { value: false, ref: "connectionPopover" }
      ]
    }
  },
  data: function() {
    return {
      toolbarIcons: [
        { name: "Edit", active: false, disabled: false, type: "mode" },
        { name: "Delete", active: false, disabled: false, type: "mode" },
        { name: "Point", active: false, disabled: false, type: "tool" },
        { name: "LineString", active: false, disabled: false, type: "tool" },
        { name: "Polygon", active: false, disabled: false, type: "tool" },
        { name: "Connection", active: false, disabled: true, type: "conn" }
      ],
      connectionDisplay: false,
      dialogPosition: {
        offsetX: 0,
        offsetY: 0,
        x: void 0,
        y: void 0
      }
    };
  },
  computed: {
    showAllToolIcons: function() {
      return this.drawnType === "All tools" || this.drawnType === "None";
    },
    showEditModeIcon: function() {
      return this.toolbarOptions.includes("Edit");
    },
    showDeleteModeIcon: function() {
      return this.toolbarOptions.includes("Delete");
    },
    showDrawPointIcon: function() {
      return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point");
    },
    showDrawLineStringIcon: function() {
      return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString");
    },
    showDrawPolygonIcon: function() {
      return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon");
    },
    showConnectionIcon: function() {
      return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString");
    },
    inDrawing: function() {
      return this.activeDrawTool !== void 0;
    },
    newlyDrawnExist: function() {
      return Object.keys(this.newlyDrawnEntry).length > 0;
    },
    connectionExist: function() {
      return Object.keys(this.connectionEntry).length > 0;
    }
  },
  watch: {
    drawnType: function() {
      this.disabledToolbarConnectionIcon(true);
    },
    activeDrawMode: function(t13) {
      this.updateToolbarIcons(t13, "mode"), t13 === "Delete" && (this.connectionDisplay = false);
    },
    activeDrawTool: function(t13) {
      this.updateToolbarIcons(t13, "tool"), t13 || (this.connectionDisplay = false);
    },
    newlyDrawnExist: function(t13) {
      t13 && (this.connectionDisplay = true);
    },
    connectionExist: function(t13) {
      this.disabledToolbarConnectionIcon(!t13), t13 || (this.connectionDisplay = false);
    },
    connectionDisplay: function(t13) {
      this.activeToolbarConnectionIcon(t13), t13 ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0);
    },
    dialogPosition: {
      handler: function() {
        const t13 = this.$el.getBoundingClientRect();
        this.dialogPosition.offsetX = t13.x, this.dialogPosition.offsetY = t13.y;
      },
      deep: true,
      once: true
    }
  },
  methods: {
    iconDisabled: function(t13) {
      return this.toolbarIcons.filter((e) => e.name === t13)[0].disabled;
    },
    modeClickEvent: function(t13) {
      if (!this.iconDisabled(t13)) {
        const e = this.activeDrawMode === t13 ? void 0 : t13;
        this.$emit("clickToolbar", "mode", e);
      }
    },
    toolClickEvent: function(t13) {
      if (!this.iconDisabled(t13)) {
        const e = this.activeDrawTool === t13 ? void 0 : t13;
        this.$emit("clickToolbar", "tool", e);
      }
    },
    connectionClickEvent: function() {
      !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay);
    },
    updateToolbarIcons: function(t13, e) {
      this.toolbarIcons.map((r) => {
        r.name === t13 ? r.active = true : r.active = false;
      }), this.toolbarIcons.filter((r) => r.type !== "conn").filter((r) => r.type !== e).map((r) => {
        t13 ? r.disabled = true : r.disabled = false;
      }), this.toolbarCssHacks();
    },
    disabledToolbarConnectionIcon: function(t13) {
      this.toolbarIcons.filter((e) => e.type === "conn").map((e) => {
        t13 ? e.disabled = true : e.disabled = false, this.activeDrawMode === "Delete" && (e.disabled = true);
      }), this.toolbarCssHacks();
    },
    activeToolbarConnectionIcon: function(t13) {
      this.toolbarIcons.filter((e) => e.type === "conn").map((e) => {
        t13 ? e.active = true : e.active = false;
      }), this.toolbarCssHacks();
    },
    toolbarCssHacks: function() {
      this.$nextTick(() => {
        this.toolbarIcons.map((t13) => {
          const e = this.$el.querySelector(`.draw${t13.name}`);
          e && (t13.active ? e.classList.add("active") : e.classList.remove("active"), t13.disabled ? e.classList.add("disabled") : e.classList.remove("disabled"));
        });
      });
    },
    dialogCssHacks: function() {
      this.$nextTick(() => {
        const t13 = this.$el.querySelector(".connection-dialog");
        RL(this.mapCanvas.containerHTML, t13);
        let e, r;
        const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t13.getBoundingClientRect();
        this.dialogPosition.x > n.width / 2 ? e = this.dialogPosition.x - a.width : e = this.dialogPosition.x, this.dialogPosition.y > n.height / 2 ? r = this.dialogPosition.y - a.height : r = this.dialogPosition.y, t13.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`;
      });
    },
    hoverIndex: function(t13) {
      return this.hoverVisibilities.findIndex((e) => e.ref === t13);
    },
    showTooltip: function(t13) {
      this.$emit("showTooltip", t13);
    },
    hideTooltip: function(t13) {
      this.$emit("hideTooltip", t13);
    },
    dialogPopUpPositionHandler: function(t13) {
      t13.preventDefault(), this.dialogPosition.x = t13.clientX, this.dialogPosition.y = t13.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks();
    }
  },
  mounted: function() {
    this.$nextTick(() => {
      this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, false);
    });
  },
  destroyed: function() {
    this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, false);
  }
};
var zL = { class: "toolbar-container" };
var VL = { class: "toolbar-icons" };
function HL(t13, e, r, n, a, i) {
  const o = resolveComponent("map-svg-sprite-color"), s = resolveComponent("map-svg-icon"), l = el, u = SL;
  return openBlock(), createElementBlock("div", zL, [
    createVNode(o),
    createBaseVNode("div", VL, [
      i.showEditModeIcon ? (openBlock(), createBlock(l, {
        key: 0,
        content: "Edit Mode",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value,
        ref: "editPopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "comment",
            class: "icon-button drawEdit",
            onClick: e[0] || (e[0] = (c) => i.modeClickEvent("Edit")),
            onMouseover: e[1] || (e[1] = (c) => i.showTooltip(i.hoverIndex("editPopover"))),
            onMouseout: e[2] || (e[2] = (c) => i.hideTooltip(i.hoverIndex("editPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true),
      i.showDeleteModeIcon ? (openBlock(), createBlock(l, {
        key: 1,
        content: "Delete Mode",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value,
        ref: "deletePopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "drawTrash",
            class: "icon-button drawDelete",
            onClick: e[3] || (e[3] = (c) => i.modeClickEvent("Delete")),
            onMouseover: e[4] || (e[4] = (c) => i.showTooltip(i.hoverIndex("deletePopover"))),
            onMouseout: e[5] || (e[5] = (c) => i.hideTooltip(i.hoverIndex("deletePopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true),
      i.showDrawPointIcon ? (openBlock(), createBlock(l, {
        key: 2,
        content: "Draw Point",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value,
        ref: "pointPopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "drawPoint",
            class: "icon-button drawPoint",
            onClick: e[6] || (e[6] = (c) => i.toolClickEvent("Point")),
            onMouseover: e[7] || (e[7] = (c) => i.showTooltip(i.hoverIndex("pointPopover"))),
            onMouseout: e[8] || (e[8] = (c) => i.hideTooltip(i.hoverIndex("pointPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true),
      i.showDrawLineStringIcon ? (openBlock(), createBlock(l, {
        key: 3,
        content: "Draw LineString",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,
        ref: "drawLinePopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "drawLine",
            class: "icon-button drawLineString",
            onClick: e[9] || (e[9] = (c) => i.toolClickEvent("LineString")),
            onMouseover: e[10] || (e[10] = (c) => i.showTooltip(i.hoverIndex("lineStringPopover"))),
            onMouseout: e[11] || (e[11] = (c) => i.hideTooltip(i.hoverIndex("lineStringPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true),
      i.showDrawPolygonIcon ? (openBlock(), createBlock(l, {
        key: 4,
        content: "Draw Polygon",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value,
        ref: "polygonPopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "drawPolygon",
            class: "icon-button drawPolygon",
            onClick: e[12] || (e[12] = (c) => i.toolClickEvent("Polygon")),
            onMouseover: e[13] || (e[13] = (c) => i.showTooltip(i.hoverIndex("polygonPopover"))),
            onMouseout: e[14] || (e[14] = (c) => i.hideTooltip(i.hoverIndex("polygonPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true),
      i.showConnectionIcon ? (openBlock(), createBlock(l, {
        key: 5,
        content: "Connectivity",
        placement: "top",
        teleported: false,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value,
        ref: "connectionPopover"
      }, {
        reference: withCtx(() => [
          createVNode(s, {
            icon: "connection",
            class: "icon-button drawConnection",
            onClick: e[15] || (e[15] = (c) => i.connectionClickEvent()),
            onMouseover: e[16] || (e[16] = (c) => i.showTooltip(i.hoverIndex("connectionPopover"))),
            onMouseout: e[17] || (e[17] = (c) => i.hideTooltip(i.hoverIndex("connectionPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : createCommentVNode("", true)
    ]),
    r.mapCanvas ? withDirectives((openBlock(), createBlock(u, {
      key: 0,
      class: "connection-dialog",
      connectionEntry: r.connectionEntry,
      inDrawing: i.inDrawing,
      connectionExist: i.connectionExist,
      onDialogDisplay: e[18] || (e[18] = (c) => i.connectionClickEvent()),
      onConfirmDrawn: e[19] || (e[19] = (c) => t13.$emit("confirmDrawn", c)),
      onCancelDrawn: e[20] || (e[20] = (c) => t13.$emit("cancelDrawn", c)),
      onFeatureTooltip: e[21] || (e[21] = (c) => t13.$emit("featureTooltip", c))
    }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [
      [vShow, t13.connectionDisplay]
    ]) : createCommentVNode("", true)
  ]);
}
var yA = Ur($L, [["render", HL], ["__scopeId", "data-v-8a96a220"]]);
var KL = {
  name: "HelpModeDialog",
  props: {
    /**
     * MultiFlatmapRef from multiflatmapvuer. Provide this when using with MultiFlatmap.
     */
    multiflatmapRef: {
      type: Object,
      default: null
    },
    /**
     * FlatmapRef from flatmapvuer. Provide this when using with Flatmap.
     */
    flatmapRef: {
      type: Object,
      default: null
    },
    /**
     * ScaffoldRef from scaffoldvuer. Provide this when using with Scaffold.
     */
    scaffoldRef: {
      type: Object,
      default: null
    },
    /**
     * The flag for last tooltip item.
     */
    lastItem: {
      type: Boolean,
      default: false,
      required: false
    }
  },
  mounted: function() {
    this.toggleHelpModeHighlight(true), this.toggleTooltipHighlight();
  },
  unmounted: function() {
    this.toggleHelpModeHighlight(false);
  },
  watch: {
    lastItem: function(t13) {
      t13 && this.toggleTooltipHighlight();
    }
  },
  methods: {
    /**
     * This function will be called on clicking Next button.
     *
     * @public
     */
    showNext: function() {
      this.$emit("show-next");
    },
    /**
     * This function will be called on clicking Finish button.
     *
     * @public
     */
    finishHelpMode: function() {
      this.$emit("finish-help-mode");
    },
    /**
     * This function must be called on 'shown-map-tooltip' event.
     *
     * @public
     */
    toggleTooltipPinHighlight: function() {
      const t13 = this.getCurrentFlatmap();
      this.resetHighlightedItems(), this.$nextTick(() => {
        var i;
        const e = t13.querySelectorAll(".maplibregl-marker"), r = t13.querySelector(
          ".flatmap-popup-popper"
        ), n = ((i = r == null ? void 0 : r.style) == null ? void 0 : i.transform) || "", a = this.extractMarkerPosition(n);
        e.forEach((o) => {
          const s = o.style.transform;
          this.extractMarkerPosition(s) === a && o.classList.add("in-help-highlight");
        });
      });
    },
    /**
     * This function must be called on 'shown-tooltip' event.
     *
     * @public
     */
    toggleTooltipHighlight: function() {
      this.resetHighlightedItems(), this.$nextTick(() => {
        document.querySelectorAll(
          '.el-popper:not([style*="none"])'
        ).forEach((e) => {
          const r = e.classList.contains("flatmap-popper"), n = e.classList.contains(
            "el-fade-in-linear-enter-active"
          );
          (r || n) && this.toggleHighlight(e);
        });
      });
    },
    toggleHighlight: function(t13) {
      const e = (t13 == null ? void 0 : t13.id) || "", r = document.querySelector(
        `[aria-describedby="${e}"]`
      );
      r && r.classList.add("in-help-highlight");
    },
    resetHighlightedItems: function() {
      document.querySelectorAll(".in-help-highlight").forEach((e) => {
        e.classList.remove("in-help-highlight");
      });
    },
    getCurrentScaffold: function() {
      var e;
      return ((e = this.scaffoldRef) == null ? void 0 : e.$el) || null;
    },
    getCurrentMultiflatmap: function() {
      var e;
      return ((e = this.multiflatmapRef) == null ? void 0 : e.$el) || null;
    },
    getCurrentFlatmap: function() {
      var r;
      const t13 = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap());
      return (t13 == null ? void 0 : t13.$el) || null;
    },
    toggleHelpModeHighlight: function(t13) {
      const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight");
      e && (t13 ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t13 ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t13 ? n.classList.add("in-help") : n.classList.remove("in-help")), t13 || a.forEach((i) => {
        i.classList.remove("in-help-highlight");
      });
    },
    /**
     * Temporary solution to find the position of map marker from popover
     */
    extractMarkerPosition: function(t13) {
      const e = /translate\((.*?)\)/g, r = t13.match(e);
      return r ? r[r.length - 1].slice(10, -1) : "";
    }
  }
};
var Ic = (t13) => (pushScopeId("data-v-3efb89fb"), t13 = t13(), popScopeId(), t13);
var qL = Ic(() => createBaseVNode("h4", null, "Help Mode", -1));
var UL = Ic(() => createBaseVNode("p", null, [
  createTextVNode(" All caught up! "),
  createBaseVNode("br"),
  createTextVNode(" Click 'Help' to restart. ")
], -1));
var GL = Ic(() => createBaseVNode("p", null, 'Click "Next" to see the next item.', -1));
function WL(t13, e, r, n, a, i) {
  const o = Hr;
  return openBlock(), createElementBlock("div", {
    class: normalizeClass(["help-mode-dialog", { finish: r.lastItem }])
  }, [
    qL,
    r.lastItem ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
      UL,
      createBaseVNode("div", null, [
        createVNode(o, {
          class: "button",
          onClick: i.finishHelpMode
        }, {
          default: withCtx(() => [
            createTextVNode(" Finish ")
          ]),
          _: 1
        }, 8, ["onClick"])
      ])
    ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
      GL,
      createBaseVNode("div", null, [
        createVNode(o, {
          class: "button",
          onClick: i.showNext
        }, {
          default: withCtx(() => [
            createTextVNode(" Next ")
          ]),
          _: 1
        }, 8, ["onClick"]),
        createVNode(o, {
          class: "button secondary",
          onClick: i.finishHelpMode
        }, {
          default: withCtx(() => [
            createTextVNode(" Exit Help Mode ")
          ]),
          _: 1
        }, 8, ["onClick"])
      ])
    ], 64))
  ], 2);
}
var bA = Ur(KL, [["render", WL], ["__scopeId", "data-v-3efb89fb"]]);
var YL = (t13) => new Promise((e) => setTimeout(e, t13));
var jL = "https://citation.doi.org";
var ZL = [
  {
    label: "APA",
    value: "apa"
  },
  {
    label: "Chicago",
    value: "chicago-note-bibliography"
  },
  {
    label: "IEEE",
    value: "ieee"
  },
  {
    label: "Bibtex",
    value: "bibtex"
  }
];
var Yl = "apa";
var XL = 600;
var QL = {
  name: "ExternalResourceCard",
  props: {
    resources: {
      type: Array,
      default: () => []
    }
  },
  data: function() {
    return {
      pubMedReferences: [],
      openLibReferences: [],
      isbnDBReferences: [],
      referecesListContent: "",
      citationOptions: ZL,
      citationType: Yl,
      crosscite_host: jL
    };
  },
  watch: {
    resources: function(t13) {
      this.formatReferences([...t13]), this.getCitationText(Yl);
    }
  },
  computed: {
    referencesWithDOI: function() {
      return this.pubMedReferences.filter((e) => e.type === "doi" || e.doi).length;
    }
  },
  mounted: function() {
    this.formatReferences([...this.resources]), this.getCitationText(Yl);
  },
  methods: {
    showRelatedConnectivities: function(t13) {
      this.$emit("show-reference-connectivities", t13);
    },
    formatReferences: function(t13) {
      const e = this.extractNonPubMedReferences(t13), r = t13.filter((n) => !e.includes(n));
      this.pubMedReferences = r.map(
        (n) => typeof n == "object" ? this.extractPublicationIdFromURLString(n[0]) : this.extractPublicationIdFromURLString(n)
      ), this.pubMedReferences.forEach((n) => {
        if (n.type === "pmc") {
          const a = n.id;
          this.searchPMID(a).then((i) => {
            if (i && i.esearchresult) {
              const o = i.esearchresult.idlist || [];
              n.id = o[0], n.type = "pmid";
            }
          });
        }
      }), this.formatNonPubMedReferences(e).then((n) => {
        this.openLibReferences = n.filter((a) => a.type === "openlib"), this.isbnDBReferences = n.filter((a) => a.type === "isbndb"), this.formatOpenLibReferences();
      });
    },
    extractNonPubMedReferences: function(t13) {
      const e = [], r = this.getPubMedDomains();
      return t13.forEach((n) => {
        let a = 0;
        r.forEach((i) => {
          n.includes(i) && a++;
        }), a || e.push(n);
      }), e;
    },
    formatNonPubMedReferences: async function(t13) {
      const e = [], r = t13.filter((u) => u.indexOf("isbn") !== -1), n = r.map((u) => "ISBN:" + u.split("/").pop()), a = n.join(","), i = n.slice(), o = (u) => r.find((c) => c.includes(u)), s = `https://openlibrary.org/api/books?bibkeys=${a}&format=json`, l = await this.fetchData(s);
      for (const u in l) {
        const c = i.indexOf(u);
        i.splice(c, 1);
        const d = l[u].info_url, v = d.split("/"), h6 = v.indexOf("books"), f = v[h6 + 1], p = u.split(":")[1], m = o(p);
        e.push({
          id: p,
          type: "openlib",
          url: d,
          bookId: f,
          resource: m
        });
      }
      return i.forEach((u) => {
        const c = u.split(":")[1], d = `https://isbndb.com/book/${c}`, v = o(c);
        e.push({
          id: c,
          url: d,
          type: "isbndb",
          resource: v
        });
      }), e;
    },
    extractPublicationIdFromURLString: function(t13) {
      if (!t13) return;
      const e = decodeURIComponent(t13);
      let r = { id: "", type: "", citation: {}, resource: t13 };
      return this.getPubMedDomains().forEach((a) => {
        const i = e.lastIndexOf(a);
        i !== -1 && (r.id = e.slice(i + a.length), a === "doi.org/" ? r.type = "doi" : a === "pmc/articles/" ? r.type = "pmc" : r.type = "pmid");
      }), r.id === "" && (t13.includes("doi:") ? (r.id = this.stripPMIDPrefix(t13), r.type = "doi") : t13.includes("PMID:") && (r.id = this.stripPMIDPrefix(t13), r.type = "pmid")), r.id.endsWith("/") && (r.id = r.id.slice(0, -1)), r;
    },
    getPubMedDomains: function() {
      return [
        "doi.org/",
        "nih.gov/pubmed/",
        "pmc/articles/",
        "pubmed.ncbi.nlm.nih.gov/"
      ];
    },
    stripPMIDPrefix: function(t13) {
      return t13.split(":")[1];
    },
    onCitationFormatChange: function(t13) {
      this.citationType = t13, this.getCitationText(t13);
    },
    generateCitationText: function(t13, e) {
      const { id: r, type: n, doi: a } = t13;
      if (!(t13.citation && t13.citation[e]) && r)
        if (t13.citation[e] = "", t13.citation.error = null, n === "doi" || a) {
          const i = n === "doi" ? r : a;
          this.getCitationTextByDOI(i).then((o) => {
            const s = this.replaceLinkInText(o);
            t13.citation[e] = s, this.updateCopyContents();
          }).catch((o) => {
            t13.citation.error = {
              type: e,
              ref: "doi"
            };
          });
        } else n === "pmid" && this.getDOIFromPubMedID(r).then((i) => {
          if (i != null && i.result) {
            const o = i.result[r], l = ((o == null ? void 0 : o.articleids) || []).find((c) => c.idtype === "doi"), u = l == null ? void 0 : l.value;
            if (u)
              t13.doi = u, this.getCitationTextByDOI(u).then((c) => {
                const d = this.replaceLinkInText(c);
                t13.citation[e] = d, this.updateCopyContents();
              }).catch((c) => {
                t13.citation.error = {
                  type: e,
                  ref: "doi"
                };
              });
            else {
              const { title: c, pubdate: d, authors: v } = o, h6 = v ? v.map((p) => p.name) : [], f = this.formatCopyReference({
                title: c || "",
                date: d || "",
                authors: h6,
                url: `https://pubmed.ncbi.nlm.nih.gov/${r}`
              });
              t13.citation[e] = f, this.updateCopyContents();
            }
          }
        }).catch((i) => {
          t13.citation.error = {
            type: e,
            ref: "pubmed"
          };
        });
    },
    getCitationText: function(t13) {
      async function e(r) {
        for (let n = 0; n < r.pubMedReferences.length; n++)
          r.generateCitationText(r.pubMedReferences[n], t13), r.pubMedReferences.length > 3 && n < r.pubMedReferences.length - 1 && await YL(XL);
      }
      e(this);
    },
    reloadCitation: function(t13) {
      this.generateCitationText(t13, this.citationType);
    },
    updateCopyContents: function() {
      const t13 = this.citationOptions.find((n) => n.value === this.citationType);
      let e = "";
      const r = [];
      if (this.referencesWithDOI && (e = t13 == null ? void 0 : t13.label), this.pubMedReferences.forEach((n) => {
        r.push(n.citation[this.citationType]);
      }), this.openLibReferences.forEach((n) => {
        r.push(this.formatCopyReference(n));
      }), this.isbnDBReferences.forEach((n) => {
        r.push(n.url);
      }), r.length) {
        const a = `<ul>${r.map((o) => `<li>${o}</li>`).join(`
`)}</ul>`, i = "<div><strong>References</strong></div>";
        this.referecesListContent = i + `
` + a;
      }
      this.$emit("references-loaded", {
        style: e,
        list: r
      });
    },
    replaceLinkInText: function(t13) {
      const e = "https://";
      let r = t13.split(e)[1];
      if (r) {
        r = r.split(" ")[0], r = r.trim(), r.endsWith(".") && (r = r.substring(0, r.length - 1));
        const n = e + r, a = `<a href="${n}" target="_blank">${n}</a>`;
        return t13.replace(n, a);
      }
      return t13;
    },
    searchPMID: async function(t13) {
      const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t13}&format=json`;
      return await this.fetchData(e);
    },
    getCitationTextByDOI: async function(t13) {
      const e = `${this.crosscite_host}/format?doi=${t13}&style=${this.citationType}&lang=en-US`;
      return await this.fetchData(e, "text");
    },
    getDOIFromPubMedID: async function(t13) {
      const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t13}&format=json`;
      return await this.fetchData(e);
    },
    formatOpenLibReferences: function() {
      this.openLibReferences.forEach((t13) => {
        const { bookId: e } = t13;
        this.getBookData(e).then((r) => {
          const { title: n, authors: a, publish_date: i } = r;
          n && (t13.title = n), i && (t13.date = i), a && (t13.authors = [], a.forEach((o) => {
            this.getBookAuthor(o.key).then((s) => {
              const { name: l } = s;
              l && (t13.authors.push(l), this.updateCopyContents());
            });
          })), this.updateCopyContents();
        });
      });
    },
    getBookData: async function(t13) {
      const e = `https://openlibrary.org/books/${t13}.json`;
      return await this.fetchData(e);
    },
    getBookAuthor: async function(t13) {
      const e = `https://openlibrary.org${t13}.json`;
      return await this.fetchData(e);
    },
    formatCopyReference: function(t13) {
      const e = [], { title: r, date: n, authors: a, url: i } = t13;
      return r && e.push(r), n && e.push(`(${n})`), a && e.push(`- ${a.join(", ")}`), e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`), e.join(" ");
    },
    fetchData: async function(t13, e) {
      try {
        const r = await fetch(t13);
        if (!r.ok)
          throw new Error(`Response status: ${r.status}`);
        return e === "text" ? await r.text() : await r.json();
      } catch (r) {
        throw new Error(r);
      }
    }
  }
};
var Oa = (t13) => (pushScopeId("data-v-44a32829"), t13 = t13(), popScopeId(), t13);
var JL = { class: "resource-container" };
var eI = { class: "attribute-title-container" };
var tI = Oa(() => createBaseVNode("div", { class: "attribute-title" }, "References", -1));
var rI = { class: "copy-button" };
var nI = {
  key: 0,
  class: "citation-tabs"
};
var aI = { class: "citation-list" };
var iI = Oa(() => createBaseVNode("span", null, "Internal Server Error", -1));
var oI = Oa(() => createBaseVNode("br", null, null, -1));
var sI = Oa(() => createBaseVNode("br", null, null, -1));
var lI = ["href"];
var uI = Oa(() => createBaseVNode("br", null, null, -1));
var cI = Oa(() => createBaseVNode("span", null, "Sorry, something went wrong.", -1));
var dI = Oa(() => createBaseVNode("br", null, null, -1));
var fI = ["onClick"];
var vI = ["innerHTML"];
var hI = { class: "reference-button-container" };
var pI = ["innerHTML"];
var gI = { class: "reference-button-container" };
var mI = ["href"];
var yI = { class: "reference-button-container" };
function bI(t13, e, r, n, a, i) {
  const o = Gh, s = Hr;
  return openBlock(), createElementBlock("div", JL, [
    createBaseVNode("div", eI, [
      tI,
      createBaseVNode("div", rI, [
        createVNode(o, {
          label: "Copy list to clipboard",
          content: t13.referecesListContent
        }, null, 8, ["content"])
      ])
    ]),
    i.referencesWithDOI ? (openBlock(), createElementBlock("div", nI, [
      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.citationOptions, (l) => (openBlock(), createBlock(s, {
        link: "",
        key: l.value,
        type: t13.citationType === l.value ? "primary" : "",
        onClick: (u) => i.onCitationFormatChange(l.value)
      }, {
        default: withCtx(() => [
          createTextVNode(toDisplayString(l.label), 1)
        ]),
        _: 2
      }, 1032, ["type", "onClick"]))), 128))
    ])) : createCommentVNode("", true),
    createBaseVNode("ul", aI, [
      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.pubMedReferences, (l) => {
        var u, c, d, v;
        return openBlock(), createElementBlock("li", {
          key: l.id,
          class: normalizeClass({
            loading: l.citation && !l.citation.error && l.citation[t13.citationType] === "",
            error: l.citation && l.citation.error
          })
        }, [
          l.citation ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            ((u = l.citation.error) == null ? void 0 : u.ref) === "doi" && ((c = l.citation.error) == null ? void 0 : c.type) === t13.citationType ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
              iI,
              oI,
              createTextVNode(" Sorry, something went wrong."),
              sI,
              createTextVNode(" The dataset citation generator ("),
              createBaseVNode("a", {
                href: t13.crosscite_host,
                target: "_blank"
              }, toDisplayString(t13.crosscite_host), 9, lI),
              createTextVNode(") encountered an internal error and was unable to complete your request."),
              uI,
              createTextVNode(" Please come back later. ")
            ], 64)) : ((d = l.citation.error) == null ? void 0 : d.ref) === "pubmed" && ((v = l.citation.error) == null ? void 0 : v.type) === t13.citationType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
              cI,
              dI,
              createTextVNode(" Please try again. "),
              createBaseVNode("span", {
                class: "reload-button",
                onClick: (h6) => i.reloadCitation(l)
              }, "Reload", 8, fI)
            ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
              createBaseVNode("span", {
                innerHTML: l.citation[t13.citationType]
              }, null, 8, vI),
              createBaseVNode("div", hI, [
                createVNode(s, {
                  class: "reference-icon-button",
                  size: "small",
                  onClick: (h6) => i.showRelatedConnectivities(l.resource)
                }, {
                  default: withCtx(() => [
                    createTextVNode(" Show related connectivities ")
                  ]),
                  _: 2
                }, 1032, ["onClick"])
              ]),
              createVNode(o, {
                content: l.citation[t13.citationType]
              }, null, 8, ["content"])
            ], 64))
          ], 64)) : createCommentVNode("", true)
        ], 2);
      }), 128)),
      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.openLibReferences, (l) => (openBlock(), createElementBlock("li", null, [
        createBaseVNode("div", {
          innerHTML: i.formatCopyReference(l)
        }, null, 8, pI),
        createBaseVNode("div", gI, [
          createVNode(s, {
            class: "reference-icon-button",
            size: "small",
            onClick: (u) => i.showRelatedConnectivities(l.resource)
          }, {
            default: withCtx(() => [
              createTextVNode(" Show related connectivities ")
            ]),
            _: 2
          }, 1032, ["onClick"])
        ]),
        createVNode(o, {
          content: i.formatCopyReference(l)
        }, null, 8, ["content"])
      ]))), 256)),
      (openBlock(true), createElementBlock(Fragment, null, renderList(t13.isbnDBReferences, (l) => (openBlock(), createElementBlock("li", null, [
        createBaseVNode("a", {
          href: l.url,
          target: "_blank"
        }, toDisplayString(l.url), 9, mI),
        createBaseVNode("div", yI, [
          createVNode(s, {
            class: "reference-icon-button",
            size: "small",
            onClick: (u) => i.showRelatedConnectivities(l.resource)
          }, {
            default: withCtx(() => [
              createTextVNode(" Show related connectivities ")
            ]),
            _: 2
          }, 1032, ["onClick"])
        ]),
        createVNode(o, {
          content: l.url
        }, null, 8, ["content"])
      ]))), 256))
    ])
  ]);
}
var wI = Ur(QL, [["render", bI], ["__scopeId", "data-v-44a32829"]]);
function CI(t13) {
  return { all: t13 = t13 || /* @__PURE__ */ new Map(), on: function(e, r) {
    var n = t13.get(e);
    n ? n.push(r) : t13.set(e, [r]);
  }, off: function(e, r) {
    var n = t13.get(e);
    n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t13.set(e, []));
  }, emit: function(e, r) {
    var n = t13.get(e);
    n && n.slice().map(function(a) {
      a(r);
    }), (n = t13.get("*")) && n.slice().map(function(a) {
      a(e, r);
    });
  } };
}
var ys = new CI();
var xI = (t13) => t13.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase());
var EI = function(t13) {
  return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : "";
};
var kI = {
  name: "ProvenancePopup",
  props: {
    tooltipEntry: {
      type: Object,
      default: () => ({
        destinations: [],
        origins: [],
        components: [],
        destinationsWithDatasets: [],
        originsWithDatasets: [],
        componentsWithDatasets: [],
        resource: void 0
      })
    }
  },
  inject: ["getFeaturesAlert"],
  data: function() {
    return {
      controller: void 0,
      activeSpecies: void 0,
      pubmedSearchUrl: "",
      loading: false,
      showToolip: false,
      showDetails: false,
      originDescriptions: {
        motor: "is the location of the initial cell body of the circuit",
        sensory: "is the location of the initial cell body in the PNS circuit"
      },
      componentsWithDatasets: [],
      uberons: [{ id: void 0, name: void 0 }]
    };
  },
  computed: {
    featuresAlert() {
      return this.getFeaturesAlert();
    },
    resources: function() {
      let t13 = [];
      return this.tooltipEntry && this.tooltipEntry.hyperlinks && (t13 = this.tooltipEntry.hyperlinks), t13;
    },
    originDescription: function() {
      return this.tooltipEntry && this.tooltipEntry.title && this.tooltipEntry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory;
    },
    provSpeciesDescription: function() {
      let t13 = "Studied in";
      return this.tooltipEntry.provenanceTaxonomyLabel.forEach((e) => {
        t13 += ` ${e},`;
      }), t13 = t13.slice(0, -1), t13 += " species", t13;
    }
  },
  methods: {
    titleCase: function(t13) {
      return xI(t13);
    },
    capitalise: function(t13) {
      return EI(t13);
    },
    openUrl: function(t13) {
      window.open(t13, "_blank");
    },
    openAll: function() {
      ys.emit("onActionClick", {
        type: "Facets",
        labels: this.tooltipEntry.componentsWithDatasets.map((t13) => t13.name)
      });
    },
    openAxons: function() {
      ys.emit("onActionClick", {
        type: "Facets",
        labels: this.tooltipEntry.destinationsWithDatasets.map((t13) => t13.name)
      });
    },
    openDendrites: function() {
      ys.emit("onActionClick", {
        type: "Facets",
        labels: this.tooltipEntry.originsWithDatasets.map((t13) => t13.name)
      });
    },
    pubmedSearchUrlUpdate: function(t13) {
      this.pubmedSearchUrl = t13;
    }
  }
};
var Ti = (t13) => (pushScopeId("data-v-3d217adc"), t13 = t13(), popScopeId(), t13);
var SI = {
  key: 0,
  class: "main"
};
var TI = {
  key: 0,
  class: "block"
};
var _I = { class: "title" };
var DI = {
  key: 0,
  class: "subtitle"
};
var PI = {
  key: 1,
  class: "block"
};
var OI = { class: "title" };
var LI = {
  key: 2,
  class: "attribute-title-container"
};
var II = Ti(() => createBaseVNode("span", { class: "attribute-title" }, "Alert", -1));
var AI = { style: { "word-break": "keep-all" } };
var FI = { class: "content-container scrollbar" };
var MI = {
  key: 0,
  class: "block"
};
var BI = { class: "attribute-title-container" };
var NI = Ti(() => createBaseVNode("span", { class: "attribute-title" }, "Origin", -1));
var RI = { style: { "word-break": "keep-all" } };
var $I = Ti(() => createBaseVNode("i", null, "Origin", -1));
var zI = ["origin-item-label"];
var VI = {
  key: 0,
  class: "separator"
};
var HI = {
  key: 1,
  class: "block"
};
var KI = Ti(() => createBaseVNode("div", { class: "attribute-title-container" }, [
  createBaseVNode("div", { class: "attribute-title" }, "Components")
], -1));
var qI = ["component-item-label"];
var UI = {
  key: 0,
  class: "separator"
};
var GI = {
  key: 2,
  class: "block"
};
var WI = { class: "attribute-title-container" };
var YI = Ti(() => createBaseVNode("span", { class: "attribute-title" }, "Destination", -1));
var jI = Ti(() => createBaseVNode("span", { style: { "word-break": "keep-all" } }, [
  createBaseVNode("i", null, "Destination"),
  createTextVNode(" is where the axons terminate ")
], -1));
var ZI = ["destination-item-label"];
var XI = {
  key: 0,
  class: "separator"
};
function QI(t13, e, r, n, a, i) {
  const o = O2, s = Ht, l = el, u = qv, c = Ws, d = Hr, v = wI, h6 = oc;
  return r.tooltipEntry ? withDirectives((openBlock(), createElementBlock("div", SI, [
    r.tooltipEntry.title ? (openBlock(), createElementBlock("div", TI, [
      createBaseVNode("div", _I, toDisplayString(i.capitalise(r.tooltipEntry.title)), 1),
      r.tooltipEntry.provenanceTaxonomyLabel && r.tooltipEntry.provenanceTaxonomyLabel.length > 0 ? (openBlock(), createElementBlock("div", DI, toDisplayString(i.provSpeciesDescription), 1)) : createCommentVNode("", true)
    ])) : (openBlock(), createElementBlock("div", PI, [
      createBaseVNode("div", OI, toDisplayString(r.tooltipEntry.featureId), 1)
    ])),
    i.featuresAlert ? (openBlock(), createElementBlock("div", LI, [
      II,
      createVNode(l, {
        width: "250",
        trigger: "hover",
        teleported: false,
        "popper-class": "popover-origin-help"
      }, {
        reference: withCtx(() => [
          createVNode(s, { class: "info" }, {
            default: withCtx(() => [
              createVNode(o)
            ]),
            _: 1
          })
        ]),
        default: withCtx(() => [
          createBaseVNode("span", AI, toDisplayString(i.featuresAlert), 1)
        ]),
        _: 1
      })
    ])) : createCommentVNode("", true),
    withDirectives(createBaseVNode("div", {
      class: "hide",
      id: "hide-path-info",
      onClick: e[0] || (e[0] = (f) => t13.showDetails = false)
    }, [
      createTextVNode(" Hide path information "),
      createVNode(s, null, {
        default: withCtx(() => [
          createVNode(u)
        ]),
        _: 1
      })
    ], 512), [
      [vShow, t13.showDetails]
    ]),
    withDirectives(createBaseVNode("div", {
      class: "hide",
      id: "show-path-info",
      onClick: e[1] || (e[1] = (f) => t13.showDetails = true)
    }, [
      createTextVNode(" Show path information "),
      createVNode(s, null, {
        default: withCtx(() => [
          createVNode(c)
        ]),
        _: 1
      })
    ], 512), [
      [vShow, !t13.showDetails]
    ]),
    createVNode(Transition, { name: "slide-fade" }, {
      default: withCtx(() => [
        withDirectives(createBaseVNode("div", FI, [
          createTextVNode(toDisplayString(r.tooltipEntry.paths) + " ", 1),
          r.tooltipEntry.origins && r.tooltipEntry.origins.length > 0 ? (openBlock(), createElementBlock("div", MI, [
            createBaseVNode("div", BI, [
              NI,
              createVNode(l, {
                width: "250",
                trigger: "hover",
                teleported: false,
                "popper-class": "popover-origin-help"
              }, {
                reference: withCtx(() => [
                  createVNode(s, { class: "info" }, {
                    default: withCtx(() => [
                      createVNode(o)
                    ]),
                    _: 1
                  })
                ]),
                default: withCtx(() => [
                  createBaseVNode("span", RI, [
                    $I,
                    createTextVNode(" " + toDisplayString(i.originDescription), 1)
                  ])
                ]),
                _: 1
              })
            ]),
            (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.origins, (f, p) => (openBlock(), createElementBlock("div", {
              class: "attribute-content",
              "origin-item-label": f,
              key: f
            }, [
              createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1),
              p != r.tooltipEntry.origins.length - 1 ? (openBlock(), createElementBlock("div", VI)) : createCommentVNode("", true)
            ], 8, zI))), 128)),
            withDirectives(createVNode(d, {
              class: "button",
              id: "open-dendrites-button",
              onClick: i.openDendrites
            }, {
              default: withCtx(() => [
                createTextVNode(" Explore origin data ")
              ]),
              _: 1
            }, 8, ["onClick"]), [
              [
                vShow,
                r.tooltipEntry.originsWithDatasets && r.tooltipEntry.originsWithDatasets.length > 0
              ]
            ])
          ])) : createCommentVNode("", true),
          r.tooltipEntry.components && r.tooltipEntry.components.length > 0 ? (openBlock(), createElementBlock("div", HI, [
            KI,
            (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.components, (f, p) => (openBlock(), createElementBlock("div", {
              class: "attribute-content",
              "component-item-label": f,
              key: f
            }, [
              createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1),
              p != r.tooltipEntry.components.length - 1 ? (openBlock(), createElementBlock("div", UI)) : createCommentVNode("", true)
            ], 8, qI))), 128))
          ])) : createCommentVNode("", true),
          r.tooltipEntry.destinations && r.tooltipEntry.destinations.length > 0 ? (openBlock(), createElementBlock("div", GI, [
            createBaseVNode("div", WI, [
              YI,
              createVNode(l, {
                width: "250",
                trigger: "hover",
                teleported: false,
                "popper-class": "popover-origin-help"
              }, {
                reference: withCtx(() => [
                  createVNode(s, { class: "info" }, {
                    default: withCtx(() => [
                      createVNode(o)
                    ]),
                    _: 1
                  })
                ]),
                default: withCtx(() => [
                  jI
                ]),
                _: 1
              })
            ]),
            (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.destinations, (f, p) => (openBlock(), createElementBlock("div", {
              class: "attribute-content",
              "destination-item-label": f,
              key: f
            }, [
              createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1),
              p != r.tooltipEntry.destinations.length - 1 ? (openBlock(), createElementBlock("div", XI)) : createCommentVNode("", true)
            ], 8, ZI))), 128)),
            withDirectives(createVNode(d, {
              class: "button",
              onClick: i.openAxons
            }, {
              default: withCtx(() => [
                createTextVNode(" Explore destination data ")
              ]),
              _: 1
            }, 8, ["onClick"]), [
              [
                vShow,
                r.tooltipEntry.destinationsWithDatasets && r.tooltipEntry.destinationsWithDatasets.length > 0
              ]
            ])
          ])) : createCommentVNode("", true),
          withDirectives(createVNode(d, {
            class: "button",
            onClick: i.openAll
          }, {
            default: withCtx(() => [
              createTextVNode(" Search for data on components ")
            ]),
            _: 1
          }, 8, ["onClick"]), [
            [
              vShow,
              r.tooltipEntry.componentsWithDatasets && r.tooltipEntry.componentsWithDatasets.length > 0
            ]
          ]),
          i.resources.length ? (openBlock(), createBlock(v, {
            key: 3,
            resources: i.resources
          }, null, 8, ["resources"])) : createCommentVNode("", true)
        ], 512), [
          [vShow, t13.showDetails]
        ])
      ]),
      _: 1
    })
  ])), [
    [h6, t13.loading]
  ]) : createCommentVNode("", true);
}
var JI = Ur(kI, [["render", QI], ["__scopeId", "data-v-3d217adc"]]);
var eA = {
  name: "Tooltip",
  props: {
    tooltipEntry: {
      type: Object
    },
    annotationDisplay: {
      type: Boolean,
      default: false
    },
    annotationEntry: {
      type: Object
    }
  },
  mounted: function() {
    ys.on("onActionClick", (t13) => {
      this.$emit("onActionClick", t13);
    });
  }
};
var tA = {
  class: "tooltip-container",
  id: "tooltip-container"
};
function rA(t13, e, r, n, a, i) {
  const o = iT, s = JI;
  return openBlock(), createElementBlock("div", tA, [
    r.annotationDisplay ? (openBlock(), createBlock(o, {
      key: 0,
      annotationEntry: r.annotationEntry,
      onAnnotation: e[0] || (e[0] = (l) => t13.$emit("annotation", l))
    }, null, 8, ["annotationEntry"])) : (openBlock(), createBlock(s, {
      key: 1,
      tooltipEntry: r.tooltipEntry
    }, null, 8, ["tooltipEntry"]))
  ]);
}
var wA = Ur(eA, [["render", rA], ["__scopeId", "data-v-229b3988"]]);
var nA = {
  name: "TreeControls",
  props: {
    /**
     * The type of map that the TreeControls is used. Either "flatmap" or "scaffold".
     */
    mapType: {
      type: String,
      required: true
    },
    isReady: {
      type: Boolean,
      default: true
    },
    /**
     * The title of the TreeControls.
     */
    title: {
      type: String
    },
    /**
     * The data of the tree.
     */
    treeData: {
      type: Array,
      default: function() {
        return [];
      }
    },
    showColourPicker: {
      type: Boolean,
      default: false
    },
    /**
     * The active node of the tree.
     */
    active: {
      type: [String, Array],
      required: true
    },
    /**
     * The hover node of the tree.
     */
    hover: {
      type: [String, Array],
      required: true
    },
    enableFilter: {
      type: Boolean,
      default: true
    }
  },
  data: function() {
    return {
      defaultExpandedKeys: ["All"],
      filterText: "",
      myPopperClass: "hide-scaffold-colour-popup",
      tooltipVisible: false,
      tooltipLabel: "",
      tooltipAtBottom: false
    };
  },
  computed: {
    isFlatmap: function() {
      return this.mapType === "flatmap";
    },
    isScaffold: function() {
      return this.mapType === "scaffold";
    },
    nodeKey: function() {
      if (this.isFlatmap)
        return "key";
      if (this.isScaffold)
        return "id";
    },
    expandedKeys: function() {
      if (this.isFlatmap)
        return this.defaultExpandedKeys;
      if (this.isScaffold)
        return [];
    }
  },
  watch: {
    showColourPicker: {
      immediate: true,
      handler: function() {
        this.showColourPicker ? this.myPopperClass = "showPicker" : this.myPopperClass = "hide-scaffold-colour-popup";
      }
    },
    filterText: {
      handler: function(t13) {
        this.$refs.regionTree && this.$refs.regionTree.filter(t13);
      }
    }
  },
  methods: {
    filterNode: function(t13, e) {
      return t13 ? e.label ? e.label.toLowerCase().includes(t13.toLowerCase()) : false : true;
    },
    setColour: function(t13, e) {
      this.$emit("setColour", t13, e);
    },
    getBackgroundStyles: function(t13) {
      return "colour" in t13 ? { background: t13.colour } : {};
    },
    nodeIsActive: function(t13) {
      return this.active === t13.models;
    },
    nodeIsHover: function(t13) {
      return this.hover === t13.models;
    },
    changeActiveByNode: function(t13, e = false) {
      this.isFlatmap ? t13.models && this.$emit("changeActive", t13.models) : this.isScaffold && (t13.isPrimitives || t13.isRegion) && this.$emit("changeActive", t13, e);
    },
    changeHoverByNode: function(t13, e = false) {
      this.isFlatmap ? t13.models && this.$emit("changeHover", t13.models) : this.isScaffold && t13.isPrimitives && this.$emit("changeHover", t13, e);
    },
    checkChanged: function(t13, e) {
      if (this.isFlatmap) {
        const r = e.checkedKeys.includes(t13.key);
        t13.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t13.key, value: r });
      } else this.isScaffold && this.$emit("checkChanged", t13, e);
    },
    displayTooltip: function(t13, e, r) {
      const a = r.target.closest(".el-tree-node__content"), i = a.clientWidth, o = a.getBoundingClientRect().x, s = a.querySelector(".lastChildInItem");
      let l = 0;
      if (s) {
        const c = s.getBoundingClientRect();
        l = c.x + c.width - o;
      }
      const u = l > i;
      this.tooltipVisible = u && e, this.tooltipLabel = t13, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight;
    }
  },
  unmounted: function() {
    this.sortedPrimitiveGroups = void 0;
  },
  mounted: function() {
    this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText);
  }
};
var aA = { class: "selections-container" };
var iA = { class: "title-text" };
var oA = {
  class: "tree-container",
  ref: "treeContainer"
};
var sA = { class: "tooltip-text" };
var lA = ["onClick", "onMouseover", "onMouseenter"];
var uA = ["onClick", "onMouseover", "onMouseenter"];
var cA = { class: "lastChildInItem" };
var dA = {
  key: 0,
  class: "node-options"
};
function fA(t13, e, r, n, a, i) {
  const o = So, s = Eo, l = Js, u = el, c = Tk, d = OS, v = oc;
  return openBlock(), createElementBlock("div", aA, [
    r.title ? (openBlock(), createBlock(l, { key: 0 }, {
      default: withCtx(() => [
        createVNode(o, { span: 12 }, {
          default: withCtx(() => [
            createBaseVNode("div", iA, toDisplayString(r.title), 1)
          ]),
          _: 1
        }),
        r.enableFilter ? (openBlock(), createBlock(o, {
          key: 0,
          span: 12
        }, {
          default: withCtx(() => [
            createBaseVNode("div", null, [
              createVNode(s, {
                class: "tree-filter-input",
                modelValue: t13.filterText,
                "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.filterText = h6),
                placeholder: "Filter " + r.title
              }, null, 8, ["modelValue", "placeholder"])
            ])
          ]),
          _: 1
        })) : createCommentVNode("", true)
      ]),
      _: 1
    })) : createCommentVNode("", true),
    createBaseVNode("div", oA, [
      createBaseVNode("div", {
        class: normalizeClass(["tree-tooltip", t13.tooltipAtBottom ? "bottom" : ""])
      }, [
        createVNode(u, {
          ref: "tooltip",
          visible: t13.tooltipVisible && t13.tooltipLabel !== "",
          placement: "top",
          "show-arrow": false,
          teleported: false,
          trigger: "manual",
          "popper-class": "tree-tooltip-popper",
          "virtual-triggering": "",
          width: 260
        }, {
          default: withCtx(() => [
            createBaseVNode("div", sA, toDisplayString(t13.tooltipLabel), 1)
          ]),
          _: 1
        }, 8, ["visible"])
      ], 2),
      withDirectives((openBlock(), createBlock(d, {
        ref: "regionTree",
        "element-loading-background": "rgba(0, 0, 0, 0.3)",
        "show-checkbox": "",
        "node-key": i.nodeKey,
        data: r.treeData,
        "check-strictly": false,
        "expand-on-click-node": false,
        "render-after-expand": false,
        "default-expanded-keys": i.expandedKeys,
        onCheck: i.checkChanged,
        indent: 8,
        "filter-node-method": i.filterNode,
        class: normalizeClass([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""])
      }, {
        default: withCtx(({ node: h6, data: f }) => [
          r.mapType === "flatmap" ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: normalizeClass(["region-tree-node", {
              activeItem: i.nodeIsActive(f),
              hoverItem: i.nodeIsHover(f)
            }]),
            onClick: (p) => i.changeActiveByNode(f),
            onMouseover: (p) => i.changeHoverByNode(f, false),
            onMouseenter: (p) => i.displayTooltip(h6.label, true, p),
            onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", false, p))
          }, [
            createBaseVNode("div", {
              style: normalizeStyle(i.getBackgroundStyles(f)),
              class: "lastChildInItem"
            }, toDisplayString(h6.label), 5)
          ], 42, lA)) : r.mapType === "scaffold" ? (openBlock(), createElementBlock("span", {
            key: 1,
            class: normalizeClass(["region-tree-node", {
              activeItem: r.active.includes(f.id),
              hoverItem: r.hover.includes(f.id)
            }]),
            onClick: (p) => i.changeActiveByNode(f, true),
            onMouseover: (p) => i.changeHoverByNode(f, true, p),
            onMouseenter: (p) => i.displayTooltip(h6.label, true, p),
            onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", false, p))
          }, [
            f.isPrimitives ? (openBlock(), createBlock(c, {
              key: 0,
              class: normalizeClass({ "show-picker": r.showColourPicker }),
              modelValue: f.activeColour,
              "onUpdate:modelValue": (p) => f.activeColour = p,
              size: "small",
              "popper-class": t13.myPopperClass,
              onChange: (p) => i.setColour(f, p)
            }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "popper-class", "onChange"])) : createCommentVNode("", true),
            createBaseVNode("div", cA, [
              createBaseVNode("span", null, toDisplayString(h6.label), 1),
              f.isTextureSlides ? (openBlock(), createElementBlock("span", dA, " (Texture) ")) : createCommentVNode("", true)
            ])
          ], 42, uA)) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [
        [v, !r.isReady]
      ])
    ], 512)
  ]);
}
var CA = Ur(nA, [["render", fA], ["__scopeId", "data-v-823a8388"]]);

export {
  Gh,
  iT,
  pA,
  mA,
  yA,
  bA,
  wI,
  wA,
  CA
};
/*! Bundled license information:

@abi-software/map-utilities/dist/map-utilities.js:
  (**
  * @vue/shared v3.4.27
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
  * @license MIT
  **)
  (*! Element Plus Icons Vue v2.3.1 *)
  (*!
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
  *)
  (*!
  Event object based on jQuery events, MIT license
  
  https://jquery.org/license/
  https://tldrlegal.com/license/mit-license
  https://github.com/jquery/jquery/blob/master/src/event.js
  *)
  (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
  (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
*/
//# sourceMappingURL=chunk-SR72G2KZ.js.map